md-editor-v3 4.1.0 → 4.2.0-beta.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,5 +1,5 @@
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 as g, a as S, m as ce, k as N, e as B, h as se, f as j, i as ue, g as O, j as U, l as de, b as me, d as fe } from "./config.mjs";
1
+ import { inject as I, onMounted as C, watch as $, toRef as W, nextTick as A, shallowRef as x, ref as L, computed as H, defineComponent as Z, createVNode as F, Fragment as le, reactive as J, provide as M, onBeforeUnmount as ie } from "vue";
2
+ import { p, a as S, m as ce, k as N, e as B, 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
3
  import { u as he, g as pe, b as y } from "./index4.mjs";
4
4
  import { a as P, u as ge } from "./dom.mjs";
5
5
  import ve from "medium-zoom";
@@ -9,56 +9,56 @@ import be from "markdown-it";
9
9
  import we from "markdown-it-image-figures";
10
10
  import ke from "markdown-it-task-lists";
11
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) => {
12
+ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pageFullscreenChanged", G = "fullscreenChanged", D = "previewChanged", z = "htmlPreviewChanged", K = "catalogVisibleChanged", Se = "textareaFocus", Ie = (e, o) => {
13
13
  const l = I("editorId"), t = X(() => {
14
14
  const n = document.querySelectorAll(`#${l}-preview img`);
15
15
  n.length !== 0 && ve(n, {
16
16
  background: "#00000073"
17
17
  });
18
18
  });
19
- C(t), $([a, W(e.setting, "preview")], t);
20
- }, Te = Ie, Pe = (e, a) => {
19
+ C(t), $([o, W(e.setting, "preview")], t);
20
+ }, Te = Ie, Pe = (e, o) => {
21
21
  const l = I("editorId"), t = I("usedLanguageText"), n = () => {
22
22
  document.querySelectorAll(`#${l}-preview pre`).forEach((i) => {
23
- var d, f;
24
- let u = -1;
25
- (d = i.querySelector(".copy-button")) == null || d.remove();
23
+ var m, f;
24
+ let d = -1;
25
+ (m = i.querySelector(".copy-button")) == null || m.remove();
26
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="${g}-icon" aria-hidden="true"><use xlink:href="#${g}-icon-copy"></use></svg>`, r.addEventListener("click", () => {
28
- var k, v;
29
- clearTimeout(u);
30
- const w = i.querySelector("code").innerText, m = ye(e.formatCopiedText(w)), p = ((k = t.value.copyCode) == null ? void 0 : k.successTips) || "已复制!", h = ((v = t.value.copyCode) == null ? void 0 : v.failTips) || "已复制!";
31
- r.dataset.tips = m ? p : h, u = window.setTimeout(() => {
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 w, v;
29
+ clearTimeout(d);
30
+ const b = i.querySelector("code").innerText, u = ye(e.formatCopiedText(b)), g = ((w = t.value.copyCode) == null ? void 0 : w.successTips) || "已复制!", h = ((v = t.value.copyCode) == null ? void 0 : v.failTips) || "已复制!";
31
+ r.dataset.tips = u ? g : h, d = window.setTimeout(() => {
32
32
  r.dataset.tips = s;
33
33
  }, 1500);
34
34
  }), i.appendChild(r);
35
35
  });
36
- }, o = () => {
36
+ }, a = () => {
37
37
  A(n);
38
38
  }, c = (i) => {
39
39
  i && A(n);
40
40
  };
41
- $(() => a.value, o), $(() => e.setting.preview, c), $(() => e.setting.htmlPreview, c), $(() => t.value, n), C(n);
41
+ $(() => o.value, a), $(() => e.setting.preview, c), $(() => e.setting.htmlPreview, c), $(() => t.value, n), C(n);
42
42
  }, Ee = Pe, _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);
43
+ var a;
44
+ const o = (a = S.editorExtensions) == null ? void 0 : a.highlight, l = o == null ? void 0 : o.instance, t = I("highlight"), n = x(l);
45
45
  return C(() => {
46
46
  if (!e.noHighlight && !n.value) {
47
47
  const c = document.createElement("script");
48
48
  c.src = t.value.js, c.onload = () => {
49
49
  n.value = window.hljs;
50
- }, c.id = `${g}-hljs`, P(c, "hljs");
50
+ }, c.id = `${p}-hljs`, P(c, "hljs");
51
51
  const i = document.createElement("link");
52
- i.rel = "stylesheet", i.href = t.value.css, i.id = `${g}-hlCss`, P(i);
52
+ i.rel = "stylesheet", i.href = t.value.css, i.id = `${p}-hlCss`, P(i);
53
53
  }
54
54
  }), $(
55
55
  () => t.value.css,
56
56
  (c) => {
57
- ge(`${g}-hlCss`, "href", c);
57
+ ge(`${p}-hlCss`, "href", c);
58
58
  }
59
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), c = new $e({
60
+ }, Me = _e, Fe = (e) => {
61
+ const o = I("theme"), { editorExtensions: l } = S, t = l == null ? void 0 : l.mermaid, n = x(t == null ? void 0 : t.instance), a = x(!1), c = new $e({
62
62
  max: 1e3,
63
63
  // 缓存10分钟
64
64
  ttl: 6e5
@@ -66,11 +66,11 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
66
66
  const s = n.value;
67
67
  !e.noMermaid && s && (s.initialize({
68
68
  startOnLoad: !1,
69
- theme: a.value === "dark" ? "dark" : "default"
70
- }), o.value = !o.value);
69
+ theme: o.value === "dark" ? "dark" : "default"
70
+ }), a.value = !a.value);
71
71
  };
72
72
  return $(
73
- () => a.value,
73
+ () => o.value,
74
74
  () => {
75
75
  c.clear(), i();
76
76
  }
@@ -87,201 +87,206 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
87
87
  });
88
88
  else {
89
89
  const r = document.createElement("script");
90
- r.id = `${g}-mermaid`, r.src = s, r.onload = () => {
90
+ r.id = `${p}-mermaid`, r.src = s, r.onload = () => {
91
91
  n.value = window.mermaid, i();
92
92
  }, P(r, "mermaid");
93
93
  }
94
94
  }
95
- }), { mermaidRef: n, reRenderRef: o, replaceMermaid: () => {
95
+ }), { mermaidRef: n, reRenderRef: a, replaceMermaid: () => {
96
96
  A(() => {
97
- !e.noMermaid && n.value && document.querySelectorAll(
98
- `div.${g}-mermaid`
99
- ).forEach(async (r) => {
100
- let d = c.get(r.innerText);
101
- if (!d) {
102
- const w = he(), m = n.value.renderAsync || n.value.render;
103
- let p = "";
104
- try {
105
- p = await m(w, r.innerText);
106
- } catch {
97
+ if (!e.noMermaid && n.value) {
98
+ const s = document.querySelectorAll(
99
+ `div.${p}-mermaid`
100
+ ), r = document.createElement("div");
101
+ r.style.width = document.body.offsetWidth + "px", r.style.height = document.body.offsetHeight + "px", r.style.position = "fixed", r.style.zIndex = "-10000", r.style.top = "-10000", document.body.appendChild(r);
102
+ let m = s.length;
103
+ s.forEach(async (f) => {
104
+ let b = c.get(f.innerText);
105
+ if (!b) {
106
+ const g = he(), h = n.value.renderAsync || n.value.render;
107
+ let w = "";
108
+ try {
109
+ w = await h(g, f.innerText, r);
110
+ } catch {
111
+ }
112
+ b = typeof w == "string" ? w : w.svg, c.set(f.innerText, b);
107
113
  }
108
- d = typeof p == "string" ? p : p.svg, c.set(r.innerText, d);
109
- }
110
- const f = document.createElement("p");
111
- f.className = `${g}-mermaid`, f.setAttribute("data-processed", ""), f.innerHTML = d, r.dataset.line !== void 0 && (f.dataset.line = r.dataset.line), r.replaceWith(f);
112
- });
114
+ const u = document.createElement("p");
115
+ u.className = `${p}-mermaid`, u.setAttribute("data-processed", ""), u.innerHTML = b, f.dataset.line !== void 0 && (u.dataset.line = f.dataset.line), f.replaceWith(u), --m === 0 && r.remove();
116
+ });
117
+ }
113
118
  });
114
119
  } };
115
- }, Me = He, Re = (e) => {
120
+ }, He = Fe, xe = (e) => {
116
121
  var n;
117
- const a = (n = S.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = R(l);
122
+ const o = (n = S.editorExtensions) == null ? void 0 : n.katex, l = o == null ? void 0 : o.instance, t = x(l);
118
123
  return C(() => {
119
124
  if (!e.noKatex && !t.value) {
120
- const o = document.createElement("script");
121
- o.src = (a == null ? void 0 : a.js) || N.js, o.onload = () => {
125
+ const a = document.createElement("script");
126
+ a.src = (o == null ? void 0 : o.js) || N.js, a.onload = () => {
122
127
  t.value = window.katex;
123
- }, o.id = `${g}-katex`;
128
+ }, a.id = `${p}-katex`;
124
129
  const c = document.createElement("link");
125
- c.rel = "stylesheet", c.href = (a == null ? void 0 : a.css) || N.css, c.id = `${g}-katexCss`, P(o, "katex"), P(c);
130
+ c.rel = "stylesheet", c.href = (o == null ? void 0 : o.css) || N.css, c.id = `${p}-katexCss`, P(a, "katex"), P(c);
126
131
  }
127
132
  }), t;
128
- }, xe = Re, Ae = (e, a) => {
133
+ }, Re = xe, Ae = (e, o) => {
129
134
  const l = e.renderer.rules.fence.bind(e.renderer.rules);
130
- e.renderer.rules.fence = (t, n, o, c, i) => {
131
- const u = t[n], s = u.content.trim();
132
- if (u.info === "mermaid") {
135
+ e.renderer.rules.fence = (t, n, a, c, i) => {
136
+ const d = t[n], s = d.content.trim();
137
+ if (d.info === "mermaid" && !o.noMermaid) {
133
138
  let r;
134
- return t[n].map && t[n].level === 0 && (r = t[n].map[0], t[n].attrSet("data-line", String(r))), `<div class="${g}-mermaid" ${r !== void 0 ? "data-line=" + r : ""} data-mermaid-theme=${a.themeRef.value}>${s}</div>`;
139
+ 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=${o.themeRef.value}>${s}</div>`;
135
140
  }
136
- return l(t, n, o, c, i);
141
+ return l(t, n, a, c, i);
137
142
  };
138
- }, Le = Ae, q = (e, a) => {
143
+ }, Le = Ae, q = (e, o) => {
139
144
  let l = !0, t = !0;
140
- const n = e.posMax, o = a > 0 ? e.src.charCodeAt(a - 1) : -1, c = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
141
- return (o === 32 || o === 9 || c >= 48 && c <= 57) && (t = !1), (c === 32 || c === 9) && (l = !1), {
145
+ const n = e.posMax, a = o > 0 ? e.src.charCodeAt(o - 1) : -1, c = o + 1 <= n ? e.src.charCodeAt(o + 1) : -1;
146
+ return (a === 32 || a === 9 || c >= 48 && c <= 57) && (t = !1), (c === 32 || c === 9) && (l = !1), {
142
147
  can_open: l,
143
148
  can_close: t
144
149
  };
145
- }, Ne = (e, a) => {
146
- let l, t, n, o;
150
+ }, Ne = (e, o) => {
151
+ let l, t, n, a;
147
152
  if (e.src[e.pos] !== "$")
148
153
  return !1;
149
154
  if (n = q(e, e.pos), !n.can_open)
150
- return a || (e.pending += "$"), e.pos += 1, !0;
155
+ return o || (e.pending += "$"), e.pos += 1, !0;
151
156
  const c = e.pos + 1;
152
157
  for (l = c; (l = e.src.indexOf("$", l)) !== -1; ) {
153
- for (o = l - 1; e.src[o] === "\\"; )
154
- o -= 1;
155
- if ((l - o) % 2 == 1)
158
+ for (a = l - 1; e.src[a] === "\\"; )
159
+ a -= 1;
160
+ if ((l - a) % 2 == 1)
156
161
  break;
157
162
  l += 1;
158
163
  }
159
- return l === -1 ? (a || (e.pending += "$"), e.pos = c, !0) : l - c === 0 ? (a || (e.pending += "$$"), e.pos = c + 1, !0) : (n = q(e, l), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(c, l)), e.pos = l + 1, !0) : (a || (e.pending += "$"), e.pos = c, !0));
160
- }, Be = (e, a, l, t) => {
161
- let n, o, c, i, u = !1, s = e.bMarks[a] + e.tShift[a], r = e.eMarks[a];
164
+ return l === -1 ? (o || (e.pending += "$"), e.pos = c, !0) : l - c === 0 ? (o || (e.pending += "$$"), e.pos = c + 1, !0) : (n = q(e, l), n.can_close ? (o || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(c, l)), e.pos = l + 1, !0) : (o || (e.pending += "$"), e.pos = c, !0));
165
+ }, Be = (e, o, l, t) => {
166
+ let n, a, c, i, d = !1, s = e.bMarks[o] + e.tShift[o], r = e.eMarks[o];
162
167
  if (s + 2 > r || e.src.slice(s, s + 2) !== "$$")
163
168
  return !1;
164
169
  if (s += 2, n = e.src.slice(s, r), t)
165
170
  return !0;
166
- for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), u = !0), c = a; !u && (c++, !(c >= l || (s = e.bMarks[c] + e.tShift[c], r = e.eMarks[c], s < r && e.tShift[c] < e.blkIndent))); )
167
- e.src.slice(s, r).trim().slice(-2) === "$$" && (i = e.src.slice(0, r).lastIndexOf("$$"), o = e.src.slice(s, i), u = !0);
171
+ for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), d = !0), c = o; !d && (c++, !(c >= l || (s = e.bMarks[c] + e.tShift[c], r = e.eMarks[c], s < r && e.tShift[c] < e.blkIndent))); )
172
+ e.src.slice(s, r).trim().slice(-2) === "$$" && (i = e.src.slice(0, r).lastIndexOf("$$"), a = e.src.slice(s, i), d = !0);
168
173
  e.line = c + 1;
169
- const d = e.push("math_block", "math", 0);
170
- return d.block = !0, d.content = (n && n.trim() ? n + `
171
- ` : "") + e.getLines(a + 1, c, e.tShift[a], !0) + (o && o.trim() ? o : ""), d.map = [a, e.line], d.markup = "$$", !0;
172
- }, je = (e, a) => {
174
+ const m = e.push("math_block", "math", 0);
175
+ return m.block = !0, m.content = (n && n.trim() ? n + `
176
+ ` : "") + e.getLines(o + 1, c, e.tShift[o], !0) + (a && a.trim() ? a : ""), m.map = [o, e.line], m.markup = "$$", !0;
177
+ }, je = (e, o) => {
173
178
  const l = (n) => {
174
- if (a.katexRef.value) {
175
- const o = a.katexRef.value.renderToString(n, {
179
+ if (o.katexRef.value) {
180
+ const a = o.katexRef.value.renderToString(n, {
176
181
  throwOnError: !1
177
182
  });
178
- return `<span class="${g}-katex-inline" data-processed>${o}</span>`;
183
+ return `<span class="${p}-katex-inline" data-processed>${a}</span>`;
179
184
  } else
180
- return `<span class="${g}-katex-inline">${n}</span>`;
181
- }, t = (n, o) => {
182
- if (a.katexRef.value) {
183
- const c = a.katexRef.value.renderToString(n, {
185
+ return `<span class="${p}-katex-inline">${n}</span>`;
186
+ }, t = (n, a) => {
187
+ if (o.katexRef.value) {
188
+ const c = o.katexRef.value.renderToString(n, {
184
189
  throwOnError: !1,
185
190
  displayMode: !0
186
191
  });
187
- return `<p class="${g}-katex-block" data-line=${o} data-processed>${c}</p>`;
192
+ return `<p class="${p}-katex-block" data-line=${a} data-processed>${c}</p>`;
188
193
  } else
189
- return `<p class="${g}-katex-block" data-line=${o}>${n}</p>`;
194
+ return `<p class="${p}-katex-block" data-line=${a}>${n}</p>`;
190
195
  };
191
196
  e.inline.ruler.after("escape", "math_inline", Ne), e.block.ruler.after("blockquote", "math_block", Be, {
192
197
  alt: ["paragraph", "reference", "blockquote", "list"]
193
- }), 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]) + `
198
+ }), e.renderer.rules.math_inline = (n, a) => l(n[a].content), e.renderer.rules.math_block = (n, a) => t(n[a].content, n[a].map[0]) + `
194
199
  `;
195
- }, Oe = je, Ue = (e, a) => {
196
- a = a || {};
197
- const l = 3, t = a.marker || "!", n = t.charCodeAt(0), o = t.length;
200
+ }, Oe = je, Ue = (e, o) => {
201
+ o = o || {};
202
+ const l = 3, t = o.marker || "!", n = t.charCodeAt(0), a = t.length;
198
203
  let c = "", i = "";
199
- const u = (r, d, f, w, m) => {
200
- const p = r[d];
201
- return p.type === "admonition_open" ? (r[d].attrPush([
204
+ const d = (r, m, f, b, u) => {
205
+ const g = r[m];
206
+ return g.type === "admonition_open" ? (r[m].attrPush([
202
207
  "class",
203
- `${g}-admonition ${g}-admonition-${p.info}`
204
- ]), r[d].attrSet("data-line", String(r[d].map[0]))) : p.type === "admonition_title_open" && r[d].attrPush(["class", `${g}-admonition-title`]), m.renderToken(r, d, f);
208
+ `${p}-admonition ${p}-admonition-${g.info}`
209
+ ]), r[m].attrSet("data-line", String(r[m].map[0]))) : g.type === "admonition_title_open" && r[m].attrPush(["class", `${p}-admonition-title`]), u.renderToken(r, m, f);
205
210
  }, s = (r) => {
206
- const d = r.trim().split(" ", 2);
207
- i = "", c = d[0], d.length > 1 && (i = r.substring(c.length + 2)), (i === "" || !i) && (i = c);
211
+ const m = r.trim().split(" ", 2);
212
+ i = "", c = m[0], m.length > 1 && (i = r.substring(c.length + 2)), (i === "" || !i) && (i = c);
208
213
  };
209
214
  e.block.ruler.before(
210
215
  "code",
211
216
  "admonition",
212
- (r, d, f, w) => {
213
- let m, p, h, k = !1, v = r.bMarks[d] + r.tShift[d], b = r.eMarks[d];
217
+ (r, m, f, b) => {
218
+ let u, g, h, w = !1, v = r.bMarks[m] + r.tShift[m], k = r.eMarks[m];
214
219
  if (n !== r.src.charCodeAt(v))
215
220
  return !1;
216
- for (m = v + 1; m <= b && t[(m - v) % o] === r.src[m]; m++)
221
+ for (u = v + 1; u <= k && t[(u - v) % a] === r.src[u]; u++)
217
222
  ;
218
- const T = Math.floor((m - v) / o);
223
+ const T = Math.floor((u - v) / a);
219
224
  if (T !== l)
220
225
  return !1;
221
- m -= (m - v) % o;
222
- const _ = r.src.slice(v, m), E = r.src.slice(m, b);
223
- if (s(E), w)
226
+ u -= (u - v) % a;
227
+ const _ = r.src.slice(v, u), E = r.src.slice(u, k);
228
+ if (s(E), b)
224
229
  return !0;
225
- for (p = d; p++, !(p >= f || (v = r.bMarks[p] + r.tShift[p], b = r.eMarks[p], v < b && r.sCount[p] < r.blkIndent)); )
226
- if (n === r.src.charCodeAt(v) && !(r.sCount[p] - r.blkIndent >= 4)) {
227
- for (m = v + 1; m <= b && t[(m - v) % o] === r.src[m]; m++)
230
+ for (g = m; g++, !(g >= f || (v = r.bMarks[g] + r.tShift[g], k = r.eMarks[g], v < k && r.sCount[g] < r.blkIndent)); )
231
+ if (n === r.src.charCodeAt(v) && !(r.sCount[g] - r.blkIndent >= 4)) {
232
+ for (u = v + 1; u <= k && t[(u - v) % a] === r.src[u]; u++)
228
233
  ;
229
- if (!(Math.floor((m - v) / o) < T) && (m -= (m - v) % o, m = r.skipSpaces(m), !(m < b))) {
230
- k = !0;
234
+ if (!(Math.floor((u - v) / a) < T) && (u -= (u - v) % a, u = r.skipSpaces(u), !(u < k))) {
235
+ w = !0;
231
236
  break;
232
237
  }
233
238
  }
234
- const ae = r.parentType, oe = r.lineMax;
235
- return r.parentType = "root", r.lineMax = p, h = r.push("admonition_open", "div", 1), h.markup = _, h.block = !0, h.info = c, h.map = [d, p], h = r.push("admonition_title_open", "p", 1), h.markup = _ + " " + c, h.map = [d, p], h = r.push("inline", "", 0), h.content = i, h.map = [d, r.line - 1], h.children = [], h = r.push("admonition_title_close", "p", -1), h.markup = _ + " " + c, r.md.block.tokenize(r, d + 1, p), 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 = p + (k ? 1 : 0), !0;
239
+ const oe = r.parentType, ae = r.lineMax;
240
+ return r.parentType = "root", r.lineMax = g, h = r.push("admonition_open", "div", 1), h.markup = _, h.block = !0, h.info = c, h.map = [m, g], h = r.push("admonition_title_open", "p", 1), h.markup = _ + " " + c, h.map = [m, g], h = r.push("inline", "", 0), h.content = i, h.map = [m, r.line - 1], h.children = [], h = r.push("admonition_title_close", "p", -1), h.markup = _ + " " + c, r.md.block.tokenize(r, m + 1, g), h = r.push("admonition_close", "div", -1), h.markup = r.src.slice(v, u), h.block = !0, r.parentType = oe, r.lineMax = ae, r.line = g + (w ? 1 : 0), !0;
236
241
  },
237
242
  {
238
243
  alt: ["paragraph", "reference", "blockquote", "list"]
239
244
  }
240
- ), e.renderer.rules.admonition_open = u, e.renderer.rules.admonition_title_open = u, e.renderer.rules.admonition_title_close = u, e.renderer.rules.admonition_close = u;
241
- }, Ve = Ue, Ge = (e, a) => {
245
+ ), 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;
246
+ }, Ve = Ue, Ge = (e, o) => {
242
247
  let l;
243
248
  e.core.ruler.push("headingLinks", (t) => {
244
249
  l || (l = t.Token);
245
250
  }), e.renderer.rules.heading_open = (t, n) => {
246
- const o = t[n], c = t[n + 1].content, i = o.markup.length;
247
- return a.headsRef.value.push({
251
+ const a = t[n], c = t[n + 1].content, i = a.markup.length;
252
+ return o.headsRef.value.push({
248
253
  text: c,
249
254
  level: i
250
- }), o.map && o.level === 0 && (o.attrSet("data-line", String(o.map[0])), o.attrSet(
255
+ }), a.map && a.level === 0 && (a.attrSet("data-line", String(a.map[0])), a.attrSet(
251
256
  "id",
252
- a.mdHeadingId(c, i, a.headsRef.value.length)
253
- )), e.renderer.renderToken(t, n, a);
254
- }, e.renderer.rules.heading_close = (t, n, o, c, i) => i.renderToken(t, n, o);
255
- }, De = Ge, ze = (e, a) => {
257
+ o.mdHeadingId(c, i, o.headsRef.value.length)
258
+ )), e.renderer.renderToken(t, n, o);
259
+ }, e.renderer.rules.heading_close = (t, n, a, c, i) => i.renderToken(t, n, a);
260
+ }, De = Ge, ze = (e, o) => {
256
261
  const l = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
257
- function o(s) {
262
+ function a(s) {
258
263
  return s.info ? t(s.info).trim() : "";
259
264
  }
260
265
  function c(s) {
261
- const r = o(s), [d = null, f = ""] = (n.exec(r) || []).slice(1);
262
- return [d, f];
266
+ const r = a(s), [m = null, f = ""] = (n.exec(r) || []).slice(1);
267
+ return [m, f];
263
268
  }
264
269
  function i(s) {
265
- const r = o(s);
270
+ const r = a(s);
266
271
  return r ? r.split(/(\s+)/g)[0] : "";
267
272
  }
268
- const u = (s, r, d, f, w) => {
273
+ const d = (s, r, m, f, b) => {
269
274
  if (s[r].hidden)
270
275
  return "";
271
- const [m, p] = c(s[r]);
272
- if (m === null)
273
- return l(s, r, d, f, w);
274
- let h, k, v, b, T = "", _ = "";
275
- for (let E = r; E < s.length && (h = s[E], [k, v] = c(h), k === m); E++)
276
- h.info = h.info.replace(n, ""), h.hidden = !0, b = E - r > 0 ? "" : " checked", T += `<li><input type="radio" name="label-group-${a.editorId}-${r}"${b}><label for="group-${a.editorId}-${r}-tab-${E - r}" onclick="this.previousElementSibling.click()">${v || i(h)}</label></li>
277
- `, _ += `<input type="radio" id="group-${a.editorId}-${r}-tab-${E - r}" name="group-${a.editorId}-${r}"${b}>
278
- ` + l(s, E, d, f, w);
276
+ const [u, g] = c(s[r]);
277
+ if (u === null)
278
+ return l(s, r, m, f, b);
279
+ let h, w, v, k, T = "", _ = "";
280
+ for (let E = r; E < s.length && (h = s[E], [w, v] = c(h), w === u); E++)
281
+ h.info = h.info.replace(n, ""), h.hidden = !0, k = E - r > 0 ? "" : " checked", T += `<li><input type="radio" name="label-group-${o.editorId}-${r}"${k}><label for="group-${o.editorId}-${r}-tab-${E - r}" onclick="this.previousElementSibling.click()">${v || i(h)}</label></li>
282
+ `, _ += `<input type="radio" id="group-${o.editorId}-${r}-tab-${E - r}" name="group-${o.editorId}-${r}"${k}>
283
+ ` + l(s, E, m, f, b);
279
284
  return `<div class="code-tabs">
280
285
  <ul>
281
286
  ` + T + `</ul>
282
287
  ` + _ + "</div>";
283
288
  };
284
- e.renderer.rules.fence = u;
289
+ e.renderer.rules.fence = d;
285
290
  }, Ke = ze, qe = (e) => {
286
291
  [
287
292
  "paragraph_open",
@@ -290,53 +295,53 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
290
295
  "bullet_list_open",
291
296
  "blockquote_open",
292
297
  "hr"
293
- ].forEach((a) => {
294
- e.renderer.rules[a] = (l, t, n, o, c) => {
298
+ ].forEach((o) => {
299
+ e.renderer.rules[o] = (l, t, n, a, c) => {
295
300
  let i;
296
301
  return l[t].map && l[t].level === 0 && (i = l[t].map[0], l[t].attrSet("data-line", String(i))), c.renderToken(l, t, n);
297
302
  };
298
- }), ["html_block", "fence"].forEach((a) => {
299
- const l = e.renderer.rules[a];
300
- e.renderer.rules[a] = (t, n, o, c, i) => {
301
- let u;
302
- const s = l(t, n, o, c, i);
303
- return t[n].map && t[n].level === 0 ? (u = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${u}"`)) : s;
303
+ }), ["html_block", "fence"].forEach((o) => {
304
+ const l = e.renderer.rules[o];
305
+ e.renderer.rules[o] = (t, n, a, c, i) => {
306
+ let d;
307
+ const s = l(t, n, a, c, i);
308
+ return t[n].map && t[n].level === 0 ? (d = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${d}"`)) : s;
304
309
  };
305
310
  });
306
- }, We = (e, a) => {
307
- const { editorConfig: l, markdownItConfig: t } = S, n = I("editorId"), o = I("showCodeRowNumber"), c = I("theme"), i = L([]), u = Fe(e), s = xe(e), { reRenderRef: r, replaceMermaid: d } = Me(e), f = be({
311
+ }, We = (e, o) => {
312
+ const { editorConfig: l, markdownItConfig: t } = S, n = I("editorId"), a = I("showCodeRowNumber"), c = I("theme"), i = L([]), d = Me(e), s = Re(e), { reRenderRef: r, replaceMermaid: m } = He(e), f = be({
308
313
  html: !0,
309
314
  breaks: !0
310
315
  });
311
- t(f), f.use(Oe, { katexRef: s }), f.use(we, { figcaption: !0 }), f.use(Ve), f.use(ke), f.use(De, { mdHeadingId: e.mdHeadingId, headsRef: i }), f.use(Ke, { editorId: n }), e.noMermaid || f.use(Le, { themeRef: c }), f.set({
312
- highlight: (k, v) => {
313
- let b;
314
- !e.noHighlight && u.value ? u.value.getLanguage(v) ? b = u.value.highlight(k, {
316
+ t(f), f.use(Oe, { katexRef: s }), f.use(we, { figcaption: !0 }), f.use(Ve), f.use(ke), f.use(De, { mdHeadingId: e.mdHeadingId, headsRef: i }), f.use(Ke, { editorId: n }), e.noMermaid || f.use(Le, { themeRef: c, noMermaid: e.noMermaid }), f.set({
317
+ highlight: (w, v) => {
318
+ let k;
319
+ !e.noHighlight && d.value ? d.value.getLanguage(v) ? k = d.value.highlight(w, {
315
320
  language: v,
316
321
  ignoreIllegals: !0
317
- }).value : b = u.value.highlightAuto(k).value : b = f.utils.escapeHtml(k);
318
- const T = o ? pe(b.trim()) : `<span class="code-block">${b.trim()}</span>`;
322
+ }).value : k = d.value.highlightAuto(w).value : k = f.utils.escapeHtml(w);
323
+ const T = a ? pe(k.trim()) : `<span class="code-block">${k.trim()}</span>`;
319
324
  return `<pre><code class="language-${v}" language=${v}>${T}</code></pre>`;
320
325
  }
321
326
  }), qe(f);
322
- const w = L(e.sanitize(f.render(e.modelValue))), m = () => {
323
- y.emit(n, "buildFinished", w.value), e.onHtmlChanged(w.value), e.onGetCatalog(i.value), y.emit(n, "catalogChanged", i.value), d();
327
+ const b = L(e.sanitize(f.render(e.modelValue))), u = () => {
328
+ y.emit(n, "buildFinished", b.value), e.onHtmlChanged(b.value), e.onGetCatalog(i.value), y.emit(n, "catalogChanged", i.value), m();
324
329
  };
325
- C(m);
326
- const p = X(
330
+ C(u);
331
+ const g = X(
327
332
  async () => {
328
- i.value = [], w.value = e.sanitize(f.render(e.modelValue)), m();
333
+ i.value = [], b.value = e.sanitize(f.render(e.modelValue)), u();
329
334
  },
330
- (l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
331
- ), h = M(() => (e.noKatex || s.value) && (e.noHighlight || u.value));
332
- return $([W(e, "modelValue"), h, r], p), C(() => {
335
+ (l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : o ? 0 : 500
336
+ ), h = H(() => (e.noKatex || s.value) && (e.noHighlight || d.value));
337
+ return $([W(e, "modelValue"), h, r], g), C(() => {
333
338
  y.on(n, {
334
339
  name: "pushCatalog",
335
340
  callback() {
336
341
  y.emit(n, "catalogChanged", i.value);
337
342
  }
338
343
  });
339
- }), { html: w };
344
+ }), { html: b };
340
345
  }, Ze = We, Je = {
341
346
  modelValue: {
342
347
  type: String,
@@ -389,28 +394,28 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
389
394
  name: "ContentPreview",
390
395
  props: Je,
391
396
  setup(e) {
392
- const a = I("editorId"), l = I("previewTheme"), t = I("showCodeRowNumber"), {
397
+ const o = I("editorId"), l = I("previewTheme"), t = I("showCodeRowNumber"), {
393
398
  html: n
394
399
  } = Ze(e, e.previewOnly);
395
- return Ee(e, n), Te(e, n), () => H(le, null, [H("div", {
396
- id: `${a}-preview-wrapper`,
397
- class: `${g}-preview-wrapper`,
400
+ return Ee(e, n), Te(e, n), () => F(le, null, [F("div", {
401
+ id: `${o}-preview-wrapper`,
402
+ class: `${p}-preview-wrapper`,
398
403
  "data-show": e.setting.preview,
399
404
  key: "content-preview-wrapper"
400
- }, [H("article", {
401
- id: `${a}-preview`,
402
- class: [`${g}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${g}-scrn`],
405
+ }, [F("article", {
406
+ id: `${o}-preview`,
407
+ class: [`${p}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${p}-scrn`],
403
408
  innerHTML: n.value
404
- }, null)]), !e.previewOnly && H("div", {
405
- id: `${a}-html-wrapper`,
406
- class: `${g}-preview-wrapper`,
409
+ }, null)]), !e.previewOnly && F("div", {
410
+ id: `${o}-html-wrapper`,
411
+ class: `${p}-preview-wrapper`,
407
412
  "data-show": e.setting.htmlPreview,
408
413
  key: "html-preview-wrapper"
409
- }, [H("div", {
410
- class: `${g}-html`
414
+ }, [F("div", {
415
+ class: `${p}-html`
411
416
  }, [n.value])])]);
412
417
  }
413
- }), dt = (e, a) => {
418
+ }), ut = (e, o) => {
414
419
  const { editorId: l } = e, t = J({
415
420
  // 是否已编译成html
416
421
  buildFinished: !1,
@@ -431,12 +436,12 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
431
436
  }), y.on(l, {
432
437
  name: Q,
433
438
  callback() {
434
- const n = new Promise((o) => {
439
+ const n = new Promise((a) => {
435
440
  if (t.buildFinished)
436
- o(t.html);
441
+ a(t.html);
437
442
  else {
438
443
  const c = (i) => {
439
- o(i), y.remove(l, "buildFinished", c);
444
+ a(i), y.remove(l, "buildFinished", c);
440
445
  };
441
446
  y.on(l, {
442
447
  name: "buildFinished",
@@ -444,19 +449,19 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
444
449
  });
445
450
  }
446
451
  });
447
- e.onSave ? e.onSave(e.modelValue, n) : a.emit("onSave", e.modelValue, n);
452
+ e.onSave ? e.onSave(e.modelValue, n) : o.emit("onSave", e.modelValue, n);
448
453
  }
449
454
  });
450
455
  });
451
456
  }, ee = (e) => {
452
- var n, o;
453
- const { editorId: a } = e, l = (o = (n = S) == null ? void 0 : n.editorExtensions) == null ? void 0 : o.highlight;
454
- F("editorId", a), F(
457
+ var n, a;
458
+ const { editorId: o } = e, l = (a = (n = S) == null ? void 0 : n.editorExtensions) == null ? void 0 : a.highlight;
459
+ M("editorId", o), M(
455
460
  "theme",
456
- M(() => e.theme)
457
- ), F(
461
+ H(() => e.theme)
462
+ ), M(
458
463
  "highlight",
459
- M(() => {
464
+ H(() => {
460
465
  const c = {
461
466
  ...B,
462
467
  ...l == null ? void 0 : l.css
@@ -466,145 +471,145 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
466
471
  css: c[e.codeTheme] ? c[e.codeTheme][i] : B.atom[i]
467
472
  };
468
473
  })
469
- ), F("showCodeRowNumber", e.showCodeRowNumber);
470
- const t = M(() => {
471
- var i, u;
474
+ ), M("showCodeRowNumber", e.showCodeRowNumber);
475
+ const t = H(() => {
476
+ var i, d;
472
477
  const c = {
473
478
  ...j,
474
- ...(u = (i = S) == null ? void 0 : i.editorConfig) == null ? void 0 : u.languageUserDefined
479
+ ...(d = (i = S) == null ? void 0 : i.editorConfig) == null ? void 0 : d.languageUserDefined
475
480
  };
476
481
  return c[e.language] ? c[e.language] : j["zh-CN"];
477
482
  });
478
- F("usedLanguageText", t), F(
483
+ M("usedLanguageText", t), M(
479
484
  "previewTheme",
480
- M(() => e.previewTheme)
485
+ H(() => e.previewTheme)
481
486
  );
482
487
  }, mt = (e) => {
483
- ee(e), F("tabWidth", e.tabWidth);
488
+ ee(e), M("tabWidth", e.tabWidth);
484
489
  }, te = (e) => {
485
490
  C(() => {
486
491
  var l;
487
- const a = document.createElement("script");
488
- a.src = ((l = S.editorExtensions) == null ? void 0 : l.iconfont) || ue, a.id = `${g}-icon`, e.noIconfont || P(a);
492
+ const o = document.createElement("script");
493
+ o.src = ((l = S.editorExtensions) == null ? void 0 : l.iconfont) || de, o.id = `${p}-icon`, e.noIconfont || P(o);
489
494
  });
490
495
  }, ft = (e) => {
491
- var i, u, s, r, d, f;
492
- const { noPrettier: a, noUploadImg: l } = e, { editorExtensions: t } = S, n = a || !!((u = (i = S.editorExtensions) == null ? void 0 : i.prettier) != null && u.prettierInstance), o = a || !!((r = (s = S.editorExtensions) == null ? void 0 : s.prettier) != null && r.parserMarkdownInstance), c = l || !!((f = (d = S.editorExtensions) == null ? void 0 : d.cropper) != null && f.instance);
496
+ var i, d, s, r, m, f;
497
+ const { noPrettier: o, noUploadImg: l } = e, { editorExtensions: t } = S, n = o || !!((d = (i = S.editorExtensions) == null ? void 0 : i.prettier) != null && d.prettierInstance), a = o || !!((r = (s = S.editorExtensions) == null ? void 0 : s.prettier) != null && r.parserMarkdownInstance), c = l || !!((f = (m = S.editorExtensions) == null ? void 0 : m.cropper) != null && f.instance);
493
498
  C(() => {
494
- var k, v, b, T;
495
- const w = document.createElement("script"), m = document.createElement("script");
496
- w.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || O.main, w.id = `${g}-prettier`, m.src = ((v = t == null ? void 0 : t.prettier) == null ? void 0 : v.parserMarkdownJs) || O.markdown, m.id = `${g}-prettierMD`;
497
- const p = document.createElement("link");
498
- p.rel = "stylesheet", p.href = ((b = t == null ? void 0 : t.cropper) == null ? void 0 : b.css) || U.css, p.id = `${g}-cropperCss`;
499
+ var w, v, k, T;
500
+ const b = document.createElement("script"), u = document.createElement("script");
501
+ b.src = ((w = t == null ? void 0 : t.prettier) == null ? void 0 : w.standaloneJs) || O.main, b.id = `${p}-prettier`, u.src = ((v = t == null ? void 0 : t.prettier) == null ? void 0 : v.parserMarkdownJs) || O.markdown, u.id = `${p}-prettierMD`;
502
+ const g = document.createElement("link");
503
+ g.rel = "stylesheet", g.href = ((k = t == null ? void 0 : t.cropper) == null ? void 0 : k.css) || U.css, g.id = `${p}-cropperCss`;
499
504
  const h = document.createElement("script");
500
- h.src = ((T = t == null ? void 0 : t.cropper) == null ? void 0 : T.js) || U.js, h.id = `${g}-cropper`, c || (P(p), P(h)), n || P(w), o || P(m);
505
+ h.src = ((T = t == null ? void 0 : t.cropper) == null ? void 0 : T.js) || U.js, h.id = `${p}-cropper`, c || (P(g), P(h)), n || P(b), a || P(u);
501
506
  }), te(e);
502
- }, ht = (e, a) => {
507
+ }, ht = (e, o) => {
503
508
  const { editorId: l } = e, t = J({
504
509
  pageFullscreen: e.pageFullscreen,
505
510
  fullscreen: !1,
506
511
  preview: e.preview,
507
512
  htmlPreview: e.preview ? !1 : e.htmlPreview
508
- }), n = (i, u) => {
509
- t[i] = u === void 0 ? !t[i] : u, i === "preview" && t.preview ? t.htmlPreview = !1 : i === "htmlPreview" && t.htmlPreview && (t.preview = !1);
513
+ }), n = (i, d) => {
514
+ t[i] = d === void 0 ? !t[i] : d, i === "preview" && t.preview ? t.htmlPreview = !1 : i === "htmlPreview" && t.htmlPreview && (t.preview = !1);
510
515
  };
511
- let o = "";
516
+ let a = "";
512
517
  const c = () => {
513
- t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = o;
518
+ t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = a;
514
519
  };
515
520
  return $(() => [t.pageFullscreen, t.fullscreen], c), C(() => {
516
521
  y.on(l, {
517
522
  name: "uploadImage",
518
- callback(i, u) {
523
+ callback(i, d) {
519
524
  const s = (r) => {
520
525
  y.emit(l, "replace", "image", {
521
526
  desc: "",
522
527
  urls: r
523
- }), u && u();
528
+ }), d && d();
524
529
  };
525
- e.onUploadImg ? e.onUploadImg(i, s) : a.emit("onUploadImg", i, s);
530
+ e.onUploadImg ? e.onUploadImg(i, s) : o.emit("onUploadImg", i, s);
526
531
  }
527
- }), o = document.body.style.overflow, c();
532
+ }), a = document.body.style.overflow, c();
528
533
  }), [t, n];
529
534
  }, pt = (e) => {
530
- const { editorId: a } = e, l = L(!1);
535
+ const { editorId: o } = e, l = L(!1);
531
536
  return C(() => {
532
- y.on(a, {
537
+ y.on(o, {
533
538
  name: Y,
534
539
  callback: (n) => {
535
540
  n === void 0 ? l.value = !l.value : l.value = n;
536
541
  }
537
542
  });
538
- }), M(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
539
- }, gt = (e, a, l, t, n) => {
540
- const { editorId: o } = e;
543
+ }), H(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
544
+ }, gt = (e, o, l, t, n) => {
545
+ const { editorId: a } = e;
541
546
  $(
542
547
  () => t.pageFullscreen,
543
548
  (i) => {
544
- y.emit(o, V, i);
549
+ y.emit(a, V, i);
545
550
  }
546
551
  ), $(
547
552
  () => t.fullscreen,
548
553
  (i) => {
549
- y.emit(o, G, i);
554
+ y.emit(a, G, i);
550
555
  }
551
556
  ), $(
552
557
  () => t.preview,
553
558
  (i) => {
554
- y.emit(o, D, i);
559
+ y.emit(a, D, i);
555
560
  }
556
561
  ), $(
557
562
  () => t.htmlPreview,
558
563
  (i) => {
559
- y.emit(o, z, i);
564
+ y.emit(a, z, i);
560
565
  }
561
566
  ), $(l, (i) => {
562
- y.emit(o, K, i);
567
+ y.emit(a, K, i);
563
568
  });
564
569
  const c = {
565
- on(i, u) {
570
+ on(i, d) {
566
571
  switch (i) {
567
572
  case "pageFullscreen": {
568
- y.on(o, {
573
+ y.on(a, {
569
574
  name: V,
570
575
  callback(s) {
571
- u(s);
576
+ d(s);
572
577
  }
573
578
  });
574
579
  break;
575
580
  }
576
581
  case "fullscreen": {
577
- y.on(o, {
582
+ y.on(a, {
578
583
  name: G,
579
584
  callback(s) {
580
- u(s);
585
+ d(s);
581
586
  }
582
587
  });
583
588
  break;
584
589
  }
585
590
  case "preview": {
586
- y.on(o, {
591
+ y.on(a, {
587
592
  name: D,
588
593
  callback(s) {
589
- u(s);
594
+ d(s);
590
595
  }
591
596
  });
592
597
  break;
593
598
  }
594
599
  case "htmlPreview": {
595
- y.on(o, {
600
+ y.on(a, {
596
601
  name: z,
597
602
  callback(s) {
598
- u(s);
603
+ d(s);
599
604
  }
600
605
  });
601
606
  break;
602
607
  }
603
608
  case "catalog": {
604
- y.on(o, {
609
+ y.on(a, {
605
610
  name: K,
606
611
  callback(s) {
607
- u(s);
612
+ d(s);
608
613
  }
609
614
  });
610
615
  break;
@@ -615,7 +620,7 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
615
620
  n("pageFullscreen", i);
616
621
  },
617
622
  toggleFullscreen(i) {
618
- y.emit(o, Ce, i);
623
+ y.emit(a, Ce, i);
619
624
  },
620
625
  togglePreview(i) {
621
626
  n("preview", i);
@@ -624,19 +629,19 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
624
629
  n("htmlPreview", i);
625
630
  },
626
631
  toggleCatalog(i) {
627
- y.emit(o, Y, i);
632
+ y.emit(a, Y, i);
628
633
  },
629
634
  triggerSave() {
630
- y.emit(o, Q);
635
+ y.emit(a, Q);
631
636
  },
632
637
  insert(i) {
633
- y.emit(o, "replace", "universal", { generate: i });
638
+ y.emit(a, "replace", "universal", { generate: i });
634
639
  },
635
- focus() {
636
- y.emit(o, Se);
640
+ focus(i) {
641
+ y.emit(a, Se, i);
637
642
  }
638
643
  };
639
- a.expose(c);
644
+ o.expose(c);
640
645
  }, Qe = (e) => e, ne = {
641
646
  /**
642
647
  * markdown content.
@@ -693,7 +698,7 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
693
698
  */
694
699
  editorId: {
695
700
  type: String,
696
- default: de
701
+ default: ue
697
702
  },
698
703
  /**
699
704
  * 预览中代码是否显示行号
@@ -1038,41 +1043,41 @@ const Q = "onSave", Y = "changeCatalogVisible", Ce = "changeFullscreen", V = "pa
1038
1043
  name: "MdPreview",
1039
1044
  props: ne,
1040
1045
  emits: re,
1041
- setup(e, a) {
1046
+ setup(e, o) {
1042
1047
  const {
1043
1048
  editorId: l,
1044
1049
  noKatex: t,
1045
1050
  noMermaid: n,
1046
- noHighlight: o
1051
+ noHighlight: a
1047
1052
  } = e;
1048
1053
  return ee(e), te(e), ie(() => {
1049
1054
  y.clear(l);
1050
- }), () => H("div", {
1055
+ }), () => F("div", {
1051
1056
  id: l,
1052
- class: [g, e.class, e.theme === "dark" && `${g}-dark`, `${g}-previewOnly`],
1057
+ class: [p, e.class, e.theme === "dark" && `${p}-dark`, `${p}-previewOnly`],
1053
1058
  style: e.style
1054
- }, [H(Xe, {
1059
+ }, [F(Xe, {
1055
1060
  modelValue: e.modelValue,
1056
1061
  onHtmlChanged: (c) => {
1057
- e.onHtmlChanged ? e.onHtmlChanged(c) : a.emit("onHtmlChanged", c);
1062
+ e.onHtmlChanged ? e.onHtmlChanged(c) : o.emit("onHtmlChanged", c);
1058
1063
  },
1059
1064
  onGetCatalog: (c) => {
1060
- e.onGetCatalog ? e.onGetCatalog(c) : a.emit("onGetCatalog", c);
1065
+ e.onGetCatalog ? e.onGetCatalog(c) : o.emit("onGetCatalog", c);
1061
1066
  },
1062
1067
  mdHeadingId: e.mdHeadingId,
1063
1068
  noMermaid: n,
1064
1069
  sanitize: e.sanitize,
1065
1070
  noKatex: t,
1066
1071
  formatCopiedText: e.formatCopiedText,
1067
- noHighlight: o,
1072
+ noHighlight: a,
1068
1073
  previewOnly: !0
1069
1074
  }, null)]);
1070
1075
  }
1071
- }), x = Ye;
1072
- x.install = (e) => (e.component(x.name, x), e);
1076
+ }), R = Ye;
1077
+ R.install = (e) => (e.component(R.name, R), e);
1073
1078
  export {
1074
1079
  Ce as C,
1075
- x as M,
1080
+ R as M,
1076
1081
  Q as O,
1077
1082
  Se as T,
1078
1083
  Y as a,
@@ -1084,5 +1089,5 @@ export {
1084
1089
  ht as g,
1085
1090
  pt as h,
1086
1091
  gt as i,
1087
- dt as u
1092
+ ut as u
1088
1093
  };