fumadocs-core 15.7.7 → 15.7.9
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/{chunk-5SU2O5AS.js → chunk-H2GMUTQG.js} +3 -1
- package/dist/{chunk-NJLFLPV4.js → chunk-HN2NUUD2.js} +3 -2
- package/dist/dynamic-link.js +1 -1
- package/dist/highlight/client.d.ts +1 -0
- package/dist/highlight/client.js +1 -1
- package/dist/highlight/index.d.ts +3 -1
- package/dist/highlight/index.js +5 -3
- package/dist/i18n/index.server.js +3 -3
- package/dist/link.js +1 -1
- package/dist/mdx-plugins/index.d.ts +2 -2
- package/dist/mdx-plugins/index.js +2 -2
- package/package.json +9 -1
|
@@ -8,7 +8,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
var Link2 = forwardRef(
|
|
9
9
|
({
|
|
10
10
|
href = "#",
|
|
11
|
-
|
|
11
|
+
// any protocol
|
|
12
|
+
external = href.match(/^\w+:/) || // protocol relative URL
|
|
13
|
+
href.startsWith("//"),
|
|
12
14
|
prefetch,
|
|
13
15
|
...props
|
|
14
16
|
}, ref) => {
|
|
@@ -7,7 +7,7 @@ var defaultThemes = {
|
|
|
7
7
|
dark: "github-dark"
|
|
8
8
|
};
|
|
9
9
|
var highlighters = /* @__PURE__ */ new Map();
|
|
10
|
-
async function
|
|
10
|
+
async function highlightHast(code, options) {
|
|
11
11
|
const {
|
|
12
12
|
lang: initialLang,
|
|
13
13
|
fallbackLanguage,
|
|
@@ -101,11 +101,12 @@ async function getHighlighter(engineType, options) {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
async function highlight(code, options) {
|
|
104
|
-
return _renderHighlight(await
|
|
104
|
+
return _renderHighlight(await highlightHast(code, options), options);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export {
|
|
108
108
|
defaultThemes,
|
|
109
|
+
highlightHast,
|
|
109
110
|
getHighlighter,
|
|
110
111
|
highlight
|
|
111
112
|
};
|
package/dist/dynamic-link.js
CHANGED
package/dist/highlight/client.js
CHANGED
|
@@ -2,6 +2,7 @@ import { CodeToHastOptionsCommon, BundledLanguage, CodeOptionsMeta, Awaitable, R
|
|
|
2
2
|
import { BundledTheme } from 'shiki/themes';
|
|
3
3
|
import { Components } from 'hast-util-to-jsx-runtime';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
+
import { Root } from 'hast';
|
|
5
6
|
|
|
6
7
|
type HighlightOptionsCommon = CodeToHastOptionsCommon<BundledLanguage> & CodeOptionsMeta & {
|
|
7
8
|
engine?: 'js' | 'oniguruma' | Awaitable<RegexEngine>;
|
|
@@ -10,6 +11,7 @@ type HighlightOptionsCommon = CodeToHastOptionsCommon<BundledLanguage> & CodeOpt
|
|
|
10
11
|
};
|
|
11
12
|
type HighlightOptionsThemes = CodeOptionsThemes<BundledTheme>;
|
|
12
13
|
type HighlightOptions = HighlightOptionsCommon & (HighlightOptionsThemes | Record<never, never>);
|
|
14
|
+
declare function highlightHast(code: string, options: HighlightOptions): Promise<Root>;
|
|
13
15
|
/**
|
|
14
16
|
* Get Shiki highlighter instance of Fumadocs (mostly for internal use, don't recommend you to use it).
|
|
15
17
|
*
|
|
@@ -19,4 +21,4 @@ type HighlightOptions = HighlightOptionsCommon & (HighlightOptionsThemes | Recor
|
|
|
19
21
|
declare function getHighlighter(engineType: 'js' | 'oniguruma' | 'custom', options: BundledHighlighterOptions<BundledLanguage, BundledTheme>): Promise<Highlighter>;
|
|
20
22
|
declare function highlight(code: string, options: HighlightOptions): Promise<ReactNode>;
|
|
21
23
|
|
|
22
|
-
export { type HighlightOptions, type HighlightOptionsCommon, type HighlightOptionsThemes, getHighlighter, highlight };
|
|
24
|
+
export { type HighlightOptions, type HighlightOptionsCommon, type HighlightOptionsThemes, getHighlighter, highlight, highlightHast };
|
package/dist/highlight/index.js
CHANGED
package/dist/link.js
CHANGED
|
@@ -8,11 +8,11 @@ export { a as StructureOptions, S as StructuredData, r as remarkStructure, s as
|
|
|
8
8
|
export { a as RemarkCodeTabOptions, R as RemarkHeadingOptions, b as remarkCodeTab, r as remarkHeading } from '../remark-code-tab-DmyIyi6m.js';
|
|
9
9
|
import { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type CodeBlockIcon = {
|
|
12
12
|
viewBox: string;
|
|
13
13
|
fill: string;
|
|
14
14
|
d: string;
|
|
15
|
-
}
|
|
15
|
+
} | string;
|
|
16
16
|
interface IconOptions {
|
|
17
17
|
shortcuts?: Record<string, string>;
|
|
18
18
|
extend?: Record<string, CodeBlockIcon>;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
defaultThemes,
|
|
7
7
|
getHighlighter
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-HN2NUUD2.js";
|
|
9
9
|
import "../chunk-JSBRDJBE.js";
|
|
10
10
|
|
|
11
11
|
// src/mdx-plugins/index.ts
|
|
@@ -161,7 +161,7 @@ function transformerIcon(options = {}) {
|
|
|
161
161
|
const iconName = lang in shortcuts ? shortcuts[lang] : lang;
|
|
162
162
|
const icon = iconName in icons ? icons[iconName] : defaultIcon;
|
|
163
163
|
if (icon) {
|
|
164
|
-
pre.properties.icon = `<svg viewBox="${icon.viewBox}"><path d="${icon.d}" fill="${icon.fill}" /></svg>`;
|
|
164
|
+
pre.properties.icon = typeof icon === "string" ? icon : `<svg viewBox="${icon.viewBox}"><path d="${icon.d}" fill="${icon.fill}" /></svg>`;
|
|
165
165
|
}
|
|
166
166
|
return pre;
|
|
167
167
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "15.7.
|
|
3
|
+
"version": "15.7.9",
|
|
4
4
|
"description": "The library for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -142,6 +142,8 @@
|
|
|
142
142
|
"next": "14.x.x || 15.x.x",
|
|
143
143
|
"react": "18.x.x || 19.x.x",
|
|
144
144
|
"react-dom": "18.x.x || 19.x.x",
|
|
145
|
+
"waku": "^0.26.0",
|
|
146
|
+
"@tanstack/react-router": "1.x.x",
|
|
145
147
|
"react-router": "7.x.x"
|
|
146
148
|
},
|
|
147
149
|
"peerDependenciesMeta": {
|
|
@@ -168,6 +170,12 @@
|
|
|
168
170
|
},
|
|
169
171
|
"react-router": {
|
|
170
172
|
"optional": true
|
|
173
|
+
},
|
|
174
|
+
"waku": {
|
|
175
|
+
"optional": true
|
|
176
|
+
},
|
|
177
|
+
"@tanstack/react-router": {
|
|
178
|
+
"optional": true
|
|
171
179
|
}
|
|
172
180
|
},
|
|
173
181
|
"publishConfig": {
|