md-editor-v3 4.6.2-beta.1 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/MdEditor.cjs +15 -15
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/MdEditor.mjs +530 -518
- package/lib/es/index.mjs +17 -18
- package/lib/types/MdEditor/type.d.ts +1 -3
- package/lib/umd/index.js +69 -69
- package/package.json +8 -9
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (e, o, l) => (
|
|
4
|
-
import { defineComponent as P, createVNode as t, inject as I, ref as j, onMounted as J, reactive as ee, computed as
|
|
5
|
-
import { p as n, c as Y, l as
|
|
6
|
-
import { draggingScroll as
|
|
7
|
-
import { D as ie, a as
|
|
8
|
-
import { b, h as
|
|
9
|
-
import { a as
|
|
10
|
-
import { M as
|
|
11
|
-
import { minimalSetup as
|
|
12
|
-
import { EditorView as
|
|
13
|
-
import { languages as
|
|
14
|
-
import { markdown as
|
|
15
|
-
import {
|
|
16
|
-
import { deleteLine as
|
|
17
|
-
import { HighlightStyle as
|
|
1
|
+
var Nt = Object.defineProperty;
|
|
2
|
+
var Ot = (e, o, l) => o in e ? Nt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
|
|
3
|
+
var q = (e, o, l) => (Ot(e, typeof o != "symbol" ? o + "" : o, l), l);
|
|
4
|
+
import { defineComponent as P, createVNode as t, inject as I, ref as j, onMounted as J, reactive as ee, computed as Te, watch as V, nextTick as he, Fragment as St, cloneVNode as ut, toRef as me, shallowRef as Vt, onBeforeUnmount as Ft } from "vue";
|
|
5
|
+
import { p as n, c as Y, l as Bt, g as Rt, j as Pt } from "./chunks/config.mjs";
|
|
6
|
+
import { draggingScroll as Ut, linkTo as _t, debounce as qt, createSmoothScroll as Gt, throttle as jt } from "@vavt/util";
|
|
7
|
+
import { D as ie, a as Kt } from "./chunks/index2.mjs";
|
|
8
|
+
import { b as h, h as Wt, E as te, U as we, i as zt, j as ye, R as w, c as Zt, O as At, k as Mt, l as Lt, T as Xt } from "./chunks/index3.mjs";
|
|
9
|
+
import { a as Yt } from "./chunks/dom.mjs";
|
|
10
|
+
import { M as Dt, I as C } from "./chunks/index.mjs";
|
|
11
|
+
import { minimalSetup as Jt, EditorView as ge } from "codemirror";
|
|
12
|
+
import { EditorView as xe, placeholder as Qt, keymap as el } from "@codemirror/view";
|
|
13
|
+
import { languages as tl } from "@codemirror/language-data";
|
|
14
|
+
import { markdown as ll } from "@codemirror/lang-markdown";
|
|
15
|
+
import { EditorSelection as G, EditorState as ke, Compartment as be, StateEffect as ol } from "@codemirror/state";
|
|
16
|
+
import { deleteLine as al, indentWithTab as nl, undo as rl, redo as il } from "@codemirror/commands";
|
|
17
|
+
import { HighlightStyle as It, syntaxHighlighting as Et, indentUnit as sl } from "@codemirror/language";
|
|
18
18
|
import { tags as s } from "@lezer/highlight";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import yl from "./ModalToolbar.mjs";
|
|
19
|
+
import { autocompletion as cl } from "@codemirror/autocomplete";
|
|
20
|
+
import { c as ul, C as dl, e as ml, a as gl, u as fl, b as bl, d as hl, f as vl, g as kl, h as Cl, i as pl, M as $l } from "./chunks/index4.mjs";
|
|
21
|
+
import Ht from "./MdCatalog.mjs";
|
|
22
|
+
import { g as dt } from "./chunks/vue-tsx.mjs";
|
|
23
|
+
import yl from "./NormalToolbar.mjs";
|
|
24
|
+
import Tl from "./ModalToolbar.mjs";
|
|
26
25
|
import "medium-zoom";
|
|
27
26
|
import "copy-to-clipboard";
|
|
28
27
|
import "markdown-it";
|
|
29
28
|
import "markdown-it-image-figures";
|
|
30
29
|
import "markdown-it-task-lists";
|
|
31
30
|
import "lru-cache";
|
|
32
|
-
const
|
|
31
|
+
const wl = /* @__PURE__ */ P({
|
|
33
32
|
setup() {
|
|
34
33
|
return () => t("div", {
|
|
35
34
|
class: `${n}-divider`
|
|
36
35
|
}, null);
|
|
37
36
|
}
|
|
38
|
-
}),
|
|
37
|
+
}), xl = {
|
|
39
38
|
noPrettier: {
|
|
40
39
|
type: Boolean
|
|
41
40
|
},
|
|
@@ -84,13 +83,13 @@ const Tl = /* @__PURE__ */ P({
|
|
|
84
83
|
showToolbarName: {
|
|
85
84
|
type: Boolean
|
|
86
85
|
}
|
|
87
|
-
},
|
|
88
|
-
var u,
|
|
86
|
+
}, Sl = (e) => {
|
|
87
|
+
var u, d, p, T;
|
|
89
88
|
const o = I("editorId");
|
|
90
|
-
let l = (
|
|
91
|
-
const a = (
|
|
89
|
+
let l = (d = (u = Y.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : d.instance;
|
|
90
|
+
const a = (T = (p = Y.editorExtensions) == null ? void 0 : p.screenfull) == null ? void 0 : T.js, r = j(!1), i = ($) => {
|
|
92
91
|
if (!l) {
|
|
93
|
-
|
|
92
|
+
h.emit(o, te, {
|
|
94
93
|
name: "fullscreen",
|
|
95
94
|
message: "fullscreen is undefined"
|
|
96
95
|
});
|
|
@@ -107,15 +106,15 @@ const Tl = /* @__PURE__ */ P({
|
|
|
107
106
|
return J(() => {
|
|
108
107
|
if (g(), !l) {
|
|
109
108
|
const $ = document.createElement("script");
|
|
110
|
-
$.src = a ||
|
|
109
|
+
$.src = a || Bt, $.onload = c, $.id = `${n}-screenfull`, Yt($, "screenfull");
|
|
111
110
|
}
|
|
112
111
|
}), J(() => {
|
|
113
|
-
|
|
114
|
-
name:
|
|
112
|
+
h.on(o, {
|
|
113
|
+
name: Wt,
|
|
115
114
|
callback: i
|
|
116
115
|
});
|
|
117
116
|
}), { fullscreenHandler: i };
|
|
118
|
-
},
|
|
117
|
+
}, Al = {
|
|
119
118
|
tableShape: {
|
|
120
119
|
type: Array,
|
|
121
120
|
default: () => [6, 4]
|
|
@@ -125,9 +124,9 @@ const Tl = /* @__PURE__ */ P({
|
|
|
125
124
|
default: () => {
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
|
-
},
|
|
127
|
+
}, Ml = /* @__PURE__ */ P({
|
|
129
128
|
name: "TableShape",
|
|
130
|
-
props:
|
|
129
|
+
props: Al,
|
|
131
130
|
setup(e) {
|
|
132
131
|
const o = ee({
|
|
133
132
|
x: -1,
|
|
@@ -154,7 +153,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
154
153
|
class: [`${n}-table-shape-col-default`, a <= o.x && i <= o.y && `${n}-table-shape-col-include`]
|
|
155
154
|
}, null)]))]))]);
|
|
156
155
|
}
|
|
157
|
-
}),
|
|
156
|
+
}), Ll = Ml, Dl = {
|
|
158
157
|
type: {
|
|
159
158
|
type: String,
|
|
160
159
|
default: "link"
|
|
@@ -173,10 +172,10 @@ const Tl = /* @__PURE__ */ P({
|
|
|
173
172
|
default: () => {
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
|
-
},
|
|
177
|
-
props:
|
|
175
|
+
}, Il = /* @__PURE__ */ P({
|
|
176
|
+
props: Dl,
|
|
178
177
|
setup(e) {
|
|
179
|
-
const o = I("usedLanguageText"), l = I("editorId"), a =
|
|
178
|
+
const o = I("usedLanguageText"), l = I("editorId"), a = Te(() => {
|
|
180
179
|
var i, g;
|
|
181
180
|
switch (e.type) {
|
|
182
181
|
case "link":
|
|
@@ -190,17 +189,17 @@ const Tl = /* @__PURE__ */ P({
|
|
|
190
189
|
desc: "",
|
|
191
190
|
url: ""
|
|
192
191
|
});
|
|
193
|
-
return
|
|
192
|
+
return V(() => e.visible, (i) => {
|
|
194
193
|
i || setTimeout(() => {
|
|
195
194
|
r.desc = "", r.url = "";
|
|
196
195
|
}, 200);
|
|
197
|
-
}), () => t(
|
|
196
|
+
}), () => t(Dt, {
|
|
198
197
|
title: a.value,
|
|
199
198
|
visible: e.visible,
|
|
200
199
|
onClose: e.onCancel
|
|
201
200
|
}, {
|
|
202
201
|
default: () => {
|
|
203
|
-
var i, g, c, u,
|
|
202
|
+
var i, g, c, u, d;
|
|
204
203
|
return [t("div", {
|
|
205
204
|
class: `${n}-form-item`
|
|
206
205
|
}, [t("label", {
|
|
@@ -212,8 +211,8 @@ const Tl = /* @__PURE__ */ P({
|
|
|
212
211
|
id: `link-desc-${l}`,
|
|
213
212
|
type: "text",
|
|
214
213
|
value: r.desc,
|
|
215
|
-
onChange: (
|
|
216
|
-
r.desc =
|
|
214
|
+
onChange: (p) => {
|
|
215
|
+
r.desc = p.target.value;
|
|
217
216
|
},
|
|
218
217
|
autocomplete: "off"
|
|
219
218
|
}, null)]), t("div", {
|
|
@@ -227,8 +226,8 @@ const Tl = /* @__PURE__ */ P({
|
|
|
227
226
|
id: `link-url-${l}`,
|
|
228
227
|
type: "text",
|
|
229
228
|
value: r.url,
|
|
230
|
-
onChange: (
|
|
231
|
-
r.url =
|
|
229
|
+
onChange: (p) => {
|
|
230
|
+
r.url = p.target.value;
|
|
232
231
|
},
|
|
233
232
|
autocomplete: "off"
|
|
234
233
|
}, null)]), t("div", {
|
|
@@ -239,11 +238,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
239
238
|
onClick: () => {
|
|
240
239
|
e.onOk(r), r.desc = "", r.url = "";
|
|
241
240
|
}
|
|
242
|
-
}, [(
|
|
241
|
+
}, [(d = o.value.linkModalTips) == null ? void 0 : d.buttonOK])])];
|
|
243
242
|
}
|
|
244
243
|
});
|
|
245
244
|
}
|
|
246
|
-
}),
|
|
245
|
+
}), El = {
|
|
247
246
|
visible: {
|
|
248
247
|
type: Boolean,
|
|
249
248
|
default: !1
|
|
@@ -258,12 +257,12 @@ const Tl = /* @__PURE__ */ P({
|
|
|
258
257
|
default: () => {
|
|
259
258
|
}
|
|
260
259
|
}
|
|
261
|
-
},
|
|
262
|
-
props:
|
|
260
|
+
}, Hl = /* @__PURE__ */ P({
|
|
261
|
+
props: El,
|
|
263
262
|
setup(e) {
|
|
264
|
-
var
|
|
263
|
+
var p, T, $;
|
|
265
264
|
const o = I("usedLanguageText"), l = I("editorId");
|
|
266
|
-
let a = ($ = (
|
|
265
|
+
let a = ($ = (T = (p = Y) == null ? void 0 : p.editorExtensions) == null ? void 0 : T.cropper) == null ? void 0 : $.instance;
|
|
267
266
|
const r = j(), i = j(), g = j(), c = ee({
|
|
268
267
|
cropperInited: !1,
|
|
269
268
|
imgSelected: !1,
|
|
@@ -272,33 +271,33 @@ const Tl = /* @__PURE__ */ P({
|
|
|
272
271
|
isFullscreen: !1
|
|
273
272
|
});
|
|
274
273
|
let u = null;
|
|
275
|
-
|
|
274
|
+
V(() => e.visible, () => {
|
|
276
275
|
e.visible && !c.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
|
|
277
276
|
if (!a) {
|
|
278
|
-
|
|
277
|
+
h.emit(l, te, {
|
|
279
278
|
name: "Cropper",
|
|
280
279
|
message: "Cropper is undefined"
|
|
281
280
|
});
|
|
282
281
|
return;
|
|
283
282
|
}
|
|
284
|
-
const
|
|
285
|
-
if (c.imgSelected = !0, (
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
c.imgSrc = f.target.result,
|
|
283
|
+
const m = r.value.files || [];
|
|
284
|
+
if (c.imgSelected = !0, (m == null ? void 0 : m.length) > 0) {
|
|
285
|
+
const b = new FileReader();
|
|
286
|
+
b.onload = (f) => {
|
|
287
|
+
c.imgSrc = f.target.result, he(() => {
|
|
289
288
|
u = new a(i.value, {
|
|
290
289
|
viewMode: 2,
|
|
291
290
|
preview: `.${n}-clip-preview-target`
|
|
292
291
|
// aspectRatio: 16 / 9,
|
|
293
292
|
});
|
|
294
293
|
});
|
|
295
|
-
},
|
|
294
|
+
}, b.readAsDataURL(m[0]);
|
|
296
295
|
}
|
|
297
296
|
});
|
|
298
|
-
}),
|
|
297
|
+
}), V(() => [c.imgSelected], () => {
|
|
299
298
|
g.value.style = "";
|
|
300
|
-
}),
|
|
301
|
-
|
|
299
|
+
}), V(() => c.isFullscreen, () => {
|
|
300
|
+
he(() => {
|
|
302
301
|
u == null || u.destroy(), g.value.style = "", i.value && (u = new a(i.value, {
|
|
303
302
|
viewMode: 2,
|
|
304
303
|
preview: `.${n}-clip-preview-target`
|
|
@@ -306,26 +305,26 @@ const Tl = /* @__PURE__ */ P({
|
|
|
306
305
|
}));
|
|
307
306
|
});
|
|
308
307
|
});
|
|
309
|
-
const
|
|
308
|
+
const d = () => {
|
|
310
309
|
u.clear(), u.destroy(), u = null, r.value.value = "", c.imgSelected = !1;
|
|
311
310
|
};
|
|
312
311
|
return () => {
|
|
313
|
-
var
|
|
314
|
-
return t(
|
|
312
|
+
var m;
|
|
313
|
+
return t(Dt, {
|
|
315
314
|
class: `${n}-modal-clip`,
|
|
316
|
-
title: (
|
|
315
|
+
title: (m = o.value.clipModalTips) == null ? void 0 : m.title,
|
|
317
316
|
visible: e.visible,
|
|
318
317
|
onClose: e.onCancel,
|
|
319
318
|
showAdjust: !0,
|
|
320
319
|
isFullscreen: c.isFullscreen,
|
|
321
|
-
onAdjust: (
|
|
322
|
-
c.isFullscreen =
|
|
320
|
+
onAdjust: (b) => {
|
|
321
|
+
c.isFullscreen = b;
|
|
323
322
|
},
|
|
324
323
|
width: "668px",
|
|
325
324
|
height: "421px"
|
|
326
325
|
}, {
|
|
327
326
|
default: () => {
|
|
328
|
-
var
|
|
327
|
+
var b, f;
|
|
329
328
|
return [t("div", {
|
|
330
329
|
class: `${n}-form-item ${n}-clip`
|
|
331
330
|
}, [t("div", {
|
|
@@ -341,15 +340,15 @@ const Tl = /* @__PURE__ */ P({
|
|
|
341
340
|
alt: ""
|
|
342
341
|
}, null), t("div", {
|
|
343
342
|
class: `${n}-clip-delete`,
|
|
344
|
-
onClick:
|
|
345
|
-
}, [t(
|
|
343
|
+
onClick: d
|
|
344
|
+
}, [t(C, {
|
|
346
345
|
name: "delete"
|
|
347
346
|
}, null)])]) : t("div", {
|
|
348
347
|
class: `${n}-clip-upload`,
|
|
349
348
|
onClick: () => {
|
|
350
349
|
r.value.click();
|
|
351
350
|
}
|
|
352
|
-
}, [t(
|
|
351
|
+
}, [t(C, {
|
|
353
352
|
name: "upload"
|
|
354
353
|
}, null)])]), t("div", {
|
|
355
354
|
class: `${n}-clip-preview`
|
|
@@ -363,11 +362,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
363
362
|
type: "button",
|
|
364
363
|
onClick: () => {
|
|
365
364
|
if (u) {
|
|
366
|
-
const
|
|
367
|
-
|
|
365
|
+
const v = u.getCroppedCanvas();
|
|
366
|
+
h.emit(l, we, [zt(v.toDataURL("image/png"))], e.onOk), d();
|
|
368
367
|
}
|
|
369
368
|
}
|
|
370
|
-
}, [((
|
|
369
|
+
}, [((b = o.value.clipModalTips) == null ? void 0 : b.buttonUpload) || ((f = o.value.linkModalTips) == null ? void 0 : f.buttonOK)])]), t("input", {
|
|
371
370
|
ref: r,
|
|
372
371
|
accept: "image/*",
|
|
373
372
|
type: "file",
|
|
@@ -380,7 +379,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
380
379
|
});
|
|
381
380
|
};
|
|
382
381
|
}
|
|
383
|
-
}),
|
|
382
|
+
}), Nl = {
|
|
384
383
|
type: {
|
|
385
384
|
type: String,
|
|
386
385
|
default: "link"
|
|
@@ -403,27 +402,27 @@ const Tl = /* @__PURE__ */ P({
|
|
|
403
402
|
default: () => {
|
|
404
403
|
}
|
|
405
404
|
}
|
|
406
|
-
},
|
|
407
|
-
props:
|
|
405
|
+
}, Ol = /* @__PURE__ */ P({
|
|
406
|
+
props: Nl,
|
|
408
407
|
setup(e) {
|
|
409
|
-
return () => t(
|
|
408
|
+
return () => t(St, null, [t(Il, {
|
|
410
409
|
type: e.type,
|
|
411
410
|
visible: e.linkVisible,
|
|
412
411
|
onOk: e.onOk,
|
|
413
412
|
onCancel: e.onCancel
|
|
414
|
-
}, null), t(
|
|
413
|
+
}, null), t(Hl, {
|
|
415
414
|
visible: e.clipVisible,
|
|
416
415
|
onOk: e.onOk,
|
|
417
416
|
onCancel: e.onCancel
|
|
418
417
|
}, null)]);
|
|
419
418
|
}
|
|
420
|
-
}),
|
|
419
|
+
}), Vl = /* @__PURE__ */ P({
|
|
421
420
|
name: "MDEditorToolbar",
|
|
422
|
-
props:
|
|
421
|
+
props: xl,
|
|
423
422
|
setup(e) {
|
|
424
423
|
const o = I("editorId"), l = I("usedLanguageText"), {
|
|
425
424
|
fullscreenHandler: a
|
|
426
|
-
} =
|
|
425
|
+
} = Sl(e), r = `${o}-toolbar-wrapper`, i = j(), g = ee({
|
|
427
426
|
title: !1,
|
|
428
427
|
catalog: !1,
|
|
429
428
|
// 图片上传下拉
|
|
@@ -433,36 +432,36 @@ const Tl = /* @__PURE__ */ P({
|
|
|
433
432
|
// mermaid
|
|
434
433
|
mermaid: !1,
|
|
435
434
|
katex: !1
|
|
436
|
-
}), c = (
|
|
437
|
-
|
|
435
|
+
}), c = (b, f) => {
|
|
436
|
+
h.emit(o, w, b, f);
|
|
438
437
|
}, u = ee({
|
|
439
438
|
type: "link",
|
|
440
439
|
linkVisible: !1,
|
|
441
440
|
clipVisible: !1
|
|
442
|
-
}),
|
|
441
|
+
}), d = j();
|
|
443
442
|
J(() => {
|
|
444
|
-
|
|
445
|
-
name:
|
|
446
|
-
callback(
|
|
447
|
-
u.type =
|
|
443
|
+
h.on(o, {
|
|
444
|
+
name: ye,
|
|
445
|
+
callback(b) {
|
|
446
|
+
u.type = b, u.linkVisible = !0;
|
|
448
447
|
}
|
|
449
448
|
});
|
|
450
449
|
});
|
|
451
|
-
const
|
|
452
|
-
const
|
|
453
|
-
return [
|
|
454
|
-
}),
|
|
455
|
-
|
|
450
|
+
const p = Te(() => {
|
|
451
|
+
const b = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), f = b.indexOf("="), v = f === -1 ? b : b.slice(0, f + 1), y = f === -1 ? [] : b.slice(f, Number.MAX_SAFE_INTEGER);
|
|
452
|
+
return [v, y];
|
|
453
|
+
}), T = j(), $ = () => {
|
|
454
|
+
h.emit(o, we, Array.from(T.value.files || [])), T.value.value = "";
|
|
456
455
|
};
|
|
457
456
|
J(() => {
|
|
458
|
-
|
|
457
|
+
T.value.addEventListener("change", $);
|
|
459
458
|
});
|
|
460
|
-
const
|
|
461
|
-
var f,
|
|
462
|
-
if (
|
|
463
|
-
switch (
|
|
459
|
+
const m = (b) => {
|
|
460
|
+
var f, v, y, x, S, N, L, le, oe, A, M, _, U, O, E, H, F, K, W, ue, ae, X, z, ne, Z, B, R, re, de, Se, Ae, Me, Le, De, Ie, Ee, He, Ne, Oe, Ve, Fe, Be, Re, Pe, Ue, _e, qe, Ge, je, Ke, We, ze, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st, ct;
|
|
461
|
+
if (Rt.includes(b))
|
|
462
|
+
switch (b) {
|
|
464
463
|
case "-":
|
|
465
|
-
return t(
|
|
464
|
+
return t(wl, null, null);
|
|
466
465
|
case "bold":
|
|
467
466
|
return t("div", {
|
|
468
467
|
class: `${n}-toolbar-item`,
|
|
@@ -470,11 +469,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
470
469
|
onClick: () => {
|
|
471
470
|
c("bold");
|
|
472
471
|
}
|
|
473
|
-
}, [t(
|
|
472
|
+
}, [t(C, {
|
|
474
473
|
name: "bold"
|
|
475
474
|
}, null), e.showToolbarName && t("div", {
|
|
476
475
|
class: `${n}-toolbar-item-name`
|
|
477
|
-
}, [(
|
|
476
|
+
}, [(v = l.value.toolbarTips) == null ? void 0 : v.bold])]);
|
|
478
477
|
case "underline":
|
|
479
478
|
return t("div", {
|
|
480
479
|
class: `${n}-toolbar-item`,
|
|
@@ -482,7 +481,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
482
481
|
onClick: () => {
|
|
483
482
|
c("underline");
|
|
484
483
|
}
|
|
485
|
-
}, [t(
|
|
484
|
+
}, [t(C, {
|
|
486
485
|
name: "underline"
|
|
487
486
|
}, null), e.showToolbarName && t("div", {
|
|
488
487
|
class: `${n}-toolbar-item-name`
|
|
@@ -494,7 +493,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
494
493
|
onClick: () => {
|
|
495
494
|
c("italic");
|
|
496
495
|
}
|
|
497
|
-
}, [t(
|
|
496
|
+
}, [t(C, {
|
|
498
497
|
name: "italic"
|
|
499
498
|
}, null), e.showToolbarName && t("div", {
|
|
500
499
|
class: `${n}-toolbar-item-name`
|
|
@@ -506,7 +505,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
506
505
|
onClick: () => {
|
|
507
506
|
c("strikeThrough");
|
|
508
507
|
}
|
|
509
|
-
}, [t(
|
|
508
|
+
}, [t(C, {
|
|
510
509
|
name: "strike-through"
|
|
511
510
|
}, null), e.showToolbarName && t("div", {
|
|
512
511
|
class: `${n}-toolbar-item-name`
|
|
@@ -515,8 +514,8 @@ const Tl = /* @__PURE__ */ P({
|
|
|
515
514
|
return t(ie, {
|
|
516
515
|
relative: `#${r}`,
|
|
517
516
|
visible: g.title,
|
|
518
|
-
onChange: (
|
|
519
|
-
g.title =
|
|
517
|
+
onChange: (k) => {
|
|
518
|
+
g.title = k;
|
|
520
519
|
},
|
|
521
520
|
overlay: t("ul", {
|
|
522
521
|
class: `${n}-menu`,
|
|
@@ -556,11 +555,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
556
555
|
}, [(O = l.value.titleItem) == null ? void 0 : O.h6])])
|
|
557
556
|
}, {
|
|
558
557
|
default: () => {
|
|
559
|
-
var
|
|
558
|
+
var k, D;
|
|
560
559
|
return [t("div", {
|
|
561
560
|
class: `${n}-toolbar-item`,
|
|
562
|
-
title: (
|
|
563
|
-
}, [t(
|
|
561
|
+
title: (k = l.value.toolbarTips) == null ? void 0 : k.title
|
|
562
|
+
}, [t(C, {
|
|
564
563
|
name: "title"
|
|
565
564
|
}, null), e.showToolbarName && t("div", {
|
|
566
565
|
class: `${n}-toolbar-item-name`
|
|
@@ -574,7 +573,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
574
573
|
onClick: () => {
|
|
575
574
|
c("sub");
|
|
576
575
|
}
|
|
577
|
-
}, [t(
|
|
576
|
+
}, [t(C, {
|
|
578
577
|
name: "sub"
|
|
579
578
|
}, null), e.showToolbarName && t("div", {
|
|
580
579
|
class: `${n}-toolbar-item-name`
|
|
@@ -582,11 +581,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
582
581
|
case "sup":
|
|
583
582
|
return t("div", {
|
|
584
583
|
class: `${n}-toolbar-item`,
|
|
585
|
-
title: (
|
|
584
|
+
title: (F = l.value.toolbarTips) == null ? void 0 : F.sup,
|
|
586
585
|
onClick: () => {
|
|
587
586
|
c("sup");
|
|
588
587
|
}
|
|
589
|
-
}, [t(
|
|
588
|
+
}, [t(C, {
|
|
590
589
|
name: "sup"
|
|
591
590
|
}, null), e.showToolbarName && t("div", {
|
|
592
591
|
class: `${n}-toolbar-item-name`
|
|
@@ -598,11 +597,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
598
597
|
onClick: () => {
|
|
599
598
|
c("quote");
|
|
600
599
|
}
|
|
601
|
-
}, [t(
|
|
600
|
+
}, [t(C, {
|
|
602
601
|
name: "quote"
|
|
603
602
|
}, null), e.showToolbarName && t("div", {
|
|
604
603
|
class: `${n}-toolbar-item-name`
|
|
605
|
-
}, [(
|
|
604
|
+
}, [(ue = l.value.toolbarTips) == null ? void 0 : ue.quote])]);
|
|
606
605
|
case "unorderedList":
|
|
607
606
|
return t("div", {
|
|
608
607
|
class: `${n}-toolbar-item`,
|
|
@@ -610,7 +609,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
610
609
|
onClick: () => {
|
|
611
610
|
c("unorderedList");
|
|
612
611
|
}
|
|
613
|
-
}, [t(
|
|
612
|
+
}, [t(C, {
|
|
614
613
|
name: "unordered-list"
|
|
615
614
|
}, null), e.showToolbarName && t("div", {
|
|
616
615
|
class: `${n}-toolbar-item-name`
|
|
@@ -622,7 +621,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
622
621
|
onClick: () => {
|
|
623
622
|
c("orderedList");
|
|
624
623
|
}
|
|
625
|
-
}, [t(
|
|
624
|
+
}, [t(C, {
|
|
626
625
|
name: "ordered-list"
|
|
627
626
|
}, null), e.showToolbarName && t("div", {
|
|
628
627
|
class: `${n}-toolbar-item-name`
|
|
@@ -634,11 +633,11 @@ const Tl = /* @__PURE__ */ P({
|
|
|
634
633
|
onClick: () => {
|
|
635
634
|
c("task");
|
|
636
635
|
}
|
|
637
|
-
}, [t(
|
|
636
|
+
}, [t(C, {
|
|
638
637
|
name: "task"
|
|
639
638
|
}, null), e.showToolbarName && t("div", {
|
|
640
639
|
class: `${n}-toolbar-item-name`
|
|
641
|
-
}, [(
|
|
640
|
+
}, [(B = l.value.toolbarTips) == null ? void 0 : B.task])]);
|
|
642
641
|
case "codeRow":
|
|
643
642
|
return t("div", {
|
|
644
643
|
class: `${n}-toolbar-item`,
|
|
@@ -646,7 +645,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
646
645
|
onClick: () => {
|
|
647
646
|
c("codeRow");
|
|
648
647
|
}
|
|
649
|
-
}, [t(
|
|
648
|
+
}, [t(C, {
|
|
650
649
|
name: "code-row"
|
|
651
650
|
}, null), e.showToolbarName && t("div", {
|
|
652
651
|
class: `${n}-toolbar-item-name`
|
|
@@ -654,43 +653,43 @@ const Tl = /* @__PURE__ */ P({
|
|
|
654
653
|
case "code":
|
|
655
654
|
return t("div", {
|
|
656
655
|
class: `${n}-toolbar-item`,
|
|
657
|
-
title: (
|
|
656
|
+
title: (de = l.value.toolbarTips) == null ? void 0 : de.code,
|
|
658
657
|
onClick: () => {
|
|
659
658
|
c("code");
|
|
660
659
|
}
|
|
661
|
-
}, [t(
|
|
660
|
+
}, [t(C, {
|
|
662
661
|
name: "code"
|
|
663
662
|
}, null), e.showToolbarName && t("div", {
|
|
664
663
|
class: `${n}-toolbar-item-name`
|
|
665
|
-
}, [(
|
|
664
|
+
}, [(Se = l.value.toolbarTips) == null ? void 0 : Se.code])]);
|
|
666
665
|
case "link":
|
|
667
666
|
return t("div", {
|
|
668
667
|
class: `${n}-toolbar-item`,
|
|
669
|
-
title: (
|
|
668
|
+
title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.link,
|
|
670
669
|
onClick: () => {
|
|
671
670
|
u.type = "link", u.linkVisible = !0;
|
|
672
671
|
}
|
|
673
|
-
}, [t(
|
|
672
|
+
}, [t(C, {
|
|
674
673
|
name: "link"
|
|
675
674
|
}, null), e.showToolbarName && t("div", {
|
|
676
675
|
class: `${n}-toolbar-item-name`
|
|
677
|
-
}, [(
|
|
676
|
+
}, [(Me = l.value.toolbarTips) == null ? void 0 : Me.link])]);
|
|
678
677
|
case "image":
|
|
679
678
|
return e.noUploadImg ? t("div", {
|
|
680
679
|
class: `${n}-toolbar-item`,
|
|
681
|
-
title: (
|
|
680
|
+
title: (Le = l.value.toolbarTips) == null ? void 0 : Le.image,
|
|
682
681
|
onClick: () => {
|
|
683
682
|
u.type = "image", u.linkVisible = !0;
|
|
684
683
|
}
|
|
685
|
-
}, [t(
|
|
684
|
+
}, [t(C, {
|
|
686
685
|
name: "image"
|
|
687
686
|
}, null), e.showToolbarName && t("div", {
|
|
688
687
|
class: `${n}-toolbar-item-name`
|
|
689
|
-
}, [(
|
|
688
|
+
}, [(De = l.value.toolbarTips) == null ? void 0 : De.image])]) : t(ie, {
|
|
690
689
|
relative: `#${r}`,
|
|
691
690
|
visible: g.image,
|
|
692
|
-
onChange: (
|
|
693
|
-
g.image =
|
|
691
|
+
onChange: (k) => {
|
|
692
|
+
g.image = k;
|
|
694
693
|
},
|
|
695
694
|
overlay: t("ul", {
|
|
696
695
|
class: `${n}-menu`,
|
|
@@ -702,24 +701,24 @@ const Tl = /* @__PURE__ */ P({
|
|
|
702
701
|
onClick: () => {
|
|
703
702
|
u.type = "image", u.linkVisible = !0;
|
|
704
703
|
}
|
|
705
|
-
}, [(
|
|
704
|
+
}, [(Ie = l.value.imgTitleItem) == null ? void 0 : Ie.link]), t("li", {
|
|
706
705
|
class: `${n}-menu-item`,
|
|
707
706
|
onClick: () => {
|
|
708
|
-
|
|
707
|
+
T.value.click();
|
|
709
708
|
}
|
|
710
|
-
}, [(
|
|
709
|
+
}, [(Ee = l.value.imgTitleItem) == null ? void 0 : Ee.upload]), t("li", {
|
|
711
710
|
class: `${n}-menu-item`,
|
|
712
711
|
onClick: () => {
|
|
713
712
|
u.clipVisible = !0;
|
|
714
713
|
}
|
|
715
|
-
}, [(
|
|
714
|
+
}, [(He = l.value.imgTitleItem) == null ? void 0 : He.clip2upload])])
|
|
716
715
|
}, {
|
|
717
716
|
default: () => {
|
|
718
|
-
var
|
|
717
|
+
var k, D;
|
|
719
718
|
return [t("div", {
|
|
720
719
|
class: `${n}-toolbar-item`,
|
|
721
|
-
title: (
|
|
722
|
-
}, [t(
|
|
720
|
+
title: (k = l.value.toolbarTips) == null ? void 0 : k.image
|
|
721
|
+
}, [t(C, {
|
|
723
722
|
name: "image"
|
|
724
723
|
}, null), e.showToolbarName && t("div", {
|
|
725
724
|
class: `${n}-toolbar-item-name`
|
|
@@ -730,25 +729,25 @@ const Tl = /* @__PURE__ */ P({
|
|
|
730
729
|
return t(ie, {
|
|
731
730
|
relative: `#${r}`,
|
|
732
731
|
visible: g.table,
|
|
733
|
-
onChange: (
|
|
734
|
-
g.table =
|
|
732
|
+
onChange: (k) => {
|
|
733
|
+
g.table = k;
|
|
735
734
|
},
|
|
736
735
|
key: "bar-table",
|
|
737
|
-
overlay: t(
|
|
736
|
+
overlay: t(Ll, {
|
|
738
737
|
tableShape: e.tableShape,
|
|
739
|
-
onSelected: (
|
|
738
|
+
onSelected: (k) => {
|
|
740
739
|
c("table", {
|
|
741
|
-
selectedShape:
|
|
740
|
+
selectedShape: k
|
|
742
741
|
});
|
|
743
742
|
}
|
|
744
743
|
}, null)
|
|
745
744
|
}, {
|
|
746
745
|
default: () => {
|
|
747
|
-
var
|
|
746
|
+
var k, D;
|
|
748
747
|
return [t("div", {
|
|
749
748
|
class: `${n}-toolbar-item`,
|
|
750
|
-
title: (
|
|
751
|
-
}, [t(
|
|
749
|
+
title: (k = l.value.toolbarTips) == null ? void 0 : k.table
|
|
750
|
+
}, [t(C, {
|
|
752
751
|
name: "table"
|
|
753
752
|
}, null), e.showToolbarName && t("div", {
|
|
754
753
|
class: `${n}-toolbar-item-name`
|
|
@@ -758,128 +757,128 @@ const Tl = /* @__PURE__ */ P({
|
|
|
758
757
|
case "revoke":
|
|
759
758
|
return t("div", {
|
|
760
759
|
class: `${n}-toolbar-item`,
|
|
761
|
-
title: (
|
|
760
|
+
title: (Ne = l.value.toolbarTips) == null ? void 0 : Ne.revoke,
|
|
762
761
|
onClick: () => {
|
|
763
|
-
|
|
762
|
+
h.emit(o, Lt);
|
|
764
763
|
}
|
|
765
|
-
}, [t(
|
|
764
|
+
}, [t(C, {
|
|
766
765
|
name: "revoke"
|
|
767
766
|
}, null), e.showToolbarName && t("div", {
|
|
768
767
|
class: `${n}-toolbar-item-name`
|
|
769
|
-
}, [(
|
|
768
|
+
}, [(Oe = l.value.toolbarTips) == null ? void 0 : Oe.revoke])]);
|
|
770
769
|
case "next":
|
|
771
770
|
return t("div", {
|
|
772
771
|
class: `${n}-toolbar-item`,
|
|
773
|
-
title: (
|
|
772
|
+
title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.next,
|
|
774
773
|
onClick: () => {
|
|
775
|
-
|
|
774
|
+
h.emit(o, Mt);
|
|
776
775
|
}
|
|
777
|
-
}, [t(
|
|
776
|
+
}, [t(C, {
|
|
778
777
|
name: "next"
|
|
779
778
|
}, null), e.showToolbarName && t("div", {
|
|
780
779
|
class: `${n}-toolbar-item-name`
|
|
781
|
-
}, [(
|
|
780
|
+
}, [(Fe = l.value.toolbarTips) == null ? void 0 : Fe.next])]);
|
|
782
781
|
case "save":
|
|
783
782
|
return t("div", {
|
|
784
783
|
class: `${n}-toolbar-item`,
|
|
785
|
-
title: (
|
|
784
|
+
title: (Be = l.value.toolbarTips) == null ? void 0 : Be.save,
|
|
786
785
|
onClick: () => {
|
|
787
|
-
|
|
786
|
+
h.emit(o, At);
|
|
788
787
|
}
|
|
789
|
-
}, [t(
|
|
788
|
+
}, [t(C, {
|
|
790
789
|
name: "baocun"
|
|
791
790
|
}, null), e.showToolbarName && t("div", {
|
|
792
791
|
class: `${n}-toolbar-item-name`
|
|
793
|
-
}, [(
|
|
792
|
+
}, [(Re = l.value.toolbarTips) == null ? void 0 : Re.save])]);
|
|
794
793
|
case "prettier":
|
|
795
794
|
return e.noPrettier ? "" : t("div", {
|
|
796
795
|
class: `${n}-toolbar-item`,
|
|
797
|
-
title: (
|
|
796
|
+
title: (Pe = l.value.toolbarTips) == null ? void 0 : Pe.prettier,
|
|
798
797
|
onClick: () => {
|
|
799
798
|
c("prettier");
|
|
800
799
|
}
|
|
801
|
-
}, [t(
|
|
800
|
+
}, [t(C, {
|
|
802
801
|
name: "prettier"
|
|
803
802
|
}, null), e.showToolbarName && t("div", {
|
|
804
803
|
class: `${n}-toolbar-item-name`
|
|
805
|
-
}, [(
|
|
804
|
+
}, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier])]);
|
|
806
805
|
case "pageFullscreen":
|
|
807
806
|
return !e.setting.fullscreen && t("div", {
|
|
808
807
|
class: `${n}-toolbar-item`,
|
|
809
|
-
title: (
|
|
808
|
+
title: (_e = l.value.toolbarTips) == null ? void 0 : _e.pageFullscreen,
|
|
810
809
|
onClick: () => {
|
|
811
810
|
e.updateSetting("pageFullscreen");
|
|
812
811
|
}
|
|
813
|
-
}, [t(
|
|
812
|
+
}, [t(C, {
|
|
814
813
|
name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
|
|
815
814
|
}, null), e.showToolbarName && t("div", {
|
|
816
815
|
class: `${n}-toolbar-item-name`
|
|
817
|
-
}, [(
|
|
816
|
+
}, [(qe = l.value.toolbarTips) == null ? void 0 : qe.pageFullscreen])]);
|
|
818
817
|
case "fullscreen":
|
|
819
818
|
return t("div", {
|
|
820
819
|
class: `${n}-toolbar-item`,
|
|
821
|
-
title: (
|
|
820
|
+
title: (Ge = l.value.toolbarTips) == null ? void 0 : Ge.fullscreen,
|
|
822
821
|
onClick: () => {
|
|
823
822
|
a();
|
|
824
823
|
}
|
|
825
|
-
}, [t(
|
|
824
|
+
}, [t(C, {
|
|
826
825
|
name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
|
|
827
826
|
}, null), e.showToolbarName && t("div", {
|
|
828
827
|
class: `${n}-toolbar-item-name`
|
|
829
|
-
}, [(
|
|
828
|
+
}, [(je = l.value.toolbarTips) == null ? void 0 : je.fullscreen])]);
|
|
830
829
|
case "preview":
|
|
831
830
|
return t("div", {
|
|
832
831
|
class: `${n}-toolbar-item`,
|
|
833
|
-
title: (
|
|
832
|
+
title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.preview,
|
|
834
833
|
onClick: () => {
|
|
835
834
|
e.updateSetting("preview");
|
|
836
835
|
}
|
|
837
|
-
}, [t(
|
|
836
|
+
}, [t(C, {
|
|
838
837
|
name: "preview"
|
|
839
838
|
}, null), e.showToolbarName && t("div", {
|
|
840
839
|
class: `${n}-toolbar-item-name`
|
|
841
|
-
}, [(
|
|
840
|
+
}, [(We = l.value.toolbarTips) == null ? void 0 : We.preview])]);
|
|
842
841
|
case "htmlPreview":
|
|
843
842
|
return t("div", {
|
|
844
843
|
class: `${n}-toolbar-item`,
|
|
845
|
-
title: (
|
|
844
|
+
title: (ze = l.value.toolbarTips) == null ? void 0 : ze.htmlPreview,
|
|
846
845
|
onClick: () => {
|
|
847
846
|
e.updateSetting("htmlPreview");
|
|
848
847
|
}
|
|
849
|
-
}, [t(
|
|
848
|
+
}, [t(C, {
|
|
850
849
|
name: "coding"
|
|
851
850
|
}, null), e.showToolbarName && t("div", {
|
|
852
851
|
class: `${n}-toolbar-item-name`
|
|
853
|
-
}, [(
|
|
852
|
+
}, [(Ze = l.value.toolbarTips) == null ? void 0 : Ze.htmlPreview])]);
|
|
854
853
|
case "catalog":
|
|
855
854
|
return t("div", {
|
|
856
855
|
class: `${n}-toolbar-item`,
|
|
857
|
-
title: (
|
|
856
|
+
title: (Xe = l.value.toolbarTips) == null ? void 0 : Xe.catalog,
|
|
858
857
|
onClick: () => {
|
|
859
|
-
|
|
858
|
+
h.emit(o, Zt);
|
|
860
859
|
},
|
|
861
860
|
key: "bar-catalog"
|
|
862
|
-
}, [t(
|
|
861
|
+
}, [t(C, {
|
|
863
862
|
name: "catalog"
|
|
864
863
|
}, null), e.showToolbarName && t("div", {
|
|
865
864
|
class: `${n}-toolbar-item-name`
|
|
866
|
-
}, [(
|
|
865
|
+
}, [(Ye = l.value.toolbarTips) == null ? void 0 : Ye.catalog])]);
|
|
867
866
|
case "github":
|
|
868
867
|
return t("div", {
|
|
869
868
|
class: `${n}-toolbar-item`,
|
|
870
|
-
title: (
|
|
871
|
-
onClick: () =>
|
|
872
|
-
}, [t(
|
|
869
|
+
title: (Je = l.value.toolbarTips) == null ? void 0 : Je.github,
|
|
870
|
+
onClick: () => _t("https://github.com/imzbf/md-editor-v3")
|
|
871
|
+
}, [t(C, {
|
|
873
872
|
name: "github"
|
|
874
873
|
}, null), e.showToolbarName && t("div", {
|
|
875
874
|
class: `${n}-toolbar-item-name`
|
|
876
|
-
}, [(
|
|
875
|
+
}, [(Qe = l.value.toolbarTips) == null ? void 0 : Qe.github])]);
|
|
877
876
|
case "mermaid":
|
|
878
877
|
return t(ie, {
|
|
879
878
|
relative: `#${r}`,
|
|
880
879
|
visible: g.mermaid,
|
|
881
|
-
onChange: (
|
|
882
|
-
g.mermaid =
|
|
880
|
+
onChange: (k) => {
|
|
881
|
+
g.mermaid = k;
|
|
883
882
|
},
|
|
884
883
|
overlay: t("ul", {
|
|
885
884
|
class: `${n}-menu`,
|
|
@@ -891,50 +890,50 @@ const Tl = /* @__PURE__ */ P({
|
|
|
891
890
|
onClick: () => {
|
|
892
891
|
c("flow");
|
|
893
892
|
}
|
|
894
|
-
}, [(
|
|
893
|
+
}, [(et = l.value.mermaid) == null ? void 0 : et.flow]), t("li", {
|
|
895
894
|
class: `${n}-menu-item`,
|
|
896
895
|
onClick: () => {
|
|
897
896
|
c("sequence");
|
|
898
897
|
}
|
|
899
|
-
}, [(
|
|
898
|
+
}, [(tt = l.value.mermaid) == null ? void 0 : tt.sequence]), t("li", {
|
|
900
899
|
class: `${n}-menu-item`,
|
|
901
900
|
onClick: () => {
|
|
902
901
|
c("gantt");
|
|
903
902
|
}
|
|
904
|
-
}, [(
|
|
903
|
+
}, [(lt = l.value.mermaid) == null ? void 0 : lt.gantt]), t("li", {
|
|
905
904
|
class: `${n}-menu-item`,
|
|
906
905
|
onClick: () => {
|
|
907
906
|
c("class");
|
|
908
907
|
}
|
|
909
|
-
}, [(
|
|
908
|
+
}, [(ot = l.value.mermaid) == null ? void 0 : ot.class]), t("li", {
|
|
910
909
|
class: `${n}-menu-item`,
|
|
911
910
|
onClick: () => {
|
|
912
911
|
c("state");
|
|
913
912
|
}
|
|
914
|
-
}, [(
|
|
913
|
+
}, [(at = l.value.mermaid) == null ? void 0 : at.state]), t("li", {
|
|
915
914
|
class: `${n}-menu-item`,
|
|
916
915
|
onClick: () => {
|
|
917
916
|
c("pie");
|
|
918
917
|
}
|
|
919
|
-
}, [(
|
|
918
|
+
}, [(nt = l.value.mermaid) == null ? void 0 : nt.pie]), t("li", {
|
|
920
919
|
class: `${n}-menu-item`,
|
|
921
920
|
onClick: () => {
|
|
922
921
|
c("relationship");
|
|
923
922
|
}
|
|
924
|
-
}, [(
|
|
923
|
+
}, [(rt = l.value.mermaid) == null ? void 0 : rt.relationship]), t("li", {
|
|
925
924
|
class: `${n}-menu-item`,
|
|
926
925
|
onClick: () => {
|
|
927
926
|
c("journey");
|
|
928
927
|
}
|
|
929
|
-
}, [(
|
|
928
|
+
}, [(it = l.value.mermaid) == null ? void 0 : it.journey])]),
|
|
930
929
|
key: "bar-mermaid"
|
|
931
930
|
}, {
|
|
932
931
|
default: () => {
|
|
933
|
-
var
|
|
932
|
+
var k, D;
|
|
934
933
|
return [t("div", {
|
|
935
934
|
class: `${n}-toolbar-item`,
|
|
936
|
-
title: (
|
|
937
|
-
}, [t(
|
|
935
|
+
title: (k = l.value.toolbarTips) == null ? void 0 : k.mermaid
|
|
936
|
+
}, [t(C, {
|
|
938
937
|
name: "mermaid"
|
|
939
938
|
}, null), e.showToolbarName && t("div", {
|
|
940
939
|
class: `${n}-toolbar-item-name`
|
|
@@ -945,8 +944,8 @@ const Tl = /* @__PURE__ */ P({
|
|
|
945
944
|
return t(ie, {
|
|
946
945
|
relative: `#${r}`,
|
|
947
946
|
visible: g.katex,
|
|
948
|
-
onChange: (
|
|
949
|
-
g.katex =
|
|
947
|
+
onChange: (k) => {
|
|
948
|
+
g.katex = k;
|
|
950
949
|
},
|
|
951
950
|
overlay: t("ul", {
|
|
952
951
|
class: `${n}-menu`,
|
|
@@ -958,20 +957,20 @@ const Tl = /* @__PURE__ */ P({
|
|
|
958
957
|
onClick: () => {
|
|
959
958
|
c("katexInline");
|
|
960
959
|
}
|
|
961
|
-
}, [(
|
|
960
|
+
}, [(st = l.value.katex) == null ? void 0 : st.inline]), t("li", {
|
|
962
961
|
class: `${n}-menu-item`,
|
|
963
962
|
onClick: () => {
|
|
964
963
|
c("katexBlock");
|
|
965
964
|
}
|
|
966
|
-
}, [(
|
|
965
|
+
}, [(ct = l.value.katex) == null ? void 0 : ct.block])]),
|
|
967
966
|
key: "bar-katex"
|
|
968
967
|
}, {
|
|
969
968
|
default: () => {
|
|
970
|
-
var
|
|
969
|
+
var k, D;
|
|
971
970
|
return [t("div", {
|
|
972
971
|
class: `${n}-toolbar-item`,
|
|
973
|
-
title: (
|
|
974
|
-
}, [t(
|
|
972
|
+
title: (k = l.value.toolbarTips) == null ? void 0 : k.katex
|
|
973
|
+
}, [t(C, {
|
|
975
974
|
name: "formula"
|
|
976
975
|
}, null), e.showToolbarName && t("div", {
|
|
977
976
|
class: `${n}-toolbar-item-name`
|
|
@@ -980,35 +979,35 @@ const Tl = /* @__PURE__ */ P({
|
|
|
980
979
|
});
|
|
981
980
|
}
|
|
982
981
|
else if (e.defToolbars instanceof Array) {
|
|
983
|
-
const
|
|
984
|
-
return
|
|
985
|
-
insert(
|
|
986
|
-
|
|
987
|
-
generate:
|
|
982
|
+
const k = e.defToolbars[b];
|
|
983
|
+
return k ? ut(k, {
|
|
984
|
+
insert(ve) {
|
|
985
|
+
h.emit(o, w, "universal", {
|
|
986
|
+
generate: ve
|
|
988
987
|
});
|
|
989
988
|
}
|
|
990
989
|
}) : "";
|
|
991
990
|
} else if (e.defToolbars && e.defToolbars.children instanceof Array) {
|
|
992
|
-
const
|
|
993
|
-
return
|
|
994
|
-
insert(
|
|
995
|
-
|
|
996
|
-
generate:
|
|
991
|
+
const k = e.defToolbars.children[b];
|
|
992
|
+
return k ? ut(k, {
|
|
993
|
+
insert(ve) {
|
|
994
|
+
h.emit(o, w, "universal", {
|
|
995
|
+
generate: ve
|
|
997
996
|
});
|
|
998
997
|
}
|
|
999
998
|
}) : "";
|
|
1000
999
|
} else
|
|
1001
1000
|
return "";
|
|
1002
1001
|
};
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1005
|
-
i.value &&
|
|
1002
|
+
return V(() => e.toolbars, () => {
|
|
1003
|
+
he(() => {
|
|
1004
|
+
i.value && Ut(i.value);
|
|
1006
1005
|
});
|
|
1007
1006
|
}, {
|
|
1008
1007
|
immediate: !0
|
|
1009
1008
|
}), () => {
|
|
1010
|
-
const
|
|
1011
|
-
return t(
|
|
1009
|
+
const b = p.value[0].map((v) => m(v)), f = p.value[1].map((v) => m(v));
|
|
1010
|
+
return t(St, null, [e.toolbars.length > 0 && t("div", {
|
|
1012
1011
|
class: `${n}-toolbar-wrapper`,
|
|
1013
1012
|
ref: i,
|
|
1014
1013
|
id: r
|
|
@@ -1016,43 +1015,43 @@ const Tl = /* @__PURE__ */ P({
|
|
|
1016
1015
|
class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
|
|
1017
1016
|
}, [t("div", {
|
|
1018
1017
|
class: `${n}-toolbar-left`,
|
|
1019
|
-
ref:
|
|
1020
|
-
}, [
|
|
1018
|
+
ref: d
|
|
1019
|
+
}, [b]), t("div", {
|
|
1021
1020
|
class: `${n}-toolbar-right`
|
|
1022
1021
|
}, [f])])]), t("input", {
|
|
1023
|
-
ref:
|
|
1022
|
+
ref: T,
|
|
1024
1023
|
accept: "image/*",
|
|
1025
1024
|
type: "file",
|
|
1026
1025
|
multiple: !0,
|
|
1027
1026
|
style: {
|
|
1028
1027
|
display: "none"
|
|
1029
1028
|
}
|
|
1030
|
-
}, null), t(
|
|
1029
|
+
}, null), t(Ol, {
|
|
1031
1030
|
linkVisible: u.linkVisible,
|
|
1032
1031
|
clipVisible: u.clipVisible,
|
|
1033
1032
|
type: u.type,
|
|
1034
1033
|
onCancel: () => {
|
|
1035
1034
|
u.linkVisible = !1, u.clipVisible = !1;
|
|
1036
1035
|
},
|
|
1037
|
-
onOk: (
|
|
1038
|
-
|
|
1039
|
-
desc:
|
|
1040
|
-
url:
|
|
1036
|
+
onOk: (v) => {
|
|
1037
|
+
v && c(u.type, {
|
|
1038
|
+
desc: v.desc,
|
|
1039
|
+
url: v.url
|
|
1041
1040
|
}), u.linkVisible = !1, u.clipVisible = !1;
|
|
1042
1041
|
}
|
|
1043
1042
|
}, null)]);
|
|
1044
1043
|
};
|
|
1045
1044
|
}
|
|
1046
|
-
}),
|
|
1047
|
-
const l =
|
|
1045
|
+
}), Fl = (e, o) => {
|
|
1046
|
+
const l = qt(() => {
|
|
1048
1047
|
e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
|
|
1049
1048
|
}, 50), a = (r) => {
|
|
1050
|
-
const i = e.clientHeight, g = o.clientHeight, c = e.scrollHeight, u = o.scrollHeight,
|
|
1049
|
+
const i = e.clientHeight, g = o.clientHeight, c = e.scrollHeight, u = o.scrollHeight, d = (c - i) / (u - g);
|
|
1051
1050
|
r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
|
|
1052
|
-
top: e.scrollTop /
|
|
1051
|
+
top: e.scrollTop / d
|
|
1053
1052
|
// behavior: 'smooth'
|
|
1054
1053
|
}), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
|
|
1055
|
-
top: o.scrollTop *
|
|
1054
|
+
top: o.scrollTop * d
|
|
1056
1055
|
// behavior: 'smooth'
|
|
1057
1056
|
}), l());
|
|
1058
1057
|
};
|
|
@@ -1066,113 +1065,113 @@ const Tl = /* @__PURE__ */ P({
|
|
|
1066
1065
|
e.removeEventListener("scroll", a), o.removeEventListener("scroll", a);
|
|
1067
1066
|
}
|
|
1068
1067
|
];
|
|
1069
|
-
},
|
|
1070
|
-
const { view: a } = l, r =
|
|
1068
|
+
}, Bl = (e, o, l) => {
|
|
1069
|
+
const { view: a } = l, r = Gt(), i = ($) => a.lineBlockAt(a.state.doc.line($).from).top, g = ($) => a.lineBlockAt(a.state.doc.line($).from).height;
|
|
1071
1070
|
let c = [];
|
|
1072
1071
|
const u = () => {
|
|
1073
1072
|
c = [];
|
|
1074
1073
|
const $ = Array.from(o.querySelectorAll("[data-line]")).map(
|
|
1075
|
-
(
|
|
1076
|
-
), { lines:
|
|
1077
|
-
let
|
|
1078
|
-
for (let
|
|
1079
|
-
|
|
1080
|
-
start:
|
|
1074
|
+
(v) => Number(v.dataset.line) + 1
|
|
1075
|
+
), { lines: m } = a.state.doc;
|
|
1076
|
+
let b = 1, f = $.shift() ?? m;
|
|
1077
|
+
for (let v = 1; v <= m; v++)
|
|
1078
|
+
v === f && (b = v, f = $.shift() || m + 1), c.push({
|
|
1079
|
+
start: b,
|
|
1081
1080
|
end: f - 1
|
|
1082
1081
|
});
|
|
1083
1082
|
};
|
|
1084
|
-
let
|
|
1085
|
-
const
|
|
1083
|
+
let d = 0, p = 0;
|
|
1084
|
+
const T = jt(($) => {
|
|
1086
1085
|
var y, x, S, N, L, le, oe;
|
|
1087
1086
|
if (!((y = o.firstElementChild) != null && y.firstElementChild))
|
|
1088
1087
|
return;
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1088
|
+
const m = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: b } = a.state.doc.lineAt(m.from);
|
|
1089
|
+
if (b > c.length || a.state.doc.lines < c[c.length - 1].end)
|
|
1091
1090
|
return;
|
|
1092
1091
|
let f = +getComputedStyle(o).paddingTop.replace("px", "");
|
|
1093
|
-
const
|
|
1092
|
+
const v = +getComputedStyle(o).paddingBottom.replace("px", "");
|
|
1094
1093
|
if ($.target === e) {
|
|
1095
|
-
if (
|
|
1094
|
+
if (p !== 0)
|
|
1096
1095
|
return;
|
|
1097
|
-
|
|
1098
|
-
const A = c[
|
|
1096
|
+
d++;
|
|
1097
|
+
const A = c[b - 1];
|
|
1099
1098
|
let M = i(A.end) + g(A.end), _ = 0;
|
|
1100
1099
|
const U = i(A.start), O = o.querySelector(`[data-line="${A.start - 1}"]`) || ((x = o.firstElementChild) == null ? void 0 : x.firstElementChild), E = o.querySelector(`[data-line="${A.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
|
|
1101
|
-
let H = 0,
|
|
1102
|
-
U === 0 ? O === E ? (f = 0, M = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / M, H = E.offsetTop + E.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / M, H = E.offsetTop) : M > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - U) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - U),
|
|
1103
|
-
const K =
|
|
1100
|
+
let H = 0, F = 0;
|
|
1101
|
+
U === 0 ? O === E ? (f = 0, M = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / M, H = E.offsetTop + E.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / M, H = E.offsetTop) : M > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - U) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - U), F = O.offsetTop, H = o.scrollHeight - o.clientHeight - F + 10) : (_ = (a.scrollDOM.scrollTop - U) / (M - U), F = O.offsetTop, H = E.offsetTop - F);
|
|
1102
|
+
const K = F - f + H * _;
|
|
1104
1103
|
r(o, K, () => {
|
|
1105
|
-
|
|
1104
|
+
d--;
|
|
1106
1105
|
});
|
|
1107
1106
|
} else {
|
|
1108
|
-
if (
|
|
1107
|
+
if (d !== 0)
|
|
1109
1108
|
return;
|
|
1110
|
-
|
|
1109
|
+
p++;
|
|
1111
1110
|
const A = Array.from(
|
|
1112
1111
|
o.querySelectorAll("[data-line]")
|
|
1113
1112
|
), M = o.scrollTop, _ = o.scrollHeight;
|
|
1114
1113
|
let U = A.length === 0 ? 1 : Math.ceil(
|
|
1115
1114
|
Number(A[A.length - 1].dataset.line) * (M / _)
|
|
1116
1115
|
), O = (N = o.firstElementChild) == null ? void 0 : N.firstElementChild;
|
|
1117
|
-
for (let
|
|
1118
|
-
const R = o.querySelector(`[data-line="${
|
|
1116
|
+
for (let B = U; B >= 0; B--) {
|
|
1117
|
+
const R = o.querySelector(`[data-line="${B}"]`);
|
|
1119
1118
|
if (R && R.offsetTop <= M) {
|
|
1120
|
-
O = R, U =
|
|
1119
|
+
O = R, U = B;
|
|
1121
1120
|
break;
|
|
1122
1121
|
}
|
|
1123
1122
|
}
|
|
1124
1123
|
let E = (L = o.firstElementChild) == null ? void 0 : L.firstElementChild, H = (le = o.firstElementChild) == null ? void 0 : le.lastElementChild;
|
|
1125
1124
|
for (; A.length > 0; ) {
|
|
1126
|
-
const
|
|
1127
|
-
if (
|
|
1125
|
+
const B = A.indexOf(O);
|
|
1126
|
+
if (B + 1 >= A.length)
|
|
1128
1127
|
break;
|
|
1129
|
-
const R = A[
|
|
1130
|
-
if (
|
|
1128
|
+
const R = A[B + 1];
|
|
1129
|
+
if (B === -1) {
|
|
1131
1130
|
H = R;
|
|
1132
1131
|
break;
|
|
1133
1132
|
}
|
|
1134
1133
|
const re = O.offsetTop;
|
|
1135
1134
|
if (re > M) {
|
|
1136
|
-
if (
|
|
1135
|
+
if (B === 0) {
|
|
1137
1136
|
E = O, H = R;
|
|
1138
1137
|
break;
|
|
1139
1138
|
}
|
|
1140
|
-
O = A[
|
|
1139
|
+
O = A[B - 1];
|
|
1141
1140
|
continue;
|
|
1142
1141
|
}
|
|
1143
|
-
const
|
|
1144
|
-
if (re <= M &&
|
|
1142
|
+
const de = R.offsetTop;
|
|
1143
|
+
if (re <= M && de > M) {
|
|
1145
1144
|
E = O, H = R;
|
|
1146
1145
|
break;
|
|
1147
1146
|
}
|
|
1148
1147
|
O = R;
|
|
1149
1148
|
}
|
|
1150
|
-
const
|
|
1149
|
+
const F = E.offsetTop;
|
|
1151
1150
|
let K = H.offsetTop, W = 0;
|
|
1152
|
-
const { start:
|
|
1151
|
+
const { start: ue, end: ae } = c[Number(E.dataset.line || 0)], X = i(ue);
|
|
1153
1152
|
let z = i(ae);
|
|
1154
1153
|
const ne = g(ae);
|
|
1155
1154
|
let Z = 0;
|
|
1156
|
-
E === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (E === H ? (K = H.offsetHeight - o.offsetHeight + f +
|
|
1157
|
-
(M -
|
|
1155
|
+
E === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (E === H ? (K = H.offsetHeight - o.offsetHeight + f + v, Z = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : Z = z + ne - X, W = Math.max(M / K, 0)) : z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (W = Math.max(
|
|
1156
|
+
(M - F) / (o.scrollHeight - F - o.clientHeight),
|
|
1158
1157
|
0
|
|
1159
1158
|
), z = i(a.state.doc.lines) + g(a.state.doc.lines), Z = 8 + z - X - e.clientHeight) : (W = Math.max(
|
|
1160
|
-
(M -
|
|
1159
|
+
(M - F) / (K - F),
|
|
1161
1160
|
0
|
|
1162
1161
|
), Z = z + ne - X), r(e, X + Z * W, () => {
|
|
1163
|
-
|
|
1162
|
+
p--;
|
|
1164
1163
|
});
|
|
1165
1164
|
}
|
|
1166
1165
|
}, 10);
|
|
1167
1166
|
return [
|
|
1168
1167
|
() => {
|
|
1169
|
-
u(), e.addEventListener("scroll",
|
|
1168
|
+
u(), e.addEventListener("scroll", T), o.addEventListener("scroll", T), e.dispatchEvent(new Event("scroll"));
|
|
1170
1169
|
},
|
|
1171
1170
|
() => {
|
|
1172
|
-
c = [], e.removeEventListener("scroll",
|
|
1171
|
+
c = [], e.removeEventListener("scroll", T), o.removeEventListener("scroll", T);
|
|
1173
1172
|
}
|
|
1174
1173
|
];
|
|
1175
|
-
},
|
|
1174
|
+
}, Rl = (e, o, l) => {
|
|
1176
1175
|
const a = I("editorId");
|
|
1177
1176
|
let r = () => {
|
|
1178
1177
|
}, i = () => {
|
|
@@ -1183,47 +1182,47 @@ const Tl = /* @__PURE__ */ P({
|
|
|
1183
1182
|
`#${a} .cm-scroller`
|
|
1184
1183
|
), u = document.querySelector(
|
|
1185
1184
|
`[id="${a}-preview-wrapper"][data-show="true"]`
|
|
1186
|
-
),
|
|
1185
|
+
), d = document.querySelector(
|
|
1187
1186
|
`[id="${a}-html-wrapper"][data-show="true"]`
|
|
1188
1187
|
);
|
|
1189
|
-
(u ||
|
|
1188
|
+
(u || d) && ([i, r] = (u ? Bl : Fl)(
|
|
1190
1189
|
c,
|
|
1191
|
-
u ||
|
|
1190
|
+
u || d,
|
|
1192
1191
|
l.value
|
|
1193
1192
|
)), e.scrollAuto && i();
|
|
1194
1193
|
};
|
|
1195
|
-
|
|
1194
|
+
V(
|
|
1196
1195
|
[
|
|
1197
1196
|
o,
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1197
|
+
me(e.setting, "preview"),
|
|
1198
|
+
me(e.setting, "htmlPreview"),
|
|
1199
|
+
me(e.setting, "fullscreen"),
|
|
1200
|
+
me(e.setting, "pageFullscreen")
|
|
1202
1201
|
],
|
|
1203
1202
|
() => {
|
|
1204
|
-
|
|
1203
|
+
he(g);
|
|
1205
1204
|
}
|
|
1206
|
-
),
|
|
1205
|
+
), V(
|
|
1207
1206
|
() => e.scrollAuto,
|
|
1208
1207
|
(c) => {
|
|
1209
1208
|
c ? i() : r();
|
|
1210
1209
|
}
|
|
1211
1210
|
), J(g);
|
|
1212
|
-
},
|
|
1213
|
-
var
|
|
1211
|
+
}, Pl = Rl, Ul = (e, o, l) => {
|
|
1212
|
+
var p, T, $, m, b, f;
|
|
1214
1213
|
let a = "", r = 0, i = 0, g = !0, c = !1;
|
|
1215
|
-
const u = o.getSelectedText(),
|
|
1214
|
+
const u = o.getSelectedText(), d = (p = Y.editorConfig) == null ? void 0 : p.mermaidTemplate;
|
|
1216
1215
|
if (/^h[1-6]{1}$/.test(e)) {
|
|
1217
|
-
const
|
|
1218
|
-
a = `${
|
|
1216
|
+
const v = e.replace(/^h(\d)/, (y, x) => new Array(Number(x)).fill("#", 0, x).join(""));
|
|
1217
|
+
a = `${v} ${u}`, r = v.length + 1;
|
|
1219
1218
|
} else if (e === "prettier") {
|
|
1220
|
-
const
|
|
1221
|
-
((
|
|
1219
|
+
const v = window.prettier || (($ = (T = Y.editorExtensions) == null ? void 0 : T.prettier) == null ? void 0 : $.prettierInstance), y = [
|
|
1220
|
+
((m = window.prettierPlugins) == null ? void 0 : m.markdown) || ((f = (b = Y.editorExtensions) == null ? void 0 : b.prettier) == null ? void 0 : f.parserMarkdownInstance)
|
|
1222
1221
|
];
|
|
1223
|
-
!
|
|
1222
|
+
!v || y[0] === void 0 ? (h.emit(l.editorId, te, {
|
|
1224
1223
|
name: "prettier",
|
|
1225
1224
|
message: "prettier is undefined"
|
|
1226
|
-
}), a = o.getValue()) : a =
|
|
1225
|
+
}), a = o.getValue()) : a = v.format(o.getValue(), {
|
|
1227
1226
|
parser: "markdown",
|
|
1228
1227
|
plugins: y
|
|
1229
1228
|
}), g = !1, c = !0;
|
|
@@ -1274,16 +1273,16 @@ const Tl = /* @__PURE__ */ P({
|
|
|
1274
1273
|
break;
|
|
1275
1274
|
}
|
|
1276
1275
|
case "code": {
|
|
1277
|
-
const
|
|
1276
|
+
const v = l.text || u || "", y = l.mode || "language";
|
|
1278
1277
|
a = `\`\`\`${y}
|
|
1279
|
-
${
|
|
1278
|
+
${v}
|
|
1280
1279
|
\`\`\`
|
|
1281
1280
|
`, r = 3, i = 3 + y.length - a.length;
|
|
1282
1281
|
break;
|
|
1283
1282
|
}
|
|
1284
1283
|
case "table": {
|
|
1285
1284
|
a = "|";
|
|
1286
|
-
const { selectedShape:
|
|
1285
|
+
const { selectedShape: v = { x: 1, y: 1 } } = l, { x: y, y: x } = v;
|
|
1287
1286
|
for (let S = 0; S <= x; S++)
|
|
1288
1287
|
a += " col |";
|
|
1289
1288
|
a += `
|
|
@@ -1300,20 +1299,20 @@ ${h}
|
|
|
1300
1299
|
break;
|
|
1301
1300
|
}
|
|
1302
1301
|
case "link": {
|
|
1303
|
-
const { desc:
|
|
1304
|
-
a = `[${
|
|
1302
|
+
const { desc: v, url: y } = l;
|
|
1303
|
+
a = `[${v}](${y})`, g = !1;
|
|
1305
1304
|
break;
|
|
1306
1305
|
}
|
|
1307
1306
|
case "image": {
|
|
1308
|
-
const { desc:
|
|
1309
|
-
x instanceof Array ? a = x.reduce((S, N) => S + `
|
|
1309
|
+
`, "") : a = `
|
|
1311
1310
|
`, g = !1;
|
|
1312
1311
|
break;
|
|
1313
1312
|
}
|
|
1314
1313
|
case "flow": {
|
|
1315
1314
|
a = `\`\`\`mermaid
|
|
1316
|
-
${(
|
|
1315
|
+
${(d == null ? void 0 : d.flow) || `flowchart TD
|
|
1317
1316
|
Start --> Stop`}
|
|
1318
1317
|
\`\`\`
|
|
1319
1318
|
`, r = 3, i = 10 - a.length;
|
|
@@ -1321,7 +1320,7 @@ ${(m == null ? void 0 : m.flow) || `flowchart TD
|
|
|
1321
1320
|
}
|
|
1322
1321
|
case "sequence": {
|
|
1323
1322
|
a = `\`\`\`mermaid
|
|
1324
|
-
${(
|
|
1323
|
+
${(d == null ? void 0 : d.sequence) || `sequenceDiagram
|
|
1325
1324
|
A->>B: hello!
|
|
1326
1325
|
B-->>A: hi!
|
|
1327
1326
|
A-)B: bye!`}
|
|
@@ -1331,7 +1330,7 @@ ${(m == null ? void 0 : m.sequence) || `sequenceDiagram
|
|
|
1331
1330
|
}
|
|
1332
1331
|
case "gantt": {
|
|
1333
1332
|
a = `\`\`\`mermaid
|
|
1334
|
-
${(
|
|
1333
|
+
${(d == null ? void 0 : d.gantt) || `gantt
|
|
1335
1334
|
title A Gantt Diagram
|
|
1336
1335
|
dateFormat YYYY-MM-DD
|
|
1337
1336
|
section Section
|
|
@@ -1343,7 +1342,7 @@ Another task :after a1, 20d`}
|
|
|
1343
1342
|
}
|
|
1344
1343
|
case "class": {
|
|
1345
1344
|
a = `\`\`\`mermaid
|
|
1346
|
-
${(
|
|
1345
|
+
${(d == null ? void 0 : d.class) || `classDiagram
|
|
1347
1346
|
class Animal
|
|
1348
1347
|
Vehicle <|-- Car`}
|
|
1349
1348
|
\`\`\`
|
|
@@ -1352,7 +1351,7 @@ ${(m == null ? void 0 : m.class) || `classDiagram
|
|
|
1352
1351
|
}
|
|
1353
1352
|
case "state": {
|
|
1354
1353
|
a = `\`\`\`mermaid
|
|
1355
|
-
${(
|
|
1354
|
+
${(d == null ? void 0 : d.state) || `stateDiagram-v2
|
|
1356
1355
|
s1 --> s2`}
|
|
1357
1356
|
\`\`\`
|
|
1358
1357
|
`, r = 3, i = 10 - a.length;
|
|
@@ -1360,7 +1359,7 @@ ${(m == null ? void 0 : m.state) || `stateDiagram-v2
|
|
|
1360
1359
|
}
|
|
1361
1360
|
case "pie": {
|
|
1362
1361
|
a = `\`\`\`mermaid
|
|
1363
|
-
${(
|
|
1362
|
+
${(d == null ? void 0 : d.pie) || `pie title Pets adopted by volunteers
|
|
1364
1363
|
"Dogs" : 386
|
|
1365
1364
|
"Cats" : 85
|
|
1366
1365
|
"Rats" : 15`}
|
|
@@ -1370,7 +1369,7 @@ ${(m == null ? void 0 : m.pie) || `pie title Pets adopted by volunteers
|
|
|
1370
1369
|
}
|
|
1371
1370
|
case "relationship": {
|
|
1372
1371
|
a = `\`\`\`mermaid
|
|
1373
|
-
${(
|
|
1372
|
+
${(d == null ? void 0 : d.relationship) || `erDiagram
|
|
1374
1373
|
CAR ||--o{ NAMED-DRIVER : allows
|
|
1375
1374
|
PERSON ||--o{ NAMED-DRIVER : is`}
|
|
1376
1375
|
\`\`\`
|
|
@@ -1379,7 +1378,7 @@ ${(m == null ? void 0 : m.relationship) || `erDiagram
|
|
|
1379
1378
|
}
|
|
1380
1379
|
case "journey": {
|
|
1381
1380
|
a = `\`\`\`mermaid
|
|
1382
|
-
${(
|
|
1381
|
+
${(d == null ? void 0 : d.journey) || `journey
|
|
1383
1382
|
title My working day
|
|
1384
1383
|
section Go to work
|
|
1385
1384
|
Make tea: 5: Me
|
|
@@ -1404,7 +1403,7 @@ $$
|
|
|
1404
1403
|
break;
|
|
1405
1404
|
}
|
|
1406
1405
|
case "universal": {
|
|
1407
|
-
const { generate:
|
|
1406
|
+
const { generate: v } = l, y = v(u);
|
|
1408
1407
|
a = y.targetValue, g = y.select, r = y.deviationStart, i = y.deviationEnd;
|
|
1409
1408
|
}
|
|
1410
1409
|
}
|
|
@@ -1421,18 +1420,18 @@ $$
|
|
|
1421
1420
|
replaceAll: c
|
|
1422
1421
|
}
|
|
1423
1422
|
};
|
|
1424
|
-
},
|
|
1423
|
+
}, _l = "#e5c07b", mt = "var(--md-color)", ql = "#56b6c2", Gl = "#ffffff", se = "var(--md-color)", gt = "#e5c07b", jl = "#e5c07b", Kl = "var(--md-color)", ft = "#d19a66", Wl = "#c678dd", zl = "#21252b", Zl = "#2c313a", bt = "var(--md-bk-color)", Ce = "var(--md-bk-color)", Xl = "#ceedfa33", ht = "#528bff", Yl = xe.theme(
|
|
1425
1424
|
{
|
|
1426
1425
|
"&": {
|
|
1427
|
-
color:
|
|
1428
|
-
backgroundColor:
|
|
1426
|
+
color: se,
|
|
1427
|
+
backgroundColor: bt
|
|
1429
1428
|
},
|
|
1430
1429
|
".cm-content": {
|
|
1431
|
-
caretColor:
|
|
1430
|
+
caretColor: ht
|
|
1432
1431
|
},
|
|
1433
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1434
|
-
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor:
|
|
1435
|
-
".cm-panels": { backgroundColor:
|
|
1432
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: ht },
|
|
1433
|
+
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Xl },
|
|
1434
|
+
".cm-panels": { backgroundColor: zl, color: se },
|
|
1436
1435
|
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
1437
1436
|
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
1438
1437
|
".cm-searchMatch": {
|
|
@@ -1448,13 +1447,13 @@ $$
|
|
|
1448
1447
|
backgroundColor: "#bad0f847"
|
|
1449
1448
|
},
|
|
1450
1449
|
".cm-gutters": {
|
|
1451
|
-
backgroundColor:
|
|
1452
|
-
color:
|
|
1450
|
+
backgroundColor: bt,
|
|
1451
|
+
color: se,
|
|
1453
1452
|
borderRight: "1px solid",
|
|
1454
1453
|
borderColor: "var(--md-border-color)"
|
|
1455
1454
|
},
|
|
1456
1455
|
".cm-activeLineGutter": {
|
|
1457
|
-
backgroundColor:
|
|
1456
|
+
backgroundColor: Zl
|
|
1458
1457
|
},
|
|
1459
1458
|
".cm-foldPlaceholder": {
|
|
1460
1459
|
backgroundColor: "transparent",
|
|
@@ -1463,29 +1462,29 @@ $$
|
|
|
1463
1462
|
},
|
|
1464
1463
|
".cm-tooltip": {
|
|
1465
1464
|
border: "1px solid var(--md-border-color)",
|
|
1466
|
-
backgroundColor:
|
|
1465
|
+
backgroundColor: Ce
|
|
1467
1466
|
},
|
|
1468
1467
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1469
1468
|
borderTopColor: "transparent",
|
|
1470
1469
|
borderBottomColor: "transparent"
|
|
1471
1470
|
},
|
|
1472
1471
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
1473
|
-
borderTopColor:
|
|
1474
|
-
borderBottomColor:
|
|
1472
|
+
borderTopColor: Ce,
|
|
1473
|
+
borderBottomColor: Ce
|
|
1475
1474
|
},
|
|
1476
1475
|
".cm-tooltip-autocomplete": {
|
|
1477
1476
|
"& > ul > li[aria-selected]": {
|
|
1478
|
-
color:
|
|
1477
|
+
color: se
|
|
1479
1478
|
}
|
|
1480
1479
|
}
|
|
1481
1480
|
},
|
|
1482
1481
|
{ dark: !0 }
|
|
1483
|
-
),
|
|
1484
|
-
{ tag: s.keyword, color:
|
|
1485
|
-
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color:
|
|
1486
|
-
{ tag: [s.function(s.variableName), s.labelName], color:
|
|
1487
|
-
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color:
|
|
1488
|
-
{ tag: [s.definition(s.name), s.separator], color:
|
|
1482
|
+
), Jl = It.define([
|
|
1483
|
+
{ tag: s.keyword, color: Wl },
|
|
1484
|
+
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: mt },
|
|
1485
|
+
{ tag: [s.function(s.variableName), s.labelName], color: jl },
|
|
1486
|
+
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color: ft },
|
|
1487
|
+
{ tag: [s.definition(s.name), s.separator], color: se },
|
|
1489
1488
|
{
|
|
1490
1489
|
tag: [
|
|
1491
1490
|
s.typeName,
|
|
@@ -1497,7 +1496,7 @@ $$
|
|
|
1497
1496
|
s.self,
|
|
1498
1497
|
s.namespace
|
|
1499
1498
|
],
|
|
1500
|
-
color:
|
|
1499
|
+
color: _l
|
|
1501
1500
|
},
|
|
1502
1501
|
{
|
|
1503
1502
|
tag: [
|
|
@@ -1509,32 +1508,32 @@ $$
|
|
|
1509
1508
|
s.link,
|
|
1510
1509
|
s.special(s.string)
|
|
1511
1510
|
],
|
|
1512
|
-
color:
|
|
1511
|
+
color: ql
|
|
1513
1512
|
},
|
|
1514
|
-
{ tag: [s.meta, s.comment], color:
|
|
1513
|
+
{ tag: [s.meta, s.comment], color: gt },
|
|
1515
1514
|
{ tag: s.strong, fontWeight: "bold" },
|
|
1516
1515
|
{ tag: s.emphasis, fontStyle: "italic" },
|
|
1517
1516
|
{ tag: s.strikethrough, textDecoration: "line-through" },
|
|
1518
|
-
{ tag: s.link, color:
|
|
1519
|
-
{ tag: s.heading, fontWeight: "bold", color:
|
|
1520
|
-
{ tag: [s.atom, s.bool, s.special(s.variableName)], color:
|
|
1521
|
-
{ tag: [s.processingInstruction, s.string, s.inserted], color:
|
|
1522
|
-
{ tag: s.invalid, color:
|
|
1523
|
-
]),
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
], Ql = "#e5c07b",
|
|
1517
|
+
{ tag: s.link, color: gt, textDecoration: "underline" },
|
|
1518
|
+
{ tag: s.heading, fontWeight: "bold", color: mt },
|
|
1519
|
+
{ tag: [s.atom, s.bool, s.special(s.variableName)], color: ft },
|
|
1520
|
+
{ tag: [s.processingInstruction, s.string, s.inserted], color: Kl },
|
|
1521
|
+
{ tag: s.invalid, color: Gl }
|
|
1522
|
+
]), vt = [
|
|
1523
|
+
Yl,
|
|
1524
|
+
Et(Jl)
|
|
1525
|
+
], Ql = "#e5c07b", kt = "#3f4a54", eo = "#56b6c2", to = "#fff", ce = "#3f4a54", Ct = "#2d8cf0", lo = "#2d8cf0", oo = "#3f4a54", pt = "#d19a66", ao = "#c678dd", no = "#21252b", ro = "#ceedfa33", $t = "var(--md-bk-color)", pe = "var(--md-bk-color)", io = "#bad5fa", yt = "#3f4a54", so = xe.theme(
|
|
1527
1526
|
{
|
|
1528
1527
|
"&": {
|
|
1529
|
-
color:
|
|
1530
|
-
backgroundColor:
|
|
1528
|
+
color: ce,
|
|
1529
|
+
backgroundColor: $t
|
|
1531
1530
|
},
|
|
1532
1531
|
".cm-content": {
|
|
1533
|
-
caretColor:
|
|
1532
|
+
caretColor: yt
|
|
1534
1533
|
},
|
|
1535
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1534
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: yt },
|
|
1536
1535
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: io },
|
|
1537
|
-
".cm-panels": { backgroundColor: no, color:
|
|
1536
|
+
".cm-panels": { backgroundColor: no, color: ce },
|
|
1538
1537
|
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
1539
1538
|
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
1540
1539
|
".cm-searchMatch": {
|
|
@@ -1550,8 +1549,8 @@ $$
|
|
|
1550
1549
|
backgroundColor: "#bad0f847"
|
|
1551
1550
|
},
|
|
1552
1551
|
".cm-gutters": {
|
|
1553
|
-
backgroundColor:
|
|
1554
|
-
color:
|
|
1552
|
+
backgroundColor: $t,
|
|
1553
|
+
color: ce,
|
|
1555
1554
|
borderRight: "1px solid",
|
|
1556
1555
|
borderColor: "var(--md-border-color)"
|
|
1557
1556
|
},
|
|
@@ -1565,29 +1564,29 @@ $$
|
|
|
1565
1564
|
},
|
|
1566
1565
|
".cm-tooltip": {
|
|
1567
1566
|
border: "1px solid var(--md-border-color)",
|
|
1568
|
-
backgroundColor:
|
|
1567
|
+
backgroundColor: pe
|
|
1569
1568
|
},
|
|
1570
1569
|
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
1571
1570
|
borderTopColor: "transparent",
|
|
1572
1571
|
borderBottomColor: "transparent"
|
|
1573
1572
|
},
|
|
1574
1573
|
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
1575
|
-
borderTopColor:
|
|
1576
|
-
borderBottomColor:
|
|
1574
|
+
borderTopColor: pe,
|
|
1575
|
+
borderBottomColor: pe
|
|
1577
1576
|
},
|
|
1578
1577
|
".cm-tooltip-autocomplete": {
|
|
1579
1578
|
"& > ul > li[aria-selected]": {
|
|
1580
|
-
color:
|
|
1579
|
+
color: ce
|
|
1581
1580
|
}
|
|
1582
1581
|
}
|
|
1583
1582
|
}
|
|
1584
1583
|
// { dark: true }
|
|
1585
|
-
), co =
|
|
1584
|
+
), co = It.define([
|
|
1586
1585
|
{ tag: s.keyword, color: ao },
|
|
1587
|
-
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color:
|
|
1586
|
+
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: kt },
|
|
1588
1587
|
{ tag: [s.function(s.variableName), s.labelName], color: lo },
|
|
1589
|
-
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color:
|
|
1590
|
-
{ tag: [s.definition(s.name), s.separator], color:
|
|
1588
|
+
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color: pt },
|
|
1589
|
+
{ tag: [s.definition(s.name), s.separator], color: ce },
|
|
1591
1590
|
{
|
|
1592
1591
|
tag: [
|
|
1593
1592
|
s.typeName,
|
|
@@ -1613,38 +1612,38 @@ $$
|
|
|
1613
1612
|
],
|
|
1614
1613
|
color: eo
|
|
1615
1614
|
},
|
|
1616
|
-
{ tag: [s.meta, s.comment], color:
|
|
1615
|
+
{ tag: [s.meta, s.comment], color: Ct },
|
|
1617
1616
|
{ tag: s.strong, fontWeight: "bold" },
|
|
1618
1617
|
{ tag: s.emphasis, fontStyle: "italic" },
|
|
1619
1618
|
{ tag: s.strikethrough, textDecoration: "line-through" },
|
|
1620
|
-
{ tag: s.link, color:
|
|
1621
|
-
{ tag: s.heading, fontWeight: "bold", color:
|
|
1622
|
-
{ tag: [s.atom, s.bool, s.special(s.variableName)], color:
|
|
1619
|
+
{ tag: s.link, color: Ct, textDecoration: "underline" },
|
|
1620
|
+
{ tag: s.heading, fontWeight: "bold", color: kt },
|
|
1621
|
+
{ tag: [s.atom, s.bool, s.special(s.variableName)], color: pt },
|
|
1623
1622
|
{ tag: [s.processingInstruction, s.string, s.inserted], color: oo },
|
|
1624
1623
|
{ tag: s.invalid, color: to }
|
|
1625
|
-
]),
|
|
1624
|
+
]), Tt = [
|
|
1626
1625
|
so,
|
|
1627
|
-
|
|
1626
|
+
Et(co)
|
|
1628
1627
|
], fe = (e, o, l, a, r) => (i, g, c, u) => {
|
|
1629
|
-
const
|
|
1630
|
-
i.dispatch(i.state.replaceSelection(`${
|
|
1631
|
-
const
|
|
1628
|
+
const d = `${e}${o}`.slice(u - c);
|
|
1629
|
+
i.dispatch(i.state.replaceSelection(`${d}${l}${a}`));
|
|
1630
|
+
const p = c + g.label.length + (r === "title" ? l.length : 0);
|
|
1632
1631
|
i.dispatch({
|
|
1633
1632
|
selection: G.create(
|
|
1634
1633
|
[
|
|
1635
1634
|
G.range(
|
|
1636
1635
|
c + g.label.length + (r === "title" ? 1 : -o.length),
|
|
1637
|
-
|
|
1636
|
+
p
|
|
1638
1637
|
),
|
|
1639
|
-
G.cursor(
|
|
1638
|
+
G.cursor(p)
|
|
1640
1639
|
],
|
|
1641
1640
|
1
|
|
1642
1641
|
)
|
|
1643
1642
|
}), i.focus();
|
|
1644
|
-
},
|
|
1643
|
+
}, wt = (e) => (o, l, a, r) => {
|
|
1645
1644
|
const i = e.slice(r - a);
|
|
1646
1645
|
o.dispatch(o.state.replaceSelection(`${i} `));
|
|
1647
|
-
},
|
|
1646
|
+
}, uo = (e) => {
|
|
1648
1647
|
const o = (l) => {
|
|
1649
1648
|
const a = l.matchBefore(
|
|
1650
1649
|
/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
|
|
@@ -1658,7 +1657,7 @@ $$
|
|
|
1658
1657
|
return {
|
|
1659
1658
|
label: g,
|
|
1660
1659
|
type: "text",
|
|
1661
|
-
apply:
|
|
1660
|
+
apply: wt(g)
|
|
1662
1661
|
};
|
|
1663
1662
|
}),
|
|
1664
1663
|
// 任务列表
|
|
@@ -1667,7 +1666,7 @@ $$
|
|
|
1667
1666
|
return {
|
|
1668
1667
|
label: i,
|
|
1669
1668
|
type: "text",
|
|
1670
|
-
apply:
|
|
1669
|
+
apply: wt(i)
|
|
1671
1670
|
};
|
|
1672
1671
|
}),
|
|
1673
1672
|
// 代码
|
|
@@ -1740,16 +1739,16 @@ $$`, "title")
|
|
|
1740
1739
|
]
|
|
1741
1740
|
};
|
|
1742
1741
|
};
|
|
1743
|
-
return
|
|
1744
|
-
override: e ? [o,
|
|
1742
|
+
return cl({
|
|
1743
|
+
override: e ? [o, ...e] : [o]
|
|
1745
1744
|
});
|
|
1746
|
-
},
|
|
1747
|
-
const o = new
|
|
1745
|
+
}, xt = uo, Q = (e) => {
|
|
1746
|
+
const o = new be();
|
|
1748
1747
|
return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
|
|
1749
|
-
effects:
|
|
1748
|
+
effects: ol.appendConfig.of(o.of(a))
|
|
1750
1749
|
}), !0);
|
|
1751
1750
|
};
|
|
1752
|
-
class
|
|
1751
|
+
class mo {
|
|
1753
1752
|
constructor(o) {
|
|
1754
1753
|
q(this, "view");
|
|
1755
1754
|
q(this, "maxLength", Number.MAX_SAFE_INTEGER);
|
|
@@ -1831,7 +1830,7 @@ class fo {
|
|
|
1831
1830
|
this.view.focus();
|
|
1832
1831
|
} catch (r) {
|
|
1833
1832
|
if (r.message === "The input text is too long")
|
|
1834
|
-
|
|
1833
|
+
h.emit(a, te, {
|
|
1835
1834
|
name: "overlength",
|
|
1836
1835
|
message: r.message,
|
|
1837
1836
|
data: o
|
|
@@ -1847,8 +1846,8 @@ class fo {
|
|
|
1847
1846
|
*/
|
|
1848
1847
|
setTabSize(o) {
|
|
1849
1848
|
this.toggleTabSize([
|
|
1850
|
-
|
|
1851
|
-
|
|
1849
|
+
ke.tabSize.of(o),
|
|
1850
|
+
sl.of(" ".repeat(o))
|
|
1852
1851
|
]);
|
|
1853
1852
|
}
|
|
1854
1853
|
/**
|
|
@@ -1857,7 +1856,7 @@ class fo {
|
|
|
1857
1856
|
* @param t 目标内容
|
|
1858
1857
|
*/
|
|
1859
1858
|
setPlaceholder(o) {
|
|
1860
|
-
this.togglePlaceholder(
|
|
1859
|
+
this.togglePlaceholder(Qt(o));
|
|
1861
1860
|
}
|
|
1862
1861
|
focus(o) {
|
|
1863
1862
|
if (this.view.focus(), !o)
|
|
@@ -1882,271 +1881,284 @@ class fo {
|
|
|
1882
1881
|
});
|
|
1883
1882
|
}
|
|
1884
1883
|
setDisabled(o) {
|
|
1885
|
-
this.toggleDisabled([
|
|
1884
|
+
this.toggleDisabled([xe.editable.of(!o)]);
|
|
1886
1885
|
}
|
|
1887
1886
|
setReadOnly(o) {
|
|
1888
|
-
this.toggleReadOnly([
|
|
1887
|
+
this.toggleReadOnly([ke.readOnly.of(o)]);
|
|
1889
1888
|
}
|
|
1890
1889
|
setMaxLength(o) {
|
|
1891
1890
|
this.maxLength = o, this.toggleMaxlength([
|
|
1892
|
-
|
|
1891
|
+
ke.changeFilter.of((l) => l.newDoc.length <= o)
|
|
1893
1892
|
]);
|
|
1894
1893
|
}
|
|
1895
1894
|
}
|
|
1896
|
-
const
|
|
1895
|
+
const go = (e) => {
|
|
1897
1896
|
const o = I("editorId");
|
|
1898
1897
|
return (a) => {
|
|
1899
1898
|
if (!a.clipboardData)
|
|
1900
1899
|
return;
|
|
1901
1900
|
if (a.clipboardData.files.length > 0) {
|
|
1902
1901
|
const { files: i } = a.clipboardData;
|
|
1903
|
-
|
|
1902
|
+
h.emit(
|
|
1904
1903
|
o,
|
|
1905
|
-
|
|
1904
|
+
we,
|
|
1906
1905
|
Array.from(i).filter((g) => /image\/.*/.test(g.type))
|
|
1907
1906
|
), a.preventDefault();
|
|
1908
1907
|
return;
|
|
1909
1908
|
}
|
|
1910
1909
|
if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
|
|
1911
1910
|
const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
|
|
1912
|
-
|
|
1911
|
+
h.emit(o, w, "code", {
|
|
1913
1912
|
mode: i.mode,
|
|
1914
1913
|
text: a.clipboardData.getData("text/plain")
|
|
1915
1914
|
}), a.preventDefault();
|
|
1916
1915
|
return;
|
|
1917
1916
|
}
|
|
1918
1917
|
const r = a.clipboardData.getData("text/plain");
|
|
1919
|
-
e.maxlength && r.length + e.modelValue.length > e.maxlength &&
|
|
1918
|
+
e.maxlength && r.length + e.modelValue.length > e.maxlength && h.emit(o, te, {
|
|
1920
1919
|
name: "overlength",
|
|
1921
1920
|
message: "The input text is too long",
|
|
1922
1921
|
data: r
|
|
1923
1922
|
});
|
|
1924
1923
|
};
|
|
1925
|
-
},
|
|
1924
|
+
}, fo = go, bo = (e) => {
|
|
1926
1925
|
const o = I("editorId");
|
|
1927
1926
|
J(() => {
|
|
1928
|
-
|
|
1929
|
-
name:
|
|
1927
|
+
h.on(o, {
|
|
1928
|
+
name: Xt,
|
|
1930
1929
|
callback(l) {
|
|
1931
1930
|
var a;
|
|
1932
1931
|
(a = e.value) == null || a.focus(l);
|
|
1933
1932
|
}
|
|
1934
1933
|
});
|
|
1935
1934
|
});
|
|
1936
|
-
},
|
|
1935
|
+
}, ho = bo, vo = (e, o) => [
|
|
1937
1936
|
{
|
|
1938
1937
|
key: "Ctrl-b",
|
|
1939
1938
|
mac: "Cmd-b",
|
|
1940
|
-
run: () => (
|
|
1939
|
+
run: () => (h.emit(e, w, "bold"), !0)
|
|
1941
1940
|
},
|
|
1942
1941
|
{
|
|
1943
1942
|
key: "Ctrl-d",
|
|
1944
1943
|
mac: "Cmd-d",
|
|
1945
|
-
run:
|
|
1944
|
+
run: al,
|
|
1946
1945
|
preventDefault: !0
|
|
1947
1946
|
},
|
|
1948
1947
|
{
|
|
1949
1948
|
key: "Ctrl-s",
|
|
1950
1949
|
mac: "Cmd-s",
|
|
1951
|
-
run: (N) => (
|
|
1952
|
-
shift: () => (
|
|
1950
|
+
run: (N) => (h.emit(e, At, N.state.doc.toString()), !0),
|
|
1951
|
+
shift: () => (h.emit(e, w, "strikeThrough"), !0)
|
|
1953
1952
|
},
|
|
1954
1953
|
{
|
|
1955
1954
|
key: "Ctrl-u",
|
|
1956
1955
|
mac: "Cmd-u",
|
|
1957
|
-
run: () => (
|
|
1958
|
-
shift: () => (
|
|
1956
|
+
run: () => (h.emit(e, w, "underline"), !0),
|
|
1957
|
+
shift: () => (h.emit(e, w, "unorderedList"), !0)
|
|
1959
1958
|
},
|
|
1960
1959
|
{
|
|
1961
1960
|
key: "Ctrl-i",
|
|
1962
1961
|
mac: "Cmd-i",
|
|
1963
|
-
run: () => (
|
|
1964
|
-
shift: () => (
|
|
1962
|
+
run: () => (h.emit(e, w, "italic"), !0),
|
|
1963
|
+
shift: () => (h.emit(e, ye, "image"), !0)
|
|
1965
1964
|
},
|
|
1966
1965
|
{
|
|
1967
1966
|
key: "Ctrl-1",
|
|
1968
1967
|
mac: "Cmd-1",
|
|
1969
|
-
run: () => (
|
|
1968
|
+
run: () => (h.emit(e, w, "h1"), !0)
|
|
1970
1969
|
},
|
|
1971
1970
|
{
|
|
1972
1971
|
key: "Ctrl-2",
|
|
1973
1972
|
mac: "Cmd-2",
|
|
1974
|
-
run: () => (
|
|
1973
|
+
run: () => (h.emit(e, w, "h2"), !0)
|
|
1975
1974
|
},
|
|
1976
1975
|
{
|
|
1977
1976
|
key: "Ctrl-3",
|
|
1978
1977
|
mac: "Cmd-3",
|
|
1979
|
-
run: () => (
|
|
1978
|
+
run: () => (h.emit(e, w, "h3"), !0)
|
|
1980
1979
|
},
|
|
1981
1980
|
{
|
|
1982
1981
|
key: "Ctrl-4",
|
|
1983
1982
|
mac: "Cmd-4",
|
|
1984
|
-
run: () => (
|
|
1983
|
+
run: () => (h.emit(e, w, "h4"), !0)
|
|
1985
1984
|
},
|
|
1986
1985
|
{
|
|
1987
1986
|
key: "Ctrl-5",
|
|
1988
1987
|
mac: "Cmd-5",
|
|
1989
|
-
run: () => (
|
|
1988
|
+
run: () => (h.emit(e, w, "h5"), !0)
|
|
1990
1989
|
},
|
|
1991
1990
|
{
|
|
1992
1991
|
key: "Ctrl-6",
|
|
1993
1992
|
mac: "Cmd-6",
|
|
1994
|
-
run: () => (
|
|
1993
|
+
run: () => (h.emit(e, w, "h6"), !0)
|
|
1995
1994
|
},
|
|
1996
1995
|
{
|
|
1997
1996
|
key: "Ctrl-ArrowUp",
|
|
1998
1997
|
mac: "Cmd-ArrowUp",
|
|
1999
|
-
run: () => (
|
|
1998
|
+
run: () => (h.emit(e, w, "sup"), !0)
|
|
2000
1999
|
},
|
|
2001
2000
|
{
|
|
2002
2001
|
key: "Ctrl-ArrowDown",
|
|
2003
2002
|
mac: "Cmd-ArrowDown",
|
|
2004
|
-
run: () => (
|
|
2003
|
+
run: () => (h.emit(e, w, "sub"), !0)
|
|
2005
2004
|
},
|
|
2006
2005
|
{
|
|
2007
2006
|
key: "Ctrl-o",
|
|
2008
2007
|
mac: "Cmd-o",
|
|
2009
|
-
run: () => (
|
|
2008
|
+
run: () => (h.emit(e, w, "orderedList"), !0)
|
|
2010
2009
|
},
|
|
2011
2010
|
{
|
|
2012
2011
|
key: "Ctrl-c",
|
|
2013
2012
|
mac: "Cmd-c",
|
|
2014
|
-
shift: () => (
|
|
2013
|
+
shift: () => (h.emit(e, w, "code"), !0),
|
|
2015
2014
|
any(N, L) {
|
|
2016
|
-
return (L.ctrlKey || L.metaKey) && L.altKey && L.code === "KeyC" ? (
|
|
2015
|
+
return (L.ctrlKey || L.metaKey) && L.altKey && L.code === "KeyC" ? (h.emit(e, w, "codeRow"), !0) : !1;
|
|
2017
2016
|
}
|
|
2018
2017
|
},
|
|
2019
2018
|
{
|
|
2020
2019
|
key: "Ctrl-l",
|
|
2021
2020
|
mac: "Cmd-l",
|
|
2022
|
-
run: () => (
|
|
2021
|
+
run: () => (h.emit(e, ye, "link"), !0)
|
|
2023
2022
|
},
|
|
2024
2023
|
{
|
|
2025
2024
|
key: "Ctrl-f",
|
|
2026
2025
|
mac: "Cmd-f",
|
|
2027
|
-
shift: () => o.noPrettier ? !1 : (
|
|
2026
|
+
shift: () => o.noPrettier ? !1 : (h.emit(e, w, "prettier"), !0)
|
|
2028
2027
|
},
|
|
2029
2028
|
{
|
|
2030
|
-
any: (N, L) => (L.ctrlKey || L.metaKey) && L.altKey && L.shiftKey && L.code === "KeyT" ? (
|
|
2029
|
+
any: (N, L) => (L.ctrlKey || L.metaKey) && L.altKey && L.shiftKey && L.code === "KeyT" ? (h.emit(e, w, "table"), !0) : !1
|
|
2031
2030
|
}
|
|
2032
|
-
],
|
|
2033
|
-
const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = j(), i =
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
Jt({ codeLanguages: Yt }),
|
|
2031
|
+
], ko = vo, Co = (e) => {
|
|
2032
|
+
const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = j(), i = Vt(), g = new be(), c = new be(), u = new be(), d = ko(l, e), p = fo(e), T = [
|
|
2033
|
+
el.of([...d, nl]),
|
|
2034
|
+
Jt,
|
|
2035
|
+
g.of(ll({ codeLanguages: tl })),
|
|
2038
2036
|
// 横向换行
|
|
2039
2037
|
ge.lineWrapping,
|
|
2040
|
-
ge.updateListener.of((
|
|
2041
|
-
|
|
2038
|
+
ge.updateListener.of((m) => {
|
|
2039
|
+
m.docChanged && e.onChange(m.state.doc.toString());
|
|
2042
2040
|
}),
|
|
2043
2041
|
ge.domEventHandlers({
|
|
2044
|
-
paste:
|
|
2042
|
+
paste: p,
|
|
2045
2043
|
blur: e.onBlur,
|
|
2046
2044
|
focus: e.onFocus,
|
|
2047
2045
|
drop: e.onDrop,
|
|
2048
|
-
input: (
|
|
2049
|
-
e.onInput && e.onInput(
|
|
2050
|
-
const { data:
|
|
2051
|
-
e.maxlength && e.modelValue.length +
|
|
2046
|
+
input: (m) => {
|
|
2047
|
+
e.onInput && e.onInput(m);
|
|
2048
|
+
const { data: b } = m;
|
|
2049
|
+
e.maxlength && e.modelValue.length + b.length > e.maxlength && h.emit(l, te, {
|
|
2052
2050
|
name: "overlength",
|
|
2053
2051
|
message: "The input text is too long",
|
|
2054
|
-
data:
|
|
2052
|
+
data: b
|
|
2055
2053
|
});
|
|
2056
2054
|
}
|
|
2057
2055
|
})
|
|
2058
|
-
],
|
|
2059
|
-
const
|
|
2060
|
-
...
|
|
2061
|
-
a.value === "light" ?
|
|
2062
|
-
|
|
2056
|
+
], $ = () => {
|
|
2057
|
+
const m = [
|
|
2058
|
+
...T,
|
|
2059
|
+
c.of(a.value === "light" ? Tt : vt),
|
|
2060
|
+
u.of(xt(e.completions))
|
|
2063
2061
|
];
|
|
2064
|
-
return Y.codeMirrorExtensions(a.value,
|
|
2065
|
-
...
|
|
2062
|
+
return Y.codeMirrorExtensions(a.value, m, [
|
|
2063
|
+
...d
|
|
2066
2064
|
]);
|
|
2067
2065
|
};
|
|
2068
2066
|
return J(() => {
|
|
2069
|
-
const
|
|
2067
|
+
const m = new ge({
|
|
2070
2068
|
doc: e.modelValue,
|
|
2071
|
-
parent: r.value
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2069
|
+
parent: r.value,
|
|
2070
|
+
extensions: [$()]
|
|
2071
|
+
}), b = new mo(m);
|
|
2072
|
+
i.value = b, setTimeout(() => {
|
|
2073
|
+
b.setTabSize(o), b.setDisabled(e.disabled), b.setReadOnly(e.readonly), e.placeholder && b.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && b.setMaxLength(e.maxlength), e.autofocus && m.focus();
|
|
2074
|
+
}, 0), h.on(l, {
|
|
2075
|
+
name: Lt,
|
|
2077
2076
|
callback() {
|
|
2078
|
-
|
|
2077
|
+
rl(m);
|
|
2079
2078
|
}
|
|
2080
|
-
}),
|
|
2081
|
-
name:
|
|
2079
|
+
}), h.on(l, {
|
|
2080
|
+
name: Mt,
|
|
2082
2081
|
callback() {
|
|
2083
|
-
|
|
2082
|
+
il(m);
|
|
2084
2083
|
}
|
|
2085
|
-
}),
|
|
2084
|
+
}), h.on(l, {
|
|
2086
2085
|
name: w,
|
|
2087
|
-
callback(
|
|
2088
|
-
var
|
|
2089
|
-
const { text:
|
|
2090
|
-
(
|
|
2086
|
+
callback(f, v = {}) {
|
|
2087
|
+
var S;
|
|
2088
|
+
const { text: y, options: x } = Ul(f, i.value, v);
|
|
2089
|
+
(S = i.value) == null || S.replaceSelectedText(y, x, l);
|
|
2091
2090
|
}
|
|
2092
2091
|
});
|
|
2093
|
-
}),
|
|
2094
|
-
|
|
2092
|
+
}), V(
|
|
2093
|
+
a,
|
|
2095
2094
|
() => {
|
|
2096
|
-
var
|
|
2097
|
-
(
|
|
2095
|
+
var m;
|
|
2096
|
+
(m = i.value) == null || m.view.dispatch({
|
|
2097
|
+
effects: c.reconfigure(a.value === "light" ? Tt : vt)
|
|
2098
|
+
});
|
|
2098
2099
|
},
|
|
2099
2100
|
{
|
|
2100
2101
|
deep: !0
|
|
2101
2102
|
}
|
|
2102
|
-
),
|
|
2103
|
+
), V(
|
|
2104
|
+
() => e.completions,
|
|
2105
|
+
() => {
|
|
2106
|
+
var m;
|
|
2107
|
+
(m = i.value) == null || m.view.dispatch({
|
|
2108
|
+
effects: u.reconfigure(xt(e.completions))
|
|
2109
|
+
});
|
|
2110
|
+
},
|
|
2111
|
+
{
|
|
2112
|
+
deep: !0
|
|
2113
|
+
}
|
|
2114
|
+
), V(
|
|
2103
2115
|
() => e.modelValue,
|
|
2104
2116
|
() => {
|
|
2105
|
-
var
|
|
2106
|
-
((
|
|
2117
|
+
var m, b;
|
|
2118
|
+
((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((b = i.value) == null || b.setValue(e.modelValue));
|
|
2107
2119
|
}
|
|
2108
|
-
),
|
|
2120
|
+
), V(
|
|
2109
2121
|
() => e.placeholder,
|
|
2110
2122
|
() => {
|
|
2111
|
-
var
|
|
2112
|
-
(
|
|
2123
|
+
var m;
|
|
2124
|
+
(m = i.value) == null || m.setPlaceholder(e.placeholder);
|
|
2113
2125
|
}
|
|
2114
|
-
),
|
|
2126
|
+
), V(
|
|
2115
2127
|
() => e.disabled,
|
|
2116
2128
|
() => {
|
|
2117
|
-
var
|
|
2118
|
-
(
|
|
2129
|
+
var m;
|
|
2130
|
+
(m = i.value) == null || m.setDisabled(e.disabled);
|
|
2119
2131
|
}
|
|
2120
|
-
),
|
|
2132
|
+
), V(
|
|
2121
2133
|
() => e.readonly,
|
|
2122
2134
|
() => {
|
|
2123
|
-
var
|
|
2124
|
-
(
|
|
2135
|
+
var m;
|
|
2136
|
+
(m = i.value) == null || m.setDisabled(e.readonly);
|
|
2125
2137
|
}
|
|
2126
|
-
),
|
|
2138
|
+
), V(
|
|
2127
2139
|
() => e.maxlength,
|
|
2128
2140
|
() => {
|
|
2129
|
-
var
|
|
2130
|
-
e.maxlength && ((
|
|
2141
|
+
var m;
|
|
2142
|
+
e.maxlength && ((m = i.value) == null || m.setMaxLength(e.maxlength));
|
|
2131
2143
|
}
|
|
2132
|
-
),
|
|
2144
|
+
), ho(i), {
|
|
2133
2145
|
inputWrapperRef: r,
|
|
2134
2146
|
codeMirrorUt: i
|
|
2135
2147
|
};
|
|
2136
|
-
},
|
|
2148
|
+
}, po = Co, $o = /* @__PURE__ */ P({
|
|
2137
2149
|
name: "MDEditorContent",
|
|
2138
|
-
props:
|
|
2150
|
+
props: ul,
|
|
2139
2151
|
setup(e) {
|
|
2140
2152
|
const o = I("editorId"), l = j(""), {
|
|
2141
2153
|
inputWrapperRef: a,
|
|
2142
2154
|
codeMirrorUt: r
|
|
2143
|
-
} =
|
|
2144
|
-
return
|
|
2155
|
+
} = po(e);
|
|
2156
|
+
return Pl(e, l, r), () => t("div", {
|
|
2145
2157
|
class: `${n}-content`
|
|
2146
2158
|
}, [t("div", {
|
|
2147
2159
|
class: `${n}-input-wrapper`,
|
|
2148
2160
|
ref: a
|
|
2149
|
-
}, null), t(
|
|
2161
|
+
}, null), t(dl, {
|
|
2150
2162
|
modelValue: e.modelValue,
|
|
2151
2163
|
setting: e.setting,
|
|
2152
2164
|
onHtmlChanged: (i) => {
|
|
@@ -2160,7 +2172,7 @@ const bo = (e) => {
|
|
|
2160
2172
|
formatCopiedText: e.formatCopiedText,
|
|
2161
2173
|
noHighlight: e.noHighlight,
|
|
2162
2174
|
noImgZoomIn: e.noImgZoomIn
|
|
2163
|
-
}, null), e.catalogVisible && t(
|
|
2175
|
+
}, null), e.catalogVisible && t(Ht, {
|
|
2164
2176
|
theme: e.theme,
|
|
2165
2177
|
class: `${n}-catalog-editor`,
|
|
2166
2178
|
editorId: o,
|
|
@@ -2168,7 +2180,7 @@ const bo = (e) => {
|
|
|
2168
2180
|
key: "internal-catalog"
|
|
2169
2181
|
}, null)]);
|
|
2170
2182
|
}
|
|
2171
|
-
}),
|
|
2183
|
+
}), yo = /* @__PURE__ */ P({
|
|
2172
2184
|
props: {
|
|
2173
2185
|
modelValue: {
|
|
2174
2186
|
type: String,
|
|
@@ -2186,7 +2198,7 @@ const bo = (e) => {
|
|
|
2186
2198
|
}, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
|
|
2187
2199
|
};
|
|
2188
2200
|
}
|
|
2189
|
-
}),
|
|
2201
|
+
}), To = {
|
|
2190
2202
|
checked: {
|
|
2191
2203
|
type: Boolean,
|
|
2192
2204
|
default: !1
|
|
@@ -2196,8 +2208,8 @@ const bo = (e) => {
|
|
|
2196
2208
|
default: () => {
|
|
2197
2209
|
}
|
|
2198
2210
|
}
|
|
2199
|
-
},
|
|
2200
|
-
props:
|
|
2211
|
+
}, wo = /* @__PURE__ */ P({
|
|
2212
|
+
props: To,
|
|
2201
2213
|
setup(e) {
|
|
2202
2214
|
return () => t("div", {
|
|
2203
2215
|
class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
|
|
@@ -2206,7 +2218,7 @@ const bo = (e) => {
|
|
|
2206
2218
|
}
|
|
2207
2219
|
}, null);
|
|
2208
2220
|
}
|
|
2209
|
-
}),
|
|
2221
|
+
}), xo = {
|
|
2210
2222
|
scrollAuto: {
|
|
2211
2223
|
type: Boolean
|
|
2212
2224
|
},
|
|
@@ -2215,8 +2227,8 @@ const bo = (e) => {
|
|
|
2215
2227
|
default: () => {
|
|
2216
2228
|
}
|
|
2217
2229
|
}
|
|
2218
|
-
},
|
|
2219
|
-
props:
|
|
2230
|
+
}, So = /* @__PURE__ */ P({
|
|
2231
|
+
props: xo,
|
|
2220
2232
|
setup(e) {
|
|
2221
2233
|
const o = I("usedLanguageText");
|
|
2222
2234
|
return () => {
|
|
@@ -2228,13 +2240,13 @@ const bo = (e) => {
|
|
|
2228
2240
|
onClick: () => {
|
|
2229
2241
|
e.onScrollAutoChange(!e.scrollAuto);
|
|
2230
2242
|
}
|
|
2231
|
-
}, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(
|
|
2243
|
+
}, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(wo, {
|
|
2232
2244
|
checked: e.scrollAuto,
|
|
2233
2245
|
onChange: e.onScrollAutoChange
|
|
2234
2246
|
}, null)]);
|
|
2235
2247
|
};
|
|
2236
2248
|
}
|
|
2237
|
-
}),
|
|
2249
|
+
}), Ao = {
|
|
2238
2250
|
modelValue: {
|
|
2239
2251
|
type: String,
|
|
2240
2252
|
default: ""
|
|
@@ -2254,22 +2266,22 @@ const bo = (e) => {
|
|
|
2254
2266
|
defFooters: {
|
|
2255
2267
|
type: Object
|
|
2256
2268
|
}
|
|
2257
|
-
},
|
|
2269
|
+
}, Mo = /* @__PURE__ */ P({
|
|
2258
2270
|
name: "MDEditorFooter",
|
|
2259
|
-
props:
|
|
2271
|
+
props: Ao,
|
|
2260
2272
|
setup(e) {
|
|
2261
|
-
const o =
|
|
2273
|
+
const o = Te(() => {
|
|
2262
2274
|
const a = e.footers.indexOf("="), r = a === -1 ? e.footers : e.footers.slice(0, a), i = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
|
|
2263
2275
|
return [r, i];
|
|
2264
2276
|
}), l = (a) => {
|
|
2265
|
-
if (
|
|
2277
|
+
if (Pt.includes(a))
|
|
2266
2278
|
switch (a) {
|
|
2267
2279
|
case "markdownTotal":
|
|
2268
|
-
return t(
|
|
2280
|
+
return t(yo, {
|
|
2269
2281
|
modelValue: e.modelValue
|
|
2270
2282
|
}, null);
|
|
2271
2283
|
case "scrollSwitch":
|
|
2272
|
-
return t(
|
|
2284
|
+
return t(So, {
|
|
2273
2285
|
scrollAuto: e.scrollAuto,
|
|
2274
2286
|
onScrollAutoChange: e.onScrollAutoChange
|
|
2275
2287
|
}, null);
|
|
@@ -2288,10 +2300,10 @@ const bo = (e) => {
|
|
|
2288
2300
|
}, [r])]);
|
|
2289
2301
|
};
|
|
2290
2302
|
}
|
|
2291
|
-
}),
|
|
2303
|
+
}), Lo = /* @__PURE__ */ P({
|
|
2292
2304
|
name: "MdEditorV3",
|
|
2293
|
-
props:
|
|
2294
|
-
emits:
|
|
2305
|
+
props: ml,
|
|
2306
|
+
emits: gl,
|
|
2295
2307
|
setup(e, o) {
|
|
2296
2308
|
const {
|
|
2297
2309
|
editorId: l,
|
|
@@ -2303,36 +2315,36 @@ const bo = (e) => {
|
|
|
2303
2315
|
} = e, u = ee({
|
|
2304
2316
|
scrollAuto: e.scrollAuto
|
|
2305
2317
|
});
|
|
2306
|
-
|
|
2307
|
-
const [
|
|
2308
|
-
return
|
|
2309
|
-
|
|
2310
|
-
}),
|
|
2311
|
-
var
|
|
2312
|
-
const $ =
|
|
2318
|
+
fl(e, o), bl(e), hl(e), vl(e, o);
|
|
2319
|
+
const [d, p] = kl(e, o), T = Cl(e);
|
|
2320
|
+
return Ft(() => {
|
|
2321
|
+
h.clear(l);
|
|
2322
|
+
}), pl(e, o, T, d, p), () => {
|
|
2323
|
+
var b;
|
|
2324
|
+
const $ = dt({
|
|
2313
2325
|
props: e,
|
|
2314
2326
|
ctx: o
|
|
2315
|
-
}, "defToolbars"),
|
|
2327
|
+
}, "defToolbars"), m = dt({
|
|
2316
2328
|
props: e,
|
|
2317
2329
|
ctx: o
|
|
2318
2330
|
}, "defFooters");
|
|
2319
2331
|
return t("div", {
|
|
2320
2332
|
id: l,
|
|
2321
|
-
class: [n, e.class, e.theme === "dark" && `${n}-dark`,
|
|
2333
|
+
class: [n, e.class, e.theme === "dark" && `${n}-dark`, d.fullscreen || d.pageFullscreen ? `${n}-fullscreen` : ""],
|
|
2322
2334
|
style: e.style
|
|
2323
|
-
}, [t(
|
|
2335
|
+
}, [t(Vl, {
|
|
2324
2336
|
noPrettier: i,
|
|
2325
2337
|
toolbars: e.toolbars,
|
|
2326
2338
|
toolbarsExclude: e.toolbarsExclude,
|
|
2327
|
-
setting:
|
|
2328
|
-
updateSetting:
|
|
2339
|
+
setting: d,
|
|
2340
|
+
updateSetting: p,
|
|
2329
2341
|
tableShape: e.tableShape,
|
|
2330
2342
|
defToolbars: $,
|
|
2331
2343
|
noUploadImg: g,
|
|
2332
2344
|
showToolbarName: e.showToolbarName
|
|
2333
|
-
}, null), t(
|
|
2345
|
+
}, null), t($o, {
|
|
2334
2346
|
modelValue: e.modelValue,
|
|
2335
|
-
setting:
|
|
2347
|
+
setting: d,
|
|
2336
2348
|
mdHeadingId: e.mdHeadingId,
|
|
2337
2349
|
noMermaid: r,
|
|
2338
2350
|
noPrettier: i,
|
|
@@ -2366,23 +2378,23 @@ const bo = (e) => {
|
|
|
2366
2378
|
e.onInput ? e.onInput(f) : o.emit("onInput", f);
|
|
2367
2379
|
},
|
|
2368
2380
|
completions: e.completions,
|
|
2369
|
-
catalogVisible:
|
|
2381
|
+
catalogVisible: T.value,
|
|
2370
2382
|
theme: e.theme,
|
|
2371
2383
|
noImgZoomIn: e.noImgZoomIn,
|
|
2372
2384
|
onDrop: (f) => {
|
|
2373
2385
|
e.onDrop ? e.onDrop(f) : o.emit("onDrop", f);
|
|
2374
2386
|
}
|
|
2375
|
-
}, null), ((
|
|
2387
|
+
}, null), ((b = e.footers) == null ? void 0 : b.length) > 0 && t(Mo, {
|
|
2376
2388
|
modelValue: e.modelValue,
|
|
2377
2389
|
footers: e.footers,
|
|
2378
|
-
defFooters:
|
|
2390
|
+
defFooters: m,
|
|
2379
2391
|
scrollAuto: u.scrollAuto,
|
|
2380
2392
|
onScrollAutoChange: (f) => u.scrollAuto = f
|
|
2381
2393
|
}, null)]);
|
|
2382
2394
|
};
|
|
2383
2395
|
}
|
|
2384
|
-
}),
|
|
2385
|
-
|
|
2396
|
+
}), $e = Lo;
|
|
2397
|
+
$e.install = (e) => (e.component($e.name, $e), e.use(yl).use(Kt).use(Tl).use(Ht).use($l), e);
|
|
2386
2398
|
export {
|
|
2387
|
-
|
|
2399
|
+
$e as default
|
|
2388
2400
|
};
|