boltdocs 1.5.0 → 1.7.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/{PackageManagerTabs-XW3AVXVX.mjs → PackageManagerTabs-NVT7G625.mjs} +1 -1
- package/dist/{SearchDialog-CEVPEMT3.css → SearchDialog-UOAW6IR3.css} +361 -113
- package/dist/{SearchDialog-5ISK64QY.mjs → SearchDialog-YOXMFGH6.mjs} +1 -1
- package/dist/{chunk-S5G55FBI.mjs → chunk-7SFUJWTB.mjs} +4 -4
- package/dist/{chunk-FMQ4HRKZ.mjs → chunk-MULKZFVN.mjs} +873 -759
- package/dist/client/index.css +361 -113
- package/dist/client/index.d.mts +39 -8
- package/dist/client/index.d.ts +39 -8
- package/dist/client/index.js +722 -467
- package/dist/client/index.mjs +197 -58
- package/dist/client/ssr.css +361 -113
- package/dist/client/ssr.d.mts +3 -1
- package/dist/client/ssr.d.ts +3 -1
- package/dist/client/ssr.js +533 -412
- package/dist/client/ssr.mjs +3 -2
- package/dist/{config-DkZg5aCf.d.ts → config-D68h41CA.d.mts} +21 -2
- package/dist/{config-DkZg5aCf.d.mts → config-D68h41CA.d.ts} +21 -2
- package/dist/node/index.d.mts +10 -2
- package/dist/node/index.d.ts +10 -2
- package/dist/node/index.js +45 -21
- package/dist/node/index.mjs +45 -21
- package/dist/{types-DGIo1VKD.d.ts → types-CviV0GbX.d.mts} +13 -0
- package/dist/{types-DGIo1VKD.d.mts → types-CviV0GbX.d.ts} +13 -0
- package/package.json +1 -1
- package/src/client/app/index.tsx +8 -4
- package/src/client/index.ts +4 -0
- package/src/client/ssr.tsx +4 -1
- package/src/client/theme/components/mdx/FileTree.tsx +229 -0
- package/src/client/theme/components/mdx/Table.tsx +53 -0
- package/src/client/theme/components/mdx/Tabs.tsx +1 -4
- package/src/client/theme/components/mdx/index.ts +6 -0
- package/src/client/theme/components/mdx/mdx-components.css +158 -0
- package/src/client/theme/icons/pnpm.tsx +5 -5
- package/src/client/theme/styles/markdown.css +8 -3
- package/src/client/theme/styles/variables.css +10 -9
- package/src/client/theme/ui/Layout/Layout.tsx +2 -10
- package/src/client/theme/ui/Layout/base.css +15 -3
- package/src/client/theme/ui/Link/Link.tsx +2 -2
- package/src/client/theme/ui/Link/LinkPreview.tsx +9 -14
- package/src/client/theme/ui/Link/link-preview.css +30 -27
- package/src/client/theme/ui/Navbar/Navbar.tsx +65 -17
- package/src/client/theme/ui/Navbar/Tabs.tsx +74 -0
- package/src/client/theme/ui/Navbar/navbar.css +111 -5
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +65 -49
- package/src/client/theme/ui/OnThisPage/toc.css +30 -10
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +97 -57
- package/src/client/theme/ui/Sidebar/sidebar.css +61 -67
- package/src/client/types.ts +10 -0
- package/src/node/config.ts +19 -1
- package/src/node/plugin/entry.ts +5 -1
- package/src/node/plugin/index.ts +2 -1
- package/src/node/routes/index.ts +12 -1
- package/src/node/routes/parser.ts +21 -7
- package/src/node/routes/types.ts +9 -1
- package/src/node/ssg/index.ts +2 -1
- package/src/node/ssg/options.ts +2 -0
- package/src/client/theme/icons/yarn.tsx +0 -16
package/dist/client/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Sidebar,
|
|
11
11
|
ThemeLayout,
|
|
12
12
|
createBoltdocsApp
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-MULKZFVN.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Video
|
|
16
16
|
} from "../chunk-Z7JHYNAS.mjs";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
Deno,
|
|
20
20
|
NPM,
|
|
21
21
|
Pnpm
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-7SFUJWTB.mjs";
|
|
23
23
|
import "../chunk-FMTOYQLO.mjs";
|
|
24
24
|
|
|
25
25
|
// src/client/theme/components/Playground/Playground.tsx
|
|
@@ -191,39 +191,17 @@ function Card({
|
|
|
191
191
|
|
|
192
192
|
// src/client/theme/components/mdx/Tabs.tsx
|
|
193
193
|
import { useState as useState2, Children, isValidElement, useRef } from "react";
|
|
194
|
-
|
|
195
|
-
// src/client/theme/icons/yarn.tsx
|
|
196
194
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
197
|
-
var Yarn = (props) => /* @__PURE__ */ jsxs3("svg", { ...props, viewBox: "0 0 256 256", children: [
|
|
198
|
-
/* @__PURE__ */ jsx5(
|
|
199
|
-
"path",
|
|
200
|
-
{
|
|
201
|
-
fill: "#2C8EBB",
|
|
202
|
-
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"
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ jsx5(
|
|
206
|
-
"path",
|
|
207
|
-
{
|
|
208
|
-
fill: "#2C8EBB",
|
|
209
|
-
d: "M173.045 74.053c-4.632-4.632-12.144-4.632-16.776 0L128 102.323l-28.269-28.27c-4.632-4.632-12.144-4.632-16.776 0-4.632 4.632-4.632 12.144 0 16.776L111.224 119.1l-28.269 28.269c-4.632 4.632-4.632 12.144 0 16.776 2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474L128 135.877l28.269 28.268c2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474c4.632-4.632 4.632-12.144 0-16.776L144.776 119.1l28.269-28.271 c4.632-4.632 4.632-12.144 0-16.776z"
|
|
210
|
-
}
|
|
211
|
-
)
|
|
212
|
-
] });
|
|
213
|
-
|
|
214
|
-
// src/client/theme/components/mdx/Tabs.tsx
|
|
215
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
216
195
|
function Tab({ children }) {
|
|
217
|
-
const content = typeof children === "string" ? /* @__PURE__ */
|
|
218
|
-
return /* @__PURE__ */
|
|
196
|
+
const content = typeof children === "string" ? /* @__PURE__ */ jsx5(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ jsx5("code", { children: children.trim() }) }) : children;
|
|
197
|
+
return /* @__PURE__ */ jsx5("div", { className: "ld-tab-panel", children: content });
|
|
219
198
|
}
|
|
220
199
|
var getIconForLabel = (label) => {
|
|
221
200
|
const l = label.toLowerCase();
|
|
222
|
-
if (l.includes("
|
|
223
|
-
if (l.includes("
|
|
224
|
-
if (l.includes("
|
|
225
|
-
if (l.includes("
|
|
226
|
-
if (l.includes("deno")) return /* @__PURE__ */ jsx6(Deno, {});
|
|
201
|
+
if (l.includes("pnpm")) return /* @__PURE__ */ jsx5(Pnpm, {});
|
|
202
|
+
if (l.includes("npm")) return /* @__PURE__ */ jsx5(NPM, {});
|
|
203
|
+
if (l.includes("bun")) return /* @__PURE__ */ jsx5(Bun, {});
|
|
204
|
+
if (l.includes("deno")) return /* @__PURE__ */ jsx5(Deno, {});
|
|
227
205
|
return null;
|
|
228
206
|
};
|
|
229
207
|
function Tabs({ defaultIndex = 0, children }) {
|
|
@@ -244,11 +222,11 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
244
222
|
tabRefs.current[newIndex]?.focus();
|
|
245
223
|
}
|
|
246
224
|
};
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ jsxs3("div", { className: "ld-tabs", children: [
|
|
226
|
+
/* @__PURE__ */ jsx5("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
|
|
249
227
|
const label = child.props.label;
|
|
250
228
|
const Icon = getIconForLabel(label);
|
|
251
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ jsxs3(
|
|
252
230
|
"button",
|
|
253
231
|
{
|
|
254
232
|
role: "tab",
|
|
@@ -263,13 +241,13 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
263
241
|
onClick: () => setActive(i),
|
|
264
242
|
children: [
|
|
265
243
|
Icon,
|
|
266
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ jsx5("span", { children: label })
|
|
267
245
|
]
|
|
268
246
|
},
|
|
269
247
|
i
|
|
270
248
|
);
|
|
271
249
|
}) }),
|
|
272
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsx5(
|
|
273
251
|
"div",
|
|
274
252
|
{
|
|
275
253
|
className: "ld-tabs__content",
|
|
@@ -290,13 +268,13 @@ import {
|
|
|
290
268
|
ShieldAlert,
|
|
291
269
|
Bookmark
|
|
292
270
|
} from "lucide-react";
|
|
293
|
-
import { jsx as
|
|
271
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
294
272
|
var ICON_MAP = {
|
|
295
|
-
note: /* @__PURE__ */
|
|
296
|
-
tip: /* @__PURE__ */
|
|
297
|
-
info: /* @__PURE__ */
|
|
298
|
-
warning: /* @__PURE__ */
|
|
299
|
-
danger: /* @__PURE__ */
|
|
273
|
+
note: /* @__PURE__ */ jsx6(Bookmark, { size: 18 }),
|
|
274
|
+
tip: /* @__PURE__ */ jsx6(Lightbulb, { size: 18 }),
|
|
275
|
+
info: /* @__PURE__ */ jsx6(Info, { size: 18 }),
|
|
276
|
+
warning: /* @__PURE__ */ jsx6(AlertTriangle, { size: 18 }),
|
|
277
|
+
danger: /* @__PURE__ */ jsx6(ShieldAlert, { size: 18 })
|
|
300
278
|
};
|
|
301
279
|
var LABEL_MAP = {
|
|
302
280
|
note: "Note",
|
|
@@ -312,35 +290,35 @@ function Admonition({
|
|
|
312
290
|
className = "",
|
|
313
291
|
...rest
|
|
314
292
|
}) {
|
|
315
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ jsxs4(
|
|
316
294
|
"div",
|
|
317
295
|
{
|
|
318
296
|
className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
|
|
319
297
|
role: type === "warning" || type === "danger" ? "alert" : "note",
|
|
320
298
|
...rest,
|
|
321
299
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ jsxs4("div", { className: "ld-admonition__header", children: [
|
|
301
|
+
/* @__PURE__ */ jsx6("span", { className: "ld-admonition__icon", children: ICON_MAP[type] }),
|
|
302
|
+
/* @__PURE__ */ jsx6("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
|
|
325
303
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ jsx6("div", { className: "ld-admonition__body", children })
|
|
327
305
|
]
|
|
328
306
|
}
|
|
329
307
|
);
|
|
330
308
|
}
|
|
331
|
-
var Note = (props) => /* @__PURE__ */
|
|
332
|
-
var Tip = (props) => /* @__PURE__ */
|
|
333
|
-
var Warning = (props) => /* @__PURE__ */
|
|
334
|
-
var Danger = (props) => /* @__PURE__ */
|
|
335
|
-
var InfoBox = (props) => /* @__PURE__ */
|
|
309
|
+
var Note = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "note", ...props });
|
|
310
|
+
var Tip = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "tip", ...props });
|
|
311
|
+
var Warning = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "warning", ...props });
|
|
312
|
+
var Danger = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "danger", ...props });
|
|
313
|
+
var InfoBox = (props) => /* @__PURE__ */ jsx6(Admonition, { type: "info", ...props });
|
|
336
314
|
|
|
337
315
|
// src/client/theme/components/mdx/List.tsx
|
|
338
316
|
import React3, { Children as Children2 } from "react";
|
|
339
317
|
import { Check as Check2, ChevronRight } from "lucide-react";
|
|
340
|
-
import { jsx as
|
|
318
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
341
319
|
var ICON_MAP2 = {
|
|
342
|
-
checked: /* @__PURE__ */
|
|
343
|
-
arrow: /* @__PURE__ */
|
|
320
|
+
checked: /* @__PURE__ */ jsx7(Check2, { size: 14, className: "ld-list__icon" }),
|
|
321
|
+
arrow: /* @__PURE__ */ jsx7(ChevronRight, { size: 14, className: "ld-list__icon" })
|
|
344
322
|
};
|
|
345
323
|
function List({
|
|
346
324
|
variant = "default",
|
|
@@ -349,17 +327,176 @@ function List({
|
|
|
349
327
|
...rest
|
|
350
328
|
}) {
|
|
351
329
|
if (variant === "default") {
|
|
352
|
-
return /* @__PURE__ */
|
|
330
|
+
return /* @__PURE__ */ jsx7("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
|
|
353
331
|
}
|
|
354
332
|
const icon = ICON_MAP2[variant];
|
|
355
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ jsx7("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: Children2.map(children, (child) => {
|
|
356
334
|
if (!React3.isValidElement(child)) return child;
|
|
357
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ jsxs5("li", { className: "ld-list__item", children: [
|
|
358
336
|
icon,
|
|
359
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ jsx7("span", { className: "ld-list__text", children: child.props.children })
|
|
360
338
|
] });
|
|
361
339
|
}) });
|
|
362
340
|
}
|
|
341
|
+
|
|
342
|
+
// src/client/theme/components/mdx/FileTree.tsx
|
|
343
|
+
import React4, { Children as Children3, isValidElement as isValidElement2, useState as useState3 } from "react";
|
|
344
|
+
import {
|
|
345
|
+
Folder,
|
|
346
|
+
FileText,
|
|
347
|
+
File,
|
|
348
|
+
FileCode,
|
|
349
|
+
FileImage,
|
|
350
|
+
ChevronRight as ChevronRight2
|
|
351
|
+
} from "lucide-react";
|
|
352
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
353
|
+
function getTextContent(node) {
|
|
354
|
+
if (typeof node === "string") return node;
|
|
355
|
+
if (typeof node === "number") return node.toString();
|
|
356
|
+
if (Array.isArray(node)) return node.map(getTextContent).join("");
|
|
357
|
+
if (isValidElement2(node)) {
|
|
358
|
+
return getTextContent(node.props.children);
|
|
359
|
+
}
|
|
360
|
+
return "";
|
|
361
|
+
}
|
|
362
|
+
function getFileIcon(filename) {
|
|
363
|
+
const name = filename.toLowerCase();
|
|
364
|
+
if (name.endsWith(".ts") || name.endsWith(".tsx") || name.endsWith(".js") || name.endsWith(".jsx") || name.endsWith(".json") || name.endsWith(".mjs") || name.endsWith(".cjs") || name.endsWith(".astro") || name.endsWith(".vue") || name.endsWith(".svelte")) {
|
|
365
|
+
return /* @__PURE__ */ jsx8(FileCode, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
366
|
+
}
|
|
367
|
+
if (name.endsWith(".md") || name.endsWith(".mdx") || name.endsWith(".txt")) {
|
|
368
|
+
return /* @__PURE__ */ jsx8(FileText, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
369
|
+
}
|
|
370
|
+
if (name.endsWith(".png") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".svg") || name.endsWith(".gif")) {
|
|
371
|
+
return /* @__PURE__ */ jsx8(
|
|
372
|
+
FileImage,
|
|
373
|
+
{
|
|
374
|
+
size: 16,
|
|
375
|
+
strokeWidth: 2,
|
|
376
|
+
className: "ld-file-tree__icon-file"
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
return /* @__PURE__ */ jsx8(File, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
381
|
+
}
|
|
382
|
+
function isListElement(node, tag) {
|
|
383
|
+
if (typeof node.type === "string") {
|
|
384
|
+
return node.type === tag;
|
|
385
|
+
}
|
|
386
|
+
if (typeof node.type === "function") {
|
|
387
|
+
return node.type.name === tag || node.type.name?.toLowerCase() === tag;
|
|
388
|
+
}
|
|
389
|
+
if (node.props && node.props.originalType === tag) {
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
if (node.props && node.props.mdxType === tag) {
|
|
393
|
+
return true;
|
|
394
|
+
}
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
function FolderNode({
|
|
398
|
+
labelText,
|
|
399
|
+
nestedNodes,
|
|
400
|
+
depth
|
|
401
|
+
}) {
|
|
402
|
+
const [isOpen, setIsOpen] = useState3(true);
|
|
403
|
+
return /* @__PURE__ */ jsxs6("li", { className: "ld-file-tree__item", children: [
|
|
404
|
+
/* @__PURE__ */ jsxs6(
|
|
405
|
+
"div",
|
|
406
|
+
{
|
|
407
|
+
className: "ld-file-tree__label ld-file-tree__label--folder",
|
|
408
|
+
onClick: () => setIsOpen(!isOpen),
|
|
409
|
+
style: { cursor: "pointer" },
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon ld-file-tree__icon--chevron", children: /* @__PURE__ */ jsx8(
|
|
412
|
+
ChevronRight2,
|
|
413
|
+
{
|
|
414
|
+
size: 14,
|
|
415
|
+
className: `ld-file-tree__chevron ${isOpen ? "ld-file-tree__chevron--open" : ""}`,
|
|
416
|
+
strokeWidth: 3
|
|
417
|
+
}
|
|
418
|
+
) }),
|
|
419
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon", children: /* @__PURE__ */ jsx8(
|
|
420
|
+
Folder,
|
|
421
|
+
{
|
|
422
|
+
size: 16,
|
|
423
|
+
strokeWidth: 2,
|
|
424
|
+
className: "ld-file-tree__icon-folder",
|
|
425
|
+
fill: "currentColor",
|
|
426
|
+
fillOpacity: 0.15
|
|
427
|
+
}
|
|
428
|
+
) }),
|
|
429
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-file-tree__name", children: labelText })
|
|
430
|
+
]
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
isOpen && nestedNodes.length > 0 && /* @__PURE__ */ jsx8("div", { className: "ld-file-tree__nested", children: nestedNodes.map((child, index) => /* @__PURE__ */ jsx8(React4.Fragment, { children: parseNode(child, depth) }, index)) })
|
|
434
|
+
] });
|
|
435
|
+
}
|
|
436
|
+
function parseNode(node, depth = 0) {
|
|
437
|
+
if (!isValidElement2(node)) {
|
|
438
|
+
return node;
|
|
439
|
+
}
|
|
440
|
+
if (isListElement(node, "ul")) {
|
|
441
|
+
return /* @__PURE__ */ jsx8(
|
|
442
|
+
"ul",
|
|
443
|
+
{
|
|
444
|
+
className: `ld-file-tree__list ${depth === 0 ? "ld-file-tree__list--root" : ""}`,
|
|
445
|
+
children: Children3.map(node.props.children, (child, index) => /* @__PURE__ */ jsx8(React4.Fragment, { children: parseNode(child, depth + 1) }, index))
|
|
446
|
+
}
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
if (isListElement(node, "li")) {
|
|
450
|
+
const children = Children3.toArray(node.props.children);
|
|
451
|
+
const nestedListIndex = children.findIndex(
|
|
452
|
+
(child) => isValidElement2(child) && isListElement(child, "ul")
|
|
453
|
+
);
|
|
454
|
+
const hasNested = nestedListIndex !== -1;
|
|
455
|
+
const labelNodes = hasNested ? children.slice(0, nestedListIndex) : children;
|
|
456
|
+
const nestedNodes = hasNested ? children.slice(nestedListIndex) : [];
|
|
457
|
+
const rawLabelContent = getTextContent(labelNodes).trim();
|
|
458
|
+
const isExplicitDir = rawLabelContent.endsWith("/");
|
|
459
|
+
const labelText = isExplicitDir ? rawLabelContent.slice(0, -1) : rawLabelContent;
|
|
460
|
+
const isFolder = hasNested || isExplicitDir;
|
|
461
|
+
if (isFolder) {
|
|
462
|
+
return /* @__PURE__ */ jsx8(
|
|
463
|
+
FolderNode,
|
|
464
|
+
{
|
|
465
|
+
labelText,
|
|
466
|
+
nestedNodes,
|
|
467
|
+
depth
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
return /* @__PURE__ */ jsx8("li", { className: "ld-file-tree__item", children: /* @__PURE__ */ jsxs6("div", { className: "ld-file-tree__label ld-file-tree__label--file", children: [
|
|
472
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon ld-file-tree__icon--spacer" }),
|
|
473
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-file-tree__icon", children: getFileIcon(labelText) }),
|
|
474
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-file-tree__name", children: labelText })
|
|
475
|
+
] }) });
|
|
476
|
+
}
|
|
477
|
+
if (node.props.children) {
|
|
478
|
+
return Children3.map(node.props.children, (child, index) => /* @__PURE__ */ jsx8(React4.Fragment, { children: parseNode(child, depth) }, index));
|
|
479
|
+
}
|
|
480
|
+
return node;
|
|
481
|
+
}
|
|
482
|
+
function FileTree({ children }) {
|
|
483
|
+
return /* @__PURE__ */ jsx8("div", { className: "ld-file-tree", dir: "ltr", children: Children3.map(children, (child) => parseNode(child, 0)) });
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// src/client/theme/components/mdx/Table.tsx
|
|
487
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
488
|
+
function Table({
|
|
489
|
+
headers,
|
|
490
|
+
data,
|
|
491
|
+
children,
|
|
492
|
+
className = ""
|
|
493
|
+
}) {
|
|
494
|
+
const tableContent = children ? children : /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
495
|
+
headers && /* @__PURE__ */ jsx9("thead", { children: /* @__PURE__ */ jsx9("tr", { children: headers.map((header, i) => /* @__PURE__ */ jsx9("th", { children: header }, i)) }) }),
|
|
496
|
+
data && /* @__PURE__ */ jsx9("tbody", { children: data.map((row, i) => /* @__PURE__ */ jsx9("tr", { children: row.map((cell, j) => /* @__PURE__ */ jsx9("td", { children: cell }, j)) }, i)) })
|
|
497
|
+
] });
|
|
498
|
+
return /* @__PURE__ */ jsx9("div", { className: `ld-table-container ${className}`.trim(), children: /* @__PURE__ */ jsx9("table", { className: "ld-table", children: tableContent }) });
|
|
499
|
+
}
|
|
363
500
|
export {
|
|
364
501
|
Admonition,
|
|
365
502
|
BackgroundGradient,
|
|
@@ -370,6 +507,7 @@ export {
|
|
|
370
507
|
Cards,
|
|
371
508
|
CodeBlock,
|
|
372
509
|
Danger,
|
|
510
|
+
FileTree,
|
|
373
511
|
Head,
|
|
374
512
|
InfoBox,
|
|
375
513
|
List,
|
|
@@ -381,6 +519,7 @@ export {
|
|
|
381
519
|
Playground,
|
|
382
520
|
Sidebar,
|
|
383
521
|
Tab,
|
|
522
|
+
Table,
|
|
384
523
|
Tabs,
|
|
385
524
|
ThemeLayout,
|
|
386
525
|
Tip,
|