@unterberg/nivel 0.1.4 → 0.1.6

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.
@@ -19,30 +19,41 @@ import {
19
19
  // src/runtime/client/AppLayout.tsx
20
20
  import { cmMerge as cmMerge5 } from "@classmatejs/react";
21
21
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
22
- import { useState as useState4 } from "react";
23
- import { usePageContext as usePageContext5 } from "vike-react/usePageContext";
22
+ import { usePageContext as usePageContext4 } from "vike-react/usePageContext";
24
23
 
25
24
  // src/runtime/client/components/Navbar/index.tsx
26
25
  import cm2, { cmMerge as cmMerge4 } from "@classmatejs/react";
27
26
  import { ChevronDown, TextSearch } from "lucide-react";
28
- import { useCallback, useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
29
- import { usePageContext as usePageContext4 } from "vike-react/usePageContext";
27
+ import { memo as memo3, useCallback, useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
28
+ import { usePageContext as usePageContext3 } from "vike-react/usePageContext";
30
29
 
31
30
  // src/runtime/client/docsGlobalContext.ts
31
+ import { createContext, createElement, useContext } from "react";
32
32
  import { usePageContext } from "vike-react/usePageContext";
33
- var getDocsGlobalContext = (pageContext) => {
33
+ var DocsGlobalContext = createContext(null);
34
+ var getDocsFromGlobalContext = (pageContext) => {
34
35
  const docs = pageContext.globalContext?.docs;
35
36
  if (!docs) {
36
37
  throw new Error("Missing docs global context data.");
37
38
  }
38
39
  return docs;
39
40
  };
41
+ var DocsGlobalContextProvider = ({ children, docs }) => {
42
+ return createElement(DocsGlobalContext.Provider, { value: docs }, children);
43
+ };
40
44
  var useDocsGlobalContext = () => {
41
- return getDocsGlobalContext(usePageContext());
45
+ const docs = useContext(DocsGlobalContext);
46
+ if (!docs) {
47
+ throw new Error("Missing docs global context provider.");
48
+ }
49
+ return docs;
50
+ };
51
+ var useDocsFromPageGlobalContext = () => {
52
+ return getDocsFromGlobalContext(usePageContext());
42
53
  };
43
54
 
44
55
  // src/runtime/client/store/runtime-store.tsx
45
- import { createContext, useContext } from "react";
56
+ import { createContext as createContext2, useContext as useContext2 } from "react";
46
57
  import { useStore } from "zustand";
47
58
  import { createStore } from "zustand/vanilla";
48
59
  import { jsx } from "react/jsx-runtime";
@@ -51,11 +62,56 @@ var defaultDocsSearchState = {
51
62
  query: ""
52
63
  };
53
64
  var defaultDocsSidebarState = {
54
- openNodes: {},
55
- scrollTop: 0
65
+ openNodes: {}
66
+ };
67
+ var defaultDocsRouteState = {
68
+ currentHref: "",
69
+ currentSectionId: null,
70
+ pageTitle: "",
71
+ headings: [],
72
+ tableOfContents: false,
73
+ previousPage: null,
74
+ nextPage: null
56
75
  };
57
76
  var createDocsRuntimeStore = () => {
58
77
  return createStore()((set) => {
78
+ const routeActions = {
79
+ setPageData: (data) => set((state) => {
80
+ const nextRouteState = {
81
+ ...state.routeState,
82
+ currentHref: data.page.href,
83
+ currentSectionId: data.page.sectionId,
84
+ pageTitle: data.page.title,
85
+ headings: data.headings,
86
+ tableOfContents: data.page.tableOfContents,
87
+ previousPage: data.previousPage,
88
+ nextPage: data.nextPage
89
+ };
90
+ if (state.routeState.currentHref === nextRouteState.currentHref && state.routeState.currentSectionId === nextRouteState.currentSectionId && state.routeState.pageTitle === nextRouteState.pageTitle && state.routeState.headings === nextRouteState.headings && state.routeState.tableOfContents === nextRouteState.tableOfContents && state.routeState.previousPage === nextRouteState.previousPage && state.routeState.nextPage === nextRouteState.nextPage) {
91
+ return state;
92
+ }
93
+ return {
94
+ routeState: nextRouteState
95
+ };
96
+ }),
97
+ clearPageData: () => set((state) => {
98
+ if (state.routeState.currentHref === defaultDocsRouteState.currentHref && state.routeState.currentSectionId === defaultDocsRouteState.currentSectionId && state.routeState.pageTitle === defaultDocsRouteState.pageTitle && state.routeState.headings === defaultDocsRouteState.headings && state.routeState.tableOfContents === defaultDocsRouteState.tableOfContents && state.routeState.previousPage === defaultDocsRouteState.previousPage && state.routeState.nextPage === defaultDocsRouteState.nextPage) {
99
+ return state;
100
+ }
101
+ return {
102
+ routeState: {
103
+ ...state.routeState,
104
+ currentHref: defaultDocsRouteState.currentHref,
105
+ currentSectionId: defaultDocsRouteState.currentSectionId,
106
+ pageTitle: defaultDocsRouteState.pageTitle,
107
+ headings: defaultDocsRouteState.headings,
108
+ tableOfContents: defaultDocsRouteState.tableOfContents,
109
+ previousPage: defaultDocsRouteState.previousPage,
110
+ nextPage: defaultDocsRouteState.nextPage
111
+ }
112
+ };
113
+ })
114
+ };
59
115
  const searchActions = {
60
116
  open: () => set((state) => {
61
117
  if (state.searchState.isOpen) {
@@ -122,20 +178,11 @@ var createDocsRuntimeStore = () => {
122
178
  }
123
179
  }
124
180
  };
125
- }),
126
- setScrollTop: (scrollTop) => set((state) => {
127
- if (state.sidebarState.scrollTop === scrollTop) {
128
- return state;
129
- }
130
- return {
131
- sidebarState: {
132
- ...state.sidebarState,
133
- scrollTop
134
- }
135
- };
136
181
  })
137
182
  };
138
183
  return {
184
+ routeActions,
185
+ routeState: defaultDocsRouteState,
139
186
  searchActions,
140
187
  searchState: defaultDocsSearchState,
141
188
  sidebarActions,
@@ -143,12 +190,12 @@ var createDocsRuntimeStore = () => {
143
190
  };
144
191
  });
145
192
  };
146
- var DocsRuntimeStoreContext = createContext(null);
193
+ var DocsRuntimeStoreContext = createContext2(null);
147
194
  var DocsRuntimeStoreProvider = ({ children, store }) => {
148
195
  return /* @__PURE__ */ jsx(DocsRuntimeStoreContext.Provider, { value: store, children });
149
196
  };
150
197
  var useDocsRuntimeStoreApi = () => {
151
- const store = useContext(DocsRuntimeStoreContext);
198
+ const store = useContext2(DocsRuntimeStoreContext);
152
199
  if (store === null) {
153
200
  throw new Error("Missing docs runtime store provider.");
154
201
  }
@@ -179,6 +226,17 @@ var useDocsSidebarStore = (selector) => {
179
226
  var useDocsSidebarActions = () => {
180
227
  return useDocsRuntimeStore((state) => state.sidebarActions);
181
228
  };
229
+ var useDocsRouteStore = (selector) => {
230
+ return useDocsRuntimeStore(
231
+ (state) => selector({
232
+ ...state.routeState,
233
+ ...state.routeActions
234
+ })
235
+ );
236
+ };
237
+ var useDocsRouteActions = () => {
238
+ return useDocsRuntimeStore((state) => state.routeActions);
239
+ };
182
240
 
183
241
  // src/runtime/client/components/Brand.tsx
184
242
  import { cmMerge } from "@classmatejs/react";
@@ -242,7 +300,7 @@ var LayoutComponent = cm.div.variants({
242
300
  import { cmMerge as cmMerge2 } from "@classmatejs/react";
243
301
  import { useQuery } from "@tanstack/react-query";
244
302
  import { ArrowRightFromLine, MessageCircleQuestion, Search as SearchIcon, TriangleAlert } from "lucide-react";
245
- import { useEffect, useRef, useState } from "react";
303
+ import { memo, useEffect, useRef, useState } from "react";
246
304
  import { createPortal } from "react-dom";
247
305
  import { usePageContext as usePageContext2 } from "vike-react/usePageContext";
248
306
 
@@ -323,6 +381,9 @@ var mapHitToSearchResult = (hit, config) => {
323
381
  };
324
382
  var searchAlgoliaIndex = async (options) => {
325
383
  const { config, query, signal } = options;
384
+ if (!config) {
385
+ throw new Error("Algolia search is not configured.");
386
+ }
326
387
  const response = await fetch(buildSearchUrl(config.appId, config.indexName), {
327
388
  method: "POST",
328
389
  signal,
@@ -360,9 +421,8 @@ var useDebouncedValue = (value, delayMs) => {
360
421
  }, [delayMs, value]);
361
422
  return debouncedValue;
362
423
  };
363
- var SearchTrigger = () => {
364
- const pageContext = usePageContext2();
365
- const docs = getDocsGlobalContext(pageContext);
424
+ var SearchTrigger = memo(() => {
425
+ const docs = useDocsGlobalContext();
366
426
  const { open, setQuery } = useDocsSearchActions();
367
427
  const query = useDocsSearchStore((state) => state.query);
368
428
  const [isSearchHovered, setIsSearchHovered] = useState(false);
@@ -403,16 +463,16 @@ var SearchTrigger = () => {
403
463
  ) }),
404
464
  /* @__PURE__ */ jsx3("button", { type: "button", className: "btn btn-ghost btn-square md:hidden", "aria-label": "Search docs", onClick: open, children: /* @__PURE__ */ jsx3(SearchIcon, { className: "h-4 w-4" }) })
405
465
  ] });
406
- };
407
- var Search = () => {
408
- const pageContext = usePageContext2();
409
- const docs = getDocsGlobalContext(pageContext);
466
+ });
467
+ var Search = memo(() => {
468
+ const docs = useDocsGlobalContext();
469
+ const { urlPathname } = usePageContext2();
410
470
  const { close, setQuery } = useDocsSearchActions();
411
471
  const isOpen = useDocsSearchStore((state) => state.isOpen);
412
472
  const query = useDocsSearchStore((state) => state.query);
413
473
  const containerRef = useRef(null);
414
474
  const suggestionBoxRef = useRef(null);
415
- const previousPathnameRef = useRef(pageContext.urlPathname);
475
+ const previousPathnameRef = useRef(urlPathname);
416
476
  const debouncedQuery = useDebouncedValue(query, QUERY_DEBOUNCE_MS);
417
477
  const normalizedQuery = debouncedQuery.trim();
418
478
  const canSearch = Boolean(docs.algolia) && normalizedQuery.length >= MIN_QUERY_LENGTH;
@@ -423,11 +483,11 @@ var Search = () => {
423
483
  retry: false
424
484
  });
425
485
  useEffect(() => {
426
- if (previousPathnameRef.current !== pageContext.urlPathname) {
486
+ if (previousPathnameRef.current !== urlPathname) {
427
487
  close();
428
- previousPathnameRef.current = pageContext.urlPathname;
488
+ previousPathnameRef.current = urlPathname;
429
489
  }
430
- }, [close, pageContext.urlPathname]);
490
+ }, [close, urlPathname]);
431
491
  useEffect(() => {
432
492
  if (!isOpen) {
433
493
  return;
@@ -466,7 +526,7 @@ var Search = () => {
466
526
  results: searchQuery.data ?? []
467
527
  }
468
528
  ) });
469
- };
529
+ });
470
530
  var SearchSuggestionBox = ({
471
531
  contentRef,
472
532
  isError,
@@ -556,7 +616,7 @@ var SearchSuggestionBox = ({
556
616
  };
557
617
 
558
618
  // src/runtime/client/components/SocialLinks.tsx
559
- import { usePageContext as usePageContext3 } from "vike-react/usePageContext";
619
+ import { memo as memo2 } from "react";
560
620
  import { jsx as jsx4 } from "react/jsx-runtime";
561
621
  var _iconAssets = {
562
622
  github: nivelAssetUrl("brands/github.svg"),
@@ -577,9 +637,8 @@ var SocialIconElement = ({ icon, href }) => {
577
637
  }
578
638
  ) });
579
639
  };
580
- var SocialIcons = () => {
581
- const pageContext = usePageContext3();
582
- const docs = getDocsGlobalContext(pageContext);
640
+ var SocialIcons = memo2(() => {
641
+ const docs = useDocsGlobalContext();
583
642
  const socialEntries = Object.entries(docs.social ?? {}).filter(
584
643
  (entry) => entry[0] in _iconAssets && typeof entry[1] === "string" && entry[1].length > 0
585
644
  );
@@ -587,7 +646,7 @@ var SocialIcons = () => {
587
646
  return null;
588
647
  }
589
648
  return /* @__PURE__ */ jsx4("ul", { className: "flex items-center gap-1", children: socialEntries.map(([platform, href]) => /* @__PURE__ */ jsx4(SocialIconElement, { icon: platform, href }, platform)) });
590
- };
649
+ });
591
650
  var SocialLinks_default = SocialIcons;
592
651
 
593
652
  // src/runtime/client/components/ThemeSwitch.tsx
@@ -730,86 +789,84 @@ var MegaMenu = ({
730
789
  resizeObserver.disconnect();
731
790
  };
732
791
  }, [visibleSectionElement, visibleSectionId]);
733
- return (
734
- // biome-ignore lint/a11y/noStaticElementInteractions: ok
735
- /* @__PURE__ */ jsxs4(
736
- "div",
737
- {
738
- className: cmMerge3(
739
- "fixed top-13 left-0 z-3 w-full pt-3",
740
- isActive ? "pointer-events-auto" : "pointer-events-none"
792
+ return /* @__PURE__ */ jsxs4(
793
+ "div",
794
+ {
795
+ className: cmMerge3(
796
+ "fixed top-13 left-0 z-3 w-full pt-3",
797
+ isActive ? "pointer-events-auto" : "pointer-events-none"
798
+ ),
799
+ onPointerEnter: () => onOpen(visibleSectionId),
800
+ onPointerLeave: onClose,
801
+ children: [
802
+ /* @__PURE__ */ jsx6(
803
+ "div",
804
+ {
805
+ className: cmMerge3(
806
+ isActive ? "opacity-100" : "opacity-0",
807
+ "pointer-events-none absolute top-0 left-0 h-svh w-full bg-linear-to-t from-base-100/60 to-base-100 transition-opacity duration-200 backdrop-blur-md"
808
+ )
809
+ }
741
810
  ),
742
- onPointerEnter: () => onOpen(visibleSectionId),
743
- onPointerLeave: onClose,
744
- children: [
745
- /* @__PURE__ */ jsx6(
746
- "div",
747
- {
748
- className: cmMerge3(
749
- isActive ? "opacity-100" : "opacity-0",
750
- "pointer-events-none absolute top-0 left-0 h-svh w-full bg-linear-to-t from-base-100/60 to-base-100 transition-opacity duration-200 backdrop-blur-md"
751
- )
752
- }
753
- ),
754
- /* @__PURE__ */ jsx6(
755
- "div",
756
- {
757
- className: cmMerge3(
758
- "relative z-4 overflow-hidden transition-[height] bg-base-100 duration-300",
759
- isLandingPage && !isActive ? "" : "border-b border-base-muted-light ease-out"
760
- ),
761
- style: { height: isActive ? contentHeight : 0 },
762
- children: /* @__PURE__ */ jsx6(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx6(
763
- "div",
764
- {
765
- className: cmMerge3(
766
- isActive ? "translate-y-0 opacity-100" : "-translate-y-10 opacity-0",
767
- "relative z-4 transition-all duration-300"
768
- ),
769
- children: sections.map((section) => /* @__PURE__ */ jsx6(
770
- "div",
771
- {
772
- ref: section.id === visibleSectionId ? setVisibleSectionElement : void 0,
773
- className: cmMerge3(
774
- section.id === visibleSectionId ? "opacity-100" : "opacity-0 pointer-events-none",
775
- "transition-all absolute w-full duration-300"
776
- ),
777
- children: section.items.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "mt-2 flex ", children: section.items.map(
778
- (child) => child.showInNav !== false && /* @__PURE__ */ jsxs4("li", { className: "flex-1 py-3 mb-6 px-4", children: [
779
- child.href ? /* @__PURE__ */ jsx6(
780
- "a",
781
- {
782
- className: "mb-4 block text-lg font-semibold tracking-tight",
783
- href: withSiteBaseUrl(child.href),
784
- children: child.title
785
- }
786
- ) : /* @__PURE__ */ jsx6("span", { className: "mb-4 block text-lg font-semibold tracking-tight", children: child.title }),
787
- child.kind === "group" && child.items.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "menu border-l border-base-muted-light py-0 w-full", children: child.items.map((subChild) => /* @__PURE__ */ jsx6("li", { children: subChild.href ? /* @__PURE__ */ jsx6("a", { href: withSiteBaseUrl(subChild.href), onClick: onClose, children: renderInlineMarkdown(subChild.title) }) : /* @__PURE__ */ jsx6("span", { children: renderInlineMarkdown(subChild.title) }) }, subChild.id)) })
788
- ] }, child.id)
789
- ) })
790
- },
791
- section.id
792
- ))
793
- }
794
- ) })
795
- }
796
- )
797
- ]
798
- }
799
- )
811
+ /* @__PURE__ */ jsx6(
812
+ "div",
813
+ {
814
+ className: cmMerge3(
815
+ "relative z-4 overflow-hidden transition-[height] bg-base-100 duration-300",
816
+ isLandingPage && !isActive ? "" : "border-b border-base-muted-light ease-out"
817
+ ),
818
+ style: { height: isActive ? contentHeight : 0 },
819
+ children: /* @__PURE__ */ jsx6(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx6(
820
+ "div",
821
+ {
822
+ className: cmMerge3(
823
+ isActive ? "translate-y-0 opacity-100" : "-translate-y-10 opacity-0",
824
+ "relative z-4 transition-all duration-300"
825
+ ),
826
+ children: sections.map((section) => /* @__PURE__ */ jsx6(
827
+ "div",
828
+ {
829
+ ref: section.id === visibleSectionId ? setVisibleSectionElement : void 0,
830
+ className: cmMerge3(
831
+ section.id === visibleSectionId ? "opacity-100" : "opacity-0 pointer-events-none",
832
+ "transition-all absolute w-full duration-300"
833
+ ),
834
+ children: section.items.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "mt-2 flex ", children: section.items.map(
835
+ (child) => child.showInNav !== false && /* @__PURE__ */ jsxs4("li", { className: "flex-1 py-3 mb-6 px-4", children: [
836
+ child.href ? /* @__PURE__ */ jsx6(
837
+ "a",
838
+ {
839
+ className: "mb-4 block text-lg font-semibold tracking-tight",
840
+ href: withSiteBaseUrl(child.href),
841
+ children: child.title
842
+ }
843
+ ) : /* @__PURE__ */ jsx6("span", { className: "mb-4 block text-lg font-semibold tracking-tight", children: child.title }),
844
+ child.kind === "group" && child.items.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "menu border-l border-base-muted-light py-0 w-full", children: child.items.map((subChild) => /* @__PURE__ */ jsx6("li", { children: subChild.href ? /* @__PURE__ */ jsx6("a", { href: withSiteBaseUrl(subChild.href), onClick: onClose, children: renderInlineMarkdown(subChild.title) }) : /* @__PURE__ */ jsx6("span", { children: renderInlineMarkdown(subChild.title) }) }, subChild.id)) })
845
+ ] }, child.id)
846
+ ) })
847
+ },
848
+ section.id
849
+ ))
850
+ }
851
+ ) })
852
+ }
853
+ )
854
+ ]
855
+ }
800
856
  );
801
857
  };
802
858
 
803
859
  // src/runtime/client/components/Navbar/index.tsx
804
860
  import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
805
- var Navbar = ({ brand, navbarItems, theme, sections }) => {
806
- const { urlPathname } = usePageContext4();
807
- const isLandingPage = urlPathname === "/";
861
+ var Navbar = memo3(() => {
862
+ const docs = useDocsGlobalContext();
863
+ const { urlPathname, urlParsed } = usePageContext3();
864
+ const activeSectionId = useDocsRouteStore((state) => state.currentSectionId);
865
+ const isLandingPage = urlParsed.pathname === "/";
808
866
  const [isMegaMenuOpen, setIsMegaMenuOpen] = useState3(false);
809
867
  const megaMenuCloseTimeoutRef = useRef2(null);
810
- const pageContext = usePageContext4();
811
- const docs = getDocsGlobalContext(pageContext);
812
- const activeSection = getActiveSectionByPathname(docs, pageContext.urlPathname);
868
+ const sections = docs.sidebarSections;
869
+ const activeSection = sections.find((section) => section.id === activeSectionId) ?? getActiveSectionByPathname(docs, urlPathname);
813
870
  const [hoveredSectionId, setHoveredSectionId] = useState3(activeSection?.id ?? sections[0]?.id);
814
871
  const { toggle: toggleSearch } = useDocsSearchActions();
815
872
  const clearMegaMenuCloseTimeout = useCallback(() => {
@@ -842,16 +899,19 @@ var Navbar = ({ brand, navbarItems, theme, sections }) => {
842
899
  clearMegaMenuCloseTimeout();
843
900
  };
844
901
  }, [clearMegaMenuCloseTimeout]);
902
+ useEffect3(() => {
903
+ setHoveredSectionId(activeSection?.id ?? sections[0]?.id);
904
+ }, [activeSection?.id, sections]);
845
905
  return /* @__PURE__ */ jsxs5(Fragment2, { children: [
846
906
  /* @__PURE__ */ jsx7(StyledNavbar, { $border: isLandingPage, children: /* @__PURE__ */ jsx7(LayoutComponent, { className: "h-full", children: isLandingPage ? /* @__PURE__ */ jsxs5("div", { className: "relative z-3 flex h-full items-center justify-between py-4", children: [
847
- /* @__PURE__ */ jsx7("div", { className: "flex flex-1 items-center gap-4", children: /* @__PURE__ */ jsx7(Brand, { brand }) }),
907
+ /* @__PURE__ */ jsx7("div", { className: "flex flex-1 items-center gap-4", children: /* @__PURE__ */ jsx7(Brand, { brand: docs.brand }) }),
848
908
  /* @__PURE__ */ jsx7(
849
909
  "nav",
850
910
  {
851
911
  "aria-label": "Primary",
852
912
  className: "top-0 left-0 flex min-w-0 flex-1 items-center justify-center gap-4 overflow-x-auto",
853
913
  children: /* @__PURE__ */ jsxs5("ul", { className: "flex items-center font-semibold", children: [
854
- navbarItems.map((item) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
914
+ docs.navbarItems.map((item) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
855
915
  "a",
856
916
  {
857
917
  href: withSiteBaseUrl(item.href),
@@ -890,17 +950,17 @@ var Navbar = ({ brand, navbarItems, theme, sections }) => {
890
950
  ),
891
951
  /* @__PURE__ */ jsxs5("div", { className: "flex flex-1 items-center justify-end gap-2", children: [
892
952
  /* @__PURE__ */ jsx7(SocialLinks_default, {}),
893
- /* @__PURE__ */ jsx7(ThemeSwitch, { theme })
953
+ /* @__PURE__ */ jsx7(ThemeSwitch, { theme: docs.theme })
894
954
  ] })
895
955
  ] }) : /* @__PURE__ */ jsxs5("div", { className: "relative z-3 flex h-full items-center justify-between py-4", children: [
896
- /* @__PURE__ */ jsx7("div", { className: "flex w-80 flex-1 items-center justify-between gap-2 lg:flex-none", children: /* @__PURE__ */ jsx7(Brand, { brand }) }),
956
+ /* @__PURE__ */ jsx7("div", { className: "flex w-80 flex-1 items-center justify-between gap-2 lg:flex-none", children: /* @__PURE__ */ jsx7(Brand, { brand: docs.brand }) }),
897
957
  /* @__PURE__ */ jsxs5(
898
958
  "nav",
899
959
  {
900
960
  "aria-label": "Primary",
901
961
  className: "top-0 left-0 flex flex-1 items-center justify-start gap-4 overflow-x-auto lg:pl-6 xl:pl-10",
902
962
  children: [
903
- /* @__PURE__ */ jsx7("ul", { className: "flex items-center gap-2 font-semibold", children: navbarItems.map((item) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
963
+ /* @__PURE__ */ jsx7("ul", { className: "flex items-center gap-2 font-semibold", children: docs.navbarItems.map((item) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
904
964
  "a",
905
965
  {
906
966
  href: withSiteBaseUrl(item.href),
@@ -922,7 +982,7 @@ var Navbar = ({ brand, navbarItems, theme, sections }) => {
922
982
  ),
923
983
  /* @__PURE__ */ jsxs5("div", { className: "flex w-78 flex-1 items-center justify-end gap-2 lg:flex-none", children: [
924
984
  /* @__PURE__ */ jsx7(SocialLinks_default, {}),
925
- /* @__PURE__ */ jsx7(ThemeSwitch, { theme })
985
+ /* @__PURE__ */ jsx7(ThemeSwitch, { theme: docs.theme })
926
986
  ] })
927
987
  ] }) }) }),
928
988
  /* @__PURE__ */ jsx7(Search, {}),
@@ -939,51 +999,46 @@ var Navbar = ({ brand, navbarItems, theme, sections }) => {
939
999
  }
940
1000
  )
941
1001
  ] });
942
- };
1002
+ });
943
1003
  var StyledNavbar = cm2.header`
944
- top-0 left-0 z-20 h-16 w-full bg-base-100
1004
+ top-0 left-0 z-20 h-16 w-full bg-base-100
945
1005
  ${({ $border }) => $border ? "relative" : "fixed"}
946
1006
  `;
947
1007
 
948
1008
  // src/runtime/client/components/UserSettingsSync.tsx
949
- import { useEffect as useEffect4 } from "react";
1009
+ import { useEffect as useEffect4, useMemo } from "react";
950
1010
  var UserSettingsSync = ({ theme }) => {
951
1011
  const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
952
1012
  const lightTheme = theme?.light ?? "consumer-light";
953
1013
  const darkTheme = theme?.dark ?? "consumer-dark";
954
1014
  const defaultThemePreference = theme?.defaultPreference ?? "light";
955
- const resolvedTheme = { light: lightTheme, dark: darkTheme, defaultPreference: defaultThemePreference };
1015
+ const resolvedTheme = useMemo(
1016
+ () => ({ light: lightTheme, dark: darkTheme, defaultPreference: defaultThemePreference }),
1017
+ [darkTheme, defaultThemePreference, lightTheme]
1018
+ );
956
1019
  const effectiveThemePreference = resolveThemePreference(themePreference, resolvedTheme);
957
1020
  useEffect4(() => {
958
1021
  applyThemePreference(effectiveThemePreference, resolvedTheme);
959
- }, [darkTheme, defaultThemePreference, effectiveThemePreference, lightTheme]);
1022
+ }, [effectiveThemePreference, resolvedTheme]);
960
1023
  return null;
961
1024
  };
962
1025
 
963
1026
  // src/runtime/client/AppLayout.tsx
964
1027
  import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
965
- var AppLayout = ({ children }) => {
966
- const { urlPathname } = usePageContext5();
967
- const pageContext = usePageContext5();
968
- const docs = getDocsGlobalContext(pageContext);
1028
+ var queryClient = new QueryClient();
1029
+ var runtimeStore = createDocsRuntimeStore();
1030
+ var AppLayout = ({ children, header }) => {
1031
+ const { urlPathname } = usePageContext4();
1032
+ const pageContext = usePageContext4();
1033
+ const docs = getDocsFromGlobalContext(pageContext);
969
1034
  const isLandingPage = urlPathname === "/";
970
- const [docsRuntimeStore] = useState4(() => createDocsRuntimeStore());
971
- const [queryClient] = useState4(() => new QueryClient());
972
- return /* @__PURE__ */ jsx8(DocsRuntimeStoreProvider, { store: docsRuntimeStore, children: /* @__PURE__ */ jsxs6(QueryClientProvider, { client: queryClient, children: [
1035
+ return /* @__PURE__ */ jsx8(DocsRuntimeStoreProvider, { store: runtimeStore, children: /* @__PURE__ */ jsx8(DocsGlobalContextProvider, { docs, children: /* @__PURE__ */ jsxs6(QueryClientProvider, { client: queryClient, children: [
973
1036
  /* @__PURE__ */ jsx8(UserSettingsSync, { theme: docs.theme }),
974
1037
  /* @__PURE__ */ jsxs6("div", { className: "min-h-screen bg-base-100 text-base-content", children: [
975
- /* @__PURE__ */ jsx8(
976
- Navbar,
977
- {
978
- brand: docs.brand,
979
- navbarItems: docs.navbarItems,
980
- sections: docs.sidebarSections,
981
- theme: docs.theme
982
- }
983
- ),
1038
+ header ?? /* @__PURE__ */ jsx8(Navbar, {}),
984
1039
  /* @__PURE__ */ jsx8("div", { className: cmMerge5(isLandingPage ? "" : "pt-16"), children })
985
1040
  ] })
986
- ] }) });
1041
+ ] }) }) });
987
1042
  };
988
1043
 
989
1044
  // src/runtime/client/components/MetaHead/FaviconLinks.tsx
@@ -1063,7 +1118,7 @@ var ThemeBootstrap = ({ theme }) => {
1063
1118
  // src/runtime/client/components/MetaHead/index.tsx
1064
1119
  import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
1065
1120
  var MetaHead = () => {
1066
- const docs = useDocsGlobalContext();
1121
+ const docs = useDocsFromPageGlobalContext();
1067
1122
  return /* @__PURE__ */ jsxs9(Fragment5, { children: [
1068
1123
  /* @__PURE__ */ jsx12(ThemeBootstrap, { theme: docs.theme }),
1069
1124
  /* @__PURE__ */ jsx12(FaviconLinks, { head: docs.head }),
@@ -1078,16 +1133,134 @@ var ProseContainer = cm3.section`
1078
1133
  `;
1079
1134
 
1080
1135
  // src/runtime/client/DocsPage.tsx
1136
+ import { useData } from "vike-react/useData";
1137
+ import { usePageContext as usePageContext5 } from "vike-react/usePageContext";
1138
+
1139
+ // src/runtime/client/getMdxRuntimeValue.tsx
1140
+ var isExternalHref = (href) => {
1141
+ return /^(?:[a-z]+:)?\/\//i.test(href) || href.startsWith("mailto:") || href.startsWith("tel:");
1142
+ };
1143
+ var splitHref = (href) => {
1144
+ const [pathname, hash = ""] = href.split("#");
1145
+ return {
1146
+ pathname,
1147
+ hash: hash ? `#${hash}` : ""
1148
+ };
1149
+ };
1150
+ var resolveDocLink = (options) => {
1151
+ const { currentPathname, href } = options;
1152
+ if (href.startsWith("#") || isExternalHref(href)) {
1153
+ return null;
1154
+ }
1155
+ const { pathname, hash } = splitHref(href);
1156
+ const docsPathname = resolveDocsHref(options.docs.basePath, pathname);
1157
+ if (!docsPathname) {
1158
+ return null;
1159
+ }
1160
+ const page = getResolvedPageByPathname(options.docs, docsPathname);
1161
+ if (!page) {
1162
+ return null;
1163
+ }
1164
+ const section = getResolvedSectionById(options.docs, page.sectionId);
1165
+ return {
1166
+ href: withSiteBaseUrl(`${page.href}${hash}`),
1167
+ title: page.title,
1168
+ breadcrumb: section ? [section.navTitle] : [],
1169
+ isCurrentPage: isSamePagePathname(page, currentPathname)
1170
+ };
1171
+ };
1172
+ var resolveOverviewItem = (options) => {
1173
+ const page = options.docs.pages.find((candidate) => candidate.id === options.id);
1174
+ if (!page) {
1175
+ return null;
1176
+ }
1177
+ return {
1178
+ title: page.title,
1179
+ href: withSiteBaseUrl(page.href),
1180
+ excerpt: page.description ?? null
1181
+ };
1182
+ };
1183
+ var getMdxRuntimeValue = (options) => {
1184
+ const { currentPathname, docs } = options;
1185
+ const activeSection = getActiveSectionByPathname(docs, currentPathname);
1186
+ const currentPage = getResolvedPageByPathname(docs, currentPathname);
1187
+ return {
1188
+ locale: "en",
1189
+ codeBlockChoices: docsCodeBlockChoiceStore,
1190
+ localizeHref: (href) => {
1191
+ if (href.startsWith("#") || isExternalHref(href)) {
1192
+ return href;
1193
+ }
1194
+ const { pathname, hash } = splitHref(href);
1195
+ const docsPathname = resolveDocsHref(docs.basePath, pathname);
1196
+ const page = docsPathname ? getResolvedPageByPathname(docs, docsPathname) : null;
1197
+ if (!page) {
1198
+ if (docsPathname && !pathname.startsWith("/")) {
1199
+ return withSiteBaseUrl(`${docsPathname}${hash}`);
1200
+ }
1201
+ return withSiteBaseUrl(href);
1202
+ }
1203
+ return withSiteBaseUrl(`${page.href}${hash}`);
1204
+ },
1205
+ resolveDocLink: ({ href }) => resolveDocLink({
1206
+ docs,
1207
+ currentPathname,
1208
+ href
1209
+ }),
1210
+ resolveOverviewItem: (id) => resolveOverviewItem({
1211
+ docs,
1212
+ id
1213
+ }),
1214
+ t: (group, key) => {
1215
+ if (group === "docs" && key === "onThisPage") {
1216
+ return "On this page";
1217
+ }
1218
+ if (group === "docs" && key === "previous") {
1219
+ return "Previous";
1220
+ }
1221
+ if (group === "docs" && key === "next") {
1222
+ return "Next";
1223
+ }
1224
+ if (group === "docs" && key === "currentSection") {
1225
+ return activeSection?.navTitle ?? currentPage?.title ?? "Docs";
1226
+ }
1227
+ return key;
1228
+ }
1229
+ };
1230
+ };
1231
+
1232
+ // src/runtime/client/DocsPage.tsx
1233
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
1234
+ var DocsPage = ({ Content }) => {
1235
+ const pageContext = usePageContext5();
1236
+ const docs = useDocsGlobalContext();
1237
+ const { page } = useData();
1238
+ return /* @__PURE__ */ jsx13(
1239
+ UniversalMdxProvider,
1240
+ {
1241
+ value: getMdxRuntimeValue({
1242
+ docs,
1243
+ currentPathname: pageContext.urlPathname
1244
+ }),
1245
+ children: /* @__PURE__ */ jsxs10(ProseContainer, { "data-doc-content": "", children: [
1246
+ /* @__PURE__ */ jsx13("h1", { className: "scroll-mt-24", children: renderInlineMarkdown(page.title) }),
1247
+ /* @__PURE__ */ jsx13(Content, {})
1248
+ ] })
1249
+ }
1250
+ );
1251
+ };
1252
+
1253
+ // src/runtime/client/DocsRouteLayout.tsx
1254
+ import { useEffect as useEffect8, useLayoutEffect } from "react";
1081
1255
  import { useData as useData2 } from "vike-react/useData";
1082
- import { usePageContext as usePageContext6 } from "vike-react/usePageContext";
1083
1256
 
1084
1257
  // src/runtime/client/components/DocsPagination.tsx
1085
1258
  import { cmMerge as cmMerge6 } from "@classmatejs/react";
1086
1259
  import { ChevronLeft, ChevronRight } from "lucide-react";
1087
- import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
1260
+ import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
1088
1261
  var PaginationCard = ({ item, direction, isOffset }) => {
1089
1262
  const isPrevious = direction === "previous";
1090
- return /* @__PURE__ */ jsx13(
1263
+ return /* @__PURE__ */ jsx14(
1091
1264
  "a",
1092
1265
  {
1093
1266
  href: withSiteBaseUrl(item.href),
@@ -1097,9 +1270,9 @@ var PaginationCard = ({ item, direction, isOffset }) => {
1097
1270
  isOffset && "sm:col-start-2"
1098
1271
  ),
1099
1272
  "aria-label": `${isPrevious ? "Previous" : "Next"}: ${item.title}`,
1100
- children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col justify-between gap-2", children: [
1101
- /* @__PURE__ */ jsx13("p", { className: "text-lg font-semibold text-base-content", children: renderInlineMarkdown(item.title) }),
1102
- /* @__PURE__ */ jsxs10(
1273
+ children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col justify-between gap-2", children: [
1274
+ /* @__PURE__ */ jsx14("p", { className: "text-lg font-semibold text-base-content", children: renderInlineMarkdown(item.title) }),
1275
+ /* @__PURE__ */ jsxs11(
1103
1276
  "div",
1104
1277
  {
1105
1278
  className: cmMerge6(
@@ -1107,9 +1280,9 @@ var PaginationCard = ({ item, direction, isOffset }) => {
1107
1280
  isPrevious ? "justify-start" : "justify-end"
1108
1281
  ),
1109
1282
  children: [
1110
- isPrevious && /* @__PURE__ */ jsx13(ChevronLeft, { className: "h-4 w-4" }),
1111
- /* @__PURE__ */ jsx13("span", { children: isPrevious ? "Previous" : "Next" }),
1112
- !isPrevious && /* @__PURE__ */ jsx13(ChevronRight, { className: "h-4 w-4" })
1283
+ isPrevious && /* @__PURE__ */ jsx14(ChevronLeft, { className: "h-4 w-4" }),
1284
+ /* @__PURE__ */ jsx14("span", { children: isPrevious ? "Previous" : "Next" }),
1285
+ !isPrevious && /* @__PURE__ */ jsx14(ChevronRight, { className: "h-4 w-4" })
1113
1286
  ]
1114
1287
  }
1115
1288
  )
@@ -1117,37 +1290,48 @@ var PaginationCard = ({ item, direction, isOffset }) => {
1117
1290
  }
1118
1291
  );
1119
1292
  };
1120
- var DocsPagination = ({ previousPage, nextPage }) => {
1293
+ var DocsPagination = ({
1294
+ previousPage: previousPageProp = null,
1295
+ nextPage: nextPageProp = null
1296
+ }) => {
1297
+ const paginationEnabled = useDocsGlobalContext().footer.pagination;
1298
+ const previousPage = useDocsRouteStore((state) => state.previousPage) ?? previousPageProp;
1299
+ const nextPage = useDocsRouteStore((state) => state.nextPage) ?? nextPageProp;
1300
+ if (!paginationEnabled) {
1301
+ return null;
1302
+ }
1121
1303
  if (!previousPage && !nextPage) {
1122
1304
  return null;
1123
1305
  }
1124
- return /* @__PURE__ */ jsx13("nav", { className: "mb-10 mt-16", "aria-label": "Previous Next", children: /* @__PURE__ */ jsxs10("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1125
- previousPage && /* @__PURE__ */ jsx13(PaginationCard, { item: previousPage, direction: "previous" }),
1126
- nextPage && /* @__PURE__ */ jsx13(PaginationCard, { isOffset: !previousPage, item: nextPage, direction: "next" })
1306
+ return /* @__PURE__ */ jsx14("nav", { className: "mb-10 mt-16", "aria-label": "Previous Next", children: /* @__PURE__ */ jsxs11("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1307
+ previousPage && /* @__PURE__ */ jsx14(PaginationCard, { item: previousPage, direction: "previous" }),
1308
+ nextPage && /* @__PURE__ */ jsx14(PaginationCard, { isOffset: !previousPage, item: nextPage, direction: "next" })
1127
1309
  ] }) });
1128
1310
  };
1129
1311
 
1130
1312
  // src/runtime/client/components/Footer.tsx
1131
1313
  import { Bug, Pencil } from "lucide-react";
1132
- import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
1133
- var DocsFooter = ({ brand }) => {
1134
- return /* @__PURE__ */ jsxs11("footer", { className: "mb-8 mt-12 text-sm border-t border-base-muted-light pt-10", children: [
1135
- /* @__PURE__ */ jsxs11("div", { className: "mb-16 flex items-center gap-2", children: [
1136
- /* @__PURE__ */ jsxs11("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
1137
- /* @__PURE__ */ jsx14(Pencil, { className: "w-3 h-3" }),
1314
+ import { memo as memo4 } from "react";
1315
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1316
+ var DocsFooter = memo4(() => {
1317
+ const { brand } = useDocsGlobalContext();
1318
+ return /* @__PURE__ */ jsxs12("footer", { className: "mb-8 mt-12 text-sm border-t border-base-muted-light pt-10", children: [
1319
+ /* @__PURE__ */ jsxs12("div", { className: "mb-16 flex items-center gap-2", children: [
1320
+ /* @__PURE__ */ jsxs12("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
1321
+ /* @__PURE__ */ jsx15(Pencil, { className: "w-3 h-3" }),
1138
1322
  " Edit this page"
1139
1323
  ] }),
1140
- /* @__PURE__ */ jsxs11("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
1141
- /* @__PURE__ */ jsx14(Bug, { className: "w-3 h-3" }),
1324
+ /* @__PURE__ */ jsxs12("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
1325
+ /* @__PURE__ */ jsx15(Bug, { className: "w-3 h-3" }),
1142
1326
  " Report Issue"
1143
1327
  ] })
1144
1328
  ] }),
1145
- /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center", children: [
1146
- /* @__PURE__ */ jsx14(SocialLinks_default, {}),
1147
- /* @__PURE__ */ jsx14("div", { className: "flex gap-2 items-center", children: brand && /* @__PURE__ */ jsx14(Brand, { brand, noText: true }) })
1329
+ /* @__PURE__ */ jsxs12("div", { className: "flex justify-between items-center", children: [
1330
+ /* @__PURE__ */ jsx15(SocialLinks_default, {}),
1331
+ /* @__PURE__ */ jsx15("div", { className: "flex gap-2 items-center", children: brand && /* @__PURE__ */ jsx15(Brand, { brand, noText: true }) })
1148
1332
  ] })
1149
1333
  ] });
1150
- };
1334
+ });
1151
1335
 
1152
1336
  // src/runtime/client/components/HeadingLinkCopy.tsx
1153
1337
  import { useEffect as useEffect5 } from "react";
@@ -1201,7 +1385,7 @@ var HeadingLinkCopy = () => {
1201
1385
 
1202
1386
  // src/runtime/client/components/Sidebar.tsx
1203
1387
  import { cmMerge as cmMerge7 } from "@classmatejs/react";
1204
- import { useEffect as useEffect6, useRef as useRef3 } from "react";
1388
+ import { memo as memo5, useEffect as useEffect6, useRef as useRef3 } from "react";
1205
1389
 
1206
1390
  // src/runtime/client/components/docsNavigation.ts
1207
1391
  var containsActiveHref = (items, currentHref) => {
@@ -1229,7 +1413,7 @@ var getVisibleGroupItems = (group) => {
1229
1413
  var getGroupHref = (group) => group.href ?? null;
1230
1414
 
1231
1415
  // src/runtime/client/components/Sidebar.tsx
1232
- import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1416
+ import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
1233
1417
  var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
1234
1418
  const storedOpen = useDocsSidebarStore((state) => state.openNodes[nodeId]);
1235
1419
  const { setNodeOpen } = useDocsSidebarActions();
@@ -1249,7 +1433,7 @@ var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
1249
1433
  };
1250
1434
  };
1251
1435
  var SidebarPageLink = ({ title, href, currentHref }) => {
1252
- return /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(
1436
+ return /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(
1253
1437
  "a",
1254
1438
  {
1255
1439
  href: withSiteBaseUrl(href),
@@ -1262,10 +1446,10 @@ var SidebarPageLink = ({ title, href, currentHref }) => {
1262
1446
  ) });
1263
1447
  };
1264
1448
  var SidebarGroupDivider = ({ title }) => {
1265
- return /* @__PURE__ */ jsx15("li", { className: "ml-3 mt-2 mb-2 border-b border-base-muted-light text-xs text-base-muted-medium pointer-events-none font-semibold", children: /* @__PURE__ */ jsx15("span", { className: "-ml-3", children: renderInlineMarkdown(title, { codeClassName: "text-sm!" }) }) });
1449
+ return /* @__PURE__ */ jsx16("li", { className: "ml-3 mt-2 mb-2 border-b border-base-muted-light text-xs text-base-muted-medium pointer-events-none font-semibold", children: /* @__PURE__ */ jsx16("span", { className: "-ml-3", children: renderInlineMarkdown(title, { codeClassName: "text-sm!" }) }) });
1266
1450
  };
1267
1451
  var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) => {
1268
- const content = /* @__PURE__ */ jsx15(
1452
+ const content = /* @__PURE__ */ jsx16(
1269
1453
  "span",
1270
1454
  {
1271
1455
  className: cmMerge7(
@@ -1276,7 +1460,7 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) =>
1276
1460
  }
1277
1461
  );
1278
1462
  if (allowNavigation && href) {
1279
- return /* @__PURE__ */ jsx15(
1463
+ return /* @__PURE__ */ jsx16(
1280
1464
  "a",
1281
1465
  {
1282
1466
  href: withSiteBaseUrl(href),
@@ -1288,19 +1472,19 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) =>
1288
1472
  }
1289
1473
  );
1290
1474
  }
1291
- return /* @__PURE__ */ jsx15("span", { className: "flex items-center gap-2 text-base-content", children: content });
1475
+ return /* @__PURE__ */ jsx16("span", { className: "flex items-center gap-2 text-base-content", children: content });
1292
1476
  };
1293
1477
  var renderSidebarItems = (items, currentHref) => {
1294
1478
  return items.map((item) => {
1295
1479
  if (item.kind === "page") {
1296
- return /* @__PURE__ */ jsx15(SidebarPageLink, { title: item.navTitle, href: item.href, currentHref }, item.id);
1480
+ return /* @__PURE__ */ jsx16(SidebarPageLink, { title: item.navTitle, href: item.href, currentHref }, item.id);
1297
1481
  }
1298
- return /* @__PURE__ */ jsx15(SidebarNestedGroup, { group: item, currentHref }, item.id);
1482
+ return /* @__PURE__ */ jsx16(SidebarNestedGroup, { group: item, currentHref }, item.id);
1299
1483
  });
1300
1484
  };
1301
1485
  var SidebarItemList = ({ items, currentHref }) => {
1302
1486
  const visibleItems = getVisibleNavItems(items);
1303
- return /* @__PURE__ */ jsx15("ul", { className: "menu w-full", children: renderSidebarItems(visibleItems, currentHref) });
1487
+ return /* @__PURE__ */ jsx16("ul", { className: "menu w-full", children: renderSidebarItems(visibleItems, currentHref) });
1304
1488
  };
1305
1489
  var SidebarNestedGroup = ({ group, currentHref }) => {
1306
1490
  const groupHref = getGroupHref(group);
@@ -1311,14 +1495,14 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
1311
1495
  const { isOpen, setIsOpen } = useAutoOpenDetails(`group:${group.id}`, isOpenByDefault, nestedHasActiveItem);
1312
1496
  if (!isCollapsible) {
1313
1497
  if (!group.title) {
1314
- return /* @__PURE__ */ jsx15(Fragment6, { children: renderSidebarItems(visibleItems, currentHref) });
1498
+ return /* @__PURE__ */ jsx16(Fragment6, { children: renderSidebarItems(visibleItems, currentHref) });
1315
1499
  }
1316
- return /* @__PURE__ */ jsxs12(Fragment6, { children: [
1317
- /* @__PURE__ */ jsx15(SidebarGroupDivider, { title: group.title }),
1500
+ return /* @__PURE__ */ jsxs13(Fragment6, { children: [
1501
+ /* @__PURE__ */ jsx16(SidebarGroupDivider, { title: group.title }),
1318
1502
  renderSidebarItems(visibleItems, currentHref)
1319
1503
  ] });
1320
1504
  }
1321
- return /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs12(
1505
+ return /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsxs13(
1322
1506
  "details",
1323
1507
  {
1324
1508
  open: isOpen,
@@ -1326,7 +1510,7 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
1326
1510
  setIsOpen(event.currentTarget.open);
1327
1511
  },
1328
1512
  children: [
1329
- /* @__PURE__ */ jsx15("summary", { children: /* @__PURE__ */ jsx15(
1513
+ /* @__PURE__ */ jsx16("summary", { children: /* @__PURE__ */ jsx16(
1330
1514
  SidebarGroupTitle,
1331
1515
  {
1332
1516
  title: group.title,
@@ -1335,7 +1519,7 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
1335
1519
  allowNavigation: Boolean(groupHref)
1336
1520
  }
1337
1521
  ) }),
1338
- visibleItems.length > 0 ? /* @__PURE__ */ jsx15(SidebarItemList, { items: visibleItems, currentHref }) : null
1522
+ visibleItems.length > 0 ? /* @__PURE__ */ jsx16(SidebarItemList, { items: visibleItems, currentHref }) : null
1339
1523
  ]
1340
1524
  }
1341
1525
  ) });
@@ -1347,7 +1531,7 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
1347
1531
  section.id === activeSectionId,
1348
1532
  sectionHasActiveItem
1349
1533
  );
1350
- return /* @__PURE__ */ jsx15("li", { className: "pb-4", children: /* @__PURE__ */ jsxs12(
1534
+ return /* @__PURE__ */ jsx16("li", { className: "pb-4", children: /* @__PURE__ */ jsxs13(
1351
1535
  "details",
1352
1536
  {
1353
1537
  open: isOpen,
@@ -1355,53 +1539,45 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
1355
1539
  setIsOpen(event.currentTarget.open);
1356
1540
  },
1357
1541
  children: [
1358
- /* @__PURE__ */ jsx15("summary", { children: /* @__PURE__ */ jsx15(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem }) }),
1359
- /* @__PURE__ */ jsx15(SidebarItemList, { items: section.items, currentHref })
1542
+ /* @__PURE__ */ jsx16("summary", { children: /* @__PURE__ */ jsx16(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem }) }),
1543
+ /* @__PURE__ */ jsx16(SidebarItemList, { items: section.items, currentHref })
1360
1544
  ]
1361
1545
  }
1362
1546
  ) });
1363
1547
  };
1364
- var Sidebar = ({ sections, activeSectionId, currentHref, horizontal }) => {
1365
- const scrollContainerRef = useRef3(null);
1366
- const scrollTop = useDocsSidebarStore((state) => state.scrollTop);
1367
- const { setScrollTop } = useDocsSidebarActions();
1368
- useEffect6(() => {
1369
- const scrollContainer = scrollContainerRef.current;
1370
- if (!scrollContainer || scrollContainer.scrollTop === scrollTop) {
1371
- return;
1372
- }
1373
- scrollContainer.scrollTop = scrollTop;
1374
- }, [scrollTop]);
1375
- return /* @__PURE__ */ jsx15("aside", { className: "hidden basis-76 shrink-0 lg:block", children: /* @__PURE__ */ jsxs12("div", { className: "-ml-3 sticky top-16", children: [
1376
- /* @__PURE__ */ jsx15("div", { className: "absolute h-full w-px right-0 top-0 bg-linear-to-t to-base-muted-light via-base-muted-light pointer-events-none z-1" }),
1377
- /* @__PURE__ */ jsx15(
1378
- "div",
1379
- {
1380
- ref: scrollContainerRef,
1381
- className: "pr-4 h-[calc(100svh-16*var(--spacing))] overflow-y-scroll overflow-x-hidden relative z-10",
1382
- onScroll: (event) => {
1383
- setScrollTop(event.currentTarget.scrollTop);
1384
- },
1385
- children: /* @__PURE__ */ jsx15("ul", { className: cmMerge7("menu w-full px-0 py-5 li:last-child:border-0"), children: sections.map((section) => /* @__PURE__ */ jsx15(
1386
- SidebarSectionGroup,
1387
- {
1388
- section,
1389
- currentHref,
1390
- activeSectionId
1391
- },
1392
- section.id
1393
- )) })
1394
- }
1395
- )
1396
- ] }) });
1397
- };
1548
+ var Sidebar = memo5(
1549
+ ({ currentHref: currentHrefProp = "", activeSectionId: activeSectionIdProp = "" }) => {
1550
+ const scrollContainerRef = useRef3(null);
1551
+ const currentHref = useDocsRouteStore((state) => state.currentHref) || currentHrefProp;
1552
+ const activeSectionId = useDocsRouteStore((state) => state.currentSectionId ?? "") || activeSectionIdProp;
1553
+ const { sidebarSections } = useDocsGlobalContext();
1554
+ return /* @__PURE__ */ jsx16("aside", { className: "hidden basis-76 shrink-0 lg:block", children: /* @__PURE__ */ jsxs13("div", { className: "-ml-3 sticky top-16", children: [
1555
+ /* @__PURE__ */ jsx16("div", { className: "absolute h-full w-px right-0 top-0 bg-linear-to-t to-base-muted-light via-base-muted-light pointer-events-none z-1" }),
1556
+ /* @__PURE__ */ jsx16(
1557
+ "div",
1558
+ {
1559
+ ref: scrollContainerRef,
1560
+ className: "pr-4 h-[calc(100svh-16*var(--spacing))] overflow-y-scroll overflow-x-hidden relative z-10",
1561
+ children: /* @__PURE__ */ jsx16("ul", { className: cmMerge7("menu w-full px-0 py-5 li:last-child:border-0"), children: sidebarSections.map((section) => /* @__PURE__ */ jsx16(
1562
+ SidebarSectionGroup,
1563
+ {
1564
+ section,
1565
+ currentHref,
1566
+ activeSectionId
1567
+ },
1568
+ section.id
1569
+ )) })
1570
+ }
1571
+ )
1572
+ ] }) });
1573
+ }
1574
+ );
1398
1575
 
1399
1576
  // src/runtime/client/components/TableOfContents.tsx
1400
1577
  import cm4, { cmMerge as cmMerge8 } from "@classmatejs/react";
1401
- import { TableOfContentsIcon } from "lucide-react";
1402
- import { useEffect as useEffect7, useState as useState5 } from "react";
1403
- import { useData } from "vike-react/useData";
1404
- import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
1578
+ import { Flame, TableOfContentsIcon } from "lucide-react";
1579
+ import { useEffect as useEffect7, useState as useState4 } from "react";
1580
+ import { Fragment as Fragment7, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
1405
1581
  var getCurrentHash = () => {
1406
1582
  try {
1407
1583
  return decodeURIComponent(window.location.hash);
@@ -1479,11 +1655,18 @@ var updateActiveHeadingFromScroll = (setActiveHeadingId) => {
1479
1655
  }
1480
1656
  setActiveHeadingId(nextActiveHeadingId);
1481
1657
  };
1482
- var TableOfContents = ({ headings, partners }) => {
1483
- const [activeHeadingId, setActiveHeadingId] = useState5("");
1484
- const [domHeadings, setDomHeadings] = useState5(headings);
1485
- const effectiveHeadings = domHeadings.length > 0 ? domHeadings : headings;
1486
- const { page } = useData();
1658
+ var TableOfContents = ({
1659
+ headings: headingsProp = [],
1660
+ tableOfContents: tableOfContentsProp = false
1661
+ }) => {
1662
+ const { partners } = useDocsGlobalContext();
1663
+ const headings = useDocsRouteStore((state) => state.headings);
1664
+ const tableOfContents = useDocsRouteStore((state) => state.tableOfContents);
1665
+ const effectiveRouteHeadings = headings.length > 0 ? headings : headingsProp;
1666
+ const effectiveTableOfContents = tableOfContents || tableOfContentsProp;
1667
+ const [activeHeadingId, setActiveHeadingId] = useState4("");
1668
+ const [domHeadings, setDomHeadings] = useState4(effectiveRouteHeadings);
1669
+ const effectiveHeadings = domHeadings.length > 0 ? domHeadings : effectiveRouteHeadings;
1487
1670
  useEffect7(() => {
1488
1671
  let scrollFrame = 0;
1489
1672
  const syncActiveHeading = () => {
@@ -1525,24 +1708,24 @@ var TableOfContents = ({ headings, partners }) => {
1525
1708
  return;
1526
1709
  }
1527
1710
  setDomHeadings((currentHeadings) => {
1528
- if (areHeadingsEqual(currentHeadings, headings)) {
1711
+ if (areHeadingsEqual(currentHeadings, effectiveRouteHeadings)) {
1529
1712
  return currentHeadings;
1530
1713
  }
1531
- return headings;
1714
+ return effectiveRouteHeadings;
1532
1715
  });
1533
1716
  setActiveHeadingId("");
1534
1717
  queueMicrotask(() => {
1535
1718
  syncHeadingsFromDom(setDomHeadings);
1536
1719
  updateActiveHeadingFromScroll(setActiveHeadingId);
1537
1720
  });
1538
- }, [headings]);
1539
- return /* @__PURE__ */ jsx16("aside", { className: cmMerge8(page.tableOfContents ? "w-64" : "w-32", "hidden shrink-0 xl:block"), children: /* @__PURE__ */ jsx16("div", { className: "sticky top-16", children: /* @__PURE__ */ jsxs13("div", { className: "relative h-[calc(100svh-16*var(--spacing))] overflow-y-auto overflow-x-hidden pt-10 pb-8", children: [
1540
- page.tableOfContents ? effectiveHeadings.length > 0 && /* @__PURE__ */ jsxs13(Fragment7, { children: [
1541
- /* @__PURE__ */ jsxs13("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
1542
- /* @__PURE__ */ jsx16(TableOfContentsIcon, { className: "h-3 w-3" }),
1721
+ }, [effectiveRouteHeadings]);
1722
+ return /* @__PURE__ */ jsx17("aside", { className: cmMerge8(effectiveTableOfContents ? "w-64" : "w-32", "hidden shrink-0 xl:block"), children: /* @__PURE__ */ jsx17("div", { className: "sticky top-16", children: /* @__PURE__ */ jsxs14("div", { className: "relative h-[calc(100svh-16*var(--spacing))] overflow-y-auto overflow-x-hidden pt-10 pb-8", children: [
1723
+ effectiveTableOfContents ? effectiveHeadings.length > 0 && /* @__PURE__ */ jsxs14(Fragment7, { children: [
1724
+ /* @__PURE__ */ jsxs14("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
1725
+ /* @__PURE__ */ jsx17(TableOfContentsIcon, { className: "h-3 w-3" }),
1543
1726
  "On this page"
1544
1727
  ] }),
1545
- /* @__PURE__ */ jsx16("nav", { "aria-label": "On this page", className: "mb-12", children: /* @__PURE__ */ jsx16("ul", { children: effectiveHeadings.map((heading, index) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(
1728
+ /* @__PURE__ */ jsx17("nav", { "aria-label": "On this page", className: "mb-12", children: /* @__PURE__ */ jsx17("ul", { children: effectiveHeadings.map((heading, index) => /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17(
1546
1729
  "a",
1547
1730
  {
1548
1731
  href: `#${heading.id}`,
@@ -1557,35 +1740,29 @@ var TableOfContents = ({ headings, partners }) => {
1557
1740
  }
1558
1741
  ) }, heading.id)) }) })
1559
1742
  ] }) : null,
1560
- /* @__PURE__ */ jsx16(Adbar, { partners })
1743
+ /* @__PURE__ */ jsx17(Adbar, { partners })
1561
1744
  ] }) }) });
1562
1745
  };
1563
1746
  var Adbar = ({ partners }) => {
1564
1747
  if (partners.primary.length === 0 && partners.gold.length === 0) {
1565
1748
  return null;
1566
1749
  }
1567
- return /* @__PURE__ */ jsxs13(Fragment7, { children: [
1568
- /* @__PURE__ */ jsxs13("ul", { className: "grid grid-cols-[repeat(auto-fit,minmax(5.5rem,1fr))] gap-3 opacity-90", children: [
1569
- partners.primary.map((partner) => /* @__PURE__ */ jsx16(AdbarItem, { className: "col-span-full", children: /* @__PURE__ */ jsx16(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx16(PartnerLogo, { partner }) }) }, partner.name)),
1570
- partners.gold.map((partner) => /* @__PURE__ */ jsx16(AdbarItem, { children: /* @__PURE__ */ jsx16(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx16(PartnerLogo, { partner }) }) }, partner.name))
1750
+ return /* @__PURE__ */ jsxs14("aside", { children: [
1751
+ /* @__PURE__ */ jsxs14("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
1752
+ /* @__PURE__ */ jsx17(Flame, { className: "h-3 w-3" }),
1753
+ "Partners"
1571
1754
  ] }),
1572
- /* @__PURE__ */ jsxs13(AdbarItem, { className: "col-span-full p-2 text-left mt-3 block!", children: [
1573
- /* @__PURE__ */ jsx16("strong", { className: "text-sm tracking-tighter leading-tight mb-1 block", children: "Your company name here! \u{1F48E} " }),
1574
- /* @__PURE__ */ jsxs13("p", { className: "text-xs text-base-muted", children: [
1575
- "Hey, this is a classic text ad here!",
1576
- " ",
1577
- /* @__PURE__ */ jsx16("a", { href: "#adlink", className: "text-info", children: "link" }),
1578
- " ",
1579
- "to some thing"
1580
- ] })
1755
+ /* @__PURE__ */ jsxs14("ul", { className: "grid grid-cols-[repeat(auto-fit,minmax(5.5rem,1fr))] gap-3 opacity-90", children: [
1756
+ partners.primary.map((partner) => /* @__PURE__ */ jsx17(AdbarItem, { className: "col-span-full", children: /* @__PURE__ */ jsx17(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx17(PartnerLogo, { partner }) }) }, partner.name)),
1757
+ partners.gold.map((partner) => /* @__PURE__ */ jsx17(AdbarItem, { children: /* @__PURE__ */ jsx17(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx17(PartnerLogo, { partner }) }) }, partner.name))
1581
1758
  ] })
1582
1759
  ] });
1583
1760
  };
1584
1761
  var PartnerLogo = ({
1585
1762
  partner
1586
1763
  }) => {
1587
- return /* @__PURE__ */ jsxs13(Fragment7, { children: [
1588
- /* @__PURE__ */ jsx16(
1764
+ return /* @__PURE__ */ jsxs14(Fragment7, { children: [
1765
+ /* @__PURE__ */ jsx17(
1589
1766
  Image,
1590
1767
  {
1591
1768
  src: partner.logoLight,
@@ -1595,7 +1772,7 @@ var PartnerLogo = ({
1595
1772
  className: cmMerge8("block", partner.logoDark ? "dark:hidden" : "dark:invert")
1596
1773
  }
1597
1774
  ),
1598
- partner.logoDark ? /* @__PURE__ */ jsx16(Image, { src: partner.logoDark, width: 200, height: 100, alt: partner.logoAlt, className: "hidden dark:block" }) : null
1775
+ partner.logoDark ? /* @__PURE__ */ jsx17(Image, { src: partner.logoDark, width: 200, height: 100, alt: partner.logoAlt, className: "hidden dark:block" }) : null
1599
1776
  ] });
1600
1777
  };
1601
1778
  var AdbarItem = cm4.div`
@@ -1620,130 +1797,37 @@ var Image = cm4.img`
1620
1797
  w-24
1621
1798
  `;
1622
1799
 
1623
- // src/runtime/client/getMdxRuntimeValue.tsx
1624
- var isExternalHref = (href) => {
1625
- return /^(?:[a-z]+:)?\/\//i.test(href) || href.startsWith("mailto:") || href.startsWith("tel:");
1626
- };
1627
- var splitHref = (href) => {
1628
- const [pathname, hash = ""] = href.split("#");
1629
- return {
1630
- pathname,
1631
- hash: hash ? `#${hash}` : ""
1632
- };
1633
- };
1634
- var resolveDocLink = (options) => {
1635
- const { currentPathname, href } = options;
1636
- if (href.startsWith("#") || isExternalHref(href)) {
1637
- return null;
1638
- }
1639
- const { pathname, hash } = splitHref(href);
1640
- const docsPathname = resolveDocsHref(options.docs.basePath, pathname);
1641
- if (!docsPathname) {
1642
- return null;
1643
- }
1644
- const page = getResolvedPageByPathname(options.docs, docsPathname);
1645
- if (!page) {
1646
- return null;
1647
- }
1648
- const section = getResolvedSectionById(options.docs, page.sectionId);
1649
- return {
1650
- href: withSiteBaseUrl(`${page.href}${hash}`),
1651
- title: page.title,
1652
- breadcrumb: section ? [section.navTitle] : [],
1653
- isCurrentPage: isSamePagePathname(page, currentPathname)
1654
- };
1655
- };
1656
- var resolveOverviewItem = (options) => {
1657
- const page = options.docs.pages.find((candidate) => candidate.id === options.id);
1658
- if (!page) {
1659
- return null;
1660
- }
1661
- return {
1662
- title: page.title,
1663
- href: withSiteBaseUrl(page.href),
1664
- excerpt: page.description ?? null
1665
- };
1666
- };
1667
- var getMdxRuntimeValue = (options) => {
1668
- const { currentPathname, docs } = options;
1669
- const activeSection = getActiveSectionByPathname(docs, currentPathname);
1670
- const currentPage = getResolvedPageByPathname(docs, currentPathname);
1671
- return {
1672
- locale: "en",
1673
- codeBlockChoices: docsCodeBlockChoiceStore,
1674
- localizeHref: (href) => {
1675
- if (href.startsWith("#") || isExternalHref(href)) {
1676
- return href;
1677
- }
1678
- const { pathname, hash } = splitHref(href);
1679
- const docsPathname = resolveDocsHref(docs.basePath, pathname);
1680
- const page = docsPathname ? getResolvedPageByPathname(docs, docsPathname) : null;
1681
- if (!page) {
1682
- if (docsPathname && !pathname.startsWith("/")) {
1683
- return withSiteBaseUrl(`${docsPathname}${hash}`);
1684
- }
1685
- return withSiteBaseUrl(href);
1686
- }
1687
- return withSiteBaseUrl(`${page.href}${hash}`);
1688
- },
1689
- resolveDocLink: ({ href }) => resolveDocLink({
1690
- docs,
1691
- currentPathname,
1692
- href
1693
- }),
1694
- resolveOverviewItem: (id) => resolveOverviewItem({
1695
- docs,
1696
- id
1697
- }),
1698
- t: (group, key) => {
1699
- if (group === "docs" && key === "onThisPage") {
1700
- return "On this page";
1701
- }
1702
- if (group === "docs" && key === "previous") {
1703
- return "Previous";
1704
- }
1705
- if (group === "docs" && key === "next") {
1706
- return "Next";
1707
- }
1708
- if (group === "docs" && key === "currentSection") {
1709
- return activeSection?.navTitle ?? currentPage?.title ?? "Docs";
1710
- }
1711
- return key;
1712
- }
1713
- };
1800
+ // src/runtime/client/DocsRouteLayout.tsx
1801
+ import { Fragment as Fragment8, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
1802
+ var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect8 : useLayoutEffect;
1803
+ var DocsRouteStateSync = ({ data }) => {
1804
+ const { clearPageData, setPageData } = useDocsRouteActions();
1805
+ useIsomorphicLayoutEffect(() => {
1806
+ setPageData(data);
1807
+ }, [data, setPageData]);
1808
+ useEffect8(() => {
1809
+ return () => {
1810
+ clearPageData();
1811
+ };
1812
+ }, [clearPageData]);
1813
+ return null;
1714
1814
  };
1715
-
1716
- // src/runtime/client/DocsPage.tsx
1717
- import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
1718
- var DocsPage = ({ Content }) => {
1719
- const pageContext = usePageContext6();
1720
- const docs = getDocsGlobalContext(pageContext);
1721
- const { page, headings, previousPage, nextPage } = useData2();
1722
- return /* @__PURE__ */ jsxs14(
1723
- UniversalMdxProvider,
1724
- {
1725
- value: getMdxRuntimeValue({
1726
- docs,
1727
- currentPathname: pageContext.urlPathname
1728
- }),
1729
- children: [
1730
- /* @__PURE__ */ jsx17(HeadingLinkCopy, {}),
1731
- /* @__PURE__ */ jsx17("div", { className: "absolute top-0 left-0 w-full h-[60svh] bg-radial-[at_65%_-85%] from-primary-muted-light/40 dark:from-primary-muted-light/60 to-65%" }),
1732
- /* @__PURE__ */ jsx17(LayoutComponent, { children: /* @__PURE__ */ jsxs14("div", { className: "lg:flex lg:gap-10 xl:gap-14", children: [
1733
- /* @__PURE__ */ jsx17(Sidebar, { sections: docs.sidebarSections, activeSectionId: page.sectionId, currentHref: page.href }),
1734
- /* @__PURE__ */ jsxs14("main", { className: "mt-10 min-w-0 flex-1 basis-auto shrink", children: [
1735
- /* @__PURE__ */ jsxs14(ProseContainer, { "data-doc-content": "", children: [
1736
- /* @__PURE__ */ jsx17("h1", { className: "scroll-mt-24", children: renderInlineMarkdown(page.title) }),
1737
- /* @__PURE__ */ jsx17(Content, {})
1738
- ] }),
1739
- docs.footer.pagination ? /* @__PURE__ */ jsx17(DocsPagination, { previousPage, nextPage }) : null,
1740
- /* @__PURE__ */ jsx17(DocsFooter, { brand: docs.brand })
1741
- ] }),
1742
- /* @__PURE__ */ jsx17(TableOfContents, { headings, partners: docs.partners })
1743
- ] }) })
1744
- ]
1745
- }
1746
- );
1815
+ var DocsRouteLayout = ({ children }) => {
1816
+ const data = useData2();
1817
+ return /* @__PURE__ */ jsxs15(Fragment8, { children: [
1818
+ /* @__PURE__ */ jsx18(DocsRouteStateSync, { data }),
1819
+ /* @__PURE__ */ jsx18(HeadingLinkCopy, {}),
1820
+ /* @__PURE__ */ jsx18("div", { className: "absolute top-0 left-0 h-[60svh] w-full bg-radial-[at_65%_-85%] from-primary-muted-light/40 to-65% dark:from-primary-muted-light/60" }),
1821
+ /* @__PURE__ */ jsx18(LayoutComponent, { children: /* @__PURE__ */ jsxs15("div", { className: "lg:flex lg:gap-10 xl:gap-14", children: [
1822
+ /* @__PURE__ */ jsx18(Sidebar, { currentHref: data.page.href, activeSectionId: data.page.sectionId }),
1823
+ /* @__PURE__ */ jsxs15("main", { className: "mt-10 min-w-0 flex-1 basis-auto shrink", children: [
1824
+ children,
1825
+ /* @__PURE__ */ jsx18(DocsPagination, { previousPage: data.previousPage, nextPage: data.nextPage }),
1826
+ /* @__PURE__ */ jsx18(DocsFooter, {})
1827
+ ] }),
1828
+ /* @__PURE__ */ jsx18(TableOfContents, { headings: data.headings, tableOfContents: data.page.tableOfContents })
1829
+ ] }) })
1830
+ ] });
1747
1831
  };
1748
1832
 
1749
1833
  export {
@@ -1751,6 +1835,8 @@ export {
1751
1835
  useDocsSearchActions,
1752
1836
  useDocsSidebarStore,
1753
1837
  useDocsSidebarActions,
1838
+ useDocsRouteStore,
1839
+ useDocsRouteActions,
1754
1840
  LayoutComponent,
1755
1841
  useDocsUserSettingsStore,
1756
1842
  DEFAULT_THEME_PREFERENCE,
@@ -1759,6 +1845,7 @@ export {
1759
1845
  AppLayout,
1760
1846
  MetaHead,
1761
1847
  ProseContainer,
1762
- DocsPage
1848
+ DocsPage,
1849
+ DocsRouteLayout
1763
1850
  };
1764
- //# sourceMappingURL=chunk-5NW6G3SG.js.map
1851
+ //# sourceMappingURL=chunk-5QP3Y2DU.js.map