md-editor-v3 4.11.0-beta.0 → 4.11.0-beta.2

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,69 +1,69 @@
1
- import { inject as P, onMounted as E, watch as C, toRef as ee, nextTick as U, shallowRef as B, ref as R, computed as F, defineComponent as te, createVNode as x, Fragment as pe, reactive as ne, provide as H, onBeforeUnmount as he } from "vue";
2
- import { e as S, p as h, m as ge, k as G, f as D, h as ye, s as V, a as ve, i as be, g as z, j as W, l as we, b as ke, d as $e } from "./config.mjs";
3
- import { a as Ce, b as y, P as Ie, C as K, R as oe, B as A, O as re, E as Se, U as Ee, c as ae, d as q, F as Z, e as J, H as Q, f as X, h as le, i as Pe } from "./index4.mjs";
4
- import { a as _, u as _e } from "./dom.mjs";
1
+ import { inject as _, onMounted as P, watch as C, toRef as te, nextTick as U, shallowRef as B, ref as R, computed as F, defineComponent as ne, createVNode as M, Fragment as pe, reactive as oe, provide as H, onBeforeUnmount as he } from "vue";
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 K, l as we, b as ke, d as $e } from "./config.mjs";
3
+ import { a as Ce, b as y, P as Ie, C as q, R as G, B as A, O as re, E as Se, U as Ee, c as ae, d as Z, F as J, e as Q, H as X, f as Y, h as le, i as Pe } from "./index4.mjs";
4
+ import { a as T, u as _e } from "./dom.mjs";
5
5
  import Te from "medium-zoom";
6
6
  import { debounce as ie, uuid as j } from "@vavt/util";
7
7
  import He from "copy-to-clipboard";
8
8
  import Fe from "markdown-it";
9
- import Me from "markdown-it-image-figures";
10
- import xe from "markdown-it-task-lists";
9
+ import xe from "markdown-it-image-figures";
10
+ import Me from "markdown-it-task-lists";
11
11
  import Re from "lru-cache";
12
12
  const Ae = (e, a) => {
13
- const i = P("editorId"), { noImgZoomIn: t } = e, n = ie(() => {
14
- const l = document.querySelectorAll(`#${i}-preview img`);
15
- l.length !== 0 && Te(l, {
13
+ const l = _("editorId"), { noImgZoomIn: t } = e, n = ie(() => {
14
+ const i = document.querySelectorAll(`#${l}-preview img`);
15
+ i.length !== 0 && Te(i, {
16
16
  background: "#00000073"
17
17
  });
18
18
  });
19
- E(() => {
19
+ P(() => {
20
20
  !t && n();
21
- }), C([a, ee(e.setting, "preview")], () => {
21
+ }), C([a, te(e.setting, "preview")], () => {
22
22
  !t && n();
23
23
  });
24
24
  }, Be = Ae, Le = (e, a) => {
25
25
  if (typeof a[e] == "string")
26
26
  return a[e];
27
- const i = `<i class="${h}-iconfont ${h}-icon-${e}"></i>`;
27
+ const l = `<i class="${h}-iconfont ${h}-icon-${e}"></i>`;
28
28
  switch (S.iconfontType) {
29
29
  case "svg":
30
30
  return `<svg class="${h}-icon" aria-hidden="true"><use xlink:href="#${h}-icon-${e}"></use></svg>`;
31
31
  default:
32
- return i;
32
+ return l;
33
33
  }
34
- }, Ne = (e, a) => {
35
- const i = P("editorId"), t = P("usedLanguageText"), n = P("customIcon"), l = () => {
36
- document.querySelectorAll(`#${i}-preview pre`).forEach((c) => {
37
- var w, v;
38
- let s = -1;
39
- (w = c.querySelector(".copy-button")) == null || w.remove();
40
- const o = ((v = t.value.copyCode) == null ? void 0 : v.text) || "复制代码", u = document.createElement("span");
41
- u.setAttribute("class", "copy-button"), u.dataset.tips = o, u.innerHTML = Le("copy", n.value), u.addEventListener("click", () => {
42
- var g, b;
43
- clearTimeout(s);
44
- const m = c.querySelector("code").innerText, p = He(e.formatCopiedText(m)), f = ((g = t.value.copyCode) == null ? void 0 : g.successTips) || "已复制!", k = ((b = t.value.copyCode) == null ? void 0 : b.failTips) || "已复制!";
45
- u.dataset.tips = p ? f : k, s = window.setTimeout(() => {
46
- u.dataset.tips = o;
34
+ }, Ne = (e, a, l) => {
35
+ const t = _("editorId"), n = _("usedLanguageText"), i = _("customIcon"), r = () => {
36
+ document.querySelectorAll(`#${t}-preview pre`).forEach((s) => {
37
+ var v, m;
38
+ let o = -1;
39
+ (v = s.querySelector(".copy-button")) == null || v.remove();
40
+ const d = ((m = n.value.copyCode) == null ? void 0 : m.text) || "复制代码", b = document.createElement("span");
41
+ b.setAttribute("class", "copy-button"), b.dataset.tips = d, b.innerHTML = Le("copy", i.value), b.addEventListener("click", () => {
42
+ var w, E;
43
+ clearTimeout(o);
44
+ const p = s.querySelector("code").innerText, f = He(e.formatCopiedText(p)), k = ((w = n.value.copyCode) == null ? void 0 : w.successTips) || "已复制!", g = ((E = n.value.copyCode) == null ? void 0 : E.failTips) || "已复制!";
45
+ b.dataset.tips = f ? k : g, o = window.setTimeout(() => {
46
+ b.dataset.tips = d;
47
47
  }, 1500);
48
- }), c.appendChild(u);
48
+ }), s.appendChild(b);
49
49
  });
50
- }, r = () => {
51
- U(l);
52
- }, d = (c) => {
53
- c && U(l);
50
+ }, u = () => {
51
+ U(r);
52
+ }, c = (s) => {
53
+ s && U(r);
54
54
  };
55
- C(() => a.value, r), C(() => e.setting.preview, d), C(() => e.setting.htmlPreview, d), C(() => t.value, l), E(l);
55
+ C([a, l], u), C(() => e.setting.preview, c), C(() => e.setting.htmlPreview, c), C(() => n.value, r), P(r);
56
56
  }, Oe = Ne, Ue = (e) => {
57
- var l;
58
- const a = (l = S.editorExtensions) == null ? void 0 : l.highlight, i = a == null ? void 0 : a.instance, t = P("highlight"), n = B(i);
59
- return E(() => {
57
+ var i;
58
+ const a = (i = S.editorExtensions) == null ? void 0 : i.highlight, l = a == null ? void 0 : a.instance, t = _("highlight"), n = B(l);
59
+ return P(() => {
60
60
  if (!e.noHighlight && !n.value) {
61
61
  const r = document.createElement("script");
62
62
  r.src = t.value.js, r.onload = () => {
63
63
  n.value = window.hljs;
64
- }, r.id = `${h}-hljs`, _(r, "hljs");
65
- const d = document.createElement("link");
66
- d.rel = "stylesheet", d.href = t.value.css, d.id = `${h}-hlCss`, _(d);
64
+ }, r.id = `${h}-hljs`, T(r, "hljs");
65
+ const u = document.createElement("link");
66
+ u.rel = "stylesheet", u.href = t.value.css, u.id = `${h}-hlCss`, T(u);
67
67
  }
68
68
  }), C(
69
69
  () => t.value.css,
@@ -72,12 +72,12 @@ const Ae = (e, a) => {
72
72
  }
73
73
  ), n;
74
74
  }, je = Ue, Ge = (e) => {
75
- const a = P("theme"), { editorExtensions: i, mermaidConfig: t } = S, n = i == null ? void 0 : i.mermaid, l = B(n == null ? void 0 : n.instance), r = B(-1), d = new Re({
75
+ const a = _("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 Re({
76
76
  max: 1e3,
77
77
  // 缓存10分钟
78
78
  ttl: 6e5
79
79
  }), c = () => {
80
- const o = l.value;
80
+ const o = i.value;
81
81
  !e.noMermaid && o && (o.initialize(
82
82
  t({
83
83
  startOnLoad: !1,
@@ -88,9 +88,9 @@ const Ae = (e, a) => {
88
88
  return C(
89
89
  () => a.value,
90
90
  () => {
91
- d.clear(), c();
91
+ u.clear(), c();
92
92
  }
93
- ), E(() => {
93
+ ), P(() => {
94
94
  if (!e.noMermaid && !(n != null && n.instance)) {
95
95
  const o = (n == null ? void 0 : n.js) || ge;
96
96
  if (/\.mjs/.test(o))
@@ -98,208 +98,208 @@ const Ae = (e, a) => {
98
98
  /* @vite-ignore */
99
99
  /* webpackIgnore: true */
100
100
  o
101
- ).then((u) => {
102
- l.value = u.default, c();
101
+ ).then((d) => {
102
+ i.value = d.default, c();
103
103
  });
104
104
  else {
105
- const u = document.createElement("script");
106
- u.id = `${h}-mermaid`, u.src = o, u.onload = () => {
107
- l.value = window.mermaid, c();
108
- }, _(u, "mermaid");
105
+ const d = document.createElement("script");
106
+ d.id = `${h}-mermaid`, d.src = o, d.onload = () => {
107
+ i.value = window.mermaid, c();
108
+ }, T(d, "mermaid");
109
109
  }
110
110
  }
111
- }), { mermaidRef: l, reRenderRef: r, replaceMermaid: () => {
111
+ }), { mermaidRef: i, reRenderRef: r, replaceMermaid: () => {
112
112
  U(() => {
113
- if (!e.noMermaid && l.value) {
113
+ if (!e.noMermaid && i.value) {
114
114
  const o = document.querySelectorAll(
115
115
  `div.${h}-mermaid`
116
- ), u = document.createElement("div");
117
- u.style.width = document.body.offsetWidth + "px", u.style.height = document.body.offsetHeight + "px", u.style.position = "fixed", u.style.zIndex = "-10000", u.style.top = "-10000";
118
- let w = o.length;
119
- w > 0 && document.body.appendChild(u), o.forEach(async (v) => {
120
- let m = d.get(v.innerText);
116
+ ), d = document.createElement("div");
117
+ 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";
118
+ let b = o.length;
119
+ b > 0 && document.body.appendChild(d), o.forEach(async (v) => {
120
+ let m = u.get(v.innerText);
121
121
  if (!m) {
122
- const f = j(), k = l.value.renderAsync || l.value.render;
122
+ const f = j(), k = i.value.renderAsync || i.value.render;
123
123
  let g = "";
124
124
  try {
125
- g = await k(f, v.innerText, u);
125
+ g = await k(f, v.innerText, d);
126
126
  } catch {
127
127
  }
128
128
  m = await e.sanitizeMermaid(
129
129
  typeof g == "string" ? g : g.svg
130
- ), d.set(v.innerText, m);
130
+ ), u.set(v.innerText, m);
131
131
  }
132
132
  const p = document.createElement("p");
133
- p.className = `${h}-mermaid`, p.setAttribute("data-processed", ""), p.innerHTML = m, v.dataset.line !== void 0 && (p.dataset.line = v.dataset.line), v.replaceWith(p), --w === 0 && u.remove();
133
+ p.className = `${h}-mermaid`, p.setAttribute("data-processed", ""), p.innerHTML = m, v.dataset.line !== void 0 && (p.dataset.line = v.dataset.line), v.replaceWith(p), --b === 0 && d.remove();
134
134
  });
135
135
  }
136
136
  });
137
137
  } };
138
138
  }, De = Ge, Ve = (e) => {
139
139
  var n;
140
- const a = (n = S.editorExtensions) == null ? void 0 : n.katex, i = a == null ? void 0 : a.instance, t = B(i);
141
- return E(() => {
140
+ const a = (n = S.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = B(l);
141
+ return P(() => {
142
142
  if (!e.noKatex && !t.value) {
143
- const l = document.createElement("script");
144
- l.src = (a == null ? void 0 : a.js) || G.js, l.onload = () => {
143
+ const i = document.createElement("script");
144
+ i.src = (a == null ? void 0 : a.js) || D.js, i.onload = () => {
145
145
  t.value = window.katex;
146
- }, l.id = `${h}-katex`;
146
+ }, i.id = `${h}-katex`;
147
147
  const r = document.createElement("link");
148
- r.rel = "stylesheet", r.href = (a == null ? void 0 : a.css) || G.css, r.id = `${h}-katexCss`, _(l, "katex"), _(r);
148
+ r.rel = "stylesheet", r.href = (a == null ? void 0 : a.css) || D.css, r.id = `${h}-katexCss`, T(i, "katex"), T(r);
149
149
  }
150
150
  }), t;
151
151
  }, ze = Ve, We = (e, a) => {
152
- const i = e.renderer.rules.fence.bind(e.renderer.rules);
153
- e.renderer.rules.fence = (t, n, l, r, d) => {
152
+ const l = e.renderer.rules.fence.bind(e.renderer.rules);
153
+ e.renderer.rules.fence = (t, n, i, r, u) => {
154
154
  const c = t[n], s = c.content.trim();
155
155
  if (c.info === "mermaid") {
156
156
  let o;
157
157
  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>`;
158
158
  }
159
- return i(t, n, l, r, d);
159
+ return l(t, n, i, r, u);
160
160
  };
161
- }, Ke = We, Y = (e, a) => {
162
- let i = !0, t = !0;
163
- const n = e.posMax, l = a > 0 ? e.src.charCodeAt(a - 1) : -1, r = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
164
- return (l === 32 || l === 9 || r >= 48 && r <= 57) && (t = !1), (r === 32 || r === 9) && (i = !1), {
165
- can_open: i,
161
+ }, Ke = We, ee = (e, a) => {
162
+ let l = !0, t = !0;
163
+ const n = e.posMax, i = a > 0 ? e.src.charCodeAt(a - 1) : -1, r = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
164
+ return (i === 32 || i === 9 || r >= 48 && r <= 57) && (t = !1), (r === 32 || r === 9) && (l = !1), {
165
+ can_open: l,
166
166
  can_close: t
167
167
  };
168
168
  }, qe = (e, a) => {
169
- let i, t, n, l;
169
+ let l, t, n, i;
170
170
  if (e.src[e.pos] !== "$")
171
171
  return !1;
172
- if (n = Y(e, e.pos), !n.can_open)
172
+ if (n = ee(e, e.pos), !n.can_open)
173
173
  return a || (e.pending += "$"), e.pos += 1, !0;
174
174
  const r = e.pos + 1;
175
- for (i = r; (i = e.src.indexOf("$", i)) !== -1; ) {
176
- for (l = i - 1; e.src[l] === "\\"; )
177
- l -= 1;
178
- if ((i - l) % 2 == 1)
175
+ for (l = r; (l = e.src.indexOf("$", l)) !== -1; ) {
176
+ for (i = l - 1; e.src[i] === "\\"; )
177
+ i -= 1;
178
+ if ((l - i) % 2 == 1)
179
179
  break;
180
- i += 1;
180
+ l += 1;
181
181
  }
182
- return i === -1 ? (a || (e.pending += "$"), e.pos = r, !0) : i - r === 0 ? (a || (e.pending += "$$"), e.pos = r + 1, !0) : (n = Y(e, i), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(r, i)), e.pos = i + 1, !0) : (a || (e.pending += "$"), e.pos = r, !0));
183
- }, Ze = (e, a, i, t) => {
184
- let n, l, r, d, c = !1, s = e.bMarks[a] + e.tShift[a], o = e.eMarks[a];
182
+ 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));
183
+ }, Ze = (e, a, l, t) => {
184
+ let n, i, r, u, c = !1, s = e.bMarks[a] + e.tShift[a], o = e.eMarks[a];
185
185
  if (s + 2 > o || e.src.slice(s, s + 2) !== "$$")
186
186
  return !1;
187
187
  if (s += 2, n = e.src.slice(s, o), t)
188
188
  return !0;
189
- for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), c = !0), r = a; !c && (r++, !(r >= i || (s = e.bMarks[r] + e.tShift[r], o = e.eMarks[r], s < o && e.tShift[r] < e.blkIndent))); )
190
- e.src.slice(s, o).trim().slice(-2) === "$$" && (d = e.src.slice(0, o).lastIndexOf("$$"), l = e.src.slice(s, d), c = !0);
189
+ 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))); )
190
+ e.src.slice(s, o).trim().slice(-2) === "$$" && (u = e.src.slice(0, o).lastIndexOf("$$"), i = e.src.slice(s, u), c = !0);
191
191
  e.line = r + 1;
192
- const u = e.push("math_block", "math", 0);
193
- return u.block = !0, u.content = (n && n.trim() ? n + `
194
- ` : "") + e.getLines(a + 1, r, e.tShift[a], !0) + (l && l.trim() ? l : ""), u.map = [a, e.line], u.markup = "$$", !0;
192
+ const d = e.push("math_block", "math", 0);
193
+ return d.block = !0, d.content = (n && n.trim() ? n + `
194
+ ` : "") + e.getLines(a + 1, r, e.tShift[a], !0) + (i && i.trim() ? i : ""), d.map = [a, e.line], d.markup = "$$", !0;
195
195
  }, Je = (e, a) => {
196
- const i = (n) => {
196
+ const l = (n) => {
197
197
  if (a.katexRef.value) {
198
- const l = a.katexRef.value.renderToString(n, {
198
+ const i = a.katexRef.value.renderToString(n, {
199
199
  throwOnError: !1
200
200
  });
201
- return `<span class="${h}-katex-inline" data-processed>${l}</span>`;
201
+ return `<span class="${h}-katex-inline" data-processed>${i}</span>`;
202
202
  } else
203
203
  return `<span class="${h}-katex-inline">${n}</span>`;
204
- }, t = (n, l) => {
204
+ }, t = (n, i) => {
205
205
  if (a.katexRef.value) {
206
206
  const r = a.katexRef.value.renderToString(n, {
207
207
  throwOnError: !1,
208
208
  displayMode: !0
209
209
  });
210
- return `<p class="${h}-katex-block" data-line=${l} data-processed>${r}</p>`;
210
+ return `<p class="${h}-katex-block" data-line=${i} data-processed>${r}</p>`;
211
211
  } else
212
- return `<p class="${h}-katex-block" data-line=${l}>${n}</p>`;
212
+ return `<p class="${h}-katex-block" data-line=${i}>${n}</p>`;
213
213
  };
214
214
  e.inline.ruler.after("escape", "math_inline", qe), e.block.ruler.after("blockquote", "math_block", Ze, {
215
215
  alt: ["paragraph", "reference", "blockquote", "list"]
216
- }), e.renderer.rules.math_inline = (n, l) => i(n[l].content), e.renderer.rules.math_block = (n, l) => t(n[l].content, n[l].map[0]) + `
216
+ }), 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]) + `
217
217
  `;
218
218
  }, Qe = Je, Xe = (e, a) => {
219
219
  a = a || {};
220
- const i = 3, t = a.marker || "!", n = t.charCodeAt(0), l = t.length;
221
- let r = "", d = "";
222
- const c = (o, u, w, v, m) => {
223
- const p = o[u];
224
- return p.type === "admonition_open" ? (o[u].attrPush([
220
+ const l = 3, t = a.marker || "!", n = t.charCodeAt(0), i = t.length;
221
+ let r = "", u = "";
222
+ const c = (o, d, b, v, m) => {
223
+ const p = o[d];
224
+ return p.type === "admonition_open" ? (o[d].attrPush([
225
225
  "class",
226
226
  `${h}-admonition ${h}-admonition-${p.info}`
227
- ]), o[u].attrSet("data-line", String(o[u].map[0]))) : p.type === "admonition_title_open" && o[u].attrPush(["class", `${h}-admonition-title`]), m.renderToken(o, u, w);
227
+ ]), 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);
228
228
  }, s = (o) => {
229
- const u = o.trim().split(" ", 2);
230
- d = "", r = u[0], u.length > 1 && (d = o.substring(r.length + 2)), (d === "" || !d) && (d = r);
229
+ const d = o.trim().split(" ", 2);
230
+ u = "", r = d[0], d.length > 1 && (u = o.substring(r.length + 2)), (u === "" || !u) && (u = r);
231
231
  };
232
232
  e.block.ruler.before(
233
233
  "code",
234
234
  "admonition",
235
- (o, u, w, v) => {
236
- let m, p, f, k = !1, g = o.bMarks[u] + o.tShift[u], b = o.eMarks[u];
235
+ (o, d, b, v) => {
236
+ let m, p, f, k = !1, g = o.bMarks[d] + o.tShift[d], w = o.eMarks[d];
237
237
  if (n !== o.src.charCodeAt(g))
238
238
  return !1;
239
- for (m = g + 1; m <= b && t[(m - g) % l] === o.src[m]; m++)
239
+ for (m = g + 1; m <= w && t[(m - g) % i] === o.src[m]; m++)
240
240
  ;
241
- const T = Math.floor((m - g) / l);
242
- if (T !== i)
241
+ const E = Math.floor((m - g) / i);
242
+ if (E !== l)
243
243
  return !1;
244
- m -= (m - g) % l;
245
- const I = o.src.slice(g, m), $ = o.src.slice(m, b);
244
+ m -= (m - g) % i;
245
+ const I = o.src.slice(g, m), $ = o.src.slice(m, w);
246
246
  if (s($), v)
247
247
  return !0;
248
- for (p = u; p++, !(p >= w || (g = o.bMarks[p] + o.tShift[p], b = o.eMarks[p], g < b && o.sCount[p] < o.blkIndent)); )
248
+ for (p = d; p++, !(p >= b || (g = o.bMarks[p] + o.tShift[p], w = o.eMarks[p], g < w && o.sCount[p] < o.blkIndent)); )
249
249
  if (n === o.src.charCodeAt(g) && !(o.sCount[p] - o.blkIndent >= 4)) {
250
- for (m = g + 1; m <= b && t[(m - g) % l] === o.src[m]; m++)
250
+ for (m = g + 1; m <= w && t[(m - g) % i] === o.src[m]; m++)
251
251
  ;
252
- if (!(Math.floor((m - g) / l) < T) && (m -= (m - g) % l, m = o.skipSpaces(m), !(m < b))) {
252
+ if (!(Math.floor((m - g) / i) < E) && (m -= (m - g) % i, m = o.skipSpaces(m), !(m < w))) {
253
253
  k = !0;
254
254
  break;
255
255
  }
256
256
  }
257
- const L = o.parentType, M = o.lineMax;
258
- return o.parentType = "root", o.lineMax = p, f = o.push("admonition_open", "div", 1), f.markup = I, f.block = !0, f.info = r, f.map = [u, p], f = o.push("admonition_title_open", "p", 1), f.markup = I + " " + r, f.map = [u, p], f = o.push("inline", "", 0), f.content = d, f.map = [u, o.line - 1], f.children = [], f = o.push("admonition_title_close", "p", -1), f.markup = I + " " + r, o.md.block.tokenize(o, u + 1, p), f = o.push("admonition_close", "div", -1), f.markup = o.src.slice(g, m), f.block = !0, o.parentType = L, o.lineMax = M, o.line = p + (k ? 1 : 0), !0;
257
+ const L = o.parentType, x = o.lineMax;
258
+ return o.parentType = "root", o.lineMax = p, f = o.push("admonition_open", "div", 1), f.markup = I, f.block = !0, f.info = r, f.map = [d, p], f = o.push("admonition_title_open", "p", 1), f.markup = I + " " + 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 = I + " " + 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 = x, o.line = p + (k ? 1 : 0), !0;
259
259
  },
260
260
  {
261
261
  alt: ["paragraph", "reference", "blockquote", "list"]
262
262
  }
263
263
  ), 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;
264
264
  }, Ye = Xe, et = (e, a) => {
265
- e.renderer.rules.heading_open = (i, t) => {
266
- var d;
267
- const n = i[t], l = ((d = i[t + 1].children) == null ? void 0 : d.reduce((c, s) => c + (s.content || ""), "")) || "", r = n.markup.length;
265
+ e.renderer.rules.heading_open = (l, t) => {
266
+ var u;
267
+ const n = l[t], i = ((u = l[t + 1].children) == null ? void 0 : u.reduce((c, s) => c + (s.content || ""), "")) || "", r = n.markup.length;
268
268
  return a.headsRef.value.push({
269
- text: l,
269
+ text: i,
270
270
  level: r
271
271
  }), n.map && n.level === 0 && (n.attrSet("data-line", String(n.map[0])), n.attrSet(
272
272
  "id",
273
- a.mdHeadingId(l, r, a.headsRef.value.length)
274
- )), e.renderer.renderToken(i, t, a);
275
- }, e.renderer.rules.heading_close = (i, t, n, l, r) => r.renderToken(i, t, n);
273
+ a.mdHeadingId(i, r, a.headsRef.value.length)
274
+ )), e.renderer.renderToken(l, t, a);
275
+ }, e.renderer.rules.heading_close = (l, t, n, i, r) => r.renderToken(l, t, n);
276
276
  }, tt = et, nt = (e, a) => {
277
- const i = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
278
- function l(s) {
277
+ const l = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
278
+ function i(s) {
279
279
  return s.info ? t(s.info).trim() : "";
280
280
  }
281
281
  function r(s) {
282
- const o = l(s), [u = null, w = ""] = (n.exec(o) || []).slice(1);
283
- return [u, w];
282
+ const o = i(s), [d = null, b = ""] = (n.exec(o) || []).slice(1);
283
+ return [d, b];
284
284
  }
285
- function d(s) {
286
- const o = l(s);
285
+ function u(s) {
286
+ const o = i(s);
287
287
  return o ? o.split(/(\s+)/g)[0] : "";
288
288
  }
289
- const c = (s, o, u, w, v) => {
289
+ const c = (s, o, d, b, v) => {
290
290
  if (s[o].hidden)
291
291
  return "";
292
292
  const [m, p] = r(s[o]);
293
293
  if (m === null)
294
- return i(s, o, u, w, v);
295
- let f, k, g, b, T = "", I = "";
294
+ return l(s, o, d, b, v);
295
+ let f, k, g, w, E = "", I = "";
296
296
  for (let $ = o; $ < s.length && (f = s[$], [k, g] = r(f), k === m); $++)
297
- f.info = f.info.replace(n, ""), f.hidden = !0, b = $ - o > 0 ? "" : " checked", T += `<li><input type="radio" name="label-group-${a.editorId}-${o}"${b}><label for="group-${a.editorId}-${o}-tab-${$ - o}" onclick="this.previousElementSibling.click()">${g || d(f)}</label></li>
298
- `, I += `<input type="radio" id="group-${a.editorId}-${o}-tab-${$ - o}" name="group-${a.editorId}-${o}"${b}>
299
- ` + i(s, $, u, w, v);
297
+ f.info = f.info.replace(n, ""), f.hidden = !0, w = $ - o > 0 ? "" : " checked", E += `<li><input type="radio" name="label-group-${a.editorId}-${o}"${w}><label for="group-${a.editorId}-${o}-tab-${$ - o}" onclick="this.previousElementSibling.click()">${g || u(f)}</label></li>
298
+ `, I += `<input type="radio" id="group-${a.editorId}-${o}-tab-${$ - o}" name="group-${a.editorId}-${o}"${w}>
299
+ ` + l(s, $, d, b, v);
300
300
  return `<div class="code-tabs">
301
301
  <ul>
302
- ` + T + `</ul>
302
+ ` + E + `</ul>
303
303
  ` + I + "</div>";
304
304
  };
305
305
  e.renderer.rules.fence = c;
@@ -314,23 +314,23 @@ const Ae = (e, a) => {
314
314
  "html_block",
315
315
  "fence"
316
316
  ].forEach((a) => {
317
- const i = e.renderer.rules[a];
318
- i ? e.renderer.rules[a] = (t, n, l, r, d) => {
317
+ const l = e.renderer.rules[a];
318
+ l ? e.renderer.rules[a] = (t, n, i, r, u) => {
319
319
  let c;
320
- const s = i(t, n, l, r, d);
320
+ const s = l(t, n, i, r, u);
321
321
  return t[n].map && t[n].level === 0 && !/^<!--/.test(s) ? (c = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${c}"`)) : s;
322
- } : e.renderer.rules[a] = (t, n, l, r, d) => {
322
+ } : e.renderer.rules[a] = (t, n, i, r, u) => {
323
323
  let c;
324
- return t[n].map && t[n].level === 0 && (c = t[n].map[0], t[n].attrSet("data-line", String(c))), d.renderToken(t, n, l);
324
+ 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);
325
325
  };
326
326
  });
327
327
  }, at = (e, a) => {
328
- const { editorConfig: i, markdownItConfig: t, markdownItPlugins: n } = S, l = P("editorId"), r = P("showCodeRowNumber"), d = P("theme"), c = R([]), s = je(e), o = ze(e), { reRenderRef: u, replaceMermaid: w } = De(e), v = Fe({
328
+ const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } = S, i = _("editorId"), r = _("showCodeRowNumber"), u = _("theme"), c = R([]), s = je(e), o = ze(e), { reRenderRef: d, replaceMermaid: b } = De(e), v = Fe({
329
329
  html: !0,
330
330
  breaks: !0
331
331
  });
332
332
  t(v, {
333
- editorId: l
333
+ editorId: i
334
334
  });
335
335
  const m = [
336
336
  {
@@ -340,7 +340,7 @@ const Ae = (e, a) => {
340
340
  },
341
341
  {
342
342
  type: "image",
343
- plugin: Me,
343
+ plugin: xe,
344
344
  options: { figcaption: !0, classes: "md-zoom" }
345
345
  },
346
346
  {
@@ -350,7 +350,7 @@ const Ae = (e, a) => {
350
350
  },
351
351
  {
352
352
  type: "taskList",
353
- plugin: xe,
353
+ plugin: Me,
354
354
  options: {}
355
355
  },
356
356
  {
@@ -361,15 +361,15 @@ const Ae = (e, a) => {
361
361
  {
362
362
  type: "codeTabs",
363
363
  plugin: ot,
364
- options: { editorId: l }
364
+ options: { editorId: i }
365
365
  }
366
366
  ];
367
367
  e.noMermaid || m.push({
368
368
  type: "mermaid",
369
369
  plugin: Ke,
370
- options: { themeRef: d }
370
+ options: { themeRef: u }
371
371
  }), n(m, {
372
- editorId: l
372
+ editorId: i
373
373
  }).forEach((I) => {
374
374
  v.use(I.plugin, I.options);
375
375
  });
@@ -381,38 +381,38 @@ const Ae = (e, a) => {
381
381
  if (N)
382
382
  return N;
383
383
  }
384
- let M;
385
- !e.noHighlight && s.value ? s.value.getLanguage($) ? M = s.value.highlight(I, {
384
+ let x;
385
+ !e.noHighlight && s.value ? s.value.getLanguage($) ? x = s.value.highlight(I, {
386
386
  language: $,
387
387
  ignoreIllegals: !0
388
- }).value : M = s.value.highlightAuto(I).value : M = v.utils.escapeHtml(I);
389
- const fe = r ? Ce(M.replace(/^\n+|\n+$/g, "")) : `<span class="code-block">${M.replace(/^\n+|\n+$/g, "")}</span>`;
388
+ }).value : x = s.value.highlightAuto(I).value : x = v.utils.escapeHtml(I);
389
+ const fe = r ? Ce(x.replace(/^\n+|\n+$/g, "")) : `<span class="code-block">${x.replace(/^\n+|\n+$/g, "")}</span>`;
390
390
  return `<pre><code class="language-${$}" language=${$}>${fe}</code></pre>`;
391
391
  }
392
392
  }), rt(v);
393
393
  const f = R(`_article-key_${j()}`), k = R(e.sanitize(v.render(e.modelValue))), g = () => {
394
- y.emit(l, A, k.value), e.onHtmlChanged(k.value), e.onGetCatalog(c.value), y.emit(l, K, c.value), w();
394
+ y.emit(i, A, k.value), e.onHtmlChanged(k.value), e.onGetCatalog(c.value), y.emit(i, q, c.value), b();
395
395
  };
396
- E(g);
397
- const b = () => {
396
+ P(g);
397
+ const w = () => {
398
398
  c.value = [], k.value = e.sanitize(v.render(e.modelValue)), g();
399
- }, T = F(() => (e.noKatex || o.value) && (e.noHighlight || s.value));
399
+ }, E = F(() => (e.noKatex || o.value) && (e.noHighlight || s.value));
400
400
  return C(
401
- [ee(e, "modelValue"), T, u],
401
+ [te(e, "modelValue"), E, d],
402
402
  ie(
403
- b,
404
- (i == null ? void 0 : i.renderDelay) !== void 0 ? i == null ? void 0 : i.renderDelay : a ? 0 : 500
403
+ w,
404
+ (l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
405
405
  )
406
- ), E(() => {
407
- y.on(l, {
406
+ ), P(() => {
407
+ y.on(i, {
408
408
  name: Ie,
409
409
  callback() {
410
- y.emit(l, K, c.value);
410
+ y.emit(i, q, c.value);
411
411
  }
412
- }), y.on(l, {
413
- name: oe,
412
+ }), y.on(i, {
413
+ name: G,
414
414
  callback: () => {
415
- b(), f.value = `_article-key_${j()}`;
415
+ w(), f.value = `_article-key_${j()}`;
416
416
  }
417
417
  });
418
418
  }), { html: k, key: f };
@@ -470,7 +470,7 @@ const Ae = (e, a) => {
470
470
  sanitizeMermaid: {
471
471
  type: Function
472
472
  }
473
- }, kt = {
473
+ }, $t = {
474
474
  ...ce,
475
475
  onChange: {
476
476
  type: Function,
@@ -542,35 +542,35 @@ const Ae = (e, a) => {
542
542
  onInputBoxWitdhChange: {
543
543
  type: Function
544
544
  }
545
- }, it = /* @__PURE__ */ te({
545
+ }, it = /* @__PURE__ */ ne({
546
546
  name: "ContentPreview",
547
547
  props: ce,
548
548
  setup(e) {
549
- const a = P("editorId"), i = P("previewTheme"), t = P("showCodeRowNumber"), {
549
+ const a = _("editorId"), l = _("previewTheme"), t = _("showCodeRowNumber"), {
550
550
  html: n,
551
- key: l
551
+ key: i
552
552
  } = lt(e, e.previewOnly);
553
- return Oe(e, n), Be(e, n), () => x(pe, null, [x("div", {
553
+ return Oe(e, n, i), Be(e, n), () => M(pe, null, [M("div", {
554
554
  id: `${a}-preview-wrapper`,
555
555
  class: `${h}-preview-wrapper`,
556
556
  "data-show": e.setting.preview,
557
557
  key: "content-preview-wrapper"
558
- }, [x("article", {
559
- key: l.value,
558
+ }, [M("div", {
559
+ key: i.value,
560
560
  id: `${a}-preview`,
561
- class: [`${h}-preview`, `${i == null ? void 0 : i.value}-theme`, t && `${h}-scrn`],
561
+ class: [`${h}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${h}-scrn`],
562
562
  innerHTML: n.value
563
- }, null)]), !e.previewOnly && x("div", {
563
+ }, null)]), !e.previewOnly && M("div", {
564
564
  id: `${a}-html-wrapper`,
565
565
  class: `${h}-preview-wrapper`,
566
566
  "data-show": e.setting.htmlPreview,
567
567
  key: "html-preview-wrapper"
568
- }, [x("div", {
568
+ }, [M("div", {
569
569
  class: `${h}-html`
570
570
  }, [n.value])])]);
571
571
  }
572
- }), $t = (e, a) => {
573
- const { editorId: i } = e, t = ne({
572
+ }), Ct = (e, a) => {
573
+ const { editorId: l } = e, t = oe({
574
574
  // 是否已编译成html
575
575
  buildFinished: !1,
576
576
  // 存储当前最新的html
@@ -581,23 +581,23 @@ const Ae = (e, a) => {
581
581
  () => {
582
582
  t.buildFinished = !1;
583
583
  }
584
- ), E(() => {
585
- y.on(i, {
584
+ ), P(() => {
585
+ y.on(l, {
586
586
  name: A,
587
587
  callback(n) {
588
588
  t.buildFinished = !0, t.html = n;
589
589
  }
590
- }), y.on(i, {
590
+ }), y.on(l, {
591
591
  name: re,
592
592
  callback() {
593
- const n = new Promise((l) => {
593
+ const n = new Promise((i) => {
594
594
  if (t.buildFinished)
595
- l(t.html);
595
+ i(t.html);
596
596
  else {
597
- const r = (d) => {
598
- l(d), y.remove(i, A, r);
597
+ const r = (u) => {
598
+ i(u), y.remove(l, A, r);
599
599
  };
600
- y.on(i, {
600
+ y.on(l, {
601
601
  name: A,
602
602
  callback: r
603
603
  });
@@ -608,8 +608,8 @@ const Ae = (e, a) => {
608
608
  });
609
609
  });
610
610
  }, se = (e) => {
611
- var n, l;
612
- const { editorId: a } = e, i = (l = (n = S) == null ? void 0 : n.editorExtensions) == null ? void 0 : l.highlight;
611
+ var n, i;
612
+ const { editorId: a } = e, l = (i = (n = S) == null ? void 0 : n.editorExtensions) == null ? void 0 : i.highlight;
613
613
  H("editorId", a), H(
614
614
  "theme",
615
615
  F(() => e.theme)
@@ -620,22 +620,22 @@ const Ae = (e, a) => {
620
620
  "highlight",
621
621
  F(() => {
622
622
  const r = {
623
- ...D,
624
- ...i == null ? void 0 : i.css
625
- }, d = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
623
+ ...V,
624
+ ...l == null ? void 0 : l.css
625
+ }, u = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
626
626
  return {
627
- js: (i == null ? void 0 : i.js) || ye,
628
- css: r[e.codeTheme] ? r[e.codeTheme][d] : D.atom[d]
627
+ js: (l == null ? void 0 : l.js) || ye,
628
+ css: r[e.codeTheme] ? r[e.codeTheme][u] : V.atom[u]
629
629
  };
630
630
  })
631
631
  ), H("showCodeRowNumber", e.showCodeRowNumber);
632
632
  const t = F(() => {
633
- var d, c;
633
+ var u, c;
634
634
  const r = {
635
- ...V,
636
- ...(c = (d = S) == null ? void 0 : d.editorConfig) == null ? void 0 : c.languageUserDefined
635
+ ...z,
636
+ ...(c = (u = S) == null ? void 0 : u.editorConfig) == null ? void 0 : c.languageUserDefined
637
637
  };
638
- return r[e.language] ? r[e.language] : V["zh-CN"];
638
+ return r[e.language] ? r[e.language] : z["zh-CN"];
639
639
  });
640
640
  H("usedLanguageText", t), H(
641
641
  "previewTheme",
@@ -644,110 +644,110 @@ const Ae = (e, a) => {
644
644
  "customIcon",
645
645
  F(() => e.customIcon)
646
646
  );
647
- }, Ct = (e) => {
647
+ }, It = (e) => {
648
648
  se(e), H("tabWidth", e.tabWidth);
649
649
  }, ue = (e) => {
650
- E(() => {
651
- var a, i;
650
+ P(() => {
651
+ var a, l;
652
652
  if (!e.noIconfont)
653
653
  if (S.iconfontType === "svg") {
654
654
  const t = document.createElement("script");
655
- t.src = ((a = S.editorExtensions) == null ? void 0 : a.iconfont) || ve, t.id = `${h}-icon`, _(t);
655
+ t.src = ((a = S.editorExtensions) == null ? void 0 : a.iconfont) || ve, t.id = `${h}-icon`, T(t);
656
656
  } else {
657
657
  const t = document.createElement("link");
658
- t.rel = "stylesheet", t.href = ((i = S.editorExtensions) == null ? void 0 : i.iconfontClass) || be, t.id = `${h}-icon-class`, _(t);
658
+ t.rel = "stylesheet", t.href = ((l = S.editorExtensions) == null ? void 0 : l.iconfontClass) || be, t.id = `${h}-icon-class`, T(t);
659
659
  }
660
660
  });
661
- }, It = (e) => {
662
- var d, c, s, o, u, w;
663
- const { noPrettier: a, noUploadImg: i } = e, { editorExtensions: t } = S, n = a || !!((c = (d = S.editorExtensions) == null ? void 0 : d.prettier) != null && c.prettierInstance), l = a || !!((o = (s = S.editorExtensions) == null ? void 0 : s.prettier) != null && o.parserMarkdownInstance), r = i || !!((w = (u = S.editorExtensions) == null ? void 0 : u.cropper) != null && w.instance);
664
- E(() => {
665
- var k, g, b, T;
661
+ }, St = (e) => {
662
+ var u, c, s, o, d, b;
663
+ 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);
664
+ P(() => {
665
+ var k, g, w, E;
666
666
  const v = document.createElement("script"), m = document.createElement("script");
667
- v.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || z.main, v.id = `${h}-prettier`, m.src = ((g = t == null ? void 0 : t.prettier) == null ? void 0 : g.parserMarkdownJs) || z.markdown, m.id = `${h}-prettierMD`;
667
+ 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`;
668
668
  const p = document.createElement("link");
669
- p.rel = "stylesheet", p.href = ((b = t == null ? void 0 : t.cropper) == null ? void 0 : b.css) || W.css, p.id = `${h}-cropperCss`;
669
+ p.rel = "stylesheet", p.href = ((w = t == null ? void 0 : t.cropper) == null ? void 0 : w.css) || K.css, p.id = `${h}-cropperCss`;
670
670
  const f = document.createElement("script");
671
- f.src = ((T = t == null ? void 0 : t.cropper) == null ? void 0 : T.js) || W.js, f.id = `${h}-cropper`, r || (_(p), _(f)), n || _(v), l || _(m);
671
+ f.src = ((E = t == null ? void 0 : t.cropper) == null ? void 0 : E.js) || K.js, f.id = `${h}-cropper`, r || (T(p), T(f)), n || T(v), i || T(m);
672
672
  }), ue(e);
673
- }, St = (e, a) => {
674
- const { editorId: i } = e;
675
- E(() => {
676
- y.on(i, {
673
+ }, Et = (e, a) => {
674
+ const { editorId: l } = e;
675
+ P(() => {
676
+ y.on(l, {
677
677
  name: Se,
678
678
  callback: (t) => {
679
679
  e.onError instanceof Function ? e.onError(t) : a.emit("onError", t);
680
680
  }
681
681
  });
682
682
  });
683
- }, Et = (e, a) => {
684
- const { editorId: i } = e, t = ne({
683
+ }, Pt = (e, a) => {
684
+ const { editorId: l } = e, t = oe({
685
685
  pageFullscreen: e.pageFullscreen,
686
686
  fullscreen: !1,
687
687
  preview: e.preview,
688
688
  htmlPreview: e.preview ? !1 : e.htmlPreview
689
- }), n = (d, c) => {
690
- t[d] = c === void 0 ? !t[d] : c, d === "preview" && t.preview ? t.htmlPreview = !1 : d === "htmlPreview" && t.htmlPreview && (t.preview = !1);
689
+ }), n = (u, c) => {
690
+ t[u] = c === void 0 ? !t[u] : c, u === "preview" && t.preview ? t.htmlPreview = !1 : u === "htmlPreview" && t.htmlPreview && (t.preview = !1);
691
691
  };
692
- let l = "";
692
+ let i = "";
693
693
  const r = () => {
694
- t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = l;
694
+ t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = i;
695
695
  };
696
- return C(() => [t.pageFullscreen, t.fullscreen], r), E(() => {
697
- y.on(i, {
696
+ return C(() => [t.pageFullscreen, t.fullscreen], r), P(() => {
697
+ y.on(l, {
698
698
  name: Ee,
699
- callback(d, c) {
699
+ callback(u, c) {
700
700
  const s = (o) => {
701
- y.emit(i, le, "image", {
701
+ y.emit(l, le, "image", {
702
702
  desc: "",
703
703
  urls: o
704
704
  }), c && c();
705
705
  };
706
- e.onUploadImg ? e.onUploadImg(d, s) : a.emit("onUploadImg", d, s);
706
+ e.onUploadImg ? e.onUploadImg(u, s) : a.emit("onUploadImg", u, s);
707
707
  }
708
- }), l = document.body.style.overflow, r();
708
+ }), i = document.body.style.overflow, r();
709
709
  }), [t, n];
710
- }, Pt = (e) => {
711
- const { editorId: a } = e, i = R(!1);
712
- return E(() => {
710
+ }, _t = (e) => {
711
+ const { editorId: a } = e, l = R(!1);
712
+ return P(() => {
713
713
  y.on(a, {
714
714
  name: ae,
715
715
  callback: (n) => {
716
- n === void 0 ? i.value = !i.value : i.value = n;
716
+ n === void 0 ? l.value = !l.value : l.value = n;
717
717
  }
718
718
  });
719
- }), F(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && i.value);
720
- }, _t = (e, a, i, t, n, l) => {
719
+ }), F(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
720
+ }, Tt = (e, a, l, t, n, i) => {
721
721
  const { editorId: r } = e;
722
722
  C(
723
723
  () => t.pageFullscreen,
724
724
  (c) => {
725
- y.emit(r, q, c);
725
+ y.emit(r, Z, c);
726
726
  }
727
727
  ), C(
728
728
  () => t.fullscreen,
729
729
  (c) => {
730
- y.emit(r, Z, c);
730
+ y.emit(r, J, c);
731
731
  }
732
732
  ), C(
733
733
  () => t.preview,
734
734
  (c) => {
735
- y.emit(r, J, c);
735
+ y.emit(r, Q, c);
736
736
  }
737
737
  ), C(
738
738
  () => t.htmlPreview,
739
739
  (c) => {
740
- y.emit(r, Q, c);
740
+ y.emit(r, X, c);
741
741
  }
742
- ), C(i, (c) => {
743
- y.emit(r, X, c);
742
+ ), C(l, (c) => {
743
+ y.emit(r, Y, c);
744
744
  });
745
- const d = {
745
+ const u = {
746
746
  on(c, s) {
747
747
  switch (c) {
748
748
  case "pageFullscreen": {
749
749
  y.on(r, {
750
- name: q,
750
+ name: Z,
751
751
  callback(o) {
752
752
  s(o);
753
753
  }
@@ -756,7 +756,7 @@ const Ae = (e, a) => {
756
756
  }
757
757
  case "fullscreen": {
758
758
  y.on(r, {
759
- name: Z,
759
+ name: J,
760
760
  callback(o) {
761
761
  s(o);
762
762
  }
@@ -765,7 +765,7 @@ const Ae = (e, a) => {
765
765
  }
766
766
  case "preview": {
767
767
  y.on(r, {
768
- name: J,
768
+ name: Q,
769
769
  callback(o) {
770
770
  s(o);
771
771
  }
@@ -774,7 +774,7 @@ const Ae = (e, a) => {
774
774
  }
775
775
  case "htmlPreview": {
776
776
  y.on(r, {
777
- name: Q,
777
+ name: X,
778
778
  callback(o) {
779
779
  s(o);
780
780
  }
@@ -783,7 +783,7 @@ const Ae = (e, a) => {
783
783
  }
784
784
  case "catalog": {
785
785
  y.on(r, {
786
- name: X,
786
+ name: Y,
787
787
  callback(o) {
788
788
  s(o);
789
789
  }
@@ -815,21 +815,21 @@ const Ae = (e, a) => {
815
815
  },
816
816
  focus(c) {
817
817
  var s;
818
- (s = l.value) == null || s.focus(c);
818
+ (s = i.value) == null || s.focus(c);
819
819
  },
820
820
  rerender() {
821
- y.emit(r, oe);
821
+ y.emit(r, G);
822
822
  },
823
823
  getSelectedText() {
824
824
  var c;
825
- return (c = l.value) == null ? void 0 : c.getSelectedText();
825
+ return (c = i.value) == null ? void 0 : c.getSelectedText();
826
826
  },
827
827
  resetHistory() {
828
828
  var c;
829
- (c = l.value) == null || c.resetHistory();
829
+ (c = i.value) == null || c.resetHistory();
830
830
  }
831
831
  };
832
- a.expose(d);
832
+ a.expose(u);
833
833
  }, ct = (e) => e, de = {
834
834
  /**
835
835
  * markdown content.
@@ -1018,7 +1018,7 @@ const Ae = (e, a) => {
1018
1018
  type: Function,
1019
1019
  default: (e) => Promise.resolve(e)
1020
1020
  }
1021
- }, Tt = {
1021
+ }, Ht = {
1022
1022
  ...de,
1023
1023
  /**
1024
1024
  * input回调事件
@@ -1270,7 +1270,7 @@ const Ae = (e, a) => {
1270
1270
  onInputBoxWitdhChange: {
1271
1271
  type: Function
1272
1272
  }
1273
- }, me = ["onHtmlChanged", "onGetCatalog"], Ht = [
1273
+ }, me = ["onHtmlChanged", "onGetCatalog"], Ft = [
1274
1274
  ...me,
1275
1275
  "onChange",
1276
1276
  "onSave",
@@ -1282,24 +1282,31 @@ const Ae = (e, a) => {
1282
1282
  "onInput",
1283
1283
  "onDrop",
1284
1284
  "onInputBoxWitdhChange"
1285
- ], st = /* @__PURE__ */ te({
1285
+ ], st = (e, a) => {
1286
+ const { editorId: l } = e, t = {
1287
+ rerender() {
1288
+ y.emit(l, G);
1289
+ }
1290
+ };
1291
+ a.expose(t);
1292
+ }, ut = /* @__PURE__ */ ne({
1286
1293
  name: "MdPreview",
1287
1294
  props: de,
1288
1295
  emits: me,
1289
1296
  setup(e, a) {
1290
1297
  const {
1291
- editorId: i,
1298
+ editorId: l,
1292
1299
  noKatex: t,
1293
1300
  noMermaid: n,
1294
- noHighlight: l
1301
+ noHighlight: i
1295
1302
  } = e;
1296
- return se(e), ue(e), he(() => {
1297
- y.clear(i);
1298
- }), () => x("div", {
1299
- id: i,
1303
+ return se(e), ue(e), st(e, a), he(() => {
1304
+ y.clear(l);
1305
+ }), () => M("div", {
1306
+ id: l,
1300
1307
  class: [h, e.class, e.theme === "dark" && `${h}-dark`, `${h}-previewOnly`],
1301
1308
  style: e.style
1302
- }, [x(it, {
1309
+ }, [M(it, {
1303
1310
  modelValue: e.modelValue,
1304
1311
  onHtmlChanged: (r) => {
1305
1312
  e.onHtmlChanged ? e.onHtmlChanged(r) : a.emit("onHtmlChanged", r);
@@ -1312,25 +1319,25 @@ const Ae = (e, a) => {
1312
1319
  sanitize: e.sanitize,
1313
1320
  noKatex: t,
1314
1321
  formatCopiedText: e.formatCopiedText,
1315
- noHighlight: l,
1322
+ noHighlight: i,
1316
1323
  noImgZoomIn: e.noImgZoomIn,
1317
1324
  previewOnly: !0,
1318
1325
  sanitizeMermaid: e.sanitizeMermaid
1319
1326
  }, null)]);
1320
1327
  }
1321
- }), O = st;
1328
+ }), O = ut;
1322
1329
  O.install = (e) => (e.component(O.name, O), e);
1323
1330
  export {
1324
1331
  it as C,
1325
1332
  O as M,
1326
- Ht as a,
1327
- Ct as b,
1328
- kt as c,
1329
- It as d,
1330
- Tt as e,
1331
- St as f,
1332
- Et as g,
1333
- Pt as h,
1334
- _t as i,
1335
- $t as u
1333
+ Ft as a,
1334
+ It as b,
1335
+ $t as c,
1336
+ St as d,
1337
+ Ht as e,
1338
+ Et as f,
1339
+ Pt as g,
1340
+ _t as h,
1341
+ Tt as i,
1342
+ Ct as u
1336
1343
  };