@mlightcad/ui-components 0.0.8 → 0.0.10

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.
Files changed (35) hide show
  1. package/README.md +21 -3
  2. package/dist/ui-components.es.js +416 -318
  3. package/dist/ui-components.umd.js +2 -2
  4. package/lib/index.d.ts +2 -1
  5. package/lib/index.js +3 -1
  6. package/package.json +1 -1
  7. package/src/components/MlCollapse.vue +11 -5
  8. package/src/components/MlStatusBar.vue +43 -0
  9. package/src/components/MlToolPalette.vue +41 -30
  10. package/src/{composable → composables}/types.ts +10 -0
  11. package/src/composables/useAutoOpen.ts +77 -0
  12. package/src/composables/useBoundingRect.ts +161 -0
  13. package/src/composables/useDrag.ts +176 -0
  14. package/src/{composable → composables}/useDragEx.ts +16 -6
  15. package/src/{composable → composables}/useInitialRect.ts +13 -13
  16. package/src/composables/useLastPosAndSize.ts +43 -0
  17. package/src/composables/useLeftPosAndWidth.ts +47 -0
  18. package/src/{composable → composables}/useResize.ts +36 -28
  19. package/src/{composable → composables}/useTransition.ts +31 -24
  20. package/src/index.ts +10 -1
  21. package/lib/MlDropdown.vue.d.ts +0 -59
  22. package/lib/MlDropdown.vue.js +0 -106
  23. package/lib/MlLanguage.vue.d.ts +0 -29
  24. package/lib/MlLanguage.vue.js +0 -67
  25. package/lib/MlToolPalette.vue.d.ts +0 -2
  26. package/lib/MlToolPalette.vue.js +0 -149
  27. package/lib/MlToolbar.vue.d.ts +0 -74
  28. package/lib/MlToolbar.vue.js +0 -129
  29. package/src/composable/useBoundingRect.ts +0 -87
  30. package/src/composable/useDrag.ts +0 -157
  31. package/src/composable/useRect.ts +0 -23
  32. /package/src/{composable → composables}/useWindowSize.ts +0 -0
  33. /package/src/{svg → svgs}/arrow-left.svg +0 -0
  34. /package/src/{svg → svgs}/arrow-right.svg +0 -0
  35. /package/src/{svg → svgs}/svg.d.ts +0 -0
@@ -1,83 +1,81 @@
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-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-d69f63b3]{cursor:default;width:300px;min-width:var(--collapsed-width);position:absolute;border:1px solid;border-radius:4px}.ml-tool-palette-dialog-icon[data-v-d69f63b3]{border-bottom:1px solid}.ml-tool-palette-dialog-layout[data-v-d69f63b3]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-d69f63b3]{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-d69f63b3]{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-d69f63b3]{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-d69f63b3]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-d69f63b3],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-d69f63b3]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-d69f63b3]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { ElIcon as S, ElDropdownItem as ee, ElDropdownMenu as te, ElDropdown as le, ElButton as ne, ElTooltip as oe, ElButtonGroup as ie } 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-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";
3
3
  import "element-plus/es/components/base/style/css";
4
4
  import "element-plus/es/components/icon/style/css";
5
- import { openBlock as _, createElementBlock as b, createElementVNode as g, defineComponent as D, mergeModels as W, useModel as N, computed as L, createBlock as E, withCtx as M, resolveDynamicComponent as se, createVNode as $, Fragment as O, renderList as F, createTextVNode as ae, toDisplayString as A, pushScopeId as j, popScopeId as q, normalizeClass as J, normalizeStyle as K, createCommentVNode as Q, ref as f, onMounted as I, nextTick as H, watch as C, onBeforeUnmount as Z, onUnmounted as R, unref as ue, renderSlot as ce } from "vue";
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";
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";
9
9
  import "element-plus/es/components/button-group/style/css";
10
10
  import "element-plus/es/components/tooltip/style/css";
11
11
  import "element-plus/es/components/button/style/css";
12
- const re = {
12
+ const de = {
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  width: "1em",
15
15
  height: "1em",
16
16
  viewBox: "0 0 1024 1024"
17
- }, ve = /* @__PURE__ */ g("path", {
17
+ }, me = /* @__PURE__ */ z("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
- }, null, -1), de = [
21
- ve
20
+ }, null, -1), he = [
21
+ me
22
22
  ];
23
- function me(e, l) {
24
- return _(), b("svg", re, [...de]);
23
+ function fe(e, i) {
24
+ return y(), I("svg", de, [...he]);
25
25
  }
26
- const X = { render: me }, he = {
26
+ const G = { 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
- }, pe = /* @__PURE__ */ g("path", {
31
+ }, we = /* @__PURE__ */ z("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
- }, null, -1), fe = [
35
- pe
34
+ }, null, -1), _e = [
35
+ we
36
36
  ];
37
- function _e(e, l) {
38
- return _(), b("svg", he, [...fe]);
37
+ function ge(e, i) {
38
+ return y(), I("svg", pe, [..._e]);
39
39
  }
40
- const U = { render: _e }, we = /* @__PURE__ */ D({
40
+ const j = { render: ge }, Le = /* @__PURE__ */ S({
41
41
  __name: "MlCollapse",
42
- props: /* @__PURE__ */ W({
42
+ props: /* @__PURE__ */ V({
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__ */ W({
50
- change: null
51
- }, ["update:modelValue"]),
52
- setup(e, { emit: l }) {
53
- const n = e, t = N(e, "modelValue"), o = l, c = L(() => n.reverse ? t.value ? X : U : t.value ? U : X), s = L(() => `${n.size}px`), v = () => {
54
- o("change", t.value), t.value = !t.value;
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 = () => {
52
+ l("change", o.value), o.value = !o.value;
55
53
  };
56
- return (u, h) => {
57
- const r = S;
58
- return _(), E(r, {
59
- size: s.value,
60
- onClick: v
54
+ return (s, a) => {
55
+ const v = Y;
56
+ return y(), W(v, {
57
+ size: u.value,
58
+ onClick: d
61
59
  }, {
62
- default: M(() => [
63
- (_(), E(se(c.value)))
60
+ default: T(() => [
61
+ (y(), W(re(n.value)))
64
62
  ]),
65
63
  _: 1
66
64
  }, 8, ["size"]);
67
65
  };
68
66
  }
69
- }), xe = (e) => (j("data-v-3fc33b5d"), e = e(), q(), e), Le = /* @__PURE__ */ xe(() => /* @__PURE__ */ g("svg", {
67
+ }), xe = (e) => (Z("data-v-3fc33b5d"), e = e(), P(), e), Me = /* @__PURE__ */ xe(() => /* @__PURE__ */ z("svg", {
70
68
  preserveAspectRatio: "xMidYMid meet",
71
69
  viewBox: "0 0 24 24",
72
70
  width: "1.2em",
73
71
  height: "1.2em",
74
72
  "data-v-63d067da": ""
75
73
  }, [
76
- /* @__PURE__ */ g("path", {
74
+ /* @__PURE__ */ z("path", {
77
75
  fill: "currentColor",
78
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"
79
77
  })
80
- ], -1)), ge = /* @__PURE__ */ D({
78
+ ], -1)), ye = /* @__PURE__ */ S({
81
79
  __name: "MlDropdown",
82
80
  props: {
83
81
  icon: {},
@@ -87,22 +85,22 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
87
85
  emits: {
88
86
  click: null
89
87
  },
90
- setup(e, { emit: l }) {
91
- const n = e, t = l, o = L(() => n.items.filter((s) => s.name !== n.current)), c = (s) => {
92
- t("click", s);
88
+ setup(e, { emit: i }) {
89
+ const t = e, o = i, l = L(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
90
+ o("click", u);
93
91
  };
94
- return (s, v) => {
95
- const u = S, h = ee, r = te, i = le;
96
- return _(), E(i, { onCommand: c }, {
97
- dropdown: M(() => [
98
- $(r, null, {
99
- default: M(() => [
100
- (_(!0), b(O, null, F(o.value, (a) => (_(), E(h, {
101
- key: a.text,
102
- command: a.name
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, {
99
+ key: c.text,
100
+ command: c.name
103
101
  }, {
104
- default: M(() => [
105
- ae(A(a.text), 1)
102
+ default: T(() => [
103
+ ve(N(c.text), 1)
106
104
  ]),
107
105
  _: 2
108
106
  }, 1032, ["command"]))), 128))
@@ -110,13 +108,13 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
110
108
  _: 1
111
109
  })
112
110
  ]),
113
- default: M(() => [
114
- $(u, {
111
+ default: T(() => [
112
+ H(s, {
115
113
  size: "30",
116
114
  class: "ml-dropdown-icon"
117
115
  }, {
118
- default: M(() => [
119
- Le
116
+ default: T(() => [
117
+ Me
120
118
  ]),
121
119
  _: 1
122
120
  })
@@ -125,12 +123,12 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
125
123
  });
126
124
  };
127
125
  }
128
- }), G = (e, l) => {
129
- const n = e.__vccOpts || e;
130
- for (const [t, o] of l)
131
- n[t] = o;
132
- return n;
133
- }, Y = /* @__PURE__ */ G(ge, [["__scopeId", "data-v-3fc33b5d"]]), Me = '<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>', ye = /* @__PURE__ */ D({
126
+ }), A = (e, i) => {
127
+ const t = e.__vccOpts || e;
128
+ for (const [o, l] of i)
129
+ t[o] = l;
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({
134
132
  __name: "MlLanguage",
135
133
  props: {
136
134
  languages: {},
@@ -139,21 +137,32 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
139
137
  emits: {
140
138
  click: null
141
139
  },
142
- setup(e, { emit: l }) {
143
- const n = e, t = l, o = (c) => {
144
- t("click", c);
140
+ setup(e, { emit: i }) {
141
+ const t = e, o = i, l = (n) => {
142
+ o("click", n);
145
143
  };
146
- return (c, s) => (_(), E(Y, {
147
- icon: Me,
148
- items: n.languages,
149
- current: n.current,
150
- onClick: o
144
+ return (n, u) => (y(), W(X, {
145
+ icon: Ee,
146
+ items: t.languages,
147
+ current: t.current,
148
+ onClick: l
151
149
  }, null, 8, ["items", "current"]));
152
150
  }
153
- }), ze = {
151
+ }), ze = {}, Ce = { class: "ml-status-bar" }, Be = { class: "ml-status-bar-left" }, Te = { class: "ml-status-bar-right" };
152
+ function ke(e, i) {
153
+ return y(), I("div", Ce, [
154
+ z("div", Be, [
155
+ O(e.$slots, "left", {}, void 0, !0)
156
+ ]),
157
+ z("div", Te, [
158
+ O(e.$slots, "right", {}, void 0, !0)
159
+ ])
160
+ ]);
161
+ }
162
+ const $e = /* @__PURE__ */ A(ze, [["render", ke], ["__scopeId", "data-v-b0c9d107"]]), We = {
154
163
  key: 0,
155
164
  class: "ml-toolbar-button-text"
156
- }, Ee = /* @__PURE__ */ D({
165
+ }, Ie = /* @__PURE__ */ S({
157
166
  __name: "MlToolbar",
158
167
  props: {
159
168
  items: {},
@@ -163,43 +172,43 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
163
172
  emits: {
164
173
  click: null
165
174
  },
166
- setup(e, { emit: l }) {
167
- const n = e, t = l, o = L(() => n.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), c = L(() => n.size === "small" ? 20 : 30), s = L(() => {
168
- switch (n.size) {
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(() => {
177
+ switch (t.size) {
169
178
  case "small":
170
179
  return 30;
171
180
  case "medium":
172
181
  return 50;
173
182
  }
174
183
  return 70;
175
- }), v = (r) => r.description ? r.description : r.text, u = L(() => n.size === "large"), h = (r) => {
176
- t("click", r);
184
+ }), d = (v) => v.description ? v.description : v.text, s = L(() => t.size === "large"), a = (v) => {
185
+ o("click", v);
177
186
  };
178
- return (r, i) => {
179
- const a = S, p = ne, x = oe, y = ie;
180
- return _(), E(y, {
181
- class: J(o.value)
187
+ return (v, g) => {
188
+ const c = Y, h = ue, r = ae, p = ce;
189
+ return y(), W(p, {
190
+ class: R(l.value)
182
191
  }, {
183
- default: M(() => [
184
- (_(!0), b(O, null, F(r.items, (w, d) => (_(), E(x, {
185
- key: w.text,
186
- content: v(w),
192
+ default: T(() => [
193
+ (y(!0), I(K, null, Q(v.items, (x, C) => (y(), W(r, {
194
+ key: x.text,
195
+ content: d(x),
187
196
  "hide-after": 0
188
197
  }, {
189
- default: M(() => [
190
- (_(), E(p, {
198
+ default: T(() => [
199
+ (y(), W(h, {
191
200
  class: "ml-toolbar-button",
192
- style: K({ width: s.value + "px", height: s.value + "px" }),
193
- key: d,
194
- onClick: (m) => h(w.command)
201
+ style: ee({ width: u.value + "px", height: u.value + "px" }),
202
+ key: C,
203
+ onClick: (k) => a(x.command)
195
204
  }, {
196
- default: M(() => [
197
- g("div", null, [
198
- $(a, {
199
- size: c.value,
200
- innerHTML: w.icon
205
+ default: T(() => [
206
+ z("div", null, [
207
+ H(c, {
208
+ size: n.value,
209
+ innerHTML: x.icon
201
210
  }, null, 8, ["size", "innerHTML"]),
202
- u.value ? (_(), b("div", ze, A(w.text), 1)) : Q("", !0)
211
+ s.value ? (y(), I("div", We, N(x.text), 1)) : te("", !0)
203
212
  ])
204
213
  ]),
205
214
  _: 2
@@ -212,294 +221,383 @@ const U = { render: _e }, we = /* @__PURE__ */ D({
212
221
  }, 8, ["class"]);
213
222
  };
214
223
  }
215
- }), Ce = /* @__PURE__ */ G(Ee, [["__scopeId", "data-v-27b5412a"]]), V = 20;
216
- function be(e) {
217
- const l = f({});
218
- let n = !1;
219
- const t = () => {
220
- if (!n && e.value) {
221
- const o = e.value.getBoundingClientRect();
222
- l.value.left = o.left, l.value.top = o.top, l.value.width = o.width, l.value.height = o.height, n = !0;
224
+ }), De = /* @__PURE__ */ A(Ie, [["__scopeId", "data-v-27b5412a"]]), q = 20;
225
+ function He(e, i, t) {
226
+ const o = m(!1), l = (s) => {
227
+ 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
+ }
231
+ }, n = () => {
232
+ t.value && (o.value = !0);
233
+ }, u = () => {
234
+ i.value && i.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
235
+ }, d = () => {
236
+ i.value && i.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
237
+ };
238
+ return D(() => {
239
+ window.addEventListener("mousemove", l);
240
+ }), U(() => {
241
+ window.removeEventListener("mousemove", l);
242
+ }), _(t, (s) => {
243
+ s && (o.value = !1);
244
+ }), _(e, (s) => {
245
+ s ? u() : d();
246
+ }), { autoOpened: o };
247
+ }
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
+ x: l.value.x - n.value.x,
251
+ y: l.value.y - n.value.y
252
+ }), s = () => {
253
+ if (e.value) {
254
+ const r = e.value.getBoundingClientRect();
255
+ n.value = {
256
+ x: r.left,
257
+ y: r.top
258
+ }, l.value = {
259
+ x: r.left,
260
+ y: r.top
261
+ };
262
+ }
263
+ }, a = () => {
264
+ e.value && e.value.addEventListener("mousedown", g);
265
+ }, v = () => {
266
+ e.value && e.value.removeEventListener("mousedown", g);
267
+ }, g = (r) => {
268
+ 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;
272
+ }
273
+ o.value = !0, u.x = r.clientX, u.y = r.clientY, s(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", h);
274
+ }
275
+ }, c = (r) => {
276
+ 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);
278
+ l.value.x = Math.max(
279
+ t ? t.value.offset.value.left : 0,
280
+ $
281
+ );
282
+ const w = p - b;
283
+ l.value.x = Math.min(
284
+ t ? w - t.value.offset.value.right : w,
285
+ l.value.x
286
+ ), l.value.y = Math.max(
287
+ t ? t.value.offset.value.top : 0,
288
+ Math.min(E, x - f)
289
+ );
290
+ const M = x - f;
291
+ l.value.y = Math.min(
292
+ t ? M - t.value.offset.value.bottom : M,
293
+ l.value.y
294
+ ), C.style.left = l.value.x + "px", C.style.top = l.value.y + "px";
295
+ }
296
+ }, h = () => {
297
+ o.value = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", h);
298
+ };
299
+ 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();
305
+ }), {
306
+ isDragging: o,
307
+ movement: d,
308
+ position: l
309
+ };
310
+ }
311
+ function Ve(e, i, t) {
312
+ const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = Se(
313
+ e,
314
+ i,
315
+ t
316
+ );
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;
321
+ }
322
+ }), {
323
+ docked: o,
324
+ orientation: l,
325
+ isDragging: n,
326
+ movement: u,
327
+ position: d
328
+ };
329
+ }
330
+ function Ye(e, i, t, o) {
331
+ const l = m(null), n = m(null), u = m(null), d = m(null);
332
+ return _(e, (s, a) => {
333
+ l.value = a;
334
+ }), _(i, (s, a) => {
335
+ n.value = a;
336
+ }), _(t, (s, a) => {
337
+ u.value = a;
338
+ }), _(o, (s, a) => {
339
+ d.value = a;
340
+ }), {
341
+ lastLeft: l,
342
+ lastTop: n,
343
+ lastWidth: u,
344
+ lastHeight: d
345
+ };
346
+ }
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) => {
352
+ o.value && t.value && (n.value = a);
353
+ }), { left: n, width: l };
354
+ }
355
+ function Oe(e, i = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
356
+ const t = m({});
357
+ let o = !1;
358
+ const l = () => {
359
+ if (!o && e.value) {
360
+ 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;
223
362
  }
224
363
  };
225
- return I(() => {
226
- e.value && H(() => {
227
- t();
228
- });
229
- }), C(e, (o) => {
230
- o && H(() => {
231
- t();
232
- });
364
+ return D(() => {
365
+ e.value && l();
366
+ }), _(e, (n) => {
367
+ n && l();
233
368
  }), {
234
- isIntialized: n,
235
- initialRect: l
369
+ isIntialized: o,
370
+ initialRect: t
236
371
  };
237
372
  }
238
- function ke(e, l = f(!1), n = { width: 20, height: 40 }) {
239
- const t = f({
240
- width: null,
241
- height: null,
242
- left: null,
243
- top: null
244
- }), o = f(!1);
245
- let c = 0, s = 0, v = 0, u = 0, h = 0;
246
- const r = 5, i = f(
247
- null
248
- ), a = (d) => {
249
- if (e.value)
250
- if (o.value) {
251
- const m = d.clientX - u, z = d.clientY - h;
252
- (i.value === "left" || i.value === "left-bottom-corner") && (t.value.width = Math.max(
253
- n.width,
254
- s - m
255
- ), t.value.left = c + m, e.value.style.left = t.value.left + "px", e.value.style.width = t.value.width + "px"), (i.value === "right" || i.value === "right-bottom-corner") && (t.value.width = Math.max(
256
- n.width,
257
- s + m
258
- ), e.value.style.width = t.value.width + "px"), (i.value === "bottom" || i.value === "left-bottom-corner" || i.value === "right-bottom-corner") && (t.value.height = Math.max(
259
- n.height,
260
- v + z
261
- ), e.value.style.height = t.value.height + "px");
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 }) {
374
+ 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))
378
+ if (u.value) {
379
+ const f = b.clientX - v, $ = b.clientY - g;
380
+ 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
+ }
384
+ if (h.value === "right" || h.value === "right-bottom-corner") {
385
+ const E = s + f;
386
+ E > l.width && (n.value.width = E, e.value.style.width = n.value.width + "px");
387
+ }
388
+ if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
389
+ const E = a + $;
390
+ E > l.height && (n.value.height = E, e.value.style.height = n.value.height + "px");
391
+ }
262
392
  } else {
263
- const m = e.value.getBoundingClientRect(), z = d.clientX - m.left, k = d.clientY - m.top, B = z <= r, T = z >= m.width - r, P = k >= m.height - r;
264
- B && P && l.value ? (e.value.style.cursor = "nesw-resize", i.value = "left-bottom-corner") : T && P && !l.value ? (e.value.style.cursor = "nwse-resize", i.value = "right-bottom-corner") : B && l.value ? (e.value.style.cursor = "ew-resize", i.value = "left") : T && !l.value ? (e.value.style.cursor = "ew-resize", i.value = "right") : P ? (e.value.style.cursor = "ns-resize", i.value = "bottom") : (e.value.style.cursor = "", i.value = null);
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);
265
395
  }
266
- }, p = (d) => {
267
- if (!e.value || !i.value) return;
268
- const m = e.value.getBoundingClientRect();
269
- u = d.clientX, h = d.clientY, s = m.width, v = m.height, c = m.left, t.value.width = s, t.value.height = v, t.value.left = m.left, t.value.top = m.top, o.value = !0, document.addEventListener("mousemove", a), document.addEventListener("mouseup", x);
396
+ }, p = (b) => {
397
+ 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);
270
400
  }, x = () => {
271
- o.value = !1, i.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", x);
272
- }, y = () => {
273
- e.value && (e.value.removeEventListener("mousedown", p), e.value.removeEventListener("mousemove", a)), document.removeEventListener("mouseup", x);
274
- }, w = () => {
275
- e.value && (e.value.addEventListener("mousedown", p), e.value.addEventListener("mousemove", a));
401
+ u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", x);
402
+ }, 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));
276
406
  };
277
- return I(() => {
278
- e.value && w();
279
- }), Z(() => {
280
- y();
281
- }), C(e, (d) => {
282
- d ? w() : y();
283
- }), { rect: t, isResizing: o };
407
+ return D(() => {
408
+ e.value && k();
409
+ }), ne(() => {
410
+ C();
411
+ }), _(e, (b) => {
412
+ b ? k() : C();
413
+ }), { rect: n, isResizing: u };
284
414
  }
285
- function Be(e, l, n) {
286
- function t() {
287
- e.value && (e.value.style.transition = "");
288
- }
289
- const o = () => {
290
- e.value && e.value.removeEventListener("transitionend", t);
291
- }, c = () => {
292
- e.value && e.value.addEventListener("transitionend", t);
293
- };
294
- I(() => {
295
- e.value && e.value.addEventListener("transitionend", t);
296
- }), Z(() => {
297
- e.value && e.value.removeEventListener("transitionend", t);
298
- }), C(e, (s) => {
299
- s ? c() : o();
300
- }), C(n, () => {
415
+ function Ne(e, i, t, o) {
416
+ const l = () => {
301
417
  if (e.value) {
302
418
  const s = e.value;
303
- l.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
419
+ i.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
304
420
  }
305
- });
306
- }
307
- function Te(e, l, n, t) {
308
- const o = f(window.innerWidth), c = f(window.innerHeight), { initialRect: s } = be(e), { rect: v } = ke(e, l);
309
- Be(e, l, n);
310
- const u = L(() => v.value.width && v.value.height ? v.value : s.value), h = (a) => {
311
- if (e.value && l.value) {
312
- const p = e.value.getBoundingClientRect();
313
- e.value.style.left = p.left + a + "px";
314
- }
315
- }, r = () => {
316
- const a = window.innerWidth - o.value;
317
- o.value = window.innerWidth, c.value = window.innerHeight, h(a);
421
+ }, n = () => {
422
+ e.value && (e.value.style.transition = "");
423
+ }, u = () => {
424
+ e.value && e.value.removeEventListener("transitionend", n);
425
+ }, d = () => {
426
+ e.value && e.value.addEventListener("transitionend", n);
318
427
  };
319
- I(() => {
320
- window.addEventListener("resize", r);
321
- }), R(() => {
322
- window.removeEventListener("resize", r);
428
+ D(() => {
429
+ e.value && e.value.addEventListener("transitionend", n);
430
+ }), ne(() => {
431
+ e.value && e.value.removeEventListener("transitionend", n);
432
+ }), _(e, (s) => {
433
+ s ? d() : u();
434
+ }), _(t, () => {
435
+ l();
436
+ }), _(o, () => {
437
+ l();
323
438
  });
324
- let i = null;
325
- return C(n, (a) => {
326
- a ? (i = u.value.width, u.value.width = V, l.value && u.value.left && i && (u.value.left = u.value.left + i - V)) : (u.value.width = i, l.value && u.value.left && i && (u.value.left = u.value.left - i + V), i = null);
327
- }), C(t, (a) => {
328
- if (a && e.value) {
329
- const x = e.value.getBoundingClientRect();
330
- u.value.left = x.left, u.value.top = x.top;
331
- }
332
- }), { rect: u };
333
439
  }
334
- function $e(e, l) {
335
- const n = f(!1), t = f({ x: 0, y: 0 }), o = f({ x: 0, y: 0 }), c = L(() => ({
336
- x: t.value.x - o.value.x,
337
- y: t.value.y - o.value.y
338
- })), s = () => {
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
+ e,
443
+ i,
444
+ o
445
+ ), g = L(() => d.value === "right"), { rect: c, isResizing: h } = Xe(
446
+ e,
447
+ t,
448
+ g,
449
+ o.value.offset
450
+ ), { width: r, left: p } = Ae(
451
+ c,
452
+ h,
453
+ 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) => {
339
463
  if (e.value) {
340
- const a = e.value.getBoundingClientRect();
341
- o.value.x = a.left, o.value.y = a.top, t.value.x = a.left, t.value.y = a.top;
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);
469
+ } else
470
+ M.left + M.width >= window.innerWidth && w < 0 && (c.value.left = Math.max(0, B));
342
471
  }
343
- }, v = () => {
344
- e.value && e.value.addEventListener("mousedown", h);
345
- }, u = () => {
346
- e.value && e.value.removeEventListener("mousedown", h);
347
- }, h = () => {
348
- n.value = !0, document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
349
- }, r = (a) => {
350
- if (n.value) {
351
- const p = window.innerWidth, x = window.innerHeight, y = e.value, w = y.offsetWidth, d = y.offsetHeight, m = t.value.x + a.movementX, z = t.value.y + a.movementY;
352
- t.value.x = Math.max(
353
- l ? l.value.leftGap : 0,
354
- Math.min(m, p - w)
355
- );
356
- const k = l && l.value.container ? l.value.container.clientWidth : 0, B = p - k - w;
357
- if (t.value.x = Math.min(
358
- l ? B - l.value.rightGap : B,
359
- t.value.x
360
- ), t.value.y = Math.max(
361
- 0,
362
- Math.min(z, x - d)
363
- ), l != null && l.value.container) {
364
- const T = l == null ? void 0 : l.value.container;
365
- T.style.left = t.value.x + "px", T.style.top = t.value.y + "px";
366
- }
367
- }
368
- }, i = () => {
369
- n.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
472
+ }, f = () => {
473
+ const w = window.innerWidth - l.value;
474
+ l.value = window.innerWidth, n.value = window.innerHeight, b(w);
370
475
  };
371
- return I(() => {
372
- e.value && H(() => {
373
- s(), v();
374
- });
375
- }), R(() => {
376
- e.value && (s(), e.value.removeEventListener("mousedown", h));
377
- }), C(e, (a) => {
378
- a ? H(() => {
379
- s(), v();
380
- }) : u();
381
- }), {
382
- isDragging: n,
383
- movement: c,
384
- position: t
476
+ D(() => {
477
+ window.addEventListener("resize", f);
478
+ }), U(() => {
479
+ window.removeEventListener("resize", f);
480
+ });
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
+ }, 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);
385
485
  };
386
- }
387
- function De(e, l) {
388
- const n = f(!1), t = f("left"), { isDragging: o, movement: c, position: s } = $e(e, l);
389
- return C(c, (v) => {
390
- if (v && l.value.container) {
391
- const h = l.value.container.getBoundingClientRect();
392
- h.left <= l.value.leftGap ? (t.value = "left", n.value = !0) : window.innerWidth - h.left - h.width - V <= l.value.rightGap ? (t.value = "right", n.value = !0) : n.value = !1;
486
+ return _(u, () => {
487
+ 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;
393
496
  }
394
- }), {
395
- docked: n,
396
- orientation: t,
397
- isDragging: o,
398
- movement: c,
399
- position: s
400
- };
497
+ }), { rect: c, orientation: d, reversed: g };
401
498
  }
402
- const Ie = (e) => (j("data-v-d69f63b3"), e = e(), q(), e), Ve = /* @__PURE__ */ Ie(() => /* @__PURE__ */ g("svg", {
499
+ const Fe = (e) => (Z("data-v-539d98d3"), e = e(), P(), e), Ge = /* @__PURE__ */ Fe(() => /* @__PURE__ */ z("svg", {
403
500
  xmlns: "http://www.w3.org/2000/svg",
404
501
  width: "1em",
405
502
  height: "1em",
406
503
  viewBox: "0 0 1024 1024"
407
504
  }, [
408
- /* @__PURE__ */ g("path", {
505
+ /* @__PURE__ */ z("path", {
409
506
  fill: "currentColor",
410
507
  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"
411
508
  })
412
- ], -1)), We = { class: "ml-tool-palette-title" }, He = { class: "ml-tool-palette-content" }, Se = /* @__PURE__ */ D({
509
+ ], -1)), je = { class: "ml-tool-palette-title" }, qe = { class: "ml-tool-palette-content" }, Je = /* @__PURE__ */ S({
413
510
  __name: "MlToolPalette",
414
- props: /* @__PURE__ */ W({
415
- title: { default: "" }
511
+ props: /* @__PURE__ */ V({
512
+ title: { default: "" },
513
+ leftOffset: { default: 0 },
514
+ rightOffset: { default: 0 },
515
+ topOffset: { default: 0 },
516
+ bottomOffset: { default: 0 }
416
517
  }, {
417
518
  modelValue: { default: !0 },
418
519
  modelModifiers: {}
419
520
  }),
420
- emits: /* @__PURE__ */ W(["close"], ["update:modelValue"]),
421
- setup(e, { emit: l }) {
422
- const n = e, t = N(e, "modelValue"), o = l, c = f(!1), s = f(null), v = f(null), u = L(() => i.value === "right"), h = L(() => ({
423
- leftGap: 0,
424
- rightGap: 0,
425
- container: v.value
426
- })), { docked: r, orientation: i, movement: a } = De(
427
- s,
428
- h
429
- ), { rect: p } = Te(
430
- v,
431
- u,
432
- c,
433
- a
434
- ), x = L(() => ({
435
- left: `${p.value.left}px`,
436
- top: `${p.value.top}px`,
437
- width: `${p.value.width}px`,
438
- height: r.value ? "100%" : `${p.value.height}px`
439
- })), y = (d) => {
440
- c.value = d;
441
- }, w = () => {
442
- t.value = !1;
443
- const d = v.value;
444
- o("close", {
445
- x: d ? d.clientLeft : 0,
446
- y: d ? d.clientTop : 0
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(() => ({
524
+ offset: m({
525
+ left: t.leftOffset,
526
+ right: t.rightOffset,
527
+ top: t.topOffset,
528
+ bottom: t.bottomOffset
529
+ })
530
+ })), {
531
+ rect: a,
532
+ orientation: v,
533
+ reversed: g
534
+ } = Ue(d, u, n, s), c = L(() => ({
535
+ left: `${a.value.left}px`,
536
+ top: `${a.value.top}px`,
537
+ width: `${a.value.width}px`,
538
+ height: `${a.value.height}px`
539
+ })), h = () => {
540
+ o.value = !1;
541
+ const r = d.value;
542
+ l("close", {
543
+ x: r ? r.clientLeft : 0,
544
+ y: r ? r.clientTop : 0
447
545
  });
448
546
  };
449
- return (d, m) => {
450
- const z = S;
451
- return t.value ? (_(), b("div", {
547
+ return (r, p) => {
548
+ const x = Y;
549
+ return o.value ? (y(), I("div", {
452
550
  key: 0,
453
551
  ref_key: "toolPaletteElement",
454
- ref: v,
455
- style: K([x.value]),
552
+ ref: d,
553
+ style: ee([c.value]),
456
554
  class: "ml-tool-palette-dialog"
457
555
  }, [
458
- g("div", {
459
- class: J(["ml-tool-palette-dialog-layout", ue(i)])
556
+ z("div", {
557
+ class: R(["ml-tool-palette-dialog-layout", F(v)])
460
558
  }, [
461
- g("div", {
559
+ z("div", {
462
560
  ref_key: "titleBarElement",
463
- ref: s,
561
+ ref: u,
464
562
  class: "ml-tool-palette-title-bar"
465
563
  }, [
466
- $(z, {
564
+ H(x, {
467
565
  size: 18,
468
566
  class: "ml-tool-palette-dialog-icon",
469
- onClick: w
567
+ onClick: h
470
568
  }, {
471
- default: M(() => [
472
- Ve
569
+ default: T(() => [
570
+ Ge
473
571
  ]),
474
572
  _: 1
475
573
  }),
476
- $(we, {
574
+ H(Le, {
477
575
  class: "ml-tool-palette-dialog-icon",
478
- modelValue: c.value,
479
- "onUpdate:modelValue": m[0] || (m[0] = (k) => c.value = k),
480
- reverse: u.value,
481
- onChange: y
576
+ modelValue: n.value,
577
+ "onUpdate:modelValue": p[0] || (p[0] = (C) => n.value = C),
578
+ reverse: F(g)
482
579
  }, null, 8, ["modelValue", "reverse"]),
483
- g("span", We, A(n.title), 1)
580
+ z("span", je, N(t.title), 1)
484
581
  ], 512),
485
- g("div", He, [
486
- ce(d.$slots, "default", {}, void 0, !0)
582
+ z("div", qe, [
583
+ O(r.$slots, "default", {}, void 0, !0)
487
584
  ])
488
585
  ], 2)
489
- ], 4)) : Q("", !0);
586
+ ], 4)) : te("", !0);
490
587
  };
491
588
  }
492
- }), Pe = /* @__PURE__ */ G(Se, [["__scopeId", "data-v-d69f63b3"]]), Je = {
589
+ }), Ke = /* @__PURE__ */ A(Je, [["__scopeId", "data-v-539d98d3"]]), st = {
493
590
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
494
591
  install(e) {
495
- e.component("MlCollapse", Y), e.component("MlDropdown", Y), e.component("MlLanguage", ye), e.component("MlToolbar", Ce), e.component("MlToolPalette", Pe);
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);
496
593
  }
497
594
  };
498
595
  export {
499
- we as MlCollapse,
500
- Y as MlDropdown,
501
- ye as MlLanguage,
502
- Pe as MlToolPalette,
503
- Ce as MlToolbar,
504
- Je as default
596
+ Le as MlCollapse,
597
+ X as MlDropdown,
598
+ be as MlLanguage,
599
+ $e as MlStatusBar,
600
+ Ke as MlToolPalette,
601
+ De as MlToolbar,
602
+ st as default
505
603
  };