@coderminer/vue-markdown 0.0.0-stage → 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 +226 -0
- package/LICENSE +21 -0
- package/README.md +584 -3
- package/README.zh-CN.md +550 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
- package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
- package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
- package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
- package/dist/chunks/adapters-CMwX_NEI.js +26 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
- package/dist/chunks/codemirror-DyphMAEg.js +82 -0
- package/dist/chunks/config-aRYo2R8_.js +10 -0
- package/dist/chunks/context-8NfW6fxI.js +30 -0
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
- package/dist/chunks/export-BrgMLgUp.js +1574 -0
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/identity-Bi27FKyx.js +6243 -0
- package/dist/chunks/labels-BtHiUTQI.js +47 -0
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
- package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
- package/dist/chunks/normalize-VKfQXZiK.js +226 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-YWo5uqTh.js +27 -0
- package/dist/chunks/preset-BjaOuJUL.js +44 -0
- package/dist/chunks/registry-B7BfEkuy.js +6150 -0
- package/dist/chunks/render-DAqK0w5J.js +1754 -0
- package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
- package/dist/chunks/runtime-D95F41zG.js +574 -0
- package/dist/chunks/security-y4EwUyAs.js +212 -0
- package/dist/chunks/shared-NjFDPmkb.js +67 -0
- package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
- package/dist/chunks/url-D2BoivaE.js +24 -0
- package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
- package/dist/components/CodeBlock.d.ts +73 -0
- package/dist/components/CodeBlock.js +1 -0
- package/dist/components/Icon.d.ts +6 -0
- package/dist/components/MarkdownBlockquote.d.ts +18 -0
- package/dist/components/MarkdownBlockquote.js +1 -0
- package/dist/components/MarkdownBreak.d.ts +8 -0
- package/dist/components/MarkdownBreak.js +1 -0
- package/dist/components/MarkdownChildren.d.ts +17 -0
- package/dist/components/MarkdownCode.d.ts +29 -0
- package/dist/components/MarkdownCode.js +1 -0
- package/dist/components/MarkdownConfigProvider.d.ts +33 -0
- package/dist/components/MarkdownConfigProvider.js +1 -0
- package/dist/components/MarkdownContent.d.ts +16 -0
- package/dist/components/MarkdownContent.js +1 -0
- package/dist/components/MarkdownCustomTag.d.ts +20 -0
- package/dist/components/MarkdownCustomTag.js +1 -0
- package/dist/components/MarkdownEmphasis.d.ts +18 -0
- package/dist/components/MarkdownEmphasis.js +1 -0
- package/dist/components/MarkdownEmpty.d.ts +8 -0
- package/dist/components/MarkdownEmpty.js +1 -0
- package/dist/components/MarkdownError.d.ts +11 -0
- package/dist/components/MarkdownError.js +1 -0
- package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
- package/dist/components/MarkdownFootnoteReference.js +1 -0
- package/dist/components/MarkdownFootnotes.d.ts +17 -0
- package/dist/components/MarkdownFootnotes.js +1 -0
- package/dist/components/MarkdownHeading.d.ts +18 -0
- package/dist/components/MarkdownHeading.js +1 -0
- package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
- package/dist/components/MarkdownHorizontalRule.js +1 -0
- package/dist/components/MarkdownHtml.d.ts +8 -0
- package/dist/components/MarkdownHtml.js +1 -0
- package/dist/components/MarkdownImage.d.ts +15 -0
- package/dist/components/MarkdownImage.js +1 -0
- package/dist/components/MarkdownInlineCode.d.ts +18 -0
- package/dist/components/MarkdownInlineCode.js +1 -0
- package/dist/components/MarkdownLink.d.ts +22 -0
- package/dist/components/MarkdownLink.js +1 -0
- package/dist/components/MarkdownList.d.ts +18 -0
- package/dist/components/MarkdownList.js +1 -0
- package/dist/components/MarkdownListItem.d.ts +18 -0
- package/dist/components/MarkdownListItem.js +1 -0
- package/dist/components/MarkdownLoading.d.ts +8 -0
- package/dist/components/MarkdownLoading.js +1 -0
- package/dist/components/MarkdownMath.d.ts +12 -0
- package/dist/components/MarkdownMath.js +1 -0
- package/dist/components/MarkdownMermaid.d.ts +78 -0
- package/dist/components/MarkdownMermaid.js +1 -0
- package/dist/components/MarkdownParagraph.d.ts +18 -0
- package/dist/components/MarkdownParagraph.js +1 -0
- package/dist/components/MarkdownRenderer.d.ts +167 -0
- package/dist/components/MarkdownRenderer.js +1 -0
- package/dist/components/MarkdownRoot.d.ts +24 -0
- package/dist/components/MarkdownRoot.js +1 -0
- package/dist/components/MarkdownStrikethrough.d.ts +18 -0
- package/dist/components/MarkdownStrikethrough.js +1 -0
- package/dist/components/MarkdownStrong.d.ts +18 -0
- package/dist/components/MarkdownStrong.js +1 -0
- package/dist/components/MarkdownTable.d.ts +18 -0
- package/dist/components/MarkdownTable.js +1 -0
- package/dist/components/MarkdownTableCell.d.ts +20 -0
- package/dist/components/MarkdownTableCell.js +1 -0
- package/dist/components/MarkdownTableRow.d.ts +18 -0
- package/dist/components/MarkdownTableRow.js +1 -0
- package/dist/components/MarkdownTableSection.d.ts +18 -0
- package/dist/components/MarkdownTableSection.js +1 -0
- package/dist/components/MarkdownTaskItem.d.ts +20 -0
- package/dist/components/MarkdownTaskItem.js +1 -0
- package/dist/components/MarkdownToc.d.ts +36 -0
- package/dist/components/MarkdownToc.js +1 -0
- package/dist/components/MarkdownTocItem.d.ts +14 -0
- package/dist/components/MarkdownTocItem.js +1 -0
- package/dist/components/MermaidBlock.d.ts +50 -0
- package/dist/components/MermaidBlock.js +1 -0
- package/dist/components/MermaidLiveEditor.d.ts +44 -0
- package/dist/components/MermaidLiveEditor.js +1 -0
- package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
- package/dist/components/VueSyntaxHighlighter.js +1 -0
- package/dist/components/codeRegion.d.ts +14 -0
- package/dist/components/config.d.ts +7 -0
- package/dist/components/context.d.ts +45 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +38 -0
- package/dist/components/render.d.ts +9 -0
- package/dist/components/scroll-lock.d.ts +7 -0
- package/dist/components/types.d.ts +61 -0
- package/dist/composables/useActiveHeading.d.ts +12 -0
- package/dist/composables/useCodeHighlighter.d.ts +30 -0
- package/dist/composables/useLineWindow.d.ts +38 -0
- package/dist/composables/useMarkdownDocument.d.ts +25 -0
- package/dist/core/adapters.d.ts +7 -0
- package/dist/core/config.d.ts +5 -0
- package/dist/core/diagnostics.d.ts +9 -0
- package/dist/core/finalize.d.ts +18 -0
- package/dist/core/hast-nodes.d.ts +3 -0
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/highlight-lines.d.ts +8 -0
- package/dist/core/identity.d.ts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/core/manifest.d.ts +38 -0
- package/dist/core/memo.d.ts +5 -0
- package/dist/core/model-hast.d.ts +8 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/normalize.d.ts +37 -0
- package/dist/core/parts.d.ts +136 -0
- package/dist/core/preset.d.ts +10 -0
- package/dist/core/run.d.ts +16 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/security.d.ts +21 -0
- package/dist/core/slugger.d.ts +13 -0
- package/dist/core/types.d.ts +392 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/editor/codemirror.d.ts +14 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/headless.d.ts +21 -0
- package/dist/headless.js +12 -0
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +4 -0
- package/dist/highlight/shared.d.ts +11 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +75 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +11 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +53 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +585 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +6 -0
- package/dist/mermaid/index.js +8 -0
- package/dist/mermaid/plugin.d.ts +17 -0
- package/dist/mermaid/runtime.d.ts +14 -0
- 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 +16 -0
- package/dist/node-components.d.ts +1 -0
- package/dist/node-components.js +39 -0
- package/dist/pipeline/custom.d.ts +8 -0
- package/dist/pipeline/identity.d.ts +12 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/official.d.ts +6 -0
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +1 -0
- package/dist/plugins/builtin.d.ts +15 -0
- package/dist/plugins/define.d.ts +7 -0
- package/dist/plugins/registry.d.ts +16 -0
- package/dist/plugins/source.d.ts +7 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +1 -0
- package/dist/presets.d.ts +3 -0
- package/dist/presets.js +1 -0
- package/dist/style.css +2 -0
- package/dist/styles/components.css +737 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/math-full.css +3 -0
- package/dist/styles/math.css +18 -0
- package/dist/styles/tokens.css +96 -0
- package/package.json +214 -6
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, l = (n, r, o) => (o = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : o, n));
|
|
19
|
+
export { s as n, l as r, o as t };
|
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import { t as e } from "./asyncToGenerator-ChigusFD.js";
|
|
2
|
+
// src/mermaid/sanitize.ts
|
|
3
|
+
var t = /* @__PURE__ */ new Set([
|
|
4
|
+
"svg",
|
|
5
|
+
"g",
|
|
6
|
+
"path",
|
|
7
|
+
"rect",
|
|
8
|
+
"circle",
|
|
9
|
+
"ellipse",
|
|
10
|
+
"line",
|
|
11
|
+
"polyline",
|
|
12
|
+
"polygon",
|
|
13
|
+
"text",
|
|
14
|
+
"tspan",
|
|
15
|
+
"defs",
|
|
16
|
+
"marker",
|
|
17
|
+
"use",
|
|
18
|
+
"title",
|
|
19
|
+
"desc",
|
|
20
|
+
"clippath",
|
|
21
|
+
"lineargradient",
|
|
22
|
+
"radialgradient",
|
|
23
|
+
"stop",
|
|
24
|
+
"pattern",
|
|
25
|
+
"mask",
|
|
26
|
+
"symbol",
|
|
27
|
+
"textpath",
|
|
28
|
+
"style"
|
|
29
|
+
]), n = {
|
|
30
|
+
clippath: "clipPath",
|
|
31
|
+
lineargradient: "linearGradient",
|
|
32
|
+
radialgradient: "radialGradient",
|
|
33
|
+
textpath: "textPath"
|
|
34
|
+
}, r = {
|
|
35
|
+
id: "id",
|
|
36
|
+
class: "class",
|
|
37
|
+
d: "d",
|
|
38
|
+
fill: "fill",
|
|
39
|
+
fillopacity: "fill-opacity",
|
|
40
|
+
fillrule: "fill-rule",
|
|
41
|
+
stroke: "stroke",
|
|
42
|
+
strokewidth: "stroke-width",
|
|
43
|
+
strokedasharray: "stroke-dasharray",
|
|
44
|
+
strokedashoffset: "stroke-dashoffset",
|
|
45
|
+
strokelinecap: "stroke-linecap",
|
|
46
|
+
strokelinejoin: "stroke-linejoin",
|
|
47
|
+
strokemiterlimit: "stroke-miterlimit",
|
|
48
|
+
strokeopacity: "stroke-opacity",
|
|
49
|
+
x: "x",
|
|
50
|
+
y: "y",
|
|
51
|
+
x1: "x1",
|
|
52
|
+
y1: "y1",
|
|
53
|
+
x2: "x2",
|
|
54
|
+
y2: "y2",
|
|
55
|
+
cx: "cx",
|
|
56
|
+
cy: "cy",
|
|
57
|
+
r: "r",
|
|
58
|
+
rx: "rx",
|
|
59
|
+
ry: "ry",
|
|
60
|
+
width: "width",
|
|
61
|
+
height: "height",
|
|
62
|
+
viewbox: "viewBox",
|
|
63
|
+
preserveaspectratio: "preserveAspectRatio",
|
|
64
|
+
transform: "transform",
|
|
65
|
+
transformorigin: "transform-origin",
|
|
66
|
+
points: "points",
|
|
67
|
+
pathlength: "pathLength",
|
|
68
|
+
offset: "offset",
|
|
69
|
+
stopcolor: "stop-color",
|
|
70
|
+
stopopacity: "stop-opacity",
|
|
71
|
+
markerstart: "marker-start",
|
|
72
|
+
markermid: "marker-mid",
|
|
73
|
+
markerend: "marker-end",
|
|
74
|
+
markerwidth: "markerWidth",
|
|
75
|
+
markerheight: "markerHeight",
|
|
76
|
+
markerunits: "markerUnits",
|
|
77
|
+
refx: "refX",
|
|
78
|
+
refy: "refY",
|
|
79
|
+
orient: "orient",
|
|
80
|
+
gradientunits: "gradientUnits",
|
|
81
|
+
gradienttransform: "gradientTransform",
|
|
82
|
+
spreadmethod: "spreadMethod",
|
|
83
|
+
fx: "fx",
|
|
84
|
+
fy: "fy",
|
|
85
|
+
fr: "fr",
|
|
86
|
+
patternunits: "patternUnits",
|
|
87
|
+
patterncontentunits: "patternContentUnits",
|
|
88
|
+
patterntransform: "patternTransform",
|
|
89
|
+
clippathunits: "clipPathUnits",
|
|
90
|
+
clippath: "clip-path",
|
|
91
|
+
cliprule: "clip-rule",
|
|
92
|
+
mask: "mask",
|
|
93
|
+
maskunits: "maskUnits",
|
|
94
|
+
maskcontentunits: "maskContentUnits",
|
|
95
|
+
textlength: "textLength",
|
|
96
|
+
lengthadjust: "lengthAdjust",
|
|
97
|
+
textanchor: "text-anchor",
|
|
98
|
+
dominantbaseline: "dominant-baseline",
|
|
99
|
+
alignmentbaseline: "alignment-baseline",
|
|
100
|
+
baselineshift: "baseline-shift",
|
|
101
|
+
fontfamily: "font-family",
|
|
102
|
+
fontsize: "font-size",
|
|
103
|
+
fontweight: "font-weight",
|
|
104
|
+
fontstyle: "font-style",
|
|
105
|
+
fontvariant: "font-variant",
|
|
106
|
+
letterspacing: "letter-spacing",
|
|
107
|
+
wordspacing: "word-spacing",
|
|
108
|
+
textdecoration: "text-decoration",
|
|
109
|
+
whitespace: "white-space",
|
|
110
|
+
texttransform: "text-transform",
|
|
111
|
+
direction: "direction",
|
|
112
|
+
writingmode: "writing-mode",
|
|
113
|
+
lineheight: "line-height",
|
|
114
|
+
dx: "dx",
|
|
115
|
+
dy: "dy",
|
|
116
|
+
rotate: "rotate",
|
|
117
|
+
startoffset: "startOffset",
|
|
118
|
+
method: "method",
|
|
119
|
+
spacing: "spacing",
|
|
120
|
+
side: "side",
|
|
121
|
+
color: "color",
|
|
122
|
+
display: "display",
|
|
123
|
+
visibility: "visibility",
|
|
124
|
+
overflow: "overflow",
|
|
125
|
+
opacity: "opacity",
|
|
126
|
+
role: "role",
|
|
127
|
+
arialabel: "aria-label",
|
|
128
|
+
ariahidden: "aria-hidden",
|
|
129
|
+
ariahaspopup: "aria-haspopup",
|
|
130
|
+
arialabelledby: "aria-labelledby",
|
|
131
|
+
ariadescribedby: "aria-describedby",
|
|
132
|
+
ariaroledescription: "aria-roledescription",
|
|
133
|
+
focusable: "focusable",
|
|
134
|
+
tabindex: "tabindex",
|
|
135
|
+
href: "href",
|
|
136
|
+
xlinkhref: "xlink:href",
|
|
137
|
+
xmlspace: "xml:space",
|
|
138
|
+
vectoreffect: "vector-effect",
|
|
139
|
+
paintorder: "paint-order",
|
|
140
|
+
shaperendering: "shape-rendering",
|
|
141
|
+
pointerevents: "pointer-events",
|
|
142
|
+
filter: "filter",
|
|
143
|
+
cursor: "cursor"
|
|
144
|
+
}, i = /* @__PURE__ */ new Set([
|
|
145
|
+
"script",
|
|
146
|
+
"foreignobject",
|
|
147
|
+
"iframe",
|
|
148
|
+
"object",
|
|
149
|
+
"embed",
|
|
150
|
+
"image",
|
|
151
|
+
"audio",
|
|
152
|
+
"video"
|
|
153
|
+
]), a = /@import|@font-face|expression\s*\(|javascript\s*:|-moz-binding|behavior\s*:/i, o = /url\(\s*([^)]*)\)/gi, s = /* @__PURE__ */ new Set([
|
|
154
|
+
"media",
|
|
155
|
+
"supports",
|
|
156
|
+
"layer"
|
|
157
|
+
]), c = /* @__PURE__ */ new Set(["charset", "layer"]);
|
|
158
|
+
function l(e) {
|
|
159
|
+
let t = e.trim(), n = t.charAt(0);
|
|
160
|
+
return (n === "\"" || n === "'") && t.charAt(t.length - 1) === n && (t = t.slice(1, -1).trim()), t.startsWith("#");
|
|
161
|
+
}
|
|
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, "")];
|
|
164
|
+
}
|
|
165
|
+
function d(e) {
|
|
166
|
+
var t;
|
|
167
|
+
let n = {}, r = (t = e.properties) == null ? {} : t;
|
|
168
|
+
for (let e of Object.keys(r)) {
|
|
169
|
+
let t = u(e);
|
|
170
|
+
if (!t) continue;
|
|
171
|
+
if (t === "href" || t === "xlink:href") {
|
|
172
|
+
var i;
|
|
173
|
+
let a = String((i = r[e]) == null ? "" : i);
|
|
174
|
+
a.startsWith("#") && (n[t] = a);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
let a = r[e];
|
|
178
|
+
a != null && a !== !1 && (n[t] = Array.isArray(a) ? a.map(String).join(" ") : String(a));
|
|
179
|
+
}
|
|
180
|
+
return n;
|
|
181
|
+
}
|
|
182
|
+
function f(e) {
|
|
183
|
+
let t = "";
|
|
184
|
+
for (let n of e) n.type === "text" ? t += n.value : n.type === "element" && (t += f(n.children));
|
|
185
|
+
return t;
|
|
186
|
+
}
|
|
187
|
+
function p(e) {
|
|
188
|
+
let t = /^@([-a-zA-Z]+)/.exec(e);
|
|
189
|
+
return t ? t[1].toLowerCase() : "";
|
|
190
|
+
}
|
|
191
|
+
function m(e) {
|
|
192
|
+
let t = 0, n = "";
|
|
193
|
+
for (let r = 0; r < e.length; r++) {
|
|
194
|
+
let i = e.charAt(r);
|
|
195
|
+
if (n) i === "\\" ? r++ : i === n && (n = "");
|
|
196
|
+
else if (i === "\"" || i === "'") n = i;
|
|
197
|
+
else if (i === "(" || i === "[") t++;
|
|
198
|
+
else if (i === ")" || i === "]") t = Math.max(0, t - 1);
|
|
199
|
+
else if (t === 0 && (i === "+" || i === "~")) return !0;
|
|
200
|
+
}
|
|
201
|
+
return !1;
|
|
202
|
+
}
|
|
203
|
+
function h(e, t) {
|
|
204
|
+
let n = e.trim();
|
|
205
|
+
if (!n.startsWith(t)) return !1;
|
|
206
|
+
let r = n.charAt(t.length);
|
|
207
|
+
return r !== "" && /[a-zA-Z0-9_-]/.test(r) ? !1 : !m(n);
|
|
208
|
+
}
|
|
209
|
+
function g(e) {
|
|
210
|
+
let t = [], n = "", r = 0, i = "";
|
|
211
|
+
for (let a = 0; a < e.length; a++) {
|
|
212
|
+
let o = e.charAt(a);
|
|
213
|
+
if (i) n += o, o === "\\" ? n += e.charAt(++a) : o === i && (i = "");
|
|
214
|
+
else if (o === "\"" || o === "'") i = o, n += o;
|
|
215
|
+
else {
|
|
216
|
+
if (o === "(" || o === "[") r++;
|
|
217
|
+
else if (o === ")" || o === "]") r = Math.max(0, r - 1);
|
|
218
|
+
else if (o === "," && r === 0) {
|
|
219
|
+
t.push(n), n = "";
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
n += o;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return t.push(n), t;
|
|
226
|
+
}
|
|
227
|
+
function _(e, t, n) {
|
|
228
|
+
let r = 0, i = "";
|
|
229
|
+
for (let a = t; a < n; a++) {
|
|
230
|
+
let t = e.charAt(a);
|
|
231
|
+
if (i) t === "\\" ? a++ : t === i && (i = "");
|
|
232
|
+
else if (t === "\"" || t === "'") i = t;
|
|
233
|
+
else if (t === "/" && e.charAt(a + 1) === "*") {
|
|
234
|
+
let t = e.indexOf("*/", a + 2);
|
|
235
|
+
if (t === -1 || t >= n) return -1;
|
|
236
|
+
a = t + 1;
|
|
237
|
+
} else if (t === "{") r++;
|
|
238
|
+
else if (t === "}" && (r--, r === 0)) return a;
|
|
239
|
+
}
|
|
240
|
+
return -1;
|
|
241
|
+
}
|
|
242
|
+
function v(e, t, n) {
|
|
243
|
+
if (e.startsWith("@")) {
|
|
244
|
+
let r = p(e);
|
|
245
|
+
return r.endsWith("keyframes") ? !0 : s.has(r) && y(t, n);
|
|
246
|
+
}
|
|
247
|
+
return e ? g(e).every((e) => h(e, n)) : !1;
|
|
248
|
+
}
|
|
249
|
+
function y(e, t) {
|
|
250
|
+
let n = 0;
|
|
251
|
+
for (; n < e.length;) {
|
|
252
|
+
for (; n < e.length && /[\s;]/.test(e.charAt(n));) n++;
|
|
253
|
+
if (n >= e.length) break;
|
|
254
|
+
let r = n, i = "", a = 0, o = -1, s = -1;
|
|
255
|
+
for (; n < e.length; n++) {
|
|
256
|
+
let t = e.charAt(n);
|
|
257
|
+
if (i) t === "\\" ? n++ : t === i && (i = "");
|
|
258
|
+
else if (t === "\"" || t === "'") i = t;
|
|
259
|
+
else if (t === "/" && e.charAt(n + 1) === "*") {
|
|
260
|
+
let t = e.indexOf("*/", n + 2);
|
|
261
|
+
if (t === -1) return !1;
|
|
262
|
+
n = t + 1;
|
|
263
|
+
} else if (t === "(" || t === "[") a++;
|
|
264
|
+
else if (t === ")" || t === "]") a = Math.max(0, a - 1);
|
|
265
|
+
else if (a === 0) {
|
|
266
|
+
if (t === "{") {
|
|
267
|
+
o = n;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
if (t === ";") {
|
|
271
|
+
s = n;
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
if (t === "}") return !1;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (i) return !1;
|
|
278
|
+
let l = e.slice(r, o === -1 ? s : o).trim();
|
|
279
|
+
if (o !== -1) {
|
|
280
|
+
let r = _(e, o, e.length);
|
|
281
|
+
if (r === -1 || !v(l, e.slice(o + 1, r), t)) return !1;
|
|
282
|
+
n = r + 1;
|
|
283
|
+
} else if (s !== -1) {
|
|
284
|
+
if (!l.startsWith("@") || !c.has(p(l))) return !1;
|
|
285
|
+
n = s + 1;
|
|
286
|
+
} else {
|
|
287
|
+
if (l !== "") return !1;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return !0;
|
|
292
|
+
}
|
|
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");
|
|
296
|
+
return n.trim() ? n : void 0;
|
|
297
|
+
}
|
|
298
|
+
function x(e) {
|
|
299
|
+
let t = [], n = "", r = () => {
|
|
300
|
+
let e = n.replace(/\s+/g, " ").trim();
|
|
301
|
+
e && t.push(e), n = "";
|
|
302
|
+
}, i = (e) => {
|
|
303
|
+
if (e.type === "text") {
|
|
304
|
+
n += e.value;
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (e.type !== "element") return;
|
|
308
|
+
let t = e.tagName.toLowerCase();
|
|
309
|
+
if (t === "br") r();
|
|
310
|
+
else if (t === "div" || t === "p" || t === "li" || t === "tr") {
|
|
311
|
+
r();
|
|
312
|
+
for (let t of e.children) i(t);
|
|
313
|
+
r();
|
|
314
|
+
} else for (let t of e.children) i(t);
|
|
315
|
+
};
|
|
316
|
+
for (let t of e) i(t);
|
|
317
|
+
return r(), t;
|
|
318
|
+
}
|
|
319
|
+
function S(e, t) {
|
|
320
|
+
let n = x(e.children);
|
|
321
|
+
if (n.length === 0) return [];
|
|
322
|
+
let r = d(e), i = {};
|
|
323
|
+
for (let e of [
|
|
324
|
+
"x",
|
|
325
|
+
"y",
|
|
326
|
+
"transform",
|
|
327
|
+
"class"
|
|
328
|
+
]) r[e] !== void 0 && (i[e] = r[e]);
|
|
329
|
+
return i.x === void 0 && (i.x = "0"), i.y === void 0 && (i.y = "0"), [{
|
|
330
|
+
kind: "element",
|
|
331
|
+
key: t,
|
|
332
|
+
tag: "text",
|
|
333
|
+
attrs: i,
|
|
334
|
+
children: n.map((e, n) => ({
|
|
335
|
+
kind: "element",
|
|
336
|
+
key: `${t}.${n}`,
|
|
337
|
+
tag: "tspan",
|
|
338
|
+
attrs: {
|
|
339
|
+
x: i.x,
|
|
340
|
+
dy: n === 0 ? "1em" : "1.2em"
|
|
341
|
+
},
|
|
342
|
+
children: [{
|
|
343
|
+
kind: "text",
|
|
344
|
+
key: `${t}.${n}.text`,
|
|
345
|
+
value: e
|
|
346
|
+
}]
|
|
347
|
+
}))
|
|
348
|
+
}];
|
|
349
|
+
}
|
|
350
|
+
function C(e, r = "", a) {
|
|
351
|
+
let o = [];
|
|
352
|
+
return e.forEach((e, s) => {
|
|
353
|
+
var c;
|
|
354
|
+
let l = r ? `${r}.${s}` : String(s);
|
|
355
|
+
if (e.type === "text") {
|
|
356
|
+
e.value.trim() !== "" && o.push({
|
|
357
|
+
kind: "text",
|
|
358
|
+
key: l,
|
|
359
|
+
value: e.value
|
|
360
|
+
});
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
if (e.type !== "element") return;
|
|
364
|
+
let u = e.tagName.toLowerCase();
|
|
365
|
+
if (u === "foreignobject") o.push(...S(e, l));
|
|
366
|
+
else if (u === "style") {
|
|
367
|
+
let t = b(f(e.children), a);
|
|
368
|
+
t && o.push({
|
|
369
|
+
kind: "element",
|
|
370
|
+
key: l,
|
|
371
|
+
tag: "style",
|
|
372
|
+
attrs: {},
|
|
373
|
+
children: [{
|
|
374
|
+
kind: "text",
|
|
375
|
+
key: `${l}.css`,
|
|
376
|
+
value: t
|
|
377
|
+
}]
|
|
378
|
+
});
|
|
379
|
+
} else i.has(u) || (t.has(u) ? o.push({
|
|
380
|
+
kind: "element",
|
|
381
|
+
key: l,
|
|
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)));
|
|
386
|
+
}), o;
|
|
387
|
+
}
|
|
388
|
+
function w(e) {
|
|
389
|
+
var t;
|
|
390
|
+
let n = (t = e.properties) == null ? void 0 : t.id;
|
|
391
|
+
return typeof n == "string" && n !== "" ? `#${n}` : void 0;
|
|
392
|
+
}
|
|
393
|
+
function T(e) {
|
|
394
|
+
var t;
|
|
395
|
+
let n = e.find((e) => e.kind === "element" && e.tag.toLowerCase() === "svg"), r = n == null || (t = n.attrs) == null ? void 0 : t.id;
|
|
396
|
+
return typeof r == "string" && r !== "" ? `#${r}` : void 0;
|
|
397
|
+
}
|
|
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);
|
|
401
|
+
}
|
|
402
|
+
function D(e) {
|
|
403
|
+
let t = {};
|
|
404
|
+
if (!e || typeof e != "object") return t;
|
|
405
|
+
for (let n of Object.keys(e)) {
|
|
406
|
+
let r = u(n);
|
|
407
|
+
if (!r) continue;
|
|
408
|
+
let i = String(e[n]);
|
|
409
|
+
r === "href" || r === "xlink:href" ? i.startsWith("#") && (t[r] = i) : t[r] = i;
|
|
410
|
+
}
|
|
411
|
+
return t;
|
|
412
|
+
}
|
|
413
|
+
function O(e) {
|
|
414
|
+
let t = "";
|
|
415
|
+
if (!Array.isArray(e)) return t;
|
|
416
|
+
for (let n of e) n.kind === "text" ? t += n.value : n.kind === "element" && (t += O(n.children));
|
|
417
|
+
return t;
|
|
418
|
+
}
|
|
419
|
+
function k(e, r = "", a) {
|
|
420
|
+
let o = [];
|
|
421
|
+
return Array.isArray(e) && e.forEach((e, s) => {
|
|
422
|
+
var c;
|
|
423
|
+
let l = r ? `${r}.${s}` : String(s);
|
|
424
|
+
if (e.kind === "text") {
|
|
425
|
+
o.push({
|
|
426
|
+
kind: "text",
|
|
427
|
+
key: l,
|
|
428
|
+
value: e.value
|
|
429
|
+
});
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
if (e.kind !== "element" || typeof e.tag != "string") return;
|
|
433
|
+
let u = Array.isArray(e.children) ? e.children : [], d = e.tag.toLowerCase();
|
|
434
|
+
if (d === "style") {
|
|
435
|
+
let e = b(O(u), a);
|
|
436
|
+
e && o.push({
|
|
437
|
+
kind: "element",
|
|
438
|
+
key: l,
|
|
439
|
+
tag: "style",
|
|
440
|
+
attrs: {},
|
|
441
|
+
children: [{
|
|
442
|
+
kind: "text",
|
|
443
|
+
key: `${l}.css`,
|
|
444
|
+
value: e
|
|
445
|
+
}]
|
|
446
|
+
});
|
|
447
|
+
} else i.has(d) || (t.has(d) ? o.push({
|
|
448
|
+
kind: "element",
|
|
449
|
+
key: l,
|
|
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)));
|
|
454
|
+
}), o;
|
|
455
|
+
}
|
|
456
|
+
function A(e) {
|
|
457
|
+
return k(e, "", Array.isArray(e) ? T(e) : void 0);
|
|
458
|
+
}
|
|
459
|
+
// src/mermaid/sanitize-svg-lazy.ts
|
|
460
|
+
function j(e) {
|
|
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);
|
|
468
|
+
}
|
|
469
|
+
// src/mermaid/runtime.ts
|
|
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() {
|
|
480
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
481
|
+
}
|
|
482
|
+
function I(e) {
|
|
483
|
+
return e === "dark" || e === "auto" && F() ? "dark" : e === "custom" ? "neutral" : "default";
|
|
484
|
+
}
|
|
485
|
+
function L(e) {
|
|
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);
|
|
496
|
+
}
|
|
497
|
+
function z(e) {
|
|
498
|
+
return B.apply(this, arguments);
|
|
499
|
+
}
|
|
500
|
+
function B() {
|
|
501
|
+
return B = e(function* (e) {
|
|
502
|
+
return e.api || (e.api = import("mermaid").then((e) => {
|
|
503
|
+
var t;
|
|
504
|
+
return (t = e.default) == null ? e : t;
|
|
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);
|
|
518
|
+
}
|
|
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) {
|
|
523
|
+
let t = e instanceof Error ? e.message : typeof e == "string" ? e : "Mermaid rendering failed.";
|
|
524
|
+
return U(t) ? "Mermaid is not available. Install the optional `mermaid` peer dependency to render diagrams." : t;
|
|
525
|
+
}
|
|
526
|
+
function G() {
|
|
527
|
+
return P.counter += 1, `vmd-mermaid-${P.counter}`;
|
|
528
|
+
}
|
|
529
|
+
function K(e) {
|
|
530
|
+
return q.apply(this, arguments);
|
|
531
|
+
}
|
|
532
|
+
function q() {
|
|
533
|
+
return q = e(function* (t, n = {}) {
|
|
534
|
+
if (typeof window > "u" || typeof DOMParser > "u") return {
|
|
535
|
+
nodes: [],
|
|
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."
|
|
541
|
+
};
|
|
542
|
+
if (!t.trim()) return {
|
|
543
|
+
nodes: [],
|
|
544
|
+
error: "Mermaid source is empty. Provide diagram text such as `graph TD; A-->B`."
|
|
545
|
+
};
|
|
546
|
+
let r = P, i = function() {
|
|
547
|
+
var i = e(function* () {
|
|
548
|
+
try {
|
|
549
|
+
var e;
|
|
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);
|
|
553
|
+
return {
|
|
554
|
+
svg: o,
|
|
555
|
+
nodes: yield j(o)
|
|
556
|
+
};
|
|
557
|
+
} catch (e) {
|
|
558
|
+
return {
|
|
559
|
+
nodes: [],
|
|
560
|
+
error: W(e)
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
return function() {
|
|
565
|
+
return i.apply(this, arguments);
|
|
566
|
+
};
|
|
567
|
+
}(), a = r.queue.then(i, i);
|
|
568
|
+
return r.queue = a.catch(() => void 0), a;
|
|
569
|
+
}), q.apply(this, arguments);
|
|
570
|
+
}
|
|
571
|
+
function J() {
|
|
572
|
+
P.api = void 0, P.initializedKey = void 0;
|
|
573
|
+
}
|
|
574
|
+
export { t as a, j as i, K as n, E as o, J as r, A as s, G as t };
|