instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
False
idxed_docs_results: list[dict] = []
idxed_blogs_results: list[dict] = []
@rx.event(temporal=True)
def user_query(self, value: str):
self.query = value.replace("rx.", "")
@rx.event(temporal=True)
def reset_search(self):
"""Reset state variables."""
self.idxed_blo... |
return
try:
async with self:
self.is_fetching = True
yield
client = typesense.Client(TYPESENSE_CONFIG)
search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
... | self.idxed_blogs_results = [] |
=True)
def user_query(self, value: str):
self.query = value.replace("rx.", "")
@rx.event(temporal=True)
def reset_search(self):
"""Reset state variables."""
self.idxed_blogs_results = []
self.idxed_docs_results = []
self.query = ""
@rx.event(temporal=True)
a... |
yield
client = typesense.Client(TYPESENSE_CONFIG)
search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,... | self.is_fetching = True |
uery = value.replace("rx.", "")
@rx.event(temporal=True)
def reset_search(self):
"""Reset state variables."""
self.idxed_blogs_results = []
self.idxed_docs_results = []
self.query = ""
@rx.event(temporal=True)
async def apply_filter_search(self, selected_filter: str):
... |
search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,
"sort_by": "_text_match:desc",
"text_match_thr... | client = typesense.Client(TYPESENSE_CONFIG) |
rue)
def reset_search(self):
"""Reset state variables."""
self.idxed_blogs_results = []
self.idxed_docs_results = []
self.query = ""
@rx.event(temporal=True)
async def apply_filter_search(self, selected_filter: str):
"""Re-run search with new filter."""
if se... |
if self.selected_filter != "All Content":
if self.selected_filter == "Blog Posts":
search_params["filter_by"] = "section:=Blog"
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
... | search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,
"sort_by": "_text_match:desc",
"text_match_threshold": "0.6"... |
ts."""
async with self:
if not self.query.strip():
self.idxed_docs_results = []
self.idxed_blogs_results = []
return
try:
async with self:
self.is_fetching = True
yield
client = typesens... |
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
... | if self.selected_filter != "All Content":
if self.selected_filter == "Blog Posts":
search_params["filter_by"] = "section:=Blog"
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
... |
ery.strip():
self.idxed_docs_results = []
self.idxed_blogs_results = []
return
try:
async with self:
self.is_fetching = True
yield
client = typesense.Client(TYPESENSE_CONFIG)
search_params = {
... |
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
... | if self.selected_filter == "Blog Posts":
search_params["filter_by"] = "section:=Blog"
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
section_filter = " || ".join(f"section:={s}" for s ... |
self.idxed_blogs_results = []
return
try:
async with self:
self.is_fetching = True
yield
client = typesense.Client(TYPESENSE_CONFIG)
search_params = {
"q": self.query,
"query_by": ... |
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_params["filter_by"] = section_filter
result = cl... | search_params["filter_by"] = "section:=Blog" |
async with self:
self.is_fetching = True
yield
client = typesense.Client(TYPESENSE_CONFIG)
search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
... |
if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_params["filter_by"] = section_filter
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_r... | sections = self._get_sections_for_cluster(self.selected_filter) |
client = typesense.Client(TYPESENSE_CONFIG)
search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,
"sort_... |
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
... | if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_params["filter_by"] = section_filter |
t(TYPESENSE_CONFIG)
search_params = {
"q": self.query,
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,
"sort_by": "_text_match:desc",
... |
search_params["filter_by"] = section_filter
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc =... | section_filter = " || ".join(f"section:={s}" for s in sections) |
"query_by": "title,content,headings,components",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,
"sort_by": "_text_match:desc",
"text_match_threshold": "0.6",
"exhaustive_search": True,
... |
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
... | search_params["filter_by"] = section_filter |
s",
"query_by_weights": "6,8,3,12",
"per_page": 15,
"num_typos": 2,
"sort_by": "_text_match:desc",
"text_match_threshold": "0.6",
"exhaustive_search": True,
"highlight_fields": "content",
"hig... |
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(format... | result = client.collections["docs"].documents.search(search_params) |
5,
"num_typos": 2,
"sort_by": "_text_match:desc",
"text_match_threshold": "0.6",
"exhaustive_search": True,
"highlight_fields": "content",
"highlight_full_fields": "content,components",
"highlight_start_tag":... |
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
... | docs_results = [] |
: 2,
"sort_by": "_text_match:desc",
"text_match_threshold": "0.6",
"exhaustive_search": True,
"highlight_fields": "content",
"highlight_full_fields": "content,components",
"highlight_start_tag": "<mark>",
"hi... |
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_resul... | blog_results = [] |
"_text_match:desc",
"text_match_threshold": "0.6",
"exhaustive_search": True,
"highlight_fields": "content",
"highlight_full_fields": "content,components",
"highlight_start_tag": "<mark>",
"highlight_end_tag": "</mark>",
... |
async with self:
self.idxed_docs_results = docs_results
self.idxed_blogs_results = blog_results
self.is_fetching = False
except Exception:
async with self:
self.idxed_docs_results = []
self.idxed_blogs_res... | for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_results.append(form... |
match_threshold": "0.6",
"exhaustive_search": True,
"highlight_fields": "content",
"highlight_full_fields": "content,components",
"highlight_start_tag": "<mark>",
"highlight_end_tag": "</mark>",
"snippet_threshold": 30,
... |
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_results.append(formatted_doc)
async with self:
self.id... | doc = hit["document"] |
"exhaustive_search": True,
"highlight_fields": "content",
"highlight_full_fields": "content,components",
"highlight_start_tag": "<mark>",
"highlight_end_tag": "</mark>",
"snippet_threshold": 30,
}
if self.selecte... |
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_results.append(formatted_doc)
async with self:
self.idxed_docs_results = docs_results
self.idxed_blogs_results = blog_resu... | formatted_doc = self._format_result(doc, hit.get("highlights", [])) |
"highlight_full_fields": "content,components",
"highlight_start_tag": "<mark>",
"highlight_end_tag": "</mark>",
"snippet_threshold": 30,
}
if self.selected_filter != "All Content":
if self.selected_filter == "Blog Posts":
... |
async with self:
self.idxed_docs_results = docs_results
self.idxed_blogs_results = blog_results
self.is_fetching = False
except Exception:
async with self:
self.idxed_docs_results = []
self.idxed_blogs_res... | if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_results.append(formatted_doc) |
if self.selected_filter != "All Content":
if self.selected_filter == "Blog Posts":
search_params["filter_by"] = "section:=Blog"
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
... |
self.idxed_blogs_results = blog_results
self.is_fetching = False
except Exception:
async with self:
self.idxed_docs_results = []
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(... | self.idxed_docs_results = docs_results |
if self.selected_filter == "Blog Posts":
search_params["filter_by"] = "section:=Blog"
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
section_filter = " || ".join(f"section:... |
self.is_fetching = False
except Exception:
async with self:
self.idxed_docs_results = []
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_len... | self.idxed_blogs_results = blog_results |
search_params["filter_by"] = "section:=Blog"
else:
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_... |
except Exception:
async with self:
self.idxed_docs_results = []
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
... | self.is_fetching = False |
sections = self._get_sections_for_cluster(self.selected_filter)
if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_params["filter_by"] = section_filter
result = client.collections["docs"].documents.s... |
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
... | self.idxed_docs_results = [] |
ter(self.selected_filter)
if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_params["filter_by"] = section_filter
result = client.collections["docs"].documents.search(search_params)
docs_result... |
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
content = doc.get("content", "") or ""
... | self.idxed_blogs_results = [] |
if sections:
section_filter = " || ".join(f"section:={s}" for s in sections)
search_params["filter_by"] = section_filter
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
... |
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
content = doc.get("content", "") or ""
def bold_tokens(snippet: str, tokens:... | self.is_fetching = False |
tion_filter
result = client.collections["docs"].documents.search(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
... |
close_tag = "</span>"
content = doc.get("content", "") or ""
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok... | bold_stype = '<span style="font-weight: 900; color: #AA99EC;">' |
earch(search_params)
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_r... |
content = doc.get("content", "") or ""
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{... | close_tag = "</span>" |
docs_results = []
blog_results = []
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
... |
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
... | content = doc.get("content", "") or "" |
[]
for hit in result["hits"]:
doc = hit["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_re... |
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>... | def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
sn... |
["document"]
formatted_doc = self._format_result(doc, hit.get("highlights", []))
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_results.append(formatted_doc)
async with self:
... |
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
... | for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
snippet,
flags=re.IGNORECASE,
... |
if doc.get("section") == "Blog":
blog_results.append(formatted_doc)
else:
docs_results.append(formatted_doc)
async with self:
self.idxed_docs_results = docs_results
self.idxed_blogs_results = blog_results
... |
except re.error:
snippet = snippet.replace(tok, f"{bold_stype}{tok}{close_tag}")
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("sni... | snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
snippet,
flags=re.IGNORECASE,
) |
self.idxed_blogs_results = blog_results
self.is_fetching = False
except Exception:
async with self:
self.idxed_docs_results = []
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(
self, ... |
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
... | snippet = snippet.replace(tok, f"{bold_stype}{tok}{close_tag}") |
self.idxed_docs_results = []
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
... |
# 2) Typesense component highlights (simplified)
for h in highlights or []:
if h.get("field", "").startswith("components"):
values = h.get("values") or ([h.get("value")] if h.get("value") else [])
if values:
cleaned = [
... | for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
)
... |
self.idxed_blogs_results = []
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
co... |
# 2) Typesense component highlights (simplified)
for h in highlights or []:
if h.get("field", "").startswith("components"):
values = h.get("values") or ([h.get("value")] if h.get("value") else [])
if values:
cleaned = [
... | if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
)
if marked:
... |
self.is_fetching = False
def _get_highlighted_content(
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
content = doc.get("content", "") or ""
def bold_toke... |
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
)
if marked:
token = marked[0]
idx = content.lower().find(token.lower())
... | snippet = h.get("snippet") or h.get("value") or "" |
self, doc, highlights: list | None, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
content = doc.get("content", "") or ""
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in ... |
# 2) Typesense component highlights (simplified)
for h in highlights or []:
if h.get("field", "").startswith("components"):
values = h.get("values") or ([h.get("value")] if h.get("value") else [])
if values:
cleaned = [
... | if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
)
if marked:
token = marked[0]
idx = content.lower().find(token.lower())
if idx... |
one, snippet_length=350
):
import re
bold_stype = '<span style="font-weight: 900; color: #AA99EC;">'
close_tag = "</span>"
content = doc.get("content", "") or ""
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t},... |
if marked:
token = marked[0]
idx = content.lower().find(token.lower())
if idx != -1:
start = max(0, idx - snippet_length // 2)
end = min(
l... | marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
) |
= "</span>"
content = doc.get("content", "") or ""
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
... |
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
# 2) Typese... | if marked:
token = marked[0]
idx = content.lower().find(token.lower())
if idx != -1:
start = max(0, idx - snippet_length // 2)
end = min(
len(content), idx + le... |
get("content", "") or ""
def bold_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close... |
idx = content.lower().find(token.lower())
if idx != -1:
start = max(0, idx - snippet_length // 2)
end = min(
len(content), idx + len(token) + snippet_length // 2
... | token = marked[0] |
_tokens(snippet: str, tokens: list[str]) -> str:
for tok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
snippet,
... |
if idx != -1:
start = max(0, idx - snippet_length // 2)
end = min(
len(content), idx + len(token) + snippet_length // 2
)
snippet = content[start:end]
... | idx = content.lower().find(token.lower()) |
ok in sorted({t for t in tokens if t}, key=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
snippet,
flags=re.IGNORECASE,
)
... |
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
# 2) Typese... | if idx != -1:
start = max(0, idx - snippet_length // 2)
end = min(
len(content), idx + len(token) + snippet_length // 2
)
snippet = content[start:end]
... |
=len, reverse=True):
try:
snippet = re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
snippet,
flags=re.IGNORECASE,
)
except re.error:
... |
end = min(
len(content), idx + len(token) + snippet_length // 2
)
snippet = content[start:end]
snippet = bold_tokens(snippet, marked)
if start > 0:... | start = max(0, idx - snippet_length // 2) |
= re.sub(
re.escape(tok),
f"{bold_stype}\\g<0>{close_tag}",
snippet,
flags=re.IGNORECASE,
)
except re.error:
snippet = snippet.replace(tok, f"{bold_stype}{tok}{close_ta... |
snippet = content[start:end]
snippet = bold_tokens(snippet, marked)
if start > 0:
snippet = "..." + snippet
if end < len(content):
snippet = sn... | end = min(
len(content), idx + len(token) + snippet_length // 2
) |
flags=re.IGNORECASE,
)
except re.error:
snippet = snippet.replace(tok, f"{bold_stype}{tok}{close_tag}")
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("con... |
snippet = bold_tokens(snippet, marked)
if start > 0:
snippet = "..." + snippet
if end < len(content):
snippet = snippet + "..."
return snippet
... | snippet = content[start:end] |
except re.error:
snippet = snippet.replace(tok, f"{bold_stype}{tok}{close_tag}")
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet... |
if start > 0:
snippet = "..." + snippet
if end < len(content):
snippet = snippet + "..."
return snippet
snippet = snippet.replace("<mark>", bold_stype... | snippet = bold_tokens(snippet, marked) |
.replace(tok, f"{bold_stype}{tok}{close_tag}")
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
... |
if end < len(content):
snippet = snippet + "..."
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
re... | if start > 0:
snippet = "..." + snippet |
return snippet
# 1) Typesense content/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
... |
if end < len(content):
snippet = snippet + "..."
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
re... | snippet = "..." + snippet |
ntent/title highlights
for h in highlights or []:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORE... |
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet... | if end < len(content):
snippet = snippet + "..." |
]:
if h.get("field") in ("content", "title"):
snippet = h.get("snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
)
if marke... |
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet... | snippet = snippet + "..." |
"snippet") or h.get("value") or ""
if snippet:
marked = re.findall(
r"<mark>(.*?)</mark>", snippet, flags=re.IGNORECASE
)
if marked:
token = marked[0]
idx = content.lower()... |
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
# 2) Typesense component highlights (simplified)
for h in highlights or []:
if h.get("field", "").startswith("components"):
... | snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
) |
if idx != -1:
start = max(0, idx - snippet_length // 2)
end = min(
len(content), idx + len(token) + snippet_length // 2
)
snippet = content[start:end]
... |
# 3) Client-side components match
q = (getattr(self, "query", "") or "").strip().lower()
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
... | for h in highlights or []:
if h.get("field", "").startswith("components"):
values = h.get("values") or ([h.get("value")] if h.get("value") else [])
if values:
cleaned = [
v.replace("<mark>", bold_stype).replace("</mark>", close_tag)... |
start = max(0, idx - snippet_length // 2)
end = min(
len(content), idx + len(token) + snippet_length // 2
)
snippet = content[start:end]
snippet = bold_... |
# 3) Client-side components match
q = (getattr(self, "query", "") or "").strip().lower()
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
... | if h.get("field", "").startswith("components"):
values = h.get("values") or ([h.get("value")] if h.get("value") else [])
if values:
cleaned = [
v.replace("<mark>", bold_stype).replace("</mark>", close_tag)
for v in value... |
)
end = min(
len(content), idx + len(token) + snippet_length // 2
)
snippet = content[start:end]
snippet = bold_tokens(snippet, marked)
if start > 0... |
if values:
cleaned = [
v.replace("<mark>", bold_stype).replace("</mark>", close_tag)
for v in values
if v
]
return f"Matches found: {', '.join(cleaned[:6])}"
# 3)... | values = h.get("values") or ([h.get("value")] if h.get("value") else []) |
x + len(token) + snippet_length // 2
)
snippet = content[start:end]
snippet = bold_tokens(snippet, marked)
if start > 0:
snippet = "..." + snippet
i... |
# 3) Client-side components match
q = (getattr(self, "query", "") or "").strip().lower()
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
... | if values:
cleaned = [
v.replace("<mark>", bold_stype).replace("</mark>", close_tag)
for v in values
if v
]
return f"Matches found: {', '.join(cleaned[:6])}" |
// 2
)
snippet = content[start:end]
snippet = bold_tokens(snippet, marked)
if start > 0:
snippet = "..." + snippet
if end < len(content):
... |
return f"Matches found: {', '.join(cleaned[:6])}"
# 3) Client-side components match
q = (getattr(self, "query", "") or "").strip().lower()
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]... | cleaned = [
v.replace("<mark>", bold_stype).replace("</mark>", close_tag)
for v in values
if v
] |
snippet = snippet + "..."
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
... |
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>{close_tag}",
... | q = (getattr(self, "query", "") or "").strip().lower() |
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
... |
# 4) fallback: truncated content
return self._truncate_content(content, max_length=snippet_length)
def _get_sections_for_cluster(self, cluster_name: str) -> list[str]:
"""Map cluster names to section names."""
return CLUSTERS.get(cluster_name, [])
def _format_result(self, doc... | if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>{close_tag}",
... |
return snippet
snippet = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
... |
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>{close_tag}",
c,
flags=re.IG... | comps = doc.get("components") or [] |
t = snippet.replace("<mark>", bold_stype).replace(
"</mark>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
# 2) Typesense component highlights (si... |
if matched:
bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>{close_tag}",
c,
flags=re.IGNORECASE,
)
for c in matched[:6]
... | matched = [c for c in comps if isinstance(c, str) and q in c.lower()] |
>", close_tag
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
# 2) Typesense component highlights (simplified)
for h in highlights or []:
if h.get("field", "").sta... |
# 4) fallback: truncated content
return self._truncate_content(content, max_length=snippet_length)
def _get_sections_for_cluster(self, cluster_name: str) -> list[str]:
"""Map cluster names to section names."""
return CLUSTERS.get(cluster_name, [])
def _format_result(self, doc... | if matched:
bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>{close_tag}",
c,
flags=re.IGNORECASE,
)
for c in matched[:6]
]
... |
)
return snippet[:snippet_length] + (
"..." if len(snippet) > snippet_length else snippet
)
# 2) Typesense component highlights (simplified)
for h in highlights or []:
if h.get("field", "").startswith("components"):
... |
return f"Matches found: {', '.join(bolded)}"
# 4) fallback: truncated content
return self._truncate_content(content, max_length=snippet_length)
def _get_sections_for_cluster(self, cluster_name: str) -> list[str]:
"""Map cluster names to section names."""
return CLU... | bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>{close_tag}",
c,
flags=re.IGNORECASE,
)
for c in matched[:6]
] |
v.replace("<mark>", bold_stype).replace("</mark>", close_tag)
for v in values
if v
]
return f"Matches found: {', '.join(cleaned[:6])}"
# 3) Client-side components match
q = (getattr(self, "query", "... |
def _format_result(self, doc: dict, highlights: list | None = None) -> dict:
"""Format Typesense result to match your fuzzy search structure."""
if doc.get("section") != "Blog":
return {
"name": doc.get("title", ""),
"parts": doc.get("parts", []),
... | def _get_sections_for_cluster(self, cluster_name: str) -> list[str]:
"""Map cluster names to section names."""
return CLUSTERS.get(cluster_name, []) |
return f"Matches found: {', '.join(cleaned[:6])}"
# 3) Client-side components match
q = (getattr(self, "query", "") or "").strip().lower()
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
... |
def _get_cluster_from_section(self, section: str) -> str:
"""Map section back to cluster name."""
for cluster, sections in CLUSTERS.items():
if section in sections:
return cluster
return "Docs"
def _truncate_content(self, content: str, max_length: int = 200... | def _format_result(self, doc: dict, highlights: list | None = None) -> dict:
"""Format Typesense result to match your fuzzy search structure."""
if doc.get("section") != "Blog":
return {
"name": doc.get("title", ""),
"parts": doc.get("parts", []),
... |
trip().lower()
if q:
comps = doc.get("components") or []
matched = [c for c in comps if isinstance(c, str) and q in c.lower()]
if matched:
bolded = [
re.sub(
re.escape(q),
f"{bold_stype}\\g<0>... |
def _get_cluster_from_section(self, section: str) -> str:
"""Map section back to cluster name."""
for cluster, sections in CLUSTERS.items():
if section in sections:
return cluster
return "Docs"
def _truncate_content(self, content: str, max_length: int = 200... | if doc.get("section") != "Blog":
return {
"name": doc.get("title", ""),
"parts": doc.get("parts", []),
"url": doc.get("url", ""),
"image": doc.get("path", ""),
"cluster": self._get_cluster_from_section(doc.get("section", "")),
... |
names."""
return CLUSTERS.get(cluster_name, [])
def _format_result(self, doc: dict, highlights: list | None = None) -> dict:
"""Format Typesense result to match your fuzzy search structure."""
if doc.get("section") != "Blog":
return {
"name": doc.get("title", ""... |
def _truncate_content(self, content: str, max_length: int = 200) -> str:
"""Truncate content for description."""
if len(content) <= max_length:
return content
return content[:max_length].rstrip() + "..."
def keyboard_shortcut_script() -> rx.Component:
"""Add keyboard shor... | def _get_cluster_from_section(self, section: str) -> str:
"""Map section back to cluster name."""
for cluster, sections in CLUSTERS.items():
if section in sections:
return cluster
return "Docs" |
| None = None) -> dict:
"""Format Typesense result to match your fuzzy search structure."""
if doc.get("section") != "Blog":
return {
"name": doc.get("title", ""),
"parts": doc.get("parts", []),
"url": doc.get("url", ""),
"imag... |
return "Docs"
def _truncate_content(self, content: str, max_length: int = 200) -> str:
"""Truncate content for description."""
if len(content) <= max_length:
return content
return content[:max_length].rstrip() + "..."
def keyboard_shortcut_script() -> rx.Component:
... | for cluster, sections in CLUSTERS.items():
if section in sections:
return cluster |
sult to match your fuzzy search structure."""
if doc.get("section") != "Blog":
return {
"name": doc.get("title", ""),
"parts": doc.get("parts", []),
"url": doc.get("url", ""),
"image": doc.get("path", ""),
"cluster": sel... |
return "Docs"
def _truncate_content(self, content: str, max_length: int = 200) -> str:
"""Truncate content for description."""
if len(content) <= max_length:
return content
return content[:max_length].rstrip() + "..."
def keyboard_shortcut_script() -> rx.Component:
... | if section in sections:
return cluster |
og":
return {
"name": doc.get("title", ""),
"parts": doc.get("parts", []),
"url": doc.get("url", ""),
"image": doc.get("path", ""),
"cluster": self._get_cluster_from_section(doc.get("section", "")),
"description"... |
def keyboard_shortcut_script() -> rx.Component:
"""Add keyboard shortcut support for opening search."""
return rx.script(
"""
document.addEventListener('keydown', function(e) {
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
e.preventDefault();
doc... | def _truncate_content(self, content: str, max_length: int = 200) -> str:
"""Truncate content for description."""
if len(content) <= max_length:
return content
return content[:max_length].rstrip() + "..." |
et_cluster_from_section(doc.get("section", "")),
"description": self._get_highlighted_content(doc, highlights),
}
else:
return {
"title": doc.get("title", ""),
"url": doc.get("url", ""),
"author": doc.get("author", ""),
... |
def search_trigger() -> rx.Component:
"""Render the search trigger button."""
return ui.button(
rx.html(
"""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M11.6681 11.6671L14.6681 14.6671M13.3347 7.33374C13.3347 4.02003 10.6485 1... | def keyboard_shortcut_script() -> rx.Component:
"""Add keyboard shortcut support for opening search."""
return rx.script(
"""
document.addEventListener('keydown', function(e) {
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
e.preventDefault();
docume... |
tent(doc.get("content", "")),
"image": doc.get("image", ""),
}
def _get_cluster_from_section(self, section: str) -> str:
"""Map section back to cluster name."""
for cluster, sections in CLUSTERS.items():
if section in sections:
return cluster
... |
def search_breadcrumb(items):
"""Create a breadcrumb navigation component."""
return rx.hstack(
rx.foreach(
items,
lambda item, index: rx.fragment(
rx.cond(
index > 0,
rx.el.label(
"›", # noqa: RU... | def search_trigger() -> rx.Component:
"""Render the search trigger button."""
return ui.button(
rx.html(
"""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M11.6681 11.6671L14.6681 14.6671M13.3347 7.33374C13.3347 4.02003 10.6485 1.33... |
}
});
"""
)
def search_trigger() -> rx.Component:
"""Render the search trigger button."""
return ui.button(
rx.html(
"""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M11.6681 11.6671L14.6681 14.6671M13... |
def cluster_icon(filter_name: str):
icons = {
"All Content": "DragDropIcon",
"AI Builder": "RoboticIcon",
"Hosting": "CloudIcon",
"Components": "BlockGameIcon",
"Docs": "File01Icon",
"Enterprise": "City02Icon",
"API Reference": "ApiIcon",
"Blog Post... | def search_breadcrumb(items):
"""Create a breadcrumb navigation component."""
return rx.hstack(
rx.foreach(
items,
lambda item, index: rx.fragment(
rx.cond(
index > 0,
rx.el.label(
"›", # noqa: RUF00... |
dcrumb navigation component."""
return rx.hstack(
rx.foreach(
items,
lambda item, index: rx.fragment(
rx.cond(
index > 0,
rx.el.label(
"›", # noqa: RUF001
class_name="text-sm font... |
def filter_items(filter_name: str):
return ui.popover.close(
rx.el.div(
rx.el.div(
cluster_icon(filter_name),
rx.el.button(
filter_name,
class_name="w-full text-left",
type="button",
),... | def cluster_icon(filter_name: str):
icons = {
"All Content": "DragDropIcon",
"AI Builder": "RoboticIcon",
"Hosting": "CloudIcon",
"Components": "BlockGameIcon",
"Docs": "File01Icon",
"Enterprise": "City02Icon",
"API Reference": "ApiIcon",
"Blog Posts":... |
rn rx.hstack(
rx.foreach(
items,
lambda item, index: rx.fragment(
rx.cond(
index > 0,
rx.el.label(
"›", # noqa: RUF001
class_name="text-sm font-medium",
color=... |
return ui.icon(icon=icons.get(filter_name, ""), class_name="shrink-0 size-4")
def filter_items(filter_name: str):
return ui.popover.close(
rx.el.div(
rx.el.div(
cluster_icon(filter_name),
rx.el.button(
filter_name,
cl... | icons = {
"All Content": "DragDropIcon",
"AI Builder": "RoboticIcon",
"Hosting": "CloudIcon",
"Components": "BlockGameIcon",
"Docs": "File01Icon",
"Enterprise": "City02Icon",
"API Reference": "ApiIcon",
"Blog Posts": "BloggerIcon",
} |
rx.el.label(
item,
class_name=rx.cond(
index == (items.length() - 1),
"text-sm font-medium",
"text-sm font-regular",
),
color=rx.cond(
... |
def filter_icon(tag: str):
"""Helper to render icons for filters consistently."""
return ui.icon(icon=tag, class_name="shrink-0 size-3")
def filter_component():
return ui.popover.root(
ui.popover.trigger(
ui.button(
rx.el.div(
rx.el.div(
... | def filter_items(filter_name: str):
return ui.popover.close(
rx.el.div(
rx.el.div(
cluster_icon(filter_name),
rx.el.button(
filter_name,
class_name="w-full text-left",
type="button",
),
... |
: "File01Icon",
"Enterprise": "City02Icon",
"API Reference": "ApiIcon",
"Blog Posts": "BloggerIcon",
}
return ui.icon(icon=icons.get(filter_name, ""), class_name="shrink-0 size-4")
def filter_items(filter_name: str):
return ui.popover.close(
rx.el.div(
rx.el.div... |
def filter_component():
return ui.popover.root(
ui.popover.trigger(
ui.button(
rx.el.div(
rx.el.div(
rx.match(
SimpleSearch.selected_filter,
("All Content", filter_icon("DragDro... | def filter_icon(tag: str):
"""Helper to render icons for filters consistently."""
return ui.icon(icon=tag, class_name="shrink-0 size-3") |
on(icon=icons.get(filter_name, ""), class_name="shrink-0 size-4")
def filter_items(filter_name: str):
return ui.popover.close(
rx.el.div(
rx.el.div(
cluster_icon(filter_name),
rx.el.button(
filter_name,
class_name="w-full ... |
def search_input():
return rx.box(
rx.box(
rx.icon(
tag="search",
size=14,
class_name="absolute left-2 top-1/2 transform -translate-y-1/2 !text-gray-500/40",
),
rx.box(
filter_component(),
... | def filter_component():
return ui.popover.root(
ui.popover.trigger(
ui.button(
rx.el.div(
rx.el.div(
rx.match(
SimpleSearch.selected_filter,
("All Content", filter_icon("DragDropIc... |
con", class_name="shrink-0 size-3"),
class_name="flex flex-row items-center justify-between w-[150px] text-sm",
),
class_name="flex flex-row justify-between items-center gap-x-4 rounded-md outline-none",
type="button",
variant="outline"... |
def copy_button(url: str):
return ui.button(
rx.cond(
last_copied.value == url,
ui.icon("CheckmarkCircle02Icon", class_name="size-2"),
ui.icon("Share08Icon", size=10, class_name="size-2"),
),
variant="outline",
size="xs",
on_click=[
... | def search_input():
return rx.box(
rx.box(
rx.icon(
tag="search",
size=14,
class_name="absolute left-2 top-1/2 transform -translate-y-1/2 !text-gray-500/40",
),
rx.box(
filter_component(),
rx.... |
outline",
on_click=rx.run_script(
"document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }))"
),
),
class_name="hidden md:flex absolute right-2 top-1/2 transform -translate-y-1/2 text-sm flex-row items-center g... |
def search_result(tags: list, value: dict):
return rx.link(
rx.box(
rx.box(
rx.text(value["name"], class_name="text-sm font-bold"),
copy_button(url=f"https://reflex.dev/{value['url'].to(str)}"),
class_name="flex flex-row items-center justify-bet... | def copy_button(url: str):
return ui.button(
rx.cond(
last_copied.value == url,
ui.icon("CheckmarkCircle02Icon", class_name="size-2"),
ui.icon("Share08Icon", size=10, class_name="size-2"),
),
variant="outline",
size="xs",
on_click=[
... |
h(),
],
auto_focus=True,
placeholder="Search documentation ...",
class_name="py-2 pl-7 md:pr-[310px] w-full placeholder:text-sm text-sm rounded-lg outline-none focus:outline-none border border-secondary-a4 bg-secondary-1 text-secondary-12",
),
... |
def search_result_blog(value: dict):
return rx.link(
rx.box(
rx.box(
rx.box(
rx.text(value["author"]),
"-",
rx.text(value["date"]),
class_name="flex flex-row gap-x-2 items-center text-sm !text-slat... | def search_result(tags: list, value: dict):
return rx.link(
rx.box(
rx.box(
rx.text(value["name"], class_name="text-sm font-bold"),
copy_button(url=f"https://reflex.dev/{value['url'].to(str)}"),
class_name="flex flex-row items-center justify-betwee... |
x(
rx.box(
rx.text(value["name"], class_name="text-sm font-bold"),
copy_button(url=f"https://reflex.dev/{value['url'].to(str)}"),
class_name="flex flex-row items-center justify-between pr-1 w-full",
),
rx.html(
value["de... |
def search_result_start(item: dict):
return rx.link(
rx.box(
rx.box(
rx.icon(tag=item["icon"], size=11, class_name="size-4 !text-slate-9"),
rx.text(item["name"], class_name="text-sm font-bold"),
class_name="flex flex-row items-center justify-sta... | def search_result_blog(value: dict):
return rx.link(
rx.box(
rx.box(
rx.box(
rx.text(value["author"]),
"-",
rx.text(value["date"]),
class_name="flex flex-row gap-x-2 items-center text-sm !text-slate-1... |
1",
),
rx.text(value["title"], class_name="text-md font-bold"),
rx.text(
value["description"],
class_name=(
"text-sm font-regular opacity-[0.81] "
"line-clamp-2 overflow-hidden text-ellipsis"
),
... |
def no_results_found():
return rx.box(
rx.el.p(
rx.fragment(
"No results found for ",
rx.el.strong(f"'{SimpleSearch.query}'"),
),
),
class_name="w-full flex items-center justify-center text-sm py-4",
)
def searching_in_progress... | def search_result_start(item: dict):
return rx.link(
rx.box(
rx.box(
rx.icon(tag=item["icon"], size=11, class_name="size-4 !text-slate-9"),
rx.text(item["name"], class_name="text-sm font-bold"),
class_name="flex flex-row items-center justify-start ... |
item: dict):
return rx.link(
rx.box(
rx.box(
rx.icon(tag=item["icon"], size=11, class_name="size-4 !text-slate-9"),
rx.text(item["name"], class_name="text-sm font-bold"),
class_name="flex flex-row items-center justify-start gap-x-2",
),... |
def searching_in_progress():
return rx.box(
rx.el.p(
rx.fragment(
"Searching for ",
rx.el.strong(f"'{SimpleSearch.query}'"),
"...",
),
),
class_name="w-full flex items-center justify-center text-sm py-4",
)
def ... | def no_results_found():
return rx.box(
rx.el.p(
rx.fragment(
"No results found for ",
rx.el.strong(f"'{SimpleSearch.query}'"),
),
),
class_name="w-full flex items-center justify-center text-sm py-4",
) |
art gap-x-2",
),
rx.text(
item["description"],
class_name=(
"text-xs font-regular opacity-[0.81] "
"line-clamp-2 overflow-hidden text-ellipsis"
),
style={
"display": "-webk... |
def search_content():
return rx.scroll_area(
rx.cond(
SimpleSearch.query.length() < 3,
rx.box(
rx.foreach(suggestion_items, lambda value: search_result_start(value)),
class_name="flex flex-col gap-y-2",
),
rx.cond(
... | def searching_in_progress():
return rx.box(
rx.el.p(
rx.fragment(
"Searching for ",
rx.el.strong(f"'{SimpleSearch.query}'"),
"...",
),
),
class_name="w-full flex items-center justify-center text-sm py-4",
) |
rx.foreach(
SimpleSearch.idxed_docs_results,
lambda value: search_result(
value["parts"].to(list), value
),
),
class_n... | def typesense_search() -> rx.Component:
"""Create the main search component for Reflex Web."""
return rx.fragment(
rx.dialog.root(
rx.dialog.trigger(search_trigger(), id="search-trigger"),
rx.dialog.content(
search_input(),
search_content(),
... | |
from reflex.style import toggle_color_mode
from pcweb.components.icons import get_icon
def color() -> rx.Component:
return rx.el.button(
rx.color_mode.icon(
light_component=get_icon("sun", class_name="shrink-0 !text-slate-9"),
dark_component=get_icon("moon", class_name="shrink-0 ... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons import get_icon
def color() -> rx.Component:
return rx.el.button(
rx.color_mode.icon(
light_component=get_icon("sun", class_name="shrink-0 !text-slate-9"),
dark_component=get_icon("moon", class_name="shrink-0 !text-slate-9"),
),
on_clic... | from reflex.style import toggle_color_mode |
import reflex as rx
from reflex.style import toggle_color_mode
|
def color() -> rx.Component:
return rx.el.button(
rx.color_mode.icon(
light_component=get_icon("sun", class_name="shrink-0 !text-slate-9"),
dark_component=get_icon("moon", class_name="shrink-0 !text-slate-9"),
),
on_click=toggle_color_mode,
custom_attrs={"a... | from pcweb.components.icons import get_icon |
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL
def discord() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="discord_navbar", class_name="shrink-0 text-secondary-11"),
custom_attrs={"aria-label":... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL
def discord() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="discord_navbar", class_name="shrink-0 text-secondary-11"),
custom_attrs={"aria-label": "Discord link"},
... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.constants import DISCORD_URL
def discord() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="discord_navbar", class_name="shrink-0 text-secondary-11"),
custom_attrs={"aria-label": "Discord link"},
size="icon-sm",
variant="outline... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
|
def discord() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="discord_navbar", class_name="shrink-0 text-secondary-11"),
custom_attrs={"aria-label": "Discord link"},
size="icon-sm",
variant="outline",
class_name="text-secondar... | from pcweb.constants import DISCORD_URL |
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.constants import GITHUB_STARS, GITHUB_URL
def github() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="github_navbar", class_name="shrink-0 text-secondary-11"),
f"{GITHUB_STARS ... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.constants import GITHUB_STARS, GITHUB_URL
def github() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="github_navbar", class_name="shrink-0 text-secondary-11"),
f"{GITHUB_STARS // 1000}K",
... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.constants import GITHUB_STARS, GITHUB_URL
def github() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="github_navbar", class_name="shrink-0 text-secondary-11"),
f"{GITHUB_STARS // 1000}K",
custom_attrs={"aria-label": "Github link"},
... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
|
def github() -> rx.Component:
return ui.link(
render_=ui.button(
get_icon(icon="github_navbar", class_name="shrink-0 text-secondary-11"),
f"{GITHUB_STARS // 1000}K",
custom_attrs={"aria-label": "Github link"},
size="sm",
variant="outline",
... | from pcweb.constants import GITHUB_STARS, GITHUB_URL |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages.framework.framework import framework
from pcweb.pages.gallery... | from reflex.style import toggle_color_mode |
import reflex as rx
from reflex.style import toggle_color_mode
|
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages.framework.framework import framework
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting im... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
|
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages.framework.framework import framework
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
u... | from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
|
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages.framework.framework import framework
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
)... | from pcweb.pages.blog import blogs |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
|
from pcweb.pages.docs.library import library
from pcweb.pages.framework.framework import framework
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
... | from pcweb.pages.docs import getting_started |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
|
from pcweb.pages.framework.framework import framework
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-... | from pcweb.pages.docs.library import library |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.