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