@clarify-labs/renderer 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/output/{ClarifyShell-1LuBliwt.js → ClarifyShell-Cq5Af46F.js} +32 -12
  2. package/output/ClarifyShell-Cq5Af46F.js.map +1 -0
  3. package/output/{ClarifyShell-C6li72Ce.cjs → ClarifyShell-UsefuuLS.cjs} +31 -11
  4. package/output/ClarifyShell-UsefuuLS.cjs.map +1 -0
  5. package/output/{MermaidViewer-dXsomvM7.js → MermaidViewer-Bc9H25yK.js} +2 -2
  6. package/output/{MermaidViewer-dXsomvM7.js.map → MermaidViewer-Bc9H25yK.js.map} +1 -1
  7. package/output/{MermaidViewer-B6-BMCJG.cjs → MermaidViewer-Db7qsyVk.cjs} +2 -2
  8. package/output/{MermaidViewer-B6-BMCJG.cjs.map → MermaidViewer-Db7qsyVk.cjs.map} +1 -1
  9. package/output/{OpenApiOperation-DgrqzeiS.js → OpenApiOperation-BZWeCbvy.js} +471 -178
  10. package/output/OpenApiOperation-BZWeCbvy.js.map +1 -0
  11. package/output/{OpenApiOperation-B52IWlKb.cjs → OpenApiOperation-DbZjxIuj.cjs} +491 -174
  12. package/output/OpenApiOperation-DbZjxIuj.cjs.map +1 -0
  13. package/output/{PageActions-D7K9LDGf.js → PageActions-BQeEmXbT.js} +524 -350
  14. package/output/PageActions-BQeEmXbT.js.map +1 -0
  15. package/output/{PageActions-BjB6PYmL.cjs → PageActions-Dg1l9KB1.cjs} +521 -347
  16. package/output/PageActions-Dg1l9KB1.cjs.map +1 -0
  17. package/output/{SearchDialog-CxYLjRi5.js → SearchDialog-B67VA0Ut.js} +3 -3
  18. package/output/{SearchDialog-CxYLjRi5.js.map → SearchDialog-B67VA0Ut.js.map} +1 -1
  19. package/output/{SearchDialog-CIPvXMT3.cjs → SearchDialog-DjKvqN7p.cjs} +3 -3
  20. package/output/{SearchDialog-CIPvXMT3.cjs.map → SearchDialog-DjKvqN7p.cjs.map} +1 -1
  21. package/output/app/ContentDiagnostic.d.ts +2 -1
  22. package/output/client.cjs +3 -3
  23. package/output/client.js +3 -3
  24. package/output/components/AccordionGroup.d.ts +7 -0
  25. package/output/components/Collapse.d.ts +2 -0
  26. package/output/components/FileTree.d.ts +10 -0
  27. package/output/components/Image.d.ts +6 -0
  28. package/output/components/Steps.d.ts +12 -0
  29. package/output/components/Tabs.d.ts +12 -5
  30. package/output/components/Tooltip.d.ts +7 -0
  31. package/output/components/index.d.ts +10 -1
  32. package/output/core/i18n.d.ts +1 -1
  33. package/output/{i18n-DnqZHFT7.js → i18n-Bqth9d6Q.js} +5 -1
  34. package/output/i18n-Bqth9d6Q.js.map +1 -0
  35. package/output/{i18n-b4iTLeia.cjs → i18n-C-fReCj-.cjs} +5 -1
  36. package/output/i18n-C-fReCj-.cjs.map +1 -0
  37. package/output/index.cjs +17 -8
  38. package/output/index.cjs.map +1 -1
  39. package/output/index.d.ts +5 -4
  40. package/output/index.js +14 -9
  41. package/output/index.js.map +1 -1
  42. package/output/mdx/components.d.ts +9 -0
  43. package/output/mdx/primitives.d.ts +4 -2
  44. package/output/openapi/components/CodeDisplay.d.ts +1 -0
  45. package/output/openapi/components/InlineListbox.d.ts +18 -0
  46. package/output/preview.cjs +3 -3
  47. package/output/preview.js +3 -3
  48. package/output/{render-Di5B6Zc0.cjs → render-Dc9wxg_r.cjs} +2 -2
  49. package/output/{render-Di5B6Zc0.cjs.map → render-Dc9wxg_r.cjs.map} +1 -1
  50. package/output/{render-DKj24Jqw.js → render-aS-w4fK4.js} +2 -2
  51. package/output/{render-DKj24Jqw.js.map → render-aS-w4fK4.js.map} +1 -1
  52. package/output/renderer.css +766 -171
  53. package/output/server.cjs +2 -2
  54. package/output/server.js +2 -2
  55. package/package.json +1 -1
  56. package/output/ClarifyShell-1LuBliwt.js.map +0 -1
  57. package/output/ClarifyShell-C6li72Ce.cjs.map +0 -1
  58. package/output/OpenApiOperation-B52IWlKb.cjs.map +0 -1
  59. package/output/OpenApiOperation-DgrqzeiS.js.map +0 -1
  60. package/output/PageActions-BjB6PYmL.cjs.map +0 -1
  61. package/output/PageActions-D7K9LDGf.js.map +0 -1
  62. package/output/i18n-DnqZHFT7.js.map +0 -1
  63. package/output/i18n-b4iTLeia.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SearchDialog-CIPvXMT3.cjs","names":[],"sources":["../source/shell/search/items.ts","../source/shell/search/pagefind.ts","../source/shell/search/SearchInput.tsx","../source/shell/search/Highlight.tsx","../source/shell/search/SearchResult.tsx","../source/shell/search/SearchDialog.tsx"],"sourcesContent":["import type { NavigationNode, RouteItem } from '../../types'\n\nimport type { SearchItem } from './types'\n\nfunction routeGroupTitles(navigation: NavigationNode[]) {\n const titles = new Map<string, string>()\n\n for (const node of navigation) {\n if (node.children?.length) {\n for (const child of node.children) {\n titles.set(child.path, node.title)\n }\n } else {\n titles.set(node.path, node.title)\n }\n }\n\n return titles\n}\n\nexport function buildSearchItems(routes: RouteItem[], navigation: NavigationNode[]): SearchItem[] {\n const groupTitles = routeGroupTitles(navigation)\n\n return routes.flatMap((route) => {\n // Skip bare alias routes (e.g., /path) from search to avoid duplicates in multilingual sites\n if (route.isBareAlias) return []\n \n const groupTitle = groupTitles.get(route.path)\n const pageItem: SearchItem = {\n title: route.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: route.path,\n keywords: [groupTitle, route.title, route.path, route.kind].filter(Boolean).join(' ').toLowerCase(),\n }\n\n const sectionItems = route.sections?.map((section) => ({\n title: section.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: `${route.path}#${section.id}`,\n keywords: [groupTitle, route.title, section.title, route.path, section.id].filter(Boolean).join(' ').toLowerCase(),\n })) ?? []\n\n return [pageItem, ...sectionItems]\n })\n}\n","import { prefixHref } from '../../utils/href'\n\nimport type { Pagefind } from './types'\n\ntype PagefindModule = {\n createInstance: () => Pagefind\n}\n\nconst pagefindPromises = new Map<string, Promise<Pagefind | null>>()\n\nexport function pagefindCacheKey(routePrefix: string, locale: string | undefined) {\n return `${routePrefix || '/'}:${locale || 'default'}`\n}\n\nexport function loadPagefind(routePrefix: string, locale: string | undefined): Promise<Pagefind | null> {\n if (typeof window === 'undefined') return Promise.resolve(null)\n\n const language = locale ?? document.documentElement.lang\n const cacheKey = pagefindCacheKey(routePrefix, language)\n const cachedPagefind = pagefindPromises.get(cacheKey)\n if (cachedPagefind) {\n return cachedPagefind\n }\n\n const pagefindUrl = prefixHref('/pagefind/pagefind.js', routePrefix)\n const pagefindPromise = import(/* @vite-ignore */ pagefindUrl)\n .then(async (module: PagefindModule) => {\n const previousLanguage = document.documentElement.lang\n if (language) document.documentElement.lang = language\n const pagefind = module.createInstance()\n if (previousLanguage && previousLanguage !== language) document.documentElement.lang = previousLanguage\n await pagefind.init?.()\n return pagefind\n })\n .catch((error: unknown) => {\n pagefindPromises.delete(cacheKey)\n console.warn('[clarify:search] Pagefind instance failed', { cacheKey, language, error })\n return null\n })\n\n pagefindPromises.set(cacheKey, pagefindPromise)\n return pagefindPromise\n}\n\nexport function normalizePagefindUrl(url: string, routePrefix: string): string {\n const parsedUrl = new URL(url, typeof window === 'undefined' ? 'http://localhost' : window.location.origin)\n let pathname = parsedUrl.pathname\n const prefix = routePrefix && routePrefix !== '/' ? `/${routePrefix.replace(/^\\/+|\\/+$/g, '')}` : ''\n\n if (prefix && (pathname === prefix || pathname.startsWith(`${prefix}/`))) {\n pathname = pathname.slice(prefix.length) || '/'\n }\n\n return `${pathname}${parsedUrl.search}${parsedUrl.hash}`\n}\n","import clsx from 'clsx'\nimport { LoaderCircle, Search as SearchIcon } from 'lucide-react'\nimport { forwardRef } from 'react'\n\nimport { useBuiltInText } from '../../i18n'\n\nexport const SearchInput = forwardRef<\n React.ElementRef<'input'>,\n {\n query: string\n setQuery: (query: string) => void\n onClose: () => void\n onSubmit: () => void\n activeDescendantId?: string\n loading?: boolean\n }\n>(function SearchInput(arg0, inputRef) {\n const { query, setQuery, onClose, onSubmit, activeDescendantId, loading = false } = arg0\n const t = useBuiltInText()\n const Icon = loading ? LoaderCircle : SearchIcon\n\n return (\n <div className=\"clarify-search-input group relative flex h-12\">\n <Icon\n aria-hidden=\"true\"\n className={clsx(\n 'pointer-events-none absolute top-0 left-3 h-full w-5 stroke-(--clarify-theme-tokens-colors-muted)',\n loading && 'animate-spin',\n )}\n />\n <input\n ref={inputRef}\n data-autofocus\n role=\"combobox\"\n aria-expanded={query !== ''}\n aria-controls=\"clarify-search-results\"\n aria-activedescendant={activeDescendantId}\n value={query}\n onChange={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === 'Escape') {\n if (query) setQuery('')\n else onClose()\n }\n if (event.key === 'Enter') {\n event.preventDefault()\n onSubmit()\n }\n }}\n placeholder={t('search.placeholder')}\n className=\"clarify-search-field flex-auto appearance-none bg-transparent pr-4 pl-10 outline-hidden focus:w-full focus:flex-none [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden [&::-webkit-search-results-button]:hidden [&::-webkit-search-results-decoration]:hidden\"\n />\n </div>\n )\n})\n","import { Fragment } from 'react'\nimport type { ReactNode } from 'react'\n\nfunction stripHtml(value: string): string {\n if (typeof document === 'undefined') return value.replace(/<[^>]*>/g, '')\n const template = document.createElement('template')\n template.innerHTML = value\n return template.content.textContent ?? ''\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\ntype HighlightQueryProps = { text: string; query: string }\n\nexport function HighlightQuery(arg0: HighlightQueryProps) {\n const { text, query } = arg0\n\n if (!query) return text\n\n const parts = text.split(new RegExp(`(${escapeRegExp(query)})`, 'ig'))\n\n return (\n <>\n {parts.map((part, index) =>\n part.toLowerCase() === query.toLowerCase() ? (\n <mark key={index} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {part}\n </mark>\n ) : (\n <Fragment key={index}>{part}</Fragment>\n ),\n )}\n </>\n )\n}\n\nfunction renderExcerptNode(node: ChildNode, key: string): ReactNode {\n if (node.nodeType === Node.TEXT_NODE) return node.textContent\n if (node.nodeType !== Node.ELEMENT_NODE) return null\n\n const element = node as HTMLElement\n const children = Array.from(element.childNodes).map((child, index) => renderExcerptNode(child, `${key}-${index}`))\n\n if (element.tagName.toLowerCase() === 'mark') {\n return (\n <mark key={key} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {children}\n </mark>\n )\n }\n\n return <Fragment key={key}>{children}</Fragment>\n}\n\ntype HighlightExcerptProps = { excerpt: string; query: string }\n\nexport function HighlightExcerpt(arg0: HighlightExcerptProps) {\n const { excerpt, query } = arg0\n\n if (typeof document === 'undefined' || !excerpt.includes('<mark')) {\n return <HighlightQuery text={stripHtml(excerpt)} query={query} />\n }\n\n const template = document.createElement('template')\n template.innerHTML = excerpt\n\n return <>{Array.from(template.content.childNodes).map((node, index) => renderExcerptNode(node, String(index)))}</>\n}\n","import clsx from 'clsx'\nimport { Fragment, useId } from 'react'\n\nimport { HighlightExcerpt, HighlightQuery } from './Highlight'\nimport type { SearchDisplayItem } from './types'\n\ntype SearchResultProps = {\n result: SearchDisplayItem\n query: string\n active: boolean\n onActive: () => void\n onSelect: () => void\n}\n\nexport function SearchResult(arg0: SearchResultProps) {\n const { result, query, active, onActive, onSelect } = arg0\n const id = useId()\n const hierarchy = result.type === 'quick'\n ? [result.sectionTitle, result.pageTitle].filter((value): value is string => typeof value === 'string')\n : []\n\n return (\n <li\n id={id}\n className={clsx('clarify-search-result group block cursor-pointer px-4 py-3', active && 'clarify-search-result-active')}\n aria-selected={active}\n onMouseEnter={onActive}\n onMouseMove={onActive}\n onMouseDown={(event) => {\n event.preventDefault()\n onSelect()\n }}\n >\n <div className=\"clarify-search-result-title\">\n <HighlightQuery text={result.title} query={query} />\n </div>\n {hierarchy.length > 0 ? (\n <div className=\"clarify-search-result-hierarchy mt-1 truncate whitespace-nowrap\">\n {hierarchy.map((item, itemIndex, items) => (\n <Fragment key={`${item}-${itemIndex}`}>\n <HighlightQuery text={item} query={query} />\n <span className={itemIndex === items.length - 1 ? 'sr-only' : 'clarify-search-result-separator mx-2'}>/</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n {result.type === 'full-text' && result.excerpt ? (\n <p className=\"clarify-search-result-excerpt mt-1 line-clamp-2 text-xs leading-5 text-(--clarify-theme-tokens-colors-muted)\">\n <HighlightExcerpt excerpt={result.excerpt} query={query} />\n </p>\n ) : null}\n </li>\n )\n}\n","import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react'\nimport clsx from 'clsx'\nimport { SearchX } from 'lucide-react'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport { useBuiltInText } from '../../i18n'\nimport type { NavigationNode, RouteItem } from '../../types'\n\nimport { buildSearchItems } from './items'\nimport { loadPagefind, normalizePagefindUrl, pagefindCacheKey } from './pagefind'\nimport { SearchInput } from './SearchInput'\nimport { SearchResult } from './SearchResult'\nimport type { FullTextSearchItem, Pagefind, SearchDisplayItem } from './types'\n\ntype SearchDialogProps = {\n open: boolean\n setOpen: (open: boolean) => void\n routes: RouteItem[]\n navigation: NavigationNode[]\n routePrefix?: string\n currentLocale?: string\n className?: string\n onNavigate?: () => void\n}\n\ntype PagefindState = {\n key: string\n pagefind: Pagefind | null\n available: boolean\n}\n\ntype FullTextSearchState = {\n key: string\n results: FullTextSearchItem[] | null\n}\n\ntype UseSearchDialogLifecycleArgs = {\n open: boolean\n setOpen: (open: boolean) => void\n}\n\nfunction useSearchDialogLifecycle(arg0: UseSearchDialogLifecycleArgs) {\n const { open, setOpen } = arg0\n const location = useLocation()\n\n useEffect(() => {\n setOpen(false)\n }, [location.pathname, location.search, location.hash, setOpen])\n\n useEffect(() => {\n if (typeof window === 'undefined') return undefined\n if (open) return undefined\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n setOpen(true)\n }\n }\n\n window.addEventListener('keydown', onKeyDown)\n return () => window.removeEventListener('keydown', onKeyDown)\n }, [open, setOpen])\n}\n\ntype UseSearchDataArgs = {\n query: string\n searchItems: ReturnType<typeof buildSearchItems>\n routePrefix: string\n currentLocale?: string\n}\n\ntype SearchDataState = {\n results: SearchDisplayItem[]\n searchInputLoading: boolean\n showNoResults: boolean\n}\n\nfunction useSearchData(arg0: UseSearchDataArgs): SearchDataState {\n const { query, searchItems, routePrefix, currentLocale } = arg0\n const [fullTextState, setFullTextState] = useState<FullTextSearchState | null>(null)\n const [pagefindState, setPagefindState] = useState<PagefindState | null>(null)\n\n const quickResults = useMemo(() => {\n const normalizedQuery = query.trim().toLowerCase()\n if (!normalizedQuery) return []\n return searchItems.filter((item) => item.keywords.includes(normalizedQuery)).slice(0, 8).map((item) => ({ ...item, type: 'quick' as const }))\n }, [query, searchItems])\n\n const pagefindKey = pagefindCacheKey(routePrefix, currentLocale)\n const activePagefindState = pagefindState?.key === pagefindKey ? pagefindState : null\n const pagefind = activePagefindState?.pagefind ?? null\n const pagefindAvailable = activePagefindState?.available ?? null\n const trimmedQuery = query.trim()\n const fullTextKey = `${pagefindKey}:${trimmedQuery}`\n const fullTextResults = fullTextState?.key === fullTextKey ? fullTextState.results : null\n const results: SearchDisplayItem[] = fullTextResults ?? quickResults\n const searchInputLoading = pagefindAvailable === null || Boolean(trimmedQuery && pagefind && fullTextState?.key !== fullTextKey)\n const showNoResults = Boolean(query.trim()) && results.length === 0 && pagefindAvailable !== null\n\n useEffect(() => {\n let cancelled = false\n\n loadPagefind(routePrefix, currentLocale).then((loadedPagefind) => {\n if (cancelled) return\n setPagefindState({ key: pagefindKey, pagefind: loadedPagefind, available: Boolean(loadedPagefind) })\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, pagefindKey, routePrefix])\n\n useEffect(() => {\n let cancelled = false\n if (!trimmedQuery || !pagefind) return undefined\n\n Promise.resolve().then(async () => {\n if (cancelled) return\n\n try {\n const search = await pagefind.search(trimmedQuery, { limit: 8 })\n const data = await Promise.all(search.results.map(async (result) => ({ id: result.id, data: await result.data() })))\n if (cancelled) return\n setFullTextState({\n key: fullTextKey,\n results: data.map(({ id, data }) => ({\n type: 'full-text',\n id,\n title: data.meta.title || data.url,\n url: normalizePagefindUrl(data.url, routePrefix),\n excerpt: data.excerpt,\n })),\n })\n } catch (error: unknown) {\n console.warn('[clarify:search] Pagefind search failed', { currentLocale, query: trimmedQuery, error })\n if (!cancelled) setFullTextState({ key: fullTextKey, results: null })\n }\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, fullTextKey, pagefind, routePrefix, trimmedQuery])\n\n return {\n results,\n searchInputLoading,\n showNoResults,\n }\n}\n\nexport function SearchDialog(arg0: SearchDialogProps) {\n const {\n open,\n setOpen,\n routes,\n navigation,\n routePrefix = '/',\n currentLocale,\n className,\n onNavigate = () => {},\n } = arg0\n\n const t = useBuiltInText()\n const navigate = useNavigate()\n const inputRef = useRef<React.ElementRef<typeof SearchInput>>(null)\n const [query, setQuery] = useState('')\n const [activeIndex, setActiveIndex] = useState(0)\n const searchItems = useMemo(() => buildSearchItems(routes, navigation), [navigation, routes])\n\n useSearchDialogLifecycle({ open, setOpen })\n const { results, searchInputLoading, showNoResults } = useSearchData({ query, searchItems, routePrefix, currentLocale })\n\n const updateQuery = (value: string) => {\n setQuery(value)\n setActiveIndex(0)\n }\n\n function closeDialog() {\n updateQuery('')\n setOpen(false)\n }\n\n function selectResult(result = results[activeIndex]) {\n if (!result) return\n navigate(result.url)\n onNavigate()\n closeDialog()\n }\n\n function renderResultsPanel() {\n return (\n <div className=\"border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) empty:hidden dark:border-zinc-100/5 dark:bg-white/2.5\">\n {showNoResults ? (\n <div className=\"p-6 text-center\">\n <SearchX className=\"mx-auto h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-zinc-600\" />\n <p className=\"mt-2 text-xs text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-400\">\n {t('search.noResults', { query })}\n </p>\n </div>\n ) : null}\n {results.length ? (\n <ul id=\"clarify-search-results\" className=\"clarify-search-results\" role=\"listbox\">\n {results.map((result, resultIndex) => (\n <SearchResult\n key={result.type === 'full-text' ? result.id : result.url}\n result={result}\n query={query}\n active={resultIndex === activeIndex}\n onActive={() => setActiveIndex(resultIndex)}\n onSelect={() => selectResult(result)}\n />\n ))}\n </ul>\n ) : null}\n </div>\n )\n }\n\n return (\n <Dialog open={open} onClose={closeDialog} className={clsx('clarify-search-dialog fixed inset-0 z-50', className)}>\n <DialogBackdrop\n transition\n className=\"clarify-search-backdrop clarify-ui-backdrop fixed inset-0 backdrop-blur-xs data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in\"\n />\n\n <div className=\"fixed inset-0 overflow-y-auto px-4 py-4 sm:px-6 sm:py-20 md:py-32 lg:px-8 lg:py-(--clarify-search-dialog-padding-block-lg)\">\n <DialogPanel\n transition\n className=\"clarify-search-panel mx-auto transform-gpu overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) shadow-xl ring-1 ring-(--clarify-theme-tokens-colors-border) data-closed:scale-95 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:max-w-xl dark:bg-zinc-900 dark:ring-zinc-800\"\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index + 1) % results.length : 0))\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index - 1 + results.length) % results.length : 0))\n }\n }}\n >\n <SearchInput\n ref={inputRef}\n query={query}\n setQuery={updateQuery}\n onClose={closeDialog}\n onSubmit={() => selectResult()}\n loading={searchInputLoading}\n />\n {renderResultsPanel()}\n </DialogPanel>\n </div>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AAQ,gBACpB,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD;KAEU;KACD;KACP,QAAQ,gBAAgB;KACxB,gBAAgB,eAAe,WAAW;KAC1C,gBAAgB,aAAa,MAAM;IACpC,GANM,OAAO,SAAS,cAAc,OAAO,KAAK,OAAO,GAMvD,CACF;GACC,CAAA,IACF,IACD;;CAET;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,kBAAA,QAAD;EAAc;EAAM,SAAS;EAAa,YAAA,GAAA,KAAA,QAAA,CAAgB,4CAA4C,SAAS;YAA/G,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAA,gBAAD;GACE,YAAA;GACA,WAAU;EACX,CAAA,GAED,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;aACb,iBAAA,GAAA,kBAAA,KAAA,CAAC,kBAAA,aAAD;IACE,YAAA;IACA,WAAU;IACV,YAAY,UAAU;KACpB,IAAI,MAAM,QAAQ,aAAa;MAC7B,MAAM,eAAe;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,KAAK,QAAQ,SAAS,CAAE;KAC/E;KACA,IAAI,MAAM,QAAQ,WAAW;MAC3B,MAAM,eAAe;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,IAAI,QAAQ,UAAU,QAAQ,SAAS,CAAE;KAChG;IACF;cAZF,CAcE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;KACE,KAAK;KACE;KACP,UAAU;KACV,SAAS;KACT,gBAAgB,aAAa;KAC7B,SAAS;IACV,CAAA,GACA,mBAAmB,CACT;;EACV,CAAA,CACC;;AAEZ"}
1
+ {"version":3,"file":"SearchDialog-DjKvqN7p.cjs","names":[],"sources":["../source/shell/search/items.ts","../source/shell/search/pagefind.ts","../source/shell/search/SearchInput.tsx","../source/shell/search/Highlight.tsx","../source/shell/search/SearchResult.tsx","../source/shell/search/SearchDialog.tsx"],"sourcesContent":["import type { NavigationNode, RouteItem } from '../../types'\n\nimport type { SearchItem } from './types'\n\nfunction routeGroupTitles(navigation: NavigationNode[]) {\n const titles = new Map<string, string>()\n\n for (const node of navigation) {\n if (node.children?.length) {\n for (const child of node.children) {\n titles.set(child.path, node.title)\n }\n } else {\n titles.set(node.path, node.title)\n }\n }\n\n return titles\n}\n\nexport function buildSearchItems(routes: RouteItem[], navigation: NavigationNode[]): SearchItem[] {\n const groupTitles = routeGroupTitles(navigation)\n\n return routes.flatMap((route) => {\n // Skip bare alias routes (e.g., /path) from search to avoid duplicates in multilingual sites\n if (route.isBareAlias) return []\n \n const groupTitle = groupTitles.get(route.path)\n const pageItem: SearchItem = {\n title: route.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: route.path,\n keywords: [groupTitle, route.title, route.path, route.kind].filter(Boolean).join(' ').toLowerCase(),\n }\n\n const sectionItems = route.sections?.map((section) => ({\n title: section.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: `${route.path}#${section.id}`,\n keywords: [groupTitle, route.title, section.title, route.path, section.id].filter(Boolean).join(' ').toLowerCase(),\n })) ?? []\n\n return [pageItem, ...sectionItems]\n })\n}\n","import { prefixHref } from '../../utils/href'\n\nimport type { Pagefind } from './types'\n\ntype PagefindModule = {\n createInstance: () => Pagefind\n}\n\nconst pagefindPromises = new Map<string, Promise<Pagefind | null>>()\n\nexport function pagefindCacheKey(routePrefix: string, locale: string | undefined) {\n return `${routePrefix || '/'}:${locale || 'default'}`\n}\n\nexport function loadPagefind(routePrefix: string, locale: string | undefined): Promise<Pagefind | null> {\n if (typeof window === 'undefined') return Promise.resolve(null)\n\n const language = locale ?? document.documentElement.lang\n const cacheKey = pagefindCacheKey(routePrefix, language)\n const cachedPagefind = pagefindPromises.get(cacheKey)\n if (cachedPagefind) {\n return cachedPagefind\n }\n\n const pagefindUrl = prefixHref('/pagefind/pagefind.js', routePrefix)\n const pagefindPromise = import(/* @vite-ignore */ pagefindUrl)\n .then(async (module: PagefindModule) => {\n const previousLanguage = document.documentElement.lang\n if (language) document.documentElement.lang = language\n const pagefind = module.createInstance()\n if (previousLanguage && previousLanguage !== language) document.documentElement.lang = previousLanguage\n await pagefind.init?.()\n return pagefind\n })\n .catch((error: unknown) => {\n pagefindPromises.delete(cacheKey)\n console.warn('[clarify:search] Pagefind instance failed', { cacheKey, language, error })\n return null\n })\n\n pagefindPromises.set(cacheKey, pagefindPromise)\n return pagefindPromise\n}\n\nexport function normalizePagefindUrl(url: string, routePrefix: string): string {\n const parsedUrl = new URL(url, typeof window === 'undefined' ? 'http://localhost' : window.location.origin)\n let pathname = parsedUrl.pathname\n const prefix = routePrefix && routePrefix !== '/' ? `/${routePrefix.replace(/^\\/+|\\/+$/g, '')}` : ''\n\n if (prefix && (pathname === prefix || pathname.startsWith(`${prefix}/`))) {\n pathname = pathname.slice(prefix.length) || '/'\n }\n\n return `${pathname}${parsedUrl.search}${parsedUrl.hash}`\n}\n","import clsx from 'clsx'\nimport { LoaderCircle, Search as SearchIcon } from 'lucide-react'\nimport { forwardRef } from 'react'\n\nimport { useBuiltInText } from '../../i18n'\n\nexport const SearchInput = forwardRef<\n React.ElementRef<'input'>,\n {\n query: string\n setQuery: (query: string) => void\n onClose: () => void\n onSubmit: () => void\n activeDescendantId?: string\n loading?: boolean\n }\n>(function SearchInput(arg0, inputRef) {\n const { query, setQuery, onClose, onSubmit, activeDescendantId, loading = false } = arg0\n const t = useBuiltInText()\n const Icon = loading ? LoaderCircle : SearchIcon\n\n return (\n <div className=\"clarify-search-input group relative flex h-12\">\n <Icon\n aria-hidden=\"true\"\n className={clsx(\n 'pointer-events-none absolute top-0 left-3 h-full w-5 stroke-(--clarify-theme-tokens-colors-muted)',\n loading && 'animate-spin',\n )}\n />\n <input\n ref={inputRef}\n data-autofocus\n role=\"combobox\"\n aria-expanded={query !== ''}\n aria-controls=\"clarify-search-results\"\n aria-activedescendant={activeDescendantId}\n value={query}\n onChange={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === 'Escape') {\n if (query) setQuery('')\n else onClose()\n }\n if (event.key === 'Enter') {\n event.preventDefault()\n onSubmit()\n }\n }}\n placeholder={t('search.placeholder')}\n className=\"clarify-search-field flex-auto appearance-none bg-transparent pr-4 pl-10 outline-hidden focus:w-full focus:flex-none [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden [&::-webkit-search-results-button]:hidden [&::-webkit-search-results-decoration]:hidden\"\n />\n </div>\n )\n})\n","import { Fragment } from 'react'\nimport type { ReactNode } from 'react'\n\nfunction stripHtml(value: string): string {\n if (typeof document === 'undefined') return value.replace(/<[^>]*>/g, '')\n const template = document.createElement('template')\n template.innerHTML = value\n return template.content.textContent ?? ''\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\ntype HighlightQueryProps = { text: string; query: string }\n\nexport function HighlightQuery(arg0: HighlightQueryProps) {\n const { text, query } = arg0\n\n if (!query) return text\n\n const parts = text.split(new RegExp(`(${escapeRegExp(query)})`, 'ig'))\n\n return (\n <>\n {parts.map((part, index) =>\n part.toLowerCase() === query.toLowerCase() ? (\n <mark key={index} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {part}\n </mark>\n ) : (\n <Fragment key={index}>{part}</Fragment>\n ),\n )}\n </>\n )\n}\n\nfunction renderExcerptNode(node: ChildNode, key: string): ReactNode {\n if (node.nodeType === Node.TEXT_NODE) return node.textContent\n if (node.nodeType !== Node.ELEMENT_NODE) return null\n\n const element = node as HTMLElement\n const children = Array.from(element.childNodes).map((child, index) => renderExcerptNode(child, `${key}-${index}`))\n\n if (element.tagName.toLowerCase() === 'mark') {\n return (\n <mark key={key} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {children}\n </mark>\n )\n }\n\n return <Fragment key={key}>{children}</Fragment>\n}\n\ntype HighlightExcerptProps = { excerpt: string; query: string }\n\nexport function HighlightExcerpt(arg0: HighlightExcerptProps) {\n const { excerpt, query } = arg0\n\n if (typeof document === 'undefined' || !excerpt.includes('<mark')) {\n return <HighlightQuery text={stripHtml(excerpt)} query={query} />\n }\n\n const template = document.createElement('template')\n template.innerHTML = excerpt\n\n return <>{Array.from(template.content.childNodes).map((node, index) => renderExcerptNode(node, String(index)))}</>\n}\n","import clsx from 'clsx'\nimport { Fragment, useId } from 'react'\n\nimport { HighlightExcerpt, HighlightQuery } from './Highlight'\nimport type { SearchDisplayItem } from './types'\n\ntype SearchResultProps = {\n result: SearchDisplayItem\n query: string\n active: boolean\n onActive: () => void\n onSelect: () => void\n}\n\nexport function SearchResult(arg0: SearchResultProps) {\n const { result, query, active, onActive, onSelect } = arg0\n const id = useId()\n const hierarchy = result.type === 'quick'\n ? [result.sectionTitle, result.pageTitle].filter((value): value is string => typeof value === 'string')\n : []\n\n return (\n <li\n id={id}\n className={clsx('clarify-search-result group block cursor-pointer px-4 py-3', active && 'clarify-search-result-active')}\n aria-selected={active}\n onMouseEnter={onActive}\n onMouseMove={onActive}\n onMouseDown={(event) => {\n event.preventDefault()\n onSelect()\n }}\n >\n <div className=\"clarify-search-result-title\">\n <HighlightQuery text={result.title} query={query} />\n </div>\n {hierarchy.length > 0 ? (\n <div className=\"clarify-search-result-hierarchy mt-1 truncate whitespace-nowrap\">\n {hierarchy.map((item, itemIndex, items) => (\n <Fragment key={`${item}-${itemIndex}`}>\n <HighlightQuery text={item} query={query} />\n <span className={itemIndex === items.length - 1 ? 'sr-only' : 'clarify-search-result-separator mx-2'}>/</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n {result.type === 'full-text' && result.excerpt ? (\n <p className=\"clarify-search-result-excerpt mt-1 line-clamp-2 text-xs leading-5 text-(--clarify-theme-tokens-colors-muted)\">\n <HighlightExcerpt excerpt={result.excerpt} query={query} />\n </p>\n ) : null}\n </li>\n )\n}\n","import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react'\nimport clsx from 'clsx'\nimport { SearchX } from 'lucide-react'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport { useBuiltInText } from '../../i18n'\nimport type { NavigationNode, RouteItem } from '../../types'\n\nimport { buildSearchItems } from './items'\nimport { loadPagefind, normalizePagefindUrl, pagefindCacheKey } from './pagefind'\nimport { SearchInput } from './SearchInput'\nimport { SearchResult } from './SearchResult'\nimport type { FullTextSearchItem, Pagefind, SearchDisplayItem } from './types'\n\ntype SearchDialogProps = {\n open: boolean\n setOpen: (open: boolean) => void\n routes: RouteItem[]\n navigation: NavigationNode[]\n routePrefix?: string\n currentLocale?: string\n className?: string\n onNavigate?: () => void\n}\n\ntype PagefindState = {\n key: string\n pagefind: Pagefind | null\n available: boolean\n}\n\ntype FullTextSearchState = {\n key: string\n results: FullTextSearchItem[] | null\n}\n\ntype UseSearchDialogLifecycleArgs = {\n open: boolean\n setOpen: (open: boolean) => void\n}\n\nfunction useSearchDialogLifecycle(arg0: UseSearchDialogLifecycleArgs) {\n const { open, setOpen } = arg0\n const location = useLocation()\n\n useEffect(() => {\n setOpen(false)\n }, [location.pathname, location.search, location.hash, setOpen])\n\n useEffect(() => {\n if (typeof window === 'undefined') return undefined\n if (open) return undefined\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n setOpen(true)\n }\n }\n\n window.addEventListener('keydown', onKeyDown)\n return () => window.removeEventListener('keydown', onKeyDown)\n }, [open, setOpen])\n}\n\ntype UseSearchDataArgs = {\n query: string\n searchItems: ReturnType<typeof buildSearchItems>\n routePrefix: string\n currentLocale?: string\n}\n\ntype SearchDataState = {\n results: SearchDisplayItem[]\n searchInputLoading: boolean\n showNoResults: boolean\n}\n\nfunction useSearchData(arg0: UseSearchDataArgs): SearchDataState {\n const { query, searchItems, routePrefix, currentLocale } = arg0\n const [fullTextState, setFullTextState] = useState<FullTextSearchState | null>(null)\n const [pagefindState, setPagefindState] = useState<PagefindState | null>(null)\n\n const quickResults = useMemo(() => {\n const normalizedQuery = query.trim().toLowerCase()\n if (!normalizedQuery) return []\n return searchItems.filter((item) => item.keywords.includes(normalizedQuery)).slice(0, 8).map((item) => ({ ...item, type: 'quick' as const }))\n }, [query, searchItems])\n\n const pagefindKey = pagefindCacheKey(routePrefix, currentLocale)\n const activePagefindState = pagefindState?.key === pagefindKey ? pagefindState : null\n const pagefind = activePagefindState?.pagefind ?? null\n const pagefindAvailable = activePagefindState?.available ?? null\n const trimmedQuery = query.trim()\n const fullTextKey = `${pagefindKey}:${trimmedQuery}`\n const fullTextResults = fullTextState?.key === fullTextKey ? fullTextState.results : null\n const results: SearchDisplayItem[] = fullTextResults ?? quickResults\n const searchInputLoading = pagefindAvailable === null || Boolean(trimmedQuery && pagefind && fullTextState?.key !== fullTextKey)\n const showNoResults = Boolean(query.trim()) && results.length === 0 && pagefindAvailable !== null\n\n useEffect(() => {\n let cancelled = false\n\n loadPagefind(routePrefix, currentLocale).then((loadedPagefind) => {\n if (cancelled) return\n setPagefindState({ key: pagefindKey, pagefind: loadedPagefind, available: Boolean(loadedPagefind) })\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, pagefindKey, routePrefix])\n\n useEffect(() => {\n let cancelled = false\n if (!trimmedQuery || !pagefind) return undefined\n\n Promise.resolve().then(async () => {\n if (cancelled) return\n\n try {\n const search = await pagefind.search(trimmedQuery, { limit: 8 })\n const data = await Promise.all(search.results.map(async (result) => ({ id: result.id, data: await result.data() })))\n if (cancelled) return\n setFullTextState({\n key: fullTextKey,\n results: data.map(({ id, data }) => ({\n type: 'full-text',\n id,\n title: data.meta.title || data.url,\n url: normalizePagefindUrl(data.url, routePrefix),\n excerpt: data.excerpt,\n })),\n })\n } catch (error: unknown) {\n console.warn('[clarify:search] Pagefind search failed', { currentLocale, query: trimmedQuery, error })\n if (!cancelled) setFullTextState({ key: fullTextKey, results: null })\n }\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, fullTextKey, pagefind, routePrefix, trimmedQuery])\n\n return {\n results,\n searchInputLoading,\n showNoResults,\n }\n}\n\nexport function SearchDialog(arg0: SearchDialogProps) {\n const {\n open,\n setOpen,\n routes,\n navigation,\n routePrefix = '/',\n currentLocale,\n className,\n onNavigate = () => {},\n } = arg0\n\n const t = useBuiltInText()\n const navigate = useNavigate()\n const inputRef = useRef<React.ElementRef<typeof SearchInput>>(null)\n const [query, setQuery] = useState('')\n const [activeIndex, setActiveIndex] = useState(0)\n const searchItems = useMemo(() => buildSearchItems(routes, navigation), [navigation, routes])\n\n useSearchDialogLifecycle({ open, setOpen })\n const { results, searchInputLoading, showNoResults } = useSearchData({ query, searchItems, routePrefix, currentLocale })\n\n const updateQuery = (value: string) => {\n setQuery(value)\n setActiveIndex(0)\n }\n\n function closeDialog() {\n updateQuery('')\n setOpen(false)\n }\n\n function selectResult(result = results[activeIndex]) {\n if (!result) return\n navigate(result.url)\n onNavigate()\n closeDialog()\n }\n\n function renderResultsPanel() {\n return (\n <div className=\"border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) empty:hidden dark:border-zinc-100/5 dark:bg-white/2.5\">\n {showNoResults ? (\n <div className=\"p-6 text-center\">\n <SearchX className=\"mx-auto h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-zinc-600\" />\n <p className=\"mt-2 text-xs text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-400\">\n {t('search.noResults', { query })}\n </p>\n </div>\n ) : null}\n {results.length ? (\n <ul id=\"clarify-search-results\" className=\"clarify-search-results\" role=\"listbox\">\n {results.map((result, resultIndex) => (\n <SearchResult\n key={result.type === 'full-text' ? result.id : result.url}\n result={result}\n query={query}\n active={resultIndex === activeIndex}\n onActive={() => setActiveIndex(resultIndex)}\n onSelect={() => selectResult(result)}\n />\n ))}\n </ul>\n ) : null}\n </div>\n )\n }\n\n return (\n <Dialog open={open} onClose={closeDialog} className={clsx('clarify-search-dialog fixed inset-0 z-50', className)}>\n <DialogBackdrop\n transition\n className=\"clarify-search-backdrop clarify-ui-backdrop fixed inset-0 backdrop-blur-xs data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in\"\n />\n\n <div className=\"fixed inset-0 overflow-y-auto px-4 py-4 sm:px-6 sm:py-20 md:py-32 lg:px-8 lg:py-(--clarify-search-dialog-padding-block-lg)\">\n <DialogPanel\n transition\n className=\"clarify-search-panel mx-auto transform-gpu overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) shadow-xl ring-1 ring-(--clarify-theme-tokens-colors-border) data-closed:scale-95 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:max-w-xl dark:bg-zinc-900 dark:ring-zinc-800\"\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index + 1) % results.length : 0))\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index - 1 + results.length) % results.length : 0))\n }\n }}\n >\n <SearchInput\n ref={inputRef}\n query={query}\n setQuery={updateQuery}\n onClose={closeDialog}\n onSubmit={() => selectResult()}\n loading={searchInputLoading}\n />\n {renderResultsPanel()}\n </DialogPanel>\n </div>\n </Dialog>\n )\n}\n\nexport default SearchDialog\n"],"mappings":";;;;;;;;;;;AAIA,SAAS,iBAAiB,YAA8B;CACtD,MAAM,yBAAS,IAAI,IAAoB;CAEvC,KAAK,MAAM,QAAQ,YACjB,IAAI,KAAK,UAAU,QACjB,KAAK,MAAM,SAAS,KAAK,UACvB,OAAO,IAAI,MAAM,MAAM,KAAK,KAAK;MAGnC,OAAO,IAAI,KAAK,MAAM,KAAK,KAAK;CAIpC,OAAO;AACT;AAEA,SAAgB,iBAAiB,QAAqB,YAA4C;CAChG,MAAM,cAAc,iBAAiB,UAAU;CAE/C,OAAO,OAAO,SAAS,UAAU;EAE/B,IAAI,MAAM,aAAa,OAA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EACX,CAAA,GAED,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;aACb,iBAAA,GAAA,kBAAA,KAAA,CAAC,kBAAA,aAAD;IACE,YAAA;IACA,WAAU;IACV,YAAY,UAAU;KACpB,IAAI,MAAM,QAAQ,aAAa;MAC7B,MAAM,eAAe;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,KAAK,QAAQ,SAAS,CAAE;KAC/E;KACA,IAAI,MAAM,QAAQ,WAAW;MAC3B,MAAM,eAAe;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,IAAI,QAAQ,UAAU,QAAQ,SAAS,CAAE;KAChG;IACF;cAZF,CAcE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;KACE,KAAK;KACE;KACP,UAAU;KACV,SAAS;KACT,gBAAgB,aAAa;KAC7B,SAAS;IACV,CAAA,GACA,mBAAmB,CACT;;EACV,CAAA,CACC;;AAEZ"}
@@ -1,6 +1,7 @@
1
1
  import { ComponentType } from 'react';
2
+ export type ContentDiagnosticKind = 'markdown' | 'mdx' | 'openapi' | 'route-load';
2
3
  export type ContentDiagnostic = {
3
- kind: string;
4
+ kind: ContentDiagnosticKind;
4
5
  title: string;
5
6
  message: string;
6
7
  details?: string;
package/output/client.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ClarifyShell = require("./ClarifyShell-C6li72Ce.cjs");
3
- const require_PageActions = require("./PageActions-BjB6PYmL.cjs");
4
- const require_render = require("./render-Di5B6Zc0.cjs");
2
+ const require_ClarifyShell = require("./ClarifyShell-UsefuuLS.cjs");
3
+ const require_PageActions = require("./PageActions-Dg1l9KB1.cjs");
4
+ const require_render = require("./render-Dc9wxg_r.cjs");
5
5
  exports.ThemeEditor = require_ClarifyShell.ThemeEditor;
6
6
  exports.applyThemeVariables = require_ClarifyShell.applyThemeVariables;
7
7
  exports.getStoredLocalePreference = require_PageActions.getStoredLocalePreference;
package/output/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ClarifyShell-1LuBliwt.js";
2
- import { S as themeCookieName, _ as getStoredThemePreference, b as storeLocalePreference, g as getStoredLocalePreference, v as localeCookieName, x as storeThemePreference, y as readLocaleCookie } from "./PageActions-D7K9LDGf.js";
3
- import { t as render } from "./render-DKj24Jqw.js";
1
+ import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ClarifyShell-Cq5Af46F.js";
2
+ import { S as themeCookieName, _ as getStoredThemePreference, b as storeLocalePreference, g as getStoredLocalePreference, v as localeCookieName, x as storeThemePreference, y as readLocaleCookie } from "./PageActions-BQeEmXbT.js";
3
+ import { t as render } from "./render-aS-w4fK4.js";
4
4
  export { ThemeEditor, applyThemeVariables, getStoredLocalePreference, getStoredThemePreference, localeCookieName, readLocaleCookie, render, storeLocalePreference, storeThemePreference, themeBootstrapScript, themeCookieName, themeEditorPresets, themeStorageKey };
@@ -0,0 +1,7 @@
1
+ import { ComponentPropsWithoutRef, ReactElement } from 'react';
2
+ import { CollapseProps } from './Collapse';
3
+ export type AccordionGroupProps = {
4
+ children?: ReactElement<CollapseProps> | ReactElement<CollapseProps>[];
5
+ multiple?: boolean;
6
+ } & ComponentPropsWithoutRef<'div'>;
7
+ export declare function AccordionGroup(arg0: AccordionGroupProps): import("react").JSX.Element;
@@ -4,6 +4,8 @@ export type CollapseProps = {
4
4
  title?: ReactNode;
5
5
  summary?: ReactNode;
6
6
  defaultOpen?: boolean;
7
+ open?: boolean;
8
+ onOpenChange?: (open: boolean) => void;
7
9
  className?: string;
8
10
  } & Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'className'>;
9
11
  export declare function Collapse(arg0: CollapseProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ export type FileTreeProps = ComponentPropsWithoutRef<'div'>;
3
+ export declare function FileTree(arg0: FileTreeProps): import("react").JSX.Element;
4
+ export type FileTreeItemProps = {
5
+ name: ReactNode;
6
+ description?: ReactNode;
7
+ type?: 'file' | 'folder';
8
+ children?: ReactNode;
9
+ } & Omit<ComponentPropsWithoutRef<'li'>, 'children'>;
10
+ export declare function FileTreeItem(arg0: FileTreeItemProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ export type ImageProps = ComponentPropsWithoutRef<'img'> & {
3
+ caption?: ReactNode;
4
+ zoom?: boolean;
5
+ };
6
+ export declare function Image(arg0: ImageProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ export type StepsProps = {
3
+ children: ReactNode;
4
+ className?: string;
5
+ } & Omit<ComponentPropsWithoutRef<'ol'>, 'children' | 'className'>;
6
+ export declare function Steps(arg0: StepsProps): import("react").JSX.Element;
7
+ export type StepProps = {
8
+ children: ReactNode;
9
+ title?: ReactNode;
10
+ className?: string;
11
+ } & Omit<ComponentPropsWithoutRef<'li'>, 'children' | 'className' | 'title'>;
12
+ export declare function Step(arg0: StepProps): import("react").JSX.Element;
@@ -1,16 +1,23 @@
1
1
  import { ReactNode } from 'react';
2
- type ClarifyTabItem = {
2
+ export type TabItem = {
3
3
  id: string;
4
4
  label: ReactNode;
5
5
  panel: ReactNode;
6
6
  };
7
- type ClarifyTabsProps = {
8
- items: ClarifyTabItem[];
7
+ export type TabProps = {
8
+ title: ReactNode;
9
+ children: ReactNode;
10
+ value?: string;
11
+ };
12
+ export declare function TabItem(_props: TabProps): null;
13
+ export type TabsProps = {
14
+ items?: TabItem[];
15
+ children?: ReactNode;
16
+ defaultValue?: string;
9
17
  selectedIndex?: number;
10
18
  onChange?: (index: number) => void;
11
19
  className?: string;
12
20
  listClassName?: string;
13
21
  panelsClassName?: string;
14
22
  };
15
- export declare function Tabs(arg0: ClarifyTabsProps): import("react").JSX.Element;
16
- export {};
23
+ export declare function Tabs(arg0: TabsProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ export type TooltipProps = {
3
+ content: ReactNode;
4
+ children: ReactNode;
5
+ side?: 'top' | 'bottom';
6
+ } & Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'content'>;
7
+ export declare function Tooltip(arg0: TooltipProps): import("react").JSX.Element;
@@ -1,3 +1,5 @@
1
+ export { AccordionGroup } from './AccordionGroup';
2
+ export type { AccordionGroupProps } from './AccordionGroup';
1
3
  export { Button } from './Button';
2
4
  export type { ButtonProps } from './Button';
3
5
  export { Callout } from './Callout';
@@ -8,6 +10,8 @@ export { Code, CodeGroup, Pre } from './Code';
8
10
  export { Collapse } from './Collapse';
9
11
  export type { CollapseProps } from './Collapse';
10
12
  export { Feedback } from './Feedback';
13
+ export { FileTree, FileTreeItem } from './FileTree';
14
+ export type { FileTreeItemProps, FileTreeProps } from './FileTree';
11
15
  export { Heading } from './Heading';
12
16
  export { LocalizedLink, useLocalizedHref } from './LocalizedLink';
13
17
  export type { LocalizedLinkProps } from './LocalizedLink';
@@ -15,8 +19,13 @@ export { Logo } from './Logo';
15
19
  export { Mermaid } from './Mermaid';
16
20
  export { GridPattern, HeroPattern } from './patterns';
17
21
  export { Prose } from './Prose';
22
+ export { Step, Steps } from './Steps';
23
+ export type { StepProps, StepsProps } from './Steps';
18
24
  export { Tag } from './Tag';
19
25
  export type { TagProps } from './Tag';
20
- export { Tabs } from './Tabs';
26
+ export { TabItem as Tab, Tabs } from './Tabs';
27
+ export type { TabItem, TabProps, TabsProps } from './Tabs';
28
+ export { Tooltip } from './Tooltip';
29
+ export type { TooltipProps } from './Tooltip';
21
30
  export { WebFrame } from './WebFrame';
22
31
  export type { WebFrameProps } from './WebFrame';
@@ -1,5 +1,5 @@
1
1
  export type BuiltInLocale = 'en' | 'zh-CN';
2
- export type BuiltInTextKey = 'actions.code' | 'actions.copy' | 'actions.copied' | 'builtWith.label' | 'builtWith.prefix' | 'callout.danger' | 'callout.info' | 'callout.note' | 'callout.success' | 'callout.tip' | 'callout.warning' | 'contentActions.copyContent' | 'contentActions.copyContentDescription' | 'contentActions.copyLink' | 'contentActions.copyLinkDescription' | 'contentActions.copyLlms' | 'contentActions.copyLlmsDescription' | 'contentActions.copiedLlms' | 'contentActions.editPage' | 'contentActions.editPageDescription' | 'contentActions.copyOptions' | 'contentActions.copiedContent' | 'contentActions.copiedLink' | 'contentActions.viewMarkdown' | 'contentActions.viewMarkdownDescription' | 'contentActions.viewOpenApi' | 'contentActions.viewOpenApiDescription' | 'feedback.no' | 'feedback.prompt' | 'feedback.thanks' | 'feedback.yes' | 'navigation.documentation' | 'navigation.next' | 'navigation.previous' | 'navigation.previousNext' | 'navigation.toggle' | 'navbar.home' | 'navbar.openLinks' | 'navbar.sections' | 'notFound.description' | 'notFound.home' | 'notFound.label' | 'notFound.title' | 'openapi.apiDocumentation' | 'openapi.bodyProperties' | 'openapi.collapse' | 'openapi.endpointNotFound' | 'openapi.example' | 'openapi.expand' | 'openapi.headers' | 'openapi.language' | 'openapi.client' | 'openapi.loading' | 'openapi.mediaType' | 'openapi.none' | 'openapi.openApiReference' | 'openapi.operationParameter' | 'openapi.optional' | 'openapi.parameter' | 'openapi.pathParameters' | 'openapi.queryParameters' | 'openapi.request' | 'openapi.requestBody' | 'openapi.requestBodyEmpty' | 'openapi.responseBodyProperties' | 'openapi.required' | 'openapi.requiredBadge' | 'openapi.response' | 'openapi.responses' | 'openapi.schemaExample' | 'openapi.scrollExamplesLeft' | 'openapi.scrollExamplesRight' | 'openapi.specNotFound' | 'openapi.specPathMissing' | 'openapi.status' | 'openapi.version' | 'openapi.webhookResponse' | 'openapi.webhookResponses' | 'search.button' | 'search.noResults' | 'search.placeholder' | 'search.shortcutCtrl' | 'renderError.componentStack' | 'renderError.description' | 'renderError.details' | 'renderError.message' | 'renderError.path' | 'renderError.reload' | 'renderError.stack' | 'renderError.title' | 'renderError.version' | 'renderError.type' | 'theme.switchToDark' | 'theme.switchToLight' | 'theme.switchToSystem' | 'language.switch' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.resetZoom' | 'mermaid.renderError' | 'mermaid.scrollHint';
2
+ export type BuiltInTextKey = 'actions.code' | 'actions.copy' | 'actions.copying' | 'actions.copied' | 'actions.copyFailed' | 'builtWith.label' | 'builtWith.prefix' | 'callout.danger' | 'callout.info' | 'callout.note' | 'callout.success' | 'callout.tip' | 'callout.warning' | 'contentActions.copyContent' | 'contentActions.copyContentDescription' | 'contentActions.copyLink' | 'contentActions.copyLinkDescription' | 'contentActions.copyLlms' | 'contentActions.copyLlmsDescription' | 'contentActions.copiedLlms' | 'contentActions.editPage' | 'contentActions.editPageDescription' | 'contentActions.copyOptions' | 'contentActions.copiedContent' | 'contentActions.copiedLink' | 'contentActions.viewMarkdown' | 'contentActions.viewMarkdownDescription' | 'contentActions.viewOpenApi' | 'contentActions.viewOpenApiDescription' | 'feedback.no' | 'feedback.prompt' | 'feedback.thanks' | 'feedback.yes' | 'navigation.documentation' | 'navigation.next' | 'navigation.previous' | 'navigation.previousNext' | 'navigation.toggle' | 'navbar.home' | 'navbar.openLinks' | 'navbar.sections' | 'notFound.description' | 'notFound.home' | 'notFound.label' | 'notFound.title' | 'openapi.apiDocumentation' | 'openapi.bodyProperties' | 'openapi.collapse' | 'openapi.endpointNotFound' | 'openapi.example' | 'openapi.expand' | 'openapi.headers' | 'openapi.language' | 'openapi.client' | 'openapi.loading' | 'openapi.mediaType' | 'openapi.none' | 'openapi.openApiReference' | 'openapi.operationParameter' | 'openapi.optional' | 'openapi.parameter' | 'openapi.pathParameters' | 'openapi.queryParameters' | 'openapi.request' | 'openapi.requestBody' | 'openapi.requestBodyEmpty' | 'openapi.responseBodyProperties' | 'openapi.required' | 'openapi.requiredBadge' | 'openapi.response' | 'openapi.responses' | 'openapi.schemaExample' | 'openapi.scrollExamplesLeft' | 'openapi.scrollExamplesRight' | 'openapi.specNotFound' | 'openapi.specPathMissing' | 'openapi.status' | 'openapi.version' | 'openapi.webhookResponse' | 'openapi.webhookResponses' | 'search.button' | 'search.noResults' | 'search.placeholder' | 'search.shortcutCtrl' | 'renderError.componentStack' | 'renderError.description' | 'renderError.details' | 'renderError.message' | 'renderError.path' | 'renderError.reload' | 'renderError.stack' | 'renderError.title' | 'renderError.version' | 'renderError.type' | 'theme.switchToDark' | 'theme.switchToLight' | 'theme.switchToSystem' | 'language.switch' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.resetZoom' | 'mermaid.renderError' | 'mermaid.scrollHint';
3
3
  export declare function resolveBuiltInLocale(locale?: string): BuiltInLocale;
4
4
  export declare function translateBuiltInText(locale: string | undefined, key: BuiltInTextKey, replacements?: Record<string, string>): string;
5
5
  export declare function useBuiltInText(locale?: string): (key: BuiltInTextKey, replacements?: Record<string, string>) => string;
@@ -23,7 +23,9 @@ var builtInText = {
23
23
  en: {
24
24
  "actions.code": "Code",
25
25
  "actions.copy": "Copy",
26
+ "actions.copying": "Copying...",
26
27
  "actions.copied": "Copied!",
28
+ "actions.copyFailed": "Copy failed",
27
29
  "builtWith.label": "Built with Clarify",
28
30
  "builtWith.prefix": "Built with",
29
31
  "callout.danger": "Danger",
@@ -126,7 +128,9 @@ var builtInText = {
126
128
  "zh-CN": {
127
129
  "actions.code": "代码",
128
130
  "actions.copy": "复制",
131
+ "actions.copying": "正在复制...",
129
132
  "actions.copied": "已复制!",
133
+ "actions.copyFailed": "复制失败",
130
134
  "builtWith.label": "由 Clarify 构建",
131
135
  "builtWith.prefix": "构建来自",
132
136
  "callout.danger": "危险",
@@ -244,4 +248,4 @@ function useBuiltInText(locale) {
244
248
  //#endregion
245
249
  export { useConfig as a, useOpenApiSpecs as c, OpenApiSpecsContext as i, ConfigContext as n, useConfigOptional as o, LocaleContext as r, useLocale as s, useBuiltInText as t };
246
250
 
247
- //# sourceMappingURL=i18n-DnqZHFT7.js.map
251
+ //# sourceMappingURL=i18n-Bqth9d6Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-Bqth9d6Q.js","names":[],"sources":["../source/core/context.tsx","../source/core/i18n.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { Config, OpenApiRegistry } from './types'\n\nexport const ConfigContext = createContext<Config | null>(null)\nexport const LocaleContext = createContext<string | undefined>(undefined)\nexport const OpenApiSpecsContext = createContext<OpenApiRegistry>({})\n\nexport function useConfig(): Config {\n const config = useContext(ConfigContext)\n if (!config) {\n throw new Error(\n '[clarify] useConfig must be used within a ConfigContext.Provider'\n )\n }\n return config\n}\n\nexport function useConfigOptional(): Config | null {\n return useContext(ConfigContext)\n}\n\nexport function useLocale(): string | undefined {\n return useContext(LocaleContext)\n}\n\nexport function useOpenApiSpecs(): OpenApiRegistry {\n return useContext(OpenApiSpecsContext)\n}\n","import { useContext } from 'react'\n\nimport { ConfigContext, LocaleContext } from './context'\n\nexport type BuiltInLocale = 'en' | 'zh-CN'\n\nexport type BuiltInTextKey =\n | 'actions.code'\n | 'actions.copy'\n | 'actions.copying'\n | 'actions.copied'\n | 'actions.copyFailed'\n | 'builtWith.label'\n | 'builtWith.prefix'\n | 'callout.danger'\n | 'callout.info'\n | 'callout.note'\n | 'callout.success'\n | 'callout.tip'\n | 'callout.warning'\n | 'contentActions.copyContent'\n | 'contentActions.copyContentDescription'\n | 'contentActions.copyLink'\n | 'contentActions.copyLinkDescription'\n | 'contentActions.copyLlms'\n | 'contentActions.copyLlmsDescription'\n | 'contentActions.copiedLlms'\n | 'contentActions.editPage'\n | 'contentActions.editPageDescription'\n | 'contentActions.copyOptions'\n | 'contentActions.copiedContent'\n | 'contentActions.copiedLink'\n | 'contentActions.viewMarkdown'\n | 'contentActions.viewMarkdownDescription'\n | 'contentActions.viewOpenApi'\n | 'contentActions.viewOpenApiDescription'\n | 'feedback.no'\n | 'feedback.prompt'\n | 'feedback.thanks'\n | 'feedback.yes'\n | 'navigation.documentation'\n | 'navigation.next'\n | 'navigation.previous'\n | 'navigation.previousNext'\n | 'navigation.toggle'\n | 'navbar.home'\n | 'navbar.openLinks'\n | 'navbar.sections'\n | 'notFound.description'\n | 'notFound.home'\n | 'notFound.label'\n | 'notFound.title'\n | 'openapi.apiDocumentation'\n | 'openapi.bodyProperties'\n | 'openapi.collapse'\n | 'openapi.endpointNotFound'\n | 'openapi.example'\n | 'openapi.expand'\n | 'openapi.headers'\n | 'openapi.language'\n | 'openapi.client'\n | 'openapi.loading'\n | 'openapi.mediaType'\n | 'openapi.none'\n | 'openapi.openApiReference'\n | 'openapi.operationParameter'\n | 'openapi.optional'\n | 'openapi.parameter'\n | 'openapi.pathParameters'\n | 'openapi.queryParameters'\n | 'openapi.request'\n | 'openapi.requestBody'\n | 'openapi.requestBodyEmpty'\n | 'openapi.responseBodyProperties'\n | 'openapi.required'\n | 'openapi.requiredBadge'\n | 'openapi.response'\n | 'openapi.responses'\n | 'openapi.schemaExample'\n | 'openapi.scrollExamplesLeft'\n | 'openapi.scrollExamplesRight'\n | 'openapi.specNotFound'\n | 'openapi.specPathMissing'\n | 'openapi.status'\n | 'openapi.version'\n | 'openapi.webhookResponse'\n | 'openapi.webhookResponses'\n | 'search.button'\n | 'search.noResults'\n | 'search.placeholder'\n | 'search.shortcutCtrl'\n | 'renderError.componentStack'\n | 'renderError.description'\n | 'renderError.details'\n | 'renderError.message'\n | 'renderError.path'\n | 'renderError.reload'\n | 'renderError.stack'\n | 'renderError.title'\n | 'renderError.version'\n | 'renderError.type'\n | 'theme.switchToDark'\n | 'theme.switchToLight'\n | 'theme.switchToSystem'\n | 'language.switch'\n | 'mermaid.zoomIn'\n | 'mermaid.zoomOut'\n | 'mermaid.resetZoom'\n | 'mermaid.renderError'\n | 'mermaid.scrollHint'\n\nconst builtInText = {\n en: {\n 'actions.code': 'Code',\n 'actions.copy': 'Copy',\n 'actions.copying': 'Copying...',\n 'actions.copied': 'Copied!',\n 'actions.copyFailed': 'Copy failed',\n 'builtWith.label': 'Built with Clarify',\n 'builtWith.prefix': 'Built with',\n 'callout.danger': 'Danger',\n 'callout.info': 'Info',\n 'callout.note': 'Note',\n 'callout.success': 'Success',\n 'callout.tip': 'Tip',\n 'callout.warning': 'Warning',\n 'contentActions.copyContent': 'Copy page',\n 'contentActions.copyContentDescription': 'Copy this page as {contentType} for LLMs',\n 'contentActions.copyLink': 'Copy {contentType} link',\n 'contentActions.copyLinkDescription': 'Copy the raw {contentType} content link for this page',\n 'contentActions.copyLlms': 'Copy llms.txt',\n 'contentActions.copyLlmsDescription': 'Copy the llms.txt link for this site',\n 'contentActions.copiedLlms': 'Copied llms.txt',\n 'contentActions.editPage': 'Edit this page',\n 'contentActions.editPageDescription': 'Open the source file for this page',\n 'contentActions.copyOptions': 'Choose copy option',\n 'contentActions.copiedContent': 'Copied page',\n 'contentActions.copiedLink': 'Copied link',\n 'contentActions.viewMarkdown': 'View as Markdown',\n 'contentActions.viewMarkdownDescription': 'View this page as plain text',\n 'contentActions.viewOpenApi': 'View raw OpenAPI',\n 'contentActions.viewOpenApiDescription': 'Open the API description file in a new tab',\n 'feedback.no': 'No',\n 'feedback.prompt': 'Was this page helpful?',\n 'feedback.thanks': 'Thanks for your feedback!',\n 'feedback.yes': 'Yes',\n 'navigation.documentation': 'Documentation',\n 'navigation.next': 'Next',\n 'navigation.previous': 'Previous',\n 'navigation.previousNext': 'Previous and next pages',\n 'navigation.toggle': 'Toggle navigation',\n 'navbar.home': 'Home',\n 'navbar.openLinks': 'Open navigation links',\n 'navbar.sections': 'Documentation sections',\n 'notFound.description': 'The page may have moved, been renamed, or never existed. Check the address or return to the homepage.',\n 'notFound.home': 'Back to homepage',\n 'notFound.label': '404',\n 'notFound.title': 'Page not found',\n 'openapi.apiDocumentation': 'API Documentation',\n 'openapi.bodyProperties': 'Body properties',\n 'openapi.collapse': 'Collapse',\n 'openapi.endpointNotFound': 'Endpoint not found: {endpoint}',\n 'openapi.example': 'Example',\n 'openapi.expand': 'Expand',\n 'openapi.headers': 'Headers',\n 'openapi.language': 'Language',\n 'openapi.client': 'Client',\n 'openapi.loading': 'Loading OpenAPI spec...',\n 'openapi.mediaType': 'Media type',\n 'openapi.none': 'None',\n 'openapi.openApiReference': 'OpenAPI Reference',\n 'openapi.operationParameter': 'Operation parameter.',\n 'openapi.optional': 'Optional.',\n 'openapi.parameter': 'parameter',\n 'openapi.pathParameters': 'Path parameters',\n 'openapi.queryParameters': 'Query parameters',\n 'openapi.request': 'Request',\n 'openapi.requestBody': 'Request body',\n 'openapi.requestBodyEmpty': 'No request body',\n 'openapi.responseBodyProperties': 'Response body properties',\n 'openapi.required': 'Required.',\n 'openapi.requiredBadge': 'required',\n 'openapi.response': 'Response',\n 'openapi.responses': 'Responses',\n 'openapi.schemaExample': 'Schema example',\n 'openapi.scrollExamplesLeft': 'Scroll examples left',\n 'openapi.scrollExamplesRight': 'Scroll examples right',\n 'openapi.specNotFound': 'OpenAPI spec not found: {specPath}',\n 'openapi.specPathMissing': 'spec or specPath was not provided',\n 'openapi.status': 'Status',\n 'openapi.version': 'Version {version}',\n 'openapi.webhookResponse': 'Webhook response',\n 'openapi.webhookResponses': 'Webhook responses',\n 'search.button': 'Search...',\n 'search.noResults': 'Nothing found for {query}.',\n 'search.placeholder': 'Find something...',\n 'search.shortcutCtrl': 'Ctrl ',\n 'renderError.componentStack': 'React component stack',\n 'renderError.description': 'Clarify stopped rendering this route to keep the rest of the shell responsive. Review the diagnostics below, fix the page source, then reload the route.',\n 'renderError.details': 'Runtime diagnostics',\n 'renderError.message': 'Message',\n 'renderError.path': 'Route',\n 'renderError.reload': 'Reload route',\n 'renderError.stack': 'JavaScript stack trace',\n 'renderError.title': 'Route render failed',\n 'renderError.type': 'Error type',\n 'renderError.version': 'Clarify version',\n 'theme.switchToDark': 'Switch to dark theme',\n 'theme.switchToLight': 'Switch to light theme',\n 'theme.switchToSystem': 'Follow system theme',\n 'language.switch': 'Switch language',\n 'mermaid.zoomIn': 'Zoom in',\n 'mermaid.zoomOut': 'Zoom out',\n 'mermaid.resetZoom': 'Reset zoom',\n 'mermaid.renderError': 'Mermaid render error',\n 'mermaid.scrollHint': 'Click the diagram to enable scroll-to-zoom',\n },\n 'zh-CN': {\n 'actions.code': '代码',\n 'actions.copy': '复制',\n 'actions.copying': '正在复制...',\n 'actions.copied': '已复制!',\n 'actions.copyFailed': '复制失败',\n 'builtWith.label': '由 Clarify 构建',\n 'builtWith.prefix': '构建来自',\n 'callout.danger': '危险',\n 'callout.info': '信息',\n 'callout.note': '注意',\n 'callout.success': '成功',\n 'callout.tip': '提示',\n 'callout.warning': '警告',\n 'contentActions.copyContent': '复制页面',\n 'contentActions.copyContentDescription': '将页面以 {contentType} 格式复制给 LLMs',\n 'contentActions.copyLink': '复制 {contentType} 链接',\n 'contentActions.copyLinkDescription': '复制当前页面的 {contentType} 原始内容链接',\n 'contentActions.copyLlms': '复制 llms.txt',\n 'contentActions.copyLlmsDescription': '复制此站点的 llms.txt 链接',\n 'contentActions.copiedLlms': '已复制 llms.txt',\n 'contentActions.editPage': '编辑此页面',\n 'contentActions.editPageDescription': '打开当前页面的源文件',\n 'contentActions.copyOptions': '选择复制选项',\n 'contentActions.copiedContent': '已复制页面',\n 'contentActions.copiedLink': '已复制链接',\n 'contentActions.viewMarkdown': '以 Markdown 格式查看',\n 'contentActions.viewMarkdownDescription': '以纯文本查看此页面',\n 'contentActions.viewOpenApi': '查看 OpenAPI 原始内容',\n 'contentActions.viewOpenApiDescription': '在新标签页打开 API 描述文件',\n 'feedback.no': '否',\n 'feedback.prompt': '这个页面有帮助吗?',\n 'feedback.thanks': '感谢你的反馈!',\n 'feedback.yes': '是',\n 'navigation.documentation': '文档',\n 'navigation.next': '下一页',\n 'navigation.previous': '上一页',\n 'navigation.previousNext': '上一页和下一页',\n 'navigation.toggle': '切换导航',\n 'navbar.home': '首页',\n 'navbar.openLinks': '打开导航链接',\n 'navbar.sections': '文档栏目',\n 'notFound.description': '页面可能已移动、重命名或不存在。请检查地址,或返回首页继续浏览。',\n 'notFound.home': '返回首页',\n 'notFound.label': '404',\n 'notFound.title': '页面未找到',\n 'openapi.apiDocumentation': 'API 文档',\n 'openapi.bodyProperties': '请求体属性',\n 'openapi.collapse': '收起',\n 'openapi.endpointNotFound': '未找到端点:{endpoint}',\n 'openapi.example': '示例',\n 'openapi.expand': '展开',\n 'openapi.headers': '请求头',\n 'openapi.language': '语言',\n 'openapi.client': '客户端',\n 'openapi.loading': '正在加载 OpenAPI 描述文件...',\n 'openapi.mediaType': '媒体类型',\n 'openapi.none': '无',\n 'openapi.openApiReference': 'OpenAPI 参考',\n 'openapi.operationParameter': '操作参数。',\n 'openapi.optional': '可选。',\n 'openapi.parameter': '参数',\n 'openapi.pathParameters': '路径参数',\n 'openapi.queryParameters': '查询参数',\n 'openapi.request': '请求',\n 'openapi.requestBody': '请求体',\n 'openapi.requestBodyEmpty': '暂无请求体',\n 'openapi.responseBodyProperties': '响应体属性',\n 'openapi.required': '必填。',\n 'openapi.requiredBadge': '必填',\n 'openapi.response': '响应',\n 'openapi.responses': '响应',\n 'openapi.schemaExample': 'Schema 示例',\n 'openapi.scrollExamplesLeft': '向左滚动示例',\n 'openapi.scrollExamplesRight': '向右滚动示例',\n 'openapi.specNotFound': '未找到 OpenAPI 描述文件:{specPath}',\n 'openapi.specPathMissing': '未提供 spec 或 specPath',\n 'openapi.status': '状态',\n 'openapi.version': '版本 {version}',\n 'openapi.webhookResponse': 'Webhook 响应',\n 'openapi.webhookResponses': 'Webhook 响应',\n 'search.button': '搜索...',\n 'search.noResults': '没有找到与 {query} 相关的结果。',\n 'search.placeholder': '搜索内容...',\n 'search.shortcutCtrl': 'Ctrl ',\n 'renderError.componentStack': 'React 组件栈',\n 'renderError.description': 'Clarify 已停止渲染此路由,以保证文档 Shell 仍可响应。请查看下方诊断信息,修复页面源码后重新加载路由。',\n 'renderError.details': '运行时诊断',\n 'renderError.message': '错误消息',\n 'renderError.path': '路由',\n 'renderError.reload': '重新加载路由',\n 'renderError.stack': 'JavaScript 堆栈',\n 'renderError.title': '路由渲染失败',\n 'renderError.type': '错误类型',\n 'renderError.version': 'Clarify 版本',\n 'theme.switchToDark': '切换到深色主题',\n 'theme.switchToLight': '切换到浅色主题',\n 'theme.switchToSystem': '跟随系统主题',\n 'language.switch': '切换语言',\n 'mermaid.zoomIn': '放大',\n 'mermaid.zoomOut': '缩小',\n 'mermaid.resetZoom': '重置缩放',\n 'mermaid.renderError': 'Mermaid 渲染错误',\n 'mermaid.scrollHint': '点击图表后即可滚轮缩放',\n },\n} satisfies Record<BuiltInLocale, Record<BuiltInTextKey, string>>\n\nexport function resolveBuiltInLocale(locale?: string): BuiltInLocale {\n return locale === 'zh-CN' || locale?.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en'\n}\n\nexport function translateBuiltInText(locale: string | undefined, key: BuiltInTextKey, replacements: Record<string, string> = {}): string {\n let value = builtInText[resolveBuiltInLocale(locale)]?.[key] ?? builtInText.en[key]\n for (const [name, replacement] of Object.entries(replacements)) {\n value = value.replaceAll(`{${name}}`, replacement)\n }\n return value\n}\n\nexport function useBuiltInText(locale?: string) {\n const config = useContext(ConfigContext)\n const currentLocale = useContext(LocaleContext)\n const resolvedLocale = locale ?? currentLocale ?? config?.i18n?.defaultLocale\n return (key: BuiltInTextKey, replacements?: Record<string, string>) => translateBuiltInText(resolvedLocale, key, replacements)\n}\n"],"mappings":";;AAIA,IAAa,gBAAgB,cAA6B,IAAI;AAC9D,IAAa,gBAAgB,cAAkC,KAAA,CAAS;AACxE,IAAa,sBAAsB,cAA+B,CAAC,CAAC;AAEpE,SAAgB,YAAoB;CAClC,MAAM,SAAS,WAAW,aAAa;CACvC,IAAI,CAAC,QACH,MAAM,IAAI,MACR,kEACF;CAEF,OAAO;AACT;AAEA,SAAgB,oBAAmC;CACjD,OAAO,WAAW,aAAa;AACjC;AAEA,SAAgB,YAAgC;CAC9C,OAAO,WAA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K,YAAY;AAC/H"}
@@ -23,7 +23,9 @@ var builtInText = {
23
23
  en: {
24
24
  "actions.code": "Code",
25
25
  "actions.copy": "Copy",
26
+ "actions.copying": "Copying...",
26
27
  "actions.copied": "Copied!",
28
+ "actions.copyFailed": "Copy failed",
27
29
  "builtWith.label": "Built with Clarify",
28
30
  "builtWith.prefix": "Built with",
29
31
  "callout.danger": "Danger",
@@ -126,7 +128,9 @@ var builtInText = {
126
128
  "zh-CN": {
127
129
  "actions.code": "代码",
128
130
  "actions.copy": "复制",
131
+ "actions.copying": "正在复制...",
129
132
  "actions.copied": "已复制!",
133
+ "actions.copyFailed": "复制失败",
130
134
  "builtWith.label": "由 Clarify 构建",
131
135
  "builtWith.prefix": "构建来自",
132
136
  "callout.danger": "危险",
@@ -291,4 +295,4 @@ Object.defineProperty(exports, "useOpenApiSpecs", {
291
295
  }
292
296
  });
293
297
 
294
- //# sourceMappingURL=i18n-b4iTLeia.cjs.map
298
+ //# sourceMappingURL=i18n-C-fReCj-.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-C-fReCj-.cjs","names":[],"sources":["../source/core/context.tsx","../source/core/i18n.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { Config, OpenApiRegistry } from './types'\n\nexport const ConfigContext = createContext<Config | null>(null)\nexport const LocaleContext = createContext<string | undefined>(undefined)\nexport const OpenApiSpecsContext = createContext<OpenApiRegistry>({})\n\nexport function useConfig(): Config {\n const config = useContext(ConfigContext)\n if (!config) {\n throw new Error(\n '[clarify] useConfig must be used within a ConfigContext.Provider'\n )\n }\n return config\n}\n\nexport function useConfigOptional(): Config | null {\n return useContext(ConfigContext)\n}\n\nexport function useLocale(): string | undefined {\n return useContext(LocaleContext)\n}\n\nexport function useOpenApiSpecs(): OpenApiRegistry {\n return useContext(OpenApiSpecsContext)\n}\n","import { useContext } from 'react'\n\nimport { ConfigContext, LocaleContext } from './context'\n\nexport type BuiltInLocale = 'en' | 'zh-CN'\n\nexport type BuiltInTextKey =\n | 'actions.code'\n | 'actions.copy'\n | 'actions.copying'\n | 'actions.copied'\n | 'actions.copyFailed'\n | 'builtWith.label'\n | 'builtWith.prefix'\n | 'callout.danger'\n | 'callout.info'\n | 'callout.note'\n | 'callout.success'\n | 'callout.tip'\n | 'callout.warning'\n | 'contentActions.copyContent'\n | 'contentActions.copyContentDescription'\n | 'contentActions.copyLink'\n | 'contentActions.copyLinkDescription'\n | 'contentActions.copyLlms'\n | 'contentActions.copyLlmsDescription'\n | 'contentActions.copiedLlms'\n | 'contentActions.editPage'\n | 'contentActions.editPageDescription'\n | 'contentActions.copyOptions'\n | 'contentActions.copiedContent'\n | 'contentActions.copiedLink'\n | 'contentActions.viewMarkdown'\n | 'contentActions.viewMarkdownDescription'\n | 'contentActions.viewOpenApi'\n | 'contentActions.viewOpenApiDescription'\n | 'feedback.no'\n | 'feedback.prompt'\n | 'feedback.thanks'\n | 'feedback.yes'\n | 'navigation.documentation'\n | 'navigation.next'\n | 'navigation.previous'\n | 'navigation.previousNext'\n | 'navigation.toggle'\n | 'navbar.home'\n | 'navbar.openLinks'\n | 'navbar.sections'\n | 'notFound.description'\n | 'notFound.home'\n | 'notFound.label'\n | 'notFound.title'\n | 'openapi.apiDocumentation'\n | 'openapi.bodyProperties'\n | 'openapi.collapse'\n | 'openapi.endpointNotFound'\n | 'openapi.example'\n | 'openapi.expand'\n | 'openapi.headers'\n | 'openapi.language'\n | 'openapi.client'\n | 'openapi.loading'\n | 'openapi.mediaType'\n | 'openapi.none'\n | 'openapi.openApiReference'\n | 'openapi.operationParameter'\n | 'openapi.optional'\n | 'openapi.parameter'\n | 'openapi.pathParameters'\n | 'openapi.queryParameters'\n | 'openapi.request'\n | 'openapi.requestBody'\n | 'openapi.requestBodyEmpty'\n | 'openapi.responseBodyProperties'\n | 'openapi.required'\n | 'openapi.requiredBadge'\n | 'openapi.response'\n | 'openapi.responses'\n | 'openapi.schemaExample'\n | 'openapi.scrollExamplesLeft'\n | 'openapi.scrollExamplesRight'\n | 'openapi.specNotFound'\n | 'openapi.specPathMissing'\n | 'openapi.status'\n | 'openapi.version'\n | 'openapi.webhookResponse'\n | 'openapi.webhookResponses'\n | 'search.button'\n | 'search.noResults'\n | 'search.placeholder'\n | 'search.shortcutCtrl'\n | 'renderError.componentStack'\n | 'renderError.description'\n | 'renderError.details'\n | 'renderError.message'\n | 'renderError.path'\n | 'renderError.reload'\n | 'renderError.stack'\n | 'renderError.title'\n | 'renderError.version'\n | 'renderError.type'\n | 'theme.switchToDark'\n | 'theme.switchToLight'\n | 'theme.switchToSystem'\n | 'language.switch'\n | 'mermaid.zoomIn'\n | 'mermaid.zoomOut'\n | 'mermaid.resetZoom'\n | 'mermaid.renderError'\n | 'mermaid.scrollHint'\n\nconst builtInText = {\n en: {\n 'actions.code': 'Code',\n 'actions.copy': 'Copy',\n 'actions.copying': 'Copying...',\n 'actions.copied': 'Copied!',\n 'actions.copyFailed': 'Copy failed',\n 'builtWith.label': 'Built with Clarify',\n 'builtWith.prefix': 'Built with',\n 'callout.danger': 'Danger',\n 'callout.info': 'Info',\n 'callout.note': 'Note',\n 'callout.success': 'Success',\n 'callout.tip': 'Tip',\n 'callout.warning': 'Warning',\n 'contentActions.copyContent': 'Copy page',\n 'contentActions.copyContentDescription': 'Copy this page as {contentType} for LLMs',\n 'contentActions.copyLink': 'Copy {contentType} link',\n 'contentActions.copyLinkDescription': 'Copy the raw {contentType} content link for this page',\n 'contentActions.copyLlms': 'Copy llms.txt',\n 'contentActions.copyLlmsDescription': 'Copy the llms.txt link for this site',\n 'contentActions.copiedLlms': 'Copied llms.txt',\n 'contentActions.editPage': 'Edit this page',\n 'contentActions.editPageDescription': 'Open the source file for this page',\n 'contentActions.copyOptions': 'Choose copy option',\n 'contentActions.copiedContent': 'Copied page',\n 'contentActions.copiedLink': 'Copied link',\n 'contentActions.viewMarkdown': 'View as Markdown',\n 'contentActions.viewMarkdownDescription': 'View this page as plain text',\n 'contentActions.viewOpenApi': 'View raw OpenAPI',\n 'contentActions.viewOpenApiDescription': 'Open the API description file in a new tab',\n 'feedback.no': 'No',\n 'feedback.prompt': 'Was this page helpful?',\n 'feedback.thanks': 'Thanks for your feedback!',\n 'feedback.yes': 'Yes',\n 'navigation.documentation': 'Documentation',\n 'navigation.next': 'Next',\n 'navigation.previous': 'Previous',\n 'navigation.previousNext': 'Previous and next pages',\n 'navigation.toggle': 'Toggle navigation',\n 'navbar.home': 'Home',\n 'navbar.openLinks': 'Open navigation links',\n 'navbar.sections': 'Documentation sections',\n 'notFound.description': 'The page may have moved, been renamed, or never existed. Check the address or return to the homepage.',\n 'notFound.home': 'Back to homepage',\n 'notFound.label': '404',\n 'notFound.title': 'Page not found',\n 'openapi.apiDocumentation': 'API Documentation',\n 'openapi.bodyProperties': 'Body properties',\n 'openapi.collapse': 'Collapse',\n 'openapi.endpointNotFound': 'Endpoint not found: {endpoint}',\n 'openapi.example': 'Example',\n 'openapi.expand': 'Expand',\n 'openapi.headers': 'Headers',\n 'openapi.language': 'Language',\n 'openapi.client': 'Client',\n 'openapi.loading': 'Loading OpenAPI spec...',\n 'openapi.mediaType': 'Media type',\n 'openapi.none': 'None',\n 'openapi.openApiReference': 'OpenAPI Reference',\n 'openapi.operationParameter': 'Operation parameter.',\n 'openapi.optional': 'Optional.',\n 'openapi.parameter': 'parameter',\n 'openapi.pathParameters': 'Path parameters',\n 'openapi.queryParameters': 'Query parameters',\n 'openapi.request': 'Request',\n 'openapi.requestBody': 'Request body',\n 'openapi.requestBodyEmpty': 'No request body',\n 'openapi.responseBodyProperties': 'Response body properties',\n 'openapi.required': 'Required.',\n 'openapi.requiredBadge': 'required',\n 'openapi.response': 'Response',\n 'openapi.responses': 'Responses',\n 'openapi.schemaExample': 'Schema example',\n 'openapi.scrollExamplesLeft': 'Scroll examples left',\n 'openapi.scrollExamplesRight': 'Scroll examples right',\n 'openapi.specNotFound': 'OpenAPI spec not found: {specPath}',\n 'openapi.specPathMissing': 'spec or specPath was not provided',\n 'openapi.status': 'Status',\n 'openapi.version': 'Version {version}',\n 'openapi.webhookResponse': 'Webhook response',\n 'openapi.webhookResponses': 'Webhook responses',\n 'search.button': 'Search...',\n 'search.noResults': 'Nothing found for {query}.',\n 'search.placeholder': 'Find something...',\n 'search.shortcutCtrl': 'Ctrl ',\n 'renderError.componentStack': 'React component stack',\n 'renderError.description': 'Clarify stopped rendering this route to keep the rest of the shell responsive. Review the diagnostics below, fix the page source, then reload the route.',\n 'renderError.details': 'Runtime diagnostics',\n 'renderError.message': 'Message',\n 'renderError.path': 'Route',\n 'renderError.reload': 'Reload route',\n 'renderError.stack': 'JavaScript stack trace',\n 'renderError.title': 'Route render failed',\n 'renderError.type': 'Error type',\n 'renderError.version': 'Clarify version',\n 'theme.switchToDark': 'Switch to dark theme',\n 'theme.switchToLight': 'Switch to light theme',\n 'theme.switchToSystem': 'Follow system theme',\n 'language.switch': 'Switch language',\n 'mermaid.zoomIn': 'Zoom in',\n 'mermaid.zoomOut': 'Zoom out',\n 'mermaid.resetZoom': 'Reset zoom',\n 'mermaid.renderError': 'Mermaid render error',\n 'mermaid.scrollHint': 'Click the diagram to enable scroll-to-zoom',\n },\n 'zh-CN': {\n 'actions.code': '代码',\n 'actions.copy': '复制',\n 'actions.copying': '正在复制...',\n 'actions.copied': '已复制!',\n 'actions.copyFailed': '复制失败',\n 'builtWith.label': '由 Clarify 构建',\n 'builtWith.prefix': '构建来自',\n 'callout.danger': '危险',\n 'callout.info': '信息',\n 'callout.note': '注意',\n 'callout.success': '成功',\n 'callout.tip': '提示',\n 'callout.warning': '警告',\n 'contentActions.copyContent': '复制页面',\n 'contentActions.copyContentDescription': '将页面以 {contentType} 格式复制给 LLMs',\n 'contentActions.copyLink': '复制 {contentType} 链接',\n 'contentActions.copyLinkDescription': '复制当前页面的 {contentType} 原始内容链接',\n 'contentActions.copyLlms': '复制 llms.txt',\n 'contentActions.copyLlmsDescription': '复制此站点的 llms.txt 链接',\n 'contentActions.copiedLlms': '已复制 llms.txt',\n 'contentActions.editPage': '编辑此页面',\n 'contentActions.editPageDescription': '打开当前页面的源文件',\n 'contentActions.copyOptions': '选择复制选项',\n 'contentActions.copiedContent': '已复制页面',\n 'contentActions.copiedLink': '已复制链接',\n 'contentActions.viewMarkdown': '以 Markdown 格式查看',\n 'contentActions.viewMarkdownDescription': '以纯文本查看此页面',\n 'contentActions.viewOpenApi': '查看 OpenAPI 原始内容',\n 'contentActions.viewOpenApiDescription': '在新标签页打开 API 描述文件',\n 'feedback.no': '否',\n 'feedback.prompt': '这个页面有帮助吗?',\n 'feedback.thanks': '感谢你的反馈!',\n 'feedback.yes': '是',\n 'navigation.documentation': '文档',\n 'navigation.next': '下一页',\n 'navigation.previous': '上一页',\n 'navigation.previousNext': '上一页和下一页',\n 'navigation.toggle': '切换导航',\n 'navbar.home': '首页',\n 'navbar.openLinks': '打开导航链接',\n 'navbar.sections': '文档栏目',\n 'notFound.description': '页面可能已移动、重命名或不存在。请检查地址,或返回首页继续浏览。',\n 'notFound.home': '返回首页',\n 'notFound.label': '404',\n 'notFound.title': '页面未找到',\n 'openapi.apiDocumentation': 'API 文档',\n 'openapi.bodyProperties': '请求体属性',\n 'openapi.collapse': '收起',\n 'openapi.endpointNotFound': '未找到端点:{endpoint}',\n 'openapi.example': '示例',\n 'openapi.expand': '展开',\n 'openapi.headers': '请求头',\n 'openapi.language': '语言',\n 'openapi.client': '客户端',\n 'openapi.loading': '正在加载 OpenAPI 描述文件...',\n 'openapi.mediaType': '媒体类型',\n 'openapi.none': '无',\n 'openapi.openApiReference': 'OpenAPI 参考',\n 'openapi.operationParameter': '操作参数。',\n 'openapi.optional': '可选。',\n 'openapi.parameter': '参数',\n 'openapi.pathParameters': '路径参数',\n 'openapi.queryParameters': '查询参数',\n 'openapi.request': '请求',\n 'openapi.requestBody': '请求体',\n 'openapi.requestBodyEmpty': '暂无请求体',\n 'openapi.responseBodyProperties': '响应体属性',\n 'openapi.required': '必填。',\n 'openapi.requiredBadge': '必填',\n 'openapi.response': '响应',\n 'openapi.responses': '响应',\n 'openapi.schemaExample': 'Schema 示例',\n 'openapi.scrollExamplesLeft': '向左滚动示例',\n 'openapi.scrollExamplesRight': '向右滚动示例',\n 'openapi.specNotFound': '未找到 OpenAPI 描述文件:{specPath}',\n 'openapi.specPathMissing': '未提供 spec 或 specPath',\n 'openapi.status': '状态',\n 'openapi.version': '版本 {version}',\n 'openapi.webhookResponse': 'Webhook 响应',\n 'openapi.webhookResponses': 'Webhook 响应',\n 'search.button': '搜索...',\n 'search.noResults': '没有找到与 {query} 相关的结果。',\n 'search.placeholder': '搜索内容...',\n 'search.shortcutCtrl': 'Ctrl ',\n 'renderError.componentStack': 'React 组件栈',\n 'renderError.description': 'Clarify 已停止渲染此路由,以保证文档 Shell 仍可响应。请查看下方诊断信息,修复页面源码后重新加载路由。',\n 'renderError.details': '运行时诊断',\n 'renderError.message': '错误消息',\n 'renderError.path': '路由',\n 'renderError.reload': '重新加载路由',\n 'renderError.stack': 'JavaScript 堆栈',\n 'renderError.title': '路由渲染失败',\n 'renderError.type': '错误类型',\n 'renderError.version': 'Clarify 版本',\n 'theme.switchToDark': '切换到深色主题',\n 'theme.switchToLight': '切换到浅色主题',\n 'theme.switchToSystem': '跟随系统主题',\n 'language.switch': '切换语言',\n 'mermaid.zoomIn': '放大',\n 'mermaid.zoomOut': '缩小',\n 'mermaid.resetZoom': '重置缩放',\n 'mermaid.renderError': 'Mermaid 渲染错误',\n 'mermaid.scrollHint': '点击图表后即可滚轮缩放',\n },\n} satisfies Record<BuiltInLocale, Record<BuiltInTextKey, string>>\n\nexport function resolveBuiltInLocale(locale?: string): BuiltInLocale {\n return locale === 'zh-CN' || locale?.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en'\n}\n\nexport function translateBuiltInText(locale: string | undefined, key: BuiltInTextKey, replacements: Record<string, string> = {}): string {\n let value = builtInText[resolveBuiltInLocale(locale)]?.[key] ?? builtInText.en[key]\n for (const [name, replacement] of Object.entries(replacements)) {\n value = value.replaceAll(`{${name}}`, replacement)\n }\n return value\n}\n\nexport function useBuiltInText(locale?: string) {\n const config = useContext(ConfigContext)\n const currentLocale = useContext(LocaleContext)\n const resolvedLocale = locale ?? currentLocale ?? config?.i18n?.defaultLocale\n return (key: BuiltInTextKey, replacements?: Record<string, string>) => translateBuiltInText(resolvedLocale, key, replacements)\n}\n"],"mappings":";;AAIA,IAAa,iBAAA,GAAA,MAAA,cAAA,CAA6C,IAAI;AAC9D,IAAa,iBAAA,GAAA,MAAA,cAAA,CAAkD,KAAA,CAAS;AACxE,IAAa,uBAAA,GAAA,MAAA,cAAA,CAAqD,CAAC,CAAC;AAEpE,SAAgB,YAAoB;CAClC,MAAM,UAAA,GAAA,MAAA,WAAA,CAAoB,aAAa;CACvC,IAAI,CAAC,QACH,MAAM,IAAI,MACR,kEACF;CAEF,OAAO;AACT;AAEA,SAAgB,oBAAmC;CACjD,QAAA,GAAA,MAAA,WAAA,CAAkB,aAAa;AACjC;AAEA,SAAgB,YAAgC;CAC9C,QAAA,GAAA,MAAA,WAAA,CAAkB,aAAa;AACjC;AAEA,SAAgB,kBAAmC;CACjD,QAAA,GAAA,MAAA,WAAA,CAAkB,mBAAmB;AACvC;;;ACmFA,IAAM,cAAc;CAClB,IAAI;EACF,gBAAgB;EAChB,gBAAgB;EAChB,mBAAmB;EACnB,kBAAkB;EAClB,sBAAsB;EACtB,mBAAmB;EACnB,oBAAoB;EACpB,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;EACf,mBAAmB;EACnB,8BAA8B;EAC9B,yCAAyC;EACzC,2BAA2B;EAC3B,sCAAsC;EACtC,2BAA2B;EAC3B,sCAAsC;EACtC,6BAA6B;EAC7B,2BAA2B;EAC3B,sCAAsC;EACtC,8BAA8B;EAC9B,gCAAgC;EAChC,6BAA6B;EAC7B,+BAA+B;EAC/B,0CAA0C;EAC1C,8BAA8B;EAC9B,yCAAyC;EACzC,eAAe;EACf,mBAAmB;EACn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tB,uBAAuB;EACvB,wBAAwB;EACxB,mBAAmB;EACnB,kBAAkB;EAClB,mBAAmB;EACnB,qBAAqB;EACrB,uBAAuB;EACvB,sBAAsB;CACxB;AACF;AAEA,SAAgB,qBAAqB,QAAgC;CACnE,OAAO,WAAW,WAAW,QAAQ,YAAY,CAAC,CAAC,WAAW,IAAI,IAAI,UAAU;AAClF;AAEA,SAAgB,qBAAqB,QAA4B,KAAqB,eAAuC,CAAC,GAAW;CACvI,IAAI,QAAQ,YAAY,qBAAqB,MAAM,EAAE,GAAG,QAAQ,YAAY,GAAG;CAC/E,KAAK,MAAM,CAAC,MAAM,gBAAgB,OAAO,QAAQ,YAAY,GAC3D,QAAQ,MAAM,WAAW,IAAI,KAAK,IAAI,WAAW;CAEnD,OAAO;AACT;AAEA,SAAgB,eAAe,QAAiB;CAC9C,MAAM,UAAA,GAAA,MAAA,WAAA,CAAoB,aAAa;CACvC,MAAM,iBAAA,GAAA,MAAA,WAAA,CAA2B,aAAa;CAC9C,MAAM,iBAAiB,UAAU,iBAAiB,QAAQ,MAAM;CAChE,QAAQ,KAAqB,iBAA0C,qBAAqB,gBAAgB,KAAK,YAAY;AAC/H"}
package/output/index.cjs CHANGED
@@ -1,18 +1,23 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_i18n = require("./i18n-b4iTLeia.cjs");
3
- const require_ClarifyShell = require("./ClarifyShell-C6li72Ce.cjs");
4
- const require_PageActions = require("./PageActions-BjB6PYmL.cjs");
5
- const require_OpenApiOperation = require("./OpenApiOperation-B52IWlKb.cjs");
2
+ const require_i18n = require("./i18n-C-fReCj-.cjs");
3
+ const require_ClarifyShell = require("./ClarifyShell-UsefuuLS.cjs");
4
+ const require_PageActions = require("./PageActions-Dg1l9KB1.cjs");
5
+ const require_OpenApiOperation = require("./OpenApiOperation-DbZjxIuj.cjs");
6
6
  const require_remark = require("./remark-DTLbG8PK.cjs");
7
- const require_render = require("./render-Di5B6Zc0.cjs");
7
+ const require_render = require("./render-Dc9wxg_r.cjs");
8
8
  let react = require("react");
9
9
  let react_router_dom = require("react-router-dom");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
11
  //#region source/app/ContentDiagnostic.tsx
12
12
  function ContentDiagnosticPanel(params) {
13
13
  const { data } = params;
14
- const typeLabel = data.kind === "mdx" ? "MDX" : data.kind === "openapi" ? "OpenAPI" : "Route";
15
- const detailsLabel = data.kind === "mdx" ? "Why it happened" : "Details";
14
+ const typeLabel = {
15
+ markdown: "Markdown",
16
+ mdx: "MDX",
17
+ openapi: "OpenAPI",
18
+ "route-load": "Route"
19
+ }[data.kind];
20
+ const detailsLabel = data.kind === "mdx" || data.kind === "markdown" ? "Why it happened" : "Details";
16
21
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ClarifyShell.RenderErrorPanel, {
17
22
  title: data.title,
18
23
  description: data.message,
@@ -157,7 +162,7 @@ function operationMatchesTags(operationTags, filterTags) {
157
162
  function OpenApiPaths(arg0) {
158
163
  const { spec, tagFilter } = arg0;
159
164
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
160
- className: "clarify-api-endpoints divide-y divide-zinc-200/70 dark:divide-white/10",
165
+ className: "clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10",
161
166
  children: require_OpenApiOperation.listOpenApiOperations(spec).filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter)).map(({ path, method, operation, source }) => ({
162
167
  path,
163
168
  method: method.toUpperCase(),
@@ -299,6 +304,10 @@ exports.RuntimeSlot = require_ClarifyShell.RuntimeSlot;
299
304
  exports.RuntimeSlotsProvider = require_ClarifyShell.RuntimeSlotsProvider;
300
305
  exports.SectionProvider = require_PageActions.SectionProvider;
301
306
  exports.SlotProvider = require_ClarifyShell.SlotProvider;
307
+ exports.Step = require_OpenApiOperation.Step;
308
+ exports.Steps = require_OpenApiOperation.Steps;
309
+ exports.Tab = require_OpenApiOperation.TabItem;
310
+ exports.Tabs = require_OpenApiOperation.Tabs;
302
311
  exports.Tag = require_OpenApiOperation.Tag;
303
312
  exports.ThemeEditor = require_ClarifyShell.ThemeEditor;
304
313
  exports.ThemeProvider = require_PageActions.ThemeProvider;