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