md-editor-v3 6.1.1-0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/MdEditor.cjs +13 -13
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +1 -1
- package/lib/cjs/chunks/index3.cjs +37 -38
- package/lib/cjs/chunks/index4.cjs +1 -1
- package/lib/es/MdEditor.mjs +931 -915
- package/lib/es/ModalToolbar.mjs +24 -23
- package/lib/es/chunks/index.mjs +32 -32
- package/lib/es/chunks/index3.mjs +670 -632
- package/lib/es/chunks/index4.mjs +250 -254
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/Editor.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/UpdateOnDemand.d.ts +16 -0
- package/lib/types/MdEditor/layouts/Content/index.d.ts +3 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +9 -1
- package/lib/types/MdEditor/props.d.ts +9 -1
- package/lib/types/MdPreview/MdPreview.d.ts +3 -0
- package/package.json +2 -1
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as te, D as lt } from "./chunks/index.mjs";
|
|
2
2
|
import { s as at, a as nt, M as We } from "./chunks/index4.mjs";
|
|
3
|
-
import { C as rt, c as st, a as it, e as ct, b as ut, u as dt, d as mt, f as bt, g as vt, h as gt, i as
|
|
3
|
+
import { C as rt, c as st, a as it, e as ct, b as ut, u as dt, d as mt, f as bt, g as vt, h as gt, i as ht, j as ft, k as pt, M as Tt } from "./chunks/index3.mjs";
|
|
4
4
|
import wt from "./ModalToolbar.mjs";
|
|
5
5
|
import yt from "./NormalToolbar.mjs";
|
|
6
|
-
import { inject as r, watch as
|
|
7
|
-
import { g as
|
|
6
|
+
import { inject as r, watch as N, nextTick as se, onMounted as K, ref as E, defineComponent as y, createVNode as l, reactive as Y, toRef as Ce, computed as P, Fragment as _e, cloneVNode as ne, createApp as Ct, shallowRef as kt, onBeforeUnmount as ge } from "vue";
|
|
7
|
+
import { g as Z, p as a, a as $t, M as le, d as xt, b as St } from "./chunks/config.mjs";
|
|
8
8
|
import { linkTo as It, throttle as Et, createSmoothScroll as ze, draggingScroll as Lt } from "@vavt/util";
|
|
9
9
|
import { deleteLine as Nt, history as ke, defaultKeymap as At, historyKeymap as Dt, indentWithTab as Mt, undo as Rt, redo as Ft } from "@codemirror/commands";
|
|
10
10
|
import { markdown as Bt } from "@codemirror/lang-markdown";
|
|
11
11
|
import { languages as Pt } from "@codemirror/language-data";
|
|
12
|
-
import { EditorState as ie, EditorSelection as
|
|
13
|
-
import { placeholder as Ot, EditorView as
|
|
14
|
-
import { b as
|
|
12
|
+
import { EditorState as ie, EditorSelection as U, Compartment as j, StateEffect as re, StateField as qe, RangeSetBuilder as Ht } from "@codemirror/state";
|
|
13
|
+
import { placeholder as Ot, EditorView as B, showTooltip as Vt, Decoration as Wt, WidgetType as _t, keymap as zt, drawSelection as qt } from "@codemirror/view";
|
|
14
|
+
import { b as h, E as X, R as w, C as Ut, U as he, a as Ue, c as Ke, O as Ge, d as Kt, e as Gt, T as jt, S as Yt, G as $e } from "./chunks/event-bus.mjs";
|
|
15
15
|
import { indentUnit as Zt, syntaxHighlighting as je, HighlightStyle as Ye } from "@codemirror/language";
|
|
16
16
|
import { autocompletion as Xt } from "@codemirror/autocomplete";
|
|
17
17
|
import { a as Jt } from "./chunks/dom.mjs";
|
|
18
|
-
import { I as
|
|
18
|
+
import { I as x, M as Qt } from "./chunks/index2.mjs";
|
|
19
19
|
import { b as eo } from "./chunks/index5.mjs";
|
|
20
|
-
import { tags as
|
|
20
|
+
import { tags as b } from "@lezer/highlight";
|
|
21
21
|
import { searchKeymap as to } from "@codemirror/search";
|
|
22
22
|
import { g as xe } from "./chunks/vue-tsx.mjs";
|
|
23
23
|
const oo = (e, t, o) => {
|
|
@@ -25,34 +25,34 @@ const oo = (e, t, o) => {
|
|
|
25
25
|
let s = () => {
|
|
26
26
|
}, c = () => {
|
|
27
27
|
};
|
|
28
|
-
const
|
|
28
|
+
const d = () => {
|
|
29
29
|
s();
|
|
30
|
-
const
|
|
30
|
+
const u = o.value?.view.contentDOM.getRootNode(), v = u?.querySelector(
|
|
31
31
|
`#${n} .cm-scroller`
|
|
32
|
-
),
|
|
32
|
+
), m = u?.querySelector(
|
|
33
33
|
`[id="${n}-preview-wrapper"]`
|
|
34
|
-
),
|
|
34
|
+
), f = u?.querySelector(
|
|
35
35
|
`[id="${n}-html-wrapper"]`
|
|
36
36
|
);
|
|
37
|
-
(
|
|
37
|
+
(m || f) && ([c, s] = (m ? at : nt)(
|
|
38
38
|
v,
|
|
39
|
-
|
|
39
|
+
m || f,
|
|
40
40
|
o.value
|
|
41
41
|
), e.scrollAuto && c());
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
43
|
+
N([t, i], () => {
|
|
44
|
+
se(d);
|
|
45
|
+
}), N(
|
|
46
46
|
() => e.scrollAuto,
|
|
47
|
-
(
|
|
48
|
-
|
|
47
|
+
(u) => {
|
|
48
|
+
u ? c() : s();
|
|
49
49
|
}
|
|
50
|
-
),
|
|
50
|
+
), N(
|
|
51
51
|
() => i.value.previewOnly,
|
|
52
|
-
(
|
|
53
|
-
|
|
52
|
+
(u) => {
|
|
53
|
+
u ? s() : c();
|
|
54
54
|
}
|
|
55
|
-
),
|
|
55
|
+
), K(d);
|
|
56
56
|
}, ce = async (e, t, o) => {
|
|
57
57
|
if (/^h[1-6]$/.test(e))
|
|
58
58
|
return lo(e, t);
|
|
@@ -106,7 +106,7 @@ const oo = (e, t, o) => {
|
|
|
106
106
|
return { text: "", options: {} };
|
|
107
107
|
}
|
|
108
108
|
}, lo = (e, t) => {
|
|
109
|
-
const o = e.slice(1), n = "#".repeat(Number(o)), [i, s, c] =
|
|
109
|
+
const o = e.slice(1), n = "#".repeat(Number(o)), [i, s, c] = fe(t, {
|
|
110
110
|
wholeLine: !0
|
|
111
111
|
});
|
|
112
112
|
return {
|
|
@@ -114,10 +114,10 @@ const oo = (e, t, o) => {
|
|
|
114
114
|
options: { deviationStart: n.length + 1, replaceStart: s, replaceEnd: c }
|
|
115
115
|
};
|
|
116
116
|
}, ao = async (e, t) => {
|
|
117
|
-
const o = window.prettier ||
|
|
118
|
-
window.prettierPlugins?.markdown ||
|
|
117
|
+
const o = window.prettier || Z.editorExtensions.prettier?.prettierInstance, n = [
|
|
118
|
+
window.prettierPlugins?.markdown || Z.editorExtensions.prettier?.parserMarkdownInstance
|
|
119
119
|
];
|
|
120
|
-
return !o || !n[0] ? (
|
|
120
|
+
return !o || !n[0] ? (h.emit(t.editorId, X, {
|
|
121
121
|
name: "prettier",
|
|
122
122
|
message: "prettier is undefined"
|
|
123
123
|
}), {
|
|
@@ -160,17 +160,17 @@ $$
|
|
|
160
160
|
orderedList: 1,
|
|
161
161
|
task: "- [ ] "
|
|
162
162
|
}, io = (e, t) => {
|
|
163
|
-
const [o, n, i] =
|
|
163
|
+
const [o, n, i] = fe(t, {
|
|
164
164
|
wholeLine: !0
|
|
165
165
|
}), s = o.split(`
|
|
166
|
-
`), c = so[e],
|
|
166
|
+
`), c = so[e], d = e === "orderedList" ? s.map((m, f) => `${c + f}. ${m}`) : s.map((m) => `${c}${m}`), u = e === "orderedList" ? "1. " : c.toString(), v = s.length === 1 ? u.length : 0;
|
|
167
167
|
return {
|
|
168
|
-
text:
|
|
168
|
+
text: d.join(`
|
|
169
169
|
`),
|
|
170
170
|
options: { deviationStart: v, replaceStart: n, replaceEnd: i }
|
|
171
171
|
};
|
|
172
172
|
}, co = (e, t) => {
|
|
173
|
-
const [o, n, i] =
|
|
173
|
+
const [o, n, i] = fe(t), s = e.mode || "language", c = `
|
|
174
174
|
\`\`\`${s}
|
|
175
175
|
${e.text || o || ""}
|
|
176
176
|
\`\`\`
|
|
@@ -208,7 +208,7 @@ dateFormat YYYY-MM-DD`,
|
|
|
208
208
|
CAR ||--o{ NAMED-DRIVER : allows`,
|
|
209
209
|
journey: `journey
|
|
210
210
|
title My Journey`,
|
|
211
|
-
...
|
|
211
|
+
...Z.editorConfig.mermaidTemplate
|
|
212
212
|
}[e]}
|
|
213
213
|
\`\`\`
|
|
214
214
|
`,
|
|
@@ -216,22 +216,22 @@ dateFormat YYYY-MM-DD`,
|
|
|
216
216
|
}), mo = (e, t) => {
|
|
217
217
|
const o = t.getSelectedText(), { desc: n = o, url: i = "", urls: s } = e;
|
|
218
218
|
let c = "";
|
|
219
|
-
const
|
|
220
|
-
return s instanceof Array ? c = s.reduce((
|
|
219
|
+
const d = i === "" && (!s || s instanceof Array && s.length === 0);
|
|
220
|
+
return s instanceof Array ? c = s.reduce((u, v) => {
|
|
221
221
|
const {
|
|
222
|
-
url:
|
|
223
|
-
alt:
|
|
224
|
-
title:
|
|
222
|
+
url: m = "",
|
|
223
|
+
alt: f = "",
|
|
224
|
+
title: g = ""
|
|
225
225
|
} = typeof v == "object" ? v : { url: v };
|
|
226
|
-
return
|
|
226
|
+
return u + `
|
|
227
227
|
`;
|
|
228
228
|
}, "") : c = `
|
|
229
229
|
`, {
|
|
230
230
|
text: c,
|
|
231
231
|
options: {
|
|
232
232
|
select: i === "",
|
|
233
|
-
deviationStart:
|
|
234
|
-
deviationEnd:
|
|
233
|
+
deviationStart: d ? c.length - i.length - 2 : c.length,
|
|
234
|
+
deviationEnd: d ? -2 : 0
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
}, bo = (e) => {
|
|
@@ -262,7 +262,7 @@ dateFormat YYYY-MM-DD`,
|
|
|
262
262
|
deviationEnd: n.deviationEnd || 0
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
},
|
|
265
|
+
}, fe = (e, t = { wholeLine: !1 }) => {
|
|
266
266
|
const o = e.view.state, n = o.selection.main;
|
|
267
267
|
if (n.empty) {
|
|
268
268
|
const i = o.doc.lineAt(n.from);
|
|
@@ -280,10 +280,10 @@ dateFormat YYYY-MM-DD`,
|
|
|
280
280
|
n.from,
|
|
281
281
|
n.to
|
|
282
282
|
];
|
|
283
|
-
},
|
|
284
|
-
const t = new
|
|
283
|
+
}, G = (e) => {
|
|
284
|
+
const t = new j();
|
|
285
285
|
return (n) => (t.get(e.state) ? e.dispatch({ effects: t.reconfigure(n) }) : e.dispatch({
|
|
286
|
-
effects:
|
|
286
|
+
effects: re.appendConfig.of(t.of(n))
|
|
287
287
|
}), !0);
|
|
288
288
|
};
|
|
289
289
|
class go {
|
|
@@ -370,7 +370,7 @@ class go {
|
|
|
370
370
|
}), this.view.focus();
|
|
371
371
|
} catch (s) {
|
|
372
372
|
if (s.message === "The input text is too long")
|
|
373
|
-
|
|
373
|
+
h.emit(n, X, {
|
|
374
374
|
name: "overlength",
|
|
375
375
|
message: s.message,
|
|
376
376
|
data: t
|
|
@@ -380,7 +380,7 @@ class go {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
constructor(t) {
|
|
383
|
-
this.view = t, this.toggleTabSize =
|
|
383
|
+
this.view = t, this.toggleTabSize = G(this.view), this.togglePlaceholder = G(this.view), this.setExtensions = G(this.view), this.toggleDisabled = G(this.view), this.toggleReadOnly = G(this.view), this.toggleMaxlength = G(this.view);
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
386
386
|
* 设置tabSize
|
|
@@ -417,14 +417,14 @@ class go {
|
|
|
417
417
|
}
|
|
418
418
|
this.view.dispatch({
|
|
419
419
|
scrollIntoView: !0,
|
|
420
|
-
selection:
|
|
421
|
-
[
|
|
420
|
+
selection: U.create(
|
|
421
|
+
[U.range(o, n), U.cursor(i)],
|
|
422
422
|
1
|
|
423
423
|
)
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
426
|
setDisabled(t) {
|
|
427
|
-
this.toggleDisabled([
|
|
427
|
+
this.toggleDisabled([B.editable.of(!t)]);
|
|
428
428
|
}
|
|
429
429
|
setReadOnly(t) {
|
|
430
430
|
this.toggleReadOnly([ie.readOnly.of(t)]);
|
|
@@ -435,28 +435,28 @@ class go {
|
|
|
435
435
|
]);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const ho = (e, t) => {
|
|
439
439
|
if (e === t) return !0;
|
|
440
440
|
if (e.length !== t.length) return !1;
|
|
441
441
|
for (let o = 0; o < e.length; o++)
|
|
442
442
|
if (e[o] !== t[o]) return !1;
|
|
443
443
|
return !0;
|
|
444
|
-
},
|
|
445
|
-
const o =
|
|
446
|
-
|
|
447
|
-
(!o.value || !
|
|
444
|
+
}, fo = (e, t) => {
|
|
445
|
+
const o = E(t.value);
|
|
446
|
+
N([t], () => {
|
|
447
|
+
(!o.value || !ho(o.value, t.value)) && (o.value = t.value, e());
|
|
448
448
|
});
|
|
449
|
-
},
|
|
450
|
-
const v = `${e}${t}${o}${n}`,
|
|
449
|
+
}, ae = (e, t, o, n, i) => (s, c, d, u) => {
|
|
450
|
+
const v = `${e}${t}${o}${n}`, m = d + c.label.length + (i === "title" ? o.length : 0);
|
|
451
451
|
s.dispatch({
|
|
452
|
-
changes: { from:
|
|
453
|
-
selection:
|
|
452
|
+
changes: { from: d, to: u, insert: v },
|
|
453
|
+
selection: U.create(
|
|
454
454
|
[
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
U.range(
|
|
456
|
+
d + c.label.length + (i === "title" ? 1 : -t.length),
|
|
457
|
+
m
|
|
458
458
|
),
|
|
459
|
-
|
|
459
|
+
U.cursor(m)
|
|
460
460
|
],
|
|
461
461
|
1
|
|
462
462
|
)
|
|
@@ -499,7 +499,7 @@ const fo = (e, t) => {
|
|
|
499
499
|
].map((i) => ({
|
|
500
500
|
label: `${i[0]}${i[1]}`,
|
|
501
501
|
type: "text",
|
|
502
|
-
apply:
|
|
502
|
+
apply: ae(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
|
|
503
503
|
})),
|
|
504
504
|
// 链接
|
|
505
505
|
{
|
|
@@ -524,12 +524,12 @@ const fo = (e, t) => {
|
|
|
524
524
|
{
|
|
525
525
|
label: "$",
|
|
526
526
|
type: "text",
|
|
527
|
-
apply:
|
|
527
|
+
apply: ae("$", "", "", "$", "type")
|
|
528
528
|
},
|
|
529
529
|
{
|
|
530
530
|
label: "$$",
|
|
531
531
|
type: "text",
|
|
532
|
-
apply:
|
|
532
|
+
apply: ae("$$", "", `
|
|
533
533
|
`, `
|
|
534
534
|
$$`, "title")
|
|
535
535
|
},
|
|
@@ -554,7 +554,7 @@ $$`, "title")
|
|
|
554
554
|
].map((i) => ({
|
|
555
555
|
label: `!!! ${i}`,
|
|
556
556
|
type: "text",
|
|
557
|
-
apply:
|
|
557
|
+
apply: ae("!!!", ` ${i}`, " Title", `
|
|
558
558
|
|
|
559
559
|
!!!`, "title")
|
|
560
560
|
}))
|
|
@@ -564,14 +564,14 @@ $$`, "title")
|
|
|
564
564
|
return Xt({
|
|
565
565
|
override: e ? [t, ...e] : [t]
|
|
566
566
|
});
|
|
567
|
-
}, po = /* @__PURE__ */
|
|
567
|
+
}, po = /* @__PURE__ */ y({
|
|
568
568
|
name: `${a}-divider`,
|
|
569
569
|
setup() {
|
|
570
570
|
return () => l("div", {
|
|
571
571
|
class: `${a}-divider`
|
|
572
572
|
}, null);
|
|
573
573
|
}
|
|
574
|
-
}), To = /* @__PURE__ */
|
|
574
|
+
}), To = /* @__PURE__ */ y({
|
|
575
575
|
name: "ToolbarBold",
|
|
576
576
|
setup() {
|
|
577
577
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -580,16 +580,16 @@ $$`, "title")
|
|
|
580
580
|
title: t.value.toolbarTips?.bold,
|
|
581
581
|
disabled: o?.value,
|
|
582
582
|
onClick: () => {
|
|
583
|
-
|
|
583
|
+
h.emit(e, w, "bold");
|
|
584
584
|
},
|
|
585
585
|
type: "button"
|
|
586
|
-
}, [l(
|
|
586
|
+
}, [l(x, {
|
|
587
587
|
name: "bold"
|
|
588
588
|
}, null), n?.value && l("div", {
|
|
589
589
|
class: `${a}-toolbar-item-name`
|
|
590
590
|
}, [t.value.toolbarTips?.bold])]);
|
|
591
591
|
}
|
|
592
|
-
}), wo = /* @__PURE__ */
|
|
592
|
+
}), wo = /* @__PURE__ */ y({
|
|
593
593
|
name: "ToolbarCatalog",
|
|
594
594
|
setup() {
|
|
595
595
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("catalogVisible");
|
|
@@ -598,17 +598,17 @@ $$`, "title")
|
|
|
598
598
|
title: t.value.toolbarTips?.catalog,
|
|
599
599
|
disabled: o?.value,
|
|
600
600
|
onClick: () => {
|
|
601
|
-
|
|
601
|
+
h.emit(e, Ut);
|
|
602
602
|
},
|
|
603
603
|
key: "bar-catalog",
|
|
604
604
|
type: "button"
|
|
605
|
-
}, [l(
|
|
605
|
+
}, [l(x, {
|
|
606
606
|
name: "catalog"
|
|
607
607
|
}, null), n?.value && l("div", {
|
|
608
608
|
class: `${a}-toolbar-item-name`
|
|
609
609
|
}, [t.value.toolbarTips?.catalog])]);
|
|
610
610
|
}
|
|
611
|
-
}), yo = /* @__PURE__ */
|
|
611
|
+
}), yo = /* @__PURE__ */ y({
|
|
612
612
|
name: "ToolbarCode",
|
|
613
613
|
setup() {
|
|
614
614
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -617,16 +617,16 @@ $$`, "title")
|
|
|
617
617
|
title: t.value.toolbarTips?.code,
|
|
618
618
|
disabled: o?.value,
|
|
619
619
|
onClick: () => {
|
|
620
|
-
|
|
620
|
+
h.emit(e, w, "code");
|
|
621
621
|
},
|
|
622
622
|
type: "button"
|
|
623
|
-
}, [l(
|
|
623
|
+
}, [l(x, {
|
|
624
624
|
name: "code"
|
|
625
625
|
}, null), n?.value && l("div", {
|
|
626
626
|
class: `${a}-toolbar-item-name`
|
|
627
627
|
}, [t.value.toolbarTips?.code])]);
|
|
628
628
|
}
|
|
629
|
-
}), Co = /* @__PURE__ */
|
|
629
|
+
}), Co = /* @__PURE__ */ y({
|
|
630
630
|
name: "ToolbarCodeRow",
|
|
631
631
|
setup() {
|
|
632
632
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -635,16 +635,16 @@ $$`, "title")
|
|
|
635
635
|
title: t.value.toolbarTips?.codeRow,
|
|
636
636
|
disabled: o?.value,
|
|
637
637
|
onClick: () => {
|
|
638
|
-
|
|
638
|
+
h.emit(e, w, "codeRow");
|
|
639
639
|
},
|
|
640
640
|
type: "button"
|
|
641
|
-
}, [l(
|
|
641
|
+
}, [l(x, {
|
|
642
642
|
name: "code-row"
|
|
643
643
|
}, null), n?.value && l("div", {
|
|
644
644
|
class: `${a}-toolbar-item-name`
|
|
645
645
|
}, [t.value.toolbarTips?.codeRow])]);
|
|
646
646
|
}
|
|
647
|
-
}), ko = /* @__PURE__ */
|
|
647
|
+
}), ko = /* @__PURE__ */ y({
|
|
648
648
|
name: "ToolbarFullscreen",
|
|
649
649
|
setup() {
|
|
650
650
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), {
|
|
@@ -658,13 +658,13 @@ $$`, "title")
|
|
|
658
658
|
i();
|
|
659
659
|
},
|
|
660
660
|
type: "button"
|
|
661
|
-
}, [l(
|
|
661
|
+
}, [l(x, {
|
|
662
662
|
name: n.value.fullscreen ? "fullscreen-exit" : "fullscreen"
|
|
663
663
|
}, null), o?.value && l("div", {
|
|
664
664
|
class: `${a}-toolbar-item-name`
|
|
665
665
|
}, [e.value.toolbarTips?.fullscreen])]);
|
|
666
666
|
}
|
|
667
|
-
}), $o = /* @__PURE__ */
|
|
667
|
+
}), $o = /* @__PURE__ */ y({
|
|
668
668
|
name: "ToolbarGithub",
|
|
669
669
|
setup() {
|
|
670
670
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName");
|
|
@@ -676,13 +676,13 @@ $$`, "title")
|
|
|
676
676
|
It("https://github.com/imzbf/md-editor-v3");
|
|
677
677
|
},
|
|
678
678
|
type: "button"
|
|
679
|
-
}, [l(
|
|
679
|
+
}, [l(x, {
|
|
680
680
|
name: "github"
|
|
681
681
|
}, null), o?.value && l("div", {
|
|
682
682
|
class: `${a}-toolbar-item-name`
|
|
683
683
|
}, [e.value.toolbarTips?.github])]);
|
|
684
684
|
}
|
|
685
|
-
}), xo = /* @__PURE__ */
|
|
685
|
+
}), xo = /* @__PURE__ */ y({
|
|
686
686
|
name: "ToolbarHtmlPreview",
|
|
687
687
|
setup() {
|
|
688
688
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -694,13 +694,13 @@ $$`, "title")
|
|
|
694
694
|
i("htmlPreview");
|
|
695
695
|
},
|
|
696
696
|
type: "button"
|
|
697
|
-
}, [l(
|
|
697
|
+
}, [l(x, {
|
|
698
698
|
name: "preview-html"
|
|
699
699
|
}, null), o?.value && l("div", {
|
|
700
700
|
class: `${a}-toolbar-item-name`
|
|
701
701
|
}, [e.value.toolbarTips?.htmlPreview])]);
|
|
702
702
|
}
|
|
703
|
-
}), So = /* @__PURE__ */
|
|
703
|
+
}), So = /* @__PURE__ */ y({
|
|
704
704
|
name: "ToolbarImage",
|
|
705
705
|
setup() {
|
|
706
706
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -709,10 +709,10 @@ $$`, "title")
|
|
|
709
709
|
title: t.value.toolbarTips?.image,
|
|
710
710
|
disabled: o?.value,
|
|
711
711
|
onClick: () => {
|
|
712
|
-
|
|
712
|
+
h.emit(e, w, "image");
|
|
713
713
|
},
|
|
714
714
|
type: "button"
|
|
715
|
-
}, [l(
|
|
715
|
+
}, [l(x, {
|
|
716
716
|
name: "image"
|
|
717
717
|
}, null), n?.value && l("div", {
|
|
718
718
|
class: `${a}-toolbar-item-name`
|
|
@@ -733,13 +733,13 @@ $$`, "title")
|
|
|
733
733
|
default: () => {
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
}, Eo = /* @__PURE__ */
|
|
736
|
+
}, Eo = /* @__PURE__ */ y({
|
|
737
737
|
name: `${a}-modal-clip`,
|
|
738
738
|
props: Io,
|
|
739
739
|
setup(e) {
|
|
740
740
|
const t = r("usedLanguageText"), o = r("editorId"), n = r("rootRef");
|
|
741
|
-
let i =
|
|
742
|
-
const s =
|
|
741
|
+
let i = Z.editorExtensions.cropper.instance;
|
|
742
|
+
const s = E(), c = E(), d = E(), u = Y({
|
|
743
743
|
cropperInited: !1,
|
|
744
744
|
imgSelected: !1,
|
|
745
745
|
imgSrc: "",
|
|
@@ -747,36 +747,38 @@ $$`, "title")
|
|
|
747
747
|
isFullscreen: !1
|
|
748
748
|
});
|
|
749
749
|
let v = null;
|
|
750
|
-
|
|
751
|
-
e.visible && !
|
|
750
|
+
N(() => e.visible, () => {
|
|
751
|
+
e.visible && !u.cropperInited && (i = i || window.Cropper, s.value.onchange = () => {
|
|
752
752
|
if (!i) {
|
|
753
|
-
|
|
753
|
+
h.emit(o, X, {
|
|
754
754
|
name: "Cropper",
|
|
755
755
|
message: "Cropper is undefined"
|
|
756
756
|
});
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
},
|
|
759
|
+
const g = s.value.files || [];
|
|
760
|
+
if (u.imgSelected = !0, g?.length > 0) {
|
|
761
|
+
const p = new FileReader();
|
|
762
|
+
p.onload = (k) => {
|
|
763
|
+
u.imgSrc = k.target.result;
|
|
764
|
+
}, p.readAsDataURL(g[0]);
|
|
765
765
|
}
|
|
766
766
|
});
|
|
767
|
-
}),
|
|
768
|
-
|
|
769
|
-
}),
|
|
770
|
-
|
|
771
|
-
v?.destroy(),
|
|
767
|
+
}), N(() => [u.imgSelected], () => {
|
|
768
|
+
d.value.style = "";
|
|
769
|
+
}), N([Ce(() => u.isFullscreen), Ce(() => u.imgSrc)], () => {
|
|
770
|
+
u.imgSrc && se(() => {
|
|
771
|
+
v?.destroy(), d.value.style = "", c.value && (v = new i(c.value, {
|
|
772
772
|
viewMode: 2,
|
|
773
773
|
preview: n.value.getRootNode().querySelector(`.${a}-clip-preview-target`)
|
|
774
774
|
// aspectRatio: 16 / 9,
|
|
775
775
|
}));
|
|
776
776
|
});
|
|
777
777
|
});
|
|
778
|
-
const
|
|
779
|
-
v.clear(), v.destroy(), v = null, s.value.value = "",
|
|
778
|
+
const m = () => {
|
|
779
|
+
v.clear(), v.destroy(), v = null, s.value.value = "", u.imgSelected = !1, u.imgSrc = "";
|
|
780
|
+
}, f = (g) => {
|
|
781
|
+
u.isFullscreen = g;
|
|
780
782
|
};
|
|
781
783
|
return () => l(Qt, {
|
|
782
784
|
class: `${a}-modal-clip`,
|
|
@@ -784,10 +786,8 @@ $$`, "title")
|
|
|
784
786
|
visible: e.visible,
|
|
785
787
|
onClose: e.onCancel,
|
|
786
788
|
showAdjust: !0,
|
|
787
|
-
isFullscreen:
|
|
788
|
-
onAdjust:
|
|
789
|
-
m.isFullscreen = h;
|
|
790
|
-
},
|
|
789
|
+
isFullscreen: u.isFullscreen,
|
|
790
|
+
onAdjust: f,
|
|
791
791
|
width: "668px",
|
|
792
792
|
height: "421px"
|
|
793
793
|
}, {
|
|
@@ -795,10 +795,10 @@ $$`, "title")
|
|
|
795
795
|
class: `${a}-form-item ${a}-clip`
|
|
796
796
|
}, [l("div", {
|
|
797
797
|
class: `${a}-clip-main`
|
|
798
|
-
}, [
|
|
798
|
+
}, [u.imgSelected ? l("div", {
|
|
799
799
|
class: `${a}-clip-cropper`
|
|
800
800
|
}, [l("img", {
|
|
801
|
-
src:
|
|
801
|
+
src: u.imgSrc,
|
|
802
802
|
ref: c,
|
|
803
803
|
style: {
|
|
804
804
|
display: "none"
|
|
@@ -806,8 +806,8 @@ $$`, "title")
|
|
|
806
806
|
alt: ""
|
|
807
807
|
}, null), l("div", {
|
|
808
808
|
class: `${a}-clip-delete`,
|
|
809
|
-
onClick:
|
|
810
|
-
}, [l(
|
|
809
|
+
onClick: m
|
|
810
|
+
}, [l(x, {
|
|
811
811
|
name: "delete"
|
|
812
812
|
}, null)])]) : l("div", {
|
|
813
813
|
class: `${a}-clip-upload`,
|
|
@@ -817,13 +817,13 @@ $$`, "title")
|
|
|
817
817
|
role: "button",
|
|
818
818
|
tabindex: "0",
|
|
819
819
|
"aria-label": t.value.imgTitleItem?.upload
|
|
820
|
-
}, [l(
|
|
820
|
+
}, [l(x, {
|
|
821
821
|
name: "upload"
|
|
822
822
|
}, null)])]), l("div", {
|
|
823
823
|
class: `${a}-clip-preview`
|
|
824
824
|
}, [l("div", {
|
|
825
825
|
class: `${a}-clip-preview-target`,
|
|
826
|
-
ref:
|
|
826
|
+
ref: d
|
|
827
827
|
}, null)])]), l("div", {
|
|
828
828
|
class: `${a}-form-item`
|
|
829
829
|
}, [l("button", {
|
|
@@ -831,8 +831,8 @@ $$`, "title")
|
|
|
831
831
|
type: "button",
|
|
832
832
|
onClick: () => {
|
|
833
833
|
if (v) {
|
|
834
|
-
const
|
|
835
|
-
|
|
834
|
+
const g = v.getCroppedCanvas();
|
|
835
|
+
h.emit(o, he, [eo(g.toDataURL("image/png"))], e.onOk), m();
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
}, [t.value.clipModalTips?.buttonUpload || t.value.linkModalTips?.buttonOK])]), l("input", {
|
|
@@ -862,7 +862,7 @@ $$`, "title")
|
|
|
862
862
|
default: () => {
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
|
-
}, No = /* @__PURE__ */
|
|
865
|
+
}, No = /* @__PURE__ */ y({
|
|
866
866
|
name: `${a}-modals`,
|
|
867
867
|
props: Lo,
|
|
868
868
|
setup(e) {
|
|
@@ -872,17 +872,56 @@ $$`, "title")
|
|
|
872
872
|
onCancel: e.onCancel
|
|
873
873
|
}, null);
|
|
874
874
|
}
|
|
875
|
-
}), Ao = /* @__PURE__ */
|
|
875
|
+
}), Ao = /* @__PURE__ */ y({
|
|
876
876
|
name: "ToolbarImageDropdown",
|
|
877
877
|
setup() {
|
|
878
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
879
|
-
|
|
880
|
-
}, v = (
|
|
881
|
-
o?.value ||
|
|
878
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = E(!1), d = E(), u = () => {
|
|
879
|
+
h.emit(e, he, Array.from(d.value.files || [])), d.value.value = "";
|
|
880
|
+
}, v = (k, S) => {
|
|
881
|
+
o?.value || h.emit(e, w, k, S);
|
|
882
882
|
};
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
})
|
|
883
|
+
K(() => {
|
|
884
|
+
d.value.addEventListener("change", u);
|
|
885
|
+
});
|
|
886
|
+
const m = (k) => {
|
|
887
|
+
s.value = k;
|
|
888
|
+
}, f = () => {
|
|
889
|
+
c.value = !1;
|
|
890
|
+
}, g = (k) => {
|
|
891
|
+
k && v("image", {
|
|
892
|
+
desc: k.desc,
|
|
893
|
+
url: k.url,
|
|
894
|
+
transform: !0
|
|
895
|
+
}), c.value = !1;
|
|
896
|
+
}, p = P(() => l("ul", {
|
|
897
|
+
class: `${a}-menu`,
|
|
898
|
+
onClick: () => {
|
|
899
|
+
s.value = !1;
|
|
900
|
+
},
|
|
901
|
+
role: "menu"
|
|
902
|
+
}, [l("li", {
|
|
903
|
+
class: `${a}-menu-item ${a}-menu-item-image`,
|
|
904
|
+
onClick: () => {
|
|
905
|
+
v("image");
|
|
906
|
+
},
|
|
907
|
+
role: "menuitem",
|
|
908
|
+
tabindex: "0"
|
|
909
|
+
}, [t.value.imgTitleItem?.link]), l("li", {
|
|
910
|
+
class: `${a}-menu-item ${a}-menu-item-image`,
|
|
911
|
+
onClick: () => {
|
|
912
|
+
d.value.click();
|
|
913
|
+
},
|
|
914
|
+
role: "menuitem",
|
|
915
|
+
tabindex: "0"
|
|
916
|
+
}, [t.value.imgTitleItem?.upload]), l("li", {
|
|
917
|
+
class: `${a}-menu-item ${a}-menu-item-image`,
|
|
918
|
+
onClick: () => {
|
|
919
|
+
c.value = !0;
|
|
920
|
+
},
|
|
921
|
+
role: "menuitem",
|
|
922
|
+
tabindex: "0"
|
|
923
|
+
}, [t.value.imgTitleItem?.clip2upload])]));
|
|
924
|
+
return () => l(_e, null, [l("label", {
|
|
886
925
|
for: `${i}_label`,
|
|
887
926
|
style: {
|
|
888
927
|
display: "none"
|
|
@@ -890,74 +929,37 @@ $$`, "title")
|
|
|
890
929
|
"aria-label": t.value.imgTitleItem?.upload
|
|
891
930
|
}, null), l("input", {
|
|
892
931
|
id: `${i}_label`,
|
|
893
|
-
ref:
|
|
932
|
+
ref: d,
|
|
894
933
|
accept: "image/*",
|
|
895
934
|
type: "file",
|
|
896
935
|
multiple: !0,
|
|
897
936
|
style: {
|
|
898
937
|
display: "none"
|
|
899
938
|
}
|
|
900
|
-
}, null), l(
|
|
939
|
+
}, null), l(te, {
|
|
901
940
|
relative: `#${i}`,
|
|
902
941
|
visible: s.value,
|
|
903
|
-
onChange:
|
|
904
|
-
s.value = b;
|
|
905
|
-
},
|
|
942
|
+
onChange: m,
|
|
906
943
|
disabled: o?.value,
|
|
907
|
-
overlay:
|
|
908
|
-
class: `${a}-menu`,
|
|
909
|
-
onClick: () => {
|
|
910
|
-
s.value = !1;
|
|
911
|
-
},
|
|
912
|
-
role: "menu"
|
|
913
|
-
}, [l("li", {
|
|
914
|
-
class: `${a}-menu-item ${a}-menu-item-image`,
|
|
915
|
-
onClick: () => {
|
|
916
|
-
v("image");
|
|
917
|
-
},
|
|
918
|
-
role: "menuitem",
|
|
919
|
-
tabindex: "0"
|
|
920
|
-
}, [t.value.imgTitleItem?.link]), l("li", {
|
|
921
|
-
class: `${a}-menu-item ${a}-menu-item-image`,
|
|
922
|
-
onClick: () => {
|
|
923
|
-
u.value.click();
|
|
924
|
-
},
|
|
925
|
-
role: "menuitem",
|
|
926
|
-
tabindex: "0"
|
|
927
|
-
}, [t.value.imgTitleItem?.upload]), l("li", {
|
|
928
|
-
class: `${a}-menu-item ${a}-menu-item-image`,
|
|
929
|
-
onClick: () => {
|
|
930
|
-
c.value = !0;
|
|
931
|
-
},
|
|
932
|
-
role: "menuitem",
|
|
933
|
-
tabindex: "0"
|
|
934
|
-
}, [t.value.imgTitleItem?.clip2upload])])
|
|
944
|
+
overlay: p.value
|
|
935
945
|
}, {
|
|
936
946
|
default: () => [l("button", {
|
|
937
947
|
class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
|
|
938
948
|
title: t.value.toolbarTips?.image,
|
|
939
949
|
disabled: o?.value,
|
|
940
950
|
type: "button"
|
|
941
|
-
}, [l(
|
|
951
|
+
}, [l(x, {
|
|
942
952
|
name: "image"
|
|
943
953
|
}, null), n?.value && l("div", {
|
|
944
954
|
class: `${a}-toolbar-item-name`
|
|
945
955
|
}, [t.value.toolbarTips?.image])])]
|
|
946
956
|
}), l(No, {
|
|
947
957
|
clipVisible: c.value,
|
|
948
|
-
onCancel:
|
|
949
|
-
|
|
950
|
-
},
|
|
951
|
-
onOk: (b) => {
|
|
952
|
-
b && v("image", {
|
|
953
|
-
desc: b.desc,
|
|
954
|
-
url: b.url,
|
|
955
|
-
transform: !0
|
|
956
|
-
}), c.value = !1;
|
|
957
|
-
}
|
|
958
|
+
onCancel: f,
|
|
959
|
+
onOk: g
|
|
958
960
|
}, null)]);
|
|
959
961
|
}
|
|
960
|
-
}), Do = /* @__PURE__ */
|
|
962
|
+
}), Do = /* @__PURE__ */ y({
|
|
961
963
|
name: "ToolbarItalic",
|
|
962
964
|
setup() {
|
|
963
965
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -966,49 +968,49 @@ $$`, "title")
|
|
|
966
968
|
title: t.value.toolbarTips?.italic,
|
|
967
969
|
disabled: o?.value,
|
|
968
970
|
onClick: () => {
|
|
969
|
-
|
|
971
|
+
h.emit(e, w, "italic");
|
|
970
972
|
},
|
|
971
973
|
type: "button"
|
|
972
|
-
}, [l(
|
|
974
|
+
}, [l(x, {
|
|
973
975
|
name: "italic"
|
|
974
976
|
}, null), n?.value && l("div", {
|
|
975
977
|
class: `${a}-toolbar-item-name`
|
|
976
978
|
}, [t.value.toolbarTips?.italic])]);
|
|
977
979
|
}
|
|
978
|
-
}), Mo = /* @__PURE__ */
|
|
980
|
+
}), Mo = /* @__PURE__ */ y({
|
|
979
981
|
name: "ToolbarKatex",
|
|
980
982
|
setup() {
|
|
981
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
982
|
-
o?.value ||
|
|
983
|
-
}
|
|
984
|
-
|
|
983
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = (v) => {
|
|
984
|
+
o?.value || h.emit(e, w, v);
|
|
985
|
+
}, d = (v) => {
|
|
986
|
+
s.value = v;
|
|
987
|
+
}, u = P(() => l("ul", {
|
|
988
|
+
class: `${a}-menu`,
|
|
989
|
+
onClick: () => {
|
|
990
|
+
s.value = !1;
|
|
991
|
+
},
|
|
992
|
+
role: "menu"
|
|
993
|
+
}, [l("li", {
|
|
994
|
+
class: `${a}-menu-item ${a}-menu-item-katex`,
|
|
995
|
+
onClick: () => {
|
|
996
|
+
c("katexInline");
|
|
997
|
+
},
|
|
998
|
+
role: "menuitem",
|
|
999
|
+
tabindex: "0"
|
|
1000
|
+
}, [t.value.katex?.inline]), l("li", {
|
|
1001
|
+
class: `${a}-menu-item ${a}-menu-item-katex`,
|
|
1002
|
+
onClick: () => {
|
|
1003
|
+
c("katexBlock");
|
|
1004
|
+
},
|
|
1005
|
+
role: "menuitem",
|
|
1006
|
+
tabindex: "0"
|
|
1007
|
+
}, [t.value.katex?.block])]));
|
|
1008
|
+
return () => l(te, {
|
|
985
1009
|
relative: `#${i}`,
|
|
986
1010
|
visible: s.value,
|
|
987
|
-
onChange:
|
|
988
|
-
s.value = u;
|
|
989
|
-
},
|
|
1011
|
+
onChange: d,
|
|
990
1012
|
disabled: o?.value,
|
|
991
|
-
overlay:
|
|
992
|
-
class: `${a}-menu`,
|
|
993
|
-
onClick: () => {
|
|
994
|
-
s.value = !1;
|
|
995
|
-
},
|
|
996
|
-
role: "menu"
|
|
997
|
-
}, [l("li", {
|
|
998
|
-
class: `${a}-menu-item ${a}-menu-item-katex`,
|
|
999
|
-
onClick: () => {
|
|
1000
|
-
c("katexInline");
|
|
1001
|
-
},
|
|
1002
|
-
role: "menuitem",
|
|
1003
|
-
tabindex: "0"
|
|
1004
|
-
}, [t.value.katex?.inline]), l("li", {
|
|
1005
|
-
class: `${a}-menu-item ${a}-menu-item-katex`,
|
|
1006
|
-
onClick: () => {
|
|
1007
|
-
c("katexBlock");
|
|
1008
|
-
},
|
|
1009
|
-
role: "menuitem",
|
|
1010
|
-
tabindex: "0"
|
|
1011
|
-
}, [t.value.katex?.block])]),
|
|
1013
|
+
overlay: u.value,
|
|
1012
1014
|
key: "bar-katex"
|
|
1013
1015
|
}, {
|
|
1014
1016
|
default: () => [l("button", {
|
|
@@ -1016,14 +1018,14 @@ $$`, "title")
|
|
|
1016
1018
|
title: t.value.toolbarTips?.katex,
|
|
1017
1019
|
disabled: o?.value,
|
|
1018
1020
|
type: "button"
|
|
1019
|
-
}, [l(
|
|
1021
|
+
}, [l(x, {
|
|
1020
1022
|
name: "formula"
|
|
1021
1023
|
}, null), n?.value && l("div", {
|
|
1022
1024
|
class: `${a}-toolbar-item-name`
|
|
1023
1025
|
}, [t.value.toolbarTips?.katex])])]
|
|
1024
1026
|
});
|
|
1025
1027
|
}
|
|
1026
|
-
}), Ro = /* @__PURE__ */
|
|
1028
|
+
}), Ro = /* @__PURE__ */ y({
|
|
1027
1029
|
name: "ToolbarLink",
|
|
1028
1030
|
setup() {
|
|
1029
1031
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1032,91 +1034,91 @@ $$`, "title")
|
|
|
1032
1034
|
title: t.value.toolbarTips?.link,
|
|
1033
1035
|
disabled: o?.value,
|
|
1034
1036
|
onClick: () => {
|
|
1035
|
-
|
|
1037
|
+
h.emit(e, w, "link");
|
|
1036
1038
|
},
|
|
1037
1039
|
type: "button"
|
|
1038
|
-
}, [l(
|
|
1040
|
+
}, [l(x, {
|
|
1039
1041
|
name: "link"
|
|
1040
1042
|
}, null), n?.value && l("div", {
|
|
1041
1043
|
class: `${a}-toolbar-item-name`
|
|
1042
1044
|
}, [t.value.toolbarTips?.link])]);
|
|
1043
1045
|
}
|
|
1044
|
-
}), Fo = /* @__PURE__ */
|
|
1046
|
+
}), Fo = /* @__PURE__ */ y({
|
|
1045
1047
|
name: "ToolbarMermaid",
|
|
1046
1048
|
setup() {
|
|
1047
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
1048
|
-
o?.value ||
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1049
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = (v) => {
|
|
1050
|
+
o?.value || h.emit(e, w, v);
|
|
1051
|
+
}, d = (v) => {
|
|
1052
|
+
s.value = v;
|
|
1053
|
+
}, u = P(() => l("ul", {
|
|
1054
|
+
class: `${a}-menu`,
|
|
1055
|
+
onClick: () => {
|
|
1056
|
+
s.value = !1;
|
|
1057
|
+
},
|
|
1058
|
+
role: "menu"
|
|
1059
|
+
}, [l("li", {
|
|
1060
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1061
|
+
onClick: () => {
|
|
1062
|
+
c("flow");
|
|
1063
|
+
},
|
|
1064
|
+
role: "menuitem",
|
|
1065
|
+
tabindex: "0"
|
|
1066
|
+
}, [t.value.mermaid?.flow]), l("li", {
|
|
1067
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1068
|
+
onClick: () => {
|
|
1069
|
+
c("sequence");
|
|
1070
|
+
},
|
|
1071
|
+
role: "menuitem",
|
|
1072
|
+
tabindex: "0"
|
|
1073
|
+
}, [t.value.mermaid?.sequence]), l("li", {
|
|
1074
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1075
|
+
onClick: () => {
|
|
1076
|
+
c("gantt");
|
|
1077
|
+
},
|
|
1078
|
+
role: "menuitem",
|
|
1079
|
+
tabindex: "0"
|
|
1080
|
+
}, [t.value.mermaid?.gantt]), l("li", {
|
|
1081
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1082
|
+
onClick: () => {
|
|
1083
|
+
c("class");
|
|
1084
|
+
},
|
|
1085
|
+
role: "menuitem",
|
|
1086
|
+
tabindex: "0"
|
|
1087
|
+
}, [t.value.mermaid?.class]), l("li", {
|
|
1088
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1089
|
+
onClick: () => {
|
|
1090
|
+
c("state");
|
|
1091
|
+
},
|
|
1092
|
+
role: "menuitem",
|
|
1093
|
+
tabindex: "0"
|
|
1094
|
+
}, [t.value.mermaid?.state]), l("li", {
|
|
1095
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1096
|
+
onClick: () => {
|
|
1097
|
+
c("pie");
|
|
1098
|
+
},
|
|
1099
|
+
role: "menuitem",
|
|
1100
|
+
tabindex: "0"
|
|
1101
|
+
}, [t.value.mermaid?.pie]), l("li", {
|
|
1102
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1103
|
+
onClick: () => {
|
|
1104
|
+
c("relationship");
|
|
1105
|
+
},
|
|
1106
|
+
role: "menuitem",
|
|
1107
|
+
tabindex: "0"
|
|
1108
|
+
}, [t.value.mermaid?.relationship]), l("li", {
|
|
1109
|
+
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1110
|
+
onClick: () => {
|
|
1111
|
+
c("journey");
|
|
1112
|
+
},
|
|
1113
|
+
role: "menuitem",
|
|
1114
|
+
tabindex: "0"
|
|
1115
|
+
}, [t.value.mermaid?.journey])]));
|
|
1116
|
+
return () => l(te, {
|
|
1051
1117
|
relative: `#${i}`,
|
|
1052
1118
|
visible: s.value,
|
|
1053
|
-
onChange:
|
|
1054
|
-
s.value = u;
|
|
1055
|
-
},
|
|
1119
|
+
onChange: d,
|
|
1056
1120
|
disabled: o?.value,
|
|
1057
|
-
overlay:
|
|
1058
|
-
class: `${a}-menu`,
|
|
1059
|
-
onClick: () => {
|
|
1060
|
-
s.value = !1;
|
|
1061
|
-
},
|
|
1062
|
-
role: "menu"
|
|
1063
|
-
}, [l("li", {
|
|
1064
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1065
|
-
onClick: () => {
|
|
1066
|
-
c("flow");
|
|
1067
|
-
},
|
|
1068
|
-
role: "menuitem",
|
|
1069
|
-
tabindex: "0"
|
|
1070
|
-
}, [t.value.mermaid?.flow]), l("li", {
|
|
1071
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1072
|
-
onClick: () => {
|
|
1073
|
-
c("sequence");
|
|
1074
|
-
},
|
|
1075
|
-
role: "menuitem",
|
|
1076
|
-
tabindex: "0"
|
|
1077
|
-
}, [t.value.mermaid?.sequence]), l("li", {
|
|
1078
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1079
|
-
onClick: () => {
|
|
1080
|
-
c("gantt");
|
|
1081
|
-
},
|
|
1082
|
-
role: "menuitem",
|
|
1083
|
-
tabindex: "0"
|
|
1084
|
-
}, [t.value.mermaid?.gantt]), l("li", {
|
|
1085
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1086
|
-
onClick: () => {
|
|
1087
|
-
c("class");
|
|
1088
|
-
},
|
|
1089
|
-
role: "menuitem",
|
|
1090
|
-
tabindex: "0"
|
|
1091
|
-
}, [t.value.mermaid?.class]), l("li", {
|
|
1092
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1093
|
-
onClick: () => {
|
|
1094
|
-
c("state");
|
|
1095
|
-
},
|
|
1096
|
-
role: "menuitem",
|
|
1097
|
-
tabindex: "0"
|
|
1098
|
-
}, [t.value.mermaid?.state]), l("li", {
|
|
1099
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1100
|
-
onClick: () => {
|
|
1101
|
-
c("pie");
|
|
1102
|
-
},
|
|
1103
|
-
role: "menuitem",
|
|
1104
|
-
tabindex: "0"
|
|
1105
|
-
}, [t.value.mermaid?.pie]), l("li", {
|
|
1106
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1107
|
-
onClick: () => {
|
|
1108
|
-
c("relationship");
|
|
1109
|
-
},
|
|
1110
|
-
role: "menuitem",
|
|
1111
|
-
tabindex: "0"
|
|
1112
|
-
}, [t.value.mermaid?.relationship]), l("li", {
|
|
1113
|
-
class: `${a}-menu-item ${a}-menu-item-mermaid`,
|
|
1114
|
-
onClick: () => {
|
|
1115
|
-
c("journey");
|
|
1116
|
-
},
|
|
1117
|
-
role: "menuitem",
|
|
1118
|
-
tabindex: "0"
|
|
1119
|
-
}, [t.value.mermaid?.journey])]),
|
|
1121
|
+
overlay: u.value,
|
|
1120
1122
|
key: "bar-mermaid"
|
|
1121
1123
|
}, {
|
|
1122
1124
|
default: () => [l("button", {
|
|
@@ -1124,14 +1126,14 @@ $$`, "title")
|
|
|
1124
1126
|
title: t.value.toolbarTips?.mermaid,
|
|
1125
1127
|
disabled: o?.value,
|
|
1126
1128
|
type: "button"
|
|
1127
|
-
}, [l(
|
|
1129
|
+
}, [l(x, {
|
|
1128
1130
|
name: "mermaid"
|
|
1129
1131
|
}, null), n?.value && l("div", {
|
|
1130
1132
|
class: `${a}-toolbar-item-name`
|
|
1131
1133
|
}, [t.value.toolbarTips?.mermaid])])]
|
|
1132
1134
|
});
|
|
1133
1135
|
}
|
|
1134
|
-
}), Bo = /* @__PURE__ */
|
|
1136
|
+
}), Bo = /* @__PURE__ */ y({
|
|
1135
1137
|
name: "ToolbarNext",
|
|
1136
1138
|
setup() {
|
|
1137
1139
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1140,16 +1142,16 @@ $$`, "title")
|
|
|
1140
1142
|
title: t.value.toolbarTips?.next,
|
|
1141
1143
|
disabled: o?.value,
|
|
1142
1144
|
onClick: () => {
|
|
1143
|
-
|
|
1145
|
+
h.emit(e, Ue);
|
|
1144
1146
|
},
|
|
1145
1147
|
type: "button"
|
|
1146
|
-
}, [l(
|
|
1148
|
+
}, [l(x, {
|
|
1147
1149
|
name: "next"
|
|
1148
1150
|
}, null), n?.value && l("div", {
|
|
1149
1151
|
class: `${a}-toolbar-item-name`
|
|
1150
1152
|
}, [t.value.toolbarTips?.next])]);
|
|
1151
1153
|
}
|
|
1152
|
-
}), Po = /* @__PURE__ */
|
|
1154
|
+
}), Po = /* @__PURE__ */ y({
|
|
1153
1155
|
name: "ToolbarOrderedList",
|
|
1154
1156
|
setup() {
|
|
1155
1157
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1158,16 +1160,16 @@ $$`, "title")
|
|
|
1158
1160
|
title: t.value.toolbarTips?.orderedList,
|
|
1159
1161
|
disabled: o?.value,
|
|
1160
1162
|
onClick: () => {
|
|
1161
|
-
|
|
1163
|
+
h.emit(e, w, "orderedList");
|
|
1162
1164
|
},
|
|
1163
1165
|
type: "button"
|
|
1164
|
-
}, [l(
|
|
1166
|
+
}, [l(x, {
|
|
1165
1167
|
name: "ordered-list"
|
|
1166
1168
|
}, null), n?.value && l("div", {
|
|
1167
1169
|
class: `${a}-toolbar-item-name`
|
|
1168
1170
|
}, [t.value.toolbarTips?.orderedList])]);
|
|
1169
1171
|
}
|
|
1170
|
-
}), Ho = /* @__PURE__ */
|
|
1172
|
+
}), Ho = /* @__PURE__ */ y({
|
|
1171
1173
|
name: "ToolbarPageFullscreen",
|
|
1172
1174
|
setup() {
|
|
1173
1175
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -1179,13 +1181,13 @@ $$`, "title")
|
|
|
1179
1181
|
i("pageFullscreen");
|
|
1180
1182
|
},
|
|
1181
1183
|
type: "button"
|
|
1182
|
-
}, [l(
|
|
1184
|
+
}, [l(x, {
|
|
1183
1185
|
name: n.value.pageFullscreen ? "minimize" : "maximize"
|
|
1184
1186
|
}, null), o?.value && l("div", {
|
|
1185
1187
|
class: `${a}-toolbar-item-name`
|
|
1186
1188
|
}, [e.value.toolbarTips?.pageFullscreen])]);
|
|
1187
1189
|
}
|
|
1188
|
-
}), Oo = /* @__PURE__ */
|
|
1190
|
+
}), Oo = /* @__PURE__ */ y({
|
|
1189
1191
|
name: "ToolbarPrettier",
|
|
1190
1192
|
setup() {
|
|
1191
1193
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1194,16 +1196,16 @@ $$`, "title")
|
|
|
1194
1196
|
title: t.value.toolbarTips?.prettier,
|
|
1195
1197
|
disabled: o?.value,
|
|
1196
1198
|
onClick: () => {
|
|
1197
|
-
|
|
1199
|
+
h.emit(e, w, "prettier");
|
|
1198
1200
|
},
|
|
1199
1201
|
type: "button"
|
|
1200
|
-
}, [l(
|
|
1202
|
+
}, [l(x, {
|
|
1201
1203
|
name: "prettier"
|
|
1202
1204
|
}, null), n?.value && l("div", {
|
|
1203
1205
|
class: `${a}-toolbar-item-name`
|
|
1204
1206
|
}, [t.value.toolbarTips?.prettier])]);
|
|
1205
1207
|
}
|
|
1206
|
-
}), Vo = /* @__PURE__ */
|
|
1208
|
+
}), Vo = /* @__PURE__ */ y({
|
|
1207
1209
|
name: "ToolbarPreview",
|
|
1208
1210
|
setup() {
|
|
1209
1211
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -1215,13 +1217,13 @@ $$`, "title")
|
|
|
1215
1217
|
i("preview");
|
|
1216
1218
|
},
|
|
1217
1219
|
type: "button"
|
|
1218
|
-
}, [l(
|
|
1220
|
+
}, [l(x, {
|
|
1219
1221
|
name: "preview"
|
|
1220
1222
|
}, null), o?.value && l("div", {
|
|
1221
1223
|
class: `${a}-toolbar-item-name`
|
|
1222
1224
|
}, [e.value.toolbarTips?.preview])]);
|
|
1223
1225
|
}
|
|
1224
|
-
}), Wo = /* @__PURE__ */
|
|
1226
|
+
}), Wo = /* @__PURE__ */ y({
|
|
1225
1227
|
name: "ToolbarPreviewOnly",
|
|
1226
1228
|
setup() {
|
|
1227
1229
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -1233,13 +1235,13 @@ $$`, "title")
|
|
|
1233
1235
|
i("previewOnly");
|
|
1234
1236
|
},
|
|
1235
1237
|
type: "button"
|
|
1236
|
-
}, [l(
|
|
1238
|
+
}, [l(x, {
|
|
1237
1239
|
name: "preview-only"
|
|
1238
1240
|
}, null), o?.value && l("div", {
|
|
1239
1241
|
class: `${a}-toolbar-item-name`
|
|
1240
1242
|
}, [e.value.toolbarTips?.previewOnly])]);
|
|
1241
1243
|
}
|
|
1242
|
-
}), _o = /* @__PURE__ */
|
|
1244
|
+
}), _o = /* @__PURE__ */ y({
|
|
1243
1245
|
name: "ToolbarQuote",
|
|
1244
1246
|
setup() {
|
|
1245
1247
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1248,16 +1250,16 @@ $$`, "title")
|
|
|
1248
1250
|
title: t.value.toolbarTips?.quote,
|
|
1249
1251
|
disabled: o?.value,
|
|
1250
1252
|
onClick: () => {
|
|
1251
|
-
|
|
1253
|
+
h.emit(e, w, "quote");
|
|
1252
1254
|
},
|
|
1253
1255
|
type: "button"
|
|
1254
|
-
}, [l(
|
|
1256
|
+
}, [l(x, {
|
|
1255
1257
|
name: "quote"
|
|
1256
1258
|
}, null), n?.value && l("div", {
|
|
1257
1259
|
class: `${a}-toolbar-item-name`
|
|
1258
1260
|
}, [t.value.toolbarTips?.quote])]);
|
|
1259
1261
|
}
|
|
1260
|
-
}), zo = /* @__PURE__ */
|
|
1262
|
+
}), zo = /* @__PURE__ */ y({
|
|
1261
1263
|
name: "ToolbarRevoke",
|
|
1262
1264
|
setup() {
|
|
1263
1265
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1266,16 +1268,16 @@ $$`, "title")
|
|
|
1266
1268
|
title: t.value.toolbarTips?.revoke,
|
|
1267
1269
|
disabled: o?.value,
|
|
1268
1270
|
onClick: () => {
|
|
1269
|
-
|
|
1271
|
+
h.emit(e, Ke);
|
|
1270
1272
|
},
|
|
1271
1273
|
type: "button"
|
|
1272
|
-
}, [l(
|
|
1274
|
+
}, [l(x, {
|
|
1273
1275
|
name: "revoke"
|
|
1274
1276
|
}, null), n?.value && l("div", {
|
|
1275
1277
|
class: `${a}-toolbar-item-name`
|
|
1276
1278
|
}, [t.value.toolbarTips?.revoke])]);
|
|
1277
1279
|
}
|
|
1278
|
-
}), qo = /* @__PURE__ */
|
|
1280
|
+
}), qo = /* @__PURE__ */ y({
|
|
1279
1281
|
name: "ToolbarSave",
|
|
1280
1282
|
setup() {
|
|
1281
1283
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1284,16 +1286,16 @@ $$`, "title")
|
|
|
1284
1286
|
title: t.value.toolbarTips?.save,
|
|
1285
1287
|
disabled: o?.value,
|
|
1286
1288
|
onClick: () => {
|
|
1287
|
-
|
|
1289
|
+
h.emit(e, Ge);
|
|
1288
1290
|
},
|
|
1289
1291
|
type: "button"
|
|
1290
|
-
}, [l(
|
|
1292
|
+
}, [l(x, {
|
|
1291
1293
|
name: "save"
|
|
1292
1294
|
}, null), n?.value && l("div", {
|
|
1293
1295
|
class: `${a}-toolbar-item-name`
|
|
1294
1296
|
}, [t.value.toolbarTips?.save])]);
|
|
1295
1297
|
}
|
|
1296
|
-
}), Uo = /* @__PURE__ */
|
|
1298
|
+
}), Uo = /* @__PURE__ */ y({
|
|
1297
1299
|
name: "ToolbarStrikeThrough",
|
|
1298
1300
|
setup() {
|
|
1299
1301
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1302,16 +1304,16 @@ $$`, "title")
|
|
|
1302
1304
|
title: t.value.toolbarTips?.strikeThrough,
|
|
1303
1305
|
disabled: o?.value,
|
|
1304
1306
|
onClick: () => {
|
|
1305
|
-
|
|
1307
|
+
h.emit(e, w, "strikeThrough");
|
|
1306
1308
|
},
|
|
1307
1309
|
type: "button"
|
|
1308
|
-
}, [l(
|
|
1310
|
+
}, [l(x, {
|
|
1309
1311
|
name: "strike-through"
|
|
1310
1312
|
}, null), n?.value && l("div", {
|
|
1311
1313
|
class: `${a}-toolbar-item-name`
|
|
1312
1314
|
}, [t.value.toolbarTips?.strikeThrough])]);
|
|
1313
1315
|
}
|
|
1314
|
-
}), Ko = /* @__PURE__ */
|
|
1316
|
+
}), Ko = /* @__PURE__ */ y({
|
|
1315
1317
|
name: "ToolbarSub",
|
|
1316
1318
|
setup() {
|
|
1317
1319
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1320,16 +1322,16 @@ $$`, "title")
|
|
|
1320
1322
|
title: t.value.toolbarTips?.sub,
|
|
1321
1323
|
disabled: o?.value,
|
|
1322
1324
|
onClick: () => {
|
|
1323
|
-
|
|
1325
|
+
h.emit(e, w, "sub");
|
|
1324
1326
|
},
|
|
1325
1327
|
type: "button"
|
|
1326
|
-
}, [l(
|
|
1328
|
+
}, [l(x, {
|
|
1327
1329
|
name: "sub"
|
|
1328
1330
|
}, null), n?.value && l("div", {
|
|
1329
1331
|
class: `${a}-toolbar-item-name`
|
|
1330
1332
|
}, [t.value.toolbarTips?.sub])]);
|
|
1331
1333
|
}
|
|
1332
|
-
}), Go = /* @__PURE__ */
|
|
1334
|
+
}), Go = /* @__PURE__ */ y({
|
|
1333
1335
|
name: "ToolbarSup",
|
|
1334
1336
|
setup() {
|
|
1335
1337
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1338,10 +1340,10 @@ $$`, "title")
|
|
|
1338
1340
|
title: t.value.toolbarTips?.sup,
|
|
1339
1341
|
disabled: o?.value,
|
|
1340
1342
|
onClick: () => {
|
|
1341
|
-
|
|
1343
|
+
h.emit(e, w, "sup");
|
|
1342
1344
|
},
|
|
1343
1345
|
type: "button"
|
|
1344
|
-
}, [l(
|
|
1346
|
+
}, [l(x, {
|
|
1345
1347
|
name: "sup"
|
|
1346
1348
|
}, null), n?.value && l("div", {
|
|
1347
1349
|
class: `${a}-toolbar-item-name`
|
|
@@ -1357,18 +1359,18 @@ $$`, "title")
|
|
|
1357
1359
|
default: () => {
|
|
1358
1360
|
}
|
|
1359
1361
|
}
|
|
1360
|
-
}, Yo = /* @__PURE__ */
|
|
1362
|
+
}, Yo = /* @__PURE__ */ y({
|
|
1361
1363
|
name: "TableShape",
|
|
1362
1364
|
props: jo,
|
|
1363
1365
|
setup(e) {
|
|
1364
|
-
const t =
|
|
1366
|
+
const t = Y({
|
|
1365
1367
|
x: -1,
|
|
1366
1368
|
y: -1
|
|
1367
|
-
}), o =
|
|
1369
|
+
}), o = P(() => JSON.stringify(e.tableShape)), n = () => {
|
|
1368
1370
|
const s = [...JSON.parse(o.value)];
|
|
1369
1371
|
return (!s[2] || s[2] < s[0]) && (s[2] = s[0]), (!s[3] || s[3] < s[3]) && (s[3] = s[1]), s;
|
|
1370
|
-
}, i =
|
|
1371
|
-
return
|
|
1372
|
+
}, i = E(n());
|
|
1373
|
+
return N([o], () => {
|
|
1372
1374
|
i.value = n();
|
|
1373
1375
|
}), () => l("div", {
|
|
1374
1376
|
class: `${a}-table-shape`,
|
|
@@ -1378,53 +1380,53 @@ $$`, "title")
|
|
|
1378
1380
|
}, [new Array(i.value[1]).fill("").map((s, c) => l("div", {
|
|
1379
1381
|
class: `${a}-table-shape-row`,
|
|
1380
1382
|
key: `table-shape-row-${c}`
|
|
1381
|
-
}, [new Array(i.value[0]).fill("").map((
|
|
1383
|
+
}, [new Array(i.value[0]).fill("").map((d, u) => l("div", {
|
|
1382
1384
|
class: `${a}-table-shape-col`,
|
|
1383
|
-
key: `table-shape-col-${
|
|
1385
|
+
key: `table-shape-col-${u}`,
|
|
1384
1386
|
onMouseenter: () => {
|
|
1385
|
-
t.x = c, t.y =
|
|
1387
|
+
t.x = c, t.y = u, u + 1 === i.value[0] && u + 1 < i.value[2] ? i.value[0]++ : u + 2 < i.value[0] && i.value[0] > e.tableShape[0] && i.value[0]--, c + 1 === i.value[1] && c + 1 < i.value[3] ? i.value[1]++ : c + 2 < i.value[1] && i.value[1] > e.tableShape[1] && i.value[1]--;
|
|
1386
1388
|
},
|
|
1387
1389
|
onClick: () => {
|
|
1388
1390
|
e.onSelected(t);
|
|
1389
1391
|
}
|
|
1390
1392
|
}, [l("div", {
|
|
1391
|
-
class: [`${a}-table-shape-col-default`, c <= t.x &&
|
|
1393
|
+
class: [`${a}-table-shape-col-default`, c <= t.x && u <= t.y && `${a}-table-shape-col-include`]
|
|
1392
1394
|
}, null)]))]))]);
|
|
1393
1395
|
}
|
|
1394
|
-
}), Zo = /* @__PURE__ */
|
|
1396
|
+
}), Zo = /* @__PURE__ */ y({
|
|
1395
1397
|
name: "ToolbarTable",
|
|
1396
1398
|
setup() {
|
|
1397
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c =
|
|
1398
|
-
|
|
1399
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c = E(!1), d = (m) => {
|
|
1400
|
+
c.value = m;
|
|
1401
|
+
}, u = (m) => {
|
|
1402
|
+
o?.value || h.emit(e, w, "table", {
|
|
1403
|
+
selectedShape: m
|
|
1404
|
+
});
|
|
1405
|
+
}, v = P(() => l(Yo, {
|
|
1406
|
+
tableShape: i.value,
|
|
1407
|
+
onSelected: u
|
|
1408
|
+
}, null));
|
|
1409
|
+
return () => l(te, {
|
|
1399
1410
|
relative: `#${s}`,
|
|
1400
1411
|
visible: c.value,
|
|
1401
|
-
onChange:
|
|
1402
|
-
c.value = u;
|
|
1403
|
-
},
|
|
1412
|
+
onChange: d,
|
|
1404
1413
|
disabled: o?.value,
|
|
1405
1414
|
key: "bar-table",
|
|
1406
|
-
overlay:
|
|
1407
|
-
tableShape: i.value,
|
|
1408
|
-
onSelected: (u) => {
|
|
1409
|
-
o?.value || g.emit(e, y, "table", {
|
|
1410
|
-
selectedShape: u
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
}, null)
|
|
1415
|
+
overlay: v.value
|
|
1414
1416
|
}, {
|
|
1415
1417
|
default: () => [l("button", {
|
|
1416
1418
|
class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
|
|
1417
1419
|
title: t.value.toolbarTips?.table,
|
|
1418
1420
|
disabled: o?.value,
|
|
1419
1421
|
type: "button"
|
|
1420
|
-
}, [l(
|
|
1422
|
+
}, [l(x, {
|
|
1421
1423
|
name: "table"
|
|
1422
1424
|
}, null), n?.value && l("div", {
|
|
1423
1425
|
class: `${a}-toolbar-item-name`
|
|
1424
1426
|
}, [t.value.toolbarTips?.table])])]
|
|
1425
1427
|
});
|
|
1426
1428
|
}
|
|
1427
|
-
}), Xo = /* @__PURE__ */
|
|
1429
|
+
}), Xo = /* @__PURE__ */ y({
|
|
1428
1430
|
name: "ToolbarTask",
|
|
1429
1431
|
setup() {
|
|
1430
1432
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1433,91 +1435,91 @@ $$`, "title")
|
|
|
1433
1435
|
title: t.value.toolbarTips?.task,
|
|
1434
1436
|
disabled: o?.value,
|
|
1435
1437
|
onClick: () => {
|
|
1436
|
-
|
|
1438
|
+
h.emit(e, w, "task");
|
|
1437
1439
|
},
|
|
1438
1440
|
type: "button"
|
|
1439
|
-
}, [l(
|
|
1441
|
+
}, [l(x, {
|
|
1440
1442
|
name: "task"
|
|
1441
1443
|
}, null), n?.value && l("div", {
|
|
1442
1444
|
class: `${a}-toolbar-item-name`
|
|
1443
1445
|
}, [t.value.toolbarTips?.task])]);
|
|
1444
1446
|
}
|
|
1445
|
-
}), Jo = /* @__PURE__ */
|
|
1447
|
+
}), Jo = /* @__PURE__ */ y({
|
|
1446
1448
|
name: "ToolbarTitle",
|
|
1447
1449
|
setup() {
|
|
1448
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
1449
|
-
o?.value ||
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1450
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = (v) => {
|
|
1451
|
+
o?.value || h.emit(e, w, v);
|
|
1452
|
+
}, d = (v) => {
|
|
1453
|
+
s.value = v;
|
|
1454
|
+
}, u = P(() => l("ul", {
|
|
1455
|
+
class: `${a}-menu`,
|
|
1456
|
+
onClick: () => {
|
|
1457
|
+
s.value = !1;
|
|
1458
|
+
},
|
|
1459
|
+
role: "menu"
|
|
1460
|
+
}, [l("li", {
|
|
1461
|
+
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1462
|
+
onClick: () => {
|
|
1463
|
+
c("h1");
|
|
1464
|
+
},
|
|
1465
|
+
role: "menuitem",
|
|
1466
|
+
tabindex: "0"
|
|
1467
|
+
}, [t.value.titleItem?.h1]), l("li", {
|
|
1468
|
+
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1469
|
+
onClick: () => {
|
|
1470
|
+
c("h2");
|
|
1471
|
+
},
|
|
1472
|
+
role: "menuitem",
|
|
1473
|
+
tabindex: "0"
|
|
1474
|
+
}, [t.value.titleItem?.h2]), l("li", {
|
|
1475
|
+
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1476
|
+
onClick: () => {
|
|
1477
|
+
c("h3");
|
|
1478
|
+
},
|
|
1479
|
+
role: "menuitem",
|
|
1480
|
+
tabindex: "0"
|
|
1481
|
+
}, [t.value.titleItem?.h3]), l("li", {
|
|
1482
|
+
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1483
|
+
onClick: () => {
|
|
1484
|
+
c("h4");
|
|
1485
|
+
},
|
|
1486
|
+
role: "menuitem",
|
|
1487
|
+
tabindex: "0"
|
|
1488
|
+
}, [t.value.titleItem?.h4]), l("li", {
|
|
1489
|
+
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1490
|
+
onClick: () => {
|
|
1491
|
+
c("h5");
|
|
1492
|
+
},
|
|
1493
|
+
role: "menuitem",
|
|
1494
|
+
tabindex: "0"
|
|
1495
|
+
}, [t.value.titleItem?.h5]), l("li", {
|
|
1496
|
+
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1497
|
+
onClick: () => {
|
|
1498
|
+
c("h6");
|
|
1499
|
+
},
|
|
1500
|
+
role: "menuitem",
|
|
1501
|
+
tabindex: "0"
|
|
1502
|
+
}, [t.value.titleItem?.h6])]));
|
|
1503
|
+
return () => l(te, {
|
|
1452
1504
|
relative: `#${i}`,
|
|
1453
1505
|
visible: s.value,
|
|
1454
|
-
onChange:
|
|
1455
|
-
s.value = u;
|
|
1456
|
-
},
|
|
1506
|
+
onChange: d,
|
|
1457
1507
|
disabled: o?.value,
|
|
1458
|
-
overlay:
|
|
1459
|
-
class: `${a}-menu`,
|
|
1460
|
-
onClick: () => {
|
|
1461
|
-
s.value = !1;
|
|
1462
|
-
},
|
|
1463
|
-
role: "menu"
|
|
1464
|
-
}, [l("li", {
|
|
1465
|
-
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1466
|
-
onClick: () => {
|
|
1467
|
-
c("h1");
|
|
1468
|
-
},
|
|
1469
|
-
role: "menuitem",
|
|
1470
|
-
tabindex: "0"
|
|
1471
|
-
}, [t.value.titleItem?.h1]), l("li", {
|
|
1472
|
-
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1473
|
-
onClick: () => {
|
|
1474
|
-
c("h2");
|
|
1475
|
-
},
|
|
1476
|
-
role: "menuitem",
|
|
1477
|
-
tabindex: "0"
|
|
1478
|
-
}, [t.value.titleItem?.h2]), l("li", {
|
|
1479
|
-
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1480
|
-
onClick: () => {
|
|
1481
|
-
c("h3");
|
|
1482
|
-
},
|
|
1483
|
-
role: "menuitem",
|
|
1484
|
-
tabindex: "0"
|
|
1485
|
-
}, [t.value.titleItem?.h3]), l("li", {
|
|
1486
|
-
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1487
|
-
onClick: () => {
|
|
1488
|
-
c("h4");
|
|
1489
|
-
},
|
|
1490
|
-
role: "menuitem",
|
|
1491
|
-
tabindex: "0"
|
|
1492
|
-
}, [t.value.titleItem?.h4]), l("li", {
|
|
1493
|
-
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1494
|
-
onClick: () => {
|
|
1495
|
-
c("h5");
|
|
1496
|
-
},
|
|
1497
|
-
role: "menuitem",
|
|
1498
|
-
tabindex: "0"
|
|
1499
|
-
}, [t.value.titleItem?.h5]), l("li", {
|
|
1500
|
-
class: `${a}-menu-item ${a}-menu-item-title`,
|
|
1501
|
-
onClick: () => {
|
|
1502
|
-
c("h6");
|
|
1503
|
-
},
|
|
1504
|
-
role: "menuitem",
|
|
1505
|
-
tabindex: "0"
|
|
1506
|
-
}, [t.value.titleItem?.h6])])
|
|
1508
|
+
overlay: u.value
|
|
1507
1509
|
}, {
|
|
1508
1510
|
default: () => [l("button", {
|
|
1509
1511
|
class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
|
|
1510
1512
|
disabled: o?.value,
|
|
1511
1513
|
title: t.value.toolbarTips?.title,
|
|
1512
1514
|
type: "button"
|
|
1513
|
-
}, [l(
|
|
1515
|
+
}, [l(x, {
|
|
1514
1516
|
name: "title"
|
|
1515
1517
|
}, null), n?.value && l("div", {
|
|
1516
1518
|
class: `${a}-toolbar-item-name`
|
|
1517
1519
|
}, [t.value.toolbarTips?.title])])]
|
|
1518
1520
|
});
|
|
1519
1521
|
}
|
|
1520
|
-
}), Qo = /* @__PURE__ */
|
|
1522
|
+
}), Qo = /* @__PURE__ */ y({
|
|
1521
1523
|
name: "ToolbarUnderline",
|
|
1522
1524
|
setup() {
|
|
1523
1525
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1526,16 +1528,16 @@ $$`, "title")
|
|
|
1526
1528
|
title: t.value.toolbarTips?.underline,
|
|
1527
1529
|
disabled: o?.value,
|
|
1528
1530
|
onClick: () => {
|
|
1529
|
-
|
|
1531
|
+
h.emit(e, w, "underline");
|
|
1530
1532
|
},
|
|
1531
1533
|
type: "button"
|
|
1532
|
-
}, [l(
|
|
1534
|
+
}, [l(x, {
|
|
1533
1535
|
name: "underline"
|
|
1534
1536
|
}, null), n?.value && l("div", {
|
|
1535
1537
|
class: `${a}-toolbar-item-name`
|
|
1536
1538
|
}, [t.value.toolbarTips?.underline])]);
|
|
1537
1539
|
}
|
|
1538
|
-
}), el = /* @__PURE__ */
|
|
1540
|
+
}), el = /* @__PURE__ */ y({
|
|
1539
1541
|
name: "ToolbarUnorderedList",
|
|
1540
1542
|
setup() {
|
|
1541
1543
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1544,10 +1546,10 @@ $$`, "title")
|
|
|
1544
1546
|
title: t.value.toolbarTips?.unorderedList,
|
|
1545
1547
|
disabled: o?.value,
|
|
1546
1548
|
onClick: () => {
|
|
1547
|
-
|
|
1549
|
+
h.emit(e, w, "unorderedList");
|
|
1548
1550
|
},
|
|
1549
1551
|
type: "button"
|
|
1550
|
-
}, [l(
|
|
1552
|
+
}, [l(x, {
|
|
1551
1553
|
name: "unordered-list"
|
|
1552
1554
|
}, null), n?.value && l("div", {
|
|
1553
1555
|
class: `${a}-toolbar-item-name`
|
|
@@ -1557,47 +1559,47 @@ $$`, "title")
|
|
|
1557
1559
|
const e = r("editorId"), t = r("setting"), o = r("updateSetting"), {
|
|
1558
1560
|
editorExtensions: n,
|
|
1559
1561
|
editorExtensionsAttrs: i
|
|
1560
|
-
} =
|
|
1562
|
+
} = Z;
|
|
1561
1563
|
let s = n.screenfull.instance;
|
|
1562
|
-
const c =
|
|
1564
|
+
const c = E(!1), d = (m) => {
|
|
1563
1565
|
if (!s) {
|
|
1564
|
-
|
|
1566
|
+
h.emit(e, X, {
|
|
1565
1567
|
name: "fullscreen",
|
|
1566
1568
|
message: "fullscreen is undefined"
|
|
1567
1569
|
});
|
|
1568
1570
|
return;
|
|
1569
1571
|
}
|
|
1570
|
-
s.isEnabled ? (c.value = !0, (
|
|
1571
|
-
},
|
|
1572
|
+
s.isEnabled ? (c.value = !0, (m === void 0 ? !s.isFullscreen : m) ? s.request() : s.exit()) : console.error("browser does not support screenfull!");
|
|
1573
|
+
}, u = () => {
|
|
1572
1574
|
s && s.isEnabled && s.on("change", () => {
|
|
1573
1575
|
(c.value || t.value.fullscreen) && (c.value = !1, o("fullscreen"));
|
|
1574
1576
|
});
|
|
1575
1577
|
}, v = () => {
|
|
1576
|
-
s = window.screenfull,
|
|
1578
|
+
s = window.screenfull, u();
|
|
1577
1579
|
};
|
|
1578
|
-
return
|
|
1579
|
-
|
|
1580
|
+
return K(() => {
|
|
1581
|
+
u(), s || Jt("script", {
|
|
1580
1582
|
...i.screenfull?.js,
|
|
1581
1583
|
src: n.screenfull.js,
|
|
1582
1584
|
id: rt.screenfull,
|
|
1583
1585
|
onload: v
|
|
1584
1586
|
}, "screenfull");
|
|
1585
|
-
}),
|
|
1586
|
-
|
|
1587
|
+
}), K(() => {
|
|
1588
|
+
h.on(e, {
|
|
1587
1589
|
name: Kt,
|
|
1588
|
-
callback:
|
|
1590
|
+
callback: d
|
|
1589
1591
|
});
|
|
1590
1592
|
}), {
|
|
1591
|
-
fullscreenHandler:
|
|
1593
|
+
fullscreenHandler: d
|
|
1592
1594
|
};
|
|
1593
1595
|
};
|
|
1594
1596
|
let ol = 0;
|
|
1595
1597
|
const Ze = () => {
|
|
1596
|
-
const e = r("editorId"), t = r("theme"), o = r("previewTheme"), n = r("language"), i = r("disabled"), s = r("noUploadImg"), c = r("noPrettier"),
|
|
1598
|
+
const e = r("editorId"), t = r("theme"), o = r("previewTheme"), n = r("language"), i = r("disabled"), s = r("noUploadImg"), c = r("noPrettier"), d = r("codeTheme"), u = r("showToolbarName"), v = r("setting"), m = r("defToolbars");
|
|
1597
1599
|
return {
|
|
1598
|
-
barRender: (
|
|
1599
|
-
if ($t.includes(
|
|
1600
|
-
switch (
|
|
1600
|
+
barRender: (g) => {
|
|
1601
|
+
if ($t.includes(g))
|
|
1602
|
+
switch (g) {
|
|
1601
1603
|
case "-":
|
|
1602
1604
|
return l(po, {
|
|
1603
1605
|
key: `bar-${ol++}`
|
|
@@ -1721,33 +1723,33 @@ const Ze = () => {
|
|
|
1721
1723
|
key: "bar-katex"
|
|
1722
1724
|
}, null);
|
|
1723
1725
|
}
|
|
1724
|
-
else if (
|
|
1725
|
-
const p =
|
|
1726
|
-
return p ?
|
|
1726
|
+
else if (m.value instanceof Array) {
|
|
1727
|
+
const p = m.value[g];
|
|
1728
|
+
return p ? ne(p, {
|
|
1727
1729
|
theme: p.props?.theme || t.value,
|
|
1728
1730
|
previewTheme: p.props?.theme || o.value,
|
|
1729
1731
|
language: p.props?.theme || n.value,
|
|
1730
|
-
codeTheme: p.props?.codeTheme ||
|
|
1732
|
+
codeTheme: p.props?.codeTheme || d.value,
|
|
1731
1733
|
disabled: p.props?.disabled || i.value,
|
|
1732
|
-
showToolbarName: p.props?.showToolbarName ||
|
|
1733
|
-
insert(
|
|
1734
|
-
|
|
1735
|
-
generate:
|
|
1734
|
+
showToolbarName: p.props?.showToolbarName || u.value,
|
|
1735
|
+
insert(S) {
|
|
1736
|
+
h.emit(e, w, "universal", {
|
|
1737
|
+
generate: S
|
|
1736
1738
|
});
|
|
1737
1739
|
}
|
|
1738
1740
|
}) : "";
|
|
1739
|
-
} else if (
|
|
1740
|
-
const p =
|
|
1741
|
-
return p ?
|
|
1741
|
+
} else if (m.value?.children instanceof Array) {
|
|
1742
|
+
const p = m.value.children[g];
|
|
1743
|
+
return p ? ne(p, {
|
|
1742
1744
|
theme: p.props?.theme || t.value,
|
|
1743
1745
|
previewTheme: p.props?.theme || o.value,
|
|
1744
1746
|
language: p.props?.theme || n.value,
|
|
1745
|
-
codeTheme: p.props?.codeTheme ||
|
|
1747
|
+
codeTheme: p.props?.codeTheme || d.value,
|
|
1746
1748
|
disabled: p.props?.disabled || i.value,
|
|
1747
|
-
showToolbarName: p.props?.showToolbarName ||
|
|
1748
|
-
insert(
|
|
1749
|
-
|
|
1750
|
-
generate:
|
|
1749
|
+
showToolbarName: p.props?.showToolbarName || u.value,
|
|
1750
|
+
insert(S) {
|
|
1751
|
+
h.emit(e, w, "universal", {
|
|
1752
|
+
generate: S
|
|
1751
1753
|
});
|
|
1752
1754
|
}
|
|
1753
1755
|
}) : "";
|
|
@@ -1755,7 +1757,7 @@ const Ze = () => {
|
|
|
1755
1757
|
return "";
|
|
1756
1758
|
}
|
|
1757
1759
|
};
|
|
1758
|
-
}, ll = /* @__PURE__ */
|
|
1760
|
+
}, ll = /* @__PURE__ */ y({
|
|
1759
1761
|
name: "FloatingToolbar",
|
|
1760
1762
|
setup() {
|
|
1761
1763
|
const e = r("floatingToolbars"), {
|
|
@@ -1765,7 +1767,7 @@ const Ze = () => {
|
|
|
1765
1767
|
class: `${a}-floating-toolbar`
|
|
1766
1768
|
}, [e.value.map((o) => t(o))]);
|
|
1767
1769
|
}
|
|
1768
|
-
}), ve =
|
|
1770
|
+
}), ve = re.define(), al = qe.define({
|
|
1769
1771
|
create() {
|
|
1770
1772
|
return null;
|
|
1771
1773
|
},
|
|
@@ -1775,36 +1777,43 @@ const Ze = () => {
|
|
|
1775
1777
|
},
|
|
1776
1778
|
provide: (e) => Vt.from(e)
|
|
1777
1779
|
}), nl = (e) => {
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
+
let t = null;
|
|
1781
|
+
const o = (s, c) => {
|
|
1782
|
+
t && t.kind === c.kind && t.pos === c.pos || (t = c, s.dispatch({
|
|
1780
1783
|
effects: ve.of({
|
|
1781
|
-
pos:
|
|
1784
|
+
pos: c.pos,
|
|
1782
1785
|
above: !0,
|
|
1783
1786
|
arrow: !0,
|
|
1784
1787
|
create: () => {
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1788
|
+
const d = document.createElement("div"), u = `${a}-floating-toolbar-container`;
|
|
1789
|
+
d.classList.add(u), d.dataset.state = "hidden", requestAnimationFrame(() => {
|
|
1790
|
+
d.dataset.state = "visible";
|
|
1791
|
+
});
|
|
1792
|
+
const v = document.createElement("div");
|
|
1793
|
+
d.appendChild(v);
|
|
1794
|
+
const m = Ct(ll);
|
|
1795
|
+
return e.privide(m), m.mount(d), { dom: d, destroy: () => m.unmount() };
|
|
1789
1796
|
}
|
|
1790
1797
|
})
|
|
1791
|
-
});
|
|
1792
|
-
},
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1798
|
+
}));
|
|
1799
|
+
}, n = (s) => {
|
|
1800
|
+
t && (t = null, s.dispatch({ effects: ve.of(null) }));
|
|
1801
|
+
}, i = B.updateListener.of((s) => {
|
|
1802
|
+
if (s.selectionSet || s.docChanged) {
|
|
1803
|
+
const c = s.state, d = c.selection.main;
|
|
1804
|
+
if (!d.empty)
|
|
1805
|
+
o(s.view, { kind: "selection", pos: d.anchor });
|
|
1797
1806
|
else {
|
|
1798
|
-
const
|
|
1799
|
-
/^\s*$/.test(
|
|
1807
|
+
const u = d.head, v = c.doc.lineAt(u);
|
|
1808
|
+
/^\s*$/.test(v.text) ? o(s.view, { kind: "emptyLine", pos: u }) : n(s.view);
|
|
1800
1809
|
}
|
|
1801
1810
|
}
|
|
1802
1811
|
});
|
|
1803
|
-
return [al,
|
|
1804
|
-
}, rl = "#e5c07b", Ee = "var(--md-color)", sl = "#56b6c2", il = "#fff",
|
|
1812
|
+
return [al, i];
|
|
1813
|
+
}, rl = "#e5c07b", Ee = "var(--md-color)", sl = "#56b6c2", il = "#fff", Q = "#3f4a54", Le = "#2d8cf0", cl = "#2d8cf0", ul = "#3f4a54", Ne = "#d19a66", dl = "#c678dd", ml = "#f6f6f6", bl = "#ceedfa33", Ae = "var(--md-bk-color)", ue = "var(--md-bk-color)", vl = "#bad5fa", De = "#3f4a54", gl = B.theme(
|
|
1805
1814
|
{
|
|
1806
1815
|
"&": {
|
|
1807
|
-
color:
|
|
1816
|
+
color: Q,
|
|
1808
1817
|
backgroundColor: Ae
|
|
1809
1818
|
},
|
|
1810
1819
|
".cm-content": {
|
|
@@ -1812,7 +1821,7 @@ const Ze = () => {
|
|
|
1812
1821
|
},
|
|
1813
1822
|
".cm-cursor, .cm-dropCursor": { borderLeftColor: De },
|
|
1814
1823
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: vl },
|
|
1815
|
-
".cm-panels": { backgroundColor: ml, color:
|
|
1824
|
+
".cm-panels": { backgroundColor: ml, color: Q },
|
|
1816
1825
|
".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
|
|
1817
1826
|
".cm-panels.cm-panels-bottom": { borderTop: "1px solid var(--md-border-color)" },
|
|
1818
1827
|
".cm-searchMatch": {
|
|
@@ -1829,7 +1838,7 @@ const Ze = () => {
|
|
|
1829
1838
|
},
|
|
1830
1839
|
".cm-gutters": {
|
|
1831
1840
|
backgroundColor: Ae,
|
|
1832
|
-
color:
|
|
1841
|
+
color: Q,
|
|
1833
1842
|
borderRight: "1px solid",
|
|
1834
1843
|
borderColor: "var(--md-border-color)"
|
|
1835
1844
|
},
|
|
@@ -1856,58 +1865,58 @@ const Ze = () => {
|
|
|
1856
1865
|
},
|
|
1857
1866
|
".cm-tooltip-autocomplete": {
|
|
1858
1867
|
"& > ul > li[aria-selected]": {
|
|
1859
|
-
color:
|
|
1868
|
+
color: Q
|
|
1860
1869
|
}
|
|
1861
1870
|
}
|
|
1862
1871
|
}
|
|
1863
1872
|
// { dark: true }
|
|
1864
|
-
),
|
|
1865
|
-
{ tag:
|
|
1866
|
-
{ tag: [
|
|
1867
|
-
{ tag: [
|
|
1868
|
-
{ tag: [
|
|
1869
|
-
{ tag: [
|
|
1873
|
+
), hl = Ye.define([
|
|
1874
|
+
{ tag: b.keyword, color: dl },
|
|
1875
|
+
{ tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color: Ee },
|
|
1876
|
+
{ tag: [b.function(b.variableName), b.labelName], color: cl },
|
|
1877
|
+
{ tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Ne },
|
|
1878
|
+
{ tag: [b.definition(b.name), b.separator], color: Q },
|
|
1870
1879
|
{
|
|
1871
1880
|
tag: [
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1881
|
+
b.typeName,
|
|
1882
|
+
b.className,
|
|
1883
|
+
b.number,
|
|
1884
|
+
b.changed,
|
|
1885
|
+
b.annotation,
|
|
1886
|
+
b.modifier,
|
|
1887
|
+
b.self,
|
|
1888
|
+
b.namespace
|
|
1880
1889
|
],
|
|
1881
1890
|
color: rl
|
|
1882
1891
|
},
|
|
1883
1892
|
{
|
|
1884
1893
|
tag: [
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1894
|
+
b.operator,
|
|
1895
|
+
b.operatorKeyword,
|
|
1896
|
+
b.url,
|
|
1897
|
+
b.escape,
|
|
1898
|
+
b.regexp,
|
|
1899
|
+
b.link,
|
|
1900
|
+
b.special(b.string)
|
|
1892
1901
|
],
|
|
1893
1902
|
color: sl
|
|
1894
1903
|
},
|
|
1895
|
-
{ tag: [
|
|
1896
|
-
{ tag:
|
|
1897
|
-
{ tag:
|
|
1898
|
-
{ tag:
|
|
1899
|
-
{ tag:
|
|
1900
|
-
{ tag:
|
|
1901
|
-
{ tag: [
|
|
1902
|
-
{ tag: [
|
|
1903
|
-
{ tag:
|
|
1904
|
+
{ tag: [b.meta, b.comment], color: Le },
|
|
1905
|
+
{ tag: b.strong, fontWeight: "bold" },
|
|
1906
|
+
{ tag: b.emphasis, fontStyle: "italic" },
|
|
1907
|
+
{ tag: b.strikethrough, textDecoration: "line-through" },
|
|
1908
|
+
{ tag: b.link, color: Le, textDecoration: "underline" },
|
|
1909
|
+
{ tag: b.heading, fontWeight: "bold", color: Ee },
|
|
1910
|
+
{ tag: [b.atom, b.bool, b.special(b.variableName)], color: Ne },
|
|
1911
|
+
{ tag: [b.processingInstruction, b.string, b.inserted], color: ul },
|
|
1912
|
+
{ tag: b.invalid, color: il }
|
|
1904
1913
|
]), Me = [
|
|
1905
1914
|
gl,
|
|
1906
|
-
je(
|
|
1907
|
-
],
|
|
1915
|
+
je(hl)
|
|
1916
|
+
], fl = "#e5c07b", Re = "var(--md-color)", pl = "#56b6c2", Tl = "#ffffff", ee = "var(--md-color)", Fe = "#e5c07b", wl = "#e5c07b", yl = "var(--md-color)", Be = "#d19a66", Cl = "#c678dd", kl = "#21252b", $l = "#2c313a", Pe = "var(--md-bk-color)", de = "var(--md-bk-color)", xl = "#ceedfa33", He = "#528bff", Sl = B.theme(
|
|
1908
1917
|
{
|
|
1909
1918
|
"&": {
|
|
1910
|
-
color:
|
|
1919
|
+
color: ee,
|
|
1911
1920
|
backgroundColor: Pe
|
|
1912
1921
|
},
|
|
1913
1922
|
".cm-content": {
|
|
@@ -1915,7 +1924,7 @@ const Ze = () => {
|
|
|
1915
1924
|
},
|
|
1916
1925
|
".cm-cursor, .cm-dropCursor": { borderLeftColor: He },
|
|
1917
1926
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: xl },
|
|
1918
|
-
".cm-panels": { backgroundColor: kl, color:
|
|
1927
|
+
".cm-panels": { backgroundColor: kl, color: ee },
|
|
1919
1928
|
".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
|
|
1920
1929
|
".cm-panels.cm-panels-bottom": { borderTop: "1px solid var(--md-border-color)" },
|
|
1921
1930
|
".cm-searchMatch": {
|
|
@@ -1932,7 +1941,7 @@ const Ze = () => {
|
|
|
1932
1941
|
},
|
|
1933
1942
|
".cm-gutters": {
|
|
1934
1943
|
backgroundColor: Pe,
|
|
1935
|
-
color:
|
|
1944
|
+
color: ee,
|
|
1936
1945
|
borderRight: "1px solid",
|
|
1937
1946
|
borderColor: "var(--md-border-color)"
|
|
1938
1947
|
},
|
|
@@ -1959,58 +1968,58 @@ const Ze = () => {
|
|
|
1959
1968
|
},
|
|
1960
1969
|
".cm-tooltip-autocomplete": {
|
|
1961
1970
|
"& > ul > li[aria-selected]": {
|
|
1962
|
-
color:
|
|
1971
|
+
color: ee
|
|
1963
1972
|
}
|
|
1964
1973
|
}
|
|
1965
1974
|
},
|
|
1966
1975
|
{ dark: !0 }
|
|
1967
1976
|
), Il = Ye.define([
|
|
1968
|
-
{ tag:
|
|
1969
|
-
{ tag: [
|
|
1970
|
-
{ tag: [
|
|
1971
|
-
{ tag: [
|
|
1972
|
-
{ tag: [
|
|
1977
|
+
{ tag: b.keyword, color: Cl },
|
|
1978
|
+
{ tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color: Re },
|
|
1979
|
+
{ tag: [b.function(b.variableName), b.labelName], color: wl },
|
|
1980
|
+
{ tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Be },
|
|
1981
|
+
{ tag: [b.definition(b.name), b.separator], color: ee },
|
|
1973
1982
|
{
|
|
1974
1983
|
tag: [
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1984
|
+
b.typeName,
|
|
1985
|
+
b.className,
|
|
1986
|
+
b.number,
|
|
1987
|
+
b.changed,
|
|
1988
|
+
b.annotation,
|
|
1989
|
+
b.modifier,
|
|
1990
|
+
b.self,
|
|
1991
|
+
b.namespace
|
|
1983
1992
|
],
|
|
1984
|
-
color:
|
|
1993
|
+
color: fl
|
|
1985
1994
|
},
|
|
1986
1995
|
{
|
|
1987
1996
|
tag: [
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1997
|
+
b.operator,
|
|
1998
|
+
b.operatorKeyword,
|
|
1999
|
+
b.url,
|
|
2000
|
+
b.escape,
|
|
2001
|
+
b.regexp,
|
|
2002
|
+
b.link,
|
|
2003
|
+
b.special(b.string)
|
|
1995
2004
|
],
|
|
1996
2005
|
color: pl
|
|
1997
2006
|
},
|
|
1998
|
-
{ tag: [
|
|
1999
|
-
{ tag:
|
|
2000
|
-
{ tag:
|
|
2001
|
-
{ tag:
|
|
2002
|
-
{ tag:
|
|
2003
|
-
{ tag:
|
|
2004
|
-
{ tag: [
|
|
2005
|
-
{ tag: [
|
|
2006
|
-
{ tag:
|
|
2007
|
+
{ tag: [b.meta, b.comment], color: Fe },
|
|
2008
|
+
{ tag: b.strong, fontWeight: "bold" },
|
|
2009
|
+
{ tag: b.emphasis, fontStyle: "italic" },
|
|
2010
|
+
{ tag: b.strikethrough, textDecoration: "line-through" },
|
|
2011
|
+
{ tag: b.link, color: Fe, textDecoration: "underline" },
|
|
2012
|
+
{ tag: b.heading, fontWeight: "bold", color: Re },
|
|
2013
|
+
{ tag: [b.atom, b.bool, b.special(b.variableName)], color: Be },
|
|
2014
|
+
{ tag: [b.processingInstruction, b.string, b.inserted], color: yl },
|
|
2015
|
+
{ tag: b.invalid, color: Tl }
|
|
2007
2016
|
]), Oe = [
|
|
2008
2017
|
Sl,
|
|
2009
2018
|
je(Il)
|
|
2010
2019
|
], El = (e, t) => {
|
|
2011
2020
|
const o = r("editorId"), n = (s) => {
|
|
2012
2021
|
s instanceof Promise ? s.then((c) => {
|
|
2013
|
-
|
|
2022
|
+
h.emit(o, w, "universal", {
|
|
2014
2023
|
generate() {
|
|
2015
2024
|
return {
|
|
2016
2025
|
targetValue: c
|
|
@@ -2019,7 +2028,7 @@ const Ze = () => {
|
|
|
2019
2028
|
});
|
|
2020
2029
|
}).catch((c) => {
|
|
2021
2030
|
console.error(c);
|
|
2022
|
-
}) :
|
|
2031
|
+
}) : h.emit(o, w, "universal", {
|
|
2023
2032
|
generate() {
|
|
2024
2033
|
return {
|
|
2025
2034
|
targetValue: s
|
|
@@ -2031,26 +2040,26 @@ const Ze = () => {
|
|
|
2031
2040
|
if (!s.clipboardData)
|
|
2032
2041
|
return;
|
|
2033
2042
|
if (s.clipboardData.files.length > 0) {
|
|
2034
|
-
const { files:
|
|
2035
|
-
|
|
2043
|
+
const { files: g } = s.clipboardData;
|
|
2044
|
+
h.emit(
|
|
2036
2045
|
o,
|
|
2037
|
-
|
|
2038
|
-
Array.from(
|
|
2046
|
+
he,
|
|
2047
|
+
Array.from(g).filter((p) => /image\/.*/.test(p.type))
|
|
2039
2048
|
), s.preventDefault();
|
|
2040
2049
|
return;
|
|
2041
2050
|
}
|
|
2042
|
-
const c = s.clipboardData.getData("text/plain"),
|
|
2043
|
-
if (
|
|
2044
|
-
const
|
|
2045
|
-
n(
|
|
2051
|
+
const c = s.clipboardData.getData("text/plain"), d = t.value?.view.state.selection.main.to || 0, u = t.value?.view.state.doc.lineAt(d).from || 0, v = t.value?.view.state.doc.sliceString(u, d) || "", m = /!\[.*\]\(\s*$/.test(v), f = /!\[.*\]\((.*)\s?.*\)/.test(c);
|
|
2052
|
+
if (m) {
|
|
2053
|
+
const g = e.transformImgUrl(c);
|
|
2054
|
+
n(g), s.preventDefault();
|
|
2046
2055
|
return;
|
|
2047
|
-
} else if (
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
|
|
2056
|
+
} else if (f) {
|
|
2057
|
+
const g = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
|
|
2058
|
+
g ? Promise.all(
|
|
2059
|
+
g.map((p) => e.transformImgUrl(p))
|
|
2051
2060
|
).then((p) => {
|
|
2052
2061
|
n(
|
|
2053
|
-
p.reduce((
|
|
2062
|
+
p.reduce((k, S, A) => k.replace(g[A], S), c)
|
|
2054
2063
|
);
|
|
2055
2064
|
}).catch((p) => {
|
|
2056
2065
|
console.error(p);
|
|
@@ -2058,14 +2067,14 @@ const Ze = () => {
|
|
|
2058
2067
|
return;
|
|
2059
2068
|
}
|
|
2060
2069
|
if (e.autoDetectCode && s.clipboardData.types.includes("vscode-editor-data")) {
|
|
2061
|
-
const
|
|
2062
|
-
|
|
2063
|
-
mode:
|
|
2070
|
+
const g = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
|
|
2071
|
+
h.emit(o, w, "code", {
|
|
2072
|
+
mode: g.mode,
|
|
2064
2073
|
text: s.clipboardData.getData("text/plain")
|
|
2065
2074
|
}), s.preventDefault();
|
|
2066
2075
|
return;
|
|
2067
2076
|
}
|
|
2068
|
-
e.maxlength && c.length + e.modelValue.length > e.maxlength &&
|
|
2077
|
+
e.maxlength && c.length + e.modelValue.length > e.maxlength && h.emit(o, X, {
|
|
2069
2078
|
name: "overlength",
|
|
2070
2079
|
message: "The input text is too long",
|
|
2071
2080
|
data: c
|
|
@@ -2075,7 +2084,7 @@ const Ze = () => {
|
|
|
2075
2084
|
{
|
|
2076
2085
|
key: "Ctrl-b",
|
|
2077
2086
|
mac: "Cmd-b",
|
|
2078
|
-
run: () => (
|
|
2087
|
+
run: () => (h.emit(e, w, "bold"), !0)
|
|
2079
2088
|
},
|
|
2080
2089
|
{
|
|
2081
2090
|
key: "Ctrl-d",
|
|
@@ -2086,137 +2095,137 @@ const Ze = () => {
|
|
|
2086
2095
|
{
|
|
2087
2096
|
key: "Ctrl-s",
|
|
2088
2097
|
mac: "Cmd-s",
|
|
2089
|
-
run: (
|
|
2090
|
-
shift: () => (
|
|
2098
|
+
run: (L) => (h.emit(e, Ge, L.state.doc.toString()), !0),
|
|
2099
|
+
shift: () => (h.emit(e, w, "strikeThrough"), !0)
|
|
2091
2100
|
},
|
|
2092
2101
|
{
|
|
2093
2102
|
key: "Ctrl-u",
|
|
2094
2103
|
mac: "Cmd-u",
|
|
2095
2104
|
preventDefault: !0,
|
|
2096
|
-
run: () => (
|
|
2097
|
-
shift: () => (
|
|
2105
|
+
run: () => (h.emit(e, w, "underline"), !0),
|
|
2106
|
+
shift: () => (h.emit(e, w, "unorderedList"), !0)
|
|
2098
2107
|
},
|
|
2099
2108
|
{
|
|
2100
2109
|
key: "Ctrl-i",
|
|
2101
2110
|
mac: "Cmd-i",
|
|
2102
2111
|
preventDefault: !0,
|
|
2103
|
-
run: () => (
|
|
2104
|
-
shift: () => (
|
|
2112
|
+
run: () => (h.emit(e, w, "italic"), !0),
|
|
2113
|
+
shift: () => (h.emit(e, w, "image"), !0)
|
|
2105
2114
|
},
|
|
2106
2115
|
{
|
|
2107
2116
|
key: "Ctrl-1",
|
|
2108
2117
|
mac: "Cmd-1",
|
|
2109
|
-
run: () => (
|
|
2118
|
+
run: () => (h.emit(e, w, "h1"), !0)
|
|
2110
2119
|
},
|
|
2111
2120
|
{
|
|
2112
2121
|
key: "Ctrl-2",
|
|
2113
2122
|
mac: "Cmd-2",
|
|
2114
|
-
run: () => (
|
|
2123
|
+
run: () => (h.emit(e, w, "h2"), !0)
|
|
2115
2124
|
},
|
|
2116
2125
|
{
|
|
2117
2126
|
key: "Ctrl-3",
|
|
2118
2127
|
mac: "Cmd-3",
|
|
2119
|
-
run: () => (
|
|
2128
|
+
run: () => (h.emit(e, w, "h3"), !0)
|
|
2120
2129
|
},
|
|
2121
2130
|
{
|
|
2122
2131
|
key: "Ctrl-4",
|
|
2123
2132
|
mac: "Cmd-4",
|
|
2124
|
-
run: () => (
|
|
2133
|
+
run: () => (h.emit(e, w, "h4"), !0)
|
|
2125
2134
|
},
|
|
2126
2135
|
{
|
|
2127
2136
|
key: "Ctrl-5",
|
|
2128
2137
|
mac: "Cmd-5",
|
|
2129
|
-
run: () => (
|
|
2138
|
+
run: () => (h.emit(e, w, "h5"), !0)
|
|
2130
2139
|
},
|
|
2131
2140
|
{
|
|
2132
2141
|
key: "Ctrl-6",
|
|
2133
2142
|
mac: "Cmd-6",
|
|
2134
|
-
run: () => (
|
|
2143
|
+
run: () => (h.emit(e, w, "h6"), !0)
|
|
2135
2144
|
},
|
|
2136
2145
|
{
|
|
2137
2146
|
key: "Ctrl-ArrowUp",
|
|
2138
2147
|
mac: "Cmd-ArrowUp",
|
|
2139
|
-
run: () => (
|
|
2148
|
+
run: () => (h.emit(e, w, "sup"), !0)
|
|
2140
2149
|
},
|
|
2141
2150
|
{
|
|
2142
2151
|
key: "Ctrl-ArrowDown",
|
|
2143
2152
|
mac: "Cmd-ArrowDown",
|
|
2144
|
-
run: () => (
|
|
2153
|
+
run: () => (h.emit(e, w, "sub"), !0)
|
|
2145
2154
|
},
|
|
2146
2155
|
{
|
|
2147
2156
|
key: "Ctrl-o",
|
|
2148
2157
|
mac: "Cmd-o",
|
|
2149
|
-
run: () => (
|
|
2158
|
+
run: () => (h.emit(e, w, "orderedList"), !0)
|
|
2150
2159
|
},
|
|
2151
2160
|
{
|
|
2152
2161
|
key: "Ctrl-c",
|
|
2153
2162
|
mac: "Cmd-c",
|
|
2154
|
-
shift: () => (
|
|
2155
|
-
any(
|
|
2156
|
-
return (
|
|
2163
|
+
shift: () => (h.emit(e, w, "code"), !0),
|
|
2164
|
+
any(L, C) {
|
|
2165
|
+
return (C.ctrlKey || C.metaKey) && C.altKey && C.code === "KeyC" ? (h.emit(e, w, "codeRow"), !0) : !1;
|
|
2157
2166
|
}
|
|
2158
2167
|
},
|
|
2159
2168
|
{
|
|
2160
2169
|
key: "Ctrl-l",
|
|
2161
2170
|
mac: "Cmd-l",
|
|
2162
|
-
run: () => (
|
|
2171
|
+
run: () => (h.emit(e, w, "link"), !0)
|
|
2163
2172
|
},
|
|
2164
2173
|
{
|
|
2165
2174
|
key: "Ctrl-f",
|
|
2166
2175
|
mac: "Cmd-f",
|
|
2167
|
-
shift: () => t.noPrettier ? !1 : (
|
|
2176
|
+
shift: () => t.noPrettier ? !1 : (h.emit(e, w, "prettier"), !0)
|
|
2168
2177
|
},
|
|
2169
2178
|
{
|
|
2170
|
-
any: (
|
|
2179
|
+
any: (L, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (h.emit(e, w, "table"), !0) : !1
|
|
2171
2180
|
},
|
|
2172
2181
|
...to
|
|
2173
2182
|
], Nl = /[a-z][a-z0-9.+-]*:\/\/[^\s<>"'`()]+(?:\([^\s<>"'`]*\)[^\s<>"'`]*)*/i, Al = /\/\/[^\s<>"'`()]+/i, Dl = /data:[a-z]+\/[a-z0-9.+-]+(?:;base64)?,[a-z0-9+/=%]+/i, Ml = /\/(?!\/)[^\s<>"'`()]+/i, Ve = new RegExp(
|
|
2174
2183
|
`(?<![a-z0-9.+-])(${Nl.source}|${Al.source}|${Dl.source}|${Ml.source})`,
|
|
2175
2184
|
"gi"
|
|
2176
2185
|
), Rl = (e, t, o) => e.some((n) => n.from === t && n.to === o), Fl = (e) => {
|
|
2177
|
-
const t = e.shortenText || (() => "..."), o =
|
|
2178
|
-
const
|
|
2179
|
-
for (let
|
|
2180
|
-
const p =
|
|
2186
|
+
const t = e.shortenText || (() => "..."), o = re.define(), n = re.define(), i = (u, v) => {
|
|
2187
|
+
const m = new Ht(), f = [];
|
|
2188
|
+
for (let g = 1; g <= u.doc.lines; g++) {
|
|
2189
|
+
const p = u.doc.line(g), k = p.text;
|
|
2181
2190
|
Ve.lastIndex = 0;
|
|
2182
|
-
let
|
|
2183
|
-
for (;
|
|
2184
|
-
if (!
|
|
2185
|
-
const A =
|
|
2191
|
+
let S;
|
|
2192
|
+
for (; S = Ve.exec(k); ) {
|
|
2193
|
+
if (!S[0]) continue;
|
|
2194
|
+
const A = S[0];
|
|
2186
2195
|
if (A.length <= e.maxLength) continue;
|
|
2187
|
-
const
|
|
2188
|
-
if (Rl(v,
|
|
2189
|
-
|
|
2196
|
+
const D = p.from + S.index, I = D + A.length;
|
|
2197
|
+
if (Rl(v, D, I)) {
|
|
2198
|
+
f.push({ from: D, to: I });
|
|
2190
2199
|
continue;
|
|
2191
2200
|
}
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
Wt.replace({ widget: new s(
|
|
2201
|
+
const M = t(A);
|
|
2202
|
+
m.add(
|
|
2203
|
+
D,
|
|
2204
|
+
I,
|
|
2205
|
+
Wt.replace({ widget: new s(M, A, D, I) })
|
|
2197
2206
|
);
|
|
2198
2207
|
}
|
|
2199
2208
|
}
|
|
2200
|
-
return { deco:
|
|
2209
|
+
return { deco: m.finish(), expanded: f };
|
|
2201
2210
|
};
|
|
2202
2211
|
class s extends _t {
|
|
2203
|
-
constructor(v,
|
|
2204
|
-
super(), this.short = v, this.raw =
|
|
2212
|
+
constructor(v, m, f, g) {
|
|
2213
|
+
super(), this.short = v, this.raw = m, this.from = f, this.to = g;
|
|
2205
2214
|
}
|
|
2206
2215
|
toDOM(v) {
|
|
2207
|
-
const
|
|
2208
|
-
return
|
|
2209
|
-
|
|
2210
|
-
selection:
|
|
2216
|
+
const m = document.createElement("span");
|
|
2217
|
+
return m.textContent = this.short, m.className = "cm-short-text", m.title = this.raw, m.style.display = "inline", m.style.textDecoration = "underline", m.addEventListener("mousedown", (f) => {
|
|
2218
|
+
f.preventDefault(), f.stopPropagation(), v.dispatch({
|
|
2219
|
+
selection: U.cursor(this.from),
|
|
2211
2220
|
effects: o.of({
|
|
2212
2221
|
from: this.from,
|
|
2213
2222
|
to: this.to,
|
|
2214
2223
|
expand: !0
|
|
2215
2224
|
})
|
|
2216
2225
|
}), v.focus();
|
|
2217
|
-
}),
|
|
2218
|
-
|
|
2219
|
-
}),
|
|
2226
|
+
}), m.addEventListener("click", (f) => {
|
|
2227
|
+
f.preventDefault();
|
|
2228
|
+
}), m;
|
|
2220
2229
|
}
|
|
2221
2230
|
ignoreEvent() {
|
|
2222
2231
|
return !1;
|
|
@@ -2226,115 +2235,115 @@ const Ze = () => {
|
|
|
2226
2235
|
}
|
|
2227
2236
|
}
|
|
2228
2237
|
const c = qe.define({
|
|
2229
|
-
create(
|
|
2230
|
-
return i(
|
|
2238
|
+
create(u) {
|
|
2239
|
+
return i(u, []);
|
|
2231
2240
|
},
|
|
2232
|
-
update(
|
|
2233
|
-
let
|
|
2234
|
-
v.docChanged &&
|
|
2235
|
-
from: v.changes.mapPos(
|
|
2241
|
+
update(u, v) {
|
|
2242
|
+
let m = u.expanded;
|
|
2243
|
+
v.docChanged && m.length && (m = m.map(({ from: g, to: p }) => ({
|
|
2244
|
+
from: v.changes.mapPos(g, 1),
|
|
2236
2245
|
to: v.changes.mapPos(p, -1)
|
|
2237
|
-
})).filter(({ from:
|
|
2238
|
-
let
|
|
2239
|
-
for (const
|
|
2240
|
-
|
|
2241
|
-
({ from: p, to:
|
|
2242
|
-
) :
|
|
2243
|
-
return !
|
|
2246
|
+
})).filter(({ from: g, to: p }) => g < p));
|
|
2247
|
+
let f = m !== u.expanded;
|
|
2248
|
+
for (const g of v.effects)
|
|
2249
|
+
g.is(o) ? g.value.expand ? m = [{ from: g.value.from, to: g.value.to }] : m = m.filter(
|
|
2250
|
+
({ from: p, to: k }) => p !== g.value.from || k !== g.value.to
|
|
2251
|
+
) : g.is(n) && m.length > 0 && (m = []);
|
|
2252
|
+
return !f && m !== u.expanded && (f = !0), v.docChanged || f ? i(v.state, m) : u;
|
|
2244
2253
|
},
|
|
2245
|
-
provide: (
|
|
2246
|
-
}),
|
|
2247
|
-
mousedown(
|
|
2248
|
-
const
|
|
2249
|
-
if (!
|
|
2254
|
+
provide: (u) => B.decorations.compute([u], (v) => v.field(u).deco)
|
|
2255
|
+
}), d = B.domEventHandlers({
|
|
2256
|
+
mousedown(u, v) {
|
|
2257
|
+
const m = v.state.field(c, !1);
|
|
2258
|
+
if (!m || m.expanded.length === 0)
|
|
2250
2259
|
return !1;
|
|
2251
|
-
const
|
|
2252
|
-
if (
|
|
2253
|
-
const
|
|
2254
|
-
if (
|
|
2255
|
-
({ from:
|
|
2260
|
+
const f = u.target;
|
|
2261
|
+
if (f && v.dom.contains(f)) {
|
|
2262
|
+
const g = v.posAtDOM(f, 0);
|
|
2263
|
+
if (g != null && g !== -1 && m.expanded.some(
|
|
2264
|
+
({ from: k, to: S }) => g >= k && g <= S
|
|
2256
2265
|
))
|
|
2257
2266
|
return !1;
|
|
2258
2267
|
}
|
|
2259
2268
|
return v.dispatch({ effects: n.of(void 0) }), !1;
|
|
2260
2269
|
}
|
|
2261
2270
|
});
|
|
2262
|
-
return [c,
|
|
2271
|
+
return [c, d];
|
|
2263
2272
|
};
|
|
2264
|
-
|
|
2273
|
+
B.EDIT_CONTEXT = !1;
|
|
2265
2274
|
const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension, Bl = (e) => {
|
|
2266
2275
|
const t = Xe(e);
|
|
2267
2276
|
return e.compartment ? e.compartment.of(t) : t;
|
|
2268
2277
|
}, Pl = (e) => {
|
|
2269
2278
|
const t = r("tabWidth"), o = r("editorId"), n = r("theme"), i = r("previewTheme"), s = r("language"), c = r(
|
|
2270
2279
|
"usedLanguageText"
|
|
2271
|
-
),
|
|
2272
|
-
noPrettier:
|
|
2280
|
+
), d = r("disabled"), u = r("showToolbarName"), v = r("customIcon"), m = r("noUploadImg"), f = r("tableShape"), g = r("noPrettier"), p = r("codeTheme"), k = r("setting"), S = r("updateSetting"), A = r("catalogVisible"), D = r("defToolbars"), I = r("floatingToolbars"), M = r("rootRef"), L = E(), C = kt(), R = E(!1), z = new j(), q = new j(), $ = new j(), pe = new j(), Je = new j(), Qe = Ll(o, {
|
|
2281
|
+
noPrettier: g
|
|
2273
2282
|
}), Te = () => [
|
|
2274
2283
|
...Qe,
|
|
2275
2284
|
...At,
|
|
2276
2285
|
...Dt,
|
|
2277
2286
|
Mt
|
|
2278
|
-
],
|
|
2279
|
-
paste: El(e,
|
|
2287
|
+
], oe = {
|
|
2288
|
+
paste: El(e, C),
|
|
2280
2289
|
blur: e.onBlur,
|
|
2281
2290
|
focus: e.onFocus,
|
|
2282
2291
|
drop: e.onDrop,
|
|
2283
2292
|
compositionstart: () => {
|
|
2284
|
-
|
|
2293
|
+
R.value = !0;
|
|
2285
2294
|
},
|
|
2286
|
-
compositionend: (
|
|
2287
|
-
|
|
2295
|
+
compositionend: (T, F) => {
|
|
2296
|
+
R.value = !1, e.updateModelValue(F.state.doc.toString());
|
|
2288
2297
|
},
|
|
2289
|
-
input: (
|
|
2290
|
-
e.onInput && e.onInput(
|
|
2291
|
-
const { data:
|
|
2292
|
-
e.maxlength && e.modelValue.length +
|
|
2298
|
+
input: (T) => {
|
|
2299
|
+
e.onInput && e.onInput(T);
|
|
2300
|
+
const { data: F } = T;
|
|
2301
|
+
e.maxlength && e.modelValue.length + F.length > e.maxlength && h.emit(o, X, {
|
|
2293
2302
|
name: "overlength",
|
|
2294
2303
|
message: "The input text is too long",
|
|
2295
|
-
data:
|
|
2304
|
+
data: F
|
|
2296
2305
|
});
|
|
2297
2306
|
}
|
|
2298
2307
|
}, et = nl({
|
|
2299
|
-
privide(
|
|
2300
|
-
|
|
2308
|
+
privide(T) {
|
|
2309
|
+
T.provide("editorId", o), T.provide("theme", n), T.provide("previewTheme", i), T.provide("language", s), T.provide("disabled", d), T.provide("noUploadImg", m), T.provide("tableShape", f), T.provide("noPrettier", g), T.provide("codeTheme", p), T.provide("showToolbarName", u), T.provide("setting", k), T.provide("updateSetting", S), T.provide("usedLanguageText", c), T.provide("catalogVisible", A), T.provide("defToolbars", D), T.provide("tabWidth", t), T.provide("customIcon", v), T.provide("floatingToolbars", I), T.provide("rootRef", M);
|
|
2301
2310
|
}
|
|
2302
2311
|
}), tt = [
|
|
2303
2312
|
{
|
|
2304
2313
|
type: "theme",
|
|
2305
|
-
extension: ({ theme:
|
|
2306
|
-
compartment:
|
|
2314
|
+
extension: ({ theme: T }) => T.value === "light" ? Me : Oe,
|
|
2315
|
+
compartment: z,
|
|
2307
2316
|
options: {
|
|
2308
2317
|
theme: n
|
|
2309
2318
|
}
|
|
2310
2319
|
},
|
|
2311
2320
|
{
|
|
2312
2321
|
type: "updateListener",
|
|
2313
|
-
extension:
|
|
2314
|
-
|
|
2322
|
+
extension: B.updateListener.of((T) => {
|
|
2323
|
+
T.docChanged && (e.onChange(T.state.doc.toString()), R.value || e.updateModelValue(T.state.doc.toString()));
|
|
2315
2324
|
})
|
|
2316
2325
|
},
|
|
2317
2326
|
{
|
|
2318
2327
|
type: "domEventHandlers",
|
|
2319
|
-
extension:
|
|
2328
|
+
extension: B.domEventHandlers(oe),
|
|
2320
2329
|
compartment: pe
|
|
2321
2330
|
},
|
|
2322
2331
|
{
|
|
2323
2332
|
type: "completions",
|
|
2324
2333
|
extension: Ie(e.completions),
|
|
2325
|
-
compartment:
|
|
2334
|
+
compartment: q
|
|
2326
2335
|
},
|
|
2327
2336
|
{
|
|
2328
2337
|
type: "history",
|
|
2329
2338
|
extension: ke(),
|
|
2330
|
-
compartment:
|
|
2339
|
+
compartment: $
|
|
2331
2340
|
}
|
|
2332
|
-
], we =
|
|
2341
|
+
], we = Z.codeMirrorExtensions(
|
|
2333
2342
|
[
|
|
2334
2343
|
// 横向换行
|
|
2335
2344
|
{
|
|
2336
2345
|
type: "lineWrapping",
|
|
2337
|
-
extension:
|
|
2346
|
+
extension: B.lineWrapping
|
|
2338
2347
|
},
|
|
2339
2348
|
{
|
|
2340
2349
|
type: "keymap",
|
|
@@ -2351,14 +2360,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2351
2360
|
},
|
|
2352
2361
|
{
|
|
2353
2362
|
type: "linkShortener",
|
|
2354
|
-
extension: (
|
|
2363
|
+
extension: (T) => Fl(T),
|
|
2355
2364
|
options: {
|
|
2356
2365
|
maxLength: 30
|
|
2357
2366
|
}
|
|
2358
2367
|
},
|
|
2359
2368
|
{
|
|
2360
2369
|
type: "floatingToolbar",
|
|
2361
|
-
extension:
|
|
2370
|
+
extension: I.value.length > 0 ? et : [],
|
|
2362
2371
|
compartment: Je
|
|
2363
2372
|
}
|
|
2364
2373
|
],
|
|
@@ -2368,201 +2377,201 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2368
2377
|
keyBindings: Te()
|
|
2369
2378
|
}
|
|
2370
2379
|
), ot = () => [...tt, ...we].map(Bl);
|
|
2371
|
-
return
|
|
2372
|
-
const
|
|
2380
|
+
return K(() => {
|
|
2381
|
+
const T = new B({
|
|
2373
2382
|
doc: e.modelValue,
|
|
2374
|
-
parent:
|
|
2383
|
+
parent: L.value,
|
|
2375
2384
|
extensions: ot()
|
|
2376
|
-
}),
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
}, 0),
|
|
2385
|
+
}), F = new go(T);
|
|
2386
|
+
C.value = F, setTimeout(() => {
|
|
2387
|
+
F.setTabSize(t), F.setDisabled(d.value), F.setReadOnly(e.readonly), e.placeholder && F.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && F.setMaxLength(e.maxlength), e.autofocus && T.focus();
|
|
2388
|
+
}, 0), h.on(o, {
|
|
2380
2389
|
name: Ke,
|
|
2381
2390
|
callback() {
|
|
2382
|
-
Rt(
|
|
2391
|
+
Rt(T);
|
|
2383
2392
|
}
|
|
2384
|
-
}),
|
|
2393
|
+
}), h.on(o, {
|
|
2385
2394
|
name: Ue,
|
|
2386
2395
|
callback() {
|
|
2387
|
-
Ft(
|
|
2396
|
+
Ft(T);
|
|
2388
2397
|
}
|
|
2389
|
-
}),
|
|
2390
|
-
name:
|
|
2391
|
-
async callback(
|
|
2392
|
-
if (
|
|
2393
|
-
const
|
|
2394
|
-
if (
|
|
2395
|
-
|
|
2396
|
-
const { text:
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
{ ...
|
|
2398
|
+
}), h.on(o, {
|
|
2399
|
+
name: w,
|
|
2400
|
+
async callback(O, H = {}) {
|
|
2401
|
+
if (O === "image" && H.transform) {
|
|
2402
|
+
const V = e.transformImgUrl(H.url);
|
|
2403
|
+
if (V instanceof Promise)
|
|
2404
|
+
V.then(async (_) => {
|
|
2405
|
+
const { text: W, options: J } = await ce(
|
|
2406
|
+
O,
|
|
2407
|
+
C.value,
|
|
2408
|
+
{ ...H, url: _ }
|
|
2400
2409
|
);
|
|
2401
|
-
|
|
2402
|
-
}).catch((
|
|
2403
|
-
console.error(
|
|
2410
|
+
C.value?.replaceSelectedText(W, J, o);
|
|
2411
|
+
}).catch((_) => {
|
|
2412
|
+
console.error(_);
|
|
2404
2413
|
});
|
|
2405
2414
|
else {
|
|
2406
|
-
const { text:
|
|
2407
|
-
...
|
|
2408
|
-
url:
|
|
2415
|
+
const { text: _, options: W } = await ce(O, C.value, {
|
|
2416
|
+
...H,
|
|
2417
|
+
url: V
|
|
2409
2418
|
});
|
|
2410
|
-
|
|
2419
|
+
C.value?.replaceSelectedText(_, W, o);
|
|
2411
2420
|
}
|
|
2412
2421
|
} else {
|
|
2413
|
-
const { text:
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2422
|
+
const { text: V, options: _ } = await ce(
|
|
2423
|
+
O,
|
|
2424
|
+
C.value,
|
|
2425
|
+
H
|
|
2417
2426
|
);
|
|
2418
|
-
|
|
2427
|
+
C.value?.replaceSelectedText(V, _, o);
|
|
2419
2428
|
}
|
|
2420
2429
|
}
|
|
2421
|
-
}),
|
|
2430
|
+
}), h.on(o, {
|
|
2422
2431
|
name: Gt,
|
|
2423
|
-
callback: Et((
|
|
2424
|
-
const
|
|
2425
|
-
for (const
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
} :
|
|
2432
|
+
callback: Et((O) => {
|
|
2433
|
+
const H = { ...oe }, V = Object.keys(oe);
|
|
2434
|
+
for (const _ in O) {
|
|
2435
|
+
const W = _;
|
|
2436
|
+
V.includes(W) ? H[W] = (J, ye) => {
|
|
2437
|
+
O[W](J, ye), J.defaultPrevented || oe[W](J, ye);
|
|
2438
|
+
} : H[W] = O[W];
|
|
2430
2439
|
}
|
|
2431
|
-
|
|
2440
|
+
C.value?.view.dispatch({
|
|
2432
2441
|
effects: pe.reconfigure(
|
|
2433
|
-
|
|
2442
|
+
B.domEventHandlers(H)
|
|
2434
2443
|
)
|
|
2435
2444
|
});
|
|
2436
2445
|
})
|
|
2437
|
-
}),
|
|
2446
|
+
}), h.on(o, {
|
|
2438
2447
|
name: jt,
|
|
2439
|
-
callback: (
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2442
|
-
|
|
2448
|
+
callback: (O, H) => {
|
|
2449
|
+
const V = T.state.doc.line(O);
|
|
2450
|
+
T.dispatch(
|
|
2451
|
+
T.state.update({ changes: { from: V.from, to: V.to, insert: H } })
|
|
2443
2452
|
);
|
|
2444
2453
|
}
|
|
2445
|
-
}),
|
|
2454
|
+
}), h.on(o, {
|
|
2446
2455
|
name: Yt,
|
|
2447
2456
|
callback() {
|
|
2448
|
-
|
|
2457
|
+
h.emit(o, $e, T);
|
|
2449
2458
|
}
|
|
2450
|
-
}),
|
|
2451
|
-
}),
|
|
2459
|
+
}), h.emit(o, $e, T);
|
|
2460
|
+
}), N(
|
|
2452
2461
|
n,
|
|
2453
2462
|
() => {
|
|
2454
|
-
|
|
2455
|
-
effects:
|
|
2463
|
+
C.value?.view.dispatch({
|
|
2464
|
+
effects: z.reconfigure(n.value === "light" ? Me : Oe)
|
|
2456
2465
|
});
|
|
2457
2466
|
},
|
|
2458
2467
|
{ deep: !0 }
|
|
2459
|
-
),
|
|
2468
|
+
), N(
|
|
2460
2469
|
() => e.completions,
|
|
2461
2470
|
() => {
|
|
2462
|
-
|
|
2463
|
-
effects:
|
|
2471
|
+
C.value?.view.dispatch({
|
|
2472
|
+
effects: q.reconfigure(Ie(e.completions))
|
|
2464
2473
|
});
|
|
2465
2474
|
},
|
|
2466
2475
|
{ deep: !0 }
|
|
2467
|
-
),
|
|
2476
|
+
), N(
|
|
2468
2477
|
() => e.modelValue,
|
|
2469
2478
|
() => {
|
|
2470
|
-
|
|
2479
|
+
C.value?.getValue() !== e.modelValue && C.value?.setValue(e.modelValue);
|
|
2471
2480
|
}
|
|
2472
|
-
),
|
|
2481
|
+
), N(
|
|
2473
2482
|
() => e.placeholder,
|
|
2474
2483
|
() => {
|
|
2475
|
-
|
|
2484
|
+
C.value?.setPlaceholder(e.placeholder);
|
|
2476
2485
|
}
|
|
2477
|
-
),
|
|
2478
|
-
|
|
2479
|
-
}),
|
|
2486
|
+
), N([d], () => {
|
|
2487
|
+
C.value?.setDisabled(d.value);
|
|
2488
|
+
}), N(
|
|
2480
2489
|
() => e.readonly,
|
|
2481
2490
|
() => {
|
|
2482
|
-
|
|
2491
|
+
C.value?.setDisabled(e.readonly);
|
|
2483
2492
|
}
|
|
2484
|
-
),
|
|
2493
|
+
), N(
|
|
2485
2494
|
() => e.maxlength,
|
|
2486
2495
|
() => {
|
|
2487
|
-
e.maxlength &&
|
|
2496
|
+
e.maxlength && C.value?.setMaxLength(e.maxlength);
|
|
2488
2497
|
}
|
|
2489
|
-
),
|
|
2490
|
-
const
|
|
2491
|
-
(
|
|
2498
|
+
), fo(() => {
|
|
2499
|
+
const T = we.find(
|
|
2500
|
+
(F) => F.type === "floatingToolbar"
|
|
2492
2501
|
);
|
|
2493
|
-
|
|
2494
|
-
effects:
|
|
2495
|
-
Xe(
|
|
2502
|
+
T?.compartment && (I.value.length > 0 ? C.value?.view.dispatch({
|
|
2503
|
+
effects: T.compartment.reconfigure(
|
|
2504
|
+
Xe(T)
|
|
2496
2505
|
)
|
|
2497
|
-
}) :
|
|
2498
|
-
effects:
|
|
2506
|
+
}) : C.value?.view.dispatch({
|
|
2507
|
+
effects: T.compartment.reconfigure([])
|
|
2499
2508
|
}));
|
|
2500
|
-
},
|
|
2501
|
-
inputWrapperRef:
|
|
2502
|
-
codeMirrorUt:
|
|
2509
|
+
}, I), {
|
|
2510
|
+
inputWrapperRef: L,
|
|
2511
|
+
codeMirrorUt: C,
|
|
2503
2512
|
resetHistory() {
|
|
2504
|
-
|
|
2513
|
+
C.value?.view.dispatch({ effects: $.reconfigure([]) }), C.value?.view.dispatch({ effects: $.reconfigure(ke()) });
|
|
2505
2514
|
}
|
|
2506
2515
|
};
|
|
2507
2516
|
}, Hl = (e, t, o) => {
|
|
2508
|
-
const n = r("setting"), i =
|
|
2517
|
+
const n = r("setting"), i = P(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = Y({
|
|
2509
2518
|
resizedWidth: i.value
|
|
2510
|
-
}), c =
|
|
2519
|
+
}), c = Y({
|
|
2511
2520
|
width: i.value
|
|
2512
|
-
}),
|
|
2521
|
+
}), d = Y({
|
|
2513
2522
|
left: i.value,
|
|
2514
2523
|
display: "initial"
|
|
2515
|
-
}),
|
|
2516
|
-
const
|
|
2517
|
-
let
|
|
2518
|
-
|
|
2519
|
-
const
|
|
2520
|
-
c.width =
|
|
2521
|
-
}, v = (
|
|
2522
|
-
|
|
2523
|
-
},
|
|
2524
|
-
document.removeEventListener("mousemove",
|
|
2524
|
+
}), u = (f) => {
|
|
2525
|
+
const g = t.value?.offsetWidth || 0, p = t.value?.getBoundingClientRect().x || 0;
|
|
2526
|
+
let k = f.x - p;
|
|
2527
|
+
k / g < le ? k = g * le : k > g - g * le && (k = g - g * le);
|
|
2528
|
+
const S = `${k / g * 100}%`;
|
|
2529
|
+
c.width = S, d.left = S, s.resizedWidth = S, e.oninputBoxWidthChange?.(S);
|
|
2530
|
+
}, v = (f) => {
|
|
2531
|
+
f.target === o.value && document.addEventListener("mousemove", u);
|
|
2532
|
+
}, m = () => {
|
|
2533
|
+
document.removeEventListener("mousemove", u);
|
|
2525
2534
|
};
|
|
2526
|
-
return
|
|
2527
|
-
document.removeEventListener("mousedown", v), document.removeEventListener("mouseup",
|
|
2528
|
-
}),
|
|
2529
|
-
document.addEventListener("mousedown", v), document.addEventListener("mouseup",
|
|
2535
|
+
return N([o], () => {
|
|
2536
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m), document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
|
|
2537
|
+
}), K(() => {
|
|
2538
|
+
document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
|
|
2530
2539
|
}), ge(() => {
|
|
2531
|
-
document.removeEventListener("mousedown", v), document.removeEventListener("mouseup",
|
|
2532
|
-
}),
|
|
2533
|
-
s.resizedWidth =
|
|
2534
|
-
}),
|
|
2540
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m);
|
|
2541
|
+
}), N([i], ([f]) => {
|
|
2542
|
+
s.resizedWidth = f, c.width = f, d.left = f;
|
|
2543
|
+
}), N(
|
|
2535
2544
|
[
|
|
2536
2545
|
() => n.value.htmlPreview,
|
|
2537
2546
|
() => n.value.preview,
|
|
2538
2547
|
() => n.value.previewOnly
|
|
2539
2548
|
],
|
|
2540
2549
|
() => {
|
|
2541
|
-
n.value.previewOnly ? (c.width = "0%",
|
|
2550
|
+
n.value.previewOnly ? (c.width = "0%", d.display = "none") : !n.value.htmlPreview && !n.value.preview ? (c.width = "100%", d.display = "none") : (c.width = s.resizedWidth, d.display = "initial");
|
|
2542
2551
|
},
|
|
2543
2552
|
{
|
|
2544
2553
|
immediate: !0
|
|
2545
2554
|
}
|
|
2546
2555
|
), {
|
|
2547
2556
|
inputWrapperStyle: c,
|
|
2548
|
-
resizeOperateStyle:
|
|
2557
|
+
resizeOperateStyle: d
|
|
2549
2558
|
};
|
|
2550
2559
|
}, Ol = () => {
|
|
2551
|
-
const e = r("editorId"), t =
|
|
2560
|
+
const e = r("editorId"), t = E(!0), o = ze();
|
|
2552
2561
|
return {
|
|
2553
|
-
onCatalogActive: (c,
|
|
2554
|
-
const
|
|
2562
|
+
onCatalogActive: (c, d) => {
|
|
2563
|
+
const u = document.querySelector(
|
|
2555
2564
|
`#${e} .${a}-catalog-editor`
|
|
2556
2565
|
);
|
|
2557
|
-
if (!
|
|
2566
|
+
if (!d || !t.value || !u)
|
|
2558
2567
|
return;
|
|
2559
|
-
const v =
|
|
2560
|
-
(v > 100 || v < 100) && o(
|
|
2568
|
+
const v = d.offsetTop - u.scrollTop;
|
|
2569
|
+
(v > 100 || v < 100) && o(u, d.offsetTop - 100);
|
|
2561
2570
|
},
|
|
2562
2571
|
onMouseenter: () => t.value = !1,
|
|
2563
2572
|
onMouseleave: () => t.value = !0
|
|
2564
2573
|
};
|
|
2565
|
-
}, me = /* @__PURE__ */
|
|
2574
|
+
}, me = /* @__PURE__ */ y({
|
|
2566
2575
|
name: `${xt}CustomScrollbar`,
|
|
2567
2576
|
props: {
|
|
2568
2577
|
id: {
|
|
@@ -2601,44 +2610,44 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2601
2610
|
setup(e, {
|
|
2602
2611
|
slots: t
|
|
2603
2612
|
}) {
|
|
2604
|
-
const o =
|
|
2605
|
-
let c = null,
|
|
2606
|
-
const
|
|
2613
|
+
const o = E(null), n = E(null), i = E(null), s = E(null);
|
|
2614
|
+
let c = null, d = null, u = !1, v = 0, m = 0;
|
|
2615
|
+
const f = () => {
|
|
2607
2616
|
if (!n.value || !o.value || !i.value || !s.value) return;
|
|
2608
|
-
const
|
|
2609
|
-
if (
|
|
2617
|
+
const I = o.value.clientHeight, M = n.value.scrollHeight, L = n.value.scrollTop;
|
|
2618
|
+
if (M <= I) {
|
|
2610
2619
|
i.value.style.display = "none", e.alwaysShowTrack || (s.value.style.display = "none");
|
|
2611
2620
|
return;
|
|
2612
2621
|
} else
|
|
2613
2622
|
i.value.style.display = "block", s.value.style.display = "block";
|
|
2614
|
-
const
|
|
2615
|
-
i.value.style.height = `${
|
|
2616
|
-
},
|
|
2617
|
-
|
|
2618
|
-
},
|
|
2619
|
-
if (!
|
|
2620
|
-
const
|
|
2621
|
-
n.value.scrollTop =
|
|
2622
|
-
},
|
|
2623
|
-
|
|
2624
|
-
}, A = (
|
|
2625
|
-
n.value && n.value.removeEventListener("scroll",
|
|
2626
|
-
},
|
|
2623
|
+
const C = I / M, R = Math.max(I * C, 20), z = I - R, q = Math.min(L * C, z);
|
|
2624
|
+
i.value.style.height = `${R}px`, i.value.style.top = `${q}px`;
|
|
2625
|
+
}, g = () => f(), p = (I) => {
|
|
2626
|
+
u = !0, v = I.clientY, m = n.value.scrollTop, document.body.style.userSelect = "none";
|
|
2627
|
+
}, k = (I) => {
|
|
2628
|
+
if (!u || !n.value || !o.value) return;
|
|
2629
|
+
const M = I.clientY - v, L = n.value.scrollHeight / o.value.clientHeight;
|
|
2630
|
+
n.value.scrollTop = m + M * L;
|
|
2631
|
+
}, S = () => {
|
|
2632
|
+
u = !1, document.body.style.userSelect = "";
|
|
2633
|
+
}, A = (I) => {
|
|
2634
|
+
n.value && n.value.removeEventListener("scroll", g), n.value = I, n.value ? (n.value.addEventListener("scroll", g), f()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
|
|
2635
|
+
}, D = () => {
|
|
2627
2636
|
if (!o.value) return;
|
|
2628
|
-
const
|
|
2629
|
-
A(
|
|
2637
|
+
const I = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
|
|
2638
|
+
A(I);
|
|
2630
2639
|
};
|
|
2631
|
-
return
|
|
2632
|
-
await
|
|
2633
|
-
|
|
2634
|
-
|
|
2640
|
+
return K(async () => {
|
|
2641
|
+
await se(), D(), c = new MutationObserver(() => {
|
|
2642
|
+
d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
2643
|
+
D();
|
|
2635
2644
|
});
|
|
2636
2645
|
}), c.observe(o.value, {
|
|
2637
2646
|
childList: !0,
|
|
2638
2647
|
subtree: !0
|
|
2639
|
-
}), window.addEventListener("resize",
|
|
2648
|
+
}), window.addEventListener("resize", f), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", k), document.addEventListener("mouseup", S);
|
|
2640
2649
|
}), ge(() => {
|
|
2641
|
-
c?.disconnect(), n.value && n.value.removeEventListener("scroll",
|
|
2650
|
+
c?.disconnect(), n.value && n.value.removeEventListener("scroll", g), window.removeEventListener("resize", f), i.value?.removeEventListener("mousedown", p), document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", S);
|
|
2642
2651
|
}), () => l("div", {
|
|
2643
2652
|
id: e.id,
|
|
2644
2653
|
class: [`${a}-custom-scrollbar`, e.class],
|
|
@@ -2653,44 +2662,57 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2653
2662
|
ref: i
|
|
2654
2663
|
}, null)])]);
|
|
2655
2664
|
}
|
|
2656
|
-
}), Vl = ze(), Wl =
|
|
2665
|
+
}), Vl = ze(), Wl = {
|
|
2666
|
+
flex: 1
|
|
2667
|
+
}, _l = /* @__PURE__ */ y({
|
|
2657
2668
|
name: "MDEditorContent",
|
|
2658
2669
|
props: st,
|
|
2659
2670
|
setup(e, t) {
|
|
2660
|
-
const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c =
|
|
2671
|
+
const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = E(""), d = E(), u = E(), {
|
|
2661
2672
|
inputWrapperRef: v,
|
|
2662
|
-
codeMirrorUt:
|
|
2663
|
-
resetHistory:
|
|
2673
|
+
codeMirrorUt: m,
|
|
2674
|
+
resetHistory: f
|
|
2664
2675
|
} = Pl(e), {
|
|
2665
|
-
inputWrapperStyle:
|
|
2676
|
+
inputWrapperStyle: g,
|
|
2666
2677
|
resizeOperateStyle: p
|
|
2667
|
-
} = Hl(e,
|
|
2668
|
-
oo(e, c,
|
|
2678
|
+
} = Hl(e, d, u);
|
|
2679
|
+
oo(e, c, m);
|
|
2669
2680
|
const {
|
|
2670
|
-
onCatalogActive:
|
|
2671
|
-
onMouseenter:
|
|
2681
|
+
onCatalogActive: k,
|
|
2682
|
+
onMouseenter: S,
|
|
2672
2683
|
onMouseleave: A
|
|
2673
|
-
} = Ol()
|
|
2684
|
+
} = Ol(), D = (L, C) => {
|
|
2685
|
+
if (!s.value.preview && C.line !== void 0) {
|
|
2686
|
+
L.preventDefault();
|
|
2687
|
+
const R = m.value?.view;
|
|
2688
|
+
if (R) {
|
|
2689
|
+
const z = R.state.doc.line(C.line + 1), q = R.lineBlockAt(z.from)?.top, $ = R.scrollDOM;
|
|
2690
|
+
Vl($, q);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
}, I = P(() => s.value.preview ? "preview" : "editor"), M = (L) => {
|
|
2694
|
+
c.value = L, e.onHtmlChanged(L);
|
|
2695
|
+
};
|
|
2674
2696
|
return t.expose({
|
|
2675
2697
|
getSelectedText() {
|
|
2676
|
-
return
|
|
2698
|
+
return m.value?.getSelectedText();
|
|
2677
2699
|
},
|
|
2678
2700
|
focus(L) {
|
|
2679
|
-
|
|
2701
|
+
m.value?.focus(L);
|
|
2680
2702
|
},
|
|
2681
|
-
resetHistory:
|
|
2703
|
+
resetHistory: f,
|
|
2682
2704
|
getEditorView() {
|
|
2683
|
-
return
|
|
2705
|
+
return m.value?.view;
|
|
2684
2706
|
}
|
|
2685
2707
|
}), () => l("div", {
|
|
2686
2708
|
class: `${a}-content`
|
|
2687
2709
|
}, [l("div", {
|
|
2688
2710
|
class: `${a}-content-wrapper`,
|
|
2689
|
-
ref:
|
|
2711
|
+
ref: d
|
|
2690
2712
|
}, [l(me, {
|
|
2691
2713
|
alwaysShowTrack: !0,
|
|
2692
2714
|
scrollTarget: `#${o} .cm-scroller`,
|
|
2693
|
-
style:
|
|
2715
|
+
style: g
|
|
2694
2716
|
}, {
|
|
2695
2717
|
default: () => [l("div", {
|
|
2696
2718
|
class: `${a}-input-wrapper`,
|
|
@@ -2699,18 +2721,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2699
2721
|
}), (s.value.htmlPreview || s.value.preview) && l("div", {
|
|
2700
2722
|
class: `${a}-resize-operate`,
|
|
2701
2723
|
style: p,
|
|
2702
|
-
ref:
|
|
2724
|
+
ref: u
|
|
2703
2725
|
}, null), l(me, {
|
|
2704
|
-
style:
|
|
2705
|
-
flex: 1
|
|
2706
|
-
}
|
|
2726
|
+
style: Wl
|
|
2707
2727
|
}, {
|
|
2708
2728
|
default: () => [l(it, {
|
|
2709
2729
|
modelValue: e.modelValue,
|
|
2710
2730
|
onChange: e.onChange,
|
|
2711
|
-
onHtmlChanged:
|
|
2712
|
-
c.value = L, e.onHtmlChanged(L);
|
|
2713
|
-
},
|
|
2731
|
+
onHtmlChanged: M,
|
|
2714
2732
|
onGetCatalog: e.onGetCatalog,
|
|
2715
2733
|
mdHeadingId: e.mdHeadingId,
|
|
2716
2734
|
noMermaid: e.noMermaid,
|
|
@@ -2722,11 +2740,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2722
2740
|
sanitizeMermaid: e.sanitizeMermaid,
|
|
2723
2741
|
codeFoldable: e.codeFoldable,
|
|
2724
2742
|
autoFoldThreshold: e.autoFoldThreshold,
|
|
2725
|
-
onRemount: e.onRemount
|
|
2743
|
+
onRemount: e.onRemount,
|
|
2744
|
+
previewComponent: e.previewComponent,
|
|
2745
|
+
noEcharts: e.noEcharts
|
|
2726
2746
|
}, null)]
|
|
2727
2747
|
})]), n.value && l(me, {
|
|
2728
2748
|
class: `${a}-catalog-${e.catalogLayout}`,
|
|
2729
|
-
onMouseenter:
|
|
2749
|
+
onMouseenter: S,
|
|
2730
2750
|
onMouseleave: A
|
|
2731
2751
|
}, {
|
|
2732
2752
|
default: () => [l(We, {
|
|
@@ -2736,23 +2756,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2736
2756
|
mdHeadingId: e.mdHeadingId,
|
|
2737
2757
|
key: "internal-catalog",
|
|
2738
2758
|
scrollElementOffsetTop: 2,
|
|
2739
|
-
syncWith:
|
|
2740
|
-
onClick:
|
|
2741
|
-
if (!s.value.preview && S.line !== void 0) {
|
|
2742
|
-
L.preventDefault();
|
|
2743
|
-
const N = b.value?.view;
|
|
2744
|
-
if (N) {
|
|
2745
|
-
const M = N.state.doc.line(S.line + 1), k = N.lineBlockAt(M.from)?.top, V = N.scrollDOM;
|
|
2746
|
-
Vl(V, k);
|
|
2747
|
-
}
|
|
2748
|
-
}
|
|
2749
|
-
},
|
|
2759
|
+
syncWith: I.value,
|
|
2760
|
+
onClick: D,
|
|
2750
2761
|
catalogMaxDepth: e.catalogMaxDepth,
|
|
2751
|
-
onActive:
|
|
2762
|
+
onActive: k
|
|
2752
2763
|
}, null)]
|
|
2753
2764
|
})]);
|
|
2754
2765
|
}
|
|
2755
|
-
}),
|
|
2766
|
+
}), zl = /* @__PURE__ */ y({
|
|
2756
2767
|
props: {
|
|
2757
2768
|
modelValue: {
|
|
2758
2769
|
type: String,
|
|
@@ -2767,7 +2778,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2767
2778
|
class: `${a}-footer-label`
|
|
2768
2779
|
}, [`${t.value.footer?.markdownTotal}:`]), l("span", null, [e.modelValue?.length || 0])]);
|
|
2769
2780
|
}
|
|
2770
|
-
}),
|
|
2781
|
+
}), ql = {
|
|
2771
2782
|
checked: {
|
|
2772
2783
|
type: Boolean,
|
|
2773
2784
|
default: !1
|
|
@@ -2781,9 +2792,9 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2781
2792
|
type: Boolean,
|
|
2782
2793
|
default: void 0
|
|
2783
2794
|
}
|
|
2784
|
-
},
|
|
2795
|
+
}, Ul = /* @__PURE__ */ y({
|
|
2785
2796
|
name: `${a}-checkbox`,
|
|
2786
|
-
props:
|
|
2797
|
+
props: ql,
|
|
2787
2798
|
setup(e) {
|
|
2788
2799
|
return () => l("div", {
|
|
2789
2800
|
class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`, e.disabled && `${a}-disabled`],
|
|
@@ -2792,7 +2803,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2792
2803
|
}
|
|
2793
2804
|
}, null);
|
|
2794
2805
|
}
|
|
2795
|
-
}),
|
|
2806
|
+
}), Kl = {
|
|
2796
2807
|
scrollAuto: {
|
|
2797
2808
|
type: Boolean
|
|
2798
2809
|
},
|
|
@@ -2801,8 +2812,8 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2801
2812
|
default: () => {
|
|
2802
2813
|
}
|
|
2803
2814
|
}
|
|
2804
|
-
},
|
|
2805
|
-
props:
|
|
2815
|
+
}, Gl = /* @__PURE__ */ y({
|
|
2816
|
+
props: Kl,
|
|
2806
2817
|
setup(e) {
|
|
2807
2818
|
const t = r("usedLanguageText"), o = r("disabled");
|
|
2808
2819
|
return () => l("div", {
|
|
@@ -2812,13 +2823,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2812
2823
|
onClick: () => {
|
|
2813
2824
|
o?.value || e.onScrollAutoChange(!e.scrollAuto);
|
|
2814
2825
|
}
|
|
2815
|
-
}, [t?.value.footer?.scrollAuto]), l(
|
|
2826
|
+
}, [t?.value.footer?.scrollAuto]), l(Ul, {
|
|
2816
2827
|
checked: e.scrollAuto,
|
|
2817
2828
|
onChange: e.onScrollAutoChange,
|
|
2818
2829
|
disabled: o?.value
|
|
2819
2830
|
}, null)]);
|
|
2820
2831
|
}
|
|
2821
|
-
}),
|
|
2832
|
+
}), jl = {
|
|
2822
2833
|
modelValue: {
|
|
2823
2834
|
type: String,
|
|
2824
2835
|
default: ""
|
|
@@ -2841,55 +2852,55 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2841
2852
|
defFooters: {
|
|
2842
2853
|
type: Object
|
|
2843
2854
|
}
|
|
2844
|
-
},
|
|
2855
|
+
}, Yl = /* @__PURE__ */ y({
|
|
2845
2856
|
name: "MDEditorFooter",
|
|
2846
|
-
props:
|
|
2857
|
+
props: jl,
|
|
2847
2858
|
setup(e) {
|
|
2848
|
-
const t = r("theme"), o = r("language"), n = r("disabled"), i =
|
|
2849
|
-
const c = e.footers.indexOf("="),
|
|
2850
|
-
return [
|
|
2859
|
+
const t = r("theme"), o = r("language"), n = r("disabled"), i = P(() => {
|
|
2860
|
+
const c = e.footers.indexOf("="), d = c === -1 ? e.footers : e.footers.slice(0, c), u = c === -1 ? [] : e.footers.slice(c, Number.MAX_SAFE_INTEGER);
|
|
2861
|
+
return [d, u];
|
|
2851
2862
|
}), s = (c) => {
|
|
2852
2863
|
if (St.includes(c))
|
|
2853
2864
|
switch (c) {
|
|
2854
2865
|
case "markdownTotal":
|
|
2855
|
-
return l(
|
|
2866
|
+
return l(zl, {
|
|
2856
2867
|
modelValue: e.modelValue
|
|
2857
2868
|
}, null);
|
|
2858
2869
|
case "scrollSwitch":
|
|
2859
|
-
return !e.noScrollAuto && l(
|
|
2870
|
+
return !e.noScrollAuto && l(Gl, {
|
|
2860
2871
|
scrollAuto: e.scrollAuto,
|
|
2861
2872
|
onScrollAutoChange: e.onScrollAutoChange
|
|
2862
2873
|
}, null);
|
|
2863
2874
|
}
|
|
2864
2875
|
else if (e.defFooters instanceof Array) {
|
|
2865
|
-
const
|
|
2866
|
-
return
|
|
2867
|
-
theme:
|
|
2868
|
-
language:
|
|
2869
|
-
disabled:
|
|
2876
|
+
const d = e.defFooters[c];
|
|
2877
|
+
return d ? ne(d, {
|
|
2878
|
+
theme: d.props?.theme || t.value,
|
|
2879
|
+
language: d.props?.language || o.value,
|
|
2880
|
+
disabled: d.props?.disabled || n?.value
|
|
2870
2881
|
}) : "";
|
|
2871
2882
|
} else if (e.defFooters && e.defFooters.children instanceof Array) {
|
|
2872
|
-
const
|
|
2873
|
-
return
|
|
2874
|
-
theme:
|
|
2875
|
-
language:
|
|
2876
|
-
disabled:
|
|
2883
|
+
const d = e.defFooters.children[c];
|
|
2884
|
+
return d ? ne(d, {
|
|
2885
|
+
theme: d.props?.theme || t.value,
|
|
2886
|
+
language: d.props?.language || o.value,
|
|
2887
|
+
disabled: d.props?.disabled || n?.value
|
|
2877
2888
|
}) : "";
|
|
2878
2889
|
} else
|
|
2879
2890
|
return "";
|
|
2880
2891
|
};
|
|
2881
2892
|
return () => {
|
|
2882
|
-
const c = i.value[0].map((
|
|
2893
|
+
const c = i.value[0].map((u) => s(u)), d = i.value[1].map((u) => s(u));
|
|
2883
2894
|
return l("div", {
|
|
2884
2895
|
class: `${a}-footer`
|
|
2885
2896
|
}, [l("div", {
|
|
2886
2897
|
class: `${a}-footer-left`
|
|
2887
2898
|
}, [c]), l("div", {
|
|
2888
2899
|
class: `${a}-footer-right`
|
|
2889
|
-
}, [
|
|
2900
|
+
}, [d])]);
|
|
2890
2901
|
};
|
|
2891
2902
|
}
|
|
2892
|
-
}),
|
|
2903
|
+
}), Zl = {
|
|
2893
2904
|
// 工具栏选择显示
|
|
2894
2905
|
toolbars: {
|
|
2895
2906
|
type: Array,
|
|
@@ -2900,24 +2911,24 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2900
2911
|
type: Array,
|
|
2901
2912
|
default: () => []
|
|
2902
2913
|
}
|
|
2903
|
-
},
|
|
2914
|
+
}, Xl = /* @__PURE__ */ y({
|
|
2904
2915
|
name: "MDEditorToolbar",
|
|
2905
|
-
props:
|
|
2916
|
+
props: Zl,
|
|
2906
2917
|
setup(e) {
|
|
2907
|
-
const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i =
|
|
2918
|
+
const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = E(), s = E(), {
|
|
2908
2919
|
barRender: c
|
|
2909
|
-
} = Ze(),
|
|
2910
|
-
const
|
|
2911
|
-
return [
|
|
2920
|
+
} = Ze(), d = P(() => {
|
|
2921
|
+
const u = e.toolbars.filter((g) => !e.toolbarsExclude.includes(g)), v = u.indexOf("="), m = v === -1 ? u : u.slice(0, v + 1), f = v === -1 ? [] : u.slice(v, Number.MAX_SAFE_INTEGER);
|
|
2922
|
+
return [m, f];
|
|
2912
2923
|
});
|
|
2913
|
-
return
|
|
2914
|
-
|
|
2924
|
+
return N(() => e.toolbars, () => {
|
|
2925
|
+
se(() => {
|
|
2915
2926
|
i.value && Lt(i.value);
|
|
2916
2927
|
});
|
|
2917
2928
|
}, {
|
|
2918
2929
|
immediate: !0
|
|
2919
2930
|
}), () => {
|
|
2920
|
-
const
|
|
2931
|
+
const u = d.value[0].map((m) => c(m)), v = d.value[1].map((m) => c(m));
|
|
2921
2932
|
return l(_e, null, [e.toolbars.length > 0 && l("div", {
|
|
2922
2933
|
class: `${a}-toolbar-wrapper`,
|
|
2923
2934
|
ref: i,
|
|
@@ -2927,12 +2938,12 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2927
2938
|
}, [l("div", {
|
|
2928
2939
|
class: `${a}-toolbar-left`,
|
|
2929
2940
|
ref: s
|
|
2930
|
-
}, [
|
|
2941
|
+
}, [u]), l("div", {
|
|
2931
2942
|
class: `${a}-toolbar-right`
|
|
2932
2943
|
}, [v])])])]);
|
|
2933
2944
|
};
|
|
2934
2945
|
}
|
|
2935
|
-
}), be = /* @__PURE__ */
|
|
2946
|
+
}), be = /* @__PURE__ */ y({
|
|
2936
2947
|
name: "MdEditorV3",
|
|
2937
2948
|
props: ut,
|
|
2938
2949
|
emits: ct,
|
|
@@ -2941,48 +2952,72 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2941
2952
|
noKatex: o,
|
|
2942
2953
|
noMermaid: n,
|
|
2943
2954
|
noHighlight: i
|
|
2944
|
-
} = e, s =
|
|
2955
|
+
} = e, s = Y({
|
|
2945
2956
|
scrollAuto: e.scrollAuto
|
|
2946
|
-
}), c =
|
|
2957
|
+
}), c = E(), d = E(), u = P(() => xe({
|
|
2947
2958
|
props: e,
|
|
2948
2959
|
ctx: t
|
|
2949
|
-
}, "defToolbars")), v =
|
|
2960
|
+
}, "defToolbars")), v = P(() => xe({
|
|
2950
2961
|
props: e,
|
|
2951
2962
|
ctx: t
|
|
2952
|
-
}, "defFooters")),
|
|
2953
|
-
editorId:
|
|
2963
|
+
}, "defFooters")), m = dt(e), [f, g] = mt(e, t, {
|
|
2964
|
+
editorId: m
|
|
2954
2965
|
}), p = bt(e, {
|
|
2955
|
-
editorId:
|
|
2966
|
+
editorId: m
|
|
2956
2967
|
});
|
|
2957
|
-
|
|
2958
|
-
editorId:
|
|
2959
|
-
}), gt(e),
|
|
2960
|
-
editorId:
|
|
2961
|
-
}),
|
|
2962
|
-
editorId:
|
|
2968
|
+
vt(e, t, {
|
|
2969
|
+
editorId: m
|
|
2970
|
+
}), gt(e), ht(e, t, {
|
|
2971
|
+
editorId: m
|
|
2972
|
+
}), ft(e, t, {
|
|
2973
|
+
editorId: m,
|
|
2963
2974
|
catalogVisible: p,
|
|
2964
|
-
setting:
|
|
2965
|
-
updateSetting:
|
|
2966
|
-
codeRef:
|
|
2975
|
+
setting: f,
|
|
2976
|
+
updateSetting: g,
|
|
2977
|
+
codeRef: d
|
|
2967
2978
|
}), pt(e, {
|
|
2968
2979
|
rootRef: c,
|
|
2969
|
-
editorId:
|
|
2970
|
-
setting:
|
|
2971
|
-
updateSetting:
|
|
2980
|
+
editorId: m,
|
|
2981
|
+
setting: f,
|
|
2982
|
+
updateSetting: g,
|
|
2972
2983
|
catalogVisible: p,
|
|
2973
|
-
defToolbars:
|
|
2984
|
+
defToolbars: u
|
|
2974
2985
|
}), ge(() => {
|
|
2975
|
-
|
|
2976
|
-
})
|
|
2977
|
-
|
|
2978
|
-
|
|
2986
|
+
h.clear(m);
|
|
2987
|
+
});
|
|
2988
|
+
const k = ($) => {
|
|
2989
|
+
t.emit("update:modelValue", $);
|
|
2990
|
+
}, S = ($) => {
|
|
2991
|
+
e.onChange?.($), t.emit("onChange", $);
|
|
2992
|
+
}, A = ($) => {
|
|
2993
|
+
e.onHtmlChanged?.($), t.emit("onHtmlChanged", $);
|
|
2994
|
+
}, D = ($) => {
|
|
2995
|
+
e.onGetCatalog?.($), t.emit("onGetCatalog", $);
|
|
2996
|
+
}, I = ($) => {
|
|
2997
|
+
e.onBlur?.($), t.emit("onBlur", $);
|
|
2998
|
+
}, M = ($) => {
|
|
2999
|
+
e.onFocus?.($), t.emit("onFocus", $);
|
|
3000
|
+
}, L = ($) => {
|
|
3001
|
+
e.onInput?.($), t.emit("onInput", $);
|
|
3002
|
+
}, C = ($) => {
|
|
3003
|
+
e.onDrop?.($), t.emit("onDrop", $);
|
|
3004
|
+
}, R = ($) => {
|
|
3005
|
+
e.oninputBoxWidthChange?.($), t.emit("oninputBoxWidthChange", $);
|
|
3006
|
+
}, z = () => {
|
|
3007
|
+
e.onRemount?.(), t.emit("onRemount");
|
|
3008
|
+
}, q = ($) => {
|
|
3009
|
+
s.scrollAuto = $;
|
|
3010
|
+
};
|
|
3011
|
+
return () => l("div", {
|
|
3012
|
+
id: m,
|
|
3013
|
+
class: [a, e.class, e.theme === "dark" && `${a}-dark`, f.fullscreen || f.pageFullscreen ? `${a}-fullscreen` : ""],
|
|
2979
3014
|
style: e.style,
|
|
2980
3015
|
ref: c
|
|
2981
|
-
}, [e.toolbars.length > 0 && l(
|
|
3016
|
+
}, [e.toolbars.length > 0 && l(Xl, {
|
|
2982
3017
|
toolbars: e.toolbars,
|
|
2983
3018
|
toolbarsExclude: e.toolbarsExclude
|
|
2984
|
-
}, null), l(
|
|
2985
|
-
ref:
|
|
3019
|
+
}, null), l(_l, {
|
|
3020
|
+
ref: d,
|
|
2986
3021
|
modelValue: e.modelValue,
|
|
2987
3022
|
mdHeadingId: e.mdHeadingId,
|
|
2988
3023
|
noMermaid: n,
|
|
@@ -2996,53 +3031,34 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2996
3031
|
maxlength: e.maxLength,
|
|
2997
3032
|
autoDetectCode: e.autoDetectCode,
|
|
2998
3033
|
noHighlight: i,
|
|
2999
|
-
updateModelValue:
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
e.onHtmlChanged?.(T), t.emit("onHtmlChanged", T);
|
|
3007
|
-
},
|
|
3008
|
-
onGetCatalog: (T) => {
|
|
3009
|
-
e.onGetCatalog?.(T), t.emit("onGetCatalog", T);
|
|
3010
|
-
},
|
|
3011
|
-
onBlur: (T) => {
|
|
3012
|
-
e.onBlur?.(T), t.emit("onBlur", T);
|
|
3013
|
-
},
|
|
3014
|
-
onFocus: (T) => {
|
|
3015
|
-
e.onFocus?.(T), t.emit("onFocus", T);
|
|
3016
|
-
},
|
|
3017
|
-
onInput: (T) => {
|
|
3018
|
-
e.onInput?.(T), t.emit("onInput", T);
|
|
3019
|
-
},
|
|
3034
|
+
updateModelValue: k,
|
|
3035
|
+
onChange: S,
|
|
3036
|
+
onHtmlChanged: A,
|
|
3037
|
+
onGetCatalog: D,
|
|
3038
|
+
onBlur: I,
|
|
3039
|
+
onFocus: M,
|
|
3040
|
+
onInput: L,
|
|
3020
3041
|
completions: e.completions,
|
|
3021
3042
|
noImgZoomIn: e.noImgZoomIn,
|
|
3022
|
-
onDrop:
|
|
3023
|
-
e.onDrop?.(T), t.emit("onDrop", T);
|
|
3024
|
-
},
|
|
3043
|
+
onDrop: C,
|
|
3025
3044
|
inputBoxWidth: e.inputBoxWidth,
|
|
3026
|
-
oninputBoxWidthChange:
|
|
3027
|
-
e.oninputBoxWidthChange?.(T), t.emit("oninputBoxWidthChange", T);
|
|
3028
|
-
},
|
|
3045
|
+
oninputBoxWidthChange: R,
|
|
3029
3046
|
sanitizeMermaid: e.sanitizeMermaid,
|
|
3030
3047
|
transformImgUrl: e.transformImgUrl,
|
|
3031
3048
|
codeFoldable: e.codeFoldable,
|
|
3032
3049
|
autoFoldThreshold: e.autoFoldThreshold,
|
|
3033
|
-
onRemount:
|
|
3034
|
-
e.onRemount?.(), t.emit("onRemount");
|
|
3035
|
-
},
|
|
3050
|
+
onRemount: z,
|
|
3036
3051
|
catalogLayout: e.catalogLayout,
|
|
3037
3052
|
catalogMaxDepth: e.catalogMaxDepth,
|
|
3038
|
-
noEcharts: e.noEcharts
|
|
3039
|
-
|
|
3053
|
+
noEcharts: e.noEcharts,
|
|
3054
|
+
previewComponent: e.previewComponent
|
|
3055
|
+
}, null), e.footers.length > 0 && l(Yl, {
|
|
3040
3056
|
modelValue: e.modelValue,
|
|
3041
3057
|
footers: e.footers,
|
|
3042
3058
|
defFooters: v.value,
|
|
3043
|
-
noScrollAuto: !
|
|
3059
|
+
noScrollAuto: !f.preview && !f.htmlPreview || f.previewOnly,
|
|
3044
3060
|
scrollAuto: s.scrollAuto,
|
|
3045
|
-
onScrollAutoChange:
|
|
3061
|
+
onScrollAutoChange: q
|
|
3046
3062
|
}, null)]);
|
|
3047
3063
|
}
|
|
3048
3064
|
});
|