fumadocs-ui 15.2.5 → 15.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mdx.js +1 -1
- package/dist/page.d.ts +1 -7
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +0 -46
- package/dist/page.server.d.ts +13 -0
- package/dist/page.server.d.ts.map +1 -0
- package/dist/page.server.js +36 -0
- package/dist/provider/base.js +3 -3
- package/package.json +6 -5
package/dist/mdx.js
CHANGED
|
@@ -10,7 +10,7 @@ function Image(props) {
|
|
|
10
10
|
return (_jsx(FrameworkImage, { sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px", ...props, className: cn('rounded-lg', props.className) }));
|
|
11
11
|
}
|
|
12
12
|
function Table(props) {
|
|
13
|
-
return (_jsx("div", { className: "relative overflow-auto", children: _jsx("table", { ...props }) }));
|
|
13
|
+
return (_jsx("div", { className: "relative overflow-auto prose-no-margin my-6", children: _jsx("table", { ...props }) }));
|
|
14
14
|
}
|
|
15
15
|
const defaultMdxComponents = {
|
|
16
16
|
pre: (props) => (_jsx(CodeBlock, { ...props, children: _jsx(Pre, { children: props.children }) })),
|
package/dist/page.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { TableOfContents } from 'fumadocs-core/server';
|
|
2
2
|
import { type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
|
-
import type { LoaderConfig, LoaderOutput, Page } from 'fumadocs-core/source';
|
|
4
3
|
import { type AnchorProviderProps } from 'fumadocs-core/toc';
|
|
5
4
|
import { type FooterProps, type BreadcrumbProps } from './page-client.js';
|
|
6
5
|
import { type TOCProps } from './components/layout/toc.js';
|
|
@@ -73,11 +72,6 @@ export declare function DocsPage({ toc, full, tableOfContentPopover: { enabled:
|
|
|
73
72
|
export declare const DocsBody: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
74
73
|
export declare const DocsDescription: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
75
74
|
export declare const DocsTitle: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
76
|
-
export declare function DocsCategory({ page, from, tree: forcedTree, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
77
|
-
page: Page;
|
|
78
|
-
from: LoaderOutput<LoaderConfig>;
|
|
79
|
-
tree?: PageTree.Root;
|
|
80
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
81
75
|
/**
|
|
82
76
|
* For separate MDX page
|
|
83
77
|
*/
|
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,
|
|
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,EAEzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,eAAe,EAGrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,yBAAyB,CAAC;AAMjC,KAAK,qBAAqB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,CAAC,GAC/D,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,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ACrB;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAQ,EACR,IAAY,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,2CAkGf;AA+BD;;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,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, } from 'react';
|
|
3
3
|
import { AnchorProvider } from 'fumadocs-core/toc';
|
|
4
|
-
import { Card, Cards } from './components/card.js';
|
|
5
4
|
import { replaceOrDefault } from './layouts/shared.js';
|
|
6
5
|
import { cn } from './utils/cn.js';
|
|
7
6
|
import { Footer, LastUpdate, TocPopoverHeader, Breadcrumb, PageBody, PageArticle, } from './page-client.js';
|
|
@@ -53,51 +52,6 @@ export const DocsTitle = forwardRef((props, ref) => {
|
|
|
53
52
|
return (_jsx("h1", { ref: ref, ...props, className: cn('text-3xl font-semibold', props.className), children: props.children }));
|
|
54
53
|
});
|
|
55
54
|
DocsTitle.displayName = 'DocsTitle';
|
|
56
|
-
export function DocsCategory({ page, from, tree: forcedTree, ...props }) {
|
|
57
|
-
let tree;
|
|
58
|
-
if (forcedTree) {
|
|
59
|
-
tree = forcedTree;
|
|
60
|
-
}
|
|
61
|
-
else if (from._i18n) {
|
|
62
|
-
const locale = page.locale ?? from._i18n.defaultLanguage;
|
|
63
|
-
tree = from.pageTree[locale];
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
tree = from.pageTree;
|
|
67
|
-
}
|
|
68
|
-
function findParentFromTree(node, page) {
|
|
69
|
-
if ('index' in node && node.index?.$ref?.file === page.file.path) {
|
|
70
|
-
return node;
|
|
71
|
-
}
|
|
72
|
-
for (const child of node.children) {
|
|
73
|
-
if (child.type === 'folder') {
|
|
74
|
-
const parent = findParentFromTree(child, page);
|
|
75
|
-
if (parent)
|
|
76
|
-
return parent;
|
|
77
|
-
}
|
|
78
|
-
if (child.type === 'page' && child.$ref?.file === page.file.path) {
|
|
79
|
-
return node;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
let items;
|
|
84
|
-
const parent = findParentFromTree(tree, page);
|
|
85
|
-
if (parent) {
|
|
86
|
-
items = parent.children.flatMap((item) => {
|
|
87
|
-
if (item.type !== 'page' || item.url === page.url)
|
|
88
|
-
return [];
|
|
89
|
-
return from.getNodePage(item) ?? [];
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
const pages = from.getPages(page.locale);
|
|
94
|
-
items = pages.filter((item) => item.file.dirname === page.file.dirname &&
|
|
95
|
-
item.file.path !== page.file.path);
|
|
96
|
-
}
|
|
97
|
-
if (items.length === 0)
|
|
98
|
-
return null;
|
|
99
|
-
return (_jsx(Cards, { ...props, children: items.map((item) => (_jsx(Card, { title: item.data.title, description: item.data.description, href: item.url }, item.url))) }));
|
|
100
|
-
}
|
|
101
55
|
/**
|
|
102
56
|
* For separate MDX page
|
|
103
57
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { LoaderConfig, LoaderOutput, Page } from 'fumadocs-core/source';
|
|
3
|
+
import { type PageTree } from 'fumadocs-core/server';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use https://fumadocs.vercel.app/docs/ui/markdown#further-reading-section instead
|
|
6
|
+
*/
|
|
7
|
+
export declare function DocsCategory({ page, from, tree: forcedTree, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
page: Page;
|
|
9
|
+
from: LoaderOutput<LoaderConfig>;
|
|
10
|
+
tree?: PageTree.Root;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export * from './page.js';
|
|
13
|
+
//# sourceMappingURL=page.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.server.d.ts","sourceRoot":"","sources":["../src/page.server.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGvE;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,IAAI,EACJ,IAAI,EAAE,UAAU,EAChB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;CACtB,kDA+CA;AAED,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getPageTreePeers } from 'fumadocs-core/server';
|
|
3
|
+
import { Card, Cards } from './components/card.js';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use https://fumadocs.vercel.app/docs/ui/markdown#further-reading-section instead
|
|
6
|
+
*/
|
|
7
|
+
export function DocsCategory({ page, from, tree: forcedTree, ...props }) {
|
|
8
|
+
let tree;
|
|
9
|
+
if (forcedTree) {
|
|
10
|
+
tree = forcedTree;
|
|
11
|
+
}
|
|
12
|
+
else if (from._i18n) {
|
|
13
|
+
const locale = page.locale ?? from._i18n.defaultLanguage;
|
|
14
|
+
tree = from.pageTree[locale];
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
tree = from.pageTree;
|
|
18
|
+
}
|
|
19
|
+
let items = getPageTreePeers(tree, page.url);
|
|
20
|
+
if (items.length === 0) {
|
|
21
|
+
const pages = from.getPages(page.locale);
|
|
22
|
+
items = pages
|
|
23
|
+
.filter((item) => item.file.dirname === page.file.dirname &&
|
|
24
|
+
item.file.path !== page.file.path)
|
|
25
|
+
.map((page) => ({
|
|
26
|
+
type: 'page',
|
|
27
|
+
name: page.data.title,
|
|
28
|
+
description: page.data.description,
|
|
29
|
+
url: page.url,
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
if (items.length === 0)
|
|
33
|
+
return null;
|
|
34
|
+
return (_jsx(Cards, { ...props, children: items.map((item) => (_jsx(Card, { title: item.name, description: item.description, href: item.url }, item.url))) }));
|
|
35
|
+
}
|
|
36
|
+
export * from './page.js';
|
package/dist/provider/base.js
CHANGED
|
@@ -11,13 +11,13 @@ import { usePathname, useRouter } from 'fumadocs-core/framework';
|
|
|
11
11
|
const DefaultSearchDialog = lazy(() => import('../components/dialog/search-default.js'));
|
|
12
12
|
export function RootProvider({ children, dir = 'ltr', theme = {}, search, i18n, }) {
|
|
13
13
|
let body = children;
|
|
14
|
-
if (i18n) {
|
|
15
|
-
body = _jsx(I18nProvider, { ...i18n, children: body });
|
|
16
|
-
}
|
|
17
14
|
if (search?.enabled !== false)
|
|
18
15
|
body = (_jsx(SearchProvider, { SearchDialog: DefaultSearchDialog, ...search, children: body }));
|
|
19
16
|
if (theme?.enabled !== false)
|
|
20
17
|
body = (_jsx(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, disableTransitionOnChange: true, ...theme, children: body }));
|
|
18
|
+
if (i18n) {
|
|
19
|
+
body = _jsx(I18nProvider, { ...i18n, children: body });
|
|
20
|
+
}
|
|
21
21
|
return (_jsx(DirectionProvider, { dir: dir, children: _jsx(SidebarProvider, { children: body }) }));
|
|
22
22
|
}
|
|
23
23
|
function I18nProvider({ locales = [], locale, onLocaleChange, ...props }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.6",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
"types": "./dist/layouts/*.d.ts"
|
|
30
30
|
},
|
|
31
31
|
"./page": {
|
|
32
|
+
"node": "./dist/page.server.js",
|
|
32
33
|
"import": "./dist/page.js",
|
|
33
|
-
"types": "./dist/page.d.ts"
|
|
34
|
+
"types": "./dist/page.server.d.ts"
|
|
34
35
|
},
|
|
35
36
|
"./provider": {
|
|
36
37
|
"import": "./dist/provider/index.js",
|
|
@@ -82,8 +83,8 @@
|
|
|
82
83
|
"next-themes": "^0.4.6",
|
|
83
84
|
"postcss-selector-parser": "^7.1.0",
|
|
84
85
|
"react-medium-image-zoom": "^5.2.14",
|
|
85
|
-
"tailwind-merge": "^3.
|
|
86
|
-
"fumadocs-core": "15.2.
|
|
86
|
+
"tailwind-merge": "^3.2.0",
|
|
87
|
+
"fumadocs-core": "15.2.6"
|
|
87
88
|
},
|
|
88
89
|
"devDependencies": {
|
|
89
90
|
"@next/eslint-plugin-next": "^15.2.4",
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
"tsc-alias": "^1.8.13",
|
|
97
98
|
"@fumadocs/cli": "0.1.1",
|
|
98
99
|
"eslint-config-custom": "0.0.0",
|
|
99
|
-
"fumadocs-core": "15.2.
|
|
100
|
+
"fumadocs-core": "15.2.6",
|
|
100
101
|
"tsconfig": "0.0.0"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|