fumadocs-ui 15.2.11 → 15.2.13
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/shiki.css +55 -51
- package/dist/components/layout/search-toggle.d.ts +6 -4
- package/dist/components/layout/search-toggle.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/layouts/docs.d.ts +1 -1
- package/dist/layouts/docs.d.ts.map +1 -1
- package/dist/layouts/docs.js +5 -5
- package/dist/layouts/notebook.d.ts +2 -2
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +13 -9
- package/dist/layouts/shared.d.ts +1 -0
- package/dist/layouts/shared.d.ts.map +1 -1
- package/dist/layouts/shared.js +7 -0
- package/dist/page.d.ts +4 -3
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +9 -9
- package/dist/style.css +53 -54
- package/dist/utils/use-copy-button.d.ts +1 -1
- package/dist/utils/use-copy-button.d.ts.map +1 -1
- package/dist/utils/use-copy-button.js +11 -10
- package/package.json +6 -6
package/css/shiki.css
CHANGED
|
@@ -1,65 +1,69 @@
|
|
|
1
|
-
.shiki code span {
|
|
2
|
-
color: var(--shiki-light);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.dark .shiki code span {
|
|
6
|
-
color: var(--shiki-dark);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
1
|
.fd-codeblock pre > * {
|
|
10
2
|
display: grid;
|
|
11
3
|
font-size: 13px;
|
|
12
4
|
}
|
|
13
5
|
|
|
14
|
-
.shiki
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
6
|
+
.shiki:not(.not-fumadocs-codeblock *) {
|
|
7
|
+
code span {
|
|
8
|
+
color: var(--shiki-light);
|
|
9
|
+
}
|
|
18
10
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
11
|
+
code .diff.remove {
|
|
12
|
+
background-color: var(--fd-diff-remove-color);
|
|
13
|
+
opacity: 0.7;
|
|
14
|
+
}
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
16
|
+
code .diff::before {
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 6px;
|
|
19
|
+
}
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
code .diff.remove::before {
|
|
22
|
+
content: '-';
|
|
23
|
+
color: var(--fd-diff-remove-symbol-color);
|
|
24
|
+
}
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
26
|
+
code .diff.add {
|
|
27
|
+
background-color: var(--fd-diff-add-color);
|
|
28
|
+
}
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
code .diff.add::before {
|
|
31
|
+
content: '+';
|
|
32
|
+
color: var(--fd-diff-add-symbol-color);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
code .diff {
|
|
36
|
+
margin: 0 -16px;
|
|
37
|
+
padding: 0 16px;
|
|
38
|
+
position: relative;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.highlighted {
|
|
42
|
+
margin: 0 -16px;
|
|
43
|
+
padding: 0 16px;
|
|
44
|
+
background-color: color-mix(
|
|
45
|
+
in oklab,
|
|
46
|
+
var(--color-fd-primary) 10%,
|
|
47
|
+
transparent
|
|
48
|
+
);
|
|
49
|
+
}
|
|
43
50
|
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
.highlighted-word {
|
|
52
|
+
padding: 1px 2px;
|
|
53
|
+
margin: -1px -3px;
|
|
54
|
+
border: 1px solid
|
|
55
|
+
color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
|
|
56
|
+
background-color: color-mix(
|
|
57
|
+
in oklab,
|
|
58
|
+
var(--color-fd-primary) 10%,
|
|
59
|
+
transparent
|
|
60
|
+
);
|
|
61
|
+
border-radius: 2px;
|
|
62
|
+
}
|
|
52
63
|
}
|
|
53
64
|
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
|
|
59
|
-
background-color: color-mix(
|
|
60
|
-
in oklab,
|
|
61
|
-
var(--color-fd-primary) 10%,
|
|
62
|
-
transparent
|
|
63
|
-
);
|
|
64
|
-
border-radius: 2px;
|
|
65
|
+
.dark .shiki:not(.not-fumadocs-codeblock *) {
|
|
66
|
+
code span {
|
|
67
|
+
color: var(--shiki-dark);
|
|
68
|
+
}
|
|
65
69
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
2
|
import { type ButtonProps } from '../../components/ui/button.js';
|
|
3
|
-
|
|
3
|
+
interface SearchToggleProps extends Omit<ComponentProps<'button'>, 'color'>, ButtonProps {
|
|
4
4
|
hideIfDisabled?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function
|
|
5
|
+
}
|
|
6
|
+
export declare function SearchToggle({ hideIfDisabled, size, color, ...props }: SearchToggleProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare function LargeSearchToggle({ hideIfDisabled, ...props }: ComponentProps<'button'> & {
|
|
7
8
|
hideIfDisabled?: boolean;
|
|
8
9
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
9
11
|
//# sourceMappingURL=search-toggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/search-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"search-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/search-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,wBAAwB,CAAC;AAE1E,UAAU,iBACR,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAC7C,WAAW;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAC3B,cAAc,EACd,IAAa,EACb,KAAe,EACf,GAAG,KAAK,EACT,EAAE,iBAAiB,kDAuBnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,kDA6BA"}
|
|
@@ -8,7 +8,7 @@ export const buttonVariants = cva('inline-flex items-center justify-center round
|
|
|
8
8
|
secondary: 'border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground',
|
|
9
9
|
},
|
|
10
10
|
size: {
|
|
11
|
-
sm: 'gap-1
|
|
11
|
+
sm: 'gap-1 px-2 py-1.5 text-xs',
|
|
12
12
|
icon: 'p-1.5 [&_svg]:size-5',
|
|
13
13
|
'icon-sm': 'p-1.5 [&_svg]:size-4.5',
|
|
14
14
|
},
|
package/dist/layouts/docs.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
15
15
|
*/
|
|
16
16
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
17
17
|
}
|
|
18
|
-
export declare function DocsLayout({ nav: { transparentMode, ...nav }, searchToggle, disableThemeSwitch, themeSwitch,
|
|
18
|
+
export declare function DocsLayout({ nav: { transparentMode, ...nav }, sidebar, searchToggle, disableThemeSwitch, themeSwitch, i18n, children, ...props }: DocsLayoutProps): ReactNode;
|
|
19
19
|
export declare function DocsLayoutSidebar({ collapsible, components, nav, links, footer, banner, ...props }: Omit<SidebarOptions, 'tabs'> & {
|
|
20
20
|
links?: LinkItemType[];
|
|
21
21
|
nav?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAcrE,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAcrE,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAY/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG;QAClC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEF;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAY,EACZ,YAAY,EACZ,kBAA0B,EAC1B,WAA8C,EAC9C,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CAkG7B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAkB,EAClB,UAAU,EACV,GAAG,EACH,KAAU,EACV,MAAM,EACN,MAAM,EACN,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAChC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,2CA2CA;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,WAAW,EACX,KAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;CAC9C,kDAiCA;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Languages, Sidebar as SidebarIcon } from '../icons.js';
|
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
5
|
import { buttonVariants } from '../components/ui/button.js';
|
|
6
6
|
import { CollapsibleSidebar, Sidebar, SidebarCollapseTrigger, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarViewport, } from '../components/layout/sidebar.js';
|
|
7
|
-
import { slot, slots } from '../layouts/shared.js';
|
|
7
|
+
import { omit, slot, slots } from '../layouts/shared.js';
|
|
8
8
|
import { BaseLinkItem, } from '../layouts/links.js';
|
|
9
9
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
10
10
|
import { getLinks } from './shared.js';
|
|
@@ -12,12 +12,12 @@ import { LanguageToggle, LanguageToggleText, } from '../components/layout/langua
|
|
|
12
12
|
import { CollapsibleControl, Navbar, NavbarSidebarTrigger, } from '../layouts/docs-client.js';
|
|
13
13
|
import { TreeContextProvider } from '../contexts/tree.js';
|
|
14
14
|
import { ThemeToggle } from '../components/layout/theme-toggle.js';
|
|
15
|
-
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
16
15
|
import { getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
|
|
17
16
|
import { NavProvider, StylesProvider, } from '../contexts/layout.js';
|
|
18
17
|
import Link from 'fumadocs-core/link';
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
19
|
+
export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar = {}, searchToggle, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, i18n = false, children, ...props }) {
|
|
20
|
+
const tabs = useMemo(() => getSidebarTabsFromOptions(sidebar.tabs, props.tree) ?? [], [sidebar.tabs, props.tree]);
|
|
21
21
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
22
22
|
const variables = cn('[--fd-tocnav-height:36px] md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px] xl:[--fd-toc-width:286px] xl:[--fd-tocnav-height:0px]', !nav.component && nav.enabled !== false
|
|
23
23
|
? '[--fd-nav-height:calc(var(--spacing)*14)] md:[--fd-nav-height:0px]'
|
|
@@ -29,7 +29,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, searchToggle
|
|
|
29
29
|
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [slot(nav, _jsxs(Navbar, { className: "md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), _jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children: nav.children }), slots('sm', searchToggle, _jsx(SearchToggle, { hideIfDisabled: true })), _jsx(NavbarSidebarTrigger, { className: "-me-2 md:hidden" })] })), _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex flex-1 flex-row pe-(--fd-layout-offset)', variables, props.containerProps?.className), style: {
|
|
30
30
|
...layoutVariables,
|
|
31
31
|
...props.containerProps?.style,
|
|
32
|
-
}, children: [slot(sidebar, _jsx(DocsLayoutSidebar, { ...sidebar, links: links, nav: _jsxs(_Fragment, { children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium", children: nav.title }), nav.children] }), banner: _jsxs(_Fragment, { children: [tabs.length > 0 ? _jsx(RootToggle, { options: tabs }) : null, slots('lg', searchToggle, _jsx(LargeSearchToggle, { hideIfDisabled: true, className: "rounded-lg max-md:hidden" })), sidebar.banner] }), footer: _jsxs(_Fragment, { children: [_jsx(DocsLayoutSidebarFooter, { links: links.filter((item) => item.type === 'icon'), i18n: i18n, themeSwitch: themeSwitch }), sidebar.footer] }) })), _jsx(StylesProvider, { ...pageStyles, children: children })] })] }) }));
|
|
32
|
+
}, children: [slot(sidebar, _jsx(DocsLayoutSidebar, { ...omit(sidebar, 'enabled', 'component', 'tabs'), links: links, nav: _jsxs(_Fragment, { children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium", children: nav.title }), nav.children] }), banner: _jsxs(_Fragment, { children: [tabs.length > 0 ? _jsx(RootToggle, { options: tabs }) : null, slots('lg', searchToggle, _jsx(LargeSearchToggle, { hideIfDisabled: true, className: "rounded-lg max-md:hidden" })), sidebar.banner] }), footer: _jsxs(_Fragment, { children: [_jsx(DocsLayoutSidebarFooter, { links: links.filter((item) => item.type === 'icon'), i18n: i18n, themeSwitch: themeSwitch }), sidebar.footer] }) })), _jsx(StylesProvider, { ...pageStyles, children: children })] })] }) }));
|
|
33
33
|
}
|
|
34
34
|
export function DocsLayoutSidebar({ collapsible = true, components, nav, links = [], footer, banner, ...props }) {
|
|
35
35
|
const Aside = collapsible ? CollapsibleSidebar : Sidebar;
|
|
@@ -9,9 +9,9 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
9
9
|
nav?: BaseLayoutProps['nav'] & {
|
|
10
10
|
mode?: 'top' | 'auto';
|
|
11
11
|
};
|
|
12
|
-
sidebar?:
|
|
12
|
+
sidebar?: Partial<SidebarOptions>;
|
|
13
13
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
14
14
|
}
|
|
15
|
-
export declare function DocsLayout(
|
|
15
|
+
export declare function DocsLayout(props: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export { Navbar, NavbarSidebarTrigger };
|
|
17
17
|
//# sourceMappingURL=notebook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,kBAAkB,CAAC;AAsB/E,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EAErB,MAAM,mBAAmB,CAAC;AAa3B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAkJhD;AAoLD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -16,7 +16,8 @@ import { NavProvider, StylesProvider, } from '../contexts/layout.js';
|
|
|
16
16
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
17
17
|
import Link from 'fumadocs-core/link';
|
|
18
18
|
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
19
|
-
export function DocsLayout(
|
|
19
|
+
export function DocsLayout(props) {
|
|
20
|
+
const { tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { collapsible: sidebarCollapsible = true, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, } = props;
|
|
20
21
|
const navMode = nav.mode ?? 'auto';
|
|
21
22
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
22
23
|
const tabs = useMemo(() => getSidebarTabsFromOptions(tabOptions, props.tree) ?? [], [tabOptions, props.tree]);
|
|
@@ -33,22 +34,25 @@ export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav
|
|
|
33
34
|
...layoutVariables,
|
|
34
35
|
...props.containerProps?.style,
|
|
35
36
|
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-(--fd-layout-offset)', navMode === 'top' ? 'bg-transparent' : 'md:[--fd-nav-height:0px]', sidebar.className), inner: {
|
|
36
|
-
className: cn(navMode === 'top' ? 'md:pt-2.5' : 'md:pt-3.5'
|
|
37
|
-
}, children: [_jsxs(SidebarHeader, { children: [navMode === 'auto' && (_jsxs("div", { className: "flex flex-row justify-between max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-medium", children: nav.title }), _jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
37
|
+
className: cn(navMode === 'top' ? 'md:pt-2.5' : 'md:pt-3.5'),
|
|
38
|
+
}, children: [_jsxs(SidebarHeader, { children: [navMode === 'auto' && (_jsxs("div", { className: "flex flex-row justify-between max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-medium", children: nav.title }), sidebarCollapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
38
39
|
color: 'ghost',
|
|
39
40
|
size: 'icon-sm',
|
|
40
|
-
}), 'text-fd-muted-foreground mb-auto'), children: _jsx(SidebarIcon, {}) })] })), nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { options: tabs })) : null] }), _jsxs(SidebarViewport, { children: [tabMode === 'navbar' &&
|
|
41
|
-
tabs.map((tab, i) => (_jsx(SidebarLayoutTab, { item: tab, className: cn('lg:hidden', i === tabs.length - 1 && 'mb-4') }, tab.url))), links.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: cn('flex flex-row items-center', !sidebarFooter && 'md:hidden'), children: [i18n ? (_jsx(LanguageToggle, { className: "me-auto md:hidden", children: _jsx(Languages, { className: "size-5 text-fd-muted-foreground" }) })) : null, slot(themeSwitch, _jsx(ThemeToggle, { className: "md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarFooter] })] }), _jsx(DocsNavbar, {
|
|
41
|
+
}), 'text-fd-muted-foreground mb-auto'), children: _jsx(SidebarIcon, {}) }))] })), nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { options: tabs })) : null] }), _jsxs(SidebarViewport, { children: [tabMode === 'navbar' &&
|
|
42
|
+
tabs.map((tab, i) => (_jsx(SidebarLayoutTab, { item: tab, className: cn('lg:hidden', i === tabs.length - 1 && 'mb-4') }, tab.url))), links.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: cn('flex flex-row items-center', !sidebarFooter && 'md:hidden'), children: [i18n ? (_jsx(LanguageToggle, { className: "me-auto md:hidden", children: _jsx(Languages, { className: "size-5 text-fd-muted-foreground" }) })) : null, slot(themeSwitch, _jsx(ThemeToggle, { className: "md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarFooter] })] }), _jsx(DocsNavbar, { ...props, links: links, tabs: tabMode == 'navbar' ? tabs : [] }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
|
|
42
43
|
}
|
|
43
|
-
function DocsNavbar({
|
|
44
|
+
function DocsNavbar({ links, tabs, ...props }) {
|
|
45
|
+
const navMode = props.nav?.mode ?? 'auto';
|
|
46
|
+
const sidebarCollapsible = props.sidebar?.collapsible ?? true;
|
|
47
|
+
const nav = (_jsx(Link, { href: props.nav?.url ?? '/', className: cn('inline-flex items-center gap-2.5 font-semibold empty:hidden', navMode === 'auto' && 'md:hidden'), children: props.nav?.title }));
|
|
44
48
|
return (_jsxs(Navbar, { mode: navMode, children: [_jsxs("div", { className: cn('flex flex-row border-b border-fd-foreground/10 px-4 h-14', navMode === 'auto' && 'md:px-6'), children: [_jsxs("div", { className: cn('flex flex-row items-center', navMode === 'top' && 'flex-1 pe-4'), children: [sidebarCollapsible && navMode === 'auto' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
45
49
|
color: 'ghost',
|
|
46
50
|
size: 'icon-sm',
|
|
47
|
-
}), 'text-fd-muted-foreground -ms-1.5 me-2 data-[collapsed=false]:hidden max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null, nav] }), slots('lg', searchToggle, _jsx(LargeSearchToggle, { hideIfDisabled: true, className: cn('w-full my-auto rounded-xl max-md:hidden', navMode === 'top' ? 'max-w-sm px-2' : 'max-w-[240px]') })), _jsxs("div", { className: "flex flex-1 flex-row items-center justify-end", children: [_jsx("div", { className: "flex flex-row items-center gap-6 px-4 empty:hidden max-lg:hidden", children: links
|
|
51
|
+
}), 'text-fd-muted-foreground -ms-1.5 me-2 data-[collapsed=false]:hidden max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null, nav] }), slots('lg', props.searchToggle, _jsx(LargeSearchToggle, { hideIfDisabled: true, className: cn('w-full my-auto rounded-xl max-md:hidden', navMode === 'top' ? 'max-w-sm px-2' : 'max-w-[240px]') })), _jsxs("div", { className: "flex flex-1 flex-row items-center justify-end", children: [_jsx("div", { className: "flex flex-row items-center gap-6 px-4 empty:hidden max-lg:hidden", children: links
|
|
48
52
|
.filter((item) => item.type !== 'icon')
|
|
49
|
-
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground" }, i))) }), children, slots('sm', searchToggle, _jsx(SearchToggle, { hideIfDisabled: true, className: "md:hidden" })), _jsx(NavbarSidebarTrigger, { className: "-me-1.5 md:hidden" }), links
|
|
53
|
+
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground" }, i))) }), props.nav?.children, slots('sm', props.searchToggle, _jsx(SearchToggle, { hideIfDisabled: true, className: "md:hidden" })), _jsx(NavbarSidebarTrigger, { className: "-me-1.5 md:hidden" }), links
|
|
50
54
|
.filter((item) => item.type === 'icon')
|
|
51
|
-
.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon-sm', color: 'ghost' }), 'text-fd-muted-foreground max-lg:hidden'), "aria-label": item.label, children: item.icon }, i))), i18n ? (_jsx(LanguageToggle, { className: "max-md:hidden", children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, slot(themeSwitch, _jsx(ThemeToggle, { className: "ms-2 max-md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarCollapsible && navMode === 'top' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
55
|
+
.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon-sm', color: 'ghost' }), 'text-fd-muted-foreground max-lg:hidden'), "aria-label": item.label, children: item.icon }, i))), props.i18n ? (_jsx(LanguageToggle, { className: "max-md:hidden", children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, slot(props.themeSwitch, _jsx(ThemeToggle, { className: "ms-2 max-md:hidden", mode: props.themeSwitch?.mode ?? 'light-dark-system' })), sidebarCollapsible && navMode === 'top' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
52
56
|
color: 'secondary',
|
|
53
57
|
size: 'icon-sm',
|
|
54
58
|
}), 'ms-2 text-fd-muted-foreground rounded-full max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null] })] }), tabs.length > 0 ? (_jsx(LayoutTabs, { className: "px-6 border-b border-fd-foreground/10 h-10 max-lg:hidden", children: tabs.map((tab) => (_jsx(LayoutTab, { ...tab }, tab.url))) })) : null] }));
|
package/dist/layouts/shared.d.ts
CHANGED
|
@@ -62,4 +62,5 @@ export declare function slots<Comp extends Record<string, ReactNode>>(variant: k
|
|
|
62
62
|
enabled?: boolean;
|
|
63
63
|
components?: Comp;
|
|
64
64
|
} | undefined, def: ReactNode): ReactNode;
|
|
65
|
+
export declare function omit<T extends Record<string, unknown>, Keys extends keyof T>(obj: T, ...keys: Keys[]): Omit<T, Keys>;
|
|
65
66
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/layouts/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE;QACZ,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,IAAI,CAAC,EAAE,YAAY,GAAG,mBAAmB,CAAC;KAC3C,CAAC;IAEF,YAAY,CAAC,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;YAClB,EAAE,EAAE,SAAS,CAAC;YACd,EAAE,EAAE,SAAS,CAAC;SACf,CAAC,CAAC;KACJ,CAAC,CAAC;IAEH;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,E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AC1D,OAAO,EAAE,MAAM,IAAI,EACnB,GAAG,EACC;IACE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB,GACD,SAAS,EACb,GAAG,EAAE,SAAS,GACb,SAAS,CAMX;AAED,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,SAAS,MAAM,CAAC,EAC1E,GAAG,EAAE,CAAC,EACN,GAAG,IAAI,EAAE,IAAI,EAAE,GACd,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAMf"}
|
package/dist/layouts/shared.js
CHANGED
|
@@ -33,3 +33,10 @@ export function slots(variant, obj, def) {
|
|
|
33
33
|
return _jsx(Slot, { children: obj.components[variant] });
|
|
34
34
|
return def;
|
|
35
35
|
}
|
|
36
|
+
export function omit(obj, ...keys) {
|
|
37
|
+
const clone = { ...obj };
|
|
38
|
+
for (const key of keys) {
|
|
39
|
+
delete clone[key];
|
|
40
|
+
}
|
|
41
|
+
return clone;
|
|
42
|
+
}
|
package/dist/page.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TableOfContents } from 'fumadocs-core/server';
|
|
2
|
-
import { type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type AnchorHTMLAttributes, type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
3
|
import { type AnchorProviderProps } from 'fumadocs-core/toc';
|
|
4
|
-
import { type
|
|
4
|
+
import { type BreadcrumbProps, type FooterProps } from './page-client.js';
|
|
5
5
|
import { type TOCProps } from './components/layout/toc.js';
|
|
6
6
|
type TableOfContentOptions = Omit<TOCProps, 'items' | 'children'> & Pick<AnchorProviderProps, 'single'> & {
|
|
7
7
|
enabled: boolean;
|
|
@@ -65,7 +65,8 @@ export interface DocsPageProps {
|
|
|
65
65
|
article?: HTMLAttributes<HTMLElement>;
|
|
66
66
|
children: ReactNode;
|
|
67
67
|
}
|
|
68
|
-
export declare function DocsPage({ toc, full, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopoverReplace, ...tocPopoverOptions }, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions }, ...props }: DocsPageProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare function DocsPage({ toc, full, editOnGithub, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopoverReplace, ...tocPopoverOptions }, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions }, ...props }: DocsPageProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export declare function EditOnGitHub(props: ComponentProps<'a'>): import("react/jsx-runtime").JSX.Element;
|
|
69
70
|
/**
|
|
70
71
|
* Add typography styles
|
|
71
72
|
*/
|
package/dist/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,WAAW,EAOjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,yBAAyB,CAAC;AAMjC,KAAK,qBAAqB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,CAAC,GAC/D,I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AAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAQ,EACR,IAAY,EACZ,YAAY,EACZ,qBAAqB,EAAE,EACrB,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,iBAAiB,EAC5B,GAAG,iBAAiB,EAChB,EACN,cAAc,EAAE,EACd,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,GAAG,UAAU,EACT,EACN,GAAG,KAAK,EACT,EAAE,aAAa,2CA8Ff;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,2CAuBtD;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,2HAOnB,CAAC;AAIH,eAAO,MAAM,eAAe,uIAgB1B,CAAC;AAIH,eAAO,MAAM,SAAS,mIAapB,CAAC;AAIH;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAM5E"}
|
package/dist/page.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, } from 'react';
|
|
3
3
|
import { AnchorProvider } from 'fumadocs-core/toc';
|
|
4
4
|
import { slot } from './layouts/shared.js';
|
|
5
5
|
import { cn } from './utils/cn.js';
|
|
6
|
-
import { Footer, LastUpdate,
|
|
6
|
+
import { Breadcrumb, Footer, LastUpdate, PageArticle, PageBody, TocPopover, TocPopoverContent, TocPopoverTrigger, } from './page-client.js';
|
|
7
7
|
import { Toc, TOCItems, TOCScrollArea, } from './components/layout/toc.js';
|
|
8
8
|
import { buttonVariants } from './components/ui/button.js';
|
|
9
9
|
import { Edit, Text } from './icons.js';
|
|
10
10
|
import { I18nLabel } from './contexts/i18n.js';
|
|
11
11
|
import ClerkTOCItems from './components/layout/toc-clerk.js';
|
|
12
|
-
export function DocsPage({ toc = [], full = false, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopoverReplace, ...tocPopoverOptions } = {}, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {}, ...props }) {
|
|
12
|
+
export function DocsPage({ toc = [], full = false, editOnGithub, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopoverReplace, ...tocPopoverOptions } = {}, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {}, ...props }) {
|
|
13
13
|
const isTocRequired = toc.length > 0 ||
|
|
14
14
|
tocOptions.footer !== undefined ||
|
|
15
15
|
tocOptions.header !== undefined;
|
|
@@ -24,17 +24,17 @@ export function DocsPage({ toc = [], full = false, tableOfContentPopover: { enab
|
|
|
24
24
|
}, children: [slot({ enabled: tocPopoverEnabled, component: tocPopoverReplace }, _jsxs(TocPopover, { className: "h-10", children: [_jsx(TocPopoverTrigger, { className: "w-full", items: toc }), _jsxs(TocPopoverContent, { children: [tocPopoverOptions.header, _jsx(TOCScrollArea, { isMenu: true, children: tocPopoverOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc })) : (_jsx(TOCItems, { items: toc })) }), tocPopoverOptions.footer] })] }), {
|
|
25
25
|
items: toc,
|
|
26
26
|
...tocPopoverOptions,
|
|
27
|
-
}), _jsxs(PageArticle, { ...props.article, className: cn(full || !tocEnabled ? 'max-w-[1120px]' : 'max-w-[860px]', props.article?.className), children: [slot(props.breadcrumb, _jsx(Breadcrumb, { ...props.breadcrumb })), props.children, _jsx("div", { role: "none", className: "flex-1" }), _jsxs("div", { className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden", children: [
|
|
27
|
+
}), _jsxs(PageArticle, { ...props.article, className: cn(full || !tocEnabled ? 'max-w-[1120px]' : 'max-w-[860px]', props.article?.className), children: [slot(props.breadcrumb, _jsx(Breadcrumb, { ...props.breadcrumb })), props.children, _jsx("div", { role: "none", className: "flex-1" }), _jsxs("div", { className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden", children: [editOnGithub && (_jsx(EditOnGitHub, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith('/') ? editOnGithub.path.slice(1) : editOnGithub.path}` })), props.lastUpdate && (_jsx(LastUpdate, { date: new Date(props.lastUpdate) }))] }), slot(props.footer, _jsx(Footer, { items: props.footer?.items }))] })] }), slot({ enabled: tocEnabled, component: tocReplace }, _jsxs(Toc, { children: [tocOptions.header, _jsxs("h3", { className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground", children: [_jsx(Text, { className: "size-4" }), _jsx(I18nLabel, { label: "toc" })] }), _jsx(TOCScrollArea, { children: tocOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc })) : (_jsx(TOCItems, { items: toc })) }), tocOptions.footer] }), {
|
|
28
28
|
items: toc,
|
|
29
29
|
...tocOptions,
|
|
30
30
|
})] }));
|
|
31
31
|
}
|
|
32
|
-
function EditOnGitHub(
|
|
33
|
-
|
|
34
|
-
return (_jsxs("a", { href: href, target: "_blank", rel: "noreferrer noopener", ...props, className: cn(buttonVariants({
|
|
32
|
+
export function EditOnGitHub(props) {
|
|
33
|
+
return (_jsx("a", { target: "_blank", rel: "noreferrer noopener", ...props, className: cn(buttonVariants({
|
|
35
34
|
color: 'secondary',
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
size: 'sm',
|
|
36
|
+
className: 'gap-1.5 not-prose',
|
|
37
|
+
}), props.className), children: props.children ?? (_jsxs(_Fragment, { children: [_jsx(Edit, { className: "size-3.5" }), _jsx(I18nLabel, { label: "editOnGithub" })] })) }));
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Add typography styles
|
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -1585,7 +1585,7 @@
|
|
|
1585
1585
|
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
1586
1586
|
}
|
|
1587
1587
|
.transition {
|
|
1588
|
-
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
|
|
1588
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;
|
|
1589
1589
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
1590
1590
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
1591
1591
|
}
|
|
@@ -2101,11 +2101,6 @@
|
|
|
2101
2101
|
padding-inline-start: var(--fd-layout-offset);
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
|
-
.md\:pt-0 {
|
|
2105
|
-
@media (width >= 48rem) {
|
|
2106
|
-
padding-top: calc(var(--spacing) * 0);
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
2104
|
.md\:pt-2\.5 {
|
|
2110
2105
|
@media (width >= 48rem) {
|
|
2111
2106
|
padding-top: calc(var(--spacing) * 2.5);
|
|
@@ -2356,60 +2351,64 @@
|
|
|
2356
2351
|
--color-fd-secondary: hsl(0, 0%, 18%);
|
|
2357
2352
|
--color-fd-muted-foreground: hsl(0, 0%, 72%);
|
|
2358
2353
|
}
|
|
2359
|
-
.shiki code span {
|
|
2360
|
-
color: var(--shiki-light);
|
|
2361
|
-
}
|
|
2362
|
-
.dark .shiki code span {
|
|
2363
|
-
color: var(--shiki-dark);
|
|
2364
|
-
}
|
|
2365
2354
|
.fd-codeblock pre > * {
|
|
2366
2355
|
display: grid;
|
|
2367
2356
|
font-size: 13px;
|
|
2368
2357
|
}
|
|
2369
|
-
.shiki
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
}
|
|
2373
|
-
.shiki code .diff::before {
|
|
2374
|
-
position: absolute;
|
|
2375
|
-
left: 6px;
|
|
2376
|
-
}
|
|
2377
|
-
.shiki code .diff.remove::before {
|
|
2378
|
-
content: '-';
|
|
2379
|
-
color: var(--fd-diff-remove-symbol-color);
|
|
2380
|
-
}
|
|
2381
|
-
.shiki code .diff.add {
|
|
2382
|
-
background-color: var(--fd-diff-add-color);
|
|
2383
|
-
}
|
|
2384
|
-
.shiki code .diff.add::before {
|
|
2385
|
-
content: '+';
|
|
2386
|
-
color: var(--fd-diff-add-symbol-color);
|
|
2387
|
-
}
|
|
2388
|
-
.shiki code .diff {
|
|
2389
|
-
margin: 0 -16px;
|
|
2390
|
-
padding: 0 16px;
|
|
2391
|
-
position: relative;
|
|
2392
|
-
}
|
|
2393
|
-
.shiki .highlighted {
|
|
2394
|
-
margin: 0 -16px;
|
|
2395
|
-
padding: 0 16px;
|
|
2396
|
-
background-color: color-mix( in oklab, hsl(0, 0%, 9%) 10%, transparent );
|
|
2397
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2398
|
-
background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
|
|
2358
|
+
.shiki:not(.not-fumadocs-codeblock *) {
|
|
2359
|
+
code span {
|
|
2360
|
+
color: var(--shiki-light);
|
|
2399
2361
|
}
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2362
|
+
code .diff.remove {
|
|
2363
|
+
background-color: var(--fd-diff-remove-color);
|
|
2364
|
+
opacity: 0.7;
|
|
2365
|
+
}
|
|
2366
|
+
code .diff::before {
|
|
2367
|
+
position: absolute;
|
|
2368
|
+
left: 6px;
|
|
2407
2369
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2370
|
+
code .diff.remove::before {
|
|
2371
|
+
content: '-';
|
|
2372
|
+
color: var(--fd-diff-remove-symbol-color);
|
|
2373
|
+
}
|
|
2374
|
+
code .diff.add {
|
|
2375
|
+
background-color: var(--fd-diff-add-color);
|
|
2376
|
+
}
|
|
2377
|
+
code .diff.add::before {
|
|
2378
|
+
content: '+';
|
|
2379
|
+
color: var(--fd-diff-add-symbol-color);
|
|
2380
|
+
}
|
|
2381
|
+
code .diff {
|
|
2382
|
+
margin: 0 -16px;
|
|
2383
|
+
padding: 0 16px;
|
|
2384
|
+
position: relative;
|
|
2385
|
+
}
|
|
2386
|
+
.highlighted {
|
|
2387
|
+
margin: 0 -16px;
|
|
2388
|
+
padding: 0 16px;
|
|
2389
|
+
background-color: color-mix( in oklab, hsl(0, 0%, 9%) 10%, transparent );
|
|
2390
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2391
|
+
background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
.highlighted-word {
|
|
2395
|
+
padding: 1px 2px;
|
|
2396
|
+
margin: -1px -3px;
|
|
2397
|
+
border: 1px solid color-mix(in srgb, hsl(0, 0%, 9%) 50%, transparent);
|
|
2398
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2399
|
+
border: 1px solid color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
|
|
2400
|
+
}
|
|
2401
|
+
background-color: color-mix( in oklab, hsl(0, 0%, 9%) 10%, transparent );
|
|
2402
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2403
|
+
background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
|
|
2404
|
+
}
|
|
2405
|
+
border-radius: 2px;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
.dark .shiki:not(.not-fumadocs-codeblock *) {
|
|
2409
|
+
code span {
|
|
2410
|
+
color: var(--shiki-dark);
|
|
2411
2411
|
}
|
|
2412
|
-
border-radius: 2px;
|
|
2413
2412
|
}
|
|
2414
2413
|
@layer base {
|
|
2415
2414
|
*, ::after, ::before, ::backdrop, ::file-selector-button {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type MouseEventHandler } from 'react';
|
|
2
|
-
export declare function useCopyButton(onCopy: () => void): [checked: boolean, onClick: MouseEventHandler];
|
|
2
|
+
export declare function useCopyButton(onCopy: () => void | Promise<void>): [checked: boolean, onClick: MouseEventHandler];
|
|
3
3
|
//# sourceMappingURL=use-copy-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-copy-button.d.ts","sourceRoot":"","sources":["../../src/utils/use-copy-button.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-copy-button.d.ts","sourceRoot":"","sources":["../../src/utils/use-copy-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAG5E,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACjC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAwBhD"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
3
4
|
export function useCopyButton(onCopy) {
|
|
4
5
|
const [checked, setChecked] = useState(false);
|
|
5
6
|
const timeoutRef = useRef(null);
|
|
6
|
-
const
|
|
7
|
-
callbackRef.current = onCopy;
|
|
8
|
-
const onClick = useCallback(() => {
|
|
7
|
+
const onClick = useEffectEvent(() => {
|
|
9
8
|
if (timeoutRef.current)
|
|
10
9
|
window.clearTimeout(timeoutRef.current);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const res = Promise.resolve(onCopy());
|
|
11
|
+
void res.then(() => {
|
|
12
|
+
setChecked(true);
|
|
13
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
14
|
+
setChecked(false);
|
|
15
|
+
}, 1500);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
17
18
|
// Avoid updates after being unmounted
|
|
18
19
|
useEffect(() => {
|
|
19
20
|
return () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.13",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -87,20 +87,20 @@
|
|
|
87
87
|
"postcss-selector-parser": "^7.1.0",
|
|
88
88
|
"react-medium-image-zoom": "^5.2.14",
|
|
89
89
|
"tailwind-merge": "^3.2.0",
|
|
90
|
-
"fumadocs-core": "15.2.
|
|
90
|
+
"fumadocs-core": "15.2.13"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@next/eslint-plugin-next": "^15.3.1",
|
|
94
|
-
"@tailwindcss/cli": "^4.1.
|
|
94
|
+
"@tailwindcss/cli": "^4.1.5",
|
|
95
95
|
"@types/lodash.merge": "^4.6.9",
|
|
96
96
|
"@types/react": "^19.1.2",
|
|
97
|
-
"@types/react-dom": "^19.1.
|
|
97
|
+
"@types/react-dom": "^19.1.3",
|
|
98
98
|
"next": "15.3.1",
|
|
99
|
-
"tailwindcss": "^4.1.
|
|
99
|
+
"tailwindcss": "^4.1.5",
|
|
100
100
|
"tsc-alias": "^1.8.15",
|
|
101
101
|
"@fumadocs/cli": "0.1.1",
|
|
102
102
|
"eslint-config-custom": "0.0.0",
|
|
103
|
-
"fumadocs-core": "15.2.
|
|
103
|
+
"fumadocs-core": "15.2.13",
|
|
104
104
|
"tsconfig": "0.0.0"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|