md-editor-v3 4.2.0 → 4.2.1-beta.1

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