fumadocs-ui 13.4.5 → 13.4.6
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-N47AX4K6.js → chunk-KCZRDPB4.js} +145 -61
- package/dist/chunk-NSEJBI4V.js +56 -0
- package/dist/components/banner.d.ts +8 -1
- package/dist/components/banner.js +16 -10
- package/dist/components/layout/language-toggle.js +6 -51
- package/dist/docs-layout.client.d.ts +9 -4
- package/dist/docs-layout.client.js +325 -24
- package/dist/{edit-on-github-FSFN5H36.js → edit-on-github-YFVYCMB7.js} +2 -1
- package/dist/home-layout.client.d.ts +3 -2
- package/dist/home-layout.client.js +17 -9
- package/dist/home-layout.d.ts +2 -2
- package/dist/home-layout.js +2 -1
- package/dist/layout.d.ts +3 -9
- package/dist/layout.js +2 -11
- package/dist/{layout.shared-C5L62VPM.d.ts → layout.shared-DEQFTB9M.d.ts} +6 -0
- package/dist/page.js +2 -1
- package/dist/{sidebar-BguPKq_K.d.ts → sidebar-DwBSl7jC.d.ts} +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.js +0 -1
- package/package.json +6 -6
- package/dist/chunk-J5B4GINE.js +0 -90
- package/dist/chunk-VTGJREY6.js +0 -237
- package/dist/dynamic-sidebar-JFB3Z7SK.js +0 -106
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
LargeSearchToggle,
|
|
4
|
+
LinkItem,
|
|
5
|
+
LinksMenu,
|
|
6
6
|
NavBox,
|
|
7
|
+
SearchToggle,
|
|
7
8
|
ThemeToggle,
|
|
8
9
|
Title
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KCZRDPB4.js";
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./chunk-N47AX4K6.js";
|
|
12
|
+
LanguageToggle
|
|
13
|
+
} from "./chunk-NSEJBI4V.js";
|
|
14
14
|
import {
|
|
15
|
-
TreeContextProvider
|
|
15
|
+
TreeContextProvider,
|
|
16
|
+
useTreeContext
|
|
16
17
|
} from "./chunk-LSTPTAZ5.js";
|
|
17
|
-
import
|
|
18
|
+
import {
|
|
19
|
+
ScrollArea,
|
|
20
|
+
ScrollViewport
|
|
21
|
+
} from "./chunk-2FLZOPQN.js";
|
|
18
22
|
import "./chunk-CP67AHDD.js";
|
|
19
|
-
import
|
|
23
|
+
import {
|
|
24
|
+
hasActive,
|
|
25
|
+
isActive
|
|
26
|
+
} from "./chunk-UOD2T27N.js";
|
|
20
27
|
import {
|
|
21
28
|
useSearchContext
|
|
22
29
|
} from "./chunk-ET4TW6M5.js";
|
|
@@ -24,9 +31,14 @@ import {
|
|
|
24
31
|
useSidebar
|
|
25
32
|
} from "./chunk-27HFSL7N.js";
|
|
26
33
|
import "./chunk-EFMHXXHW.js";
|
|
27
|
-
import "./chunk-TQJ6YPJ3.js";
|
|
28
34
|
import {
|
|
29
|
-
|
|
35
|
+
Collapsible,
|
|
36
|
+
CollapsibleContent,
|
|
37
|
+
CollapsibleTrigger
|
|
38
|
+
} from "./chunk-TQJ6YPJ3.js";
|
|
39
|
+
import {
|
|
40
|
+
buttonVariants,
|
|
41
|
+
itemVariants
|
|
30
42
|
} from "./chunk-EDNTYBXS.js";
|
|
31
43
|
import {
|
|
32
44
|
twMerge
|
|
@@ -35,9 +47,296 @@ import "./chunk-MLKGABMK.js";
|
|
|
35
47
|
|
|
36
48
|
// src/docs-layout.client.tsx
|
|
37
49
|
import { SidebarTrigger } from "fumadocs-core/sidebar";
|
|
38
|
-
import { Menu, SidebarIcon, X } from "lucide-react";
|
|
39
|
-
import { useCallback } from "react";
|
|
40
|
-
|
|
50
|
+
import { Menu, SidebarIcon as SidebarIcon2, X } from "lucide-react";
|
|
51
|
+
import { useCallback as useCallback3 } from "react";
|
|
52
|
+
|
|
53
|
+
// src/components/layout/sidebar.tsx
|
|
54
|
+
import { ChevronDown, ExternalLinkIcon } from "lucide-react";
|
|
55
|
+
import * as Base from "fumadocs-core/sidebar";
|
|
56
|
+
import { usePathname } from "next/navigation";
|
|
57
|
+
import {
|
|
58
|
+
createContext,
|
|
59
|
+
useCallback,
|
|
60
|
+
useContext,
|
|
61
|
+
useMemo,
|
|
62
|
+
useState
|
|
63
|
+
} from "react";
|
|
64
|
+
import Link from "fumadocs-core/link";
|
|
65
|
+
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
66
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
67
|
+
var defaultComponents = {
|
|
68
|
+
Folder: FolderNode,
|
|
69
|
+
Separator: SeparatorNode,
|
|
70
|
+
Item: PageNode
|
|
71
|
+
};
|
|
72
|
+
var Context = createContext({
|
|
73
|
+
defaultOpenLevel: 0,
|
|
74
|
+
components: defaultComponents,
|
|
75
|
+
prefetch: true
|
|
76
|
+
});
|
|
77
|
+
function Sidebar({
|
|
78
|
+
components,
|
|
79
|
+
defaultOpenLevel = 0,
|
|
80
|
+
items,
|
|
81
|
+
prefetch = true,
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
84
|
+
const search = useSearchContext();
|
|
85
|
+
const hasSearch = search.enabled && !props.hideSearch;
|
|
86
|
+
const context = useMemo(
|
|
87
|
+
() => ({
|
|
88
|
+
defaultOpenLevel,
|
|
89
|
+
components: { ...defaultComponents, ...components },
|
|
90
|
+
prefetch
|
|
91
|
+
}),
|
|
92
|
+
[components, defaultOpenLevel, prefetch]
|
|
93
|
+
);
|
|
94
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value: context, children: /* @__PURE__ */ jsxs(
|
|
95
|
+
Base.SidebarList,
|
|
96
|
+
{
|
|
97
|
+
id: "nd-sidebar",
|
|
98
|
+
blockScrollingWidth: 768,
|
|
99
|
+
...props.aside,
|
|
100
|
+
className: twMerge(
|
|
101
|
+
"fixed z-30 flex flex-col bg-fd-card text-sm md:sticky md:top-0 md:h-dvh md:w-[var(--fd-c-sidebar)] md:min-w-[var(--fd-sidebar-width)] md:border-e md:ps-[calc(var(--fd-c-sidebar)-var(--fd-sidebar-width))]",
|
|
102
|
+
"max-md:inset-0 max-md:bg-fd-background/80 max-md:pt-14 max-md:text-[15px] max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
|
|
103
|
+
props.aside?.className
|
|
104
|
+
),
|
|
105
|
+
children: [
|
|
106
|
+
hasSearch || props.banner ? /* @__PURE__ */ jsxs(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
...props.bannerProps,
|
|
110
|
+
className: twMerge(
|
|
111
|
+
"flex flex-col gap-1 px-4 pt-2 md:px-3 md:pt-4",
|
|
112
|
+
props.bannerProps?.className
|
|
113
|
+
),
|
|
114
|
+
children: [
|
|
115
|
+
props.banner,
|
|
116
|
+
hasSearch ? /* @__PURE__ */ jsx(LargeSearchToggle, { className: "rounded-lg max-md:hidden" }) : null
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
) : null,
|
|
120
|
+
/* @__PURE__ */ jsx(ViewportContent, { items }),
|
|
121
|
+
props.footer ? /* @__PURE__ */ jsx(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
...props.footerProps,
|
|
125
|
+
className: twMerge(
|
|
126
|
+
"flex flex-row items-center border-t py-1 max-md:px-4 md:mx-3",
|
|
127
|
+
props.footerProps?.className
|
|
128
|
+
),
|
|
129
|
+
children: props.footer
|
|
130
|
+
}
|
|
131
|
+
) : null
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
) });
|
|
135
|
+
}
|
|
136
|
+
function ViewportContent({
|
|
137
|
+
items
|
|
138
|
+
}) {
|
|
139
|
+
const { root } = useTreeContext();
|
|
140
|
+
return /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxs(
|
|
141
|
+
ScrollViewport,
|
|
142
|
+
{
|
|
143
|
+
style: {
|
|
144
|
+
maskImage: "linear-gradient(to bottom, transparent 2px, white 24px)"
|
|
145
|
+
},
|
|
146
|
+
children: [
|
|
147
|
+
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,
|
|
148
|
+
/* @__PURE__ */ jsx(NodeList, { items: root.children, className: "px-4 py-6 md:px-3" })
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
) });
|
|
152
|
+
}
|
|
153
|
+
function NodeList({
|
|
154
|
+
items,
|
|
155
|
+
level = 0,
|
|
156
|
+
...props
|
|
157
|
+
}) {
|
|
158
|
+
const { components } = useContext(Context);
|
|
159
|
+
return /* @__PURE__ */ jsx("div", { ...props, children: items.map((item, i) => {
|
|
160
|
+
const id = `${item.type}_${i.toString()}`;
|
|
161
|
+
switch (item.type) {
|
|
162
|
+
case "separator":
|
|
163
|
+
return /* @__PURE__ */ jsx(components.Separator, { item }, id);
|
|
164
|
+
case "folder":
|
|
165
|
+
return /* @__PURE__ */ jsx(components.Folder, { item, level: level + 1 }, id);
|
|
166
|
+
default:
|
|
167
|
+
return /* @__PURE__ */ jsx(components.Item, { item }, item.url);
|
|
168
|
+
}
|
|
169
|
+
}) });
|
|
170
|
+
}
|
|
171
|
+
function PageNode({
|
|
172
|
+
item: { icon, external = false, url, name }
|
|
173
|
+
}) {
|
|
174
|
+
const pathname = usePathname();
|
|
175
|
+
const active = isActive(url, pathname, false);
|
|
176
|
+
const { prefetch } = useContext(Context);
|
|
177
|
+
return /* @__PURE__ */ jsxs(
|
|
178
|
+
Link,
|
|
179
|
+
{
|
|
180
|
+
href: url,
|
|
181
|
+
external,
|
|
182
|
+
className: twMerge(itemVariants({ active })),
|
|
183
|
+
prefetch,
|
|
184
|
+
children: [
|
|
185
|
+
icon ?? (external ? /* @__PURE__ */ jsx(ExternalLinkIcon, {}) : null),
|
|
186
|
+
name
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
function FolderNode({
|
|
192
|
+
item,
|
|
193
|
+
level
|
|
194
|
+
}) {
|
|
195
|
+
const { defaultOpenLevel, prefetch } = useContext(Context);
|
|
196
|
+
const pathname = usePathname();
|
|
197
|
+
const active = item.index !== void 0 && isActive(item.index.url, pathname, false);
|
|
198
|
+
const childActive = useMemo(
|
|
199
|
+
() => hasActive(item.children, pathname),
|
|
200
|
+
[item.children, pathname]
|
|
201
|
+
);
|
|
202
|
+
const shouldExtend = active || childActive || (item.defaultOpen ?? defaultOpenLevel >= level);
|
|
203
|
+
const [open, setOpen] = useState(shouldExtend);
|
|
204
|
+
useOnChange(shouldExtend, (v) => {
|
|
205
|
+
if (v) setOpen(v);
|
|
206
|
+
});
|
|
207
|
+
const onClick = useCallback(
|
|
208
|
+
(e) => {
|
|
209
|
+
if (
|
|
210
|
+
// clicking on icon
|
|
211
|
+
e.target.hasAttribute("data-icon") || active
|
|
212
|
+
) {
|
|
213
|
+
setOpen((prev) => !prev);
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
[active]
|
|
218
|
+
);
|
|
219
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
220
|
+
item.icon,
|
|
221
|
+
item.name,
|
|
222
|
+
/* @__PURE__ */ jsx(
|
|
223
|
+
ChevronDown,
|
|
224
|
+
{
|
|
225
|
+
"data-icon": true,
|
|
226
|
+
className: twMerge("ms-auto transition-transform", !open && "-rotate-90")
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
] });
|
|
230
|
+
return /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, children: [
|
|
231
|
+
item.index ? /* @__PURE__ */ jsx(
|
|
232
|
+
Link,
|
|
233
|
+
{
|
|
234
|
+
className: twMerge(itemVariants({ active })),
|
|
235
|
+
href: item.index.url,
|
|
236
|
+
onClick,
|
|
237
|
+
prefetch,
|
|
238
|
+
children: content
|
|
239
|
+
}
|
|
240
|
+
) : /* @__PURE__ */ jsx(CollapsibleTrigger, { className: twMerge(itemVariants({ active })), children: content }),
|
|
241
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(
|
|
242
|
+
NodeList,
|
|
243
|
+
{
|
|
244
|
+
className: "ms-2 flex flex-col border-s py-2 ps-2",
|
|
245
|
+
items: item.children,
|
|
246
|
+
level
|
|
247
|
+
}
|
|
248
|
+
) })
|
|
249
|
+
] });
|
|
250
|
+
}
|
|
251
|
+
function SeparatorNode({
|
|
252
|
+
item
|
|
253
|
+
}) {
|
|
254
|
+
return /* @__PURE__ */ jsx("p", { className: "mb-2 mt-8 px-2 font-medium first:mt-0", children: item.name });
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// src/components/layout/dynamic-sidebar.tsx
|
|
258
|
+
import { useCallback as useCallback2, useRef, useState as useState2 } from "react";
|
|
259
|
+
import { SidebarIcon } from "lucide-react";
|
|
260
|
+
import { useOnChange as useOnChange2 } from "fumadocs-core/utils/use-on-change";
|
|
261
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
262
|
+
function DynamicSidebar(props) {
|
|
263
|
+
const { collapsed, setCollapsed } = useSidebar();
|
|
264
|
+
const [hover, setHover] = useState2(false);
|
|
265
|
+
const timerRef = useRef(0);
|
|
266
|
+
const closeTimeRef = useRef(0);
|
|
267
|
+
const onCollapse = useCallback2(() => {
|
|
268
|
+
setCollapsed((v) => !v);
|
|
269
|
+
}, [setCollapsed]);
|
|
270
|
+
useOnChange2(collapsed, () => {
|
|
271
|
+
setHover(false);
|
|
272
|
+
closeTimeRef.current = Date.now() + 150;
|
|
273
|
+
});
|
|
274
|
+
const onEnter = useCallback2((e) => {
|
|
275
|
+
if (e.pointerType === "touch" || closeTimeRef.current > Date.now()) return;
|
|
276
|
+
window.clearTimeout(timerRef.current);
|
|
277
|
+
setHover(true);
|
|
278
|
+
}, []);
|
|
279
|
+
const onLeave = useCallback2((e) => {
|
|
280
|
+
if (e.pointerType === "touch") return;
|
|
281
|
+
window.clearTimeout(timerRef.current);
|
|
282
|
+
timerRef.current = window.setTimeout(
|
|
283
|
+
() => {
|
|
284
|
+
setHover(false);
|
|
285
|
+
closeTimeRef.current = Date.now() + 150;
|
|
286
|
+
},
|
|
287
|
+
Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500
|
|
288
|
+
);
|
|
289
|
+
}, []);
|
|
290
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
291
|
+
collapsed ? /* @__PURE__ */ jsx2(
|
|
292
|
+
"div",
|
|
293
|
+
{
|
|
294
|
+
className: "fixed inset-y-0 start-0 w-6 max-md:hidden xl:w-[50px]",
|
|
295
|
+
onPointerEnter: onEnter,
|
|
296
|
+
onPointerLeave: onLeave
|
|
297
|
+
}
|
|
298
|
+
) : null,
|
|
299
|
+
collapsed ? /* @__PURE__ */ jsx2(
|
|
300
|
+
"button",
|
|
301
|
+
{
|
|
302
|
+
type: "button",
|
|
303
|
+
"aria-label": "Collapse Sidebar",
|
|
304
|
+
className: twMerge(
|
|
305
|
+
buttonVariants({
|
|
306
|
+
color: "secondary",
|
|
307
|
+
size: "icon",
|
|
308
|
+
className: "fixed start-4 bottom-2 z-10 max-md:hidden"
|
|
309
|
+
})
|
|
310
|
+
),
|
|
311
|
+
onClick: onCollapse,
|
|
312
|
+
children: /* @__PURE__ */ jsx2(SidebarIcon, {})
|
|
313
|
+
}
|
|
314
|
+
) : null,
|
|
315
|
+
/* @__PURE__ */ jsx2(
|
|
316
|
+
Sidebar,
|
|
317
|
+
{
|
|
318
|
+
...props,
|
|
319
|
+
aside: {
|
|
320
|
+
"data-collapse": collapsed,
|
|
321
|
+
"data-hover": hover,
|
|
322
|
+
onPointerEnter: onEnter,
|
|
323
|
+
onPointerLeave: onLeave,
|
|
324
|
+
"aria-hidden": Boolean(collapsed && !hover),
|
|
325
|
+
className: twMerge(
|
|
326
|
+
"md:transition-[transform,padding,width,margin]",
|
|
327
|
+
collapsed && [
|
|
328
|
+
"md:top-1 md:me-fd-sidebar-offset md:h-[calc(100dvh-4px)] md:w-[var(--fd-sidebar-width)] md:animate-fd-sidebar-collapse md:rounded-xl md:border md:ps-0 md:shadow-md",
|
|
329
|
+
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)]"
|
|
330
|
+
]
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/docs-layout.client.tsx
|
|
339
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
41
340
|
function SubNav({
|
|
42
341
|
title,
|
|
43
342
|
url,
|
|
@@ -47,17 +346,17 @@ function SubNav({
|
|
|
47
346
|
}) {
|
|
48
347
|
const { open } = useSidebar();
|
|
49
348
|
const { enabled } = useSearchContext();
|
|
50
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ jsxs3(
|
|
51
350
|
NavBox,
|
|
52
351
|
{
|
|
53
352
|
id: "nd-subnav",
|
|
54
353
|
className: "flex h-14 flex-row items-center px-4 md:hidden",
|
|
55
354
|
transparentMode,
|
|
56
355
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
enabled && enableSearch ? /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ jsx3(Title, { url, title }),
|
|
357
|
+
/* @__PURE__ */ jsx3("div", { className: "flex flex-1 flex-row items-center", children }),
|
|
358
|
+
enabled && enableSearch ? /* @__PURE__ */ jsx3(SearchToggle, {}) : null,
|
|
359
|
+
/* @__PURE__ */ jsx3(
|
|
61
360
|
SidebarTrigger,
|
|
62
361
|
{
|
|
63
362
|
className: twMerge(
|
|
@@ -67,7 +366,7 @@ function SubNav({
|
|
|
67
366
|
className: "-me-2"
|
|
68
367
|
})
|
|
69
368
|
),
|
|
70
|
-
children: open ? /* @__PURE__ */
|
|
369
|
+
children: open ? /* @__PURE__ */ jsx3(X, {}) : /* @__PURE__ */ jsx3(Menu, {})
|
|
71
370
|
}
|
|
72
371
|
)
|
|
73
372
|
]
|
|
@@ -76,7 +375,7 @@ function SubNav({
|
|
|
76
375
|
}
|
|
77
376
|
function SidebarCollapseTrigger() {
|
|
78
377
|
const { setCollapsed } = useSidebar();
|
|
79
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ jsx3(
|
|
80
379
|
"button",
|
|
81
380
|
{
|
|
82
381
|
type: "button",
|
|
@@ -88,14 +387,16 @@ function SidebarCollapseTrigger() {
|
|
|
88
387
|
className: "ms-auto max-md:hidden"
|
|
89
388
|
})
|
|
90
389
|
),
|
|
91
|
-
onClick:
|
|
390
|
+
onClick: useCallback3(() => {
|
|
92
391
|
setCollapsed((prev) => !prev);
|
|
93
392
|
}, [setCollapsed]),
|
|
94
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ jsx3(SidebarIcon2, {})
|
|
95
394
|
}
|
|
96
395
|
);
|
|
97
396
|
}
|
|
98
397
|
export {
|
|
398
|
+
DynamicSidebar,
|
|
399
|
+
LanguageToggle,
|
|
99
400
|
LinksMenu,
|
|
100
401
|
Sidebar,
|
|
101
402
|
SidebarCollapseTrigger,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { S as SharedNavProps, L as LinkItemType } from './layout.shared-
|
|
1
|
+
import { S as SharedNavProps, L as LinkItemType } from './layout.shared-DEQFTB9M.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
|
-
declare function Nav({ title, url, items, transparentMode, enableSearch, children, }: SharedNavProps & {
|
|
4
|
+
declare function Nav({ title, url, items, transparentMode, enableSearch, i18n, children, }: SharedNavProps & {
|
|
5
|
+
i18n?: boolean;
|
|
5
6
|
items: LinkItemType[];
|
|
6
7
|
}): React.ReactElement;
|
|
7
8
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
LargeSearchToggle,
|
|
4
|
+
LinkItem,
|
|
5
|
+
LinksMenu,
|
|
3
6
|
NavBox,
|
|
7
|
+
SearchToggle,
|
|
4
8
|
ThemeToggle,
|
|
5
9
|
Title
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KCZRDPB4.js";
|
|
7
11
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
LinksMenu,
|
|
11
|
-
SearchToggle
|
|
12
|
-
} from "./chunk-N47AX4K6.js";
|
|
12
|
+
LanguageToggle
|
|
13
|
+
} from "./chunk-NSEJBI4V.js";
|
|
13
14
|
import "./chunk-CP67AHDD.js";
|
|
14
15
|
import "./chunk-UOD2T27N.js";
|
|
15
16
|
import {
|
|
@@ -36,6 +37,7 @@ function Nav({
|
|
|
36
37
|
items,
|
|
37
38
|
transparentMode,
|
|
38
39
|
enableSearch = true,
|
|
40
|
+
i18n,
|
|
39
41
|
children
|
|
40
42
|
}) {
|
|
41
43
|
const search = useSearchContext();
|
|
@@ -62,9 +64,15 @@ function Nav({
|
|
|
62
64
|
className: "-me-2 lg:hidden"
|
|
63
65
|
})
|
|
64
66
|
),
|
|
65
|
-
footer: /* @__PURE__ */ jsxs(
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
67
|
+
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between px-2 pt-2", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-fd-muted-foreground", children: text.chooseTheme }),
|
|
70
|
+
/* @__PURE__ */ jsx(ThemeToggle, {})
|
|
71
|
+
] }),
|
|
72
|
+
i18n ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between px-2 pt-2", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-fd-muted-foreground", children: text.chooseLanguage }),
|
|
74
|
+
/* @__PURE__ */ jsx(LanguageToggle, {})
|
|
75
|
+
] }) : null
|
|
68
76
|
] }),
|
|
69
77
|
children: /* @__PURE__ */ jsx(MoreVertical, {})
|
|
70
78
|
}
|
package/dist/home-layout.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BaseLayoutProps } from './layout.shared-
|
|
1
|
+
import { B as BaseLayoutProps } from './layout.shared-DEQFTB9M.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
4
|
type HomeLayoutProps = BaseLayoutProps;
|
|
5
|
-
declare function HomeLayout({ nav, links, githubUrl, children, }: BaseLayoutProps): React.ReactElement;
|
|
5
|
+
declare function HomeLayout({ nav, links, githubUrl, i18n, children, }: BaseLayoutProps): React.ReactElement;
|
|
6
6
|
|
|
7
7
|
export { HomeLayout, type HomeLayoutProps };
|
package/dist/home-layout.js
CHANGED
|
@@ -13,13 +13,14 @@ function HomeLayout({
|
|
|
13
13
|
nav = {},
|
|
14
14
|
links = [],
|
|
15
15
|
githubUrl,
|
|
16
|
+
i18n,
|
|
16
17
|
children
|
|
17
18
|
}) {
|
|
18
19
|
const finalLinks = getLinks(links, githubUrl);
|
|
19
20
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
21
|
replaceOrDefault(
|
|
21
22
|
nav,
|
|
22
|
-
/* @__PURE__ */ jsx(Nav, { items: finalLinks, ...nav, children: nav.children })
|
|
23
|
+
/* @__PURE__ */ jsx(Nav, { items: finalLinks, i18n, ...nav, children: nav.children })
|
|
23
24
|
),
|
|
24
25
|
children
|
|
25
26
|
] });
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PageTree } from 'fumadocs-core/server';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { S as SidebarProps } from './sidebar-
|
|
4
|
-
import { B as BaseLayoutProps } from './layout.shared-
|
|
5
|
-
export { L as LinkItemType } from './layout.shared-
|
|
3
|
+
import { S as SidebarProps } from './sidebar-DwBSl7jC.js';
|
|
4
|
+
import { B as BaseLayoutProps } from './layout.shared-DEQFTB9M.js';
|
|
5
|
+
export { L as LinkItemType } from './layout.shared-DEQFTB9M.js';
|
|
6
6
|
|
|
7
7
|
interface SidebarOptions extends Omit<SidebarProps, 'items'> {
|
|
8
8
|
enabled: boolean;
|
|
@@ -13,12 +13,6 @@ interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
13
13
|
tree: PageTree.Root;
|
|
14
14
|
sidebar?: Partial<SidebarOptions>;
|
|
15
15
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
16
|
-
/**
|
|
17
|
-
* Enable Language Switch
|
|
18
|
-
*
|
|
19
|
-
* @defaultValue false
|
|
20
|
-
*/
|
|
21
|
-
i18n?: boolean;
|
|
22
16
|
}
|
|
23
17
|
declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, containerProps, i18n, ...props }: DocsLayoutProps): React.ReactNode;
|
|
24
18
|
|
package/dist/layout.js
CHANGED
|
@@ -3,7 +3,9 @@ import {
|
|
|
3
3
|
SidebarCollapseTrigger,
|
|
4
4
|
ThemeToggle,
|
|
5
5
|
SubNav,
|
|
6
|
+
LanguageToggle,
|
|
6
7
|
LinksMenu,
|
|
8
|
+
DynamicSidebar,
|
|
7
9
|
Sidebar,
|
|
8
10
|
} from "./docs-layout.client"
|
|
9
11
|
import {
|
|
@@ -23,19 +25,8 @@ import "./chunk-MLKGABMK.js";
|
|
|
23
25
|
// src/layout.tsx
|
|
24
26
|
import Link from "next/link";
|
|
25
27
|
import { MoreHorizontal } from "lucide-react";
|
|
26
|
-
import dynamic from "next/dynamic";
|
|
27
28
|
import { notFound } from "next/navigation";
|
|
28
29
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
-
var LanguageToggle = dynamic(
|
|
30
|
-
() => import("./components/layout/language-toggle.js").then(
|
|
31
|
-
(mod) => mod.LanguageToggle
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
var DynamicSidebar = dynamic(
|
|
35
|
-
() => import("./dynamic-sidebar-JFB3Z7SK.js").then(
|
|
36
|
-
(mod) => mod.DynamicSidebar
|
|
37
|
-
)
|
|
38
|
-
);
|
|
39
30
|
function DocsLayout({
|
|
40
31
|
nav,
|
|
41
32
|
githubUrl,
|
package/dist/page.js
CHANGED
|
@@ -25,7 +25,7 @@ import { AnchorProvider } from "fumadocs-core/toc";
|
|
|
25
25
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
26
26
|
var ClerkTOCItems = dynamic(() => import("./toc-clerk-CAID2WGC.js"));
|
|
27
27
|
var EditOnGitHub = dynamic(
|
|
28
|
-
() => import("./edit-on-github-
|
|
28
|
+
() => import("./edit-on-github-YFVYCMB7.js")
|
|
29
29
|
);
|
|
30
30
|
function DocsPage({
|
|
31
31
|
toc = [],
|
|
@@ -67,6 +67,7 @@ function DocsPage({
|
|
|
67
67
|
/* @__PURE__ */ jsx(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
|
+
id: "nd-tocnav",
|
|
70
71
|
className: twMerge(
|
|
71
72
|
"sticky top-14 z-10 border-b bg-fd-background/60 text-sm backdrop-blur-md md:top-1 md:mx-3 md:rounded-full md:border md:shadow-md",
|
|
72
73
|
tocPopoverOptions.enabled !== true && "lg:hidden"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PageTree } from 'fumadocs-core/server';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
|
-
import { L as LinkItemType } from './layout.shared-
|
|
3
|
+
import { L as LinkItemType } from './layout.shared-DEQFTB9M.js';
|
|
4
4
|
|
|
5
5
|
interface SidebarProps {
|
|
6
6
|
items: LinkItemType[];
|