fumadocs-ui 11.1.2 → 11.2.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/{chunk-RPQDC26K.js → chunk-E2VA3Y4S.js} +4 -4
- package/dist/{chunk-XP3DGFDZ.js → chunk-HUXFUKD2.js} +1 -1
- package/dist/chunk-PW7TBOIJ.js +21 -0
- package/dist/components/accordion.js +3 -3
- package/dist/components/callout.d.ts +1 -1
- package/dist/components/callout.js +4 -4
- package/dist/components/codeblock.js +1 -1
- package/dist/components/dialog/search-algolia.js +2 -2
- package/dist/components/dialog/search-default.js +2 -2
- package/dist/components/dialog/search.js +2 -2
- package/dist/components/files.js +2 -2
- package/dist/components/roll-button.js +2 -2
- package/dist/{i18n-dw7ODAws.d.ts → i18n-p5QWhj_3.d.ts} +2 -0
- package/dist/i18n.d.ts +2 -2
- package/dist/i18n.js +2 -3
- package/dist/{layout-2R7eRkWi.d.ts → layout-vxXAvjoq.d.ts} +9 -9
- package/dist/layout.client.d.ts +6 -1
- package/dist/layout.client.js +168 -93
- package/dist/layout.d.ts +1 -1
- package/dist/layout.js +12 -4
- package/dist/mdx.client.js +1 -1
- package/dist/page.client.js +21 -30
- package/dist/page.js +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.cjs +25 -20
- package/dist/tailwind-plugin.js +25 -20
- package/package.json +2 -2
- package/dist/chunk-YAHHY62W.js +0 -20
package/dist/layout.client.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-2KA2UOM3.js";
|
|
25
25
|
import {
|
|
26
26
|
useI18n
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-PW7TBOIJ.js";
|
|
28
28
|
import {
|
|
29
29
|
Collapsible,
|
|
30
30
|
CollapsibleContent,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
import "./chunk-6C3VEZWH.js";
|
|
40
40
|
|
|
41
41
|
// src/components/nav.tsx
|
|
42
|
-
import { MenuIcon,
|
|
42
|
+
import { MenuIcon, MoreVertical, SearchIcon, X } from "lucide-react";
|
|
43
43
|
import Link2 from "fumadocs-core/link";
|
|
44
44
|
import { SidebarTrigger } from "fumadocs-core/sidebar";
|
|
45
45
|
import { useEffect, useState } from "react";
|
|
@@ -47,7 +47,7 @@ import { usePathname as usePathname2 } from "next/navigation";
|
|
|
47
47
|
|
|
48
48
|
// src/components/theme-toggle.tsx
|
|
49
49
|
import { cva } from "class-variance-authority";
|
|
50
|
-
import {
|
|
50
|
+
import { Moon, Sun } from "lucide-react";
|
|
51
51
|
import { useTheme } from "next-themes";
|
|
52
52
|
import { useCallback } from "react";
|
|
53
53
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -79,8 +79,8 @@ function ThemeToggle({
|
|
|
79
79
|
onClick: onToggle,
|
|
80
80
|
...props,
|
|
81
81
|
children: [
|
|
82
|
-
/* @__PURE__ */ jsx(
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
82
|
+
/* @__PURE__ */ jsx(Sun, { className: twMerge(buttonVariants2({ dark: false })) }),
|
|
83
|
+
/* @__PURE__ */ jsx(Moon, { className: twMerge(buttonVariants2({ dark: true })) })
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
);
|
|
@@ -88,7 +88,7 @@ function ThemeToggle({
|
|
|
88
88
|
|
|
89
89
|
// src/components/link-item.tsx
|
|
90
90
|
import Link from "fumadocs-core/link";
|
|
91
|
-
import {
|
|
91
|
+
import { ChevronDown } from "lucide-react";
|
|
92
92
|
import { usePathname } from "next/navigation";
|
|
93
93
|
import { cva as cva2 } from "class-variance-authority";
|
|
94
94
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -125,7 +125,7 @@ function LinkItem({
|
|
|
125
125
|
...props,
|
|
126
126
|
children: [
|
|
127
127
|
item.text,
|
|
128
|
-
/* @__PURE__ */ jsx2(
|
|
128
|
+
/* @__PURE__ */ jsx2(ChevronDown, { className: "ml-auto size-4" })
|
|
129
129
|
]
|
|
130
130
|
}
|
|
131
131
|
),
|
|
@@ -142,11 +142,11 @@ function LinkItem({
|
|
|
142
142
|
children: [
|
|
143
143
|
item.icon,
|
|
144
144
|
item.text,
|
|
145
|
-
/* @__PURE__ */ jsx2(
|
|
145
|
+
/* @__PURE__ */ jsx2(ChevronDown, { className: "ml-auto size-4 group-data-[state=closed]/link:-rotate-90" })
|
|
146
146
|
]
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
/* @__PURE__ */ jsx2(CollapsibleContent, { children: /* @__PURE__ */ jsx2("div", { className: "flex flex-col ps-4
|
|
149
|
+
/* @__PURE__ */ jsx2(CollapsibleContent, { children: /* @__PURE__ */ jsx2("div", { className: "flex flex-col py-1 ps-4", children: item.items.map((child, i) => /* @__PURE__ */ jsx2(LinkItem, { item: child, on: "menu" }, i)) }) })
|
|
150
150
|
] });
|
|
151
151
|
}
|
|
152
152
|
const activeType = item.active ?? "url";
|
|
@@ -243,7 +243,7 @@ function Nav({
|
|
|
243
243
|
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-row items-center justify-end md:gap-2", children: [
|
|
244
244
|
enableSearch && search.enabled ? /* @__PURE__ */ jsx3(SearchToggle, {}) : null,
|
|
245
245
|
/* @__PURE__ */ jsx3(ThemeToggle, { className: "max-lg:hidden" }),
|
|
246
|
-
enableSidebar ? /* @__PURE__ */
|
|
246
|
+
enableSidebar ? /* @__PURE__ */ jsxs3(
|
|
247
247
|
SidebarTrigger,
|
|
248
248
|
{
|
|
249
249
|
"aria-label": "Toggle Sidebar",
|
|
@@ -251,10 +251,13 @@ function Nav({
|
|
|
251
251
|
buttonVariants({
|
|
252
252
|
size: "icon",
|
|
253
253
|
color: "ghost",
|
|
254
|
-
className: "md:hidden"
|
|
254
|
+
className: "group md:hidden"
|
|
255
255
|
})
|
|
256
256
|
),
|
|
257
|
-
children:
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsx3(MenuIcon, { className: "group-data-[open=true]:hidden" }),
|
|
259
|
+
/* @__PURE__ */ jsx3(X, { className: "hidden group-data-[open=true]:block" })
|
|
260
|
+
]
|
|
258
261
|
}
|
|
259
262
|
) : null,
|
|
260
263
|
/* @__PURE__ */ jsx3(
|
|
@@ -288,12 +291,15 @@ function LinksMenu({ items, ...props }) {
|
|
|
288
291
|
className: props.className
|
|
289
292
|
})
|
|
290
293
|
),
|
|
291
|
-
children: /* @__PURE__ */ jsx3(
|
|
294
|
+
children: /* @__PURE__ */ jsx3(MoreVertical, {})
|
|
292
295
|
}
|
|
293
296
|
),
|
|
294
297
|
/* @__PURE__ */ jsxs3(PopoverContent, { className: "flex flex-col", children: [
|
|
295
298
|
items.map((item, i) => /* @__PURE__ */ jsx3(LinkItem, { item, on: "menu" }, i)),
|
|
296
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-row px-2 py-1 items-center justify-between", children: [
|
|
300
|
+
/* @__PURE__ */ jsx3("p", { className: "font-medium", children: "Theme" }),
|
|
301
|
+
/* @__PURE__ */ jsx3(ThemeToggle, {})
|
|
302
|
+
] })
|
|
297
303
|
] })
|
|
298
304
|
] });
|
|
299
305
|
}
|
|
@@ -338,11 +344,17 @@ function SearchToggle() {
|
|
|
338
344
|
|
|
339
345
|
// src/components/sidebar.tsx
|
|
340
346
|
import { cva as cva3 } from "class-variance-authority";
|
|
341
|
-
import { ChevronDown, ExternalLinkIcon
|
|
347
|
+
import { ChevronDown as ChevronDown2, ExternalLinkIcon } from "lucide-react";
|
|
342
348
|
import * as Base from "fumadocs-core/sidebar";
|
|
343
349
|
import { usePathname as usePathname3 } from "next/navigation";
|
|
344
|
-
import
|
|
345
|
-
|
|
350
|
+
import {
|
|
351
|
+
createContext,
|
|
352
|
+
useCallback as useCallback2,
|
|
353
|
+
useContext,
|
|
354
|
+
useEffect as useEffect2,
|
|
355
|
+
useMemo,
|
|
356
|
+
useState as useState2
|
|
357
|
+
} from "react";
|
|
346
358
|
import Link3 from "fumadocs-core/link";
|
|
347
359
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
348
360
|
var itemVariants = cva3(
|
|
@@ -369,12 +381,11 @@ function Sidebar({
|
|
|
369
381
|
footer,
|
|
370
382
|
components,
|
|
371
383
|
defaultOpenLevel = 1,
|
|
372
|
-
collapsible = true,
|
|
373
384
|
banner,
|
|
374
|
-
items
|
|
385
|
+
items,
|
|
386
|
+
...props
|
|
375
387
|
}) {
|
|
376
|
-
const
|
|
377
|
-
const alwaysShowFooter = Boolean(footer) || collapsible;
|
|
388
|
+
const alwaysShowFooter = Boolean(footer);
|
|
378
389
|
const context = useMemo(
|
|
379
390
|
() => ({
|
|
380
391
|
defaultOpenLevel,
|
|
@@ -382,79 +393,43 @@ function Sidebar({
|
|
|
382
393
|
}),
|
|
383
394
|
[components, defaultOpenLevel]
|
|
384
395
|
);
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
banner,
|
|
417
|
-
items.length > 0 && /* @__PURE__ */ jsx4("div", { className: "flex flex-col md:hidden", children: items.map((item, i) => /* @__PURE__ */ jsx4(LinkItem, { item, on: "menu" }, i)) })
|
|
418
|
-
] }),
|
|
419
|
-
/* @__PURE__ */ jsxs4(
|
|
420
|
-
"div",
|
|
421
|
-
{
|
|
422
|
-
className: twMerge(
|
|
423
|
-
"flex flex-row items-center gap-2 border-t p-3 md:p-2",
|
|
424
|
-
!alwaysShowFooter && "md:hidden"
|
|
425
|
-
),
|
|
426
|
-
children: [
|
|
427
|
-
footer,
|
|
428
|
-
/* @__PURE__ */ jsx4(ThemeToggle, { className: "md:hidden" }),
|
|
429
|
-
collapsible ? /* @__PURE__ */ jsx4(
|
|
430
|
-
"button",
|
|
431
|
-
{
|
|
432
|
-
type: "button",
|
|
433
|
-
"aria-label": "Trigger Sidebar",
|
|
434
|
-
className: twMerge(
|
|
435
|
-
buttonVariants({
|
|
436
|
-
color: "ghost",
|
|
437
|
-
size: "icon",
|
|
438
|
-
className: "max-md:hidden ms-auto"
|
|
439
|
-
})
|
|
440
|
-
),
|
|
441
|
-
onClick: onCollapse,
|
|
442
|
-
children: /* @__PURE__ */ jsx4(SidebarIcon, {})
|
|
443
|
-
}
|
|
444
|
-
) : null
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
)
|
|
448
|
-
]
|
|
449
|
-
}
|
|
450
|
-
)
|
|
451
|
-
] });
|
|
396
|
+
return /* @__PURE__ */ jsx4(SidebarContext.Provider, { value: context, children: /* @__PURE__ */ jsxs4(
|
|
397
|
+
Base.SidebarList,
|
|
398
|
+
{
|
|
399
|
+
minWidth: 768,
|
|
400
|
+
className: twMerge(
|
|
401
|
+
"flex w-full flex-col text-[15px] md:sticky md:top-16 md:h-body md:w-[240px] md:text-sm xl:w-[260px]",
|
|
402
|
+
"max-md:fixed max-md:inset-0 max-md:z-40 max-md:bg-background/80 max-md:pt-16 max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
|
|
403
|
+
props.className
|
|
404
|
+
),
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ jsx4("div", { id: "sidebar-background", className: "absolute z-[-1] size-full" }),
|
|
407
|
+
/* @__PURE__ */ jsxs4(ViewportContent, { children: [
|
|
408
|
+
banner,
|
|
409
|
+
items.length > 0 && /* @__PURE__ */ jsx4("div", { className: "flex flex-col md:hidden", children: items.map((item, i) => /* @__PURE__ */ jsx4(LinkItem, { item, on: "menu" }, i)) })
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ jsxs4(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
className: twMerge(
|
|
415
|
+
"flex flex-row items-center gap-2 border-t p-3 md:p-2",
|
|
416
|
+
!alwaysShowFooter && "md:hidden"
|
|
417
|
+
),
|
|
418
|
+
children: [
|
|
419
|
+
footer,
|
|
420
|
+
/* @__PURE__ */ jsx4(ThemeToggle, { className: "md:hidden" })
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
)
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
) });
|
|
452
427
|
}
|
|
453
428
|
function ViewportContent({
|
|
454
429
|
children
|
|
455
430
|
}) {
|
|
456
431
|
const { root } = useTreeContext();
|
|
457
|
-
return /* @__PURE__ */ jsx4(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx4(ScrollViewport, { children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-8 pb-10 pt-4
|
|
432
|
+
return /* @__PURE__ */ jsx4(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx4(ScrollViewport, { children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-8 pb-10 pt-4 px-4 md:px-3 md:pt-10", children: [
|
|
458
433
|
children,
|
|
459
434
|
/* @__PURE__ */ jsx4(NodeList, { items: root.children })
|
|
460
435
|
] }) }) });
|
|
@@ -513,7 +488,7 @@ function FolderNode({
|
|
|
513
488
|
if (shouldExtend)
|
|
514
489
|
setExtend(true);
|
|
515
490
|
}, [shouldExtend]);
|
|
516
|
-
const onClick =
|
|
491
|
+
const onClick = useCallback2(
|
|
517
492
|
(e) => {
|
|
518
493
|
if (e.target !== e.currentTarget || active) {
|
|
519
494
|
setExtend((prev) => !prev);
|
|
@@ -533,7 +508,7 @@ function FolderNode({
|
|
|
533
508
|
icon,
|
|
534
509
|
name,
|
|
535
510
|
/* @__PURE__ */ jsx4(
|
|
536
|
-
|
|
511
|
+
ChevronDown2,
|
|
537
512
|
{
|
|
538
513
|
className: twMerge(
|
|
539
514
|
"ms-auto transition-transform",
|
|
@@ -547,7 +522,7 @@ function FolderNode({
|
|
|
547
522
|
icon,
|
|
548
523
|
name,
|
|
549
524
|
/* @__PURE__ */ jsx4(
|
|
550
|
-
|
|
525
|
+
ChevronDown2,
|
|
551
526
|
{
|
|
552
527
|
className: twMerge(
|
|
553
528
|
"ms-auto transition-transform",
|
|
@@ -559,7 +534,7 @@ function FolderNode({
|
|
|
559
534
|
/* @__PURE__ */ jsx4(CollapsibleContent, { children: /* @__PURE__ */ jsx4(
|
|
560
535
|
NodeList,
|
|
561
536
|
{
|
|
562
|
-
className: "ms-
|
|
537
|
+
className: "ms-2 flex flex-col border-s py-2 ps-2",
|
|
563
538
|
items: children,
|
|
564
539
|
level
|
|
565
540
|
}
|
|
@@ -571,7 +546,107 @@ function SeparatorNode({
|
|
|
571
546
|
}) {
|
|
572
547
|
return /* @__PURE__ */ jsx4("p", { className: "mb-2 mt-8 px-2 font-medium first:mt-0", children: item.name });
|
|
573
548
|
}
|
|
549
|
+
|
|
550
|
+
// src/components/dynamic-sidebar.tsx
|
|
551
|
+
import { useCallback as useCallback3, useRef, useState as useState3 } from "react";
|
|
552
|
+
import { SidebarIcon } from "lucide-react";
|
|
553
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
554
|
+
function DynamicSidebar(props) {
|
|
555
|
+
const [open, setOpen] = useSidebarCollapse();
|
|
556
|
+
const [hover, setHover] = useState3(false);
|
|
557
|
+
const timerRef = useRef(0);
|
|
558
|
+
const onCollapse = () => {
|
|
559
|
+
setOpen(!open);
|
|
560
|
+
};
|
|
561
|
+
const onHover = useCallback3((e) => {
|
|
562
|
+
if (e.pointerType === "touch")
|
|
563
|
+
return;
|
|
564
|
+
window.clearTimeout(timerRef.current);
|
|
565
|
+
setHover(true);
|
|
566
|
+
}, []);
|
|
567
|
+
const onLeave = useCallback3((e) => {
|
|
568
|
+
if (e.pointerType === "touch")
|
|
569
|
+
return;
|
|
570
|
+
window.clearTimeout(timerRef.current);
|
|
571
|
+
timerRef.current = window.setTimeout(() => {
|
|
572
|
+
setHover(false);
|
|
573
|
+
}, 300);
|
|
574
|
+
}, []);
|
|
575
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
576
|
+
!open ? /* @__PURE__ */ jsx5(
|
|
577
|
+
"div",
|
|
578
|
+
{
|
|
579
|
+
className: "fixed bottom-0 start-0 top-16 max-md:hidden",
|
|
580
|
+
onPointerEnter: onHover,
|
|
581
|
+
onPointerLeave: onLeave,
|
|
582
|
+
style: {
|
|
583
|
+
maxWidth: "240px",
|
|
584
|
+
width: "calc(max(0px, 100vw - 1400px)/2)",
|
|
585
|
+
minWidth: "1rem"
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
) : null,
|
|
589
|
+
!open ? /* @__PURE__ */ jsx5(
|
|
590
|
+
"button",
|
|
591
|
+
{
|
|
592
|
+
type: "button",
|
|
593
|
+
"aria-label": "Trigger Sidebar",
|
|
594
|
+
className: twMerge(
|
|
595
|
+
buttonVariants({
|
|
596
|
+
color: "secondary",
|
|
597
|
+
size: "icon",
|
|
598
|
+
className: "fixed start-4 bottom-4 z-10 max-md:hidden"
|
|
599
|
+
})
|
|
600
|
+
),
|
|
601
|
+
onClick: onCollapse,
|
|
602
|
+
children: /* @__PURE__ */ jsx5(SidebarIcon, {})
|
|
603
|
+
}
|
|
604
|
+
) : null,
|
|
605
|
+
/* @__PURE__ */ jsx5(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
id: "dynamic-sidebar",
|
|
609
|
+
"data-open": open,
|
|
610
|
+
"data-hover": hover,
|
|
611
|
+
onPointerEnter: onHover,
|
|
612
|
+
onPointerLeave: onLeave,
|
|
613
|
+
"aria-hidden": !open && !hover,
|
|
614
|
+
className: twMerge(
|
|
615
|
+
"z-40 transition-transform max-md:absolute",
|
|
616
|
+
!open && "md:fixed md:bottom-2 md:start-2 md:top-16 md:overflow-hidden md:rounded-xl md:border md:bg-background md:shadow-md"
|
|
617
|
+
),
|
|
618
|
+
children: /* @__PURE__ */ jsx5(
|
|
619
|
+
Sidebar,
|
|
620
|
+
{
|
|
621
|
+
...props,
|
|
622
|
+
className: twMerge(!open && "md:h-full"),
|
|
623
|
+
footer: /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
624
|
+
props.footer,
|
|
625
|
+
/* @__PURE__ */ jsx5(
|
|
626
|
+
"button",
|
|
627
|
+
{
|
|
628
|
+
type: "button",
|
|
629
|
+
"aria-label": "Trigger Sidebar",
|
|
630
|
+
className: twMerge(
|
|
631
|
+
buttonVariants({
|
|
632
|
+
color: "ghost",
|
|
633
|
+
size: "icon",
|
|
634
|
+
className: "max-md:hidden ms-auto"
|
|
635
|
+
})
|
|
636
|
+
),
|
|
637
|
+
onClick: onCollapse,
|
|
638
|
+
children: /* @__PURE__ */ jsx5(SidebarIcon, {})
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
] })
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
] });
|
|
647
|
+
}
|
|
574
648
|
export {
|
|
649
|
+
DynamicSidebar,
|
|
575
650
|
Nav,
|
|
576
651
|
Sidebar,
|
|
577
652
|
TreeContextProvider
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'fumadocs-core/server';
|
|
2
2
|
import 'react';
|
|
3
|
-
export { B as BaseLayoutProps,
|
|
3
|
+
export { B as BaseLayoutProps, c as DocsLayout, D as DocsLayoutProps, b as Layout, L as LinkItemType } from './layout-vxXAvjoq.js';
|
package/dist/layout.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Nav,
|
|
3
3
|
TreeContextProvider,
|
|
4
|
+
DynamicSidebar,
|
|
4
5
|
Sidebar,
|
|
5
6
|
} from "./layout.client.js"
|
|
6
7
|
import {
|
|
@@ -48,20 +49,27 @@ function DocsLayout({
|
|
|
48
49
|
{
|
|
49
50
|
...containerProps,
|
|
50
51
|
className: twMerge(
|
|
51
|
-
"mx-auto flex w-full max-w-container flex-row gap-
|
|
52
|
+
"mx-auto flex w-full max-w-container flex-row gap-2 xl:gap-6",
|
|
52
53
|
containerProps?.className
|
|
53
54
|
),
|
|
54
55
|
children: [
|
|
55
56
|
replaceOrDefault(
|
|
56
57
|
sidebar,
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
58
|
+
sidebarCollapsible ? /* @__PURE__ */ jsx(
|
|
59
|
+
DynamicSidebar,
|
|
60
|
+
{
|
|
61
|
+
items: finalLinks,
|
|
62
|
+
defaultOpenLevel: sidebar.defaultOpenLevel,
|
|
63
|
+
banner: sidebar.banner,
|
|
64
|
+
footer: sidebar.footer
|
|
65
|
+
}
|
|
66
|
+
) : /* @__PURE__ */ jsx(
|
|
58
67
|
Sidebar,
|
|
59
68
|
{
|
|
60
69
|
items: finalLinks,
|
|
61
70
|
defaultOpenLevel: sidebar.defaultOpenLevel,
|
|
62
71
|
banner: sidebar.banner,
|
|
63
|
-
footer: sidebar.footer
|
|
64
|
-
collapsible: sidebarCollapsible
|
|
72
|
+
footer: sidebar.footer
|
|
65
73
|
}
|
|
66
74
|
)
|
|
67
75
|
),
|
package/dist/mdx.client.js
CHANGED
package/dist/page.client.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import "./chunk-7F2LGCS6.js";
|
|
10
10
|
import {
|
|
11
11
|
useI18n
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PW7TBOIJ.js";
|
|
13
13
|
import {
|
|
14
14
|
twMerge
|
|
15
15
|
} from "./chunk-TK3TM3MR.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-6C3VEZWH.js";
|
|
|
17
17
|
|
|
18
18
|
// src/page.client.tsx
|
|
19
19
|
import { useEffect as useEffect2, useMemo, useState } from "react";
|
|
20
|
-
import {
|
|
20
|
+
import { ChevronLeft, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
21
21
|
import Link2 from "next/link";
|
|
22
22
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
23
23
|
|
|
@@ -84,7 +84,7 @@ function TOCItem2({
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// src/components/breadcrumb.tsx
|
|
87
|
-
import {
|
|
87
|
+
import { ChevronRight } from "lucide-react";
|
|
88
88
|
import { useBreadcrumb } from "fumadocs-core/breadcrumb";
|
|
89
89
|
import Link from "next/link";
|
|
90
90
|
import { usePathname } from "next/navigation";
|
|
@@ -107,13 +107,10 @@ function Breadcrumb() {
|
|
|
107
107
|
"overflow-hidden whitespace-nowrap",
|
|
108
108
|
isLast ? "text-foreground" : "text-ellipsis"
|
|
109
109
|
);
|
|
110
|
-
return (
|
|
111
|
-
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
114
|
-
item.url ? /* @__PURE__ */ jsx2(Link, { href: item.url, className: style, children: item.name }) : /* @__PURE__ */ jsx2("span", { className: style, children: item.name })
|
|
115
|
-
] }, i)
|
|
116
|
-
);
|
|
110
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
111
|
+
i !== 0 && /* @__PURE__ */ jsx2(ChevronRight, { className: "size-4 shrink-0 rtl:rotate-180" }),
|
|
112
|
+
item.url ? /* @__PURE__ */ jsx2(Link, { href: item.url, className: style, children: item.name }) : /* @__PURE__ */ jsx2("span", { className: style, children: item.name })
|
|
113
|
+
] }, i);
|
|
117
114
|
})
|
|
118
115
|
}
|
|
119
116
|
);
|
|
@@ -136,6 +133,7 @@ function LastUpdate(props) {
|
|
|
136
133
|
function Footer({ items }) {
|
|
137
134
|
const tree = useTreeContext();
|
|
138
135
|
const pathname = usePathname2();
|
|
136
|
+
const { nextPage, previousPage } = useI18n().text;
|
|
139
137
|
const { previous = items?.previous, next = items?.next } = useMemo(() => {
|
|
140
138
|
const currentIndex = tree.navigation.findIndex(
|
|
141
139
|
(item) => item.url === pathname
|
|
@@ -145,29 +143,22 @@ function Footer({ items }) {
|
|
|
145
143
|
next: tree.navigation[currentIndex + 1]
|
|
146
144
|
};
|
|
147
145
|
}, [pathname, tree.navigation]);
|
|
148
|
-
const footerItem = "flex flex-col gap-2 rounded-lg p-
|
|
149
|
-
return /* @__PURE__ */ jsxs3("div", { className: "
|
|
146
|
+
const footerItem = "flex flex-col gap-2 rounded-lg p-4 text-sm transition-colors hover:bg-accent hover:text-accent-foreground";
|
|
147
|
+
return /* @__PURE__ */ jsxs3("div", { className: "mt-4 flex flex-row flex-wrap gap-1 border-t py-4", children: [
|
|
150
148
|
previous ? /* @__PURE__ */ jsxs3(Link2, { href: previous.url, className: footerItem, children: [
|
|
151
|
-
/* @__PURE__ */ jsxs3("div", { className: "inline-flex items-center gap-0.5", children: [
|
|
152
|
-
/* @__PURE__ */ jsx3(
|
|
153
|
-
/* @__PURE__ */ jsx3("p", { children:
|
|
149
|
+
/* @__PURE__ */ jsxs3("div", { className: "inline-flex items-center gap-0.5 text-muted-foreground", children: [
|
|
150
|
+
/* @__PURE__ */ jsx3(ChevronLeft, { className: "-ms-1 size-4 shrink-0 rtl:rotate-180" }),
|
|
151
|
+
/* @__PURE__ */ jsx3("p", { children: previousPage })
|
|
154
152
|
] }),
|
|
155
|
-
/* @__PURE__ */ jsx3("p", { className: "font-medium
|
|
153
|
+
/* @__PURE__ */ jsx3("p", { className: "font-medium", children: previous.name })
|
|
156
154
|
] }) : null,
|
|
157
|
-
next ? /* @__PURE__ */ jsxs3(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */ jsx3(ChevronRightIcon2, { className: "-me-1 size-4 shrink-0 rtl:rotate-180" }),
|
|
165
|
-
/* @__PURE__ */ jsx3("p", { children: "Next" })
|
|
166
|
-
] }),
|
|
167
|
-
/* @__PURE__ */ jsx3("p", { className: "font-medium text-foreground", children: next.name })
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
) : null
|
|
155
|
+
next ? /* @__PURE__ */ jsxs3(Link2, { href: next.url, className: twMerge(footerItem, "ms-auto text-end"), children: [
|
|
156
|
+
/* @__PURE__ */ jsxs3("div", { className: "inline-flex flex-row-reverse items-center gap-0.5 text-muted-foreground", children: [
|
|
157
|
+
/* @__PURE__ */ jsx3(ChevronRight2, { className: "-me-1 size-4 shrink-0 rtl:rotate-180" }),
|
|
158
|
+
/* @__PURE__ */ jsx3("p", { children: nextPage })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsx3("p", { className: "font-medium", children: next.name })
|
|
161
|
+
] }) : null
|
|
171
162
|
] });
|
|
172
163
|
}
|
|
173
164
|
export {
|
package/dist/page.js
CHANGED
|
@@ -22,7 +22,7 @@ function DocsPage({
|
|
|
22
22
|
...props
|
|
23
23
|
}) {
|
|
24
24
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
-
/* @__PURE__ */ jsxs("article", { className: "flex w-0 flex-1 flex-col gap-6 py-10", children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("article", { className: "flex w-0 flex-1 flex-col gap-6 px-4 py-10", children: [
|
|
26
26
|
replaceOrDefault(breadcrumb, /* @__PURE__ */ jsx(Breadcrumb, {})),
|
|
27
27
|
props.children,
|
|
28
28
|
props.lastUpdate ? /* @__PURE__ */ jsx(LastUpdate, { date: new Date(props.lastUpdate) }) : null,
|
package/dist/provider.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { DefaultSearchDialogProps } from './components/dialog/search-default.js';
|
|
4
4
|
import { SearchLink, SharedProps } from './components/dialog/search.js';
|
|
5
|
-
export { u as useI18n } from './i18n-
|
|
5
|
+
export { u as useI18n } from './i18n-p5QWhj_3.js';
|
|
6
6
|
export { u as useTreeContext } from './tree-cqNEopxM.js';
|
|
7
7
|
import 'fumadocs-core/search/shared';
|
|
8
8
|
import 'fumadocs-core/server';
|