md-editor-v3 4.2.1 → 4.3.0-beta.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 +8 -8
- package/lib/cjs/NormalToolbar.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +4 -4
- package/lib/cjs/chunks/index2.cjs +1 -1
- package/lib/cjs/chunks/index3.cjs +1 -1
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/MdEditor.mjs +290 -270
- package/lib/es/NormalToolbar.mjs +13 -7
- package/lib/es/chunks/index.mjs +25 -25
- package/lib/es/chunks/index2.mjs +20 -14
- package/lib/es/chunks/index3.mjs +12 -6
- package/lib/es/index.mjs +15 -14
- package/lib/preview.css +1 -1
- package/lib/style.css +1 -1
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +12 -0
- package/lib/types/DropdownToolbar/index.d.ts +12 -0
- package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Content/markdownIt/mermaid/index.d.ts +0 -1
- package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +3 -2
- package/lib/types/MdEditor/type.d.ts +3 -1
- package/lib/types/ModalToolbar/ModalToolbar.d.ts +12 -0
- package/lib/types/ModalToolbar/index.d.ts +12 -0
- package/lib/types/NormalToolbar/NormalToolbar.d.ts +12 -0
- package/lib/types/NormalToolbar/index.d.ts +12 -0
- package/lib/umd/index.js +36 -36
- package/package.json +2 -2
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var U = (e, o, a) => (
|
|
4
|
-
import { defineComponent as O, createVNode as t, inject as S, ref as G, onMounted as z, reactive as Z, computed as
|
|
5
|
-
import { p as n, a as W, s as
|
|
6
|
-
import { a as ee, D as
|
|
7
|
-
import { b as h, a as
|
|
8
|
-
import { linkTo as
|
|
9
|
-
import { C as
|
|
10
|
-
import { a as
|
|
11
|
-
import { a as
|
|
12
|
-
import { minimalSetup as
|
|
13
|
-
import { EditorView as
|
|
14
|
-
import { languages as
|
|
15
|
-
import { markdown as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
var Qe = Object.defineProperty;
|
|
2
|
+
var et = (e, o, a) => o in e ? Qe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[o] = a;
|
|
3
|
+
var U = (e, o, a) => (et(e, typeof o != "symbol" ? o + "" : o, a), a);
|
|
4
|
+
import { defineComponent as O, createVNode as t, inject as S, ref as G, onMounted as z, reactive as Z, computed as ge, watch as F, nextTick as fe, Fragment as _e, cloneVNode as He, toRef as te, shallowRef as tt, onBeforeUnmount as lt } from "vue";
|
|
5
|
+
import { p as n, a as W, s as ot, b as at, d as nt } from "./chunks/config.mjs";
|
|
6
|
+
import { a as ee, D as rt } from "./chunks/index2.mjs";
|
|
7
|
+
import { b as h, a as it } from "./chunks/index4.mjs";
|
|
8
|
+
import { linkTo as st, debounce as ct, throttle as dt, smoothScroll as Ie } from "@vavt/util";
|
|
9
|
+
import { C as ut, a as mt, O as We, T as ft, b as gt, e as ht, c as bt, u as vt, d as pt, f as kt, g as Ct, h as $t, i as yt, M as xt } from "./chunks/index.mjs";
|
|
10
|
+
import { a as wt } from "./chunks/dom.mjs";
|
|
11
|
+
import { a as ze, M as Tt } from "./chunks/index3.mjs";
|
|
12
|
+
import { minimalSetup as St, EditorView as re } from "codemirror";
|
|
13
|
+
import { EditorView as he, placeholder as At, keymap as Mt } from "@codemirror/view";
|
|
14
|
+
import { languages as Lt } from "@codemirror/language-data";
|
|
15
|
+
import { markdown as Dt } from "@codemirror/lang-markdown";
|
|
16
|
+
import { htmlCompletionSource as Et, html as Ht } from "@codemirror/lang-html";
|
|
17
|
+
import { deleteLine as It, indentWithTab as Bt, undo as Ft, redo as Ot } from "@codemirror/commands";
|
|
18
|
+
import { HighlightStyle as Ye, syntaxHighlighting as Ze, indentUnit as Vt } from "@codemirror/language";
|
|
18
19
|
import { tags as s } from "@lezer/highlight";
|
|
19
|
-
import { EditorSelection as P, EditorState as
|
|
20
|
-
import { autocompletion as
|
|
21
|
-
import
|
|
22
|
-
import { g as
|
|
23
|
-
import
|
|
20
|
+
import { EditorSelection as P, EditorState as ce, Compartment as Rt, StateEffect as Pt } from "@codemirror/state";
|
|
21
|
+
import { autocompletion as Nt } from "@codemirror/autocomplete";
|
|
22
|
+
import Je from "./MdCatalog.mjs";
|
|
23
|
+
import { g as Be } from "./chunks/vue-tsx.mjs";
|
|
24
|
+
import qt from "./NormalToolbar.mjs";
|
|
24
25
|
import "medium-zoom";
|
|
25
26
|
import "copy-to-clipboard";
|
|
26
27
|
import "markdown-it";
|
|
27
28
|
import "markdown-it-image-figures";
|
|
28
29
|
import "markdown-it-task-lists";
|
|
29
30
|
import "lru-cache";
|
|
30
|
-
const
|
|
31
|
+
const Ut = /* @__PURE__ */ O({
|
|
31
32
|
setup() {
|
|
32
33
|
return () => t("div", {
|
|
33
34
|
class: `${n}-divider`
|
|
34
35
|
}, null);
|
|
35
36
|
}
|
|
36
|
-
}),
|
|
37
|
+
}), Gt = {
|
|
37
38
|
noPrettier: {
|
|
38
39
|
type: Boolean
|
|
39
40
|
},
|
|
@@ -74,7 +75,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
74
75
|
noUploadImg: {
|
|
75
76
|
type: Boolean
|
|
76
77
|
}
|
|
77
|
-
},
|
|
78
|
+
}, Kt = (e) => {
|
|
78
79
|
var f, u, d, v;
|
|
79
80
|
const o = S("editorId");
|
|
80
81
|
let a = (u = (f = W.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : u.instance;
|
|
@@ -97,15 +98,15 @@ const Vt = /* @__PURE__ */ O({
|
|
|
97
98
|
return z(() => {
|
|
98
99
|
if (c(), !a) {
|
|
99
100
|
const y = document.createElement("script");
|
|
100
|
-
y.src = l ||
|
|
101
|
+
y.src = l || ot, y.onload = m, y.id = `${n}-screenfull`, wt(y, "screenfull");
|
|
101
102
|
}
|
|
102
103
|
}), z(() => {
|
|
103
104
|
h.on(o, {
|
|
104
|
-
name:
|
|
105
|
+
name: ut,
|
|
105
106
|
callback: r
|
|
106
107
|
});
|
|
107
108
|
}), { fullscreenHandler: r };
|
|
108
|
-
},
|
|
109
|
+
}, jt = {
|
|
109
110
|
tableShape: {
|
|
110
111
|
type: Array,
|
|
111
112
|
default: () => [6, 4]
|
|
@@ -115,9 +116,9 @@ const Vt = /* @__PURE__ */ O({
|
|
|
115
116
|
default: () => {
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
|
-
},
|
|
119
|
+
}, _t = /* @__PURE__ */ O({
|
|
119
120
|
name: "TableShape",
|
|
120
|
-
props:
|
|
121
|
+
props: jt,
|
|
121
122
|
setup(e) {
|
|
122
123
|
const o = Z({
|
|
123
124
|
x: -1,
|
|
@@ -144,7 +145,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
144
145
|
class: [`${n}-table-shape-col-default`, l <= o.x && r <= o.y && `${n}-table-shape-col-include`]
|
|
145
146
|
}, null)]))]))]);
|
|
146
147
|
}
|
|
147
|
-
}),
|
|
148
|
+
}), Wt = _t, zt = {
|
|
148
149
|
type: {
|
|
149
150
|
type: String,
|
|
150
151
|
default: "link"
|
|
@@ -163,10 +164,10 @@ const Vt = /* @__PURE__ */ O({
|
|
|
163
164
|
default: () => {
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
},
|
|
167
|
-
props:
|
|
167
|
+
}, Yt = /* @__PURE__ */ O({
|
|
168
|
+
props: zt,
|
|
168
169
|
setup(e) {
|
|
169
|
-
const o = S("usedLanguageText"), a = S("editorId"), l =
|
|
170
|
+
const o = S("usedLanguageText"), a = S("editorId"), l = ge(() => {
|
|
170
171
|
var r, c;
|
|
171
172
|
switch (e.type) {
|
|
172
173
|
case "link":
|
|
@@ -184,7 +185,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
184
185
|
r || setTimeout(() => {
|
|
185
186
|
i.desc = "", i.url = "";
|
|
186
187
|
}, 200);
|
|
187
|
-
}), () => t(
|
|
188
|
+
}), () => t(ze, {
|
|
188
189
|
title: l.value,
|
|
189
190
|
visible: e.visible,
|
|
190
191
|
onClose: e.onCancel
|
|
@@ -233,7 +234,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
233
234
|
}
|
|
234
235
|
});
|
|
235
236
|
}
|
|
236
|
-
}),
|
|
237
|
+
}), Zt = {
|
|
237
238
|
visible: {
|
|
238
239
|
type: Boolean,
|
|
239
240
|
default: !1
|
|
@@ -248,8 +249,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
248
249
|
default: () => {
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
|
-
},
|
|
252
|
-
props:
|
|
252
|
+
}, Jt = /* @__PURE__ */ O({
|
|
253
|
+
props: Zt,
|
|
253
254
|
setup(e) {
|
|
254
255
|
var d, v, y;
|
|
255
256
|
const o = S("usedLanguageText"), a = S("editorId");
|
|
@@ -275,7 +276,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
275
276
|
if (m.imgSelected = !0, (b == null ? void 0 : b.length) > 0) {
|
|
276
277
|
const p = new FileReader();
|
|
277
278
|
p.onload = (g) => {
|
|
278
|
-
m.imgSrc = g.target.result,
|
|
279
|
+
m.imgSrc = g.target.result, fe(() => {
|
|
279
280
|
f = new l(r.value, {
|
|
280
281
|
viewMode: 2,
|
|
281
282
|
preview: `.${n}-clip-preview-target`
|
|
@@ -288,7 +289,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
288
289
|
}), F(() => [m.imgSelected], () => {
|
|
289
290
|
c.value.style = "";
|
|
290
291
|
}), F(() => m.isFullscreen, () => {
|
|
291
|
-
|
|
292
|
+
fe(() => {
|
|
292
293
|
f == null || f.destroy(), c.value.style = "", r.value && (f = new l(r.value, {
|
|
293
294
|
viewMode: 2,
|
|
294
295
|
preview: `.${n}-clip-preview-target`
|
|
@@ -301,7 +302,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
301
302
|
};
|
|
302
303
|
return () => {
|
|
303
304
|
var b;
|
|
304
|
-
return t(
|
|
305
|
+
return t(ze, {
|
|
305
306
|
class: `${n}-modal-clip`,
|
|
306
307
|
title: (b = o.value.clipModalTips) == null ? void 0 : b.title,
|
|
307
308
|
visible: e.visible,
|
|
@@ -359,8 +360,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
359
360
|
type: "button",
|
|
360
361
|
onClick: () => {
|
|
361
362
|
if (f) {
|
|
362
|
-
const
|
|
363
|
-
h.emit(a, "uploadImage", [
|
|
363
|
+
const C = f.getCroppedCanvas();
|
|
364
|
+
h.emit(a, "uploadImage", [it(C.toDataURL("image/png"))], e.onOk), u();
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
367
|
}, [((p = o.value.clipModalTips) == null ? void 0 : p.buttonUpload) || ((g = o.value.linkModalTips) == null ? void 0 : g.buttonOK)])]), t("input", {
|
|
@@ -376,7 +377,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
376
377
|
});
|
|
377
378
|
};
|
|
378
379
|
}
|
|
379
|
-
}),
|
|
380
|
+
}), Xt = {
|
|
380
381
|
type: {
|
|
381
382
|
type: String,
|
|
382
383
|
default: "link"
|
|
@@ -399,27 +400,27 @@ const Vt = /* @__PURE__ */ O({
|
|
|
399
400
|
default: () => {
|
|
400
401
|
}
|
|
401
402
|
}
|
|
402
|
-
},
|
|
403
|
-
props:
|
|
403
|
+
}, Qt = /* @__PURE__ */ O({
|
|
404
|
+
props: Xt,
|
|
404
405
|
setup(e) {
|
|
405
|
-
return () => t(
|
|
406
|
+
return () => t(_e, null, [t(Yt, {
|
|
406
407
|
type: e.type,
|
|
407
408
|
visible: e.linkVisible,
|
|
408
409
|
onOk: e.onOk,
|
|
409
410
|
onCancel: e.onCancel
|
|
410
|
-
}, null), t(
|
|
411
|
+
}, null), t(Jt, {
|
|
411
412
|
visible: e.clipVisible,
|
|
412
413
|
onOk: e.onOk,
|
|
413
414
|
onCancel: e.onCancel
|
|
414
415
|
}, null)]);
|
|
415
416
|
}
|
|
416
|
-
}),
|
|
417
|
+
}), el = /* @__PURE__ */ O({
|
|
417
418
|
name: "MDEditorToolbar",
|
|
418
|
-
props:
|
|
419
|
+
props: Gt,
|
|
419
420
|
setup(e) {
|
|
420
421
|
const o = S("editorId"), a = S("usedLanguageText"), {
|
|
421
422
|
fullscreenHandler: l
|
|
422
|
-
} =
|
|
423
|
+
} = Kt(e), i = `${o}-toolbar-wrapper`, r = Z({
|
|
423
424
|
title: !1,
|
|
424
425
|
catalog: !1,
|
|
425
426
|
// 图片上传下拉
|
|
@@ -444,9 +445,9 @@ const Vt = /* @__PURE__ */ O({
|
|
|
444
445
|
}
|
|
445
446
|
});
|
|
446
447
|
});
|
|
447
|
-
const u =
|
|
448
|
-
const b = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), p = b.indexOf("="), g = p === -1 ? b : b.slice(0, p + 1),
|
|
449
|
-
return [g,
|
|
448
|
+
const u = ge(() => {
|
|
449
|
+
const b = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), p = b.indexOf("="), g = p === -1 ? b : b.slice(0, p + 1), C = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
|
|
450
|
+
return [g, C];
|
|
450
451
|
}), d = G(), v = () => {
|
|
451
452
|
h.emit(o, "uploadImage", Array.from(d.value.files || [])), d.value.value = "";
|
|
452
453
|
};
|
|
@@ -454,11 +455,11 @@ const Vt = /* @__PURE__ */ O({
|
|
|
454
455
|
d.value.addEventListener("change", v);
|
|
455
456
|
});
|
|
456
457
|
const y = (b) => {
|
|
457
|
-
var p, g,
|
|
458
|
-
if (
|
|
458
|
+
var p, g, C, x, T, w, M, $, A, R, L, D, V, I, E, K, N, ae, J, j, q, X, _, H, B, Q, ne, be, ve, pe, ke, Ce, $e, ye, xe, we, Te, Se, Ae, Me, Le, De, Ee;
|
|
459
|
+
if (at.includes(b))
|
|
459
460
|
switch (b) {
|
|
460
461
|
case "-":
|
|
461
|
-
return t(
|
|
462
|
+
return t(Ut, null, null);
|
|
462
463
|
case "bold":
|
|
463
464
|
return t("div", {
|
|
464
465
|
class: `${n}-toolbar-item`,
|
|
@@ -488,7 +489,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
488
489
|
case "italic":
|
|
489
490
|
return t("div", {
|
|
490
491
|
class: `${n}-toolbar-item`,
|
|
491
|
-
title: (
|
|
492
|
+
title: (C = a.value.toolbarTips) == null ? void 0 : C.italic,
|
|
492
493
|
onClick: () => {
|
|
493
494
|
c("italic");
|
|
494
495
|
}
|
|
@@ -515,8 +516,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
515
516
|
return t(ee, {
|
|
516
517
|
relative: `#${i}`,
|
|
517
518
|
visible: r.title,
|
|
518
|
-
onChange: (
|
|
519
|
-
r.title =
|
|
519
|
+
onChange: (k) => {
|
|
520
|
+
r.title = k;
|
|
520
521
|
},
|
|
521
522
|
overlay: t("ul", {
|
|
522
523
|
class: `${n}-menu`,
|
|
@@ -543,7 +544,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
543
544
|
onClick: () => {
|
|
544
545
|
c("h4");
|
|
545
546
|
}
|
|
546
|
-
}, [(
|
|
547
|
+
}, [($ = a.value.titleItem) == null ? void 0 : $.h4]), t("li", {
|
|
547
548
|
class: `${n}-menu-item`,
|
|
548
549
|
onClick: () => {
|
|
549
550
|
c("h5");
|
|
@@ -556,10 +557,10 @@ const Vt = /* @__PURE__ */ O({
|
|
|
556
557
|
}, [(R = a.value.titleItem) == null ? void 0 : R.h6])])
|
|
557
558
|
}, {
|
|
558
559
|
default: () => {
|
|
559
|
-
var
|
|
560
|
+
var k;
|
|
560
561
|
return [t("div", {
|
|
561
562
|
class: `${n}-toolbar-item`,
|
|
562
|
-
title: (
|
|
563
|
+
title: (k = a.value.toolbarTips) == null ? void 0 : k.title
|
|
563
564
|
}, [t("svg", {
|
|
564
565
|
class: `${n}-icon`,
|
|
565
566
|
"aria-hidden": "true"
|
|
@@ -700,8 +701,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
700
701
|
}, null)])]) : t(ee, {
|
|
701
702
|
relative: `#${i}`,
|
|
702
703
|
visible: r.image,
|
|
703
|
-
onChange: (
|
|
704
|
-
r.image =
|
|
704
|
+
onChange: (k) => {
|
|
705
|
+
r.image = k;
|
|
705
706
|
},
|
|
706
707
|
overlay: t("ul", {
|
|
707
708
|
class: `${n}-menu`,
|
|
@@ -726,10 +727,10 @@ const Vt = /* @__PURE__ */ O({
|
|
|
726
727
|
}, [(_ = a.value.imgTitleItem) == null ? void 0 : _.clip2upload])])
|
|
727
728
|
}, {
|
|
728
729
|
default: () => {
|
|
729
|
-
var
|
|
730
|
+
var k;
|
|
730
731
|
return [t("div", {
|
|
731
732
|
class: `${n}-toolbar-item`,
|
|
732
|
-
title: (
|
|
733
|
+
title: (k = a.value.toolbarTips) == null ? void 0 : k.image
|
|
733
734
|
}, [t("svg", {
|
|
734
735
|
class: `${n}-icon`,
|
|
735
736
|
"aria-hidden": "true"
|
|
@@ -742,24 +743,24 @@ const Vt = /* @__PURE__ */ O({
|
|
|
742
743
|
return t(ee, {
|
|
743
744
|
relative: `#${i}`,
|
|
744
745
|
visible: r.table,
|
|
745
|
-
onChange: (
|
|
746
|
-
r.table =
|
|
746
|
+
onChange: (k) => {
|
|
747
|
+
r.table = k;
|
|
747
748
|
},
|
|
748
749
|
key: "bar-table",
|
|
749
|
-
overlay: t(
|
|
750
|
+
overlay: t(Wt, {
|
|
750
751
|
tableShape: e.tableShape,
|
|
751
|
-
onSelected: (
|
|
752
|
+
onSelected: (k) => {
|
|
752
753
|
c("table", {
|
|
753
|
-
selectedShape:
|
|
754
|
+
selectedShape: k
|
|
754
755
|
});
|
|
755
756
|
}
|
|
756
757
|
}, null)
|
|
757
758
|
}, {
|
|
758
759
|
default: () => {
|
|
759
|
-
var
|
|
760
|
+
var k;
|
|
760
761
|
return [t("div", {
|
|
761
762
|
class: `${n}-toolbar-item`,
|
|
762
|
-
title: (
|
|
763
|
+
title: (k = a.value.toolbarTips) == null ? void 0 : k.table
|
|
763
764
|
}, [t("svg", {
|
|
764
765
|
class: `${n}-icon`,
|
|
765
766
|
"aria-hidden": "true"
|
|
@@ -799,7 +800,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
799
800
|
class: `${n}-toolbar-item`,
|
|
800
801
|
title: (Q = a.value.toolbarTips) == null ? void 0 : Q.save,
|
|
801
802
|
onClick: () => {
|
|
802
|
-
h.emit(o,
|
|
803
|
+
h.emit(o, We);
|
|
803
804
|
}
|
|
804
805
|
}, [t("svg", {
|
|
805
806
|
class: `${n}-icon`,
|
|
@@ -823,7 +824,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
823
824
|
case "pageFullscreen":
|
|
824
825
|
return !e.setting.fullscreen && t("div", {
|
|
825
826
|
class: `${n}-toolbar-item`,
|
|
826
|
-
title: (
|
|
827
|
+
title: (be = a.value.toolbarTips) == null ? void 0 : be.pageFullscreen,
|
|
827
828
|
onClick: () => {
|
|
828
829
|
e.updateSetting("pageFullscreen");
|
|
829
830
|
}
|
|
@@ -836,7 +837,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
836
837
|
case "fullscreen":
|
|
837
838
|
return t("div", {
|
|
838
839
|
class: `${n}-toolbar-item`,
|
|
839
|
-
title: (
|
|
840
|
+
title: (ve = a.value.toolbarTips) == null ? void 0 : ve.fullscreen,
|
|
840
841
|
onClick: () => {
|
|
841
842
|
l();
|
|
842
843
|
}
|
|
@@ -849,7 +850,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
849
850
|
case "preview":
|
|
850
851
|
return t("div", {
|
|
851
852
|
class: `${n}-toolbar-item`,
|
|
852
|
-
title: (
|
|
853
|
+
title: (pe = a.value.toolbarTips) == null ? void 0 : pe.preview,
|
|
853
854
|
onClick: () => {
|
|
854
855
|
e.updateSetting("preview");
|
|
855
856
|
}
|
|
@@ -862,7 +863,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
862
863
|
case "htmlPreview":
|
|
863
864
|
return t("div", {
|
|
864
865
|
class: `${n}-toolbar-item`,
|
|
865
|
-
title: (
|
|
866
|
+
title: (ke = a.value.toolbarTips) == null ? void 0 : ke.htmlPreview,
|
|
866
867
|
onClick: () => {
|
|
867
868
|
e.updateSetting("htmlPreview");
|
|
868
869
|
}
|
|
@@ -875,9 +876,9 @@ const Vt = /* @__PURE__ */ O({
|
|
|
875
876
|
case "catalog":
|
|
876
877
|
return t("div", {
|
|
877
878
|
class: `${n}-toolbar-item`,
|
|
878
|
-
title: (
|
|
879
|
+
title: (Ce = a.value.toolbarTips) == null ? void 0 : Ce.catalog,
|
|
879
880
|
onClick: () => {
|
|
880
|
-
h.emit(o,
|
|
881
|
+
h.emit(o, mt);
|
|
881
882
|
},
|
|
882
883
|
key: "bar-catalog"
|
|
883
884
|
}, [t("svg", {
|
|
@@ -889,8 +890,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
889
890
|
case "github":
|
|
890
891
|
return t("div", {
|
|
891
892
|
class: `${n}-toolbar-item`,
|
|
892
|
-
title: (
|
|
893
|
-
onClick: () =>
|
|
893
|
+
title: ($e = a.value.toolbarTips) == null ? void 0 : $e.github,
|
|
894
|
+
onClick: () => st("https://github.com/imzbf/md-editor-v3")
|
|
894
895
|
}, [t("svg", {
|
|
895
896
|
class: `${n}-icon`,
|
|
896
897
|
"aria-hidden": "true"
|
|
@@ -901,8 +902,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
901
902
|
return t(ee, {
|
|
902
903
|
relative: `#${i}`,
|
|
903
904
|
visible: r.mermaid,
|
|
904
|
-
onChange: (
|
|
905
|
-
r.mermaid =
|
|
905
|
+
onChange: (k) => {
|
|
906
|
+
r.mermaid = k;
|
|
906
907
|
},
|
|
907
908
|
overlay: t("ul", {
|
|
908
909
|
class: `${n}-menu`,
|
|
@@ -914,49 +915,49 @@ const Vt = /* @__PURE__ */ O({
|
|
|
914
915
|
onClick: () => {
|
|
915
916
|
c("flow");
|
|
916
917
|
}
|
|
917
|
-
}, [(
|
|
918
|
+
}, [(ye = a.value.mermaid) == null ? void 0 : ye.flow]), t("li", {
|
|
918
919
|
class: `${n}-menu-item`,
|
|
919
920
|
onClick: () => {
|
|
920
921
|
c("sequence");
|
|
921
922
|
}
|
|
922
|
-
}, [(
|
|
923
|
+
}, [(xe = a.value.mermaid) == null ? void 0 : xe.sequence]), t("li", {
|
|
923
924
|
class: `${n}-menu-item`,
|
|
924
925
|
onClick: () => {
|
|
925
926
|
c("gantt");
|
|
926
927
|
}
|
|
927
|
-
}, [(
|
|
928
|
+
}, [(we = a.value.mermaid) == null ? void 0 : we.gantt]), t("li", {
|
|
928
929
|
class: `${n}-menu-item`,
|
|
929
930
|
onClick: () => {
|
|
930
931
|
c("class");
|
|
931
932
|
}
|
|
932
|
-
}, [(
|
|
933
|
+
}, [(Te = a.value.mermaid) == null ? void 0 : Te.class]), t("li", {
|
|
933
934
|
class: `${n}-menu-item`,
|
|
934
935
|
onClick: () => {
|
|
935
936
|
c("state");
|
|
936
937
|
}
|
|
937
|
-
}, [(
|
|
938
|
+
}, [(Se = a.value.mermaid) == null ? void 0 : Se.state]), t("li", {
|
|
938
939
|
class: `${n}-menu-item`,
|
|
939
940
|
onClick: () => {
|
|
940
941
|
c("pie");
|
|
941
942
|
}
|
|
942
|
-
}, [(
|
|
943
|
+
}, [(Ae = a.value.mermaid) == null ? void 0 : Ae.pie]), t("li", {
|
|
943
944
|
class: `${n}-menu-item`,
|
|
944
945
|
onClick: () => {
|
|
945
946
|
c("relationship");
|
|
946
947
|
}
|
|
947
|
-
}, [(
|
|
948
|
+
}, [(Me = a.value.mermaid) == null ? void 0 : Me.relationship]), t("li", {
|
|
948
949
|
class: `${n}-menu-item`,
|
|
949
950
|
onClick: () => {
|
|
950
951
|
c("journey");
|
|
951
952
|
}
|
|
952
|
-
}, [(
|
|
953
|
+
}, [(Le = a.value.mermaid) == null ? void 0 : Le.journey])]),
|
|
953
954
|
key: "bar-mermaid"
|
|
954
955
|
}, {
|
|
955
956
|
default: () => {
|
|
956
|
-
var
|
|
957
|
+
var k;
|
|
957
958
|
return [t("div", {
|
|
958
959
|
class: `${n}-toolbar-item`,
|
|
959
|
-
title: (
|
|
960
|
+
title: (k = a.value.toolbarTips) == null ? void 0 : k.mermaid
|
|
960
961
|
}, [t("svg", {
|
|
961
962
|
class: `${n}-icon`,
|
|
962
963
|
"aria-hidden": "true"
|
|
@@ -969,8 +970,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
969
970
|
return t(ee, {
|
|
970
971
|
relative: `#${i}`,
|
|
971
972
|
visible: r.katex,
|
|
972
|
-
onChange: (
|
|
973
|
-
r.katex =
|
|
973
|
+
onChange: (k) => {
|
|
974
|
+
r.katex = k;
|
|
974
975
|
},
|
|
975
976
|
overlay: t("ul", {
|
|
976
977
|
class: `${n}-menu`,
|
|
@@ -982,19 +983,19 @@ const Vt = /* @__PURE__ */ O({
|
|
|
982
983
|
onClick: () => {
|
|
983
984
|
c("katexInline");
|
|
984
985
|
}
|
|
985
|
-
}, [(
|
|
986
|
+
}, [(De = a.value.katex) == null ? void 0 : De.inline]), t("li", {
|
|
986
987
|
class: `${n}-menu-item`,
|
|
987
988
|
onClick: () => {
|
|
988
989
|
c("katexBlock");
|
|
989
990
|
}
|
|
990
|
-
}, [(
|
|
991
|
+
}, [(Ee = a.value.katex) == null ? void 0 : Ee.block])]),
|
|
991
992
|
key: "bar-katex"
|
|
992
993
|
}, {
|
|
993
994
|
default: () => {
|
|
994
|
-
var
|
|
995
|
+
var k;
|
|
995
996
|
return [t("div", {
|
|
996
997
|
class: `${n}-toolbar-item`,
|
|
997
|
-
title: (
|
|
998
|
+
title: (k = a.value.toolbarTips) == null ? void 0 : k.katex
|
|
998
999
|
}, [t("svg", {
|
|
999
1000
|
class: `${n}-icon`,
|
|
1000
1001
|
"aria-hidden": "true"
|
|
@@ -1004,12 +1005,30 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1004
1005
|
}
|
|
1005
1006
|
});
|
|
1006
1007
|
}
|
|
1007
|
-
else
|
|
1008
|
-
|
|
1008
|
+
else if (e.defToolbars instanceof Array) {
|
|
1009
|
+
const k = e.defToolbars[b];
|
|
1010
|
+
return k ? He(k, {
|
|
1011
|
+
insert(se) {
|
|
1012
|
+
h.emit(o, "replace", "universal", {
|
|
1013
|
+
generate: se
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
}) : "";
|
|
1017
|
+
} else if (e.defToolbars && e.defToolbars.children instanceof Array) {
|
|
1018
|
+
const k = e.defToolbars.children[b];
|
|
1019
|
+
return k ? He(k, {
|
|
1020
|
+
insert(se) {
|
|
1021
|
+
h.emit(o, "replace", "universal", {
|
|
1022
|
+
generate: se
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
}) : "";
|
|
1026
|
+
} else
|
|
1027
|
+
return "";
|
|
1009
1028
|
};
|
|
1010
1029
|
return () => {
|
|
1011
1030
|
const b = u.value[0].map((g) => y(g)), p = u.value[1].map((g) => y(g));
|
|
1012
|
-
return t(
|
|
1031
|
+
return t(_e, null, [e.toolbars.length > 0 && t("div", {
|
|
1013
1032
|
class: `${n}-toolbar-wrapper`,
|
|
1014
1033
|
id: i
|
|
1015
1034
|
}, [t("div", {
|
|
@@ -1027,7 +1046,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1027
1046
|
style: {
|
|
1028
1047
|
display: "none"
|
|
1029
1048
|
}
|
|
1030
|
-
}, null), t(
|
|
1049
|
+
}, null), t(Qt, {
|
|
1031
1050
|
linkVisible: m.linkVisible,
|
|
1032
1051
|
clipVisible: m.clipVisible,
|
|
1033
1052
|
type: m.type,
|
|
@@ -1043,8 +1062,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1043
1062
|
}, null)]);
|
|
1044
1063
|
};
|
|
1045
1064
|
}
|
|
1046
|
-
}),
|
|
1047
|
-
const a =
|
|
1065
|
+
}), tl = (e, o) => {
|
|
1066
|
+
const a = ct(() => {
|
|
1048
1067
|
e.removeEventListener("scroll", l), e.addEventListener("scroll", l), o.removeEventListener("scroll", l), o.addEventListener("scroll", l);
|
|
1049
1068
|
}, 50), l = (i) => {
|
|
1050
1069
|
const r = e.clientHeight, c = o.clientHeight, m = e.scrollHeight, f = o.scrollHeight, u = (m - r) / (f - c);
|
|
@@ -1066,7 +1085,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1066
1085
|
e.removeEventListener("scroll", l), o.removeEventListener("scroll", l);
|
|
1067
1086
|
}
|
|
1068
1087
|
];
|
|
1069
|
-
},
|
|
1088
|
+
}, ll = (e, o, a) => {
|
|
1070
1089
|
const { view: l } = a, i = (v) => l.lineBlockAt(l.state.doc.line(v).from).top, r = (v) => l.lineBlockAt(l.state.doc.line(v).from).height;
|
|
1071
1090
|
let c = [];
|
|
1072
1091
|
const m = () => {
|
|
@@ -1082,8 +1101,8 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1082
1101
|
});
|
|
1083
1102
|
};
|
|
1084
1103
|
let f = 0, u = 0;
|
|
1085
|
-
const d =
|
|
1086
|
-
var p, g,
|
|
1104
|
+
const d = dt((v) => {
|
|
1105
|
+
var p, g, C, x, T, w, M;
|
|
1087
1106
|
if (!((p = o.firstElementChild) != null && p.firstElementChild))
|
|
1088
1107
|
return;
|
|
1089
1108
|
const y = l.lineBlockAtHeight(l.scrollDOM.scrollTop), { number: b } = l.state.doc.lineAt(y.from);
|
|
@@ -1092,24 +1111,24 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1092
1111
|
if (u !== 0)
|
|
1093
1112
|
return;
|
|
1094
1113
|
f++;
|
|
1095
|
-
const
|
|
1114
|
+
const $ = c[b - 1], A = i($.end) + r($.end);
|
|
1096
1115
|
let R = 0;
|
|
1097
|
-
const L = i(
|
|
1116
|
+
const L = i($.start), D = o.querySelector(`[data-line="${$.start - 1}"]`) || ((g = o.firstElementChild) == null ? void 0 : g.firstElementChild), V = o.querySelector(`[data-line="${$.end}"]`) || ((C = o.lastElementChild) == null ? void 0 : C.lastElementChild);
|
|
1098
1117
|
let I = 0, E = 0;
|
|
1099
1118
|
L === 0 ? (R = (l.scrollDOM.scrollTop - L) / (A - L), I = V.offsetTop) : A > l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight ? (R = (l.scrollDOM.scrollTop - L) / (l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight - L), E = D.offsetTop, I = o.scrollHeight - o.clientHeight - E + 10) : (R = (l.scrollDOM.scrollTop - L) / (A - L), E = D.offsetTop, I = V.offsetTop - E);
|
|
1100
1119
|
const K = E - 10 + I * R;
|
|
1101
|
-
|
|
1120
|
+
Ie(o, K, () => {
|
|
1102
1121
|
f--;
|
|
1103
1122
|
});
|
|
1104
1123
|
} else {
|
|
1105
1124
|
if (f !== 0)
|
|
1106
1125
|
return;
|
|
1107
1126
|
u++;
|
|
1108
|
-
const
|
|
1127
|
+
const $ = Array.from(
|
|
1109
1128
|
o.querySelectorAll("[data-line]")
|
|
1110
1129
|
), A = o.scrollTop, R = o.scrollHeight;
|
|
1111
|
-
let L =
|
|
1112
|
-
Number(
|
|
1130
|
+
let L = $.length === 0 ? 1 : Math.ceil(
|
|
1131
|
+
Number($[$.length - 1].dataset.line) * (A / R)
|
|
1113
1132
|
), D = (x = o.firstElementChild) == null ? void 0 : x.firstElementChild;
|
|
1114
1133
|
for (let H = L; H >= 0; H--) {
|
|
1115
1134
|
const B = o.querySelector(`[data-line="${H}"]`);
|
|
@@ -1119,11 +1138,11 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1119
1138
|
}
|
|
1120
1139
|
}
|
|
1121
1140
|
let V = (T = o.firstElementChild) == null ? void 0 : T.firstElementChild, I = (w = o.firstElementChild) == null ? void 0 : w.lastElementChild;
|
|
1122
|
-
for (;
|
|
1123
|
-
const H =
|
|
1124
|
-
if (H + 1 >=
|
|
1141
|
+
for (; $.length > 0; ) {
|
|
1142
|
+
const H = $.indexOf(D);
|
|
1143
|
+
if (H + 1 >= $.length)
|
|
1125
1144
|
break;
|
|
1126
|
-
const B =
|
|
1145
|
+
const B = $[H + 1];
|
|
1127
1146
|
if (H === -1) {
|
|
1128
1147
|
I = B;
|
|
1129
1148
|
break;
|
|
@@ -1134,7 +1153,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1134
1153
|
V = D, I = B;
|
|
1135
1154
|
break;
|
|
1136
1155
|
}
|
|
1137
|
-
D =
|
|
1156
|
+
D = $[H - 1];
|
|
1138
1157
|
continue;
|
|
1139
1158
|
}
|
|
1140
1159
|
const ne = B.offsetTop;
|
|
@@ -1156,7 +1175,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1156
1175
|
), q = i(l.state.doc.lines) + r(l.state.doc.lines), _ = 8 + q - j - e.clientHeight) : (N = Math.max(
|
|
1157
1176
|
(A - E) / (K - E),
|
|
1158
1177
|
0
|
|
1159
|
-
), _ = q + X - j),
|
|
1178
|
+
), _ = q + X - j), Ie(e, j + _ * N, () => {
|
|
1160
1179
|
u--;
|
|
1161
1180
|
});
|
|
1162
1181
|
}
|
|
@@ -1169,7 +1188,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1169
1188
|
c = [], e.removeEventListener("scroll", d), o.removeEventListener("scroll", d);
|
|
1170
1189
|
}
|
|
1171
1190
|
];
|
|
1172
|
-
},
|
|
1191
|
+
}, ol = (e, o, a) => {
|
|
1173
1192
|
const l = S("editorId");
|
|
1174
1193
|
let i = () => {
|
|
1175
1194
|
}, r = () => {
|
|
@@ -1181,7 +1200,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1181
1200
|
), u = document.querySelector(
|
|
1182
1201
|
`[id="${l}-html-wrapper"][data-show="true"]`
|
|
1183
1202
|
);
|
|
1184
|
-
(f || u) && ([r, i] = (f ?
|
|
1203
|
+
(f || u) && ([r, i] = (f ? ll : tl)(
|
|
1185
1204
|
m,
|
|
1186
1205
|
f || u,
|
|
1187
1206
|
a.value
|
|
@@ -1196,7 +1215,7 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1196
1215
|
te(e.setting, "pageFullscreen")
|
|
1197
1216
|
],
|
|
1198
1217
|
() => {
|
|
1199
|
-
|
|
1218
|
+
fe(c);
|
|
1200
1219
|
}
|
|
1201
1220
|
), F(
|
|
1202
1221
|
() => e.scrollAuto,
|
|
@@ -1204,21 +1223,21 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1204
1223
|
m ? r() : i();
|
|
1205
1224
|
}
|
|
1206
1225
|
), z(c);
|
|
1207
|
-
},
|
|
1226
|
+
}, al = ol, nl = (e, o, a) => {
|
|
1208
1227
|
var d, v, y, b, p, g;
|
|
1209
1228
|
let l = "", i = 0, r = 0, c = !0, m = !1;
|
|
1210
1229
|
const f = o.getSelectedText(), u = (d = W.editorConfig) == null ? void 0 : d.mermaidTemplate;
|
|
1211
1230
|
if (/^h[1-6]{1}$/.test(e)) {
|
|
1212
|
-
const
|
|
1213
|
-
l = `${
|
|
1231
|
+
const C = e.replace(/^h(\d)/, (x, T) => new Array(Number(T)).fill("#", 0, T).join(""));
|
|
1232
|
+
l = `${C} ${f}`, i = C.length + 1;
|
|
1214
1233
|
} else if (e === "prettier") {
|
|
1215
|
-
const
|
|
1234
|
+
const C = window.prettier || ((y = (v = W.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : y.prettierInstance), x = [
|
|
1216
1235
|
((b = window.prettierPlugins) == null ? void 0 : b.markdown) || ((g = (p = W.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : g.parserMarkdownInstance)
|
|
1217
1236
|
];
|
|
1218
|
-
!
|
|
1237
|
+
!C || x[0] === void 0 ? (h.emit(a.editorId, "errorCatcher", {
|
|
1219
1238
|
name: "prettier",
|
|
1220
1239
|
message: "prettier is undefined"
|
|
1221
|
-
}), l = o.getValue()) : l =
|
|
1240
|
+
}), l = o.getValue()) : l = C.format(o.getValue(), {
|
|
1222
1241
|
parser: "markdown",
|
|
1223
1242
|
plugins: x
|
|
1224
1243
|
}), c = !1, m = !0;
|
|
@@ -1269,16 +1288,16 @@ const Vt = /* @__PURE__ */ O({
|
|
|
1269
1288
|
break;
|
|
1270
1289
|
}
|
|
1271
1290
|
case "code": {
|
|
1272
|
-
const
|
|
1291
|
+
const C = a.text || f || "", x = a.mode || "language";
|
|
1273
1292
|
l = `\`\`\`${x}
|
|
1274
|
-
${
|
|
1293
|
+
${C}
|
|
1275
1294
|
\`\`\`
|
|
1276
1295
|
`, i = 3, r = 3 + x.length - l.length;
|
|
1277
1296
|
break;
|
|
1278
1297
|
}
|
|
1279
1298
|
case "table": {
|
|
1280
1299
|
l = "|";
|
|
1281
|
-
const { selectedShape:
|
|
1300
|
+
const { selectedShape: C = { x: 1, y: 1 } } = a, { x, y: T } = C;
|
|
1282
1301
|
for (let w = 0; w <= T; w++)
|
|
1283
1302
|
l += " col |";
|
|
1284
1303
|
l += `
|
|
@@ -1295,14 +1314,14 @@ ${k}
|
|
|
1295
1314
|
break;
|
|
1296
1315
|
}
|
|
1297
1316
|
case "link": {
|
|
1298
|
-
const { desc:
|
|
1299
|
-
l = `[${
|
|
1317
|
+
const { desc: C, url: x } = a;
|
|
1318
|
+
l = `[${C}](${x})`, c = !1;
|
|
1300
1319
|
break;
|
|
1301
1320
|
}
|
|
1302
1321
|
case "image": {
|
|
1303
|
-
const { desc:
|
|
1304
|
-
T instanceof Array ? l = T.reduce((w, M) => w + `
|
|
1324
|
+
`, "") : l = `
|
|
1306
1325
|
`, c = !1;
|
|
1307
1326
|
break;
|
|
1308
1327
|
}
|
|
@@ -1399,7 +1418,7 @@ $$
|
|
|
1399
1418
|
break;
|
|
1400
1419
|
}
|
|
1401
1420
|
case "universal": {
|
|
1402
|
-
const { generate:
|
|
1421
|
+
const { generate: C } = a, x = C(f);
|
|
1403
1422
|
l = x.targetValue, c = x.select, i = x.deviationStart, r = x.deviationEnd;
|
|
1404
1423
|
}
|
|
1405
1424
|
}
|
|
@@ -1416,18 +1435,18 @@ $$
|
|
|
1416
1435
|
replaceAll: m
|
|
1417
1436
|
}
|
|
1418
1437
|
};
|
|
1419
|
-
},
|
|
1438
|
+
}, rl = "#e5c07b", Fe = "var(--md-color)", il = "#56b6c2", sl = "#ffffff", le = "var(--md-color)", Oe = "#e5c07b", cl = "#e5c07b", dl = "var(--md-color)", Ve = "#d19a66", ul = "#c678dd", ml = "#21252b", fl = "#2c313a", Re = "var(--md-bk-color)", de = "var(--md-bk-color)", gl = "#ceedfa33", Pe = "#528bff", hl = he.theme(
|
|
1420
1439
|
{
|
|
1421
1440
|
"&": {
|
|
1422
1441
|
color: le,
|
|
1423
|
-
backgroundColor:
|
|
1442
|
+
backgroundColor: Re
|
|
1424
1443
|
},
|
|
1425
1444
|
".cm-content": {
|
|
1426
|
-
caretColor:
|
|
1445
|
+
caretColor: Pe
|
|
1427
1446
|
},
|
|
1428
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1429
|
-
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor:
|
|
1430
|
-
".cm-panels": { backgroundColor:
|
|
1447
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: Pe },
|
|
1448
|
+
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: gl },
|
|
1449
|
+
".cm-panels": { backgroundColor: ml, color: le },
|
|
1431
1450
|
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
1432
1451
|
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
1433
1452
|
".cm-searchMatch": {
|
|
@@ -1443,13 +1462,13 @@ $$
|
|
|
1443
1462
|
backgroundColor: "#bad0f847"
|
|
1444
1463
|
},
|
|
1445
1464
|
".cm-gutters": {
|
|
1446
|
-
backgroundColor:
|
|
1465
|
+
backgroundColor: Re,
|
|
1447
1466
|
color: le,
|
|
1448
1467
|
borderRight: "1px solid",
|
|
1449
1468
|
borderColor: "var(--md-border-color)"
|
|
1450
1469
|
},
|
|
1451
1470
|
".cm-activeLineGutter": {
|
|
1452
|
-
backgroundColor:
|
|
1471
|
+
backgroundColor: fl
|
|
1453
1472
|
},
|
|
1454
1473
|
".cm-foldPlaceholder": {
|
|
1455
1474
|
backgroundColor: "transparent",
|
|
@@ -1458,15 +1477,15 @@ $$
|
|
|
1458
1477
|
},
|
|
1459
1478
|
".cm-tooltip": {
|
|
1460
1479
|
border: "1px solid var(--md-border-color)",
|
|
1461
|
-
backgroundColor:
|
|
1480
|
+
backgroundColor: de
|
|
1462
1481
|
},
|
|
1463
1482
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1464
1483
|
borderTopColor: "transparent",
|
|
1465
1484
|
borderBottomColor: "transparent"
|
|
1466
1485
|
},
|
|
1467
1486
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
1468
|
-
borderTopColor:
|
|
1469
|
-
borderBottomColor:
|
|
1487
|
+
borderTopColor: de,
|
|
1488
|
+
borderBottomColor: de
|
|
1470
1489
|
},
|
|
1471
1490
|
".cm-tooltip-autocomplete": {
|
|
1472
1491
|
"& > ul > li[aria-selected]": {
|
|
@@ -1475,11 +1494,11 @@ $$
|
|
|
1475
1494
|
}
|
|
1476
1495
|
},
|
|
1477
1496
|
{ dark: !0 }
|
|
1478
|
-
),
|
|
1479
|
-
{ tag: s.keyword, color:
|
|
1480
|
-
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color:
|
|
1481
|
-
{ tag: [s.function(s.variableName), s.labelName], color:
|
|
1482
|
-
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color:
|
|
1497
|
+
), bl = Ye.define([
|
|
1498
|
+
{ tag: s.keyword, color: ul },
|
|
1499
|
+
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: Fe },
|
|
1500
|
+
{ tag: [s.function(s.variableName), s.labelName], color: cl },
|
|
1501
|
+
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color: Ve },
|
|
1483
1502
|
{ tag: [s.definition(s.name), s.separator], color: le },
|
|
1484
1503
|
{
|
|
1485
1504
|
tag: [
|
|
@@ -1492,7 +1511,7 @@ $$
|
|
|
1492
1511
|
s.self,
|
|
1493
1512
|
s.namespace
|
|
1494
1513
|
],
|
|
1495
|
-
color:
|
|
1514
|
+
color: rl
|
|
1496
1515
|
},
|
|
1497
1516
|
{
|
|
1498
1517
|
tag: [
|
|
@@ -1504,32 +1523,32 @@ $$
|
|
|
1504
1523
|
s.link,
|
|
1505
1524
|
s.special(s.string)
|
|
1506
1525
|
],
|
|
1507
|
-
color:
|
|
1526
|
+
color: il
|
|
1508
1527
|
},
|
|
1509
|
-
{ tag: [s.meta, s.comment], color:
|
|
1528
|
+
{ tag: [s.meta, s.comment], color: Oe },
|
|
1510
1529
|
{ tag: s.strong, fontWeight: "bold" },
|
|
1511
1530
|
{ tag: s.emphasis, fontStyle: "italic" },
|
|
1512
1531
|
{ tag: s.strikethrough, textDecoration: "line-through" },
|
|
1513
|
-
{ tag: s.link, color:
|
|
1514
|
-
{ tag: s.heading, fontWeight: "bold", color:
|
|
1515
|
-
{ tag: [s.atom, s.bool, s.special(s.variableName)], color:
|
|
1516
|
-
{ tag: [s.processingInstruction, s.string, s.inserted], color:
|
|
1517
|
-
{ tag: s.invalid, color:
|
|
1518
|
-
]),
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
],
|
|
1532
|
+
{ tag: s.link, color: Oe, textDecoration: "underline" },
|
|
1533
|
+
{ tag: s.heading, fontWeight: "bold", color: Fe },
|
|
1534
|
+
{ tag: [s.atom, s.bool, s.special(s.variableName)], color: Ve },
|
|
1535
|
+
{ tag: [s.processingInstruction, s.string, s.inserted], color: dl },
|
|
1536
|
+
{ tag: s.invalid, color: sl }
|
|
1537
|
+
]), vl = [
|
|
1538
|
+
hl,
|
|
1539
|
+
Ze(bl)
|
|
1540
|
+
], pl = "#e5c07b", Ne = "#3f4a54", kl = "#56b6c2", Cl = "#fff", oe = "#3f4a54", qe = "#2d8cf0", $l = "#2d8cf0", yl = "#3f4a54", Ue = "#d19a66", xl = "#c678dd", wl = "#21252b", Tl = "#ceedfa33", Ge = "var(--md-bk-color)", ue = "var(--md-bk-color)", Sl = "#bad5fa", Ke = "#3f4a54", Al = he.theme(
|
|
1522
1541
|
{
|
|
1523
1542
|
"&": {
|
|
1524
1543
|
color: oe,
|
|
1525
|
-
backgroundColor:
|
|
1544
|
+
backgroundColor: Ge
|
|
1526
1545
|
},
|
|
1527
1546
|
".cm-content": {
|
|
1528
|
-
caretColor:
|
|
1547
|
+
caretColor: Ke
|
|
1529
1548
|
},
|
|
1530
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1531
|
-
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor:
|
|
1532
|
-
".cm-panels": { backgroundColor:
|
|
1549
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: Ke },
|
|
1550
|
+
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Sl },
|
|
1551
|
+
".cm-panels": { backgroundColor: wl, color: oe },
|
|
1533
1552
|
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
1534
1553
|
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
1535
1554
|
".cm-searchMatch": {
|
|
@@ -1545,13 +1564,13 @@ $$
|
|
|
1545
1564
|
backgroundColor: "#bad0f847"
|
|
1546
1565
|
},
|
|
1547
1566
|
".cm-gutters": {
|
|
1548
|
-
backgroundColor:
|
|
1567
|
+
backgroundColor: Ge,
|
|
1549
1568
|
color: oe,
|
|
1550
1569
|
borderRight: "1px solid",
|
|
1551
1570
|
borderColor: "var(--md-border-color)"
|
|
1552
1571
|
},
|
|
1553
1572
|
".cm-activeLineGutter": {
|
|
1554
|
-
backgroundColor:
|
|
1573
|
+
backgroundColor: Tl
|
|
1555
1574
|
},
|
|
1556
1575
|
".cm-foldPlaceholder": {
|
|
1557
1576
|
backgroundColor: "transparent",
|
|
@@ -1560,15 +1579,15 @@ $$
|
|
|
1560
1579
|
},
|
|
1561
1580
|
".cm-tooltip": {
|
|
1562
1581
|
border: "1px solid var(--md-border-color)",
|
|
1563
|
-
backgroundColor:
|
|
1582
|
+
backgroundColor: ue
|
|
1564
1583
|
},
|
|
1565
1584
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1566
1585
|
borderTopColor: "transparent",
|
|
1567
1586
|
borderBottomColor: "transparent"
|
|
1568
1587
|
},
|
|
1569
1588
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
1570
|
-
borderTopColor:
|
|
1571
|
-
borderBottomColor:
|
|
1589
|
+
borderTopColor: ue,
|
|
1590
|
+
borderBottomColor: ue
|
|
1572
1591
|
},
|
|
1573
1592
|
".cm-tooltip-autocomplete": {
|
|
1574
1593
|
"& > ul > li[aria-selected]": {
|
|
@@ -1577,11 +1596,11 @@ $$
|
|
|
1577
1596
|
}
|
|
1578
1597
|
}
|
|
1579
1598
|
// { dark: true }
|
|
1580
|
-
),
|
|
1581
|
-
{ tag: s.keyword, color:
|
|
1582
|
-
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color:
|
|
1583
|
-
{ tag: [s.function(s.variableName), s.labelName], color:
|
|
1584
|
-
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color:
|
|
1599
|
+
), Ml = Ye.define([
|
|
1600
|
+
{ tag: s.keyword, color: xl },
|
|
1601
|
+
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: Ne },
|
|
1602
|
+
{ tag: [s.function(s.variableName), s.labelName], color: $l },
|
|
1603
|
+
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color: Ue },
|
|
1585
1604
|
{ tag: [s.definition(s.name), s.separator], color: oe },
|
|
1586
1605
|
{
|
|
1587
1606
|
tag: [
|
|
@@ -1594,7 +1613,7 @@ $$
|
|
|
1594
1613
|
s.self,
|
|
1595
1614
|
s.namespace
|
|
1596
1615
|
],
|
|
1597
|
-
color:
|
|
1616
|
+
color: pl
|
|
1598
1617
|
},
|
|
1599
1618
|
{
|
|
1600
1619
|
tag: [
|
|
@@ -1606,20 +1625,20 @@ $$
|
|
|
1606
1625
|
s.link,
|
|
1607
1626
|
s.special(s.string)
|
|
1608
1627
|
],
|
|
1609
|
-
color:
|
|
1628
|
+
color: kl
|
|
1610
1629
|
},
|
|
1611
|
-
{ tag: [s.meta, s.comment], color:
|
|
1630
|
+
{ tag: [s.meta, s.comment], color: qe },
|
|
1612
1631
|
{ tag: s.strong, fontWeight: "bold" },
|
|
1613
1632
|
{ tag: s.emphasis, fontStyle: "italic" },
|
|
1614
1633
|
{ tag: s.strikethrough, textDecoration: "line-through" },
|
|
1615
|
-
{ tag: s.link, color:
|
|
1616
|
-
{ tag: s.heading, fontWeight: "bold", color:
|
|
1617
|
-
{ tag: [s.atom, s.bool, s.special(s.variableName)], color:
|
|
1618
|
-
{ tag: [s.processingInstruction, s.string, s.inserted], color:
|
|
1619
|
-
{ tag: s.invalid, color:
|
|
1620
|
-
]),
|
|
1621
|
-
|
|
1622
|
-
|
|
1634
|
+
{ tag: s.link, color: qe, textDecoration: "underline" },
|
|
1635
|
+
{ tag: s.heading, fontWeight: "bold", color: Ne },
|
|
1636
|
+
{ tag: [s.atom, s.bool, s.special(s.variableName)], color: Ue },
|
|
1637
|
+
{ tag: [s.processingInstruction, s.string, s.inserted], color: yl },
|
|
1638
|
+
{ tag: s.invalid, color: Cl }
|
|
1639
|
+
]), Ll = [
|
|
1640
|
+
Al,
|
|
1641
|
+
Ze(Ml)
|
|
1623
1642
|
], ie = (e, o, a, l, i) => (r, c, m, f) => {
|
|
1624
1643
|
const u = `${e}${o}`.slice(f - m);
|
|
1625
1644
|
r.dispatch(r.state.replaceSelection(`${u}${a}${l}`));
|
|
@@ -1636,10 +1655,10 @@ $$
|
|
|
1636
1655
|
1
|
|
1637
1656
|
)
|
|
1638
1657
|
}), r.focus();
|
|
1639
|
-
},
|
|
1658
|
+
}, je = (e) => (o, a, l, i) => {
|
|
1640
1659
|
const r = e.slice(i - l);
|
|
1641
1660
|
o.dispatch(o.state.replaceSelection(`${r} `));
|
|
1642
|
-
},
|
|
1661
|
+
}, Dl = (e) => {
|
|
1643
1662
|
const o = (a) => {
|
|
1644
1663
|
const l = a.matchBefore(
|
|
1645
1664
|
/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
|
|
@@ -1653,7 +1672,7 @@ $$
|
|
|
1653
1672
|
return {
|
|
1654
1673
|
label: c,
|
|
1655
1674
|
type: "text",
|
|
1656
|
-
apply:
|
|
1675
|
+
apply: je(c)
|
|
1657
1676
|
};
|
|
1658
1677
|
}),
|
|
1659
1678
|
// 任务列表
|
|
@@ -1662,7 +1681,7 @@ $$
|
|
|
1662
1681
|
return {
|
|
1663
1682
|
label: r,
|
|
1664
1683
|
type: "text",
|
|
1665
|
-
apply:
|
|
1684
|
+
apply: je(r)
|
|
1666
1685
|
};
|
|
1667
1686
|
}),
|
|
1668
1687
|
// 代码
|
|
@@ -1735,16 +1754,16 @@ $$`, "title")
|
|
|
1735
1754
|
]
|
|
1736
1755
|
};
|
|
1737
1756
|
};
|
|
1738
|
-
return
|
|
1739
|
-
override: e ? [o, ...e] : [o]
|
|
1757
|
+
return Nt({
|
|
1758
|
+
override: e ? [o, Et, ...e] : [o]
|
|
1740
1759
|
});
|
|
1741
|
-
},
|
|
1742
|
-
const o = new
|
|
1760
|
+
}, El = Dl, Y = (e) => {
|
|
1761
|
+
const o = new Rt();
|
|
1743
1762
|
return (l) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(l) }) : e.dispatch({
|
|
1744
|
-
effects:
|
|
1763
|
+
effects: Pt.appendConfig.of(o.of(l))
|
|
1745
1764
|
}), !0);
|
|
1746
1765
|
};
|
|
1747
|
-
class
|
|
1766
|
+
class Hl {
|
|
1748
1767
|
constructor(o) {
|
|
1749
1768
|
U(this, "view");
|
|
1750
1769
|
// 切换tabSize的执行方法。切换时,Compartment实例需要相同
|
|
@@ -1827,8 +1846,8 @@ class Al {
|
|
|
1827
1846
|
*/
|
|
1828
1847
|
setTabSize(o) {
|
|
1829
1848
|
this.toggleTabSize([
|
|
1830
|
-
|
|
1831
|
-
|
|
1849
|
+
ce.tabSize.of(o),
|
|
1850
|
+
Vt.of(" ".repeat(o))
|
|
1832
1851
|
]);
|
|
1833
1852
|
}
|
|
1834
1853
|
/**
|
|
@@ -1837,7 +1856,7 @@ class Al {
|
|
|
1837
1856
|
* @param t 目标内容
|
|
1838
1857
|
*/
|
|
1839
1858
|
setPlaceholder(o) {
|
|
1840
|
-
this.togglePlaceholder(
|
|
1859
|
+
this.togglePlaceholder(At(o));
|
|
1841
1860
|
}
|
|
1842
1861
|
focus(o) {
|
|
1843
1862
|
if (this.view.focus(), !o)
|
|
@@ -1862,18 +1881,18 @@ class Al {
|
|
|
1862
1881
|
});
|
|
1863
1882
|
}
|
|
1864
1883
|
setDisabled(o) {
|
|
1865
|
-
this.toggleDisabled([
|
|
1884
|
+
this.toggleDisabled([he.editable.of(!o)]);
|
|
1866
1885
|
}
|
|
1867
1886
|
setReadOnly(o) {
|
|
1868
|
-
this.toggleReadOnly([
|
|
1887
|
+
this.toggleReadOnly([ce.readOnly.of(o)]);
|
|
1869
1888
|
}
|
|
1870
1889
|
setMaxLength(o) {
|
|
1871
1890
|
this.toggleMaxlength([
|
|
1872
|
-
|
|
1891
|
+
ce.changeFilter.of((a) => a.newDoc.length <= o)
|
|
1873
1892
|
]);
|
|
1874
1893
|
}
|
|
1875
1894
|
}
|
|
1876
|
-
const
|
|
1895
|
+
const Il = (e) => {
|
|
1877
1896
|
const o = S("editorId");
|
|
1878
1897
|
return (l) => {
|
|
1879
1898
|
if (l.clipboardData) {
|
|
@@ -1894,18 +1913,18 @@ const Ml = (e) => {
|
|
|
1894
1913
|
}
|
|
1895
1914
|
}
|
|
1896
1915
|
};
|
|
1897
|
-
},
|
|
1916
|
+
}, Bl = Il, Fl = (e) => {
|
|
1898
1917
|
const o = S("editorId");
|
|
1899
1918
|
z(() => {
|
|
1900
1919
|
h.on(o, {
|
|
1901
|
-
name:
|
|
1920
|
+
name: ft,
|
|
1902
1921
|
callback(a) {
|
|
1903
1922
|
var l;
|
|
1904
1923
|
(l = e.value) == null || l.focus(a);
|
|
1905
1924
|
}
|
|
1906
1925
|
});
|
|
1907
1926
|
});
|
|
1908
|
-
},
|
|
1927
|
+
}, Ol = Fl, Vl = (e, o) => [
|
|
1909
1928
|
{
|
|
1910
1929
|
key: "Ctrl-b",
|
|
1911
1930
|
mac: "Cmd-b",
|
|
@@ -1914,13 +1933,13 @@ const Ml = (e) => {
|
|
|
1914
1933
|
{
|
|
1915
1934
|
key: "Ctrl-d",
|
|
1916
1935
|
mac: "Cmd-d",
|
|
1917
|
-
run:
|
|
1936
|
+
run: It,
|
|
1918
1937
|
preventDefault: !0
|
|
1919
1938
|
},
|
|
1920
1939
|
{
|
|
1921
1940
|
key: "Ctrl-s",
|
|
1922
1941
|
mac: "Cmd-s",
|
|
1923
|
-
run: (M) => (h.emit(e,
|
|
1942
|
+
run: (M) => (h.emit(e, We, M.state.doc.toString()), !0),
|
|
1924
1943
|
shift: () => (h.emit(e, "replace", "strikeThrough"), !0)
|
|
1925
1944
|
},
|
|
1926
1945
|
{
|
|
@@ -1984,8 +2003,8 @@ const Ml = (e) => {
|
|
|
1984
2003
|
key: "Ctrl-c",
|
|
1985
2004
|
mac: "Cmd-c",
|
|
1986
2005
|
shift: () => (h.emit(e, "replace", "code"), !0),
|
|
1987
|
-
any(M,
|
|
1988
|
-
return (
|
|
2006
|
+
any(M, $) {
|
|
2007
|
+
return ($.ctrlKey || $.metaKey) && $.altKey && $.code === "KeyC" ? (h.emit(e, "replace", "codeRow"), !0) : !1;
|
|
1989
2008
|
}
|
|
1990
2009
|
},
|
|
1991
2010
|
{
|
|
@@ -1999,13 +2018,14 @@ const Ml = (e) => {
|
|
|
1999
2018
|
shift: () => o.noPrettier ? !1 : (h.emit(e, "replace", "prettier"), !0)
|
|
2000
2019
|
},
|
|
2001
2020
|
{
|
|
2002
|
-
any: (M,
|
|
2021
|
+
any: (M, $) => ($.ctrlKey || $.metaKey) && $.altKey && $.shiftKey && $.code === "KeyT" ? (h.emit(e, "replace", "table"), !0) : !1
|
|
2003
2022
|
}
|
|
2004
|
-
],
|
|
2005
|
-
const o = S("tabWidth"), a = S("editorId"), l = S("theme"), i = G(), r =
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2023
|
+
], Rl = Vl, Pl = (e) => {
|
|
2024
|
+
const o = S("tabWidth"), a = S("editorId"), l = S("theme"), i = G(), r = tt(), c = Rl(a, e), m = Bl(e), f = [
|
|
2025
|
+
Mt.of([...c, Bt]),
|
|
2026
|
+
St,
|
|
2027
|
+
Ht(),
|
|
2028
|
+
Dt({ codeLanguages: Lt }),
|
|
2009
2029
|
// 横向换行
|
|
2010
2030
|
re.lineWrapping,
|
|
2011
2031
|
re.updateListener.of((d) => {
|
|
@@ -2019,8 +2039,8 @@ const Ml = (e) => {
|
|
|
2019
2039
|
], u = () => {
|
|
2020
2040
|
const d = [
|
|
2021
2041
|
...f,
|
|
2022
|
-
l.value === "light" ?
|
|
2023
|
-
|
|
2042
|
+
l.value === "light" ? Ll : vl,
|
|
2043
|
+
El(e.completions)
|
|
2024
2044
|
];
|
|
2025
2045
|
return W.codeMirrorExtensions(l.value, d, [
|
|
2026
2046
|
...c
|
|
@@ -2030,25 +2050,25 @@ const Ml = (e) => {
|
|
|
2030
2050
|
const d = new re({
|
|
2031
2051
|
doc: e.value,
|
|
2032
2052
|
parent: i.value
|
|
2033
|
-
}), v = new
|
|
2053
|
+
}), v = new Hl(d);
|
|
2034
2054
|
r.value = v, setTimeout(() => {
|
|
2035
2055
|
v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), v.setExtensions(u()), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && d.focus();
|
|
2036
2056
|
}, 0), h.on(a, {
|
|
2037
2057
|
name: "ctrlZ",
|
|
2038
2058
|
callback() {
|
|
2039
|
-
|
|
2059
|
+
Ft(d);
|
|
2040
2060
|
}
|
|
2041
2061
|
}), h.on(a, {
|
|
2042
2062
|
name: "ctrlShiftZ",
|
|
2043
2063
|
callback() {
|
|
2044
|
-
|
|
2064
|
+
Ot(d);
|
|
2045
2065
|
}
|
|
2046
2066
|
}), h.on(a, {
|
|
2047
2067
|
name: "replace",
|
|
2048
2068
|
callback(y, b = {}) {
|
|
2049
|
-
var
|
|
2050
|
-
const { text: p, options: g } =
|
|
2051
|
-
(
|
|
2069
|
+
var C;
|
|
2070
|
+
const { text: p, options: g } = nl(y, r.value, b);
|
|
2071
|
+
(C = r.value) == null || C.replaceSelectedText(p, g);
|
|
2052
2072
|
}
|
|
2053
2073
|
});
|
|
2054
2074
|
}), F(
|
|
@@ -2090,11 +2110,11 @@ const Ml = (e) => {
|
|
|
2090
2110
|
var d;
|
|
2091
2111
|
e.maxlength && ((d = r.value) == null || d.setMaxLength(e.maxlength));
|
|
2092
2112
|
}
|
|
2093
|
-
),
|
|
2113
|
+
), Ol(r), {
|
|
2094
2114
|
inputWrapperRef: i,
|
|
2095
2115
|
codeMirrorUt: r
|
|
2096
2116
|
};
|
|
2097
|
-
},
|
|
2117
|
+
}, Nl = Pl, ql = {
|
|
2098
2118
|
value: {
|
|
2099
2119
|
type: String,
|
|
2100
2120
|
default: ""
|
|
@@ -2194,20 +2214,20 @@ const Ml = (e) => {
|
|
|
2194
2214
|
type: String,
|
|
2195
2215
|
default: "light"
|
|
2196
2216
|
}
|
|
2197
|
-
},
|
|
2217
|
+
}, Ul = /* @__PURE__ */ O({
|
|
2198
2218
|
name: "MDEditorContent",
|
|
2199
|
-
props:
|
|
2219
|
+
props: ql,
|
|
2200
2220
|
setup(e) {
|
|
2201
2221
|
const o = S("editorId"), a = G(""), {
|
|
2202
2222
|
inputWrapperRef: l,
|
|
2203
2223
|
codeMirrorUt: i
|
|
2204
|
-
} =
|
|
2205
|
-
return
|
|
2224
|
+
} = Nl(e);
|
|
2225
|
+
return al(e, a, i), () => t("div", {
|
|
2206
2226
|
class: `${n}-content`
|
|
2207
2227
|
}, [t("div", {
|
|
2208
2228
|
class: `${n}-input-wrapper`,
|
|
2209
2229
|
ref: l
|
|
2210
|
-
}, null), t(
|
|
2230
|
+
}, null), t(gt, {
|
|
2211
2231
|
modelValue: e.value,
|
|
2212
2232
|
setting: e.setting,
|
|
2213
2233
|
onHtmlChanged: (r) => {
|
|
@@ -2220,7 +2240,7 @@ const Ml = (e) => {
|
|
|
2220
2240
|
noKatex: e.noKatex,
|
|
2221
2241
|
formatCopiedText: e.formatCopiedText,
|
|
2222
2242
|
noHighlight: e.noHighlight
|
|
2223
|
-
}, null), e.catalogVisible && t(
|
|
2243
|
+
}, null), e.catalogVisible && t(Je, {
|
|
2224
2244
|
theme: e.theme,
|
|
2225
2245
|
class: `${n}-catalog-editor`,
|
|
2226
2246
|
editorId: o,
|
|
@@ -2228,7 +2248,7 @@ const Ml = (e) => {
|
|
|
2228
2248
|
key: "internal-catalog"
|
|
2229
2249
|
}, null)]);
|
|
2230
2250
|
}
|
|
2231
|
-
}),
|
|
2251
|
+
}), Gl = /* @__PURE__ */ O({
|
|
2232
2252
|
props: {
|
|
2233
2253
|
modelValue: {
|
|
2234
2254
|
type: String,
|
|
@@ -2246,7 +2266,7 @@ const Ml = (e) => {
|
|
|
2246
2266
|
}, [`${(a = o.value.footer) == null ? void 0 : a.markdownTotal}:`]), t("span", null, [((l = e.modelValue) == null ? void 0 : l.length) || 0])]);
|
|
2247
2267
|
};
|
|
2248
2268
|
}
|
|
2249
|
-
}),
|
|
2269
|
+
}), Kl = {
|
|
2250
2270
|
checked: {
|
|
2251
2271
|
type: Boolean,
|
|
2252
2272
|
default: !1
|
|
@@ -2256,8 +2276,8 @@ const Ml = (e) => {
|
|
|
2256
2276
|
default: () => {
|
|
2257
2277
|
}
|
|
2258
2278
|
}
|
|
2259
|
-
},
|
|
2260
|
-
props:
|
|
2279
|
+
}, jl = /* @__PURE__ */ O({
|
|
2280
|
+
props: Kl,
|
|
2261
2281
|
setup(e) {
|
|
2262
2282
|
return () => t("div", {
|
|
2263
2283
|
class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
|
|
@@ -2266,7 +2286,7 @@ const Ml = (e) => {
|
|
|
2266
2286
|
}
|
|
2267
2287
|
}, null);
|
|
2268
2288
|
}
|
|
2269
|
-
}),
|
|
2289
|
+
}), _l = {
|
|
2270
2290
|
scrollAuto: {
|
|
2271
2291
|
type: Boolean
|
|
2272
2292
|
},
|
|
@@ -2275,8 +2295,8 @@ const Ml = (e) => {
|
|
|
2275
2295
|
default: () => {
|
|
2276
2296
|
}
|
|
2277
2297
|
}
|
|
2278
|
-
},
|
|
2279
|
-
props:
|
|
2298
|
+
}, Wl = /* @__PURE__ */ O({
|
|
2299
|
+
props: _l,
|
|
2280
2300
|
setup(e) {
|
|
2281
2301
|
const o = S("usedLanguageText");
|
|
2282
2302
|
return () => {
|
|
@@ -2288,13 +2308,13 @@ const Ml = (e) => {
|
|
|
2288
2308
|
onClick: () => {
|
|
2289
2309
|
e.onScrollAutoChange(!e.scrollAuto);
|
|
2290
2310
|
}
|
|
2291
|
-
}, [(a = o.value.footer) == null ? void 0 : a.scrollAuto]), t(
|
|
2311
|
+
}, [(a = o.value.footer) == null ? void 0 : a.scrollAuto]), t(jl, {
|
|
2292
2312
|
checked: e.scrollAuto,
|
|
2293
2313
|
onChange: e.onScrollAutoChange
|
|
2294
2314
|
}, null)]);
|
|
2295
2315
|
};
|
|
2296
2316
|
}
|
|
2297
|
-
}),
|
|
2317
|
+
}), zl = {
|
|
2298
2318
|
modelValue: {
|
|
2299
2319
|
type: String,
|
|
2300
2320
|
default: ""
|
|
@@ -2314,22 +2334,22 @@ const Ml = (e) => {
|
|
|
2314
2334
|
defFooters: {
|
|
2315
2335
|
type: Object
|
|
2316
2336
|
}
|
|
2317
|
-
},
|
|
2337
|
+
}, Yl = /* @__PURE__ */ O({
|
|
2318
2338
|
name: "MDEditorFooter",
|
|
2319
|
-
props:
|
|
2339
|
+
props: zl,
|
|
2320
2340
|
setup(e) {
|
|
2321
|
-
const o =
|
|
2341
|
+
const o = ge(() => {
|
|
2322
2342
|
const l = e.footers.indexOf("="), i = l === -1 ? e.footers : e.footers.slice(0, l), r = l === -1 ? [] : e.footers.slice(l, Number.MAX_SAFE_INTEGER);
|
|
2323
2343
|
return [i, r];
|
|
2324
2344
|
}), a = (l) => {
|
|
2325
|
-
if (
|
|
2345
|
+
if (nt.includes(l))
|
|
2326
2346
|
switch (l) {
|
|
2327
2347
|
case "markdownTotal":
|
|
2328
|
-
return t(
|
|
2348
|
+
return t(Gl, {
|
|
2329
2349
|
modelValue: e.modelValue
|
|
2330
2350
|
}, null);
|
|
2331
2351
|
case "scrollSwitch":
|
|
2332
|
-
return t(
|
|
2352
|
+
return t(Wl, {
|
|
2333
2353
|
scrollAuto: e.scrollAuto,
|
|
2334
2354
|
onScrollAutoChange: e.onScrollAutoChange
|
|
2335
2355
|
}, null);
|
|
@@ -2348,10 +2368,10 @@ const Ml = (e) => {
|
|
|
2348
2368
|
}, [i])]);
|
|
2349
2369
|
};
|
|
2350
2370
|
}
|
|
2351
|
-
}),
|
|
2371
|
+
}), Zl = /* @__PURE__ */ O({
|
|
2352
2372
|
name: "MdEditorV3",
|
|
2353
|
-
props:
|
|
2354
|
-
emits:
|
|
2373
|
+
props: ht,
|
|
2374
|
+
emits: bt,
|
|
2355
2375
|
setup(e, o) {
|
|
2356
2376
|
const {
|
|
2357
2377
|
editorId: a,
|
|
@@ -2363,16 +2383,16 @@ const Ml = (e) => {
|
|
|
2363
2383
|
} = e, f = Z({
|
|
2364
2384
|
scrollAuto: e.scrollAuto
|
|
2365
2385
|
});
|
|
2366
|
-
|
|
2367
|
-
const [u, d] =
|
|
2368
|
-
return
|
|
2386
|
+
vt(e, o), pt(e), kt(e);
|
|
2387
|
+
const [u, d] = Ct(e, o), v = $t(e);
|
|
2388
|
+
return lt(() => {
|
|
2369
2389
|
h.clear(a);
|
|
2370
|
-
}),
|
|
2390
|
+
}), yt(e, o, v, u, d), () => {
|
|
2371
2391
|
var p;
|
|
2372
|
-
const y =
|
|
2392
|
+
const y = Be({
|
|
2373
2393
|
props: e,
|
|
2374
2394
|
ctx: o
|
|
2375
|
-
}, "defToolbars"), b =
|
|
2395
|
+
}, "defToolbars"), b = Be({
|
|
2376
2396
|
props: e,
|
|
2377
2397
|
ctx: o
|
|
2378
2398
|
}, "defFooters");
|
|
@@ -2380,7 +2400,7 @@ const Ml = (e) => {
|
|
|
2380
2400
|
id: a,
|
|
2381
2401
|
class: [n, e.class, e.theme === "dark" && `${n}-dark`, u.fullscreen || u.pageFullscreen ? `${n}-fullscreen` : ""],
|
|
2382
2402
|
style: e.style
|
|
2383
|
-
}, [t(
|
|
2403
|
+
}, [t(el, {
|
|
2384
2404
|
noPrettier: r,
|
|
2385
2405
|
toolbars: e.toolbars,
|
|
2386
2406
|
toolbarsExclude: e.toolbarsExclude,
|
|
@@ -2389,7 +2409,7 @@ const Ml = (e) => {
|
|
|
2389
2409
|
tableShape: e.tableShape,
|
|
2390
2410
|
defToolbars: y,
|
|
2391
2411
|
noUploadImg: c
|
|
2392
|
-
}, null), t(
|
|
2412
|
+
}, null), t(Ul, {
|
|
2393
2413
|
value: e.modelValue,
|
|
2394
2414
|
setting: u,
|
|
2395
2415
|
mdHeadingId: e.mdHeadingId,
|
|
@@ -2424,7 +2444,7 @@ const Ml = (e) => {
|
|
|
2424
2444
|
completions: e.completions,
|
|
2425
2445
|
catalogVisible: v.value,
|
|
2426
2446
|
theme: e.theme
|
|
2427
|
-
}, null), ((p = e.footers) == null ? void 0 : p.length) > 0 && t(
|
|
2447
|
+
}, null), ((p = e.footers) == null ? void 0 : p.length) > 0 && t(Yl, {
|
|
2428
2448
|
modelValue: e.modelValue,
|
|
2429
2449
|
footers: e.footers,
|
|
2430
2450
|
defFooters: b,
|
|
@@ -2433,8 +2453,8 @@ const Ml = (e) => {
|
|
|
2433
2453
|
}, null)]);
|
|
2434
2454
|
};
|
|
2435
2455
|
}
|
|
2436
|
-
}),
|
|
2437
|
-
|
|
2456
|
+
}), me = Zl;
|
|
2457
|
+
me.install = (e) => (e.component(me.name, me), e.use(qt).use(rt).use(Tt).use(Je).use(xt), e);
|
|
2438
2458
|
export {
|
|
2439
|
-
|
|
2459
|
+
me as default
|
|
2440
2460
|
};
|