fumadocs-core 16.14.3 → 16.14.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/i18n/middleware.js +1 -1
- package/dist/{index-ByMgvmTr2.d.ts → index-BNgjXvXj2.d.ts} +16 -7
- package/dist/{loader-5zwcKTZH.js → loader-9mGcCnIF.js} +15 -8
- package/dist/mdx-plugins/index.js +1 -1
- package/dist/mdx-plugins/rehype-code.core.js +1 -1
- package/dist/mdx-plugins/rehype-code.js +1 -1
- package/dist/mdx-plugins/remark-image.js +3 -8
- package/dist/mdx-plugins/stringifier.js +5 -3
- package/dist/negotiation/index.js +1 -1
- package/dist/{negotiation-BmZGHDR5.js → negotiation-DAsKgSvF.js} +6 -4
- package/dist/{rehype-code.core-DwDF3yaw.js → rehype-code.core-CWlREGfK.js} +1 -1
- package/dist/{remove-markdown-Do94q-my.js → remove-markdown-DfKNMl9w.js} +4 -2
- package/dist/search/client/mixedbread.js +1 -1
- package/dist/search/flexsearch.d.ts +2 -2
- package/dist/search/mixedbread.d.ts +1 -1
- package/dist/search/mixedbread.js +1 -1
- package/dist/search/server.d.ts +1 -1
- package/dist/{server-DYMsTHMa.d.ts → server-BYa_JUH1.d.ts} +2 -2
- 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 +2 -2
- package/dist/source/plugins/slugs.js +23 -10
- package/dist/source/plugins/status-badges.d.ts +1 -1
- package/package.json +11 -12
- package/dist/dist-DrR2d46_.js +0 -808
- package/dist/fromFile-DQPra6_l.js +0 -845
package/dist/i18n/middleware.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as getNegotiator } from "../negotiation-
|
|
1
|
+
import { t as getNegotiator } from "../negotiation-DAsKgSvF.js";
|
|
2
2
|
import { NextResponse } from "next/server.js";
|
|
3
3
|
//#region ../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.7/node_modules/@formatjs/fast-memoize/index.js
|
|
4
4
|
function memoize(fn, options) {
|
|
@@ -109,13 +109,23 @@ interface PageTreeBuilder {
|
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/source/plugins/slugs.d.ts
|
|
111
111
|
/**
|
|
112
|
-
* a function to generate slugs, return `undefined` to
|
|
112
|
+
* a function to generate slugs, return `undefined` to generate default slugs.
|
|
113
|
+
*
|
|
114
|
+
* conflicting cases like `dir/index.mdx` vs `dir.mdx` are resolved after the function returns.
|
|
115
|
+
*
|
|
116
|
+
* @param next - generate the default slugs from file path (before conflict resolution).
|
|
113
117
|
*/
|
|
114
|
-
type SlugFn<S extends ContentStorage = ContentStorage> = (file: S['$inferPage']) => string[] | undefined;
|
|
118
|
+
type SlugFn<S extends ContentStorage = ContentStorage> = (file: S['$inferPage'], next: () => string[]) => string[] | undefined;
|
|
119
|
+
interface SlugsPluginOptions<S extends ContentStorage = ContentStorage> {
|
|
120
|
+
/** Slugs to prepend to every page. */
|
|
121
|
+
baseSlugs?: string[];
|
|
122
|
+
/** generate default slugs for pages */
|
|
123
|
+
slugs?: SlugFn<S>;
|
|
124
|
+
}
|
|
115
125
|
/**
|
|
116
|
-
* Generate slugs for pages if missing
|
|
126
|
+
* Generate slugs for pages if missing.
|
|
117
127
|
*/
|
|
118
|
-
declare function slugsPlugin(
|
|
128
|
+
declare function slugsPlugin(optsOrFn?: SlugsPluginOptions | SlugFn): LoaderPlugin;
|
|
119
129
|
/**
|
|
120
130
|
* Generate slugs from file data (e.g. frontmatter).
|
|
121
131
|
*
|
|
@@ -146,7 +156,7 @@ interface LoaderConfig {
|
|
|
146
156
|
meta: Meta;
|
|
147
157
|
i18n: I18nConfig | undefined;
|
|
148
158
|
}
|
|
149
|
-
interface LoaderOptions<S extends ContentStorage = ContentStorage, I18n extends I18nConfig | undefined = I18nConfig | undefined> {
|
|
159
|
+
interface LoaderOptions<S extends ContentStorage = ContentStorage, I18n extends I18nConfig | undefined = I18nConfig | undefined> extends SlugsPluginOptions<S> {
|
|
150
160
|
baseUrl: string;
|
|
151
161
|
i18n?: I18n;
|
|
152
162
|
url?: (slugs: string[], locale?: string) => string;
|
|
@@ -158,7 +168,6 @@ interface LoaderOptions<S extends ContentStorage = ContentStorage, I18n extends
|
|
|
158
168
|
typedPlugin: (plugin: LoaderPlugin<S>) => LoaderPlugin;
|
|
159
169
|
}) => LoaderPluginOption[]);
|
|
160
170
|
icon?: IconResolver;
|
|
161
|
-
slugs?: SlugFn<S>;
|
|
162
171
|
}
|
|
163
172
|
interface ResolvedLoaderConfig {
|
|
164
173
|
input: ResolvedInput;
|
|
@@ -465,4 +474,4 @@ declare function llms<C extends LoaderConfig = LoaderConfig>(loader: LoaderOutpu
|
|
|
465
474
|
indexNode(node: Node, lang?: string): string;
|
|
466
475
|
};
|
|
467
476
|
//#endregion
|
|
468
|
-
export { SlugFn as A,
|
|
477
|
+
export { SlugFn as A, ContentStorageMetaFile as B, LoaderPluginOption as C, createGetUrl as D, ResolvedLoaderConfig as E, PageTreeBuilder as F, FileSystem as H, PageTreeBuilderContext as I, PageTreeOptions as L, getSlugs as M, slugsFromData as N, loader as O, slugsPlugin as P, PageTreeTransformer as R, LoaderPlugin as S, Page as T, ContentStoragePageFile as V, InferMetaType as _, MetaData as a, LoaderOptions as b, SourceUnion as c, multiple as d, source as f, dynamicLoader as g, DynamicLoaderConfig as h, DynamicSource as i, SlugsPluginOptions as j, types_d_exports as k, StaticSource as l, DynamicLoader as m, llms as n, PageData as o, update as p, path_d_exports as r, Source as s, LLMsConfig as t, VirtualFile as u, InferPageType as v, Meta as w, LoaderOutput as x, LoaderConfig as y, ContentStorage as z };
|
|
@@ -332,10 +332,12 @@ function createPageTreeBuilder(input, options) {
|
|
|
332
332
|
}
|
|
333
333
|
if (existing.priority >= priority) return false;
|
|
334
334
|
const folder = pathToNode.get(existing.owner);
|
|
335
|
-
if (folder && folder.type === "folder")
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
335
|
+
if (folder && folder.type === "folder") {
|
|
336
|
+
if (folder.index === node) delete folder.index;
|
|
337
|
+
else {
|
|
338
|
+
const idx = folder.children.indexOf(node);
|
|
339
|
+
if (idx !== -1) folder.children.splice(idx, 1);
|
|
340
|
+
}
|
|
339
341
|
}
|
|
340
342
|
existing.owner = ownerPath;
|
|
341
343
|
existing.priority = priority;
|
|
@@ -504,8 +506,10 @@ function createPageTreeBuilder(input, options) {
|
|
|
504
506
|
const outputArray = [];
|
|
505
507
|
const excludedPaths = /* @__PURE__ */ new Set();
|
|
506
508
|
for (const item of metadata.pages) resolveFolderItem(folderPath, item, outputArray, excludedPaths);
|
|
507
|
-
if (indexPath)
|
|
508
|
-
|
|
509
|
+
if (indexPath) {
|
|
510
|
+
if (excludedPaths.has(indexPath)) delete node.index;
|
|
511
|
+
else excludedPaths.add(indexPath);
|
|
512
|
+
}
|
|
509
513
|
for (const item of outputArray) {
|
|
510
514
|
if (item !== rest && item !== restReversed) {
|
|
511
515
|
node.children.push(item);
|
|
@@ -772,7 +776,7 @@ function loader(...args) {
|
|
|
772
776
|
}
|
|
773
777
|
};
|
|
774
778
|
}
|
|
775
|
-
function resolveConfig(input, { slugs, icon, plugins = [], baseUrl, url, ...base }) {
|
|
779
|
+
function resolveConfig(input, { slugs, baseSlugs, icon, plugins = [], baseUrl, url, ...base }) {
|
|
776
780
|
let config = {
|
|
777
781
|
...base,
|
|
778
782
|
url: url ? (...args) => normalizeUrl(url(...args)) : createGetUrl(baseUrl, base.i18n),
|
|
@@ -780,7 +784,10 @@ function resolveConfig(input, { slugs, icon, plugins = [], baseUrl, url, ...base
|
|
|
780
784
|
plugins: buildPlugins([
|
|
781
785
|
icon && iconPlugin(icon),
|
|
782
786
|
...typeof plugins === "function" ? plugins({ typedPlugin: (plugin) => plugin }) : plugins,
|
|
783
|
-
slugsPlugin(
|
|
787
|
+
slugsPlugin({
|
|
788
|
+
slugs,
|
|
789
|
+
baseSlugs
|
|
790
|
+
})
|
|
784
791
|
])
|
|
785
792
|
};
|
|
786
793
|
for (const plugin of config.plugins) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { remarkHeading } from "./remark-heading.js";
|
|
2
2
|
import { generateCodeBlockTabs, parseCodeBlockAttributes } from "./codeblock-utils.js";
|
|
3
3
|
import { remarkGfm } from "./remark-gfm.js";
|
|
4
|
-
import { r as transformerTab } from "../rehype-code.core-
|
|
4
|
+
import { r as transformerTab } from "../rehype-code.core-CWlREGfK.js";
|
|
5
5
|
import { transformerIcon } from "./transformer-icon.js";
|
|
6
6
|
import { rehypeCode, rehypeCodeDefaultOptions } from "./rehype-code.js";
|
|
7
7
|
import { remarkImage } from "./remark-image.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as rehypeCodeDefaultOptions, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-
|
|
1
|
+
import { n as rehypeCodeDefaultOptions, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-CWlREGfK.js";
|
|
2
2
|
import { transformerIcon } from "./transformer-icon.js";
|
|
3
3
|
export { createRehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultShikiFactory, wasmShikiFactory } from "../highlight/shiki/full.js";
|
|
2
|
-
import { n as rehypeCodeDefaultOptions$1, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-
|
|
2
|
+
import { n as rehypeCodeDefaultOptions$1, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-CWlREGfK.js";
|
|
3
3
|
import { transformerIcon } from "./transformer-icon.js";
|
|
4
4
|
//#region src/mdx-plugins/rehype-code.ts
|
|
5
5
|
const rehypeCodeDefaultOptions = {
|
|
@@ -157,16 +157,11 @@ function parseSrc(src, publicDir, dir) {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
async function getImageSize(src, onExternal) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return imageSizeFromFile(src.file);
|
|
163
|
-
}
|
|
160
|
+
const { probe } = await import("@fumari/image-size");
|
|
161
|
+
if (src.type === "file") return probe(src.file);
|
|
164
162
|
if (onExternal === false) return;
|
|
165
163
|
const { timeout } = typeof onExternal === "object" ? onExternal : {};
|
|
166
|
-
|
|
167
|
-
if (!res.ok) throw new Error(`[Remark Image] Failed to fetch ${src.url} (${res.status}): ${await res.text()}`);
|
|
168
|
-
const { imageSize } = await import("../dist-DrR2d46_.js");
|
|
169
|
-
return imageSize(new Uint8Array(await res.arrayBuffer()));
|
|
164
|
+
return probe(src.url, { timeout });
|
|
170
165
|
}
|
|
171
166
|
//#endregion
|
|
172
167
|
export { remarkImage };
|
|
@@ -25,9 +25,11 @@ function defaultStringifier(config = {}) {
|
|
|
25
25
|
if (v) return v;
|
|
26
26
|
}
|
|
27
27
|
const extraInfo = node.data?._stringify;
|
|
28
|
-
if (extraInfo)
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (extraInfo) {
|
|
29
|
+
if (extraInfo === "children-only") visibility = "children-only";
|
|
30
|
+
else if ("text" in extraInfo) return extraInfo.text;
|
|
31
|
+
else node = extraInfo.node;
|
|
32
|
+
}
|
|
31
33
|
if (visibility === "children-only") {
|
|
32
34
|
if (!("children" in node)) return "";
|
|
33
35
|
switch (node.type) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as isMarkdownPreferred, r as rewritePath, t as getNegotiator } from "../negotiation-
|
|
1
|
+
import { n as isMarkdownPreferred, r as rewritePath, t as getNegotiator } from "../negotiation-DAsKgSvF.js";
|
|
2
2
|
export { getNegotiator, isMarkdownPreferred, rewritePath };
|
|
@@ -499,10 +499,12 @@ var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
499
499
|
if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) s |= 2;
|
|
500
500
|
else if (spec.subtype != "*") return null;
|
|
501
501
|
var keys = Object.keys(spec.params);
|
|
502
|
-
if (keys.length > 0)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
502
|
+
if (keys.length > 0) {
|
|
503
|
+
if (keys.every(function(k) {
|
|
504
|
+
return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase();
|
|
505
|
+
})) s |= 1;
|
|
506
|
+
else return null;
|
|
507
|
+
}
|
|
506
508
|
return {
|
|
507
509
|
i: index,
|
|
508
510
|
o: spec.i,
|
|
@@ -115,7 +115,7 @@ function transformerAddLanguage(lang) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
//#endregion
|
|
118
|
-
//#region ../../node_modules/.pnpm/@shikijs+transformers@4.4.
|
|
118
|
+
//#region ../../node_modules/.pnpm/@shikijs+transformers@4.4.3/node_modules/@shikijs/transformers/dist/index.mjs
|
|
119
119
|
const RE_SPLIT_COMMENT = /(\s+\/\/)/;
|
|
120
120
|
const RE_V1_END_COMMENT_PREFIX = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/;
|
|
121
121
|
const RE_V3_END_COMMENT_PREFIX = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/;
|
|
@@ -15,8 +15,10 @@ var require_remove_markdown = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
15
15
|
var output = md || "";
|
|
16
16
|
output = output.replace(/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/gm, "");
|
|
17
17
|
try {
|
|
18
|
-
if (options.stripListLeaders)
|
|
19
|
-
|
|
18
|
+
if (options.stripListLeaders) {
|
|
19
|
+
if (options.listUnicodeChar) output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, options.listUnicodeChar + " $1");
|
|
20
|
+
else output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, "$1");
|
|
21
|
+
}
|
|
20
22
|
if (options.gfm) output = output.replace(/\n={2,}/g, "\n").replace(/~{3}.*\n/g, "").replace(/~~/g, "").replace(/```(?:.*)\n([\s\S]*?)```/g, (_, code) => code.trim());
|
|
21
23
|
if (options.abbr) output = output.replace(/\*\[.*\]:.*\n/, "");
|
|
22
24
|
let htmlReplaceRegex = /<[^>]*>/g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __toESM } from "../../rolldown-runtime-DC62tzP2.js";
|
|
2
|
-
import { t as require_remove_markdown } from "../../remove-markdown-
|
|
2
|
+
import { t as require_remove_markdown } from "../../remove-markdown-DfKNMl9w.js";
|
|
3
3
|
import Slugger from "github-slugger";
|
|
4
4
|
//#region src/search/client/mixedbread.ts
|
|
5
5
|
var import_remove_markdown = /* @__PURE__ */ __toESM(require_remove_markdown(), 1);
|
|
@@ -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 { x as LoaderOutput, y as LoaderConfig } from "../index-
|
|
4
|
+
import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-BYa_JUH1.js";
|
|
5
|
+
import { x as LoaderOutput, y as LoaderConfig } from "../index-BNgjXvXj2.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 { r as SortedResult } from "../index-BM36H-xw.js";
|
|
2
|
-
import { n as SearchAPI } from "../server-
|
|
2
|
+
import { n as SearchAPI } from "../server-BYa_JUH1.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,6 +1,6 @@
|
|
|
1
1
|
import { r as __toESM } from "../rolldown-runtime-DC62tzP2.js";
|
|
2
2
|
import { t as createEndpoint } from "../endpoint-MyoBU5IC.js";
|
|
3
|
-
import { t as require_remove_markdown } from "../remove-markdown-
|
|
3
|
+
import { t as require_remove_markdown } from "../remove-markdown-DfKNMl9w.js";
|
|
4
4
|
import Slugger from "github-slugger";
|
|
5
5
|
//#region src/search/mixedbread.ts
|
|
6
6
|
var import_remove_markdown = /* @__PURE__ */ __toESM(require_remove_markdown(), 1);
|
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-BYa_JUH1.js";
|
|
2
2
|
export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
|
|
@@ -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 { x as LoaderOutput, y as LoaderConfig } from "./index-
|
|
5
|
+
import { x as LoaderOutput, y as LoaderConfig } from "./index-BNgjXvXj2.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>>;
|
|
@@ -49,7 +49,7 @@ interface SharedIndex {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/search/zbsearch/create-server.d.ts
|
|
52
|
-
type CreateInput = Parameters<typeof create>[0]
|
|
52
|
+
type CreateInput = NonNullable<Parameters<typeof create>[0]>;
|
|
53
53
|
interface SharedOptions extends Pick<CreateInput, 'sort' | 'components' | 'plugins'> {
|
|
54
54
|
/**
|
|
55
55
|
* Tokenizer language.
|
package/dist/source/dynamic.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { g as dynamicLoader, h as DynamicLoaderConfig, m as DynamicLoader } from "../index-
|
|
1
|
+
import { g as dynamicLoader, h as DynamicLoaderConfig, m as DynamicLoader } from "../index-BNgjXvXj2.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-9mGcCnIF.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 { B as
|
|
1
|
+
import { B as ContentStorageMetaFile, C as LoaderPluginOption, D as createGetUrl, E as ResolvedLoaderConfig, F as PageTreeBuilder, H as FileSystem, I as PageTreeBuilderContext, L as PageTreeOptions, M as getSlugs, O as loader, R as PageTreeTransformer, S as LoaderPlugin, T as Page, V as ContentStoragePageFile, _ as InferMetaType, a as MetaData, b as LoaderOptions, c as SourceUnion, d as multiple, f as source, i as DynamicSource, k as types_d_exports, l as StaticSource, n as llms, o as PageData, p as update, r as path_d_exports, s as Source, t as LLMsConfig, u as VirtualFile, v as InferPageType, w as Meta, x as LoaderOutput, y as LoaderConfig, z as ContentStorage } from "../index-BNgjXvXj2.js";
|
|
2
2
|
export { type ContentStorage, type ContentStorageMetaFile, type ContentStoragePageFile, 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, getSlugs, llms, loader, multiple, source, 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 multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-
|
|
2
|
+
import { a as multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-9mGcCnIF.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, 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-BNgjXvXj2.js";
|
|
2
2
|
export { LLMsConfig, llms };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as SlugFn, M as
|
|
2
|
-
export { SlugFn, getSlugs, slugsFromData, slugsPlugin };
|
|
1
|
+
import { A as SlugFn, M as getSlugs, N as slugsFromData, P as slugsPlugin, j as SlugsPluginOptions } from "../../index-BNgjXvXj2.js";
|
|
2
|
+
export { SlugFn, SlugsPluginOptions, getSlugs, slugsFromData, slugsPlugin };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { n as dirname, r as extname, t as basename } from "../../path-1H5VzYiT.js";
|
|
2
2
|
//#region src/source/plugins/slugs.ts
|
|
3
3
|
/**
|
|
4
|
-
* Generate slugs for pages if missing
|
|
4
|
+
* Generate slugs for pages if missing.
|
|
5
5
|
*/
|
|
6
|
-
function slugsPlugin(
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function slugsPlugin(optsOrFn = {}) {
|
|
7
|
+
const prepended = /* @__PURE__ */ new WeakSet();
|
|
8
|
+
const { baseSlugs = [], slugs: slugFn } = typeof optsOrFn === "function" ? { slugs: optsOrFn } : optsOrFn;
|
|
9
|
+
function generateSlugs(path, file) {
|
|
10
|
+
const out = slugFn?.(file, () => getSlugs(path)) ?? getSlugs(path);
|
|
11
|
+
prepended.add(file);
|
|
12
|
+
return baseSlugs.length > 0 ? [...baseSlugs, ...out] : out;
|
|
9
13
|
}
|
|
10
14
|
return {
|
|
11
15
|
name: "fumadocs:slugs",
|
|
@@ -14,13 +18,19 @@ function slugsPlugin(slugFn) {
|
|
|
14
18
|
const taken = /* @__PURE__ */ new Set();
|
|
15
19
|
for (const path of storage.getFiles()) {
|
|
16
20
|
const file = storage.read(path);
|
|
17
|
-
if (!file || file.format !== "page"
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
if (!file || file.format !== "page") continue;
|
|
22
|
+
if (file.slugs) {
|
|
23
|
+
if (baseSlugs.length > 0 && !prepended.has(file)) {
|
|
24
|
+
file.slugs = [...baseSlugs, ...file.slugs];
|
|
25
|
+
prepended.add(file);
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (basename(path, extname(path)) === "index") {
|
|
20
30
|
indexFiles.push(path);
|
|
21
31
|
continue;
|
|
22
32
|
}
|
|
23
|
-
file.slugs =
|
|
33
|
+
file.slugs = generateSlugs(path, file);
|
|
24
34
|
const key = file.slugs.join("/");
|
|
25
35
|
if (taken.has(key)) throw new Error(`Duplicated slugs: ${key}`);
|
|
26
36
|
taken.add(key);
|
|
@@ -28,8 +38,11 @@ function slugsPlugin(slugFn) {
|
|
|
28
38
|
for (const path of indexFiles) {
|
|
29
39
|
const file = storage.read(path);
|
|
30
40
|
if (file?.format !== "page") continue;
|
|
31
|
-
file.slugs =
|
|
32
|
-
if (taken.has(file.slugs.join("/"))) file.slugs.
|
|
41
|
+
file.slugs = generateSlugs(path, file);
|
|
42
|
+
if (taken.has(file.slugs.join("/"))) file.slugs = [...file.slugs, "index"];
|
|
43
|
+
const key = file.slugs.join("/");
|
|
44
|
+
if (taken.has(key)) throw new Error(`Duplicated slugs: ${key}`);
|
|
45
|
+
taken.add(key);
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
48
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-D8-KI7Uy.js";
|
|
2
|
-
import { S as LoaderPlugin } from "../../index-
|
|
2
|
+
import { S as LoaderPlugin } from "../../index-BNgjXvXj2.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "16.14.
|
|
3
|
+
"version": "16.14.5",
|
|
4
4
|
"description": "The React.js library for building a documentation website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -114,13 +114,14 @@
|
|
|
114
114
|
"remark-gfm": "^4.0.1",
|
|
115
115
|
"remark-rehype": "^11.1.2",
|
|
116
116
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
117
|
-
"shiki": "^4.4.
|
|
117
|
+
"shiki": "^4.4.3",
|
|
118
118
|
"tinyglobby": "^0.2.17",
|
|
119
119
|
"unified": "^11.0.5",
|
|
120
120
|
"unist-util-visit": "^5.1.0",
|
|
121
121
|
"vfile": "^6.0.3",
|
|
122
122
|
"yaml": "^2.9.0",
|
|
123
|
-
"zbsearch": "^
|
|
123
|
+
"zbsearch": "^4.0.0",
|
|
124
|
+
"@fumari/image-size": "^0.1.0"
|
|
124
125
|
},
|
|
125
126
|
"devDependencies": {
|
|
126
127
|
"@formatjs/intl-localematcher": "^0.8.13",
|
|
@@ -128,19 +129,18 @@
|
|
|
128
129
|
"@mixedbread/sdk": "0.77.0",
|
|
129
130
|
"@orama/core": "^1.2.19",
|
|
130
131
|
"@oramacloud/client": "^2.1.4",
|
|
131
|
-
"@shikijs/transformers": "^4.4.
|
|
132
|
-
"@tanstack/react-router": "1.170.
|
|
132
|
+
"@shikijs/transformers": "^4.4.3",
|
|
133
|
+
"@tanstack/react-router": "1.170.27",
|
|
133
134
|
"@types/estree-jsx": "^1.0.5",
|
|
134
135
|
"@types/hast": "^3.0.5",
|
|
135
136
|
"@types/mdast": "^4.0.4",
|
|
136
|
-
"@types/negotiator": "^0.6.
|
|
137
|
-
"@types/node": "26.
|
|
137
|
+
"@types/negotiator": "^0.6.5",
|
|
138
|
+
"@types/node": "26.2.0",
|
|
138
139
|
"@types/react": "^19.2.18",
|
|
139
140
|
"@types/react-dom": "^19.2.4",
|
|
140
141
|
"algoliasearch": "5.56.0",
|
|
141
142
|
"flexsearch": "^0.8.212",
|
|
142
|
-
"
|
|
143
|
-
"lucide-react": "^1.28.0",
|
|
143
|
+
"lucide-react": "^1.31.0",
|
|
144
144
|
"negotiator": "^1.0.0",
|
|
145
145
|
"next": "16.3.0",
|
|
146
146
|
"path-to-regexp": "^8.4.2",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"remove-markdown": "^0.6.4",
|
|
151
151
|
"tsdown": "0.22.14",
|
|
152
152
|
"typescript": "^6.0.3",
|
|
153
|
-
"waku": "1.0.0-beta.
|
|
153
|
+
"waku": "1.0.0-beta.9",
|
|
154
154
|
"zod": "4.4.3",
|
|
155
155
|
"tsconfig": "0.0.0"
|
|
156
156
|
},
|
|
@@ -233,8 +233,7 @@
|
|
|
233
233
|
"inlinedDependencies": {
|
|
234
234
|
"@formatjs/fast-memoize": "3.1.7",
|
|
235
235
|
"@formatjs/intl-localematcher": "0.8.13",
|
|
236
|
-
"@shikijs/transformers": "4.4.
|
|
237
|
-
"image-size": "2.0.2",
|
|
236
|
+
"@shikijs/transformers": "4.4.3",
|
|
238
237
|
"negotiator": "1.0.0",
|
|
239
238
|
"path-to-regexp": "8.4.2",
|
|
240
239
|
"remove-markdown": "0.6.4"
|