md-editor-v3 4.6.2 → 4.7.0-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/MdEditor.cjs +26 -26
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/NormalToolbar.cjs +1 -1
- package/lib/cjs/chunks/index2.cjs +1 -1
- package/lib/cjs/chunks/index4.cjs +1 -1
- package/lib/es/MdEditor.mjs +703 -699
- package/lib/es/ModalToolbar.mjs +18 -9
- package/lib/es/NormalToolbar.mjs +19 -10
- package/lib/es/chunks/index2.mjs +25 -16
- package/lib/es/chunks/index4.mjs +3 -0
- package/lib/style.css +1 -1
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +21 -2
- package/lib/types/DropdownToolbar/index.d.ts +20 -0
- package/lib/types/MdCatalog/MdCatalog.d.ts +1 -1
- package/lib/types/MdCatalog/index.d.ts +3 -3
- package/lib/types/MdEditor/Editor.d.ts +2 -2
- package/lib/types/MdEditor/index.d.ts +6 -6
- package/lib/types/MdEditor/layouts/Content/index.d.ts +1 -1
- package/lib/types/MdPreview/MdPreview.d.ts +2 -2
- package/lib/types/MdPreview/index.d.ts +6 -6
- package/lib/types/ModalToolbar/ModalToolbar.d.ts +15 -2
- package/lib/types/ModalToolbar/index.d.ts +20 -0
- package/lib/types/NormalToolbar/NormalToolbar.d.ts +15 -2
- package/lib/types/NormalToolbar/index.d.ts +20 -0
- package/lib/umd/index.js +39 -39
- package/package.json +1 -1
package/lib/es/ModalToolbar.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as s, createVNode as o, Fragment as d, isVNode as
|
|
2
|
-
import { p as
|
|
3
|
-
import { g as
|
|
1
|
+
import { defineComponent as s, createVNode as o, Fragment as d, isVNode as r } from "vue";
|
|
2
|
+
import { p as c } from "./chunks/config.mjs";
|
|
3
|
+
import { g as a } from "./chunks/vue-tsx.mjs";
|
|
4
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) {
|
|
8
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
8
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !r(t);
|
|
9
9
|
}
|
|
10
10
|
const g = {
|
|
11
11
|
title: {
|
|
@@ -52,31 +52,40 @@ const g = {
|
|
|
52
52
|
type: Function
|
|
53
53
|
},
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
|
|
56
56
|
*/
|
|
57
57
|
insert: {
|
|
58
58
|
type: Function
|
|
59
|
+
},
|
|
60
|
+
language: {
|
|
61
|
+
type: String
|
|
62
|
+
},
|
|
63
|
+
theme: {
|
|
64
|
+
type: String
|
|
59
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* ==结束
|
|
68
|
+
*/
|
|
60
69
|
}, i = /* @__PURE__ */ s({
|
|
61
70
|
name: "ModalToolbar",
|
|
62
71
|
props: g,
|
|
63
72
|
emits: ["onClick", "onClose", "onAdjust"],
|
|
64
73
|
setup(t, e) {
|
|
65
74
|
return () => {
|
|
66
|
-
const
|
|
75
|
+
const u = a({
|
|
67
76
|
props: t,
|
|
68
77
|
ctx: e
|
|
69
|
-
}, "trigger"), n =
|
|
78
|
+
}, "trigger"), n = a({
|
|
70
79
|
props: t,
|
|
71
80
|
ctx: e
|
|
72
81
|
}, "default");
|
|
73
82
|
return o(d, null, [o("div", {
|
|
74
|
-
class: `${
|
|
83
|
+
class: `${c}-toolbar-item`,
|
|
75
84
|
title: t.title,
|
|
76
85
|
onClick: () => {
|
|
77
86
|
t.onClick instanceof Function ? t.onClick() : e.emit("onClick");
|
|
78
87
|
}
|
|
79
|
-
}, [
|
|
88
|
+
}, [u]), o(f, {
|
|
80
89
|
width: t.width,
|
|
81
90
|
height: t.height,
|
|
82
91
|
title: t.modalTitle,
|
package/lib/es/NormalToolbar.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as r, createVNode as l } from "vue";
|
|
2
|
-
import { p as
|
|
3
|
-
import { g as
|
|
2
|
+
import { p as a } from "./chunks/config.mjs";
|
|
3
|
+
import { g as c } from "./chunks/vue-tsx.mjs";
|
|
4
4
|
const m = {
|
|
5
5
|
title: {
|
|
6
6
|
type: String,
|
|
@@ -14,28 +14,37 @@ const m = {
|
|
|
14
14
|
type: Function
|
|
15
15
|
},
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
|
|
18
18
|
*/
|
|
19
19
|
insert: {
|
|
20
20
|
type: Function
|
|
21
|
+
},
|
|
22
|
+
language: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
theme: {
|
|
26
|
+
type: String
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* ==结束
|
|
30
|
+
*/
|
|
22
31
|
}, e = /* @__PURE__ */ r({
|
|
23
32
|
name: "NormalToolbar",
|
|
24
33
|
props: m,
|
|
25
34
|
emits: ["onClick"],
|
|
26
|
-
setup(t,
|
|
35
|
+
setup(t, n) {
|
|
27
36
|
return () => {
|
|
28
|
-
const
|
|
37
|
+
const o = c({
|
|
29
38
|
props: t,
|
|
30
|
-
ctx:
|
|
39
|
+
ctx: n
|
|
31
40
|
}, "trigger");
|
|
32
41
|
return l("div", {
|
|
33
|
-
class: `${
|
|
42
|
+
class: `${a}-toolbar-item`,
|
|
34
43
|
title: t.title,
|
|
35
|
-
onClick: (
|
|
36
|
-
t.onClick instanceof Function ? t.onClick(
|
|
44
|
+
onClick: (i) => {
|
|
45
|
+
t.onClick instanceof Function ? t.onClick(i) : n.emit("onClick", i);
|
|
37
46
|
}
|
|
38
|
-
}, [
|
|
47
|
+
}, [o]);
|
|
39
48
|
};
|
|
40
49
|
}
|
|
41
50
|
});
|
package/lib/es/chunks/index2.mjs
CHANGED
|
@@ -28,13 +28,13 @@ const B = {
|
|
|
28
28
|
overlayStyle: {},
|
|
29
29
|
triggerHover: !1,
|
|
30
30
|
overlayHover: !1
|
|
31
|
-
}),
|
|
31
|
+
}), o = C(), n = C(), s = () => {
|
|
32
32
|
var p;
|
|
33
33
|
t.triggerHover = !0;
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
34
|
+
const r = o.value, l = n.value;
|
|
35
|
+
if (!r || !l)
|
|
36
36
|
return;
|
|
37
|
-
const u =
|
|
37
|
+
const u = r.getBoundingClientRect(), f = r.offsetTop, b = r.offsetLeft, H = u.height, L = u.width, w = ((p = document.querySelector(e.relative)) == null ? void 0 : p.scrollLeft) || 0;
|
|
38
38
|
t.overlayStyle = {
|
|
39
39
|
...t.overlayStyle,
|
|
40
40
|
top: f + H + "px",
|
|
@@ -43,27 +43,27 @@ const B = {
|
|
|
43
43
|
}, m = () => {
|
|
44
44
|
t.overlayHover = !0;
|
|
45
45
|
};
|
|
46
|
-
D(() => e.visible, (
|
|
47
|
-
|
|
46
|
+
D(() => e.visible, (r) => {
|
|
47
|
+
r ? t.overlayClass = t.overlayClass.filter((l) => l !== i) : t.overlayClass.push(i);
|
|
48
48
|
});
|
|
49
49
|
let h = -1;
|
|
50
|
-
const g = (
|
|
51
|
-
|
|
50
|
+
const g = (r) => {
|
|
51
|
+
o.value === r.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(h), h = window.setTimeout(() => {
|
|
52
52
|
!t.overlayHover && !t.triggerHover && e.onChange(!1);
|
|
53
53
|
}, 10);
|
|
54
54
|
};
|
|
55
55
|
return T(() => {
|
|
56
|
-
|
|
56
|
+
o.value.addEventListener("mouseenter", s), o.value.addEventListener("mouseleave", g), n.value.addEventListener("mouseenter", m), n.value.addEventListener("mouseleave", g);
|
|
57
57
|
}), O(() => {
|
|
58
|
-
|
|
58
|
+
o.value.removeEventListener("mouseenter", s), o.value.removeEventListener("mouseleave", g), n.value.removeEventListener("mouseenter", m), n.value.removeEventListener("mouseleave", g);
|
|
59
59
|
}), () => {
|
|
60
|
-
const
|
|
60
|
+
const r = v({
|
|
61
61
|
ctx: a
|
|
62
62
|
}), l = v({
|
|
63
63
|
props: e,
|
|
64
64
|
ctx: a
|
|
65
|
-
}, "overlay"), u = $(
|
|
66
|
-
ref:
|
|
65
|
+
}, "overlay"), u = $(r instanceof Array ? r[0] : r, {
|
|
66
|
+
ref: o
|
|
67
67
|
}), f = d("div", {
|
|
68
68
|
class: [`${c}-dropdown`, t.overlayClass],
|
|
69
69
|
style: t.overlayStyle,
|
|
@@ -94,11 +94,20 @@ const B = {
|
|
|
94
94
|
type: [String, Object]
|
|
95
95
|
},
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
|
|
98
98
|
*/
|
|
99
99
|
insert: {
|
|
100
100
|
type: Function
|
|
101
101
|
},
|
|
102
|
+
language: {
|
|
103
|
+
type: String
|
|
104
|
+
},
|
|
105
|
+
theme: {
|
|
106
|
+
type: String
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* ==结束
|
|
110
|
+
*/
|
|
102
111
|
default: {
|
|
103
112
|
type: [String, Object]
|
|
104
113
|
}
|
|
@@ -112,7 +121,7 @@ const B = {
|
|
|
112
121
|
const t = v({
|
|
113
122
|
props: e,
|
|
114
123
|
ctx: a
|
|
115
|
-
}, "trigger"),
|
|
124
|
+
}, "trigger"), o = v({
|
|
116
125
|
props: e,
|
|
117
126
|
ctx: a
|
|
118
127
|
}, "overlay"), n = v({
|
|
@@ -125,7 +134,7 @@ const B = {
|
|
|
125
134
|
onChange: (s) => {
|
|
126
135
|
e.onChange instanceof Function ? e.onChange(s) : a.emit("onChange", s);
|
|
127
136
|
},
|
|
128
|
-
overlay:
|
|
137
|
+
overlay: o
|
|
129
138
|
}, {
|
|
130
139
|
default: () => [d("div", {
|
|
131
140
|
class: `${c}-toolbar-item`,
|