@clarify-labs/renderer 0.7.1 → 0.7.2

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/client.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { S as themeCookieName, _ as getStoredThemePreference, b as storeLocalePreference, g as getStoredLocalePreference, v as localeCookieName, x as storeThemePreference, y as readLocaleCookie } from "./PageActions-yoDRjkq8.js";
2
- import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ThemeRoot-CLa0yvRQ.js";
3
- import { t as render } from "./render-D0ls3d2j.js";
2
+ import { a as themeBootstrapScript, i as themeEditorPresets, n as ThemeEditor, r as applyThemeVariables, s as themeStorageKey } from "./ThemeRoot-QULrwQf6.js";
3
+ import { t as render } from "./render-psutGbsg.js";
4
4
  export { ThemeEditor, applyThemeVariables, getStoredLocalePreference, getStoredThemePreference, localeCookieName, readLocaleCookie, render, storeLocalePreference, storeThemePreference, themeBootstrapScript, themeCookieName, themeEditorPresets, themeStorageKey };
package/output/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_PageActions = require("./PageActions-1RDCHcUY.cjs");
3
- const require_ThemeRoot = require("./ThemeRoot-DYS-lcK-.cjs");
4
- const require_OpenApiOperation = require("./OpenApiOperation-C4xZu4i0.cjs");
3
+ const require_ThemeRoot = require("./ThemeRoot-UWj0iK1X.cjs");
4
+ const require_OpenApiOperation = require("./OpenApiOperation-BcyW_ULy.cjs");
5
5
  const require_remark = require("./remark-Dv3owbSH.cjs");
6
- const require_render = require("./render-CRTqZzyY.cjs");
6
+ const require_render = require("./render-ByWbJbrA.cjs");
7
7
  let react_router_dom = require("react-router-dom");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region source/openapi/lib/spec-path.ts
package/output/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { C as Code, D as CardGroup, E as Card, O as Callout, S as Collapse, T as Pre, _ as HeroPattern, b as Tag, f as Markdown, g as GridPattern, h as Prose, k as Button, m as WebFrame, n as OpenApiOperation$1, p as primitives_exports, v as Logo, w as CodeGroup, x as Feedback, y as Heading } from "./OpenApiOperation-LIL7bqxW.js";
1
+ import { C as Code, D as CardGroup, E as Card, O as Callout, S as Collapse, T as Pre, _ as HeroPattern, b as Tag, f as Markdown, g as GridPattern, h as Prose, k as Button, m as WebFrame, n as OpenApiOperation$1, p as primitives_exports, v as Logo, w as CodeGroup, x as Feedback, y as Heading } from "./OpenApiOperation-tUKf7lZ4.js";
2
2
  import { A as OpenApisContext, D as useBuiltInText, M as useLocale, N as useOpenApis, O as ConfigContext, c as remToPx, h as useTheme, j as useConfig, m as ThemeProvider, n as PageTitleActions, o as SectionProvider, p as ThemeToggle, s as useSectionStore } from "./PageActions-yoDRjkq8.js";
3
- import { a as themeBootstrapScript, c as AppShell, d as PageBanner, i as themeEditorPresets, l as PageFooter, n as ThemeEditor, o as themePresets, r as applyThemeVariables, u as BuiltWithClarify } from "./ThemeRoot-CLa0yvRQ.js";
3
+ import { a as themeBootstrapScript, c as AppShell, d as PageBanner, i as themeEditorPresets, l as PageFooter, n as ThemeEditor, o as themePresets, r as applyThemeVariables, u as BuiltWithClarify } from "./ThemeRoot-QULrwQf6.js";
4
4
  import { t as markdownRemarkPlugins } from "./remark-Dd2WU50s.js";
5
- import { t as render } from "./render-D0ls3d2j.js";
5
+ import { t as render } from "./render-psutGbsg.js";
6
6
  import { useLocation } from "react-router-dom";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region source/openapi/lib/spec-path.ts
@@ -31,6 +31,7 @@ export declare function useMDXComponents(components?: Record<string, unknown>):
31
31
  }): import("react").JSX.Element;
32
32
  Row(arg0: {
33
33
  children: import('react').ReactNode;
34
+ className?: string;
34
35
  }): import("react").JSX.Element;
35
36
  Col(arg0: {
36
37
  children: import('react').ReactNode;
@@ -30,6 +30,7 @@ type NoteProps = {
30
30
  export declare function Note(arg0: NoteProps): import("react").JSX.Element;
31
31
  type RowProps = {
32
32
  children: ReactNode;
33
+ className?: string;
33
34
  };
34
35
  export declare function Row(arg0: RowProps): import("react").JSX.Element;
35
36
  type ColProps = {
@@ -0,0 +1,30 @@
1
+ import { ReactNode } from 'react';
2
+ import { OpenAPIOperation, OpenAPISpec } from '../lib/utils';
3
+ import { MediaTypeEntry, OpenApiParameter, OpenApiRecord, OpenApiServer, RequestAuthInput } from '../types';
4
+ type EndpointRequestProps = {
5
+ spec: OpenAPISpec;
6
+ path: string;
7
+ method: string;
8
+ description?: string;
9
+ groupedParameters: {
10
+ path: OpenApiParameter[];
11
+ query: OpenApiParameter[];
12
+ header: OpenApiParameter[];
13
+ };
14
+ parameters: OpenApiParameter[];
15
+ requestBody?: OpenApiRecord;
16
+ requestContents: MediaTypeEntry[];
17
+ requestSchema: unknown;
18
+ selectedRequestMediaType: string;
19
+ onSelectRequestMediaType: (value: string) => void;
20
+ selectedServer: OpenApiServer;
21
+ serverVariables: Record<string, string>;
22
+ auth?: RequestAuthInput;
23
+ };
24
+ export declare function EndpointRequest(arg0: EndpointRequestProps): ReactNode;
25
+ type EndpointResponseProps = {
26
+ spec: OpenAPISpec;
27
+ operation: OpenAPIOperation;
28
+ };
29
+ export declare function EndpointResponse(arg0: EndpointResponseProps): ReactNode;
30
+ export {};
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_PageActions = require("./PageActions-1RDCHcUY.cjs");
3
- const require_OpenApiOperation = require("./OpenApiOperation-C4xZu4i0.cjs");
3
+ const require_OpenApiOperation = require("./OpenApiOperation-BcyW_ULy.cjs");
4
4
  let react = require("react");
5
5
  let react_router_dom = require("react-router-dom");
6
6
  let lucide_react = require("lucide-react");
package/output/preview.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as authPlaceholder, c as getServerKey, d as getRequestBody, i as ResponseExamplesPanel, l as getServers, o as defaultServerVariables, r as RequestExamplesPanel, s as getAuthOptions, t as EndpointIdentity, u as getMediaTypeEntries } from "./OpenApiOperation-LIL7bqxW.js";
1
+ import { a as authPlaceholder, c as getServerKey, d as getRequestBody, i as ResponseExamplesPanel, l as getServers, o as defaultServerVariables, r as RequestExamplesPanel, s as getAuthOptions, t as EndpointIdentity, u as getMediaTypeEntries } from "./OpenApiOperation-tUKf7lZ4.js";
2
2
  import { A as OpenApisContext, O as ConfigContext, i as Navigation, k as LocaleContext, o as SectionProvider } from "./PageActions-yoDRjkq8.js";
3
3
  import { useState } from "react";
4
4
  import { MemoryRouter } from "react-router-dom";
@@ -1,5 +1,5 @@
1
1
  const require_PageActions = require("./PageActions-1RDCHcUY.cjs");
2
- const require_ThemeRoot = require("./ThemeRoot-DYS-lcK-.cjs");
2
+ const require_ThemeRoot = require("./ThemeRoot-UWj0iK1X.cjs");
3
3
  let react = require("react");
4
4
  let react_router_dom = require("react-router-dom");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -64,4 +64,4 @@ Object.defineProperty(exports, "render", {
64
64
  }
65
65
  });
66
66
 
67
- //# sourceMappingURL=render-CRTqZzyY.cjs.map
67
+ //# sourceMappingURL=render-ByWbJbrA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-CRTqZzyY.cjs","names":[],"sources":["../source/runtime/render.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { hydrateRoot, createRoot } from 'react-dom/client'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport { AppShell } from '../app/AppShell'\nimport { ConfigContext, OpenApisContext } from '../context'\nimport { ThemeProvider } from '../theme/ThemeProvider'\nimport { ThemeRoot } from '../theme/ThemeRoot'\nimport type { RenderOptions } from '../types'\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 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, openApis = {}, bannerComponent, footerComponent, 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 <ConfigContext.Provider value={config}>\n <OpenApisContext.Provider value={openApis}>\n <ThemeProvider>\n <ThemeRoot theme={config.theme} themeEditor={themeEditor}>\n <AppShell config={config} routes={routes} navigation={navigation ?? []} bannerComponent={bannerComponent} footerComponent={footerComponent} />\n </ThemeRoot>\n </ThemeProvider>\n </OpenApisContext.Provider>\n </ConfigContext.Provider>\n </BrowserRouter>\n </StrictMode>\n )\n\n const hydrationDebug = isHydrationDebugEnabled()\n\n try {\n 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 createRoot(target as Element).render(app)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,SAAS,0BAAmC;CAC1C,IAAI;EAEF,OAAO,IADY,gBAAgB,OAAO,SAAS,MAC5C,EAAO,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,WAAW,CAAC,GAAG,iBAAiB,iBAAiB,WAAW,cAAc,UAAU;CAExH,MAAM,SAAS,aAAa,SAAS,eAAe,MAAM;CAC1D,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,qDAAmD;CAGrE,MAAM,MACJ,iBAAA,GAAA,kBAAA,KAAC,MAAA,YAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,iBAAA,eAAD;EAAe,UAAU,OAAO;YAC9B,iBAAA,GAAA,kBAAA,KAAC,oBAAA,cAAc,UAAf;GAAwB,OAAO;aAC7B,iBAAA,GAAA,kBAAA,KAAC,oBAAA,gBAAgB,UAAjB;IAA0B,OAAO;cAC/B,iBAAA,GAAA,kBAAA,KAAC,oBAAA,eAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,kBAAA,WAAD;KAAW,OAAO,OAAO;KAAoB;eAC3C,iBAAA,GAAA,kBAAA,KAAC,kBAAA,UAAD;MAAkB;MAAgB;MAAQ,YAAY,cAAc,CAAC;MAAoB;MAAkC;KAAkB,CAAA;IACpI,CAAA,EACE,CAAA;GACS,CAAA;EACJ,CAAA;CACX,CAAA,EACL,CAAA;CAGd,MAAM,iBAAiB,wBAAwB;CAE/C,IAAI;EACF,CAAA,GAAA,iBAAA,aAAY,QAAmB,KAAK,EAClC,mBAAmB,OAAO,WAAW;GAGnC,IAAI,gBACF,QAAQ,KAAK,0CAA0C,OAAO,SAAS;EAE3E,EACF,CAAC;CACH,SAAS,KAAK;EACZ,QAAQ,KAAK,8DAA8D,GAAG;EAC9E,CAAA,GAAA,iBAAA,YAAW,MAAiB,EAAE,OAAO,GAAG;CAC1C;AACF"}
1
+ {"version":3,"file":"render-ByWbJbrA.cjs","names":[],"sources":["../source/runtime/render.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { hydrateRoot, createRoot } from 'react-dom/client'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport { AppShell } from '../app/AppShell'\nimport { ConfigContext, OpenApisContext } from '../context'\nimport { ThemeProvider } from '../theme/ThemeProvider'\nimport { ThemeRoot } from '../theme/ThemeRoot'\nimport type { RenderOptions } from '../types'\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 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, openApis = {}, bannerComponent, footerComponent, 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 <ConfigContext.Provider value={config}>\n <OpenApisContext.Provider value={openApis}>\n <ThemeProvider>\n <ThemeRoot theme={config.theme} themeEditor={themeEditor}>\n <AppShell config={config} routes={routes} navigation={navigation ?? []} bannerComponent={bannerComponent} footerComponent={footerComponent} />\n </ThemeRoot>\n </ThemeProvider>\n </OpenApisContext.Provider>\n </ConfigContext.Provider>\n </BrowserRouter>\n </StrictMode>\n )\n\n const hydrationDebug = isHydrationDebugEnabled()\n\n try {\n 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 createRoot(target as Element).render(app)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,SAAS,0BAAmC;CAC1C,IAAI;EAEF,OAAO,IADY,gBAAgB,OAAO,SAAS,MAC5C,EAAO,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,WAAW,CAAC,GAAG,iBAAiB,iBAAiB,WAAW,cAAc,UAAU;CAExH,MAAM,SAAS,aAAa,SAAS,eAAe,MAAM;CAC1D,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,qDAAmD;CAGrE,MAAM,MACJ,iBAAA,GAAA,kBAAA,KAAC,MAAA,YAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,iBAAA,eAAD;EAAe,UAAU,OAAO;YAC9B,iBAAA,GAAA,kBAAA,KAAC,oBAAA,cAAc,UAAf;GAAwB,OAAO;aAC7B,iBAAA,GAAA,kBAAA,KAAC,oBAAA,gBAAgB,UAAjB;IAA0B,OAAO;cAC/B,iBAAA,GAAA,kBAAA,KAAC,oBAAA,eAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,kBAAA,WAAD;KAAW,OAAO,OAAO;KAAoB;eAC3C,iBAAA,GAAA,kBAAA,KAAC,kBAAA,UAAD;MAAkB;MAAgB;MAAQ,YAAY,cAAc,CAAC;MAAoB;MAAkC;KAAkB,CAAA;IACpI,CAAA,EACE,CAAA;GACS,CAAA;EACJ,CAAA;CACX,CAAA,EACL,CAAA;CAGd,MAAM,iBAAiB,wBAAwB;CAE/C,IAAI;EACF,CAAA,GAAA,iBAAA,aAAY,QAAmB,KAAK,EAClC,mBAAmB,OAAO,WAAW;GAGnC,IAAI,gBACF,QAAQ,KAAK,0CAA0C,OAAO,SAAS;EAE3E,EACF,CAAC;CACH,SAAS,KAAK;EACZ,QAAQ,KAAK,8DAA8D,GAAG;EAC9E,CAAA,GAAA,iBAAA,YAAW,MAAiB,EAAE,OAAO,GAAG;CAC1C;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { A as OpenApisContext, O as ConfigContext, m as ThemeProvider } from "./PageActions-yoDRjkq8.js";
2
- import { c as AppShell, t as ThemeRoot } from "./ThemeRoot-CLa0yvRQ.js";
2
+ import { c as AppShell, t as ThemeRoot } from "./ThemeRoot-QULrwQf6.js";
3
3
  import { StrictMode } from "react";
4
4
  import { BrowserRouter } from "react-router-dom";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -59,4 +59,4 @@ function render(options) {
59
59
  //#endregion
60
60
  export { render as t };
61
61
 
62
- //# sourceMappingURL=render-D0ls3d2j.js.map
62
+ //# sourceMappingURL=render-psutGbsg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-D0ls3d2j.js","names":[],"sources":["../source/runtime/render.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { hydrateRoot, createRoot } from 'react-dom/client'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport { AppShell } from '../app/AppShell'\nimport { ConfigContext, OpenApisContext } from '../context'\nimport { ThemeProvider } from '../theme/ThemeProvider'\nimport { ThemeRoot } from '../theme/ThemeRoot'\nimport type { RenderOptions } from '../types'\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 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, openApis = {}, bannerComponent, footerComponent, 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 <ConfigContext.Provider value={config}>\n <OpenApisContext.Provider value={openApis}>\n <ThemeProvider>\n <ThemeRoot theme={config.theme} themeEditor={themeEditor}>\n <AppShell config={config} routes={routes} navigation={navigation ?? []} bannerComponent={bannerComponent} footerComponent={footerComponent} />\n </ThemeRoot>\n </ThemeProvider>\n </OpenApisContext.Provider>\n </ConfigContext.Provider>\n </BrowserRouter>\n </StrictMode>\n )\n\n const hydrationDebug = isHydrationDebugEnabled()\n\n try {\n 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 createRoot(target as Element).render(app)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,SAAS,0BAAmC;CAC1C,IAAI;EAEF,OAAO,IADY,gBAAgB,OAAO,SAAS,MAC5C,EAAO,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,WAAW,CAAC,GAAG,iBAAiB,iBAAiB,WAAW,cAAc,UAAU;CAExH,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,cAAc,UAAf;GAAwB,OAAO;aAC7B,oBAAC,gBAAgB,UAAjB;IAA0B,OAAO;cAC/B,oBAAC,eAAD,EAAA,UACE,oBAAC,WAAD;KAAW,OAAO,OAAO;KAAoB;eAC3C,oBAAC,UAAD;MAAkB;MAAgB;MAAQ,YAAY,cAAc,CAAC;MAAoB;MAAkC;KAAkB,CAAA;IACpI,CAAA,EACE,CAAA;GACS,CAAA;EACJ,CAAA;CACX,CAAA,EACL,CAAA;CAGd,MAAM,iBAAiB,wBAAwB;CAE/C,IAAI;EACF,YAAY,QAAmB,KAAK,EAClC,mBAAmB,OAAO,WAAW;GAGnC,IAAI,gBACF,QAAQ,KAAK,0CAA0C,OAAO,SAAS;EAE3E,EACF,CAAC;CACH,SAAS,KAAK;EACZ,QAAQ,KAAK,8DAA8D,GAAG;EAC9E,WAAW,MAAiB,EAAE,OAAO,GAAG;CAC1C;AACF"}
1
+ {"version":3,"file":"render-psutGbsg.js","names":[],"sources":["../source/runtime/render.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { hydrateRoot, createRoot } from 'react-dom/client'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport { AppShell } from '../app/AppShell'\nimport { ConfigContext, OpenApisContext } from '../context'\nimport { ThemeProvider } from '../theme/ThemeProvider'\nimport { ThemeRoot } from '../theme/ThemeRoot'\nimport type { RenderOptions } from '../types'\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 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, openApis = {}, bannerComponent, footerComponent, 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 <ConfigContext.Provider value={config}>\n <OpenApisContext.Provider value={openApis}>\n <ThemeProvider>\n <ThemeRoot theme={config.theme} themeEditor={themeEditor}>\n <AppShell config={config} routes={routes} navigation={navigation ?? []} bannerComponent={bannerComponent} footerComponent={footerComponent} />\n </ThemeRoot>\n </ThemeProvider>\n </OpenApisContext.Provider>\n </ConfigContext.Provider>\n </BrowserRouter>\n </StrictMode>\n )\n\n const hydrationDebug = isHydrationDebugEnabled()\n\n try {\n 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 createRoot(target as Element).render(app)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,SAAS,0BAAmC;CAC1C,IAAI;EAEF,OAAO,IADY,gBAAgB,OAAO,SAAS,MAC5C,EAAO,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,WAAW,CAAC,GAAG,iBAAiB,iBAAiB,WAAW,cAAc,UAAU;CAExH,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,cAAc,UAAf;GAAwB,OAAO;aAC7B,oBAAC,gBAAgB,UAAjB;IAA0B,OAAO;cAC/B,oBAAC,eAAD,EAAA,UACE,oBAAC,WAAD;KAAW,OAAO,OAAO;KAAoB;eAC3C,oBAAC,UAAD;MAAkB;MAAgB;MAAQ,YAAY,cAAc,CAAC;MAAoB;MAAkC;KAAkB,CAAA;IACpI,CAAA,EACE,CAAA;GACS,CAAA;EACJ,CAAA;CACX,CAAA,EACL,CAAA;CAGd,MAAM,iBAAiB,wBAAwB;CAE/C,IAAI;EACF,YAAY,QAAmB,KAAK,EAClC,mBAAmB,OAAO,WAAW;GAGnC,IAAI,gBACF,QAAQ,KAAK,0CAA0C,OAAO,SAAS;EAE3E,EACF,CAAC;CACH,SAAS,KAAK;EACZ,QAAQ,KAAK,8DAA8D,GAAG;EAC9E,WAAW,MAAiB,EAAE,OAAO,GAAG;CAC1C;AACF"}
@@ -2537,12 +2537,6 @@
2537
2537
  margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));
2538
2538
  }
2539
2539
 
2540
- :where(.space-y-6 > :not(:last-child)) {
2541
- --tw-space-y-reverse: 0;
2542
- margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));
2543
- margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
2544
- }
2545
-
2546
2540
  :where(.space-y-8 > :not(:last-child)) {
2547
2541
  --tw-space-y-reverse: 0;
2548
2542
  margin-block-start: calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));
@@ -4594,8 +4588,8 @@
4594
4588
  position: sticky;
4595
4589
  }
4596
4590
 
4597
- .xl\:top-24 {
4598
- top: calc(var(--spacing) * 24);
4591
+ .xl\:top-\[calc\(var\(--clarify-header-offset\,3\.5rem\)\+1\.5rem\)\] {
4592
+ top: calc(var(--clarify-header-offset, 3.5rem) + 1.5rem);
4599
4593
  }
4600
4594
 
4601
4595
  .xl\:max-w-none {
@@ -4614,6 +4608,10 @@
4614
4608
  grid-template-columns: repeat(4, minmax(0, 1fr));
4615
4609
  }
4616
4610
 
4611
+ .xl\:self-start {
4612
+ align-self: flex-start;
4613
+ }
4614
+
4617
4615
  .xl\:px-6 {
4618
4616
  padding-inline: calc(var(--spacing) * 6);
4619
4617
  }
package/output/server.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_PageActions = require("./PageActions-1RDCHcUY.cjs");
3
- const require_ThemeRoot = require("./ThemeRoot-DYS-lcK-.cjs");
3
+ const require_ThemeRoot = require("./ThemeRoot-UWj0iK1X.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
1
  import { A as OpenApisContext, O as ConfigContext, T as prefixHref, m as ThemeProvider } from "./PageActions-yoDRjkq8.js";
2
- import { c as AppShell, t as ThemeRoot } from "./ThemeRoot-CLa0yvRQ.js";
2
+ import { c as AppShell, t as ThemeRoot } from "./ThemeRoot-QULrwQf6.js";
3
3
  import { StrictMode } from "react";
4
4
  import { StaticRouter } from "react-router-dom";
5
5
  import { jsx } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clarify-labs/renderer",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "repository": {