md-editor-v3 3.0.1 → 4.0.0

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 (103) hide show
  1. package/README.md +131 -95
  2. package/lib/cjs/DropdownToolbar.cjs +1 -0
  3. package/lib/cjs/MdCatalog.cjs +1 -0
  4. package/lib/cjs/MdEditor.cjs +60 -0
  5. package/lib/cjs/MdPreview.cjs +1 -0
  6. package/lib/cjs/ModalToolbar.cjs +1 -0
  7. package/lib/cjs/NormalToolbar.cjs +1 -0
  8. package/lib/cjs/chunks/config.cjs +1 -0
  9. package/lib/cjs/chunks/dom.cjs +1 -0
  10. package/lib/cjs/chunks/event-bus.cjs +1 -0
  11. package/lib/cjs/chunks/index.cjs +8 -0
  12. package/lib/cjs/chunks/index2.cjs +1 -0
  13. package/lib/cjs/chunks/index3.cjs +1 -0
  14. package/lib/cjs/chunks/index4.cjs +2 -0
  15. package/lib/cjs/chunks/vue-tsx.cjs +1 -0
  16. package/lib/cjs/config.cjs +1 -0
  17. package/lib/cjs/index.cjs +1 -0
  18. package/lib/es/DropdownToolbar.mjs +7 -0
  19. package/lib/es/MdCatalog.mjs +215 -0
  20. package/lib/es/MdEditor.mjs +2286 -0
  21. package/lib/es/MdPreview.mjs +15 -0
  22. package/lib/es/ModalToolbar.mjs +9 -0
  23. package/lib/es/NormalToolbar.mjs +39 -0
  24. package/lib/es/chunks/config.mjs +271 -0
  25. package/lib/es/chunks/dom.mjs +32 -0
  26. package/lib/es/chunks/event-bus.mjs +38 -0
  27. package/lib/es/chunks/index.mjs +1061 -0
  28. package/lib/es/chunks/index2.mjs +135 -0
  29. package/lib/es/chunks/index3.mjs +229 -0
  30. package/lib/es/chunks/index4.mjs +57 -0
  31. package/lib/es/chunks/vue-tsx.mjs +11 -0
  32. package/lib/es/config.mjs +4 -0
  33. package/lib/es/index.mjs +35 -0
  34. package/lib/preview.css +1 -0
  35. package/lib/style.css +1 -1
  36. package/lib/types/DropdownToolbar/index.d.ts +129 -0
  37. package/lib/{MdEditor/extensions → types}/MdCatalog/CatalogLink.d.ts +4 -4
  38. package/lib/{MdEditor/extensions/MdCatalog/index.d.ts → types/MdCatalog/MdCatalog.d.ts} +3 -3
  39. package/lib/types/MdCatalog/index.d.ts +193 -0
  40. package/lib/{MdEditor → types/MdEditor}/Editor.d.ts +153 -162
  41. package/lib/types/MdEditor/components/Checkbox/index.d.ts +24 -0
  42. package/lib/types/MdEditor/components/Divider/index.d.ts +2 -0
  43. package/lib/types/MdEditor/components/Dropdown/index.d.ts +53 -0
  44. package/lib/types/MdEditor/components/Modal/index.d.ts +84 -0
  45. package/lib/types/MdEditor/composition.d.ts +66 -0
  46. package/lib/{MdEditor → types/MdEditor}/index.d.ts +343 -388
  47. package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +154 -0
  48. package/lib/types/MdEditor/layouts/Content/codemirror/commands.d.ts +4 -0
  49. package/lib/types/MdEditor/layouts/Content/codemirror/index.d.ts +56 -0
  50. package/lib/types/MdEditor/layouts/Content/codemirror/themeLight.d.ts +23 -0
  51. package/lib/types/MdEditor/layouts/Content/codemirror/themeOneDark.d.ts +26 -0
  52. package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +6 -0
  53. package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +7 -0
  54. package/lib/types/MdEditor/layouts/Content/composition/useAutoScroll.d.ts +5 -0
  55. package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +13 -0
  56. package/lib/types/MdEditor/layouts/Content/composition/useCopyCode.d.ts +4 -0
  57. package/lib/types/MdEditor/layouts/Content/composition/useHighlight.d.ts +8 -0
  58. package/lib/types/MdEditor/layouts/Content/composition/useKatex.d.ts +8 -0
  59. package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +5 -0
  60. package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +11 -0
  61. package/lib/types/MdEditor/layouts/Content/composition/usePasteUpload.d.ts +6 -0
  62. package/lib/types/MdEditor/layouts/Content/composition/userZoom.d.ts +10 -0
  63. package/lib/types/MdEditor/layouts/Content/index.d.ts +173 -0
  64. package/lib/types/MdEditor/layouts/Content/markdownIt/admonition/index.d.ts +5 -0
  65. package/lib/types/MdEditor/layouts/Content/markdownIt/codetabs/index.d.ts +14 -0
  66. package/lib/types/MdEditor/layouts/Content/markdownIt/heading/index.d.ts +9 -0
  67. package/lib/types/MdEditor/layouts/Content/markdownIt/katex/index.d.ts +10 -0
  68. package/lib/types/MdEditor/layouts/Content/markdownIt/mermaid/index.d.ts +6 -0
  69. package/lib/types/MdEditor/layouts/Content/props.d.ts +89 -0
  70. package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +15 -0
  71. package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +21 -0
  72. package/lib/types/MdEditor/layouts/Footer/index.d.ts +50 -0
  73. package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +33 -0
  74. package/lib/types/MdEditor/layouts/Modals/Link.d.ts +42 -0
  75. package/lib/types/MdEditor/layouts/Modals/index.d.ts +51 -0
  76. package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +28 -0
  77. package/lib/types/MdEditor/layouts/Toolbar/composition.d.ts +4 -0
  78. package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +91 -0
  79. package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +45 -0
  80. package/lib/types/MdEditor/props.d.ts +546 -0
  81. package/lib/types/MdEditor/static/event-name.d.ts +9 -0
  82. package/lib/{MdEditor → types/MdEditor}/type.d.ts +2 -1
  83. package/lib/types/MdEditor/utils/content-help.d.ts +19 -0
  84. package/lib/types/MdEditor/utils/dom.d.ts +22 -0
  85. package/lib/types/MdEditor/utils/event-bus.d.ts +17 -0
  86. package/lib/types/MdEditor/utils/index.d.ts +66 -0
  87. package/lib/types/MdEditor/utils/scroll-auto.d.ts +18 -0
  88. package/lib/types/MdEditor/utils/smooth-scroll.d.ts +8 -0
  89. package/lib/types/MdEditor/utils/vue-tsx.d.ts +23 -0
  90. package/lib/types/MdPreview/MdPreview.d.ts +186 -0
  91. package/lib/types/MdPreview/index.d.ts +453 -0
  92. package/lib/types/ModalToolbar/index.d.ts +244 -0
  93. package/lib/types/NormalToolbar/index.d.ts +105 -0
  94. package/lib/types/config.d.ts +1 -0
  95. package/lib/types/index.d.ts +8 -0
  96. package/lib/{md-editor-v3.umd.js → umd/index.js} +38 -38
  97. package/package.json +16 -20
  98. package/lib/md-editor-v3.cjs +0 -63
  99. package/lib/md-editor-v3.mjs +0 -4143
  100. /package/lib/{MdEditor/extensions → types/DropdownToolbar}/DropdownToolbar.d.ts +0 -0
  101. /package/lib/{MdEditor → types/MdEditor}/config.d.ts +0 -0
  102. /package/lib/{MdEditor/extensions → types/ModalToolbar}/ModalToolbar.d.ts +0 -0
  103. /package/lib/{MdEditor/extensions → types/NormalToolbar}/NormalToolbar.d.ts +0 -0
@@ -0,0 +1,1061 @@
1
+ import { inject as I, onMounted as C, watch as $, toRef as W, nextTick as A, shallowRef as R, ref as L, computed as M, defineComponent as Z, createVNode as H, Fragment as le, reactive as J, provide as F, onBeforeUnmount as ie } from "vue";
2
+ import { p, a as S, m as ce, k as B, e as N, h as se, f as j, i as de, g as O, j as U, l as ue, b as me, d as fe } from "./config.mjs";
3
+ import { b } from "./event-bus.mjs";
4
+ import { a as E, u as he } from "./dom.mjs";
5
+ import pe from "medium-zoom";
6
+ import { d as X, u as ge, a as ve } from "./index4.mjs";
7
+ import be from "copy-to-clipboard";
8
+ import ye from "markdown-it";
9
+ import we from "markdown-it-image-figures";
10
+ import ke from "markdown-it-task-lists";
11
+ import $e from "lru-cache";
12
+ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pageFullscreenChanged", G = "fullscreenChanged", D = "previewChanged", z = "htmlPreviewChanged", K = "catalogVisibleChanged", Se = "textareaFocus", Ie = (e, a) => {
13
+ const l = I("editorId"), t = X(() => {
14
+ const n = document.querySelectorAll(`#${l}-preview img`);
15
+ n.length !== 0 && pe(n, {
16
+ background: "#00000073"
17
+ });
18
+ });
19
+ C(t), $([a, W(e.setting, "preview")], t);
20
+ }, Te = Ie, Ee = (e, a) => {
21
+ const l = I("editorId"), t = I("usedLanguageText"), n = () => {
22
+ document.querySelectorAll(`#${l}-preview pre`).forEach((c) => {
23
+ var u, f;
24
+ let d = -1;
25
+ (u = c.querySelector(".copy-button")) == null || u.remove();
26
+ const s = ((f = t.value.copyCode) == null ? void 0 : f.text) || "复制代码", r = document.createElement("span");
27
+ r.setAttribute("class", "copy-button"), r.dataset.tips = s, r.innerHTML = `<svg class="${p}-icon" aria-hidden="true"><use xlink:href="#${p}-icon-copy"></use></svg>`, r.addEventListener("click", () => {
28
+ var k, v;
29
+ clearTimeout(d);
30
+ const w = c.querySelector("code").innerText, m = be(e.formatCopiedText(w)), g = ((k = t.value.copyCode) == null ? void 0 : k.successTips) || "已复制!", h = ((v = t.value.copyCode) == null ? void 0 : v.failTips) || "已复制!";
31
+ r.dataset.tips = m ? g : h, d = window.setTimeout(() => {
32
+ r.dataset.tips = s;
33
+ }, 1500);
34
+ }), c.appendChild(r);
35
+ });
36
+ }, o = () => {
37
+ A(n);
38
+ }, i = (c) => {
39
+ c && A(n);
40
+ };
41
+ $(() => a.value, o), $(() => e.setting.preview, i), $(() => e.setting.htmlPreview, i), $(() => t.value, n), C(n);
42
+ }, Pe = Ee, _e = (e) => {
43
+ var o;
44
+ const a = (o = S.editorExtensions) == null ? void 0 : o.highlight, l = a == null ? void 0 : a.instance, t = I("highlight"), n = R(l);
45
+ return C(() => {
46
+ if (!e.noHighlight && !n.value) {
47
+ const i = document.createElement("script");
48
+ i.src = t.value.js, i.onload = () => {
49
+ n.value = window.hljs;
50
+ }, i.id = `${p}-hljs`, E(i, "hljs");
51
+ const c = document.createElement("link");
52
+ c.rel = "stylesheet", c.href = t.value.css, c.id = `${p}-hlCss`, E(c);
53
+ }
54
+ }), $(
55
+ () => t.value.css,
56
+ (i) => {
57
+ he(`${p}-hlCss`, "href", i);
58
+ }
59
+ ), n;
60
+ }, Fe = _e, He = (e) => {
61
+ const a = I("theme"), { editorExtensions: l } = S, t = l == null ? void 0 : l.mermaid, n = R(t == null ? void 0 : t.instance), o = R(!1), i = new $e({
62
+ max: 1e3,
63
+ // 缓存10分钟
64
+ ttl: 6e5
65
+ }), c = () => {
66
+ const s = (t == null ? void 0 : t.instance) || window.mermaid;
67
+ !e.noMermaid && s && (s.initialize({
68
+ startOnLoad: !1,
69
+ theme: a.value === "dark" ? "dark" : "default"
70
+ }), o.value = !o.value);
71
+ };
72
+ return $(
73
+ () => a.value,
74
+ () => {
75
+ i.clear(), c();
76
+ }
77
+ ), C(() => {
78
+ if (!e.noMermaid && !(t != null && t.instance)) {
79
+ const s = document.createElement("script");
80
+ s.id = `${p}-mermaid`;
81
+ const r = (t == null ? void 0 : t.js) || ce;
82
+ /\.mjs/.test(r) ? (s.setAttribute("type", "module"), s.innerHTML = `import mermaid from "${r}";window.mermaid=mermaid;document.getElementById('${p}-mermaid').dispatchEvent(new Event('load'));`) : s.src = r, s.onload = () => {
83
+ n.value = window.mermaid, c();
84
+ }, E(s, "mermaid");
85
+ }
86
+ }), { mermaidRef: n, reRenderRef: o, replaceMermaid: () => {
87
+ A(() => {
88
+ !e.noMermaid && n.value && document.querySelectorAll(
89
+ `div.${p}-mermaid`
90
+ ).forEach(async (r) => {
91
+ let u = i.get(r.innerText);
92
+ if (!u) {
93
+ const w = ge(), g = await (n.value.renderAsync || n.value.render)(w, r.innerText);
94
+ u = typeof g == "string" ? g : g.svg, i.set(r.innerText, u);
95
+ }
96
+ const f = document.createElement("p");
97
+ f.className = `${p}-mermaid`, f.setAttribute("data-processed", ""), f.innerHTML = u, r.dataset.line !== void 0 && (f.dataset.line = r.dataset.line), r.replaceWith(f);
98
+ });
99
+ });
100
+ } };
101
+ }, Me = He, Re = (e) => {
102
+ var n;
103
+ const a = (n = S.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = R(l);
104
+ return C(() => {
105
+ if (!e.noKatex && !t.value) {
106
+ const o = document.createElement("script");
107
+ o.src = (a == null ? void 0 : a.js) || B.js, o.onload = () => {
108
+ t.value = window.katex;
109
+ }, o.id = `${p}-katex`;
110
+ const i = document.createElement("link");
111
+ i.rel = "stylesheet", i.href = (a == null ? void 0 : a.css) || B.css, i.id = `${p}-katexCss`, E(o, "katex"), E(i);
112
+ }
113
+ }), t;
114
+ }, xe = Re, Ae = (e, a) => {
115
+ const l = e.renderer.rules.fence.bind(e.renderer.rules);
116
+ e.renderer.rules.fence = (t, n, o, i, c) => {
117
+ const d = t[n], s = d.content.trim();
118
+ if (d.info === "mermaid") {
119
+ let r;
120
+ return t[n].map && t[n].level === 0 && (r = t[n].map[0], t[n].attrSet("data-line", String(r))), `<div class="${p}-mermaid" ${r !== void 0 ? "data-line=" + r : ""} data-mermaid-theme=${a.themeRef.value}>${s}</div>`;
121
+ }
122
+ return l(t, n, o, i, c);
123
+ };
124
+ }, Le = Ae, q = (e, a) => {
125
+ let l = !0, t = !0;
126
+ const n = e.posMax, o = a > 0 ? e.src.charCodeAt(a - 1) : -1, i = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
127
+ return (o === 32 || o === 9 || i >= 48 && i <= 57) && (t = !1), (i === 32 || i === 9) && (l = !1), {
128
+ can_open: l,
129
+ can_close: t
130
+ };
131
+ }, Be = (e, a) => {
132
+ let l, t, n, o;
133
+ if (e.src[e.pos] !== "$")
134
+ return !1;
135
+ if (n = q(e, e.pos), !n.can_open)
136
+ return a || (e.pending += "$"), e.pos += 1, !0;
137
+ const i = e.pos + 1;
138
+ for (l = i; (l = e.src.indexOf("$", l)) !== -1; ) {
139
+ for (o = l - 1; e.src[o] === "\\"; )
140
+ o -= 1;
141
+ if ((l - o) % 2 == 1)
142
+ break;
143
+ l += 1;
144
+ }
145
+ return l === -1 ? (a || (e.pending += "$"), e.pos = i, !0) : l - i === 0 ? (a || (e.pending += "$$"), e.pos = i + 1, !0) : (n = q(e, l), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(i, l)), e.pos = l + 1, !0) : (a || (e.pending += "$"), e.pos = i, !0));
146
+ }, Ne = (e, a, l, t) => {
147
+ let n, o, i, c, d = !1, s = e.bMarks[a] + e.tShift[a], r = e.eMarks[a];
148
+ if (s + 2 > r || e.src.slice(s, s + 2) !== "$$")
149
+ return !1;
150
+ if (s += 2, n = e.src.slice(s, r), t)
151
+ return !0;
152
+ for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), d = !0), i = a; !d && (i++, !(i >= l || (s = e.bMarks[i] + e.tShift[i], r = e.eMarks[i], s < r && e.tShift[i] < e.blkIndent))); )
153
+ e.src.slice(s, r).trim().slice(-2) === "$$" && (c = e.src.slice(0, r).lastIndexOf("$$"), o = e.src.slice(s, c), d = !0);
154
+ e.line = i + 1;
155
+ const u = e.push("math_block", "math", 0);
156
+ return u.block = !0, u.content = (n && n.trim() ? n + `
157
+ ` : "") + e.getLines(a + 1, i, e.tShift[a], !0) + (o && o.trim() ? o : ""), u.map = [a, e.line], u.markup = "$$", !0;
158
+ }, je = (e, a) => {
159
+ const l = (n) => {
160
+ if (a.katexRef.value) {
161
+ const o = a.katexRef.value.renderToString(n, {
162
+ throwOnError: !1
163
+ });
164
+ return `<span class="${p}-katex-inline" data-processed>${o}</span>`;
165
+ } else
166
+ return `<span class="${p}-katex-inline">${n}</span>`;
167
+ }, t = (n, o) => {
168
+ if (a.katexRef.value) {
169
+ const i = a.katexRef.value.renderToString(n, {
170
+ throwOnError: !1,
171
+ displayMode: !0
172
+ });
173
+ return `<p class="${p}-katex-block" data-line=${o} data-processed>${i}</p>`;
174
+ } else
175
+ return `<p class="${p}-katex-block" data-line=${o}>${n}</p>`;
176
+ };
177
+ e.inline.ruler.after("escape", "math_inline", Be), e.block.ruler.after("blockquote", "math_block", Ne, {
178
+ alt: ["paragraph", "reference", "blockquote", "list"]
179
+ }), e.renderer.rules.math_inline = (n, o) => l(n[o].content), e.renderer.rules.math_block = (n, o) => t(n[o].content, n[o].map[0]) + `
180
+ `;
181
+ }, Oe = je, Ue = (e, a) => {
182
+ a = a || {};
183
+ const l = 3, t = a.marker || "!", n = t.charCodeAt(0), o = t.length;
184
+ let i = "", c = "";
185
+ const d = (r, u, f, w, m) => {
186
+ const g = r[u];
187
+ return g.type === "admonition_open" ? (r[u].attrPush([
188
+ "class",
189
+ `${p}-admonition ${p}-admonition-${g.info}`
190
+ ]), r[u].attrSet("data-line", String(r[u].map[0]))) : g.type === "admonition_title_open" && r[u].attrPush(["class", `${p}-admonition-title`]), m.renderToken(r, u, f);
191
+ }, s = (r) => {
192
+ const u = r.trim().split(" ", 2);
193
+ c = "", i = u[0], u.length > 1 && (c = r.substring(i.length + 2)), (c === "" || !c) && (c = i);
194
+ };
195
+ e.block.ruler.before(
196
+ "code",
197
+ "admonition",
198
+ (r, u, f, w) => {
199
+ let m, g, h, k = !1, v = r.bMarks[u] + r.tShift[u], y = r.eMarks[u];
200
+ if (n !== r.src.charCodeAt(v))
201
+ return !1;
202
+ for (m = v + 1; m <= y && t[(m - v) % o] === r.src[m]; m++)
203
+ ;
204
+ const T = Math.floor((m - v) / o);
205
+ if (T !== l)
206
+ return !1;
207
+ m -= (m - v) % o;
208
+ const _ = r.src.slice(v, m), P = r.src.slice(m, y);
209
+ if (s(P), w)
210
+ return !0;
211
+ for (g = u; g++, !(g >= f || (v = r.bMarks[g] + r.tShift[g], y = r.eMarks[g], v < y && r.sCount[g] < r.blkIndent)); )
212
+ if (n === r.src.charCodeAt(v) && !(r.sCount[g] - r.blkIndent >= 4)) {
213
+ for (m = v + 1; m <= y && t[(m - v) % o] === r.src[m]; m++)
214
+ ;
215
+ if (!(Math.floor((m - v) / o) < T) && (m -= (m - v) % o, m = r.skipSpaces(m), !(m < y))) {
216
+ k = !0;
217
+ break;
218
+ }
219
+ }
220
+ const ae = r.parentType, oe = r.lineMax;
221
+ return r.parentType = "root", r.lineMax = g, h = r.push("admonition_open", "div", 1), h.markup = _, h.block = !0, h.info = i, h.map = [u, g], h = r.push("admonition_title_open", "p", 1), h.markup = _ + " " + i, h.map = [u, g], h = r.push("inline", "", 0), h.content = c, h.map = [u, r.line - 1], h.children = [], h = r.push("admonition_title_close", "p", -1), h.markup = _ + " " + i, r.md.block.tokenize(r, u + 1, g), h = r.push("admonition_close", "div", -1), h.markup = r.src.slice(v, m), h.block = !0, r.parentType = ae, r.lineMax = oe, r.line = g + (k ? 1 : 0), !0;
222
+ },
223
+ {
224
+ alt: ["paragraph", "reference", "blockquote", "list"]
225
+ }
226
+ ), e.renderer.rules.admonition_open = d, e.renderer.rules.admonition_title_open = d, e.renderer.rules.admonition_title_close = d, e.renderer.rules.admonition_close = d;
227
+ }, Ve = Ue, Ge = (e, a) => {
228
+ let l;
229
+ e.core.ruler.push("headingLinks", (t) => {
230
+ l || (l = t.Token);
231
+ }), e.renderer.rules.heading_open = (t, n) => {
232
+ const o = t[n], i = t[n + 1].content, c = o.markup.length;
233
+ return a.headsRef.value.push({
234
+ text: i,
235
+ level: c
236
+ }), o.map && o.level === 0 && (o.attrSet("data-line", String(o.map[0])), o.attrSet(
237
+ "id",
238
+ a.mdHeadingId(i, c, a.headsRef.value.length)
239
+ )), e.renderer.renderToken(t, n, a);
240
+ }, e.renderer.rules.heading_close = (t, n, o, i, c) => c.renderToken(t, n, o);
241
+ }, De = Ge, ze = (e, a) => {
242
+ const l = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
243
+ function o(s) {
244
+ return s.info ? t(s.info).trim() : "";
245
+ }
246
+ function i(s) {
247
+ const r = o(s), [u = null, f = ""] = (n.exec(r) || []).slice(1);
248
+ return [u, f];
249
+ }
250
+ function c(s) {
251
+ const r = o(s);
252
+ return r ? r.split(/(\s+)/g)[0] : "";
253
+ }
254
+ const d = (s, r, u, f, w) => {
255
+ if (s[r].hidden)
256
+ return "";
257
+ const [m, g] = i(s[r]);
258
+ if (m === null)
259
+ return l(s, r, u, f, w);
260
+ let h, k, v, y, T = "", _ = "";
261
+ for (let P = r; P < s.length && (h = s[P], [k, v] = i(h), k === m); P++)
262
+ h.info = h.info.replace(n, ""), h.hidden = !0, y = P - r > 0 ? "" : " checked", T += `<li><input type="radio" name="label-group-${a.editorId}-${r}"${y}><label for="group-${a.editorId}-${r}-tab-${P - r}" onclick="this.previousElementSibling.click()">${v || c(h)}</label></li>
263
+ `, _ += `<input type="radio" id="group-${a.editorId}-${r}-tab-${P - r}" name="group-${a.editorId}-${r}"${y}>
264
+ ` + l(s, P, u, f, w);
265
+ return `<div class="code-tabs">
266
+ <ul>
267
+ ` + T + `</ul>
268
+ ` + _ + "</div>";
269
+ };
270
+ e.renderer.rules.fence = d;
271
+ }, Ke = ze, qe = (e) => {
272
+ [
273
+ "paragraph_open",
274
+ "table_open",
275
+ "ordered_list_open",
276
+ "bullet_list_open",
277
+ "blockquote_open",
278
+ "hr"
279
+ ].forEach((a) => {
280
+ e.renderer.rules[a] = (l, t, n, o, i) => {
281
+ let c;
282
+ return l[t].map && l[t].level === 0 && (c = l[t].map[0], l[t].attrSet("data-line", String(c))), i.renderToken(l, t, n);
283
+ };
284
+ }), ["html_block", "fence"].forEach((a) => {
285
+ const l = e.renderer.rules[a];
286
+ e.renderer.rules[a] = (t, n, o, i, c) => {
287
+ let d;
288
+ const s = l(t, n, o, i, c);
289
+ return t[n].map && t[n].level === 0 ? (d = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${d}"`)) : s;
290
+ };
291
+ });
292
+ }, We = (e, a) => {
293
+ const { editorConfig: l, markdownItConfig: t } = S, n = I("editorId"), o = I("showCodeRowNumber"), i = I("theme"), c = L([]), d = Fe(e), s = xe(e), { reRenderRef: r, replaceMermaid: u } = Me(e), f = ye({
294
+ html: !0,
295
+ breaks: !0
296
+ });
297
+ f.use(Oe, { katexRef: s }), f.use(we, { figcaption: !0 }), f.use(Ve), f.use(ke), f.use(De, { mdHeadingId: e.mdHeadingId, headsRef: c }), f.use(Ke, { editorId: n }), e.noMermaid || f.use(Le, { themeRef: i }), f.set({
298
+ highlight: (k, v) => {
299
+ let y;
300
+ !e.noHighlight && d.value ? d.value.getLanguage(v) ? y = d.value.highlight(k, {
301
+ language: v,
302
+ ignoreIllegals: !0
303
+ }).value : y = d.value.highlightAuto(k).value : y = f.utils.escapeHtml(k);
304
+ const T = o ? ve(y.trim()) : `<span class="code-block">${y.trim()}</span>`;
305
+ return `<pre><code class="language-${v}" language=${v}>${T}</code></pre>`;
306
+ }
307
+ }), qe(f), t(f);
308
+ const w = L(e.sanitize(f.render(e.modelValue))), m = () => {
309
+ b.emit(n, "buildFinished", w.value), e.onHtmlChanged(w.value), e.onGetCatalog(c.value), b.emit(n, "catalogChanged", c.value), u();
310
+ };
311
+ C(m);
312
+ const g = X(
313
+ async () => {
314
+ c.value = [], w.value = e.sanitize(f.render(e.modelValue)), m();
315
+ },
316
+ (l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
317
+ ), h = M(() => (e.noKatex || s.value) && (e.noHighlight || d.value));
318
+ return $([W(e, "modelValue"), h, r], g), C(() => {
319
+ b.on(n, {
320
+ name: "pushCatalog",
321
+ callback() {
322
+ b.emit(n, "catalogChanged", c.value);
323
+ }
324
+ });
325
+ }), { html: w };
326
+ }, Ze = We, Je = {
327
+ modelValue: {
328
+ type: String,
329
+ default: ""
330
+ },
331
+ setting: {
332
+ type: Object,
333
+ default: () => ({})
334
+ },
335
+ onHtmlChanged: {
336
+ type: Function,
337
+ default: () => {
338
+ }
339
+ },
340
+ onGetCatalog: {
341
+ type: Function,
342
+ default: () => {
343
+ }
344
+ },
345
+ mdHeadingId: {
346
+ type: Function,
347
+ default: () => ""
348
+ },
349
+ noMermaid: {
350
+ type: Boolean,
351
+ default: !1
352
+ },
353
+ sanitize: {
354
+ type: Function,
355
+ default: (e) => e
356
+ },
357
+ // 不使用该函数功能
358
+ noKatex: {
359
+ type: Boolean,
360
+ default: !1
361
+ },
362
+ formatCopiedText: {
363
+ type: Function,
364
+ default: (e) => e
365
+ },
366
+ noHighlight: {
367
+ type: Boolean,
368
+ default: !1
369
+ },
370
+ previewOnly: {
371
+ type: Boolean,
372
+ default: !1
373
+ }
374
+ }, Xe = /* @__PURE__ */ Z({
375
+ name: "ContentPreview",
376
+ props: Je,
377
+ setup(e) {
378
+ const a = I("editorId"), l = I("previewTheme"), t = I("showCodeRowNumber"), {
379
+ html: n
380
+ } = Ze(e, e.previewOnly);
381
+ return Pe(e, n), Te(e, n), () => H(le, null, [H("div", {
382
+ id: `${a}-preview-wrapper`,
383
+ class: `${p}-preview-wrapper`,
384
+ "data-show": e.setting.preview,
385
+ key: "content-preview-wrapper"
386
+ }, [H("article", {
387
+ id: `${a}-preview`,
388
+ class: [`${p}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${p}-scrn`],
389
+ innerHTML: n.value
390
+ }, null)]), !e.previewOnly && H("div", {
391
+ id: `${a}-html-wrapper`,
392
+ class: `${p}-preview-wrapper`,
393
+ "data-show": e.setting.htmlPreview,
394
+ key: "html-preview-wrapper"
395
+ }, [H("div", {
396
+ class: `${p}-html`
397
+ }, [n.value])])]);
398
+ }
399
+ }), ut = (e, a) => {
400
+ const { editorId: l } = e, t = J({
401
+ // 是否已编译成html
402
+ buildFinished: !1,
403
+ // 存储当前最新的html
404
+ html: ""
405
+ });
406
+ $(
407
+ () => e.modelValue,
408
+ () => {
409
+ t.buildFinished = !1;
410
+ }
411
+ ), C(() => {
412
+ b.on(l, {
413
+ name: "buildFinished",
414
+ callback(n) {
415
+ t.buildFinished = !0, t.html = n;
416
+ }
417
+ }), b.on(l, {
418
+ name: Q,
419
+ callback() {
420
+ const n = new Promise((o) => {
421
+ if (t.buildFinished)
422
+ o(t.html);
423
+ else {
424
+ const i = (c) => {
425
+ o(c), b.remove(l, "buildFinished", i);
426
+ };
427
+ b.on(l, {
428
+ name: "buildFinished",
429
+ callback: i
430
+ });
431
+ }
432
+ });
433
+ e.onSave ? e.onSave(e.modelValue, n) : a.emit("onSave", e.modelValue, n);
434
+ }
435
+ });
436
+ });
437
+ }, ee = (e) => {
438
+ var n, o;
439
+ const { editorId: a } = e, l = (o = (n = S) == null ? void 0 : n.editorExtensions) == null ? void 0 : o.highlight;
440
+ F("editorId", a), F(
441
+ "theme",
442
+ M(() => e.theme)
443
+ ), F(
444
+ "highlight",
445
+ M(() => {
446
+ const i = {
447
+ ...N,
448
+ ...l == null ? void 0 : l.css
449
+ }, c = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
450
+ return {
451
+ js: (l == null ? void 0 : l.js) || se,
452
+ css: i[e.codeTheme] ? i[e.codeTheme][c] : N.atom[c]
453
+ };
454
+ })
455
+ ), F("showCodeRowNumber", e.showCodeRowNumber);
456
+ const t = M(() => {
457
+ var c, d;
458
+ const i = {
459
+ ...j,
460
+ ...(d = (c = S) == null ? void 0 : c.editorConfig) == null ? void 0 : d.languageUserDefined
461
+ };
462
+ return i[e.language] ? i[e.language] : j["zh-CN"];
463
+ });
464
+ F("usedLanguageText", t), F(
465
+ "previewTheme",
466
+ M(() => e.previewTheme)
467
+ );
468
+ }, mt = (e) => {
469
+ ee(e), F("tabWidth", e.tabWidth);
470
+ }, te = (e) => {
471
+ C(() => {
472
+ var l;
473
+ const a = document.createElement("script");
474
+ a.src = ((l = S.editorExtensions) == null ? void 0 : l.iconfont) || de, a.id = `${p}-icon`, e.noIconfont || E(a);
475
+ });
476
+ }, ft = (e) => {
477
+ var c, d, s, r, u, f;
478
+ const { noPrettier: a, noUploadImg: l } = e, { editorExtensions: t } = S, n = a || !!((d = (c = S.editorExtensions) == null ? void 0 : c.prettier) != null && d.prettierInstance), o = a || !!((r = (s = S.editorExtensions) == null ? void 0 : s.prettier) != null && r.parserMarkdownInstance), i = l || !!((f = (u = S.editorExtensions) == null ? void 0 : u.cropper) != null && f.instance);
479
+ C(() => {
480
+ var k, v, y, T;
481
+ const w = document.createElement("script"), m = document.createElement("script");
482
+ w.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || O.main, w.id = `${p}-prettier`, m.src = ((v = t == null ? void 0 : t.prettier) == null ? void 0 : v.parserMarkdownJs) || O.markdown, m.id = `${p}-prettierMD`;
483
+ const g = document.createElement("link");
484
+ g.rel = "stylesheet", g.href = ((y = t == null ? void 0 : t.cropper) == null ? void 0 : y.css) || U.css, g.id = `${p}-cropperCss`;
485
+ const h = document.createElement("script");
486
+ h.src = ((T = t == null ? void 0 : t.cropper) == null ? void 0 : T.js) || U.js, h.id = `${p}-cropper`, i || (E(g), E(h)), n || E(w), o || E(m);
487
+ }), te(e);
488
+ }, ht = (e, a) => {
489
+ const { editorId: l } = e, t = J({
490
+ pageFullscreen: e.pageFullscreen,
491
+ fullscreen: !1,
492
+ preview: e.preview,
493
+ htmlPreview: e.preview ? !1 : e.htmlPreview
494
+ }), n = (c, d) => {
495
+ t[c] = d === void 0 ? !t[c] : d, c === "preview" && t.preview ? t.htmlPreview = !1 : c === "htmlPreview" && t.htmlPreview && (t.preview = !1);
496
+ };
497
+ let o = "";
498
+ const i = () => {
499
+ t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = o;
500
+ };
501
+ return $(() => [t.pageFullscreen, t.fullscreen], i), C(() => {
502
+ b.on(l, {
503
+ name: "uploadImage",
504
+ callback(c, d) {
505
+ const s = (r) => {
506
+ b.emit(l, "replace", "image", {
507
+ desc: "",
508
+ urls: r
509
+ }), d && d();
510
+ };
511
+ e.onUploadImg ? e.onUploadImg(c, s) : a.emit("onUploadImg", c, s);
512
+ }
513
+ }), o = document.body.style.overflow, i();
514
+ }), [t, n];
515
+ }, pt = (e) => {
516
+ const { editorId: a } = e, l = L(!1);
517
+ return C(() => {
518
+ b.on(a, {
519
+ name: Y,
520
+ callback: (n) => {
521
+ n === void 0 ? l.value = !l.value : l.value = n;
522
+ }
523
+ });
524
+ }), M(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
525
+ }, gt = (e, a, l, t, n) => {
526
+ const { editorId: o } = e;
527
+ $(
528
+ () => t.pageFullscreen,
529
+ (c) => {
530
+ b.emit(o, V, c);
531
+ }
532
+ ), $(
533
+ () => t.fullscreen,
534
+ (c) => {
535
+ b.emit(o, G, c);
536
+ }
537
+ ), $(
538
+ () => t.preview,
539
+ (c) => {
540
+ b.emit(o, D, c);
541
+ }
542
+ ), $(
543
+ () => t.htmlPreview,
544
+ (c) => {
545
+ b.emit(o, z, c);
546
+ }
547
+ ), $(l, (c) => {
548
+ b.emit(o, K, c);
549
+ });
550
+ const i = {
551
+ on(c, d) {
552
+ switch (c) {
553
+ case "pageFullscreen": {
554
+ b.on(o, {
555
+ name: V,
556
+ callback(s) {
557
+ d(s);
558
+ }
559
+ });
560
+ break;
561
+ }
562
+ case "fullscreen": {
563
+ b.on(o, {
564
+ name: G,
565
+ callback(s) {
566
+ d(s);
567
+ }
568
+ });
569
+ break;
570
+ }
571
+ case "preview": {
572
+ b.on(o, {
573
+ name: D,
574
+ callback(s) {
575
+ d(s);
576
+ }
577
+ });
578
+ break;
579
+ }
580
+ case "htmlPreview": {
581
+ b.on(o, {
582
+ name: z,
583
+ callback(s) {
584
+ d(s);
585
+ }
586
+ });
587
+ break;
588
+ }
589
+ case "catalog": {
590
+ b.on(o, {
591
+ name: K,
592
+ callback(s) {
593
+ d(s);
594
+ }
595
+ });
596
+ break;
597
+ }
598
+ }
599
+ },
600
+ togglePageFullscreen(c) {
601
+ n("pageFullscreen", c);
602
+ },
603
+ toggleFullscreen(c) {
604
+ b.emit(o, Ce, c);
605
+ },
606
+ togglePreview(c) {
607
+ n("preview", c);
608
+ },
609
+ toggleHtmlPreview(c) {
610
+ n("htmlPreview", c);
611
+ },
612
+ toggleCatalog(c) {
613
+ b.emit(o, Y, c);
614
+ },
615
+ triggerSave() {
616
+ b.emit(o, Q);
617
+ },
618
+ insert(c) {
619
+ b.emit(o, "replace", "universal", { generate: c });
620
+ },
621
+ focus() {
622
+ b.emit(o, Se);
623
+ }
624
+ };
625
+ a.expose(i);
626
+ }, Qe = (e) => e, ne = {
627
+ /**
628
+ * markdown content.
629
+ *
630
+ * @default ''
631
+ */
632
+ modelValue: {
633
+ type: String,
634
+ default: ""
635
+ },
636
+ /**
637
+ * 主题,支持light和dark
638
+ *
639
+ * @default 'light'
640
+ */
641
+ theme: {
642
+ type: String,
643
+ default: "light"
644
+ },
645
+ /**
646
+ * 外层类名
647
+ *
648
+ * @default ''
649
+ */
650
+ class: {
651
+ type: String,
652
+ default: ""
653
+ },
654
+ /**
655
+ * 预设语言名称
656
+ *
657
+ * @default 'zh-CN'
658
+ */
659
+ language: {
660
+ type: String,
661
+ default: "zh-CN"
662
+ },
663
+ /**
664
+ * html变化事件
665
+ */
666
+ onHtmlChanged: {
667
+ type: Function
668
+ },
669
+ /**
670
+ * 获取目录结构
671
+ */
672
+ onGetCatalog: {
673
+ type: Function
674
+ },
675
+ /**
676
+ * 编辑器唯一标识
677
+ *
678
+ * @default 'md-editor-v3'
679
+ */
680
+ editorId: {
681
+ type: String,
682
+ default: ue
683
+ },
684
+ /**
685
+ * 预览中代码是否显示行号
686
+ *
687
+ * @default false
688
+ */
689
+ showCodeRowNumber: {
690
+ type: Boolean,
691
+ default: !1
692
+ },
693
+ /**
694
+ * 预览内容样式
695
+ *
696
+ * @default 'default'
697
+ */
698
+ previewTheme: {
699
+ type: String,
700
+ default: "default"
701
+ },
702
+ /**
703
+ * 编辑器样式
704
+ */
705
+ style: {
706
+ type: Object,
707
+ default: () => ({})
708
+ },
709
+ /**
710
+ * 标题的id生成方式
711
+ *
712
+ * @default (text: string) => text
713
+ */
714
+ mdHeadingId: {
715
+ type: Function,
716
+ default: Qe
717
+ },
718
+ /**
719
+ *
720
+ * 不能保证文本正确的情况,在marked编译md文本后通过该方法处理
721
+ * 推荐DOMPurify、sanitize-html
722
+ *
723
+ * @default (text: string) => text
724
+ */
725
+ sanitize: {
726
+ type: Function,
727
+ default: (e) => e
728
+ },
729
+ /**
730
+ * 不使用该mermaid
731
+ *
732
+ * @default false
733
+ */
734
+ noMermaid: {
735
+ type: Boolean,
736
+ default: !1
737
+ },
738
+ /**
739
+ * 不使用katex
740
+ *
741
+ * @default false
742
+ */
743
+ noKatex: {
744
+ type: Boolean,
745
+ default: !1
746
+ },
747
+ /**
748
+ * 代码主题
749
+ *
750
+ * @default 'atom'
751
+ */
752
+ codeTheme: {
753
+ type: String,
754
+ default: "atom"
755
+ },
756
+ /**
757
+ * 不插入iconfont链接
758
+ *
759
+ * @default false
760
+ */
761
+ noIconfont: {
762
+ type: Boolean
763
+ },
764
+ /**
765
+ * 复制代码格式化方法
766
+ *
767
+ * @default (text) => text
768
+ */
769
+ formatCopiedText: {
770
+ type: Function,
771
+ default: (e) => e
772
+ },
773
+ /**
774
+ * 某些预览主题的代码模块背景是暗色系
775
+ * 将这个属性设置为true,会自动在该主题下的light模式下使用暗色系的代码风格
776
+ *
777
+ * @default true
778
+ */
779
+ codeStyleReverse: {
780
+ type: Boolean,
781
+ default: !0
782
+ },
783
+ /**
784
+ * 需要自动调整的预览主题
785
+ *
786
+ * @default ['default', 'mk-cute']
787
+ */
788
+ codeStyleReverseList: {
789
+ type: Array,
790
+ default: ["default", "mk-cute"]
791
+ },
792
+ noHighlight: {
793
+ type: Boolean,
794
+ default: !1
795
+ }
796
+ }, vt = {
797
+ ...ne,
798
+ /**
799
+ * input回调事件
800
+ */
801
+ onChange: {
802
+ type: Function
803
+ },
804
+ /**
805
+ * input回调事件
806
+ */
807
+ onSave: {
808
+ type: Function
809
+ },
810
+ /**
811
+ * 上传图片事件
812
+ */
813
+ onUploadImg: {
814
+ type: Function
815
+ },
816
+ /**
817
+ * 是否页面内全屏
818
+ *
819
+ * @default false
820
+ */
821
+ pageFullscreen: {
822
+ type: Boolean,
823
+ default: !1
824
+ },
825
+ /**
826
+ * 是否展开预览
827
+ *
828
+ * @default true
829
+ */
830
+ preview: {
831
+ type: Boolean,
832
+ default: !0
833
+ },
834
+ /**
835
+ * 是否展开html预览
836
+ *
837
+ * @default false
838
+ */
839
+ htmlPreview: {
840
+ type: Boolean,
841
+ default: !1
842
+ },
843
+ /**
844
+ * 仅预览模式,不显示toolbar和编辑框
845
+ *
846
+ * @4.0.0开始移除该设置,使用组件MdPreview替换
847
+ *
848
+ * @default false
849
+ */
850
+ // previewOnly: {
851
+ // type: Boolean as PropType<boolean>,
852
+ // default: false
853
+ // },
854
+ /**
855
+ * 工具栏选择显示
856
+ *
857
+ * @default allToolbar
858
+ */
859
+ toolbars: {
860
+ type: Array,
861
+ default: me
862
+ },
863
+ /**
864
+ * 工具栏选择不显示
865
+ *
866
+ * @default []
867
+ */
868
+ toolbarsExclude: {
869
+ type: Array,
870
+ default: []
871
+ },
872
+ /**
873
+ * 格式化md
874
+ *
875
+ * @default true
876
+ */
877
+ noPrettier: {
878
+ type: Boolean,
879
+ default: !1
880
+ },
881
+ /**
882
+ * 一个tab等于空格数
883
+ *
884
+ * @default 2
885
+ */
886
+ tabWidth: {
887
+ type: Number,
888
+ default: 2
889
+ },
890
+ /**
891
+ * 表格预设格子数
892
+ *
893
+ * @default [6, 4]
894
+ */
895
+ tableShape: {
896
+ type: Array,
897
+ default: () => [6, 4]
898
+ },
899
+ /**
900
+ * 空提示
901
+ *
902
+ * @default ''
903
+ */
904
+ placeholder: {
905
+ type: String,
906
+ default: ""
907
+ },
908
+ /**
909
+ * 自定义的工具栏列表
910
+ */
911
+ defToolbars: {
912
+ type: [String, Object]
913
+ },
914
+ /**
915
+ * 内部错误捕获
916
+ */
917
+ onError: {
918
+ type: Function
919
+ },
920
+ /**
921
+ * 页脚列表显示顺序
922
+ */
923
+ footers: {
924
+ type: Array,
925
+ default: fe
926
+ },
927
+ /**
928
+ * 是否默认激活输入框和预览框同步滚动
929
+ *
930
+ * @default true
931
+ */
932
+ scrollAuto: {
933
+ type: Boolean,
934
+ default: !0
935
+ },
936
+ /**
937
+ * 自定义的也叫工具组件列表
938
+ */
939
+ defFooters: {
940
+ type: [String, Object]
941
+ },
942
+ /**
943
+ * 是否禁用上传图片
944
+ *
945
+ * @default false
946
+ */
947
+ noUploadImg: {
948
+ type: Boolean
949
+ },
950
+ /**
951
+ * 文本区域自动获得焦点
952
+ *
953
+ * @default false
954
+ */
955
+ autoFocus: {
956
+ type: Boolean
957
+ },
958
+ /**
959
+ * 禁用文本区域
960
+ *
961
+ * @default false
962
+ */
963
+ disabled: {
964
+ type: Boolean
965
+ },
966
+ /**
967
+ * 文本区域为只读
968
+ *
969
+ * @default false
970
+ */
971
+ readOnly: {
972
+ type: Boolean
973
+ },
974
+ /**
975
+ * 文本区域允许的最大字符数
976
+ */
977
+ maxLength: {
978
+ type: Number
979
+ },
980
+ /**
981
+ * 是否启用自动识别粘贴代码类别
982
+ * 目前支持 vscode 复制的代码识别
983
+ *
984
+ * @default false
985
+ */
986
+ autoDetectCode: {
987
+ type: Boolean
988
+ },
989
+ /**
990
+ * 输入框失去焦点时触发事件
991
+ */
992
+ onBlur: {
993
+ type: Function
994
+ },
995
+ /**
996
+ * 输入框获得焦点时触发事件
997
+ */
998
+ onFocus: {
999
+ type: Function
1000
+ }
1001
+ }, re = ["onHtmlChanged", "onGetCatalog"], bt = [
1002
+ ...re,
1003
+ "onChange",
1004
+ "onSave",
1005
+ "onUploadImg",
1006
+ "onError",
1007
+ "update:modelValue",
1008
+ "onBlur",
1009
+ "onFocus"
1010
+ ], Ye = /* @__PURE__ */ Z({
1011
+ name: "MdPreview",
1012
+ props: ne,
1013
+ emits: re,
1014
+ setup(e, a) {
1015
+ const {
1016
+ editorId: l,
1017
+ noKatex: t,
1018
+ noMermaid: n,
1019
+ noHighlight: o
1020
+ } = e;
1021
+ return ee(e), te(e), ie(() => {
1022
+ b.clear(l);
1023
+ }), () => H("div", {
1024
+ id: l,
1025
+ class: [p, e.class, e.theme === "dark" && `${p}-dark`, `${p}-previewOnly`],
1026
+ style: e.style
1027
+ }, [H(Xe, {
1028
+ modelValue: e.modelValue,
1029
+ onHtmlChanged: (i) => {
1030
+ e.onHtmlChanged ? e.onHtmlChanged(i) : a.emit("onHtmlChanged", i);
1031
+ },
1032
+ onGetCatalog: (i) => {
1033
+ e.onGetCatalog ? e.onGetCatalog(i) : a.emit("onGetCatalog", i);
1034
+ },
1035
+ mdHeadingId: e.mdHeadingId,
1036
+ noMermaid: n,
1037
+ sanitize: e.sanitize,
1038
+ noKatex: t,
1039
+ formatCopiedText: e.formatCopiedText,
1040
+ noHighlight: o,
1041
+ previewOnly: !0
1042
+ }, null)]);
1043
+ }
1044
+ }), x = Ye;
1045
+ x.install = (e) => (e.component(x.name, x), e);
1046
+ export {
1047
+ Ce as C,
1048
+ x as M,
1049
+ Q as O,
1050
+ Se as T,
1051
+ Y as a,
1052
+ Xe as b,
1053
+ bt as c,
1054
+ mt as d,
1055
+ vt as e,
1056
+ ft as f,
1057
+ ht as g,
1058
+ pt as h,
1059
+ gt as i,
1060
+ ut as u
1061
+ };