@coderminer/vue-markdown 1.0.0 → 1.0.1
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.md +116 -0
- package/README.md +7 -2
- package/README.zh-CN.md +6 -3
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +0 -2
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +0 -2
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +0 -2
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +0 -2
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +0 -2
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +0 -2
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +0 -2
- package/dist/chunks/MarkdownError-C0sPs5W0.js +0 -2
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +0 -2
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +0 -2
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +0 -2
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +0 -2
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +0 -2
- package/dist/chunks/MarkdownImage-BRy76svs.js +0 -2
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +0 -2
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +0 -2
- package/dist/chunks/MarkdownList-BJ-_C71k.js +0 -2
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +0 -2
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +0 -2
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +0 -2
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +0 -2
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +0 -2
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +0 -2
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +0 -2
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +0 -2
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +0 -2
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +0 -2
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +0 -2
- package/dist/chunks/{MarkdownToc-BdOHF-Yo.js → MarkdownToc-DHWWoH6t.js} +1 -3
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +0 -2
- package/dist/chunks/{MermaidLiveEditor-W-qf3G-5.js → MermaidLiveEditor-1TKkI5bp.js} +1 -3
- package/dist/chunks/{VueSyntaxHighlighter-DyLsYMwy.js → VueSyntaxHighlighter-BWpCO-cX.js} +1 -3
- package/dist/chunks/adapters-CMwX_NEI.js +0 -2
- package/dist/chunks/{blank-line-Cb-JBP_5.js → blank-line-CKKsFeKR.js} +1 -3
- package/dist/chunks/codemirror-DyphMAEg.js +0 -2
- package/dist/chunks/config-aRYo2R8_.js +0 -2
- package/dist/chunks/context-8NfW6fxI.js +0 -2
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +0 -2
- package/dist/chunks/{export-DZQ3cUry.js → export-BrgMLgUp.js} +13 -14
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/{lib-BQiWGWpu.js → hast-util-from-html-D3e_iQ89.js} +495 -494
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/{identity-jZEhX2d5.js → identity-Bi27FKyx.js} +7 -8
- package/dist/chunks/labels-BtHiUTQI.js +0 -2
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +0 -2
- package/dist/chunks/{micromark-factory-space-Db040TnW.js → micromark-factory-space-CpXAnYUY.js} +2 -4
- package/dist/chunks/{normalize-CRYv3Wqt.js → normalize-VKfQXZiK.js} +57 -51
- package/dist/chunks/{plugin-DqkFHyny.js → plugin-YWo5uqTh.js} +1 -2
- package/dist/chunks/preset-BjaOuJUL.js +0 -2
- package/dist/chunks/{registry-DLjr93-V.js → registry-B7BfEkuy.js} +1051 -1045
- package/dist/chunks/{render-Cs8iKrgz.js → render-DAqK0w5J.js} +524 -494
- package/dist/chunks/{default-DWVS-I_8.js → rolldown-runtime-QGRDbDUS.js} +1 -5
- package/dist/chunks/{runtime-DJMnzjah.js → runtime-D95F41zG.js} +145 -117
- package/dist/chunks/security-y4EwUyAs.js +0 -2
- package/dist/chunks/{shared-DNAvZ-UY.js → shared-NjFDPmkb.js} +18 -27
- package/dist/chunks/{space-separated-tokens-CmBjEPdR.js → space-separated-tokens-1ebNqf35.js} +1 -3
- package/dist/chunks/url-D2BoivaE.js +0 -2
- package/dist/chunks/{useActiveHeading-BaGVMJnB.js → useActiveHeading-CnyGTG1u.js} +165 -122
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/MarkdownCustomTag.js +1 -1
- package/dist/components/MarkdownMath.js +1 -1
- package/dist/components/MarkdownMermaid.d.ts +3 -3
- package/dist/components/MarkdownMermaid.js +1 -1
- package/dist/components/MarkdownRenderer.d.ts +16 -19
- package/dist/components/MarkdownRenderer.js +1 -1
- package/dist/components/MarkdownToc.js +1 -1
- package/dist/components/MermaidBlock.js +1 -1
- package/dist/components/MermaidLiveEditor.js +1 -1
- package/dist/components/VueSyntaxHighlighter.js +1 -1
- package/dist/components/context.d.ts +2 -2
- package/dist/components/index.js +6 -6
- package/dist/components/types.d.ts +34 -2
- package/dist/composables/useMarkdownDocument.d.ts +2 -0
- package/dist/core/hast-nodes.d.ts +0 -3
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/normalize.d.ts +10 -0
- package/dist/core/parts.d.ts +1 -0
- package/dist/core/slugger.d.ts +7 -0
- package/dist/core/types.d.ts +3 -1
- package/dist/headless.js +8 -8
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/index.d.ts +2 -1
- package/dist/highlight/index.js +4 -3
- package/dist/highlight/shared.d.ts +0 -5
- package/dist/highlight/shiki.js +2 -3
- package/dist/html/index.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +47 -49
- package/dist/math/index.js +18 -16
- package/dist/mermaid/index.d.ts +2 -1
- package/dist/mermaid/index.js +8 -3
- package/dist/mermaid/plugin.d.ts +3 -0
- package/dist/mermaid/runtime.d.ts +3 -1
- package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
- package/dist/mermaid/sanitize-svg.d.ts +3 -0
- package/dist/mermaid/sanitize.d.ts +6 -2
- package/dist/node-components.js +6 -6
- package/dist/pipeline.js +1 -1
- package/dist/plugins.js +1 -1
- package/dist/styles/components.css +25 -0
- package/package.json +6 -3
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js.map +0 -1
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js.map +0 -1
- package/dist/chunks/MarkdownCode-B1k9tmW5.js.map +0 -1
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js.map +0 -1
- package/dist/chunks/MarkdownContent-BAK6dqo7.js.map +0 -1
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js +0 -42
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js.map +0 -1
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js.map +0 -1
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js.map +0 -1
- package/dist/chunks/MarkdownError-C0sPs5W0.js.map +0 -1
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js.map +0 -1
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js.map +0 -1
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js.map +0 -1
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js.map +0 -1
- package/dist/chunks/MarkdownHtml-66lYkvwM.js.map +0 -1
- package/dist/chunks/MarkdownImage-BRy76svs.js.map +0 -1
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js.map +0 -1
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js.map +0 -1
- package/dist/chunks/MarkdownList-BJ-_C71k.js.map +0 -1
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js.map +0 -1
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js.map +0 -1
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js.map +0 -1
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js +0 -416
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js.map +0 -1
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js.map +0 -1
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js.map +0 -1
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js.map +0 -1
- package/dist/chunks/MarkdownTable-DmBTg_CR.js.map +0 -1
- package/dist/chunks/MarkdownTableCell-eiCJe847.js.map +0 -1
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js.map +0 -1
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js.map +0 -1
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js.map +0 -1
- package/dist/chunks/MarkdownToc-BdOHF-Yo.js.map +0 -1
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js.map +0 -1
- package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js.map +0 -1
- package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js.map +0 -1
- package/dist/chunks/adapters-CMwX_NEI.js.map +0 -1
- package/dist/chunks/blank-line-Cb-JBP_5.js.map +0 -1
- package/dist/chunks/codemirror-DyphMAEg.js.map +0 -1
- package/dist/chunks/config-aRYo2R8_.js.map +0 -1
- package/dist/chunks/context-8NfW6fxI.js.map +0 -1
- package/dist/chunks/default-DWVS-I_8.js.map +0 -1
- package/dist/chunks/diagnostics-CtHoJyiX.js.map +0 -1
- package/dist/chunks/export-DZQ3cUry.js.map +0 -1
- package/dist/chunks/hast-nodes-C0bX3M5Z.js +0 -35
- package/dist/chunks/hast-nodes-C0bX3M5Z.js.map +0 -1
- package/dist/chunks/highlightjs-BEh-YwEG.js +0 -6041
- package/dist/chunks/highlightjs-BEh-YwEG.js.map +0 -1
- package/dist/chunks/identity-jZEhX2d5.js.map +0 -1
- package/dist/chunks/labels-BtHiUTQI.js.map +0 -1
- package/dist/chunks/lib-BQiWGWpu.js.map +0 -1
- package/dist/chunks/lib-LwqA_W3J.js +0 -127
- package/dist/chunks/lib-LwqA_W3J.js.map +0 -1
- package/dist/chunks/longest-streak-DZE_EqsU.js.map +0 -1
- package/dist/chunks/micromark-factory-space-Db040TnW.js.map +0 -1
- package/dist/chunks/normalize-CRYv3Wqt.js.map +0 -1
- package/dist/chunks/plugin-DqkFHyny.js.map +0 -1
- package/dist/chunks/preset-BjaOuJUL.js.map +0 -1
- package/dist/chunks/registry-DLjr93-V.js.map +0 -1
- package/dist/chunks/render-Cs8iKrgz.js.map +0 -1
- package/dist/chunks/runtime-DJMnzjah.js.map +0 -1
- package/dist/chunks/security-y4EwUyAs.js.map +0 -1
- package/dist/chunks/shared-DNAvZ-UY.js.map +0 -1
- package/dist/chunks/space-separated-tokens-CmBjEPdR.js.map +0 -1
- package/dist/chunks/url-D2BoivaE.js.map +0 -1
- package/dist/chunks/useActiveHeading-BaGVMJnB.js.map +0 -1
- package/dist/highlight/shiki.js.map +0 -1
- package/dist/html/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/math/index.js.map +0 -1
|
@@ -16,8 +16,4 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
16
16
|
value: n,
|
|
17
17
|
enumerable: !0
|
|
18
18
|
}) : o, n));
|
|
19
|
-
|
|
20
|
-
function u() {}
|
|
21
|
-
export { l as i, o as n, s as r, u as t };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=default-DWVS-I_8.js.map
|
|
19
|
+
export { s as n, l as r, o as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./asyncToGenerator-ChigusFD.js";
|
|
2
|
-
import { t } from "./lib-BQiWGWpu.js";
|
|
3
2
|
// src/mermaid/sanitize.ts
|
|
4
|
-
var
|
|
3
|
+
var t = /* @__PURE__ */ new Set([
|
|
5
4
|
"svg",
|
|
6
5
|
"g",
|
|
7
6
|
"path",
|
|
@@ -27,12 +26,12 @@ var n = /* @__PURE__ */ new Set([
|
|
|
27
26
|
"symbol",
|
|
28
27
|
"textpath",
|
|
29
28
|
"style"
|
|
30
|
-
]),
|
|
29
|
+
]), n = {
|
|
31
30
|
clippath: "clipPath",
|
|
32
31
|
lineargradient: "linearGradient",
|
|
33
32
|
radialgradient: "radialGradient",
|
|
34
33
|
textpath: "textPath"
|
|
35
|
-
},
|
|
34
|
+
}, r = {
|
|
36
35
|
id: "id",
|
|
37
36
|
class: "class",
|
|
38
37
|
d: "d",
|
|
@@ -142,7 +141,7 @@ var n = /* @__PURE__ */ new Set([
|
|
|
142
141
|
pointerevents: "pointer-events",
|
|
143
142
|
filter: "filter",
|
|
144
143
|
cursor: "cursor"
|
|
145
|
-
},
|
|
144
|
+
}, i = /* @__PURE__ */ new Set([
|
|
146
145
|
"script",
|
|
147
146
|
"foreignobject",
|
|
148
147
|
"iframe",
|
|
@@ -151,23 +150,23 @@ var n = /* @__PURE__ */ new Set([
|
|
|
151
150
|
"image",
|
|
152
151
|
"audio",
|
|
153
152
|
"video"
|
|
154
|
-
]),
|
|
153
|
+
]), a = /@import|@font-face|expression\s*\(|javascript\s*:|-moz-binding|behavior\s*:/i, o = /url\(\s*([^)]*)\)/gi, s = /* @__PURE__ */ new Set([
|
|
155
154
|
"media",
|
|
156
155
|
"supports",
|
|
157
156
|
"layer"
|
|
158
|
-
]),
|
|
159
|
-
function
|
|
157
|
+
]), c = /* @__PURE__ */ new Set(["charset", "layer"]);
|
|
158
|
+
function l(e) {
|
|
160
159
|
let t = e.trim(), n = t.charAt(0);
|
|
161
160
|
return (n === "\"" || n === "'") && t.charAt(t.length - 1) === n && (t = t.slice(1, -1).trim()), t.startsWith("#");
|
|
162
161
|
}
|
|
163
|
-
function
|
|
164
|
-
return e === "className" ? "class" : e.startsWith("data-") ? e : e.startsWith("data") && e.length > 4 && e.charAt(4) >= "A" && e.charAt(4) <= "Z" ? e.replace(/([A-Z])/g, "-$1").toLowerCase() :
|
|
162
|
+
function u(e) {
|
|
163
|
+
return e === "className" ? "class" : e.startsWith("data-") ? e : e.startsWith("data") && e.length > 4 && e.charAt(4) >= "A" && e.charAt(4) <= "Z" ? e.replace(/([A-Z])/g, "-$1").toLowerCase() : r[e.toLowerCase().replace(/[-_:]/g, "")];
|
|
165
164
|
}
|
|
166
|
-
function
|
|
165
|
+
function d(e) {
|
|
167
166
|
var t;
|
|
168
167
|
let n = {}, r = (t = e.properties) == null ? {} : t;
|
|
169
168
|
for (let e of Object.keys(r)) {
|
|
170
|
-
let t =
|
|
169
|
+
let t = u(e);
|
|
171
170
|
if (!t) continue;
|
|
172
171
|
if (t === "href" || t === "xlink:href") {
|
|
173
172
|
var i;
|
|
@@ -180,16 +179,16 @@ function f(e) {
|
|
|
180
179
|
}
|
|
181
180
|
return n;
|
|
182
181
|
}
|
|
183
|
-
function
|
|
182
|
+
function f(e) {
|
|
184
183
|
let t = "";
|
|
185
|
-
for (let n of e) n.type === "text" ? t += n.value : n.type === "element" && (t +=
|
|
184
|
+
for (let n of e) n.type === "text" ? t += n.value : n.type === "element" && (t += f(n.children));
|
|
186
185
|
return t;
|
|
187
186
|
}
|
|
188
|
-
function
|
|
187
|
+
function p(e) {
|
|
189
188
|
let t = /^@([-a-zA-Z]+)/.exec(e);
|
|
190
189
|
return t ? t[1].toLowerCase() : "";
|
|
191
190
|
}
|
|
192
|
-
function
|
|
191
|
+
function m(e) {
|
|
193
192
|
let t = 0, n = "";
|
|
194
193
|
for (let r = 0; r < e.length; r++) {
|
|
195
194
|
let i = e.charAt(r);
|
|
@@ -201,13 +200,13 @@ function h(e) {
|
|
|
201
200
|
}
|
|
202
201
|
return !1;
|
|
203
202
|
}
|
|
204
|
-
function
|
|
203
|
+
function h(e, t) {
|
|
205
204
|
let n = e.trim();
|
|
206
205
|
if (!n.startsWith(t)) return !1;
|
|
207
206
|
let r = n.charAt(t.length);
|
|
208
|
-
return r !== "" && /[a-zA-Z0-9_-]/.test(r) ? !1 : !
|
|
207
|
+
return r !== "" && /[a-zA-Z0-9_-]/.test(r) ? !1 : !m(n);
|
|
209
208
|
}
|
|
210
|
-
function
|
|
209
|
+
function g(e) {
|
|
211
210
|
let t = [], n = "", r = 0, i = "";
|
|
212
211
|
for (let a = 0; a < e.length; a++) {
|
|
213
212
|
let o = e.charAt(a);
|
|
@@ -225,7 +224,7 @@ function _(e) {
|
|
|
225
224
|
}
|
|
226
225
|
return t.push(n), t;
|
|
227
226
|
}
|
|
228
|
-
function
|
|
227
|
+
function _(e, t, n) {
|
|
229
228
|
let r = 0, i = "";
|
|
230
229
|
for (let a = t; a < n; a++) {
|
|
231
230
|
let t = e.charAt(a);
|
|
@@ -240,14 +239,14 @@ function v(e, t, n) {
|
|
|
240
239
|
}
|
|
241
240
|
return -1;
|
|
242
241
|
}
|
|
243
|
-
function
|
|
242
|
+
function v(e, t, n) {
|
|
244
243
|
if (e.startsWith("@")) {
|
|
245
|
-
let r =
|
|
246
|
-
return r.endsWith("keyframes") ? !0 :
|
|
244
|
+
let r = p(e);
|
|
245
|
+
return r.endsWith("keyframes") ? !0 : s.has(r) && y(t, n);
|
|
247
246
|
}
|
|
248
|
-
return e ?
|
|
247
|
+
return e ? g(e).every((e) => h(e, n)) : !1;
|
|
249
248
|
}
|
|
250
|
-
function
|
|
249
|
+
function y(e, t) {
|
|
251
250
|
let n = 0;
|
|
252
251
|
for (; n < e.length;) {
|
|
253
252
|
for (; n < e.length && /[\s;]/.test(e.charAt(n));) n++;
|
|
@@ -276,27 +275,27 @@ function b(e, t) {
|
|
|
276
275
|
}
|
|
277
276
|
}
|
|
278
277
|
if (i) return !1;
|
|
279
|
-
let
|
|
278
|
+
let l = e.slice(r, o === -1 ? s : o).trim();
|
|
280
279
|
if (o !== -1) {
|
|
281
|
-
let r =
|
|
282
|
-
if (r === -1 || !
|
|
280
|
+
let r = _(e, o, e.length);
|
|
281
|
+
if (r === -1 || !v(l, e.slice(o + 1, r), t)) return !1;
|
|
283
282
|
n = r + 1;
|
|
284
283
|
} else if (s !== -1) {
|
|
285
|
-
if (!
|
|
284
|
+
if (!l.startsWith("@") || !c.has(p(l))) return !1;
|
|
286
285
|
n = s + 1;
|
|
287
286
|
} else {
|
|
288
|
-
if (
|
|
287
|
+
if (l !== "") return !1;
|
|
289
288
|
break;
|
|
290
289
|
}
|
|
291
290
|
}
|
|
292
291
|
return !0;
|
|
293
292
|
}
|
|
294
|
-
function
|
|
295
|
-
if (!t || !e.trim() ||
|
|
296
|
-
let n = e.replace(
|
|
293
|
+
function b(e, t) {
|
|
294
|
+
if (!t || !e.trim() || a.test(e) || !y(e, t)) return;
|
|
295
|
+
let n = e.replace(o, (e, t) => l(t) ? e : "none");
|
|
297
296
|
return n.trim() ? n : void 0;
|
|
298
297
|
}
|
|
299
|
-
function
|
|
298
|
+
function x(e) {
|
|
300
299
|
let t = [], n = "", r = () => {
|
|
301
300
|
let e = n.replace(/\s+/g, " ").trim();
|
|
302
301
|
e && t.push(e), n = "";
|
|
@@ -317,10 +316,10 @@ function S(e) {
|
|
|
317
316
|
for (let t of e) i(t);
|
|
318
317
|
return r(), t;
|
|
319
318
|
}
|
|
320
|
-
function
|
|
321
|
-
let n =
|
|
319
|
+
function S(e, t) {
|
|
320
|
+
let n = x(e.children);
|
|
322
321
|
if (n.length === 0) return [];
|
|
323
|
-
let r =
|
|
322
|
+
let r = d(e), i = {};
|
|
324
323
|
for (let e of [
|
|
325
324
|
"x",
|
|
326
325
|
"y",
|
|
@@ -348,11 +347,11 @@ function C(e, t) {
|
|
|
348
347
|
}))
|
|
349
348
|
}];
|
|
350
349
|
}
|
|
351
|
-
function
|
|
350
|
+
function C(e, r = "", a) {
|
|
352
351
|
let o = [];
|
|
353
352
|
return e.forEach((e, s) => {
|
|
354
353
|
var c;
|
|
355
|
-
let l =
|
|
354
|
+
let l = r ? `${r}.${s}` : String(s);
|
|
356
355
|
if (e.type === "text") {
|
|
357
356
|
e.value.trim() !== "" && o.push({
|
|
358
357
|
kind: "text",
|
|
@@ -363,9 +362,9 @@ function w(e, t = "", i) {
|
|
|
363
362
|
}
|
|
364
363
|
if (e.type !== "element") return;
|
|
365
364
|
let u = e.tagName.toLowerCase();
|
|
366
|
-
if (u === "foreignobject") o.push(...
|
|
365
|
+
if (u === "foreignobject") o.push(...S(e, l));
|
|
367
366
|
else if (u === "style") {
|
|
368
|
-
let t =
|
|
367
|
+
let t = b(f(e.children), a);
|
|
369
368
|
t && o.push({
|
|
370
369
|
kind: "element",
|
|
371
370
|
key: l,
|
|
@@ -377,51 +376,51 @@ function w(e, t = "", i) {
|
|
|
377
376
|
value: t
|
|
378
377
|
}]
|
|
379
378
|
});
|
|
380
|
-
} else
|
|
379
|
+
} else i.has(u) || (t.has(u) ? o.push({
|
|
381
380
|
kind: "element",
|
|
382
381
|
key: l,
|
|
383
|
-
tag: (c =
|
|
384
|
-
attrs:
|
|
385
|
-
children:
|
|
386
|
-
}) : o.push(...
|
|
382
|
+
tag: (c = n[u]) == null ? u : c,
|
|
383
|
+
attrs: d(e),
|
|
384
|
+
children: C(e.children, l, a)
|
|
385
|
+
}) : o.push(...C(e.children, l, a)));
|
|
387
386
|
}), o;
|
|
388
387
|
}
|
|
389
|
-
function
|
|
388
|
+
function w(e) {
|
|
390
389
|
var t;
|
|
391
390
|
let n = (t = e.properties) == null ? void 0 : t.id;
|
|
392
391
|
return typeof n == "string" && n !== "" ? `#${n}` : void 0;
|
|
393
392
|
}
|
|
394
|
-
function
|
|
393
|
+
function T(e) {
|
|
395
394
|
var t;
|
|
396
395
|
let n = e.find((e) => e.kind === "element" && e.tag.toLowerCase() === "svg"), r = n == null || (t = n.attrs) == null ? void 0 : t.id;
|
|
397
396
|
return typeof r == "string" && r !== "" ? `#${r}` : void 0;
|
|
398
397
|
}
|
|
399
|
-
function
|
|
400
|
-
let
|
|
401
|
-
return
|
|
398
|
+
function E(e) {
|
|
399
|
+
let t = e.find((e) => e.type === "element" && e.tagName.toLowerCase() === "svg");
|
|
400
|
+
return t ? C([t], "", w(t)) : C(e);
|
|
402
401
|
}
|
|
403
|
-
function
|
|
402
|
+
function D(e) {
|
|
404
403
|
let t = {};
|
|
405
404
|
if (!e || typeof e != "object") return t;
|
|
406
405
|
for (let n of Object.keys(e)) {
|
|
407
|
-
let r =
|
|
406
|
+
let r = u(n);
|
|
408
407
|
if (!r) continue;
|
|
409
408
|
let i = String(e[n]);
|
|
410
409
|
r === "href" || r === "xlink:href" ? i.startsWith("#") && (t[r] = i) : t[r] = i;
|
|
411
410
|
}
|
|
412
411
|
return t;
|
|
413
412
|
}
|
|
414
|
-
function
|
|
413
|
+
function O(e) {
|
|
415
414
|
let t = "";
|
|
416
415
|
if (!Array.isArray(e)) return t;
|
|
417
|
-
for (let n of e) n.kind === "text" ? t += n.value : n.kind === "element" && (t +=
|
|
416
|
+
for (let n of e) n.kind === "text" ? t += n.value : n.kind === "element" && (t += O(n.children));
|
|
418
417
|
return t;
|
|
419
418
|
}
|
|
420
|
-
function
|
|
419
|
+
function k(e, r = "", a) {
|
|
421
420
|
let o = [];
|
|
422
421
|
return Array.isArray(e) && e.forEach((e, s) => {
|
|
423
422
|
var c;
|
|
424
|
-
let l =
|
|
423
|
+
let l = r ? `${r}.${s}` : String(s);
|
|
425
424
|
if (e.kind === "text") {
|
|
426
425
|
o.push({
|
|
427
426
|
kind: "text",
|
|
@@ -433,7 +432,7 @@ function A(e, t = "", i) {
|
|
|
433
432
|
if (e.kind !== "element" || typeof e.tag != "string") return;
|
|
434
433
|
let u = Array.isArray(e.children) ? e.children : [], d = e.tag.toLowerCase();
|
|
435
434
|
if (d === "style") {
|
|
436
|
-
let e =
|
|
435
|
+
let e = b(O(u), a);
|
|
437
436
|
e && o.push({
|
|
438
437
|
kind: "element",
|
|
439
438
|
key: l,
|
|
@@ -445,102 +444,131 @@ function A(e, t = "", i) {
|
|
|
445
444
|
value: e
|
|
446
445
|
}]
|
|
447
446
|
});
|
|
448
|
-
} else
|
|
447
|
+
} else i.has(d) || (t.has(d) ? o.push({
|
|
449
448
|
kind: "element",
|
|
450
449
|
key: l,
|
|
451
|
-
tag: (c =
|
|
452
|
-
attrs:
|
|
453
|
-
children:
|
|
454
|
-
}) : o.push(...
|
|
450
|
+
tag: (c = n[d]) == null ? d : c,
|
|
451
|
+
attrs: D(e.attrs),
|
|
452
|
+
children: k(u, l, a)
|
|
453
|
+
}) : o.push(...k(u, l, a)));
|
|
455
454
|
}), o;
|
|
456
455
|
}
|
|
456
|
+
function A(e) {
|
|
457
|
+
return k(e, "", Array.isArray(e) ? T(e) : void 0);
|
|
458
|
+
}
|
|
459
|
+
// src/mermaid/sanitize-svg-lazy.ts
|
|
457
460
|
function j(e) {
|
|
458
|
-
return
|
|
461
|
+
return M.apply(this, arguments);
|
|
462
|
+
}
|
|
463
|
+
function M() {
|
|
464
|
+
return M = e(function* (e) {
|
|
465
|
+
let { fromHtml: t } = yield import("./hast-util-from-html-D3e_iQ89.js").then((e) => e.t);
|
|
466
|
+
return E(t(e, { fragment: !0 }).children);
|
|
467
|
+
}), M.apply(this, arguments);
|
|
459
468
|
}
|
|
460
469
|
// src/mermaid/runtime.ts
|
|
461
|
-
|
|
462
|
-
|
|
470
|
+
function N() {
|
|
471
|
+
return {
|
|
472
|
+
api: void 0,
|
|
473
|
+
initializedKey: void 0,
|
|
474
|
+
queue: Promise.resolve(),
|
|
475
|
+
counter: 0
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
var P = N();
|
|
479
|
+
function F() {
|
|
463
480
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
464
481
|
}
|
|
482
|
+
function I(e) {
|
|
483
|
+
return e === "dark" || e === "auto" && F() ? "dark" : e === "custom" ? "neutral" : "default";
|
|
484
|
+
}
|
|
465
485
|
function L(e) {
|
|
466
|
-
return
|
|
486
|
+
return {
|
|
487
|
+
startOnLoad: !1,
|
|
488
|
+
securityLevel: "strict",
|
|
489
|
+
htmlLabels: !1,
|
|
490
|
+
theme: I(e),
|
|
491
|
+
fontFamily: "var(--vmd-font-sans)"
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
function R(e) {
|
|
495
|
+
return JSON.stringify(e);
|
|
467
496
|
}
|
|
468
|
-
function
|
|
469
|
-
return
|
|
497
|
+
function z(e) {
|
|
498
|
+
return B.apply(this, arguments);
|
|
470
499
|
}
|
|
471
|
-
function
|
|
472
|
-
return
|
|
473
|
-
return
|
|
500
|
+
function B() {
|
|
501
|
+
return B = e(function* (e) {
|
|
502
|
+
return e.api || (e.api = import("mermaid").then((e) => {
|
|
474
503
|
var t;
|
|
475
504
|
return (t = e.default) == null ? e : t;
|
|
476
|
-
}))
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
fontFamily: "var(--vmd-font-sans)"
|
|
490
|
-
}), N = t);
|
|
491
|
-
}), V.apply(this, arguments);
|
|
492
|
-
}
|
|
493
|
-
function H(e) {
|
|
494
|
-
return /(cannot find module|failed to resolve module|failed to fetch dynamically imported module|err_module_not_found|not installed)/i.test(e) && /mermaid/i.test(e);
|
|
505
|
+
}).catch((t) => {
|
|
506
|
+
throw e.api = void 0, t;
|
|
507
|
+
})), e.api;
|
|
508
|
+
}), B.apply(this, arguments);
|
|
509
|
+
}
|
|
510
|
+
function V(e, t, n) {
|
|
511
|
+
return H.apply(this, arguments);
|
|
512
|
+
}
|
|
513
|
+
function H() {
|
|
514
|
+
return H = e(function* (e, t, n) {
|
|
515
|
+
let r = L(n), i = R(r);
|
|
516
|
+
e.initializedKey !== i && (yield t.initialize(r), e.initializedKey = i);
|
|
517
|
+
}), H.apply(this, arguments);
|
|
495
518
|
}
|
|
496
519
|
function U(e) {
|
|
520
|
+
return /(cannot find module|failed to resolve module|failed to fetch dynamically imported module|err_module_not_found|not installed)/i.test(e) && /mermaid/i.test(e);
|
|
521
|
+
}
|
|
522
|
+
function W(e) {
|
|
497
523
|
let t = e instanceof Error ? e.message : typeof e == "string" ? e : "Mermaid rendering failed.";
|
|
498
|
-
return
|
|
524
|
+
return U(t) ? "Mermaid is not available. Install the optional `mermaid` peer dependency to render diagrams." : t;
|
|
499
525
|
}
|
|
500
|
-
function
|
|
501
|
-
return `vmd-mermaid-${
|
|
526
|
+
function G() {
|
|
527
|
+
return P.counter += 1, `vmd-mermaid-${P.counter}`;
|
|
502
528
|
}
|
|
503
|
-
function
|
|
504
|
-
return
|
|
529
|
+
function K(e) {
|
|
530
|
+
return q.apply(this, arguments);
|
|
505
531
|
}
|
|
506
|
-
function
|
|
507
|
-
return
|
|
532
|
+
function q() {
|
|
533
|
+
return q = e(function* (t, n = {}) {
|
|
508
534
|
if (typeof window > "u" || typeof DOMParser > "u") return {
|
|
509
535
|
nodes: [],
|
|
510
|
-
error: "Mermaid requires a browser environment."
|
|
536
|
+
error: "Mermaid requires a browser environment. Render it on the client after mount, or pass a pre-rendered renderer."
|
|
537
|
+
};
|
|
538
|
+
if (typeof t != "string") return {
|
|
539
|
+
nodes: [],
|
|
540
|
+
error: "Mermaid source must be a string. If you used `renderMermaid()`, await its result before passing it as the source."
|
|
511
541
|
};
|
|
512
542
|
if (!t.trim()) return {
|
|
513
543
|
nodes: [],
|
|
514
|
-
error: "Mermaid source is empty."
|
|
544
|
+
error: "Mermaid source is empty. Provide diagram text such as `graph TD; A-->B`."
|
|
515
545
|
};
|
|
516
|
-
let r = function() {
|
|
517
|
-
var
|
|
546
|
+
let r = P, i = function() {
|
|
547
|
+
var i = e(function* () {
|
|
518
548
|
try {
|
|
519
549
|
var e;
|
|
520
|
-
let
|
|
521
|
-
yield
|
|
522
|
-
let
|
|
550
|
+
let i = yield z(r);
|
|
551
|
+
yield V(r, i, n.theme);
|
|
552
|
+
let a = (e = n.id) == null ? G() : e, { svg: o } = yield i.render(a, t);
|
|
523
553
|
return {
|
|
524
|
-
svg:
|
|
525
|
-
nodes:
|
|
554
|
+
svg: o,
|
|
555
|
+
nodes: yield j(o)
|
|
526
556
|
};
|
|
527
557
|
} catch (e) {
|
|
528
558
|
return {
|
|
529
559
|
nodes: [],
|
|
530
|
-
error:
|
|
560
|
+
error: W(e)
|
|
531
561
|
};
|
|
532
562
|
}
|
|
533
563
|
});
|
|
534
564
|
return function() {
|
|
535
|
-
return
|
|
565
|
+
return i.apply(this, arguments);
|
|
536
566
|
};
|
|
537
|
-
}(),
|
|
538
|
-
return
|
|
539
|
-
}),
|
|
567
|
+
}(), a = r.queue.then(i, i);
|
|
568
|
+
return r.queue = a.catch(() => void 0), a;
|
|
569
|
+
}), q.apply(this, arguments);
|
|
540
570
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
571
|
+
function J() {
|
|
572
|
+
P.api = void 0, P.initializedKey = void 0;
|
|
543
573
|
}
|
|
544
|
-
export {
|
|
545
|
-
|
|
546
|
-
//# sourceMappingURL=runtime-DJMnzjah.js.map
|
|
574
|
+
export { t as a, j as i, K as n, E as o, J as r, A as s, G as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./objectSpread2-CtBNx0TF.js";
|
|
2
|
-
import { n as t, t as n } from "./hast-nodes-C0bX3M5Z.js";
|
|
3
2
|
// src/highlight/shared.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
3
|
+
var t = 256, n = /* @__PURE__ */ new Map();
|
|
4
|
+
function r(e, t = "") {
|
|
6
5
|
return {
|
|
7
6
|
language: t,
|
|
8
7
|
nodes: [{
|
|
@@ -12,13 +11,7 @@ function a(e, t = "") {
|
|
|
12
11
|
}]
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
return t(e);
|
|
17
|
-
}
|
|
18
|
-
function s(e) {
|
|
19
|
-
return n(e);
|
|
20
|
-
}
|
|
21
|
-
function c(e, t, n, r) {
|
|
14
|
+
function i(e, t, n, r) {
|
|
22
15
|
var i, a;
|
|
23
16
|
return [
|
|
24
17
|
e.id,
|
|
@@ -29,32 +22,32 @@ function c(e, t, n, r) {
|
|
|
29
22
|
t
|
|
30
23
|
].join("");
|
|
31
24
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
25
|
+
function a() {
|
|
26
|
+
n.clear();
|
|
34
27
|
}
|
|
35
|
-
function
|
|
28
|
+
function o(e) {
|
|
36
29
|
if (!e || typeof e != "object") return !1;
|
|
37
30
|
let t = e;
|
|
38
31
|
return typeof t.language == "string" && Array.isArray(t.nodes);
|
|
39
32
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!e) return a
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
33
|
+
function s(e, a, s, c = {}) {
|
|
34
|
+
if (!e) return r(a, s);
|
|
35
|
+
let l = i(e, a, s, c), u = n.get(l);
|
|
36
|
+
if (u) return u;
|
|
44
37
|
let d;
|
|
45
38
|
try {
|
|
46
|
-
let
|
|
47
|
-
d =
|
|
39
|
+
let t = e.highlight(a, s, c);
|
|
40
|
+
d = o(t) ? t : r(a, s);
|
|
48
41
|
} catch (e) {
|
|
49
|
-
d = a
|
|
42
|
+
d = r(a, s);
|
|
50
43
|
}
|
|
51
|
-
if (
|
|
52
|
-
let e =
|
|
53
|
-
e !== void 0 &&
|
|
44
|
+
if (n.set(l, d), n.size > t) {
|
|
45
|
+
let e = n.keys().next().value;
|
|
46
|
+
e !== void 0 && n.delete(e);
|
|
54
47
|
}
|
|
55
48
|
return d;
|
|
56
49
|
}
|
|
57
|
-
function
|
|
50
|
+
function c(t) {
|
|
58
51
|
let n = 0, r = () => `line-${n++}`, i = (t) => t.kind === "text" ? t.value.split("\n").map((e) => e === "" ? [] : [{
|
|
59
52
|
kind: "text",
|
|
60
53
|
key: r(),
|
|
@@ -71,6 +64,4 @@ function f(t) {
|
|
|
71
64
|
};
|
|
72
65
|
return a(t);
|
|
73
66
|
}
|
|
74
|
-
export {
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=shared-DNAvZ-UY.js.map
|
|
67
|
+
export { c as i, r as n, s as r, a as t };
|
package/dist/chunks/{space-separated-tokens-CmBjEPdR.js → space-separated-tokens-1ebNqf35.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e } from "./rolldown-runtime-QGRDbDUS.js";
|
|
2
2
|
// node_modules/property-information/lib/util/schema.js
|
|
3
3
|
var t = class {
|
|
4
4
|
constructor(e, t, n) {
|
|
@@ -1095,5 +1095,3 @@ function R(e) {
|
|
|
1095
1095
|
return e.join(" ").trim();
|
|
1096
1096
|
}
|
|
1097
1097
|
export { N as a, r as c, I as i, R as n, P as o, F as r, A as s, L as t };
|
|
1098
|
-
|
|
1099
|
-
//# sourceMappingURL=space-separated-tokens-CmBjEPdR.js.map
|