fumadocs-core 16.15.4 → 16.15.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.d.ts +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/{build-doc-CX-PNB-q.js → build-doc-4OvfjVN2.js} +1 -1
- package/dist/{definitions-D8-KI7Uy.d.ts → definitions-CFOhwE1k.d.ts} +8 -1
- package/dist/{dynamic-Dgf8t2t2.js → dynamic-CTsodhTH.js} +1 -1
- package/dist/{index-CdZGMKDG.d.ts → index-B-0R0VbS.d.ts} +2 -2
- package/dist/{index-19nHQs6M.d.ts → index-BL0I0wLZ.d.ts} +4 -4
- package/dist/{index-DZN5OrTa.d.ts → index-E8Qh_yQs.d.ts} +7 -2
- package/dist/page-tree/index.d.ts +3 -3
- package/dist/page-tree/index.js +2 -2
- package/dist/search/flexsearch.d.ts +2 -2
- package/dist/search/flexsearch.js +1 -1
- package/dist/search/mixedbread.d.ts +1 -1
- package/dist/search/server.d.ts +1 -1
- package/dist/search/server.js +1 -1
- package/dist/{server-C8FDQbVc.d.ts → server-k_q58LOn.d.ts} +1 -1
- package/dist/source/client/index.d.ts +1 -1
- package/dist/source/client/index.js +1 -1
- package/dist/source/dynamic.d.ts +1 -1
- package/dist/source/dynamic.js +1 -1
- package/dist/source/index.d.ts +1 -1
- package/dist/source/index.js +1 -1
- package/dist/source/llms.d.ts +1 -1
- package/dist/source/plugins/lucide-icons.d.ts +1 -1
- package/dist/source/plugins/slugs.d.ts +1 -1
- package/dist/source/plugins/status-badges.d.ts +2 -2
- package/dist/source/schema.d.ts +1 -1
- package/dist/source/schema.js +1 -1
- package/dist/{utils-Dn9VIXRN.js → utils-DEVq3cEC.js} +18 -1
- package/package.json +1 -1
package/dist/breadcrumb.d.ts
CHANGED
package/dist/breadcrumb.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as normalizeUrl } from "./url-BVHvi3_K.js";
|
|
2
|
-
import { r as findPath } from "./utils-
|
|
2
|
+
import { r as findPath } from "./utils-DEVq3cEC.js";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
//#region src/breadcrumb.tsx
|
|
5
5
|
function useBreadcrumb(url, tree, options) {
|
|
@@ -54,7 +54,14 @@ interface Folder extends ID {
|
|
|
54
54
|
type: 'folder';
|
|
55
55
|
name: ReactNode;
|
|
56
56
|
description?: ReactNode;
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Mark as a root folder, `true` for the default type.
|
|
59
|
+
*
|
|
60
|
+
* A string value specifies its **root type**: root folders of the same type
|
|
61
|
+
* under the same parent scope are interchangeable (e.g. versions), and pages
|
|
62
|
+
* can map to their structural projection in another root.
|
|
63
|
+
*/
|
|
64
|
+
root?: boolean | string;
|
|
58
65
|
defaultOpen?: boolean;
|
|
59
66
|
collapsible?: boolean;
|
|
60
67
|
index?: Item;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as normalizeUrl } from "./url-BVHvi3_K.js";
|
|
2
|
-
import {
|
|
2
|
+
import { l as visit } from "./utils-DEVq3cEC.js";
|
|
3
3
|
import { t as isEqualShallow } from "./is-equal-LdLqRs0o.js";
|
|
4
4
|
import { a as normalize, i as joinPath, n as dirname, r as extname, t as basename } from "./path-1H5VzYiT.js";
|
|
5
5
|
import { slugsPlugin } from "./source/plugins/slugs.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as Root } from "./definitions-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { i as Root } from "./definitions-CFOhwE1k.js";
|
|
2
|
+
import "./index-E8Qh_yQs.js";
|
|
3
3
|
//#region src/source/client/index.d.ts
|
|
4
4
|
interface SerializedPageTree {
|
|
5
5
|
$fumadocs_loader: 'page-tree';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-
|
|
1
|
+
import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-CFOhwE1k.js";
|
|
2
2
|
import { t as Awaitable } from "./types-D89QoQR-.js";
|
|
3
3
|
import { i as StructuredData } from "./remark-structure-CnHwvNZr.js";
|
|
4
4
|
import "./index-BhgPrb5p.js";
|
|
5
5
|
import { n as I18nConfig } from "./index-DydiXvgS.js";
|
|
6
|
-
import "./index-
|
|
7
|
-
import { n as SerializedPageTree } from "./index-
|
|
6
|
+
import "./index-E8Qh_yQs.js";
|
|
7
|
+
import { n as SerializedPageTree } from "./index-B-0R0VbS.js";
|
|
8
8
|
import { ReactNode } from "react";
|
|
9
9
|
//#region src/source/storage/file-system.d.ts
|
|
10
10
|
/**
|
|
@@ -388,7 +388,7 @@ type SourceConfig = {
|
|
|
388
388
|
interface MetaData {
|
|
389
389
|
icon?: string | undefined;
|
|
390
390
|
title?: string | undefined;
|
|
391
|
-
root?: boolean | undefined;
|
|
391
|
+
root?: boolean | string | undefined;
|
|
392
392
|
pages?: string[] | undefined;
|
|
393
393
|
pagesIndex?: string | undefined;
|
|
394
394
|
defaultOpen?: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Root, n as Item, r as Node, t as Folder } from "./definitions-
|
|
1
|
+
import { i as Root, n as Item, r as Node, t as Folder } from "./definitions-CFOhwE1k.js";
|
|
2
2
|
//#region src/page-tree/utils.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Flatten tree to an array of page nodes
|
|
@@ -33,6 +33,11 @@ declare function findParent(from: Root | Folder, url: string): Root | Folder | u
|
|
|
33
33
|
declare function findPath(nodes: Node[], matcher: (node: Node) => boolean, options?: {
|
|
34
34
|
includeSeparator?: boolean;
|
|
35
35
|
}): Node[] | null;
|
|
36
|
+
/**
|
|
37
|
+
* Find the structural projection of `page` (under the root folder `from`) in `to`:
|
|
38
|
+
* the page at the same file path relative to the root folder.
|
|
39
|
+
*/
|
|
40
|
+
declare function findProjection(from: Folder, to: Folder, page: Item): Item | undefined;
|
|
36
41
|
/**
|
|
37
42
|
* Perform a depth-first search on page tree visiting every node.
|
|
38
43
|
*
|
|
@@ -41,4 +46,4 @@ declare function findPath(nodes: Node[], matcher: (node: Node) => boolean, optio
|
|
|
41
46
|
*/
|
|
42
47
|
declare function visit<Root$1 extends Node | Root>(root: Root$1, visitor: <T extends Node | Root>(node: T, parent?: Root | Folder) => 'skip' | 'break' | T | void): Root$1;
|
|
43
48
|
//#endregion
|
|
44
|
-
export {
|
|
49
|
+
export { findSiblings as a, getPageTreeRoots as c, findProjection as i, visit as l, findParent as n, flattenTree as o, findPath as r, getPageTreePeers as s, findNeighbour as t };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "../definitions-
|
|
2
|
-
import { a as
|
|
3
|
-
export { Folder, Item, Node, Root, Separator, findNeighbour, findParent, findPath, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
|
|
1
|
+
import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "../definitions-CFOhwE1k.js";
|
|
2
|
+
import { a as findSiblings, c as getPageTreeRoots, i as findProjection, l as visit, n as findParent, o as flattenTree, r as findPath, s as getPageTreePeers, t as findNeighbour } from "../index-E8Qh_yQs.js";
|
|
3
|
+
export { Folder, Item, Node, Root, Separator, findNeighbour, findParent, findPath, findProjection, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
|
package/dist/page-tree/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { findNeighbour, findParent, findPath, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
|
|
1
|
+
import { a as findSiblings, c as getPageTreeRoots, i as findProjection, l as visit, n as findParent, o as flattenTree, r as findPath, s as getPageTreePeers, t as findNeighbour } from "../utils-DEVq3cEC.js";
|
|
2
|
+
export { findNeighbour, findParent, findPath, findProjection, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as Awaitable } from "../types-D89QoQR-.js";
|
|
2
2
|
import { n as I18nConfig } from "../index-DydiXvgS.js";
|
|
3
3
|
import "../index-BM36H-xw.js";
|
|
4
|
-
import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-
|
|
5
|
-
import { b as LoaderOutput, v as LoaderConfig } from "../index-
|
|
4
|
+
import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-k_q58LOn.js";
|
|
5
|
+
import { b as LoaderOutput, v as LoaderConfig } from "../index-BL0I0wLZ.js";
|
|
6
6
|
import { DocumentData, DocumentOptions } from "flexsearch";
|
|
7
7
|
//#region src/search/server/build-doc.d.ts
|
|
8
8
|
interface SharedDocument {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createEndpoint } from "../endpoint-MyoBU5IC.js";
|
|
2
|
-
import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-
|
|
2
|
+
import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-4OvfjVN2.js";
|
|
3
3
|
import { n as search, t as createDocument } from "../utils-Bvy3V-fv.js";
|
|
4
4
|
import Search from "flexsearch";
|
|
5
5
|
//#region src/search/flexsearch.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as SortedResult } from "../index-BM36H-xw.js";
|
|
2
|
-
import { n as SearchAPI } from "../server-
|
|
2
|
+
import { n as SearchAPI } from "../server-k_q58LOn.js";
|
|
3
3
|
import Mixedbread from "@mixedbread/sdk";
|
|
4
4
|
import { StoreSearchResponse } from "@mixedbread/sdk/resources/stores";
|
|
5
5
|
//#region src/search/mixedbread.d.ts
|
package/dist/search/server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AdvancedOptions, c as SimpleOptions, d as createSearchAPI, f as initAdvancedSearch, i as AdvancedIndex, l as createFromSource, n as SearchAPI, o as ExportedData, p as initSimpleSearch, r as SearchServer, s as Index, t as QueryOptions, u as createI18nSearchAPI } from "../server-
|
|
1
|
+
import { a as AdvancedOptions, c as SimpleOptions, d as createSearchAPI, f as initAdvancedSearch, i as AdvancedIndex, l as createFromSource, n as SearchAPI, o as ExportedData, p as initSimpleSearch, r as SearchServer, s as Index, t as QueryOptions, u as createI18nSearchAPI } from "../server-k_q58LOn.js";
|
|
2
2
|
export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
|
package/dist/search/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as defaultReadOptions, t as createEndpoint } from "../endpoint-MyoBU5IC.js";
|
|
2
|
-
import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-
|
|
2
|
+
import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-4OvfjVN2.js";
|
|
3
3
|
import { n as searchSimple, t as searchAdvanced } from "../advanced-Ct13khZr.js";
|
|
4
4
|
import { create, insertMultipleAsync, save } from "zbsearch";
|
|
5
5
|
//#region src/search/zbsearch/create-db.ts
|
|
@@ -2,7 +2,7 @@ import { t as Awaitable } from "./types-D89QoQR-.js";
|
|
|
2
2
|
import { i as StructuredData } from "./remark-structure-CnHwvNZr.js";
|
|
3
3
|
import { n as I18nConfig } from "./index-DydiXvgS.js";
|
|
4
4
|
import { r as SortedResult } from "./index-BM36H-xw.js";
|
|
5
|
-
import { b as LoaderOutput, v as LoaderConfig } from "./index-
|
|
5
|
+
import { b as LoaderOutput, v as LoaderConfig } from "./index-BL0I0wLZ.js";
|
|
6
6
|
import { Language, RawData, SearchParams, TypedDocument, ZBSearch, create } from "zbsearch";
|
|
7
7
|
//#region src/search/zbsearch/create-db.d.ts
|
|
8
8
|
type SimpleDocument = TypedDocument<ZBSearch<typeof simpleSchema>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-
|
|
1
|
+
import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-B-0R0VbS.js";
|
|
2
2
|
export { Serialized, SerializedPageTree, deserializePageTree, useFumadocsLoader };
|
package/dist/source/dynamic.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { h as dynamicLoader, m as DynamicLoaderConfig, p as DynamicLoader } from "../index-
|
|
1
|
+
import { h as dynamicLoader, m as DynamicLoaderConfig, p as DynamicLoader } from "../index-BL0I0wLZ.js";
|
|
2
2
|
export { DynamicLoader, DynamicLoaderConfig, dynamicLoader };
|
package/dist/source/dynamic.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as dynamicLoader } from "../dynamic-
|
|
1
|
+
import { t as dynamicLoader } from "../dynamic-CTsodhTH.js";
|
|
2
2
|
export { dynamicLoader };
|
package/dist/source/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as ContentStoragePageFile, C as Meta, D as loader, E as createGetUrl, F as PageTreeBuilderContext, I as PageTreeOptions, L as PageTreeTransformer, O as types_d_exports, P as PageTreeBuilder, R as ContentStorage, S as LoaderPluginOption, T as ResolvedLoaderConfig, V as FileSystem, _ as InferPageType, a as MetaData, b as LoaderOutput, c as SourceUnion, d as multiple, f as update, g as InferMetaType, h as dynamicLoader, i as DynamicSource, j as getSlugs, l as StaticSource, m as DynamicLoaderConfig, n as llms, o as PageData, p as DynamicLoader, r as path_d_exports, s as Source, t as LLMsConfig, u as VirtualFile, v as LoaderConfig, w as Page, x as LoaderPlugin, y as LoaderOptions, z as ContentStorageMetaFile } from "../index-
|
|
1
|
+
import { B as ContentStoragePageFile, C as Meta, D as loader, E as createGetUrl, F as PageTreeBuilderContext, I as PageTreeOptions, L as PageTreeTransformer, O as types_d_exports, P as PageTreeBuilder, R as ContentStorage, S as LoaderPluginOption, T as ResolvedLoaderConfig, V as FileSystem, _ as InferPageType, a as MetaData, b as LoaderOutput, c as SourceUnion, d as multiple, f as update, g as InferMetaType, h as dynamicLoader, i as DynamicSource, j as getSlugs, l as StaticSource, m as DynamicLoaderConfig, n as llms, o as PageData, p as DynamicLoader, r as path_d_exports, s as Source, t as LLMsConfig, u as VirtualFile, v as LoaderConfig, w as Page, x as LoaderPlugin, y as LoaderOptions, z as ContentStorageMetaFile } from "../index-BL0I0wLZ.js";
|
|
2
2
|
export { type ContentStorage, type ContentStorageMetaFile, type ContentStoragePageFile, type DynamicLoader, type DynamicLoaderConfig, type DynamicSource, FileSystem, InferMetaType, InferPageType, LLMsConfig, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, type MetaData, Page, type PageData, type PageTreeBuilder, type PageTreeBuilderContext, type PageTreeOptions, type PageTreeTransformer, path_d_exports as PathUtils, ResolvedLoaderConfig, type Source, type SourceUnion, type StaticSource, type VirtualFile, type types_d_exports as _Internal, createGetUrl, dynamicLoader, getSlugs, llms, loader, multiple, update };
|
package/dist/source/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as path_exports } from "../path-1H5VzYiT.js";
|
|
2
|
-
import { a as update, i as multiple, n as createGetUrl, o as FileSystem, r as loader, t as dynamicLoader } from "../dynamic-
|
|
2
|
+
import { a as update, i as multiple, n as createGetUrl, o as FileSystem, r as loader, t as dynamicLoader } from "../dynamic-CTsodhTH.js";
|
|
3
3
|
import { getSlugs } from "./plugins/slugs.js";
|
|
4
4
|
import { llms } from "./llms.js";
|
|
5
5
|
export { FileSystem, path_exports as PathUtils, createGetUrl, dynamicLoader, getSlugs, llms, loader, multiple, update };
|
package/dist/source/llms.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as llms, t as LLMsConfig } from "../index-
|
|
1
|
+
import { n as llms, t as LLMsConfig } from "../index-BL0I0wLZ.js";
|
|
2
2
|
export { LLMsConfig, llms };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as SlugsPluginOptions, M as slugsFromData, N as slugsPlugin, j as getSlugs, k as SlugFn } from "../../index-
|
|
1
|
+
import { A as SlugsPluginOptions, M as slugsFromData, N as slugsPlugin, j as getSlugs, k as SlugFn } from "../../index-BL0I0wLZ.js";
|
|
2
2
|
export { SlugFn, SlugsPluginOptions, getSlugs, slugsFromData, slugsPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-
|
|
2
|
-
import { x as LoaderPlugin } from "../../index-
|
|
1
|
+
import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-CFOhwE1k.js";
|
|
2
|
+
import { x as LoaderPlugin } from "../../index-BL0I0wLZ.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
//#region src/source/plugins/status-badges.d.ts
|
|
5
5
|
interface Item extends Item$1 {
|
package/dist/source/schema.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const metaSchema: z.ZodObject<{
|
|
|
8
8
|
pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
9
|
pagesIndex: z.ZodOptional<z.ZodString>;
|
|
10
10
|
description: z.ZodOptional<z.ZodString>;
|
|
11
|
-
root: z.ZodOptional<z.ZodBoolean
|
|
11
|
+
root: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
12
12
|
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
13
13
|
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
icon: z.ZodOptional<z.ZodString>;
|
package/dist/source/schema.js
CHANGED
|
@@ -9,7 +9,7 @@ const metaSchema = z.object({
|
|
|
9
9
|
/** specify a index page for folder */
|
|
10
10
|
pagesIndex: z.string().optional(),
|
|
11
11
|
description: z.string().optional(),
|
|
12
|
-
root: z.boolean().optional(),
|
|
12
|
+
root: z.union([z.boolean(), z.string()]).optional(),
|
|
13
13
|
defaultOpen: z.boolean().optional(),
|
|
14
14
|
collapsible: z.boolean().optional(),
|
|
15
15
|
icon: z.string().optional()
|
|
@@ -103,6 +103,23 @@ function findPath(nodes, matcher, options = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
return run(nodes) ?? null;
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Find the structural projection of `page` (under the root folder `from`) in `to`:
|
|
108
|
+
* the page at the same file path relative to the root folder.
|
|
109
|
+
*/
|
|
110
|
+
function findProjection(from, to, page) {
|
|
111
|
+
const prefix = from.$ref && `${from.$ref.folder}/`;
|
|
112
|
+
if (!prefix || !to.$ref || !page.$ref?.startsWith(prefix)) return;
|
|
113
|
+
const target = `${to.$ref.folder}/${page.$ref.slice(prefix.length)}`;
|
|
114
|
+
let result;
|
|
115
|
+
visit(to, (node) => {
|
|
116
|
+
if (node.type === "page" && node.$ref === target) {
|
|
117
|
+
result = node;
|
|
118
|
+
return "break";
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
106
123
|
const VisitBreak = Symbol("VisitBreak");
|
|
107
124
|
/**
|
|
108
125
|
* Perform a depth-first search on page tree visiting every node.
|
|
@@ -131,4 +148,4 @@ function visit(root, visitor) {
|
|
|
131
148
|
}
|
|
132
149
|
}
|
|
133
150
|
//#endregion
|
|
134
|
-
export {
|
|
151
|
+
export { findSiblings as a, getPageTreeRoots as c, findProjection as i, visit as l, findParent as n, flattenTree as o, findPath as r, getPageTreePeers as s, findNeighbour as t };
|