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