@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.
Files changed (232) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/LICENSE +21 -0
  3. package/README.md +584 -3
  4. package/README.zh-CN.md +550 -0
  5. package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
  6. package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
  7. package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
  8. package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
  9. package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
  10. package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
  11. package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
  12. package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
  13. package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
  14. package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
  15. package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
  16. package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
  17. package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
  18. package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
  19. package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
  20. package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
  21. package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
  22. package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
  23. package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
  24. package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
  25. package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
  26. package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
  27. package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
  28. package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
  29. package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
  30. package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
  31. package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
  32. package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
  33. package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
  34. package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
  35. package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
  36. package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
  37. package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
  38. package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
  39. package/dist/chunks/adapters-CMwX_NEI.js +26 -0
  40. package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
  41. package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
  42. package/dist/chunks/codemirror-DyphMAEg.js +82 -0
  43. package/dist/chunks/config-aRYo2R8_.js +10 -0
  44. package/dist/chunks/context-8NfW6fxI.js +30 -0
  45. package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
  46. package/dist/chunks/default-ZQ5aHh-N.js +3 -0
  47. package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
  48. package/dist/chunks/export-BrgMLgUp.js +1574 -0
  49. package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
  50. package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
  51. package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
  52. package/dist/chunks/identity-Bi27FKyx.js +6243 -0
  53. package/dist/chunks/labels-BtHiUTQI.js +47 -0
  54. package/dist/chunks/lib-CCnkLL6S.js +252 -0
  55. package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
  56. package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
  57. package/dist/chunks/normalize-VKfQXZiK.js +226 -0
  58. package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
  59. package/dist/chunks/plugin-YWo5uqTh.js +27 -0
  60. package/dist/chunks/preset-BjaOuJUL.js +44 -0
  61. package/dist/chunks/registry-B7BfEkuy.js +6150 -0
  62. package/dist/chunks/render-DAqK0w5J.js +1754 -0
  63. package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
  64. package/dist/chunks/runtime-D95F41zG.js +574 -0
  65. package/dist/chunks/security-y4EwUyAs.js +212 -0
  66. package/dist/chunks/shared-NjFDPmkb.js +67 -0
  67. package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
  68. package/dist/chunks/url-D2BoivaE.js +24 -0
  69. package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
  70. package/dist/components/CodeBlock.d.ts +73 -0
  71. package/dist/components/CodeBlock.js +1 -0
  72. package/dist/components/Icon.d.ts +6 -0
  73. package/dist/components/MarkdownBlockquote.d.ts +18 -0
  74. package/dist/components/MarkdownBlockquote.js +1 -0
  75. package/dist/components/MarkdownBreak.d.ts +8 -0
  76. package/dist/components/MarkdownBreak.js +1 -0
  77. package/dist/components/MarkdownChildren.d.ts +17 -0
  78. package/dist/components/MarkdownCode.d.ts +29 -0
  79. package/dist/components/MarkdownCode.js +1 -0
  80. package/dist/components/MarkdownConfigProvider.d.ts +33 -0
  81. package/dist/components/MarkdownConfigProvider.js +1 -0
  82. package/dist/components/MarkdownContent.d.ts +16 -0
  83. package/dist/components/MarkdownContent.js +1 -0
  84. package/dist/components/MarkdownCustomTag.d.ts +20 -0
  85. package/dist/components/MarkdownCustomTag.js +1 -0
  86. package/dist/components/MarkdownEmphasis.d.ts +18 -0
  87. package/dist/components/MarkdownEmphasis.js +1 -0
  88. package/dist/components/MarkdownEmpty.d.ts +8 -0
  89. package/dist/components/MarkdownEmpty.js +1 -0
  90. package/dist/components/MarkdownError.d.ts +11 -0
  91. package/dist/components/MarkdownError.js +1 -0
  92. package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
  93. package/dist/components/MarkdownFootnoteReference.js +1 -0
  94. package/dist/components/MarkdownFootnotes.d.ts +17 -0
  95. package/dist/components/MarkdownFootnotes.js +1 -0
  96. package/dist/components/MarkdownHeading.d.ts +18 -0
  97. package/dist/components/MarkdownHeading.js +1 -0
  98. package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
  99. package/dist/components/MarkdownHorizontalRule.js +1 -0
  100. package/dist/components/MarkdownHtml.d.ts +8 -0
  101. package/dist/components/MarkdownHtml.js +1 -0
  102. package/dist/components/MarkdownImage.d.ts +15 -0
  103. package/dist/components/MarkdownImage.js +1 -0
  104. package/dist/components/MarkdownInlineCode.d.ts +18 -0
  105. package/dist/components/MarkdownInlineCode.js +1 -0
  106. package/dist/components/MarkdownLink.d.ts +22 -0
  107. package/dist/components/MarkdownLink.js +1 -0
  108. package/dist/components/MarkdownList.d.ts +18 -0
  109. package/dist/components/MarkdownList.js +1 -0
  110. package/dist/components/MarkdownListItem.d.ts +18 -0
  111. package/dist/components/MarkdownListItem.js +1 -0
  112. package/dist/components/MarkdownLoading.d.ts +8 -0
  113. package/dist/components/MarkdownLoading.js +1 -0
  114. package/dist/components/MarkdownMath.d.ts +12 -0
  115. package/dist/components/MarkdownMath.js +1 -0
  116. package/dist/components/MarkdownMermaid.d.ts +78 -0
  117. package/dist/components/MarkdownMermaid.js +1 -0
  118. package/dist/components/MarkdownParagraph.d.ts +18 -0
  119. package/dist/components/MarkdownParagraph.js +1 -0
  120. package/dist/components/MarkdownRenderer.d.ts +167 -0
  121. package/dist/components/MarkdownRenderer.js +1 -0
  122. package/dist/components/MarkdownRoot.d.ts +24 -0
  123. package/dist/components/MarkdownRoot.js +1 -0
  124. package/dist/components/MarkdownStrikethrough.d.ts +18 -0
  125. package/dist/components/MarkdownStrikethrough.js +1 -0
  126. package/dist/components/MarkdownStrong.d.ts +18 -0
  127. package/dist/components/MarkdownStrong.js +1 -0
  128. package/dist/components/MarkdownTable.d.ts +18 -0
  129. package/dist/components/MarkdownTable.js +1 -0
  130. package/dist/components/MarkdownTableCell.d.ts +20 -0
  131. package/dist/components/MarkdownTableCell.js +1 -0
  132. package/dist/components/MarkdownTableRow.d.ts +18 -0
  133. package/dist/components/MarkdownTableRow.js +1 -0
  134. package/dist/components/MarkdownTableSection.d.ts +18 -0
  135. package/dist/components/MarkdownTableSection.js +1 -0
  136. package/dist/components/MarkdownTaskItem.d.ts +20 -0
  137. package/dist/components/MarkdownTaskItem.js +1 -0
  138. package/dist/components/MarkdownToc.d.ts +36 -0
  139. package/dist/components/MarkdownToc.js +1 -0
  140. package/dist/components/MarkdownTocItem.d.ts +14 -0
  141. package/dist/components/MarkdownTocItem.js +1 -0
  142. package/dist/components/MermaidBlock.d.ts +50 -0
  143. package/dist/components/MermaidBlock.js +1 -0
  144. package/dist/components/MermaidLiveEditor.d.ts +44 -0
  145. package/dist/components/MermaidLiveEditor.js +1 -0
  146. package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
  147. package/dist/components/VueSyntaxHighlighter.js +1 -0
  148. package/dist/components/codeRegion.d.ts +14 -0
  149. package/dist/components/config.d.ts +7 -0
  150. package/dist/components/context.d.ts +45 -0
  151. package/dist/components/index.d.ts +42 -0
  152. package/dist/components/index.js +38 -0
  153. package/dist/components/render.d.ts +9 -0
  154. package/dist/components/scroll-lock.d.ts +7 -0
  155. package/dist/components/types.d.ts +61 -0
  156. package/dist/composables/useActiveHeading.d.ts +12 -0
  157. package/dist/composables/useCodeHighlighter.d.ts +30 -0
  158. package/dist/composables/useLineWindow.d.ts +38 -0
  159. package/dist/composables/useMarkdownDocument.d.ts +25 -0
  160. package/dist/core/adapters.d.ts +7 -0
  161. package/dist/core/config.d.ts +5 -0
  162. package/dist/core/diagnostics.d.ts +9 -0
  163. package/dist/core/finalize.d.ts +18 -0
  164. package/dist/core/hast-nodes.d.ts +3 -0
  165. package/dist/core/hast-to-nodes.d.ts +9 -0
  166. package/dist/core/highlight-lines.d.ts +8 -0
  167. package/dist/core/identity.d.ts +4 -0
  168. package/dist/core/labels.d.ts +4 -0
  169. package/dist/core/manifest.d.ts +38 -0
  170. package/dist/core/memo.d.ts +5 -0
  171. package/dist/core/model-hast.d.ts +8 -0
  172. package/dist/core/model.d.ts +10 -0
  173. package/dist/core/normalize.d.ts +37 -0
  174. package/dist/core/parts.d.ts +136 -0
  175. package/dist/core/preset.d.ts +10 -0
  176. package/dist/core/run.d.ts +16 -0
  177. package/dist/core/search.d.ts +5 -0
  178. package/dist/core/security.d.ts +21 -0
  179. package/dist/core/slugger.d.ts +13 -0
  180. package/dist/core/types.d.ts +392 -0
  181. package/dist/core/url.d.ts +10 -0
  182. package/dist/editor/codemirror.d.ts +14 -0
  183. package/dist/editor/index.d.ts +2 -0
  184. package/dist/editor/index.js +1 -0
  185. package/dist/export/index.d.ts +6 -0
  186. package/dist/headless.d.ts +21 -0
  187. package/dist/headless.js +12 -0
  188. package/dist/highlight/convert-hast.d.ts +8 -0
  189. package/dist/highlight/highlightjs.d.ts +7 -0
  190. package/dist/highlight/index.d.ts +4 -0
  191. package/dist/highlight/index.js +4 -0
  192. package/dist/highlight/shared.d.ts +11 -0
  193. package/dist/highlight/shiki.d.ts +7 -0
  194. package/dist/highlight/shiki.js +75 -0
  195. package/dist/html/index.d.ts +17 -0
  196. package/dist/html/index.js +11 -0
  197. package/dist/index.d.ts +24 -0
  198. package/dist/index.js +53 -0
  199. package/dist/math/index.d.ts +4 -0
  200. package/dist/math/index.js +585 -0
  201. package/dist/math/katex.d.ts +4 -0
  202. package/dist/math/plugin.d.ts +20 -0
  203. package/dist/mermaid/index.d.ts +6 -0
  204. package/dist/mermaid/index.js +8 -0
  205. package/dist/mermaid/plugin.d.ts +17 -0
  206. package/dist/mermaid/runtime.d.ts +14 -0
  207. package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
  208. package/dist/mermaid/sanitize-svg.d.ts +3 -0
  209. package/dist/mermaid/sanitize.d.ts +16 -0
  210. package/dist/node-components.d.ts +1 -0
  211. package/dist/node-components.js +39 -0
  212. package/dist/pipeline/custom.d.ts +8 -0
  213. package/dist/pipeline/identity.d.ts +12 -0
  214. package/dist/pipeline/index.d.ts +5 -0
  215. package/dist/pipeline/official.d.ts +6 -0
  216. package/dist/pipeline.d.ts +1 -0
  217. package/dist/pipeline.js +1 -0
  218. package/dist/plugins/builtin.d.ts +15 -0
  219. package/dist/plugins/define.d.ts +7 -0
  220. package/dist/plugins/registry.d.ts +16 -0
  221. package/dist/plugins/source.d.ts +7 -0
  222. package/dist/plugins.d.ts +3 -0
  223. package/dist/plugins.js +1 -0
  224. package/dist/presets.d.ts +3 -0
  225. package/dist/presets.js +1 -0
  226. package/dist/style.css +2 -0
  227. package/dist/styles/components.css +737 -0
  228. package/dist/styles/index.d.ts +1 -0
  229. package/dist/styles/math-full.css +3 -0
  230. package/dist/styles/math.css +18 -0
  231. package/dist/styles/tokens.css +96 -0
  232. package/package.json +214 -6
@@ -0,0 +1,260 @@
1
+ import { n as e } from "./labels-BtHiUTQI.js";
2
+ import { n as t, t as n } from "./diagnostics-CtHoJyiX.js";
3
+ import { t as r } from "./asyncToGenerator-ChigusFD.js";
4
+ import { r as i } from "./config-aRYo2R8_.js";
5
+ import { n as a, r as o } from "./context-8NfW6fxI.js";
6
+ import { o as s, s as c, t as l } from "./render-DAqK0w5J.js";
7
+ import { computed as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, h, normalizeStyle as g, openBlock as _, unref as v, useSlots as y } from "vue";
8
+ // src/components/VueSyntaxHighlighter.vue?vue&type=script&setup=true&lang.ts
9
+ var b = [
10
+ "data-vmd-theme",
11
+ "data-language",
12
+ "data-highlighter",
13
+ "data-virtual"
14
+ ], x = {
15
+ "data-vmd-part": "highlighter-body",
16
+ class: "vmd-highlighter-body"
17
+ }, S = /* @__PURE__ */ m({
18
+ __name: "VueSyntaxHighlighter",
19
+ props: {
20
+ source: {},
21
+ language: { default: "" },
22
+ theme: { default: void 0 },
23
+ highlighter: { default: void 0 },
24
+ lineNumbers: {
25
+ type: Boolean,
26
+ default: !1
27
+ },
28
+ highlightLines: { default: () => [] },
29
+ maxLines: { default: 0 },
30
+ virtual: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ virtualThreshold: { default: 200 },
35
+ lineHeight: { default: 20 },
36
+ delay: { default: 0 }
37
+ },
38
+ emits: ["copy", "error"],
39
+ setup(S, { expose: C, emit: w }) {
40
+ let T = S, E = w, D = o(), O = i(), k = y();
41
+ function A(e) {
42
+ var t;
43
+ (t = D.onRenderError) == null || t.call(D, e), E("error", e);
44
+ }
45
+ let { result: j, active: M, resolvedTheme: N, getHighlighted: P } = c({
46
+ source: () => T.source,
47
+ language: () => T.language,
48
+ highlighter: () => {
49
+ var e, t;
50
+ return (e = (t = T.highlighter) == null ? D.highlighter : t) == null ? O.value.highlighter : e;
51
+ },
52
+ theme: () => T.theme,
53
+ contextTheme: () => {
54
+ var e;
55
+ return (e = D.theme) == null ? O.value.theme : e;
56
+ },
57
+ delay: () => T.delay,
58
+ onDiagnostic: A
59
+ }), { expanded: F, truncatable: I, totalLines: L, virtualActive: R, startLine: z, endLine: B, visibleLines: V, lineHeight: H, scrollRef: U, onScroll: W, toggle: G, isHighlightedLine: K } = s({
60
+ nodes: () => j.value.nodes,
61
+ source: () => T.source,
62
+ maxLines: () => T.maxLines,
63
+ virtual: () => T.virtual,
64
+ virtualThreshold: () => T.virtualThreshold,
65
+ lineHeight: () => T.lineHeight,
66
+ highlightLines: () => T.highlightLines
67
+ }), q = u(() => j.value.mode === "block");
68
+ function J() {
69
+ return Y.apply(this, arguments);
70
+ }
71
+ function Y() {
72
+ return Y = r(function* () {
73
+ try {
74
+ if (typeof navigator < "u" && navigator.clipboard) yield navigator.clipboard.writeText(T.source);
75
+ else if (typeof document < "u") {
76
+ let e = document.createElement("textarea");
77
+ e.value = T.source, document.body.appendChild(e), e.select();
78
+ let t = document.execCommand("copy");
79
+ if (e.remove(), t === !1) throw Error("The copy command was rejected.");
80
+ } else throw Error("Clipboard access is not available.");
81
+ E("copy", T.source);
82
+ } catch (e) {
83
+ A(n("copy-error", `The source could not be copied to the clipboard: ${t(e)}`, {
84
+ severity: "warning",
85
+ phase: "render"
86
+ }));
87
+ }
88
+ }), Y.apply(this, arguments);
89
+ }
90
+ C({
91
+ copy: J,
92
+ getHighlighted: P,
93
+ highlighted: j
94
+ });
95
+ let X = u(() => ({
96
+ source: T.source,
97
+ language: T.language,
98
+ highlighted: j.value,
99
+ nodes: j.value.nodes,
100
+ lines: V.value,
101
+ actions: { copy: J }
102
+ })), Z = u(() => ({
103
+ source: T.source,
104
+ language: T.language,
105
+ label: e(D.labels.empty),
106
+ actions: { copy: J }
107
+ })), Q = m({ setup() {
108
+ return () => {
109
+ var e;
110
+ let t = k.actions;
111
+ if (t) {
112
+ let e = t(X.value);
113
+ if (!a(e)) return h("span", {
114
+ "data-vmd-part": "highlighter-actions",
115
+ class: "vmd-highlighter-actions"
116
+ }, e);
117
+ }
118
+ let n = (e = D.slots) == null ? void 0 : e.actions;
119
+ if (n) {
120
+ let e = n(X.value);
121
+ if (!a(e)) return h("span", {
122
+ "data-vmd-part": "highlighter-actions",
123
+ class: "vmd-highlighter-actions"
124
+ }, e);
125
+ }
126
+ return null;
127
+ };
128
+ } }), $ = m({ setup() {
129
+ return () => {
130
+ var e, t;
131
+ let n = k.header;
132
+ if (n) {
133
+ let e = n(X.value);
134
+ if (!a(e)) return h("div", {
135
+ "data-vmd-part": "highlighter-header",
136
+ class: "vmd-highlighter-header"
137
+ }, e);
138
+ }
139
+ let r = (e = D.slots) == null ? void 0 : e.header;
140
+ if (r) {
141
+ let e = r(X.value);
142
+ if (!a(e)) return h("div", {
143
+ "data-vmd-part": "highlighter-header",
144
+ class: "vmd-highlighter-header"
145
+ }, e);
146
+ }
147
+ return !k.actions && !((t = D.slots) != null && t.actions) ? null : h("div", {
148
+ "data-vmd-part": "highlighter-header",
149
+ class: "vmd-highlighter-header"
150
+ }, [h("span", { class: "vmd-highlighter-label" }, T.language || "text"), h(Q)]);
151
+ };
152
+ } }), ee = m({ setup() {
153
+ return () => {
154
+ var e;
155
+ let t = k.footer;
156
+ if (t) {
157
+ let e = t(X.value);
158
+ if (!a(e)) return h("div", {
159
+ "data-vmd-part": "highlighter-footer",
160
+ class: "vmd-highlighter-footer"
161
+ }, e);
162
+ }
163
+ let n = (e = D.slots) == null ? void 0 : e.footer;
164
+ if (n) {
165
+ let e = n(X.value);
166
+ if (!a(e)) return h("div", {
167
+ "data-vmd-part": "highlighter-footer",
168
+ class: "vmd-highlighter-footer"
169
+ }, e);
170
+ }
171
+ return null;
172
+ };
173
+ } }), te = m({ setup() {
174
+ return () => D.renderHostSlot("highlighter", {
175
+ source: T.source,
176
+ language: T.language,
177
+ nodes: j.value.nodes,
178
+ lines: V.value,
179
+ highlighted: j.value,
180
+ actions: { copy: J }
181
+ }, () => {
182
+ let t = k.highlighter;
183
+ if (t) {
184
+ let e = t({
185
+ source: T.source,
186
+ language: T.language,
187
+ nodes: j.value.nodes,
188
+ lines: V.value,
189
+ highlighted: j.value,
190
+ actions: { copy: J }
191
+ });
192
+ if (!a(e)) return e;
193
+ }
194
+ if (T.source === "") return D.renderHostSlot("empty", Z.value, () => {
195
+ let t = k.empty;
196
+ if (t) {
197
+ let e = t(Z.value);
198
+ if (!a(e)) return e;
199
+ }
200
+ return h("div", {
201
+ "data-vmd-part": "highlighter-empty",
202
+ class: "vmd-highlighter-empty"
203
+ }, e(D.labels.empty));
204
+ });
205
+ if (q.value) return l(j.value.nodes, D);
206
+ let n = [];
207
+ R.value && z.value > 0 && n.push(h("div", {
208
+ "aria-hidden": "true",
209
+ style: { height: `${z.value * H.value}px` }
210
+ }));
211
+ for (let e of V.value) {
212
+ let t = K(e.index);
213
+ n.push(h("div", {
214
+ class: "vmd-highlighter-line",
215
+ "data-vmd-part": "highlighter-line",
216
+ "data-line": String(e.index + 1),
217
+ "data-highlighted": t ? "true" : void 0
218
+ }, [T.lineNumbers ? h("span", {
219
+ class: "vmd-highlighter-gutter",
220
+ "data-vmd-part": "highlighter-gutter",
221
+ "aria-hidden": "true"
222
+ }, String(e.index + 1)) : null, h("code", { class: "vmd-highlighter-code" }, l(e.nodes, D))]));
223
+ }
224
+ return R.value && B.value < L.value && n.push(h("div", {
225
+ "aria-hidden": "true",
226
+ style: { height: `${(L.value - B.value) * H.value}px` }
227
+ })), I.value && n.push(h("button", {
228
+ type: "button",
229
+ class: "vmd-highlighter-toggle",
230
+ "data-vmd-part": "highlighter-toggle",
231
+ "aria-expanded": F.value ? "true" : "false",
232
+ onClick: G
233
+ }, F.value ? e(D.labels.showLess) : e(D.labels.showAll))), n;
234
+ });
235
+ } });
236
+ return (e, t) => {
237
+ var n;
238
+ return _(), d("div", {
239
+ ref_key: "scrollRef",
240
+ ref: U,
241
+ "data-vmd-part": "highlighter",
242
+ class: "vmd-highlighter",
243
+ "data-vmd-theme": v(N),
244
+ "data-language": S.language || "text",
245
+ "data-highlighter": (n = v(M)) == null ? void 0 : n.id,
246
+ "data-virtual": v(R) ? "true" : void 0,
247
+ style: g(v(R) ? {
248
+ maxHeight: `${v(H) * 20}px`,
249
+ overflow: "auto"
250
+ } : void 0),
251
+ onScroll: t[0] || (t[0] = (...e) => v(W) && v(W)(...e))
252
+ }, [
253
+ p(v($)),
254
+ f("div", x, [p(v(te))]),
255
+ p(v(ee))
256
+ ], 44, b);
257
+ };
258
+ }
259
+ });
260
+ export { S as t };
@@ -0,0 +1,26 @@
1
+ // src/core/adapters.ts
2
+ function e(e) {
3
+ if (!e || typeof e != "object") return !1;
4
+ let t = e;
5
+ return typeof t.id == "string" && typeof t.highlight == "function";
6
+ }
7
+ function t(e) {
8
+ if (!e || typeof e != "object") return !1;
9
+ let t = e;
10
+ return typeof t.id == "string" && typeof t.render == "function";
11
+ }
12
+ function n(e) {
13
+ if (!e || typeof e != "object") return !1;
14
+ let t = e;
15
+ return typeof t.id == "string" && typeof t.render == "function";
16
+ }
17
+ function r(e) {
18
+ return !e || typeof e != "object" ? !1 : typeof e.format == "function";
19
+ }
20
+ function i(e) {
21
+ return !e || typeof e != "object" ? !1 : typeof e.slug == "function";
22
+ }
23
+ function a(e) {
24
+ return typeof e == "function";
25
+ }
26
+ export { i as a, n as i, e as n, a as o, t as r, r as t };
@@ -0,0 +1,26 @@
1
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/asyncToGenerator.js
2
+ function e(e, t, n, r, i, a, o) {
3
+ try {
4
+ var s = e[a](o), c = s.value;
5
+ } catch (e) {
6
+ n(e);
7
+ return;
8
+ }
9
+ s.done ? t(c) : Promise.resolve(c).then(r, i);
10
+ }
11
+ function t(t) {
12
+ return function() {
13
+ var n = this, r = arguments;
14
+ return new Promise(function(i, a) {
15
+ var o = t.apply(n, r);
16
+ function s(t) {
17
+ e(o, i, a, s, c, "next", t);
18
+ }
19
+ function c(t) {
20
+ e(o, i, a, s, c, "throw", t);
21
+ }
22
+ s(void 0);
23
+ });
24
+ };
25
+ }
26
+ export { t };
@@ -0,0 +1,88 @@
1
+ import { _ as e, g as t, h as n, m as r, t as i, v as a } from "./micromark-factory-space-CpXAnYUY.js";
2
+ // node_modules/micromark-util-normalize-identifier/index.js
3
+ function o(e) {
4
+ return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
5
+ }
6
+ // node_modules/mdast-util-to-string/lib/index.js
7
+ var s = {};
8
+ function c(e, t) {
9
+ let n = t || s;
10
+ return l(e, typeof n.includeImageAlt != "boolean" || n.includeImageAlt, typeof n.includeHtml != "boolean" || n.includeHtml);
11
+ }
12
+ function l(e, t, n) {
13
+ if (d(e)) {
14
+ if ("value" in e) return e.type === "html" && !n ? "" : e.value;
15
+ if (t && "alt" in e && e.alt) return e.alt;
16
+ if ("children" in e) return u(e.children, t, n);
17
+ }
18
+ return Array.isArray(e) ? u(e, t, n) : "";
19
+ }
20
+ function u(e, t, n) {
21
+ let r = [], i = -1;
22
+ for (; ++i < e.length;) r[i] = l(e[i], t, n);
23
+ return r.join("");
24
+ }
25
+ function d(e) {
26
+ return !!(e && typeof e == "object");
27
+ }
28
+ // node_modules/micromark-util-classify-character/index.js
29
+ function f(t) {
30
+ if (t === null || n(t) || a(t)) return 1;
31
+ if (e(t)) return 2;
32
+ }
33
+ // node_modules/micromark-util-chunked/index.js
34
+ function p(e, t, n, r) {
35
+ let i = e.length, a = 0, o;
36
+ if (t = t < 0 ? -t > i ? 0 : i + t : t > i ? i : t, n = n > 0 ? n : 0, r.length < 1e4) o = Array.from(r), o.unshift(t, n), e.splice(...o);
37
+ else for (n && e.splice(t, n); a < r.length;) o = r.slice(a, a + 1e4), o.unshift(t, 0), e.splice(...o), a += 1e4, t += 1e4;
38
+ }
39
+ function m(e, t) {
40
+ return e.length > 0 ? (p(e, e.length, 0, t), e) : t;
41
+ }
42
+ // node_modules/micromark-util-combine-extensions/index.js
43
+ var h = {}.hasOwnProperty;
44
+ function g(e) {
45
+ let t = {}, n = -1;
46
+ for (; ++n < e.length;) _(t, e[n]);
47
+ return t;
48
+ }
49
+ function _(e, t) {
50
+ let n;
51
+ for (n in t) {
52
+ let r = (h.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n], a;
53
+ if (i) for (a in i) {
54
+ h.call(r, a) || (r[a] = []);
55
+ let e = i[a];
56
+ v(r[a], Array.isArray(e) ? e : e ? [e] : []);
57
+ }
58
+ }
59
+ }
60
+ function v(e, t) {
61
+ let n = -1, r = [];
62
+ for (; ++n < t.length;) (t[n].add === "after" ? e : r).push(t[n]);
63
+ p(e, 0, 0, r);
64
+ }
65
+ // node_modules/micromark-util-resolve-all/index.js
66
+ function y(e, t, n) {
67
+ let r = [], i = -1;
68
+ for (; ++i < e.length;) {
69
+ let a = e[i].resolveAll;
70
+ a && !r.includes(a) && (t = a(t, n), r.push(a));
71
+ }
72
+ return t;
73
+ }
74
+ // node_modules/micromark-core-commonmark/lib/blank-line.js
75
+ var b = {
76
+ partial: !0,
77
+ tokenize: x
78
+ };
79
+ function x(e, n, a) {
80
+ return o;
81
+ function o(n) {
82
+ return t(n) ? i(e, s, "linePrefix")(n) : s(n);
83
+ }
84
+ function s(e) {
85
+ return e === null || r(e) ? n(e) : a(e);
86
+ }
87
+ }
88
+ export { p as a, o as c, m as i, y as n, f as o, g as r, c as s, b as t };
@@ -0,0 +1,82 @@
1
+ import { t as e } from "./asyncToGenerator-ChigusFD.js";
2
+ // src/editor/codemirror.ts
3
+ function t() {
4
+ return {
5
+ startState: () => ({}),
6
+ token(e) {
7
+ return e.sol() && e.eatSpace(), e.match(/^\s*(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|timeline|gitGraph|quadrantChart|requirementDiagram|C4Context)\b/) ? "keyword" : e.match(/%%[^\n]*/) ? (e.skipToEnd(), "comment") : e.match(/"[^"]*"/) ? "string" : e.match(/-->|---|==>|-.->|--x|--o|<\|--|\|\|--|\.\.>/) ? "operator" : e.match(/[{}[\]()]/) ? "bracket" : (e.next(), null);
8
+ }
9
+ };
10
+ }
11
+ function n(e, t) {
12
+ return r.apply(this, arguments);
13
+ }
14
+ function r() {
15
+ return r = e(function* (e, n) {
16
+ let [r, i, a, o] = yield Promise.all([
17
+ import("@codemirror/view"),
18
+ import("@codemirror/state"),
19
+ import("@codemirror/language"),
20
+ import("@codemirror/commands")
21
+ ]), { EditorView: s, keymap: c, placeholder: l } = r, { EditorState: u } = i, { StreamLanguage: d } = a, { defaultKeymap: f, history: p, historyKeymap: m } = o, h = s.theme({
22
+ "&": {
23
+ height: "100%",
24
+ backgroundColor: "var(--vmd-code-bg, #f6f8fa)",
25
+ color: "var(--vmd-code-text, #1f2328)",
26
+ fontSize: "var(--vmd-font-size-sm, 0.875rem)"
27
+ },
28
+ ".cm-content": {
29
+ fontFamily: "var(--vmd-font-mono, monospace)",
30
+ padding: "0.75rem"
31
+ },
32
+ ".cm-gutters": {
33
+ backgroundColor: "var(--vmd-code-toolbar-bg, #eef1f4)",
34
+ color: "var(--vmd-color-muted, #59636e)",
35
+ border: "none"
36
+ },
37
+ "&.cm-focused": { outline: "none" }
38
+ }), g = new s({
39
+ parent: e,
40
+ state: u.create({
41
+ doc: n.value,
42
+ extensions: [
43
+ p(),
44
+ c.of([...f, ...m]),
45
+ d.define(t()),
46
+ l("Write Mermaid source…"),
47
+ s.lineWrapping,
48
+ h,
49
+ s.updateListener.of((e) => {
50
+ e.docChanged && n.onChange(e.state.doc.toString());
51
+ })
52
+ ]
53
+ })
54
+ });
55
+ return {
56
+ destroy() {
57
+ g.destroy();
58
+ },
59
+ focus() {
60
+ g.focus();
61
+ },
62
+ setValue(e) {
63
+ e !== g.state.doc.toString() && g.dispatch({ changes: {
64
+ from: 0,
65
+ to: g.state.doc.length,
66
+ insert: e
67
+ } });
68
+ },
69
+ focusLine(e) {
70
+ let t = g.state.doc.line(Math.max(1, Math.min(e, g.state.doc.lines)));
71
+ g.dispatch({
72
+ selection: {
73
+ anchor: t.from,
74
+ head: t.to
75
+ },
76
+ scrollIntoView: !0
77
+ }), g.focus();
78
+ }
79
+ };
80
+ }), r.apply(this, arguments);
81
+ }
82
+ export { n as t };
@@ -0,0 +1,10 @@
1
+ import { computed as e, inject as t, provide as n } from "vue";
2
+ // src/components/config.ts
3
+ var r = Symbol("@coderminer/vue-markdown:config");
4
+ function i() {
5
+ return t(r, e(() => ({})));
6
+ }
7
+ function a(e) {
8
+ n(r, e);
9
+ }
10
+ export { a as n, i as r, r as t };
@@ -0,0 +1,30 @@
1
+ import { t as e } from "./labels-BtHiUTQI.js";
2
+ import { Comment as t, Fragment as n, inject as r } from "vue";
3
+ // src/components/context.ts
4
+ var i = Symbol("@coderminer/vue-markdown:render-context"), a = {
5
+ components: {},
6
+ labels: e,
7
+ linkTarget: "_self",
8
+ externalLinkTarget: "_self",
9
+ renderHostSlot(e, t, n) {
10
+ return n();
11
+ },
12
+ onLinkClick() {},
13
+ onCustomTagClick() {},
14
+ onTaskChange() {}
15
+ };
16
+ function o() {
17
+ return r(i, a);
18
+ }
19
+ function s(e) {
20
+ if (e == null) return !0;
21
+ if (typeof e == "string") return e.trim() === "";
22
+ if (Array.isArray(e)) return e.length === 0 || e.every((e) => s(e));
23
+ if (typeof e == "object") {
24
+ let r = e;
25
+ if (r.type === t) return !0;
26
+ if (r.type === n && Array.isArray(r.children)) return r.children.length === 0 || r.children.every((e) => s(e));
27
+ }
28
+ return !1;
29
+ }
30
+ export { s as n, o as r, i as t };
@@ -0,0 +1,6 @@
1
+ import { t as e } from "./hast-to-nodes-DuZsi4XT.js";
2
+ // src/highlight/convert-hast.ts
3
+ function t(t) {
4
+ return e(t);
5
+ }
6
+ export { t };
@@ -0,0 +1,3 @@
1
+ // node_modules/devlop/lib/default.js
2
+ function e() {}
3
+ export { e as t };
@@ -0,0 +1,23 @@
1
+ // src/core/diagnostics.ts
2
+ function e(e, t, n = {}) {
3
+ var r;
4
+ return {
5
+ code: e,
6
+ message: t,
7
+ severity: (r = n.severity) == null ? "error" : r,
8
+ phase: n.phase,
9
+ plugin: n.plugin,
10
+ source: n.source,
11
+ details: n.details
12
+ };
13
+ }
14
+ function t(e) {
15
+ if (e instanceof Error) return e.message;
16
+ if (typeof e == "string") return e;
17
+ try {
18
+ return JSON.stringify(e);
19
+ } catch (t) {
20
+ return String(e);
21
+ }
22
+ }
23
+ export { t as n, e as t };