@clarify-labs/renderer 0.11.9 → 0.11.11
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-nV23Fn7m.js → ClarifyShell-DGm_R5Bp.js} +33 -13
- package/output/ClarifyShell-DGm_R5Bp.js.map +1 -0
- package/output/{ClarifyShell-GCXbb_AF.cjs → ClarifyShell-DLOGS18o.cjs} +33 -13
- package/output/ClarifyShell-DLOGS18o.cjs.map +1 -0
- package/output/{MermaidViewer-DEKNDG7K.cjs → MermaidViewer-BRR8SGnK.cjs} +2 -2
- package/output/{MermaidViewer-DEKNDG7K.cjs.map → MermaidViewer-BRR8SGnK.cjs.map} +1 -1
- package/output/{MermaidViewer-Ssxr00dy.js → MermaidViewer-CSbKX396.js} +2 -2
- package/output/{MermaidViewer-Ssxr00dy.js.map → MermaidViewer-CSbKX396.js.map} +1 -1
- package/output/{OpenApiOperation-DIgbzvk5.cjs → OpenApiOperation-416zAKci.cjs} +80 -12
- package/output/OpenApiOperation-416zAKci.cjs.map +1 -0
- package/output/{OpenApiOperation-B26v2y44.js → OpenApiOperation-bY3wbaJC.js} +70 -14
- package/output/OpenApiOperation-bY3wbaJC.js.map +1 -0
- package/output/{PageActions-DxGK-444.cjs → PageActions-CVOTIuxh.cjs} +198 -80
- package/output/PageActions-CVOTIuxh.cjs.map +1 -0
- package/output/{PageActions-BbmyFeSk.js → PageActions-D52u18C8.js} +194 -82
- package/output/PageActions-D52u18C8.js.map +1 -0
- package/output/{SearchDialog-DexOW8E4.cjs → SearchDialog--OLp05za.cjs} +3 -3
- package/output/{SearchDialog-DexOW8E4.cjs.map → SearchDialog--OLp05za.cjs.map} +1 -1
- package/output/{SearchDialog-4oEbmVMR.js → SearchDialog-Cq7w-uc7.js} +3 -3
- package/output/{SearchDialog-4oEbmVMR.js.map → SearchDialog-Cq7w-uc7.js.map} +1 -1
- package/output/app/AppShell.d.ts +2 -1
- package/output/app/PageActions.d.ts +6 -0
- package/output/app/PageUpdatedAt.d.ts +6 -0
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/core/types.d.ts +21 -5
- package/output/{i18n-BuvwT5W9.cjs → i18n-BMNCgF9o.cjs} +2 -2
- package/output/{i18n-BuvwT5W9.cjs.map → i18n-BMNCgF9o.cjs.map} +1 -1
- package/output/{i18n-C6tIP-nl.js → i18n-Zmmhz7FF.js} +2 -2
- package/output/{i18n-C6tIP-nl.js.map → i18n-Zmmhz7FF.js.map} +1 -1
- package/output/index.cjs +7 -5
- package/output/index.d.ts +2 -1
- package/output/index.js +6 -6
- package/output/mdx/components.d.ts +9 -0
- package/output/mdx/primitives.d.ts +11 -0
- package/output/preview.cjs +3 -3
- package/output/preview.js +3 -3
- package/output/{render-CAtVGsQF.js → render-D_QvIv7Z.js} +2 -2
- package/output/{render-CAtVGsQF.js.map → render-D_QvIv7Z.js.map} +1 -1
- package/output/{render-D8h-jcnw.cjs → render-TErh9x_2.cjs} +2 -2
- package/output/{render-D8h-jcnw.cjs.map → render-TErh9x_2.cjs.map} +1 -1
- package/output/renderer.css +86 -0
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/ClarifyShell-GCXbb_AF.cjs.map +0 -1
- package/output/ClarifyShell-nV23Fn7m.js.map +0 -1
- package/output/OpenApiOperation-B26v2y44.js.map +0 -1
- package/output/OpenApiOperation-DIgbzvk5.cjs.map +0 -1
- package/output/PageActions-BbmyFeSk.js.map +0 -1
- package/output/PageActions-DxGK-444.cjs.map +0 -1
package/output/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
3
|
-
const require_i18n = require("./i18n-
|
|
4
|
-
const require_ClarifyShell = require("./ClarifyShell-
|
|
5
|
-
const require_PageActions = require("./PageActions-
|
|
6
|
-
const require_OpenApiOperation = require("./OpenApiOperation-
|
|
3
|
+
const require_i18n = require("./i18n-BMNCgF9o.cjs");
|
|
4
|
+
const require_ClarifyShell = require("./ClarifyShell-DLOGS18o.cjs");
|
|
5
|
+
const require_PageActions = require("./PageActions-CVOTIuxh.cjs");
|
|
6
|
+
const require_OpenApiOperation = require("./OpenApiOperation-416zAKci.cjs");
|
|
7
7
|
const require_remark = require("./remark-DTLbG8PK.cjs");
|
|
8
|
-
const require_render = require("./render-
|
|
8
|
+
const require_render = require("./render-TErh9x_2.cjs");
|
|
9
9
|
let clsx = require("clsx");
|
|
10
10
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
11
11
|
let react = require("react");
|
|
@@ -404,6 +404,8 @@ exports.PageBanner = require_ClarifyShell.PageBanner;
|
|
|
404
404
|
exports.PageFooter = require_ClarifyShell.PageFooter;
|
|
405
405
|
exports.Pre = require_OpenApiOperation.Pre;
|
|
406
406
|
exports.Prose = require_OpenApiOperation.Prose;
|
|
407
|
+
exports.Release = require_OpenApiOperation.Release;
|
|
408
|
+
exports.ReleaseItem = require_OpenApiOperation.ReleaseItem;
|
|
407
409
|
exports.RuntimeSlot = require_ClarifyShell.RuntimeSlot;
|
|
408
410
|
exports.RuntimeSlotsProvider = require_ClarifyShell.RuntimeSlotsProvider;
|
|
409
411
|
exports.SectionProvider = require_PageActions.SectionProvider;
|
package/output/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, Feedback,
|
|
|
8
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
|
+
import { Release, ReleaseItem } from './mdx/primitives';
|
|
11
12
|
import { markdownRemarkPlugins, parseCodeMeta } from './mdx/remark';
|
|
12
13
|
import { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation, createOpenApiRouteComponent } from './openapi';
|
|
13
14
|
import { render } from './runtime/render';
|
|
@@ -26,7 +27,7 @@ export type { ContentDiagnostic, ContentDiagnosticKind };
|
|
|
26
27
|
export type { Config, RouteItem, RouteSection, RenderOptions, ServerRenderOptions, Section };
|
|
27
28
|
export type { RuntimeSlotEntry, RuntimeSlotRegistry, UISlotRegistration, UISlotName, UISlotContext } from './slots';
|
|
28
29
|
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 };
|
|
29
|
-
export { Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, Pre, Prose, Heading, Logo, Mermaid, GridPattern, HeroPattern, Feedback, Step, Steps, Tab, Tabs, Tag, WebFrame };
|
|
30
|
+
export { Button, Callout, Card, CardGroup, Code, CodeGroup, Collapse, Pre, Prose, Heading, Logo, Mermaid, GridPattern, HeroPattern, Feedback, Step, Steps, Tab, Tabs, Tag, WebFrame, Release, ReleaseItem };
|
|
30
31
|
export { DocShell, useMDXComponents, markdownRemarkPlugins, parseCodeMeta };
|
|
31
32
|
export { SlotProvider, RuntimeSlot, RuntimeSlotsProvider, useSlot };
|
|
32
33
|
export { OpenApiRequest, OpenApiDocument, OpenApiLink, OpenApiOperation };
|
package/output/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as
|
|
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-
|
|
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 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-bY3wbaJC.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-Zmmhz7FF.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-DGm_R5Bp.js";
|
|
4
|
+
import { T as localizeHref, c as remToPx, g as useTheme, h as ThemeProvider, m as ThemeToggle, o as SectionProvider, s as useSectionStore, t as PageActions } from "./PageActions-D52u18C8.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-D_QvIv7Z.js";
|
|
7
7
|
import clsx from "clsx";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
9
|
import { useLocation } from "react-router-dom";
|
|
@@ -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, 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 };
|
|
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, Release, ReleaseItem, 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
|
|
@@ -9,6 +9,15 @@ export declare function useMDXComponents(components?: Record<string, unknown>):
|
|
|
9
9
|
OpenApiOperation: typeof OpenApiOperation;
|
|
10
10
|
Collapse: typeof Collapse;
|
|
11
11
|
Mermaid: typeof Mermaid;
|
|
12
|
+
Release(arg0: {
|
|
13
|
+
version: string;
|
|
14
|
+
date?: string;
|
|
15
|
+
children: import('react').ReactNode;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
ReleaseItem(arg0: {
|
|
18
|
+
title: string;
|
|
19
|
+
children: import('react').ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
12
21
|
wrapper(arg0: {
|
|
13
22
|
children: import('react').ReactNode;
|
|
14
23
|
}): import("react").JSX.Element;
|
|
@@ -5,6 +5,17 @@ import { Image } from '../components/Image';
|
|
|
5
5
|
type WrapperProps = {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
};
|
|
8
|
+
type ReleaseProps = {
|
|
9
|
+
version: string;
|
|
10
|
+
date?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
type ReleaseItemProps = {
|
|
14
|
+
title: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export declare function Release(arg0: ReleaseProps): import("react").JSX.Element;
|
|
18
|
+
export declare function ReleaseItem(arg0: ReleaseItemProps): import("react").JSX.Element;
|
|
8
19
|
export declare function wrapper(arg0: WrapperProps): import("react").JSX.Element;
|
|
9
20
|
export declare function table(arg0: ComponentPropsWithoutRef<'table'>): import("react").JSX.Element;
|
|
10
21
|
export declare function a(arg0: ComponentPropsWithoutRef<'a'>): import("react").JSX.Element;
|
package/output/preview.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-BMNCgF9o.cjs");
|
|
3
|
+
const require_PageActions = require("./PageActions-CVOTIuxh.cjs");
|
|
4
|
+
const require_OpenApiOperation = require("./OpenApiOperation-416zAKci.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let lucide_react = require("lucide-react");
|
package/output/preview.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ResponseExamplesPanel, c as getAuthOptions, g as getRequestBody, h as getMediaTypeEntries, i as RequestExamplesPanel, l as getServerKey, o as authPlaceholder, s as defaultServerVariables, t as EndpointIdentity, u as getServers } from "./OpenApiOperation-
|
|
2
|
-
import { i as OpenApiSpecsContext, n as ConfigProvider, r as LocaleContext } from "./i18n-
|
|
3
|
-
import { a as
|
|
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-bY3wbaJC.js";
|
|
2
|
+
import { i as OpenApiSpecsContext, n as ConfigProvider, r as LocaleContext } from "./i18n-Zmmhz7FF.js";
|
|
3
|
+
import { a as Navigation, o as SectionProvider } from "./PageActions-D52u18C8.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Menu, X } from "lucide-react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ClarifyShell } from "./ClarifyShell-
|
|
1
|
+
import { t as ClarifyShell } from "./ClarifyShell-DGm_R5Bp.js";
|
|
2
2
|
import { StrictMode } from "react";
|
|
3
3
|
import { BrowserRouter } from "react-router-dom";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -56,4 +56,4 @@ function render(options) {
|
|
|
56
56
|
//#endregion
|
|
57
57
|
export { render as t };
|
|
58
58
|
|
|
59
|
-
//# sourceMappingURL=render-
|
|
59
|
+
//# sourceMappingURL=render-D_QvIv7Z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-
|
|
1
|
+
{"version":3,"file":"render-D_QvIv7Z.js","names":[],"sources":["../source/runtime/render.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { hydrateRoot, createRoot, type Root } from 'react-dom/client'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport type { RenderOptions } from '../types'\n\nimport { ClarifyShell } from './ClarifyShell'\n\nlet root: Root | undefined\n\n/**\n * Clarify 客户端 Hydration 入口。\n * 在文档项目的 main.tsx 中调用:\n * ```ts\n * import { render } from '@clarify-labs/renderer';\n * import { routes } from 'virtual:clarify/routes';\n * import { config } from 'virtual:clarify/config';\n * render({ config, routes });\n * ```\n */\nfunction isHydrationDebugEnabled(): boolean {\n if (typeof window === 'undefined') return false\n\n try {\n const params = new URLSearchParams(window.location.search)\n return params.get('clarifyHydrationDebug') === '1' || window.localStorage.getItem('clarify:hydration-debug') === '1'\n } catch {\n return false\n }\n}\n\nexport function render(options: RenderOptions) {\n const { config, routes, navigation, openApiSpecs = {}, runtimeSlots, container, themeEditor = false } = options\n\n const target = container ?? document.getElementById('root')\n if (!target) {\n throw new Error('[clarify] 渲染失败:找不到挂载节点,请确保 HTML 中存在 id=\"root\" 的元素')\n }\n\n const app = (\n <StrictMode>\n <BrowserRouter basename={config.routePrefix}>\n <ClarifyShell\n config={config}\n routes={routes}\n navigation={navigation}\n openApiSpecs={openApiSpecs}\n runtimeSlots={runtimeSlots}\n themeEditor={themeEditor}\n />\n </BrowserRouter>\n </StrictMode>\n )\n\n const hydrationDebug = isHydrationDebugEnabled()\n\n if (root) {\n root.render(app)\n return\n }\n\n try {\n root = hydrateRoot(target as Element, app, {\n onRecoverableError(error, errorInfo) {\n // Phase 1: suppress hydration mismatch noise by default. React 19\n // recovers automatically, but diagnostics can be enabled explicitly.\n if (hydrationDebug) {\n console.warn('[clarify] Recoverable hydration error:', error, errorInfo)\n }\n },\n })\n } catch (err) {\n console.warn('[clarify] Hydration failed, falling back to client render:', err)\n root = createRoot(target as Element)\n root.render(app)\n }\n}\n"],"mappings":";;;;;;AAQA,IAAI;;;;;;;;;;;AAYJ,SAAS,0BAAmC;CAC1C,IAAI,OAAO,WAAW,aAAa,OAAO;CAE1C,IAAI;EAEF,OAAO,IADY,gBAAgB,OAAO,SAAS,MAC5C,CAAA,CAAO,IAAI,uBAAuB,MAAM,OAAO,OAAO,aAAa,QAAQ,yBAAyB,MAAM;CACnH,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,OAAO,SAAwB;CAC7C,MAAM,EAAE,QAAQ,QAAQ,YAAY,eAAe,CAAC,GAAG,cAAc,WAAW,cAAc,UAAU;CAExG,MAAM,SAAS,aAAa,SAAS,eAAe,MAAM;CAC1D,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,qDAAmD;CAGrE,MAAM,MACJ,oBAAC,YAAD,EAAA,UACE,oBAAC,eAAD;EAAe,UAAU,OAAO;YAC9B,oBAAC,cAAD;GACU;GACA;GACI;GACE;GACA;GACD;EACd,CAAA;CACY,CAAA,EACL,CAAA;CAGd,MAAM,iBAAiB,wBAAwB;CAE/C,IAAI,MAAM;EACR,KAAK,OAAO,GAAG;EACf;CACF;CAEA,IAAI;EACF,OAAO,YAAY,QAAmB,KAAK,EACzC,mBAAmB,OAAO,WAAW;GAGnC,IAAI,gBACF,QAAQ,KAAK,0CAA0C,OAAO,SAAS;EAE3E,EACF,CAAC;CACH,SAAS,KAAK;EACZ,QAAQ,KAAK,8DAA8D,GAAG;EAC9E,OAAO,WAAW,MAAiB;EACnC,KAAK,OAAO,GAAG;CACjB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_ClarifyShell = require("./ClarifyShell-
|
|
1
|
+
const require_ClarifyShell = require("./ClarifyShell-DLOGS18o.cjs");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
let react_router_dom = require("react-router-dom");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -61,4 +61,4 @@ Object.defineProperty(exports, "render", {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=render-
|
|
64
|
+
//# sourceMappingURL=render-TErh9x_2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-
|
|
1
|
+
{"version":3,"file":"render-TErh9x_2.cjs","names":[],"sources":["../source/runtime/render.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { hydrateRoot, createRoot, type Root } from 'react-dom/client'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport type { RenderOptions } from '../types'\n\nimport { ClarifyShell } from './ClarifyShell'\n\nlet root: Root | undefined\n\n/**\n * Clarify 客户端 Hydration 入口。\n * 在文档项目的 main.tsx 中调用:\n * ```ts\n * import { render } from '@clarify-labs/renderer';\n * import { routes } from 'virtual:clarify/routes';\n * import { config } from 'virtual:clarify/config';\n * render({ config, routes });\n * ```\n */\nfunction isHydrationDebugEnabled(): boolean {\n if (typeof window === 'undefined') return false\n\n try {\n const params = new URLSearchParams(window.location.search)\n return params.get('clarifyHydrationDebug') === '1' || window.localStorage.getItem('clarify:hydration-debug') === '1'\n } catch {\n return false\n }\n}\n\nexport function render(options: RenderOptions) {\n const { config, routes, navigation, openApiSpecs = {}, runtimeSlots, container, themeEditor = false } = options\n\n const target = container ?? document.getElementById('root')\n if (!target) {\n throw new Error('[clarify] 渲染失败:找不到挂载节点,请确保 HTML 中存在 id=\"root\" 的元素')\n }\n\n const app = (\n <StrictMode>\n <BrowserRouter basename={config.routePrefix}>\n <ClarifyShell\n config={config}\n routes={routes}\n navigation={navigation}\n openApiSpecs={openApiSpecs}\n runtimeSlots={runtimeSlots}\n themeEditor={themeEditor}\n />\n </BrowserRouter>\n </StrictMode>\n )\n\n const hydrationDebug = isHydrationDebugEnabled()\n\n if (root) {\n root.render(app)\n return\n }\n\n try {\n root = hydrateRoot(target as Element, app, {\n onRecoverableError(error, errorInfo) {\n // Phase 1: suppress hydration mismatch noise by default. React 19\n // recovers automatically, but diagnostics can be enabled explicitly.\n if (hydrationDebug) {\n console.warn('[clarify] Recoverable hydration error:', error, errorInfo)\n }\n },\n })\n } catch (err) {\n console.warn('[clarify] Hydration failed, falling back to client render:', err)\n root = createRoot(target as Element)\n root.render(app)\n }\n}\n"],"mappings":";;;;;;AAQA,IAAI;;;;;;;;;;;AAYJ,SAAS,0BAAmC;CAC1C,IAAI,OAAO,WAAW,aAAa,OAAO;CAE1C,IAAI;EAEF,OAAO,IADY,gBAAgB,OAAO,SAAS,MAC5C,CAAA,CAAO,IAAI,uBAAuB,MAAM,OAAO,OAAO,aAAa,QAAQ,yBAAyB,MAAM;CACnH,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,OAAO,SAAwB;CAC7C,MAAM,EAAE,QAAQ,QAAQ,YAAY,eAAe,CAAC,GAAG,cAAc,WAAW,cAAc,UAAU;CAExG,MAAM,SAAS,aAAa,SAAS,eAAe,MAAM;CAC1D,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,qDAAmD;CAGrE,MAAM,MACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAA,YAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAA,eAAD;EAAe,UAAU,OAAO;YAC9B,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,cAAD;GACU;GACA;GACI;GACE;GACA;GACD;EACd,CAAA;CACY,CAAA,EACL,CAAA;CAGd,MAAM,iBAAiB,wBAAwB;CAE/C,IAAI,MAAM;EACR,KAAK,OAAO,GAAG;EACf;CACF;CAEA,IAAI;EACF,QAAA,GAAA,iBAAA,YAAA,CAAmB,QAAmB,KAAK,EACzC,mBAAmB,OAAO,WAAW;GAGnC,IAAI,gBACF,QAAQ,KAAK,0CAA0C,OAAO,SAAS;EAE3E,EACF,CAAC;CACH,SAAS,KAAK;EACZ,QAAQ,KAAK,8DAA8D,GAAG;EAC9E,QAAA,GAAA,iBAAA,WAAA,CAAkB,MAAiB;EACnC,KAAK,OAAO,GAAG;CACjB;AACF"}
|
package/output/renderer.css
CHANGED
|
@@ -145,6 +145,7 @@
|
|
|
145
145
|
--text-base: 1rem;
|
|
146
146
|
--text-base--line-height: 1.75rem;
|
|
147
147
|
--text-lg: 1.125rem;
|
|
148
|
+
--text-lg--line-height: 1.75rem;
|
|
148
149
|
--text-xl: 1.25rem;
|
|
149
150
|
--text-2xl: 1.5rem;
|
|
150
151
|
--text-3xl: 1.875rem;
|
|
@@ -1001,6 +1002,17 @@
|
|
|
1001
1002
|
--clarify-http-method-default-text: var(--color-zinc-100);
|
|
1002
1003
|
}
|
|
1003
1004
|
|
|
1005
|
+
.clarify-content-blog .clarify-mdx-page, .clarify-content-blog .clarify-page-metadata {
|
|
1006
|
+
max-width: 48rem;
|
|
1007
|
+
margin-inline: auto;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.clarify-content-blog .clarify-page-title {
|
|
1011
|
+
font-family: Georgia, Times New Roman, serif;
|
|
1012
|
+
font-size: clamp(2.5rem, 7cqw, 4.5rem);
|
|
1013
|
+
line-height: 1.05;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1004
1016
|
.clarify-api-response {
|
|
1005
1017
|
--shiki-color-text: var(--clarify-ui-text-strong);
|
|
1006
1018
|
--shiki-token-constant: #047857;
|
|
@@ -1937,6 +1949,10 @@
|
|
|
1937
1949
|
margin: 0;
|
|
1938
1950
|
}
|
|
1939
1951
|
|
|
1952
|
+
.m-0\! {
|
|
1953
|
+
margin: 0 !important;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1940
1956
|
.mx-0 {
|
|
1941
1957
|
margin-inline: 0;
|
|
1942
1958
|
}
|
|
@@ -1973,6 +1989,10 @@
|
|
|
1973
1989
|
margin-block: calc(var(--spacing) * 10);
|
|
1974
1990
|
}
|
|
1975
1991
|
|
|
1992
|
+
.my-14 {
|
|
1993
|
+
margin-block: calc(var(--spacing) * 14);
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1976
1996
|
.prose {
|
|
1977
1997
|
--tw-prose-body: var(--clarify-theme-tokens-colors-foreground);
|
|
1978
1998
|
}
|
|
@@ -2425,6 +2445,10 @@
|
|
|
2425
2445
|
margin-left: calc(var(--spacing) * -152);
|
|
2426
2446
|
}
|
|
2427
2447
|
|
|
2448
|
+
.ml-1 {
|
|
2449
|
+
margin-left: var(--spacing);
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2428
2452
|
.ml-2 {
|
|
2429
2453
|
margin-left: calc(var(--spacing) * 2);
|
|
2430
2454
|
}
|
|
@@ -2495,6 +2519,11 @@
|
|
|
2495
2519
|
height: calc(var(--spacing) * 2.5);
|
|
2496
2520
|
}
|
|
2497
2521
|
|
|
2522
|
+
.size-3 {
|
|
2523
|
+
width: calc(var(--spacing) * 3);
|
|
2524
|
+
height: calc(var(--spacing) * 3);
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2498
2527
|
.size-3\.5 {
|
|
2499
2528
|
width: calc(var(--spacing) * 3.5);
|
|
2500
2529
|
height: calc(var(--spacing) * 3.5);
|
|
@@ -2941,6 +2970,14 @@
|
|
|
2941
2970
|
min-width: calc(var(--spacing) * 28);
|
|
2942
2971
|
}
|
|
2943
2972
|
|
|
2973
|
+
.min-w-40 {
|
|
2974
|
+
min-width: calc(var(--spacing) * 40);
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
.min-w-48 {
|
|
2978
|
+
min-width: calc(var(--spacing) * 48);
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2944
2981
|
.min-w-96 {
|
|
2945
2982
|
min-width: calc(var(--spacing) * 96);
|
|
2946
2983
|
}
|
|
@@ -3014,6 +3051,10 @@
|
|
|
3014
3051
|
rotate: -90deg;
|
|
3015
3052
|
}
|
|
3016
3053
|
|
|
3054
|
+
.rotate-90 {
|
|
3055
|
+
rotate: 90deg;
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3017
3058
|
.rotate-180 {
|
|
3018
3059
|
rotate: 180deg;
|
|
3019
3060
|
}
|
|
@@ -3219,6 +3260,10 @@
|
|
|
3219
3260
|
gap: calc(var(--spacing) * 6);
|
|
3220
3261
|
}
|
|
3221
3262
|
|
|
3263
|
+
.gap-7 {
|
|
3264
|
+
gap: calc(var(--spacing) * 7);
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3222
3267
|
.gap-px {
|
|
3223
3268
|
gap: 1px;
|
|
3224
3269
|
}
|
|
@@ -3311,6 +3356,10 @@
|
|
|
3311
3356
|
}
|
|
3312
3357
|
}
|
|
3313
3358
|
|
|
3359
|
+
.self-start {
|
|
3360
|
+
align-self: flex-start;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3314
3363
|
.truncate {
|
|
3315
3364
|
text-overflow: ellipsis;
|
|
3316
3365
|
white-space: nowrap;
|
|
@@ -4235,6 +4284,10 @@
|
|
|
4235
4284
|
padding-left: calc(var(--spacing) * 4);
|
|
4236
4285
|
}
|
|
4237
4286
|
|
|
4287
|
+
.pl-6 {
|
|
4288
|
+
padding-left: calc(var(--spacing) * 6);
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4238
4291
|
.pl-9 {
|
|
4239
4292
|
padding-left: calc(var(--spacing) * 9);
|
|
4240
4293
|
}
|
|
@@ -4324,6 +4377,11 @@
|
|
|
4324
4377
|
line-height: calc(var(--spacing) * 6);
|
|
4325
4378
|
}
|
|
4326
4379
|
|
|
4380
|
+
.text-lg {
|
|
4381
|
+
font-size: var(--text-lg);
|
|
4382
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
4383
|
+
}
|
|
4384
|
+
|
|
4327
4385
|
.text-lg\/7 {
|
|
4328
4386
|
font-size: var(--text-lg);
|
|
4329
4387
|
line-height: calc(var(--spacing) * 7);
|
|
@@ -4684,6 +4742,14 @@
|
|
|
4684
4742
|
opacity: .35;
|
|
4685
4743
|
}
|
|
4686
4744
|
|
|
4745
|
+
.opacity-60 {
|
|
4746
|
+
opacity: .6;
|
|
4747
|
+
}
|
|
4748
|
+
|
|
4749
|
+
.opacity-70 {
|
|
4750
|
+
opacity: .7;
|
|
4751
|
+
}
|
|
4752
|
+
|
|
4687
4753
|
.opacity-80 {
|
|
4688
4754
|
opacity: .8;
|
|
4689
4755
|
}
|
|
@@ -5363,6 +5429,10 @@
|
|
|
5363
5429
|
color: var(--clarify-theme-tokens-colors-foreground);
|
|
5364
5430
|
}
|
|
5365
5431
|
|
|
5432
|
+
.hover\:text-\(--clarify-ui-text\):hover {
|
|
5433
|
+
color: var(--clarify-ui-text);
|
|
5434
|
+
}
|
|
5435
|
+
|
|
5366
5436
|
.hover\:text-\(--clarify-ui-text-strong\):hover {
|
|
5367
5437
|
color: var(--clarify-ui-text-strong);
|
|
5368
5438
|
}
|
|
@@ -5663,6 +5733,10 @@
|
|
|
5663
5733
|
position: absolute;
|
|
5664
5734
|
}
|
|
5665
5735
|
|
|
5736
|
+
.sm\:sticky {
|
|
5737
|
+
position: sticky;
|
|
5738
|
+
}
|
|
5739
|
+
|
|
5666
5740
|
.sm\:top-14 {
|
|
5667
5741
|
top: calc(var(--spacing) * 14);
|
|
5668
5742
|
}
|
|
@@ -5671,6 +5745,10 @@
|
|
|
5671
5745
|
top: calc(var(--spacing) * 16);
|
|
5672
5746
|
}
|
|
5673
5747
|
|
|
5748
|
+
.sm\:top-24 {
|
|
5749
|
+
top: calc(var(--spacing) * 24);
|
|
5750
|
+
}
|
|
5751
|
+
|
|
5674
5752
|
.sm\:right-0 {
|
|
5675
5753
|
right: 0;
|
|
5676
5754
|
}
|
|
@@ -5747,6 +5825,10 @@
|
|
|
5747
5825
|
grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr);
|
|
5748
5826
|
}
|
|
5749
5827
|
|
|
5828
|
+
.sm\:grid-cols-\[8\.5rem_minmax\(0\,1fr\)\] {
|
|
5829
|
+
grid-template-columns: 8.5rem minmax(0, 1fr);
|
|
5830
|
+
}
|
|
5831
|
+
|
|
5750
5832
|
.sm\:grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
5751
5833
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
5752
5834
|
}
|
|
@@ -5783,6 +5865,10 @@
|
|
|
5783
5865
|
gap: calc(var(--spacing) * 4);
|
|
5784
5866
|
}
|
|
5785
5867
|
|
|
5868
|
+
.sm\:gap-12 {
|
|
5869
|
+
gap: calc(var(--spacing) * 12);
|
|
5870
|
+
}
|
|
5871
|
+
|
|
5786
5872
|
.sm\:self-end {
|
|
5787
5873
|
align-self: flex-end;
|
|
5788
5874
|
}
|
package/output/server.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ClarifyShell = require("./ClarifyShell-
|
|
3
|
-
const require_PageActions = require("./PageActions-
|
|
2
|
+
const require_ClarifyShell = require("./ClarifyShell-DLOGS18o.cjs");
|
|
3
|
+
const require_PageActions = require("./PageActions-CVOTIuxh.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let react_router_dom = require("react-router-dom");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
package/output/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ClarifyShell } from "./ClarifyShell-
|
|
2
|
-
import {
|
|
1
|
+
import { t as ClarifyShell } from "./ClarifyShell-DGm_R5Bp.js";
|
|
2
|
+
import { E as prefixHref } from "./PageActions-D52u18C8.js";
|
|
3
3
|
import { StrictMode } from "react";
|
|
4
4
|
import { StaticRouter } from "react-router-dom";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|