md-editor-v3 4.7.0 → 4.8.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 +17 -1
- package/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +27 -27
- package/lib/cjs/MdModal.cjs +1 -1
- package/lib/cjs/MdPreview.cjs +1 -1
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/chunks/config.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +8 -1
- package/lib/cjs/chunks/index3.cjs +1 -2
- package/lib/cjs/chunks/index4.cjs +2 -8
- package/lib/cjs/config.cjs +1 -1
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/DropdownToolbar.mjs +2 -2
- package/lib/es/MdCatalog.mjs +1 -1
- package/lib/es/MdEditor.mjs +717 -674
- package/lib/es/MdModal.mjs +1 -1
- package/lib/es/MdPreview.mjs +2 -2
- package/lib/es/ModalToolbar.mjs +1 -1
- package/lib/es/chunks/config.mjs +19 -19
- package/lib/es/chunks/index.mjs +1248 -138
- package/lib/es/chunks/index2.mjs +2 -2
- package/lib/es/chunks/index3.mjs +163 -79
- package/lib/es/chunks/index4.mjs +77 -1258
- package/lib/es/config.mjs +10 -2
- package/lib/es/index.mjs +24 -17
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/Editor.d.ts +9 -0
- package/lib/types/MdEditor/config.d.ts +2 -2
- package/lib/types/MdEditor/index.d.ts +15 -0
- package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +2 -1
- package/lib/types/MdEditor/layouts/Content/composition/useResize.d.ts +12 -0
- package/lib/types/MdEditor/layouts/Content/index.d.ts +6 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +3 -0
- package/lib/types/MdEditor/props.d.ts +10 -0
- package/lib/types/config.d.ts +3 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/umd/index.js +31 -31
- package/package.json +1 -1
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ft = (e, o, l) => o in e ?
|
|
1
|
+
var Bt = Object.defineProperty;
|
|
2
|
+
var Ft = (e, o, l) => o in e ? Bt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
|
|
3
3
|
var q = (e, o, l) => (Ft(e, typeof o != "symbol" ? o + "" : o, l), l);
|
|
4
|
-
import { defineComponent as P, createVNode as t, inject as A, ref as
|
|
5
|
-
import { p as n,
|
|
6
|
-
import { draggingScroll as
|
|
7
|
-
import {
|
|
8
|
-
import { b as
|
|
4
|
+
import { defineComponent as P, createVNode as t, inject as A, ref as U, onMounted as Y, reactive as G, computed as Te, watch as O, nextTick as he, Fragment as Mt, cloneVNode as mt, toRef as te, shallowRef as Rt, onBeforeUnmount as Lt } from "vue";
|
|
5
|
+
import { p as n, e as Q, n as Pt, b as Wt, d as Ut } from "./chunks/config.mjs";
|
|
6
|
+
import { draggingScroll as _t, linkTo as qt, debounce as zt, createSmoothScroll as Gt, throttle as Kt } from "@vavt/util";
|
|
7
|
+
import { a as se, D as jt } from "./chunks/index2.mjs";
|
|
8
|
+
import { b as v, h as Zt, E as le, U as we, i as Xt, j as ye, R as x, c as Yt, O as Dt, k as Et, l as It, T as Jt } from "./chunks/index4.mjs";
|
|
9
9
|
import { a as Qt } from "./chunks/dom.mjs";
|
|
10
|
-
import { M as
|
|
10
|
+
import { M as Ht, I as y } from "./chunks/index3.mjs";
|
|
11
11
|
import { minimalSetup as el, EditorView as ge } from "codemirror";
|
|
12
12
|
import { EditorView as xe, placeholder as tl, keymap as ll } from "@codemirror/view";
|
|
13
13
|
import { languages as ol } from "@codemirror/language-data";
|
|
14
14
|
import { markdown as al } from "@codemirror/lang-markdown";
|
|
15
|
-
import { EditorSelection as
|
|
15
|
+
import { EditorSelection as z, EditorState as ke, Compartment as be, StateEffect as nl } from "@codemirror/state";
|
|
16
16
|
import { deleteLine as rl, indentWithTab as il, undo as sl, redo as cl } from "@codemirror/commands";
|
|
17
|
-
import { HighlightStyle as
|
|
18
|
-
import { tags as
|
|
17
|
+
import { HighlightStyle as Nt, syntaxHighlighting as Ot, indentUnit as ul } from "@codemirror/language";
|
|
18
|
+
import { tags as c } from "@lezer/highlight";
|
|
19
19
|
import { autocompletion as dl } from "@codemirror/autocomplete";
|
|
20
|
-
import { c as ml, C as gl, e as fl, a as bl, u as hl, b as vl, d as kl, f as Cl, g as pl, h as $l, i as yl, M as Tl } from "./chunks/
|
|
21
|
-
import
|
|
20
|
+
import { c as ml, C as gl, e as fl, a as bl, u as hl, b as vl, d as kl, f as Cl, g as pl, h as $l, i as yl, M as Tl } from "./chunks/index.mjs";
|
|
21
|
+
import Vt from "./MdCatalog.mjs";
|
|
22
22
|
import { g as gt } from "./chunks/vue-tsx.mjs";
|
|
23
23
|
import wl from "./NormalToolbar.mjs";
|
|
24
24
|
import xl from "./ModalToolbar.mjs";
|
|
@@ -84,36 +84,36 @@ const Sl = /* @__PURE__ */ P({
|
|
|
84
84
|
type: Boolean
|
|
85
85
|
}
|
|
86
86
|
}, Ml = (e) => {
|
|
87
|
-
var u,
|
|
87
|
+
var u, s, f, w;
|
|
88
88
|
const o = A("editorId");
|
|
89
|
-
let l = (
|
|
90
|
-
const a = (
|
|
89
|
+
let l = (s = (u = Q.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : s.instance;
|
|
90
|
+
const a = (w = (f = Q.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : w.js, r = U(!1), i = (k) => {
|
|
91
91
|
if (!l) {
|
|
92
|
-
|
|
92
|
+
v.emit(o, le, {
|
|
93
93
|
name: "fullscreen",
|
|
94
94
|
message: "fullscreen is undefined"
|
|
95
95
|
});
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
l.isEnabled ? (
|
|
98
|
+
l.isEnabled ? (r.value = !0, (k === void 0 ? !l.isFullscreen : k) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
|
|
99
99
|
}, m = () => {
|
|
100
100
|
l && l.isEnabled && l.on("change", () => {
|
|
101
|
-
(
|
|
101
|
+
(r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
|
|
102
102
|
});
|
|
103
103
|
}, g = () => {
|
|
104
104
|
l = window.screenfull, m();
|
|
105
105
|
};
|
|
106
|
-
return
|
|
106
|
+
return Y(() => {
|
|
107
107
|
if (m(), !l) {
|
|
108
|
-
const
|
|
109
|
-
|
|
108
|
+
const k = document.createElement("script");
|
|
109
|
+
k.src = a || Pt, k.onload = g, k.id = `${n}-screenfull`, Qt(k, "screenfull");
|
|
110
110
|
}
|
|
111
|
-
}),
|
|
112
|
-
|
|
111
|
+
}), Y(() => {
|
|
112
|
+
v.on(o, {
|
|
113
113
|
name: Zt,
|
|
114
|
-
callback:
|
|
114
|
+
callback: i
|
|
115
115
|
});
|
|
116
|
-
}), { fullscreenHandler:
|
|
116
|
+
}), { fullscreenHandler: i };
|
|
117
117
|
}, Ll = {
|
|
118
118
|
tableShape: {
|
|
119
119
|
type: Array,
|
|
@@ -128,7 +128,7 @@ const Sl = /* @__PURE__ */ P({
|
|
|
128
128
|
name: "TableShape",
|
|
129
129
|
props: Ll,
|
|
130
130
|
setup(e) {
|
|
131
|
-
const o =
|
|
131
|
+
const o = G({
|
|
132
132
|
x: -1,
|
|
133
133
|
y: -1
|
|
134
134
|
});
|
|
@@ -140,20 +140,20 @@ const Sl = /* @__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
|
+
}), El = Dl, Il = {
|
|
157
157
|
type: {
|
|
158
158
|
type: String,
|
|
159
159
|
default: "link"
|
|
@@ -173,46 +173,46 @@ const Sl = /* @__PURE__ */ P({
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}, Hl = /* @__PURE__ */ P({
|
|
176
|
-
props:
|
|
176
|
+
props: Il,
|
|
177
177
|
setup(e) {
|
|
178
178
|
const o = A("usedLanguageText"), l = A("editorId"), a = Te(() => {
|
|
179
|
-
var
|
|
179
|
+
var i, m;
|
|
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
184
|
return (m = o.value.linkModalTips) == null ? void 0 : m.imageTitle;
|
|
185
185
|
default:
|
|
186
186
|
return "";
|
|
187
187
|
}
|
|
188
|
-
}),
|
|
188
|
+
}), r = G({
|
|
189
189
|
desc: "",
|
|
190
190
|
url: ""
|
|
191
191
|
});
|
|
192
|
-
return
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
return O(() => e.visible, (i) => {
|
|
193
|
+
i || setTimeout(() => {
|
|
194
|
+
r.desc = "", r.url = "";
|
|
195
195
|
}, 200);
|
|
196
|
-
}), () => t(
|
|
196
|
+
}), () => t(Ht, {
|
|
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, m, g, u, 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
|
-
}, [(
|
|
208
|
+
}, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
|
|
209
209
|
placeholder: (m = o.value.linkModalTips) == null ? void 0 : m.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: (f) => {
|
|
215
|
+
r.desc = f.target.value;
|
|
216
216
|
},
|
|
217
217
|
autocomplete: "off"
|
|
218
218
|
}, null)]), t("div", {
|
|
@@ -225,9 +225,9 @@ const Sl = /* @__PURE__ */ P({
|
|
|
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: (f) => {
|
|
230
|
+
r.url = f.target.value;
|
|
231
231
|
},
|
|
232
232
|
autocomplete: "off"
|
|
233
233
|
}, null)]), t("div", {
|
|
@@ -236,9 +236,9 @@ const Sl = /* @__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
|
}
|
|
@@ -260,10 +260,10 @@ const Sl = /* @__PURE__ */ P({
|
|
|
260
260
|
}, Ol = /* @__PURE__ */ P({
|
|
261
261
|
props: Nl,
|
|
262
262
|
setup(e) {
|
|
263
|
-
var
|
|
263
|
+
var f, w, k;
|
|
264
264
|
const o = A("usedLanguageText"), l = A("editorId");
|
|
265
|
-
let a = (
|
|
266
|
-
const
|
|
265
|
+
let a = (k = (w = (f = Q) == null ? void 0 : f.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : k.instance;
|
|
266
|
+
const r = U(), i = U(), m = U(), g = G({
|
|
267
267
|
cropperInited: !1,
|
|
268
268
|
imgSelected: !1,
|
|
269
269
|
imgSrc: "",
|
|
@@ -271,60 +271,60 @@ const Sl = /* @__PURE__ */ P({
|
|
|
271
271
|
isFullscreen: !1
|
|
272
272
|
});
|
|
273
273
|
let u = null;
|
|
274
|
-
|
|
275
|
-
e.visible && !g.cropperInited && (a = a || window.Cropper,
|
|
274
|
+
O(() => e.visible, () => {
|
|
275
|
+
e.visible && !g.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
|
|
276
276
|
if (!a) {
|
|
277
|
-
|
|
277
|
+
v.emit(l, le, {
|
|
278
278
|
name: "Cropper",
|
|
279
279
|
message: "Cropper is undefined"
|
|
280
280
|
});
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
const d =
|
|
283
|
+
const d = r.value.files || [];
|
|
284
284
|
if (g.imgSelected = !0, (d == null ? void 0 : d.length) > 0) {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
g.imgSrc =
|
|
288
|
-
u = new a(
|
|
285
|
+
const C = new FileReader();
|
|
286
|
+
C.onload = (h) => {
|
|
287
|
+
g.imgSrc = h.target.result, he(() => {
|
|
288
|
+
u = 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
|
+
}, C.readAsDataURL(d[0]);
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
|
-
}),
|
|
297
|
+
}), O(() => [g.imgSelected], () => {
|
|
298
298
|
m.value.style = "";
|
|
299
|
-
}),
|
|
299
|
+
}), O(() => g.isFullscreen, () => {
|
|
300
300
|
he(() => {
|
|
301
|
-
u == null || u.destroy(), m.value.style = "",
|
|
301
|
+
u == null || u.destroy(), m.value.style = "", i.value && (u = new a(i.value, {
|
|
302
302
|
viewMode: 2,
|
|
303
303
|
preview: `.${n}-clip-preview-target`
|
|
304
304
|
// aspectRatio: 16 / 9,
|
|
305
305
|
}));
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
|
-
const
|
|
309
|
-
u.clear(), u.destroy(), u = null,
|
|
308
|
+
const s = () => {
|
|
309
|
+
u.clear(), u.destroy(), u = null, r.value.value = "", g.imgSelected = !1;
|
|
310
310
|
};
|
|
311
311
|
return () => {
|
|
312
312
|
var d;
|
|
313
|
-
return t(
|
|
313
|
+
return t(Ht, {
|
|
314
314
|
class: `${n}-modal-clip`,
|
|
315
315
|
title: (d = o.value.clipModalTips) == null ? void 0 : d.title,
|
|
316
316
|
visible: e.visible,
|
|
317
317
|
onClose: e.onCancel,
|
|
318
318
|
showAdjust: !0,
|
|
319
319
|
isFullscreen: g.isFullscreen,
|
|
320
|
-
onAdjust: (
|
|
321
|
-
g.isFullscreen =
|
|
320
|
+
onAdjust: (C) => {
|
|
321
|
+
g.isFullscreen = C;
|
|
322
322
|
},
|
|
323
323
|
width: "668px",
|
|
324
324
|
height: "421px"
|
|
325
325
|
}, {
|
|
326
326
|
default: () => {
|
|
327
|
-
var
|
|
327
|
+
var C, h;
|
|
328
328
|
return [t("div", {
|
|
329
329
|
class: `${n}-form-item ${n}-clip`
|
|
330
330
|
}, [t("div", {
|
|
@@ -333,22 +333,22 @@ const Sl = /* @__PURE__ */ P({
|
|
|
333
333
|
class: `${n}-clip-cropper`
|
|
334
334
|
}, [t("img", {
|
|
335
335
|
src: g.imgSrc,
|
|
336
|
-
ref:
|
|
336
|
+
ref: i,
|
|
337
337
|
style: {
|
|
338
338
|
display: "none"
|
|
339
339
|
},
|
|
340
340
|
alt: ""
|
|
341
341
|
}, null), t("div", {
|
|
342
342
|
class: `${n}-clip-delete`,
|
|
343
|
-
onClick:
|
|
344
|
-
}, [t(
|
|
343
|
+
onClick: s
|
|
344
|
+
}, [t(y, {
|
|
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(y, {
|
|
352
352
|
name: "upload"
|
|
353
353
|
}, null)])]), t("div", {
|
|
354
354
|
class: `${n}-clip-preview`
|
|
@@ -362,12 +362,12 @@ const Sl = /* @__PURE__ */ P({
|
|
|
362
362
|
type: "button",
|
|
363
363
|
onClick: () => {
|
|
364
364
|
if (u) {
|
|
365
|
-
const
|
|
366
|
-
|
|
365
|
+
const b = u.getCroppedCanvas();
|
|
366
|
+
v.emit(l, we, [Xt(b.toDataURL("image/png"))], e.onOk), s();
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
}, [((
|
|
370
|
-
ref:
|
|
369
|
+
}, [((C = o.value.clipModalTips) == null ? void 0 : C.buttonUpload) || ((h = o.value.linkModalTips) == null ? void 0 : h.buttonOK)])]), t("input", {
|
|
370
|
+
ref: r,
|
|
371
371
|
accept: "image/*",
|
|
372
372
|
type: "file",
|
|
373
373
|
multiple: !1,
|
|
@@ -402,7 +402,7 @@ const Sl = /* @__PURE__ */ P({
|
|
|
402
402
|
default: () => {
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
},
|
|
405
|
+
}, Bl = /* @__PURE__ */ P({
|
|
406
406
|
props: Vl,
|
|
407
407
|
setup(e) {
|
|
408
408
|
return () => t(Mt, null, [t(Hl, {
|
|
@@ -416,13 +416,13 @@ const Sl = /* @__PURE__ */ P({
|
|
|
416
416
|
onCancel: e.onCancel
|
|
417
417
|
}, null)]);
|
|
418
418
|
}
|
|
419
|
-
}),
|
|
419
|
+
}), Fl = /* @__PURE__ */ P({
|
|
420
420
|
name: "MDEditorToolbar",
|
|
421
421
|
props: Al,
|
|
422
422
|
setup(e) {
|
|
423
|
-
const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"),
|
|
424
|
-
fullscreenHandler:
|
|
425
|
-
} = Ml(e), m = `${o}-toolbar-wrapper`, g =
|
|
423
|
+
const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"), r = A("language"), {
|
|
424
|
+
fullscreenHandler: i
|
|
425
|
+
} = Ml(e), m = `${o}-toolbar-wrapper`, g = U(), u = G({
|
|
426
426
|
title: !1,
|
|
427
427
|
catalog: !1,
|
|
428
428
|
// 图片上传下拉
|
|
@@ -432,44 +432,44 @@ const Sl = /* @__PURE__ */ P({
|
|
|
432
432
|
// mermaid
|
|
433
433
|
mermaid: !1,
|
|
434
434
|
katex: !1
|
|
435
|
-
}),
|
|
436
|
-
|
|
437
|
-
},
|
|
435
|
+
}), s = (b, p) => {
|
|
436
|
+
v.emit(o, x, b, p);
|
|
437
|
+
}, f = G({
|
|
438
438
|
type: "link",
|
|
439
439
|
linkVisible: !1,
|
|
440
440
|
clipVisible: !1
|
|
441
|
-
}),
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
}), w = U();
|
|
442
|
+
Y(() => {
|
|
443
|
+
v.on(o, {
|
|
444
444
|
name: ye,
|
|
445
|
-
callback(
|
|
446
|
-
|
|
445
|
+
callback(b) {
|
|
446
|
+
f.type = b, f.linkVisible = !0;
|
|
447
447
|
}
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
|
-
const
|
|
451
|
-
const
|
|
450
|
+
const k = Te(() => {
|
|
451
|
+
const b = e.toolbars.filter((D) => !e.toolbarsExclude.includes(D)), p = b.indexOf("="), T = p === -1 ? b : b.slice(0, p + 1), S = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
|
|
452
452
|
return [T, S];
|
|
453
|
-
}), d =
|
|
454
|
-
|
|
453
|
+
}), d = U(), C = () => {
|
|
454
|
+
v.emit(o, we, Array.from(d.value.files || [])), d.value.value = "";
|
|
455
455
|
};
|
|
456
|
-
|
|
457
|
-
d.value.addEventListener("change",
|
|
456
|
+
Y(() => {
|
|
457
|
+
d.value.addEventListener("change", C);
|
|
458
458
|
});
|
|
459
|
-
const
|
|
460
|
-
var
|
|
461
|
-
if (
|
|
462
|
-
switch (
|
|
459
|
+
const h = (b) => {
|
|
460
|
+
var p, T, S, D, E, oe, ae, M, L, _, W, V, H, N, B, K, j, de, ne, J, Z, re, X, F, R, ie, me, Se, Ae, Me, Le, De, Ee, Ie, He, Ne, Oe, Ve, Be, Fe, Re, Pe, We, Ue, _e, qe, ze, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st, ct, ut, dt;
|
|
461
|
+
if (Wt.includes(b))
|
|
462
|
+
switch (b) {
|
|
463
463
|
case "-":
|
|
464
464
|
return t(Sl, null, null);
|
|
465
465
|
case "bold":
|
|
466
466
|
return t("div", {
|
|
467
467
|
class: `${n}-toolbar-item`,
|
|
468
|
-
title: (
|
|
468
|
+
title: (p = l.value.toolbarTips) == null ? void 0 : p.bold,
|
|
469
469
|
onClick: () => {
|
|
470
|
-
|
|
470
|
+
s("bold");
|
|
471
471
|
}
|
|
472
|
-
}, [t(
|
|
472
|
+
}, [t(y, {
|
|
473
473
|
name: "bold"
|
|
474
474
|
}, null), e.showToolbarName && t("div", {
|
|
475
475
|
class: `${n}-toolbar-item-name`
|
|
@@ -479,9 +479,9 @@ const Sl = /* @__PURE__ */ P({
|
|
|
479
479
|
class: `${n}-toolbar-item`,
|
|
480
480
|
title: (S = l.value.toolbarTips) == null ? void 0 : S.underline,
|
|
481
481
|
onClick: () => {
|
|
482
|
-
|
|
482
|
+
s("underline");
|
|
483
483
|
}
|
|
484
|
-
}, [t(
|
|
484
|
+
}, [t(y, {
|
|
485
485
|
name: "underline"
|
|
486
486
|
}, null), e.showToolbarName && t("div", {
|
|
487
487
|
class: `${n}-toolbar-item-name`
|
|
@@ -489,33 +489,33 @@ const Sl = /* @__PURE__ */ P({
|
|
|
489
489
|
case "italic":
|
|
490
490
|
return t("div", {
|
|
491
491
|
class: `${n}-toolbar-item`,
|
|
492
|
-
title: (
|
|
492
|
+
title: (E = l.value.toolbarTips) == null ? void 0 : E.italic,
|
|
493
493
|
onClick: () => {
|
|
494
|
-
|
|
494
|
+
s("italic");
|
|
495
495
|
}
|
|
496
|
-
}, [t(
|
|
496
|
+
}, [t(y, {
|
|
497
497
|
name: "italic"
|
|
498
498
|
}, null), e.showToolbarName && t("div", {
|
|
499
499
|
class: `${n}-toolbar-item-name`
|
|
500
|
-
}, [(
|
|
500
|
+
}, [(oe = l.value.toolbarTips) == null ? void 0 : oe.italic])]);
|
|
501
501
|
case "strikeThrough":
|
|
502
502
|
return t("div", {
|
|
503
503
|
class: `${n}-toolbar-item`,
|
|
504
|
-
title: (
|
|
504
|
+
title: (ae = l.value.toolbarTips) == null ? void 0 : ae.strikeThrough,
|
|
505
505
|
onClick: () => {
|
|
506
|
-
|
|
506
|
+
s("strikeThrough");
|
|
507
507
|
}
|
|
508
|
-
}, [t(
|
|
508
|
+
}, [t(y, {
|
|
509
509
|
name: "strike-through"
|
|
510
510
|
}, null), e.showToolbarName && t("div", {
|
|
511
511
|
class: `${n}-toolbar-item-name`
|
|
512
512
|
}, [(M = l.value.toolbarTips) == null ? void 0 : M.strikeThrough])]);
|
|
513
513
|
case "title":
|
|
514
|
-
return t(
|
|
514
|
+
return t(se, {
|
|
515
515
|
relative: `#${m}`,
|
|
516
516
|
visible: u.title,
|
|
517
|
-
onChange: (
|
|
518
|
-
u.title =
|
|
517
|
+
onChange: ($) => {
|
|
518
|
+
u.title = $;
|
|
519
519
|
},
|
|
520
520
|
overlay: t("ul", {
|
|
521
521
|
class: `${n}-menu`,
|
|
@@ -523,57 +523,57 @@ const Sl = /* @__PURE__ */ P({
|
|
|
523
523
|
u.title = !1;
|
|
524
524
|
}
|
|
525
525
|
}, [t("li", {
|
|
526
|
-
class: `${n}-menu-item`,
|
|
526
|
+
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
527
527
|
onClick: () => {
|
|
528
|
-
|
|
528
|
+
s("h1");
|
|
529
529
|
}
|
|
530
530
|
}, [(L = l.value.titleItem) == null ? void 0 : L.h1]), t("li", {
|
|
531
|
-
class: `${n}-menu-item`,
|
|
531
|
+
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
532
532
|
onClick: () => {
|
|
533
|
-
|
|
533
|
+
s("h2");
|
|
534
534
|
}
|
|
535
535
|
}, [(_ = l.value.titleItem) == null ? void 0 : _.h2]), t("li", {
|
|
536
|
-
class: `${n}-menu-item`,
|
|
536
|
+
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
537
537
|
onClick: () => {
|
|
538
|
-
|
|
538
|
+
s("h3");
|
|
539
539
|
}
|
|
540
|
-
}, [(
|
|
541
|
-
class: `${n}-menu-item`,
|
|
540
|
+
}, [(W = l.value.titleItem) == null ? void 0 : W.h3]), t("li", {
|
|
541
|
+
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
542
542
|
onClick: () => {
|
|
543
|
-
|
|
543
|
+
s("h4");
|
|
544
544
|
}
|
|
545
|
-
}, [(
|
|
546
|
-
class: `${n}-menu-item`,
|
|
545
|
+
}, [(V = l.value.titleItem) == null ? void 0 : V.h4]), t("li", {
|
|
546
|
+
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
547
547
|
onClick: () => {
|
|
548
|
-
|
|
548
|
+
s("h5");
|
|
549
549
|
}
|
|
550
550
|
}, [(H = l.value.titleItem) == null ? void 0 : H.h5]), t("li", {
|
|
551
|
-
class: `${n}-menu-item`,
|
|
551
|
+
class: `${n}-menu-item ${n}-menu-item-title`,
|
|
552
552
|
onClick: () => {
|
|
553
|
-
|
|
553
|
+
s("h6");
|
|
554
554
|
}
|
|
555
555
|
}, [(N = l.value.titleItem) == null ? void 0 : N.h6])])
|
|
556
556
|
}, {
|
|
557
557
|
default: () => {
|
|
558
|
-
var
|
|
558
|
+
var $, I;
|
|
559
559
|
return [t("div", {
|
|
560
560
|
class: `${n}-toolbar-item`,
|
|
561
|
-
title: (
|
|
562
|
-
}, [t(
|
|
561
|
+
title: ($ = l.value.toolbarTips) == null ? void 0 : $.title
|
|
562
|
+
}, [t(y, {
|
|
563
563
|
name: "title"
|
|
564
564
|
}, null), e.showToolbarName && t("div", {
|
|
565
565
|
class: `${n}-toolbar-item-name`
|
|
566
|
-
}, [(
|
|
566
|
+
}, [(I = l.value.toolbarTips) == null ? void 0 : I.title])])];
|
|
567
567
|
}
|
|
568
568
|
});
|
|
569
569
|
case "sub":
|
|
570
570
|
return t("div", {
|
|
571
571
|
class: `${n}-toolbar-item`,
|
|
572
|
-
title: (
|
|
572
|
+
title: (B = l.value.toolbarTips) == null ? void 0 : B.sub,
|
|
573
573
|
onClick: () => {
|
|
574
|
-
|
|
574
|
+
s("sub");
|
|
575
575
|
}
|
|
576
|
-
}, [t(
|
|
576
|
+
}, [t(y, {
|
|
577
577
|
name: "sub"
|
|
578
578
|
}, null), e.showToolbarName && t("div", {
|
|
579
579
|
class: `${n}-toolbar-item-name`
|
|
@@ -581,71 +581,71 @@ const Sl = /* @__PURE__ */ P({
|
|
|
581
581
|
case "sup":
|
|
582
582
|
return t("div", {
|
|
583
583
|
class: `${n}-toolbar-item`,
|
|
584
|
-
title: (
|
|
584
|
+
title: (j = l.value.toolbarTips) == null ? void 0 : j.sup,
|
|
585
585
|
onClick: () => {
|
|
586
|
-
|
|
586
|
+
s("sup");
|
|
587
587
|
}
|
|
588
|
-
}, [t(
|
|
588
|
+
}, [t(y, {
|
|
589
589
|
name: "sup"
|
|
590
590
|
}, null), e.showToolbarName && t("div", {
|
|
591
591
|
class: `${n}-toolbar-item-name`
|
|
592
|
-
}, [(
|
|
592
|
+
}, [(de = l.value.toolbarTips) == null ? void 0 : de.sup])]);
|
|
593
593
|
case "quote":
|
|
594
594
|
return t("div", {
|
|
595
595
|
class: `${n}-toolbar-item`,
|
|
596
|
-
title: (
|
|
596
|
+
title: (ne = l.value.toolbarTips) == null ? void 0 : ne.quote,
|
|
597
597
|
onClick: () => {
|
|
598
|
-
|
|
598
|
+
s("quote");
|
|
599
599
|
}
|
|
600
|
-
}, [t(
|
|
600
|
+
}, [t(y, {
|
|
601
601
|
name: "quote"
|
|
602
602
|
}, null), e.showToolbarName && t("div", {
|
|
603
603
|
class: `${n}-toolbar-item-name`
|
|
604
|
-
}, [(
|
|
604
|
+
}, [(J = l.value.toolbarTips) == null ? void 0 : J.quote])]);
|
|
605
605
|
case "unorderedList":
|
|
606
606
|
return t("div", {
|
|
607
607
|
class: `${n}-toolbar-item`,
|
|
608
|
-
title: (
|
|
608
|
+
title: (Z = l.value.toolbarTips) == null ? void 0 : Z.unorderedList,
|
|
609
609
|
onClick: () => {
|
|
610
|
-
|
|
610
|
+
s("unorderedList");
|
|
611
611
|
}
|
|
612
|
-
}, [t(
|
|
612
|
+
}, [t(y, {
|
|
613
613
|
name: "unordered-list"
|
|
614
614
|
}, null), e.showToolbarName && t("div", {
|
|
615
615
|
class: `${n}-toolbar-item-name`
|
|
616
|
-
}, [(
|
|
616
|
+
}, [(re = l.value.toolbarTips) == null ? void 0 : re.unorderedList])]);
|
|
617
617
|
case "orderedList":
|
|
618
618
|
return t("div", {
|
|
619
619
|
class: `${n}-toolbar-item`,
|
|
620
|
-
title: (
|
|
620
|
+
title: (X = l.value.toolbarTips) == null ? void 0 : X.orderedList,
|
|
621
621
|
onClick: () => {
|
|
622
|
-
|
|
622
|
+
s("orderedList");
|
|
623
623
|
}
|
|
624
|
-
}, [t(
|
|
624
|
+
}, [t(y, {
|
|
625
625
|
name: "ordered-list"
|
|
626
626
|
}, null), e.showToolbarName && t("div", {
|
|
627
627
|
class: `${n}-toolbar-item-name`
|
|
628
|
-
}, [(
|
|
628
|
+
}, [(F = l.value.toolbarTips) == null ? void 0 : F.orderedList])]);
|
|
629
629
|
case "task":
|
|
630
630
|
return t("div", {
|
|
631
631
|
class: `${n}-toolbar-item`,
|
|
632
632
|
title: (R = l.value.toolbarTips) == null ? void 0 : R.task,
|
|
633
633
|
onClick: () => {
|
|
634
|
-
|
|
634
|
+
s("task");
|
|
635
635
|
}
|
|
636
|
-
}, [t(
|
|
636
|
+
}, [t(y, {
|
|
637
637
|
name: "task"
|
|
638
638
|
}, null), e.showToolbarName && t("div", {
|
|
639
639
|
class: `${n}-toolbar-item-name`
|
|
640
|
-
}, [(
|
|
640
|
+
}, [(ie = l.value.toolbarTips) == null ? void 0 : ie.task])]);
|
|
641
641
|
case "codeRow":
|
|
642
642
|
return t("div", {
|
|
643
643
|
class: `${n}-toolbar-item`,
|
|
644
|
-
title: (
|
|
644
|
+
title: (me = l.value.toolbarTips) == null ? void 0 : me.codeRow,
|
|
645
645
|
onClick: () => {
|
|
646
|
-
|
|
646
|
+
s("codeRow");
|
|
647
647
|
}
|
|
648
|
-
}, [t(
|
|
648
|
+
}, [t(y, {
|
|
649
649
|
name: "code-row"
|
|
650
650
|
}, null), e.showToolbarName && t("div", {
|
|
651
651
|
class: `${n}-toolbar-item-name`
|
|
@@ -655,9 +655,9 @@ const Sl = /* @__PURE__ */ P({
|
|
|
655
655
|
class: `${n}-toolbar-item`,
|
|
656
656
|
title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
|
|
657
657
|
onClick: () => {
|
|
658
|
-
|
|
658
|
+
s("code");
|
|
659
659
|
}
|
|
660
|
-
}, [t(
|
|
660
|
+
}, [t(y, {
|
|
661
661
|
name: "code"
|
|
662
662
|
}, null), e.showToolbarName && t("div", {
|
|
663
663
|
class: `${n}-toolbar-item-name`
|
|
@@ -667,9 +667,9 @@ const Sl = /* @__PURE__ */ P({
|
|
|
667
667
|
class: `${n}-toolbar-item`,
|
|
668
668
|
title: (Le = l.value.toolbarTips) == null ? void 0 : Le.link,
|
|
669
669
|
onClick: () => {
|
|
670
|
-
|
|
670
|
+
f.type = "link", f.linkVisible = !0;
|
|
671
671
|
}
|
|
672
|
-
}, [t(
|
|
672
|
+
}, [t(y, {
|
|
673
673
|
name: "link"
|
|
674
674
|
}, null), e.showToolbarName && t("div", {
|
|
675
675
|
class: `${n}-toolbar-item-name`
|
|
@@ -677,19 +677,19 @@ const Sl = /* @__PURE__ */ P({
|
|
|
677
677
|
case "image":
|
|
678
678
|
return e.noUploadImg ? t("div", {
|
|
679
679
|
class: `${n}-toolbar-item`,
|
|
680
|
-
title: (
|
|
680
|
+
title: (Ee = l.value.toolbarTips) == null ? void 0 : Ee.image,
|
|
681
681
|
onClick: () => {
|
|
682
|
-
|
|
682
|
+
f.type = "image", f.linkVisible = !0;
|
|
683
683
|
}
|
|
684
|
-
}, [t(
|
|
684
|
+
}, [t(y, {
|
|
685
685
|
name: "image"
|
|
686
686
|
}, null), e.showToolbarName && t("div", {
|
|
687
687
|
class: `${n}-toolbar-item-name`
|
|
688
|
-
}, [(
|
|
688
|
+
}, [(Ie = l.value.toolbarTips) == null ? void 0 : Ie.image])]) : t(se, {
|
|
689
689
|
relative: `#${m}`,
|
|
690
690
|
visible: u.image,
|
|
691
|
-
onChange: (
|
|
692
|
-
u.image =
|
|
691
|
+
onChange: ($) => {
|
|
692
|
+
u.image = $;
|
|
693
693
|
},
|
|
694
694
|
overlay: t("ul", {
|
|
695
695
|
class: `${n}-menu`,
|
|
@@ -697,61 +697,61 @@ const Sl = /* @__PURE__ */ P({
|
|
|
697
697
|
u.title = !1;
|
|
698
698
|
}
|
|
699
699
|
}, [t("li", {
|
|
700
|
-
class: `${n}-menu-item`,
|
|
700
|
+
class: `${n}-menu-item ${n}-menu-item-image`,
|
|
701
701
|
onClick: () => {
|
|
702
|
-
|
|
702
|
+
f.type = "image", f.linkVisible = !0;
|
|
703
703
|
}
|
|
704
704
|
}, [(He = l.value.imgTitleItem) == null ? void 0 : He.link]), t("li", {
|
|
705
|
-
class: `${n}-menu-item`,
|
|
705
|
+
class: `${n}-menu-item ${n}-menu-item-image`,
|
|
706
706
|
onClick: () => {
|
|
707
707
|
d.value.click();
|
|
708
708
|
}
|
|
709
709
|
}, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.upload]), t("li", {
|
|
710
|
-
class: `${n}-menu-item`,
|
|
710
|
+
class: `${n}-menu-item ${n}-menu-item-image`,
|
|
711
711
|
onClick: () => {
|
|
712
|
-
|
|
712
|
+
f.clipVisible = !0;
|
|
713
713
|
}
|
|
714
714
|
}, [(Oe = l.value.imgTitleItem) == null ? void 0 : Oe.clip2upload])])
|
|
715
715
|
}, {
|
|
716
716
|
default: () => {
|
|
717
|
-
var
|
|
717
|
+
var $, I;
|
|
718
718
|
return [t("div", {
|
|
719
719
|
class: `${n}-toolbar-item`,
|
|
720
|
-
title: (
|
|
721
|
-
}, [t(
|
|
720
|
+
title: ($ = l.value.toolbarTips) == null ? void 0 : $.image
|
|
721
|
+
}, [t(y, {
|
|
722
722
|
name: "image"
|
|
723
723
|
}, null), e.showToolbarName && t("div", {
|
|
724
724
|
class: `${n}-toolbar-item-name`
|
|
725
|
-
}, [(
|
|
725
|
+
}, [(I = l.value.toolbarTips) == null ? void 0 : I.image])])];
|
|
726
726
|
}
|
|
727
727
|
});
|
|
728
728
|
case "table":
|
|
729
|
-
return t(
|
|
729
|
+
return t(se, {
|
|
730
730
|
relative: `#${m}`,
|
|
731
731
|
visible: u.table,
|
|
732
|
-
onChange: (
|
|
733
|
-
u.table =
|
|
732
|
+
onChange: ($) => {
|
|
733
|
+
u.table = $;
|
|
734
734
|
},
|
|
735
735
|
key: "bar-table",
|
|
736
|
-
overlay: t(
|
|
736
|
+
overlay: t(El, {
|
|
737
737
|
tableShape: e.tableShape,
|
|
738
|
-
onSelected: (
|
|
739
|
-
|
|
740
|
-
selectedShape:
|
|
738
|
+
onSelected: ($) => {
|
|
739
|
+
s("table", {
|
|
740
|
+
selectedShape: $
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
743
|
}, null)
|
|
744
744
|
}, {
|
|
745
745
|
default: () => {
|
|
746
|
-
var
|
|
746
|
+
var $, I;
|
|
747
747
|
return [t("div", {
|
|
748
748
|
class: `${n}-toolbar-item`,
|
|
749
|
-
title: (
|
|
750
|
-
}, [t(
|
|
749
|
+
title: ($ = l.value.toolbarTips) == null ? void 0 : $.table
|
|
750
|
+
}, [t(y, {
|
|
751
751
|
name: "table"
|
|
752
752
|
}, null), e.showToolbarName && t("div", {
|
|
753
753
|
class: `${n}-toolbar-item-name`
|
|
754
|
-
}, [(
|
|
754
|
+
}, [(I = l.value.toolbarTips) == null ? void 0 : I.table])])];
|
|
755
755
|
}
|
|
756
756
|
});
|
|
757
757
|
case "revoke":
|
|
@@ -759,21 +759,21 @@ const Sl = /* @__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
|
+
v.emit(o, It);
|
|
763
763
|
}
|
|
764
|
-
}, [t(
|
|
764
|
+
}, [t(y, {
|
|
765
765
|
name: "revoke"
|
|
766
766
|
}, null), e.showToolbarName && t("div", {
|
|
767
767
|
class: `${n}-toolbar-item-name`
|
|
768
|
-
}, [(
|
|
768
|
+
}, [(Be = l.value.toolbarTips) == null ? void 0 : Be.revoke])]);
|
|
769
769
|
case "next":
|
|
770
770
|
return t("div", {
|
|
771
771
|
class: `${n}-toolbar-item`,
|
|
772
|
-
title: (
|
|
772
|
+
title: (Fe = l.value.toolbarTips) == null ? void 0 : Fe.next,
|
|
773
773
|
onClick: () => {
|
|
774
|
-
|
|
774
|
+
v.emit(o, Et);
|
|
775
775
|
}
|
|
776
|
-
}, [t(
|
|
776
|
+
}, [t(y, {
|
|
777
777
|
name: "next"
|
|
778
778
|
}, null), e.showToolbarName && t("div", {
|
|
779
779
|
class: `${n}-toolbar-item-name`
|
|
@@ -783,57 +783,57 @@ const Sl = /* @__PURE__ */ P({
|
|
|
783
783
|
class: `${n}-toolbar-item`,
|
|
784
784
|
title: (Pe = l.value.toolbarTips) == null ? void 0 : Pe.save,
|
|
785
785
|
onClick: () => {
|
|
786
|
-
|
|
786
|
+
v.emit(o, Dt);
|
|
787
787
|
}
|
|
788
|
-
}, [t(
|
|
788
|
+
}, [t(y, {
|
|
789
789
|
name: "baocun"
|
|
790
790
|
}, null), e.showToolbarName && t("div", {
|
|
791
791
|
class: `${n}-toolbar-item-name`
|
|
792
|
-
}, [(
|
|
792
|
+
}, [(We = l.value.toolbarTips) == null ? void 0 : We.save])]);
|
|
793
793
|
case "prettier":
|
|
794
794
|
return e.noPrettier ? "" : t("div", {
|
|
795
795
|
class: `${n}-toolbar-item`,
|
|
796
|
-
title: (
|
|
796
|
+
title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier,
|
|
797
797
|
onClick: () => {
|
|
798
|
-
|
|
798
|
+
s("prettier");
|
|
799
799
|
}
|
|
800
|
-
}, [t(
|
|
800
|
+
}, [t(y, {
|
|
801
801
|
name: "prettier"
|
|
802
802
|
}, null), e.showToolbarName && t("div", {
|
|
803
803
|
class: `${n}-toolbar-item-name`
|
|
804
|
-
}, [(
|
|
804
|
+
}, [(_e = l.value.toolbarTips) == null ? void 0 : _e.prettier])]);
|
|
805
805
|
case "pageFullscreen":
|
|
806
806
|
return !e.setting.fullscreen && t("div", {
|
|
807
807
|
class: `${n}-toolbar-item`,
|
|
808
|
-
title: (
|
|
808
|
+
title: (qe = l.value.toolbarTips) == null ? void 0 : qe.pageFullscreen,
|
|
809
809
|
onClick: () => {
|
|
810
810
|
e.updateSetting("pageFullscreen");
|
|
811
811
|
}
|
|
812
|
-
}, [t(
|
|
812
|
+
}, [t(y, {
|
|
813
813
|
name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
|
|
814
814
|
}, null), e.showToolbarName && t("div", {
|
|
815
815
|
class: `${n}-toolbar-item-name`
|
|
816
|
-
}, [(
|
|
816
|
+
}, [(ze = l.value.toolbarTips) == null ? void 0 : ze.pageFullscreen])]);
|
|
817
817
|
case "fullscreen":
|
|
818
818
|
return t("div", {
|
|
819
819
|
class: `${n}-toolbar-item`,
|
|
820
|
-
title: (
|
|
820
|
+
title: (Ge = l.value.toolbarTips) == null ? void 0 : Ge.fullscreen,
|
|
821
821
|
onClick: () => {
|
|
822
|
-
|
|
822
|
+
i();
|
|
823
823
|
}
|
|
824
|
-
}, [t(
|
|
824
|
+
}, [t(y, {
|
|
825
825
|
name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
|
|
826
826
|
}, null), e.showToolbarName && t("div", {
|
|
827
827
|
class: `${n}-toolbar-item-name`
|
|
828
|
-
}, [(
|
|
828
|
+
}, [(Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen])]);
|
|
829
829
|
case "preview":
|
|
830
830
|
return t("div", {
|
|
831
831
|
class: `${n}-toolbar-item`,
|
|
832
|
-
title: (
|
|
832
|
+
title: (je = l.value.toolbarTips) == null ? void 0 : je.preview,
|
|
833
833
|
onClick: () => {
|
|
834
834
|
e.updateSetting("preview");
|
|
835
835
|
}
|
|
836
|
-
}, [t(
|
|
836
|
+
}, [t(y, {
|
|
837
837
|
name: "preview"
|
|
838
838
|
}, null), e.showToolbarName && t("div", {
|
|
839
839
|
class: `${n}-toolbar-item-name`
|
|
@@ -845,7 +845,7 @@ const Sl = /* @__PURE__ */ P({
|
|
|
845
845
|
onClick: () => {
|
|
846
846
|
e.updateSetting("htmlPreview");
|
|
847
847
|
}
|
|
848
|
-
}, [t(
|
|
848
|
+
}, [t(y, {
|
|
849
849
|
name: "coding"
|
|
850
850
|
}, null), e.showToolbarName && t("div", {
|
|
851
851
|
class: `${n}-toolbar-item-name`
|
|
@@ -855,10 +855,10 @@ const Sl = /* @__PURE__ */ P({
|
|
|
855
855
|
class: `${n}-toolbar-item`,
|
|
856
856
|
title: (Je = l.value.toolbarTips) == null ? void 0 : Je.catalog,
|
|
857
857
|
onClick: () => {
|
|
858
|
-
|
|
858
|
+
v.emit(o, Yt);
|
|
859
859
|
},
|
|
860
860
|
key: "bar-catalog"
|
|
861
|
-
}, [t(
|
|
861
|
+
}, [t(y, {
|
|
862
862
|
name: "catalog"
|
|
863
863
|
}, null), e.showToolbarName && t("div", {
|
|
864
864
|
class: `${n}-toolbar-item-name`
|
|
@@ -867,18 +867,18 @@ const Sl = /* @__PURE__ */ P({
|
|
|
867
867
|
return t("div", {
|
|
868
868
|
class: `${n}-toolbar-item`,
|
|
869
869
|
title: (et = l.value.toolbarTips) == null ? void 0 : et.github,
|
|
870
|
-
onClick: () =>
|
|
871
|
-
}, [t(
|
|
870
|
+
onClick: () => qt("https://github.com/imzbf/md-editor-v3")
|
|
871
|
+
}, [t(y, {
|
|
872
872
|
name: "github"
|
|
873
873
|
}, null), e.showToolbarName && t("div", {
|
|
874
874
|
class: `${n}-toolbar-item-name`
|
|
875
875
|
}, [(tt = l.value.toolbarTips) == null ? void 0 : tt.github])]);
|
|
876
876
|
case "mermaid":
|
|
877
|
-
return t(
|
|
877
|
+
return t(se, {
|
|
878
878
|
relative: `#${m}`,
|
|
879
879
|
visible: u.mermaid,
|
|
880
|
-
onChange: (
|
|
881
|
-
u.mermaid =
|
|
880
|
+
onChange: ($) => {
|
|
881
|
+
u.mermaid = $;
|
|
882
882
|
},
|
|
883
883
|
overlay: t("ul", {
|
|
884
884
|
class: `${n}-menu`,
|
|
@@ -886,66 +886,66 @@ const Sl = /* @__PURE__ */ P({
|
|
|
886
886
|
u.mermaid = !1;
|
|
887
887
|
}
|
|
888
888
|
}, [t("li", {
|
|
889
|
-
class: `${n}-menu-item`,
|
|
889
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
890
890
|
onClick: () => {
|
|
891
|
-
|
|
891
|
+
s("flow");
|
|
892
892
|
}
|
|
893
893
|
}, [(lt = l.value.mermaid) == null ? void 0 : lt.flow]), t("li", {
|
|
894
|
-
class: `${n}-menu-item`,
|
|
894
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
895
895
|
onClick: () => {
|
|
896
|
-
|
|
896
|
+
s("sequence");
|
|
897
897
|
}
|
|
898
898
|
}, [(ot = l.value.mermaid) == null ? void 0 : ot.sequence]), t("li", {
|
|
899
|
-
class: `${n}-menu-item`,
|
|
899
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
900
900
|
onClick: () => {
|
|
901
|
-
|
|
901
|
+
s("gantt");
|
|
902
902
|
}
|
|
903
903
|
}, [(at = l.value.mermaid) == null ? void 0 : at.gantt]), t("li", {
|
|
904
|
-
class: `${n}-menu-item`,
|
|
904
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
905
905
|
onClick: () => {
|
|
906
|
-
|
|
906
|
+
s("class");
|
|
907
907
|
}
|
|
908
908
|
}, [(nt = l.value.mermaid) == null ? void 0 : nt.class]), t("li", {
|
|
909
|
-
class: `${n}-menu-item`,
|
|
909
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
910
910
|
onClick: () => {
|
|
911
|
-
|
|
911
|
+
s("state");
|
|
912
912
|
}
|
|
913
913
|
}, [(rt = l.value.mermaid) == null ? void 0 : rt.state]), t("li", {
|
|
914
|
-
class: `${n}-menu-item`,
|
|
914
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
915
915
|
onClick: () => {
|
|
916
|
-
|
|
916
|
+
s("pie");
|
|
917
917
|
}
|
|
918
918
|
}, [(it = l.value.mermaid) == null ? void 0 : it.pie]), t("li", {
|
|
919
|
-
class: `${n}-menu-item`,
|
|
919
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
920
920
|
onClick: () => {
|
|
921
|
-
|
|
921
|
+
s("relationship");
|
|
922
922
|
}
|
|
923
923
|
}, [(st = l.value.mermaid) == null ? void 0 : st.relationship]), t("li", {
|
|
924
|
-
class: `${n}-menu-item`,
|
|
924
|
+
class: `${n}-menu-item ${n}-menu-item-mermaid`,
|
|
925
925
|
onClick: () => {
|
|
926
|
-
|
|
926
|
+
s("journey");
|
|
927
927
|
}
|
|
928
928
|
}, [(ct = l.value.mermaid) == null ? void 0 : ct.journey])]),
|
|
929
929
|
key: "bar-mermaid"
|
|
930
930
|
}, {
|
|
931
931
|
default: () => {
|
|
932
|
-
var
|
|
932
|
+
var $, I;
|
|
933
933
|
return [t("div", {
|
|
934
934
|
class: `${n}-toolbar-item`,
|
|
935
|
-
title: (
|
|
936
|
-
}, [t(
|
|
935
|
+
title: ($ = l.value.toolbarTips) == null ? void 0 : $.mermaid
|
|
936
|
+
}, [t(y, {
|
|
937
937
|
name: "mermaid"
|
|
938
938
|
}, null), e.showToolbarName && t("div", {
|
|
939
939
|
class: `${n}-toolbar-item-name`
|
|
940
|
-
}, [(
|
|
940
|
+
}, [(I = l.value.toolbarTips) == null ? void 0 : I.mermaid])])];
|
|
941
941
|
}
|
|
942
942
|
});
|
|
943
943
|
case "katex":
|
|
944
|
-
return t(
|
|
944
|
+
return t(se, {
|
|
945
945
|
relative: `#${m}`,
|
|
946
946
|
visible: u.katex,
|
|
947
|
-
onChange: (
|
|
948
|
-
u.katex =
|
|
947
|
+
onChange: ($) => {
|
|
948
|
+
u.katex = $;
|
|
949
949
|
},
|
|
950
950
|
overlay: t("ul", {
|
|
951
951
|
class: `${n}-menu`,
|
|
@@ -953,49 +953,49 @@ const Sl = /* @__PURE__ */ P({
|
|
|
953
953
|
u.katex = !1;
|
|
954
954
|
}
|
|
955
955
|
}, [t("li", {
|
|
956
|
-
class: `${n}-menu-item`,
|
|
956
|
+
class: `${n}-menu-item ${n}-menu-item-katex`,
|
|
957
957
|
onClick: () => {
|
|
958
|
-
|
|
958
|
+
s("katexInline");
|
|
959
959
|
}
|
|
960
960
|
}, [(ut = l.value.katex) == null ? void 0 : ut.inline]), t("li", {
|
|
961
|
-
class: `${n}-menu-item`,
|
|
961
|
+
class: `${n}-menu-item ${n}-menu-item-katex`,
|
|
962
962
|
onClick: () => {
|
|
963
|
-
|
|
963
|
+
s("katexBlock");
|
|
964
964
|
}
|
|
965
965
|
}, [(dt = l.value.katex) == null ? void 0 : dt.block])]),
|
|
966
966
|
key: "bar-katex"
|
|
967
967
|
}, {
|
|
968
968
|
default: () => {
|
|
969
|
-
var
|
|
969
|
+
var $, I;
|
|
970
970
|
return [t("div", {
|
|
971
971
|
class: `${n}-toolbar-item`,
|
|
972
|
-
title: (
|
|
973
|
-
}, [t(
|
|
972
|
+
title: ($ = l.value.toolbarTips) == null ? void 0 : $.katex
|
|
973
|
+
}, [t(y, {
|
|
974
974
|
name: "formula"
|
|
975
975
|
}, null), e.showToolbarName && t("div", {
|
|
976
976
|
class: `${n}-toolbar-item-name`
|
|
977
|
-
}, [(
|
|
977
|
+
}, [(I = l.value.toolbarTips) == null ? void 0 : I.katex])])];
|
|
978
978
|
}
|
|
979
979
|
});
|
|
980
980
|
}
|
|
981
981
|
else if (e.defToolbars instanceof Array) {
|
|
982
|
-
const
|
|
983
|
-
return
|
|
982
|
+
const $ = e.defToolbars[b];
|
|
983
|
+
return $ ? mt($, {
|
|
984
984
|
theme: a.value,
|
|
985
|
-
language:
|
|
985
|
+
language: r.value,
|
|
986
986
|
insert(ve) {
|
|
987
|
-
|
|
987
|
+
v.emit(o, x, "universal", {
|
|
988
988
|
generate: ve
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
991
|
}) : "";
|
|
992
992
|
} else if (e.defToolbars && e.defToolbars.children instanceof Array) {
|
|
993
|
-
const
|
|
994
|
-
return
|
|
993
|
+
const $ = e.defToolbars.children[b];
|
|
994
|
+
return $ ? mt($, {
|
|
995
995
|
theme: a.value,
|
|
996
|
-
language:
|
|
996
|
+
language: r.value,
|
|
997
997
|
insert(ve) {
|
|
998
|
-
|
|
998
|
+
v.emit(o, x, "universal", {
|
|
999
999
|
generate: ve
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
@@ -1003,14 +1003,14 @@ const Sl = /* @__PURE__ */ P({
|
|
|
1003
1003
|
} else
|
|
1004
1004
|
return "";
|
|
1005
1005
|
};
|
|
1006
|
-
return
|
|
1006
|
+
return O(() => e.toolbars, () => {
|
|
1007
1007
|
he(() => {
|
|
1008
|
-
g.value &&
|
|
1008
|
+
g.value && _t(g.value);
|
|
1009
1009
|
});
|
|
1010
1010
|
}, {
|
|
1011
1011
|
immediate: !0
|
|
1012
1012
|
}), () => {
|
|
1013
|
-
const
|
|
1013
|
+
const b = k.value[0].map((T) => h(T)), p = k.value[1].map((T) => h(T));
|
|
1014
1014
|
return t(Mt, null, [e.toolbars.length > 0 && t("div", {
|
|
1015
1015
|
class: `${n}-toolbar-wrapper`,
|
|
1016
1016
|
ref: g,
|
|
@@ -1019,10 +1019,10 @@ const Sl = /* @__PURE__ */ P({
|
|
|
1019
1019
|
class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
|
|
1020
1020
|
}, [t("div", {
|
|
1021
1021
|
class: `${n}-toolbar-left`,
|
|
1022
|
-
ref:
|
|
1023
|
-
}, [
|
|
1022
|
+
ref: w
|
|
1023
|
+
}, [b]), t("div", {
|
|
1024
1024
|
class: `${n}-toolbar-right`
|
|
1025
|
-
}, [
|
|
1025
|
+
}, [p])])]), t("input", {
|
|
1026
1026
|
ref: d,
|
|
1027
1027
|
accept: "image/*",
|
|
1028
1028
|
type: "file",
|
|
@@ -1030,32 +1030,32 @@ const Sl = /* @__PURE__ */ P({
|
|
|
1030
1030
|
style: {
|
|
1031
1031
|
display: "none"
|
|
1032
1032
|
}
|
|
1033
|
-
}, null), t(
|
|
1034
|
-
linkVisible:
|
|
1035
|
-
clipVisible:
|
|
1036
|
-
type:
|
|
1033
|
+
}, null), t(Bl, {
|
|
1034
|
+
linkVisible: f.linkVisible,
|
|
1035
|
+
clipVisible: f.clipVisible,
|
|
1036
|
+
type: f.type,
|
|
1037
1037
|
onCancel: () => {
|
|
1038
|
-
|
|
1038
|
+
f.linkVisible = !1, f.clipVisible = !1;
|
|
1039
1039
|
},
|
|
1040
1040
|
onOk: (T) => {
|
|
1041
|
-
T &&
|
|
1041
|
+
T && s(f.type, {
|
|
1042
1042
|
desc: T.desc,
|
|
1043
1043
|
url: T.url
|
|
1044
|
-
}),
|
|
1044
|
+
}), f.linkVisible = !1, f.clipVisible = !1;
|
|
1045
1045
|
}
|
|
1046
1046
|
}, null)]);
|
|
1047
1047
|
};
|
|
1048
1048
|
}
|
|
1049
1049
|
}), Rl = (e, o) => {
|
|
1050
|
-
const l =
|
|
1050
|
+
const l = zt(() => {
|
|
1051
1051
|
e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
|
|
1052
|
-
}, 50), a = (
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
top: e.scrollTop /
|
|
1052
|
+
}, 50), a = (r) => {
|
|
1053
|
+
const i = e.clientHeight, m = o.clientHeight, g = e.scrollHeight, u = o.scrollHeight, s = (g - i) / (u - m);
|
|
1054
|
+
r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
|
|
1055
|
+
top: e.scrollTop / s
|
|
1056
1056
|
// behavior: 'smooth'
|
|
1057
1057
|
}), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
|
|
1058
|
-
top: o.scrollTop *
|
|
1058
|
+
top: o.scrollTop * s
|
|
1059
1059
|
// behavior: 'smooth'
|
|
1060
1060
|
}), l());
|
|
1061
1061
|
};
|
|
@@ -1070,319 +1070,319 @@ const Sl = /* @__PURE__ */ P({
|
|
|
1070
1070
|
}
|
|
1071
1071
|
];
|
|
1072
1072
|
}, Pl = (e, o, l) => {
|
|
1073
|
-
const { view: a } = l,
|
|
1073
|
+
const { view: a } = l, r = Gt(), i = (k) => a.lineBlockAt(a.state.doc.line(k).from).top, m = (k) => a.lineBlockAt(a.state.doc.line(k).from).height;
|
|
1074
1074
|
let g = [];
|
|
1075
1075
|
const u = () => {
|
|
1076
1076
|
g = [];
|
|
1077
|
-
const
|
|
1078
|
-
(
|
|
1077
|
+
const k = Array.from(o.querySelectorAll("[data-line]")).map(
|
|
1078
|
+
(b) => Number(b.dataset.line) + 1
|
|
1079
1079
|
), { lines: d } = a.state.doc;
|
|
1080
|
-
let
|
|
1081
|
-
for (let
|
|
1082
|
-
|
|
1083
|
-
start:
|
|
1084
|
-
end:
|
|
1080
|
+
let C = 1, h = k.shift() ?? d;
|
|
1081
|
+
for (let b = 1; b <= d; b++)
|
|
1082
|
+
b === h && (C = b, h = k.shift() || d + 1), g.push({
|
|
1083
|
+
start: C,
|
|
1084
|
+
end: h - 1
|
|
1085
1085
|
});
|
|
1086
1086
|
};
|
|
1087
|
-
let
|
|
1088
|
-
const
|
|
1089
|
-
var
|
|
1090
|
-
if (!((
|
|
1087
|
+
let s = 0, f = 0;
|
|
1088
|
+
const w = Kt((k) => {
|
|
1089
|
+
var p, T, S, D, E, oe, ae;
|
|
1090
|
+
if (!((p = o.firstElementChild) != null && p.firstElementChild))
|
|
1091
1091
|
return;
|
|
1092
|
-
const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number:
|
|
1093
|
-
if (
|
|
1092
|
+
const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: C } = a.state.doc.lineAt(d.from);
|
|
1093
|
+
if (C > g.length || a.state.doc.lines < g[g.length - 1].end)
|
|
1094
1094
|
return;
|
|
1095
|
-
let
|
|
1096
|
-
const
|
|
1097
|
-
if (
|
|
1098
|
-
if (
|
|
1095
|
+
let h = +getComputedStyle(o).paddingTop.replace("px", "");
|
|
1096
|
+
const b = +getComputedStyle(o).paddingBottom.replace("px", "");
|
|
1097
|
+
if (k.target === e) {
|
|
1098
|
+
if (f !== 0)
|
|
1099
1099
|
return;
|
|
1100
|
-
|
|
1101
|
-
const M = g[
|
|
1102
|
-
let L =
|
|
1103
|
-
const
|
|
1104
|
-
let N = 0,
|
|
1105
|
-
|
|
1106
|
-
const K =
|
|
1107
|
-
|
|
1108
|
-
|
|
1100
|
+
s++;
|
|
1101
|
+
const M = g[C - 1];
|
|
1102
|
+
let L = i(M.end) + m(M.end), _ = 0;
|
|
1103
|
+
const W = i(M.start), V = o.querySelector(`[data-line="${M.start - 1}"]`) || ((T = o.firstElementChild) == null ? void 0 : T.firstElementChild), H = o.querySelector(`[data-line="${M.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
|
|
1104
|
+
let N = 0, B = 0;
|
|
1105
|
+
W === 0 ? V === H ? (h = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / L, N = H.offsetTop + H.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / L, N = H.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - W) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - W), B = V.offsetTop, N = o.scrollHeight - o.clientHeight - B + 10) : (_ = (a.scrollDOM.scrollTop - W) / (L - W), B = V.offsetTop, N = H.offsetTop - B);
|
|
1106
|
+
const K = B - h + N * _;
|
|
1107
|
+
r(o, K, () => {
|
|
1108
|
+
s--;
|
|
1109
1109
|
});
|
|
1110
1110
|
} else {
|
|
1111
|
-
if (
|
|
1111
|
+
if (s !== 0)
|
|
1112
1112
|
return;
|
|
1113
|
-
|
|
1113
|
+
f++;
|
|
1114
1114
|
const M = Array.from(
|
|
1115
1115
|
o.querySelectorAll("[data-line]")
|
|
1116
1116
|
), L = o.scrollTop, _ = o.scrollHeight;
|
|
1117
|
-
let
|
|
1117
|
+
let W = M.length === 0 ? 1 : Math.ceil(
|
|
1118
1118
|
Number(M[M.length - 1].dataset.line) * (L / _)
|
|
1119
|
-
),
|
|
1120
|
-
for (let
|
|
1121
|
-
const R = o.querySelector(`[data-line="${
|
|
1119
|
+
), V = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild;
|
|
1120
|
+
for (let F = W; F >= 0; F--) {
|
|
1121
|
+
const R = o.querySelector(`[data-line="${F}"]`);
|
|
1122
1122
|
if (R && R.offsetTop <= L) {
|
|
1123
|
-
|
|
1123
|
+
V = R, W = F;
|
|
1124
1124
|
break;
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
|
-
let H = (
|
|
1127
|
+
let H = (E = o.firstElementChild) == null ? void 0 : E.firstElementChild, N = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
|
|
1128
1128
|
for (; M.length > 0; ) {
|
|
1129
|
-
const
|
|
1130
|
-
if (
|
|
1129
|
+
const F = M.indexOf(V);
|
|
1130
|
+
if (F + 1 >= M.length)
|
|
1131
1131
|
break;
|
|
1132
|
-
const R = M[
|
|
1133
|
-
if (
|
|
1132
|
+
const R = M[F + 1];
|
|
1133
|
+
if (F === -1) {
|
|
1134
1134
|
N = R;
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
|
-
const
|
|
1138
|
-
if (
|
|
1139
|
-
if (
|
|
1140
|
-
H =
|
|
1137
|
+
const ie = V.offsetTop;
|
|
1138
|
+
if (ie > L) {
|
|
1139
|
+
if (F === 0) {
|
|
1140
|
+
H = V, N = R;
|
|
1141
1141
|
break;
|
|
1142
1142
|
}
|
|
1143
|
-
|
|
1143
|
+
V = M[F - 1];
|
|
1144
1144
|
continue;
|
|
1145
1145
|
}
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
H =
|
|
1146
|
+
const me = R.offsetTop;
|
|
1147
|
+
if (ie <= L && me > L) {
|
|
1148
|
+
H = V, N = R;
|
|
1149
1149
|
break;
|
|
1150
1150
|
}
|
|
1151
|
-
|
|
1151
|
+
V = R;
|
|
1152
1152
|
}
|
|
1153
|
-
const
|
|
1154
|
-
let K = N.offsetTop,
|
|
1155
|
-
const { start:
|
|
1156
|
-
let
|
|
1157
|
-
const
|
|
1158
|
-
let
|
|
1159
|
-
H === ((
|
|
1160
|
-
(L -
|
|
1153
|
+
const B = H.offsetTop;
|
|
1154
|
+
let K = N.offsetTop, j = 0;
|
|
1155
|
+
const { start: de, end: ne } = g[Number(H.dataset.line || 0)], J = i(de);
|
|
1156
|
+
let Z = i(ne);
|
|
1157
|
+
const re = m(ne);
|
|
1158
|
+
let X = 0;
|
|
1159
|
+
H === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (H === N ? (K = N.offsetHeight - o.offsetHeight + h + b, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + re - J, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
|
|
1160
|
+
(L - B) / (o.scrollHeight - B - o.clientHeight),
|
|
1161
1161
|
0
|
|
1162
|
-
),
|
|
1163
|
-
(L -
|
|
1162
|
+
), Z = i(a.state.doc.lines) + m(a.state.doc.lines), X = 8 + Z - J - e.clientHeight) : (j = Math.max(
|
|
1163
|
+
(L - B) / (K - B),
|
|
1164
1164
|
0
|
|
1165
|
-
),
|
|
1166
|
-
|
|
1165
|
+
), X = Z + re - J), r(e, J + X * j, () => {
|
|
1166
|
+
f--;
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
1169
|
}, 10);
|
|
1170
1170
|
return [
|
|
1171
1171
|
() => {
|
|
1172
|
-
u(), e.addEventListener("scroll",
|
|
1172
|
+
u(), e.addEventListener("scroll", w), o.addEventListener("scroll", w), e.dispatchEvent(new Event("scroll"));
|
|
1173
1173
|
},
|
|
1174
1174
|
() => {
|
|
1175
|
-
g = [], e.removeEventListener("scroll",
|
|
1175
|
+
g = [], e.removeEventListener("scroll", w), o.removeEventListener("scroll", w);
|
|
1176
1176
|
}
|
|
1177
1177
|
];
|
|
1178
|
-
},
|
|
1178
|
+
}, Wl = (e, o, l) => {
|
|
1179
1179
|
const a = A("editorId");
|
|
1180
|
-
let
|
|
1181
|
-
},
|
|
1180
|
+
let r = () => {
|
|
1181
|
+
}, i = () => {
|
|
1182
1182
|
};
|
|
1183
1183
|
const m = () => {
|
|
1184
|
-
|
|
1184
|
+
r();
|
|
1185
1185
|
const g = document.querySelector(
|
|
1186
1186
|
`#${a} .cm-scroller`
|
|
1187
1187
|
), u = 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
|
-
(u ||
|
|
1192
|
+
(u || s) && ([i, r] = (u ? Pl : Rl)(
|
|
1193
1193
|
g,
|
|
1194
|
-
u ||
|
|
1194
|
+
u || s,
|
|
1195
1195
|
l.value
|
|
1196
|
-
)), e.scrollAuto &&
|
|
1196
|
+
)), e.scrollAuto && i();
|
|
1197
1197
|
};
|
|
1198
|
-
|
|
1198
|
+
O(
|
|
1199
1199
|
[
|
|
1200
1200
|
o,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1201
|
+
te(e.setting, "preview"),
|
|
1202
|
+
te(e.setting, "htmlPreview"),
|
|
1203
|
+
te(e.setting, "fullscreen"),
|
|
1204
|
+
te(e.setting, "pageFullscreen")
|
|
1205
1205
|
],
|
|
1206
1206
|
() => {
|
|
1207
1207
|
he(m);
|
|
1208
1208
|
}
|
|
1209
|
-
),
|
|
1209
|
+
), O(
|
|
1210
1210
|
() => e.scrollAuto,
|
|
1211
1211
|
(g) => {
|
|
1212
|
-
g ?
|
|
1212
|
+
g ? i() : r();
|
|
1213
1213
|
}
|
|
1214
|
-
),
|
|
1215
|
-
},
|
|
1216
|
-
var
|
|
1217
|
-
let a = "",
|
|
1218
|
-
const u = o.getSelectedText(),
|
|
1214
|
+
), Y(m);
|
|
1215
|
+
}, Ul = Wl, _l = (e, o, l) => {
|
|
1216
|
+
var f, w, k, d, C, h;
|
|
1217
|
+
let a = "", r = 0, i = 0, m = !0, g = !1;
|
|
1218
|
+
const u = o.getSelectedText(), s = (f = Q.editorConfig) == null ? void 0 : f.mermaidTemplate;
|
|
1219
1219
|
if (/^h[1-6]{1}$/.test(e)) {
|
|
1220
|
-
const
|
|
1221
|
-
a = `${
|
|
1220
|
+
const b = e.replace(/^h(\d)/, (p, T) => new Array(Number(T)).fill("#", 0, T).join(""));
|
|
1221
|
+
a = `${b} ${u}`, r = b.length + 1;
|
|
1222
1222
|
} else if (e === "prettier") {
|
|
1223
|
-
const
|
|
1224
|
-
((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((
|
|
1223
|
+
const b = window.prettier || ((k = (w = Q.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : k.prettierInstance), p = [
|
|
1224
|
+
((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((h = (C = Q.editorExtensions) == null ? void 0 : C.prettier) == null ? void 0 : h.parserMarkdownInstance)
|
|
1225
1225
|
];
|
|
1226
|
-
!
|
|
1226
|
+
!b || p[0] === void 0 ? (v.emit(l.editorId, le, {
|
|
1227
1227
|
name: "prettier",
|
|
1228
1228
|
message: "prettier is undefined"
|
|
1229
|
-
}), a = o.getValue()) : a =
|
|
1229
|
+
}), a = o.getValue()) : a = b.format(o.getValue(), {
|
|
1230
1230
|
parser: "markdown",
|
|
1231
|
-
plugins:
|
|
1231
|
+
plugins: p
|
|
1232
1232
|
}), m = !1, g = !0;
|
|
1233
1233
|
} else
|
|
1234
1234
|
switch (e) {
|
|
1235
1235
|
case "bold": {
|
|
1236
|
-
a = `**${u}**`,
|
|
1236
|
+
a = `**${u}**`, r = 2, i = -2;
|
|
1237
1237
|
break;
|
|
1238
1238
|
}
|
|
1239
1239
|
case "underline": {
|
|
1240
|
-
a = `<u>${u}</u>`,
|
|
1240
|
+
a = `<u>${u}</u>`, r = 3, i = -4;
|
|
1241
1241
|
break;
|
|
1242
1242
|
}
|
|
1243
1243
|
case "italic": {
|
|
1244
|
-
a = `*${u}*`,
|
|
1244
|
+
a = `*${u}*`, r = 1, i = -1;
|
|
1245
1245
|
break;
|
|
1246
1246
|
}
|
|
1247
1247
|
case "strikeThrough": {
|
|
1248
|
-
a = `~~${u}~~`,
|
|
1248
|
+
a = `~~${u}~~`, r = 2, i = -2;
|
|
1249
1249
|
break;
|
|
1250
1250
|
}
|
|
1251
1251
|
case "sub": {
|
|
1252
|
-
a = `<sub>${u}</sub>`,
|
|
1252
|
+
a = `<sub>${u}</sub>`, r = 5, i = -6;
|
|
1253
1253
|
break;
|
|
1254
1254
|
}
|
|
1255
1255
|
case "sup": {
|
|
1256
|
-
a = `<sup>${u}</sup>`,
|
|
1256
|
+
a = `<sup>${u}</sup>`, r = 5, i = -6;
|
|
1257
1257
|
break;
|
|
1258
1258
|
}
|
|
1259
1259
|
case "codeRow": {
|
|
1260
|
-
a = "`" + u + "`",
|
|
1260
|
+
a = "`" + u + "`", r = 1, i = -1;
|
|
1261
1261
|
break;
|
|
1262
1262
|
}
|
|
1263
1263
|
case "quote": {
|
|
1264
|
-
a = `> ${u}`,
|
|
1264
|
+
a = `> ${u}`, r = 2;
|
|
1265
1265
|
break;
|
|
1266
1266
|
}
|
|
1267
1267
|
case "orderedList": {
|
|
1268
|
-
a = `1. ${u}`,
|
|
1268
|
+
a = `1. ${u}`, r = 3;
|
|
1269
1269
|
break;
|
|
1270
1270
|
}
|
|
1271
1271
|
case "unorderedList": {
|
|
1272
|
-
a = `- ${u}`,
|
|
1272
|
+
a = `- ${u}`, r = 2;
|
|
1273
1273
|
break;
|
|
1274
1274
|
}
|
|
1275
1275
|
case "task": {
|
|
1276
|
-
a = `- [ ] ${u}`,
|
|
1276
|
+
a = `- [ ] ${u}`, r = 6;
|
|
1277
1277
|
break;
|
|
1278
1278
|
}
|
|
1279
1279
|
case "code": {
|
|
1280
|
-
const
|
|
1281
|
-
a = `\`\`\`${
|
|
1282
|
-
${
|
|
1280
|
+
const b = l.text || u || "", p = l.mode || "language";
|
|
1281
|
+
a = `\`\`\`${p}
|
|
1282
|
+
${b}
|
|
1283
1283
|
\`\`\`
|
|
1284
|
-
`,
|
|
1284
|
+
`, r = 3, i = 3 + p.length - a.length;
|
|
1285
1285
|
break;
|
|
1286
1286
|
}
|
|
1287
1287
|
case "table": {
|
|
1288
1288
|
a = "|";
|
|
1289
|
-
const { selectedShape:
|
|
1289
|
+
const { selectedShape: b = { x: 1, y: 1 } } = l, { x: p, y: T } = b;
|
|
1290
1290
|
for (let S = 0; S <= T; S++)
|
|
1291
1291
|
a += " col |";
|
|
1292
1292
|
a += `
|
|
1293
1293
|
|`;
|
|
1294
1294
|
for (let S = 0; S <= T; S++)
|
|
1295
1295
|
a += " - |";
|
|
1296
|
-
for (let S = 0; S <=
|
|
1296
|
+
for (let S = 0; S <= p; S++) {
|
|
1297
1297
|
a += `
|
|
1298
1298
|
|`;
|
|
1299
1299
|
for (let D = 0; D <= T; D++)
|
|
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: b, url: p } = l;
|
|
1307
|
+
a = `[${b}](${p})`, m = !1;
|
|
1308
1308
|
break;
|
|
1309
1309
|
}
|
|
1310
1310
|
case "image": {
|
|
1311
|
-
const { desc:
|
|
1312
|
-
T instanceof Array ? a = T.reduce((S, D) => S + `
|
|
1313
|
+
`, "") : a = `
|
|
1314
1314
|
`, m = !1;
|
|
1315
1315
|
break;
|
|
1316
1316
|
}
|
|
1317
1317
|
case "flow": {
|
|
1318
1318
|
a = `\`\`\`mermaid
|
|
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": {
|
|
1326
1326
|
a = `\`\`\`mermaid
|
|
1327
|
-
${(
|
|
1327
|
+
${(s == null ? void 0 : s.sequence) || `sequenceDiagram
|
|
1328
1328
|
A->>B: hello!
|
|
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": {
|
|
1336
1336
|
a = `\`\`\`mermaid
|
|
1337
|
-
${(
|
|
1337
|
+
${(s == null ? void 0 : s.gantt) || `gantt
|
|
1338
1338
|
title A Gantt Diagram
|
|
1339
1339
|
dateFormat YYYY-MM-DD
|
|
1340
1340
|
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": {
|
|
1348
1348
|
a = `\`\`\`mermaid
|
|
1349
|
-
${(
|
|
1349
|
+
${(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": {
|
|
1357
1357
|
a = `\`\`\`mermaid
|
|
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": {
|
|
1365
1365
|
a = `\`\`\`mermaid
|
|
1366
|
-
${(
|
|
1366
|
+
${(s == null ? void 0 : s.pie) || `pie title Pets adopted by volunteers
|
|
1367
1367
|
"Dogs" : 386
|
|
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": {
|
|
1375
1375
|
a = `\`\`\`mermaid
|
|
1376
|
-
${(
|
|
1376
|
+
${(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": {
|
|
1384
1384
|
a = `\`\`\`mermaid
|
|
1385
|
-
${(
|
|
1385
|
+
${(s == null ? void 0 : s.journey) || `journey
|
|
1386
1386
|
title My working day
|
|
1387
1387
|
section Go to work
|
|
1388
1388
|
Make tea: 5: Me
|
|
@@ -1392,23 +1392,23 @@ ${(c == null ? void 0 : c.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: b } = l, p = b(u);
|
|
1411
|
+
a = p.targetValue, m = p.select, r = p.deviationStart, i = p.deviationEnd;
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
return {
|
|
@@ -1417,17 +1417,17 @@ $$
|
|
|
1417
1417
|
// 是否选中
|
|
1418
1418
|
select: m,
|
|
1419
1419
|
// 选中时,开始位置的偏移量
|
|
1420
|
-
deviationStart:
|
|
1420
|
+
deviationStart: r,
|
|
1421
1421
|
// 结束的偏移量
|
|
1422
|
-
deviationEnd:
|
|
1422
|
+
deviationEnd: i,
|
|
1423
1423
|
// 是否整个替换
|
|
1424
1424
|
replaceAll: g
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
|
-
},
|
|
1427
|
+
}, ql = "#e5c07b", ft = "var(--md-color)", zl = "#56b6c2", Gl = "#ffffff", ce = "var(--md-color)", bt = "#e5c07b", Kl = "#e5c07b", jl = "var(--md-color)", ht = "#d19a66", Zl = "#c678dd", Xl = "#21252b", Yl = "#2c313a", vt = "var(--md-bk-color)", Ce = "var(--md-bk-color)", Jl = "#ceedfa33", kt = "#528bff", Ql = xe.theme(
|
|
1428
1428
|
{
|
|
1429
1429
|
"&": {
|
|
1430
|
-
color:
|
|
1430
|
+
color: ce,
|
|
1431
1431
|
backgroundColor: vt
|
|
1432
1432
|
},
|
|
1433
1433
|
".cm-content": {
|
|
@@ -1435,7 +1435,7 @@ $$
|
|
|
1435
1435
|
},
|
|
1436
1436
|
".cm-cursor, .cm-dropCursor": { borderLeftColor: kt },
|
|
1437
1437
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Jl },
|
|
1438
|
-
".cm-panels": { backgroundColor: Xl, color:
|
|
1438
|
+
".cm-panels": { backgroundColor: Xl, color: ce },
|
|
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": {
|
|
@@ -1452,7 +1452,7 @@ $$
|
|
|
1452
1452
|
},
|
|
1453
1453
|
".cm-gutters": {
|
|
1454
1454
|
backgroundColor: vt,
|
|
1455
|
-
color:
|
|
1455
|
+
color: ce,
|
|
1456
1456
|
borderRight: "1px solid",
|
|
1457
1457
|
borderColor: "var(--md-border-color)"
|
|
1458
1458
|
},
|
|
@@ -1478,58 +1478,58 @@ $$
|
|
|
1478
1478
|
},
|
|
1479
1479
|
".cm-tooltip-autocomplete": {
|
|
1480
1480
|
"& > ul > li[aria-selected]": {
|
|
1481
|
-
color:
|
|
1481
|
+
color: ce
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
1484
|
},
|
|
1485
1485
|
{ dark: !0 }
|
|
1486
|
-
), eo =
|
|
1487
|
-
{ tag:
|
|
1488
|
-
{ tag: [
|
|
1489
|
-
{ tag: [
|
|
1490
|
-
{ tag: [
|
|
1491
|
-
{ tag: [
|
|
1486
|
+
), eo = Nt.define([
|
|
1487
|
+
{ tag: c.keyword, color: Zl },
|
|
1488
|
+
{ tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: ft },
|
|
1489
|
+
{ tag: [c.function(c.variableName), c.labelName], color: Kl },
|
|
1490
|
+
{ tag: [c.color, c.constant(c.name), c.standard(c.name)], color: ht },
|
|
1491
|
+
{ tag: [c.definition(c.name), c.separator], color: ce },
|
|
1492
1492
|
{
|
|
1493
1493
|
tag: [
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1494
|
+
c.typeName,
|
|
1495
|
+
c.className,
|
|
1496
|
+
c.number,
|
|
1497
|
+
c.changed,
|
|
1498
|
+
c.annotation,
|
|
1499
|
+
c.modifier,
|
|
1500
|
+
c.self,
|
|
1501
|
+
c.namespace
|
|
1502
1502
|
],
|
|
1503
|
-
color:
|
|
1503
|
+
color: ql
|
|
1504
1504
|
},
|
|
1505
1505
|
{
|
|
1506
1506
|
tag: [
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1507
|
+
c.operator,
|
|
1508
|
+
c.operatorKeyword,
|
|
1509
|
+
c.url,
|
|
1510
|
+
c.escape,
|
|
1511
|
+
c.regexp,
|
|
1512
|
+
c.link,
|
|
1513
|
+
c.special(c.string)
|
|
1514
1514
|
],
|
|
1515
|
-
color:
|
|
1515
|
+
color: zl
|
|
1516
1516
|
},
|
|
1517
|
-
{ tag: [
|
|
1518
|
-
{ tag:
|
|
1519
|
-
{ tag:
|
|
1520
|
-
{ tag:
|
|
1521
|
-
{ tag:
|
|
1522
|
-
{ tag:
|
|
1523
|
-
{ tag: [
|
|
1524
|
-
{ tag: [
|
|
1525
|
-
{ tag:
|
|
1517
|
+
{ tag: [c.meta, c.comment], color: bt },
|
|
1518
|
+
{ tag: c.strong, fontWeight: "bold" },
|
|
1519
|
+
{ tag: c.emphasis, fontStyle: "italic" },
|
|
1520
|
+
{ tag: c.strikethrough, textDecoration: "line-through" },
|
|
1521
|
+
{ tag: c.link, color: bt, textDecoration: "underline" },
|
|
1522
|
+
{ tag: c.heading, fontWeight: "bold", color: ft },
|
|
1523
|
+
{ tag: [c.atom, c.bool, c.special(c.variableName)], color: ht },
|
|
1524
|
+
{ tag: [c.processingInstruction, c.string, c.inserted], color: jl },
|
|
1525
|
+
{ tag: c.invalid, color: Gl }
|
|
1526
1526
|
]), Ct = [
|
|
1527
1527
|
Ql,
|
|
1528
|
-
|
|
1529
|
-
], to = "#e5c07b", pt = "#3f4a54", lo = "#56b6c2", oo = "#fff",
|
|
1528
|
+
Ot(eo)
|
|
1529
|
+
], to = "#e5c07b", pt = "#3f4a54", lo = "#56b6c2", oo = "#fff", ue = "#3f4a54", $t = "#2d8cf0", ao = "#2d8cf0", no = "#3f4a54", yt = "#d19a66", ro = "#c678dd", io = "#21252b", so = "#ceedfa33", Tt = "var(--md-bk-color)", pe = "var(--md-bk-color)", co = "#bad5fa", wt = "#3f4a54", uo = xe.theme(
|
|
1530
1530
|
{
|
|
1531
1531
|
"&": {
|
|
1532
|
-
color:
|
|
1532
|
+
color: ue,
|
|
1533
1533
|
backgroundColor: Tt
|
|
1534
1534
|
},
|
|
1535
1535
|
".cm-content": {
|
|
@@ -1537,7 +1537,7 @@ $$
|
|
|
1537
1537
|
},
|
|
1538
1538
|
".cm-cursor, .cm-dropCursor": { borderLeftColor: wt },
|
|
1539
1539
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: co },
|
|
1540
|
-
".cm-panels": { backgroundColor: io, color:
|
|
1540
|
+
".cm-panels": { backgroundColor: io, color: ue },
|
|
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": {
|
|
@@ -1554,7 +1554,7 @@ $$
|
|
|
1554
1554
|
},
|
|
1555
1555
|
".cm-gutters": {
|
|
1556
1556
|
backgroundColor: Tt,
|
|
1557
|
-
color:
|
|
1557
|
+
color: ue,
|
|
1558
1558
|
borderRight: "1px solid",
|
|
1559
1559
|
borderColor: "var(--md-border-color)"
|
|
1560
1560
|
},
|
|
@@ -1580,73 +1580,73 @@ $$
|
|
|
1580
1580
|
},
|
|
1581
1581
|
".cm-tooltip-autocomplete": {
|
|
1582
1582
|
"& > ul > li[aria-selected]": {
|
|
1583
|
-
color:
|
|
1583
|
+
color: ue
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
1587
|
// { dark: true }
|
|
1588
|
-
), mo =
|
|
1589
|
-
{ tag:
|
|
1590
|
-
{ tag: [
|
|
1591
|
-
{ tag: [
|
|
1592
|
-
{ tag: [
|
|
1593
|
-
{ tag: [
|
|
1588
|
+
), mo = Nt.define([
|
|
1589
|
+
{ tag: c.keyword, color: ro },
|
|
1590
|
+
{ tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: pt },
|
|
1591
|
+
{ tag: [c.function(c.variableName), c.labelName], color: ao },
|
|
1592
|
+
{ tag: [c.color, c.constant(c.name), c.standard(c.name)], color: yt },
|
|
1593
|
+
{ tag: [c.definition(c.name), c.separator], color: ue },
|
|
1594
1594
|
{
|
|
1595
1595
|
tag: [
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1596
|
+
c.typeName,
|
|
1597
|
+
c.className,
|
|
1598
|
+
c.number,
|
|
1599
|
+
c.changed,
|
|
1600
|
+
c.annotation,
|
|
1601
|
+
c.modifier,
|
|
1602
|
+
c.self,
|
|
1603
|
+
c.namespace
|
|
1604
1604
|
],
|
|
1605
1605
|
color: to
|
|
1606
1606
|
},
|
|
1607
1607
|
{
|
|
1608
1608
|
tag: [
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1609
|
+
c.operator,
|
|
1610
|
+
c.operatorKeyword,
|
|
1611
|
+
c.url,
|
|
1612
|
+
c.escape,
|
|
1613
|
+
c.regexp,
|
|
1614
|
+
c.link,
|
|
1615
|
+
c.special(c.string)
|
|
1616
1616
|
],
|
|
1617
1617
|
color: lo
|
|
1618
1618
|
},
|
|
1619
|
-
{ tag: [
|
|
1620
|
-
{ tag:
|
|
1621
|
-
{ tag:
|
|
1622
|
-
{ tag:
|
|
1623
|
-
{ tag:
|
|
1624
|
-
{ tag:
|
|
1625
|
-
{ tag: [
|
|
1626
|
-
{ tag: [
|
|
1627
|
-
{ tag:
|
|
1619
|
+
{ tag: [c.meta, c.comment], color: $t },
|
|
1620
|
+
{ tag: c.strong, fontWeight: "bold" },
|
|
1621
|
+
{ tag: c.emphasis, fontStyle: "italic" },
|
|
1622
|
+
{ tag: c.strikethrough, textDecoration: "line-through" },
|
|
1623
|
+
{ tag: c.link, color: $t, textDecoration: "underline" },
|
|
1624
|
+
{ tag: c.heading, fontWeight: "bold", color: pt },
|
|
1625
|
+
{ tag: [c.atom, c.bool, c.special(c.variableName)], color: yt },
|
|
1626
|
+
{ tag: [c.processingInstruction, c.string, c.inserted], color: no },
|
|
1627
|
+
{ tag: c.invalid, color: oo }
|
|
1628
1628
|
]), xt = [
|
|
1629
1629
|
uo,
|
|
1630
|
-
|
|
1631
|
-
], fe = (e, o, l, a,
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
selection:
|
|
1630
|
+
Ot(mo)
|
|
1631
|
+
], fe = (e, o, l, a, r) => (i, m, g, u) => {
|
|
1632
|
+
const s = `${e}${o}`.slice(u - g);
|
|
1633
|
+
i.dispatch(i.state.replaceSelection(`${s}${l}${a}`));
|
|
1634
|
+
const f = g + m.label.length + (r === "title" ? l.length : 0);
|
|
1635
|
+
i.dispatch({
|
|
1636
|
+
selection: z.create(
|
|
1637
1637
|
[
|
|
1638
|
-
|
|
1639
|
-
g + m.label.length + (
|
|
1640
|
-
|
|
1638
|
+
z.range(
|
|
1639
|
+
g + m.label.length + (r === "title" ? 1 : -o.length),
|
|
1640
|
+
f
|
|
1641
1641
|
),
|
|
1642
|
-
|
|
1642
|
+
z.cursor(f)
|
|
1643
1643
|
],
|
|
1644
1644
|
1
|
|
1645
1645
|
)
|
|
1646
|
-
}),
|
|
1647
|
-
}, St = (e) => (o, l, a,
|
|
1648
|
-
const
|
|
1649
|
-
o.dispatch(o.state.replaceSelection(`${
|
|
1646
|
+
}), i.focus();
|
|
1647
|
+
}, St = (e) => (o, l, a, r) => {
|
|
1648
|
+
const i = e.slice(r - a);
|
|
1649
|
+
o.dispatch(o.state.replaceSelection(`${i} `));
|
|
1650
1650
|
}, go = (e) => {
|
|
1651
1651
|
const o = (l) => {
|
|
1652
1652
|
const a = l.matchBefore(
|
|
@@ -1656,8 +1656,8 @@ $$
|
|
|
1656
1656
|
from: a.from,
|
|
1657
1657
|
options: [
|
|
1658
1658
|
// 标题
|
|
1659
|
-
...["h1", "h2", "h3", "h4", "h5", "h6"].map((
|
|
1660
|
-
const m = new Array(
|
|
1659
|
+
...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
|
|
1660
|
+
const m = new Array(i + 1).fill("#").join("");
|
|
1661
1661
|
return {
|
|
1662
1662
|
label: m,
|
|
1663
1663
|
type: "text",
|
|
@@ -1665,12 +1665,12 @@ $$
|
|
|
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: St(
|
|
1673
|
+
apply: St(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: fe(
|
|
1684
|
+
apply: fe(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
|
|
1685
1685
|
})),
|
|
1686
1686
|
// 链接
|
|
1687
1687
|
{
|
|
@@ -1733,10 +1733,10 @@ $$`, "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: fe("!!!", ` ${
|
|
1739
|
+
apply: fe("!!!", ` ${r}`, " Title", `
|
|
1740
1740
|
|
|
1741
1741
|
!!!`, "title")
|
|
1742
1742
|
}))
|
|
@@ -1746,7 +1746,7 @@ $$`, "title")
|
|
|
1746
1746
|
return dl({
|
|
1747
1747
|
override: e ? [o, ...e] : [o]
|
|
1748
1748
|
});
|
|
1749
|
-
}, At = go,
|
|
1749
|
+
}, At = go, ee = (e) => {
|
|
1750
1750
|
const o = new be();
|
|
1751
1751
|
return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
|
|
1752
1752
|
effects: nl.appendConfig.of(o.of(a))
|
|
@@ -1766,7 +1766,7 @@ class fo {
|
|
|
1766
1766
|
q(this, "toggleDisabled");
|
|
1767
1767
|
q(this, "toggleReadOnly");
|
|
1768
1768
|
q(this, "toggleMaxlength");
|
|
1769
|
-
this.view = o, this.toggleTabSize =
|
|
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() {
|
|
1772
1772
|
return this.view.state.doc.toString();
|
|
@@ -1818,29 +1818,29 @@ class fo {
|
|
|
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: z.create(
|
|
1826
1826
|
[
|
|
1827
|
-
|
|
1828
|
-
|
|
1827
|
+
z.range(r + l.deviationStart, i),
|
|
1828
|
+
z.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
|
+
v.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
|
/**
|
|
@@ -1865,21 +1865,21 @@ class fo {
|
|
|
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: z.create(
|
|
1882
|
+
[z.range(l, a), z.cursor(r)],
|
|
1883
1883
|
1
|
|
1884
1884
|
)
|
|
1885
1885
|
});
|
|
@@ -1902,33 +1902,33 @@ const bo = (e) => {
|
|
|
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
|
+
v.emit(
|
|
1907
1907
|
o,
|
|
1908
1908
|
we,
|
|
1909
|
-
Array.from(
|
|
1909
|
+
Array.from(i).filter((m) => /image\/.*/.test(m.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
|
+
v.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 && v.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
1928
|
}, ho = bo, vo = (e) => {
|
|
1929
1929
|
const o = A("editorId");
|
|
1930
|
-
|
|
1931
|
-
|
|
1930
|
+
Y(() => {
|
|
1931
|
+
v.on(o, {
|
|
1932
1932
|
name: Jt,
|
|
1933
1933
|
callback(l) {
|
|
1934
1934
|
var a;
|
|
@@ -1940,7 +1940,7 @@ const bo = (e) => {
|
|
|
1940
1940
|
{
|
|
1941
1941
|
key: "Ctrl-b",
|
|
1942
1942
|
mac: "Cmd-b",
|
|
1943
|
-
run: () => (
|
|
1943
|
+
run: () => (v.emit(e, x, "bold"), !0)
|
|
1944
1944
|
},
|
|
1945
1945
|
{
|
|
1946
1946
|
key: "Ctrl-d",
|
|
@@ -1951,90 +1951,90 @@ const bo = (e) => {
|
|
|
1951
1951
|
{
|
|
1952
1952
|
key: "Ctrl-s",
|
|
1953
1953
|
mac: "Cmd-s",
|
|
1954
|
-
run: (D) => (
|
|
1955
|
-
shift: () => (
|
|
1954
|
+
run: (D) => (v.emit(e, Dt, D.state.doc.toString()), !0),
|
|
1955
|
+
shift: () => (v.emit(e, x, "strikeThrough"), !0)
|
|
1956
1956
|
},
|
|
1957
1957
|
{
|
|
1958
1958
|
key: "Ctrl-u",
|
|
1959
1959
|
mac: "Cmd-u",
|
|
1960
|
-
run: () => (
|
|
1961
|
-
shift: () => (
|
|
1960
|
+
run: () => (v.emit(e, x, "underline"), !0),
|
|
1961
|
+
shift: () => (v.emit(e, x, "unorderedList"), !0)
|
|
1962
1962
|
},
|
|
1963
1963
|
{
|
|
1964
1964
|
key: "Ctrl-i",
|
|
1965
1965
|
mac: "Cmd-i",
|
|
1966
|
-
run: () => (
|
|
1967
|
-
shift: () => (
|
|
1966
|
+
run: () => (v.emit(e, x, "italic"), !0),
|
|
1967
|
+
shift: () => (v.emit(e, ye, "image"), !0)
|
|
1968
1968
|
},
|
|
1969
1969
|
{
|
|
1970
1970
|
key: "Ctrl-1",
|
|
1971
1971
|
mac: "Cmd-1",
|
|
1972
|
-
run: () => (
|
|
1972
|
+
run: () => (v.emit(e, x, "h1"), !0)
|
|
1973
1973
|
},
|
|
1974
1974
|
{
|
|
1975
1975
|
key: "Ctrl-2",
|
|
1976
1976
|
mac: "Cmd-2",
|
|
1977
|
-
run: () => (
|
|
1977
|
+
run: () => (v.emit(e, x, "h2"), !0)
|
|
1978
1978
|
},
|
|
1979
1979
|
{
|
|
1980
1980
|
key: "Ctrl-3",
|
|
1981
1981
|
mac: "Cmd-3",
|
|
1982
|
-
run: () => (
|
|
1982
|
+
run: () => (v.emit(e, x, "h3"), !0)
|
|
1983
1983
|
},
|
|
1984
1984
|
{
|
|
1985
1985
|
key: "Ctrl-4",
|
|
1986
1986
|
mac: "Cmd-4",
|
|
1987
|
-
run: () => (
|
|
1987
|
+
run: () => (v.emit(e, x, "h4"), !0)
|
|
1988
1988
|
},
|
|
1989
1989
|
{
|
|
1990
1990
|
key: "Ctrl-5",
|
|
1991
1991
|
mac: "Cmd-5",
|
|
1992
|
-
run: () => (
|
|
1992
|
+
run: () => (v.emit(e, x, "h5"), !0)
|
|
1993
1993
|
},
|
|
1994
1994
|
{
|
|
1995
1995
|
key: "Ctrl-6",
|
|
1996
1996
|
mac: "Cmd-6",
|
|
1997
|
-
run: () => (
|
|
1997
|
+
run: () => (v.emit(e, x, "h6"), !0)
|
|
1998
1998
|
},
|
|
1999
1999
|
{
|
|
2000
2000
|
key: "Ctrl-ArrowUp",
|
|
2001
2001
|
mac: "Cmd-ArrowUp",
|
|
2002
|
-
run: () => (
|
|
2002
|
+
run: () => (v.emit(e, x, "sup"), !0)
|
|
2003
2003
|
},
|
|
2004
2004
|
{
|
|
2005
2005
|
key: "Ctrl-ArrowDown",
|
|
2006
2006
|
mac: "Cmd-ArrowDown",
|
|
2007
|
-
run: () => (
|
|
2007
|
+
run: () => (v.emit(e, x, "sub"), !0)
|
|
2008
2008
|
},
|
|
2009
2009
|
{
|
|
2010
2010
|
key: "Ctrl-o",
|
|
2011
2011
|
mac: "Cmd-o",
|
|
2012
|
-
run: () => (
|
|
2012
|
+
run: () => (v.emit(e, x, "orderedList"), !0)
|
|
2013
2013
|
},
|
|
2014
2014
|
{
|
|
2015
2015
|
key: "Ctrl-c",
|
|
2016
2016
|
mac: "Cmd-c",
|
|
2017
|
-
shift: () => (
|
|
2018
|
-
any(D,
|
|
2019
|
-
return (
|
|
2017
|
+
shift: () => (v.emit(e, x, "code"), !0),
|
|
2018
|
+
any(D, E) {
|
|
2019
|
+
return (E.ctrlKey || E.metaKey) && E.altKey && E.code === "KeyC" ? (v.emit(e, x, "codeRow"), !0) : !1;
|
|
2020
2020
|
}
|
|
2021
2021
|
},
|
|
2022
2022
|
{
|
|
2023
2023
|
key: "Ctrl-l",
|
|
2024
2024
|
mac: "Cmd-l",
|
|
2025
|
-
run: () => (
|
|
2025
|
+
run: () => (v.emit(e, ye, "link"), !0)
|
|
2026
2026
|
},
|
|
2027
2027
|
{
|
|
2028
2028
|
key: "Ctrl-f",
|
|
2029
2029
|
mac: "Cmd-f",
|
|
2030
|
-
shift: () => o.noPrettier ? !1 : (
|
|
2030
|
+
shift: () => o.noPrettier ? !1 : (v.emit(e, x, "prettier"), !0)
|
|
2031
2031
|
},
|
|
2032
2032
|
{
|
|
2033
|
-
any: (D,
|
|
2033
|
+
any: (D, E) => (E.ctrlKey || E.metaKey) && E.altKey && E.shiftKey && E.code === "KeyT" ? (v.emit(e, x, "table"), !0) : !1
|
|
2034
2034
|
}
|
|
2035
2035
|
], po = Co, $o = (e) => {
|
|
2036
|
-
const o = A("tabWidth"), l = A("editorId"), a = A("theme"),
|
|
2037
|
-
ll.of([...
|
|
2036
|
+
const o = A("tabWidth"), l = A("editorId"), a = A("theme"), r = U(), i = Rt(), m = new be(), g = new be(), u = new be(), s = po(l, e), f = ho(e), w = [
|
|
2037
|
+
ll.of([...s, il]),
|
|
2038
2038
|
el,
|
|
2039
2039
|
m.of(al({ codeLanguages: ol })),
|
|
2040
2040
|
// 横向换行
|
|
@@ -2043,130 +2043,172 @@ const bo = (e) => {
|
|
|
2043
2043
|
d.docChanged && e.onChange(d.state.doc.toString());
|
|
2044
2044
|
}),
|
|
2045
2045
|
ge.domEventHandlers({
|
|
2046
|
-
paste:
|
|
2046
|
+
paste: f,
|
|
2047
2047
|
blur: e.onBlur,
|
|
2048
2048
|
focus: e.onFocus,
|
|
2049
2049
|
drop: e.onDrop,
|
|
2050
2050
|
input: (d) => {
|
|
2051
2051
|
e.onInput && e.onInput(d);
|
|
2052
|
-
const { data:
|
|
2053
|
-
e.maxlength && e.modelValue.length +
|
|
2052
|
+
const { data: C } = d;
|
|
2053
|
+
e.maxlength && e.modelValue.length + C.length > e.maxlength && v.emit(l, le, {
|
|
2054
2054
|
name: "overlength",
|
|
2055
2055
|
message: "The input text is too long",
|
|
2056
|
-
data:
|
|
2056
|
+
data: C
|
|
2057
2057
|
});
|
|
2058
2058
|
}
|
|
2059
2059
|
})
|
|
2060
|
-
],
|
|
2060
|
+
], k = () => {
|
|
2061
2061
|
const d = [
|
|
2062
|
-
...
|
|
2062
|
+
...w,
|
|
2063
2063
|
g.of(a.value === "light" ? xt : Ct),
|
|
2064
2064
|
u.of(At(e.completions))
|
|
2065
2065
|
];
|
|
2066
|
-
return
|
|
2067
|
-
...
|
|
2066
|
+
return Q.codeMirrorExtensions(a.value, d, [
|
|
2067
|
+
...s
|
|
2068
2068
|
]);
|
|
2069
2069
|
};
|
|
2070
|
-
return
|
|
2070
|
+
return Y(() => {
|
|
2071
2071
|
const d = new ge({
|
|
2072
2072
|
doc: e.modelValue,
|
|
2073
|
-
parent:
|
|
2074
|
-
extensions: [
|
|
2075
|
-
}),
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
}, 0),
|
|
2073
|
+
parent: r.value,
|
|
2074
|
+
extensions: [k()]
|
|
2075
|
+
}), C = new fo(d);
|
|
2076
|
+
i.value = C, setTimeout(() => {
|
|
2077
|
+
C.setTabSize(o), C.setDisabled(e.disabled), C.setReadOnly(e.readonly), e.placeholder && C.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && C.setMaxLength(e.maxlength), e.autofocus && d.focus();
|
|
2078
|
+
}, 0), v.on(l, {
|
|
2079
2079
|
name: It,
|
|
2080
2080
|
callback() {
|
|
2081
2081
|
sl(d);
|
|
2082
2082
|
}
|
|
2083
|
-
}),
|
|
2084
|
-
name:
|
|
2083
|
+
}), v.on(l, {
|
|
2084
|
+
name: Et,
|
|
2085
2085
|
callback() {
|
|
2086
2086
|
cl(d);
|
|
2087
2087
|
}
|
|
2088
|
-
}),
|
|
2089
|
-
name:
|
|
2090
|
-
callback(
|
|
2088
|
+
}), v.on(l, {
|
|
2089
|
+
name: x,
|
|
2090
|
+
callback(h, b = {}) {
|
|
2091
2091
|
var S;
|
|
2092
|
-
const { text:
|
|
2093
|
-
(S =
|
|
2092
|
+
const { text: p, options: T } = _l(h, i.value, b);
|
|
2093
|
+
(S = i.value) == null || S.replaceSelectedText(p, T, l);
|
|
2094
2094
|
}
|
|
2095
2095
|
});
|
|
2096
|
-
}),
|
|
2096
|
+
}), O(
|
|
2097
2097
|
a,
|
|
2098
2098
|
() => {
|
|
2099
2099
|
var d;
|
|
2100
|
-
(d =
|
|
2100
|
+
(d = i.value) == null || d.view.dispatch({
|
|
2101
2101
|
effects: g.reconfigure(a.value === "light" ? xt : Ct)
|
|
2102
2102
|
});
|
|
2103
2103
|
},
|
|
2104
2104
|
{
|
|
2105
2105
|
deep: !0
|
|
2106
2106
|
}
|
|
2107
|
-
),
|
|
2107
|
+
), O(
|
|
2108
2108
|
() => e.completions,
|
|
2109
2109
|
() => {
|
|
2110
2110
|
var d;
|
|
2111
|
-
(d =
|
|
2111
|
+
(d = i.value) == null || d.view.dispatch({
|
|
2112
2112
|
effects: u.reconfigure(At(e.completions))
|
|
2113
2113
|
});
|
|
2114
2114
|
},
|
|
2115
2115
|
{
|
|
2116
2116
|
deep: !0
|
|
2117
2117
|
}
|
|
2118
|
-
),
|
|
2118
|
+
), O(
|
|
2119
2119
|
() => e.modelValue,
|
|
2120
2120
|
() => {
|
|
2121
|
-
var d,
|
|
2122
|
-
((d =
|
|
2121
|
+
var d, C;
|
|
2122
|
+
((d = i.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((C = i.value) == null || C.setValue(e.modelValue));
|
|
2123
2123
|
}
|
|
2124
|
-
),
|
|
2124
|
+
), O(
|
|
2125
2125
|
() => e.placeholder,
|
|
2126
2126
|
() => {
|
|
2127
2127
|
var d;
|
|
2128
|
-
(d =
|
|
2128
|
+
(d = i.value) == null || d.setPlaceholder(e.placeholder);
|
|
2129
2129
|
}
|
|
2130
|
-
),
|
|
2130
|
+
), O(
|
|
2131
2131
|
() => e.disabled,
|
|
2132
2132
|
() => {
|
|
2133
2133
|
var d;
|
|
2134
|
-
(d =
|
|
2134
|
+
(d = i.value) == null || d.setDisabled(e.disabled);
|
|
2135
2135
|
}
|
|
2136
|
-
),
|
|
2136
|
+
), O(
|
|
2137
2137
|
() => e.readonly,
|
|
2138
2138
|
() => {
|
|
2139
2139
|
var d;
|
|
2140
|
-
(d =
|
|
2140
|
+
(d = i.value) == null || d.setDisabled(e.readonly);
|
|
2141
2141
|
}
|
|
2142
|
-
),
|
|
2142
|
+
), O(
|
|
2143
2143
|
() => e.maxlength,
|
|
2144
2144
|
() => {
|
|
2145
2145
|
var d;
|
|
2146
|
-
e.maxlength && ((d =
|
|
2146
|
+
e.maxlength && ((d = i.value) == null || d.setMaxLength(e.maxlength));
|
|
2147
2147
|
}
|
|
2148
|
-
), ko(
|
|
2149
|
-
inputWrapperRef:
|
|
2150
|
-
codeMirrorUt:
|
|
2148
|
+
), ko(i), {
|
|
2149
|
+
inputWrapperRef: r,
|
|
2150
|
+
codeMirrorUt: i
|
|
2151
|
+
};
|
|
2152
|
+
}, yo = $o, To = (e, o, l) => {
|
|
2153
|
+
const a = G({
|
|
2154
|
+
resizedWidth: e.inputBoxWitdh
|
|
2155
|
+
}), r = G({
|
|
2156
|
+
width: e.inputBoxWitdh
|
|
2157
|
+
}), i = G({
|
|
2158
|
+
left: e.inputBoxWitdh,
|
|
2159
|
+
display: "initial"
|
|
2160
|
+
}), m = (s) => {
|
|
2161
|
+
var d, C;
|
|
2162
|
+
const f = ((d = o.value) == null ? void 0 : d.offsetWidth) || 0, w = ((C = o.value) == null ? void 0 : C.getBoundingClientRect().x) || 0;
|
|
2163
|
+
let k = s.x - w;
|
|
2164
|
+
k < 100 ? k = 100 : k > f - 100 && (k = f - 100), r.width = `${k}px`, i.left = `${k}px`, a.resizedWidth = `${k}px`;
|
|
2165
|
+
}, g = () => {
|
|
2166
|
+
document.addEventListener("mousemove", m);
|
|
2167
|
+
}, u = () => {
|
|
2168
|
+
document.removeEventListener("mousemove", m);
|
|
2151
2169
|
};
|
|
2152
|
-
|
|
2170
|
+
return Y(() => {
|
|
2171
|
+
var s;
|
|
2172
|
+
(s = l.value) == null || s.addEventListener("mousedown", g), document.addEventListener("mouseup", u);
|
|
2173
|
+
}), Lt(() => {
|
|
2174
|
+
var s, f;
|
|
2175
|
+
(s = l.value) == null || s.removeEventListener("mousedown", g), (f = l.value) == null || f.removeEventListener("mouseup", u);
|
|
2176
|
+
}), O(
|
|
2177
|
+
[te(e.setting, "htmlPreview"), te(e.setting, "preview")],
|
|
2178
|
+
() => {
|
|
2179
|
+
!e.setting.htmlPreview && !e.setting.preview ? (a.resizedWidth = r.width, r.width = "100%", i.display = "none") : (r.width = a.resizedWidth, i.display = "initial");
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
immediate: !0
|
|
2183
|
+
}
|
|
2184
|
+
), { inputWrapperStyle: r, resizeOperateStyle: i };
|
|
2185
|
+
}, wo = To, xo = /* @__PURE__ */ P({
|
|
2153
2186
|
name: "MDEditorContent",
|
|
2154
2187
|
props: ml,
|
|
2155
2188
|
setup(e) {
|
|
2156
|
-
const o = A("editorId"), l =
|
|
2157
|
-
inputWrapperRef:
|
|
2158
|
-
codeMirrorUt:
|
|
2159
|
-
} = yo(e)
|
|
2160
|
-
|
|
2161
|
-
|
|
2189
|
+
const o = A("editorId"), l = U(""), a = U(), r = U(), {
|
|
2190
|
+
inputWrapperRef: i,
|
|
2191
|
+
codeMirrorUt: m
|
|
2192
|
+
} = yo(e), {
|
|
2193
|
+
inputWrapperStyle: g,
|
|
2194
|
+
resizeOperateStyle: u
|
|
2195
|
+
} = wo(e, a, r);
|
|
2196
|
+
return Ul(e, l, m), () => t("div", {
|
|
2197
|
+
class: `${n}-content`,
|
|
2198
|
+
ref: a
|
|
2162
2199
|
}, [t("div", {
|
|
2163
2200
|
class: `${n}-input-wrapper`,
|
|
2164
|
-
|
|
2201
|
+
style: g,
|
|
2202
|
+
ref: i
|
|
2203
|
+
}, null), t("div", {
|
|
2204
|
+
class: `${n}-resize-operate`,
|
|
2205
|
+
style: u,
|
|
2206
|
+
ref: r
|
|
2165
2207
|
}, null), t(gl, {
|
|
2166
2208
|
modelValue: e.modelValue,
|
|
2167
2209
|
setting: e.setting,
|
|
2168
|
-
onHtmlChanged: (
|
|
2169
|
-
l.value =
|
|
2210
|
+
onHtmlChanged: (s) => {
|
|
2211
|
+
l.value = s, e.onHtmlChanged(s);
|
|
2170
2212
|
},
|
|
2171
2213
|
onGetCatalog: e.onGetCatalog,
|
|
2172
2214
|
mdHeadingId: e.mdHeadingId,
|
|
@@ -2176,7 +2218,7 @@ const bo = (e) => {
|
|
|
2176
2218
|
formatCopiedText: e.formatCopiedText,
|
|
2177
2219
|
noHighlight: e.noHighlight,
|
|
2178
2220
|
noImgZoomIn: e.noImgZoomIn
|
|
2179
|
-
}, null), e.catalogVisible && t(
|
|
2221
|
+
}, null), e.catalogVisible && t(Vt, {
|
|
2180
2222
|
theme: e.theme,
|
|
2181
2223
|
class: `${n}-catalog-editor`,
|
|
2182
2224
|
editorId: o,
|
|
@@ -2184,7 +2226,7 @@ const bo = (e) => {
|
|
|
2184
2226
|
key: "internal-catalog"
|
|
2185
2227
|
}, null)]);
|
|
2186
2228
|
}
|
|
2187
|
-
}),
|
|
2229
|
+
}), So = /* @__PURE__ */ P({
|
|
2188
2230
|
props: {
|
|
2189
2231
|
modelValue: {
|
|
2190
2232
|
type: String,
|
|
@@ -2202,7 +2244,7 @@ const bo = (e) => {
|
|
|
2202
2244
|
}, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
|
|
2203
2245
|
};
|
|
2204
2246
|
}
|
|
2205
|
-
}),
|
|
2247
|
+
}), Ao = {
|
|
2206
2248
|
checked: {
|
|
2207
2249
|
type: Boolean,
|
|
2208
2250
|
default: !1
|
|
@@ -2212,8 +2254,8 @@ const bo = (e) => {
|
|
|
2212
2254
|
default: () => {
|
|
2213
2255
|
}
|
|
2214
2256
|
}
|
|
2215
|
-
},
|
|
2216
|
-
props:
|
|
2257
|
+
}, Mo = /* @__PURE__ */ P({
|
|
2258
|
+
props: Ao,
|
|
2217
2259
|
setup(e) {
|
|
2218
2260
|
return () => t("div", {
|
|
2219
2261
|
class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
|
|
@@ -2222,7 +2264,7 @@ const bo = (e) => {
|
|
|
2222
2264
|
}
|
|
2223
2265
|
}, null);
|
|
2224
2266
|
}
|
|
2225
|
-
}),
|
|
2267
|
+
}), Lo = {
|
|
2226
2268
|
scrollAuto: {
|
|
2227
2269
|
type: Boolean
|
|
2228
2270
|
},
|
|
@@ -2231,8 +2273,8 @@ const bo = (e) => {
|
|
|
2231
2273
|
default: () => {
|
|
2232
2274
|
}
|
|
2233
2275
|
}
|
|
2234
|
-
},
|
|
2235
|
-
props:
|
|
2276
|
+
}, Do = /* @__PURE__ */ P({
|
|
2277
|
+
props: Lo,
|
|
2236
2278
|
setup(e) {
|
|
2237
2279
|
const o = A("usedLanguageText");
|
|
2238
2280
|
return () => {
|
|
@@ -2244,13 +2286,13 @@ const bo = (e) => {
|
|
|
2244
2286
|
onClick: () => {
|
|
2245
2287
|
e.onScrollAutoChange(!e.scrollAuto);
|
|
2246
2288
|
}
|
|
2247
|
-
}, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(
|
|
2289
|
+
}, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Mo, {
|
|
2248
2290
|
checked: e.scrollAuto,
|
|
2249
2291
|
onChange: e.onScrollAutoChange
|
|
2250
2292
|
}, null)]);
|
|
2251
2293
|
};
|
|
2252
2294
|
}
|
|
2253
|
-
}),
|
|
2295
|
+
}), Eo = {
|
|
2254
2296
|
modelValue: {
|
|
2255
2297
|
type: String,
|
|
2256
2298
|
default: ""
|
|
@@ -2270,22 +2312,22 @@ const bo = (e) => {
|
|
|
2270
2312
|
defFooters: {
|
|
2271
2313
|
type: Object
|
|
2272
2314
|
}
|
|
2273
|
-
},
|
|
2315
|
+
}, Io = /* @__PURE__ */ P({
|
|
2274
2316
|
name: "MDEditorFooter",
|
|
2275
|
-
props:
|
|
2317
|
+
props: Eo,
|
|
2276
2318
|
setup(e) {
|
|
2277
2319
|
const o = Te(() => {
|
|
2278
|
-
const a = e.footers.indexOf("="),
|
|
2279
|
-
return [
|
|
2320
|
+
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);
|
|
2321
|
+
return [r, i];
|
|
2280
2322
|
}), l = (a) => {
|
|
2281
|
-
if (
|
|
2323
|
+
if (Ut.includes(a))
|
|
2282
2324
|
switch (a) {
|
|
2283
2325
|
case "markdownTotal":
|
|
2284
|
-
return t(
|
|
2326
|
+
return t(So, {
|
|
2285
2327
|
modelValue: e.modelValue
|
|
2286
2328
|
}, null);
|
|
2287
2329
|
case "scrollSwitch":
|
|
2288
|
-
return t(
|
|
2330
|
+
return t(Do, {
|
|
2289
2331
|
scrollAuto: e.scrollAuto,
|
|
2290
2332
|
onScrollAutoChange: e.onScrollAutoChange
|
|
2291
2333
|
}, null);
|
|
@@ -2294,17 +2336,17 @@ const bo = (e) => {
|
|
|
2294
2336
|
return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
|
|
2295
2337
|
};
|
|
2296
2338
|
return () => {
|
|
2297
|
-
const a = o.value[0].map((
|
|
2339
|
+
const a = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
|
|
2298
2340
|
return t("div", {
|
|
2299
2341
|
class: `${n}-footer`
|
|
2300
2342
|
}, [t("div", {
|
|
2301
2343
|
class: `${n}-footer-left`
|
|
2302
2344
|
}, [a]), t("div", {
|
|
2303
2345
|
class: `${n}-footer-right`
|
|
2304
|
-
}, [
|
|
2346
|
+
}, [r])]);
|
|
2305
2347
|
};
|
|
2306
2348
|
}
|
|
2307
|
-
}),
|
|
2349
|
+
}), Ho = /* @__PURE__ */ P({
|
|
2308
2350
|
name: "MdEditorV3",
|
|
2309
2351
|
props: fl,
|
|
2310
2352
|
emits: bl,
|
|
@@ -2312,20 +2354,20 @@ const bo = (e) => {
|
|
|
2312
2354
|
const {
|
|
2313
2355
|
editorId: l,
|
|
2314
2356
|
noKatex: a,
|
|
2315
|
-
noMermaid:
|
|
2316
|
-
noPrettier:
|
|
2357
|
+
noMermaid: r,
|
|
2358
|
+
noPrettier: i,
|
|
2317
2359
|
noUploadImg: m,
|
|
2318
2360
|
noHighlight: g
|
|
2319
|
-
} = e, u =
|
|
2361
|
+
} = e, u = G({
|
|
2320
2362
|
scrollAuto: e.scrollAuto
|
|
2321
2363
|
});
|
|
2322
2364
|
hl(e, o), vl(e), kl(e), Cl(e, o);
|
|
2323
|
-
const [
|
|
2324
|
-
return
|
|
2325
|
-
|
|
2326
|
-
}), yl(e, o,
|
|
2327
|
-
var
|
|
2328
|
-
const
|
|
2365
|
+
const [s, f] = pl(e, o), w = $l(e);
|
|
2366
|
+
return Lt(() => {
|
|
2367
|
+
v.clear(l);
|
|
2368
|
+
}), yl(e, o, w, s, f), () => {
|
|
2369
|
+
var C;
|
|
2370
|
+
const k = gt({
|
|
2329
2371
|
props: e,
|
|
2330
2372
|
ctx: o
|
|
2331
2373
|
}, "defToolbars"), d = gt({
|
|
@@ -2334,24 +2376,24 @@ const bo = (e) => {
|
|
|
2334
2376
|
}, "defFooters");
|
|
2335
2377
|
return t("div", {
|
|
2336
2378
|
id: l,
|
|
2337
|
-
class: [n, e.class, e.theme === "dark" && `${n}-dark`,
|
|
2379
|
+
class: [n, e.class, e.theme === "dark" && `${n}-dark`, s.fullscreen || s.pageFullscreen ? `${n}-fullscreen` : ""],
|
|
2338
2380
|
style: e.style
|
|
2339
|
-
}, [t(
|
|
2340
|
-
noPrettier:
|
|
2381
|
+
}, [t(Fl, {
|
|
2382
|
+
noPrettier: i,
|
|
2341
2383
|
toolbars: e.toolbars,
|
|
2342
2384
|
toolbarsExclude: e.toolbarsExclude,
|
|
2343
|
-
setting:
|
|
2344
|
-
updateSetting:
|
|
2385
|
+
setting: s,
|
|
2386
|
+
updateSetting: f,
|
|
2345
2387
|
tableShape: e.tableShape,
|
|
2346
|
-
defToolbars:
|
|
2388
|
+
defToolbars: k,
|
|
2347
2389
|
noUploadImg: m,
|
|
2348
2390
|
showToolbarName: e.showToolbarName
|
|
2349
|
-
}, null), t(
|
|
2391
|
+
}, null), t(xo, {
|
|
2350
2392
|
modelValue: e.modelValue,
|
|
2351
|
-
setting:
|
|
2393
|
+
setting: s,
|
|
2352
2394
|
mdHeadingId: e.mdHeadingId,
|
|
2353
|
-
noMermaid:
|
|
2354
|
-
noPrettier:
|
|
2395
|
+
noMermaid: r,
|
|
2396
|
+
noPrettier: i,
|
|
2355
2397
|
sanitize: e.sanitize,
|
|
2356
2398
|
placeholder: e.placeholder,
|
|
2357
2399
|
noKatex: a,
|
|
@@ -2363,42 +2405,43 @@ const bo = (e) => {
|
|
|
2363
2405
|
maxlength: e.maxLength,
|
|
2364
2406
|
autoDetectCode: e.autoDetectCode,
|
|
2365
2407
|
noHighlight: g,
|
|
2366
|
-
onChange: (
|
|
2367
|
-
e.onChange ? e.onChange(
|
|
2408
|
+
onChange: (h) => {
|
|
2409
|
+
e.onChange ? e.onChange(h) : (o.emit("update:modelValue", h), o.emit("onChange", h));
|
|
2368
2410
|
},
|
|
2369
|
-
onHtmlChanged: (
|
|
2370
|
-
e.onHtmlChanged ? e.onHtmlChanged(
|
|
2411
|
+
onHtmlChanged: (h) => {
|
|
2412
|
+
e.onHtmlChanged ? e.onHtmlChanged(h) : o.emit("onHtmlChanged", h);
|
|
2371
2413
|
},
|
|
2372
|
-
onGetCatalog: (
|
|
2373
|
-
e.onGetCatalog ? e.onGetCatalog(
|
|
2414
|
+
onGetCatalog: (h) => {
|
|
2415
|
+
e.onGetCatalog ? e.onGetCatalog(h) : o.emit("onGetCatalog", h);
|
|
2374
2416
|
},
|
|
2375
|
-
onBlur: (
|
|
2376
|
-
e.onBlur ? e.onBlur(
|
|
2417
|
+
onBlur: (h) => {
|
|
2418
|
+
e.onBlur ? e.onBlur(h) : o.emit("onBlur", h);
|
|
2377
2419
|
},
|
|
2378
|
-
onFocus: (
|
|
2379
|
-
e.onFocus ? e.onFocus(
|
|
2420
|
+
onFocus: (h) => {
|
|
2421
|
+
e.onFocus ? e.onFocus(h) : o.emit("onFocus", h);
|
|
2380
2422
|
},
|
|
2381
|
-
onInput: (
|
|
2382
|
-
e.onInput ? e.onInput(
|
|
2423
|
+
onInput: (h) => {
|
|
2424
|
+
e.onInput ? e.onInput(h) : o.emit("onInput", h);
|
|
2383
2425
|
},
|
|
2384
2426
|
completions: e.completions,
|
|
2385
|
-
catalogVisible:
|
|
2427
|
+
catalogVisible: w.value,
|
|
2386
2428
|
theme: e.theme,
|
|
2387
2429
|
noImgZoomIn: e.noImgZoomIn,
|
|
2388
|
-
onDrop: (
|
|
2389
|
-
e.onDrop ? e.onDrop(
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2430
|
+
onDrop: (h) => {
|
|
2431
|
+
e.onDrop ? e.onDrop(h) : o.emit("onDrop", h);
|
|
2432
|
+
},
|
|
2433
|
+
inputBoxWitdh: e.inputBoxWitdh
|
|
2434
|
+
}, null), ((C = e.footers) == null ? void 0 : C.length) > 0 && t(Io, {
|
|
2392
2435
|
modelValue: e.modelValue,
|
|
2393
2436
|
footers: e.footers,
|
|
2394
2437
|
defFooters: d,
|
|
2395
2438
|
scrollAuto: u.scrollAuto,
|
|
2396
|
-
onScrollAutoChange: (
|
|
2439
|
+
onScrollAutoChange: (h) => u.scrollAuto = h
|
|
2397
2440
|
}, null)]);
|
|
2398
2441
|
};
|
|
2399
2442
|
}
|
|
2400
|
-
}), $e =
|
|
2401
|
-
$e.install = (e) => (e.component($e.name, $e), e.use(wl).use(
|
|
2443
|
+
}), $e = Ho;
|
|
2444
|
+
$e.install = (e) => (e.component($e.name, $e), e.use(wl).use(jt).use(xl).use(Vt).use(Tl), e);
|
|
2402
2445
|
export {
|
|
2403
2446
|
$e as default
|
|
2404
2447
|
};
|