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