md-editor-v3 6.2.1 → 6.3.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.
@@ -1,7 +1,7 @@
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";
1
+ import { defineComponent as H, reactive as B, ref as w, watch as D, onMounted as $, onBeforeUnmount as N, cloneVNode as W, createVNode as c, inject as I } from "vue";
2
2
  import { p as i } from "./config.mjs";
3
3
  import { g as f } from "./vue-tsx.mjs";
4
- const j = {
4
+ const O = {
5
5
  overlay: {
6
6
  type: [String, Object],
7
7
  default: ""
@@ -24,11 +24,11 @@ const j = {
24
24
  type: Boolean,
25
25
  default: void 0
26
26
  }
27
- }, I = /* @__PURE__ */ H({
27
+ }, j = /* @__PURE__ */ H({
28
28
  name: `${i}-dropdown`,
29
- props: j,
29
+ props: O,
30
30
  setup(e, a) {
31
- const d = `${i}-dropdown-hidden`, t = D({
31
+ const d = `${i}-dropdown-hidden`, t = B({
32
32
  overlayClass: [d],
33
33
  overlayStyle: {},
34
34
  triggerHover: !1,
@@ -40,28 +40,28 @@ const j = {
40
40
  const n = o.value, r = l.value;
41
41
  if (!n || !r)
42
42
  return;
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;
43
+ const g = n.getBoundingClientRect(), y = n.offsetTop, L = n.offsetLeft, E = g.height, T = g.width, p = n.getRootNode(), m = p.querySelector(e.relative)?.scrollLeft || 0, C = p.querySelector(e.relative)?.clientWidth || 0;
44
44
  let s = L - r.offsetWidth / 2 + T / 2 - m;
45
45
  s + r.offsetWidth > m + C && (s = m + C - r.offsetWidth), s < 0 && (s = 0), t.overlayStyle = {
46
46
  ...t.overlayStyle,
47
- top: y + E + "px",
48
- left: s + "px"
47
+ insetBlockStart: y + E + "px",
48
+ insetInlineStart: s + "px"
49
49
  }, e.onChange(!0);
50
50
  }, b = () => {
51
51
  if (e.disabled)
52
52
  return !1;
53
53
  t.overlayHover = !0;
54
54
  };
55
- $(() => e.visible, (n) => {
55
+ D(() => e.visible, (n) => {
56
56
  n ? t.overlayClass = t.overlayClass.filter((r) => r !== d) : t.overlayClass.push(d);
57
57
  });
58
- let p = -1;
58
+ let S = -1;
59
59
  const v = (n) => {
60
- o.value === n.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(p), p = window.setTimeout(() => {
60
+ o.value === n.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(S), S = window.setTimeout(() => {
61
61
  !t.overlayHover && !t.triggerHover && e.onChange(!1);
62
62
  }, 10);
63
63
  };
64
- return B(() => {
64
+ return $(() => {
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);
@@ -150,7 +150,7 @@ const j = {
150
150
  props: R,
151
151
  emits: ["onChange"],
152
152
  setup(e, a) {
153
- const d = O("editorId"), t = (o) => {
153
+ const d = I("editorId"), t = (o) => {
154
154
  e.onChange?.(o), a.emit("onChange", o);
155
155
  };
156
156
  return () => {
@@ -164,7 +164,7 @@ const j = {
164
164
  props: e,
165
165
  ctx: a
166
166
  });
167
- return c(I, {
167
+ return c(j, {
168
168
  relative: `#${d}-toolbar-wrapper`,
169
169
  visible: e.visible,
170
170
  onChange: t,
@@ -184,5 +184,5 @@ const j = {
184
184
  h.install = (e) => (e.component(h.name, h), e);
185
185
  export {
186
186
  h as D,
187
- I as a
187
+ j as a
188
188
  };
@@ -1,10 +1,10 @@
1
- import { createVNode as t, defineComponent as k, h as I, inject as S, ref as r, shallowRef as O, reactive as E, computed as p, watch as x, nextTick as b, onMounted as W, Teleport as q } from "vue";
2
- import { p as i, g as C } from "./config.mjs";
1
+ import { createVNode as t, defineComponent as k, h as j, inject as p, ref as c, shallowRef as O, reactive as E, computed as g, watch as x, nextTick as b, onMounted as W, Teleport as q } from "vue";
2
+ import { p as l, g as C } from "./config.mjs";
3
3
  import { c as w } from "./index5.mjs";
4
- import { k as z } from "./dom.mjs";
5
- import { g as M } from "./vue-tsx.mjs";
6
- import { Upload as N, Trash2 as D, X as U, SquareSigma as X, ChartArea as G, ListTree as Q, CodeXml as V, Eye as Z, View as J, Expand as K, Shrink as Y, Maximize2 as _, Minimize2 as ee, SquareCode as P, Save as te, Forward as oe, Reply as le, Table as ne, Image as ie, Link as se, Code as ae, ListTodo as ue, ListOrdered as de, List as re, Quote as ce, Superscript as me, Subscript as fe, Heading as he, Strikethrough as ve, Italic as ye, Underline as pe, Bold as ge } from "lucide-vue-next";
7
- const Se = () => t("svg", {
4
+ import { k as I } from "./dom.mjs";
5
+ import { g as z } from "./vue-tsx.mjs";
6
+ import { Upload as N, Trash2 as D, X as U, SquareSigma as X, ChartArea as G, ListTree as Q, CodeXml as V, Eye as Z, View as J, Expand as K, Shrink as Y, Maximize2 as _, Minimize2 as ee, SquareCode as M, Save as te, Forward as ne, Reply as oe, Table as ie, Image as le, Link as se, Code as ae, ListTodo as re, ListOrdered as ue, List as ce, Quote as de, Superscript as me, Subscript as fe, Heading as he, Strikethrough as ve, Italic as ye, Underline as ge, Bold as Se } from "lucide-vue-next";
7
+ const pe = () => t("svg", {
8
8
  xmlns: "http://www.w3.org/2000/svg",
9
9
  viewBox: "0 0 24 24",
10
10
  fill: "none",
@@ -18,26 +18,26 @@ const Se = () => t("svg", {
18
18
  }, null), t("path", {
19
19
  d: "M9 18c-4.51 2-5-2-7-2"
20
20
  }, null)]), ke = {
21
- bold: ge,
22
- underline: pe,
21
+ bold: Se,
22
+ underline: ge,
23
23
  italic: ye,
24
24
  "strike-through": ve,
25
25
  title: he,
26
26
  sub: fe,
27
27
  sup: me,
28
- quote: ce,
29
- "unordered-list": re,
30
- "ordered-list": de,
31
- task: ue,
28
+ quote: de,
29
+ "unordered-list": ce,
30
+ "ordered-list": ue,
31
+ task: re,
32
32
  "code-row": ae,
33
- code: P,
33
+ code: M,
34
34
  link: se,
35
- image: ie,
36
- table: ne,
37
- revoke: le,
38
- next: oe,
35
+ image: le,
36
+ table: ie,
37
+ revoke: oe,
38
+ next: ne,
39
39
  save: te,
40
- prettier: P,
40
+ prettier: M,
41
41
  minimize: ee,
42
42
  maximize: _,
43
43
  "fullscreen-exit": Y,
@@ -46,14 +46,14 @@ const Se = () => t("svg", {
46
46
  preview: Z,
47
47
  "preview-html": V,
48
48
  catalog: Q,
49
- github: Se,
49
+ github: pe,
50
50
  mermaid: G,
51
51
  formula: X,
52
52
  close: U,
53
53
  delete: D,
54
54
  upload: N
55
55
  }, xe = /* @__PURE__ */ k({
56
- name: `${i}-icon-set`,
56
+ name: `${l}-icon-set`,
57
57
  props: {
58
58
  name: {
59
59
  type: String,
@@ -61,12 +61,12 @@ const Se = () => t("svg", {
61
61
  }
62
62
  },
63
63
  setup(e) {
64
- return () => I(ke[e.name], {
65
- class: `${i}-icon`
64
+ return () => j(ke[e.name], {
65
+ class: `${l}-icon`
66
66
  });
67
67
  }
68
- }), j = /* @__PURE__ */ k({
69
- name: `${i}-icon`,
68
+ }), P = /* @__PURE__ */ k({
69
+ name: `${l}-icon`,
70
70
  props: {
71
71
  name: {
72
72
  type: String,
@@ -74,10 +74,10 @@ const Se = () => t("svg", {
74
74
  }
75
75
  },
76
76
  setup(e) {
77
- const d = S("customIcon");
77
+ const u = p("customIcon");
78
78
  return () => {
79
- const a = d.value[e.name];
80
- return typeof a == "object" ? typeof a.component == "object" ? I(a.component, a.props) : t("span", {
79
+ const a = u.value[e.name];
80
+ return typeof a == "object" ? typeof a.component == "object" ? j(a.component, a.props) : t("span", {
81
81
  innerHTML: a.component
82
82
  }, null) : t(xe, {
83
83
  name: e.name
@@ -129,15 +129,15 @@ const Se = () => t("svg", {
129
129
  type: Boolean,
130
130
  default: !0
131
131
  }
132
- }, g = /* @__PURE__ */ k({
132
+ }, S = /* @__PURE__ */ k({
133
133
  name: "MdModal",
134
134
  props: be,
135
135
  emits: ["onClose"],
136
- setup(e, d) {
137
- const a = S("theme"), $ = S("rootRef"), m = r(e.visible), u = r([`${i}-modal`]), f = r(), h = r(), v = r(), F = O();
138
- let c = () => {
136
+ setup(e, u) {
137
+ const a = p("theme"), $ = p("rootRef"), m = c(e.visible), r = c([`${l}-modal`]), f = c(), h = c(), v = c(), B = O();
138
+ let d = () => {
139
139
  };
140
- const o = E({
140
+ const n = E({
141
141
  maskStyle: {
142
142
  zIndex: -1
143
143
  },
@@ -145,114 +145,114 @@ const Se = () => t("svg", {
145
145
  zIndex: -1
146
146
  },
147
147
  initPos: {
148
- left: "0px",
149
- top: "0px"
148
+ insetInlineStart: "0px",
149
+ insetBlockStart: "0px"
150
150
  },
151
151
  historyPos: {
152
- left: "0px",
153
- top: "0px"
152
+ insetInlineStart: "0px",
153
+ insetBlockStart: "0px"
154
154
  }
155
- }), R = p(() => e.isFullscreen ? {
155
+ }), F = g(() => e.isFullscreen ? {
156
156
  width: "100%",
157
157
  height: "100%"
158
158
  } : {
159
159
  width: e.width,
160
160
  height: e.height
161
161
  });
162
- x(() => e.isFullscreen, (l) => {
163
- l ? c() : b(() => {
164
- c = z(h.value, (n, s) => {
165
- o.initPos.left = n + "px", o.initPos.top = s + "px";
162
+ x(() => e.isFullscreen, (o) => {
163
+ o ? d() : b(() => {
164
+ d = I(h.value, (i, s) => {
165
+ n.initPos.insetInlineStart = i + "px", n.initPos.insetBlockStart = s + "px";
166
166
  });
167
167
  });
168
- }), x(() => e.visible, (l) => {
169
- l ? (o.maskStyle.zIndex = C.editorConfig.zIndex + w(), o.modalStyle.zIndex = C.editorConfig.zIndex + w(), u.value.push("zoom-in"), m.value = l, b(() => {
170
- const n = f.value.offsetWidth / 2, s = f.value.offsetHeight / 2, H = document.documentElement.clientWidth / 2, A = document.documentElement.clientHeight / 2;
171
- o.initPos.left = H - n + "px", o.initPos.top = A - s + "px", e.isFullscreen || (c = z(h.value, (B, L) => {
172
- o.initPos.left = B + "px", o.initPos.top = L + "px";
168
+ }), x(() => e.visible, (o) => {
169
+ o ? (n.maskStyle.zIndex = C.editorConfig.zIndex + w(), n.modalStyle.zIndex = C.editorConfig.zIndex + w(), r.value.push("zoom-in"), m.value = o, b(() => {
170
+ const i = f.value.offsetWidth / 2, s = f.value.offsetHeight / 2, T = document.documentElement.clientWidth / 2, H = document.documentElement.clientHeight / 2;
171
+ n.initPos.insetInlineStart = T - i + "px", n.initPos.insetBlockStart = H - s + "px", e.isFullscreen || (d = I(h.value, (A, L) => {
172
+ n.initPos.insetInlineStart = A + "px", n.initPos.insetBlockStart = L + "px";
173
173
  }));
174
174
  }), setTimeout(() => {
175
- u.value = u.value.filter((n) => n !== "zoom-in");
176
- }, 140)) : (u.value.push("zoom-out"), c(), setTimeout(() => {
177
- u.value = u.value.filter((n) => n !== "zoom-out"), m.value = l;
175
+ r.value = r.value.filter((i) => i !== "zoom-in");
176
+ }, 140)) : (r.value.push("zoom-out"), d(), setTimeout(() => {
177
+ r.value = r.value.filter((i) => i !== "zoom-out"), m.value = o;
178
178
  }, 130));
179
179
  });
180
- const y = p(() => ({
180
+ const y = g(() => ({
181
181
  display: m.value ? "block" : "none"
182
- })), T = p(() => {
182
+ })), R = g(() => {
183
183
  if (typeof e.style == "string") {
184
- const l = Object.entries(y.value).map(([n, s]) => `${n}: ${s}`).join("; ");
185
- return [e.style, l].join("; ");
184
+ const o = Object.entries(y.value).map(([i, s]) => `${i}: ${s}`).join("; ");
185
+ return [e.style, o].join("; ");
186
186
  } else return e.style instanceof Object ? {
187
187
  ...y.value,
188
188
  ...e.style
189
189
  } : y.value;
190
190
  });
191
191
  return W(() => {
192
- const l = $.value?.getRootNode();
193
- v.value = l instanceof Document ? document.body : l;
192
+ const o = $.value?.getRootNode();
193
+ v.value = o instanceof Document ? document.body : o;
194
194
  }), () => {
195
- const l = M({
196
- ctx: d
197
- }), n = M({
195
+ const o = z({
196
+ ctx: u
197
+ }), i = z({
198
198
  props: e,
199
- ctx: d
199
+ ctx: u
200
200
  }, "title");
201
201
  return v.value ? t(q, {
202
202
  to: v.value
203
203
  }, {
204
204
  default: () => [t("div", {
205
- ref: F,
206
- class: `${i}-modal-container`,
205
+ ref: B,
206
+ class: `${l}-modal-container`,
207
207
  "data-theme": a.value
208
208
  }, [t("div", {
209
209
  class: e.class,
210
- style: T.value
210
+ style: R.value
211
211
  }, [e.showMask && t("div", {
212
- class: `${i}-modal-mask`,
213
- style: o.maskStyle,
212
+ class: `${l}-modal-mask`,
213
+ style: n.maskStyle,
214
214
  onClick: () => {
215
- e.onClose?.(), d.emit("onClose");
215
+ e.onClose?.(), u.emit("onClose");
216
216
  }
217
217
  }, null), t("div", {
218
- class: u.value,
218
+ class: r.value,
219
219
  style: {
220
- ...o.modalStyle,
221
- ...o.initPos,
222
- ...R.value
220
+ ...n.modalStyle,
221
+ ...n.initPos,
222
+ ...F.value
223
223
  },
224
224
  ref: f
225
225
  }, [t("div", {
226
- class: `${i}-modal-header`,
226
+ class: `${l}-modal-header`,
227
227
  ref: h
228
- }, [n || ""]), t("div", {
229
- class: `${i}-modal-body`
230
- }, [l]), t("div", {
231
- class: `${i}-modal-func`
228
+ }, [i || ""]), t("div", {
229
+ class: `${l}-modal-body`
230
+ }, [o]), t("div", {
231
+ class: `${l}-modal-func`
232
232
  }, [e.showAdjust && t("div", {
233
- class: `${i}-modal-adjust`,
233
+ class: `${l}-modal-adjust`,
234
234
  onClick: (s) => {
235
- s.stopPropagation(), e.isFullscreen ? o.initPos = o.historyPos : (o.historyPos = o.initPos, o.initPos = {
236
- left: "0",
237
- top: "0"
235
+ s.stopPropagation(), e.isFullscreen ? n.initPos = n.historyPos : (n.historyPos = n.initPos, n.initPos = {
236
+ insetInlineStart: "0",
237
+ insetBlockStart: "0"
238
238
  }), e.onAdjust(!e.isFullscreen);
239
239
  }
240
- }, [t(j, {
240
+ }, [t(P, {
241
241
  name: e.isFullscreen ? "minimize" : "maximize"
242
242
  }, null)]), t("div", {
243
- class: `${i}-modal-close`,
243
+ class: `${l}-modal-close`,
244
244
  onClick: (s) => {
245
- s.stopPropagation(), e.onClose?.(), d.emit("onClose");
245
+ s.stopPropagation(), e.onClose?.(), u.emit("onClose");
246
246
  }
247
- }, [t(j, {
247
+ }, [t(P, {
248
248
  name: "close"
249
249
  }, null)])])])])])]
250
250
  }) : "";
251
251
  };
252
252
  }
253
253
  });
254
- g.install = (e) => (e.component(g.name, g), e);
254
+ S.install = (e) => (e.component(S.name, S), e);
255
255
  export {
256
- j as I,
257
- g as M
256
+ P as I,
257
+ S as M
258
258
  };