md-editor-v3 4.12.0-beta.1 → 4.12.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.
@@ -1,19 +1,19 @@
1
1
  import { inject as P, watch as I, toRef as te, onMounted as _, nextTick as j, shallowRef as B, ref as R, computed as F, defineComponent as ne, createVNode as M, Fragment as pe, reactive as oe, provide as x, onBeforeUnmount as he } from "vue";
2
2
  import { e as S, p as h, m as ge, k as D, f as V, h as ye, s as z, a as ve, i as be, g as W, j as q, b as we, d as ke } from "./config.mjs";
3
- import { a as $e, b as y, P as Ce, C as K, R as G, B as A, O as re, E as Ie, U as Se, c as ae, d as Z, F as J, e as X, H as Q, f as Y, h as le, i as Ee, j as Pe } from "./index4.mjs";
4
- import { a as T, u as _e } from "./dom.mjs";
5
- import Te from "medium-zoom";
3
+ import { a as $e, b as g, P as Ce, C as K, R as G, B as A, O as re, E as Ie, U as Se, c as ae, d as Z, F as J, e as X, H as Q, f as Y, h as le, i as Ee, j as Pe, k as _e } from "./index4.mjs";
4
+ import { a as T, u as Te } from "./dom.mjs";
5
+ import xe from "medium-zoom";
6
6
  import { debounce as ie, uuid as U } from "@vavt/util";
7
- import xe from "copy-to-clipboard";
8
- import Fe from "markdown-it";
9
- import He from "markdown-it-image-figures";
10
- import Me from "markdown-it-task-lists";
11
- import Re from "markdown-it-xss";
12
- import { LRUCache as Ae } from "lru-cache";
13
- const Be = (e, a) => {
7
+ import Fe from "copy-to-clipboard";
8
+ import He from "markdown-it";
9
+ import Me from "markdown-it-image-figures";
10
+ import Re from "markdown-it-task-lists";
11
+ import Ae from "markdown-it-xss";
12
+ import { LRUCache as Be } from "lru-cache";
13
+ const Le = (e, a) => {
14
14
  const l = P("editorId"), { noImgZoomIn: t } = e, n = ie(() => {
15
15
  const i = document.querySelectorAll(`#${l}-preview img`);
16
- i.length !== 0 && Te(i, {
16
+ i.length !== 0 && xe(i, {
17
17
  background: "#00000073"
18
18
  });
19
19
  });
@@ -26,7 +26,7 @@ const Be = (e, a) => {
26
26
  immediate: !0
27
27
  }
28
28
  );
29
- }, Le = (e, a) => {
29
+ }, Ne = (e, a) => {
30
30
  if (typeof a[e] == "string")
31
31
  return a[e];
32
32
  const l = `<i class="${h}-iconfont ${h}-icon-${e}"></i>`;
@@ -36,59 +36,59 @@ const Be = (e, a) => {
36
36
  default:
37
37
  return l;
38
38
  }
39
- }, Ne = (e, a, l) => {
40
- const t = P("editorId"), n = P("usedLanguageText"), i = P("customIcon"), r = () => {
39
+ }, Oe = (e, a, l) => {
40
+ const t = P("editorId"), n = P("usedLanguageText"), i = P("customIcon"), o = () => {
41
41
  document.querySelectorAll(`#${t}-preview pre`).forEach((s) => {
42
42
  var v, m;
43
- let o = -1;
43
+ let r = -1;
44
44
  (v = s.querySelector(".copy-button")) == null || v.remove();
45
45
  const d = ((m = n.value.copyCode) == null ? void 0 : m.text) || "复制代码", b = document.createElement("span");
46
- b.setAttribute("class", "copy-button"), b.dataset.tips = d, b.innerHTML = Le("copy", i.value), b.addEventListener("click", () => {
46
+ b.setAttribute("class", "copy-button"), b.dataset.tips = d, b.innerHTML = Ne("copy", i.value), b.addEventListener("click", () => {
47
47
  var w, E;
48
- clearTimeout(o);
49
- const p = s.querySelector("code").innerText, f = xe(e.formatCopiedText(p)), k = ((w = n.value.copyCode) == null ? void 0 : w.successTips) || "已复制!", g = ((E = n.value.copyCode) == null ? void 0 : E.failTips) || "已复制!";
50
- b.dataset.tips = f ? k : g, o = window.setTimeout(() => {
48
+ clearTimeout(r);
49
+ const p = s.querySelector("code").innerText, f = Fe(e.formatCopiedText(p)), k = ((w = n.value.copyCode) == null ? void 0 : w.successTips) || "已复制!", y = ((E = n.value.copyCode) == null ? void 0 : E.failTips) || "已复制!";
50
+ b.dataset.tips = f ? k : y, r = window.setTimeout(() => {
51
51
  b.dataset.tips = d;
52
52
  }, 1500);
53
53
  }), s.appendChild(b);
54
54
  });
55
55
  }, u = () => {
56
- j(r);
56
+ j(o);
57
57
  }, c = (s) => {
58
- s && j(r);
58
+ s && j(o);
59
59
  };
60
- I([a, l], u), I(() => e.setting.preview, c), I(() => e.setting.htmlPreview, c), I(() => n.value, r), _(r);
61
- }, Oe = (e) => {
60
+ I([a, l], u), I(() => e.setting.preview, c), I(() => e.setting.htmlPreview, c), I(() => n.value, o), _(o);
61
+ }, je = (e) => {
62
62
  var i;
63
63
  const a = (i = S.editorExtensions) == null ? void 0 : i.highlight, l = a == null ? void 0 : a.instance, t = P("highlight"), n = B(l);
64
64
  return _(() => {
65
65
  if (!e.noHighlight && !n.value) {
66
- const r = document.createElement("script");
67
- r.src = t.value.js, r.onload = () => {
66
+ const o = document.createElement("script");
67
+ o.src = t.value.js, o.onload = () => {
68
68
  n.value = window.hljs;
69
- }, r.id = `${h}-hljs`, T(r, "hljs");
69
+ }, o.id = `${h}-hljs`, T(o, "hljs");
70
70
  const u = document.createElement("link");
71
71
  u.rel = "stylesheet", u.href = t.value.css, u.id = `${h}-hlCss`, T(u);
72
72
  }
73
73
  }), I(
74
74
  () => t.value.css,
75
- (r) => {
76
- _e(`${h}-hlCss`, "href", r);
75
+ (o) => {
76
+ Te(`${h}-hlCss`, "href", o);
77
77
  }
78
78
  ), n;
79
- }, je = (e) => {
80
- const a = P("theme"), { editorExtensions: l, mermaidConfig: t } = S, n = l == null ? void 0 : l.mermaid, i = B(n == null ? void 0 : n.instance), r = B(-1), u = new Ae({
79
+ }, Ue = (e) => {
80
+ const a = P("theme"), { editorExtensions: l, mermaidConfig: t } = S, n = l == null ? void 0 : l.mermaid, i = B(n == null ? void 0 : n.instance), o = B(-1), u = new Be({
81
81
  max: 1e3,
82
82
  // 缓存10分钟
83
83
  ttl: 6e5
84
84
  }), c = () => {
85
- const o = i.value;
86
- !e.noMermaid && o && (o.initialize(
85
+ const r = i.value;
86
+ !e.noMermaid && r && (r.initialize(
87
87
  t({
88
88
  startOnLoad: !1,
89
89
  theme: a.value === "dark" ? "dark" : "default"
90
90
  })
91
- ), r.value = r.value + 1);
91
+ ), o.value = o.value + 1);
92
92
  };
93
93
  return I(
94
94
  () => a.value,
@@ -97,41 +97,41 @@ const Be = (e, a) => {
97
97
  }
98
98
  ), _(() => {
99
99
  if (!e.noMermaid && !(n != null && n.instance)) {
100
- const o = (n == null ? void 0 : n.js) || ge;
101
- if (/\.mjs/.test(o))
100
+ const r = (n == null ? void 0 : n.js) || ge;
101
+ if (/\.mjs/.test(r))
102
102
  import(
103
103
  /* @vite-ignore */
104
104
  /* webpackIgnore: true */
105
- o
105
+ r
106
106
  ).then((d) => {
107
107
  i.value = d.default, c();
108
108
  });
109
109
  else {
110
110
  const d = document.createElement("script");
111
- d.id = `${h}-mermaid`, d.src = o, d.onload = () => {
111
+ d.id = `${h}-mermaid`, d.src = r, d.onload = () => {
112
112
  i.value = window.mermaid, c();
113
113
  }, T(d, "mermaid");
114
114
  }
115
115
  }
116
- }), { mermaidRef: i, reRenderRef: r, replaceMermaid: () => {
116
+ }), { mermaidRef: i, reRenderRef: o, replaceMermaid: () => {
117
117
  j(() => {
118
118
  if (!e.noMermaid && i.value) {
119
- const o = document.querySelectorAll(
119
+ const r = document.querySelectorAll(
120
120
  `div.${h}-mermaid`
121
121
  ), d = document.createElement("div");
122
122
  d.style.width = document.body.offsetWidth + "px", d.style.height = document.body.offsetHeight + "px", d.style.position = "fixed", d.style.zIndex = "-10000", d.style.top = "-10000";
123
- let b = o.length;
124
- b > 0 && document.body.appendChild(d), o.forEach(async (v) => {
123
+ let b = r.length;
124
+ b > 0 && document.body.appendChild(d), r.forEach(async (v) => {
125
125
  let m = u.get(v.innerText);
126
126
  if (!m) {
127
127
  const f = U(), k = i.value.renderAsync || i.value.render;
128
- let g = "";
128
+ let y = "";
129
129
  try {
130
- g = await k(f, v.innerText, d);
130
+ y = await k(f, v.innerText, d);
131
131
  } catch {
132
132
  }
133
133
  m = await e.sanitizeMermaid(
134
- typeof g == "string" ? g : g.svg
134
+ typeof y == "string" ? y : y.svg
135
135
  ), u.set(v.innerText, m);
136
136
  }
137
137
  const p = document.createElement("p");
@@ -140,7 +140,7 @@ const Be = (e, a) => {
140
140
  }
141
141
  });
142
142
  } };
143
- }, Ue = (e) => {
143
+ }, Ge = (e) => {
144
144
  var n;
145
145
  const a = (n = S.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = B(l);
146
146
  return _(() => {
@@ -149,55 +149,55 @@ const Be = (e, a) => {
149
149
  i.src = (a == null ? void 0 : a.js) || D.js, i.onload = () => {
150
150
  t.value = window.katex;
151
151
  }, i.id = `${h}-katex`;
152
- const r = document.createElement("link");
153
- r.rel = "stylesheet", r.href = (a == null ? void 0 : a.css) || D.css, r.id = `${h}-katexCss`, T(i, "katex"), T(r);
152
+ const o = document.createElement("link");
153
+ o.rel = "stylesheet", o.href = (a == null ? void 0 : a.css) || D.css, o.id = `${h}-katexCss`, T(i, "katex"), T(o);
154
154
  }
155
155
  }), t;
156
- }, Ge = (e, a) => {
156
+ }, De = (e, a) => {
157
157
  const l = e.renderer.rules.fence.bind(e.renderer.rules);
158
- e.renderer.rules.fence = (t, n, i, r, u) => {
158
+ e.renderer.rules.fence = (t, n, i, o, u) => {
159
159
  const c = t[n], s = c.content.trim();
160
160
  if (c.info === "mermaid") {
161
- let o;
162
- return t[n].map && t[n].level === 0 && (o = t[n].map[0], t[n].attrSet("data-line", String(o))), `<div class="${h}-mermaid" ${o !== void 0 ? "data-line=" + o : ""} data-mermaid-theme=${a.themeRef.value}>${s}</div>`;
161
+ let r;
162
+ return t[n].map && t[n].level === 0 && (r = t[n].map[0], t[n].attrSet("data-line", String(r))), `<div class="${h}-mermaid" ${r !== void 0 ? "data-line=" + r : ""} data-mermaid-theme=${a.themeRef.value}>${s}</div>`;
163
163
  }
164
- return l(t, n, i, r, u);
164
+ return l(t, n, i, o, u);
165
165
  };
166
- }, De = Ge, ee = (e, a) => {
166
+ }, Ve = De, ee = (e, a) => {
167
167
  let l = !0, t = !0;
168
- const n = e.posMax, i = a > 0 ? e.src.charCodeAt(a - 1) : -1, r = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
169
- return (i === 32 || i === 9 || r >= 48 && r <= 57) && (t = !1), (r === 32 || r === 9) && (l = !1), {
168
+ const n = e.posMax, i = a > 0 ? e.src.charCodeAt(a - 1) : -1, o = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
169
+ return (i === 32 || i === 9 || o >= 48 && o <= 57) && (t = !1), (o === 32 || o === 9) && (l = !1), {
170
170
  can_open: l,
171
171
  can_close: t
172
172
  };
173
- }, Ve = (e, a) => {
173
+ }, ze = (e, a) => {
174
174
  let l, t, n, i;
175
175
  if (e.src[e.pos] !== "$")
176
176
  return !1;
177
177
  if (n = ee(e, e.pos), !n.can_open)
178
178
  return a || (e.pending += "$"), e.pos += 1, !0;
179
- const r = e.pos + 1;
180
- for (l = r; (l = e.src.indexOf("$", l)) !== -1; ) {
179
+ const o = e.pos + 1;
180
+ for (l = o; (l = e.src.indexOf("$", l)) !== -1; ) {
181
181
  for (i = l - 1; e.src[i] === "\\"; )
182
182
  i -= 1;
183
183
  if ((l - i) % 2 == 1)
184
184
  break;
185
185
  l += 1;
186
186
  }
187
- return l === -1 ? (a || (e.pending += "$"), e.pos = r, !0) : l - r === 0 ? (a || (e.pending += "$$"), e.pos = r + 1, !0) : (n = ee(e, l), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(r, l)), e.pos = l + 1, !0) : (a || (e.pending += "$"), e.pos = r, !0));
188
- }, ze = (e, a, l, t) => {
189
- let n, i, r, u, c = !1, s = e.bMarks[a] + e.tShift[a], o = e.eMarks[a];
190
- if (s + 2 > o || e.src.slice(s, s + 2) !== "$$")
187
+ return l === -1 ? (a || (e.pending += "$"), e.pos = o, !0) : l - o === 0 ? (a || (e.pending += "$$"), e.pos = o + 1, !0) : (n = ee(e, l), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(o, l)), e.pos = l + 1, !0) : (a || (e.pending += "$"), e.pos = o, !0));
188
+ }, We = (e, a, l, t) => {
189
+ let n, i, o, u, c = !1, s = e.bMarks[a] + e.tShift[a], r = e.eMarks[a];
190
+ if (s + 2 > r || e.src.slice(s, s + 2) !== "$$")
191
191
  return !1;
192
- if (s += 2, n = e.src.slice(s, o), t)
192
+ if (s += 2, n = e.src.slice(s, r), t)
193
193
  return !0;
194
- for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), c = !0), r = a; !c && (r++, !(r >= l || (s = e.bMarks[r] + e.tShift[r], o = e.eMarks[r], s < o && e.tShift[r] < e.blkIndent))); )
195
- e.src.slice(s, o).trim().slice(-2) === "$$" && (u = e.src.slice(0, o).lastIndexOf("$$"), i = e.src.slice(s, u), c = !0);
196
- e.line = r + 1;
194
+ for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), c = !0), o = a; !c && (o++, !(o >= l || (s = e.bMarks[o] + e.tShift[o], r = e.eMarks[o], s < r && e.tShift[o] < e.blkIndent))); )
195
+ e.src.slice(s, r).trim().slice(-2) === "$$" && (u = e.src.slice(0, r).lastIndexOf("$$"), i = e.src.slice(s, u), c = !0);
196
+ e.line = o + 1;
197
197
  const d = e.push("math_block", "math", 0);
198
198
  return d.block = !0, d.content = (n && n.trim() ? n + `
199
- ` : "") + e.getLines(a + 1, r, e.tShift[a], !0) + (i && i.trim() ? i : ""), d.map = [a, e.line], d.markup = "$$", !0;
200
- }, We = (e, a) => {
199
+ ` : "") + e.getLines(a + 1, o, e.tShift[a], !0) + (i && i.trim() ? i : ""), d.map = [a, e.line], d.markup = "$$", !0;
200
+ }, qe = (e, a) => {
201
201
  const l = (n) => {
202
202
  if (a.katexRef.value) {
203
203
  const i = a.katexRef.value.renderToString(n, {
@@ -208,99 +208,99 @@ const Be = (e, a) => {
208
208
  return `<span class="${h}-katex-inline">${n}</span>`;
209
209
  }, t = (n, i) => {
210
210
  if (a.katexRef.value) {
211
- const r = a.katexRef.value.renderToString(n, {
211
+ const o = a.katexRef.value.renderToString(n, {
212
212
  throwOnError: !1,
213
213
  displayMode: !0
214
214
  });
215
- return `<p class="${h}-katex-block" data-line=${i} data-processed>${r}</p>`;
215
+ return `<p class="${h}-katex-block" data-line=${i} data-processed>${o}</p>`;
216
216
  } else
217
217
  return `<p class="${h}-katex-block" data-line=${i}>${n}</p>`;
218
218
  };
219
- e.inline.ruler.after("escape", "math_inline", Ve), e.block.ruler.after("blockquote", "math_block", ze, {
219
+ e.inline.ruler.after("escape", "math_inline", ze), e.block.ruler.after("blockquote", "math_block", We, {
220
220
  alt: ["paragraph", "reference", "blockquote", "list"]
221
221
  }), e.renderer.rules.math_inline = (n, i) => l(n[i].content), e.renderer.rules.math_block = (n, i) => t(n[i].content, n[i].map[0]) + `
222
222
  `;
223
- }, qe = We, Ke = (e, a) => {
223
+ }, Ke = qe, Ze = (e, a) => {
224
224
  a = a || {};
225
225
  const l = 3, t = a.marker || "!", n = t.charCodeAt(0), i = t.length;
226
- let r = "", u = "";
227
- const c = (o, d, b, v, m) => {
228
- const p = o[d];
229
- return p.type === "admonition_open" ? (o[d].attrPush([
226
+ let o = "", u = "";
227
+ const c = (r, d, b, v, m) => {
228
+ const p = r[d];
229
+ return p.type === "admonition_open" ? (r[d].attrPush([
230
230
  "class",
231
231
  `${h}-admonition ${h}-admonition-${p.info}`
232
- ]), o[d].attrSet("data-line", String(o[d].map[0]))) : p.type === "admonition_title_open" && o[d].attrPush(["class", `${h}-admonition-title`]), m.renderToken(o, d, b);
233
- }, s = (o) => {
234
- const d = o.trim().split(" ", 2);
235
- u = "", r = d[0], d.length > 1 && (u = o.substring(r.length + 2)), (u === "" || !u) && (u = r);
232
+ ]), r[d].attrSet("data-line", String(r[d].map[0]))) : p.type === "admonition_title_open" && r[d].attrPush(["class", `${h}-admonition-title`]), m.renderToken(r, d, b);
233
+ }, s = (r) => {
234
+ const d = r.trim().split(" ", 2);
235
+ u = "", o = d[0], d.length > 1 && (u = r.substring(o.length + 2)), (u === "" || !u) && (u = o);
236
236
  };
237
237
  e.block.ruler.before(
238
238
  "code",
239
239
  "admonition",
240
- (o, d, b, v) => {
241
- let m, p, f, k = !1, g = o.bMarks[d] + o.tShift[d], w = o.eMarks[d];
242
- if (n !== o.src.charCodeAt(g))
240
+ (r, d, b, v) => {
241
+ let m, p, f, k = !1, y = r.bMarks[d] + r.tShift[d], w = r.eMarks[d];
242
+ if (n !== r.src.charCodeAt(y))
243
243
  return !1;
244
- for (m = g + 1; m <= w && t[(m - g) % i] === o.src[m]; m++)
244
+ for (m = y + 1; m <= w && t[(m - y) % i] === r.src[m]; m++)
245
245
  ;
246
- const E = Math.floor((m - g) / i);
246
+ const E = Math.floor((m - y) / i);
247
247
  if (E !== l)
248
248
  return !1;
249
- m -= (m - g) % i;
250
- const $ = o.src.slice(g, m), C = o.src.slice(m, w);
249
+ m -= (m - y) % i;
250
+ const $ = r.src.slice(y, m), C = r.src.slice(m, w);
251
251
  if (s(C), v)
252
252
  return !0;
253
- for (p = d; p++, !(p >= b || (g = o.bMarks[p] + o.tShift[p], w = o.eMarks[p], g < w && o.sCount[p] < o.blkIndent)); )
254
- if (n === o.src.charCodeAt(g) && !(o.sCount[p] - o.blkIndent >= 4)) {
255
- for (m = g + 1; m <= w && t[(m - g) % i] === o.src[m]; m++)
253
+ for (p = d; p++, !(p >= b || (y = r.bMarks[p] + r.tShift[p], w = r.eMarks[p], y < w && r.sCount[p] < r.blkIndent)); )
254
+ if (n === r.src.charCodeAt(y) && !(r.sCount[p] - r.blkIndent >= 4)) {
255
+ for (m = y + 1; m <= w && t[(m - y) % i] === r.src[m]; m++)
256
256
  ;
257
- if (!(Math.floor((m - g) / i) < E) && (m -= (m - g) % i, m = o.skipSpaces(m), !(m < w))) {
257
+ if (!(Math.floor((m - y) / i) < E) && (m -= (m - y) % i, m = r.skipSpaces(m), !(m < w))) {
258
258
  k = !0;
259
259
  break;
260
260
  }
261
261
  }
262
- const L = o.parentType, H = o.lineMax;
263
- return o.parentType = "root", o.lineMax = p, f = o.push("admonition_open", "div", 1), f.markup = $, f.block = !0, f.info = r, f.map = [d, p], f = o.push("admonition_title_open", "p", 1), f.markup = $ + " " + r, f.map = [d, p], f = o.push("inline", "", 0), f.content = u, f.map = [d, o.line - 1], f.children = [], f = o.push("admonition_title_close", "p", -1), f.markup = $ + " " + r, o.md.block.tokenize(o, d + 1, p), f = o.push("admonition_close", "div", -1), f.markup = o.src.slice(g, m), f.block = !0, o.parentType = L, o.lineMax = H, o.line = p + (k ? 1 : 0), !0;
262
+ const L = r.parentType, H = r.lineMax;
263
+ return r.parentType = "root", r.lineMax = p, f = r.push("admonition_open", "div", 1), f.markup = $, f.block = !0, f.info = o, f.map = [d, p], f = r.push("admonition_title_open", "p", 1), f.markup = $ + " " + o, f.map = [d, p], f = r.push("inline", "", 0), f.content = u, f.map = [d, r.line - 1], f.children = [], f = r.push("admonition_title_close", "p", -1), f.markup = $ + " " + o, r.md.block.tokenize(r, d + 1, p), f = r.push("admonition_close", "div", -1), f.markup = r.src.slice(y, m), f.block = !0, r.parentType = L, r.lineMax = H, r.line = p + (k ? 1 : 0), !0;
264
264
  },
265
265
  {
266
266
  alt: ["paragraph", "reference", "blockquote", "list"]
267
267
  }
268
268
  ), e.renderer.rules.admonition_open = c, e.renderer.rules.admonition_title_open = c, e.renderer.rules.admonition_title_close = c, e.renderer.rules.admonition_close = c;
269
- }, Ze = Ke, Je = (e, a) => {
269
+ }, Je = Ze, Xe = (e, a) => {
270
270
  e.renderer.rules.heading_open = (l, t) => {
271
271
  var u;
272
- const n = l[t], i = ((u = l[t + 1].children) == null ? void 0 : u.reduce((c, s) => c + (s.content || ""), "")) || "", r = n.markup.length;
272
+ const n = l[t], i = ((u = l[t + 1].children) == null ? void 0 : u.reduce((c, s) => c + (s.content || ""), "")) || "", o = n.markup.length;
273
273
  return a.headsRef.value.push({
274
274
  text: i,
275
- level: r
275
+ level: o
276
276
  }), n.map && n.level === 0 && (n.attrSet("data-line", String(n.map[0])), n.attrSet(
277
277
  "id",
278
- a.mdHeadingId(i, r, a.headsRef.value.length)
278
+ a.mdHeadingId(i, o, a.headsRef.value.length)
279
279
  )), e.renderer.renderToken(l, t, a);
280
- }, e.renderer.rules.heading_close = (l, t, n, i, r) => r.renderToken(l, t, n);
281
- }, Xe = Je, Qe = (e, a) => {
280
+ }, e.renderer.rules.heading_close = (l, t, n, i, o) => o.renderToken(l, t, n);
281
+ }, Qe = Xe, Ye = (e, a) => {
282
282
  const l = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
283
283
  function i(s) {
284
284
  return s.info ? t(s.info).trim() : "";
285
285
  }
286
- function r(s) {
287
- const o = i(s), [d = null, b = ""] = (n.exec(o) || []).slice(1);
286
+ function o(s) {
287
+ const r = i(s), [d = null, b = ""] = (n.exec(r) || []).slice(1);
288
288
  return [d, b];
289
289
  }
290
290
  function u(s) {
291
- const o = i(s);
292
- return o ? o.split(/(\s+)/g)[0] : "";
291
+ const r = i(s);
292
+ return r ? r.split(/(\s+)/g)[0] : "";
293
293
  }
294
- const c = (s, o, d, b, v) => {
295
- if (s[o].hidden)
294
+ const c = (s, r, d, b, v) => {
295
+ if (s[r].hidden)
296
296
  return "";
297
- const [m, p] = r(s[o]);
297
+ const [m, p] = o(s[r]);
298
298
  if (m === null)
299
- return l(s, o, d, b, v);
300
- let f, k, g, w, E = "", $ = "";
301
- for (let C = o; C < s.length && (f = s[C], [k, g] = r(f), k === m); C++)
302
- f.info = f.info.replace(n, ""), f.hidden = !0, w = C - o > 0 ? "" : " checked", E += `<li><input type="radio" name="label-group-${a.editorId}-${o}"${w}><label for="group-${a.editorId}-${o}-tab-${C - o}" onclick="this.previousElementSibling.click()">${g || u(f)}</label></li>
303
- `, $ += `<input type="radio" id="group-${a.editorId}-${o}-tab-${C - o}" name="group-${a.editorId}-${o}"${w}>
299
+ return l(s, r, d, b, v);
300
+ let f, k, y, w, E = "", $ = "";
301
+ for (let C = r; C < s.length && (f = s[C], [k, y] = o(f), k === m); C++)
302
+ f.info = f.info.replace(n, ""), f.hidden = !0, w = C - r > 0 ? "" : " checked", E += `<li><input type="radio" name="label-group-${a.editorId}-${r}"${w}><label for="group-${a.editorId}-${r}-tab-${C - r}" onclick="this.previousElementSibling.click()">${y || u(f)}</label></li>
303
+ `, $ += `<input type="radio" id="group-${a.editorId}-${r}-tab-${C - r}" name="group-${a.editorId}-${r}"${w}>
304
304
  ` + l(s, C, d, b, v);
305
305
  return `<div class="code-tabs">
306
306
  <ul>
@@ -308,7 +308,7 @@ const Be = (e, a) => {
308
308
  ` + $ + "</div>";
309
309
  };
310
310
  e.renderer.rules.fence = c;
311
- }, Ye = Qe, et = (e) => {
311
+ }, et = Ye, tt = (e) => {
312
312
  [
313
313
  "paragraph_open",
314
314
  "table_open",
@@ -320,17 +320,17 @@ const Be = (e, a) => {
320
320
  "fence"
321
321
  ].forEach((a) => {
322
322
  const l = e.renderer.rules[a];
323
- l ? e.renderer.rules[a] = (t, n, i, r, u) => {
323
+ l ? e.renderer.rules[a] = (t, n, i, o, u) => {
324
324
  let c;
325
- const s = l(t, n, i, r, u);
325
+ const s = l(t, n, i, o, u);
326
326
  return t[n].map && t[n].level === 0 && !/^<!--/.test(s) ? (c = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${c}"`)) : s;
327
- } : e.renderer.rules[a] = (t, n, i, r, u) => {
327
+ } : e.renderer.rules[a] = (t, n, i, o, u) => {
328
328
  let c;
329
329
  return t[n].map && t[n].level === 0 && (c = t[n].map[0], t[n].attrSet("data-line", String(c))), u.renderToken(t, n, i);
330
330
  };
331
331
  });
332
- }, tt = (e, a) => {
333
- const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } = S, i = P("editorId"), r = P("showCodeRowNumber"), u = P("theme"), c = R([]), s = Oe(e), o = Ue(e), { reRenderRef: d, replaceMermaid: b } = je(e), v = Fe({
332
+ }, nt = (e, a) => {
333
+ const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } = S, i = P("editorId"), o = P("showCodeRowNumber"), u = P("theme"), c = R([]), s = je(e), r = Ge(e), { reRenderRef: d, replaceMermaid: b } = Ue(e), v = He({
334
334
  html: !0,
335
335
  breaks: !0
336
336
  });
@@ -340,37 +340,37 @@ const Be = (e, a) => {
340
340
  const m = [
341
341
  {
342
342
  type: "katex",
343
- plugin: qe,
344
- options: { katexRef: o }
343
+ plugin: Ke,
344
+ options: { katexRef: r }
345
345
  },
346
346
  {
347
347
  type: "image",
348
- plugin: He,
348
+ plugin: Me,
349
349
  options: { figcaption: !0, classes: "md-zoom" }
350
350
  },
351
351
  {
352
352
  type: "admonition",
353
- plugin: Ze,
353
+ plugin: Je,
354
354
  options: {}
355
355
  },
356
356
  {
357
357
  type: "taskList",
358
- plugin: Me,
358
+ plugin: Re,
359
359
  options: {}
360
360
  },
361
361
  {
362
362
  type: "heading",
363
- plugin: Xe,
363
+ plugin: Qe,
364
364
  options: { mdHeadingId: e.mdHeadingId, headsRef: c }
365
365
  },
366
366
  {
367
367
  type: "codeTabs",
368
- plugin: Ye,
368
+ plugin: et,
369
369
  options: { editorId: i }
370
370
  },
371
371
  {
372
372
  type: "xss",
373
- plugin: Re,
373
+ plugin: Ae,
374
374
  options: {
375
375
  // https://github.com/leizongmin/js-xss/blob/master/README.zh.md
376
376
  xss($) {
@@ -399,7 +399,7 @@ const Be = (e, a) => {
399
399
  ];
400
400
  e.noMermaid || m.push({
401
401
  type: "mermaid",
402
- plugin: De,
402
+ plugin: Ve,
403
403
  options: { themeRef: u }
404
404
  }), n(m, {
405
405
  editorId: i
@@ -419,17 +419,17 @@ const Be = (e, a) => {
419
419
  language: C,
420
420
  ignoreIllegals: !0
421
421
  }).value : H = s.value.highlightAuto($).value : H = v.utils.escapeHtml($);
422
- const fe = r ? $e(H.replace(/^\n+|\n+$/g, "")) : `<span class="code-block">${H.replace(/^\n+|\n+$/g, "")}</span>`;
422
+ const fe = o ? $e(H.replace(/^\n+|\n+$/g, "")) : `<span class="code-block">${H.replace(/^\n+|\n+$/g, "")}</span>`;
423
423
  return `<pre><code class="language-${C}" language=${C}>${fe}</code></pre>`;
424
424
  }
425
- }), et(v);
426
- const f = R(`_article-key_${U()}`), k = R(e.sanitize(v.render(e.modelValue))), g = () => {
427
- y.emit(i, A, k.value), e.onHtmlChanged(k.value), e.onGetCatalog(c.value), y.emit(i, K, c.value), b();
425
+ }), tt(v);
426
+ const f = R(`_article-key_${U()}`), k = R(e.sanitize(v.render(e.modelValue))), y = () => {
427
+ g.emit(i, A, k.value), e.onHtmlChanged(k.value), e.onGetCatalog(c.value), g.emit(i, K, c.value), b();
428
428
  };
429
- _(g);
429
+ _(y);
430
430
  const w = () => {
431
- c.value = [], k.value = e.sanitize(v.render(e.modelValue)), g();
432
- }, E = F(() => (e.noKatex || o.value) && (e.noHighlight || s.value));
431
+ c.value = [], k.value = e.sanitize(v.render(e.modelValue)), y();
432
+ }, E = F(() => (e.noKatex || r.value) && (e.noHighlight || s.value));
433
433
  return I(
434
434
  [te(e, "modelValue"), E, d],
435
435
  ie(
@@ -437,19 +437,19 @@ const Be = (e, a) => {
437
437
  (l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
438
438
  )
439
439
  ), _(() => {
440
- y.on(i, {
440
+ g.on(i, {
441
441
  name: Ce,
442
442
  callback() {
443
- y.emit(i, K, c.value);
443
+ g.emit(i, K, c.value);
444
444
  }
445
- }), y.on(i, {
445
+ }), g.on(i, {
446
446
  name: G,
447
447
  callback: () => {
448
448
  w(), f.value = `_article-key_${U()}`;
449
449
  }
450
450
  });
451
451
  }), { html: k, key: f };
452
- }, nt = tt, ce = {
452
+ }, ot = nt, ce = {
453
453
  modelValue: {
454
454
  type: String,
455
455
  default: ""
@@ -503,8 +503,13 @@ const Be = (e, a) => {
503
503
  sanitizeMermaid: {
504
504
  type: Function
505
505
  }
506
- }, vt = {
506
+ }, bt = {
507
507
  ...ce,
508
+ updateModelValue: {
509
+ type: Function,
510
+ default: () => {
511
+ }
512
+ },
508
513
  onChange: {
509
514
  type: Function,
510
515
  default: () => {
@@ -575,15 +580,15 @@ const Be = (e, a) => {
575
580
  onInputBoxWitdhChange: {
576
581
  type: Function
577
582
  }
578
- }, ot = /* @__PURE__ */ ne({
583
+ }, rt = /* @__PURE__ */ ne({
579
584
  name: "ContentPreview",
580
585
  props: ce,
581
586
  setup(e) {
582
587
  const a = P("editorId"), l = P("previewTheme"), t = P("showCodeRowNumber"), {
583
588
  html: n,
584
589
  key: i
585
- } = nt(e, e.previewOnly);
586
- return Ne(e, n, i), Be(e, n), () => M(pe, null, [e.setting.preview && M("div", {
590
+ } = ot(e, e.previewOnly);
591
+ return Oe(e, n, i), Le(e, n), () => M(pe, null, [e.setting.preview && M("div", {
587
592
  id: `${a}-preview-wrapper`,
588
593
  class: `${h}-preview-wrapper`,
589
594
  key: "content-preview-wrapper"
@@ -600,7 +605,7 @@ const Be = (e, a) => {
600
605
  class: `${h}-html`
601
606
  }, [n.value])])]);
602
607
  }
603
- }), bt = (e, a) => {
608
+ }), wt = (e, a) => {
604
609
  const { editorId: l } = e, t = oe({
605
610
  // 是否已编译成html
606
611
  buildFinished: !1,
@@ -613,24 +618,24 @@ const Be = (e, a) => {
613
618
  t.buildFinished = !1;
614
619
  }
615
620
  ), _(() => {
616
- y.on(l, {
621
+ g.on(l, {
617
622
  name: A,
618
623
  callback(n) {
619
624
  t.buildFinished = !0, t.html = n;
620
625
  }
621
- }), y.on(l, {
626
+ }), g.on(l, {
622
627
  name: re,
623
628
  callback() {
624
629
  const n = new Promise((i) => {
625
630
  if (t.buildFinished)
626
631
  i(t.html);
627
632
  else {
628
- const r = (u) => {
629
- i(u), y.remove(l, A, r);
633
+ const o = (u) => {
634
+ i(u), g.remove(l, A, o);
630
635
  };
631
- y.on(l, {
636
+ g.on(l, {
632
637
  name: A,
633
- callback: r
638
+ callback: o
634
639
  });
635
640
  }
636
641
  });
@@ -650,23 +655,23 @@ const Be = (e, a) => {
650
655
  ), x(
651
656
  "highlight",
652
657
  F(() => {
653
- const r = {
658
+ const o = {
654
659
  ...V,
655
660
  ...l == null ? void 0 : l.css
656
661
  }, u = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
657
662
  return {
658
663
  js: (l == null ? void 0 : l.js) || ye,
659
- css: r[e.codeTheme] ? r[e.codeTheme][u] : V.atom[u]
664
+ css: o[e.codeTheme] ? o[e.codeTheme][u] : V.atom[u]
660
665
  };
661
666
  })
662
667
  ), x("showCodeRowNumber", e.showCodeRowNumber);
663
668
  const t = F(() => {
664
669
  var u, c;
665
- const r = {
670
+ const o = {
666
671
  ...z,
667
672
  ...(c = (u = S) == null ? void 0 : u.editorConfig) == null ? void 0 : c.languageUserDefined
668
673
  };
669
- return r[e.language] ? r[e.language] : z["zh-CN"];
674
+ return o[e.language] ? o[e.language] : z["zh-CN"];
670
675
  });
671
676
  x("usedLanguageText", t), x(
672
677
  "previewTheme",
@@ -675,7 +680,7 @@ const Be = (e, a) => {
675
680
  "customIcon",
676
681
  F(() => e.customIcon)
677
682
  );
678
- }, wt = (e) => {
683
+ }, kt = (e) => {
679
684
  se(e), x("tabWidth", e.tabWidth);
680
685
  }, ue = (e) => {
681
686
  _(() => {
@@ -689,29 +694,29 @@ const Be = (e, a) => {
689
694
  t.rel = "stylesheet", t.href = ((l = S.editorExtensions) == null ? void 0 : l.iconfontClass) || be, t.id = `${h}-icon-class`, T(t);
690
695
  }
691
696
  });
692
- }, kt = (e) => {
693
- var u, c, s, o, d, b;
694
- const { noPrettier: a, noUploadImg: l } = e, { editorExtensions: t } = S, n = a || !!((c = (u = S.editorExtensions) == null ? void 0 : u.prettier) != null && c.prettierInstance), i = a || !!((o = (s = S.editorExtensions) == null ? void 0 : s.prettier) != null && o.parserMarkdownInstance), r = l || !!((b = (d = S.editorExtensions) == null ? void 0 : d.cropper) != null && b.instance);
697
+ }, $t = (e) => {
698
+ var u, c, s, r, d, b;
699
+ const { noPrettier: a, noUploadImg: l } = e, { editorExtensions: t } = S, n = a || !!((c = (u = S.editorExtensions) == null ? void 0 : u.prettier) != null && c.prettierInstance), i = a || !!((r = (s = S.editorExtensions) == null ? void 0 : s.prettier) != null && r.parserMarkdownInstance), o = l || !!((b = (d = S.editorExtensions) == null ? void 0 : d.cropper) != null && b.instance);
695
700
  _(() => {
696
- var k, g, w, E;
701
+ var k, y, w, E;
697
702
  const v = document.createElement("script"), m = document.createElement("script");
698
- v.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || W.main, v.id = `${h}-prettier`, m.src = ((g = t == null ? void 0 : t.prettier) == null ? void 0 : g.parserMarkdownJs) || W.markdown, m.id = `${h}-prettierMD`;
703
+ v.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || W.main, v.id = `${h}-prettier`, m.src = ((y = t == null ? void 0 : t.prettier) == null ? void 0 : y.parserMarkdownJs) || W.markdown, m.id = `${h}-prettierMD`;
699
704
  const p = document.createElement("link");
700
705
  p.rel = "stylesheet", p.href = ((w = t == null ? void 0 : t.cropper) == null ? void 0 : w.css) || q.css, p.id = `${h}-cropperCss`;
701
706
  const f = document.createElement("script");
702
- f.src = ((E = t == null ? void 0 : t.cropper) == null ? void 0 : E.js) || q.js, f.id = `${h}-cropper`, r || (T(p), T(f)), n || T(v), i || T(m);
707
+ f.src = ((E = t == null ? void 0 : t.cropper) == null ? void 0 : E.js) || q.js, f.id = `${h}-cropper`, o || (T(p), T(f)), n || T(v), i || T(m);
703
708
  }), ue(e);
704
- }, $t = (e, a) => {
709
+ }, Ct = (e, a) => {
705
710
  const { editorId: l } = e;
706
711
  _(() => {
707
- y.on(l, {
712
+ g.on(l, {
708
713
  name: Ie,
709
714
  callback: (t) => {
710
715
  e.onError instanceof Function ? e.onError(t) : a.emit("onError", t);
711
716
  }
712
717
  });
713
718
  });
714
- }, Ct = (e, a) => {
719
+ }, It = (e, a) => {
715
720
  const { editorId: l } = e, t = oe({
716
721
  pageFullscreen: e.pageFullscreen,
717
722
  fullscreen: !1,
@@ -721,102 +726,102 @@ const Be = (e, a) => {
721
726
  t[u] = c === void 0 ? !t[u] : c, u === "preview" && t.preview ? t.htmlPreview = !1 : u === "htmlPreview" && t.htmlPreview && (t.preview = !1);
722
727
  };
723
728
  let i = "";
724
- const r = () => {
729
+ const o = () => {
725
730
  t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = i;
726
731
  };
727
- return I(() => [t.pageFullscreen, t.fullscreen], r), _(() => {
728
- y.on(l, {
732
+ return I(() => [t.pageFullscreen, t.fullscreen], o), _(() => {
733
+ g.on(l, {
729
734
  name: Se,
730
735
  callback(u, c) {
731
- const s = (o) => {
732
- y.emit(l, le, "image", {
736
+ const s = (r) => {
737
+ g.emit(l, le, "image", {
733
738
  desc: "",
734
- urls: o
739
+ urls: r
735
740
  }), c && c();
736
741
  };
737
742
  e.onUploadImg ? e.onUploadImg(u, s) : a.emit("onUploadImg", u, s);
738
743
  }
739
- }), i = document.body.style.overflow, r();
744
+ }), i = document.body.style.overflow, o();
740
745
  }), [t, n];
741
- }, It = (e) => {
746
+ }, St = (e) => {
742
747
  const { editorId: a } = e, l = R(!1);
743
748
  return _(() => {
744
- y.on(a, {
749
+ g.on(a, {
745
750
  name: ae,
746
751
  callback: (n) => {
747
752
  n === void 0 ? l.value = !l.value : l.value = n;
748
753
  }
749
754
  });
750
755
  }), F(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
751
- }, St = (e, a, l, t, n, i) => {
752
- const { editorId: r } = e;
756
+ }, Et = (e, a, l, t, n, i) => {
757
+ const { editorId: o } = e;
753
758
  I(
754
759
  () => t.pageFullscreen,
755
760
  (c) => {
756
- y.emit(r, Z, c);
761
+ g.emit(o, Z, c);
757
762
  }
758
763
  ), I(
759
764
  () => t.fullscreen,
760
765
  (c) => {
761
- y.emit(r, J, c);
766
+ g.emit(o, J, c);
762
767
  }
763
768
  ), I(
764
769
  () => t.preview,
765
770
  (c) => {
766
- y.emit(r, X, c);
771
+ g.emit(o, X, c);
767
772
  }
768
773
  ), I(
769
774
  () => t.htmlPreview,
770
775
  (c) => {
771
- y.emit(r, Q, c);
776
+ g.emit(o, Q, c);
772
777
  }
773
778
  ), I(l, (c) => {
774
- y.emit(r, Y, c);
779
+ g.emit(o, Y, c);
775
780
  });
776
781
  const u = {
777
782
  on(c, s) {
778
783
  switch (c) {
779
784
  case "pageFullscreen": {
780
- y.on(r, {
785
+ g.on(o, {
781
786
  name: Z,
782
- callback(o) {
783
- s(o);
787
+ callback(r) {
788
+ s(r);
784
789
  }
785
790
  });
786
791
  break;
787
792
  }
788
793
  case "fullscreen": {
789
- y.on(r, {
794
+ g.on(o, {
790
795
  name: J,
791
- callback(o) {
792
- s(o);
796
+ callback(r) {
797
+ s(r);
793
798
  }
794
799
  });
795
800
  break;
796
801
  }
797
802
  case "preview": {
798
- y.on(r, {
803
+ g.on(o, {
799
804
  name: X,
800
- callback(o) {
801
- s(o);
805
+ callback(r) {
806
+ s(r);
802
807
  }
803
808
  });
804
809
  break;
805
810
  }
806
811
  case "htmlPreview": {
807
- y.on(r, {
812
+ g.on(o, {
808
813
  name: Q,
809
- callback(o) {
810
- s(o);
814
+ callback(r) {
815
+ s(r);
811
816
  }
812
817
  });
813
818
  break;
814
819
  }
815
820
  case "catalog": {
816
- y.on(r, {
821
+ g.on(o, {
817
822
  name: Y,
818
- callback(o) {
819
- s(o);
823
+ callback(r) {
824
+ s(r);
820
825
  }
821
826
  });
822
827
  break;
@@ -827,7 +832,7 @@ const Be = (e, a) => {
827
832
  n("pageFullscreen", c);
828
833
  },
829
834
  toggleFullscreen(c) {
830
- y.emit(r, Ee, c);
835
+ g.emit(o, Ee, c);
831
836
  },
832
837
  togglePreview(c) {
833
838
  n("preview", c);
@@ -836,20 +841,20 @@ const Be = (e, a) => {
836
841
  n("htmlPreview", c);
837
842
  },
838
843
  toggleCatalog(c) {
839
- y.emit(r, ae, c);
844
+ g.emit(o, ae, c);
840
845
  },
841
846
  triggerSave() {
842
- y.emit(r, re);
847
+ g.emit(o, re);
843
848
  },
844
849
  insert(c) {
845
- y.emit(r, le, "universal", { generate: c });
850
+ g.emit(o, le, "universal", { generate: c });
846
851
  },
847
852
  focus(c) {
848
853
  var s;
849
854
  (s = i.value) == null || s.focus(c);
850
855
  },
851
856
  rerender() {
852
- y.emit(r, G);
857
+ g.emit(o, G);
853
858
  },
854
859
  getSelectedText() {
855
860
  var c;
@@ -858,10 +863,13 @@ const Be = (e, a) => {
858
863
  resetHistory() {
859
864
  var c;
860
865
  (c = i.value) == null || c.resetHistory();
866
+ },
867
+ domEventHandlers(c) {
868
+ g.emit(o, Pe, c);
861
869
  }
862
870
  };
863
871
  a.expose(u);
864
- }, rt = (e) => e, de = {
872
+ }, at = (e) => e, de = {
865
873
  /**
866
874
  * markdown content.
867
875
  *
@@ -917,7 +925,7 @@ const Be = (e, a) => {
917
925
  */
918
926
  editorId: {
919
927
  type: String,
920
- default: () => Pe("md-editor-v3_")
928
+ default: () => _e("md-editor-v3_")
921
929
  },
922
930
  /**
923
931
  * 预览中代码是否显示行号
@@ -951,7 +959,7 @@ const Be = (e, a) => {
951
959
  */
952
960
  mdHeadingId: {
953
961
  type: Function,
954
- default: rt
962
+ default: at
955
963
  },
956
964
  /**
957
965
  *
@@ -1049,7 +1057,7 @@ const Be = (e, a) => {
1049
1057
  type: Function,
1050
1058
  default: (e) => Promise.resolve(e)
1051
1059
  }
1052
- }, Et = {
1060
+ }, Pt = {
1053
1061
  ...de,
1054
1062
  /**
1055
1063
  * input回调事件
@@ -1301,7 +1309,7 @@ const Be = (e, a) => {
1301
1309
  onInputBoxWitdhChange: {
1302
1310
  type: Function
1303
1311
  }
1304
- }, me = ["onHtmlChanged", "onGetCatalog"], Pt = [
1312
+ }, me = ["onHtmlChanged", "onGetCatalog"], _t = [
1305
1313
  ...me,
1306
1314
  "onChange",
1307
1315
  "onSave",
@@ -1313,10 +1321,10 @@ const Be = (e, a) => {
1313
1321
  "onInput",
1314
1322
  "onDrop",
1315
1323
  "onInputBoxWitdhChange"
1316
- ], at = (e, a) => {
1324
+ ], lt = (e, a) => {
1317
1325
  const { editorId: l } = e, t = {
1318
1326
  rerender() {
1319
- y.emit(l, G);
1327
+ g.emit(l, G);
1320
1328
  }
1321
1329
  };
1322
1330
  a.expose(t);
@@ -1331,19 +1339,19 @@ const Be = (e, a) => {
1331
1339
  noMermaid: n,
1332
1340
  noHighlight: i
1333
1341
  } = e;
1334
- return se(e), ue(e), at(e, a), he(() => {
1335
- y.clear(l);
1342
+ return se(e), ue(e), lt(e, a), he(() => {
1343
+ g.clear(l);
1336
1344
  }), () => M("div", {
1337
1345
  id: l,
1338
1346
  class: [h, e.class, e.theme === "dark" && `${h}-dark`, `${h}-previewOnly`],
1339
1347
  style: e.style
1340
- }, [M(ot, {
1348
+ }, [M(rt, {
1341
1349
  modelValue: e.modelValue,
1342
- onHtmlChanged: (r) => {
1343
- e.onHtmlChanged ? e.onHtmlChanged(r) : a.emit("onHtmlChanged", r);
1350
+ onHtmlChanged: (o) => {
1351
+ e.onHtmlChanged ? e.onHtmlChanged(o) : a.emit("onHtmlChanged", o);
1344
1352
  },
1345
- onGetCatalog: (r) => {
1346
- e.onGetCatalog ? e.onGetCatalog(r) : a.emit("onGetCatalog", r);
1353
+ onGetCatalog: (o) => {
1354
+ e.onGetCatalog ? e.onGetCatalog(o) : a.emit("onGetCatalog", o);
1347
1355
  },
1348
1356
  mdHeadingId: e.mdHeadingId,
1349
1357
  noMermaid: n,
@@ -1359,16 +1367,16 @@ const Be = (e, a) => {
1359
1367
  });
1360
1368
  O.install = (e) => (e.component(O.name, O), e);
1361
1369
  export {
1362
- ot as C,
1370
+ rt as C,
1363
1371
  O as M,
1364
- Pt as a,
1365
- wt as b,
1366
- vt as c,
1367
- kt as d,
1368
- Et as e,
1369
- $t as f,
1370
- Ct as g,
1371
- It as h,
1372
- St as i,
1373
- bt as u
1372
+ _t as a,
1373
+ kt as b,
1374
+ bt as c,
1375
+ $t as d,
1376
+ Pt as e,
1377
+ Ct as f,
1378
+ It as g,
1379
+ St as h,
1380
+ Et as i,
1381
+ wt as u
1374
1382
  };