md-editor-v3 6.2.0 → 6.2.1
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/es/MdEditor.mjs
CHANGED
|
@@ -3,15 +3,15 @@ import { s as at, a as nt, M as We } from "./chunks/index4.mjs";
|
|
|
3
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 N, nextTick as
|
|
6
|
+
import { inject as r, watch as N, nextTick as ie, onMounted as K, ref as I, defineComponent as C, createVNode as l, reactive as Y, toRef as ke, computed as P, Fragment as _e, cloneVNode as ne, createApp as Ct, shallowRef as kt, onBeforeUnmount as he } from "vue";
|
|
7
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
|
-
import { deleteLine as Nt, history as
|
|
9
|
+
import { deleteLine as Nt, history as $e, defaultKeymap as At, historyKeymap as Dt, indentWithTab as Rt, undo as Mt, 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
|
|
12
|
+
import { EditorState as ce, EditorSelection as U, Compartment as j, StateEffect as re, StateField as qe, RangeSetBuilder as Ht } from "@codemirror/state";
|
|
13
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
|
|
14
|
+
import { b as h, E as X, R as y, C as Ut, U as fe, a as Ue, c as Ke, O as Ge, d as Kt, e as Gt, T as jt, S as Yt, G as xe } 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";
|
|
@@ -19,7 +19,7 @@ import { I as x, M as Qt } from "./chunks/index2.mjs";
|
|
|
19
19
|
import { b as eo } from "./chunks/index5.mjs";
|
|
20
20
|
import { tags as b } from "@lezer/highlight";
|
|
21
21
|
import { searchKeymap as to } from "@codemirror/search";
|
|
22
|
-
import { g as
|
|
22
|
+
import { g as Se } from "./chunks/vue-tsx.mjs";
|
|
23
23
|
const oo = (e, t, o) => {
|
|
24
24
|
const n = r("editorId"), i = r("setting");
|
|
25
25
|
let s = () => {
|
|
@@ -41,7 +41,7 @@ const oo = (e, t, o) => {
|
|
|
41
41
|
), e.scrollAuto && c());
|
|
42
42
|
};
|
|
43
43
|
N([t, i], () => {
|
|
44
|
-
|
|
44
|
+
ie(d);
|
|
45
45
|
}), N(
|
|
46
46
|
() => e.scrollAuto,
|
|
47
47
|
(u) => {
|
|
@@ -53,7 +53,7 @@ const oo = (e, t, o) => {
|
|
|
53
53
|
u ? s() : c();
|
|
54
54
|
}
|
|
55
55
|
), K(d);
|
|
56
|
-
},
|
|
56
|
+
}, ue = async (e, t, o) => {
|
|
57
57
|
if (/^h[1-6]$/.test(e))
|
|
58
58
|
return lo(e, t);
|
|
59
59
|
if (e === "prettier")
|
|
@@ -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] = pe(t, {
|
|
110
110
|
wholeLine: !0
|
|
111
111
|
});
|
|
112
112
|
return {
|
|
@@ -160,7 +160,7 @@ $$
|
|
|
160
160
|
orderedList: 1,
|
|
161
161
|
task: "- [ ] "
|
|
162
162
|
}, io = (e, t) => {
|
|
163
|
-
const [o, n, i] =
|
|
163
|
+
const [o, n, i] = pe(t, {
|
|
164
164
|
wholeLine: !0
|
|
165
165
|
}), s = o.split(`
|
|
166
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;
|
|
@@ -170,7 +170,7 @@ $$
|
|
|
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] = pe(t), s = e.mode || "language", c = `
|
|
174
174
|
\`\`\`${s}
|
|
175
175
|
${e.text || o || ""}
|
|
176
176
|
\`\`\`
|
|
@@ -262,7 +262,7 @@ dateFormat YYYY-MM-DD`,
|
|
|
262
262
|
deviationEnd: n.deviationEnd || 0
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
},
|
|
265
|
+
}, pe = (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);
|
|
@@ -389,7 +389,7 @@ class go {
|
|
|
389
389
|
*/
|
|
390
390
|
setTabSize(t) {
|
|
391
391
|
this.toggleTabSize([
|
|
392
|
-
|
|
392
|
+
ce.tabSize.of(t),
|
|
393
393
|
Zt.of(" ".repeat(t))
|
|
394
394
|
]);
|
|
395
395
|
}
|
|
@@ -427,11 +427,11 @@ class go {
|
|
|
427
427
|
this.toggleDisabled([B.editable.of(!t)]);
|
|
428
428
|
}
|
|
429
429
|
setReadOnly(t) {
|
|
430
|
-
this.toggleReadOnly([
|
|
430
|
+
this.toggleReadOnly([ce.readOnly.of(t)]);
|
|
431
431
|
}
|
|
432
432
|
setMaxLength(t) {
|
|
433
433
|
this.maxLength = t, this.toggleMaxlength([
|
|
434
|
-
|
|
434
|
+
ce.changeFilter.of((o) => o.newDoc.length <= t)
|
|
435
435
|
]);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
@@ -442,7 +442,7 @@ const ho = (e, t) => {
|
|
|
442
442
|
if (e[o] !== t[o]) return !1;
|
|
443
443
|
return !0;
|
|
444
444
|
}, fo = (e, t) => {
|
|
445
|
-
const o =
|
|
445
|
+
const o = I(t.value);
|
|
446
446
|
N([t], () => {
|
|
447
447
|
(!o.value || !ho(o.value, t.value)) && (o.value = t.value, e());
|
|
448
448
|
});
|
|
@@ -461,10 +461,10 @@ const ho = (e, t) => {
|
|
|
461
461
|
1
|
|
462
462
|
)
|
|
463
463
|
}), s.focus();
|
|
464
|
-
},
|
|
464
|
+
}, Ie = (e) => (t, o, n, i) => {
|
|
465
465
|
const s = e.slice(i - n);
|
|
466
466
|
t.dispatch(t.state.replaceSelection(`${s} `));
|
|
467
|
-
},
|
|
467
|
+
}, Ee = (e) => {
|
|
468
468
|
const t = (o) => {
|
|
469
469
|
const n = o.matchBefore(
|
|
470
470
|
/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/
|
|
@@ -478,7 +478,7 @@ const ho = (e, t) => {
|
|
|
478
478
|
return {
|
|
479
479
|
label: c,
|
|
480
480
|
type: "text",
|
|
481
|
-
apply:
|
|
481
|
+
apply: Ie(c)
|
|
482
482
|
};
|
|
483
483
|
}),
|
|
484
484
|
// 任务列表
|
|
@@ -487,7 +487,7 @@ const ho = (e, t) => {
|
|
|
487
487
|
return {
|
|
488
488
|
label: s,
|
|
489
489
|
type: "text",
|
|
490
|
-
apply:
|
|
490
|
+
apply: Ie(s)
|
|
491
491
|
};
|
|
492
492
|
}),
|
|
493
493
|
// 代码
|
|
@@ -564,14 +564,14 @@ $$`, "title")
|
|
|
564
564
|
return Xt({
|
|
565
565
|
override: e ? [t, ...e] : [t]
|
|
566
566
|
});
|
|
567
|
-
}, po = /* @__PURE__ */
|
|
567
|
+
}, po = /* @__PURE__ */ C({
|
|
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__ */ C({
|
|
575
575
|
name: "ToolbarBold",
|
|
576
576
|
setup() {
|
|
577
577
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -580,7 +580,7 @@ $$`, "title")
|
|
|
580
580
|
title: t.value.toolbarTips?.bold,
|
|
581
581
|
disabled: o?.value,
|
|
582
582
|
onClick: () => {
|
|
583
|
-
h.emit(e,
|
|
583
|
+
h.emit(e, y, "bold");
|
|
584
584
|
},
|
|
585
585
|
type: "button"
|
|
586
586
|
}, [l(x, {
|
|
@@ -589,7 +589,7 @@ $$`, "title")
|
|
|
589
589
|
class: `${a}-toolbar-item-name`
|
|
590
590
|
}, [t.value.toolbarTips?.bold])]);
|
|
591
591
|
}
|
|
592
|
-
}), wo = /* @__PURE__ */
|
|
592
|
+
}), wo = /* @__PURE__ */ C({
|
|
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");
|
|
@@ -608,7 +608,7 @@ $$`, "title")
|
|
|
608
608
|
class: `${a}-toolbar-item-name`
|
|
609
609
|
}, [t.value.toolbarTips?.catalog])]);
|
|
610
610
|
}
|
|
611
|
-
}), yo = /* @__PURE__ */
|
|
611
|
+
}), yo = /* @__PURE__ */ C({
|
|
612
612
|
name: "ToolbarCode",
|
|
613
613
|
setup() {
|
|
614
614
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -617,7 +617,7 @@ $$`, "title")
|
|
|
617
617
|
title: t.value.toolbarTips?.code,
|
|
618
618
|
disabled: o?.value,
|
|
619
619
|
onClick: () => {
|
|
620
|
-
h.emit(e,
|
|
620
|
+
h.emit(e, y, "code");
|
|
621
621
|
},
|
|
622
622
|
type: "button"
|
|
623
623
|
}, [l(x, {
|
|
@@ -626,7 +626,7 @@ $$`, "title")
|
|
|
626
626
|
class: `${a}-toolbar-item-name`
|
|
627
627
|
}, [t.value.toolbarTips?.code])]);
|
|
628
628
|
}
|
|
629
|
-
}), Co = /* @__PURE__ */
|
|
629
|
+
}), Co = /* @__PURE__ */ C({
|
|
630
630
|
name: "ToolbarCodeRow",
|
|
631
631
|
setup() {
|
|
632
632
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -635,7 +635,7 @@ $$`, "title")
|
|
|
635
635
|
title: t.value.toolbarTips?.codeRow,
|
|
636
636
|
disabled: o?.value,
|
|
637
637
|
onClick: () => {
|
|
638
|
-
h.emit(e,
|
|
638
|
+
h.emit(e, y, "codeRow");
|
|
639
639
|
},
|
|
640
640
|
type: "button"
|
|
641
641
|
}, [l(x, {
|
|
@@ -644,7 +644,7 @@ $$`, "title")
|
|
|
644
644
|
class: `${a}-toolbar-item-name`
|
|
645
645
|
}, [t.value.toolbarTips?.codeRow])]);
|
|
646
646
|
}
|
|
647
|
-
}), ko = /* @__PURE__ */
|
|
647
|
+
}), ko = /* @__PURE__ */ C({
|
|
648
648
|
name: "ToolbarFullscreen",
|
|
649
649
|
setup() {
|
|
650
650
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), {
|
|
@@ -664,7 +664,7 @@ $$`, "title")
|
|
|
664
664
|
class: `${a}-toolbar-item-name`
|
|
665
665
|
}, [e.value.toolbarTips?.fullscreen])]);
|
|
666
666
|
}
|
|
667
|
-
}), $o = /* @__PURE__ */
|
|
667
|
+
}), $o = /* @__PURE__ */ C({
|
|
668
668
|
name: "ToolbarGithub",
|
|
669
669
|
setup() {
|
|
670
670
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName");
|
|
@@ -682,7 +682,7 @@ $$`, "title")
|
|
|
682
682
|
class: `${a}-toolbar-item-name`
|
|
683
683
|
}, [e.value.toolbarTips?.github])]);
|
|
684
684
|
}
|
|
685
|
-
}), xo = /* @__PURE__ */
|
|
685
|
+
}), xo = /* @__PURE__ */ C({
|
|
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");
|
|
@@ -700,7 +700,7 @@ $$`, "title")
|
|
|
700
700
|
class: `${a}-toolbar-item-name`
|
|
701
701
|
}, [e.value.toolbarTips?.htmlPreview])]);
|
|
702
702
|
}
|
|
703
|
-
}), So = /* @__PURE__ */
|
|
703
|
+
}), So = /* @__PURE__ */ C({
|
|
704
704
|
name: "ToolbarImage",
|
|
705
705
|
setup() {
|
|
706
706
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -709,7 +709,7 @@ $$`, "title")
|
|
|
709
709
|
title: t.value.toolbarTips?.image,
|
|
710
710
|
disabled: o?.value,
|
|
711
711
|
onClick: () => {
|
|
712
|
-
h.emit(e,
|
|
712
|
+
h.emit(e, y, "image");
|
|
713
713
|
},
|
|
714
714
|
type: "button"
|
|
715
715
|
}, [l(x, {
|
|
@@ -733,13 +733,13 @@ $$`, "title")
|
|
|
733
733
|
default: () => {
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
}, Eo = /* @__PURE__ */
|
|
736
|
+
}, Eo = /* @__PURE__ */ C({
|
|
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
741
|
let i = Z.editorExtensions.cropper.instance;
|
|
742
|
-
const s =
|
|
742
|
+
const s = I(), c = I(), d = I(), u = Y({
|
|
743
743
|
cropperInited: !1,
|
|
744
744
|
imgSelected: !1,
|
|
745
745
|
imgSrc: "",
|
|
@@ -766,8 +766,8 @@ $$`, "title")
|
|
|
766
766
|
});
|
|
767
767
|
}), N(() => [u.imgSelected], () => {
|
|
768
768
|
d.value.style = "";
|
|
769
|
-
}), N([
|
|
770
|
-
u.imgSrc &&
|
|
769
|
+
}), N([ke(() => u.isFullscreen), ke(() => u.imgSrc)], () => {
|
|
770
|
+
u.imgSrc && ie(() => {
|
|
771
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`)
|
|
@@ -832,7 +832,7 @@ $$`, "title")
|
|
|
832
832
|
onClick: () => {
|
|
833
833
|
if (v) {
|
|
834
834
|
const g = v.getCroppedCanvas();
|
|
835
|
-
h.emit(o,
|
|
835
|
+
h.emit(o, fe, [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__ */ C({
|
|
866
866
|
name: `${a}-modals`,
|
|
867
867
|
props: Lo,
|
|
868
868
|
setup(e) {
|
|
@@ -872,13 +872,13 @@ $$`, "title")
|
|
|
872
872
|
onCancel: e.onCancel
|
|
873
873
|
}, null);
|
|
874
874
|
}
|
|
875
|
-
}), Ao = /* @__PURE__ */
|
|
875
|
+
}), Ao = /* @__PURE__ */ C({
|
|
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
|
-
h.emit(e,
|
|
880
|
-
}, v = (k,
|
|
881
|
-
o?.value || h.emit(e,
|
|
878
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = I(!1), c = I(!1), d = I(), u = () => {
|
|
879
|
+
h.emit(e, fe, Array.from(d.value.files || [])), d.value.value = "";
|
|
880
|
+
}, v = (k, E) => {
|
|
881
|
+
o?.value || h.emit(e, y, k, E);
|
|
882
882
|
};
|
|
883
883
|
K(() => {
|
|
884
884
|
d.value.addEventListener("change", u);
|
|
@@ -959,7 +959,7 @@ $$`, "title")
|
|
|
959
959
|
onOk: g
|
|
960
960
|
}, null)]);
|
|
961
961
|
}
|
|
962
|
-
}), Do = /* @__PURE__ */
|
|
962
|
+
}), Do = /* @__PURE__ */ C({
|
|
963
963
|
name: "ToolbarItalic",
|
|
964
964
|
setup() {
|
|
965
965
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -968,7 +968,7 @@ $$`, "title")
|
|
|
968
968
|
title: t.value.toolbarTips?.italic,
|
|
969
969
|
disabled: o?.value,
|
|
970
970
|
onClick: () => {
|
|
971
|
-
h.emit(e,
|
|
971
|
+
h.emit(e, y, "italic");
|
|
972
972
|
},
|
|
973
973
|
type: "button"
|
|
974
974
|
}, [l(x, {
|
|
@@ -977,11 +977,11 @@ $$`, "title")
|
|
|
977
977
|
class: `${a}-toolbar-item-name`
|
|
978
978
|
}, [t.value.toolbarTips?.italic])]);
|
|
979
979
|
}
|
|
980
|
-
}),
|
|
980
|
+
}), Ro = /* @__PURE__ */ C({
|
|
981
981
|
name: "ToolbarKatex",
|
|
982
982
|
setup() {
|
|
983
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
984
|
-
o?.value || h.emit(e,
|
|
983
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = I(!1), c = (v) => {
|
|
984
|
+
o?.value || h.emit(e, y, v);
|
|
985
985
|
}, d = (v) => {
|
|
986
986
|
s.value = v;
|
|
987
987
|
}, u = P(() => l("ul", {
|
|
@@ -1025,7 +1025,7 @@ $$`, "title")
|
|
|
1025
1025
|
}, [t.value.toolbarTips?.katex])])]
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
1028
|
-
}),
|
|
1028
|
+
}), Mo = /* @__PURE__ */ C({
|
|
1029
1029
|
name: "ToolbarLink",
|
|
1030
1030
|
setup() {
|
|
1031
1031
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1034,7 +1034,7 @@ $$`, "title")
|
|
|
1034
1034
|
title: t.value.toolbarTips?.link,
|
|
1035
1035
|
disabled: o?.value,
|
|
1036
1036
|
onClick: () => {
|
|
1037
|
-
h.emit(e,
|
|
1037
|
+
h.emit(e, y, "link");
|
|
1038
1038
|
},
|
|
1039
1039
|
type: "button"
|
|
1040
1040
|
}, [l(x, {
|
|
@@ -1043,11 +1043,11 @@ $$`, "title")
|
|
|
1043
1043
|
class: `${a}-toolbar-item-name`
|
|
1044
1044
|
}, [t.value.toolbarTips?.link])]);
|
|
1045
1045
|
}
|
|
1046
|
-
}), Fo = /* @__PURE__ */
|
|
1046
|
+
}), Fo = /* @__PURE__ */ C({
|
|
1047
1047
|
name: "ToolbarMermaid",
|
|
1048
1048
|
setup() {
|
|
1049
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
1050
|
-
o?.value || h.emit(e,
|
|
1049
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = I(!1), c = (v) => {
|
|
1050
|
+
o?.value || h.emit(e, y, v);
|
|
1051
1051
|
}, d = (v) => {
|
|
1052
1052
|
s.value = v;
|
|
1053
1053
|
}, u = P(() => l("ul", {
|
|
@@ -1133,7 +1133,7 @@ $$`, "title")
|
|
|
1133
1133
|
}, [t.value.toolbarTips?.mermaid])])]
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
1136
|
-
}), Bo = /* @__PURE__ */
|
|
1136
|
+
}), Bo = /* @__PURE__ */ C({
|
|
1137
1137
|
name: "ToolbarNext",
|
|
1138
1138
|
setup() {
|
|
1139
1139
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1151,7 +1151,7 @@ $$`, "title")
|
|
|
1151
1151
|
class: `${a}-toolbar-item-name`
|
|
1152
1152
|
}, [t.value.toolbarTips?.next])]);
|
|
1153
1153
|
}
|
|
1154
|
-
}), Po = /* @__PURE__ */
|
|
1154
|
+
}), Po = /* @__PURE__ */ C({
|
|
1155
1155
|
name: "ToolbarOrderedList",
|
|
1156
1156
|
setup() {
|
|
1157
1157
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1160,7 +1160,7 @@ $$`, "title")
|
|
|
1160
1160
|
title: t.value.toolbarTips?.orderedList,
|
|
1161
1161
|
disabled: o?.value,
|
|
1162
1162
|
onClick: () => {
|
|
1163
|
-
h.emit(e,
|
|
1163
|
+
h.emit(e, y, "orderedList");
|
|
1164
1164
|
},
|
|
1165
1165
|
type: "button"
|
|
1166
1166
|
}, [l(x, {
|
|
@@ -1169,7 +1169,7 @@ $$`, "title")
|
|
|
1169
1169
|
class: `${a}-toolbar-item-name`
|
|
1170
1170
|
}, [t.value.toolbarTips?.orderedList])]);
|
|
1171
1171
|
}
|
|
1172
|
-
}), Ho = /* @__PURE__ */
|
|
1172
|
+
}), Ho = /* @__PURE__ */ C({
|
|
1173
1173
|
name: "ToolbarPageFullscreen",
|
|
1174
1174
|
setup() {
|
|
1175
1175
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -1187,7 +1187,7 @@ $$`, "title")
|
|
|
1187
1187
|
class: `${a}-toolbar-item-name`
|
|
1188
1188
|
}, [e.value.toolbarTips?.pageFullscreen])]);
|
|
1189
1189
|
}
|
|
1190
|
-
}), Oo = /* @__PURE__ */
|
|
1190
|
+
}), Oo = /* @__PURE__ */ C({
|
|
1191
1191
|
name: "ToolbarPrettier",
|
|
1192
1192
|
setup() {
|
|
1193
1193
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1196,7 +1196,7 @@ $$`, "title")
|
|
|
1196
1196
|
title: t.value.toolbarTips?.prettier,
|
|
1197
1197
|
disabled: o?.value,
|
|
1198
1198
|
onClick: () => {
|
|
1199
|
-
h.emit(e,
|
|
1199
|
+
h.emit(e, y, "prettier");
|
|
1200
1200
|
},
|
|
1201
1201
|
type: "button"
|
|
1202
1202
|
}, [l(x, {
|
|
@@ -1205,7 +1205,7 @@ $$`, "title")
|
|
|
1205
1205
|
class: `${a}-toolbar-item-name`
|
|
1206
1206
|
}, [t.value.toolbarTips?.prettier])]);
|
|
1207
1207
|
}
|
|
1208
|
-
}), Vo = /* @__PURE__ */
|
|
1208
|
+
}), Vo = /* @__PURE__ */ C({
|
|
1209
1209
|
name: "ToolbarPreview",
|
|
1210
1210
|
setup() {
|
|
1211
1211
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -1223,7 +1223,7 @@ $$`, "title")
|
|
|
1223
1223
|
class: `${a}-toolbar-item-name`
|
|
1224
1224
|
}, [e.value.toolbarTips?.preview])]);
|
|
1225
1225
|
}
|
|
1226
|
-
}), Wo = /* @__PURE__ */
|
|
1226
|
+
}), Wo = /* @__PURE__ */ C({
|
|
1227
1227
|
name: "ToolbarPreviewOnly",
|
|
1228
1228
|
setup() {
|
|
1229
1229
|
const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
|
|
@@ -1241,7 +1241,7 @@ $$`, "title")
|
|
|
1241
1241
|
class: `${a}-toolbar-item-name`
|
|
1242
1242
|
}, [e.value.toolbarTips?.previewOnly])]);
|
|
1243
1243
|
}
|
|
1244
|
-
}), _o = /* @__PURE__ */
|
|
1244
|
+
}), _o = /* @__PURE__ */ C({
|
|
1245
1245
|
name: "ToolbarQuote",
|
|
1246
1246
|
setup() {
|
|
1247
1247
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1250,7 +1250,7 @@ $$`, "title")
|
|
|
1250
1250
|
title: t.value.toolbarTips?.quote,
|
|
1251
1251
|
disabled: o?.value,
|
|
1252
1252
|
onClick: () => {
|
|
1253
|
-
h.emit(e,
|
|
1253
|
+
h.emit(e, y, "quote");
|
|
1254
1254
|
},
|
|
1255
1255
|
type: "button"
|
|
1256
1256
|
}, [l(x, {
|
|
@@ -1259,7 +1259,7 @@ $$`, "title")
|
|
|
1259
1259
|
class: `${a}-toolbar-item-name`
|
|
1260
1260
|
}, [t.value.toolbarTips?.quote])]);
|
|
1261
1261
|
}
|
|
1262
|
-
}), zo = /* @__PURE__ */
|
|
1262
|
+
}), zo = /* @__PURE__ */ C({
|
|
1263
1263
|
name: "ToolbarRevoke",
|
|
1264
1264
|
setup() {
|
|
1265
1265
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1277,7 +1277,7 @@ $$`, "title")
|
|
|
1277
1277
|
class: `${a}-toolbar-item-name`
|
|
1278
1278
|
}, [t.value.toolbarTips?.revoke])]);
|
|
1279
1279
|
}
|
|
1280
|
-
}), qo = /* @__PURE__ */
|
|
1280
|
+
}), qo = /* @__PURE__ */ C({
|
|
1281
1281
|
name: "ToolbarSave",
|
|
1282
1282
|
setup() {
|
|
1283
1283
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1295,7 +1295,7 @@ $$`, "title")
|
|
|
1295
1295
|
class: `${a}-toolbar-item-name`
|
|
1296
1296
|
}, [t.value.toolbarTips?.save])]);
|
|
1297
1297
|
}
|
|
1298
|
-
}), Uo = /* @__PURE__ */
|
|
1298
|
+
}), Uo = /* @__PURE__ */ C({
|
|
1299
1299
|
name: "ToolbarStrikeThrough",
|
|
1300
1300
|
setup() {
|
|
1301
1301
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1304,7 +1304,7 @@ $$`, "title")
|
|
|
1304
1304
|
title: t.value.toolbarTips?.strikeThrough,
|
|
1305
1305
|
disabled: o?.value,
|
|
1306
1306
|
onClick: () => {
|
|
1307
|
-
h.emit(e,
|
|
1307
|
+
h.emit(e, y, "strikeThrough");
|
|
1308
1308
|
},
|
|
1309
1309
|
type: "button"
|
|
1310
1310
|
}, [l(x, {
|
|
@@ -1313,7 +1313,7 @@ $$`, "title")
|
|
|
1313
1313
|
class: `${a}-toolbar-item-name`
|
|
1314
1314
|
}, [t.value.toolbarTips?.strikeThrough])]);
|
|
1315
1315
|
}
|
|
1316
|
-
}), Ko = /* @__PURE__ */
|
|
1316
|
+
}), Ko = /* @__PURE__ */ C({
|
|
1317
1317
|
name: "ToolbarSub",
|
|
1318
1318
|
setup() {
|
|
1319
1319
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1322,7 +1322,7 @@ $$`, "title")
|
|
|
1322
1322
|
title: t.value.toolbarTips?.sub,
|
|
1323
1323
|
disabled: o?.value,
|
|
1324
1324
|
onClick: () => {
|
|
1325
|
-
h.emit(e,
|
|
1325
|
+
h.emit(e, y, "sub");
|
|
1326
1326
|
},
|
|
1327
1327
|
type: "button"
|
|
1328
1328
|
}, [l(x, {
|
|
@@ -1331,7 +1331,7 @@ $$`, "title")
|
|
|
1331
1331
|
class: `${a}-toolbar-item-name`
|
|
1332
1332
|
}, [t.value.toolbarTips?.sub])]);
|
|
1333
1333
|
}
|
|
1334
|
-
}), Go = /* @__PURE__ */
|
|
1334
|
+
}), Go = /* @__PURE__ */ C({
|
|
1335
1335
|
name: "ToolbarSup",
|
|
1336
1336
|
setup() {
|
|
1337
1337
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1340,7 +1340,7 @@ $$`, "title")
|
|
|
1340
1340
|
title: t.value.toolbarTips?.sup,
|
|
1341
1341
|
disabled: o?.value,
|
|
1342
1342
|
onClick: () => {
|
|
1343
|
-
h.emit(e,
|
|
1343
|
+
h.emit(e, y, "sup");
|
|
1344
1344
|
},
|
|
1345
1345
|
type: "button"
|
|
1346
1346
|
}, [l(x, {
|
|
@@ -1359,7 +1359,7 @@ $$`, "title")
|
|
|
1359
1359
|
default: () => {
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
-
}, Yo = /* @__PURE__ */
|
|
1362
|
+
}, Yo = /* @__PURE__ */ C({
|
|
1363
1363
|
name: "TableShape",
|
|
1364
1364
|
props: jo,
|
|
1365
1365
|
setup(e) {
|
|
@@ -1369,7 +1369,7 @@ $$`, "title")
|
|
|
1369
1369
|
}), o = P(() => JSON.stringify(e.tableShape)), n = () => {
|
|
1370
1370
|
const s = [...JSON.parse(o.value)];
|
|
1371
1371
|
return (!s[2] || s[2] < s[0]) && (s[2] = s[0]), (!s[3] || s[3] < s[3]) && (s[3] = s[1]), s;
|
|
1372
|
-
}, i =
|
|
1372
|
+
}, i = I(n());
|
|
1373
1373
|
return N([o], () => {
|
|
1374
1374
|
i.value = n();
|
|
1375
1375
|
}), () => l("div", {
|
|
@@ -1393,13 +1393,13 @@ $$`, "title")
|
|
|
1393
1393
|
class: [`${a}-table-shape-col-default`, c <= t.x && u <= t.y && `${a}-table-shape-col-include`]
|
|
1394
1394
|
}, null)]))]))]);
|
|
1395
1395
|
}
|
|
1396
|
-
}), Zo = /* @__PURE__ */
|
|
1396
|
+
}), Zo = /* @__PURE__ */ C({
|
|
1397
1397
|
name: "ToolbarTable",
|
|
1398
1398
|
setup() {
|
|
1399
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c =
|
|
1399
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c = I(!1), d = (m) => {
|
|
1400
1400
|
c.value = m;
|
|
1401
1401
|
}, u = (m) => {
|
|
1402
|
-
o?.value || h.emit(e,
|
|
1402
|
+
o?.value || h.emit(e, y, "table", {
|
|
1403
1403
|
selectedShape: m
|
|
1404
1404
|
});
|
|
1405
1405
|
}, v = P(() => l(Yo, {
|
|
@@ -1426,7 +1426,7 @@ $$`, "title")
|
|
|
1426
1426
|
}, [t.value.toolbarTips?.table])])]
|
|
1427
1427
|
});
|
|
1428
1428
|
}
|
|
1429
|
-
}), Xo = /* @__PURE__ */
|
|
1429
|
+
}), Xo = /* @__PURE__ */ C({
|
|
1430
1430
|
name: "ToolbarTask",
|
|
1431
1431
|
setup() {
|
|
1432
1432
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1435,7 +1435,7 @@ $$`, "title")
|
|
|
1435
1435
|
title: t.value.toolbarTips?.task,
|
|
1436
1436
|
disabled: o?.value,
|
|
1437
1437
|
onClick: () => {
|
|
1438
|
-
h.emit(e,
|
|
1438
|
+
h.emit(e, y, "task");
|
|
1439
1439
|
},
|
|
1440
1440
|
type: "button"
|
|
1441
1441
|
}, [l(x, {
|
|
@@ -1444,11 +1444,11 @@ $$`, "title")
|
|
|
1444
1444
|
class: `${a}-toolbar-item-name`
|
|
1445
1445
|
}, [t.value.toolbarTips?.task])]);
|
|
1446
1446
|
}
|
|
1447
|
-
}), Jo = /* @__PURE__ */
|
|
1447
|
+
}), Jo = /* @__PURE__ */ C({
|
|
1448
1448
|
name: "ToolbarTitle",
|
|
1449
1449
|
setup() {
|
|
1450
|
-
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s =
|
|
1451
|
-
o?.value || h.emit(e,
|
|
1450
|
+
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = I(!1), c = (v) => {
|
|
1451
|
+
o?.value || h.emit(e, y, v);
|
|
1452
1452
|
}, d = (v) => {
|
|
1453
1453
|
s.value = v;
|
|
1454
1454
|
}, u = P(() => l("ul", {
|
|
@@ -1519,7 +1519,7 @@ $$`, "title")
|
|
|
1519
1519
|
}, [t.value.toolbarTips?.title])])]
|
|
1520
1520
|
});
|
|
1521
1521
|
}
|
|
1522
|
-
}), Qo = /* @__PURE__ */
|
|
1522
|
+
}), Qo = /* @__PURE__ */ C({
|
|
1523
1523
|
name: "ToolbarUnderline",
|
|
1524
1524
|
setup() {
|
|
1525
1525
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1528,7 +1528,7 @@ $$`, "title")
|
|
|
1528
1528
|
title: t.value.toolbarTips?.underline,
|
|
1529
1529
|
disabled: o?.value,
|
|
1530
1530
|
onClick: () => {
|
|
1531
|
-
h.emit(e,
|
|
1531
|
+
h.emit(e, y, "underline");
|
|
1532
1532
|
},
|
|
1533
1533
|
type: "button"
|
|
1534
1534
|
}, [l(x, {
|
|
@@ -1537,7 +1537,7 @@ $$`, "title")
|
|
|
1537
1537
|
class: `${a}-toolbar-item-name`
|
|
1538
1538
|
}, [t.value.toolbarTips?.underline])]);
|
|
1539
1539
|
}
|
|
1540
|
-
}), el = /* @__PURE__ */
|
|
1540
|
+
}), el = /* @__PURE__ */ C({
|
|
1541
1541
|
name: "ToolbarUnorderedList",
|
|
1542
1542
|
setup() {
|
|
1543
1543
|
const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
|
|
@@ -1546,7 +1546,7 @@ $$`, "title")
|
|
|
1546
1546
|
title: t.value.toolbarTips?.unorderedList,
|
|
1547
1547
|
disabled: o?.value,
|
|
1548
1548
|
onClick: () => {
|
|
1549
|
-
h.emit(e,
|
|
1549
|
+
h.emit(e, y, "unorderedList");
|
|
1550
1550
|
},
|
|
1551
1551
|
type: "button"
|
|
1552
1552
|
}, [l(x, {
|
|
@@ -1561,7 +1561,7 @@ $$`, "title")
|
|
|
1561
1561
|
editorExtensionsAttrs: i
|
|
1562
1562
|
} = Z;
|
|
1563
1563
|
let s = n.screenfull.instance;
|
|
1564
|
-
const c =
|
|
1564
|
+
const c = I(!1), d = (m) => {
|
|
1565
1565
|
if (!s) {
|
|
1566
1566
|
h.emit(e, X, {
|
|
1567
1567
|
name: "fullscreen",
|
|
@@ -1657,7 +1657,7 @@ const Ze = () => {
|
|
|
1657
1657
|
key: "bar-code"
|
|
1658
1658
|
}, null);
|
|
1659
1659
|
case "link":
|
|
1660
|
-
return l(
|
|
1660
|
+
return l(Mo, {
|
|
1661
1661
|
key: "bar-link"
|
|
1662
1662
|
}, null);
|
|
1663
1663
|
case "image":
|
|
@@ -1719,7 +1719,7 @@ const Ze = () => {
|
|
|
1719
1719
|
key: "bar-mermaid"
|
|
1720
1720
|
}, null);
|
|
1721
1721
|
case "katex":
|
|
1722
|
-
return l(
|
|
1722
|
+
return l(Ro, {
|
|
1723
1723
|
key: "bar-katex"
|
|
1724
1724
|
}, null);
|
|
1725
1725
|
}
|
|
@@ -1732,9 +1732,9 @@ const Ze = () => {
|
|
|
1732
1732
|
codeTheme: p.props?.codeTheme || d.value,
|
|
1733
1733
|
disabled: p.props?.disabled || i.value,
|
|
1734
1734
|
showToolbarName: p.props?.showToolbarName || u.value,
|
|
1735
|
-
insert(
|
|
1736
|
-
h.emit(e,
|
|
1737
|
-
generate:
|
|
1735
|
+
insert(E) {
|
|
1736
|
+
h.emit(e, y, "universal", {
|
|
1737
|
+
generate: E
|
|
1738
1738
|
});
|
|
1739
1739
|
}
|
|
1740
1740
|
}) : "";
|
|
@@ -1747,9 +1747,9 @@ const Ze = () => {
|
|
|
1747
1747
|
codeTheme: p.props?.codeTheme || d.value,
|
|
1748
1748
|
disabled: p.props?.disabled || i.value,
|
|
1749
1749
|
showToolbarName: p.props?.showToolbarName || u.value,
|
|
1750
|
-
insert(
|
|
1751
|
-
h.emit(e,
|
|
1752
|
-
generate:
|
|
1750
|
+
insert(E) {
|
|
1751
|
+
h.emit(e, y, "universal", {
|
|
1752
|
+
generate: E
|
|
1753
1753
|
});
|
|
1754
1754
|
}
|
|
1755
1755
|
}) : "";
|
|
@@ -1757,7 +1757,7 @@ const Ze = () => {
|
|
|
1757
1757
|
return "";
|
|
1758
1758
|
}
|
|
1759
1759
|
};
|
|
1760
|
-
}, ll = /* @__PURE__ */
|
|
1760
|
+
}, ll = /* @__PURE__ */ C({
|
|
1761
1761
|
name: "FloatingToolbar",
|
|
1762
1762
|
setup() {
|
|
1763
1763
|
const e = r("floatingToolbars"), {
|
|
@@ -1767,12 +1767,12 @@ const Ze = () => {
|
|
|
1767
1767
|
class: `${a}-floating-toolbar`
|
|
1768
1768
|
}, [e.value.map((o) => t(o))]);
|
|
1769
1769
|
}
|
|
1770
|
-
}),
|
|
1770
|
+
}), ge = re.define(), al = qe.define({
|
|
1771
1771
|
create() {
|
|
1772
1772
|
return null;
|
|
1773
1773
|
},
|
|
1774
1774
|
update(e, t) {
|
|
1775
|
-
for (const o of t.effects) o.is(
|
|
1775
|
+
for (const o of t.effects) o.is(ge) && (e = o.value);
|
|
1776
1776
|
return e;
|
|
1777
1777
|
},
|
|
1778
1778
|
provide: (e) => Vt.from(e)
|
|
@@ -1780,7 +1780,7 @@ const Ze = () => {
|
|
|
1780
1780
|
let t = null;
|
|
1781
1781
|
const o = (s, c) => {
|
|
1782
1782
|
t && t.kind === c.kind && t.pos === c.pos || (t = c, s.dispatch({
|
|
1783
|
-
effects:
|
|
1783
|
+
effects: ge.of({
|
|
1784
1784
|
pos: c.pos,
|
|
1785
1785
|
above: !0,
|
|
1786
1786
|
arrow: !0,
|
|
@@ -1797,7 +1797,7 @@ const Ze = () => {
|
|
|
1797
1797
|
})
|
|
1798
1798
|
}));
|
|
1799
1799
|
}, n = (s) => {
|
|
1800
|
-
t && (t = null, s.dispatch({ effects:
|
|
1800
|
+
t && (t = null, s.dispatch({ effects: ge.of(null) }));
|
|
1801
1801
|
}, i = B.updateListener.of((s) => {
|
|
1802
1802
|
if (s.selectionSet || s.docChanged) {
|
|
1803
1803
|
const c = s.state, d = c.selection.main;
|
|
@@ -1810,16 +1810,16 @@ const Ze = () => {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
});
|
|
1812
1812
|
return [al, i];
|
|
1813
|
-
}, rl = "#e5c07b",
|
|
1813
|
+
}, rl = "#e5c07b", Le = "var(--md-color)", sl = "#56b6c2", il = "#fff", Q = "#3f4a54", Ne = "#2d8cf0", cl = "#2d8cf0", ul = "#3f4a54", Ae = "#d19a66", dl = "#c678dd", ml = "#f6f6f6", bl = "#ceedfa33", De = "var(--md-bk-color)", de = "var(--md-bk-color)", vl = "#bad5fa", Re = "#3f4a54", gl = B.theme(
|
|
1814
1814
|
{
|
|
1815
1815
|
"&": {
|
|
1816
1816
|
color: Q,
|
|
1817
|
-
backgroundColor:
|
|
1817
|
+
backgroundColor: De
|
|
1818
1818
|
},
|
|
1819
1819
|
".cm-content": {
|
|
1820
|
-
caretColor:
|
|
1820
|
+
caretColor: Re
|
|
1821
1821
|
},
|
|
1822
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1822
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: Re },
|
|
1823
1823
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: vl },
|
|
1824
1824
|
".cm-panels": { backgroundColor: ml, color: Q },
|
|
1825
1825
|
".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
|
|
@@ -1837,7 +1837,7 @@ const Ze = () => {
|
|
|
1837
1837
|
backgroundColor: "#bad0f847"
|
|
1838
1838
|
},
|
|
1839
1839
|
".cm-gutters": {
|
|
1840
|
-
backgroundColor:
|
|
1840
|
+
backgroundColor: De,
|
|
1841
1841
|
color: Q,
|
|
1842
1842
|
borderRight: "1px solid",
|
|
1843
1843
|
borderColor: "var(--md-border-color)"
|
|
@@ -1852,7 +1852,7 @@ const Ze = () => {
|
|
|
1852
1852
|
},
|
|
1853
1853
|
".cm-tooltip": {
|
|
1854
1854
|
border: "1px solid var(--md-border-color)",
|
|
1855
|
-
backgroundColor:
|
|
1855
|
+
backgroundColor: de
|
|
1856
1856
|
},
|
|
1857
1857
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1858
1858
|
borderTopColor: "var(--md-border-color)",
|
|
@@ -1860,8 +1860,8 @@ const Ze = () => {
|
|
|
1860
1860
|
borderBottomColor: "var(--md-border-color)"
|
|
1861
1861
|
},
|
|
1862
1862
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
1863
|
-
borderTopColor:
|
|
1864
|
-
borderBottomColor:
|
|
1863
|
+
borderTopColor: de,
|
|
1864
|
+
borderBottomColor: de
|
|
1865
1865
|
},
|
|
1866
1866
|
".cm-tooltip-autocomplete": {
|
|
1867
1867
|
"& > ul > li[aria-selected]": {
|
|
@@ -1872,9 +1872,9 @@ const Ze = () => {
|
|
|
1872
1872
|
// { dark: true }
|
|
1873
1873
|
), hl = Ye.define([
|
|
1874
1874
|
{ tag: b.keyword, color: dl },
|
|
1875
|
-
{ tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color:
|
|
1875
|
+
{ tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color: Le },
|
|
1876
1876
|
{ tag: [b.function(b.variableName), b.labelName], color: cl },
|
|
1877
|
-
{ tag: [b.color, b.constant(b.name), b.standard(b.name)], color:
|
|
1877
|
+
{ tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Ae },
|
|
1878
1878
|
{ tag: [b.definition(b.name), b.separator], color: Q },
|
|
1879
1879
|
{
|
|
1880
1880
|
tag: [
|
|
@@ -1901,28 +1901,28 @@ const Ze = () => {
|
|
|
1901
1901
|
],
|
|
1902
1902
|
color: sl
|
|
1903
1903
|
},
|
|
1904
|
-
{ tag: [b.meta, b.comment], color:
|
|
1904
|
+
{ tag: [b.meta, b.comment], color: Ne },
|
|
1905
1905
|
{ tag: b.strong, fontWeight: "bold" },
|
|
1906
1906
|
{ tag: b.emphasis, fontStyle: "italic" },
|
|
1907
1907
|
{ tag: b.strikethrough, textDecoration: "line-through" },
|
|
1908
|
-
{ tag: b.link, color:
|
|
1909
|
-
{ tag: b.heading, fontWeight: "bold", color:
|
|
1910
|
-
{ tag: [b.atom, b.bool, b.special(b.variableName)], color:
|
|
1908
|
+
{ tag: b.link, color: Ne, textDecoration: "underline" },
|
|
1909
|
+
{ tag: b.heading, fontWeight: "bold", color: Le },
|
|
1910
|
+
{ tag: [b.atom, b.bool, b.special(b.variableName)], color: Ae },
|
|
1911
1911
|
{ tag: [b.processingInstruction, b.string, b.inserted], color: ul },
|
|
1912
1912
|
{ tag: b.invalid, color: il }
|
|
1913
1913
|
]), Me = [
|
|
1914
1914
|
gl,
|
|
1915
1915
|
je(hl)
|
|
1916
|
-
], fl = "#e5c07b",
|
|
1916
|
+
], fl = "#e5c07b", Fe = "var(--md-color)", pl = "#56b6c2", Tl = "#ffffff", ee = "var(--md-color)", Be = "#e5c07b", wl = "#e5c07b", yl = "var(--md-color)", Pe = "#d19a66", Cl = "#c678dd", kl = "#21252b", $l = "#2c313a", He = "var(--md-bk-color)", me = "var(--md-bk-color)", xl = "#ceedfa33", Oe = "#528bff", Sl = B.theme(
|
|
1917
1917
|
{
|
|
1918
1918
|
"&": {
|
|
1919
1919
|
color: ee,
|
|
1920
|
-
backgroundColor:
|
|
1920
|
+
backgroundColor: He
|
|
1921
1921
|
},
|
|
1922
1922
|
".cm-content": {
|
|
1923
|
-
caretColor:
|
|
1923
|
+
caretColor: Oe
|
|
1924
1924
|
},
|
|
1925
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1925
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: Oe },
|
|
1926
1926
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: xl },
|
|
1927
1927
|
".cm-panels": { backgroundColor: kl, color: ee },
|
|
1928
1928
|
".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
|
|
@@ -1940,7 +1940,7 @@ const Ze = () => {
|
|
|
1940
1940
|
backgroundColor: "#bad0f847"
|
|
1941
1941
|
},
|
|
1942
1942
|
".cm-gutters": {
|
|
1943
|
-
backgroundColor:
|
|
1943
|
+
backgroundColor: He,
|
|
1944
1944
|
color: ee,
|
|
1945
1945
|
borderRight: "1px solid",
|
|
1946
1946
|
borderColor: "var(--md-border-color)"
|
|
@@ -1955,7 +1955,7 @@ const Ze = () => {
|
|
|
1955
1955
|
},
|
|
1956
1956
|
".cm-tooltip": {
|
|
1957
1957
|
border: "1px solid var(--md-border-color)",
|
|
1958
|
-
backgroundColor:
|
|
1958
|
+
backgroundColor: me
|
|
1959
1959
|
},
|
|
1960
1960
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1961
1961
|
borderTopColor: "var(--md-border-color)",
|
|
@@ -1963,8 +1963,8 @@ const Ze = () => {
|
|
|
1963
1963
|
borderBottomColor: "var(--md-border-color)"
|
|
1964
1964
|
},
|
|
1965
1965
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
1966
|
-
borderTopColor:
|
|
1967
|
-
borderBottomColor:
|
|
1966
|
+
borderTopColor: me,
|
|
1967
|
+
borderBottomColor: me
|
|
1968
1968
|
},
|
|
1969
1969
|
".cm-tooltip-autocomplete": {
|
|
1970
1970
|
"& > ul > li[aria-selected]": {
|
|
@@ -1975,9 +1975,9 @@ const Ze = () => {
|
|
|
1975
1975
|
{ dark: !0 }
|
|
1976
1976
|
), Il = Ye.define([
|
|
1977
1977
|
{ tag: b.keyword, color: Cl },
|
|
1978
|
-
{ tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color:
|
|
1978
|
+
{ tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color: Fe },
|
|
1979
1979
|
{ tag: [b.function(b.variableName), b.labelName], color: wl },
|
|
1980
|
-
{ tag: [b.color, b.constant(b.name), b.standard(b.name)], color:
|
|
1980
|
+
{ tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Pe },
|
|
1981
1981
|
{ tag: [b.definition(b.name), b.separator], color: ee },
|
|
1982
1982
|
{
|
|
1983
1983
|
tag: [
|
|
@@ -2004,22 +2004,22 @@ const Ze = () => {
|
|
|
2004
2004
|
],
|
|
2005
2005
|
color: pl
|
|
2006
2006
|
},
|
|
2007
|
-
{ tag: [b.meta, b.comment], color:
|
|
2007
|
+
{ tag: [b.meta, b.comment], color: Be },
|
|
2008
2008
|
{ tag: b.strong, fontWeight: "bold" },
|
|
2009
2009
|
{ tag: b.emphasis, fontStyle: "italic" },
|
|
2010
2010
|
{ tag: b.strikethrough, textDecoration: "line-through" },
|
|
2011
|
-
{ tag: b.link, color:
|
|
2012
|
-
{ tag: b.heading, fontWeight: "bold", color:
|
|
2013
|
-
{ tag: [b.atom, b.bool, b.special(b.variableName)], color:
|
|
2011
|
+
{ tag: b.link, color: Be, textDecoration: "underline" },
|
|
2012
|
+
{ tag: b.heading, fontWeight: "bold", color: Fe },
|
|
2013
|
+
{ tag: [b.atom, b.bool, b.special(b.variableName)], color: Pe },
|
|
2014
2014
|
{ tag: [b.processingInstruction, b.string, b.inserted], color: yl },
|
|
2015
2015
|
{ tag: b.invalid, color: Tl }
|
|
2016
|
-
]),
|
|
2016
|
+
]), Ve = [
|
|
2017
2017
|
Sl,
|
|
2018
2018
|
je(Il)
|
|
2019
2019
|
], El = (e, t) => {
|
|
2020
2020
|
const o = r("editorId"), n = (s) => {
|
|
2021
2021
|
s instanceof Promise ? s.then((c) => {
|
|
2022
|
-
h.emit(o,
|
|
2022
|
+
h.emit(o, y, "universal", {
|
|
2023
2023
|
generate() {
|
|
2024
2024
|
return {
|
|
2025
2025
|
targetValue: c
|
|
@@ -2028,7 +2028,7 @@ const Ze = () => {
|
|
|
2028
2028
|
});
|
|
2029
2029
|
}).catch((c) => {
|
|
2030
2030
|
console.error(c);
|
|
2031
|
-
}) : h.emit(o,
|
|
2031
|
+
}) : h.emit(o, y, "universal", {
|
|
2032
2032
|
generate() {
|
|
2033
2033
|
return {
|
|
2034
2034
|
targetValue: s
|
|
@@ -2043,7 +2043,7 @@ const Ze = () => {
|
|
|
2043
2043
|
const { files: g } = s.clipboardData;
|
|
2044
2044
|
h.emit(
|
|
2045
2045
|
o,
|
|
2046
|
-
|
|
2046
|
+
fe,
|
|
2047
2047
|
Array.from(g).filter((p) => /image\/.*/.test(p.type))
|
|
2048
2048
|
), s.preventDefault();
|
|
2049
2049
|
return;
|
|
@@ -2059,7 +2059,7 @@ const Ze = () => {
|
|
|
2059
2059
|
g.map((p) => e.transformImgUrl(p))
|
|
2060
2060
|
).then((p) => {
|
|
2061
2061
|
n(
|
|
2062
|
-
p.reduce((k,
|
|
2062
|
+
p.reduce((k, E, M) => k.replace(g[M], E), c)
|
|
2063
2063
|
);
|
|
2064
2064
|
}).catch((p) => {
|
|
2065
2065
|
console.error(p);
|
|
@@ -2068,7 +2068,7 @@ const Ze = () => {
|
|
|
2068
2068
|
}
|
|
2069
2069
|
if (e.autoDetectCode && s.clipboardData.types.includes("vscode-editor-data")) {
|
|
2070
2070
|
const g = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
|
|
2071
|
-
h.emit(o,
|
|
2071
|
+
h.emit(o, y, "code", {
|
|
2072
2072
|
mode: g.mode,
|
|
2073
2073
|
text: s.clipboardData.getData("text/plain")
|
|
2074
2074
|
}), s.preventDefault();
|
|
@@ -2084,7 +2084,7 @@ const Ze = () => {
|
|
|
2084
2084
|
{
|
|
2085
2085
|
key: "Ctrl-b",
|
|
2086
2086
|
mac: "Cmd-b",
|
|
2087
|
-
run: () => (h.emit(e,
|
|
2087
|
+
run: () => (h.emit(e, y, "bold"), !0)
|
|
2088
2088
|
},
|
|
2089
2089
|
{
|
|
2090
2090
|
key: "Ctrl-d",
|
|
@@ -2096,113 +2096,136 @@ const Ze = () => {
|
|
|
2096
2096
|
key: "Ctrl-s",
|
|
2097
2097
|
mac: "Cmd-s",
|
|
2098
2098
|
run: (L) => (h.emit(e, Ge, L.state.doc.toString()), !0),
|
|
2099
|
-
shift: () => (h.emit(e,
|
|
2099
|
+
shift: () => (h.emit(e, y, "strikeThrough"), !0)
|
|
2100
2100
|
},
|
|
2101
2101
|
{
|
|
2102
2102
|
key: "Ctrl-u",
|
|
2103
2103
|
mac: "Cmd-u",
|
|
2104
2104
|
preventDefault: !0,
|
|
2105
|
-
run: () => (h.emit(e,
|
|
2106
|
-
shift: () => (h.emit(e,
|
|
2105
|
+
run: () => (h.emit(e, y, "underline"), !0),
|
|
2106
|
+
shift: () => (h.emit(e, y, "unorderedList"), !0)
|
|
2107
2107
|
},
|
|
2108
2108
|
{
|
|
2109
2109
|
key: "Ctrl-i",
|
|
2110
2110
|
mac: "Cmd-i",
|
|
2111
2111
|
preventDefault: !0,
|
|
2112
|
-
run: () => (h.emit(e,
|
|
2113
|
-
shift: () => (h.emit(e,
|
|
2112
|
+
run: () => (h.emit(e, y, "italic"), !0),
|
|
2113
|
+
shift: () => (h.emit(e, y, "image"), !0)
|
|
2114
2114
|
},
|
|
2115
2115
|
{
|
|
2116
2116
|
key: "Ctrl-1",
|
|
2117
2117
|
mac: "Cmd-1",
|
|
2118
|
-
run: () => (h.emit(e,
|
|
2118
|
+
run: () => (h.emit(e, y, "h1"), !0)
|
|
2119
2119
|
},
|
|
2120
2120
|
{
|
|
2121
2121
|
key: "Ctrl-2",
|
|
2122
2122
|
mac: "Cmd-2",
|
|
2123
|
-
run: () => (h.emit(e,
|
|
2123
|
+
run: () => (h.emit(e, y, "h2"), !0)
|
|
2124
2124
|
},
|
|
2125
2125
|
{
|
|
2126
2126
|
key: "Ctrl-3",
|
|
2127
2127
|
mac: "Cmd-3",
|
|
2128
|
-
run: () => (h.emit(e,
|
|
2128
|
+
run: () => (h.emit(e, y, "h3"), !0)
|
|
2129
2129
|
},
|
|
2130
2130
|
{
|
|
2131
2131
|
key: "Ctrl-4",
|
|
2132
2132
|
mac: "Cmd-4",
|
|
2133
|
-
run: () => (h.emit(e,
|
|
2133
|
+
run: () => (h.emit(e, y, "h4"), !0)
|
|
2134
2134
|
},
|
|
2135
2135
|
{
|
|
2136
2136
|
key: "Ctrl-5",
|
|
2137
2137
|
mac: "Cmd-5",
|
|
2138
|
-
run: () => (h.emit(e,
|
|
2138
|
+
run: () => (h.emit(e, y, "h5"), !0)
|
|
2139
2139
|
},
|
|
2140
2140
|
{
|
|
2141
2141
|
key: "Ctrl-6",
|
|
2142
2142
|
mac: "Cmd-6",
|
|
2143
|
-
run: () => (h.emit(e,
|
|
2143
|
+
run: () => (h.emit(e, y, "h6"), !0)
|
|
2144
2144
|
},
|
|
2145
2145
|
{
|
|
2146
2146
|
key: "Ctrl-ArrowUp",
|
|
2147
2147
|
mac: "Cmd-ArrowUp",
|
|
2148
|
-
run: () => (h.emit(e,
|
|
2148
|
+
run: () => (h.emit(e, y, "sup"), !0)
|
|
2149
2149
|
},
|
|
2150
2150
|
{
|
|
2151
2151
|
key: "Ctrl-ArrowDown",
|
|
2152
2152
|
mac: "Cmd-ArrowDown",
|
|
2153
|
-
run: () => (h.emit(e,
|
|
2153
|
+
run: () => (h.emit(e, y, "sub"), !0)
|
|
2154
2154
|
},
|
|
2155
2155
|
{
|
|
2156
2156
|
key: "Ctrl-o",
|
|
2157
2157
|
mac: "Cmd-o",
|
|
2158
|
-
run: () => (h.emit(e,
|
|
2158
|
+
run: () => (h.emit(e, y, "orderedList"), !0)
|
|
2159
2159
|
},
|
|
2160
2160
|
{
|
|
2161
2161
|
key: "Ctrl-c",
|
|
2162
2162
|
mac: "Cmd-c",
|
|
2163
|
-
shift: () => (h.emit(e,
|
|
2164
|
-
any(L,
|
|
2165
|
-
return (
|
|
2163
|
+
shift: () => (h.emit(e, y, "code"), !0),
|
|
2164
|
+
any(L, T) {
|
|
2165
|
+
return (T.ctrlKey || T.metaKey) && T.altKey && T.code === "KeyC" ? (h.emit(e, y, "codeRow"), !0) : !1;
|
|
2166
2166
|
}
|
|
2167
2167
|
},
|
|
2168
2168
|
{
|
|
2169
2169
|
key: "Ctrl-l",
|
|
2170
2170
|
mac: "Cmd-l",
|
|
2171
|
-
run: () => (h.emit(e,
|
|
2171
|
+
run: () => (h.emit(e, y, "link"), !0)
|
|
2172
2172
|
},
|
|
2173
2173
|
{
|
|
2174
2174
|
key: "Ctrl-f",
|
|
2175
2175
|
mac: "Cmd-f",
|
|
2176
|
-
shift: () => t.noPrettier ? !1 : (h.emit(e,
|
|
2176
|
+
shift: () => t.noPrettier ? !1 : (h.emit(e, y, "prettier"), !0)
|
|
2177
2177
|
},
|
|
2178
2178
|
{
|
|
2179
|
-
any: (L,
|
|
2179
|
+
any: (L, T) => (T.ctrlKey || T.metaKey) && T.altKey && T.shiftKey && T.code === "KeyT" ? (h.emit(e, y, "table"), !0) : !1
|
|
2180
2180
|
},
|
|
2181
2181
|
...to
|
|
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,
|
|
2183
|
-
`(
|
|
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, Rl = /\/(?!\/)[^\s<>"'`()]+/i, se = new RegExp(
|
|
2183
|
+
`(${Nl.source}|${Al.source}|${Dl.source}|${Rl.source})`,
|
|
2184
2184
|
"gi"
|
|
2185
|
-
),
|
|
2185
|
+
), Ml = /[a-z0-9.+-]/i, Fl = (e) => {
|
|
2186
|
+
const t = [];
|
|
2187
|
+
se.lastIndex = 0;
|
|
2188
|
+
let o;
|
|
2189
|
+
for (; o = se.exec(e); ) {
|
|
2190
|
+
const n = o.index ?? 0, i = n > 0 ? e[n - 1] : "";
|
|
2191
|
+
if (i && Ml.test(i) || i === "<" && e[n] === "/")
|
|
2192
|
+
continue;
|
|
2193
|
+
const c = n + o[0].length;
|
|
2194
|
+
t.push([n, c]);
|
|
2195
|
+
}
|
|
2196
|
+
return t;
|
|
2197
|
+
}, Bl = (e, t, o) => e.some((n) => n.from === t && n.to === o), Pl = (e) => {
|
|
2186
2198
|
const t = e.shortenText || (() => "..."), o = re.define(), n = re.define(), i = (u, v) => {
|
|
2187
2199
|
const m = new Ht(), f = [];
|
|
2188
2200
|
for (let g = 1; g <= u.doc.lines; g++) {
|
|
2189
2201
|
const p = u.doc.line(g), k = p.text;
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2202
|
+
se.lastIndex = 0;
|
|
2203
|
+
const E = e.findTexts?.({
|
|
2204
|
+
state: u,
|
|
2205
|
+
lineText: k,
|
|
2206
|
+
lineNumber: p.number,
|
|
2207
|
+
lineFrom: p.from,
|
|
2208
|
+
lineTo: p.to,
|
|
2209
|
+
defaultTextRegex: se
|
|
2210
|
+
}) ?? Fl(k);
|
|
2211
|
+
for (const M of E) {
|
|
2212
|
+
if (!M) continue;
|
|
2213
|
+
const [A, S] = M;
|
|
2214
|
+
if (typeof A != "number" || typeof S != "number" || A < 0 || S <= A || A >= k.length || S > k.length)
|
|
2215
|
+
continue;
|
|
2216
|
+
const D = k.slice(A, S);
|
|
2217
|
+
if (!D || D.length <= e.maxLength)
|
|
2218
|
+
continue;
|
|
2219
|
+
const L = p.from + A, T = p.from + S;
|
|
2220
|
+
if (Bl(v, L, T)) {
|
|
2221
|
+
f.push({ from: L, to: T });
|
|
2199
2222
|
continue;
|
|
2200
2223
|
}
|
|
2201
|
-
const
|
|
2224
|
+
const R = t(D);
|
|
2202
2225
|
m.add(
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
Wt.replace({ widget: new s(
|
|
2226
|
+
L,
|
|
2227
|
+
T,
|
|
2228
|
+
Wt.replace({ widget: new s(R, D, L, T) })
|
|
2206
2229
|
);
|
|
2207
2230
|
}
|
|
2208
2231
|
}
|
|
@@ -2261,7 +2284,7 @@ const Ze = () => {
|
|
|
2261
2284
|
if (f && v.dom.contains(f)) {
|
|
2262
2285
|
const g = v.posAtDOM(f, 0);
|
|
2263
2286
|
if (g != null && g !== -1 && m.expanded.some(
|
|
2264
|
-
({ from: k, to:
|
|
2287
|
+
({ from: k, to: E }) => g >= k && g <= E
|
|
2265
2288
|
))
|
|
2266
2289
|
return !1;
|
|
2267
2290
|
}
|
|
@@ -2271,33 +2294,33 @@ const Ze = () => {
|
|
|
2271
2294
|
return [c, d];
|
|
2272
2295
|
};
|
|
2273
2296
|
B.EDIT_CONTEXT = !1;
|
|
2274
|
-
const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension,
|
|
2297
|
+
const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension, Hl = (e) => {
|
|
2275
2298
|
const t = Xe(e);
|
|
2276
2299
|
return e.compartment ? e.compartment.of(t) : t;
|
|
2277
|
-
},
|
|
2300
|
+
}, Ol = (e) => {
|
|
2278
2301
|
const t = r("tabWidth"), o = r("editorId"), n = r("theme"), i = r("previewTheme"), s = r("language"), c = r(
|
|
2279
2302
|
"usedLanguageText"
|
|
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"),
|
|
2303
|
+
), d = r("disabled"), u = r("showToolbarName"), v = r("customIcon"), m = r("noUploadImg"), f = r("tableShape"), g = r("noPrettier"), p = r("codeTheme"), k = r("setting"), E = r("updateSetting"), M = r("catalogVisible"), A = r("defToolbars"), S = r("floatingToolbars"), D = r("rootRef"), L = I(), T = kt(), R = I(!1), z = new j(), q = new j(), $ = new j(), Te = new j(), Je = new j(), Qe = Ll(o, {
|
|
2281
2304
|
noPrettier: g
|
|
2282
|
-
}),
|
|
2305
|
+
}), we = () => [
|
|
2283
2306
|
...Qe,
|
|
2284
2307
|
...At,
|
|
2285
2308
|
...Dt,
|
|
2286
|
-
|
|
2309
|
+
Rt
|
|
2287
2310
|
], oe = {
|
|
2288
|
-
paste: El(e,
|
|
2311
|
+
paste: El(e, T),
|
|
2289
2312
|
blur: e.onBlur,
|
|
2290
2313
|
focus: e.onFocus,
|
|
2291
2314
|
drop: e.onDrop,
|
|
2292
2315
|
compositionstart: () => {
|
|
2293
2316
|
R.value = !0;
|
|
2294
2317
|
},
|
|
2295
|
-
compositionend: (
|
|
2318
|
+
compositionend: (w, F) => {
|
|
2296
2319
|
R.value = !1, e.updateModelValue(F.state.doc.toString());
|
|
2297
2320
|
},
|
|
2298
|
-
input: (
|
|
2299
|
-
e.onInput && e.onInput(
|
|
2300
|
-
const { data: F } =
|
|
2321
|
+
input: (w) => {
|
|
2322
|
+
e.onInput && e.onInput(w);
|
|
2323
|
+
const { data: F } = w;
|
|
2301
2324
|
e.maxlength && e.modelValue.length + F.length > e.maxlength && h.emit(o, X, {
|
|
2302
2325
|
name: "overlength",
|
|
2303
2326
|
message: "The input text is too long",
|
|
@@ -2305,13 +2328,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2305
2328
|
});
|
|
2306
2329
|
}
|
|
2307
2330
|
}, et = nl({
|
|
2308
|
-
privide(
|
|
2309
|
-
|
|
2331
|
+
privide(w) {
|
|
2332
|
+
w.provide("editorId", o), w.provide("theme", n), w.provide("previewTheme", i), w.provide("language", s), w.provide("disabled", d), w.provide("noUploadImg", m), w.provide("tableShape", f), w.provide("noPrettier", g), w.provide("codeTheme", p), w.provide("showToolbarName", u), w.provide("setting", k), w.provide("updateSetting", E), w.provide("usedLanguageText", c), w.provide("catalogVisible", M), w.provide("defToolbars", A), w.provide("tabWidth", t), w.provide("customIcon", v), w.provide("floatingToolbars", S), w.provide("rootRef", D);
|
|
2310
2333
|
}
|
|
2311
2334
|
}), tt = [
|
|
2312
2335
|
{
|
|
2313
2336
|
type: "theme",
|
|
2314
|
-
extension: ({ theme:
|
|
2337
|
+
extension: ({ theme: w }) => w.value === "light" ? Me : Ve,
|
|
2315
2338
|
compartment: z,
|
|
2316
2339
|
options: {
|
|
2317
2340
|
theme: n
|
|
@@ -2319,26 +2342,26 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2319
2342
|
},
|
|
2320
2343
|
{
|
|
2321
2344
|
type: "updateListener",
|
|
2322
|
-
extension: B.updateListener.of((
|
|
2323
|
-
|
|
2345
|
+
extension: B.updateListener.of((w) => {
|
|
2346
|
+
w.docChanged && (e.onChange(w.state.doc.toString()), R.value || e.updateModelValue(w.state.doc.toString()));
|
|
2324
2347
|
})
|
|
2325
2348
|
},
|
|
2326
2349
|
{
|
|
2327
2350
|
type: "domEventHandlers",
|
|
2328
2351
|
extension: B.domEventHandlers(oe),
|
|
2329
|
-
compartment:
|
|
2352
|
+
compartment: Te
|
|
2330
2353
|
},
|
|
2331
2354
|
{
|
|
2332
2355
|
type: "completions",
|
|
2333
|
-
extension:
|
|
2356
|
+
extension: Ee(e.completions),
|
|
2334
2357
|
compartment: q
|
|
2335
2358
|
},
|
|
2336
2359
|
{
|
|
2337
2360
|
type: "history",
|
|
2338
|
-
extension:
|
|
2361
|
+
extension: $e(),
|
|
2339
2362
|
compartment: $
|
|
2340
2363
|
}
|
|
2341
|
-
],
|
|
2364
|
+
], ye = Z.codeMirrorExtensions(
|
|
2342
2365
|
[
|
|
2343
2366
|
// 横向换行
|
|
2344
2367
|
{
|
|
@@ -2347,7 +2370,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2347
2370
|
},
|
|
2348
2371
|
{
|
|
2349
2372
|
type: "keymap",
|
|
2350
|
-
extension: zt.of(
|
|
2373
|
+
extension: zt.of(we())
|
|
2351
2374
|
},
|
|
2352
2375
|
// 解决多行placeholder时,光标异常的情况
|
|
2353
2376
|
{
|
|
@@ -2360,71 +2383,71 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2360
2383
|
},
|
|
2361
2384
|
{
|
|
2362
2385
|
type: "linkShortener",
|
|
2363
|
-
extension: (
|
|
2386
|
+
extension: (w) => Pl(w),
|
|
2364
2387
|
options: {
|
|
2365
2388
|
maxLength: 30
|
|
2366
2389
|
}
|
|
2367
2390
|
},
|
|
2368
2391
|
{
|
|
2369
2392
|
type: "floatingToolbar",
|
|
2370
|
-
extension:
|
|
2393
|
+
extension: S.value.length > 0 ? et : [],
|
|
2371
2394
|
compartment: Je
|
|
2372
2395
|
}
|
|
2373
2396
|
],
|
|
2374
2397
|
{
|
|
2375
2398
|
editorId: o,
|
|
2376
2399
|
theme: n.value,
|
|
2377
|
-
keyBindings:
|
|
2400
|
+
keyBindings: we()
|
|
2378
2401
|
}
|
|
2379
|
-
), ot = () => [...tt, ...
|
|
2402
|
+
), ot = () => [...tt, ...ye].map(Hl);
|
|
2380
2403
|
return K(() => {
|
|
2381
|
-
const
|
|
2404
|
+
const w = new B({
|
|
2382
2405
|
doc: e.modelValue,
|
|
2383
2406
|
parent: L.value,
|
|
2384
2407
|
extensions: ot()
|
|
2385
|
-
}), F = new go(
|
|
2386
|
-
|
|
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 &&
|
|
2408
|
+
}), F = new go(w);
|
|
2409
|
+
T.value = F, setTimeout(() => {
|
|
2410
|
+
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 && w.focus();
|
|
2388
2411
|
}, 0), h.on(o, {
|
|
2389
2412
|
name: Ke,
|
|
2390
2413
|
callback() {
|
|
2391
|
-
|
|
2414
|
+
Mt(w);
|
|
2392
2415
|
}
|
|
2393
2416
|
}), h.on(o, {
|
|
2394
2417
|
name: Ue,
|
|
2395
2418
|
callback() {
|
|
2396
|
-
Ft(
|
|
2419
|
+
Ft(w);
|
|
2397
2420
|
}
|
|
2398
2421
|
}), h.on(o, {
|
|
2399
|
-
name:
|
|
2422
|
+
name: y,
|
|
2400
2423
|
async callback(O, H = {}) {
|
|
2401
2424
|
if (O === "image" && H.transform) {
|
|
2402
2425
|
const V = e.transformImgUrl(H.url);
|
|
2403
2426
|
if (V instanceof Promise)
|
|
2404
2427
|
V.then(async (_) => {
|
|
2405
|
-
const { text: W, options: J } = await
|
|
2428
|
+
const { text: W, options: J } = await ue(
|
|
2406
2429
|
O,
|
|
2407
|
-
|
|
2430
|
+
T.value,
|
|
2408
2431
|
{ ...H, url: _ }
|
|
2409
2432
|
);
|
|
2410
|
-
|
|
2433
|
+
T.value?.replaceSelectedText(W, J, o);
|
|
2411
2434
|
}).catch((_) => {
|
|
2412
2435
|
console.error(_);
|
|
2413
2436
|
});
|
|
2414
2437
|
else {
|
|
2415
|
-
const { text: _, options: W } = await
|
|
2438
|
+
const { text: _, options: W } = await ue(O, T.value, {
|
|
2416
2439
|
...H,
|
|
2417
2440
|
url: V
|
|
2418
2441
|
});
|
|
2419
|
-
|
|
2442
|
+
T.value?.replaceSelectedText(_, W, o);
|
|
2420
2443
|
}
|
|
2421
2444
|
} else {
|
|
2422
|
-
const { text: V, options: _ } = await
|
|
2445
|
+
const { text: V, options: _ } = await ue(
|
|
2423
2446
|
O,
|
|
2424
|
-
|
|
2447
|
+
T.value,
|
|
2425
2448
|
H
|
|
2426
2449
|
);
|
|
2427
|
-
|
|
2450
|
+
T.value?.replaceSelectedText(V, _, o);
|
|
2428
2451
|
}
|
|
2429
2452
|
}
|
|
2430
2453
|
}), h.on(o, {
|
|
@@ -2433,12 +2456,12 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2433
2456
|
const H = { ...oe }, V = Object.keys(oe);
|
|
2434
2457
|
for (const _ in O) {
|
|
2435
2458
|
const W = _;
|
|
2436
|
-
V.includes(W) ? H[W] = (J,
|
|
2437
|
-
O[W](J,
|
|
2459
|
+
V.includes(W) ? H[W] = (J, Ce) => {
|
|
2460
|
+
O[W](J, Ce), J.defaultPrevented || oe[W](J, Ce);
|
|
2438
2461
|
} : H[W] = O[W];
|
|
2439
2462
|
}
|
|
2440
|
-
|
|
2441
|
-
effects:
|
|
2463
|
+
T.value?.view.dispatch({
|
|
2464
|
+
effects: Te.reconfigure(
|
|
2442
2465
|
B.domEventHandlers(H)
|
|
2443
2466
|
)
|
|
2444
2467
|
});
|
|
@@ -2446,74 +2469,74 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2446
2469
|
}), h.on(o, {
|
|
2447
2470
|
name: jt,
|
|
2448
2471
|
callback: (O, H) => {
|
|
2449
|
-
const V =
|
|
2450
|
-
|
|
2451
|
-
|
|
2472
|
+
const V = w.state.doc.line(O);
|
|
2473
|
+
w.dispatch(
|
|
2474
|
+
w.state.update({ changes: { from: V.from, to: V.to, insert: H } })
|
|
2452
2475
|
);
|
|
2453
2476
|
}
|
|
2454
2477
|
}), h.on(o, {
|
|
2455
2478
|
name: Yt,
|
|
2456
2479
|
callback() {
|
|
2457
|
-
h.emit(o,
|
|
2480
|
+
h.emit(o, xe, w);
|
|
2458
2481
|
}
|
|
2459
|
-
}), h.emit(o,
|
|
2482
|
+
}), h.emit(o, xe, w);
|
|
2460
2483
|
}), N(
|
|
2461
2484
|
n,
|
|
2462
2485
|
() => {
|
|
2463
|
-
|
|
2464
|
-
effects: z.reconfigure(n.value === "light" ? Me :
|
|
2486
|
+
T.value?.view.dispatch({
|
|
2487
|
+
effects: z.reconfigure(n.value === "light" ? Me : Ve)
|
|
2465
2488
|
});
|
|
2466
2489
|
},
|
|
2467
2490
|
{ deep: !0 }
|
|
2468
2491
|
), N(
|
|
2469
2492
|
() => e.completions,
|
|
2470
2493
|
() => {
|
|
2471
|
-
|
|
2472
|
-
effects: q.reconfigure(
|
|
2494
|
+
T.value?.view.dispatch({
|
|
2495
|
+
effects: q.reconfigure(Ee(e.completions))
|
|
2473
2496
|
});
|
|
2474
2497
|
},
|
|
2475
2498
|
{ deep: !0 }
|
|
2476
2499
|
), N(
|
|
2477
2500
|
() => e.modelValue,
|
|
2478
2501
|
() => {
|
|
2479
|
-
|
|
2502
|
+
T.value?.getValue() !== e.modelValue && T.value?.setValue(e.modelValue);
|
|
2480
2503
|
}
|
|
2481
2504
|
), N(
|
|
2482
2505
|
() => e.placeholder,
|
|
2483
2506
|
() => {
|
|
2484
|
-
|
|
2507
|
+
T.value?.setPlaceholder(e.placeholder);
|
|
2485
2508
|
}
|
|
2486
2509
|
), N([d], () => {
|
|
2487
|
-
|
|
2510
|
+
T.value?.setDisabled(d.value);
|
|
2488
2511
|
}), N(
|
|
2489
2512
|
() => e.readonly,
|
|
2490
2513
|
() => {
|
|
2491
|
-
|
|
2514
|
+
T.value?.setDisabled(e.readonly);
|
|
2492
2515
|
}
|
|
2493
2516
|
), N(
|
|
2494
2517
|
() => e.maxlength,
|
|
2495
2518
|
() => {
|
|
2496
|
-
e.maxlength &&
|
|
2519
|
+
e.maxlength && T.value?.setMaxLength(e.maxlength);
|
|
2497
2520
|
}
|
|
2498
2521
|
), fo(() => {
|
|
2499
|
-
const
|
|
2522
|
+
const w = ye.find(
|
|
2500
2523
|
(F) => F.type === "floatingToolbar"
|
|
2501
2524
|
);
|
|
2502
|
-
|
|
2503
|
-
effects:
|
|
2504
|
-
Xe(
|
|
2525
|
+
w?.compartment && (S.value.length > 0 ? T.value?.view.dispatch({
|
|
2526
|
+
effects: w.compartment.reconfigure(
|
|
2527
|
+
Xe(w)
|
|
2505
2528
|
)
|
|
2506
|
-
}) :
|
|
2507
|
-
effects:
|
|
2529
|
+
}) : T.value?.view.dispatch({
|
|
2530
|
+
effects: w.compartment.reconfigure([])
|
|
2508
2531
|
}));
|
|
2509
|
-
},
|
|
2532
|
+
}, S), {
|
|
2510
2533
|
inputWrapperRef: L,
|
|
2511
|
-
codeMirrorUt:
|
|
2534
|
+
codeMirrorUt: T,
|
|
2512
2535
|
resetHistory() {
|
|
2513
|
-
|
|
2536
|
+
T.value?.view.dispatch({ effects: $.reconfigure([]) }), T.value?.view.dispatch({ effects: $.reconfigure($e()) });
|
|
2514
2537
|
}
|
|
2515
2538
|
};
|
|
2516
|
-
},
|
|
2539
|
+
}, Vl = (e, t, o) => {
|
|
2517
2540
|
const n = r("setting"), i = P(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = Y({
|
|
2518
2541
|
resizedWidth: i.value
|
|
2519
2542
|
}), c = Y({
|
|
@@ -2525,8 +2548,8 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2525
2548
|
const g = t.value?.offsetWidth || 0, p = t.value?.getBoundingClientRect().x || 0;
|
|
2526
2549
|
let k = f.x - p;
|
|
2527
2550
|
k / g < le ? k = g * le : k > g - g * le && (k = g - g * le);
|
|
2528
|
-
const
|
|
2529
|
-
c.width =
|
|
2551
|
+
const E = `${k / g * 100}%`;
|
|
2552
|
+
c.width = E, d.left = E, s.resizedWidth = E, e.oninputBoxWidthChange?.(E);
|
|
2530
2553
|
}, v = (f) => {
|
|
2531
2554
|
f.target === o.value && document.addEventListener("mousemove", u);
|
|
2532
2555
|
}, m = () => {
|
|
@@ -2536,7 +2559,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2536
2559
|
document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m), document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
|
|
2537
2560
|
}), K(() => {
|
|
2538
2561
|
document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
|
|
2539
|
-
}),
|
|
2562
|
+
}), he(() => {
|
|
2540
2563
|
document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m);
|
|
2541
2564
|
}), N([i], ([f]) => {
|
|
2542
2565
|
s.resizedWidth = f, c.width = f, d.left = f;
|
|
@@ -2556,8 +2579,8 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2556
2579
|
inputWrapperStyle: c,
|
|
2557
2580
|
resizeOperateStyle: d
|
|
2558
2581
|
};
|
|
2559
|
-
},
|
|
2560
|
-
const e = r("editorId"), t =
|
|
2582
|
+
}, Wl = () => {
|
|
2583
|
+
const e = r("editorId"), t = I(!0), o = ze();
|
|
2561
2584
|
return {
|
|
2562
2585
|
onCatalogActive: (c, d) => {
|
|
2563
2586
|
const u = document.querySelector(
|
|
@@ -2571,7 +2594,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2571
2594
|
onMouseenter: () => t.value = !1,
|
|
2572
2595
|
onMouseleave: () => t.value = !0
|
|
2573
2596
|
};
|
|
2574
|
-
},
|
|
2597
|
+
}, be = /* @__PURE__ */ C({
|
|
2575
2598
|
name: `${xt}CustomScrollbar`,
|
|
2576
2599
|
props: {
|
|
2577
2600
|
id: {
|
|
@@ -2610,44 +2633,44 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2610
2633
|
setup(e, {
|
|
2611
2634
|
slots: t
|
|
2612
2635
|
}) {
|
|
2613
|
-
const o =
|
|
2636
|
+
const o = I(null), n = I(null), i = I(null), s = I(null);
|
|
2614
2637
|
let c = null, d = null, u = !1, v = 0, m = 0;
|
|
2615
2638
|
const f = () => {
|
|
2616
2639
|
if (!n.value || !o.value || !i.value || !s.value) return;
|
|
2617
|
-
const
|
|
2618
|
-
if (
|
|
2640
|
+
const S = o.value.clientHeight, D = n.value.scrollHeight, L = n.value.scrollTop;
|
|
2641
|
+
if (D <= S) {
|
|
2619
2642
|
i.value.style.display = "none", e.alwaysShowTrack || (s.value.style.display = "none");
|
|
2620
2643
|
return;
|
|
2621
2644
|
} else
|
|
2622
2645
|
i.value.style.display = "block", s.value.style.display = "block";
|
|
2623
|
-
const
|
|
2646
|
+
const T = S / D, R = Math.max(S * T, 20), z = S - R, q = Math.min(L * T, z);
|
|
2624
2647
|
i.value.style.height = `${R}px`, i.value.style.top = `${q}px`;
|
|
2625
|
-
}, g = () => f(), p = (
|
|
2626
|
-
u = !0, v =
|
|
2627
|
-
}, k = (
|
|
2648
|
+
}, g = () => f(), p = (S) => {
|
|
2649
|
+
u = !0, v = S.clientY, m = n.value.scrollTop, document.body.style.userSelect = "none";
|
|
2650
|
+
}, k = (S) => {
|
|
2628
2651
|
if (!u || !n.value || !o.value) return;
|
|
2629
|
-
const
|
|
2630
|
-
n.value.scrollTop = m +
|
|
2631
|
-
},
|
|
2652
|
+
const D = S.clientY - v, L = n.value.scrollHeight / o.value.clientHeight;
|
|
2653
|
+
n.value.scrollTop = m + D * L;
|
|
2654
|
+
}, E = () => {
|
|
2632
2655
|
u = !1, document.body.style.userSelect = "";
|
|
2633
|
-
},
|
|
2634
|
-
n.value && n.value.removeEventListener("scroll", g), n.value =
|
|
2635
|
-
},
|
|
2656
|
+
}, M = (S) => {
|
|
2657
|
+
n.value && n.value.removeEventListener("scroll", g), n.value = S, n.value ? (n.value.addEventListener("scroll", g), f()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
|
|
2658
|
+
}, A = () => {
|
|
2636
2659
|
if (!o.value) return;
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2660
|
+
const S = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
|
|
2661
|
+
M(S);
|
|
2639
2662
|
};
|
|
2640
2663
|
return K(async () => {
|
|
2641
|
-
await
|
|
2664
|
+
await ie(), A(), c = new MutationObserver(() => {
|
|
2642
2665
|
d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
2643
|
-
|
|
2666
|
+
A();
|
|
2644
2667
|
});
|
|
2645
2668
|
}), c.observe(o.value, {
|
|
2646
2669
|
childList: !0,
|
|
2647
2670
|
subtree: !0
|
|
2648
|
-
}), window.addEventListener("resize", f), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", k), document.addEventListener("mouseup",
|
|
2649
|
-
}),
|
|
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",
|
|
2671
|
+
}), window.addEventListener("resize", f), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", k), document.addEventListener("mouseup", E);
|
|
2672
|
+
}), he(() => {
|
|
2673
|
+
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", E);
|
|
2651
2674
|
}), () => l("div", {
|
|
2652
2675
|
id: e.id,
|
|
2653
2676
|
class: [`${a}-custom-scrollbar`, e.class],
|
|
@@ -2662,35 +2685,35 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2662
2685
|
ref: i
|
|
2663
2686
|
}, null)])]);
|
|
2664
2687
|
}
|
|
2665
|
-
}),
|
|
2688
|
+
}), _l = ze(), zl = {
|
|
2666
2689
|
flex: 1
|
|
2667
|
-
},
|
|
2690
|
+
}, ql = /* @__PURE__ */ C({
|
|
2668
2691
|
name: "MDEditorContent",
|
|
2669
2692
|
props: st,
|
|
2670
2693
|
setup(e, t) {
|
|
2671
|
-
const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c =
|
|
2694
|
+
const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = I(""), d = I(), u = I(), {
|
|
2672
2695
|
inputWrapperRef: v,
|
|
2673
2696
|
codeMirrorUt: m,
|
|
2674
2697
|
resetHistory: f
|
|
2675
|
-
} =
|
|
2698
|
+
} = Ol(e), {
|
|
2676
2699
|
inputWrapperStyle: g,
|
|
2677
2700
|
resizeOperateStyle: p
|
|
2678
|
-
} =
|
|
2701
|
+
} = Vl(e, d, u);
|
|
2679
2702
|
oo(e, c, m);
|
|
2680
2703
|
const {
|
|
2681
2704
|
onCatalogActive: k,
|
|
2682
|
-
onMouseenter:
|
|
2683
|
-
onMouseleave:
|
|
2684
|
-
} =
|
|
2685
|
-
if (!s.value.preview &&
|
|
2705
|
+
onMouseenter: E,
|
|
2706
|
+
onMouseleave: M
|
|
2707
|
+
} = Wl(), A = (L, T) => {
|
|
2708
|
+
if (!s.value.preview && T.line !== void 0) {
|
|
2686
2709
|
L.preventDefault();
|
|
2687
2710
|
const R = m.value?.view;
|
|
2688
2711
|
if (R) {
|
|
2689
|
-
const z = R.state.doc.line(
|
|
2690
|
-
|
|
2712
|
+
const z = R.state.doc.line(T.line + 1), q = R.lineBlockAt(z.from)?.top, $ = R.scrollDOM;
|
|
2713
|
+
_l($, q);
|
|
2691
2714
|
}
|
|
2692
2715
|
}
|
|
2693
|
-
},
|
|
2716
|
+
}, S = P(() => s.value.preview ? "preview" : "editor"), D = (L) => {
|
|
2694
2717
|
c.value = L, e.onHtmlChanged(L);
|
|
2695
2718
|
};
|
|
2696
2719
|
return t.expose({
|
|
@@ -2709,7 +2732,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2709
2732
|
}, [l("div", {
|
|
2710
2733
|
class: `${a}-content-wrapper`,
|
|
2711
2734
|
ref: d
|
|
2712
|
-
}, [l(
|
|
2735
|
+
}, [l(be, {
|
|
2713
2736
|
alwaysShowTrack: !0,
|
|
2714
2737
|
scrollTarget: `#${o} .cm-scroller`,
|
|
2715
2738
|
style: g
|
|
@@ -2722,13 +2745,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2722
2745
|
class: `${a}-resize-operate`,
|
|
2723
2746
|
style: p,
|
|
2724
2747
|
ref: u
|
|
2725
|
-
}, null), l(
|
|
2726
|
-
style:
|
|
2748
|
+
}, null), l(be, {
|
|
2749
|
+
style: zl
|
|
2727
2750
|
}, {
|
|
2728
2751
|
default: () => [l(it, {
|
|
2729
2752
|
modelValue: e.modelValue,
|
|
2730
2753
|
onChange: e.onChange,
|
|
2731
|
-
onHtmlChanged:
|
|
2754
|
+
onHtmlChanged: D,
|
|
2732
2755
|
onGetCatalog: e.onGetCatalog,
|
|
2733
2756
|
mdHeadingId: e.mdHeadingId,
|
|
2734
2757
|
noMermaid: e.noMermaid,
|
|
@@ -2744,10 +2767,10 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2744
2767
|
previewComponent: e.previewComponent,
|
|
2745
2768
|
noEcharts: e.noEcharts
|
|
2746
2769
|
}, null)]
|
|
2747
|
-
})]), n.value && l(
|
|
2770
|
+
})]), n.value && l(be, {
|
|
2748
2771
|
class: `${a}-catalog-${e.catalogLayout}`,
|
|
2749
|
-
onMouseenter:
|
|
2750
|
-
onMouseleave:
|
|
2772
|
+
onMouseenter: E,
|
|
2773
|
+
onMouseleave: M
|
|
2751
2774
|
}, {
|
|
2752
2775
|
default: () => [l(We, {
|
|
2753
2776
|
theme: i.value,
|
|
@@ -2756,14 +2779,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2756
2779
|
mdHeadingId: e.mdHeadingId,
|
|
2757
2780
|
key: "internal-catalog",
|
|
2758
2781
|
scrollElementOffsetTop: 2,
|
|
2759
|
-
syncWith:
|
|
2760
|
-
onClick:
|
|
2782
|
+
syncWith: S.value,
|
|
2783
|
+
onClick: A,
|
|
2761
2784
|
catalogMaxDepth: e.catalogMaxDepth,
|
|
2762
2785
|
onActive: k
|
|
2763
2786
|
}, null)]
|
|
2764
2787
|
})]);
|
|
2765
2788
|
}
|
|
2766
|
-
}),
|
|
2789
|
+
}), Ul = /* @__PURE__ */ C({
|
|
2767
2790
|
props: {
|
|
2768
2791
|
modelValue: {
|
|
2769
2792
|
type: String,
|
|
@@ -2778,7 +2801,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2778
2801
|
class: `${a}-footer-label`
|
|
2779
2802
|
}, [`${t.value.footer?.markdownTotal}:`]), l("span", null, [e.modelValue?.length || 0])]);
|
|
2780
2803
|
}
|
|
2781
|
-
}),
|
|
2804
|
+
}), Kl = {
|
|
2782
2805
|
checked: {
|
|
2783
2806
|
type: Boolean,
|
|
2784
2807
|
default: !1
|
|
@@ -2792,9 +2815,9 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2792
2815
|
type: Boolean,
|
|
2793
2816
|
default: void 0
|
|
2794
2817
|
}
|
|
2795
|
-
},
|
|
2818
|
+
}, Gl = /* @__PURE__ */ C({
|
|
2796
2819
|
name: `${a}-checkbox`,
|
|
2797
|
-
props:
|
|
2820
|
+
props: Kl,
|
|
2798
2821
|
setup(e) {
|
|
2799
2822
|
return () => l("div", {
|
|
2800
2823
|
class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`, e.disabled && `${a}-disabled`],
|
|
@@ -2803,7 +2826,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2803
2826
|
}
|
|
2804
2827
|
}, null);
|
|
2805
2828
|
}
|
|
2806
|
-
}),
|
|
2829
|
+
}), jl = {
|
|
2807
2830
|
scrollAuto: {
|
|
2808
2831
|
type: Boolean
|
|
2809
2832
|
},
|
|
@@ -2812,8 +2835,8 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2812
2835
|
default: () => {
|
|
2813
2836
|
}
|
|
2814
2837
|
}
|
|
2815
|
-
},
|
|
2816
|
-
props:
|
|
2838
|
+
}, Yl = /* @__PURE__ */ C({
|
|
2839
|
+
props: jl,
|
|
2817
2840
|
setup(e) {
|
|
2818
2841
|
const t = r("usedLanguageText"), o = r("disabled");
|
|
2819
2842
|
return () => l("div", {
|
|
@@ -2823,13 +2846,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2823
2846
|
onClick: () => {
|
|
2824
2847
|
o?.value || e.onScrollAutoChange(!e.scrollAuto);
|
|
2825
2848
|
}
|
|
2826
|
-
}, [t?.value.footer?.scrollAuto]), l(
|
|
2849
|
+
}, [t?.value.footer?.scrollAuto]), l(Gl, {
|
|
2827
2850
|
checked: e.scrollAuto,
|
|
2828
2851
|
onChange: e.onScrollAutoChange,
|
|
2829
2852
|
disabled: o?.value
|
|
2830
2853
|
}, null)]);
|
|
2831
2854
|
}
|
|
2832
|
-
}),
|
|
2855
|
+
}), Zl = {
|
|
2833
2856
|
modelValue: {
|
|
2834
2857
|
type: String,
|
|
2835
2858
|
default: ""
|
|
@@ -2852,9 +2875,9 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2852
2875
|
defFooters: {
|
|
2853
2876
|
type: Object
|
|
2854
2877
|
}
|
|
2855
|
-
},
|
|
2878
|
+
}, Xl = /* @__PURE__ */ C({
|
|
2856
2879
|
name: "MDEditorFooter",
|
|
2857
|
-
props:
|
|
2880
|
+
props: Zl,
|
|
2858
2881
|
setup(e) {
|
|
2859
2882
|
const t = r("theme"), o = r("language"), n = r("disabled"), i = P(() => {
|
|
2860
2883
|
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);
|
|
@@ -2863,11 +2886,11 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2863
2886
|
if (St.includes(c))
|
|
2864
2887
|
switch (c) {
|
|
2865
2888
|
case "markdownTotal":
|
|
2866
|
-
return l(
|
|
2889
|
+
return l(Ul, {
|
|
2867
2890
|
modelValue: e.modelValue
|
|
2868
2891
|
}, null);
|
|
2869
2892
|
case "scrollSwitch":
|
|
2870
|
-
return !e.noScrollAuto && l(
|
|
2893
|
+
return !e.noScrollAuto && l(Yl, {
|
|
2871
2894
|
scrollAuto: e.scrollAuto,
|
|
2872
2895
|
onScrollAutoChange: e.onScrollAutoChange
|
|
2873
2896
|
}, null);
|
|
@@ -2900,7 +2923,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2900
2923
|
}, [d])]);
|
|
2901
2924
|
};
|
|
2902
2925
|
}
|
|
2903
|
-
}),
|
|
2926
|
+
}), Jl = {
|
|
2904
2927
|
// 工具栏选择显示
|
|
2905
2928
|
toolbars: {
|
|
2906
2929
|
type: Array,
|
|
@@ -2911,18 +2934,18 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2911
2934
|
type: Array,
|
|
2912
2935
|
default: () => []
|
|
2913
2936
|
}
|
|
2914
|
-
},
|
|
2937
|
+
}, Ql = /* @__PURE__ */ C({
|
|
2915
2938
|
name: "MDEditorToolbar",
|
|
2916
|
-
props:
|
|
2939
|
+
props: Jl,
|
|
2917
2940
|
setup(e) {
|
|
2918
|
-
const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i =
|
|
2941
|
+
const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = I(), s = I(), {
|
|
2919
2942
|
barRender: c
|
|
2920
2943
|
} = Ze(), d = P(() => {
|
|
2921
2944
|
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
2945
|
return [m, f];
|
|
2923
2946
|
});
|
|
2924
2947
|
return N(() => e.toolbars, () => {
|
|
2925
|
-
|
|
2948
|
+
ie(() => {
|
|
2926
2949
|
i.value && Lt(i.value);
|
|
2927
2950
|
});
|
|
2928
2951
|
}, {
|
|
@@ -2943,7 +2966,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2943
2966
|
}, [v])])])]);
|
|
2944
2967
|
};
|
|
2945
2968
|
}
|
|
2946
|
-
}),
|
|
2969
|
+
}), ve = /* @__PURE__ */ C({
|
|
2947
2970
|
name: "MdEditorV3",
|
|
2948
2971
|
props: ut,
|
|
2949
2972
|
emits: ct,
|
|
@@ -2954,10 +2977,10 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2954
2977
|
noHighlight: i
|
|
2955
2978
|
} = e, s = Y({
|
|
2956
2979
|
scrollAuto: e.scrollAuto
|
|
2957
|
-
}), c =
|
|
2980
|
+
}), c = I(), d = I(), u = P(() => Se({
|
|
2958
2981
|
props: e,
|
|
2959
2982
|
ctx: t
|
|
2960
|
-
}, "defToolbars")), v = P(() =>
|
|
2983
|
+
}, "defToolbars")), v = P(() => Se({
|
|
2961
2984
|
props: e,
|
|
2962
2985
|
ctx: t
|
|
2963
2986
|
}, "defFooters")), m = dt(e), [f, g] = mt(e, t, {
|
|
@@ -2982,24 +3005,24 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
2982
3005
|
updateSetting: g,
|
|
2983
3006
|
catalogVisible: p,
|
|
2984
3007
|
defToolbars: u
|
|
2985
|
-
}),
|
|
3008
|
+
}), he(() => {
|
|
2986
3009
|
h.clear(m);
|
|
2987
3010
|
});
|
|
2988
3011
|
const k = ($) => {
|
|
2989
3012
|
t.emit("update:modelValue", $);
|
|
2990
|
-
},
|
|
3013
|
+
}, E = ($) => {
|
|
2991
3014
|
e.onChange?.($), t.emit("onChange", $);
|
|
2992
|
-
},
|
|
3015
|
+
}, M = ($) => {
|
|
2993
3016
|
e.onHtmlChanged?.($), t.emit("onHtmlChanged", $);
|
|
2994
|
-
},
|
|
3017
|
+
}, A = ($) => {
|
|
2995
3018
|
e.onGetCatalog?.($), t.emit("onGetCatalog", $);
|
|
2996
|
-
},
|
|
3019
|
+
}, S = ($) => {
|
|
2997
3020
|
e.onBlur?.($), t.emit("onBlur", $);
|
|
2998
|
-
},
|
|
3021
|
+
}, D = ($) => {
|
|
2999
3022
|
e.onFocus?.($), t.emit("onFocus", $);
|
|
3000
3023
|
}, L = ($) => {
|
|
3001
3024
|
e.onInput?.($), t.emit("onInput", $);
|
|
3002
|
-
},
|
|
3025
|
+
}, T = ($) => {
|
|
3003
3026
|
e.onDrop?.($), t.emit("onDrop", $);
|
|
3004
3027
|
}, R = ($) => {
|
|
3005
3028
|
e.oninputBoxWidthChange?.($), t.emit("oninputBoxWidthChange", $);
|
|
@@ -3013,10 +3036,10 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
3013
3036
|
class: [a, e.class, e.theme === "dark" && `${a}-dark`, f.fullscreen || f.pageFullscreen ? `${a}-fullscreen` : ""],
|
|
3014
3037
|
style: e.style,
|
|
3015
3038
|
ref: c
|
|
3016
|
-
}, [e.toolbars.length > 0 && l(
|
|
3039
|
+
}, [e.toolbars.length > 0 && l(Ql, {
|
|
3017
3040
|
toolbars: e.toolbars,
|
|
3018
3041
|
toolbarsExclude: e.toolbarsExclude
|
|
3019
|
-
}, null), l(
|
|
3042
|
+
}, null), l(ql, {
|
|
3020
3043
|
ref: d,
|
|
3021
3044
|
modelValue: e.modelValue,
|
|
3022
3045
|
mdHeadingId: e.mdHeadingId,
|
|
@@ -3032,15 +3055,15 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
3032
3055
|
autoDetectCode: e.autoDetectCode,
|
|
3033
3056
|
noHighlight: i,
|
|
3034
3057
|
updateModelValue: k,
|
|
3035
|
-
onChange:
|
|
3036
|
-
onHtmlChanged:
|
|
3037
|
-
onGetCatalog:
|
|
3038
|
-
onBlur:
|
|
3039
|
-
onFocus:
|
|
3058
|
+
onChange: E,
|
|
3059
|
+
onHtmlChanged: M,
|
|
3060
|
+
onGetCatalog: A,
|
|
3061
|
+
onBlur: S,
|
|
3062
|
+
onFocus: D,
|
|
3040
3063
|
onInput: L,
|
|
3041
3064
|
completions: e.completions,
|
|
3042
3065
|
noImgZoomIn: e.noImgZoomIn,
|
|
3043
|
-
onDrop:
|
|
3066
|
+
onDrop: T,
|
|
3044
3067
|
inputBoxWidth: e.inputBoxWidth,
|
|
3045
3068
|
oninputBoxWidthChange: R,
|
|
3046
3069
|
sanitizeMermaid: e.sanitizeMermaid,
|
|
@@ -3052,7 +3075,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
3052
3075
|
catalogMaxDepth: e.catalogMaxDepth,
|
|
3053
3076
|
noEcharts: e.noEcharts,
|
|
3054
3077
|
previewComponent: e.previewComponent
|
|
3055
|
-
}, null), e.footers.length > 0 && l(
|
|
3078
|
+
}, null), e.footers.length > 0 && l(Xl, {
|
|
3056
3079
|
modelValue: e.modelValue,
|
|
3057
3080
|
footers: e.footers,
|
|
3058
3081
|
defFooters: v.value,
|
|
@@ -3062,7 +3085,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
|
|
|
3062
3085
|
}, null)]);
|
|
3063
3086
|
}
|
|
3064
3087
|
});
|
|
3065
|
-
|
|
3088
|
+
ve.install = (e) => (e.component(ve.name, ve), e.use(yt).use(lt).use(wt).use(We).use(Tt), e);
|
|
3066
3089
|
export {
|
|
3067
|
-
|
|
3090
|
+
ve as default
|
|
3068
3091
|
};
|