md-editor-v3 4.5.0 → 4.6.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.
- package/README.md +1 -0
- package/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +11 -11
- package/lib/cjs/chunks/index.cjs +6 -6
- package/lib/cjs/chunks/index4.cjs +2 -2
- package/lib/es/MdCatalog.mjs +28 -28
- package/lib/es/MdEditor.mjs +708 -702
- package/lib/es/chunks/index.mjs +206 -201
- package/lib/es/chunks/index4.mjs +64 -46
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/Editor.d.ts +8 -1
- package/lib/types/MdEditor/index.d.ts +18 -2
- package/lib/types/MdEditor/layouts/Content/index.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +4 -0
- package/lib/types/MdEditor/props.d.ts +3 -0
- package/lib/types/MdEditor/static/event-name.d.ts +9 -0
- package/lib/types/MdEditor/type.d.ts +1 -1
- package/lib/types/MdPreview/MdPreview.d.ts +2 -1
- package/lib/types/MdPreview/index.d.ts +6 -2
- package/lib/umd/index.js +41 -41
- package/package.json +2 -2
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { inject as P, onMounted as S, watch as $, toRef as
|
|
2
|
-
import { a as C, p, m as
|
|
3
|
-
import { u as
|
|
4
|
-
import { a as
|
|
5
|
-
import
|
|
6
|
-
import { debounce as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
const l = P("editorId"), { noImgZoomIn: t } = e, n =
|
|
1
|
+
import { inject as P, onMounted as S, watch as $, toRef as X, nextTick as L, shallowRef as R, ref as B, computed as F, defineComponent as Q, createVNode as A, Fragment as ue, reactive as Y, provide as H, onBeforeUnmount as de } from "vue";
|
|
2
|
+
import { a as C, p, m as me, k as O, e as U, h as fe, f as j, i as pe, g as he, j as G, l as D, n as ge, b as ye, d as ve } from "./config.mjs";
|
|
3
|
+
import { u as be, g as we, b as g, P as ke, h as V, B as M, d as ee, E as $e, U as Ce, c as te, i as z, F as K, j as q, H as Z, k as W, R as ne, C as Ie, T as Se } from "./index4.mjs";
|
|
4
|
+
import { a as _, u as Ee } from "./dom.mjs";
|
|
5
|
+
import Pe from "medium-zoom";
|
|
6
|
+
import { debounce as oe } from "@vavt/util";
|
|
7
|
+
import Te from "copy-to-clipboard";
|
|
8
|
+
import _e from "markdown-it";
|
|
9
|
+
import He from "markdown-it-image-figures";
|
|
10
|
+
import Fe from "markdown-it-task-lists";
|
|
11
|
+
import Ae from "lru-cache";
|
|
12
|
+
const Me = (e, a) => {
|
|
13
|
+
const l = P("editorId"), { noImgZoomIn: t } = e, n = oe(() => {
|
|
14
14
|
const r = document.querySelectorAll(`#${l}-preview img`);
|
|
15
|
-
r.length !== 0 &&
|
|
15
|
+
r.length !== 0 && Pe(r, {
|
|
16
16
|
background: "#00000073"
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
S(() => {
|
|
20
20
|
!t && n();
|
|
21
|
-
}), $([a,
|
|
21
|
+
}), $([a, X(e.setting, "preview")], () => {
|
|
22
22
|
!t && n();
|
|
23
23
|
});
|
|
24
|
-
},
|
|
24
|
+
}, Re = Me, xe = (e, a) => {
|
|
25
25
|
if (typeof a[e] == "string")
|
|
26
26
|
return a[e];
|
|
27
27
|
const l = `<i class="${p}-iconfont ${p}-icon-${e}"></i>`;
|
|
@@ -31,48 +31,48 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
31
31
|
default:
|
|
32
32
|
return l;
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Le = (e, a) => {
|
|
35
35
|
const l = P("editorId"), t = P("usedLanguageText"), n = P("customIcon"), r = () => {
|
|
36
36
|
document.querySelectorAll(`#${l}-preview pre`).forEach((u) => {
|
|
37
|
-
var b,
|
|
37
|
+
var b, v;
|
|
38
38
|
let s = -1;
|
|
39
39
|
(b = u.querySelector(".copy-button")) == null || b.remove();
|
|
40
|
-
const o = ((
|
|
41
|
-
d.setAttribute("class", "copy-button"), d.dataset.tips = o, d.innerHTML =
|
|
42
|
-
var
|
|
40
|
+
const o = ((v = t.value.copyCode) == null ? void 0 : v.text) || "复制代码", d = document.createElement("span");
|
|
41
|
+
d.setAttribute("class", "copy-button"), d.dataset.tips = o, d.innerHTML = xe("copy", n.value), d.addEventListener("click", () => {
|
|
42
|
+
var y, w;
|
|
43
43
|
clearTimeout(s);
|
|
44
|
-
const m = u.querySelector("code").innerText, h =
|
|
44
|
+
const m = u.querySelector("code").innerText, h = Te(e.formatCopiedText(m)), f = ((y = t.value.copyCode) == null ? void 0 : y.successTips) || "已复制!", k = ((w = t.value.copyCode) == null ? void 0 : w.failTips) || "已复制!";
|
|
45
45
|
d.dataset.tips = h ? f : k, s = window.setTimeout(() => {
|
|
46
46
|
d.dataset.tips = o;
|
|
47
47
|
}, 1500);
|
|
48
48
|
}), u.appendChild(d);
|
|
49
49
|
});
|
|
50
50
|
}, i = () => {
|
|
51
|
-
|
|
51
|
+
L(r);
|
|
52
52
|
}, c = (u) => {
|
|
53
|
-
u &&
|
|
53
|
+
u && L(r);
|
|
54
54
|
};
|
|
55
55
|
$(() => a.value, i), $(() => e.setting.preview, c), $(() => e.setting.htmlPreview, c), $(() => t.value, r), S(r);
|
|
56
|
-
},
|
|
56
|
+
}, Be = Le, Ne = (e) => {
|
|
57
57
|
var r;
|
|
58
|
-
const a = (r = C.editorExtensions) == null ? void 0 : r.highlight, l = a == null ? void 0 : a.instance, t = P("highlight"), n =
|
|
58
|
+
const a = (r = C.editorExtensions) == null ? void 0 : r.highlight, l = a == null ? void 0 : a.instance, t = P("highlight"), n = R(l);
|
|
59
59
|
return S(() => {
|
|
60
60
|
if (!e.noHighlight && !n.value) {
|
|
61
61
|
const i = document.createElement("script");
|
|
62
62
|
i.src = t.value.js, i.onload = () => {
|
|
63
63
|
n.value = window.hljs;
|
|
64
|
-
}, i.id = `${p}-hljs`,
|
|
64
|
+
}, i.id = `${p}-hljs`, _(i, "hljs");
|
|
65
65
|
const c = document.createElement("link");
|
|
66
|
-
c.rel = "stylesheet", c.href = t.value.css, c.id = `${p}-hlCss`,
|
|
66
|
+
c.rel = "stylesheet", c.href = t.value.css, c.id = `${p}-hlCss`, _(c);
|
|
67
67
|
}
|
|
68
68
|
}), $(
|
|
69
69
|
() => t.value.css,
|
|
70
70
|
(i) => {
|
|
71
|
-
|
|
71
|
+
Ee(`${p}-hlCss`, "href", i);
|
|
72
72
|
}
|
|
73
73
|
), n;
|
|
74
|
-
},
|
|
75
|
-
const a = P("theme"), { editorExtensions: l } = C, t = l == null ? void 0 : l.mermaid, n =
|
|
74
|
+
}, Oe = Ne, Ue = (e) => {
|
|
75
|
+
const a = P("theme"), { editorExtensions: l } = C, t = l == null ? void 0 : l.mermaid, n = R(t == null ? void 0 : t.instance), r = R(-1), i = new Ae({
|
|
76
76
|
max: 1e3,
|
|
77
77
|
// 缓存10分钟
|
|
78
78
|
ttl: 6e5
|
|
@@ -90,7 +90,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
90
90
|
}
|
|
91
91
|
), S(() => {
|
|
92
92
|
if (!e.noMermaid && !(t != null && t.instance)) {
|
|
93
|
-
const s = (t == null ? void 0 : t.js) ||
|
|
93
|
+
const s = (t == null ? void 0 : t.js) || me;
|
|
94
94
|
if (/\.mjs/.test(s))
|
|
95
95
|
import(
|
|
96
96
|
/* @vite-ignore */
|
|
@@ -103,11 +103,11 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
103
103
|
const o = document.createElement("script");
|
|
104
104
|
o.id = `${p}-mermaid`, o.src = s, o.onload = () => {
|
|
105
105
|
n.value = window.mermaid, c();
|
|
106
|
-
},
|
|
106
|
+
}, _(o, "mermaid");
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}), { mermaidRef: n, reRenderRef: r, replaceMermaid: () => {
|
|
110
|
-
|
|
110
|
+
L(() => {
|
|
111
111
|
if (!e.noMermaid && n.value) {
|
|
112
112
|
const s = document.querySelectorAll(
|
|
113
113
|
`div.${p}-mermaid`
|
|
@@ -115,36 +115,36 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
115
115
|
o.style.width = document.body.offsetWidth + "px", o.style.height = document.body.offsetHeight + "px", o.style.position = "fixed", o.style.zIndex = "-10000", o.style.top = "-10000";
|
|
116
116
|
let d = s.length;
|
|
117
117
|
d > 0 && document.body.appendChild(o), s.forEach(async (b) => {
|
|
118
|
-
let
|
|
119
|
-
if (!
|
|
120
|
-
const h =
|
|
118
|
+
let v = i.get(b.innerText);
|
|
119
|
+
if (!v) {
|
|
120
|
+
const h = be(), f = n.value.renderAsync || n.value.render;
|
|
121
121
|
let k = "";
|
|
122
122
|
try {
|
|
123
123
|
k = await f(h, b.innerText, o);
|
|
124
124
|
} catch {
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
v = typeof k == "string" ? k : k.svg, i.set(b.innerText, v);
|
|
127
127
|
}
|
|
128
128
|
const m = document.createElement("p");
|
|
129
|
-
m.className = `${p}-mermaid`, m.setAttribute("data-processed", ""), m.innerHTML =
|
|
129
|
+
m.className = `${p}-mermaid`, m.setAttribute("data-processed", ""), m.innerHTML = v, b.dataset.line !== void 0 && (m.dataset.line = b.dataset.line), b.replaceWith(m), --d === 0 && o.remove();
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
} };
|
|
134
|
-
},
|
|
134
|
+
}, je = Ue, Ge = (e) => {
|
|
135
135
|
var n;
|
|
136
|
-
const a = (n = C.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t =
|
|
136
|
+
const a = (n = C.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = R(l);
|
|
137
137
|
return S(() => {
|
|
138
138
|
if (!e.noKatex && !t.value) {
|
|
139
139
|
const r = document.createElement("script");
|
|
140
|
-
r.src = (a == null ? void 0 : a.js) ||
|
|
140
|
+
r.src = (a == null ? void 0 : a.js) || O.js, r.onload = () => {
|
|
141
141
|
t.value = window.katex;
|
|
142
142
|
}, r.id = `${p}-katex`;
|
|
143
143
|
const i = document.createElement("link");
|
|
144
|
-
i.rel = "stylesheet", i.href = (a == null ? void 0 : a.css) ||
|
|
144
|
+
i.rel = "stylesheet", i.href = (a == null ? void 0 : a.css) || O.css, i.id = `${p}-katexCss`, _(r, "katex"), _(i);
|
|
145
145
|
}
|
|
146
146
|
}), t;
|
|
147
|
-
},
|
|
147
|
+
}, De = Ge, Ve = (e, a) => {
|
|
148
148
|
const l = e.renderer.rules.fence.bind(e.renderer.rules);
|
|
149
149
|
e.renderer.rules.fence = (t, n, r, i, c) => {
|
|
150
150
|
const u = t[n], s = u.content.trim();
|
|
@@ -154,18 +154,18 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
154
154
|
}
|
|
155
155
|
return l(t, n, r, i, c);
|
|
156
156
|
};
|
|
157
|
-
},
|
|
157
|
+
}, ze = Ve, J = (e, a) => {
|
|
158
158
|
let l = !0, t = !0;
|
|
159
159
|
const n = e.posMax, r = a > 0 ? e.src.charCodeAt(a - 1) : -1, i = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
|
|
160
160
|
return (r === 32 || r === 9 || i >= 48 && i <= 57) && (t = !1), (i === 32 || i === 9) && (l = !1), {
|
|
161
161
|
can_open: l,
|
|
162
162
|
can_close: t
|
|
163
163
|
};
|
|
164
|
-
},
|
|
164
|
+
}, Ke = (e, a) => {
|
|
165
165
|
let l, t, n, r;
|
|
166
166
|
if (e.src[e.pos] !== "$")
|
|
167
167
|
return !1;
|
|
168
|
-
if (n =
|
|
168
|
+
if (n = J(e, e.pos), !n.can_open)
|
|
169
169
|
return a || (e.pending += "$"), e.pos += 1, !0;
|
|
170
170
|
const i = e.pos + 1;
|
|
171
171
|
for (l = i; (l = e.src.indexOf("$", l)) !== -1; ) {
|
|
@@ -175,8 +175,8 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
175
175
|
break;
|
|
176
176
|
l += 1;
|
|
177
177
|
}
|
|
178
|
-
return l === -1 ? (a || (e.pending += "$"), e.pos = i, !0) : l - i === 0 ? (a || (e.pending += "$$"), e.pos = i + 1, !0) : (n =
|
|
179
|
-
},
|
|
178
|
+
return l === -1 ? (a || (e.pending += "$"), e.pos = i, !0) : l - i === 0 ? (a || (e.pending += "$$"), e.pos = i + 1, !0) : (n = J(e, l), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(i, l)), e.pos = l + 1, !0) : (a || (e.pending += "$"), e.pos = i, !0));
|
|
179
|
+
}, qe = (e, a, l, t) => {
|
|
180
180
|
let n, r, i, c, u = !1, s = e.bMarks[a] + e.tShift[a], o = e.eMarks[a];
|
|
181
181
|
if (s + 2 > o || e.src.slice(s, s + 2) !== "$$")
|
|
182
182
|
return !1;
|
|
@@ -188,7 +188,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
188
188
|
const d = e.push("math_block", "math", 0);
|
|
189
189
|
return d.block = !0, d.content = (n && n.trim() ? n + `
|
|
190
190
|
` : "") + e.getLines(a + 1, i, e.tShift[a], !0) + (r && r.trim() ? r : ""), d.map = [a, e.line], d.markup = "$$", !0;
|
|
191
|
-
},
|
|
191
|
+
}, Ze = (e, a) => {
|
|
192
192
|
const l = (n) => {
|
|
193
193
|
if (a.katexRef.value) {
|
|
194
194
|
const r = a.katexRef.value.renderToString(n, {
|
|
@@ -207,15 +207,15 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
207
207
|
} else
|
|
208
208
|
return `<p class="${p}-katex-block" data-line=${r}>${n}</p>`;
|
|
209
209
|
};
|
|
210
|
-
e.inline.ruler.after("escape", "math_inline",
|
|
210
|
+
e.inline.ruler.after("escape", "math_inline", Ke), e.block.ruler.after("blockquote", "math_block", qe, {
|
|
211
211
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
212
212
|
}), e.renderer.rules.math_inline = (n, r) => l(n[r].content), e.renderer.rules.math_block = (n, r) => t(n[r].content, n[r].map[0]) + `
|
|
213
213
|
`;
|
|
214
|
-
},
|
|
214
|
+
}, We = Ze, Je = (e, a) => {
|
|
215
215
|
a = a || {};
|
|
216
216
|
const l = 3, t = a.marker || "!", n = t.charCodeAt(0), r = t.length;
|
|
217
217
|
let i = "", c = "";
|
|
218
|
-
const u = (o, d, b,
|
|
218
|
+
const u = (o, d, b, v, m) => {
|
|
219
219
|
const h = o[d];
|
|
220
220
|
return h.type === "admonition_open" ? (o[d].attrPush([
|
|
221
221
|
"class",
|
|
@@ -228,36 +228,36 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
228
228
|
e.block.ruler.before(
|
|
229
229
|
"code",
|
|
230
230
|
"admonition",
|
|
231
|
-
(o, d, b,
|
|
232
|
-
let m, h, f, k = !1,
|
|
233
|
-
if (n !== o.src.charCodeAt(
|
|
231
|
+
(o, d, b, v) => {
|
|
232
|
+
let m, h, f, k = !1, y = o.bMarks[d] + o.tShift[d], w = o.eMarks[d];
|
|
233
|
+
if (n !== o.src.charCodeAt(y))
|
|
234
234
|
return !1;
|
|
235
|
-
for (m =
|
|
235
|
+
for (m = y + 1; m <= w && t[(m - y) % r] === o.src[m]; m++)
|
|
236
236
|
;
|
|
237
|
-
const I = Math.floor((m -
|
|
237
|
+
const I = Math.floor((m - y) / r);
|
|
238
238
|
if (I !== l)
|
|
239
239
|
return !1;
|
|
240
|
-
m -= (m -
|
|
241
|
-
const E = o.src.slice(
|
|
242
|
-
if (s(T),
|
|
240
|
+
m -= (m - y) % r;
|
|
241
|
+
const E = o.src.slice(y, m), T = o.src.slice(m, w);
|
|
242
|
+
if (s(T), v)
|
|
243
243
|
return !0;
|
|
244
|
-
for (h = d; h++, !(h >= b || (
|
|
245
|
-
if (n === o.src.charCodeAt(
|
|
246
|
-
for (m =
|
|
244
|
+
for (h = d; h++, !(h >= b || (y = o.bMarks[h] + o.tShift[h], w = o.eMarks[h], y < w && o.sCount[h] < o.blkIndent)); )
|
|
245
|
+
if (n === o.src.charCodeAt(y) && !(o.sCount[h] - o.blkIndent >= 4)) {
|
|
246
|
+
for (m = y + 1; m <= w && t[(m - y) % r] === o.src[m]; m++)
|
|
247
247
|
;
|
|
248
|
-
if (!(Math.floor((m -
|
|
248
|
+
if (!(Math.floor((m - y) / r) < I) && (m -= (m - y) % r, m = o.skipSpaces(m), !(m < w))) {
|
|
249
249
|
k = !0;
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
const
|
|
254
|
-
return o.parentType = "root", o.lineMax = h, f = o.push("admonition_open", "div", 1), f.markup = E, f.block = !0, f.info = i, f.map = [d, h], f = o.push("admonition_title_open", "p", 1), f.markup = E + " " + i, f.map = [d, h], f = o.push("inline", "", 0), f.content = c, f.map = [d, o.line - 1], f.children = [], f = o.push("admonition_title_close", "p", -1), f.markup = E + " " + i, o.md.block.tokenize(o, d + 1, h), f = o.push("admonition_close", "div", -1), f.markup = o.src.slice(
|
|
253
|
+
const N = o.parentType, se = o.lineMax;
|
|
254
|
+
return o.parentType = "root", o.lineMax = h, f = o.push("admonition_open", "div", 1), f.markup = E, f.block = !0, f.info = i, f.map = [d, h], f = o.push("admonition_title_open", "p", 1), f.markup = E + " " + i, f.map = [d, h], f = o.push("inline", "", 0), f.content = c, f.map = [d, o.line - 1], f.children = [], f = o.push("admonition_title_close", "p", -1), f.markup = E + " " + i, o.md.block.tokenize(o, d + 1, h), f = o.push("admonition_close", "div", -1), f.markup = o.src.slice(y, m), f.block = !0, o.parentType = N, o.lineMax = se, o.line = h + (k ? 1 : 0), !0;
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
257
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
258
258
|
}
|
|
259
259
|
), 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;
|
|
260
|
-
},
|
|
260
|
+
}, Xe = Je, Qe = (e, a) => {
|
|
261
261
|
e.renderer.rules.heading_open = (l, t) => {
|
|
262
262
|
const n = l[t], r = l[t + 1].content, i = n.markup.length;
|
|
263
263
|
return a.headsRef.value.push({
|
|
@@ -268,7 +268,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
268
268
|
a.mdHeadingId(r, i, a.headsRef.value.length)
|
|
269
269
|
)), e.renderer.renderToken(l, t, a);
|
|
270
270
|
}, e.renderer.rules.heading_close = (l, t, n, r, i) => i.renderToken(l, t, n);
|
|
271
|
-
},
|
|
271
|
+
}, Ye = Qe, et = (e, a) => {
|
|
272
272
|
const l = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
|
|
273
273
|
function r(s) {
|
|
274
274
|
return s.info ? t(s.info).trim() : "";
|
|
@@ -281,24 +281,24 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
281
281
|
const o = r(s);
|
|
282
282
|
return o ? o.split(/(\s+)/g)[0] : "";
|
|
283
283
|
}
|
|
284
|
-
const u = (s, o, d, b,
|
|
284
|
+
const u = (s, o, d, b, v) => {
|
|
285
285
|
if (s[o].hidden)
|
|
286
286
|
return "";
|
|
287
287
|
const [m, h] = i(s[o]);
|
|
288
288
|
if (m === null)
|
|
289
|
-
return l(s, o, d, b,
|
|
290
|
-
let f, k,
|
|
291
|
-
for (let T = o; T < s.length && (f = s[T], [k,
|
|
292
|
-
f.info = f.info.replace(n, ""), f.hidden = !0, w = T - o > 0 ? "" : " checked", I += `<li><input type="radio" name="label-group-${a.editorId}-${o}"${w}><label for="group-${a.editorId}-${o}-tab-${T - o}" onclick="this.previousElementSibling.click()">${
|
|
289
|
+
return l(s, o, d, b, v);
|
|
290
|
+
let f, k, y, w, I = "", E = "";
|
|
291
|
+
for (let T = o; T < s.length && (f = s[T], [k, y] = i(f), k === m); T++)
|
|
292
|
+
f.info = f.info.replace(n, ""), f.hidden = !0, w = T - o > 0 ? "" : " checked", I += `<li><input type="radio" name="label-group-${a.editorId}-${o}"${w}><label for="group-${a.editorId}-${o}-tab-${T - o}" onclick="this.previousElementSibling.click()">${y || c(f)}</label></li>
|
|
293
293
|
`, E += `<input type="radio" id="group-${a.editorId}-${o}-tab-${T - o}" name="group-${a.editorId}-${o}"${w}>
|
|
294
|
-
` + l(s, T, d, b,
|
|
294
|
+
` + l(s, T, d, b, v);
|
|
295
295
|
return `<div class="code-tabs">
|
|
296
296
|
<ul>
|
|
297
297
|
` + I + `</ul>
|
|
298
298
|
` + E + "</div>";
|
|
299
299
|
};
|
|
300
300
|
e.renderer.rules.fence = u;
|
|
301
|
-
},
|
|
301
|
+
}, tt = et, nt = (e) => {
|
|
302
302
|
[
|
|
303
303
|
"paragraph_open",
|
|
304
304
|
"table_open",
|
|
@@ -319,80 +319,80 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
319
319
|
return t[n].map && t[n].level === 0 && (u = t[n].map[0], t[n].attrSet("data-line", String(u))), c.renderToken(t, n, r);
|
|
320
320
|
};
|
|
321
321
|
});
|
|
322
|
-
},
|
|
323
|
-
const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } = C, r = P("editorId"), i = P("showCodeRowNumber"), c = P("theme"), u = B([]), s =
|
|
322
|
+
}, ot = (e, a) => {
|
|
323
|
+
const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } = C, r = P("editorId"), i = P("showCodeRowNumber"), c = P("theme"), u = B([]), s = Oe(e), o = De(e), { reRenderRef: d, replaceMermaid: b } = je(e), v = _e({
|
|
324
324
|
html: !0,
|
|
325
325
|
breaks: !0
|
|
326
326
|
});
|
|
327
|
-
t(
|
|
327
|
+
t(v);
|
|
328
328
|
const m = [
|
|
329
329
|
{
|
|
330
330
|
type: "katex",
|
|
331
|
-
plugin:
|
|
331
|
+
plugin: We,
|
|
332
332
|
options: { katexRef: o }
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
type: "image",
|
|
336
|
-
plugin:
|
|
336
|
+
plugin: He,
|
|
337
337
|
options: { figcaption: !0, classes: "md-zoom" }
|
|
338
338
|
},
|
|
339
339
|
{
|
|
340
340
|
type: "admonition",
|
|
341
|
-
plugin:
|
|
341
|
+
plugin: Xe,
|
|
342
342
|
options: {}
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
type: "taskList",
|
|
346
|
-
plugin:
|
|
346
|
+
plugin: Fe,
|
|
347
347
|
options: {}
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
type: "heading",
|
|
351
|
-
plugin:
|
|
351
|
+
plugin: Ye,
|
|
352
352
|
options: { mdHeadingId: e.mdHeadingId, headsRef: u }
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
355
|
type: "codeTabs",
|
|
356
|
-
plugin:
|
|
356
|
+
plugin: tt,
|
|
357
357
|
options: { editorId: r }
|
|
358
358
|
}
|
|
359
359
|
];
|
|
360
360
|
e.noMermaid || m.push({
|
|
361
361
|
type: "mermaid",
|
|
362
|
-
plugin:
|
|
362
|
+
plugin: ze,
|
|
363
363
|
options: { themeRef: c }
|
|
364
364
|
}), n(m).forEach((w) => {
|
|
365
|
-
|
|
366
|
-
}),
|
|
365
|
+
v.use(w.plugin, w.options);
|
|
366
|
+
}), v.set({
|
|
367
367
|
highlight: (w, I) => {
|
|
368
368
|
let E;
|
|
369
369
|
!e.noHighlight && s.value ? s.value.getLanguage(I) ? E = s.value.highlight(w, {
|
|
370
370
|
language: I,
|
|
371
371
|
ignoreIllegals: !0
|
|
372
|
-
}).value : E = s.value.highlightAuto(w).value : E =
|
|
373
|
-
const T = i ?
|
|
372
|
+
}).value : E = s.value.highlightAuto(w).value : E = v.utils.escapeHtml(w);
|
|
373
|
+
const T = i ? we(E.trim()) : `<span class="code-block">${E.trim()}</span>`;
|
|
374
374
|
return `<pre><code class="language-${I}" language=${I}>${T}</code></pre>`;
|
|
375
375
|
}
|
|
376
|
-
}),
|
|
377
|
-
const h = B(e.sanitize(
|
|
378
|
-
g.emit(r,
|
|
376
|
+
}), nt(v);
|
|
377
|
+
const h = B(e.sanitize(v.render(e.modelValue))), f = () => {
|
|
378
|
+
g.emit(r, M, h.value), e.onHtmlChanged(h.value), e.onGetCatalog(u.value), g.emit(r, V, u.value), b();
|
|
379
379
|
};
|
|
380
380
|
S(f);
|
|
381
|
-
const k =
|
|
381
|
+
const k = oe(
|
|
382
382
|
async () => {
|
|
383
|
-
u.value = [], h.value = e.sanitize(
|
|
383
|
+
u.value = [], h.value = e.sanitize(v.render(e.modelValue)), f();
|
|
384
384
|
},
|
|
385
385
|
(l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
|
|
386
|
-
),
|
|
387
|
-
return $([
|
|
386
|
+
), y = F(() => (e.noKatex || o.value) && (e.noHighlight || s.value));
|
|
387
|
+
return $([X(e, "modelValue"), y, d], k), S(() => {
|
|
388
388
|
g.on(r, {
|
|
389
|
-
name:
|
|
389
|
+
name: ke,
|
|
390
390
|
callback() {
|
|
391
|
-
g.emit(r,
|
|
391
|
+
g.emit(r, V, u.value);
|
|
392
392
|
}
|
|
393
393
|
});
|
|
394
394
|
}), { html: h };
|
|
395
|
-
},
|
|
395
|
+
}, rt = ot, re = {
|
|
396
396
|
modelValue: {
|
|
397
397
|
type: String,
|
|
398
398
|
default: ""
|
|
@@ -443,8 +443,8 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
443
443
|
noImgZoomIn: {
|
|
444
444
|
type: Boolean
|
|
445
445
|
}
|
|
446
|
-
},
|
|
447
|
-
...
|
|
446
|
+
}, bt = {
|
|
447
|
+
...re,
|
|
448
448
|
onChange: {
|
|
449
449
|
type: Function,
|
|
450
450
|
default: () => {
|
|
@@ -503,34 +503,39 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
503
503
|
},
|
|
504
504
|
onInput: {
|
|
505
505
|
type: Function
|
|
506
|
+
},
|
|
507
|
+
onDrop: {
|
|
508
|
+
type: Function,
|
|
509
|
+
default: () => {
|
|
510
|
+
}
|
|
506
511
|
}
|
|
507
|
-
},
|
|
512
|
+
}, at = /* @__PURE__ */ Q({
|
|
508
513
|
name: "ContentPreview",
|
|
509
|
-
props:
|
|
514
|
+
props: re,
|
|
510
515
|
setup(e) {
|
|
511
516
|
const a = P("editorId"), l = P("previewTheme"), t = P("showCodeRowNumber"), {
|
|
512
517
|
html: n
|
|
513
|
-
} =
|
|
514
|
-
return
|
|
518
|
+
} = rt(e, e.previewOnly);
|
|
519
|
+
return Be(e, n), Re(e, n), () => A(ue, null, [A("div", {
|
|
515
520
|
id: `${a}-preview-wrapper`,
|
|
516
521
|
class: `${p}-preview-wrapper`,
|
|
517
522
|
"data-show": e.setting.preview,
|
|
518
523
|
key: "content-preview-wrapper"
|
|
519
|
-
}, [
|
|
524
|
+
}, [A("article", {
|
|
520
525
|
id: `${a}-preview`,
|
|
521
526
|
class: [`${p}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${p}-scrn`],
|
|
522
527
|
innerHTML: n.value
|
|
523
|
-
}, null)]), !e.previewOnly &&
|
|
528
|
+
}, null)]), !e.previewOnly && A("div", {
|
|
524
529
|
id: `${a}-html-wrapper`,
|
|
525
530
|
class: `${p}-preview-wrapper`,
|
|
526
531
|
"data-show": e.setting.htmlPreview,
|
|
527
532
|
key: "html-preview-wrapper"
|
|
528
|
-
}, [
|
|
533
|
+
}, [A("div", {
|
|
529
534
|
class: `${p}-html`
|
|
530
535
|
}, [n.value])])]);
|
|
531
536
|
}
|
|
532
|
-
}),
|
|
533
|
-
const { editorId: l } = e, t =
|
|
537
|
+
}), wt = (e, a) => {
|
|
538
|
+
const { editorId: l } = e, t = Y({
|
|
534
539
|
// 是否已编译成html
|
|
535
540
|
buildFinished: !1,
|
|
536
541
|
// 存储当前最新的html
|
|
@@ -543,22 +548,22 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
543
548
|
}
|
|
544
549
|
), S(() => {
|
|
545
550
|
g.on(l, {
|
|
546
|
-
name:
|
|
551
|
+
name: M,
|
|
547
552
|
callback(n) {
|
|
548
553
|
t.buildFinished = !0, t.html = n;
|
|
549
554
|
}
|
|
550
555
|
}), g.on(l, {
|
|
551
|
-
name:
|
|
556
|
+
name: ee,
|
|
552
557
|
callback() {
|
|
553
558
|
const n = new Promise((r) => {
|
|
554
559
|
if (t.buildFinished)
|
|
555
560
|
r(t.html);
|
|
556
561
|
else {
|
|
557
562
|
const i = (c) => {
|
|
558
|
-
r(c), g.remove(l,
|
|
563
|
+
r(c), g.remove(l, M, i);
|
|
559
564
|
};
|
|
560
565
|
g.on(l, {
|
|
561
|
-
name:
|
|
566
|
+
name: M,
|
|
562
567
|
callback: i
|
|
563
568
|
});
|
|
564
569
|
}
|
|
@@ -567,78 +572,78 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
567
572
|
}
|
|
568
573
|
});
|
|
569
574
|
});
|
|
570
|
-
},
|
|
575
|
+
}, ae = (e) => {
|
|
571
576
|
var n, r;
|
|
572
577
|
const { editorId: a } = e, l = (r = (n = C) == null ? void 0 : n.editorExtensions) == null ? void 0 : r.highlight;
|
|
573
|
-
|
|
578
|
+
H("editorId", a), H(
|
|
574
579
|
"theme",
|
|
575
|
-
|
|
576
|
-
),
|
|
580
|
+
F(() => e.theme)
|
|
581
|
+
), H(
|
|
577
582
|
"highlight",
|
|
578
|
-
|
|
583
|
+
F(() => {
|
|
579
584
|
const i = {
|
|
580
|
-
...
|
|
585
|
+
...U,
|
|
581
586
|
...l == null ? void 0 : l.css
|
|
582
587
|
}, c = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
|
|
583
588
|
return {
|
|
584
|
-
js: (l == null ? void 0 : l.js) ||
|
|
585
|
-
css: i[e.codeTheme] ? i[e.codeTheme][c] :
|
|
589
|
+
js: (l == null ? void 0 : l.js) || fe,
|
|
590
|
+
css: i[e.codeTheme] ? i[e.codeTheme][c] : U.atom[c]
|
|
586
591
|
};
|
|
587
592
|
})
|
|
588
|
-
),
|
|
589
|
-
const t =
|
|
593
|
+
), H("showCodeRowNumber", e.showCodeRowNumber);
|
|
594
|
+
const t = F(() => {
|
|
590
595
|
var c, u;
|
|
591
596
|
const i = {
|
|
592
|
-
...
|
|
597
|
+
...j,
|
|
593
598
|
...(u = (c = C) == null ? void 0 : c.editorConfig) == null ? void 0 : u.languageUserDefined
|
|
594
599
|
};
|
|
595
|
-
return i[e.language] ? i[e.language] :
|
|
600
|
+
return i[e.language] ? i[e.language] : j["zh-CN"];
|
|
596
601
|
});
|
|
597
|
-
|
|
602
|
+
H("usedLanguageText", t), H(
|
|
598
603
|
"previewTheme",
|
|
599
|
-
|
|
600
|
-
),
|
|
604
|
+
F(() => e.previewTheme)
|
|
605
|
+
), H(
|
|
601
606
|
"customIcon",
|
|
602
|
-
|
|
607
|
+
F(() => e.customIcon)
|
|
603
608
|
);
|
|
604
|
-
},
|
|
605
|
-
|
|
606
|
-
},
|
|
609
|
+
}, kt = (e) => {
|
|
610
|
+
ae(e), H("tabWidth", e.tabWidth);
|
|
611
|
+
}, le = (e) => {
|
|
607
612
|
S(() => {
|
|
608
613
|
var a, l;
|
|
609
614
|
if (!e.noIconfont)
|
|
610
615
|
if (C.iconfontType === "svg") {
|
|
611
616
|
const t = document.createElement("script");
|
|
612
|
-
t.src = ((a = C.editorExtensions) == null ? void 0 : a.iconfont) ||
|
|
617
|
+
t.src = ((a = C.editorExtensions) == null ? void 0 : a.iconfont) || pe, t.id = `${p}-icon`, _(t);
|
|
613
618
|
} else {
|
|
614
619
|
const t = document.createElement("link");
|
|
615
|
-
t.rel = "stylesheet", t.href = ((l = C.editorExtensions) == null ? void 0 : l.iconfontClass) ||
|
|
620
|
+
t.rel = "stylesheet", t.href = ((l = C.editorExtensions) == null ? void 0 : l.iconfontClass) || he, t.id = `${p}-icon-class`, _(t);
|
|
616
621
|
}
|
|
617
622
|
});
|
|
618
|
-
},
|
|
623
|
+
}, $t = (e) => {
|
|
619
624
|
var c, u, s, o, d, b;
|
|
620
625
|
const { noPrettier: a, noUploadImg: l } = e, { editorExtensions: t } = C, n = a || !!((u = (c = C.editorExtensions) == null ? void 0 : c.prettier) != null && u.prettierInstance), r = a || !!((o = (s = C.editorExtensions) == null ? void 0 : s.prettier) != null && o.parserMarkdownInstance), i = l || !!((b = (d = C.editorExtensions) == null ? void 0 : d.cropper) != null && b.instance);
|
|
621
626
|
S(() => {
|
|
622
|
-
var k,
|
|
623
|
-
const
|
|
624
|
-
|
|
627
|
+
var k, y, w, I;
|
|
628
|
+
const v = document.createElement("script"), m = document.createElement("script");
|
|
629
|
+
v.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || G.main, v.id = `${p}-prettier`, m.src = ((y = t == null ? void 0 : t.prettier) == null ? void 0 : y.parserMarkdownJs) || G.markdown, m.id = `${p}-prettierMD`;
|
|
625
630
|
const h = document.createElement("link");
|
|
626
|
-
h.rel = "stylesheet", h.href = ((w = t == null ? void 0 : t.cropper) == null ? void 0 : w.css) ||
|
|
631
|
+
h.rel = "stylesheet", h.href = ((w = t == null ? void 0 : t.cropper) == null ? void 0 : w.css) || D.css, h.id = `${p}-cropperCss`;
|
|
627
632
|
const f = document.createElement("script");
|
|
628
|
-
f.src = ((I = t == null ? void 0 : t.cropper) == null ? void 0 : I.js) ||
|
|
629
|
-
}),
|
|
630
|
-
},
|
|
633
|
+
f.src = ((I = t == null ? void 0 : t.cropper) == null ? void 0 : I.js) || D.js, f.id = `${p}-cropper`, i || (_(h), _(f)), n || _(v), r || _(m);
|
|
634
|
+
}), le(e);
|
|
635
|
+
}, Ct = (e, a) => {
|
|
631
636
|
const { editorId: l } = e;
|
|
632
637
|
S(() => {
|
|
633
638
|
g.on(l, {
|
|
634
|
-
name:
|
|
639
|
+
name: $e,
|
|
635
640
|
callback: (t) => {
|
|
636
641
|
e.onError instanceof Function ? e.onError(t) : a.emit("onError", t);
|
|
637
642
|
}
|
|
638
643
|
});
|
|
639
644
|
});
|
|
640
|
-
},
|
|
641
|
-
const { editorId: l } = e, t =
|
|
645
|
+
}, It = (e, a) => {
|
|
646
|
+
const { editorId: l } = e, t = Y({
|
|
642
647
|
pageFullscreen: e.pageFullscreen,
|
|
643
648
|
fullscreen: !1,
|
|
644
649
|
preview: e.preview,
|
|
@@ -652,10 +657,10 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
652
657
|
};
|
|
653
658
|
return $(() => [t.pageFullscreen, t.fullscreen], i), S(() => {
|
|
654
659
|
g.on(l, {
|
|
655
|
-
name:
|
|
660
|
+
name: Ce,
|
|
656
661
|
callback(c, u) {
|
|
657
662
|
const s = (o) => {
|
|
658
|
-
g.emit(l,
|
|
663
|
+
g.emit(l, ne, "image", {
|
|
659
664
|
desc: "",
|
|
660
665
|
urls: o
|
|
661
666
|
}), u && u();
|
|
@@ -664,47 +669,47 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
664
669
|
}
|
|
665
670
|
}), r = document.body.style.overflow, i();
|
|
666
671
|
}), [t, n];
|
|
667
|
-
},
|
|
672
|
+
}, St = (e) => {
|
|
668
673
|
const { editorId: a } = e, l = B(!1);
|
|
669
674
|
return S(() => {
|
|
670
675
|
g.on(a, {
|
|
671
|
-
name:
|
|
676
|
+
name: te,
|
|
672
677
|
callback: (n) => {
|
|
673
678
|
n === void 0 ? l.value = !l.value : l.value = n;
|
|
674
679
|
}
|
|
675
680
|
});
|
|
676
|
-
}),
|
|
677
|
-
},
|
|
681
|
+
}), F(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
|
|
682
|
+
}, Et = (e, a, l, t, n) => {
|
|
678
683
|
const { editorId: r } = e;
|
|
679
684
|
$(
|
|
680
685
|
() => t.pageFullscreen,
|
|
681
686
|
(c) => {
|
|
682
|
-
g.emit(r,
|
|
687
|
+
g.emit(r, z, c);
|
|
683
688
|
}
|
|
684
689
|
), $(
|
|
685
690
|
() => t.fullscreen,
|
|
686
691
|
(c) => {
|
|
687
|
-
g.emit(r,
|
|
692
|
+
g.emit(r, K, c);
|
|
688
693
|
}
|
|
689
694
|
), $(
|
|
690
695
|
() => t.preview,
|
|
691
696
|
(c) => {
|
|
692
|
-
g.emit(r,
|
|
697
|
+
g.emit(r, q, c);
|
|
693
698
|
}
|
|
694
699
|
), $(
|
|
695
700
|
() => t.htmlPreview,
|
|
696
701
|
(c) => {
|
|
697
|
-
g.emit(r,
|
|
702
|
+
g.emit(r, Z, c);
|
|
698
703
|
}
|
|
699
704
|
), $(l, (c) => {
|
|
700
|
-
g.emit(r,
|
|
705
|
+
g.emit(r, W, c);
|
|
701
706
|
});
|
|
702
707
|
const i = {
|
|
703
708
|
on(c, u) {
|
|
704
709
|
switch (c) {
|
|
705
710
|
case "pageFullscreen": {
|
|
706
711
|
g.on(r, {
|
|
707
|
-
name:
|
|
712
|
+
name: z,
|
|
708
713
|
callback(s) {
|
|
709
714
|
u(s);
|
|
710
715
|
}
|
|
@@ -713,7 +718,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
713
718
|
}
|
|
714
719
|
case "fullscreen": {
|
|
715
720
|
g.on(r, {
|
|
716
|
-
name:
|
|
721
|
+
name: K,
|
|
717
722
|
callback(s) {
|
|
718
723
|
u(s);
|
|
719
724
|
}
|
|
@@ -722,7 +727,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
722
727
|
}
|
|
723
728
|
case "preview": {
|
|
724
729
|
g.on(r, {
|
|
725
|
-
name:
|
|
730
|
+
name: q,
|
|
726
731
|
callback(s) {
|
|
727
732
|
u(s);
|
|
728
733
|
}
|
|
@@ -731,7 +736,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
731
736
|
}
|
|
732
737
|
case "htmlPreview": {
|
|
733
738
|
g.on(r, {
|
|
734
|
-
name:
|
|
739
|
+
name: Z,
|
|
735
740
|
callback(s) {
|
|
736
741
|
u(s);
|
|
737
742
|
}
|
|
@@ -740,7 +745,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
740
745
|
}
|
|
741
746
|
case "catalog": {
|
|
742
747
|
g.on(r, {
|
|
743
|
-
name:
|
|
748
|
+
name: W,
|
|
744
749
|
callback(s) {
|
|
745
750
|
u(s);
|
|
746
751
|
}
|
|
@@ -753,7 +758,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
753
758
|
n("pageFullscreen", c);
|
|
754
759
|
},
|
|
755
760
|
toggleFullscreen(c) {
|
|
756
|
-
g.emit(r,
|
|
761
|
+
g.emit(r, Ie, c);
|
|
757
762
|
},
|
|
758
763
|
togglePreview(c) {
|
|
759
764
|
n("preview", c);
|
|
@@ -762,20 +767,20 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
762
767
|
n("htmlPreview", c);
|
|
763
768
|
},
|
|
764
769
|
toggleCatalog(c) {
|
|
765
|
-
g.emit(r,
|
|
770
|
+
g.emit(r, te, c);
|
|
766
771
|
},
|
|
767
772
|
triggerSave() {
|
|
768
|
-
g.emit(r,
|
|
773
|
+
g.emit(r, ee);
|
|
769
774
|
},
|
|
770
775
|
insert(c) {
|
|
771
|
-
g.emit(r,
|
|
776
|
+
g.emit(r, ne, "universal", { generate: c });
|
|
772
777
|
},
|
|
773
778
|
focus(c) {
|
|
774
|
-
g.emit(r,
|
|
779
|
+
g.emit(r, Se, c);
|
|
775
780
|
}
|
|
776
781
|
};
|
|
777
782
|
a.expose(i);
|
|
778
|
-
},
|
|
783
|
+
}, lt = (e) => e, ie = {
|
|
779
784
|
/**
|
|
780
785
|
* markdown content.
|
|
781
786
|
*
|
|
@@ -831,7 +836,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
831
836
|
*/
|
|
832
837
|
editorId: {
|
|
833
838
|
type: String,
|
|
834
|
-
default:
|
|
839
|
+
default: ge
|
|
835
840
|
},
|
|
836
841
|
/**
|
|
837
842
|
* 预览中代码是否显示行号
|
|
@@ -865,7 +870,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
865
870
|
*/
|
|
866
871
|
mdHeadingId: {
|
|
867
872
|
type: Function,
|
|
868
|
-
default:
|
|
873
|
+
default: lt
|
|
869
874
|
},
|
|
870
875
|
/**
|
|
871
876
|
*
|
|
@@ -959,8 +964,8 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
959
964
|
type: Object,
|
|
960
965
|
default: {}
|
|
961
966
|
}
|
|
962
|
-
},
|
|
963
|
-
...
|
|
967
|
+
}, Pt = {
|
|
968
|
+
...ie,
|
|
964
969
|
/**
|
|
965
970
|
* input回调事件
|
|
966
971
|
*/
|
|
@@ -1024,7 +1029,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
1024
1029
|
*/
|
|
1025
1030
|
toolbars: {
|
|
1026
1031
|
type: Array,
|
|
1027
|
-
default:
|
|
1032
|
+
default: ye
|
|
1028
1033
|
},
|
|
1029
1034
|
/**
|
|
1030
1035
|
* 工具栏选择不显示
|
|
@@ -1088,7 +1093,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
1088
1093
|
*/
|
|
1089
1094
|
footers: {
|
|
1090
1095
|
type: Array,
|
|
1091
|
-
default:
|
|
1096
|
+
default: ve
|
|
1092
1097
|
},
|
|
1093
1098
|
/**
|
|
1094
1099
|
* 是否默认激活输入框和预览框同步滚动
|
|
@@ -1191,9 +1196,12 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
1191
1196
|
*/
|
|
1192
1197
|
onInput: {
|
|
1193
1198
|
type: Function
|
|
1199
|
+
},
|
|
1200
|
+
onDrop: {
|
|
1201
|
+
type: Function
|
|
1194
1202
|
}
|
|
1195
|
-
},
|
|
1196
|
-
...
|
|
1203
|
+
}, ce = ["onHtmlChanged", "onGetCatalog"], Tt = [
|
|
1204
|
+
...ce,
|
|
1197
1205
|
"onChange",
|
|
1198
1206
|
"onSave",
|
|
1199
1207
|
"onUploadImg",
|
|
@@ -1201,11 +1209,12 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
1201
1209
|
"update:modelValue",
|
|
1202
1210
|
"onBlur",
|
|
1203
1211
|
"onFocus",
|
|
1204
|
-
"onInput"
|
|
1205
|
-
|
|
1212
|
+
"onInput",
|
|
1213
|
+
"onDrop"
|
|
1214
|
+
], it = /* @__PURE__ */ Q({
|
|
1206
1215
|
name: "MdPreview",
|
|
1207
|
-
props:
|
|
1208
|
-
emits:
|
|
1216
|
+
props: ie,
|
|
1217
|
+
emits: ce,
|
|
1209
1218
|
setup(e, a) {
|
|
1210
1219
|
const {
|
|
1211
1220
|
editorId: l,
|
|
@@ -1213,13 +1222,13 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
1213
1222
|
noMermaid: n,
|
|
1214
1223
|
noHighlight: r
|
|
1215
1224
|
} = e;
|
|
1216
|
-
return
|
|
1225
|
+
return ae(e), le(e), de(() => {
|
|
1217
1226
|
g.clear(l);
|
|
1218
|
-
}), () =>
|
|
1227
|
+
}), () => A("div", {
|
|
1219
1228
|
id: l,
|
|
1220
1229
|
class: [p, e.class, e.theme === "dark" && `${p}-dark`, `${p}-previewOnly`],
|
|
1221
1230
|
style: e.style
|
|
1222
|
-
}, [
|
|
1231
|
+
}, [A(at, {
|
|
1223
1232
|
modelValue: e.modelValue,
|
|
1224
1233
|
onHtmlChanged: (i) => {
|
|
1225
1234
|
e.onHtmlChanged ? e.onHtmlChanged(i) : a.emit("onHtmlChanged", i);
|
|
@@ -1237,23 +1246,19 @@ const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "p
|
|
|
1237
1246
|
previewOnly: !0
|
|
1238
1247
|
}, null)]);
|
|
1239
1248
|
}
|
|
1240
|
-
}),
|
|
1241
|
-
|
|
1249
|
+
}), x = it;
|
|
1250
|
+
x.install = (e) => (e.component(x.name, x), e);
|
|
1242
1251
|
export {
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
Ye as b,
|
|
1249
|
-
ft as c,
|
|
1252
|
+
at as C,
|
|
1253
|
+
x as M,
|
|
1254
|
+
Tt as a,
|
|
1255
|
+
kt as b,
|
|
1256
|
+
bt as c,
|
|
1250
1257
|
$t as d,
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
wt as k,
|
|
1258
|
-
pt as u
|
|
1258
|
+
Pt as e,
|
|
1259
|
+
Ct as f,
|
|
1260
|
+
It as g,
|
|
1261
|
+
St as h,
|
|
1262
|
+
Et as i,
|
|
1263
|
+
wt as u
|
|
1259
1264
|
};
|