@unterberg/nivel 0.1.11 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -13
- package/dist/SearchModal-YJZFUB53.js +335 -0
- package/dist/SearchModal-YJZFUB53.js.map +1 -0
- package/dist/chunk-ESAHWFDZ.js +196 -0
- package/dist/chunk-ESAHWFDZ.js.map +1 -0
- package/dist/{chunk-GT62XN7K.js → chunk-NGX2C26M.js} +12 -22
- package/dist/chunk-NGX2C26M.js.map +1 -0
- package/dist/{chunk-HQHLPFGA.js → chunk-PKXDOKJY.js} +5 -3
- package/dist/{chunk-HQHLPFGA.js.map → chunk-PKXDOKJY.js.map} +1 -1
- package/dist/chunk-PYYPYIBD.js +49 -0
- package/dist/chunk-PYYPYIBD.js.map +1 -0
- package/dist/{chunk-NDJ5LYLK.js → chunk-QWIYQPCW.js} +6 -45
- package/dist/chunk-QWIYQPCW.js.map +1 -0
- package/dist/{chunk-6Q5XESPG.js → chunk-R6O4NLHC.js} +3 -3
- package/dist/{chunk-6TXPHBIC.js → chunk-SH5XWPXW.js} +353 -757
- package/dist/chunk-SH5XWPXW.js.map +1 -0
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +8 -5
- package/dist/config.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/mdx/code-blocks.d.ts +1 -1
- package/dist/mdx.js +3 -2
- package/dist/mdx.js.map +1 -1
- package/dist/runtime/client.d.ts +1 -1
- package/dist/runtime/client.js +8 -5
- package/dist/runtime/node.d.ts +1 -1
- package/dist/runtime/node.js +4 -3
- package/dist/{types-BGAec0JI.d.ts → types-IiJ1jLWc.d.ts} +1 -0
- package/dist/vike.d.ts +1 -1
- package/dist/vike.js +249 -4
- package/dist/vike.js.map +1 -1
- package/package.json +6 -7
- package/dist/chunk-6TXPHBIC.js.map +0 -1
- package/dist/chunk-GT62XN7K.js.map +0 -1
- package/dist/chunk-NDJ5LYLK.js.map +0 -1
- /package/dist/{chunk-6Q5XESPG.js.map → chunk-R6O4NLHC.js.map} +0 -0
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DocsGlobalContextProvider,
|
|
3
|
+
DocsRuntimeStoreProvider,
|
|
4
|
+
LayoutComponent,
|
|
5
|
+
createDocsRuntimeStore,
|
|
6
|
+
getDocsFromGlobalContext,
|
|
7
|
+
useDocsFromPageGlobalContext,
|
|
8
|
+
useDocsGlobalContext,
|
|
9
|
+
useDocsSearchActions,
|
|
10
|
+
useDocsSearchStore,
|
|
11
|
+
useDocsSidebarActions,
|
|
12
|
+
useDocsSidebarStore
|
|
13
|
+
} from "./chunk-ESAHWFDZ.js";
|
|
1
14
|
import {
|
|
2
15
|
createHeadingSlugger,
|
|
3
16
|
normalizeHeadingTitle
|
|
@@ -11,558 +24,100 @@ import {
|
|
|
11
24
|
getResolvedPageByPathname,
|
|
12
25
|
getResolvedSectionById,
|
|
13
26
|
isSamePagePathname,
|
|
27
|
+
resolveDocsHref
|
|
28
|
+
} from "./chunk-QWIYQPCW.js";
|
|
29
|
+
import {
|
|
14
30
|
nivelAssetUrl,
|
|
15
|
-
resolveDocsHref,
|
|
16
31
|
withSiteBaseUrl
|
|
17
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-PYYPYIBD.js";
|
|
18
33
|
|
|
19
34
|
// src/runtime/client/AppLayout.tsx
|
|
20
|
-
import { cmMerge as
|
|
21
|
-
import {
|
|
22
|
-
import { usePageContext as usePageContext4 } from "vike-react/usePageContext";
|
|
35
|
+
import { cmMerge as cmMerge5 } from "@classmatejs/react";
|
|
36
|
+
import { usePageContext as usePageContext2 } from "vike-react/usePageContext";
|
|
23
37
|
|
|
24
38
|
// src/runtime/client/components/Navbar/index.tsx
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
// src/runtime/client/docsGlobalContext.ts
|
|
29
|
-
import { createContext, createElement, useContext } from "react";
|
|
39
|
+
import cm3 from "@classmatejs/react";
|
|
40
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
30
41
|
import { usePageContext } from "vike-react/usePageContext";
|
|
31
|
-
var DocsGlobalContext = createContext(null);
|
|
32
|
-
var getDocsFromGlobalContext = (pageContext) => {
|
|
33
|
-
const docs = pageContext.globalContext?.docs;
|
|
34
|
-
if (!docs) {
|
|
35
|
-
throw new Error("Missing docs global context data.");
|
|
36
|
-
}
|
|
37
|
-
return docs;
|
|
38
|
-
};
|
|
39
|
-
var DocsGlobalContextProvider = ({ children, docs }) => {
|
|
40
|
-
return createElement(DocsGlobalContext.Provider, { value: docs }, children);
|
|
41
|
-
};
|
|
42
|
-
var useDocsGlobalContext = () => {
|
|
43
|
-
const docs = useContext(DocsGlobalContext);
|
|
44
|
-
if (!docs) {
|
|
45
|
-
throw new Error("Missing docs global context provider.");
|
|
46
|
-
}
|
|
47
|
-
return docs;
|
|
48
|
-
};
|
|
49
|
-
var useDocsFromPageGlobalContext = () => {
|
|
50
|
-
return getDocsFromGlobalContext(usePageContext());
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/runtime/client/store/runtime-store.tsx
|
|
54
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
55
|
-
import { useStore } from "zustand";
|
|
56
|
-
import { createStore } from "zustand/vanilla";
|
|
57
|
-
import { jsx } from "react/jsx-runtime";
|
|
58
|
-
var defaultDocsSearchState = {
|
|
59
|
-
isOpen: false,
|
|
60
|
-
query: ""
|
|
61
|
-
};
|
|
62
|
-
var defaultDocsSidebarState = {
|
|
63
|
-
openNodes: {}
|
|
64
|
-
};
|
|
65
|
-
var createDocsRuntimeStore = () => {
|
|
66
|
-
return createStore()((set) => {
|
|
67
|
-
const searchActions = {
|
|
68
|
-
open: () => set((state) => {
|
|
69
|
-
if (state.searchState.isOpen) {
|
|
70
|
-
return state;
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
searchState: {
|
|
74
|
-
...state.searchState,
|
|
75
|
-
isOpen: true
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}),
|
|
79
|
-
close: () => set((state) => {
|
|
80
|
-
if (!state.searchState.isOpen) {
|
|
81
|
-
return state;
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
searchState: {
|
|
85
|
-
...state.searchState,
|
|
86
|
-
isOpen: false
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}),
|
|
90
|
-
toggle: () => set((state) => ({
|
|
91
|
-
searchState: {
|
|
92
|
-
...state.searchState,
|
|
93
|
-
isOpen: !state.searchState.isOpen
|
|
94
|
-
}
|
|
95
|
-
})),
|
|
96
|
-
setQuery: (query) => set((state) => {
|
|
97
|
-
if (state.searchState.query === query) {
|
|
98
|
-
return state;
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
searchState: {
|
|
102
|
-
...state.searchState,
|
|
103
|
-
query
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}),
|
|
107
|
-
clearQuery: () => set((state) => {
|
|
108
|
-
if (state.searchState.query === "") {
|
|
109
|
-
return state;
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
searchState: {
|
|
113
|
-
...state.searchState,
|
|
114
|
-
query: ""
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
})
|
|
118
|
-
};
|
|
119
|
-
const sidebarActions = {
|
|
120
|
-
setNodeOpen: (nodeId, isOpen) => set((state) => {
|
|
121
|
-
if (state.sidebarState.openNodes[nodeId] === isOpen) {
|
|
122
|
-
return state;
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
sidebarState: {
|
|
126
|
-
...state.sidebarState,
|
|
127
|
-
openNodes: {
|
|
128
|
-
...state.sidebarState.openNodes,
|
|
129
|
-
[nodeId]: isOpen
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
})
|
|
134
|
-
};
|
|
135
|
-
return {
|
|
136
|
-
searchActions,
|
|
137
|
-
searchState: defaultDocsSearchState,
|
|
138
|
-
sidebarActions,
|
|
139
|
-
sidebarState: defaultDocsSidebarState
|
|
140
|
-
};
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
var DocsRuntimeStoreContext = createContext2(null);
|
|
144
|
-
var DocsRuntimeStoreProvider = ({ children, store }) => {
|
|
145
|
-
return /* @__PURE__ */ jsx(DocsRuntimeStoreContext.Provider, { value: store, children });
|
|
146
|
-
};
|
|
147
|
-
var useDocsRuntimeStoreApi = () => {
|
|
148
|
-
const store = useContext2(DocsRuntimeStoreContext);
|
|
149
|
-
if (store === null) {
|
|
150
|
-
throw new Error("Missing docs runtime store provider.");
|
|
151
|
-
}
|
|
152
|
-
return store;
|
|
153
|
-
};
|
|
154
|
-
var useDocsRuntimeStore = (selector) => {
|
|
155
|
-
return useStore(useDocsRuntimeStoreApi(), selector);
|
|
156
|
-
};
|
|
157
|
-
var useDocsSearchStore = (selector) => {
|
|
158
|
-
return useDocsRuntimeStore(
|
|
159
|
-
(state) => selector({
|
|
160
|
-
...state.searchState,
|
|
161
|
-
...state.searchActions
|
|
162
|
-
})
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
var useDocsSearchActions = () => {
|
|
166
|
-
return useDocsRuntimeStore((state) => state.searchActions);
|
|
167
|
-
};
|
|
168
|
-
var useDocsSidebarStore = (selector) => {
|
|
169
|
-
return useDocsRuntimeStore(
|
|
170
|
-
(state) => selector({
|
|
171
|
-
...state.sidebarState,
|
|
172
|
-
...state.sidebarActions
|
|
173
|
-
})
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
var useDocsSidebarActions = () => {
|
|
177
|
-
return useDocsRuntimeStore((state) => state.sidebarActions);
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
// src/runtime/client/components/LayoutComponent.tsx
|
|
181
|
-
import cm from "@classmatejs/react";
|
|
182
|
-
var LayoutSize = {
|
|
183
|
-
xxs: "xxs",
|
|
184
|
-
xs: "xs",
|
|
185
|
-
sm: "sm",
|
|
186
|
-
md: "md",
|
|
187
|
-
lg: "lg",
|
|
188
|
-
xl: "xl",
|
|
189
|
-
full: "full"
|
|
190
|
-
};
|
|
191
|
-
var layoutComponentSizeMapping = {
|
|
192
|
-
xxs: "max-w-[480px]",
|
|
193
|
-
xs: "max-w-[768px]",
|
|
194
|
-
sm: "max-w-5xl",
|
|
195
|
-
md: "max-w-6xl",
|
|
196
|
-
lg: "max-w-7xl",
|
|
197
|
-
xl: "max-w-[1440px]",
|
|
198
|
-
full: "max-w-full"
|
|
199
|
-
};
|
|
200
|
-
var LayoutComponent = cm.div.variants({
|
|
201
|
-
base: ({ $noGrow }) => `px-4 ${$noGrow ? "" : "mx-auto w-full"} relative`,
|
|
202
|
-
variants: {
|
|
203
|
-
$size: layoutComponentSizeMapping
|
|
204
|
-
},
|
|
205
|
-
defaultVariants: {
|
|
206
|
-
$size: LayoutSize.xl
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
42
|
|
|
210
43
|
// src/runtime/client/components/Search.tsx
|
|
211
|
-
import {
|
|
212
|
-
import {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
// src/runtime/client/search.ts
|
|
219
|
-
var hierarchyLevels = ["lvl0", "lvl1", "lvl2", "lvl3", "lvl4", "lvl5", "lvl6"];
|
|
220
|
-
var stripHtml = (value) => value.replace(/<[^>]+>/g, "");
|
|
221
|
-
var normalizeString = (value) => {
|
|
222
|
-
if (typeof value === "string") {
|
|
223
|
-
const normalized = stripHtml(value).replace(/\s+/g, " ").trim();
|
|
224
|
-
return normalized || void 0;
|
|
225
|
-
}
|
|
226
|
-
if (typeof value === "number" || typeof value === "boolean") {
|
|
227
|
-
return String(value);
|
|
228
|
-
}
|
|
229
|
-
return void 0;
|
|
230
|
-
};
|
|
231
|
-
var getValueAtPath = (value, path) => {
|
|
232
|
-
if (!path) {
|
|
233
|
-
return void 0;
|
|
234
|
-
}
|
|
235
|
-
const segments = path.split(".").filter(Boolean);
|
|
236
|
-
let currentValue = value;
|
|
237
|
-
for (const segment of segments) {
|
|
238
|
-
if (!currentValue || typeof currentValue !== "object" || Array.isArray(currentValue)) {
|
|
239
|
-
return void 0;
|
|
240
|
-
}
|
|
241
|
-
currentValue = currentValue[segment];
|
|
242
|
-
}
|
|
243
|
-
return currentValue;
|
|
244
|
-
};
|
|
245
|
-
var getMappedString = (value, path) => {
|
|
246
|
-
return normalizeString(getValueAtPath(value, path));
|
|
247
|
-
};
|
|
248
|
-
var buildSearchUrl = (appId, indexName) => {
|
|
249
|
-
return `https://${appId}-dsn.algolia.net/1/indexes/${encodeURIComponent(indexName)}/query`;
|
|
250
|
-
};
|
|
251
|
-
var getDocSearchHierarchyValue = (hierarchy, level) => {
|
|
252
|
-
if (!hierarchy || typeof hierarchy !== "object") {
|
|
253
|
-
return void 0;
|
|
254
|
-
}
|
|
255
|
-
return normalizeString(hierarchy[level]);
|
|
256
|
-
};
|
|
257
|
-
var getDocSearchTitleLevel = (hit) => {
|
|
258
|
-
const levelFromType = typeof hit.type === "string" && /^lvl[0-6]$/.test(hit.type) ? hit.type : null;
|
|
259
|
-
if (levelFromType && getDocSearchHierarchyValue(hit.hierarchy, levelFromType)) {
|
|
260
|
-
return levelFromType;
|
|
261
|
-
}
|
|
262
|
-
return [...hierarchyLevels].reverse().find((level) => level !== "lvl0" && getDocSearchHierarchyValue(hit.hierarchy, level));
|
|
263
|
-
};
|
|
264
|
-
var getDocSearchFallbackResult = (hit) => {
|
|
265
|
-
const docSearchHit = hit;
|
|
266
|
-
const titleLevel = getDocSearchTitleLevel(docSearchHit);
|
|
267
|
-
const title = titleLevel ? getDocSearchHierarchyValue(docSearchHit.hierarchy, titleLevel) : void 0;
|
|
268
|
-
const titleLevelIndex = titleLevel ? hierarchyLevels.indexOf(titleLevel) : -1;
|
|
269
|
-
const sectionTitle = hierarchyLevels.slice(0, Math.max(titleLevelIndex, 0)).reverse().map((level) => getDocSearchHierarchyValue(docSearchHit.hierarchy, level)).find(Boolean) ?? normalizeString(docSearchHit.category);
|
|
270
|
-
return {
|
|
271
|
-
href: normalizeString(docSearchHit.url) ?? normalizeString(docSearchHit.url_without_anchor),
|
|
272
|
-
title: title ?? normalizeString(docSearchHit.category),
|
|
273
|
-
excerpt: normalizeString(docSearchHit._snippetResult?.content?.value) ?? normalizeString(docSearchHit.content) ?? normalizeString(docSearchHit._highlightResult?.content?.value),
|
|
274
|
-
sectionTitle
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
var mapHitToSearchResult = (hit, config) => {
|
|
278
|
-
const docSearchFallback = getDocSearchFallbackResult(hit);
|
|
279
|
-
const href = getMappedString(hit, config.fields.href) ?? docSearchFallback.href;
|
|
280
|
-
const title = getMappedString(hit, config.fields.title) ?? docSearchFallback.title;
|
|
281
|
-
if (!href || !title) {
|
|
282
|
-
return null;
|
|
283
|
-
}
|
|
284
|
-
const excerpt = getMappedString(hit, config.fields.excerpt) ?? docSearchFallback.excerpt;
|
|
285
|
-
const sectionTitle = getMappedString(hit, config.fields.sectionTitle) ?? docSearchFallback.sectionTitle;
|
|
286
|
-
return {
|
|
287
|
-
href,
|
|
288
|
-
title,
|
|
289
|
-
excerpt,
|
|
290
|
-
sectionTitle
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
var searchAlgoliaIndex = async (options) => {
|
|
294
|
-
const { config, query, signal } = options;
|
|
295
|
-
if (!config) {
|
|
296
|
-
throw new Error("Algolia search is not configured.");
|
|
297
|
-
}
|
|
298
|
-
const response = await fetch(buildSearchUrl(config.appId, config.indexName), {
|
|
299
|
-
method: "POST",
|
|
300
|
-
signal,
|
|
301
|
-
headers: {
|
|
302
|
-
accept: "application/json",
|
|
303
|
-
"content-type": "application/json",
|
|
304
|
-
"x-algolia-api-key": config.apiKey,
|
|
305
|
-
"x-algolia-application-id": config.appId
|
|
306
|
-
},
|
|
307
|
-
body: JSON.stringify({
|
|
308
|
-
query,
|
|
309
|
-
...config.searchParams
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
if (!response.ok) {
|
|
313
|
-
throw new Error(`Algolia search request failed with status ${response.status}.`);
|
|
314
|
-
}
|
|
315
|
-
const data = await response.json();
|
|
316
|
-
return (data.hits ?? []).map((hit) => mapHitToSearchResult(hit, config)).filter((result) => result !== null);
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
// src/runtime/client/components/Search.tsx
|
|
320
|
-
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
321
|
-
var MIN_QUERY_LENGTH = 2;
|
|
322
|
-
var QUERY_DEBOUNCE_MS = 150;
|
|
323
|
-
var useDebouncedValue = (value, delayMs) => {
|
|
324
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
325
|
-
useEffect(() => {
|
|
326
|
-
const timeoutId = window.setTimeout(() => {
|
|
327
|
-
setDebouncedValue(value);
|
|
328
|
-
}, delayMs);
|
|
329
|
-
return () => {
|
|
330
|
-
window.clearTimeout(timeoutId);
|
|
331
|
-
};
|
|
332
|
-
}, [delayMs, value]);
|
|
333
|
-
return debouncedValue;
|
|
44
|
+
import { useEffect, useState } from "react";
|
|
45
|
+
import { jsx } from "react/jsx-runtime";
|
|
46
|
+
var searchModalModulePromise = null;
|
|
47
|
+
var loadSearchModalModule = () => {
|
|
48
|
+
searchModalModulePromise ??= import("./SearchModal-YJZFUB53.js");
|
|
49
|
+
return searchModalModulePromise;
|
|
334
50
|
};
|
|
335
|
-
var
|
|
51
|
+
var Search = () => {
|
|
336
52
|
const docs = useDocsGlobalContext();
|
|
337
|
-
const { open, setQuery } = useDocsSearchActions();
|
|
338
|
-
const query = useDocsSearchStore((state) => state.query);
|
|
339
|
-
const [isSearchHovered, setIsSearchHovered] = useState(false);
|
|
340
|
-
if (!docs.algolia) {
|
|
341
|
-
return null;
|
|
342
|
-
}
|
|
343
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
344
|
-
/* @__PURE__ */ jsx2("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxs(
|
|
345
|
-
"label",
|
|
346
|
-
{
|
|
347
|
-
className: cmMerge(
|
|
348
|
-
"input input-sm w-56 transition-all",
|
|
349
|
-
isSearchHovered ? "border-primary-muted shadow-lg shadow-primary-muted-light" : "shadow-transparent"
|
|
350
|
-
),
|
|
351
|
-
onMouseEnter: () => setIsSearchHovered(true),
|
|
352
|
-
onMouseLeave: () => setIsSearchHovered(false),
|
|
353
|
-
children: [
|
|
354
|
-
/* @__PURE__ */ jsx2("span", { className: "label", children: /* @__PURE__ */ jsx2(SearchIcon, { className: "h-4 w-4 shrink-0" }) }),
|
|
355
|
-
/* @__PURE__ */ jsx2(
|
|
356
|
-
"input",
|
|
357
|
-
{
|
|
358
|
-
type: "text",
|
|
359
|
-
value: query,
|
|
360
|
-
placeholder: "Search docs",
|
|
361
|
-
className: cmMerge(
|
|
362
|
-
"w-full placeholder:text-base-muted-medium transition-colors",
|
|
363
|
-
isSearchHovered && "placeholder:text-base-muted"
|
|
364
|
-
),
|
|
365
|
-
onFocus: open,
|
|
366
|
-
onChange: (event) => {
|
|
367
|
-
setQuery(event.target.value);
|
|
368
|
-
open();
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
)
|
|
372
|
-
]
|
|
373
|
-
}
|
|
374
|
-
) }),
|
|
375
|
-
/* @__PURE__ */ jsx2("button", { type: "button", className: "btn btn-ghost btn-square md:hidden", "aria-label": "Search docs", onClick: open, children: /* @__PURE__ */ jsx2(SearchIcon, { className: "h-4 w-4" }) })
|
|
376
|
-
] });
|
|
377
|
-
});
|
|
378
|
-
var Search = memo(() => {
|
|
379
|
-
const docs = useDocsGlobalContext();
|
|
380
|
-
const { urlPathname } = usePageContext2();
|
|
381
|
-
const { close, setQuery } = useDocsSearchActions();
|
|
382
53
|
const isOpen = useDocsSearchStore((state) => state.isOpen);
|
|
383
|
-
const
|
|
384
|
-
const containerRef = useRef(null);
|
|
385
|
-
const suggestionBoxRef = useRef(null);
|
|
386
|
-
const previousPathnameRef = useRef(urlPathname);
|
|
387
|
-
const debouncedQuery = useDebouncedValue(query, QUERY_DEBOUNCE_MS);
|
|
388
|
-
const normalizedQuery = debouncedQuery.trim();
|
|
389
|
-
const canSearch = Boolean(docs.algolia) && normalizedQuery.length >= MIN_QUERY_LENGTH;
|
|
390
|
-
const searchQuery = useQuery({
|
|
391
|
-
queryKey: ["nivel-algolia-search", docs.algolia?.appId, docs.algolia?.indexName, normalizedQuery],
|
|
392
|
-
queryFn: ({ signal }) => searchAlgoliaIndex({ config: docs.algolia, query: normalizedQuery, signal }),
|
|
393
|
-
enabled: isOpen && canSearch,
|
|
394
|
-
retry: false
|
|
395
|
-
});
|
|
396
|
-
useEffect(() => {
|
|
397
|
-
if (previousPathnameRef.current !== urlPathname) {
|
|
398
|
-
close();
|
|
399
|
-
previousPathnameRef.current = urlPathname;
|
|
400
|
-
}
|
|
401
|
-
}, [close, urlPathname]);
|
|
54
|
+
const [searchModalModule, setSearchModalModule] = useState(null);
|
|
402
55
|
useEffect(() => {
|
|
403
|
-
if (!isOpen) {
|
|
56
|
+
if (!docs.algolia || !isOpen || searchModalModule !== null) {
|
|
404
57
|
return;
|
|
405
58
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
const handleKeyDown = (event) => {
|
|
413
|
-
if (event.key === "Escape") {
|
|
414
|
-
close();
|
|
59
|
+
let isMounted = true;
|
|
60
|
+
loadSearchModalModule().then((module) => {
|
|
61
|
+
if (isMounted) {
|
|
62
|
+
setSearchModalModule(module);
|
|
415
63
|
}
|
|
416
|
-
};
|
|
417
|
-
document.addEventListener("pointerdown", handlePointerDown);
|
|
418
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
419
|
-
return () => {
|
|
420
|
-
document.removeEventListener("pointerdown", handlePointerDown);
|
|
421
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
422
|
-
};
|
|
423
|
-
}, [close, isOpen]);
|
|
424
|
-
if (!docs.algolia) {
|
|
425
|
-
return null;
|
|
426
|
-
}
|
|
427
|
-
return /* @__PURE__ */ jsx2("div", { ref: containerRef, className: "relative", children: /* @__PURE__ */ jsx2(
|
|
428
|
-
SearchSuggestionBox,
|
|
429
|
-
{
|
|
430
|
-
contentRef: suggestionBoxRef,
|
|
431
|
-
isError: searchQuery.isError,
|
|
432
|
-
isLoading: searchQuery.isFetching,
|
|
433
|
-
isOpen,
|
|
434
|
-
onClose: close,
|
|
435
|
-
onQueryChange: setQuery,
|
|
436
|
-
query,
|
|
437
|
-
results: searchQuery.data ?? []
|
|
438
|
-
}
|
|
439
|
-
) });
|
|
440
|
-
});
|
|
441
|
-
var SearchSuggestionBox = ({
|
|
442
|
-
contentRef,
|
|
443
|
-
isError,
|
|
444
|
-
isLoading,
|
|
445
|
-
isOpen,
|
|
446
|
-
onClose,
|
|
447
|
-
onQueryChange,
|
|
448
|
-
query,
|
|
449
|
-
results
|
|
450
|
-
}) => {
|
|
451
|
-
const inputRef = useRef(null);
|
|
452
|
-
const normalizedQuery = query.trim();
|
|
453
|
-
const canSearch = normalizedQuery.length >= MIN_QUERY_LENGTH;
|
|
454
|
-
useEffect(() => {
|
|
455
|
-
if (!isOpen) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
const frameId = window.requestAnimationFrame(() => {
|
|
459
|
-
inputRef.current?.focus();
|
|
460
|
-
inputRef.current?.setSelectionRange(query.length, query.length);
|
|
461
64
|
});
|
|
462
65
|
return () => {
|
|
463
|
-
|
|
66
|
+
isMounted = false;
|
|
464
67
|
};
|
|
465
|
-
}, [isOpen,
|
|
466
|
-
if (!
|
|
68
|
+
}, [docs.algolia, isOpen, searchModalModule]);
|
|
69
|
+
if (!docs.algolia || searchModalModule === null) {
|
|
467
70
|
return null;
|
|
468
71
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
/* @__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" }),
|
|
472
|
-
/* @__PURE__ */ jsxs(
|
|
473
|
-
LayoutComponent,
|
|
474
|
-
{
|
|
475
|
-
ref: contentRef,
|
|
476
|
-
$size: "sm",
|
|
477
|
-
className: "mt-5 relative z-2 rounded-box bg-base-100/70 p-6 pt-6 shadow-lg shadow-primary-muted-light",
|
|
478
|
-
children: [
|
|
479
|
-
/* @__PURE__ */ jsx2(
|
|
480
|
-
"input",
|
|
481
|
-
{
|
|
482
|
-
placeholder: "Search docs",
|
|
483
|
-
ref: inputRef,
|
|
484
|
-
type: "text",
|
|
485
|
-
className: "input input-primary input-xl w-full",
|
|
486
|
-
value: query,
|
|
487
|
-
onChange: (event) => onQueryChange(event.target.value)
|
|
488
|
-
}
|
|
489
|
-
),
|
|
490
|
-
/* @__PURE__ */ jsx2("div", { className: "flex h-7 items-center px-4 text-xs text-base-muted", children: isLoading ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
491
|
-
/* @__PURE__ */ jsx2("span", { className: "loading loading-dots loading-xs" }),
|
|
492
|
-
"Searching..."
|
|
493
|
-
] }) : normalizedQuery ? null : /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
494
|
-
/* @__PURE__ */ jsx2(MessageCircleQuestion, { className: "h-3 w-3 shrink-0" }),
|
|
495
|
-
"Type at least ",
|
|
496
|
-
MIN_QUERY_LENGTH,
|
|
497
|
-
" characters."
|
|
498
|
-
] }) }),
|
|
499
|
-
normalizedQuery ? isError ? /* @__PURE__ */ jsxs("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: [
|
|
500
|
-
/* @__PURE__ */ jsx2(TriangleAlert, { className: "h-4 w-4 shrink-0 text-warning" }),
|
|
501
|
-
"Search is temporarily unavailable."
|
|
502
|
-
] }) : !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: "-mx-2 max-h-80 overflow-y-auto p-2", children: /* @__PURE__ */ jsx2("ul", { className: "flex flex-col gap-2", children: results.map((result) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs(
|
|
503
|
-
"a",
|
|
504
|
-
{
|
|
505
|
-
href: withSiteBaseUrl(result.href),
|
|
506
|
-
className: "block rounded-box border border-base-muted-medium bg-base-100 p-4 shadow-md hover:border-primary-muted hover:bg-base-200",
|
|
507
|
-
onClick: onClose,
|
|
508
|
-
children: [
|
|
509
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-start gap-2", children: [
|
|
510
|
-
/* @__PURE__ */ jsx2("div", { className: "font-bold text-base-content", children: result.title }),
|
|
511
|
-
result.sectionTitle ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-base-muted-medium", children: [
|
|
512
|
-
/* @__PURE__ */ jsx2(ArrowRightFromLine, { className: "h-3 w-3" }),
|
|
513
|
-
" ",
|
|
514
|
-
result.sectionTitle
|
|
515
|
-
] }) : null
|
|
516
|
-
] }),
|
|
517
|
-
result.excerpt ? /* @__PURE__ */ jsx2("p", { className: "text-xs leading-5 text-base-muted", children: result.excerpt }) : null
|
|
518
|
-
]
|
|
519
|
-
}
|
|
520
|
-
) }, result.href)) }) }) : null
|
|
521
|
-
]
|
|
522
|
-
}
|
|
523
|
-
)
|
|
524
|
-
] }),
|
|
525
|
-
document.body
|
|
526
|
-
);
|
|
72
|
+
const { SearchModal } = searchModalModule;
|
|
73
|
+
return /* @__PURE__ */ jsx(SearchModal, {});
|
|
527
74
|
};
|
|
528
75
|
|
|
529
76
|
// src/runtime/client/components/Navbar/DocsNavbar.tsx
|
|
530
|
-
import
|
|
77
|
+
import cm, { cmMerge as cmMerge2 } from "@classmatejs/react";
|
|
531
78
|
import { ChevronDown, Menu, TextSearch } from "lucide-react";
|
|
532
79
|
import { useCallback } from "react";
|
|
533
80
|
|
|
534
81
|
// src/runtime/client/components/Brand.tsx
|
|
535
|
-
import { cmMerge
|
|
536
|
-
import { jsx as
|
|
82
|
+
import { cmMerge } from "@classmatejs/react";
|
|
83
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
537
84
|
var Brand = ({ brand, noText = false }) => {
|
|
538
85
|
const defaultLogo = brand.logoLight ?? brand.logoDark;
|
|
539
|
-
return /* @__PURE__ */
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
86
|
+
return /* @__PURE__ */ jsxs(
|
|
87
|
+
"a",
|
|
88
|
+
{
|
|
89
|
+
href: brand.href,
|
|
90
|
+
className: "flex items-center gap-3 text-base-content no-underline",
|
|
91
|
+
"aria-label": noText ? `${brand.text} homepage` : void 0,
|
|
92
|
+
children: [
|
|
93
|
+
defaultLogo && /* @__PURE__ */ jsxs("span", { className: "relative block h-8 w-8 shrink-0", children: [
|
|
94
|
+
brand.logoLight && /* @__PURE__ */ jsx2(
|
|
95
|
+
"img",
|
|
96
|
+
{
|
|
97
|
+
src: brand.logoLight,
|
|
98
|
+
alt: brand.logoAlt,
|
|
99
|
+
className: cmMerge("h-8 w-8 object-contain", brand.logoDark ? "block dark:hidden" : "block")
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
brand.logoDark && /* @__PURE__ */ jsx2(
|
|
103
|
+
"img",
|
|
104
|
+
{
|
|
105
|
+
src: brand.logoDark,
|
|
106
|
+
alt: brand.logoAlt,
|
|
107
|
+
className: cmMerge("h-8 w-8 object-contain", brand.logoLight ? "hidden dark:block" : "block")
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] }),
|
|
111
|
+
!noText && /* @__PURE__ */ jsx2("span", { className: "text-xl font-semibold tracking-tight", children: brand.text })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
560
115
|
};
|
|
561
116
|
|
|
562
117
|
// src/runtime/client/components/SocialLinks.tsx
|
|
563
|
-
import { memo
|
|
564
|
-
import { jsx as
|
|
565
|
-
var
|
|
118
|
+
import { memo } from "react";
|
|
119
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
120
|
+
var iconAssets = {
|
|
566
121
|
github: nivelAssetUrl("brands/github.svg"),
|
|
567
122
|
discord: nivelAssetUrl(`brands/discord.svg`),
|
|
568
123
|
x: nivelAssetUrl(`brands/x.svg`),
|
|
@@ -570,26 +125,29 @@ var _iconAssets = {
|
|
|
570
125
|
linkedin: nivelAssetUrl("brands/linkedin.svg")
|
|
571
126
|
};
|
|
572
127
|
var SocialIconElement = ({ icon, href }) => {
|
|
573
|
-
|
|
128
|
+
const socialLabel = icon === "x" ? "X" : icon.charAt(0).toUpperCase() + icon.slice(1);
|
|
129
|
+
return /* @__PURE__ */ jsx3("li", { className: "m-0 p-0", children: /* @__PURE__ */ jsx3(
|
|
574
130
|
"a",
|
|
575
131
|
{
|
|
576
132
|
href,
|
|
577
133
|
target: "_blank",
|
|
578
134
|
rel: "noopener noreferrer",
|
|
579
135
|
className: "flex h-8 w-8 items-center justify-center rounded-full border border-base-muted-light bg-base-200",
|
|
580
|
-
|
|
136
|
+
"aria-label": `${socialLabel} profile`,
|
|
137
|
+
title: socialLabel,
|
|
138
|
+
children: /* @__PURE__ */ jsx3("img", { src: iconAssets[icon], alt: "", "aria-hidden": "true", className: "h-3 w-auto opacity-75 dark:invert" })
|
|
581
139
|
}
|
|
582
140
|
) });
|
|
583
141
|
};
|
|
584
|
-
var SocialIcons =
|
|
142
|
+
var SocialIcons = memo(() => {
|
|
585
143
|
const docs = useDocsGlobalContext();
|
|
586
144
|
const socialEntries = Object.entries(docs.social ?? {}).filter(
|
|
587
|
-
(entry) => entry[0] in
|
|
145
|
+
(entry) => entry[0] in iconAssets && typeof entry[1] === "string" && entry[1].length > 0
|
|
588
146
|
);
|
|
589
147
|
if (socialEntries.length === 0) {
|
|
590
148
|
return null;
|
|
591
149
|
}
|
|
592
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ jsx3("ul", { className: "flex items-center gap-1", children: socialEntries.map(([platform, href]) => /* @__PURE__ */ jsx3(SocialIconElement, { icon: platform, href }, platform)) });
|
|
593
151
|
});
|
|
594
152
|
var SocialLinks_default = SocialIcons;
|
|
595
153
|
|
|
@@ -678,12 +236,12 @@ var applyThemePreference = (themePreference, themeConfig) => {
|
|
|
678
236
|
};
|
|
679
237
|
|
|
680
238
|
// src/runtime/client/components/ThemeSwitch.tsx
|
|
681
|
-
import { jsx as
|
|
239
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
682
240
|
var ThemeSwitch = ({ theme }) => {
|
|
683
241
|
const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
|
|
684
242
|
const setThemePreference = useDocsUserSettingsStore((state) => state.setThemePreference);
|
|
685
243
|
const effectiveThemePreference = resolveThemePreference(themePreference, theme);
|
|
686
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ jsxs2(
|
|
687
245
|
"button",
|
|
688
246
|
{
|
|
689
247
|
type: "button",
|
|
@@ -691,32 +249,32 @@ var ThemeSwitch = ({ theme }) => {
|
|
|
691
249
|
onClick: () => setThemePreference(effectiveThemePreference === "light" ? "dark" : "light"),
|
|
692
250
|
className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-base-muted-light bg-base-200",
|
|
693
251
|
children: [
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ jsx4(Sun, { className: "h-4 w-4 dark:hidden" }),
|
|
253
|
+
/* @__PURE__ */ jsx4(Moon, { className: "hidden h-4 w-4 dark:block" })
|
|
696
254
|
]
|
|
697
255
|
}
|
|
698
256
|
);
|
|
699
257
|
};
|
|
700
258
|
|
|
701
259
|
// src/runtime/client/components/Navbar/AsideButtons.tsx
|
|
702
|
-
import { jsx as
|
|
260
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
703
261
|
var AsideButtons = () => {
|
|
704
262
|
const docs = useDocsGlobalContext();
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex-1 justify-end gap-2 flex", children: [
|
|
264
|
+
/* @__PURE__ */ jsx5("div", { className: "hidden lg:block", children: /* @__PURE__ */ jsx5(SocialLinks_default, {}) }),
|
|
265
|
+
/* @__PURE__ */ jsx5(ThemeSwitch, { theme: docs.theme })
|
|
708
266
|
] });
|
|
709
267
|
};
|
|
710
268
|
var AsideButtons_default = AsideButtons;
|
|
711
269
|
|
|
712
270
|
// src/runtime/client/components/Navbar/DocsNavbar.tsx
|
|
713
|
-
import { jsx as
|
|
714
|
-
var StyledNav =
|
|
271
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
272
|
+
var StyledNav = cm.nav`
|
|
715
273
|
gap-4
|
|
716
274
|
flex-1 pl-10 items-center justify-end lg:justify-start
|
|
717
275
|
hidden lg:flex
|
|
718
276
|
`;
|
|
719
|
-
var StyledNavList =
|
|
277
|
+
var StyledNavList = cm.ul`
|
|
720
278
|
inline-flex items-center gap-2 font-semibold
|
|
721
279
|
`;
|
|
722
280
|
var DocsNavbar = ({
|
|
@@ -733,12 +291,12 @@ var DocsNavbar = ({
|
|
|
733
291
|
const handleClick = useCallback(() => {
|
|
734
292
|
alert("TODO: Open mobile menu");
|
|
735
293
|
}, []);
|
|
736
|
-
return /* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-1 gap-4 pt-3 justify-between", children: [
|
|
295
|
+
/* @__PURE__ */ jsx6("div", { className: "lg:min-w-76 min-w-none", children: /* @__PURE__ */ jsx6(Brand, { brand: docs.brand }) }),
|
|
296
|
+
/* @__PURE__ */ jsx6(StyledNav, { "aria-label": "Primary", children: /* @__PURE__ */ jsxs4(StyledNavList, { className: "", children: [
|
|
739
297
|
docs.navbarItems.map((item) => {
|
|
740
298
|
const isMegaMenuItemActive = isMegaMenuOpen && hoveredSectionId === item.id;
|
|
741
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ jsx6("li", { children: /* @__PURE__ */ jsx6(
|
|
742
300
|
"a",
|
|
743
301
|
{
|
|
744
302
|
href: withSiteBaseUrl(item.href),
|
|
@@ -748,19 +306,19 @@ var DocsNavbar = ({
|
|
|
748
306
|
onFocus: () => openMegaMenu(item.id),
|
|
749
307
|
onBlur: scheduleMegaMenuClose,
|
|
750
308
|
onClick: closeMegaMenu,
|
|
751
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ jsxs4(
|
|
752
310
|
"span",
|
|
753
311
|
{
|
|
754
|
-
className:
|
|
312
|
+
className: cmMerge2(
|
|
755
313
|
"btn text-base btn-sm md:min-w-30 px-2 whitespace-nowrap tracking-tight",
|
|
756
314
|
activeSection?.id === item.id ? "btn-primary btn-soft" : "btn-ghost "
|
|
757
315
|
),
|
|
758
316
|
children: [
|
|
759
317
|
renderInlineMarkdown(item.title),
|
|
760
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ jsx6(
|
|
761
319
|
ChevronDown,
|
|
762
320
|
{
|
|
763
|
-
className:
|
|
321
|
+
className: cmMerge2(
|
|
764
322
|
"h-4 w-4 shrink-0 transition-transform duration-200",
|
|
765
323
|
isMegaMenuItemActive ? "rotate-180" : "rotate-0"
|
|
766
324
|
)
|
|
@@ -772,7 +330,7 @@ var DocsNavbar = ({
|
|
|
772
330
|
}
|
|
773
331
|
) }, item.id);
|
|
774
332
|
}),
|
|
775
|
-
docs.algolia ? /* @__PURE__ */
|
|
333
|
+
docs.algolia ? /* @__PURE__ */ jsx6("li", { children: /* @__PURE__ */ jsxs4(
|
|
776
334
|
"button",
|
|
777
335
|
{
|
|
778
336
|
type: "button",
|
|
@@ -780,27 +338,27 @@ var DocsNavbar = ({
|
|
|
780
338
|
className: "btn btn-ghost btn-sm text-base md:min-w-30 px-2 whitespace-nowrap tracking-tight",
|
|
781
339
|
children: [
|
|
782
340
|
"Search",
|
|
783
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ jsx6(TextSearch, { className: "h-4 w-4" })
|
|
784
342
|
]
|
|
785
343
|
}
|
|
786
344
|
) }) : null
|
|
787
345
|
] }) }),
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ jsx6("button", { type: "button", className: "block lg:hidden", "aria-label": "Open navigation menu", onClick: handleClick, children: /* @__PURE__ */ jsx6(Menu, { className: "w-6 h-6" }) }),
|
|
347
|
+
/* @__PURE__ */ jsx6("div", { className: "lg:min-w-40 hidden lg:block", children: /* @__PURE__ */ jsx6(AsideButtons_default, {}) })
|
|
790
348
|
] });
|
|
791
349
|
};
|
|
792
350
|
var DocsNavbar_default = DocsNavbar;
|
|
793
351
|
|
|
794
352
|
// src/runtime/client/components/Navbar/LandingPageNavbar.tsx
|
|
795
|
-
import
|
|
353
|
+
import cm2, { cmMerge as cmMerge3 } from "@classmatejs/react";
|
|
796
354
|
import { ChevronDown as ChevronDown2, Menu as Menu2, TextSearch as TextSearch2 } from "lucide-react";
|
|
797
355
|
import { useCallback as useCallback2 } from "react";
|
|
798
|
-
import { jsx as
|
|
799
|
-
var StyledNav2 =
|
|
356
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
357
|
+
var StyledNav2 = cm2.nav`
|
|
800
358
|
gap-4
|
|
801
359
|
flex-1 lg:pl-6 xl:pl-10 items-center justify-center
|
|
802
360
|
`;
|
|
803
|
-
var StyledNavList2 =
|
|
361
|
+
var StyledNavList2 = cm2.ul`
|
|
804
362
|
inline-flex items-center gap-2 font-semibold
|
|
805
363
|
`;
|
|
806
364
|
var LandingPageNavbar = ({
|
|
@@ -816,12 +374,12 @@ var LandingPageNavbar = ({
|
|
|
816
374
|
const handleClick = useCallback2(() => {
|
|
817
375
|
alert("TODO: Open mobile menu");
|
|
818
376
|
}, []);
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-1 gap-4 pt-3 justify-between", children: [
|
|
378
|
+
/* @__PURE__ */ jsx7("div", { className: "min-w-40", children: /* @__PURE__ */ jsx7(Brand, { brand: docs.brand }) }),
|
|
379
|
+
/* @__PURE__ */ jsx7(StyledNav2, { "aria-label": "Primary", className: "flex-1 flex hidden lg:flex", children: /* @__PURE__ */ jsxs5(StyledNavList2, { className: "justify-end ", children: [
|
|
822
380
|
docs.navbarItems.map((item) => {
|
|
823
381
|
const isMegaMenuItemActive = isMegaMenuOpen && hoveredSectionId === item.id;
|
|
824
|
-
return /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsx7(
|
|
825
383
|
"a",
|
|
826
384
|
{
|
|
827
385
|
href: withSiteBaseUrl(item.href),
|
|
@@ -831,18 +389,18 @@ var LandingPageNavbar = ({
|
|
|
831
389
|
onFocus: () => openMegaMenu(item.id),
|
|
832
390
|
onBlur: scheduleMegaMenuClose,
|
|
833
391
|
onClick: closeMegaMenu,
|
|
834
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ jsxs5(
|
|
835
393
|
"span",
|
|
836
394
|
{
|
|
837
|
-
className:
|
|
395
|
+
className: cmMerge3(
|
|
838
396
|
"btn btn-ghost text-base lg:text-lg btn-sm lg:min-w-30 px-2 whitespace-nowrap tracking-tight"
|
|
839
397
|
),
|
|
840
398
|
children: [
|
|
841
399
|
renderInlineMarkdown(item.title),
|
|
842
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ jsx7(
|
|
843
401
|
ChevronDown2,
|
|
844
402
|
{
|
|
845
|
-
className:
|
|
403
|
+
className: cmMerge3(
|
|
846
404
|
"h-4 w-4 shrink-0 transition-transform duration-200",
|
|
847
405
|
isMegaMenuItemActive ? "rotate-180" : "rotate-0"
|
|
848
406
|
)
|
|
@@ -854,7 +412,7 @@ var LandingPageNavbar = ({
|
|
|
854
412
|
}
|
|
855
413
|
) }, item.id);
|
|
856
414
|
}),
|
|
857
|
-
docs.algolia ? /* @__PURE__ */
|
|
415
|
+
docs.algolia ? /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs5(
|
|
858
416
|
"button",
|
|
859
417
|
{
|
|
860
418
|
type: "button",
|
|
@@ -862,21 +420,21 @@ var LandingPageNavbar = ({
|
|
|
862
420
|
className: "btn btn-ghost btn-sm text-base lg:text-lg lg:min-w-30 px-2 whitespace-nowrap tracking-tight",
|
|
863
421
|
children: [
|
|
864
422
|
"Search",
|
|
865
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ jsx7(TextSearch2, { className: "h-4 w-4" })
|
|
866
424
|
]
|
|
867
425
|
}
|
|
868
426
|
) }) : null
|
|
869
427
|
] }) }),
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ jsx7("div", { className: "min-w-40 hidden lg:block", children: /* @__PURE__ */ jsx7(AsideButtons_default, {}) }),
|
|
429
|
+
/* @__PURE__ */ jsx7("button", { type: "button", className: "block lg:hidden", "aria-label": "Open navigation menu", onClick: handleClick, children: /* @__PURE__ */ jsx7(Menu2, { className: "w-6 h-6" }) })
|
|
872
430
|
] });
|
|
873
431
|
};
|
|
874
432
|
var LandingPageNavbar_default = LandingPageNavbar;
|
|
875
433
|
|
|
876
434
|
// src/runtime/client/components/Navbar/MegaMenu.tsx
|
|
877
|
-
import { cmMerge as
|
|
435
|
+
import { cmMerge as cmMerge4 } from "@classmatejs/react";
|
|
878
436
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
879
|
-
import { jsx as
|
|
437
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
880
438
|
var MegaMenu = ({
|
|
881
439
|
isActive,
|
|
882
440
|
onOpen,
|
|
@@ -890,7 +448,7 @@ var MegaMenu = ({
|
|
|
890
448
|
const [visibleSectionElement, setVisibleSectionElement] = useState2(null);
|
|
891
449
|
const [contentHeight, setContentHeight] = useState2(0);
|
|
892
450
|
useEffect2(() => {
|
|
893
|
-
if (!visibleSectionId || visibleSectionElement === null) {
|
|
451
|
+
if (!isActive || !visibleSectionId || visibleSectionElement === null) {
|
|
894
452
|
return;
|
|
895
453
|
}
|
|
896
454
|
const updateContentHeight = () => {
|
|
@@ -907,57 +465,57 @@ var MegaMenu = ({
|
|
|
907
465
|
return () => {
|
|
908
466
|
resizeObserver.disconnect();
|
|
909
467
|
};
|
|
910
|
-
}, [visibleSectionElement, visibleSectionId]);
|
|
911
|
-
return /* @__PURE__ */
|
|
468
|
+
}, [visibleSectionElement, visibleSectionId, isActive]);
|
|
469
|
+
return /* @__PURE__ */ jsxs6(
|
|
912
470
|
"div",
|
|
913
471
|
{
|
|
914
|
-
className:
|
|
472
|
+
className: cmMerge4("fixed top-14 left-0 z-3 w-full", isActive ? "pointer-events-auto" : "pointer-events-none"),
|
|
915
473
|
onPointerEnter: () => onOpen(visibleSectionId),
|
|
916
474
|
onPointerLeave: onClose,
|
|
917
475
|
children: [
|
|
918
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ jsx8(
|
|
919
477
|
"div",
|
|
920
478
|
{
|
|
921
|
-
className:
|
|
479
|
+
className: cmMerge4(
|
|
922
480
|
isActive ? "opacity-100" : "opacity-0",
|
|
923
481
|
"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"
|
|
924
482
|
)
|
|
925
483
|
}
|
|
926
484
|
),
|
|
927
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ jsx8(
|
|
928
486
|
"div",
|
|
929
487
|
{
|
|
930
|
-
className:
|
|
488
|
+
className: cmMerge4(
|
|
931
489
|
"relative z-4 overflow-hidden transition-[height] bg-base-100 duration-300",
|
|
932
490
|
isLandingPage && !isActive ? "" : "border-b border-base-muted-light ease-out"
|
|
933
491
|
),
|
|
934
492
|
style: { height: isActive ? contentHeight : 0 },
|
|
935
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ jsx8(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx8(
|
|
936
494
|
"div",
|
|
937
495
|
{
|
|
938
|
-
className:
|
|
496
|
+
className: cmMerge4(
|
|
939
497
|
isActive ? "translate-y-0 opacity-100" : "-translate-y-10 opacity-0",
|
|
940
498
|
"relative z-4 transition-all duration-300"
|
|
941
499
|
),
|
|
942
|
-
children: sections.map((section) => /* @__PURE__ */
|
|
500
|
+
children: sections.map((section) => /* @__PURE__ */ jsx8(
|
|
943
501
|
"div",
|
|
944
502
|
{
|
|
945
503
|
ref: section.id === visibleSectionId ? setVisibleSectionElement : void 0,
|
|
946
|
-
className:
|
|
504
|
+
className: cmMerge4(
|
|
947
505
|
section.id === visibleSectionId ? "opacity-100" : "opacity-0 pointer-events-none",
|
|
948
506
|
"transition-all absolute w-full duration-300"
|
|
949
507
|
),
|
|
950
|
-
children: section.items.length > 0 && /* @__PURE__ */
|
|
951
|
-
(child) => child.showInNav !== false && /* @__PURE__ */
|
|
952
|
-
child.href ? /* @__PURE__ */
|
|
508
|
+
children: section.items.length > 0 && /* @__PURE__ */ jsx8("ul", { className: "mt-2 flex ", children: section.items.map(
|
|
509
|
+
(child) => child.showInNav !== false && /* @__PURE__ */ jsxs6("li", { className: "flex-1 py-3 mb-6 px-4", children: [
|
|
510
|
+
child.href ? /* @__PURE__ */ jsx8(
|
|
953
511
|
"a",
|
|
954
512
|
{
|
|
955
513
|
className: "mb-4 block text-lg font-semibold tracking-tight",
|
|
956
514
|
href: withSiteBaseUrl(child.href),
|
|
957
515
|
children: child.title
|
|
958
516
|
}
|
|
959
|
-
) : /* @__PURE__ */
|
|
960
|
-
child.kind === "group" && child.items.length > 0 && /* @__PURE__ */
|
|
517
|
+
) : /* @__PURE__ */ jsx8("span", { className: "mb-4 block text-lg font-semibold tracking-tight", children: child.title }),
|
|
518
|
+
child.kind === "group" && child.items.length > 0 && /* @__PURE__ */ jsx8("ul", { className: "menu border-l border-base-muted-light py-0 w-full", children: child.items.map((subChild) => /* @__PURE__ */ jsx8("li", { children: subChild.href ? /* @__PURE__ */ jsx8("a", { href: withSiteBaseUrl(subChild.href), onClick: onClose, children: renderInlineMarkdown(subChild.title) }) : /* @__PURE__ */ jsx8("span", { children: renderInlineMarkdown(subChild.title) }) }, subChild.id)) })
|
|
961
519
|
] }, child.id)
|
|
962
520
|
) })
|
|
963
521
|
},
|
|
@@ -973,13 +531,13 @@ var MegaMenu = ({
|
|
|
973
531
|
};
|
|
974
532
|
|
|
975
533
|
// src/runtime/client/components/Navbar/useMegaMenu.ts
|
|
976
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useRef
|
|
534
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
|
977
535
|
var megaMenuOpenDelayMs = 120;
|
|
978
536
|
var megaMenuCloseDelayMs = 140;
|
|
979
537
|
var useMegaMenu = ({ activeSectionId, sections }) => {
|
|
980
538
|
const [isMegaMenuOpen, setIsMegaMenuOpen] = useState3(false);
|
|
981
|
-
const megaMenuOpenTimeoutRef =
|
|
982
|
-
const megaMenuCloseTimeoutRef =
|
|
539
|
+
const megaMenuOpenTimeoutRef = useRef(null);
|
|
540
|
+
const megaMenuCloseTimeoutRef = useRef(null);
|
|
983
541
|
const [hoveredSectionId, setHoveredSectionId] = useState3(activeSectionId ?? sections[0]?.id);
|
|
984
542
|
const clearMegaMenuOpenTimeout = useCallback3(() => {
|
|
985
543
|
if (megaMenuOpenTimeoutRef.current === null) {
|
|
@@ -1052,20 +610,36 @@ var useMegaMenu = ({ activeSectionId, sections }) => {
|
|
|
1052
610
|
var useMegaMenu_default = useMegaMenu;
|
|
1053
611
|
|
|
1054
612
|
// src/runtime/client/components/Navbar/index.tsx
|
|
1055
|
-
import { jsx as
|
|
613
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
614
|
+
var LARGE_SCREEN_MEDIA_QUERY = "(min-width: 1024px)";
|
|
1056
615
|
var NavbarNew = () => {
|
|
1057
616
|
const docs = useDocsGlobalContext();
|
|
1058
|
-
const { urlPathname, urlParsed } =
|
|
617
|
+
const { urlPathname, urlParsed } = usePageContext();
|
|
1059
618
|
const isLandingPage = urlParsed.pathname === "/";
|
|
1060
619
|
const sections = docs.sidebarSections;
|
|
1061
620
|
const activeSection = getActiveSectionByPathname(docs, urlPathname);
|
|
1062
621
|
const { toggle: toggleSearch } = useDocsSearchActions();
|
|
622
|
+
const [isLargeScreen, setIsLargeScreen] = useState4(false);
|
|
1063
623
|
const { closeMegaMenu, hoveredSectionId, isMegaMenuOpen, openMegaMenu, scheduleMegaMenuOpen, scheduleMegaMenuClose } = useMegaMenu_default({
|
|
1064
624
|
activeSectionId: activeSection?.id,
|
|
1065
625
|
sections
|
|
1066
626
|
});
|
|
1067
|
-
|
|
1068
|
-
|
|
627
|
+
useEffect4(() => {
|
|
628
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
const mediaQueryList = window.matchMedia(LARGE_SCREEN_MEDIA_QUERY);
|
|
632
|
+
const updateLargeScreenState = () => {
|
|
633
|
+
setIsLargeScreen(mediaQueryList.matches);
|
|
634
|
+
};
|
|
635
|
+
updateLargeScreenState();
|
|
636
|
+
mediaQueryList.addEventListener("change", updateLargeScreenState);
|
|
637
|
+
return () => {
|
|
638
|
+
mediaQueryList.removeEventListener("change", updateLargeScreenState);
|
|
639
|
+
};
|
|
640
|
+
}, []);
|
|
641
|
+
return /* @__PURE__ */ jsxs7(StyledNavbar, { $border: isLandingPage, children: [
|
|
642
|
+
/* @__PURE__ */ jsx9(LayoutComponent, { children: isLandingPage ? /* @__PURE__ */ jsx9(
|
|
1069
643
|
LandingPageNavbar_default,
|
|
1070
644
|
{
|
|
1071
645
|
openMegaMenu,
|
|
@@ -1076,7 +650,7 @@ var NavbarNew = () => {
|
|
|
1076
650
|
hoveredSectionId,
|
|
1077
651
|
isMegaMenuOpen
|
|
1078
652
|
}
|
|
1079
|
-
) : /* @__PURE__ */
|
|
653
|
+
) : /* @__PURE__ */ jsx9(
|
|
1080
654
|
DocsNavbar_default,
|
|
1081
655
|
{
|
|
1082
656
|
openMegaMenu,
|
|
@@ -1089,8 +663,8 @@ var NavbarNew = () => {
|
|
|
1089
663
|
isMegaMenuOpen
|
|
1090
664
|
}
|
|
1091
665
|
) }),
|
|
1092
|
-
/* @__PURE__ */
|
|
1093
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ jsx9(Search, {}),
|
|
667
|
+
isLargeScreen ? /* @__PURE__ */ jsx9(
|
|
1094
668
|
MegaMenu,
|
|
1095
669
|
{
|
|
1096
670
|
sections,
|
|
@@ -1101,18 +675,18 @@ var NavbarNew = () => {
|
|
|
1101
675
|
onClose: scheduleMegaMenuClose,
|
|
1102
676
|
isLandingPage
|
|
1103
677
|
}
|
|
1104
|
-
)
|
|
678
|
+
) : null
|
|
1105
679
|
] });
|
|
1106
680
|
};
|
|
1107
681
|
var Navbar_default = NavbarNew;
|
|
1108
|
-
var StyledNavbar =
|
|
682
|
+
var StyledNavbar = cm3.header`
|
|
1109
683
|
top-0 left-0 z-20 w-full bg-base-100
|
|
1110
684
|
pt-0 h-14
|
|
1111
685
|
${({ $border }) => $border ? "relative" : "fixed"}
|
|
1112
686
|
`;
|
|
1113
687
|
|
|
1114
688
|
// src/runtime/client/components/UserSettingsSync.tsx
|
|
1115
|
-
import { useEffect as
|
|
689
|
+
import { useEffect as useEffect5, useMemo } from "react";
|
|
1116
690
|
var UserSettingsSync = ({ theme }) => {
|
|
1117
691
|
const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
|
|
1118
692
|
const lightTheme = theme?.light ?? "consumer-light";
|
|
@@ -1123,57 +697,84 @@ var UserSettingsSync = ({ theme }) => {
|
|
|
1123
697
|
[darkTheme, defaultThemePreference, lightTheme]
|
|
1124
698
|
);
|
|
1125
699
|
const effectiveThemePreference = resolveThemePreference(themePreference, resolvedTheme);
|
|
1126
|
-
|
|
700
|
+
useEffect5(() => {
|
|
1127
701
|
applyThemePreference(effectiveThemePreference, resolvedTheme);
|
|
1128
702
|
}, [effectiveThemePreference, resolvedTheme]);
|
|
1129
703
|
return null;
|
|
1130
704
|
};
|
|
1131
705
|
|
|
1132
706
|
// src/runtime/client/AppLayout.tsx
|
|
1133
|
-
import { jsx as
|
|
1134
|
-
var queryClient = new QueryClient();
|
|
707
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1135
708
|
var runtimeStore = createDocsRuntimeStore();
|
|
1136
709
|
var AppLayout = ({ children, header }) => {
|
|
1137
|
-
const { urlPathname } =
|
|
1138
|
-
const pageContext =
|
|
710
|
+
const { urlPathname } = usePageContext2();
|
|
711
|
+
const pageContext = usePageContext2();
|
|
1139
712
|
const docs = getDocsFromGlobalContext(pageContext);
|
|
1140
713
|
const isLandingPage = urlPathname === "/";
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
header ?? /* @__PURE__ */
|
|
1145
|
-
/* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ jsx10(DocsRuntimeStoreProvider, { store: runtimeStore, children: /* @__PURE__ */ jsxs8(DocsGlobalContextProvider, { docs, children: [
|
|
715
|
+
/* @__PURE__ */ jsx10(UserSettingsSync, { theme: docs.theme }),
|
|
716
|
+
/* @__PURE__ */ jsxs8("div", { className: "min-h-screen bg-base-100 text-base-content", children: [
|
|
717
|
+
header ?? /* @__PURE__ */ jsx10(Navbar_default, {}),
|
|
718
|
+
/* @__PURE__ */ jsx10("div", { className: cmMerge5(isLandingPage ? "" : "pt-14"), children })
|
|
1146
719
|
] })
|
|
1147
|
-
] }) })
|
|
720
|
+
] }) });
|
|
1148
721
|
};
|
|
1149
722
|
|
|
1150
723
|
// src/runtime/client/components/MetaHead/FaviconLinks.tsx
|
|
1151
|
-
import { Fragment
|
|
724
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1152
725
|
var FaviconLinks = ({ head }) => {
|
|
1153
726
|
const { appleTouchIcon, faviconIco, faviconSvg } = head;
|
|
1154
|
-
return /* @__PURE__ */
|
|
1155
|
-
appleTouchIcon && /* @__PURE__ */
|
|
1156
|
-
faviconSvg && /* @__PURE__ */
|
|
1157
|
-
faviconIco && /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
728
|
+
appleTouchIcon && /* @__PURE__ */ jsx11("link", { rel: "apple-touch-icon", href: appleTouchIcon }),
|
|
729
|
+
faviconSvg && /* @__PURE__ */ jsx11("link", { rel: "icon", type: "image/svg+xml", href: faviconSvg }),
|
|
730
|
+
faviconIco && /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
731
|
+
/* @__PURE__ */ jsx11("link", { rel: "shortcut icon", type: "image/x-icon", href: faviconIco }),
|
|
732
|
+
/* @__PURE__ */ jsx11("link", { rel: "icon", type: "image/x-icon", href: faviconIco })
|
|
1160
733
|
] })
|
|
1161
734
|
] });
|
|
1162
735
|
};
|
|
1163
736
|
|
|
1164
737
|
// src/runtime/client/components/MetaHead/FontLinks.tsx
|
|
1165
|
-
import { Fragment as
|
|
738
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
739
|
+
var defaultInterFontStylesheetHref = nivelAssetUrl("fonts/fonts-inter.css");
|
|
740
|
+
var defaultInterFontCss = `
|
|
741
|
+
@font-face {
|
|
742
|
+
font-display: swap;
|
|
743
|
+
font-family: 'Inter';
|
|
744
|
+
font-style: normal;
|
|
745
|
+
font-weight: 400;
|
|
746
|
+
src: url('${nivelAssetUrl("fonts/inter-v20-latin-regular.woff2")}') format('woff2');
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
@font-face {
|
|
750
|
+
font-display: swap;
|
|
751
|
+
font-family: 'Inter';
|
|
752
|
+
font-style: normal;
|
|
753
|
+
font-weight: 600;
|
|
754
|
+
src: url('${nivelAssetUrl("fonts/inter-v20-latin-600.woff2")}') format('woff2');
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
@font-face {
|
|
758
|
+
font-display: swap;
|
|
759
|
+
font-family: 'Inter';
|
|
760
|
+
font-style: normal;
|
|
761
|
+
font-weight: 800;
|
|
762
|
+
src: url('${nivelAssetUrl("fonts/inter-v20-latin-800.woff2")}') format('woff2');
|
|
763
|
+
}
|
|
764
|
+
`;
|
|
1166
765
|
var FontLinks = ({ head }) => {
|
|
1167
766
|
const { fontStylesheetHref, fontPreloadHrefs } = head;
|
|
1168
767
|
const effectivePreloadHrefs = fontPreloadHrefs ?? [];
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
768
|
+
const shouldInlineDefaultInterFonts = fontStylesheetHref === defaultInterFontStylesheetHref;
|
|
769
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
770
|
+
effectivePreloadHrefs.map((href) => /* @__PURE__ */ jsx12("link", { rel: "preload", href, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, href)),
|
|
771
|
+
shouldInlineDefaultInterFonts ? /* @__PURE__ */ jsx12("style", { dangerouslySetInnerHTML: { __html: defaultInterFontCss } }) : null,
|
|
772
|
+
fontStylesheetHref && !shouldInlineDefaultInterFonts ? /* @__PURE__ */ jsx12("link", { rel: "stylesheet", href: fontStylesheetHref }) : null
|
|
1172
773
|
] });
|
|
1173
774
|
};
|
|
1174
775
|
|
|
1175
776
|
// src/runtime/client/components/MetaHead/ThemeBootstrap.tsx
|
|
1176
|
-
import { jsx as
|
|
777
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1177
778
|
var getThemeBootstrapScript = (theme) => {
|
|
1178
779
|
return `(() => {
|
|
1179
780
|
const storageKey = ${JSON.stringify(USER_SETTINGS_STORAGE_KEY)};
|
|
@@ -1211,7 +812,7 @@ var getThemeBootstrapScript = (theme) => {
|
|
|
1211
812
|
})();`;
|
|
1212
813
|
};
|
|
1213
814
|
var ThemeBootstrap = ({ theme }) => {
|
|
1214
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ jsx13(
|
|
1215
816
|
"script",
|
|
1216
817
|
{
|
|
1217
818
|
dangerouslySetInnerHTML: {
|
|
@@ -1222,19 +823,19 @@ var ThemeBootstrap = ({ theme }) => {
|
|
|
1222
823
|
};
|
|
1223
824
|
|
|
1224
825
|
// src/runtime/client/components/MetaHead/index.tsx
|
|
1225
|
-
import { Fragment as
|
|
826
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1226
827
|
var MetaHead = () => {
|
|
1227
828
|
const docs = useDocsFromPageGlobalContext();
|
|
1228
|
-
return /* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
830
|
+
/* @__PURE__ */ jsx14(ThemeBootstrap, { theme: docs.theme }),
|
|
831
|
+
/* @__PURE__ */ jsx14(FaviconLinks, { head: docs.head }),
|
|
832
|
+
/* @__PURE__ */ jsx14(FontLinks, { head: docs.head })
|
|
1232
833
|
] });
|
|
1233
834
|
};
|
|
1234
835
|
|
|
1235
836
|
// src/runtime/client/components/ProseContainer.tsx
|
|
1236
|
-
import
|
|
1237
|
-
var ProseContainer =
|
|
837
|
+
import cm4 from "@classmatejs/react";
|
|
838
|
+
var ProseContainer = cm4.section`
|
|
1238
839
|
prose-container
|
|
1239
840
|
`;
|
|
1240
841
|
|
|
@@ -1242,34 +843,34 @@ var ProseContainer = cm5.section`
|
|
|
1242
843
|
import { useData } from "vike-react/useData";
|
|
1243
844
|
|
|
1244
845
|
// src/runtime/client/components/DocsPagination.tsx
|
|
1245
|
-
import { cmMerge as
|
|
846
|
+
import { cmMerge as cmMerge6 } from "@classmatejs/react";
|
|
1246
847
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
1247
|
-
import { jsx as
|
|
848
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1248
849
|
var PaginationCard = ({ item, direction, isOffset }) => {
|
|
1249
850
|
const isPrevious = direction === "previous";
|
|
1250
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ jsx15(
|
|
1251
852
|
"a",
|
|
1252
853
|
{
|
|
1253
854
|
href: withSiteBaseUrl(item.href),
|
|
1254
|
-
className:
|
|
855
|
+
className: cmMerge6(
|
|
1255
856
|
"group rounded-box border border-base-muted-light bg-base-100 p-5 no-underline hover:border-primary-muted-medium hover:bg-base-200",
|
|
1256
857
|
isPrevious ? "text-left" : "text-right",
|
|
1257
858
|
isOffset && "sm:col-start-2"
|
|
1258
859
|
),
|
|
1259
860
|
"aria-label": `${isPrevious ? "Previous" : "Next"}: ${item.title}`,
|
|
1260
|
-
children: /* @__PURE__ */
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
862
|
+
/* @__PURE__ */ jsx15("p", { className: "text-lg font-semibold text-base-content", children: renderInlineMarkdown(item.title) }),
|
|
863
|
+
/* @__PURE__ */ jsxs12(
|
|
1263
864
|
"div",
|
|
1264
865
|
{
|
|
1265
|
-
className:
|
|
866
|
+
className: cmMerge6(
|
|
1266
867
|
"flex items-center gap-1 text-base-muted group-hover:text-base-content",
|
|
1267
868
|
isPrevious ? "justify-start" : "justify-end"
|
|
1268
869
|
),
|
|
1269
870
|
children: [
|
|
1270
|
-
isPrevious && /* @__PURE__ */
|
|
1271
|
-
/* @__PURE__ */
|
|
1272
|
-
!isPrevious && /* @__PURE__ */
|
|
871
|
+
isPrevious && /* @__PURE__ */ jsx15(ChevronLeft, { className: "h-4 w-4" }),
|
|
872
|
+
/* @__PURE__ */ jsx15("span", { children: isPrevious ? "Previous" : "Next" }),
|
|
873
|
+
!isPrevious && /* @__PURE__ */ jsx15(ChevronRight, { className: "h-4 w-4" })
|
|
1273
874
|
]
|
|
1274
875
|
}
|
|
1275
876
|
)
|
|
@@ -1290,38 +891,38 @@ var DocsPagination = ({
|
|
|
1290
891
|
if (!previousPage && !nextPage) {
|
|
1291
892
|
return null;
|
|
1292
893
|
}
|
|
1293
|
-
return /* @__PURE__ */
|
|
1294
|
-
previousPage && /* @__PURE__ */
|
|
1295
|
-
nextPage && /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ jsx15("nav", { className: "mb-10 mt-16", "aria-label": "Previous Next", children: /* @__PURE__ */ jsxs12("div", { className: "grid gap-4 sm:grid-cols-2", children: [
|
|
895
|
+
previousPage && /* @__PURE__ */ jsx15(PaginationCard, { item: previousPage, direction: "previous" }),
|
|
896
|
+
nextPage && /* @__PURE__ */ jsx15(PaginationCard, { isOffset: !previousPage, item: nextPage, direction: "next" })
|
|
1296
897
|
] }) });
|
|
1297
898
|
};
|
|
1298
899
|
|
|
1299
900
|
// src/runtime/client/components/Footer.tsx
|
|
1300
901
|
import { Bug, Pencil } from "lucide-react";
|
|
1301
|
-
import { memo as
|
|
1302
|
-
import { jsx as
|
|
1303
|
-
var DocsFooter =
|
|
902
|
+
import { memo as memo2 } from "react";
|
|
903
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
904
|
+
var DocsFooter = memo2(() => {
|
|
1304
905
|
const { brand } = useDocsGlobalContext();
|
|
1305
|
-
return /* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
/* @__PURE__ */
|
|
1308
|
-
/* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ jsxs13("footer", { className: "mb-8 mt-12 text-sm border-t border-base-muted-light pt-10", children: [
|
|
907
|
+
/* @__PURE__ */ jsxs13("div", { className: "mb-16 flex items-center gap-2", children: [
|
|
908
|
+
/* @__PURE__ */ jsxs13("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
|
|
909
|
+
/* @__PURE__ */ jsx16(Pencil, { className: "w-3 h-3" }),
|
|
1309
910
|
" Edit this page"
|
|
1310
911
|
] }),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ jsxs13("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
|
|
913
|
+
/* @__PURE__ */ jsx16(Bug, { className: "w-3 h-3" }),
|
|
1313
914
|
" Report Issue"
|
|
1314
915
|
] })
|
|
1315
916
|
] }),
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between items-center", children: [
|
|
918
|
+
/* @__PURE__ */ jsx16(SocialLinks_default, {}),
|
|
919
|
+
/* @__PURE__ */ jsx16("div", { className: "flex gap-2 items-center", children: brand && /* @__PURE__ */ jsx16(Brand, { brand, noText: true }) })
|
|
1319
920
|
] })
|
|
1320
921
|
] });
|
|
1321
922
|
});
|
|
1322
923
|
|
|
1323
924
|
// src/runtime/client/components/HeadingLinkCopy.tsx
|
|
1324
|
-
import { useEffect as
|
|
925
|
+
import { useEffect as useEffect6 } from "react";
|
|
1325
926
|
var copyText = async (value) => {
|
|
1326
927
|
try {
|
|
1327
928
|
await navigator.clipboard.writeText(value);
|
|
@@ -1340,7 +941,7 @@ var copyText = async (value) => {
|
|
|
1340
941
|
};
|
|
1341
942
|
var getHeadingLink = (target) => target instanceof Element ? target.closest("a[data-copy-heading-link]") : null;
|
|
1342
943
|
var HeadingLinkCopy = () => {
|
|
1343
|
-
|
|
944
|
+
useEffect6(() => {
|
|
1344
945
|
const handleClick = (event) => {
|
|
1345
946
|
if (event.defaultPrevented || event.button !== 0) {
|
|
1346
947
|
return;
|
|
@@ -1371,9 +972,9 @@ var HeadingLinkCopy = () => {
|
|
|
1371
972
|
};
|
|
1372
973
|
|
|
1373
974
|
// src/runtime/client/components/Sidebar.tsx
|
|
1374
|
-
import { cmMerge as
|
|
1375
|
-
import { memo as
|
|
1376
|
-
import { usePageContext as
|
|
975
|
+
import { cmMerge as cmMerge7 } from "@classmatejs/react";
|
|
976
|
+
import { memo as memo3, useEffect as useEffect7, useRef as useRef2 } from "react";
|
|
977
|
+
import { usePageContext as usePageContext3 } from "vike-react/usePageContext";
|
|
1377
978
|
|
|
1378
979
|
// src/runtime/client/components/docsNavigation.ts
|
|
1379
980
|
var containsActiveHref = (items, currentHref) => {
|
|
@@ -1401,12 +1002,12 @@ var getVisibleGroupItems = (group) => {
|
|
|
1401
1002
|
var getGroupHref = (group) => group.href ?? null;
|
|
1402
1003
|
|
|
1403
1004
|
// src/runtime/client/components/Sidebar.tsx
|
|
1404
|
-
import { Fragment as
|
|
1005
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1405
1006
|
var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
|
|
1406
1007
|
const storedOpen = useDocsSidebarStore((state) => state.openNodes[nodeId]);
|
|
1407
1008
|
const { setNodeOpen } = useDocsSidebarActions();
|
|
1408
1009
|
const isOpen = storedOpen === void 0 ? isOpenByDefault || hasActiveDescendant : storedOpen || hasActiveDescendant;
|
|
1409
|
-
|
|
1010
|
+
useEffect7(() => {
|
|
1410
1011
|
if (hasActiveDescendant) {
|
|
1411
1012
|
setNodeOpen(nodeId, true);
|
|
1412
1013
|
return;
|
|
@@ -1421,11 +1022,11 @@ var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
|
|
|
1421
1022
|
};
|
|
1422
1023
|
};
|
|
1423
1024
|
var SidebarPageLink = ({ title, href, currentHref }) => {
|
|
1424
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ jsx17("li", { className: "rounded-none", children: /* @__PURE__ */ jsx17(
|
|
1425
1026
|
"a",
|
|
1426
1027
|
{
|
|
1427
1028
|
href: withSiteBaseUrl(href),
|
|
1428
|
-
className:
|
|
1029
|
+
className: cmMerge7(
|
|
1429
1030
|
"text-base-muted hover:text-base-content justify-start hover:bg-base-200",
|
|
1430
1031
|
href === currentHref && "text-primary! font-semibold bg-base-200"
|
|
1431
1032
|
),
|
|
@@ -1434,13 +1035,13 @@ var SidebarPageLink = ({ title, href, currentHref }) => {
|
|
|
1434
1035
|
) });
|
|
1435
1036
|
};
|
|
1436
1037
|
var SidebarGroupDivider = ({ title }) => {
|
|
1437
|
-
return /* @__PURE__ */
|
|
1038
|
+
return /* @__PURE__ */ jsx17("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__ */ jsx17("span", { className: "-ml-3", children: renderInlineMarkdown(title, { codeClassName: "text-sm!" }) }) });
|
|
1438
1039
|
};
|
|
1439
1040
|
var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) => {
|
|
1440
|
-
const content = /* @__PURE__ */
|
|
1041
|
+
const content = /* @__PURE__ */ jsx17(
|
|
1441
1042
|
"span",
|
|
1442
1043
|
{
|
|
1443
|
-
className:
|
|
1044
|
+
className: cmMerge7(
|
|
1444
1045
|
allowNavigation ? "font-medium" : "font-semibold",
|
|
1445
1046
|
isActive && allowNavigation && "text-primary!"
|
|
1446
1047
|
),
|
|
@@ -1448,11 +1049,11 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) =>
|
|
|
1448
1049
|
}
|
|
1449
1050
|
);
|
|
1450
1051
|
if (allowNavigation && href) {
|
|
1451
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ jsx17(
|
|
1452
1053
|
"a",
|
|
1453
1054
|
{
|
|
1454
1055
|
href: withSiteBaseUrl(href),
|
|
1455
|
-
className:
|
|
1056
|
+
className: cmMerge7(
|
|
1456
1057
|
"flex items-center gap-2 text-base-muted hover:text-base-content no-underline",
|
|
1457
1058
|
isActive && "text-primary! font-semibold"
|
|
1458
1059
|
),
|
|
@@ -1460,19 +1061,19 @@ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) =>
|
|
|
1460
1061
|
}
|
|
1461
1062
|
);
|
|
1462
1063
|
}
|
|
1463
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsx17("span", { className: "flex items-center gap-2 text-base-content", children: content });
|
|
1464
1065
|
};
|
|
1465
1066
|
var renderSidebarItems = (items, currentHref) => {
|
|
1466
1067
|
return items.map((item) => {
|
|
1467
1068
|
if (item.kind === "page") {
|
|
1468
|
-
return /* @__PURE__ */
|
|
1069
|
+
return /* @__PURE__ */ jsx17(SidebarPageLink, { title: item.navTitle, href: item.href, currentHref }, item.id);
|
|
1469
1070
|
}
|
|
1470
|
-
return /* @__PURE__ */
|
|
1071
|
+
return /* @__PURE__ */ jsx17(SidebarNestedGroup, { group: item, currentHref }, item.id);
|
|
1471
1072
|
});
|
|
1472
1073
|
};
|
|
1473
1074
|
var SidebarItemList = ({ items, currentHref }) => {
|
|
1474
1075
|
const visibleItems = getVisibleNavItems(items);
|
|
1475
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsx17("ul", { className: "menu lg:w-[97%]", children: renderSidebarItems(visibleItems, currentHref) });
|
|
1476
1077
|
};
|
|
1477
1078
|
var SidebarNestedGroup = ({ group, currentHref }) => {
|
|
1478
1079
|
const groupHref = getGroupHref(group);
|
|
@@ -1483,14 +1084,14 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
|
|
|
1483
1084
|
const { isOpen, setIsOpen } = useAutoOpenDetails(`group:${group.id}`, isOpenByDefault, nestedHasActiveItem);
|
|
1484
1085
|
if (!isCollapsible) {
|
|
1485
1086
|
if (!group.title) {
|
|
1486
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ jsx17(Fragment4, { children: renderSidebarItems(visibleItems, currentHref) });
|
|
1487
1088
|
}
|
|
1488
|
-
return /* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1089
|
+
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
1090
|
+
/* @__PURE__ */ jsx17(SidebarGroupDivider, { title: group.title }),
|
|
1490
1091
|
renderSidebarItems(visibleItems, currentHref)
|
|
1491
1092
|
] });
|
|
1492
1093
|
}
|
|
1493
|
-
return /* @__PURE__ */
|
|
1094
|
+
return /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs14(
|
|
1494
1095
|
"details",
|
|
1495
1096
|
{
|
|
1496
1097
|
open: isOpen,
|
|
@@ -1498,7 +1099,7 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
|
|
|
1498
1099
|
setIsOpen(event.currentTarget.open);
|
|
1499
1100
|
},
|
|
1500
1101
|
children: [
|
|
1501
|
-
/* @__PURE__ */
|
|
1102
|
+
/* @__PURE__ */ jsx17("summary", { children: /* @__PURE__ */ jsx17(
|
|
1502
1103
|
SidebarGroupTitle,
|
|
1503
1104
|
{
|
|
1504
1105
|
title: group.title,
|
|
@@ -1507,7 +1108,7 @@ var SidebarNestedGroup = ({ group, currentHref }) => {
|
|
|
1507
1108
|
allowNavigation: Boolean(groupHref)
|
|
1508
1109
|
}
|
|
1509
1110
|
) }),
|
|
1510
|
-
visibleItems.length > 0 ? /* @__PURE__ */
|
|
1111
|
+
visibleItems.length > 0 ? /* @__PURE__ */ jsx17(SidebarItemList, { items: visibleItems, currentHref }) : null
|
|
1511
1112
|
]
|
|
1512
1113
|
}
|
|
1513
1114
|
) });
|
|
@@ -1519,7 +1120,7 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
|
|
|
1519
1120
|
section.id === activeSectionId,
|
|
1520
1121
|
sectionHasActiveItem
|
|
1521
1122
|
);
|
|
1522
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ jsx17("li", { className: "pb-4", children: /* @__PURE__ */ jsxs14(
|
|
1523
1124
|
"details",
|
|
1524
1125
|
{
|
|
1525
1126
|
open: isOpen,
|
|
@@ -1527,28 +1128,28 @@ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
|
|
|
1527
1128
|
setIsOpen(event.currentTarget.open);
|
|
1528
1129
|
},
|
|
1529
1130
|
children: [
|
|
1530
|
-
/* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ jsx17("summary", { children: /* @__PURE__ */ jsx17(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem }) }),
|
|
1132
|
+
/* @__PURE__ */ jsx17(SidebarItemList, { items: section.items, currentHref })
|
|
1532
1133
|
]
|
|
1533
1134
|
}
|
|
1534
1135
|
) });
|
|
1535
1136
|
};
|
|
1536
|
-
var Sidebar =
|
|
1137
|
+
var Sidebar = memo3(
|
|
1537
1138
|
({ currentHref: currentHrefProp = "", activeSectionId: activeSectionIdProp = "" }) => {
|
|
1538
|
-
const scrollContainerRef =
|
|
1539
|
-
const { urlPathname } =
|
|
1139
|
+
const scrollContainerRef = useRef2(null);
|
|
1140
|
+
const { urlPathname } = usePageContext3();
|
|
1540
1141
|
const currentHref = currentHrefProp || urlPathname;
|
|
1541
1142
|
const docs = useDocsGlobalContext();
|
|
1542
1143
|
const activeSectionId = activeSectionIdProp || getActiveSectionByPathname(docs, currentHref)?.id || "";
|
|
1543
1144
|
const { sidebarSections } = docs;
|
|
1544
|
-
return /* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ jsx17("aside", { className: "hidden basis-76 shrink-0 lg:block", children: /* @__PURE__ */ jsxs14("div", { className: "-ml-3 sticky top-14", children: [
|
|
1146
|
+
/* @__PURE__ */ jsx17("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" }),
|
|
1147
|
+
/* @__PURE__ */ jsx17(
|
|
1547
1148
|
"div",
|
|
1548
1149
|
{
|
|
1549
1150
|
ref: scrollContainerRef,
|
|
1550
1151
|
className: "pr-4 h-[calc(100svh-14*var(--spacing))] overflow-y-scroll relative z-10",
|
|
1551
|
-
children: /* @__PURE__ */
|
|
1152
|
+
children: /* @__PURE__ */ jsx17("ul", { className: cmMerge7("menu p-0 m-0 w-full px-0 pt-3 li:last-child:border-0"), children: sidebarSections.map((section) => /* @__PURE__ */ jsx17(
|
|
1552
1153
|
SidebarSectionGroup,
|
|
1553
1154
|
{
|
|
1554
1155
|
section,
|
|
@@ -1564,9 +1165,9 @@ var Sidebar = memo4(
|
|
|
1564
1165
|
);
|
|
1565
1166
|
|
|
1566
1167
|
// src/runtime/client/components/TableOfContents.tsx
|
|
1567
|
-
import
|
|
1168
|
+
import cm5, { cmMerge as cmMerge8 } from "@classmatejs/react";
|
|
1568
1169
|
import { Flame, TableOfContentsIcon } from "lucide-react";
|
|
1569
|
-
import { Fragment as
|
|
1170
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1570
1171
|
var TableOfContents = ({
|
|
1571
1172
|
headings: headingsProp = [],
|
|
1572
1173
|
tableOfContents: tableOfContentsProp = false,
|
|
@@ -1576,19 +1177,19 @@ var TableOfContents = ({
|
|
|
1576
1177
|
const { partners } = useDocsGlobalContext();
|
|
1577
1178
|
const effectiveHeadings = headingsProp;
|
|
1578
1179
|
const effectiveTableOfContents = tableOfContentsProp;
|
|
1579
|
-
return /* @__PURE__ */
|
|
1580
|
-
effectiveTableOfContents ? effectiveHeadings.length > 0 && /* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1180
|
+
return /* @__PURE__ */ jsx18("aside", { className: cmMerge8(effectiveTableOfContents ? "w-64" : "w-32", "hidden shrink-0 xl:block"), children: /* @__PURE__ */ jsx18("div", { className: "sticky top-14", children: /* @__PURE__ */ jsxs15("div", { className: "relative h-[calc(100svh-14*var(--spacing))] overflow-y-auto overflow-x-hidden pt-10 pb-8", children: [
|
|
1181
|
+
effectiveTableOfContents ? effectiveHeadings.length > 0 && /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
1182
|
+
/* @__PURE__ */ jsxs15("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
|
|
1183
|
+
/* @__PURE__ */ jsx18(TableOfContentsIcon, { className: "h-3 w-3" }),
|
|
1583
1184
|
"On this page"
|
|
1584
1185
|
] }),
|
|
1585
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ jsx18("nav", { "aria-label": "On this page", className: "mb-12", children: /* @__PURE__ */ jsx18("ul", { children: effectiveHeadings.map((heading) => /* @__PURE__ */ jsx18("li", { children: /* @__PURE__ */ jsx18(
|
|
1586
1187
|
"a",
|
|
1587
1188
|
{
|
|
1588
1189
|
href: `#${heading.id}`,
|
|
1589
1190
|
"aria-current": activeHeadingId === heading.id ? "location" : void 0,
|
|
1590
1191
|
onClick: () => setActiveHeadingId(heading.id),
|
|
1591
|
-
className:
|
|
1192
|
+
className: cmMerge8(
|
|
1592
1193
|
"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",
|
|
1593
1194
|
heading.depth > 2 ? "pl-6" : "pl-4",
|
|
1594
1195
|
activeHeadingId === heading.id ? "border-l-2 border-primary font-semibold text-base-content" : ""
|
|
@@ -1597,42 +1198,42 @@ var TableOfContents = ({
|
|
|
1597
1198
|
}
|
|
1598
1199
|
) }, heading.id)) }) })
|
|
1599
1200
|
] }) : null,
|
|
1600
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ jsx18(Adbar, { partners })
|
|
1601
1202
|
] }) }) });
|
|
1602
1203
|
};
|
|
1603
1204
|
var Adbar = ({ partners }) => {
|
|
1604
1205
|
if (partners.primary.length === 0 && partners.gold.length === 0) {
|
|
1605
1206
|
return null;
|
|
1606
1207
|
}
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1208
|
+
return /* @__PURE__ */ jsxs15("aside", { children: [
|
|
1209
|
+
/* @__PURE__ */ jsxs15("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
|
|
1210
|
+
/* @__PURE__ */ jsx18(Flame, { className: "h-3 w-3" }),
|
|
1610
1211
|
"Partners"
|
|
1611
1212
|
] }),
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
partners.primary.map((partner) => /* @__PURE__ */
|
|
1614
|
-
partners.gold.map((partner) => /* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ jsxs15("ul", { className: "grid grid-cols-[repeat(auto-fit,minmax(5.5rem,1fr))] gap-3 opacity-90", children: [
|
|
1214
|
+
partners.primary.map((partner) => /* @__PURE__ */ jsx18(AdbarItem, { className: "col-span-full", children: /* @__PURE__ */ jsx18(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx18(PartnerLogo, { partner }) }) }, partner.name)),
|
|
1215
|
+
partners.gold.map((partner) => /* @__PURE__ */ jsx18(AdbarItem, { children: /* @__PURE__ */ jsx18(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx18(PartnerLogo, { partner }) }) }, partner.name))
|
|
1615
1216
|
] })
|
|
1616
1217
|
] });
|
|
1617
1218
|
};
|
|
1618
1219
|
var PartnerLogo = ({
|
|
1619
1220
|
partner
|
|
1620
1221
|
}) => {
|
|
1621
|
-
return /* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
1223
|
+
/* @__PURE__ */ jsx18(
|
|
1623
1224
|
Image,
|
|
1624
1225
|
{
|
|
1625
1226
|
src: partner.logoLight,
|
|
1626
1227
|
width: 200,
|
|
1627
1228
|
height: 100,
|
|
1628
1229
|
alt: partner.logoAlt,
|
|
1629
|
-
className:
|
|
1230
|
+
className: cmMerge8("block", partner.logoDark ? "dark:hidden" : "dark:invert")
|
|
1630
1231
|
}
|
|
1631
1232
|
),
|
|
1632
|
-
partner.logoDark ? /* @__PURE__ */
|
|
1233
|
+
partner.logoDark ? /* @__PURE__ */ jsx18(Image, { src: partner.logoDark, width: 200, height: 100, alt: partner.logoAlt, className: "hidden dark:block" }) : null
|
|
1633
1234
|
] });
|
|
1634
1235
|
};
|
|
1635
|
-
var AdbarItem =
|
|
1236
|
+
var AdbarItem = cm5.div`
|
|
1636
1237
|
px-5
|
|
1637
1238
|
py-5
|
|
1638
1239
|
bg-base-200
|
|
@@ -1642,26 +1243,26 @@ var AdbarItem = cm6.div`
|
|
|
1642
1243
|
justify-center
|
|
1643
1244
|
rounded-field
|
|
1644
1245
|
`;
|
|
1645
|
-
var AdbarLink =
|
|
1246
|
+
var AdbarLink = cm5.a`
|
|
1646
1247
|
block
|
|
1647
1248
|
w-full
|
|
1648
1249
|
transition-opacity
|
|
1649
1250
|
hover:opacity-100
|
|
1650
1251
|
focus-visible:opacity-100
|
|
1651
1252
|
`;
|
|
1652
|
-
var Image =
|
|
1253
|
+
var Image = cm5.img`
|
|
1653
1254
|
mx-auto
|
|
1654
1255
|
w-24
|
|
1655
1256
|
`;
|
|
1656
1257
|
|
|
1657
1258
|
// src/runtime/client/components/TableOfContentsMobile.tsx
|
|
1658
|
-
import
|
|
1259
|
+
import cm6 from "@classmatejs/react";
|
|
1659
1260
|
import { TableOfContents as TableOfContents2 } from "lucide-react";
|
|
1660
1261
|
|
|
1661
1262
|
// src/runtime/client/components/BreadcrumbSidebarTrigger.tsx
|
|
1662
1263
|
import { ChevronLast, ChevronsRight } from "lucide-react";
|
|
1663
1264
|
import { useCallback as useCallback4 } from "react";
|
|
1664
|
-
import { jsx as
|
|
1265
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1665
1266
|
var dedupeBreadcrumbs = (items) => {
|
|
1666
1267
|
return items.filter((item, index) => index === 0 || items[index - 1]?.title !== item.title);
|
|
1667
1268
|
};
|
|
@@ -1696,18 +1297,18 @@ var BreadcrumbSidebarTrigger = ({ currentHref }) => {
|
|
|
1696
1297
|
const handleClick = useCallback4(() => {
|
|
1697
1298
|
alert("TODO: Open mobile menu");
|
|
1698
1299
|
}, []);
|
|
1699
|
-
return /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
/* @__PURE__ */
|
|
1702
|
-
index > 0 ? /* @__PURE__ */
|
|
1703
|
-
/* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ jsx19("button", { className: "cursor-pointer min-w-0 max-w-full hidden md:block", type: "button", onClick: handleClick, children: /* @__PURE__ */ jsxs16("span", { className: "flex items-center gap-1 min-w-0 overflow-hidden lg:hidden", children: [
|
|
1301
|
+
/* @__PURE__ */ jsx19(ChevronLast, { className: "w-4 h-4 shrink-0 text-primary" }),
|
|
1302
|
+
/* @__PURE__ */ jsx19("span", { className: "hidden md:flex items-center gap-1", children: breadcrumbItems.map((item, index) => /* @__PURE__ */ jsxs16("span", { className: "contents", children: [
|
|
1303
|
+
index > 0 ? /* @__PURE__ */ jsx19(ChevronsRight, { className: "w-4 h-4 shrink-0 text-base-muted-medium" }) : null,
|
|
1304
|
+
/* @__PURE__ */ jsx19("span", { className: index === 0 ? "font-semibold truncate" : "text-sm truncate", children: renderInlineMarkdown(item.title, { codeClassName: "text-sm!" }) })
|
|
1704
1305
|
] }, item.id)) })
|
|
1705
1306
|
] }) });
|
|
1706
1307
|
};
|
|
1707
1308
|
var BreadcrumbSidebarTrigger_default = BreadcrumbSidebarTrigger;
|
|
1708
1309
|
|
|
1709
1310
|
// src/runtime/client/components/TableOfContentsMobile.tsx
|
|
1710
|
-
import { Fragment as
|
|
1311
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1711
1312
|
var TableOfContentsMobile = ({
|
|
1712
1313
|
headings = [],
|
|
1713
1314
|
tableOfContents = false,
|
|
@@ -1718,13 +1319,13 @@ var TableOfContentsMobile = ({
|
|
|
1718
1319
|
}) => {
|
|
1719
1320
|
const topOptionValue = "__docs-page-top__";
|
|
1720
1321
|
const selectedValue = tableOfContents && headings.some((heading) => heading.id === activeHeadingId) ? activeHeadingId : "";
|
|
1721
|
-
return /* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
/* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
/* @__PURE__ */
|
|
1322
|
+
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
1323
|
+
/* @__PURE__ */ jsx20("div", { className: "h-12 xl:hidden" }),
|
|
1324
|
+
/* @__PURE__ */ jsx20(StyledTOC, { children: /* @__PURE__ */ jsxs17(StyledTOCInner, { children: [
|
|
1325
|
+
/* @__PURE__ */ jsx20(BreadcrumbSidebarTrigger_default, { currentHref }),
|
|
1326
|
+
/* @__PURE__ */ jsxs17("label", { className: "select select-sm md:w-80 w-full", htmlFor: "table-of-contents-select", children: [
|
|
1327
|
+
/* @__PURE__ */ jsx20("span", { className: "label flex", children: /* @__PURE__ */ jsx20(TableOfContents2, { className: "w-4 h-4" }) }),
|
|
1328
|
+
/* @__PURE__ */ jsxs17(
|
|
1728
1329
|
"select",
|
|
1729
1330
|
{
|
|
1730
1331
|
id: "table-of-contents-select",
|
|
@@ -1741,8 +1342,8 @@ var TableOfContentsMobile = ({
|
|
|
1741
1342
|
window.location.hash = encodeURIComponent(value);
|
|
1742
1343
|
},
|
|
1743
1344
|
children: [
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
tableOfContents && headings.map((heading) => /* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ jsx20("option", { value: topOptionValue, children: pageTitle }),
|
|
1346
|
+
tableOfContents && headings.map((heading) => /* @__PURE__ */ jsx20("option", { value: heading.id, children: heading.title }, heading.id))
|
|
1746
1347
|
]
|
|
1747
1348
|
}
|
|
1748
1349
|
)
|
|
@@ -1751,7 +1352,7 @@ var TableOfContentsMobile = ({
|
|
|
1751
1352
|
] });
|
|
1752
1353
|
};
|
|
1753
1354
|
var TableOfContentsMobile_default = TableOfContentsMobile;
|
|
1754
|
-
var StyledTOC =
|
|
1355
|
+
var StyledTOC = cm6.div`
|
|
1755
1356
|
block xl:hidden
|
|
1756
1357
|
fixed
|
|
1757
1358
|
bg-base-100 border-b-base-muted-light
|
|
@@ -1760,14 +1361,14 @@ var StyledTOC = cm7.div`
|
|
|
1760
1361
|
lg:w-[calc(100svw-80*var(--spacing))]
|
|
1761
1362
|
lg:left-80
|
|
1762
1363
|
`;
|
|
1763
|
-
var StyledTOCInner =
|
|
1364
|
+
var StyledTOCInner = cm6.div`
|
|
1764
1365
|
absolute inset-0 flex justify-between items-center
|
|
1765
1366
|
pr-4
|
|
1766
1367
|
px-4 lg:pl-14
|
|
1767
1368
|
`;
|
|
1768
1369
|
|
|
1769
1370
|
// src/runtime/client/components/useTableOfContentsState.ts
|
|
1770
|
-
import { useEffect as
|
|
1371
|
+
import { useEffect as useEffect8, useState as useState5 } from "react";
|
|
1771
1372
|
var getCurrentHash = () => {
|
|
1772
1373
|
try {
|
|
1773
1374
|
return decodeURIComponent(window.location.hash);
|
|
@@ -1849,10 +1450,10 @@ var updateActiveHeadingFromScroll = (setActiveHeadingId) => {
|
|
|
1849
1450
|
var useTableOfContentsState = ({
|
|
1850
1451
|
headings: routeHeadings = []
|
|
1851
1452
|
}) => {
|
|
1852
|
-
const [activeHeadingId, setActiveHeadingId] =
|
|
1853
|
-
const [domHeadings, setDomHeadings] =
|
|
1453
|
+
const [activeHeadingId, setActiveHeadingId] = useState5("");
|
|
1454
|
+
const [domHeadings, setDomHeadings] = useState5(routeHeadings);
|
|
1854
1455
|
const effectiveHeadings = domHeadings.length > 0 ? domHeadings : routeHeadings;
|
|
1855
|
-
|
|
1456
|
+
useEffect8(() => {
|
|
1856
1457
|
let scrollFrame = 0;
|
|
1857
1458
|
const syncActiveHeading = () => {
|
|
1858
1459
|
if (scrollFrame) {
|
|
@@ -1888,7 +1489,7 @@ var useTableOfContentsState = ({
|
|
|
1888
1489
|
window.removeEventListener("resize", syncActiveHeading);
|
|
1889
1490
|
};
|
|
1890
1491
|
}, []);
|
|
1891
|
-
|
|
1492
|
+
useEffect8(() => {
|
|
1892
1493
|
if (typeof window === "undefined") {
|
|
1893
1494
|
return;
|
|
1894
1495
|
}
|
|
@@ -1912,19 +1513,19 @@ var useTableOfContentsState = ({
|
|
|
1912
1513
|
};
|
|
1913
1514
|
|
|
1914
1515
|
// src/runtime/client/DocsLayout.tsx
|
|
1915
|
-
import { Fragment as
|
|
1516
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1916
1517
|
var DocsLayout = ({ children }) => {
|
|
1917
1518
|
const data = useData();
|
|
1918
1519
|
const { activeHeadingId, effectiveHeadings, setActiveHeadingId } = useTableOfContentsState({
|
|
1919
1520
|
headings: data.headings
|
|
1920
1521
|
});
|
|
1921
|
-
return /* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
1523
|
+
/* @__PURE__ */ jsx21(HeadingLinkCopy, {}),
|
|
1524
|
+
/* @__PURE__ */ jsx21("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" }),
|
|
1525
|
+
/* @__PURE__ */ jsx21(LayoutComponent, { children: /* @__PURE__ */ jsxs18("div", { className: "lg:flex gap-14", children: [
|
|
1526
|
+
/* @__PURE__ */ jsx21(Sidebar, { currentHref: data.page.href, activeSectionId: data.page.sectionId }),
|
|
1527
|
+
/* @__PURE__ */ jsxs18("main", { className: "min-w-0 flex-1 basis-auto shrink", children: [
|
|
1528
|
+
/* @__PURE__ */ jsx21(
|
|
1928
1529
|
TableOfContentsMobile_default,
|
|
1929
1530
|
{
|
|
1930
1531
|
headings: effectiveHeadings,
|
|
@@ -1935,11 +1536,11 @@ var DocsLayout = ({ children }) => {
|
|
|
1935
1536
|
setActiveHeadingId
|
|
1936
1537
|
}
|
|
1937
1538
|
),
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ jsx21("div", { className: "mt-10 min-w-0", children }),
|
|
1540
|
+
/* @__PURE__ */ jsx21(DocsPagination, { previousPage: data.previousPage, nextPage: data.nextPage }),
|
|
1541
|
+
/* @__PURE__ */ jsx21(DocsFooter, {})
|
|
1941
1542
|
] }),
|
|
1942
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ jsx21(
|
|
1943
1544
|
TableOfContents,
|
|
1944
1545
|
{
|
|
1945
1546
|
headings: effectiveHeadings,
|
|
@@ -1954,7 +1555,7 @@ var DocsLayout = ({ children }) => {
|
|
|
1954
1555
|
|
|
1955
1556
|
// src/runtime/client/DocsPage.tsx
|
|
1956
1557
|
import { useData as useData2 } from "vike-react/useData";
|
|
1957
|
-
import { usePageContext as
|
|
1558
|
+
import { usePageContext as usePageContext4 } from "vike-react/usePageContext";
|
|
1958
1559
|
|
|
1959
1560
|
// src/runtime/client/getMdxRuntimeValue.tsx
|
|
1960
1561
|
var isExternalHref = (href) => {
|
|
@@ -2050,32 +1651,27 @@ var getMdxRuntimeValue = (options) => {
|
|
|
2050
1651
|
};
|
|
2051
1652
|
|
|
2052
1653
|
// src/runtime/client/DocsPage.tsx
|
|
2053
|
-
import { jsx as
|
|
1654
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2054
1655
|
var DocsPage = ({ Content }) => {
|
|
2055
|
-
const pageContext =
|
|
1656
|
+
const pageContext = usePageContext4();
|
|
2056
1657
|
const docs = useDocsGlobalContext();
|
|
2057
1658
|
const { page } = useData2();
|
|
2058
|
-
return /* @__PURE__ */
|
|
1659
|
+
return /* @__PURE__ */ jsx22(
|
|
2059
1660
|
UniversalMdxProvider,
|
|
2060
1661
|
{
|
|
2061
1662
|
value: getMdxRuntimeValue({
|
|
2062
1663
|
docs,
|
|
2063
1664
|
currentPathname: pageContext.urlPathname
|
|
2064
1665
|
}),
|
|
2065
|
-
children: /* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
1666
|
+
children: /* @__PURE__ */ jsxs19(ProseContainer, { "data-doc-content": "", children: [
|
|
1667
|
+
/* @__PURE__ */ jsx22("h1", { className: "scroll-mt-32 xl:scroll-mt-24", children: renderInlineMarkdown(page.title) }),
|
|
1668
|
+
/* @__PURE__ */ jsx22(Content, {})
|
|
2068
1669
|
] })
|
|
2069
1670
|
}
|
|
2070
1671
|
);
|
|
2071
1672
|
};
|
|
2072
1673
|
|
|
2073
1674
|
export {
|
|
2074
|
-
useDocsSearchStore,
|
|
2075
|
-
useDocsSearchActions,
|
|
2076
|
-
useDocsSidebarStore,
|
|
2077
|
-
useDocsSidebarActions,
|
|
2078
|
-
LayoutComponent,
|
|
2079
1675
|
useDocsUserSettingsStore,
|
|
2080
1676
|
DEFAULT_THEME_PREFERENCE,
|
|
2081
1677
|
applyThemePreference,
|
|
@@ -2086,4 +1682,4 @@ export {
|
|
|
2086
1682
|
DocsLayout,
|
|
2087
1683
|
DocsPage
|
|
2088
1684
|
};
|
|
2089
|
-
//# sourceMappingURL=chunk-
|
|
1685
|
+
//# sourceMappingURL=chunk-SH5XWPXW.js.map
|