@clarify-labs/renderer 0.11.18 → 0.11.20

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/index.cjs CHANGED
@@ -3,7 +3,7 @@ const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
3
3
  const require_i18n = require("./i18n-BMNCgF9o.cjs");
4
4
  const require_ClarifyShell = require("./ClarifyShell-DwxpyL0U.cjs");
5
5
  const require_PageActions = require("./PageActions-CwJLUFUH.cjs");
6
- const require_OpenApiOperation = require("./OpenApiOperation-XH6b7ntf.cjs");
6
+ const require_OpenApiOperation = require("./OpenApiOperation-Cv4N92VL.cjs");
7
7
  const require_remark = require("./remark-DTLbG8PK.cjs");
8
8
  const require_render = require("./render-DHVpckNI.cjs");
9
9
  let react = require("react");
@@ -161,10 +161,10 @@ function operationMatchesTags(operationTags, filterTags) {
161
161
  return operationTags?.some((tag) => filterTags.includes(tag)) ?? false;
162
162
  }
163
163
  function OpenApiPaths(arg0) {
164
- const { spec, tagFilter } = arg0;
164
+ const { spec, tagFilter, operationOrder } = arg0;
165
165
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
166
166
  className: "clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10",
167
- children: require_OpenApiOperation.listOpenApiOperations(spec).filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter)).map(({ path, method, operation, source }) => ({
167
+ children: require_OpenApiOperation.listOpenApiOperations(spec, operationOrder).filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter)).map(({ path, method, operation, source }) => ({
168
168
  path,
169
169
  method: method.toUpperCase(),
170
170
  operation,
@@ -186,7 +186,7 @@ function WarningBox(arg0) {
186
186
  });
187
187
  }
188
188
  function OpenApiDocument(arg0) {
189
- const { spec, specPath, tagFilter } = arg0;
189
+ const { spec, specPath, tagFilter, operationOrder } = arg0;
190
190
  const t = require_i18n.useBuiltInText();
191
191
  const { spec: resolved, loading } = useOpenApiSpec(spec, specPath);
192
192
  if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WarningBox, { children: t("openapi.loading") });
@@ -200,7 +200,8 @@ function OpenApiDocument(arg0) {
200
200
  className: "flex-auto",
201
201
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiHeader, { spec: resolved }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiPaths, {
202
202
  spec: resolved,
203
- tagFilter
203
+ tagFilter,
204
+ operationOrder
204
205
  })]
205
206
  })]
206
207
  });
@@ -255,7 +256,10 @@ function OpenApiRequest(arg0) {
255
256
  }
256
257
  function createOpenApiRouteComponent(data) {
257
258
  return function OpenApiRoutePage() {
258
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocument, { spec: data.spec });
259
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiDocument, {
260
+ spec: data.spec,
261
+ operationOrder: data.operationOrder
262
+ });
259
263
  };
260
264
  }
261
265
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n tagFilter?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-accent-text) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter } = arg0\n\n const entries = listOpenApiOperations(spec)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200'\n : 'rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, tagFilter } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-md bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-accent-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-lg border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-accent-border) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-md text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-accent-text)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC,MAAM,eAAe,KAAK,SAAS,kBAAkB,KAAK,SAAS,aAAa,oBAAoB;CAGpG,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,kBAAD;EACE,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,SAAQ;EACR,UAAU,CACR;GAAE,OAAO;GAAW,OAAO,KAAK,YAAY;EAAU,GACtD;GAAE,OAAO;GAAQ,OAAO;EAAU,CACpC;EACc;EACd,gBAAgB,KAAK,UACnB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAA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AA,GAAA,kBAAA,KAAA,CAAC,QAAD;IAAM,WAAU;cAAhB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;eAAuH;IAAW,CAAA,GACjJ,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;eAAkE;IAAY,CAAA,IAAI,IACvG;;GACN,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAU;cACd,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAA,YAAD;KAAY,eAAY;KAAO,WAAU;IAAU,CAAA;GAC/C,CAAA;EACO;;AAEnB;;;ACpFA,IAAM,uBAAuB;CAC3B,GAAG,yBAAA;CACH,UAAA,yBAAA;CACA,SAAA,yBAAA;AACF;AAEA,IAAM,2BAA2B;CAC/B;CACA;CACA;CACA;AACF;AAEA,SAAgB,iBAAiB,aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAU;YACd,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,yBAAA,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[]; operationOrder?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n tagFilter?: string[]\n operationOrder?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n operationOrder?: string[]\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-accent-text) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter, operationOrder } = arg0\n\n const entries = listOpenApiOperations(spec, operationOrder)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200'\n : 'rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, tagFilter, operationOrder } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} operationOrder={operationOrder} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} operationOrder={data.operationOrder} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-md bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-accent-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-lg border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-accent-border) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-md text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-accent-text)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 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AG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAU;YACd,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,yBAAA,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
package/output/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Heading, B as Callout, C as Tabs, D as GridPattern, E as Prose, F as CodeGroup, H as LocalizedLink, I as Pre, L as Mermaid, M as Feedback, N as Collapse, O as HeroPattern, P as Code, R as Card, S as TabItem, T as Steps, V as Button, _ as Markdown, b as primitives_exports, d as EndpointMethodBadge, f as getOpenApiOperationEntryById, j as Tag, k as Logo, m as listOpenApiOperations, n as OpenApiOperation$1, p as getOpenApiOperationSectionId, r as OpenApiRequestWorkbench, v as Release, w as Step, x as WebFrame, y as ReleaseItem, z as CardGroup } from "./OpenApiOperation-hxX828Il.js";
1
+ import { A as Heading, B as Callout, C as Tabs, D as GridPattern, E as Prose, F as CodeGroup, H as LocalizedLink, I as Pre, L as Mermaid, M as Feedback, N as Collapse, O as HeroPattern, P as Code, R as Card, S as TabItem, T as Steps, V as Button, _ as Markdown, b as primitives_exports, d as EndpointMethodBadge, f as getOpenApiOperationEntryById, j as Tag, k as Logo, m as listOpenApiOperations, n as OpenApiOperation$1, p as getOpenApiOperationSectionId, r as OpenApiRequestWorkbench, v as Release, w as Step, x as WebFrame, y as ReleaseItem, z as CardGroup } from "./OpenApiOperation-B68CqUJW.js";
2
2
  import { a as useConfig, c as useConfigUpdaterOptional, i as OpenApiSpecsContext, l as useLocale, n as ConfigProvider, s as useConfigUpdater, t as useBuiltInText, u as useOpenApiSpecs } from "./i18n-Zmmhz7FF.js";
3
3
  import { a as themeBootstrapScript, c as AppShell, d as RenderErrorPanel, f as BuiltWithClarify, g as useSlot, h as SlotProvider, i as themeEditorPresets, l as PageFooter, m as RuntimeSlotsProvider, n as ThemeEditor, o as themePresets, p as RuntimeSlot, r as applyThemeVariables, u as PageBanner } from "./ClarifyShell-BdkOnYRO.js";
4
4
  import { c as remToPx, d as ThemeToggle, f as ThemeProvider, h as localizeHref, o as SectionProvider, p as useTheme, s as useSectionStore, t as PageActions } from "./PageActions-BszP_J4e.js";
@@ -158,10 +158,10 @@ function operationMatchesTags(operationTags, filterTags) {
158
158
  return operationTags?.some((tag) => filterTags.includes(tag)) ?? false;
159
159
  }
160
160
  function OpenApiPaths(arg0) {
161
- const { spec, tagFilter } = arg0;
161
+ const { spec, tagFilter, operationOrder } = arg0;
162
162
  return /* @__PURE__ */ jsx("div", {
163
163
  className: "clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10",
164
- children: listOpenApiOperations(spec).filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter)).map(({ path, method, operation, source }) => ({
164
+ children: listOpenApiOperations(spec, operationOrder).filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter)).map(({ path, method, operation, source }) => ({
165
165
  path,
166
166
  method: method.toUpperCase(),
167
167
  operation,
@@ -183,7 +183,7 @@ function WarningBox(arg0) {
183
183
  });
184
184
  }
185
185
  function OpenApiDocument(arg0) {
186
- const { spec, specPath, tagFilter } = arg0;
186
+ const { spec, specPath, tagFilter, operationOrder } = arg0;
187
187
  const t = useBuiltInText();
188
188
  const { spec: resolved, loading } = useOpenApiSpec(spec, specPath);
189
189
  if (loading) return /* @__PURE__ */ jsx(WarningBox, { children: t("openapi.loading") });
@@ -197,7 +197,8 @@ function OpenApiDocument(arg0) {
197
197
  className: "flex-auto",
198
198
  children: [/* @__PURE__ */ jsx(OpenApiHeader, { spec: resolved }), /* @__PURE__ */ jsx(OpenApiPaths, {
199
199
  spec: resolved,
200
- tagFilter
200
+ tagFilter,
201
+ operationOrder
201
202
  })]
202
203
  })]
203
204
  });
@@ -252,7 +253,10 @@ function OpenApiRequest(arg0) {
252
253
  }
253
254
  function createOpenApiRouteComponent(data) {
254
255
  return function OpenApiRoutePage() {
255
- return /* @__PURE__ */ jsx(OpenApiDocument, { spec: data.spec });
256
+ return /* @__PURE__ */ jsx(OpenApiDocument, {
257
+ spec: data.spec,
258
+ operationOrder: data.operationOrder
259
+ });
256
260
  };
257
261
  }
258
262
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n tagFilter?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-accent-text) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter } = arg0\n\n const entries = listOpenApiOperations(spec)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200'\n : 'rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, tagFilter } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-md bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-accent-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-lg border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-accent-border) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-md text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-accent-text)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC,MAAM,eAAe,KAAK,SAAS,kBAAkB,KAAK,SAAS,aAAa,oBAAoB;CAGpG,OACE,oBAAC,kBAAD;EACE,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,SAAQ;EACR,UAAU,CACR;GAAE,OAAO;GAAW,OAAO,KAAK,YAAY;EAAU,GACtD;GAAE,OAAO;GAAQ,OAAO;EAAU,CACpC;EACc;EACd,gBAAgB,KAAK,UACnB,oBAAC,OAAD;GAAK,WAAU;aACZ,KAAK;EACH,CAAA,IACH;CACL,CAAA;AAEL;AAEA,SAAgB,iCAAiC,MAAwC;CACvF,OAAO,SAAS,6BAA6B;EAC3C,OAAO,oBAAC,wBAAD,EAA8B,KAAO,CAAA;CAC9C;AACF;;;AClCA,SAAS,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IACvG;;GACN,oBAAC,QAAD;IAAM,WAAU;cACd,oBAAC,YAAD;KAAY,eAAY;KAAO,WAAU;IAAU,CAAA;GAC/C,CAAA;EACO;;AAEnB;;;ACpFA,IAAM,uBAAuB;CAC3B,GAAG;CACH;CACA;AACF;AAEA,IAAM,2BAA2B;CAC/B;CACA;CACA;CACA;AACF;AAEA,SAAgB,iBAAiB,aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,oBAAC,QAAD;EAAM,WAAU;YACd,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,oBAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,oBAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,oBAAC,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../source/app/ContentDiagnostic.tsx","../source/openapi/lib/spec-path.ts","../source/openapi/entry.tsx","../source/openapi/components/OpenApiLink.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\n\nimport { RenderErrorPanel } from './RenderErrorPanel'\n\nexport type ContentDiagnosticKind = 'markdown' | 'markdown+jsx' | 'openapi' | 'route-load'\n\nexport type ContentDiagnostic = {\n kind: ContentDiagnosticKind\n title: string\n message: string\n details?: string\n filePath?: string\n}\n\ntype ContentDiagnosticPanelProps = {\n data: ContentDiagnostic\n}\n\nfunction ContentDiagnosticPanel(params: ContentDiagnosticPanelProps) {\n const { data } = params\n const typeLabels: Record<ContentDiagnosticKind, string> = {\n markdown: 'Markdown',\n 'markdown+jsx': 'MDX',\n openapi: 'OpenAPI',\n 'route-load': 'Route',\n }\n const typeLabel = typeLabels[data.kind]\n const detailsLabel = data.kind === 'markdown+jsx' || data.kind === 'markdown' ? 'Why it happened' : 'Details'\n const pathLabel = 'File'\n\n return (\n <RenderErrorPanel\n title={data.title}\n description={data.message}\n titleId=\"clarify-content-diagnostic-title\"\n metadata={[\n { label: pathLabel, value: data.filePath ?? 'Unknown' },\n { label: 'Type', value: typeLabel },\n ]}\n detailsLabel={detailsLabel}\n detailsContent={data.details ? (\n <pre className=\"max-h-(--clarify-error-details-max-height) overflow-auto whitespace-pre-wrap wrap-break-word font-mono\">\n {data.details}\n </pre>\n ) : null}\n />\n )\n}\n\nexport function createContentDiagnosticComponent(data: ContentDiagnostic): ComponentType {\n return function ContentDiagnosticComponent() {\n return <ContentDiagnosticPanel data={data} />\n }\n}\n","import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { useConfig, useLocale, useOpenApiSpecs } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\ntype OpenApiSpecResult = {\n spec: OpenAPISpec | null\n loading: boolean\n}\n\ntype OpenApiSpecModule = { default: OpenAPISpec } | OpenAPISpec\n\ntype LoadedSpecState = {\n loader?: () => Promise<OpenApiSpecModule>\n spec: OpenAPISpec | null\n}\n\nfunction isOpenApiSpecLoader(value: unknown): value is () => Promise<OpenApiSpecModule> {\n return typeof value === 'function'\n}\n\nfunction getLoadedSpec(value: OpenApiSpecModule): OpenAPISpec {\n return value && typeof value === 'object' && 'default' in value\n ? value.default\n : value\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\n/**\n * Prefer a locale-qualified registry key for absolute specPath values, then\n * fall back to the normalized key. The CLI registers visible route aliases,\n * while relative paths already resolve through the current localized route.\n */\nfunction specModuleCandidates(moduleId: string, specPath: string, locale: string | undefined): string[] {\n const candidates: string[] = []\n if (locale && specPath.startsWith('/') && !specPath.startsWith(VIRTUAL_PREFIX)) {\n const rest = moduleId.slice(VIRTUAL_PREFIX.length)\n if (!rest.startsWith(`${locale}/`) && rest !== locale) candidates.push(`${VIRTUAL_PREFIX}${locale}/${rest}`)\n }\n candidates.push(moduleId)\n return candidates\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenApiSpecResult {\n const config = useConfig()\n const locale = useLocale()\n const specs = useOpenApiSpecs()\n const location = useLocation()\n const [loadedSpec, setLoadedSpec] = useState<LoadedSpecState>({ spec: null })\n const normalized = specPath ? normalizeSpecPath(specPath, location.pathname, config.routePrefix) : undefined\n const candidates = specPath && normalized ? specModuleCandidates(normalized, specPath, locale) : []\n const registryValue = candidates.map(candidate => specs[candidate]).find(Boolean)\n\n useEffect(() => {\n let cancelled = false\n\n if (!isOpenApiSpecLoader(registryValue)) return\n\n registryValue().then(module => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: getLoadedSpec(module) })\n }).catch(() => {\n if (!cancelled) setLoadedSpec({ loader: registryValue, spec: null })\n })\n\n return () => {\n cancelled = true\n }\n }, [registryValue])\n\n if (spec) return { spec, loading: false }\n if (!specPath) return { spec: null, loading: false }\n if (isOpenApiSpecLoader(registryValue)) {\n return loadedSpec.loader === registryValue\n ? { spec: loadedSpec.spec, loading: false }\n : { spec: null, loading: true }\n }\n return { spec: registryValue ?? null, loading: false }\n}\n","import type { ReactNode } from 'react'\n\nimport { PageActions } from '../app/PageActions'\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { OpenApiRequestWorkbench } from './components/OpenApiRequest'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperationEntryById, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec; tagFilter?: string[]; operationOrder?: string[] }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n tagFilter?: string[]\n operationOrder?: string[]\n}\n\nexport type OpenApiRouteData = {\n spec: OpenAPISpec\n operationOrder?: string[]\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n operationId: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n operationId: string\n}\n\nexport type OpenApiRequestProps = OpenApiOperationProps & {\n requestExample?: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"clarify-openapi-header mb-16 border-b border-(--clarify-theme-tokens-colors-border) pb-8\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-(--clarify-ui-accent-text) uppercase\">\n {t('openapi.openApiReference')}\n </p>\n <h1 className=\"clarify-page-title\">{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead mt-4 *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"mt-4 text-sm text-(--clarify-ui-text-faint)\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction operationMatchesTags(operationTags: string[] | undefined, filterTags: string[] | undefined): boolean {\n if (!filterTags?.length) return true\n return operationTags?.some(tag => filterTags.includes(tag)) ?? false\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec, tagFilter, operationOrder } = arg0\n\n const entries = listOpenApiOperations(spec, operationOrder)\n .filter(({ operation }) => operationMatchesTags(operation.tags, tagFilter))\n .map(({ path, method, operation, source }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n source,\n }))\n\n return (\n <div className=\"clarify-openai-endpoints divide-y divide-zinc-200/70 dark:divide-white/10\">\n {entries.map(({ path, method, operation, source }) => (\n <OpenApiOperationComponent key={`${source}-${method}-${path}`} spec={spec} path={path} method={method} operation={operation} operationSource={source} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200'\n : 'rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath, tagFilter, operationOrder } = arg0\n const t = useBuiltInText()\n const { spec: resolved, loading } = useOpenApiSpec(spec, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page relative flex h-full flex-col pt-16 pb-10\">\n <div className=\"clarify-page-actions mb-4 flex justify-end sm:absolute sm:top-16 sm:right-0 sm:mb-0\">\n <PageActions />\n </div>\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} tagFilter={tagFilter} operationOrder={operationOrder} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, operationId } = arg0\n const t = useBuiltInText()\n const entry = getOpenApiOperationEntryById(spec, operationId)\n\n if (!entry) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n }\n\n const normalizedMethod = entry.method.toUpperCase()\n return <OpenApiOperationComponent key={`${entry.source}-${normalizedMethod}-${entry.path}`} spec={spec} path={entry.path} method={normalizedMethod} operation={entry.operation} operationSource={entry.source} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, operationId } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) {\n return <WarningBox>{t('openapi.loading')}</WarningBox>\n }\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} operationId={operationId} />\n}\n\nexport function OpenApiRequest(arg0: OpenApiRequestProps): ReactNode {\n const { specPath, operationId, requestExample } = arg0\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <WarningBox>{t('openapi.loading')}</WarningBox>\n if (!spec) return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n\n const entry = getOpenApiOperationEntryById(spec, operationId)\n if (!entry) return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: operationId })}</WarningBox>\n\n return (\n <OpenApiRequestWorkbench\n spec={spec}\n path={entry.path}\n method={entry.method.toUpperCase()}\n operation={entry.operation}\n operationSource={entry.source}\n requestExample={requestExample}\n />\n )\n}\n\nexport function createOpenApiRouteComponent(data: OpenApiRouteData) {\n return function OpenApiRoutePage() {\n return <OpenApiDocument spec={data.spec} operationOrder={data.operationOrder} />\n }\n}\n","import clsx from 'clsx'\nimport { ArrowRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { LocalizedLink } from '../../components/LocalizedLink'\nimport { useConfig, useLocale } from '../../core/context'\nimport { useBuiltInText } from '../../core/i18n'\nimport { localizeHref } from '../../utils/href'\nimport { useOpenApiSpec } from '../lib/spec-path'\nimport { getOpenApiOperationEntryById, getOpenApiOperationSectionId } from '../lib/utils'\n\nimport { EndpointMethodBadge } from './EndpointMethodBadge'\n\nexport type OpenApiLinkProps = {\n specPath: string\n operationId: string\n href?: string\n inline?: boolean\n className?: string\n}\n\ntype OpenApiLinkViewProps = {\n href: string\n method: string\n path: string\n label: string\n className?: string\n}\n\nexport function OpenApiLink(arg0: OpenApiLinkProps): ReactNode {\n const { specPath, operationId, href: hrefOverride, inline = false, className } = arg0\n const config = useConfig()\n const locale = useLocale()\n const t = useBuiltInText()\n const { spec, loading } = useOpenApiSpec(undefined, specPath)\n\n if (loading) return <span className={className}>{t('openapi.loading')}</span>\n\n const entry = spec ? getOpenApiOperationEntryById(spec, operationId) : undefined\n if (!entry) return <span className={className}>{t('openapi.endpointNotFound', { endpoint: operationId })}</span>\n\n const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId\n const targetPath = hrefOverride ?? specPath\n const href = `${localizeHref(targetPath, config, locale)}#${sectionId}`\n const method = entry.method.toUpperCase()\n const title = entry.operation.summary?.trim() || ''\n\n if (inline) return <OpenApiLinkInline href={href} method={method} path={entry.path} label={title || entry.path} className={className} />\n return <OpenApiLinkBlock href={href} method={method} path={entry.path} label={title} className={className} />\n}\n\nfunction OpenApiLinkInline(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link clarify-openapi-link-inline not-prose inline-flex max-w-full items-center gap-1.5 rounded-md bg-(--clarify-ui-active-background) py-px pr-1.5 pl-px align-[0.125em] text-(--clarify-theme-tokens-colors-foreground) no-underline transition-colors hover:bg-(--clarify-ui-accent-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n aria-label={`${method}: ${label}`}\n >\n <EndpointMethodBadge method={method} compact />\n <span className=\"truncate text-[0.8125rem]/5 font-medium\">{label}</span>\n </LocalizedLink>\n )\n}\n\nfunction OpenApiLinkBlock(arg0: OpenApiLinkViewProps): ReactNode {\n const { href, method, path, label, className } = arg0\n\n return (\n <LocalizedLink\n href={href}\n className={clsx(\n 'clarify-openapi-link not-prose group flex w-full items-center gap-3 rounded-lg border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 py-3 no-underline transition-colors hover:border-(--clarify-ui-accent-border) hover:bg-(--clarify-ui-hover-background) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary) focus-visible:ring-offset-2',\n className,\n )}\n >\n <EndpointMethodBadge method={method} />\n <span className=\"min-w-0 flex-1\">\n <code className=\"block truncate bg-transparent p-0 font-mono text-sm/6 font-semibold text-(--clarify-theme-tokens-colors-foreground)\">{path}</code>\n {label ? <span className=\"mt-0.5 block truncate text-xs/5 text-(--clarify-ui-text-faint)\">{label}</span> : null}\n </span>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-md text-(--clarify-ui-text-faint) transition-colors group-hover:bg-(--clarify-theme-tokens-colors-surface) group-hover:text-(--clarify-ui-accent-text)\">\n <ArrowRight aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </LocalizedLink>\n )\n}\n","import { Collapse } from '../components/Collapse'\nimport { Mermaid } from '../components/Mermaid'\nimport { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Collapse,\n Mermaid,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiLink,\n OpenApiRequest,\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-(--clarify-theme-tokens-colors-background) px-6 py-10 text-(--clarify-theme-tokens-colors-foreground) md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-(--clarify-ui-text-soft)\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,uBAAuB,QAAqC;CACnE,MAAM,EAAE,SAAS;CAOjB,MAAM,YAAY;EALhB,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT,cAAc;CAEE,EAAW,KAAK;CAClC,MAAM,eAAe,KAAK,SAAS,kBAAkB,KAAK,SAAS,aAAa,oBAAoB;CAGpG,OACE,oBAAC,kBAAD;EACE,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,SAAQ;EACR,UAAU,CACR;GAAE,OAAO;GAAW,OAAO,KAAK,YAAY;EAAU,GACtD;GAAE,OAAO;GAA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/D,MAAM,EAAE,MAAM,QAAQ,MAAM,OAAO,cAAc;CAEjD,OACE,qBAAC,eAAD;EACQ;EACN,WAAW,KACT,qbACA,SACF;YALF;GAOE,oBAAC,qBAAD,EAA6B,OAAS,CAAA;GACtC,qBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,oBAAC,QAAD;KAAM,WAAU;eAAuH;IAAW,CAAA,GACjJ,QAAQ,oBAAC,QAAD;KAAM,WAAU;eAAkE;IAAY,CAAA,IAAI,IACvG;;GACN,oBAAC,QAAD;IAAM,WAAU;cACd,oBAAC,YAAD;KAAY,eAAY;KAAO,WAAU;IAAU,CAAA;GAC/C,CAAA;EACO;;AAEnB;;;ACpFA,IAAM,uBAAuB;CAC3B,GAAG;CACH;CACA;AACF;AAEA,IAAM,2BAA2B;CAC/B;CACA;CACA;CACA;AACF;AAEA,SAAgB,iBAAiB,aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,oBAAC,QAAD;EAAM,WAAU;YACd,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,oBAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,oBAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,oBAAC,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
@@ -4,9 +4,11 @@ export type OpenApiDocumentProps = {
4
4
  spec?: OpenAPISpec;
5
5
  specPath?: string;
6
6
  tagFilter?: string[];
7
+ operationOrder?: string[];
7
8
  };
8
9
  export type OpenApiRouteData = {
9
10
  spec: OpenAPISpec;
11
+ operationOrder?: string[];
10
12
  };
11
13
  export type OpenApiOperationProps = {
12
14
  specPath: string;
@@ -16,4 +16,4 @@ export declare function isOpenAPIHttpMethod(method: string): method is OpenAPIHt
16
16
  export declare function getOpenApiOperation(spec: OpenAPISpec, path: string, method: string): OpenAPIOperation | undefined;
17
17
  export declare function getOpenApiOperationEntry(spec: OpenAPISpec, path: string, method: string, source?: OpenAPIOperationSource): OpenAPIOperationEntry | undefined;
18
18
  export declare function getOpenApiOperationEntryById(spec: OpenAPISpec, operationId: string): OpenAPIOperationEntry | undefined;
19
- export declare function listOpenApiOperations(spec: OpenAPISpec): OpenAPIOperationEntry[];
19
+ export declare function listOpenApiOperations(spec: OpenAPISpec, operationOrder?: string[]): OpenAPIOperationEntry[];
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_i18n = require("./i18n-BMNCgF9o.cjs");
3
3
  const require_PageActions = require("./PageActions-CwJLUFUH.cjs");
4
- const require_OpenApiOperation = require("./OpenApiOperation-XH6b7ntf.cjs");
4
+ const require_OpenApiOperation = require("./OpenApiOperation-Cv4N92VL.cjs");
5
5
  let react = require("react");
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
7
  let lucide_react = require("lucide-react");
package/output/preview.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ResponseExamplesPanel, c as getAuthOptions, g as getRequestBody, h as getMediaTypeEntries, i as RequestExamplesPanel, l as getServerKey, o as authPlaceholder, s as defaultServerVariables, t as EndpointIdentity, u as getServers } from "./OpenApiOperation-hxX828Il.js";
1
+ import { a as ResponseExamplesPanel, c as getAuthOptions, g as getRequestBody, h as getMediaTypeEntries, i as RequestExamplesPanel, l as getServerKey, o as authPlaceholder, s as defaultServerVariables, t as EndpointIdentity, u as getServers } from "./OpenApiOperation-B68CqUJW.js";
2
2
  import { i as OpenApiSpecsContext, n as ConfigProvider, r as LocaleContext } from "./i18n-Zmmhz7FF.js";
3
3
  import { a as Navigation, o as SectionProvider } from "./PageActions-BszP_J4e.js";
4
4
  import { useState } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clarify-labs/renderer",
3
- "version": "0.11.18",
3
+ "version": "0.11.20",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "repository": {