@tresjs/leches 0.3.1 → 0.4.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/SelectControl.vue.d.ts +24 -0
- package/dist/composables/useControls.d.ts +8 -0
- package/dist/style.css +2 -2
- package/dist/tresleches.js +293 -253
- package/dist/tresleches.umd.cjs +3 -3
- package/package.json +17 -12
package/dist/tresleches.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.
|
|
3
|
+
* version: v0.4.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 C, computed as E, 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 v, normalizeClass as k, withDirectives as et, vShow as st, createTextVNode as zt, normalizeStyle as Mt, Fragment as P, renderList as L, createCommentVNode as nt, createVNode as wt, Transition as vt, withCtx as it, createBlock as w } from "vue";
|
|
9
|
+
import { useStorage as Ct, isClient as St, useDraggable as kt, useMouse as F, 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", ht = () => {
|
|
17
|
+
}, N = /* @__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: ht }))) :
|
|
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: ht }))) : 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
|
|
36
|
+
if (typeof o[0] == "string" || Array.isArray(o[0]) ? ([e, s, n] = o, t = qt) : [t, e, s, n] = o, !t)
|
|
37
37
|
return ht;
|
|
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, B = Object.getOwnPropertySymbols, Xt = Object.prototype.hasOwnProperty, Rt = Object.prototype.propertyIsEnumerable, U = (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
|
-
|
|
56
|
+
Xt.call(t, e) && U(o, e, t[e]);
|
|
57
57
|
if (B)
|
|
58
58
|
for (var e of B(t))
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
const
|
|
59
|
+
Rt.call(t, e) && U(o, e, t[e]);
|
|
60
|
+
return o;
|
|
61
|
+
}, Ft = (o, t) => Lt(o, Vt(t));
|
|
62
|
+
const Ht = /* @__PURE__ */ C({
|
|
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 = E(() => {
|
|
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, Ft(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 at(
|
|
102
|
-
const t = window.getComputedStyle(
|
|
103
|
-
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" &&
|
|
101
|
+
function at(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 =
|
|
106
|
+
const e = o.parentNode;
|
|
107
107
|
return !e || e.tagName === "BODY" ? !1 : at(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
const t =
|
|
110
|
+
function Qt(o) {
|
|
111
|
+
const t = o || window.event, e = t.target;
|
|
112
112
|
return at(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const e =
|
|
114
|
+
function Wt(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 || (N && (s = Pt(
|
|
128
128
|
l,
|
|
129
129
|
"touchmove",
|
|
130
130
|
(y) => {
|
|
131
|
-
|
|
131
|
+
Qt(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 || (N && (s == null || s()), l.style.overflow = n, e.value = !1);
|
|
138
138
|
};
|
|
139
|
-
return
|
|
139
|
+
return ot(a), E({
|
|
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 Zt() {
|
|
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 = Wt(e, s.value);
|
|
156
156
|
I(t, (i) => n.value = i);
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
Zt();
|
|
160
160
|
/**
|
|
161
161
|
* @license
|
|
162
162
|
* Copyright 2010-2023 Three.js Authors
|
|
163
163
|
* SPDX-License-Identifier: MIT
|
|
164
164
|
*/
|
|
165
165
|
const lt = "153";
|
|
166
|
-
function
|
|
167
|
-
return Math.max(t, Math.min(e,
|
|
166
|
+
function H(o, t, e) {
|
|
167
|
+
return Math.max(t, Math.min(e, o));
|
|
168
168
|
}
|
|
169
|
-
class
|
|
169
|
+
class Q {
|
|
170
170
|
constructor(t = 0, e = 0) {
|
|
171
|
-
|
|
171
|
+
Q.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(H(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 Nt {
|
|
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 S = Math.sqrt(
|
|
384
|
-
z = Math.sin(z *
|
|
381
|
+
const f = y * _ + c * u + h * x + r * b, M = f >= 0 ? 1 : -1, W = 1 - f * f;
|
|
382
|
+
if (W > Number.EPSILON) {
|
|
383
|
+
const S = Math.sqrt(W), Z = Math.atan2(S, f * M);
|
|
384
|
+
z = Math.sin(z * Z) / S, l = Math.sin(l * Z) / S;
|
|
385
385
|
}
|
|
386
|
-
const
|
|
387
|
-
if (y = y * z + _ *
|
|
388
|
-
const S = 1 / Math.sqrt(y * y + c * c + h * h +
|
|
389
|
-
y *= S, c *= S, h *= S,
|
|
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 S = 1 / Math.sqrt(y * y + c * c + h * h + r * r);
|
|
389
|
+
y *= S, c *= S, h *= S, r *= S;
|
|
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(H(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);
|
|
@@ -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(H(s, -1, 1));
|
|
779
779
|
}
|
|
780
780
|
distanceTo(t) {
|
|
781
781
|
return Math.sqrt(this.distanceToSquared(t));
|
|
@@ -843,19 +843,19 @@ class $ {
|
|
|
843
843
|
yield this.x, yield this.y, yield this.z;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
const
|
|
846
|
+
const X = /* @__PURE__ */ new $(), K = /* @__PURE__ */ new Nt();
|
|
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
|
|
851
|
+
const Bt = Symbol("CONTROLS_CONTEXT_KEY"), T = tt({
|
|
852
852
|
controls: []
|
|
853
853
|
});
|
|
854
|
-
function
|
|
855
|
-
return
|
|
854
|
+
function Ut() {
|
|
855
|
+
return ft(Bt, T), T;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return Object.entries(
|
|
857
|
+
function R(o) {
|
|
858
|
+
return Object.entries(o).map(([t, e]) => {
|
|
859
859
|
let s = "string", n;
|
|
860
860
|
const i = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
861
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 $ || n instanceof $ || n instanceof Array) && (s = "vector"), !V(e) && e.value ? {
|
|
@@ -872,63 +872,73 @@ function X(r) {
|
|
|
872
872
|
};
|
|
873
873
|
});
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
875
|
+
function Kt() {
|
|
876
|
+
T.controls = [];
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function Ge(o, t, e) {
|
|
879
879
|
let s = [];
|
|
880
|
-
if (typeof
|
|
881
|
-
|
|
880
|
+
if (typeof o == "string")
|
|
881
|
+
o === "fpsgraph" ? s.push({
|
|
882
882
|
label: "fpsgraph",
|
|
883
883
|
visible: !0,
|
|
884
884
|
type: "fpsgraph"
|
|
885
885
|
}) : s.push({
|
|
886
|
-
label:
|
|
886
|
+
label: o,
|
|
887
887
|
visible: !0,
|
|
888
888
|
type: "folder",
|
|
889
|
-
controls:
|
|
889
|
+
controls: R(t)
|
|
890
|
+
});
|
|
891
|
+
else if (typeof o == "object" && o.options)
|
|
892
|
+
s.push({
|
|
893
|
+
...e,
|
|
894
|
+
label: o.label || "Dropdown",
|
|
895
|
+
visible: !0,
|
|
896
|
+
value: o.value,
|
|
897
|
+
type: "select",
|
|
898
|
+
ref: o,
|
|
899
|
+
options: o.options
|
|
890
900
|
});
|
|
891
|
-
else if (typeof
|
|
901
|
+
else if (typeof o == "object" && typeof t == "string")
|
|
892
902
|
s.push({
|
|
893
903
|
...e,
|
|
894
904
|
label: t,
|
|
895
905
|
visible: !0,
|
|
896
|
-
value:
|
|
897
|
-
type: typeof
|
|
898
|
-
ref:
|
|
906
|
+
value: o[t],
|
|
907
|
+
type: typeof o[t],
|
|
908
|
+
ref: o
|
|
899
909
|
});
|
|
900
|
-
else if (
|
|
901
|
-
const n =
|
|
902
|
-
s =
|
|
910
|
+
else if (gt(o)) {
|
|
911
|
+
const n = mt(o);
|
|
912
|
+
s = R(n);
|
|
903
913
|
} else
|
|
904
|
-
s =
|
|
905
|
-
return
|
|
914
|
+
s = R(o);
|
|
915
|
+
return T.controls = [...T.controls, ...s], bt(Kt), { state: T, controls: s };
|
|
906
916
|
}
|
|
907
|
-
const
|
|
917
|
+
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__ */ C({
|
|
908
918
|
__name: "NumberControl",
|
|
909
919
|
props: {
|
|
910
920
|
label: {},
|
|
911
921
|
control: {}
|
|
912
922
|
},
|
|
913
923
|
emits: ["change"],
|
|
914
|
-
setup(
|
|
915
|
-
const e =
|
|
924
|
+
setup(o, { emit: t }) {
|
|
925
|
+
const e = o;
|
|
916
926
|
function s(h) {
|
|
917
|
-
const { target:
|
|
918
|
-
t("change",
|
|
927
|
+
const { target: r } = h;
|
|
928
|
+
t("change", r.valueAsNumber);
|
|
919
929
|
}
|
|
920
|
-
const n =
|
|
930
|
+
const n = F(), i = m(0), a = m(!1), l = (h) => {
|
|
921
931
|
i.value = h.clientX, a.value = !0;
|
|
922
932
|
}, y = () => {
|
|
923
933
|
a.value = !1;
|
|
924
934
|
}, c = (h) => Math.floor(Math.abs(h) / 10);
|
|
925
935
|
return I(n.x, (h) => {
|
|
926
936
|
if (a.value) {
|
|
927
|
-
const
|
|
928
|
-
|
|
937
|
+
const r = h - i.value, _ = c(r);
|
|
938
|
+
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
939
|
}
|
|
930
|
-
}), (h,
|
|
931
|
-
p("label",
|
|
940
|
+
}), (h, r) => (d(), g("div", Gt, [
|
|
941
|
+
p("label", Jt, v(h.label), 1),
|
|
932
942
|
p("input", {
|
|
933
943
|
value: h.control.value,
|
|
934
944
|
class: k(["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 }]),
|
|
@@ -939,51 +949,51 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
|
|
|
939
949
|
onInput: s,
|
|
940
950
|
onMousedown: l,
|
|
941
951
|
onMouseup: y
|
|
942
|
-
}, null, 42,
|
|
952
|
+
}, null, 42, Ot)
|
|
943
953
|
]));
|
|
944
954
|
}
|
|
945
|
-
}),
|
|
955
|
+
}), 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__ */ C({
|
|
946
956
|
__name: "TextControl",
|
|
947
957
|
props: {
|
|
948
958
|
label: {},
|
|
949
959
|
control: {}
|
|
950
960
|
},
|
|
951
961
|
emits: ["change"],
|
|
952
|
-
setup(
|
|
962
|
+
setup(o, { emit: t }) {
|
|
953
963
|
function e(s) {
|
|
954
964
|
t("change", s);
|
|
955
965
|
}
|
|
956
|
-
return (s, n) => (d(),
|
|
957
|
-
p("label",
|
|
966
|
+
return (s, n) => (d(), g("div", ee, [
|
|
967
|
+
p("label", se, v(s.label), 1),
|
|
958
968
|
p("input", {
|
|
959
969
|
value: s.control.value,
|
|
960
970
|
type: "string",
|
|
961
971
|
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
972
|
onChange: e
|
|
963
|
-
}, null, 40,
|
|
973
|
+
}, null, 40, ne)
|
|
964
974
|
]));
|
|
965
975
|
}
|
|
966
|
-
}),
|
|
976
|
+
}), oe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, re = { class: "text-gray-500 w-1/3" }, he = ["id", "checked"], ae = ["for"], le = { class: "i-ic:baseline-check text-light" }, ue = /* @__PURE__ */ C({
|
|
967
977
|
__name: "BooleanControl",
|
|
968
978
|
props: {
|
|
969
979
|
label: {},
|
|
970
980
|
control: {}
|
|
971
981
|
},
|
|
972
982
|
emits: ["change"],
|
|
973
|
-
setup(
|
|
983
|
+
setup(o, { emit: t }) {
|
|
974
984
|
function e(s) {
|
|
975
985
|
const { target: n } = s;
|
|
976
986
|
t("change", n.checked);
|
|
977
987
|
}
|
|
978
|
-
return (s, n) => (d(),
|
|
979
|
-
p("label",
|
|
988
|
+
return (s, n) => (d(), g("div", oe, [
|
|
989
|
+
p("label", re, v(s.label), 1),
|
|
980
990
|
p("input", {
|
|
981
991
|
id: s.control.label,
|
|
982
992
|
checked: s.control.value,
|
|
983
993
|
class: "hidden",
|
|
984
994
|
type: "checkbox",
|
|
985
995
|
onInput: e
|
|
986
|
-
}, null, 40,
|
|
996
|
+
}, null, 40, he),
|
|
987
997
|
p("label", {
|
|
988
998
|
for: s.control.label,
|
|
989
999
|
class: "inline-flex items-center cursor-pointer"
|
|
@@ -991,140 +1001,140 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
|
|
|
991
1001
|
p("span", {
|
|
992
1002
|
class: k([{ "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
1003
|
}, [
|
|
994
|
-
et(p("i",
|
|
1004
|
+
et(p("i", le, null, 512), [
|
|
995
1005
|
[st, s.control.value]
|
|
996
1006
|
])
|
|
997
1007
|
], 2)
|
|
998
|
-
], 8,
|
|
1008
|
+
], 8, ae)
|
|
999
1009
|
]));
|
|
1000
1010
|
}
|
|
1001
|
-
}),
|
|
1011
|
+
}), 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__ */ C({
|
|
1002
1012
|
__name: "SliderControl",
|
|
1003
1013
|
props: {
|
|
1004
1014
|
label: {},
|
|
1005
1015
|
control: {}
|
|
1006
1016
|
},
|
|
1007
1017
|
emits: ["change"],
|
|
1008
|
-
setup(
|
|
1009
|
-
const e =
|
|
1010
|
-
function s(
|
|
1011
|
-
const { target: _ } =
|
|
1018
|
+
setup(o, { emit: t }) {
|
|
1019
|
+
const e = o;
|
|
1020
|
+
function s(r) {
|
|
1021
|
+
const { target: _ } = r;
|
|
1012
1022
|
t("change", _.valueAsNumber);
|
|
1013
1023
|
}
|
|
1014
1024
|
const n = E(() => ({
|
|
1015
1025
|
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 =
|
|
1026
|
+
})), i = F(), a = m(0), l = m(!1), y = (r) => {
|
|
1027
|
+
a.value = r.clientX, l.value = !0;
|
|
1018
1028
|
}, c = () => {
|
|
1019
1029
|
l.value = !1;
|
|
1020
|
-
}, h = (
|
|
1021
|
-
return I(i.x, (
|
|
1030
|
+
}, h = (r) => Math.floor(Math.abs(r) / 10);
|
|
1031
|
+
return I(i.x, (r) => {
|
|
1022
1032
|
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 =
|
|
1033
|
+
const _ = r - a.value, u = h(_);
|
|
1034
|
+
_ > 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
1035
|
}
|
|
1026
|
-
}), (
|
|
1036
|
+
}), (r, _) => (d(), g("div", ce, [
|
|
1027
1037
|
p("label", {
|
|
1028
|
-
class: k(["text-gray-500 w-1/3", { "flex justify-between items-center":
|
|
1038
|
+
class: k(["text-gray-500 w-1/3", { "flex justify-between items-center": r.control.icon }])
|
|
1029
1039
|
}, [
|
|
1030
|
-
|
|
1040
|
+
zt(v(r.label) + " ", 1),
|
|
1031
1041
|
p("i", {
|
|
1032
|
-
class: k(`i-${
|
|
1042
|
+
class: k(`i-${r.control.icon}`)
|
|
1033
1043
|
}, null, 2)
|
|
1034
1044
|
], 2),
|
|
1035
1045
|
p("input", {
|
|
1036
|
-
value:
|
|
1046
|
+
value: r.control.value,
|
|
1037
1047
|
class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
|
|
1038
|
-
style:
|
|
1048
|
+
style: Mt(n.value),
|
|
1039
1049
|
type: "range",
|
|
1040
|
-
min:
|
|
1041
|
-
max:
|
|
1042
|
-
step:
|
|
1050
|
+
min: r.control.min,
|
|
1051
|
+
max: r.control.max,
|
|
1052
|
+
step: r.control.step,
|
|
1043
1053
|
onInput: s
|
|
1044
|
-
}, null, 44,
|
|
1054
|
+
}, null, 44, ye),
|
|
1045
1055
|
p("input", {
|
|
1046
|
-
value:
|
|
1056
|
+
value: r.control.value,
|
|
1047
1057
|
class: k(["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
1058
|
type: "number",
|
|
1049
|
-
min:
|
|
1050
|
-
max:
|
|
1051
|
-
step:
|
|
1059
|
+
min: r.control.min,
|
|
1060
|
+
max: r.control.max,
|
|
1061
|
+
step: r.control.step,
|
|
1052
1062
|
onInput: s,
|
|
1053
1063
|
onMousedown: y,
|
|
1054
1064
|
onMouseup: c
|
|
1055
|
-
}, null, 42,
|
|
1065
|
+
}, null, 42, _e)
|
|
1056
1066
|
]));
|
|
1057
1067
|
}
|
|
1058
1068
|
});
|
|
1059
|
-
const
|
|
1060
|
-
const e =
|
|
1069
|
+
const pe = (o, t) => {
|
|
1070
|
+
const e = o.__vccOpts || o;
|
|
1061
1071
|
for (const [s, n] of t)
|
|
1062
1072
|
e[s] = n;
|
|
1063
1073
|
return e;
|
|
1064
|
-
},
|
|
1074
|
+
}, 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__ */ C({
|
|
1065
1075
|
__name: "ColorControl",
|
|
1066
1076
|
props: {
|
|
1067
1077
|
label: {},
|
|
1068
1078
|
control: {}
|
|
1069
1079
|
},
|
|
1070
1080
|
emits: ["change"],
|
|
1071
|
-
setup(
|
|
1081
|
+
setup(o, { emit: t }) {
|
|
1072
1082
|
function e(s) {
|
|
1073
1083
|
const { target: n } = s;
|
|
1074
1084
|
t("change", n.value);
|
|
1075
1085
|
}
|
|
1076
|
-
return (s, n) => (d(),
|
|
1077
|
-
p("label",
|
|
1086
|
+
return (s, n) => (d(), g("div", fe, [
|
|
1087
|
+
p("label", ge, v(s.label), 1),
|
|
1078
1088
|
p("input", {
|
|
1079
1089
|
value: s.control.value,
|
|
1080
1090
|
type: "color",
|
|
1081
1091
|
onInput: e
|
|
1082
|
-
}, null, 40,
|
|
1092
|
+
}, null, 40, me),
|
|
1083
1093
|
p("input", {
|
|
1084
1094
|
value: s.control.value,
|
|
1085
1095
|
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
1096
|
type: "text",
|
|
1087
1097
|
onInput: e
|
|
1088
|
-
}, null, 40,
|
|
1098
|
+
}, null, 40, be)
|
|
1089
1099
|
]));
|
|
1090
1100
|
}
|
|
1091
1101
|
});
|
|
1092
|
-
function
|
|
1093
|
-
return typeof
|
|
1102
|
+
function Me(o) {
|
|
1103
|
+
return typeof o == "number" ? [o, o, o] : o instanceof $ ? [o.x, o.y, o.z] : o;
|
|
1094
1104
|
}
|
|
1095
|
-
const
|
|
1105
|
+
const we = { 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
1106
|
key: 0,
|
|
1097
1107
|
class: "font-bold px-0.5 py-1 text-0.65rem text-gray-300"
|
|
1098
|
-
},
|
|
1108
|
+
}, ke = ["value", "onInput", "onMousedown", "onMouseup"], $e = /* @__PURE__ */ C({
|
|
1099
1109
|
__name: "VectorControl",
|
|
1100
1110
|
props: {
|
|
1101
1111
|
label: {},
|
|
1102
1112
|
control: {}
|
|
1103
1113
|
},
|
|
1104
1114
|
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 = E(() =>
|
|
1111
|
-
function u(x,
|
|
1115
|
+
setup(o, { emit: t }) {
|
|
1116
|
+
const e = o, s = F(), n = m(0), i = m(!1), a = m(0), l = (x, b) => {
|
|
1117
|
+
a.value = b, n.value = x.clientX, i.value = !0;
|
|
1118
|
+
}, y = (x, b) => {
|
|
1119
|
+
a.value = b, i.value = !1;
|
|
1120
|
+
}, c = (x) => Math.floor(Math.abs(x) / 10), h = E(() => Me(e.control.value)), r = E(() => Object.keys(e.control.value)), _ = E(() => e.control.value instanceof Q || e.control.value instanceof $);
|
|
1121
|
+
function u(x, b) {
|
|
1112
1122
|
const { value: z } = e.control, { target: f } = x;
|
|
1113
|
-
a.value =
|
|
1123
|
+
a.value = b, z[_.value ? r.value[a.value] : a.value] = parseInt(f.value, 10), t("change", z);
|
|
1114
1124
|
}
|
|
1115
1125
|
return I(s.x, (x) => {
|
|
1116
1126
|
if (i.value) {
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1127
|
+
const b = x - n.value, z = c(b), { value: f } = e.control, M = _.value ? r.value[a.value] : a.value;
|
|
1128
|
+
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
1129
|
}
|
|
1120
|
-
}), (x,
|
|
1121
|
-
p("label",
|
|
1122
|
-
p("div",
|
|
1123
|
-
(d(!0),
|
|
1130
|
+
}), (x, b) => (d(), g("div", we, [
|
|
1131
|
+
p("label", ve, v(x.label), 1),
|
|
1132
|
+
p("div", Ce, [
|
|
1133
|
+
(d(!0), g(P, null, L(h.value, (z, f) => (d(), g("div", {
|
|
1124
1134
|
key: x.label + f,
|
|
1125
1135
|
class: "flex items-center w-1/3 bg-gray-100 rounded"
|
|
1126
1136
|
}, [
|
|
1127
|
-
|
|
1137
|
+
r.value[f] && _.value ? (d(), g("span", Se, v(r.value[f]), 1)) : nt("", !0),
|
|
1128
1138
|
p("input", {
|
|
1129
1139
|
type: "text",
|
|
1130
1140
|
class: k(["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 }]),
|
|
@@ -1132,41 +1142,41 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1132
1142
|
onInput: (M) => u(M, f),
|
|
1133
1143
|
onMousedown: (M) => l(M, f),
|
|
1134
1144
|
onMouseup: (M) => y(M, f)
|
|
1135
|
-
}, null, 42,
|
|
1145
|
+
}, null, 42, ke)
|
|
1136
1146
|
]))), 128))
|
|
1137
1147
|
])
|
|
1138
1148
|
]));
|
|
1139
1149
|
}
|
|
1140
|
-
}),
|
|
1150
|
+
}), Ee = { class: "mb-4" }, Te = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ C({
|
|
1141
1151
|
__name: "Folder",
|
|
1142
1152
|
props: {
|
|
1143
1153
|
control: {}
|
|
1144
1154
|
},
|
|
1145
|
-
setup(
|
|
1155
|
+
setup(o) {
|
|
1146
1156
|
function t(n, i) {
|
|
1147
1157
|
i.value = n;
|
|
1148
1158
|
}
|
|
1149
|
-
const e =
|
|
1159
|
+
const e = m(!1), s = () => {
|
|
1150
1160
|
e.value = !e.value;
|
|
1151
1161
|
};
|
|
1152
|
-
return (n, i) => (d(),
|
|
1162
|
+
return (n, i) => (d(), g("div", Ee, [
|
|
1153
1163
|
p("button", {
|
|
1154
1164
|
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
1165
|
onClick: s
|
|
1156
1166
|
}, [
|
|
1157
|
-
p("span", null,
|
|
1167
|
+
p("span", null, v(n.control.label), 1),
|
|
1158
1168
|
p("i", {
|
|
1159
1169
|
class: k(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
|
|
1160
1170
|
}, null, 2)
|
|
1161
1171
|
]),
|
|
1162
|
-
|
|
1172
|
+
wt(vt, {
|
|
1163
1173
|
name: "slide",
|
|
1164
1174
|
"enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
|
|
1165
1175
|
"leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
|
|
1166
1176
|
}, {
|
|
1167
1177
|
default: it(() => [
|
|
1168
|
-
et(p("div",
|
|
1169
|
-
(d(!0),
|
|
1178
|
+
et(p("div", Te, [
|
|
1179
|
+
(d(!0), g(P, null, L(n.control.controls, (a) => (d(), w(ut, {
|
|
1170
1180
|
key: a.label,
|
|
1171
1181
|
control: a,
|
|
1172
1182
|
onChange: (l) => t(l, a)
|
|
@@ -1179,26 +1189,26 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1179
1189
|
})
|
|
1180
1190
|
]));
|
|
1181
1191
|
}
|
|
1182
|
-
}),
|
|
1192
|
+
}), 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__ */ C({
|
|
1183
1193
|
__name: "FPSGraph",
|
|
1184
1194
|
props: {
|
|
1185
1195
|
label: {},
|
|
1186
1196
|
control: {}
|
|
1187
1197
|
},
|
|
1188
|
-
setup(
|
|
1189
|
-
const t =
|
|
1198
|
+
setup(o) {
|
|
1199
|
+
const t = $t({ every: J }), e = m(""), s = m([]), n = m(G / A);
|
|
1190
1200
|
let i = performance.now();
|
|
1191
|
-
return
|
|
1201
|
+
return Et(({ timestamp: a }) => {
|
|
1192
1202
|
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},${
|
|
1203
|
+
(l, y) => `${y * A},${Y + O - A / 2 - l * (Y + O - A) / 120}`
|
|
1194
1204
|
).join(" "));
|
|
1195
|
-
}), (a, l) => (d(),
|
|
1196
|
-
p("label",
|
|
1197
|
-
p("div",
|
|
1198
|
-
p("div",
|
|
1199
|
-
(d(),
|
|
1205
|
+
}), (a, l) => (d(), g("div", Ae, [
|
|
1206
|
+
p("label", je, v(a.label), 1),
|
|
1207
|
+
p("div", qe, [
|
|
1208
|
+
p("div", Pe, v(Math.round(j(t))) + " FPS", 1),
|
|
1209
|
+
(d(), g("svg", {
|
|
1200
1210
|
width: G,
|
|
1201
|
-
height:
|
|
1211
|
+
height: Y,
|
|
1202
1212
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1203
1213
|
class: "bg-gray-100"
|
|
1204
1214
|
}, [
|
|
@@ -1209,91 +1219,121 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1209
1219
|
"stroke-width": A,
|
|
1210
1220
|
"stroke-linecap": "round",
|
|
1211
1221
|
"stroke-linejoin": "round"
|
|
1212
|
-
}, null, 8,
|
|
1222
|
+
}, null, 8, De)
|
|
1213
1223
|
]))
|
|
1214
1224
|
])
|
|
1215
1225
|
]));
|
|
1216
1226
|
}
|
|
1217
|
-
}),
|
|
1227
|
+
}), 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"], Fe = /* @__PURE__ */ C({
|
|
1228
|
+
__name: "SelectControl",
|
|
1229
|
+
props: {
|
|
1230
|
+
label: {},
|
|
1231
|
+
control: {}
|
|
1232
|
+
},
|
|
1233
|
+
emits: ["change"],
|
|
1234
|
+
setup(o, { emit: t }) {
|
|
1235
|
+
function e(s) {
|
|
1236
|
+
t("change", s.target.value);
|
|
1237
|
+
}
|
|
1238
|
+
return (s, n) => (d(), g("div", Ve, [
|
|
1239
|
+
p("label", Xe, v(s.label), 1),
|
|
1240
|
+
p("select", {
|
|
1241
|
+
value: s.control.value,
|
|
1242
|
+
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",
|
|
1243
|
+
onChange: e
|
|
1244
|
+
}, [
|
|
1245
|
+
(d(!0), g(P, null, L(s.control.options, (i) => (d(), g("option", {
|
|
1246
|
+
key: i.value,
|
|
1247
|
+
value: i.value
|
|
1248
|
+
}, v(i.text), 9, Ye))), 128))
|
|
1249
|
+
], 40, Re)
|
|
1250
|
+
]));
|
|
1251
|
+
}
|
|
1252
|
+
}), ut = /* @__PURE__ */ C({
|
|
1218
1253
|
__name: "ControlInput",
|
|
1219
1254
|
props: {
|
|
1220
1255
|
control: {}
|
|
1221
1256
|
},
|
|
1222
1257
|
emits: ["change"],
|
|
1223
|
-
setup(
|
|
1258
|
+
setup(o, { emit: t }) {
|
|
1224
1259
|
function e(s) {
|
|
1225
1260
|
t("change", s);
|
|
1226
1261
|
}
|
|
1227
|
-
return (s, n) => s.control.visible ? (d(),
|
|
1228
|
-
s.control.type === "color" ? (d(), w(
|
|
1262
|
+
return (s, n) => s.control.visible ? (d(), g(P, { key: 0 }, [
|
|
1263
|
+
s.control.type === "color" ? (d(), w(ze, {
|
|
1229
1264
|
key: 0,
|
|
1230
1265
|
label: s.control.label,
|
|
1231
1266
|
control: s.control,
|
|
1232
1267
|
onChange: e
|
|
1233
|
-
}, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w(
|
|
1268
|
+
}, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w($e, {
|
|
1234
1269
|
key: 1,
|
|
1235
1270
|
label: s.control.label,
|
|
1236
1271
|
control: s.control,
|
|
1237
1272
|
onChange: e
|
|
1238
|
-
}, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(
|
|
1273
|
+
}, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(ue, {
|
|
1239
1274
|
key: 2,
|
|
1240
1275
|
label: s.control.label,
|
|
1241
1276
|
control: s.control,
|
|
1242
1277
|
onChange: e
|
|
1243
|
-
}, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(
|
|
1278
|
+
}, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(Le, {
|
|
1244
1279
|
key: 3,
|
|
1245
1280
|
label: s.control.label,
|
|
1246
1281
|
control: s.control
|
|
1247
|
-
}, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(
|
|
1282
|
+
}, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(Ie, {
|
|
1248
1283
|
key: 4,
|
|
1249
1284
|
label: s.control.label,
|
|
1250
1285
|
control: s.control
|
|
1251
|
-
}, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(
|
|
1286
|
+
}, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(te, {
|
|
1252
1287
|
key: 5,
|
|
1253
1288
|
label: s.control.label,
|
|
1254
1289
|
control: s.control,
|
|
1255
1290
|
onChange: e
|
|
1256
|
-
}, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(
|
|
1291
|
+
}, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(de, {
|
|
1257
1292
|
key: 6,
|
|
1258
1293
|
label: s.control.label,
|
|
1259
1294
|
control: s.control,
|
|
1260
1295
|
onChange: e
|
|
1261
|
-
}, null, 8, ["label", "control"])) : (d(), w(
|
|
1296
|
+
}, null, 8, ["label", "control"])) : s.control.type === "select" ? (d(), w(Fe, {
|
|
1262
1297
|
key: 7,
|
|
1263
1298
|
label: s.control.label,
|
|
1264
1299
|
control: s.control,
|
|
1265
1300
|
onChange: e
|
|
1301
|
+
}, null, 8, ["label", "control"])) : (d(), w(ie, {
|
|
1302
|
+
key: 8,
|
|
1303
|
+
label: s.control.label,
|
|
1304
|
+
control: s.control,
|
|
1305
|
+
onChange: e
|
|
1266
1306
|
}, null, 8, ["label", "control"]))
|
|
1267
1307
|
], 64)) : nt("", !0);
|
|
1268
1308
|
}
|
|
1269
|
-
}),
|
|
1309
|
+
}), He = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, Qe = /* @__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), We = /* @__PURE__ */ p("div", null, [
|
|
1270
1310
|
/* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
|
|
1271
1311
|
/* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
|
|
1272
1312
|
/* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" })
|
|
1273
|
-
], -1),
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1313
|
+
], -1), Ze = /* @__PURE__ */ p("div", null, null, -1), Ne = [
|
|
1314
|
+
Qe,
|
|
1315
|
+
We,
|
|
1316
|
+
Ze
|
|
1317
|
+
], Be = 280, Je = /* @__PURE__ */ C({
|
|
1278
1318
|
__name: "TresLeches",
|
|
1279
|
-
setup(
|
|
1280
|
-
const { width: t } =
|
|
1319
|
+
setup(o) {
|
|
1320
|
+
const { width: t } = Tt(), e = m(null), s = Ut();
|
|
1281
1321
|
function n(i, a) {
|
|
1282
1322
|
a.ref && (a.ref[a.label] = i), a.value = i;
|
|
1283
1323
|
}
|
|
1284
|
-
return (i, a) => (d(), w(
|
|
1285
|
-
"initial-value": { x:
|
|
1324
|
+
return (i, a) => (d(), w(j(Ht), {
|
|
1325
|
+
"initial-value": { x: j(t) - Be - 20, y: 10 },
|
|
1286
1326
|
class: "fixed select-none z-24 w-280px font-sans text-xs",
|
|
1287
1327
|
handle: e.value
|
|
1288
1328
|
}, {
|
|
1289
1329
|
default: it(() => [
|
|
1290
|
-
p("div",
|
|
1330
|
+
p("div", He, [
|
|
1291
1331
|
p("header", {
|
|
1292
1332
|
ref_key: "handle",
|
|
1293
1333
|
ref: e,
|
|
1294
1334
|
class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
|
|
1295
|
-
},
|
|
1296
|
-
(d(!0),
|
|
1335
|
+
}, Ne, 512),
|
|
1336
|
+
(d(!0), g(P, null, L(j(s).controls, (l) => (d(), w(ut, {
|
|
1297
1337
|
key: l.label,
|
|
1298
1338
|
control: l,
|
|
1299
1339
|
onChange: (y) => n(y, l)
|
|
@@ -1305,6 +1345,6 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
|
|
|
1305
1345
|
}
|
|
1306
1346
|
});
|
|
1307
1347
|
export {
|
|
1308
|
-
|
|
1309
|
-
|
|
1348
|
+
Je as TresLeches,
|
|
1349
|
+
Ge as useControls
|
|
1310
1350
|
};
|