@clarify-labs/renderer 0.10.2 → 0.11.0
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.
- package/output/{ClarifyShell-C6li72Ce.cjs → ClarifyShell-BAjq876Z.cjs} +113 -90
- package/output/ClarifyShell-BAjq876Z.cjs.map +1 -0
- package/output/{ClarifyShell-1LuBliwt.js → ClarifyShell-GoSXvgMg.js} +114 -91
- package/output/ClarifyShell-GoSXvgMg.js.map +1 -0
- package/output/{MermaidViewer-B6-BMCJG.cjs → MermaidViewer-BZ8ghcFP.cjs} +2 -2
- package/output/{MermaidViewer-B6-BMCJG.cjs.map → MermaidViewer-BZ8ghcFP.cjs.map} +1 -1
- package/output/{MermaidViewer-dXsomvM7.js → MermaidViewer-CkIxyqtf.js} +2 -2
- package/output/{MermaidViewer-dXsomvM7.js.map → MermaidViewer-CkIxyqtf.js.map} +1 -1
- package/output/{OpenApiOperation-DgrqzeiS.js → OpenApiOperation-C2vJztWZ.js} +1983 -365
- package/output/OpenApiOperation-C2vJztWZ.js.map +1 -0
- package/output/{OpenApiOperation-B52IWlKb.cjs → OpenApiOperation-D-5uE5v7.cjs} +2009 -361
- package/output/OpenApiOperation-D-5uE5v7.cjs.map +1 -0
- package/output/{PageActions-BjB6PYmL.cjs → PageActions-DJRXlGhz.cjs} +532 -358
- package/output/PageActions-DJRXlGhz.cjs.map +1 -0
- package/output/{PageActions-D7K9LDGf.js → PageActions-bugd7GZh.js} +535 -361
- package/output/PageActions-bugd7GZh.js.map +1 -0
- package/output/{SearchDialog-CIPvXMT3.cjs → SearchDialog-8AdCRp6K.cjs} +3 -3
- package/output/{SearchDialog-CIPvXMT3.cjs.map → SearchDialog-8AdCRp6K.cjs.map} +1 -1
- package/output/{SearchDialog-CxYLjRi5.js → SearchDialog-CBJjDs_9.js} +3 -3
- package/output/{SearchDialog-CxYLjRi5.js.map → SearchDialog-CBJjDs_9.js.map} +1 -1
- package/output/app/ContentDiagnostic.d.ts +2 -1
- package/output/app/PageFooter.d.ts +1 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/components/AccordionGroup.d.ts +7 -0
- package/output/components/Collapse.d.ts +2 -0
- package/output/components/FileTree.d.ts +10 -0
- package/output/components/Image.d.ts +6 -0
- package/output/components/Steps.d.ts +12 -0
- package/output/components/Tabs.d.ts +12 -5
- package/output/components/Tooltip.d.ts +8 -0
- package/output/components/index.d.ts +10 -1
- package/output/core/i18n.d.ts +1 -1
- package/output/core/types.d.ts +37 -19
- package/output/{i18n-DnqZHFT7.js → i18n-BPrC45nD.js} +102 -2
- package/output/i18n-BPrC45nD.js.map +1 -0
- package/output/{i18n-b4iTLeia.cjs → i18n-wXINKKV0.cjs} +102 -2
- package/output/i18n-wXINKKV0.cjs.map +1 -0
- package/output/index.cjs +38 -8
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +8 -7
- package/output/index.js +34 -9
- package/output/index.js.map +1 -1
- package/output/mdx/components.d.ts +11 -1
- package/output/mdx/primitives.d.ts +4 -2
- package/output/openapi/components/CodeDisplay.d.ts +1 -0
- package/output/openapi/components/EndpointMethodBadge.d.ts +6 -0
- package/output/openapi/components/EndpointSections.d.ts +2 -2
- package/output/openapi/components/ExamplePanels.d.ts +2 -2
- package/output/openapi/components/InlineListbox.d.ts +31 -0
- package/output/openapi/components/OpenApiAuthPanel.d.ts +12 -0
- package/output/openapi/components/OpenApiOperation.d.ts +1 -9
- package/output/openapi/components/OpenApiOperation.state.d.ts +4 -2
- package/output/openapi/components/OpenApiRequest.d.ts +18 -0
- package/output/openapi/components/OpenApiRequestFields.d.ts +25 -0
- package/output/openapi/components/OpenApiResponseViewer.d.ts +8 -0
- package/output/openapi/components/SendRequestButton.d.ts +9 -0
- package/output/openapi/components/helpers.d.ts +6 -1
- package/output/openapi/components/useOpenApiRequestState.d.ts +41 -0
- package/output/openapi/entry.d.ts +2 -0
- package/output/openapi/index.d.ts +2 -2
- package/output/openapi/lib/api-exchange-code.d.ts +8 -0
- package/output/openapi/lib/api-exchange.d.ts +30 -0
- package/output/openapi/lib/api-request.d.ts +24 -0
- package/output/openapi/lib/request-code.d.ts +2 -2
- package/output/openapi/lib/request-parameters.d.ts +5 -0
- package/output/openapi/store.d.ts +10 -0
- package/output/openapi/types.d.ts +4 -0
- package/output/preview.cjs +37 -27
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +37 -27
- package/output/preview.js.map +1 -1
- package/output/{render-Di5B6Zc0.cjs → render-FICIzeXz.cjs} +2 -2
- package/output/{render-Di5B6Zc0.cjs.map → render-FICIzeXz.cjs.map} +1 -1
- package/output/{render-DKj24Jqw.js → render-XQiw_48i.js} +2 -2
- package/output/{render-DKj24Jqw.js.map → render-XQiw_48i.js.map} +1 -1
- package/output/renderer.css +1310 -318
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/output/theme/ThemeEditor.d.ts +8 -4
- package/output/theme/variables.d.ts +8 -4
- package/package.json +1 -1
- package/output/ClarifyShell-1LuBliwt.js.map +0 -1
- package/output/ClarifyShell-C6li72Ce.cjs.map +0 -1
- package/output/OpenApiOperation-B52IWlKb.cjs.map +0 -1
- package/output/OpenApiOperation-DgrqzeiS.js.map +0 -1
- package/output/PageActions-BjB6PYmL.cjs.map +0 -1
- package/output/PageActions-D7K9LDGf.js.map +0 -1
- package/output/i18n-DnqZHFT7.js.map +0 -1
- package/output/i18n-b4iTLeia.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDialog-CxYLjRi5.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) return []\n \n const groupTitle = groupTitles.get(route.path)\n const pageItem: SearchItem = {\n title: route.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: route.path,\n keywords: [groupTitle, route.title, route.path, route.kind].filter(Boolean).join(' ').toLowerCase(),\n }\n\n const sectionItems = route.sections?.map((section) => ({\n title: section.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: `${route.path}#${section.id}`,\n keywords: [groupTitle, route.title, section.title, route.path, section.id].filter(Boolean).join(' ').toLowerCase(),\n })) ?? []\n\n return [pageItem, ...sectionItems]\n })\n}\n","import { prefixHref } from '../../utils/href'\n\nimport type { Pagefind } from './types'\n\ntype PagefindModule = {\n createInstance: () => Pagefind\n}\n\nconst pagefindPromises = new Map<string, Promise<Pagefind | null>>()\n\nexport function pagefindCacheKey(routePrefix: string, locale: string | undefined) {\n return `${routePrefix || '/'}:${locale || 'default'}`\n}\n\nexport function loadPagefind(routePrefix: string, locale: string | undefined): Promise<Pagefind | null> {\n if (typeof window === 'undefined') return Promise.resolve(null)\n\n const language = locale ?? document.documentElement.lang\n const cacheKey = pagefindCacheKey(routePrefix, language)\n const cachedPagefind = pagefindPromises.get(cacheKey)\n if (cachedPagefind) {\n return cachedPagefind\n }\n\n const pagefindUrl = prefixHref('/pagefind/pagefind.js', routePrefix)\n const pagefindPromise = import(/* @vite-ignore */ pagefindUrl)\n .then(async (module: PagefindModule) => {\n const previousLanguage = document.documentElement.lang\n if (language) document.documentElement.lang = language\n const pagefind = module.createInstance()\n if (previousLanguage && previousLanguage !== language) document.documentElement.lang = previousLanguage\n await pagefind.init?.()\n return pagefind\n })\n .catch((error: unknown) => {\n pagefindPromises.delete(cacheKey)\n console.warn('[clarify:search] Pagefind instance failed', { cacheKey, language, error })\n return null\n })\n\n pagefindPromises.set(cacheKey, pagefindPromise)\n return pagefindPromise\n}\n\nexport function normalizePagefindUrl(url: string, routePrefix: string): string {\n const parsedUrl = new URL(url, typeof window === 'undefined' ? 'http://localhost' : window.location.origin)\n let pathname = parsedUrl.pathname\n const prefix = routePrefix && routePrefix !== '/' ? `/${routePrefix.replace(/^\\/+|\\/+$/g, '')}` : ''\n\n if (prefix && (pathname === prefix || pathname.startsWith(`${prefix}/`))) {\n pathname = pathname.slice(prefix.length) || '/'\n }\n\n return `${pathname}${parsedUrl.search}${parsedUrl.hash}`\n}\n","import clsx from 'clsx'\nimport { LoaderCircle, Search as SearchIcon } from 'lucide-react'\nimport { forwardRef } from 'react'\n\nimport { useBuiltInText } from '../../i18n'\n\nexport const SearchInput = forwardRef<\n React.ElementRef<'input'>,\n {\n query: string\n setQuery: (query: string) => void\n onClose: () => void\n onSubmit: () => void\n activeDescendantId?: string\n loading?: boolean\n }\n>(function SearchInput(arg0, inputRef) {\n const { query, setQuery, onClose, onSubmit, activeDescendantId, loading = false } = arg0\n const t = useBuiltInText()\n const Icon = loading ? LoaderCircle : SearchIcon\n\n return (\n <div className=\"clarify-search-input group relative flex h-12\">\n <Icon\n aria-hidden=\"true\"\n className={clsx(\n 'pointer-events-none absolute top-0 left-3 h-full w-5 stroke-(--clarify-theme-tokens-colors-muted)',\n loading && 'animate-spin',\n )}\n />\n <input\n ref={inputRef}\n data-autofocus\n role=\"combobox\"\n aria-expanded={query !== ''}\n aria-controls=\"clarify-search-results\"\n aria-activedescendant={activeDescendantId}\n value={query}\n onChange={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === 'Escape') {\n if (query) setQuery('')\n else onClose()\n }\n if (event.key === 'Enter') {\n event.preventDefault()\n onSubmit()\n }\n }}\n placeholder={t('search.placeholder')}\n className=\"clarify-search-field flex-auto appearance-none bg-transparent pr-4 pl-10 outline-hidden focus:w-full focus:flex-none [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden [&::-webkit-search-results-button]:hidden [&::-webkit-search-results-decoration]:hidden\"\n />\n </div>\n )\n})\n","import { Fragment } from 'react'\nimport type { ReactNode } from 'react'\n\nfunction stripHtml(value: string): string {\n if (typeof document === 'undefined') return value.replace(/<[^>]*>/g, '')\n const template = document.createElement('template')\n template.innerHTML = value\n return template.content.textContent ?? ''\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\ntype HighlightQueryProps = { text: string; query: string }\n\nexport function HighlightQuery(arg0: HighlightQueryProps) {\n const { text, query } = arg0\n\n if (!query) return text\n\n const parts = text.split(new RegExp(`(${escapeRegExp(query)})`, 'ig'))\n\n return (\n <>\n {parts.map((part, index) =>\n part.toLowerCase() === query.toLowerCase() ? (\n <mark key={index} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {part}\n </mark>\n ) : (\n <Fragment key={index}>{part}</Fragment>\n ),\n )}\n </>\n )\n}\n\nfunction renderExcerptNode(node: ChildNode, key: string): ReactNode {\n if (node.nodeType === Node.TEXT_NODE) return node.textContent\n if (node.nodeType !== Node.ELEMENT_NODE) return null\n\n const element = node as HTMLElement\n const children = Array.from(element.childNodes).map((child, index) => renderExcerptNode(child, `${key}-${index}`))\n\n if (element.tagName.toLowerCase() === 'mark') {\n return (\n <mark key={key} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {children}\n </mark>\n )\n }\n\n return <Fragment key={key}>{children}</Fragment>\n}\n\ntype HighlightExcerptProps = { excerpt: string; query: string }\n\nexport function HighlightExcerpt(arg0: HighlightExcerptProps) {\n const { excerpt, query } = arg0\n\n if (typeof document === 'undefined' || !excerpt.includes('<mark')) {\n return <HighlightQuery text={stripHtml(excerpt)} query={query} />\n }\n\n const template = document.createElement('template')\n template.innerHTML = excerpt\n\n return <>{Array.from(template.content.childNodes).map((node, index) => renderExcerptNode(node, String(index)))}</>\n}\n","import clsx from 'clsx'\nimport { Fragment, useId } from 'react'\n\nimport { HighlightExcerpt, HighlightQuery } from './Highlight'\nimport type { SearchDisplayItem } from './types'\n\ntype SearchResultProps = {\n result: SearchDisplayItem\n query: string\n active: boolean\n onActive: () => void\n onSelect: () => void\n}\n\nexport function SearchResult(arg0: SearchResultProps) {\n const { result, query, active, onActive, onSelect } = arg0\n const id = useId()\n const hierarchy = result.type === 'quick'\n ? [result.sectionTitle, result.pageTitle].filter((value): value is string => typeof value === 'string')\n : []\n\n return (\n <li\n id={id}\n className={clsx('clarify-search-result group block cursor-pointer px-4 py-3', active && 'clarify-search-result-active')}\n aria-selected={active}\n onMouseEnter={onActive}\n onMouseMove={onActive}\n onMouseDown={(event) => {\n event.preventDefault()\n onSelect()\n }}\n >\n <div className=\"clarify-search-result-title\">\n <HighlightQuery text={result.title} query={query} />\n </div>\n {hierarchy.length > 0 ? (\n <div className=\"clarify-search-result-hierarchy mt-1 truncate whitespace-nowrap\">\n {hierarchy.map((item, itemIndex, items) => (\n <Fragment key={`${item}-${itemIndex}`}>\n <HighlightQuery text={item} query={query} />\n <span className={itemIndex === items.length - 1 ? 'sr-only' : 'clarify-search-result-separator mx-2'}>/</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n {result.type === 'full-text' && result.excerpt ? (\n <p className=\"clarify-search-result-excerpt mt-1 line-clamp-2 text-xs leading-5 text-(--clarify-theme-tokens-colors-muted)\">\n <HighlightExcerpt excerpt={result.excerpt} query={query} />\n </p>\n ) : null}\n </li>\n )\n}\n","import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react'\nimport clsx from 'clsx'\nimport { SearchX } from 'lucide-react'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport { useBuiltInText } from '../../i18n'\nimport type { NavigationNode, RouteItem } from '../../types'\n\nimport { buildSearchItems } from './items'\nimport { loadPagefind, normalizePagefindUrl, pagefindCacheKey } from './pagefind'\nimport { SearchInput } from './SearchInput'\nimport { SearchResult } from './SearchResult'\nimport type { FullTextSearchItem, Pagefind, SearchDisplayItem } from './types'\n\ntype SearchDialogProps = {\n open: boolean\n setOpen: (open: boolean) => void\n routes: RouteItem[]\n navigation: NavigationNode[]\n routePrefix?: string\n currentLocale?: string\n className?: string\n onNavigate?: () => void\n}\n\ntype PagefindState = {\n key: string\n pagefind: Pagefind | null\n available: boolean\n}\n\ntype FullTextSearchState = {\n key: string\n results: FullTextSearchItem[] | null\n}\n\ntype UseSearchDialogLifecycleArgs = {\n open: boolean\n setOpen: (open: boolean) => void\n}\n\nfunction useSearchDialogLifecycle(arg0: UseSearchDialogLifecycleArgs) {\n const { open, setOpen } = arg0\n const location = useLocation()\n\n useEffect(() => {\n setOpen(false)\n }, [location.pathname, location.search, location.hash, setOpen])\n\n useEffect(() => {\n if (typeof window === 'undefined') return undefined\n if (open) return undefined\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n setOpen(true)\n }\n }\n\n window.addEventListener('keydown', onKeyDown)\n return () => window.removeEventListener('keydown', onKeyDown)\n }, [open, setOpen])\n}\n\ntype UseSearchDataArgs = {\n query: string\n searchItems: ReturnType<typeof buildSearchItems>\n routePrefix: string\n currentLocale?: string\n}\n\ntype SearchDataState = {\n results: SearchDisplayItem[]\n searchInputLoading: boolean\n showNoResults: boolean\n}\n\nfunction useSearchData(arg0: UseSearchDataArgs): SearchDataState {\n const { query, searchItems, routePrefix, currentLocale } = arg0\n const [fullTextState, setFullTextState] = useState<FullTextSearchState | null>(null)\n const [pagefindState, setPagefindState] = useState<PagefindState | null>(null)\n\n const quickResults = useMemo(() => {\n const normalizedQuery = query.trim().toLowerCase()\n if (!normalizedQuery) return []\n return searchItems.filter((item) => item.keywords.includes(normalizedQuery)).slice(0, 8).map((item) => ({ ...item, type: 'quick' as const }))\n }, [query, searchItems])\n\n const pagefindKey = pagefindCacheKey(routePrefix, currentLocale)\n const activePagefindState = pagefindState?.key === pagefindKey ? pagefindState : null\n const pagefind = activePagefindState?.pagefind ?? null\n const pagefindAvailable = activePagefindState?.available ?? null\n const trimmedQuery = query.trim()\n const fullTextKey = `${pagefindKey}:${trimmedQuery}`\n const fullTextResults = fullTextState?.key === fullTextKey ? fullTextState.results : null\n const results: SearchDisplayItem[] = fullTextResults ?? quickResults\n const searchInputLoading = pagefindAvailable === null || Boolean(trimmedQuery && pagefind && fullTextState?.key !== fullTextKey)\n const showNoResults = Boolean(query.trim()) && results.length === 0 && pagefindAvailable !== null\n\n useEffect(() => {\n let cancelled = false\n\n loadPagefind(routePrefix, currentLocale).then((loadedPagefind) => {\n if (cancelled) return\n setPagefindState({ key: pagefindKey, pagefind: loadedPagefind, available: Boolean(loadedPagefind) })\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, pagefindKey, routePrefix])\n\n useEffect(() => {\n let cancelled = false\n if (!trimmedQuery || !pagefind) return undefined\n\n Promise.resolve().then(async () => {\n if (cancelled) return\n\n try {\n const search = await pagefind.search(trimmedQuery, { limit: 8 })\n const data = await Promise.all(search.results.map(async (result) => ({ id: result.id, data: await result.data() })))\n if (cancelled) return\n setFullTextState({\n key: fullTextKey,\n results: data.map(({ id, data }) => ({\n type: 'full-text',\n id,\n title: data.meta.title || data.url,\n url: normalizePagefindUrl(data.url, routePrefix),\n excerpt: data.excerpt,\n })),\n })\n } catch (error: unknown) {\n console.warn('[clarify:search] Pagefind search failed', { currentLocale, query: trimmedQuery, error })\n if (!cancelled) setFullTextState({ key: fullTextKey, results: null })\n }\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, fullTextKey, pagefind, routePrefix, trimmedQuery])\n\n return {\n results,\n searchInputLoading,\n showNoResults,\n }\n}\n\nexport function SearchDialog(arg0: SearchDialogProps) {\n const {\n open,\n setOpen,\n routes,\n navigation,\n routePrefix = '/',\n currentLocale,\n className,\n onNavigate = () => {},\n } = arg0\n\n const t = useBuiltInText()\n const navigate = useNavigate()\n const inputRef = useRef<React.ElementRef<typeof SearchInput>>(null)\n const [query, setQuery] = useState('')\n const [activeIndex, setActiveIndex] = useState(0)\n const searchItems = useMemo(() => buildSearchItems(routes, navigation), [navigation, routes])\n\n useSearchDialogLifecycle({ open, setOpen })\n const { results, searchInputLoading, showNoResults } = useSearchData({ query, searchItems, routePrefix, currentLocale })\n\n const updateQuery = (value: string) => {\n setQuery(value)\n setActiveIndex(0)\n }\n\n function closeDialog() {\n updateQuery('')\n setOpen(false)\n }\n\n function selectResult(result = results[activeIndex]) {\n if (!result) return\n navigate(result.url)\n onNavigate()\n closeDialog()\n }\n\n function renderResultsPanel() {\n return (\n <div className=\"border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) empty:hidden dark:border-zinc-100/5 dark:bg-white/2.5\">\n {showNoResults ? (\n <div className=\"p-6 text-center\">\n <SearchX className=\"mx-auto h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-zinc-600\" />\n <p className=\"mt-2 text-xs text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-400\">\n {t('search.noResults', { query })}\n </p>\n </div>\n ) : null}\n {results.length ? (\n <ul id=\"clarify-search-results\" className=\"clarify-search-results\" role=\"listbox\">\n {results.map((result, resultIndex) => (\n <SearchResult\n key={result.type === 'full-text' ? result.id : result.url}\n result={result}\n query={query}\n active={resultIndex === activeIndex}\n onActive={() => setActiveIndex(resultIndex)}\n onSelect={() => selectResult(result)}\n />\n ))}\n </ul>\n ) : null}\n </div>\n )\n }\n\n return (\n <Dialog open={open} onClose={closeDialog} className={clsx('clarify-search-dialog fixed inset-0 z-50', className)}>\n <DialogBackdrop\n transition\n className=\"clarify-search-backdrop clarify-ui-backdrop fixed inset-0 backdrop-blur-xs data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in\"\n />\n\n <div className=\"fixed inset-0 overflow-y-auto px-4 py-4 sm:px-6 sm:py-20 md:py-32 lg:px-8 lg:py-(--clarify-search-dialog-padding-block-lg)\">\n <DialogPanel\n transition\n className=\"clarify-search-panel mx-auto transform-gpu overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) shadow-xl ring-1 ring-(--clarify-theme-tokens-colors-border) data-closed:scale-95 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:max-w-xl dark:bg-zinc-900 dark:ring-zinc-800\"\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index + 1) % results.length : 0))\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index - 1 + results.length) % results.length : 0))\n }\n }}\n >\n <SearchInput\n ref={inputRef}\n query={query}\n setQuery={updateQuery}\n onClose={closeDialog}\n onSubmit={() => selectResult()}\n loading={searchInputLoading}\n />\n {renderResultsPanel()}\n </DialogPanel>\n </div>\n </Dialog>\n )\n}\n\nexport default SearchDialog\n"],"mappings":";;;;;;;;;AAIA,SAAS,iBAAiB,YAA8B;CACtD,MAAM,yBAAS,IAAI,IAAoB;CAEvC,KAAK,MAAM,QAAQ,YACjB,IAAI,KAAK,UAAU,QACjB,KAAK,MAAM,SAAS,KAAK,UACvB,OAAO,IAAI,MAAM,MAAM,KAAK,KAAK;MAGnC,OAAO,IAAI,KAAK,MAAM,KAAK,KAAK;CAIpC,OAAO;AACT;AAEA,SAAgB,iBAAiB,QAAqB,YAA4C;CAChG,MAAM,cAAc,iBAAiB,UAAU;CAE/C,OAAO,OAAO,SAAS,UAAU;EAE/B,IAAI,MAAM,aAAa,OAAO,CAAC;EAE/B,MAAM,aAAa,YAAY,IAAI,MAAM,IAAI;EAiB7C,OAAO,CAAC;GAfN,OAAO,MAAM;GACb,WAAW,MAAM;GACjB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;EACX,CAAA,GAED,oBAAC,OAAD;GAAK,WAAU;aACb,qBAAC,aAAD;IACE,YAAA;IACA,WAAU;IACV,YAAY,UAAU;KACpB,IAAI,MAAM,QAAQ,aAAa;MAC7B,MAAM,eAAe;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,KAAK,QAAQ,SAAS,CAAE;KAC/E;KACA,IAAI,MAAM,QAAQ,WAAW;MAC3B,MAAM,eAAe;MACrB,gBAAgB,UAAW,QAAQ,UAAU,QAAQ,IAAI,QAAQ,UAAU,QAAQ,SAAS,CAAE;KAChG;IACF;cAZF,CAcE,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-CBJjDs_9.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) return []\n \n const groupTitle = groupTitles.get(route.path)\n const pageItem: SearchItem = {\n title: route.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: route.path,\n keywords: [groupTitle, route.title, route.path, route.kind].filter(Boolean).join(' ').toLowerCase(),\n }\n\n const sectionItems = route.sections?.map((section) => ({\n title: section.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: `${route.path}#${section.id}`,\n keywords: [groupTitle, route.title, section.title, route.path, section.id].filter(Boolean).join(' ').toLowerCase(),\n })) ?? []\n\n return [pageItem, ...sectionItems]\n })\n}\n","import { prefixHref } from '../../utils/href'\n\nimport type { Pagefind } from './types'\n\ntype PagefindModule = {\n createInstance: () => Pagefind\n}\n\nconst pagefindPromises = new Map<string, Promise<Pagefind | null>>()\n\nexport function pagefindCacheKey(routePrefix: string, locale: string | undefined) {\n return `${routePrefix || '/'}:${locale || 'default'}`\n}\n\nexport function loadPagefind(routePrefix: string, locale: string | undefined): Promise<Pagefind | null> {\n if (typeof window === 'undefined') return Promise.resolve(null)\n\n const language = locale ?? document.documentElement.lang\n const cacheKey = pagefindCacheKey(routePrefix, language)\n const cachedPagefind = pagefindPromises.get(cacheKey)\n if (cachedPagefind) {\n return cachedPagefind\n }\n\n const pagefindUrl = prefixHref('/pagefind/pagefind.js', routePrefix)\n const pagefindPromise = import(/* @vite-ignore */ pagefindUrl)\n .then(async (module: PagefindModule) => {\n const previousLanguage = document.documentElement.lang\n if (language) document.documentElement.lang = language\n const pagefind = module.createInstance()\n if (previousLanguage && previousLanguage !== language) document.documentElement.lang = previousLanguage\n await pagefind.init?.()\n return pagefind\n })\n .catch((error: unknown) => {\n pagefindPromises.delete(cacheKey)\n console.warn('[clarify:search] Pagefind instance failed', { cacheKey, language, error })\n return null\n })\n\n pagefindPromises.set(cacheKey, pagefindPromise)\n return pagefindPromise\n}\n\nexport function normalizePagefindUrl(url: string, routePrefix: string): string {\n const parsedUrl = new URL(url, typeof window === 'undefined' ? 'http://localhost' : window.location.origin)\n let pathname = parsedUrl.pathname\n const prefix = routePrefix && routePrefix !== '/' ? `/${routePrefix.replace(/^\\/+|\\/+$/g, '')}` : ''\n\n if (prefix && (pathname === prefix || pathname.startsWith(`${prefix}/`))) {\n pathname = pathname.slice(prefix.length) || '/'\n }\n\n return `${pathname}${parsedUrl.search}${parsedUrl.hash}`\n}\n","import clsx from 'clsx'\nimport { LoaderCircle, Search as SearchIcon } from 'lucide-react'\nimport { forwardRef } from 'react'\n\nimport { useBuiltInText } from '../../i18n'\n\nexport const SearchInput = forwardRef<\n React.ElementRef<'input'>,\n {\n query: string\n setQuery: (query: string) => void\n onClose: () => void\n onSubmit: () => void\n activeDescendantId?: string\n loading?: boolean\n }\n>(function SearchInput(arg0, inputRef) {\n const { query, setQuery, onClose, onSubmit, activeDescendantId, loading = false } = arg0\n const t = useBuiltInText()\n const Icon = loading ? LoaderCircle : SearchIcon\n\n return (\n <div className=\"clarify-search-input group relative flex h-12\">\n <Icon\n aria-hidden=\"true\"\n className={clsx(\n 'pointer-events-none absolute top-0 left-3 h-full w-5 stroke-(--clarify-theme-tokens-colors-muted)',\n loading && 'animate-spin',\n )}\n />\n <input\n ref={inputRef}\n data-autofocus\n role=\"combobox\"\n aria-expanded={query !== ''}\n aria-controls=\"clarify-search-results\"\n aria-activedescendant={activeDescendantId}\n value={query}\n onChange={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === 'Escape') {\n if (query) setQuery('')\n else onClose()\n }\n if (event.key === 'Enter') {\n event.preventDefault()\n onSubmit()\n }\n }}\n placeholder={t('search.placeholder')}\n className=\"clarify-search-field flex-auto appearance-none bg-transparent pr-4 pl-10 outline-hidden focus:w-full focus:flex-none [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden [&::-webkit-search-results-button]:hidden [&::-webkit-search-results-decoration]:hidden\"\n />\n </div>\n )\n})\n","import { Fragment } from 'react'\nimport type { ReactNode } from 'react'\n\nfunction stripHtml(value: string): string {\n if (typeof document === 'undefined') return value.replace(/<[^>]*>/g, '')\n const template = document.createElement('template')\n template.innerHTML = value\n return template.content.textContent ?? ''\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\ntype HighlightQueryProps = { text: string; query: string }\n\nexport function HighlightQuery(arg0: HighlightQueryProps) {\n const { text, query } = arg0\n\n if (!query) return text\n\n const parts = text.split(new RegExp(`(${escapeRegExp(query)})`, 'ig'))\n\n return (\n <>\n {parts.map((part, index) =>\n part.toLowerCase() === query.toLowerCase() ? (\n <mark key={index} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {part}\n </mark>\n ) : (\n <Fragment key={index}>{part}</Fragment>\n ),\n )}\n </>\n )\n}\n\nfunction renderExcerptNode(node: ChildNode, key: string): ReactNode {\n if (node.nodeType === Node.TEXT_NODE) return node.textContent\n if (node.nodeType !== Node.ELEMENT_NODE) return null\n\n const element = node as HTMLElement\n const children = Array.from(element.childNodes).map((child, index) => renderExcerptNode(child, `${key}-${index}`))\n\n if (element.tagName.toLowerCase() === 'mark') {\n return (\n <mark key={key} className=\"bg-transparent text-(--clarify-theme-tokens-colors-primary) underline\">\n {children}\n </mark>\n )\n }\n\n return <Fragment key={key}>{children}</Fragment>\n}\n\ntype HighlightExcerptProps = { excerpt: string; query: string }\n\nexport function HighlightExcerpt(arg0: HighlightExcerptProps) {\n const { excerpt, query } = arg0\n\n if (typeof document === 'undefined' || !excerpt.includes('<mark')) {\n return <HighlightQuery text={stripHtml(excerpt)} query={query} />\n }\n\n const template = document.createElement('template')\n template.innerHTML = excerpt\n\n return <>{Array.from(template.content.childNodes).map((node, index) => renderExcerptNode(node, String(index)))}</>\n}\n","import clsx from 'clsx'\nimport { Fragment, useId } from 'react'\n\nimport { HighlightExcerpt, HighlightQuery } from './Highlight'\nimport type { SearchDisplayItem } from './types'\n\ntype SearchResultProps = {\n result: SearchDisplayItem\n query: string\n active: boolean\n onActive: () => void\n onSelect: () => void\n}\n\nexport function SearchResult(arg0: SearchResultProps) {\n const { result, query, active, onActive, onSelect } = arg0\n const id = useId()\n const hierarchy = result.type === 'quick'\n ? [result.sectionTitle, result.pageTitle].filter((value): value is string => typeof value === 'string')\n : []\n\n return (\n <li\n id={id}\n className={clsx('clarify-search-result group block cursor-pointer px-4 py-3', active && 'clarify-search-result-active')}\n aria-selected={active}\n onMouseEnter={onActive}\n onMouseMove={onActive}\n onMouseDown={(event) => {\n event.preventDefault()\n onSelect()\n }}\n >\n <div className=\"clarify-search-result-title\">\n <HighlightQuery text={result.title} query={query} />\n </div>\n {hierarchy.length > 0 ? (\n <div className=\"clarify-search-result-hierarchy mt-1 truncate whitespace-nowrap\">\n {hierarchy.map((item, itemIndex, items) => (\n <Fragment key={`${item}-${itemIndex}`}>\n <HighlightQuery text={item} query={query} />\n <span className={itemIndex === items.length - 1 ? 'sr-only' : 'clarify-search-result-separator mx-2'}>/</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n {result.type === 'full-text' && result.excerpt ? (\n <p className=\"clarify-search-result-excerpt mt-1 line-clamp-2 text-xs leading-5 text-(--clarify-theme-tokens-colors-muted)\">\n <HighlightExcerpt excerpt={result.excerpt} query={query} />\n </p>\n ) : null}\n </li>\n )\n}\n","import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react'\nimport clsx from 'clsx'\nimport { SearchX } from 'lucide-react'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport { useBuiltInText } from '../../i18n'\nimport type { NavigationNode, RouteItem } from '../../types'\n\nimport { buildSearchItems } from './items'\nimport { loadPagefind, normalizePagefindUrl, pagefindCacheKey } from './pagefind'\nimport { SearchInput } from './SearchInput'\nimport { SearchResult } from './SearchResult'\nimport type { FullTextSearchItem, Pagefind, SearchDisplayItem } from './types'\n\ntype SearchDialogProps = {\n open: boolean\n setOpen: (open: boolean) => void\n routes: RouteItem[]\n navigation: NavigationNode[]\n routePrefix?: string\n currentLocale?: string\n className?: string\n onNavigate?: () => void\n}\n\ntype PagefindState = {\n key: string\n pagefind: Pagefind | null\n available: boolean\n}\n\ntype FullTextSearchState = {\n key: string\n results: FullTextSearchItem[] | null\n}\n\ntype UseSearchDialogLifecycleArgs = {\n open: boolean\n setOpen: (open: boolean) => void\n}\n\nfunction useSearchDialogLifecycle(arg0: UseSearchDialogLifecycleArgs) {\n const { open, setOpen } = arg0\n const location = useLocation()\n\n useEffect(() => {\n setOpen(false)\n }, [location.pathname, location.search, location.hash, setOpen])\n\n useEffect(() => {\n if (typeof window === 'undefined') return undefined\n if (open) return undefined\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n setOpen(true)\n }\n }\n\n window.addEventListener('keydown', onKeyDown)\n return () => window.removeEventListener('keydown', onKeyDown)\n }, [open, setOpen])\n}\n\ntype UseSearchDataArgs = {\n query: string\n searchItems: ReturnType<typeof buildSearchItems>\n routePrefix: string\n currentLocale?: string\n}\n\ntype SearchDataState = {\n results: SearchDisplayItem[]\n searchInputLoading: boolean\n showNoResults: boolean\n}\n\nfunction useSearchData(arg0: UseSearchDataArgs): SearchDataState {\n const { query, searchItems, routePrefix, currentLocale } = arg0\n const [fullTextState, setFullTextState] = useState<FullTextSearchState | null>(null)\n const [pagefindState, setPagefindState] = useState<PagefindState | null>(null)\n\n const quickResults = useMemo(() => {\n const normalizedQuery = query.trim().toLowerCase()\n if (!normalizedQuery) return []\n return searchItems.filter((item) => item.keywords.includes(normalizedQuery)).slice(0, 8).map((item) => ({ ...item, type: 'quick' as const }))\n }, [query, searchItems])\n\n const pagefindKey = pagefindCacheKey(routePrefix, currentLocale)\n const activePagefindState = pagefindState?.key === pagefindKey ? pagefindState : null\n const pagefind = activePagefindState?.pagefind ?? null\n const pagefindAvailable = activePagefindState?.available ?? null\n const trimmedQuery = query.trim()\n const fullTextKey = `${pagefindKey}:${trimmedQuery}`\n const fullTextResults = fullTextState?.key === fullTextKey ? fullTextState.results : null\n const results: SearchDisplayItem[] = fullTextResults ?? quickResults\n const searchInputLoading = pagefindAvailable === null || Boolean(trimmedQuery && pagefind && fullTextState?.key !== fullTextKey)\n const showNoResults = Boolean(query.trim()) && results.length === 0 && pagefindAvailable !== null\n\n useEffect(() => {\n let cancelled = false\n\n loadPagefind(routePrefix, currentLocale).then((loadedPagefind) => {\n if (cancelled) return\n setPagefindState({ key: pagefindKey, pagefind: loadedPagefind, available: Boolean(loadedPagefind) })\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, pagefindKey, routePrefix])\n\n useEffect(() => {\n let cancelled = false\n if (!trimmedQuery || !pagefind) return undefined\n\n Promise.resolve().then(async () => {\n if (cancelled) return\n\n try {\n const search = await pagefind.search(trimmedQuery, { limit: 8 })\n const data = await Promise.all(search.results.map(async (result) => ({ id: result.id, data: await result.data() })))\n if (cancelled) return\n setFullTextState({\n key: fullTextKey,\n results: data.map(({ id, data }) => ({\n type: 'full-text',\n id,\n title: data.meta.title || data.url,\n url: normalizePagefindUrl(data.url, routePrefix),\n excerpt: data.excerpt,\n })),\n })\n } catch (error: unknown) {\n console.warn('[clarify:search] Pagefind search failed', { currentLocale, query: trimmedQuery, error })\n if (!cancelled) setFullTextState({ key: fullTextKey, results: null })\n }\n })\n\n return () => {\n cancelled = true\n }\n }, [currentLocale, fullTextKey, pagefind, routePrefix, trimmedQuery])\n\n return {\n results,\n searchInputLoading,\n showNoResults,\n }\n}\n\nexport function SearchDialog(arg0: SearchDialogProps) {\n const {\n open,\n setOpen,\n routes,\n navigation,\n routePrefix = '/',\n currentLocale,\n className,\n onNavigate = () => {},\n } = arg0\n\n const t = useBuiltInText()\n const navigate = useNavigate()\n const inputRef = useRef<React.ElementRef<typeof SearchInput>>(null)\n const [query, setQuery] = useState('')\n const [activeIndex, setActiveIndex] = useState(0)\n const searchItems = useMemo(() => buildSearchItems(routes, navigation), [navigation, routes])\n\n useSearchDialogLifecycle({ open, setOpen })\n const { results, searchInputLoading, showNoResults } = useSearchData({ query, searchItems, routePrefix, currentLocale })\n\n const updateQuery = (value: string) => {\n setQuery(value)\n setActiveIndex(0)\n }\n\n function closeDialog() {\n updateQuery('')\n setOpen(false)\n }\n\n function selectResult(result = results[activeIndex]) {\n if (!result) return\n navigate(result.url)\n onNavigate()\n closeDialog()\n }\n\n function renderResultsPanel() {\n return (\n <div className=\"border-t border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-background) empty:hidden dark:border-zinc-100/5 dark:bg-white/2.5\">\n {showNoResults ? (\n <div className=\"p-6 text-center\">\n <SearchX className=\"mx-auto h-5 w-5 stroke-(--clarify-theme-tokens-colors-foreground) dark:stroke-zinc-600\" />\n <p className=\"mt-2 text-xs text-(--clarify-theme-tokens-colors-muted) dark:text-zinc-400\">\n {t('search.noResults', { query })}\n </p>\n </div>\n ) : null}\n {results.length ? (\n <ul id=\"clarify-search-results\" className=\"clarify-search-results\" role=\"listbox\">\n {results.map((result, resultIndex) => (\n <SearchResult\n key={result.type === 'full-text' ? result.id : result.url}\n result={result}\n query={query}\n active={resultIndex === activeIndex}\n onActive={() => setActiveIndex(resultIndex)}\n onSelect={() => selectResult(result)}\n />\n ))}\n </ul>\n ) : null}\n </div>\n )\n }\n\n return (\n <Dialog open={open} onClose={closeDialog} className={clsx('clarify-search-dialog fixed inset-0 z-50', className)}>\n <DialogBackdrop\n transition\n className=\"clarify-search-backdrop clarify-ui-backdrop fixed inset-0 backdrop-blur-xs data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in\"\n />\n\n <div className=\"fixed inset-0 overflow-y-auto px-4 py-4 sm:px-6 sm:py-20 md:py-32 lg:px-8 lg:py-(--clarify-search-dialog-padding-block-lg)\">\n <DialogPanel\n transition\n className=\"clarify-search-panel mx-auto transform-gpu overflow-hidden rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) shadow-xl ring-1 ring-(--clarify-theme-tokens-colors-border) data-closed:scale-95 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:max-w-xl dark:bg-zinc-900 dark:ring-zinc-800\"\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index + 1) % results.length : 0))\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActiveIndex((index) => (results.length ? (index - 1 + results.length) % results.length : 0))\n }\n }}\n >\n <SearchInput\n ref={inputRef}\n query={query}\n setQuery={updateQuery}\n onClose={closeDialog}\n onSubmit={() => selectResult()}\n loading={searchInputLoading}\n />\n {renderResultsPanel()}\n </DialogPanel>\n </div>\n </Dialog>\n )\n}\n\nexport default SearchDialog\n"],"mappings":";;;;;;;;;AAIA,SAAS,iBAAiB,YAA8B;CACtD,MAAM,yBAAS,IAAI,IAAoB;CAEvC,KAAK,MAAM,QAAQ,YACjB,IAAI,KAAK,UAAU,QACjB,KAAK,MAAM,SAAS,KAAK,UACvB,OAAO,IAAI,MAAM,MAAM,KAAK,KAAK;MAGnC,OAAO,IAAI,KAAK,MAAM,KAAK,KAAK;CAIpC,OAAO;AACT;AAEA,SAAgB,iBAAiB,QAAqB,YAA4C;CAChG,MAAM,cAAc,iBAAiB,UAAU;CAE/C,OAAO,OAAO,SAAS,UAAU;EAE/B,IAAI,MAAM,aAAa,OAAO,CAAC;EAE/B,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,KAA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;KACE;KACP,UAAU;KACV,SAAS;KACT,gBAAgB,aAAa;KAC7B,SAAS;IACV,CAAA,GACA,mBAAmB,CACT;;EACV,CAAA,CACC;;AAEZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function PageFooter(): import("react").JSX.Element;
|
|
1
|
+
export declare function PageFooter(): import("react").JSX.Element | null;
|
package/output/client.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ClarifyShell = require("./ClarifyShell-
|
|
3
|
-
const require_PageActions = require("./PageActions-
|
|
4
|
-
const require_render = require("./render-
|
|
2
|
+
const require_ClarifyShell = require("./ClarifyShell-BAjq876Z.cjs");
|
|
3
|
+
const require_PageActions = require("./PageActions-DJRXlGhz.cjs");
|
|
4
|
+
const require_render = require("./render-FICIzeXz.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-
|
|
2
|
-
import { S as themeCookieName, _ as getStoredThemePreference, b as storeLocalePreference, g as getStoredLocalePreference, v as localeCookieName, x as storeThemePreference, y as readLocaleCookie } from "./PageActions-
|
|
3
|
-
import { t as render } from "./render-
|
|
1
|
+
import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ClarifyShell-GoSXvgMg.js";
|
|
2
|
+
import { S as themeCookieName, _ as getStoredThemePreference, b as storeLocalePreference, g as getStoredLocalePreference, v as localeCookieName, x as storeThemePreference, y as readLocaleCookie } from "./PageActions-bugd7GZh.js";
|
|
3
|
+
import { t as render } from "./render-XQiw_48i.js";
|
|
4
4
|
export { ThemeEditor, applyThemeVariables, getStoredLocalePreference, getStoredThemePreference, localeCookieName, readLocaleCookie, render, storeLocalePreference, storeThemePreference, themeBootstrapScript, themeCookieName, themeEditorPresets, themeStorageKey };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
2
|
+
import { CollapseProps } from './Collapse';
|
|
3
|
+
export type AccordionGroupProps = {
|
|
4
|
+
children?: ReactElement<CollapseProps> | ReactElement<CollapseProps>[];
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
7
|
+
export declare function AccordionGroup(arg0: AccordionGroupProps): import("react").JSX.Element;
|
|
@@ -4,6 +4,8 @@ export type CollapseProps = {
|
|
|
4
4
|
title?: ReactNode;
|
|
5
5
|
summary?: ReactNode;
|
|
6
6
|
defaultOpen?: boolean;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
9
|
className?: string;
|
|
8
10
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'className'>;
|
|
9
11
|
export declare function Collapse(arg0: CollapseProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export type FileTreeProps = ComponentPropsWithoutRef<'div'>;
|
|
3
|
+
export declare function FileTree(arg0: FileTreeProps): import("react").JSX.Element;
|
|
4
|
+
export type FileTreeItemProps = {
|
|
5
|
+
name: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
type?: 'file' | 'folder';
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
} & Omit<ComponentPropsWithoutRef<'li'>, 'children'>;
|
|
10
|
+
export declare function FileTreeItem(arg0: FileTreeItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export type StepsProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & Omit<ComponentPropsWithoutRef<'ol'>, 'children' | 'className'>;
|
|
6
|
+
export declare function Steps(arg0: StepsProps): import("react").JSX.Element;
|
|
7
|
+
export type StepProps = {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
} & Omit<ComponentPropsWithoutRef<'li'>, 'children' | 'className' | 'title'>;
|
|
12
|
+
export declare function Step(arg0: StepProps): import("react").JSX.Element;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
type
|
|
2
|
+
export type TabItem = {
|
|
3
3
|
id: string;
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
panel: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
8
|
-
|
|
7
|
+
export type TabProps = {
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
value?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function TabItem(_props: TabProps): null;
|
|
13
|
+
export type TabsProps = {
|
|
14
|
+
items?: TabItem[];
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
defaultValue?: string;
|
|
9
17
|
selectedIndex?: number;
|
|
10
18
|
onChange?: (index: number) => void;
|
|
11
19
|
className?: string;
|
|
12
20
|
listClassName?: string;
|
|
13
21
|
panelsClassName?: string;
|
|
14
22
|
};
|
|
15
|
-
export declare function Tabs(arg0:
|
|
16
|
-
export {};
|
|
23
|
+
export declare function Tabs(arg0: TabsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export type TooltipProps = {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
side?: 'top' | 'bottom';
|
|
6
|
+
triggerClassName?: string;
|
|
7
|
+
} & Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'content'>;
|
|
8
|
+
export declare function Tooltip(arg0: TooltipProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { AccordionGroup } from './AccordionGroup';
|
|
2
|
+
export type { AccordionGroupProps } from './AccordionGroup';
|
|
1
3
|
export { Button } from './Button';
|
|
2
4
|
export type { ButtonProps } from './Button';
|
|
3
5
|
export { Callout } from './Callout';
|
|
@@ -8,6 +10,8 @@ export { Code, CodeGroup, Pre } from './Code';
|
|
|
8
10
|
export { Collapse } from './Collapse';
|
|
9
11
|
export type { CollapseProps } from './Collapse';
|
|
10
12
|
export { Feedback } from './Feedback';
|
|
13
|
+
export { FileTree, FileTreeItem } from './FileTree';
|
|
14
|
+
export type { FileTreeItemProps, FileTreeProps } from './FileTree';
|
|
11
15
|
export { Heading } from './Heading';
|
|
12
16
|
export { LocalizedLink, useLocalizedHref } from './LocalizedLink';
|
|
13
17
|
export type { LocalizedLinkProps } from './LocalizedLink';
|
|
@@ -15,8 +19,13 @@ export { Logo } from './Logo';
|
|
|
15
19
|
export { Mermaid } from './Mermaid';
|
|
16
20
|
export { GridPattern, HeroPattern } from './patterns';
|
|
17
21
|
export { Prose } from './Prose';
|
|
22
|
+
export { Step, Steps } from './Steps';
|
|
23
|
+
export type { StepProps, StepsProps } from './Steps';
|
|
18
24
|
export { Tag } from './Tag';
|
|
19
25
|
export type { TagProps } from './Tag';
|
|
20
|
-
export { Tabs } from './Tabs';
|
|
26
|
+
export { TabItem as Tab, Tabs } from './Tabs';
|
|
27
|
+
export type { TabItem, TabProps, TabsProps } from './Tabs';
|
|
28
|
+
export { Tooltip } from './Tooltip';
|
|
29
|
+
export type { TooltipProps } from './Tooltip';
|
|
21
30
|
export { WebFrame } from './WebFrame';
|
|
22
31
|
export type { WebFrameProps } from './WebFrame';
|
package/output/core/i18n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type BuiltInLocale = 'en' | 'zh-CN';
|
|
2
|
-
export type BuiltInTextKey = 'actions.code' | 'actions.copy' | 'actions.copied' | 'builtWith.label' | 'builtWith.prefix' | 'callout.danger' | 'callout.info' | 'callout.note' | 'callout.success' | 'callout.tip' | 'callout.warning' | 'contentActions.copyContent' | 'contentActions.copyContentDescription' | 'contentActions.copyLink' | 'contentActions.copyLinkDescription' | 'contentActions.copyLlms' | 'contentActions.copyLlmsDescription' | 'contentActions.copiedLlms' | 'contentActions.editPage' | 'contentActions.editPageDescription' | 'contentActions.copyOptions' | 'contentActions.copiedContent' | 'contentActions.copiedLink' | 'contentActions.viewMarkdown' | 'contentActions.viewMarkdownDescription' | 'contentActions.viewOpenApi' | 'contentActions.viewOpenApiDescription' | 'feedback.no' | 'feedback.prompt' | 'feedback.thanks' | 'feedback.yes' | 'navigation.documentation' | 'navigation.next' | 'navigation.previous' | 'navigation.previousNext' | 'navigation.toggle' | 'navbar.home' | 'navbar.openLinks' | 'navbar.sections' | 'notFound.description' | 'notFound.home' | 'notFound.label' | 'notFound.title' | 'openapi.apiDocumentation' | 'openapi.bodyProperties' | 'openapi.collapse' | 'openapi.endpointNotFound' | 'openapi.example' | 'openapi.expand' | 'openapi.headers' | 'openapi.language' | 'openapi.client' | 'openapi.loading' | 'openapi.mediaType' | 'openapi.none' | 'openapi.openApiReference' | 'openapi.operationParameter' | 'openapi.optional' | 'openapi.parameter' | 'openapi.pathParameters' | 'openapi.queryParameters' | 'openapi.request' | 'openapi.requestBody' | 'openapi.requestBodyEmpty' | 'openapi.responseBodyProperties' | 'openapi.required' | 'openapi.requiredBadge' | 'openapi.response' | 'openapi.responses' | 'openapi.schemaExample' | 'openapi.scrollExamplesLeft' | 'openapi.scrollExamplesRight' | 'openapi.specNotFound' | 'openapi.specPathMissing' | 'openapi.status' | 'openapi.version' | 'openapi.webhookResponse' | 'openapi.webhookResponses' | 'search.button' | 'search.noResults' | 'search.placeholder' | 'search.shortcutCtrl' | 'renderError.componentStack' | 'renderError.description' | 'renderError.details' | 'renderError.message' | 'renderError.path' | 'renderError.reload' | 'renderError.stack' | 'renderError.title' | 'renderError.version' | 'renderError.type' | 'theme.switchToDark' | 'theme.switchToLight' | 'theme.switchToSystem' | 'language.switch' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.resetZoom' | 'mermaid.renderError' | 'mermaid.scrollHint';
|
|
2
|
+
export type BuiltInTextKey = 'actions.code' | 'actions.copy' | 'actions.copying' | 'actions.copied' | 'actions.copyFailed' | 'builtWith.label' | 'builtWith.prefix' | 'callout.danger' | 'callout.info' | 'callout.note' | 'callout.success' | 'callout.tip' | 'callout.warning' | 'contentActions.copyContent' | 'contentActions.copyContentDescription' | 'contentActions.copyLink' | 'contentActions.copyLinkDescription' | 'contentActions.copyLlms' | 'contentActions.copyLlmsDescription' | 'contentActions.copiedLlms' | 'contentActions.editPage' | 'contentActions.editPageDescription' | 'contentActions.copyOptions' | 'contentActions.copiedContent' | 'contentActions.copiedLink' | 'contentActions.viewMarkdown' | 'contentActions.viewMarkdownDescription' | 'contentActions.viewOpenApi' | 'contentActions.viewOpenApiDescription' | 'feedback.no' | 'feedback.prompt' | 'feedback.thanks' | 'feedback.yes' | 'navigation.documentation' | 'navigation.next' | 'navigation.previous' | 'navigation.previousNext' | 'navigation.toggle' | 'navbar.home' | 'navbar.openLinks' | 'navbar.sections' | 'notFound.description' | 'notFound.home' | 'notFound.label' | 'notFound.title' | 'openapi.apiDocumentation' | 'openapi.authentication' | 'openapi.bodyProperties' | 'openapi.collapse' | 'openapi.clear' | 'openapi.codeSnippet' | 'openapi.endpointNotFound' | 'openapi.example' | 'openapi.expand' | 'openapi.headers' | 'openapi.headerName' | 'openapi.headerValue' | 'openapi.headerParameters' | 'openapi.fieldDescription' | 'openapi.includeParameter' | 'openapi.cookieParameters' | 'openapi.cookieParametersBrowserManaged' | 'openapi.cookies' | 'openapi.cookiesBrowserHidden' | 'openapi.language' | 'openapi.client' | 'openapi.closeRequest' | 'openapi.credential' | 'openapi.loading' | 'openapi.mediaType' | 'openapi.none' | 'openapi.noRequestConfiguration' | 'openapi.openApiReference' | 'openapi.operationParameter' | 'openapi.optional' | 'openapi.parameter' | 'openapi.parameterInvalidArray' | 'openapi.parameterInvalidDate' | 'openapi.parameterInvalidDateTime' | 'openapi.parameterInvalidEnum' | 'openapi.parameterInvalidInteger' | 'openapi.parameterInvalidNumber' | 'openapi.parameterInvalidObject' | 'openapi.pathParameters' | 'openapi.queryParameters' | 'openapi.preview' | 'openapi.raw' | 'openapi.resetToExample' | 'openapi.body' | 'openapi.binaryPreview' | 'openapi.downloadBody' | 'openapi.noHeaders' | 'openapi.responseViews' | 'openapi.responseUrl' | 'openapi.redirected' | 'openapi.searchHeaders' | 'openapi.unknownContentType' | 'openapi.variables' | 'openapi.requestConfiguration' | 'openapi.requestHeaders' | 'openapi.request' | 'openapi.requestBody' | 'openapi.requestBodyEmpty' | 'openapi.requestCorsHint' | 'openapi.responseBodyProperties' | 'openapi.responseHeaders' | 'openapi.required' | 'openapi.requiredBadge' | 'openapi.response' | 'openapi.responseBodyEmpty' | 'openapi.responseBodyEmptyTitle' | 'openapi.responseEmpty' | 'openapi.responseEmptyTitle' | 'openapi.responseErrorTitle' | 'openapi.responses' | 'openapi.schemaExample' | 'openapi.sendRequest' | 'openapi.sendingRequest' | 'openapi.server' | 'openapi.scrollExamplesLeft' | 'openapi.scrollExamplesRight' | 'openapi.specNotFound' | 'openapi.specPathMissing' | 'openapi.status' | 'openapi.tryRequest' | 'openapi.version' | 'openapi.webhookResponse' | 'openapi.webhookResponses' | 'search.button' | 'search.noResults' | 'search.placeholder' | 'search.shortcutCtrl' | 'renderError.componentStack' | 'renderError.description' | 'renderError.details' | 'renderError.message' | 'renderError.path' | 'renderError.reload' | 'renderError.stack' | 'renderError.title' | 'renderError.version' | 'renderError.type' | 'theme.switchToDark' | 'theme.switchToLight' | 'theme.switchToSystem' | 'language.switch' | 'mermaid.zoomIn' | 'mermaid.zoomOut' | 'mermaid.resetZoom' | 'mermaid.renderError' | 'mermaid.scrollHint';
|
|
3
3
|
export declare function resolveBuiltInLocale(locale?: string): BuiltInLocale;
|
|
4
4
|
export declare function translateBuiltInText(locale: string | undefined, key: BuiltInTextKey, replacements?: Record<string, string>): string;
|
|
5
5
|
export declare function useBuiltInText(locale?: string): (key: BuiltInTextKey, replacements?: Record<string, string>) => string;
|
package/output/core/types.d.ts
CHANGED
|
@@ -53,8 +53,8 @@ export type LocaleConfig = {
|
|
|
53
53
|
label: string;
|
|
54
54
|
dir?: 'ltr' | 'rtl';
|
|
55
55
|
};
|
|
56
|
-
export type
|
|
57
|
-
|
|
56
|
+
export type LocalesConfig = {
|
|
57
|
+
default: string;
|
|
58
58
|
missing: 'fallback' | '404' | 'hide';
|
|
59
59
|
locales: LocaleConfig[];
|
|
60
60
|
};
|
|
@@ -73,11 +73,11 @@ export type FooterConfig = {
|
|
|
73
73
|
socials?: Record<string, string>;
|
|
74
74
|
copyright?: LocalizedText;
|
|
75
75
|
};
|
|
76
|
-
export type
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
directory?: string;
|
|
76
|
+
export type VariablePrimitive = string | number | boolean;
|
|
77
|
+
export type VariableValue = VariablePrimitive | {
|
|
78
|
+
[key: string]: VariableValue;
|
|
80
79
|
};
|
|
80
|
+
export type VariablesConfig = Record<string, VariableValue>;
|
|
81
81
|
export type ThemePreset = 'default' | 'base';
|
|
82
82
|
export type ThemeModeColorValue = {
|
|
83
83
|
light?: string;
|
|
@@ -111,7 +111,6 @@ export type ThemeConfig = {
|
|
|
111
111
|
preset: ThemePreset;
|
|
112
112
|
tokens: ThemeTokensConfig;
|
|
113
113
|
layout: ThemeLayoutConfig;
|
|
114
|
-
editor: boolean;
|
|
115
114
|
};
|
|
116
115
|
export type PagesItem = string | {
|
|
117
116
|
page: string;
|
|
@@ -138,26 +137,45 @@ export type TabItem = {
|
|
|
138
137
|
pages?: PagesConfig;
|
|
139
138
|
};
|
|
140
139
|
export type TabsConfig = TabItem[];
|
|
140
|
+
export type NavigationConfig = {
|
|
141
|
+
links?: NavbarLink[];
|
|
142
|
+
tabs?: TabsConfig;
|
|
143
|
+
};
|
|
144
|
+
export type FeaturesConfig = {
|
|
145
|
+
search: {
|
|
146
|
+
enabled: boolean;
|
|
147
|
+
provider: 'pagefind' | 'none';
|
|
148
|
+
};
|
|
149
|
+
repository: {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
url?: string;
|
|
152
|
+
branch?: string;
|
|
153
|
+
directory?: string;
|
|
154
|
+
};
|
|
155
|
+
themeEditor: {
|
|
156
|
+
enabled: boolean;
|
|
157
|
+
};
|
|
158
|
+
openapi: {
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
playground: boolean;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
141
163
|
export type Config = {
|
|
142
164
|
title: string;
|
|
143
|
-
logo?: LogoConfig;
|
|
144
|
-
homeUrl?: string;
|
|
145
|
-
favicon?: FaviconConfig;
|
|
146
|
-
theme: ThemeConfig;
|
|
147
165
|
description: string;
|
|
148
166
|
siteUrl?: string;
|
|
149
|
-
source?: SourceConfig;
|
|
150
|
-
rootDirectory: string;
|
|
151
167
|
routePrefix: string;
|
|
152
168
|
assetPrefix: string;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
logo?: LogoConfig;
|
|
170
|
+
homeUrl?: string;
|
|
171
|
+
favicon?: FaviconConfig;
|
|
172
|
+
theme: ThemeConfig;
|
|
173
|
+
navigation?: NavigationConfig;
|
|
157
174
|
banner?: BannerConfig;
|
|
158
175
|
footer?: FooterConfig;
|
|
159
|
-
|
|
160
|
-
|
|
176
|
+
locales?: LocalesConfig;
|
|
177
|
+
variables?: VariablesConfig;
|
|
178
|
+
features: FeaturesConfig;
|
|
161
179
|
version?: string;
|
|
162
180
|
};
|
|
163
181
|
export type NavigationTab = {
|
|
@@ -23,7 +23,9 @@ var builtInText = {
|
|
|
23
23
|
en: {
|
|
24
24
|
"actions.code": "Code",
|
|
25
25
|
"actions.copy": "Copy",
|
|
26
|
+
"actions.copying": "Copying...",
|
|
26
27
|
"actions.copied": "Copied!",
|
|
28
|
+
"actions.copyFailed": "Copy failed",
|
|
27
29
|
"builtWith.label": "Built with Clarify",
|
|
28
30
|
"builtWith.prefix": "Built with",
|
|
29
31
|
"callout.danger": "Danger",
|
|
@@ -65,37 +67,85 @@ var builtInText = {
|
|
|
65
67
|
"notFound.label": "404",
|
|
66
68
|
"notFound.title": "Page not found",
|
|
67
69
|
"openapi.apiDocumentation": "API Documentation",
|
|
70
|
+
"openapi.authentication": "Authentication",
|
|
68
71
|
"openapi.bodyProperties": "Body properties",
|
|
69
72
|
"openapi.collapse": "Collapse",
|
|
73
|
+
"openapi.clear": "Clear",
|
|
74
|
+
"openapi.codeSnippet": "Code snippet",
|
|
70
75
|
"openapi.endpointNotFound": "Endpoint not found: {endpoint}",
|
|
71
76
|
"openapi.example": "Example",
|
|
72
77
|
"openapi.expand": "Expand",
|
|
73
78
|
"openapi.headers": "Headers",
|
|
79
|
+
"openapi.headerName": "Name",
|
|
80
|
+
"openapi.headerValue": "Value",
|
|
81
|
+
"openapi.headerParameters": "Header parameters",
|
|
82
|
+
"openapi.fieldDescription": "Field description",
|
|
83
|
+
"openapi.includeParameter": "Include parameter",
|
|
84
|
+
"openapi.cookieParameters": "Cookie parameters",
|
|
85
|
+
"openapi.cookieParametersBrowserManaged": "Cookies are managed by the browser. Matching cookies are sent when the server allows credentialed requests.",
|
|
86
|
+
"openapi.cookies": "Cookies",
|
|
87
|
+
"openapi.cookiesBrowserHidden": "Cookies are managed by the browser. Set-Cookie values are not exposed to JavaScript.",
|
|
74
88
|
"openapi.language": "Language",
|
|
75
89
|
"openapi.client": "Client",
|
|
90
|
+
"openapi.closeRequest": "Close request tester",
|
|
91
|
+
"openapi.credential": "Credential",
|
|
76
92
|
"openapi.loading": "Loading OpenAPI spec...",
|
|
77
93
|
"openapi.mediaType": "Media type",
|
|
78
94
|
"openapi.none": "None",
|
|
95
|
+
"openapi.noRequestConfiguration": "This request has no parameters, authentication, variables, or request body. It is ready to send as-is.",
|
|
79
96
|
"openapi.openApiReference": "OpenAPI Reference",
|
|
80
97
|
"openapi.operationParameter": "Operation parameter.",
|
|
81
98
|
"openapi.optional": "Optional.",
|
|
82
99
|
"openapi.parameter": "parameter",
|
|
100
|
+
"openapi.parameterInvalidArray": "Enter a valid JSON array.",
|
|
101
|
+
"openapi.parameterInvalidDate": "Enter a valid date.",
|
|
102
|
+
"openapi.parameterInvalidDateTime": "Enter a valid date and time.",
|
|
103
|
+
"openapi.parameterInvalidEnum": "Select one of the allowed values.",
|
|
104
|
+
"openapi.parameterInvalidInteger": "Enter a whole number.",
|
|
105
|
+
"openapi.parameterInvalidNumber": "Enter a valid number.",
|
|
106
|
+
"openapi.parameterInvalidObject": "Enter a valid JSON object.",
|
|
83
107
|
"openapi.pathParameters": "Path parameters",
|
|
84
108
|
"openapi.queryParameters": "Query parameters",
|
|
109
|
+
"openapi.preview": "Preview",
|
|
110
|
+
"openapi.raw": "Raw",
|
|
111
|
+
"openapi.resetToExample": "Reset to example",
|
|
112
|
+
"openapi.body": "Body",
|
|
113
|
+
"openapi.binaryPreview": "Binary response preview is not available.",
|
|
114
|
+
"openapi.downloadBody": "Download response body",
|
|
115
|
+
"openapi.noHeaders": "No response headers match the current search.",
|
|
116
|
+
"openapi.responseViews": "Response views",
|
|
117
|
+
"openapi.responseUrl": "Final URL",
|
|
118
|
+
"openapi.redirected": "Redirected",
|
|
119
|
+
"openapi.searchHeaders": "Search response headers",
|
|
120
|
+
"openapi.unknownContentType": "Unknown content type",
|
|
121
|
+
"openapi.variables": "Variables",
|
|
122
|
+
"openapi.requestConfiguration": "Request configuration",
|
|
123
|
+
"openapi.requestHeaders": "Request headers",
|
|
85
124
|
"openapi.request": "Request",
|
|
86
125
|
"openapi.requestBody": "Request body",
|
|
87
126
|
"openapi.requestBodyEmpty": "No request body",
|
|
127
|
+
"openapi.requestCorsHint": "The API may be unavailable from this browser because of its network or CORS policy",
|
|
88
128
|
"openapi.responseBodyProperties": "Response body properties",
|
|
129
|
+
"openapi.responseHeaders": "Response headers",
|
|
89
130
|
"openapi.required": "Required.",
|
|
90
131
|
"openapi.requiredBadge": "required",
|
|
91
132
|
"openapi.response": "Response",
|
|
133
|
+
"openapi.responseBodyEmpty": "The response body is empty.",
|
|
134
|
+
"openapi.responseBodyEmptyTitle": "No response content",
|
|
135
|
+
"openapi.responseEmpty": "Send the request to inspect the response.",
|
|
136
|
+
"openapi.responseEmptyTitle": "Ready for a request",
|
|
137
|
+
"openapi.responseErrorTitle": "Request failed",
|
|
92
138
|
"openapi.responses": "Responses",
|
|
93
139
|
"openapi.schemaExample": "Schema example",
|
|
140
|
+
"openapi.sendRequest": "Send",
|
|
141
|
+
"openapi.sendingRequest": "Sending",
|
|
142
|
+
"openapi.server": "Server",
|
|
94
143
|
"openapi.scrollExamplesLeft": "Scroll examples left",
|
|
95
144
|
"openapi.scrollExamplesRight": "Scroll examples right",
|
|
96
145
|
"openapi.specNotFound": "OpenAPI spec not found: {specPath}",
|
|
97
146
|
"openapi.specPathMissing": "spec or specPath was not provided",
|
|
98
147
|
"openapi.status": "Status",
|
|
148
|
+
"openapi.tryRequest": "Try request",
|
|
99
149
|
"openapi.version": "Version {version}",
|
|
100
150
|
"openapi.webhookResponse": "Webhook response",
|
|
101
151
|
"openapi.webhookResponses": "Webhook responses",
|
|
@@ -126,7 +176,9 @@ var builtInText = {
|
|
|
126
176
|
"zh-CN": {
|
|
127
177
|
"actions.code": "代码",
|
|
128
178
|
"actions.copy": "复制",
|
|
179
|
+
"actions.copying": "正在复制...",
|
|
129
180
|
"actions.copied": "已复制!",
|
|
181
|
+
"actions.copyFailed": "复制失败",
|
|
130
182
|
"builtWith.label": "由 Clarify 构建",
|
|
131
183
|
"builtWith.prefix": "构建来自",
|
|
132
184
|
"callout.danger": "危险",
|
|
@@ -168,37 +220,85 @@ var builtInText = {
|
|
|
168
220
|
"notFound.label": "404",
|
|
169
221
|
"notFound.title": "页面未找到",
|
|
170
222
|
"openapi.apiDocumentation": "API 文档",
|
|
223
|
+
"openapi.authentication": "认证方式",
|
|
171
224
|
"openapi.bodyProperties": "请求体属性",
|
|
172
225
|
"openapi.collapse": "收起",
|
|
226
|
+
"openapi.clear": "清除",
|
|
227
|
+
"openapi.codeSnippet": "代码示例",
|
|
173
228
|
"openapi.endpointNotFound": "未找到端点:{endpoint}",
|
|
174
229
|
"openapi.example": "示例",
|
|
175
230
|
"openapi.expand": "展开",
|
|
176
231
|
"openapi.headers": "请求头",
|
|
232
|
+
"openapi.headerName": "名称",
|
|
233
|
+
"openapi.headerValue": "值",
|
|
234
|
+
"openapi.headerParameters": "请求头参数",
|
|
235
|
+
"openapi.fieldDescription": "字段说明",
|
|
236
|
+
"openapi.includeParameter": "传递参数",
|
|
237
|
+
"openapi.cookieParameters": "Cookie 参数",
|
|
238
|
+
"openapi.cookieParametersBrowserManaged": "Cookie 由浏览器管理;当服务端允许携带凭据时,匹配的 Cookie 会随请求发送。",
|
|
239
|
+
"openapi.cookies": "Cookies",
|
|
240
|
+
"openapi.cookiesBrowserHidden": "Cookie 由浏览器管理,JavaScript 无法读取 Set-Cookie 的值。",
|
|
177
241
|
"openapi.language": "语言",
|
|
178
242
|
"openapi.client": "客户端",
|
|
243
|
+
"openapi.closeRequest": "关闭请求测试器",
|
|
244
|
+
"openapi.credential": "认证凭证",
|
|
179
245
|
"openapi.loading": "正在加载 OpenAPI 描述文件...",
|
|
180
246
|
"openapi.mediaType": "媒体类型",
|
|
181
247
|
"openapi.none": "无",
|
|
248
|
+
"openapi.noRequestConfiguration": "此请求没有参数、认证、变量或请求体,可以直接发送。",
|
|
182
249
|
"openapi.openApiReference": "OpenAPI 参考",
|
|
183
250
|
"openapi.operationParameter": "操作参数。",
|
|
184
251
|
"openapi.optional": "可选。",
|
|
185
252
|
"openapi.parameter": "参数",
|
|
253
|
+
"openapi.parameterInvalidArray": "请输入有效的 JSON 数组。",
|
|
254
|
+
"openapi.parameterInvalidDate": "请输入有效日期。",
|
|
255
|
+
"openapi.parameterInvalidDateTime": "请输入有效的日期和时间。",
|
|
256
|
+
"openapi.parameterInvalidEnum": "请选择允许的值。",
|
|
257
|
+
"openapi.parameterInvalidInteger": "请输入整数。",
|
|
258
|
+
"openapi.parameterInvalidNumber": "请输入有效数字。",
|
|
259
|
+
"openapi.parameterInvalidObject": "请输入有效的 JSON 对象。",
|
|
186
260
|
"openapi.pathParameters": "路径参数",
|
|
187
261
|
"openapi.queryParameters": "查询参数",
|
|
262
|
+
"openapi.preview": "预览",
|
|
263
|
+
"openapi.raw": "原始内容",
|
|
264
|
+
"openapi.resetToExample": "重置为示例",
|
|
265
|
+
"openapi.body": "响应体",
|
|
266
|
+
"openapi.binaryPreview": "暂不支持预览二进制响应。",
|
|
267
|
+
"openapi.downloadBody": "下载响应体",
|
|
268
|
+
"openapi.noHeaders": "没有匹配当前搜索的响应头。",
|
|
269
|
+
"openapi.responseViews": "响应视图",
|
|
270
|
+
"openapi.responseUrl": "最终 URL",
|
|
271
|
+
"openapi.redirected": "已重定向",
|
|
272
|
+
"openapi.searchHeaders": "搜索响应头",
|
|
273
|
+
"openapi.unknownContentType": "未知内容类型",
|
|
274
|
+
"openapi.variables": "变量",
|
|
275
|
+
"openapi.requestConfiguration": "请求配置",
|
|
276
|
+
"openapi.requestHeaders": "请求头",
|
|
188
277
|
"openapi.request": "请求",
|
|
189
278
|
"openapi.requestBody": "请求体",
|
|
190
279
|
"openapi.requestBodyEmpty": "暂无请求体",
|
|
280
|
+
"openapi.requestCorsHint": "受目标 API 的网络或 CORS 策略影响,浏览器可能无法直接访问",
|
|
191
281
|
"openapi.responseBodyProperties": "响应体属性",
|
|
282
|
+
"openapi.responseHeaders": "响应头",
|
|
192
283
|
"openapi.required": "必填。",
|
|
193
284
|
"openapi.requiredBadge": "必填",
|
|
194
285
|
"openapi.response": "响应",
|
|
286
|
+
"openapi.responseBodyEmpty": "响应体为空。",
|
|
287
|
+
"openapi.responseBodyEmptyTitle": "无响应内容",
|
|
288
|
+
"openapi.responseEmpty": "发送请求后在这里查看响应。",
|
|
289
|
+
"openapi.responseEmptyTitle": "等待发送请求",
|
|
290
|
+
"openapi.responseErrorTitle": "请求失败",
|
|
195
291
|
"openapi.responses": "响应",
|
|
196
292
|
"openapi.schemaExample": "Schema 示例",
|
|
293
|
+
"openapi.sendRequest": "发送",
|
|
294
|
+
"openapi.sendingRequest": "发送中",
|
|
295
|
+
"openapi.server": "服务地址",
|
|
197
296
|
"openapi.scrollExamplesLeft": "向左滚动示例",
|
|
198
297
|
"openapi.scrollExamplesRight": "向右滚动示例",
|
|
199
298
|
"openapi.specNotFound": "未找到 OpenAPI 描述文件:{specPath}",
|
|
200
299
|
"openapi.specPathMissing": "未提供 spec 或 specPath",
|
|
201
300
|
"openapi.status": "状态",
|
|
301
|
+
"openapi.tryRequest": "发起测试请求",
|
|
202
302
|
"openapi.version": "版本 {version}",
|
|
203
303
|
"openapi.webhookResponse": "Webhook 响应",
|
|
204
304
|
"openapi.webhookResponses": "Webhook 响应",
|
|
@@ -238,10 +338,10 @@ function translateBuiltInText(locale, key, replacements = {}) {
|
|
|
238
338
|
function useBuiltInText(locale) {
|
|
239
339
|
const config = useContext(ConfigContext);
|
|
240
340
|
const currentLocale = useContext(LocaleContext);
|
|
241
|
-
const resolvedLocale = locale ?? currentLocale ?? config?.
|
|
341
|
+
const resolvedLocale = locale ?? currentLocale ?? config?.locales?.default;
|
|
242
342
|
return (key, replacements) => translateBuiltInText(resolvedLocale, key, replacements);
|
|
243
343
|
}
|
|
244
344
|
//#endregion
|
|
245
345
|
export { useConfig as a, useOpenApiSpecs as c, OpenApiSpecsContext as i, ConfigContext as n, useConfigOptional as o, LocaleContext as r, useLocale as s, useBuiltInText as t };
|
|
246
346
|
|
|
247
|
-
//# sourceMappingURL=i18n-
|
|
347
|
+
//# sourceMappingURL=i18n-BPrC45nD.js.map
|