md-editor-v3 4.8.0-beta.1 → 4.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/lib/cjs/MdEditor.cjs +27 -27
- package/lib/cjs/chunks/config.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +5 -5
- package/lib/es/MdEditor.mjs +533 -523
- package/lib/es/chunks/config.mjs +9 -8
- package/lib/es/chunks/index.mjs +64 -54
- package/lib/types/MdEditor/Editor.d.ts +8 -1
- package/lib/types/MdEditor/config.d.ts +4 -0
- package/lib/types/MdEditor/index.d.ts +16 -2
- 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 +6 -0
- package/lib/types/MdEditor/type.d.ts +1 -1
- package/lib/types/MdPreview/MdPreview.d.ts +2 -1
- package/lib/types/MdPreview/index.d.ts +6 -2
- package/lib/umd/index.js +33 -33
- package/package.json +1 -1
package/lib/es/chunks/config.mjs
CHANGED
|
@@ -239,19 +239,20 @@ const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2
|
|
|
239
239
|
}, l = {
|
|
240
240
|
editorExtensions: {},
|
|
241
241
|
editorConfig: {},
|
|
242
|
-
codeMirrorExtensions: (
|
|
242
|
+
codeMirrorExtensions: (t, i) => i,
|
|
243
243
|
markdownItConfig: () => {
|
|
244
244
|
},
|
|
245
|
-
markdownItPlugins: (
|
|
245
|
+
markdownItPlugins: (t) => t,
|
|
246
246
|
iconfontType: "svg"
|
|
247
|
-
}, j = (
|
|
248
|
-
if (
|
|
249
|
-
for (const
|
|
250
|
-
const s = i
|
|
251
|
-
s && (l[
|
|
247
|
+
}, j = (t) => {
|
|
248
|
+
if (t)
|
|
249
|
+
for (const i in t) {
|
|
250
|
+
const s = t[i];
|
|
251
|
+
s && (l[i] = s);
|
|
252
252
|
}
|
|
253
|
-
};
|
|
253
|
+
}, v = 170;
|
|
254
254
|
export {
|
|
255
|
+
v as M,
|
|
255
256
|
r as a,
|
|
256
257
|
m as b,
|
|
257
258
|
j as c,
|
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { inject as P, onMounted as S, watch as $, toRef as X, nextTick as B, shallowRef as
|
|
1
|
+
import { inject as P, onMounted as S, watch as $, toRef as X, nextTick as B, shallowRef as M, ref as L, computed as H, defineComponent as Q, createVNode as x, Fragment as ue, reactive as Y, provide as F, onBeforeUnmount as de } from "vue";
|
|
2
2
|
import { e as C, p, m as me, k as O, f as U, h as fe, s as j, a as pe, i as he, g as G, j as D, l as ge, b as ye, d as ve } from "./config.mjs";
|
|
3
|
-
import { u as be, a as we, b as g, P as ke, C as V, B as
|
|
3
|
+
import { u as be, a as we, b as g, P as ke, C as V, B as A, O as ee, E as $e, U as Ce, c as te, d as z, F as W, e as K, H as q, f as Z, R as ne, h as Ie, T as Se } from "./index4.mjs";
|
|
4
4
|
import { a as _, u as Ee } from "./dom.mjs";
|
|
5
5
|
import Pe from "medium-zoom";
|
|
6
6
|
import { debounce as oe } from "@vavt/util";
|
|
7
7
|
import Te from "copy-to-clipboard";
|
|
8
8
|
import _e from "markdown-it";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
9
|
+
import Fe from "markdown-it-image-figures";
|
|
10
|
+
import He from "markdown-it-task-lists";
|
|
11
|
+
import xe from "lru-cache";
|
|
12
|
+
const Ae = (e, a) => {
|
|
13
13
|
const l = P("editorId"), { noImgZoomIn: t } = e, n = oe(() => {
|
|
14
14
|
const r = document.querySelectorAll(`#${l}-preview img`);
|
|
15
15
|
r.length !== 0 && Pe(r, {
|
|
@@ -21,7 +21,7 @@ const Me = (e, a) => {
|
|
|
21
21
|
}), $([a, X(e.setting, "preview")], () => {
|
|
22
22
|
!t && n();
|
|
23
23
|
});
|
|
24
|
-
},
|
|
24
|
+
}, Me = Ae, Re = (e, a) => {
|
|
25
25
|
if (typeof a[e] == "string")
|
|
26
26
|
return a[e];
|
|
27
27
|
const l = `<i class="${p}-iconfont ${p}-icon-${e}"></i>`;
|
|
@@ -38,7 +38,7 @@ const Me = (e, a) => {
|
|
|
38
38
|
let s = -1;
|
|
39
39
|
(b = u.querySelector(".copy-button")) == null || b.remove();
|
|
40
40
|
const o = ((v = t.value.copyCode) == null ? void 0 : v.text) || "复制代码", d = document.createElement("span");
|
|
41
|
-
d.setAttribute("class", "copy-button"), d.dataset.tips = o, d.innerHTML =
|
|
41
|
+
d.setAttribute("class", "copy-button"), d.dataset.tips = o, d.innerHTML = Re("copy", n.value), d.addEventListener("click", () => {
|
|
42
42
|
var y, w;
|
|
43
43
|
clearTimeout(s);
|
|
44
44
|
const m = u.querySelector("code").innerText, h = Te(e.formatCopiedText(m)), f = ((y = t.value.copyCode) == null ? void 0 : y.successTips) || "已复制!", k = ((w = t.value.copyCode) == null ? void 0 : w.failTips) || "已复制!";
|
|
@@ -55,7 +55,7 @@ const Me = (e, a) => {
|
|
|
55
55
|
$(() => a.value, i), $(() => e.setting.preview, c), $(() => e.setting.htmlPreview, c), $(() => t.value, r), S(r);
|
|
56
56
|
}, Le = Be, Ne = (e) => {
|
|
57
57
|
var r;
|
|
58
|
-
const a = (r = C.editorExtensions) == null ? void 0 : r.highlight, l = a == null ? void 0 : a.instance, t = P("highlight"), n =
|
|
58
|
+
const a = (r = C.editorExtensions) == null ? void 0 : r.highlight, l = a == null ? void 0 : a.instance, t = P("highlight"), n = M(l);
|
|
59
59
|
return S(() => {
|
|
60
60
|
if (!e.noHighlight && !n.value) {
|
|
61
61
|
const i = document.createElement("script");
|
|
@@ -72,7 +72,7 @@ const Me = (e, a) => {
|
|
|
72
72
|
}
|
|
73
73
|
), n;
|
|
74
74
|
}, Oe = Ne, Ue = (e) => {
|
|
75
|
-
const a = P("theme"), { editorExtensions: l } = C, t = l == null ? void 0 : l.mermaid, n =
|
|
75
|
+
const a = P("theme"), { editorExtensions: l } = C, t = l == null ? void 0 : l.mermaid, n = M(t == null ? void 0 : t.instance), r = M(-1), i = new xe({
|
|
76
76
|
max: 1e3,
|
|
77
77
|
// 缓存10分钟
|
|
78
78
|
ttl: 6e5
|
|
@@ -133,7 +133,7 @@ const Me = (e, a) => {
|
|
|
133
133
|
} };
|
|
134
134
|
}, je = Ue, Ge = (e) => {
|
|
135
135
|
var n;
|
|
136
|
-
const a = (n = C.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t =
|
|
136
|
+
const a = (n = C.editorExtensions) == null ? void 0 : n.katex, l = a == null ? void 0 : a.instance, t = M(l);
|
|
137
137
|
return S(() => {
|
|
138
138
|
if (!e.noKatex && !t.value) {
|
|
139
139
|
const r = document.createElement("script");
|
|
@@ -161,7 +161,7 @@ const Me = (e, a) => {
|
|
|
161
161
|
can_open: l,
|
|
162
162
|
can_close: t
|
|
163
163
|
};
|
|
164
|
-
},
|
|
164
|
+
}, We = (e, a) => {
|
|
165
165
|
let l, t, n, r;
|
|
166
166
|
if (e.src[e.pos] !== "$")
|
|
167
167
|
return !1;
|
|
@@ -176,7 +176,7 @@ const Me = (e, a) => {
|
|
|
176
176
|
l += 1;
|
|
177
177
|
}
|
|
178
178
|
return l === -1 ? (a || (e.pending += "$"), e.pos = i, !0) : l - i === 0 ? (a || (e.pending += "$$"), e.pos = i + 1, !0) : (n = J(e, l), n.can_close ? (a || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(i, l)), e.pos = l + 1, !0) : (a || (e.pending += "$"), e.pos = i, !0));
|
|
179
|
-
},
|
|
179
|
+
}, Ke = (e, a, l, t) => {
|
|
180
180
|
let n, r, i, c, u = !1, s = e.bMarks[a] + e.tShift[a], o = e.eMarks[a];
|
|
181
181
|
if (s + 2 > o || e.src.slice(s, s + 2) !== "$$")
|
|
182
182
|
return !1;
|
|
@@ -188,7 +188,7 @@ const Me = (e, a) => {
|
|
|
188
188
|
const d = e.push("math_block", "math", 0);
|
|
189
189
|
return d.block = !0, d.content = (n && n.trim() ? n + `
|
|
190
190
|
` : "") + e.getLines(a + 1, i, e.tShift[a], !0) + (r && r.trim() ? r : ""), d.map = [a, e.line], d.markup = "$$", !0;
|
|
191
|
-
},
|
|
191
|
+
}, qe = (e, a) => {
|
|
192
192
|
const l = (n) => {
|
|
193
193
|
if (a.katexRef.value) {
|
|
194
194
|
const r = a.katexRef.value.renderToString(n, {
|
|
@@ -207,11 +207,11 @@ const Me = (e, a) => {
|
|
|
207
207
|
} else
|
|
208
208
|
return `<p class="${p}-katex-block" data-line=${r}>${n}</p>`;
|
|
209
209
|
};
|
|
210
|
-
e.inline.ruler.after("escape", "math_inline",
|
|
210
|
+
e.inline.ruler.after("escape", "math_inline", We), e.block.ruler.after("blockquote", "math_block", Ke, {
|
|
211
211
|
alt: ["paragraph", "reference", "blockquote", "list"]
|
|
212
212
|
}), e.renderer.rules.math_inline = (n, r) => l(n[r].content), e.renderer.rules.math_block = (n, r) => t(n[r].content, n[r].map[0]) + `
|
|
213
213
|
`;
|
|
214
|
-
}, Ze =
|
|
214
|
+
}, Ze = qe, Je = (e, a) => {
|
|
215
215
|
a = a || {};
|
|
216
216
|
const l = 3, t = a.marker || "!", n = t.charCodeAt(0), r = t.length;
|
|
217
217
|
let i = "", c = "";
|
|
@@ -314,7 +314,7 @@ const Me = (e, a) => {
|
|
|
314
314
|
l ? e.renderer.rules[a] = (t, n, r, i, c) => {
|
|
315
315
|
let u;
|
|
316
316
|
const s = l(t, n, r, i, c);
|
|
317
|
-
return t[n].map && t[n].level === 0 ? (u = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${u}"`)) : s;
|
|
317
|
+
return t[n].map && t[n].level === 0 && !/^<!--/.test(s) ? (u = t[n].map[0], s.replace(/^(<[^>]*)/, `$1 data-line="${u}"`)) : s;
|
|
318
318
|
} : e.renderer.rules[a] = (t, n, r, i, c) => {
|
|
319
319
|
let u;
|
|
320
320
|
return t[n].map && t[n].level === 0 && (u = t[n].map[0], t[n].attrSet("data-line", String(u))), c.renderToken(t, n, r);
|
|
@@ -334,7 +334,7 @@ const Me = (e, a) => {
|
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
336
|
type: "image",
|
|
337
|
-
plugin:
|
|
337
|
+
plugin: Fe,
|
|
338
338
|
options: { figcaption: !0, classes: "md-zoom" }
|
|
339
339
|
},
|
|
340
340
|
{
|
|
@@ -344,7 +344,7 @@ const Me = (e, a) => {
|
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
346
|
type: "taskList",
|
|
347
|
-
plugin:
|
|
347
|
+
plugin: He,
|
|
348
348
|
options: {}
|
|
349
349
|
},
|
|
350
350
|
{
|
|
@@ -376,7 +376,7 @@ const Me = (e, a) => {
|
|
|
376
376
|
}
|
|
377
377
|
}), nt(v);
|
|
378
378
|
const h = L(e.sanitize(v.render(e.modelValue))), f = () => {
|
|
379
|
-
g.emit(r,
|
|
379
|
+
g.emit(r, A, h.value), e.onHtmlChanged(h.value), e.onGetCatalog(u.value), g.emit(r, V, u.value), b();
|
|
380
380
|
};
|
|
381
381
|
S(f);
|
|
382
382
|
const k = oe(
|
|
@@ -384,7 +384,7 @@ const Me = (e, a) => {
|
|
|
384
384
|
u.value = [], h.value = e.sanitize(v.render(e.modelValue)), f();
|
|
385
385
|
},
|
|
386
386
|
(l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : a ? 0 : 500
|
|
387
|
-
), y =
|
|
387
|
+
), y = H(() => (e.noKatex || o.value) && (e.noHighlight || s.value));
|
|
388
388
|
return $([X(e, "modelValue"), y, d], k), S(() => {
|
|
389
389
|
g.on(r, {
|
|
390
390
|
name: ke,
|
|
@@ -512,6 +512,9 @@ const Me = (e, a) => {
|
|
|
512
512
|
},
|
|
513
513
|
inputBoxWitdh: {
|
|
514
514
|
type: String
|
|
515
|
+
},
|
|
516
|
+
onInputBoxWitdhChange: {
|
|
517
|
+
type: Function
|
|
515
518
|
}
|
|
516
519
|
}, at = /* @__PURE__ */ Q({
|
|
517
520
|
name: "ContentPreview",
|
|
@@ -520,21 +523,21 @@ const Me = (e, a) => {
|
|
|
520
523
|
const a = P("editorId"), l = P("previewTheme"), t = P("showCodeRowNumber"), {
|
|
521
524
|
html: n
|
|
522
525
|
} = rt(e, e.previewOnly);
|
|
523
|
-
return Le(e, n),
|
|
526
|
+
return Le(e, n), Me(e, n), () => x(ue, null, [x("div", {
|
|
524
527
|
id: `${a}-preview-wrapper`,
|
|
525
528
|
class: `${p}-preview-wrapper`,
|
|
526
529
|
"data-show": e.setting.preview,
|
|
527
530
|
key: "content-preview-wrapper"
|
|
528
|
-
}, [
|
|
531
|
+
}, [x("article", {
|
|
529
532
|
id: `${a}-preview`,
|
|
530
533
|
class: [`${p}-preview`, `${l == null ? void 0 : l.value}-theme`, t && `${p}-scrn`],
|
|
531
534
|
innerHTML: n.value
|
|
532
|
-
}, null)]), !e.previewOnly &&
|
|
535
|
+
}, null)]), !e.previewOnly && x("div", {
|
|
533
536
|
id: `${a}-html-wrapper`,
|
|
534
537
|
class: `${p}-preview-wrapper`,
|
|
535
538
|
"data-show": e.setting.htmlPreview,
|
|
536
539
|
key: "html-preview-wrapper"
|
|
537
|
-
}, [
|
|
540
|
+
}, [x("div", {
|
|
538
541
|
class: `${p}-html`
|
|
539
542
|
}, [n.value])])]);
|
|
540
543
|
}
|
|
@@ -552,7 +555,7 @@ const Me = (e, a) => {
|
|
|
552
555
|
}
|
|
553
556
|
), S(() => {
|
|
554
557
|
g.on(l, {
|
|
555
|
-
name:
|
|
558
|
+
name: A,
|
|
556
559
|
callback(n) {
|
|
557
560
|
t.buildFinished = !0, t.html = n;
|
|
558
561
|
}
|
|
@@ -564,10 +567,10 @@ const Me = (e, a) => {
|
|
|
564
567
|
r(t.html);
|
|
565
568
|
else {
|
|
566
569
|
const i = (c) => {
|
|
567
|
-
r(c), g.remove(l,
|
|
570
|
+
r(c), g.remove(l, A, i);
|
|
568
571
|
};
|
|
569
572
|
g.on(l, {
|
|
570
|
-
name:
|
|
573
|
+
name: A,
|
|
571
574
|
callback: i
|
|
572
575
|
});
|
|
573
576
|
}
|
|
@@ -579,15 +582,15 @@ const Me = (e, a) => {
|
|
|
579
582
|
}, ae = (e) => {
|
|
580
583
|
var n, r;
|
|
581
584
|
const { editorId: a } = e, l = (r = (n = C) == null ? void 0 : n.editorExtensions) == null ? void 0 : r.highlight;
|
|
582
|
-
|
|
585
|
+
F("editorId", a), F(
|
|
583
586
|
"theme",
|
|
584
|
-
|
|
585
|
-
),
|
|
587
|
+
H(() => e.theme)
|
|
588
|
+
), F(
|
|
586
589
|
"language",
|
|
587
|
-
|
|
588
|
-
),
|
|
590
|
+
H(() => e.language)
|
|
591
|
+
), F(
|
|
589
592
|
"highlight",
|
|
590
|
-
|
|
593
|
+
H(() => {
|
|
591
594
|
const i = {
|
|
592
595
|
...U,
|
|
593
596
|
...l == null ? void 0 : l.css
|
|
@@ -597,8 +600,8 @@ const Me = (e, a) => {
|
|
|
597
600
|
css: i[e.codeTheme] ? i[e.codeTheme][c] : U.atom[c]
|
|
598
601
|
};
|
|
599
602
|
})
|
|
600
|
-
),
|
|
601
|
-
const t =
|
|
603
|
+
), F("showCodeRowNumber", e.showCodeRowNumber);
|
|
604
|
+
const t = H(() => {
|
|
602
605
|
var c, u;
|
|
603
606
|
const i = {
|
|
604
607
|
...j,
|
|
@@ -606,15 +609,15 @@ const Me = (e, a) => {
|
|
|
606
609
|
};
|
|
607
610
|
return i[e.language] ? i[e.language] : j["zh-CN"];
|
|
608
611
|
});
|
|
609
|
-
|
|
612
|
+
F("usedLanguageText", t), F(
|
|
610
613
|
"previewTheme",
|
|
611
|
-
|
|
612
|
-
),
|
|
614
|
+
H(() => e.previewTheme)
|
|
615
|
+
), F(
|
|
613
616
|
"customIcon",
|
|
614
|
-
|
|
617
|
+
H(() => e.customIcon)
|
|
615
618
|
);
|
|
616
619
|
}, kt = (e) => {
|
|
617
|
-
ae(e),
|
|
620
|
+
ae(e), F("tabWidth", e.tabWidth);
|
|
618
621
|
}, le = (e) => {
|
|
619
622
|
S(() => {
|
|
620
623
|
var a, l;
|
|
@@ -685,7 +688,7 @@ const Me = (e, a) => {
|
|
|
685
688
|
n === void 0 ? l.value = !l.value : l.value = n;
|
|
686
689
|
}
|
|
687
690
|
});
|
|
688
|
-
}),
|
|
691
|
+
}), H(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog") && l.value);
|
|
689
692
|
}, Et = (e, a, l, t, n) => {
|
|
690
693
|
const { editorId: r } = e;
|
|
691
694
|
$(
|
|
@@ -696,17 +699,17 @@ const Me = (e, a) => {
|
|
|
696
699
|
), $(
|
|
697
700
|
() => t.fullscreen,
|
|
698
701
|
(c) => {
|
|
699
|
-
g.emit(r,
|
|
702
|
+
g.emit(r, W, c);
|
|
700
703
|
}
|
|
701
704
|
), $(
|
|
702
705
|
() => t.preview,
|
|
703
706
|
(c) => {
|
|
704
|
-
g.emit(r,
|
|
707
|
+
g.emit(r, K, c);
|
|
705
708
|
}
|
|
706
709
|
), $(
|
|
707
710
|
() => t.htmlPreview,
|
|
708
711
|
(c) => {
|
|
709
|
-
g.emit(r,
|
|
712
|
+
g.emit(r, q, c);
|
|
710
713
|
}
|
|
711
714
|
), $(l, (c) => {
|
|
712
715
|
g.emit(r, Z, c);
|
|
@@ -725,7 +728,7 @@ const Me = (e, a) => {
|
|
|
725
728
|
}
|
|
726
729
|
case "fullscreen": {
|
|
727
730
|
g.on(r, {
|
|
728
|
-
name:
|
|
731
|
+
name: W,
|
|
729
732
|
callback(s) {
|
|
730
733
|
u(s);
|
|
731
734
|
}
|
|
@@ -734,7 +737,7 @@ const Me = (e, a) => {
|
|
|
734
737
|
}
|
|
735
738
|
case "preview": {
|
|
736
739
|
g.on(r, {
|
|
737
|
-
name:
|
|
740
|
+
name: K,
|
|
738
741
|
callback(s) {
|
|
739
742
|
u(s);
|
|
740
743
|
}
|
|
@@ -743,7 +746,7 @@ const Me = (e, a) => {
|
|
|
743
746
|
}
|
|
744
747
|
case "htmlPreview": {
|
|
745
748
|
g.on(r, {
|
|
746
|
-
name:
|
|
749
|
+
name: q,
|
|
747
750
|
callback(s) {
|
|
748
751
|
u(s);
|
|
749
752
|
}
|
|
@@ -1216,6 +1219,12 @@ const Me = (e, a) => {
|
|
|
1216
1219
|
inputBoxWitdh: {
|
|
1217
1220
|
type: String,
|
|
1218
1221
|
default: "50%"
|
|
1222
|
+
},
|
|
1223
|
+
/**
|
|
1224
|
+
* 输入框宽度变化事件
|
|
1225
|
+
*/
|
|
1226
|
+
onInputBoxWitdhChange: {
|
|
1227
|
+
type: Function
|
|
1219
1228
|
}
|
|
1220
1229
|
}, ce = ["onHtmlChanged", "onGetCatalog"], Tt = [
|
|
1221
1230
|
...ce,
|
|
@@ -1227,7 +1236,8 @@ const Me = (e, a) => {
|
|
|
1227
1236
|
"onBlur",
|
|
1228
1237
|
"onFocus",
|
|
1229
1238
|
"onInput",
|
|
1230
|
-
"onDrop"
|
|
1239
|
+
"onDrop",
|
|
1240
|
+
"onInputBoxWitdhChange"
|
|
1231
1241
|
], it = /* @__PURE__ */ Q({
|
|
1232
1242
|
name: "MdPreview",
|
|
1233
1243
|
props: ie,
|
|
@@ -1241,11 +1251,11 @@ const Me = (e, a) => {
|
|
|
1241
1251
|
} = e;
|
|
1242
1252
|
return ae(e), le(e), de(() => {
|
|
1243
1253
|
g.clear(l);
|
|
1244
|
-
}), () =>
|
|
1254
|
+
}), () => x("div", {
|
|
1245
1255
|
id: l,
|
|
1246
1256
|
class: [p, e.class, e.theme === "dark" && `${p}-dark`, `${p}-previewOnly`],
|
|
1247
1257
|
style: e.style
|
|
1248
|
-
}, [
|
|
1258
|
+
}, [x(at, {
|
|
1249
1259
|
modelValue: e.modelValue,
|
|
1250
1260
|
onHtmlChanged: (i) => {
|
|
1251
1261
|
e.onHtmlChanged ? e.onHtmlChanged(i) : a.emit("onHtmlChanged", i);
|
|
@@ -1263,11 +1273,11 @@ const Me = (e, a) => {
|
|
|
1263
1273
|
previewOnly: !0
|
|
1264
1274
|
}, null)]);
|
|
1265
1275
|
}
|
|
1266
|
-
}),
|
|
1267
|
-
|
|
1276
|
+
}), R = it;
|
|
1277
|
+
R.install = (e) => (e.component(R.name, R), e);
|
|
1268
1278
|
export {
|
|
1269
1279
|
at as C,
|
|
1270
|
-
|
|
1280
|
+
R as M,
|
|
1271
1281
|
Tt as a,
|
|
1272
1282
|
kt as b,
|
|
1273
1283
|
bt as c,
|
|
@@ -102,6 +102,9 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
102
102
|
type: import("vue").PropType<string>;
|
|
103
103
|
default: string;
|
|
104
104
|
};
|
|
105
|
+
onInputBoxWitdhChange: {
|
|
106
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
107
|
+
};
|
|
105
108
|
modelValue: {
|
|
106
109
|
type: import("vue").PropType<string>;
|
|
107
110
|
default: string;
|
|
@@ -187,7 +190,7 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
187
190
|
type: import("vue").PropType<import('./type').CustomIcon>;
|
|
188
191
|
default: {};
|
|
189
192
|
};
|
|
190
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
193
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
191
194
|
onChange: {
|
|
192
195
|
type: import("vue").PropType<import('./type').ChangeEvent>;
|
|
193
196
|
};
|
|
@@ -291,6 +294,9 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
291
294
|
type: import("vue").PropType<string>;
|
|
292
295
|
default: string;
|
|
293
296
|
};
|
|
297
|
+
onInputBoxWitdhChange: {
|
|
298
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
299
|
+
};
|
|
294
300
|
modelValue: {
|
|
295
301
|
type: import("vue").PropType<string>;
|
|
296
302
|
default: string;
|
|
@@ -385,6 +391,7 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
385
391
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
386
392
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
387
393
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
394
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
388
395
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
389
396
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
390
397
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -96,6 +96,7 @@ declare const _default: {
|
|
|
96
96
|
readonly maxLength?: number | undefined;
|
|
97
97
|
readonly autoDetectCode?: boolean | undefined;
|
|
98
98
|
readonly completions?: import("@codemirror/autocomplete").CompletionSource[] | undefined;
|
|
99
|
+
readonly onInputBoxWitdhChange?: ((width: string) => void) | undefined;
|
|
99
100
|
readonly onHtmlChanged?: import("./type").HtmlChangedEvent | undefined;
|
|
100
101
|
readonly onGetCatalog?: import("./type").GetCatalogEvent | undefined;
|
|
101
102
|
readonly noIconfont?: boolean | undefined;
|
|
@@ -106,6 +107,7 @@ declare const _default: {
|
|
|
106
107
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
107
108
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
108
109
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
110
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
109
111
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
110
112
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
111
113
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -121,7 +123,7 @@ declare const _default: {
|
|
|
121
123
|
}>;
|
|
122
124
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
123
125
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
124
|
-
$emit: (event: "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
126
|
+
$emit: (event: "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
125
127
|
$el: any;
|
|
126
128
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
127
129
|
onChange: {
|
|
@@ -227,6 +229,9 @@ declare const _default: {
|
|
|
227
229
|
type: import("vue").PropType<string>;
|
|
228
230
|
default: string;
|
|
229
231
|
};
|
|
232
|
+
onInputBoxWitdhChange: {
|
|
233
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
234
|
+
};
|
|
230
235
|
modelValue: {
|
|
231
236
|
type: import("vue").PropType<string>;
|
|
232
237
|
default: string;
|
|
@@ -321,6 +326,7 @@ declare const _default: {
|
|
|
321
326
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
322
327
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
323
328
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
329
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
324
330
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
325
331
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
326
332
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -481,6 +487,9 @@ declare const _default: {
|
|
|
481
487
|
type: import("vue").PropType<string>;
|
|
482
488
|
default: string;
|
|
483
489
|
};
|
|
490
|
+
onInputBoxWitdhChange: {
|
|
491
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
492
|
+
};
|
|
484
493
|
modelValue: {
|
|
485
494
|
type: import("vue").PropType<string>;
|
|
486
495
|
default: string;
|
|
@@ -575,6 +584,7 @@ declare const _default: {
|
|
|
575
584
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
576
585
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
577
586
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
587
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
578
588
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
579
589
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
580
590
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -686,6 +696,9 @@ declare const _default: {
|
|
|
686
696
|
type: import("vue").PropType<string>;
|
|
687
697
|
default: string;
|
|
688
698
|
};
|
|
699
|
+
onInputBoxWitdhChange: {
|
|
700
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
701
|
+
};
|
|
689
702
|
modelValue: {
|
|
690
703
|
type: import("vue").PropType<string>;
|
|
691
704
|
default: string;
|
|
@@ -780,10 +793,11 @@ declare const _default: {
|
|
|
780
793
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
781
794
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
782
795
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
796
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
783
797
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
784
798
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
785
799
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
786
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
800
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
787
801
|
language: string;
|
|
788
802
|
theme: import("./type").Themes;
|
|
789
803
|
editorId: string;
|
|
@@ -56,6 +56,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
56
|
inputBoxWitdh: {
|
|
57
57
|
type: import("vue").PropType<string>;
|
|
58
58
|
};
|
|
59
|
+
onInputBoxWitdhChange: {
|
|
60
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
61
|
+
};
|
|
59
62
|
modelValue: {
|
|
60
63
|
type: import("vue").PropType<string>;
|
|
61
64
|
default: string;
|
|
@@ -161,6 +164,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
161
164
|
inputBoxWitdh: {
|
|
162
165
|
type: import("vue").PropType<string>;
|
|
163
166
|
};
|
|
167
|
+
onInputBoxWitdhChange: {
|
|
168
|
+
type: import("vue").PropType<(width: string) => void>;
|
|
169
|
+
};
|
|
164
170
|
modelValue: {
|
|
165
171
|
type: import("vue").PropType<string>;
|
|
166
172
|
default: string;
|
|
@@ -370,7 +370,7 @@ export interface ExposeParam {
|
|
|
370
370
|
}
|
|
371
371
|
export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;
|
|
372
372
|
export type MdPreviewProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof mdPreviewProps>>>>;
|
|
373
|
-
export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput' | 'onDrop'>;
|
|
373
|
+
export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput' | 'onDrop' | 'onInputBoxWitdhChange'>;
|
|
374
374
|
export type EditorContext = SetupContext<EditorEmits>;
|
|
375
375
|
/**
|
|
376
376
|
* 自定义图标的数据类型
|
|
@@ -84,7 +84,7 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
84
84
|
type: import("vue").PropType<import('../MdEditor/type').CustomIcon>;
|
|
85
85
|
default: {};
|
|
86
86
|
};
|
|
87
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('../MdEditor/type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
87
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('../MdEditor/type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
88
88
|
modelValue: {
|
|
89
89
|
type: import("vue").PropType<string>;
|
|
90
90
|
default: string;
|
|
@@ -179,6 +179,7 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
179
179
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
180
180
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
181
181
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
182
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
182
183
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
183
184
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
184
185
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -76,6 +76,7 @@ declare const _default: {
|
|
|
76
76
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
77
77
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
78
78
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
79
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
79
80
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
80
81
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
81
82
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -91,7 +92,7 @@ declare const _default: {
|
|
|
91
92
|
}>;
|
|
92
93
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
93
94
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
94
|
-
$emit: (event: "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
95
|
+
$emit: (event: "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
95
96
|
$el: any;
|
|
96
97
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
97
98
|
modelValue: {
|
|
@@ -188,6 +189,7 @@ declare const _default: {
|
|
|
188
189
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
189
190
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
190
191
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
192
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
191
193
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
192
194
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
193
195
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -326,6 +328,7 @@ declare const _default: {
|
|
|
326
328
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
327
329
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
328
330
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
331
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
329
332
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
330
333
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
331
334
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -428,10 +431,11 @@ declare const _default: {
|
|
|
428
431
|
onOnError?: ((...args: any[]) => any) | undefined;
|
|
429
432
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
430
433
|
onOnUploadImg?: ((...args: any[]) => any) | undefined;
|
|
434
|
+
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
431
435
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
432
436
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
433
437
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
434
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
438
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
435
439
|
language: string;
|
|
436
440
|
theme: import("..").Themes;
|
|
437
441
|
editorId: string;
|