md-editor-v3 6.1.1-0 → 6.2.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/lib/cjs/MdEditor.cjs +13 -13
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +1 -1
- package/lib/cjs/chunks/index3.cjs +37 -38
- package/lib/cjs/chunks/index4.cjs +1 -1
- package/lib/es/MdEditor.mjs +931 -915
- package/lib/es/ModalToolbar.mjs +24 -23
- package/lib/es/chunks/index.mjs +32 -32
- package/lib/es/chunks/index3.mjs +670 -632
- package/lib/es/chunks/index4.mjs +250 -254
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/Editor.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/UpdateOnDemand.d.ts +16 -0
- package/lib/types/MdEditor/layouts/Content/index.d.ts +3 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +9 -1
- package/lib/types/MdEditor/props.d.ts +9 -1
- package/lib/types/MdPreview/MdPreview.d.ts +3 -0
- package/package.json +2 -1
package/lib/es/ModalToolbar.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { M as
|
|
1
|
+
import { defineComponent as r, createVNode as d, Fragment as c, isVNode as y } from "vue";
|
|
2
|
+
import { M as g } from "./chunks/index2.mjs";
|
|
3
3
|
import { p as a } from "./chunks/config.mjs";
|
|
4
|
-
import { g as
|
|
5
|
-
function
|
|
6
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
4
|
+
import { g as i } from "./chunks/vue-tsx.mjs";
|
|
5
|
+
function m(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !y(e);
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const h = {
|
|
9
9
|
title: {
|
|
10
10
|
type: String,
|
|
11
11
|
default: ""
|
|
@@ -100,23 +100,28 @@ const m = {
|
|
|
100
100
|
/**
|
|
101
101
|
* ==结束
|
|
102
102
|
*/
|
|
103
|
-
},
|
|
103
|
+
}, o = /* @__PURE__ */ r({
|
|
104
104
|
name: "ModalToolbar",
|
|
105
|
-
props:
|
|
105
|
+
props: h,
|
|
106
106
|
emits: ["onClick", "onClose", "onAdjust"],
|
|
107
107
|
setup(e, t) {
|
|
108
|
+
const u = () => {
|
|
109
|
+
e.onClose?.(), t.emit("onClose");
|
|
110
|
+
}, s = (n) => {
|
|
111
|
+
e.onAdjust?.(n), t.emit("onAdjust", n);
|
|
112
|
+
};
|
|
108
113
|
return () => {
|
|
109
|
-
const
|
|
114
|
+
const n = i({
|
|
110
115
|
props: e,
|
|
111
116
|
ctx: t
|
|
112
|
-
}, "trigger"), f =
|
|
117
|
+
}, "trigger"), f = i({
|
|
113
118
|
props: e,
|
|
114
119
|
ctx: t
|
|
115
|
-
}, "modalTitle"),
|
|
120
|
+
}, "modalTitle"), l = i({
|
|
116
121
|
props: e,
|
|
117
122
|
ctx: t
|
|
118
123
|
});
|
|
119
|
-
return
|
|
124
|
+
return d(c, null, [d("button", {
|
|
120
125
|
class: [`${a}-toolbar-item`, e.disabled && `${a}-disabled`],
|
|
121
126
|
title: e.title,
|
|
122
127
|
disabled: e.disabled,
|
|
@@ -124,7 +129,7 @@ const m = {
|
|
|
124
129
|
e.onClick?.(), t.emit("onClick");
|
|
125
130
|
},
|
|
126
131
|
type: "button"
|
|
127
|
-
}, [
|
|
132
|
+
}, [n]), d(g, {
|
|
128
133
|
style: e.style,
|
|
129
134
|
class: e.class,
|
|
130
135
|
width: e.width,
|
|
@@ -132,21 +137,17 @@ const m = {
|
|
|
132
137
|
title: f,
|
|
133
138
|
visible: e.visible,
|
|
134
139
|
showMask: e.showMask,
|
|
135
|
-
onClose:
|
|
136
|
-
e.onClose?.(), t.emit("onClose");
|
|
137
|
-
},
|
|
140
|
+
onClose: u,
|
|
138
141
|
showAdjust: e.showAdjust,
|
|
139
142
|
isFullscreen: e.isFullscreen,
|
|
140
|
-
onAdjust:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}, g(n) ? n : {
|
|
144
|
-
default: () => [n]
|
|
143
|
+
onAdjust: s
|
|
144
|
+
}, m(l) ? l : {
|
|
145
|
+
default: () => [l]
|
|
145
146
|
})]);
|
|
146
147
|
};
|
|
147
148
|
}
|
|
148
149
|
});
|
|
149
|
-
|
|
150
|
+
o.install = (e) => (e.component(o.name, o), e);
|
|
150
151
|
export {
|
|
151
|
-
|
|
152
|
+
o as default
|
|
152
153
|
};
|
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as H, reactive as D, ref as w, watch as $, onMounted as B, onBeforeUnmount as N, cloneVNode as W, createVNode as
|
|
1
|
+
import { defineComponent as H, reactive as D, ref as w, watch as $, onMounted as B, onBeforeUnmount as N, cloneVNode as W, createVNode as c, inject as O } from "vue";
|
|
2
2
|
import { p as i } from "./config.mjs";
|
|
3
|
-
import { g as
|
|
3
|
+
import { g as f } from "./vue-tsx.mjs";
|
|
4
4
|
const j = {
|
|
5
5
|
overlay: {
|
|
6
6
|
type: [String, Object],
|
|
@@ -33,19 +33,19 @@ const j = {
|
|
|
33
33
|
overlayStyle: {},
|
|
34
34
|
triggerHover: !1,
|
|
35
35
|
overlayHover: !1
|
|
36
|
-
}),
|
|
36
|
+
}), o = w(), l = w(), u = () => {
|
|
37
37
|
if (e.disabled)
|
|
38
38
|
return !1;
|
|
39
39
|
t.triggerHover = !0;
|
|
40
|
-
const n =
|
|
41
|
-
if (!n || !
|
|
40
|
+
const n = o.value, r = l.value;
|
|
41
|
+
if (!n || !r)
|
|
42
42
|
return;
|
|
43
|
-
const g = n.getBoundingClientRect(),
|
|
44
|
-
let
|
|
45
|
-
|
|
43
|
+
const g = n.getBoundingClientRect(), y = n.offsetTop, L = n.offsetLeft, E = g.height, T = g.width, S = n.getRootNode(), m = S.querySelector(e.relative)?.scrollLeft || 0, C = S.querySelector(e.relative)?.clientWidth || 0;
|
|
44
|
+
let s = L - r.offsetWidth / 2 + T / 2 - m;
|
|
45
|
+
s + r.offsetWidth > m + C && (s = m + C - r.offsetWidth), s < 0 && (s = 0), t.overlayStyle = {
|
|
46
46
|
...t.overlayStyle,
|
|
47
|
-
top:
|
|
48
|
-
left:
|
|
47
|
+
top: y + E + "px",
|
|
48
|
+
left: s + "px"
|
|
49
49
|
}, e.onChange(!0);
|
|
50
50
|
}, b = () => {
|
|
51
51
|
if (e.disabled)
|
|
@@ -53,35 +53,35 @@ const j = {
|
|
|
53
53
|
t.overlayHover = !0;
|
|
54
54
|
};
|
|
55
55
|
$(() => e.visible, (n) => {
|
|
56
|
-
n ? t.overlayClass = t.overlayClass.filter((
|
|
56
|
+
n ? t.overlayClass = t.overlayClass.filter((r) => r !== d) : t.overlayClass.push(d);
|
|
57
57
|
});
|
|
58
58
|
let p = -1;
|
|
59
59
|
const v = (n) => {
|
|
60
|
-
|
|
60
|
+
o.value === n.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(p), p = window.setTimeout(() => {
|
|
61
61
|
!t.overlayHover && !t.triggerHover && e.onChange(!1);
|
|
62
62
|
}, 10);
|
|
63
63
|
};
|
|
64
64
|
return B(() => {
|
|
65
|
-
|
|
65
|
+
o.value.addEventListener("mouseenter", u), o.value.addEventListener("mouseleave", v), l.value.addEventListener("mouseenter", b), l.value.addEventListener("mouseleave", v);
|
|
66
66
|
}), N(() => {
|
|
67
|
-
|
|
67
|
+
o.value.removeEventListener("mouseenter", u), o.value.removeEventListener("mouseleave", v), l.value.removeEventListener("mouseenter", b), l.value.removeEventListener("mouseleave", v);
|
|
68
68
|
}), () => {
|
|
69
|
-
const n =
|
|
69
|
+
const n = f({
|
|
70
70
|
ctx: a
|
|
71
|
-
}),
|
|
71
|
+
}), r = f({
|
|
72
72
|
props: e,
|
|
73
73
|
ctx: a
|
|
74
74
|
}, "overlay"), g = W(n instanceof Array ? n[0] : n, {
|
|
75
|
-
ref:
|
|
75
|
+
ref: o,
|
|
76
76
|
key: "cloned-dropdown-trigger"
|
|
77
|
-
}),
|
|
77
|
+
}), y = c("div", {
|
|
78
78
|
class: [`${i}-dropdown`, t.overlayClass],
|
|
79
79
|
style: t.overlayStyle,
|
|
80
80
|
ref: l
|
|
81
|
-
}, [
|
|
81
|
+
}, [c("div", {
|
|
82
82
|
class: `${i}-dropdown-overlay`
|
|
83
|
-
}, [
|
|
84
|
-
return [g,
|
|
83
|
+
}, [r instanceof Array ? r[0] : r])]);
|
|
84
|
+
return [g, y];
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}), R = {
|
|
@@ -150,33 +150,33 @@ const j = {
|
|
|
150
150
|
props: R,
|
|
151
151
|
emits: ["onChange"],
|
|
152
152
|
setup(e, a) {
|
|
153
|
-
const d = O("editorId")
|
|
153
|
+
const d = O("editorId"), t = (o) => {
|
|
154
|
+
e.onChange?.(o), a.emit("onChange", o);
|
|
155
|
+
};
|
|
154
156
|
return () => {
|
|
155
|
-
const
|
|
157
|
+
const o = f({
|
|
156
158
|
props: e,
|
|
157
159
|
ctx: a
|
|
158
|
-
}, "trigger"),
|
|
160
|
+
}, "trigger"), l = f({
|
|
159
161
|
props: e,
|
|
160
162
|
ctx: a
|
|
161
|
-
}, "overlay"),
|
|
163
|
+
}, "overlay"), u = f({
|
|
162
164
|
props: e,
|
|
163
165
|
ctx: a
|
|
164
166
|
});
|
|
165
|
-
return
|
|
167
|
+
return c(I, {
|
|
166
168
|
relative: `#${d}-toolbar-wrapper`,
|
|
167
169
|
visible: e.visible,
|
|
168
|
-
onChange:
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
overlay: r,
|
|
170
|
+
onChange: t,
|
|
171
|
+
overlay: l,
|
|
172
172
|
disabled: e.disabled
|
|
173
173
|
}, {
|
|
174
|
-
default: () => [
|
|
174
|
+
default: () => [c("button", {
|
|
175
175
|
class: [`${i}-toolbar-item`, e.disabled && `${i}-disabled`],
|
|
176
176
|
title: e.title || "",
|
|
177
177
|
disabled: e.disabled,
|
|
178
178
|
type: "button"
|
|
179
|
-
}, [
|
|
179
|
+
}, [u || o])]
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
182
|
}
|