@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.
- package/output/{ClarifyShell-CKvXZj0f.js → ClarifyShell-CGoRrkn1.js} +120 -68
- package/output/ClarifyShell-CGoRrkn1.js.map +1 -0
- package/output/{ClarifyShell-CukbPOAd.cjs → ClarifyShell-D8OGIUWq.cjs} +120 -68
- package/output/ClarifyShell-D8OGIUWq.cjs.map +1 -0
- package/output/{MermaidViewer-FOg263MO.cjs → MermaidViewer-CFqy0BnO.cjs} +3 -3
- package/output/{MermaidViewer-FOg263MO.cjs.map → MermaidViewer-CFqy0BnO.cjs.map} +1 -1
- package/output/{MermaidViewer-_tpH0JNn.js → MermaidViewer-TdU3sRfy.js} +3 -3
- package/output/{MermaidViewer-_tpH0JNn.js.map → MermaidViewer-TdU3sRfy.js.map} +1 -1
- package/output/{OpenApiOperation-c-I6Nw9j.cjs → OpenApiOperation-Bd68uxXq.cjs} +9 -8
- package/output/{OpenApiOperation-c-I6Nw9j.cjs.map → OpenApiOperation-Bd68uxXq.cjs.map} +1 -1
- package/output/{OpenApiOperation-Dv9u2GEJ.js → OpenApiOperation-vCuIKI4O.js} +9 -8
- package/output/{OpenApiOperation-Dv9u2GEJ.js.map → OpenApiOperation-vCuIKI4O.js.map} +1 -1
- package/output/{PageActions-DviEypf6.js → PageActions-CqXr0SyW.js} +112 -75
- package/output/PageActions-CqXr0SyW.js.map +1 -0
- package/output/{PageActions-ob2OJusG.cjs → PageActions-DPYXFL6N.cjs} +117 -74
- package/output/PageActions-DPYXFL6N.cjs.map +1 -0
- package/output/{SearchDialog-89JAjQMh.js → SearchDialog-BQcbGNvl.js} +29 -20
- package/output/SearchDialog-BQcbGNvl.js.map +1 -0
- package/output/{SearchDialog-CTiUIKeo.cjs → SearchDialog-CExM6Bxd.cjs} +29 -20
- package/output/SearchDialog-CExM6Bxd.cjs.map +1 -0
- package/output/app/AppShell.d.ts +1 -2
- package/output/app/BuiltInNotFoundPage.d.ts +1 -0
- package/output/app/PageActions.d.ts +0 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/context.d.ts +2 -1
- package/output/core/context.d.ts +9 -0
- package/output/core/types.d.ts +4 -0
- package/output/{i18n-Cff810G_.js → i18n-D4O3z-sP.js} +24 -3
- package/output/i18n-D4O3z-sP.js.map +1 -0
- package/output/{i18n-Cjfk1N7i.cjs → i18n-Dw4Jlho-.cjs} +36 -3
- package/output/i18n-Dw4Jlho-.cjs.map +1 -0
- package/output/index.cjs +11 -7
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +3 -2
- package/output/index.js +8 -8
- package/output/index.js.map +1 -1
- package/output/preview.cjs +6 -6
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +6 -6
- package/output/preview.js.map +1 -1
- package/output/{render-BxiVlY6q.cjs → render-CqBz1q82.cjs} +2 -2
- package/output/{render-BxiVlY6q.cjs.map → render-CqBz1q82.cjs.map} +1 -1
- package/output/{render-B41PHjt8.js → render-DQRifjrn.js} +2 -2
- package/output/{render-B41PHjt8.js.map → render-DQRifjrn.js.map} +1 -1
- package/output/renderer.css +4 -0
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/output/shell/ContentActions.d.ts +0 -1
- package/output/shell/Header.d.ts +1 -2
- package/output/shell/Search.d.ts +3 -6
- package/output/shell/mobile.d.ts +1 -2
- package/output/shell/search/SearchDialog.d.ts +2 -1
- package/output/shell/search/pagefind.d.ts +3 -2
- package/output/theme/ThemeRoot.d.ts +0 -2
- package/output/theme/randomTheme.d.ts +2 -1
- package/output/utils/href.d.ts +2 -0
- package/package.json +1 -1
- package/output/ClarifyShell-CKvXZj0f.js.map +0 -1
- package/output/ClarifyShell-CukbPOAd.cjs.map +0 -1
- package/output/PageActions-DviEypf6.js.map +0 -1
- package/output/PageActions-ob2OJusG.cjs.map +0 -1
- package/output/SearchDialog-89JAjQMh.js.map +0 -1
- package/output/SearchDialog-CTiUIKeo.cjs.map +0 -1
- package/output/i18n-Cff810G_.js.map +0 -1
- package/output/i18n-Cjfk1N7i.cjs.map +0 -1
package/output/index.cjs.map
CHANGED
|
@@ -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, prefixHref } 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 = `${prefixHref(localizeHref(targetPath, config, locale), config.routePrefix)}#${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,OAAD;GAAK,WAAU;aACZ,KAAK;EACH,CAAA,IACH;CACL,CAAA;AAEL;AAEA,SAAgB,iCAAiC,MAAwC;CACvF,OAAO,SAAS,6BAA6B;EAC3C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAD,EAA8B,KAAO,CAAA;CAC9C;AACF;;;AClCA,SAAS,oBAAoB,OAA2D;CACtF,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,cAAc,OAAuC;CAC5D,OAAO,SAAS,OAAO,UAAU,YAAY,aAAa,QACtD,MAAM,UACN;AACN;AAEA,IAAM,iBAAiB;AAEvB,SAAS,oBAAoB,SAAiB,IAAoB;CAChE,MAAM,SAAS,UAAU,MAAM,GAAA,CAAI,MAAM,GAAG,CAAC,CAAC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ACH,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[] }\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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
@@ -5,7 +5,7 @@ import { PageBanner } from './app/PageBanner';
|
|
|
5
5
|
import { PageFooter } from './app/PageFooter';
|
|
6
6
|
import { SectionProvider, useSectionStore, Section } from './app/SectionProvider';
|
|
7
7
|
import { Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, Feedback, GridPattern, Heading, HeroPattern, Logo, Mermaid, Pre, Prose, Step, Steps, Tab, Tabs, Tag, WebFrame } from './components';
|
|
8
|
-
import { OpenApiSpecsContext, useOpenApiSpecs } from './context';
|
|
8
|
+
import { ConfigProvider, OpenApiSpecsContext, useConfig, useConfigUpdater, useConfigUpdaterOptional, useOpenApiSpecs } from './context';
|
|
9
9
|
import { useMDXComponents } from './mdx/components';
|
|
10
10
|
import { DocShell } from './mdx/DocShell';
|
|
11
11
|
import { markdownRemarkPlugins, parseCodeMeta } from './mdx/remark';
|
|
@@ -19,12 +19,13 @@ import { themePresets, themeBootstrapScript } from './theme/variables';
|
|
|
19
19
|
import { Config, RouteItem, RouteSection, RenderOptions, ServerRenderOptions } from './types';
|
|
20
20
|
import { remToPx } from './utils/remToPx';
|
|
21
21
|
export type { OpenApiRequestProps, OpenApiOperationProps, OpenApiDocumentProps, OpenApiLinkProps, OpenAPIOperation, OpenAPISpec, OpenApiRouteData } from './openapi';
|
|
22
|
+
export type { ConfigProviderProps, ConfigUpdater } from './context';
|
|
22
23
|
export type { ThemeEditorProps } from './theme/ThemeEditor';
|
|
23
24
|
export type { StepProps, StepsProps, TabItem, TabProps, TabsProps } from './components';
|
|
24
25
|
export type { ContentDiagnostic, ContentDiagnosticKind };
|
|
25
26
|
export type { Config, RouteItem, RouteSection, RenderOptions, ServerRenderOptions, Section };
|
|
26
27
|
export type { RuntimeSlotEntry, RuntimeSlotRegistry, UISlotRegistration, UISlotName, UISlotContext } from './slots';
|
|
27
|
-
export { AppShell, render, OpenApiSpecsContext, useOpenApiSpecs, BuiltWithClarify, PageBanner, PageFooter, ThemeProvider, ThemeToggle, ThemeEditor, useTheme, SectionProvider, useSectionStore, remToPx, applyThemeVariables, themeEditorPresets, themePresets, themeBootstrapScript, createContentDiagnosticComponent, createOpenApiRouteComponent };
|
|
28
|
+
export { AppShell, render, ConfigProvider, OpenApiSpecsContext, useConfig, useConfigUpdater, useConfigUpdaterOptional, useOpenApiSpecs, BuiltWithClarify, PageBanner, PageFooter, ThemeProvider, ThemeToggle, ThemeEditor, useTheme, SectionProvider, useSectionStore, remToPx, applyThemeVariables, themeEditorPresets, themePresets, themeBootstrapScript, createContentDiagnosticComponent, createOpenApiRouteComponent };
|
|
28
29
|
export { Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, Pre, Prose, Heading, Logo, Mermaid, GridPattern, HeroPattern, Feedback, Step, Steps, Tab, Tabs, Tag, WebFrame };
|
|
29
30
|
export { DocShell, useMDXComponents, markdownRemarkPlugins, parseCodeMeta };
|
|
30
31
|
export { SlotProvider, RuntimeSlot, RuntimeSlotsProvider, useSlot };
|
package/output/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as Feedback, B as LocalizedLink, C as Steps, D as Logo, E as HeroPattern, F as Mermaid, I as Card, L as CardGroup, M as Code, N as CodeGroup, O as Heading, P as Pre, R as Callout, S as Step, T as GridPattern, _ as Markdown, b as TabItem, d as EndpointMethodBadge, f as getOpenApiOperationEntryById, j as Collapse, k as Tag, m as listOpenApiOperations, n as OpenApiOperation$1, p as getOpenApiOperationSectionId, r as OpenApiRequestWorkbench, v as primitives_exports, w as Prose, x as Tabs, y as WebFrame, z as Button } from "./OpenApiOperation-
|
|
2
|
-
import { a as useConfig, c as
|
|
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-
|
|
4
|
-
import {
|
|
1
|
+
import { A as Feedback, B as LocalizedLink, C as Steps, D as Logo, E as HeroPattern, F as Mermaid, I as Card, L as CardGroup, M as Code, N as CodeGroup, O as Heading, P as Pre, R as Callout, S as Step, T as GridPattern, _ as Markdown, b as TabItem, d as EndpointMethodBadge, f as getOpenApiOperationEntryById, j as Collapse, k as Tag, m as listOpenApiOperations, n as OpenApiOperation$1, p as getOpenApiOperationSectionId, r as OpenApiRequestWorkbench, v as primitives_exports, w as Prose, x as Tabs, y as WebFrame, z as Button } from "./OpenApiOperation-vCuIKI4O.js";
|
|
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-D4O3z-sP.js";
|
|
3
|
+
import { a as themeBootstrapScript, c as AppShell, d as RenderErrorPanel, f as BuiltWithClarify, g as useSlot, h as SlotProvider, i as themeEditorPresets, l as PageFooter, m as RuntimeSlotsProvider, n as ThemeEditor, o as themePresets, p as RuntimeSlot, r as applyThemeVariables, u as PageBanner } from "./ClarifyShell-CGoRrkn1.js";
|
|
4
|
+
import { a as SectionProvider, h as useTheme, m as ThemeProvider, o as useSectionStore, p as ThemeToggle, s as remToPx, t as PageActions, w as localizeHref } from "./PageActions-CqXr0SyW.js";
|
|
5
5
|
import { n as parseCodeMeta, t as markdownRemarkPlugins } from "./remark-C9iRQM0R.js";
|
|
6
|
-
import { t as render } from "./render-
|
|
6
|
+
import { t as render } from "./render-DQRifjrn.js";
|
|
7
7
|
import clsx from "clsx";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
9
|
import { useLocation } from "react-router-dom";
|
|
10
|
-
import { ArrowRight } from "lucide-react";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { ArrowRight } from "lucide-react";
|
|
12
12
|
//#region source/app/ContentDiagnostic.tsx
|
|
13
13
|
function ContentDiagnosticPanel(params) {
|
|
14
14
|
const { data } = params;
|
|
@@ -273,7 +273,7 @@ function OpenApiLink(arg0) {
|
|
|
273
273
|
children: t("openapi.endpointNotFound", { endpoint: operationId })
|
|
274
274
|
});
|
|
275
275
|
const sectionId = getOpenApiOperationSectionId(entry.operation) || operationId;
|
|
276
|
-
const href = `${
|
|
276
|
+
const href = `${localizeHref(hrefOverride ?? specPath, config, locale)}#${sectionId}`;
|
|
277
277
|
const method = entry.method.toUpperCase();
|
|
278
278
|
const title = entry.operation.summary?.trim() || "";
|
|
279
279
|
if (inline) return /* @__PURE__ */ jsx(OpenApiLinkInline, {
|
|
@@ -375,6 +375,6 @@ function DocShell(arg0) {
|
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
377
|
//#endregion
|
|
378
|
-
export { AppShell, BuiltWithClarify, Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, DocShell, Feedback, GridPattern, Heading, HeroPattern, Logo, Mermaid, OpenApiDocument, OpenApiLink, OpenApiOperation, OpenApiRequest, OpenApiSpecsContext, PageBanner, PageFooter, Pre, Prose, RuntimeSlot, RuntimeSlotsProvider, SectionProvider, SlotProvider, Step, Steps, TabItem as Tab, Tabs, Tag, ThemeEditor, ThemeProvider, ThemeToggle, WebFrame, applyThemeVariables, createContentDiagnosticComponent, createOpenApiRouteComponent, markdownRemarkPlugins, parseCodeMeta, remToPx, render, themeBootstrapScript, themeEditorPresets, themePresets, useMDXComponents, useOpenApiSpecs, useSectionStore, useSlot, useTheme };
|
|
378
|
+
export { AppShell, BuiltWithClarify, Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, ConfigProvider, DocShell, Feedback, GridPattern, Heading, HeroPattern, Logo, Mermaid, OpenApiDocument, OpenApiLink, OpenApiOperation, OpenApiRequest, OpenApiSpecsContext, PageBanner, PageFooter, Pre, Prose, RuntimeSlot, RuntimeSlotsProvider, SectionProvider, SlotProvider, Step, Steps, TabItem as Tab, Tabs, Tag, ThemeEditor, ThemeProvider, ThemeToggle, WebFrame, applyThemeVariables, createContentDiagnosticComponent, createOpenApiRouteComponent, markdownRemarkPlugins, parseCodeMeta, remToPx, render, themeBootstrapScript, themeEditorPresets, themePresets, useConfig, useConfigUpdater, useConfigUpdaterOptional, useMDXComponents, useOpenApiSpecs, useSectionStore, useSlot, useTheme };
|
|
379
379
|
|
|
380
380
|
//# sourceMappingURL=index.js.map
|
package/output/index.js.map
CHANGED
|
@@ -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, prefixHref } 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 = `${prefixHref(localizeHref(targetPath, config, locale), config.routePrefix)}#${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,oBAAoB,OAA2D;CACtF,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,cAAc,OAAuC;CAC5D,OAAO,SAAS,OAAO,UAAU,YAAY,aAAa,QACtD,MAAM,UACN;AACN;AAEA,IAAM,iBAAiB;AAEvB,SAAS,oBAAoB,SAAiB,IAAoB;CAChE,MAAM,SAAS,UAAU,MAAM,GAAA,CAAI,MAAM,GAAG,CAAC,CAAC,OAA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aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACfA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,oBAAC,QAAD;EAAM,WAAU;YACd,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,oBAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,oBAAC,KAAD;KAAG,WAAU;eAAgD;IAAY,CAAA,IAAI,IACnF;OACR,oBAAC,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
|
|
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,oBAAoB,OAA2D;CACtF,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,cAAc,OAAuC;CAC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AU;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"}
|
package/output/preview.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
3
|
-
const require_PageActions = require("./PageActions-
|
|
4
|
-
const require_OpenApiOperation = require("./OpenApiOperation-
|
|
2
|
+
const require_i18n = require("./i18n-Dw4Jlho-.cjs");
|
|
3
|
+
const require_PageActions = require("./PageActions-DPYXFL6N.cjs");
|
|
4
|
+
const require_OpenApiOperation = require("./OpenApiOperation-Bd68uxXq.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
|
-
let lucide_react = require("lucide-react");
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let lucide_react = require("lucide-react");
|
|
8
8
|
//#region source/preview/openapi.tsx
|
|
9
9
|
function usePreviewRequestState(arg0) {
|
|
10
10
|
const { spec, operation } = arg0;
|
|
@@ -449,8 +449,8 @@ var mainPreviewSections = [{
|
|
|
449
449
|
}];
|
|
450
450
|
function PreviewEnvironment(arg0) {
|
|
451
451
|
const { children, sections = [] } = arg0;
|
|
452
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_i18n.
|
|
453
|
-
|
|
452
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_i18n.ConfigProvider, {
|
|
453
|
+
config: previewConfig,
|
|
454
454
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_i18n.LocaleContext.Provider, {
|
|
455
455
|
value: previewConfig.locales.default,
|
|
456
456
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_i18n.OpenApiSpecsContext.Provider, {
|