@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
|
@@ -5,11 +5,11 @@ import { i } from "./adapters-CMwX_NEI.js";
|
|
|
5
5
|
import { t as a } from "./asyncToGenerator-ChigusFD.js";
|
|
6
6
|
import { r as o } from "./config-aRYo2R8_.js";
|
|
7
7
|
import { n as s, r as c } from "./context-8NfW6fxI.js";
|
|
8
|
-
import {
|
|
8
|
+
import { i as l, n as u, r as d } from "./shared-NjFDPmkb.js";
|
|
9
9
|
import { n as f, t as p } from "./MarkdownCode-B1k9tmW5.js";
|
|
10
10
|
import { t as m } from "./MarkdownBlockquote-DVXziX2t.js";
|
|
11
11
|
import { t as h } from "./MarkdownBreak-BwCi2Itt.js";
|
|
12
|
-
import { t as g } from "./MarkdownCustomTag-
|
|
12
|
+
import { t as g } from "./MarkdownCustomTag-lZJHsD6f.js";
|
|
13
13
|
import { t as _ } from "./MarkdownEmphasis-CppivOEu.js";
|
|
14
14
|
import { t as v } from "./MarkdownHeading-DaNcP0_6.js";
|
|
15
15
|
import { t as y } from "./MarkdownHorizontalRule-QNe_cuUI.js";
|
|
@@ -17,37 +17,37 @@ import { t as b } from "./MarkdownImage-BRy76svs.js";
|
|
|
17
17
|
import { t as x } from "./MarkdownInlineCode-MXZYFwex.js";
|
|
18
18
|
import { t as S } from "./MarkdownLink-Dbx3NwgV.js";
|
|
19
19
|
import { t as C } from "./MarkdownList-BJ-_C71k.js";
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as
|
|
25
|
-
import { t as
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import { t as
|
|
29
|
-
import { t as
|
|
30
|
-
import { t as
|
|
31
|
-
import { t as
|
|
32
|
-
import { computed as
|
|
20
|
+
import { i as ee, n as te, s as ne, t as re } from "./runtime-D95F41zG.js";
|
|
21
|
+
import { t as w } from "./MarkdownListItem-Z1EHIY26.js";
|
|
22
|
+
import { t as T } from "./MarkdownFootnoteReference-Dy3Khwyj.js";
|
|
23
|
+
import { t as E } from "./MarkdownFootnotes-BRPzkbXv.js";
|
|
24
|
+
import { t as D } from "./MarkdownParagraph-BxLSmSaG.js";
|
|
25
|
+
import { t as O } from "./MarkdownStrikethrough-CblvbqDk.js";
|
|
26
|
+
import { t as k } from "./MarkdownTaskItem-BcmKo1lk.js";
|
|
27
|
+
import { t as ie } from "./MarkdownStrong-uU5MzAoJ.js";
|
|
28
|
+
import { t as ae } from "./MarkdownTable-DmBTg_CR.js";
|
|
29
|
+
import { t as A } from "./MarkdownTableCell-eiCJe847.js";
|
|
30
|
+
import { t as oe } from "./MarkdownTableRow-DuJaPntg.js";
|
|
31
|
+
import { t as j } from "./MarkdownTableSection-PFHz-R33.js";
|
|
32
|
+
import { computed as M, createBlock as N, createCommentVNode as se, createElementBlock as P, createElementVNode as ce, createSlots as le, createVNode as F, defineComponent as I, guardReactiveProps as L, h as R, normalizeClass as ue, normalizeProps as z, normalizeStyle as de, onMounted as B, onScopeDispose as V, onUnmounted as fe, openBlock as H, ref as U, renderSlot as W, resolveDynamicComponent as pe, shallowRef as G, toDisplayString as me, toValue as K, unref as q, useSlots as he, watch as ge, withCtx as J } from "vue";
|
|
33
33
|
// src/composables/useCodeHighlighter.ts
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
return
|
|
37
|
-
throw
|
|
38
|
-
})),
|
|
34
|
+
var Y;
|
|
35
|
+
function _e() {
|
|
36
|
+
return Y || (Y = import("./highlightjs-BxJFpKS1.js").then((e) => e.n).then((e) => e.highlightjs).catch((e) => {
|
|
37
|
+
throw Y = void 0, e;
|
|
38
|
+
})), Y;
|
|
39
39
|
}
|
|
40
40
|
function ve(e) {
|
|
41
|
-
let r =
|
|
41
|
+
let r = M(() => {
|
|
42
42
|
var t, n;
|
|
43
|
-
return (t = (n =
|
|
44
|
-
}), i =
|
|
43
|
+
return (t = (n = K(e.theme)) == null ? K(e.contextTheme) : n) == null ? "light" : t;
|
|
44
|
+
}), i = G(u(K(e.source), K(e.language))), o = G(K(e.highlighter)), s = /* @__PURE__ */ new Set();
|
|
45
45
|
function c(t) {
|
|
46
46
|
var n;
|
|
47
47
|
let r = `${t.code}\u001f${t.message}`;
|
|
48
48
|
s.has(r) || (s.add(r), (n = e.onDiagnostic) == null || n.call(e, t));
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function l() {
|
|
51
51
|
return r.value === "dark" || r.value === "auto" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
52
52
|
}
|
|
53
53
|
let f = 0, p;
|
|
@@ -58,13 +58,13 @@ function ve(e) {
|
|
|
58
58
|
return h = a(function* () {
|
|
59
59
|
var a;
|
|
60
60
|
let s = ++f;
|
|
61
|
-
if (!((a =
|
|
62
|
-
let p =
|
|
61
|
+
if (!((a = K(e.enabled)) == null || a)) return;
|
|
62
|
+
let p = K(e.highlighter);
|
|
63
63
|
if (p && typeof p.highlight != "function" && (c(n("highlighter-invalid", "The supplied highlighter does not implement `highlight()`. Falling back to plain text.", {
|
|
64
64
|
severity: "warning",
|
|
65
65
|
phase: "render"
|
|
66
66
|
})), p = void 0), !p) try {
|
|
67
|
-
p = yield
|
|
67
|
+
p = yield _e();
|
|
68
68
|
} catch (e) {
|
|
69
69
|
c(n("highlighter-unavailable", "The default highlight.js adapter could not be loaded. Install the optional `highlight.js` peer dependency to enable syntax highlighting.", {
|
|
70
70
|
severity: "warning",
|
|
@@ -73,14 +73,14 @@ function ve(e) {
|
|
|
73
73
|
}
|
|
74
74
|
if (s !== f) return;
|
|
75
75
|
if (!p || typeof p.highlight != "function") {
|
|
76
|
-
o.value = void 0, i.value = u(
|
|
76
|
+
o.value = void 0, i.value = u(K(e.source), K(e.language));
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
o.value = p;
|
|
80
80
|
try {
|
|
81
81
|
var m, h;
|
|
82
82
|
yield (m = p.load) == null ? void 0 : m.call(p);
|
|
83
|
-
let t =
|
|
83
|
+
let t = K(e.language);
|
|
84
84
|
t && (yield (h = p.loadLanguage) == null ? void 0 : h.call(p, t));
|
|
85
85
|
} catch (e) {
|
|
86
86
|
c(n("highlighter-load", `The highlighter could not prepare this language: ${t(e)}`, {
|
|
@@ -89,39 +89,39 @@ function ve(e) {
|
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
91
91
|
if (s !== f) return;
|
|
92
|
-
let g =
|
|
93
|
-
i.value =
|
|
92
|
+
let g = K(e.source), _ = K(e.language);
|
|
93
|
+
i.value = d(p, g, _, {
|
|
94
94
|
theme: r.value,
|
|
95
|
-
colorScheme:
|
|
95
|
+
colorScheme: l()
|
|
96
96
|
});
|
|
97
97
|
}), h.apply(this, arguments);
|
|
98
98
|
}
|
|
99
99
|
function g() {
|
|
100
100
|
var t;
|
|
101
101
|
p && (clearTimeout(p), p = void 0);
|
|
102
|
-
let n = (t =
|
|
102
|
+
let n = (t = K(e.delay)) == null ? 0 : t;
|
|
103
103
|
return n > 0 ? new Promise((e) => {
|
|
104
104
|
p = setTimeout(() => {
|
|
105
105
|
p = void 0, m().then(e);
|
|
106
106
|
}, n);
|
|
107
107
|
}) : m();
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
ge(() => [K(e.source), K(e.language)], ([e, t]) => {
|
|
110
110
|
i.value = u(e, t);
|
|
111
|
-
}),
|
|
111
|
+
}), ge(() => {
|
|
112
112
|
var t;
|
|
113
113
|
return [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
K(e.source),
|
|
115
|
+
K(e.language),
|
|
116
|
+
K(e.highlighter),
|
|
117
117
|
r.value,
|
|
118
|
-
(t =
|
|
118
|
+
(t = K(e.enabled)) == null || t
|
|
119
119
|
];
|
|
120
120
|
}, () => {
|
|
121
121
|
g();
|
|
122
|
-
}), z(() => {
|
|
123
|
-
g();
|
|
124
122
|
}), B(() => {
|
|
123
|
+
g();
|
|
124
|
+
}), V(() => {
|
|
125
125
|
f += 1, p && (clearTimeout(p), p = void 0);
|
|
126
126
|
});
|
|
127
127
|
function _() {
|
|
@@ -136,7 +136,7 @@ function ve(e) {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
// src/core/highlight-lines.ts
|
|
139
|
-
function
|
|
139
|
+
function X(e) {
|
|
140
140
|
let t = /* @__PURE__ */ new Set();
|
|
141
141
|
for (let n of e == null ? [] : e) {
|
|
142
142
|
if (typeof n == "number") {
|
|
@@ -152,20 +152,20 @@ function ye(e) {
|
|
|
152
152
|
return t;
|
|
153
153
|
}
|
|
154
154
|
// src/composables/useLineWindow.ts
|
|
155
|
-
function
|
|
156
|
-
let t =
|
|
155
|
+
function ye(e) {
|
|
156
|
+
let t = M(() => l(K(e.nodes))), n = M(() => t.value.length), r = U(!1), i = U(0), a = U(0), o = U(), s = U(!1), c = M(() => X(K(e.highlightLines))), u = M(() => {
|
|
157
157
|
var t;
|
|
158
|
-
return Math.max(0, (t =
|
|
159
|
-
}),
|
|
158
|
+
return Math.max(0, (t = K(e.maxLines)) == null ? 0 : t);
|
|
159
|
+
}), d = M(() => u.value > 0 && n.value > u.value), f = M(() => d.value && !r.value), p = M(() => f.value ? Math.min(n.value, u.value) : n.value), m = M(() => {
|
|
160
160
|
var t;
|
|
161
|
-
return (t =
|
|
162
|
-
}), h =
|
|
161
|
+
return (t = K(e.virtual)) != null && t;
|
|
162
|
+
}), h = M(() => {
|
|
163
163
|
var t;
|
|
164
|
-
return (t =
|
|
165
|
-
}), g =
|
|
164
|
+
return (t = K(e.virtualThreshold)) == null ? 200 : t;
|
|
165
|
+
}), g = M(() => {
|
|
166
166
|
var t;
|
|
167
|
-
return (t =
|
|
168
|
-
}), _ =
|
|
167
|
+
return (t = K(e.lineHeight)) == null ? 20 : t;
|
|
168
|
+
}), _ = M(() => s.value && m.value && p.value >= h.value), v = M(() => _.value ? Math.max(0, Math.floor(i.value / g.value) - 4) : 0), y = M(() => _.value ? Math.min(p.value, Math.ceil((i.value + a.value) / g.value) + 4) : p.value), b = M(() => {
|
|
169
169
|
let e = [];
|
|
170
170
|
for (let r = v.value; r < y.value; r += 1) {
|
|
171
171
|
var n;
|
|
@@ -189,14 +189,14 @@ function be(e) {
|
|
|
189
189
|
function ee(e) {
|
|
190
190
|
return c.value.has(e + 1);
|
|
191
191
|
}
|
|
192
|
-
return
|
|
192
|
+
return B(() => {
|
|
193
193
|
S(), s.value = !0;
|
|
194
|
-
}),
|
|
194
|
+
}), ge(() => K(e.source), () => {
|
|
195
195
|
r.value = !1;
|
|
196
196
|
}), {
|
|
197
197
|
highlightedLines: t,
|
|
198
198
|
expanded: r,
|
|
199
|
-
truncatable:
|
|
199
|
+
truncatable: d,
|
|
200
200
|
totalLines: p,
|
|
201
201
|
virtualActive: _,
|
|
202
202
|
startLine: v,
|
|
@@ -211,7 +211,7 @@ function be(e) {
|
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
// src/components/Icon.ts
|
|
214
|
-
var
|
|
214
|
+
var Z = {
|
|
215
215
|
copy: ["M8 8h12v12H8z", "M4 16V4h12"],
|
|
216
216
|
check: ["M4 12l5 5L20 6"],
|
|
217
217
|
download: [
|
|
@@ -266,7 +266,7 @@ var X = {
|
|
|
266
266
|
"M14 15h6v4h-6z",
|
|
267
267
|
"M7 9v3h10v3"
|
|
268
268
|
]
|
|
269
|
-
},
|
|
269
|
+
}, be = (e) => R("svg", {
|
|
270
270
|
class: "vmd-icon",
|
|
271
271
|
viewBox: "0 0 24 24",
|
|
272
272
|
"aria-hidden": "true",
|
|
@@ -276,7 +276,7 @@ var X = {
|
|
|
276
276
|
"stroke-width": 1.8,
|
|
277
277
|
"stroke-linecap": "round",
|
|
278
278
|
"stroke-linejoin": "round"
|
|
279
|
-
},
|
|
279
|
+
}, Z[e.name].map((e) => R("path", { d: e }))), xe = [
|
|
280
280
|
"data-vmd-theme",
|
|
281
281
|
"data-language",
|
|
282
282
|
"data-highlighter",
|
|
@@ -292,7 +292,7 @@ var X = {
|
|
|
292
292
|
key: 2,
|
|
293
293
|
"data-vmd-part": "code-body",
|
|
294
294
|
class: "vmd-code-body"
|
|
295
|
-
}, Ee = /* @__PURE__ */
|
|
295
|
+
}, Ee = /* @__PURE__ */ I({
|
|
296
296
|
__name: "CodeBlock",
|
|
297
297
|
props: {
|
|
298
298
|
node: {},
|
|
@@ -340,16 +340,16 @@ var X = {
|
|
|
340
340
|
"error"
|
|
341
341
|
],
|
|
342
342
|
setup(i, { expose: l, emit: u }) {
|
|
343
|
-
let d = i, p = u, m = c(), h = o(), g =
|
|
343
|
+
let d = i, p = u, m = c(), h = o(), g = he(), _ = f({
|
|
344
344
|
standalone: () => d.standalone,
|
|
345
345
|
ignoreRegion: () => d.ignoreRegion
|
|
346
|
-
}), v =
|
|
346
|
+
}), v = M(() => {
|
|
347
347
|
var e, t;
|
|
348
348
|
return d.code === void 0 ? (e = (t = d.node) == null ? void 0 : t.code) == null ? "" : e : d.code;
|
|
349
|
-
}), y =
|
|
349
|
+
}), y = M(() => {
|
|
350
350
|
var e, t;
|
|
351
351
|
return d.language === void 0 ? (e = (t = d.node) == null ? void 0 : t.language) == null ? "" : e : d.language;
|
|
352
|
-
}), b =
|
|
352
|
+
}), b = M(() => y.value || "text");
|
|
353
353
|
function x(e) {
|
|
354
354
|
var t;
|
|
355
355
|
(t = m.onRenderError) == null || t.call(m, e), p("error", e);
|
|
@@ -368,7 +368,7 @@ var X = {
|
|
|
368
368
|
},
|
|
369
369
|
enabled: () => !_.value,
|
|
370
370
|
onDiagnostic: x
|
|
371
|
-
}), { highlightedLines: ne, expanded: re, truncatable:
|
|
371
|
+
}), { highlightedLines: ne, expanded: re, truncatable: w, virtualActive: T, startLine: E, endLine: D, totalLines: O, visibleLines: k, lineHeight: ie, scrollRef: ae, onScroll: A, toggle: oe, isHighlightedLine: j } = ye({
|
|
372
372
|
nodes: () => S.value.nodes,
|
|
373
373
|
source: v,
|
|
374
374
|
maxLines: () => d.maxLines,
|
|
@@ -376,15 +376,15 @@ var X = {
|
|
|
376
376
|
virtualThreshold: () => d.virtualThreshold,
|
|
377
377
|
lineHeight: () => d.lineHeight,
|
|
378
378
|
highlightLines: () => d.highlightLines
|
|
379
|
-
}),
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
}), se = M(() => S.value.mode === "block"), le = M(() => d.lineNumbers || d.highlightLines.length > 0 || d.maxLines > 0 || d.virtual), L = U("idle"), z = M(() => L.value === "copied" ? e(m.labels.copied) : L.value === "failed" ? e(m.labels.copyFailed) : ""), B, V;
|
|
380
|
+
fe(() => {
|
|
381
|
+
B && clearTimeout(B), V && URL.revokeObjectURL(V);
|
|
382
382
|
});
|
|
383
|
-
function
|
|
384
|
-
return
|
|
383
|
+
function G() {
|
|
384
|
+
return me.apply(this, arguments);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
386
|
+
function me() {
|
|
387
|
+
return me = a(function* () {
|
|
388
388
|
let e = v.value;
|
|
389
389
|
try {
|
|
390
390
|
if (typeof navigator < "u" && navigator.clipboard) yield navigator.clipboard.writeText(e);
|
|
@@ -394,31 +394,31 @@ var X = {
|
|
|
394
394
|
let n = document.execCommand("copy");
|
|
395
395
|
if (t.remove(), n === !1) throw Error("The copy command was rejected.");
|
|
396
396
|
} else throw Error("Clipboard access is not available.");
|
|
397
|
-
p("copy", e),
|
|
398
|
-
|
|
397
|
+
p("copy", e), L.value = "copied", B && clearTimeout(B), B = setTimeout(() => {
|
|
398
|
+
L.value = "idle";
|
|
399
399
|
}, 1500);
|
|
400
400
|
} catch (e) {
|
|
401
|
-
|
|
401
|
+
L.value = "failed", x(n("copy-error", `The source could not be copied to the clipboard: ${t(e)}`, {
|
|
402
402
|
severity: "warning",
|
|
403
403
|
phase: "render"
|
|
404
|
-
})),
|
|
405
|
-
|
|
404
|
+
})), B && clearTimeout(B), B = setTimeout(() => {
|
|
405
|
+
L.value = "idle";
|
|
406
406
|
}, 1500);
|
|
407
407
|
}
|
|
408
|
-
}),
|
|
408
|
+
}), me.apply(this, arguments);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
return
|
|
410
|
+
function K() {
|
|
411
|
+
return Y.apply(this, arguments);
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
return
|
|
413
|
+
function Y() {
|
|
414
|
+
return Y = a(function* () {
|
|
415
415
|
let e = v.value;
|
|
416
416
|
if (typeof document < "u" && typeof URL < "u") try {
|
|
417
417
|
let t = new Blob([e], { type: "text/plain;charset=utf-8" }), n = URL.createObjectURL(t);
|
|
418
|
-
|
|
418
|
+
V = n;
|
|
419
419
|
let r = document.createElement("a");
|
|
420
420
|
r.href = n, r.download = d.fileName || `code.${y.value || "txt"}`, r.click(), setTimeout(() => {
|
|
421
|
-
URL.revokeObjectURL(n),
|
|
421
|
+
URL.revokeObjectURL(n), V === n && (V = void 0);
|
|
422
422
|
}, 1e3), p("download", e);
|
|
423
423
|
} catch (e) {
|
|
424
424
|
x(n("download-error", `The source could not be downloaded: ${t(e)}`, {
|
|
@@ -426,101 +426,101 @@ var X = {
|
|
|
426
426
|
phase: "render"
|
|
427
427
|
}));
|
|
428
428
|
}
|
|
429
|
-
}),
|
|
429
|
+
}), Y.apply(this, arguments);
|
|
430
430
|
}
|
|
431
|
-
let
|
|
432
|
-
copy:
|
|
433
|
-
download:
|
|
434
|
-
})),
|
|
431
|
+
let _e = M(() => ({
|
|
432
|
+
copy: G,
|
|
433
|
+
download: K
|
|
434
|
+
})), X = M(() => ({
|
|
435
435
|
node: d.node,
|
|
436
436
|
source: v.value,
|
|
437
437
|
language: y.value,
|
|
438
438
|
highlighted: S.value,
|
|
439
439
|
nodes: S.value.nodes,
|
|
440
440
|
lines: ne.value,
|
|
441
|
-
visibleLines:
|
|
442
|
-
actions:
|
|
443
|
-
})),
|
|
441
|
+
visibleLines: k.value,
|
|
442
|
+
actions: _e.value
|
|
443
|
+
})), Z = M(() => ({
|
|
444
444
|
source: v.value,
|
|
445
445
|
language: y.value,
|
|
446
446
|
fileName: d.fileName,
|
|
447
447
|
title: d.title,
|
|
448
448
|
highlighted: S.value,
|
|
449
449
|
nodes: S.value.nodes,
|
|
450
|
-
actions:
|
|
451
|
-
})), Ee =
|
|
450
|
+
actions: _e.value
|
|
451
|
+
})), Ee = M(() => r(r({}, Z.value), {}, { label: b.value }));
|
|
452
452
|
function De() {
|
|
453
453
|
let t = [];
|
|
454
|
-
|
|
454
|
+
T.value && E.value > 0 && t.push(R("div", {
|
|
455
455
|
key: "spacer-top",
|
|
456
456
|
"aria-hidden": "true",
|
|
457
|
-
style: { height: `${
|
|
457
|
+
style: { height: `${E.value * ie.value}px` }
|
|
458
458
|
}));
|
|
459
|
-
for (let e of
|
|
460
|
-
let n =
|
|
461
|
-
t.push(
|
|
459
|
+
for (let e of k.value) {
|
|
460
|
+
let n = j(e.index);
|
|
461
|
+
t.push(R("div", {
|
|
462
462
|
class: "vmd-highlighter-line",
|
|
463
463
|
"data-vmd-part": "highlighter-line",
|
|
464
464
|
"data-line": String(e.index + 1),
|
|
465
465
|
"data-highlighted": n ? "true" : void 0,
|
|
466
466
|
key: `line-${e.index}`
|
|
467
|
-
}, [d.lineNumbers ?
|
|
467
|
+
}, [d.lineNumbers ? R("span", {
|
|
468
468
|
class: "vmd-highlighter-gutter",
|
|
469
469
|
"data-vmd-part": "highlighter-gutter",
|
|
470
470
|
"aria-hidden": "true"
|
|
471
|
-
}, String(e.index + 1)) : null,
|
|
471
|
+
}, String(e.index + 1)) : null, R("code", { class: ["vmd-highlighter-code", y.value ? `language-${y.value}` : void 0] }, $(e.nodes, m))]));
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return T.value && D.value < O.value && t.push(R("div", {
|
|
474
474
|
key: "spacer-bottom",
|
|
475
475
|
"aria-hidden": "true",
|
|
476
|
-
style: { height: `${(
|
|
477
|
-
})),
|
|
476
|
+
style: { height: `${(O.value - D.value) * ie.value}px` }
|
|
477
|
+
})), w.value && t.push(R("button", {
|
|
478
478
|
type: "button",
|
|
479
479
|
class: "vmd-highlighter-toggle",
|
|
480
480
|
"data-vmd-part": "highlighter-toggle",
|
|
481
481
|
"aria-expanded": re.value ? "true" : "false",
|
|
482
|
-
onClick:
|
|
482
|
+
onClick: oe
|
|
483
483
|
}, re.value ? e(m.labels.showLess) : e(m.labels.showAll))), t;
|
|
484
484
|
}
|
|
485
|
-
let Oe =
|
|
486
|
-
return () => m.renderHostSlot("code",
|
|
485
|
+
let Oe = I({ setup() {
|
|
486
|
+
return () => m.renderHostSlot("code", X.value, () => {
|
|
487
487
|
let e = g.code;
|
|
488
488
|
if (e) {
|
|
489
|
-
let t = e(
|
|
489
|
+
let t = e(X.value);
|
|
490
490
|
if (!s(t)) return t;
|
|
491
491
|
}
|
|
492
|
-
return
|
|
492
|
+
return se.value ? $(S.value.nodes, m) : le.value ? De() : $(S.value.nodes, m);
|
|
493
493
|
});
|
|
494
|
-
} }), ke =
|
|
495
|
-
return () => m.renderHostSlot("toolbar",
|
|
494
|
+
} }), ke = I({ setup() {
|
|
495
|
+
return () => m.renderHostSlot("toolbar", Z.value, () => {
|
|
496
496
|
let r = g.toolbar;
|
|
497
497
|
if (r) {
|
|
498
|
-
let e = r(
|
|
498
|
+
let e = r(Z.value);
|
|
499
499
|
if (!s(e)) return e;
|
|
500
500
|
}
|
|
501
|
-
return m.renderHostSlot("code-actions",
|
|
501
|
+
return m.renderHostSlot("code-actions", Z.value, () => {
|
|
502
502
|
let r = g["code-actions"];
|
|
503
503
|
if (r) {
|
|
504
|
-
let e = r(
|
|
504
|
+
let e = r(Z.value);
|
|
505
505
|
if (!s(e)) return e;
|
|
506
506
|
}
|
|
507
507
|
if (!d.showActions && d.actions.length === 0) return null;
|
|
508
508
|
let i = [];
|
|
509
509
|
if (d.showActions) {
|
|
510
|
-
let t =
|
|
511
|
-
if (i.push(
|
|
510
|
+
let t = L.value === "copied" ? e(m.labels.copied) : L.value === "failed" ? e(m.labels.copyFailed) : e(m.labels.copy);
|
|
511
|
+
if (i.push(R("button", {
|
|
512
512
|
type: "button",
|
|
513
513
|
class: "vmd-code-action",
|
|
514
514
|
"data-vmd-part": "code-action",
|
|
515
515
|
"data-action": "copy",
|
|
516
516
|
"data-icon": "true",
|
|
517
|
-
"data-state":
|
|
517
|
+
"data-state": L.value,
|
|
518
518
|
"aria-label": t,
|
|
519
519
|
title: t,
|
|
520
|
-
onClick:
|
|
521
|
-
}, [
|
|
520
|
+
onClick: G
|
|
521
|
+
}, [R(be, { name: L.value === "copied" ? "check" : "copy" }), R("span", { class: "vmd-visually-hidden" }, t)])), d.showDownload) {
|
|
522
522
|
let t = e(m.labels.download);
|
|
523
|
-
i.push(
|
|
523
|
+
i.push(R("button", {
|
|
524
524
|
type: "button",
|
|
525
525
|
class: "vmd-code-action",
|
|
526
526
|
"data-vmd-part": "code-action",
|
|
@@ -528,11 +528,11 @@ var X = {
|
|
|
528
528
|
"data-icon": "true",
|
|
529
529
|
"aria-label": t,
|
|
530
530
|
title: t,
|
|
531
|
-
onClick:
|
|
532
|
-
}, [
|
|
531
|
+
onClick: K
|
|
532
|
+
}, [R(be, { name: "download" }), R("span", { class: "vmd-visually-hidden" }, t)]));
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
for (let r of d.actions) i.push(
|
|
535
|
+
for (let r of d.actions) i.push(R("button", {
|
|
536
536
|
type: "button",
|
|
537
537
|
class: "vmd-code-action",
|
|
538
538
|
"data-vmd-part": "code-action",
|
|
@@ -543,8 +543,8 @@ var X = {
|
|
|
543
543
|
yield r.run({
|
|
544
544
|
code: v.value,
|
|
545
545
|
language: y.value,
|
|
546
|
-
copy:
|
|
547
|
-
download:
|
|
546
|
+
copy: G,
|
|
547
|
+
download: K
|
|
548
548
|
}), p("action", r.key);
|
|
549
549
|
} catch (e) {
|
|
550
550
|
x(n("action-error", `The "${r.key}" action failed: ${t(e)}`, {
|
|
@@ -558,61 +558,61 @@ var X = {
|
|
|
558
558
|
};
|
|
559
559
|
}()
|
|
560
560
|
}, e(r.label)));
|
|
561
|
-
return i.push(
|
|
561
|
+
return i.push(R("span", {
|
|
562
562
|
class: "vmd-code-feedback",
|
|
563
563
|
"data-vmd-part": "code-feedback",
|
|
564
|
-
"data-state":
|
|
564
|
+
"data-state": L.value,
|
|
565
565
|
role: "status",
|
|
566
566
|
"aria-live": "polite"
|
|
567
|
-
},
|
|
567
|
+
}, z.value)), i;
|
|
568
568
|
});
|
|
569
569
|
});
|
|
570
|
-
} }), Ae =
|
|
570
|
+
} }), Ae = I({ setup() {
|
|
571
571
|
return () => m.renderHostSlot("header", Ee.value, () => {
|
|
572
572
|
let e = g.header;
|
|
573
573
|
if (e) {
|
|
574
574
|
let t = e(Ee.value);
|
|
575
575
|
if (!s(t)) return t;
|
|
576
576
|
}
|
|
577
|
-
return [
|
|
577
|
+
return [R("span", {
|
|
578
578
|
class: "vmd-code-heading",
|
|
579
579
|
"data-vmd-part": "code-heading"
|
|
580
580
|
}, [
|
|
581
|
-
|
|
582
|
-
d.title ?
|
|
581
|
+
R(be, { name: "source" }),
|
|
582
|
+
d.title ? R("span", {
|
|
583
583
|
class: "vmd-code-title",
|
|
584
584
|
"data-vmd-part": "code-title"
|
|
585
585
|
}, d.title) : null,
|
|
586
|
-
d.fileName ?
|
|
586
|
+
d.fileName ? R("span", {
|
|
587
587
|
class: "vmd-code-file-name",
|
|
588
588
|
"data-vmd-part": "code-file-name"
|
|
589
589
|
}, d.fileName) : null,
|
|
590
|
-
|
|
590
|
+
R("span", {
|
|
591
591
|
class: "vmd-code-lang",
|
|
592
592
|
"data-vmd-part": "code-lang"
|
|
593
593
|
}, b.value)
|
|
594
|
-
]),
|
|
594
|
+
]), R("span", {
|
|
595
595
|
class: "vmd-code-toolbar",
|
|
596
596
|
"data-vmd-part": "code-toolbar"
|
|
597
|
-
}, [
|
|
597
|
+
}, [R(ke)])];
|
|
598
598
|
});
|
|
599
599
|
} });
|
|
600
|
-
return
|
|
601
|
-
|
|
600
|
+
return ge(() => [v.value, y.value], () => {
|
|
601
|
+
L.value = "idle";
|
|
602
602
|
}), l({
|
|
603
|
-
copy:
|
|
604
|
-
download:
|
|
603
|
+
copy: G,
|
|
604
|
+
download: K,
|
|
605
605
|
getHighlighted: te,
|
|
606
606
|
highlighted: S
|
|
607
607
|
}), (e, t) => {
|
|
608
608
|
var n;
|
|
609
|
-
return
|
|
609
|
+
return q(_) ? (H(), N(pe(q(_)), {
|
|
610
610
|
key: 0,
|
|
611
611
|
node: i.node,
|
|
612
612
|
code: v.value,
|
|
613
613
|
language: y.value,
|
|
614
|
-
theme:
|
|
615
|
-
highlighter:
|
|
614
|
+
theme: q(ee),
|
|
615
|
+
highlighter: q(C),
|
|
616
616
|
actions: i.actions,
|
|
617
617
|
"show-actions": i.showActions,
|
|
618
618
|
"show-download": i.showDownload,
|
|
@@ -623,14 +623,14 @@ var X = {
|
|
|
623
623
|
"max-lines": i.maxLines,
|
|
624
624
|
virtual: i.virtual,
|
|
625
625
|
"virtual-threshold": i.virtualThreshold,
|
|
626
|
-
"line-height":
|
|
626
|
+
"line-height": q(ie),
|
|
627
627
|
delay: i.delay,
|
|
628
|
-
highlighted:
|
|
629
|
-
"action-handlers":
|
|
630
|
-
copy:
|
|
631
|
-
download:
|
|
628
|
+
highlighted: q(S),
|
|
629
|
+
"action-handlers": _e.value,
|
|
630
|
+
copy: G,
|
|
631
|
+
download: K
|
|
632
632
|
}, {
|
|
633
|
-
default:
|
|
633
|
+
default: J(() => [W(e.$slots, "default")]),
|
|
634
634
|
_: 3
|
|
635
635
|
}, 8, [
|
|
636
636
|
"node",
|
|
@@ -652,27 +652,27 @@ var X = {
|
|
|
652
652
|
"delay",
|
|
653
653
|
"highlighted",
|
|
654
654
|
"action-handlers"
|
|
655
|
-
])) : (
|
|
655
|
+
])) : (H(), P("div", {
|
|
656
656
|
key: 1,
|
|
657
657
|
"data-vmd-part": "code",
|
|
658
658
|
class: "vmd-code vmd-code-block",
|
|
659
|
-
"data-vmd-theme":
|
|
659
|
+
"data-vmd-theme": q(ee),
|
|
660
660
|
"data-language": b.value,
|
|
661
|
-
"data-highlighter": (n =
|
|
662
|
-
"data-virtual":
|
|
663
|
-
}, [
|
|
661
|
+
"data-highlighter": (n = q(C)) == null ? void 0 : n.id,
|
|
662
|
+
"data-virtual": q(T) ? "true" : void 0
|
|
663
|
+
}, [ce("div", Se, [F(q(Ae))]), se.value ? (H(), P("div", Ce, [F(q(Oe))])) : le.value ? (H(), P("div", {
|
|
664
664
|
key: 1,
|
|
665
665
|
ref_key: "scrollRef",
|
|
666
|
-
ref:
|
|
666
|
+
ref: ae,
|
|
667
667
|
"data-vmd-part": "code-body",
|
|
668
668
|
class: "vmd-code-body vmd-code-lines",
|
|
669
|
-
"data-virtual":
|
|
670
|
-
style:
|
|
671
|
-
maxHeight: `${
|
|
669
|
+
"data-virtual": q(T) ? "true" : void 0,
|
|
670
|
+
style: de(q(T) ? {
|
|
671
|
+
maxHeight: `${q(ie) * 20}px`,
|
|
672
672
|
overflow: "auto"
|
|
673
673
|
} : void 0),
|
|
674
|
-
onScroll: t[0] || (t[0] = (...e) =>
|
|
675
|
-
}, [
|
|
674
|
+
onScroll: t[0] || (t[0] = (...e) => q(A) && q(A)(...e))
|
|
675
|
+
}, [F(q(Oe))], 44, we)) : (H(), P("pre", Te, [ce("code", { class: ue(["vmd-code-element", y.value ? `language-${y.value}` : void 0]) }, [F(q(Oe))], 2)]))], 8, xe));
|
|
676
676
|
};
|
|
677
677
|
}
|
|
678
678
|
}), De = [
|
|
@@ -684,7 +684,7 @@ var X = {
|
|
|
684
684
|
"data-vmd-part": "math-error",
|
|
685
685
|
class: "vmd-math-error",
|
|
686
686
|
role: "status"
|
|
687
|
-
}, ke = /* @__PURE__ */
|
|
687
|
+
}, ke = /* @__PURE__ */ I({
|
|
688
688
|
__name: "MarkdownMath",
|
|
689
689
|
props: {
|
|
690
690
|
node: {},
|
|
@@ -695,19 +695,19 @@ var X = {
|
|
|
695
695
|
mathEngine: {}
|
|
696
696
|
},
|
|
697
697
|
setup(t) {
|
|
698
|
-
let r = t, i = c(), a =
|
|
698
|
+
let r = t, i = c(), a = M(() => {
|
|
699
699
|
var e, t;
|
|
700
700
|
return (e = r.tex) == null ? ((t = r.node) == null ? void 0 : t.kind) === "math" ? r.node.tex : "" : e;
|
|
701
|
-
}), o =
|
|
701
|
+
}), o = M(() => {
|
|
702
702
|
var e, t;
|
|
703
703
|
return (e = r.displayMode) == null ? ((t = r.node) == null ? void 0 : t.kind) === "math" && r.node.displayMode : e;
|
|
704
|
-
}), s =
|
|
704
|
+
}), s = M(() => {
|
|
705
705
|
var e, t;
|
|
706
706
|
return (e = r.rendered) == null ? ((t = r.node) == null ? void 0 : t.kind) === "math" ? r.node.rendered : [] : e;
|
|
707
|
-
}), l =
|
|
707
|
+
}), l = M(() => {
|
|
708
708
|
var e;
|
|
709
709
|
return (e = r.mathEngine) == null ? i.mathEngine : e;
|
|
710
|
-
}), u =
|
|
710
|
+
}), u = M(() => {
|
|
711
711
|
if (l.value) try {
|
|
712
712
|
return l.value.render(a.value, { displayMode: o.value });
|
|
713
713
|
} catch (e) {
|
|
@@ -720,7 +720,7 @@ var X = {
|
|
|
720
720
|
error: e instanceof Error ? e.message : String(e)
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
|
-
}), d =
|
|
723
|
+
}), d = M(() => !l.value && (s.value === void 0 || s.value.length === 0) && a.value !== ""), f = M(() => {
|
|
724
724
|
var e, t, n;
|
|
725
725
|
let r = (e = (t = (n = u.value) == null ? void 0 : n.nodes) == null ? s.value : t) == null ? [] : e;
|
|
726
726
|
return r.length > 0 ? r : d.value ? [{
|
|
@@ -738,10 +738,10 @@ var X = {
|
|
|
738
738
|
if (e) return e;
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
let m =
|
|
741
|
+
let m = M(() => u.value ? void 0 : p(s.value)), h = M(() => {
|
|
742
742
|
var e, t, n;
|
|
743
743
|
return (e = (t = r.error) == null ? (n = u.value) == null ? void 0 : n.error : t) == null ? m.value : e;
|
|
744
|
-
}), g =
|
|
744
|
+
}), g = M(() => e(i.labels.math, { tex: a.value })), _ = !1;
|
|
745
745
|
function v() {
|
|
746
746
|
if (!_) {
|
|
747
747
|
if (h.value) {
|
|
@@ -760,28 +760,28 @@ var X = {
|
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
|
|
764
|
-
let y =
|
|
763
|
+
B(v), ge([h, d], v);
|
|
764
|
+
let y = I({ setup() {
|
|
765
765
|
return () => i.renderHostSlot("math", {
|
|
766
766
|
tex: a.value,
|
|
767
767
|
displayMode: o.value,
|
|
768
768
|
rendered: f.value,
|
|
769
769
|
error: h.value
|
|
770
770
|
}, () => $(f.value, i));
|
|
771
|
-
} }), b =
|
|
771
|
+
} }), b = I({ setup() {
|
|
772
772
|
return () => i.renderHostSlot("math-error", {
|
|
773
773
|
tex: a.value,
|
|
774
774
|
error: h.value,
|
|
775
775
|
retry: () => void 0
|
|
776
|
-
}, () =>
|
|
776
|
+
}, () => R("span", { class: "vmd-math-fallback" }, a.value));
|
|
777
777
|
} });
|
|
778
|
-
return (e, t) => (
|
|
778
|
+
return (e, t) => (H(), P("span", {
|
|
779
779
|
"data-vmd-part": "math",
|
|
780
780
|
class: "vmd-math",
|
|
781
781
|
"data-display": o.value ? "true" : "false",
|
|
782
782
|
"data-error": h.value ? "true" : void 0,
|
|
783
783
|
"aria-label": g.value
|
|
784
|
-
}, [h.value ? (
|
|
784
|
+
}, [h.value ? (H(), P("span", Oe, [F(q(b))])) : (H(), N(q(y), { key: 1 }))], 8, De));
|
|
785
785
|
}
|
|
786
786
|
}), Ae = [
|
|
787
787
|
"data-vmd-theme",
|
|
@@ -805,7 +805,7 @@ var X = {
|
|
|
805
805
|
key: 1,
|
|
806
806
|
"data-vmd-part": "mermaid-source",
|
|
807
807
|
class: "vmd-mermaid-source"
|
|
808
|
-
}, Ie = "
|
|
808
|
+
}, Ie = "The Mermaid renderer returned an invalid result. Return an object such as `{ nodes }` or `{ svg }` from `render()`.", Le = "The Mermaid renderer returned no diagram nodes or SVG. Return `{ nodes }` or `{ svg }`, or remove the custom renderer to use the built-in runtime.", Re = "The Mermaid renderer returned SVG that sanitization rejected completely. Return safe SVG markup or sanitized `nodes` instead.", ze = "Mermaid produced no renderable diagram output. Check the diagram syntax and the installed `mermaid` version.", Be = "Mermaid produced SVG that sanitization rejected completely. Check the diagram syntax and the installed `mermaid` version.", Ve = "Mermaid source must be a string. If you used `renderMermaid()`, await its result before passing it as the source.", He = /* @__PURE__ */ I({
|
|
809
809
|
__name: "MermaidBlock",
|
|
810
810
|
props: {
|
|
811
811
|
node: { default: void 0 },
|
|
@@ -839,96 +839,111 @@ var X = {
|
|
|
839
839
|
"action"
|
|
840
840
|
],
|
|
841
841
|
setup(o, { expose: l, emit: u }) {
|
|
842
|
-
let d = o, f = u, p = c(), m =
|
|
842
|
+
let d = o, f = u, p = c(), m = he(), h = M(() => {
|
|
843
843
|
var e, t;
|
|
844
844
|
return (e = d.source) == null ? ((t = d.node) == null ? void 0 : t.kind) === "mermaid" ? d.node.code : "" : e;
|
|
845
|
-
}), g =
|
|
845
|
+
}), g = M(() => typeof h.value == "string" ? h.value : ""), _ = M(() => {
|
|
846
846
|
var e, t;
|
|
847
847
|
return (e = (t = d.theme) == null ? p.theme : t) == null ? "light" : e;
|
|
848
|
-
}),
|
|
849
|
-
function
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
let t = ne(n);
|
|
862
|
-
if (t.length > 0) return r(r({}, e), {}, {
|
|
848
|
+
}), v = U("idle"), y = G(), b = G(), x = U(""), S = U("preview"), C = U(1), w = U(!1), T = U(), E = U(!1), D = !1, O, k = M(() => d.renderer && i(d.renderer) ? d.renderer : p.mermaidRenderer), ie = M(() => k.value && i(k.value) ? k.value.id : "mermaid"), ae = M(() => e(p.labels.mermaid, { source: g.value })), A = 0;
|
|
849
|
+
function oe(e) {
|
|
850
|
+
return j.apply(this, arguments);
|
|
851
|
+
}
|
|
852
|
+
function j() {
|
|
853
|
+
return j = a(function* (e) {
|
|
854
|
+
var t;
|
|
855
|
+
if (!e || typeof e != "object") return {
|
|
856
|
+
nodes: [],
|
|
857
|
+
error: Ie
|
|
858
|
+
};
|
|
859
|
+
let n = typeof e.svg == "string" && e.svg ? e.svg : void 0, i = Array.isArray(e.nodes) ? ne(e.nodes) : [];
|
|
860
|
+
if (i.length > 0) return r(r({}, e), {}, {
|
|
863
861
|
svg: n,
|
|
864
|
-
nodes:
|
|
862
|
+
nodes: i
|
|
865
863
|
});
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
864
|
+
if (n) {
|
|
865
|
+
var a;
|
|
866
|
+
let t = yield ee(n);
|
|
867
|
+
return t.length > 0 ? r(r({}, e), {}, {
|
|
868
|
+
svg: n,
|
|
869
|
+
nodes: t
|
|
870
|
+
}) : r(r({}, e), {}, {
|
|
871
|
+
svg: n,
|
|
872
|
+
nodes: [],
|
|
873
|
+
error: (a = e.error) == null ? Re : a
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
return r(r({}, e), {}, {
|
|
877
|
+
svg: n,
|
|
878
|
+
nodes: [],
|
|
879
|
+
error: (t = e.error) == null ? Le : t
|
|
880
|
+
});
|
|
881
|
+
}), j.apply(this, arguments);
|
|
872
882
|
}
|
|
873
|
-
function
|
|
874
|
-
return
|
|
883
|
+
function N() {
|
|
884
|
+
return le.apply(this, arguments);
|
|
875
885
|
}
|
|
876
|
-
function
|
|
877
|
-
return
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
886
|
+
function le() {
|
|
887
|
+
return le = a(function* () {
|
|
888
|
+
if (!D) return;
|
|
889
|
+
let e = ++A;
|
|
890
|
+
v.value = "pending", x.value = "", C.value = 1;
|
|
891
|
+
let a = k.value, o = re(), s;
|
|
892
|
+
if (typeof h.value != "string") s = {
|
|
893
|
+
nodes: [],
|
|
894
|
+
error: Ve
|
|
895
|
+
};
|
|
896
|
+
else if (a && i(a)) try {
|
|
897
|
+
s = yield oe(yield a.render(g.value, {
|
|
898
|
+
theme: _.value,
|
|
899
|
+
id: o
|
|
885
900
|
}));
|
|
886
901
|
} catch (e) {
|
|
887
|
-
|
|
902
|
+
s = {
|
|
888
903
|
nodes: [],
|
|
889
|
-
error:
|
|
904
|
+
error: `The Mermaid renderer failed: ${t(e)}`
|
|
890
905
|
};
|
|
891
906
|
}
|
|
892
907
|
else {
|
|
893
|
-
let e = yield te(
|
|
894
|
-
theme:
|
|
895
|
-
id:
|
|
908
|
+
let e = yield te(g.value, {
|
|
909
|
+
theme: _.value,
|
|
910
|
+
id: o
|
|
896
911
|
});
|
|
897
|
-
|
|
912
|
+
s = e.error || e.nodes.length > 0 ? e : r(r({}, e), {}, { error: e.svg ? Be : ze });
|
|
898
913
|
}
|
|
899
|
-
if (e ===
|
|
900
|
-
if (
|
|
901
|
-
var
|
|
902
|
-
|
|
903
|
-
let e =
|
|
904
|
-
(
|
|
905
|
-
} else
|
|
914
|
+
if (D && e === A) {
|
|
915
|
+
if (y.value = s, s.error) {
|
|
916
|
+
var c;
|
|
917
|
+
v.value = "error", x.value = s.error, f("error", s.error);
|
|
918
|
+
let e = s.error.indexOf("Mermaid is not available") !== -1;
|
|
919
|
+
(c = p.onRenderError) == null || c.call(p, n(e ? "mermaid-unavailable" : "mermaid-error", s.error, { phase: "render" }));
|
|
920
|
+
} else v.value = "ready", b.value = s, f("rendered", s);
|
|
906
921
|
}
|
|
907
|
-
}),
|
|
922
|
+
}), le.apply(this, arguments);
|
|
908
923
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
}),
|
|
912
|
-
|
|
913
|
-
}),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
924
|
+
B(() => {
|
|
925
|
+
D = !0, N();
|
|
926
|
+
}), fe(() => {
|
|
927
|
+
D = !1, A += 1, O && clearTimeout(O), typeof document < "u" && document.removeEventListener("keydown", pe);
|
|
928
|
+
}), ge(() => [
|
|
929
|
+
g.value,
|
|
930
|
+
k.value,
|
|
931
|
+
_.value
|
|
917
932
|
], () => {
|
|
918
|
-
|
|
933
|
+
D && N();
|
|
919
934
|
});
|
|
920
|
-
function
|
|
921
|
-
return
|
|
935
|
+
function L() {
|
|
936
|
+
return ue.apply(this, arguments);
|
|
922
937
|
}
|
|
923
|
-
function
|
|
924
|
-
return
|
|
938
|
+
function ue() {
|
|
939
|
+
return ue = a(function* () {
|
|
925
940
|
try {
|
|
926
|
-
typeof navigator < "u" && navigator.clipboard && (yield navigator.clipboard.writeText(
|
|
927
|
-
|
|
941
|
+
typeof navigator < "u" && navigator.clipboard && (yield navigator.clipboard.writeText(g.value)), E.value = !0, f("copy", g.value), O && clearTimeout(O), O = setTimeout(() => {
|
|
942
|
+
E.value = !1;
|
|
928
943
|
}, 1500);
|
|
929
944
|
} catch (r) {
|
|
930
945
|
var e;
|
|
931
|
-
|
|
946
|
+
E.value = !1;
|
|
932
947
|
let i = `The source could not be copied to the clipboard: ${t(r)}`;
|
|
933
948
|
f("error", i), (e = p.onRenderError) == null || e.call(p, n("copy-error", i, {
|
|
934
949
|
severity: "warning",
|
|
@@ -936,20 +951,20 @@ var X = {
|
|
|
936
951
|
plugin: "mermaid"
|
|
937
952
|
}));
|
|
938
953
|
}
|
|
939
|
-
}),
|
|
954
|
+
}), ue.apply(this, arguments);
|
|
940
955
|
}
|
|
941
|
-
function
|
|
956
|
+
function z(e, t) {
|
|
942
957
|
if (typeof document > "u" || typeof URL > "u") return;
|
|
943
958
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
944
959
|
r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 1e3);
|
|
945
960
|
}
|
|
946
961
|
function de() {
|
|
947
|
-
return
|
|
962
|
+
return V.apply(this, arguments);
|
|
948
963
|
}
|
|
949
|
-
function
|
|
950
|
-
return
|
|
964
|
+
function V() {
|
|
965
|
+
return V = a(function* () {
|
|
951
966
|
var e;
|
|
952
|
-
let t = (e =
|
|
967
|
+
let t = (e = b.value) == null ? void 0 : e.svg;
|
|
953
968
|
if (t && typeof document < "u" && typeof Image < "u") try {
|
|
954
969
|
var n;
|
|
955
970
|
let e = URL.createObjectURL(new Blob([t], { type: "image/svg+xml" })), r = new Image();
|
|
@@ -959,25 +974,25 @@ var X = {
|
|
|
959
974
|
let i = document.createElement("canvas");
|
|
960
975
|
i.width = r.width || 800, i.height = r.height || 600, (n = i.getContext("2d")) == null || n.drawImage(r, 0, 0), URL.revokeObjectURL(e);
|
|
961
976
|
let a = yield new Promise((e) => i.toBlob(e, "image/png"));
|
|
962
|
-
a && (
|
|
977
|
+
a && (z(a, "diagram.png"), f("export", "png"));
|
|
963
978
|
} catch (e) {}
|
|
964
|
-
}),
|
|
979
|
+
}), V.apply(this, arguments);
|
|
965
980
|
}
|
|
966
|
-
function
|
|
981
|
+
function W() {
|
|
967
982
|
var e;
|
|
968
|
-
let t = (e =
|
|
969
|
-
t && (
|
|
983
|
+
let t = (e = b.value) == null ? void 0 : e.svg;
|
|
984
|
+
t && (z(new Blob([t], { type: "image/svg+xml" }), "diagram.svg"), f("export", "svg"));
|
|
970
985
|
}
|
|
971
|
-
function
|
|
972
|
-
e.key === "Escape" &&
|
|
986
|
+
function pe(e) {
|
|
987
|
+
e.key === "Escape" && w.value && K(!1);
|
|
973
988
|
}
|
|
974
|
-
function
|
|
975
|
-
return
|
|
989
|
+
function K() {
|
|
990
|
+
return J.apply(this, arguments);
|
|
976
991
|
}
|
|
977
|
-
function
|
|
978
|
-
return
|
|
992
|
+
function J() {
|
|
993
|
+
return J = a(function* (e = !w.value) {
|
|
979
994
|
if (!d.allowFullscreen) return;
|
|
980
|
-
let t =
|
|
995
|
+
let t = T.value;
|
|
981
996
|
if (typeof document < "u") {
|
|
982
997
|
if (e) {
|
|
983
998
|
var n;
|
|
@@ -985,48 +1000,65 @@ var X = {
|
|
|
985
1000
|
var r;
|
|
986
1001
|
yield t == null || (r = t.requestFullscreen) == null ? void 0 : r.call(t);
|
|
987
1002
|
} catch (e) {}
|
|
988
|
-
if (!
|
|
989
|
-
|
|
1003
|
+
if (!D) return;
|
|
1004
|
+
w.value = !0, document.addEventListener("keydown", pe), t == null || (n = t.focus) == null || n.call(t);
|
|
990
1005
|
} else {
|
|
991
1006
|
try {
|
|
992
1007
|
document.fullscreenElement && (yield document.exitFullscreen());
|
|
993
1008
|
} catch (e) {}
|
|
994
|
-
if (!
|
|
995
|
-
|
|
1009
|
+
if (!D) return;
|
|
1010
|
+
w.value = !1, document.removeEventListener("keydown", pe);
|
|
996
1011
|
}
|
|
997
|
-
f("fullscreen",
|
|
1012
|
+
f("fullscreen", w.value);
|
|
998
1013
|
}
|
|
999
|
-
}),
|
|
1014
|
+
}), J.apply(this, arguments);
|
|
1000
1015
|
}
|
|
1001
|
-
function
|
|
1002
|
-
|
|
1016
|
+
function Y(e) {
|
|
1017
|
+
C.value = Math.min(4, Math.max(.25, Number((C.value + e).toFixed(2))));
|
|
1003
1018
|
}
|
|
1004
|
-
function
|
|
1005
|
-
|
|
1019
|
+
function _e() {
|
|
1020
|
+
C.value = 1;
|
|
1006
1021
|
}
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1022
|
+
function ve() {
|
|
1023
|
+
return R("button", {
|
|
1024
|
+
type: "button",
|
|
1025
|
+
class: "vmd-mermaid-retry",
|
|
1026
|
+
"data-vmd-part": "mermaid-retry",
|
|
1027
|
+
"data-action": "retry",
|
|
1028
|
+
onClick: X
|
|
1029
|
+
}, e(p.labels.retry));
|
|
1009
1030
|
}
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1031
|
+
function X() {
|
|
1032
|
+
return ye.apply(this, arguments);
|
|
1012
1033
|
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1034
|
+
function ye() {
|
|
1035
|
+
return ye = a(function* () {
|
|
1036
|
+
C.value = 1, yield N();
|
|
1037
|
+
}), ye.apply(this, arguments);
|
|
1038
|
+
}
|
|
1039
|
+
function Z() {
|
|
1040
|
+
S.value = "preview", C.value = 1;
|
|
1041
|
+
}
|
|
1042
|
+
function xe() {
|
|
1043
|
+
S.value = "source";
|
|
1044
|
+
}
|
|
1045
|
+
let Se = M(() => ({
|
|
1046
|
+
copy: L,
|
|
1015
1047
|
exportPng: de,
|
|
1016
|
-
downloadSvg:
|
|
1017
|
-
fullscreen: () =>
|
|
1018
|
-
retry:
|
|
1019
|
-
zoomIn: () =>
|
|
1020
|
-
zoomOut: () =>
|
|
1021
|
-
resetZoom:
|
|
1048
|
+
downloadSvg: W,
|
|
1049
|
+
fullscreen: () => K(),
|
|
1050
|
+
retry: X,
|
|
1051
|
+
zoomIn: () => Y(.25),
|
|
1052
|
+
zoomOut: () => Y(-.25),
|
|
1053
|
+
resetZoom: _e
|
|
1022
1054
|
}));
|
|
1023
|
-
function
|
|
1024
|
-
return
|
|
1055
|
+
function Ce(e) {
|
|
1056
|
+
return we.apply(this, arguments);
|
|
1025
1057
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return
|
|
1058
|
+
function we() {
|
|
1059
|
+
return we = a(function* (e) {
|
|
1028
1060
|
try {
|
|
1029
|
-
yield e.run(r({ source:
|
|
1061
|
+
yield e.run(r({ source: g.value }, Se.value)), f("action", e.key);
|
|
1030
1062
|
} catch (r) {
|
|
1031
1063
|
var i;
|
|
1032
1064
|
let a = `The "${e.key}" action failed: ${t(r)}`;
|
|
@@ -1036,144 +1068,144 @@ var X = {
|
|
|
1036
1068
|
plugin: "mermaid"
|
|
1037
1069
|
}));
|
|
1038
1070
|
}
|
|
1039
|
-
}),
|
|
1071
|
+
}), we.apply(this, arguments);
|
|
1040
1072
|
}
|
|
1041
|
-
let
|
|
1042
|
-
source:
|
|
1043
|
-
label:
|
|
1044
|
-
view:
|
|
1045
|
-
status:
|
|
1046
|
-
copied:
|
|
1047
|
-
fullscreen:
|
|
1073
|
+
let Te = M(() => ({
|
|
1074
|
+
source: g.value,
|
|
1075
|
+
label: ae.value,
|
|
1076
|
+
view: S.value,
|
|
1077
|
+
status: v.value,
|
|
1078
|
+
copied: E.value,
|
|
1079
|
+
fullscreen: w.value,
|
|
1048
1080
|
compact: d.compact,
|
|
1049
|
-
actions:
|
|
1050
|
-
showPreview:
|
|
1051
|
-
showSource:
|
|
1052
|
-
})),
|
|
1053
|
-
view:
|
|
1054
|
-
status:
|
|
1081
|
+
actions: Se.value,
|
|
1082
|
+
showPreview: Z,
|
|
1083
|
+
showSource: xe
|
|
1084
|
+
})), Ee = M(() => ({
|
|
1085
|
+
view: S.value,
|
|
1086
|
+
status: v.value,
|
|
1055
1087
|
actions: {
|
|
1056
|
-
preview:
|
|
1057
|
-
source:
|
|
1088
|
+
preview: Z,
|
|
1089
|
+
source: xe
|
|
1058
1090
|
}
|
|
1059
|
-
})),
|
|
1060
|
-
source:
|
|
1061
|
-
status:
|
|
1062
|
-
copied:
|
|
1063
|
-
fullscreen:
|
|
1091
|
+
})), De = M(() => ({
|
|
1092
|
+
source: g.value,
|
|
1093
|
+
status: v.value,
|
|
1094
|
+
copied: E.value,
|
|
1095
|
+
fullscreen: w.value,
|
|
1064
1096
|
enableZoom: d.enableZoom,
|
|
1065
1097
|
allowFullscreen: d.allowFullscreen,
|
|
1066
1098
|
compact: d.compact,
|
|
1067
|
-
actions:
|
|
1068
|
-
})),
|
|
1099
|
+
actions: Se.value
|
|
1100
|
+
})), Oe = I({ setup() {
|
|
1069
1101
|
return () => {
|
|
1070
1102
|
var t;
|
|
1071
1103
|
return p.renderHostSlot("mermaid", {
|
|
1072
|
-
source:
|
|
1073
|
-
svg: (t =
|
|
1074
|
-
status:
|
|
1075
|
-
error:
|
|
1104
|
+
source: g.value,
|
|
1105
|
+
svg: (t = b.value) == null ? void 0 : t.svg,
|
|
1106
|
+
status: v.value,
|
|
1107
|
+
error: x.value,
|
|
1076
1108
|
actions: {
|
|
1077
|
-
copy:
|
|
1109
|
+
copy: L,
|
|
1078
1110
|
exportPng: de,
|
|
1079
|
-
fullscreen: () =>
|
|
1080
|
-
retry:
|
|
1111
|
+
fullscreen: () => K(),
|
|
1112
|
+
retry: X
|
|
1081
1113
|
}
|
|
1082
1114
|
}, () => {
|
|
1083
1115
|
let t = m.mermaid;
|
|
1084
1116
|
if (t) {
|
|
1085
1117
|
var n;
|
|
1086
1118
|
let e = t({
|
|
1087
|
-
source:
|
|
1088
|
-
svg: (n =
|
|
1089
|
-
status:
|
|
1090
|
-
error:
|
|
1119
|
+
source: g.value,
|
|
1120
|
+
svg: (n = b.value) == null ? void 0 : n.svg,
|
|
1121
|
+
status: v.value,
|
|
1122
|
+
error: x.value,
|
|
1091
1123
|
actions: {
|
|
1092
|
-
copy:
|
|
1124
|
+
copy: L,
|
|
1093
1125
|
exportPng: de,
|
|
1094
|
-
fullscreen: () =>
|
|
1095
|
-
retry:
|
|
1126
|
+
fullscreen: () => K(),
|
|
1127
|
+
retry: X
|
|
1096
1128
|
}
|
|
1097
1129
|
});
|
|
1098
1130
|
if (!s(e)) return e;
|
|
1099
1131
|
}
|
|
1100
|
-
return
|
|
1132
|
+
return b.value ? R("div", {
|
|
1101
1133
|
class: "vmd-mermaid-diagram",
|
|
1102
|
-
style: { transform: `scale(${
|
|
1103
|
-
}, $(
|
|
1134
|
+
style: { transform: `scale(${C.value})` }
|
|
1135
|
+
}, $(b.value.nodes, p)) : v.value === "error" ? d.showErrors ? R("div", {
|
|
1104
1136
|
"data-vmd-part": "mermaid-error",
|
|
1105
1137
|
class: "vmd-mermaid-error",
|
|
1106
1138
|
role: "status"
|
|
1107
|
-
},
|
|
1139
|
+
}, [x.value, ve()]) : R("div", {
|
|
1108
1140
|
"data-vmd-part": "mermaid-fallback",
|
|
1109
1141
|
class: "vmd-mermaid-fallback",
|
|
1110
1142
|
role: "status"
|
|
1111
|
-
}, e(p.labels.mermaidFallback)) :
|
|
1143
|
+
}, [R("span", { class: "vmd-mermaid-fallback-message" }, e(p.labels.mermaidFallback)), ve()]) : R("div", {
|
|
1112
1144
|
"data-vmd-part": "mermaid-pending",
|
|
1113
1145
|
class: "vmd-mermaid-pending",
|
|
1114
1146
|
role: "status"
|
|
1115
1147
|
}, "Rendering diagram…");
|
|
1116
1148
|
});
|
|
1117
1149
|
};
|
|
1118
|
-
} }),
|
|
1150
|
+
} }), ke = I({ setup() {
|
|
1119
1151
|
return () => p.renderHostSlot("mermaid-error", {
|
|
1120
|
-
source:
|
|
1121
|
-
error:
|
|
1122
|
-
retry:
|
|
1123
|
-
focusSource:
|
|
1152
|
+
source: g.value,
|
|
1153
|
+
error: x.value,
|
|
1154
|
+
retry: X,
|
|
1155
|
+
focusSource: xe
|
|
1124
1156
|
}, () => {
|
|
1125
1157
|
let e = m["mermaid-error"];
|
|
1126
1158
|
if (e) {
|
|
1127
1159
|
let t = e({
|
|
1128
|
-
source:
|
|
1129
|
-
error:
|
|
1130
|
-
retry:
|
|
1131
|
-
focusSource:
|
|
1160
|
+
source: g.value,
|
|
1161
|
+
error: x.value,
|
|
1162
|
+
retry: X,
|
|
1163
|
+
focusSource: xe
|
|
1132
1164
|
});
|
|
1133
1165
|
if (!s(t)) return t;
|
|
1134
1166
|
}
|
|
1135
|
-
return
|
|
1167
|
+
return R("div", {
|
|
1136
1168
|
"data-vmd-part": "mermaid-error",
|
|
1137
1169
|
class: "vmd-mermaid-error",
|
|
1138
1170
|
role: "status"
|
|
1139
|
-
},
|
|
1171
|
+
}, [x.value, ve()]);
|
|
1140
1172
|
});
|
|
1141
|
-
} }),
|
|
1142
|
-
return () => p.renderHostSlot("tabs",
|
|
1173
|
+
} }), He = I({ setup() {
|
|
1174
|
+
return () => p.renderHostSlot("tabs", Ee.value, () => {
|
|
1143
1175
|
let t = m.tabs;
|
|
1144
1176
|
if (t) {
|
|
1145
|
-
let e = t(
|
|
1177
|
+
let e = t(Ee.value);
|
|
1146
1178
|
if (!s(e)) return e;
|
|
1147
1179
|
}
|
|
1148
|
-
return
|
|
1180
|
+
return R("div", {
|
|
1149
1181
|
"data-vmd-part": "mermaid-tabs",
|
|
1150
1182
|
class: "vmd-mermaid-tabs",
|
|
1151
1183
|
role: "tablist"
|
|
1152
|
-
}, [
|
|
1184
|
+
}, [R("button", {
|
|
1153
1185
|
type: "button",
|
|
1154
1186
|
role: "tab",
|
|
1155
1187
|
"data-action": "preview",
|
|
1156
|
-
"aria-selected":
|
|
1157
|
-
"data-active":
|
|
1158
|
-
onClick:
|
|
1159
|
-
}, [
|
|
1188
|
+
"aria-selected": S.value === "preview" ? "true" : "false",
|
|
1189
|
+
"data-active": S.value === "preview" ? "true" : void 0,
|
|
1190
|
+
onClick: Z
|
|
1191
|
+
}, [R(be, { name: "preview" }), e(p.labels.preview)]), R("button", {
|
|
1160
1192
|
type: "button",
|
|
1161
1193
|
role: "tab",
|
|
1162
1194
|
"data-action": "source",
|
|
1163
|
-
"aria-selected":
|
|
1164
|
-
"data-active":
|
|
1165
|
-
onClick:
|
|
1166
|
-
}, [
|
|
1195
|
+
"aria-selected": S.value === "source" ? "true" : "false",
|
|
1196
|
+
"data-active": S.value === "source" ? "true" : void 0,
|
|
1197
|
+
onClick: xe
|
|
1198
|
+
}, [R(be, { name: "source" }), e(p.labels.source)])]);
|
|
1167
1199
|
});
|
|
1168
|
-
} }),
|
|
1169
|
-
return () => p.renderHostSlot("actions",
|
|
1200
|
+
} }), Ue = I({ setup() {
|
|
1201
|
+
return () => p.renderHostSlot("actions", De.value, () => {
|
|
1170
1202
|
let t = m.actions;
|
|
1171
1203
|
if (t) {
|
|
1172
|
-
let e = t(
|
|
1204
|
+
let e = t(De.value);
|
|
1173
1205
|
if (!s(e)) return e;
|
|
1174
1206
|
}
|
|
1175
1207
|
if (d.compact) return null;
|
|
1176
|
-
let n =
|
|
1208
|
+
let n = E.value ? e(p.labels.copied) : e(p.labels.copy), r = (e, t, n, r) => R("button", {
|
|
1177
1209
|
type: "button",
|
|
1178
1210
|
class: "vmd-mermaid-action",
|
|
1179
1211
|
"data-vmd-part": "mermaid-action",
|
|
@@ -1182,63 +1214,63 @@ var X = {
|
|
|
1182
1214
|
"aria-label": t,
|
|
1183
1215
|
title: t,
|
|
1184
1216
|
onClick: r
|
|
1185
|
-
}, [
|
|
1186
|
-
d.enableZoom && i.push(r("zoom-in", e(p.labels.zoomIn), "zoom-in", () =>
|
|
1217
|
+
}, [R(be, { name: n }), R("span", { class: "vmd-visually-hidden" }, t)]), i = [];
|
|
1218
|
+
d.enableZoom && i.push(r("zoom-in", e(p.labels.zoomIn), "zoom-in", () => Y(.25)), r("zoom-out", e(p.labels.zoomOut), "zoom-out", () => Y(-.25)), r("reset-zoom", e(p.labels.reset), "reset", _e)), i.push(r("copy", n, E.value ? "check" : "copy", L), r("export-png", e(p.labels.exportPng), "image", de), r("download-svg", `${e(p.labels.download)} SVG`, "download", W)), d.allowFullscreen && i.push(r("fullscreen", w.value ? e(p.labels.exitFullscreen) : e(p.labels.fullscreen), w.value ? "exit-fullscreen" : "fullscreen", () => K())), i.push(r("retry", e(p.labels.retry), "retry", X));
|
|
1187
1219
|
for (let t of d.actions) {
|
|
1188
1220
|
let n = e(t.label);
|
|
1189
|
-
i.push(
|
|
1221
|
+
i.push(R("button", {
|
|
1190
1222
|
type: "button",
|
|
1191
1223
|
class: "vmd-mermaid-action",
|
|
1192
1224
|
"data-vmd-part": "mermaid-action",
|
|
1193
1225
|
"data-action": t.key,
|
|
1194
|
-
onClick: () => void
|
|
1226
|
+
onClick: () => void Ce(t)
|
|
1195
1227
|
}, n));
|
|
1196
1228
|
}
|
|
1197
|
-
return
|
|
1229
|
+
return R("div", {
|
|
1198
1230
|
"data-vmd-part": "mermaid-actions",
|
|
1199
1231
|
class: "vmd-mermaid-actions"
|
|
1200
1232
|
}, i);
|
|
1201
1233
|
});
|
|
1202
|
-
} }),
|
|
1203
|
-
return () => p.renderHostSlot("header",
|
|
1234
|
+
} }), We = I({ setup() {
|
|
1235
|
+
return () => p.renderHostSlot("header", Te.value, () => {
|
|
1204
1236
|
let e = m.header;
|
|
1205
1237
|
if (e) {
|
|
1206
|
-
let t = e(
|
|
1238
|
+
let t = e(Te.value);
|
|
1207
1239
|
if (!s(t)) return t;
|
|
1208
1240
|
}
|
|
1209
1241
|
return [
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1242
|
+
R("span", { class: "vmd-mermaid-label" }, [R(be, { name: "diagram" }), ae.value]),
|
|
1243
|
+
R(He),
|
|
1244
|
+
R(Ue)
|
|
1213
1245
|
];
|
|
1214
1246
|
});
|
|
1215
1247
|
} });
|
|
1216
1248
|
return l({
|
|
1217
|
-
render:
|
|
1218
|
-
copy:
|
|
1249
|
+
render: N,
|
|
1250
|
+
copy: L,
|
|
1219
1251
|
exportPng: de,
|
|
1220
|
-
downloadSvg:
|
|
1221
|
-
toggleFullscreen:
|
|
1222
|
-
}), (e, t) => (
|
|
1252
|
+
downloadSvg: W,
|
|
1253
|
+
toggleFullscreen: K
|
|
1254
|
+
}), (e, t) => (H(), P("div", {
|
|
1223
1255
|
ref_key: "root",
|
|
1224
|
-
ref:
|
|
1256
|
+
ref: T,
|
|
1225
1257
|
"data-vmd-part": "mermaid",
|
|
1226
1258
|
class: "vmd-mermaid",
|
|
1227
|
-
"data-vmd-theme":
|
|
1228
|
-
"data-status":
|
|
1229
|
-
"data-renderer":
|
|
1230
|
-
"data-fullscreen":
|
|
1259
|
+
"data-vmd-theme": _.value,
|
|
1260
|
+
"data-status": v.value,
|
|
1261
|
+
"data-renderer": ie.value,
|
|
1262
|
+
"data-fullscreen": w.value ? "true" : void 0,
|
|
1231
1263
|
"data-compact": o.compact ? "true" : void 0,
|
|
1232
|
-
"data-view":
|
|
1264
|
+
"data-view": S.value,
|
|
1233
1265
|
role: "figure",
|
|
1234
|
-
"aria-label":
|
|
1266
|
+
"aria-label": ae.value,
|
|
1235
1267
|
tabindex: "-1"
|
|
1236
|
-
}, [
|
|
1268
|
+
}, [ce("div", {
|
|
1237
1269
|
class: "vmd-mermaid-surface",
|
|
1238
|
-
"data-vmd-part":
|
|
1239
|
-
}, [
|
|
1270
|
+
"data-vmd-part": w.value ? "mermaid-fullscreen" : void 0
|
|
1271
|
+
}, [ce("div", Me, [F(q(We))]), S.value === "preview" ? (H(), P("div", Ne, [b.value && v.value === "error" && o.showErrors ? (H(), P("div", Pe, [F(q(ke))])) : se("", !0), F(q(Oe))])) : (H(), P("pre", Fe, [ce("code", null, me(g.value), 1)]))], 8, je)], 8, Ae));
|
|
1240
1272
|
}
|
|
1241
|
-
}),
|
|
1273
|
+
}), Ue = /* @__PURE__ */ I({
|
|
1242
1274
|
__name: "MarkdownMermaid",
|
|
1243
1275
|
props: {
|
|
1244
1276
|
node: { default: void 0 },
|
|
@@ -1272,10 +1304,10 @@ var X = {
|
|
|
1272
1304
|
"action"
|
|
1273
1305
|
],
|
|
1274
1306
|
setup(e, { expose: t, emit: n }) {
|
|
1275
|
-
let r = e, i = n, a = c(), o =
|
|
1307
|
+
let r = e, i = n, a = c(), o = U(), s = M(() => {
|
|
1276
1308
|
var e, t;
|
|
1277
1309
|
return (e = r.code) == null ? ((t = r.node) == null ? void 0 : t.kind) === "mermaid" ? r.node.code : "" : e;
|
|
1278
|
-
}), l =
|
|
1310
|
+
}), l = M(() => {
|
|
1279
1311
|
var e;
|
|
1280
1312
|
return (e = a.regions) == null ? void 0 : e.mermaidBlock;
|
|
1281
1313
|
});
|
|
@@ -1305,7 +1337,7 @@ var X = {
|
|
|
1305
1337
|
exportPng: f,
|
|
1306
1338
|
downloadSvg: p,
|
|
1307
1339
|
toggleFullscreen: m
|
|
1308
|
-
}), (t, n) => l.value ? (
|
|
1340
|
+
}), (t, n) => l.value ? (H(), N(pe(l.value), {
|
|
1309
1341
|
key: 0,
|
|
1310
1342
|
node: e.node,
|
|
1311
1343
|
source: s.value,
|
|
@@ -1322,30 +1354,30 @@ var X = {
|
|
|
1322
1354
|
onExport: n[3] || (n[3] = (e) => i("export", e)),
|
|
1323
1355
|
onFullscreen: n[4] || (n[4] = (e) => i("fullscreen", e)),
|
|
1324
1356
|
onAction: n[5] || (n[5] = (e) => i("action", e))
|
|
1325
|
-
},
|
|
1357
|
+
}, le({ _: 2 }, [
|
|
1326
1358
|
t.$slots.header ? {
|
|
1327
1359
|
name: "header",
|
|
1328
|
-
fn:
|
|
1360
|
+
fn: J((e) => [W(t.$slots, "header", z(L(e || {})))]),
|
|
1329
1361
|
key: "0"
|
|
1330
1362
|
} : void 0,
|
|
1331
1363
|
t.$slots.tabs ? {
|
|
1332
1364
|
name: "tabs",
|
|
1333
|
-
fn:
|
|
1365
|
+
fn: J((e) => [W(t.$slots, "tabs", z(L(e || {})))]),
|
|
1334
1366
|
key: "1"
|
|
1335
1367
|
} : void 0,
|
|
1336
1368
|
t.$slots.actions ? {
|
|
1337
1369
|
name: "actions",
|
|
1338
|
-
fn:
|
|
1370
|
+
fn: J((e) => [W(t.$slots, "actions", z(L(e || {})))]),
|
|
1339
1371
|
key: "2"
|
|
1340
1372
|
} : void 0,
|
|
1341
1373
|
t.$slots.mermaid ? {
|
|
1342
1374
|
name: "mermaid",
|
|
1343
|
-
fn:
|
|
1375
|
+
fn: J((e) => [W(t.$slots, "mermaid", z(L(e || {})))]),
|
|
1344
1376
|
key: "3"
|
|
1345
1377
|
} : void 0,
|
|
1346
1378
|
t.$slots["mermaid-error"] ? {
|
|
1347
1379
|
name: "mermaid-error",
|
|
1348
|
-
fn:
|
|
1380
|
+
fn: J((e) => [W(t.$slots, "mermaid-error", z(L(e || {})))]),
|
|
1349
1381
|
key: "4"
|
|
1350
1382
|
} : void 0
|
|
1351
1383
|
]), 1064, [
|
|
@@ -1358,7 +1390,7 @@ var X = {
|
|
|
1358
1390
|
"allow-fullscreen",
|
|
1359
1391
|
"compact",
|
|
1360
1392
|
"actions"
|
|
1361
|
-
])) : (
|
|
1393
|
+
])) : (H(), N(He, {
|
|
1362
1394
|
key: 1,
|
|
1363
1395
|
ref_key: "block",
|
|
1364
1396
|
ref: o,
|
|
@@ -1377,30 +1409,30 @@ var X = {
|
|
|
1377
1409
|
onExport: n[9] || (n[9] = (e) => i("export", e)),
|
|
1378
1410
|
onFullscreen: n[10] || (n[10] = (e) => i("fullscreen", e)),
|
|
1379
1411
|
onAction: n[11] || (n[11] = (e) => i("action", e))
|
|
1380
|
-
},
|
|
1412
|
+
}, le({ _: 2 }, [
|
|
1381
1413
|
t.$slots.header ? {
|
|
1382
1414
|
name: "header",
|
|
1383
|
-
fn:
|
|
1415
|
+
fn: J((e) => [W(t.$slots, "header", z(L(e || {})))]),
|
|
1384
1416
|
key: "0"
|
|
1385
1417
|
} : void 0,
|
|
1386
1418
|
t.$slots.tabs ? {
|
|
1387
1419
|
name: "tabs",
|
|
1388
|
-
fn:
|
|
1420
|
+
fn: J((e) => [W(t.$slots, "tabs", z(L(e || {})))]),
|
|
1389
1421
|
key: "1"
|
|
1390
1422
|
} : void 0,
|
|
1391
1423
|
t.$slots.actions ? {
|
|
1392
1424
|
name: "actions",
|
|
1393
|
-
fn:
|
|
1425
|
+
fn: J((e) => [W(t.$slots, "actions", z(L(e || {})))]),
|
|
1394
1426
|
key: "2"
|
|
1395
1427
|
} : void 0,
|
|
1396
1428
|
t.$slots.mermaid ? {
|
|
1397
1429
|
name: "mermaid",
|
|
1398
|
-
fn:
|
|
1430
|
+
fn: J((e) => [W(t.$slots, "mermaid", z(L(e || {})))]),
|
|
1399
1431
|
key: "3"
|
|
1400
1432
|
} : void 0,
|
|
1401
1433
|
t.$slots["mermaid-error"] ? {
|
|
1402
1434
|
name: "mermaid-error",
|
|
1403
|
-
fn:
|
|
1435
|
+
fn: J((e) => [W(t.$slots, "mermaid-error", z(L(e || {})))]),
|
|
1404
1436
|
key: "4"
|
|
1405
1437
|
} : void 0
|
|
1406
1438
|
]), 1032, [
|
|
@@ -1415,8 +1447,8 @@ var X = {
|
|
|
1415
1447
|
"actions"
|
|
1416
1448
|
]));
|
|
1417
1449
|
}
|
|
1418
|
-
}),
|
|
1419
|
-
p:
|
|
1450
|
+
}), We = {
|
|
1451
|
+
p: D,
|
|
1420
1452
|
h1: v,
|
|
1421
1453
|
h2: v,
|
|
1422
1454
|
h3: v,
|
|
@@ -1424,25 +1456,25 @@ var X = {
|
|
|
1424
1456
|
h5: v,
|
|
1425
1457
|
h6: v,
|
|
1426
1458
|
em: _,
|
|
1427
|
-
strong:
|
|
1428
|
-
del:
|
|
1459
|
+
strong: ie,
|
|
1460
|
+
del: O,
|
|
1429
1461
|
a: S,
|
|
1430
1462
|
img: b,
|
|
1431
1463
|
ul: C,
|
|
1432
1464
|
ol: C,
|
|
1433
|
-
li:
|
|
1465
|
+
li: w,
|
|
1434
1466
|
blockquote: m,
|
|
1435
1467
|
hr: y,
|
|
1436
|
-
table:
|
|
1437
|
-
thead:
|
|
1438
|
-
tbody:
|
|
1439
|
-
tfoot:
|
|
1440
|
-
tr:
|
|
1441
|
-
th:
|
|
1442
|
-
td:
|
|
1468
|
+
table: ae,
|
|
1469
|
+
thead: j,
|
|
1470
|
+
tbody: j,
|
|
1471
|
+
tfoot: j,
|
|
1472
|
+
tr: oe,
|
|
1473
|
+
th: A,
|
|
1474
|
+
td: A,
|
|
1443
1475
|
code: x,
|
|
1444
1476
|
br: h
|
|
1445
|
-
},
|
|
1477
|
+
}, Ge = {
|
|
1446
1478
|
p: "paragraph",
|
|
1447
1479
|
h1: "heading",
|
|
1448
1480
|
h2: "heading",
|
|
@@ -1471,61 +1503,61 @@ var X = {
|
|
|
1471
1503
|
br: "break",
|
|
1472
1504
|
input: "taskItem"
|
|
1473
1505
|
};
|
|
1474
|
-
function
|
|
1506
|
+
function Ke(e) {
|
|
1475
1507
|
if (e === "code") return p;
|
|
1476
1508
|
if (e === "custom") return g;
|
|
1477
1509
|
if (e === "math") return ke;
|
|
1478
|
-
if (e === "mermaid") return
|
|
1510
|
+
if (e === "mermaid") return Ue;
|
|
1479
1511
|
}
|
|
1480
1512
|
function Q(e) {
|
|
1481
1513
|
return typeof e == "string" || typeof e == "object";
|
|
1482
1514
|
}
|
|
1483
|
-
function
|
|
1515
|
+
function qe(e) {
|
|
1484
1516
|
return typeof e == "function";
|
|
1485
1517
|
}
|
|
1486
|
-
function
|
|
1518
|
+
function Je(e) {
|
|
1487
1519
|
var t;
|
|
1488
|
-
return e.kind === "element" ? (t =
|
|
1520
|
+
return e.kind === "element" ? (t = Ge[e.tag]) == null ? e.tag : t : e.kind;
|
|
1489
1521
|
}
|
|
1490
|
-
function
|
|
1522
|
+
function Ye(e) {
|
|
1491
1523
|
var t;
|
|
1492
1524
|
return ((t = e.attrs.class) == null ? "" : t).split(/\s+/).filter(Boolean);
|
|
1493
1525
|
}
|
|
1494
|
-
function
|
|
1526
|
+
function Xe(e) {
|
|
1495
1527
|
return e.children.find((e) => e.kind === "element" && e.tag === "input" && e.attrs.type === "checkbox");
|
|
1496
1528
|
}
|
|
1497
|
-
function
|
|
1529
|
+
function Ze(e) {
|
|
1498
1530
|
if (e.kind === "element") {
|
|
1499
|
-
if (e.tag === "li" &&
|
|
1500
|
-
if (e.tag === "sup" && (
|
|
1501
|
-
if (e.tag === "section" && (
|
|
1531
|
+
if (e.tag === "li" && Xe(e)) return "taskItem";
|
|
1532
|
+
if (e.tag === "sup" && (Ye(e).includes("footnote-ref") || e.attrs["data-footnote-ref"] !== void 0 || e.children.some((e) => e.kind === "element" && e.tag === "a" && (Ye(e).includes("footnote-ref") || e.attrs["data-footnote-ref"] !== void 0)))) return "footnoteReference";
|
|
1533
|
+
if (e.tag === "section" && (Ye(e).includes("footnotes") || e.attrs["data-footnotes"] !== void 0)) return "footnotes";
|
|
1502
1534
|
}
|
|
1503
1535
|
}
|
|
1504
|
-
function
|
|
1505
|
-
for (let n of e) if (n.kind === "element" && n.attrs.id === t || "children" in n && Array.isArray(n.children) &&
|
|
1536
|
+
function Qe(e, t) {
|
|
1537
|
+
for (let n of e) if (n.kind === "element" && n.attrs.id === t || "children" in n && Array.isArray(n.children) && Qe(n.children, t)) return !0;
|
|
1506
1538
|
return !1;
|
|
1507
1539
|
}
|
|
1508
|
-
function
|
|
1540
|
+
function $e(e) {
|
|
1509
1541
|
if (e.kind === "element") for (let n of e.children) {
|
|
1510
1542
|
var t;
|
|
1511
1543
|
if (n.kind === "element" && n.tag === "a" && (t = n.attrs.href) != null && t.startsWith("#")) return n.attrs.href.slice(1);
|
|
1512
1544
|
}
|
|
1513
1545
|
}
|
|
1514
|
-
function
|
|
1546
|
+
function et(e) {
|
|
1515
1547
|
if (e.kind === "element") {
|
|
1516
|
-
let t =
|
|
1548
|
+
let t = Je(e);
|
|
1517
1549
|
return t === e.tag ? [e.tag] : [e.tag, t];
|
|
1518
1550
|
}
|
|
1519
1551
|
return e.kind === "custom" ? [e.tag, "custom"] : e.kind === "plugin" ? [e.type, "plugin"] : [e.kind];
|
|
1520
1552
|
}
|
|
1521
|
-
function
|
|
1522
|
-
for (let r of
|
|
1553
|
+
function tt(e, t) {
|
|
1554
|
+
for (let r of et(e)) {
|
|
1523
1555
|
var n;
|
|
1524
1556
|
let e = (n = t.nodeComponents) == null ? void 0 : n[r];
|
|
1525
|
-
if (
|
|
1557
|
+
if (qe(e)) return e;
|
|
1526
1558
|
}
|
|
1527
1559
|
}
|
|
1528
|
-
function
|
|
1560
|
+
function nt(e, t) {
|
|
1529
1561
|
if (e.kind === "element" && e.tag === "code") {
|
|
1530
1562
|
var n;
|
|
1531
1563
|
let e = (n = t.nodeComponents) == null ? void 0 : n.inlineCode;
|
|
@@ -1533,14 +1565,14 @@ function Ze(e, t) {
|
|
|
1533
1565
|
let r = t.components.code;
|
|
1534
1566
|
return typeof r == "function" || Q(r) ? r : void 0;
|
|
1535
1567
|
}
|
|
1536
|
-
let r =
|
|
1568
|
+
let r = Ze(e);
|
|
1537
1569
|
if (r) {
|
|
1538
1570
|
var i;
|
|
1539
1571
|
let e = (i = t.nodeComponents) == null ? void 0 : i[r];
|
|
1540
1572
|
if (Q(e)) return e;
|
|
1541
1573
|
}
|
|
1542
|
-
let a =
|
|
1543
|
-
for (let n of
|
|
1574
|
+
let a = Je(e);
|
|
1575
|
+
for (let n of et(e)) {
|
|
1544
1576
|
var o, s;
|
|
1545
1577
|
let e = (o = t.nodeComponents) == null ? void 0 : o[n];
|
|
1546
1578
|
if (Q(e)) return e;
|
|
@@ -1552,29 +1584,29 @@ function Ze(e, t) {
|
|
|
1552
1584
|
}
|
|
1553
1585
|
}
|
|
1554
1586
|
}
|
|
1555
|
-
function
|
|
1587
|
+
function rt(e, t) {
|
|
1556
1588
|
if (!e.segments || e.segments.length === 0) return e.value;
|
|
1557
1589
|
let n = t.components.mark;
|
|
1558
|
-
return e.segments.map((e, t) => e.match ? typeof n == "string" ?
|
|
1590
|
+
return e.segments.map((e, t) => e.match ? typeof n == "string" ? R(n, {
|
|
1559
1591
|
class: "vmd-search-match",
|
|
1560
1592
|
"data-vmd-part": "search-match",
|
|
1561
1593
|
key: t
|
|
1562
|
-
}, e.value) : typeof n == "object" || typeof n == "function" ?
|
|
1594
|
+
}, e.value) : typeof n == "object" || typeof n == "function" ? R(n, {
|
|
1563
1595
|
class: "vmd-search-match",
|
|
1564
1596
|
"data-vmd-part": "search-match",
|
|
1565
1597
|
key: t
|
|
1566
|
-
}, { default: () => e.value }) :
|
|
1598
|
+
}, { default: () => e.value }) : R("mark", {
|
|
1567
1599
|
class: "vmd-search-match",
|
|
1568
1600
|
"data-vmd-part": "search-match",
|
|
1569
1601
|
key: t
|
|
1570
1602
|
}, e.value) : e.value);
|
|
1571
1603
|
}
|
|
1572
|
-
function
|
|
1604
|
+
function it(e, t) {
|
|
1573
1605
|
var n;
|
|
1574
1606
|
let r = (n = t.nodeComponents) == null ? void 0 : n[e];
|
|
1575
1607
|
return Q(r) ? r : void 0;
|
|
1576
1608
|
}
|
|
1577
|
-
function
|
|
1609
|
+
function at(e) {
|
|
1578
1610
|
return e.kind === "element" || e.kind === "custom" ? {
|
|
1579
1611
|
kind: e.kind,
|
|
1580
1612
|
tag: e.tag,
|
|
@@ -1584,36 +1616,36 @@ function et(e) {
|
|
|
1584
1616
|
attrs: {}
|
|
1585
1617
|
};
|
|
1586
1618
|
}
|
|
1587
|
-
function
|
|
1619
|
+
function ot(e, t) {
|
|
1588
1620
|
return () => $(e.children, t);
|
|
1589
1621
|
}
|
|
1590
|
-
var
|
|
1591
|
-
function
|
|
1592
|
-
let t =
|
|
1622
|
+
var st = /* @__PURE__ */ new WeakMap();
|
|
1623
|
+
function ct(e) {
|
|
1624
|
+
let t = st.get(e);
|
|
1593
1625
|
if (t !== void 0) return t;
|
|
1594
1626
|
let n = e.props, r = Array.isArray(n) ? n.indexOf("children") !== -1 : typeof n == "object" && !!n && Object.prototype.hasOwnProperty.call(n, "children");
|
|
1595
|
-
return
|
|
1627
|
+
return st.set(e, r), r;
|
|
1596
1628
|
}
|
|
1597
|
-
function
|
|
1629
|
+
function lt(e, t, n, i, a = {}, o) {
|
|
1598
1630
|
let s = r(r(r({}, i), a), {}, { key: t.key });
|
|
1599
|
-
"children" in s && (typeof e == "string" || !
|
|
1631
|
+
"children" in s && (typeof e == "string" || !ct(e)) && delete s.children;
|
|
1600
1632
|
let c = o == null ? (() => []) : o;
|
|
1601
|
-
return typeof e == "string" ?
|
|
1633
|
+
return typeof e == "string" ? R(e, s, c()) : R(e, r(r({}, s), {}, { node: t }), { default: c });
|
|
1602
1634
|
}
|
|
1603
|
-
function
|
|
1635
|
+
function ut(e, t, n = !1) {
|
|
1604
1636
|
var i, a, o;
|
|
1605
1637
|
let s = (i = t.nodeComponents) == null ? void 0 : i.code, c = e.language ? `language-${e.language}` : void 0, l = `${e.key}-code`;
|
|
1606
|
-
if (!n &&
|
|
1638
|
+
if (!n && qe(s)) return s(r(r({ node: e }, at(e)), {}, {
|
|
1607
1639
|
key: l,
|
|
1608
1640
|
children: () => [e.code],
|
|
1609
|
-
defaultRender: () =>
|
|
1641
|
+
defaultRender: () => ut(e, t, !0),
|
|
1610
1642
|
context: t
|
|
1611
1643
|
}));
|
|
1612
1644
|
let u = (a = (o = Q(s) ? s : void 0) == null ? Q(t.components.code) ? t.components.code : void 0 : o) == null ? "code" : a;
|
|
1613
|
-
return typeof u == "string" ?
|
|
1645
|
+
return typeof u == "string" ? R(u, {
|
|
1614
1646
|
class: c ? ["vmd-code-element", c] : "vmd-code-element",
|
|
1615
1647
|
key: l
|
|
1616
|
-
}, e.code) :
|
|
1648
|
+
}, e.code) : R(u, r({
|
|
1617
1649
|
node: e,
|
|
1618
1650
|
className: c,
|
|
1619
1651
|
key: l
|
|
@@ -1622,103 +1654,101 @@ function at(e, t, n = !1) {
|
|
|
1622
1654
|
language: e.language
|
|
1623
1655
|
} : {}), { default: () => [e.code] });
|
|
1624
1656
|
}
|
|
1625
|
-
function
|
|
1657
|
+
function dt(e, t) {
|
|
1626
1658
|
var n, r;
|
|
1627
1659
|
let i = t.components.pre;
|
|
1628
|
-
return typeof i == "function" || Q(i) ?
|
|
1660
|
+
return typeof i == "function" || Q(i) ? lt(i, e, t, {}, {}, () => [ut(e, t)]) : Q(t.components.code) || Q((n = t.nodeComponents) == null ? void 0 : n.code) || qe((r = t.nodeComponents) == null ? void 0 : r.code) ? lt(p, e, t, {}, {}, () => [ut(e, t)]) : R(Ee, {
|
|
1629
1661
|
node: e,
|
|
1630
1662
|
key: e.key
|
|
1631
1663
|
});
|
|
1632
1664
|
}
|
|
1633
|
-
function
|
|
1634
|
-
let n =
|
|
1635
|
-
return
|
|
1665
|
+
function ft(e, t) {
|
|
1666
|
+
let n = Xe(e), r = (n == null ? void 0 : n.attrs.checked) !== void 0 && n.attrs.checked !== "false", i = e.children.filter((e) => e !== n);
|
|
1667
|
+
return R(k, {
|
|
1636
1668
|
node: e,
|
|
1637
1669
|
key: e.key,
|
|
1638
1670
|
checked: r,
|
|
1639
1671
|
children: e.children
|
|
1640
1672
|
}, { default: () => $(i, t) });
|
|
1641
1673
|
}
|
|
1642
|
-
function
|
|
1643
|
-
return
|
|
1674
|
+
function pt(e, t) {
|
|
1675
|
+
return R(E, {
|
|
1644
1676
|
node: e,
|
|
1645
1677
|
key: e.key
|
|
1646
1678
|
}, { default: () => $(e.children, t) });
|
|
1647
1679
|
}
|
|
1648
|
-
function
|
|
1649
|
-
let n =
|
|
1650
|
-
return
|
|
1680
|
+
function mt(e, t) {
|
|
1681
|
+
let n = $e(e), r = n !== void 0 && t.document !== void 0 && !Qe(t.document.nodes, n);
|
|
1682
|
+
return R(T, {
|
|
1651
1683
|
node: e,
|
|
1652
1684
|
key: e.key,
|
|
1653
1685
|
missing: r
|
|
1654
1686
|
}, { default: () => $(e.children, t) });
|
|
1655
1687
|
}
|
|
1656
|
-
function
|
|
1657
|
-
if (n === "taskItem") return
|
|
1658
|
-
if (n === "footnotes") return
|
|
1659
|
-
if (n === "footnoteReference") return
|
|
1688
|
+
function ht(e, t, n) {
|
|
1689
|
+
if (n === "taskItem") return ft(e, t);
|
|
1690
|
+
if (n === "footnotes") return pt(e, t);
|
|
1691
|
+
if (n === "footnoteReference") return mt(e, t);
|
|
1660
1692
|
}
|
|
1661
|
-
function
|
|
1693
|
+
function gt(e, t) {
|
|
1662
1694
|
var n;
|
|
1663
|
-
let r = (n =
|
|
1664
|
-
return
|
|
1695
|
+
let r = (n = it(e.tag, t)) == null ? it("custom", t) : n;
|
|
1696
|
+
return lt(r == null ? g : r, e, t, e.attrs, {
|
|
1665
1697
|
tag: e.tag,
|
|
1666
1698
|
customProps: e.props
|
|
1667
|
-
},
|
|
1699
|
+
}, ot(e, t));
|
|
1668
1700
|
}
|
|
1669
|
-
function
|
|
1701
|
+
function _t(e, t) {
|
|
1670
1702
|
switch (e.kind) {
|
|
1671
|
-
case "text": return
|
|
1703
|
+
case "text": return rt(e, t);
|
|
1672
1704
|
case "element": {
|
|
1673
|
-
let n =
|
|
1705
|
+
let n = nt(e, t);
|
|
1674
1706
|
if (!n) {
|
|
1675
|
-
let n =
|
|
1707
|
+
let n = Ze(e), r = n ? ht(e, t, n) : void 0;
|
|
1676
1708
|
if (r !== void 0) return r;
|
|
1677
1709
|
}
|
|
1678
|
-
let i = n == null ?
|
|
1710
|
+
let i = n == null ? We[e.tag] : n;
|
|
1679
1711
|
if (!i) {
|
|
1680
1712
|
let n = r({}, e.attrs);
|
|
1681
|
-
return delete n.children,
|
|
1713
|
+
return delete n.children, R(e.tag, r(r({}, n), {}, { key: e.key }), ot(e, t)());
|
|
1682
1714
|
}
|
|
1683
|
-
return
|
|
1715
|
+
return lt(i, e, t, e.attrs, { children: e.children }, ot(e, t));
|
|
1684
1716
|
}
|
|
1685
|
-
case "code": return
|
|
1686
|
-
case "custom": return
|
|
1717
|
+
case "code": return dt(e, t);
|
|
1718
|
+
case "custom": return gt(e, t);
|
|
1687
1719
|
case "math":
|
|
1688
1720
|
var n, i;
|
|
1689
|
-
return
|
|
1721
|
+
return lt((n = (i = nt(e, t)) == null ? Ke("math") : i) == null ? "span" : n, e, t, {}, {
|
|
1690
1722
|
tex: e.tex,
|
|
1691
1723
|
displayMode: e.displayMode,
|
|
1692
1724
|
rendered: e.rendered
|
|
1693
1725
|
});
|
|
1694
1726
|
case "mermaid":
|
|
1695
1727
|
var a, o;
|
|
1696
|
-
return
|
|
1728
|
+
return lt((a = (o = nt(e, t)) == null ? Ke("mermaid") : o) == null ? "pre" : a, e, t, {}, { code: e.code });
|
|
1697
1729
|
case "plugin":
|
|
1698
1730
|
var s, c;
|
|
1699
|
-
return
|
|
1731
|
+
return lt((s = (c = nt(e, t)) == null ? Ke(e.type) : c) == null ? "div" : s, e, t, {}, { payload: e.payload }, e.children ? () => $(e.children, t) : () => []);
|
|
1700
1732
|
default: return null;
|
|
1701
1733
|
}
|
|
1702
1734
|
}
|
|
1703
|
-
function
|
|
1704
|
-
if (e.kind === "text") return
|
|
1735
|
+
function vt(e, t) {
|
|
1736
|
+
if (e.kind === "text") return rt(e, t);
|
|
1705
1737
|
if (e.kind !== "code") {
|
|
1706
|
-
let n =
|
|
1738
|
+
let n = tt(e, t);
|
|
1707
1739
|
if (n) {
|
|
1708
|
-
let i = n, a = e.kind === "element" || e.kind === "custom" ?
|
|
1709
|
-
return i(r(r({ node: e },
|
|
1740
|
+
let i = n, a = e.kind === "element" || e.kind === "custom" ? ot(e, t) : void 0;
|
|
1741
|
+
return i(r(r({ node: e }, at(e)), {}, {
|
|
1710
1742
|
key: e.key,
|
|
1711
1743
|
children: () => a ? a() : [],
|
|
1712
|
-
defaultRender: () =>
|
|
1744
|
+
defaultRender: () => _t(e, t),
|
|
1713
1745
|
context: t
|
|
1714
1746
|
}));
|
|
1715
1747
|
}
|
|
1716
1748
|
}
|
|
1717
|
-
return
|
|
1749
|
+
return _t(e, t);
|
|
1718
1750
|
}
|
|
1719
1751
|
function $(e, t) {
|
|
1720
|
-
return e.map((e) =>
|
|
1752
|
+
return e.map((e) => vt(e, t));
|
|
1721
1753
|
}
|
|
1722
|
-
export { Ee as a, ke as i,
|
|
1723
|
-
|
|
1724
|
-
//# sourceMappingURL=render-Cs8iKrgz.js.map
|
|
1754
|
+
export { Ee as a, ke as i, Ue as n, ye as o, He as r, ve as s, $ as t };
|