@clarify-labs/renderer 0.11.7 → 0.11.8

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 (66) hide show
  1. package/output/{ClarifyShell-CKvXZj0f.js → ClarifyShell-CGoRrkn1.js} +120 -68
  2. package/output/ClarifyShell-CGoRrkn1.js.map +1 -0
  3. package/output/{ClarifyShell-CukbPOAd.cjs → ClarifyShell-D8OGIUWq.cjs} +120 -68
  4. package/output/ClarifyShell-D8OGIUWq.cjs.map +1 -0
  5. package/output/{MermaidViewer-FOg263MO.cjs → MermaidViewer-CFqy0BnO.cjs} +3 -3
  6. package/output/{MermaidViewer-FOg263MO.cjs.map → MermaidViewer-CFqy0BnO.cjs.map} +1 -1
  7. package/output/{MermaidViewer-_tpH0JNn.js → MermaidViewer-TdU3sRfy.js} +3 -3
  8. package/output/{MermaidViewer-_tpH0JNn.js.map → MermaidViewer-TdU3sRfy.js.map} +1 -1
  9. package/output/{OpenApiOperation-c-I6Nw9j.cjs → OpenApiOperation-Bd68uxXq.cjs} +9 -8
  10. package/output/{OpenApiOperation-c-I6Nw9j.cjs.map → OpenApiOperation-Bd68uxXq.cjs.map} +1 -1
  11. package/output/{OpenApiOperation-Dv9u2GEJ.js → OpenApiOperation-vCuIKI4O.js} +9 -8
  12. package/output/{OpenApiOperation-Dv9u2GEJ.js.map → OpenApiOperation-vCuIKI4O.js.map} +1 -1
  13. package/output/{PageActions-DviEypf6.js → PageActions-CqXr0SyW.js} +112 -75
  14. package/output/PageActions-CqXr0SyW.js.map +1 -0
  15. package/output/{PageActions-ob2OJusG.cjs → PageActions-DPYXFL6N.cjs} +117 -74
  16. package/output/PageActions-DPYXFL6N.cjs.map +1 -0
  17. package/output/{SearchDialog-89JAjQMh.js → SearchDialog-BQcbGNvl.js} +29 -20
  18. package/output/SearchDialog-BQcbGNvl.js.map +1 -0
  19. package/output/{SearchDialog-CTiUIKeo.cjs → SearchDialog-CExM6Bxd.cjs} +29 -20
  20. package/output/SearchDialog-CExM6Bxd.cjs.map +1 -0
  21. package/output/app/AppShell.d.ts +1 -2
  22. package/output/app/BuiltInNotFoundPage.d.ts +1 -0
  23. package/output/app/PageActions.d.ts +0 -1
  24. package/output/client.cjs +3 -3
  25. package/output/client.js +3 -3
  26. package/output/context.d.ts +2 -1
  27. package/output/core/context.d.ts +9 -0
  28. package/output/core/types.d.ts +4 -0
  29. package/output/{i18n-Cff810G_.js → i18n-D4O3z-sP.js} +24 -3
  30. package/output/i18n-D4O3z-sP.js.map +1 -0
  31. package/output/{i18n-Cjfk1N7i.cjs → i18n-Dw4Jlho-.cjs} +36 -3
  32. package/output/i18n-Dw4Jlho-.cjs.map +1 -0
  33. package/output/index.cjs +11 -7
  34. package/output/index.cjs.map +1 -1
  35. package/output/index.d.ts +3 -2
  36. package/output/index.js +8 -8
  37. package/output/index.js.map +1 -1
  38. package/output/preview.cjs +6 -6
  39. package/output/preview.cjs.map +1 -1
  40. package/output/preview.js +6 -6
  41. package/output/preview.js.map +1 -1
  42. package/output/{render-BxiVlY6q.cjs → render-CqBz1q82.cjs} +2 -2
  43. package/output/{render-BxiVlY6q.cjs.map → render-CqBz1q82.cjs.map} +1 -1
  44. package/output/{render-B41PHjt8.js → render-DQRifjrn.js} +2 -2
  45. package/output/{render-B41PHjt8.js.map → render-DQRifjrn.js.map} +1 -1
  46. package/output/renderer.css +4 -0
  47. package/output/server.cjs +2 -2
  48. package/output/server.js +2 -2
  49. package/output/shell/ContentActions.d.ts +0 -1
  50. package/output/shell/Header.d.ts +1 -2
  51. package/output/shell/Search.d.ts +3 -6
  52. package/output/shell/mobile.d.ts +1 -2
  53. package/output/shell/search/SearchDialog.d.ts +2 -1
  54. package/output/shell/search/pagefind.d.ts +3 -2
  55. package/output/theme/ThemeRoot.d.ts +0 -2
  56. package/output/theme/randomTheme.d.ts +2 -1
  57. package/output/utils/href.d.ts +2 -0
  58. package/package.json +1 -1
  59. package/output/ClarifyShell-CKvXZj0f.js.map +0 -1
  60. package/output/ClarifyShell-CukbPOAd.cjs.map +0 -1
  61. package/output/PageActions-DviEypf6.js.map +0 -1
  62. package/output/PageActions-ob2OJusG.cjs.map +0 -1
  63. package/output/SearchDialog-89JAjQMh.js.map +0 -1
  64. package/output/SearchDialog-CTiUIKeo.cjs.map +0 -1
  65. package/output/i18n-Cff810G_.js.map +0 -1
  66. package/output/i18n-Cjfk1N7i.cjs.map +0 -1
@@ -1,13 +1,13 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
2
- const require_i18n = require("./i18n-Cjfk1N7i.cjs");
3
- const require_PageActions = require("./PageActions-ob2OJusG.cjs");
2
+ const require_i18n = require("./i18n-Dw4Jlho-.cjs");
3
+ require("./PageActions-DPYXFL6N.cjs");
4
4
  let clsx = require("clsx");
5
5
  clsx = require_rolldown_runtime.__toESM(clsx, 1);
6
6
  let react = require("react");
7
7
  let react_router_dom = require("react-router-dom");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
8
9
  let _headlessui_react = require("@headlessui/react");
9
10
  let lucide_react = require("lucide-react");
10
- let react_jsx_runtime = require("react/jsx-runtime");
11
11
  //#region source/shell/search/items.ts
12
12
  function routeGroupTitles(navigation) {
13
13
  const titles = /* @__PURE__ */ new Map();
@@ -49,30 +49,38 @@ function buildSearchItems(routes, navigation) {
49
49
  //#endregion
50
50
  //#region source/shell/search/pagefind.ts
51
51
  var pagefindPromises = /* @__PURE__ */ new Map();
52
- function pagefindCacheKey(routePrefix, locale) {
53
- return `${routePrefix || "/"}:${locale || "default"}`;
52
+ function pagefindCacheKey(assetPrefix, locale) {
53
+ return `${assetPrefix || "/"}:${locale || "default"}`;
54
54
  }
55
- function loadPagefind(routePrefix, locale) {
55
+ function resolvePagefindUrl(assetPrefix) {
56
+ const prefix = assetPrefix || "/";
57
+ return `${prefix.endsWith("/") ? prefix : `${prefix}/`}pagefind/pagefind.js`;
58
+ }
59
+ function loadPagefind(assetPrefix, locale) {
56
60
  if (typeof window === "undefined") return Promise.resolve(null);
57
- const language = locale ?? document.documentElement.lang;
58
- const cacheKey = pagefindCacheKey(routePrefix, language);
61
+ const cacheKey = pagefindCacheKey(assetPrefix, locale);
59
62
  const cachedPagefind = pagefindPromises.get(cacheKey);
60
63
  if (cachedPagefind) return cachedPagefind;
61
64
  const pagefindPromise = import(
62
65
  /* @vite-ignore */
63
- require_PageActions.prefixHref("/pagefind/pagefind.js", routePrefix)
66
+ resolvePagefindUrl(assetPrefix)
64
67
  ).then(async (module) => {
65
68
  const previousLanguage = document.documentElement.lang;
66
- if (language) document.documentElement.lang = language;
69
+ if (locale) document.documentElement.lang = locale;
67
70
  const pagefind = module.createInstance();
68
- if (previousLanguage && previousLanguage !== language) document.documentElement.lang = previousLanguage;
69
- await pagefind.init?.();
71
+ if (previousLanguage !== locale) document.documentElement.lang = previousLanguage;
72
+ try {
73
+ await pagefind.init?.();
74
+ } catch (error) {
75
+ if (error instanceof Error && error.message.includes("No language indexes found")) return null;
76
+ throw error;
77
+ }
70
78
  return pagefind;
71
79
  }).catch((error) => {
72
80
  pagefindPromises.delete(cacheKey);
73
81
  console.warn("[clarify:search] Pagefind instance failed", {
74
82
  cacheKey,
75
- language,
83
+ locale,
76
84
  error
77
85
  });
78
86
  return null;
@@ -230,7 +238,7 @@ function useSearchDialogLifecycle(arg0) {
230
238
  }, [open, setOpen]);
231
239
  }
232
240
  function useSearchData(arg0) {
233
- const { query, searchItems, routePrefix, currentLocale } = arg0;
241
+ const { query, searchItems, routePrefix, assetPrefix, currentLocale } = arg0;
234
242
  const [fullTextState, setFullTextState] = (0, react.useState)(null);
235
243
  const [pagefindState, setPagefindState] = (0, react.useState)(null);
236
244
  const quickResults = (0, react.useMemo)(() => {
@@ -241,7 +249,7 @@ function useSearchData(arg0) {
241
249
  type: "quick"
242
250
  }));
243
251
  }, [query, searchItems]);
244
- const pagefindKey = pagefindCacheKey(routePrefix, currentLocale);
252
+ const pagefindKey = pagefindCacheKey(assetPrefix, currentLocale);
245
253
  const activePagefindState = pagefindState?.key === pagefindKey ? pagefindState : null;
246
254
  const pagefind = activePagefindState?.pagefind ?? null;
247
255
  const pagefindAvailable = activePagefindState?.available ?? null;
@@ -252,7 +260,7 @@ function useSearchData(arg0) {
252
260
  const showNoResults = Boolean(query.trim()) && results.length === 0 && pagefindAvailable !== null;
253
261
  (0, react.useEffect)(() => {
254
262
  let cancelled = false;
255
- loadPagefind(routePrefix, currentLocale).then((loadedPagefind) => {
263
+ loadPagefind(assetPrefix, currentLocale).then((loadedPagefind) => {
256
264
  if (cancelled) return;
257
265
  setPagefindState({
258
266
  key: pagefindKey,
@@ -264,9 +272,9 @@ function useSearchData(arg0) {
264
272
  cancelled = true;
265
273
  };
266
274
  }, [
275
+ assetPrefix,
267
276
  currentLocale,
268
- pagefindKey,
269
- routePrefix
277
+ pagefindKey
270
278
  ]);
271
279
  (0, react.useEffect)(() => {
272
280
  let cancelled = false;
@@ -319,7 +327,7 @@ function useSearchData(arg0) {
319
327
  };
320
328
  }
321
329
  function SearchDialog(arg0) {
322
- const { open, setOpen, routes, navigation, routePrefix = "/", currentLocale, className, onNavigate = () => {} } = arg0;
330
+ const { open, setOpen, routes, navigation, routePrefix, assetPrefix, currentLocale, className, onNavigate = () => {} } = arg0;
323
331
  const t = require_i18n.useBuiltInText();
324
332
  const navigate = (0, react_router_dom.useNavigate)();
325
333
  const inputRef = (0, react.useRef)(null);
@@ -334,6 +342,7 @@ function SearchDialog(arg0) {
334
342
  query,
335
343
  searchItems,
336
344
  routePrefix,
345
+ assetPrefix,
337
346
  currentLocale
338
347
  });
339
348
  const updateQuery = (value) => {
@@ -411,4 +420,4 @@ function SearchDialog(arg0) {
411
420
  exports.SearchDialog = SearchDialog;
412
421
  exports.default = SearchDialog;
413
422
 
414
- //# sourceMappingURL=SearchDialog-CTiUIKeo.cjs.map
423
+ //# sourceMappingURL=SearchDialog-CExM6Bxd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchDialog-CExM6Bxd.cjs","names":[],"sources":["../source/shell/search/items.ts","../source/shell/search/pagefind.ts","../source/shell/search/SearchInput.tsx","../source/shell/search/Highlight.tsx","../source/shell/search/SearchResult.tsx","../source/shell/search/SearchDialog.tsx"],"sourcesContent":["import type { NavigationNode, RouteItem } from '../../types'\n\nimport type { SearchItem } from './types'\n\nfunction routeGroupTitles(navigation: NavigationNode[]) {\n const titles = new Map<string, string>()\n\n for (const node of navigation) {\n if (node.children?.length) {\n for (const child of node.children) {\n titles.set(child.path, node.title)\n }\n } else {\n titles.set(node.path, node.title)\n }\n }\n\n return titles\n}\n\nexport function buildSearchItems(routes: RouteItem[], navigation: NavigationNode[]): SearchItem[] {\n const groupTitles = routeGroupTitles(navigation)\n\n return routes.flatMap((route) => {\n // Skip bare alias routes (e.g., /path) from search to avoid duplicates in multilingual sites\n if (route.isBareAlias) return []\n \n const groupTitle = groupTitles.get(route.path)\n const pageItem: SearchItem = {\n title: route.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: route.path,\n keywords: [groupTitle, route.title, route.path, route.kind].filter(Boolean).join(' ').toLowerCase(),\n }\n\n const sectionItems = route.sections?.map((section) => ({\n title: section.title,\n pageTitle: route.title,\n sectionTitle: groupTitle,\n url: `${route.path}#${section.id}`,\n keywords: [groupTitle, route.title, section.title, route.path, section.id].filter(Boolean).join(' ').toLowerCase(),\n })) ?? []\n\n return [pageItem, ...sectionItems]\n })\n}\n","import 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-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 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-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,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outeItem, NavigationTree } from '../types';
3
3
  export type AppShellProps = {
4
- config: Config;
5
4
  routes: RouteItem[];
6
5
  navigation: NavigationTree;
7
6
  runtimeSlots?: RuntimeSlotRegistry;
@@ -0,0 +1 @@
1
+ export declare function BuiltInNotFoundPage(): import("react").JSX.Element;
@@ -2,7 +2,6 @@ import { ReactNode } from 'react';
2
2
  import { RouteItem } from '../types';
3
3
  type PageActionsContextValue = {
4
4
  route?: RouteItem;
5
- routePrefix?: string;
6
5
  };
7
6
  type PageActionsProviderProps = PageActionsContextValue & {
8
7
  children: ReactNode;
package/output/client.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ClarifyShell = require("./ClarifyShell-CukbPOAd.cjs");
3
- const require_PageActions = require("./PageActions-ob2OJusG.cjs");
4
- const require_render = require("./render-BxiVlY6q.cjs");
2
+ const require_ClarifyShell = require("./ClarifyShell-D8OGIUWq.cjs");
3
+ const require_PageActions = require("./PageActions-DPYXFL6N.cjs");
4
+ const require_render = require("./render-CqBz1q82.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-CKvXZj0f.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-DviEypf6.js";
3
- import { t as render } from "./render-B41PHjt8.js";
1
+ import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ClarifyShell-CGoRrkn1.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-CqXr0SyW.js";
3
+ import { t as render } from "./render-DQRifjrn.js";
4
4
  export { ThemeEditor, applyThemeVariables, getStoredLocalePreference, getStoredThemePreference, localeCookieName, readLocaleCookie, render, storeLocalePreference, storeThemePreference, themeBootstrapScript, themeCookieName, themeEditorPresets, themeStorageKey };
@@ -1 +1,2 @@
1
- export { LocaleContext, OpenApiSpecsContext, useLocale, useOpenApiSpecs } from './core/context';
1
+ export { ConfigContext, ConfigProvider, LocaleContext, OpenApiSpecsContext, useConfig, useConfigOptional, useConfigUpdater, useConfigUpdaterOptional, useLocale, useOpenApiSpecs } from './core/context';
2
+ export type { ConfigProviderProps, ConfigUpdater } from './core/context';
@@ -1,8 +1,17 @@
1
+ import { ReactNode } from 'react';
1
2
  import { Config, OpenApiRegistry } from './types';
2
3
  export declare const ConfigContext: import('react').Context<Config | null>;
4
+ export type ConfigUpdater = (update: Config | ((config: Config) => Config)) => void;
3
5
  export declare const LocaleContext: import('react').Context<string | undefined>;
4
6
  export declare const OpenApiSpecsContext: import('react').Context<OpenApiRegistry>;
7
+ export type ConfigProviderProps = {
8
+ config: Config;
9
+ children: ReactNode;
10
+ };
11
+ export declare function ConfigProvider(props: ConfigProviderProps): import("react").JSX.Element;
5
12
  export declare function useConfig(): Config;
6
13
  export declare function useConfigOptional(): Config | null;
14
+ export declare function useConfigUpdater(): ConfigUpdater;
15
+ export declare function useConfigUpdaterOptional(): ConfigUpdater | null;
7
16
  export declare function useLocale(): string | undefined;
8
17
  export declare function useOpenApiSpecs(): OpenApiRegistry;
@@ -112,6 +112,9 @@ export type ThemeConfig = {
112
112
  tokens: ThemeTokensConfig;
113
113
  layout: ThemeLayoutConfig;
114
114
  };
115
+ export type LayoutConfig = {
116
+ tabs: 'subnav' | 'navbar';
117
+ };
115
118
  export type PagesItem = string | {
116
119
  page: string;
117
120
  title?: LocalizedText;
@@ -170,6 +173,7 @@ export type Config = {
170
173
  homeUrl?: string;
171
174
  favicon?: FaviconConfig;
172
175
  theme: ThemeConfig;
176
+ layout?: LayoutConfig;
173
177
  navigation?: NavigationConfig;
174
178
  banner?: BannerConfig;
175
179
  footer?: FooterConfig;
@@ -1,8 +1,21 @@
1
- import { createContext, useContext } from "react";
1
+ import { createContext, useContext, useState } from "react";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  //#region source/core/context.tsx
3
4
  var ConfigContext = createContext(null);
5
+ var ConfigUpdaterContext = createContext(null);
4
6
  var LocaleContext = createContext(void 0);
5
7
  var OpenApiSpecsContext = createContext({});
8
+ function ConfigProvider(props) {
9
+ const { config: initialConfig, children } = props;
10
+ const [config, setConfig] = useState(initialConfig);
11
+ return /* @__PURE__ */ jsx(ConfigContext.Provider, {
12
+ value: config,
13
+ children: /* @__PURE__ */ jsx(ConfigUpdaterContext.Provider, {
14
+ value: setConfig,
15
+ children
16
+ })
17
+ });
18
+ }
6
19
  function useConfig() {
7
20
  const config = useContext(ConfigContext);
8
21
  if (!config) throw new Error("[clarify] useConfig must be used within a ConfigContext.Provider");
@@ -11,6 +24,14 @@ function useConfig() {
11
24
  function useConfigOptional() {
12
25
  return useContext(ConfigContext);
13
26
  }
27
+ function useConfigUpdater() {
28
+ const updater = useContext(ConfigUpdaterContext);
29
+ if (!updater) throw new Error("[clarify] useConfigUpdater must be used within a ConfigProvider");
30
+ return updater;
31
+ }
32
+ function useConfigUpdaterOptional() {
33
+ return useContext(ConfigUpdaterContext);
34
+ }
14
35
  function useLocale() {
15
36
  return useContext(LocaleContext);
16
37
  }
@@ -380,6 +401,6 @@ function useBuiltInText(locale) {
380
401
  return (key, replacements) => translateBuiltInText(resolvedLocale, key, replacements);
381
402
  }
382
403
  //#endregion
383
- 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 };
404
+ export { useConfig as a, useConfigUpdaterOptional as c, OpenApiSpecsContext as i, useLocale as l, ConfigProvider as n, useConfigOptional as o, LocaleContext as r, useConfigUpdater as s, useBuiltInText as t, useOpenApiSpecs as u };
384
405
 
385
- //# sourceMappingURL=i18n-Cff810G_.js.map
406
+ //# sourceMappingURL=i18n-D4O3z-sP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-D4O3z-sP.js","names":[],"sources":["../source/core/context.tsx","../source/core/locales/en.json","../source/core/locales/zh-CN.json","../source/core/i18n.ts"],"sourcesContent":["import { createContext, useContext, useState } from 'react'\nimport type { ReactNode } from 'react'\n\nimport type { Config, OpenApiRegistry } from './types'\n\nexport const ConfigContext = createContext<Config | null>(null)\nexport type ConfigUpdater = (update: Config | ((config: Config) => Config)) => void\nconst ConfigUpdaterContext = createContext<ConfigUpdater | null>(null)\nexport const LocaleContext = createContext<string | undefined>(undefined)\nexport const OpenApiSpecsContext = createContext<OpenApiRegistry>({})\n\nexport type ConfigProviderProps = {\n config: Config\n children: ReactNode\n}\n\nexport function ConfigProvider(props: ConfigProviderProps) {\n const { config: initialConfig, children } = props\n const [config, setConfig] = useState(initialConfig)\n\n return (\n <ConfigContext.Provider value={config}>\n <ConfigUpdaterContext.Provider value={setConfig}>\n {children}\n </ConfigUpdaterContext.Provider>\n </ConfigContext.Provider>\n )\n}\n\nexport function useConfig(): Config {\n const config = useContext(ConfigContext)\n if (!config) {\n throw new Error(\n '[clarify] useConfig must be used within a ConfigContext.Provider'\n )\n }\n return config\n}\n\nexport function useConfigOptional(): Config | null {\n return useContext(ConfigContext)\n}\n\nexport function useConfigUpdater(): ConfigUpdater {\n const updater = useContext(ConfigUpdaterContext)\n if (!updater) {\n throw new Error('[clarify] useConfigUpdater must be used within a ConfigProvider')\n }\n return updater\n}\n\nexport function useConfigUpdaterOptional(): ConfigUpdater | null {\n return useContext(ConfigUpdaterContext)\n}\n\nexport function useLocale(): string | undefined {\n return useContext(LocaleContext)\n}\n\nexport function useOpenApiSpecs(): OpenApiRegistry {\n return useContext(OpenApiSpecsContext)\n}\n","{\n \"actions.code\": \"Code\",\n \"actions.copy\": \"Copy\",\n \"actions.copying\": \"Copying...\",\n \"actions.copied\": \"Copied!\",\n \"actions.copyFailed\": \"Copy failed\",\n \"builtWith.label\": \"Built with Clarify\",\n \"builtWith.prefix\": \"Built with\",\n \"callout.danger\": \"Danger\",\n \"callout.info\": \"Info\",\n \"callout.note\": \"Note\",\n \"callout.success\": \"Success\",\n \"callout.tip\": \"Tip\",\n \"callout.warning\": \"Warning\",\n \"contentActions.copyContent\": \"Copy page\",\n \"contentActions.copyContentDescription\": \"Copy this page as {contentType} for LLMs\",\n \"contentActions.copyLink\": \"Copy {contentType} link\",\n \"contentActions.copyLinkDescription\": \"Copy the raw {contentType} content link for this page\",\n \"contentActions.copyLlms\": \"Copy llms.txt\",\n \"contentActions.copyLlmsDescription\": \"Copy the llms.txt link for this site\",\n \"contentActions.copiedLlms\": \"Copied llms.txt\",\n \"contentActions.copiedMcpConfig\": \"Copied MCP config\",\n \"contentActions.mcpConfig\": \"Copy MCP config\",\n \"contentActions.mcpConfigDescription\": \"Copy this site's MCP server configuration\",\n \"contentActions.editPage\": \"Edit this page\",\n \"contentActions.editPageDescription\": \"Open the source file for this page\",\n \"contentActions.copyOptions\": \"Choose copy option\",\n \"contentActions.copiedContent\": \"Copied page\",\n \"contentActions.copiedLink\": \"Copied link\",\n \"contentActions.viewMarkdown\": \"View as Markdown\",\n \"contentActions.viewMarkdownDescription\": \"View this page as plain text\",\n \"contentActions.viewOpenApi\": \"View raw OpenAPI\",\n \"contentActions.viewOpenApiDescription\": \"Open the API description file in a new tab\",\n \"feedback.no\": \"No\",\n \"feedback.prompt\": \"Was this page helpful?\",\n \"feedback.thanks\": \"Thanks for your feedback!\",\n \"feedback.yes\": \"Yes\",\n \"navigation.documentation\": \"Documentation\",\n \"navigation.next\": \"Next\",\n \"navigation.previous\": \"Previous\",\n \"navigation.previousNext\": \"Previous and next pages\",\n \"navigation.toggle\": \"Toggle navigation\",\n \"navbar.home\": \"Home\",\n \"navbar.openLinks\": \"Open navigation links\",\n \"navbar.sections\": \"Documentation sections\",\n \"notFound.description\": \"The page may have moved, been renamed, or never existed. Check the address or return to the homepage.\",\n \"notFound.home\": \"Back to homepage\",\n \"notFound.label\": \"404\",\n \"notFound.title\": \"Page not found\",\n \"openapi.apiDocumentation\": \"API Documentation\",\n \"openapi.authentication\": \"Authentication\",\n \"openapi.authAnd\": \"AND\",\n \"openapi.authApiKey\": \"API key\",\n \"openapi.authBearerFormat\": \"Bearer format: {format}\",\n \"openapi.authLocation\": \"{in} parameter: {name}\",\n \"openapi.authNoAuth\": \"No authentication required\",\n \"openapi.authOr\": \"OR\",\n \"openapi.authScopes\": \"Scopes: {scopes}\",\n \"openapi.bodyProperties\": \"Body properties\",\n \"openapi.collapse\": \"Collapse\",\n \"openapi.clear\": \"Clear\",\n \"openapi.codeSnippet\": \"Code snippet\",\n \"openapi.endpointNotFound\": \"Operation not found or operationId is not unique: {endpoint}\",\n \"openapi.example\": \"Example\",\n \"openapi.expand\": \"Expand\",\n \"openapi.headers\": \"Headers\",\n \"openapi.headerName\": \"Name\",\n \"openapi.headerValue\": \"Value\",\n \"openapi.headerParameters\": \"Header parameters\",\n \"openapi.fieldDescription\": \"Field description\",\n \"openapi.includeParameter\": \"Include parameter\",\n \"openapi.cookieParameters\": \"Cookie parameters\",\n \"openapi.cookieParametersBrowserManaged\": \"Cookies are managed by the browser. Matching cookies are sent when the server allows credentialed requests.\",\n \"openapi.cookies\": \"Cookies\",\n \"openapi.cookiesBrowserHidden\": \"Cookies are managed by the browser. Set-Cookie values are not exposed to JavaScript.\",\n \"openapi.language\": \"Language\",\n \"openapi.client\": \"Client\",\n \"openapi.closeRequest\": \"Close request tester\",\n \"openapi.credential\": \"Credential\",\n \"openapi.loading\": \"Loading OpenAPI spec...\",\n \"openapi.mediaType\": \"Media type\",\n \"openapi.none\": \"None\",\n \"openapi.noRequestConfiguration\": \"This request has no parameters, authentication, variables, or request body. It is ready to send as-is.\",\n \"openapi.openApiReference\": \"OpenAPI Reference\",\n \"openapi.operationParameter\": \"Operation parameter.\",\n \"openapi.optional\": \"Optional.\",\n \"openapi.parameter\": \"parameter\",\n \"openapi.parameterInvalidArray\": \"Enter a valid JSON array.\",\n \"openapi.parameterInvalidDate\": \"Enter a valid date.\",\n \"openapi.parameterInvalidDateTime\": \"Enter a valid date and time.\",\n \"openapi.parameterInvalidEnum\": \"Select one of the allowed values.\",\n \"openapi.parameterInvalidInteger\": \"Enter a whole number.\",\n \"openapi.parameterInvalidNumber\": \"Enter a valid number.\",\n \"openapi.parameterInvalidObject\": \"Enter a valid JSON object.\",\n \"openapi.pathParameters\": \"Path parameters\",\n \"openapi.queryParameters\": \"Query parameters\",\n \"openapi.preview\": \"Preview\",\n \"openapi.raw\": \"Raw\",\n \"openapi.resetToExample\": \"Reset to example\",\n \"openapi.body\": \"Body\",\n \"openapi.binaryPreview\": \"Binary response preview is not available.\",\n \"openapi.downloadBody\": \"Download response body\",\n \"openapi.noHeaders\": \"No response headers match the current search.\",\n \"openapi.responseViews\": \"Response views\",\n \"openapi.responseUrl\": \"Final URL\",\n \"openapi.redirected\": \"Redirected\",\n \"openapi.searchHeaders\": \"Search response headers\",\n \"openapi.searchBodyProperties\": \"Search request body properties\",\n \"openapi.searchResponseBodyProperties\": \"Search response body properties\",\n \"openapi.noBodyProperties\": \"No request body properties match the current search.\",\n \"openapi.noResponseBodyProperties\": \"No response body properties match the current search.\",\n \"openapi.unknownContentType\": \"Unknown content type\",\n \"openapi.variables\": \"Variables\",\n \"openapi.requestConfiguration\": \"Request configuration\",\n \"openapi.requestExample\": \"Request example\",\n \"openapi.requestHeaders\": \"Request headers\",\n \"openapi.request\": \"Request\",\n \"openapi.requestBody\": \"Request body\",\n \"openapi.requestBodyEmpty\": \"No request body\",\n \"openapi.requestCorsHint\": \"The API may be unavailable from this browser because of its network or CORS policy\",\n \"openapi.responseBodyProperties\": \"Response body properties\",\n \"openapi.responseHeaders\": \"Response headers\",\n \"openapi.required\": \"Required.\",\n \"openapi.requiredBadge\": \"required\",\n \"openapi.response\": \"Response\",\n \"openapi.responseBodyEmpty\": \"The response body is empty.\",\n \"openapi.responseBodyEmptyTitle\": \"No response content\",\n \"openapi.responseEmpty\": \"Send the request to inspect the response.\",\n \"openapi.responseEmptyTitle\": \"Ready for a request\",\n \"openapi.responseErrorTitle\": \"Request failed\",\n \"openapi.responses\": \"Responses\",\n \"openapi.schemaExample\": \"Schema example\",\n \"openapi.sendRequest\": \"Send\",\n \"openapi.sendingRequest\": \"Sending\",\n \"openapi.server\": \"Server\",\n \"openapi.scrollExamplesLeft\": \"Scroll examples left\",\n \"openapi.scrollExamplesRight\": \"Scroll examples right\",\n \"openapi.specNotFound\": \"OpenAPI spec not found: {specPath}\",\n \"openapi.specPathMissing\": \"spec or specPath was not provided\",\n \"openapi.status\": \"Status\",\n \"openapi.tryRequest\": \"Try request\",\n \"openapi.version\": \"Version {version}\",\n \"openapi.webhookResponse\": \"Webhook response\",\n \"openapi.webhookResponses\": \"Webhook responses\",\n \"search.button\": \"Search...\",\n \"search.noResults\": \"Nothing found for {query}.\",\n \"search.placeholder\": \"Find something...\",\n \"search.shortcutCtrl\": \"Ctrl \",\n \"renderError.componentStack\": \"React component stack\",\n \"renderError.description\": \"Clarify stopped rendering this route to keep the rest of the shell responsive. Review the diagnostics below, fix the page source, then reload the route.\",\n \"renderError.details\": \"Runtime diagnostics\",\n \"renderError.message\": \"Message\",\n \"renderError.path\": \"Route\",\n \"renderError.reload\": \"Reload route\",\n \"renderError.stack\": \"JavaScript stack trace\",\n \"renderError.title\": \"Route render failed\",\n \"renderError.type\": \"Error type\",\n \"renderError.version\": \"Clarify version\",\n \"theme.dark\": \"Dark\",\n \"theme.light\": \"Light\",\n \"theme.switch\": \"Switch theme\",\n \"theme.switchToDark\": \"Switch to dark theme\",\n \"theme.switchToLight\": \"Switch to light theme\",\n \"theme.switchToSystem\": \"Follow system theme\",\n \"theme.system\": \"System\",\n \"language.switch\": \"Switch language\",\n \"mermaid.zoomIn\": \"Zoom in\",\n \"mermaid.zoomOut\": \"Zoom out\",\n \"mermaid.resetZoom\": \"Reset zoom\",\n \"mermaid.renderError\": \"Mermaid render error\",\n \"mermaid.scrollHint\": \"Click the diagram to enable scroll-to-zoom\"\n}\n","{\n \"actions.code\": \"代码\",\n \"actions.copy\": \"复制\",\n \"actions.copying\": \"正在复制...\",\n \"actions.copied\": \"已复制!\",\n \"actions.copyFailed\": \"复制失败\",\n \"builtWith.label\": \"由 Clarify 构建\",\n \"builtWith.prefix\": \"构建来自\",\n \"callout.danger\": \"危险\",\n \"callout.info\": \"信息\",\n \"callout.note\": \"注意\",\n \"callout.success\": \"成功\",\n \"callout.tip\": \"提示\",\n \"callout.warning\": \"警告\",\n \"contentActions.copyContent\": \"复制页面\",\n \"contentActions.copyContentDescription\": \"将页面以 {contentType} 格式复制给 LLMs\",\n \"contentActions.copyLink\": \"复制 {contentType} 链接\",\n \"contentActions.copyLinkDescription\": \"复制当前页面的 {contentType} 原始内容链接\",\n \"contentActions.copyLlms\": \"复制 llms.txt\",\n \"contentActions.copyLlmsDescription\": \"复制此站点的 llms.txt 链接\",\n \"contentActions.copiedLlms\": \"已复制 llms.txt\",\n \"contentActions.copiedMcpConfig\": \"已复制 MCP 配置\",\n \"contentActions.mcpConfig\": \"复制 MCP 配置\",\n \"contentActions.mcpConfigDescription\": \"复制站点的 MCP server 配置\",\n \"contentActions.editPage\": \"编辑此页面\",\n \"contentActions.editPageDescription\": \"打开当前页面的源文件\",\n \"contentActions.copyOptions\": \"选择复制选项\",\n \"contentActions.copiedContent\": \"已复制页面\",\n \"contentActions.copiedLink\": \"已复制链接\",\n \"contentActions.viewMarkdown\": \"以 Markdown 格式查看\",\n \"contentActions.viewMarkdownDescription\": \"以纯文本查看此页面\",\n \"contentActions.viewOpenApi\": \"查看 OpenAPI 原始内容\",\n \"contentActions.viewOpenApiDescription\": \"在新标签页打开 API 描述文件\",\n \"feedback.no\": \"否\",\n \"feedback.prompt\": \"这个页面有帮助吗?\",\n \"feedback.thanks\": \"感谢你的反馈!\",\n \"feedback.yes\": \"是\",\n \"navigation.documentation\": \"文档\",\n \"navigation.next\": \"下一页\",\n \"navigation.previous\": \"上一页\",\n \"navigation.previousNext\": \"上一页和下一页\",\n \"navigation.toggle\": \"切换导航\",\n \"navbar.home\": \"首页\",\n \"navbar.openLinks\": \"打开导航链接\",\n \"navbar.sections\": \"文档栏目\",\n \"notFound.description\": \"页面可能已移动、重命名或不存在。请检查地址,或返回首页继续浏览。\",\n \"notFound.home\": \"返回首页\",\n \"notFound.label\": \"404\",\n \"notFound.title\": \"页面未找到\",\n \"openapi.apiDocumentation\": \"API 文档\",\n \"openapi.authentication\": \"认证方式\",\n \"openapi.authAnd\": \"并且\",\n \"openapi.authApiKey\": \"API 密钥\",\n \"openapi.authBearerFormat\": \"Bearer 格式:{format}\",\n \"openapi.authLocation\": \"{in} 参数:{name}\",\n \"openapi.authNoAuth\": \"无需认证\",\n \"openapi.authOr\": \"或者\",\n \"openapi.authScopes\": \"Scopes:{scopes}\",\n \"openapi.bodyProperties\": \"请求体属性\",\n \"openapi.collapse\": \"收起\",\n \"openapi.clear\": \"清除\",\n \"openapi.codeSnippet\": \"代码示例\",\n \"openapi.endpointNotFound\": \"未找到 operation,或 operationId 不唯一:{endpoint}\",\n \"openapi.example\": \"示例\",\n \"openapi.expand\": \"展开\",\n \"openapi.headers\": \"请求头\",\n \"openapi.headerName\": \"名称\",\n \"openapi.headerValue\": \"值\",\n \"openapi.headerParameters\": \"请求头参数\",\n \"openapi.fieldDescription\": \"字段说明\",\n \"openapi.includeParameter\": \"传递参数\",\n \"openapi.cookieParameters\": \"Cookie 参数\",\n \"openapi.cookieParametersBrowserManaged\": \"Cookie 由浏览器管理;当服务端允许携带凭据时,匹配的 Cookie 会随请求发送。\",\n \"openapi.cookies\": \"Cookies\",\n \"openapi.cookiesBrowserHidden\": \"Cookie 由浏览器管理,JavaScript 无法读取 Set-Cookie 的值。\",\n \"openapi.language\": \"语言\",\n \"openapi.client\": \"客户端\",\n \"openapi.closeRequest\": \"关闭请求测试器\",\n \"openapi.credential\": \"认证凭证\",\n \"openapi.loading\": \"正在加载 OpenAPI 描述文件...\",\n \"openapi.mediaType\": \"媒体类型\",\n \"openapi.none\": \"无\",\n \"openapi.noRequestConfiguration\": \"此请求没有参数、认证、变量或请求体,可以直接发送。\",\n \"openapi.openApiReference\": \"OpenAPI 参考\",\n \"openapi.operationParameter\": \"操作参数。\",\n \"openapi.optional\": \"可选。\",\n \"openapi.parameter\": \"参数\",\n \"openapi.parameterInvalidArray\": \"请输入有效的 JSON 数组。\",\n \"openapi.parameterInvalidDate\": \"请输入有效日期。\",\n \"openapi.parameterInvalidDateTime\": \"请输入有效的日期和时间。\",\n \"openapi.parameterInvalidEnum\": \"请选择允许的值。\",\n \"openapi.parameterInvalidInteger\": \"请输入整数。\",\n \"openapi.parameterInvalidNumber\": \"请输入有效数字。\",\n \"openapi.parameterInvalidObject\": \"请输入有效的 JSON 对象。\",\n \"openapi.pathParameters\": \"路径参数\",\n \"openapi.queryParameters\": \"查询参数\",\n \"openapi.preview\": \"预览\",\n \"openapi.raw\": \"原始内容\",\n \"openapi.resetToExample\": \"重置为示例\",\n \"openapi.body\": \"响应体\",\n \"openapi.binaryPreview\": \"暂不支持预览二进制响应。\",\n \"openapi.downloadBody\": \"下载响应体\",\n \"openapi.noHeaders\": \"没有匹配当前搜索的响应头。\",\n \"openapi.responseViews\": \"响应视图\",\n \"openapi.responseUrl\": \"最终 URL\",\n \"openapi.redirected\": \"已重定向\",\n \"openapi.searchHeaders\": \"搜索响应头\",\n \"openapi.searchBodyProperties\": \"搜索请求体属性\",\n \"openapi.searchResponseBodyProperties\": \"搜索响应体属性\",\n \"openapi.noBodyProperties\": \"没有匹配当前搜索的请求体属性。\",\n \"openapi.noResponseBodyProperties\": \"没有匹配当前搜索的响应体属性。\",\n \"openapi.unknownContentType\": \"未知内容类型\",\n \"openapi.variables\": \"变量\",\n \"openapi.requestConfiguration\": \"请求配置\",\n \"openapi.requestExample\": \"请求示例\",\n \"openapi.requestHeaders\": \"请求头\",\n \"openapi.request\": \"请求\",\n \"openapi.requestBody\": \"请求体\",\n \"openapi.requestBodyEmpty\": \"暂无请求体\",\n \"openapi.requestCorsHint\": \"受目标 API 的网络或 CORS 策略影响,浏览器可能无法直接访问\",\n \"openapi.responseBodyProperties\": \"响应体属性\",\n \"openapi.responseHeaders\": \"响应头\",\n \"openapi.required\": \"必填。\",\n \"openapi.requiredBadge\": \"必填\",\n \"openapi.response\": \"响应\",\n \"openapi.responseBodyEmpty\": \"响应体为空。\",\n \"openapi.responseBodyEmptyTitle\": \"无响应内容\",\n \"openapi.responseEmpty\": \"发送请求后在这里查看响应。\",\n \"openapi.responseEmptyTitle\": \"等待发送请求\",\n \"openapi.responseErrorTitle\": \"请求失败\",\n \"openapi.responses\": \"响应\",\n \"openapi.schemaExample\": \"Schema 示例\",\n \"openapi.sendRequest\": \"发送\",\n \"openapi.sendingRequest\": \"发送中\",\n \"openapi.server\": \"服务地址\",\n \"openapi.scrollExamplesLeft\": \"向左滚动示例\",\n \"openapi.scrollExamplesRight\": \"向右滚动示例\",\n \"openapi.specNotFound\": \"未找到 OpenAPI 描述文件:{specPath}\",\n \"openapi.specPathMissing\": \"未提供 spec 或 specPath\",\n \"openapi.status\": \"状态\",\n \"openapi.tryRequest\": \"发起测试请求\",\n \"openapi.version\": \"版本 {version}\",\n \"openapi.webhookResponse\": \"Webhook 响应\",\n \"openapi.webhookResponses\": \"Webhook 响应\",\n \"search.button\": \"搜索...\",\n \"search.noResults\": \"没有找到与 {query} 相关的结果。\",\n \"search.placeholder\": \"搜索内容...\",\n \"search.shortcutCtrl\": \"Ctrl \",\n \"renderError.componentStack\": \"React 组件栈\",\n \"renderError.description\": \"Clarify 已停止渲染此路由,以保证文档 Shell 仍可响应。请查看下方诊断信息,修复页面源码后重新加载路由。\",\n \"renderError.details\": \"运行时诊断\",\n \"renderError.message\": \"错误消息\",\n \"renderError.path\": \"路由\",\n \"renderError.reload\": \"重新加载路由\",\n \"renderError.stack\": \"JavaScript 堆栈\",\n \"renderError.title\": \"路由渲染失败\",\n \"renderError.type\": \"错误类型\",\n \"renderError.version\": \"Clarify 版本\",\n \"theme.dark\": \"深色\",\n \"theme.light\": \"浅色\",\n \"theme.switch\": \"切换主题\",\n \"theme.switchToDark\": \"切换到深色主题\",\n \"theme.switchToLight\": \"切换到浅色主题\",\n \"theme.switchToSystem\": \"跟随系统主题\",\n \"theme.system\": \"跟随系统\",\n \"language.switch\": \"切换语言\",\n \"mermaid.zoomIn\": \"放大\",\n \"mermaid.zoomOut\": \"缩小\",\n \"mermaid.resetZoom\": \"重置缩放\",\n \"mermaid.renderError\": \"Mermaid 渲染错误\",\n \"mermaid.scrollHint\": \"点击图表后即可滚轮缩放\"\n}\n","import { useContext } from 'react'\n\nimport { ConfigContext, LocaleContext } from './context'\nimport enText from './locales/en.json'\nimport zhCNText from './locales/zh-CN.json'\n\nexport type BuiltInLocale = 'en' | 'zh-CN'\n\nexport type BuiltInTextKey = keyof typeof enText\n\nconst checkedZhCNText: Record<BuiltInTextKey, string> & Record<Exclude<keyof typeof zhCNText, BuiltInTextKey>, never> = zhCNText\n\nconst builtInText: Record<BuiltInLocale, Record<BuiltInTextKey, string>> = {\n en: enText,\n 'zh-CN': checkedZhCNText,\n}\n\nexport function resolveBuiltInLocale(locale?: string): BuiltInLocale {\n return locale === 'zh-CN' || locale?.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en'\n}\n\nexport function translateBuiltInText(locale: string | undefined, key: BuiltInTextKey, replacements: Record<string, string> = {}): string {\n let value = builtInText[resolveBuiltInLocale(locale)]?.[key] ?? builtInText.en[key]\n for (const [name, replacement] of Object.entries(replacements)) {\n value = value.replaceAll(`{${name}}`, replacement)\n }\n return value\n}\n\nexport function useBuiltInText(locale?: string) {\n const config = useContext(ConfigContext)\n const currentLocale = useContext(LocaleContext)\n const resolvedLocale = locale ?? currentLocale ?? config?.locales?.default\n return (key: BuiltInTextKey, replacements?: Record<string, string>) => translateBuiltInText(resolvedLocale, key, replacements)\n}\n"],"mappings":";;;AAKA,IAAa,gBAAgB,cAA6B,IAAI;AAE9D,IAAM,uBAAuB,cAAoC,IAAI;AACrE,IAAa,gBAAgB,cAAkC,KAAA,CAAS;AACxE,IAAa,sBAAsB,cAA+B,CAAC,CAAC;AAOpE,SAAgB,eAAe,OAA4B;CACzD,MAAM,EAAE,QAAQ,eAAe,aAAa;CAC5C,MAAM,CAAC,QAAQ,aAAa,SAAS,aAAa;CAElD,OACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;YAC7B,oBAAC,qBAAqB,UAAtB;GAA+B,OAAO;GACnC;EAC4B,CAAA;CACT,CAAA;AAE5B;AAEA,SAAgB,YAAoB;CAClC,MAAM,SAAS,WAAW,aAAa;CACvC,IAAI,CAAC,QACH,MAAM,IAAI,MACR,kEACF;CAEF,OAAO;AACT;AAEA,SAAgB,oBAAmC;CACjD,OAAO,WAAW,aAAa;AACjC;AAEA,SAAgB,mBAAkC;CAChD,MAAM,UAAU,WAAW,oBAAoB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,iEAAiE;CAEnF,OAAO;AACT;AAEA,SAAgB,2BAAiD;CAC/D,OAAO,WAAW,oBAAoB;AACxC;AAEA,SAAgB,YAAgC;CAC9C,OAAO,WAAW,aAAa;AACjC;AAEA,SAAgB,kBAAmC;CACjD,OAAO,WAAW,mBAAmB;AACvC;;;AGjDA,IAAM,cAAqE;CACzE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;CACJ,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;AACX;AAEA,SAAgB,qBAAqB,QAAgC;CACnE,OAAO,WAAW,WAAW,QAAQ,YAAY,CAAC,CAAC,WAAW,IAAI,IAAI,UAAU;AAClF;AAEA,SAAgB,qBAAqB,QAA4B,KAAqB,eAAuC,CAAC,GAAW;CACvI,IAAI,QAAQ,YAAY,qBAAqB,MAAM,EAAE,GAAG,QAAQ,YAAY,GAAG;CAC/E,KAAK,MAAM,CAAC,MAAM,gBAAgB,OAAO,QAAQ,YAAY,GAC3D,QAAQ,MAAM,WAAW,IAAI,KAAK,IAAI,WAAW;CAEnD,OAAO;AACT;AAEA,SAAgB,eAAe,QAAiB;CAC9C,MAAM,SAAS,WAAW,aAAa;CACvC,MAAM,gBAAgB,WAAW,aAAa;CAC9C,MAAM,iBAAiB,UAAU,iBAAiB,QAAQ,SAAS;CACnE,QAAQ,KAAqB,iBAA0C,qBAAqB,gBAAgB,KAAK,YAAY;AAC/H"}
@@ -1,8 +1,21 @@
1
1
  let react = require("react");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
2
3
  //#region source/core/context.tsx
3
4
  var ConfigContext = (0, react.createContext)(null);
5
+ var ConfigUpdaterContext = (0, react.createContext)(null);
4
6
  var LocaleContext = (0, react.createContext)(void 0);
5
7
  var OpenApiSpecsContext = (0, react.createContext)({});
8
+ function ConfigProvider(props) {
9
+ const { config: initialConfig, children } = props;
10
+ const [config, setConfig] = (0, react.useState)(initialConfig);
11
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigContext.Provider, {
12
+ value: config,
13
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfigUpdaterContext.Provider, {
14
+ value: setConfig,
15
+ children
16
+ })
17
+ });
18
+ }
6
19
  function useConfig() {
7
20
  const config = (0, react.useContext)(ConfigContext);
8
21
  if (!config) throw new Error("[clarify] useConfig must be used within a ConfigContext.Provider");
@@ -11,6 +24,14 @@ function useConfig() {
11
24
  function useConfigOptional() {
12
25
  return (0, react.useContext)(ConfigContext);
13
26
  }
27
+ function useConfigUpdater() {
28
+ const updater = (0, react.useContext)(ConfigUpdaterContext);
29
+ if (!updater) throw new Error("[clarify] useConfigUpdater must be used within a ConfigProvider");
30
+ return updater;
31
+ }
32
+ function useConfigUpdaterOptional() {
33
+ return (0, react.useContext)(ConfigUpdaterContext);
34
+ }
14
35
  function useLocale() {
15
36
  return (0, react.useContext)(LocaleContext);
16
37
  }
@@ -380,10 +401,10 @@ function useBuiltInText(locale) {
380
401
  return (key, replacements) => translateBuiltInText(resolvedLocale, key, replacements);
381
402
  }
382
403
  //#endregion
383
- Object.defineProperty(exports, "ConfigContext", {
404
+ Object.defineProperty(exports, "ConfigProvider", {
384
405
  enumerable: true,
385
406
  get: function() {
386
- return ConfigContext;
407
+ return ConfigProvider;
387
408
  }
388
409
  });
389
410
  Object.defineProperty(exports, "LocaleContext", {
@@ -416,6 +437,18 @@ Object.defineProperty(exports, "useConfigOptional", {
416
437
  return useConfigOptional;
417
438
  }
418
439
  });
440
+ Object.defineProperty(exports, "useConfigUpdater", {
441
+ enumerable: true,
442
+ get: function() {
443
+ return useConfigUpdater;
444
+ }
445
+ });
446
+ Object.defineProperty(exports, "useConfigUpdaterOptional", {
447
+ enumerable: true,
448
+ get: function() {
449
+ return useConfigUpdaterOptional;
450
+ }
451
+ });
419
452
  Object.defineProperty(exports, "useLocale", {
420
453
  enumerable: true,
421
454
  get: function() {
@@ -429,4 +462,4 @@ Object.defineProperty(exports, "useOpenApiSpecs", {
429
462
  }
430
463
  });
431
464
 
432
- //# sourceMappingURL=i18n-Cjfk1N7i.cjs.map
465
+ //# sourceMappingURL=i18n-Dw4Jlho-.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-Dw4Jlho-.cjs","names":[],"sources":["../source/core/context.tsx","../source/core/locales/en.json","../source/core/locales/zh-CN.json","../source/core/i18n.ts"],"sourcesContent":["import { createContext, useContext, useState } from 'react'\nimport type { ReactNode } from 'react'\n\nimport type { Config, OpenApiRegistry } from './types'\n\nexport const ConfigContext = createContext<Config | null>(null)\nexport type ConfigUpdater = (update: Config | ((config: Config) => Config)) => void\nconst ConfigUpdaterContext = createContext<ConfigUpdater | null>(null)\nexport const LocaleContext = createContext<string | undefined>(undefined)\nexport const OpenApiSpecsContext = createContext<OpenApiRegistry>({})\n\nexport type ConfigProviderProps = {\n config: Config\n children: ReactNode\n}\n\nexport function ConfigProvider(props: ConfigProviderProps) {\n const { config: initialConfig, children } = props\n const [config, setConfig] = useState(initialConfig)\n\n return (\n <ConfigContext.Provider value={config}>\n <ConfigUpdaterContext.Provider value={setConfig}>\n {children}\n </ConfigUpdaterContext.Provider>\n </ConfigContext.Provider>\n )\n}\n\nexport function useConfig(): Config {\n const config = useContext(ConfigContext)\n if (!config) {\n throw new Error(\n '[clarify] useConfig must be used within a ConfigContext.Provider'\n )\n }\n return config\n}\n\nexport function useConfigOptional(): Config | null {\n return useContext(ConfigContext)\n}\n\nexport function useConfigUpdater(): ConfigUpdater {\n const updater = useContext(ConfigUpdaterContext)\n if (!updater) {\n throw new Error('[clarify] useConfigUpdater must be used within a ConfigProvider')\n }\n return updater\n}\n\nexport function useConfigUpdaterOptional(): ConfigUpdater | null {\n return useContext(ConfigUpdaterContext)\n}\n\nexport function useLocale(): string | undefined {\n return useContext(LocaleContext)\n}\n\nexport function useOpenApiSpecs(): OpenApiRegistry {\n return useContext(OpenApiSpecsContext)\n}\n","{\n \"actions.code\": \"Code\",\n \"actions.copy\": \"Copy\",\n \"actions.copying\": \"Copying...\",\n \"actions.copied\": \"Copied!\",\n \"actions.copyFailed\": \"Copy failed\",\n \"builtWith.label\": \"Built with Clarify\",\n \"builtWith.prefix\": \"Built with\",\n \"callout.danger\": \"Danger\",\n \"callout.info\": \"Info\",\n \"callout.note\": \"Note\",\n \"callout.success\": \"Success\",\n \"callout.tip\": \"Tip\",\n \"callout.warning\": \"Warning\",\n \"contentActions.copyContent\": \"Copy page\",\n \"contentActions.copyContentDescription\": \"Copy this page as {contentType} for LLMs\",\n \"contentActions.copyLink\": \"Copy {contentType} link\",\n \"contentActions.copyLinkDescription\": \"Copy the raw {contentType} content link for this page\",\n \"contentActions.copyLlms\": \"Copy llms.txt\",\n \"contentActions.copyLlmsDescription\": \"Copy the llms.txt link for this site\",\n \"contentActions.copiedLlms\": \"Copied llms.txt\",\n \"contentActions.copiedMcpConfig\": \"Copied MCP config\",\n \"contentActions.mcpConfig\": \"Copy MCP config\",\n \"contentActions.mcpConfigDescription\": \"Copy this site's MCP server configuration\",\n \"contentActions.editPage\": \"Edit this page\",\n \"contentActions.editPageDescription\": \"Open the source file for this page\",\n \"contentActions.copyOptions\": \"Choose copy option\",\n \"contentActions.copiedContent\": \"Copied page\",\n \"contentActions.copiedLink\": \"Copied link\",\n \"contentActions.viewMarkdown\": \"View as Markdown\",\n \"contentActions.viewMarkdownDescription\": \"View this page as plain text\",\n \"contentActions.viewOpenApi\": \"View raw OpenAPI\",\n \"contentActions.viewOpenApiDescription\": \"Open the API description file in a new tab\",\n \"feedback.no\": \"No\",\n \"feedback.prompt\": \"Was this page helpful?\",\n \"feedback.thanks\": \"Thanks for your feedback!\",\n \"feedback.yes\": \"Yes\",\n \"navigation.documentation\": \"Documentation\",\n \"navigation.next\": \"Next\",\n \"navigation.previous\": \"Previous\",\n \"navigation.previousNext\": \"Previous and next pages\",\n \"navigation.toggle\": \"Toggle navigation\",\n \"navbar.home\": \"Home\",\n \"navbar.openLinks\": \"Open navigation links\",\n \"navbar.sections\": \"Documentation sections\",\n \"notFound.description\": \"The page may have moved, been renamed, or never existed. Check the address or return to the homepage.\",\n \"notFound.home\": \"Back to homepage\",\n \"notFound.label\": \"404\",\n \"notFound.title\": \"Page not found\",\n \"openapi.apiDocumentation\": \"API Documentation\",\n \"openapi.authentication\": \"Authentication\",\n \"openapi.authAnd\": \"AND\",\n \"openapi.authApiKey\": \"API key\",\n \"openapi.authBearerFormat\": \"Bearer format: {format}\",\n \"openapi.authLocation\": \"{in} parameter: {name}\",\n \"openapi.authNoAuth\": \"No authentication required\",\n \"openapi.authOr\": \"OR\",\n \"openapi.authScopes\": \"Scopes: {scopes}\",\n \"openapi.bodyProperties\": \"Body properties\",\n \"openapi.collapse\": \"Collapse\",\n \"openapi.clear\": \"Clear\",\n \"openapi.codeSnippet\": \"Code snippet\",\n \"openapi.endpointNotFound\": \"Operation not found or operationId is not unique: {endpoint}\",\n \"openapi.example\": \"Example\",\n \"openapi.expand\": \"Expand\",\n \"openapi.headers\": \"Headers\",\n \"openapi.headerName\": \"Name\",\n \"openapi.headerValue\": \"Value\",\n \"openapi.headerParameters\": \"Header parameters\",\n \"openapi.fieldDescription\": \"Field description\",\n \"openapi.includeParameter\": \"Include parameter\",\n \"openapi.cookieParameters\": \"Cookie parameters\",\n \"openapi.cookieParametersBrowserManaged\": \"Cookies are managed by the browser. Matching cookies are sent when the server allows credentialed requests.\",\n \"openapi.cookies\": \"Cookies\",\n \"openapi.cookiesBrowserHidden\": \"Cookies are managed by the browser. Set-Cookie values are not exposed to JavaScript.\",\n \"openapi.language\": \"Language\",\n \"openapi.client\": \"Client\",\n \"openapi.closeRequest\": \"Close request tester\",\n \"openapi.credential\": \"Credential\",\n \"openapi.loading\": \"Loading OpenAPI spec...\",\n \"openapi.mediaType\": \"Media type\",\n \"openapi.none\": \"None\",\n \"openapi.noRequestConfiguration\": \"This request has no parameters, authentication, variables, or request body. It is ready to send as-is.\",\n \"openapi.openApiReference\": \"OpenAPI Reference\",\n \"openapi.operationParameter\": \"Operation parameter.\",\n \"openapi.optional\": \"Optional.\",\n \"openapi.parameter\": \"parameter\",\n \"openapi.parameterInvalidArray\": \"Enter a valid JSON array.\",\n \"openapi.parameterInvalidDate\": \"Enter a valid date.\",\n \"openapi.parameterInvalidDateTime\": \"Enter a valid date and time.\",\n \"openapi.parameterInvalidEnum\": \"Select one of the allowed values.\",\n \"openapi.parameterInvalidInteger\": \"Enter a whole number.\",\n \"openapi.parameterInvalidNumber\": \"Enter a valid number.\",\n \"openapi.parameterInvalidObject\": \"Enter a valid JSON object.\",\n \"openapi.pathParameters\": \"Path parameters\",\n \"openapi.queryParameters\": \"Query parameters\",\n \"openapi.preview\": \"Preview\",\n \"openapi.raw\": \"Raw\",\n \"openapi.resetToExample\": \"Reset to example\",\n \"openapi.body\": \"Body\",\n \"openapi.binaryPreview\": \"Binary response preview is not available.\",\n \"openapi.downloadBody\": \"Download response body\",\n \"openapi.noHeaders\": \"No response headers match the current search.\",\n \"openapi.responseViews\": \"Response views\",\n \"openapi.responseUrl\": \"Final URL\",\n \"openapi.redirected\": \"Redirected\",\n \"openapi.searchHeaders\": \"Search response headers\",\n \"openapi.searchBodyProperties\": \"Search request body properties\",\n \"openapi.searchResponseBodyProperties\": \"Search response body properties\",\n \"openapi.noBodyProperties\": \"No request body properties match the current search.\",\n \"openapi.noResponseBodyProperties\": \"No response body properties match the current search.\",\n \"openapi.unknownContentType\": \"Unknown content type\",\n \"openapi.variables\": \"Variables\",\n \"openapi.requestConfiguration\": \"Request configuration\",\n \"openapi.requestExample\": \"Request example\",\n \"openapi.requestHeaders\": \"Request headers\",\n \"openapi.request\": \"Request\",\n \"openapi.requestBody\": \"Request body\",\n \"openapi.requestBodyEmpty\": \"No request body\",\n \"openapi.requestCorsHint\": \"The API may be unavailable from this browser because of its network or CORS policy\",\n \"openapi.responseBodyProperties\": \"Response body properties\",\n \"openapi.responseHeaders\": \"Response headers\",\n \"openapi.required\": \"Required.\",\n \"openapi.requiredBadge\": \"required\",\n \"openapi.response\": \"Response\",\n \"openapi.responseBodyEmpty\": \"The response body is empty.\",\n \"openapi.responseBodyEmptyTitle\": \"No response content\",\n \"openapi.responseEmpty\": \"Send the request to inspect the response.\",\n \"openapi.responseEmptyTitle\": \"Ready for a request\",\n \"openapi.responseErrorTitle\": \"Request failed\",\n \"openapi.responses\": \"Responses\",\n \"openapi.schemaExample\": \"Schema example\",\n \"openapi.sendRequest\": \"Send\",\n \"openapi.sendingRequest\": \"Sending\",\n \"openapi.server\": \"Server\",\n \"openapi.scrollExamplesLeft\": \"Scroll examples left\",\n \"openapi.scrollExamplesRight\": \"Scroll examples right\",\n \"openapi.specNotFound\": \"OpenAPI spec not found: {specPath}\",\n \"openapi.specPathMissing\": \"spec or specPath was not provided\",\n \"openapi.status\": \"Status\",\n \"openapi.tryRequest\": \"Try request\",\n \"openapi.version\": \"Version {version}\",\n \"openapi.webhookResponse\": \"Webhook response\",\n \"openapi.webhookResponses\": \"Webhook responses\",\n \"search.button\": \"Search...\",\n \"search.noResults\": \"Nothing found for {query}.\",\n \"search.placeholder\": \"Find something...\",\n \"search.shortcutCtrl\": \"Ctrl \",\n \"renderError.componentStack\": \"React component stack\",\n \"renderError.description\": \"Clarify stopped rendering this route to keep the rest of the shell responsive. Review the diagnostics below, fix the page source, then reload the route.\",\n \"renderError.details\": \"Runtime diagnostics\",\n \"renderError.message\": \"Message\",\n \"renderError.path\": \"Route\",\n \"renderError.reload\": \"Reload route\",\n \"renderError.stack\": \"JavaScript stack trace\",\n \"renderError.title\": \"Route render failed\",\n \"renderError.type\": \"Error type\",\n \"renderError.version\": \"Clarify version\",\n \"theme.dark\": \"Dark\",\n \"theme.light\": \"Light\",\n \"theme.switch\": \"Switch theme\",\n \"theme.switchToDark\": \"Switch to dark theme\",\n \"theme.switchToLight\": \"Switch to light theme\",\n \"theme.switchToSystem\": \"Follow system theme\",\n \"theme.system\": \"System\",\n \"language.switch\": \"Switch language\",\n \"mermaid.zoomIn\": \"Zoom in\",\n \"mermaid.zoomOut\": \"Zoom out\",\n \"mermaid.resetZoom\": \"Reset zoom\",\n \"mermaid.renderError\": \"Mermaid render error\",\n \"mermaid.scrollHint\": \"Click the diagram to enable scroll-to-zoom\"\n}\n","{\n \"actions.code\": \"代码\",\n \"actions.copy\": \"复制\",\n \"actions.copying\": \"正在复制...\",\n \"actions.copied\": \"已复制!\",\n \"actions.copyFailed\": \"复制失败\",\n \"builtWith.label\": \"由 Clarify 构建\",\n \"builtWith.prefix\": \"构建来自\",\n \"callout.danger\": \"危险\",\n \"callout.info\": \"信息\",\n \"callout.note\": \"注意\",\n \"callout.success\": \"成功\",\n \"callout.tip\": \"提示\",\n \"callout.warning\": \"警告\",\n \"contentActions.copyContent\": \"复制页面\",\n \"contentActions.copyContentDescription\": \"将页面以 {contentType} 格式复制给 LLMs\",\n \"contentActions.copyLink\": \"复制 {contentType} 链接\",\n \"contentActions.copyLinkDescription\": \"复制当前页面的 {contentType} 原始内容链接\",\n \"contentActions.copyLlms\": \"复制 llms.txt\",\n \"contentActions.copyLlmsDescription\": \"复制此站点的 llms.txt 链接\",\n \"contentActions.copiedLlms\": \"已复制 llms.txt\",\n \"contentActions.copiedMcpConfig\": \"已复制 MCP 配置\",\n \"contentActions.mcpConfig\": \"复制 MCP 配置\",\n \"contentActions.mcpConfigDescription\": \"复制站点的 MCP server 配置\",\n \"contentActions.editPage\": \"编辑此页面\",\n \"contentActions.editPageDescription\": \"打开当前页面的源文件\",\n \"contentActions.copyOptions\": \"选择复制选项\",\n \"contentActions.copiedContent\": \"已复制页面\",\n \"contentActions.copiedLink\": \"已复制链接\",\n \"contentActions.viewMarkdown\": \"以 Markdown 格式查看\",\n \"contentActions.viewMarkdownDescription\": \"以纯文本查看此页面\",\n \"contentActions.viewOpenApi\": \"查看 OpenAPI 原始内容\",\n \"contentActions.viewOpenApiDescription\": \"在新标签页打开 API 描述文件\",\n \"feedback.no\": \"否\",\n \"feedback.prompt\": \"这个页面有帮助吗?\",\n \"feedback.thanks\": \"感谢你的反馈!\",\n \"feedback.yes\": \"是\",\n \"navigation.documentation\": \"文档\",\n \"navigation.next\": \"下一页\",\n \"navigation.previous\": \"上一页\",\n \"navigation.previousNext\": \"上一页和下一页\",\n \"navigation.toggle\": \"切换导航\",\n \"navbar.home\": \"首页\",\n \"navbar.openLinks\": \"打开导航链接\",\n \"navbar.sections\": \"文档栏目\",\n \"notFound.description\": \"页面可能已移动、重命名或不存在。请检查地址,或返回首页继续浏览。\",\n \"notFound.home\": \"返回首页\",\n \"notFound.label\": \"404\",\n \"notFound.title\": \"页面未找到\",\n \"openapi.apiDocumentation\": \"API 文档\",\n \"openapi.authentication\": \"认证方式\",\n \"openapi.authAnd\": \"并且\",\n \"openapi.authApiKey\": \"API 密钥\",\n \"openapi.authBearerFormat\": \"Bearer 格式:{format}\",\n \"openapi.authLocation\": \"{in} 参数:{name}\",\n \"openapi.authNoAuth\": \"无需认证\",\n \"openapi.authOr\": \"或者\",\n \"openapi.authScopes\": \"Scopes:{scopes}\",\n \"openapi.bodyProperties\": \"请求体属性\",\n \"openapi.collapse\": \"收起\",\n \"openapi.clear\": \"清除\",\n \"openapi.codeSnippet\": \"代码示例\",\n \"openapi.endpointNotFound\": \"未找到 operation,或 operationId 不唯一:{endpoint}\",\n \"openapi.example\": \"示例\",\n \"openapi.expand\": \"展开\",\n \"openapi.headers\": \"请求头\",\n \"openapi.headerName\": \"名称\",\n \"openapi.headerValue\": \"值\",\n \"openapi.headerParameters\": \"请求头参数\",\n \"openapi.fieldDescription\": \"字段说明\",\n \"openapi.includeParameter\": \"传递参数\",\n \"openapi.cookieParameters\": \"Cookie 参数\",\n \"openapi.cookieParametersBrowserManaged\": \"Cookie 由浏览器管理;当服务端允许携带凭据时,匹配的 Cookie 会随请求发送。\",\n \"openapi.cookies\": \"Cookies\",\n \"openapi.cookiesBrowserHidden\": \"Cookie 由浏览器管理,JavaScript 无法读取 Set-Cookie 的值。\",\n \"openapi.language\": \"语言\",\n \"openapi.client\": \"客户端\",\n \"openapi.closeRequest\": \"关闭请求测试器\",\n \"openapi.credential\": \"认证凭证\",\n \"openapi.loading\": \"正在加载 OpenAPI 描述文件...\",\n \"openapi.mediaType\": \"媒体类型\",\n \"openapi.none\": \"无\",\n \"openapi.noRequestConfiguration\": \"此请求没有参数、认证、变量或请求体,可以直接发送。\",\n \"openapi.openApiReference\": \"OpenAPI 参考\",\n \"openapi.operationParameter\": \"操作参数。\",\n \"openapi.optional\": \"可选。\",\n \"openapi.parameter\": \"参数\",\n \"openapi.parameterInvalidArray\": \"请输入有效的 JSON 数组。\",\n \"openapi.parameterInvalidDate\": \"请输入有效日期。\",\n \"openapi.parameterInvalidDateTime\": \"请输入有效的日期和时间。\",\n \"openapi.parameterInvalidEnum\": \"请选择允许的值。\",\n \"openapi.parameterInvalidInteger\": \"请输入整数。\",\n \"openapi.parameterInvalidNumber\": \"请输入有效数字。\",\n \"openapi.parameterInvalidObject\": \"请输入有效的 JSON 对象。\",\n \"openapi.pathParameters\": \"路径参数\",\n \"openapi.queryParameters\": \"查询参数\",\n \"openapi.preview\": \"预览\",\n \"openapi.raw\": \"原始内容\",\n \"openapi.resetToExample\": \"重置为示例\",\n \"openapi.body\": \"响应体\",\n \"openapi.binaryPreview\": \"暂不支持预览二进制响应。\",\n \"openapi.downloadBody\": \"下载响应体\",\n \"openapi.noHeaders\": \"没有匹配当前搜索的响应头。\",\n \"openapi.responseViews\": \"响应视图\",\n \"openapi.responseUrl\": \"最终 URL\",\n \"openapi.redirected\": \"已重定向\",\n \"openapi.searchHeaders\": \"搜索响应头\",\n \"openapi.searchBodyProperties\": \"搜索请求体属性\",\n \"openapi.searchResponseBodyProperties\": \"搜索响应体属性\",\n \"openapi.noBodyProperties\": \"没有匹配当前搜索的请求体属性。\",\n \"openapi.noResponseBodyProperties\": \"没有匹配当前搜索的响应体属性。\",\n \"openapi.unknownContentType\": \"未知内容类型\",\n \"openapi.variables\": \"变量\",\n \"openapi.requestConfiguration\": \"请求配置\",\n \"openapi.requestExample\": \"请求示例\",\n \"openapi.requestHeaders\": \"请求头\",\n \"openapi.request\": \"请求\",\n \"openapi.requestBody\": \"请求体\",\n \"openapi.requestBodyEmpty\": \"暂无请求体\",\n \"openapi.requestCorsHint\": \"受目标 API 的网络或 CORS 策略影响,浏览器可能无法直接访问\",\n \"openapi.responseBodyProperties\": \"响应体属性\",\n \"openapi.responseHeaders\": \"响应头\",\n \"openapi.required\": \"必填。\",\n \"openapi.requiredBadge\": \"必填\",\n \"openapi.response\": \"响应\",\n \"openapi.responseBodyEmpty\": \"响应体为空。\",\n \"openapi.responseBodyEmptyTitle\": \"无响应内容\",\n \"openapi.responseEmpty\": \"发送请求后在这里查看响应。\",\n \"openapi.responseEmptyTitle\": \"等待发送请求\",\n \"openapi.responseErrorTitle\": \"请求失败\",\n \"openapi.responses\": \"响应\",\n \"openapi.schemaExample\": \"Schema 示例\",\n \"openapi.sendRequest\": \"发送\",\n \"openapi.sendingRequest\": \"发送中\",\n \"openapi.server\": \"服务地址\",\n \"openapi.scrollExamplesLeft\": \"向左滚动示例\",\n \"openapi.scrollExamplesRight\": \"向右滚动示例\",\n \"openapi.specNotFound\": \"未找到 OpenAPI 描述文件:{specPath}\",\n \"openapi.specPathMissing\": \"未提供 spec 或 specPath\",\n \"openapi.status\": \"状态\",\n \"openapi.tryRequest\": \"发起测试请求\",\n \"openapi.version\": \"版本 {version}\",\n \"openapi.webhookResponse\": \"Webhook 响应\",\n \"openapi.webhookResponses\": \"Webhook 响应\",\n \"search.button\": \"搜索...\",\n \"search.noResults\": \"没有找到与 {query} 相关的结果。\",\n \"search.placeholder\": \"搜索内容...\",\n \"search.shortcutCtrl\": \"Ctrl \",\n \"renderError.componentStack\": \"React 组件栈\",\n \"renderError.description\": \"Clarify 已停止渲染此路由,以保证文档 Shell 仍可响应。请查看下方诊断信息,修复页面源码后重新加载路由。\",\n \"renderError.details\": \"运行时诊断\",\n \"renderError.message\": \"错误消息\",\n \"renderError.path\": \"路由\",\n \"renderError.reload\": \"重新加载路由\",\n \"renderError.stack\": \"JavaScript 堆栈\",\n \"renderError.title\": \"路由渲染失败\",\n \"renderError.type\": \"错误类型\",\n \"renderError.version\": \"Clarify 版本\",\n \"theme.dark\": \"深色\",\n \"theme.light\": \"浅色\",\n \"theme.switch\": \"切换主题\",\n \"theme.switchToDark\": \"切换到深色主题\",\n \"theme.switchToLight\": \"切换到浅色主题\",\n \"theme.switchToSystem\": \"跟随系统主题\",\n \"theme.system\": \"跟随系统\",\n \"language.switch\": \"切换语言\",\n \"mermaid.zoomIn\": \"放大\",\n \"mermaid.zoomOut\": \"缩小\",\n \"mermaid.resetZoom\": \"重置缩放\",\n \"mermaid.renderError\": \"Mermaid 渲染错误\",\n \"mermaid.scrollHint\": \"点击图表后即可滚轮缩放\"\n}\n","import { useContext } from 'react'\n\nimport { ConfigContext, LocaleContext } from './context'\nimport enText from './locales/en.json'\nimport zhCNText from './locales/zh-CN.json'\n\nexport type BuiltInLocale = 'en' | 'zh-CN'\n\nexport type BuiltInTextKey = keyof typeof enText\n\nconst checkedZhCNText: Record<BuiltInTextKey, string> & Record<Exclude<keyof typeof zhCNText, BuiltInTextKey>, never> = zhCNText\n\nconst builtInText: Record<BuiltInLocale, Record<BuiltInTextKey, string>> = {\n en: enText,\n 'zh-CN': checkedZhCNText,\n}\n\nexport function resolveBuiltInLocale(locale?: string): BuiltInLocale {\n return locale === 'zh-CN' || locale?.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en'\n}\n\nexport function translateBuiltInText(locale: string | undefined, key: BuiltInTextKey, replacements: Record<string, string> = {}): string {\n let value = builtInText[resolveBuiltInLocale(locale)]?.[key] ?? builtInText.en[key]\n for (const [name, replacement] of Object.entries(replacements)) {\n value = value.replaceAll(`{${name}}`, replacement)\n }\n return value\n}\n\nexport function useBuiltInText(locale?: string) {\n const config = useContext(ConfigContext)\n const currentLocale = useContext(LocaleContext)\n const resolvedLocale = locale ?? currentLocale ?? config?.locales?.default\n return (key: BuiltInTextKey, replacements?: Record<string, string>) => translateBuiltInText(resolvedLocale, key, replacements)\n}\n"],"mappings":";;;AAKA,IAAa,iBAAA,GAAA,MAAA,cAAA,CAA6C,IAAI;AAE9D,IAAM,wBAAA,GAAA,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;;;;;;;;;;;CAAA;CACJ,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;AACX;AAEA,SAAgB,qBAAqB,QAAgC;CACnE,OAAO,WAAW,WAAW,QAAQ,YAAY,CAAC,CAAC,WAAW,IAAI,IAAI,UAAU;AAClF;AAEA,SAAgB,qBAAqB,QAA4B,KAAqB,eAAuC,CAAC,GAAW;CACvI,IAAI,QAAQ,YAAY,qBAAqB,MAAM,EAAE,GAAG,QAAQ,YAAY,GAAG;CAC/E,KAAK,MAAM,CAAC,MAAM,gBAAgB,OAAO,QAAQ,YAAY,GAC3D,QAAQ,MAAM,WAAW,IAAI,KAAK,IAAI,WAAW;CAEnD,OAAO;AACT;AAEA,SAAgB,eAAe,QAAiB;CAC9C,MAAM,UAAA,GAAA,MAAA,WAAA,CAAoB,aAAa;CACvC,MAAM,iBAAA,GAAA,MAAA,WAAA,CAA2B,aAAa;CAC9C,MAAM,iBAAiB,UAAU,iBAAiB,QAAQ,SAAS;CACnE,QAAQ,KAAqB,iBAA0C,qBAAqB,gBAAgB,KAAK,YAAY;AAC/H"}
package/output/index.cjs CHANGED
@@ -1,17 +1,17 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
3
- const require_i18n = require("./i18n-Cjfk1N7i.cjs");
4
- const require_ClarifyShell = require("./ClarifyShell-CukbPOAd.cjs");
5
- const require_PageActions = require("./PageActions-ob2OJusG.cjs");
6
- const require_OpenApiOperation = require("./OpenApiOperation-c-I6Nw9j.cjs");
3
+ const require_i18n = require("./i18n-Dw4Jlho-.cjs");
4
+ const require_ClarifyShell = require("./ClarifyShell-D8OGIUWq.cjs");
5
+ const require_PageActions = require("./PageActions-DPYXFL6N.cjs");
6
+ const require_OpenApiOperation = require("./OpenApiOperation-Bd68uxXq.cjs");
7
7
  const require_remark = require("./remark-DTLbG8PK.cjs");
8
- const require_render = require("./render-BxiVlY6q.cjs");
8
+ const require_render = require("./render-CqBz1q82.cjs");
9
9
  let clsx = require("clsx");
10
10
  clsx = require_rolldown_runtime.__toESM(clsx, 1);
11
11
  let react = require("react");
12
12
  let react_router_dom = require("react-router-dom");
13
- let lucide_react = require("lucide-react");
14
13
  let react_jsx_runtime = require("react/jsx-runtime");
14
+ let lucide_react = require("lucide-react");
15
15
  //#region source/app/ContentDiagnostic.tsx
16
16
  function ContentDiagnosticPanel(params) {
17
17
  const { data } = params;
@@ -276,7 +276,7 @@ function OpenApiLink(arg0) {
276
276
  children: t("openapi.endpointNotFound", { endpoint: operationId })
277
277
  });
278
278
  const sectionId = require_OpenApiOperation.getOpenApiOperationSectionId(entry.operation) || operationId;
279
- const href = `${require_PageActions.prefixHref(require_PageActions.localizeHref(hrefOverride ?? specPath, config, locale), config.routePrefix)}#${sectionId}`;
279
+ const href = `${require_PageActions.localizeHref(hrefOverride ?? specPath, config, locale)}#${sectionId}`;
280
280
  const method = entry.method.toUpperCase();
281
281
  const title = entry.operation.summary?.trim() || "";
282
282
  if (inline) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiLinkInline, {
@@ -387,6 +387,7 @@ exports.CardGroup = require_OpenApiOperation.CardGroup;
387
387
  exports.Code = require_OpenApiOperation.Code;
388
388
  exports.CodeGroup = require_OpenApiOperation.CodeGroup;
389
389
  exports.Collapse = require_OpenApiOperation.Collapse;
390
+ exports.ConfigProvider = require_i18n.ConfigProvider;
390
391
  exports.DocShell = DocShell;
391
392
  exports.Feedback = require_OpenApiOperation.Feedback;
392
393
  exports.GridPattern = require_OpenApiOperation.GridPattern;
@@ -426,6 +427,9 @@ exports.render = require_render.render;
426
427
  exports.themeBootstrapScript = require_ClarifyShell.themeBootstrapScript;
427
428
  exports.themeEditorPresets = require_ClarifyShell.themeEditorPresets;
428
429
  exports.themePresets = require_ClarifyShell.themePresets;
430
+ exports.useConfig = require_i18n.useConfig;
431
+ exports.useConfigUpdater = require_i18n.useConfigUpdater;
432
+ exports.useConfigUpdaterOptional = require_i18n.useConfigUpdaterOptional;
429
433
  exports.useMDXComponents = useMDXComponents;
430
434
  exports.useOpenApiSpecs = require_i18n.useOpenApiSpecs;
431
435
  exports.useSectionStore = require_PageActions.useSectionStore;