md-editor-v3 6.0.0 → 6.0.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 +4 -4
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/NormalToolbar.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +1 -1
- package/lib/cjs/chunks/index3.cjs +45 -45
- package/lib/es/MdEditor.mjs +446 -426
- package/lib/es/ModalToolbar.mjs +6 -5
- package/lib/es/NormalToolbar.mjs +2 -1
- package/lib/es/chunks/index.mjs +10 -9
- package/lib/es/chunks/index3.mjs +520 -514
- package/lib/types/MdEditor/composition.d.ts +3 -3
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +0 -13
- package/lib/types/MdEditor/layouts/Content/index.d.ts +0 -3
- package/lib/types/MdEditor/layouts/Content/props.d.ts +1 -13
- package/package.json +1 -1
package/lib/es/ModalToolbar.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as s, createVNode as l, Fragment as r, isVNode as c } from "vue";
|
|
2
|
-
import { M as
|
|
2
|
+
import { M as y } from "./chunks/index2.mjs";
|
|
3
3
|
import { p as a } from "./chunks/config.mjs";
|
|
4
4
|
import { g as d } from "./chunks/vue-tsx.mjs";
|
|
5
|
-
function
|
|
5
|
+
function g(e) {
|
|
6
6
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !c(e);
|
|
7
7
|
}
|
|
8
8
|
const m = {
|
|
@@ -122,8 +122,9 @@ const m = {
|
|
|
122
122
|
disabled: e.disabled,
|
|
123
123
|
onClick: () => {
|
|
124
124
|
e.onClick?.(), t.emit("onClick");
|
|
125
|
-
}
|
|
126
|
-
|
|
125
|
+
},
|
|
126
|
+
type: "button"
|
|
127
|
+
}, [u]), l(y, {
|
|
127
128
|
style: e.style,
|
|
128
129
|
class: e.class,
|
|
129
130
|
width: e.width,
|
|
@@ -139,7 +140,7 @@ const m = {
|
|
|
139
140
|
onAdjust: (o) => {
|
|
140
141
|
e.onAdjust?.(o), t.emit("onAdjust", o);
|
|
141
142
|
}
|
|
142
|
-
},
|
|
143
|
+
}, g(n) ? n : {
|
|
143
144
|
default: () => [n]
|
|
144
145
|
})]);
|
|
145
146
|
};
|
package/lib/es/NormalToolbar.mjs
CHANGED
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 y, inject as O } from "vue";
|
|
2
2
|
import { p as i } from "./config.mjs";
|
|
3
3
|
import { g as u } from "./vue-tsx.mjs";
|
|
4
4
|
const j = {
|
|
@@ -40,11 +40,11 @@ const j = {
|
|
|
40
40
|
const n = r.value, o = l.value;
|
|
41
41
|
if (!n || !o)
|
|
42
42
|
return;
|
|
43
|
-
const g = n.getBoundingClientRect(),
|
|
43
|
+
const g = n.getBoundingClientRect(), c = 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
44
|
let f = L - o.offsetWidth / 2 + T / 2 - m;
|
|
45
45
|
f + o.offsetWidth > m + C && (f = m + C - o.offsetWidth), f < 0 && (f = 0), t.overlayStyle = {
|
|
46
46
|
...t.overlayStyle,
|
|
47
|
-
top:
|
|
47
|
+
top: c + E + "px",
|
|
48
48
|
left: f + "px"
|
|
49
49
|
}, e.onChange(!0);
|
|
50
50
|
}, b = () => {
|
|
@@ -74,14 +74,14 @@ const j = {
|
|
|
74
74
|
}, "overlay"), g = W(n instanceof Array ? n[0] : n, {
|
|
75
75
|
ref: r,
|
|
76
76
|
key: "cloned-dropdown-trigger"
|
|
77
|
-
}),
|
|
77
|
+
}), c = y("div", {
|
|
78
78
|
class: [`${i}-dropdown`, t.overlayClass],
|
|
79
79
|
style: t.overlayStyle,
|
|
80
80
|
ref: l
|
|
81
|
-
}, [
|
|
81
|
+
}, [y("div", {
|
|
82
82
|
class: `${i}-dropdown-overlay`
|
|
83
83
|
}, [o instanceof Array ? o[0] : o])]);
|
|
84
|
-
return [g,
|
|
84
|
+
return [g, c];
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}), R = {
|
|
@@ -162,7 +162,7 @@ const j = {
|
|
|
162
162
|
props: e,
|
|
163
163
|
ctx: a
|
|
164
164
|
});
|
|
165
|
-
return
|
|
165
|
+
return y(I, {
|
|
166
166
|
relative: `#${d}-toolbar-wrapper`,
|
|
167
167
|
visible: e.visible,
|
|
168
168
|
onChange: (s) => {
|
|
@@ -171,10 +171,11 @@ const j = {
|
|
|
171
171
|
overlay: r,
|
|
172
172
|
disabled: e.disabled
|
|
173
173
|
}, {
|
|
174
|
-
default: () => [
|
|
174
|
+
default: () => [y("button", {
|
|
175
175
|
class: [`${i}-toolbar-item`, e.disabled && `${i}-disabled`],
|
|
176
176
|
title: e.title || "",
|
|
177
|
-
disabled: e.disabled
|
|
177
|
+
disabled: e.disabled,
|
|
178
|
+
type: "button"
|
|
178
179
|
}, [l || t])]
|
|
179
180
|
});
|
|
180
181
|
};
|