@tresjs/leches 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,99 +1,99 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.11.0
3
+ * version: v0.12.1
4
4
  * (c) 2023
5
5
  * description: Tasty GUI for Vue controls 🍰
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { unref as A, isRef as L, toRefs as E, customRef as se, ref as y, watch as N, computed as K, defineComponent as M, reactive as z, h as ie, provide as ce, isReactive as ue, openBlock as v, createElementBlock as _, createElementVNode as d, toDisplayString as k, normalizeClass as S, withDirectives as J, vShow as Q, createTextVNode as de, normalizeStyle as fe, Fragment as I, renderList as O, createCommentVNode as P, createBlock as C, createVNode as pe, Transition as ve, withCtx as Z } from "vue";
9
- import { useWindowSize as ee, useEventListener as W, useStorage as ge, isClient as ye, useMouse as R, useFps as be, useRafFn as he } from "@vueuse/core";
10
- function D(n) {
11
- return typeof n == "function" ? n() : A(n);
8
+ import { unref as F, isRef as R, toRefs as X, customRef as de, ref as f, watch as z, computed as O, defineComponent as M, reactive as N, h as pe, provide as fe, isReactive as ve, openBlock as p, createElementBlock as x, createElementVNode as d, toDisplayString as k, normalizeClass as K, withDirectives as oe, vShow as le, createTextVNode as ge, normalizeStyle as ye, Fragment as U, renderList as W, createCommentVNode as Y, createBlock as C, createVNode as be, Transition as he, withCtx as ae } from "vue";
9
+ import { useWindowSize as re, useEventListener as H, useStorage as me, isClient as _e, useMouse as Q, useMousePressed as xe, useKeyModifier as Z, useFps as we, useRafFn as $e } from "@vueuse/core";
10
+ function E(t) {
11
+ return typeof t == "function" ? t() : F(t);
12
12
  }
13
- const ne = typeof window < "u" && typeof document < "u";
14
- function me(n, l = {}) {
15
- if (!L(n))
16
- return E(n);
17
- const t = Array.isArray(n.value) ? Array.from({ length: n.value.length }) : {};
18
- for (const e in n.value)
19
- t[e] = se(() => ({
13
+ const se = typeof window < "u" && typeof document < "u";
14
+ function Ce(t, i = {}) {
15
+ if (!R(t))
16
+ return X(t);
17
+ const n = Array.isArray(t.value) ? Array.from({ length: t.value.length }) : {};
18
+ for (const o in t.value)
19
+ n[o] = de(() => ({
20
20
  get() {
21
- return n.value[e];
21
+ return t.value[o];
22
22
  },
23
- set(a) {
24
- var r;
25
- if ((r = D(l.replaceRef)) != null ? r : !0)
26
- if (Array.isArray(n.value)) {
27
- const f = [...n.value];
28
- f[e] = a, n.value = f;
23
+ set(e) {
24
+ var u;
25
+ if ((u = E(i.replaceRef)) != null ? u : !0)
26
+ if (Array.isArray(t.value)) {
27
+ const s = [...t.value];
28
+ s[o] = e, t.value = s;
29
29
  } else {
30
- const f = { ...n.value, [e]: a };
31
- Object.setPrototypeOf(f, Object.getPrototypeOf(n.value)), n.value = f;
30
+ const s = { ...t.value, [o]: e };
31
+ Object.setPrototypeOf(s, Object.getPrototypeOf(t.value)), t.value = s;
32
32
  }
33
33
  else
34
- n.value[e] = a;
34
+ t.value[o] = e;
35
35
  }
36
36
  }));
37
- return t;
37
+ return n;
38
38
  }
39
- const _e = ne ? window : void 0;
40
- function xe(n, l = {}) {
39
+ const ke = se ? window : void 0;
40
+ function Me(t, i = {}) {
41
41
  const {
42
- pointerTypes: t,
43
- preventDefault: e,
44
- stopPropagation: a,
45
- exact: r,
46
- onMove: i,
47
- onEnd: f,
48
- onStart: p,
49
- initialValue: w,
50
- axis: c = "both",
51
- draggingElement: o = _e,
52
- handle: u = n
53
- } = l, { width: h } = ee();
54
- let T = h.value;
55
- const s = y(
56
- D(w) ?? { x: 0, y: 0 }
42
+ pointerTypes: n,
43
+ preventDefault: o,
44
+ stopPropagation: e,
45
+ exact: u,
46
+ onMove: a,
47
+ onEnd: s,
48
+ onStart: c,
49
+ initialValue: m,
50
+ axis: h = "both",
51
+ draggingElement: r = ke,
52
+ handle: l = t
53
+ } = i, { width: y } = re();
54
+ let S = y.value;
55
+ const v = f(
56
+ E(m) ?? { x: 0, y: 0 }
57
57
  );
58
- N(h, () => {
59
- const b = h.value - T;
60
- s.value.x += b, T = h.value;
58
+ z(y, () => {
59
+ const g = y.value - S;
60
+ v.value.x += g, S = y.value;
61
61
  });
62
- const m = y(), $ = (b) => t ? t.includes(b.pointerType) : !0, g = (b) => {
63
- D(e) && b.preventDefault(), D(a) && b.stopPropagation();
64
- }, x = (b) => {
65
- if (!$(b) || D(r) && b.target !== D(n))
62
+ const T = f(), D = (g) => n ? n.includes(g.pointerType) : !0, $ = (g) => {
63
+ E(o) && g.preventDefault(), E(e) && g.stopPropagation();
64
+ }, A = (g) => {
65
+ if (!D(g) || E(u) && g.target !== E(t))
66
66
  return;
67
- const V = D(n).getBoundingClientRect(), q = {
68
- x: b.clientX - V.left,
69
- y: b.clientY - V.top
67
+ const b = E(t).getBoundingClientRect(), w = {
68
+ x: g.clientX - b.left,
69
+ y: g.clientY - b.top
70
70
  };
71
- (p == null ? void 0 : p(q, b)) !== !1 && (m.value = q, g(b));
72
- }, ae = (b) => {
73
- if (!$(b) || !m.value)
71
+ (c == null ? void 0 : c(w, g)) !== !1 && (T.value = w, $(g));
72
+ }, V = (g) => {
73
+ if (!D(g) || !T.value)
74
74
  return;
75
- let { x: V, y: q } = s.value;
76
- (c === "x" || c === "both") && (V = b.clientX - m.value.x), (c === "y" || c === "both") && (q = b.clientY - m.value.y), s.value = {
77
- x: V,
78
- y: q
79
- }, i == null || i(s.value, b), g(b);
80
- }, re = (b) => {
81
- $(b) && m.value && (m.value = void 0, f == null || f(s.value, b), g(b));
75
+ let { x: b, y: w } = v.value;
76
+ (h === "x" || h === "both") && (b = g.clientX - T.value.x), (h === "y" || h === "both") && (w = g.clientY - T.value.y), v.value = {
77
+ x: b,
78
+ y: w
79
+ }, a == null || a(v.value, g), $(g);
80
+ }, L = (g) => {
81
+ D(g) && T.value && (T.value = void 0, s == null || s(v.value, g), $(g));
82
82
  };
83
- if (ne) {
84
- const b = { capture: l.capture ?? !0 };
85
- W(u, "pointerdown", x, b), W(o, "pointermove", ae, b), W(o, "pointerup", re, b);
83
+ if (se) {
84
+ const g = { capture: i.capture ?? !0 };
85
+ H(l, "pointerdown", A, g), H(r, "pointermove", V, g), H(r, "pointerup", L, g);
86
86
  }
87
87
  return {
88
- ...me(s),
89
- position: s,
90
- isDragging: K(() => !!m.value),
91
- style: K(
92
- () => `left:${s.value.x}px;top:${s.value.y}px;`
88
+ ...Ce(v),
89
+ position: v,
90
+ isDragging: O(() => !!T.value),
91
+ style: O(
92
+ () => `left:${v.value.x}px;top:${v.value.y}px;`
93
93
  )
94
94
  };
95
95
  }
96
- const we = /* @__PURE__ */ M({
96
+ const Se = /* @__PURE__ */ M({
97
97
  name: "UseDraggable",
98
98
  props: [
99
99
  "storageKey",
@@ -110,136 +110,132 @@ const we = /* @__PURE__ */ M({
110
110
  "onMove",
111
111
  "onEnd"
112
112
  ],
113
- setup(n, { slots: l }) {
114
- const t = y(), e = K(() => n.handle ?? t.value), a = n.storageKey && ge(
115
- n.storageKey,
116
- D(n.initialValue) || { x: 0, y: 0 },
117
- ye ? n.storageType === "session" ? sessionStorage : localStorage : void 0
118
- ), r = a || n.initialValue || { x: 0, y: 0 }, f = z(xe(t, {
119
- ...n,
120
- handle: e,
121
- initialValue: r,
122
- onEnd: (p, w) => {
123
- var c;
124
- (c = n.onEnd) == null || c.call(n, p, w), a && (a.value.x = p.x, a.value.y = p.y);
113
+ setup(t, { slots: i }) {
114
+ const n = f(), o = O(() => t.handle ?? n.value), e = t.storageKey && me(
115
+ t.storageKey,
116
+ E(t.initialValue) || { x: 0, y: 0 },
117
+ _e ? t.storageType === "session" ? sessionStorage : localStorage : void 0
118
+ ), u = e || t.initialValue || { x: 0, y: 0 }, s = N(Me(n, {
119
+ ...t,
120
+ handle: o,
121
+ initialValue: u,
122
+ onEnd: (c, m) => {
123
+ var h;
124
+ (h = t.onEnd) == null || h.call(t, c, m), e && (e.value.x = c.x, e.value.y = c.y);
125
125
  }
126
126
  }));
127
127
  return () => {
128
- if (l.default)
129
- return ie(n.as || "div", { ref: t, style: `touch-action:none;${f.style}` }, l.default(f));
128
+ if (i.default)
129
+ return pe(t.as || "div", { ref: n, style: `touch-action:none;${s.style}` }, i.default(s));
130
130
  };
131
131
  }
132
- }), $e = Symbol("CONTROLS_CONTEXT_KEY"), te = "default", F = z({});
133
- function Ce(n = te) {
134
- return ce($e, F), F[n];
132
+ }), Te = Symbol("CONTROLS_CONTEXT_KEY"), ie = "default", P = N({});
133
+ function Ae(t = ie) {
134
+ return fe(Te, P), P[t];
135
135
  }
136
- const j = (n) => {
137
- const l = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
138
- return typeof n == "boolean" ? "boolean" : typeof n == "number" ? "number" : typeof n == "string" && l.test(n) ? "color" : typeof n == "string" ? "string" : n.isVector3 || n.isVector2 || n.isEuler || n instanceof Array ? "vector" : n.min !== void 0 || n.max !== void 0 || n.step !== void 0 ? "range" : n.options && Array.isArray(n.options) ? "select" : "unknown";
139
- }, X = (n, l, t, e) => {
140
- const a = {
141
- key: y(n),
142
- label: y(n),
143
- name: y(n),
144
- type: y(t),
145
- value: y(l),
146
- visible: y(!0),
147
- [n]: y(l)
136
+ const G = (t) => {
137
+ const i = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
138
+ return typeof t == "boolean" ? "boolean" : typeof t == "number" ? "number" : typeof t == "string" && i.test(t) ? "color" : typeof t == "string" ? "string" : t.isVector3 || t.isVector2 || t.isEuler || t instanceof Array ? "vector" : t.min !== void 0 || t.max !== void 0 || t.step !== void 0 ? "range" : t.options && Array.isArray(t.options) ? "select" : "unknown";
139
+ }, j = (t, i, n, o) => {
140
+ const e = {
141
+ key: f(t),
142
+ label: f(t),
143
+ name: f(t),
144
+ type: f(n),
145
+ value: f(i),
146
+ visible: f(!0),
147
+ [t]: f(i)
148
148
  };
149
- return e && (a.folder = y(e)), a;
150
- }, ke = (n, l) => {
151
- let t = 1, e = `${n}_${t}`;
152
- for (; l[e]; )
153
- t++, e = `${n}_${t}`;
154
- return e;
155
- }, An = (n, l, t) => {
156
- const e = {}, a = typeof n == "string" ? n : null, r = a ? l : n, i = a && a !== "fpsgraph" ? t : l, f = (i == null ? void 0 : i.uuid) || te;
157
- if (F[f] || (F[f] = z({})), n === "fpsgraph") {
158
- const o = X("fpsgraph", null, "fpsgraph", null);
159
- return F[f].fpsgraph = o, e.fpsgraph = o, E(z(e));
149
+ return o && (e.folder = f(o)), e;
150
+ }, Dt = (t, i, n) => {
151
+ const o = {}, e = typeof t == "string" ? t : null, u = e ? i : t, a = e && e !== "fpsgraph" ? n : i, s = (a == null ? void 0 : a.uuid) || ie;
152
+ if (P[s] || (P[s] = N({})), t === "fpsgraph") {
153
+ const r = j("fpsgraph", null, "fpsgraph", null);
154
+ return P[s].fpsgraph = r, o.fpsgraph = r, X(N(o));
160
155
  }
161
- const p = F[f], w = ue(r), c = w ? E(r) : {};
162
- for (const o in r) {
163
- let u = r[o], h = o;
164
- if (w && c[o] && (u = c[o]), a && (h = `${a}${o.charAt(0).toUpperCase() + o.slice(1)}`), !a && p[h] && (h = ke(o, p)), typeof u == "object" && !L(u) && !Array.isArray(u) && u.value !== void 0) {
165
- const s = u, m = L(s.value) ? s.value : y(s.value), $ = j(s), g = X(o, m, $, a);
166
- $ === "select" && (g.options = y(s.options.map((x) => typeof x == "object" && x.text && x.value ? x : {
167
- text: x,
168
- value: x
169
- }))), $ === "range" && (g.min = y(s.min || 0), g.max = y(s.max || 1), g.step = y(s.step || 0.1)), g.label.value = s.label || o, g.visible.value = s.visible !== void 0 ? s.visible : !0, p[h] = g, e[h] = g;
156
+ const c = P[s], m = ve(u), h = m ? X(u) : {};
157
+ for (const r in u) {
158
+ let l = u[r], y = r;
159
+ if (m && h[r] && (l = h[r]), e && (y = `${e}${r.charAt(0).toUpperCase() + r.slice(1)}`), typeof l == "object" && !R(l) && !Array.isArray(l) && l.value !== void 0) {
160
+ const v = l, T = R(v.value) ? v.value : f(v.value), D = G(v), $ = j(r, T, D, e);
161
+ D === "select" && ($.options = f(v.options.map((A) => typeof A == "object" && A.text && A.value ? A : {
162
+ text: A,
163
+ value: A
164
+ }))), D === "range" && ($.min = f(v.min || 0), $.max = f(v.max || 1), $.step = f(v.step || 0.1)), $.label.value = v.label || r, $.visible.value = v.visible !== void 0 ? v.visible : !0, c[y] = $, o[y] = $;
170
165
  continue;
171
166
  }
172
- if (L(u)) {
173
- const s = X(o, u, j(u.value), a);
174
- p[h] = s, e[h] = s;
167
+ if (R(l)) {
168
+ const v = j(r, l, G(l.value), e);
169
+ c[y] = v, o[y] = v;
175
170
  continue;
176
- } else if (typeof u == "object" && !Array.isArray(u)) {
177
- const s = E(u);
178
- s[o] && (u = s[o]);
171
+ } else if (typeof l == "object" && !Array.isArray(l)) {
172
+ const v = X(l);
173
+ v[r] && (l = v[r]);
179
174
  }
180
- const T = X(o, u, j(u), a);
181
- p[h] = T, e[h] = T, T.uniqueKey = h;
175
+ const S = j(r, l, G(l), e);
176
+ c[y] = S, o[y] = S, S.uniqueKey = y;
182
177
  }
183
- return Object.keys(e).length > 1 ? E(z(e)) : Object.values(e)[0];
184
- }, Me = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Se = ["for"], Te = ["id", "value", "min", "max", "step"], Ae = /* @__PURE__ */ M({
178
+ return Object.keys(o).length > 1 ? X(N(o)) : Object.values(o)[0];
179
+ }, Ie = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Ke = ["for"], De = ["id", "value", "min", "max", "step"], Fe = /* @__PURE__ */ M({
185
180
  __name: "NumberControl",
186
181
  props: {
187
182
  label: {},
188
183
  control: {}
189
184
  },
190
185
  emits: ["change"],
191
- setup(n, { emit: l }) {
192
- const t = n;
193
- function e(c) {
194
- const { target: o } = c;
195
- l("change", o.valueAsNumber);
186
+ setup(t, { emit: i }) {
187
+ const n = t, o = i;
188
+ function e(r) {
189
+ const { target: l } = r;
190
+ o("change", l.valueAsNumber);
196
191
  }
197
- const a = R(), r = y(0), i = y(!1), f = (c) => {
198
- r.value = c.clientX, i.value = !0;
199
- }, p = () => {
200
- i.value = !1;
201
- }, w = (c) => Math.floor(Math.abs(c) / 10);
202
- return N(a.x, (c) => {
203
- if (i.value) {
204
- const o = c - r.value, u = w(o);
205
- o > 0 ? l("change", t.control.value + 1 + u) : o < 0 && l("change", t.control.value - 1 + u), t.control.min !== void 0 && t.control.value < t.control.min && l("change", t.control.min), t.control.max !== void 0 && t.control.value > t.control.max && l("change", t.control.max), r.value = c;
192
+ const u = Q(), a = f(0), s = f(!1), c = (r) => {
193
+ a.value = r.clientX, s.value = !0;
194
+ }, m = () => {
195
+ s.value = !1;
196
+ }, h = (r) => Math.floor(Math.abs(r) / 10);
197
+ return z(u.x, (r) => {
198
+ if (s.value) {
199
+ const l = r - a.value, y = h(l);
200
+ l > 0 ? o("change", n.control.value + 1 + y) : l < 0 && o("change", n.control.value - 1 + y), n.control.min !== void 0 && n.control.value < n.control.min && o("change", n.control.min), n.control.max !== void 0 && n.control.value > n.control.max && o("change", n.control.max), a.value = r;
206
201
  }
207
- }), (c, o) => (v(), _("div", Me, [
202
+ }), (r, l) => (p(), x("div", Ie, [
208
203
  d("label", {
209
204
  class: "text-gray-500 w-1/3",
210
- for: c.control.uniqueKey
211
- }, k(c.label), 9, Se),
205
+ for: r.control.uniqueKey
206
+ }, k(r.label), 9, Ke),
212
207
  d("input", {
213
- id: c.control.uniqueKey,
214
- value: c.control.value,
215
- class: S(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": i.value }]),
208
+ id: r.control.uniqueKey,
209
+ value: r.control.value,
210
+ class: K(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": s.value }]),
216
211
  type: "number",
217
- min: c.control.min,
218
- max: c.control.max,
219
- step: c.control.step,
212
+ min: r.control.min,
213
+ max: r.control.max,
214
+ step: r.control.step,
220
215
  onInput: e,
221
- onMousedown: f,
222
- onMouseup: p
223
- }, null, 42, Te)
216
+ onMousedown: c,
217
+ onMouseup: m
218
+ }, null, 42, De)
224
219
  ]));
225
220
  }
226
- }), De = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Ie = ["for"], Ke = ["id", "value", "aria-label"], Ee = /* @__PURE__ */ M({
221
+ }), Ee = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Ve = ["for"], qe = ["id", "value", "aria-label"], ze = /* @__PURE__ */ M({
227
222
  __name: "TextControl",
228
223
  props: {
229
224
  label: {},
230
225
  control: {}
231
226
  },
232
227
  emits: ["change"],
233
- setup(n, { emit: l }) {
234
- function t(e) {
235
- const { target: a } = e;
236
- l("change", a.value);
228
+ setup(t, { emit: i }) {
229
+ const n = i;
230
+ function o(e) {
231
+ const { target: u } = e;
232
+ n("change", u.value);
237
233
  }
238
- return (e, a) => (v(), _("div", De, [
234
+ return (e, u) => (p(), x("div", Ee, [
239
235
  d("label", {
240
236
  for: e.control.uniqueKey,
241
237
  class: "text-gray-500 w-1/3"
242
- }, k(e.label), 9, Ie),
238
+ }, k(e.label), 9, Ve),
243
239
  d("input", {
244
240
  id: e.control.uniqueKey,
245
241
  value: e.control.value,
@@ -248,139 +244,140 @@ const j = (n) => {
248
244
  class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 border-none font-sans",
249
245
  "aria-label": e.label,
250
246
  placeholder: "Enter value here...",
251
- onChange: t
252
- }, null, 40, Ke)
247
+ onChange: o
248
+ }, null, 40, qe)
253
249
  ]));
254
250
  }
255
- }), Fe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, Ve = { class: "text-gray-500 w-1/3" }, qe = ["id", "checked"], Ue = ["for"], ze = ["aria-checked"], Oe = { class: "i-ic:baseline-check text-light" }, Xe = /* @__PURE__ */ M({
251
+ }), Ue = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, Oe = { class: "text-gray-500 w-1/3" }, Xe = ["id", "checked"], Pe = ["for"], Le = ["aria-checked"], Be = { class: "i-ic:baseline-check text-light" }, Ne = /* @__PURE__ */ M({
256
252
  __name: "BooleanControl",
257
253
  props: {
258
254
  label: {},
259
255
  control: {}
260
256
  },
261
257
  emits: ["change"],
262
- setup(n, { emit: l }) {
263
- const t = n;
264
- function e(r) {
265
- const { target: i } = r;
266
- l("change", i.checked);
258
+ setup(t, { emit: i }) {
259
+ const n = t, o = i;
260
+ function e(a) {
261
+ const { target: s } = a;
262
+ o("change", s.checked);
267
263
  }
268
- function a(r) {
269
- (r.code === "Space" || r.code === "Enter") && (r.preventDefault(), l("change", !t.control.value));
264
+ function u(a) {
265
+ (a.code === "Space" || a.code === "Enter") && (a.preventDefault(), o("change", !n.control.value));
270
266
  }
271
- return (r, i) => (v(), _("div", Fe, [
272
- d("label", Ve, k(r.label), 1),
267
+ return (a, s) => (p(), x("div", Ue, [
268
+ d("label", Oe, k(a.label), 1),
273
269
  d("input", {
274
- id: r.control.uniqueKey,
275
- checked: r.control.value,
270
+ id: a.control.uniqueKey,
271
+ checked: a.control.value,
276
272
  class: "hidden",
277
273
  type: "checkbox",
278
274
  onInput: e
279
- }, null, 40, qe),
275
+ }, null, 40, Xe),
280
276
  d("label", {
281
- for: r.control.uniqueKey,
277
+ for: a.control.uniqueKey,
282
278
  class: "inline-flex items-center cursor-pointer"
283
279
  }, [
284
280
  d("span", {
285
281
  tabindex: "0",
286
282
  role: "checkbox",
287
- "aria-checked": r.control.value.toString(),
288
- class: S([{ "bg-dark-500": r.control.value, "bg-gray-200": !r.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"]),
289
- onKeydown: a
283
+ "aria-checked": a.control.value.toString(),
284
+ class: K([{ "bg-dark-500": a.control.value, "bg-gray-200": !a.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"]),
285
+ onKeydown: u
290
286
  }, [
291
- J(d("i", Oe, null, 512), [
292
- [Q, r.control.value]
287
+ oe(d("i", Be, null, 512), [
288
+ [le, a.control.value]
293
289
  ])
294
- ], 42, ze)
295
- ], 8, Ue)
290
+ ], 42, Le)
291
+ ], 8, Pe)
296
292
  ]));
297
293
  }
298
- }), Le = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, Pe = ["value", "min", "max", "step"], Ne = ["value", "min", "max", "step"], We = /* @__PURE__ */ M({
294
+ }), We = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, je = ["value", "min", "max", "step"], Re = ["value", "min", "max", "step"], Ye = /* @__PURE__ */ M({
299
295
  __name: "SliderControl",
300
296
  props: {
301
297
  label: {},
302
298
  control: {}
303
299
  },
304
300
  emits: ["change"],
305
- setup(n, { emit: l }) {
306
- const t = n;
307
- function e(o) {
308
- const { target: u } = o;
309
- l("change", u.valueAsNumber);
301
+ setup(t, { emit: i }) {
302
+ const n = t, o = i;
303
+ function e(l) {
304
+ const { target: y } = l;
305
+ o("change", y.valueAsNumber);
310
306
  }
311
- const a = K(() => ({
312
- backgroundImage: `linear-gradient(to right, #333 0% ${100 * (t.control.value - (t.control.min || 0)) / ((t.control.max || 100) - (t.control.min || 0))}%, #e2e2e2 0%)`
313
- })), r = R(), i = y(0), f = y(!1), p = (o) => {
314
- i.value = o.clientX, f.value = !0;
315
- }, w = () => {
316
- f.value = !1;
317
- }, c = (o) => Math.floor(Math.abs(o) / 10);
318
- return N(r.x, (o) => {
319
- if (f.value) {
320
- const u = o - i.value, h = c(u);
321
- u > 0 ? l("change", t.control.value + 1 + h) : u < 0 && l("change", t.control.value - 1 + h), t.control.min !== void 0 && t.control.value < t.control.min && l("change", t.control.min), t.control.max !== void 0 && t.control.value > t.control.max && l("change", t.control.max), i.value = o;
307
+ const u = O(() => ({
308
+ backgroundImage: `linear-gradient(to right, #333 0% ${100 * (n.control.value - (n.control.min || 0)) / ((n.control.max || 100) - (n.control.min || 0))}%, #e2e2e2 0%)`
309
+ })), a = Q(), s = f(0), c = f(!1), m = (l) => {
310
+ s.value = l.clientX, c.value = !0;
311
+ }, h = () => {
312
+ c.value = !1;
313
+ }, r = (l) => Math.floor(Math.abs(l) / 10);
314
+ return z(a.x, (l) => {
315
+ if (c.value) {
316
+ const y = l - s.value, S = r(y);
317
+ y > 0 ? o("change", n.control.value + 1 + S) : y < 0 && o("change", n.control.value - 1 + S), n.control.min !== void 0 && n.control.value < n.control.min && o("change", n.control.min), n.control.max !== void 0 && n.control.value > n.control.max && o("change", n.control.max), s.value = l;
322
318
  }
323
- }), (o, u) => (v(), _("div", Le, [
319
+ }), (l, y) => (p(), x("div", We, [
324
320
  d("label", {
325
- class: S(["text-gray-500 w-1/3", { "flex justify-between items-center": o.control.icon }])
321
+ class: K(["text-gray-500 w-1/3", { "flex justify-between items-center": l.control.icon }])
326
322
  }, [
327
- de(k(o.label) + " ", 1),
323
+ ge(k(l.label) + " ", 1),
328
324
  d("i", {
329
- class: S(`i-${o.control.icon}`)
325
+ class: K(`i-${l.control.icon}`)
330
326
  }, null, 2)
331
327
  ], 2),
332
328
  d("input", {
333
- value: o.control.value,
329
+ value: l.control.value,
334
330
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
335
- style: fe(a.value),
331
+ style: ye(u.value),
336
332
  type: "range",
337
- min: o.control.min,
338
- max: o.control.max,
339
- step: o.control.step,
333
+ min: l.control.min,
334
+ max: l.control.max,
335
+ step: l.control.step,
340
336
  onInput: e
341
- }, null, 44, Pe),
337
+ }, null, 44, je),
342
338
  d("input", {
343
- value: o.control.value,
344
- class: S(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": f.value }]),
339
+ value: l.control.value,
340
+ class: K(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": c.value }]),
345
341
  type: "number",
346
- min: o.control.min,
347
- max: o.control.max,
348
- step: o.control.step,
342
+ min: l.control.min,
343
+ max: l.control.max,
344
+ step: l.control.step,
349
345
  onInput: e,
350
- onMousedown: p,
351
- onMouseup: w
352
- }, null, 42, Ne)
346
+ onMousedown: m,
347
+ onMouseup: h
348
+ }, null, 42, Re)
353
349
  ]));
354
350
  }
355
351
  });
356
- const je = (n, l) => {
357
- const t = n.__vccOpts || n;
358
- for (const [e, a] of l)
359
- t[e] = a;
360
- return t;
361
- }, Be = /* @__PURE__ */ je(We, [["__scopeId", "data-v-9e6267fe"]]), Re = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Ye = { class: "text-gray-500 w-1/3" }, He = ["id", "value", "aria-label"], Ge = ["id", "aria-label", "value"], Je = /* @__PURE__ */ M({
352
+ const He = (t, i) => {
353
+ const n = t.__vccOpts || t;
354
+ for (const [o, e] of i)
355
+ n[o] = e;
356
+ return n;
357
+ }, Ge = /* @__PURE__ */ He(Ye, [["__scopeId", "data-v-9e6267fe"]]), Je = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Qe = { class: "text-gray-500 w-1/3" }, Ze = ["id", "value", "aria-label"], et = ["id", "aria-label", "value"], tt = /* @__PURE__ */ M({
362
358
  __name: "ColorControl",
363
359
  props: {
364
360
  label: {},
365
361
  control: {}
366
362
  },
367
363
  emits: ["change"],
368
- setup(n, { emit: l }) {
369
- function t(e) {
370
- const { target: a } = e;
371
- l("change", a.value);
364
+ setup(t, { emit: i }) {
365
+ const n = i;
366
+ function o(e) {
367
+ const { target: u } = e;
368
+ n("change", u.value);
372
369
  }
373
- return (e, a) => (v(), _("div", Re, [
374
- d("label", Ye, k(e.label), 1),
370
+ return (e, u) => (p(), x("div", Je, [
371
+ d("label", Qe, k(e.label), 1),
375
372
  d("input", {
376
373
  id: e.control.uniqueKey,
377
374
  tabindex: "0",
378
375
  value: e.control.value,
379
376
  "aria-label": e.label,
380
- class: S(["focus:outline-none focus:ring-2 focus:ring-blue-600", { "important-outline-gray-200": e.control.value === "#ffffff" }]),
377
+ class: K(["focus:outline-none focus:ring-2 focus:ring-blue-600", { "important-outline-gray-200": e.control.value === "#ffffff" }]),
381
378
  type: "color",
382
- onInput: t
383
- }, null, 42, He),
379
+ onInput: o
380
+ }, null, 42, Ze),
384
381
  d("input", {
385
382
  id: e.control.uniqueKey,
386
383
  tabindex: "0",
@@ -388,300 +385,318 @@ const je = (n, l) => {
388
385
  value: e.control.value,
389
386
  class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 border-none font-sans",
390
387
  type: "text",
391
- onInput: t
392
- }, null, 40, Ge)
388
+ onInput: o
389
+ }, null, 40, et)
393
390
  ]));
394
391
  }
395
392
  });
396
- function Qe(n) {
397
- if (typeof n == "number")
398
- return [n, n, n];
399
- if (oe(n)) {
400
- const { x: l, y: t, z: e } = n;
401
- return [l, t, e];
393
+ function nt(t) {
394
+ if (typeof t == "number")
395
+ return [t, t, t];
396
+ if (ce(t)) {
397
+ const { x: i, y: n, z: o } = t;
398
+ return [i, n, o];
402
399
  }
403
- return n;
400
+ return t;
404
401
  }
405
- function Ze(n) {
406
- return n && typeof n.x == "number" && typeof n.y == "number" && typeof n.z > "u";
402
+ function ot(t) {
403
+ return t && typeof t.x == "number" && typeof t.y == "number" && typeof t.z > "u";
407
404
  }
408
- function oe(n) {
409
- return n && typeof n.x == "number" && typeof n.y == "number" && typeof n.z == "number";
405
+ function ce(t) {
406
+ return t && typeof t.x == "number" && typeof t.y == "number" && typeof t.z == "number";
410
407
  }
411
- const en = { class: "text-gray-500 w-1/3" }, nn = { class: "w-2/3 flex justify-between gap-0.5" }, tn = {
408
+ const lt = { class: "text-gray-500 w-1/3" }, at = { class: "relative w-2/3 flex justify-between gap-0.5" }, rt = {
412
409
  key: 0,
413
410
  class: "font-bold px-1 py-1 text-0.65rem text-gray-300"
414
- }, on = ["id", "value", "onInput", "onMousedown", "onMouseup"], ln = /* @__PURE__ */ M({
411
+ }, st = ["id", "step", "value", "onInput", "onMousedown", "onMouseup", "onFocus"], it = /* @__PURE__ */ M({
415
412
  __name: "VectorControl",
416
413
  props: {
417
414
  label: {},
418
415
  control: {}
419
416
  },
420
417
  emits: ["change"],
421
- setup(n, { emit: l }) {
422
- const t = n, e = R(), a = y(0), r = y(!1), i = y(0), f = (s, m) => {
423
- i.value = m, a.value = s.clientX, r.value = !0;
424
- }, p = (s, m) => {
425
- i.value = m, r.value = !1;
426
- }, w = () => {
427
- r.value = !1;
428
- }, c = (s) => Math.floor(Math.abs(s) / 10), o = K(() => Qe(t.control.value)), u = y(["x", "y", "z"]), h = K(() => Ze(t.control.value) || oe(t.control.value));
429
- function T(s, m) {
430
- const { value: $ } = t.control, { target: g } = s;
431
- i.value = m, $[h.value ? u.value[i.value] : i.value] = parseFloat(g.value), l("change", $);
418
+ setup(t, { emit: i }) {
419
+ const n = t, o = i, e = Q(), { pressed: u } = xe(), a = f(0), s = f(!1), c = f(0), m = f(null), h = f(1), r = Z("Shift"), l = Z("Alt");
420
+ z(r, (b) => {
421
+ h.value = b ? 10 : 1;
422
+ }), z(l, (b) => {
423
+ h.value = b ? 0.1 : 1;
424
+ });
425
+ const y = (b) => {
426
+ m.value = b;
427
+ }, S = () => {
428
+ m.value = null;
429
+ }, v = (b, w) => {
430
+ c.value = w, a.value = b.clientX, s.value = !0;
431
+ }, T = (b, w) => {
432
+ c.value = w, s.value = !1;
433
+ }, D = () => {
434
+ s.value = !1;
435
+ };
436
+ z(u, (b) => {
437
+ b || (s.value = !1);
438
+ });
439
+ const $ = (b) => Math.floor(Math.abs(b) / 10), A = O(() => nt(n.control.value)), V = f(["x", "y", "z"]), L = O(() => ot(n.control.value) || ce(n.control.value));
440
+ function g(b, w) {
441
+ const { value: q } = n.control, { target: _ } = b;
442
+ c.value = w, q[L.value ? V.value[c.value] : c.value] = parseFloat(_.value), o("change", q);
432
443
  }
433
- return N(e.x, (s) => {
434
- if (r.value) {
435
- const m = s - a.value, $ = c(m), { value: g } = t.control, x = h.value ? u.value[i.value] : i.value;
436
- m > 0 ? g[x] += 0.1 + $ : m < 0 && (g[x] -= 0.1 + $), t.control.min !== void 0 && g < t.control.min && (g[x] = t.control.min), t.control.max !== void 0 && g > t.control.max && (g[x] = t.control.max), l("change", g), a.value = s;
444
+ return z(e.x, (b) => {
445
+ if (s.value) {
446
+ const w = b - a.value, q = $(w), { value: _ } = n.control, I = L.value ? V.value[c.value] : c.value;
447
+ w > 0 ? _[I] += h.value + q : w < 0 && (_[I] -= h.value + q), n.control.min !== void 0 && _ < n.control.min && (_[I] = n.control.min), n.control.max !== void 0 && _ > n.control.max && (_[I] = n.control.max), o("change", _), a.value = b;
437
448
  }
438
- }), (s, m) => (v(), _("div", {
449
+ }), (b, w) => (p(), x("div", {
439
450
  class: "flex px-4 justify-between gap-1 items-center mb-2",
440
- onMouseup: m[0] || (m[0] = ($) => w())
451
+ onMouseup: w[0] || (w[0] = (q) => D())
441
452
  }, [
442
- d("label", en, k(s.label), 1),
443
- d("div", nn, [
444
- (v(!0), _(I, null, O(o.value, ($, g) => (v(), _("div", {
445
- key: s.label + g,
446
- class: "flex items-center w-1/3 bg-gray-100 rounded"
453
+ d("label", lt, k(b.label), 1),
454
+ d("div", at, [
455
+ (p(!0), x(U, null, W(A.value, (q, _) => (p(), x("div", {
456
+ key: b.label + _,
457
+ class: K(["flex items-center w-1/3 bg-gray-100 rounded", { "w-2/5": m.value === _ }])
447
458
  }, [
448
- u.value[g] && h.value ? (v(), _("span", tn, k(u.value[g]), 1)) : P("", !0),
459
+ V.value[_] && L.value ? (p(), x("span", rt, k(V.value[_]), 1)) : Y("", !0),
449
460
  d("input", {
450
- id: `${s.control.uniqueKey}-${u.value[g]}`,
461
+ id: `${b.control.uniqueKey}-${V.value[_]}`,
451
462
  type: "number",
452
- step: "0.1",
453
- class: S(["w-full px-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans appearence-none", { "cursor-ew-resize": r.value }]),
454
- value: o.value[g].toFixed(2),
455
- onInput: (x) => T(x, g),
456
- onMousedown: (x) => f(x, g),
457
- onMouseup: (x) => p(x, g)
458
- }, null, 42, on)
459
- ]))), 128))
463
+ step: h.value,
464
+ class: K(["w-full px-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans appearence-none", { "cursor-ew-resize": s.value }]),
465
+ value: A.value[_].toFixed(2),
466
+ onInput: (I) => g(I, _),
467
+ onMousedown: (I) => v(I, _),
468
+ onMouseup: (I) => T(I, _),
469
+ onFocus: (I) => y(_),
470
+ onBlur: S
471
+ }, null, 42, st)
472
+ ], 2))), 128))
460
473
  ])
461
474
  ], 32));
462
475
  }
463
- }), an = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, rn = { class: "text-gray-500 w-1/3" }, sn = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, cn = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, un = ["points"], Y = 160, B = 40, U = 2, H = 100, G = 20, dn = /* @__PURE__ */ M({
476
+ }), ct = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, ut = { class: "text-gray-500 w-1/3" }, dt = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, pt = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, ft = ["points"], ee = 160, J = 40, B = 2, te = 100, ne = 20, vt = /* @__PURE__ */ M({
464
477
  __name: "FPSGraph",
465
478
  props: {
466
479
  label: {},
467
480
  control: {}
468
481
  },
469
- setup(n) {
470
- const l = be({ every: H }), t = y(""), e = y([]), a = y(Y / U);
471
- let r = performance.now();
472
- return he(({ timestamp: i }) => {
473
- i - r >= H && (r = i, e.value.push(l.value), e.value.length > a.value && e.value.shift(), t.value = e.value.map(
474
- (f, p) => `${p * U},${B + G - U / 2 - f * (B + G - U) / 120}`
482
+ setup(t) {
483
+ const i = we({ every: te }), n = f(""), o = f([]), e = f(ee / B);
484
+ let u = performance.now();
485
+ return $e(({ timestamp: a }) => {
486
+ a - u >= te && (u = a, o.value.push(i.value), o.value.length > e.value && o.value.shift(), n.value = o.value.map(
487
+ (s, c) => `${c * B},${J + ne - B / 2 - s * (J + ne - B) / 120}`
475
488
  ).join(" "));
476
- }), (i, f) => (v(), _("div", an, [
477
- d("label", rn, k(i.label), 1),
478
- d("div", sn, [
479
- d("div", cn, k(Math.round(A(l))) + " FPS ", 1),
480
- (v(), _("svg", {
481
- width: Y,
482
- height: B,
489
+ }), (a, s) => (p(), x("div", ct, [
490
+ d("label", ut, k(a.label), 1),
491
+ d("div", dt, [
492
+ d("div", pt, k(Math.round(F(i))) + " FPS ", 1),
493
+ (p(), x("svg", {
494
+ width: ee,
495
+ height: J,
483
496
  xmlns: "http://www.w3.org/2000/svg",
484
497
  class: "bg-gray-100"
485
498
  }, [
486
499
  d("polyline", {
487
- points: t.value,
500
+ points: n.value,
488
501
  fill: "none",
489
502
  stroke: "lightgray",
490
- "stroke-width": U,
503
+ "stroke-width": B,
491
504
  "stroke-linecap": "round",
492
505
  "stroke-linejoin": "round"
493
- }, null, 8, un)
506
+ }, null, 8, ft)
494
507
  ]))
495
508
  ])
496
509
  ]));
497
510
  }
498
- }), fn = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, pn = ["for"], vn = ["id", "value"], gn = ["value"], yn = /* @__PURE__ */ M({
511
+ }), gt = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, yt = ["for"], bt = ["id", "value"], ht = ["value"], mt = /* @__PURE__ */ M({
499
512
  __name: "SelectControl",
500
513
  props: {
501
514
  label: {},
502
515
  control: {}
503
516
  },
504
517
  emits: ["change"],
505
- setup(n, { emit: l }) {
506
- function t(e) {
507
- l("change", e.target.value);
518
+ setup(t, { emit: i }) {
519
+ const n = i;
520
+ function o(e) {
521
+ n("change", e.target.value);
508
522
  }
509
- return (e, a) => (v(), _("div", fn, [
523
+ return (e, u) => (p(), x("div", gt, [
510
524
  d("label", {
511
525
  class: "text-gray-500 w-1/3",
512
526
  for: e.control.uniqueKey
513
- }, k(e.label), 9, pn),
527
+ }, k(e.label), 9, yt),
514
528
  d("select", {
515
529
  id: e.control.uniqueKey,
516
530
  value: e.control.value,
517
531
  class: "p-2 w-2/3 rounded text-left text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
518
- onChange: t
532
+ onChange: o
519
533
  }, [
520
- (v(!0), _(I, null, O(e.control.options, (r) => (v(), _("option", {
521
- key: r.value,
522
- value: r.value
523
- }, k(r.text), 9, gn))), 128))
524
- ], 40, vn)
534
+ (p(!0), x(U, null, W(e.control.options, (a) => (p(), x("option", {
535
+ key: a.value,
536
+ value: a.value
537
+ }, k(a.text), 9, ht))), 128))
538
+ ], 40, bt)
525
539
  ]));
526
540
  }
527
- }), le = /* @__PURE__ */ M({
541
+ }), ue = /* @__PURE__ */ M({
528
542
  __name: "ControlInput",
529
543
  props: {
530
544
  control: {}
531
545
  },
532
546
  emits: ["change"],
533
- setup(n, { emit: l }) {
534
- function t(e) {
535
- l("change", e);
547
+ setup(t, { emit: i }) {
548
+ const n = i;
549
+ function o(e) {
550
+ n("change", e);
536
551
  }
537
- return (e, a) => e.control.visible ? (v(), _(I, { key: 0 }, [
538
- e.control.type === "color" ? (v(), C(Je, {
552
+ return (e, u) => e.control.visible ? (p(), x(U, { key: 0 }, [
553
+ e.control.type === "color" ? (p(), C(tt, {
539
554
  key: 0,
540
555
  label: e.control.label,
541
556
  control: e.control,
542
- onChange: t
543
- }, null, 8, ["label", "control"])) : e.control.type === "select" ? (v(), C(yn, {
557
+ onChange: o
558
+ }, null, 8, ["label", "control"])) : e.control.type === "select" ? (p(), C(mt, {
544
559
  key: 1,
545
560
  label: e.control.label,
546
561
  control: e.control,
547
- onChange: t
548
- }, null, 8, ["label", "control"])) : e.control.type === "vector" ? (v(), C(ln, {
562
+ onChange: o
563
+ }, null, 8, ["label", "control"])) : e.control.type === "vector" ? (p(), C(it, {
549
564
  key: 2,
550
565
  label: e.control.label,
551
566
  control: e.control,
552
- onChange: t
553
- }, null, 8, ["label", "control"])) : e.control.type === "boolean" ? (v(), C(Xe, {
567
+ onChange: o
568
+ }, null, 8, ["label", "control"])) : e.control.type === "boolean" ? (p(), C(Ne, {
554
569
  key: 3,
555
570
  label: e.control.label,
556
571
  control: e.control,
557
- onChange: t
558
- }, null, 8, ["label", "control"])) : e.control.type === "fpsgraph" ? (v(), C(dn, {
572
+ onChange: o
573
+ }, null, 8, ["label", "control"])) : e.control.type === "fpsgraph" ? (p(), C(vt, {
559
574
  key: 4,
560
575
  label: e.control.label,
561
576
  control: e.control
562
- }, null, 8, ["label", "control"])) : e.control.type === "number" ? (v(), C(Ae, {
577
+ }, null, 8, ["label", "control"])) : e.control.type === "number" ? (p(), C(Fe, {
563
578
  key: 5,
564
579
  label: e.control.label,
565
580
  control: e.control,
566
- onChange: t
567
- }, null, 8, ["label", "control"])) : e.control.type === "range" ? (v(), C(Be, {
581
+ onChange: o
582
+ }, null, 8, ["label", "control"])) : e.control.type === "range" ? (p(), C(Ge, {
568
583
  key: 6,
569
584
  label: e.control.label,
570
585
  control: e.control,
571
- onChange: t
572
- }, null, 8, ["label", "control"])) : (v(), C(Ee, {
586
+ onChange: o
587
+ }, null, 8, ["label", "control"])) : (p(), C(ze, {
573
588
  key: 7,
574
589
  label: e.control.label,
575
590
  control: e.control,
576
- onChange: t
591
+ onChange: o
577
592
  }, null, 8, ["label", "control"]))
578
- ], 64)) : P("", !0);
593
+ ], 64)) : Y("", !0);
579
594
  }
580
- }), bn = { class: "mb-4" }, hn = ["aria-expanded", "data-folder"], mn = {
595
+ }), _t = { class: "mb-4" }, xt = ["aria-expanded", "data-folder"], wt = {
581
596
  class: "bg-white rounded-b pt-4",
582
597
  role: "menu"
583
- }, _n = /* @__PURE__ */ M({
598
+ }, $t = /* @__PURE__ */ M({
584
599
  __name: "Folder",
585
600
  props: {
586
601
  controls: {},
587
602
  label: {}
588
603
  },
589
- setup(n) {
590
- function l(a, r) {
591
- r.value = a;
604
+ setup(t) {
605
+ function i(e, u) {
606
+ u.value = e;
592
607
  }
593
- const t = y(!1), e = () => {
594
- t.value = !t.value;
608
+ const n = f(!1), o = () => {
609
+ n.value = !n.value;
595
610
  };
596
- return (a, r) => (v(), _("div", bn, [
611
+ return (e, u) => (p(), x("div", _t, [
597
612
  d("button", {
598
613
  class: "flex items-center justify-between w-full py-2 px-4 bg-gray-100 border-none text-gray-400 font-bold text-xs font-sans cursor-pointer",
599
- "aria-expanded": t.value,
614
+ "aria-expanded": n.value,
600
615
  "aria-haspopup": "true",
601
616
  role: "button",
602
- "data-folder": a.label,
617
+ "data-folder": e.label,
603
618
  tabindex: "0",
604
- onClick: e
619
+ onClick: o
605
620
  }, [
606
- d("span", null, k(a.label), 1),
621
+ d("span", null, k(e.label), 1),
607
622
  d("i", {
608
- class: S(t.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
623
+ class: K(n.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
609
624
  }, null, 2)
610
- ], 8, hn),
611
- pe(ve, {
625
+ ], 8, xt),
626
+ be(he, {
612
627
  name: "slide",
613
628
  "enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
614
629
  "leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
615
630
  }, {
616
- default: Z(() => [
617
- J(d("div", mn, [
618
- (v(!0), _(I, null, O(a.controls, (i) => (v(), C(le, {
619
- key: i.label,
620
- control: i,
631
+ default: ae(() => [
632
+ oe(d("div", wt, [
633
+ (p(!0), x(U, null, W(e.controls, (a) => (p(), C(ue, {
634
+ key: a.label,
635
+ control: a,
621
636
  role: "menuitem",
622
- onChange: (f) => l(f, i)
637
+ onChange: (s) => i(s, a)
623
638
  }, null, 8, ["control", "onChange"]))), 128))
624
639
  ], 512), [
625
- [Q, t.value]
640
+ [le, n.value]
626
641
  ])
627
642
  ]),
628
643
  _: 1
629
644
  })
630
645
  ]));
631
646
  }
632
- }), xn = {
647
+ }), Ct = {
633
648
  tabindex: "0",
634
649
  class: "bg-white shadow-xl rounded border-4 border-solid border-black"
635
- }, wn = /* @__PURE__ */ d("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), $n = /* @__PURE__ */ d("div", null, [
650
+ }, kt = /* @__PURE__ */ d("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), Mt = /* @__PURE__ */ d("div", null, [
636
651
  /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" }),
637
652
  /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" }),
638
653
  /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" })
639
- ], -1), Cn = /* @__PURE__ */ d("div", null, null, -1), kn = [
640
- wn,
641
- $n,
642
- Cn
643
- ], Mn = 280, Dn = /* @__PURE__ */ M({
654
+ ], -1), St = /* @__PURE__ */ d("div", null, null, -1), Tt = [
655
+ kt,
656
+ Mt,
657
+ St
658
+ ], At = 280, Ft = /* @__PURE__ */ M({
644
659
  __name: "TresLeches",
645
660
  props: {
646
661
  uuid: {}
647
662
  },
648
- setup(n) {
649
- const l = n, { uuid: t } = E(l), { width: e } = ee(), a = y(null), r = Ce(t == null ? void 0 : t.value);
650
- function i(p, w) {
651
- r[A(p)].value = w, r[A(p)][A(p)] = w;
663
+ setup(t) {
664
+ const i = t, { uuid: n } = X(i), { width: o } = re(), e = f(null), u = Ae(n == null ? void 0 : n.value);
665
+ function a(c, m) {
666
+ u[F(c)].value = m, u[F(c)][F(c)] = m;
652
667
  }
653
- const f = K(() => {
654
- const p = {};
655
- for (const w in r) {
656
- const c = r[w], o = c.folder || "default";
657
- p[o] || (p[o] = []), p[o].push(c);
668
+ const s = O(() => {
669
+ const c = {};
670
+ for (const m in u) {
671
+ const h = u[m], r = h.folder || "default";
672
+ c[r] || (c[r] = []), c[r].push(h);
658
673
  }
659
- return p;
674
+ return c;
660
675
  });
661
- return (p, w) => (v(), C(A(we), {
662
- id: A(t),
663
- "initial-value": { x: A(e) - Mn - 40, y: 10 },
664
- class: S(["absolute select-none z-24 w-280px font-sans text-xs", p.$attrs.class]),
665
- handle: a.value
676
+ return (c, m) => (p(), C(F(Se), {
677
+ id: F(n),
678
+ "initial-value": { x: F(o) - At - 40, y: 10 },
679
+ class: K(["absolute select-none z-24 w-280px font-sans text-xs", c.$attrs.class]),
680
+ handle: e.value
666
681
  }, {
667
- default: Z(() => [
668
- d("div", xn, [
682
+ default: ae(() => [
683
+ d("div", Ct, [
669
684
  d("header", {
670
685
  ref_key: "handle",
671
- ref: a,
686
+ ref: e,
672
687
  class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
673
- }, kn, 512),
674
- (v(!0), _(I, null, O(f.value, (c, o) => (v(), _(I, { key: o }, [
675
- o !== "default" ? (v(), C(_n, {
688
+ }, Tt, 512),
689
+ (p(!0), x(U, null, W(s.value, (h, r) => (p(), x(U, { key: r }, [
690
+ r !== "default" ? (p(), C($t, {
676
691
  key: 0,
677
- label: o,
678
- controls: c
679
- }, null, 8, ["label", "controls"])) : P("", !0),
680
- o === "default" ? (v(!0), _(I, { key: 1 }, O(c, (u) => (v(), C(le, {
681
- key: u.label,
682
- control: u,
683
- onChange: (h) => i(u.key, h)
684
- }, null, 8, ["control", "onChange"]))), 128)) : P("", !0)
692
+ label: r,
693
+ controls: h
694
+ }, null, 8, ["label", "controls"])) : Y("", !0),
695
+ r === "default" ? (p(!0), x(U, { key: 1 }, W(h, (l) => (p(), C(ue, {
696
+ key: l.label,
697
+ control: l,
698
+ onChange: (y) => a(l.key, y)
699
+ }, null, 8, ["control", "onChange"]))), 128)) : Y("", !0)
685
700
  ], 64))), 128))
686
701
  ])
687
702
  ]),
@@ -690,7 +705,7 @@ const en = { class: "text-gray-500 w-1/3" }, nn = { class: "w-2/3 flex justify-b
690
705
  }
691
706
  });
692
707
  export {
693
- Dn as TresLeches,
694
- An as useControls,
695
- Ce as useControlsProvider
708
+ Ft as TresLeches,
709
+ Dt as useControls,
710
+ Ae as useControlsProvider
696
711
  };