fumadocs-ui 15.0.18 → 15.1.0
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.server.d.ts.map +1 -1
- package/dist/mdx.server.js +5 -9
- package/dist/page.client.d.ts +5 -8
- package/dist/page.client.d.ts.map +1 -1
- package/dist/page.client.js +10 -5
- package/dist/style.css +3 -6
- package/package.json +4 -4
package/dist/mdx.server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.server.d.ts","sourceRoot":"","sources":["../src/mdx.server.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,oBAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx.server.d.ts","sourceRoot":"","sources":["../src/mdx.server.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,oBAAoB,MAAM,OAAO,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,CAAC,YAAY,CAAC,EAClC,IAAI,EAAE,IAAI,EACV,YAAY,GAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAA0B,GAC7D,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAUzB;AAED,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/mdx.server.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import defaultMdxComponents from './mdx.js';
|
|
3
|
-
import * as path from 'node:path';
|
|
4
3
|
/**
|
|
5
4
|
* Extend the default Link component to resolve relative file paths in `href`.
|
|
6
5
|
*
|
|
@@ -10,14 +9,11 @@ import * as path from 'node:path';
|
|
|
10
9
|
*/
|
|
11
10
|
export function createRelativeLink(source, page, OverrideLink = defaultMdxComponents.a) {
|
|
12
11
|
return async function RelativeLink({ href, ...props }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(href
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const targetPage = pages.find((item) => item.file.path === hrefPath);
|
|
19
|
-
if (targetPage)
|
|
20
|
-
href = targetPage.url;
|
|
12
|
+
// resolve relative href
|
|
13
|
+
if (href && href.startsWith('.')) {
|
|
14
|
+
const target = source.getPageByHref(href, { dir: page.file.dirname });
|
|
15
|
+
if (target)
|
|
16
|
+
href = target.page.url;
|
|
21
17
|
}
|
|
22
18
|
return _jsx(OverrideLink, { href: href, ...props });
|
|
23
19
|
};
|
package/dist/page.client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { PageTree } from 'fumadocs-core/server';
|
|
2
3
|
import { type BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
|
|
3
4
|
export declare function TocPopoverHeader(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
5
|
export declare function PageBody(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,22 +7,18 @@ export declare function PageArticle(props: HTMLAttributes<HTMLElement>): import(
|
|
|
6
7
|
export declare function LastUpdate(props: {
|
|
7
8
|
date: Date;
|
|
8
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
|
|
9
11
|
export interface FooterProps {
|
|
10
12
|
/**
|
|
11
13
|
* Items including information for the next and previous page
|
|
12
14
|
*/
|
|
13
15
|
items?: {
|
|
14
|
-
previous?:
|
|
15
|
-
|
|
16
|
-
url: string;
|
|
17
|
-
};
|
|
18
|
-
next?: {
|
|
19
|
-
name: string;
|
|
20
|
-
url: string;
|
|
21
|
-
};
|
|
16
|
+
previous?: Item;
|
|
17
|
+
next?: Item;
|
|
22
18
|
};
|
|
23
19
|
}
|
|
24
20
|
export declare function Footer({ items }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
25
21
|
export type BreadcrumbProps = BreadcrumbOptions;
|
|
26
22
|
export declare function Breadcrumb(options: BreadcrumbProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
export {};
|
|
27
24
|
//# sourceMappingURL=page.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.client.d.ts","sourceRoot":"","sources":["../src/page.client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"page.client.d.ts","sourceRoot":"","sources":["../src/page.client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAMlC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CA8CrE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAY7D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAe7D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,2CAc/C;AAED,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC;AAChE,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,IAAI,CAAC;KACb,CAAC;CACH;AAyBD,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,WAAW,2CA+B5C;AAuCD,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,kDAsClD"}
|
package/dist/page.client.js
CHANGED
|
@@ -3,7 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Fragment, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
4
|
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
-
import { cva } from 'class-variance-authority';
|
|
7
6
|
import { cn } from './utils/cn.js';
|
|
8
7
|
import { useI18n } from './contexts/i18n.js';
|
|
9
8
|
import { useTreeContext, useTreePath } from './contexts/tree.js';
|
|
@@ -54,8 +53,6 @@ export function LastUpdate(props) {
|
|
|
54
53
|
}, [props.date]);
|
|
55
54
|
return (_jsxs("p", { className: "text-sm text-fd-muted-foreground", children: [text.lastUpdate, " ", date] }));
|
|
56
55
|
}
|
|
57
|
-
const itemVariants = cva('flex w-full flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground');
|
|
58
|
-
const itemLabel = cva('inline-flex items-center gap-0.5 text-fd-muted-foreground');
|
|
59
56
|
function scanNavigationList(tree) {
|
|
60
57
|
const list = [];
|
|
61
58
|
tree.forEach((node) => {
|
|
@@ -75,7 +72,6 @@ function scanNavigationList(tree) {
|
|
|
75
72
|
const listCache = new WeakMap();
|
|
76
73
|
export function Footer({ items }) {
|
|
77
74
|
const { root } = useTreeContext();
|
|
78
|
-
const { text } = useI18n();
|
|
79
75
|
const pathname = usePathname();
|
|
80
76
|
const { previous, next } = useMemo(() => {
|
|
81
77
|
if (items)
|
|
@@ -91,7 +87,16 @@ export function Footer({ items }) {
|
|
|
91
87
|
next: list[idx + 1],
|
|
92
88
|
};
|
|
93
89
|
}, [items, pathname, root]);
|
|
94
|
-
return (_jsxs("div", { className:
|
|
90
|
+
return (_jsxs("div", { className: cn('@container grid gap-4 pb-6', previous && next ? 'grid-cols-2' : 'grid-cols-1'), children: [previous ? _jsx(FooterItem, { item: previous, index: 0 }) : null, next ? _jsx(FooterItem, { item: next, index: 1 }) : null] }));
|
|
91
|
+
}
|
|
92
|
+
function FooterItem({ item, index }) {
|
|
93
|
+
const { text } = useI18n();
|
|
94
|
+
const Icon = index === 0 ? ChevronLeft : ChevronRight;
|
|
95
|
+
const title = item.description ? item.name : null;
|
|
96
|
+
const description = item.description ?? item.name;
|
|
97
|
+
return (_jsxs(Link, { href: item.url, className: cn('flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full', index === 1 && 'text-end'), children: [_jsxs("div", { className: cn('inline-flex items-center gap-1.5', index === 1 && 'flex-row-reverse', title ? 'font-medium' : 'text-fd-muted-foreground'), children: [_jsx(Icon, { className: "-mx-1 size-4 shrink-0 rtl:rotate-180" }), _jsx("p", { children: title ?? text.nextPage })] }), _jsx("p", { className: cn(title
|
|
98
|
+
? 'text-fd-muted-foreground truncate'
|
|
99
|
+
: 'font-medium md:text-[15px]'), children: description })] }));
|
|
95
100
|
}
|
|
96
101
|
export function Breadcrumb(options) {
|
|
97
102
|
const path = useTreePath();
|
package/dist/style.css
CHANGED
|
@@ -351,9 +351,6 @@
|
|
|
351
351
|
.z-\[2\] {
|
|
352
352
|
z-index: 2;
|
|
353
353
|
}
|
|
354
|
-
.col-start-2 {
|
|
355
|
-
grid-column-start: 2;
|
|
356
|
-
}
|
|
357
354
|
.container {
|
|
358
355
|
width: 100%;
|
|
359
356
|
@media (width >= 40rem) {
|
|
@@ -379,6 +376,9 @@
|
|
|
379
376
|
max-width: 1400px;
|
|
380
377
|
}
|
|
381
378
|
}
|
|
379
|
+
.-mx-1 {
|
|
380
|
+
margin-inline: calc(var(--spacing) * -1);
|
|
381
|
+
}
|
|
382
382
|
.-mx-2 {
|
|
383
383
|
margin-inline: calc(var(--spacing) * -2);
|
|
384
384
|
}
|
|
@@ -412,9 +412,6 @@
|
|
|
412
412
|
.ms-auto {
|
|
413
413
|
margin-inline-start: auto;
|
|
414
414
|
}
|
|
415
|
-
.-me-1 {
|
|
416
|
-
margin-inline-end: calc(var(--spacing) * -1);
|
|
417
|
-
}
|
|
418
415
|
.-me-1\.5 {
|
|
419
416
|
margin-inline-end: calc(var(--spacing) * -1.5);
|
|
420
417
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.0
|
|
3
|
+
"version": "15.1.0",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@radix-ui/react-tabs": "^1.1.3",
|
|
67
67
|
"class-variance-authority": "^0.7.1",
|
|
68
68
|
"lodash.merge": "^4.6.2",
|
|
69
|
-
"lucide-react": "^0.
|
|
69
|
+
"lucide-react": "^0.482.0",
|
|
70
70
|
"next-themes": "^0.4.6",
|
|
71
71
|
"postcss-selector-parser": "^7.1.0",
|
|
72
72
|
"react-medium-image-zoom": "^5.2.14",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"tsc-alias": "^1.8.11",
|
|
84
84
|
"@fumadocs/cli": "0.0.8",
|
|
85
85
|
"eslint-config-custom": "0.0.0",
|
|
86
|
-
"fumadocs-core": "15.0
|
|
86
|
+
"fumadocs-core": "15.1.0",
|
|
87
87
|
"tsconfig": "0.0.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"react": "18.x.x || 19.x.x",
|
|
92
92
|
"react-dom": "18.x.x || 19.x.x",
|
|
93
93
|
"tailwindcss": "^3.4.14 || ^4.0.0",
|
|
94
|
-
"fumadocs-core": "15.0
|
|
94
|
+
"fumadocs-core": "15.1.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependenciesMeta": {
|
|
97
97
|
"tailwindcss": {
|