fumadocs-ui 15.6.9 → 15.6.11
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/components/codeblock.d.ts +1 -1
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +2 -1
- package/dist/components/dialog/search-algolia.d.ts +2 -1
- package/dist/components/dialog/search-algolia.d.ts.map +1 -1
- package/dist/components/dialog/search-default.d.ts +2 -1
- package/dist/components/dialog/search-default.d.ts.map +1 -1
- package/dist/components/dialog/search-orama.d.ts +2 -1
- package/dist/components/dialog/search-orama.d.ts.map +1 -1
- package/dist/components/dialog/search.d.ts +4 -1
- package/dist/components/dialog/search.d.ts.map +1 -1
- package/dist/components/dialog/search.js +12 -2
- package/dist/contexts/search.d.ts.map +1 -1
- package/dist/contexts/search.js +5 -1
- package/dist/layouts/{docs-client.d.ts → docs/client.d.ts} +1 -1
- package/dist/layouts/docs/client.d.ts.map +1 -0
- package/dist/layouts/{docs-client.js → docs/client.js} +7 -7
- package/dist/layouts/{docs.d.ts → docs/index.d.ts} +6 -6
- package/dist/layouts/docs/index.d.ts.map +1 -0
- package/dist/layouts/{docs.js → docs/index.js} +22 -22
- package/dist/layouts/{home.d.ts → home/index.d.ts} +2 -2
- package/dist/layouts/home/index.d.ts.map +1 -0
- package/dist/layouts/{home.js → home/index.js} +13 -11
- package/dist/layouts/{notebook-client.d.ts → notebook/client.d.ts} +2 -2
- package/dist/layouts/notebook/client.d.ts.map +1 -0
- package/dist/layouts/{notebook-client.js → notebook/client.js} +6 -6
- package/dist/layouts/{notebook.d.ts → notebook/index.d.ts} +4 -4
- package/dist/layouts/notebook/index.d.ts.map +1 -0
- package/dist/layouts/{notebook.js → notebook/index.js} +28 -29
- package/dist/mdx.d.ts +1 -1
- package/dist/style.css +13 -3
- package/package.json +44 -12
- package/dist/layouts/docs-client.d.ts.map +0 -1
- package/dist/layouts/docs.d.ts.map +0 -1
- package/dist/layouts/home.d.ts.map +0 -1
- package/dist/layouts/notebook-client.d.ts.map +0 -1
- package/dist/layouts/notebook.d.ts.map +0 -1
|
@@ -38,5 +38,5 @@ export declare function CodeBlock({ ref, title, allowCopy, keepBackground, icon,
|
|
|
38
38
|
export declare function CodeBlockTabs({ ref, ...props }: ComponentProps<typeof Tabs>): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
export declare function CodeBlockTabsList(props: ComponentProps<typeof TabsList>): import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
export declare function CodeBlockTabsTrigger({ children, ...props }: ComponentProps<typeof TabsTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export declare const CodeBlockTab:
|
|
41
|
+
export declare const CodeBlockTab: typeof TabsContent;
|
|
42
42
|
//# sourceMappingURL=codeblock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IAE5C;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAA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C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,KAAK,SAAS,CAAC;CAC9E;AAOD,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAS/C;AAED,wBAAgB,SAAS,CAAC,EACxB,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAsB,EACtB,IAAI,EACJ,aAAkB,EAClB,QAAQ,EACR,OAEC,EACD,GAAG,KAAK,EACT,EAAE,cAAc,2CAwEhB;AAwCD,wBAAgB,aAAa,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,2CA2B3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,2CAoBvE;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,WAAW,CAAC,2CAapC;AAGD,eAAO,MAAM,YAAY,oBAAc,CAAC"}
|
|
@@ -63,4 +63,5 @@ export function CodeBlockTabsList(props) {
|
|
|
63
63
|
export function CodeBlockTabsTrigger({ children, ...props }) {
|
|
64
64
|
return (_jsxs(TabsTrigger, { ...props, className: cn('relative group inline-flex text-sm font-medium text-nowrap items-center gap-2 px-2 first:ms-1 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5', props.className), children: [_jsx("div", { className: "absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary" }), children] }));
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
// TODO: currently Vite RSC plugin has problem with adding `asChild` here, maybe revisit this in future
|
|
67
|
+
export const CodeBlockTab = TabsContent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type AlgoliaOptions } from 'fumadocs-core/search/client';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { type SharedProps } from './search.js';
|
|
4
|
+
import type { SearchLink, TagItem } from '../../contexts/search.js';
|
|
4
5
|
export interface AlgoliaSearchDialogProps extends SharedProps {
|
|
5
6
|
searchOptions: AlgoliaOptions;
|
|
6
7
|
links?: SearchLink[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-algolia.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-algolia.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"search-algolia.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-algolia.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,OAAO,EAYL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,aAAa,EAAE,cAAc,CAAC;IAC9B,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,aAAa,EACb,IAAS,EACT,UAAU,EACV,WAAmB,EACnB,UAAkB,EAClB,KAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,wBAAwB,2CA4D1B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { type SharedProps } from './search.js';
|
|
3
|
+
import type { SearchLink, TagItem } from '../../contexts/search.js';
|
|
3
4
|
export interface DefaultSearchDialogProps extends SharedProps {
|
|
4
5
|
links?: SearchLink[];
|
|
5
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-default.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-default.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"search-default.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-default.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAG1D,OAAO,EAYL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IAEjB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,UAAU,EACV,IAAS,EACT,GAAG,EACH,OAAO,EACP,IAAc,EACd,UAAkB,EAClB,KAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAkE1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type OramaCloudOptions } from 'fumadocs-core/search/client';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { type SharedProps } from './search.js';
|
|
4
|
+
import type { SearchLink, TagItem } from '../../contexts/search.js';
|
|
4
5
|
export interface OramaSearchDialogProps extends SharedProps {
|
|
5
6
|
links?: SearchLink[];
|
|
6
7
|
client: OramaCloudOptions['client'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-orama.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-orama.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"search-orama.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-orama.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,OAAO,EAYL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,MAAM,EACN,aAAa,EACb,IAAS,EACT,UAAU,EACV,SAAiB,EACjB,UAAkB,EAClB,KAAK,EACL,MAAM,EACN,KAAU,EACV,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAgExB"}
|
|
@@ -2,6 +2,7 @@ import { type ComponentProps, type ReactNode } from 'react';
|
|
|
2
2
|
import { DialogContent, DialogOverlay } from '@radix-ui/react-dialog';
|
|
3
3
|
import type { SortedResult } from 'fumadocs-core/server';
|
|
4
4
|
import type { SharedProps } from '../../contexts/search.js';
|
|
5
|
+
import type { HighlightedText } from 'fumadocs-core/search/server';
|
|
5
6
|
type ReactSortedResult = Omit<SortedResult, 'content'> & {
|
|
6
7
|
external?: boolean;
|
|
7
8
|
content: ReactNode;
|
|
@@ -34,7 +35,8 @@ export declare function SearchDialogList({ items, Empty, Item, ...props }: Omit<
|
|
|
34
35
|
onClick: () => void;
|
|
35
36
|
}) => ReactNode;
|
|
36
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export declare function SearchDialogListItem({ item, className, children, ...props }: ComponentProps<'button'> & {
|
|
38
|
+
export declare function SearchDialogListItem({ item, className, children, renderHighlights: render, ...props }: ComponentProps<'button'> & {
|
|
39
|
+
renderHighlights?: typeof renderHighlights;
|
|
38
40
|
item: ReactSortedResult;
|
|
39
41
|
}): import("react/jsx-runtime").JSX.Element;
|
|
40
42
|
export declare function SearchDialogIcon(props: ComponentProps<'svg'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -47,6 +49,7 @@ export declare function TagsList({ tag, onTagChange, allowClear, ...props }: Tag
|
|
|
47
49
|
export declare function TagsListItem({ value, className, ...props }: ComponentProps<'button'> & {
|
|
48
50
|
value: string;
|
|
49
51
|
}): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare function renderHighlights(highlights: HighlightedText[]): ReactNode;
|
|
50
53
|
export declare function useSearch(): {
|
|
51
54
|
open: boolean;
|
|
52
55
|
onOpenChange: (open: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,aAAa,EACb,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,aAAa,EACb,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,KAAK,iBAAiB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAGF,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAA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
117
117
|
heading: _jsx(Hash, { className: "size-4 shrink-0 text-fd-muted-foreground" }),
|
|
118
118
|
page: (_jsx(FileText, { className: "size-6 text-fd-muted-foreground bg-fd-muted border p-0.5 rounded-sm shadow-sm shrink-0" })),
|
|
119
119
|
};
|
|
120
|
-
export function SearchDialogListItem({ item, className, children, ...props }) {
|
|
120
|
+
export function SearchDialogListItem({ item, className, children, renderHighlights: render = renderHighlights, ...props }) {
|
|
121
121
|
const { active: activeId, setActive } = useSearchList();
|
|
122
122
|
const active = item.id === activeId;
|
|
123
123
|
return (_jsx("button", { type: "button", ref: useCallback((element) => {
|
|
@@ -130,7 +130,9 @@ export function SearchDialogListItem({ item, className, children, ...props }) {
|
|
|
130
130
|
}
|
|
131
131
|
}, [active]), "aria-selected": active, className: cn('relative flex select-none flex-row items-center gap-2 p-2 text-start text-sm rounded-lg', item.type !== 'page' && 'ps-8', item.type === 'page' || item.type === 'heading'
|
|
132
132
|
? 'font-medium'
|
|
133
|
-
: 'text-fd-popover-foreground/80', active && 'bg-fd-accent text-fd-accent-foreground', className), onPointerMove: () => setActive(item.id), ...props, children: children ?? (_jsxs(_Fragment, { children: [item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-4.5 inset-y-0 w-px bg-fd-border" })), icons[item.type], _jsx("p", { className: "min-w-0 truncate", children: item.
|
|
133
|
+
: 'text-fd-popover-foreground/80', active && 'bg-fd-accent text-fd-accent-foreground', className), onPointerMove: () => setActive(item.id), ...props, children: children ?? (_jsxs(_Fragment, { children: [item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-4.5 inset-y-0 w-px bg-fd-border" })), icons[item.type], _jsx("p", { className: "min-w-0 truncate", children: item.contentWithHighlights
|
|
134
|
+
? render(item.contentWithHighlights)
|
|
135
|
+
: item.content })] })) }));
|
|
134
136
|
}
|
|
135
137
|
export function SearchDialogIcon(props) {
|
|
136
138
|
const { isLoading } = useSearch();
|
|
@@ -157,6 +159,14 @@ export function TagsListItem({ value, className, ...props }) {
|
|
|
157
159
|
onValueChange(selected && allowClear ? undefined : value);
|
|
158
160
|
}, tabIndex: -1, ...props, children: props.children }));
|
|
159
161
|
}
|
|
162
|
+
function renderHighlights(highlights) {
|
|
163
|
+
return highlights.map((node, i) => {
|
|
164
|
+
if (node.styles?.highlight) {
|
|
165
|
+
return (_jsx("span", { className: "text-fd-primary bg-fd-primary/10", children: node.content }, i));
|
|
166
|
+
}
|
|
167
|
+
return _jsx(Fragment, { children: node.content }, i);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
160
170
|
export function useSearch() {
|
|
161
171
|
const ctx = useContext(Context);
|
|
162
172
|
if (!ctx)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/contexts/search.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAGf,UAAU,MAAM;IACd,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEtD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;;OAIG;IACH,YAAY,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ErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;;OAIG;IACH,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAQD,wBAAgB,gBAAgB,IAAI,iBAAiB,CAEpD;AAcD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,QAAQ,EACR,OAAc,EACd,OAAO,EACP,MASC,EACD,KAAK,GACN,EAAE,mBAAmB,2CA4CrB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,aAI/D"}
|
package/dist/contexts/search.js
CHANGED
|
@@ -42,7 +42,11 @@ export function SearchProvider({ SearchDialog, children, preload = true, options
|
|
|
42
42
|
window.removeEventListener('keydown', handler);
|
|
43
43
|
};
|
|
44
44
|
}, [hotKey]);
|
|
45
|
-
return (_jsxs(SearchContext.Provider, { value: useMemo(() => ({
|
|
45
|
+
return (_jsxs(SearchContext.Provider, { value: useMemo(() => ({
|
|
46
|
+
enabled: true,
|
|
47
|
+
hotKey,
|
|
48
|
+
setOpenSearch: setIsOpen,
|
|
49
|
+
}), [hotKey]), children: [isOpen !== undefined && (_jsx(SearchDialog, { open: isOpen, onOpenChange: setIsOpen,
|
|
46
50
|
// @ts-expect-error -- insert prop for official UIs
|
|
47
51
|
links: links, ...options })), children] }));
|
|
48
52
|
}
|
|
@@ -2,4 +2,4 @@ import { type ComponentProps } from 'react';
|
|
|
2
2
|
export declare function Navbar(props: ComponentProps<'header'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function LayoutBody(props: ComponentProps<'main'>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function CollapsibleControl(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,kBAAkB,4CA2BjC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Sidebar as SidebarIcon } from '
|
|
4
|
-
import { cn } from '
|
|
5
|
-
import { buttonVariants } from '
|
|
6
|
-
import { useSidebar } from '
|
|
7
|
-
import { useNav } from '
|
|
8
|
-
import { SidebarCollapseTrigger } from '
|
|
9
|
-
import { SearchToggle } from '
|
|
3
|
+
import { Sidebar as SidebarIcon } from '../../icons.js';
|
|
4
|
+
import { cn } from '../../utils/cn.js';
|
|
5
|
+
import { buttonVariants } from '../../components/ui/button.js';
|
|
6
|
+
import { useSidebar } from '../../contexts/sidebar.js';
|
|
7
|
+
import { useNav } from '../../contexts/layout.js';
|
|
8
|
+
import { SidebarCollapseTrigger } from '../../components/layout/sidebar.js';
|
|
9
|
+
import { SearchToggle } from '../../components/layout/search-toggle.js';
|
|
10
10
|
export function Navbar(props) {
|
|
11
11
|
const { isTransparent } = useNav();
|
|
12
12
|
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('fixed top-(--fd-banner-height) inset-x-0 z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm', !isTransparent && 'bg-fd-background/80', props.className), children: props.children }));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { PageTree } from 'fumadocs-core/server';
|
|
2
2
|
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
|
-
import { SidebarTrigger } from '
|
|
4
|
-
import { type LinkItemType } from '
|
|
5
|
-
import { type BaseLayoutProps } from '
|
|
6
|
-
import { CollapsibleControl, Navbar } from '
|
|
7
|
-
import { type SidebarOptions } from '
|
|
3
|
+
import { SidebarTrigger } from '../../components/layout/sidebar.js';
|
|
4
|
+
import { type LinkItemType } from '../../layouts/links.js';
|
|
5
|
+
import { type BaseLayoutProps } from '../../layouts/shared.js';
|
|
6
|
+
import { CollapsibleControl, Navbar } from '../../layouts/docs/client.js';
|
|
7
|
+
import { type SidebarOptions } from '../../layouts/docs/shared.js';
|
|
8
8
|
export interface DocsLayoutProps extends BaseLayoutProps {
|
|
9
9
|
tree: PageTree.Root;
|
|
10
10
|
sidebar?: SidebarOptions & ComponentProps<'aside'> & {
|
|
@@ -18,4 +18,4 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
18
18
|
}
|
|
19
19
|
export declare function DocsLayout({ nav: { transparentMode, ...nav }, sidebar: { tabs: sidebarTabs, enabled: sidebarEnabled, ...sidebarProps }, searchToggle, disableThemeSwitch, themeSwitch, i18n, children, ...props }: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export { CollapsibleControl, Navbar, SidebarTrigger, type LinkItemType };
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/index.tsx"],"names":[],"mappings":"AAAA,OAA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{ Languages, Sidebar as SidebarIcon } from '
|
|
4
|
-
import { cn } from '
|
|
5
|
-
import { buttonVariants } from '
|
|
6
|
-
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '
|
|
7
|
-
import { BaseLinkItem, } from '
|
|
8
|
-
import { RootToggle } from '
|
|
9
|
-
import { getLinks } from '
|
|
10
|
-
import { LanguageToggle, LanguageToggleText, } from '
|
|
11
|
-
import { CollapsibleControl, LayoutBody, Navbar } from '
|
|
12
|
-
import { TreeContextProvider } from '
|
|
13
|
-
import { ThemeToggle } from '
|
|
14
|
-
import { getSidebarTabsFromOptions, SidebarLinkItem, } from '
|
|
15
|
-
import { NavProvider } from '
|
|
3
|
+
import { Languages, Sidebar as SidebarIcon } from '../../icons.js';
|
|
4
|
+
import { cn } from '../../utils/cn.js';
|
|
5
|
+
import { buttonVariants } from '../../components/ui/button.js';
|
|
6
|
+
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '../../components/layout/sidebar.js';
|
|
7
|
+
import { BaseLinkItem, } from '../../layouts/links.js';
|
|
8
|
+
import { RootToggle } from '../../components/layout/root-toggle.js';
|
|
9
|
+
import { getLinks } from '../../layouts/shared.js';
|
|
10
|
+
import { LanguageToggle, LanguageToggleText, } from '../../components/layout/language-toggle.js';
|
|
11
|
+
import { CollapsibleControl, LayoutBody, Navbar } from '../../layouts/docs/client.js';
|
|
12
|
+
import { TreeContextProvider } from '../../contexts/tree.js';
|
|
13
|
+
import { ThemeToggle } from '../../components/layout/theme-toggle.js';
|
|
14
|
+
import { getSidebarTabsFromOptions, SidebarLinkItem, } from '../../layouts/docs/shared.js';
|
|
15
|
+
import { NavProvider } from '../../contexts/layout.js';
|
|
16
16
|
import Link from 'fumadocs-core/link';
|
|
17
|
-
import { LargeSearchToggle, SearchToggle, } from '
|
|
17
|
+
import { LargeSearchToggle, SearchToggle, } from '../../components/layout/search-toggle.js';
|
|
18
18
|
import { HideIfEmpty } from 'fumadocs-core/hide-if-empty';
|
|
19
19
|
export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { tabs: sidebarTabs, enabled: sidebarEnabled = true, ...sidebarProps } = {}, searchToggle = {}, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, i18n = false, children, ...props }) {
|
|
20
20
|
const tabs = useMemo(() => getSidebarTabsFromOptions(sidebarTabs, props.tree) ?? [], [sidebarTabs, props.tree]);
|
|
@@ -28,15 +28,15 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
|
|
|
28
28
|
const viewport = (_jsxs(SidebarViewport, { children: [links
|
|
29
29
|
.filter((v) => v.type !== 'icon')
|
|
30
30
|
.map((item, i, list) => (_jsx(SidebarLinkItem, { item: item, className: cn(i === list.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: components })] }));
|
|
31
|
-
const mobile = (_jsxs(SidebarContentMobile, { ...rest, children: [_jsxs(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0
|
|
31
|
+
const mobile = (_jsxs(SidebarContentMobile, { ...rest, children: [_jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex text-fd-muted-foreground items-center gap-1.5", children: [_jsx("div", { className: "flex flex-1", children: iconLinks.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({
|
|
32
|
+
size: 'icon-sm',
|
|
33
|
+
color: 'ghost',
|
|
34
|
+
className: 'p-2',
|
|
35
|
+
})), "aria-label": item.label, children: item.icon }, i))) }), i18n ? (_jsxs(LanguageToggle, { children: [_jsx(Languages, { className: "size-4.5" }), _jsx(LanguageToggleText, {})] })) : null, themeSwitch.enabled !== false &&
|
|
36
|
+
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0", mode: themeSwitch.mode }))), _jsx(SidebarTrigger, { className: cn(buttonVariants({
|
|
37
37
|
color: 'ghost',
|
|
38
38
|
size: 'icon-sm',
|
|
39
|
-
className: 'p-2
|
|
39
|
+
className: 'p-2',
|
|
40
40
|
})), children: _jsx(SidebarIcon, {}) })] }), tabs.length > 0 && _jsx(RootToggle, { options: tabs }), banner] }), viewport, _jsx(SidebarFooter, { className: "empty:hidden", children: footer })] }));
|
|
41
41
|
const content = (_jsxs(SidebarContent, { ...rest, children: [_jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
42
42
|
color: 'ghost',
|
|
@@ -44,7 +44,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
|
|
|
44
44
|
className: 'mb-auto text-fd-muted-foreground',
|
|
45
45
|
})), children: _jsx(SidebarIcon, {}) }))] }), searchToggle.enabled !== false &&
|
|
46
46
|
(searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { hideIfDisabled: true }))), tabs.length > 0 && _jsx(RootToggle, { options: tabs }), banner] }), viewport, _jsxs(HideIfEmpty, { as: SidebarFooter, children: [_jsxs("div", { className: "flex text-fd-muted-foreground items-center justify-end empty:hidden", children: [iconLinks.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon-sm', color: 'ghost' }), i === iconLinks.length - 1 && 'me-auto'), "aria-label": item.label, children: item.icon }, i))), i18n ? (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-4.5" }) })) : null, themeSwitch.enabled !== false &&
|
|
47
|
-
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0
|
|
47
|
+
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0", mode: themeSwitch.mode })))] }), footer] })] }));
|
|
48
48
|
return (_jsx(Sidebar, { defaultOpenLevel: defaultOpenLevel, prefetch: prefetch, Mobile: mobile, Content: _jsxs(_Fragment, { children: [collapsible && _jsx(CollapsibleControl, {}), content] }) }));
|
|
49
49
|
}
|
|
50
50
|
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [nav.enabled !== false &&
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import { type BaseLayoutProps, type NavOptions } from '
|
|
2
|
+
import { type BaseLayoutProps, type NavOptions } from '../../layouts/shared.js';
|
|
3
3
|
export interface HomeLayoutProps extends BaseLayoutProps {
|
|
4
4
|
nav?: Partial<NavOptions & {
|
|
5
5
|
/**
|
|
@@ -10,4 +10,4 @@ export interface HomeLayoutProps extends BaseLayoutProps {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function HomeLayout(props: HomeLayoutProps & HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare function Header({ nav, i18n, links, githubUrl, themeSwitch, searchToggle, }: HomeLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AA8B1B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,GAAG,cAAc,CAAC,WAAW,CAAC,2CAmCrD;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAQ,EACR,IAAY,EACZ,KAAK,EACL,SAAS,EACT,WAAgB,EAChB,YAAiB,GAClB,EAAE,eAAe,2CAmGjB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useMemo } from 'react';
|
|
3
|
-
import { cn } from '
|
|
4
|
-
import { getLinks } from '
|
|
5
|
-
import { NavProvider } from '
|
|
6
|
-
import { Navbar, NavbarLink, NavbarMenu, NavbarMenuContent, NavbarMenuLink, NavbarMenuTrigger, } from '
|
|
7
|
-
import { LargeSearchToggle, SearchToggle, } from '
|
|
8
|
-
import { ThemeToggle } from '
|
|
9
|
-
import { LanguageToggle, LanguageToggleText, } from '
|
|
10
|
-
import { ChevronDown, Languages } from '
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
import { getLinks, } from '../../layouts/shared.js';
|
|
5
|
+
import { NavProvider } from '../../contexts/layout.js';
|
|
6
|
+
import { Navbar, NavbarLink, NavbarMenu, NavbarMenuContent, NavbarMenuLink, NavbarMenuTrigger, } from '../../layouts/home/navbar.js';
|
|
7
|
+
import { LargeSearchToggle, SearchToggle, } from '../../components/layout/search-toggle.js';
|
|
8
|
+
import { ThemeToggle } from '../../components/layout/theme-toggle.js';
|
|
9
|
+
import { LanguageToggle, LanguageToggleText, } from '../../components/layout/language-toggle.js';
|
|
10
|
+
import { ChevronDown, Languages } from '../../icons.js';
|
|
11
11
|
import Link from 'fumadocs-core/link';
|
|
12
|
-
import { Menu, MenuContent, MenuLinkItem, MenuTrigger, } from '
|
|
13
|
-
import { buttonVariants } from '
|
|
12
|
+
import { Menu, MenuContent, MenuLinkItem, MenuTrigger, } from '../../layouts/home/menu.js';
|
|
13
|
+
import { buttonVariants } from '../../components/ui/button.js';
|
|
14
14
|
export function HomeLayout(props) {
|
|
15
15
|
const { nav = {}, links, githubUrl, i18n, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, searchToggle, ...rest } = props;
|
|
16
16
|
return (_jsx(NavProvider, { transparentMode: nav?.transparentMode, children: _jsxs("main", { id: "nd-home-layout", ...rest, className: cn('flex flex-1 flex-col pt-14', rest.className), children: [nav.enabled !== false &&
|
|
@@ -47,5 +47,7 @@ function NavbarLinkItem({ item, ...props }) {
|
|
|
47
47
|
return (_jsx(NavbarLink, { ...props, item: item, variant: item.type, "aria-label": item.type === 'icon' ? item.label : undefined, children: item.type === 'icon' ? item.icon : item.text }));
|
|
48
48
|
}
|
|
49
49
|
function isSecondary(item) {
|
|
50
|
-
|
|
50
|
+
if ('secondary' in item && item.secondary != null)
|
|
51
|
+
return item.secondary;
|
|
52
|
+
return item.type === 'icon';
|
|
51
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
import type { Option } from '
|
|
2
|
+
import type { Option } from '../../components/layout/root-toggle.js';
|
|
3
3
|
export declare function Navbar({ mode, ...props }: ComponentProps<'header'> & {
|
|
4
4
|
mode: 'top' | 'auto';
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,4 +8,4 @@ export declare function NavbarSidebarTrigger({ className, ...props }: ComponentP
|
|
|
8
8
|
export declare function LayoutTabs({ options, ...props }: ComponentProps<'div'> & {
|
|
9
9
|
options: Option[];
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/notebook/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAQrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,2CAoBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAkB1B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,2CA+BA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from '
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
|
-
import { useSidebar } from '
|
|
6
|
-
import { useNav } from '
|
|
7
|
-
import { buttonVariants } from '
|
|
8
|
-
import { Sidebar as SidebarIcon } from '
|
|
5
|
+
import { useSidebar } from '../../contexts/sidebar.js';
|
|
6
|
+
import { useNav } from '../../contexts/layout.js';
|
|
7
|
+
import { buttonVariants } from '../../components/ui/button.js';
|
|
8
|
+
import { Sidebar as SidebarIcon } from '../../icons.js';
|
|
9
9
|
import Link from 'fumadocs-core/link';
|
|
10
10
|
import { usePathname } from 'fumadocs-core/framework';
|
|
11
|
-
import { isActive } from '
|
|
11
|
+
import { isActive } from '../../utils/is-active.js';
|
|
12
12
|
export function Navbar({ mode, ...props }) {
|
|
13
13
|
const { open, collapsed } = useSidebar();
|
|
14
14
|
const { isTransparent } = useNav();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ComponentProps, type HTMLAttributes } from 'react';
|
|
2
|
-
import { type BaseLayoutProps } from '
|
|
3
|
-
import { type SidebarOptions } from '
|
|
2
|
+
import { type BaseLayoutProps } from '../../layouts/shared.js';
|
|
3
|
+
import { type SidebarOptions } from '../../layouts/docs/shared.js';
|
|
4
4
|
import type { PageTree } from 'fumadocs-core/server';
|
|
5
|
-
import { Navbar, NavbarSidebarTrigger } from '
|
|
5
|
+
import { Navbar, NavbarSidebarTrigger } from '../../layouts/notebook/client.js';
|
|
6
6
|
export interface DocsLayoutProps extends BaseLayoutProps {
|
|
7
7
|
tree: PageTree.Root;
|
|
8
8
|
tabMode?: 'sidebar' | 'navbar';
|
|
@@ -14,4 +14,4 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
14
14
|
}
|
|
15
15
|
export declare function DocsLayout(props: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export { Navbar, NavbarSidebarTrigger };
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/notebook/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AA6BlE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAUnC,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,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEnD,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAgNhD;AA6LD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useMemo, } from 'react';
|
|
3
|
-
import { getLinks } from '
|
|
4
|
-
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '
|
|
5
|
-
import { TreeContextProvider } from '
|
|
6
|
-
import { cn } from '
|
|
7
|
-
import { buttonVariants } from '
|
|
8
|
-
import { ChevronDown, Languages, Sidebar as SidebarIcon, X, } from '
|
|
9
|
-
import { BaseLinkItem } from '
|
|
10
|
-
import { LanguageToggle } from '
|
|
11
|
-
import { ThemeToggle } from '
|
|
12
|
-
import { Popover, PopoverContent, PopoverTrigger, } from '
|
|
13
|
-
import { getSidebarTabsFromOptions, SidebarLinkItem, } from '
|
|
14
|
-
import { LayoutBody, LayoutTabs, Navbar, NavbarSidebarTrigger, } from '
|
|
15
|
-
import { NavProvider } from '
|
|
16
|
-
import { RootToggle } from '
|
|
3
|
+
import { getLinks } from '../../layouts/shared.js';
|
|
4
|
+
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '../../components/layout/sidebar.js';
|
|
5
|
+
import { TreeContextProvider } from '../../contexts/tree.js';
|
|
6
|
+
import { cn } from '../../utils/cn.js';
|
|
7
|
+
import { buttonVariants } from '../../components/ui/button.js';
|
|
8
|
+
import { ChevronDown, Languages, Sidebar as SidebarIcon, X, } from '../../icons.js';
|
|
9
|
+
import { BaseLinkItem } from '../../layouts/links.js';
|
|
10
|
+
import { LanguageToggle } from '../../components/layout/language-toggle.js';
|
|
11
|
+
import { ThemeToggle } from '../../components/layout/theme-toggle.js';
|
|
12
|
+
import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover.js';
|
|
13
|
+
import { getSidebarTabsFromOptions, SidebarLinkItem, } from '../../layouts/docs/shared.js';
|
|
14
|
+
import { LayoutBody, LayoutTabs, Navbar, NavbarSidebarTrigger, } from '../../layouts/notebook/client.js';
|
|
15
|
+
import { NavProvider } from '../../contexts/layout.js';
|
|
16
|
+
import { RootToggle } from '../../components/layout/root-toggle.js';
|
|
17
17
|
import Link from 'fumadocs-core/link';
|
|
18
|
-
import { LargeSearchToggle, SearchToggle, } from '
|
|
18
|
+
import { LargeSearchToggle, SearchToggle, } from '../../components/layout/search-toggle.js';
|
|
19
19
|
import { HideIfEmpty } from 'fumadocs-core/hide-if-empty';
|
|
20
20
|
export function DocsLayout(props) {
|
|
21
21
|
const { tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { tabs: tabOptions, ...sidebarProps } = {}, i18n = false, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, } = props;
|
|
@@ -55,26 +55,25 @@ export function DocsLayout(props) {
|
|
|
55
55
|
}
|
|
56
56
|
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsx(NavProvider, { transparentMode: transparentMode, children: _jsxs(LayoutBody, { ...props.containerProps, className: cn(variables, props.containerProps?.className), children: [sidebar(), _jsx(DocsNavbar, { ...props, links: links, tabs: tabMode == 'navbar' ? tabs : [] }), props.children] }) }) }));
|
|
57
57
|
}
|
|
58
|
-
function DocsNavbar({ links, tabs, searchToggle = {}, themeSwitch = {}, ...props }) {
|
|
59
|
-
const navMode =
|
|
58
|
+
function DocsNavbar({ links, tabs, searchToggle = {}, themeSwitch = {}, nav = {}, ...props }) {
|
|
59
|
+
const navMode = nav.mode ?? 'auto';
|
|
60
60
|
const sidebarCollapsible = props.sidebar?.collapsible ?? true;
|
|
61
|
-
|
|
62
|
-
return (_jsxs(Navbar, { mode: navMode, children: [_jsxs("div", { className: cn('flex border-b px-4 flex-1', 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({
|
|
61
|
+
return (_jsxs(Navbar, { mode: navMode, children: [_jsxs("div", { className: cn('flex border-b px-2.5 gap-2 flex-1 md:px-4', navMode === 'auto' && 'md:px-6'), children: [_jsxs("div", { className: cn('flex items-center', navMode === 'top' && 'flex-1'), children: [sidebarCollapsible && navMode === 'auto' && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
63
62
|
color: 'ghost',
|
|
64
63
|
size: 'icon-sm',
|
|
65
|
-
}), 'text-fd-muted-foreground
|
|
66
|
-
(searchToggle.components?.lg ? (_jsx("div", { className: cn('w-full my-auto max-md:hidden', navMode === 'top' ? 'rounded-xl max-w-sm' : 'max-w-[240px]'), children: searchToggle.components
|
|
64
|
+
}), 'text-fd-muted-foreground data-[collapsed=false]:hidden max-md:hidden'), children: _jsx(SidebarIcon, {}) })), _jsx(Link, { href: nav.url ?? '/', className: cn('inline-flex items-center gap-2.5 font-semibold empty:hidden', navMode === 'auto' && 'md:hidden'), children: nav.title })] }), searchToggle.enabled !== false &&
|
|
65
|
+
(searchToggle.components?.lg ? (_jsx("div", { className: cn('w-full my-auto max-md:hidden', navMode === 'top' ? 'rounded-xl max-w-sm' : 'max-w-[240px]'), children: searchToggle.components.lg })) : (_jsx(LargeSearchToggle, { hideIfDisabled: true, className: cn('w-full my-auto max-md:hidden', navMode === 'top'
|
|
67
66
|
? 'rounded-xl max-w-sm ps-2.5'
|
|
68
|
-
: 'max-w-[240px]') }))), _jsxs("div", { className: "flex flex-1
|
|
67
|
+
: 'max-w-[240px]') }))), _jsxs("div", { className: "flex flex-1 items-center justify-end md:gap-2", children: [_jsx("div", { className: "flex items-center gap-6 empty:hidden max-lg:hidden", children: links
|
|
69
68
|
.filter((item) => item.type !== 'icon')
|
|
70
|
-
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary" }, i))) }),
|
|
71
|
-
(searchToggle.components?.sm ?? (_jsx(SearchToggle, { hideIfDisabled: true, className: "p-2 md:hidden" }))), _jsx(NavbarSidebarTrigger, { className: "p-2 -me-1.5 md:hidden" }), links
|
|
69
|
+
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary" }, i))) }), nav.children, links
|
|
72
70
|
.filter((item) => item.type === 'icon')
|
|
73
|
-
.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))),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
.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))), _jsxs("div", { className: "flex items-center md:hidden", children: [searchToggle.enabled !== false &&
|
|
72
|
+
(searchToggle.components?.sm ?? (_jsx(SearchToggle, { hideIfDisabled: true, className: "p-2" }))), _jsx(NavbarSidebarTrigger, { className: "p-2" })] }), _jsxs("div", { className: "flex items-center gap-2 max-md:hidden", children: [props.i18n ? (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, themeSwitch.enabled !== false &&
|
|
73
|
+
(themeSwitch.component ?? (_jsx(ThemeToggle, { mode: themeSwitch.mode ?? 'light-dark-system' }))), sidebarCollapsible && navMode === 'top' && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
74
|
+
color: 'secondary',
|
|
75
|
+
size: 'icon-sm',
|
|
76
|
+
}), 'text-fd-muted-foreground rounded-full'), children: _jsx(SidebarIcon, {}) }))] })] })] }), tabs.length > 0 && (_jsx(LayoutTabs, { className: cn('border-b h-10 max-lg:hidden', navMode === 'top' ? 'px-4' : 'px-6'), options: tabs }))] }));
|
|
78
77
|
}
|
|
79
78
|
function NavbarLinkItem({ item, ...props }) {
|
|
80
79
|
if (item.type === 'menu') {
|
package/dist/mdx.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
|
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const defaultMdxComponents: {
|
|
9
|
-
CodeBlockTab:
|
|
9
|
+
CodeBlockTab: typeof import("./components/tabs.unstyled.js").TabsContent;
|
|
10
10
|
CodeBlockTabs: typeof CodeBlockTabs;
|
|
11
11
|
CodeBlockTabsList: typeof CodeBlockTabsList;
|
|
12
12
|
CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
|
package/dist/style.css
CHANGED
|
@@ -455,9 +455,6 @@
|
|
|
455
455
|
.-ms-1\.5 {
|
|
456
456
|
margin-inline-start: calc(var(--spacing) * -1.5);
|
|
457
457
|
}
|
|
458
|
-
.ms-1\.5 {
|
|
459
|
-
margin-inline-start: calc(var(--spacing) * 1.5);
|
|
460
|
-
}
|
|
461
458
|
.ms-2 {
|
|
462
459
|
margin-inline-start: calc(var(--spacing) * 2);
|
|
463
460
|
}
|
|
@@ -1427,6 +1424,9 @@
|
|
|
1427
1424
|
.px-2 {
|
|
1428
1425
|
padding-inline: calc(var(--spacing) * 2);
|
|
1429
1426
|
}
|
|
1427
|
+
.px-2\.5 {
|
|
1428
|
+
padding-inline: calc(var(--spacing) * 2.5);
|
|
1429
|
+
}
|
|
1430
1430
|
.px-3 {
|
|
1431
1431
|
padding-inline: calc(var(--spacing) * 3);
|
|
1432
1432
|
}
|
|
@@ -2351,6 +2351,16 @@
|
|
|
2351
2351
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
|
+
.md\:gap-2 {
|
|
2355
|
+
@media (width >= 48rem) {
|
|
2356
|
+
gap: calc(var(--spacing) * 2);
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
.md\:px-4 {
|
|
2360
|
+
@media (width >= 48rem) {
|
|
2361
|
+
padding-inline: calc(var(--spacing) * 4);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2354
2364
|
.md\:px-6 {
|
|
2355
2365
|
@media (width >= 48rem) {
|
|
2356
2366
|
padding-inline: calc(var(--spacing) * 6);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.6.
|
|
3
|
+
"version": "15.6.11",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -24,9 +24,41 @@
|
|
|
24
24
|
"import": "./dist/i18n.js",
|
|
25
25
|
"types": "./dist/i18n.d.ts"
|
|
26
26
|
},
|
|
27
|
-
"./layouts
|
|
28
|
-
"import": "./dist/layouts
|
|
29
|
-
"types": "./dist/layouts
|
|
27
|
+
"./layouts/home": {
|
|
28
|
+
"import": "./dist/layouts/home/index.js",
|
|
29
|
+
"types": "./dist/layouts/home/index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./layouts/home/*": {
|
|
32
|
+
"import": "./dist/layouts/home/*.js",
|
|
33
|
+
"types": "./dist/layouts/home/*.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./layouts/docs": {
|
|
36
|
+
"import": "./dist/layouts/docs/index.js",
|
|
37
|
+
"types": "./dist/layouts/docs/index.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./layouts/docs/page": {
|
|
40
|
+
"import": "./dist/layouts/docs/page.js",
|
|
41
|
+
"types": "./dist/layouts/docs/page.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./layouts/docs-client": {
|
|
44
|
+
"import": "./dist/layouts/docs/client.js",
|
|
45
|
+
"types": "./dist/layouts/docs/client.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./layouts/notebook": {
|
|
48
|
+
"import": "./dist/layouts/notebook/index.js",
|
|
49
|
+
"types": "./dist/layouts/notebook/index.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./layouts/notebook-client": {
|
|
52
|
+
"import": "./dist/layouts/notebook/client.js",
|
|
53
|
+
"types": "./dist/layouts/notebook/client.d.ts"
|
|
54
|
+
},
|
|
55
|
+
"./layouts/links": {
|
|
56
|
+
"import": "./dist/layouts/links.js",
|
|
57
|
+
"types": "./dist/layouts/links.d.ts"
|
|
58
|
+
},
|
|
59
|
+
"./layouts/shared": {
|
|
60
|
+
"import": "./dist/layouts/shared.js",
|
|
61
|
+
"types": "./dist/layouts/shared.d.ts"
|
|
30
62
|
},
|
|
31
63
|
"./page": {
|
|
32
64
|
"node": "./dist/page.server.js",
|
|
@@ -89,21 +121,21 @@
|
|
|
89
121
|
"react-medium-image-zoom": "^5.3.0",
|
|
90
122
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
91
123
|
"tailwind-merge": "^3.3.1",
|
|
92
|
-
"fumadocs-core": "15.6.
|
|
124
|
+
"fumadocs-core": "15.6.11"
|
|
93
125
|
},
|
|
94
126
|
"devDependencies": {
|
|
95
|
-
"@next/eslint-plugin-next": "^15.4.
|
|
127
|
+
"@next/eslint-plugin-next": "^15.4.6",
|
|
96
128
|
"@tailwindcss/cli": "^4.1.11",
|
|
97
129
|
"@types/lodash.merge": "^4.6.9",
|
|
98
|
-
"@types/react": "^19.1.
|
|
130
|
+
"@types/react": "^19.1.10",
|
|
99
131
|
"@types/react-dom": "^19.1.7",
|
|
100
|
-
"next": "15.4.
|
|
132
|
+
"next": "15.4.6",
|
|
101
133
|
"tailwindcss": "^4.1.11",
|
|
102
134
|
"tsc-alias": "^1.8.16",
|
|
103
|
-
"@fumadocs/cli": "0.
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
135
|
+
"@fumadocs/cli": "1.0.0",
|
|
136
|
+
"eslint-config-custom": "0.0.0",
|
|
137
|
+
"fumadocs-core": "15.6.11",
|
|
138
|
+
"tsconfig": "0.0.0"
|
|
107
139
|
},
|
|
108
140
|
"peerDependencies": {
|
|
109
141
|
"@types/react": "*",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,kBAAkB,4CA2BjC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAIf,OAAO,EAQL,cAAc,EAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAA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ED,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,GAAG,cAAc,CAAC,WAAW,CAAC,2CAmCrD;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAQ,EACR,IAAY,EACZ,KAAK,EACL,SAAS,EACT,WAAgB,EAChB,YAAiB,GAClB,EAAE,eAAe,2CAmGjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notebook-client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAQrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,2CAoBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAkB1B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,2CA+BA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AA6BlE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE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