@unterberg/nivel 0.1.1 → 0.1.3

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.
@@ -11,20 +11,22 @@ import {
11
11
  getResolvedPageByPathname,
12
12
  getResolvedSectionById,
13
13
  isSamePagePathname,
14
+ nivelAssetUrl,
14
15
  resolveDocsHref,
15
16
  withSiteBaseUrl
16
- } from "./chunk-CL74JUQ4.js";
17
+ } from "./chunk-NDJ5LYLK.js";
17
18
 
18
19
  // src/runtime/client/AppLayout.tsx
20
+ import { cmMerge as cmMerge5 } from "@classmatejs/react";
19
21
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
20
- import { useState as useState5 } from "react";
21
- import { usePageContext as usePageContext3 } from "vike-react/usePageContext";
22
+ import { useState as useState4 } from "react";
23
+ import { usePageContext as usePageContext5 } from "vike-react/usePageContext";
22
24
 
23
25
  // src/runtime/client/components/Navbar/index.tsx
24
26
  import cm2, { cmMerge as cmMerge4 } from "@classmatejs/react";
25
- import { ChevronDown } from "lucide-react";
26
- import { useCallback, useEffect as useEffect4, useMemo, useRef as useRef2, useState as useState4 } from "react";
27
- import { usePageContext as usePageContext2 } from "vike-react/usePageContext";
27
+ 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";
28
30
 
29
31
  // src/runtime/client/docsGlobalContext.ts
30
32
  import { usePageContext } from "vike-react/usePageContext";
@@ -39,14 +41,153 @@ var useDocsGlobalContext = () => {
39
41
  return getDocsGlobalContext(usePageContext());
40
42
  };
41
43
 
44
+ // src/runtime/client/store/runtime-store.tsx
45
+ import { createContext, useContext } from "react";
46
+ import { useStore } from "zustand";
47
+ import { createStore } from "zustand/vanilla";
48
+ import { jsx } from "react/jsx-runtime";
49
+ var defaultDocsSearchState = {
50
+ isOpen: false,
51
+ query: ""
52
+ };
53
+ var defaultDocsSidebarState = {
54
+ openNodes: {},
55
+ scrollTop: 0
56
+ };
57
+ var createDocsRuntimeStore = () => {
58
+ return createStore()((set) => {
59
+ const searchActions = {
60
+ open: () => set((state) => {
61
+ if (state.searchState.isOpen) {
62
+ return state;
63
+ }
64
+ return {
65
+ searchState: {
66
+ ...state.searchState,
67
+ isOpen: true
68
+ }
69
+ };
70
+ }),
71
+ close: () => set((state) => {
72
+ if (!state.searchState.isOpen) {
73
+ return state;
74
+ }
75
+ return {
76
+ searchState: {
77
+ ...state.searchState,
78
+ isOpen: false
79
+ }
80
+ };
81
+ }),
82
+ toggle: () => set((state) => ({
83
+ searchState: {
84
+ ...state.searchState,
85
+ isOpen: !state.searchState.isOpen
86
+ }
87
+ })),
88
+ setQuery: (query) => set((state) => {
89
+ if (state.searchState.query === query) {
90
+ return state;
91
+ }
92
+ return {
93
+ searchState: {
94
+ ...state.searchState,
95
+ query
96
+ }
97
+ };
98
+ }),
99
+ clearQuery: () => set((state) => {
100
+ if (state.searchState.query === "") {
101
+ return state;
102
+ }
103
+ return {
104
+ searchState: {
105
+ ...state.searchState,
106
+ query: ""
107
+ }
108
+ };
109
+ })
110
+ };
111
+ const sidebarActions = {
112
+ setNodeOpen: (nodeId, isOpen) => set((state) => {
113
+ if (state.sidebarState.openNodes[nodeId] === isOpen) {
114
+ return state;
115
+ }
116
+ return {
117
+ sidebarState: {
118
+ ...state.sidebarState,
119
+ openNodes: {
120
+ ...state.sidebarState.openNodes,
121
+ [nodeId]: isOpen
122
+ }
123
+ }
124
+ };
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
+ })
137
+ };
138
+ return {
139
+ searchActions,
140
+ searchState: defaultDocsSearchState,
141
+ sidebarActions,
142
+ sidebarState: defaultDocsSidebarState
143
+ };
144
+ });
145
+ };
146
+ var DocsRuntimeStoreContext = createContext(null);
147
+ var DocsRuntimeStoreProvider = ({ children, store }) => {
148
+ return /* @__PURE__ */ jsx(DocsRuntimeStoreContext.Provider, { value: store, children });
149
+ };
150
+ var useDocsRuntimeStoreApi = () => {
151
+ const store = useContext(DocsRuntimeStoreContext);
152
+ if (store === null) {
153
+ throw new Error("Missing docs runtime store provider.");
154
+ }
155
+ return store;
156
+ };
157
+ var useDocsRuntimeStore = (selector) => {
158
+ return useStore(useDocsRuntimeStoreApi(), selector);
159
+ };
160
+ var useDocsSearchStore = (selector) => {
161
+ return useDocsRuntimeStore(
162
+ (state) => selector({
163
+ ...state.searchState,
164
+ ...state.searchActions
165
+ })
166
+ );
167
+ };
168
+ var useDocsSearchActions = () => {
169
+ return useDocsRuntimeStore((state) => state.searchActions);
170
+ };
171
+ var useDocsSidebarStore = (selector) => {
172
+ return useDocsRuntimeStore(
173
+ (state) => selector({
174
+ ...state.sidebarState,
175
+ ...state.sidebarActions
176
+ })
177
+ );
178
+ };
179
+ var useDocsSidebarActions = () => {
180
+ return useDocsRuntimeStore((state) => state.sidebarActions);
181
+ };
182
+
42
183
  // src/runtime/client/components/Brand.tsx
43
184
  import { cmMerge } from "@classmatejs/react";
44
- import { jsx, jsxs } from "react/jsx-runtime";
185
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
45
186
  var Brand = ({ brand, noText = false }) => {
46
187
  const defaultLogo = brand.logoLight ?? brand.logoDark;
47
188
  return /* @__PURE__ */ jsxs("a", { href: brand.href, className: "flex items-center gap-3 text-base-content no-underline", children: [
48
189
  defaultLogo && /* @__PURE__ */ jsxs("span", { className: "relative block h-7 w-7 shrink-0", children: [
49
- brand.logoLight && /* @__PURE__ */ jsx(
190
+ brand.logoLight && /* @__PURE__ */ jsx2(
50
191
  "img",
51
192
  {
52
193
  src: brand.logoLight,
@@ -54,7 +195,7 @@ var Brand = ({ brand, noText = false }) => {
54
195
  className: cmMerge("h-7 w-7 object-contain", brand.logoDark ? "block dark:hidden" : "block")
55
196
  }
56
197
  ),
57
- brand.logoDark && /* @__PURE__ */ jsx(
198
+ brand.logoDark && /* @__PURE__ */ jsx2(
58
199
  "img",
59
200
  {
60
201
  src: brand.logoDark,
@@ -63,7 +204,7 @@ var Brand = ({ brand, noText = false }) => {
63
204
  }
64
205
  )
65
206
  ] }),
66
- !noText && /* @__PURE__ */ jsx("span", { className: "text-xl font-semibold tracking-tight", children: brand.text })
207
+ !noText && /* @__PURE__ */ jsx2("span", { className: "text-xl font-semibold tracking-tight", children: brand.text })
67
208
  ] });
68
209
  };
69
210
 
@@ -103,6 +244,7 @@ import { useQuery } from "@tanstack/react-query";
103
244
  import { ArrowRightFromLine, MessageCircleQuestion, Search as SearchIcon, TriangleAlert } from "lucide-react";
104
245
  import { useEffect, useRef, useState } from "react";
105
246
  import { createPortal } from "react-dom";
247
+ import { usePageContext as usePageContext2 } from "vike-react/usePageContext";
106
248
 
107
249
  // src/runtime/client/search.ts
108
250
  var hierarchyLevels = ["lvl0", "lvl1", "lvl2", "lvl3", "lvl4", "lvl5", "lvl6"];
@@ -203,7 +345,7 @@ var searchAlgoliaIndex = async (options) => {
203
345
  };
204
346
 
205
347
  // src/runtime/client/components/Search.tsx
206
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
348
+ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
207
349
  var MIN_QUERY_LENGTH = 2;
208
350
  var QUERY_DEBOUNCE_MS = 150;
209
351
  var useDebouncedValue = (value, delayMs) => {
@@ -218,48 +360,17 @@ var useDebouncedValue = (value, delayMs) => {
218
360
  }, [delayMs, value]);
219
361
  return debouncedValue;
220
362
  };
221
- var Search = ({ algolia }) => {
222
- const [isOpen, setIsOpen] = useState(false);
223
- const [query, setQuery] = useState("");
363
+ var SearchTrigger = () => {
364
+ const pageContext = usePageContext2();
365
+ const docs = getDocsGlobalContext(pageContext);
366
+ const { open, setQuery } = useDocsSearchActions();
367
+ const query = useDocsSearchStore((state) => state.query);
224
368
  const [isSearchHovered, setIsSearchHovered] = useState(false);
225
- const containerRef = useRef(null);
226
- const suggestionBoxRef = useRef(null);
227
- const debouncedQuery = useDebouncedValue(query, QUERY_DEBOUNCE_MS);
228
- const normalizedQuery = debouncedQuery.trim();
229
- const canSearch = Boolean(algolia) && normalizedQuery.length >= MIN_QUERY_LENGTH;
230
- const searchQuery = useQuery({
231
- queryKey: ["nivel-algolia-search", algolia?.appId, algolia?.indexName, normalizedQuery],
232
- queryFn: ({ signal }) => searchAlgoliaIndex({ config: algolia, query: normalizedQuery, signal }),
233
- enabled: isOpen && canSearch,
234
- retry: false
235
- });
236
- useEffect(() => {
237
- if (!isOpen) {
238
- return;
239
- }
240
- const handlePointerDown = (event) => {
241
- const target = event.target;
242
- if (!containerRef.current?.contains(target) && !suggestionBoxRef.current?.contains(target)) {
243
- setIsOpen(false);
244
- }
245
- };
246
- const handleKeyDown = (event) => {
247
- if (event.key === "Escape") {
248
- setIsOpen(false);
249
- }
250
- };
251
- document.addEventListener("pointerdown", handlePointerDown);
252
- document.addEventListener("keydown", handleKeyDown);
253
- return () => {
254
- document.removeEventListener("pointerdown", handlePointerDown);
255
- document.removeEventListener("keydown", handleKeyDown);
256
- };
257
- }, [isOpen]);
258
- if (!algolia) {
369
+ if (!docs.algolia) {
259
370
  return null;
260
371
  }
261
- return /* @__PURE__ */ jsxs2("div", { ref: containerRef, className: "relative", children: [
262
- /* @__PURE__ */ jsx2("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxs2(
372
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
373
+ /* @__PURE__ */ jsx3("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxs2(
263
374
  "label",
264
375
  {
265
376
  className: cmMerge2(
@@ -269,8 +380,8 @@ var Search = ({ algolia }) => {
269
380
  onMouseEnter: () => setIsSearchHovered(true),
270
381
  onMouseLeave: () => setIsSearchHovered(false),
271
382
  children: [
272
- /* @__PURE__ */ jsx2("span", { className: "label", children: /* @__PURE__ */ jsx2(SearchIcon, { className: "h-4 w-4 shrink-0" }) }),
273
- /* @__PURE__ */ jsx2(
383
+ /* @__PURE__ */ jsx3("span", { className: "label", children: /* @__PURE__ */ jsx3(SearchIcon, { className: "h-4 w-4 shrink-0" }) }),
384
+ /* @__PURE__ */ jsx3(
274
385
  "input",
275
386
  {
276
387
  type: "text",
@@ -280,49 +391,81 @@ var Search = ({ algolia }) => {
280
391
  "w-full placeholder:text-base-muted-medium transition-colors",
281
392
  isSearchHovered && "placeholder:text-base-muted"
282
393
  ),
283
- onFocus: () => {
284
- setIsOpen(true);
285
- },
394
+ onFocus: open,
286
395
  onChange: (event) => {
287
396
  setQuery(event.target.value);
288
- setIsOpen(true);
397
+ open();
289
398
  }
290
399
  }
291
400
  )
292
401
  ]
293
402
  }
294
403
  ) }),
295
- /* @__PURE__ */ jsx2(
296
- "button",
297
- {
298
- type: "button",
299
- className: "btn btn-ghost btn-square md:hidden",
300
- "aria-label": "Search docs",
301
- onClick: () => {
302
- setIsOpen(true);
303
- },
304
- children: /* @__PURE__ */ jsx2(SearchIcon, { className: "h-4 w-4" })
404
+ /* @__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
+ ] });
406
+ };
407
+ var Search = () => {
408
+ const pageContext = usePageContext2();
409
+ const docs = getDocsGlobalContext(pageContext);
410
+ const { close, setQuery } = useDocsSearchActions();
411
+ const isOpen = useDocsSearchStore((state) => state.isOpen);
412
+ const query = useDocsSearchStore((state) => state.query);
413
+ const containerRef = useRef(null);
414
+ const suggestionBoxRef = useRef(null);
415
+ const previousPathnameRef = useRef(pageContext.urlPathname);
416
+ const debouncedQuery = useDebouncedValue(query, QUERY_DEBOUNCE_MS);
417
+ const normalizedQuery = debouncedQuery.trim();
418
+ const canSearch = Boolean(docs.algolia) && normalizedQuery.length >= MIN_QUERY_LENGTH;
419
+ const searchQuery = useQuery({
420
+ queryKey: ["nivel-algolia-search", docs.algolia?.appId, docs.algolia?.indexName, normalizedQuery],
421
+ queryFn: ({ signal }) => searchAlgoliaIndex({ config: docs.algolia, query: normalizedQuery, signal }),
422
+ enabled: isOpen && canSearch,
423
+ retry: false
424
+ });
425
+ useEffect(() => {
426
+ if (previousPathnameRef.current !== pageContext.urlPathname) {
427
+ close();
428
+ previousPathnameRef.current = pageContext.urlPathname;
429
+ }
430
+ }, [close, pageContext.urlPathname]);
431
+ useEffect(() => {
432
+ if (!isOpen) {
433
+ return;
434
+ }
435
+ const handlePointerDown = (event) => {
436
+ const target = event.target;
437
+ if (!containerRef.current?.contains(target) && !suggestionBoxRef.current?.contains(target)) {
438
+ close();
305
439
  }
306
- ),
307
- /* @__PURE__ */ jsx2(
308
- SearchSuggestionBox,
309
- {
310
- contentRef: suggestionBoxRef,
311
- isError: searchQuery.isError,
312
- isLoading: searchQuery.isFetching,
313
- isOpen,
314
- onClose: () => {
315
- setIsOpen(false);
316
- },
317
- onQueryChange: (nextQuery) => {
318
- setQuery(nextQuery);
319
- setIsOpen(true);
320
- },
321
- query,
322
- results: searchQuery.data ?? []
440
+ };
441
+ const handleKeyDown = (event) => {
442
+ if (event.key === "Escape") {
443
+ close();
323
444
  }
324
- )
325
- ] });
445
+ };
446
+ document.addEventListener("pointerdown", handlePointerDown);
447
+ document.addEventListener("keydown", handleKeyDown);
448
+ return () => {
449
+ document.removeEventListener("pointerdown", handlePointerDown);
450
+ document.removeEventListener("keydown", handleKeyDown);
451
+ };
452
+ }, [close, isOpen]);
453
+ if (!docs.algolia) {
454
+ return null;
455
+ }
456
+ return /* @__PURE__ */ jsx3("div", { ref: containerRef, className: "relative", children: /* @__PURE__ */ jsx3(
457
+ SearchSuggestionBox,
458
+ {
459
+ contentRef: suggestionBoxRef,
460
+ isError: searchQuery.isError,
461
+ isLoading: searchQuery.isFetching,
462
+ isOpen,
463
+ onClose: close,
464
+ onQueryChange: setQuery,
465
+ query,
466
+ results: searchQuery.data ?? []
467
+ }
468
+ ) });
326
469
  };
327
470
  var SearchSuggestionBox = ({
328
471
  contentRef,
@@ -354,15 +497,15 @@ var SearchSuggestionBox = ({
354
497
  }
355
498
  return createPortal(
356
499
  /* @__PURE__ */ jsxs2("div", { className: "fixed inset-0 z-30 h-full w-full bg-base-100/50 backdrop-blur-lg", children: [
357
- /* @__PURE__ */ jsx2("div", { className: "absolute inset-0 z-1 bg-linear-to-b from-base-100 via-base-100 via-25% to-primary-muted-superlight dark:bg-linear-to-t" }),
500
+ /* @__PURE__ */ jsx3("div", { className: "absolute inset-0 z-1 bg-linear-to-b from-base-100 via-base-100 via-25% to-primary-muted-superlight dark:bg-linear-to-t" }),
358
501
  /* @__PURE__ */ jsxs2(
359
502
  LayoutComponent,
360
503
  {
361
504
  ref: contentRef,
362
505
  $size: "sm",
363
- className: "mt-5 relative z-2 pt-6 p-6 bg-base-100/70 rounded-box shadow-lg shadow-primary-muted-light",
506
+ className: "mt-5 relative z-2 rounded-box bg-base-100/70 p-6 pt-6 shadow-lg shadow-primary-muted-light",
364
507
  children: [
365
- /* @__PURE__ */ jsx2(
508
+ /* @__PURE__ */ jsx3(
366
509
  "input",
367
510
  {
368
511
  placeholder: "Search docs",
@@ -373,34 +516,34 @@ var SearchSuggestionBox = ({
373
516
  onChange: (event) => onQueryChange(event.target.value)
374
517
  }
375
518
  ),
376
- /* @__PURE__ */ jsx2("div", { className: "flex h-7 items-center px-4 text-xs text-base-muted", children: isLoading ? /* @__PURE__ */ jsxs2("span", { className: "flex items-center gap-1", children: [
377
- /* @__PURE__ */ jsx2("span", { className: "loading loading-dots loading-xs" }),
519
+ /* @__PURE__ */ jsx3("div", { className: "flex h-7 items-center px-4 text-xs text-base-muted", children: isLoading ? /* @__PURE__ */ jsxs2("span", { className: "flex items-center gap-1", children: [
520
+ /* @__PURE__ */ jsx3("span", { className: "loading loading-dots loading-xs" }),
378
521
  "Searching..."
379
522
  ] }) : normalizedQuery ? null : /* @__PURE__ */ jsxs2("span", { className: "flex items-center gap-1", children: [
380
- /* @__PURE__ */ jsx2(MessageCircleQuestion, { className: "h-3 w-3 shrink-0" }),
523
+ /* @__PURE__ */ jsx3(MessageCircleQuestion, { className: "h-3 w-3 shrink-0" }),
381
524
  "Type at least ",
382
525
  MIN_QUERY_LENGTH,
383
526
  " characters."
384
527
  ] }) }),
385
528
  normalizedQuery ? isError ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 rounded-box border border-warning/40 bg-base-100 p-4 text-sm text-base-muted shadow-md shadow-primary-muted-light", children: [
386
- /* @__PURE__ */ jsx2(TriangleAlert, { className: "h-4 w-4 shrink-0 text-warning" }),
529
+ /* @__PURE__ */ jsx3(TriangleAlert, { className: "h-4 w-4 shrink-0 text-warning" }),
387
530
  "Search is temporarily unavailable."
388
- ] }) : !canSearch ? /* @__PURE__ */ jsx2("div", { className: "text-sm text-base-muted", children: "Keep typing to search." }) : !isLoading && results.length === 0 ? /* @__PURE__ */ jsx2("div", { className: "text-sm text-base-muted", children: "No results found." }) : /* @__PURE__ */ jsx2("div", { className: "max-h-80 overflow-y-auto -mx-2 p-2", children: /* @__PURE__ */ jsx2("ul", { className: "flex flex-col gap-2", children: results.map((result) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs2(
531
+ ] }) : !canSearch ? /* @__PURE__ */ jsx3("div", { className: "text-sm text-base-muted", children: "Keep typing to search." }) : !isLoading && results.length === 0 ? /* @__PURE__ */ jsx3("div", { className: "text-sm text-base-muted", children: "No results found." }) : /* @__PURE__ */ jsx3("div", { className: "-mx-2 max-h-80 overflow-y-auto p-2", children: /* @__PURE__ */ jsx3("ul", { className: "flex flex-col gap-2", children: results.map((result) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs2(
389
532
  "a",
390
533
  {
391
534
  href: withSiteBaseUrl(result.href),
392
- className: "block rounded-box border border-base-muted-medium bg-base-100 p-4 hover:border-primary-muted hover:bg-base-200 shadow-md",
535
+ className: "block rounded-box border border-base-muted-medium bg-base-100 p-4 shadow-md hover:border-primary-muted hover:bg-base-200",
393
536
  onClick: onClose,
394
537
  children: [
395
538
  /* @__PURE__ */ jsxs2("div", { className: "mb-2 flex items-center justify-start gap-2", children: [
396
- /* @__PURE__ */ jsx2("div", { className: "text-base-content font-bold", children: result.title }),
539
+ /* @__PURE__ */ jsx3("div", { className: "font-bold text-base-content", children: result.title }),
397
540
  result.sectionTitle ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1 text-sm text-base-muted-medium", children: [
398
- /* @__PURE__ */ jsx2(ArrowRightFromLine, { className: "h-3 w-3" }),
541
+ /* @__PURE__ */ jsx3(ArrowRightFromLine, { className: "h-3 w-3" }),
399
542
  " ",
400
543
  result.sectionTitle
401
544
  ] }) : null
402
545
  ] }),
403
- result.excerpt ? /* @__PURE__ */ jsx2("p", { className: "text-xs leading-5 text-base-muted", children: result.excerpt }) : null
546
+ result.excerpt ? /* @__PURE__ */ jsx3("p", { className: "text-xs leading-5 text-base-muted", children: result.excerpt }) : null
404
547
  ]
405
548
  }
406
549
  ) }, result.href)) }) }) : null
@@ -412,6 +555,41 @@ var SearchSuggestionBox = ({
412
555
  );
413
556
  };
414
557
 
558
+ // src/runtime/client/components/SocialLinks.tsx
559
+ import { usePageContext as usePageContext3 } from "vike-react/usePageContext";
560
+ import { jsx as jsx4 } from "react/jsx-runtime";
561
+ var _iconAssets = {
562
+ github: nivelAssetUrl("brands/github.svg"),
563
+ discord: nivelAssetUrl(`brands/discord.svg`),
564
+ x: nivelAssetUrl(`brands/x.svg`),
565
+ bluesky: nivelAssetUrl(`brands/bluesky.svg`),
566
+ linkedin: nivelAssetUrl("brands/linkedin.svg")
567
+ };
568
+ var SocialIconElement = ({ icon, href }) => {
569
+ return /* @__PURE__ */ jsx4("li", { className: "m-0 p-0", children: /* @__PURE__ */ jsx4(
570
+ "a",
571
+ {
572
+ href,
573
+ target: "_blank",
574
+ rel: "noopener noreferrer",
575
+ className: "flex h-8 w-8 items-center justify-center rounded-full border border-base-muted-light bg-base-200",
576
+ children: /* @__PURE__ */ jsx4("img", { src: _iconAssets[icon], alt: `${icon} icon`, className: "h-3 w-auto opacity-75 dark:invert" })
577
+ }
578
+ ) });
579
+ };
580
+ var SocialIcons = () => {
581
+ const pageContext = usePageContext3();
582
+ const docs = getDocsGlobalContext(pageContext);
583
+ const socialEntries = Object.entries(docs.social ?? {}).filter(
584
+ (entry) => entry[0] in _iconAssets && typeof entry[1] === "string" && entry[1].length > 0
585
+ );
586
+ if (socialEntries.length === 0) {
587
+ return null;
588
+ }
589
+ return /* @__PURE__ */ jsx4("ul", { className: "flex items-center gap-1", children: socialEntries.map(([platform, href]) => /* @__PURE__ */ jsx4(SocialIconElement, { icon: platform, href }, platform)) });
590
+ };
591
+ var SocialLinks_default = SocialIcons;
592
+
415
593
  // src/runtime/client/components/ThemeSwitch.tsx
416
594
  import { Moon, Sun } from "lucide-react";
417
595
 
@@ -497,7 +675,7 @@ var applyThemePreference = (themePreference, themeConfig) => {
497
675
  };
498
676
 
499
677
  // src/runtime/client/components/ThemeSwitch.tsx
500
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
678
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
501
679
  var ThemeSwitch = ({ theme }) => {
502
680
  const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
503
681
  const setThemePreference = useDocsUserSettingsStore((state) => state.setThemePreference);
@@ -510,24 +688,25 @@ var ThemeSwitch = ({ theme }) => {
510
688
  onClick: () => setThemePreference(effectiveThemePreference === "light" ? "dark" : "light"),
511
689
  className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-base-muted-light bg-base-200",
512
690
  children: [
513
- /* @__PURE__ */ jsx3(Sun, { className: "h-4 w-4 dark:hidden" }),
514
- /* @__PURE__ */ jsx3(Moon, { className: "hidden h-4 w-4 dark:block" })
691
+ /* @__PURE__ */ jsx5(Sun, { className: "h-4 w-4 dark:hidden" }),
692
+ /* @__PURE__ */ jsx5(Moon, { className: "hidden h-4 w-4 dark:block" })
515
693
  ]
516
694
  }
517
695
  );
518
696
  };
519
697
 
520
- // src/runtime/client/components/Navbar/MegaMenu/index.tsx
698
+ // src/runtime/client/components/Navbar/MegaMenu.tsx
521
699
  import { cmMerge as cmMerge3 } from "@classmatejs/react";
522
700
  import { useEffect as useEffect2, useState as useState2 } from "react";
523
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
701
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
524
702
  var MegaMenu = ({
525
703
  isActive,
526
704
  onOpen,
527
705
  onClose,
528
706
  sections,
529
707
  activeSectionId,
530
- hoveredSectionId
708
+ hoveredSectionId,
709
+ isLandingPage
531
710
  }) => {
532
711
  const visibleSectionId = hoveredSectionId ?? activeSectionId ?? sections[0]?.id;
533
712
  const [visibleSectionElement, setVisibleSectionElement] = useState2(null);
@@ -563,7 +742,7 @@ var MegaMenu = ({
563
742
  onPointerEnter: () => onOpen(visibleSectionId),
564
743
  onPointerLeave: onClose,
565
744
  children: [
566
- /* @__PURE__ */ jsx4(
745
+ /* @__PURE__ */ jsx6(
567
746
  "div",
568
747
  {
569
748
  className: cmMerge3(
@@ -572,21 +751,22 @@ var MegaMenu = ({
572
751
  )
573
752
  }
574
753
  ),
575
- /* @__PURE__ */ jsx4(
754
+ /* @__PURE__ */ jsx6(
576
755
  "div",
577
756
  {
578
757
  className: cmMerge3(
579
- "relative z-4 overflow-hidden bg-base-100 transition-[height] duration-300 ease-out border-b border-base-muted-light"
758
+ "relative z-4 overflow-hidden transition-[height] bg-base-100 duration-300",
759
+ isLandingPage && !isActive ? "" : "border-b border-base-muted-light ease-out"
580
760
  ),
581
761
  style: { height: isActive ? contentHeight : 0 },
582
- children: /* @__PURE__ */ jsx4(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx4(
762
+ children: /* @__PURE__ */ jsx6(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx6(
583
763
  "div",
584
764
  {
585
765
  className: cmMerge3(
586
766
  isActive ? "translate-y-0 opacity-100" : "-translate-y-10 opacity-0",
587
767
  "relative z-4 transition-all duration-300"
588
768
  ),
589
- children: sections.map((section) => /* @__PURE__ */ jsx4(
769
+ children: sections.map((section) => /* @__PURE__ */ jsx6(
590
770
  "div",
591
771
  {
592
772
  ref: section.id === visibleSectionId ? setVisibleSectionElement : void 0,
@@ -594,17 +774,17 @@ var MegaMenu = ({
594
774
  section.id === visibleSectionId ? "opacity-100" : "opacity-0 pointer-events-none",
595
775
  "transition-all absolute w-full duration-300"
596
776
  ),
597
- children: section.items.length > 0 && /* @__PURE__ */ jsx4("ul", { className: "mt-2 flex ", children: section.items.map(
777
+ children: section.items.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "mt-2 flex ", children: section.items.map(
598
778
  (child) => child.showInNav !== false && /* @__PURE__ */ jsxs4("li", { className: "flex-1 py-3 mb-6 px-4", children: [
599
- child.href ? /* @__PURE__ */ jsx4(
779
+ child.href ? /* @__PURE__ */ jsx6(
600
780
  "a",
601
781
  {
602
782
  className: "mb-4 block text-lg font-semibold tracking-tight",
603
783
  href: withSiteBaseUrl(child.href),
604
784
  children: child.title
605
785
  }
606
- ) : /* @__PURE__ */ jsx4("span", { className: "mb-4 block text-lg font-semibold tracking-tight", children: child.title }),
607
- child.kind === "group" && child.items.length > 0 && /* @__PURE__ */ jsx4("ul", { className: "menu border-l border-base-muted-light py-0 w-full", children: child.items.map((subChild) => /* @__PURE__ */ jsx4("li", { children: subChild.href ? /* @__PURE__ */ jsx4("a", { href: withSiteBaseUrl(subChild.href), onClick: onClose, children: renderInlineMarkdown(subChild.title) }) : /* @__PURE__ */ jsx4("span", { children: renderInlineMarkdown(subChild.title) }) }, subChild.id)) })
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)) })
608
788
  ] }, child.id)
609
789
  ) })
610
790
  },
@@ -620,45 +800,18 @@ var MegaMenu = ({
620
800
  );
621
801
  };
622
802
 
623
- // src/runtime/client/components/Navbar/useNavbarScroll.ts
624
- import { useEffect as useEffect3, useState as useState3 } from "react";
625
- var useNavbarScroll = (isLandingPage) => {
626
- const [isLandingPageScrolled, setIsLandingPageScrolled] = useState3(false);
627
- useEffect3(() => {
628
- if (!isLandingPage) {
629
- setIsLandingPageScrolled(false);
630
- return;
631
- }
632
- const handleScroll = () => {
633
- setIsLandingPageScrolled(window.scrollY > 20);
634
- };
635
- handleScroll();
636
- window.addEventListener("scroll", handleScroll, { passive: true });
637
- return () => {
638
- window.removeEventListener("scroll", handleScroll);
639
- };
640
- }, [isLandingPage]);
641
- return {
642
- isLandingPageScrolled
643
- };
644
- };
645
-
646
803
  // src/runtime/client/components/Navbar/index.tsx
647
- import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
648
- var Navbar = ({ brand, algolia, navbarItems, theme, sections }) => {
649
- const { urlPathname } = usePageContext2();
804
+ 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();
650
807
  const isLandingPage = urlPathname === "/";
651
- const { isLandingPageScrolled } = useNavbarScroll(isLandingPage);
652
- const [isMegaMenuOpen, setIsMegaMenuOpen] = useState4(false);
808
+ const [isMegaMenuOpen, setIsMegaMenuOpen] = useState3(false);
653
809
  const megaMenuCloseTimeoutRef = useRef2(null);
654
- const pageContext = usePageContext2();
810
+ const pageContext = usePageContext4();
655
811
  const docs = getDocsGlobalContext(pageContext);
656
812
  const activeSection = getActiveSectionByPathname(docs, pageContext.urlPathname);
657
- const [hoveredSectionId, setHoveredSectionId] = useState4(activeSection?.id ?? sections[0]?.id);
658
- const showChrome = useMemo(
659
- () => !isLandingPage || isLandingPageScrolled || !isMegaMenuOpen,
660
- [isLandingPage, isLandingPageScrolled, isMegaMenuOpen]
661
- );
813
+ const [hoveredSectionId, setHoveredSectionId] = useState3(activeSection?.id ?? sections[0]?.id);
814
+ const { toggle: toggleSearch } = useDocsSearchActions();
662
815
  const clearMegaMenuCloseTimeout = useCallback(() => {
663
816
  if (megaMenuCloseTimeoutRef.current === null) {
664
817
  return;
@@ -682,58 +835,72 @@ var Navbar = ({ brand, algolia, navbarItems, theme, sections }) => {
682
835
  megaMenuCloseTimeoutRef.current = window.setTimeout(() => {
683
836
  setIsMegaMenuOpen(false);
684
837
  megaMenuCloseTimeoutRef.current = null;
685
- }, 120);
838
+ }, 140);
686
839
  };
687
- useEffect4(() => {
840
+ useEffect3(() => {
688
841
  return () => {
689
842
  clearMegaMenuCloseTimeout();
690
843
  };
691
844
  }, [clearMegaMenuCloseTimeout]);
692
- return /* @__PURE__ */ jsxs5(Fragment, { children: [
693
- /* @__PURE__ */ jsx5(StyledNavbar, { $border: showChrome, children: /* @__PURE__ */ jsx5(LayoutComponent, { className: "h-full", children: isLandingPage ? /* @__PURE__ */ jsxs5("div", { className: "relative z-3 flex h-full items-center justify-between py-4", children: [
694
- /* @__PURE__ */ jsx5("div", { className: "flex flex-1 items-center gap-4", children: /* @__PURE__ */ jsx5(Brand, { brand }) }),
695
- /* @__PURE__ */ jsx5(
845
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
846
+ /* @__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 }) }),
848
+ /* @__PURE__ */ jsx7(
696
849
  "nav",
697
850
  {
698
851
  "aria-label": "Primary",
699
852
  className: "top-0 left-0 flex min-w-0 flex-1 items-center justify-center gap-4 overflow-x-auto",
700
- children: /* @__PURE__ */ jsx5("ul", { className: "flex items-center font-semibold", children: navbarItems.map((item) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
701
- "a",
702
- {
703
- href: withSiteBaseUrl(item.href),
704
- className: "h-full block py-3.25",
705
- onPointerEnter: () => openMegaMenu(item.id),
706
- onPointerLeave: scheduleMegaMenuClose,
707
- onFocus: () => openMegaMenu(item.id),
708
- onBlur: scheduleMegaMenuClose,
709
- onClick: closeMegaMenu,
710
- children: /* @__PURE__ */ jsxs5(
711
- "span",
712
- {
713
- className: cmMerge4("btn text-lg btn-ghost min-w-30 px-2 whitespace-nowrap tracking-tight"),
714
- children: [
715
- renderInlineMarkdown(item.title),
716
- /* @__PURE__ */ jsx5(ChevronDown, { className: "h-4 w-4 shrink-0" })
717
- ]
718
- }
719
- )
720
- }
721
- ) }, item.id)) })
853
+ children: /* @__PURE__ */ jsxs5("ul", { className: "flex items-center font-semibold", children: [
854
+ navbarItems.map((item) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
855
+ "a",
856
+ {
857
+ href: withSiteBaseUrl(item.href),
858
+ className: "h-full block py-3.25",
859
+ onPointerEnter: () => openMegaMenu(item.id),
860
+ onPointerLeave: scheduleMegaMenuClose,
861
+ onFocus: () => openMegaMenu(item.id),
862
+ onBlur: scheduleMegaMenuClose,
863
+ onClick: closeMegaMenu,
864
+ children: /* @__PURE__ */ jsxs5(
865
+ "span",
866
+ {
867
+ className: cmMerge4("btn text-lg btn-ghost min-w-30 px-2 whitespace-nowrap tracking-tight"),
868
+ children: [
869
+ renderInlineMarkdown(item.title),
870
+ /* @__PURE__ */ jsx7(ChevronDown, { className: "h-4 w-4 shrink-0" })
871
+ ]
872
+ }
873
+ )
874
+ }
875
+ ) }, item.id)),
876
+ docs.algolia ? /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs5(
877
+ "button",
878
+ {
879
+ type: "button",
880
+ onClick: toggleSearch,
881
+ className: "btn btn-ghost min-w-30 px-2 text-lg whitespace-nowrap tracking-tight",
882
+ children: [
883
+ "Search",
884
+ /* @__PURE__ */ jsx7(TextSearch, { className: "h-4 w-4" })
885
+ ]
886
+ }
887
+ ) }) : null
888
+ ] })
722
889
  }
723
890
  ),
724
891
  /* @__PURE__ */ jsxs5("div", { className: "flex flex-1 items-center justify-end gap-2", children: [
725
- /* @__PURE__ */ jsx5(Search, { algolia }),
726
- /* @__PURE__ */ jsx5(ThemeSwitch, { theme })
892
+ /* @__PURE__ */ jsx7(SocialLinks_default, {}),
893
+ /* @__PURE__ */ jsx7(ThemeSwitch, { theme })
727
894
  ] })
728
895
  ] }) : /* @__PURE__ */ jsxs5("div", { className: "relative z-3 flex h-full items-center justify-between py-4", children: [
729
- /* @__PURE__ */ jsx5("div", { className: "flex w-80 flex-1 items-center justify-between gap-2 lg:flex-none", children: /* @__PURE__ */ jsx5(Brand, { brand }) }),
896
+ /* @__PURE__ */ jsx7("div", { className: "flex w-80 flex-1 items-center justify-between gap-2 lg:flex-none", children: /* @__PURE__ */ jsx7(Brand, { brand }) }),
730
897
  /* @__PURE__ */ jsxs5(
731
898
  "nav",
732
899
  {
733
900
  "aria-label": "Primary",
734
901
  className: "top-0 left-0 flex flex-1 items-center justify-start gap-4 overflow-x-auto lg:pl-6 xl:pl-10",
735
902
  children: [
736
- /* @__PURE__ */ jsx5("ul", { className: "flex items-center gap-2 font-semibold", children: navbarItems.map((item) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
903
+ /* @__PURE__ */ jsx7("ul", { className: "flex items-center gap-2 font-semibold", children: navbarItems.map((item) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
737
904
  "a",
738
905
  {
739
906
  href: withSiteBaseUrl(item.href),
@@ -749,13 +916,17 @@ var Navbar = ({ brand, algolia, navbarItems, theme, sections }) => {
749
916
  children: renderInlineMarkdown(item.title)
750
917
  }
751
918
  ) }, item.id)) }),
752
- /* @__PURE__ */ jsx5(Search, { algolia })
919
+ /* @__PURE__ */ jsx7(SearchTrigger, {})
753
920
  ]
754
921
  }
755
922
  ),
756
- /* @__PURE__ */ jsx5("div", { className: "flex w-78 flex-1 items-center justify-end gap-2 lg:flex-none", children: /* @__PURE__ */ jsx5(ThemeSwitch, { theme }) })
923
+ /* @__PURE__ */ jsxs5("div", { className: "flex w-78 flex-1 items-center justify-end gap-2 lg:flex-none", children: [
924
+ /* @__PURE__ */ jsx7(SocialLinks_default, {}),
925
+ /* @__PURE__ */ jsx7(ThemeSwitch, { theme })
926
+ ] })
757
927
  ] }) }) }),
758
- /* @__PURE__ */ jsx5(
928
+ /* @__PURE__ */ jsx7(Search, {}),
929
+ /* @__PURE__ */ jsx7(
759
930
  MegaMenu,
760
931
  {
761
932
  sections,
@@ -763,17 +934,19 @@ var Navbar = ({ brand, algolia, navbarItems, theme, sections }) => {
763
934
  hoveredSectionId,
764
935
  isActive: isMegaMenuOpen,
765
936
  onOpen: openMegaMenu,
766
- onClose: scheduleMegaMenuClose
937
+ onClose: scheduleMegaMenuClose,
938
+ isLandingPage
767
939
  }
768
940
  )
769
941
  ] });
770
942
  };
771
943
  var StyledNavbar = cm2.header`
772
- fixed top-0 left-0 z-20 h-16 w-full bg-base-100
944
+ top-0 left-0 z-20 h-16 w-full bg-base-100
945
+ ${({ $border }) => $border ? "relative" : "fixed"}
773
946
  `;
774
947
 
775
948
  // src/runtime/client/components/UserSettingsSync.tsx
776
- import { useEffect as useEffect5 } from "react";
949
+ import { useEffect as useEffect4 } from "react";
777
950
  var UserSettingsSync = ({ theme }) => {
778
951
  const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
779
952
  const lightTheme = theme?.light ?? "consumer-light";
@@ -781,66 +954,65 @@ var UserSettingsSync = ({ theme }) => {
781
954
  const defaultThemePreference = theme?.defaultPreference ?? "light";
782
955
  const resolvedTheme = { light: lightTheme, dark: darkTheme, defaultPreference: defaultThemePreference };
783
956
  const effectiveThemePreference = resolveThemePreference(themePreference, resolvedTheme);
784
- useEffect5(() => {
957
+ useEffect4(() => {
785
958
  applyThemePreference(effectiveThemePreference, resolvedTheme);
786
959
  }, [darkTheme, defaultThemePreference, effectiveThemePreference, lightTheme]);
787
960
  return null;
788
961
  };
789
962
 
790
963
  // src/runtime/client/AppLayout.tsx
791
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
964
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
792
965
  var AppLayout = ({ children }) => {
793
- const pageContext = usePageContext3();
966
+ const { urlPathname } = usePageContext5();
967
+ const pageContext = usePageContext5();
794
968
  const docs = getDocsGlobalContext(pageContext);
795
- const [queryClient] = useState5(() => new QueryClient());
796
- return (
797
- // todo: we should try vike-react-query instead
798
- /* @__PURE__ */ jsxs6(QueryClientProvider, { client: queryClient, children: [
799
- /* @__PURE__ */ jsx6(UserSettingsSync, { theme: docs.theme }),
800
- /* @__PURE__ */ jsxs6("div", { className: "min-h-screen bg-base-100 text-base-content", children: [
801
- /* @__PURE__ */ jsx6(
802
- Navbar,
803
- {
804
- brand: docs.brand,
805
- algolia: docs.algolia,
806
- navbarItems: docs.navbarItems,
807
- sections: docs.sidebarSections,
808
- theme: docs.theme
809
- }
810
- ),
811
- /* @__PURE__ */ jsx6("div", { className: "pt-16", children })
812
- ] })
969
+ 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: [
973
+ /* @__PURE__ */ jsx8(UserSettingsSync, { theme: docs.theme }),
974
+ /* @__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
+ ),
984
+ /* @__PURE__ */ jsx8("div", { className: cmMerge5(isLandingPage ? "" : "pt-16"), children })
813
985
  ] })
814
- );
986
+ ] }) });
815
987
  };
816
988
 
817
989
  // src/runtime/client/components/MetaHead/FaviconLinks.tsx
818
- import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
990
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
819
991
  var FaviconLinks = ({ head }) => {
820
992
  const { appleTouchIcon, faviconIco, faviconSvg } = head;
821
- return /* @__PURE__ */ jsxs7(Fragment2, { children: [
822
- appleTouchIcon && /* @__PURE__ */ jsx7("link", { rel: "apple-touch-icon", href: appleTouchIcon }),
823
- faviconSvg && /* @__PURE__ */ jsx7("link", { rel: "icon", type: "image/svg+xml", href: faviconSvg }),
824
- faviconIco && /* @__PURE__ */ jsxs7(Fragment2, { children: [
825
- /* @__PURE__ */ jsx7("link", { rel: "shortcut icon", type: "image/x-icon", href: faviconIco }),
826
- /* @__PURE__ */ jsx7("link", { rel: "icon", type: "image/x-icon", href: faviconIco })
993
+ return /* @__PURE__ */ jsxs7(Fragment3, { children: [
994
+ appleTouchIcon && /* @__PURE__ */ jsx9("link", { rel: "apple-touch-icon", href: appleTouchIcon }),
995
+ faviconSvg && /* @__PURE__ */ jsx9("link", { rel: "icon", type: "image/svg+xml", href: faviconSvg }),
996
+ faviconIco && /* @__PURE__ */ jsxs7(Fragment3, { children: [
997
+ /* @__PURE__ */ jsx9("link", { rel: "shortcut icon", type: "image/x-icon", href: faviconIco }),
998
+ /* @__PURE__ */ jsx9("link", { rel: "icon", type: "image/x-icon", href: faviconIco })
827
999
  ] })
828
1000
  ] });
829
1001
  };
830
1002
 
831
1003
  // src/runtime/client/components/MetaHead/FontLinks.tsx
832
- import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1004
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
833
1005
  var FontLinks = ({ head }) => {
834
1006
  const { fontStylesheetHref, fontPreloadHrefs } = head;
835
1007
  const effectivePreloadHrefs = fontPreloadHrefs ?? [];
836
- return /* @__PURE__ */ jsxs8(Fragment3, { children: [
837
- effectivePreloadHrefs.map((href) => /* @__PURE__ */ jsx8("link", { rel: "preload", href, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, href)),
838
- fontStylesheetHref && /* @__PURE__ */ jsx8("link", { rel: "stylesheet", href: fontStylesheetHref })
1008
+ return /* @__PURE__ */ jsxs8(Fragment4, { children: [
1009
+ effectivePreloadHrefs.map((href) => /* @__PURE__ */ jsx10("link", { rel: "preload", href, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, href)),
1010
+ fontStylesheetHref && /* @__PURE__ */ jsx10("link", { rel: "stylesheet", href: fontStylesheetHref })
839
1011
  ] });
840
1012
  };
841
1013
 
842
1014
  // src/runtime/client/components/MetaHead/ThemeBootstrap.tsx
843
- import { jsx as jsx9 } from "react/jsx-runtime";
1015
+ import { jsx as jsx11 } from "react/jsx-runtime";
844
1016
  var getThemeBootstrapScript = (theme) => {
845
1017
  return `(() => {
846
1018
  const storageKey = ${JSON.stringify(USER_SETTINGS_STORAGE_KEY)};
@@ -878,7 +1050,7 @@ var getThemeBootstrapScript = (theme) => {
878
1050
  })();`;
879
1051
  };
880
1052
  var ThemeBootstrap = ({ theme }) => {
881
- return /* @__PURE__ */ jsx9(
1053
+ return /* @__PURE__ */ jsx11(
882
1054
  "script",
883
1055
  {
884
1056
  dangerouslySetInnerHTML: {
@@ -889,13 +1061,13 @@ var ThemeBootstrap = ({ theme }) => {
889
1061
  };
890
1062
 
891
1063
  // src/runtime/client/components/MetaHead/index.tsx
892
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1064
+ import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
893
1065
  var MetaHead = () => {
894
1066
  const docs = useDocsGlobalContext();
895
- return /* @__PURE__ */ jsxs9(Fragment4, { children: [
896
- /* @__PURE__ */ jsx10(ThemeBootstrap, { theme: docs.theme }),
897
- /* @__PURE__ */ jsx10(FaviconLinks, { head: docs.head }),
898
- /* @__PURE__ */ jsx10(FontLinks, { head: docs.head })
1067
+ return /* @__PURE__ */ jsxs9(Fragment5, { children: [
1068
+ /* @__PURE__ */ jsx12(ThemeBootstrap, { theme: docs.theme }),
1069
+ /* @__PURE__ */ jsx12(FaviconLinks, { head: docs.head }),
1070
+ /* @__PURE__ */ jsx12(FontLinks, { head: docs.head })
899
1071
  ] });
900
1072
  };
901
1073
 
@@ -907,37 +1079,37 @@ var ProseContainer = cm3.section`
907
1079
 
908
1080
  // src/runtime/client/DocsPage.tsx
909
1081
  import { useData as useData2 } from "vike-react/useData";
910
- import { usePageContext as usePageContext4 } from "vike-react/usePageContext";
1082
+ import { usePageContext as usePageContext6 } from "vike-react/usePageContext";
911
1083
 
912
1084
  // src/runtime/client/components/DocsPagination.tsx
913
- import { cmMerge as cmMerge5 } from "@classmatejs/react";
1085
+ import { cmMerge as cmMerge6 } from "@classmatejs/react";
914
1086
  import { ChevronLeft, ChevronRight } from "lucide-react";
915
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1087
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
916
1088
  var PaginationCard = ({ item, direction, isOffset }) => {
917
1089
  const isPrevious = direction === "previous";
918
- return /* @__PURE__ */ jsx11(
1090
+ return /* @__PURE__ */ jsx13(
919
1091
  "a",
920
1092
  {
921
1093
  href: withSiteBaseUrl(item.href),
922
- className: cmMerge5(
1094
+ className: cmMerge6(
923
1095
  "group rounded-box border border-base-muted-light bg-base-100 p-5 no-underline hover:border-primary-muted-medium hover:bg-base-200",
924
1096
  isPrevious ? "text-left" : "text-right",
925
1097
  isOffset && "sm:col-start-2"
926
1098
  ),
927
1099
  "aria-label": `${isPrevious ? "Previous" : "Next"}: ${item.title}`,
928
1100
  children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col justify-between gap-2", children: [
929
- /* @__PURE__ */ jsx11("p", { className: "text-lg font-semibold text-base-content", children: renderInlineMarkdown(item.title) }),
1101
+ /* @__PURE__ */ jsx13("p", { className: "text-lg font-semibold text-base-content", children: renderInlineMarkdown(item.title) }),
930
1102
  /* @__PURE__ */ jsxs10(
931
1103
  "div",
932
1104
  {
933
- className: cmMerge5(
1105
+ className: cmMerge6(
934
1106
  "flex items-center gap-1 text-base-muted group-hover:text-base-content",
935
1107
  isPrevious ? "justify-start" : "justify-end"
936
1108
  ),
937
1109
  children: [
938
- isPrevious && /* @__PURE__ */ jsx11(ChevronLeft, { className: "h-4 w-4" }),
939
- /* @__PURE__ */ jsx11("span", { children: isPrevious ? "Previous" : "Next" }),
940
- !isPrevious && /* @__PURE__ */ jsx11(ChevronRight, { className: "h-4 w-4" })
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" })
941
1113
  ]
942
1114
  }
943
1115
  )
@@ -949,35 +1121,87 @@ var DocsPagination = ({ previousPage, nextPage }) => {
949
1121
  if (!previousPage && !nextPage) {
950
1122
  return null;
951
1123
  }
952
- return /* @__PURE__ */ jsx11("nav", { className: "mb-10 mt-16", "aria-label": "Previous Next", children: /* @__PURE__ */ jsxs10("div", { className: "grid gap-4 sm:grid-cols-2", children: [
953
- previousPage && /* @__PURE__ */ jsx11(PaginationCard, { item: previousPage, direction: "previous" }),
954
- nextPage && /* @__PURE__ */ jsx11(PaginationCard, { isOffset: !previousPage, item: nextPage, direction: "next" })
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" })
955
1127
  ] }) });
956
1128
  };
957
1129
 
958
1130
  // src/runtime/client/components/Footer.tsx
959
1131
  import { Bug, Pencil } from "lucide-react";
960
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1132
+ import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
961
1133
  var DocsFooter = ({ brand }) => {
962
1134
  return /* @__PURE__ */ jsxs11("footer", { className: "mb-8 mt-12 text-sm border-t border-base-muted-light pt-10", children: [
963
1135
  /* @__PURE__ */ jsxs11("div", { className: "mb-16 flex items-center gap-2", children: [
964
1136
  /* @__PURE__ */ jsxs11("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
965
- /* @__PURE__ */ jsx12(Pencil, { className: "w-3 h-3" }),
1137
+ /* @__PURE__ */ jsx14(Pencil, { className: "w-3 h-3" }),
966
1138
  " Edit this page"
967
1139
  ] }),
968
1140
  /* @__PURE__ */ jsxs11("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
969
- /* @__PURE__ */ jsx12(Bug, { className: "w-3 h-3" }),
1141
+ /* @__PURE__ */ jsx14(Bug, { className: "w-3 h-3" }),
970
1142
  " Report Issue"
971
1143
  ] })
972
1144
  ] }),
973
- /* @__PURE__ */ jsx12("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsx12("div", { className: "flex gap-2 items-center", children: brand && /* @__PURE__ */ jsx12(Brand, { brand, noText: true }) }) })
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 }) })
1148
+ ] })
974
1149
  ] });
975
1150
  };
976
1151
 
1152
+ // src/runtime/client/components/HeadingLinkCopy.tsx
1153
+ import { useEffect as useEffect5 } from "react";
1154
+ var copyText = async (value) => {
1155
+ try {
1156
+ await navigator.clipboard.writeText(value);
1157
+ return;
1158
+ } catch {
1159
+ const textarea = document.createElement("textarea");
1160
+ textarea.value = value;
1161
+ textarea.setAttribute("readonly", "true");
1162
+ textarea.style.position = "fixed";
1163
+ textarea.style.opacity = "0";
1164
+ document.body.appendChild(textarea);
1165
+ textarea.select();
1166
+ document.execCommand("copy");
1167
+ document.body.removeChild(textarea);
1168
+ }
1169
+ };
1170
+ var getHeadingLink = (target) => target instanceof Element ? target.closest("a[data-copy-heading-link]") : null;
1171
+ var HeadingLinkCopy = () => {
1172
+ useEffect5(() => {
1173
+ const handleClick = (event) => {
1174
+ if (event.defaultPrevented || event.button !== 0) {
1175
+ return;
1176
+ }
1177
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
1178
+ return;
1179
+ }
1180
+ const link = getHeadingLink(event.target);
1181
+ if (!link) {
1182
+ return;
1183
+ }
1184
+ const href = link.getAttribute("href");
1185
+ if (!href) {
1186
+ return;
1187
+ }
1188
+ const nextUrl = new URL(href, window.location.href);
1189
+ if (nextUrl.hash && window.location.hash !== nextUrl.hash) {
1190
+ history.replaceState(null, "", nextUrl.hash);
1191
+ }
1192
+ void copyText(nextUrl.href);
1193
+ };
1194
+ document.addEventListener("click", handleClick);
1195
+ return () => {
1196
+ document.removeEventListener("click", handleClick);
1197
+ };
1198
+ }, []);
1199
+ return null;
1200
+ };
1201
+
977
1202
  // src/runtime/client/components/Sidebar.tsx
978
- import { cmMerge as cmMerge6 } from "@classmatejs/react";
979
- import { useEffect as useEffect6 } from "react";
980
- import { create as create2 } from "zustand";
1203
+ import { cmMerge as cmMerge7 } from "@classmatejs/react";
1204
+ import { useEffect as useEffect6, useRef as useRef3 } from "react";
981
1205
 
982
1206
  // src/runtime/client/components/docsNavigation.ts
983
1207
  var containsActiveHref = (items, currentHref) => {
@@ -1005,24 +1229,10 @@ var getVisibleGroupItems = (group) => {
1005
1229
  var getGroupHref = (group) => group.href ?? null;
1006
1230
 
1007
1231
  // src/runtime/client/components/Sidebar.tsx
1008
- import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1009
- var useSidebarDisclosureStore = create2()((set) => ({
1010
- openNodes: {},
1011
- setNodeOpen: (nodeId, isOpen) => set((state) => {
1012
- if (state.openNodes[nodeId] === isOpen) {
1013
- return state;
1014
- }
1015
- return {
1016
- openNodes: {
1017
- ...state.openNodes,
1018
- [nodeId]: isOpen
1019
- }
1020
- };
1021
- })
1022
- }));
1232
+ import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1023
1233
  var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
1024
- const storedOpen = useSidebarDisclosureStore((state) => state.openNodes[nodeId]);
1025
- const setNodeOpen = useSidebarDisclosureStore((state) => state.setNodeOpen);
1234
+ const storedOpen = useDocsSidebarStore((state) => state.openNodes[nodeId]);
1235
+ const { setNodeOpen } = useDocsSidebarActions();
1026
1236
  const isOpen = storedOpen === void 0 ? isOpenByDefault || hasActiveDescendant : storedOpen || hasActiveDescendant;
1027
1237
  useEffect6(() => {
1028
1238
  if (hasActiveDescendant) {
@@ -1039,11 +1249,11 @@ var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
1039
1249
  };
1040
1250
  };
1041
1251
  var SidebarPageLink = ({ title, href, currentHref }) => {
1042
- return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(
1252
+ return /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(
1043
1253
  "a",
1044
1254
  {
1045
1255
  href: withSiteBaseUrl(href),
1046
- className: cmMerge6(
1256
+ className: cmMerge7(
1047
1257
  "text-base-muted hover:text-base-content justify-start hover:bg-base-200",
1048
1258
  href === currentHref && "text-primary! font-semibold bg-base-200"
1049
1259
  ),
@@ -1052,13 +1262,13 @@ var SidebarPageLink = ({ title, href, currentHref }) => {
1052
1262
  ) });
1053
1263
  };
1054
1264
  var SidebarGroupDivider = ({ title }) => {
1055
- return /* @__PURE__ */ jsx13("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__ */ jsx13("span", { className: "-ml-3", children: renderInlineMarkdown(title, { codeClassName: "text-sm!" }) }) });
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!" }) }) });
1056
1266
  };
1057
1267
  var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) => {
1058
- const content = /* @__PURE__ */ jsx13(
1268
+ const content = /* @__PURE__ */ jsx15(
1059
1269
  "span",
1060
1270
  {
1061
- className: cmMerge6(
1271
+ className: cmMerge7(
1062
1272
  allowNavigation ? "font-medium" : "font-semibold",
1063
1273
  isActive && allowNavigation && "text-primary!"
1064
1274
  ),
@@ -1066,11 +1276,11 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) =>
1066
1276
  }
1067
1277
  );
1068
1278
  if (allowNavigation && href) {
1069
- return /* @__PURE__ */ jsx13(
1279
+ return /* @__PURE__ */ jsx15(
1070
1280
  "a",
1071
1281
  {
1072
1282
  href: withSiteBaseUrl(href),
1073
- className: cmMerge6(
1283
+ className: cmMerge7(
1074
1284
  "flex items-center gap-2 text-base-muted hover:text-base-content no-underline",
1075
1285
  isActive && "text-primary! font-semibold"
1076
1286
  ),
@@ -1078,19 +1288,19 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) =>
1078
1288
  }
1079
1289
  );
1080
1290
  }
1081
- return /* @__PURE__ */ jsx13("span", { className: "flex items-center gap-2 text-base-content", children: content });
1291
+ return /* @__PURE__ */ jsx15("span", { className: "flex items-center gap-2 text-base-content", children: content });
1082
1292
  };
1083
1293
  var renderSidebarItems = (items, currentHref) => {
1084
1294
  return items.map((item) => {
1085
1295
  if (item.kind === "page") {
1086
- return /* @__PURE__ */ jsx13(SidebarPageLink, { title: item.navTitle, href: item.href, currentHref }, item.id);
1296
+ return /* @__PURE__ */ jsx15(SidebarPageLink, { title: item.navTitle, href: item.href, currentHref }, item.id);
1087
1297
  }
1088
- return /* @__PURE__ */ jsx13(SidebarNestedGroup, { group: item, currentHref }, item.id);
1298
+ return /* @__PURE__ */ jsx15(SidebarNestedGroup, { group: item, currentHref }, item.id);
1089
1299
  });
1090
1300
  };
1091
1301
  var SidebarItemList = ({ items, currentHref }) => {
1092
1302
  const visibleItems = getVisibleNavItems(items);
1093
- return /* @__PURE__ */ jsx13("ul", { className: "menu w-full", children: renderSidebarItems(visibleItems, currentHref) });
1303
+ return /* @__PURE__ */ jsx15("ul", { className: "menu w-full", children: renderSidebarItems(visibleItems, currentHref) });
1094
1304
  };
1095
1305
  var SidebarNestedGroup = ({ group, currentHref }) => {
1096
1306
  const groupHref = getGroupHref(group);
@@ -1101,14 +1311,14 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
1101
1311
  const { isOpen, setIsOpen } = useAutoOpenDetails(`group:${group.id}`, isOpenByDefault, nestedHasActiveItem);
1102
1312
  if (!isCollapsible) {
1103
1313
  if (!group.title) {
1104
- return /* @__PURE__ */ jsx13(Fragment5, { children: renderSidebarItems(visibleItems, currentHref) });
1314
+ return /* @__PURE__ */ jsx15(Fragment6, { children: renderSidebarItems(visibleItems, currentHref) });
1105
1315
  }
1106
- return /* @__PURE__ */ jsxs12(Fragment5, { children: [
1107
- /* @__PURE__ */ jsx13(SidebarGroupDivider, { title: group.title }),
1316
+ return /* @__PURE__ */ jsxs12(Fragment6, { children: [
1317
+ /* @__PURE__ */ jsx15(SidebarGroupDivider, { title: group.title }),
1108
1318
  renderSidebarItems(visibleItems, currentHref)
1109
1319
  ] });
1110
1320
  }
1111
- return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12(
1321
+ return /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs12(
1112
1322
  "details",
1113
1323
  {
1114
1324
  open: isOpen,
@@ -1116,7 +1326,7 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
1116
1326
  setIsOpen(event.currentTarget.open);
1117
1327
  },
1118
1328
  children: [
1119
- /* @__PURE__ */ jsx13("summary", { children: /* @__PURE__ */ jsx13(
1329
+ /* @__PURE__ */ jsx15("summary", { children: /* @__PURE__ */ jsx15(
1120
1330
  SidebarGroupTitle,
1121
1331
  {
1122
1332
  title: group.title,
@@ -1125,7 +1335,7 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
1125
1335
  allowNavigation: Boolean(groupHref)
1126
1336
  }
1127
1337
  ) }),
1128
- visibleItems.length > 0 ? /* @__PURE__ */ jsx13(SidebarItemList, { items: visibleItems, currentHref }) : null
1338
+ visibleItems.length > 0 ? /* @__PURE__ */ jsx15(SidebarItemList, { items: visibleItems, currentHref }) : null
1129
1339
  ]
1130
1340
  }
1131
1341
  ) });
@@ -1137,7 +1347,7 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
1137
1347
  section.id === activeSectionId,
1138
1348
  sectionHasActiveItem
1139
1349
  );
1140
- return /* @__PURE__ */ jsx13("li", { className: "pb-4", children: /* @__PURE__ */ jsxs12(
1350
+ return /* @__PURE__ */ jsx15("li", { className: "pb-4", children: /* @__PURE__ */ jsxs12(
1141
1351
  "details",
1142
1352
  {
1143
1353
  open: isOpen,
@@ -1145,33 +1355,53 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
1145
1355
  setIsOpen(event.currentTarget.open);
1146
1356
  },
1147
1357
  children: [
1148
- /* @__PURE__ */ jsx13("summary", { children: /* @__PURE__ */ jsx13(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem }) }),
1149
- /* @__PURE__ */ jsx13(SidebarItemList, { items: section.items, currentHref })
1358
+ /* @__PURE__ */ jsx15("summary", { children: /* @__PURE__ */ jsx15(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem }) }),
1359
+ /* @__PURE__ */ jsx15(SidebarItemList, { items: section.items, currentHref })
1150
1360
  ]
1151
1361
  }
1152
1362
  ) });
1153
1363
  };
1154
1364
  var Sidebar = ({ sections, activeSectionId, currentHref, horizontal }) => {
1155
- return /* @__PURE__ */ jsx13("aside", { className: "hidden basis-76 shrink-0 lg:block", children: /* @__PURE__ */ jsxs12("div", { className: "-ml-3 sticky top-16", children: [
1156
- /* @__PURE__ */ jsx13("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" }),
1157
- /* @__PURE__ */ jsx13("div", { className: "pr-4 h-[calc(100svh-16*var(--spacing))] overflow-y-scroll overflow-x-hidden relative z-10", children: /* @__PURE__ */ jsx13("ul", { className: cmMerge6("menu w-full px-0 py-5 li:last-child:border-0"), children: sections.map((section) => /* @__PURE__ */ jsx13(
1158
- SidebarSectionGroup,
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",
1159
1379
  {
1160
- section,
1161
- currentHref,
1162
- activeSectionId
1163
- },
1164
- section.id
1165
- )) }) })
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
+ )
1166
1396
  ] }) });
1167
1397
  };
1168
1398
 
1169
1399
  // src/runtime/client/components/TableOfContents.tsx
1170
- import cm4, { cmMerge as cmMerge7 } from "@classmatejs/react";
1400
+ import cm4, { cmMerge as cmMerge8 } from "@classmatejs/react";
1171
1401
  import { TableOfContentsIcon } from "lucide-react";
1172
- import { useEffect as useEffect7, useState as useState6 } from "react";
1402
+ import { useEffect as useEffect7, useState as useState5 } from "react";
1173
1403
  import { useData } from "vike-react/useData";
1174
- import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1404
+ import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
1175
1405
  var getCurrentHash = () => {
1176
1406
  try {
1177
1407
  return decodeURIComponent(window.location.hash);
@@ -1250,8 +1480,8 @@ var updateActiveHeadingFromScroll = (setActiveHeadingId) => {
1250
1480
  setActiveHeadingId(nextActiveHeadingId);
1251
1481
  };
1252
1482
  var TableOfContents = ({ headings, partners }) => {
1253
- const [activeHeadingId, setActiveHeadingId] = useState6("");
1254
- const [domHeadings, setDomHeadings] = useState6(headings);
1483
+ const [activeHeadingId, setActiveHeadingId] = useState5("");
1484
+ const [domHeadings, setDomHeadings] = useState5(headings);
1255
1485
  const effectiveHeadings = domHeadings.length > 0 ? domHeadings : headings;
1256
1486
  const { page } = useData();
1257
1487
  useEffect7(() => {
@@ -1306,19 +1536,19 @@ var TableOfContents = ({ headings, partners }) => {
1306
1536
  updateActiveHeadingFromScroll(setActiveHeadingId);
1307
1537
  });
1308
1538
  }, [headings]);
1309
- return /* @__PURE__ */ jsx14("aside", { className: cmMerge7(page.tableOfContents ? "w-64" : "w-32", "hidden shrink-0 xl:block"), children: /* @__PURE__ */ jsx14("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: [
1310
- page.tableOfContents ? effectiveHeadings.length > 0 && /* @__PURE__ */ jsxs13(Fragment6, { children: [
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: [
1311
1541
  /* @__PURE__ */ jsxs13("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
1312
- /* @__PURE__ */ jsx14(TableOfContentsIcon, { className: "h-3 w-3" }),
1542
+ /* @__PURE__ */ jsx16(TableOfContentsIcon, { className: "h-3 w-3" }),
1313
1543
  "On this page"
1314
1544
  ] }),
1315
- /* @__PURE__ */ jsx14("nav", { "aria-label": "On this page", className: "mb-12", children: /* @__PURE__ */ jsx14("ul", { children: effectiveHeadings.map((heading, index) => /* @__PURE__ */ jsx14("li", { children: /* @__PURE__ */ jsx14(
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(
1316
1546
  "a",
1317
1547
  {
1318
1548
  href: `#${heading.id}`,
1319
1549
  "aria-current": activeHeadingId === heading.id ? "location" : void 0,
1320
1550
  onClick: () => setActiveHeadingId(heading.id),
1321
- className: cmMerge7(
1551
+ className: cmMerge8(
1322
1552
  "cursor-pointer block border-l border-base-muted-light py-1.5 text-sm text-base-muted hover:border-primary-muted hover:text-base-content",
1323
1553
  heading.depth > 2 ? "pl-6" : "pl-4",
1324
1554
  activeHeadingId ? activeHeadingId === heading.id ? "border-l-2 border-primary font-semibold text-base-content" : "" : index === 0 ? "border-l-2 border-primary font-semibold text-base-content" : ""
@@ -1327,24 +1557,24 @@ var TableOfContents = ({ headings, partners }) => {
1327
1557
  }
1328
1558
  ) }, heading.id)) }) })
1329
1559
  ] }) : null,
1330
- /* @__PURE__ */ jsx14(Adbar, { partners })
1560
+ /* @__PURE__ */ jsx16(Adbar, { partners })
1331
1561
  ] }) }) });
1332
1562
  };
1333
1563
  var Adbar = ({ partners }) => {
1334
1564
  if (partners.primary.length === 0 && partners.gold.length === 0) {
1335
1565
  return null;
1336
1566
  }
1337
- return /* @__PURE__ */ jsxs13(Fragment6, { children: [
1567
+ return /* @__PURE__ */ jsxs13(Fragment7, { children: [
1338
1568
  /* @__PURE__ */ jsxs13("ul", { className: "grid grid-cols-[repeat(auto-fit,minmax(5.5rem,1fr))] gap-3 opacity-90", children: [
1339
- partners.primary.map((partner) => /* @__PURE__ */ jsx14(AdbarItem, { className: "col-span-full", children: /* @__PURE__ */ jsx14(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx14(PartnerLogo, { partner }) }) }, partner.name)),
1340
- partners.gold.map((partner) => /* @__PURE__ */ jsx14(AdbarItem, { children: /* @__PURE__ */ jsx14(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx14(PartnerLogo, { partner }) }) }, partner.name))
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))
1341
1571
  ] }),
1342
1572
  /* @__PURE__ */ jsxs13(AdbarItem, { className: "col-span-full p-2 text-left mt-3 block!", children: [
1343
- /* @__PURE__ */ jsx14("strong", { className: "text-sm tracking-tighter leading-tight mb-1 block", children: "Your company name here! \u{1F48E} " }),
1573
+ /* @__PURE__ */ jsx16("strong", { className: "text-sm tracking-tighter leading-tight mb-1 block", children: "Your company name here! \u{1F48E} " }),
1344
1574
  /* @__PURE__ */ jsxs13("p", { className: "text-xs text-base-muted", children: [
1345
1575
  "Hey, this is a classic text ad here!",
1346
1576
  " ",
1347
- /* @__PURE__ */ jsx14("a", { href: "#adlink", className: "text-info", children: "link" }),
1577
+ /* @__PURE__ */ jsx16("a", { href: "#adlink", className: "text-info", children: "link" }),
1348
1578
  " ",
1349
1579
  "to some thing"
1350
1580
  ] })
@@ -1354,18 +1584,18 @@ var Adbar = ({ partners }) => {
1354
1584
  var PartnerLogo = ({
1355
1585
  partner
1356
1586
  }) => {
1357
- return /* @__PURE__ */ jsxs13(Fragment6, { children: [
1358
- /* @__PURE__ */ jsx14(
1587
+ return /* @__PURE__ */ jsxs13(Fragment7, { children: [
1588
+ /* @__PURE__ */ jsx16(
1359
1589
  Image,
1360
1590
  {
1361
1591
  src: partner.logoLight,
1362
1592
  width: 200,
1363
1593
  height: 100,
1364
1594
  alt: partner.logoAlt,
1365
- className: cmMerge7("block", partner.logoDark ? "dark:hidden" : "dark:invert")
1595
+ className: cmMerge8("block", partner.logoDark ? "dark:hidden" : "dark:invert")
1366
1596
  }
1367
1597
  ),
1368
- partner.logoDark ? /* @__PURE__ */ jsx14(Image, { src: partner.logoDark, width: 200, height: 100, alt: partner.logoAlt, className: "hidden dark:block" }) : null
1598
+ partner.logoDark ? /* @__PURE__ */ jsx16(Image, { src: partner.logoDark, width: 200, height: 100, alt: partner.logoAlt, className: "hidden dark:block" }) : null
1369
1599
  ] });
1370
1600
  };
1371
1601
  var AdbarItem = cm4.div`
@@ -1484,9 +1714,9 @@ var getMdxRuntimeValue = (options) => {
1484
1714
  };
1485
1715
 
1486
1716
  // src/runtime/client/DocsPage.tsx
1487
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1717
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
1488
1718
  var DocsPage = ({ Content }) => {
1489
- const pageContext = usePageContext4();
1719
+ const pageContext = usePageContext6();
1490
1720
  const docs = getDocsGlobalContext(pageContext);
1491
1721
  const { page, headings, previousPage, nextPage } = useData2();
1492
1722
  return /* @__PURE__ */ jsxs14(
@@ -1497,18 +1727,19 @@ var DocsPage = ({ Content }) => {
1497
1727
  currentPathname: pageContext.urlPathname
1498
1728
  }),
1499
1729
  children: [
1500
- /* @__PURE__ */ jsx15("div", { className: "absolute top-0 left-0 w-full h-[60svh] bg-radial-[at_65%_-85%] from-primary-muted-light to-65%" }),
1501
- /* @__PURE__ */ jsx15(LayoutComponent, { children: /* @__PURE__ */ jsxs14("div", { className: "lg:flex lg:gap-10 xl:gap-14", children: [
1502
- /* @__PURE__ */ jsx15(Sidebar, { sections: docs.sidebarSections, activeSectionId: page.sectionId, currentHref: page.href }),
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 }),
1503
1734
  /* @__PURE__ */ jsxs14("main", { className: "mt-10 min-w-0 flex-1 basis-auto shrink", children: [
1504
1735
  /* @__PURE__ */ jsxs14(ProseContainer, { "data-doc-content": "", children: [
1505
- /* @__PURE__ */ jsx15("h1", { className: "scroll-mt-24", children: renderInlineMarkdown(page.title) }),
1506
- /* @__PURE__ */ jsx15(Content, {})
1736
+ /* @__PURE__ */ jsx17("h1", { className: "scroll-mt-24", children: renderInlineMarkdown(page.title) }),
1737
+ /* @__PURE__ */ jsx17(Content, {})
1507
1738
  ] }),
1508
- docs.footer.pagination ? /* @__PURE__ */ jsx15(DocsPagination, { previousPage, nextPage }) : null,
1509
- /* @__PURE__ */ jsx15(DocsFooter, { brand: docs.brand })
1739
+ docs.footer.pagination ? /* @__PURE__ */ jsx17(DocsPagination, { previousPage, nextPage }) : null,
1740
+ /* @__PURE__ */ jsx17(DocsFooter, { brand: docs.brand })
1510
1741
  ] }),
1511
- /* @__PURE__ */ jsx15(TableOfContents, { headings, partners: docs.partners })
1742
+ /* @__PURE__ */ jsx17(TableOfContents, { headings, partners: docs.partners })
1512
1743
  ] }) })
1513
1744
  ]
1514
1745
  }
@@ -1516,6 +1747,10 @@ var DocsPage = ({ Content }) => {
1516
1747
  };
1517
1748
 
1518
1749
  export {
1750
+ useDocsSearchStore,
1751
+ useDocsSearchActions,
1752
+ useDocsSidebarStore,
1753
+ useDocsSidebarActions,
1519
1754
  LayoutComponent,
1520
1755
  useDocsUserSettingsStore,
1521
1756
  DEFAULT_THEME_PREFERENCE,
@@ -1526,4 +1761,4 @@ export {
1526
1761
  ProseContainer,
1527
1762
  DocsPage
1528
1763
  };
1529
- //# sourceMappingURL=chunk-DSQGGUBC.js.map
1764
+ //# sourceMappingURL=chunk-5NW6G3SG.js.map