fumadocs-core 16.14.2 → 16.14.4

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 { t as getNegotiator } from "../negotiation-BmZGHDR5.js";
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) {
@@ -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") if (folder.index === node) delete folder.index;
336
- else {
337
- const idx = folder.children.indexOf(node);
338
- if (idx !== -1) folder.children.splice(idx, 1);
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) if (excludedPaths.has(indexPath)) delete node.index;
508
- else excludedPaths.add(indexPath);
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);
@@ -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-DwDF3yaw.js";
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-DwDF3yaw.js";
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-DwDF3yaw.js";
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
- if (src.type === "file") {
161
- const { imageSizeFromFile } = await import("../fromFile-DQPra6_l.js");
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
- const res = await fetch(src.url, { signal: typeof timeout === "number" ? AbortSignal.timeout(timeout) : void 0 });
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) if (extraInfo === "children-only") visibility = "children-only";
29
- else if ("text" in extraInfo) return extraInfo.text;
30
- else node = extraInfo.node;
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-BmZGHDR5.js";
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) if (keys.every(function(k) {
503
- return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase();
504
- })) s |= 1;
505
- else return null;
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.1/node_modules/@shikijs/transformers/dist/index.mjs
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) if (options.listUnicodeChar) output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, options.listUnicodeChar + " $1");
19
- else output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, "$1");
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-Do94q-my.js";
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,7 +1,7 @@
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-DYMsTHMa.js";
4
+ import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-fnyWR-fq.js";
5
5
  import { x as LoaderOutput, y as LoaderConfig } from "../index-ByMgvmTr2.js";
6
6
  import { DocumentData, DocumentOptions } from "flexsearch";
7
7
  //#region src/search/server/build-doc.d.ts
@@ -1,5 +1,5 @@
1
1
  import { r as SortedResult } from "../index-BM36H-xw.js";
2
- import { n as SearchAPI } from "../server-DYMsTHMa.js";
2
+ import { n as SearchAPI } from "../server-fnyWR-fq.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-Do94q-my.js";
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);
@@ -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-DYMsTHMa.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-fnyWR-fq.js";
2
2
  export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -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.
@@ -1,4 +1,4 @@
1
- import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-5zwcKTZH.js";
1
+ import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-cKlyDdAK.js";
2
2
  import { cache } from "react";
3
3
  //#region src/source/dynamic.ts
4
4
  function dynamicLoader(input, options) {
@@ -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-5zwcKTZH.js";
2
+ import { a as multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-cKlyDdAK.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.14.2",
3
+ "version": "16.14.4",
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.1",
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": "^3.3.4"
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.1",
132
- "@tanstack/react-router": "1.170.18",
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.4",
137
- "@types/node": "26.1.2",
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
- "image-size": "^2.0.2",
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.8",
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.1",
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"