md-editor-v3 4.3.0-beta.3 → 4.3.0-beta.5
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 +2 -0
- package/lib/cjs/MdEditor.cjs +24 -24
- package/lib/cjs/MdModal.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +7 -7
- package/lib/cjs/chunks/index2.cjs +1 -1
- package/lib/es/MdEditor.mjs +484 -449
- package/lib/es/MdModal.mjs +26 -25
- package/lib/es/chunks/index.mjs +179 -161
- package/lib/es/chunks/index2.mjs +28 -28
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +2 -2
- package/lib/types/DropdownToolbar/index.d.ts +4 -4
- package/lib/types/MdEditor/Editor.d.ts +8 -1
- package/lib/types/MdEditor/components/Modal/Modal.d.ts +4 -5
- package/lib/types/MdEditor/components/Modal/index.d.ts +13 -12
- package/lib/types/MdEditor/index.d.ts +18 -2
- package/lib/types/MdEditor/layouts/Content/codemirror/index.d.ts +3 -3
- 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 +3 -2
- package/lib/types/MdPreview/MdPreview.d.ts +2 -1
- package/lib/types/MdPreview/index.d.ts +6 -2
- package/lib/umd/index.js +6 -6
- package/package.json +1 -1
package/lib/es/MdModal.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, ref as c, reactive as k, computed as $, onMounted as F, onBeforeUnmount as w, watch as v, nextTick as M, createVNode as o } from "vue";
|
|
2
2
|
import { p as s } from "./chunks/config.mjs";
|
|
3
3
|
import { g } from "./chunks/vue-tsx.mjs";
|
|
4
4
|
import { k as y } from "./chunks/dom.mjs";
|
|
@@ -21,9 +21,7 @@ const b = {
|
|
|
21
21
|
default: "auto"
|
|
22
22
|
},
|
|
23
23
|
onClose: {
|
|
24
|
-
type: Function
|
|
25
|
-
default: () => {
|
|
26
|
-
}
|
|
24
|
+
type: Function
|
|
27
25
|
},
|
|
28
26
|
showAdjust: {
|
|
29
27
|
type: Boolean,
|
|
@@ -38,12 +36,13 @@ const b = {
|
|
|
38
36
|
default: () => {
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
|
-
},
|
|
39
|
+
}, h = /* @__PURE__ */ x({
|
|
42
40
|
name: "MdModal",
|
|
43
41
|
props: b,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
emits: ["onClose"],
|
|
43
|
+
setup(e, u) {
|
|
44
|
+
const f = c(e.visible), n = c([`${s}-modal`]), m = c(), r = c();
|
|
45
|
+
let d = () => {
|
|
47
46
|
};
|
|
48
47
|
const t = k({
|
|
49
48
|
initPos: {
|
|
@@ -54,7 +53,7 @@ const b = {
|
|
|
54
53
|
left: "0px",
|
|
55
54
|
top: "0px"
|
|
56
55
|
}
|
|
57
|
-
}),
|
|
56
|
+
}), C = $(() => e.isFullscreen ? {
|
|
58
57
|
width: "100%",
|
|
59
58
|
height: "100%"
|
|
60
59
|
} : {
|
|
@@ -62,45 +61,47 @@ const b = {
|
|
|
62
61
|
height: e.height
|
|
63
62
|
});
|
|
64
63
|
return F(() => {
|
|
65
|
-
|
|
64
|
+
d = y(r.value, (i, l) => {
|
|
66
65
|
t.initPos.left = i + "px", t.initPos.top = l + "px";
|
|
67
66
|
});
|
|
68
67
|
}), w(() => {
|
|
69
|
-
|
|
68
|
+
d();
|
|
70
69
|
}), v(() => e.isFullscreen, (i) => {
|
|
71
|
-
i ?
|
|
70
|
+
i ? d() : d = y(r.value, (l, a) => {
|
|
72
71
|
t.initPos.left = l + "px", t.initPos.top = a + "px";
|
|
73
72
|
});
|
|
74
73
|
}), v(() => e.visible, (i) => {
|
|
75
|
-
i ? (n.value.push("zoom-in"),
|
|
76
|
-
const l =
|
|
77
|
-
t.initPos.left =
|
|
74
|
+
i ? (n.value.push("zoom-in"), f.value = i, M(() => {
|
|
75
|
+
const l = m.value.offsetWidth / 2, a = m.value.offsetHeight / 2, P = document.documentElement.clientWidth / 2, p = document.documentElement.clientHeight / 2;
|
|
76
|
+
t.initPos.left = P - l + "px", t.initPos.top = p - a + "px";
|
|
78
77
|
}), setTimeout(() => {
|
|
79
78
|
n.value = n.value.filter((l) => l !== "zoom-in");
|
|
80
79
|
}, 140)) : (n.value.push("zoom-out"), setTimeout(() => {
|
|
81
|
-
n.value = n.value.filter((l) => l !== "zoom-out"),
|
|
80
|
+
n.value = n.value.filter((l) => l !== "zoom-out"), f.value = i;
|
|
82
81
|
}, 130));
|
|
83
82
|
}), () => {
|
|
84
83
|
const i = g({
|
|
85
|
-
ctx:
|
|
84
|
+
ctx: u
|
|
86
85
|
}), l = g({
|
|
87
86
|
props: e,
|
|
88
|
-
ctx:
|
|
87
|
+
ctx: u
|
|
89
88
|
}, "title");
|
|
90
89
|
return o("div", {
|
|
91
90
|
style: {
|
|
92
|
-
display:
|
|
91
|
+
display: f.value ? "block" : "none"
|
|
93
92
|
}
|
|
94
93
|
}, [o("div", {
|
|
95
94
|
class: `${s}-modal-mask`,
|
|
96
|
-
onClick:
|
|
95
|
+
onClick: () => {
|
|
96
|
+
e.onClose ? e.onClose() : u.emit("onClose");
|
|
97
|
+
}
|
|
97
98
|
}, null), o("div", {
|
|
98
99
|
class: n.value,
|
|
99
100
|
style: {
|
|
100
101
|
...t.initPos,
|
|
101
|
-
...
|
|
102
|
+
...C.value
|
|
102
103
|
},
|
|
103
|
-
ref:
|
|
104
|
+
ref: m
|
|
104
105
|
}, [o("div", {
|
|
105
106
|
class: `${s}-modal-header`,
|
|
106
107
|
ref: r
|
|
@@ -124,7 +125,7 @@ const b = {
|
|
|
124
125
|
}, null)])]), o("div", {
|
|
125
126
|
class: `${s}-modal-close`,
|
|
126
127
|
onClick: (a) => {
|
|
127
|
-
a.stopPropagation(), e.onClose
|
|
128
|
+
a.stopPropagation(), e.onClose ? e.onClose() : u.emit("onClose");
|
|
128
129
|
}
|
|
129
130
|
}, [o("svg", {
|
|
130
131
|
class: `${s}-icon`,
|
|
@@ -135,7 +136,7 @@ const b = {
|
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
138
|
});
|
|
138
|
-
|
|
139
|
+
h.install = (e) => (e.component(h.name, h), e);
|
|
139
140
|
export {
|
|
140
|
-
|
|
141
|
+
h as default
|
|
141
142
|
};
|