md-editor-v3 4.4.0 → 4.5.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.
- package/README.md +129 -109
- package/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +18 -18
- package/lib/cjs/MdModal.cjs +1 -1
- package/lib/cjs/MdPreview.cjs +1 -1
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/chunks/config.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +6 -6
- package/lib/cjs/chunks/index3.cjs +1 -2
- package/lib/cjs/chunks/index4.cjs +2 -0
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/MdCatalog.mjs +1 -1
- package/lib/es/MdEditor.mjs +967 -1058
- package/lib/es/MdModal.mjs +6 -139
- package/lib/es/MdPreview.mjs +1 -1
- package/lib/es/ModalToolbar.mjs +1 -1
- package/lib/es/chunks/config.mjs +25 -26
- package/lib/es/chunks/index.mjs +230 -204
- package/lib/es/chunks/index3.mjs +163 -61
- package/lib/es/chunks/index4.mjs +69 -0
- package/lib/es/index.mjs +18 -17
- package/lib/preview.css +1 -1
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/Editor.d.ts +10 -1
- package/lib/types/MdEditor/components/Icon/Icon.d.ts +16 -0
- package/lib/types/MdEditor/components/Icon/Str.d.ts +3 -0
- package/lib/types/MdEditor/components/Icon/index.d.ts +16 -0
- package/lib/types/MdEditor/config.d.ts +2 -1
- package/lib/types/MdEditor/index.d.ts +23 -4
- package/lib/types/MdEditor/props.d.ts +15 -1
- package/lib/types/MdEditor/type.d.ts +37 -8
- package/lib/types/MdPreview/MdPreview.d.ts +9 -0
- package/lib/types/MdPreview/index.d.ts +20 -1
- package/lib/umd/index.js +43 -43
- package/package.json +1 -1
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -1,68 +1,78 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import {
|
|
3
|
-
import { u as
|
|
4
|
-
import { a as F, u as
|
|
5
|
-
import
|
|
1
|
+
import { inject as P, onMounted as S, watch as $, toRef as W, nextTick as A, shallowRef as x, ref as B, computed as H, defineComponent as J, createVNode as M, Fragment as ie, reactive as X, provide as _, onBeforeUnmount as ce } from "vue";
|
|
2
|
+
import { a as C, p, m as se, k as N, e as j, h as ue, f as O, i as de, g as me, j as U, l as V, n as fe, b as pe, d as he } from "./config.mjs";
|
|
3
|
+
import { u as ge, g as ve, b as g } from "./index4.mjs";
|
|
4
|
+
import { a as F, u as ye } from "./dom.mjs";
|
|
5
|
+
import be from "medium-zoom";
|
|
6
6
|
import { debounce as Q } from "@vavt/util";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const Y = "onSave", ee = "changeCatalogVisible",
|
|
13
|
-
const l =
|
|
7
|
+
import we from "copy-to-clipboard";
|
|
8
|
+
import ke from "markdown-it";
|
|
9
|
+
import $e from "markdown-it-image-figures";
|
|
10
|
+
import Ce from "markdown-it-task-lists";
|
|
11
|
+
import Ie from "lru-cache";
|
|
12
|
+
const Y = "onSave", ee = "changeCatalogVisible", Se = "changeFullscreen", G = "pageFullscreenChanged", D = "fullscreenChanged", z = "previewChanged", K = "htmlPreviewChanged", q = "catalogVisibleChanged", Ee = "textareaFocus", Pe = (e, a) => {
|
|
13
|
+
const l = P("editorId"), { noImgZoomIn: t } = e, n = Q(() => {
|
|
14
14
|
const r = document.querySelectorAll(`#${l}-preview img`);
|
|
15
|
-
r.length !== 0 &&
|
|
15
|
+
r.length !== 0 && be(r, {
|
|
16
16
|
background: "#00000073"
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
S(() => {
|
|
20
20
|
!t && n();
|
|
21
21
|
}), $([a, W(e.setting, "preview")], () => {
|
|
22
22
|
!t && n();
|
|
23
23
|
});
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
}, Te = Pe, Fe = (e, a) => {
|
|
25
|
+
if (typeof a[e] == "string")
|
|
26
|
+
return a[e];
|
|
27
|
+
const l = `<i class="${p}-iconfont ${p}-icon-${e}"></i>`;
|
|
28
|
+
switch (C.iconfontType) {
|
|
29
|
+
case "svg":
|
|
30
|
+
return `<svg class="${p}-icon" aria-hidden="true"><use xlink:href="#${p}-icon-${e}"></use></svg>`;
|
|
31
|
+
default:
|
|
32
|
+
return l;
|
|
33
|
+
}
|
|
34
|
+
}, _e = (e, a) => {
|
|
35
|
+
const l = P("editorId"), t = P("usedLanguageText"), n = P("customIcon"), r = () => {
|
|
36
|
+
document.querySelectorAll(`#${l}-preview pre`).forEach((u) => {
|
|
37
|
+
var b, y;
|
|
38
|
+
let s = -1;
|
|
39
|
+
(b = u.querySelector(".copy-button")) == null || b.remove();
|
|
40
|
+
const o = ((y = t.value.copyCode) == null ? void 0 : y.text) || "复制代码", d = document.createElement("span");
|
|
41
|
+
d.setAttribute("class", "copy-button"), d.dataset.tips = o, d.innerHTML = Fe("copy", n.value), d.addEventListener("click", () => {
|
|
42
|
+
var v, w;
|
|
43
|
+
clearTimeout(s);
|
|
44
|
+
const m = u.querySelector("code").innerText, h = we(e.formatCopiedText(m)), f = ((v = t.value.copyCode) == null ? void 0 : v.successTips) || "已复制!", k = ((w = t.value.copyCode) == null ? void 0 : w.failTips) || "已复制!";
|
|
45
|
+
d.dataset.tips = h ? f : k, s = window.setTimeout(() => {
|
|
46
|
+
d.dataset.tips = o;
|
|
37
47
|
}, 1500);
|
|
38
|
-
}),
|
|
48
|
+
}), u.appendChild(d);
|
|
39
49
|
});
|
|
40
|
-
},
|
|
41
|
-
A(
|
|
42
|
-
},
|
|
43
|
-
|
|
50
|
+
}, i = () => {
|
|
51
|
+
A(r);
|
|
52
|
+
}, c = (u) => {
|
|
53
|
+
u && A(r);
|
|
44
54
|
};
|
|
45
|
-
$(() => a.value,
|
|
46
|
-
},
|
|
55
|
+
$(() => a.value, i), $(() => e.setting.preview, c), $(() => e.setting.htmlPreview, c), $(() => t.value, r), S(r);
|
|
56
|
+
}, He = _e, Me = (e) => {
|
|
47
57
|
var r;
|
|
48
|
-
const a = (r =
|
|
49
|
-
return
|
|
58
|
+
const a = (r = C.editorExtensions) == null ? void 0 : r.highlight, l = a == null ? void 0 : a.instance, t = P("highlight"), n = x(l);
|
|
59
|
+
return S(() => {
|
|
50
60
|
if (!e.noHighlight && !n.value) {
|
|
51
61
|
const i = document.createElement("script");
|
|
52
62
|
i.src = t.value.js, i.onload = () => {
|
|
53
63
|
n.value = window.hljs;
|
|
54
|
-
}, i.id = `${
|
|
64
|
+
}, i.id = `${p}-hljs`, F(i, "hljs");
|
|
55
65
|
const c = document.createElement("link");
|
|
56
|
-
c.rel = "stylesheet", c.href = t.value.css, c.id = `${
|
|
66
|
+
c.rel = "stylesheet", c.href = t.value.css, c.id = `${p}-hlCss`, F(c);
|
|
57
67
|
}
|
|
58
68
|
}), $(
|
|
59
69
|
() => t.value.css,
|
|
60
70
|
(i) => {
|
|
61
|
-
|
|
71
|
+
ye(`${p}-hlCss`, "href", i);
|
|
62
72
|
}
|
|
63
73
|
), n;
|
|
64
|
-
},
|
|
65
|
-
const a =
|
|
74
|
+
}, xe = Me, Re = (e) => {
|
|
75
|
+
const a = P("theme"), { editorExtensions: l } = C, t = l == null ? void 0 : l.mermaid, n = x(t == null ? void 0 : t.instance), r = x(-1), i = new Ie({
|
|
66
76
|
max: 1e3,
|
|
67
77
|
// 缓存10分钟
|
|
68
78
|
ttl: 6e5
|
|
@@ -78,7 +88,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
78
88
|
() => {
|
|
79
89
|
i.clear(), c();
|
|
80
90
|
}
|
|
81
|
-
),
|
|
91
|
+
), S(() => {
|
|
82
92
|
if (!e.noMermaid && !(t != null && t.instance)) {
|
|
83
93
|
const s = (t == null ? void 0 : t.js) || se;
|
|
84
94
|
if (/\.mjs/.test(s))
|
|
@@ -91,7 +101,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
91
101
|
});
|
|
92
102
|
else {
|
|
93
103
|
const o = document.createElement("script");
|
|
94
|
-
o.id = `${
|
|
104
|
+
o.id = `${p}-mermaid`, o.src = s, o.onload = () => {
|
|
95
105
|
n.value = window.mermaid, c();
|
|
96
106
|
}, F(o, "mermaid");
|
|
97
107
|
}
|
|
@@ -100,58 +110,58 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
100
110
|
A(() => {
|
|
101
111
|
if (!e.noMermaid && n.value) {
|
|
102
112
|
const s = document.querySelectorAll(
|
|
103
|
-
`div.${
|
|
113
|
+
`div.${p}-mermaid`
|
|
104
114
|
), o = document.createElement("div");
|
|
105
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";
|
|
106
|
-
let
|
|
107
|
-
|
|
116
|
+
let d = s.length;
|
|
117
|
+
d > 0 && document.body.appendChild(o), s.forEach(async (b) => {
|
|
108
118
|
let y = i.get(b.innerText);
|
|
109
119
|
if (!y) {
|
|
110
|
-
const
|
|
120
|
+
const h = ge(), f = n.value.renderAsync || n.value.render;
|
|
111
121
|
let k = "";
|
|
112
122
|
try {
|
|
113
|
-
k = await f(
|
|
123
|
+
k = await f(h, b.innerText, o);
|
|
114
124
|
} catch {
|
|
115
125
|
}
|
|
116
126
|
y = typeof k == "string" ? k : k.svg, i.set(b.innerText, y);
|
|
117
127
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
128
|
+
const m = document.createElement("p");
|
|
129
|
+
m.className = `${p}-mermaid`, m.setAttribute("data-processed", ""), m.innerHTML = y, b.dataset.line !== void 0 && (m.dataset.line = b.dataset.line), b.replaceWith(m), --d === 0 && o.remove();
|
|
120
130
|
});
|
|
121
131
|
}
|
|
122
132
|
});
|
|
123
133
|
} };
|
|
124
|
-
},
|
|
134
|
+
}, Ae = Re, Be = (e) => {
|
|
125
135
|
var n;
|
|
126
|
-
const a = (n =
|
|
127
|
-
return
|
|
136
|
+
const a = (n = C.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = x(l);
|
|
137
|
+
return S(() => {
|
|
128
138
|
if (!e.noKatex && !t.value) {
|
|
129
139
|
const r = document.createElement("script");
|
|
130
140
|
r.src = (a == null ? void 0 : a.js) || N.js, r.onload = () => {
|
|
131
141
|
t.value = window.katex;
|
|
132
|
-
}, r.id = `${
|
|
142
|
+
}, r.id = `${p}-katex`;
|
|
133
143
|
const i = document.createElement("link");
|
|
134
|
-
i.rel = "stylesheet", i.href = (a == null ? void 0 : a.css) || N.css, i.id = `${
|
|
144
|
+
i.rel = "stylesheet", i.href = (a == null ? void 0 : a.css) || N.css, i.id = `${p}-katexCss`, F(r, "katex"), F(i);
|
|
135
145
|
}
|
|
136
146
|
}), t;
|
|
137
|
-
},
|
|
147
|
+
}, Le = Be, Ne = (e, a) => {
|
|
138
148
|
const l = e.renderer.rules.fence.bind(e.renderer.rules);
|
|
139
149
|
e.renderer.rules.fence = (t, n, r, i, c) => {
|
|
140
150
|
const u = t[n], s = u.content.trim();
|
|
141
151
|
if (u.info === "mermaid") {
|
|
142
152
|
let o;
|
|
143
|
-
return t[n].map && t[n].level === 0 && (o = t[n].map[0], t[n].attrSet("data-line", String(o))), `<div class="${
|
|
153
|
+
return t[n].map && t[n].level === 0 && (o = t[n].map[0], t[n].attrSet("data-line", String(o))), `<div class="${p}-mermaid" ${o !== void 0 ? "data-line=" + o : ""} data-mermaid-theme=${a.themeRef.value}>${s}</div>`;
|
|
144
154
|
}
|
|
145
155
|
return l(t, n, r, i, c);
|
|
146
156
|
};
|
|
147
|
-
},
|
|
157
|
+
}, je = Ne, Z = (e, a) => {
|
|
148
158
|
let l = !0, t = !0;
|
|
149
159
|
const n = e.posMax, r = a > 0 ? e.src.charCodeAt(a - 1) : -1, i = a + 1 <= n ? e.src.charCodeAt(a + 1) : -1;
|
|
150
160
|
return (r === 32 || r === 9 || i >= 48 && i <= 57) && (t = !1), (i === 32 || i === 9) && (l = !1), {
|
|
151
161
|
can_open: l,
|
|
152
162
|
can_close: t
|
|
153
163
|
};
|
|
154
|
-
},
|
|
164
|
+
}, Oe = (e, a) => {
|
|
155
165
|
let l, t, n, r;
|
|
156
166
|
if (e.src[e.pos] !== "$")
|
|
157
167
|
return !1;
|
|
@@ -166,7 +176,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
166
176
|
l += 1;
|
|
167
177
|
}
|
|
168
178
|
return l === -1 ? (a || (e.pending += "$"), e.pos = i, !0) : l - i === 0 ? (a || (e.pending += "$$"), e.pos = i + 1, !0) : (n = Z(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));
|
|
169
|
-
},
|
|
179
|
+
}, Ue = (e, a, l, t) => {
|
|
170
180
|
let n, r, i, c, u = !1, s = e.bMarks[a] + e.tShift[a], o = e.eMarks[a];
|
|
171
181
|
if (s + 2 > o || e.src.slice(s, s + 2) !== "$$")
|
|
172
182
|
return !1;
|
|
@@ -175,79 +185,79 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
175
185
|
for (n.trim().slice(-2) === "$$" && (n = n.trim().slice(0, -2), u = !0), i = a; !u && (i++, !(i >= l || (s = e.bMarks[i] + e.tShift[i], o = e.eMarks[i], s < o && e.tShift[i] < e.blkIndent))); )
|
|
176
186
|
e.src.slice(s, o).trim().slice(-2) === "$$" && (c = e.src.slice(0, o).lastIndexOf("$$"), r = e.src.slice(s, c), u = !0);
|
|
177
187
|
e.line = i + 1;
|
|
178
|
-
const
|
|
179
|
-
return
|
|
180
|
-
` : "") + e.getLines(a + 1, i, e.tShift[a], !0) + (r && r.trim() ? r : ""),
|
|
181
|
-
},
|
|
188
|
+
const d = e.push("math_block", "math", 0);
|
|
189
|
+
return d.block = !0, d.content = (n && n.trim() ? n + `
|
|
190
|
+
` : "") + e.getLines(a + 1, i, e.tShift[a], !0) + (r && r.trim() ? r : ""), d.map = [a, e.line], d.markup = "$$", !0;
|
|
191
|
+
}, Ve = (e, a) => {
|
|
182
192
|
const l = (n) => {
|
|
183
193
|
if (a.katexRef.value) {
|
|
184
194
|
const r = a.katexRef.value.renderToString(n, {
|
|
185
195
|
throwOnError: !1
|
|
186
196
|
});
|
|
187
|
-
return `<span class="${
|
|
197
|
+
return `<span class="${p}-katex-inline" data-processed>${r}</span>`;
|
|
188
198
|
} else
|
|
189
|
-
return `<span class="${
|
|
199
|
+
return `<span class="${p}-katex-inline">${n}</span>`;
|
|
190
200
|
}, t = (n, r) => {
|
|
191
201
|
if (a.katexRef.value) {
|
|
192
202
|
const i = a.katexRef.value.renderToString(n, {
|
|
193
203
|
throwOnError: !1,
|
|
194
204
|
displayMode: !0
|
|
195
205
|
});
|
|
196
|
-
return `<p class="${
|
|
206
|
+
return `<p class="${p}-katex-block" data-line=${r} data-processed>${i}</p>`;
|
|
197
207
|
} else
|
|
198
|
-
return `<p class="${
|
|
208
|
+
return `<p class="${p}-katex-block" data-line=${r}>${n}</p>`;
|
|
199
209
|
};
|
|
200
|
-
e.inline.ruler.after("escape", "math_inline",
|
|
210
|
+
e.inline.ruler.after("escape", "math_inline", Oe), e.block.ruler.after("blockquote", "math_block", Ue, {
|
|
201
211
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
202
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]) + `
|
|
203
213
|
`;
|
|
204
|
-
},
|
|
214
|
+
}, Ge = Ve, De = (e, a) => {
|
|
205
215
|
a = a || {};
|
|
206
216
|
const l = 3, t = a.marker || "!", n = t.charCodeAt(0), r = t.length;
|
|
207
217
|
let i = "", c = "";
|
|
208
|
-
const u = (o,
|
|
209
|
-
const
|
|
210
|
-
return
|
|
218
|
+
const u = (o, d, b, y, m) => {
|
|
219
|
+
const h = o[d];
|
|
220
|
+
return h.type === "admonition_open" ? (o[d].attrPush([
|
|
211
221
|
"class",
|
|
212
|
-
`${
|
|
213
|
-
]), o[
|
|
222
|
+
`${p}-admonition ${p}-admonition-${h.info}`
|
|
223
|
+
]), o[d].attrSet("data-line", String(o[d].map[0]))) : h.type === "admonition_title_open" && o[d].attrPush(["class", `${p}-admonition-title`]), m.renderToken(o, d, b);
|
|
214
224
|
}, s = (o) => {
|
|
215
|
-
const
|
|
216
|
-
c = "", i =
|
|
225
|
+
const d = o.trim().split(" ", 2);
|
|
226
|
+
c = "", i = d[0], d.length > 1 && (c = o.substring(i.length + 2)), (c === "" || !c) && (c = i);
|
|
217
227
|
};
|
|
218
228
|
e.block.ruler.before(
|
|
219
229
|
"code",
|
|
220
230
|
"admonition",
|
|
221
|
-
(o,
|
|
222
|
-
let
|
|
231
|
+
(o, d, b, y) => {
|
|
232
|
+
let m, h, f, k = !1, v = o.bMarks[d] + o.tShift[d], w = o.eMarks[d];
|
|
223
233
|
if (n !== o.src.charCodeAt(v))
|
|
224
234
|
return !1;
|
|
225
|
-
for (
|
|
235
|
+
for (m = v + 1; m <= w && t[(m - v) % r] === o.src[m]; m++)
|
|
226
236
|
;
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
237
|
+
const I = Math.floor((m - v) / r);
|
|
238
|
+
if (I !== l)
|
|
229
239
|
return !1;
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
if (s(
|
|
240
|
+
m -= (m - v) % r;
|
|
241
|
+
const E = o.src.slice(v, m), T = o.src.slice(m, w);
|
|
242
|
+
if (s(T), y)
|
|
233
243
|
return !0;
|
|
234
|
-
for (
|
|
235
|
-
if (n === o.src.charCodeAt(v) && !(o.sCount[
|
|
236
|
-
for (
|
|
244
|
+
for (h = d; h++, !(h >= b || (v = o.bMarks[h] + o.tShift[h], w = o.eMarks[h], v < w && o.sCount[h] < o.blkIndent)); )
|
|
245
|
+
if (n === o.src.charCodeAt(v) && !(o.sCount[h] - o.blkIndent >= 4)) {
|
|
246
|
+
for (m = v + 1; m <= w && t[(m - v) % r] === o.src[m]; m++)
|
|
237
247
|
;
|
|
238
|
-
if (!(Math.floor((
|
|
248
|
+
if (!(Math.floor((m - v) / r) < I) && (m -= (m - v) % r, m = o.skipSpaces(m), !(m < w))) {
|
|
239
249
|
k = !0;
|
|
240
250
|
break;
|
|
241
251
|
}
|
|
242
252
|
}
|
|
243
253
|
const L = o.parentType, le = o.lineMax;
|
|
244
|
-
return o.parentType = "root", 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(v, m), f.block = !0, o.parentType = L, o.lineMax = le, o.line = h + (k ? 1 : 0), !0;
|
|
245
255
|
},
|
|
246
256
|
{
|
|
247
257
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
248
258
|
}
|
|
249
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;
|
|
250
|
-
},
|
|
260
|
+
}, ze = De, Ke = (e, a) => {
|
|
251
261
|
e.renderer.rules.heading_open = (l, t) => {
|
|
252
262
|
const n = l[t], r = l[t + 1].content, i = n.markup.length;
|
|
253
263
|
return a.headsRef.value.push({
|
|
@@ -258,37 +268,37 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
258
268
|
a.mdHeadingId(r, i, a.headsRef.value.length)
|
|
259
269
|
)), e.renderer.renderToken(l, t, a);
|
|
260
270
|
}, e.renderer.rules.heading_close = (l, t, n, r, i) => i.renderToken(l, t, n);
|
|
261
|
-
},
|
|
271
|
+
}, qe = Ke, Ze = (e, a) => {
|
|
262
272
|
const l = e.renderer.rules.fence, t = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/;
|
|
263
273
|
function r(s) {
|
|
264
274
|
return s.info ? t(s.info).trim() : "";
|
|
265
275
|
}
|
|
266
276
|
function i(s) {
|
|
267
|
-
const o = r(s), [
|
|
268
|
-
return [
|
|
277
|
+
const o = r(s), [d = null, b = ""] = (n.exec(o) || []).slice(1);
|
|
278
|
+
return [d, b];
|
|
269
279
|
}
|
|
270
280
|
function c(s) {
|
|
271
281
|
const o = r(s);
|
|
272
282
|
return o ? o.split(/(\s+)/g)[0] : "";
|
|
273
283
|
}
|
|
274
|
-
const u = (s, o,
|
|
284
|
+
const u = (s, o, d, b, y) => {
|
|
275
285
|
if (s[o].hidden)
|
|
276
286
|
return "";
|
|
277
|
-
const [
|
|
278
|
-
if (
|
|
279
|
-
return l(s, o,
|
|
280
|
-
let f, k, v, w,
|
|
281
|
-
for (let
|
|
282
|
-
f.info = f.info.replace(n, ""), f.hidden = !0, w =
|
|
283
|
-
`,
|
|
284
|
-
` + l(s,
|
|
287
|
+
const [m, h] = i(s[o]);
|
|
288
|
+
if (m === null)
|
|
289
|
+
return l(s, o, d, b, y);
|
|
290
|
+
let f, k, v, w, I = "", E = "";
|
|
291
|
+
for (let T = o; T < s.length && (f = s[T], [k, v] = 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()">${v || c(f)}</label></li>
|
|
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, y);
|
|
285
295
|
return `<div class="code-tabs">
|
|
286
296
|
<ul>
|
|
287
|
-
` +
|
|
288
|
-
` +
|
|
297
|
+
` + I + `</ul>
|
|
298
|
+
` + E + "</div>";
|
|
289
299
|
};
|
|
290
300
|
e.renderer.rules.fence = u;
|
|
291
|
-
},
|
|
301
|
+
}, We = Ze, Je = (e) => {
|
|
292
302
|
[
|
|
293
303
|
"paragraph_open",
|
|
294
304
|
"table_open",
|
|
@@ -309,80 +319,80 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
309
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);
|
|
310
320
|
};
|
|
311
321
|
});
|
|
312
|
-
},
|
|
313
|
-
const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } =
|
|
322
|
+
}, Xe = (e, a) => {
|
|
323
|
+
const { editorConfig: l, markdownItConfig: t, markdownItPlugins: n } = C, r = P("editorId"), i = P("showCodeRowNumber"), c = P("theme"), u = B([]), s = xe(e), o = Le(e), { reRenderRef: d, replaceMermaid: b } = Ae(e), y = ke({
|
|
314
324
|
html: !0,
|
|
315
325
|
breaks: !0
|
|
316
326
|
});
|
|
317
327
|
t(y);
|
|
318
|
-
const
|
|
328
|
+
const m = [
|
|
319
329
|
{
|
|
320
330
|
type: "katex",
|
|
321
|
-
plugin:
|
|
331
|
+
plugin: Ge,
|
|
322
332
|
options: { katexRef: o }
|
|
323
333
|
},
|
|
324
334
|
{
|
|
325
335
|
type: "image",
|
|
326
|
-
plugin:
|
|
336
|
+
plugin: $e,
|
|
327
337
|
options: { figcaption: !0, classes: "md-zoom" }
|
|
328
338
|
},
|
|
329
339
|
{
|
|
330
340
|
type: "admonition",
|
|
331
|
-
plugin:
|
|
341
|
+
plugin: ze,
|
|
332
342
|
options: {}
|
|
333
343
|
},
|
|
334
344
|
{
|
|
335
345
|
type: "taskList",
|
|
336
|
-
plugin:
|
|
346
|
+
plugin: Ce,
|
|
337
347
|
options: {}
|
|
338
348
|
},
|
|
339
349
|
{
|
|
340
350
|
type: "heading",
|
|
341
|
-
plugin:
|
|
351
|
+
plugin: qe,
|
|
342
352
|
options: { mdHeadingId: e.mdHeadingId, headsRef: u }
|
|
343
353
|
},
|
|
344
354
|
{
|
|
345
355
|
type: "codeTabs",
|
|
346
|
-
plugin:
|
|
356
|
+
plugin: We,
|
|
347
357
|
options: { editorId: r }
|
|
348
358
|
}
|
|
349
359
|
];
|
|
350
|
-
e.noMermaid ||
|
|
360
|
+
e.noMermaid || m.push({
|
|
351
361
|
type: "mermaid",
|
|
352
|
-
plugin:
|
|
362
|
+
plugin: je,
|
|
353
363
|
options: { themeRef: c }
|
|
354
|
-
}), n(
|
|
364
|
+
}), n(m).forEach((w) => {
|
|
355
365
|
y.use(w.plugin, w.options);
|
|
356
366
|
}), y.set({
|
|
357
|
-
highlight: (w,
|
|
358
|
-
let
|
|
359
|
-
!e.noHighlight && s.value ? s.value.getLanguage(
|
|
360
|
-
language:
|
|
367
|
+
highlight: (w, I) => {
|
|
368
|
+
let E;
|
|
369
|
+
!e.noHighlight && s.value ? s.value.getLanguage(I) ? E = s.value.highlight(w, {
|
|
370
|
+
language: I,
|
|
361
371
|
ignoreIllegals: !0
|
|
362
|
-
}).value :
|
|
363
|
-
const
|
|
364
|
-
return `<pre><code class="language-${
|
|
372
|
+
}).value : E = s.value.highlightAuto(w).value : E = y.utils.escapeHtml(w);
|
|
373
|
+
const T = i ? ve(E.trim()) : `<span class="code-block">${E.trim()}</span>`;
|
|
374
|
+
return `<pre><code class="language-${I}" language=${I}>${T}</code></pre>`;
|
|
365
375
|
}
|
|
366
|
-
}),
|
|
367
|
-
const
|
|
368
|
-
g.emit(r, "buildFinished",
|
|
376
|
+
}), Je(y);
|
|
377
|
+
const h = B(e.sanitize(y.render(e.modelValue))), f = () => {
|
|
378
|
+
g.emit(r, "buildFinished", h.value), e.onHtmlChanged(h.value), e.onGetCatalog(u.value), g.emit(r, "catalogChanged", u.value), b();
|
|
369
379
|
};
|
|
370
|
-
|
|
380
|
+
S(f);
|
|
371
381
|
const k = Q(
|
|
372
382
|
async () => {
|
|
373
|
-
u.value = [],
|
|
383
|
+
u.value = [], h.value = e.sanitize(y.render(e.modelValue)), f();
|
|
374
384
|
},
|
|
375
385
|
(l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
|
|
376
|
-
), v =
|
|
377
|
-
return $([W(e, "modelValue"), v,
|
|
386
|
+
), v = H(() => (e.noKatex || o.value) && (e.noHighlight || s.value));
|
|
387
|
+
return $([W(e, "modelValue"), v, d], k), S(() => {
|
|
378
388
|
g.on(r, {
|
|
379
389
|
name: "pushCatalog",
|
|
380
390
|
callback() {
|
|
381
391
|
g.emit(r, "catalogChanged", u.value);
|
|
382
392
|
}
|
|
383
393
|
});
|
|
384
|
-
}), { html:
|
|
385
|
-
},
|
|
394
|
+
}), { html: h };
|
|
395
|
+
}, Qe = Xe, te = {
|
|
386
396
|
modelValue: {
|
|
387
397
|
type: String,
|
|
388
398
|
default: ""
|
|
@@ -433,7 +443,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
433
443
|
noImgZoomIn: {
|
|
434
444
|
type: Boolean
|
|
435
445
|
}
|
|
436
|
-
},
|
|
446
|
+
}, ft = {
|
|
437
447
|
...te,
|
|
438
448
|
onChange: {
|
|
439
449
|
type: Function,
|
|
@@ -494,32 +504,32 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
494
504
|
onInput: {
|
|
495
505
|
type: Function
|
|
496
506
|
}
|
|
497
|
-
},
|
|
507
|
+
}, Ye = /* @__PURE__ */ J({
|
|
498
508
|
name: "ContentPreview",
|
|
499
509
|
props: te,
|
|
500
510
|
setup(e) {
|
|
501
|
-
const a =
|
|
511
|
+
const a = P("editorId"), l = P("previewTheme"), t = P("showCodeRowNumber"), {
|
|
502
512
|
html: n
|
|
503
|
-
} =
|
|
504
|
-
return
|
|
513
|
+
} = Qe(e, e.previewOnly);
|
|
514
|
+
return He(e, n), Te(e, n), () => M(ie, null, [M("div", {
|
|
505
515
|
id: `${a}-preview-wrapper`,
|
|
506
|
-
class: `${
|
|
516
|
+
class: `${p}-preview-wrapper`,
|
|
507
517
|
"data-show": e.setting.preview,
|
|
508
518
|
key: "content-preview-wrapper"
|
|
509
|
-
}, [
|
|
519
|
+
}, [M("article", {
|
|
510
520
|
id: `${a}-preview`,
|
|
511
|
-
class: [`${
|
|
521
|
+
class: [`${p}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${p}-scrn`],
|
|
512
522
|
innerHTML: n.value
|
|
513
|
-
}, null)]), !e.previewOnly &&
|
|
523
|
+
}, null)]), !e.previewOnly && M("div", {
|
|
514
524
|
id: `${a}-html-wrapper`,
|
|
515
|
-
class: `${
|
|
525
|
+
class: `${p}-preview-wrapper`,
|
|
516
526
|
"data-show": e.setting.htmlPreview,
|
|
517
527
|
key: "html-preview-wrapper"
|
|
518
|
-
}, [
|
|
519
|
-
class: `${
|
|
528
|
+
}, [M("div", {
|
|
529
|
+
class: `${p}-html`
|
|
520
530
|
}, [n.value])])]);
|
|
521
531
|
}
|
|
522
|
-
}),
|
|
532
|
+
}), pt = (e, a) => {
|
|
523
533
|
const { editorId: l } = e, t = X({
|
|
524
534
|
// 是否已编译成html
|
|
525
535
|
buildFinished: !1,
|
|
@@ -531,7 +541,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
531
541
|
() => {
|
|
532
542
|
t.buildFinished = !1;
|
|
533
543
|
}
|
|
534
|
-
),
|
|
544
|
+
), S(() => {
|
|
535
545
|
g.on(l, {
|
|
536
546
|
name: "buildFinished",
|
|
537
547
|
callback(n) {
|
|
@@ -559,13 +569,13 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
559
569
|
});
|
|
560
570
|
}, ne = (e) => {
|
|
561
571
|
var n, r;
|
|
562
|
-
const { editorId: a } = e, l = (r = (n =
|
|
572
|
+
const { editorId: a } = e, l = (r = (n = C) == null ? void 0 : n.editorExtensions) == null ? void 0 : r.highlight;
|
|
563
573
|
_("editorId", a), _(
|
|
564
574
|
"theme",
|
|
565
|
-
|
|
575
|
+
H(() => e.theme)
|
|
566
576
|
), _(
|
|
567
577
|
"highlight",
|
|
568
|
-
|
|
578
|
+
H(() => {
|
|
569
579
|
const i = {
|
|
570
580
|
...j,
|
|
571
581
|
...l == null ? void 0 : l.css
|
|
@@ -576,41 +586,50 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
576
586
|
};
|
|
577
587
|
})
|
|
578
588
|
), _("showCodeRowNumber", e.showCodeRowNumber);
|
|
579
|
-
const t =
|
|
589
|
+
const t = H(() => {
|
|
580
590
|
var c, u;
|
|
581
591
|
const i = {
|
|
582
592
|
...O,
|
|
583
|
-
...(u = (c =
|
|
593
|
+
...(u = (c = C) == null ? void 0 : c.editorConfig) == null ? void 0 : u.languageUserDefined
|
|
584
594
|
};
|
|
585
595
|
return i[e.language] ? i[e.language] : O["zh-CN"];
|
|
586
596
|
});
|
|
587
597
|
_("usedLanguageText", t), _(
|
|
588
598
|
"previewTheme",
|
|
589
|
-
|
|
599
|
+
H(() => e.previewTheme)
|
|
600
|
+
), _(
|
|
601
|
+
"customIcon",
|
|
602
|
+
H(() => e.customIcon)
|
|
590
603
|
);
|
|
591
|
-
},
|
|
604
|
+
}, ht = (e) => {
|
|
592
605
|
ne(e), _("tabWidth", e.tabWidth);
|
|
593
606
|
}, oe = (e) => {
|
|
594
|
-
|
|
595
|
-
var l;
|
|
596
|
-
|
|
597
|
-
|
|
607
|
+
S(() => {
|
|
608
|
+
var a, l;
|
|
609
|
+
if (!e.noIconfont)
|
|
610
|
+
if (C.iconfontType === "svg") {
|
|
611
|
+
const t = document.createElement("script");
|
|
612
|
+
t.src = ((a = C.editorExtensions) == null ? void 0 : a.iconfont) || de, t.id = `${p}-icon`, F(t);
|
|
613
|
+
} else {
|
|
614
|
+
const t = document.createElement("link");
|
|
615
|
+
t.rel = "stylesheet", t.href = ((l = C.editorExtensions) == null ? void 0 : l.iconfontClass) || me, t.id = `${p}-icon-class`, F(t);
|
|
616
|
+
}
|
|
598
617
|
});
|
|
599
|
-
},
|
|
600
|
-
var c, u, s, o,
|
|
601
|
-
const { noPrettier: a, noUploadImg: l } = e, { editorExtensions: t } =
|
|
602
|
-
|
|
603
|
-
var k, v, w,
|
|
604
|
-
const y = document.createElement("script"),
|
|
605
|
-
y.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) ||
|
|
606
|
-
const
|
|
607
|
-
|
|
618
|
+
}, gt = (e) => {
|
|
619
|
+
var c, u, s, o, d, b;
|
|
620
|
+
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
|
+
S(() => {
|
|
622
|
+
var k, v, w, I;
|
|
623
|
+
const y = document.createElement("script"), m = document.createElement("script");
|
|
624
|
+
y.src = ((k = t == null ? void 0 : t.prettier) == null ? void 0 : k.standaloneJs) || U.main, y.id = `${p}-prettier`, m.src = ((v = t == null ? void 0 : t.prettier) == null ? void 0 : v.parserMarkdownJs) || U.markdown, m.id = `${p}-prettierMD`;
|
|
625
|
+
const h = document.createElement("link");
|
|
626
|
+
h.rel = "stylesheet", h.href = ((w = t == null ? void 0 : t.cropper) == null ? void 0 : w.css) || V.css, h.id = `${p}-cropperCss`;
|
|
608
627
|
const f = document.createElement("script");
|
|
609
|
-
f.src = ((
|
|
628
|
+
f.src = ((I = t == null ? void 0 : t.cropper) == null ? void 0 : I.js) || V.js, f.id = `${p}-cropper`, i || (F(h), F(f)), n || F(y), r || F(m);
|
|
610
629
|
}), oe(e);
|
|
611
|
-
},
|
|
630
|
+
}, vt = (e, a) => {
|
|
612
631
|
const { editorId: l } = e;
|
|
613
|
-
|
|
632
|
+
S(() => {
|
|
614
633
|
g.on(l, {
|
|
615
634
|
name: "errorCatcher",
|
|
616
635
|
callback: (t) => {
|
|
@@ -618,7 +637,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
618
637
|
}
|
|
619
638
|
});
|
|
620
639
|
});
|
|
621
|
-
},
|
|
640
|
+
}, yt = (e, a) => {
|
|
622
641
|
const { editorId: l } = e, t = X({
|
|
623
642
|
pageFullscreen: e.pageFullscreen,
|
|
624
643
|
fullscreen: !1,
|
|
@@ -631,7 +650,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
631
650
|
const i = () => {
|
|
632
651
|
t.pageFullscreen || t.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = r;
|
|
633
652
|
};
|
|
634
|
-
return $(() => [t.pageFullscreen, t.fullscreen], i),
|
|
653
|
+
return $(() => [t.pageFullscreen, t.fullscreen], i), S(() => {
|
|
635
654
|
g.on(l, {
|
|
636
655
|
name: "uploadImage",
|
|
637
656
|
callback(c, u) {
|
|
@@ -645,17 +664,17 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
645
664
|
}
|
|
646
665
|
}), r = document.body.style.overflow, i();
|
|
647
666
|
}), [t, n];
|
|
648
|
-
},
|
|
667
|
+
}, bt = (e) => {
|
|
649
668
|
const { editorId: a } = e, l = B(!1);
|
|
650
|
-
return
|
|
669
|
+
return S(() => {
|
|
651
670
|
g.on(a, {
|
|
652
671
|
name: ee,
|
|
653
672
|
callback: (n) => {
|
|
654
673
|
n === void 0 ? l.value = !l.value : l.value = n;
|
|
655
674
|
}
|
|
656
675
|
});
|
|
657
|
-
}),
|
|
658
|
-
},
|
|
676
|
+
}), H(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
|
|
677
|
+
}, wt = (e, a, l, t, n) => {
|
|
659
678
|
const { editorId: r } = e;
|
|
660
679
|
$(
|
|
661
680
|
() => t.pageFullscreen,
|
|
@@ -734,7 +753,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
734
753
|
n("pageFullscreen", c);
|
|
735
754
|
},
|
|
736
755
|
toggleFullscreen(c) {
|
|
737
|
-
g.emit(r,
|
|
756
|
+
g.emit(r, Se, c);
|
|
738
757
|
},
|
|
739
758
|
togglePreview(c) {
|
|
740
759
|
n("preview", c);
|
|
@@ -752,11 +771,11 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
752
771
|
g.emit(r, "replace", "universal", { generate: c });
|
|
753
772
|
},
|
|
754
773
|
focus(c) {
|
|
755
|
-
g.emit(r,
|
|
774
|
+
g.emit(r, Ee, c);
|
|
756
775
|
}
|
|
757
776
|
};
|
|
758
777
|
a.expose(i);
|
|
759
|
-
},
|
|
778
|
+
}, et = (e) => e, re = {
|
|
760
779
|
/**
|
|
761
780
|
* markdown content.
|
|
762
781
|
*
|
|
@@ -812,7 +831,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
812
831
|
*/
|
|
813
832
|
editorId: {
|
|
814
833
|
type: String,
|
|
815
|
-
default:
|
|
834
|
+
default: fe
|
|
816
835
|
},
|
|
817
836
|
/**
|
|
818
837
|
* 预览中代码是否显示行号
|
|
@@ -846,7 +865,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
846
865
|
*/
|
|
847
866
|
mdHeadingId: {
|
|
848
867
|
type: Function,
|
|
849
|
-
default:
|
|
868
|
+
default: et
|
|
850
869
|
},
|
|
851
870
|
/**
|
|
852
871
|
*
|
|
@@ -932,8 +951,15 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
932
951
|
noImgZoomIn: {
|
|
933
952
|
type: Boolean,
|
|
934
953
|
default: !1
|
|
954
|
+
},
|
|
955
|
+
/**
|
|
956
|
+
* 自定义的图标
|
|
957
|
+
*/
|
|
958
|
+
customIcon: {
|
|
959
|
+
type: Object,
|
|
960
|
+
default: {}
|
|
935
961
|
}
|
|
936
|
-
},
|
|
962
|
+
}, kt = {
|
|
937
963
|
...re,
|
|
938
964
|
/**
|
|
939
965
|
* input回调事件
|
|
@@ -998,7 +1024,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
998
1024
|
*/
|
|
999
1025
|
toolbars: {
|
|
1000
1026
|
type: Array,
|
|
1001
|
-
default:
|
|
1027
|
+
default: pe
|
|
1002
1028
|
},
|
|
1003
1029
|
/**
|
|
1004
1030
|
* 工具栏选择不显示
|
|
@@ -1062,7 +1088,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
1062
1088
|
*/
|
|
1063
1089
|
footers: {
|
|
1064
1090
|
type: Array,
|
|
1065
|
-
default:
|
|
1091
|
+
default: he
|
|
1066
1092
|
},
|
|
1067
1093
|
/**
|
|
1068
1094
|
* 是否默认激活输入框和预览框同步滚动
|
|
@@ -1166,7 +1192,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
1166
1192
|
onInput: {
|
|
1167
1193
|
type: Function
|
|
1168
1194
|
}
|
|
1169
|
-
}, ae = ["onHtmlChanged", "onGetCatalog"],
|
|
1195
|
+
}, ae = ["onHtmlChanged", "onGetCatalog"], $t = [
|
|
1170
1196
|
...ae,
|
|
1171
1197
|
"onChange",
|
|
1172
1198
|
"onSave",
|
|
@@ -1176,7 +1202,7 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
1176
1202
|
"onBlur",
|
|
1177
1203
|
"onFocus",
|
|
1178
1204
|
"onInput"
|
|
1179
|
-
],
|
|
1205
|
+
], tt = /* @__PURE__ */ J({
|
|
1180
1206
|
name: "MdPreview",
|
|
1181
1207
|
props: re,
|
|
1182
1208
|
emits: ae,
|
|
@@ -1189,11 +1215,11 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
1189
1215
|
} = e;
|
|
1190
1216
|
return ne(e), oe(e), ce(() => {
|
|
1191
1217
|
g.clear(l);
|
|
1192
|
-
}), () =>
|
|
1218
|
+
}), () => M("div", {
|
|
1193
1219
|
id: l,
|
|
1194
|
-
class: [
|
|
1220
|
+
class: [p, e.class, e.theme === "dark" && `${p}-dark`, `${p}-previewOnly`],
|
|
1195
1221
|
style: e.style
|
|
1196
|
-
}, [
|
|
1222
|
+
}, [M(Ye, {
|
|
1197
1223
|
modelValue: e.modelValue,
|
|
1198
1224
|
onHtmlChanged: (i) => {
|
|
1199
1225
|
e.onHtmlChanged ? e.onHtmlChanged(i) : a.emit("onHtmlChanged", i);
|
|
@@ -1211,23 +1237,23 @@ const Y = "onSave", ee = "changeCatalogVisible", Ie = "changeFullscreen", G = "p
|
|
|
1211
1237
|
previewOnly: !0
|
|
1212
1238
|
}, null)]);
|
|
1213
1239
|
}
|
|
1214
|
-
}), R =
|
|
1240
|
+
}), R = tt;
|
|
1215
1241
|
R.install = (e) => (e.component(R.name, R), e);
|
|
1216
1242
|
export {
|
|
1217
|
-
|
|
1243
|
+
Se as C,
|
|
1218
1244
|
R as M,
|
|
1219
1245
|
Y as O,
|
|
1220
|
-
|
|
1246
|
+
Ee as T,
|
|
1221
1247
|
ee as a,
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1248
|
+
Ye as b,
|
|
1249
|
+
ft as c,
|
|
1250
|
+
$t as d,
|
|
1251
|
+
kt as e,
|
|
1252
|
+
ht as f,
|
|
1253
|
+
gt as g,
|
|
1254
|
+
vt as h,
|
|
1255
|
+
yt as i,
|
|
1256
|
+
bt as j,
|
|
1257
|
+
wt as k,
|
|
1258
|
+
pt as u
|
|
1233
1259
|
};
|