@mlightcad/ui-components 0.0.11 → 0.0.13

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 CHANGED
@@ -92,7 +92,7 @@ Features above can be customized by the following properties.
92
92
 
93
93
  ```javascript
94
94
  /**
95
- * Properties of MLToolbar components
95
+ * Properties of MLToolBar components
96
96
  */
97
97
  interface Props {
98
98
  /**
@@ -1,8 +1,8 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-b0c9d107]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--el-border-color);box-shadow:0 -2px 1-px #0000003d}.ml-status-bar-left[data-v-b0c9d107],.ml-status-bar-right[data-v-b0c9d107]{display:flex;align-items:center}.ml-status-bar-left[data-v-b0c9d107]>*{margin-right:10px}.ml-status-bar-right[data-v-b0c9d107]>*{margin-left:10px}.ml-vertical-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-27b5412a]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-27b5412a]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-539d98d3]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;border:1px solid;border-radius:4px}.ml-tool-palette-dialog-icon[data-v-539d98d3]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-539d98d3]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-539d98d3]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center;border:1px}.ml-tool-palette-title[data-v-539d98d3]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-539d98d3]{pointer-events:none;-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;align-items:center;background-color:#fff;overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-539d98d3]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-539d98d3],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-539d98d3]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-539d98d3]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { ElIcon as Y, ElDropdownItem as oe, ElDropdownMenu as ie, ElDropdown as se, ElButton as ue, ElTooltip as ae, ElButtonGroup as ce } from "element-plus/es";
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-ac7280f8]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;background-color:var(--el-fill-color);border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-ac7280f8],.ml-status-bar-right[data-v-ac7280f8]{display:flex;align-items:center}.ml-status-bar-left[data-v-ac7280f8]>*{margin-right:10px}.ml-status-bar-right[data-v-ac7280f8]>*{margin-left:10px}.ml-vertical-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-d5511111]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-d5511111]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-c27d14f6]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid}.ml-tool-palette-dialog-icon[data-v-c27d14f6]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-c27d14f6]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-c27d14f6]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center}.ml-tool-palette-title[data-v-c27d14f6]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-c27d14f6]{pointer-events:none;-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-c27d14f6]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-c27d14f6],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-c27d14f6]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-c27d14f6]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { ElIcon as A, ElDropdownItem as se, ElDropdownMenu as ie, ElDropdown as ue, ElButton as ae, ElTooltip as ce, ElButtonGroup as re } from "element-plus/es";
3
3
  import "element-plus/es/components/base/style/css";
4
4
  import "element-plus/es/components/icon/style/css";
5
- import { openBlock as y, createElementBlock as I, createElementVNode as z, defineComponent as S, mergeModels as V, useModel as J, computed as L, createBlock as W, withCtx as T, resolveDynamicComponent as re, createVNode as H, Fragment as K, renderList as Q, createTextVNode as ve, toDisplayString as N, pushScopeId as Z, popScopeId as P, renderSlot as O, normalizeClass as R, normalizeStyle as ee, createCommentVNode as te, ref as m, onMounted as D, onUnmounted as U, watch as _, onBeforeUnmount as ne, unref as F } from "vue";
5
+ import { openBlock as y, createElementBlock as I, createElementVNode as b, defineComponent as V, mergeModels as Y, useModel as K, computed as g, createBlock as W, withCtx as k, resolveDynamicComponent as Q, createVNode as S, Fragment as Z, renderList as P, createTextVNode as ve, toDisplayString as U, pushScopeId as R, popScopeId as ee, renderSlot as O, normalizeClass as te, normalizeStyle as X, createCommentVNode as ne, ref as m, onMounted as D, onUnmounted as F, watch as L, onBeforeUnmount as le, unref as G } from "vue";
6
6
  import "element-plus/es/components/dropdown/style/css";
7
7
  import "element-plus/es/components/dropdown-menu/style/css";
8
8
  import "element-plus/es/components/dropdown-item/style/css";
@@ -14,68 +14,68 @@ const de = {
14
14
  width: "1em",
15
15
  height: "1em",
16
16
  viewBox: "0 0 1024 1024"
17
- }, me = /* @__PURE__ */ z("path", {
17
+ }, me = /* @__PURE__ */ b("path", {
18
18
  fill: "currentColor",
19
19
  d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"
20
20
  }, null, -1), he = [
21
21
  me
22
22
  ];
23
- function fe(e, i) {
23
+ function fe(e, s) {
24
24
  return y(), I("svg", de, [...he]);
25
25
  }
26
- const G = { render: fe }, pe = {
26
+ const j = { render: fe }, pe = {
27
27
  xmlns: "http://www.w3.org/2000/svg",
28
28
  width: "1em",
29
29
  height: "1em",
30
30
  viewBox: "0 0 1024 1024"
31
- }, we = /* @__PURE__ */ z("path", {
31
+ }, we = /* @__PURE__ */ b("path", {
32
32
  fill: "currentColor",
33
33
  d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
34
34
  }, null, -1), _e = [
35
35
  we
36
36
  ];
37
- function ge(e, i) {
37
+ function ge(e, s) {
38
38
  return y(), I("svg", pe, [..._e]);
39
39
  }
40
- const j = { render: ge }, Le = /* @__PURE__ */ S({
40
+ const q = { render: ge }, Le = /* @__PURE__ */ V({
41
41
  __name: "MlCollapse",
42
- props: /* @__PURE__ */ V({
42
+ props: /* @__PURE__ */ Y({
43
43
  size: { default: 18 },
44
44
  reverse: { type: Boolean, default: !1 }
45
45
  }, {
46
46
  modelValue: { default: !0 },
47
47
  modelModifiers: {}
48
48
  }),
49
- emits: /* @__PURE__ */ V(["change"], ["update:modelValue"]),
50
- setup(e, { emit: i }) {
51
- const t = e, o = J(e, "modelValue"), l = i, n = L(() => t.reverse ? o.value ? G : j : o.value ? j : G), u = L(() => `${t.size}px`), d = () => {
49
+ emits: /* @__PURE__ */ Y(["change"], ["update:modelValue"]),
50
+ setup(e, { emit: s }) {
51
+ const t = e, o = K(e, "modelValue"), l = s, n = g(() => t.reverse ? o.value ? j : q : o.value ? q : j), u = g(() => `${t.size}px`), d = () => {
52
52
  l("change", o.value), o.value = !o.value;
53
53
  };
54
- return (s, a) => {
55
- const v = Y;
56
- return y(), W(v, {
54
+ return (i, a) => {
55
+ const r = A;
56
+ return y(), W(r, {
57
57
  size: u.value,
58
58
  onClick: d
59
59
  }, {
60
- default: T(() => [
61
- (y(), W(re(n.value)))
60
+ default: k(() => [
61
+ (y(), W(Q(n.value)))
62
62
  ]),
63
63
  _: 1
64
64
  }, 8, ["size"]);
65
65
  };
66
66
  }
67
- }), xe = (e) => (Z("data-v-3fc33b5d"), e = e(), P(), e), Me = /* @__PURE__ */ xe(() => /* @__PURE__ */ z("svg", {
67
+ }), xe = (e) => (R("data-v-3fc33b5d"), e = e(), ee(), e), ye = /* @__PURE__ */ xe(() => /* @__PURE__ */ b("svg", {
68
68
  preserveAspectRatio: "xMidYMid meet",
69
69
  viewBox: "0 0 24 24",
70
70
  width: "1.2em",
71
71
  height: "1.2em",
72
72
  "data-v-63d067da": ""
73
73
  }, [
74
- /* @__PURE__ */ z("path", {
74
+ /* @__PURE__ */ b("path", {
75
75
  fill: "currentColor",
76
76
  d: "m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"
77
77
  })
78
- ], -1)), ye = /* @__PURE__ */ S({
78
+ ], -1)), Me = /* @__PURE__ */ V({
79
79
  __name: "MlDropdown",
80
80
  props: {
81
81
  icon: {},
@@ -85,22 +85,22 @@ const j = { render: ge }, Le = /* @__PURE__ */ S({
85
85
  emits: {
86
86
  click: null
87
87
  },
88
- setup(e, { emit: i }) {
89
- const t = e, o = i, l = L(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
88
+ setup(e, { emit: s }) {
89
+ const t = e, o = s, l = g(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
90
90
  o("click", u);
91
91
  };
92
92
  return (u, d) => {
93
- const s = Y, a = oe, v = ie, g = se;
94
- return y(), W(g, { onCommand: n }, {
95
- dropdown: T(() => [
96
- H(v, null, {
97
- default: T(() => [
98
- (y(!0), I(K, null, Q(l.value, (c) => (y(), W(a, {
93
+ const i = A, a = se, r = ie, w = ue;
94
+ return y(), W(w, { onCommand: n }, {
95
+ dropdown: k(() => [
96
+ S(r, null, {
97
+ default: k(() => [
98
+ (y(!0), I(Z, null, P(l.value, (c) => (y(), W(a, {
99
99
  key: c.text,
100
100
  command: c.name
101
101
  }, {
102
- default: T(() => [
103
- ve(N(c.text), 1)
102
+ default: k(() => [
103
+ ve(U(c.text), 1)
104
104
  ]),
105
105
  _: 2
106
106
  }, 1032, ["command"]))), 128))
@@ -108,13 +108,13 @@ const j = { render: ge }, Le = /* @__PURE__ */ S({
108
108
  _: 1
109
109
  })
110
110
  ]),
111
- default: T(() => [
112
- H(s, {
111
+ default: k(() => [
112
+ S(i, {
113
113
  size: "30",
114
114
  class: "ml-dropdown-icon"
115
115
  }, {
116
- default: T(() => [
117
- Me
116
+ default: k(() => [
117
+ ye
118
118
  ]),
119
119
  _: 1
120
120
  })
@@ -123,12 +123,12 @@ const j = { render: ge }, Le = /* @__PURE__ */ S({
123
123
  });
124
124
  };
125
125
  }
126
- }), A = (e, i) => {
126
+ }), H = (e, s) => {
127
127
  const t = e.__vccOpts || e;
128
- for (const [o, l] of i)
128
+ for (const [o, l] of s)
129
129
  t[o] = l;
130
130
  return t;
131
- }, X = /* @__PURE__ */ A(ye, [["__scopeId", "data-v-3fc33b5d"]]), Ee = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', be = /* @__PURE__ */ S({
131
+ }, N = /* @__PURE__ */ H(Me, [["__scopeId", "data-v-3fc33b5d"]]), Ee = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', ze = /* @__PURE__ */ V({
132
132
  __name: "MlLanguage",
133
133
  props: {
134
134
  languages: {},
@@ -137,33 +137,33 @@ const j = { render: ge }, Le = /* @__PURE__ */ S({
137
137
  emits: {
138
138
  click: null
139
139
  },
140
- setup(e, { emit: i }) {
141
- const t = e, o = i, l = (n) => {
140
+ setup(e, { emit: s }) {
141
+ const t = e, o = s, l = (n) => {
142
142
  o("click", n);
143
143
  };
144
- return (n, u) => (y(), W(X, {
144
+ return (n, u) => (y(), W(N, {
145
145
  icon: Ee,
146
146
  items: t.languages,
147
147
  current: t.current,
148
148
  onClick: l
149
149
  }, null, 8, ["items", "current"]));
150
150
  }
151
- }), ze = {}, Ce = { class: "ml-status-bar" }, Be = { class: "ml-status-bar-left" }, Te = { class: "ml-status-bar-right" };
152
- function ke(e, i) {
151
+ }), be = {}, Ce = { class: "ml-status-bar" }, Be = { class: "ml-status-bar-left" }, ke = { class: "ml-status-bar-right" };
152
+ function $e(e, s) {
153
153
  return y(), I("div", Ce, [
154
- z("div", Be, [
154
+ b("div", Be, [
155
155
  O(e.$slots, "left", {}, void 0, !0)
156
156
  ]),
157
- z("div", Te, [
157
+ b("div", ke, [
158
158
  O(e.$slots, "right", {}, void 0, !0)
159
159
  ])
160
160
  ]);
161
161
  }
162
- const $e = /* @__PURE__ */ A(ze, [["render", ke], ["__scopeId", "data-v-b0c9d107"]]), We = {
162
+ const Te = /* @__PURE__ */ H(be, [["render", $e], ["__scopeId", "data-v-ac7280f8"]]), We = {
163
163
  key: 0,
164
164
  class: "ml-toolbar-button-text"
165
- }, Ie = /* @__PURE__ */ S({
166
- __name: "MlToolbar",
165
+ }, Ie = /* @__PURE__ */ V({
166
+ __name: "MlToolBar",
167
167
  props: {
168
168
  items: {},
169
169
  size: { default: "large" },
@@ -172,8 +172,8 @@ const $e = /* @__PURE__ */ A(ze, [["render", ke], ["__scopeId", "data-v-b0c9d107
172
172
  emits: {
173
173
  click: null
174
174
  },
175
- setup(e, { emit: i }) {
176
- const t = e, o = i, l = L(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = L(() => t.size === "small" ? 20 : 30), u = L(() => {
175
+ setup(e, { emit: s }) {
176
+ const t = e, o = s, l = g(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = g(() => t.size === "small" ? 20 : 30), u = g(() => {
177
177
  switch (t.size) {
178
178
  case "small":
179
179
  return 30;
@@ -181,34 +181,36 @@ const $e = /* @__PURE__ */ A(ze, [["render", ke], ["__scopeId", "data-v-b0c9d107
181
181
  return 50;
182
182
  }
183
183
  return 70;
184
- }), d = (v) => v.description ? v.description : v.text, s = L(() => t.size === "large"), a = (v) => {
185
- o("click", v);
184
+ }), d = (r) => r.description ? r.description : r.text, i = g(() => t.size === "large"), a = (r) => {
185
+ o("click", r);
186
186
  };
187
- return (v, g) => {
188
- const c = Y, h = ue, r = ae, p = ce;
189
- return y(), W(p, {
190
- class: R(l.value)
187
+ return (r, w) => {
188
+ const c = A, h = ae, v = ce, f = re;
189
+ return y(), W(f, {
190
+ class: te(l.value)
191
191
  }, {
192
- default: T(() => [
193
- (y(!0), I(K, null, Q(v.items, (x, C) => (y(), W(r, {
192
+ default: k(() => [
193
+ (y(!0), I(Z, null, P(r.items, (x, C) => (y(), W(v, {
194
194
  key: x.text,
195
195
  content: d(x),
196
196
  "hide-after": 0
197
197
  }, {
198
- default: T(() => [
198
+ default: k(() => [
199
199
  (y(), W(h, {
200
200
  class: "ml-toolbar-button",
201
- style: ee({ width: u.value + "px", height: u.value + "px" }),
201
+ style: X({ width: u.value + "px", height: u.value + "px" }),
202
202
  key: C,
203
- onClick: (k) => a(x.command)
203
+ onClick: (B) => a(x.command)
204
204
  }, {
205
- default: T(() => [
206
- z("div", null, [
207
- H(c, {
208
- size: n.value,
209
- innerHTML: x.icon
210
- }, null, 8, ["size", "innerHTML"]),
211
- s.value ? (y(), I("div", We, N(x.text), 1)) : te("", !0)
205
+ default: k(() => [
206
+ b("div", null, [
207
+ S(c, { size: n.value }, {
208
+ default: k(() => [
209
+ (y(), W(Q(x.icon)))
210
+ ]),
211
+ _: 2
212
+ }, 1032, ["size"]),
213
+ i.value ? (y(), I("div", We, U(x.text), 1)) : ne("", !0)
212
214
  ])
213
215
  ]),
214
216
  _: 2
@@ -221,73 +223,73 @@ const $e = /* @__PURE__ */ A(ze, [["render", ke], ["__scopeId", "data-v-b0c9d107
221
223
  }, 8, ["class"]);
222
224
  };
223
225
  }
224
- }), De = /* @__PURE__ */ A(Ie, [["__scopeId", "data-v-27b5412a"]]), q = 20;
225
- function He(e, i, t) {
226
- const o = m(!1), l = (s) => {
226
+ }), De = /* @__PURE__ */ H(Ie, [["__scopeId", "data-v-d5511111"]]), J = 20;
227
+ function Se(e, s, t) {
228
+ const o = m(!1), l = (i) => {
227
229
  if (t.value && e.value) {
228
- const a = e.value.getBoundingClientRect(), v = s.clientX < a.left || s.clientX > a.right || s.clientY < a.top || s.clientY > a.bottom;
229
- o.value = !v;
230
+ const a = e.value.getBoundingClientRect(), r = i.clientX < a.left || i.clientX > a.right || i.clientY < a.top || i.clientY > a.bottom;
231
+ o.value = !r;
230
232
  }
231
233
  }, n = () => {
232
234
  t.value && (o.value = !0);
233
235
  }, u = () => {
234
- i.value && i.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
236
+ s.value && s.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
235
237
  }, d = () => {
236
- i.value && i.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
238
+ s.value && s.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
237
239
  };
238
240
  return D(() => {
239
241
  window.addEventListener("mousemove", l);
240
- }), U(() => {
242
+ }), F(() => {
241
243
  window.removeEventListener("mousemove", l);
242
- }), _(t, (s) => {
243
- s && (o.value = !1);
244
- }), _(e, (s) => {
245
- s ? u() : d();
244
+ }), L(t, (i) => {
245
+ i && (o.value = !1);
246
+ }), L(e, (i) => {
247
+ i ? u() : d();
246
248
  }), { autoOpened: o };
247
249
  }
248
- function Se(e, i, t) {
249
- const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d = L(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
250
+ function Ve(e, s, t) {
251
+ const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d = g(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
250
252
  x: l.value.x - n.value.x,
251
253
  y: l.value.y - n.value.y
252
- }), s = () => {
254
+ }), i = () => {
253
255
  if (e.value) {
254
- const r = e.value.getBoundingClientRect();
256
+ const v = e.value.getBoundingClientRect();
255
257
  n.value = {
256
- x: r.left,
257
- y: r.top
258
+ x: v.left,
259
+ y: v.top
258
260
  }, l.value = {
259
- x: r.left,
260
- y: r.top
261
+ x: v.left,
262
+ y: v.top
261
263
  };
262
264
  }
263
265
  }, a = () => {
264
- e.value && e.value.addEventListener("mousedown", g);
265
- }, v = () => {
266
- e.value && e.value.removeEventListener("mousedown", g);
267
- }, g = (r) => {
266
+ e.value && e.value.addEventListener("mousedown", w);
267
+ }, r = () => {
268
+ e.value && e.value.removeEventListener("mousedown", w);
269
+ }, w = (v) => {
268
270
  if (e.value != null) {
269
- if (i && i.value) {
270
- const p = i.value.getBoundingClientRect();
271
- if (r.clientX < p.left || r.clientX > p.right || r.clientY < p.top || r.clientY > p.bottom) return;
271
+ if (s && s.value) {
272
+ const f = s.value.getBoundingClientRect();
273
+ if (v.clientX < f.left || v.clientX > f.right || v.clientY < f.top || v.clientY > f.bottom) return;
272
274
  }
273
- o.value = !0, u.x = r.clientX, u.y = r.clientY, s(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", h);
275
+ o.value = !0, u.x = v.clientX, u.y = v.clientY, i(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", h);
274
276
  }
275
- }, c = (r) => {
277
+ }, c = (v) => {
276
278
  if (o.value && n.value && l.value) {
277
- const p = window.innerWidth, x = window.innerHeight, C = e.value, k = C.getBoundingClientRect(), b = k.width, f = k.height, $ = n.value.x + (r.clientX - u.x), E = n.value.y + (r.clientY - u.y);
279
+ const f = window.innerWidth, x = window.innerHeight, C = e.value, B = C.getBoundingClientRect(), z = B.width, p = B.height, T = n.value.x + (v.clientX - u.x), E = n.value.y + (v.clientY - u.y);
278
280
  l.value.x = Math.max(
279
281
  t ? t.value.offset.value.left : 0,
280
- $
282
+ T
281
283
  );
282
- const w = p - b;
284
+ const _ = f - z;
283
285
  l.value.x = Math.min(
284
- t ? w - t.value.offset.value.right : w,
286
+ t ? _ - t.value.offset.value.right : _,
285
287
  l.value.x
286
288
  ), l.value.y = Math.max(
287
289
  t ? t.value.offset.value.top : 0,
288
- Math.min(E, x - f)
290
+ Math.min(E, x - p)
289
291
  );
290
- const M = x - f;
292
+ const M = x - p - 1;
291
293
  l.value.y = Math.min(
292
294
  t ? M - t.value.offset.value.bottom : M,
293
295
  l.value.y
@@ -297,27 +299,27 @@ function Se(e, i, t) {
297
299
  o.value = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", h);
298
300
  };
299
301
  return D(() => {
300
- e.value && (s(), a());
301
- }), U(() => {
302
- e.value && e.value.removeEventListener("mousedown", g);
303
- }), _(e, (r) => {
304
- r ? (s(), a()) : v();
302
+ e.value && (i(), a());
303
+ }), F(() => {
304
+ e.value && e.value.removeEventListener("mousedown", w);
305
+ }), L(e, (v) => {
306
+ v ? (i(), a()) : r();
305
307
  }), {
306
308
  isDragging: o,
307
309
  movement: d,
308
310
  position: l
309
311
  };
310
312
  }
311
- function Ve(e, i, t) {
312
- const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = Se(
313
+ function Ye(e, s, t) {
314
+ const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = Ve(
313
315
  e,
314
- i,
316
+ s,
315
317
  t
316
318
  );
317
- return _(u, (s) => {
318
- if (s && e.value) {
319
- const v = e.value.getBoundingClientRect();
320
- v.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - v.left - v.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
319
+ return L(u, (i) => {
320
+ if (i && e.value) {
321
+ const r = e.value.getBoundingClientRect();
322
+ r.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - r.left - r.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
321
323
  }
322
324
  }), {
323
325
  docked: o,
@@ -327,15 +329,15 @@ function Ve(e, i, t) {
327
329
  position: d
328
330
  };
329
331
  }
330
- function Ye(e, i, t, o) {
332
+ function Ae(e, s, t, o) {
331
333
  const l = m(null), n = m(null), u = m(null), d = m(null);
332
- return _(e, (s, a) => {
334
+ return L(e, (i, a) => {
333
335
  l.value = a;
334
- }), _(i, (s, a) => {
336
+ }), L(s, (i, a) => {
335
337
  n.value = a;
336
- }), _(t, (s, a) => {
338
+ }), L(t, (i, a) => {
337
339
  u.value = a;
338
- }), _(o, (s, a) => {
340
+ }), L(o, (i, a) => {
339
341
  d.value = a;
340
342
  }), {
341
343
  lastLeft: l,
@@ -344,79 +346,79 @@ function Ye(e, i, t, o) {
344
346
  lastHeight: d
345
347
  };
346
348
  }
347
- function Ae(e, i, t, o) {
348
- const l = m(e.value.width), n = m(e.value.left), u = L(() => e.value.width), d = L(() => e.value.left), s = L(() => t.value ? t.value.x : null);
349
- return _([u, d], ([a, v]) => {
350
- (l.value == null || n.value == null || i.value) && (l.value = a, n.value = v);
351
- }), _(s, (a) => {
349
+ function He(e, s, t, o) {
350
+ const l = m(e.value.width), n = m(e.value.left), u = g(() => e.value.width), d = g(() => e.value.left), i = g(() => t.value ? t.value.x : null);
351
+ return L([u, d], ([a, r]) => {
352
+ (l.value == null || n.value == null || s.value) && (l.value = a, n.value = r);
353
+ }), L(i, (a) => {
352
354
  o.value && t.value && (n.value = a);
353
355
  }), { left: n, width: l };
354
356
  }
355
- function Oe(e, i = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
357
+ function Oe(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
356
358
  const t = m({});
357
359
  let o = !1;
358
360
  const l = () => {
359
361
  if (!o && e.value) {
360
362
  const n = e.value.getBoundingClientRect();
361
- t.value.left = Math.max(n.left, i.value.left), t.value.top = Math.max(n.top, i.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
363
+ t.value.left = Math.max(n.left, s.value.left), t.value.top = Math.max(n.top, s.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
362
364
  }
363
365
  };
364
366
  return D(() => {
365
367
  e.value && l();
366
- }), _(e, (n) => {
368
+ }), L(e, (n) => {
367
369
  n && l();
368
370
  }), {
369
371
  isIntialized: o,
370
372
  initialRect: t
371
373
  };
372
374
  }
373
- function Xe(e, i = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
375
+ function Xe(e, s = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
374
376
  const { initialRect: n } = Oe(e, o), u = m(!1);
375
- let d = 0, s = 0, a = 0, v = 0, g = 0;
376
- const c = 5, h = m(null), r = (b) => {
377
- if (!(!e.value || i.value))
377
+ let d = 0, i = 0, a = 0, r = 0, w = 0;
378
+ const c = 5, h = m(null), v = (z) => {
379
+ if (!(!e.value || s.value))
378
380
  if (u.value) {
379
- const f = b.clientX - v, $ = b.clientY - g;
381
+ const p = z.clientX - r, T = z.clientY - w;
380
382
  if (h.value === "left" || h.value === "left-bottom-corner") {
381
- const E = s - f;
382
- E > l.width && (n.value.width = E, n.value.left = d + f, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
383
+ const E = i - p;
384
+ E > l.width && (n.value.width = E, n.value.left = d + p, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
383
385
  }
384
386
  if (h.value === "right" || h.value === "right-bottom-corner") {
385
- const E = s + f;
387
+ const E = i + p;
386
388
  E > l.width && (n.value.width = E, e.value.style.width = n.value.width + "px");
387
389
  }
388
390
  if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
389
- const E = a + $;
391
+ const E = a + T;
390
392
  E > l.height && (n.value.height = E, e.value.style.height = n.value.height + "px");
391
393
  }
392
394
  } else {
393
- const f = e.value.getBoundingClientRect(), $ = b.clientX - f.left, E = b.clientY - f.top, w = $ <= c, M = $ >= f.width - c, B = E >= f.height - c;
394
- w && B && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : M && B && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : w && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : M && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : B ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
395
+ const p = e.value.getBoundingClientRect(), T = z.clientX - p.left, E = z.clientY - p.top, _ = T <= c, M = T >= p.width - c, $ = E >= p.height - c;
396
+ _ && $ && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : M && $ && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : _ && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : M && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : $ ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
395
397
  }
396
- }, p = (b) => {
398
+ }, f = (z) => {
397
399
  if (!e.value || !h.value) return;
398
- const f = e.value.getBoundingClientRect();
399
- v = b.clientX, g = b.clientY, s = f.width, a = f.height, d = f.left, n.value.width = s, n.value.height = a, n.value.left = f.left, n.value.top = f.top, u.value = !0, document.addEventListener("mousemove", r), document.addEventListener("mouseup", x);
400
+ const p = e.value.getBoundingClientRect();
401
+ r = z.clientX, w = z.clientY, i = p.width, a = p.height, d = p.left, n.value.width = i, n.value.height = a, n.value.left = p.left, n.value.top = p.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", x);
400
402
  }, x = () => {
401
- u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", x);
403
+ u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", x);
402
404
  }, C = () => {
403
- e.value && (e.value.removeEventListener("mousedown", p), e.value.removeEventListener("mousemove", r)), document.removeEventListener("mouseup", x);
404
- }, k = () => {
405
- e.value && (e.value.addEventListener("mousedown", p), e.value.addEventListener("mousemove", r));
405
+ e.value && (e.value.removeEventListener("mousedown", f), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", x);
406
+ }, B = () => {
407
+ e.value && (e.value.addEventListener("mousedown", f), e.value.addEventListener("mousemove", v));
406
408
  };
407
409
  return D(() => {
408
- e.value && k();
409
- }), ne(() => {
410
+ e.value && B();
411
+ }), le(() => {
410
412
  C();
411
- }), _(e, (b) => {
412
- b ? k() : C();
413
+ }), L(e, (z) => {
414
+ z ? B() : C();
413
415
  }), { rect: n, isResizing: u };
414
416
  }
415
- function Ne(e, i, t, o) {
417
+ function Ne(e, s, t, o) {
416
418
  const l = () => {
417
419
  if (e.value) {
418
- const s = e.value;
419
- i.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
420
+ const i = e.value;
421
+ s.value ? i.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : i.style.transition = "width 0.3s ease";
420
422
  }
421
423
  }, n = () => {
422
424
  e.value && (e.value.style.transition = "");
@@ -427,88 +429,88 @@ function Ne(e, i, t, o) {
427
429
  };
428
430
  D(() => {
429
431
  e.value && e.value.addEventListener("transitionend", n);
430
- }), ne(() => {
432
+ }), le(() => {
431
433
  e.value && e.value.removeEventListener("transitionend", n);
432
- }), _(e, (s) => {
433
- s ? d() : u();
434
- }), _(t, () => {
434
+ }), L(e, (i) => {
435
+ i ? d() : u();
436
+ }), L(t, () => {
435
437
  l();
436
- }), _(o, () => {
438
+ }), L(o, () => {
437
439
  l();
438
440
  });
439
441
  }
440
- function Ue(e, i, t, o) {
441
- const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: s, position: a, isDragging: v } = Ve(
442
+ function Ue(e, s, t, o) {
443
+ const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: i, position: a, isDragging: r } = Ye(
442
444
  e,
443
- i,
445
+ s,
444
446
  o
445
- ), g = L(() => d.value === "right"), { rect: c, isResizing: h } = Xe(
447
+ ), w = g(() => d.value === "right"), { rect: c, isResizing: h } = Xe(
446
448
  e,
447
449
  t,
448
- g,
450
+ w,
449
451
  o.value.offset
450
- ), { width: r, left: p } = Ae(
452
+ ), { width: v, left: f } = He(
451
453
  c,
452
454
  h,
453
455
  a,
454
- v
455
- ), { lastTop: x, lastHeight: C } = Ye(
456
- L(() => c.value.left),
457
- L(() => c.value.top),
458
- L(() => c.value.width),
459
- L(() => c.value.height)
460
- ), { autoOpened: k } = He(e, i, t);
461
- Ne(e, g, t, k);
462
- const b = (w) => {
456
+ r
457
+ ), { lastTop: x, lastHeight: C } = Ae(
458
+ g(() => c.value.left),
459
+ g(() => c.value.top),
460
+ g(() => c.value.width),
461
+ g(() => c.value.height)
462
+ ), { autoOpened: B } = Se(e, s, t);
463
+ Ne(e, w, t, B);
464
+ const z = (_) => {
463
465
  if (e.value) {
464
- const M = e.value.getBoundingClientRect(), B = M.left + w;
465
- if (g.value) {
466
- c.value.left = B;
467
- const le = window.innerWidth - M.width - M.left;
468
- M.left <= 0 && le >= 0 && w < 0 && (c.value.left = Math.max(0, B)), window.innerWidth - M.width <= 0 && (c.value.left = window.innerWidth - M.width);
466
+ const M = e.value.getBoundingClientRect(), $ = M.left + _;
467
+ if (w.value) {
468
+ c.value.left = $;
469
+ const oe = window.innerWidth - M.width - M.left;
470
+ M.left <= 0 && oe >= 0 && _ < 0 && (c.value.left = Math.max(0, $)), window.innerWidth - M.width <= 0 && (c.value.left = window.innerWidth - M.width);
469
471
  } else
470
- M.left + M.width >= window.innerWidth && w < 0 && (c.value.left = Math.max(0, B));
472
+ M.left + M.width >= window.innerWidth && _ < 0 && (c.value.left = Math.max(0, $));
471
473
  }
472
- }, f = () => {
473
- const w = window.innerWidth - l.value;
474
- l.value = window.innerWidth, n.value = window.innerHeight, b(w);
474
+ }, p = () => {
475
+ const _ = window.innerWidth - l.value;
476
+ l.value = window.innerWidth, n.value = window.innerHeight, z(_);
475
477
  };
476
478
  D(() => {
477
- window.addEventListener("resize", f);
478
- }), U(() => {
479
- window.removeEventListener("resize", f);
479
+ window.addEventListener("resize", p);
480
+ }), F(() => {
481
+ window.removeEventListener("resize", p);
480
482
  });
481
- const $ = (w) => {
482
- w ? (c.value.width = q, g.value && p.value && r.value && (c.value.left = p.value + r.value - q)) : (c.value.width = r.value, g.value && p.value && r.value && (c.value.left = p.value));
483
+ const T = (_) => {
484
+ _ ? (c.value.width = J, w.value && f.value && v.value && (c.value.left = f.value + v.value - J)) : (c.value.width = v.value, w.value && f.value && v.value && (c.value.left = f.value));
483
485
  }, E = () => {
484
- u.value ? (c.value.top = o.value.offset.value.top, c.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (c.value.top = x.value, c.value.height = C.value);
486
+ u.value ? (c.value.top = o.value.offset.value.top, c.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom - 1) : (c.value.top = x.value, c.value.height = C.value);
485
487
  };
486
- return _(u, () => {
488
+ return L(u, () => {
487
489
  E();
488
- }), _(t, (w) => {
489
- $(w);
490
- }), _(k, (w) => {
491
- t.value && !v.value && $(!w);
492
- }), _(s, (w) => {
493
- if (w && e.value) {
494
- const B = e.value.getBoundingClientRect();
495
- c.value.left = B.left, c.value.top = B.top;
490
+ }), L(t, (_) => {
491
+ T(_);
492
+ }), L(B, (_) => {
493
+ t.value && !r.value && T(!_);
494
+ }), L(i, (_) => {
495
+ if (_ && e.value) {
496
+ const $ = e.value.getBoundingClientRect();
497
+ c.value.left = $.left, c.value.top = $.top;
496
498
  }
497
- }), { rect: c, orientation: d, reversed: g };
499
+ }), { rect: c, orientation: d, reversed: w };
498
500
  }
499
- const Fe = (e) => (Z("data-v-539d98d3"), e = e(), P(), e), Ge = /* @__PURE__ */ Fe(() => /* @__PURE__ */ z("svg", {
501
+ const Fe = (e) => (R("data-v-c27d14f6"), e = e(), ee(), e), Ge = /* @__PURE__ */ Fe(() => /* @__PURE__ */ b("svg", {
500
502
  xmlns: "http://www.w3.org/2000/svg",
501
503
  width: "1em",
502
504
  height: "1em",
503
505
  viewBox: "0 0 1024 1024"
504
506
  }, [
505
- /* @__PURE__ */ z("path", {
507
+ /* @__PURE__ */ b("path", {
506
508
  fill: "currentColor",
507
509
  d: "M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
508
510
  })
509
- ], -1)), je = { class: "ml-tool-palette-title" }, qe = { class: "ml-tool-palette-content" }, Je = /* @__PURE__ */ S({
511
+ ], -1)), je = { class: "ml-tool-palette-title" }, qe = { class: "ml-tool-palette-content" }, Je = /* @__PURE__ */ V({
510
512
  __name: "MlToolPalette",
511
- props: /* @__PURE__ */ V({
513
+ props: /* @__PURE__ */ Y({
512
514
  title: { default: "" },
513
515
  leftOffset: { default: 0 },
514
516
  rightOffset: { default: 0 },
@@ -518,9 +520,9 @@ const Fe = (e) => (Z("data-v-539d98d3"), e = e(), P(), e), Ge = /* @__PURE__ */
518
520
  modelValue: { default: !0 },
519
521
  modelModifiers: {}
520
522
  }),
521
- emits: /* @__PURE__ */ V(["close"], ["update:modelValue"]),
522
- setup(e, { emit: i }) {
523
- const t = e, o = J(e, "modelValue"), l = i, n = m(!1), u = m(null), d = m(null), s = L(() => ({
523
+ emits: /* @__PURE__ */ Y(["close"], ["update:modelValue"]),
524
+ setup(e, { emit: s }) {
525
+ const t = e, o = K(e, "modelValue"), l = s, n = m(!1), u = m(null), d = m(null), i = g(() => ({
524
526
  offset: m({
525
527
  left: t.leftOffset,
526
528
  right: t.rightOffset,
@@ -529,75 +531,82 @@ const Fe = (e) => (Z("data-v-539d98d3"), e = e(), P(), e), Ge = /* @__PURE__ */
529
531
  })
530
532
  })), {
531
533
  rect: a,
532
- orientation: v,
533
- reversed: g
534
- } = Ue(d, u, n, s), c = L(() => ({
534
+ orientation: r,
535
+ reversed: w
536
+ } = Ue(d, u, n, i), c = g(() => ({
535
537
  left: `${a.value.left}px`,
536
538
  top: `${a.value.top}px`,
537
539
  width: `${a.value.width}px`,
538
540
  height: `${a.value.height}px`
539
- })), h = () => {
541
+ })), h = g(() => w.value ? {
542
+ borderLeft: "1px solid",
543
+ borderRight: null
544
+ } : {
545
+ borderLeft: null,
546
+ borderRight: "1px solid"
547
+ }), v = () => {
540
548
  o.value = !1;
541
- const r = d.value;
549
+ const f = d.value;
542
550
  l("close", {
543
- x: r ? r.clientLeft : 0,
544
- y: r ? r.clientTop : 0
551
+ x: f ? f.clientLeft : 0,
552
+ y: f ? f.clientTop : 0
545
553
  });
546
554
  };
547
- return (r, p) => {
548
- const x = Y;
555
+ return (f, x) => {
556
+ const C = A;
549
557
  return o.value ? (y(), I("div", {
550
558
  key: 0,
551
559
  ref_key: "toolPaletteElement",
552
560
  ref: d,
553
- style: ee([c.value]),
561
+ style: X([c.value]),
554
562
  class: "ml-tool-palette-dialog"
555
563
  }, [
556
- z("div", {
557
- class: R(["ml-tool-palette-dialog-layout", F(v)])
564
+ b("div", {
565
+ class: te(["ml-tool-palette-dialog-layout", G(r)])
558
566
  }, [
559
- z("div", {
567
+ b("div", {
560
568
  ref_key: "titleBarElement",
561
569
  ref: u,
562
- class: "ml-tool-palette-title-bar"
570
+ class: "ml-tool-palette-title-bar",
571
+ style: X(h.value)
563
572
  }, [
564
- H(x, {
573
+ S(C, {
565
574
  size: 18,
566
575
  class: "ml-tool-palette-dialog-icon",
567
- onClick: h
576
+ onClick: v
568
577
  }, {
569
- default: T(() => [
578
+ default: k(() => [
570
579
  Ge
571
580
  ]),
572
581
  _: 1
573
582
  }),
574
- H(Le, {
583
+ S(Le, {
575
584
  class: "ml-tool-palette-dialog-icon",
576
585
  modelValue: n.value,
577
- "onUpdate:modelValue": p[0] || (p[0] = (C) => n.value = C),
578
- reverse: F(g)
586
+ "onUpdate:modelValue": x[0] || (x[0] = (B) => n.value = B),
587
+ reverse: G(w)
579
588
  }, null, 8, ["modelValue", "reverse"]),
580
- z("span", je, N(t.title), 1)
581
- ], 512),
582
- z("div", qe, [
583
- O(r.$slots, "default", {}, void 0, !0)
589
+ b("span", je, U(t.title), 1)
590
+ ], 4),
591
+ b("div", qe, [
592
+ O(f.$slots, "default", {}, void 0, !0)
584
593
  ])
585
594
  ], 2)
586
- ], 4)) : te("", !0);
595
+ ], 4)) : ne("", !0);
587
596
  };
588
597
  }
589
- }), Ke = /* @__PURE__ */ A(Je, [["__scopeId", "data-v-539d98d3"]]), st = {
598
+ }), Ke = /* @__PURE__ */ H(Je, [["__scopeId", "data-v-c27d14f6"]]), it = {
590
599
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
591
600
  install(e) {
592
- e.component("MlCollapse", X), e.component("MlDropdown", X), e.component("MlLanguage", be), e.component("MlStatusBar", $e), e.component("MlToolbar", De), e.component("MlToolPalette", Ke);
601
+ e.component("MlCollapse", N), e.component("MlDropdown", N), e.component("MlLanguage", ze), e.component("MlStatusBar", Te), e.component("MlToolBar", De), e.component("MlToolPalette", Ke);
593
602
  }
594
603
  };
595
604
  export {
596
605
  Le as MlCollapse,
597
- X as MlDropdown,
598
- be as MlLanguage,
599
- $e as MlStatusBar,
606
+ N as MlDropdown,
607
+ ze as MlLanguage,
608
+ Te as MlStatusBar,
609
+ De as MlToolBar,
600
610
  Ke as MlToolPalette,
601
- De as MlToolbar,
602
- st as default
611
+ it as default
603
612
  };
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-b0c9d107]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--el-border-color);box-shadow:0 -2px 1-px #0000003d}.ml-status-bar-left[data-v-b0c9d107],.ml-status-bar-right[data-v-b0c9d107]{display:flex;align-items:center}.ml-status-bar-left[data-v-b0c9d107]>*{margin-right:10px}.ml-status-bar-right[data-v-b0c9d107]>*{margin-left:10px}.ml-vertical-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-27b5412a]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-27b5412a]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-27b5412a]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-539d98d3]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;border:1px solid;border-radius:4px}.ml-tool-palette-dialog-icon[data-v-539d98d3]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-539d98d3]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-539d98d3]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center;border:1px}.ml-tool-palette-title[data-v-539d98d3]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-539d98d3]{pointer-events:none;-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;align-items:center;background-color:#fff;overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-539d98d3]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-539d98d3],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-539d98d3]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-539d98d3]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(y,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/icon/style/css"),require("vue"),require("element-plus/es/components/dropdown/style/css"),require("element-plus/es/components/dropdown-menu/style/css"),require("element-plus/es/components/dropdown-item/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/icon/style/css","vue","element-plus/es/components/dropdown/style/css","element-plus/es/components/dropdown-menu/style/css","element-plus/es/components/dropdown-item/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css"],E):(y=typeof globalThis<"u"?globalThis:y||self,E(y.UIComponents={},y.es,null,null,y.Vue))})(this,function(y,E,pe,fe,e){"use strict";const O={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},Y=[e.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"},null,-1)];function A(t,i){return e.openBlock(),e.createElementBlock("svg",O,[...Y])}const V={render:A},X={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},q=[e.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null,-1)];function U(t,i){return e.openBlock(),e.createElementBlock("svg",X,[...q])}const $={render:U},S=e.defineComponent({__name:"MlCollapse",props:e.mergeModels({size:{default:18},reverse:{type:Boolean,default:!1}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.computed(()=>n.reverse?s.value?V:$:s.value?$:V),a=e.computed(()=>`${n.size}px`),h=()=>{l("change",s.value),s.value=!s.value};return(c,r)=>{const m=E.ElIcon;return e.openBlock(),e.createBlock(m,{size:a.value,onClick:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value)))]),_:1},8,["size"])}}}),F=(t=>(e.pushScopeId("data-v-3fc33b5d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em","data-v-63d067da":""},[e.createElementVNode("path",{fill:"currentColor",d:"m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"})],-1)),j=e.defineComponent({__name:"MlDropdown",props:{icon:{},items:{},current:{default:void 0}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.items.filter(a=>a.name!==n.current)),o=a=>{s("click",a)};return(a,h)=>{const c=E.ElIcon,r=E.ElDropdownItem,m=E.ElDropdownMenu,_=E.ElDropdown;return e.openBlock(),e.createBlock(_,{onCommand:o},{dropdown:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createBlock(r,{key:u.text,command:u.name},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(c,{size:"30",class:"ml-dropdown-icon"},{default:e.withCtx(()=>[F]),_:1})]),_:1})}}}),z=(t,i)=>{const n=t.__vccOpts||t;for(const[s,l]of i)n[s]=l;return n},T=z(j,[["__scopeId","data-v-3fc33b5d"]]),G='<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>',I=e.defineComponent({__name:"MlLanguage",props:{languages:{},current:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=o=>{s("click",o)};return(o,a)=>(e.openBlock(),e.createBlock(T,{icon:G,items:n.languages,current:n.current,onClick:l},null,8,["items","current"]))}}),J={},K={class:"ml-status-bar"},Q={class:"ml-status-bar-left"},Z={class:"ml-status-bar-right"};function P(t,i){return e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const N=z(J,[["render",P],["__scopeId","data-v-b0c9d107"]]),R={key:0,class:"ml-toolbar-button-text"},W=z(e.defineComponent({__name:"MlToolbar",props:{items:{},size:{default:"large"},direction:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.direction==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),o=e.computed(()=>n.size==="small"?20:30),a=e.computed(()=>{switch(n.size){case"small":return 30;case"medium":return 50}return 70}),h=m=>m.description?m.description:m.text,c=e.computed(()=>n.size==="large"),r=m=>{s("click",m)};return(m,_)=>{const u=E.ElIcon,p=E.ElButton,d=E.ElTooltip,v=E.ElButtonGroup;return e.openBlock(),e.createBlock(v,{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.items,(g,B)=>(e.openBlock(),e.createBlock(d,{key:g.text,content:h(g),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{class:"ml-toolbar-button",style:e.normalizeStyle({width:a.value+"px",height:a.value+"px"}),key:B,onClick:C=>r(g.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(u,{size:o.value,innerHTML:g.icon},null,8,["size","innerHTML"]),c.value?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(g.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-27b5412a"]]),D=20;function ee(t,i,n){const s=e.ref(!1),l=c=>{if(n.value&&t.value){const r=t.value.getBoundingClientRect(),m=c.clientX<r.left||c.clientX>r.right||c.clientY<r.top||c.clientY>r.bottom;s.value=!m}},o=()=>{n.value&&(s.value=!0)},a=()=>{i.value&&i.value.addEventListener("mousemove",o),t.value&&t.value.addEventListener("mousemove",o)},h=()=>{i.value&&i.value.removeEventListener("mousemove",o),t.value&&t.value.removeEventListener("mousemove",o)};return e.onMounted(()=>{window.addEventListener("mousemove",l)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",l)}),e.watch(n,c=>{c&&(s.value=!1)}),e.watch(t,c=>{c?a():h()}),{autoOpened:s}}function te(t,i,n){const s=e.ref(!1),l=e.ref(null),o=e.ref(null),a={x:0,y:0},h=e.computed(()=>l.value==null||o.value==null?{x:0,y:0}:{x:l.value.x-o.value.x,y:l.value.y-o.value.y}),c=()=>{if(t.value){const d=t.value.getBoundingClientRect();o.value={x:d.left,y:d.top},l.value={x:d.left,y:d.top}}},r=()=>{t.value&&t.value.addEventListener("mousedown",_)},m=()=>{t.value&&t.value.removeEventListener("mousedown",_)},_=d=>{if(t.value!=null){if(i&&i.value){const v=i.value.getBoundingClientRect();if(d.clientX<v.left||d.clientX>v.right||d.clientY<v.top||d.clientY>v.bottom)return}s.value=!0,a.x=d.clientX,a.y=d.clientY,c(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)}},u=d=>{if(s.value&&o.value&&l.value){const v=window.innerWidth,g=window.innerHeight,B=t.value,C=B.getBoundingClientRect(),x=C.width,f=C.height,b=o.value.x+(d.clientX-a.x),M=o.value.y+(d.clientY-a.y);l.value.x=Math.max(n?n.value.offset.value.left:0,b);const w=v-x;l.value.x=Math.min(n?w-n.value.offset.value.right:w,l.value.x),l.value.y=Math.max(n?n.value.offset.value.top:0,Math.min(M,g-f));const L=g-f;l.value.y=Math.min(n?L-n.value.offset.value.bottom:L,l.value.y),B.style.left=l.value.x+"px",B.style.top=l.value.y+"px"}},p=()=>{s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return e.onMounted(()=>{t.value&&(c(),r())}),e.onUnmounted(()=>{t.value&&t.value.removeEventListener("mousedown",_)}),e.watch(t,d=>{d?(c(),r()):m()}),{isDragging:s,movement:h,position:l}}function ne(t,i,n){const s=e.ref(!1),l=e.ref("left"),{isDragging:o,movement:a,position:h}=te(t,i,n);return e.watch(a,c=>{if(c&&t.value){const m=t.value.getBoundingClientRect();m.left<=n.value.offset.value.left?(l.value="left",s.value=!0):window.innerWidth-m.left-m.width<=n.value.offset.value.right?(l.value="right",s.value=!0):s.value=!1}}),{docked:s,orientation:l,isDragging:o,movement:a,position:h}}function oe(t,i,n,s){const l=e.ref(null),o=e.ref(null),a=e.ref(null),h=e.ref(null);return e.watch(t,(c,r)=>{l.value=r}),e.watch(i,(c,r)=>{o.value=r}),e.watch(n,(c,r)=>{a.value=r}),e.watch(s,(c,r)=>{h.value=r}),{lastLeft:l,lastTop:o,lastWidth:a,lastHeight:h}}function le(t,i,n,s){const l=e.ref(t.value.width),o=e.ref(t.value.left),a=e.computed(()=>t.value.width),h=e.computed(()=>t.value.left),c=e.computed(()=>n.value?n.value.x:null);return e.watch([a,h],([r,m])=>{(l.value==null||o.value==null||i.value)&&(l.value=r,o.value=m)}),e.watch(c,r=>{s.value&&n.value&&(o.value=r)}),{left:o,width:l}}function se(t,i=e.ref({left:0,right:0,top:0,bottom:0})){const n=e.ref({});let s=!1;const l=()=>{if(!s&&t.value){const o=t.value.getBoundingClientRect();n.value.left=Math.max(o.left,i.value.left),n.value.top=Math.max(o.top,i.value.top),n.value.width=o.width,n.value.height=o.height,s=!0}};return e.onMounted(()=>{t.value&&l()}),e.watch(t,o=>{o&&l()}),{isIntialized:s,initialRect:n}}function ie(t,i=e.ref(!1),n=e.ref(!1),s=e.ref({left:0,right:0,top:0,bottom:0}),l={width:20,height:40}){const{initialRect:o}=se(t,s),a=e.ref(!1);let h=0,c=0,r=0,m=0,_=0;const u=5,p=e.ref(null),d=x=>{if(!(!t.value||i.value))if(a.value){const f=x.clientX-m,b=x.clientY-_;if(p.value==="left"||p.value==="left-bottom-corner"){const M=c-f;M>l.width&&(o.value.width=M,o.value.left=h+f,t.value.style.left=o.value.left+"px",t.value.style.width=o.value.width+"px")}if(p.value==="right"||p.value==="right-bottom-corner"){const M=c+f;M>l.width&&(o.value.width=M,t.value.style.width=o.value.width+"px")}if(p.value==="bottom"||p.value==="left-bottom-corner"||p.value==="right-bottom-corner"){const M=r+b;M>l.height&&(o.value.height=M,t.value.style.height=o.value.height+"px")}}else{const f=t.value.getBoundingClientRect(),b=x.clientX-f.left,M=x.clientY-f.top,w=b<=u,L=b>=f.width-u,k=M>=f.height-u;w&&k&&n.value?(t.value.style.cursor="nesw-resize",p.value="left-bottom-corner"):L&&k&&!n.value?(t.value.style.cursor="nwse-resize",p.value="right-bottom-corner"):w&&n.value?(t.value.style.cursor="ew-resize",p.value="left"):L&&!n.value?(t.value.style.cursor="ew-resize",p.value="right"):k?(t.value.style.cursor="ns-resize",p.value="bottom"):(t.value.style.cursor="",p.value=null)}},v=x=>{if(!t.value||!p.value)return;const f=t.value.getBoundingClientRect();m=x.clientX,_=x.clientY,c=f.width,r=f.height,h=f.left,o.value.width=c,o.value.height=r,o.value.left=f.left,o.value.top=f.top,a.value=!0,document.addEventListener("mousemove",d),document.addEventListener("mouseup",g)},g=()=>{a.value=!1,p.value=null,t.value&&(t.value.style.cursor=""),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",g)},B=()=>{t.value&&(t.value.removeEventListener("mousedown",v),t.value.removeEventListener("mousemove",d)),document.removeEventListener("mouseup",g)},C=()=>{t.value&&(t.value.addEventListener("mousedown",v),t.value.addEventListener("mousemove",d))};return e.onMounted(()=>{t.value&&C()}),e.onBeforeUnmount(()=>{B()}),e.watch(t,x=>{x?C():B()}),{rect:o,isResizing:a}}function ce(t,i,n,s){const l=()=>{if(t.value){const c=t.value;i.value?c.style.transition="width 0.3s ease-out, left 0.3s ease-out":c.style.transition="width 0.3s ease"}},o=()=>{t.value&&(t.value.style.transition="")},a=()=>{t.value&&t.value.removeEventListener("transitionend",o)},h=()=>{t.value&&t.value.addEventListener("transitionend",o)};e.onMounted(()=>{t.value&&t.value.addEventListener("transitionend",o)}),e.onBeforeUnmount(()=>{t.value&&t.value.removeEventListener("transitionend",o)}),e.watch(t,c=>{c?h():a()}),e.watch(n,()=>{l()}),e.watch(s,()=>{l()})}function ae(t,i,n,s){const l=e.ref(window.innerWidth),o=e.ref(window.innerHeight),{docked:a,orientation:h,movement:c,position:r,isDragging:m}=ne(t,i,s),_=e.computed(()=>h.value==="right"),{rect:u,isResizing:p}=ie(t,n,_,s.value.offset),{width:d,left:v}=le(u,p,r,m),{lastTop:g,lastHeight:B}=oe(e.computed(()=>u.value.left),e.computed(()=>u.value.top),e.computed(()=>u.value.width),e.computed(()=>u.value.height)),{autoOpened:C}=ee(t,i,n);ce(t,_,n,C);const x=w=>{if(t.value){const L=t.value.getBoundingClientRect(),k=L.left+w;if(_.value){u.value.left=k;const he=window.innerWidth-L.width-L.left;L.left<=0&&he>=0&&w<0&&(u.value.left=Math.max(0,k)),window.innerWidth-L.width<=0&&(u.value.left=window.innerWidth-L.width)}else L.left+L.width>=window.innerWidth&&w<0&&(u.value.left=Math.max(0,k))}},f=()=>{const w=window.innerWidth-l.value;l.value=window.innerWidth,o.value=window.innerHeight,x(w)};e.onMounted(()=>{window.addEventListener("resize",f)}),e.onUnmounted(()=>{window.removeEventListener("resize",f)});const b=w=>{w?(u.value.width=D,_.value&&v.value&&d.value&&(u.value.left=v.value+d.value-D)):(u.value.width=d.value,_.value&&v.value&&d.value&&(u.value.left=v.value))},M=()=>{a.value?(u.value.top=s.value.offset.value.top,u.value.height=window.innerHeight-s.value.offset.value.top-s.value.offset.value.bottom):(u.value.top=g.value,u.value.height=B.value)};return e.watch(a,()=>{M()}),e.watch(n,w=>{b(w)}),e.watch(C,w=>{n.value&&!m.value&&b(!w)}),e.watch(c,w=>{if(w&&t.value){const k=t.value.getBoundingClientRect();u.value.left=k.left,u.value.top=k.top}}),{rect:u,orientation:h,reversed:_}}const re=(t=>(e.pushScopeId("data-v-539d98d3"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})],-1)),ue={class:"ml-tool-palette-title"},de={class:"ml-tool-palette-content"},H=z(e.defineComponent({__name:"MlToolPalette",props:e.mergeModels({title:{default:""},leftOffset:{default:0},rightOffset:{default:0},topOffset:{default:0},bottomOffset:{default:0}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.ref(!1),a=e.ref(null),h=e.ref(null),c=e.computed(()=>({offset:e.ref({left:n.leftOffset,right:n.rightOffset,top:n.topOffset,bottom:n.bottomOffset})})),{rect:r,orientation:m,reversed:_}=ae(h,a,o,c),u=e.computed(()=>({left:`${r.value.left}px`,top:`${r.value.top}px`,width:`${r.value.width}px`,height:`${r.value.height}px`})),p=()=>{s.value=!1;const d=h.value;l("close",{x:d?d.clientLeft:0,y:d?d.clientTop:0})};return(d,v)=>{const g=E.ElIcon;return s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"toolPaletteElement",ref:h,style:e.normalizeStyle([u.value]),class:"ml-tool-palette-dialog"},[e.createElementVNode("div",{class:e.normalizeClass(["ml-tool-palette-dialog-layout",e.unref(m)])},[e.createElementVNode("div",{ref_key:"titleBarElement",ref:a,class:"ml-tool-palette-title-bar"},[e.createVNode(g,{size:18,class:"ml-tool-palette-dialog-icon",onClick:p},{default:e.withCtx(()=>[re]),_:1}),e.createVNode(S,{class:"ml-tool-palette-dialog-icon",modelValue:o.value,"onUpdate:modelValue":v[0]||(v[0]=B=>o.value=B),reverse:e.unref(_)},null,8,["modelValue","reverse"]),e.createElementVNode("span",ue,e.toDisplayString(n.title),1)],512),e.createElementVNode("div",de,[e.renderSlot(d.$slots,"default",{},void 0,!0)])],2)],4)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-539d98d3"]]),me={install(t){t.component("MlCollapse",T),t.component("MlDropdown",T),t.component("MlLanguage",I),t.component("MlStatusBar",N),t.component("MlToolbar",W),t.component("MlToolPalette",H)}};y.MlCollapse=S,y.MlDropdown=T,y.MlLanguage=I,y.MlStatusBar=N,y.MlToolPalette=H,y.MlToolbar=W,y.default=me,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-ac7280f8]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;background-color:var(--el-fill-color);border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-ac7280f8],.ml-status-bar-right[data-v-ac7280f8]{display:flex;align-items:center}.ml-status-bar-left[data-v-ac7280f8]>*{margin-right:10px}.ml-status-bar-right[data-v-ac7280f8]>*{margin-left:10px}.ml-vertical-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-d5511111]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-d5511111]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-d5511111]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-c27d14f6]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid}.ml-tool-palette-dialog-icon[data-v-c27d14f6]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-c27d14f6]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-c27d14f6]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center}.ml-tool-palette-title[data-v-c27d14f6]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-c27d14f6]{pointer-events:none;-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-c27d14f6]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-c27d14f6],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-c27d14f6]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-c27d14f6]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ (function(L,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/icon/style/css"),require("vue"),require("element-plus/es/components/dropdown/style/css"),require("element-plus/es/components/dropdown-menu/style/css"),require("element-plus/es/components/dropdown-item/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/icon/style/css","vue","element-plus/es/components/dropdown/style/css","element-plus/es/components/dropdown-menu/style/css","element-plus/es/components/dropdown-item/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css"],x):(L=typeof globalThis<"u"?globalThis:L||self,x(L.UIComponents={},L.es,null,null,L.Vue))})(this,function(L,x,pe,fe,e){"use strict";const Y={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},A=[e.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"},null,-1)];function H(t,i){return e.openBlock(),e.createElementBlock("svg",Y,[...A])}const $={render:H},X={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},q=[e.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null,-1)];function U(t,i){return e.openBlock(),e.createElementBlock("svg",X,[...q])}const T={render:U},S=e.defineComponent({__name:"MlCollapse",props:e.mergeModels({size:{default:18},reverse:{type:Boolean,default:!1}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.computed(()=>n.reverse?s.value?$:T:s.value?T:$),a=e.computed(()=>`${n.size}px`),h=()=>{l("change",s.value),s.value=!s.value};return(c,r)=>{const d=x.ElIcon;return e.openBlock(),e.createBlock(d,{size:a.value,onClick:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value)))]),_:1},8,["size"])}}}),F=(t=>(e.pushScopeId("data-v-3fc33b5d"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em","data-v-63d067da":""},[e.createElementVNode("path",{fill:"currentColor",d:"m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"})],-1)),j=e.defineComponent({__name:"MlDropdown",props:{icon:{},items:{},current:{default:void 0}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.items.filter(a=>a.name!==n.current)),o=a=>{s("click",a)};return(a,h)=>{const c=x.ElIcon,r=x.ElDropdownItem,d=x.ElDropdownMenu,w=x.ElDropdown;return e.openBlock(),e.createBlock(w,{onCommand:o},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createBlock(r,{key:u.text,command:u.name},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(c,{size:"30",class:"ml-dropdown-icon"},{default:e.withCtx(()=>[F]),_:1})]),_:1})}}}),z=(t,i)=>{const n=t.__vccOpts||t;for(const[s,l]of i)n[s]=l;return n},V=z(j,[["__scopeId","data-v-3fc33b5d"]]),G='<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>',I=e.defineComponent({__name:"MlLanguage",props:{languages:{},current:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=o=>{s("click",o)};return(o,a)=>(e.openBlock(),e.createBlock(V,{icon:G,items:n.languages,current:n.current,onClick:l},null,8,["items","current"]))}}),J={},K={class:"ml-status-bar"},Q={class:"ml-status-bar-left"},Z={class:"ml-status-bar-right"};function P(t,i){return e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",Z,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const N=z(J,[["render",P],["__scopeId","data-v-ac7280f8"]]),R={key:0,class:"ml-toolbar-button-text"},W=z(e.defineComponent({__name:"MlToolBar",props:{items:{},size:{default:"large"},direction:{}},emits:{click:null},setup(t,{emit:i}){const n=t,s=i,l=e.computed(()=>n.direction==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),o=e.computed(()=>n.size==="small"?20:30),a=e.computed(()=>{switch(n.size){case"small":return 30;case"medium":return 50}return 70}),h=d=>d.description?d.description:d.text,c=e.computed(()=>n.size==="large"),r=d=>{s("click",d)};return(d,w)=>{const u=x.ElIcon,p=x.ElButton,m=x.ElTooltip,f=x.ElButtonGroup;return e.openBlock(),e.createBlock(f,{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.items,(g,M)=>(e.openBlock(),e.createBlock(m,{key:g.text,content:h(g),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{class:"ml-toolbar-button",style:e.normalizeStyle({width:a.value+"px",height:a.value+"px"}),key:M,onClick:k=>r(g.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(u,{size:o.value},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.icon)))]),_:2},1032,["size"]),c.value?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(g.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-d5511111"]]),D=20;function ee(t,i,n){const s=e.ref(!1),l=c=>{if(n.value&&t.value){const r=t.value.getBoundingClientRect(),d=c.clientX<r.left||c.clientX>r.right||c.clientY<r.top||c.clientY>r.bottom;s.value=!d}},o=()=>{n.value&&(s.value=!0)},a=()=>{i.value&&i.value.addEventListener("mousemove",o),t.value&&t.value.addEventListener("mousemove",o)},h=()=>{i.value&&i.value.removeEventListener("mousemove",o),t.value&&t.value.removeEventListener("mousemove",o)};return e.onMounted(()=>{window.addEventListener("mousemove",l)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",l)}),e.watch(n,c=>{c&&(s.value=!1)}),e.watch(t,c=>{c?a():h()}),{autoOpened:s}}function te(t,i,n){const s=e.ref(!1),l=e.ref(null),o=e.ref(null),a={x:0,y:0},h=e.computed(()=>l.value==null||o.value==null?{x:0,y:0}:{x:l.value.x-o.value.x,y:l.value.y-o.value.y}),c=()=>{if(t.value){const m=t.value.getBoundingClientRect();o.value={x:m.left,y:m.top},l.value={x:m.left,y:m.top}}},r=()=>{t.value&&t.value.addEventListener("mousedown",w)},d=()=>{t.value&&t.value.removeEventListener("mousedown",w)},w=m=>{if(t.value!=null){if(i&&i.value){const f=i.value.getBoundingClientRect();if(m.clientX<f.left||m.clientX>f.right||m.clientY<f.top||m.clientY>f.bottom)return}s.value=!0,a.x=m.clientX,a.y=m.clientY,c(),document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)}},u=m=>{if(s.value&&o.value&&l.value){const f=window.innerWidth,g=window.innerHeight,M=t.value,k=M.getBoundingClientRect(),E=k.width,v=k.height,b=o.value.x+(m.clientX-a.x),B=o.value.y+(m.clientY-a.y);l.value.x=Math.max(n?n.value.offset.value.left:0,b);const _=f-E;l.value.x=Math.min(n?_-n.value.offset.value.right:_,l.value.x),l.value.y=Math.max(n?n.value.offset.value.top:0,Math.min(B,g-v));const y=g-v-1;l.value.y=Math.min(n?y-n.value.offset.value.bottom:y,l.value.y),M.style.left=l.value.x+"px",M.style.top=l.value.y+"px"}},p=()=>{s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p)};return e.onMounted(()=>{t.value&&(c(),r())}),e.onUnmounted(()=>{t.value&&t.value.removeEventListener("mousedown",w)}),e.watch(t,m=>{m?(c(),r()):d()}),{isDragging:s,movement:h,position:l}}function ne(t,i,n){const s=e.ref(!1),l=e.ref("left"),{isDragging:o,movement:a,position:h}=te(t,i,n);return e.watch(a,c=>{if(c&&t.value){const d=t.value.getBoundingClientRect();d.left<=n.value.offset.value.left?(l.value="left",s.value=!0):window.innerWidth-d.left-d.width<=n.value.offset.value.right?(l.value="right",s.value=!0):s.value=!1}}),{docked:s,orientation:l,isDragging:o,movement:a,position:h}}function oe(t,i,n,s){const l=e.ref(null),o=e.ref(null),a=e.ref(null),h=e.ref(null);return e.watch(t,(c,r)=>{l.value=r}),e.watch(i,(c,r)=>{o.value=r}),e.watch(n,(c,r)=>{a.value=r}),e.watch(s,(c,r)=>{h.value=r}),{lastLeft:l,lastTop:o,lastWidth:a,lastHeight:h}}function le(t,i,n,s){const l=e.ref(t.value.width),o=e.ref(t.value.left),a=e.computed(()=>t.value.width),h=e.computed(()=>t.value.left),c=e.computed(()=>n.value?n.value.x:null);return e.watch([a,h],([r,d])=>{(l.value==null||o.value==null||i.value)&&(l.value=r,o.value=d)}),e.watch(c,r=>{s.value&&n.value&&(o.value=r)}),{left:o,width:l}}function se(t,i=e.ref({left:0,right:0,top:0,bottom:0})){const n=e.ref({});let s=!1;const l=()=>{if(!s&&t.value){const o=t.value.getBoundingClientRect();n.value.left=Math.max(o.left,i.value.left),n.value.top=Math.max(o.top,i.value.top),n.value.width=o.width,n.value.height=o.height,s=!0}};return e.onMounted(()=>{t.value&&l()}),e.watch(t,o=>{o&&l()}),{isIntialized:s,initialRect:n}}function ie(t,i=e.ref(!1),n=e.ref(!1),s=e.ref({left:0,right:0,top:0,bottom:0}),l={width:20,height:40}){const{initialRect:o}=se(t,s),a=e.ref(!1);let h=0,c=0,r=0,d=0,w=0;const u=5,p=e.ref(null),m=E=>{if(!(!t.value||i.value))if(a.value){const v=E.clientX-d,b=E.clientY-w;if(p.value==="left"||p.value==="left-bottom-corner"){const B=c-v;B>l.width&&(o.value.width=B,o.value.left=h+v,t.value.style.left=o.value.left+"px",t.value.style.width=o.value.width+"px")}if(p.value==="right"||p.value==="right-bottom-corner"){const B=c+v;B>l.width&&(o.value.width=B,t.value.style.width=o.value.width+"px")}if(p.value==="bottom"||p.value==="left-bottom-corner"||p.value==="right-bottom-corner"){const B=r+b;B>l.height&&(o.value.height=B,t.value.style.height=o.value.height+"px")}}else{const v=t.value.getBoundingClientRect(),b=E.clientX-v.left,B=E.clientY-v.top,_=b<=u,y=b>=v.width-u,C=B>=v.height-u;_&&C&&n.value?(t.value.style.cursor="nesw-resize",p.value="left-bottom-corner"):y&&C&&!n.value?(t.value.style.cursor="nwse-resize",p.value="right-bottom-corner"):_&&n.value?(t.value.style.cursor="ew-resize",p.value="left"):y&&!n.value?(t.value.style.cursor="ew-resize",p.value="right"):C?(t.value.style.cursor="ns-resize",p.value="bottom"):(t.value.style.cursor="",p.value=null)}},f=E=>{if(!t.value||!p.value)return;const v=t.value.getBoundingClientRect();d=E.clientX,w=E.clientY,c=v.width,r=v.height,h=v.left,o.value.width=c,o.value.height=r,o.value.left=v.left,o.value.top=v.top,a.value=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},g=()=>{a.value=!1,p.value=null,t.value&&(t.value.style.cursor=""),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)},M=()=>{t.value&&(t.value.removeEventListener("mousedown",f),t.value.removeEventListener("mousemove",m)),document.removeEventListener("mouseup",g)},k=()=>{t.value&&(t.value.addEventListener("mousedown",f),t.value.addEventListener("mousemove",m))};return e.onMounted(()=>{t.value&&k()}),e.onBeforeUnmount(()=>{M()}),e.watch(t,E=>{E?k():M()}),{rect:o,isResizing:a}}function ce(t,i,n,s){const l=()=>{if(t.value){const c=t.value;i.value?c.style.transition="width 0.3s ease-out, left 0.3s ease-out":c.style.transition="width 0.3s ease"}},o=()=>{t.value&&(t.value.style.transition="")},a=()=>{t.value&&t.value.removeEventListener("transitionend",o)},h=()=>{t.value&&t.value.addEventListener("transitionend",o)};e.onMounted(()=>{t.value&&t.value.addEventListener("transitionend",o)}),e.onBeforeUnmount(()=>{t.value&&t.value.removeEventListener("transitionend",o)}),e.watch(t,c=>{c?h():a()}),e.watch(n,()=>{l()}),e.watch(s,()=>{l()})}function ae(t,i,n,s){const l=e.ref(window.innerWidth),o=e.ref(window.innerHeight),{docked:a,orientation:h,movement:c,position:r,isDragging:d}=ne(t,i,s),w=e.computed(()=>h.value==="right"),{rect:u,isResizing:p}=ie(t,n,w,s.value.offset),{width:m,left:f}=le(u,p,r,d),{lastTop:g,lastHeight:M}=oe(e.computed(()=>u.value.left),e.computed(()=>u.value.top),e.computed(()=>u.value.width),e.computed(()=>u.value.height)),{autoOpened:k}=ee(t,i,n);ce(t,w,n,k);const E=_=>{if(t.value){const y=t.value.getBoundingClientRect(),C=y.left+_;if(w.value){u.value.left=C;const he=window.innerWidth-y.width-y.left;y.left<=0&&he>=0&&_<0&&(u.value.left=Math.max(0,C)),window.innerWidth-y.width<=0&&(u.value.left=window.innerWidth-y.width)}else y.left+y.width>=window.innerWidth&&_<0&&(u.value.left=Math.max(0,C))}},v=()=>{const _=window.innerWidth-l.value;l.value=window.innerWidth,o.value=window.innerHeight,E(_)};e.onMounted(()=>{window.addEventListener("resize",v)}),e.onUnmounted(()=>{window.removeEventListener("resize",v)});const b=_=>{_?(u.value.width=D,w.value&&f.value&&m.value&&(u.value.left=f.value+m.value-D)):(u.value.width=m.value,w.value&&f.value&&m.value&&(u.value.left=f.value))},B=()=>{a.value?(u.value.top=s.value.offset.value.top,u.value.height=window.innerHeight-s.value.offset.value.top-s.value.offset.value.bottom-1):(u.value.top=g.value,u.value.height=M.value)};return e.watch(a,()=>{B()}),e.watch(n,_=>{b(_)}),e.watch(k,_=>{n.value&&!d.value&&b(!_)}),e.watch(c,_=>{if(_&&t.value){const C=t.value.getBoundingClientRect();u.value.left=C.left,u.value.top=C.top}}),{rect:u,orientation:h,reversed:w}}const re=(t=>(e.pushScopeId("data-v-c27d14f6"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})],-1)),ue={class:"ml-tool-palette-title"},de={class:"ml-tool-palette-content"},O=z(e.defineComponent({__name:"MlToolPalette",props:e.mergeModels({title:{default:""},leftOffset:{default:0},rightOffset:{default:0},topOffset:{default:0},bottomOffset:{default:0}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:i}){const n=t,s=e.useModel(t,"modelValue"),l=i,o=e.ref(!1),a=e.ref(null),h=e.ref(null),c=e.computed(()=>({offset:e.ref({left:n.leftOffset,right:n.rightOffset,top:n.topOffset,bottom:n.bottomOffset})})),{rect:r,orientation:d,reversed:w}=ae(h,a,o,c),u=e.computed(()=>({left:`${r.value.left}px`,top:`${r.value.top}px`,width:`${r.value.width}px`,height:`${r.value.height}px`})),p=e.computed(()=>w.value?{borderLeft:"1px solid",borderRight:null}:{borderLeft:null,borderRight:"1px solid"}),m=()=>{s.value=!1;const f=h.value;l("close",{x:f?f.clientLeft:0,y:f?f.clientTop:0})};return(f,g)=>{const M=x.ElIcon;return s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"toolPaletteElement",ref:h,style:e.normalizeStyle([u.value]),class:"ml-tool-palette-dialog"},[e.createElementVNode("div",{class:e.normalizeClass(["ml-tool-palette-dialog-layout",e.unref(d)])},[e.createElementVNode("div",{ref_key:"titleBarElement",ref:a,class:"ml-tool-palette-title-bar",style:e.normalizeStyle(p.value)},[e.createVNode(M,{size:18,class:"ml-tool-palette-dialog-icon",onClick:m},{default:e.withCtx(()=>[re]),_:1}),e.createVNode(S,{class:"ml-tool-palette-dialog-icon",modelValue:o.value,"onUpdate:modelValue":g[0]||(g[0]=k=>o.value=k),reverse:e.unref(w)},null,8,["modelValue","reverse"]),e.createElementVNode("span",ue,e.toDisplayString(n.title),1)],4),e.createElementVNode("div",de,[e.renderSlot(f.$slots,"default",{},void 0,!0)])],2)],4)):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-c27d14f6"]]),me={install(t){t.component("MlCollapse",V),t.component("MlDropdown",V),t.component("MlLanguage",I),t.component("MlStatusBar",N),t.component("MlToolBar",W),t.component("MlToolPalette",O)}};L.MlCollapse=S,L.MlDropdown=V,L.MlLanguage=I,L.MlStatusBar=N,L.MlToolBar=W,L.MlToolPalette=O,L.default=me,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/lib/index.d.ts CHANGED
@@ -2,11 +2,11 @@ import MlCollapse from './components/MlCollapse.vue';
2
2
  import MlDropdown from './components/MlDropdown.vue';
3
3
  import MlLanguage from './components/MlLanguage.vue';
4
4
  import MlStatusBar from './components/MlStatusBar.vue';
5
- import MlToolbar from './components/MlToolbar.vue';
5
+ import MlToolBar from './components/MlToolBar.vue';
6
6
  import MlToolPalette from './components/MlToolPalette.vue';
7
- export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToolbar, MlToolPalette };
7
+ export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToolBar, MlToolPalette };
8
8
  export type { MlDropdownMenuItem } from './components/MlDropdown.vue';
9
- export type { MlButtonData } from './components/MlToolbar.vue';
9
+ export type { MlButtonData } from './components/MlToolBar.vue';
10
10
  declare const _default: {
11
11
  install(app: any): void;
12
12
  };
package/lib/index.js CHANGED
@@ -2,9 +2,9 @@ import MlCollapse from './components/MlCollapse.vue';
2
2
  import MlDropdown from './components/MlDropdown.vue';
3
3
  import MlLanguage from './components/MlLanguage.vue';
4
4
  import MlStatusBar from './components/MlStatusBar.vue';
5
- import MlToolbar from './components/MlToolbar.vue';
5
+ import MlToolBar from './components/MlToolBar.vue';
6
6
  import MlToolPalette from './components/MlToolPalette.vue';
7
- export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToolbar, MlToolPalette };
7
+ export { MlCollapse, MlDropdown, MlLanguage, MlStatusBar, MlToolBar, MlToolPalette };
8
8
  // Optionally, export them as a plugin for Vue
9
9
  export default {
10
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13,7 +13,7 @@ export default {
13
13
  app.component('MlDropdown', MlDropdown);
14
14
  app.component('MlLanguage', MlLanguage);
15
15
  app.component('MlStatusBar', MlStatusBar);
16
- app.component('MlToolbar', MlToolbar);
16
+ app.component('MlToolBar', MlToolBar);
17
17
  app.component('MlToolPalette', MlToolPalette);
18
18
  }
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/ui-components",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "One common UI component library based on Element Plus",
5
5
  "license": "MIT",
6
6
  "author": "MLight Lee <mlight.lee@outlook.com>",
@@ -23,8 +23,8 @@
23
23
  display: flex;
24
24
  justify-content: space-between;
25
25
  align-items: center;
26
- border-top: 1px solid var(--el-border-color);
27
- box-shadow: 0 -2px 1-px rgba(0, 0, 0, 0.24);
26
+ background-color: var(--el-fill-color);
27
+ border: 1px solid var(--el-border-color);
28
28
  }
29
29
 
30
30
  .ml-status-bar-left,
@@ -26,7 +26,9 @@
26
26
  </template>
27
27
 
28
28
  <script setup lang="ts">
29
- import { Component, computed } from 'vue'
29
+ import { computed, DefineComponent } from 'vue'
30
+
31
+ export type MlIconType = () => DefineComponent
30
32
 
31
33
  /**
32
34
  * Data to descibe button appearance
@@ -35,7 +37,7 @@ export interface MlButtonData {
35
37
  /**
36
38
  * Icon represented by one vue component
37
39
  */
38
- icon: Component
40
+ icon: MlIconType
39
41
  /**
40
42
  * Text shown below icon
41
43
  */
@@ -51,7 +53,7 @@ export interface MlButtonData {
51
53
  }
52
54
 
53
55
  /**
54
- * Properties of MlToolbar component
56
+ * Properties of MlToolBar component
55
57
  */
56
58
  interface Props {
57
59
  /**
@@ -6,7 +6,7 @@
6
6
  v-if="visible"
7
7
  >
8
8
  <div class="ml-tool-palette-dialog-layout" :class="orientation">
9
- <div ref="titleBarElement" class="ml-tool-palette-title-bar">
9
+ <div ref="titleBarElement" class="ml-tool-palette-title-bar" :style="titleBarBorderStyle">
10
10
  <el-icon
11
11
  :size="18"
12
12
  class="ml-tool-palette-dialog-icon"
@@ -128,6 +128,16 @@ const resizedStyle = computed(() => {
128
128
  }
129
129
  })
130
130
 
131
+ const titleBarBorderStyle = computed(() => {
132
+ return reversed.value ? {
133
+ borderLeft: '1px solid',
134
+ borderRight: null
135
+ } : {
136
+ borderLeft: null,
137
+ borderRight: '1px solid'
138
+ }
139
+ })
140
+
131
141
  const handleClose = () => {
132
142
  visible.value = false
133
143
  const element = toolPaletteElement.value
@@ -144,8 +154,8 @@ const handleClose = () => {
144
154
  width: 300px;
145
155
  min-width: var(--collapsed-width);
146
156
  position: fixed;
157
+ box-sizing: border-box;
147
158
  border: 1px solid;
148
- border-radius: 4px;
149
159
  }
150
160
 
151
161
  .ml-tool-palette-dialog-icon {
@@ -165,7 +175,6 @@ const handleClose = () => {
165
175
  cursor: move; /* Draggable cursor on the left part */
166
176
  writing-mode: vertical-rl; /* Vertically align the text */
167
177
  text-align: center;
168
- border: 1px;
169
178
  }
170
179
 
171
180
  .ml-tool-palette-title {
@@ -185,8 +194,7 @@ const handleClose = () => {
185
194
  flex-grow: 1;
186
195
  display: flex;
187
196
  justify-content: space-around;
188
- align-items: center;
189
- background-color: white;
197
+ background-color: var(--el-fill-color);
190
198
  overflow: hidden; /* Hides content when width becomes 0 */
191
199
  }
192
200
 
@@ -125,7 +125,7 @@ export function useBoundingRect(
125
125
  rect.value.height =
126
126
  window.innerHeight -
127
127
  dragOptions.value.offset.value.top -
128
- dragOptions.value.offset.value.bottom
128
+ dragOptions.value.offset.value.bottom - 1
129
129
  } else {
130
130
  rect.value.top = lastTop.value
131
131
  rect.value.height = lastHeight.value
@@ -125,7 +125,7 @@ export function useDrag(
125
125
  options ? options.value.offset.value.top : 0,
126
126
  Math.min(newY, viewportHeight - elementHeight)
127
127
  )
128
- const distanceToBottomBorder = viewportHeight - elementHeight
128
+ const distanceToBottomBorder = viewportHeight - elementHeight - 1
129
129
  position.value.y = Math.min(
130
130
  options
131
131
  ? distanceToBottomBorder - options.value.offset.value.bottom
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ export default {
23
23
  app.component('MlDropdown', MlDropdown)
24
24
  app.component('MlLanguage', MlLanguage)
25
25
  app.component('MlStatusBar', MlStatusBar)
26
- app.component('MlToolbar', MlToolBar)
26
+ app.component('MlToolBar', MlToolBar)
27
27
  app.component('MlToolPalette', MlToolPalette)
28
28
  }
29
29
  }