fumadocs-core 15.2.9 → 15.2.11

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,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { R as Root, N as Node } from './page-tree-BG3wP0gU.js';
2
+ import { R as Root, N as Node } from './page-tree-bSt6K__E.js';
3
3
 
4
4
  interface BreadcrumbItem {
5
5
  name: ReactNode;
@@ -19,7 +19,7 @@ function getBreadcrumbItemsFromPath(tree, path, options) {
19
19
  const { includePage = true, includeSeparator = false, includeRoot } = options;
20
20
  let items = [];
21
21
  path.forEach((item, i) => {
22
- if (item.type === "separator" && includeSeparator) {
22
+ if (item.type === "separator" && item.name && includeSeparator) {
23
23
  items.push({
24
24
  name: item.name
25
25
  });
@@ -54,16 +54,17 @@ async function getHighlighter(engineType, options) {
54
54
  const { createHighlighter } = await import("shiki");
55
55
  let highlighter = highlighters.get(engineType);
56
56
  if (!highlighter) {
57
- let engine = options.engine;
57
+ let engine;
58
58
  if (engineType === "js") {
59
59
  engine = import("shiki/engine/javascript").then(
60
60
  (res) => res.createJavaScriptRegexEngine()
61
61
  );
62
- }
63
- if (engineType === "oniguruma" || !engine) {
62
+ } else if (engineType === "oniguruma" || !options.engine) {
64
63
  engine = import("shiki/engine/oniguruma").then(
65
64
  (res) => res.createOnigurumaEngine(import("shiki/wasm"))
66
65
  );
66
+ } else {
67
+ engine = options.engine;
67
68
  }
68
69
  highlighter = createHighlighter({
69
70
  ...options,
@@ -3,7 +3,7 @@ import {
3
3
  _highlight,
4
4
  _renderHighlight,
5
5
  highlight
6
- } from "../chunk-BUCUQ3WX.js";
6
+ } from "../chunk-SRVMHXJD.js";
7
7
  import "../chunk-MLKGABMK.js";
8
8
 
9
9
  // src/highlight/client.tsx
@@ -1,4 +1,4 @@
1
- import { CodeToHastOptionsCommon, BundledLanguage, CodeOptionsMeta, Awaitable, RegexEngine, CodeOptionsThemes, ShikiTransformer } from 'shiki';
1
+ import { CodeToHastOptionsCommon, BundledLanguage, CodeOptionsMeta, Awaitable, RegexEngine, CodeOptionsThemes, ShikiTransformer, BundledHighlighterOptions, Highlighter } from 'shiki';
2
2
  import { BundledTheme } from 'shiki/themes';
3
3
  import { Components } from 'hast-util-to-jsx-runtime';
4
4
  import { ReactNode } from 'react';
@@ -10,6 +10,13 @@ type HighlightOptionsCommon = CodeToHastOptionsCommon<BundledLanguage> & CodeOpt
10
10
  };
11
11
  type HighlightOptionsThemes = CodeOptionsThemes<BundledTheme>;
12
12
  type HighlightOptions = HighlightOptionsCommon & (HighlightOptionsThemes | Record<never, never>);
13
+ /**
14
+ * Get Shiki highlighter instance of Fumadocs (mostly for internal use, don't recommend you to use it).
15
+ *
16
+ * @param engineType - engine type, the engine specified in `options` will only be effective when this is set to `custom`.
17
+ * @param options - Shiki options.
18
+ */
19
+ declare function getHighlighter(engineType: 'js' | 'oniguruma' | 'custom', options: BundledHighlighterOptions<BundledLanguage, BundledTheme>): Promise<Highlighter>;
13
20
  declare function highlight(code: string, options: HighlightOptions): Promise<ReactNode>;
14
21
 
15
- export { type HighlightOptions, type HighlightOptionsCommon, type HighlightOptionsThemes, createStyleTransformer, highlight };
22
+ export { type HighlightOptions, type HighlightOptionsCommon, type HighlightOptionsThemes, createStyleTransformer, getHighlighter, highlight };
@@ -1,9 +1,11 @@
1
1
  import {
2
2
  createStyleTransformer,
3
+ getHighlighter,
3
4
  highlight
4
- } from "../chunk-BUCUQ3WX.js";
5
+ } from "../chunk-SRVMHXJD.js";
5
6
  import "../chunk-MLKGABMK.js";
6
7
  export {
7
8
  createStyleTransformer,
9
+ getHighlighter,
8
10
  highlight
9
11
  };
@@ -10,7 +10,7 @@ import {
10
10
  createStyleTransformer,
11
11
  defaultThemes,
12
12
  getHighlighter
13
- } from "../chunk-BUCUQ3WX.js";
13
+ } from "../chunk-SRVMHXJD.js";
14
14
  import "../chunk-MLKGABMK.js";
15
15
 
16
16
  // src/mdx-plugins/index.ts
@@ -24,7 +24,7 @@ interface Item {
24
24
  interface Separator {
25
25
  $id?: string;
26
26
  type: 'separator';
27
- name: ReactNode;
27
+ name?: ReactNode;
28
28
  icon?: ReactElement;
29
29
  }
30
30
  interface Folder {
@@ -7,7 +7,7 @@ import 'mdast';
7
7
  import 'unified';
8
8
  import 'mdast-util-mdx-jsx';
9
9
  import 'react';
10
- import '../page-tree-BG3wP0gU.js';
10
+ import '../page-tree-bSt6K__E.js';
11
11
 
12
12
  type AdvancedDocument = TypedDocument<Orama<typeof advancedSchema>>;
13
13
  declare const advancedSchema: {
@@ -1,6 +1,6 @@
1
1
  export { a as TOCItemType, T as TableOfContents, g as getTableOfContents } from '../get-toc-Cr2URuiP.js';
2
- import { N as Node, I as Item, R as Root, F as Folder } from '../page-tree-BG3wP0gU.js';
3
- export { p as PageTree } from '../page-tree-BG3wP0gU.js';
2
+ import { N as Node, I as Item, R as Root, F as Folder } from '../page-tree-bSt6K__E.js';
3
+ export { p as PageTree } from '../page-tree-bSt6K__E.js';
4
4
  export { S as SortedResult } from '../types-Ch8gnVgO.js';
5
5
  import { Metadata } from 'next';
6
6
  import { NextRequest } from 'next/server';
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { I as I18nConfig } from '../config-inq6kP6y.js';
3
- import { R as Root, I as Item, F as Folder$1, S as Separator } from '../page-tree-BG3wP0gU.js';
3
+ import { R as Root, I as Item, F as Folder$1, S as Separator } from '../page-tree-bSt6K__E.js';
4
4
 
5
5
  interface FileInfo {
6
6
  /**
@@ -10,7 +10,7 @@ import {
10
10
  // src/source/page-tree-builder.ts
11
11
  var group = /^\((?<name>.+)\)$/;
12
12
  var link = /^(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/;
13
- var separator = /^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---$/;
13
+ var separator = /^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---|^---$/;
14
14
  var rest = "...";
15
15
  var restReversed = "z...a";
16
16
  var extractPrefix = "...";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "15.2.9",
3
+ "version": "15.2.11",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -79,8 +79,8 @@
79
79
  "dependencies": {
80
80
  "@formatjs/intl-localematcher": "^0.6.1",
81
81
  "@orama/orama": "^3.1.6",
82
- "@shikijs/rehype": "^3.2.2",
83
- "@shikijs/transformers": "^3.2.2",
82
+ "@shikijs/rehype": "^3.3.0",
83
+ "@shikijs/transformers": "^3.3.0",
84
84
  "github-slugger": "^2.0.0",
85
85
  "hast-util-to-estree": "^3.1.3",
86
86
  "hast-util-to-jsx-runtime": "^2.3.6",
@@ -90,33 +90,33 @@
90
90
  "remark": "^15.0.0",
91
91
  "remark-gfm": "^4.0.1",
92
92
  "scroll-into-view-if-needed": "^3.1.0",
93
- "shiki": "^3.2.2",
93
+ "shiki": "^3.3.0",
94
94
  "unist-util-visit": "^5.0.0"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@algolia/client-search": "4.24.0",
98
98
  "@mdx-js/mdx": "^3.1.0",
99
99
  "@oramacloud/client": "^2.1.4",
100
- "@tanstack/react-router": "^1.116.0",
100
+ "@tanstack/react-router": "^1.117.1",
101
101
  "@types/estree-jsx": "^1.0.5",
102
102
  "@types/hast": "^3.0.4",
103
103
  "@types/mdast": "^4.0.3",
104
104
  "@types/negotiator": "^0.6.3",
105
- "@types/node": "22.14.1",
105
+ "@types/node": "22.15.2",
106
106
  "@types/react": "^19.1.2",
107
107
  "@types/react-dom": "^19.1.2",
108
108
  "algoliasearch": "4.24.0",
109
109
  "mdast-util-mdx-jsx": "^3.2.0",
110
110
  "mdast-util-mdxjs-esm": "^2.0.1",
111
111
  "next": "^15.3.1",
112
- "react-router": "^7.5.1",
112
+ "react-router": "^7.5.2",
113
113
  "remark-mdx": "^3.1.0",
114
114
  "remark-rehype": "^11.1.2",
115
115
  "typescript": "^5.8.3",
116
116
  "unified": "^11.0.5",
117
117
  "vfile": "^6.0.3",
118
- "eslint-config-custom": "0.0.0",
119
- "tsconfig": "0.0.0"
118
+ "tsconfig": "0.0.0",
119
+ "eslint-config-custom": "0.0.0"
120
120
  },
121
121
  "peerDependencies": {
122
122
  "@oramacloud/client": "1.x.x || 2.x.x",