md-editor-v3 4.6.2-beta.0 → 4.6.2-beta.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/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +1 -1
- 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/index.cjs +1 -8
- package/lib/cjs/chunks/index3.cjs +2 -1
- package/lib/cjs/chunks/index4.cjs +8 -2
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/DropdownToolbar.mjs +2 -2
- package/lib/es/MdCatalog.mjs +9 -9
- package/lib/es/MdEditor.mjs +27 -27
- 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 +11 -11
- package/lib/es/chunks/index.mjs +138 -1232
- package/lib/es/chunks/index2.mjs +2 -2
- package/lib/es/chunks/index3.mjs +79 -163
- package/lib/es/chunks/index4.mjs +1255 -77
- package/lib/es/config.mjs +1 -1
- package/lib/es/index.mjs +7 -7
- package/lib/preview.css +1 -1
- package/lib/style.css +1 -1
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +1 -1
- package/lib/types/DropdownToolbar/index.d.ts +59 -33
- package/lib/types/MdCatalog/CatalogLink.d.ts +1 -1
- package/lib/types/MdCatalog/MdCatalog.d.ts +1 -1
- package/lib/types/MdCatalog/index.d.ts +59 -44
- package/lib/types/MdEditor/Editor.d.ts +1 -1
- package/lib/types/MdEditor/components/Checkbox/index.d.ts +1 -1
- package/lib/types/MdEditor/components/Divider/index.d.ts +1 -1
- package/lib/types/MdEditor/components/Dropdown/index.d.ts +1 -1
- package/lib/types/MdEditor/components/Icon/Icon.d.ts +1 -1
- package/lib/types/MdEditor/components/Icon/index.d.ts +1 -1
- package/lib/types/MdEditor/components/Modal/Modal.d.ts +1 -1
- package/lib/types/MdEditor/components/Modal/index.d.ts +60 -48
- package/lib/types/MdEditor/index.d.ts +101 -225
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Content/index.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Footer/index.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Modals/Link.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Modals/index.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +1 -1
- package/lib/types/MdEditor/utils/vue-tsx.d.ts +1 -1
- package/lib/types/MdPreview/MdPreview.d.ts +1 -1
- package/lib/types/MdPreview/index.d.ts +72 -114
- package/lib/types/ModalToolbar/ModalToolbar.d.ts +1 -1
- package/lib/types/ModalToolbar/index.d.ts +64 -58
- package/lib/types/NormalToolbar/NormalToolbar.d.ts +1 -1
- package/lib/types/NormalToolbar/index.d.ts +56 -24
- package/lib/umd/index.js +27 -27
- package/package.json +9 -8
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var Dt = Object.defineProperty;
|
|
2
2
|
var It = (e, o, l) => o in e ? Dt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
|
|
3
3
|
var q = (e, o, l) => (It(e, typeof o != "symbol" ? o + "" : o, l), l);
|
|
4
|
-
import { defineComponent as P, createVNode as t, inject as I, ref as
|
|
5
|
-
import { p as n,
|
|
4
|
+
import { defineComponent as P, createVNode as t, inject as I, ref as j, onMounted as J, reactive as ee, computed as ye, watch as B, nextTick as be, Fragment as yt, cloneVNode as ct, toRef as se, shallowRef as Et, onBeforeUnmount as Ht } from "vue";
|
|
5
|
+
import { p as n, c as Y, l as Nt, g as Ot, j as Vt } from "./chunks/config.mjs";
|
|
6
6
|
import { draggingScroll as Ft, linkTo as Bt, debounce as Rt, createSmoothScroll as Pt, throttle as Ut } from "@vavt/util";
|
|
7
|
-
import {
|
|
8
|
-
import { b,
|
|
7
|
+
import { D as ie, a as _t } from "./chunks/index2.mjs";
|
|
8
|
+
import { b, h as qt, E as te, U as Te, i as Gt, j as $e, R as w, c as jt, O as Tt, k as wt, l as xt, T as Kt } from "./chunks/index3.mjs";
|
|
9
9
|
import { a as Wt } from "./chunks/dom.mjs";
|
|
10
|
-
import { M as St, I as p } from "./chunks/
|
|
10
|
+
import { M as St, I as p } from "./chunks/index.mjs";
|
|
11
11
|
import { minimalSetup as zt, EditorView as ge } from "codemirror";
|
|
12
12
|
import { EditorView as we, placeholder as Zt, keymap as Xt } from "@codemirror/view";
|
|
13
13
|
import { languages as Yt } from "@codemirror/language-data";
|
|
@@ -18,7 +18,7 @@ import { HighlightStyle as At, syntaxHighlighting as Mt, indentUnit as nl } from
|
|
|
18
18
|
import { tags as s } from "@lezer/highlight";
|
|
19
19
|
import { EditorSelection as G, EditorState as ve, Compartment as rl, StateEffect as il } from "@codemirror/state";
|
|
20
20
|
import { autocompletion as sl } from "@codemirror/autocomplete";
|
|
21
|
-
import { c as cl, C as ul, e as dl, a as ml, u as gl, b as fl, d as bl, f as hl, g as vl, h as kl, i as Cl, M as pl } from "./chunks/
|
|
21
|
+
import { c as cl, C as ul, e as dl, a as ml, u as gl, b as fl, d as bl, f as hl, g as vl, h as kl, i as Cl, M as pl } from "./chunks/index4.mjs";
|
|
22
22
|
import Lt from "./MdCatalog.mjs";
|
|
23
23
|
import { g as ut } from "./chunks/vue-tsx.mjs";
|
|
24
24
|
import $l from "./NormalToolbar.mjs";
|
|
@@ -88,7 +88,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
88
88
|
var u, m, d, v;
|
|
89
89
|
const o = I("editorId");
|
|
90
90
|
let l = (m = (u = Y.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : m.instance;
|
|
91
|
-
const a = (v = (d = Y.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : v.js, r =
|
|
91
|
+
const a = (v = (d = Y.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : v.js, r = j(!1), i = ($) => {
|
|
92
92
|
if (!l) {
|
|
93
93
|
b.emit(o, te, {
|
|
94
94
|
name: "fullscreen",
|
|
@@ -264,7 +264,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
264
264
|
var d, v, $;
|
|
265
265
|
const o = I("usedLanguageText"), l = I("editorId");
|
|
266
266
|
let a = ($ = (v = (d = Y) == null ? void 0 : d.editorExtensions) == null ? void 0 : v.cropper) == null ? void 0 : $.instance;
|
|
267
|
-
const r =
|
|
267
|
+
const r = j(), i = j(), g = j(), c = ee({
|
|
268
268
|
cropperInited: !1,
|
|
269
269
|
imgSelected: !1,
|
|
270
270
|
imgSrc: "",
|
|
@@ -423,7 +423,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
423
423
|
setup(e) {
|
|
424
424
|
const o = I("editorId"), l = I("usedLanguageText"), {
|
|
425
425
|
fullscreenHandler: a
|
|
426
|
-
} = xl(e), r = `${o}-toolbar-wrapper`, i =
|
|
426
|
+
} = xl(e), r = `${o}-toolbar-wrapper`, i = j(), g = ee({
|
|
427
427
|
title: !1,
|
|
428
428
|
catalog: !1,
|
|
429
429
|
// 图片上传下拉
|
|
@@ -439,7 +439,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
439
439
|
type: "link",
|
|
440
440
|
linkVisible: !1,
|
|
441
441
|
clipVisible: !1
|
|
442
|
-
}), m =
|
|
442
|
+
}), m = j();
|
|
443
443
|
J(() => {
|
|
444
444
|
b.on(o, {
|
|
445
445
|
name: $e,
|
|
@@ -451,14 +451,14 @@ const Tl = /* @__PURE__ */ P({
|
|
|
451
451
|
const d = ye(() => {
|
|
452
452
|
const k = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), f = k.indexOf("="), h = f === -1 ? k : k.slice(0, f + 1), y = f === -1 ? [] : k.slice(f, Number.MAX_SAFE_INTEGER);
|
|
453
453
|
return [h, y];
|
|
454
|
-
}), v =
|
|
454
|
+
}), v = j(), $ = () => {
|
|
455
455
|
b.emit(o, Te, Array.from(v.value.files || [])), v.value.value = "";
|
|
456
456
|
};
|
|
457
457
|
J(() => {
|
|
458
458
|
v.value.addEventListener("change", $);
|
|
459
459
|
});
|
|
460
460
|
const T = (k) => {
|
|
461
|
-
var f, h, y, x, S, N, L, le, oe, A, M, _, U, O, E, H, V,
|
|
461
|
+
var f, h, y, x, S, N, L, le, oe, A, M, _, U, O, E, H, V, K, W, de, ae, X, z, ne, Z, F, R, re, me, xe, Se, Ae, Me, Le, De, Ie, Ee, He, Ne, Oe, Ve, Fe, Be, Re, Pe, Ue, _e, qe, Ge, je, Ke, We, ze, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st;
|
|
462
462
|
if (Ot.includes(k))
|
|
463
463
|
switch (k) {
|
|
464
464
|
case "-":
|
|
@@ -590,7 +590,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
590
590
|
name: "sup"
|
|
591
591
|
}, null), e.showToolbarName && t("div", {
|
|
592
592
|
class: `${n}-toolbar-item-name`
|
|
593
|
-
}, [(
|
|
593
|
+
}, [(K = l.value.toolbarTips) == null ? void 0 : K.sup])]);
|
|
594
594
|
case "quote":
|
|
595
595
|
return t("div", {
|
|
596
596
|
class: `${n}-toolbar-item`,
|
|
@@ -830,7 +830,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
830
830
|
case "preview":
|
|
831
831
|
return t("div", {
|
|
832
832
|
class: `${n}-toolbar-item`,
|
|
833
|
-
title: (
|
|
833
|
+
title: (je = l.value.toolbarTips) == null ? void 0 : je.preview,
|
|
834
834
|
onClick: () => {
|
|
835
835
|
e.updateSetting("preview");
|
|
836
836
|
}
|
|
@@ -838,7 +838,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
838
838
|
name: "preview"
|
|
839
839
|
}, null), e.showToolbarName && t("div", {
|
|
840
840
|
class: `${n}-toolbar-item-name`
|
|
841
|
-
}, [(
|
|
841
|
+
}, [(Ke = l.value.toolbarTips) == null ? void 0 : Ke.preview])]);
|
|
842
842
|
case "htmlPreview":
|
|
843
843
|
return t("div", {
|
|
844
844
|
class: `${n}-toolbar-item`,
|
|
@@ -856,7 +856,7 @@ const Tl = /* @__PURE__ */ P({
|
|
|
856
856
|
class: `${n}-toolbar-item`,
|
|
857
857
|
title: (Ze = l.value.toolbarTips) == null ? void 0 : Ze.catalog,
|
|
858
858
|
onClick: () => {
|
|
859
|
-
b.emit(o,
|
|
859
|
+
b.emit(o, jt);
|
|
860
860
|
},
|
|
861
861
|
key: "bar-catalog"
|
|
862
862
|
}, [t(p, {
|
|
@@ -1100,8 +1100,8 @@ const Tl = /* @__PURE__ */ P({
|
|
|
1100
1100
|
const U = i(A.start), O = o.querySelector(`[data-line="${A.start - 1}"]`) || ((x = o.firstElementChild) == null ? void 0 : x.firstElementChild), E = o.querySelector(`[data-line="${A.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
|
|
1101
1101
|
let H = 0, V = 0;
|
|
1102
1102
|
U === 0 ? O === E ? (f = 0, M = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / M, H = E.offsetTop + E.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / M, H = E.offsetTop) : M > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - U) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - U), V = O.offsetTop, H = o.scrollHeight - o.clientHeight - V + 10) : (_ = (a.scrollDOM.scrollTop - U) / (M - U), V = O.offsetTop, H = E.offsetTop - V);
|
|
1103
|
-
const
|
|
1104
|
-
r(o,
|
|
1103
|
+
const K = V - f + H * _;
|
|
1104
|
+
r(o, K, () => {
|
|
1105
1105
|
m--;
|
|
1106
1106
|
});
|
|
1107
1107
|
} else {
|
|
@@ -1148,16 +1148,16 @@ const Tl = /* @__PURE__ */ P({
|
|
|
1148
1148
|
O = R;
|
|
1149
1149
|
}
|
|
1150
1150
|
const V = E.offsetTop;
|
|
1151
|
-
let
|
|
1151
|
+
let K = H.offsetTop, W = 0;
|
|
1152
1152
|
const { start: de, end: ae } = c[Number(E.dataset.line || 0)], X = i(de);
|
|
1153
1153
|
let z = i(ae);
|
|
1154
1154
|
const ne = g(ae);
|
|
1155
1155
|
let Z = 0;
|
|
1156
|
-
E === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (E === H ? (
|
|
1156
|
+
E === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (E === H ? (K = H.offsetHeight - o.offsetHeight + f + h, Z = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : Z = z + ne - X, W = Math.max(M / K, 0)) : z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (W = Math.max(
|
|
1157
1157
|
(M - V) / (o.scrollHeight - V - o.clientHeight),
|
|
1158
1158
|
0
|
|
1159
1159
|
), z = i(a.state.doc.lines) + g(a.state.doc.lines), Z = 8 + z - X - e.clientHeight) : (W = Math.max(
|
|
1160
|
-
(M - V) / (
|
|
1160
|
+
(M - V) / (K - V),
|
|
1161
1161
|
0
|
|
1162
1162
|
), Z = z + ne - X), r(e, X + Z * W, () => {
|
|
1163
1163
|
d--;
|
|
@@ -1421,7 +1421,7 @@ $$
|
|
|
1421
1421
|
replaceAll: c
|
|
1422
1422
|
}
|
|
1423
1423
|
};
|
|
1424
|
-
}, Ul = "#e5c07b", dt = "var(--md-color)", _l = "#56b6c2", ql = "#ffffff", ce = "var(--md-color)", mt = "#e5c07b", Gl = "#e5c07b",
|
|
1424
|
+
}, Ul = "#e5c07b", dt = "var(--md-color)", _l = "#56b6c2", ql = "#ffffff", ce = "var(--md-color)", mt = "#e5c07b", Gl = "#e5c07b", jl = "var(--md-color)", gt = "#d19a66", Kl = "#c678dd", Wl = "#21252b", zl = "#2c313a", ft = "var(--md-bk-color)", ke = "var(--md-bk-color)", Zl = "#ceedfa33", bt = "#528bff", Xl = we.theme(
|
|
1425
1425
|
{
|
|
1426
1426
|
"&": {
|
|
1427
1427
|
color: ce,
|
|
@@ -1481,7 +1481,7 @@ $$
|
|
|
1481
1481
|
},
|
|
1482
1482
|
{ dark: !0 }
|
|
1483
1483
|
), Yl = At.define([
|
|
1484
|
-
{ tag: s.keyword, color:
|
|
1484
|
+
{ tag: s.keyword, color: Kl },
|
|
1485
1485
|
{ tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: dt },
|
|
1486
1486
|
{ tag: [s.function(s.variableName), s.labelName], color: Gl },
|
|
1487
1487
|
{ tag: [s.color, s.constant(s.name), s.standard(s.name)], color: gt },
|
|
@@ -1518,7 +1518,7 @@ $$
|
|
|
1518
1518
|
{ tag: s.link, color: mt, textDecoration: "underline" },
|
|
1519
1519
|
{ tag: s.heading, fontWeight: "bold", color: dt },
|
|
1520
1520
|
{ tag: [s.atom, s.bool, s.special(s.variableName)], color: gt },
|
|
1521
|
-
{ tag: [s.processingInstruction, s.string, s.inserted], color:
|
|
1521
|
+
{ tag: [s.processingInstruction, s.string, s.inserted], color: jl },
|
|
1522
1522
|
{ tag: s.invalid, color: ql }
|
|
1523
1523
|
]), Jl = [
|
|
1524
1524
|
Xl,
|
|
@@ -1926,7 +1926,7 @@ const bo = (e) => {
|
|
|
1926
1926
|
const o = I("editorId");
|
|
1927
1927
|
J(() => {
|
|
1928
1928
|
b.on(o, {
|
|
1929
|
-
name:
|
|
1929
|
+
name: Kt,
|
|
1930
1930
|
callback(l) {
|
|
1931
1931
|
var a;
|
|
1932
1932
|
(a = e.value) == null || a.focus(l);
|
|
@@ -2030,7 +2030,7 @@ const bo = (e) => {
|
|
|
2030
2030
|
any: (N, L) => (L.ctrlKey || L.metaKey) && L.altKey && L.shiftKey && L.code === "KeyT" ? (b.emit(e, w, "table"), !0) : !1
|
|
2031
2031
|
}
|
|
2032
2032
|
], po = Co, $o = (e) => {
|
|
2033
|
-
const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r =
|
|
2033
|
+
const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = j(), i = Et(), g = po(l, e), c = ho(e), u = [
|
|
2034
2034
|
Xt.of([...g, ll]),
|
|
2035
2035
|
zt,
|
|
2036
2036
|
el(),
|
|
@@ -2137,7 +2137,7 @@ const bo = (e) => {
|
|
|
2137
2137
|
name: "MDEditorContent",
|
|
2138
2138
|
props: cl,
|
|
2139
2139
|
setup(e) {
|
|
2140
|
-
const o = I("editorId"), l =
|
|
2140
|
+
const o = I("editorId"), l = j(""), {
|
|
2141
2141
|
inputWrapperRef: a,
|
|
2142
2142
|
codeMirrorUt: r
|
|
2143
2143
|
} = yo(e);
|
package/lib/es/MdModal.mjs
CHANGED
package/lib/es/MdPreview.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as x } from "./chunks/
|
|
1
|
+
import { M as x } from "./chunks/index4.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "./chunks/config.mjs";
|
|
4
|
-
import "./chunks/
|
|
4
|
+
import "./chunks/index3.mjs";
|
|
5
5
|
import "./chunks/dom.mjs";
|
|
6
6
|
import "@vavt/util";
|
|
7
7
|
import "medium-zoom";
|
package/lib/es/ModalToolbar.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as s, createVNode as o, Fragment as d, isVNode as c } from "vue";
|
|
2
2
|
import { p as r } from "./chunks/config.mjs";
|
|
3
3
|
import { g as u } from "./chunks/vue-tsx.mjs";
|
|
4
|
-
import { M as f } from "./chunks/
|
|
4
|
+
import { M as f } from "./chunks/index.mjs";
|
|
5
5
|
import "./chunks/dom.mjs";
|
|
6
6
|
import "@vavt/util";
|
|
7
7
|
function m(t) {
|
package/lib/es/chunks/config.mjs
CHANGED
|
@@ -252,20 +252,20 @@ const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2
|
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
254
|
export {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
255
|
+
f as a,
|
|
256
|
+
n as b,
|
|
257
|
+
l as c,
|
|
258
|
+
d,
|
|
259
|
+
h as e,
|
|
260
|
+
o as f,
|
|
261
|
+
m as g,
|
|
262
262
|
c as h,
|
|
263
263
|
r as i,
|
|
264
|
-
|
|
264
|
+
p as j,
|
|
265
265
|
b as k,
|
|
266
|
-
|
|
266
|
+
g as l,
|
|
267
267
|
k as m,
|
|
268
|
-
|
|
268
|
+
j as n,
|
|
269
269
|
a as p,
|
|
270
|
-
|
|
270
|
+
u as s
|
|
271
271
|
};
|