@clarify-labs/renderer 0.10.3 → 0.11.1
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-UsefuuLS.cjs → ClarifyShell-C2XnkFQ6.cjs} +119 -100
- package/output/ClarifyShell-C2XnkFQ6.cjs.map +1 -0
- package/output/{ClarifyShell-Cq5Af46F.js → ClarifyShell-CwRtof1h.js} +119 -100
- package/output/ClarifyShell-CwRtof1h.js.map +1 -0
- package/output/{MermaidViewer-Db7qsyVk.cjs → MermaidViewer-CTvMCE19.cjs} +2 -2
- package/output/{MermaidViewer-Db7qsyVk.cjs.map → MermaidViewer-CTvMCE19.cjs.map} +1 -1
- package/output/{MermaidViewer-Bc9H25yK.js → MermaidViewer-CwkiQ2gO.js} +2 -2
- package/output/{MermaidViewer-Bc9H25yK.js.map → MermaidViewer-CwkiQ2gO.js.map} +1 -1
- package/output/{OpenApiOperation-BZWeCbvy.js → OpenApiOperation-CFo6_otd.js} +1964 -292
- package/output/OpenApiOperation-CFo6_otd.js.map +1 -0
- package/output/{OpenApiOperation-DbZjxIuj.cjs → OpenApiOperation-D1WNrj5X.cjs} +1967 -289
- package/output/OpenApiOperation-D1WNrj5X.cjs.map +1 -0
- package/output/{PageActions-BQeEmXbT.js → PageActions-3eo05fb_.js} +60 -19
- package/output/PageActions-3eo05fb_.js.map +1 -0
- package/output/{PageActions-Dg1l9KB1.cjs → PageActions-Lp_NeIKr.cjs} +59 -18
- package/output/PageActions-Lp_NeIKr.cjs.map +1 -0
- package/output/{SearchDialog-B67VA0Ut.js → SearchDialog-BvCBIFqs.js} +3 -3
- package/output/{SearchDialog-B67VA0Ut.js.map → SearchDialog-BvCBIFqs.js.map} +1 -1
- package/output/{SearchDialog-DjKvqN7p.cjs → SearchDialog-CM9DrE2Y.cjs} +3 -3
- package/output/{SearchDialog-DjKvqN7p.cjs.map → SearchDialog-CM9DrE2Y.cjs.map} +1 -1
- package/output/app/PageFooter.d.ts +1 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/components/Tooltip.d.ts +1 -0
- package/output/core/i18n.d.ts +1 -1
- package/output/core/types.d.ts +37 -19
- package/output/{i18n-Bqth9d6Q.js → i18n-BxXpRSFX.js} +106 -2
- package/output/i18n-BxXpRSFX.js.map +1 -0
- package/output/{i18n-C-fReCj-.cjs → i18n-DsjZ51U1.cjs} +106 -2
- package/output/i18n-DsjZ51U1.cjs.map +1 -0
- package/output/index.cjs +26 -5
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +3 -3
- package/output/index.js +26 -6
- package/output/index.js.map +1 -1
- package/output/mdx/components.d.ts +2 -1
- package/output/openapi/components/EndpointMethodBadge.d.ts +6 -0
- package/output/openapi/components/EndpointSections.d.ts +2 -2
- package/output/openapi/components/ExamplePanels.d.ts +2 -2
- package/output/openapi/components/InlineListbox.d.ts +14 -0
- package/output/openapi/components/OpenApiAuthPanel.d.ts +12 -0
- package/output/openapi/components/OpenApiOperation.d.ts +1 -9
- package/output/openapi/components/OpenApiOperation.state.d.ts +4 -2
- package/output/openapi/components/OpenApiRequest.d.ts +18 -0
- package/output/openapi/components/OpenApiRequestBodyEditor.d.ts +14 -0
- package/output/openapi/components/OpenApiRequestFields.d.ts +25 -0
- package/output/openapi/components/OpenApiResponseViewer.d.ts +14 -0
- package/output/openapi/components/SendRequestButton.d.ts +9 -0
- package/output/openapi/components/helpers.d.ts +6 -1
- package/output/openapi/components/useOpenApiRequestState.d.ts +48 -0
- package/output/openapi/entry.d.ts +2 -0
- package/output/openapi/index.d.ts +2 -2
- package/output/openapi/lib/api-exchange-code.d.ts +8 -0
- package/output/openapi/lib/api-exchange.d.ts +30 -0
- package/output/openapi/lib/api-request.d.ts +25 -0
- package/output/openapi/lib/helpers.d.ts +8 -0
- package/output/openapi/lib/request-code.d.ts +2 -2
- package/output/openapi/lib/request-parameters.d.ts +5 -0
- package/output/openapi/store.d.ts +10 -0
- package/output/openapi/types.d.ts +6 -0
- package/output/preview.cjs +46 -40
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +46 -40
- package/output/preview.js.map +1 -1
- package/output/{render-Dc9wxg_r.cjs → render-CKG4X-me.cjs} +2 -2
- package/output/{render-Dc9wxg_r.cjs.map → render-CKG4X-me.cjs.map} +1 -1
- package/output/{render-aS-w4fK4.js → render-vlp3hwW3.js} +2 -2
- package/output/{render-aS-w4fK4.js.map → render-vlp3hwW3.js.map} +1 -1
- package/output/renderer.css +630 -152
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/output/theme/ThemeEditor.d.ts +8 -4
- package/output/theme/variables.d.ts +8 -4
- package/package.json +2 -1
- package/output/ClarifyShell-Cq5Af46F.js.map +0 -1
- package/output/ClarifyShell-UsefuuLS.cjs.map +0 -1
- package/output/OpenApiOperation-BZWeCbvy.js.map +0 -1
- package/output/OpenApiOperation-DbZjxIuj.cjs.map +0 -1
- package/output/PageActions-BQeEmXbT.js.map +0 -1
- package/output/PageActions-Dg1l9KB1.cjs.map +0 -1
- package/output/core/index.d.ts +0 -3
- package/output/i18n-Bqth9d6Q.js.map +0 -1
- package/output/i18n-C-fReCj-.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
3
|
-
const require_PageActions = require("./PageActions-
|
|
2
|
+
const require_i18n = require("./i18n-DsjZ51U1.cjs");
|
|
3
|
+
const require_PageActions = require("./PageActions-Lp_NeIKr.cjs");
|
|
4
4
|
let clsx = require("clsx");
|
|
5
5
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
6
6
|
let react = require("react");
|
|
@@ -124,26 +124,42 @@ function safeDecodeURIComponent(value) {
|
|
|
124
124
|
var clarify_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='279px'%20height='200px'%20viewBox='0%200%20279%20200'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eclarify%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='clarify'%20transform='translate(-0,%200.0054)'%3e%3cpath%20d='M44.867217,0.0054376148%20C130.715579,1.00591567%20200,70.9091172%20200,156.994562%20L199.986321,155.127494%20C199.384888,180.009127%20179.026368,199.994562%20154,199.994562%20L46,199.994562%20C20.5949015,199.994562%200,179.399661%200,153.994562%20L0,45.9945624%20C0,21.0975659%2019.7793434,0.820282524%2044.4815926,0.0191499894%20Z'%20fill='%2300D492'%3e%3c/path%3e%3cpath%20d='M123.867217,0.0054376148%20C209.715579,1.00591567%20279,70.9091172%20279,156.994562%20L278.986321,155.127494%20C278.384888,180.009127%20258.026368,199.994562%20233,199.994562%20L125,199.994562%20C99.5949015,199.994562%2079,179.399661%2079,153.994562%20L79,45.9945624%20C79,21.0975659%2098.7793434,0.820282524%20123.481593,0.0191499894%20Z'%20id='clarify-right'%20fill-opacity='0.6'%20fill='%2300F6C9'%20transform='translate(179,%20100)%20rotate(-90)%20translate(-179,%20-100)'%3e%3c/path%3e%3cpath%20d='M199.979267,154.416906%20L199.984438,155.157125%20L199.962366,155.872459%20C198.977251,180.406837%20178.776104,199.994562%20154,199.994562%20L124.372438,199.994125%20L124.249053,199.994081%20C99.6939678,199.603921%2079.8122712,179.973634%2079.01915,155.518407%20L79.0054376,155.132783%20C79.5830823,105.566626%20103.129768,61.5221348%20139.498462,33.1463428%20C175.69419,61.3871018%20199.186123,105.143863%20199.979267,154.416906%20Z'%20id='形状结合'%20fill='%2300F692'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region source/app/BuiltWithClarify.tsx
|
|
127
|
+
var CLARIFY_TRACKING_URL = "https://clarify.pub/api/track";
|
|
127
128
|
function BuiltWithClarify() {
|
|
128
129
|
const t = require_i18n.useBuiltInText();
|
|
129
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
130
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
131
|
+
className: "clarify-built-with inline-flex items-center gap-1.5",
|
|
132
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
133
|
+
tabIndex: -1,
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
title: t("builtWith.label"),
|
|
136
|
+
src: CLARIFY_TRACKING_URL,
|
|
137
|
+
style: {
|
|
138
|
+
position: "absolute",
|
|
139
|
+
width: 0,
|
|
140
|
+
height: 0,
|
|
141
|
+
border: 0,
|
|
142
|
+
overflow: "hidden"
|
|
143
|
+
}
|
|
144
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
145
|
+
href: "https://clarify.pub",
|
|
146
|
+
target: "_blank",
|
|
147
|
+
rel: "noreferrer",
|
|
148
|
+
"aria-label": t("builtWith.label"),
|
|
149
|
+
className: "clarify-built-with inline-flex items-center gap-1.5 rounded-full px-2 py-1 font-medium no-underline transition",
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("builtWith.prefix") }),
|
|
152
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
153
|
+
src: clarify_default,
|
|
154
|
+
alt: "",
|
|
155
|
+
className: "clarify-built-with-logo h-3.5 w-auto flex-none object-contain"
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
158
|
+
className: "clarify-built-with-brand font-semibold",
|
|
159
|
+
children: "Clarify"
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
})]
|
|
147
163
|
});
|
|
148
164
|
}
|
|
149
165
|
//#endregion
|
|
@@ -361,7 +377,7 @@ function PageBanner(props) {
|
|
|
361
377
|
const { currentLocale, onDismiss } = props;
|
|
362
378
|
const config = require_i18n.useConfig();
|
|
363
379
|
const banner = config.banner;
|
|
364
|
-
const content = banner ? require_PageActions.resolveLocalizedText(banner.content, currentLocale, config.
|
|
380
|
+
const content = banner ? require_PageActions.resolveLocalizedText(banner.content, currentLocale, config.locales?.default) : "";
|
|
365
381
|
const storageKey = (0, react.useMemo)(() => {
|
|
366
382
|
if (!banner || !content) return "";
|
|
367
383
|
return bannerStorageKey(config, content);
|
|
@@ -381,7 +397,7 @@ function PageBanner(props) {
|
|
|
381
397
|
if (!content) return null;
|
|
382
398
|
if (dismissed) return null;
|
|
383
399
|
const link = banner.link;
|
|
384
|
-
const linkLabel = link ? require_PageActions.resolveLocalizedText(link.label, currentLocale, config.
|
|
400
|
+
const linkLabel = link ? require_PageActions.resolveLocalizedText(link.label, currentLocale, config.locales?.default) : "";
|
|
385
401
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
386
402
|
className: "clarify-banner relative flex h-12 items-center border-b border-(--clarify-ui-accent-border) bg-(--clarify-ui-accent-background) px-4 text-sm text-(--clarify-ui-text) dark:border-white/10",
|
|
387
403
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -414,17 +430,17 @@ function PageBanner(props) {
|
|
|
414
430
|
//#endregion
|
|
415
431
|
//#region source/app/PageFooter.tsx
|
|
416
432
|
function localeForPath(config, pathname) {
|
|
417
|
-
const
|
|
418
|
-
if (!
|
|
433
|
+
const locales = config.locales;
|
|
434
|
+
if (!locales) return void 0;
|
|
419
435
|
const firstSegment = pathname.split("/").filter(Boolean)[0];
|
|
420
|
-
return
|
|
436
|
+
return locales.locales.find((locale) => locale.code === firstSegment)?.code ?? locales.default;
|
|
421
437
|
}
|
|
422
438
|
function FooterLink(arg0) {
|
|
423
439
|
const { link, locale, config } = arg0;
|
|
424
440
|
const external = link.external ?? require_PageActions.isExternalHref(link.href);
|
|
425
441
|
const href = external ? link.href : require_PageActions.localizeHref(link.href, config, locale);
|
|
426
442
|
const className = "clarify-footer-link no-underline transition";
|
|
427
|
-
const label = require_PageActions.resolveLocalizedText(link.label, locale, config.
|
|
443
|
+
const label = require_PageActions.resolveLocalizedText(link.label, locale, config.locales?.default);
|
|
428
444
|
if (external) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
429
445
|
href,
|
|
430
446
|
target: "_blank",
|
|
@@ -454,25 +470,22 @@ function PageFooter() {
|
|
|
454
470
|
const footer = config.footer;
|
|
455
471
|
const links = footer?.links ?? [];
|
|
456
472
|
const socials = Object.entries(footer?.socials ?? {});
|
|
457
|
-
const copyright = footer?.copyright ? require_PageActions.resolveLocalizedText(footer.copyright, locale, config.
|
|
458
|
-
if (!Boolean(copyright || links.length > 0 || socials.length > 0)) return
|
|
459
|
-
"aria-hidden": "true",
|
|
460
|
-
className: "clarify-page-footer mt-16 w-full border-t border-(--clarify-theme-tokens-colors-border) pt-8 lg:mt-24"
|
|
461
|
-
});
|
|
473
|
+
const copyright = footer?.copyright ? require_PageActions.resolveLocalizedText(footer.copyright, locale, config.locales?.default) : void 0;
|
|
474
|
+
if (!Boolean(copyright || links.length > 0 || socials.length > 0)) return null;
|
|
462
475
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
|
|
463
|
-
className: "clarify-page-footer
|
|
476
|
+
className: "clarify-page-footer w-full",
|
|
464
477
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
465
|
-
className: (0, clsx.default)("clarify-footer-content flex flex-col items-
|
|
478
|
+
className: (0, clsx.default)("clarify-footer-content flex flex-col items-start gap-2.5 text-left"),
|
|
466
479
|
children: [copyright ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
467
480
|
className: "clarify-footer-copyright m-0",
|
|
468
481
|
children: copyright
|
|
469
482
|
}) : null, links.length > 0 || socials.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
470
|
-
className: "clarify-footer-links flex flex-wrap justify-
|
|
483
|
+
className: "clarify-footer-links flex flex-wrap justify-start gap-x-4 gap-y-2",
|
|
471
484
|
children: [links.map((link) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FooterLink, {
|
|
472
485
|
link,
|
|
473
486
|
locale,
|
|
474
487
|
config
|
|
475
|
-
}, `${link.href}-${require_PageActions.resolveLocalizedText(link.label, locale, config.
|
|
488
|
+
}, `${link.href}-${require_PageActions.resolveLocalizedText(link.label, locale, config.locales?.default)}`)), socials.map(([name, href]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SocialLink, {
|
|
476
489
|
name,
|
|
477
490
|
href
|
|
478
491
|
}, name))]
|
|
@@ -495,40 +508,42 @@ function PageNavigation(arg0) {
|
|
|
495
508
|
const previous = pageRoutes[currentIndex - 1];
|
|
496
509
|
const next = pageRoutes[currentIndex + 1];
|
|
497
510
|
if (!previous && !next) return null;
|
|
511
|
+
const hasBothDirections = Boolean(previous && next);
|
|
498
512
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
|
|
499
|
-
className: "clarify-page-navigation mt-
|
|
513
|
+
className: (0, clsx.default)("clarify-page-navigation mt-12 grid border-t border-(--clarify-theme-tokens-colors-border)", hasBothDirections && "@3xl:grid-cols-2"),
|
|
500
514
|
"aria-label": t("navigation.previousNext"),
|
|
501
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageNavigationLink, {
|
|
515
|
+
children: [previous ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageNavigationLink, {
|
|
502
516
|
direction: "previous",
|
|
503
|
-
route: previous
|
|
504
|
-
|
|
517
|
+
route: previous,
|
|
518
|
+
separated: hasBothDirections
|
|
519
|
+
}) : null, next ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageNavigationLink, {
|
|
505
520
|
direction: "next",
|
|
506
|
-
route: next
|
|
507
|
-
|
|
521
|
+
route: next,
|
|
522
|
+
separated: hasBothDirections
|
|
523
|
+
}) : null]
|
|
508
524
|
});
|
|
509
525
|
}
|
|
510
526
|
function PageNavigationLink(arg0) {
|
|
511
|
-
const { direction, route } = arg0;
|
|
527
|
+
const { direction, route, separated } = arg0;
|
|
512
528
|
const t = require_i18n.useBuiltInText();
|
|
513
|
-
if (!route) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "hidden @3xl:block" });
|
|
514
529
|
const isNext = direction === "next";
|
|
515
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
530
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
|
|
516
531
|
to: require_PageActions.normalizeRoutePath(route.path),
|
|
517
|
-
className: (0, clsx.default)("group flex min-w-0
|
|
518
|
-
children:
|
|
519
|
-
|
|
520
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
521
|
-
className: "
|
|
522
|
-
children: [
|
|
523
|
-
className: "
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
+
className: (0, clsx.default)("group flex min-w-0 py-5 no-underline outline-none focus-visible:bg-(--clarify-ui-hover-background)", !isNext && "@3xl:pr-8", isNext && "@3xl:justify-end @3xl:pl-8 @3xl:text-right", isNext && separated && "border-t border-(--clarify-theme-tokens-colors-border) @3xl:border-t-0 @3xl:border-l"),
|
|
533
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
534
|
+
className: (0, clsx.default)("min-w-0", isNext && "ml-auto"),
|
|
535
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
536
|
+
className: (0, clsx.default)("clarify-page-navigation-label flex items-center gap-1.5 text-xs/5 font-medium text-(--clarify-theme-tokens-colors-muted)", isNext && "justify-end"),
|
|
537
|
+
children: [
|
|
538
|
+
!isNext ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "size-3.5 transition-transform group-hover:-translate-x-0.5" }) : null,
|
|
539
|
+
isNext ? t("navigation.next") : t("navigation.previous"),
|
|
540
|
+
isNext ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "size-3.5 transition-transform group-hover:translate-x-0.5" }) : null
|
|
541
|
+
]
|
|
542
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
543
|
+
className: "clarify-page-navigation-title mt-1 block truncate text-base/6 font-semibold text-(--clarify-theme-tokens-colors-foreground) transition-colors group-hover:text-(--clarify-theme-tokens-colors-primary)",
|
|
544
|
+
children: route.title
|
|
545
|
+
})]
|
|
546
|
+
})
|
|
532
547
|
});
|
|
533
548
|
}
|
|
534
549
|
//#endregion
|
|
@@ -771,19 +786,19 @@ function scrollToHash(hash) {
|
|
|
771
786
|
});
|
|
772
787
|
}
|
|
773
788
|
function explicitLocaleForPath(config, pathname) {
|
|
774
|
-
const
|
|
775
|
-
if (!
|
|
789
|
+
const locales = config.locales;
|
|
790
|
+
if (!locales) return void 0;
|
|
776
791
|
const firstSegment = pathname.split("/").filter(Boolean)[0];
|
|
777
|
-
return
|
|
792
|
+
return locales.locales.find((locale) => locale.code === firstSegment)?.code;
|
|
778
793
|
}
|
|
779
794
|
function fallbackLocale(config) {
|
|
780
|
-
return config.
|
|
795
|
+
return config.locales?.default;
|
|
781
796
|
}
|
|
782
797
|
function storedLocaleForConfig(config) {
|
|
783
|
-
return require_PageActions.getStoredLocalePreference(config.
|
|
798
|
+
return require_PageActions.getStoredLocalePreference(config.locales?.locales.map((locale) => locale.code));
|
|
784
799
|
}
|
|
785
800
|
function isDefaultLocale(config, locale) {
|
|
786
|
-
return Boolean(locale && config.
|
|
801
|
+
return Boolean(locale && config.locales?.default === locale);
|
|
787
802
|
}
|
|
788
803
|
function hasPath(nodes, pathname, locale) {
|
|
789
804
|
return nodes.some((node) => require_PageActions.isSameRoutePath(node.path, pathname, locale) || hasPath(node.children ?? [], pathname, locale));
|
|
@@ -833,7 +848,7 @@ function useRouteState(config, routes, navigation, pathname) {
|
|
|
833
848
|
explicitLocale,
|
|
834
849
|
storedLocale,
|
|
835
850
|
currentLocale,
|
|
836
|
-
currentLocaleConfig: config.
|
|
851
|
+
currentLocaleConfig: config.locales?.locales.find((locale) => locale.code === currentLocale),
|
|
837
852
|
notFoundRoute: currentRoute ? void 0 : notFoundRouteForPath(routes, pathname, currentLocale),
|
|
838
853
|
currentNavigation: navigationForLocale(navigation, currentLocale, pathname),
|
|
839
854
|
sections: sectionsForRoute(currentRoute)
|
|
@@ -857,7 +872,7 @@ function useStoredBannerDismissed(storageKey) {
|
|
|
857
872
|
}
|
|
858
873
|
function useBannerState(config, currentLocale) {
|
|
859
874
|
const banner = config.banner;
|
|
860
|
-
const bannerContent = banner ? require_PageActions.resolveLocalizedText(banner.content, currentLocale, config.
|
|
875
|
+
const bannerContent = banner ? require_PageActions.resolveLocalizedText(banner.content, currentLocale, config.locales?.default) : "";
|
|
861
876
|
const bannerStorageKey = banner && bannerContent ? `clarify:banner:dismissed:${config.title}:${bannerContent}` : void 0;
|
|
862
877
|
const storedBannerDismissed = useStoredBannerDismissed(banner?.dismissible ? bannerStorageKey : void 0);
|
|
863
878
|
const [dismissedBannerKey, setDismissedBannerKey] = (0, react.useState)();
|
|
@@ -1090,17 +1105,19 @@ function AppShell(arg0) {
|
|
|
1090
1105
|
});
|
|
1091
1106
|
}
|
|
1092
1107
|
function renderFooter() {
|
|
1093
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1094
|
-
|
|
1095
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1108
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1109
|
+
className: "clarify-page-footer-region mt-8 grid gap-5 border-t border-(--clarify-theme-tokens-colors-border) pt-6 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",
|
|
1110
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1111
|
+
className: "clarify-page-footer-slot min-w-0",
|
|
1112
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuntimeSlot, { name: "page.footer.before" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuntimeSlot, {
|
|
1113
|
+
name: "page.footer.replace",
|
|
1114
|
+
default: DefaultFooterComponent
|
|
1115
|
+
})]
|
|
1116
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1117
|
+
className: "clarify-page-attribution flex justify-end sm:self-end",
|
|
1101
1118
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BuiltWithClarify, {})
|
|
1102
|
-
})
|
|
1103
|
-
|
|
1119
|
+
})]
|
|
1120
|
+
});
|
|
1104
1121
|
}
|
|
1105
1122
|
function renderContent() {
|
|
1106
1123
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1843,8 +1860,7 @@ function createRandomTheme() {
|
|
|
1843
1860
|
colors: createRandomThemeColors(selection),
|
|
1844
1861
|
radius: { ...selection.radius }
|
|
1845
1862
|
},
|
|
1846
|
-
layout: { maxWidth: selection.maxWidth }
|
|
1847
|
-
editor: false
|
|
1863
|
+
layout: { maxWidth: selection.maxWidth }
|
|
1848
1864
|
};
|
|
1849
1865
|
}
|
|
1850
1866
|
//#endregion
|
|
@@ -1855,42 +1871,47 @@ var themePresets = {
|
|
|
1855
1871
|
preset: "default",
|
|
1856
1872
|
tokens: {
|
|
1857
1873
|
colors: {
|
|
1858
|
-
primary:
|
|
1859
|
-
|
|
1874
|
+
primary: {
|
|
1875
|
+
light: "#047857",
|
|
1876
|
+
dark: "#34d399"
|
|
1877
|
+
},
|
|
1878
|
+
accent: {
|
|
1879
|
+
light: "#0f766e",
|
|
1880
|
+
dark: "#5eead4"
|
|
1881
|
+
},
|
|
1860
1882
|
background: {
|
|
1861
|
-
light: "#
|
|
1862
|
-
dark: "#
|
|
1883
|
+
light: "#f8fafc",
|
|
1884
|
+
dark: "#0a0a0b"
|
|
1863
1885
|
},
|
|
1864
1886
|
foreground: {
|
|
1865
|
-
light: "#
|
|
1866
|
-
dark: "#
|
|
1887
|
+
light: "#172033",
|
|
1888
|
+
dark: "#f4f4f5"
|
|
1867
1889
|
},
|
|
1868
1890
|
surface: {
|
|
1869
1891
|
light: "#ffffff",
|
|
1870
1892
|
dark: "#18181b"
|
|
1871
1893
|
},
|
|
1872
1894
|
muted: {
|
|
1873
|
-
light: "#
|
|
1895
|
+
light: "#667085",
|
|
1874
1896
|
dark: "#a1a1aa"
|
|
1875
1897
|
},
|
|
1876
1898
|
border: {
|
|
1877
|
-
light: "rgb(15 23 42 / 0.
|
|
1878
|
-
dark: "rgb(255 255 255 / 0.
|
|
1899
|
+
light: "rgb(15 23 42 / 0.11)",
|
|
1900
|
+
dark: "rgb(255 255 255 / 0.11)"
|
|
1879
1901
|
},
|
|
1880
1902
|
codeBackground: {
|
|
1881
|
-
light: "#
|
|
1882
|
-
dark: "#
|
|
1903
|
+
light: "#f1f5f3",
|
|
1904
|
+
dark: "#171719"
|
|
1883
1905
|
}
|
|
1884
1906
|
},
|
|
1885
1907
|
radius: {
|
|
1886
1908
|
sm: "6px",
|
|
1887
|
-
md: "
|
|
1888
|
-
lg: "
|
|
1889
|
-
xl: "
|
|
1909
|
+
md: "8px",
|
|
1910
|
+
lg: "12px",
|
|
1911
|
+
xl: "16px"
|
|
1890
1912
|
}
|
|
1891
1913
|
},
|
|
1892
|
-
layout: { maxWidth: "82rem" }
|
|
1893
|
-
editor: false
|
|
1914
|
+
layout: { maxWidth: "82rem" }
|
|
1894
1915
|
},
|
|
1895
1916
|
base: {
|
|
1896
1917
|
preset: "base",
|
|
@@ -1930,8 +1951,7 @@ var themePresets = {
|
|
|
1930
1951
|
xl: "16px"
|
|
1931
1952
|
}
|
|
1932
1953
|
},
|
|
1933
|
-
layout: { maxWidth: "80rem" }
|
|
1934
|
-
editor: false
|
|
1954
|
+
layout: { maxWidth: "80rem" }
|
|
1935
1955
|
}
|
|
1936
1956
|
};
|
|
1937
1957
|
function cloneThemeColorValue(value) {
|
|
@@ -1953,8 +1973,7 @@ function cloneTheme(theme) {
|
|
|
1953
1973
|
},
|
|
1954
1974
|
radius: { ...theme.tokens.radius }
|
|
1955
1975
|
},
|
|
1956
|
-
layout: { ...theme.layout }
|
|
1957
|
-
editor: theme.editor
|
|
1976
|
+
layout: { ...theme.layout }
|
|
1958
1977
|
};
|
|
1959
1978
|
}
|
|
1960
1979
|
function isModeColorValue(value) {
|
|
@@ -2556,4 +2575,4 @@ Object.defineProperty(exports, "useSlot", {
|
|
|
2556
2575
|
}
|
|
2557
2576
|
});
|
|
2558
2577
|
|
|
2559
|
-
//# sourceMappingURL=ClarifyShell-
|
|
2578
|
+
//# sourceMappingURL=ClarifyShell-C2XnkFQ6.cjs.map
|