fumadocs-core 16.9.0 → 16.9.1

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,4 +1,4 @@
1
- import { i as Root, r as Node, t as Folder } from "./definitions-Cob-Q8-8.js";
1
+ import { i as Root, r as Node, t as Folder } from "./definitions-DQRPsvc7.js";
2
2
  import { ReactNode } from "react";
3
3
 
4
4
  //#region src/breadcrumb.d.ts
@@ -9,9 +9,9 @@ interface ID {
9
9
  }
10
10
  interface Root extends ID {
11
11
  /**
12
- * @internal meta file path
12
+ * @internal folder `$ref`
13
13
  */
14
- $ref?: string;
14
+ $ref?: Folder['$ref'];
15
15
  type?: 'root';
16
16
  name: ReactNode;
17
17
  description?: ReactNode;
@@ -46,9 +46,12 @@ interface Separator extends ID {
46
46
  }
47
47
  interface Folder extends ID {
48
48
  /**
49
- * @internal meta file path
49
+ * @internal paths of meta file & folder
50
50
  */
51
- $ref?: string;
51
+ $ref?: {
52
+ meta?: string;
53
+ folder: string;
54
+ };
52
55
  type: 'folder';
53
56
  name: ReactNode;
54
57
  description?: ReactNode;
@@ -1,2 +1,2 @@
1
- import { a as TranslationPreset, c as TranslationsAPIExtension, d as renderTranslation, i as TranslationObject, l as defineI18n, n as I18nConfig, o as TranslationValue, r as SingularTranslationsAPI, s as TranslationsAPI, t as I18nAPI, u as defineTranslations } from "../index-YTOeewZk.js";
1
+ import { a as TranslationPreset, c as TranslationsAPIExtension, d as renderTranslation, i as TranslationObject, l as defineI18n, n as I18nConfig, o as TranslationValue, r as SingularTranslationsAPI, s as TranslationsAPI, t as I18nAPI, u as defineTranslations } from "../index-Ci-v40o3.js";
2
2
  export { I18nAPI, I18nConfig, SingularTranslationsAPI, TranslationObject, TranslationPreset, TranslationValue, TranslationsAPI, TranslationsAPIExtension, defineI18n, defineTranslations, renderTranslation };
@@ -4,7 +4,11 @@ function defineI18n(config) {
4
4
  ...config,
5
5
  translations() {
6
6
  const translations = {};
7
- for (const lang of config.languages) translations[lang] = {};
7
+ const stagedTranslations = {};
8
+ for (const lang of config.languages) {
9
+ translations[lang] = {};
10
+ stagedTranslations[lang] = {};
11
+ }
8
12
  return {
9
13
  config,
10
14
  $inferLanguages: void 0,
@@ -14,7 +18,8 @@ function defineI18n(config) {
14
18
  },
15
19
  preset(lang, preset) {
16
20
  const t = translations[lang];
17
- for (const [namespace, obj] of Object.entries(preset.value)) if (t[namespace]) Object.assign(t[namespace], obj);
21
+ const staged = stagedTranslations[lang];
22
+ for (const [namespace, obj] of Object.entries(preset.value)) Object.assign(t[namespace] ?? (staged[namespace] ??= {}), obj);
18
23
  return this;
19
24
  },
20
25
  add(namespace, overrides) {
@@ -22,7 +27,16 @@ function defineI18n(config) {
22
27
  return this;
23
28
  },
24
29
  extend({ namespace, defaultValue }) {
25
- for (const lang of config.languages) translations[lang][namespace] = { ...defaultValue };
30
+ for (const lang of config.languages) {
31
+ const t = translations[lang];
32
+ const staged = stagedTranslations[lang];
33
+ if (t[namespace]) continue;
34
+ t[namespace] = {
35
+ ...defaultValue,
36
+ ...staged[namespace]
37
+ };
38
+ delete staged[namespace];
39
+ }
26
40
  return this;
27
41
  }
28
42
  };
@@ -32,13 +46,17 @@ function defineI18n(config) {
32
46
  /** create translations API without i18n */
33
47
  function defineTranslations() {
34
48
  const translations = {};
49
+ const stagedTranslations = {};
35
50
  return {
36
51
  $inferNamespaces: void 0,
37
52
  get() {
38
53
  return translations;
39
54
  },
40
55
  preset(preset) {
41
- for (const [namespace, obj] of Object.entries(preset.value)) if (translations[namespace]) Object.assign(translations[namespace], obj);
56
+ for (const [namespace, obj] of Object.entries(preset.value)) {
57
+ const t = translations[namespace] ?? (stagedTranslations[namespace] ??= {});
58
+ Object.assign(t, obj);
59
+ }
42
60
  return this;
43
61
  },
44
62
  add(namespace, overrides) {
@@ -46,7 +64,13 @@ function defineTranslations() {
46
64
  return this;
47
65
  },
48
66
  extend({ namespace, defaultValue }) {
49
- translations[namespace] = { ...defaultValue };
67
+ if (!translations[namespace]) {
68
+ translations[namespace] = {
69
+ ...defaultValue,
70
+ ...stagedTranslations[namespace]
71
+ };
72
+ delete stagedTranslations[namespace];
73
+ }
50
74
  return this;
51
75
  }
52
76
  };
@@ -1,4 +1,4 @@
1
- import { n as I18nConfig } from "../index-YTOeewZk.js";
1
+ import { n as I18nConfig } from "../index-Ci-v40o3.js";
2
2
  import { NextProxy } from "next/server.js";
3
3
  import { NextURL } from "next/dist/server/web/next-url.js";
4
4
 
@@ -1,8 +1,8 @@
1
- import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-Cob-Q8-8.js";
1
+ import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-DQRPsvc7.js";
2
2
  import { t as Awaitable } from "./types-DpbpliNk.js";
3
3
  import { i as StructuredData } from "./remark-structure-C2-K9_ko.js";
4
- import { n as I18nConfig } from "./index-YTOeewZk.js";
5
- import { n as SerializedPageTree } from "./index-D2f_P1Zo.js";
4
+ import { n as I18nConfig } from "./index-Ci-v40o3.js";
5
+ import { n as SerializedPageTree } from "./index-Doj0FeGs.js";
6
6
  import { ReactNode } from "react";
7
7
 
8
8
  //#region src/source/storage/file-system.d.ts
@@ -329,6 +329,7 @@ interface MetaData {
329
329
  title?: string | undefined;
330
330
  root?: boolean | undefined;
331
331
  pages?: string[] | undefined;
332
+ pagesIndex?: string | undefined;
332
333
  defaultOpen?: boolean | undefined;
333
334
  collapsible?: boolean | undefined;
334
335
  description?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { i as Root, n as Item, r as Node, t as Folder } from "./definitions-Cob-Q8-8.js";
1
+ import { i as Root, n as Item, r as Node, t as Folder } from "./definitions-DQRPsvc7.js";
2
2
 
3
3
  //#region src/page-tree/utils.d.ts
4
4
  /**
@@ -61,20 +61,22 @@ interface TranslationsAPI<Languages extends string = string, Namespaces extends
61
61
  (lang: Languages): Namespaces;
62
62
  (lang: string): Namespaces | undefined;
63
63
  };
64
+ /** add extension, will be ignored if the same extension (namespace) has been registered */
64
65
  extend: <N extends string, Obj extends TranslationObject>(extension: TranslationsAPIExtension<N, Obj>) => TranslationsAPI<Languages, Namespaces & { [K in N]: Obj }>;
65
66
  /** add translations */
66
67
  add: <N extends keyof Namespaces>(namespace: N, overrides: { [Lang in Languages]?: Partial<Namespaces[N]> }) => TranslationsAPI<Languages, Namespaces>;
67
- /** add language pack, you should call `extend()` first before adding a language preset */
68
+ /** add language pack */
68
69
  preset: (lang: Languages, preset: TranslationPreset<Namespaces>) => TranslationsAPI<Languages, Namespaces>;
69
70
  }
70
71
  interface SingularTranslationsAPI<Namespaces extends Record<string, TranslationObject> = Record<string, TranslationObject>> {
71
72
  /** for type inference only, always `undefined` in runtime */
72
73
  $inferNamespaces: Namespaces;
73
74
  get: () => Namespaces;
75
+ /** add extension, will be ignored if the same extension (namespace) has been registered */
74
76
  extend: <N extends string, Obj extends TranslationObject>(extension: TranslationsAPIExtension<N, Obj>) => SingularTranslationsAPI<Namespaces & { [K in N]: Obj }>;
75
77
  /** add translations */
76
78
  add: <N extends keyof Namespaces>(namespace: N, overrides: Partial<Namespaces[N]>) => SingularTranslationsAPI<Namespaces>;
77
- /** add language pack, you should call `extend()` first before adding a language preset */
79
+ /** add language pack */
78
80
  preset: (preset: TranslationPreset<Namespaces>) => SingularTranslationsAPI<Namespaces>;
79
81
  }
80
82
  /** create translations API without i18n */
@@ -1,4 +1,4 @@
1
- import { i as Root } from "./definitions-Cob-Q8-8.js";
1
+ import { i as Root } from "./definitions-DQRPsvc7.js";
2
2
  //#region src/source/client/index.d.ts
3
3
  interface SerializedPageTree {
4
4
  $fumadocs_loader: 'page-tree';
@@ -353,67 +353,77 @@ function createPageTreeBuilder(input, options) {
353
353
  return id;
354
354
  }
355
355
  function buildPaths(paths, filter, reversed = false) {
356
- const nodeToPath = /* @__PURE__ */ new Map();
356
+ const nodes = [];
357
357
  let indexNode;
358
358
  for (const path of paths) {
359
359
  if (filter && !filter(path)) continue;
360
360
  const fileNode = buildFile(path);
361
361
  if (fileNode) {
362
- nodeToPath.set(fileNode, path);
362
+ nodes.push(fileNode);
363
363
  if (!indexNode && basename(path, extname(path)) === "index") indexNode = fileNode;
364
364
  continue;
365
365
  }
366
366
  const dirNode = buildFolder(path);
367
- if (dirNode) nodeToPath.set(dirNode, path);
367
+ if (dirNode) nodes.push(dirNode);
368
368
  }
369
369
  const factor = reversed ? -1 : 1;
370
370
  const useName = sortBy === "name";
371
- return Array.from(nodeToPath.keys()).sort((a, b) => {
371
+ return nodes.sort((a, b) => {
372
372
  if (a === indexNode) return -100;
373
373
  if (b === indexNode) return 100;
374
- const aT = useName && a[SymbolName] || nodeToPath.get(a);
375
- const bT = useName && b[SymbolName] || nodeToPath.get(b);
374
+ const aT = useName && a[SymbolName] || (a.type === "folder" ? a.$ref.folder : a.$ref);
375
+ const bT = useName && b[SymbolName] || (b.type === "folder" ? b.$ref.folder : b.$ref);
376
376
  const aK = a.type === "folder" ? 10 : 0;
377
377
  const bK = b.type === "folder" ? 10 : 0;
378
378
  return factor * (aT.localeCompare(bT, sortLocales, sortOptions) + (aK - bK));
379
379
  });
380
380
  }
381
+ function resolveLink(item) {
382
+ const match = link.exec(item);
383
+ if (!match?.groups) return;
384
+ const { icon, url, name, external } = match.groups;
385
+ let node = {
386
+ $id: generateId(),
387
+ type: "page",
388
+ icon,
389
+ name,
390
+ url,
391
+ external: external ? true : void 0
392
+ };
393
+ for (const transformer of transformers) {
394
+ if (!transformer.file) continue;
395
+ node = transformer.file.call(ctx, node);
396
+ }
397
+ return node;
398
+ }
399
+ function resolveSeparator(item) {
400
+ const match = separator.exec(item);
401
+ if (!match?.groups) return;
402
+ let node = {
403
+ $id: generateId(),
404
+ type: "separator",
405
+ icon: match.groups.icon,
406
+ name: match.groups.name
407
+ };
408
+ for (const transformer of transformers) {
409
+ if (!transformer.separator) continue;
410
+ node = transformer.separator.call(ctx, node);
411
+ }
412
+ return node;
413
+ }
381
414
  function resolveFolderItem(folderPath, item, outputArray, excludedPaths) {
382
415
  if (item === rest || item === restReversed) {
383
416
  outputArray.push(item);
384
417
  return;
385
418
  }
386
- let match = separator.exec(item);
387
- if (match?.groups) {
388
- let node = {
389
- $id: generateId(),
390
- type: "separator",
391
- icon: match.groups.icon,
392
- name: match.groups.name
393
- };
394
- for (const transformer of transformers) {
395
- if (!transformer.separator) continue;
396
- node = transformer.separator.call(ctx, node);
397
- }
398
- outputArray.push(node);
419
+ const separator = resolveSeparator(item);
420
+ if (separator) {
421
+ outputArray.push(separator);
399
422
  return;
400
423
  }
401
- match = link.exec(item);
402
- if (match?.groups) {
403
- const { icon, url, name, external } = match.groups;
404
- let node = {
405
- $id: generateId(),
406
- type: "page",
407
- icon,
408
- name,
409
- url
410
- };
411
- if (external) node.external = true;
412
- for (const transformer of transformers) {
413
- if (!transformer.file) continue;
414
- node = transformer.file.call(ctx, node);
415
- }
416
- outputArray.push(node);
424
+ const link = resolveLink(item);
425
+ if (link) {
426
+ outputArray.push(link);
417
427
  return;
418
428
  }
419
429
  if (item.startsWith(excludePrefix)) {
@@ -446,17 +456,19 @@ function createPageTreeBuilder(input, options) {
446
456
  outputArray.push(node);
447
457
  excludedPaths.add(path);
448
458
  }
449
- function buildFolder(folderPath) {
459
+ function buildFolder(folderPath, isGlobalRoot = false) {
450
460
  const cached = pathToNode.get(folderPath);
451
461
  if (cached) return cached;
452
462
  const files = storage.readDir(folderPath);
453
463
  if (!files) return;
454
- const isGlobalRoot = folderPath === "";
455
- const metaPath = resolveFlattenPath(joinPath(folderPath, "meta"), "meta");
456
- const indexPath = resolveFlattenPath(joinPath(folderPath, "index"), "page");
464
+ let metaPath = resolveFlattenPath(joinPath(folderPath, "meta"), "meta");
457
465
  let meta = storage.read(metaPath);
458
- if (meta && meta.format !== "meta") meta = void 0;
466
+ if (!meta || meta.format !== "meta") {
467
+ meta = void 0;
468
+ metaPath = void 0;
469
+ }
459
470
  const metadata = meta?.data ?? {};
471
+ const isRoot = metadata.root ?? isGlobalRoot;
460
472
  let node = {
461
473
  type: "folder",
462
474
  name: null,
@@ -466,20 +478,35 @@ function createPageTreeBuilder(input, options) {
466
478
  collapsible: metadata.collapsible,
467
479
  children: [],
468
480
  $id: generateId(folderPath),
469
- $ref: !noRef && meta ? metaPath : void 0,
481
+ $ref: {
482
+ folder: folderPath,
483
+ meta: metaPath
484
+ },
470
485
  [SymbolUnfinished]: true
471
486
  };
472
487
  pathToNode.set(folderPath, node);
473
- if (!(metadata.root ?? isGlobalRoot)) {
474
- const fileNode = buildFile(indexPath);
475
- if (fileNode && own(folderPath, fileNode, 0)) node.index = fileNode;
488
+ let indexPath;
489
+ if (metadata.pagesIndex) {
490
+ const resolvedPath = resolveFlattenPath(joinPath(folderPath, metadata.pagesIndex), "page");
491
+ const page = buildFile(resolvedPath);
492
+ if (page && own(folderPath, page, 3)) {
493
+ indexPath = resolvedPath;
494
+ node.index = page;
495
+ } else node.index = resolveLink(metadata.pagesIndex);
496
+ } else if (!isRoot) {
497
+ const defaultPath = resolveFlattenPath(joinPath(folderPath, "index"), "page");
498
+ const page = buildFile(defaultPath);
499
+ if (page && own(folderPath, page, 0)) {
500
+ indexPath = defaultPath;
501
+ node.index = page;
502
+ }
476
503
  }
477
504
  if (metadata.pages) {
478
505
  const outputArray = [];
479
506
  const excludedPaths = /* @__PURE__ */ new Set();
480
507
  for (const item of metadata.pages) resolveFolderItem(folderPath, item, outputArray, excludedPaths);
481
- if (excludedPaths.has(indexPath)) delete node.index;
482
- else if (node.index) excludedPaths.add(indexPath);
508
+ if (indexPath) if (excludedPaths.has(indexPath)) delete node.index;
509
+ else excludedPaths.add(indexPath);
483
510
  for (const item of outputArray) {
484
511
  if (item !== rest && item !== restReversed) {
485
512
  node.children.push(item);
@@ -488,7 +515,7 @@ function createPageTreeBuilder(input, options) {
488
515
  const resolvedItem = buildPaths(files, (file) => !excludedPaths.has(file), item === restReversed);
489
516
  for (const child of resolvedItem) if (own(folderPath, child, 0)) node.children.push(child);
490
517
  }
491
- } else for (const item of buildPaths(files, node.index ? (file) => file !== indexPath : void 0)) if (own(folderPath, item, 0)) node.children.push(item);
518
+ } else for (const item of buildPaths(files, indexPath ? (file) => file !== indexPath : void 0)) if (own(folderPath, item, 0)) node.children.push(item);
492
519
  node.icon = metadata.icon ?? node.index?.icon;
493
520
  node.name = metadata.title ?? node.index?.name;
494
521
  node[SymbolName] = metadata.title ?? node.index?.[SymbolName];
@@ -498,7 +525,7 @@ function createPageTreeBuilder(input, options) {
498
525
  }
499
526
  for (const transformer of transformers) {
500
527
  if (!transformer.folder) continue;
501
- node = transformer.folder.call(ctx, node, folderPath, meta ? metaPath : void 0);
528
+ node = transformer.folder.call(ctx, node, folderPath, metaPath);
502
529
  }
503
530
  pathToNode.set(folderPath, node);
504
531
  delete node[SymbolUnfinished];
@@ -517,7 +544,7 @@ function createPageTreeBuilder(input, options) {
517
544
  description,
518
545
  icon,
519
546
  url: getUrl(page.slugs, ctx.locale),
520
- $ref: !noRef ? path : void 0,
547
+ $ref: path,
521
548
  [SymbolName]: title
522
549
  };
523
550
  for (const transformer of transformers) {
@@ -530,23 +557,24 @@ function createPageTreeBuilder(input, options) {
530
557
  const builder = {
531
558
  resolveFlattenPath,
532
559
  root(id = "root", path = "") {
533
- const node = buildFolder(path);
560
+ const folder = buildFolder(path, true);
561
+ for (const node of pathToNode.values()) {
562
+ delete node[SymbolName];
563
+ delete node[SymbolOwner];
564
+ if (noRef && "$ref" in node) delete node.$ref;
565
+ }
534
566
  let root = {
535
567
  type: "root",
536
- $ref: node?.$ref,
568
+ $ref: folder?.$ref,
537
569
  $id: generateId(id),
538
- name: node?.name || "Docs",
539
- description: node?.description,
540
- children: node ? node.children : []
570
+ name: folder?.name || "Docs",
571
+ description: folder?.description,
572
+ children: folder ? folder.children : []
541
573
  };
542
574
  for (const transformer of transformers) {
543
575
  if (!transformer.root) continue;
544
576
  root = transformer.root.call(ctx, root);
545
577
  }
546
- for (const node of pathToNode.values()) {
547
- delete node[SymbolName];
548
- delete node[SymbolOwner];
549
- }
550
578
  return root;
551
579
  }
552
580
  };
@@ -703,8 +731,8 @@ function loader(...args) {
703
731
  },
704
732
  getNodeMeta(node, language = i18n?.defaultLanguage) {
705
733
  const ref = node.$ref;
706
- if (!ref) return;
707
- return indexer.getMeta(ref, language);
734
+ if (!ref?.meta) return;
735
+ return indexer.getMeta(ref.meta, language);
708
736
  },
709
737
  getNodePage(node, language = i18n?.defaultLanguage) {
710
738
  const ref = node.$ref;
@@ -1,3 +1,3 @@
1
- import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "../definitions-Cob-Q8-8.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-DRvW7IXg.js";
1
+ import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "../definitions-DQRPsvc7.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-B_zmuyw1.js";
3
3
  export { Folder, Item, Node, Root, Separator, findNeighbour, findParent, findPath, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
@@ -1,7 +1,7 @@
1
1
  import { t as Awaitable } from "../types-DpbpliNk.js";
2
- import { n as I18nConfig } from "../index-YTOeewZk.js";
3
- import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-BmBBtKX6.js";
4
- import { C as LoaderConfig, T as LoaderOutput } from "../index-CKvjS08M2.js";
2
+ import { n as I18nConfig } from "../index-Ci-v40o3.js";
3
+ import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-CB8UVhSB.js";
4
+ import { C as LoaderConfig, T as LoaderOutput } from "../index-8VAf9i7P2.js";
5
5
  import { DocumentData, DocumentOptions } from "flexsearch";
6
6
 
7
7
  //#region src/search/server/build-doc.d.ts
@@ -1,5 +1,5 @@
1
1
  import { r as SortedResult } from "../index-Bcms_L7o.js";
2
- import { n as SearchAPI } from "../server-BmBBtKX6.js";
2
+ import { n as SearchAPI } from "../server-CB8UVhSB.js";
3
3
  import Mixedbread from "@mixedbread/sdk";
4
4
  import { StoreSearchResponse } from "@mixedbread/sdk/resources/stores";
5
5
 
@@ -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-BmBBtKX6.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-CB8UVhSB.js";
2
2
  export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -1,8 +1,8 @@
1
1
  import { t as Awaitable } from "./types-DpbpliNk.js";
2
2
  import { i as StructuredData } from "./remark-structure-C2-K9_ko.js";
3
- import { n as I18nConfig } from "./index-YTOeewZk.js";
3
+ import { n as I18nConfig } from "./index-Ci-v40o3.js";
4
4
  import { r as SortedResult } from "./index-Bcms_L7o.js";
5
- import { C as LoaderConfig, T as LoaderOutput } from "./index-CKvjS08M2.js";
5
+ import { C as LoaderConfig, T as LoaderOutput } from "./index-8VAf9i7P2.js";
6
6
  import { Language, Orama, RawData, SearchParams, TypedDocument, create } from "@orama/orama";
7
7
 
8
8
  //#region src/search/orama/create-db.d.ts
@@ -1,2 +1,2 @@
1
- import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-D2f_P1Zo.js";
1
+ import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-Doj0FeGs.js";
2
2
  export { Serialized, SerializedPageTree, deserializePageTree, useFumadocsLoader };
@@ -1,2 +1,2 @@
1
- import { b as dynamicLoader, v as DynamicLoader, y as DynamicLoaderConfig } from "../index-CKvjS08M2.js";
1
+ import { b as dynamicLoader, v as DynamicLoader, y as DynamicLoaderConfig } from "../index-8VAf9i7P2.js";
2
2
  export { DynamicLoader, DynamicLoaderConfig, dynamicLoader };
@@ -1,4 +1,4 @@
1
- import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-DWaWaGZg.js";
1
+ import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-AC1aN-MX.js";
2
2
  import { cache } from "react";
3
3
  //#region src/source/dynamic.ts
4
4
  function dynamicLoader(input, options) {
@@ -1,2 +1,2 @@
1
- import { A as ResolvedLoaderConfig, B as PageTreeTransformer, C as LoaderConfig, D as LoaderPluginOption, E as LoaderPlugin, H as ContentStorageMetaFile, L as PageTreeBuilder, M as loader, O as Meta, P as getSlugs, R as PageTreeBuilderContext, S as InferPageType, T as LoaderOutput, U as ContentStoragePageFile, V as ContentStorage, W as FileSystem, _ as update, a as MetaData, c as SourceConfig, d as VirtualFile, f as _SourceUpdate_, g as source, h as multiple, i as DynamicSource, j as createGetUrl, k as Page, l as SourceUnion, m as isStaticSource, n as llms, o as PageData, p as isDynamicSource, r as path_d_exports, s as Source, t as LLMsConfig, u as StaticSource, w as LoaderOptions, x as InferMetaType, z as PageTreeOptions } from "../index-CKvjS08M2.js";
1
+ import { A as ResolvedLoaderConfig, B as PageTreeTransformer, C as LoaderConfig, D as LoaderPluginOption, E as LoaderPlugin, H as ContentStorageMetaFile, L as PageTreeBuilder, M as loader, O as Meta, P as getSlugs, R as PageTreeBuilderContext, S as InferPageType, T as LoaderOutput, U as ContentStoragePageFile, V as ContentStorage, W as FileSystem, _ as update, a as MetaData, c as SourceConfig, d as VirtualFile, f as _SourceUpdate_, g as source, h as multiple, i as DynamicSource, j as createGetUrl, k as Page, l as SourceUnion, m as isStaticSource, n as llms, o as PageData, p as isDynamicSource, r as path_d_exports, s as Source, t as LLMsConfig, u as StaticSource, w as LoaderOptions, x as InferMetaType, z as PageTreeOptions } from "../index-8VAf9i7P2.js";
2
2
  export { ContentStorage, ContentStorageMetaFile, ContentStoragePageFile, DynamicSource, FileSystem, InferMetaType, InferPageType, LLMsConfig, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, MetaData, Page, PageData, PageTreeBuilder, PageTreeBuilderContext, PageTreeOptions, PageTreeTransformer, path_d_exports as PathUtils, ResolvedLoaderConfig, Source, SourceConfig, SourceUnion, StaticSource, VirtualFile, _SourceUpdate_, createGetUrl, getSlugs, isDynamicSource, isStaticSource, llms, loader, multiple, source, update };
@@ -1,5 +1,5 @@
1
1
  import { o as path_exports } from "../path-CPgAF5cw.js";
2
- import { a as multiple, c as FileSystem, i as isStaticSource, n as loader, o as source, r as isDynamicSource, s as update, t as createGetUrl } from "../loader-DWaWaGZg.js";
2
+ import { a as multiple, c as FileSystem, i as isStaticSource, n as loader, o as source, r as isDynamicSource, s as update, t as createGetUrl } from "../loader-AC1aN-MX.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, getSlugs, isDynamicSource, isStaticSource, llms, loader, multiple, source, update };
@@ -1,2 +1,2 @@
1
- import { n as llms, t as LLMsConfig } from "../index-CKvjS08M2.js";
1
+ import { n as llms, t as LLMsConfig } from "../index-8VAf9i7P2.js";
2
2
  export { LLMsConfig, llms };
@@ -1,4 +1,4 @@
1
- import { E as LoaderPlugin } from "../../index-CKvjS08M2.js";
1
+ import { E as LoaderPlugin } from "../../index-8VAf9i7P2.js";
2
2
  import { icons } from "lucide-react";
3
3
 
4
4
  //#region src/source/plugins/lucide-icons.d.ts
@@ -1,2 +1,2 @@
1
- import { F as slugsFromData, I as slugsPlugin, N as SlugFn, P as getSlugs } from "../../index-CKvjS08M2.js";
1
+ import { F as slugsFromData, I as slugsPlugin, N as SlugFn, P as getSlugs } from "../../index-8VAf9i7P2.js";
2
2
  export { SlugFn, getSlugs, slugsFromData, slugsPlugin };
@@ -1,5 +1,5 @@
1
- import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-Cob-Q8-8.js";
2
- import { E as LoaderPlugin } from "../../index-CKvjS08M2.js";
1
+ import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-DQRPsvc7.js";
2
+ import { E as LoaderPlugin } from "../../index-8VAf9i7P2.js";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/source/plugins/status-badges.d.ts
@@ -7,6 +7,7 @@ import { z } from "zod";
7
7
  declare const metaSchema: z.ZodObject<{
8
8
  title: z.ZodOptional<z.ZodString>;
9
9
  pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
+ pagesIndex: z.ZodOptional<z.ZodString>;
10
11
  description: z.ZodOptional<z.ZodString>;
11
12
  root: z.ZodOptional<z.ZodBoolean>;
12
13
  defaultOpen: z.ZodOptional<z.ZodBoolean>;
@@ -6,6 +6,8 @@ import { z } from "zod";
6
6
  const metaSchema = z.object({
7
7
  title: z.string().optional(),
8
8
  pages: z.array(z.string()).optional(),
9
+ /** specify a index page for folder */
10
+ pagesIndex: z.string().optional(),
9
11
  description: z.string().optional(),
10
12
  root: z.boolean().optional(),
11
13
  defaultOpen: z.boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.9.0",
3
+ "version": "16.9.1",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",