fumadocs-core 16.4.8 → 16.4.9
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, FC, ReactNode } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
import { StaticImport } from "next/dist/shared/lib/get-img-props";
|
|
4
4
|
|
|
5
5
|
//#region src/framework/index.d.ts
|
|
@@ -39,11 +39,11 @@ declare function FrameworkProvider({
|
|
|
39
39
|
children
|
|
40
40
|
}: Framework & {
|
|
41
41
|
children: ReactNode;
|
|
42
|
-
}):
|
|
42
|
+
}): react_jsx_runtime6.JSX.Element;
|
|
43
43
|
declare function usePathname(): string;
|
|
44
44
|
declare function useRouter(): Router;
|
|
45
45
|
declare function useParams(): Record<string, string | string[]>;
|
|
46
|
-
declare function Image(props: ImageProps):
|
|
47
|
-
declare function Link(props: LinkProps):
|
|
46
|
+
declare function Image(props: ImageProps): react_jsx_runtime6.JSX.Element;
|
|
47
|
+
declare function Link(props: LinkProps): react_jsx_runtime6.JSX.Element;
|
|
48
48
|
//#endregion
|
|
49
49
|
export { Framework, FrameworkProvider, Image, ImageProps, Link, Router, useParams, usePathname, useRouter };
|
package/dist/framework/next.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Framework } from "./index.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/framework/next.d.ts
|
|
6
6
|
declare function NextProvider({
|
|
@@ -11,6 +11,6 @@ declare function NextProvider({
|
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
Link?: Framework['Link'];
|
|
13
13
|
Image?: Framework['Image'];
|
|
14
|
-
}):
|
|
14
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { NextProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Framework } from "./index.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/framework/react-router.d.ts
|
|
6
6
|
declare function ReactRouterProvider({
|
|
@@ -11,6 +11,6 @@ declare function ReactRouterProvider({
|
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
Link?: Framework['Link'];
|
|
13
13
|
Image?: Framework['Image'];
|
|
14
|
-
}):
|
|
14
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ReactRouterProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Framework } from "./index.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/framework/tanstack.d.ts
|
|
6
6
|
/**
|
|
@@ -14,6 +14,6 @@ declare function TanstackProvider({
|
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
Link?: Framework['Link'];
|
|
16
16
|
Image?: Framework['Image'];
|
|
17
|
-
}):
|
|
17
|
+
}): react_jsx_runtime3.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { TanstackProvider };
|
package/dist/framework/waku.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Framework } from "./index.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/framework/waku.d.ts
|
|
6
6
|
declare function WakuProvider({
|
|
@@ -11,6 +11,6 @@ declare function WakuProvider({
|
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
Link?: Framework['Link'];
|
|
13
13
|
Image?: Framework['Image'];
|
|
14
|
-
}):
|
|
14
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { WakuProvider };
|
package/dist/source/index.js
CHANGED
|
@@ -314,7 +314,10 @@ function createPageTreeBuilderUtils(ctx) {
|
|
|
314
314
|
if (existing.priority >= priority) return false;
|
|
315
315
|
const folder = pathToNode.get(existing.owner);
|
|
316
316
|
if (folder && folder.type === "folder") if (folder.index === node) delete folder.index;
|
|
317
|
-
else
|
|
317
|
+
else {
|
|
318
|
+
const idx = folder.children.indexOf(node);
|
|
319
|
+
if (idx !== -1) folder.children.splice(idx, 1);
|
|
320
|
+
}
|
|
318
321
|
existing.owner = ownerPath;
|
|
319
322
|
existing.priority = priority;
|
|
320
323
|
return true;
|
|
@@ -327,11 +330,12 @@ function createPageTreeBuilderUtils(ctx) {
|
|
|
327
330
|
return `${ctx.rootId}:${localId}`;
|
|
328
331
|
}
|
|
329
332
|
return {
|
|
330
|
-
buildPaths(paths, reversed = false) {
|
|
333
|
+
buildPaths(paths, filter, reversed = false) {
|
|
331
334
|
const items = [];
|
|
332
335
|
const folders = [];
|
|
333
|
-
const sortedPaths = paths.sort((a, b) =>
|
|
336
|
+
const sortedPaths = paths.sort((a, b) => reversed ? b.localeCompare(a) : a.localeCompare(b));
|
|
334
337
|
for (const path$1 of sortedPaths) {
|
|
338
|
+
if (filter && !filter(path$1)) continue;
|
|
335
339
|
const fileNode = this.file(path$1);
|
|
336
340
|
if (fileNode) {
|
|
337
341
|
if (basename(path$1, extname(path$1)) === "index") items.unshift(fileNode);
|
|
@@ -383,7 +387,9 @@ function createPageTreeBuilderUtils(ctx) {
|
|
|
383
387
|
return;
|
|
384
388
|
}
|
|
385
389
|
if (item.startsWith(excludePrefix)) {
|
|
386
|
-
|
|
390
|
+
const path$2 = joinPath(folderPath, item.slice(1));
|
|
391
|
+
excludedPaths.add(path$2);
|
|
392
|
+
excludedPaths.add(resolveFlattenPath(path$2, "page"));
|
|
387
393
|
return;
|
|
388
394
|
}
|
|
389
395
|
if (item.startsWith(extractPrefix)) {
|
|
@@ -392,7 +398,7 @@ function createPageTreeBuilderUtils(ctx) {
|
|
|
392
398
|
if (!node$1) return;
|
|
393
399
|
excludedPaths.add(path$2);
|
|
394
400
|
if (registerOwner(folderPath, node$1, 2)) for (const child of node$1.children) {
|
|
395
|
-
transferOwner(folderPath,
|
|
401
|
+
transferOwner(folderPath, child);
|
|
396
402
|
outputArray.push(child);
|
|
397
403
|
}
|
|
398
404
|
else for (const child of node$1.children) if (registerOwner(folderPath, child, 2)) outputArray.push(child);
|
|
@@ -415,42 +421,43 @@ function createPageTreeBuilderUtils(ctx) {
|
|
|
415
421
|
let meta = ctx.storage.read(metaPath);
|
|
416
422
|
if (meta && meta.format !== "meta") meta = void 0;
|
|
417
423
|
const metadata = meta?.data ?? {};
|
|
418
|
-
let
|
|
419
|
-
|
|
424
|
+
let node = {
|
|
425
|
+
type: "folder",
|
|
426
|
+
name: null,
|
|
427
|
+
root: metadata.root,
|
|
428
|
+
defaultOpen: metadata.defaultOpen,
|
|
429
|
+
description: metadata.description,
|
|
430
|
+
collapsible: metadata.collapsible,
|
|
431
|
+
children: [],
|
|
432
|
+
$id: nextNodeId(folderPath),
|
|
433
|
+
$ref: !ctx.noRef && meta ? { metaFile: metaPath } : void 0
|
|
434
|
+
};
|
|
435
|
+
pathToNode.set(folderPath, node);
|
|
420
436
|
if (!(metadata.root ?? isGlobalRoot)) {
|
|
421
437
|
const file = this.file(indexPath);
|
|
422
|
-
if (file && registerOwner(folderPath, file, 0)) index = file;
|
|
438
|
+
if (file && registerOwner(folderPath, file, 0)) node.index = file;
|
|
423
439
|
}
|
|
424
440
|
if (metadata.pages) {
|
|
425
441
|
const outputArray = [];
|
|
426
442
|
const excludedPaths = /* @__PURE__ */ new Set();
|
|
427
443
|
for (const item of metadata.pages) this.resolveFolderItem(folderPath, item, outputArray, excludedPaths);
|
|
444
|
+
if (excludedPaths.has(indexPath)) delete node.index;
|
|
445
|
+
else if (node.index) excludedPaths.add(indexPath);
|
|
428
446
|
for (const item of outputArray) {
|
|
429
447
|
if (item !== rest && item !== restReversed) {
|
|
430
|
-
|
|
431
|
-
children.push(item);
|
|
448
|
+
node.children.push(item);
|
|
432
449
|
continue;
|
|
433
450
|
}
|
|
434
|
-
const resolvedItem = this.buildPaths(files
|
|
435
|
-
for (const child of resolvedItem) if (registerOwner(folderPath, child, 0)) children.push(child);
|
|
451
|
+
const resolvedItem = this.buildPaths(files, (file) => !excludedPaths.has(file), item === restReversed);
|
|
452
|
+
for (const child of resolvedItem) if (registerOwner(folderPath, child, 0)) node.children.push(child);
|
|
436
453
|
}
|
|
437
|
-
} else for (const item of this.buildPaths(files
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
icon: metadata.icon ?? index?.icon,
|
|
445
|
-
root: metadata.root,
|
|
446
|
-
defaultOpen: metadata.defaultOpen,
|
|
447
|
-
description: metadata.description,
|
|
448
|
-
collapsible: metadata.collapsible,
|
|
449
|
-
index,
|
|
450
|
-
children,
|
|
451
|
-
$id: nextNodeId(folderPath),
|
|
452
|
-
$ref: !ctx.noRef && meta ? { metaFile: metaPath } : void 0
|
|
453
|
-
};
|
|
454
|
+
} else for (const item of this.buildPaths(files, node.index ? (file) => file !== indexPath : void 0)) if (registerOwner(folderPath, item, 0)) node.children.push(item);
|
|
455
|
+
node.icon = metadata.icon ?? node.index?.icon;
|
|
456
|
+
node.name = metadata.title ?? node.index?.name;
|
|
457
|
+
if (!node.name) {
|
|
458
|
+
const folderName = basename(folderPath);
|
|
459
|
+
node.name = pathToName(group.exec(folderName)?.[1] ?? folderName);
|
|
460
|
+
}
|
|
454
461
|
for (const transformer of ctx.transformers) {
|
|
455
462
|
if (!transformer.folder) continue;
|
|
456
463
|
node = transformer.folder.call(ctx, node, folderPath, metaPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "16.4.
|
|
3
|
+
"version": "16.4.9",
|
|
4
4
|
"description": "The React.js library for building a documentation website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@mixedbread/sdk": "^0.50.1",
|
|
138
138
|
"@orama/core": "^1.2.16",
|
|
139
139
|
"@oramacloud/client": "^2.1.4",
|
|
140
|
-
"@tanstack/react-router": "1.
|
|
140
|
+
"@tanstack/react-router": "1.157.6",
|
|
141
141
|
"@types/estree-jsx": "^1.0.5",
|
|
142
142
|
"@types/hast": "^3.0.4",
|
|
143
143
|
"@types/mdast": "^4.0.4",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
151
151
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
152
152
|
"next": "16.1.4",
|
|
153
|
-
"react-router": "^7.
|
|
153
|
+
"react-router": "^7.13.0",
|
|
154
154
|
"remark-directive": "^4.0.0",
|
|
155
155
|
"remark-mdx": "^3.1.1",
|
|
156
156
|
"remove-markdown": "^0.6.3",
|