fumadocs-core 12.0.2 → 12.0.3

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 "./chunk-UWTMEZUM.js";
1
+ import "./chunk-CWMXXUWU.js";
2
2
 
3
3
  // src/breadcrumb.tsx
4
4
  import { useMemo } from "react";
@@ -2,7 +2,7 @@ import {
2
2
  __objRest,
3
3
  __spreadProps,
4
4
  __spreadValues
5
- } from "./chunk-UWTMEZUM.js";
5
+ } from "./chunk-CWMXXUWU.js";
6
6
 
7
7
  // src/link.tsx
8
8
  import Original from "next/link";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Link
4
- } from "./chunk-2BP57A6C.js";
4
+ } from "./chunk-XB7CNOKH.js";
5
5
  import {
6
6
  __objRest,
7
7
  __spreadValues
8
- } from "./chunk-UWTMEZUM.js";
8
+ } from "./chunk-CWMXXUWU.js";
9
9
 
10
10
  // src/dynamic-link.tsx
11
11
  import { useParams } from "next/navigation";
package/dist/link.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Link
3
- } from "./chunk-2BP57A6C.js";
4
- import "./chunk-UWTMEZUM.js";
3
+ } from "./chunk-XB7CNOKH.js";
4
+ import "./chunk-CWMXXUWU.js";
5
5
  export {
6
6
  Link as default
7
7
  };
@@ -27,6 +27,7 @@ type RehypeCodeOptions = RehypeShikiOptions & {
27
27
  * Default language
28
28
  *
29
29
  * @defaultValue plaintext
30
+ * @deprecated Use `defaultLanguage` instead
30
31
  */
31
32
  defaultLang?: string;
32
33
  /**
@@ -6,9 +6,8 @@ import {
6
6
  slash
7
7
  } from "../chunk-UWEEHUJV.js";
8
8
  import {
9
- __async,
10
9
  __spreadValues
11
- } from "../chunk-UWTMEZUM.js";
10
+ } from "../chunk-CWMXXUWU.js";
12
11
 
13
12
  // src/mdx-plugins/index.ts
14
13
  import {
@@ -22,20 +21,6 @@ import {
22
21
  transformerNotationWordHighlight
23
22
  } from "@shikijs/transformers";
24
23
 
25
- // src/mdx-plugins/hast-utils.ts
26
- function visit(node, tagNames, handler) {
27
- if (node.type === "element") {
28
- if (tagNames.includes(node.tagName)) {
29
- handler(node);
30
- return;
31
- }
32
- }
33
- if ("children" in node)
34
- node.children.forEach((n) => {
35
- visit(n, tagNames, handler);
36
- });
37
- }
38
-
39
24
  // src/mdx-plugins/transformer-icon.ts
40
25
  import { toEstree } from "hast-util-to-estree";
41
26
  var defaultShortcuts = {
@@ -287,7 +272,7 @@ var rehypeCodeDefaultOptions = {
287
272
  light: "github-light",
288
273
  dark: "github-dark"
289
274
  },
290
- defaultLang: "plaintext",
275
+ defaultLanguage: "plaintext",
291
276
  defaultColor: false,
292
277
  transformers: [
293
278
  transformerNotationHighlight(),
@@ -316,7 +301,7 @@ function rehypeCode(options = {}) {
316
301
  codeOptions.transformers || (codeOptions.transformers = []);
317
302
  codeOptions.transformers = [
318
303
  {
319
- name: "rehype-code:filter-meta",
304
+ name: "rehype-code:pre-process",
320
305
  preprocess(code, { meta }) {
321
306
  var _a;
322
307
  if (meta && codeOptions.filterMetaString) {
@@ -341,33 +326,16 @@ function rehypeCode(options = {}) {
341
326
  transformerIcon(codeOptions.icon)
342
327
  ];
343
328
  }
344
- const prefix = "language-";
345
- const transformer = rehypeShiki.call(this, codeOptions);
346
- return (root, file) => __async(this, null, function* () {
347
- visit(root, ["pre"], (element) => {
348
- var _a;
349
- const head = element.children[0];
350
- if (element.children.length === 0 || head.type !== "element" || head.tagName !== "code")
351
- return;
352
- (_a = head.properties).className || (_a.className = []);
353
- const classes = head.properties.className;
354
- if (!Array.isArray(classes)) return;
355
- const hasLanguage = classes.some(
356
- (d) => typeof d === "string" && d.startsWith(prefix)
357
- );
358
- if (!hasLanguage && codeOptions.defaultLang)
359
- classes.push(`${prefix}${codeOptions.defaultLang}`);
360
- });
361
- if (transformer)
362
- yield transformer.call(this, root, file, () => {
363
- });
364
- });
329
+ if (codeOptions.defaultLang) {
330
+ codeOptions.defaultLanguage = codeOptions.defaultLang;
331
+ }
332
+ return rehypeShiki.call(this, codeOptions);
365
333
  }
366
334
 
367
335
  // src/mdx-plugins/remark-image.ts
368
336
  import { existsSync } from "fs";
369
337
  import path from "path";
370
- import { visit as visit2 } from "unist-util-visit";
338
+ import { visit } from "unist-util-visit";
371
339
  var VALID_BLUR_EXT = [".jpeg", ".png", ".webp", ".avif", ".jpg"];
372
340
  var EXTERNAL_URL_REGEX = /^https?:\/\//;
373
341
  var PUBLIC_DIR = path.join(process.cwd(), "public");
@@ -376,7 +344,7 @@ function remarkImage({
376
344
  } = {}) {
377
345
  return (tree, _file, done) => {
378
346
  const importsToInject = [];
379
- visit2(tree, "image", (node) => {
347
+ visit(tree, "image", (node) => {
380
348
  var _a;
381
349
  let url = decodeURI(node.url);
382
350
  if (!url || EXTERNAL_URL_REGEX.test(url)) {
@@ -460,7 +428,7 @@ import Slugger from "github-slugger";
460
428
  import { remark } from "remark";
461
429
  import remarkGfm from "remark-gfm";
462
430
  import remarkMdx from "remark-mdx";
463
- import { visit as visit3 } from "unist-util-visit";
431
+ import { visit as visit2 } from "unist-util-visit";
464
432
  var slugger = new Slugger();
465
433
  function remarkStructure({
466
434
  types = ["paragraph", "blockquote", "heading"]
@@ -469,7 +437,7 @@ function remarkStructure({
469
437
  slugger.reset();
470
438
  const data = { contents: [], headings: [] };
471
439
  let lastHeading = "";
472
- visit3(node, types, (element) => {
440
+ visit2(node, types, (element) => {
473
441
  var _a, _b;
474
442
  if (element.type === "root") return;
475
443
  const content = flattenNode(element).trim();
@@ -1,4 +1,4 @@
1
- import "./chunk-UWTMEZUM.js";
1
+ import "./chunk-CWMXXUWU.js";
2
2
 
3
3
  // src/middleware.ts
4
4
  import { match as matchLocale } from "@formatjs/intl-localematcher";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __async
3
- } from "../chunk-UWTMEZUM.js";
3
+ } from "../chunk-CWMXXUWU.js";
4
4
 
5
5
  // src/search/client.ts
6
6
  import { useEffect, useState } from "react";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __spreadProps,
3
3
  __spreadValues
4
- } from "../chunk-UWTMEZUM.js";
4
+ } from "../chunk-CWMXXUWU.js";
5
5
 
6
6
  // src/search/server.ts
7
7
  import { Document } from "flexsearch";
@@ -2,7 +2,7 @@ import {
2
2
  __async,
3
3
  __objRest,
4
4
  __spreadValues
5
- } from "../chunk-UWTMEZUM.js";
5
+ } from "../chunk-CWMXXUWU.js";
6
6
 
7
7
  // src/search-algolia/client.ts
8
8
  import { useState } from "react";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __async,
3
3
  __spreadValues
4
- } from "../chunk-UWTMEZUM.js";
4
+ } from "../chunk-CWMXXUWU.js";
5
5
 
6
6
  // src/search-algolia/server.ts
7
7
  import { randomUUID } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-QRNTLL6S.js";
4
4
  import {
5
5
  __async
6
- } from "../chunk-UWTMEZUM.js";
6
+ } from "../chunk-CWMXXUWU.js";
7
7
 
8
8
  // src/server/get-toc.ts
9
9
  import { remark } from "remark";
package/dist/sidebar.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  __objRest,
3
3
  __spreadProps,
4
4
  __spreadValues
5
- } from "./chunk-UWTMEZUM.js";
5
+ } from "./chunk-CWMXXUWU.js";
6
6
 
7
7
  // src/sidebar.tsx
8
8
  import {
@@ -5,7 +5,7 @@ import {
5
5
  __export,
6
6
  __objRest,
7
7
  __spreadValues
8
- } from "../chunk-UWTMEZUM.js";
8
+ } from "../chunk-CWMXXUWU.js";
9
9
 
10
10
  // src/source/path.ts
11
11
  import { parse } from "path";
@@ -6,7 +6,7 @@ import {
6
6
  __objRest,
7
7
  __spreadProps,
8
8
  __spreadValues
9
- } from "./chunk-UWTMEZUM.js";
9
+ } from "./chunk-CWMXXUWU.js";
10
10
 
11
11
  // src/toc-internal.tsx
12
12
  import {
package/dist/toc.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  __objRest,
7
7
  __spreadProps,
8
8
  __spreadValues
9
- } from "./chunk-UWTMEZUM.js";
9
+ } from "./chunk-CWMXXUWU.js";
10
10
 
11
11
  // src/toc.tsx
12
12
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "12.0.2",
3
+ "version": "12.0.3",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -120,8 +120,8 @@
120
120
  ],
121
121
  "dependencies": {
122
122
  "@formatjs/intl-localematcher": "^0.5.4",
123
- "@shikijs/rehype": "^1.6.3",
124
- "@shikijs/transformers": "^1.6.3",
123
+ "@shikijs/rehype": "^1.6.4",
124
+ "@shikijs/transformers": "^1.6.4",
125
125
  "flexsearch": "0.7.21",
126
126
  "github-slugger": "^2.0.0",
127
127
  "hast-util-to-estree": "^3.1.0",
@@ -132,7 +132,7 @@
132
132
  "remark-gfm": "^4.0.0",
133
133
  "remark-mdx": "^3.0.1",
134
134
  "scroll-into-view-if-needed": "^3.1.0",
135
- "shiki": "^1.6.3",
135
+ "shiki": "^1.6.4",
136
136
  "swr": "^2.2.5",
137
137
  "unist-util-visit": "^5.0.0"
138
138
  },
@@ -148,7 +148,7 @@
148
148
  "@types/react": "^18.3.3",
149
149
  "@types/react-dom": "^18.3.0",
150
150
  "algoliasearch": "^4.23.3",
151
- "next": "^14.2.3",
151
+ "next": "^14.2.4",
152
152
  "unified": "^11.0.4",
153
153
  "eslint-config-custom": "0.0.0",
154
154
  "tsconfig": "0.0.0"
File without changes