@tresjs/leches 0.10.0 → 0.12.0

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