md-editor-v3 4.6.2 → 4.7.0-beta.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,11 +1,11 @@
1
- import { defineComponent as s, createVNode as o, Fragment as d, isVNode as c } from "vue";
2
- import { p as r } from "./chunks/config.mjs";
3
- import { g as u } from "./chunks/vue-tsx.mjs";
1
+ import { defineComponent as s, createVNode as o, Fragment as d, isVNode as r } from "vue";
2
+ import { p as c } from "./chunks/config.mjs";
3
+ import { g as a } from "./chunks/vue-tsx.mjs";
4
4
  import { M as f } from "./chunks/index.mjs";
5
5
  import "./chunks/dom.mjs";
6
6
  import "@vavt/util";
7
7
  function m(t) {
8
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !c(t);
8
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !r(t);
9
9
  }
10
10
  const g = {
11
11
  title: {
@@ -52,31 +52,40 @@ const g = {
52
52
  type: Function
53
53
  },
54
54
  /**
55
- * 没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
55
+ * ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
56
56
  */
57
57
  insert: {
58
58
  type: Function
59
+ },
60
+ language: {
61
+ type: String
62
+ },
63
+ theme: {
64
+ type: String
59
65
  }
66
+ /**
67
+ * ==结束
68
+ */
60
69
  }, i = /* @__PURE__ */ s({
61
70
  name: "ModalToolbar",
62
71
  props: g,
63
72
  emits: ["onClick", "onClose", "onAdjust"],
64
73
  setup(t, e) {
65
74
  return () => {
66
- const a = u({
75
+ const u = a({
67
76
  props: t,
68
77
  ctx: e
69
- }, "trigger"), n = u({
78
+ }, "trigger"), n = a({
70
79
  props: t,
71
80
  ctx: e
72
81
  }, "default");
73
82
  return o(d, null, [o("div", {
74
- class: `${r}-toolbar-item`,
83
+ class: `${c}-toolbar-item`,
75
84
  title: t.title,
76
85
  onClick: () => {
77
86
  t.onClick instanceof Function ? t.onClick() : e.emit("onClick");
78
87
  }
79
- }, [a]), o(f, {
88
+ }, [u]), o(f, {
80
89
  width: t.width,
81
90
  height: t.height,
82
91
  title: t.modalTitle,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as r, createVNode as l } from "vue";
2
- import { p as c } from "./chunks/config.mjs";
3
- import { g as a } from "./chunks/vue-tsx.mjs";
2
+ import { p as a } from "./chunks/config.mjs";
3
+ import { g as c } from "./chunks/vue-tsx.mjs";
4
4
  const m = {
5
5
  title: {
6
6
  type: String,
@@ -14,28 +14,37 @@ const m = {
14
14
  type: Function
15
15
  },
16
16
  /**
17
- * 没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
17
+ * ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
18
18
  */
19
19
  insert: {
20
20
  type: Function
21
+ },
22
+ language: {
23
+ type: String
24
+ },
25
+ theme: {
26
+ type: String
21
27
  }
28
+ /**
29
+ * ==结束
30
+ */
22
31
  }, e = /* @__PURE__ */ r({
23
32
  name: "NormalToolbar",
24
33
  props: m,
25
34
  emits: ["onClick"],
26
- setup(t, o) {
35
+ setup(t, n) {
27
36
  return () => {
28
- const i = a({
37
+ const o = c({
29
38
  props: t,
30
- ctx: o
39
+ ctx: n
31
40
  }, "trigger");
32
41
  return l("div", {
33
- class: `${c}-toolbar-item`,
42
+ class: `${a}-toolbar-item`,
34
43
  title: t.title,
35
- onClick: (n) => {
36
- t.onClick instanceof Function ? t.onClick(n) : o.emit("onClick", n);
44
+ onClick: (i) => {
45
+ t.onClick instanceof Function ? t.onClick(i) : n.emit("onClick", i);
37
46
  }
38
- }, [i]);
47
+ }, [o]);
39
48
  };
40
49
  }
41
50
  });
@@ -28,13 +28,13 @@ const B = {
28
28
  overlayStyle: {},
29
29
  triggerHover: !1,
30
30
  overlayHover: !1
31
- }), r = C(), n = C(), s = () => {
31
+ }), o = C(), n = C(), s = () => {
32
32
  var p;
33
33
  t.triggerHover = !0;
34
- const o = r.value, l = n.value;
35
- if (!o || !l)
34
+ const r = o.value, l = n.value;
35
+ if (!r || !l)
36
36
  return;
37
- const u = o.getBoundingClientRect(), f = o.offsetTop, b = o.offsetLeft, H = u.height, L = u.width, w = ((p = document.querySelector(e.relative)) == null ? void 0 : p.scrollLeft) || 0;
37
+ const u = r.getBoundingClientRect(), f = r.offsetTop, b = r.offsetLeft, H = u.height, L = u.width, w = ((p = document.querySelector(e.relative)) == null ? void 0 : p.scrollLeft) || 0;
38
38
  t.overlayStyle = {
39
39
  ...t.overlayStyle,
40
40
  top: f + H + "px",
@@ -43,27 +43,27 @@ const B = {
43
43
  }, m = () => {
44
44
  t.overlayHover = !0;
45
45
  };
46
- D(() => e.visible, (o) => {
47
- o ? t.overlayClass = t.overlayClass.filter((l) => l !== i) : t.overlayClass.push(i);
46
+ D(() => e.visible, (r) => {
47
+ r ? t.overlayClass = t.overlayClass.filter((l) => l !== i) : t.overlayClass.push(i);
48
48
  });
49
49
  let h = -1;
50
- const g = (o) => {
51
- r.value === o.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(h), h = window.setTimeout(() => {
50
+ const g = (r) => {
51
+ o.value === r.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(h), h = window.setTimeout(() => {
52
52
  !t.overlayHover && !t.triggerHover && e.onChange(!1);
53
53
  }, 10);
54
54
  };
55
55
  return T(() => {
56
- r.value.addEventListener("mouseenter", s), r.value.addEventListener("mouseleave", g), n.value.addEventListener("mouseenter", m), n.value.addEventListener("mouseleave", g);
56
+ o.value.addEventListener("mouseenter", s), o.value.addEventListener("mouseleave", g), n.value.addEventListener("mouseenter", m), n.value.addEventListener("mouseleave", g);
57
57
  }), O(() => {
58
- r.value.removeEventListener("mouseenter", s), r.value.removeEventListener("mouseleave", g), n.value.removeEventListener("mouseenter", m), n.value.removeEventListener("mouseleave", g);
58
+ o.value.removeEventListener("mouseenter", s), o.value.removeEventListener("mouseleave", g), n.value.removeEventListener("mouseenter", m), n.value.removeEventListener("mouseleave", g);
59
59
  }), () => {
60
- const o = v({
60
+ const r = v({
61
61
  ctx: a
62
62
  }), l = v({
63
63
  props: e,
64
64
  ctx: a
65
- }, "overlay"), u = $(o instanceof Array ? o[0] : o, {
66
- ref: r
65
+ }, "overlay"), u = $(r instanceof Array ? r[0] : r, {
66
+ ref: o
67
67
  }), f = d("div", {
68
68
  class: [`${c}-dropdown`, t.overlayClass],
69
69
  style: t.overlayStyle,
@@ -94,11 +94,20 @@ const B = {
94
94
  type: [String, Object]
95
95
  },
96
96
  /**
97
- * 没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
97
+ * ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
98
98
  */
99
99
  insert: {
100
100
  type: Function
101
101
  },
102
+ language: {
103
+ type: String
104
+ },
105
+ theme: {
106
+ type: String
107
+ },
108
+ /**
109
+ * ==结束
110
+ */
102
111
  default: {
103
112
  type: [String, Object]
104
113
  }
@@ -112,7 +121,7 @@ const B = {
112
121
  const t = v({
113
122
  props: e,
114
123
  ctx: a
115
- }, "trigger"), r = v({
124
+ }, "trigger"), o = v({
116
125
  props: e,
117
126
  ctx: a
118
127
  }, "overlay"), n = v({
@@ -125,7 +134,7 @@ const B = {
125
134
  onChange: (s) => {
126
135
  e.onChange instanceof Function ? e.onChange(s) : a.emit("onChange", s);
127
136
  },
128
- overlay: r
137
+ overlay: o
129
138
  }, {
130
139
  default: () => [d("div", {
131
140
  class: `${c}-toolbar-item`,
@@ -579,6 +579,9 @@ const Me = (e, a) => {
579
579
  H("editorId", a), H(
580
580
  "theme",
581
581
  F(() => e.theme)
582
+ ), H(
583
+ "language",
584
+ F(() => e.language)
582
585
  ), H(
583
586
  "highlight",
584
587
  F(() => {