fumadocs-core 15.7.3 → 15.7.5
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/breadcrumb.js +27 -22
- package/dist/{chunk-7GNSIKII.js → chunk-BDG7Y4PS.js} +30 -1
- package/dist/chunk-PFNP6PEB.js +11 -0
- package/dist/mdx-plugins/index.js +5 -6
- package/dist/search/server.js +1 -1
- package/dist/source/index.js +10 -8
- package/package.json +10 -10
- package/dist/chunk-3JSIVMCJ.js +0 -33
package/dist/breadcrumb.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeUrl
|
|
3
|
+
} from "./chunk-PFNP6PEB.js";
|
|
1
4
|
import "./chunk-JSBRDJBE.js";
|
|
2
5
|
|
|
3
6
|
// src/breadcrumb.tsx
|
|
@@ -52,32 +55,34 @@ function getBreadcrumbItemsFromPath(tree, path, options) {
|
|
|
52
55
|
return items;
|
|
53
56
|
}
|
|
54
57
|
function searchPath(nodes, url) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (node.
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
const items = [];
|
|
59
|
+
url = normalizeUrl(url);
|
|
60
|
+
function run(nodes2) {
|
|
61
|
+
let separator;
|
|
62
|
+
for (const node of nodes2) {
|
|
63
|
+
if (node.type === "separator") separator = node;
|
|
64
|
+
if (node.type === "folder") {
|
|
65
|
+
if (node.index?.url === url) {
|
|
66
|
+
if (separator) items.push(separator);
|
|
67
|
+
items.push(node, node.index);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
if (run(node.children)) {
|
|
71
|
+
items.unshift(node);
|
|
72
|
+
if (separator) items.unshift(separator);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
items.
|
|
69
|
-
|
|
70
|
-
return items;
|
|
76
|
+
if (node.type === "page" && node.url === url) {
|
|
77
|
+
if (separator) items.push(separator);
|
|
78
|
+
items.push(node);
|
|
79
|
+
return true;
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
|
-
|
|
74
|
-
const items = [];
|
|
75
|
-
if (separator) items.push(separator);
|
|
76
|
-
items.push(node);
|
|
77
|
-
return items;
|
|
78
|
-
}
|
|
82
|
+
return false;
|
|
79
83
|
}
|
|
80
|
-
|
|
84
|
+
run(nodes);
|
|
85
|
+
return items;
|
|
81
86
|
}
|
|
82
87
|
export {
|
|
83
88
|
getBreadcrumbItems,
|
|
@@ -37,11 +37,40 @@ function parseFolderPath(path) {
|
|
|
37
37
|
path
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
+
function splitPath(path) {
|
|
41
|
+
return path.split("/").filter((p) => p.length > 0);
|
|
42
|
+
}
|
|
43
|
+
function joinPath(...paths) {
|
|
44
|
+
const out = [];
|
|
45
|
+
const parsed = paths.flatMap(splitPath);
|
|
46
|
+
for (const seg of parsed) {
|
|
47
|
+
switch (seg) {
|
|
48
|
+
case "..":
|
|
49
|
+
out.pop();
|
|
50
|
+
break;
|
|
51
|
+
case ".":
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
out.push(seg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return out.join("/");
|
|
58
|
+
}
|
|
59
|
+
function slash(path) {
|
|
60
|
+
const isExtendedLengthPath = path.startsWith("\\\\?\\");
|
|
61
|
+
if (isExtendedLengthPath) {
|
|
62
|
+
return path;
|
|
63
|
+
}
|
|
64
|
+
return path.replaceAll("\\", "/");
|
|
65
|
+
}
|
|
40
66
|
|
|
41
67
|
export {
|
|
42
68
|
basename,
|
|
43
69
|
extname,
|
|
44
70
|
dirname,
|
|
45
71
|
parseFilePath,
|
|
46
|
-
parseFolderPath
|
|
72
|
+
parseFolderPath,
|
|
73
|
+
splitPath,
|
|
74
|
+
joinPath,
|
|
75
|
+
slash
|
|
47
76
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/utils/normalize-url.tsx
|
|
2
|
+
function normalizeUrl(url) {
|
|
3
|
+
if (url.startsWith("http://") || url.startsWith("https://")) return url;
|
|
4
|
+
if (!url.startsWith("/")) url = "/" + url;
|
|
5
|
+
if (url.length > 1 && url.endsWith("/")) url = url.slice(0, -1);
|
|
6
|
+
return url;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
normalizeUrl
|
|
11
|
+
};
|
|
@@ -2,10 +2,6 @@ import {
|
|
|
2
2
|
flattenNode,
|
|
3
3
|
remarkHeading
|
|
4
4
|
} from "../chunk-QMATWJ5F.js";
|
|
5
|
-
import {
|
|
6
|
-
joinPath,
|
|
7
|
-
slash
|
|
8
|
-
} from "../chunk-3JSIVMCJ.js";
|
|
9
5
|
import {
|
|
10
6
|
defaultThemes,
|
|
11
7
|
getHighlighter
|
|
@@ -520,7 +516,7 @@ function remarkImage({
|
|
|
520
516
|
};
|
|
521
517
|
}
|
|
522
518
|
function getImportPath(file, dir) {
|
|
523
|
-
const relative2 =
|
|
519
|
+
const relative2 = path.relative(dir, file).replaceAll(path.sep, "/");
|
|
524
520
|
return relative2.startsWith("../") ? relative2 : `./${relative2}`;
|
|
525
521
|
}
|
|
526
522
|
function parseSrc(src, publicDir, dir) {
|
|
@@ -535,7 +531,10 @@ function parseSrc(src, publicDir, dir) {
|
|
|
535
531
|
if (src.startsWith("/")) {
|
|
536
532
|
if (EXTERNAL_URL_REGEX.test(publicDir)) {
|
|
537
533
|
const url = new URL(publicDir);
|
|
538
|
-
|
|
534
|
+
const segs = [...url.pathname.split("/"), ...src.split("/")].filter(
|
|
535
|
+
(v) => v.length > 0
|
|
536
|
+
);
|
|
537
|
+
url.pathname = `/${segs.join("/")}`;
|
|
539
538
|
return { type: "url", url };
|
|
540
539
|
}
|
|
541
540
|
return {
|
package/dist/search/server.js
CHANGED
package/dist/source/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
joinPath,
|
|
3
|
-
slash,
|
|
4
|
-
splitPath
|
|
5
|
-
} from "../chunk-3JSIVMCJ.js";
|
|
6
1
|
import {
|
|
7
2
|
basename,
|
|
8
3
|
dirname,
|
|
9
4
|
extname,
|
|
5
|
+
joinPath,
|
|
10
6
|
parseFilePath,
|
|
11
|
-
parseFolderPath
|
|
12
|
-
|
|
7
|
+
parseFolderPath,
|
|
8
|
+
slash,
|
|
9
|
+
splitPath
|
|
10
|
+
} from "../chunk-BDG7Y4PS.js";
|
|
11
|
+
import {
|
|
12
|
+
normalizeUrl
|
|
13
|
+
} from "../chunk-PFNP6PEB.js";
|
|
13
14
|
import "../chunk-JSBRDJBE.js";
|
|
14
15
|
|
|
15
16
|
// src/source/page-tree/legacy.ts
|
|
@@ -504,9 +505,10 @@ function createOutput(options) {
|
|
|
504
505
|
baseUrl = "/",
|
|
505
506
|
i18n,
|
|
506
507
|
slugs: slugsFn,
|
|
507
|
-
url:
|
|
508
|
+
url: urlFn,
|
|
508
509
|
transformers = []
|
|
509
510
|
} = options;
|
|
511
|
+
const getUrl = urlFn ? (...args) => normalizeUrl(urlFn(...args)) : createGetUrl(baseUrl, i18n);
|
|
510
512
|
const defaultLanguage = i18n?.defaultLanguage ?? "";
|
|
511
513
|
const files = loadSource(source);
|
|
512
514
|
const transformerSlugs = ({ storage }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "15.7.
|
|
3
|
+
"version": "15.7.5",
|
|
4
4
|
"description": "The library for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@formatjs/intl-localematcher": "^0.6.1",
|
|
94
94
|
"@orama/orama": "^3.1.11",
|
|
95
|
-
"@shikijs/rehype": "^3.
|
|
96
|
-
"@shikijs/transformers": "^3.
|
|
95
|
+
"@shikijs/rehype": "^3.12.0",
|
|
96
|
+
"@shikijs/transformers": "^3.12.0",
|
|
97
97
|
"github-slugger": "^2.0.0",
|
|
98
98
|
"hast-util-to-estree": "^3.1.3",
|
|
99
99
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
@@ -105,32 +105,32 @@
|
|
|
105
105
|
"remark-gfm": "^4.0.1",
|
|
106
106
|
"remark-rehype": "^11.1.2",
|
|
107
107
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
108
|
-
"shiki": "^3.
|
|
108
|
+
"shiki": "^3.12.0",
|
|
109
109
|
"unist-util-visit": "^5.0.0"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@mdx-js/mdx": "^3.1.0",
|
|
113
113
|
"@mixedbread/sdk": "^0.26.0",
|
|
114
114
|
"@oramacloud/client": "^2.1.4",
|
|
115
|
-
"@tanstack/react-router": "^1.131.
|
|
115
|
+
"@tanstack/react-router": "^1.131.28",
|
|
116
116
|
"@types/estree-jsx": "^1.0.5",
|
|
117
117
|
"@types/hast": "^3.0.4",
|
|
118
118
|
"@types/mdast": "^4.0.3",
|
|
119
119
|
"@types/negotiator": "^0.6.4",
|
|
120
120
|
"@types/node": "24.3.0",
|
|
121
|
-
"@types/react": "^19.1.
|
|
122
|
-
"@types/react-dom": "^19.1.
|
|
123
|
-
"algoliasearch": "5.
|
|
121
|
+
"@types/react": "^19.1.12",
|
|
122
|
+
"@types/react-dom": "^19.1.8",
|
|
123
|
+
"algoliasearch": "5.36.0",
|
|
124
124
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
125
125
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
126
|
-
"next": "^15.5.
|
|
126
|
+
"next": "^15.5.2",
|
|
127
127
|
"react-router": "^7.8.2",
|
|
128
128
|
"remark-mdx": "^3.1.0",
|
|
129
129
|
"remove-markdown": "^0.6.2",
|
|
130
130
|
"typescript": "^5.9.2",
|
|
131
131
|
"unified": "^11.0.5",
|
|
132
132
|
"vfile": "^6.0.3",
|
|
133
|
-
"waku": "^0.
|
|
133
|
+
"waku": "^0.26.0",
|
|
134
134
|
"eslint-config-custom": "0.0.0",
|
|
135
135
|
"tsconfig": "0.0.0"
|
|
136
136
|
},
|
package/dist/chunk-3JSIVMCJ.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// src/utils/path.ts
|
|
2
|
-
function splitPath(path) {
|
|
3
|
-
return path.split("/").filter((p) => p.length > 0);
|
|
4
|
-
}
|
|
5
|
-
function joinPath(...paths) {
|
|
6
|
-
const out = [];
|
|
7
|
-
const parsed = paths.flatMap(splitPath);
|
|
8
|
-
for (const seg of parsed) {
|
|
9
|
-
switch (seg) {
|
|
10
|
-
case "..":
|
|
11
|
-
out.pop();
|
|
12
|
-
break;
|
|
13
|
-
case ".":
|
|
14
|
-
break;
|
|
15
|
-
default:
|
|
16
|
-
out.push(seg);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return out.join("/");
|
|
20
|
-
}
|
|
21
|
-
function slash(path) {
|
|
22
|
-
const isExtendedLengthPath = path.startsWith("\\\\?\\");
|
|
23
|
-
if (isExtendedLengthPath) {
|
|
24
|
-
return path;
|
|
25
|
-
}
|
|
26
|
-
return path.replaceAll("\\", "/");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
splitPath,
|
|
31
|
-
joinPath,
|
|
32
|
-
slash
|
|
33
|
-
};
|