md-editor-v3 6.0.1 → 6.1.0-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/lib/cjs/chunks/dom.cjs +1 -1
- package/lib/cjs/chunks/index3.cjs +39 -39
- package/lib/es/chunks/dom.mjs +132 -92
- package/lib/es/chunks/index3.mjs +375 -383
- package/lib/preview.css +1 -1
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/type.d.ts +1 -0
- package/lib/types/MdEditor/utils/dom.d.ts +6 -0
- package/package.json +2 -2
package/lib/es/chunks/index3.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useId as
|
|
2
|
-
import { deepMerge as
|
|
3
|
-
import { p as h, g as R, f as
|
|
4
|
-
import { b as v, U as
|
|
5
|
-
import { a as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { g as
|
|
12
|
-
import { LRUCache as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
1
|
+
import { useId as Fe, provide as E, computed as x, reactive as le, watch as w, onMounted as F, ref as U, inject as b, nextTick as G, shallowRef as te, onBeforeUnmount as ne, toRef as Ae, defineComponent as ce, createVNode as N, Fragment as Re } from "vue";
|
|
2
|
+
import { deepMerge as He, deepClone as Pe, randomId as ie, debounce as Me } from "@vavt/util";
|
|
3
|
+
import { p as h, g as R, f as ue, s as me, b as Le, a as _e } from "./config.mjs";
|
|
4
|
+
import { b as v, U as Ne, C as ke, B as X, O as Ee, E as Q, P as fe, F as he, f as pe, g as ge, H as ve, h as ye, R as se, e as Oe, i as de, d as je, j as ae, k as Be, T as De } from "./event-bus.mjs";
|
|
5
|
+
import { a as L, u as Ve, S as Ue, c as Ge, z as ze } from "./dom.mjs";
|
|
6
|
+
import We from "@vavt/copy2clipboard";
|
|
7
|
+
import qe from "markdown-it";
|
|
8
|
+
import Ke from "markdown-it-image-figures";
|
|
9
|
+
import Ze from "markdown-it-sub";
|
|
10
|
+
import Je from "markdown-it-sup";
|
|
11
|
+
import { g as Xe } from "./index5.mjs";
|
|
12
|
+
import { LRUCache as Ye } from "lru-cache";
|
|
13
|
+
import Qe from "medium-zoom";
|
|
14
|
+
const M = {
|
|
15
15
|
hljs: `${h}-hljs`,
|
|
16
16
|
hlcss: `${h}-hlCss`,
|
|
17
17
|
prettier: `${h}-prettier`,
|
|
@@ -24,8 +24,8 @@ const P = {
|
|
|
24
24
|
katexjs: `${h}-katex`,
|
|
25
25
|
katexcss: `${h}-katexCss`,
|
|
26
26
|
echarts: `${h}-echarts`
|
|
27
|
-
},
|
|
28
|
-
const { editorId: o } = r, n =
|
|
27
|
+
}, Zt = (e, t, r) => {
|
|
28
|
+
const { editorId: o } = r, n = le({
|
|
29
29
|
// 是否已编译成html
|
|
30
30
|
buildFinished: !1,
|
|
31
31
|
// 存储当前最新的html
|
|
@@ -36,24 +36,24 @@ const P = {
|
|
|
36
36
|
() => {
|
|
37
37
|
n.buildFinished = !1;
|
|
38
38
|
}
|
|
39
|
-
),
|
|
39
|
+
), F(() => {
|
|
40
40
|
v.on(o, {
|
|
41
|
-
name:
|
|
41
|
+
name: X,
|
|
42
42
|
callback(m) {
|
|
43
43
|
n.buildFinished = !0, n.html = m;
|
|
44
44
|
}
|
|
45
45
|
}), v.on(o, {
|
|
46
|
-
name:
|
|
46
|
+
name: Ee,
|
|
47
47
|
callback() {
|
|
48
48
|
const m = new Promise((s) => {
|
|
49
49
|
if (n.buildFinished)
|
|
50
50
|
s(n.html);
|
|
51
51
|
else {
|
|
52
52
|
const d = (i) => {
|
|
53
|
-
s(i), v.remove(o,
|
|
53
|
+
s(i), v.remove(o, X, d);
|
|
54
54
|
};
|
|
55
55
|
v.on(o, {
|
|
56
|
-
name:
|
|
56
|
+
name: X,
|
|
57
57
|
callback: d
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -68,19 +68,19 @@ const P = {
|
|
|
68
68
|
setting: o
|
|
69
69
|
}) => {
|
|
70
70
|
const n = R.editorExtensions.highlight, m = R.editorExtensionsAttrs.highlight;
|
|
71
|
-
|
|
71
|
+
E("editorId", t), E("rootRef", r), E(
|
|
72
72
|
"theme",
|
|
73
|
-
|
|
74
|
-
),
|
|
73
|
+
x(() => e.theme)
|
|
74
|
+
), E(
|
|
75
75
|
"language",
|
|
76
|
-
|
|
77
|
-
),
|
|
76
|
+
x(() => e.language)
|
|
77
|
+
), E(
|
|
78
78
|
"highlight",
|
|
79
|
-
|
|
79
|
+
x(() => {
|
|
80
80
|
const { js: d } = n, i = {
|
|
81
|
-
...
|
|
81
|
+
...ue,
|
|
82
82
|
...n.css
|
|
83
|
-
}, { js: u, css: l = {} } = m || {}, a = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, c = i[e.codeTheme] ? i[e.codeTheme][a] :
|
|
83
|
+
}, { js: u, css: l = {} } = m || {}, a = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, c = i[e.codeTheme] ? i[e.codeTheme][a] : ue.atom[a], p = i[e.codeTheme] && l[e.codeTheme] ? l[e.codeTheme][a] : l.atom ? l.atom[a] : {};
|
|
84
84
|
return {
|
|
85
85
|
js: {
|
|
86
86
|
src: d,
|
|
@@ -92,26 +92,26 @@ const P = {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
})
|
|
95
|
-
),
|
|
96
|
-
const s =
|
|
95
|
+
), E("showCodeRowNumber", e.showCodeRowNumber);
|
|
96
|
+
const s = x(() => {
|
|
97
97
|
const d = {
|
|
98
|
-
...
|
|
98
|
+
...me,
|
|
99
99
|
...R.editorConfig.languageUserDefined
|
|
100
100
|
};
|
|
101
|
-
return
|
|
102
|
-
|
|
101
|
+
return He(
|
|
102
|
+
Pe(me["en-US"]),
|
|
103
103
|
d[e.language] || {}
|
|
104
104
|
);
|
|
105
105
|
});
|
|
106
|
-
return
|
|
106
|
+
return E("usedLanguageText", s), E(
|
|
107
107
|
"previewTheme",
|
|
108
|
-
|
|
109
|
-
),
|
|
108
|
+
x(() => e.previewTheme)
|
|
109
|
+
), E(
|
|
110
110
|
"customIcon",
|
|
111
|
-
|
|
112
|
-
),
|
|
111
|
+
x(() => e.customIcon)
|
|
112
|
+
), E(
|
|
113
113
|
"setting",
|
|
114
|
-
|
|
114
|
+
x(() => o ? {
|
|
115
115
|
// setting是reactive,不转化是可以直接赋值的
|
|
116
116
|
...o
|
|
117
117
|
} : {
|
|
@@ -122,75 +122,75 @@ const P = {
|
|
|
122
122
|
fullscreen: !1
|
|
123
123
|
})
|
|
124
124
|
), { editorId: t };
|
|
125
|
-
},
|
|
125
|
+
}, Jt = (e, t) => (E("tabWidth", e.tabWidth), E(
|
|
126
126
|
"disabled",
|
|
127
|
-
|
|
128
|
-
),
|
|
127
|
+
x(() => e.disabled)
|
|
128
|
+
), E(
|
|
129
129
|
"showToolbarName",
|
|
130
|
-
|
|
131
|
-
),
|
|
130
|
+
x(() => e.showToolbarName)
|
|
131
|
+
), E("noUploadImg", e.noUploadImg), E(
|
|
132
132
|
"tableShape",
|
|
133
|
-
|
|
134
|
-
),
|
|
133
|
+
x(() => e.tableShape)
|
|
134
|
+
), E("noPrettier", e.noPrettier), E(
|
|
135
135
|
"codeTheme",
|
|
136
|
-
|
|
137
|
-
),
|
|
136
|
+
x(() => e.codeTheme)
|
|
137
|
+
), E("updateSetting", t.updateSetting), E(
|
|
138
138
|
"catalogVisible",
|
|
139
|
-
|
|
140
|
-
),
|
|
139
|
+
x(() => t.catalogVisible.value)
|
|
140
|
+
), E("defToolbars", t.defToolbars), E(
|
|
141
141
|
"floatingToolbars",
|
|
142
|
-
|
|
143
|
-
), Ie(e, t)),
|
|
142
|
+
x(() => e.floatingToolbars)
|
|
143
|
+
), Ie(e, t)), Xt = (e) => {
|
|
144
144
|
const { noPrettier: t, noUploadImg: r } = e, { editorExtensions: o, editorExtensionsAttrs: n } = R, m = t || o.prettier.prettierInstance, s = t || o.prettier.parserMarkdownInstance, d = r || o.cropper.instance;
|
|
145
|
-
|
|
145
|
+
F(() => {
|
|
146
146
|
if (!d) {
|
|
147
147
|
const { js: i = {}, css: u = {} } = n.cropper || {};
|
|
148
|
-
|
|
148
|
+
L("link", {
|
|
149
149
|
...u,
|
|
150
150
|
rel: "stylesheet",
|
|
151
151
|
href: o.cropper.css,
|
|
152
|
-
id:
|
|
153
|
-
}),
|
|
152
|
+
id: M.croppercss
|
|
153
|
+
}), L("script", {
|
|
154
154
|
...i,
|
|
155
155
|
src: o.cropper.js,
|
|
156
|
-
id:
|
|
156
|
+
id: M.cropperjs
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
if (!m) {
|
|
160
160
|
const { standaloneJs: i = {} } = n.prettier || {};
|
|
161
|
-
|
|
161
|
+
L("script", {
|
|
162
162
|
...i,
|
|
163
163
|
src: o.prettier.standaloneJs,
|
|
164
|
-
id:
|
|
164
|
+
id: M.prettier
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
if (!s) {
|
|
168
168
|
const { parserMarkdownJs: i = {} } = n.prettier || {};
|
|
169
|
-
|
|
169
|
+
L("script", {
|
|
170
170
|
...i,
|
|
171
171
|
src: o.prettier.parserMarkdownJs,
|
|
172
|
-
id:
|
|
172
|
+
id: M.prettierMD
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
},
|
|
176
|
+
}, Yt = (e, t, r) => {
|
|
177
177
|
const { editorId: o } = r;
|
|
178
|
-
|
|
178
|
+
F(() => {
|
|
179
179
|
v.on(o, {
|
|
180
|
-
name:
|
|
180
|
+
name: Q,
|
|
181
181
|
callback: (n) => {
|
|
182
182
|
e.onError?.(n), t.emit("onError", n);
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
|
-
},
|
|
187
|
-
const { editorId: o } = r, n =
|
|
186
|
+
}, Qt = (e, t, r) => {
|
|
187
|
+
const { editorId: o } = r, n = le({
|
|
188
188
|
pageFullscreen: e.pageFullscreen,
|
|
189
189
|
fullscreen: !1,
|
|
190
190
|
preview: e.preview,
|
|
191
191
|
htmlPreview: e.preview ? !1 : e.htmlPreview,
|
|
192
192
|
previewOnly: !1
|
|
193
|
-
}), m =
|
|
193
|
+
}), m = le({ ...n }), s = (u, l) => {
|
|
194
194
|
const a = l === void 0 ? !n[u] : l;
|
|
195
195
|
switch (u) {
|
|
196
196
|
case "preview": {
|
|
@@ -212,12 +212,12 @@ const P = {
|
|
|
212
212
|
const i = () => {
|
|
213
213
|
n.pageFullscreen || n.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = d;
|
|
214
214
|
};
|
|
215
|
-
return w(() => [n.pageFullscreen, n.fullscreen], i),
|
|
215
|
+
return w(() => [n.pageFullscreen, n.fullscreen], i), F(() => {
|
|
216
216
|
v.on(o, {
|
|
217
|
-
name:
|
|
217
|
+
name: Ne,
|
|
218
218
|
callback(u, l) {
|
|
219
219
|
const a = (c) => {
|
|
220
|
-
v.emit(o,
|
|
220
|
+
v.emit(o, se, "image", {
|
|
221
221
|
desc: "",
|
|
222
222
|
urls: c
|
|
223
223
|
}), l?.();
|
|
@@ -226,9 +226,9 @@ const P = {
|
|
|
226
226
|
}
|
|
227
227
|
}), d = document.body.style.overflow, i();
|
|
228
228
|
}), [n, s];
|
|
229
|
-
},
|
|
230
|
-
const { editorId: r } = t, o =
|
|
231
|
-
return
|
|
229
|
+
}, en = (e, t) => {
|
|
230
|
+
const { editorId: r } = t, o = U(!1);
|
|
231
|
+
return F(() => {
|
|
232
232
|
v.on(r, {
|
|
233
233
|
name: ke,
|
|
234
234
|
callback: (n) => {
|
|
@@ -236,42 +236,42 @@ const P = {
|
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
238
|
}), o;
|
|
239
|
-
},
|
|
239
|
+
}, tn = (e, t, r) => {
|
|
240
240
|
const { editorId: o, catalogVisible: n, setting: m, updateSetting: s, codeRef: d } = r;
|
|
241
241
|
w(
|
|
242
242
|
() => m.pageFullscreen,
|
|
243
243
|
(u) => {
|
|
244
|
-
v.emit(o,
|
|
244
|
+
v.emit(o, fe, u);
|
|
245
245
|
}
|
|
246
246
|
), w(
|
|
247
247
|
() => m.fullscreen,
|
|
248
248
|
(u) => {
|
|
249
|
-
v.emit(o,
|
|
249
|
+
v.emit(o, he, u);
|
|
250
250
|
}
|
|
251
251
|
), w(
|
|
252
252
|
() => m.preview,
|
|
253
253
|
(u) => {
|
|
254
|
-
v.emit(o,
|
|
254
|
+
v.emit(o, pe, u);
|
|
255
255
|
}
|
|
256
256
|
), w(
|
|
257
257
|
() => m.previewOnly,
|
|
258
258
|
(u) => {
|
|
259
|
-
v.emit(o,
|
|
259
|
+
v.emit(o, ge, u);
|
|
260
260
|
}
|
|
261
261
|
), w(
|
|
262
262
|
() => m.htmlPreview,
|
|
263
263
|
(u) => {
|
|
264
|
-
v.emit(o,
|
|
264
|
+
v.emit(o, ve, u);
|
|
265
265
|
}
|
|
266
266
|
), w(n, (u) => {
|
|
267
|
-
v.emit(o,
|
|
267
|
+
v.emit(o, ye, u);
|
|
268
268
|
});
|
|
269
269
|
const i = {
|
|
270
270
|
on(u, l) {
|
|
271
271
|
switch (u) {
|
|
272
272
|
case "pageFullscreen": {
|
|
273
273
|
v.on(o, {
|
|
274
|
-
name:
|
|
274
|
+
name: fe,
|
|
275
275
|
callback(a) {
|
|
276
276
|
l(a);
|
|
277
277
|
}
|
|
@@ -280,7 +280,7 @@ const P = {
|
|
|
280
280
|
}
|
|
281
281
|
case "fullscreen": {
|
|
282
282
|
v.on(o, {
|
|
283
|
-
name:
|
|
283
|
+
name: he,
|
|
284
284
|
callback(a) {
|
|
285
285
|
l(a);
|
|
286
286
|
}
|
|
@@ -289,7 +289,7 @@ const P = {
|
|
|
289
289
|
}
|
|
290
290
|
case "preview": {
|
|
291
291
|
v.on(o, {
|
|
292
|
-
name:
|
|
292
|
+
name: pe,
|
|
293
293
|
callback(a) {
|
|
294
294
|
l(a);
|
|
295
295
|
}
|
|
@@ -298,7 +298,7 @@ const P = {
|
|
|
298
298
|
}
|
|
299
299
|
case "previewOnly": {
|
|
300
300
|
v.on(o, {
|
|
301
|
-
name:
|
|
301
|
+
name: ge,
|
|
302
302
|
callback(a) {
|
|
303
303
|
l(a);
|
|
304
304
|
}
|
|
@@ -307,7 +307,7 @@ const P = {
|
|
|
307
307
|
}
|
|
308
308
|
case "htmlPreview": {
|
|
309
309
|
v.on(o, {
|
|
310
|
-
name:
|
|
310
|
+
name: ve,
|
|
311
311
|
callback(a) {
|
|
312
312
|
l(a);
|
|
313
313
|
}
|
|
@@ -316,7 +316,7 @@ const P = {
|
|
|
316
316
|
}
|
|
317
317
|
case "catalog": {
|
|
318
318
|
v.on(o, {
|
|
319
|
-
name:
|
|
319
|
+
name: ye,
|
|
320
320
|
callback(a) {
|
|
321
321
|
l(a);
|
|
322
322
|
}
|
|
@@ -329,7 +329,7 @@ const P = {
|
|
|
329
329
|
s("pageFullscreen", u);
|
|
330
330
|
},
|
|
331
331
|
toggleFullscreen(u) {
|
|
332
|
-
v.emit(o,
|
|
332
|
+
v.emit(o, je, u);
|
|
333
333
|
},
|
|
334
334
|
togglePreview(u) {
|
|
335
335
|
s("preview", u);
|
|
@@ -344,16 +344,16 @@ const P = {
|
|
|
344
344
|
v.emit(o, ke, u);
|
|
345
345
|
},
|
|
346
346
|
triggerSave() {
|
|
347
|
-
v.emit(o,
|
|
347
|
+
v.emit(o, Ee);
|
|
348
348
|
},
|
|
349
349
|
insert(u) {
|
|
350
|
-
v.emit(o,
|
|
350
|
+
v.emit(o, se, "universal", { generate: u });
|
|
351
351
|
},
|
|
352
352
|
focus(u) {
|
|
353
353
|
d.value?.focus(u);
|
|
354
354
|
},
|
|
355
355
|
rerender() {
|
|
356
|
-
v.emit(o,
|
|
356
|
+
v.emit(o, de);
|
|
357
357
|
},
|
|
358
358
|
getSelectedText() {
|
|
359
359
|
return d.value?.getSelectedText();
|
|
@@ -362,20 +362,20 @@ const P = {
|
|
|
362
362
|
d.value?.resetHistory();
|
|
363
363
|
},
|
|
364
364
|
domEventHandlers(u) {
|
|
365
|
-
v.emit(o,
|
|
365
|
+
v.emit(o, Oe, u);
|
|
366
366
|
},
|
|
367
367
|
execCommand(u) {
|
|
368
|
-
v.emit(o,
|
|
368
|
+
v.emit(o, se, u);
|
|
369
369
|
},
|
|
370
370
|
getEditorView() {
|
|
371
371
|
return d.value?.getEditorView();
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
374
|
t.expose(i);
|
|
375
|
-
},
|
|
376
|
-
const t =
|
|
375
|
+
}, et = (e) => {
|
|
376
|
+
const t = Fe();
|
|
377
377
|
return e.id || e.editorId || `${h}-${t}`;
|
|
378
|
-
},
|
|
378
|
+
}, tt = (e, t, r) => {
|
|
379
379
|
const o = b("editorId"), n = b("rootRef"), m = b("usedLanguageText"), s = b("setting"), d = () => {
|
|
380
380
|
n.value.querySelectorAll(`#${o} .${h}-preview .${h}-code`).forEach((l) => {
|
|
381
381
|
let a = -1;
|
|
@@ -384,27 +384,27 @@ const P = {
|
|
|
384
384
|
);
|
|
385
385
|
c && (c.onclick = (p) => {
|
|
386
386
|
p.preventDefault(), clearTimeout(a);
|
|
387
|
-
const g = (l.querySelector("input:checked + pre code") || l.querySelector("pre code")).textContent, { text: y, successTips:
|
|
388
|
-
let
|
|
389
|
-
|
|
390
|
-
|
|
387
|
+
const g = (l.querySelector("input:checked + pre code") || l.querySelector("pre code")).textContent, { text: y, successTips: A, failTips: $ } = m.value.copyCode;
|
|
388
|
+
let I = A;
|
|
389
|
+
We(e.formatCopiedText(g || "")).catch(() => {
|
|
390
|
+
I = $;
|
|
391
391
|
}).finally(() => {
|
|
392
|
-
c.dataset.isIcon ? c.dataset.tips =
|
|
392
|
+
c.dataset.isIcon ? c.dataset.tips = I : c.innerHTML = I, a = window.setTimeout(() => {
|
|
393
393
|
c.dataset.isIcon ? c.dataset.tips = y : c.innerHTML = y;
|
|
394
394
|
}, 1500);
|
|
395
395
|
});
|
|
396
396
|
});
|
|
397
397
|
});
|
|
398
398
|
}, i = () => {
|
|
399
|
-
|
|
399
|
+
G(d);
|
|
400
400
|
}, u = (l) => {
|
|
401
|
-
l &&
|
|
401
|
+
l && G(d);
|
|
402
402
|
};
|
|
403
|
-
w([t, r], i), w(() => s.value.preview, u), w(() => s.value.htmlPreview, u),
|
|
404
|
-
},
|
|
403
|
+
w([t, r], i), w(() => s.value.preview, u), w(() => s.value.htmlPreview, u), F(d);
|
|
404
|
+
}, nt = (e) => {
|
|
405
405
|
const t = b("editorId"), r = b("theme"), o = b("rootRef"), { editorExtensions: n, editorExtensionsAttrs: m } = R;
|
|
406
406
|
let s = n.echarts.instance;
|
|
407
|
-
const d =
|
|
407
|
+
const d = te(-1), i = () => {
|
|
408
408
|
!e.noEcharts && s && (d.value = d.value + 1);
|
|
409
409
|
};
|
|
410
410
|
w(
|
|
@@ -412,16 +412,16 @@ const P = {
|
|
|
412
412
|
() => {
|
|
413
413
|
i();
|
|
414
414
|
}
|
|
415
|
-
),
|
|
415
|
+
), F(() => {
|
|
416
416
|
if (e.noEcharts || s)
|
|
417
417
|
return;
|
|
418
418
|
const f = n.echarts.js;
|
|
419
|
-
|
|
419
|
+
L(
|
|
420
420
|
"script",
|
|
421
421
|
{
|
|
422
422
|
...m.echarts?.js,
|
|
423
423
|
src: f,
|
|
424
|
-
id:
|
|
424
|
+
id: M.echarts,
|
|
425
425
|
onload() {
|
|
426
426
|
s = window.echarts, i();
|
|
427
427
|
}
|
|
@@ -447,12 +447,12 @@ const P = {
|
|
|
447
447
|
try {
|
|
448
448
|
const g = new Function(`return ${f.innerText}`)(), y = s.init(f, r.value);
|
|
449
449
|
y.setOption(g), f.setAttribute("data-processed", ""), l.push(y);
|
|
450
|
-
const
|
|
450
|
+
const A = new ResizeObserver(() => {
|
|
451
451
|
y.resize();
|
|
452
452
|
});
|
|
453
|
-
|
|
453
|
+
A.observe(f), a.push(A);
|
|
454
454
|
} catch (g) {
|
|
455
|
-
v.emit(t,
|
|
455
|
+
v.emit(t, Q, {
|
|
456
456
|
name: "echarts",
|
|
457
457
|
message: g?.message,
|
|
458
458
|
error: g
|
|
@@ -460,21 +460,21 @@ const P = {
|
|
|
460
460
|
}
|
|
461
461
|
}));
|
|
462
462
|
};
|
|
463
|
-
return
|
|
463
|
+
return ne(() => {
|
|
464
464
|
c();
|
|
465
465
|
}), { reRenderEcharts: d, replaceEcharts: p };
|
|
466
|
-
},
|
|
467
|
-
const t = b("highlight"), r =
|
|
468
|
-
return
|
|
469
|
-
e.noHighlight || r.value || (
|
|
466
|
+
}, ot = (e) => {
|
|
467
|
+
const t = b("highlight"), r = te(R.editorExtensions.highlight.instance);
|
|
468
|
+
return F(() => {
|
|
469
|
+
e.noHighlight || r.value || (L("link", {
|
|
470
470
|
...t.value.css,
|
|
471
471
|
rel: "stylesheet",
|
|
472
|
-
id:
|
|
473
|
-
}),
|
|
472
|
+
id: M.hlcss
|
|
473
|
+
}), L(
|
|
474
474
|
"script",
|
|
475
475
|
{
|
|
476
476
|
...t.value.js,
|
|
477
|
-
id:
|
|
477
|
+
id: M.hljs,
|
|
478
478
|
onload() {
|
|
479
479
|
r.value = window.hljs;
|
|
480
480
|
}
|
|
@@ -484,45 +484,45 @@ const P = {
|
|
|
484
484
|
}), w(
|
|
485
485
|
() => t.value.css,
|
|
486
486
|
() => {
|
|
487
|
-
e.noHighlight || R.editorExtensions.highlight.instance ||
|
|
487
|
+
e.noHighlight || R.editorExtensions.highlight.instance || Ve("link", {
|
|
488
488
|
...t.value.css,
|
|
489
489
|
rel: "stylesheet",
|
|
490
|
-
id:
|
|
490
|
+
id: M.hlcss
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
493
|
), r;
|
|
494
|
-
},
|
|
495
|
-
const t =
|
|
496
|
-
return
|
|
494
|
+
}, at = (e) => {
|
|
495
|
+
const t = te(R.editorExtensions.katex.instance);
|
|
496
|
+
return F(() => {
|
|
497
497
|
if (e.noKatex || t.value)
|
|
498
498
|
return;
|
|
499
499
|
const { editorExtensions: r, editorExtensionsAttrs: o } = R;
|
|
500
|
-
|
|
500
|
+
L(
|
|
501
501
|
"script",
|
|
502
502
|
{
|
|
503
503
|
...o.katex?.js,
|
|
504
504
|
src: r.katex.js,
|
|
505
|
-
id:
|
|
505
|
+
id: M.katexjs,
|
|
506
506
|
onload() {
|
|
507
507
|
t.value = window.katex;
|
|
508
508
|
}
|
|
509
509
|
},
|
|
510
510
|
"katex"
|
|
511
|
-
),
|
|
511
|
+
), L("link", {
|
|
512
512
|
...o.katex?.css,
|
|
513
513
|
rel: "stylesheet",
|
|
514
514
|
href: r.katex.css,
|
|
515
|
-
id:
|
|
515
|
+
id: M.katexcss
|
|
516
516
|
});
|
|
517
517
|
}), t;
|
|
518
|
-
},
|
|
518
|
+
}, Y = new Ye({
|
|
519
519
|
max: 1e3,
|
|
520
520
|
// 缓存10分钟
|
|
521
521
|
ttl: 6e5
|
|
522
|
-
}),
|
|
522
|
+
}), rt = (e) => {
|
|
523
523
|
const t = b("editorId"), r = b("theme"), o = b("rootRef"), { editorExtensions: n, editorExtensionsAttrs: m, mermaidConfig: s } = R;
|
|
524
524
|
let d = n.mermaid.instance;
|
|
525
|
-
const i =
|
|
525
|
+
const i = te(-1), u = () => {
|
|
526
526
|
!e.noMermaid && d && (d.initialize(
|
|
527
527
|
s({
|
|
528
528
|
startOnLoad: !1,
|
|
@@ -533,17 +533,17 @@ const P = {
|
|
|
533
533
|
return w(
|
|
534
534
|
() => r.value,
|
|
535
535
|
() => {
|
|
536
|
-
|
|
536
|
+
Y.clear(), u();
|
|
537
537
|
}
|
|
538
|
-
),
|
|
538
|
+
), F(() => {
|
|
539
539
|
if (e.noMermaid || d)
|
|
540
540
|
return;
|
|
541
541
|
const a = n.mermaid.js;
|
|
542
|
-
/\.mjs/.test(a) ? (
|
|
542
|
+
/\.mjs/.test(a) ? (L("link", {
|
|
543
543
|
...m.mermaid?.js,
|
|
544
544
|
rel: "modulepreload",
|
|
545
545
|
href: a,
|
|
546
|
-
id:
|
|
546
|
+
id: M.mermaidM
|
|
547
547
|
}), import(
|
|
548
548
|
/* @vite-ignore */
|
|
549
549
|
/* webpackIgnore: true */
|
|
@@ -551,17 +551,17 @@ const P = {
|
|
|
551
551
|
).then((c) => {
|
|
552
552
|
d = c.default, u();
|
|
553
553
|
}).catch((c) => {
|
|
554
|
-
v.emit(t,
|
|
554
|
+
v.emit(t, Q, {
|
|
555
555
|
name: "mermaid",
|
|
556
556
|
message: `Failed to load mermaid module: ${c.message}`,
|
|
557
557
|
error: c
|
|
558
558
|
});
|
|
559
|
-
})) :
|
|
559
|
+
})) : L(
|
|
560
560
|
"script",
|
|
561
561
|
{
|
|
562
562
|
...m.mermaid?.js,
|
|
563
563
|
src: a,
|
|
564
|
-
id:
|
|
564
|
+
id: M.mermaid,
|
|
565
565
|
onload() {
|
|
566
566
|
d = window.mermaid, u();
|
|
567
567
|
}
|
|
@@ -579,20 +579,20 @@ const P = {
|
|
|
579
579
|
Array.from(a).map((y) => (async ($) => {
|
|
580
580
|
if ($.dataset.closed === "false")
|
|
581
581
|
return !1;
|
|
582
|
-
const
|
|
583
|
-
let
|
|
584
|
-
if (!
|
|
585
|
-
const
|
|
586
|
-
let
|
|
582
|
+
const I = $.innerText;
|
|
583
|
+
let H = Y.get(I);
|
|
584
|
+
if (!H) {
|
|
585
|
+
const C = ie();
|
|
586
|
+
let P = { svg: "" };
|
|
587
587
|
try {
|
|
588
|
-
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
} catch (
|
|
592
|
-
v.emit(t,
|
|
588
|
+
P = await d.render(C, I, c), H = await e.sanitizeMermaid(P.svg);
|
|
589
|
+
const T = document.createElement("p");
|
|
590
|
+
T.className = `${h}-mermaid`, T.setAttribute("data-processed", ""), T.setAttribute("data-content", I), T.innerHTML = H, T.children[0]?.removeAttribute("height"), Y.set(I, T.innerHTML), $.dataset.line !== void 0 && (T.dataset.line = $.dataset.line), $.replaceWith(T);
|
|
591
|
+
} catch (T) {
|
|
592
|
+
v.emit(t, Q, {
|
|
593
593
|
name: "mermaid",
|
|
594
|
-
message:
|
|
595
|
-
error:
|
|
594
|
+
message: T.message,
|
|
595
|
+
error: T
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
--g === 0 && c.remove();
|
|
@@ -601,7 +601,7 @@ const P = {
|
|
|
601
601
|
);
|
|
602
602
|
}
|
|
603
603
|
} };
|
|
604
|
-
},
|
|
604
|
+
}, lt = (e, t) => {
|
|
605
605
|
t = t || {};
|
|
606
606
|
const r = 3, o = t.marker || "!", n = o.charCodeAt(0), m = o.length;
|
|
607
607
|
let s = "", d = "";
|
|
@@ -619,41 +619,41 @@ const P = {
|
|
|
619
619
|
"code",
|
|
620
620
|
"admonition",
|
|
621
621
|
(l, a, c, p) => {
|
|
622
|
-
let f, g, y,
|
|
622
|
+
let f, g, y, A = !1, $ = l.bMarks[a] + l.tShift[a], I = l.eMarks[a];
|
|
623
623
|
if (n !== l.src.charCodeAt($))
|
|
624
624
|
return !1;
|
|
625
|
-
for (f = $ + 1; f <=
|
|
625
|
+
for (f = $ + 1; f <= I && o[(f - $) % m] === l.src[f]; f++)
|
|
626
626
|
;
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
627
|
+
const H = Math.floor((f - $) / m);
|
|
628
|
+
if (H !== r)
|
|
629
629
|
return !1;
|
|
630
630
|
f -= (f - $) % m;
|
|
631
|
-
const
|
|
632
|
-
if (u(
|
|
631
|
+
const C = l.src.slice($, f), P = l.src.slice(f, I);
|
|
632
|
+
if (u(P), p)
|
|
633
633
|
return !0;
|
|
634
|
-
for (g = a; g++, !(g >= c || ($ = l.bMarks[g] + l.tShift[g],
|
|
634
|
+
for (g = a; g++, !(g >= c || ($ = l.bMarks[g] + l.tShift[g], I = l.eMarks[g], $ < I && l.sCount[g] < l.blkIndent)); )
|
|
635
635
|
if (n === l.src.charCodeAt($) && !(l.sCount[g] - l.blkIndent >= 4)) {
|
|
636
|
-
for (f = $ + 1; f <=
|
|
636
|
+
for (f = $ + 1; f <= I && o[(f - $) % m] === l.src[f]; f++)
|
|
637
637
|
;
|
|
638
|
-
if (!(Math.floor((f - $) / m) <
|
|
639
|
-
|
|
638
|
+
if (!(Math.floor((f - $) / m) < H) && (f -= (f - $) % m, f = l.skipSpaces(f), !(f < I))) {
|
|
639
|
+
A = !0;
|
|
640
640
|
break;
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
const
|
|
644
|
-
return l.parentType = "root", l.lineMax = g, y = l.push("admonition_open", "div", 1), y.markup =
|
|
643
|
+
const T = l.parentType, _ = l.lineMax;
|
|
644
|
+
return l.parentType = "root", l.lineMax = g, y = l.push("admonition_open", "div", 1), y.markup = C, y.block = !0, y.info = s, y.map = [a, g], d && (y = l.push("admonition_title_open", "p", 1), y.markup = C + " " + s, y.map = [a, g], y = l.push("inline", "", 0), y.content = d, y.map = [a, l.line - 1], y.children = [], y = l.push("admonition_title_close", "p", -1), y.markup = C + " " + s), l.md.block.tokenize(l, a + 1, g), y = l.push("admonition_close", "div", -1), y.markup = l.src.slice($, f), y.block = !0, l.parentType = T, l.lineMax = _, l.line = g + (A ? 1 : 0), !0;
|
|
645
645
|
},
|
|
646
646
|
{
|
|
647
647
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
648
648
|
}
|
|
649
649
|
), e.renderer.rules.admonition_open = i, e.renderer.rules.admonition_title_open = i, e.renderer.rules.admonition_title_close = i, e.renderer.rules.admonition_close = i;
|
|
650
|
-
},
|
|
650
|
+
}, ee = (e, t) => {
|
|
651
651
|
const r = e.attrs ? e.attrs.slice() : [];
|
|
652
652
|
return t.forEach((o) => {
|
|
653
653
|
const n = e.attrIndex(o[0]);
|
|
654
654
|
n < 0 ? r.push(o) : (r[n] = r[n].slice(), r[n][1] += ` ${o[1]}`);
|
|
655
655
|
}), r;
|
|
656
|
-
},
|
|
656
|
+
}, it = (e, t) => {
|
|
657
657
|
const r = e.renderer.rules.fence, o = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/, m = /::(open|close)/, s = (a) => a.info ? o(a.info).trim() : "", d = (a) => {
|
|
658
658
|
const c = s(a), [p = null, f = ""] = (n.exec(c) || []).slice(1);
|
|
659
659
|
return [p, f];
|
|
@@ -667,91 +667,91 @@ const P = {
|
|
|
667
667
|
}, l = (a, c, p, f, g) => {
|
|
668
668
|
if (a[c].hidden)
|
|
669
669
|
return "";
|
|
670
|
-
const y = t.usedLanguageTextRef.value?.copyCode.text,
|
|
671
|
-
if (
|
|
672
|
-
const { open:
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
attrs:
|
|
670
|
+
const y = t.usedLanguageTextRef.value?.copyCode.text, A = t.customIconRef.value.copy || y, $ = !!t.customIconRef.value.copy, I = `<span class="${h}-collapse-tips">${Ue("collapse-tips", t.customIconRef.value)}</span>`, [H] = d(a[c]);
|
|
671
|
+
if (H === null) {
|
|
672
|
+
const { open: k, tagContainer: S, tagHeader: J } = u(a[c]), j = [["class", `${h}-code`]];
|
|
673
|
+
k && j.push(["open", ""]);
|
|
674
|
+
const oe = {
|
|
675
|
+
attrs: ee(a[c], j)
|
|
676
676
|
};
|
|
677
677
|
a[c].info = a[c].info.replace(m, "");
|
|
678
|
-
const
|
|
678
|
+
const W = r(a, c, p, f, g);
|
|
679
679
|
return `
|
|
680
|
-
<${
|
|
681
|
-
<${
|
|
680
|
+
<${S} ${g.renderAttrs(oe)}>
|
|
681
|
+
<${J} class="${h}-code-head">
|
|
682
682
|
<div class="${h}-code-flag"><span></span><span></span><span></span></div>
|
|
683
683
|
<div class="${h}-code-action">
|
|
684
684
|
<span class="${h}-code-lang">${e.utils.escapeHtml(a[c].info.trim())}</span>
|
|
685
|
-
<span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${
|
|
685
|
+
<span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${A}</span>
|
|
686
686
|
${t.extraTools instanceof Function ? t.extraTools({ lang: a[c].info.trim() }) : t.extraTools || ""}
|
|
687
|
-
${
|
|
687
|
+
${S === "details" ? I : ""}
|
|
688
688
|
</div>
|
|
689
|
-
</${
|
|
690
|
-
${
|
|
691
|
-
</${
|
|
689
|
+
</${J}>
|
|
690
|
+
${W}
|
|
691
|
+
</${S}>
|
|
692
692
|
`;
|
|
693
693
|
}
|
|
694
|
-
let
|
|
695
|
-
const { open:
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
attrs:
|
|
694
|
+
let C, P, T, _, O = "", B = "", D = "";
|
|
695
|
+
const { open: q, tagContainer: V, tagHeader: z } = u(a[c]), K = [["class", `${h}-code`]];
|
|
696
|
+
q && K.push(["open", ""]);
|
|
697
|
+
const Z = {
|
|
698
|
+
attrs: ee(a[c], K)
|
|
699
699
|
};
|
|
700
|
-
for (let
|
|
701
|
-
|
|
702
|
-
const
|
|
703
|
-
|
|
700
|
+
for (let k = c; k < a.length && (C = a[k], [P, T] = d(C), P === H); k++) {
|
|
701
|
+
C.info = C.info.replace(n, "").replace(m, ""), C.hidden = !0;
|
|
702
|
+
const S = `${h}-codetab-${t.editorId}-${c}-${k - c}`;
|
|
703
|
+
_ = k - c > 0 ? "" : "checked", O += `
|
|
704
704
|
<li>
|
|
705
705
|
<input
|
|
706
706
|
type="radio"
|
|
707
|
-
id="label-${h}-codetab-label-1-${t.editorId}-${c}-${
|
|
707
|
+
id="label-${h}-codetab-label-1-${t.editorId}-${c}-${k - c}"
|
|
708
708
|
name="${h}-codetab-label-${t.editorId}-${c}"
|
|
709
|
-
class="${
|
|
710
|
-
${
|
|
709
|
+
class="${S}"
|
|
710
|
+
${_}
|
|
711
711
|
>
|
|
712
712
|
<label
|
|
713
|
-
for="label-${h}-codetab-label-1-${t.editorId}-${c}-${
|
|
714
|
-
onclick="this.getRootNode().querySelectorAll('.${
|
|
713
|
+
for="label-${h}-codetab-label-1-${t.editorId}-${c}-${k - c}"
|
|
714
|
+
onclick="this.getRootNode().querySelectorAll('.${S}').forEach(e => e.click())"
|
|
715
715
|
>
|
|
716
|
-
${e.utils.escapeHtml(
|
|
716
|
+
${e.utils.escapeHtml(T || i(C))}
|
|
717
717
|
</label>
|
|
718
|
-
</li>`,
|
|
718
|
+
</li>`, B += `
|
|
719
719
|
<div role="tabpanel">
|
|
720
720
|
<input
|
|
721
721
|
type="radio"
|
|
722
722
|
name="${h}-codetab-pre-${t.editorId}-${c}"
|
|
723
|
-
class="${
|
|
724
|
-
${
|
|
723
|
+
class="${S}"
|
|
724
|
+
${_}
|
|
725
725
|
role="presentation">
|
|
726
|
-
${r(a,
|
|
727
|
-
</div>`,
|
|
726
|
+
${r(a, k, p, f, g)}
|
|
727
|
+
</div>`, D += `
|
|
728
728
|
<input
|
|
729
729
|
type="radio"
|
|
730
730
|
name="${h}-codetab-lang-${t.editorId}-${c}"
|
|
731
|
-
class="${
|
|
732
|
-
${
|
|
731
|
+
class="${S}"
|
|
732
|
+
${_}
|
|
733
733
|
role="presentation">
|
|
734
|
-
<span class=${h}-code-lang role="note">${e.utils.escapeHtml(i(
|
|
734
|
+
<span class=${h}-code-lang role="note">${e.utils.escapeHtml(i(C))}</span>`;
|
|
735
735
|
}
|
|
736
736
|
return `
|
|
737
|
-
<${
|
|
738
|
-
<${
|
|
737
|
+
<${V} ${g.renderAttrs(Z)}>
|
|
738
|
+
<${z} class="${h}-code-head">
|
|
739
739
|
<div class="${h}-code-flag">
|
|
740
|
-
<ul class="${h}-codetab-label" role="tablist">${
|
|
740
|
+
<ul class="${h}-codetab-label" role="tablist">${O}</ul>
|
|
741
741
|
</div>
|
|
742
742
|
<div class="${h}-code-action">
|
|
743
|
-
<span class="${h}-codetab-lang">${
|
|
744
|
-
<span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${
|
|
743
|
+
<span class="${h}-codetab-lang">${D}</span>
|
|
744
|
+
<span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${A}</span>
|
|
745
745
|
${t.extraTools instanceof Function ? t.extraTools({ lang: a[c].info.trim() }) : t.extraTools || ""}
|
|
746
|
-
${
|
|
746
|
+
${V === "details" ? I : ""}
|
|
747
747
|
</div>
|
|
748
|
-
</${
|
|
749
|
-
${
|
|
750
|
-
</${
|
|
748
|
+
</${z}>
|
|
749
|
+
${B}
|
|
750
|
+
</${V}>
|
|
751
751
|
`;
|
|
752
752
|
};
|
|
753
753
|
e.renderer.rules.fence = l, e.renderer.rules.code_block = l;
|
|
754
|
-
},
|
|
754
|
+
}, st = (e, t) => {
|
|
755
755
|
const r = e.renderer.rules.fence.bind(e.renderer.rules);
|
|
756
756
|
e.renderer.rules.fence = (o, n, m, s, d) => {
|
|
757
757
|
const i = o[n], u = i.content.trim();
|
|
@@ -764,7 +764,7 @@ const P = {
|
|
|
764
764
|
}
|
|
765
765
|
return r(o, n, m, s, d);
|
|
766
766
|
};
|
|
767
|
-
},
|
|
767
|
+
}, ct = (e, t) => {
|
|
768
768
|
e.renderer.rules.heading_open = (r, o) => {
|
|
769
769
|
const n = r[o], m = r[o + 1].children?.reduce((d, i) => d + (["text", "code_inline", "math_inline"].includes(i.type) && i.content || ""), "") || "", s = n.markup.length;
|
|
770
770
|
return t.headsRef.value.push({
|
|
@@ -784,7 +784,7 @@ const P = {
|
|
|
784
784
|
})
|
|
785
785
|
), e.renderer.renderToken(r, o, t);
|
|
786
786
|
}, e.renderer.rules.heading_close = (r, o, n, m, s) => s.renderToken(r, o, n);
|
|
787
|
-
},
|
|
787
|
+
}, be = {
|
|
788
788
|
block: [
|
|
789
789
|
{ open: "$$", close: "$$" },
|
|
790
790
|
{ open: "\\[", close: "\\]" }
|
|
@@ -795,7 +795,7 @@ const P = {
|
|
|
795
795
|
{ open: "\\[", close: "\\]" },
|
|
796
796
|
{ open: "\\(", close: "\\)" }
|
|
797
797
|
]
|
|
798
|
-
},
|
|
798
|
+
}, dt = (e) => (t, r) => {
|
|
799
799
|
const o = e.delimiters;
|
|
800
800
|
let n, m, s;
|
|
801
801
|
for (const d of o)
|
|
@@ -819,7 +819,7 @@ const P = {
|
|
|
819
819
|
return t.pos = n + d.close.length, !0;
|
|
820
820
|
}
|
|
821
821
|
return !1;
|
|
822
|
-
},
|
|
822
|
+
}, ut = (e) => (t, r, o, n) => {
|
|
823
823
|
const m = e.delimiters;
|
|
824
824
|
let s, d, i, u, l = !1, a = t.bMarks[r] + t.tShift[r], c = t.eMarks[r];
|
|
825
825
|
for (const p of m)
|
|
@@ -834,10 +834,10 @@ const P = {
|
|
|
834
834
|
` : "") + t.getLines(r + 1, i, t.tShift[r], !0) + (d && d.trim() ? d : ""), f.map = [r, t.line], f.markup = p.open, !0;
|
|
835
835
|
}
|
|
836
836
|
return !1;
|
|
837
|
-
},
|
|
837
|
+
}, mt = (e, { katexRef: t, inlineDelimiters: r, blockDelimiters: o }) => {
|
|
838
838
|
const n = (s, d, i, u, l) => {
|
|
839
839
|
const a = s[d], c = {
|
|
840
|
-
attrs:
|
|
840
|
+
attrs: ee(a, [["class", `${h}-katex-inline`]])
|
|
841
841
|
};
|
|
842
842
|
if (t.value) {
|
|
843
843
|
const p = t.value.renderToString(
|
|
@@ -851,7 +851,7 @@ const P = {
|
|
|
851
851
|
return `<span ${l.renderAttrs(c)}>${a.content}</span>`;
|
|
852
852
|
}, m = (s, d, i, u, l) => {
|
|
853
853
|
const a = s[d], c = {
|
|
854
|
-
attrs:
|
|
854
|
+
attrs: ee(a, [["class", `${h}-katex-block`]])
|
|
855
855
|
};
|
|
856
856
|
if (t.value) {
|
|
857
857
|
const p = t.value.renderToString(
|
|
@@ -868,20 +868,20 @@ const P = {
|
|
|
868
868
|
e.inline.ruler.before(
|
|
869
869
|
"escape",
|
|
870
870
|
"math_inline",
|
|
871
|
-
|
|
872
|
-
delimiters: r ||
|
|
871
|
+
dt({
|
|
872
|
+
delimiters: r || be.inline
|
|
873
873
|
})
|
|
874
874
|
), e.block.ruler.after(
|
|
875
875
|
"blockquote",
|
|
876
876
|
"math_block",
|
|
877
|
-
|
|
878
|
-
delimiters: o ||
|
|
877
|
+
ut({
|
|
878
|
+
delimiters: o || be.block
|
|
879
879
|
}),
|
|
880
880
|
{
|
|
881
881
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
882
882
|
}
|
|
883
883
|
), e.renderer.rules.math_inline = n, e.renderer.rules.math_block = m;
|
|
884
|
-
},
|
|
884
|
+
}, ft = (e, t) => {
|
|
885
885
|
const r = e.renderer.rules.fence.bind(e.renderer.rules);
|
|
886
886
|
e.renderer.rules.fence = (o, n, m, s, d) => {
|
|
887
887
|
const i = o[n], u = i.content.trim();
|
|
@@ -890,77 +890,74 @@ const P = {
|
|
|
890
890
|
const a = i.map[1] - 1, p = !!s.srcLines[a]?.trim()?.startsWith("```");
|
|
891
891
|
i.attrSet("data-closed", `${p}`), i.attrSet("data-line", String(i.map[0]));
|
|
892
892
|
}
|
|
893
|
-
const l =
|
|
894
|
-
return l ? (i.attrSet("data-processed", ""), `<p ${d.renderAttrs(i)}>${l}</p>`) : `<div ${d.renderAttrs(i)}>${e.utils.escapeHtml(u)}</div>`;
|
|
893
|
+
const l = Y.get(u);
|
|
894
|
+
return l ? (i.attrSet("data-processed", ""), i.attrSet("data-content", u), `<p ${d.renderAttrs(i)}>${l}</p>`) : `<div ${d.renderAttrs(i)}>${e.utils.escapeHtml(u)}</div>`;
|
|
895
895
|
}
|
|
896
896
|
return r(o, n, m, s, d);
|
|
897
897
|
};
|
|
898
|
-
},
|
|
898
|
+
}, $e = (e, t, r) => {
|
|
899
899
|
const o = e.attrIndex(t), n = [t, r];
|
|
900
900
|
o < 0 ? e.attrPush(n) : (e.attrs = e.attrs || [], e.attrs[o] = n);
|
|
901
|
-
},
|
|
901
|
+
}, ht = (e) => e.type === "inline", pt = (e) => e.type === "paragraph_open", gt = (e) => e.type === "list_item_open", vt = (e) => e.content.indexOf("[ ] ") === 0 || e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0, yt = (e, t) => ht(e[t]) && pt(e[t - 1]) && gt(e[t - 2]) && vt(e[t]), bt = (e, t) => {
|
|
902
902
|
const r = e[t].level - 1;
|
|
903
903
|
for (let o = t - 1; o >= 0; o--)
|
|
904
904
|
if (e[o].level === r)
|
|
905
905
|
return o;
|
|
906
906
|
return -1;
|
|
907
|
-
},
|
|
907
|
+
}, $t = (e) => {
|
|
908
908
|
const t = new e("html_inline", "", 0);
|
|
909
909
|
return t.content = "<label>", t;
|
|
910
|
-
},
|
|
910
|
+
}, wt = (e) => {
|
|
911
911
|
const t = new e("html_inline", "", 0);
|
|
912
912
|
return t.content = "</label>", t;
|
|
913
|
-
},
|
|
913
|
+
}, Ct = (e, t, r) => {
|
|
914
914
|
const o = new r("html_inline", "", 0);
|
|
915
915
|
return o.content = '<label class="task-list-item-label" for="' + t + '">' + e + "</label>", o.attrs = [["for", t]], o;
|
|
916
916
|
}, kt = (e, t, r) => {
|
|
917
917
|
const o = new t("html_inline", "", 0), n = r.enabled ? " " : ' disabled="" ';
|
|
918
918
|
return e.content.indexOf("[ ] ") === 0 ? o.content = '<input class="task-list-item-checkbox"' + n + 'type="checkbox">' : (e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0) && (o.content = '<input class="task-list-item-checkbox" checked=""' + n + 'type="checkbox">'), o;
|
|
919
|
-
},
|
|
919
|
+
}, Et = (e, t, r) => {
|
|
920
920
|
if (e.children = e.children || [], e.children.unshift(kt(e, t, r)), e.children[1].content = e.children[1].content.slice(3), e.content = e.content.slice(3), r.label)
|
|
921
921
|
if (r.labelAfter) {
|
|
922
922
|
e.children.pop();
|
|
923
923
|
const o = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
|
|
924
|
-
e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + o + '">', e.children.push(
|
|
924
|
+
e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + o + '">', e.children.push(Ct(e.content, o, t));
|
|
925
925
|
} else
|
|
926
|
-
e.children.unshift(
|
|
926
|
+
e.children.unshift($t(t)), e.children.push(wt(t));
|
|
927
927
|
}, It = (e, t = {}) => {
|
|
928
928
|
e.core.ruler.after("inline", "github-task-lists", (r) => {
|
|
929
929
|
const o = r.tokens;
|
|
930
930
|
for (let n = 2; n < o.length; n++)
|
|
931
|
-
|
|
931
|
+
yt(o, n) && (Et(o[n], r.Token, t), $e(
|
|
932
932
|
o[n - 2],
|
|
933
933
|
"class",
|
|
934
934
|
"task-list-item" + (t.enabled ? " enabled" : " ")
|
|
935
|
-
),
|
|
935
|
+
), $e(o[bt(o, n - 2)], "class", "contains-task-list"));
|
|
936
936
|
});
|
|
937
937
|
}, Tt = (e) => {
|
|
938
938
|
e.core.ruler.push("init-line-number", (t) => (t.tokens.forEach((r) => {
|
|
939
939
|
r.map && (r.attrs || (r.attrs = []), r.attrs.push(["data-line", r.map[0].toString()]));
|
|
940
940
|
}), !0));
|
|
941
|
-
},
|
|
941
|
+
}, St = (e, t) => {
|
|
942
942
|
const { editorConfig: r, markdownItConfig: o, markdownItPlugins: n, editorExtensions: m } = R, s = b("editorId"), d = b("language"), i = b(
|
|
943
943
|
"usedLanguageText"
|
|
944
|
-
), u = b("showCodeRowNumber"), l = b("theme"), a = b("customIcon"), c = b("rootRef"), p = b("setting"), f =
|
|
945
|
-
let g = () => {
|
|
946
|
-
};
|
|
947
|
-
const y = nt(e), S = ot(e), { reRenderRef: $, replaceMermaid: C } = at(e), { reRenderEcharts: M, replaceEcharts: T } = tt(e), E = We({
|
|
944
|
+
), u = b("showCodeRowNumber"), l = b("theme"), a = b("customIcon"), c = b("rootRef"), p = b("setting"), f = U([]), g = ot(e), y = at(e), { reRenderRef: A, replaceMermaid: $ } = rt(e), { reRenderEcharts: I, replaceEcharts: H } = nt(e), C = qe({
|
|
948
945
|
html: !0,
|
|
949
946
|
breaks: !0,
|
|
950
947
|
linkify: !0
|
|
951
948
|
});
|
|
952
|
-
o(
|
|
949
|
+
o(C, {
|
|
953
950
|
editorId: s
|
|
954
951
|
});
|
|
955
|
-
const
|
|
952
|
+
const P = [
|
|
956
953
|
{
|
|
957
954
|
type: "image",
|
|
958
|
-
plugin:
|
|
955
|
+
plugin: Ke,
|
|
959
956
|
options: { figcaption: !0, classes: "md-zoom" }
|
|
960
957
|
},
|
|
961
958
|
{
|
|
962
959
|
type: "admonition",
|
|
963
|
-
plugin:
|
|
960
|
+
plugin: lt,
|
|
964
961
|
options: {}
|
|
965
962
|
},
|
|
966
963
|
{
|
|
@@ -970,12 +967,12 @@ const P = {
|
|
|
970
967
|
},
|
|
971
968
|
{
|
|
972
969
|
type: "heading",
|
|
973
|
-
plugin:
|
|
970
|
+
plugin: ct,
|
|
974
971
|
options: { mdHeadingId: e.mdHeadingId, headsRef: f }
|
|
975
972
|
},
|
|
976
973
|
{
|
|
977
974
|
type: "code",
|
|
978
|
-
plugin:
|
|
975
|
+
plugin: it,
|
|
979
976
|
options: {
|
|
980
977
|
editorId: s,
|
|
981
978
|
usedLanguageTextRef: i,
|
|
@@ -987,136 +984,131 @@ const P = {
|
|
|
987
984
|
},
|
|
988
985
|
{
|
|
989
986
|
type: "sub",
|
|
990
|
-
plugin:
|
|
987
|
+
plugin: Ze,
|
|
991
988
|
options: {}
|
|
992
989
|
},
|
|
993
990
|
{
|
|
994
991
|
type: "sup",
|
|
995
|
-
plugin:
|
|
992
|
+
plugin: Je,
|
|
996
993
|
options: {}
|
|
997
994
|
}
|
|
998
995
|
];
|
|
999
|
-
e.noKatex ||
|
|
996
|
+
e.noKatex || P.push({
|
|
1000
997
|
type: "katex",
|
|
1001
|
-
plugin: ut,
|
|
1002
|
-
options: { katexRef: S }
|
|
1003
|
-
}), e.noMermaid || I.push({
|
|
1004
|
-
type: "mermaid",
|
|
1005
998
|
plugin: mt,
|
|
999
|
+
options: { katexRef: y }
|
|
1000
|
+
}), e.noMermaid || P.push({
|
|
1001
|
+
type: "mermaid",
|
|
1002
|
+
plugin: ft,
|
|
1006
1003
|
options: { themeRef: l }
|
|
1007
|
-
}), e.noEcharts ||
|
|
1004
|
+
}), e.noEcharts || P.push({
|
|
1008
1005
|
type: "echarts",
|
|
1009
|
-
plugin:
|
|
1006
|
+
plugin: st,
|
|
1010
1007
|
options: { themeRef: l }
|
|
1011
|
-
}), n(
|
|
1008
|
+
}), n(P, {
|
|
1012
1009
|
editorId: s
|
|
1013
|
-
}).forEach((
|
|
1014
|
-
|
|
1010
|
+
}).forEach((k) => {
|
|
1011
|
+
C.use(k.plugin, k.options);
|
|
1015
1012
|
});
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1018
|
-
highlight: (
|
|
1019
|
-
if (
|
|
1020
|
-
const
|
|
1021
|
-
if (
|
|
1022
|
-
return
|
|
1013
|
+
const T = C.options.highlight;
|
|
1014
|
+
C.set({
|
|
1015
|
+
highlight: (k, S, J) => {
|
|
1016
|
+
if (T) {
|
|
1017
|
+
const W = T(k, S, J);
|
|
1018
|
+
if (W)
|
|
1019
|
+
return W;
|
|
1023
1020
|
}
|
|
1024
|
-
let
|
|
1025
|
-
!e.noHighlight &&
|
|
1026
|
-
language:
|
|
1021
|
+
let j;
|
|
1022
|
+
!e.noHighlight && g.value ? g.value.getLanguage(S) ? j = g.value.highlight(k, {
|
|
1023
|
+
language: S,
|
|
1027
1024
|
ignoreIllegals: !0
|
|
1028
|
-
}).value :
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
) : `<span class="${h}-code-block">${
|
|
1033
|
-
return `<pre><code class="language-${
|
|
1025
|
+
}).value : j = g.value.highlightAuto(k).value : j = C.utils.escapeHtml(k);
|
|
1026
|
+
const oe = u ? Xe(
|
|
1027
|
+
j.replace(/^\n+|\n+$/g, ""),
|
|
1028
|
+
k.replace(/^\n+|\n+$/g, "")
|
|
1029
|
+
) : `<span class="${h}-code-block">${j.replace(/^\n+|\n+$/g, "")}</span>`;
|
|
1030
|
+
return `<pre><code class="language-${S}" language=${S}>${oe}</code></pre>`;
|
|
1034
1031
|
}
|
|
1035
|
-
}), Tt(
|
|
1036
|
-
const
|
|
1032
|
+
}), Tt(C);
|
|
1033
|
+
const _ = U(`_article-key_${ie()}`), O = U(
|
|
1037
1034
|
e.sanitize(
|
|
1038
|
-
|
|
1035
|
+
C.render(e.modelValue, {
|
|
1039
1036
|
srcLines: e.modelValue.split(`
|
|
1040
1037
|
`)
|
|
1041
1038
|
})
|
|
1042
1039
|
)
|
|
1043
|
-
)
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1040
|
+
);
|
|
1041
|
+
let B = () => {
|
|
1042
|
+
}, D = () => {
|
|
1043
|
+
};
|
|
1044
|
+
const q = () => {
|
|
1045
|
+
const k = c.value?.querySelectorAll(
|
|
1046
|
+
`#${s} p.${h}-mermaid:not([data-closed=false])`
|
|
1047
|
+
);
|
|
1048
|
+
D(), D = Ge(k, {
|
|
1049
|
+
customIcon: a.value
|
|
1050
|
+
}), m.mermaid?.enableZoom && (B(), B = ze(k, {
|
|
1051
|
+
customIcon: a.value
|
|
1052
|
+
}));
|
|
1053
|
+
}, V = () => {
|
|
1054
|
+
v.emit(s, X, O.value), e.onHtmlChanged(O.value), e.onGetCatalog(f.value), v.emit(s, ae, f.value), G(() => {
|
|
1055
|
+
$().then(q), H();
|
|
1055
1056
|
});
|
|
1056
|
-
},
|
|
1057
|
-
f.value = [],
|
|
1058
|
-
|
|
1057
|
+
}, z = () => {
|
|
1058
|
+
f.value = [], O.value = e.sanitize(
|
|
1059
|
+
C.render(e.modelValue, {
|
|
1059
1060
|
srcLines: e.modelValue.split(`
|
|
1060
1061
|
`)
|
|
1061
1062
|
})
|
|
1062
1063
|
);
|
|
1063
|
-
},
|
|
1064
|
-
let
|
|
1065
|
-
return w([
|
|
1066
|
-
|
|
1064
|
+
}, K = x(() => (e.noKatex || !!y.value) && (e.noHighlight || !!g.value));
|
|
1065
|
+
let Z = -1;
|
|
1066
|
+
return w([Ae(e, "modelValue"), K, A, d], () => {
|
|
1067
|
+
Z = window.setTimeout(
|
|
1067
1068
|
() => {
|
|
1068
|
-
|
|
1069
|
+
z();
|
|
1069
1070
|
},
|
|
1070
1071
|
t ? 0 : r.renderDelay
|
|
1071
1072
|
);
|
|
1072
1073
|
}), w(
|
|
1073
1074
|
() => p.value.preview,
|
|
1074
1075
|
() => {
|
|
1075
|
-
p.value.preview &&
|
|
1076
|
-
|
|
1077
|
-
m.mermaid?.enableZoom && (g(), g = ve(
|
|
1078
|
-
c.value?.querySelectorAll(
|
|
1079
|
-
`#${s} p.${h}-mermaid:not([data-closed=false])`
|
|
1080
|
-
),
|
|
1081
|
-
{
|
|
1082
|
-
customIcon: a.value
|
|
1083
|
-
}
|
|
1084
|
-
));
|
|
1085
|
-
}), T(), v.emit(s, ne, f.value);
|
|
1076
|
+
p.value.preview && G(() => {
|
|
1077
|
+
$().then(q), H(), v.emit(s, ae, f.value);
|
|
1086
1078
|
});
|
|
1087
1079
|
}
|
|
1088
|
-
), w([
|
|
1089
|
-
|
|
1090
|
-
}),
|
|
1080
|
+
), w([O, I], () => {
|
|
1081
|
+
V();
|
|
1082
|
+
}), F(V), F(() => {
|
|
1091
1083
|
v.on(s, {
|
|
1092
|
-
name:
|
|
1084
|
+
name: Be,
|
|
1093
1085
|
callback() {
|
|
1094
|
-
v.emit(s,
|
|
1086
|
+
v.emit(s, ae, f.value);
|
|
1095
1087
|
}
|
|
1096
1088
|
}), v.on(s, {
|
|
1097
|
-
name:
|
|
1089
|
+
name: de,
|
|
1098
1090
|
callback: () => {
|
|
1099
|
-
|
|
1091
|
+
_.value = `_article-key_${ie()}`, z();
|
|
1100
1092
|
}
|
|
1101
1093
|
});
|
|
1102
|
-
}),
|
|
1103
|
-
|
|
1104
|
-
}), { html:
|
|
1105
|
-
},
|
|
1106
|
-
const r = b("editorId"), o = b("setting"), { noImgZoomIn: n } = e, m =
|
|
1094
|
+
}), ne(() => {
|
|
1095
|
+
B(), D(), clearTimeout(Z);
|
|
1096
|
+
}), { html: O, key: _ };
|
|
1097
|
+
}, xt = (e, t) => {
|
|
1098
|
+
const r = b("editorId"), o = b("setting"), { noImgZoomIn: n } = e, m = Me(() => {
|
|
1107
1099
|
const s = document.querySelectorAll(
|
|
1108
1100
|
`#${r}-preview img:not(.not-zoom):not(.medium-zoom-image)`
|
|
1109
1101
|
);
|
|
1110
|
-
s.length !== 0 &&
|
|
1102
|
+
s.length !== 0 && Qe(s, {
|
|
1111
1103
|
background: "#00000073"
|
|
1112
1104
|
});
|
|
1113
1105
|
});
|
|
1114
|
-
|
|
1106
|
+
F(async () => {
|
|
1115
1107
|
!n && o.value.preview && await m();
|
|
1116
1108
|
}), w([t, () => o.value.preview], async () => {
|
|
1117
1109
|
!n && o.value.preview && await m();
|
|
1118
1110
|
});
|
|
1119
|
-
},
|
|
1111
|
+
}, we = {
|
|
1120
1112
|
checked: {
|
|
1121
1113
|
regexp: /- \[x\]/,
|
|
1122
1114
|
value: "- [ ]"
|
|
@@ -1125,7 +1117,7 @@ const P = {
|
|
|
1125
1117
|
regexp: /- \[\s\]/,
|
|
1126
1118
|
value: "- [x]"
|
|
1127
1119
|
}
|
|
1128
|
-
},
|
|
1120
|
+
}, Ft = (e, t) => {
|
|
1129
1121
|
const r = b("editorId"), o = b("rootRef");
|
|
1130
1122
|
let n = () => {
|
|
1131
1123
|
};
|
|
@@ -1139,11 +1131,11 @@ const P = {
|
|
|
1139
1131
|
return;
|
|
1140
1132
|
const a = Number(l), c = e.modelValue.split(`
|
|
1141
1133
|
`), p = c[Number(a)].replace(
|
|
1142
|
-
|
|
1143
|
-
|
|
1134
|
+
we[u].regexp,
|
|
1135
|
+
we[u].value
|
|
1144
1136
|
);
|
|
1145
1137
|
e.previewOnly ? (c[Number(a)] = p, e.onChange(c.join(`
|
|
1146
|
-
`))) : v.emit(r,
|
|
1138
|
+
`))) : v.emit(r, De, a + 1, p);
|
|
1147
1139
|
};
|
|
1148
1140
|
s.forEach((i) => {
|
|
1149
1141
|
i.addEventListener("click", d);
|
|
@@ -1153,26 +1145,26 @@ const P = {
|
|
|
1153
1145
|
});
|
|
1154
1146
|
};
|
|
1155
1147
|
};
|
|
1156
|
-
|
|
1148
|
+
ne(() => {
|
|
1157
1149
|
n();
|
|
1158
1150
|
}), w(
|
|
1159
1151
|
[t],
|
|
1160
1152
|
() => {
|
|
1161
|
-
n(),
|
|
1153
|
+
n(), G(m);
|
|
1162
1154
|
},
|
|
1163
1155
|
{
|
|
1164
1156
|
immediate: !0
|
|
1165
1157
|
}
|
|
1166
1158
|
);
|
|
1167
|
-
},
|
|
1159
|
+
}, At = (e, t, r) => {
|
|
1168
1160
|
const o = b("setting"), n = () => {
|
|
1169
|
-
|
|
1161
|
+
G(() => {
|
|
1170
1162
|
e.onRemount?.();
|
|
1171
1163
|
});
|
|
1172
1164
|
}, m = (s) => {
|
|
1173
1165
|
s && n();
|
|
1174
1166
|
};
|
|
1175
|
-
w([t, r], n), w(() => o.value.preview, m), w(() => o.value.htmlPreview, m),
|
|
1167
|
+
w([t, r], n), w(() => o.value.preview, m), w(() => o.value.htmlPreview, m), F(n);
|
|
1176
1168
|
}, Te = {
|
|
1177
1169
|
modelValue: {
|
|
1178
1170
|
type: String,
|
|
@@ -1240,7 +1232,7 @@ const P = {
|
|
|
1240
1232
|
noEcharts: {
|
|
1241
1233
|
type: Boolean
|
|
1242
1234
|
}
|
|
1243
|
-
},
|
|
1235
|
+
}, nn = {
|
|
1244
1236
|
...Te,
|
|
1245
1237
|
updateModelValue: {
|
|
1246
1238
|
type: Function,
|
|
@@ -1309,10 +1301,10 @@ const P = {
|
|
|
1309
1301
|
catalogMaxDepth: {
|
|
1310
1302
|
type: Number
|
|
1311
1303
|
}
|
|
1312
|
-
},
|
|
1304
|
+
}, Rt = (e) => {
|
|
1313
1305
|
const r = new DOMParser().parseFromString(e, "text/html");
|
|
1314
1306
|
return Array.from(r.body.childNodes);
|
|
1315
|
-
},
|
|
1307
|
+
}, Ht = (e, t) => {
|
|
1316
1308
|
const r = [], o = [];
|
|
1317
1309
|
if (e.forEach((n, m) => {
|
|
1318
1310
|
const s = t[m];
|
|
@@ -1334,7 +1326,7 @@ const P = {
|
|
|
1334
1326
|
updates: r,
|
|
1335
1327
|
deletes: o
|
|
1336
1328
|
};
|
|
1337
|
-
},
|
|
1329
|
+
}, Ce = /* @__PURE__ */ ce({
|
|
1338
1330
|
name: "UpdateOnDemand",
|
|
1339
1331
|
props: {
|
|
1340
1332
|
html: {
|
|
@@ -1343,7 +1335,7 @@ const P = {
|
|
|
1343
1335
|
}
|
|
1344
1336
|
},
|
|
1345
1337
|
setup(e) {
|
|
1346
|
-
const t = b("editorId"), r = b("previewTheme"), o = b("showCodeRowNumber"), n =
|
|
1338
|
+
const t = b("editorId"), r = b("previewTheme"), o = b("showCodeRowNumber"), n = U(), m = e.html, s = (d, i) => {
|
|
1347
1339
|
n.value && (i.forEach((u) => {
|
|
1348
1340
|
u.remove();
|
|
1349
1341
|
}), d.forEach(({
|
|
@@ -1355,45 +1347,45 @@ const P = {
|
|
|
1355
1347
|
}));
|
|
1356
1348
|
};
|
|
1357
1349
|
return w(() => e.html, (d) => {
|
|
1358
|
-
const i =
|
|
1350
|
+
const i = Rt(d), u = Array.from(n.value?.childNodes || []), {
|
|
1359
1351
|
updates: l,
|
|
1360
1352
|
deletes: a
|
|
1361
|
-
} =
|
|
1353
|
+
} = Ht(i, u);
|
|
1362
1354
|
s(l, a);
|
|
1363
|
-
}), () =>
|
|
1355
|
+
}), () => N("div", {
|
|
1364
1356
|
id: `${t}-preview`,
|
|
1365
1357
|
class: [`${h}-preview`, `${r?.value}-theme`, o && `${h}-scrn`],
|
|
1366
1358
|
innerHTML: m,
|
|
1367
1359
|
ref: n
|
|
1368
1360
|
}, null);
|
|
1369
1361
|
}
|
|
1370
|
-
}),
|
|
1362
|
+
}), Pt = /* @__PURE__ */ ce({
|
|
1371
1363
|
name: "ContentPreview",
|
|
1372
1364
|
props: Te,
|
|
1373
1365
|
setup(e) {
|
|
1374
1366
|
const t = b("editorId"), r = b("setting"), {
|
|
1375
1367
|
html: o,
|
|
1376
1368
|
key: n
|
|
1377
|
-
} =
|
|
1378
|
-
return
|
|
1369
|
+
} = St(e, e.previewOnly);
|
|
1370
|
+
return tt(e, o, n), xt(e, o), Ft(e, o), At(e, o, n), () => N(Re, null, [r.value.preview && (e.previewOnly ? N(Ce, {
|
|
1379
1371
|
key: n.value,
|
|
1380
1372
|
html: o.value
|
|
1381
|
-
}, null) :
|
|
1373
|
+
}, null) : N("div", {
|
|
1382
1374
|
id: `${t}-preview-wrapper`,
|
|
1383
1375
|
class: `${h}-preview-wrapper`,
|
|
1384
1376
|
key: "content-preview-wrapper"
|
|
1385
|
-
}, [
|
|
1377
|
+
}, [N(Ce, {
|
|
1386
1378
|
key: n.value,
|
|
1387
1379
|
html: o.value
|
|
1388
|
-
}, null)])), r.value.htmlPreview &&
|
|
1380
|
+
}, null)])), r.value.htmlPreview && N("div", {
|
|
1389
1381
|
id: `${t}-html-wrapper`,
|
|
1390
1382
|
class: `${h}-preview-wrapper`,
|
|
1391
1383
|
key: "html-preview-wrapper"
|
|
1392
|
-
}, [
|
|
1384
|
+
}, [N("div", {
|
|
1393
1385
|
class: `${h}-html`
|
|
1394
1386
|
}, [o.value])])]);
|
|
1395
1387
|
}
|
|
1396
|
-
}),
|
|
1388
|
+
}), Mt = ({ text: e }) => e, Se = {
|
|
1397
1389
|
/**
|
|
1398
1390
|
* markdown content.
|
|
1399
1391
|
*
|
|
@@ -1502,7 +1494,7 @@ const P = {
|
|
|
1502
1494
|
*/
|
|
1503
1495
|
mdHeadingId: {
|
|
1504
1496
|
type: Function,
|
|
1505
|
-
default:
|
|
1497
|
+
default: Mt
|
|
1506
1498
|
},
|
|
1507
1499
|
/**
|
|
1508
1500
|
*
|
|
@@ -1627,8 +1619,8 @@ const P = {
|
|
|
1627
1619
|
type: Boolean,
|
|
1628
1620
|
default: !1
|
|
1629
1621
|
}
|
|
1630
|
-
},
|
|
1631
|
-
...
|
|
1622
|
+
}, on = {
|
|
1623
|
+
...Se,
|
|
1632
1624
|
/**
|
|
1633
1625
|
* input回调事件
|
|
1634
1626
|
*/
|
|
@@ -1688,7 +1680,7 @@ const P = {
|
|
|
1688
1680
|
*/
|
|
1689
1681
|
toolbars: {
|
|
1690
1682
|
type: Array,
|
|
1691
|
-
default:
|
|
1683
|
+
default: _e
|
|
1692
1684
|
},
|
|
1693
1685
|
/**
|
|
1694
1686
|
* 浮动工具栏
|
|
@@ -1766,7 +1758,7 @@ const P = {
|
|
|
1766
1758
|
*/
|
|
1767
1759
|
footers: {
|
|
1768
1760
|
type: Array,
|
|
1769
|
-
default:
|
|
1761
|
+
default: Le
|
|
1770
1762
|
},
|
|
1771
1763
|
/**
|
|
1772
1764
|
* 是否默认激活输入框和预览框同步滚动
|
|
@@ -1933,14 +1925,14 @@ const P = {
|
|
|
1933
1925
|
type: Number,
|
|
1934
1926
|
default: void 0
|
|
1935
1927
|
}
|
|
1936
|
-
},
|
|
1928
|
+
}, xe = [
|
|
1937
1929
|
"onHtmlChanged",
|
|
1938
1930
|
"onGetCatalog",
|
|
1939
1931
|
"onChange",
|
|
1940
1932
|
"onRemount",
|
|
1941
1933
|
"update:modelValue"
|
|
1942
|
-
],
|
|
1943
|
-
...
|
|
1934
|
+
], an = [
|
|
1935
|
+
...xe,
|
|
1944
1936
|
"onSave",
|
|
1945
1937
|
"onUploadImg",
|
|
1946
1938
|
"onError",
|
|
@@ -1949,36 +1941,36 @@ const P = {
|
|
|
1949
1941
|
"onInput",
|
|
1950
1942
|
"onDrop",
|
|
1951
1943
|
"oninputBoxWidthChange"
|
|
1952
|
-
],
|
|
1944
|
+
], Lt = (e, t, r) => {
|
|
1953
1945
|
const { editorId: o } = r, n = {
|
|
1954
1946
|
rerender() {
|
|
1955
|
-
v.emit(o,
|
|
1947
|
+
v.emit(o, de);
|
|
1956
1948
|
}
|
|
1957
1949
|
};
|
|
1958
1950
|
t.expose(n);
|
|
1959
|
-
},
|
|
1951
|
+
}, re = /* @__PURE__ */ ce({
|
|
1960
1952
|
name: "MdPreview",
|
|
1961
|
-
props:
|
|
1962
|
-
emits:
|
|
1953
|
+
props: Se,
|
|
1954
|
+
emits: xe,
|
|
1963
1955
|
setup(e, t) {
|
|
1964
1956
|
const {
|
|
1965
1957
|
noKatex: r,
|
|
1966
1958
|
noMermaid: o,
|
|
1967
1959
|
noHighlight: n
|
|
1968
|
-
} = e, m =
|
|
1960
|
+
} = e, m = U(), s = et(e);
|
|
1969
1961
|
return Ie(e, {
|
|
1970
1962
|
rootRef: m,
|
|
1971
1963
|
editorId: s
|
|
1972
|
-
}),
|
|
1964
|
+
}), Lt(e, t, {
|
|
1973
1965
|
editorId: s
|
|
1974
|
-
}),
|
|
1966
|
+
}), ne(() => {
|
|
1975
1967
|
v.clear(s);
|
|
1976
|
-
}), () =>
|
|
1968
|
+
}), () => N("div", {
|
|
1977
1969
|
id: s,
|
|
1978
1970
|
class: [h, e.class, e.theme === "dark" && `${h}-dark`, `${h}-previewOnly`],
|
|
1979
1971
|
style: e.style,
|
|
1980
1972
|
ref: m
|
|
1981
|
-
}, [
|
|
1973
|
+
}, [N(Pt, {
|
|
1982
1974
|
modelValue: e.modelValue,
|
|
1983
1975
|
onChange: (d) => {
|
|
1984
1976
|
e.onChange?.(d), t.emit("onChange", d), t.emit("update:modelValue", d);
|
|
@@ -2007,20 +1999,20 @@ const P = {
|
|
|
2007
1999
|
}, null)]);
|
|
2008
2000
|
}
|
|
2009
2001
|
});
|
|
2010
|
-
|
|
2002
|
+
re.install = (e) => (e.component(re.name, re), e);
|
|
2011
2003
|
export {
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2004
|
+
M as C,
|
|
2005
|
+
re as M,
|
|
2006
|
+
Pt as a,
|
|
2007
|
+
on as b,
|
|
2008
|
+
nn as c,
|
|
2009
|
+
Qt as d,
|
|
2010
|
+
an as e,
|
|
2011
|
+
en as f,
|
|
2012
|
+
Zt as g,
|
|
2013
|
+
Xt as h,
|
|
2014
|
+
Yt as i,
|
|
2015
|
+
tn as j,
|
|
2016
|
+
Jt as k,
|
|
2017
|
+
et as u
|
|
2026
2018
|
};
|