@tresjs/leches 0.3.1 → 0.5.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.
- package/dist/components/BooleanControl.vue.d.ts +6 -7
- package/dist/components/ColorControl.vue.d.ts +6 -7
- package/dist/components/ControlInput.vue.d.ts +4 -5
- package/dist/components/FPSGraph.vue.d.ts +6 -7
- package/dist/components/Folder.vue.d.ts +4 -5
- package/dist/components/NumberControl.vue.d.ts +6 -7
- package/dist/components/SelectControl.vue.d.ts +23 -0
- package/dist/components/SliderControl.vue.d.ts +6 -7
- package/dist/components/TextControl.vue.d.ts +6 -7
- package/dist/components/TresLeches.vue.d.ts +2 -2
- package/dist/components/VectorControl.vue.d.ts +6 -7
- package/dist/composables/useControls.d.ts +2 -29
- package/dist/composables/useControls.old.d.ts +25 -0
- package/dist/style.css +2 -2
- package/dist/tresleches.js +322 -277
- package/dist/tresleches.umd.cjs +3 -3
- package/package.json +32 -27
package/dist/tresleches.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.
|
|
3
|
+
* version: v0.5.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
|
|
9
|
-
import { useStorage as
|
|
10
|
-
function
|
|
11
|
-
return ct() ? (yt(
|
|
8
|
+
import { unref as j, getCurrentScope as ct, onScopeDispose as yt, toRef as _t, readonly as xt, customRef as pt, ref as m, defineComponent as S, computed as T, reactive as tt, h as dt, watch as I, provide as ft, isReactive as gt, toRefs as mt, onUnmounted as bt, isRef as V, openBlock as d, createElementBlock as g, createElementVNode as p, toDisplayString as C, normalizeClass as $, withDirectives as et, vShow as st, createTextVNode as zt, normalizeStyle as wt, Fragment as P, renderList as L, createCommentVNode as nt, createVNode as Mt, Transition as vt, withCtx as it, createBlock as v } from "vue";
|
|
9
|
+
import { useStorage as Ct, isClient as St, useDraggable as kt, useMouse as H, useFps as $t, useRafFn as Et, useWindowSize as Tt } from "@vueuse/core";
|
|
10
|
+
function ot(o) {
|
|
11
|
+
return ct() ? (yt(o), !0) : !1;
|
|
12
12
|
}
|
|
13
|
-
function q(
|
|
14
|
-
return typeof
|
|
13
|
+
function q(o) {
|
|
14
|
+
return typeof o == "function" ? o() : j(o);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
},
|
|
16
|
+
const rt = typeof window < "u", at = () => {
|
|
17
|
+
}, U = /* @__PURE__ */ It();
|
|
18
18
|
function It() {
|
|
19
|
-
var
|
|
20
|
-
return
|
|
19
|
+
var o;
|
|
20
|
+
return rt && ((o = window == null ? void 0 : window.navigator) == null ? void 0 : o.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
21
21
|
}
|
|
22
|
-
function At(...
|
|
23
|
-
if (
|
|
24
|
-
return _t(...
|
|
25
|
-
const t =
|
|
26
|
-
return typeof t == "function" ? xt(pt(() => ({ get: t, set:
|
|
22
|
+
function At(...o) {
|
|
23
|
+
if (o.length !== 1)
|
|
24
|
+
return _t(...o);
|
|
25
|
+
const t = o[0];
|
|
26
|
+
return typeof t == "function" ? xt(pt(() => ({ get: t, set: at }))) : m(t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function jt(o) {
|
|
29
29
|
var t;
|
|
30
|
-
const e = q(
|
|
30
|
+
const e = q(o);
|
|
31
31
|
return (t = e == null ? void 0 : e.$el) != null ? t : e;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
33
|
+
const qt = rt ? window : void 0;
|
|
34
|
+
function Pt(...o) {
|
|
35
35
|
let t, e, s, n;
|
|
36
|
-
if (typeof
|
|
37
|
-
return
|
|
36
|
+
if (typeof o[0] == "string" || Array.isArray(o[0]) ? ([e, s, n] = o, t = qt) : [t, e, s, n] = o, !t)
|
|
37
|
+
return at;
|
|
38
38
|
Array.isArray(e) || (e = [e]), Array.isArray(s) || (s = [s]);
|
|
39
39
|
const i = [], a = () => {
|
|
40
40
|
i.forEach((h) => h()), i.length = 0;
|
|
41
|
-
}, l = (h,
|
|
42
|
-
() => [
|
|
43
|
-
([h,
|
|
41
|
+
}, l = (h, r, _, u) => (h.addEventListener(r, _, u), () => h.removeEventListener(r, _, u)), y = I(
|
|
42
|
+
() => [jt(t), q(n)],
|
|
43
|
+
([h, r]) => {
|
|
44
44
|
a(), h && i.push(
|
|
45
|
-
...e.flatMap((_) => s.map((u) => l(h, _, u,
|
|
45
|
+
...e.flatMap((_) => s.map((u) => l(h, _, u, r)))
|
|
46
46
|
);
|
|
47
47
|
},
|
|
48
48
|
{ immediate: !0, flush: "post" }
|
|
49
49
|
), c = () => {
|
|
50
50
|
y(), a();
|
|
51
51
|
};
|
|
52
|
-
return
|
|
52
|
+
return ot(c), c;
|
|
53
53
|
}
|
|
54
|
-
var
|
|
54
|
+
var Dt = Object.defineProperty, Lt = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, F = Object.getOwnPropertySymbols, Xt = Object.prototype.hasOwnProperty, Rt = Object.prototype.propertyIsEnumerable, K = (o, t, e) => t in o ? Dt(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, Yt = (o, t) => {
|
|
55
55
|
for (var e in t || (t = {}))
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
for (var e of
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
const
|
|
56
|
+
Xt.call(t, e) && K(o, e, t[e]);
|
|
57
|
+
if (F)
|
|
58
|
+
for (var e of F(t))
|
|
59
|
+
Rt.call(t, e) && K(o, e, t[e]);
|
|
60
|
+
return o;
|
|
61
|
+
}, Ht = (o, t) => Lt(o, Vt(t));
|
|
62
|
+
const Qt = /* @__PURE__ */ S({
|
|
63
63
|
name: "UseDraggable",
|
|
64
64
|
props: [
|
|
65
65
|
"storageKey",
|
|
@@ -76,45 +76,45 @@ const Yt = /* @__PURE__ */ v({
|
|
|
76
76
|
"onMove",
|
|
77
77
|
"onEnd"
|
|
78
78
|
],
|
|
79
|
-
setup(
|
|
80
|
-
const e =
|
|
79
|
+
setup(o, { slots: t }) {
|
|
80
|
+
const e = m(), s = T(() => {
|
|
81
81
|
var y;
|
|
82
|
-
return (y =
|
|
83
|
-
}), n =
|
|
84
|
-
|
|
85
|
-
q(
|
|
86
|
-
|
|
87
|
-
), i = n ||
|
|
82
|
+
return (y = o.handle) != null ? y : e.value;
|
|
83
|
+
}), n = o.storageKey && Ct(
|
|
84
|
+
o.storageKey,
|
|
85
|
+
q(o.initialValue) || { x: 0, y: 0 },
|
|
86
|
+
St ? o.storageType === "session" ? sessionStorage : localStorage : void 0
|
|
87
|
+
), i = n || o.initialValue || { x: 0, y: 0 }, a = (y, c) => {
|
|
88
88
|
var h;
|
|
89
|
-
(h =
|
|
90
|
-
}, l = tt(
|
|
89
|
+
(h = o.onEnd) == null || h.call(o, y, c), n && (n.value.x = y.x, n.value.y = y.y);
|
|
90
|
+
}, l = tt(kt(e, Ht(Yt({}, o), {
|
|
91
91
|
handle: s,
|
|
92
92
|
initialValue: i,
|
|
93
93
|
onEnd: a
|
|
94
94
|
})));
|
|
95
95
|
return () => {
|
|
96
96
|
if (t.default)
|
|
97
|
-
return dt(
|
|
97
|
+
return dt(o.as || "div", { ref: e, style: `touch-action:none;${l.style}` }, t.default(l));
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
function
|
|
102
|
-
const t = window.getComputedStyle(
|
|
103
|
-
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" &&
|
|
101
|
+
function ht(o) {
|
|
102
|
+
const t = window.getComputedStyle(o);
|
|
103
|
+
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && o.clientWidth < o.scrollWidth || t.overflowY === "auto" && o.clientHeight < o.scrollHeight)
|
|
104
104
|
return !0;
|
|
105
105
|
{
|
|
106
|
-
const e =
|
|
107
|
-
return !e || e.tagName === "BODY" ? !1 :
|
|
106
|
+
const e = o.parentNode;
|
|
107
|
+
return !e || e.tagName === "BODY" ? !1 : ht(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
const t =
|
|
112
|
-
return
|
|
110
|
+
function Wt(o) {
|
|
111
|
+
const t = o || window.event, e = t.target;
|
|
112
|
+
return ht(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const e =
|
|
114
|
+
function Zt(o, t = !1) {
|
|
115
|
+
const e = m(t);
|
|
116
116
|
let s = null, n;
|
|
117
|
-
I(At(
|
|
117
|
+
I(At(o), (l) => {
|
|
118
118
|
if (l) {
|
|
119
119
|
const y = l;
|
|
120
120
|
n = y.style.overflow, e.value && (y.style.overflow = "hidden");
|
|
@@ -123,20 +123,20 @@ function Ht(r, t = !1) {
|
|
|
123
123
|
immediate: !0
|
|
124
124
|
});
|
|
125
125
|
const i = () => {
|
|
126
|
-
const l = q(
|
|
127
|
-
!l || e.value || (
|
|
126
|
+
const l = q(o);
|
|
127
|
+
!l || e.value || (U && (s = Pt(
|
|
128
128
|
l,
|
|
129
129
|
"touchmove",
|
|
130
130
|
(y) => {
|
|
131
|
-
|
|
131
|
+
Wt(y);
|
|
132
132
|
},
|
|
133
133
|
{ passive: !1 }
|
|
134
134
|
)), l.style.overflow = "hidden", e.value = !0);
|
|
135
135
|
}, a = () => {
|
|
136
|
-
const l = q(
|
|
137
|
-
!l || !e.value || (
|
|
136
|
+
const l = q(o);
|
|
137
|
+
!l || !e.value || (U && (s == null || s()), l.style.overflow = n, e.value = !1);
|
|
138
138
|
};
|
|
139
|
-
return
|
|
139
|
+
return ot(a), T({
|
|
140
140
|
get() {
|
|
141
141
|
return e.value;
|
|
142
142
|
},
|
|
@@ -145,30 +145,30 @@ function Ht(r, t = !1) {
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
let
|
|
150
|
-
const t =
|
|
148
|
+
function Bt() {
|
|
149
|
+
let o = !1;
|
|
150
|
+
const t = m(!1);
|
|
151
151
|
return (e, s) => {
|
|
152
|
-
if (t.value = s.value,
|
|
152
|
+
if (t.value = s.value, o)
|
|
153
153
|
return;
|
|
154
|
-
|
|
155
|
-
const n =
|
|
154
|
+
o = !0;
|
|
155
|
+
const n = Zt(e, s.value);
|
|
156
156
|
I(t, (i) => n.value = i);
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
Bt();
|
|
160
160
|
/**
|
|
161
161
|
* @license
|
|
162
162
|
* Copyright 2010-2023 Three.js Authors
|
|
163
163
|
* SPDX-License-Identifier: MIT
|
|
164
164
|
*/
|
|
165
|
-
const lt = "
|
|
166
|
-
function
|
|
167
|
-
return Math.max(t, Math.min(e,
|
|
165
|
+
const lt = "155";
|
|
166
|
+
function Q(o, t, e) {
|
|
167
|
+
return Math.max(t, Math.min(e, o));
|
|
168
168
|
}
|
|
169
|
-
class
|
|
169
|
+
class W {
|
|
170
170
|
constructor(t = 0, e = 0) {
|
|
171
|
-
|
|
171
|
+
W.prototype.isVector2 = !0, this.x = t, this.y = e;
|
|
172
172
|
}
|
|
173
173
|
get width() {
|
|
174
174
|
return this.x;
|
|
@@ -317,7 +317,7 @@ class H {
|
|
|
317
317
|
if (e === 0)
|
|
318
318
|
return Math.PI / 2;
|
|
319
319
|
const s = this.dot(t) / e;
|
|
320
|
-
return Math.acos(
|
|
320
|
+
return Math.acos(Q(s, -1, 1));
|
|
321
321
|
}
|
|
322
322
|
distanceTo(t) {
|
|
323
323
|
return Math.sqrt(this.distanceToSquared(t));
|
|
@@ -361,39 +361,39 @@ class H {
|
|
|
361
361
|
yield this.x, yield this.y;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
class
|
|
364
|
+
class Ut {
|
|
365
365
|
constructor(t = 0, e = 0, s = 0, n = 1) {
|
|
366
366
|
this.isQuaternion = !0, this._x = t, this._y = e, this._z = s, this._w = n;
|
|
367
367
|
}
|
|
368
368
|
static slerpFlat(t, e, s, n, i, a, l) {
|
|
369
|
-
let y = s[n + 0], c = s[n + 1], h = s[n + 2],
|
|
370
|
-
const _ = i[a + 0], u = i[a + 1], x = i[a + 2],
|
|
369
|
+
let y = s[n + 0], c = s[n + 1], h = s[n + 2], r = s[n + 3];
|
|
370
|
+
const _ = i[a + 0], u = i[a + 1], x = i[a + 2], b = i[a + 3];
|
|
371
371
|
if (l === 0) {
|
|
372
|
-
t[e + 0] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] =
|
|
372
|
+
t[e + 0] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
|
|
373
373
|
return;
|
|
374
374
|
}
|
|
375
375
|
if (l === 1) {
|
|
376
|
-
t[e + 0] = _, t[e + 1] = u, t[e + 2] = x, t[e + 3] =
|
|
376
|
+
t[e + 0] = _, t[e + 1] = u, t[e + 2] = x, t[e + 3] = b;
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
|
-
if (
|
|
379
|
+
if (r !== b || y !== _ || c !== u || h !== x) {
|
|
380
380
|
let z = 1 - l;
|
|
381
|
-
const f = y * _ + c * u + h * x +
|
|
382
|
-
if (
|
|
383
|
-
const
|
|
384
|
-
z = Math.sin(z *
|
|
381
|
+
const f = y * _ + c * u + h * x + r * b, M = f >= 0 ? 1 : -1, Z = 1 - f * f;
|
|
382
|
+
if (Z > Number.EPSILON) {
|
|
383
|
+
const k = Math.sqrt(Z), B = Math.atan2(k, f * M);
|
|
384
|
+
z = Math.sin(z * B) / k, l = Math.sin(l * B) / k;
|
|
385
385
|
}
|
|
386
|
-
const
|
|
387
|
-
if (y = y * z + _ *
|
|
388
|
-
const
|
|
389
|
-
y *=
|
|
386
|
+
const D = l * M;
|
|
387
|
+
if (y = y * z + _ * D, c = c * z + u * D, h = h * z + x * D, r = r * z + b * D, z === 1 - l) {
|
|
388
|
+
const k = 1 / Math.sqrt(y * y + c * c + h * h + r * r);
|
|
389
|
+
y *= k, c *= k, h *= k, r *= k;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] =
|
|
392
|
+
t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
|
|
393
393
|
}
|
|
394
394
|
static multiplyQuaternionsFlat(t, e, s, n, i, a) {
|
|
395
|
-
const l = s[n], y = s[n + 1], c = s[n + 2], h = s[n + 3],
|
|
396
|
-
return t[e] = l * x + h *
|
|
395
|
+
const l = s[n], y = s[n + 1], c = s[n + 2], h = s[n + 3], r = i[a], _ = i[a + 1], u = i[a + 2], x = i[a + 3];
|
|
396
|
+
return t[e] = l * x + h * r + y * u - c * _, t[e + 1] = y * x + h * _ + c * r - l * u, t[e + 2] = c * x + h * u + l * _ - y * r, t[e + 3] = h * x - l * r - y * _ - c * u, t;
|
|
397
397
|
}
|
|
398
398
|
get x() {
|
|
399
399
|
return this._x;
|
|
@@ -429,25 +429,25 @@ class Wt {
|
|
|
429
429
|
return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
|
|
430
430
|
}
|
|
431
431
|
setFromEuler(t, e) {
|
|
432
|
-
const s = t._x, n = t._y, i = t._z, a = t._order, l = Math.cos, y = Math.sin, c = l(s / 2), h = l(n / 2),
|
|
432
|
+
const s = t._x, n = t._y, i = t._z, a = t._order, l = Math.cos, y = Math.sin, c = l(s / 2), h = l(n / 2), r = l(i / 2), _ = y(s / 2), u = y(n / 2), x = y(i / 2);
|
|
433
433
|
switch (a) {
|
|
434
434
|
case "XYZ":
|
|
435
|
-
this._x = _ * h *
|
|
435
|
+
this._x = _ * h * r + c * u * x, this._y = c * u * r - _ * h * x, this._z = c * h * x + _ * u * r, this._w = c * h * r - _ * u * x;
|
|
436
436
|
break;
|
|
437
437
|
case "YXZ":
|
|
438
|
-
this._x = _ * h *
|
|
438
|
+
this._x = _ * h * r + c * u * x, this._y = c * u * r - _ * h * x, this._z = c * h * x - _ * u * r, this._w = c * h * r + _ * u * x;
|
|
439
439
|
break;
|
|
440
440
|
case "ZXY":
|
|
441
|
-
this._x = _ * h *
|
|
441
|
+
this._x = _ * h * r - c * u * x, this._y = c * u * r + _ * h * x, this._z = c * h * x + _ * u * r, this._w = c * h * r - _ * u * x;
|
|
442
442
|
break;
|
|
443
443
|
case "ZYX":
|
|
444
|
-
this._x = _ * h *
|
|
444
|
+
this._x = _ * h * r - c * u * x, this._y = c * u * r + _ * h * x, this._z = c * h * x - _ * u * r, this._w = c * h * r + _ * u * x;
|
|
445
445
|
break;
|
|
446
446
|
case "YZX":
|
|
447
|
-
this._x = _ * h *
|
|
447
|
+
this._x = _ * h * r + c * u * x, this._y = c * u * r + _ * h * x, this._z = c * h * x - _ * u * r, this._w = c * h * r - _ * u * x;
|
|
448
448
|
break;
|
|
449
449
|
case "XZY":
|
|
450
|
-
this._x = _ * h *
|
|
450
|
+
this._x = _ * h * r - c * u * x, this._y = c * u * r - _ * h * x, this._z = c * h * x + _ * u * r, this._w = c * h * r + _ * u * x;
|
|
451
451
|
break;
|
|
452
452
|
default:
|
|
453
453
|
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
|
|
@@ -459,18 +459,18 @@ class Wt {
|
|
|
459
459
|
return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(s), this._onChangeCallback(), this;
|
|
460
460
|
}
|
|
461
461
|
setFromRotationMatrix(t) {
|
|
462
|
-
const e = t.elements, s = e[0], n = e[4], i = e[8], a = e[1], l = e[5], y = e[9], c = e[2], h = e[6],
|
|
462
|
+
const e = t.elements, s = e[0], n = e[4], i = e[8], a = e[1], l = e[5], y = e[9], c = e[2], h = e[6], r = e[10], _ = s + l + r;
|
|
463
463
|
if (_ > 0) {
|
|
464
464
|
const u = 0.5 / Math.sqrt(_ + 1);
|
|
465
465
|
this._w = 0.25 / u, this._x = (h - y) * u, this._y = (i - c) * u, this._z = (a - n) * u;
|
|
466
|
-
} else if (s > l && s >
|
|
467
|
-
const u = 2 * Math.sqrt(1 + s - l -
|
|
466
|
+
} else if (s > l && s > r) {
|
|
467
|
+
const u = 2 * Math.sqrt(1 + s - l - r);
|
|
468
468
|
this._w = (h - y) / u, this._x = 0.25 * u, this._y = (n + a) / u, this._z = (i + c) / u;
|
|
469
|
-
} else if (l >
|
|
470
|
-
const u = 2 * Math.sqrt(1 + l - s -
|
|
469
|
+
} else if (l > r) {
|
|
470
|
+
const u = 2 * Math.sqrt(1 + l - s - r);
|
|
471
471
|
this._w = (i - c) / u, this._x = (n + a) / u, this._y = 0.25 * u, this._z = (y + h) / u;
|
|
472
472
|
} else {
|
|
473
|
-
const u = 2 * Math.sqrt(1 +
|
|
473
|
+
const u = 2 * Math.sqrt(1 + r - s - l);
|
|
474
474
|
this._w = (a - n) / u, this._x = (i + c) / u, this._y = (y + h) / u, this._z = 0.25 * u;
|
|
475
475
|
}
|
|
476
476
|
return this._onChangeCallback(), this;
|
|
@@ -480,7 +480,7 @@ class Wt {
|
|
|
480
480
|
return s < Number.EPSILON ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
|
|
481
481
|
}
|
|
482
482
|
angleTo(t) {
|
|
483
|
-
return 2 * Math.acos(Math.abs(
|
|
483
|
+
return 2 * Math.acos(Math.abs(Q(this.dot(t), -1, 1)));
|
|
484
484
|
}
|
|
485
485
|
rotateTowards(t, e) {
|
|
486
486
|
const s = this.angleTo(t);
|
|
@@ -535,8 +535,8 @@ class Wt {
|
|
|
535
535
|
const u = 1 - e;
|
|
536
536
|
return this._w = u * a + e * this._w, this._x = u * s + e * this._x, this._y = u * n + e * this._y, this._z = u * i + e * this._z, this.normalize(), this._onChangeCallback(), this;
|
|
537
537
|
}
|
|
538
|
-
const c = Math.sqrt(y), h = Math.atan2(c, l),
|
|
539
|
-
return this._w = a *
|
|
538
|
+
const c = Math.sqrt(y), h = Math.atan2(c, l), r = Math.sin((1 - e) * h) / c, _ = Math.sin(e * h) / c;
|
|
539
|
+
return this._w = a * r + this._w * _, this._x = s * r + this._x * _, this._y = n * r + this._y * _, this._z = i * r + this._z * _, this._onChangeCallback(), this;
|
|
540
540
|
}
|
|
541
541
|
slerpQuaternions(t, e, s) {
|
|
542
542
|
return this.copy(t).slerp(e, s);
|
|
@@ -574,9 +574,9 @@ class Wt {
|
|
|
574
574
|
yield this._x, yield this._y, yield this._z, yield this._w;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
class
|
|
577
|
+
class E {
|
|
578
578
|
constructor(t = 0, e = 0, s = 0) {
|
|
579
|
-
|
|
579
|
+
E.prototype.isVector3 = !0, this.x = t, this.y = e, this.z = s;
|
|
580
580
|
}
|
|
581
581
|
set(t, e, s) {
|
|
582
582
|
return s === void 0 && (s = this.z), this.x = t, this.y = e, this.z = s, this;
|
|
@@ -658,10 +658,10 @@ class $ {
|
|
|
658
658
|
return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
|
|
659
659
|
}
|
|
660
660
|
applyEuler(t) {
|
|
661
|
-
return this.applyQuaternion(
|
|
661
|
+
return this.applyQuaternion(N.setFromEuler(t));
|
|
662
662
|
}
|
|
663
663
|
applyAxisAngle(t, e) {
|
|
664
|
-
return this.applyQuaternion(
|
|
664
|
+
return this.applyQuaternion(N.setFromAxisAngle(t, e));
|
|
665
665
|
}
|
|
666
666
|
applyMatrix3(t) {
|
|
667
667
|
const e = this.x, s = this.y, n = this.z, i = t.elements;
|
|
@@ -675,8 +675,8 @@ class $ {
|
|
|
675
675
|
return this.x = (i[0] * e + i[4] * s + i[8] * n + i[12]) * a, this.y = (i[1] * e + i[5] * s + i[9] * n + i[13]) * a, this.z = (i[2] * e + i[6] * s + i[10] * n + i[14]) * a, this;
|
|
676
676
|
}
|
|
677
677
|
applyQuaternion(t) {
|
|
678
|
-
const e = this.x, s = this.y, n = this.z, i = t.x, a = t.y, l = t.z, y = t.w, c = y * e + a * n - l * s, h = y * s + l * e - i * n,
|
|
679
|
-
return this.x = c * y + _ * -i + h * -l -
|
|
678
|
+
const e = this.x, s = this.y, n = this.z, i = t.x, a = t.y, l = t.z, y = t.w, c = y * e + a * n - l * s, h = y * s + l * e - i * n, r = y * n + i * s - a * e, _ = -i * e - a * s - l * n;
|
|
679
|
+
return this.x = c * y + _ * -i + h * -l - r * -a, this.y = h * y + _ * -a + r * -i - c * -l, this.z = r * y + _ * -l + c * -a - h * -i, this;
|
|
680
680
|
}
|
|
681
681
|
project(t) {
|
|
682
682
|
return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
|
|
@@ -765,17 +765,17 @@ class $ {
|
|
|
765
765
|
return this.copy(t).multiplyScalar(s);
|
|
766
766
|
}
|
|
767
767
|
projectOnPlane(t) {
|
|
768
|
-
return
|
|
768
|
+
return X.copy(this).projectOnVector(t), this.sub(X);
|
|
769
769
|
}
|
|
770
770
|
reflect(t) {
|
|
771
|
-
return this.sub(
|
|
771
|
+
return this.sub(X.copy(t).multiplyScalar(2 * this.dot(t)));
|
|
772
772
|
}
|
|
773
773
|
angleTo(t) {
|
|
774
774
|
const e = Math.sqrt(this.lengthSq() * t.lengthSq());
|
|
775
775
|
if (e === 0)
|
|
776
776
|
return Math.PI / 2;
|
|
777
777
|
const s = this.dot(t) / e;
|
|
778
|
-
return Math.acos(
|
|
778
|
+
return Math.acos(Q(s, -1, 1));
|
|
779
779
|
}
|
|
780
780
|
distanceTo(t) {
|
|
781
781
|
return Math.sqrt(this.distanceToSquared(t));
|
|
@@ -843,22 +843,20 @@ class $ {
|
|
|
843
843
|
yield this.x, yield this.y, yield this.z;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
const
|
|
846
|
+
const X = /* @__PURE__ */ new E(), N = /* @__PURE__ */ new Ut();
|
|
847
847
|
typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
|
|
848
848
|
revision: lt
|
|
849
849
|
} }));
|
|
850
850
|
typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = lt);
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
function Zt() {
|
|
855
|
-
return j;
|
|
851
|
+
const Ft = Symbol("CONTROLS_CONTEXT_KEY"), w = tt({});
|
|
852
|
+
function Kt() {
|
|
853
|
+
return ft(Ft, w), w;
|
|
856
854
|
}
|
|
857
|
-
function
|
|
858
|
-
return Object.entries(
|
|
855
|
+
function R(o) {
|
|
856
|
+
return Object.entries(o).map(([t, e]) => {
|
|
859
857
|
let s = "string", n;
|
|
860
858
|
const i = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
861
|
-
return !V(e) && e.value || V(e) ? (s = typeof e.value, n = e.value) : (s = typeof e, n = e), s === "number" && (e.step || e.max || e.min) && (s = "range"), s === "string" && i.test(n) && (s = "color"), (n instanceof
|
|
859
|
+
return !V(e) && e.value || V(e) ? (s = typeof e.value, n = e.value) : (s = typeof e, n = e), s === "number" && (e.step || e.max || e.min) && (s = "range"), s === "string" && i.test(n) && (s = "color"), (n instanceof E || n instanceof E || n instanceof Array) && (s = "vector"), !V(e) && e.value ? {
|
|
862
860
|
...e,
|
|
863
861
|
label: e.label || t,
|
|
864
862
|
value: e.value,
|
|
@@ -872,66 +870,83 @@ function X(r) {
|
|
|
872
870
|
};
|
|
873
871
|
});
|
|
874
872
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
873
|
+
function Nt() {
|
|
874
|
+
for (const o in w)
|
|
875
|
+
delete w[o];
|
|
877
876
|
}
|
|
878
|
-
function
|
|
879
|
-
|
|
880
|
-
if (typeof
|
|
881
|
-
|
|
877
|
+
function Ge(o, t, e) {
|
|
878
|
+
const s = m();
|
|
879
|
+
if (typeof o == "string")
|
|
880
|
+
o === "fpsgraph" ? (w[o] = {
|
|
882
881
|
label: "fpsgraph",
|
|
883
882
|
visible: !0,
|
|
884
883
|
type: "fpsgraph"
|
|
885
|
-
}) :
|
|
886
|
-
label:
|
|
884
|
+
}, s.value = w[o]) : (w[o] = {
|
|
885
|
+
label: o,
|
|
887
886
|
visible: !0,
|
|
888
887
|
type: "folder",
|
|
889
|
-
controls:
|
|
890
|
-
});
|
|
891
|
-
else if (typeof
|
|
892
|
-
|
|
888
|
+
controls: R(t)
|
|
889
|
+
}, s.value = w[o]);
|
|
890
|
+
else if (typeof o == "object" && o.options)
|
|
891
|
+
w[o.label || "Dropdown"] = {
|
|
892
|
+
...e,
|
|
893
|
+
label: o.label || "Dropdown",
|
|
894
|
+
visible: !0,
|
|
895
|
+
value: o.value,
|
|
896
|
+
type: "select",
|
|
897
|
+
ref: o,
|
|
898
|
+
options: o.options
|
|
899
|
+
}, s.value = w[o.label || "Dropdown"];
|
|
900
|
+
else if (typeof o == "object" && typeof t == "string")
|
|
901
|
+
w[t] = {
|
|
893
902
|
...e,
|
|
894
903
|
label: t,
|
|
895
904
|
visible: !0,
|
|
896
|
-
value:
|
|
897
|
-
type: typeof
|
|
898
|
-
ref:
|
|
899
|
-
}
|
|
900
|
-
else if (
|
|
901
|
-
const n =
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
s =
|
|
905
|
-
|
|
905
|
+
value: o[t],
|
|
906
|
+
type: typeof o[t],
|
|
907
|
+
ref: o
|
|
908
|
+
}, s.value = w[t];
|
|
909
|
+
else if (gt(o)) {
|
|
910
|
+
const n = mt(o), i = R(n);
|
|
911
|
+
for (const a of i)
|
|
912
|
+
w[a.label] = a;
|
|
913
|
+
s.value = i;
|
|
914
|
+
} else {
|
|
915
|
+
const n = R(o);
|
|
916
|
+
for (const i of n)
|
|
917
|
+
w[i.label] = i;
|
|
918
|
+
s.value = n;
|
|
919
|
+
}
|
|
920
|
+
return bt(Nt), s;
|
|
906
921
|
}
|
|
907
|
-
const
|
|
922
|
+
const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt = { class: "text-gray-500 w-1/3" }, Ot = ["value", "min", "max", "step"], te = /* @__PURE__ */ S({
|
|
908
923
|
__name: "NumberControl",
|
|
909
924
|
props: {
|
|
910
925
|
label: {},
|
|
911
926
|
control: {}
|
|
912
927
|
},
|
|
913
928
|
emits: ["change"],
|
|
914
|
-
setup(
|
|
915
|
-
const e =
|
|
929
|
+
setup(o, { emit: t }) {
|
|
930
|
+
const e = o;
|
|
916
931
|
function s(h) {
|
|
917
|
-
const { target:
|
|
918
|
-
t("change",
|
|
932
|
+
const { target: r } = h;
|
|
933
|
+
t("change", r.valueAsNumber);
|
|
919
934
|
}
|
|
920
|
-
const n =
|
|
935
|
+
const n = H(), i = m(0), a = m(!1), l = (h) => {
|
|
921
936
|
i.value = h.clientX, a.value = !0;
|
|
922
937
|
}, y = () => {
|
|
923
938
|
a.value = !1;
|
|
924
939
|
}, c = (h) => Math.floor(Math.abs(h) / 10);
|
|
925
940
|
return I(n.x, (h) => {
|
|
926
941
|
if (a.value) {
|
|
927
|
-
const
|
|
928
|
-
|
|
942
|
+
const r = h - i.value, _ = c(r);
|
|
943
|
+
r > 0 ? t("change", e.control.value + 1 + _) : r < 0 && t("change", e.control.value - 1 + _), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), i.value = h;
|
|
929
944
|
}
|
|
930
|
-
}), (h,
|
|
931
|
-
p("label",
|
|
945
|
+
}), (h, r) => (d(), g("div", Gt, [
|
|
946
|
+
p("label", Jt, C(h.label), 1),
|
|
932
947
|
p("input", {
|
|
933
948
|
value: h.control.value,
|
|
934
|
-
class:
|
|
949
|
+
class: $(["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 }]),
|
|
935
950
|
type: "number",
|
|
936
951
|
min: h.control.min,
|
|
937
952
|
max: h.control.max,
|
|
@@ -939,234 +954,234 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
|
|
|
939
954
|
onInput: s,
|
|
940
955
|
onMousedown: l,
|
|
941
956
|
onMouseup: y
|
|
942
|
-
}, null, 42,
|
|
957
|
+
}, null, 42, Ot)
|
|
943
958
|
]));
|
|
944
959
|
}
|
|
945
|
-
}),
|
|
960
|
+
}), ee = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, se = { class: "text-gray-500 w-1/3" }, ne = ["value"], ie = /* @__PURE__ */ S({
|
|
946
961
|
__name: "TextControl",
|
|
947
962
|
props: {
|
|
948
963
|
label: {},
|
|
949
964
|
control: {}
|
|
950
965
|
},
|
|
951
966
|
emits: ["change"],
|
|
952
|
-
setup(
|
|
967
|
+
setup(o, { emit: t }) {
|
|
953
968
|
function e(s) {
|
|
954
969
|
t("change", s);
|
|
955
970
|
}
|
|
956
|
-
return (s, n) => (d(),
|
|
957
|
-
p("label",
|
|
971
|
+
return (s, n) => (d(), g("div", ee, [
|
|
972
|
+
p("label", se, C(s.label), 1),
|
|
958
973
|
p("input", {
|
|
959
974
|
value: s.control.value,
|
|
960
975
|
type: "string",
|
|
961
976
|
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",
|
|
962
977
|
onChange: e
|
|
963
|
-
}, null, 40,
|
|
978
|
+
}, null, 40, ne)
|
|
964
979
|
]));
|
|
965
980
|
}
|
|
966
|
-
}),
|
|
981
|
+
}), oe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, re = { class: "text-gray-500 w-1/3" }, ae = ["id", "checked"], he = ["for"], le = { class: "i-ic:baseline-check text-light" }, ue = /* @__PURE__ */ S({
|
|
967
982
|
__name: "BooleanControl",
|
|
968
983
|
props: {
|
|
969
984
|
label: {},
|
|
970
985
|
control: {}
|
|
971
986
|
},
|
|
972
987
|
emits: ["change"],
|
|
973
|
-
setup(
|
|
988
|
+
setup(o, { emit: t }) {
|
|
974
989
|
function e(s) {
|
|
975
990
|
const { target: n } = s;
|
|
976
991
|
t("change", n.checked);
|
|
977
992
|
}
|
|
978
|
-
return (s, n) => (d(),
|
|
979
|
-
p("label",
|
|
993
|
+
return (s, n) => (d(), g("div", oe, [
|
|
994
|
+
p("label", re, C(s.label), 1),
|
|
980
995
|
p("input", {
|
|
981
996
|
id: s.control.label,
|
|
982
997
|
checked: s.control.value,
|
|
983
998
|
class: "hidden",
|
|
984
999
|
type: "checkbox",
|
|
985
1000
|
onInput: e
|
|
986
|
-
}, null, 40,
|
|
1001
|
+
}, null, 40, ae),
|
|
987
1002
|
p("label", {
|
|
988
1003
|
for: s.control.label,
|
|
989
1004
|
class: "inline-flex items-center cursor-pointer"
|
|
990
1005
|
}, [
|
|
991
1006
|
p("span", {
|
|
992
|
-
class:
|
|
1007
|
+
class: $([{ "bg-dark-500": s.control.value, "bg-gray-200": !s.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
|
|
993
1008
|
}, [
|
|
994
|
-
et(p("i",
|
|
1009
|
+
et(p("i", le, null, 512), [
|
|
995
1010
|
[st, s.control.value]
|
|
996
1011
|
])
|
|
997
1012
|
], 2)
|
|
998
|
-
], 8,
|
|
1013
|
+
], 8, he)
|
|
999
1014
|
]));
|
|
1000
1015
|
}
|
|
1001
|
-
}),
|
|
1016
|
+
}), ce = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, ye = ["value", "min", "max", "step"], _e = ["value", "min", "max", "step"], xe = /* @__PURE__ */ S({
|
|
1002
1017
|
__name: "SliderControl",
|
|
1003
1018
|
props: {
|
|
1004
1019
|
label: {},
|
|
1005
1020
|
control: {}
|
|
1006
1021
|
},
|
|
1007
1022
|
emits: ["change"],
|
|
1008
|
-
setup(
|
|
1009
|
-
const e =
|
|
1010
|
-
function s(
|
|
1011
|
-
const { target: _ } =
|
|
1023
|
+
setup(o, { emit: t }) {
|
|
1024
|
+
const e = o;
|
|
1025
|
+
function s(r) {
|
|
1026
|
+
const { target: _ } = r;
|
|
1012
1027
|
t("change", _.valueAsNumber);
|
|
1013
1028
|
}
|
|
1014
|
-
const n =
|
|
1029
|
+
const n = T(() => ({
|
|
1015
1030
|
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%)`
|
|
1016
|
-
})), i =
|
|
1017
|
-
a.value =
|
|
1031
|
+
})), i = H(), a = m(0), l = m(!1), y = (r) => {
|
|
1032
|
+
a.value = r.clientX, l.value = !0;
|
|
1018
1033
|
}, c = () => {
|
|
1019
1034
|
l.value = !1;
|
|
1020
|
-
}, h = (
|
|
1021
|
-
return I(i.x, (
|
|
1035
|
+
}, h = (r) => Math.floor(Math.abs(r) / 10);
|
|
1036
|
+
return I(i.x, (r) => {
|
|
1022
1037
|
if (l.value) {
|
|
1023
|
-
const _ =
|
|
1024
|
-
_ > 0 ? t("change", e.control.value + 1 + u) : _ < 0 && t("change", e.control.value - 1 + u), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), a.value =
|
|
1038
|
+
const _ = r - a.value, u = h(_);
|
|
1039
|
+
_ > 0 ? t("change", e.control.value + 1 + u) : _ < 0 && t("change", e.control.value - 1 + u), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), a.value = r;
|
|
1025
1040
|
}
|
|
1026
|
-
}), (
|
|
1041
|
+
}), (r, _) => (d(), g("div", ce, [
|
|
1027
1042
|
p("label", {
|
|
1028
|
-
class:
|
|
1043
|
+
class: $(["text-gray-500 w-1/3", { "flex justify-between items-center": r.control.icon }])
|
|
1029
1044
|
}, [
|
|
1030
|
-
|
|
1045
|
+
zt(C(r.label) + " ", 1),
|
|
1031
1046
|
p("i", {
|
|
1032
|
-
class:
|
|
1047
|
+
class: $(`i-${r.control.icon}`)
|
|
1033
1048
|
}, null, 2)
|
|
1034
1049
|
], 2),
|
|
1035
1050
|
p("input", {
|
|
1036
|
-
value:
|
|
1051
|
+
value: r.control.value,
|
|
1037
1052
|
class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
|
|
1038
|
-
style:
|
|
1053
|
+
style: wt(n.value),
|
|
1039
1054
|
type: "range",
|
|
1040
|
-
min:
|
|
1041
|
-
max:
|
|
1042
|
-
step:
|
|
1055
|
+
min: r.control.min,
|
|
1056
|
+
max: r.control.max,
|
|
1057
|
+
step: r.control.step,
|
|
1043
1058
|
onInput: s
|
|
1044
|
-
}, null, 44,
|
|
1059
|
+
}, null, 44, ye),
|
|
1045
1060
|
p("input", {
|
|
1046
|
-
value:
|
|
1047
|
-
class:
|
|
1061
|
+
value: r.control.value,
|
|
1062
|
+
class: $(["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": l.value }]),
|
|
1048
1063
|
type: "number",
|
|
1049
|
-
min:
|
|
1050
|
-
max:
|
|
1051
|
-
step:
|
|
1064
|
+
min: r.control.min,
|
|
1065
|
+
max: r.control.max,
|
|
1066
|
+
step: r.control.step,
|
|
1052
1067
|
onInput: s,
|
|
1053
1068
|
onMousedown: y,
|
|
1054
1069
|
onMouseup: c
|
|
1055
|
-
}, null, 42,
|
|
1070
|
+
}, null, 42, _e)
|
|
1056
1071
|
]));
|
|
1057
1072
|
}
|
|
1058
1073
|
});
|
|
1059
|
-
const
|
|
1060
|
-
const e =
|
|
1074
|
+
const pe = (o, t) => {
|
|
1075
|
+
const e = o.__vccOpts || o;
|
|
1061
1076
|
for (const [s, n] of t)
|
|
1062
1077
|
e[s] = n;
|
|
1063
1078
|
return e;
|
|
1064
|
-
},
|
|
1079
|
+
}, de = /* @__PURE__ */ pe(xe, [["__scopeId", "data-v-743fd350"]]), fe = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, ge = { class: "text-gray-500 w-1/3" }, me = ["value"], be = ["value"], ze = /* @__PURE__ */ S({
|
|
1065
1080
|
__name: "ColorControl",
|
|
1066
1081
|
props: {
|
|
1067
1082
|
label: {},
|
|
1068
1083
|
control: {}
|
|
1069
1084
|
},
|
|
1070
1085
|
emits: ["change"],
|
|
1071
|
-
setup(
|
|
1086
|
+
setup(o, { emit: t }) {
|
|
1072
1087
|
function e(s) {
|
|
1073
1088
|
const { target: n } = s;
|
|
1074
1089
|
t("change", n.value);
|
|
1075
1090
|
}
|
|
1076
|
-
return (s, n) => (d(),
|
|
1077
|
-
p("label",
|
|
1091
|
+
return (s, n) => (d(), g("div", fe, [
|
|
1092
|
+
p("label", ge, C(s.label), 1),
|
|
1078
1093
|
p("input", {
|
|
1079
1094
|
value: s.control.value,
|
|
1080
1095
|
type: "color",
|
|
1081
1096
|
onInput: e
|
|
1082
|
-
}, null, 40,
|
|
1097
|
+
}, null, 40, me),
|
|
1083
1098
|
p("input", {
|
|
1084
1099
|
value: s.control.value,
|
|
1085
1100
|
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",
|
|
1086
1101
|
type: "text",
|
|
1087
1102
|
onInput: e
|
|
1088
|
-
}, null, 40,
|
|
1103
|
+
}, null, 40, be)
|
|
1089
1104
|
]));
|
|
1090
1105
|
}
|
|
1091
1106
|
});
|
|
1092
|
-
function
|
|
1093
|
-
return typeof
|
|
1107
|
+
function we(o) {
|
|
1108
|
+
return typeof o == "number" ? [o, o, o] : o instanceof E ? [o.x, o.y, o.z] : o;
|
|
1094
1109
|
}
|
|
1095
|
-
const
|
|
1110
|
+
const Me = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve = { class: "text-gray-500 w-1/3" }, Ce = { class: "w-2/3 flex justify-between gap-1" }, Se = {
|
|
1096
1111
|
key: 0,
|
|
1097
1112
|
class: "font-bold px-0.5 py-1 text-0.65rem text-gray-300"
|
|
1098
|
-
},
|
|
1113
|
+
}, ke = ["value", "onInput", "onMousedown", "onMouseup"], $e = /* @__PURE__ */ S({
|
|
1099
1114
|
__name: "VectorControl",
|
|
1100
1115
|
props: {
|
|
1101
1116
|
label: {},
|
|
1102
1117
|
control: {}
|
|
1103
1118
|
},
|
|
1104
1119
|
emits: ["change"],
|
|
1105
|
-
setup(
|
|
1106
|
-
const e =
|
|
1107
|
-
a.value =
|
|
1108
|
-
}, y = (x,
|
|
1109
|
-
a.value =
|
|
1110
|
-
}, c = (x) => Math.floor(Math.abs(x) / 10), h =
|
|
1111
|
-
function u(x,
|
|
1120
|
+
setup(o, { emit: t }) {
|
|
1121
|
+
const e = o, s = H(), n = m(0), i = m(!1), a = m(0), l = (x, b) => {
|
|
1122
|
+
a.value = b, n.value = x.clientX, i.value = !0;
|
|
1123
|
+
}, y = (x, b) => {
|
|
1124
|
+
a.value = b, i.value = !1;
|
|
1125
|
+
}, c = (x) => Math.floor(Math.abs(x) / 10), h = T(() => we(e.control.value)), r = T(() => Object.keys(e.control.value)), _ = T(() => e.control.value instanceof W || e.control.value instanceof E);
|
|
1126
|
+
function u(x, b) {
|
|
1112
1127
|
const { value: z } = e.control, { target: f } = x;
|
|
1113
|
-
a.value =
|
|
1128
|
+
a.value = b, z[_.value ? r.value[a.value] : a.value] = parseInt(f.value, 10), t("change", z);
|
|
1114
1129
|
}
|
|
1115
1130
|
return I(s.x, (x) => {
|
|
1116
1131
|
if (i.value) {
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1132
|
+
const b = x - n.value, z = c(b), { value: f } = e.control, M = _.value ? r.value[a.value] : a.value;
|
|
1133
|
+
b > 0 ? f[M] += 1 + z : b < 0 && (f[M] -= 1 + z), e.control.min !== void 0 && f < e.control.min && (f[M] = e.control.min), e.control.max !== void 0 && f > e.control.max && (f[M] = e.control.max), t("change", f), n.value = x;
|
|
1119
1134
|
}
|
|
1120
|
-
}), (x,
|
|
1121
|
-
p("label",
|
|
1122
|
-
p("div",
|
|
1123
|
-
(d(!0),
|
|
1135
|
+
}), (x, b) => (d(), g("div", Me, [
|
|
1136
|
+
p("label", ve, C(x.label), 1),
|
|
1137
|
+
p("div", Ce, [
|
|
1138
|
+
(d(!0), g(P, null, L(h.value, (z, f) => (d(), g("div", {
|
|
1124
1139
|
key: x.label + f,
|
|
1125
1140
|
class: "flex items-center w-1/3 bg-gray-100 rounded"
|
|
1126
1141
|
}, [
|
|
1127
|
-
|
|
1142
|
+
r.value[f] && _.value ? (d(), g("span", Se, C(r.value[f]), 1)) : nt("", !0),
|
|
1128
1143
|
p("input", {
|
|
1129
1144
|
type: "text",
|
|
1130
|
-
class:
|
|
1145
|
+
class: $(["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": i.value }]),
|
|
1131
1146
|
value: h.value[f].toFixed(2),
|
|
1132
1147
|
onInput: (M) => u(M, f),
|
|
1133
1148
|
onMousedown: (M) => l(M, f),
|
|
1134
1149
|
onMouseup: (M) => y(M, f)
|
|
1135
|
-
}, null, 42,
|
|
1150
|
+
}, null, 42, ke)
|
|
1136
1151
|
]))), 128))
|
|
1137
1152
|
])
|
|
1138
1153
|
]));
|
|
1139
1154
|
}
|
|
1140
|
-
}),
|
|
1155
|
+
}), Ee = { class: "mb-4" }, Te = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ S({
|
|
1141
1156
|
__name: "Folder",
|
|
1142
1157
|
props: {
|
|
1143
1158
|
control: {}
|
|
1144
1159
|
},
|
|
1145
|
-
setup(
|
|
1160
|
+
setup(o) {
|
|
1146
1161
|
function t(n, i) {
|
|
1147
1162
|
i.value = n;
|
|
1148
1163
|
}
|
|
1149
|
-
const e =
|
|
1164
|
+
const e = m(!1), s = () => {
|
|
1150
1165
|
e.value = !e.value;
|
|
1151
1166
|
};
|
|
1152
|
-
return (n, i) => (d(),
|
|
1167
|
+
return (n, i) => (d(), g("div", Ee, [
|
|
1153
1168
|
p("button", {
|
|
1154
1169
|
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",
|
|
1155
1170
|
onClick: s
|
|
1156
1171
|
}, [
|
|
1157
1172
|
p("span", null, C(n.control.label), 1),
|
|
1158
1173
|
p("i", {
|
|
1159
|
-
class:
|
|
1174
|
+
class: $(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
|
|
1160
1175
|
}, null, 2)
|
|
1161
1176
|
]),
|
|
1162
|
-
Mt(
|
|
1177
|
+
Mt(vt, {
|
|
1163
1178
|
name: "slide",
|
|
1164
1179
|
"enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
|
|
1165
1180
|
"leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
|
|
1166
1181
|
}, {
|
|
1167
1182
|
default: it(() => [
|
|
1168
|
-
et(p("div",
|
|
1169
|
-
(d(!0),
|
|
1183
|
+
et(p("div", Te, [
|
|
1184
|
+
(d(!0), g(P, null, L(n.control.controls, (a) => (d(), v(ut, {
|
|
1170
1185
|
key: a.label,
|
|
1171
1186
|
control: a,
|
|
1172
1187
|
onChange: (l) => t(l, a)
|
|
@@ -1179,26 +1194,26 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1179
1194
|
})
|
|
1180
1195
|
]));
|
|
1181
1196
|
}
|
|
1182
|
-
}),
|
|
1197
|
+
}), Ae = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, je = { class: "text-gray-500 w-1/3" }, qe = { 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" }, Pe = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, De = ["points"], G = 160, Y = 40, A = 2, J = 100, O = 20, Le = /* @__PURE__ */ S({
|
|
1183
1198
|
__name: "FPSGraph",
|
|
1184
1199
|
props: {
|
|
1185
1200
|
label: {},
|
|
1186
1201
|
control: {}
|
|
1187
1202
|
},
|
|
1188
|
-
setup(
|
|
1189
|
-
const t =
|
|
1203
|
+
setup(o) {
|
|
1204
|
+
const t = $t({ every: J }), e = m(""), s = m([]), n = m(G / A);
|
|
1190
1205
|
let i = performance.now();
|
|
1191
|
-
return
|
|
1206
|
+
return Et(({ timestamp: a }) => {
|
|
1192
1207
|
a - i >= J && (i = a, s.value.push(t.value), s.value.length > n.value && s.value.shift(), e.value = s.value.map(
|
|
1193
|
-
(l, y) => `${y * A},${
|
|
1208
|
+
(l, y) => `${y * A},${Y + O - A / 2 - l * (Y + O - A) / 120}`
|
|
1194
1209
|
).join(" "));
|
|
1195
|
-
}), (a, l) => (d(),
|
|
1196
|
-
p("label",
|
|
1197
|
-
p("div",
|
|
1198
|
-
p("div",
|
|
1199
|
-
(d(),
|
|
1210
|
+
}), (a, l) => (d(), g("div", Ae, [
|
|
1211
|
+
p("label", je, C(a.label), 1),
|
|
1212
|
+
p("div", qe, [
|
|
1213
|
+
p("div", Pe, C(Math.round(j(t))) + " FPS", 1),
|
|
1214
|
+
(d(), g("svg", {
|
|
1200
1215
|
width: G,
|
|
1201
|
-
height:
|
|
1216
|
+
height: Y,
|
|
1202
1217
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1203
1218
|
class: "bg-gray-100"
|
|
1204
1219
|
}, [
|
|
@@ -1209,91 +1224,121 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1209
1224
|
"stroke-width": A,
|
|
1210
1225
|
"stroke-linecap": "round",
|
|
1211
1226
|
"stroke-linejoin": "round"
|
|
1212
|
-
}, null, 8,
|
|
1227
|
+
}, null, 8, De)
|
|
1213
1228
|
]))
|
|
1214
1229
|
])
|
|
1215
1230
|
]));
|
|
1216
1231
|
}
|
|
1217
|
-
}),
|
|
1232
|
+
}), Ve = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Xe = { class: "text-gray-500 w-1/3" }, Re = ["value"], Ye = ["value"], He = /* @__PURE__ */ S({
|
|
1233
|
+
__name: "SelectControl",
|
|
1234
|
+
props: {
|
|
1235
|
+
label: {},
|
|
1236
|
+
control: {}
|
|
1237
|
+
},
|
|
1238
|
+
emits: ["change"],
|
|
1239
|
+
setup(o, { emit: t }) {
|
|
1240
|
+
function e(s) {
|
|
1241
|
+
t("change", s.target.value);
|
|
1242
|
+
}
|
|
1243
|
+
return (s, n) => (d(), g("div", Ve, [
|
|
1244
|
+
p("label", Xe, C(s.label), 1),
|
|
1245
|
+
p("select", {
|
|
1246
|
+
value: s.control.value,
|
|
1247
|
+
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",
|
|
1248
|
+
onChange: e
|
|
1249
|
+
}, [
|
|
1250
|
+
(d(!0), g(P, null, L(s.control.options, (i) => (d(), g("option", {
|
|
1251
|
+
key: i.value,
|
|
1252
|
+
value: i.value
|
|
1253
|
+
}, C(i.text), 9, Ye))), 128))
|
|
1254
|
+
], 40, Re)
|
|
1255
|
+
]));
|
|
1256
|
+
}
|
|
1257
|
+
}), ut = /* @__PURE__ */ S({
|
|
1218
1258
|
__name: "ControlInput",
|
|
1219
1259
|
props: {
|
|
1220
1260
|
control: {}
|
|
1221
1261
|
},
|
|
1222
1262
|
emits: ["change"],
|
|
1223
|
-
setup(
|
|
1263
|
+
setup(o, { emit: t }) {
|
|
1224
1264
|
function e(s) {
|
|
1225
1265
|
t("change", s);
|
|
1226
1266
|
}
|
|
1227
|
-
return (s, n) => s.control.visible ? (d(),
|
|
1228
|
-
s.control.type === "color" ? (d(),
|
|
1267
|
+
return (s, n) => s.control.visible ? (d(), g(P, { key: 0 }, [
|
|
1268
|
+
s.control.type === "color" ? (d(), v(ze, {
|
|
1229
1269
|
key: 0,
|
|
1230
1270
|
label: s.control.label,
|
|
1231
1271
|
control: s.control,
|
|
1232
1272
|
onChange: e
|
|
1233
|
-
}, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(),
|
|
1273
|
+
}, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), v($e, {
|
|
1234
1274
|
key: 1,
|
|
1235
1275
|
label: s.control.label,
|
|
1236
1276
|
control: s.control,
|
|
1237
1277
|
onChange: e
|
|
1238
|
-
}, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(),
|
|
1278
|
+
}, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), v(ue, {
|
|
1239
1279
|
key: 2,
|
|
1240
1280
|
label: s.control.label,
|
|
1241
1281
|
control: s.control,
|
|
1242
1282
|
onChange: e
|
|
1243
|
-
}, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(),
|
|
1283
|
+
}, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), v(Le, {
|
|
1244
1284
|
key: 3,
|
|
1245
1285
|
label: s.control.label,
|
|
1246
1286
|
control: s.control
|
|
1247
|
-
}, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(),
|
|
1287
|
+
}, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), v(Ie, {
|
|
1248
1288
|
key: 4,
|
|
1249
1289
|
label: s.control.label,
|
|
1250
1290
|
control: s.control
|
|
1251
|
-
}, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(),
|
|
1291
|
+
}, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), v(te, {
|
|
1252
1292
|
key: 5,
|
|
1253
1293
|
label: s.control.label,
|
|
1254
1294
|
control: s.control,
|
|
1255
1295
|
onChange: e
|
|
1256
|
-
}, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(),
|
|
1296
|
+
}, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), v(de, {
|
|
1257
1297
|
key: 6,
|
|
1258
1298
|
label: s.control.label,
|
|
1259
1299
|
control: s.control,
|
|
1260
1300
|
onChange: e
|
|
1261
|
-
}, null, 8, ["label", "control"])) : (d(),
|
|
1301
|
+
}, null, 8, ["label", "control"])) : s.control.type === "select" ? (d(), v(He, {
|
|
1262
1302
|
key: 7,
|
|
1263
1303
|
label: s.control.label,
|
|
1264
1304
|
control: s.control,
|
|
1265
1305
|
onChange: e
|
|
1306
|
+
}, null, 8, ["label", "control"])) : (d(), v(ie, {
|
|
1307
|
+
key: 8,
|
|
1308
|
+
label: s.control.label,
|
|
1309
|
+
control: s.control,
|
|
1310
|
+
onChange: e
|
|
1266
1311
|
}, null, 8, ["label", "control"]))
|
|
1267
1312
|
], 64)) : nt("", !0);
|
|
1268
1313
|
}
|
|
1269
|
-
}),
|
|
1314
|
+
}), Qe = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, We = /* @__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), Ze = /* @__PURE__ */ p("div", null, [
|
|
1270
1315
|
/* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
|
|
1271
1316
|
/* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
|
|
1272
1317
|
/* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" })
|
|
1273
|
-
], -1),
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1318
|
+
], -1), Be = /* @__PURE__ */ p("div", null, null, -1), Ue = [
|
|
1319
|
+
We,
|
|
1320
|
+
Ze,
|
|
1321
|
+
Be
|
|
1322
|
+
], Fe = 280, Je = /* @__PURE__ */ S({
|
|
1278
1323
|
__name: "TresLeches",
|
|
1279
|
-
setup(
|
|
1280
|
-
const { width: t } =
|
|
1324
|
+
setup(o) {
|
|
1325
|
+
const { width: t } = Tt(), e = m(null), s = Kt();
|
|
1281
1326
|
function n(i, a) {
|
|
1282
1327
|
a.ref && (a.ref[a.label] = i), a.value = i;
|
|
1283
1328
|
}
|
|
1284
|
-
return (i, a) => (d(),
|
|
1285
|
-
"initial-value": { x:
|
|
1329
|
+
return (i, a) => (d(), v(j(Qt), {
|
|
1330
|
+
"initial-value": { x: j(t) - Fe - 20, y: 10 },
|
|
1286
1331
|
class: "fixed select-none z-24 w-280px font-sans text-xs",
|
|
1287
1332
|
handle: e.value
|
|
1288
1333
|
}, {
|
|
1289
1334
|
default: it(() => [
|
|
1290
|
-
p("div",
|
|
1335
|
+
p("div", Qe, [
|
|
1291
1336
|
p("header", {
|
|
1292
1337
|
ref_key: "handle",
|
|
1293
1338
|
ref: e,
|
|
1294
1339
|
class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
|
|
1295
|
-
},
|
|
1296
|
-
(d(!0),
|
|
1340
|
+
}, Ue, 512),
|
|
1341
|
+
(d(!0), g(P, null, L(j(s), (l) => (d(), v(ut, {
|
|
1297
1342
|
key: l.label,
|
|
1298
1343
|
control: l,
|
|
1299
1344
|
onChange: (y) => n(y, l)
|
|
@@ -1305,6 +1350,6 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1305
1350
|
}
|
|
1306
1351
|
});
|
|
1307
1352
|
export {
|
|
1308
|
-
|
|
1309
|
-
|
|
1353
|
+
Je as TresLeches,
|
|
1354
|
+
Ge as useControls
|
|
1310
1355
|
};
|