boltdocs 1.4.0 → 1.5.0
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/dist/{SearchDialog-FBNGKRPK.mjs → SearchDialog-5ISK64QY.mjs} +1 -1
- package/dist/{SearchDialog-O3V36MXA.css → SearchDialog-CEVPEMT3.css} +54 -5
- package/dist/{cache-GQHF6BXI.mjs → cache-KNL5B4EE.mjs} +1 -1
- package/dist/{chunk-CYBWLFOG.mjs → chunk-FFBNU6IJ.mjs} +2 -1
- package/dist/{chunk-D7YBQG6H.mjs → chunk-FMQ4HRKZ.mjs} +311 -133
- package/dist/client/index.css +54 -5
- package/dist/client/index.d.mts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +624 -475
- package/dist/client/index.mjs +2 -4
- package/dist/client/ssr.css +54 -5
- package/dist/client/ssr.d.mts +1 -1
- package/dist/client/ssr.d.ts +1 -1
- package/dist/client/ssr.js +544 -395
- package/dist/client/ssr.mjs +1 -1
- package/dist/{config-BD5ZHz15.d.mts → config-DkZg5aCf.d.mts} +2 -0
- package/dist/{config-BD5ZHz15.d.ts → config-DkZg5aCf.d.ts} +2 -0
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +24 -17
- package/dist/node/index.mjs +25 -19
- package/dist/{types-CvrzTbEX.d.mts → types-DGIo1VKD.d.mts} +2 -0
- package/dist/{types-CvrzTbEX.d.ts → types-DGIo1VKD.d.ts} +2 -0
- package/package.json +1 -1
- package/src/client/app/index.tsx +2 -12
- package/src/client/app/preload.tsx +3 -1
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -11
- package/src/client/theme/styles/markdown.css +1 -5
- package/src/client/theme/ui/Link/Link.tsx +156 -18
- package/src/client/theme/ui/Link/LinkPreview.tsx +64 -0
- package/src/client/theme/ui/Link/link-preview.css +64 -0
- package/src/client/types.ts +2 -0
- package/src/node/config.ts +15 -6
- package/src/node/mdx.ts +11 -4
- package/src/node/routes/parser.ts +24 -2
- package/src/node/ssg/index.ts +1 -10
- package/src/node/utils.ts +4 -1
- package/dist/CodeBlock-QYIKJMEB.mjs +0 -7
- package/dist/chunk-KS5B3O6W.mjs +0 -43
package/dist/client/index.js
CHANGED
|
@@ -58,7 +58,7 @@ function PreloadProvider({
|
|
|
58
58
|
},
|
|
59
59
|
[routes, modules]
|
|
60
60
|
);
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreloadContext.Provider, { value: { preload }, children });
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreloadContext.Provider, { value: { preload, routes }, children });
|
|
62
62
|
}
|
|
63
63
|
var import_react, import_jsx_runtime, PreloadContext;
|
|
64
64
|
var init_preload = __esm({
|
|
@@ -68,11 +68,78 @@ var init_preload = __esm({
|
|
|
68
68
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
69
69
|
PreloadContext = (0, import_react.createContext)({
|
|
70
70
|
preload: () => {
|
|
71
|
-
}
|
|
71
|
+
},
|
|
72
|
+
routes: []
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
|
|
77
|
+
// src/client/theme/ui/Link/link-preview.css
|
|
78
|
+
var init_link_preview = __esm({
|
|
79
|
+
"src/client/theme/ui/Link/link-preview.css"() {
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// src/client/theme/ui/Link/LinkPreview.tsx
|
|
84
|
+
function LinkPreview({
|
|
85
|
+
isVisible,
|
|
86
|
+
title,
|
|
87
|
+
summary,
|
|
88
|
+
x,
|
|
89
|
+
y
|
|
90
|
+
}) {
|
|
91
|
+
const [mounted, setMounted] = (0, import_react2.useState)(false);
|
|
92
|
+
const ref = (0, import_react2.useRef)(null);
|
|
93
|
+
const [position, setPosition] = (0, import_react2.useState)({ top: 0, left: 0 });
|
|
94
|
+
(0, import_react2.useEffect)(() => {
|
|
95
|
+
setMounted(true);
|
|
96
|
+
}, []);
|
|
97
|
+
(0, import_react2.useEffect)(() => {
|
|
98
|
+
if (isVisible && ref.current) {
|
|
99
|
+
const rect = ref.current.getBoundingClientRect();
|
|
100
|
+
const padding = 15;
|
|
101
|
+
let top = y + padding;
|
|
102
|
+
let left = x + padding;
|
|
103
|
+
if (left + rect.width > window.innerWidth) {
|
|
104
|
+
left = x - rect.width - padding;
|
|
105
|
+
}
|
|
106
|
+
if (top + rect.height > window.innerHeight) {
|
|
107
|
+
top = y - rect.height - padding;
|
|
108
|
+
}
|
|
109
|
+
setPosition({ top, left });
|
|
110
|
+
}
|
|
111
|
+
}, [isVisible, x, y]);
|
|
112
|
+
if (!mounted) return null;
|
|
113
|
+
return (0, import_react_dom.createPortal)(
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
ref,
|
|
118
|
+
className: `boltdocs-link-preview ${isVisible ? "is-visible" : ""}`,
|
|
119
|
+
style: {
|
|
120
|
+
top: position.top,
|
|
121
|
+
left: position.left
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "boltdocs-link-preview-title", children: title }),
|
|
125
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "boltdocs-link-preview-summary", children: summary })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
document.body
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
var import_react2, import_react_dom, import_jsx_runtime2;
|
|
133
|
+
var init_LinkPreview = __esm({
|
|
134
|
+
"src/client/theme/ui/Link/LinkPreview.tsx"() {
|
|
135
|
+
"use strict";
|
|
136
|
+
import_react2 = require("react");
|
|
137
|
+
import_react_dom = require("react-dom");
|
|
138
|
+
init_link_preview();
|
|
139
|
+
import_jsx_runtime2 = require("react/jsx-runtime");
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
76
143
|
// src/client/theme/ui/Link/Link.tsx
|
|
77
144
|
function useLocalizedTo(to) {
|
|
78
145
|
const location = (0, import_react_router_dom.useLocation)();
|
|
@@ -129,33 +196,64 @@ function useLocalizedTo(to) {
|
|
|
129
196
|
}
|
|
130
197
|
return finalPath === basePath ? basePath : finalPath;
|
|
131
198
|
}
|
|
132
|
-
var
|
|
199
|
+
var import_react3, import_react_router_dom, import_jsx_runtime3, Link, NavLink;
|
|
133
200
|
var init_Link = __esm({
|
|
134
201
|
"src/client/theme/ui/Link/Link.tsx"() {
|
|
135
202
|
"use strict";
|
|
136
|
-
|
|
203
|
+
import_react3 = __toESM(require("react"));
|
|
137
204
|
import_react_router_dom = require("react-router-dom");
|
|
138
205
|
init_preload();
|
|
139
206
|
init_app();
|
|
140
|
-
|
|
141
|
-
|
|
207
|
+
init_LinkPreview();
|
|
208
|
+
import_jsx_runtime3 = require("react/jsx-runtime");
|
|
209
|
+
Link = import_react3.default.forwardRef(
|
|
142
210
|
(props, ref) => {
|
|
143
211
|
const {
|
|
144
212
|
boltdocsPrefetch = "hover",
|
|
213
|
+
boltdocsPreview = true,
|
|
145
214
|
onMouseEnter,
|
|
215
|
+
onMouseLeave,
|
|
146
216
|
onFocus,
|
|
217
|
+
onBlur,
|
|
147
218
|
onClick,
|
|
148
219
|
to,
|
|
149
220
|
...rest
|
|
150
221
|
} = props;
|
|
151
222
|
const localizedTo = useLocalizedTo(to);
|
|
152
|
-
const { preload } = usePreload();
|
|
223
|
+
const { preload, routes } = usePreload();
|
|
224
|
+
const config = useConfig();
|
|
153
225
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
226
|
+
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
227
|
+
const [preview, setPreview] = import_react3.default.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
154
228
|
const handleMouseEnter = (e) => {
|
|
155
229
|
onMouseEnter?.(e);
|
|
156
230
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
157
231
|
preload(localizedTo);
|
|
158
232
|
}
|
|
233
|
+
if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
234
|
+
const cleanPath = localizedTo.split("#")[0].split("?")[0];
|
|
235
|
+
const route = routes.find(
|
|
236
|
+
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
237
|
+
);
|
|
238
|
+
if (route) {
|
|
239
|
+
setPreview({
|
|
240
|
+
visible: true,
|
|
241
|
+
x: e.clientX,
|
|
242
|
+
y: e.clientY,
|
|
243
|
+
title: route.title,
|
|
244
|
+
summary: route.description
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const handleMouseMove = (e) => {
|
|
250
|
+
if (preview.visible) {
|
|
251
|
+
setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const handleMouseLeave = (e) => {
|
|
255
|
+
onMouseLeave?.(e);
|
|
256
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
159
257
|
};
|
|
160
258
|
const handleFocus = (e) => {
|
|
161
259
|
onFocus?.(e);
|
|
@@ -163,50 +261,100 @@ var init_Link = __esm({
|
|
|
163
261
|
preload(localizedTo);
|
|
164
262
|
}
|
|
165
263
|
};
|
|
264
|
+
const handleBlur = (e) => {
|
|
265
|
+
onBlur?.(e);
|
|
266
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
267
|
+
};
|
|
166
268
|
const handleClick = (e) => {
|
|
167
269
|
onClick?.(e);
|
|
270
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
168
271
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
169
272
|
return;
|
|
170
273
|
}
|
|
171
274
|
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
172
275
|
e.preventDefault();
|
|
173
|
-
|
|
276
|
+
import_react3.default.startTransition(() => {
|
|
174
277
|
navigate(localizedTo);
|
|
175
278
|
});
|
|
176
279
|
}
|
|
177
280
|
};
|
|
178
|
-
return /* @__PURE__ */ (0,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
283
|
+
import_react_router_dom.Link,
|
|
284
|
+
{
|
|
285
|
+
ref,
|
|
286
|
+
to: localizedTo,
|
|
287
|
+
onMouseEnter: handleMouseEnter,
|
|
288
|
+
onMouseMove: handleMouseMove,
|
|
289
|
+
onMouseLeave: handleMouseLeave,
|
|
290
|
+
onFocus: handleFocus,
|
|
291
|
+
onBlur: handleBlur,
|
|
292
|
+
onClick: handleClick,
|
|
293
|
+
...rest
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
297
|
+
LinkPreview,
|
|
298
|
+
{
|
|
299
|
+
isVisible: preview.visible,
|
|
300
|
+
title: preview.title,
|
|
301
|
+
summary: preview.summary,
|
|
302
|
+
x: preview.x,
|
|
303
|
+
y: preview.y
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] });
|
|
189
307
|
}
|
|
190
308
|
);
|
|
191
309
|
Link.displayName = "Link";
|
|
192
|
-
NavLink =
|
|
310
|
+
NavLink = import_react3.default.forwardRef(
|
|
193
311
|
(props, ref) => {
|
|
194
312
|
const {
|
|
195
313
|
boltdocsPrefetch = "hover",
|
|
314
|
+
boltdocsPreview = true,
|
|
196
315
|
onMouseEnter,
|
|
316
|
+
onMouseLeave,
|
|
197
317
|
onFocus,
|
|
318
|
+
onBlur,
|
|
198
319
|
onClick,
|
|
199
320
|
to,
|
|
200
321
|
...rest
|
|
201
322
|
} = props;
|
|
202
323
|
const localizedTo = useLocalizedTo(to);
|
|
203
|
-
const { preload } = usePreload();
|
|
324
|
+
const { preload, routes } = usePreload();
|
|
325
|
+
const config = useConfig();
|
|
204
326
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
327
|
+
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
328
|
+
const [preview, setPreview] = import_react3.default.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
205
329
|
const handleMouseEnter = (e) => {
|
|
206
330
|
onMouseEnter?.(e);
|
|
207
331
|
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
208
332
|
preload(localizedTo);
|
|
209
333
|
}
|
|
334
|
+
if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
335
|
+
const cleanPath = localizedTo.split("#")[0].split("?")[0];
|
|
336
|
+
const route = routes.find(
|
|
337
|
+
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
338
|
+
);
|
|
339
|
+
if (route) {
|
|
340
|
+
setPreview({
|
|
341
|
+
visible: true,
|
|
342
|
+
x: e.clientX,
|
|
343
|
+
y: e.clientY,
|
|
344
|
+
title: route.title,
|
|
345
|
+
summary: route.description
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const handleMouseMove = (e) => {
|
|
351
|
+
if (preview.visible) {
|
|
352
|
+
setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
const handleMouseLeave = (e) => {
|
|
356
|
+
onMouseLeave?.(e);
|
|
357
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
210
358
|
};
|
|
211
359
|
const handleFocus = (e) => {
|
|
212
360
|
onFocus?.(e);
|
|
@@ -214,29 +362,49 @@ var init_Link = __esm({
|
|
|
214
362
|
preload(localizedTo);
|
|
215
363
|
}
|
|
216
364
|
};
|
|
365
|
+
const handleBlur = (e) => {
|
|
366
|
+
onBlur?.(e);
|
|
367
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
368
|
+
};
|
|
217
369
|
const handleClick = (e) => {
|
|
218
370
|
onClick?.(e);
|
|
371
|
+
setPreview((prev) => ({ ...prev, visible: false }));
|
|
219
372
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
220
373
|
return;
|
|
221
374
|
}
|
|
222
375
|
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
223
376
|
e.preventDefault();
|
|
224
|
-
|
|
377
|
+
import_react3.default.startTransition(() => {
|
|
225
378
|
navigate(localizedTo);
|
|
226
379
|
});
|
|
227
380
|
}
|
|
228
381
|
};
|
|
229
|
-
return /* @__PURE__ */ (0,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
383
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
384
|
+
import_react_router_dom.NavLink,
|
|
385
|
+
{
|
|
386
|
+
ref,
|
|
387
|
+
to: localizedTo,
|
|
388
|
+
onMouseEnter: handleMouseEnter,
|
|
389
|
+
onMouseMove: handleMouseMove,
|
|
390
|
+
onMouseLeave: handleMouseLeave,
|
|
391
|
+
onFocus: handleFocus,
|
|
392
|
+
onBlur: handleBlur,
|
|
393
|
+
onClick: handleClick,
|
|
394
|
+
...rest
|
|
395
|
+
}
|
|
396
|
+
),
|
|
397
|
+
shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
398
|
+
LinkPreview,
|
|
399
|
+
{
|
|
400
|
+
isVisible: preview.visible,
|
|
401
|
+
title: preview.title,
|
|
402
|
+
summary: preview.summary,
|
|
403
|
+
x: preview.x,
|
|
404
|
+
y: preview.y
|
|
405
|
+
}
|
|
406
|
+
)
|
|
407
|
+
] });
|
|
240
408
|
}
|
|
241
409
|
);
|
|
242
410
|
NavLink.displayName = "NavLink";
|
|
@@ -267,11 +435,11 @@ function LanguageSwitcher({
|
|
|
267
435
|
currentLocale,
|
|
268
436
|
allRoutes
|
|
269
437
|
}) {
|
|
270
|
-
const [isOpen, setIsOpen] = (0,
|
|
271
|
-
const dropdownRef = (0,
|
|
438
|
+
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
439
|
+
const dropdownRef = (0, import_react4.useRef)(null);
|
|
272
440
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
273
441
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
274
|
-
(0,
|
|
442
|
+
(0, import_react4.useEffect)(() => {
|
|
275
443
|
function handleClickOutside(event) {
|
|
276
444
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
277
445
|
setIsOpen(false);
|
|
@@ -307,8 +475,8 @@ function LanguageSwitcher({
|
|
|
307
475
|
}
|
|
308
476
|
navigate(targetPath);
|
|
309
477
|
};
|
|
310
|
-
return /* @__PURE__ */ (0,
|
|
311
|
-
/* @__PURE__ */ (0,
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "boltdocs-language-switcher", ref: dropdownRef, children: [
|
|
479
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
312
480
|
"button",
|
|
313
481
|
{
|
|
314
482
|
className: "language-btn",
|
|
@@ -317,13 +485,13 @@ function LanguageSwitcher({
|
|
|
317
485
|
"aria-expanded": isOpen,
|
|
318
486
|
"aria-haspopup": "listbox",
|
|
319
487
|
children: [
|
|
320
|
-
/* @__PURE__ */ (0,
|
|
321
|
-
/* @__PURE__ */ (0,
|
|
322
|
-
/* @__PURE__ */ (0,
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Globe, { size: 18 }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "language-label", children: i18n.locales[currentLocale] || currentLocale }),
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronDown, { size: 14 })
|
|
323
491
|
]
|
|
324
492
|
}
|
|
325
493
|
),
|
|
326
|
-
isOpen && /* @__PURE__ */ (0,
|
|
494
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "language-dropdown", children: Object.entries(i18n.locales).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
327
495
|
"button",
|
|
328
496
|
{
|
|
329
497
|
className: `language-option ${key === currentLocale ? "active" : ""}`,
|
|
@@ -334,14 +502,14 @@ function LanguageSwitcher({
|
|
|
334
502
|
)) })
|
|
335
503
|
] });
|
|
336
504
|
}
|
|
337
|
-
var
|
|
505
|
+
var import_react4, import_lucide_react, import_react_router_dom2, import_jsx_runtime4;
|
|
338
506
|
var init_LanguageSwitcher = __esm({
|
|
339
507
|
"src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx"() {
|
|
340
508
|
"use strict";
|
|
341
|
-
|
|
509
|
+
import_react4 = require("react");
|
|
342
510
|
import_lucide_react = require("lucide-react");
|
|
343
511
|
import_react_router_dom2 = require("react-router-dom");
|
|
344
|
-
|
|
512
|
+
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
345
513
|
}
|
|
346
514
|
});
|
|
347
515
|
|
|
@@ -370,11 +538,11 @@ function VersionSwitcher({
|
|
|
370
538
|
currentLocale,
|
|
371
539
|
allRoutes
|
|
372
540
|
}) {
|
|
373
|
-
const [isOpen, setIsOpen] = (0,
|
|
374
|
-
const dropdownRef = (0,
|
|
541
|
+
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
542
|
+
const dropdownRef = (0, import_react5.useRef)(null);
|
|
375
543
|
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
376
544
|
const location = (0, import_react_router_dom3.useLocation)();
|
|
377
|
-
(0,
|
|
545
|
+
(0, import_react5.useEffect)(() => {
|
|
378
546
|
function handleClickOutside(event) {
|
|
379
547
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
380
548
|
setIsOpen(false);
|
|
@@ -408,14 +576,14 @@ function VersionSwitcher({
|
|
|
408
576
|
}
|
|
409
577
|
navigate(targetPath);
|
|
410
578
|
};
|
|
411
|
-
return /* @__PURE__ */ (0,
|
|
579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
412
580
|
"div",
|
|
413
581
|
{
|
|
414
582
|
className: "boltdocs-version-switcher",
|
|
415
583
|
ref: dropdownRef,
|
|
416
584
|
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
417
585
|
children: [
|
|
418
|
-
/* @__PURE__ */ (0,
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
419
587
|
"button",
|
|
420
588
|
{
|
|
421
589
|
className: "navbar-version",
|
|
@@ -429,12 +597,12 @@ function VersionSwitcher({
|
|
|
429
597
|
marginLeft: "0.5rem"
|
|
430
598
|
},
|
|
431
599
|
children: [
|
|
432
|
-
/* @__PURE__ */ (0,
|
|
433
|
-
/* @__PURE__ */ (0,
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: versions.versions[currentVersion] || currentVersion }),
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.ChevronDown, { size: 14 })
|
|
434
602
|
]
|
|
435
603
|
}
|
|
436
604
|
),
|
|
437
|
-
isOpen && /* @__PURE__ */ (0,
|
|
605
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
438
606
|
"div",
|
|
439
607
|
{
|
|
440
608
|
className: "language-dropdown",
|
|
@@ -444,7 +612,7 @@ function VersionSwitcher({
|
|
|
444
612
|
minWidth: "150px",
|
|
445
613
|
top: "calc(100% + 8px)"
|
|
446
614
|
},
|
|
447
|
-
children: Object.entries(versions.versions).map(([key, label]) => /* @__PURE__ */ (0,
|
|
615
|
+
children: Object.entries(versions.versions).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
448
616
|
"button",
|
|
449
617
|
{
|
|
450
618
|
className: `language-option ${key === currentVersion ? "active" : ""}`,
|
|
@@ -459,14 +627,14 @@ function VersionSwitcher({
|
|
|
459
627
|
}
|
|
460
628
|
);
|
|
461
629
|
}
|
|
462
|
-
var
|
|
630
|
+
var import_react5, import_lucide_react2, import_react_router_dom3, import_jsx_runtime5;
|
|
463
631
|
var init_VersionSwitcher = __esm({
|
|
464
632
|
"src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx"() {
|
|
465
633
|
"use strict";
|
|
466
|
-
|
|
634
|
+
import_react5 = require("react");
|
|
467
635
|
import_lucide_react2 = require("lucide-react");
|
|
468
636
|
import_react_router_dom3 = require("react-router-dom");
|
|
469
|
-
|
|
637
|
+
import_jsx_runtime5 = require("react/jsx-runtime");
|
|
470
638
|
}
|
|
471
639
|
});
|
|
472
640
|
|
|
@@ -480,9 +648,9 @@ var init_VersionSwitcher2 = __esm({
|
|
|
480
648
|
|
|
481
649
|
// src/client/theme/ui/ThemeToggle/ThemeToggle.tsx
|
|
482
650
|
function ThemeToggle() {
|
|
483
|
-
const [theme, setTheme] = (0,
|
|
484
|
-
const [mounted, setMounted] = (0,
|
|
485
|
-
(0,
|
|
651
|
+
const [theme, setTheme] = (0, import_react6.useState)("dark");
|
|
652
|
+
const [mounted, setMounted] = (0, import_react6.useState)(false);
|
|
653
|
+
(0, import_react6.useEffect)(() => {
|
|
486
654
|
setMounted(true);
|
|
487
655
|
const stored = localStorage.getItem("boltdocs-theme");
|
|
488
656
|
if (stored === "light" || stored === "dark") {
|
|
@@ -502,7 +670,7 @@ function ThemeToggle() {
|
|
|
502
670
|
mediaQuery.addEventListener("change", handleChange);
|
|
503
671
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
504
672
|
}, []);
|
|
505
|
-
(0,
|
|
673
|
+
(0, import_react6.useEffect)(() => {
|
|
506
674
|
if (!mounted) return;
|
|
507
675
|
const root = document.documentElement;
|
|
508
676
|
if (theme === "light") {
|
|
@@ -519,26 +687,26 @@ function ThemeToggle() {
|
|
|
519
687
|
localStorage.setItem("boltdocs-theme", newTheme);
|
|
520
688
|
};
|
|
521
689
|
if (!mounted) {
|
|
522
|
-
return /* @__PURE__ */ (0,
|
|
690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "navbar-icon-btn", "aria-label": "Toggle theme", disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { width: 20, height: 20, display: "inline-block" } }) });
|
|
523
691
|
}
|
|
524
|
-
return /* @__PURE__ */ (0,
|
|
692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
525
693
|
"button",
|
|
526
694
|
{
|
|
527
695
|
className: "navbar-icon-btn",
|
|
528
696
|
onClick: toggleTheme,
|
|
529
697
|
"aria-label": "Toggle theme",
|
|
530
698
|
title: `Switch to ${theme === "dark" ? "light" : "dark"} theme`,
|
|
531
|
-
children: theme === "dark" ? /* @__PURE__ */ (0,
|
|
699
|
+
children: theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Sun, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Moon, { size: 20 })
|
|
532
700
|
}
|
|
533
701
|
);
|
|
534
702
|
}
|
|
535
|
-
var
|
|
703
|
+
var import_react6, import_lucide_react3, import_jsx_runtime6;
|
|
536
704
|
var init_ThemeToggle = __esm({
|
|
537
705
|
"src/client/theme/ui/ThemeToggle/ThemeToggle.tsx"() {
|
|
538
706
|
"use strict";
|
|
539
|
-
|
|
707
|
+
import_react6 = require("react");
|
|
540
708
|
import_lucide_react3 = require("lucide-react");
|
|
541
|
-
|
|
709
|
+
import_jsx_runtime6 = require("react/jsx-runtime");
|
|
542
710
|
}
|
|
543
711
|
});
|
|
544
712
|
|
|
@@ -551,12 +719,12 @@ var init_ThemeToggle2 = __esm({
|
|
|
551
719
|
});
|
|
552
720
|
|
|
553
721
|
// src/client/theme/icons/discord.tsx
|
|
554
|
-
var
|
|
722
|
+
var import_jsx_runtime7, Discord;
|
|
555
723
|
var init_discord = __esm({
|
|
556
724
|
"src/client/theme/icons/discord.tsx"() {
|
|
557
725
|
"use strict";
|
|
558
|
-
|
|
559
|
-
Discord = (props) => /* @__PURE__ */ (0,
|
|
726
|
+
import_jsx_runtime7 = require("react/jsx-runtime");
|
|
727
|
+
Discord = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { ...props, viewBox: "0 0 256 199", preserveAspectRatio: "xMidYMid", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
560
728
|
"path",
|
|
561
729
|
{
|
|
562
730
|
d: "M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z",
|
|
@@ -567,12 +735,12 @@ var init_discord = __esm({
|
|
|
567
735
|
});
|
|
568
736
|
|
|
569
737
|
// src/client/theme/icons/twitter.tsx
|
|
570
|
-
var
|
|
738
|
+
var import_jsx_runtime8, XformerlyTwitter;
|
|
571
739
|
var init_twitter = __esm({
|
|
572
740
|
"src/client/theme/icons/twitter.tsx"() {
|
|
573
741
|
"use strict";
|
|
574
|
-
|
|
575
|
-
XformerlyTwitter = (props) => /* @__PURE__ */ (0,
|
|
742
|
+
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
743
|
+
XformerlyTwitter = (props) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { ...props, fill: "none", viewBox: "0 0 1200 1227", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
576
744
|
"path",
|
|
577
745
|
{
|
|
578
746
|
fill: "currentColor",
|
|
@@ -583,12 +751,12 @@ var init_twitter = __esm({
|
|
|
583
751
|
});
|
|
584
752
|
|
|
585
753
|
// src/client/theme/icons/github.tsx
|
|
586
|
-
var
|
|
754
|
+
var import_jsx_runtime9, GitHub;
|
|
587
755
|
var init_github = __esm({
|
|
588
756
|
"src/client/theme/icons/github.tsx"() {
|
|
589
757
|
"use strict";
|
|
590
|
-
|
|
591
|
-
GitHub = (props) => /* @__PURE__ */ (0,
|
|
758
|
+
import_jsx_runtime9 = require("react/jsx-runtime");
|
|
759
|
+
GitHub = (props) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { ...props, viewBox: "0 0 1024 1024", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
592
760
|
"path",
|
|
593
761
|
{
|
|
594
762
|
fillRule: "evenodd",
|
|
@@ -642,13 +810,13 @@ var init_utils = __esm({
|
|
|
642
810
|
|
|
643
811
|
// src/client/theme/ui/Navbar/GithubStars.tsx
|
|
644
812
|
function GithubStars({ repo }) {
|
|
645
|
-
const [stars, setStars] = (0,
|
|
646
|
-
(0,
|
|
813
|
+
const [stars, setStars] = (0, import_react7.useState)(null);
|
|
814
|
+
(0, import_react7.useEffect)(() => {
|
|
647
815
|
if (repo) {
|
|
648
816
|
getStarsRepo(repo).then((stars2) => setStars(stars2)).catch(() => setStars("0"));
|
|
649
817
|
}
|
|
650
818
|
}, [repo]);
|
|
651
|
-
return /* @__PURE__ */ (0,
|
|
819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
652
820
|
"a",
|
|
653
821
|
{
|
|
654
822
|
href: `https://github.com/${repo}`,
|
|
@@ -656,29 +824,29 @@ function GithubStars({ repo }) {
|
|
|
656
824
|
rel: "noopener noreferrer",
|
|
657
825
|
className: "navbar-github-stars",
|
|
658
826
|
children: [
|
|
659
|
-
/* @__PURE__ */ (0,
|
|
660
|
-
stars && /* @__PURE__ */ (0,
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GitHub, {}),
|
|
828
|
+
stars && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: stars })
|
|
661
829
|
]
|
|
662
830
|
}
|
|
663
831
|
);
|
|
664
832
|
}
|
|
665
|
-
var
|
|
833
|
+
var import_react7, import_jsx_runtime10;
|
|
666
834
|
var init_GithubStars = __esm({
|
|
667
835
|
"src/client/theme/ui/Navbar/GithubStars.tsx"() {
|
|
668
836
|
"use strict";
|
|
669
|
-
|
|
837
|
+
import_react7 = require("react");
|
|
670
838
|
init_github();
|
|
671
839
|
init_utils();
|
|
672
|
-
|
|
840
|
+
import_jsx_runtime10 = require("react/jsx-runtime");
|
|
673
841
|
}
|
|
674
842
|
});
|
|
675
843
|
|
|
676
844
|
// src/client/theme/ui/SearchDialog/SearchDialog.tsx
|
|
677
845
|
function SearchDialog({ routes }) {
|
|
678
|
-
const [isOpen, setIsOpen] = (0,
|
|
679
|
-
const [query, setQuery] = (0,
|
|
680
|
-
const inputRef = (0,
|
|
681
|
-
(0,
|
|
846
|
+
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
847
|
+
const [query, setQuery] = (0, import_react8.useState)("");
|
|
848
|
+
const inputRef = (0, import_react8.useRef)(null);
|
|
849
|
+
(0, import_react8.useEffect)(() => {
|
|
682
850
|
const handleKeyDown = (e) => {
|
|
683
851
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
684
852
|
e.preventDefault();
|
|
@@ -691,14 +859,14 @@ function SearchDialog({ routes }) {
|
|
|
691
859
|
window.addEventListener("keydown", handleKeyDown);
|
|
692
860
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
693
861
|
}, [isOpen]);
|
|
694
|
-
(0,
|
|
862
|
+
(0, import_react8.useEffect)(() => {
|
|
695
863
|
if (isOpen) {
|
|
696
864
|
setTimeout(() => inputRef.current?.focus(), 50);
|
|
697
865
|
} else {
|
|
698
866
|
setQuery("");
|
|
699
867
|
}
|
|
700
868
|
}, [isOpen]);
|
|
701
|
-
const searchResults =
|
|
869
|
+
const searchResults = import_react8.default.useMemo(() => {
|
|
702
870
|
if (!query) {
|
|
703
871
|
return routes.slice(0, 10).map((r) => ({
|
|
704
872
|
title: r.title,
|
|
@@ -739,8 +907,8 @@ function SearchDialog({ routes }) {
|
|
|
739
907
|
}
|
|
740
908
|
return uniqueResults.slice(0, 10);
|
|
741
909
|
}, [routes, query]);
|
|
742
|
-
return /* @__PURE__ */ (0,
|
|
743
|
-
/* @__PURE__ */ (0,
|
|
910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
744
912
|
"div",
|
|
745
913
|
{
|
|
746
914
|
className: "navbar-search",
|
|
@@ -755,19 +923,19 @@ function SearchDialog({ routes }) {
|
|
|
755
923
|
},
|
|
756
924
|
"aria-label": "Open search dialog",
|
|
757
925
|
children: [
|
|
758
|
-
/* @__PURE__ */ (0,
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Search, { className: "boltdocs-search-icon", size: 18 }),
|
|
759
927
|
"Search docs...",
|
|
760
|
-
/* @__PURE__ */ (0,
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("kbd", { children: "\u2318K" })
|
|
761
929
|
]
|
|
762
930
|
}
|
|
763
931
|
),
|
|
764
|
-
isOpen && (0,
|
|
765
|
-
/* @__PURE__ */ (0,
|
|
932
|
+
isOpen && (0, import_react_dom2.createPortal)(
|
|
933
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
766
934
|
"div",
|
|
767
935
|
{
|
|
768
936
|
className: "boltdocs-search-overlay",
|
|
769
937
|
onPointerDown: () => setIsOpen(false),
|
|
770
|
-
children: /* @__PURE__ */ (0,
|
|
938
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
771
939
|
"div",
|
|
772
940
|
{
|
|
773
941
|
className: "boltdocs-search-modal",
|
|
@@ -776,9 +944,9 @@ function SearchDialog({ routes }) {
|
|
|
776
944
|
"aria-label": "Search",
|
|
777
945
|
onPointerDown: (e) => e.stopPropagation(),
|
|
778
946
|
children: [
|
|
779
|
-
/* @__PURE__ */ (0,
|
|
780
|
-
/* @__PURE__ */ (0,
|
|
781
|
-
/* @__PURE__ */ (0,
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "boltdocs-search-header", children: [
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Search, { size: 18 }),
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
782
950
|
"input",
|
|
783
951
|
{
|
|
784
952
|
ref: inputRef,
|
|
@@ -789,7 +957,7 @@ function SearchDialog({ routes }) {
|
|
|
789
957
|
onChange: (e) => setQuery(e.target.value)
|
|
790
958
|
}
|
|
791
959
|
),
|
|
792
|
-
/* @__PURE__ */ (0,
|
|
960
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
793
961
|
"button",
|
|
794
962
|
{
|
|
795
963
|
className: "boltdocs-search-close",
|
|
@@ -799,7 +967,7 @@ function SearchDialog({ routes }) {
|
|
|
799
967
|
}
|
|
800
968
|
)
|
|
801
969
|
] }),
|
|
802
|
-
/* @__PURE__ */ (0,
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-search-results", children: searchResults.length > 0 ? searchResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
803
971
|
Link,
|
|
804
972
|
{
|
|
805
973
|
to: result.path === "" ? "/" : result.path,
|
|
@@ -826,15 +994,15 @@ function SearchDialog({ routes }) {
|
|
|
826
994
|
setIsOpen(false);
|
|
827
995
|
},
|
|
828
996
|
children: [
|
|
829
|
-
/* @__PURE__ */ (0,
|
|
830
|
-
result.isHeading ? /* @__PURE__ */ (0,
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "boltdocs-search-result-title", children: [
|
|
998
|
+
result.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "heading-indicator", children: "#" }) : null,
|
|
831
999
|
result.title
|
|
832
1000
|
] }),
|
|
833
|
-
result.groupTitle && /* @__PURE__ */ (0,
|
|
1001
|
+
result.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "boltdocs-search-result-group", children: result.groupTitle })
|
|
834
1002
|
]
|
|
835
1003
|
},
|
|
836
1004
|
result.path
|
|
837
|
-
)) : /* @__PURE__ */ (0,
|
|
1005
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "boltdocs-search-empty", children: [
|
|
838
1006
|
'No results found for "',
|
|
839
1007
|
query,
|
|
840
1008
|
'"'
|
|
@@ -848,15 +1016,15 @@ function SearchDialog({ routes }) {
|
|
|
848
1016
|
)
|
|
849
1017
|
] });
|
|
850
1018
|
}
|
|
851
|
-
var
|
|
1019
|
+
var import_react8, import_react_dom2, import_lucide_react4, import_jsx_runtime11;
|
|
852
1020
|
var init_SearchDialog = __esm({
|
|
853
1021
|
"src/client/theme/ui/SearchDialog/SearchDialog.tsx"() {
|
|
854
1022
|
"use strict";
|
|
855
|
-
|
|
856
|
-
|
|
1023
|
+
import_react8 = __toESM(require("react"));
|
|
1024
|
+
import_react_dom2 = require("react-dom");
|
|
857
1025
|
init_Link2();
|
|
858
1026
|
import_lucide_react4 = require("lucide-react");
|
|
859
|
-
|
|
1027
|
+
import_jsx_runtime11 = require("react/jsx-runtime");
|
|
860
1028
|
}
|
|
861
1029
|
});
|
|
862
1030
|
|
|
@@ -883,10 +1051,10 @@ function Navbar({
|
|
|
883
1051
|
const title = config.themeConfig?.title || "Boltdocs";
|
|
884
1052
|
const navItems = config.themeConfig?.navbar || [];
|
|
885
1053
|
const socialLinks = config.themeConfig?.socialLinks || [];
|
|
886
|
-
return /* @__PURE__ */ (0,
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
889
|
-
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ (0,
|
|
1054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("header", { className: "boltdocs-navbar", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "navbar-container", children: [
|
|
1055
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "navbar-left", children: [
|
|
1056
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "navbar-logo", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Link, { to: "/", children: [
|
|
1057
|
+
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
890
1058
|
"span",
|
|
891
1059
|
{
|
|
892
1060
|
className: "navbar-logo-svg",
|
|
@@ -894,7 +1062,7 @@ function Navbar({
|
|
|
894
1062
|
__html: config.themeConfig.logo
|
|
895
1063
|
}
|
|
896
1064
|
}
|
|
897
|
-
) : /* @__PURE__ */ (0,
|
|
1065
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
898
1066
|
"img",
|
|
899
1067
|
{
|
|
900
1068
|
src: config.themeConfig.logo,
|
|
@@ -904,7 +1072,7 @@ function Navbar({
|
|
|
904
1072
|
) : null,
|
|
905
1073
|
title
|
|
906
1074
|
] }) }),
|
|
907
|
-
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ (0,
|
|
1075
|
+
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
908
1076
|
VersionSwitcher,
|
|
909
1077
|
{
|
|
910
1078
|
versions: config.versions,
|
|
@@ -912,22 +1080,22 @@ function Navbar({
|
|
|
912
1080
|
currentLocale,
|
|
913
1081
|
allRoutes
|
|
914
1082
|
}
|
|
915
|
-
) : config.themeConfig?.version ? /* @__PURE__ */ (0,
|
|
1083
|
+
) : config.themeConfig?.version ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "navbar-version", children: [
|
|
916
1084
|
config.themeConfig.version,
|
|
917
1085
|
" ",
|
|
918
|
-
/* @__PURE__ */ (0,
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.ChevronDown, { size: 14 })
|
|
919
1087
|
] }) : null,
|
|
920
|
-
/* @__PURE__ */ (0,
|
|
1088
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation", children: navItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Link, { to: item.link, children: item.text }, i)) })
|
|
921
1089
|
] }),
|
|
922
|
-
/* @__PURE__ */ (0,
|
|
923
|
-
/* @__PURE__ */ (0,
|
|
924
|
-
|
|
1090
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "navbar-right", children: [
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1092
|
+
import_react9.default.Suspense,
|
|
925
1093
|
{
|
|
926
|
-
fallback: /* @__PURE__ */ (0,
|
|
927
|
-
children: /* @__PURE__ */ (0,
|
|
1094
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "navbar-search-placeholder" }),
|
|
1095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchDialog2, { routes: routes || [] })
|
|
928
1096
|
}
|
|
929
1097
|
),
|
|
930
|
-
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ (0,
|
|
1098
|
+
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
931
1099
|
LanguageSwitcher,
|
|
932
1100
|
{
|
|
933
1101
|
i18n: config.i18n,
|
|
@@ -935,12 +1103,12 @@ function Navbar({
|
|
|
935
1103
|
allRoutes
|
|
936
1104
|
}
|
|
937
1105
|
),
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
config.themeConfig?.githubRepo && /* @__PURE__ */ (0,
|
|
940
|
-
socialLinks.length > 0 && /* @__PURE__ */ (0,
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ThemeToggle, {}),
|
|
1107
|
+
config.themeConfig?.githubRepo && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GithubStars, { repo: config.themeConfig.githubRepo }),
|
|
1108
|
+
socialLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "navbar-divider" }),
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "navbar-icons", children: socialLinks.map((link, i) => {
|
|
942
1110
|
const IconComp = ICON_MAP[link.icon.toLowerCase()];
|
|
943
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
944
1112
|
"a",
|
|
945
1113
|
{
|
|
946
1114
|
href: link.link,
|
|
@@ -948,7 +1116,7 @@ function Navbar({
|
|
|
948
1116
|
rel: "noopener noreferrer",
|
|
949
1117
|
className: "navbar-icon-btn",
|
|
950
1118
|
"aria-label": link.icon,
|
|
951
|
-
children: IconComp ? /* @__PURE__ */ (0,
|
|
1119
|
+
children: IconComp ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComp, {}) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: link.icon })
|
|
952
1120
|
},
|
|
953
1121
|
i
|
|
954
1122
|
);
|
|
@@ -956,11 +1124,11 @@ function Navbar({
|
|
|
956
1124
|
] })
|
|
957
1125
|
] }) });
|
|
958
1126
|
}
|
|
959
|
-
var
|
|
1127
|
+
var import_react9, import_lucide_react5, import_jsx_runtime12, SearchDialog2, ICON_MAP;
|
|
960
1128
|
var init_Navbar = __esm({
|
|
961
1129
|
"src/client/theme/ui/Navbar/Navbar.tsx"() {
|
|
962
1130
|
"use strict";
|
|
963
|
-
|
|
1131
|
+
import_react9 = __toESM(require("react"));
|
|
964
1132
|
init_Link2();
|
|
965
1133
|
import_lucide_react5 = require("lucide-react");
|
|
966
1134
|
init_LanguageSwitcher2();
|
|
@@ -969,8 +1137,8 @@ var init_Navbar = __esm({
|
|
|
969
1137
|
init_discord();
|
|
970
1138
|
init_twitter();
|
|
971
1139
|
init_GithubStars();
|
|
972
|
-
|
|
973
|
-
SearchDialog2 =
|
|
1140
|
+
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1141
|
+
SearchDialog2 = import_react9.default.lazy(
|
|
974
1142
|
() => Promise.resolve().then(() => (init_SearchDialog2(), SearchDialog_exports)).then((m) => ({ default: m.SearchDialog }))
|
|
975
1143
|
);
|
|
976
1144
|
ICON_MAP = {
|
|
@@ -991,7 +1159,7 @@ var init_Navbar2 = __esm({
|
|
|
991
1159
|
|
|
992
1160
|
// src/client/theme/ui/PoweredBy/PoweredBy.tsx
|
|
993
1161
|
function PoweredBy() {
|
|
994
|
-
return /* @__PURE__ */ (0,
|
|
1162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "powered-by-container", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
995
1163
|
"a",
|
|
996
1164
|
{
|
|
997
1165
|
href: "https://github.com/jesusalcaladev/boltdocs",
|
|
@@ -999,19 +1167,19 @@ function PoweredBy() {
|
|
|
999
1167
|
rel: "noopener noreferrer",
|
|
1000
1168
|
className: "powered-by-link",
|
|
1001
1169
|
children: [
|
|
1002
|
-
/* @__PURE__ */ (0,
|
|
1003
|
-
/* @__PURE__ */ (0,
|
|
1004
|
-
/* @__PURE__ */ (0,
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react6.Zap, { className: "powered-by-icon", size: 12, fill: "currentColor" }),
|
|
1171
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Powered by" }),
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "powered-by-brand", children: "LiteDocs" })
|
|
1005
1173
|
]
|
|
1006
1174
|
}
|
|
1007
1175
|
) });
|
|
1008
1176
|
}
|
|
1009
|
-
var import_lucide_react6,
|
|
1177
|
+
var import_lucide_react6, import_jsx_runtime13;
|
|
1010
1178
|
var init_PoweredBy = __esm({
|
|
1011
1179
|
"src/client/theme/ui/PoweredBy/PoweredBy.tsx"() {
|
|
1012
1180
|
"use strict";
|
|
1013
1181
|
import_lucide_react6 = require("lucide-react");
|
|
1014
|
-
|
|
1182
|
+
import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1015
1183
|
}
|
|
1016
1184
|
});
|
|
1017
1185
|
|
|
@@ -1054,7 +1222,7 @@ function renderBadge(badgeRaw) {
|
|
|
1054
1222
|
} else if (lowerText === "updated") {
|
|
1055
1223
|
typeClass = "badge-updated";
|
|
1056
1224
|
}
|
|
1057
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `sidebar-badge ${typeClass}`, children: text });
|
|
1058
1226
|
}
|
|
1059
1227
|
function Sidebar({
|
|
1060
1228
|
routes,
|
|
@@ -1080,32 +1248,32 @@ function Sidebar({
|
|
|
1080
1248
|
}
|
|
1081
1249
|
}
|
|
1082
1250
|
const groups = Array.from(groupMap.values());
|
|
1083
|
-
return /* @__PURE__ */ (0,
|
|
1084
|
-
onToggle && /* @__PURE__ */ (0,
|
|
1251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("aside", { className: "boltdocs-sidebar", children: [
|
|
1252
|
+
onToggle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "sidebar-collapse", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1085
1253
|
"button",
|
|
1086
1254
|
{
|
|
1087
1255
|
className: "sidebar-collapse-btn",
|
|
1088
1256
|
onClick: onToggle,
|
|
1089
1257
|
"aria-label": isCollapsed ? "Expand Sidebar" : "Collapse Sidebar",
|
|
1090
1258
|
title: isCollapsed ? "Expand Sidebar" : "Collapse Sidebar",
|
|
1091
|
-
children: /* @__PURE__ */ (0,
|
|
1259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.PanelLeft, { size: 18 })
|
|
1092
1260
|
}
|
|
1093
1261
|
) }),
|
|
1094
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
1095
|
-
/* @__PURE__ */ (0,
|
|
1096
|
-
/* @__PURE__ */ (0,
|
|
1262
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { "aria-label": "Main Navigation", children: [
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "sidebar-list", children: ungrouped.map((route) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1097
1265
|
Link,
|
|
1098
1266
|
{
|
|
1099
1267
|
to: route.path === "" ? "/" : route.path,
|
|
1100
1268
|
className: `sidebar-link ${location.pathname === route.path ? "active" : ""}`,
|
|
1101
1269
|
"aria-current": location.pathname === route.path ? "page" : void 0,
|
|
1102
|
-
children: /* @__PURE__ */ (0,
|
|
1103
|
-
/* @__PURE__ */ (0,
|
|
1270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: route.title }),
|
|
1104
1272
|
renderBadge(route.badge)
|
|
1105
1273
|
] })
|
|
1106
1274
|
}
|
|
1107
1275
|
) }, route.path)) }),
|
|
1108
|
-
groups.map((group) => /* @__PURE__ */ (0,
|
|
1276
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1109
1277
|
SidebarGroupSection,
|
|
1110
1278
|
{
|
|
1111
1279
|
group,
|
|
@@ -1114,7 +1282,7 @@ function Sidebar({
|
|
|
1114
1282
|
group.slug
|
|
1115
1283
|
))
|
|
1116
1284
|
] }),
|
|
1117
|
-
config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0,
|
|
1285
|
+
config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PoweredBy, {})
|
|
1118
1286
|
] })
|
|
1119
1287
|
] });
|
|
1120
1288
|
}
|
|
@@ -1123,9 +1291,9 @@ function SidebarGroupSection({
|
|
|
1123
1291
|
currentPath
|
|
1124
1292
|
}) {
|
|
1125
1293
|
const isActive = group.routes.some((r) => currentPath === r.path);
|
|
1126
|
-
const [open, setOpen] = (0,
|
|
1127
|
-
return /* @__PURE__ */ (0,
|
|
1128
|
-
/* @__PURE__ */ (0,
|
|
1294
|
+
const [open, setOpen] = (0, import_react10.useState)(true);
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "sidebar-group", children: [
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1129
1297
|
"button",
|
|
1130
1298
|
{
|
|
1131
1299
|
className: `sidebar-group-header ${isActive ? "active" : ""}`,
|
|
@@ -1133,35 +1301,35 @@ function SidebarGroupSection({
|
|
|
1133
1301
|
"aria-expanded": open,
|
|
1134
1302
|
"aria-controls": `sidebar-group-${group.slug}`,
|
|
1135
1303
|
children: [
|
|
1136
|
-
/* @__PURE__ */ (0,
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sidebar-group-title", children: group.title }),
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `sidebar-group-chevron ${open ? "open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.ChevronRight, { size: 16 }) })
|
|
1138
1306
|
]
|
|
1139
1307
|
}
|
|
1140
1308
|
),
|
|
1141
|
-
open && /* @__PURE__ */ (0,
|
|
1309
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "sidebar-group-list", id: `sidebar-group-${group.slug}`, children: group.routes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1142
1310
|
Link,
|
|
1143
1311
|
{
|
|
1144
1312
|
to: route.path === "" ? "/" : route.path,
|
|
1145
1313
|
className: `sidebar-link sidebar-link-nested ${currentPath === route.path ? "active" : ""}`,
|
|
1146
1314
|
"aria-current": currentPath === route.path ? "page" : void 0,
|
|
1147
|
-
children: /* @__PURE__ */ (0,
|
|
1148
|
-
/* @__PURE__ */ (0,
|
|
1315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: route.title }),
|
|
1149
1317
|
renderBadge(route.badge)
|
|
1150
1318
|
] })
|
|
1151
1319
|
}
|
|
1152
1320
|
) }, route.path)) })
|
|
1153
1321
|
] });
|
|
1154
1322
|
}
|
|
1155
|
-
var
|
|
1323
|
+
var import_react10, import_react_router_dom4, import_lucide_react7, import_jsx_runtime14;
|
|
1156
1324
|
var init_Sidebar = __esm({
|
|
1157
1325
|
"src/client/theme/ui/Sidebar/Sidebar.tsx"() {
|
|
1158
1326
|
"use strict";
|
|
1159
|
-
|
|
1327
|
+
import_react10 = require("react");
|
|
1160
1328
|
import_react_router_dom4 = require("react-router-dom");
|
|
1161
1329
|
init_Link2();
|
|
1162
1330
|
init_PoweredBy2();
|
|
1163
1331
|
import_lucide_react7 = require("lucide-react");
|
|
1164
|
-
|
|
1332
|
+
import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1165
1333
|
}
|
|
1166
1334
|
});
|
|
1167
1335
|
|
|
@@ -1180,12 +1348,12 @@ function OnThisPage({
|
|
|
1180
1348
|
communityHelp,
|
|
1181
1349
|
filePath
|
|
1182
1350
|
}) {
|
|
1183
|
-
const [activeId, setActiveId] = (0,
|
|
1184
|
-
const [indicatorStyle, setIndicatorStyle] = (0,
|
|
1185
|
-
const observerRef = (0,
|
|
1351
|
+
const [activeId, setActiveId] = (0, import_react11.useState)("");
|
|
1352
|
+
const [indicatorStyle, setIndicatorStyle] = (0, import_react11.useState)({});
|
|
1353
|
+
const observerRef = (0, import_react11.useRef)(null);
|
|
1186
1354
|
const location = (0, import_react_router_dom5.useLocation)();
|
|
1187
|
-
const listRef = (0,
|
|
1188
|
-
(0,
|
|
1355
|
+
const listRef = (0, import_react11.useRef)(null);
|
|
1356
|
+
(0, import_react11.useEffect)(() => {
|
|
1189
1357
|
if (headings.length > 0) {
|
|
1190
1358
|
const hash = window.location.hash.substring(1);
|
|
1191
1359
|
if (hash && headings.some((h) => h.id === hash)) {
|
|
@@ -1195,7 +1363,7 @@ function OnThisPage({
|
|
|
1195
1363
|
}
|
|
1196
1364
|
}
|
|
1197
1365
|
}, [location.pathname, headings]);
|
|
1198
|
-
(0,
|
|
1366
|
+
(0, import_react11.useEffect)(() => {
|
|
1199
1367
|
if (!activeId || !listRef.current) return;
|
|
1200
1368
|
const activeElement = listRef.current.querySelector(
|
|
1201
1369
|
`a[href="#${activeId}"]`
|
|
@@ -1209,7 +1377,7 @@ function OnThisPage({
|
|
|
1209
1377
|
});
|
|
1210
1378
|
}
|
|
1211
1379
|
}, [activeId, headings]);
|
|
1212
|
-
(0,
|
|
1380
|
+
(0, import_react11.useEffect)(() => {
|
|
1213
1381
|
if (headings.length === 0) return;
|
|
1214
1382
|
if (observerRef.current) {
|
|
1215
1383
|
observerRef.current.disconnect();
|
|
@@ -1251,7 +1419,7 @@ function OnThisPage({
|
|
|
1251
1419
|
window.removeEventListener("scroll", handleScroll);
|
|
1252
1420
|
};
|
|
1253
1421
|
}, [headings, location.pathname]);
|
|
1254
|
-
(0,
|
|
1422
|
+
(0, import_react11.useEffect)(() => {
|
|
1255
1423
|
if (!activeId || !listRef.current) return;
|
|
1256
1424
|
const activeLink = listRef.current.querySelector(
|
|
1257
1425
|
`a[href="#${activeId}"]`
|
|
@@ -1272,7 +1440,7 @@ function OnThisPage({
|
|
|
1272
1440
|
}
|
|
1273
1441
|
}
|
|
1274
1442
|
}, [activeId]);
|
|
1275
|
-
const handleClick = (0,
|
|
1443
|
+
const handleClick = (0, import_react11.useCallback)(
|
|
1276
1444
|
(e, id) => {
|
|
1277
1445
|
e.preventDefault();
|
|
1278
1446
|
const el = document.getElementById(id);
|
|
@@ -1293,11 +1461,11 @@ function OnThisPage({
|
|
|
1293
1461
|
[]
|
|
1294
1462
|
);
|
|
1295
1463
|
if (headings.length === 0) return null;
|
|
1296
|
-
return /* @__PURE__ */ (0,
|
|
1297
|
-
/* @__PURE__ */ (0,
|
|
1298
|
-
/* @__PURE__ */ (0,
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1300
|
-
/* @__PURE__ */ (0,
|
|
1464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "boltdocs-on-this-page", "aria-label": "Table of contents", children: [
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "on-this-page-title", children: "On this page" }),
|
|
1466
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "on-this-page-container", children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "toc-indicator", style: indicatorStyle }),
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "on-this-page-list", ref: listRef, children: headings.map((h) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { className: h.level === 3 ? "toc-indent" : "", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1301
1469
|
"a",
|
|
1302
1470
|
{
|
|
1303
1471
|
href: `#${h.id}`,
|
|
@@ -1308,10 +1476,10 @@ function OnThisPage({
|
|
|
1308
1476
|
}
|
|
1309
1477
|
) }, h.id)) })
|
|
1310
1478
|
] }),
|
|
1311
|
-
(editLink || communityHelp) && /* @__PURE__ */ (0,
|
|
1312
|
-
/* @__PURE__ */ (0,
|
|
1313
|
-
/* @__PURE__ */ (0,
|
|
1314
|
-
editLink && filePath && /* @__PURE__ */ (0,
|
|
1479
|
+
(editLink || communityHelp) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "toc-help", children: [
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "toc-help-title", children: "Need help?" }),
|
|
1481
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { className: "toc-help-links", children: [
|
|
1482
|
+
editLink && filePath && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1315
1483
|
"a",
|
|
1316
1484
|
{
|
|
1317
1485
|
href: editLink.replace(":path", filePath),
|
|
@@ -1319,12 +1487,12 @@ function OnThisPage({
|
|
|
1319
1487
|
rel: "noopener noreferrer",
|
|
1320
1488
|
className: "toc-help-link",
|
|
1321
1489
|
children: [
|
|
1322
|
-
/* @__PURE__ */ (0,
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react8.Pencil, { size: 16 }),
|
|
1323
1491
|
"Edit this page"
|
|
1324
1492
|
]
|
|
1325
1493
|
}
|
|
1326
1494
|
) }),
|
|
1327
|
-
communityHelp && /* @__PURE__ */ (0,
|
|
1495
|
+
communityHelp && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1328
1496
|
"a",
|
|
1329
1497
|
{
|
|
1330
1498
|
href: communityHelp,
|
|
@@ -1332,7 +1500,7 @@ function OnThisPage({
|
|
|
1332
1500
|
rel: "noopener noreferrer",
|
|
1333
1501
|
className: "toc-help-link",
|
|
1334
1502
|
children: [
|
|
1335
|
-
/* @__PURE__ */ (0,
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react8.CircleHelp, { size: 16 }),
|
|
1336
1504
|
"Community help"
|
|
1337
1505
|
]
|
|
1338
1506
|
}
|
|
@@ -1341,14 +1509,14 @@ function OnThisPage({
|
|
|
1341
1509
|
] })
|
|
1342
1510
|
] });
|
|
1343
1511
|
}
|
|
1344
|
-
var
|
|
1512
|
+
var import_react11, import_react_router_dom5, import_lucide_react8, import_jsx_runtime15;
|
|
1345
1513
|
var init_OnThisPage = __esm({
|
|
1346
1514
|
"src/client/theme/ui/OnThisPage/OnThisPage.tsx"() {
|
|
1347
1515
|
"use strict";
|
|
1348
|
-
|
|
1516
|
+
import_react11 = require("react");
|
|
1349
1517
|
import_react_router_dom5 = require("react-router-dom");
|
|
1350
1518
|
import_lucide_react8 = require("lucide-react");
|
|
1351
|
-
|
|
1519
|
+
import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1352
1520
|
}
|
|
1353
1521
|
});
|
|
1354
1522
|
|
|
@@ -1363,7 +1531,7 @@ var init_OnThisPage2 = __esm({
|
|
|
1363
1531
|
// src/client/theme/ui/Head/Head.tsx
|
|
1364
1532
|
function Head({ siteTitle, siteDescription, routes }) {
|
|
1365
1533
|
const location = (0, import_react_router_dom6.useLocation)();
|
|
1366
|
-
(0,
|
|
1534
|
+
(0, import_react12.useEffect)(() => {
|
|
1367
1535
|
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1368
1536
|
const pageTitle = currentRoute?.title;
|
|
1369
1537
|
const pageDescription = currentRoute?.description || siteDescription || "";
|
|
@@ -1407,11 +1575,11 @@ function setMetaTag(attr, key, content) {
|
|
|
1407
1575
|
}
|
|
1408
1576
|
tag.content = content;
|
|
1409
1577
|
}
|
|
1410
|
-
var
|
|
1578
|
+
var import_react12, import_react_router_dom6;
|
|
1411
1579
|
var init_Head = __esm({
|
|
1412
1580
|
"src/client/theme/ui/Head/Head.tsx"() {
|
|
1413
1581
|
"use strict";
|
|
1414
|
-
|
|
1582
|
+
import_react12 = require("react");
|
|
1415
1583
|
import_react_router_dom6 = require("react-router-dom");
|
|
1416
1584
|
}
|
|
1417
1585
|
});
|
|
@@ -1431,16 +1599,16 @@ function Breadcrumbs({ routes, config }) {
|
|
|
1431
1599
|
if (location.pathname === "/") return null;
|
|
1432
1600
|
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1433
1601
|
const groupRoute = currentRoute?.group ? routes.find((r) => r.group === currentRoute.group) : null;
|
|
1434
|
-
return /* @__PURE__ */ (0,
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { className: "boltdocs-breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ol", { className: "boltdocs-breadcrumbs-list", children: [
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Link, { to: "/", className: "boltdocs-breadcrumbs-link", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.Home, { size: 14 }) }),
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
|
|
1438
1606
|
] }),
|
|
1439
|
-
currentRoute?.groupTitle && /* @__PURE__ */ (0,
|
|
1440
|
-
groupRoute ? /* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1607
|
+
currentRoute?.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
|
|
1608
|
+
groupRoute ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Link, { to: groupRoute.path, className: "boltdocs-breadcrumbs-link", children: currentRoute.groupTitle }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "boltdocs-breadcrumbs-text", children: currentRoute.groupTitle }),
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
|
|
1442
1610
|
] }),
|
|
1443
|
-
currentRoute?.title && /* @__PURE__ */ (0,
|
|
1611
|
+
currentRoute?.title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { className: "boltdocs-breadcrumbs-item", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1444
1612
|
"span",
|
|
1445
1613
|
{
|
|
1446
1614
|
className: "boltdocs-breadcrumbs-text boltdocs-breadcrumbs-active",
|
|
@@ -1450,14 +1618,14 @@ function Breadcrumbs({ routes, config }) {
|
|
|
1450
1618
|
) })
|
|
1451
1619
|
] }) });
|
|
1452
1620
|
}
|
|
1453
|
-
var import_react_router_dom7, import_lucide_react9,
|
|
1621
|
+
var import_react_router_dom7, import_lucide_react9, import_jsx_runtime16;
|
|
1454
1622
|
var init_Breadcrumbs = __esm({
|
|
1455
1623
|
"src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
1456
1624
|
"use strict";
|
|
1457
1625
|
import_react_router_dom7 = require("react-router-dom");
|
|
1458
1626
|
init_Link2();
|
|
1459
1627
|
import_lucide_react9 = require("lucide-react");
|
|
1460
|
-
|
|
1628
|
+
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1461
1629
|
}
|
|
1462
1630
|
});
|
|
1463
1631
|
|
|
@@ -1471,16 +1639,16 @@ var init_Breadcrumbs2 = __esm({
|
|
|
1471
1639
|
|
|
1472
1640
|
// src/client/theme/ui/BackgroundGradient/BackgroundGradient.tsx
|
|
1473
1641
|
function BackgroundGradient() {
|
|
1474
|
-
return /* @__PURE__ */ (0,
|
|
1475
|
-
/* @__PURE__ */ (0,
|
|
1476
|
-
/* @__PURE__ */ (0,
|
|
1642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "boltdocs-background-glow", children: [
|
|
1643
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "glow-shape glow-1" }),
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "glow-shape glow-2" })
|
|
1477
1645
|
] });
|
|
1478
1646
|
}
|
|
1479
|
-
var
|
|
1647
|
+
var import_jsx_runtime17;
|
|
1480
1648
|
var init_BackgroundGradient = __esm({
|
|
1481
1649
|
"src/client/theme/ui/BackgroundGradient/BackgroundGradient.tsx"() {
|
|
1482
1650
|
"use strict";
|
|
1483
|
-
|
|
1651
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1484
1652
|
}
|
|
1485
1653
|
});
|
|
1486
1654
|
|
|
@@ -1512,7 +1680,7 @@ function ThemeLayout({
|
|
|
1512
1680
|
className = "",
|
|
1513
1681
|
style
|
|
1514
1682
|
}) {
|
|
1515
|
-
const [isSidebarOpen, setIsSidebarOpen] = (0,
|
|
1683
|
+
const [isSidebarOpen, setIsSidebarOpen] = (0, import_react13.useState)(true);
|
|
1516
1684
|
const siteTitle = config.themeConfig?.title || "Boltdocs";
|
|
1517
1685
|
const siteDescription = config.themeConfig?.description || "";
|
|
1518
1686
|
const location = (0, import_react_router_dom8.useLocation)();
|
|
@@ -1531,13 +1699,13 @@ function ThemeLayout({
|
|
|
1531
1699
|
const prevPage = localIndex > 0 ? filteredRoutes[localIndex - 1] : null;
|
|
1532
1700
|
const nextPage = localIndex >= 0 && localIndex < filteredRoutes.length - 1 ? filteredRoutes[localIndex + 1] : null;
|
|
1533
1701
|
const { preload } = usePreload();
|
|
1534
|
-
|
|
1702
|
+
import_react13.default.useEffect(() => {
|
|
1535
1703
|
if (prevPage?.path) preload(prevPage.path);
|
|
1536
1704
|
if (nextPage?.path) preload(nextPage.path);
|
|
1537
1705
|
}, [prevPage, nextPage, preload]);
|
|
1538
|
-
return /* @__PURE__ */ (0,
|
|
1539
|
-
background !== void 0 ? background : /* @__PURE__ */ (0,
|
|
1540
|
-
head !== void 0 ? head : /* @__PURE__ */ (0,
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `boltdocs-layout ${className}`, style, children: [
|
|
1707
|
+
background !== void 0 ? background : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BackgroundGradient, {}),
|
|
1708
|
+
head !== void 0 ? head : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1541
1709
|
Head,
|
|
1542
1710
|
{
|
|
1543
1711
|
siteTitle,
|
|
@@ -1545,7 +1713,7 @@ function ThemeLayout({
|
|
|
1545
1713
|
routes
|
|
1546
1714
|
}
|
|
1547
1715
|
),
|
|
1548
|
-
navbar !== void 0 ? navbar : /* @__PURE__ */ (0,
|
|
1716
|
+
navbar !== void 0 ? navbar : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1549
1717
|
Navbar,
|
|
1550
1718
|
{
|
|
1551
1719
|
config,
|
|
@@ -1555,12 +1723,12 @@ function ThemeLayout({
|
|
|
1555
1723
|
currentVersion
|
|
1556
1724
|
}
|
|
1557
1725
|
),
|
|
1558
|
-
/* @__PURE__ */ (0,
|
|
1726
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1559
1727
|
"div",
|
|
1560
1728
|
{
|
|
1561
1729
|
className: `boltdocs-main-container ${!isSidebarOpen ? "sidebar-collapsed" : ""}`,
|
|
1562
1730
|
children: [
|
|
1563
|
-
sidebar !== void 0 ? sidebar : /* @__PURE__ */ (0,
|
|
1731
|
+
sidebar !== void 0 ? sidebar : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1564
1732
|
Sidebar,
|
|
1565
1733
|
{
|
|
1566
1734
|
routes: filteredRoutes,
|
|
@@ -1569,41 +1737,41 @@ function ThemeLayout({
|
|
|
1569
1737
|
onToggle: () => setIsSidebarOpen(!isSidebarOpen)
|
|
1570
1738
|
}
|
|
1571
1739
|
),
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1573
|
-
breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1575
|
-
(prevPage || nextPage) && /* @__PURE__ */ (0,
|
|
1576
|
-
prevPage ? /* @__PURE__ */ (0,
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("main", { className: "boltdocs-content", children: [
|
|
1741
|
+
breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Breadcrumbs, { routes: filteredRoutes, config }),
|
|
1742
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "boltdocs-page", children }),
|
|
1743
|
+
(prevPage || nextPage) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("nav", { className: "page-nav", "aria-label": "Pagination", children: [
|
|
1744
|
+
prevPage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1577
1745
|
Link,
|
|
1578
1746
|
{
|
|
1579
1747
|
to: prevPage.path || "/",
|
|
1580
1748
|
className: "page-nav-link page-nav-link--prev",
|
|
1581
1749
|
children: [
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1584
|
-
/* @__PURE__ */ (0,
|
|
1750
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "page-nav-info", children: [
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-label", children: "Previous" }),
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-title", children: prevPage.title })
|
|
1585
1753
|
] }),
|
|
1586
|
-
/* @__PURE__ */ (0,
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.ChevronLeft, { className: "page-nav-arrow", size: 16 })
|
|
1587
1755
|
]
|
|
1588
1756
|
}
|
|
1589
|
-
) : /* @__PURE__ */ (0,
|
|
1590
|
-
nextPage ? /* @__PURE__ */ (0,
|
|
1757
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", {}),
|
|
1758
|
+
nextPage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1591
1759
|
Link,
|
|
1592
1760
|
{
|
|
1593
1761
|
to: nextPage.path || "/",
|
|
1594
1762
|
className: "page-nav-link page-nav-link--next",
|
|
1595
1763
|
children: [
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1597
|
-
/* @__PURE__ */ (0,
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "page-nav-info", children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-label", children: "Next" }),
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "page-nav-title", children: nextPage.title })
|
|
1599
1767
|
] }),
|
|
1600
|
-
/* @__PURE__ */ (0,
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.ChevronRight, { className: "page-nav-arrow", size: 16 })
|
|
1601
1769
|
]
|
|
1602
1770
|
}
|
|
1603
|
-
) : /* @__PURE__ */ (0,
|
|
1771
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", {})
|
|
1604
1772
|
] })
|
|
1605
1773
|
] }),
|
|
1606
|
-
toc !== void 0 ? toc : /* @__PURE__ */ (0,
|
|
1774
|
+
toc !== void 0 ? toc : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1607
1775
|
OnThisPage,
|
|
1608
1776
|
{
|
|
1609
1777
|
headings: routes[currentIndex]?.headings,
|
|
@@ -1617,11 +1785,11 @@ function ThemeLayout({
|
|
|
1617
1785
|
)
|
|
1618
1786
|
] });
|
|
1619
1787
|
}
|
|
1620
|
-
var
|
|
1788
|
+
var import_react13, import_react_router_dom8, import_lucide_react10, import_jsx_runtime18;
|
|
1621
1789
|
var init_Layout = __esm({
|
|
1622
1790
|
"src/client/theme/ui/Layout/Layout.tsx"() {
|
|
1623
1791
|
"use strict";
|
|
1624
|
-
|
|
1792
|
+
import_react13 = __toESM(require("react"));
|
|
1625
1793
|
import_react_router_dom8 = require("react-router-dom");
|
|
1626
1794
|
init_Link2();
|
|
1627
1795
|
import_lucide_react10 = require("lucide-react");
|
|
@@ -1639,7 +1807,7 @@ var init_Layout = __esm({
|
|
|
1639
1807
|
init_Breadcrumbs2();
|
|
1640
1808
|
init_BackgroundGradient2();
|
|
1641
1809
|
init_styles();
|
|
1642
|
-
|
|
1810
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1643
1811
|
}
|
|
1644
1812
|
});
|
|
1645
1813
|
|
|
@@ -1653,23 +1821,23 @@ var init_Layout2 = __esm({
|
|
|
1653
1821
|
|
|
1654
1822
|
// src/client/theme/ui/NotFound/NotFound.tsx
|
|
1655
1823
|
function NotFound() {
|
|
1656
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
-
/* @__PURE__ */ (0,
|
|
1658
|
-
/* @__PURE__ */ (0,
|
|
1659
|
-
/* @__PURE__ */ (0,
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "boltdocs-not-found", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "not-found-content", children: [
|
|
1825
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "not-found-code", children: "404" }),
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h1", { className: "not-found-title", children: "Page Not Found" }),
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "not-found-text", children: "The page you're looking for doesn't exist or has been moved." }),
|
|
1828
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Link, { to: "/", className: "not-found-link", children: [
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.ArrowLeft, { size: 16 }),
|
|
1662
1830
|
" Go to Home"
|
|
1663
1831
|
] })
|
|
1664
1832
|
] }) });
|
|
1665
1833
|
}
|
|
1666
|
-
var import_lucide_react11,
|
|
1834
|
+
var import_lucide_react11, import_jsx_runtime19;
|
|
1667
1835
|
var init_NotFound = __esm({
|
|
1668
1836
|
"src/client/theme/ui/NotFound/NotFound.tsx"() {
|
|
1669
1837
|
"use strict";
|
|
1670
1838
|
init_Link2();
|
|
1671
1839
|
import_lucide_react11 = require("lucide-react");
|
|
1672
|
-
|
|
1840
|
+
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1673
1841
|
}
|
|
1674
1842
|
});
|
|
1675
1843
|
|
|
@@ -1683,16 +1851,16 @@ var init_NotFound2 = __esm({
|
|
|
1683
1851
|
|
|
1684
1852
|
// src/client/theme/ui/Loading/Loading.tsx
|
|
1685
1853
|
function Loading() {
|
|
1686
|
-
return /* @__PURE__ */ (0,
|
|
1687
|
-
/* @__PURE__ */ (0,
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "boltdocs-loading", children: [
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "loading-spinner" }),
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "loading-text", children: "Loading..." })
|
|
1689
1857
|
] });
|
|
1690
1858
|
}
|
|
1691
|
-
var
|
|
1859
|
+
var import_jsx_runtime20;
|
|
1692
1860
|
var init_Loading = __esm({
|
|
1693
1861
|
"src/client/theme/ui/Loading/Loading.tsx"() {
|
|
1694
1862
|
"use strict";
|
|
1695
|
-
|
|
1863
|
+
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1696
1864
|
}
|
|
1697
1865
|
});
|
|
1698
1866
|
|
|
@@ -1706,52 +1874,39 @@ var init_Loading2 = __esm({
|
|
|
1706
1874
|
|
|
1707
1875
|
// src/client/theme/components/CodeBlock/CodeBlock.tsx
|
|
1708
1876
|
function CodeBlock({ children, ...props }) {
|
|
1709
|
-
const [copied, setCopied] = (0,
|
|
1710
|
-
const preRef = (0,
|
|
1711
|
-
|
|
1712
|
-
if (import_react13.default.isValidElement(children)) {
|
|
1713
|
-
const childProps = children.props;
|
|
1714
|
-
language = childProps?.["data-language"] || "";
|
|
1715
|
-
if (!language && childProps?.className) {
|
|
1716
|
-
const match = childProps.className.match(/language-(\w+)/);
|
|
1717
|
-
if (match) language = match[1];
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
const handleCopy = (0, import_react13.useCallback)(async () => {
|
|
1877
|
+
const [copied, setCopied] = (0, import_react14.useState)(false);
|
|
1878
|
+
const preRef = (0, import_react14.useRef)(null);
|
|
1879
|
+
const handleCopy = (0, import_react14.useCallback)(async () => {
|
|
1721
1880
|
const code = preRef.current?.textContent || "";
|
|
1722
1881
|
copyToClipboard(code);
|
|
1723
1882
|
setCopied(true);
|
|
1724
1883
|
setTimeout(() => setCopied(false), 2e3);
|
|
1725
1884
|
}, []);
|
|
1726
|
-
return /* @__PURE__ */ (0,
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "code-block-wrapper", children: [
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1728
1887
|
"button",
|
|
1729
1888
|
{
|
|
1730
1889
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
1731
1890
|
onClick: handleCopy,
|
|
1732
1891
|
"aria-label": "Copy code",
|
|
1733
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
1892
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react12.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react12.Copy, { size: 16 })
|
|
1734
1893
|
}
|
|
1735
1894
|
),
|
|
1736
|
-
/* @__PURE__ */ (0,
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("pre", { ref: preRef, ...props, children })
|
|
1737
1896
|
] });
|
|
1738
1897
|
}
|
|
1739
|
-
var
|
|
1898
|
+
var import_react14, import_lucide_react12, import_jsx_runtime21;
|
|
1740
1899
|
var init_CodeBlock = __esm({
|
|
1741
1900
|
"src/client/theme/components/CodeBlock/CodeBlock.tsx"() {
|
|
1742
1901
|
"use strict";
|
|
1743
|
-
|
|
1902
|
+
import_react14 = require("react");
|
|
1744
1903
|
import_lucide_react12 = require("lucide-react");
|
|
1745
1904
|
init_utils();
|
|
1746
|
-
|
|
1905
|
+
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1747
1906
|
}
|
|
1748
1907
|
});
|
|
1749
1908
|
|
|
1750
1909
|
// src/client/theme/components/CodeBlock/index.ts
|
|
1751
|
-
var CodeBlock_exports = {};
|
|
1752
|
-
__export(CodeBlock_exports, {
|
|
1753
|
-
CodeBlock: () => CodeBlock
|
|
1754
|
-
});
|
|
1755
1910
|
var init_CodeBlock2 = __esm({
|
|
1756
1911
|
"src/client/theme/components/CodeBlock/index.ts"() {
|
|
1757
1912
|
"use strict";
|
|
@@ -1769,9 +1924,9 @@ function Video({
|
|
|
1769
1924
|
preload = "metadata",
|
|
1770
1925
|
...rest
|
|
1771
1926
|
}) {
|
|
1772
|
-
const containerRef = (0,
|
|
1773
|
-
const [isVisible, setIsVisible] = (0,
|
|
1774
|
-
(0,
|
|
1927
|
+
const containerRef = (0, import_react15.useRef)(null);
|
|
1928
|
+
const [isVisible, setIsVisible] = (0, import_react15.useState)(false);
|
|
1929
|
+
(0, import_react15.useEffect)(() => {
|
|
1775
1930
|
const el = containerRef.current;
|
|
1776
1931
|
if (!el) return;
|
|
1777
1932
|
const observer = new IntersectionObserver(
|
|
@@ -1786,7 +1941,7 @@ function Video({
|
|
|
1786
1941
|
observer.observe(el);
|
|
1787
1942
|
return () => observer.disconnect();
|
|
1788
1943
|
}, []);
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
1944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref: containerRef, className: "boltdocs-video-wrapper", children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1790
1945
|
"video",
|
|
1791
1946
|
{
|
|
1792
1947
|
className: "boltdocs-video",
|
|
@@ -1801,7 +1956,7 @@ function Video({
|
|
|
1801
1956
|
"Your browser does not support the video tag."
|
|
1802
1957
|
]
|
|
1803
1958
|
}
|
|
1804
|
-
) : /* @__PURE__ */ (0,
|
|
1959
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1805
1960
|
"div",
|
|
1806
1961
|
{
|
|
1807
1962
|
className: "boltdocs-video-placeholder",
|
|
@@ -1810,12 +1965,12 @@ function Video({
|
|
|
1810
1965
|
}
|
|
1811
1966
|
) });
|
|
1812
1967
|
}
|
|
1813
|
-
var
|
|
1968
|
+
var import_react15, import_jsx_runtime22;
|
|
1814
1969
|
var init_Video = __esm({
|
|
1815
1970
|
"src/client/theme/components/Video/Video.tsx"() {
|
|
1816
1971
|
"use strict";
|
|
1817
|
-
|
|
1818
|
-
|
|
1972
|
+
import_react15 = require("react");
|
|
1973
|
+
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1819
1974
|
}
|
|
1820
1975
|
});
|
|
1821
1976
|
|
|
@@ -1832,14 +1987,14 @@ var init_Video2 = __esm({
|
|
|
1832
1987
|
});
|
|
1833
1988
|
|
|
1834
1989
|
// src/client/theme/icons/npm.tsx
|
|
1835
|
-
var
|
|
1990
|
+
var import_jsx_runtime23, NPM;
|
|
1836
1991
|
var init_npm = __esm({
|
|
1837
1992
|
"src/client/theme/icons/npm.tsx"() {
|
|
1838
1993
|
"use strict";
|
|
1839
|
-
|
|
1840
|
-
NPM = (props) => /* @__PURE__ */ (0,
|
|
1841
|
-
/* @__PURE__ */ (0,
|
|
1842
|
-
/* @__PURE__ */ (0,
|
|
1994
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1995
|
+
NPM = (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { ...props, viewBox: "0 0 2500 2500", children: [
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { fill: "#c00", d: "M0 0h2500v2500H0z" }),
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1843
1998
|
"path",
|
|
1844
1999
|
{
|
|
1845
2000
|
fill: "#fff",
|
|
@@ -1851,69 +2006,69 @@ var init_npm = __esm({
|
|
|
1851
2006
|
});
|
|
1852
2007
|
|
|
1853
2008
|
// src/client/theme/icons/pnpm.tsx
|
|
1854
|
-
var
|
|
2009
|
+
var import_jsx_runtime24, Pnpm;
|
|
1855
2010
|
var init_pnpm = __esm({
|
|
1856
2011
|
"src/client/theme/icons/pnpm.tsx"() {
|
|
1857
2012
|
"use strict";
|
|
1858
|
-
|
|
1859
|
-
Pnpm = (props) => /* @__PURE__ */ (0,
|
|
2013
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2014
|
+
Pnpm = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1860
2015
|
"svg",
|
|
1861
2016
|
{
|
|
1862
2017
|
...props,
|
|
1863
2018
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1864
2019
|
viewBox: "76.58987244897958 44 164.00775510204068 164",
|
|
1865
2020
|
children: [
|
|
1866
|
-
/* @__PURE__ */ (0,
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
2021
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("defs", { children: [
|
|
2022
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1868
2023
|
"path",
|
|
1869
2024
|
{
|
|
1870
2025
|
d: "M237.6 95L187.6 95L187.6 45L237.6 45L237.6 95Z",
|
|
1871
2026
|
id: "pnpm_dark__b45vdTD8hs"
|
|
1872
2027
|
}
|
|
1873
2028
|
),
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1875
2030
|
"path",
|
|
1876
2031
|
{
|
|
1877
2032
|
d: "M182.59 95L132.59 95L132.59 45L182.59 45L182.59 95Z",
|
|
1878
2033
|
id: "pnpm_dark__a40WtxIl8d"
|
|
1879
2034
|
}
|
|
1880
2035
|
),
|
|
1881
|
-
/* @__PURE__ */ (0,
|
|
2036
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1882
2037
|
"path",
|
|
1883
2038
|
{
|
|
1884
2039
|
d: "M127.59 95L77.59 95L77.59 45L127.59 45L127.59 95Z",
|
|
1885
2040
|
id: "pnpm_dark__h2CN9AEEpe"
|
|
1886
2041
|
}
|
|
1887
2042
|
),
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1889
2044
|
"path",
|
|
1890
2045
|
{
|
|
1891
2046
|
d: "M237.6 150L187.6 150L187.6 100L237.6 100L237.6 150Z",
|
|
1892
2047
|
id: "pnpm_dark__dqv5133G8"
|
|
1893
2048
|
}
|
|
1894
2049
|
),
|
|
1895
|
-
/* @__PURE__ */ (0,
|
|
2050
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1896
2051
|
"path",
|
|
1897
2052
|
{
|
|
1898
2053
|
d: "M182.59 150L132.59 150L132.59 100L182.59 100L182.59 150Z",
|
|
1899
2054
|
id: "pnpm_dark__b1Lv79ypvm"
|
|
1900
2055
|
}
|
|
1901
2056
|
),
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1903
2058
|
"path",
|
|
1904
2059
|
{
|
|
1905
2060
|
d: "M182.59 205L132.59 205L132.59 155L182.59 155L182.59 205Z",
|
|
1906
2061
|
id: "pnpm_dark__hy1IZWwLX"
|
|
1907
2062
|
}
|
|
1908
2063
|
),
|
|
1909
|
-
/* @__PURE__ */ (0,
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1910
2065
|
"path",
|
|
1911
2066
|
{
|
|
1912
2067
|
d: "M237.6 205L187.6 205L187.6 155L237.6 155L237.6 205Z",
|
|
1913
2068
|
id: "pnpm_dark__akQfjxQes"
|
|
1914
2069
|
}
|
|
1915
2070
|
),
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1917
2072
|
"path",
|
|
1918
2073
|
{
|
|
1919
2074
|
d: "M127.59 205L77.59 205L77.59 155L127.59 155L127.59 205Z",
|
|
@@ -1921,15 +2076,15 @@ var init_pnpm = __esm({
|
|
|
1921
2076
|
}
|
|
1922
2077
|
)
|
|
1923
2078
|
] }),
|
|
1924
|
-
/* @__PURE__ */ (0,
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
1928
|
-
/* @__PURE__ */ (0,
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
1930
|
-
/* @__PURE__ */ (0,
|
|
1931
|
-
/* @__PURE__ */ (0,
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("g", { children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__b45vdTD8hs", fill: "#f9ad00" }) }),
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__a40WtxIl8d", fill: "#f9ad00" }) }),
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__h2CN9AEEpe", fill: "#f9ad00" }) }),
|
|
2083
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__dqv5133G8", fill: "#f9ad00" }) }),
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__b1Lv79ypvm", fill: "currentColor" }) }),
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__hy1IZWwLX", fill: "currentColor" }) }),
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__akQfjxQes", fill: "currentColor" }) }),
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("use", { xlinkHref: "#pnpm_dark__bdSrwE5pk", fill: "currentColor" }) })
|
|
1933
2088
|
] })
|
|
1934
2089
|
]
|
|
1935
2090
|
}
|
|
@@ -1938,62 +2093,62 @@ var init_pnpm = __esm({
|
|
|
1938
2093
|
});
|
|
1939
2094
|
|
|
1940
2095
|
// src/client/theme/icons/bun.tsx
|
|
1941
|
-
var
|
|
2096
|
+
var import_jsx_runtime25, Bun;
|
|
1942
2097
|
var init_bun = __esm({
|
|
1943
2098
|
"src/client/theme/icons/bun.tsx"() {
|
|
1944
2099
|
"use strict";
|
|
1945
|
-
|
|
1946
|
-
Bun = (props) => /* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2100
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2101
|
+
Bun = (props) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("svg", { ...props, viewBox: "0 0 80 70", children: [
|
|
2102
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01Z" }),
|
|
2103
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1949
2104
|
"path",
|
|
1950
2105
|
{
|
|
1951
2106
|
d: "M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z",
|
|
1952
2107
|
style: { fill: "#fbf0df" }
|
|
1953
2108
|
}
|
|
1954
2109
|
),
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1956
2111
|
"path",
|
|
1957
2112
|
{
|
|
1958
2113
|
d: "M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54Z",
|
|
1959
2114
|
style: { fill: "#f6dece" }
|
|
1960
2115
|
}
|
|
1961
2116
|
),
|
|
1962
|
-
/* @__PURE__ */ (0,
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1963
2118
|
"path",
|
|
1964
2119
|
{
|
|
1965
2120
|
d: "M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.29 9.29 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72Z",
|
|
1966
2121
|
style: { fill: "#fffefc" }
|
|
1967
2122
|
}
|
|
1968
2123
|
),
|
|
1969
|
-
/* @__PURE__ */ (0,
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1970
2125
|
"path",
|
|
1971
2126
|
{
|
|
1972
2127
|
d: "M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63Z",
|
|
1973
2128
|
style: { fill: "#ccbea7", fillRule: "evenodd" }
|
|
1974
2129
|
}
|
|
1975
2130
|
),
|
|
1976
|
-
/* @__PURE__ */ (0,
|
|
1977
|
-
/* @__PURE__ */ (0,
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z" }),
|
|
2132
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("g", { children: [
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1979
2134
|
"path",
|
|
1980
2135
|
{
|
|
1981
2136
|
d: "M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z",
|
|
1982
2137
|
style: { fill: "#b71422" }
|
|
1983
2138
|
}
|
|
1984
2139
|
),
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1986
2141
|
"path",
|
|
1987
2142
|
{
|
|
1988
2143
|
d: "M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z",
|
|
1989
2144
|
style: { fill: "#ff6164" }
|
|
1990
2145
|
}
|
|
1991
2146
|
),
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
1993
|
-
/* @__PURE__ */ (0,
|
|
2147
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 9.53 9.53 0 0 0 .75.73Z" }),
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z" })
|
|
1994
2149
|
] }),
|
|
1995
|
-
/* @__PURE__ */ (0,
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("g", { children: [
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1997
2152
|
"ellipse",
|
|
1998
2153
|
{
|
|
1999
2154
|
cx: "53.22",
|
|
@@ -2003,7 +2158,7 @@ var init_bun = __esm({
|
|
|
2003
2158
|
style: { fill: "#febbd0" }
|
|
2004
2159
|
}
|
|
2005
2160
|
),
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2007
2162
|
"ellipse",
|
|
2008
2163
|
{
|
|
2009
2164
|
cx: "22.95",
|
|
@@ -2013,14 +2168,14 @@ var init_bun = __esm({
|
|
|
2013
2168
|
style: { fill: "#febbd0" }
|
|
2014
2169
|
}
|
|
2015
2170
|
),
|
|
2016
|
-
/* @__PURE__ */ (0,
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2017
2172
|
"path",
|
|
2018
2173
|
{
|
|
2019
2174
|
d: "M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z",
|
|
2020
2175
|
style: { fillRule: "evenodd" }
|
|
2021
2176
|
}
|
|
2022
2177
|
),
|
|
2023
|
-
/* @__PURE__ */ (0,
|
|
2178
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2024
2179
|
"path",
|
|
2025
2180
|
{
|
|
2026
2181
|
d: "M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z",
|
|
@@ -2033,12 +2188,12 @@ var init_bun = __esm({
|
|
|
2033
2188
|
});
|
|
2034
2189
|
|
|
2035
2190
|
// src/client/theme/icons/deno.tsx
|
|
2036
|
-
var
|
|
2191
|
+
var import_jsx_runtime26, Deno;
|
|
2037
2192
|
var init_deno = __esm({
|
|
2038
2193
|
"src/client/theme/icons/deno.tsx"() {
|
|
2039
2194
|
"use strict";
|
|
2040
|
-
|
|
2041
|
-
Deno = (props) => /* @__PURE__ */ (0,
|
|
2195
|
+
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2196
|
+
Deno = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2042
2197
|
"svg",
|
|
2043
2198
|
{
|
|
2044
2199
|
...props,
|
|
@@ -2048,7 +2203,7 @@ var init_deno = __esm({
|
|
|
2048
2203
|
strokeMiterlimit: "2",
|
|
2049
2204
|
clipRule: "evenodd",
|
|
2050
2205
|
viewBox: "0 0 441 441",
|
|
2051
|
-
children: /* @__PURE__ */ (0,
|
|
2206
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2052
2207
|
"path",
|
|
2053
2208
|
{
|
|
2054
2209
|
fill: "currentColor",
|
|
@@ -2095,19 +2250,19 @@ function PackageManagerTabs({
|
|
|
2095
2250
|
pkg = "",
|
|
2096
2251
|
className = ""
|
|
2097
2252
|
}) {
|
|
2098
|
-
const [activeTab, setActiveTab] = (0,
|
|
2099
|
-
const [copied, setCopied] = (0,
|
|
2253
|
+
const [activeTab, setActiveTab] = (0, import_react16.useState)("npm");
|
|
2254
|
+
const [copied, setCopied] = (0, import_react16.useState)(false);
|
|
2100
2255
|
const activeCommand = getCommandForManager(activeTab, command, pkg);
|
|
2101
|
-
const handleCopy = (0,
|
|
2256
|
+
const handleCopy = (0, import_react16.useCallback)(async () => {
|
|
2102
2257
|
copyToClipboard(activeCommand);
|
|
2103
2258
|
setCopied(true);
|
|
2104
2259
|
setTimeout(() => setCopied(false), 2e3);
|
|
2105
2260
|
}, [activeCommand]);
|
|
2106
|
-
return /* @__PURE__ */ (0,
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: `pkg-tabs-wrapper ${className}`, children: [
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pkg-tabs-header", children: MANAGERS.map((mgr) => {
|
|
2108
2263
|
const Icon = mgr.icon;
|
|
2109
2264
|
const isActive = activeTab === mgr.id;
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2111
2266
|
"button",
|
|
2112
2267
|
{
|
|
2113
2268
|
className: `pkg-tab-btn ${isActive ? "active" : ""}`,
|
|
@@ -2115,40 +2270,40 @@ function PackageManagerTabs({
|
|
|
2115
2270
|
"aria-selected": isActive,
|
|
2116
2271
|
role: "tab",
|
|
2117
2272
|
children: [
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { className: "pkg-tab-icon", width: "16", height: "16" }),
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: mgr.label })
|
|
2120
2275
|
]
|
|
2121
2276
|
},
|
|
2122
2277
|
mgr.id
|
|
2123
2278
|
);
|
|
2124
2279
|
}) }),
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "code-block-wrapper pkg-tabs-content", children: [
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2127
2282
|
"button",
|
|
2128
2283
|
{
|
|
2129
2284
|
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
2130
2285
|
onClick: handleCopy,
|
|
2131
2286
|
type: "button",
|
|
2132
2287
|
"aria-label": "Copy code",
|
|
2133
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2288
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Copy, { size: 14 })
|
|
2134
2289
|
}
|
|
2135
2290
|
),
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "line", children: activeCommand }) }) })
|
|
2137
2292
|
] })
|
|
2138
2293
|
] });
|
|
2139
2294
|
}
|
|
2140
|
-
var
|
|
2295
|
+
var import_react16, import_lucide_react13, import_jsx_runtime27, MANAGERS;
|
|
2141
2296
|
var init_PackageManagerTabs = __esm({
|
|
2142
2297
|
"src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx"() {
|
|
2143
2298
|
"use strict";
|
|
2144
|
-
|
|
2299
|
+
import_react16 = require("react");
|
|
2145
2300
|
import_lucide_react13 = require("lucide-react");
|
|
2146
2301
|
init_npm();
|
|
2147
2302
|
init_pnpm();
|
|
2148
2303
|
init_bun();
|
|
2149
2304
|
init_deno();
|
|
2150
2305
|
init_utils();
|
|
2151
|
-
|
|
2306
|
+
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2152
2307
|
MANAGERS = [
|
|
2153
2308
|
{ id: "npm", label: "npm", icon: NPM },
|
|
2154
2309
|
{ id: "pnpm", label: "pnpm", icon: Pnpm },
|
|
@@ -2172,7 +2327,7 @@ var init_PackageManagerTabs2 = __esm({
|
|
|
2172
2327
|
|
|
2173
2328
|
// src/client/app/index.tsx
|
|
2174
2329
|
function useConfig() {
|
|
2175
|
-
return (0,
|
|
2330
|
+
return (0, import_react19.useContext)(ConfigContext);
|
|
2176
2331
|
}
|
|
2177
2332
|
function AppShell({
|
|
2178
2333
|
initialRoutes,
|
|
@@ -2182,8 +2337,8 @@ function AppShell({
|
|
|
2182
2337
|
homePage: HomePage,
|
|
2183
2338
|
components: customComponents = {}
|
|
2184
2339
|
}) {
|
|
2185
|
-
const [routesInfo, setRoutesInfo] = (0,
|
|
2186
|
-
const [config] = (0,
|
|
2340
|
+
const [routesInfo, setRoutesInfo] = (0, import_react17.useState)(initialRoutes);
|
|
2341
|
+
const [config] = (0, import_react17.useState)(initialConfig);
|
|
2187
2342
|
const resolveRoutes = (infos) => {
|
|
2188
2343
|
return infos.filter(
|
|
2189
2344
|
(route) => !(HomePage && (route.path === "/" || route.path === ""))
|
|
@@ -2194,35 +2349,35 @@ function AppShell({
|
|
|
2194
2349
|
const loader = loaderKey ? modules[loaderKey] : null;
|
|
2195
2350
|
return {
|
|
2196
2351
|
...route,
|
|
2197
|
-
Component:
|
|
2352
|
+
Component: import_react17.default.lazy(() => {
|
|
2198
2353
|
if (!loader)
|
|
2199
|
-
return Promise.resolve({ default: () => /* @__PURE__ */ (0,
|
|
2354
|
+
return Promise.resolve({ default: () => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(NotFound, {}) });
|
|
2200
2355
|
return loader();
|
|
2201
2356
|
})
|
|
2202
2357
|
};
|
|
2203
2358
|
});
|
|
2204
2359
|
};
|
|
2205
|
-
const [resolvedRoutes, setResolvedRoutes] = (0,
|
|
2360
|
+
const [resolvedRoutes, setResolvedRoutes] = (0, import_react17.useState)(
|
|
2206
2361
|
() => resolveRoutes(initialRoutes)
|
|
2207
2362
|
);
|
|
2208
|
-
(0,
|
|
2363
|
+
(0, import_react17.useEffect)(() => {
|
|
2209
2364
|
if (hot) {
|
|
2210
2365
|
hot.on("boltdocs:routes-update", (newRoutes) => {
|
|
2211
2366
|
setRoutesInfo(newRoutes);
|
|
2212
2367
|
});
|
|
2213
2368
|
}
|
|
2214
2369
|
}, [hot]);
|
|
2215
|
-
(0,
|
|
2370
|
+
(0, import_react17.useEffect)(() => {
|
|
2216
2371
|
setResolvedRoutes(resolveRoutes(routesInfo));
|
|
2217
2372
|
}, [routesInfo, modules]);
|
|
2218
|
-
return /* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
HomePage && /* @__PURE__ */ (0,
|
|
2373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(PreloadProvider, { routes: routesInfo, modules, children: [
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScrollHandler, {}),
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_router_dom9.Routes, { children: [
|
|
2376
|
+
HomePage && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2222
2377
|
import_react_router_dom9.Route,
|
|
2223
2378
|
{
|
|
2224
2379
|
path: "/",
|
|
2225
|
-
element: /* @__PURE__ */ (0,
|
|
2380
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2226
2381
|
ThemeLayout,
|
|
2227
2382
|
{
|
|
2228
2383
|
config,
|
|
@@ -2231,20 +2386,20 @@ function AppShell({
|
|
|
2231
2386
|
toc: null,
|
|
2232
2387
|
breadcrumbs: null,
|
|
2233
2388
|
...config.themeConfig?.layoutProps,
|
|
2234
|
-
children: /* @__PURE__ */ (0,
|
|
2389
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(HomePage, {})
|
|
2235
2390
|
}
|
|
2236
2391
|
)
|
|
2237
2392
|
}
|
|
2238
2393
|
),
|
|
2239
|
-
/* @__PURE__ */ (0,
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2240
2395
|
import_react_router_dom9.Route,
|
|
2241
2396
|
{
|
|
2242
|
-
element: /* @__PURE__ */ (0,
|
|
2243
|
-
children: resolvedRoutes.map((route) => /* @__PURE__ */ (0,
|
|
2397
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DocsLayout, { config, routes: routesInfo }),
|
|
2398
|
+
children: resolvedRoutes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2244
2399
|
import_react_router_dom9.Route,
|
|
2245
2400
|
{
|
|
2246
2401
|
path: route.path === "" ? "/" : route.path,
|
|
2247
|
-
element: /* @__PURE__ */ (0,
|
|
2402
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react17.default.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2248
2403
|
MdxPage,
|
|
2249
2404
|
{
|
|
2250
2405
|
Component: route.Component,
|
|
@@ -2257,17 +2412,17 @@ function AppShell({
|
|
|
2257
2412
|
},
|
|
2258
2413
|
"docs-layout"
|
|
2259
2414
|
),
|
|
2260
|
-
/* @__PURE__ */ (0,
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2261
2416
|
import_react_router_dom9.Route,
|
|
2262
2417
|
{
|
|
2263
2418
|
path: "*",
|
|
2264
|
-
element: /* @__PURE__ */ (0,
|
|
2419
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2265
2420
|
ThemeLayout,
|
|
2266
2421
|
{
|
|
2267
2422
|
config,
|
|
2268
2423
|
routes: routesInfo,
|
|
2269
2424
|
...config.themeConfig?.layoutProps,
|
|
2270
|
-
children: /* @__PURE__ */ (0,
|
|
2425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(NotFound, {})
|
|
2271
2426
|
}
|
|
2272
2427
|
)
|
|
2273
2428
|
}
|
|
@@ -2277,7 +2432,7 @@ function AppShell({
|
|
|
2277
2432
|
}
|
|
2278
2433
|
function ScrollHandler() {
|
|
2279
2434
|
const { pathname, hash } = (0, import_react_router_dom9.useLocation)();
|
|
2280
|
-
(0,
|
|
2435
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
2281
2436
|
if (hash) {
|
|
2282
2437
|
const id = hash.replace("#", "");
|
|
2283
2438
|
const element = document.getElementById(id);
|
|
@@ -2302,13 +2457,13 @@ function DocsLayout({
|
|
|
2302
2457
|
config,
|
|
2303
2458
|
routes
|
|
2304
2459
|
}) {
|
|
2305
|
-
return /* @__PURE__ */ (0,
|
|
2460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2306
2461
|
ThemeLayout,
|
|
2307
2462
|
{
|
|
2308
2463
|
config,
|
|
2309
2464
|
routes,
|
|
2310
2465
|
...config.themeConfig?.layoutProps,
|
|
2311
|
-
children: /* @__PURE__ */ (0,
|
|
2466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_router_dom9.Outlet, {})
|
|
2312
2467
|
}
|
|
2313
2468
|
);
|
|
2314
2469
|
}
|
|
@@ -2317,7 +2472,7 @@ function MdxPage({
|
|
|
2317
2472
|
customComponents = {}
|
|
2318
2473
|
}) {
|
|
2319
2474
|
const allComponents = { ...mdxComponents, ...customComponents };
|
|
2320
|
-
return /* @__PURE__ */ (0,
|
|
2475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react18.MDXProvider, { components: allComponents, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Component, {}) });
|
|
2321
2476
|
}
|
|
2322
2477
|
function createBoltdocsApp(options) {
|
|
2323
2478
|
const { target, routes, config, modules, hot, homePage } = options;
|
|
@@ -2327,7 +2482,7 @@ function createBoltdocsApp(options) {
|
|
|
2327
2482
|
`[boltdocs] Mount target "${target}" not found in document.`
|
|
2328
2483
|
);
|
|
2329
2484
|
}
|
|
2330
|
-
const app = /* @__PURE__ */ (0,
|
|
2485
|
+
const app = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react17.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_router_dom9.BrowserRouter, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2331
2486
|
AppShell,
|
|
2332
2487
|
{
|
|
2333
2488
|
initialRoutes: routes,
|
|
@@ -2341,31 +2496,27 @@ function createBoltdocsApp(options) {
|
|
|
2341
2496
|
container.innerHTML = "";
|
|
2342
2497
|
import_client.default.createRoot(container).render(app);
|
|
2343
2498
|
}
|
|
2344
|
-
var
|
|
2499
|
+
var import_react17, import_client, import_react_router_dom9, import_react18, import_react19, import_lucide_react14, import_jsx_runtime28, ConfigContext, Video2, PackageManagerTabs2, Heading, mdxComponents;
|
|
2345
2500
|
var init_app = __esm({
|
|
2346
2501
|
"src/client/app/index.tsx"() {
|
|
2347
2502
|
"use strict";
|
|
2348
|
-
|
|
2503
|
+
import_react17 = __toESM(require("react"));
|
|
2349
2504
|
import_client = __toESM(require("react-dom/client"));
|
|
2350
2505
|
import_react_router_dom9 = require("react-router-dom");
|
|
2351
2506
|
init_Layout2();
|
|
2352
2507
|
init_NotFound2();
|
|
2353
2508
|
init_Loading2();
|
|
2354
|
-
|
|
2355
|
-
|
|
2509
|
+
import_react18 = require("@mdx-js/react");
|
|
2510
|
+
import_react19 = require("react");
|
|
2356
2511
|
import_lucide_react14 = require("lucide-react");
|
|
2512
|
+
init_CodeBlock2();
|
|
2357
2513
|
init_preload();
|
|
2358
|
-
|
|
2359
|
-
ConfigContext = (0,
|
|
2360
|
-
|
|
2361
|
-
() => Promise.resolve().then(() => (init_CodeBlock2(), CodeBlock_exports)).then((m) => ({
|
|
2362
|
-
default: m.CodeBlock
|
|
2363
|
-
}))
|
|
2364
|
-
);
|
|
2365
|
-
Video2 = (0, import_react18.lazy)(
|
|
2514
|
+
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2515
|
+
ConfigContext = (0, import_react19.createContext)(null);
|
|
2516
|
+
Video2 = (0, import_react19.lazy)(
|
|
2366
2517
|
() => Promise.resolve().then(() => (init_Video2(), Video_exports)).then((m) => ({ default: m.Video }))
|
|
2367
2518
|
);
|
|
2368
|
-
PackageManagerTabs2 = (0,
|
|
2519
|
+
PackageManagerTabs2 = (0, import_react19.lazy)(
|
|
2369
2520
|
() => Promise.resolve().then(() => (init_PackageManagerTabs2(), PackageManagerTabs_exports)).then((m) => ({
|
|
2370
2521
|
default: m.PackageManagerTabs
|
|
2371
2522
|
}))
|
|
@@ -2376,23 +2527,21 @@ var init_app = __esm({
|
|
|
2376
2527
|
children
|
|
2377
2528
|
}) => {
|
|
2378
2529
|
const Tag = `h${level}`;
|
|
2379
|
-
return /* @__PURE__ */ (0,
|
|
2530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tag, { id, className: "boltdocs-heading", children: [
|
|
2380
2531
|
children,
|
|
2381
|
-
id && /* @__PURE__ */ (0,
|
|
2532
|
+
id && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Link, { size: 16 }) })
|
|
2382
2533
|
] });
|
|
2383
2534
|
};
|
|
2384
2535
|
mdxComponents = {
|
|
2385
|
-
h1: (props) => /* @__PURE__ */ (0,
|
|
2386
|
-
h2: (props) => /* @__PURE__ */ (0,
|
|
2387
|
-
h3: (props) => /* @__PURE__ */ (0,
|
|
2388
|
-
h4: (props) => /* @__PURE__ */ (0,
|
|
2389
|
-
h5: (props) => /* @__PURE__ */ (0,
|
|
2390
|
-
h6: (props) => /* @__PURE__ */ (0,
|
|
2391
|
-
pre: (props) => {
|
|
2392
|
-
|
|
2393
|
-
},
|
|
2394
|
-
video: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "video-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Video2, { ...props }) }),
|
|
2395
|
-
PackageManagerTabs: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PackageManagerTabs2, { ...props }) })
|
|
2536
|
+
h1: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Heading, { level: 1, ...props }),
|
|
2537
|
+
h2: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Heading, { level: 2, ...props }),
|
|
2538
|
+
h3: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Heading, { level: 3, ...props }),
|
|
2539
|
+
h4: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Heading, { level: 4, ...props }),
|
|
2540
|
+
h5: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Heading, { level: 5, ...props }),
|
|
2541
|
+
h6: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Heading, { level: 6, ...props }),
|
|
2542
|
+
pre: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CodeBlock, { ...props, children: props.children }),
|
|
2543
|
+
video: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "video-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Video2, { ...props }) }),
|
|
2544
|
+
PackageManagerTabs: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PackageManagerTabs2, { ...props }) })
|
|
2396
2545
|
};
|
|
2397
2546
|
}
|
|
2398
2547
|
});
|
|
@@ -2438,10 +2587,10 @@ init_Breadcrumbs2();
|
|
|
2438
2587
|
init_BackgroundGradient2();
|
|
2439
2588
|
|
|
2440
2589
|
// src/client/theme/components/Playground/Playground.tsx
|
|
2441
|
-
var
|
|
2590
|
+
var import_react20 = __toESM(require("react"));
|
|
2442
2591
|
var import_react_live = require("react-live");
|
|
2443
2592
|
var import_lucide_react15 = require("lucide-react");
|
|
2444
|
-
var
|
|
2593
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2445
2594
|
function prepareCode(raw) {
|
|
2446
2595
|
const trimmed = raw.trim();
|
|
2447
2596
|
const fnMatch = trimmed.match(/export\s+default\s+function\s+(\w+)/);
|
|
@@ -2474,48 +2623,48 @@ function Playground({
|
|
|
2474
2623
|
}
|
|
2475
2624
|
const prepared = prepareCode(initialCode);
|
|
2476
2625
|
const useNoInline = forceNoInline ?? prepared.noInline;
|
|
2477
|
-
const [copied, setCopied] = (0,
|
|
2478
|
-
const [activeCode, setActiveCode] = (0,
|
|
2626
|
+
const [copied, setCopied] = (0, import_react20.useState)(false);
|
|
2627
|
+
const [activeCode, setActiveCode] = (0, import_react20.useState)(prepared.code);
|
|
2479
2628
|
const handleCopy = () => {
|
|
2480
2629
|
navigator.clipboard.writeText(activeCode);
|
|
2481
2630
|
setCopied(true);
|
|
2482
2631
|
setTimeout(() => setCopied(false), 2e3);
|
|
2483
2632
|
};
|
|
2484
|
-
const extendedScope = { React:
|
|
2485
|
-
return /* @__PURE__ */ (0,
|
|
2633
|
+
const extendedScope = { React: import_react20.default, ...scope };
|
|
2634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "boltdocs-playground", "data-readonly": readonly, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2486
2635
|
import_react_live.LiveProvider,
|
|
2487
2636
|
{
|
|
2488
2637
|
code: activeCode,
|
|
2489
2638
|
scope: extendedScope,
|
|
2490
2639
|
theme: void 0,
|
|
2491
2640
|
noInline: useNoInline,
|
|
2492
|
-
children: /* @__PURE__ */ (0,
|
|
2493
|
-
/* @__PURE__ */ (0,
|
|
2494
|
-
/* @__PURE__ */ (0,
|
|
2495
|
-
/* @__PURE__ */ (0,
|
|
2496
|
-
/* @__PURE__ */ (0,
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-split-container", children: [
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-panel playground-editor-panel", children: [
|
|
2643
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-panel-header", children: [
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-panel-title", children: [
|
|
2645
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Terminal, { size: 14 }),
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: readonly ? "Code Example" : "Live Editor" })
|
|
2498
2647
|
] }),
|
|
2499
|
-
/* @__PURE__ */ (0,
|
|
2648
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2500
2649
|
"button",
|
|
2501
2650
|
{
|
|
2502
2651
|
className: "playground-copy-btn",
|
|
2503
2652
|
onClick: handleCopy,
|
|
2504
2653
|
title: "Copy code",
|
|
2505
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
2654
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Copy, { size: 14 })
|
|
2506
2655
|
}
|
|
2507
2656
|
)
|
|
2508
2657
|
] }),
|
|
2509
|
-
/* @__PURE__ */ (0,
|
|
2658
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "playground-panel-content playground-editor", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_live.LiveEditor, { disabled: readonly, onChange: setActiveCode }) })
|
|
2510
2659
|
] }),
|
|
2511
|
-
/* @__PURE__ */ (0,
|
|
2512
|
-
/* @__PURE__ */ (0,
|
|
2513
|
-
/* @__PURE__ */ (0,
|
|
2514
|
-
/* @__PURE__ */ (0,
|
|
2660
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-panel playground-preview-panel", children: [
|
|
2661
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "playground-panel-header", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-panel-title", children: [
|
|
2662
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Play, { size: 14 }),
|
|
2663
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: "Preview" })
|
|
2515
2664
|
] }) }),
|
|
2516
|
-
/* @__PURE__ */ (0,
|
|
2517
|
-
/* @__PURE__ */ (0,
|
|
2518
|
-
/* @__PURE__ */ (0,
|
|
2665
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "playground-panel-content playground-preview", children: [
|
|
2666
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_live.LivePreview, {}),
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_live.LiveError, { className: "playground-error" })
|
|
2519
2668
|
] })
|
|
2520
2669
|
] })
|
|
2521
2670
|
] })
|
|
@@ -2530,7 +2679,7 @@ init_CodeBlock2();
|
|
|
2530
2679
|
init_Video2();
|
|
2531
2680
|
|
|
2532
2681
|
// src/client/theme/components/mdx/Button.tsx
|
|
2533
|
-
var
|
|
2682
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2534
2683
|
function Button({
|
|
2535
2684
|
variant = "primary",
|
|
2536
2685
|
size = "md",
|
|
@@ -2541,7 +2690,7 @@ function Button({
|
|
|
2541
2690
|
}) {
|
|
2542
2691
|
const cls = `ld-btn ld-btn--${variant} ld-btn--${size} ${className}`.trim();
|
|
2543
2692
|
if (href) {
|
|
2544
|
-
return /* @__PURE__ */ (0,
|
|
2693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2545
2694
|
"a",
|
|
2546
2695
|
{
|
|
2547
2696
|
href,
|
|
@@ -2552,18 +2701,18 @@ function Button({
|
|
|
2552
2701
|
}
|
|
2553
2702
|
);
|
|
2554
2703
|
}
|
|
2555
|
-
return /* @__PURE__ */ (0,
|
|
2704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { className: cls, ...rest, children });
|
|
2556
2705
|
}
|
|
2557
2706
|
|
|
2558
2707
|
// src/client/theme/components/mdx/Badge.tsx
|
|
2559
|
-
var
|
|
2708
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2560
2709
|
function Badge({
|
|
2561
2710
|
variant = "default",
|
|
2562
2711
|
children,
|
|
2563
2712
|
className = "",
|
|
2564
2713
|
...rest
|
|
2565
2714
|
}) {
|
|
2566
|
-
return /* @__PURE__ */ (0,
|
|
2715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2567
2716
|
"span",
|
|
2568
2717
|
{
|
|
2569
2718
|
className: `ld-badge ld-badge--${variant} ${className}`.trim(),
|
|
@@ -2574,14 +2723,14 @@ function Badge({
|
|
|
2574
2723
|
}
|
|
2575
2724
|
|
|
2576
2725
|
// src/client/theme/components/mdx/Card.tsx
|
|
2577
|
-
var
|
|
2726
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2578
2727
|
function Cards({
|
|
2579
2728
|
cols = 3,
|
|
2580
2729
|
children,
|
|
2581
2730
|
className = "",
|
|
2582
2731
|
...rest
|
|
2583
2732
|
}) {
|
|
2584
|
-
return /* @__PURE__ */ (0,
|
|
2733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: `ld-cards ld-cards--${cols} ${className}`.trim(), ...rest, children });
|
|
2585
2734
|
}
|
|
2586
2735
|
function Card({
|
|
2587
2736
|
title,
|
|
@@ -2591,13 +2740,13 @@ function Card({
|
|
|
2591
2740
|
className = "",
|
|
2592
2741
|
...rest
|
|
2593
2742
|
}) {
|
|
2594
|
-
const inner = /* @__PURE__ */ (0,
|
|
2595
|
-
icon && /* @__PURE__ */ (0,
|
|
2596
|
-
title && /* @__PURE__ */ (0,
|
|
2597
|
-
children && /* @__PURE__ */ (0,
|
|
2743
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2744
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ld-card__icon", children: icon }),
|
|
2745
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "ld-card__title", children: title }),
|
|
2746
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "ld-card__body", children })
|
|
2598
2747
|
] });
|
|
2599
2748
|
if (href) {
|
|
2600
|
-
return /* @__PURE__ */ (0,
|
|
2749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2601
2750
|
"a",
|
|
2602
2751
|
{
|
|
2603
2752
|
href,
|
|
@@ -2607,11 +2756,11 @@ function Card({
|
|
|
2607
2756
|
}
|
|
2608
2757
|
);
|
|
2609
2758
|
}
|
|
2610
|
-
return /* @__PURE__ */ (0,
|
|
2759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: `ld-card ${className}`.trim(), ...rest, children: inner });
|
|
2611
2760
|
}
|
|
2612
2761
|
|
|
2613
2762
|
// src/client/theme/components/mdx/Tabs.tsx
|
|
2614
|
-
var
|
|
2763
|
+
var import_react21 = require("react");
|
|
2615
2764
|
init_CodeBlock2();
|
|
2616
2765
|
init_npm();
|
|
2617
2766
|
init_pnpm();
|
|
@@ -2619,16 +2768,16 @@ init_bun();
|
|
|
2619
2768
|
init_deno();
|
|
2620
2769
|
|
|
2621
2770
|
// src/client/theme/icons/yarn.tsx
|
|
2622
|
-
var
|
|
2623
|
-
var Yarn = (props) => /* @__PURE__ */ (0,
|
|
2624
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2772
|
+
var Yarn = (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("svg", { ...props, viewBox: "0 0 256 256", children: [
|
|
2773
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2625
2774
|
"path",
|
|
2626
2775
|
{
|
|
2627
2776
|
fill: "#2C8EBB",
|
|
2628
2777
|
d: "M128 0C57.307 0 0 57.307 0 128s57.307 128 128 128 128-57.307 128-128S198.693 0 128 0zm0 234.667C69.195 234.667 21.333 186.805 21.333 128S69.195 21.333 128 21.333 234.667 69.195 234.667 128 186.805 234.667 128 234.667z"
|
|
2629
2778
|
}
|
|
2630
2779
|
),
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2780
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2632
2781
|
"path",
|
|
2633
2782
|
{
|
|
2634
2783
|
fill: "#2C8EBB",
|
|
@@ -2638,25 +2787,25 @@ var Yarn = (props) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { ..
|
|
|
2638
2787
|
] });
|
|
2639
2788
|
|
|
2640
2789
|
// src/client/theme/components/mdx/Tabs.tsx
|
|
2641
|
-
var
|
|
2790
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2642
2791
|
function Tab({ children }) {
|
|
2643
|
-
const content = typeof children === "string" ? /* @__PURE__ */ (0,
|
|
2644
|
-
return /* @__PURE__ */ (0,
|
|
2792
|
+
const content = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("code", { children: children.trim() }) }) : children;
|
|
2793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ld-tab-panel", children: content });
|
|
2645
2794
|
}
|
|
2646
2795
|
var getIconForLabel = (label) => {
|
|
2647
2796
|
const l = label.toLowerCase();
|
|
2648
|
-
if (l.includes("npm")) return /* @__PURE__ */ (0,
|
|
2649
|
-
if (l.includes("pnpm")) return /* @__PURE__ */ (0,
|
|
2650
|
-
if (l.includes("yarn")) return /* @__PURE__ */ (0,
|
|
2651
|
-
if (l.includes("bun")) return /* @__PURE__ */ (0,
|
|
2652
|
-
if (l.includes("deno")) return /* @__PURE__ */ (0,
|
|
2797
|
+
if (l.includes("npm")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(NPM, {});
|
|
2798
|
+
if (l.includes("pnpm")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Pnpm, {});
|
|
2799
|
+
if (l.includes("yarn")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Yarn, {});
|
|
2800
|
+
if (l.includes("bun")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Bun, {});
|
|
2801
|
+
if (l.includes("deno")) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Deno, {});
|
|
2653
2802
|
return null;
|
|
2654
2803
|
};
|
|
2655
2804
|
function Tabs({ defaultIndex = 0, children }) {
|
|
2656
|
-
const [active, setActive] = (0,
|
|
2657
|
-
const tabRefs = (0,
|
|
2658
|
-
const tabs =
|
|
2659
|
-
(child) => (0,
|
|
2805
|
+
const [active, setActive] = (0, import_react21.useState)(defaultIndex);
|
|
2806
|
+
const tabRefs = (0, import_react21.useRef)([]);
|
|
2807
|
+
const tabs = import_react21.Children.toArray(children).filter(
|
|
2808
|
+
(child) => (0, import_react21.isValidElement)(child) && child.props?.label
|
|
2660
2809
|
);
|
|
2661
2810
|
const handleKeyDown = (e) => {
|
|
2662
2811
|
let newIndex = active;
|
|
@@ -2670,11 +2819,11 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
2670
2819
|
tabRefs.current[newIndex]?.focus();
|
|
2671
2820
|
}
|
|
2672
2821
|
};
|
|
2673
|
-
return /* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ld-tabs", children: [
|
|
2823
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
|
|
2675
2824
|
const label = child.props.label;
|
|
2676
2825
|
const Icon = getIconForLabel(label);
|
|
2677
|
-
return /* @__PURE__ */ (0,
|
|
2826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2678
2827
|
"button",
|
|
2679
2828
|
{
|
|
2680
2829
|
role: "tab",
|
|
@@ -2689,13 +2838,13 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
2689
2838
|
onClick: () => setActive(i),
|
|
2690
2839
|
children: [
|
|
2691
2840
|
Icon,
|
|
2692
|
-
/* @__PURE__ */ (0,
|
|
2841
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: label })
|
|
2693
2842
|
]
|
|
2694
2843
|
},
|
|
2695
2844
|
i
|
|
2696
2845
|
);
|
|
2697
2846
|
}) }),
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2699
2848
|
"div",
|
|
2700
2849
|
{
|
|
2701
2850
|
className: "ld-tabs__content",
|
|
@@ -2710,13 +2859,13 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
2710
2859
|
|
|
2711
2860
|
// src/client/theme/components/mdx/Admonition.tsx
|
|
2712
2861
|
var import_lucide_react16 = require("lucide-react");
|
|
2713
|
-
var
|
|
2862
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2714
2863
|
var ICON_MAP2 = {
|
|
2715
|
-
note: /* @__PURE__ */ (0,
|
|
2716
|
-
tip: /* @__PURE__ */ (0,
|
|
2717
|
-
info: /* @__PURE__ */ (0,
|
|
2718
|
-
warning: /* @__PURE__ */ (0,
|
|
2719
|
-
danger: /* @__PURE__ */ (0,
|
|
2864
|
+
note: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react16.Bookmark, { size: 18 }),
|
|
2865
|
+
tip: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react16.Lightbulb, { size: 18 }),
|
|
2866
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react16.Info, { size: 18 }),
|
|
2867
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react16.AlertTriangle, { size: 18 }),
|
|
2868
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react16.ShieldAlert, { size: 18 })
|
|
2720
2869
|
};
|
|
2721
2870
|
var LABEL_MAP = {
|
|
2722
2871
|
note: "Note",
|
|
@@ -2732,35 +2881,35 @@ function Admonition({
|
|
|
2732
2881
|
className = "",
|
|
2733
2882
|
...rest
|
|
2734
2883
|
}) {
|
|
2735
|
-
return /* @__PURE__ */ (0,
|
|
2884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2736
2885
|
"div",
|
|
2737
2886
|
{
|
|
2738
2887
|
className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
|
|
2739
2888
|
role: type === "warning" || type === "danger" ? "alert" : "note",
|
|
2740
2889
|
...rest,
|
|
2741
2890
|
children: [
|
|
2742
|
-
/* @__PURE__ */ (0,
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "ld-admonition__header", children: [
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ld-admonition__icon", children: ICON_MAP2[type] }),
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
|
|
2745
2894
|
] }),
|
|
2746
|
-
/* @__PURE__ */ (0,
|
|
2895
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "ld-admonition__body", children })
|
|
2747
2896
|
]
|
|
2748
2897
|
}
|
|
2749
2898
|
);
|
|
2750
2899
|
}
|
|
2751
|
-
var Note = (props) => /* @__PURE__ */ (0,
|
|
2752
|
-
var Tip = (props) => /* @__PURE__ */ (0,
|
|
2753
|
-
var Warning = (props) => /* @__PURE__ */ (0,
|
|
2754
|
-
var Danger = (props) => /* @__PURE__ */ (0,
|
|
2755
|
-
var InfoBox = (props) => /* @__PURE__ */ (0,
|
|
2900
|
+
var Note = (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Admonition, { type: "note", ...props });
|
|
2901
|
+
var Tip = (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Admonition, { type: "tip", ...props });
|
|
2902
|
+
var Warning = (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Admonition, { type: "warning", ...props });
|
|
2903
|
+
var Danger = (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Admonition, { type: "danger", ...props });
|
|
2904
|
+
var InfoBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Admonition, { type: "info", ...props });
|
|
2756
2905
|
|
|
2757
2906
|
// src/client/theme/components/mdx/List.tsx
|
|
2758
|
-
var
|
|
2907
|
+
var import_react22 = __toESM(require("react"));
|
|
2759
2908
|
var import_lucide_react17 = require("lucide-react");
|
|
2760
|
-
var
|
|
2909
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2761
2910
|
var ICON_MAP3 = {
|
|
2762
|
-
checked: /* @__PURE__ */ (0,
|
|
2763
|
-
arrow: /* @__PURE__ */ (0,
|
|
2911
|
+
checked: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react17.Check, { size: 14, className: "ld-list__icon" }),
|
|
2912
|
+
arrow: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react17.ChevronRight, { size: 14, className: "ld-list__icon" })
|
|
2764
2913
|
};
|
|
2765
2914
|
function List({
|
|
2766
2915
|
variant = "default",
|
|
@@ -2769,14 +2918,14 @@ function List({
|
|
|
2769
2918
|
...rest
|
|
2770
2919
|
}) {
|
|
2771
2920
|
if (variant === "default") {
|
|
2772
|
-
return /* @__PURE__ */ (0,
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
|
|
2773
2922
|
}
|
|
2774
2923
|
const icon = ICON_MAP3[variant];
|
|
2775
|
-
return /* @__PURE__ */ (0,
|
|
2776
|
-
if (!
|
|
2777
|
-
return /* @__PURE__ */ (0,
|
|
2924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: import_react22.Children.map(children, (child) => {
|
|
2925
|
+
if (!import_react22.default.isValidElement(child)) return child;
|
|
2926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("li", { className: "ld-list__item", children: [
|
|
2778
2927
|
icon,
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "ld-list__text", children: child.props.children })
|
|
2780
2929
|
] });
|
|
2781
2930
|
}) });
|
|
2782
2931
|
}
|