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.
@@ -1,142 +1,9 @@
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
- import { p as s } from "./chunks/config.mjs";
3
- import { g } from "./chunks/vue-tsx.mjs";
4
- import { k as y } from "./chunks/dom.mjs";
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
- h as default
8
+ e as default
142
9
  };
@@ -1,7 +1,7 @@
1
1
  import { M as x } from "./chunks/index.mjs";
2
2
  import "vue";
3
3
  import "./chunks/config.mjs";
4
- import "./chunks/index3.mjs";
4
+ import "./chunks/index4.mjs";
5
5
  import "./chunks/dom.mjs";
6
6
  import "@vavt/util";
7
7
  import "medium-zoom";
@@ -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 "./MdModal.mjs";
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) {
@@ -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", n = `${e}/highlight.js/11.7.0/highlight.min.js`, c = {
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
- }, d = {
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
- }, h = `${e}/screenfull.js/5.2.0/screenfull.min.js`, g = [
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
- ], m = ["markdownTotal", "=", "scrollSwitch"], p = {
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
- }, u = `${e}/mermaid/10.1.0/mermaid.esm.min.mjs`, k = {
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
- }, b = {
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: (i, t) => t,
242
+ codeMirrorExtensions: (t, i) => i,
246
243
  markdownItConfig: () => {
247
244
  },
248
- markdownItPlugins: (i) => i
249
- }, j = (i) => {
250
- if (i)
251
- for (const t in i) {
252
- const s = i[t];
253
- s && (l[t] = 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
- g as b,
256
+ m as b,
259
257
  j as c,
260
- m as d,
261
- b as e,
262
- p as f,
263
- c as g,
264
- n as h,
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
- o as l,
269
- u as m,
265
+ b as k,
266
+ h as l,
267
+ k as m,
268
+ o as n,
270
269
  a as p,
271
- h as s
270
+ g as s
272
271
  };