fumadocs-ui 13.2.2 → 13.3.1
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-KACGIS2N.js → chunk-J5B4GINE.js} +6 -9
- package/dist/chunk-P4HLRHHV.js +36 -0
- package/dist/{chunk-GHPUKUK4.js → chunk-XGJGSJZ7.js} +12 -12
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/callout.d.ts +3 -3
- package/dist/components/codeblock.d.ts +4 -4
- package/dist/components/layout/root-toggle.js +1 -1
- package/dist/components/tabs.d.ts +5 -5
- package/dist/docs-layout.client.d.ts +2 -1
- package/dist/docs-layout.client.js +28 -5
- package/dist/{dynamic-sidebar-C5OWT7N3.js → dynamic-sidebar-OIDT6SLW.js} +6 -22
- package/dist/home-layout.client.js +1 -1
- package/dist/i18n.js +1 -0
- package/dist/layout.d.ts +1 -1
- package/dist/layout.js +18 -8
- package/dist/mdx.d.ts +5 -5
- package/dist/page.client.d.ts +11 -7
- package/dist/page.client.js +43 -59
- package/dist/page.d.ts +18 -6
- package/dist/page.js +59 -11
- package/dist/provider.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/toc-clerk-RXJ32UXT.js +171 -0
- package/dist/twoslash/popup.d.ts +4 -4
- package/package.json +4 -4
|
@@ -47,17 +47,14 @@ import { Moon, Sun } from "lucide-react";
|
|
|
47
47
|
import { useTheme } from "next-themes";
|
|
48
48
|
import { useCallback } from "react";
|
|
49
49
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
50
|
-
var buttonVariants = cva(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
dark:
|
|
55
|
-
true: "dark:bg-fd-accent dark:text-fd-accent-foreground",
|
|
56
|
-
false: "bg-fd-accent text-fd-accent-foreground dark:bg-transparent dark:text-fd-muted-foreground"
|
|
57
|
-
}
|
|
50
|
+
var buttonVariants = cva("size-6 rounded-full p-1 text-fd-muted-foreground", {
|
|
51
|
+
variants: {
|
|
52
|
+
dark: {
|
|
53
|
+
true: "dark:bg-fd-accent dark:text-fd-accent-foreground",
|
|
54
|
+
false: "bg-fd-accent text-fd-accent-foreground dark:bg-transparent dark:text-fd-muted-foreground"
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
|
-
);
|
|
57
|
+
});
|
|
61
58
|
function ThemeToggle({
|
|
62
59
|
className,
|
|
63
60
|
...props
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/utils/use-toc-thumb.ts
|
|
2
|
+
import { useLayoutEffect, useState } from "react";
|
|
3
|
+
import * as Primitive from "fumadocs-core/toc";
|
|
4
|
+
function useTocThumb(containerRef) {
|
|
5
|
+
const active = Primitive.useActiveAnchors();
|
|
6
|
+
const [pos, setPos] = useState([0, 0]);
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
|
+
const container = containerRef.current;
|
|
9
|
+
if (active.length === 0 || !container || container.clientHeight === 0) {
|
|
10
|
+
setPos([0, 0]);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
let upper = Number.MAX_VALUE, lower = 0;
|
|
14
|
+
for (const item of active) {
|
|
15
|
+
const element = container.querySelector(
|
|
16
|
+
`a[href="#${item}"]`
|
|
17
|
+
);
|
|
18
|
+
if (!element) continue;
|
|
19
|
+
const styles = getComputedStyle(element);
|
|
20
|
+
upper = Math.min(
|
|
21
|
+
upper,
|
|
22
|
+
element.offsetTop + parseFloat(styles.paddingTop)
|
|
23
|
+
);
|
|
24
|
+
lower = Math.max(
|
|
25
|
+
lower,
|
|
26
|
+
element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
setPos([upper, lower - upper]);
|
|
30
|
+
}, [active, containerRef]);
|
|
31
|
+
return pos;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
useTocThumb
|
|
36
|
+
};
|
|
@@ -86,7 +86,7 @@ function Sidebar({
|
|
|
86
86
|
{
|
|
87
87
|
...props.bannerProps,
|
|
88
88
|
className: twMerge(
|
|
89
|
-
"flex flex-col gap-
|
|
89
|
+
"flex flex-col gap-1 px-4 pt-2 md:px-3 md:pt-4",
|
|
90
90
|
props.bannerProps?.className
|
|
91
91
|
),
|
|
92
92
|
children: [
|
|
@@ -95,36 +95,36 @@ function Sidebar({
|
|
|
95
95
|
]
|
|
96
96
|
}
|
|
97
97
|
) : null,
|
|
98
|
-
/* @__PURE__ */ jsx(ViewportContent, {
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
98
|
+
/* @__PURE__ */ jsx(ViewportContent, { items }),
|
|
99
|
+
props.footer ? /* @__PURE__ */ jsx(
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
102
|
...props.footerProps,
|
|
103
103
|
className: twMerge(
|
|
104
|
-
"flex flex-row items-center border-t
|
|
104
|
+
"flex flex-row items-center border-t py-1 max-md:px-4 md:mx-3",
|
|
105
105
|
props.footerProps?.className
|
|
106
106
|
),
|
|
107
107
|
children: props.footer
|
|
108
108
|
}
|
|
109
|
-
)
|
|
109
|
+
) : null
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
112
|
) });
|
|
113
113
|
}
|
|
114
114
|
function ViewportContent({
|
|
115
|
-
|
|
115
|
+
items
|
|
116
116
|
}) {
|
|
117
117
|
const { root } = useTreeContext();
|
|
118
|
-
return /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxs(
|
|
119
119
|
ScrollViewport,
|
|
120
120
|
{
|
|
121
121
|
style: {
|
|
122
|
-
maskImage: "linear-gradient(to bottom, transparent 2px, white 24px
|
|
122
|
+
maskImage: "linear-gradient(to bottom, transparent 2px, white 24px)"
|
|
123
123
|
},
|
|
124
|
-
children:
|
|
125
|
-
children,
|
|
126
|
-
/* @__PURE__ */ jsx(NodeList, { items: root.children })
|
|
127
|
-
]
|
|
124
|
+
children: [
|
|
125
|
+
items.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-col px-4 pt-6 md:hidden", children: items.map((item, i) => /* @__PURE__ */ jsx(LinkItem, { item, on: "menu" }, i)) }) : null,
|
|
126
|
+
/* @__PURE__ */ jsx(NodeList, { items: root.children, className: "px-4 py-6 md:px-3" })
|
|
127
|
+
]
|
|
128
128
|
}
|
|
129
129
|
) });
|
|
130
130
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
3
|
|
|
4
|
-
declare const Accordions:
|
|
5
|
-
declare const Accordion:
|
|
4
|
+
declare const Accordions: react.ForwardRefExoticComponent<(Omit<AccordionPrimitive.AccordionSingleProps, "value" | "onValueChange"> | Omit<AccordionPrimitive.AccordionMultipleProps, "value" | "onValueChange">) & react.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const Accordion: react.ForwardRefExoticComponent<Omit<Omit<AccordionPrimitive.AccordionItemProps & react.RefAttributes<HTMLDivElement>, "ref">, "value"> & {
|
|
6
6
|
title: string;
|
|
7
|
-
} &
|
|
7
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
|
|
9
9
|
export { Accordion, Accordions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const Callout:
|
|
4
|
+
declare const Callout: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
/**
|
|
7
7
|
* @defaultValue info
|
|
@@ -11,6 +11,6 @@ declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLD
|
|
|
11
11
|
* Force an icon
|
|
12
12
|
*/
|
|
13
13
|
icon?: ReactNode;
|
|
14
|
-
} &
|
|
14
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
|
|
16
16
|
export { Callout };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
@@ -21,8 +21,8 @@ type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
|
21
21
|
*/
|
|
22
22
|
keepBackground?: boolean;
|
|
23
23
|
};
|
|
24
|
-
declare const Pre:
|
|
25
|
-
declare const CodeBlock:
|
|
24
|
+
declare const Pre: react.ForwardRefExoticComponent<HTMLAttributes<HTMLPreElement> & react.RefAttributes<HTMLPreElement>>;
|
|
25
|
+
declare const CodeBlock: react.ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
26
26
|
/**
|
|
27
27
|
* Icon of code block
|
|
28
28
|
*
|
|
@@ -41,6 +41,6 @@ declare const CodeBlock: React.ForwardRefExoticComponent<HTMLAttributes<HTMLElem
|
|
|
41
41
|
* @defaultValue false
|
|
42
42
|
*/
|
|
43
43
|
keepBackground?: boolean;
|
|
44
|
-
} &
|
|
44
|
+
} & react.RefAttributes<HTMLElement>>;
|
|
45
45
|
|
|
46
46
|
export { CodeBlock, type CodeBlockProps, Pre };
|
|
@@ -33,7 +33,7 @@ function RootToggle({
|
|
|
33
33
|
setOpen(false);
|
|
34
34
|
}, [closeOnRedirect]);
|
|
35
35
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
36
|
-
/* @__PURE__ */ jsxs(PopoverTrigger, { className: "-mx-2 flex flex-row items-center gap-2.5 rounded-lg p-2 hover:bg-fd-
|
|
36
|
+
/* @__PURE__ */ jsxs(PopoverTrigger, { className: "-mx-2 flex flex-row items-center gap-2.5 rounded-lg p-2 hover:bg-fd-accent/50 hover:text-fd-accent-foreground", children: [
|
|
37
37
|
/* @__PURE__ */ jsx(Item, { ...selected }),
|
|
38
38
|
/* @__PURE__ */ jsx(ChevronDown, { className: "size-4 text-fd-muted-foreground md:me-1.5" })
|
|
39
39
|
] }),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
2
|
import { TabsProps as TabsProps$1, TabsContentProps } from '@radix-ui/react-tabs';
|
|
3
|
-
import * as
|
|
3
|
+
import * as react from 'react';
|
|
4
4
|
|
|
5
|
-
declare const Tabs$1:
|
|
6
|
-
declare const TabsList:
|
|
7
|
-
declare const TabsTrigger:
|
|
8
|
-
declare const TabsContent:
|
|
5
|
+
declare const Tabs$1: react.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const TabsList: react.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const TabsTrigger: react.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const TabsContent: react.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
|
|
10
10
|
declare const tabs_TabsContent: typeof TabsContent;
|
|
11
11
|
declare const tabs_TabsList: typeof TabsList;
|
|
@@ -8,5 +8,6 @@ import 'fumadocs-core/server';
|
|
|
8
8
|
declare function ThemeToggle({ className, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): React.ReactElement;
|
|
9
9
|
|
|
10
10
|
declare function SubNav({ title, url, transparentMode, children, enableSearch, }: SharedNavProps): React.ReactElement;
|
|
11
|
+
declare function SidebarCollapseTrigger(): React.ReactElement;
|
|
11
12
|
|
|
12
|
-
export { SubNav, ThemeToggle };
|
|
13
|
+
export { SidebarCollapseTrigger, SubNav, ThemeToggle };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Sidebar
|
|
4
|
+
} from "./chunk-XGJGSJZ7.js";
|
|
2
5
|
import {
|
|
3
6
|
NavBox,
|
|
4
7
|
ThemeToggle,
|
|
5
8
|
Title
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
Sidebar
|
|
9
|
-
} from "./chunk-GHPUKUK4.js";
|
|
9
|
+
} from "./chunk-J5B4GINE.js";
|
|
10
10
|
import {
|
|
11
11
|
LinksMenu,
|
|
12
12
|
SearchToggle
|
|
@@ -35,7 +35,8 @@ import "./chunk-MLKGABMK.js";
|
|
|
35
35
|
|
|
36
36
|
// src/docs-layout.client.tsx
|
|
37
37
|
import { SidebarTrigger } from "fumadocs-core/sidebar";
|
|
38
|
-
import { Menu, X } from "lucide-react";
|
|
38
|
+
import { Menu, SidebarIcon, X } from "lucide-react";
|
|
39
|
+
import { useCallback } from "react";
|
|
39
40
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
40
41
|
function SubNav({
|
|
41
42
|
title,
|
|
@@ -73,9 +74,31 @@ function SubNav({
|
|
|
73
74
|
}
|
|
74
75
|
);
|
|
75
76
|
}
|
|
77
|
+
function SidebarCollapseTrigger() {
|
|
78
|
+
const { setCollapsed } = useSidebar();
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
"aria-label": "Collapse Sidebar",
|
|
84
|
+
className: twMerge(
|
|
85
|
+
buttonVariants({
|
|
86
|
+
color: "ghost",
|
|
87
|
+
size: "icon",
|
|
88
|
+
className: "ms-auto max-md:hidden"
|
|
89
|
+
})
|
|
90
|
+
),
|
|
91
|
+
onClick: useCallback(() => {
|
|
92
|
+
setCollapsed((prev) => !prev);
|
|
93
|
+
}, [setCollapsed]),
|
|
94
|
+
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
76
98
|
export {
|
|
77
99
|
LinksMenu,
|
|
78
100
|
Sidebar,
|
|
101
|
+
SidebarCollapseTrigger,
|
|
79
102
|
SubNav,
|
|
80
103
|
ThemeToggle,
|
|
81
104
|
TreeContextProvider
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Sidebar
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XGJGSJZ7.js";
|
|
5
5
|
import "./chunk-EIPBQVOI.js";
|
|
6
6
|
import "./chunk-LSTPTAZ5.js";
|
|
7
7
|
import "./chunk-2FLZOPQN.js";
|
|
@@ -24,6 +24,7 @@ import "./chunk-MLKGABMK.js";
|
|
|
24
24
|
// src/components/layout/dynamic-sidebar.tsx
|
|
25
25
|
import { useCallback, useRef, useState } from "react";
|
|
26
26
|
import { SidebarIcon } from "lucide-react";
|
|
27
|
+
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
27
28
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
28
29
|
function DynamicSidebar(props) {
|
|
29
30
|
const { collapsed, setCollapsed } = useSidebar();
|
|
@@ -32,9 +33,11 @@ function DynamicSidebar(props) {
|
|
|
32
33
|
const closeTimeRef = useRef(0);
|
|
33
34
|
const onCollapse = useCallback(() => {
|
|
34
35
|
setCollapsed((v) => !v);
|
|
36
|
+
}, [setCollapsed]);
|
|
37
|
+
useOnChange(collapsed, () => {
|
|
35
38
|
setHover(false);
|
|
36
39
|
closeTimeRef.current = Date.now() + 150;
|
|
37
|
-
}
|
|
40
|
+
});
|
|
38
41
|
const onEnter = useCallback((e) => {
|
|
39
42
|
if (e.pointerType === "touch" || closeTimeRef.current > Date.now()) return;
|
|
40
43
|
window.clearTimeout(timerRef.current);
|
|
@@ -93,26 +96,7 @@ function DynamicSidebar(props) {
|
|
|
93
96
|
hover ? "md:translate-x-1 rtl:md:-translate-x-1" : "md:translate-x-[calc(var(--fd-sidebar-width)*-1)] rtl:md:translate-x-[var(--fd-sidebar-width)]"
|
|
94
97
|
]
|
|
95
98
|
)
|
|
96
|
-
}
|
|
97
|
-
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
98
|
-
props.footer,
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
100
|
-
"button",
|
|
101
|
-
{
|
|
102
|
-
type: "button",
|
|
103
|
-
"aria-label": "Collapse Sidebar",
|
|
104
|
-
className: twMerge(
|
|
105
|
-
buttonVariants({
|
|
106
|
-
color: "ghost",
|
|
107
|
-
size: "icon",
|
|
108
|
-
className: "max-md:hidden"
|
|
109
|
-
})
|
|
110
|
-
),
|
|
111
|
-
onClick: onCollapse,
|
|
112
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] })
|
|
99
|
+
}
|
|
116
100
|
}
|
|
117
101
|
)
|
|
118
102
|
] });
|
package/dist/i18n.js
CHANGED
package/dist/layout.d.ts
CHANGED
|
@@ -20,6 +20,6 @@ interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
20
20
|
*/
|
|
21
21
|
i18n?: boolean;
|
|
22
22
|
}
|
|
23
|
-
declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, containerProps, i18n, ...props }: DocsLayoutProps): React.
|
|
23
|
+
declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, containerProps, i18n, ...props }: DocsLayoutProps): React.ReactNode;
|
|
24
24
|
|
|
25
25
|
export { DocsLayout, type DocsLayoutProps };
|
package/dist/layout.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TreeContextProvider,
|
|
3
|
+
SidebarCollapseTrigger,
|
|
4
|
+
ThemeToggle,
|
|
3
5
|
SubNav,
|
|
4
6
|
LinksMenu,
|
|
5
7
|
Sidebar,
|
|
6
|
-
ThemeToggle,
|
|
7
8
|
} from "./docs-layout.client"
|
|
8
9
|
import {
|
|
9
10
|
getLinks
|
|
@@ -23,6 +24,7 @@ import "./chunk-MLKGABMK.js";
|
|
|
23
24
|
import Link from "next/link";
|
|
24
25
|
import { MoreHorizontal } from "lucide-react";
|
|
25
26
|
import dynamic from "next/dynamic";
|
|
27
|
+
import { notFound } from "next/navigation";
|
|
26
28
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
27
29
|
var LanguageToggle = dynamic(
|
|
28
30
|
() => import("./components/layout/language-toggle.js").then(
|
|
@@ -30,7 +32,7 @@ var LanguageToggle = dynamic(
|
|
|
30
32
|
)
|
|
31
33
|
);
|
|
32
34
|
var DynamicSidebar = dynamic(
|
|
33
|
-
() => import("./dynamic-sidebar-
|
|
35
|
+
() => import("./dynamic-sidebar-OIDT6SLW.js").then(
|
|
34
36
|
(mod) => mod.DynamicSidebar
|
|
35
37
|
)
|
|
36
38
|
);
|
|
@@ -49,14 +51,16 @@ function DocsLayout({
|
|
|
49
51
|
}) {
|
|
50
52
|
const links = getLinks(props.links ?? [], githubUrl);
|
|
51
53
|
const Aside = collapsible ? DynamicSidebar : Sidebar;
|
|
54
|
+
if (props.tree === void 0) notFound();
|
|
52
55
|
const banner = [];
|
|
56
|
+
const footer = [];
|
|
53
57
|
if (nav?.title)
|
|
54
58
|
banner.push(
|
|
55
59
|
/* @__PURE__ */ jsx(
|
|
56
60
|
Link,
|
|
57
61
|
{
|
|
58
62
|
href: nav.url ?? "/",
|
|
59
|
-
className: "inline-flex items-center gap-2.5 font-medium",
|
|
63
|
+
className: "inline-flex items-center gap-2.5 py-1 font-medium",
|
|
60
64
|
children: nav.title
|
|
61
65
|
},
|
|
62
66
|
"title"
|
|
@@ -80,6 +84,13 @@ function DocsLayout({
|
|
|
80
84
|
"links"
|
|
81
85
|
)
|
|
82
86
|
);
|
|
87
|
+
footer.push(/* @__PURE__ */ jsx(ThemeToggle, {}, "theme"));
|
|
88
|
+
if (i18n) {
|
|
89
|
+
footer.push(/* @__PURE__ */ jsx(LanguageToggle, {}, "i18n"));
|
|
90
|
+
}
|
|
91
|
+
if (collapsible) {
|
|
92
|
+
footer.push(/* @__PURE__ */ jsx(SidebarCollapseTrigger, {}, "sidebar"));
|
|
93
|
+
}
|
|
83
94
|
return /* @__PURE__ */ jsxs(TreeContextProvider, { tree: props.tree, children: [
|
|
84
95
|
replaceOrDefault(nav, /* @__PURE__ */ jsx(SubNav, { ...nav })),
|
|
85
96
|
/* @__PURE__ */ jsxs(
|
|
@@ -107,11 +118,10 @@ function DocsLayout({
|
|
|
107
118
|
sidebar.bannerProps?.className
|
|
108
119
|
)
|
|
109
120
|
},
|
|
110
|
-
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
] })
|
|
121
|
+
footer: footer.length > 0 || sidebar.footer ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
122
|
+
sidebar.footer,
|
|
123
|
+
footer
|
|
124
|
+
] }) : null
|
|
115
125
|
}
|
|
116
126
|
)
|
|
117
127
|
),
|
package/dist/mdx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { FC, HTMLAttributes, AnchorHTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { Card, Cards } from './components/card.js';
|
|
@@ -19,11 +19,11 @@ declare const defaultMdxComponents: {
|
|
|
19
19
|
h5: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
20
20
|
h6: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
21
21
|
table: typeof Table;
|
|
22
|
-
Callout:
|
|
23
|
-
title?:
|
|
22
|
+
Callout: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
|
|
23
|
+
title?: react.ReactNode;
|
|
24
24
|
type?: "info" | "warn" | "error";
|
|
25
|
-
icon?:
|
|
26
|
-
} &
|
|
25
|
+
icon?: react.ReactNode;
|
|
26
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* **Server Component Only**
|
package/dist/page.client.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { TOCItemType } from 'fumadocs-core/server';
|
|
2
|
-
import * as Primitive from 'fumadocs-core/toc';
|
|
3
2
|
import { ReactNode, ReactElement } from 'react';
|
|
4
3
|
import { BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
|
|
5
4
|
|
|
6
5
|
interface TOCProps {
|
|
7
|
-
items: TOCItemType[];
|
|
8
6
|
/**
|
|
9
7
|
* Custom content in TOC container, before the main TOC
|
|
10
8
|
*/
|
|
@@ -13,10 +11,16 @@ interface TOCProps {
|
|
|
13
11
|
* Custom content in TOC container, after the main TOC
|
|
14
12
|
*/
|
|
15
13
|
footer?: ReactNode;
|
|
14
|
+
children: ReactNode;
|
|
16
15
|
}
|
|
17
|
-
declare
|
|
18
|
-
declare function
|
|
19
|
-
|
|
16
|
+
declare function Toc({ header, footer, children }: TOCProps): ReactElement;
|
|
17
|
+
declare function TocPopover({ header, footer, items, children, }: TOCProps & {
|
|
18
|
+
items: TOCItemType[];
|
|
19
|
+
}): ReactElement;
|
|
20
|
+
declare function TOCItems({ items, isMenu, }: {
|
|
21
|
+
items: TOCItemType[];
|
|
22
|
+
isMenu?: boolean;
|
|
23
|
+
}): React.ReactElement;
|
|
20
24
|
|
|
21
25
|
interface BreadcrumbProps extends Omit<BreadcrumbOptions, 'includePage'> {
|
|
22
26
|
/**
|
|
@@ -26,7 +30,7 @@ interface BreadcrumbProps extends Omit<BreadcrumbOptions, 'includePage'> {
|
|
|
26
30
|
*/
|
|
27
31
|
full?: boolean;
|
|
28
32
|
}
|
|
29
|
-
declare function Breadcrumb({ full, ...options }: BreadcrumbProps): React.
|
|
33
|
+
declare function Breadcrumb({ full, ...options }: BreadcrumbProps): React.ReactNode;
|
|
30
34
|
|
|
31
35
|
declare function LastUpdate(props: {
|
|
32
36
|
date: Date;
|
|
@@ -48,4 +52,4 @@ interface FooterProps {
|
|
|
48
52
|
}
|
|
49
53
|
declare function Footer({ items }: FooterProps): React.ReactElement;
|
|
50
54
|
|
|
51
|
-
export { Breadcrumb, type BreadcrumbProps, Footer, type FooterProps, LastUpdate, type TOCProps, Toc, TocPopover
|
|
55
|
+
export { Breadcrumb, type BreadcrumbProps, Footer, type FooterProps, LastUpdate, TOCItems, type TOCProps, Toc, TocPopover };
|