@clarify-labs/renderer 0.11.23 → 0.11.24

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 (37) hide show
  1. package/output/{ClarifyShell-CMVVhs5d.js → ClarifyShell-BY7ufELe.js} +2 -2
  2. package/output/{ClarifyShell-CMVVhs5d.js.map → ClarifyShell-BY7ufELe.js.map} +1 -1
  3. package/output/{ClarifyShell-BCM0tKfd.cjs → ClarifyShell-BYJ3LIy_.cjs} +2 -2
  4. package/output/{ClarifyShell-BCM0tKfd.cjs.map → ClarifyShell-BYJ3LIy_.cjs.map} +1 -1
  5. package/output/{OpenApiOperation-CyR9Y-2y.cjs → OpenApiOperation-La7HjfXY.cjs} +7 -6
  6. package/output/OpenApiOperation-La7HjfXY.cjs.map +1 -0
  7. package/output/{OpenApiOperation-BVm4VnFl.js → OpenApiOperation-p1OjfdKR.js} +7 -6
  8. package/output/OpenApiOperation-p1OjfdKR.js.map +1 -0
  9. package/output/{PageActions-B98vbZRP.js → PageActions-DAdtjf4H.js} +3 -3
  10. package/output/PageActions-DAdtjf4H.js.map +1 -0
  11. package/output/{PageActions-IpmtuInV.cjs → PageActions-kJT0EKLS.cjs} +3 -3
  12. package/output/PageActions-kJT0EKLS.cjs.map +1 -0
  13. package/output/{SearchDialog-wjtpnKYS.cjs → SearchDialog-BBSj23yI.cjs} +2 -2
  14. package/output/{SearchDialog-wjtpnKYS.cjs.map → SearchDialog-BBSj23yI.cjs.map} +1 -1
  15. package/output/{SearchDialog-B4MS3QuJ.js → SearchDialog-DW_bndWO.js} +2 -2
  16. package/output/{SearchDialog-B4MS3QuJ.js.map → SearchDialog-DW_bndWO.js.map} +1 -1
  17. package/output/client.cjs +3 -3
  18. package/output/client.js +3 -3
  19. package/output/index.cjs +12 -8
  20. package/output/index.cjs.map +1 -1
  21. package/output/index.js +12 -8
  22. package/output/index.js.map +1 -1
  23. package/output/openapi/entry.d.ts +2 -0
  24. package/output/preview.cjs +2 -2
  25. package/output/preview.js +2 -2
  26. package/output/{render-CobBuz3I.cjs → render-BXsYCBIp.cjs} +2 -2
  27. package/output/{render-CobBuz3I.cjs.map → render-BXsYCBIp.cjs.map} +1 -1
  28. package/output/{render-D0qt6K1G.js → render-DU9Jt4WC.js} +2 -2
  29. package/output/{render-D0qt6K1G.js.map → render-DU9Jt4WC.js.map} +1 -1
  30. package/output/renderer.css +10 -7
  31. package/output/server.cjs +2 -2
  32. package/output/server.js +2 -2
  33. package/package.json +1 -1
  34. package/output/OpenApiOperation-BVm4VnFl.js.map +0 -1
  35. package/output/OpenApiOperation-CyR9Y-2y.cjs.map +0 -1
  36. package/output/PageActions-B98vbZRP.js.map +0 -1
  37. package/output/PageActions-IpmtuInV.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SearchDialog-B4MS3QuJ.js","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 || route.searchable === false) 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 type { Pagefind } from './types'\n\ntype PagefindModule = {\n createInstance: () => Pagefind\n}\n\nconst pagefindPromises = new Map<string, Promise<Pagefind | null>>()\n\nexport function pagefindCacheKey(assetPrefix: string, locale: string | undefined) {\n return `${assetPrefix || '/'}:${locale || 'default'}`\n}\n\nexport function resolvePagefindUrl(assetPrefix: string): string {\n const prefix = assetPrefix || '/'\n return `${prefix.endsWith('/') ? prefix : `${prefix}/`}pagefind/pagefind.js`\n}\n\nexport function loadPagefind(assetPrefix: string, locale: string | undefined): Promise<Pagefind | null> {\n if (typeof window === 'undefined') return Promise.resolve(null)\n\n const cacheKey = pagefindCacheKey(assetPrefix, locale)\n const cachedPagefind = pagefindPromises.get(cacheKey)\n if (cachedPagefind) {\n return cachedPagefind\n }\n\n const pagefindUrl = resolvePagefindUrl(assetPrefix)\n const pagefindPromise = import(/* @vite-ignore */ pagefindUrl)\n .then(async (module: PagefindModule) => {\n const previousLanguage = document.documentElement.lang\n if (locale) document.documentElement.lang = locale\n const pagefind = module.createInstance()\n if (previousLanguage !== locale) document.documentElement.lang = previousLanguage\n try {\n await pagefind.init?.()\n } catch (error) {\n if (error instanceof Error && error.message.includes('No language indexes found')) {\n return null\n }\n throw error\n }\n return pagefind\n })\n .catch((error: unknown) => {\n pagefindPromises.delete(cacheKey)\n console.warn('[clarify:search] Pagefind instance failed', { cacheKey, locale, 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-brand-search-highlight) 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-brand-search-highlight) 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 assetPrefix: 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 assetPrefix: 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, assetPrefix, 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(assetPrefix, 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(assetPrefix, 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 }, [assetPrefix, currentLocale, pagefindKey])\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 assetPrefix,\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, assetPrefix, 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-ui-border) bg-(--clarify-ui-surface) empty:hidden\">\n {showNoResults ? (\n <div className=\"p-6 text-center\">\n <SearchX className=\"mx-auto h-5 w-5 stroke-(--clarify-ui-text-faint)\" />\n <p className=\"mt-2 text-xs text-(--clarify-ui-text-soft)\">\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-ui-surface-elevated) shadow-(--clarify-ui-shadow-popover) ring-1 ring-(--clarify-ui-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\"\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,eAAe,MAAM,eAAe,OAAO,OAAO,CAAC;EAE7D,MAAM,aAAa,YAAY,IAAI,MAAM,IAAI;EAiB7C,OAAO,CAAC;GAfN,OAAO,MAAM;GACb,WAAW,MAAM;GACjB,cAAc;GACd,KAAK,MAAM;GACX,UAAU;IAAC;IAAY,MAAM;IAAO,MAAM;IAAM,MAAM;GAAI,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,YAAY;EAW5F,GAAU,GARG,MAAM,UAAU,KAAK,aAAa;GACrD,OAAO,QAAQ;GACf,WAAW,MAAM;GACjB,cAAc;GACd,KAAK,GAAG,MAAM,KAAK,GAAG,QAAQ;GAC9B,UAAU;IAAC;IAAY,MAAM;IAAO,QAAQ;IAAO,MAAM;IAAM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Ae;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,oBAAC,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-DW_bndWO.js","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 || route.searchable === false) 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 type { Pagefind } from './types'\n\ntype PagefindModule = {\n createInstance: () => Pagefind\n}\n\nconst pagefindPromises = new Map<string, Promise<Pagefind | null>>()\n\nexport function pagefindCacheKey(assetPrefix: string, locale: string | undefined) {\n return `${assetPrefix || '/'}:${locale || 'default'}`\n}\n\nexport function resolvePagefindUrl(assetPrefix: string): string {\n const prefix = assetPrefix || '/'\n return `${prefix.endsWith('/') ? prefix : `${prefix}/`}pagefind/pagefind.js`\n}\n\nexport function loadPagefind(assetPrefix: string, locale: string | undefined): Promise<Pagefind | null> {\n if (typeof window === 'undefined') return Promise.resolve(null)\n\n const cacheKey = pagefindCacheKey(assetPrefix, locale)\n const cachedPagefind = pagefindPromises.get(cacheKey)\n if (cachedPagefind) {\n return cachedPagefind\n }\n\n const pagefindUrl = resolvePagefindUrl(assetPrefix)\n const pagefindPromise = import(/* @vite-ignore */ pagefindUrl)\n .then(async (module: PagefindModule) => {\n const previousLanguage = document.documentElement.lang\n if (locale) document.documentElement.lang = locale\n const pagefind = module.createInstance()\n if (previousLanguage !== locale) document.documentElement.lang = previousLanguage\n try {\n await pagefind.init?.()\n } catch (error) {\n if (error instanceof Error && error.message.includes('No language indexes found')) {\n return null\n }\n throw error\n }\n return pagefind\n })\n .catch((error: unknown) => {\n pagefindPromises.delete(cacheKey)\n console.warn('[clarify:search] Pagefind instance failed', { cacheKey, locale, 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-brand-search-highlight) 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-brand-search-highlight) 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 assetPrefix: 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 assetPrefix: 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, assetPrefix, 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(assetPrefix, 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(assetPrefix, 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 }, [assetPrefix, currentLocale, pagefindKey])\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 assetPrefix,\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, assetPrefix, 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-ui-border) bg-(--clarify-ui-surface) empty:hidden\">\n {showNoResults ? (\n <div className=\"p-6 text-center\">\n <SearchX className=\"mx-auto h-5 w-5 stroke-(--clarify-ui-text-faint)\" />\n <p className=\"mt-2 text-xs text-(--clarify-ui-text-soft)\">\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-ui-surface-elevated) shadow-(--clarify-ui-shadow-popover) ring-1 ring-(--clarify-ui-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\"\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,eAAe,MAAM,eAAe,OAAO,OAAO,CAAC;EAE7D,MAAM,aAAa,YAAY,IAAI,MAAM,IAAI;EAiB7C,OAAO,CAAC;GAfN,OAAO,MAAM;GACb,WAAW,MAAM;GACjB,cAAc;GACd,KAAK,MAAM;GACX,UAAU;IAAC;IAAY,MAAM;IAAO,MAAM;IAAM,MAAM;GAAI,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,YAAY;EAW5F,GAAU,GARG,MAAM,UAAU,KAAK,aAAa;GACrD,OAAO,QAAQ;GACf,WAAW,MAAM;GACjB,cAAc;GACd,KAAK,GAAG,MAAM,KAAK,GAAG,QAAQ;GAC9B,UAAU;IAAC;IAAY,MAAM;IAAO,QAAQ;IAAO,MAAM;IAAM,QAAQ;GAAE,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,YAAY;EACnH,EAAE,KAAK,CAAC,CAEyB;CACnC,CAAC;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e;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,IAAI,QAAQ,UAAU,QAAQ,SAAS,CAAE;KAChG;IACF;cAZF,CAcE,oBAAC,aAAD;KACE,KAAK;KACE;KACP,UAAU;KACV,SAAS;KACT,gBAAgB,aAAa;KAC7B,SAAS;IACV,CAAA,GACA,mBAAmB,CACT;;EACV,CAAA,CACC;;AAEZ"}
package/output/client.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ClarifyShell = require("./ClarifyShell-BCM0tKfd.cjs");
3
- const require_PageActions = require("./PageActions-IpmtuInV.cjs");
4
- const require_render = require("./render-CobBuz3I.cjs");
2
+ const require_ClarifyShell = require("./ClarifyShell-BYJ3LIy_.cjs");
3
+ const require_PageActions = require("./PageActions-kJT0EKLS.cjs");
4
+ const require_render = require("./render-BXsYCBIp.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-CMVVhs5d.js";
2
- import { C as getStoredLocalePreference, D as storeLocalePreference, E as readLocaleCookie, O as storeThemePreference, T as localeCookieName, k as themeCookieName, w as getStoredThemePreference } from "./PageActions-B98vbZRP.js";
3
- import { t as render } from "./render-D0qt6K1G.js";
1
+ import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ClarifyShell-BY7ufELe.js";
2
+ import { C as getStoredLocalePreference, D as storeLocalePreference, E as readLocaleCookie, O as storeThemePreference, T as localeCookieName, k as themeCookieName, w as getStoredThemePreference } from "./PageActions-DAdtjf4H.js";
3
+ import { t as render } from "./render-DU9Jt4WC.js";
4
4
  export { ThemeEditor, applyThemeVariables, getStoredLocalePreference, getStoredThemePreference, localeCookieName, readLocaleCookie, render, storeLocalePreference, storeThemePreference, themeBootstrapScript, themeCookieName, themeEditorPresets, themeStorageKey };
package/output/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
3
3
  const require_i18n = require("./i18n-tOmAUK0W.cjs");
4
- const require_ClarifyShell = require("./ClarifyShell-BCM0tKfd.cjs");
5
- const require_PageActions = require("./PageActions-IpmtuInV.cjs");
6
- const require_OpenApiOperation = require("./OpenApiOperation-CyR9Y-2y.cjs");
4
+ const require_ClarifyShell = require("./ClarifyShell-BYJ3LIy_.cjs");
5
+ const require_PageActions = require("./PageActions-kJT0EKLS.cjs");
6
+ const require_OpenApiOperation = require("./OpenApiOperation-La7HjfXY.cjs");
7
7
  const require_remark = require("./remark-DTLbG8PK.cjs");
8
- const require_render = require("./render-CobBuz3I.cjs");
8
+ const require_render = require("./render-BXsYCBIp.cjs");
9
9
  let react = require("react");
10
10
  let react_router_dom = require("react-router-dom");
11
11
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -132,7 +132,7 @@ function useOpenApiSpec(spec, specPath) {
132
132
  //#endregion
133
133
  //#region source/openapi/entry.tsx
134
134
  function OpenApiHeader(arg0) {
135
- const { spec } = arg0;
135
+ const { spec, title } = arg0;
136
136
  const t = require_i18n.useBuiltInText();
137
137
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
138
138
  className: "clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8",
@@ -143,7 +143,7 @@ function OpenApiHeader(arg0) {
143
143
  }),
144
144
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
145
145
  className: "clarify-page-title",
146
- children: spec.info?.title ?? t("openapi.apiDocumentation")
146
+ children: title ?? spec.info?.title ?? t("openapi.apiDocumentation")
147
147
  }),
148
148
  spec.info?.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OpenApiOperation.Markdown, {
149
149
  className: "lead mt-4 *:first:mt-0 *:last:mb-0",
@@ -186,7 +186,7 @@ function WarningBox(arg0) {
186
186
  });
187
187
  }
188
188
  function OpenApiDocument(arg0) {
189
- const { spec, specPath, tagFilter, operationOrder } = arg0;
189
+ const { spec, specPath, title, tagFilter, operationOrder } = arg0;
190
190
  const t = require_i18n.useBuiltInText();
191
191
  const { spec: resolved, loading } = useOpenApiSpec(spec, specPath);
192
192
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WarningBox, { children: t("openapi.loading") });
@@ -198,7 +198,10 @@ function OpenApiDocument(arg0) {
198
198
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PageActions.PageActions, {})
199
199
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_OpenApiOperation.Prose, {
200
200
  className: "flex-auto",
201
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiHeader, { spec: resolved }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiPaths, {
201
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiHeader, {
202
+ spec: resolved,
203
+ title
204
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiPaths, {
202
205
  spec: resolved,
203
206
  tagFilter,
204
207
  operationOrder
@@ -258,6 +261,7 @@ function createOpenApiRouteComponent(data) {
258
261
  return function OpenApiRoutePage() {
259
262
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocument, {
260
263
  spec: data.spec,
264
+ title: data.title,
261
265
  operationOrder: data.operationOrder
262
266
  });
263
267
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[]; operationOrder?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n tagFilter?: string[]\n operationOrder?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n operationOrder?: string[]\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-text-faint) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter, operationOrder } = arg0\n\n const entries = listOpenApiOperations(spec, operationOrder)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-(--clarify-ui-border-subtle)\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-danger-border) bg-(--clarify-tone-danger-background) p-4 text-sm text-(--clarify-tone-danger-text)'\n : 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-warning-border) bg-(--clarify-tone-warning-background) p-4 text-sm text-(--clarify-tone-warning-text)'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, tagFilter, operationOrder } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} operationOrder={operationOrder} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} operationOrder={data.operationOrder} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-(--clarify-theme-tokens-radius-md) bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-border-strong) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-text-strong)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC,MAAM,eAAe,KAAK,SAAS,kBAAkB,KAAK,SAAS,aAAa,oBAAoB;CAGpG,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,kBAAD;EACE,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,SAAQ;EACR,UAAU,CACR;GAAE,OAAO;GAAW,OAAO,KAAK,YAAY;EAAU,GACtD;GAAE,OAAO;GAAQ,OAAO;EAAU,CACpC;EACc;EACd,gBAAgB,KAAK,UACnB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;aACZ,KAAK;EACH,CAAA,IACH;CACL,CAAA;AAEL;AAEA,SAAgB,iCAAiC,MAAwC;CACvF,OAAO,SAAS,6BAA6B;EAC3C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAD,EAA8B,KAAO,CAAA;CAC9C;AACF;;;AClCA,SAAS,oBAAoB,OAA2D;CACtF,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,cAAc,OAAuC;CAC5D,OAAO,SAAS,OAAO,UAAU,YAAY,aAAa,QACtD,MAAM,UACN;AACN;AAEA,IAAM,iBAAiB;AAEvB,SAAS,oBAAoB,SAAiB,IAAoB;CAChE,MAAM,SAAS,UAAU,MAAM,GAAA,CAAI,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;CAC5D,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,QAAQ,OACjB,IAAI,SAAS,MACX,MAAM,IAAI;MACL,IAAI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A,SAAgB,iBAAiB,aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAU;YACd,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,yBAAA,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[]; operationOrder?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec; title?: string }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n title?: string\n tagFilter?: string[]\n operationOrder?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n title?: string\n operationOrder?: string[]\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec, title } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-text-faint) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{title ?? spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter, operationOrder } = arg0\n\n const entries = listOpenApiOperations(spec, operationOrder)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-(--clarify-ui-border-subtle)\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-danger-border) bg-(--clarify-tone-danger-background) p-4 text-sm text-(--clarify-tone-danger-text)'\n : 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-warning-border) bg-(--clarify-tone-warning-background) p-4 text-sm text-(--clarify-tone-warning-text)'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, title, tagFilter, operationOrder } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} title={title} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} operationOrder={operationOrder} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} title={data.title} operationOrder={data.operationOrder} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-(--clarify-theme-tokens-radius-md) bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-border-strong) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-text-strong)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC,MAAM,eAAe,KAAK,SAAS,kBAAkB,KAAK,SAAS,aAAa,oBAAoB;CAGpG,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,kBAAD;EACE,OAAO,KAAK;EAC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AAU,CAAA,GACxE,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,yBAAA,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
package/output/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { A as Heading, B as Callout, C as Tabs, D as GridPattern, E as Prose, F as CodeGroup, H as LocalizedLink, I as Pre, L as Mermaid, M as Feedback, N as Collapse, O as HeroPattern, P as Code, R as Card, S as TabItem, T as Steps, V as Button, _ as Markdown, b as primitives_exports, d as EndpointMethodBadge, f as getOpenApiOperationEntryById, j as Tag, k as Logo, m as listOpenApiOperations, n as OpenApiOperation$1, p as getOpenApiOperationSectionId, r as OpenApiRequestWorkbench, v as Release, w as Step, x as WebFrame, y as ReleaseItem, z as CardGroup } from "./OpenApiOperation-BVm4VnFl.js";
1
+ import { A as Heading, B as Callout, C as Tabs, D as GridPattern, E as Prose, F as CodeGroup, H as LocalizedLink, I as Pre, L as Mermaid, M as Feedback, N as Collapse, O as HeroPattern, P as Code, R as Card, S as TabItem, T as Steps, V as Button, _ as Markdown, b as primitives_exports, d as EndpointMethodBadge, f as getOpenApiOperationEntryById, j as Tag, k as Logo, m as listOpenApiOperations, n as OpenApiOperation$1, p as getOpenApiOperationSectionId, r as OpenApiRequestWorkbench, v as Release, w as Step, x as WebFrame, y as ReleaseItem, z as CardGroup } from "./OpenApiOperation-p1OjfdKR.js";
2
2
  import { a as useConfig, c as useConfigUpdaterOptional, i as OpenApiSpecsContext, l as useLocale, n as ConfigProvider, s as useConfigUpdater, t as useBuiltInText, u as useOpenApiSpecs } from "./i18n-Bt-OaKRP.js";
3
- import { a as themeBootstrapScript, c as AppShell, d as RenderErrorPanel, f as BuiltWithClarify, g as useSlot, h as SlotProvider, i as themeEditorPresets, l as PageFooter, m as RuntimeSlotsProvider, n as ThemeEditor, o as themePresets, p as RuntimeSlot, r as applyThemeVariables, u as PageBanner } from "./ClarifyShell-CMVVhs5d.js";
4
- import { c as useSectionStore, f as ThemeToggle, g as localizeHref, l as remToPx, m as useTheme, p as ThemeProvider, s as SectionProvider, t as PageActions } from "./PageActions-B98vbZRP.js";
3
+ import { a as themeBootstrapScript, c as AppShell, d as RenderErrorPanel, f as BuiltWithClarify, g as useSlot, h as SlotProvider, i as themeEditorPresets, l as PageFooter, m as RuntimeSlotsProvider, n as ThemeEditor, o as themePresets, p as RuntimeSlot, r as applyThemeVariables, u as PageBanner } from "./ClarifyShell-BY7ufELe.js";
4
+ import { c as useSectionStore, f as ThemeToggle, g as localizeHref, l as remToPx, m as useTheme, p as ThemeProvider, s as SectionProvider, t as PageActions } from "./PageActions-DAdtjf4H.js";
5
5
  import { n as parseCodeMeta, t as markdownRemarkPlugins } from "./remark-C9iRQM0R.js";
6
- import { t as render } from "./render-D0qt6K1G.js";
6
+ import { t as render } from "./render-DU9Jt4WC.js";
7
7
  import { useEffect, useState } from "react";
8
8
  import { useLocation } from "react-router-dom";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -129,7 +129,7 @@ function useOpenApiSpec(spec, specPath) {
129
129
  //#endregion
130
130
  //#region source/openapi/entry.tsx
131
131
  function OpenApiHeader(arg0) {
132
- const { spec } = arg0;
132
+ const { spec, title } = arg0;
133
133
  const t = useBuiltInText();
134
134
  return /* @__PURE__ */ jsxs("header", {
135
135
  className: "clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8",
@@ -140,7 +140,7 @@ function OpenApiHeader(arg0) {
140
140
  }),
141
141
  /* @__PURE__ */ jsx("h1", {
142
142
  className: "clarify-page-title",
143
- children: spec.info?.title ?? t("openapi.apiDocumentation")
143
+ children: title ?? spec.info?.title ?? t("openapi.apiDocumentation")
144
144
  }),
145
145
  spec.info?.description ? /* @__PURE__ */ jsx(Markdown, {
146
146
  className: "lead mt-4 *:first:mt-0 *:last:mb-0",
@@ -183,7 +183,7 @@ function WarningBox(arg0) {
183
183
  });
184
184
  }
185
185
  function OpenApiDocument(arg0) {
186
- const { spec, specPath, tagFilter, operationOrder } = arg0;
186
+ const { spec, specPath, title, tagFilter, operationOrder } = arg0;
187
187
  const t = useBuiltInText();
188
188
  const { spec: resolved, loading } = useOpenApiSpec(spec, specPath);
189
189
  if (loading) return /* @__PURE__ */ jsx(WarningBox, { children: t("openapi.loading") });
@@ -195,7 +195,10 @@ function OpenApiDocument(arg0) {
195
195
  children: /* @__PURE__ */ jsx(PageActions, {})
196
196
  }), /* @__PURE__ */ jsxs(Prose, {
197
197
  className: "flex-auto",
198
- children: [/* @__PURE__ */ jsx(OpenApiHeader, { spec: resolved }), /* @__PURE__ */ jsx(OpenApiPaths, {
198
+ children: [/* @__PURE__ */ jsx(OpenApiHeader, {
199
+ spec: resolved,
200
+ title
201
+ }), /* @__PURE__ */ jsx(OpenApiPaths, {
199
202
  spec: resolved,
200
203
  tagFilter,
201
204
  operationOrder
@@ -255,6 +258,7 @@ function createOpenApiRouteComponent(data) {
255
258
  return function OpenApiRoutePage() {
256
259
  return /* @__PURE__ */ jsx(OpenApiDocument, {
257
260
  spec: data.spec,
261
+ title: data.title,
258
262
  operationOrder: data.operationOrder
259
263
  });
260
264
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[]; operationOrder?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n tagFilter?: string[]\n operationOrder?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n operationOrder?: string[]\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-text-faint) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter, operationOrder } = arg0\n\n const entries = listOpenApiOperations(spec, operationOrder)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-(--clarify-ui-border-subtle)\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-danger-border) bg-(--clarify-tone-danger-background) p-4 text-sm text-(--clarify-tone-danger-text)'\n : 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-warning-border) bg-(--clarify-tone-warning-background) p-4 text-sm text-(--clarify-tone-warning-text)'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, tagFilter, operationOrder } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} operationOrder={operationOrder} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} operationOrder={data.operationOrder} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-(--clarify-theme-tokens-radius-md) bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-border-strong) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-text-strong)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC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iagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[]; operationOrder?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec; title?: string }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n title?: string\n tagFilter?: string[]\n operationOrder?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n title?: string\n operationOrder?: string[]\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec, title } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-text-faint) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{title ?? spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter, operationOrder } = arg0\n\n const entries = listOpenApiOperations(spec, operationOrder)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-(--clarify-ui-border-subtle)\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-danger-border) bg-(--clarify-tone-danger-background) p-4 text-sm text-(--clarify-tone-danger-text)'\n : 'rounded-(--clarify-theme-tokens-radius-lg) border border-(--clarify-tone-warning-border) bg-(--clarify-tone-warning-background) p-4 text-sm text-(--clarify-tone-warning-text)'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, title, tagFilter, operationOrder } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} title={title} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} operationOrder={operationOrder} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} title={data.title} operationOrder={data.operationOrder} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-(--clarify-theme-tokens-radius-md) bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-border-strong) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-text-strong)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC,MAAM,eAAe,KAAK,SAAS,kBAAkB,KAAK,SAAS,aAAa,oBAAoB;CAGpG,OACE,oBAAC,kBAAD;EACE,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,SAAQ;EACR,UAAU,CACR;GAAE,OAAO;GAAW,OAAO,KAAK,YAAY;EAAU,GACtD;GAAE,OAAO;GAAQ,OAAO;EAAU,CACpC;EACc;EACd,gBAAgB,KAAK,UACnB,oBAAC,OAAD;GAAK,WAAU;aACZ,KAAK;EACH,CAAA,IACH;CACL,CAAA;AAEL;AAEA,SAAgB,iCAAiC,MAAwC;CACvF,OAAO,SAAS,6BAA6B;EAC3C,OAAO,oBAAC,wBAAD,EAA8B,KAAO,CAAA;CAC9C;AACF;;;AClCA,SAAS,oBAAoB,OAA2D;CACtF,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,cAAc,OAAuC;CAC5D,OAAO,SAAS,OAAO,UAAU,YAAY,aAAa,QACtD,MAAM,UACN;AACN;AAEA,IAAM,iBAAiB;AAEvB,SAAS,oBAAoB,SAAiB,IAAoB;CAChE,MAAM,SAAS,UAAU,MAAM,GAAA,CAAI,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;CAC5D,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,QAAQ,OACjB,IAAI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,aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,oBAAC,QAAD;EAAM,WAAU;YACd,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,oBAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,oBAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,oBAAC,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
@@ -3,11 +3,13 @@ import { OpenAPISpec } from './lib/utils';
3
3
  export type OpenApiDocumentProps = {
4
4
  spec?: OpenAPISpec;
5
5
  specPath?: string;
6
+ title?: string;
6
7
  tagFilter?: string[];
7
8
  operationOrder?: string[];
8
9
  };
9
10
  export type OpenApiRouteData = {
10
11
  spec: OpenAPISpec;
12
+ title?: string;
11
13
  operationOrder?: string[];
12
14
  };
13
15
  export type OpenApiOperationProps = {
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_i18n = require("./i18n-tOmAUK0W.cjs");
3
- const require_PageActions = require("./PageActions-IpmtuInV.cjs");
4
- const require_OpenApiOperation = require("./OpenApiOperation-CyR9Y-2y.cjs");
3
+ const require_PageActions = require("./PageActions-kJT0EKLS.cjs");
4
+ const require_OpenApiOperation = require("./OpenApiOperation-La7HjfXY.cjs");
5
5
  let react = require("react");
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
7
  let lucide_react = require("lucide-react");
package/output/preview.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as ResponseExamplesPanel, c as getAuthOptions, g as getRequestBody, h as getMediaTypeEntries, i as RequestExamplesPanel, l as getServerKey, o as authPlaceholder, s as defaultServerVariables, t as EndpointIdentity, u as getServers } from "./OpenApiOperation-BVm4VnFl.js";
1
+ import { a as ResponseExamplesPanel, c as getAuthOptions, g as getRequestBody, h as getMediaTypeEntries, i as RequestExamplesPanel, l as getServerKey, o as authPlaceholder, s as defaultServerVariables, t as EndpointIdentity, u as getServers } from "./OpenApiOperation-p1OjfdKR.js";
2
2
  import { i as OpenApiSpecsContext, n as ConfigProvider, r as LocaleContext } from "./i18n-Bt-OaKRP.js";
3
- import { a as Navigation, s as SectionProvider } from "./PageActions-B98vbZRP.js";
3
+ import { a as Navigation, s as SectionProvider } from "./PageActions-DAdtjf4H.js";
4
4
  import { useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Menu, X } from "lucide-react";