@tresjs/leches 0.9.1 → 0.11.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,95 +1,95 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.9.1
3
+ * version: v0.11.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 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);
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(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(() => ({
20
20
  get() {
21
- return e.value[t];
21
+ return n.value[e];
22
22
  },
23
- set(s) {
23
+ set(a) {
24
24
  var r;
25
- if ((r = I(l.replaceRef)) != null ? r : !0)
26
- if (Array.isArray(e.value)) {
27
- const p = [...e.value];
28
- p[t] = s, e.value = p;
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;
29
29
  } else {
30
- const p = { ...e.value, [t]: s };
31
- Object.setPrototypeOf(p, Object.getPrototypeOf(e.value)), e.value = p;
30
+ const f = { ...n.value, [e]: a };
31
+ Object.setPrototypeOf(f, Object.getPrototypeOf(n.value)), n.value = f;
32
32
  }
33
33
  else
34
- e.value[t] = s;
34
+ n.value[e] = a;
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(n, l = {}) {
41
41
  const {
42
- pointerTypes: n,
43
- preventDefault: t,
44
- stopPropagation: s,
42
+ pointerTypes: t,
43
+ preventDefault: e,
44
+ stopPropagation: a,
45
45
  exact: r,
46
- onMove: a,
47
- onEnd: p,
48
- onStart: v,
49
- initialValue: _,
50
- axis: i = "both",
46
+ onMove: i,
47
+ onEnd: f,
48
+ onStart: p,
49
+ initialValue: w,
50
+ axis: c = "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: u = n
53
+ } = l, { width: h } = ee();
54
+ let T = h.value;
55
+ const s = y(
56
+ D(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
+ N(h, () => {
59
+ const b = h.value - T;
60
+ s.value.x += b, T = h.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 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))
66
66
  return;
67
- const V = I(e).getBoundingClientRect(), z = {
68
- x: y.clientX - V.left,
69
- y: y.clientY - V.top
67
+ const V = D(n).getBoundingClientRect(), q = {
68
+ x: b.clientX - V.left,
69
+ y: b.clientY - V.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
+ (p == null ? void 0 : p(q, b)) !== !1 && (m.value = q, g(b));
72
+ }, ae = (b) => {
73
+ if (!$(b) || !m.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 = {
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
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));
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));
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: l.capture ?? !0 };
85
+ W(u, "pointerdown", x, b), W(o, "pointermove", ae, b), W(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(s),
89
+ position: s,
90
+ isDragging: K(() => !!m.value),
91
+ style: K(
92
+ () => `left:${s.value.x}px;top:${s.value.y}px;`
93
93
  )
94
94
  };
95
95
  }
@@ -110,161 +110,189 @@ 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(
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, {
119
- ...e,
120
- handle: t,
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
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);
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);
125
125
  }
126
126
  }));
127
127
  return () => {
128
128
  if (l.default)
129
- return ce(e.as || "div", { ref: n, style: `touch-action:none;${p.style}` }, l.default(p));
129
+ return ie(n.as || "div", { ref: t, style: `touch-action:none;${f.style}` }, l.default(f));
130
130
  };
131
131
  }
132
- }), $e = Symbol("CONTROLS_CONTEXT_KEY"), te = "default", F = U({});
133
- function Ce(e = te) {
134
- return ie($e, F), F[e];
132
+ }), $e = Symbol("CONTROLS_CONTEXT_KEY"), te = "default", F = z({});
133
+ function Ce(n = te) {
134
+ return ce($e, F), F[n];
135
135
  }
136
- const K = (e) => {
136
+ const j = (n) => {
137
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)
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)
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 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));
154
160
  }
155
- const v = F[p], _ = ue(r), i = _ ? E(r) : {};
161
+ const p = F[f], w = ue(r), c = w ? E(r) : {};
156
162
  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;
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;
161
170
  continue;
162
171
  }
163
- if (P(u)) {
164
- const f = L(o, u, K(u.value), s);
165
- v[o] = f, t[o] = f;
172
+ if (L(u)) {
173
+ const s = X(o, u, j(u.value), a);
174
+ p[h] = s, e[h] = s;
166
175
  continue;
167
176
  } else if (typeof u == "object" && !Array.isArray(u)) {
168
- const f = E(u);
169
- f[o] && (u = f[o]);
177
+ const s = E(u);
178
+ s[o] && (u = s[o]);
170
179
  }
171
- const w = L(o, u, K(u), s);
172
- v[o] = w, t[o] = w;
180
+ const T = X(o, u, j(u), a);
181
+ p[h] = T, e[h] = T, T.uniqueKey = h;
173
182
  }
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({
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({
176
185
  __name: "NumberControl",
177
186
  props: {
178
187
  label: {},
179
188
  control: {}
180
189
  },
181
190
  emits: ["change"],
182
- setup(e, { emit: l }) {
183
- const n = e;
184
- function t(i) {
185
- const { target: o } = i;
191
+ setup(n, { emit: l }) {
192
+ const t = n;
193
+ function e(c) {
194
+ const { target: o } = c;
186
195
  l("change", o.valueAsNumber);
187
196
  }
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;
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;
197
206
  }
198
- }), (i, o) => (d(), m("div", ke, [
199
- c("label", Me, k(i.label), 1),
200
- 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 }]),
207
+ }), (c, o) => (v(), _("div", Me, [
208
+ d("label", {
209
+ class: "text-gray-500 w-1/3",
210
+ for: c.control.uniqueKey
211
+ }, k(c.label), 9, Se),
212
+ 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 }]),
203
216
  type: "number",
204
- min: i.control.min,
205
- max: i.control.max,
206
- step: i.control.step,
207
- onInput: t,
208
- onMousedown: p,
209
- onMouseup: v
217
+ min: c.control.min,
218
+ max: c.control.max,
219
+ step: c.control.step,
220
+ onInput: e,
221
+ onMousedown: f,
222
+ onMouseup: p
210
223
  }, null, 42, Te)
211
224
  ]));
212
225
  }
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({
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({
214
227
  __name: "TextControl",
215
228
  props: {
216
229
  label: {},
217
230
  control: {}
218
231
  },
219
232
  emits: ["change"],
220
- setup(e, { emit: l }) {
221
- function n(t) {
222
- const { target: s } = t;
223
- l("change", s.value);
233
+ setup(n, { emit: l }) {
234
+ function t(e) {
235
+ const { target: a } = e;
236
+ l("change", a.value);
224
237
  }
225
- return (t, s) => (d(), m("div", Se, [
226
- c("label", Ae, k(t.label), 1),
227
- c("input", {
228
- value: t.control.value,
238
+ return (e, a) => (v(), _("div", De, [
239
+ d("label", {
240
+ for: e.control.uniqueKey,
241
+ class: "text-gray-500 w-1/3"
242
+ }, k(e.label), 9, Ie),
243
+ d("input", {
244
+ id: e.control.uniqueKey,
245
+ value: e.control.value,
229
246
  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)
247
+ tabindex: "0",
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",
249
+ "aria-label": e.label,
250
+ placeholder: "Enter value here...",
251
+ onChange: t
252
+ }, null, 40, Ke)
233
253
  ]));
234
254
  }
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({
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({
236
256
  __name: "BooleanControl",
237
257
  props: {
238
258
  label: {},
239
259
  control: {}
240
260
  },
241
261
  emits: ["change"],
242
- setup(e, { emit: l }) {
243
- function n(t) {
244
- const { target: s } = t;
245
- l("change", s.checked);
262
+ setup(n, { emit: l }) {
263
+ const t = n;
264
+ function e(r) {
265
+ const { target: i } = r;
266
+ l("change", i.checked);
267
+ }
268
+ function a(r) {
269
+ (r.code === "Space" || r.code === "Enter") && (r.preventDefault(), l("change", !t.control.value));
246
270
  }
247
- return (t, s) => (d(), m("div", Fe, [
248
- c("label", Ve, k(t.label), 1),
249
- c("input", {
250
- id: t.control.label,
251
- checked: t.control.value,
271
+ return (r, i) => (v(), _("div", Fe, [
272
+ d("label", Ve, k(r.label), 1),
273
+ d("input", {
274
+ id: r.control.uniqueKey,
275
+ checked: r.control.value,
252
276
  class: "hidden",
253
277
  type: "checkbox",
254
- onInput: n
255
- }, null, 40, ze),
256
- c("label", {
257
- for: t.control.label,
278
+ onInput: e
279
+ }, null, 40, qe),
280
+ d("label", {
281
+ for: r.control.uniqueKey,
258
282
  class: "inline-flex items-center cursor-pointer"
259
283
  }, [
260
- 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"])
284
+ d("span", {
285
+ tabindex: "0",
286
+ 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
262
290
  }, [
263
- q(c("i", Ue, null, 512), [
264
- [J, t.control.value]
291
+ J(d("i", Oe, null, 512), [
292
+ [Q, r.control.value]
265
293
  ])
266
- ], 2)
267
- ], 8, Oe)
294
+ ], 42, ze)
295
+ ], 8, Ue)
268
296
  ]));
269
297
  }
270
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({
@@ -274,356 +302,386 @@ const K = (e) => {
274
302
  control: {}
275
303
  },
276
304
  emits: ["change"],
277
- setup(e, { emit: l }) {
278
- const n = e;
279
- function t(o) {
305
+ setup(n, { emit: l }) {
306
+ const t = n;
307
+ function e(o) {
280
308
  const { target: u } = o;
281
309
  l("change", u.valueAsNumber);
282
310
  }
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
- }, _ = () => {
288
- p.value = !1;
289
- }, i = (o) => Math.floor(Math.abs(o) / 10);
290
- return W(r.x, (o) => {
291
- 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 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;
294
322
  }
295
- }), (o, u) => (d(), m("div", Le, [
296
- c("label", {
323
+ }), (o, u) => (v(), _("div", Le, [
324
+ d("label", {
297
325
  class: S(["text-gray-500 w-1/3", { "flex justify-between items-center": o.control.icon }])
298
326
  }, [
299
- pe(k(o.label) + " ", 1),
300
- c("i", {
327
+ de(k(o.label) + " ", 1),
328
+ d("i", {
301
329
  class: S(`i-${o.control.icon}`)
302
330
  }, null, 2)
303
331
  ], 2),
304
- c("input", {
332
+ d("input", {
305
333
  value: o.control.value,
306
334
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
307
- style: fe(s.value),
335
+ style: fe(a.value),
308
336
  type: "range",
309
337
  min: o.control.min,
310
338
  max: o.control.max,
311
339
  step: o.control.step,
312
- onInput: t
340
+ onInput: e
313
341
  }, null, 44, Pe),
314
- c("input", {
342
+ d("input", {
315
343
  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 }]),
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 }]),
317
345
  type: "number",
318
346
  min: o.control.min,
319
347
  max: o.control.max,
320
348
  step: o.control.step,
321
- onInput: t,
322
- onMousedown: v,
323
- onMouseup: _
349
+ onInput: e,
350
+ onMousedown: p,
351
+ onMouseup: w
324
352
  }, null, 42, Ne)
325
353
  ]));
326
354
  }
327
355
  });
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({
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({
334
362
  __name: "ColorControl",
335
363
  props: {
336
364
  label: {},
337
365
  control: {}
338
366
  },
339
367
  emits: ["change"],
340
- setup(e, { emit: l }) {
341
- function n(t) {
342
- const { target: s } = t;
343
- l("change", s.value);
368
+ setup(n, { emit: l }) {
369
+ function t(e) {
370
+ const { target: a } = e;
371
+ l("change", a.value);
344
372
  }
345
- return (t, s) => (d(), m("div", Re, [
346
- c("label", je, k(t.label), 1),
347
- c("input", {
348
- value: t.control.value,
373
+ return (e, a) => (v(), _("div", Re, [
374
+ d("label", Ye, k(e.label), 1),
375
+ d("input", {
376
+ id: e.control.uniqueKey,
377
+ tabindex: "0",
378
+ value: e.control.value,
379
+ "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" }]),
349
381
  type: "color",
350
- onInput: n
351
- }, null, 40, Ye),
352
- 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",
382
+ onInput: t
383
+ }, null, 42, He),
384
+ d("input", {
385
+ id: e.control.uniqueKey,
386
+ tabindex: "0",
387
+ "aria-label": e.label,
388
+ value: e.control.value,
389
+ class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 border-none font-sans",
355
390
  type: "text",
356
- onInput: n
357
- }, null, 40, He)
391
+ onInput: t
392
+ }, null, 40, Ge)
358
393
  ]));
359
394
  }
360
395
  });
361
- function qe(e) {
362
- if (typeof e == "number")
363
- return [e, e, e];
364
- if (ne(e)) {
365
- const { x: l, y: n, z: t } = e;
366
- return [l, n, t];
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];
367
402
  }
368
- return e;
403
+ return n;
369
404
  }
370
- function Je(e) {
371
- return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z > "u";
405
+ function Ze(n) {
406
+ return n && typeof n.x == "number" && typeof n.y == "number" && typeof n.z > "u";
372
407
  }
373
- function ne(e) {
374
- return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z == "number";
408
+ function oe(n) {
409
+ return n && typeof n.x == "number" && typeof n.y == "number" && typeof n.z == "number";
375
410
  }
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 = {
411
+ const en = { class: "text-gray-500 w-1/3" }, nn = { class: "w-2/3 flex justify-between gap-0.5" }, tn = {
377
412
  key: 0,
378
413
  class: "font-bold px-1 py-1 text-0.65rem text-gray-300"
379
- }, nt = ["value", "onInput", "onMousedown", "onMouseup"], ot = /* @__PURE__ */ M({
414
+ }, on = ["id", "value", "onInput", "onMousedown", "onMouseup"], ln = /* @__PURE__ */ M({
380
415
  __name: "VectorControl",
381
416
  props: {
382
417
  label: {},
383
418
  control: {}
384
419
  },
385
420
  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);
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", $);
395
432
  }
396
- return W(t.x, (f) => {
433
+ return N(e.x, (s) => {
397
434
  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;
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;
400
437
  }
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,
438
+ }), (s, m) => (v(), _("div", {
439
+ class: "flex px-4 justify-between gap-1 items-center mb-2",
440
+ onMouseup: m[0] || (m[0] = ($) => w())
441
+ }, [
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,
406
446
  class: "flex items-center w-1/3 bg-gray-100 rounded"
407
447
  }, [
408
- o.value[g] && u.value ? (d(), m("span", tt, k(o.value[g]), 1)) : N("", !0),
409
- 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)
448
+ u.value[g] && h.value ? (v(), _("span", tn, k(u.value[g]), 1)) : P("", !0),
449
+ d("input", {
450
+ id: `${s.control.uniqueKey}-${u.value[g]}`,
451
+ 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)
417
459
  ]))), 128))
418
460
  ])
419
- ]));
461
+ ], 32));
420
462
  }
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({
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({
422
464
  __name: "FPSGraph",
423
465
  props: {
424
466
  label: {},
425
467
  control: {}
426
468
  },
427
- setup(e) {
428
- const l = ye({ every: H }), n = h(""), t = h([]), s = h(Y / O);
469
+ setup(n) {
470
+ const l = be({ every: H }), t = y(""), e = y([]), a = y(Y / U);
429
471
  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}`
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}`
433
475
  ).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", {
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", {
439
481
  width: Y,
440
- height: R,
482
+ height: B,
441
483
  xmlns: "http://www.w3.org/2000/svg",
442
484
  class: "bg-gray-100"
443
485
  }, [
444
- c("polyline", {
445
- points: n.value,
486
+ d("polyline", {
487
+ points: t.value,
446
488
  fill: "none",
447
489
  stroke: "lightgray",
448
- "stroke-width": O,
490
+ "stroke-width": U,
449
491
  "stroke-linecap": "round",
450
492
  "stroke-linejoin": "round"
451
- }, null, 8, ct)
493
+ }, null, 8, un)
452
494
  ]))
453
495
  ])
454
496
  ]));
455
497
  }
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({
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({
457
499
  __name: "SelectControl",
458
500
  props: {
459
501
  label: {},
460
502
  control: {}
461
503
  },
462
504
  emits: ["change"],
463
- setup(e, { emit: l }) {
464
- function n(t) {
465
- l("change", t.target.value);
505
+ setup(n, { emit: l }) {
506
+ function t(e) {
507
+ l("change", e.target.value);
466
508
  }
467
- return (t, s) => (d(), m("div", ut, [
468
- c("label", pt, k(t.label), 1),
469
- c("select", {
470
- value: t.control.value,
509
+ return (e, a) => (v(), _("div", fn, [
510
+ d("label", {
511
+ class: "text-gray-500 w-1/3",
512
+ for: e.control.uniqueKey
513
+ }, k(e.label), 9, pn),
514
+ d("select", {
515
+ id: e.control.uniqueKey,
516
+ value: e.control.value,
471
517
  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
518
+ onChange: t
473
519
  }, [
474
- (d(!0), m(A, null, X(t.control.options, (r) => (d(), m("option", {
520
+ (v(!0), _(I, null, O(e.control.options, (r) => (v(), _("option", {
475
521
  key: r.value,
476
522
  value: r.value
477
- }, k(r.text), 9, dt))), 128))
478
- ], 40, ft)
523
+ }, k(r.text), 9, gn))), 128))
524
+ ], 40, vn)
479
525
  ]));
480
526
  }
481
- }), oe = /* @__PURE__ */ M({
527
+ }), le = /* @__PURE__ */ M({
482
528
  __name: "ControlInput",
483
529
  props: {
484
530
  control: {}
485
531
  },
486
532
  emits: ["change"],
487
- setup(e, { emit: l }) {
488
- function n(t) {
489
- l("change", t);
533
+ setup(n, { emit: l }) {
534
+ function t(e) {
535
+ l("change", e);
490
536
  }
491
- return (t, s) => t.control.visible ? (d(), m(A, { key: 0 }, [
492
- t.control.type === "color" ? (d(), C(Ge, {
537
+ return (e, a) => e.control.visible ? (v(), _(I, { key: 0 }, [
538
+ e.control.type === "color" ? (v(), C(Je, {
493
539
  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, {
540
+ label: e.control.label,
541
+ control: e.control,
542
+ onChange: t
543
+ }, null, 8, ["label", "control"])) : e.control.type === "select" ? (v(), C(yn, {
498
544
  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, {
545
+ label: e.control.label,
546
+ control: e.control,
547
+ onChange: t
548
+ }, null, 8, ["label", "control"])) : e.control.type === "vector" ? (v(), C(ln, {
503
549
  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, {
550
+ label: e.control.label,
551
+ control: e.control,
552
+ onChange: t
553
+ }, null, 8, ["label", "control"])) : e.control.type === "boolean" ? (v(), C(Xe, {
508
554
  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, {
555
+ label: e.control.label,
556
+ control: e.control,
557
+ onChange: t
558
+ }, null, 8, ["label", "control"])) : e.control.type === "fpsgraph" ? (v(), C(dn, {
513
559
  key: 4,
514
- label: t.control.label,
515
- control: t.control
516
- }, null, 8, ["label", "control"])) : t.control.type === "number" ? (d(), C(Ie, {
560
+ label: e.control.label,
561
+ control: e.control
562
+ }, null, 8, ["label", "control"])) : e.control.type === "number" ? (v(), C(Ae, {
517
563
  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, {
564
+ label: e.control.label,
565
+ control: e.control,
566
+ onChange: t
567
+ }, null, 8, ["label", "control"])) : e.control.type === "range" ? (v(), C(Be, {
522
568
  key: 6,
523
- label: t.control.label,
524
- control: t.control,
525
- onChange: n
526
- }, null, 8, ["label", "control"])) : (d(), C(Ee, {
569
+ label: e.control.label,
570
+ control: e.control,
571
+ onChange: t
572
+ }, null, 8, ["label", "control"])) : (v(), C(Ee, {
527
573
  key: 7,
528
- label: t.control.label,
529
- control: t.control,
530
- onChange: n
574
+ label: e.control.label,
575
+ control: e.control,
576
+ onChange: t
531
577
  }, null, 8, ["label", "control"]))
532
- ], 64)) : N("", !0);
578
+ ], 64)) : P("", !0);
533
579
  }
534
- }), gt = { class: "mb-4" }, ht = { class: "bg-white rounded-b pt-4" }, yt = /* @__PURE__ */ M({
580
+ }), bn = { class: "mb-4" }, hn = ["aria-expanded", "data-folder"], mn = {
581
+ class: "bg-white rounded-b pt-4",
582
+ role: "menu"
583
+ }, _n = /* @__PURE__ */ M({
535
584
  __name: "Folder",
536
585
  props: {
537
586
  controls: {},
538
587
  label: {}
539
588
  },
540
- setup(e) {
541
- function l(s, r) {
542
- r.value = s;
589
+ setup(n) {
590
+ function l(a, r) {
591
+ r.value = a;
543
592
  }
544
- const n = h(!1), t = () => {
545
- n.value = !n.value;
593
+ const t = y(!1), e = () => {
594
+ t.value = !t.value;
546
595
  };
547
- return (s, r) => (d(), m("div", gt, [
548
- 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
596
+ return (a, r) => (v(), _("div", bn, [
597
+ d("button", {
598
+ 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,
600
+ "aria-haspopup": "true",
601
+ role: "button",
602
+ "data-folder": a.label,
603
+ tabindex: "0",
604
+ onClick: e
551
605
  }, [
552
- c("span", null, k(s.label), 1),
553
- c("i", {
554
- class: S(n.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
606
+ d("span", null, k(a.label), 1),
607
+ d("i", {
608
+ class: S(t.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
555
609
  }, null, 2)
556
- ]),
557
- de(ve, {
610
+ ], 8, hn),
611
+ pe(ve, {
558
612
  name: "slide",
559
613
  "enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
560
614
  "leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
561
615
  }, {
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)
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,
621
+ role: "menuitem",
622
+ onChange: (f) => l(f, i)
568
623
  }, null, 8, ["control", "onChange"]))), 128))
569
624
  ], 512), [
570
- [J, n.value]
625
+ [Q, t.value]
571
626
  ])
572
627
  ]),
573
628
  _: 1
574
629
  })
575
630
  ]));
576
631
  }
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, [
578
- /* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" }),
579
- /* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" }),
580
- /* @__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({
632
+ }), xn = {
633
+ tabindex: "0",
634
+ 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, [
636
+ /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" }),
637
+ /* @__PURE__ */ d("i", { class: "i-ic-baseline-drag-indicator" }),
638
+ /* @__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({
586
644
  __name: "TresLeches",
587
645
  props: {
588
646
  uuid: {}
589
647
  },
590
- 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)] = _;
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;
594
652
  }
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);
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);
600
658
  }
601
- return v;
659
+ return p;
602
660
  });
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
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
608
666
  }, {
609
- default: Q(() => [
610
- c("div", bt, [
611
- c("header", {
667
+ default: Z(() => [
668
+ d("div", xn, [
669
+ d("header", {
612
670
  ref_key: "handle",
613
- ref: s,
671
+ ref: a,
614
672
  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, {
673
+ }, kn, 512),
674
+ (v(!0), _(I, null, O(f.value, (c, o) => (v(), _(I, { key: o }, [
675
+ o !== "default" ? (v(), C(_n, {
618
676
  key: 0,
619
677
  label: o,
620
- controls: i
621
- }, null, 8, ["label", "controls"])) : N("", !0),
622
- o === "default" ? (d(!0), m(A, { key: 1 }, X(i, (u) => (d(), C(oe, {
678
+ controls: c
679
+ }, null, 8, ["label", "controls"])) : P("", !0),
680
+ o === "default" ? (v(!0), _(I, { key: 1 }, O(c, (u) => (v(), C(le, {
623
681
  key: u.label,
624
682
  control: u,
625
- onChange: (w) => a(u.label, w)
626
- }, null, 8, ["control", "onChange"]))), 128)) : N("", !0)
683
+ onChange: (h) => i(u.key, h)
684
+ }, null, 8, ["control", "onChange"]))), 128)) : P("", !0)
627
685
  ], 64))), 128))
628
686
  ])
629
687
  ]),
@@ -632,7 +690,7 @@ const Qe = { class: "flex px-4 justify-between gap-1 items-center mb-2" }, Ze =
632
690
  }
633
691
  });
634
692
  export {
635
- Tt as TresLeches,
636
- Mt as useControls,
693
+ Dn as TresLeches,
694
+ An as useControls,
637
695
  Ce as useControlsProvider
638
696
  };