md-editor-v3 4.10.0 → 4.11.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/README.md +20 -0
- package/lib/cjs/MdEditor.cjs +19 -19
- package/lib/cjs/chunks/config.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +7 -7
- package/lib/cjs/chunks/index4.cjs +2 -2
- package/lib/es/MdEditor.mjs +735 -726
- package/lib/es/chunks/config.mjs +17 -17
- package/lib/es/chunks/index.mjs +434 -412
- package/lib/es/chunks/index4.mjs +21 -22
- package/lib/types/MdEditor/composition.d.ts +2 -1
- package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +1 -0
- package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +1 -0
- package/lib/types/MdEditor/layouts/Content/index.d.ts +12 -12
- package/lib/types/MdEditor/layouts/Content/type.d.ts +17 -0
- package/lib/types/MdEditor/static/event-name.d.ts +1 -0
- package/lib/types/MdEditor/type.d.ts +12 -0
- package/lib/types/MdEditor/utils/index.d.ts +0 -6
- package/lib/umd/index.js +45 -46
- package/package.json +2 -2
- package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +0 -7
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { p as n, e as
|
|
6
|
-
import { draggingScroll as _t, linkTo as
|
|
7
|
-
import { a as se, D as
|
|
8
|
-
import { b
|
|
1
|
+
var Rt = Object.defineProperty;
|
|
2
|
+
var Pt = (e, o, l) => o in e ? Rt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
|
|
3
|
+
var U = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
|
|
4
|
+
import { defineComponent as W, createVNode as t, inject as I, ref as P, onMounted as Q, reactive as G, computed as we, watch as H, nextTick as ve, Fragment as It, cloneVNode as gt, toRef as te, shallowRef as Wt, onBeforeUnmount as Dt } from "vue";
|
|
5
|
+
import { p as n, e as J, n as zt, b as qt, M as fe, d as Ut } from "./chunks/config.mjs";
|
|
6
|
+
import { draggingScroll as _t, linkTo as Gt, debounce as Kt, createSmoothScroll as jt, throttle as Zt } from "@vavt/util";
|
|
7
|
+
import { a as se, D as Xt } from "./chunks/index2.mjs";
|
|
8
|
+
import { b, i as Yt, E as le, U as xe, j as Jt, k as Te, h as x, c as Qt, O as Et, l as Ht, m as Nt } from "./chunks/index4.mjs";
|
|
9
9
|
import { a as el } from "./chunks/dom.mjs";
|
|
10
|
-
import { M as
|
|
11
|
-
import {
|
|
12
|
-
import { EditorView as Se, placeholder as
|
|
13
|
-
import { languages as
|
|
14
|
-
import { markdown as
|
|
15
|
-
import { EditorSelection as
|
|
16
|
-
import { deleteLine as rl,
|
|
17
|
-
import { HighlightStyle as
|
|
10
|
+
import { M as Bt, I as T } from "./chunks/index3.mjs";
|
|
11
|
+
import { EditorView as he } from "codemirror";
|
|
12
|
+
import { EditorView as Se, placeholder as tl, keymap as ll } from "@codemirror/view";
|
|
13
|
+
import { languages as ol } from "@codemirror/language-data";
|
|
14
|
+
import { markdown as al } from "@codemirror/lang-markdown";
|
|
15
|
+
import { EditorSelection as _, EditorState as Ce, Compartment as ce, StateEffect as nl } from "@codemirror/state";
|
|
16
|
+
import { deleteLine as il, defaultKeymap as rl, historyKeymap as sl, indentWithTab as cl, history as ft, undo as ul, redo as dl } from "@codemirror/commands";
|
|
17
|
+
import { HighlightStyle as Ot, syntaxHighlighting as Vt, indentUnit as ml } from "@codemirror/language";
|
|
18
18
|
import { tags as c } from "@lezer/highlight";
|
|
19
|
-
import { autocompletion as
|
|
20
|
-
import { c as
|
|
21
|
-
import
|
|
22
|
-
import { g as
|
|
23
|
-
import
|
|
24
|
-
import
|
|
19
|
+
import { autocompletion as gl } from "@codemirror/autocomplete";
|
|
20
|
+
import { c as fl, C as hl, e as bl, a as vl, u as kl, b as Cl, d as $l, f as pl, g as yl, h as Tl, i as wl, M as xl } from "./chunks/index.mjs";
|
|
21
|
+
import Ft from "./MdCatalog.mjs";
|
|
22
|
+
import { g as ht } from "./chunks/vue-tsx.mjs";
|
|
23
|
+
import Sl from "./NormalToolbar.mjs";
|
|
24
|
+
import Ml from "./ModalToolbar.mjs";
|
|
25
25
|
import "medium-zoom";
|
|
26
26
|
import "copy-to-clipboard";
|
|
27
27
|
import "markdown-it";
|
|
28
28
|
import "markdown-it-image-figures";
|
|
29
29
|
import "markdown-it-task-lists";
|
|
30
30
|
import "lru-cache";
|
|
31
|
-
const Al = /* @__PURE__ */
|
|
31
|
+
const Al = /* @__PURE__ */ W({
|
|
32
32
|
setup() {
|
|
33
33
|
return () => t("div", {
|
|
34
34
|
class: `${n}-divider`
|
|
35
35
|
}, null);
|
|
36
36
|
}
|
|
37
|
-
}),
|
|
37
|
+
}), Ll = {
|
|
38
38
|
noPrettier: {
|
|
39
39
|
type: Boolean
|
|
40
40
|
},
|
|
@@ -83,38 +83,38 @@ const Al = /* @__PURE__ */ P({
|
|
|
83
83
|
showToolbarName: {
|
|
84
84
|
type: Boolean
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
var
|
|
88
|
-
const o =
|
|
89
|
-
let l = (s = (
|
|
90
|
-
const a = (
|
|
86
|
+
}, Il = (e) => {
|
|
87
|
+
var d, s, g, p;
|
|
88
|
+
const o = I("editorId");
|
|
89
|
+
let l = (s = (d = J.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : s.instance;
|
|
90
|
+
const a = (p = (g = J.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : p.js, r = P(!1), i = (k) => {
|
|
91
91
|
if (!l) {
|
|
92
|
-
|
|
92
|
+
b.emit(o, le, {
|
|
93
93
|
name: "fullscreen",
|
|
94
94
|
message: "fullscreen is undefined"
|
|
95
95
|
});
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
l.isEnabled ? (
|
|
99
|
-
},
|
|
98
|
+
l.isEnabled ? (r.value = !0, (k === void 0 ? !l.isFullscreen : k) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
|
|
99
|
+
}, h = () => {
|
|
100
100
|
l && l.isEnabled && l.on("change", () => {
|
|
101
|
-
(
|
|
101
|
+
(r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
|
|
102
102
|
});
|
|
103
|
-
},
|
|
104
|
-
l = window.screenfull,
|
|
103
|
+
}, f = () => {
|
|
104
|
+
l = window.screenfull, h();
|
|
105
105
|
};
|
|
106
|
-
return
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
|
|
106
|
+
return Q(() => {
|
|
107
|
+
if (h(), !l) {
|
|
108
|
+
const k = document.createElement("script");
|
|
109
|
+
k.src = a || zt, k.onload = f, k.id = `${n}-screenfull`, el(k, "screenfull");
|
|
110
110
|
}
|
|
111
|
-
}),
|
|
112
|
-
|
|
113
|
-
name:
|
|
114
|
-
callback:
|
|
111
|
+
}), Q(() => {
|
|
112
|
+
b.on(o, {
|
|
113
|
+
name: Yt,
|
|
114
|
+
callback: i
|
|
115
115
|
});
|
|
116
|
-
}), { fullscreenHandler:
|
|
117
|
-
},
|
|
116
|
+
}), { fullscreenHandler: i };
|
|
117
|
+
}, Dl = {
|
|
118
118
|
tableShape: {
|
|
119
119
|
type: Array,
|
|
120
120
|
default: () => [6, 4]
|
|
@@ -124,9 +124,9 @@ const Al = /* @__PURE__ */ P({
|
|
|
124
124
|
default: () => {
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
},
|
|
127
|
+
}, El = /* @__PURE__ */ W({
|
|
128
128
|
name: "TableShape",
|
|
129
|
-
props:
|
|
129
|
+
props: Dl,
|
|
130
130
|
setup(e) {
|
|
131
131
|
const o = G({
|
|
132
132
|
x: -1,
|
|
@@ -140,20 +140,20 @@ const Al = /* @__PURE__ */ P({
|
|
|
140
140
|
}, [new Array(e.tableShape[1]).fill("").map((l, a) => t("div", {
|
|
141
141
|
class: `${n}-table-shape-row`,
|
|
142
142
|
key: `table-shape-row-${a}`
|
|
143
|
-
}, [new Array(e.tableShape[0]).fill("").map((
|
|
143
|
+
}, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
|
|
144
144
|
class: `${n}-table-shape-col`,
|
|
145
|
-
key: `table-shape-col-${
|
|
145
|
+
key: `table-shape-col-${i}`,
|
|
146
146
|
onMouseenter: () => {
|
|
147
|
-
o.x = a, o.y =
|
|
147
|
+
o.x = a, o.y = i;
|
|
148
148
|
},
|
|
149
149
|
onClick: () => {
|
|
150
150
|
e.onSelected(o);
|
|
151
151
|
}
|
|
152
152
|
}, [t("div", {
|
|
153
|
-
class: [`${n}-table-shape-col-default`, a <= o.x &&
|
|
153
|
+
class: [`${n}-table-shape-col-default`, a <= o.x && i <= o.y && `${n}-table-shape-col-include`]
|
|
154
154
|
}, null)]))]))]);
|
|
155
155
|
}
|
|
156
|
-
}),
|
|
156
|
+
}), Hl = El, Nl = {
|
|
157
157
|
type: {
|
|
158
158
|
type: String,
|
|
159
159
|
default: "link"
|
|
@@ -172,47 +172,47 @@ const Al = /* @__PURE__ */ P({
|
|
|
172
172
|
default: () => {
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
},
|
|
176
|
-
props:
|
|
175
|
+
}, Bl = /* @__PURE__ */ W({
|
|
176
|
+
props: Nl,
|
|
177
177
|
setup(e) {
|
|
178
|
-
const o =
|
|
179
|
-
var
|
|
178
|
+
const o = I("usedLanguageText"), l = I("editorId"), a = we(() => {
|
|
179
|
+
var i, h;
|
|
180
180
|
switch (e.type) {
|
|
181
181
|
case "link":
|
|
182
|
-
return (
|
|
182
|
+
return (i = o.value.linkModalTips) == null ? void 0 : i.linkTitle;
|
|
183
183
|
case "image":
|
|
184
|
-
return (
|
|
184
|
+
return (h = o.value.linkModalTips) == null ? void 0 : h.imageTitle;
|
|
185
185
|
default:
|
|
186
186
|
return "";
|
|
187
187
|
}
|
|
188
|
-
}),
|
|
188
|
+
}), r = G({
|
|
189
189
|
desc: "",
|
|
190
190
|
url: ""
|
|
191
191
|
});
|
|
192
|
-
return H(() => e.visible, (
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
return H(() => e.visible, (i) => {
|
|
193
|
+
i || setTimeout(() => {
|
|
194
|
+
r.desc = "", r.url = "";
|
|
195
195
|
}, 200);
|
|
196
|
-
}), () => t(
|
|
196
|
+
}), () => t(Bt, {
|
|
197
197
|
title: a.value,
|
|
198
198
|
visible: e.visible,
|
|
199
199
|
onClose: e.onCancel
|
|
200
200
|
}, {
|
|
201
201
|
default: () => {
|
|
202
|
-
var
|
|
202
|
+
var i, h, f, d, s;
|
|
203
203
|
return [t("div", {
|
|
204
204
|
class: `${n}-form-item`
|
|
205
205
|
}, [t("label", {
|
|
206
206
|
class: `${n}-label`,
|
|
207
207
|
for: `link-desc-${l}`
|
|
208
|
-
}, [(
|
|
209
|
-
placeholder: (
|
|
208
|
+
}, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
|
|
209
|
+
placeholder: (h = o.value.linkModalTips) == null ? void 0 : h.descLabelPlaceHolder,
|
|
210
210
|
class: `${n}-input`,
|
|
211
211
|
id: `link-desc-${l}`,
|
|
212
212
|
type: "text",
|
|
213
|
-
value:
|
|
214
|
-
onChange: (
|
|
215
|
-
|
|
213
|
+
value: r.desc,
|
|
214
|
+
onChange: (g) => {
|
|
215
|
+
r.desc = g.target.value;
|
|
216
216
|
},
|
|
217
217
|
autocomplete: "off"
|
|
218
218
|
}, null)]), t("div", {
|
|
@@ -220,14 +220,14 @@ const Al = /* @__PURE__ */ P({
|
|
|
220
220
|
}, [t("label", {
|
|
221
221
|
class: `${n}-label`,
|
|
222
222
|
for: `link-url-${l}`
|
|
223
|
-
}, [(
|
|
224
|
-
placeholder: (
|
|
223
|
+
}, [(f = o.value.linkModalTips) == null ? void 0 : f.urlLabel]), t("input", {
|
|
224
|
+
placeholder: (d = o.value.linkModalTips) == null ? void 0 : d.urlLabelPlaceHolder,
|
|
225
225
|
class: `${n}-input`,
|
|
226
226
|
id: `link-url-${l}`,
|
|
227
227
|
type: "text",
|
|
228
|
-
value:
|
|
229
|
-
onChange: (
|
|
230
|
-
|
|
228
|
+
value: r.url,
|
|
229
|
+
onChange: (g) => {
|
|
230
|
+
r.url = g.target.value;
|
|
231
231
|
},
|
|
232
232
|
autocomplete: "off"
|
|
233
233
|
}, null)]), t("div", {
|
|
@@ -236,13 +236,13 @@ const Al = /* @__PURE__ */ P({
|
|
|
236
236
|
class: [`${n}-btn`, `${n}-btn-row`],
|
|
237
237
|
type: "button",
|
|
238
238
|
onClick: () => {
|
|
239
|
-
e.onOk(
|
|
239
|
+
e.onOk(r), r.desc = "", r.url = "";
|
|
240
240
|
}
|
|
241
241
|
}, [(s = o.value.linkModalTips) == null ? void 0 : s.buttonOK])])];
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
}),
|
|
245
|
+
}), Ol = {
|
|
246
246
|
visible: {
|
|
247
247
|
type: Boolean,
|
|
248
248
|
default: !1
|
|
@@ -257,48 +257,48 @@ const Al = /* @__PURE__ */ P({
|
|
|
257
257
|
default: () => {
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
},
|
|
261
|
-
props:
|
|
260
|
+
}, Vl = /* @__PURE__ */ W({
|
|
261
|
+
props: Ol,
|
|
262
262
|
setup(e) {
|
|
263
|
-
var
|
|
264
|
-
const o =
|
|
265
|
-
let a = (
|
|
266
|
-
const
|
|
263
|
+
var g, p, k;
|
|
264
|
+
const o = I("usedLanguageText"), l = I("editorId");
|
|
265
|
+
let a = (k = (p = (g = J) == null ? void 0 : g.editorExtensions) == null ? void 0 : p.cropper) == null ? void 0 : k.instance;
|
|
266
|
+
const r = P(), i = P(), h = P(), f = G({
|
|
267
267
|
cropperInited: !1,
|
|
268
268
|
imgSelected: !1,
|
|
269
269
|
imgSrc: "",
|
|
270
270
|
// 是否全屏
|
|
271
271
|
isFullscreen: !1
|
|
272
272
|
});
|
|
273
|
-
let
|
|
273
|
+
let d = null;
|
|
274
274
|
H(() => e.visible, () => {
|
|
275
|
-
e.visible && !
|
|
275
|
+
e.visible && !f.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
|
|
276
276
|
if (!a) {
|
|
277
|
-
|
|
277
|
+
b.emit(l, le, {
|
|
278
278
|
name: "Cropper",
|
|
279
279
|
message: "Cropper is undefined"
|
|
280
280
|
});
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
283
|
+
const $ = r.value.files || [];
|
|
284
|
+
if (f.imgSelected = !0, ($ == null ? void 0 : $.length) > 0) {
|
|
285
|
+
const m = new FileReader();
|
|
286
|
+
m.onload = (v) => {
|
|
287
|
+
f.imgSrc = v.target.result, ve(() => {
|
|
288
|
+
d = new a(i.value, {
|
|
289
289
|
viewMode: 2,
|
|
290
290
|
preview: `.${n}-clip-preview-target`
|
|
291
291
|
// aspectRatio: 16 / 9,
|
|
292
292
|
});
|
|
293
293
|
});
|
|
294
|
-
},
|
|
294
|
+
}, m.readAsDataURL($[0]);
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
|
-
}), H(() => [
|
|
298
|
-
|
|
299
|
-
}), H(() =>
|
|
297
|
+
}), H(() => [f.imgSelected], () => {
|
|
298
|
+
h.value.style = "";
|
|
299
|
+
}), H(() => f.isFullscreen, () => {
|
|
300
300
|
ve(() => {
|
|
301
|
-
|
|
301
|
+
d == null || d.destroy(), h.value.style = "", i.value && (d = new a(i.value, {
|
|
302
302
|
viewMode: 2,
|
|
303
303
|
preview: `.${n}-clip-preview-target`
|
|
304
304
|
// aspectRatio: 16 / 9,
|
|
@@ -306,34 +306,34 @@ const Al = /* @__PURE__ */ P({
|
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
const s = () => {
|
|
309
|
-
|
|
309
|
+
d.clear(), d.destroy(), d = null, r.value.value = "", f.imgSelected = !1;
|
|
310
310
|
};
|
|
311
311
|
return () => {
|
|
312
|
-
var
|
|
313
|
-
return t(
|
|
312
|
+
var $;
|
|
313
|
+
return t(Bt, {
|
|
314
314
|
class: `${n}-modal-clip`,
|
|
315
|
-
title: (
|
|
315
|
+
title: ($ = o.value.clipModalTips) == null ? void 0 : $.title,
|
|
316
316
|
visible: e.visible,
|
|
317
317
|
onClose: e.onCancel,
|
|
318
318
|
showAdjust: !0,
|
|
319
|
-
isFullscreen:
|
|
320
|
-
onAdjust: (
|
|
321
|
-
|
|
319
|
+
isFullscreen: f.isFullscreen,
|
|
320
|
+
onAdjust: (m) => {
|
|
321
|
+
f.isFullscreen = m;
|
|
322
322
|
},
|
|
323
323
|
width: "668px",
|
|
324
324
|
height: "421px"
|
|
325
325
|
}, {
|
|
326
326
|
default: () => {
|
|
327
|
-
var
|
|
327
|
+
var m, v;
|
|
328
328
|
return [t("div", {
|
|
329
329
|
class: `${n}-form-item ${n}-clip`
|
|
330
330
|
}, [t("div", {
|
|
331
331
|
class: `${n}-clip-main`
|
|
332
|
-
}, [
|
|
332
|
+
}, [f.imgSelected ? t("div", {
|
|
333
333
|
class: `${n}-clip-cropper`
|
|
334
334
|
}, [t("img", {
|
|
335
|
-
src:
|
|
336
|
-
ref:
|
|
335
|
+
src: f.imgSrc,
|
|
336
|
+
ref: i,
|
|
337
337
|
style: {
|
|
338
338
|
display: "none"
|
|
339
339
|
},
|
|
@@ -341,33 +341,33 @@ const Al = /* @__PURE__ */ P({
|
|
|
341
341
|
}, null), t("div", {
|
|
342
342
|
class: `${n}-clip-delete`,
|
|
343
343
|
onClick: s
|
|
344
|
-
}, [t(
|
|
344
|
+
}, [t(T, {
|
|
345
345
|
name: "delete"
|
|
346
346
|
}, null)])]) : t("div", {
|
|
347
347
|
class: `${n}-clip-upload`,
|
|
348
348
|
onClick: () => {
|
|
349
|
-
|
|
349
|
+
r.value.click();
|
|
350
350
|
}
|
|
351
|
-
}, [t(
|
|
351
|
+
}, [t(T, {
|
|
352
352
|
name: "upload"
|
|
353
353
|
}, null)])]), t("div", {
|
|
354
354
|
class: `${n}-clip-preview`
|
|
355
355
|
}, [t("div", {
|
|
356
356
|
class: `${n}-clip-preview-target`,
|
|
357
|
-
ref:
|
|
357
|
+
ref: h
|
|
358
358
|
}, null)])]), t("div", {
|
|
359
359
|
class: `${n}-form-item`
|
|
360
360
|
}, [t("button", {
|
|
361
361
|
class: `${n}-btn`,
|
|
362
362
|
type: "button",
|
|
363
363
|
onClick: () => {
|
|
364
|
-
if (
|
|
365
|
-
const
|
|
366
|
-
|
|
364
|
+
if (d) {
|
|
365
|
+
const u = d.getCroppedCanvas();
|
|
366
|
+
b.emit(l, xe, [Jt(u.toDataURL("image/png"))], e.onOk), s();
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
}, [((
|
|
370
|
-
ref:
|
|
369
|
+
}, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((v = o.value.linkModalTips) == null ? void 0 : v.buttonOK)])]), t("input", {
|
|
370
|
+
ref: r,
|
|
371
371
|
accept: "image/*",
|
|
372
372
|
type: "file",
|
|
373
373
|
multiple: !1,
|
|
@@ -379,7 +379,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
379
379
|
});
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
|
-
}),
|
|
382
|
+
}), Fl = {
|
|
383
383
|
type: {
|
|
384
384
|
type: String,
|
|
385
385
|
default: "link"
|
|
@@ -402,27 +402,27 @@ const Al = /* @__PURE__ */ P({
|
|
|
402
402
|
default: () => {
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
},
|
|
406
|
-
props:
|
|
405
|
+
}, Rl = /* @__PURE__ */ W({
|
|
406
|
+
props: Fl,
|
|
407
407
|
setup(e) {
|
|
408
|
-
return () => t(
|
|
408
|
+
return () => t(It, null, [t(Bl, {
|
|
409
409
|
type: e.type,
|
|
410
410
|
visible: e.linkVisible,
|
|
411
411
|
onOk: e.onOk,
|
|
412
412
|
onCancel: e.onCancel
|
|
413
|
-
}, null), t(
|
|
413
|
+
}, null), t(Vl, {
|
|
414
414
|
visible: e.clipVisible,
|
|
415
415
|
onOk: e.onOk,
|
|
416
416
|
onCancel: e.onCancel
|
|
417
417
|
}, null)]);
|
|
418
418
|
}
|
|
419
|
-
}),
|
|
419
|
+
}), Pl = /* @__PURE__ */ W({
|
|
420
420
|
name: "MDEditorToolbar",
|
|
421
|
-
props:
|
|
421
|
+
props: Ll,
|
|
422
422
|
setup(e) {
|
|
423
|
-
const o =
|
|
424
|
-
fullscreenHandler:
|
|
425
|
-
} =
|
|
423
|
+
const o = I("editorId"), l = I("usedLanguageText"), a = I("theme"), r = I("language"), {
|
|
424
|
+
fullscreenHandler: i
|
|
425
|
+
} = Il(e), h = `${o}-toolbar-wrapper`, f = P(), d = G({
|
|
426
426
|
title: !1,
|
|
427
427
|
catalog: !1,
|
|
428
428
|
// 图片上传下拉
|
|
@@ -432,48 +432,48 @@ const Al = /* @__PURE__ */ P({
|
|
|
432
432
|
// mermaid
|
|
433
433
|
mermaid: !1,
|
|
434
434
|
katex: !1
|
|
435
|
-
}), s = (
|
|
436
|
-
|
|
437
|
-
},
|
|
435
|
+
}), s = (u, C) => {
|
|
436
|
+
b.emit(o, x, u, C);
|
|
437
|
+
}, g = G({
|
|
438
438
|
type: "link",
|
|
439
439
|
linkVisible: !1,
|
|
440
440
|
clipVisible: !1
|
|
441
|
-
}),
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
}), p = P();
|
|
442
|
+
Q(() => {
|
|
443
|
+
b.on(o, {
|
|
444
444
|
name: Te,
|
|
445
|
-
callback(
|
|
446
|
-
|
|
445
|
+
callback(u) {
|
|
446
|
+
g.type = u, g.linkVisible = !0;
|
|
447
447
|
}
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
|
-
const
|
|
451
|
-
const
|
|
452
|
-
return [
|
|
453
|
-
}),
|
|
454
|
-
|
|
450
|
+
const k = we(() => {
|
|
451
|
+
const u = e.toolbars.filter((M) => !e.toolbarsExclude.includes(M)), C = u.indexOf("="), w = C === -1 ? u : u.slice(0, C + 1), S = C === -1 ? [] : u.slice(C, Number.MAX_SAFE_INTEGER);
|
|
452
|
+
return [w, S];
|
|
453
|
+
}), $ = P(), m = () => {
|
|
454
|
+
b.emit(o, xe, Array.from($.value.files || [])), $.value.value = "";
|
|
455
455
|
};
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
Q(() => {
|
|
457
|
+
$.value.addEventListener("change", m);
|
|
458
458
|
});
|
|
459
|
-
const
|
|
460
|
-
var
|
|
461
|
-
if (
|
|
462
|
-
switch (
|
|
459
|
+
const v = (u) => {
|
|
460
|
+
var C, w, S, M, D, oe, ae, A, L, q, z, O, N, B, V, K, j, me, ne, Y, Z, ie, X, F, R, re, ge, Me, Ae, Le, Ie, De, Ee, He, Ne, Be, Oe, Ve, Fe, Re, Pe, We, ze, qe, Ue, _e, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
|
|
461
|
+
if (qt.includes(u))
|
|
462
|
+
switch (u) {
|
|
463
463
|
case "-":
|
|
464
464
|
return t(Al, null, null);
|
|
465
465
|
case "bold":
|
|
466
466
|
return t("div", {
|
|
467
467
|
class: `${n}-toolbar-item`,
|
|
468
|
-
title: (
|
|
468
|
+
title: (C = l.value.toolbarTips) == null ? void 0 : C.bold,
|
|
469
469
|
onClick: () => {
|
|
470
470
|
s("bold");
|
|
471
471
|
}
|
|
472
|
-
}, [t(
|
|
472
|
+
}, [t(T, {
|
|
473
473
|
name: "bold"
|
|
474
474
|
}, null), e.showToolbarName && t("div", {
|
|
475
475
|
class: `${n}-toolbar-item-name`
|
|
476
|
-
}, [(
|
|
476
|
+
}, [(w = l.value.toolbarTips) == null ? void 0 : w.bold])]);
|
|
477
477
|
case "underline":
|
|
478
478
|
return t("div", {
|
|
479
479
|
class: `${n}-toolbar-item`,
|
|
@@ -481,11 +481,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
481
481
|
onClick: () => {
|
|
482
482
|
s("underline");
|
|
483
483
|
}
|
|
484
|
-
}, [t(
|
|
484
|
+
}, [t(T, {
|
|
485
485
|
name: "underline"
|
|
486
486
|
}, null), e.showToolbarName && t("div", {
|
|
487
487
|
class: `${n}-toolbar-item-name`
|
|
488
|
-
}, [(
|
|
488
|
+
}, [(M = l.value.toolbarTips) == null ? void 0 : M.underline])]);
|
|
489
489
|
case "italic":
|
|
490
490
|
return t("div", {
|
|
491
491
|
class: `${n}-toolbar-item`,
|
|
@@ -493,7 +493,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
493
493
|
onClick: () => {
|
|
494
494
|
s("italic");
|
|
495
495
|
}
|
|
496
|
-
}, [t(
|
|
496
|
+
}, [t(T, {
|
|
497
497
|
name: "italic"
|
|
498
498
|
}, null), e.showToolbarName && t("div", {
|
|
499
499
|
class: `${n}-toolbar-item-name`
|
|
@@ -505,22 +505,22 @@ const Al = /* @__PURE__ */ P({
|
|
|
505
505
|
onClick: () => {
|
|
506
506
|
s("strikeThrough");
|
|
507
507
|
}
|
|
508
|
-
}, [t(
|
|
508
|
+
}, [t(T, {
|
|
509
509
|
name: "strike-through"
|
|
510
510
|
}, null), e.showToolbarName && t("div", {
|
|
511
511
|
class: `${n}-toolbar-item-name`
|
|
512
|
-
}, [(
|
|
512
|
+
}, [(A = l.value.toolbarTips) == null ? void 0 : A.strikeThrough])]);
|
|
513
513
|
case "title":
|
|
514
514
|
return t(se, {
|
|
515
|
-
relative: `#${
|
|
516
|
-
visible:
|
|
517
|
-
onChange: (
|
|
518
|
-
|
|
515
|
+
relative: `#${h}`,
|
|
516
|
+
visible: d.title,
|
|
517
|
+
onChange: (y) => {
|
|
518
|
+
d.title = y;
|
|
519
519
|
},
|
|
520
520
|
overlay: t("ul", {
|
|
521
521
|
class: `${n}-menu`,
|
|
522
522
|
onClick: () => {
|
|
523
|
-
|
|
523
|
+
d.title = !1;
|
|
524
524
|
}
|
|
525
525
|
}, [t("li", {
|
|
526
526
|
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
@@ -532,12 +532,12 @@ const Al = /* @__PURE__ */ P({
|
|
|
532
532
|
onClick: () => {
|
|
533
533
|
s("h2");
|
|
534
534
|
}
|
|
535
|
-
}, [(
|
|
535
|
+
}, [(q = l.value.titleItem) == null ? void 0 : q.h2]), t("li", {
|
|
536
536
|
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
537
537
|
onClick: () => {
|
|
538
538
|
s("h3");
|
|
539
539
|
}
|
|
540
|
-
}, [(
|
|
540
|
+
}, [(z = l.value.titleItem) == null ? void 0 : z.h3]), t("li", {
|
|
541
541
|
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
542
542
|
onClick: () => {
|
|
543
543
|
s("h4");
|
|
@@ -555,11 +555,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
555
555
|
}, [(B = l.value.titleItem) == null ? void 0 : B.h6])])
|
|
556
556
|
}, {
|
|
557
557
|
default: () => {
|
|
558
|
-
var
|
|
558
|
+
var y, E;
|
|
559
559
|
return [t("div", {
|
|
560
560
|
class: `${n}-toolbar-item`,
|
|
561
|
-
title: (
|
|
562
|
-
}, [t(
|
|
561
|
+
title: (y = l.value.toolbarTips) == null ? void 0 : y.title
|
|
562
|
+
}, [t(T, {
|
|
563
563
|
name: "title"
|
|
564
564
|
}, null), e.showToolbarName && t("div", {
|
|
565
565
|
class: `${n}-toolbar-item-name`
|
|
@@ -573,7 +573,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
573
573
|
onClick: () => {
|
|
574
574
|
s("sub");
|
|
575
575
|
}
|
|
576
|
-
}, [t(
|
|
576
|
+
}, [t(T, {
|
|
577
577
|
name: "sub"
|
|
578
578
|
}, null), e.showToolbarName && t("div", {
|
|
579
579
|
class: `${n}-toolbar-item-name`
|
|
@@ -585,11 +585,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
585
585
|
onClick: () => {
|
|
586
586
|
s("sup");
|
|
587
587
|
}
|
|
588
|
-
}, [t(
|
|
588
|
+
}, [t(T, {
|
|
589
589
|
name: "sup"
|
|
590
590
|
}, null), e.showToolbarName && t("div", {
|
|
591
591
|
class: `${n}-toolbar-item-name`
|
|
592
|
-
}, [(
|
|
592
|
+
}, [(me = l.value.toolbarTips) == null ? void 0 : me.sup])]);
|
|
593
593
|
case "quote":
|
|
594
594
|
return t("div", {
|
|
595
595
|
class: `${n}-toolbar-item`,
|
|
@@ -597,11 +597,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
597
597
|
onClick: () => {
|
|
598
598
|
s("quote");
|
|
599
599
|
}
|
|
600
|
-
}, [t(
|
|
600
|
+
}, [t(T, {
|
|
601
601
|
name: "quote"
|
|
602
602
|
}, null), e.showToolbarName && t("div", {
|
|
603
603
|
class: `${n}-toolbar-item-name`
|
|
604
|
-
}, [(
|
|
604
|
+
}, [(Y = l.value.toolbarTips) == null ? void 0 : Y.quote])]);
|
|
605
605
|
case "unorderedList":
|
|
606
606
|
return t("div", {
|
|
607
607
|
class: `${n}-toolbar-item`,
|
|
@@ -609,7 +609,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
609
609
|
onClick: () => {
|
|
610
610
|
s("unorderedList");
|
|
611
611
|
}
|
|
612
|
-
}, [t(
|
|
612
|
+
}, [t(T, {
|
|
613
613
|
name: "unordered-list"
|
|
614
614
|
}, null), e.showToolbarName && t("div", {
|
|
615
615
|
class: `${n}-toolbar-item-name`
|
|
@@ -621,7 +621,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
621
621
|
onClick: () => {
|
|
622
622
|
s("orderedList");
|
|
623
623
|
}
|
|
624
|
-
}, [t(
|
|
624
|
+
}, [t(T, {
|
|
625
625
|
name: "ordered-list"
|
|
626
626
|
}, null), e.showToolbarName && t("div", {
|
|
627
627
|
class: `${n}-toolbar-item-name`
|
|
@@ -633,7 +633,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
633
633
|
onClick: () => {
|
|
634
634
|
s("task");
|
|
635
635
|
}
|
|
636
|
-
}, [t(
|
|
636
|
+
}, [t(T, {
|
|
637
637
|
name: "task"
|
|
638
638
|
}, null), e.showToolbarName && t("div", {
|
|
639
639
|
class: `${n}-toolbar-item-name`
|
|
@@ -641,23 +641,23 @@ const Al = /* @__PURE__ */ P({
|
|
|
641
641
|
case "codeRow":
|
|
642
642
|
return t("div", {
|
|
643
643
|
class: `${n}-toolbar-item`,
|
|
644
|
-
title: (
|
|
644
|
+
title: (ge = l.value.toolbarTips) == null ? void 0 : ge.codeRow,
|
|
645
645
|
onClick: () => {
|
|
646
646
|
s("codeRow");
|
|
647
647
|
}
|
|
648
|
-
}, [t(
|
|
648
|
+
}, [t(T, {
|
|
649
649
|
name: "code-row"
|
|
650
650
|
}, null), e.showToolbarName && t("div", {
|
|
651
651
|
class: `${n}-toolbar-item-name`
|
|
652
|
-
}, [(
|
|
652
|
+
}, [(Me = l.value.toolbarTips) == null ? void 0 : Me.codeRow])]);
|
|
653
653
|
case "code":
|
|
654
654
|
return t("div", {
|
|
655
655
|
class: `${n}-toolbar-item`,
|
|
656
|
-
title: (
|
|
656
|
+
title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
|
|
657
657
|
onClick: () => {
|
|
658
658
|
s("code");
|
|
659
659
|
}
|
|
660
|
-
}, [t(
|
|
660
|
+
}, [t(T, {
|
|
661
661
|
name: "code"
|
|
662
662
|
}, null), e.showToolbarName && t("div", {
|
|
663
663
|
class: `${n}-toolbar-item-name`
|
|
@@ -667,9 +667,9 @@ const Al = /* @__PURE__ */ P({
|
|
|
667
667
|
class: `${n}-toolbar-item`,
|
|
668
668
|
title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.link,
|
|
669
669
|
onClick: () => {
|
|
670
|
-
|
|
670
|
+
g.type = "link", g.linkVisible = !0;
|
|
671
671
|
}
|
|
672
|
-
}, [t(
|
|
672
|
+
}, [t(T, {
|
|
673
673
|
name: "link"
|
|
674
674
|
}, null), e.showToolbarName && t("div", {
|
|
675
675
|
class: `${n}-toolbar-item-name`
|
|
@@ -679,46 +679,46 @@ const Al = /* @__PURE__ */ P({
|
|
|
679
679
|
class: `${n}-toolbar-item`,
|
|
680
680
|
title: (Ee = l.value.toolbarTips) == null ? void 0 : Ee.image,
|
|
681
681
|
onClick: () => {
|
|
682
|
-
|
|
682
|
+
g.type = "image", g.linkVisible = !0;
|
|
683
683
|
}
|
|
684
|
-
}, [t(
|
|
684
|
+
}, [t(T, {
|
|
685
685
|
name: "image"
|
|
686
686
|
}, null), e.showToolbarName && t("div", {
|
|
687
687
|
class: `${n}-toolbar-item-name`
|
|
688
688
|
}, [(He = l.value.toolbarTips) == null ? void 0 : He.image])]) : t(se, {
|
|
689
|
-
relative: `#${
|
|
690
|
-
visible:
|
|
691
|
-
onChange: (
|
|
692
|
-
|
|
689
|
+
relative: `#${h}`,
|
|
690
|
+
visible: d.image,
|
|
691
|
+
onChange: (y) => {
|
|
692
|
+
d.image = y;
|
|
693
693
|
},
|
|
694
694
|
overlay: t("ul", {
|
|
695
695
|
class: `${n}-menu`,
|
|
696
696
|
onClick: () => {
|
|
697
|
-
|
|
697
|
+
d.title = !1;
|
|
698
698
|
}
|
|
699
699
|
}, [t("li", {
|
|
700
700
|
class: `${n}-menu-item ${n}-menu-item-image`,
|
|
701
701
|
onClick: () => {
|
|
702
|
-
|
|
702
|
+
g.type = "image", g.linkVisible = !0;
|
|
703
703
|
}
|
|
704
704
|
}, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.link]), t("li", {
|
|
705
705
|
class: `${n}-menu-item ${n}-menu-item-image`,
|
|
706
706
|
onClick: () => {
|
|
707
|
-
|
|
707
|
+
$.value.click();
|
|
708
708
|
}
|
|
709
709
|
}, [(Be = l.value.imgTitleItem) == null ? void 0 : Be.upload]), t("li", {
|
|
710
710
|
class: `${n}-menu-item ${n}-menu-item-image`,
|
|
711
711
|
onClick: () => {
|
|
712
|
-
|
|
712
|
+
g.clipVisible = !0;
|
|
713
713
|
}
|
|
714
714
|
}, [(Oe = l.value.imgTitleItem) == null ? void 0 : Oe.clip2upload])])
|
|
715
715
|
}, {
|
|
716
716
|
default: () => {
|
|
717
|
-
var
|
|
717
|
+
var y, E;
|
|
718
718
|
return [t("div", {
|
|
719
719
|
class: `${n}-toolbar-item`,
|
|
720
|
-
title: (
|
|
721
|
-
}, [t(
|
|
720
|
+
title: (y = l.value.toolbarTips) == null ? void 0 : y.image
|
|
721
|
+
}, [t(T, {
|
|
722
722
|
name: "image"
|
|
723
723
|
}, null), e.showToolbarName && t("div", {
|
|
724
724
|
class: `${n}-toolbar-item-name`
|
|
@@ -727,27 +727,27 @@ const Al = /* @__PURE__ */ P({
|
|
|
727
727
|
});
|
|
728
728
|
case "table":
|
|
729
729
|
return t(se, {
|
|
730
|
-
relative: `#${
|
|
731
|
-
visible:
|
|
732
|
-
onChange: (
|
|
733
|
-
|
|
730
|
+
relative: `#${h}`,
|
|
731
|
+
visible: d.table,
|
|
732
|
+
onChange: (y) => {
|
|
733
|
+
d.table = y;
|
|
734
734
|
},
|
|
735
735
|
key: "bar-table",
|
|
736
|
-
overlay: t(
|
|
736
|
+
overlay: t(Hl, {
|
|
737
737
|
tableShape: e.tableShape,
|
|
738
|
-
onSelected: (
|
|
738
|
+
onSelected: (y) => {
|
|
739
739
|
s("table", {
|
|
740
|
-
selectedShape:
|
|
740
|
+
selectedShape: y
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
743
|
}, null)
|
|
744
744
|
}, {
|
|
745
745
|
default: () => {
|
|
746
|
-
var
|
|
746
|
+
var y, E;
|
|
747
747
|
return [t("div", {
|
|
748
748
|
class: `${n}-toolbar-item`,
|
|
749
|
-
title: (
|
|
750
|
-
}, [t(
|
|
749
|
+
title: (y = l.value.toolbarTips) == null ? void 0 : y.table
|
|
750
|
+
}, [t(T, {
|
|
751
751
|
name: "table"
|
|
752
752
|
}, null), e.showToolbarName && t("div", {
|
|
753
753
|
class: `${n}-toolbar-item-name`
|
|
@@ -759,9 +759,9 @@ const Al = /* @__PURE__ */ P({
|
|
|
759
759
|
class: `${n}-toolbar-item`,
|
|
760
760
|
title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.revoke,
|
|
761
761
|
onClick: () => {
|
|
762
|
-
|
|
762
|
+
b.emit(o, Nt);
|
|
763
763
|
}
|
|
764
|
-
}, [t(
|
|
764
|
+
}, [t(T, {
|
|
765
765
|
name: "revoke"
|
|
766
766
|
}, null), e.showToolbarName && t("div", {
|
|
767
767
|
class: `${n}-toolbar-item-name`
|
|
@@ -771,9 +771,9 @@ const Al = /* @__PURE__ */ P({
|
|
|
771
771
|
class: `${n}-toolbar-item`,
|
|
772
772
|
title: (Re = l.value.toolbarTips) == null ? void 0 : Re.next,
|
|
773
773
|
onClick: () => {
|
|
774
|
-
|
|
774
|
+
b.emit(o, Ht);
|
|
775
775
|
}
|
|
776
|
-
}, [t(
|
|
776
|
+
}, [t(T, {
|
|
777
777
|
name: "next"
|
|
778
778
|
}, null), e.showToolbarName && t("div", {
|
|
779
779
|
class: `${n}-toolbar-item-name`
|
|
@@ -783,9 +783,9 @@ const Al = /* @__PURE__ */ P({
|
|
|
783
783
|
class: `${n}-toolbar-item`,
|
|
784
784
|
title: (We = l.value.toolbarTips) == null ? void 0 : We.save,
|
|
785
785
|
onClick: () => {
|
|
786
|
-
|
|
786
|
+
b.emit(o, Et);
|
|
787
787
|
}
|
|
788
|
-
}, [t(
|
|
788
|
+
}, [t(T, {
|
|
789
789
|
name: "baocun"
|
|
790
790
|
}, null), e.showToolbarName && t("div", {
|
|
791
791
|
class: `${n}-toolbar-item-name`
|
|
@@ -793,23 +793,23 @@ const Al = /* @__PURE__ */ P({
|
|
|
793
793
|
case "prettier":
|
|
794
794
|
return e.noPrettier ? "" : t("div", {
|
|
795
795
|
class: `${n}-toolbar-item`,
|
|
796
|
-
title: (
|
|
796
|
+
title: (qe = l.value.toolbarTips) == null ? void 0 : qe.prettier,
|
|
797
797
|
onClick: () => {
|
|
798
798
|
s("prettier");
|
|
799
799
|
}
|
|
800
|
-
}, [t(
|
|
800
|
+
}, [t(T, {
|
|
801
801
|
name: "prettier"
|
|
802
802
|
}, null), e.showToolbarName && t("div", {
|
|
803
803
|
class: `${n}-toolbar-item-name`
|
|
804
|
-
}, [(
|
|
804
|
+
}, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier])]);
|
|
805
805
|
case "pageFullscreen":
|
|
806
806
|
return !e.setting.fullscreen && t("div", {
|
|
807
807
|
class: `${n}-toolbar-item`,
|
|
808
|
-
title: (
|
|
808
|
+
title: (_e = l.value.toolbarTips) == null ? void 0 : _e.pageFullscreen,
|
|
809
809
|
onClick: () => {
|
|
810
810
|
e.updateSetting("pageFullscreen");
|
|
811
811
|
}
|
|
812
|
-
}, [t(
|
|
812
|
+
}, [t(T, {
|
|
813
813
|
name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
|
|
814
814
|
}, null), e.showToolbarName && t("div", {
|
|
815
815
|
class: `${n}-toolbar-item-name`
|
|
@@ -819,9 +819,9 @@ const Al = /* @__PURE__ */ P({
|
|
|
819
819
|
class: `${n}-toolbar-item`,
|
|
820
820
|
title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen,
|
|
821
821
|
onClick: () => {
|
|
822
|
-
|
|
822
|
+
i();
|
|
823
823
|
}
|
|
824
|
-
}, [t(
|
|
824
|
+
}, [t(T, {
|
|
825
825
|
name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
|
|
826
826
|
}, null), e.showToolbarName && t("div", {
|
|
827
827
|
class: `${n}-toolbar-item-name`
|
|
@@ -833,7 +833,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
833
833
|
onClick: () => {
|
|
834
834
|
e.updateSetting("preview");
|
|
835
835
|
}
|
|
836
|
-
}, [t(
|
|
836
|
+
}, [t(T, {
|
|
837
837
|
name: "preview"
|
|
838
838
|
}, null), e.showToolbarName && t("div", {
|
|
839
839
|
class: `${n}-toolbar-item-name`
|
|
@@ -845,7 +845,7 @@ const Al = /* @__PURE__ */ P({
|
|
|
845
845
|
onClick: () => {
|
|
846
846
|
e.updateSetting("htmlPreview");
|
|
847
847
|
}
|
|
848
|
-
}, [t(
|
|
848
|
+
}, [t(T, {
|
|
849
849
|
name: "coding"
|
|
850
850
|
}, null), e.showToolbarName && t("div", {
|
|
851
851
|
class: `${n}-toolbar-item-name`
|
|
@@ -855,10 +855,10 @@ const Al = /* @__PURE__ */ P({
|
|
|
855
855
|
class: `${n}-toolbar-item`,
|
|
856
856
|
title: (Qe = l.value.toolbarTips) == null ? void 0 : Qe.catalog,
|
|
857
857
|
onClick: () => {
|
|
858
|
-
|
|
858
|
+
b.emit(o, Qt);
|
|
859
859
|
},
|
|
860
860
|
key: "bar-catalog"
|
|
861
|
-
}, [t(
|
|
861
|
+
}, [t(T, {
|
|
862
862
|
name: "catalog"
|
|
863
863
|
}, null), e.showToolbarName && t("div", {
|
|
864
864
|
class: `${n}-toolbar-item-name`
|
|
@@ -867,23 +867,23 @@ const Al = /* @__PURE__ */ P({
|
|
|
867
867
|
return t("div", {
|
|
868
868
|
class: `${n}-toolbar-item`,
|
|
869
869
|
title: (tt = l.value.toolbarTips) == null ? void 0 : tt.github,
|
|
870
|
-
onClick: () =>
|
|
871
|
-
}, [t(
|
|
870
|
+
onClick: () => Gt("https://github.com/imzbf/md-editor-v3")
|
|
871
|
+
}, [t(T, {
|
|
872
872
|
name: "github"
|
|
873
873
|
}, null), e.showToolbarName && t("div", {
|
|
874
874
|
class: `${n}-toolbar-item-name`
|
|
875
875
|
}, [(lt = l.value.toolbarTips) == null ? void 0 : lt.github])]);
|
|
876
876
|
case "mermaid":
|
|
877
877
|
return t(se, {
|
|
878
|
-
relative: `#${
|
|
879
|
-
visible:
|
|
880
|
-
onChange: (
|
|
881
|
-
|
|
878
|
+
relative: `#${h}`,
|
|
879
|
+
visible: d.mermaid,
|
|
880
|
+
onChange: (y) => {
|
|
881
|
+
d.mermaid = y;
|
|
882
882
|
},
|
|
883
883
|
overlay: t("ul", {
|
|
884
884
|
class: `${n}-menu`,
|
|
885
885
|
onClick: () => {
|
|
886
|
-
|
|
886
|
+
d.mermaid = !1;
|
|
887
887
|
}
|
|
888
888
|
}, [t("li", {
|
|
889
889
|
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
@@ -929,11 +929,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
929
929
|
key: "bar-mermaid"
|
|
930
930
|
}, {
|
|
931
931
|
default: () => {
|
|
932
|
-
var
|
|
932
|
+
var y, E;
|
|
933
933
|
return [t("div", {
|
|
934
934
|
class: `${n}-toolbar-item`,
|
|
935
|
-
title: (
|
|
936
|
-
}, [t(
|
|
935
|
+
title: (y = l.value.toolbarTips) == null ? void 0 : y.mermaid
|
|
936
|
+
}, [t(T, {
|
|
937
937
|
name: "mermaid"
|
|
938
938
|
}, null), e.showToolbarName && t("div", {
|
|
939
939
|
class: `${n}-toolbar-item-name`
|
|
@@ -942,15 +942,15 @@ const Al = /* @__PURE__ */ P({
|
|
|
942
942
|
});
|
|
943
943
|
case "katex":
|
|
944
944
|
return t(se, {
|
|
945
|
-
relative: `#${
|
|
946
|
-
visible:
|
|
947
|
-
onChange: (
|
|
948
|
-
|
|
945
|
+
relative: `#${h}`,
|
|
946
|
+
visible: d.katex,
|
|
947
|
+
onChange: (y) => {
|
|
948
|
+
d.katex = y;
|
|
949
949
|
},
|
|
950
950
|
overlay: t("ul", {
|
|
951
951
|
class: `${n}-menu`,
|
|
952
952
|
onClick: () => {
|
|
953
|
-
|
|
953
|
+
d.katex = !1;
|
|
954
954
|
}
|
|
955
955
|
}, [t("li", {
|
|
956
956
|
class: `${n}-menu-item ${n}-menu-item-katex`,
|
|
@@ -966,11 +966,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
966
966
|
key: "bar-katex"
|
|
967
967
|
}, {
|
|
968
968
|
default: () => {
|
|
969
|
-
var
|
|
969
|
+
var y, E;
|
|
970
970
|
return [t("div", {
|
|
971
971
|
class: `${n}-toolbar-item`,
|
|
972
|
-
title: (
|
|
973
|
-
}, [t(
|
|
972
|
+
title: (y = l.value.toolbarTips) == null ? void 0 : y.katex
|
|
973
|
+
}, [t(T, {
|
|
974
974
|
name: "formula"
|
|
975
975
|
}, null), e.showToolbarName && t("div", {
|
|
976
976
|
class: `${n}-toolbar-item-name`
|
|
@@ -979,23 +979,23 @@ const Al = /* @__PURE__ */ P({
|
|
|
979
979
|
});
|
|
980
980
|
}
|
|
981
981
|
else if (e.defToolbars instanceof Array) {
|
|
982
|
-
const
|
|
983
|
-
return
|
|
982
|
+
const y = e.defToolbars[u];
|
|
983
|
+
return y ? gt(y, {
|
|
984
984
|
theme: a.value,
|
|
985
|
-
language:
|
|
985
|
+
language: r.value,
|
|
986
986
|
insert(ke) {
|
|
987
|
-
|
|
987
|
+
b.emit(o, x, "universal", {
|
|
988
988
|
generate: ke
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
991
|
}) : "";
|
|
992
992
|
} else if (e.defToolbars && e.defToolbars.children instanceof Array) {
|
|
993
|
-
const
|
|
994
|
-
return
|
|
993
|
+
const y = e.defToolbars.children[u];
|
|
994
|
+
return y ? gt(y, {
|
|
995
995
|
theme: a.value,
|
|
996
|
-
language:
|
|
996
|
+
language: r.value,
|
|
997
997
|
insert(ke) {
|
|
998
|
-
|
|
998
|
+
b.emit(o, x, "universal", {
|
|
999
999
|
generate: ke
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
@@ -1005,53 +1005,53 @@ const Al = /* @__PURE__ */ P({
|
|
|
1005
1005
|
};
|
|
1006
1006
|
return H(() => e.toolbars, () => {
|
|
1007
1007
|
ve(() => {
|
|
1008
|
-
|
|
1008
|
+
f.value && _t(f.value);
|
|
1009
1009
|
});
|
|
1010
1010
|
}, {
|
|
1011
1011
|
immediate: !0
|
|
1012
1012
|
}), () => {
|
|
1013
|
-
const
|
|
1014
|
-
return t(
|
|
1013
|
+
const u = k.value[0].map((w) => v(w)), C = k.value[1].map((w) => v(w));
|
|
1014
|
+
return t(It, null, [e.toolbars.length > 0 && t("div", {
|
|
1015
1015
|
class: `${n}-toolbar-wrapper`,
|
|
1016
|
-
ref:
|
|
1017
|
-
id:
|
|
1016
|
+
ref: f,
|
|
1017
|
+
id: h
|
|
1018
1018
|
}, [t("div", {
|
|
1019
1019
|
class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
|
|
1020
1020
|
}, [t("div", {
|
|
1021
1021
|
class: `${n}-toolbar-left`,
|
|
1022
|
-
ref:
|
|
1023
|
-
}, [
|
|
1022
|
+
ref: p
|
|
1023
|
+
}, [u]), t("div", {
|
|
1024
1024
|
class: `${n}-toolbar-right`
|
|
1025
|
-
}, [
|
|
1026
|
-
ref:
|
|
1025
|
+
}, [C])])]), t("input", {
|
|
1026
|
+
ref: $,
|
|
1027
1027
|
accept: "image/*",
|
|
1028
1028
|
type: "file",
|
|
1029
1029
|
multiple: !0,
|
|
1030
1030
|
style: {
|
|
1031
1031
|
display: "none"
|
|
1032
1032
|
}
|
|
1033
|
-
}, null), t(
|
|
1034
|
-
linkVisible:
|
|
1035
|
-
clipVisible:
|
|
1036
|
-
type:
|
|
1033
|
+
}, null), t(Rl, {
|
|
1034
|
+
linkVisible: g.linkVisible,
|
|
1035
|
+
clipVisible: g.clipVisible,
|
|
1036
|
+
type: g.type,
|
|
1037
1037
|
onCancel: () => {
|
|
1038
|
-
|
|
1038
|
+
g.linkVisible = !1, g.clipVisible = !1;
|
|
1039
1039
|
},
|
|
1040
|
-
onOk: (
|
|
1041
|
-
|
|
1042
|
-
desc:
|
|
1043
|
-
url:
|
|
1044
|
-
}),
|
|
1040
|
+
onOk: (w) => {
|
|
1041
|
+
w && s(g.type, {
|
|
1042
|
+
desc: w.desc,
|
|
1043
|
+
url: w.url
|
|
1044
|
+
}), g.linkVisible = !1, g.clipVisible = !1;
|
|
1045
1045
|
}
|
|
1046
1046
|
}, null)]);
|
|
1047
1047
|
};
|
|
1048
1048
|
}
|
|
1049
|
-
}),
|
|
1050
|
-
const l =
|
|
1049
|
+
}), Wl = (e, o) => {
|
|
1050
|
+
const l = Kt(() => {
|
|
1051
1051
|
e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
|
|
1052
|
-
}, 50), a = (
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1052
|
+
}, 50), a = (r) => {
|
|
1053
|
+
const i = e.clientHeight, h = o.clientHeight, f = e.scrollHeight, d = o.scrollHeight, s = (f - i) / (d - h);
|
|
1054
|
+
r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
|
|
1055
1055
|
top: e.scrollTop / s
|
|
1056
1056
|
// behavior: 'smooth'
|
|
1057
1057
|
}), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
|
|
@@ -1069,67 +1069,67 @@ const Al = /* @__PURE__ */ P({
|
|
|
1069
1069
|
e.removeEventListener("scroll", a), o.removeEventListener("scroll", a);
|
|
1070
1070
|
}
|
|
1071
1071
|
];
|
|
1072
|
-
},
|
|
1073
|
-
const { view: a } = l,
|
|
1074
|
-
let
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
const
|
|
1078
|
-
(
|
|
1079
|
-
), { lines:
|
|
1080
|
-
let
|
|
1081
|
-
for (let
|
|
1082
|
-
|
|
1083
|
-
start:
|
|
1084
|
-
end:
|
|
1072
|
+
}, zl = (e, o, l) => {
|
|
1073
|
+
const { view: a } = l, r = jt(), i = (k) => a.lineBlockAt(a.state.doc.line(k).from).top, h = (k) => a.lineBlockAt(a.state.doc.line(k).from).height;
|
|
1074
|
+
let f = [];
|
|
1075
|
+
const d = () => {
|
|
1076
|
+
f = [];
|
|
1077
|
+
const k = Array.from(o.querySelectorAll("[data-line]")).map(
|
|
1078
|
+
(u) => Number(u.dataset.line) + 1
|
|
1079
|
+
), { lines: $ } = a.state.doc;
|
|
1080
|
+
let m = 1, v = k.shift() ?? $;
|
|
1081
|
+
for (let u = 1; u <= $; u++)
|
|
1082
|
+
u === v && (m = u, v = k.shift() || $ + 1), f.push({
|
|
1083
|
+
start: m,
|
|
1084
|
+
end: v - 1
|
|
1085
1085
|
});
|
|
1086
1086
|
};
|
|
1087
|
-
let s = 0,
|
|
1088
|
-
const
|
|
1089
|
-
var
|
|
1090
|
-
if (!((
|
|
1087
|
+
let s = 0, g = 0;
|
|
1088
|
+
const p = Zt((k) => {
|
|
1089
|
+
var C, w, S, M, D, oe, ae;
|
|
1090
|
+
if (!((C = o.firstElementChild) != null && C.firstElementChild))
|
|
1091
1091
|
return;
|
|
1092
|
-
const
|
|
1093
|
-
if (
|
|
1092
|
+
const $ = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: m } = a.state.doc.lineAt($.from);
|
|
1093
|
+
if (m > f.length || a.state.doc.lines < f[f.length - 1].end)
|
|
1094
1094
|
return;
|
|
1095
|
-
let
|
|
1096
|
-
const
|
|
1097
|
-
if (
|
|
1098
|
-
if (
|
|
1095
|
+
let v = +getComputedStyle(o).paddingTop.replace("px", "");
|
|
1096
|
+
const u = +getComputedStyle(o).paddingBottom.replace("px", "");
|
|
1097
|
+
if (k.target === e) {
|
|
1098
|
+
if (g !== 0)
|
|
1099
1099
|
return;
|
|
1100
1100
|
s++;
|
|
1101
|
-
const
|
|
1102
|
-
let L =
|
|
1103
|
-
const
|
|
1101
|
+
const A = f[m - 1];
|
|
1102
|
+
let L = i(A.end) + h(A.end), q = 0;
|
|
1103
|
+
const z = i(A.start), O = o.querySelector(`[data-line="${A.start - 1}"]`) || ((w = o.firstElementChild) == null ? void 0 : w.firstElementChild), N = o.querySelector(`[data-line="${A.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
|
|
1104
1104
|
let B = 0, V = 0;
|
|
1105
|
-
|
|
1106
|
-
const K = V -
|
|
1107
|
-
|
|
1105
|
+
z === 0 ? O === N ? (v = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, q = a.scrollDOM.scrollTop / L, B = N.offsetTop + N.offsetHeight - o.clientHeight) : (q = a.scrollDOM.scrollTop / L, B = N.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (q = (a.scrollDOM.scrollTop - z) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - z), V = O.offsetTop, B = o.scrollHeight - o.clientHeight - V + 10) : (q = (a.scrollDOM.scrollTop - z) / (L - z), V = O.offsetTop, B = N.offsetTop - V);
|
|
1106
|
+
const K = V - v + B * q;
|
|
1107
|
+
r(o, K, () => {
|
|
1108
1108
|
s--;
|
|
1109
1109
|
});
|
|
1110
1110
|
} else {
|
|
1111
1111
|
if (s !== 0)
|
|
1112
1112
|
return;
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1113
|
+
g++;
|
|
1114
|
+
const A = Array.from(
|
|
1115
1115
|
o.querySelectorAll("[data-line]")
|
|
1116
|
-
), L = o.scrollTop,
|
|
1117
|
-
let
|
|
1118
|
-
Number(
|
|
1119
|
-
), O = (
|
|
1120
|
-
for (let F =
|
|
1116
|
+
), L = o.scrollTop, q = o.scrollHeight;
|
|
1117
|
+
let z = A.length === 0 ? 1 : Math.ceil(
|
|
1118
|
+
Number(A[A.length - 1].dataset.line) * (L / q)
|
|
1119
|
+
), O = (M = o.firstElementChild) == null ? void 0 : M.firstElementChild;
|
|
1120
|
+
for (let F = z; F >= 0; F--) {
|
|
1121
1121
|
const R = o.querySelector(`[data-line="${F}"]`);
|
|
1122
1122
|
if (R && R.offsetTop <= L) {
|
|
1123
|
-
O = R,
|
|
1123
|
+
O = R, z = F;
|
|
1124
1124
|
break;
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
let N = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild, B = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
|
|
1128
|
-
for (;
|
|
1129
|
-
const F =
|
|
1130
|
-
if (F + 1 >=
|
|
1128
|
+
for (; A.length > 0; ) {
|
|
1129
|
+
const F = A.indexOf(O);
|
|
1130
|
+
if (F + 1 >= A.length)
|
|
1131
1131
|
break;
|
|
1132
|
-
const R =
|
|
1132
|
+
const R = A[F + 1];
|
|
1133
1133
|
if (F === -1) {
|
|
1134
1134
|
B = R;
|
|
1135
1135
|
break;
|
|
@@ -1140,11 +1140,11 @@ const Al = /* @__PURE__ */ P({
|
|
|
1140
1140
|
N = O, B = R;
|
|
1141
1141
|
break;
|
|
1142
1142
|
}
|
|
1143
|
-
O =
|
|
1143
|
+
O = A[F - 1];
|
|
1144
1144
|
continue;
|
|
1145
1145
|
}
|
|
1146
|
-
const
|
|
1147
|
-
if (re <= L &&
|
|
1146
|
+
const ge = R.offsetTop;
|
|
1147
|
+
if (re <= L && ge > L) {
|
|
1148
1148
|
N = O, B = R;
|
|
1149
1149
|
break;
|
|
1150
1150
|
}
|
|
@@ -1152,48 +1152,48 @@ const Al = /* @__PURE__ */ P({
|
|
|
1152
1152
|
}
|
|
1153
1153
|
const V = N.offsetTop;
|
|
1154
1154
|
let K = B.offsetTop, j = 0;
|
|
1155
|
-
const { start:
|
|
1156
|
-
let Z =
|
|
1157
|
-
const ie =
|
|
1155
|
+
const { start: me, end: ne } = f[Number(N.dataset.line || 0)], Y = i(me);
|
|
1156
|
+
let Z = i(ne);
|
|
1157
|
+
const ie = h(ne);
|
|
1158
1158
|
let X = 0;
|
|
1159
|
-
N === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (N === B ? (K = B.offsetHeight - o.offsetHeight +
|
|
1159
|
+
N === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (N === B ? (K = B.offsetHeight - o.offsetHeight + v + u, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + ie - Y, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
|
|
1160
1160
|
(L - V) / (o.scrollHeight - V - o.clientHeight),
|
|
1161
1161
|
0
|
|
1162
|
-
), Z =
|
|
1162
|
+
), Z = i(a.state.doc.lines) + h(a.state.doc.lines), X = 8 + Z - Y - e.clientHeight) : (j = Math.max(
|
|
1163
1163
|
(L - V) / (K - V),
|
|
1164
1164
|
0
|
|
1165
|
-
), X = Z + ie -
|
|
1166
|
-
|
|
1165
|
+
), X = Z + ie - Y), r(e, Y + X * j, () => {
|
|
1166
|
+
g--;
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
1169
|
}, 10);
|
|
1170
1170
|
return [
|
|
1171
1171
|
() => {
|
|
1172
|
-
|
|
1172
|
+
d(), e.addEventListener("scroll", p), o.addEventListener("scroll", p), e.dispatchEvent(new Event("scroll"));
|
|
1173
1173
|
},
|
|
1174
1174
|
() => {
|
|
1175
|
-
|
|
1175
|
+
f = [], e.removeEventListener("scroll", p), o.removeEventListener("scroll", p);
|
|
1176
1176
|
}
|
|
1177
1177
|
];
|
|
1178
|
-
},
|
|
1179
|
-
const a =
|
|
1180
|
-
let
|
|
1181
|
-
},
|
|
1178
|
+
}, ql = (e, o, l) => {
|
|
1179
|
+
const a = I("editorId");
|
|
1180
|
+
let r = () => {
|
|
1181
|
+
}, i = () => {
|
|
1182
1182
|
};
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
const
|
|
1183
|
+
const h = () => {
|
|
1184
|
+
r();
|
|
1185
|
+
const f = document.querySelector(
|
|
1186
1186
|
`#${a} .cm-scroller`
|
|
1187
|
-
),
|
|
1187
|
+
), d = document.querySelector(
|
|
1188
1188
|
`[id="${a}-preview-wrapper"][data-show="true"]`
|
|
1189
1189
|
), s = document.querySelector(
|
|
1190
1190
|
`[id="${a}-html-wrapper"][data-show="true"]`
|
|
1191
1191
|
);
|
|
1192
|
-
(
|
|
1193
|
-
|
|
1194
|
-
|
|
1192
|
+
(d || s) && ([i, r] = (d ? zl : Wl)(
|
|
1193
|
+
f,
|
|
1194
|
+
d || s,
|
|
1195
1195
|
l.value
|
|
1196
|
-
)), e.scrollAuto &&
|
|
1196
|
+
)), e.scrollAuto && i();
|
|
1197
1197
|
};
|
|
1198
1198
|
H(
|
|
1199
1199
|
[
|
|
@@ -1204,114 +1204,114 @@ const Al = /* @__PURE__ */ P({
|
|
|
1204
1204
|
te(e.setting, "pageFullscreen")
|
|
1205
1205
|
],
|
|
1206
1206
|
() => {
|
|
1207
|
-
ve(
|
|
1207
|
+
ve(h);
|
|
1208
1208
|
}
|
|
1209
1209
|
), H(
|
|
1210
1210
|
() => e.scrollAuto,
|
|
1211
|
-
(
|
|
1212
|
-
|
|
1211
|
+
(f) => {
|
|
1212
|
+
f ? i() : r();
|
|
1213
1213
|
}
|
|
1214
|
-
),
|
|
1215
|
-
}, Ul =
|
|
1216
|
-
var
|
|
1217
|
-
let a = "",
|
|
1218
|
-
const
|
|
1214
|
+
), Q(h);
|
|
1215
|
+
}, Ul = ql, _l = (e, o, l) => {
|
|
1216
|
+
var g, p, k, $, m, v;
|
|
1217
|
+
let a = "", r = 0, i = 0, h = !0, f = !1;
|
|
1218
|
+
const d = o.getSelectedText(), s = (g = J.editorConfig) == null ? void 0 : g.mermaidTemplate;
|
|
1219
1219
|
if (/^h[1-6]{1}$/.test(e)) {
|
|
1220
|
-
const
|
|
1221
|
-
a = `${
|
|
1220
|
+
const u = e.replace(/^h(\d)/, (C, w) => new Array(Number(w)).fill("#", 0, w).join(""));
|
|
1221
|
+
a = `${u} ${d}`, r = u.length + 1;
|
|
1222
1222
|
} else if (e === "prettier") {
|
|
1223
|
-
const
|
|
1224
|
-
((
|
|
1223
|
+
const u = window.prettier || ((k = (p = J.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : k.prettierInstance), C = [
|
|
1224
|
+
(($ = window.prettierPlugins) == null ? void 0 : $.markdown) || ((v = (m = J.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : v.parserMarkdownInstance)
|
|
1225
1225
|
];
|
|
1226
|
-
!
|
|
1226
|
+
!u || C[0] === void 0 ? (b.emit(l.editorId, le, {
|
|
1227
1227
|
name: "prettier",
|
|
1228
1228
|
message: "prettier is undefined"
|
|
1229
|
-
}), a = o.getValue()) : a =
|
|
1229
|
+
}), a = o.getValue()) : a = u.format(o.getValue(), {
|
|
1230
1230
|
parser: "markdown",
|
|
1231
|
-
plugins:
|
|
1232
|
-
}),
|
|
1231
|
+
plugins: C
|
|
1232
|
+
}), h = !1, f = !0;
|
|
1233
1233
|
} else
|
|
1234
1234
|
switch (e) {
|
|
1235
1235
|
case "bold": {
|
|
1236
|
-
a = `**${
|
|
1236
|
+
a = `**${d}**`, r = 2, i = -2;
|
|
1237
1237
|
break;
|
|
1238
1238
|
}
|
|
1239
1239
|
case "underline": {
|
|
1240
|
-
a = `<u>${
|
|
1240
|
+
a = `<u>${d}</u>`, r = 3, i = -4;
|
|
1241
1241
|
break;
|
|
1242
1242
|
}
|
|
1243
1243
|
case "italic": {
|
|
1244
|
-
a = `*${
|
|
1244
|
+
a = `*${d}*`, r = 1, i = -1;
|
|
1245
1245
|
break;
|
|
1246
1246
|
}
|
|
1247
1247
|
case "strikeThrough": {
|
|
1248
|
-
a = `~~${
|
|
1248
|
+
a = `~~${d}~~`, r = 2, i = -2;
|
|
1249
1249
|
break;
|
|
1250
1250
|
}
|
|
1251
1251
|
case "sub": {
|
|
1252
|
-
a = `<sub>${
|
|
1252
|
+
a = `<sub>${d}</sub>`, r = 5, i = -6;
|
|
1253
1253
|
break;
|
|
1254
1254
|
}
|
|
1255
1255
|
case "sup": {
|
|
1256
|
-
a = `<sup>${
|
|
1256
|
+
a = `<sup>${d}</sup>`, r = 5, i = -6;
|
|
1257
1257
|
break;
|
|
1258
1258
|
}
|
|
1259
1259
|
case "codeRow": {
|
|
1260
|
-
a = "`" +
|
|
1260
|
+
a = "`" + d + "`", r = 1, i = -1;
|
|
1261
1261
|
break;
|
|
1262
1262
|
}
|
|
1263
1263
|
case "quote": {
|
|
1264
|
-
a = `> ${
|
|
1264
|
+
a = `> ${d}`, r = 2;
|
|
1265
1265
|
break;
|
|
1266
1266
|
}
|
|
1267
1267
|
case "orderedList": {
|
|
1268
|
-
a = `1. ${
|
|
1268
|
+
a = `1. ${d}`, r = 3;
|
|
1269
1269
|
break;
|
|
1270
1270
|
}
|
|
1271
1271
|
case "unorderedList": {
|
|
1272
|
-
a = `- ${
|
|
1272
|
+
a = `- ${d}`, r = 2;
|
|
1273
1273
|
break;
|
|
1274
1274
|
}
|
|
1275
1275
|
case "task": {
|
|
1276
|
-
a = `- [ ] ${
|
|
1276
|
+
a = `- [ ] ${d}`, r = 6;
|
|
1277
1277
|
break;
|
|
1278
1278
|
}
|
|
1279
1279
|
case "code": {
|
|
1280
|
-
const
|
|
1281
|
-
a = `\`\`\`${
|
|
1282
|
-
${
|
|
1280
|
+
const u = l.text || d || "", C = l.mode || "language";
|
|
1281
|
+
a = `\`\`\`${C}
|
|
1282
|
+
${u}
|
|
1283
1283
|
\`\`\`
|
|
1284
|
-
`,
|
|
1284
|
+
`, r = 3, i = 3 + C.length - a.length;
|
|
1285
1285
|
break;
|
|
1286
1286
|
}
|
|
1287
1287
|
case "table": {
|
|
1288
1288
|
a = "|";
|
|
1289
|
-
const { selectedShape:
|
|
1290
|
-
for (let S = 0; S <=
|
|
1289
|
+
const { selectedShape: u = { x: 1, y: 1 } } = l, { x: C, y: w } = u;
|
|
1290
|
+
for (let S = 0; S <= w; S++)
|
|
1291
1291
|
a += " col |";
|
|
1292
1292
|
a += `
|
|
1293
1293
|
|`;
|
|
1294
|
-
for (let S = 0; S <=
|
|
1294
|
+
for (let S = 0; S <= w; S++)
|
|
1295
1295
|
a += " - |";
|
|
1296
|
-
for (let S = 0; S <=
|
|
1296
|
+
for (let S = 0; S <= C; S++) {
|
|
1297
1297
|
a += `
|
|
1298
1298
|
|`;
|
|
1299
|
-
for (let
|
|
1299
|
+
for (let M = 0; M <= w; M++)
|
|
1300
1300
|
a += " content |";
|
|
1301
1301
|
}
|
|
1302
|
-
|
|
1302
|
+
r = 2, i = 5 - a.length;
|
|
1303
1303
|
break;
|
|
1304
1304
|
}
|
|
1305
1305
|
case "link": {
|
|
1306
|
-
const { desc:
|
|
1307
|
-
a = `[${
|
|
1306
|
+
const { desc: u, url: C } = l;
|
|
1307
|
+
a = `[${u}](${C})`, h = !1;
|
|
1308
1308
|
break;
|
|
1309
1309
|
}
|
|
1310
1310
|
case "image": {
|
|
1311
|
-
const { desc:
|
|
1312
|
-
|
|
1313
|
-
`, "") : a = `
|
|
1313
|
+
`, "") : a = `
|
|
1314
|
+
`, h = !1;
|
|
1315
1315
|
break;
|
|
1316
1316
|
}
|
|
1317
1317
|
case "flow": {
|
|
@@ -1319,7 +1319,7 @@ ${b}
|
|
|
1319
1319
|
${(s == null ? void 0 : s.flow) || `flowchart TD
|
|
1320
1320
|
Start --> Stop`}
|
|
1321
1321
|
\`\`\`
|
|
1322
|
-
`,
|
|
1322
|
+
`, r = 3, i = 10 - a.length;
|
|
1323
1323
|
break;
|
|
1324
1324
|
}
|
|
1325
1325
|
case "sequence": {
|
|
@@ -1329,7 +1329,7 @@ ${(s == null ? void 0 : s.sequence) || `sequenceDiagram
|
|
|
1329
1329
|
B-->>A: hi!
|
|
1330
1330
|
A-)B: bye!`}
|
|
1331
1331
|
\`\`\`
|
|
1332
|
-
`,
|
|
1332
|
+
`, r = 3, i = 10 - a.length;
|
|
1333
1333
|
break;
|
|
1334
1334
|
}
|
|
1335
1335
|
case "gantt": {
|
|
@@ -1341,7 +1341,7 @@ section Section
|
|
|
1341
1341
|
A task :a1, 2014-01-01, 30d
|
|
1342
1342
|
Another task :after a1, 20d`}
|
|
1343
1343
|
\`\`\`
|
|
1344
|
-
`,
|
|
1344
|
+
`, r = 3, i = 10 - a.length;
|
|
1345
1345
|
break;
|
|
1346
1346
|
}
|
|
1347
1347
|
case "class": {
|
|
@@ -1350,7 +1350,7 @@ ${(s == null ? void 0 : s.class) || `classDiagram
|
|
|
1350
1350
|
class Animal
|
|
1351
1351
|
Vehicle <|-- Car`}
|
|
1352
1352
|
\`\`\`
|
|
1353
|
-
`,
|
|
1353
|
+
`, r = 3, i = 10 - a.length;
|
|
1354
1354
|
break;
|
|
1355
1355
|
}
|
|
1356
1356
|
case "state": {
|
|
@@ -1358,7 +1358,7 @@ ${(s == null ? void 0 : s.class) || `classDiagram
|
|
|
1358
1358
|
${(s == null ? void 0 : s.state) || `stateDiagram-v2
|
|
1359
1359
|
s1 --> s2`}
|
|
1360
1360
|
\`\`\`
|
|
1361
|
-
`,
|
|
1361
|
+
`, r = 3, i = 10 - a.length;
|
|
1362
1362
|
break;
|
|
1363
1363
|
}
|
|
1364
1364
|
case "pie": {
|
|
@@ -1368,7 +1368,7 @@ ${(s == null ? void 0 : s.pie) || `pie title Pets adopted by volunteers
|
|
|
1368
1368
|
"Cats" : 85
|
|
1369
1369
|
"Rats" : 15`}
|
|
1370
1370
|
\`\`\`
|
|
1371
|
-
`,
|
|
1371
|
+
`, r = 3, i = 10 - a.length;
|
|
1372
1372
|
break;
|
|
1373
1373
|
}
|
|
1374
1374
|
case "relationship": {
|
|
@@ -1377,7 +1377,7 @@ ${(s == null ? void 0 : s.relationship) || `erDiagram
|
|
|
1377
1377
|
CAR ||--o{ NAMED-DRIVER : allows
|
|
1378
1378
|
PERSON ||--o{ NAMED-DRIVER : is`}
|
|
1379
1379
|
\`\`\`
|
|
1380
|
-
`,
|
|
1380
|
+
`, r = 3, i = 10 - a.length;
|
|
1381
1381
|
break;
|
|
1382
1382
|
}
|
|
1383
1383
|
case "journey": {
|
|
@@ -1392,50 +1392,50 @@ ${(s == null ? void 0 : s.journey) || `journey
|
|
|
1392
1392
|
Go downstairs: 5: Me
|
|
1393
1393
|
Sit down: 5: Me`}
|
|
1394
1394
|
\`\`\`
|
|
1395
|
-
`,
|
|
1395
|
+
`, r = 3, i = 10 - a.length;
|
|
1396
1396
|
break;
|
|
1397
1397
|
}
|
|
1398
1398
|
case "katexInline": {
|
|
1399
|
-
a = "$$",
|
|
1399
|
+
a = "$$", r = 1, i = -1;
|
|
1400
1400
|
break;
|
|
1401
1401
|
}
|
|
1402
1402
|
case "katexBlock": {
|
|
1403
1403
|
a = `$$
|
|
1404
1404
|
|
|
1405
1405
|
$$
|
|
1406
|
-
`,
|
|
1406
|
+
`, r = 3, i = -4;
|
|
1407
1407
|
break;
|
|
1408
1408
|
}
|
|
1409
1409
|
case "universal": {
|
|
1410
|
-
const { generate:
|
|
1411
|
-
a =
|
|
1410
|
+
const { generate: u } = l, C = u(d);
|
|
1411
|
+
a = C.targetValue, h = C.select ?? !0, r = C.deviationStart || 0, i = C.deviationEnd || 0;
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
return {
|
|
1415
1415
|
text: a,
|
|
1416
1416
|
options: {
|
|
1417
1417
|
// 是否选中
|
|
1418
|
-
select:
|
|
1418
|
+
select: h,
|
|
1419
1419
|
// 选中时,开始位置的偏移量
|
|
1420
|
-
deviationStart:
|
|
1420
|
+
deviationStart: r,
|
|
1421
1421
|
// 结束的偏移量
|
|
1422
|
-
deviationEnd:
|
|
1422
|
+
deviationEnd: i,
|
|
1423
1423
|
// 是否整个替换
|
|
1424
|
-
replaceAll:
|
|
1424
|
+
replaceAll: f
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
|
-
},
|
|
1427
|
+
}, Gl = "#e5c07b", bt = "var(--md-color)", Kl = "#56b6c2", jl = "#ffffff", ue = "var(--md-color)", vt = "#e5c07b", Zl = "#e5c07b", Xl = "var(--md-color)", kt = "#d19a66", Yl = "#c678dd", Jl = "#21252b", Ql = "#2c313a", Ct = "var(--md-bk-color)", $e = "var(--md-bk-color)", eo = "#ceedfa33", $t = "#528bff", to = Se.theme(
|
|
1428
1428
|
{
|
|
1429
1429
|
"&": {
|
|
1430
|
-
color:
|
|
1431
|
-
backgroundColor:
|
|
1430
|
+
color: ue,
|
|
1431
|
+
backgroundColor: Ct
|
|
1432
1432
|
},
|
|
1433
1433
|
".cm-content": {
|
|
1434
|
-
caretColor:
|
|
1434
|
+
caretColor: $t
|
|
1435
1435
|
},
|
|
1436
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1437
|
-
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor:
|
|
1438
|
-
".cm-panels": { backgroundColor:
|
|
1436
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: $t },
|
|
1437
|
+
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: eo },
|
|
1438
|
+
".cm-panels": { backgroundColor: Jl, color: ue },
|
|
1439
1439
|
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
1440
1440
|
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
1441
1441
|
".cm-searchMatch": {
|
|
@@ -1451,13 +1451,13 @@ $$
|
|
|
1451
1451
|
backgroundColor: "#bad0f847"
|
|
1452
1452
|
},
|
|
1453
1453
|
".cm-gutters": {
|
|
1454
|
-
backgroundColor:
|
|
1455
|
-
color:
|
|
1454
|
+
backgroundColor: Ct,
|
|
1455
|
+
color: ue,
|
|
1456
1456
|
borderRight: "1px solid",
|
|
1457
1457
|
borderColor: "var(--md-border-color)"
|
|
1458
1458
|
},
|
|
1459
1459
|
".cm-activeLineGutter": {
|
|
1460
|
-
backgroundColor:
|
|
1460
|
+
backgroundColor: Ql
|
|
1461
1461
|
},
|
|
1462
1462
|
".cm-foldPlaceholder": {
|
|
1463
1463
|
backgroundColor: "transparent",
|
|
@@ -1478,17 +1478,17 @@ $$
|
|
|
1478
1478
|
},
|
|
1479
1479
|
".cm-tooltip-autocomplete": {
|
|
1480
1480
|
"& > ul > li[aria-selected]": {
|
|
1481
|
-
color:
|
|
1481
|
+
color: ue
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
1484
|
},
|
|
1485
1485
|
{ dark: !0 }
|
|
1486
|
-
),
|
|
1487
|
-
{ tag: c.keyword, color:
|
|
1488
|
-
{ tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color:
|
|
1489
|
-
{ tag: [c.function(c.variableName), c.labelName], color:
|
|
1490
|
-
{ tag: [c.color, c.constant(c.name), c.standard(c.name)], color:
|
|
1491
|
-
{ tag: [c.definition(c.name), c.separator], color:
|
|
1486
|
+
), lo = Ot.define([
|
|
1487
|
+
{ tag: c.keyword, color: Yl },
|
|
1488
|
+
{ tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: bt },
|
|
1489
|
+
{ tag: [c.function(c.variableName), c.labelName], color: Zl },
|
|
1490
|
+
{ tag: [c.color, c.constant(c.name), c.standard(c.name)], color: kt },
|
|
1491
|
+
{ tag: [c.definition(c.name), c.separator], color: ue },
|
|
1492
1492
|
{
|
|
1493
1493
|
tag: [
|
|
1494
1494
|
c.typeName,
|
|
@@ -1500,7 +1500,7 @@ $$
|
|
|
1500
1500
|
c.self,
|
|
1501
1501
|
c.namespace
|
|
1502
1502
|
],
|
|
1503
|
-
color:
|
|
1503
|
+
color: Gl
|
|
1504
1504
|
},
|
|
1505
1505
|
{
|
|
1506
1506
|
tag: [
|
|
@@ -1512,32 +1512,32 @@ $$
|
|
|
1512
1512
|
c.link,
|
|
1513
1513
|
c.special(c.string)
|
|
1514
1514
|
],
|
|
1515
|
-
color:
|
|
1515
|
+
color: Kl
|
|
1516
1516
|
},
|
|
1517
|
-
{ tag: [c.meta, c.comment], color:
|
|
1517
|
+
{ tag: [c.meta, c.comment], color: vt },
|
|
1518
1518
|
{ tag: c.strong, fontWeight: "bold" },
|
|
1519
1519
|
{ tag: c.emphasis, fontStyle: "italic" },
|
|
1520
1520
|
{ tag: c.strikethrough, textDecoration: "line-through" },
|
|
1521
|
-
{ tag: c.link, color:
|
|
1522
|
-
{ tag: c.heading, fontWeight: "bold", color:
|
|
1523
|
-
{ tag: [c.atom, c.bool, c.special(c.variableName)], color:
|
|
1524
|
-
{ tag: [c.processingInstruction, c.string, c.inserted], color:
|
|
1525
|
-
{ tag: c.invalid, color:
|
|
1526
|
-
]),
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
],
|
|
1521
|
+
{ tag: c.link, color: vt, textDecoration: "underline" },
|
|
1522
|
+
{ tag: c.heading, fontWeight: "bold", color: bt },
|
|
1523
|
+
{ tag: [c.atom, c.bool, c.special(c.variableName)], color: kt },
|
|
1524
|
+
{ tag: [c.processingInstruction, c.string, c.inserted], color: Xl },
|
|
1525
|
+
{ tag: c.invalid, color: jl }
|
|
1526
|
+
]), pt = [
|
|
1527
|
+
to,
|
|
1528
|
+
Vt(lo)
|
|
1529
|
+
], oo = "#e5c07b", yt = "#3f4a54", ao = "#56b6c2", no = "#fff", de = "#3f4a54", Tt = "#2d8cf0", io = "#2d8cf0", ro = "#3f4a54", wt = "#d19a66", so = "#c678dd", co = "#21252b", uo = "#ceedfa33", xt = "var(--md-bk-color)", pe = "var(--md-bk-color)", mo = "#bad5fa", St = "#3f4a54", go = Se.theme(
|
|
1530
1530
|
{
|
|
1531
1531
|
"&": {
|
|
1532
|
-
color:
|
|
1533
|
-
backgroundColor:
|
|
1532
|
+
color: de,
|
|
1533
|
+
backgroundColor: xt
|
|
1534
1534
|
},
|
|
1535
1535
|
".cm-content": {
|
|
1536
|
-
caretColor:
|
|
1536
|
+
caretColor: St
|
|
1537
1537
|
},
|
|
1538
|
-
".cm-cursor, .cm-dropCursor": { borderLeftColor:
|
|
1539
|
-
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor:
|
|
1540
|
-
".cm-panels": { backgroundColor:
|
|
1538
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: St },
|
|
1539
|
+
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: mo },
|
|
1540
|
+
".cm-panels": { backgroundColor: co, color: de },
|
|
1541
1541
|
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
|
|
1542
1542
|
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
|
|
1543
1543
|
".cm-searchMatch": {
|
|
@@ -1553,13 +1553,13 @@ $$
|
|
|
1553
1553
|
backgroundColor: "#bad0f847"
|
|
1554
1554
|
},
|
|
1555
1555
|
".cm-gutters": {
|
|
1556
|
-
backgroundColor:
|
|
1557
|
-
color:
|
|
1556
|
+
backgroundColor: xt,
|
|
1557
|
+
color: de,
|
|
1558
1558
|
borderRight: "1px solid",
|
|
1559
1559
|
borderColor: "var(--md-border-color)"
|
|
1560
1560
|
},
|
|
1561
1561
|
".cm-activeLineGutter": {
|
|
1562
|
-
backgroundColor:
|
|
1562
|
+
backgroundColor: uo
|
|
1563
1563
|
},
|
|
1564
1564
|
".cm-foldPlaceholder": {
|
|
1565
1565
|
backgroundColor: "transparent",
|
|
@@ -1580,17 +1580,17 @@ $$
|
|
|
1580
1580
|
},
|
|
1581
1581
|
".cm-tooltip-autocomplete": {
|
|
1582
1582
|
"& > ul > li[aria-selected]": {
|
|
1583
|
-
color:
|
|
1583
|
+
color: de
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
1587
|
// { dark: true }
|
|
1588
|
-
),
|
|
1589
|
-
{ tag: c.keyword, color:
|
|
1590
|
-
{ tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color:
|
|
1591
|
-
{ tag: [c.function(c.variableName), c.labelName], color:
|
|
1592
|
-
{ tag: [c.color, c.constant(c.name), c.standard(c.name)], color:
|
|
1593
|
-
{ tag: [c.definition(c.name), c.separator], color:
|
|
1588
|
+
), fo = Ot.define([
|
|
1589
|
+
{ tag: c.keyword, color: so },
|
|
1590
|
+
{ tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: yt },
|
|
1591
|
+
{ tag: [c.function(c.variableName), c.labelName], color: io },
|
|
1592
|
+
{ tag: [c.color, c.constant(c.name), c.standard(c.name)], color: wt },
|
|
1593
|
+
{ tag: [c.definition(c.name), c.separator], color: de },
|
|
1594
1594
|
{
|
|
1595
1595
|
tag: [
|
|
1596
1596
|
c.typeName,
|
|
@@ -1602,7 +1602,7 @@ $$
|
|
|
1602
1602
|
c.self,
|
|
1603
1603
|
c.namespace
|
|
1604
1604
|
],
|
|
1605
|
-
color:
|
|
1605
|
+
color: oo
|
|
1606
1606
|
},
|
|
1607
1607
|
{
|
|
1608
1608
|
tag: [
|
|
@@ -1614,40 +1614,40 @@ $$
|
|
|
1614
1614
|
c.link,
|
|
1615
1615
|
c.special(c.string)
|
|
1616
1616
|
],
|
|
1617
|
-
color:
|
|
1617
|
+
color: ao
|
|
1618
1618
|
},
|
|
1619
|
-
{ tag: [c.meta, c.comment], color:
|
|
1619
|
+
{ tag: [c.meta, c.comment], color: Tt },
|
|
1620
1620
|
{ tag: c.strong, fontWeight: "bold" },
|
|
1621
1621
|
{ tag: c.emphasis, fontStyle: "italic" },
|
|
1622
1622
|
{ tag: c.strikethrough, textDecoration: "line-through" },
|
|
1623
|
-
{ tag: c.link, color:
|
|
1624
|
-
{ tag: c.heading, fontWeight: "bold", color:
|
|
1625
|
-
{ tag: [c.atom, c.bool, c.special(c.variableName)], color:
|
|
1626
|
-
{ tag: [c.processingInstruction, c.string, c.inserted], color:
|
|
1627
|
-
{ tag: c.invalid, color:
|
|
1628
|
-
]),
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
],
|
|
1632
|
-
const s = `${e}${o}`.slice(
|
|
1633
|
-
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
selection:
|
|
1623
|
+
{ tag: c.link, color: Tt, textDecoration: "underline" },
|
|
1624
|
+
{ tag: c.heading, fontWeight: "bold", color: yt },
|
|
1625
|
+
{ tag: [c.atom, c.bool, c.special(c.variableName)], color: wt },
|
|
1626
|
+
{ tag: [c.processingInstruction, c.string, c.inserted], color: ro },
|
|
1627
|
+
{ tag: c.invalid, color: no }
|
|
1628
|
+
]), Mt = [
|
|
1629
|
+
go,
|
|
1630
|
+
Vt(fo)
|
|
1631
|
+
], be = (e, o, l, a, r) => (i, h, f, d) => {
|
|
1632
|
+
const s = `${e}${o}`.slice(d - f);
|
|
1633
|
+
i.dispatch(i.state.replaceSelection(`${s}${l}${a}`));
|
|
1634
|
+
const g = f + h.label.length + (r === "title" ? l.length : 0);
|
|
1635
|
+
i.dispatch({
|
|
1636
|
+
selection: _.create(
|
|
1637
1637
|
[
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1638
|
+
_.range(
|
|
1639
|
+
f + h.label.length + (r === "title" ? 1 : -o.length),
|
|
1640
|
+
g
|
|
1641
1641
|
),
|
|
1642
|
-
|
|
1642
|
+
_.cursor(g)
|
|
1643
1643
|
],
|
|
1644
1644
|
1
|
|
1645
1645
|
)
|
|
1646
|
-
}),
|
|
1647
|
-
}, At = (e) => (o, l, a,
|
|
1648
|
-
const
|
|
1649
|
-
o.dispatch(o.state.replaceSelection(`${
|
|
1650
|
-
},
|
|
1646
|
+
}), i.focus();
|
|
1647
|
+
}, At = (e) => (o, l, a, r) => {
|
|
1648
|
+
const i = e.slice(r - a);
|
|
1649
|
+
o.dispatch(o.state.replaceSelection(`${i} `));
|
|
1650
|
+
}, ho = (e) => {
|
|
1651
1651
|
const o = (l) => {
|
|
1652
1652
|
const a = l.matchBefore(
|
|
1653
1653
|
/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
|
|
@@ -1656,21 +1656,21 @@ $$
|
|
|
1656
1656
|
from: a.from,
|
|
1657
1657
|
options: [
|
|
1658
1658
|
// 标题
|
|
1659
|
-
...["h1", "h2", "h3", "h4", "h5", "h6"].map((
|
|
1660
|
-
const
|
|
1659
|
+
...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
|
|
1660
|
+
const h = new Array(i + 1).fill("#").join("");
|
|
1661
1661
|
return {
|
|
1662
|
-
label:
|
|
1662
|
+
label: h,
|
|
1663
1663
|
type: "text",
|
|
1664
|
-
apply: At(
|
|
1664
|
+
apply: At(h)
|
|
1665
1665
|
};
|
|
1666
1666
|
}),
|
|
1667
1667
|
// 任务列表
|
|
1668
|
-
...["unchecked", "checked"].map((
|
|
1669
|
-
const
|
|
1668
|
+
...["unchecked", "checked"].map((r) => {
|
|
1669
|
+
const i = r === "checked" ? "- [x]" : "- [ ]";
|
|
1670
1670
|
return {
|
|
1671
|
-
label:
|
|
1671
|
+
label: i,
|
|
1672
1672
|
type: "text",
|
|
1673
|
-
apply: At(
|
|
1673
|
+
apply: At(i)
|
|
1674
1674
|
};
|
|
1675
1675
|
}),
|
|
1676
1676
|
// 代码
|
|
@@ -1678,10 +1678,10 @@ $$
|
|
|
1678
1678
|
["`", ""],
|
|
1679
1679
|
["```", "language"],
|
|
1680
1680
|
["```mermaid\n", ""]
|
|
1681
|
-
].map((
|
|
1682
|
-
label: `${
|
|
1681
|
+
].map((r) => ({
|
|
1682
|
+
label: `${r[0]}${r[1]}`,
|
|
1683
1683
|
type: "text",
|
|
1684
|
-
apply:
|
|
1684
|
+
apply: be(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
|
|
1685
1685
|
})),
|
|
1686
1686
|
// 链接
|
|
1687
1687
|
{
|
|
@@ -1706,12 +1706,12 @@ $$
|
|
|
1706
1706
|
{
|
|
1707
1707
|
label: "$",
|
|
1708
1708
|
type: "text",
|
|
1709
|
-
apply:
|
|
1709
|
+
apply: be("$", "", "", "$", "type")
|
|
1710
1710
|
},
|
|
1711
1711
|
{
|
|
1712
1712
|
label: "$$",
|
|
1713
1713
|
type: "text",
|
|
1714
|
-
apply:
|
|
1714
|
+
apply: be("$$", "", `
|
|
1715
1715
|
`, `
|
|
1716
1716
|
$$`, "title")
|
|
1717
1717
|
},
|
|
@@ -1733,39 +1733,39 @@ $$`, "title")
|
|
|
1733
1733
|
"caution",
|
|
1734
1734
|
"error",
|
|
1735
1735
|
"attention"
|
|
1736
|
-
].map((
|
|
1737
|
-
label: `!!! ${
|
|
1736
|
+
].map((r) => ({
|
|
1737
|
+
label: `!!! ${r}`,
|
|
1738
1738
|
type: "text",
|
|
1739
|
-
apply:
|
|
1739
|
+
apply: be("!!!", ` ${r}`, " Title", `
|
|
1740
1740
|
|
|
1741
1741
|
!!!`, "title")
|
|
1742
1742
|
}))
|
|
1743
1743
|
]
|
|
1744
1744
|
};
|
|
1745
1745
|
};
|
|
1746
|
-
return
|
|
1746
|
+
return gl({
|
|
1747
1747
|
override: e ? [o, ...e] : [o]
|
|
1748
1748
|
});
|
|
1749
|
-
},
|
|
1750
|
-
const o = new
|
|
1749
|
+
}, Lt = ho, ee = (e) => {
|
|
1750
|
+
const o = new ce();
|
|
1751
1751
|
return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
|
|
1752
|
-
effects:
|
|
1752
|
+
effects: nl.appendConfig.of(o.of(a))
|
|
1753
1753
|
}), !0);
|
|
1754
1754
|
};
|
|
1755
|
-
class
|
|
1755
|
+
class bo {
|
|
1756
1756
|
constructor(o) {
|
|
1757
|
-
|
|
1758
|
-
|
|
1757
|
+
U(this, "view");
|
|
1758
|
+
U(this, "maxLength", Number.MAX_SAFE_INTEGER);
|
|
1759
1759
|
// 切换tabSize的执行方法。切换时,Compartment实例需要相同
|
|
1760
|
-
|
|
1761
|
-
|
|
1760
|
+
U(this, "toggleTabSize");
|
|
1761
|
+
U(this, "togglePlaceholder");
|
|
1762
1762
|
/**
|
|
1763
1763
|
* 设置全部的扩展
|
|
1764
1764
|
*/
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1765
|
+
U(this, "setExtensions");
|
|
1766
|
+
U(this, "toggleDisabled");
|
|
1767
|
+
U(this, "toggleReadOnly");
|
|
1768
|
+
U(this, "toggleMaxlength");
|
|
1769
1769
|
this.view = o, this.toggleTabSize = ee(this.view), this.togglePlaceholder = ee(this.view), this.setExtensions = ee(this.view), this.toggleDisabled = ee(this.view), this.toggleReadOnly = ee(this.view), this.toggleMaxlength = ee(this.view);
|
|
1770
1770
|
}
|
|
1771
1771
|
getValue() {
|
|
@@ -1818,29 +1818,29 @@ class ho {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
if (this.view.state.doc.length - this.getSelectedText().length + o.length > this.maxLength)
|
|
1820
1820
|
throw new Error("The input text is too long");
|
|
1821
|
-
const { from:
|
|
1821
|
+
const { from: r } = this.view.state.selection.main;
|
|
1822
1822
|
if (this.view.dispatch(this.view.state.replaceSelection(o)), l.select) {
|
|
1823
|
-
const
|
|
1823
|
+
const i = r + o.length + l.deviationEnd;
|
|
1824
1824
|
this.view.dispatch({
|
|
1825
|
-
selection:
|
|
1825
|
+
selection: _.create(
|
|
1826
1826
|
[
|
|
1827
|
-
|
|
1828
|
-
|
|
1827
|
+
_.range(r + l.deviationStart, i),
|
|
1828
|
+
_.cursor(i)
|
|
1829
1829
|
],
|
|
1830
1830
|
1
|
|
1831
1831
|
)
|
|
1832
1832
|
});
|
|
1833
1833
|
}
|
|
1834
1834
|
this.view.focus();
|
|
1835
|
-
} catch (
|
|
1836
|
-
if (
|
|
1837
|
-
|
|
1835
|
+
} catch (r) {
|
|
1836
|
+
if (r.message === "The input text is too long")
|
|
1837
|
+
b.emit(a, le, {
|
|
1838
1838
|
name: "overlength",
|
|
1839
|
-
message:
|
|
1839
|
+
message: r.message,
|
|
1840
1840
|
data: o
|
|
1841
1841
|
});
|
|
1842
1842
|
else
|
|
1843
|
-
throw
|
|
1843
|
+
throw r;
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
1846
|
/**
|
|
@@ -1851,7 +1851,7 @@ class ho {
|
|
|
1851
1851
|
setTabSize(o) {
|
|
1852
1852
|
this.toggleTabSize([
|
|
1853
1853
|
Ce.tabSize.of(o),
|
|
1854
|
-
|
|
1854
|
+
ml.of(" ".repeat(o))
|
|
1855
1855
|
]);
|
|
1856
1856
|
}
|
|
1857
1857
|
/**
|
|
@@ -1860,26 +1860,26 @@ class ho {
|
|
|
1860
1860
|
* @param t 目标内容
|
|
1861
1861
|
*/
|
|
1862
1862
|
setPlaceholder(o) {
|
|
1863
|
-
this.togglePlaceholder(
|
|
1863
|
+
this.togglePlaceholder(tl(o));
|
|
1864
1864
|
}
|
|
1865
1865
|
focus(o) {
|
|
1866
1866
|
if (this.view.focus(), !o)
|
|
1867
1867
|
return;
|
|
1868
|
-
let l = 0, a = 0,
|
|
1868
|
+
let l = 0, a = 0, r = 0;
|
|
1869
1869
|
switch (o) {
|
|
1870
1870
|
case "start":
|
|
1871
1871
|
break;
|
|
1872
1872
|
case "end": {
|
|
1873
|
-
l = a =
|
|
1873
|
+
l = a = r = this.getValue().length;
|
|
1874
1874
|
break;
|
|
1875
1875
|
}
|
|
1876
1876
|
default:
|
|
1877
|
-
l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos,
|
|
1877
|
+
l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, r = o.cursorPos;
|
|
1878
1878
|
}
|
|
1879
1879
|
this.view.dispatch({
|
|
1880
1880
|
scrollIntoView: !0,
|
|
1881
|
-
selection:
|
|
1882
|
-
[
|
|
1881
|
+
selection: _.create(
|
|
1882
|
+
[_.range(l, a), _.cursor(r)],
|
|
1883
1883
|
1
|
|
1884
1884
|
)
|
|
1885
1885
|
});
|
|
@@ -1896,209 +1896,198 @@ class ho {
|
|
|
1896
1896
|
]);
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
|
-
const
|
|
1900
|
-
const o =
|
|
1899
|
+
const vo = (e) => {
|
|
1900
|
+
const o = I("editorId");
|
|
1901
1901
|
return (a) => {
|
|
1902
1902
|
if (!a.clipboardData)
|
|
1903
1903
|
return;
|
|
1904
1904
|
if (a.clipboardData.files.length > 0) {
|
|
1905
|
-
const { files:
|
|
1906
|
-
|
|
1905
|
+
const { files: i } = a.clipboardData;
|
|
1906
|
+
b.emit(
|
|
1907
1907
|
o,
|
|
1908
1908
|
xe,
|
|
1909
|
-
Array.from(
|
|
1909
|
+
Array.from(i).filter((h) => /image\/.*/.test(h.type))
|
|
1910
1910
|
), a.preventDefault();
|
|
1911
1911
|
return;
|
|
1912
1912
|
}
|
|
1913
1913
|
if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
mode:
|
|
1914
|
+
const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
|
|
1915
|
+
b.emit(o, x, "code", {
|
|
1916
|
+
mode: i.mode,
|
|
1917
1917
|
text: a.clipboardData.getData("text/plain")
|
|
1918
1918
|
}), a.preventDefault();
|
|
1919
1919
|
return;
|
|
1920
1920
|
}
|
|
1921
|
-
const
|
|
1922
|
-
e.maxlength &&
|
|
1921
|
+
const r = a.clipboardData.getData("text/plain");
|
|
1922
|
+
e.maxlength && r.length + e.modelValue.length > e.maxlength && b.emit(o, le, {
|
|
1923
1923
|
name: "overlength",
|
|
1924
1924
|
message: "The input text is too long",
|
|
1925
|
-
data:
|
|
1925
|
+
data: r
|
|
1926
1926
|
});
|
|
1927
1927
|
};
|
|
1928
|
-
},
|
|
1929
|
-
const o = A("editorId");
|
|
1930
|
-
Y(() => {
|
|
1931
|
-
v.on(o, {
|
|
1932
|
-
name: Qt,
|
|
1933
|
-
callback(l) {
|
|
1934
|
-
var a;
|
|
1935
|
-
(a = e.value) == null || a.focus(l);
|
|
1936
|
-
}
|
|
1937
|
-
});
|
|
1938
|
-
});
|
|
1939
|
-
}, Co = ko, $o = (e, o) => [
|
|
1928
|
+
}, ko = vo, Co = (e, o) => [
|
|
1940
1929
|
{
|
|
1941
1930
|
key: "Ctrl-b",
|
|
1942
1931
|
mac: "Cmd-b",
|
|
1943
|
-
run: () => (
|
|
1932
|
+
run: () => (b.emit(e, x, "bold"), !0)
|
|
1944
1933
|
},
|
|
1945
1934
|
{
|
|
1946
1935
|
key: "Ctrl-d",
|
|
1947
1936
|
mac: "Cmd-d",
|
|
1948
|
-
run:
|
|
1937
|
+
run: il,
|
|
1949
1938
|
preventDefault: !0
|
|
1950
1939
|
},
|
|
1951
1940
|
{
|
|
1952
1941
|
key: "Ctrl-s",
|
|
1953
1942
|
mac: "Cmd-s",
|
|
1954
|
-
run: (
|
|
1955
|
-
shift: () => (
|
|
1943
|
+
run: (M) => (b.emit(e, Et, M.state.doc.toString()), !0),
|
|
1944
|
+
shift: () => (b.emit(e, x, "strikeThrough"), !0)
|
|
1956
1945
|
},
|
|
1957
1946
|
{
|
|
1958
1947
|
key: "Ctrl-u",
|
|
1959
1948
|
mac: "Cmd-u",
|
|
1960
|
-
run: () => (
|
|
1961
|
-
shift: () => (
|
|
1949
|
+
run: () => (b.emit(e, x, "underline"), !0),
|
|
1950
|
+
shift: () => (b.emit(e, x, "unorderedList"), !0)
|
|
1962
1951
|
},
|
|
1963
1952
|
{
|
|
1964
1953
|
key: "Ctrl-i",
|
|
1965
1954
|
mac: "Cmd-i",
|
|
1966
|
-
run: () => (
|
|
1967
|
-
shift: () => (
|
|
1955
|
+
run: () => (b.emit(e, x, "italic"), !0),
|
|
1956
|
+
shift: () => (b.emit(e, Te, "image"), !0)
|
|
1968
1957
|
},
|
|
1969
1958
|
{
|
|
1970
1959
|
key: "Ctrl-1",
|
|
1971
1960
|
mac: "Cmd-1",
|
|
1972
|
-
run: () => (
|
|
1961
|
+
run: () => (b.emit(e, x, "h1"), !0)
|
|
1973
1962
|
},
|
|
1974
1963
|
{
|
|
1975
1964
|
key: "Ctrl-2",
|
|
1976
1965
|
mac: "Cmd-2",
|
|
1977
|
-
run: () => (
|
|
1966
|
+
run: () => (b.emit(e, x, "h2"), !0)
|
|
1978
1967
|
},
|
|
1979
1968
|
{
|
|
1980
1969
|
key: "Ctrl-3",
|
|
1981
1970
|
mac: "Cmd-3",
|
|
1982
|
-
run: () => (
|
|
1971
|
+
run: () => (b.emit(e, x, "h3"), !0)
|
|
1983
1972
|
},
|
|
1984
1973
|
{
|
|
1985
1974
|
key: "Ctrl-4",
|
|
1986
1975
|
mac: "Cmd-4",
|
|
1987
|
-
run: () => (
|
|
1976
|
+
run: () => (b.emit(e, x, "h4"), !0)
|
|
1988
1977
|
},
|
|
1989
1978
|
{
|
|
1990
1979
|
key: "Ctrl-5",
|
|
1991
1980
|
mac: "Cmd-5",
|
|
1992
|
-
run: () => (
|
|
1981
|
+
run: () => (b.emit(e, x, "h5"), !0)
|
|
1993
1982
|
},
|
|
1994
1983
|
{
|
|
1995
1984
|
key: "Ctrl-6",
|
|
1996
1985
|
mac: "Cmd-6",
|
|
1997
|
-
run: () => (
|
|
1986
|
+
run: () => (b.emit(e, x, "h6"), !0)
|
|
1998
1987
|
},
|
|
1999
1988
|
{
|
|
2000
1989
|
key: "Ctrl-ArrowUp",
|
|
2001
1990
|
mac: "Cmd-ArrowUp",
|
|
2002
|
-
run: () => (
|
|
1991
|
+
run: () => (b.emit(e, x, "sup"), !0)
|
|
2003
1992
|
},
|
|
2004
1993
|
{
|
|
2005
1994
|
key: "Ctrl-ArrowDown",
|
|
2006
1995
|
mac: "Cmd-ArrowDown",
|
|
2007
|
-
run: () => (
|
|
1996
|
+
run: () => (b.emit(e, x, "sub"), !0)
|
|
2008
1997
|
},
|
|
2009
1998
|
{
|
|
2010
1999
|
key: "Ctrl-o",
|
|
2011
2000
|
mac: "Cmd-o",
|
|
2012
|
-
run: () => (
|
|
2001
|
+
run: () => (b.emit(e, x, "orderedList"), !0)
|
|
2013
2002
|
},
|
|
2014
2003
|
{
|
|
2015
2004
|
key: "Ctrl-c",
|
|
2016
2005
|
mac: "Cmd-c",
|
|
2017
|
-
shift: () => (
|
|
2018
|
-
any(
|
|
2019
|
-
return (D.ctrlKey || D.metaKey) && D.altKey && D.code === "KeyC" ? (
|
|
2006
|
+
shift: () => (b.emit(e, x, "code"), !0),
|
|
2007
|
+
any(M, D) {
|
|
2008
|
+
return (D.ctrlKey || D.metaKey) && D.altKey && D.code === "KeyC" ? (b.emit(e, x, "codeRow"), !0) : !1;
|
|
2020
2009
|
}
|
|
2021
2010
|
},
|
|
2022
2011
|
{
|
|
2023
2012
|
key: "Ctrl-l",
|
|
2024
2013
|
mac: "Cmd-l",
|
|
2025
|
-
run: () => (
|
|
2014
|
+
run: () => (b.emit(e, Te, "link"), !0)
|
|
2026
2015
|
},
|
|
2027
2016
|
{
|
|
2028
2017
|
key: "Ctrl-f",
|
|
2029
2018
|
mac: "Cmd-f",
|
|
2030
|
-
shift: () => o.noPrettier ? !1 : (
|
|
2019
|
+
shift: () => o.noPrettier ? !1 : (b.emit(e, x, "prettier"), !0)
|
|
2031
2020
|
},
|
|
2032
2021
|
{
|
|
2033
|
-
any: (
|
|
2022
|
+
any: (M, D) => (D.ctrlKey || D.metaKey) && D.altKey && D.shiftKey && D.code === "KeyT" ? (b.emit(e, x, "table"), !0) : !1
|
|
2034
2023
|
}
|
|
2035
|
-
],
|
|
2036
|
-
const o =
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2024
|
+
], $o = Co, po = (e) => {
|
|
2025
|
+
const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = P(), i = Wt(), h = new ce(), f = new ce(), d = new ce(), s = new ce(), g = $o(l, e), p = ko(e), k = [
|
|
2026
|
+
ll.of([...rl, ...sl, ...g, cl]),
|
|
2027
|
+
s.of(ft()),
|
|
2028
|
+
h.of(al({ codeLanguages: ol })),
|
|
2040
2029
|
// 横向换行
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2030
|
+
he.lineWrapping,
|
|
2031
|
+
he.updateListener.of((m) => {
|
|
2032
|
+
m.docChanged && e.onChange(m.state.doc.toString());
|
|
2044
2033
|
}),
|
|
2045
|
-
|
|
2046
|
-
paste:
|
|
2034
|
+
he.domEventHandlers({
|
|
2035
|
+
paste: p,
|
|
2047
2036
|
blur: e.onBlur,
|
|
2048
2037
|
focus: e.onFocus,
|
|
2049
2038
|
drop: e.onDrop,
|
|
2050
|
-
input: (
|
|
2051
|
-
e.onInput && e.onInput(
|
|
2052
|
-
const { data:
|
|
2053
|
-
e.maxlength && e.modelValue.length +
|
|
2039
|
+
input: (m) => {
|
|
2040
|
+
e.onInput && e.onInput(m);
|
|
2041
|
+
const { data: v } = m;
|
|
2042
|
+
e.maxlength && e.modelValue.length + v.length > e.maxlength && b.emit(l, le, {
|
|
2054
2043
|
name: "overlength",
|
|
2055
2044
|
message: "The input text is too long",
|
|
2056
|
-
data:
|
|
2045
|
+
data: v
|
|
2057
2046
|
});
|
|
2058
2047
|
}
|
|
2059
2048
|
})
|
|
2060
|
-
],
|
|
2061
|
-
const
|
|
2062
|
-
...
|
|
2063
|
-
|
|
2064
|
-
|
|
2049
|
+
], $ = () => {
|
|
2050
|
+
const m = [
|
|
2051
|
+
...k,
|
|
2052
|
+
f.of(a.value === "light" ? Mt : pt),
|
|
2053
|
+
d.of(Lt(e.completions))
|
|
2065
2054
|
];
|
|
2066
|
-
return
|
|
2067
|
-
...
|
|
2055
|
+
return J.codeMirrorExtensions(a.value, m, [
|
|
2056
|
+
...g
|
|
2068
2057
|
]);
|
|
2069
2058
|
};
|
|
2070
|
-
return
|
|
2071
|
-
const
|
|
2059
|
+
return Q(() => {
|
|
2060
|
+
const m = new he({
|
|
2072
2061
|
doc: e.modelValue,
|
|
2073
|
-
parent:
|
|
2074
|
-
extensions: [
|
|
2075
|
-
}),
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
}, 0),
|
|
2079
|
-
name:
|
|
2062
|
+
parent: r.value,
|
|
2063
|
+
extensions: [$()]
|
|
2064
|
+
}), v = new bo(m);
|
|
2065
|
+
i.value = v, setTimeout(() => {
|
|
2066
|
+
v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && m.focus();
|
|
2067
|
+
}, 0), b.on(l, {
|
|
2068
|
+
name: Nt,
|
|
2080
2069
|
callback() {
|
|
2081
|
-
|
|
2070
|
+
ul(m);
|
|
2082
2071
|
}
|
|
2083
|
-
}),
|
|
2084
|
-
name:
|
|
2072
|
+
}), b.on(l, {
|
|
2073
|
+
name: Ht,
|
|
2085
2074
|
callback() {
|
|
2086
|
-
|
|
2075
|
+
dl(m);
|
|
2087
2076
|
}
|
|
2088
|
-
}),
|
|
2077
|
+
}), b.on(l, {
|
|
2089
2078
|
name: x,
|
|
2090
|
-
callback(
|
|
2091
|
-
var
|
|
2092
|
-
const { text:
|
|
2093
|
-
(
|
|
2079
|
+
callback(u, C = {}) {
|
|
2080
|
+
var M;
|
|
2081
|
+
const { text: w, options: S } = _l(u, i.value, C);
|
|
2082
|
+
(M = i.value) == null || M.replaceSelectedText(w, S, l);
|
|
2094
2083
|
}
|
|
2095
2084
|
});
|
|
2096
2085
|
}), H(
|
|
2097
2086
|
a,
|
|
2098
2087
|
() => {
|
|
2099
|
-
var
|
|
2100
|
-
(
|
|
2101
|
-
effects:
|
|
2088
|
+
var m;
|
|
2089
|
+
(m = i.value) == null || m.view.dispatch({
|
|
2090
|
+
effects: f.reconfigure(a.value === "light" ? Mt : pt)
|
|
2102
2091
|
});
|
|
2103
2092
|
},
|
|
2104
2093
|
{
|
|
@@ -2107,9 +2096,9 @@ const bo = (e) => {
|
|
|
2107
2096
|
), H(
|
|
2108
2097
|
() => e.completions,
|
|
2109
2098
|
() => {
|
|
2110
|
-
var
|
|
2111
|
-
(
|
|
2112
|
-
effects:
|
|
2099
|
+
var m;
|
|
2100
|
+
(m = i.value) == null || m.view.dispatch({
|
|
2101
|
+
effects: d.reconfigure(Lt(e.completions))
|
|
2113
2102
|
});
|
|
2114
2103
|
},
|
|
2115
2104
|
{
|
|
@@ -2118,104 +2107,123 @@ const bo = (e) => {
|
|
|
2118
2107
|
), H(
|
|
2119
2108
|
() => e.modelValue,
|
|
2120
2109
|
() => {
|
|
2121
|
-
var
|
|
2122
|
-
((
|
|
2110
|
+
var m, v;
|
|
2111
|
+
((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((v = i.value) == null || v.setValue(e.modelValue));
|
|
2123
2112
|
}
|
|
2124
2113
|
), H(
|
|
2125
2114
|
() => e.placeholder,
|
|
2126
2115
|
() => {
|
|
2127
|
-
var
|
|
2128
|
-
(
|
|
2116
|
+
var m;
|
|
2117
|
+
(m = i.value) == null || m.setPlaceholder(e.placeholder);
|
|
2129
2118
|
}
|
|
2130
2119
|
), H(
|
|
2131
2120
|
() => e.disabled,
|
|
2132
2121
|
() => {
|
|
2133
|
-
var
|
|
2134
|
-
(
|
|
2122
|
+
var m;
|
|
2123
|
+
(m = i.value) == null || m.setDisabled(e.disabled);
|
|
2135
2124
|
}
|
|
2136
2125
|
), H(
|
|
2137
2126
|
() => e.readonly,
|
|
2138
2127
|
() => {
|
|
2139
|
-
var
|
|
2140
|
-
(
|
|
2128
|
+
var m;
|
|
2129
|
+
(m = i.value) == null || m.setDisabled(e.readonly);
|
|
2141
2130
|
}
|
|
2142
2131
|
), H(
|
|
2143
2132
|
() => e.maxlength,
|
|
2144
2133
|
() => {
|
|
2145
|
-
var
|
|
2146
|
-
e.maxlength && ((
|
|
2134
|
+
var m;
|
|
2135
|
+
e.maxlength && ((m = i.value) == null || m.setMaxLength(e.maxlength));
|
|
2136
|
+
}
|
|
2137
|
+
), {
|
|
2138
|
+
inputWrapperRef: r,
|
|
2139
|
+
codeMirrorUt: i,
|
|
2140
|
+
resetHistory() {
|
|
2141
|
+
var m, v;
|
|
2142
|
+
(m = i.value) == null || m.view.dispatch({
|
|
2143
|
+
effects: s.reconfigure([])
|
|
2144
|
+
}), (v = i.value) == null || v.view.dispatch({
|
|
2145
|
+
effects: s.reconfigure(ft())
|
|
2146
|
+
});
|
|
2147
2147
|
}
|
|
2148
|
-
), Co(r), {
|
|
2149
|
-
inputWrapperRef: i,
|
|
2150
|
-
codeMirrorUt: r
|
|
2151
2148
|
};
|
|
2152
|
-
},
|
|
2149
|
+
}, yo = po, To = (e, o, l) => {
|
|
2153
2150
|
const a = G({
|
|
2154
2151
|
resizedWidth: e.inputBoxWitdh
|
|
2155
|
-
}), i = G({
|
|
2156
|
-
width: e.inputBoxWitdh
|
|
2157
2152
|
}), r = G({
|
|
2153
|
+
width: e.inputBoxWitdh
|
|
2154
|
+
}), i = G({
|
|
2158
2155
|
left: e.inputBoxWitdh,
|
|
2159
2156
|
display: "initial"
|
|
2160
|
-
}),
|
|
2161
|
-
var
|
|
2162
|
-
const
|
|
2163
|
-
let
|
|
2164
|
-
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2167
|
-
},
|
|
2168
|
-
document.addEventListener("mousemove",
|
|
2169
|
-
},
|
|
2170
|
-
document.removeEventListener("mousemove",
|
|
2157
|
+
}), h = (s) => {
|
|
2158
|
+
var m, v, u;
|
|
2159
|
+
const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, p = ((v = o.value) == null ? void 0 : v.getBoundingClientRect().x) || 0;
|
|
2160
|
+
let k = s.x - p;
|
|
2161
|
+
k < fe ? k = fe : k > g - fe && (k = g - fe);
|
|
2162
|
+
const $ = `${k}px`;
|
|
2163
|
+
r.width = $, i.left = $, a.resizedWidth = $, (u = e.onInputBoxWitdhChange) == null || u.call(e, $);
|
|
2164
|
+
}, f = () => {
|
|
2165
|
+
document.addEventListener("mousemove", h);
|
|
2166
|
+
}, d = () => {
|
|
2167
|
+
document.removeEventListener("mousemove", h);
|
|
2171
2168
|
};
|
|
2172
|
-
return
|
|
2169
|
+
return Q(() => {
|
|
2173
2170
|
var s;
|
|
2174
|
-
(s = l.value) == null || s.addEventListener("mousedown",
|
|
2175
|
-
}),
|
|
2176
|
-
var s,
|
|
2177
|
-
(s = l.value) == null || s.removeEventListener("mousedown",
|
|
2171
|
+
(s = l.value) == null || s.addEventListener("mousedown", f), document.addEventListener("mouseup", d);
|
|
2172
|
+
}), Dt(() => {
|
|
2173
|
+
var s, g;
|
|
2174
|
+
(s = l.value) == null || s.removeEventListener("mousedown", f), (g = l.value) == null || g.removeEventListener("mouseup", d);
|
|
2178
2175
|
}), H(
|
|
2179
2176
|
() => e.inputBoxWitdh,
|
|
2180
2177
|
(s) => {
|
|
2181
|
-
s && (
|
|
2178
|
+
s && (r.width = s, i.left = s);
|
|
2182
2179
|
}
|
|
2183
2180
|
), H(
|
|
2184
2181
|
[te(e.setting, "htmlPreview"), te(e.setting, "preview")],
|
|
2185
2182
|
() => {
|
|
2186
|
-
!e.setting.htmlPreview && !e.setting.preview ? (
|
|
2183
|
+
!e.setting.htmlPreview && !e.setting.preview ? (r.width = "100%", i.display = "none") : (r.width = a.resizedWidth, i.display = "initial");
|
|
2187
2184
|
},
|
|
2188
2185
|
{
|
|
2189
2186
|
immediate: !0
|
|
2190
2187
|
}
|
|
2191
|
-
), { inputWrapperStyle:
|
|
2192
|
-
},
|
|
2188
|
+
), { inputWrapperStyle: r, resizeOperateStyle: i };
|
|
2189
|
+
}, wo = To, xo = /* @__PURE__ */ W({
|
|
2193
2190
|
name: "MDEditorContent",
|
|
2194
|
-
props:
|
|
2195
|
-
setup(e) {
|
|
2196
|
-
const
|
|
2197
|
-
inputWrapperRef:
|
|
2198
|
-
codeMirrorUt:
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2191
|
+
props: fl,
|
|
2192
|
+
setup(e, o) {
|
|
2193
|
+
const l = I("editorId"), a = P(""), r = P(), i = P(), {
|
|
2194
|
+
inputWrapperRef: h,
|
|
2195
|
+
codeMirrorUt: f,
|
|
2196
|
+
resetHistory: d
|
|
2197
|
+
} = yo(e), {
|
|
2198
|
+
inputWrapperStyle: s,
|
|
2199
|
+
resizeOperateStyle: g
|
|
2200
|
+
} = wo(e, r, i);
|
|
2201
|
+
return Ul(e, a, f), o.expose({
|
|
2202
|
+
getSelectedText() {
|
|
2203
|
+
var p;
|
|
2204
|
+
return (p = f.value) == null ? void 0 : p.getSelectedText();
|
|
2205
|
+
},
|
|
2206
|
+
focus(p) {
|
|
2207
|
+
var k;
|
|
2208
|
+
(k = f.value) == null || k.focus(p);
|
|
2209
|
+
},
|
|
2210
|
+
resetHistory: d
|
|
2211
|
+
}), () => t("div", {
|
|
2204
2212
|
class: `${n}-content${e.setting.htmlPreview || e.setting.preview ? " has-preview" : ""}`,
|
|
2205
|
-
ref:
|
|
2213
|
+
ref: r
|
|
2206
2214
|
}, [t("div", {
|
|
2207
2215
|
class: `${n}-input-wrapper`,
|
|
2208
|
-
style:
|
|
2209
|
-
ref:
|
|
2216
|
+
style: s,
|
|
2217
|
+
ref: h
|
|
2210
2218
|
}, null), (e.setting.htmlPreview || e.setting.preview) && t("div", {
|
|
2211
2219
|
class: `${n}-resize-operate`,
|
|
2212
|
-
style:
|
|
2220
|
+
style: g,
|
|
2213
2221
|
ref: i
|
|
2214
|
-
}, null), t(
|
|
2222
|
+
}, null), t(hl, {
|
|
2215
2223
|
modelValue: e.modelValue,
|
|
2216
2224
|
setting: e.setting,
|
|
2217
|
-
onHtmlChanged: (
|
|
2218
|
-
|
|
2225
|
+
onHtmlChanged: (p) => {
|
|
2226
|
+
a.value = p, e.onHtmlChanged(p);
|
|
2219
2227
|
},
|
|
2220
2228
|
onGetCatalog: e.onGetCatalog,
|
|
2221
2229
|
mdHeadingId: e.mdHeadingId,
|
|
@@ -2226,15 +2234,15 @@ const bo = (e) => {
|
|
|
2226
2234
|
noHighlight: e.noHighlight,
|
|
2227
2235
|
noImgZoomIn: e.noImgZoomIn,
|
|
2228
2236
|
sanitizeMermaid: e.sanitizeMermaid
|
|
2229
|
-
}, null), e.catalogVisible && t(
|
|
2237
|
+
}, null), e.catalogVisible && t(Ft, {
|
|
2230
2238
|
theme: e.theme,
|
|
2231
2239
|
class: `${n}-catalog-editor`,
|
|
2232
|
-
editorId:
|
|
2240
|
+
editorId: l,
|
|
2233
2241
|
mdHeadingId: e.mdHeadingId,
|
|
2234
2242
|
key: "internal-catalog"
|
|
2235
2243
|
}, null)]);
|
|
2236
2244
|
}
|
|
2237
|
-
}),
|
|
2245
|
+
}), So = /* @__PURE__ */ W({
|
|
2238
2246
|
props: {
|
|
2239
2247
|
modelValue: {
|
|
2240
2248
|
type: String,
|
|
@@ -2242,7 +2250,7 @@ const bo = (e) => {
|
|
|
2242
2250
|
}
|
|
2243
2251
|
},
|
|
2244
2252
|
setup(e) {
|
|
2245
|
-
const o =
|
|
2253
|
+
const o = I("usedLanguageText");
|
|
2246
2254
|
return () => {
|
|
2247
2255
|
var l, a;
|
|
2248
2256
|
return t("div", {
|
|
@@ -2262,7 +2270,7 @@ const bo = (e) => {
|
|
|
2262
2270
|
default: () => {
|
|
2263
2271
|
}
|
|
2264
2272
|
}
|
|
2265
|
-
},
|
|
2273
|
+
}, Ao = /* @__PURE__ */ W({
|
|
2266
2274
|
props: Mo,
|
|
2267
2275
|
setup(e) {
|
|
2268
2276
|
return () => t("div", {
|
|
@@ -2272,7 +2280,7 @@ const bo = (e) => {
|
|
|
2272
2280
|
}
|
|
2273
2281
|
}, null);
|
|
2274
2282
|
}
|
|
2275
|
-
}),
|
|
2283
|
+
}), Lo = {
|
|
2276
2284
|
scrollAuto: {
|
|
2277
2285
|
type: Boolean
|
|
2278
2286
|
},
|
|
@@ -2281,10 +2289,10 @@ const bo = (e) => {
|
|
|
2281
2289
|
default: () => {
|
|
2282
2290
|
}
|
|
2283
2291
|
}
|
|
2284
|
-
},
|
|
2285
|
-
props:
|
|
2292
|
+
}, Io = /* @__PURE__ */ W({
|
|
2293
|
+
props: Lo,
|
|
2286
2294
|
setup(e) {
|
|
2287
|
-
const o =
|
|
2295
|
+
const o = I("usedLanguageText");
|
|
2288
2296
|
return () => {
|
|
2289
2297
|
var l;
|
|
2290
2298
|
return t("div", {
|
|
@@ -2294,13 +2302,13 @@ const bo = (e) => {
|
|
|
2294
2302
|
onClick: () => {
|
|
2295
2303
|
e.onScrollAutoChange(!e.scrollAuto);
|
|
2296
2304
|
}
|
|
2297
|
-
}, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(
|
|
2305
|
+
}, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Ao, {
|
|
2298
2306
|
checked: e.scrollAuto,
|
|
2299
2307
|
onChange: e.onScrollAutoChange
|
|
2300
2308
|
}, null)]);
|
|
2301
2309
|
};
|
|
2302
2310
|
}
|
|
2303
|
-
}),
|
|
2311
|
+
}), Do = {
|
|
2304
2312
|
modelValue: {
|
|
2305
2313
|
type: String,
|
|
2306
2314
|
default: ""
|
|
@@ -2320,22 +2328,22 @@ const bo = (e) => {
|
|
|
2320
2328
|
defFooters: {
|
|
2321
2329
|
type: Object
|
|
2322
2330
|
}
|
|
2323
|
-
},
|
|
2331
|
+
}, Eo = /* @__PURE__ */ W({
|
|
2324
2332
|
name: "MDEditorFooter",
|
|
2325
|
-
props:
|
|
2333
|
+
props: Do,
|
|
2326
2334
|
setup(e) {
|
|
2327
2335
|
const o = we(() => {
|
|
2328
|
-
const a = e.footers.indexOf("="),
|
|
2329
|
-
return [
|
|
2336
|
+
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);
|
|
2337
|
+
return [r, i];
|
|
2330
2338
|
}), l = (a) => {
|
|
2331
2339
|
if (Ut.includes(a))
|
|
2332
2340
|
switch (a) {
|
|
2333
2341
|
case "markdownTotal":
|
|
2334
|
-
return t(
|
|
2342
|
+
return t(So, {
|
|
2335
2343
|
modelValue: e.modelValue
|
|
2336
2344
|
}, null);
|
|
2337
2345
|
case "scrollSwitch":
|
|
2338
|
-
return t(
|
|
2346
|
+
return t(Io, {
|
|
2339
2347
|
scrollAuto: e.scrollAuto,
|
|
2340
2348
|
onScrollAutoChange: e.onScrollAutoChange
|
|
2341
2349
|
}, null);
|
|
@@ -2344,116 +2352,117 @@ const bo = (e) => {
|
|
|
2344
2352
|
return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
|
|
2345
2353
|
};
|
|
2346
2354
|
return () => {
|
|
2347
|
-
const a = o.value[0].map((
|
|
2355
|
+
const a = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
|
|
2348
2356
|
return t("div", {
|
|
2349
2357
|
class: `${n}-footer`
|
|
2350
2358
|
}, [t("div", {
|
|
2351
2359
|
class: `${n}-footer-left`
|
|
2352
2360
|
}, [a]), t("div", {
|
|
2353
2361
|
class: `${n}-footer-right`
|
|
2354
|
-
}, [
|
|
2362
|
+
}, [r])]);
|
|
2355
2363
|
};
|
|
2356
2364
|
}
|
|
2357
|
-
}),
|
|
2365
|
+
}), Ho = /* @__PURE__ */ W({
|
|
2358
2366
|
name: "MdEditorV3",
|
|
2359
|
-
props:
|
|
2360
|
-
emits:
|
|
2367
|
+
props: bl,
|
|
2368
|
+
emits: vl,
|
|
2361
2369
|
setup(e, o) {
|
|
2362
2370
|
const {
|
|
2363
2371
|
editorId: l,
|
|
2364
2372
|
noKatex: a,
|
|
2365
|
-
noMermaid:
|
|
2366
|
-
noPrettier:
|
|
2367
|
-
noUploadImg:
|
|
2368
|
-
noHighlight:
|
|
2369
|
-
} = e,
|
|
2373
|
+
noMermaid: r,
|
|
2374
|
+
noPrettier: i,
|
|
2375
|
+
noUploadImg: h,
|
|
2376
|
+
noHighlight: f
|
|
2377
|
+
} = e, d = G({
|
|
2370
2378
|
scrollAuto: e.scrollAuto
|
|
2371
|
-
});
|
|
2372
|
-
|
|
2373
|
-
const [
|
|
2374
|
-
return
|
|
2375
|
-
|
|
2376
|
-
}),
|
|
2377
|
-
var
|
|
2378
|
-
const
|
|
2379
|
+
}), s = P();
|
|
2380
|
+
kl(e, o), Cl(e), $l(e), pl(e, o);
|
|
2381
|
+
const [g, p] = yl(e, o), k = Tl(e);
|
|
2382
|
+
return Dt(() => {
|
|
2383
|
+
b.clear(l);
|
|
2384
|
+
}), wl(e, o, k, g, p, s), () => {
|
|
2385
|
+
var v;
|
|
2386
|
+
const $ = ht({
|
|
2379
2387
|
props: e,
|
|
2380
2388
|
ctx: o
|
|
2381
|
-
}, "defToolbars"),
|
|
2389
|
+
}, "defToolbars"), m = ht({
|
|
2382
2390
|
props: e,
|
|
2383
2391
|
ctx: o
|
|
2384
2392
|
}, "defFooters");
|
|
2385
2393
|
return t("div", {
|
|
2386
2394
|
id: l,
|
|
2387
|
-
class: [n, e.class, e.theme === "dark" && `${n}-dark`,
|
|
2395
|
+
class: [n, e.class, e.theme === "dark" && `${n}-dark`, g.fullscreen || g.pageFullscreen ? `${n}-fullscreen` : ""],
|
|
2388
2396
|
style: e.style
|
|
2389
|
-
}, [t(
|
|
2390
|
-
noPrettier:
|
|
2397
|
+
}, [t(Pl, {
|
|
2398
|
+
noPrettier: i,
|
|
2391
2399
|
toolbars: e.toolbars,
|
|
2392
2400
|
toolbarsExclude: e.toolbarsExclude,
|
|
2393
|
-
setting:
|
|
2394
|
-
updateSetting:
|
|
2401
|
+
setting: g,
|
|
2402
|
+
updateSetting: p,
|
|
2395
2403
|
tableShape: e.tableShape,
|
|
2396
|
-
defToolbars:
|
|
2397
|
-
noUploadImg:
|
|
2404
|
+
defToolbars: $,
|
|
2405
|
+
noUploadImg: h,
|
|
2398
2406
|
showToolbarName: e.showToolbarName
|
|
2399
|
-
}, null), t(
|
|
2407
|
+
}, null), t(xo, {
|
|
2408
|
+
ref: s,
|
|
2400
2409
|
modelValue: e.modelValue,
|
|
2401
|
-
setting:
|
|
2410
|
+
setting: g,
|
|
2402
2411
|
mdHeadingId: e.mdHeadingId,
|
|
2403
|
-
noMermaid:
|
|
2404
|
-
noPrettier:
|
|
2412
|
+
noMermaid: r,
|
|
2413
|
+
noPrettier: i,
|
|
2405
2414
|
sanitize: e.sanitize,
|
|
2406
2415
|
placeholder: e.placeholder,
|
|
2407
2416
|
noKatex: a,
|
|
2408
|
-
scrollAuto:
|
|
2417
|
+
scrollAuto: d.scrollAuto,
|
|
2409
2418
|
formatCopiedText: e.formatCopiedText,
|
|
2410
2419
|
autofocus: e.autoFocus,
|
|
2411
2420
|
disabled: e.disabled,
|
|
2412
2421
|
readonly: e.readOnly,
|
|
2413
2422
|
maxlength: e.maxLength,
|
|
2414
2423
|
autoDetectCode: e.autoDetectCode,
|
|
2415
|
-
noHighlight:
|
|
2416
|
-
onChange: (
|
|
2417
|
-
e.onChange
|
|
2424
|
+
noHighlight: f,
|
|
2425
|
+
onChange: (u) => {
|
|
2426
|
+
e.onChange && e.onChange(u), o.emit("update:modelValue", u), o.emit("onChange", u);
|
|
2418
2427
|
},
|
|
2419
|
-
onHtmlChanged: (
|
|
2420
|
-
e.onHtmlChanged
|
|
2428
|
+
onHtmlChanged: (u) => {
|
|
2429
|
+
e.onHtmlChanged && e.onHtmlChanged(u), o.emit("onHtmlChanged", u);
|
|
2421
2430
|
},
|
|
2422
|
-
onGetCatalog: (
|
|
2423
|
-
e.onGetCatalog
|
|
2431
|
+
onGetCatalog: (u) => {
|
|
2432
|
+
e.onGetCatalog && e.onGetCatalog(u), o.emit("onGetCatalog", u);
|
|
2424
2433
|
},
|
|
2425
|
-
onBlur: (
|
|
2426
|
-
e.onBlur
|
|
2434
|
+
onBlur: (u) => {
|
|
2435
|
+
e.onBlur && e.onBlur(u), o.emit("onBlur", u);
|
|
2427
2436
|
},
|
|
2428
|
-
onFocus: (
|
|
2429
|
-
e.onFocus
|
|
2437
|
+
onFocus: (u) => {
|
|
2438
|
+
e.onFocus && e.onFocus(u), o.emit("onFocus", u);
|
|
2430
2439
|
},
|
|
2431
|
-
onInput: (
|
|
2432
|
-
e.onInput
|
|
2440
|
+
onInput: (u) => {
|
|
2441
|
+
e.onInput && e.onInput(u), o.emit("onInput", u);
|
|
2433
2442
|
},
|
|
2434
2443
|
completions: e.completions,
|
|
2435
|
-
catalogVisible:
|
|
2444
|
+
catalogVisible: k.value,
|
|
2436
2445
|
theme: e.theme,
|
|
2437
2446
|
noImgZoomIn: e.noImgZoomIn,
|
|
2438
|
-
onDrop: (
|
|
2439
|
-
e.onDrop
|
|
2447
|
+
onDrop: (u) => {
|
|
2448
|
+
e.onDrop && e.onDrop(u), o.emit("onDrop", u);
|
|
2440
2449
|
},
|
|
2441
2450
|
inputBoxWitdh: e.inputBoxWitdh,
|
|
2442
|
-
onInputBoxWitdhChange: (
|
|
2443
|
-
e.onInputBoxWitdhChange
|
|
2451
|
+
onInputBoxWitdhChange: (u) => {
|
|
2452
|
+
e.onInputBoxWitdhChange && e.onInputBoxWitdhChange(u), o.emit("onInputBoxWitdhChange", u);
|
|
2444
2453
|
},
|
|
2445
2454
|
sanitizeMermaid: e.sanitizeMermaid
|
|
2446
|
-
}, null), ((
|
|
2455
|
+
}, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(Eo, {
|
|
2447
2456
|
modelValue: e.modelValue,
|
|
2448
2457
|
footers: e.footers,
|
|
2449
|
-
defFooters:
|
|
2450
|
-
scrollAuto:
|
|
2451
|
-
onScrollAutoChange: (
|
|
2458
|
+
defFooters: m,
|
|
2459
|
+
scrollAuto: d.scrollAuto,
|
|
2460
|
+
onScrollAutoChange: (u) => d.scrollAuto = u
|
|
2452
2461
|
}, null)]);
|
|
2453
2462
|
};
|
|
2454
2463
|
}
|
|
2455
|
-
}), ye =
|
|
2456
|
-
ye.install = (e) => (e.component(ye.name, ye), e.use(
|
|
2464
|
+
}), ye = Ho;
|
|
2465
|
+
ye.install = (e) => (e.component(ye.name, ye), e.use(Sl).use(Xt).use(Ml).use(Ft).use(xl), e);
|
|
2457
2466
|
export {
|
|
2458
2467
|
ye as default
|
|
2459
2468
|
};
|