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