fumadocs-core 16.15.4 → 16.15.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.
Files changed (34) hide show
  1. package/dist/breadcrumb.d.ts +1 -1
  2. package/dist/breadcrumb.js +1 -1
  3. package/dist/{build-doc-CX-PNB-q.js → build-doc-4OvfjVN2.js} +1 -1
  4. package/dist/content/md.d.ts +1 -1
  5. package/dist/{definitions-D8-KI7Uy.d.ts → definitions-CFOhwE1k.d.ts} +8 -1
  6. package/dist/{dynamic-Dgf8t2t2.js → dynamic-CTsodhTH.js} +1 -1
  7. package/dist/{index-CdZGMKDG.d.ts → index-B-0R0VbS.d.ts} +2 -2
  8. package/dist/{index-19nHQs6M.d.ts → index-BL0I0wLZ.d.ts} +4 -4
  9. package/dist/{index-DZN5OrTa.d.ts → index-E8Qh_yQs.d.ts} +7 -2
  10. package/dist/{remove-markdown-DfKNMl9w.js → index.node-DkfYQyHM.js} +4 -5
  11. package/dist/page-tree/index.d.ts +3 -3
  12. package/dist/page-tree/index.js +2 -2
  13. package/dist/search/client/mixedbread.js +2 -4
  14. package/dist/search/flexsearch.d.ts +2 -2
  15. package/dist/search/flexsearch.js +1 -1
  16. package/dist/search/mixedbread.d.ts +1 -1
  17. package/dist/search/mixedbread.js +2 -4
  18. package/dist/search/server.d.ts +1 -1
  19. package/dist/search/server.js +1 -1
  20. package/dist/{server-C8FDQbVc.d.ts → server-Bd954Rsp.d.ts} +16 -16
  21. package/dist/source/client/index.d.ts +1 -1
  22. package/dist/source/client/index.js +1 -1
  23. package/dist/source/dynamic.d.ts +1 -1
  24. package/dist/source/dynamic.js +1 -1
  25. package/dist/source/index.d.ts +1 -1
  26. package/dist/source/index.js +1 -1
  27. package/dist/source/llms.d.ts +1 -1
  28. package/dist/source/plugins/lucide-icons.d.ts +1 -1
  29. package/dist/source/plugins/slugs.d.ts +1 -1
  30. package/dist/source/plugins/status-badges.d.ts +2 -2
  31. package/dist/source/schema.d.ts +1 -1
  32. package/dist/source/schema.js +1 -1
  33. package/dist/{utils-Dn9VIXRN.js → utils-DEVq3cEC.js} +18 -1
  34. package/package.json +9 -9
@@ -1,4 +1,4 @@
1
- import { i as Root, r as Node, t as Folder } from "./definitions-D8-KI7Uy.js";
1
+ import { i as Root, r as Node, t as Folder } from "./definitions-CFOhwE1k.js";
2
2
  import { ReactNode } from "react";
3
3
  //#region src/breadcrumb.d.ts
4
4
  interface BreadcrumbItem {
@@ -1,5 +1,5 @@
1
1
  import { r as normalizeUrl } from "./url-BVHvi3_K.js";
2
- import { r as findPath } from "./utils-Dn9VIXRN.js";
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) {
@@ -1,4 +1,4 @@
1
- import { r as findPath } from "./utils-Dn9VIXRN.js";
1
+ import { r as findPath } from "./utils-DEVq3cEC.js";
2
2
  import { r as extname, t as basename } from "./path-1H5VzYiT.js";
3
3
  //#region src/search/server/build-index.ts
4
4
  async function buildIndexDefault(page) {
@@ -19,6 +19,6 @@ interface MarkdownProps {
19
19
  children: Compatible;
20
20
  }
21
21
  declare function createMarkdownRenderer({ rehypePlugins, remarkPlugins, remarkRehypeOptions }?: MarkdownRendererOptions): MarkdownRenderer;
22
- declare function Markdown(props: MarkdownProps & MarkdownRendererOptions): import("react").ReactNode | Promise<import("react").ReactNode>;
22
+ declare function Markdown(props: MarkdownProps & MarkdownRendererOptions): Promise<import("react").ReactNode> | import("react").ReactNode;
23
23
  //#endregion
24
24
  export { Markdown, MarkdownProps, MarkdownRenderer, MarkdownRendererOptions, createMarkdownRenderer };
@@ -54,7 +54,14 @@ interface Folder extends ID {
54
54
  type: 'folder';
55
55
  name: ReactNode;
56
56
  description?: ReactNode;
57
- root?: boolean;
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 { c as visit } from "./utils-Dn9VIXRN.js";
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-D8-KI7Uy.js";
2
- import "./index-DZN5OrTa.js";
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-D8-KI7Uy.js";
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-DZN5OrTa.js";
7
- import { n as SerializedPageTree } from "./index-CdZGMKDG.js";
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-D8-KI7Uy.js";
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 { flattenTree as a, visit as c, findSiblings as i, findParent as n, getPageTreePeers as o, findPath as r, getPageTreeRoots as s, findNeighbour as t };
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,6 +1,5 @@
1
- import { t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
2
- //#region ../../node_modules/.pnpm/remove-markdown@0.6.4/node_modules/remove-markdown/index.js
3
- var require_remove_markdown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1
+ import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
2
+ var index_node_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4
3
  module.exports = function(md, options) {
5
4
  options = options || {};
6
5
  options.listUnicodeChar = options.hasOwnProperty("listUnicodeChar") ? options.listUnicodeChar : false;
@@ -35,6 +34,6 @@ var require_remove_markdown = /* @__PURE__ */ __commonJSMin(((exports, module) =
35
34
  }
36
35
  return output;
37
36
  };
38
- }));
37
+ })))(), 1)).default;
39
38
  //#endregion
40
- export { require_remove_markdown as t };
39
+ export { index_node_default 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-D8-KI7Uy.js";
2
- import { a as flattenTree, c as visit, i as findSiblings, n as findParent, o as getPageTreePeers, r as findPath, s as getPageTreeRoots, t as findNeighbour } from "../index-DZN5OrTa.js";
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 };
@@ -1,2 +1,2 @@
1
- import { a as flattenTree, c as visit, i as findSiblings, n as findParent, o as getPageTreePeers, r as findPath, s as getPageTreeRoots, t as findNeighbour } from "../utils-Dn9VIXRN.js";
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,14 +1,12 @@
1
- import { r as __toESM } from "../../rolldown-runtime-DC62tzP2.js";
2
- import { t as require_remove_markdown } from "../../remove-markdown-DfKNMl9w.js";
1
+ import { t as index_node_default } from "../../index.node-DkfYQyHM.js";
3
2
  import Slugger from "github-slugger";
4
3
  //#region src/search/client/mixedbread.ts
5
- var import_remove_markdown = /* @__PURE__ */ __toESM(require_remove_markdown(), 1);
6
4
  const slugger = new Slugger();
7
5
  function extractHeadingTitle(text) {
8
6
  const trimmedText = text.trim();
9
7
  if (!trimmedText.startsWith("#")) return "";
10
8
  const firstLine = trimmedText.split("\n")[0]?.trim();
11
- if (firstLine) return (0, import_remove_markdown.default)(firstLine, { useImgAltText: false });
9
+ if (firstLine) return index_node_default(firstLine, { useImgAltText: false });
12
10
  return "";
13
11
  }
14
12
  /**
@@ -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-C8FDQbVc.js";
5
- import { b as LoaderOutput, v as LoaderConfig } from "../index-19nHQs6M.js";
4
+ import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-Bd954Rsp.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-CX-PNB-q.js";
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-C8FDQbVc.js";
2
+ import { n as SearchAPI } from "../server-Bd954Rsp.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
@@ -1,15 +1,13 @@
1
- import { r as __toESM } from "../rolldown-runtime-DC62tzP2.js";
2
1
  import { t as createEndpoint } from "../endpoint-MyoBU5IC.js";
3
- import { t as require_remove_markdown } from "../remove-markdown-DfKNMl9w.js";
2
+ import { t as index_node_default } from "../index.node-DkfYQyHM.js";
4
3
  import Slugger from "github-slugger";
5
4
  //#region src/search/mixedbread.ts
6
- var import_remove_markdown = /* @__PURE__ */ __toESM(require_remove_markdown(), 1);
7
5
  const slugger = new Slugger();
8
6
  function extractHeadingTitle(text) {
9
7
  const trimmedText = text.trim();
10
8
  if (!trimmedText.startsWith("#")) return "";
11
9
  const firstLine = trimmedText.split("\n")[0]?.trim();
12
- if (firstLine) return (0, import_remove_markdown.default)(firstLine, { useImgAltText: false });
10
+ if (firstLine) return index_node_default(firstLine, { useImgAltText: false });
13
11
  return "";
14
12
  }
15
13
  function defaultTransform(results) {
@@ -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-C8FDQbVc.js";
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-Bd954Rsp.js";
2
2
  export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -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-CX-PNB-q.js";
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,29 +2,29 @@ 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-19nHQs6M.js";
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>>;
9
9
  declare const simpleSchema: {
10
- readonly url: "string";
11
- readonly title: "string";
12
- readonly breadcrumbs: "string[]";
13
- readonly description: "string";
14
- readonly content: "string";
15
- readonly keywords: "string";
16
- readonly locale: "enum";
10
+ readonly url: 'string';
11
+ readonly title: 'string';
12
+ readonly breadcrumbs: 'string[]';
13
+ readonly description: 'string';
14
+ readonly content: 'string';
15
+ readonly keywords: 'string';
16
+ readonly locale: 'enum';
17
17
  };
18
18
  type AdvancedDocument = TypedDocument<ZBSearch<typeof advancedSchema>>;
19
19
  declare const advancedSchema: {
20
- readonly content: "string";
21
- readonly page_id: "string";
22
- readonly type: "string";
23
- readonly breadcrumbs: "string[]";
24
- readonly tags: "enum[]";
25
- readonly url: "string";
26
- readonly locale: "enum";
27
- readonly embeddings: "vector[512]";
20
+ readonly content: 'string';
21
+ readonly page_id: 'string';
22
+ readonly type: 'string';
23
+ readonly breadcrumbs: 'string[]';
24
+ readonly tags: 'enum[]';
25
+ readonly url: 'string';
26
+ readonly locale: 'enum';
27
+ readonly embeddings: 'vector[512]';
28
28
  };
29
29
  //#endregion
30
30
  //#region src/search/server/build-index.d.ts
@@ -1,2 +1,2 @@
1
- import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-CdZGMKDG.js";
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 };
@@ -1,4 +1,4 @@
1
- import { c as visit } from "../../utils-Dn9VIXRN.js";
1
+ import { l as visit } from "../../utils-DEVq3cEC.js";
2
2
  import { useMemo } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region src/source/client/index.tsx
@@ -1,2 +1,2 @@
1
- import { h as dynamicLoader, m as DynamicLoaderConfig, p as DynamicLoader } from "../index-19nHQs6M.js";
1
+ import { h as dynamicLoader, m as DynamicLoaderConfig, p as DynamicLoader } from "../index-BL0I0wLZ.js";
2
2
  export { DynamicLoader, DynamicLoaderConfig, dynamicLoader };
@@ -1,2 +1,2 @@
1
- import { t as dynamicLoader } from "../dynamic-Dgf8t2t2.js";
1
+ import { t as dynamicLoader } from "../dynamic-CTsodhTH.js";
2
2
  export { dynamicLoader };
@@ -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-19nHQs6M.js";
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 };
@@ -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-Dgf8t2t2.js";
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 };
@@ -1,2 +1,2 @@
1
- import { n as llms, t as LLMsConfig } from "../index-19nHQs6M.js";
1
+ import { n as llms, t as LLMsConfig } from "../index-BL0I0wLZ.js";
2
2
  export { LLMsConfig, llms };
@@ -1,4 +1,4 @@
1
- import { x as LoaderPlugin } from "../../index-19nHQs6M.js";
1
+ import { x as LoaderPlugin } from "../../index-BL0I0wLZ.js";
2
2
  import { icons } from "lucide-react";
3
3
  //#region src/source/plugins/lucide-icons.d.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { A as SlugsPluginOptions, M as slugsFromData, N as slugsPlugin, j as getSlugs, k as SlugFn } from "../../index-19nHQs6M.js";
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-D8-KI7Uy.js";
2
- import { x as LoaderPlugin } from "../../index-19nHQs6M.js";
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 {
@@ -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>;
@@ -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 { flattenTree as a, visit as c, findSiblings as i, findParent as n, getPageTreePeers as o, findPath as r, getPageTreeRoots as s, findNeighbour as t };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.15.4",
3
+ "version": "16.15.6",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",
@@ -139,22 +139,22 @@
139
139
  "@types/estree-jsx": "^1.0.5",
140
140
  "@types/hast": "^3.0.5",
141
141
  "@types/mdast": "^4.0.4",
142
- "@types/node": "26.3.0",
142
+ "@types/node": "26.4.1",
143
143
  "@types/react": "^19.2.18",
144
144
  "@types/react-dom": "^19.2.5",
145
145
  "algoliasearch": "5.57.0",
146
146
  "flexsearch": "^0.8.212",
147
- "lucide-react": "^1.34.0",
148
- "next": "16.3.3",
147
+ "lucide-react": "^1.39.0",
148
+ "next": "16.3.4",
149
149
  "path-to-regexp": "^8.4.2",
150
- "react-router": "^8.3.0",
150
+ "react-router": "^8.3.1",
151
151
  "remark-directive": "^4.0.0",
152
152
  "remark-mdx": "^3.1.1",
153
- "remove-markdown": "^0.6.4",
153
+ "remove-markdown": "^0.7.0",
154
154
  "tsdown": "0.22.14",
155
- "typescript": "^6.0.3",
155
+ "typescript": "^7.0.2",
156
156
  "waku": "1.0.0-rc.0",
157
- "zod": "4.4.3",
157
+ "zod": "4.5.4",
158
158
  "tsconfig": "0.0.0"
159
159
  },
160
160
  "peerDependencies": {
@@ -238,7 +238,7 @@
238
238
  "@formatjs/intl-localematcher": "0.8.13",
239
239
  "@shikijs/transformers": "4.4.3",
240
240
  "path-to-regexp": "8.4.2",
241
- "remove-markdown": "0.6.4"
241
+ "remove-markdown": "0.7.0"
242
242
  },
243
243
  "scripts": {
244
244
  "build": "tsdown",