@podlite/editor-react 0.0.52 → 0.0.53
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/CHANGELOG.podlite +6 -0
- package/esm/HighlightedCode.d.ts +12 -3
- package/esm/HighlightedCode.js +61 -13
- package/esm/HighlightedCode.js.map +1 -1
- package/esm/shiki.d.ts +9 -1
- package/esm/shiki.js +4 -2
- package/esm/shiki.js.map +1 -1
- package/lib/HighlightedCode.d.ts +12 -3
- package/lib/HighlightedCode.js +62 -12
- package/lib/HighlightedCode.js.map +1 -1
- package/lib/shiki.d.ts +9 -1
- package/lib/shiki.js +23 -2
- package/lib/shiki.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.podlite
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
=head1 Upcoming
|
|
4
4
|
|
|
5
|
+
=head1 0.0.53
|
|
6
|
+
|
|
7
|
+
=item C<HighlightedCode> now combines syntax highlight with inline formatting codes. When C<:allow<...>> permits fcodes inside C<=code>, B/I/C/U/K wrap their respective spans (C<<strong>>/C<<em>>/C<<code>>/C<<u>>/C<<kbd>> + C<fc-X> class) layered over shiki's syntax colors via the decorations API
|
|
8
|
+
|
|
9
|
+
=item shiki module loader uses a direct dynamic C<import('shiki')> so the bundler code-splits it into a separate chunk. Previously the loader was wrapped in C<new Function>, which is opaque to webpack and resulted in a runtime «Failed to resolve module specifier» in browser builds
|
|
10
|
+
|
|
5
11
|
=head1 0.0.51
|
|
6
12
|
|
|
7
13
|
=item highlighter recognises semantic and custom blocks in abbreviated form (C<=TITLE>, C<=NAME>, C<=SEE-ALSO>, C<=Diagram>). Previously only C<=begin>/C<=for> forms classified non-standard block names
|
package/esm/HighlightedCode.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
declare type Decoration = {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
tagName: string;
|
|
6
|
+
properties?: {
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const extractPlainAndDecorations: (nodes: unknown) => {
|
|
11
|
+
plain: string;
|
|
12
|
+
decorations: Decoration[];
|
|
13
|
+
};
|
|
2
14
|
export interface HighlightedCodeProps {
|
|
3
15
|
node: any;
|
|
4
16
|
children: React.ReactNode;
|
|
5
17
|
keyProp: string;
|
|
6
18
|
ctx: any;
|
|
7
19
|
}
|
|
8
|
-
/**
|
|
9
|
-
* This component handles async syntax highlighting
|
|
10
|
-
*/
|
|
11
20
|
declare const HighlightedCode: React.FC<HighlightedCodeProps>;
|
|
12
21
|
export default HighlightedCode;
|
package/esm/HighlightedCode.js
CHANGED
|
@@ -1,30 +1,78 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { makeAttrs } from '@podlite/schema';
|
|
3
3
|
import { codeToThemedHtml } from './shiki';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const fcodeToTag = {
|
|
5
|
+
B: 'strong',
|
|
6
|
+
I: 'em',
|
|
7
|
+
C: 'code',
|
|
8
|
+
U: 'u',
|
|
9
|
+
K: 'kbd',
|
|
10
|
+
};
|
|
11
|
+
export const extractPlainAndDecorations = (nodes) => {
|
|
12
|
+
const decorations = [];
|
|
13
|
+
let plain = '';
|
|
14
|
+
const walk = (input) => {
|
|
15
|
+
if (input == null)
|
|
16
|
+
return;
|
|
17
|
+
if (typeof input === 'string') {
|
|
18
|
+
plain += input;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(input)) {
|
|
22
|
+
for (const child of input)
|
|
23
|
+
walk(child);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const node = input;
|
|
27
|
+
if (node.type === 'text' && typeof node.value === 'string') {
|
|
28
|
+
plain += node.value;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (node.type === 'verbatim' && typeof node.value === 'string') {
|
|
32
|
+
plain += node.value;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (node.type === 'fcode' && typeof node.name === 'string') {
|
|
36
|
+
const tagName = fcodeToTag[node.name] || 'span';
|
|
37
|
+
const start = plain.length;
|
|
38
|
+
walk(node.content);
|
|
39
|
+
const end = plain.length;
|
|
40
|
+
if (end > start) {
|
|
41
|
+
decorations.push({
|
|
42
|
+
start,
|
|
43
|
+
end,
|
|
44
|
+
tagName,
|
|
45
|
+
properties: { class: `fc-${node.name}` },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (node.content !== undefined) {
|
|
51
|
+
walk(node.content);
|
|
52
|
+
}
|
|
53
|
+
else if (typeof node.text === 'string') {
|
|
54
|
+
plain += node.text;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
walk(nodes);
|
|
58
|
+
return { plain, decorations };
|
|
59
|
+
};
|
|
7
60
|
const HighlightedCode = React.memo(({ node, children, keyProp, ctx }) => {
|
|
8
61
|
const conf = makeAttrs(node, ctx);
|
|
9
62
|
const caption = conf.exists('caption') ? conf.getFirstValue('caption') : null;
|
|
10
63
|
const lang = conf.getFirstValue('lang') || 'txt';
|
|
11
|
-
// Per spec, :allow<...> is a list of fcode names recognized inside the
|
|
12
|
-
// block. Any value flips fcode parsing on, so shiki would flatten the
|
|
13
|
-
// resulting nodes to plain text. Skip highlighting and let the fallback
|
|
14
|
-
// render children with their fcode wrappers intact.
|
|
15
|
-
const allowsFormattingCodes = conf.getAllValues('allow').length > 0;
|
|
16
64
|
const [html, setHtml] = useState(null);
|
|
17
65
|
useEffect(() => {
|
|
18
|
-
if (allowsFormattingCodes)
|
|
19
|
-
return;
|
|
20
66
|
let cancelled = false;
|
|
21
67
|
const highlight = async () => {
|
|
22
68
|
try {
|
|
23
69
|
const isDark = document.body.className.toLowerCase().includes('dark');
|
|
70
|
+
const { plain, decorations } = extractPlainAndDecorations(node.content);
|
|
24
71
|
const result = await codeToThemedHtml({
|
|
25
|
-
code:
|
|
72
|
+
code: plain,
|
|
26
73
|
language: lang,
|
|
27
74
|
theme: isDark ? 'dark' : 'light',
|
|
75
|
+
decorations,
|
|
28
76
|
});
|
|
29
77
|
if (!cancelled)
|
|
30
78
|
setHtml(result);
|
|
@@ -37,7 +85,7 @@ const HighlightedCode = React.memo(({ node, children, keyProp, ctx }) => {
|
|
|
37
85
|
return () => {
|
|
38
86
|
cancelled = true;
|
|
39
87
|
};
|
|
40
|
-
}, [lang, node.content
|
|
88
|
+
}, [lang, node.content]);
|
|
41
89
|
return html ? (React.createElement(React.Fragment, null,
|
|
42
90
|
React.createElement("code", { key: keyProp, className: "shiki", dangerouslySetInnerHTML: { __html: html } }),
|
|
43
91
|
caption && React.createElement("div", { className: "caption" }, caption))) : (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedCode.js","sourceRoot":"","sources":["../src/HighlightedCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"HighlightedCode.js","sourceRoot":"","sources":["../src/HighlightedCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAS1C,MAAM,UAAU,GAA2B;IACzC,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,KAAK;CACT,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,KAAc,EACgC,EAAE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AI,EAAE,KAAK;oBACX,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;oBAChC,WAAW;iBACZ,CAAC,CAAA;gBACF,IAAI,CAAC,SAAS;oBAAE,OAAO,CAAC,MAAM,CAAC,CAAA;aAChC;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAA;aACrD;QACH,CAAC,CAAA;QAED,SAAS,EAAE,CAAA;QACX,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAExB,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ;QACE,8BAAM,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,OAAO,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI;QAClF,OAAO,IAAI,6BAAK,SAAS,EAAC,SAAS,IAAE,OAAO,CAAO,CACnD,CACJ,CAAC,CAAC,CAAC,CACF;QACE;YACE,8BAAM,GAAG,EAAE,OAAO,IAAG,QAAQ,CAAQ,CACjC;QACL,OAAO,IAAI,6BAAK,SAAS,EAAC,SAAS,IAAE,OAAO,CAAO,CACnD,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,eAAe,CAAA"}
|
package/esm/shiki.d.ts
CHANGED
|
@@ -6,9 +6,17 @@ export declare function codeToHtml({ code, language }: {
|
|
|
6
6
|
code: string;
|
|
7
7
|
language: string;
|
|
8
8
|
}): Promise<string>;
|
|
9
|
-
|
|
9
|
+
declare type DecorationItem = {
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
tagName?: string;
|
|
13
|
+
properties?: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export declare function codeToThemedHtml({ code, language, theme, decorations, }: {
|
|
10
16
|
code: string;
|
|
11
17
|
language: string;
|
|
12
18
|
theme?: 'light' | 'dark' | 'auto';
|
|
19
|
+
decorations?: DecorationItem[];
|
|
13
20
|
}): Promise<string>;
|
|
14
21
|
export declare const isLanguageLoaded: (language: ExtendedLanguage) => boolean;
|
|
22
|
+
export {};
|
package/esm/shiki.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const loadShiki =
|
|
1
|
+
const loadShiki = () => import('shiki');
|
|
2
2
|
// Configuration
|
|
3
3
|
const CONFIG = {
|
|
4
4
|
themes: {
|
|
@@ -122,18 +122,20 @@ export async function codeToHtml({ code, language }) {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
// Convert code to HTML with explicit theme selection (for runtime theme detection)
|
|
125
|
-
export async function codeToThemedHtml({ code, language, theme, }) {
|
|
125
|
+
export async function codeToThemedHtml({ code, language, theme, decorations, }) {
|
|
126
126
|
const lang = await normalizeLanguage(language);
|
|
127
127
|
const highlighter = await getHighlighter(language);
|
|
128
128
|
if (theme === 'light' || theme === 'dark') {
|
|
129
129
|
return highlighter.codeToHtml(code, {
|
|
130
130
|
lang,
|
|
131
131
|
theme: CONFIG.themes[theme],
|
|
132
|
+
decorations,
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
135
|
return highlighter.codeToHtml(code, {
|
|
135
136
|
lang,
|
|
136
137
|
themes: CONFIG.themes,
|
|
138
|
+
decorations,
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
141
|
// Check if a language is loaded (sync — only meaningful after a prior async normalize)
|
package/esm/shiki.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shiki.js","sourceRoot":"","sources":["../src/shiki.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shiki.js","sourceRoot":"","sources":["../src/shiki.tsx"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAAG,GAAyB,EAAE,CAAC,MAAM,CAAC,O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iB,CAAC,QAAQ,CAAC,CAAA;IAC9C,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;IAElD,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE;QAClC,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAA;AACJ,CAAC;AASD,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,WAAW,GAMZ;IACC,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IAC9C,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;IAElD,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EAAE;QACzC,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE;YAClC,IAAI;YACJ,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAC3B,WAAW;SACZ,CAAC,CAAA;KACH;IAED,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE;QAClC,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW;KACZ,CAAC,CAAA;AACJ,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA0B,EAAW,EAAE;IACtE,OAAO,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5C,CAAC,CAAA"}
|
package/lib/HighlightedCode.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
declare type Decoration = {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
tagName: string;
|
|
6
|
+
properties?: {
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const extractPlainAndDecorations: (nodes: unknown) => {
|
|
11
|
+
plain: string;
|
|
12
|
+
decorations: Decoration[];
|
|
13
|
+
};
|
|
2
14
|
export interface HighlightedCodeProps {
|
|
3
15
|
node: any;
|
|
4
16
|
children: React.ReactNode;
|
|
5
17
|
keyProp: string;
|
|
6
18
|
ctx: any;
|
|
7
19
|
}
|
|
8
|
-
/**
|
|
9
|
-
* This component handles async syntax highlighting
|
|
10
|
-
*/
|
|
11
20
|
declare const HighlightedCode: React.FC<HighlightedCodeProps>;
|
|
12
21
|
export default HighlightedCode;
|
package/lib/HighlightedCode.js
CHANGED
|
@@ -1,33 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractPlainAndDecorations = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
5
6
|
const schema_1 = require("@podlite/schema");
|
|
6
7
|
const shiki_1 = require("./shiki");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const fcodeToTag = {
|
|
9
|
+
B: 'strong',
|
|
10
|
+
I: 'em',
|
|
11
|
+
C: 'code',
|
|
12
|
+
U: 'u',
|
|
13
|
+
K: 'kbd',
|
|
14
|
+
};
|
|
15
|
+
const extractPlainAndDecorations = (nodes) => {
|
|
16
|
+
const decorations = [];
|
|
17
|
+
let plain = '';
|
|
18
|
+
const walk = (input) => {
|
|
19
|
+
if (input == null)
|
|
20
|
+
return;
|
|
21
|
+
if (typeof input === 'string') {
|
|
22
|
+
plain += input;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(input)) {
|
|
26
|
+
for (const child of input)
|
|
27
|
+
walk(child);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const node = input;
|
|
31
|
+
if (node.type === 'text' && typeof node.value === 'string') {
|
|
32
|
+
plain += node.value;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (node.type === 'verbatim' && typeof node.value === 'string') {
|
|
36
|
+
plain += node.value;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (node.type === 'fcode' && typeof node.name === 'string') {
|
|
40
|
+
const tagName = fcodeToTag[node.name] || 'span';
|
|
41
|
+
const start = plain.length;
|
|
42
|
+
walk(node.content);
|
|
43
|
+
const end = plain.length;
|
|
44
|
+
if (end > start) {
|
|
45
|
+
decorations.push({
|
|
46
|
+
start,
|
|
47
|
+
end,
|
|
48
|
+
tagName,
|
|
49
|
+
properties: { class: `fc-${node.name}` },
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (node.content !== undefined) {
|
|
55
|
+
walk(node.content);
|
|
56
|
+
}
|
|
57
|
+
else if (typeof node.text === 'string') {
|
|
58
|
+
plain += node.text;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
walk(nodes);
|
|
62
|
+
return { plain, decorations };
|
|
63
|
+
};
|
|
64
|
+
exports.extractPlainAndDecorations = extractPlainAndDecorations;
|
|
10
65
|
const HighlightedCode = react_1.default.memo(({ node, children, keyProp, ctx }) => {
|
|
11
66
|
const conf = (0, schema_1.makeAttrs)(node, ctx);
|
|
12
67
|
const caption = conf.exists('caption') ? conf.getFirstValue('caption') : null;
|
|
13
68
|
const lang = conf.getFirstValue('lang') || 'txt';
|
|
14
|
-
// Per spec, :allow<...> is a list of fcode names recognized inside the
|
|
15
|
-
// block. Any value flips fcode parsing on, so shiki would flatten the
|
|
16
|
-
// resulting nodes to plain text. Skip highlighting and let the fallback
|
|
17
|
-
// render children with their fcode wrappers intact.
|
|
18
|
-
const allowsFormattingCodes = conf.getAllValues('allow').length > 0;
|
|
19
69
|
const [html, setHtml] = (0, react_1.useState)(null);
|
|
20
70
|
(0, react_1.useEffect)(() => {
|
|
21
|
-
if (allowsFormattingCodes)
|
|
22
|
-
return;
|
|
23
71
|
let cancelled = false;
|
|
24
72
|
const highlight = async () => {
|
|
25
73
|
try {
|
|
26
74
|
const isDark = document.body.className.toLowerCase().includes('dark');
|
|
75
|
+
const { plain, decorations } = (0, exports.extractPlainAndDecorations)(node.content);
|
|
27
76
|
const result = await (0, shiki_1.codeToThemedHtml)({
|
|
28
|
-
code:
|
|
77
|
+
code: plain,
|
|
29
78
|
language: lang,
|
|
30
79
|
theme: isDark ? 'dark' : 'light',
|
|
80
|
+
decorations,
|
|
31
81
|
});
|
|
32
82
|
if (!cancelled)
|
|
33
83
|
setHtml(result);
|
|
@@ -40,7 +90,7 @@ const HighlightedCode = react_1.default.memo(({ node, children, keyProp, ctx })
|
|
|
40
90
|
return () => {
|
|
41
91
|
cancelled = true;
|
|
42
92
|
};
|
|
43
|
-
}, [lang, node.content
|
|
93
|
+
}, [lang, node.content]);
|
|
44
94
|
return html ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
45
95
|
react_1.default.createElement("code", { key: keyProp, className: "shiki", dangerouslySetInnerHTML: { __html: html } }),
|
|
46
96
|
caption && react_1.default.createElement("div", { className: "caption" }, caption))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightedCode.js","sourceRoot":"","sources":["../src/HighlightedCode.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HighlightedCode.js","sourceRoot":"","sources":["../src/HighlightedCode.tsx"],"names":[],"mappings":";;;;AAAA,4DAAkD;AAClD,4CAA2C;AAC3C,mCAA0C;AAS1C,MAAM,UAAU,GAA2B;IACzC,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,KAAK;CACT,CAAA;AAEM,MAAM,0BAA0B,GAAG,CACxC,KAAc,EACgC,EAAE;IAChD,MAAM,WAAW,GAAiB,EAAE,CAAA;IACpC,IAAI,KAAK,GAAG,EAAE,CAAA;IAEd,MAAM,IAA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Q,EAAE,IAAI;oBACd,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;oBAChC,WAAW;iBACZ,CAAC,CAAA;gBACF,IAAI,CAAC,SAAS;oBAAE,OAAO,CAAC,MAAM,CAAC,CAAA;aAChC;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAA;aACrD;QACH,CAAC,CAAA;QAED,SAAS,EAAE,CAAA;QACX,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAExB,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ;QACE,wCAAM,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,OAAO,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI;QAClF,OAAO,IAAI,uCAAK,SAAS,EAAC,SAAS,IAAE,OAAO,CAAO,CACnD,CACJ,CAAC,CAAC,CAAC,CACF;QACE;YACE,wCAAM,GAAG,EAAE,OAAO,IAAG,QAAQ,CAAQ,CACjC;QACL,OAAO,IAAI,uCAAK,SAAS,EAAC,SAAS,IAAE,OAAO,CAAO,CACnD,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,kBAAe,eAAe,CAAA"}
|
package/lib/shiki.d.ts
CHANGED
|
@@ -6,9 +6,17 @@ export declare function codeToHtml({ code, language }: {
|
|
|
6
6
|
code: string;
|
|
7
7
|
language: string;
|
|
8
8
|
}): Promise<string>;
|
|
9
|
-
|
|
9
|
+
declare type DecorationItem = {
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
tagName?: string;
|
|
13
|
+
properties?: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export declare function codeToThemedHtml({ code, language, theme, decorations, }: {
|
|
10
16
|
code: string;
|
|
11
17
|
language: string;
|
|
12
18
|
theme?: 'light' | 'dark' | 'auto';
|
|
19
|
+
decorations?: DecorationItem[];
|
|
13
20
|
}): Promise<string>;
|
|
14
21
|
export declare const isLanguageLoaded: (language: ExtendedLanguage) => boolean;
|
|
22
|
+
export {};
|
package/lib/shiki.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
22
|
exports.isLanguageLoaded = exports.codeToThemedHtml = exports.codeToHtml = exports.getHighlighter = exports.normalizeLanguage = void 0;
|
|
4
|
-
const loadShiki =
|
|
23
|
+
const loadShiki = () => Promise.resolve().then(() => __importStar(require('shiki')));
|
|
5
24
|
// Configuration
|
|
6
25
|
const CONFIG = {
|
|
7
26
|
themes: {
|
|
@@ -128,18 +147,20 @@ async function codeToHtml({ code, language }) {
|
|
|
128
147
|
}
|
|
129
148
|
exports.codeToHtml = codeToHtml;
|
|
130
149
|
// Convert code to HTML with explicit theme selection (for runtime theme detection)
|
|
131
|
-
async function codeToThemedHtml({ code, language, theme, }) {
|
|
150
|
+
async function codeToThemedHtml({ code, language, theme, decorations, }) {
|
|
132
151
|
const lang = await normalizeLanguage(language);
|
|
133
152
|
const highlighter = await getHighlighter(language);
|
|
134
153
|
if (theme === 'light' || theme === 'dark') {
|
|
135
154
|
return highlighter.codeToHtml(code, {
|
|
136
155
|
lang,
|
|
137
156
|
theme: CONFIG.themes[theme],
|
|
157
|
+
decorations,
|
|
138
158
|
});
|
|
139
159
|
}
|
|
140
160
|
return highlighter.codeToHtml(code, {
|
|
141
161
|
lang,
|
|
142
162
|
themes: CONFIG.themes,
|
|
163
|
+
decorations,
|
|
143
164
|
});
|
|
144
165
|
}
|
|
145
166
|
exports.codeToThemedHtml = codeToThemedHtml;
|
package/lib/shiki.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shiki.js","sourceRoot":"","sources":["../src/shiki.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shiki.js","sourceRoot":"","sources":["../src/shiki.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,SAAS,GAAG,GAAyB,EAAE,mDAAQ,OAAO,GAAC,CAAA;AAE7D,gBAAgB;AAChB,MAAM,MAAM,GAAG;IACb,MAAM,EAAE;QACN,KAAK,EAAE,WAA2B;QAClC,IAAI,EAAE,aAA6B;KACpC;IACD,gBAAgB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAsB;CAC/C,CAAA;AAKV,2BAA2B;AAC3B,MAAM,eAAe,GAAqC;IACxD,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,KAAK;IACZ,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,OAAO;IACZ,WAAW,EAAE,OAAO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