md-editor-v3 4.4.0 → 4.5.0-beta.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/README.md +129 -109
- package/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +18 -18
- 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/config.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +6 -6
- package/lib/cjs/chunks/index3.cjs +1 -2
- package/lib/cjs/chunks/index4.cjs +2 -0
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/MdCatalog.mjs +1 -1
- package/lib/es/MdEditor.mjs +967 -1058
- package/lib/es/MdModal.mjs +6 -139
- package/lib/es/MdPreview.mjs +1 -1
- package/lib/es/ModalToolbar.mjs +1 -1
- package/lib/es/chunks/config.mjs +25 -26
- package/lib/es/chunks/index.mjs +230 -204
- package/lib/es/chunks/index3.mjs +163 -61
- package/lib/es/chunks/index4.mjs +69 -0
- package/lib/es/index.mjs +18 -17
- package/lib/preview.css +1 -1
- package/lib/style.css +1 -1
- package/lib/types/MdEditor/Editor.d.ts +10 -1
- package/lib/types/MdEditor/components/Icon/Icon.d.ts +16 -0
- package/lib/types/MdEditor/components/Icon/Str.d.ts +3 -0
- package/lib/types/MdEditor/components/Icon/index.d.ts +16 -0
- package/lib/types/MdEditor/config.d.ts +2 -1
- package/lib/types/MdEditor/index.d.ts +23 -4
- package/lib/types/MdEditor/props.d.ts +15 -1
- package/lib/types/MdEditor/type.d.ts +37 -8
- package/lib/types/MdPreview/MdPreview.d.ts +9 -0
- package/lib/types/MdPreview/index.d.ts +20 -1
- package/lib/umd/index.js +43 -43
- package/package.json +1 -1
package/lib/es/MdModal.mjs
CHANGED
|
@@ -1,142 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { M as e } from "./chunks/index3.mjs";
|
|
2
|
+
import "vue";
|
|
3
|
+
import "./chunks/config.mjs";
|
|
4
|
+
import "./chunks/vue-tsx.mjs";
|
|
5
|
+
import "./chunks/dom.mjs";
|
|
5
6
|
import "@vavt/util";
|
|
6
|
-
const b = {
|
|
7
|
-
title: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: ""
|
|
10
|
-
},
|
|
11
|
-
visible: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: !1
|
|
14
|
-
},
|
|
15
|
-
width: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: "auto"
|
|
18
|
-
},
|
|
19
|
-
height: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "auto"
|
|
22
|
-
},
|
|
23
|
-
onClose: {
|
|
24
|
-
type: Function
|
|
25
|
-
},
|
|
26
|
-
showAdjust: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: !1
|
|
29
|
-
},
|
|
30
|
-
isFullscreen: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
34
|
-
onAdjust: {
|
|
35
|
-
type: Function,
|
|
36
|
-
default: () => {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}, h = /* @__PURE__ */ x({
|
|
40
|
-
name: "MdModal",
|
|
41
|
-
props: b,
|
|
42
|
-
emits: ["onClose"],
|
|
43
|
-
setup(e, u) {
|
|
44
|
-
const f = c(e.visible), n = c([`${s}-modal`]), m = c(), r = c();
|
|
45
|
-
let d = () => {
|
|
46
|
-
};
|
|
47
|
-
const t = k({
|
|
48
|
-
initPos: {
|
|
49
|
-
left: "0px",
|
|
50
|
-
top: "0px"
|
|
51
|
-
},
|
|
52
|
-
historyPos: {
|
|
53
|
-
left: "0px",
|
|
54
|
-
top: "0px"
|
|
55
|
-
}
|
|
56
|
-
}), C = $(() => e.isFullscreen ? {
|
|
57
|
-
width: "100%",
|
|
58
|
-
height: "100%"
|
|
59
|
-
} : {
|
|
60
|
-
width: e.width,
|
|
61
|
-
height: e.height
|
|
62
|
-
});
|
|
63
|
-
return F(() => {
|
|
64
|
-
d = y(r.value, (i, l) => {
|
|
65
|
-
t.initPos.left = i + "px", t.initPos.top = l + "px";
|
|
66
|
-
});
|
|
67
|
-
}), w(() => {
|
|
68
|
-
d();
|
|
69
|
-
}), v(() => e.isFullscreen, (i) => {
|
|
70
|
-
i ? d() : d = y(r.value, (l, a) => {
|
|
71
|
-
t.initPos.left = l + "px", t.initPos.top = a + "px";
|
|
72
|
-
});
|
|
73
|
-
}), v(() => e.visible, (i) => {
|
|
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";
|
|
77
|
-
}), setTimeout(() => {
|
|
78
|
-
n.value = n.value.filter((l) => l !== "zoom-in");
|
|
79
|
-
}, 140)) : (n.value.push("zoom-out"), setTimeout(() => {
|
|
80
|
-
n.value = n.value.filter((l) => l !== "zoom-out"), f.value = i;
|
|
81
|
-
}, 130));
|
|
82
|
-
}), () => {
|
|
83
|
-
const i = g({
|
|
84
|
-
ctx: u
|
|
85
|
-
}), l = g({
|
|
86
|
-
props: e,
|
|
87
|
-
ctx: u
|
|
88
|
-
}, "title");
|
|
89
|
-
return o("div", {
|
|
90
|
-
style: {
|
|
91
|
-
display: f.value ? "block" : "none"
|
|
92
|
-
}
|
|
93
|
-
}, [o("div", {
|
|
94
|
-
class: `${s}-modal-mask`,
|
|
95
|
-
onClick: () => {
|
|
96
|
-
e.onClose ? e.onClose() : u.emit("onClose");
|
|
97
|
-
}
|
|
98
|
-
}, null), o("div", {
|
|
99
|
-
class: n.value,
|
|
100
|
-
style: {
|
|
101
|
-
...t.initPos,
|
|
102
|
-
...C.value
|
|
103
|
-
},
|
|
104
|
-
ref: m
|
|
105
|
-
}, [o("div", {
|
|
106
|
-
class: `${s}-modal-header`,
|
|
107
|
-
ref: r
|
|
108
|
-
}, [l || ""]), o("div", {
|
|
109
|
-
class: `${s}-modal-body`
|
|
110
|
-
}, [i]), o("div", {
|
|
111
|
-
class: `${s}-modal-func`
|
|
112
|
-
}, [e.showAdjust && o("div", {
|
|
113
|
-
class: `${s}-modal-adjust`,
|
|
114
|
-
onClick: (a) => {
|
|
115
|
-
a.stopPropagation(), e.isFullscreen ? t.initPos = t.historyPos : (t.historyPos = t.initPos, t.initPos = {
|
|
116
|
-
left: "0",
|
|
117
|
-
top: "0"
|
|
118
|
-
}), e.onAdjust(!e.isFullscreen);
|
|
119
|
-
}
|
|
120
|
-
}, [o("svg", {
|
|
121
|
-
class: `${s}-icon`,
|
|
122
|
-
"aria-hidden": "true"
|
|
123
|
-
}, [o("use", {
|
|
124
|
-
"xlink:href": `#md-editor-icon-${e.isFullscreen ? "suoxiao" : "fangda"}`
|
|
125
|
-
}, null)])]), o("div", {
|
|
126
|
-
class: `${s}-modal-close`,
|
|
127
|
-
onClick: (a) => {
|
|
128
|
-
a.stopPropagation(), e.onClose ? e.onClose() : u.emit("onClose");
|
|
129
|
-
}
|
|
130
|
-
}, [o("svg", {
|
|
131
|
-
class: `${s}-icon`,
|
|
132
|
-
"aria-hidden": "true"
|
|
133
|
-
}, [o("use", {
|
|
134
|
-
"xlink:href": "#md-editor-icon-close"
|
|
135
|
-
}, null)])])])])]);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
h.install = (e) => (e.component(h.name, h), e);
|
|
140
7
|
export {
|
|
141
|
-
|
|
8
|
+
e as default
|
|
142
9
|
};
|
package/lib/es/MdPreview.mjs
CHANGED
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 f from "./
|
|
4
|
+
import { M as f } from "./chunks/index3.mjs";
|
|
5
5
|
import "./chunks/dom.mjs";
|
|
6
6
|
import "@vavt/util";
|
|
7
7
|
function m(t) {
|
package/lib/es/chunks/config.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", e = "https://cdnjs.cloudflare.com/ajax/libs",
|
|
1
|
+
const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", n = "https://at.alicdn.com/t/c/font_2605852_qm4cjcggwma.css", e = "https://cdnjs.cloudflare.com/ajax/libs", c = `${e}/highlight.js/11.7.0/highlight.min.js`, d = {
|
|
2
2
|
main: `${e}/prettier/2.8.0/standalone.js`,
|
|
3
3
|
markdown: `${e}/prettier/2.8.0/parser-markdown.js`
|
|
4
|
-
},
|
|
4
|
+
}, h = {
|
|
5
5
|
css: `${e}/cropperjs/1.5.13/cropper.min.css`,
|
|
6
6
|
js: `${e}/cropperjs/1.5.13/cropper.min.js`
|
|
7
|
-
},
|
|
7
|
+
}, g = `${e}/screenfull.js/5.2.0/screenfull.min.js`, m = [
|
|
8
8
|
"bold",
|
|
9
9
|
"underline",
|
|
10
10
|
"italic",
|
|
@@ -37,7 +37,7 @@ const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2
|
|
|
37
37
|
"htmlPreview",
|
|
38
38
|
"catalog",
|
|
39
39
|
"github"
|
|
40
|
-
],
|
|
40
|
+
], p = ["markdownTotal", "=", "scrollSwitch"], u = {
|
|
41
41
|
"zh-CN": {
|
|
42
42
|
toolbarTips: {
|
|
43
43
|
bold: "加粗",
|
|
@@ -200,10 +200,10 @@ const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2
|
|
|
200
200
|
scrollAuto: "Scroll Auto"
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
},
|
|
203
|
+
}, k = `${e}/mermaid/10.1.0/mermaid.esm.min.mjs`, b = {
|
|
204
204
|
js: `${e}/KaTeX/0.16.3/katex.min.js`,
|
|
205
205
|
css: `${e}/KaTeX/0.16.3/katex.min.css`
|
|
206
|
-
},
|
|
206
|
+
}, f = {
|
|
207
207
|
a11y: {
|
|
208
208
|
light: `${e}/highlight.js/11.7.0/styles/a11y-light.min.css`,
|
|
209
209
|
dark: `${e}/highlight.js/11.7.0/styles/a11y-dark.min.css`
|
|
@@ -237,36 +237,35 @@ const a = "md-editor", o = "md-editor-v3", r = "https://at.alicdn.com/t/c/font_2
|
|
|
237
237
|
dark: `${e}/highlight.js/11.7.0/styles/stackoverflow-dark.min.css`
|
|
238
238
|
}
|
|
239
239
|
}, l = {
|
|
240
|
-
// markedRenderer: (r) => r,
|
|
241
|
-
// markedExtensions: [],
|
|
242
|
-
// markedOptions: {},
|
|
243
240
|
editorExtensions: {},
|
|
244
241
|
editorConfig: {},
|
|
245
|
-
codeMirrorExtensions: (
|
|
242
|
+
codeMirrorExtensions: (t, i) => i,
|
|
246
243
|
markdownItConfig: () => {
|
|
247
244
|
},
|
|
248
|
-
markdownItPlugins: (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
s
|
|
245
|
+
markdownItPlugins: (t) => t,
|
|
246
|
+
iconfontType: "svg"
|
|
247
|
+
}, j = (t) => {
|
|
248
|
+
if (t)
|
|
249
|
+
for (const i in t) {
|
|
250
|
+
const s = t[i];
|
|
251
|
+
s && (l[i] = s);
|
|
254
252
|
}
|
|
255
253
|
};
|
|
256
254
|
export {
|
|
257
255
|
l as a,
|
|
258
|
-
|
|
256
|
+
m as b,
|
|
259
257
|
j as c,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
258
|
+
p as d,
|
|
259
|
+
f as e,
|
|
260
|
+
u as f,
|
|
261
|
+
n as g,
|
|
262
|
+
c as h,
|
|
265
263
|
r as i,
|
|
266
264
|
d as j,
|
|
267
|
-
k,
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
b as k,
|
|
266
|
+
h as l,
|
|
267
|
+
k as m,
|
|
268
|
+
o as n,
|
|
270
269
|
a as p,
|
|
271
|
-
|
|
270
|
+
g as s
|
|
272
271
|
};
|