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.
- package/dist/breadcrumb.d.ts +1 -1
- package/dist/{definitions-Cob-Q8-8.d.ts → definitions-DQRPsvc7.d.ts} +7 -4
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +29 -5
- package/dist/i18n/middleware.d.ts +1 -1
- package/dist/{index-CKvjS08M2.d.ts → index-8VAf9i7P2.d.ts} +4 -3
- package/dist/{index-DRvW7IXg.d.ts → index-B_zmuyw1.d.ts} +1 -1
- package/dist/{index-YTOeewZk.d.ts → index-Ci-v40o3.d.ts} +4 -2
- package/dist/{index-D2f_P1Zo.d.ts → index-Doj0FeGs.d.ts} +1 -1
- package/dist/{loader-DWaWaGZg.js → loader-AC1aN-MX.js} +88 -60
- package/dist/page-tree/index.d.ts +2 -2
- package/dist/search/flexsearch.d.ts +3 -3
- package/dist/search/mixedbread.d.ts +1 -1
- package/dist/search/server.d.ts +1 -1
- package/dist/{server-BmBBtKX6.d.ts → server-CB8UVhSB.d.ts} +2 -2
- package/dist/source/client/index.d.ts +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 -0
- package/dist/source/schema.js +2 -0
- package/package.json +1 -1
package/dist/breadcrumb.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ interface ID {
|
|
|
9
9
|
}
|
|
10
10
|
interface Root extends ID {
|
|
11
11
|
/**
|
|
12
|
-
* @internal
|
|
12
|
+
* @internal folder `$ref`
|
|
13
13
|
*/
|
|
14
|
-
$ref?:
|
|
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
|
|
49
|
+
* @internal paths of meta file & folder
|
|
50
50
|
*/
|
|
51
|
-
$ref?:
|
|
51
|
+
$ref?: {
|
|
52
|
+
meta?: string;
|
|
53
|
+
folder: string;
|
|
54
|
+
};
|
|
52
55
|
type: 'folder';
|
|
53
56
|
name: ReactNode;
|
|
54
57
|
description?: ReactNode;
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/i18n/index.js
CHANGED
|
@@ -4,7 +4,11 @@ function defineI18n(config) {
|
|
|
4
4
|
...config,
|
|
5
5
|
translations() {
|
|
6
6
|
const translations = {};
|
|
7
|
-
|
|
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
|
-
|
|
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)
|
|
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))
|
|
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]
|
|
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,8 +1,8 @@
|
|
|
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-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-
|
|
5
|
-
import { n as SerializedPageTree } from "./index-
|
|
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;
|
|
@@ -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
|
|
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
|
|
79
|
+
/** add language pack */
|
|
78
80
|
preset: (preset: TranslationPreset<Namespaces>) => SingularTranslationsAPI<Namespaces>;
|
|
79
81
|
}
|
|
80
82
|
/** create translations API without i18n */
|
|
@@ -353,67 +353,77 @@ function createPageTreeBuilder(input, options) {
|
|
|
353
353
|
return id;
|
|
354
354
|
}
|
|
355
355
|
function buildPaths(paths, filter, reversed = false) {
|
|
356
|
-
const
|
|
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
|
-
|
|
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)
|
|
367
|
+
if (dirNode) nodes.push(dirNode);
|
|
368
368
|
}
|
|
369
369
|
const factor = reversed ? -1 : 1;
|
|
370
370
|
const useName = sortBy === "name";
|
|
371
|
-
return
|
|
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] ||
|
|
375
|
-
const bT = useName && b[SymbolName] ||
|
|
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
|
-
|
|
387
|
-
if (
|
|
388
|
-
|
|
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
|
-
|
|
402
|
-
if (
|
|
403
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
481
|
+
$ref: {
|
|
482
|
+
folder: folderPath,
|
|
483
|
+
meta: metaPath
|
|
484
|
+
},
|
|
470
485
|
[SymbolUnfinished]: true
|
|
471
486
|
};
|
|
472
487
|
pathToNode.set(folderPath, node);
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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
|
|
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,
|
|
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,
|
|
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:
|
|
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
|
|
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:
|
|
568
|
+
$ref: folder?.$ref,
|
|
537
569
|
$id: generateId(id),
|
|
538
|
-
name:
|
|
539
|
-
description:
|
|
540
|
-
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-
|
|
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-
|
|
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-
|
|
3
|
-
import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-
|
|
4
|
-
import { C as LoaderConfig, T as LoaderOutput } from "../index-
|
|
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-
|
|
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
|
|
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-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-
|
|
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-
|
|
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-
|
|
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 };
|
package/dist/source/dynamic.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { b as dynamicLoader, v as DynamicLoader, y as DynamicLoaderConfig } from "../index-
|
|
1
|
+
import { b as dynamicLoader, v as DynamicLoader, y as DynamicLoaderConfig } from "../index-8VAf9i7P2.js";
|
|
2
2
|
export { DynamicLoader, DynamicLoaderConfig, dynamicLoader };
|
package/dist/source/dynamic.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-
|
|
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) {
|
package/dist/source/index.d.ts
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/source/index.js
CHANGED
|
@@ -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-
|
|
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 };
|
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-8VAf9i7P2.js";
|
|
2
2
|
export { LLMsConfig, llms };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { F as slugsFromData, I as slugsPlugin, N as SlugFn, P as getSlugs } from "../../index-
|
|
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-
|
|
2
|
-
import { E as LoaderPlugin } from "../../index-
|
|
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
|
package/dist/source/schema.d.ts
CHANGED
|
@@ -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>;
|
package/dist/source/schema.js
CHANGED
|
@@ -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(),
|