@tresjs/leches 0.14.0-next.0 → 0.14.1

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