md-editor-v3 6.5.5 → 6.5.6
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/index4.cjs +21 -21
- package/lib/es/chunks/index4.mjs +614 -608
- package/package.json +1 -1
package/lib/es/chunks/index4.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useId as
|
|
2
|
-
import { deepMerge as
|
|
3
|
-
import { p as h, g as L, f as me, s as fe, a as je, b as
|
|
4
|
-
import { b, R as
|
|
5
|
-
import { a as O, u as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { a as
|
|
12
|
-
import
|
|
1
|
+
import { useId as Me, provide as T, computed as A, reactive as ie, watch as x, onMounted as M, ref as z, inject as $, nextTick as W, shallowRef as te, onBeforeUnmount as ne, toRef as Pe, defineComponent as de, createVNode as j, Fragment as Le, h as _e } from "vue";
|
|
2
|
+
import { deepMerge as Oe, deepClone as Ne, randomId as se, debounce as Be } from "@vavt/util";
|
|
3
|
+
import { p as h, g as L, f as me, s as fe, a as je, b as De } from "./config.mjs";
|
|
4
|
+
import { b, R as Ve, U as Ge, C as Te, B as Y, O as Se, E as ee, g as he, F as pe, h as ge, i as ve, H as ye, j as be, e as Ue, k as ue, d as ze, f as re, P as We, T as qe } from "./event-bus.mjs";
|
|
5
|
+
import { a as O, u as Ke, S as Ze, c as Je, z as Xe } from "./dom.mjs";
|
|
6
|
+
import Ye from "@vavt/copy2clipboard";
|
|
7
|
+
import Qe from "markdown-it";
|
|
8
|
+
import et from "markdown-it-image-figures";
|
|
9
|
+
import tt from "markdown-it-sub";
|
|
10
|
+
import nt from "markdown-it-sup";
|
|
11
|
+
import { a as ot } from "./index5.mjs";
|
|
12
|
+
import at from "medium-zoom";
|
|
13
13
|
const P = {
|
|
14
14
|
hljs: `${h}-hljs`,
|
|
15
15
|
hlcss: `${h}-hlCss`,
|
|
@@ -23,68 +23,68 @@ const P = {
|
|
|
23
23
|
katexjs: `${h}-katex`,
|
|
24
24
|
katexcss: `${h}-katexCss`,
|
|
25
25
|
echarts: `${h}-echarts`
|
|
26
|
-
},
|
|
27
|
-
b.emit(e,
|
|
28
|
-
},
|
|
29
|
-
const { editorId:
|
|
26
|
+
}, ce = (e, t) => {
|
|
27
|
+
b.emit(e, Ve, t);
|
|
28
|
+
}, tn = (e, t, a) => {
|
|
29
|
+
const { editorId: o } = a, n = ie({
|
|
30
30
|
// 是否已编译成html
|
|
31
31
|
buildFinished: !1,
|
|
32
32
|
// 存储当前最新的html
|
|
33
33
|
html: ""
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
x(
|
|
36
36
|
() => e.modelValue,
|
|
37
37
|
() => {
|
|
38
|
-
|
|
38
|
+
n.buildFinished = !1;
|
|
39
39
|
}
|
|
40
40
|
), M(() => {
|
|
41
|
-
b.on(
|
|
42
|
-
name:
|
|
43
|
-
callback(
|
|
44
|
-
|
|
41
|
+
b.on(o, {
|
|
42
|
+
name: Y,
|
|
43
|
+
callback(d) {
|
|
44
|
+
n.buildFinished = !0, n.html = d;
|
|
45
45
|
}
|
|
46
|
-
}), b.on(
|
|
47
|
-
name:
|
|
46
|
+
}), b.on(o, {
|
|
47
|
+
name: Se,
|
|
48
48
|
callback() {
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
49
|
+
const d = new Promise((s) => {
|
|
50
|
+
if (n.buildFinished)
|
|
51
|
+
s(n.html);
|
|
52
52
|
else {
|
|
53
|
-
const
|
|
54
|
-
|
|
53
|
+
const c = (u) => {
|
|
54
|
+
s(u), b.remove(o, Y, c);
|
|
55
55
|
};
|
|
56
|
-
b.on(
|
|
57
|
-
name:
|
|
58
|
-
callback:
|
|
56
|
+
b.on(o, {
|
|
57
|
+
name: Y,
|
|
58
|
+
callback: c
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
e.onSave ? e.onSave(e.modelValue,
|
|
62
|
+
e.onSave ? e.onSave(e.modelValue, d) : t.emit("onSave", e.modelValue, d);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
-
},
|
|
66
|
+
}, Ie = (e, {
|
|
67
67
|
editorId: t,
|
|
68
68
|
rootRef: a,
|
|
69
|
-
setting:
|
|
69
|
+
setting: o
|
|
70
70
|
}) => {
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const n = L.editorExtensions.highlight, d = L.editorExtensionsAttrs.highlight;
|
|
72
|
+
T("editorId", t), T("rootRef", a), T(
|
|
73
73
|
"theme",
|
|
74
|
-
|
|
75
|
-
),
|
|
74
|
+
A(() => e.theme)
|
|
75
|
+
), T(
|
|
76
76
|
"language",
|
|
77
|
-
|
|
78
|
-
),
|
|
77
|
+
A(() => e.language)
|
|
78
|
+
), T(
|
|
79
79
|
"highlight",
|
|
80
|
-
|
|
81
|
-
const { js:
|
|
80
|
+
A(() => {
|
|
81
|
+
const { js: c } = n, u = {
|
|
82
82
|
...me,
|
|
83
|
-
...
|
|
84
|
-
}, { js: l, css: i = {} } =
|
|
83
|
+
...n.css
|
|
84
|
+
}, { js: l, css: i = {} } = d || {}, r = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, m = u[e.codeTheme] ? u[e.codeTheme][r] : me.atom[r], f = u[e.codeTheme] && i[e.codeTheme] ? i[e.codeTheme][r] : i.atom ? i.atom[r] : {};
|
|
85
85
|
return {
|
|
86
86
|
js: {
|
|
87
|
-
src:
|
|
87
|
+
src: c,
|
|
88
88
|
...l
|
|
89
89
|
},
|
|
90
90
|
css: {
|
|
@@ -93,28 +93,28 @@ const P = {
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
})
|
|
96
|
-
),
|
|
97
|
-
const
|
|
98
|
-
const
|
|
96
|
+
), T("showCodeRowNumber", e.showCodeRowNumber);
|
|
97
|
+
const s = A(() => {
|
|
98
|
+
const c = {
|
|
99
99
|
...fe,
|
|
100
100
|
...L.editorConfig.languageUserDefined
|
|
101
101
|
};
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
return Oe(
|
|
103
|
+
Ne(fe["en-US"]),
|
|
104
|
+
c[e.language] || {}
|
|
105
105
|
);
|
|
106
106
|
});
|
|
107
|
-
return
|
|
107
|
+
return T("usedLanguageText", s), T(
|
|
108
108
|
"previewTheme",
|
|
109
|
-
|
|
110
|
-
),
|
|
109
|
+
A(() => e.previewTheme)
|
|
110
|
+
), T(
|
|
111
111
|
"customIcon",
|
|
112
|
-
|
|
113
|
-
),
|
|
112
|
+
A(() => e.customIcon)
|
|
113
|
+
), T(
|
|
114
114
|
"setting",
|
|
115
|
-
|
|
115
|
+
A(() => o ? {
|
|
116
116
|
// setting是reactive,不转化是可以直接赋值的
|
|
117
|
-
...
|
|
117
|
+
...o
|
|
118
118
|
} : {
|
|
119
119
|
preview: !0,
|
|
120
120
|
htmlPreview: !1,
|
|
@@ -123,105 +123,105 @@ const P = {
|
|
|
123
123
|
fullscreen: !1
|
|
124
124
|
})
|
|
125
125
|
), { editorId: t };
|
|
126
|
-
},
|
|
126
|
+
}, nn = (e, t) => (T("tabWidth", e.tabWidth), T(
|
|
127
127
|
"disabled",
|
|
128
|
-
|
|
129
|
-
),
|
|
128
|
+
A(() => e.disabled)
|
|
129
|
+
), T(
|
|
130
130
|
"contentDisabled",
|
|
131
|
-
|
|
132
|
-
),
|
|
131
|
+
A(() => e.disabled || e.readOnly)
|
|
132
|
+
), T(
|
|
133
133
|
"showToolbarName",
|
|
134
|
-
|
|
135
|
-
),
|
|
134
|
+
A(() => e.showToolbarName)
|
|
135
|
+
), T("noUploadImg", e.noUploadImg), T(
|
|
136
136
|
"tableShape",
|
|
137
|
-
|
|
138
|
-
),
|
|
137
|
+
A(() => e.tableShape)
|
|
138
|
+
), T("noPrettier", e.noPrettier), T(
|
|
139
139
|
"codeTheme",
|
|
140
|
-
|
|
141
|
-
),
|
|
140
|
+
A(() => e.codeTheme)
|
|
141
|
+
), T("updateSetting", t.updateSetting), T(
|
|
142
142
|
"catalogVisible",
|
|
143
|
-
|
|
144
|
-
),
|
|
143
|
+
A(() => t.catalogVisible.value)
|
|
144
|
+
), T("defToolbars", t.defToolbars), T(
|
|
145
145
|
"floatingToolbars",
|
|
146
|
-
|
|
147
|
-
),
|
|
148
|
-
const { noPrettier: t, noUploadImg: a } = e, { editorExtensions:
|
|
146
|
+
A(() => e.floatingToolbars)
|
|
147
|
+
), Ie(e, t)), on = (e) => {
|
|
148
|
+
const { noPrettier: t, noUploadImg: a } = e, { editorExtensions: o, editorExtensionsAttrs: n } = L, d = t || o.prettier.prettierInstance, s = t || o.prettier.parserMarkdownInstance, c = a || o.cropper.instance;
|
|
149
149
|
M(() => {
|
|
150
|
-
if (!
|
|
151
|
-
const { js:
|
|
150
|
+
if (!c) {
|
|
151
|
+
const { js: u = {}, css: l = {} } = n.cropper || {};
|
|
152
152
|
O("link", {
|
|
153
153
|
...l,
|
|
154
154
|
rel: "stylesheet",
|
|
155
|
-
href:
|
|
155
|
+
href: o.cropper.css,
|
|
156
156
|
id: P.croppercss
|
|
157
157
|
}), O("script", {
|
|
158
|
-
...
|
|
159
|
-
src:
|
|
158
|
+
...u,
|
|
159
|
+
src: o.cropper.js,
|
|
160
160
|
id: P.cropperjs
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
if (!
|
|
164
|
-
const { standaloneJs:
|
|
163
|
+
if (!d) {
|
|
164
|
+
const { standaloneJs: u = {} } = n.prettier || {};
|
|
165
165
|
O("script", {
|
|
166
|
-
...
|
|
167
|
-
src:
|
|
166
|
+
...u,
|
|
167
|
+
src: o.prettier.standaloneJs,
|
|
168
168
|
id: P.prettier
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
if (!
|
|
172
|
-
const { parserMarkdownJs:
|
|
171
|
+
if (!s) {
|
|
172
|
+
const { parserMarkdownJs: u = {} } = n.prettier || {};
|
|
173
173
|
O("script", {
|
|
174
|
-
...
|
|
175
|
-
src:
|
|
174
|
+
...u,
|
|
175
|
+
src: o.prettier.parserMarkdownJs,
|
|
176
176
|
id: P.prettierMD
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
},
|
|
181
|
-
const { editorId:
|
|
180
|
+
}, an = (e, t, a) => {
|
|
181
|
+
const { editorId: o } = a;
|
|
182
182
|
M(() => {
|
|
183
|
-
b.on(
|
|
184
|
-
name:
|
|
185
|
-
callback: (
|
|
186
|
-
e.onError?.(
|
|
183
|
+
b.on(o, {
|
|
184
|
+
name: ee,
|
|
185
|
+
callback: (n) => {
|
|
186
|
+
e.onError?.(n), t.emit("onError", n);
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
});
|
|
190
|
-
},
|
|
191
|
-
const { editorId:
|
|
190
|
+
}, rn = (e, t, a) => {
|
|
191
|
+
const { editorId: o } = a, n = ie({
|
|
192
192
|
pageFullscreen: e.pageFullscreen,
|
|
193
193
|
fullscreen: !1,
|
|
194
194
|
preview: e.preview,
|
|
195
195
|
htmlPreview: e.preview ? !1 : e.htmlPreview,
|
|
196
196
|
previewOnly: !1
|
|
197
|
-
}),
|
|
198
|
-
const r = i === void 0 ? !
|
|
197
|
+
}), d = ie({ ...n }), s = (l, i) => {
|
|
198
|
+
const r = i === void 0 ? !n[l] : i;
|
|
199
199
|
switch (l) {
|
|
200
200
|
case "preview": {
|
|
201
|
-
|
|
201
|
+
n.htmlPreview = !1, n.previewOnly = !1;
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "htmlPreview": {
|
|
205
|
-
|
|
205
|
+
n.preview = !1, n.previewOnly = !1;
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
case "previewOnly": {
|
|
209
|
-
r ? !
|
|
209
|
+
r ? !n.preview && !n.htmlPreview && (n.preview = !0) : (d.preview || (n.preview = !1), d.htmlPreview || (n.htmlPreview = !1));
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
d[l] = r, n[l] = r;
|
|
214
214
|
};
|
|
215
|
-
let
|
|
216
|
-
const
|
|
217
|
-
|
|
215
|
+
let c = "";
|
|
216
|
+
const u = () => {
|
|
217
|
+
n.pageFullscreen || n.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = c;
|
|
218
218
|
};
|
|
219
|
-
return
|
|
220
|
-
b.on(
|
|
221
|
-
name:
|
|
219
|
+
return x(() => [n.pageFullscreen, n.fullscreen], u), M(() => {
|
|
220
|
+
b.on(o, {
|
|
221
|
+
name: Ge,
|
|
222
222
|
callback(l, i) {
|
|
223
223
|
const r = (m) => {
|
|
224
|
-
|
|
224
|
+
ce(o, {
|
|
225
225
|
direct: "image",
|
|
226
226
|
params: {
|
|
227
227
|
desc: "",
|
|
@@ -231,53 +231,53 @@ const P = {
|
|
|
231
231
|
};
|
|
232
232
|
e.onUploadImg ? e.onUploadImg(l, r) : t.emit("onUploadImg", l, r);
|
|
233
233
|
}
|
|
234
|
-
}),
|
|
235
|
-
}), [
|
|
236
|
-
},
|
|
237
|
-
const { editorId: a } = t,
|
|
234
|
+
}), c = document.body.style.overflow, u();
|
|
235
|
+
}), [n, s];
|
|
236
|
+
}, ln = (e, t) => {
|
|
237
|
+
const { editorId: a } = t, o = z(!1);
|
|
238
238
|
return M(() => {
|
|
239
239
|
b.on(a, {
|
|
240
|
-
name:
|
|
241
|
-
callback: (
|
|
242
|
-
|
|
240
|
+
name: Te,
|
|
241
|
+
callback: (n) => {
|
|
242
|
+
n === void 0 ? o.value = !o.value : o.value = n;
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
|
-
}),
|
|
246
|
-
},
|
|
247
|
-
const { editorId:
|
|
248
|
-
|
|
249
|
-
() =>
|
|
245
|
+
}), o;
|
|
246
|
+
}, sn = (e, t, a) => {
|
|
247
|
+
const { editorId: o, catalogVisible: n, setting: d, updateSetting: s, codeRef: c } = a;
|
|
248
|
+
x(
|
|
249
|
+
() => d.pageFullscreen,
|
|
250
250
|
(l) => {
|
|
251
|
-
b.emit(
|
|
251
|
+
b.emit(o, he, l);
|
|
252
252
|
}
|
|
253
|
-
),
|
|
254
|
-
() =>
|
|
253
|
+
), x(
|
|
254
|
+
() => d.fullscreen,
|
|
255
255
|
(l) => {
|
|
256
|
-
b.emit(
|
|
256
|
+
b.emit(o, pe, l);
|
|
257
257
|
}
|
|
258
|
-
),
|
|
259
|
-
() =>
|
|
258
|
+
), x(
|
|
259
|
+
() => d.preview,
|
|
260
260
|
(l) => {
|
|
261
|
-
b.emit(
|
|
261
|
+
b.emit(o, ge, l);
|
|
262
262
|
}
|
|
263
|
-
),
|
|
264
|
-
() =>
|
|
263
|
+
), x(
|
|
264
|
+
() => d.previewOnly,
|
|
265
265
|
(l) => {
|
|
266
|
-
b.emit(
|
|
266
|
+
b.emit(o, ve, l);
|
|
267
267
|
}
|
|
268
|
-
),
|
|
269
|
-
() =>
|
|
268
|
+
), x(
|
|
269
|
+
() => d.htmlPreview,
|
|
270
270
|
(l) => {
|
|
271
|
-
b.emit(
|
|
271
|
+
b.emit(o, ye, l);
|
|
272
272
|
}
|
|
273
|
-
),
|
|
274
|
-
b.emit(
|
|
273
|
+
), x(n, (l) => {
|
|
274
|
+
b.emit(o, be, l);
|
|
275
275
|
});
|
|
276
|
-
const
|
|
276
|
+
const u = {
|
|
277
277
|
on(l, i) {
|
|
278
278
|
switch (l) {
|
|
279
279
|
case "pageFullscreen": {
|
|
280
|
-
b.on(
|
|
280
|
+
b.on(o, {
|
|
281
281
|
name: he,
|
|
282
282
|
callback(r) {
|
|
283
283
|
i(r);
|
|
@@ -286,7 +286,7 @@ const P = {
|
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
case "fullscreen": {
|
|
289
|
-
b.on(
|
|
289
|
+
b.on(o, {
|
|
290
290
|
name: pe,
|
|
291
291
|
callback(r) {
|
|
292
292
|
i(r);
|
|
@@ -295,7 +295,7 @@ const P = {
|
|
|
295
295
|
break;
|
|
296
296
|
}
|
|
297
297
|
case "preview": {
|
|
298
|
-
b.on(
|
|
298
|
+
b.on(o, {
|
|
299
299
|
name: ge,
|
|
300
300
|
callback(r) {
|
|
301
301
|
i(r);
|
|
@@ -304,7 +304,7 @@ const P = {
|
|
|
304
304
|
break;
|
|
305
305
|
}
|
|
306
306
|
case "previewOnly": {
|
|
307
|
-
b.on(
|
|
307
|
+
b.on(o, {
|
|
308
308
|
name: ve,
|
|
309
309
|
callback(r) {
|
|
310
310
|
i(r);
|
|
@@ -313,7 +313,7 @@ const P = {
|
|
|
313
313
|
break;
|
|
314
314
|
}
|
|
315
315
|
case "htmlPreview": {
|
|
316
|
-
b.on(
|
|
316
|
+
b.on(o, {
|
|
317
317
|
name: ye,
|
|
318
318
|
callback(r) {
|
|
319
319
|
i(r);
|
|
@@ -322,7 +322,7 @@ const P = {
|
|
|
322
322
|
break;
|
|
323
323
|
}
|
|
324
324
|
case "catalog": {
|
|
325
|
-
b.on(
|
|
325
|
+
b.on(o, {
|
|
326
326
|
name: be,
|
|
327
327
|
callback(r) {
|
|
328
328
|
i(r);
|
|
@@ -333,108 +333,108 @@ const P = {
|
|
|
333
333
|
}
|
|
334
334
|
},
|
|
335
335
|
togglePageFullscreen(l) {
|
|
336
|
-
|
|
336
|
+
s("pageFullscreen", l);
|
|
337
337
|
},
|
|
338
338
|
toggleFullscreen(l) {
|
|
339
|
-
b.emit(
|
|
339
|
+
b.emit(o, ze, l);
|
|
340
340
|
},
|
|
341
341
|
togglePreview(l) {
|
|
342
|
-
|
|
342
|
+
s("preview", l);
|
|
343
343
|
},
|
|
344
344
|
togglePreviewOnly(l) {
|
|
345
|
-
|
|
345
|
+
s("previewOnly", l);
|
|
346
346
|
},
|
|
347
347
|
toggleHtmlPreview(l) {
|
|
348
|
-
|
|
348
|
+
s("htmlPreview", l);
|
|
349
349
|
},
|
|
350
350
|
toggleCatalog(l) {
|
|
351
|
-
b.emit(
|
|
351
|
+
b.emit(o, Te, l);
|
|
352
352
|
},
|
|
353
353
|
triggerSave() {
|
|
354
|
-
b.emit(
|
|
354
|
+
b.emit(o, Se);
|
|
355
355
|
},
|
|
356
356
|
insert(l) {
|
|
357
|
-
|
|
357
|
+
ce(o, {
|
|
358
358
|
direct: "universal",
|
|
359
359
|
params: { generate: l },
|
|
360
360
|
source: "programmatic"
|
|
361
361
|
});
|
|
362
362
|
},
|
|
363
363
|
focus(l) {
|
|
364
|
-
|
|
364
|
+
c.value?.focus(l);
|
|
365
365
|
},
|
|
366
366
|
rerender() {
|
|
367
|
-
b.emit(
|
|
367
|
+
b.emit(o, ue);
|
|
368
368
|
},
|
|
369
369
|
getSelectedText() {
|
|
370
|
-
return
|
|
370
|
+
return c.value?.getSelectedText();
|
|
371
371
|
},
|
|
372
372
|
resetHistory() {
|
|
373
|
-
|
|
373
|
+
c.value?.resetHistory();
|
|
374
374
|
},
|
|
375
375
|
domEventHandlers(l) {
|
|
376
|
-
b.emit(
|
|
376
|
+
b.emit(o, Ue, l);
|
|
377
377
|
},
|
|
378
378
|
execCommand(l) {
|
|
379
|
-
|
|
379
|
+
ce(o, { direct: l, source: "programmatic" });
|
|
380
380
|
},
|
|
381
381
|
getEditorView() {
|
|
382
|
-
return
|
|
382
|
+
return c.value?.getEditorView();
|
|
383
383
|
}
|
|
384
384
|
};
|
|
385
|
-
t.expose(
|
|
386
|
-
},
|
|
387
|
-
const t =
|
|
385
|
+
t.expose(u);
|
|
386
|
+
}, rt = (e) => {
|
|
387
|
+
const t = Me();
|
|
388
388
|
return e.id || e.editorId || `${h}-${t}`;
|
|
389
|
-
},
|
|
390
|
-
const
|
|
391
|
-
|
|
389
|
+
}, lt = (e, t, a) => {
|
|
390
|
+
const o = $("editorId"), n = $("rootRef"), d = $("usedLanguageText"), s = $("setting"), c = () => {
|
|
391
|
+
n.value.querySelectorAll(`#${o} .${h}-preview .${h}-code`).forEach((i) => {
|
|
392
392
|
let r = -1;
|
|
393
393
|
const m = i.querySelector(
|
|
394
394
|
`.${h}-copy-button:not([data-processed])`
|
|
395
395
|
);
|
|
396
396
|
m && (m.onclick = (f) => {
|
|
397
397
|
f.preventDefault(), clearTimeout(r);
|
|
398
|
-
const g = (i.querySelector("input:checked + pre code") || i.querySelector("pre code")).textContent, { text: v, successTips: E, failTips: y } =
|
|
399
|
-
let
|
|
400
|
-
|
|
401
|
-
|
|
398
|
+
const g = (i.querySelector("input:checked + pre code") || i.querySelector("pre code")).textContent, { text: v, successTips: E, failTips: y } = d.value.copyCode;
|
|
399
|
+
let w = E;
|
|
400
|
+
Ye(e.formatCopiedText(g || "")).catch(() => {
|
|
401
|
+
w = y;
|
|
402
402
|
}).finally(() => {
|
|
403
|
-
m.dataset.isIcon ? m.dataset.tips =
|
|
403
|
+
m.dataset.isIcon ? m.dataset.tips = w : m.textContent = w, r = window.setTimeout(() => {
|
|
404
404
|
m.dataset.isIcon ? m.dataset.tips = v : m.textContent = v;
|
|
405
405
|
}, 1500);
|
|
406
406
|
});
|
|
407
407
|
}, m.setAttribute("data-processed", "true"));
|
|
408
408
|
});
|
|
409
|
-
},
|
|
410
|
-
W(
|
|
409
|
+
}, u = () => {
|
|
410
|
+
W(c);
|
|
411
411
|
}, l = (i) => {
|
|
412
|
-
i && W(
|
|
412
|
+
i && W(c);
|
|
413
413
|
};
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
const t =
|
|
417
|
-
let
|
|
418
|
-
const
|
|
419
|
-
!e.noEcharts &&
|
|
414
|
+
x([t, a], u), x(() => s.value.preview, l), x(() => s.value.htmlPreview, l), M(c);
|
|
415
|
+
}, it = (e) => {
|
|
416
|
+
const t = $("editorId"), a = $("theme"), o = $("rootRef"), { editorExtensions: n, editorExtensionsAttrs: d, echartsConfig: s } = L;
|
|
417
|
+
let c = n.echarts.instance;
|
|
418
|
+
const u = te(-1), l = () => {
|
|
419
|
+
!e.noEcharts && c && (u.value = u.value + 1);
|
|
420
420
|
};
|
|
421
|
-
|
|
421
|
+
x(
|
|
422
422
|
() => a.value,
|
|
423
423
|
() => {
|
|
424
424
|
l();
|
|
425
425
|
}
|
|
426
426
|
), M(() => {
|
|
427
|
-
if (e.noEcharts ||
|
|
427
|
+
if (e.noEcharts || c)
|
|
428
428
|
return;
|
|
429
|
-
const g =
|
|
429
|
+
const g = n.echarts.js;
|
|
430
430
|
O(
|
|
431
431
|
"script",
|
|
432
432
|
{
|
|
433
|
-
...
|
|
433
|
+
...d.echarts?.js,
|
|
434
434
|
src: g,
|
|
435
435
|
id: P.echarts,
|
|
436
436
|
onload() {
|
|
437
|
-
|
|
437
|
+
c = window.echarts, l();
|
|
438
438
|
}
|
|
439
439
|
},
|
|
440
440
|
"echarts"
|
|
@@ -443,25 +443,25 @@ const P = {
|
|
|
443
443
|
let i = [], r = [], m = [];
|
|
444
444
|
const f = (g = !1) => {
|
|
445
445
|
if (!i.length) {
|
|
446
|
-
g && (r.forEach((
|
|
447
|
-
|
|
448
|
-
}), m.forEach((
|
|
449
|
-
|
|
446
|
+
g && (r.forEach((w) => {
|
|
447
|
+
w.dispose?.();
|
|
448
|
+
}), m.forEach((w) => {
|
|
449
|
+
w.disconnect?.();
|
|
450
450
|
}), r = [], m = []);
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
453
|
const v = [], E = [], y = [];
|
|
454
|
-
i.forEach((
|
|
455
|
-
const
|
|
456
|
-
if (g ||
|
|
457
|
-
|
|
454
|
+
i.forEach((w, S) => {
|
|
455
|
+
const C = r[S], k = m[S];
|
|
456
|
+
if (g || !w || !w.isConnected || (o?.value ? !o.value.contains(w) : !1)) {
|
|
457
|
+
C?.dispose?.(), k?.disconnect?.();
|
|
458
458
|
return;
|
|
459
459
|
}
|
|
460
|
-
v.push(
|
|
460
|
+
v.push(w), C && E.push(C), k && y.push(k);
|
|
461
461
|
}), i = v, r = E, m = y;
|
|
462
462
|
}, p = () => {
|
|
463
|
-
if (f(), !e.noEcharts &&
|
|
464
|
-
const g =
|
|
463
|
+
if (f(), !e.noEcharts && c) {
|
|
464
|
+
const g = o.value;
|
|
465
465
|
if (!g) return;
|
|
466
466
|
Array.from(
|
|
467
467
|
g.querySelectorAll(
|
|
@@ -471,17 +471,17 @@ const P = {
|
|
|
471
471
|
if (E.dataset.closed === "false")
|
|
472
472
|
return !1;
|
|
473
473
|
try {
|
|
474
|
-
const y =
|
|
474
|
+
const y = n.echarts.parseOption(E.innerText, {
|
|
475
475
|
editorId: t,
|
|
476
476
|
element: E
|
|
477
|
-
}),
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
477
|
+
}), w = s(y), S = c.init(E, a.value);
|
|
478
|
+
S.setOption(w), E.setAttribute("data-processed", ""), i.push(E), r.push(S);
|
|
479
|
+
const C = new ResizeObserver(() => {
|
|
480
|
+
S.resize();
|
|
481
481
|
});
|
|
482
|
-
|
|
482
|
+
C.observe(E), m.push(C);
|
|
483
483
|
} catch (y) {
|
|
484
|
-
b.emit(t,
|
|
484
|
+
b.emit(t, ee, {
|
|
485
485
|
name: "echarts",
|
|
486
486
|
message: y?.message,
|
|
487
487
|
error: y
|
|
@@ -490,11 +490,11 @@ const P = {
|
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
return
|
|
493
|
+
return ne(() => {
|
|
494
494
|
f(!0);
|
|
495
|
-
}), { reRenderEcharts:
|
|
496
|
-
},
|
|
497
|
-
const t =
|
|
495
|
+
}), { reRenderEcharts: u, replaceEcharts: p };
|
|
496
|
+
}, st = (e) => {
|
|
497
|
+
const t = $("highlight"), a = te(L.editorExtensions.highlight.instance);
|
|
498
498
|
return M(() => {
|
|
499
499
|
e.noHighlight || a.value || (O("link", {
|
|
500
500
|
...t.value.css,
|
|
@@ -511,26 +511,26 @@ const P = {
|
|
|
511
511
|
},
|
|
512
512
|
"hljs"
|
|
513
513
|
));
|
|
514
|
-
}),
|
|
514
|
+
}), x(
|
|
515
515
|
() => t.value.css,
|
|
516
516
|
() => {
|
|
517
|
-
e.noHighlight || L.editorExtensions.highlight.instance ||
|
|
517
|
+
e.noHighlight || L.editorExtensions.highlight.instance || Ke("link", {
|
|
518
518
|
...t.value.css,
|
|
519
519
|
rel: "stylesheet",
|
|
520
520
|
id: P.hlcss
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
523
|
), a;
|
|
524
|
-
},
|
|
525
|
-
const t =
|
|
524
|
+
}, ct = (e) => {
|
|
525
|
+
const t = te(L.editorExtensions.katex.instance);
|
|
526
526
|
return M(() => {
|
|
527
527
|
if (e.noKatex || t.value)
|
|
528
528
|
return;
|
|
529
|
-
const { editorExtensions: a, editorExtensionsAttrs:
|
|
529
|
+
const { editorExtensions: a, editorExtensionsAttrs: o } = L;
|
|
530
530
|
O(
|
|
531
531
|
"script",
|
|
532
532
|
{
|
|
533
|
-
...
|
|
533
|
+
...o.katex?.js,
|
|
534
534
|
src: a.katex.js,
|
|
535
535
|
id: P.katexjs,
|
|
536
536
|
onload() {
|
|
@@ -539,14 +539,14 @@ const P = {
|
|
|
539
539
|
},
|
|
540
540
|
"katex"
|
|
541
541
|
), O("link", {
|
|
542
|
-
...
|
|
542
|
+
...o.katex?.css,
|
|
543
543
|
rel: "stylesheet",
|
|
544
544
|
href: a.katex.css,
|
|
545
545
|
id: P.katexcss
|
|
546
546
|
});
|
|
547
547
|
}), t;
|
|
548
548
|
};
|
|
549
|
-
class
|
|
549
|
+
class dt {
|
|
550
550
|
constructor(t) {
|
|
551
551
|
this.options = t;
|
|
552
552
|
}
|
|
@@ -556,8 +556,8 @@ class ct {
|
|
|
556
556
|
return t.expiresAt <= Date.now();
|
|
557
557
|
}
|
|
558
558
|
deleteExpired(t, a) {
|
|
559
|
-
const
|
|
560
|
-
return !
|
|
559
|
+
const o = a ?? this.cache.get(t);
|
|
560
|
+
return !o || !this.isExpired(o) ? !1 : (this.cache.delete(t), !0);
|
|
561
561
|
}
|
|
562
562
|
trim() {
|
|
563
563
|
for (const [t, a] of this.cache)
|
|
@@ -585,15 +585,15 @@ class ct {
|
|
|
585
585
|
this.cache.clear();
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
const
|
|
588
|
+
const Q = new dt({
|
|
589
589
|
max: 1e3,
|
|
590
590
|
// 缓存10分钟
|
|
591
591
|
ttl: 6e5
|
|
592
|
-
}),
|
|
593
|
-
const t =
|
|
594
|
-
let
|
|
595
|
-
const
|
|
596
|
-
if (!e.noMermaid &&
|
|
592
|
+
}), ut = (e) => {
|
|
593
|
+
const t = $("editorId"), a = $("theme"), o = $("rootRef"), { editorExtensions: n, editorExtensionsAttrs: d, mermaidConfig: s } = L;
|
|
594
|
+
let c = n.mermaid.instance;
|
|
595
|
+
const u = te(-1), l = () => {
|
|
596
|
+
if (!e.noMermaid && c) {
|
|
597
597
|
const r = a.value === "dark" ? {
|
|
598
598
|
startOnLoad: !1,
|
|
599
599
|
theme: "dark"
|
|
@@ -613,20 +613,20 @@ const Y = new ct({
|
|
|
613
613
|
clusterBorder: "#b7c0cc"
|
|
614
614
|
}
|
|
615
615
|
};
|
|
616
|
-
|
|
616
|
+
c.initialize(s(r)), u.value = u.value + 1;
|
|
617
617
|
}
|
|
618
618
|
};
|
|
619
|
-
return
|
|
619
|
+
return x(
|
|
620
620
|
() => a.value,
|
|
621
621
|
() => {
|
|
622
|
-
|
|
622
|
+
Q.clear(), l();
|
|
623
623
|
}
|
|
624
624
|
), M(() => {
|
|
625
|
-
if (e.noMermaid ||
|
|
625
|
+
if (e.noMermaid || c)
|
|
626
626
|
return;
|
|
627
|
-
const r =
|
|
627
|
+
const r = n.mermaid.js;
|
|
628
628
|
/\.mjs/.test(r) ? (O("link", {
|
|
629
|
-
...
|
|
629
|
+
...d.mermaid?.js,
|
|
630
630
|
rel: "modulepreload",
|
|
631
631
|
href: r,
|
|
632
632
|
id: P.mermaidM
|
|
@@ -635,9 +635,9 @@ const Y = new ct({
|
|
|
635
635
|
/* webpackIgnore: true */
|
|
636
636
|
r
|
|
637
637
|
).then((m) => {
|
|
638
|
-
|
|
638
|
+
c = m.default, l();
|
|
639
639
|
}).catch((m) => {
|
|
640
|
-
b.emit(t,
|
|
640
|
+
b.emit(t, ee, {
|
|
641
641
|
name: "mermaid",
|
|
642
642
|
message: `Failed to load mermaid module: ${m.message}`,
|
|
643
643
|
error: m
|
|
@@ -645,18 +645,18 @@ const Y = new ct({
|
|
|
645
645
|
})) : O(
|
|
646
646
|
"script",
|
|
647
647
|
{
|
|
648
|
-
...
|
|
648
|
+
...d.mermaid?.js,
|
|
649
649
|
src: r,
|
|
650
650
|
id: P.mermaid,
|
|
651
651
|
onload() {
|
|
652
|
-
|
|
652
|
+
c = window.mermaid, l();
|
|
653
653
|
}
|
|
654
654
|
},
|
|
655
655
|
"mermaid"
|
|
656
656
|
);
|
|
657
|
-
}), { reRenderRef:
|
|
658
|
-
if (!e.noMermaid &&
|
|
659
|
-
const r =
|
|
657
|
+
}), { reRenderRef: u, replaceMermaid: async () => {
|
|
658
|
+
if (!e.noMermaid && c) {
|
|
659
|
+
const r = o.value;
|
|
660
660
|
if (!r) return;
|
|
661
661
|
const m = r.querySelectorAll(
|
|
662
662
|
`div.${h}-mermaid`
|
|
@@ -669,20 +669,20 @@ const Y = new ct({
|
|
|
669
669
|
Array.from(m).map((v) => (async (y) => {
|
|
670
670
|
if (y.dataset.closed === "false")
|
|
671
671
|
return !1;
|
|
672
|
-
const
|
|
673
|
-
let
|
|
674
|
-
if (!
|
|
675
|
-
const
|
|
676
|
-
let
|
|
672
|
+
const w = y.innerText;
|
|
673
|
+
let S = Q.get(w);
|
|
674
|
+
if (!S) {
|
|
675
|
+
const C = se();
|
|
676
|
+
let k = { svg: "" };
|
|
677
677
|
try {
|
|
678
|
-
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
} catch (
|
|
682
|
-
b.emit(t,
|
|
678
|
+
k = await c.render(C, w, f), S = await e.sanitizeMermaid(k.svg);
|
|
679
|
+
const I = document.createElement("p");
|
|
680
|
+
I.className = `${h}-mermaid`, I.setAttribute("data-processed", ""), I.setAttribute("data-content", w), I.innerHTML = S, I.children[0]?.removeAttribute("height"), Q.set(w, I.innerHTML), y.dataset.line !== void 0 && (I.dataset.line = y.dataset.line), y.replaceWith(I);
|
|
681
|
+
} catch (I) {
|
|
682
|
+
b.emit(t, ee, {
|
|
683
683
|
name: "mermaid",
|
|
684
|
-
message:
|
|
685
|
-
error:
|
|
684
|
+
message: I.message,
|
|
685
|
+
error: I
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
}
|
|
@@ -693,11 +693,11 @@ const Y = new ct({
|
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
} };
|
|
696
|
-
},
|
|
696
|
+
}, mt = (e, t) => {
|
|
697
697
|
t = t || {};
|
|
698
|
-
const a = 3,
|
|
699
|
-
let
|
|
700
|
-
const
|
|
698
|
+
const a = 3, o = t.marker || "!", n = o.charCodeAt(0), d = o.length;
|
|
699
|
+
let s = "", c = "";
|
|
700
|
+
const u = (i, r, m, f, p) => {
|
|
701
701
|
const g = i[r];
|
|
702
702
|
return g.type === "admonition_open" ? i[r].attrPush([
|
|
703
703
|
"class",
|
|
@@ -705,106 +705,106 @@ const Y = new ct({
|
|
|
705
705
|
]) : g.type === "admonition_title_open" && i[r].attrPush(["class", `${h}-admonition-title`]), p.renderToken(i, r, m);
|
|
706
706
|
}, l = (i) => {
|
|
707
707
|
const r = i.trim().split(" ", 2);
|
|
708
|
-
|
|
708
|
+
c = "", s = r[0], r.length > 1 && (c = i.substring(s.length + 2));
|
|
709
709
|
};
|
|
710
710
|
e.block.ruler.before(
|
|
711
711
|
"code",
|
|
712
712
|
"admonition",
|
|
713
713
|
(i, r, m, f) => {
|
|
714
|
-
let p, g, v, E = !1, y = i.bMarks[r] + i.tShift[r],
|
|
715
|
-
if (
|
|
714
|
+
let p, g, v, E = !1, y = i.bMarks[r] + i.tShift[r], w = i.eMarks[r];
|
|
715
|
+
if (n !== i.src.charCodeAt(y))
|
|
716
716
|
return !1;
|
|
717
|
-
for (p = y + 1; p <=
|
|
717
|
+
for (p = y + 1; p <= w && o[(p - y) % d] === i.src[p]; p++)
|
|
718
718
|
;
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
719
|
+
const S = Math.floor((p - y) / d);
|
|
720
|
+
if (S !== a)
|
|
721
721
|
return !1;
|
|
722
|
-
p -= (p - y) %
|
|
723
|
-
const
|
|
724
|
-
if (l(
|
|
722
|
+
p -= (p - y) % d;
|
|
723
|
+
const C = i.src.slice(y, p), k = i.src.slice(p, w);
|
|
724
|
+
if (l(k), f)
|
|
725
725
|
return !0;
|
|
726
|
-
for (g = r; g++, !(g >= m || (y = i.bMarks[g] + i.tShift[g],
|
|
727
|
-
if (
|
|
728
|
-
for (p = y + 1; p <=
|
|
726
|
+
for (g = r; g++, !(g >= m || (y = i.bMarks[g] + i.tShift[g], w = i.eMarks[g], y < w && i.sCount[g] < i.blkIndent)); )
|
|
727
|
+
if (n === i.src.charCodeAt(y) && !(i.sCount[g] - i.blkIndent >= 4)) {
|
|
728
|
+
for (p = y + 1; p <= w && o[(p - y) % d] === i.src[p]; p++)
|
|
729
729
|
;
|
|
730
|
-
if (!(Math.floor((p - y) /
|
|
730
|
+
if (!(Math.floor((p - y) / d) < S) && (p -= (p - y) % d, p = i.skipSpaces(p), !(p < w))) {
|
|
731
731
|
E = !0;
|
|
732
732
|
break;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
const
|
|
736
|
-
return i.parentType = "root", i.lineMax = g, v = i.push("admonition_open", "div", 1), v.markup =
|
|
735
|
+
const I = i.parentType, R = i.lineMax;
|
|
736
|
+
return i.parentType = "root", i.lineMax = g, v = i.push("admonition_open", "div", 1), v.markup = C, v.block = !0, v.info = s, v.map = [r, g], c && (v = i.push("admonition_title_open", "p", 1), v.markup = C + " " + s, v.map = [r, g], v = i.push("inline", "", 0), v.content = c, v.map = [r, i.line - 1], v.children = [], v = i.push("admonition_title_close", "p", -1), v.markup = C + " " + s), i.md.block.tokenize(i, r + 1, g), v = i.push("admonition_close", "div", -1), v.markup = i.src.slice(y, p), v.block = !0, i.parentType = I, i.lineMax = R, i.line = g + (E ? 1 : 0), !0;
|
|
737
737
|
},
|
|
738
738
|
{
|
|
739
739
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
740
740
|
}
|
|
741
|
-
), e.renderer.rules.admonition_open =
|
|
742
|
-
},
|
|
741
|
+
), 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;
|
|
742
|
+
}, J = (e, t, a) => `<${e.tag}${a.renderAttrs(e)}>${t}</${e.tag}>`, we = (e, t) => {
|
|
743
743
|
const a = e.attrs ? e.attrs.slice() : [];
|
|
744
|
-
return t.forEach((
|
|
745
|
-
const
|
|
746
|
-
|
|
744
|
+
return t.forEach((o) => {
|
|
745
|
+
const n = e.attrIndex(o[0]);
|
|
746
|
+
n < 0 ? a.push(o) : (a[n] = a[n].slice(), a[n][1] += ` ${o[1]}`);
|
|
747
747
|
}), a;
|
|
748
|
-
},
|
|
748
|
+
}, ft = (e) => Array.from(e).map(
|
|
749
749
|
(t) => /[A-Za-z0-9_-]/.test(t) ? t : `_${t.codePointAt(0).toString(16)}_`
|
|
750
|
-
).join(""),
|
|
751
|
-
const a = e.renderer.rules.fence,
|
|
752
|
-
const f =
|
|
750
|
+
).join(""), ht = (e, t) => {
|
|
751
|
+
const a = e.renderer.rules.fence, o = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/, d = /::(open|close)/, s = ft(t.editorId), c = (m) => m.info ? o(m.info).trim() : "", u = (m) => {
|
|
752
|
+
const f = c(m), [p = null, g = ""] = (n.exec(f) || []).slice(1);
|
|
753
753
|
return [p, g];
|
|
754
754
|
}, l = (m) => {
|
|
755
|
-
const f =
|
|
755
|
+
const f = c(m);
|
|
756
756
|
return f ? f.split(/(\s+)/g)[0] : "";
|
|
757
757
|
}, i = (m) => {
|
|
758
|
-
const f = m.info.match(
|
|
758
|
+
const f = m.info.match(d) || [], p = f[1] === "open" || f[1] !== "close" && t.codeFoldable && m.content.trim().split(`
|
|
759
759
|
`).length < t.autoFoldThreshold, g = f[1] || t.codeFoldable ? "details" : "div", v = f[1] || t.codeFoldable ? "summary" : "div";
|
|
760
760
|
return { open: p, tagContainer: g, tagHeader: v };
|
|
761
761
|
}, r = (m, f, p, g, v) => {
|
|
762
762
|
if (m[f].hidden)
|
|
763
763
|
return "";
|
|
764
|
-
const E = t.usedLanguageTextRef.value?.copyCode.text || "", y = t.customIconRef.value.copy,
|
|
765
|
-
if (
|
|
766
|
-
const { open:
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
attrs:
|
|
764
|
+
const E = t.usedLanguageTextRef.value?.copyCode.text || "", y = t.customIconRef.value.copy, w = e.utils.escapeHtml(E), S = y || w, C = !!y, k = `<span class="${h}-collapse-tips">${Ze("collapse-tips", t.customIconRef.value)}</span>`, [I] = u(m[f]);
|
|
765
|
+
if (I === null) {
|
|
766
|
+
const { open: F, tagContainer: _, tagHeader: X } = i(m[f]), U = [["class", `${h}-code`]];
|
|
767
|
+
F && U.push(["open", ""]);
|
|
768
|
+
const Re = {
|
|
769
|
+
attrs: we(m[f], U)
|
|
770
770
|
};
|
|
771
|
-
m[f].info = m[f].info.replace(
|
|
772
|
-
const
|
|
771
|
+
m[f].info = m[f].info.replace(d, "");
|
|
772
|
+
const He = a(m, f, p, g, v);
|
|
773
773
|
return `
|
|
774
|
-
<${_} ${v.renderAttrs(
|
|
775
|
-
<${
|
|
774
|
+
<${_} ${v.renderAttrs(Re)}>
|
|
775
|
+
<${X} class="${h}-code-head">
|
|
776
776
|
<div class="${h}-code-flag"><span></span><span></span><span></span></div>
|
|
777
777
|
<div class="${h}-code-action">
|
|
778
778
|
<span class="${h}-code-lang">${e.utils.escapeHtml(m[f].info.trim())}</span>
|
|
779
|
-
<span class="${h}-copy-button" data-tips="${
|
|
779
|
+
<span class="${h}-copy-button" data-tips="${w}"${C ? " data-is-icon=true" : ""}>${S}</span>
|
|
780
780
|
${t.extraTools instanceof Function ? t.extraTools({ lang: m[f].info.trim() }) : t.extraTools || ""}
|
|
781
|
-
${_ === "details" ?
|
|
781
|
+
${_ === "details" ? k : ""}
|
|
782
782
|
</div>
|
|
783
|
-
</${
|
|
784
|
-
${
|
|
783
|
+
</${X}>
|
|
784
|
+
${He}
|
|
785
785
|
</${_}>
|
|
786
786
|
`;
|
|
787
787
|
}
|
|
788
|
-
let R,
|
|
789
|
-
const { open:
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
attrs:
|
|
788
|
+
let R, N, V, B, q = "", K = "", Z = "";
|
|
789
|
+
const { open: oe, tagContainer: G, tagHeader: H } = i(m[f]), D = [["class", `${h}-code`]];
|
|
790
|
+
oe && D.push(["open", ""]);
|
|
791
|
+
const ae = {
|
|
792
|
+
attrs: we(m[f], D)
|
|
793
793
|
};
|
|
794
|
-
for (let
|
|
795
|
-
R.info = R.info.replace(
|
|
796
|
-
const _ = `${h}-codetab-${
|
|
797
|
-
|
|
794
|
+
for (let F = f; F < m.length && (R = m[F], [N, V] = u(R), N === I); F++) {
|
|
795
|
+
R.info = R.info.replace(n, "").replace(d, ""), R.hidden = !0;
|
|
796
|
+
const _ = `${h}-codetab-${s}-${f}-${F - f}`;
|
|
797
|
+
B = F - f > 0 ? "" : "checked", q += `
|
|
798
798
|
<li>
|
|
799
799
|
<input
|
|
800
800
|
type="radio"
|
|
801
|
-
id="label-${h}-codetab-label-1-${
|
|
802
|
-
name="${h}-codetab-label-${
|
|
801
|
+
id="label-${h}-codetab-label-1-${s}-${f}-${F - f}"
|
|
802
|
+
name="${h}-codetab-label-${s}-${f}"
|
|
803
803
|
class="${_}"
|
|
804
|
-
${
|
|
804
|
+
${B}
|
|
805
805
|
>
|
|
806
806
|
<label
|
|
807
|
-
for="label-${h}-codetab-label-1-${
|
|
807
|
+
for="label-${h}-codetab-label-1-${s}-${f}-${F - f}"
|
|
808
808
|
onclick="this.getRootNode().querySelectorAll('.${_}').forEach(e => e.click())"
|
|
809
809
|
>
|
|
810
810
|
${e.utils.escapeHtml(V || l(R))}
|
|
@@ -813,31 +813,31 @@ const Y = new ct({
|
|
|
813
813
|
<div role="tabpanel">
|
|
814
814
|
<input
|
|
815
815
|
type="radio"
|
|
816
|
-
name="${h}-codetab-pre-${
|
|
816
|
+
name="${h}-codetab-pre-${s}-${f}"
|
|
817
817
|
class="${_}"
|
|
818
|
-
${
|
|
818
|
+
${B}
|
|
819
819
|
role="presentation">
|
|
820
|
-
${a(m,
|
|
820
|
+
${a(m, F, p, g, v)}
|
|
821
821
|
</div>`, Z += `
|
|
822
822
|
<input
|
|
823
823
|
type="radio"
|
|
824
|
-
name="${h}-codetab-lang-${
|
|
824
|
+
name="${h}-codetab-lang-${s}-${f}"
|
|
825
825
|
class="${_}"
|
|
826
|
-
${
|
|
826
|
+
${B}
|
|
827
827
|
role="presentation">
|
|
828
828
|
<span class=${h}-code-lang role="note">${e.utils.escapeHtml(l(R))}</span>`;
|
|
829
829
|
}
|
|
830
830
|
return `
|
|
831
|
-
<${G} ${v.renderAttrs(
|
|
831
|
+
<${G} ${v.renderAttrs(ae)}>
|
|
832
832
|
<${H} class="${h}-code-head">
|
|
833
833
|
<div class="${h}-code-flag">
|
|
834
834
|
<ul class="${h}-codetab-label" role="tablist">${q}</ul>
|
|
835
835
|
</div>
|
|
836
836
|
<div class="${h}-code-action">
|
|
837
837
|
<span class="${h}-codetab-lang">${Z}</span>
|
|
838
|
-
<span class="${h}-copy-button" data-tips="${
|
|
838
|
+
<span class="${h}-copy-button" data-tips="${w}"${C ? " data-is-icon=true" : ""}>${S}</span>
|
|
839
839
|
${t.extraTools instanceof Function ? t.extraTools({ lang: m[f].info.trim() }) : t.extraTools || ""}
|
|
840
|
-
${G === "details" ?
|
|
840
|
+
${G === "details" ? k : ""}
|
|
841
841
|
</div>
|
|
842
842
|
</${H}>
|
|
843
843
|
${K}
|
|
@@ -845,40 +845,41 @@ const Y = new ct({
|
|
|
845
845
|
`;
|
|
846
846
|
};
|
|
847
847
|
e.renderer.rules.fence = r, e.renderer.rules.code_block = r;
|
|
848
|
-
},
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
const i = s.map[1] - 1, m = !!c.srcLines[i]?.trim()?.startsWith("```");
|
|
855
|
-
s.attrSet("data-closed", `${m}`), s.attrSet("data-line", String(s.map[0]));
|
|
848
|
+
}, pt = (e, t) => {
|
|
849
|
+
e.core.ruler.after("block", "echarts-token-attrs", (o) => {
|
|
850
|
+
o.tokens.forEach((n) => {
|
|
851
|
+
if (!(n.type !== "fence" || n.info !== "echarts") && (n.tag = "div", n.attrJoin("class", `${h}-echarts`), n.attrSet("data-echarts-theme", t.themeRef.value), n.attrSet("style", "width: 100%; aspect-ratio: 4 / 3;"), n.map && n.level === 0)) {
|
|
852
|
+
const d = n.map[1] - 1, c = !!o.env.srcLines?.[d]?.trim()?.startsWith("```");
|
|
853
|
+
n.attrSet("data-closed", `${c}`), n.attrSet("data-line", String(n.map[0]));
|
|
856
854
|
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
855
|
+
});
|
|
856
|
+
});
|
|
857
|
+
const a = e.renderer.rules.fence.bind(e.renderer.rules);
|
|
858
|
+
e.renderer.rules.fence = (o, n, d, s, c) => {
|
|
859
|
+
const u = o[n], l = u.content.trim();
|
|
860
|
+
return u.info === "echarts" ? J(u, e.utils.escapeHtml(l), c) : a(o, n, d, s, c);
|
|
860
861
|
};
|
|
861
|
-
},
|
|
862
|
-
e.renderer.rules.heading_open = (a,
|
|
863
|
-
const
|
|
862
|
+
}, gt = (e, t) => {
|
|
863
|
+
e.renderer.rules.heading_open = (a, o) => {
|
|
864
|
+
const n = a[o], d = a[o + 1].children?.reduce((c, u) => c + (["text", "code_inline", "math_inline"].includes(u.type) && u.content || ""), "") || "", s = n.markup.length;
|
|
864
865
|
return t.headsRef.value.push({
|
|
865
|
-
text:
|
|
866
|
-
level:
|
|
867
|
-
line:
|
|
868
|
-
currentToken:
|
|
869
|
-
nextToken: a[
|
|
870
|
-
}),
|
|
866
|
+
text: d,
|
|
867
|
+
level: s,
|
|
868
|
+
line: n.map[0],
|
|
869
|
+
currentToken: n,
|
|
870
|
+
nextToken: a[o + 1]
|
|
871
|
+
}), n.map && n.level === 0 && n.attrSet(
|
|
871
872
|
"id",
|
|
872
873
|
t.mdHeadingId({
|
|
873
|
-
text:
|
|
874
|
-
level:
|
|
874
|
+
text: d,
|
|
875
|
+
level: s,
|
|
875
876
|
index: t.headsRef.value.length,
|
|
876
|
-
currentToken:
|
|
877
|
-
nextToken: a[
|
|
877
|
+
currentToken: n,
|
|
878
|
+
nextToken: a[o + 1]
|
|
878
879
|
})
|
|
879
|
-
), e.renderer.renderToken(a,
|
|
880
|
-
}, e.renderer.rules.heading_close = (a,
|
|
881
|
-
},
|
|
880
|
+
), e.renderer.renderToken(a, o, t);
|
|
881
|
+
}, e.renderer.rules.heading_close = (a, o, n, d, s) => s.renderToken(a, o, n);
|
|
882
|
+
}, Ce = {
|
|
882
883
|
block: [
|
|
883
884
|
{ open: "$$", close: "$$" },
|
|
884
885
|
{ open: "\\[", close: "\\]" }
|
|
@@ -889,197 +890,202 @@ const Y = new ct({
|
|
|
889
890
|
{ open: "\\[", close: "\\]" },
|
|
890
891
|
{ open: "\\(", close: "\\)" }
|
|
891
892
|
]
|
|
892
|
-
},
|
|
893
|
-
const
|
|
894
|
-
for (const
|
|
895
|
-
if (!t.src.startsWith(
|
|
893
|
+
}, vt = (e) => (t, a) => {
|
|
894
|
+
const o = e.delimiters;
|
|
895
|
+
for (const n of o) {
|
|
896
|
+
if (!t.src.startsWith(n.open, t.pos))
|
|
896
897
|
continue;
|
|
897
|
-
const
|
|
898
|
-
let
|
|
899
|
-
for (; (
|
|
900
|
-
let
|
|
901
|
-
for (;
|
|
902
|
-
|
|
903
|
-
if (
|
|
898
|
+
const d = t.pos + n.open.length;
|
|
899
|
+
let s = d;
|
|
900
|
+
for (; (s = t.src.indexOf(n.close, s)) !== -1; ) {
|
|
901
|
+
let c = 0, u = s - 1;
|
|
902
|
+
for (; u >= 0 && t.src[u] === "\\"; )
|
|
903
|
+
c++, u--;
|
|
904
|
+
if (c % 2 === 0)
|
|
904
905
|
break;
|
|
905
|
-
|
|
906
|
+
s += n.close.length;
|
|
906
907
|
}
|
|
907
|
-
if (
|
|
908
|
-
if (
|
|
909
|
-
return a || (t.pending +=
|
|
908
|
+
if (s !== -1) {
|
|
909
|
+
if (s - d === 0)
|
|
910
|
+
return a || (t.pending += n.open + n.close), t.pos = s + n.close.length, !0;
|
|
910
911
|
if (!a) {
|
|
911
|
-
const
|
|
912
|
-
|
|
912
|
+
const c = t.push("math_inline", e.tag, 0);
|
|
913
|
+
c.attrSet("class", e.className), c.markup = n.open, c.content = t.src.slice(d, s);
|
|
913
914
|
}
|
|
914
|
-
return t.pos =
|
|
915
|
+
return t.pos = s + n.close.length, !0;
|
|
915
916
|
}
|
|
916
917
|
}
|
|
917
918
|
return !1;
|
|
918
|
-
},
|
|
919
|
-
const
|
|
919
|
+
}, yt = (e) => (t, a, o, n) => {
|
|
920
|
+
const d = e.delimiters, s = t.bMarks[a] + t.tShift[a], c = t.eMarks[a], u = (l, i, r) => {
|
|
920
921
|
t.line = i;
|
|
921
|
-
const m = t.push("math_block",
|
|
922
|
-
return m.block = !0, m.content = l, m.map = [a, t.line], m.markup = r, !0;
|
|
922
|
+
const m = t.push("math_block", e.tag, 0);
|
|
923
|
+
return m.attrSet("class", e.className), m.block = !0, m.content = l, m.map = [a, t.line], m.markup = r, !0;
|
|
923
924
|
};
|
|
924
|
-
for (const l of
|
|
925
|
-
const i =
|
|
925
|
+
for (const l of d) {
|
|
926
|
+
const i = s;
|
|
926
927
|
if (t.src.slice(i, i + l.open.length) !== l.open)
|
|
927
928
|
continue;
|
|
928
|
-
const r = i + l.open.length, m = t.src.slice(r,
|
|
929
|
+
const r = i + l.open.length, m = t.src.slice(r, c).trim(), f = m === "", p = m === l.close, g = m.endsWith(l.close);
|
|
929
930
|
if (!f && !p && !g)
|
|
930
931
|
continue;
|
|
931
|
-
if (
|
|
932
|
+
if (n)
|
|
932
933
|
return !0;
|
|
933
934
|
if (p)
|
|
934
|
-
return
|
|
935
|
+
return u("", a + 1, l.open);
|
|
935
936
|
if (!f && g) {
|
|
936
|
-
const
|
|
937
|
-
return
|
|
937
|
+
const C = m.slice(0, -l.close.length);
|
|
938
|
+
return u(C, a + 1, l.open);
|
|
938
939
|
}
|
|
939
940
|
let v = a + 1, E = !1, y = "";
|
|
940
|
-
for (; v <
|
|
941
|
-
const
|
|
942
|
-
if (
|
|
941
|
+
for (; v < o; v++) {
|
|
942
|
+
const C = t.bMarks[v] + t.tShift[v], k = t.eMarks[v];
|
|
943
|
+
if (C < k && t.tShift[v] < t.blkIndent)
|
|
943
944
|
break;
|
|
944
|
-
if (t.src.slice(
|
|
945
|
-
const R = t.src.slice(0,
|
|
946
|
-
y = t.src.slice(
|
|
945
|
+
if (t.src.slice(C, k).trim().endsWith(l.close)) {
|
|
946
|
+
const R = t.src.slice(0, k).lastIndexOf(l.close);
|
|
947
|
+
y = t.src.slice(C, R), E = !0;
|
|
947
948
|
break;
|
|
948
949
|
}
|
|
949
950
|
}
|
|
950
951
|
if (!E)
|
|
951
952
|
continue;
|
|
952
|
-
const
|
|
953
|
-
return
|
|
953
|
+
const S = t.getLines(a + 1, v, t.tShift[a], !0) + (y.trim() ? y : "");
|
|
954
|
+
return u(S, v + 1, l.open);
|
|
954
955
|
}
|
|
955
956
|
return !1;
|
|
956
|
-
},
|
|
957
|
-
const
|
|
958
|
-
const m = {
|
|
959
|
-
attrs: ce(d, [["class", s]])
|
|
960
|
-
}, f = i.renderAttrs(m);
|
|
957
|
+
}, bt = (e, { katexRef: t, inlineDelimiters: a, blockDelimiters: o }) => {
|
|
958
|
+
const n = (c, u, l = !1) => {
|
|
961
959
|
if (!t.value)
|
|
962
|
-
return
|
|
963
|
-
const
|
|
964
|
-
|
|
960
|
+
return J(c, e.utils.escapeHtml(c.content), u);
|
|
961
|
+
const i = t.value.renderToString(
|
|
962
|
+
c.content,
|
|
965
963
|
L.katexConfig({
|
|
966
964
|
throwOnError: !1,
|
|
967
|
-
displayMode:
|
|
965
|
+
displayMode: l
|
|
968
966
|
})
|
|
969
967
|
);
|
|
970
|
-
return
|
|
971
|
-
},
|
|
968
|
+
return c.attrSet("data-processed", ""), J(c, String(i), u);
|
|
969
|
+
}, d = (c, u, l, i, r) => n(c[u], r), s = (c, u, l, i, r) => n(c[u], r, !0);
|
|
972
970
|
e.inline.ruler.before(
|
|
973
971
|
"escape",
|
|
974
972
|
"math_inline",
|
|
975
|
-
|
|
976
|
-
delimiters: a ||
|
|
973
|
+
vt({
|
|
974
|
+
delimiters: a || Ce.inline,
|
|
975
|
+
className: `${h}-katex-inline`,
|
|
976
|
+
tag: "span"
|
|
977
977
|
})
|
|
978
978
|
), e.block.ruler.after(
|
|
979
979
|
"blockquote",
|
|
980
980
|
"math_block",
|
|
981
|
-
|
|
982
|
-
delimiters:
|
|
981
|
+
yt({
|
|
982
|
+
delimiters: o || Ce.block,
|
|
983
|
+
className: `${h}-katex-block`,
|
|
984
|
+
tag: "p"
|
|
983
985
|
}),
|
|
984
986
|
{
|
|
985
987
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
986
988
|
}
|
|
987
|
-
), e.renderer.rules.math_inline =
|
|
988
|
-
},
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
const r = s.map[1] - 1, f = !!c.srcLines[r]?.trim()?.startsWith("```");
|
|
995
|
-
s.attrSet("data-closed", `${f}`), s.attrSet("data-line", String(s.map[0]));
|
|
989
|
+
), e.renderer.rules.math_inline = d, e.renderer.rules.math_block = s;
|
|
990
|
+
}, wt = (e, t) => {
|
|
991
|
+
e.core.ruler.after("block", "mermaid-token-attrs", (o) => {
|
|
992
|
+
o.tokens.forEach((n) => {
|
|
993
|
+
if (!(n.type !== "fence" || n.info !== "mermaid") && (n.tag = "div", n.attrJoin("class", `${h}-mermaid`), n.attrSet("data-mermaid-theme", t.themeRef.value), n.map && n.level === 0)) {
|
|
994
|
+
const d = n.map[1] - 1, c = !!o.env.srcLines?.[d]?.trim()?.startsWith("```");
|
|
995
|
+
n.attrSet("data-closed", `${c}`), n.attrSet("data-line", String(n.map[0]));
|
|
996
996
|
}
|
|
997
|
-
|
|
998
|
-
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
const a = e.renderer.rules.fence.bind(e.renderer.rules);
|
|
1000
|
+
e.renderer.rules.fence = (o, n, d, s, c) => {
|
|
1001
|
+
const u = o[n], l = u.content.trim();
|
|
1002
|
+
if (u.info === "mermaid") {
|
|
1003
|
+
const i = Q.get(l);
|
|
1004
|
+
return i ? (u.tag = "p", u.attrSet("data-processed", ""), u.attrSet("data-content", l), J(u, i, c)) : J(u, e.utils.escapeHtml(l), c);
|
|
999
1005
|
}
|
|
1000
|
-
return a(n,
|
|
1006
|
+
return a(o, n, d, s, c);
|
|
1001
1007
|
};
|
|
1002
|
-
},
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
},
|
|
1008
|
+
}, $e = (e, t, a) => {
|
|
1009
|
+
const o = e.attrIndex(t), n = [t, a];
|
|
1010
|
+
o < 0 ? e.attrPush(n) : (e.attrs = e.attrs || [], e.attrs[o] = n);
|
|
1011
|
+
}, Ct = (e) => e.type === "inline", $t = (e) => e.type === "paragraph_open", Et = (e) => e.type === "list_item_open", xt = (e) => e.content.indexOf("[ ] ") === 0 || e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0, Tt = (e, t) => Ct(e[t]) && $t(e[t - 1]) && Et(e[t - 2]) && xt(e[t]), St = (e, t) => {
|
|
1006
1012
|
const a = e[t].level - 1;
|
|
1007
|
-
for (let
|
|
1008
|
-
if (e[
|
|
1009
|
-
return
|
|
1013
|
+
for (let o = t - 1; o >= 0; o--)
|
|
1014
|
+
if (e[o].level === a)
|
|
1015
|
+
return o;
|
|
1010
1016
|
return -1;
|
|
1011
|
-
},
|
|
1017
|
+
}, It = (e) => {
|
|
1012
1018
|
const t = new e("html_inline", "", 0);
|
|
1013
1019
|
return t.content = "<label>", t;
|
|
1014
|
-
},
|
|
1020
|
+
}, kt = (e) => {
|
|
1015
1021
|
const t = new e("html_inline", "", 0);
|
|
1016
1022
|
return t.content = "</label>", t;
|
|
1017
|
-
}, It = (e, t, a) => {
|
|
1018
|
-
const n = new a("html_inline", "", 0);
|
|
1019
|
-
return n.content = '<label class="task-list-item-label" for="' + t + '">' + e + "</label>", n.attrs = [["for", t]], n;
|
|
1020
|
-
}, At = (e, t, a) => {
|
|
1021
|
-
const n = new t("html_inline", "", 0), o = a.enabled ? " " : ' disabled="" ';
|
|
1022
|
-
return e.content.indexOf("[ ] ") === 0 ? n.content = '<input class="task-list-item-checkbox"' + o + 'type="checkbox">' : (e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0) && (n.content = '<input class="task-list-item-checkbox" checked=""' + o + 'type="checkbox">'), n;
|
|
1023
1023
|
}, Ft = (e, t, a) => {
|
|
1024
|
+
const o = new a("html_inline", "", 0);
|
|
1025
|
+
return o.content = '<label class="task-list-item-label" for="' + t + '">' + e + "</label>", o.attrs = [["for", t]], o;
|
|
1026
|
+
}, At = (e, t, a) => {
|
|
1027
|
+
const o = new t("html_inline", "", 0), n = a.enabled ? " " : ' disabled="" ';
|
|
1028
|
+
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;
|
|
1029
|
+
}, Rt = (e, t, a) => {
|
|
1024
1030
|
if (e.children = e.children || [], e.children.unshift(At(e, t, a)), e.children[1].content = e.children[1].content.slice(3), e.content = e.content.slice(3), a.label)
|
|
1025
1031
|
if (a.labelAfter) {
|
|
1026
1032
|
e.children.pop();
|
|
1027
|
-
const
|
|
1028
|
-
e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' +
|
|
1033
|
+
const o = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
|
|
1034
|
+
e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + o + '">', e.children.push(Ft(e.content, o, t));
|
|
1029
1035
|
} else
|
|
1030
|
-
e.children.unshift(
|
|
1031
|
-
},
|
|
1036
|
+
e.children.unshift(It(t)), e.children.push(kt(t));
|
|
1037
|
+
}, Ht = (e, t = {}) => {
|
|
1032
1038
|
e.core.ruler.after("inline", "github-task-lists", (a) => {
|
|
1033
|
-
const
|
|
1034
|
-
for (let
|
|
1035
|
-
|
|
1036
|
-
n
|
|
1039
|
+
const o = a.tokens;
|
|
1040
|
+
for (let n = 2; n < o.length; n++)
|
|
1041
|
+
Tt(o, n) && (Rt(o[n], a.Token, t), $e(
|
|
1042
|
+
o[n - 2],
|
|
1037
1043
|
"class",
|
|
1038
1044
|
"task-list-item" + (t.enabled ? " enabled" : " ")
|
|
1039
|
-
),
|
|
1045
|
+
), $e(o[St(o, n - 2)], "class", "contains-task-list"));
|
|
1040
1046
|
});
|
|
1041
|
-
},
|
|
1047
|
+
}, Mt = (e) => {
|
|
1042
1048
|
e.core.ruler.push("init-line-number", (t) => (t.tokens.forEach((a) => {
|
|
1043
|
-
a.map &&
|
|
1049
|
+
a.map && a.attrSet("data-line", a.map[0].toString());
|
|
1044
1050
|
}), !0));
|
|
1045
|
-
},
|
|
1046
|
-
const { editorConfig: a, markdownItConfig:
|
|
1051
|
+
}, Pt = (e, t) => {
|
|
1052
|
+
const { editorConfig: a, markdownItConfig: o, markdownItPlugins: n, editorExtensions: d } = L, s = $("editorId"), c = $("language"), u = $(
|
|
1047
1053
|
"usedLanguageText"
|
|
1048
|
-
), l =
|
|
1054
|
+
), l = $("showCodeRowNumber"), i = $("theme"), r = $("customIcon"), m = $("rootRef"), f = $("setting"), p = z([]), g = st(e), v = ct(e), { reRenderRef: E, replaceMermaid: y } = ut(e), { reRenderEcharts: w, replaceEcharts: S } = it(e), C = Qe({
|
|
1049
1055
|
html: !0,
|
|
1050
1056
|
breaks: !0,
|
|
1051
1057
|
linkify: !0
|
|
1052
1058
|
});
|
|
1053
|
-
|
|
1054
|
-
editorId:
|
|
1059
|
+
o(C, {
|
|
1060
|
+
editorId: s
|
|
1055
1061
|
});
|
|
1056
|
-
const
|
|
1062
|
+
const k = [
|
|
1057
1063
|
{
|
|
1058
1064
|
type: "image",
|
|
1059
|
-
plugin:
|
|
1065
|
+
plugin: et,
|
|
1060
1066
|
options: { figcaption: !0, classes: "md-zoom" }
|
|
1061
1067
|
},
|
|
1062
1068
|
{
|
|
1063
1069
|
type: "admonition",
|
|
1064
|
-
plugin:
|
|
1070
|
+
plugin: mt,
|
|
1065
1071
|
options: {}
|
|
1066
1072
|
},
|
|
1067
1073
|
{
|
|
1068
1074
|
type: "taskList",
|
|
1069
|
-
plugin:
|
|
1075
|
+
plugin: Ht,
|
|
1070
1076
|
options: {}
|
|
1071
1077
|
},
|
|
1072
1078
|
{
|
|
1073
1079
|
type: "heading",
|
|
1074
|
-
plugin:
|
|
1080
|
+
plugin: gt,
|
|
1075
1081
|
options: { mdHeadingId: e.mdHeadingId, headsRef: p }
|
|
1076
1082
|
},
|
|
1077
1083
|
{
|
|
1078
1084
|
type: "code",
|
|
1079
|
-
plugin:
|
|
1085
|
+
plugin: ht,
|
|
1080
1086
|
options: {
|
|
1081
|
-
editorId:
|
|
1082
|
-
usedLanguageTextRef:
|
|
1087
|
+
editorId: s,
|
|
1088
|
+
usedLanguageTextRef: u,
|
|
1083
1089
|
// showCodeRowNumber,
|
|
1084
1090
|
codeFoldable: e.codeFoldable,
|
|
1085
1091
|
autoFoldThreshold: e.autoFoldThreshold,
|
|
@@ -1088,131 +1094,131 @@ const Y = new ct({
|
|
|
1088
1094
|
},
|
|
1089
1095
|
{
|
|
1090
1096
|
type: "sub",
|
|
1091
|
-
plugin:
|
|
1097
|
+
plugin: tt,
|
|
1092
1098
|
options: {}
|
|
1093
1099
|
},
|
|
1094
1100
|
{
|
|
1095
1101
|
type: "sup",
|
|
1096
|
-
plugin:
|
|
1102
|
+
plugin: nt,
|
|
1097
1103
|
options: {}
|
|
1098
1104
|
}
|
|
1099
1105
|
];
|
|
1100
|
-
e.noKatex ||
|
|
1106
|
+
e.noKatex || k.push({
|
|
1101
1107
|
type: "katex",
|
|
1102
|
-
plugin:
|
|
1108
|
+
plugin: bt,
|
|
1103
1109
|
options: { katexRef: v }
|
|
1104
|
-
}), e.noMermaid ||
|
|
1110
|
+
}), e.noMermaid || k.push({
|
|
1105
1111
|
type: "mermaid",
|
|
1106
|
-
plugin:
|
|
1112
|
+
plugin: wt,
|
|
1107
1113
|
options: { themeRef: i }
|
|
1108
|
-
}), e.noEcharts ||
|
|
1114
|
+
}), e.noEcharts || k.push({
|
|
1109
1115
|
type: "echarts",
|
|
1110
|
-
plugin:
|
|
1116
|
+
plugin: pt,
|
|
1111
1117
|
options: { themeRef: i }
|
|
1112
|
-
}),
|
|
1113
|
-
editorId:
|
|
1118
|
+
}), n(k, {
|
|
1119
|
+
editorId: s
|
|
1114
1120
|
}).forEach((H) => {
|
|
1115
|
-
|
|
1121
|
+
C.use(H.plugin, H.options);
|
|
1116
1122
|
});
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
highlight: (H, D,
|
|
1120
|
-
if (
|
|
1121
|
-
const U =
|
|
1123
|
+
const I = C.options.highlight;
|
|
1124
|
+
C.set({
|
|
1125
|
+
highlight: (H, D, ae) => {
|
|
1126
|
+
if (I) {
|
|
1127
|
+
const U = I(H, D, ae);
|
|
1122
1128
|
if (U)
|
|
1123
1129
|
return U;
|
|
1124
1130
|
}
|
|
1125
|
-
let
|
|
1126
|
-
!e.noHighlight && g.value ? g.value.getLanguage(D) ?
|
|
1131
|
+
let F;
|
|
1132
|
+
!e.noHighlight && g.value ? g.value.getLanguage(D) ? F = g.value.highlight(H, {
|
|
1127
1133
|
language: D,
|
|
1128
1134
|
ignoreIllegals: !0
|
|
1129
|
-
}).value :
|
|
1130
|
-
const _ =
|
|
1131
|
-
|
|
1135
|
+
}).value : F = g.value.highlightAuto(H).value : F = C.utils.escapeHtml(H);
|
|
1136
|
+
const _ = C.utils.escapeHtml(D), X = l ? ot(
|
|
1137
|
+
F.replace(/^\n+|\n+$/g, ""),
|
|
1132
1138
|
H.replace(/^\n+|\n+$/g, "")
|
|
1133
|
-
) : `<span class="${h}-code-block">${
|
|
1134
|
-
return `<pre><code class="language-${_}" language="${_}">${
|
|
1139
|
+
) : `<span class="${h}-code-block">${F.replace(/^\n+|\n+$/g, "")}</span>`;
|
|
1140
|
+
return `<pre><code class="language-${_}" language="${_}">${X}</code></pre>`;
|
|
1135
1141
|
}
|
|
1136
|
-
}),
|
|
1137
|
-
const R = z(`_article-key_${
|
|
1142
|
+
}), Mt(C);
|
|
1143
|
+
const R = z(`_article-key_${se()}`), N = z(
|
|
1138
1144
|
e.sanitize(
|
|
1139
|
-
|
|
1145
|
+
C.render(e.modelValue, {
|
|
1140
1146
|
srcLines: e.modelValue.split(`
|
|
1141
1147
|
`)
|
|
1142
1148
|
})
|
|
1143
1149
|
)
|
|
1144
1150
|
);
|
|
1145
1151
|
let V = () => {
|
|
1146
|
-
},
|
|
1152
|
+
}, B = () => {
|
|
1147
1153
|
};
|
|
1148
1154
|
const q = () => {
|
|
1149
1155
|
const H = m.value?.querySelectorAll(
|
|
1150
|
-
`#${
|
|
1156
|
+
`#${s} p.${h}-mermaid:not([data-closed=false])`
|
|
1151
1157
|
);
|
|
1152
|
-
|
|
1158
|
+
B(), B = Je(H, {
|
|
1153
1159
|
customIcon: r.value
|
|
1154
|
-
}),
|
|
1160
|
+
}), d.mermaid?.enableZoom && (V(), V = Xe(H, {
|
|
1155
1161
|
customIcon: r.value
|
|
1156
1162
|
}));
|
|
1157
1163
|
}, K = () => {
|
|
1158
|
-
b.emit(
|
|
1159
|
-
y().then(q),
|
|
1164
|
+
b.emit(s, Y, N.value), e.onHtmlChanged(N.value), e.onGetCatalog(p.value), b.emit(s, re, p.value), W(() => {
|
|
1165
|
+
y().then(q), S();
|
|
1160
1166
|
});
|
|
1161
1167
|
}, Z = () => {
|
|
1162
|
-
p.value = [],
|
|
1163
|
-
|
|
1168
|
+
p.value = [], N.value = e.sanitize(
|
|
1169
|
+
C.render(e.modelValue, {
|
|
1164
1170
|
srcLines: e.modelValue.split(`
|
|
1165
1171
|
`)
|
|
1166
1172
|
})
|
|
1167
1173
|
);
|
|
1168
|
-
},
|
|
1174
|
+
}, oe = A(() => (e.noKatex || !!v.value) && (e.noHighlight || !!g.value));
|
|
1169
1175
|
let G = -1;
|
|
1170
|
-
return
|
|
1176
|
+
return x([Pe(e, "modelValue"), oe, E, c], () => {
|
|
1171
1177
|
G = window.setTimeout(
|
|
1172
1178
|
() => {
|
|
1173
1179
|
Z();
|
|
1174
1180
|
},
|
|
1175
1181
|
t ? 0 : a.renderDelay
|
|
1176
1182
|
);
|
|
1177
|
-
}),
|
|
1183
|
+
}), x(
|
|
1178
1184
|
() => f.value.preview,
|
|
1179
1185
|
() => {
|
|
1180
1186
|
f.value.preview && W(() => {
|
|
1181
|
-
y().then(q),
|
|
1187
|
+
y().then(q), S(), b.emit(s, re, p.value);
|
|
1182
1188
|
});
|
|
1183
1189
|
}
|
|
1184
|
-
),
|
|
1190
|
+
), x([N, w], () => {
|
|
1185
1191
|
K();
|
|
1186
1192
|
}), M(K), M(() => {
|
|
1187
|
-
b.on(
|
|
1188
|
-
name:
|
|
1193
|
+
b.on(s, {
|
|
1194
|
+
name: We,
|
|
1189
1195
|
callback() {
|
|
1190
|
-
b.emit(
|
|
1196
|
+
b.emit(s, re, p.value);
|
|
1191
1197
|
}
|
|
1192
|
-
}), b.on(
|
|
1198
|
+
}), b.on(s, {
|
|
1193
1199
|
name: ue,
|
|
1194
1200
|
callback: () => {
|
|
1195
|
-
R.value = `_article-key_${
|
|
1201
|
+
R.value = `_article-key_${se()}`, Z();
|
|
1196
1202
|
}
|
|
1197
1203
|
});
|
|
1198
|
-
}),
|
|
1199
|
-
V(),
|
|
1200
|
-
}), { html:
|
|
1201
|
-
},
|
|
1202
|
-
const a =
|
|
1203
|
-
const
|
|
1204
|
+
}), ne(() => {
|
|
1205
|
+
V(), B(), clearTimeout(G);
|
|
1206
|
+
}), { html: N, key: R };
|
|
1207
|
+
}, Lt = (e, t) => {
|
|
1208
|
+
const a = $("editorId"), o = $("setting"), { noImgZoomIn: n } = e, d = Be(() => {
|
|
1209
|
+
const s = document.querySelectorAll(
|
|
1204
1210
|
`#${a}-preview img:not(.not-zoom):not(.medium-zoom-image)`
|
|
1205
1211
|
);
|
|
1206
|
-
|
|
1212
|
+
s.length !== 0 && at(s, {
|
|
1207
1213
|
background: "#00000073"
|
|
1208
1214
|
});
|
|
1209
1215
|
});
|
|
1210
1216
|
M(async () => {
|
|
1211
|
-
!
|
|
1212
|
-
}),
|
|
1213
|
-
!
|
|
1217
|
+
!n && o.value.preview && await d();
|
|
1218
|
+
}), x([t, () => o.value.preview], async () => {
|
|
1219
|
+
!n && o.value.preview && await d();
|
|
1214
1220
|
});
|
|
1215
|
-
},
|
|
1221
|
+
}, Ee = {
|
|
1216
1222
|
checked: {
|
|
1217
1223
|
regexp: /- \[x\]/,
|
|
1218
1224
|
value: "- [ ]"
|
|
@@ -1221,55 +1227,55 @@ const Y = new ct({
|
|
|
1221
1227
|
regexp: /- \[\s\]/,
|
|
1222
1228
|
value: "- [x]"
|
|
1223
1229
|
}
|
|
1224
|
-
},
|
|
1225
|
-
const a =
|
|
1226
|
-
let
|
|
1230
|
+
}, _t = (e, t) => {
|
|
1231
|
+
const a = $("editorId"), o = $("rootRef");
|
|
1232
|
+
let n = () => {
|
|
1227
1233
|
};
|
|
1228
|
-
const
|
|
1229
|
-
if (!
|
|
1234
|
+
const d = () => {
|
|
1235
|
+
if (!o.value)
|
|
1230
1236
|
return !1;
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
const l =
|
|
1237
|
+
const s = o.value.querySelectorAll(".task-list-item.enabled"), c = (u) => {
|
|
1238
|
+
u.preventDefault();
|
|
1239
|
+
const l = u.target.checked ? "unChecked" : "checked", i = u.target.parentElement?.dataset.line;
|
|
1234
1240
|
if (!i)
|
|
1235
1241
|
return;
|
|
1236
1242
|
const r = Number(i), m = e.modelValue.split(`
|
|
1237
1243
|
`), f = m[Number(r)].replace(
|
|
1238
|
-
|
|
1239
|
-
|
|
1244
|
+
Ee[l].regexp,
|
|
1245
|
+
Ee[l].value
|
|
1240
1246
|
);
|
|
1241
1247
|
e.previewOnly ? (m[Number(r)] = f, e.onChange(m.join(`
|
|
1242
|
-
`))) : b.emit(a,
|
|
1248
|
+
`))) : b.emit(a, qe, r + 1, f);
|
|
1243
1249
|
};
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
}),
|
|
1247
|
-
|
|
1248
|
-
|
|
1250
|
+
s.forEach((u) => {
|
|
1251
|
+
u.addEventListener("click", c);
|
|
1252
|
+
}), n = () => {
|
|
1253
|
+
s.forEach((u) => {
|
|
1254
|
+
u.removeEventListener("click", c);
|
|
1249
1255
|
});
|
|
1250
1256
|
};
|
|
1251
1257
|
};
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
}),
|
|
1258
|
+
ne(() => {
|
|
1259
|
+
n();
|
|
1260
|
+
}), x(
|
|
1255
1261
|
[t],
|
|
1256
1262
|
() => {
|
|
1257
|
-
|
|
1263
|
+
n(), W(d);
|
|
1258
1264
|
},
|
|
1259
1265
|
{
|
|
1260
1266
|
immediate: !0
|
|
1261
1267
|
}
|
|
1262
1268
|
);
|
|
1263
|
-
},
|
|
1264
|
-
const
|
|
1269
|
+
}, Ot = (e, t, a) => {
|
|
1270
|
+
const o = $("setting"), n = () => {
|
|
1265
1271
|
W(() => {
|
|
1266
1272
|
e.onRemount?.();
|
|
1267
1273
|
});
|
|
1268
|
-
},
|
|
1269
|
-
|
|
1274
|
+
}, d = (s) => {
|
|
1275
|
+
s && n();
|
|
1270
1276
|
};
|
|
1271
|
-
|
|
1272
|
-
},
|
|
1277
|
+
x([t, a], n), x(() => o.value.preview, d), x(() => o.value.htmlPreview, d), M(n);
|
|
1278
|
+
}, ke = {
|
|
1273
1279
|
modelValue: {
|
|
1274
1280
|
type: String,
|
|
1275
1281
|
default: ""
|
|
@@ -1340,8 +1346,8 @@ const Y = new ct({
|
|
|
1340
1346
|
type: [Object, Function],
|
|
1341
1347
|
default: void 0
|
|
1342
1348
|
}
|
|
1343
|
-
},
|
|
1344
|
-
...
|
|
1349
|
+
}, cn = {
|
|
1350
|
+
...ke,
|
|
1345
1351
|
updateModelValue: {
|
|
1346
1352
|
type: Function,
|
|
1347
1353
|
default: () => {
|
|
@@ -1409,10 +1415,10 @@ const Y = new ct({
|
|
|
1409
1415
|
catalogMaxDepth: {
|
|
1410
1416
|
type: Number
|
|
1411
1417
|
}
|
|
1412
|
-
},
|
|
1418
|
+
}, xe = (e) => {
|
|
1413
1419
|
const a = new DOMParser().parseFromString(e, "text/html");
|
|
1414
1420
|
return Array.from(a.body.childNodes);
|
|
1415
|
-
},
|
|
1421
|
+
}, Nt = (e, t) => e.nodeType !== t.nodeType ? !1 : e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE ? e.textContent === t.textContent : e.nodeType === Node.ELEMENT_NODE ? e.outerHTML === t.outerHTML : e.isEqualNode ? e.isEqualNode(t) : !1, Bt = /* @__PURE__ */ de({
|
|
1416
1422
|
name: "UpdateOnDemand",
|
|
1417
1423
|
props: {
|
|
1418
1424
|
id: {
|
|
@@ -1429,32 +1435,32 @@ const Y = new ct({
|
|
|
1429
1435
|
}
|
|
1430
1436
|
},
|
|
1431
1437
|
setup(e) {
|
|
1432
|
-
const t = z(), a = e.html,
|
|
1438
|
+
const t = z(), a = e.html, o = (n, d) => {
|
|
1433
1439
|
if (!t.value) return;
|
|
1434
|
-
const
|
|
1440
|
+
const s = t.value, c = Array.from(s.childNodes), u = Math.min(n.length, d.length);
|
|
1435
1441
|
let l = -1;
|
|
1436
|
-
for (let r = 0; r <
|
|
1437
|
-
if (!
|
|
1442
|
+
for (let r = 0; r < u; r++)
|
|
1443
|
+
if (!Nt(n[r], d[r])) {
|
|
1438
1444
|
l = r;
|
|
1439
1445
|
break;
|
|
1440
1446
|
}
|
|
1441
1447
|
if (l === -1)
|
|
1442
|
-
if (
|
|
1443
|
-
l =
|
|
1444
|
-
else if (
|
|
1445
|
-
l =
|
|
1448
|
+
if (d.length > n.length)
|
|
1449
|
+
l = n.length;
|
|
1450
|
+
else if (n.length > d.length)
|
|
1451
|
+
l = d.length;
|
|
1446
1452
|
else
|
|
1447
1453
|
return;
|
|
1448
|
-
const i = Math.min(l,
|
|
1449
|
-
for (let r =
|
|
1450
|
-
|
|
1451
|
-
for (let r = l; r <
|
|
1452
|
-
|
|
1454
|
+
const i = Math.min(l, c.length);
|
|
1455
|
+
for (let r = c.length - 1; r >= i; r--)
|
|
1456
|
+
c[r].remove();
|
|
1457
|
+
for (let r = l; r < n.length; r++)
|
|
1458
|
+
s.appendChild(n[r].cloneNode(!0));
|
|
1453
1459
|
};
|
|
1454
|
-
return
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
}), () =>
|
|
1460
|
+
return x(() => e.html, (n, d) => {
|
|
1461
|
+
const s = xe(n), c = xe(d || "");
|
|
1462
|
+
o(s, c);
|
|
1463
|
+
}), () => j("div", {
|
|
1458
1464
|
id: e.id,
|
|
1459
1465
|
class: e.class,
|
|
1460
1466
|
innerHTML: a,
|
|
@@ -1463,40 +1469,40 @@ const Y = new ct({
|
|
|
1463
1469
|
}
|
|
1464
1470
|
}), jt = /* @__PURE__ */ de({
|
|
1465
1471
|
name: "ContentPreview",
|
|
1466
|
-
props:
|
|
1472
|
+
props: ke,
|
|
1467
1473
|
setup(e) {
|
|
1468
|
-
const t =
|
|
1469
|
-
html:
|
|
1470
|
-
key:
|
|
1471
|
-
} =
|
|
1472
|
-
|
|
1473
|
-
const
|
|
1474
|
+
const t = $("editorId"), a = $("setting"), o = $("previewTheme"), n = $("showCodeRowNumber"), {
|
|
1475
|
+
html: d,
|
|
1476
|
+
key: s
|
|
1477
|
+
} = Pt(e, e.previewOnly);
|
|
1478
|
+
lt(e, d, s), Lt(e, d), _t(e, d), Ot(e, d, s);
|
|
1479
|
+
const c = A(() => [`${h}-preview`, `${o?.value}-theme`, n && `${h}-scrn`].filter(Boolean)), u = () => {
|
|
1474
1480
|
const l = `${t}-preview`;
|
|
1475
|
-
return e.previewComponent ?
|
|
1476
|
-
key:
|
|
1477
|
-
html:
|
|
1481
|
+
return e.previewComponent ? _e(e.previewComponent, {
|
|
1482
|
+
key: s.value,
|
|
1483
|
+
html: d.value,
|
|
1478
1484
|
id: l,
|
|
1479
|
-
class:
|
|
1480
|
-
}) :
|
|
1481
|
-
key:
|
|
1482
|
-
html:
|
|
1485
|
+
class: c.value
|
|
1486
|
+
}) : j(Bt, {
|
|
1487
|
+
key: s.value,
|
|
1488
|
+
html: d.value,
|
|
1483
1489
|
id: l,
|
|
1484
|
-
class:
|
|
1490
|
+
class: c.value
|
|
1485
1491
|
}, null);
|
|
1486
1492
|
};
|
|
1487
|
-
return () =>
|
|
1493
|
+
return () => j(Le, null, [a.value.preview && (e.previewOnly ? u() : j("div", {
|
|
1488
1494
|
id: `${t}-preview-wrapper`,
|
|
1489
1495
|
class: `${h}-preview-wrapper`,
|
|
1490
1496
|
key: "content-preview-wrapper"
|
|
1491
|
-
}, [
|
|
1497
|
+
}, [u()])), a.value.htmlPreview && j("div", {
|
|
1492
1498
|
id: `${t}-html-wrapper`,
|
|
1493
1499
|
class: `${h}-preview-wrapper`,
|
|
1494
1500
|
key: "html-preview-wrapper"
|
|
1495
|
-
}, [
|
|
1501
|
+
}, [j("div", {
|
|
1496
1502
|
class: `${h}-html`
|
|
1497
|
-
}, [
|
|
1503
|
+
}, [d.value])])]);
|
|
1498
1504
|
}
|
|
1499
|
-
}),
|
|
1505
|
+
}), Dt = ({ text: e }) => e, Fe = {
|
|
1500
1506
|
/**
|
|
1501
1507
|
* markdown content.
|
|
1502
1508
|
*
|
|
@@ -1605,7 +1611,7 @@ const Y = new ct({
|
|
|
1605
1611
|
*/
|
|
1606
1612
|
mdHeadingId: {
|
|
1607
1613
|
type: Function,
|
|
1608
|
-
default:
|
|
1614
|
+
default: Dt
|
|
1609
1615
|
},
|
|
1610
1616
|
/**
|
|
1611
1617
|
*
|
|
@@ -1734,8 +1740,8 @@ const Y = new ct({
|
|
|
1734
1740
|
type: [Object, Function],
|
|
1735
1741
|
default: void 0
|
|
1736
1742
|
}
|
|
1737
|
-
},
|
|
1738
|
-
...
|
|
1743
|
+
}, dn = {
|
|
1744
|
+
...Fe,
|
|
1739
1745
|
/**
|
|
1740
1746
|
* input回调事件
|
|
1741
1747
|
*/
|
|
@@ -1795,7 +1801,7 @@ const Y = new ct({
|
|
|
1795
1801
|
*/
|
|
1796
1802
|
toolbars: {
|
|
1797
1803
|
type: Array,
|
|
1798
|
-
default:
|
|
1804
|
+
default: De
|
|
1799
1805
|
},
|
|
1800
1806
|
/**
|
|
1801
1807
|
* 浮动工具栏
|
|
@@ -2046,7 +2052,7 @@ const Y = new ct({
|
|
|
2046
2052
|
"onChange",
|
|
2047
2053
|
"onRemount",
|
|
2048
2054
|
"update:modelValue"
|
|
2049
|
-
],
|
|
2055
|
+
], un = [
|
|
2050
2056
|
...Ae,
|
|
2051
2057
|
"onSave",
|
|
2052
2058
|
"onUploadImg",
|
|
@@ -2056,56 +2062,56 @@ const Y = new ct({
|
|
|
2056
2062
|
"onInput",
|
|
2057
2063
|
"onDrop",
|
|
2058
2064
|
"oninputBoxWidthChange"
|
|
2059
|
-
],
|
|
2060
|
-
const { editorId:
|
|
2065
|
+
], Vt = (e, t, a) => {
|
|
2066
|
+
const { editorId: o } = a, n = {
|
|
2061
2067
|
rerender() {
|
|
2062
|
-
b.emit(
|
|
2068
|
+
b.emit(o, ue);
|
|
2063
2069
|
}
|
|
2064
2070
|
};
|
|
2065
|
-
t.expose(
|
|
2066
|
-
},
|
|
2071
|
+
t.expose(n);
|
|
2072
|
+
}, le = /* @__PURE__ */ de({
|
|
2067
2073
|
name: "MdPreview",
|
|
2068
|
-
props:
|
|
2074
|
+
props: Fe,
|
|
2069
2075
|
emits: Ae,
|
|
2070
2076
|
setup(e, t) {
|
|
2071
2077
|
const {
|
|
2072
2078
|
noKatex: a,
|
|
2073
|
-
noMermaid:
|
|
2074
|
-
noHighlight:
|
|
2075
|
-
} = e,
|
|
2076
|
-
|
|
2077
|
-
rootRef:
|
|
2078
|
-
editorId:
|
|
2079
|
-
}),
|
|
2080
|
-
editorId:
|
|
2081
|
-
}),
|
|
2082
|
-
b.clear(
|
|
2079
|
+
noMermaid: o,
|
|
2080
|
+
noHighlight: n
|
|
2081
|
+
} = e, d = z(), s = rt(e);
|
|
2082
|
+
Ie(e, {
|
|
2083
|
+
rootRef: d,
|
|
2084
|
+
editorId: s
|
|
2085
|
+
}), Vt(e, t, {
|
|
2086
|
+
editorId: s
|
|
2087
|
+
}), ne(() => {
|
|
2088
|
+
b.clear(s);
|
|
2083
2089
|
});
|
|
2084
|
-
const
|
|
2090
|
+
const c = (r) => {
|
|
2085
2091
|
e.onChange?.(r), t.emit("onChange", r), t.emit("update:modelValue", r);
|
|
2086
|
-
},
|
|
2092
|
+
}, u = (r) => {
|
|
2087
2093
|
e.onHtmlChanged?.(r), t.emit("onHtmlChanged", r);
|
|
2088
2094
|
}, l = (r) => {
|
|
2089
2095
|
e.onGetCatalog?.(r), t.emit("onGetCatalog", r);
|
|
2090
2096
|
}, i = () => {
|
|
2091
2097
|
e.onRemount?.(), t.emit("onRemount");
|
|
2092
2098
|
};
|
|
2093
|
-
return () =>
|
|
2094
|
-
id:
|
|
2099
|
+
return () => j("div", {
|
|
2100
|
+
id: s,
|
|
2095
2101
|
class: [h, e.class, e.theme === "dark" && `${h}-dark`, `${h}-previewOnly`],
|
|
2096
2102
|
style: e.style,
|
|
2097
|
-
ref:
|
|
2098
|
-
}, [
|
|
2103
|
+
ref: d
|
|
2104
|
+
}, [j(jt, {
|
|
2099
2105
|
modelValue: e.modelValue,
|
|
2100
|
-
onChange:
|
|
2101
|
-
onHtmlChanged:
|
|
2106
|
+
onChange: c,
|
|
2107
|
+
onHtmlChanged: u,
|
|
2102
2108
|
onGetCatalog: l,
|
|
2103
2109
|
mdHeadingId: e.mdHeadingId,
|
|
2104
|
-
noMermaid:
|
|
2110
|
+
noMermaid: o,
|
|
2105
2111
|
sanitize: e.sanitize,
|
|
2106
2112
|
noKatex: a,
|
|
2107
2113
|
formatCopiedText: e.formatCopiedText,
|
|
2108
|
-
noHighlight:
|
|
2114
|
+
noHighlight: n,
|
|
2109
2115
|
noImgZoomIn: e.noImgZoomIn,
|
|
2110
2116
|
previewOnly: !0,
|
|
2111
2117
|
sanitizeMermaid: e.sanitizeMermaid,
|
|
@@ -2117,21 +2123,21 @@ const Y = new ct({
|
|
|
2117
2123
|
}, null)]);
|
|
2118
2124
|
}
|
|
2119
2125
|
});
|
|
2120
|
-
|
|
2126
|
+
le.install = (e) => (e.component(le.name, le), e);
|
|
2121
2127
|
export {
|
|
2122
2128
|
P as C,
|
|
2123
|
-
|
|
2129
|
+
le as M,
|
|
2124
2130
|
jt as a,
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2131
|
+
un as b,
|
|
2132
|
+
cn as c,
|
|
2133
|
+
dn as d,
|
|
2134
|
+
ce as e,
|
|
2135
|
+
rn as f,
|
|
2136
|
+
ln as g,
|
|
2137
|
+
tn as h,
|
|
2138
|
+
on as i,
|
|
2139
|
+
an as j,
|
|
2140
|
+
sn as k,
|
|
2141
|
+
nn as l,
|
|
2142
|
+
rt as u
|
|
2137
2143
|
};
|