@clarify-labs/renderer 0.9.4 → 0.10.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-D2P0iZ_m.js → ClarifyShell-1LuBliwt.js} +124 -40
- package/output/ClarifyShell-1LuBliwt.js.map +1 -0
- package/output/{ClarifyShell-7r92MZg9.cjs → ClarifyShell-C6li72Ce.cjs} +138 -54
- package/output/ClarifyShell-C6li72Ce.cjs.map +1 -0
- package/output/MermaidViewer-B6-BMCJG.cjs +101 -0
- package/output/MermaidViewer-B6-BMCJG.cjs.map +1 -0
- package/output/MermaidViewer-dXsomvM7.js +98 -0
- package/output/MermaidViewer-dXsomvM7.js.map +1 -0
- package/output/{OpenApiOperation-Dhlz3JSx.js → OpenApiOperation-CqNM-no4.js} +274 -206
- package/output/OpenApiOperation-CqNM-no4.js.map +1 -0
- package/output/{OpenApiOperation-CyyPlZL6.cjs → OpenApiOperation-DK46w2dq.cjs} +305 -225
- package/output/OpenApiOperation-DK46w2dq.cjs.map +1 -0
- package/output/{PageActions-CTn2XkPg.cjs → PageActions-BjB6PYmL.cjs} +76 -735
- package/output/PageActions-BjB6PYmL.cjs.map +1 -0
- package/output/{PageActions-D0PA8Zv5.js → PageActions-D7K9LDGf.js} +67 -678
- package/output/PageActions-D7K9LDGf.js.map +1 -0
- package/output/SearchDialog-CIPvXMT3.cjs +414 -0
- package/output/SearchDialog-CIPvXMT3.cjs.map +1 -0
- package/output/SearchDialog-CxYLjRi5.js +411 -0
- package/output/SearchDialog-CxYLjRi5.js.map +1 -0
- package/output/app/AppShell.d.ts +2 -2
- package/output/app/SectionHashSync.d.ts +6 -0
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/components/MermaidViewer.d.ts +7 -0
- package/output/context.d.ts +1 -1
- package/output/core/context.d.ts +3 -4
- package/output/core/i18n.d.ts +1 -1
- package/output/core/index.d.ts +1 -1
- package/output/core/types.d.ts +36 -19
- package/output/i18n-DnqZHFT7.js +247 -0
- package/output/i18n-DnqZHFT7.js.map +1 -0
- package/output/i18n-b4iTLeia.cjs +294 -0
- package/output/i18n-b4iTLeia.cjs.map +1 -0
- package/output/index.cjs +91 -94
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +5 -5
- package/output/index.js +83 -86
- package/output/index.js.map +1 -1
- package/output/markdown.cjs +1 -1
- package/output/openapi/components/EndpointSections.d.ts +3 -1
- package/output/openapi/components/ExamplePanels.d.ts +3 -1
- package/output/openapi/components/OpenApiOperation.d.ts +3 -1
- package/output/openapi/components/OpenApiOperation.state.d.ts +3 -3
- package/output/openapi/components/SchemaProperties.d.ts +1 -0
- package/output/openapi/components/helpers.d.ts +2 -2
- package/output/openapi/entry.d.ts +0 -1
- package/output/openapi/lib/helpers.d.ts +5 -3
- package/output/openapi/lib/request-code.d.ts +2 -1
- package/output/openapi/lib/spec-path.d.ts +6 -1
- package/output/openapi/lib/utils.d.ts +10 -4
- package/output/preview.cjs +7 -5
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +5 -3
- package/output/preview.js.map +1 -1
- package/output/remark-Dd2WU50s.js.map +1 -1
- package/output/{remark-Dv3owbSH.cjs → remark-zSQT0MBv.cjs} +3 -3
- package/output/{remark-Dv3owbSH.cjs.map → remark-zSQT0MBv.cjs.map} +1 -1
- package/output/{render-CwSsfrs7.js → render-DKj24Jqw.js} +15 -8
- package/output/render-DKj24Jqw.js.map +1 -0
- package/output/{render-DXDSIfZ8.cjs → render-Di5B6Zc0.cjs} +15 -8
- package/output/render-Di5B6Zc0.cjs.map +1 -0
- package/output/renderer.css +55 -1
- package/output/runtime/ClarifyShell.d.ts +5 -6
- package/output/server.cjs +4 -4
- package/output/server.cjs.map +1 -1
- package/output/server.js +4 -4
- package/output/server.js.map +1 -1
- package/output/shell/Navigation.d.ts +1 -0
- package/output/shell/search/SearchDialog.d.ts +1 -1
- package/output/slots/RuntimeSlot.d.ts +7 -7
- package/output/slots/context.d.ts +5 -5
- package/output/slots/index.d.ts +2 -2
- package/output/slots/types.d.ts +1 -1
- package/output/utils/path.d.ts +1 -1
- package/package.json +10 -10
- package/output/ClarifyShell-7r92MZg9.cjs.map +0 -1
- package/output/ClarifyShell-D2P0iZ_m.js.map +0 -1
- package/output/OpenApiOperation-CyyPlZL6.cjs.map +0 -1
- package/output/OpenApiOperation-Dhlz3JSx.js.map +0 -1
- package/output/PageActions-CTn2XkPg.cjs.map +0 -1
- package/output/PageActions-D0PA8Zv5.js.map +0 -1
- package/output/render-CwSsfrs7.js.map +0 -1
- package/output/render-DXDSIfZ8.cjs.map +0 -1
- /package/output/{chunk-DakpK96I.cjs → rolldown-runtime-DakpK96I.cjs} +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as useConfig, i as OpenApiSpecsContext, n as ConfigContext, o as useConfigOptional, r as LocaleContext, s as useLocale, t as useBuiltInText } from "./i18n-DnqZHFT7.js";
|
|
2
|
+
import { C as isExternalHref, E as copyTextToClipboard, S as themeCookieName, a as SectionProvider, b as storeLocalePreference, d as normalizeRoutePath, f as resolveLocalizedText, g as getStoredLocalePreference, h as useTheme, i as Navigation, m as ThemeProvider, o as useSectionStore, r as Header, t as PageActionsProvider, u as isSameRoutePath, w as localizeHref } from "./PageActions-D7K9LDGf.js";
|
|
2
3
|
import clsx from "clsx";
|
|
3
4
|
import { Component, Suspense, createContext, lazy, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
5
|
import { Link, Route, Routes, useLocation, useNavigate } from "react-router-dom";
|
|
5
6
|
import { ChevronDown, ChevronLeft, ChevronRight, Settings, WandSparkles, X } from "lucide-react";
|
|
6
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
//#region source/slots/context.tsx
|
|
8
|
-
var
|
|
9
|
+
var UISlotContextValue = createContext(null);
|
|
9
10
|
/**
|
|
10
|
-
* Provides an isolated {@link
|
|
11
|
+
* Provides an isolated {@link UISlotContext} for a single slot component.
|
|
11
12
|
* `RuntimeSlot` wraps every rendered slot component with this provider.
|
|
12
13
|
*/
|
|
13
14
|
function SlotProvider(arg0) {
|
|
14
15
|
const { value, children } = arg0;
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
+
return /* @__PURE__ */ jsx(UISlotContextValue.Provider, {
|
|
16
17
|
value,
|
|
17
18
|
children
|
|
18
19
|
});
|
|
@@ -25,7 +26,7 @@ function SlotProvider(arg0) {
|
|
|
25
26
|
* not mounted through a Clarify slot.
|
|
26
27
|
*/
|
|
27
28
|
function useSlot() {
|
|
28
|
-
const context = useContext(
|
|
29
|
+
const context = useContext(UISlotContextValue);
|
|
29
30
|
if (!context) throw new Error("[clarify] useSlot must be called inside a slot component");
|
|
30
31
|
return context;
|
|
31
32
|
}
|
|
@@ -36,8 +37,8 @@ var RuntimeSlotsContext = createContext({ slots: {} });
|
|
|
36
37
|
* Makes the compiled slot registry and the current route available to every
|
|
37
38
|
* {@link RuntimeSlot} in the tree. Mounted once near the top of `AppShell`.
|
|
38
39
|
*/
|
|
39
|
-
function RuntimeSlotsProvider(
|
|
40
|
-
const { slots, route, children } =
|
|
40
|
+
function RuntimeSlotsProvider(props) {
|
|
41
|
+
const { slots, route, children } = props;
|
|
41
42
|
return /* @__PURE__ */ jsx(RuntimeSlotsContext.Provider, {
|
|
42
43
|
value: {
|
|
43
44
|
slots: slots ?? {},
|
|
@@ -58,8 +59,8 @@ function RuntimeSlotsProvider(arg0) {
|
|
|
58
59
|
* compatibility with `renderToString`. Otherwise, `React.lazy` + `Suspense`
|
|
59
60
|
* is used for client-side code-splitting.
|
|
60
61
|
*/
|
|
61
|
-
function RuntimeSlot(
|
|
62
|
-
const { name, default: DefaultComponent } =
|
|
62
|
+
function RuntimeSlot(props) {
|
|
63
|
+
const { name, default: DefaultComponent } = props;
|
|
63
64
|
const { slots, route } = useContext(RuntimeSlotsContext);
|
|
64
65
|
const locale = useLocale();
|
|
65
66
|
const entries = slots[name];
|
|
@@ -90,7 +91,7 @@ function RuntimeSlot(arg0) {
|
|
|
90
91
|
function SlotEntryRenderer(props) {
|
|
91
92
|
const { entry } = props;
|
|
92
93
|
if (entry._resolved) return /* @__PURE__ */ jsx(entry._resolved, {});
|
|
93
|
-
return /* @__PURE__ */ jsx(LazySlotComponent, { loader: entry.
|
|
94
|
+
return /* @__PURE__ */ jsx(LazySlotComponent, { loader: entry.loadComponent });
|
|
94
95
|
}
|
|
95
96
|
function LazySlotComponent(props) {
|
|
96
97
|
const { loader } = props;
|
|
@@ -243,13 +244,15 @@ function PageErrorPanel(props) {
|
|
|
243
244
|
async function copyStack() {
|
|
244
245
|
if (!await copyTextToClipboard(stackText)) return;
|
|
245
246
|
setCopiedStack(true);
|
|
246
|
-
|
|
247
|
+
setTimeout(() => setCopiedStack(false), 1600);
|
|
247
248
|
}
|
|
248
249
|
return /* @__PURE__ */ jsx(RenderErrorPanel, {
|
|
249
250
|
title,
|
|
250
251
|
description,
|
|
251
252
|
refreshLabel: reloadLabel,
|
|
252
|
-
onRefresh: () =>
|
|
253
|
+
onRefresh: () => {
|
|
254
|
+
if (typeof window !== "undefined") window.location.reload();
|
|
255
|
+
},
|
|
253
256
|
metadata: [[pathLabel, path], [typeLabel, error.name]].map(([label, value]) => ({
|
|
254
257
|
label,
|
|
255
258
|
value: String(value)
|
|
@@ -385,7 +388,7 @@ function PageBanner(props) {
|
|
|
385
388
|
className: "clarify-banner-dismiss absolute right-3 inline-flex size-8 items-center justify-center rounded-full text-(--clarify-ui-text-soft) transition hover:bg-(--clarify-ui-hover-background) hover:text-(--clarify-ui-text-strong)",
|
|
386
389
|
"aria-label": "Dismiss announcement",
|
|
387
390
|
onClick: () => {
|
|
388
|
-
if (storageKey) window.localStorage.setItem(storageKey, "1");
|
|
391
|
+
if (storageKey && typeof window !== "undefined") window.localStorage.setItem(storageKey, "1");
|
|
389
392
|
setDismissed(true);
|
|
390
393
|
},
|
|
391
394
|
children: /* @__PURE__ */ jsx(X, {
|
|
@@ -619,6 +622,71 @@ function PageSkeleton() {
|
|
|
619
622
|
});
|
|
620
623
|
}
|
|
621
624
|
//#endregion
|
|
625
|
+
//#region source/app/SectionHashSync.tsx
|
|
626
|
+
var HASH_UPDATE_DEBOUNCE_MS = 120;
|
|
627
|
+
function replaceHash(sectionId) {
|
|
628
|
+
if (typeof window === "undefined") return;
|
|
629
|
+
const nextHash = sectionId ? `#${encodeURIComponent(sectionId)}` : "";
|
|
630
|
+
if (window.location.hash === nextHash) return;
|
|
631
|
+
window.history.replaceState(window.history.state, "", `${window.location.pathname}${window.location.search}${nextHash}`);
|
|
632
|
+
}
|
|
633
|
+
function useReleaseHashSyncOnManualScroll(hashScrollSuppressedUntilRef) {
|
|
634
|
+
useEffect(() => {
|
|
635
|
+
if (typeof window === "undefined") return;
|
|
636
|
+
const release = () => {
|
|
637
|
+
hashScrollSuppressedUntilRef.current = 0;
|
|
638
|
+
};
|
|
639
|
+
const releaseOnScrollKey = (event) => {
|
|
640
|
+
if ([
|
|
641
|
+
"ArrowDown",
|
|
642
|
+
"ArrowUp",
|
|
643
|
+
"End",
|
|
644
|
+
"Home",
|
|
645
|
+
"PageDown",
|
|
646
|
+
"PageUp",
|
|
647
|
+
" "
|
|
648
|
+
].includes(event.key)) release();
|
|
649
|
+
};
|
|
650
|
+
window.addEventListener("wheel", release, { passive: true });
|
|
651
|
+
window.addEventListener("touchmove", release, { passive: true });
|
|
652
|
+
window.addEventListener("keydown", releaseOnScrollKey);
|
|
653
|
+
return () => {
|
|
654
|
+
window.removeEventListener("wheel", release);
|
|
655
|
+
window.removeEventListener("touchmove", release);
|
|
656
|
+
window.removeEventListener("keydown", releaseOnScrollKey);
|
|
657
|
+
};
|
|
658
|
+
}, [hashScrollSuppressedUntilRef]);
|
|
659
|
+
}
|
|
660
|
+
function SectionHashSync(arg0) {
|
|
661
|
+
const { hashScrollSuppressedUntilRef } = arg0;
|
|
662
|
+
const location = useLocation();
|
|
663
|
+
const hashUpdateTimeoutRef = useRef(void 0);
|
|
664
|
+
const sections = useSectionStore((state) => state.sections);
|
|
665
|
+
const visibleSections = useSectionStore((state) => state.visibleSections);
|
|
666
|
+
useReleaseHashSyncOnManualScroll(hashScrollSuppressedUntilRef);
|
|
667
|
+
useEffect(() => {
|
|
668
|
+
if (!sections.length || !visibleSections.length) return;
|
|
669
|
+
const visibleSectionId = visibleSections.find((id) => id !== "_top" && sections.some((section) => section.id === id));
|
|
670
|
+
const hashSectionId = location.hash ? safeDecodeURIComponent(location.hash.slice(1)) : void 0;
|
|
671
|
+
if (hashSectionId && Date.now() < hashScrollSuppressedUntilRef.current && !visibleSections.includes(hashSectionId)) return;
|
|
672
|
+
hashUpdateTimeoutRef.current = setTimeout(() => {
|
|
673
|
+
replaceHash(visibleSections[0] === "_top" ? void 0 : visibleSectionId);
|
|
674
|
+
}, HASH_UPDATE_DEBOUNCE_MS);
|
|
675
|
+
return () => {
|
|
676
|
+
if (hashUpdateTimeoutRef.current !== void 0) {
|
|
677
|
+
clearTimeout(hashUpdateTimeoutRef.current);
|
|
678
|
+
hashUpdateTimeoutRef.current = void 0;
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
}, [
|
|
682
|
+
hashScrollSuppressedUntilRef,
|
|
683
|
+
location.hash,
|
|
684
|
+
sections,
|
|
685
|
+
visibleSections
|
|
686
|
+
]);
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
//#endregion
|
|
622
690
|
//#region source/app/AppShell.tsx
|
|
623
691
|
function BannerSlot(props) {
|
|
624
692
|
const { activeBannerKey, dismissedBannerKey, bannerResolved, onDismiss, config, locale } = props;
|
|
@@ -659,6 +727,7 @@ function resolveRouteComponent(route) {
|
|
|
659
727
|
return route.component;
|
|
660
728
|
}
|
|
661
729
|
function scrollToHash(hash) {
|
|
730
|
+
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
662
731
|
if (!hash) return;
|
|
663
732
|
const targetId = safeDecodeURIComponent(hash.slice(1));
|
|
664
733
|
const tryScrollToTarget = (attempt = 0) => {
|
|
@@ -696,25 +765,22 @@ function storedLocaleForConfig(config) {
|
|
|
696
765
|
function isDefaultLocale(config, locale) {
|
|
697
766
|
return Boolean(locale && config.i18n?.defaultLocale === locale);
|
|
698
767
|
}
|
|
699
|
-
function
|
|
700
|
-
return
|
|
701
|
-
}
|
|
702
|
-
function hasPath(nodes, pathname) {
|
|
703
|
-
return nodes.some((node) => isSameRoutePath(node.path, pathname) || hasPath(node.children ?? [], pathname));
|
|
768
|
+
function hasPath(nodes, pathname, locale) {
|
|
769
|
+
return nodes.some((node) => isSameRoutePath(node.path, pathname, locale) || hasPath(node.children ?? [], pathname, locale));
|
|
704
770
|
}
|
|
705
|
-
function navigationFromTabs(
|
|
771
|
+
function navigationFromTabs(tabs, pathname, locale) {
|
|
706
772
|
return {
|
|
707
|
-
items:
|
|
708
|
-
tabs
|
|
773
|
+
items: tabs.find((tab) => isSameRoutePath(tab.path, pathname, locale) || hasPath(tab.children, pathname, locale))?.children ?? tabs[0]?.children ?? [],
|
|
774
|
+
tabs
|
|
709
775
|
};
|
|
710
776
|
}
|
|
711
777
|
function navigationForLocale(navigation, locale, pathname) {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
778
|
+
switch (navigation.kind) {
|
|
779
|
+
case "flat": return { items: navigation.nodes };
|
|
780
|
+
case "tabbed": return navigationFromTabs(navigation.tabs, pathname, locale);
|
|
781
|
+
case "localized": return { items: locale ? navigation.locales[locale] ?? [] : [] };
|
|
782
|
+
case "localized-tabbed": return locale && navigation.locales[locale] ? navigationFromTabs(navigation.locales[locale].tabs, pathname, locale) : { items: [] };
|
|
783
|
+
}
|
|
718
784
|
}
|
|
719
785
|
function pageTitle(config, route) {
|
|
720
786
|
const routeTitle = route?.title?.trim();
|
|
@@ -767,7 +833,7 @@ function emptySubscribe() {
|
|
|
767
833
|
return () => {};
|
|
768
834
|
}
|
|
769
835
|
function useStoredBannerDismissed(storageKey) {
|
|
770
|
-
return useSyncExternalStore(emptySubscribe, () => Boolean(storageKey && window.localStorage.getItem(storageKey) === "1"), () => true);
|
|
836
|
+
return useSyncExternalStore(emptySubscribe, () => Boolean(storageKey && typeof window !== "undefined" && window.localStorage.getItem(storageKey) === "1"), () => true);
|
|
771
837
|
}
|
|
772
838
|
function useBannerState(config, currentLocale) {
|
|
773
839
|
const banner = config.banner;
|
|
@@ -785,7 +851,7 @@ function useBannerState(config, currentLocale) {
|
|
|
785
851
|
};
|
|
786
852
|
}
|
|
787
853
|
function useAppShellNavigationEffects(arg0) {
|
|
788
|
-
const { config, currentRoute, explicitLocale, location, navigate, pathname, storedLocale } = arg0;
|
|
854
|
+
const { config, currentRoute, explicitLocale, hashScrollSuppressedUntilRef, location, navigate, pathname, storedLocale } = arg0;
|
|
789
855
|
useEffect(() => {
|
|
790
856
|
if (explicitLocale) storeLocalePreference(explicitLocale);
|
|
791
857
|
}, [explicitLocale]);
|
|
@@ -805,7 +871,9 @@ function useAppShellNavigationEffects(arg0) {
|
|
|
805
871
|
storedLocale
|
|
806
872
|
]);
|
|
807
873
|
useEffect(() => {
|
|
874
|
+
if (typeof window === "undefined") return;
|
|
808
875
|
if (location.hash) {
|
|
876
|
+
hashScrollSuppressedUntilRef.current = Date.now() + 1200;
|
|
809
877
|
scrollToHash(location.hash);
|
|
810
878
|
return;
|
|
811
879
|
}
|
|
@@ -816,7 +884,11 @@ function useAppShellNavigationEffects(arg0) {
|
|
|
816
884
|
window.requestAnimationFrame(() => {
|
|
817
885
|
window.dispatchEvent(new Event("scroll"));
|
|
818
886
|
});
|
|
819
|
-
}, [
|
|
887
|
+
}, [
|
|
888
|
+
hashScrollSuppressedUntilRef,
|
|
889
|
+
location.hash,
|
|
890
|
+
location.pathname
|
|
891
|
+
]);
|
|
820
892
|
}
|
|
821
893
|
function useAppShellDocumentEffects(arg0) {
|
|
822
894
|
const { currentLocale, currentLocaleConfig, config, route } = arg0;
|
|
@@ -903,6 +975,7 @@ function AppShell(arg0) {
|
|
|
903
975
|
const pathname = normalizeRoutePath(location.pathname);
|
|
904
976
|
const headerRef = useRef(null);
|
|
905
977
|
const headerTopAreaRef = useRef(null);
|
|
978
|
+
const hashScrollSuppressedUntilRef = useRef(0);
|
|
906
979
|
const { currentRoute, explicitLocale, storedLocale, currentLocale, currentLocaleConfig, notFoundRoute, currentNavigation, sections } = useRouteState(config, routes, navigation, pathname);
|
|
907
980
|
const text = useBuiltInText(currentLocale);
|
|
908
981
|
const { activeBannerKey, bannerResolved, dismissedBannerKey, hasBanner, dismissBanner } = useBannerState(config, currentLocale);
|
|
@@ -912,6 +985,7 @@ function AppShell(arg0) {
|
|
|
912
985
|
config,
|
|
913
986
|
currentRoute,
|
|
914
987
|
explicitLocale,
|
|
988
|
+
hashScrollSuppressedUntilRef,
|
|
915
989
|
location,
|
|
916
990
|
navigate,
|
|
917
991
|
pathname,
|
|
@@ -953,7 +1027,10 @@ function AppShell(arg0) {
|
|
|
953
1027
|
className: "clarify-sidebar hidden lg:block lg:self-stretch lg:bg-(--clarify-theme-tokens-colors-background) lg:px-5 xl:px-6",
|
|
954
1028
|
children: /* @__PURE__ */ jsx("div", {
|
|
955
1029
|
className: clsx("clarify-sidebar-scroll lg:sticky lg:z-30 lg:overflow-y-auto lg:pb-8", layoutConfig.sidebarScrollClassName),
|
|
956
|
-
children: /* @__PURE__ */ jsx(Navigation, {
|
|
1030
|
+
children: /* @__PURE__ */ jsx(Navigation, {
|
|
1031
|
+
navigation: currentNavigation.items,
|
|
1032
|
+
currentLocale
|
|
1033
|
+
})
|
|
957
1034
|
})
|
|
958
1035
|
});
|
|
959
1036
|
}
|
|
@@ -1035,7 +1112,11 @@ function AppShell(arg0) {
|
|
|
1035
1112
|
children: /* @__PURE__ */ jsxs(SectionProvider, {
|
|
1036
1113
|
sections,
|
|
1037
1114
|
headerTopAreaRef,
|
|
1038
|
-
children: [
|
|
1115
|
+
children: [
|
|
1116
|
+
/* @__PURE__ */ jsx(SectionHashSync, { hashScrollSuppressedUntilRef }),
|
|
1117
|
+
renderHeader(),
|
|
1118
|
+
renderLayout()
|
|
1119
|
+
]
|
|
1039
1120
|
})
|
|
1040
1121
|
})
|
|
1041
1122
|
});
|
|
@@ -2145,10 +2226,10 @@ function useThemeEditorState(arg0) {
|
|
|
2145
2226
|
try {
|
|
2146
2227
|
await navigator.clipboard.writeText(configSource);
|
|
2147
2228
|
setCopyState("copied");
|
|
2148
|
-
|
|
2229
|
+
setTimeout(() => setCopyState("idle"), 1400);
|
|
2149
2230
|
} catch {
|
|
2150
2231
|
setCopyState("failed");
|
|
2151
|
-
|
|
2232
|
+
setTimeout(() => setCopyState("idle"), 1400);
|
|
2152
2233
|
}
|
|
2153
2234
|
}
|
|
2154
2235
|
return {
|
|
@@ -2327,25 +2408,28 @@ function ThemeRoot(props) {
|
|
|
2327
2408
|
//#region source/runtime/ClarifyShell.tsx
|
|
2328
2409
|
/**
|
|
2329
2410
|
* Shared provider chain used by both client-side render and server-side
|
|
2330
|
-
* renderToHTML. Wraps AppShell with ConfigContext →
|
|
2411
|
+
* renderToHTML. Wraps AppShell with ConfigContext → OpenApiSpecsContext →
|
|
2331
2412
|
* ThemeProvider → ThemeRoot.
|
|
2332
2413
|
*
|
|
2333
2414
|
* The outer Router (BrowserRouter / StaticRouter) is left to the caller
|
|
2334
2415
|
* so each entry point can supply the correct router variant.
|
|
2335
2416
|
*/
|
|
2336
2417
|
function ClarifyShell(props) {
|
|
2337
|
-
const { config, routes, navigation,
|
|
2418
|
+
const { config, routes, navigation, openApiSpecs, runtimeSlots, themeEditor = false } = props;
|
|
2338
2419
|
return /* @__PURE__ */ jsx(ConfigContext.Provider, {
|
|
2339
2420
|
value: config,
|
|
2340
|
-
children: /* @__PURE__ */ jsx(
|
|
2341
|
-
value:
|
|
2421
|
+
children: /* @__PURE__ */ jsx(OpenApiSpecsContext.Provider, {
|
|
2422
|
+
value: openApiSpecs,
|
|
2342
2423
|
children: /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(ThemeRoot, {
|
|
2343
2424
|
theme: config.theme,
|
|
2344
2425
|
themeEditor,
|
|
2345
2426
|
children: /* @__PURE__ */ jsx(AppShell, {
|
|
2346
2427
|
config,
|
|
2347
2428
|
routes,
|
|
2348
|
-
navigation: navigation ??
|
|
2429
|
+
navigation: navigation ?? {
|
|
2430
|
+
kind: "flat",
|
|
2431
|
+
nodes: []
|
|
2432
|
+
},
|
|
2349
2433
|
runtimeSlots
|
|
2350
2434
|
})
|
|
2351
2435
|
}) })
|
|
@@ -2355,4 +2439,4 @@ function ClarifyShell(props) {
|
|
|
2355
2439
|
//#endregion
|
|
2356
2440
|
export { themeBootstrapScript as a, AppShell as c, RenderErrorPanel as d, BuiltWithClarify as f, useSlot as g, SlotProvider as h, themeEditorPresets as i, PageFooter as l, RuntimeSlotsProvider as m, ThemeEditor as n, themePresets as o, RuntimeSlot as p, applyThemeVariables as r, themeStorageKey as s, ClarifyShell as t, PageBanner as u };
|
|
2357
2441
|
|
|
2358
|
-
//# sourceMappingURL=ClarifyShell-
|
|
2442
|
+
//# sourceMappingURL=ClarifyShell-1LuBliwt.js.map
|