fumadocs-ui 16.6.1 → 16.6.3
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/css/generated/docs.css +1 -3
- package/css/generated/notebook.css +0 -1
- package/css/generated/shared.css +3 -1
- package/css/lib/shiki.css +4 -1
- package/dist/components/sidebar/base.d.ts +6 -1
- package/dist/components/sidebar/base.js +2 -7
- package/dist/components/sidebar/link-item.js +6 -0
- package/dist/components/sidebar/page-tree.js +54 -40
- package/dist/layouts/docs/client.js +4 -4
- package/dist/layouts/docs/page/client.js +1 -1
- package/dist/layouts/docs/page/index.js +1 -1
- package/dist/layouts/flux/page/client.js +1 -1
- package/dist/layouts/home/client.d.ts +1 -1
- package/dist/layouts/notebook/client.d.ts +1 -1
- package/dist/layouts/notebook/page/client.js +1 -1
- package/dist/layouts/shared/index.d.ts +3 -3
- package/dist/style.css +6 -1
- package/dist/utils/link-item.d.ts +3 -2
- package/dist/utils/link-item.js +8 -4
- package/dist/utils/urls.js +1 -1
- package/package.json +5 -5
package/css/generated/docs.css
CHANGED
|
@@ -50,8 +50,6 @@
|
|
|
50
50
|
@source inline("as");
|
|
51
51
|
@source inline("aside");
|
|
52
52
|
@source inline("auto");
|
|
53
|
-
@source inline("auto-cols-auto");
|
|
54
|
-
@source inline("auto-rows-auto");
|
|
55
53
|
@source inline("available");
|
|
56
54
|
@source inline("backdrop-blur-sm");
|
|
57
55
|
@source inline("backdrop-blur-xs");
|
|
@@ -241,7 +239,7 @@
|
|
|
241
239
|
@source inline("max-h-[50vh]");
|
|
242
240
|
@source inline("max-md:hidden");
|
|
243
241
|
@source inline("max-md:layout:[--fd-header-height:--spacing(14)]");
|
|
244
|
-
@source inline("max-w-[
|
|
242
|
+
@source inline("max-w-[1168px]");
|
|
245
243
|
@source inline("max-w-[380px]");
|
|
246
244
|
@source inline("max-w-[900px]");
|
|
247
245
|
@source inline("max-xl:hidden");
|
package/css/generated/shared.css
CHANGED
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
@source inline("absolute");
|
|
67
67
|
@source inline("action");
|
|
68
68
|
@source inline("active");
|
|
69
|
-
@source inline("activeType");
|
|
70
69
|
@source inline("add");
|
|
71
70
|
@source inline("advanced");
|
|
72
71
|
@source inline("after");
|
|
@@ -93,6 +92,7 @@
|
|
|
93
92
|
@source inline("aria-selected");
|
|
94
93
|
@source inline("as");
|
|
95
94
|
@source inline("aside");
|
|
95
|
+
@source inline("assume");
|
|
96
96
|
@source inline("assumes");
|
|
97
97
|
@source inline("async");
|
|
98
98
|
@source inline("at");
|
|
@@ -619,6 +619,7 @@
|
|
|
619
619
|
@source inline("nextIdRef");
|
|
620
620
|
@source inline("nextPage");
|
|
621
621
|
@source inline("node");
|
|
622
|
+
@source inline("nodes");
|
|
622
623
|
@source inline("none");
|
|
623
624
|
@source inline("noopener");
|
|
624
625
|
@source inline("noreferrer");
|
|
@@ -991,6 +992,7 @@
|
|
|
991
992
|
@source inline("type");
|
|
992
993
|
@source inline("typeof");
|
|
993
994
|
@source inline("types");
|
|
995
|
+
@source inline("unchanged");
|
|
994
996
|
@source inline("undefined");
|
|
995
997
|
@source inline("under");
|
|
996
998
|
@source inline("underline");
|
package/css/lib/shiki.css
CHANGED
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
:is(pre *):is(.shiki *):not(.not-fumadocs-codeblock *) {
|
|
17
17
|
.line& {
|
|
18
18
|
position: relative;
|
|
19
|
-
min-height: 1lh;
|
|
20
19
|
padding-left: var(--padding-left);
|
|
21
20
|
padding-right: var(--padding-right);
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
.line:empty& {
|
|
24
|
+
height: 1lh;
|
|
25
|
+
}
|
|
26
|
+
|
|
24
27
|
.has-focused .line&:not(.focused) {
|
|
25
28
|
filter: blur(2px);
|
|
26
29
|
transition: filter 200ms;
|
|
@@ -74,9 +74,11 @@ declare function SidebarViewport(props: ScrollAreaProps): react_jsx_runtime0.JSX
|
|
|
74
74
|
declare function SidebarSeparator(props: ComponentProps<'p'>): react_jsx_runtime0.JSX.Element;
|
|
75
75
|
declare function SidebarItem({
|
|
76
76
|
icon,
|
|
77
|
+
active,
|
|
77
78
|
children,
|
|
78
79
|
...props
|
|
79
80
|
}: LinkProps & {
|
|
81
|
+
active?: boolean;
|
|
80
82
|
icon?: ReactNode;
|
|
81
83
|
}): react_jsx_runtime0.JSX.Element;
|
|
82
84
|
declare function SidebarFolder({
|
|
@@ -96,8 +98,11 @@ declare function SidebarFolderTrigger({
|
|
|
96
98
|
}: CollapsibleTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
97
99
|
declare function SidebarFolderLink({
|
|
98
100
|
children,
|
|
101
|
+
active,
|
|
99
102
|
...props
|
|
100
|
-
}: LinkProps
|
|
103
|
+
}: LinkProps & {
|
|
104
|
+
active?: boolean;
|
|
105
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
101
106
|
declare function SidebarFolderContent(props: CollapsibleContentProps): react_jsx_runtime0.JSX.Element;
|
|
102
107
|
declare function SidebarTrigger({
|
|
103
108
|
children,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
|
-
import { isActive } from "../../utils/urls.js";
|
|
5
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
6
5
|
import { ScrollArea, ScrollViewport } from "../ui/scroll-area.js";
|
|
7
6
|
import { createContext, use, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -134,11 +133,9 @@ function SidebarSeparator(props) {
|
|
|
134
133
|
children: props.children
|
|
135
134
|
});
|
|
136
135
|
}
|
|
137
|
-
function SidebarItem({ icon, children, ...props }) {
|
|
138
|
-
const pathname = usePathname();
|
|
136
|
+
function SidebarItem({ icon, active = false, children, ...props }) {
|
|
139
137
|
const ref = useRef(null);
|
|
140
138
|
const { prefetch } = useSidebar();
|
|
141
|
-
const active = props.href !== void 0 && isActive(props.href, pathname, false);
|
|
142
139
|
useAutoScroll(active, ref);
|
|
143
140
|
return /* @__PURE__ */ jsxs(Link, {
|
|
144
141
|
ref,
|
|
@@ -190,12 +187,10 @@ function SidebarFolderTrigger({ children, ...props }) {
|
|
|
190
187
|
children
|
|
191
188
|
});
|
|
192
189
|
}
|
|
193
|
-
function SidebarFolderLink({ children, ...props }) {
|
|
190
|
+
function SidebarFolderLink({ children, active = false, ...props }) {
|
|
194
191
|
const ref = useRef(null);
|
|
195
192
|
const { open, setOpen, collapsible } = use(FolderContext);
|
|
196
193
|
const { prefetch } = useSidebar();
|
|
197
|
-
const pathname = usePathname();
|
|
198
|
-
const active = props.href !== void 0 && isActive(props.href, pathname, false);
|
|
199
194
|
useAutoScroll(active, ref);
|
|
200
195
|
return /* @__PURE__ */ jsxs(Link, {
|
|
201
196
|
ref,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useLinkItemActive } from "../../utils/link-item.js";
|
|
1
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
5
|
|
|
3
6
|
//#region src/components/sidebar/link-item.tsx
|
|
@@ -6,6 +9,7 @@ function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
6
9
|
* Render sidebar items from page tree
|
|
7
10
|
*/
|
|
8
11
|
return function SidebarLinkItem({ item, ...props }) {
|
|
12
|
+
const active = useLinkItemActive(item);
|
|
9
13
|
if (item.type === "custom") return /* @__PURE__ */ jsx("div", {
|
|
10
14
|
...props,
|
|
11
15
|
children: item.children
|
|
@@ -14,6 +18,7 @@ function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
14
18
|
...props,
|
|
15
19
|
children: [item.url ? /* @__PURE__ */ jsxs(SidebarFolderLink, {
|
|
16
20
|
href: item.url,
|
|
21
|
+
active,
|
|
17
22
|
external: item.external,
|
|
18
23
|
children: [item.icon, item.text]
|
|
19
24
|
}) : /* @__PURE__ */ jsxs(SidebarFolderTrigger, { children: [item.icon, item.text] }), /* @__PURE__ */ jsx(SidebarFolderContent, { children: item.items.map((child, i) => /* @__PURE__ */ jsx(SidebarLinkItem, { item: child }, i)) })]
|
|
@@ -22,6 +27,7 @@ function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
22
27
|
href: item.url,
|
|
23
28
|
icon: item.icon,
|
|
24
29
|
external: item.external,
|
|
30
|
+
active,
|
|
25
31
|
...props,
|
|
26
32
|
children: item.text
|
|
27
33
|
});
|
|
@@ -1,55 +1,69 @@
|
|
|
1
1
|
import { useTreeContext, useTreePath } from "../../contexts/tree.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isActive } from "../../utils/urls.js";
|
|
3
|
+
import { Fragment, createContext, use, useMemo } from "react";
|
|
4
|
+
import { usePathname } from "fumadocs-core/framework";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
|
|
5
7
|
//#region src/components/sidebar/page-tree.tsx
|
|
8
|
+
const RendererContext = createContext(null);
|
|
6
9
|
function createPageTreeRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarSeparator, SidebarItem }) {
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
function renderList(nodes) {
|
|
11
|
+
return nodes.map((node, i) => /* @__PURE__ */ jsx(PageTreeNode, { node }, i));
|
|
12
|
+
}
|
|
13
|
+
function PageTreeNode({ node }) {
|
|
14
|
+
const { Separator, Item, Folder, pathname } = use(RendererContext);
|
|
15
|
+
if (node.type === "separator") {
|
|
16
|
+
if (Separator) return /* @__PURE__ */ jsx(Separator, { item: node });
|
|
17
|
+
return /* @__PURE__ */ jsxs(SidebarSeparator, { children: [node.icon, node.name] });
|
|
18
|
+
}
|
|
19
|
+
if (node.type === "folder") {
|
|
20
|
+
const path = useTreePath();
|
|
21
|
+
if (Folder) return /* @__PURE__ */ jsx(Folder, {
|
|
22
|
+
item: node,
|
|
23
|
+
children: renderList(node.children)
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ jsxs(SidebarFolder, {
|
|
26
|
+
collapsible: node.collapsible,
|
|
27
|
+
active: path.includes(node),
|
|
28
|
+
defaultOpen: node.defaultOpen,
|
|
29
|
+
children: [node.index ? /* @__PURE__ */ jsxs(SidebarFolderLink, {
|
|
30
|
+
href: node.index.url,
|
|
31
|
+
active: isActive(node.index.url, pathname),
|
|
32
|
+
external: node.index.external,
|
|
33
|
+
children: [node.icon, node.name]
|
|
34
|
+
}) : /* @__PURE__ */ jsxs(SidebarFolderTrigger, { children: [node.icon, node.name] }), /* @__PURE__ */ jsx(SidebarFolderContent, { children: renderList(node.children) })]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (Item) return /* @__PURE__ */ jsx(Item, { item: node });
|
|
38
|
+
return /* @__PURE__ */ jsx(SidebarItem, {
|
|
39
|
+
href: node.url,
|
|
40
|
+
external: node.external,
|
|
41
|
+
active: isActive(node.url, pathname),
|
|
42
|
+
icon: node.icon,
|
|
43
|
+
children: node.name
|
|
18
44
|
});
|
|
19
45
|
}
|
|
20
46
|
/**
|
|
21
47
|
* Render sidebar items from page tree
|
|
22
48
|
*/
|
|
23
49
|
return function SidebarPageTree(components) {
|
|
50
|
+
const { Folder, Item, Separator } = components;
|
|
24
51
|
const { root } = useTreeContext();
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
external: item.external,
|
|
41
|
-
icon: item.icon,
|
|
42
|
-
children: item.name
|
|
43
|
-
}, item.url);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ jsx(Fragment, { children: renderSidebarList(root.children) }, root.$id);
|
|
47
|
-
}, [
|
|
48
|
-
Folder,
|
|
49
|
-
Item,
|
|
50
|
-
Separator,
|
|
51
|
-
root
|
|
52
|
-
]);
|
|
52
|
+
const pathname = usePathname();
|
|
53
|
+
return /* @__PURE__ */ jsx(RendererContext, {
|
|
54
|
+
value: useMemo(() => ({
|
|
55
|
+
Folder,
|
|
56
|
+
Item,
|
|
57
|
+
Separator,
|
|
58
|
+
pathname
|
|
59
|
+
}), [
|
|
60
|
+
Folder,
|
|
61
|
+
Item,
|
|
62
|
+
Separator,
|
|
63
|
+
pathname
|
|
64
|
+
]),
|
|
65
|
+
children: /* @__PURE__ */ jsx(Fragment, { children: renderList(root.children) }, root.$id)
|
|
66
|
+
});
|
|
53
67
|
};
|
|
54
68
|
}
|
|
55
69
|
|
|
@@ -31,12 +31,12 @@ function LayoutBody({ className, style, children, ...props }) {
|
|
|
31
31
|
const { collapsed } = useSidebar();
|
|
32
32
|
return /* @__PURE__ */ jsx("div", {
|
|
33
33
|
id: "nd-docs-layout",
|
|
34
|
-
className: cn("grid transition-[grid-template-columns] overflow-x-clip min-h-(--fd-docs-height)
|
|
34
|
+
className: cn("grid transition-[grid-template-columns] overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]", className),
|
|
35
35
|
"data-sidebar-collapsed": collapsed,
|
|
36
36
|
style: {
|
|
37
|
-
gridTemplate: `"sidebar header toc"
|
|
38
|
-
"sidebar toc-popover toc"
|
|
39
|
-
"sidebar main toc" 1fr / minmax(var(--fd-sidebar-col)
|
|
37
|
+
gridTemplate: `"sidebar sidebar header toc toc"
|
|
38
|
+
"sidebar sidebar toc-popover toc toc"
|
|
39
|
+
"sidebar sidebar main toc toc" 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-width) - var(--fd-toc-width))) var(--fd-toc-width) minmax(min-content, 1fr)`,
|
|
40
40
|
"--fd-docs-row-1": "var(--fd-banner-height, 0px)",
|
|
41
41
|
"--fd-docs-row-2": "calc(var(--fd-docs-row-1) + var(--fd-header-height))",
|
|
42
42
|
"--fd-docs-row-3": "calc(var(--fd-docs-row-2) + var(--fd-toc-popover-height))",
|
|
@@ -150,7 +150,7 @@ function PageFooter({ items, children, className, ...props }) {
|
|
|
150
150
|
const pathname = usePathname();
|
|
151
151
|
const { previous, next } = useMemo(() => {
|
|
152
152
|
if (items) return items;
|
|
153
|
-
const idx = footerList.findIndex((item) => isActive(item.url, pathname
|
|
153
|
+
const idx = footerList.findIndex((item) => isActive(item.url, pathname));
|
|
154
154
|
if (idx === -1) return {};
|
|
155
155
|
return {
|
|
156
156
|
previous: footerList[idx - 1],
|
|
@@ -37,7 +37,7 @@ function DocsPage({ breadcrumb: { enabled: breadcrumbEnabled = true, component:
|
|
|
37
37
|
/* @__PURE__ */ jsxs("article", {
|
|
38
38
|
id: "nd-page",
|
|
39
39
|
"data-full": full,
|
|
40
|
-
className: cn("flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14", full ? "max-w-[
|
|
40
|
+
className: cn("flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14", full ? "max-w-[1168px]" : "xl:layout:[--fd-toc-width:268px]", className),
|
|
41
41
|
children: [
|
|
42
42
|
breadcrumbEnabled && (breadcrumb ?? /* @__PURE__ */ jsx(PageBreadcrumb, { ...breadcrumbProps })),
|
|
43
43
|
children,
|
|
@@ -178,7 +178,7 @@ function PageFooter({ items, children, className, ...props }) {
|
|
|
178
178
|
const pathname = usePathname();
|
|
179
179
|
const { previous, next } = useMemo(() => {
|
|
180
180
|
if (items) return items;
|
|
181
|
-
const idx = footerList.findIndex((item) => isActive(item.url, pathname
|
|
181
|
+
const idx = footerList.findIndex((item) => isActive(item.url, pathname));
|
|
182
182
|
if (idx === -1) return {};
|
|
183
183
|
return {
|
|
184
184
|
previous: footerList[idx - 1],
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
4
4
|
|
|
5
5
|
//#region src/layouts/home/client.d.ts
|
|
6
6
|
declare const navItemVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "button" | "main" | "icon" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Header({
|
|
10
10
|
nav,
|
|
@@ -41,6 +41,6 @@ declare function NavbarLinkItem({
|
|
|
41
41
|
...props
|
|
42
42
|
}: {
|
|
43
43
|
item: LinkItemType;
|
|
44
|
-
} & HTMLAttributes<HTMLElement>): string | number | bigint | boolean |
|
|
44
|
+
} & HTMLAttributes<HTMLElement>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { LayoutBody, LayoutContext, LayoutContextProvider, LayoutHeader, LayoutHeaderTabs, LayoutInfo, NavbarLinkItem };
|
|
@@ -150,7 +150,7 @@ function PageFooter({ items, children, className, ...props }) {
|
|
|
150
150
|
const pathname = usePathname();
|
|
151
151
|
const { previous, next } = useMemo(() => {
|
|
152
152
|
if (items) return items;
|
|
153
|
-
const idx = footerList.findIndex((item) => isActive(item.url, pathname
|
|
153
|
+
const idx = footerList.findIndex((item) => isActive(item.url, pathname));
|
|
154
154
|
if (idx === -1) return {};
|
|
155
155
|
return {
|
|
156
156
|
previous: footerList[idx - 1],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType } from "../../utils/link-item.js";
|
|
1
|
+
import { ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType, useLinkItemActive } from "../../utils/link-item.js";
|
|
2
2
|
import * as react from "react";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -62,7 +62,7 @@ declare function resolveLinkItems({
|
|
|
62
62
|
declare function renderTitleNav({
|
|
63
63
|
title,
|
|
64
64
|
url
|
|
65
|
-
}: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean |
|
|
65
|
+
}: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
66
66
|
declare function useLinkItems({
|
|
67
67
|
githubUrl,
|
|
68
68
|
links
|
|
@@ -72,4 +72,4 @@ declare function useLinkItems({
|
|
|
72
72
|
all: LinkItemType[];
|
|
73
73
|
};
|
|
74
74
|
//#endregion
|
|
75
|
-
export { BaseLayoutProps, ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType, NavOptions, renderTitleNav, resolveLinkItems, useLinkItems };
|
|
75
|
+
export { BaseLayoutProps, ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType, NavOptions, renderTitleNav, resolveLinkItems, useLinkItemActive, useLinkItems };
|
package/dist/style.css
CHANGED
|
@@ -1092,6 +1092,9 @@
|
|
|
1092
1092
|
.max-w-\[900px\] {
|
|
1093
1093
|
max-width: 900px;
|
|
1094
1094
|
}
|
|
1095
|
+
.max-w-\[1168px\] {
|
|
1096
|
+
max-width: 1168px;
|
|
1097
|
+
}
|
|
1095
1098
|
.max-w-\[1200px\] {
|
|
1096
1099
|
max-width: 1200px;
|
|
1097
1100
|
}
|
|
@@ -2862,10 +2865,12 @@
|
|
|
2862
2865
|
:is(pre *):is(.shiki *):not(.not-fumadocs-codeblock *) {
|
|
2863
2866
|
.line& {
|
|
2864
2867
|
position: relative;
|
|
2865
|
-
min-height: 1lh;
|
|
2866
2868
|
padding-left: var(--padding-left);
|
|
2867
2869
|
padding-right: var(--padding-right);
|
|
2868
2870
|
}
|
|
2871
|
+
.line:empty& {
|
|
2872
|
+
height: 1lh;
|
|
2873
|
+
}
|
|
2869
2874
|
.has-focused .line&:not(.focused) {
|
|
2870
2875
|
filter: blur(2px);
|
|
2871
2876
|
transition: filter 200ms;
|
|
@@ -79,7 +79,8 @@ declare function LinkItem({
|
|
|
79
79
|
item,
|
|
80
80
|
...props
|
|
81
81
|
}: Omit<ComponentProps<'a'>, 'href'> & {
|
|
82
|
-
item: WithHref;
|
|
82
|
+
item: LinkItemType & WithHref;
|
|
83
83
|
}): react_jsx_runtime0.JSX.Element;
|
|
84
|
+
declare function useLinkItemActive(link: LinkItemType): boolean;
|
|
84
85
|
//#endregion
|
|
85
|
-
export { ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType };
|
|
86
|
+
export { ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType, useLinkItemActive };
|
package/dist/utils/link-item.js
CHANGED
|
@@ -7,9 +7,7 @@ import Link from "fumadocs-core/link";
|
|
|
7
7
|
|
|
8
8
|
//#region src/utils/link-item.tsx
|
|
9
9
|
function LinkItem({ ref, item, ...props }) {
|
|
10
|
-
const
|
|
11
|
-
const activeType = item.active ?? "url";
|
|
12
|
-
const active = activeType !== "none" && isActive(item.url, pathname, activeType === "nested-url");
|
|
10
|
+
const active = useLinkItemActive(item);
|
|
13
11
|
return /* @__PURE__ */ jsx(Link, {
|
|
14
12
|
ref,
|
|
15
13
|
href: item.url,
|
|
@@ -19,6 +17,12 @@ function LinkItem({ ref, item, ...props }) {
|
|
|
19
17
|
children: props.children
|
|
20
18
|
});
|
|
21
19
|
}
|
|
20
|
+
function useLinkItemActive(link) {
|
|
21
|
+
const pathname = usePathname();
|
|
22
|
+
if (link.type === "custom" || !link.url) return false;
|
|
23
|
+
if (link.active === "none") return false;
|
|
24
|
+
return isActive(link.url, pathname, link.active === "nested-url");
|
|
25
|
+
}
|
|
22
26
|
|
|
23
27
|
//#endregion
|
|
24
|
-
export { LinkItem };
|
|
28
|
+
export { LinkItem, useLinkItemActive };
|
package/dist/utils/urls.js
CHANGED
|
@@ -6,7 +6,7 @@ function normalize(urlOrPath) {
|
|
|
6
6
|
/**
|
|
7
7
|
* @returns if `href` is matching the given pathname
|
|
8
8
|
*/
|
|
9
|
-
function isActive(href, pathname, nested =
|
|
9
|
+
function isActive(href, pathname, nested = false) {
|
|
10
10
|
href = normalize(href);
|
|
11
11
|
pathname = normalize(pathname);
|
|
12
12
|
return href === pathname || nested && pathname.startsWith(`${href}/`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "16.6.
|
|
3
|
+
"version": "16.6.3",
|
|
4
4
|
"description": "The Radix UI version of Fumadocs UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -113,14 +113,14 @@
|
|
|
113
113
|
"@radix-ui/react-slot": "^1.2.4",
|
|
114
114
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
115
115
|
"class-variance-authority": "^0.7.1",
|
|
116
|
-
"lucide-react": "^0.
|
|
116
|
+
"lucide-react": "^0.570.0",
|
|
117
117
|
"motion": "^12.34.0",
|
|
118
118
|
"next-themes": "^0.4.6",
|
|
119
119
|
"react-medium-image-zoom": "^5.4.0",
|
|
120
120
|
"react-remove-scroll": "^2.7.2",
|
|
121
121
|
"rehype-raw": "^7.0.0",
|
|
122
122
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
123
|
-
"tailwind-merge": "^3.4.
|
|
123
|
+
"tailwind-merge": "^3.4.1",
|
|
124
124
|
"unist-util-visit": "^5.1.0",
|
|
125
125
|
"@fumadocs/tailwind": "0.0.2"
|
|
126
126
|
},
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"unified": "^11.0.5",
|
|
136
136
|
"@fumadocs/cli": "1.2.4",
|
|
137
137
|
"eslint-config-custom": "0.0.0",
|
|
138
|
-
"fumadocs-core": "16.6.
|
|
138
|
+
"fumadocs-core": "16.6.3",
|
|
139
139
|
"tsconfig": "0.0.0"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"next": "16.x.x",
|
|
144
144
|
"react": "^19.2.0",
|
|
145
145
|
"react-dom": "^19.2.0",
|
|
146
|
-
"fumadocs-core": "16.6.
|
|
146
|
+
"fumadocs-core": "16.6.3"
|
|
147
147
|
},
|
|
148
148
|
"peerDependenciesMeta": {
|
|
149
149
|
"next": {
|