@kolkrabbi/design-editor 0.14.0 → 0.16.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/BindDot-CuCS4LS-.js +127 -0
- package/dist/{RuleRow-D0nV-GvB.js → RuleRow-DlouS36V.js} +115 -109
- package/dist/{TreePicker-DlEXH2kw.js → TreePicker-D5XZT0Zi.js} +1 -1
- package/dist/{core-EQZBciYo.js → core-B78-YLQh.js} +3630 -5555
- package/dist/core.js +3 -3
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +564 -532
- package/dist/{effects-C0ojfSm8.js → effects-B743CHEU.js} +511 -501
- package/dist/effects.js +1 -1
- package/dist/{generators-RjXuwET7.js → generators-B0uhjxUs.js} +488 -867
- package/dist/generators.js +1 -1
- package/dist/{host-BMD1sgpp.js → host-bXQMgZeW.js} +4 -4
- package/dist/{motion-ejcDWbeh.js → motion-9j3WO6a2.js} +628 -724
- package/dist/motion.js +1 -1
- package/dist/{registry-C7rLJN2U.js → registry-CSOtIU7o.js} +35 -35
- package/dist/{EditorIcon-BbFMmc1G.js → rolls-CkmuE-Ya.js} +1826 -1914
- package/dist/{src-BOZt8ciR.js → src-DFtETCsY.js} +1 -1
- package/dist/{useLayerEdit-BElo4uVW.js → useLayerEdit-BDXtPeAP.js} +69 -67
- package/package.json +8 -8
- package/dist/BindDot-xnv1FDLI.js +0 -125
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ee, F as
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as F, t as
|
|
5
|
-
import { i as
|
|
6
|
-
import { Button as L, Dropdown as R,
|
|
7
|
-
import { useEffect as
|
|
1
|
+
import { Ft as e, S as t, V as n, Xt as r, Zt as i, a, c as o, i as s, j as c, l, n as u, o as d, s as f, t as p, u as m, x as h, z as g } from "./rolls-CkmuE-Ya.js";
|
|
2
|
+
import { A as ee, F as _, I as te, L as ne, M as v, N as y, P as b, Q as x, R as re, X as S, Y as C, Z as w, a as ie, c as ae, d as T, f as E, i as oe, j as D, l as O, n as k, o as se, p as ce, s as A, u as j } from "./registry-CSOtIU7o.js";
|
|
3
|
+
import { a as M, i as le, n as N, t as ue, y as P } from "./TreePicker-D5XZT0Zi.js";
|
|
4
|
+
import { n as F, t as de } from "./useLayerEdit-BDXtPeAP.js";
|
|
5
|
+
import { i as fe, t as pe } from "./RuleRow-DlouS36V.js";
|
|
6
|
+
import { Button as I, CurveEditor as L, Dropdown as R, KeyframeEditor as me, LabeledControl as z, LabeledControlSection as he, SegmentedToggle as ge, SettingsRow as _e, Slider as ve, Tooltip as B, ViewToggle as ye, XYPad as be } from "@kolkrabbi/kol-component";
|
|
7
|
+
import { useEffect as xe, useRef as Se, useState as Ce } from "react";
|
|
8
8
|
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
9
9
|
//#region src/loops/taxonomy.js
|
|
10
|
-
var
|
|
10
|
+
var we = [
|
|
11
11
|
{
|
|
12
12
|
label: "Scanline",
|
|
13
13
|
groups: ["scanline"]
|
|
@@ -59,31 +59,31 @@ var Ce = [
|
|
|
59
59
|
],
|
|
60
60
|
labels: { scene: "Primitive" }
|
|
61
61
|
}
|
|
62
|
-
],
|
|
62
|
+
], Te = [{
|
|
63
63
|
label: "Para Type",
|
|
64
64
|
groups: ["paratype"]
|
|
65
|
-
}],
|
|
65
|
+
}], Ee = we, De = {
|
|
66
66
|
optic: "Pattern · Effects",
|
|
67
67
|
paratype: "Para Type · Misc",
|
|
68
68
|
distress: "Distressor · Vector",
|
|
69
69
|
modulator: "Modulator · Vector"
|
|
70
|
-
},
|
|
71
|
-
function
|
|
72
|
-
let t = { ...
|
|
73
|
-
for (let n of Object.keys(
|
|
70
|
+
}, Oe = Object.fromEntries(ee.params.map((e) => [e.key, e.default]));
|
|
71
|
+
function ke(e) {
|
|
72
|
+
let t = { ...Oe };
|
|
73
|
+
for (let n of Object.keys(Oe)) {
|
|
74
74
|
let r = e[n];
|
|
75
75
|
r != null && typeof r != "object" && (t[n] = r);
|
|
76
76
|
}
|
|
77
77
|
return t;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Ae(e, t) {
|
|
80
80
|
let n = t.stemWidth ?? 18, r = 0;
|
|
81
81
|
return (t.serif ?? 0) > 0 && (r = Math.max(2, n * .7) * t.serif + (t.jut ?? 0) * n * 1.5 + 1), e === "i" && (r = Math.max(r, n * .1 + 1)), r;
|
|
82
82
|
}
|
|
83
83
|
var W = (e) => Number(e.toFixed(2));
|
|
84
|
-
function
|
|
84
|
+
function je(e, t, n) {
|
|
85
85
|
if (!e || e.loopId !== "paratype-glyph") return null;
|
|
86
|
-
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a =
|
|
86
|
+
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = ke(e), o = D(a, r, i);
|
|
87
87
|
if (!o.length) return null;
|
|
88
88
|
let s = [];
|
|
89
89
|
t.bg && s.push({
|
|
@@ -100,7 +100,7 @@ function Ae(e, t, n) {
|
|
|
100
100
|
blend: "normal"
|
|
101
101
|
});
|
|
102
102
|
for (let e of o) {
|
|
103
|
-
let r =
|
|
103
|
+
let r = Ae(e.name, a) + 1.5, i = 1.5, o = e.gw + r * 2, c = e.gh + i * 2, l = e.g.paths.map((e) => `<path d="${e.d.replace(/\s+/g, " ").trim()}"${e.fillRule ? ` fill-rule="${e.fillRule}"` : ""} fill="currentColor"/>`).join(""), u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${W(o)} ${W(c)}" preserveAspectRatio="none"><g transform="translate(${W(r)} ${W(e.y1 + i)}) scale(1 -1)">${l}</g></svg>`;
|
|
104
104
|
s.push({
|
|
105
105
|
id: n("shape"),
|
|
106
106
|
type: "shape",
|
|
@@ -132,9 +132,9 @@ function Ae(e, t, n) {
|
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/editor/compose/inspectors/LoopPicker.jsx
|
|
135
|
-
function
|
|
136
|
-
let { updateLayer:
|
|
137
|
-
t &&
|
|
135
|
+
function Me({ layer: e, tree: t = Ee, inline: n = !1 }) {
|
|
136
|
+
let { updateLayer: r } = c(), i = e.loopGroup ?? "shape", a = t.find((e) => e.groups.includes(i)) ?? null, o = T(i), s = o.find((t) => t.id === e.presetId), l = [...new Set(o.map((e) => e.sub).filter(Boolean))], u = s?.sub ?? l[0], d = l.length ? o.filter((e) => e.sub === u) : o, f = (t, n = i) => {
|
|
137
|
+
t && r(e.id, {
|
|
138
138
|
loopGroup: n,
|
|
139
139
|
presetId: t.id,
|
|
140
140
|
presetLabel: t.label,
|
|
@@ -142,35 +142,35 @@ function je({ layer: e, tree: t = Te, inline: n = !1 }) {
|
|
|
142
142
|
_framePreset: "custom",
|
|
143
143
|
_formPreset: "custom",
|
|
144
144
|
_lookPreset: "custom",
|
|
145
|
-
...
|
|
145
|
+
...j(t)
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
return /* @__PURE__ */ U(V, { children: [
|
|
149
|
-
t.length > 1 || !
|
|
149
|
+
t.length > 1 || !a ? /* @__PURE__ */ H(N, {
|
|
150
150
|
label: "Type",
|
|
151
151
|
inline: n,
|
|
152
152
|
children: /* @__PURE__ */ U("div", {
|
|
153
153
|
className: "flex flex-col gap-1 w-full",
|
|
154
|
-
children: [
|
|
154
|
+
children: [a ? /* @__PURE__ */ H(ue, {
|
|
155
155
|
options: t.map((e) => ({
|
|
156
156
|
value: e.label,
|
|
157
157
|
label: e.label
|
|
158
158
|
})),
|
|
159
|
-
value:
|
|
159
|
+
value: a.label,
|
|
160
160
|
onChange: (e) => {
|
|
161
161
|
let n = t.find((t) => t.label === e);
|
|
162
|
-
n && f(
|
|
162
|
+
n && f(T(n.groups[0])[0], n.groups[0]);
|
|
163
163
|
}
|
|
164
164
|
}) : /* @__PURE__ */ H("span", {
|
|
165
165
|
className: "kol-helper-12 text-meta px-1",
|
|
166
|
-
children:
|
|
167
|
-
}),
|
|
168
|
-
options:
|
|
166
|
+
children: De[i] ?? k(i).label
|
|
167
|
+
}), a && a.groups.length > 1 && /* @__PURE__ */ H(ue, {
|
|
168
|
+
options: a.groups.map((e) => ({
|
|
169
169
|
value: e,
|
|
170
|
-
label:
|
|
170
|
+
label: a.labels?.[e] ?? k(e).label
|
|
171
171
|
})),
|
|
172
|
-
value:
|
|
173
|
-
onChange: (e) => f(
|
|
172
|
+
value: i,
|
|
173
|
+
onChange: (e) => f(T(e)[0], e)
|
|
174
174
|
})]
|
|
175
175
|
})
|
|
176
176
|
}) : null,
|
|
@@ -182,7 +182,7 @@ function je({ layer: e, tree: t = Te, inline: n = !1 }) {
|
|
|
182
182
|
label: e
|
|
183
183
|
})),
|
|
184
184
|
value: u,
|
|
185
|
-
onChange: (e) => f(
|
|
185
|
+
onChange: (e) => f(o.find((t) => t.sub === e))
|
|
186
186
|
}),
|
|
187
187
|
/* @__PURE__ */ H(N, {
|
|
188
188
|
inline: n,
|
|
@@ -192,13 +192,13 @@ function je({ layer: e, tree: t = Te, inline: n = !1 }) {
|
|
|
192
192
|
label: e.label
|
|
193
193
|
})),
|
|
194
194
|
value: e.presetId,
|
|
195
|
-
onChange: (e) => f(
|
|
195
|
+
onChange: (e) => f(o.find((t) => t.id === e))
|
|
196
196
|
})
|
|
197
197
|
] });
|
|
198
198
|
}
|
|
199
199
|
//#endregion
|
|
200
200
|
//#region src/editor/params/motionPresets.js
|
|
201
|
-
var
|
|
201
|
+
var Ne = (e) => r("generators")?.loopById(e) ?? null, Pe = {
|
|
202
202
|
frame: [
|
|
203
203
|
{
|
|
204
204
|
id: "static",
|
|
@@ -264,7 +264,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
]
|
|
267
|
-
},
|
|
267
|
+
}, Fe = [
|
|
268
268
|
{
|
|
269
269
|
id: "static",
|
|
270
270
|
label: "Static",
|
|
@@ -318,7 +318,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
318
318
|
panDir: "anti"
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
],
|
|
321
|
+
], Ie = [
|
|
322
322
|
{
|
|
323
323
|
id: "static",
|
|
324
324
|
label: "Static",
|
|
@@ -431,7 +431,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
431
431
|
colorMix: 0
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
],
|
|
434
|
+
], Le = [
|
|
435
435
|
{
|
|
436
436
|
id: "static",
|
|
437
437
|
label: "Static",
|
|
@@ -499,7 +499,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
499
499
|
stripeAngle: 135
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
],
|
|
502
|
+
], Re = [
|
|
503
503
|
{
|
|
504
504
|
id: "static",
|
|
505
505
|
label: "Static",
|
|
@@ -564,7 +564,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
564
564
|
stripeAngle: 45
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
],
|
|
567
|
+
], ze = [
|
|
568
568
|
{
|
|
569
569
|
id: "static",
|
|
570
570
|
label: "Static",
|
|
@@ -601,7 +601,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
601
601
|
fieldCycles: 1
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
],
|
|
604
|
+
], Be = [
|
|
605
605
|
{
|
|
606
606
|
id: "static",
|
|
607
607
|
label: "Static",
|
|
@@ -646,7 +646,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
646
646
|
fade: .4
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
],
|
|
649
|
+
], Ve = {
|
|
650
650
|
frame: [
|
|
651
651
|
{
|
|
652
652
|
id: "static",
|
|
@@ -789,7 +789,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
]
|
|
792
|
-
},
|
|
792
|
+
}, He = {
|
|
793
793
|
frame: [
|
|
794
794
|
{
|
|
795
795
|
id: "static",
|
|
@@ -863,7 +863,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
865
|
]
|
|
866
|
-
},
|
|
866
|
+
}, Ue = {
|
|
867
867
|
frame: [
|
|
868
868
|
{
|
|
869
869
|
id: "static",
|
|
@@ -950,7 +950,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
]
|
|
953
|
-
},
|
|
953
|
+
}, We = {
|
|
954
954
|
frame: [
|
|
955
955
|
{
|
|
956
956
|
id: "static",
|
|
@@ -1032,7 +1032,7 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
]
|
|
1035
|
-
},
|
|
1035
|
+
}, Ge = {
|
|
1036
1036
|
frame: [
|
|
1037
1037
|
{
|
|
1038
1038
|
id: "static",
|
|
@@ -1102,30 +1102,30 @@ var Me = (e) => c("generators")?.loopById(e) ?? null, Ne = {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
]
|
|
1104
1104
|
};
|
|
1105
|
-
function
|
|
1105
|
+
function Ke(e, t = {}) {
|
|
1106
1106
|
switch (e) {
|
|
1107
|
-
case "scanline": return
|
|
1107
|
+
case "scanline": return Pe;
|
|
1108
1108
|
case "pattern-rules": {
|
|
1109
1109
|
let e = t.render ?? "tiles", n = e === "field" && t.field === "organic";
|
|
1110
1110
|
return {
|
|
1111
|
-
frame: e === "tiles" ?
|
|
1112
|
-
form: e === "tiles" ?
|
|
1111
|
+
frame: e === "tiles" ? Fe : n ? Re : Le,
|
|
1112
|
+
form: e === "tiles" ? Ie : e === "weave" ? Be : ze
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
case "math-waveform": return
|
|
1116
|
-
case "math-surface": return
|
|
1117
|
-
case "math-field": return (t.kind ?? "scalar") === "complex" ?
|
|
1118
|
-
default: return
|
|
1115
|
+
case "math-waveform": return Ve;
|
|
1116
|
+
case "math-surface": return He;
|
|
1117
|
+
case "math-field": return (t.kind ?? "scalar") === "complex" ? We : Ue;
|
|
1118
|
+
default: return Ne(e)?.params?.some((e) => e.key === "vpSpin") ? Ge : null;
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function qe(e) {
|
|
1122
1122
|
let t = /* @__PURE__ */ new Set();
|
|
1123
1123
|
for (let n of e ?? []) for (let e of Object.keys(n.params ?? {})) t.add(e);
|
|
1124
1124
|
return t;
|
|
1125
1125
|
}
|
|
1126
1126
|
//#endregion
|
|
1127
1127
|
//#region src/editor/params/lookPresets.js
|
|
1128
|
-
var
|
|
1128
|
+
var Je = {
|
|
1129
1129
|
Spectrum: {
|
|
1130
1130
|
palette: "spectrum",
|
|
1131
1131
|
spectral: !0,
|
|
@@ -1164,16 +1164,16 @@ var qe = {
|
|
|
1164
1164
|
rim: 1
|
|
1165
1165
|
}
|
|
1166
1166
|
};
|
|
1167
|
-
function
|
|
1168
|
-
return e === "softforms" || e === "softforms3d" ?
|
|
1167
|
+
function Ye(e) {
|
|
1168
|
+
return e === "softforms" || e === "softforms3d" ? Je : null;
|
|
1169
1169
|
}
|
|
1170
1170
|
//#endregion
|
|
1171
1171
|
//#region src/loops/gl/primitiveEasing.js
|
|
1172
|
-
function
|
|
1172
|
+
function Xe(e) {
|
|
1173
1173
|
let t = 7.5625, n = 2.75;
|
|
1174
1174
|
return e < 1 / n ? t * e * e : e < 2 / n ? (e -= 1.5 / n, t * e * e + .75) : e < 2.5 / n ? (e -= 2.25 / n, t * e * e + .9375) : (e -= 2.625 / n, t * e * e + .984375);
|
|
1175
1175
|
}
|
|
1176
|
-
var
|
|
1176
|
+
var Ze = {
|
|
1177
1177
|
linear: (e) => e,
|
|
1178
1178
|
in: (e) => e * e,
|
|
1179
1179
|
out: (e) => 1 - (1 - e) * (1 - e),
|
|
@@ -1195,8 +1195,8 @@ var Xe = {
|
|
|
1195
1195
|
let t = 2 * Math.PI / 3;
|
|
1196
1196
|
return 2 ** (-10 * e) * Math.sin((e * 10 - .75) * t) + 1;
|
|
1197
1197
|
},
|
|
1198
|
-
bounceOut:
|
|
1199
|
-
},
|
|
1198
|
+
bounceOut: Xe
|
|
1199
|
+
}, Qe = {
|
|
1200
1200
|
linear: "Linear",
|
|
1201
1201
|
in: "Ease in",
|
|
1202
1202
|
out: "Ease out",
|
|
@@ -1211,14 +1211,14 @@ var Xe = {
|
|
|
1211
1211
|
backInOut: "Back in-out",
|
|
1212
1212
|
elasticOut: "Elastic out",
|
|
1213
1213
|
bounceOut: "Bounce out"
|
|
1214
|
-
},
|
|
1214
|
+
}, $e = Object.keys(Ze).map((e) => ({
|
|
1215
1215
|
value: e,
|
|
1216
|
-
label:
|
|
1217
|
-
})),
|
|
1216
|
+
label: Qe[e] || e
|
|
1217
|
+
})), et = (e, t, n) => [
|
|
1218
1218
|
P(e[0], t[0], n),
|
|
1219
1219
|
P(e[1], t[1], n),
|
|
1220
1220
|
P(e[2], t[2], n)
|
|
1221
|
-
],
|
|
1221
|
+
], tt = (e) => ({
|
|
1222
1222
|
rot: e.rot || [
|
|
1223
1223
|
0,
|
|
1224
1224
|
0,
|
|
@@ -1231,14 +1231,14 @@ var Xe = {
|
|
|
1231
1231
|
],
|
|
1232
1232
|
scale: e.scale ?? 1
|
|
1233
1233
|
});
|
|
1234
|
-
function
|
|
1234
|
+
function nt(e, t) {
|
|
1235
1235
|
if (!e || !e.length) return {};
|
|
1236
|
-
if (e.length === 1) return
|
|
1236
|
+
if (e.length === 1) return tt(e[0]);
|
|
1237
1237
|
let n = 0;
|
|
1238
1238
|
for (; n < e.length - 1 && t > e[n + 1].t;) n++;
|
|
1239
1239
|
let r = e[n], i = e[n + 1] || r, a = i.t - r.t || 1, o = Math.max(0, Math.min(1, (t - r.t) / a));
|
|
1240
|
-
return o = (
|
|
1241
|
-
rot:
|
|
1240
|
+
return o = (Ze[i.ease] || Ze.inout)(o), {
|
|
1241
|
+
rot: et(r.rot || [
|
|
1242
1242
|
0,
|
|
1243
1243
|
0,
|
|
1244
1244
|
0
|
|
@@ -1247,7 +1247,7 @@ function tt(e, t) {
|
|
|
1247
1247
|
0,
|
|
1248
1248
|
0
|
|
1249
1249
|
], o),
|
|
1250
|
-
pos:
|
|
1250
|
+
pos: et(r.pos || [
|
|
1251
1251
|
0,
|
|
1252
1252
|
0,
|
|
1253
1253
|
0
|
|
@@ -1259,7 +1259,7 @@ function tt(e, t) {
|
|
|
1259
1259
|
scale: P(r.scale ?? 1, i.scale ?? 1, o)
|
|
1260
1260
|
};
|
|
1261
1261
|
}
|
|
1262
|
-
var
|
|
1262
|
+
var rt = [{
|
|
1263
1263
|
t: 0,
|
|
1264
1264
|
rot: [
|
|
1265
1265
|
0,
|
|
@@ -1290,153 +1290,30 @@ var nt = [{
|
|
|
1290
1290
|
}];
|
|
1291
1291
|
//#endregion
|
|
1292
1292
|
//#region src/loops/gl/phase.js
|
|
1293
|
-
function
|
|
1293
|
+
function it(e, t) {
|
|
1294
1294
|
let n = Number(e), r = Number(t);
|
|
1295
1295
|
return !n || n <= 0 || !r || r <= 0 ? 1 : Math.max(1, Math.round(r / n));
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function at(e, t) {
|
|
1298
1298
|
return e * t % 1;
|
|
1299
1299
|
}
|
|
1300
1300
|
//#endregion
|
|
1301
1301
|
//#region src/editor/compose/inspectors/KeyframeEditor.jsx
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
0,
|
|
1313
|
-
0
|
|
1314
|
-
],
|
|
1315
|
-
scale: 1
|
|
1316
|
-
}, c = (e) => t({ keyframes: e }), l = () => rt(e.duration ?? n, v.getLoopSeconds()), u = (e) => {
|
|
1317
|
-
a(e), v.pause(), v.seek((r[e].t ?? 0) / l());
|
|
1318
|
-
}, d = () => {
|
|
1319
|
-
let e = v.getT() * l() % 1, t = r[o] || {
|
|
1320
|
-
rot: [
|
|
1321
|
-
0,
|
|
1322
|
-
0,
|
|
1323
|
-
0
|
|
1324
|
-
],
|
|
1325
|
-
pos: [
|
|
1326
|
-
0,
|
|
1327
|
-
0,
|
|
1328
|
-
0
|
|
1329
|
-
],
|
|
1330
|
-
scale: 1,
|
|
1331
|
-
ease: "inout"
|
|
1332
|
-
}, n = {
|
|
1333
|
-
t: Math.max(0, Math.min(1, e)),
|
|
1334
|
-
rot: [...t.rot || [
|
|
1335
|
-
0,
|
|
1336
|
-
0,
|
|
1337
|
-
0
|
|
1338
|
-
]],
|
|
1339
|
-
pos: [...t.pos || [
|
|
1340
|
-
0,
|
|
1341
|
-
0,
|
|
1342
|
-
0
|
|
1343
|
-
]],
|
|
1344
|
-
scale: t.scale ?? 1,
|
|
1345
|
-
ease: t.ease || "inout"
|
|
1346
|
-
}, i = [...r, n].sort((e, t) => e.t - t.t);
|
|
1347
|
-
c(i), a(i.indexOf(n));
|
|
1348
|
-
}, f = () => {
|
|
1349
|
-
r.length <= 1 || (c(r.filter((e, t) => t !== o)), a((e) => Math.max(0, e - 1)));
|
|
1350
|
-
}, p = (e) => c(r.map((t, n) => n === o ? {
|
|
1351
|
-
...t,
|
|
1352
|
-
...e
|
|
1353
|
-
} : t)), m = (e, t) => {
|
|
1354
|
-
let n = [...s.rot || [
|
|
1355
|
-
0,
|
|
1356
|
-
0,
|
|
1357
|
-
0
|
|
1358
|
-
]];
|
|
1359
|
-
n[e] = ot(t), p({ rot: n });
|
|
1360
|
-
}, h = (e, t) => {
|
|
1361
|
-
let n = [...s.pos || [
|
|
1362
|
-
0,
|
|
1363
|
-
0,
|
|
1364
|
-
0
|
|
1365
|
-
]];
|
|
1366
|
-
n[e] = t, p({ pos: n });
|
|
1367
|
-
}, g = (e, t, n, r, i, a) => /* @__PURE__ */ H(z, {
|
|
1368
|
-
label: e,
|
|
1369
|
-
children: /* @__PURE__ */ H(B, {
|
|
1370
|
-
min: t,
|
|
1371
|
-
max: n,
|
|
1372
|
-
step: r,
|
|
1373
|
-
value: i,
|
|
1374
|
-
onChange: a
|
|
1375
|
-
})
|
|
1302
|
+
function ot({ layer: t, patch: n, defaultDuration: r = 8 }) {
|
|
1303
|
+
let i = () => it(t.duration ?? r, e.getLoopSeconds());
|
|
1304
|
+
return /* @__PURE__ */ H(me, {
|
|
1305
|
+
keyframes: t.keyframes,
|
|
1306
|
+
onChange: (e) => n({ keyframes: e }),
|
|
1307
|
+
t: () => e.getT() * i() % 1,
|
|
1308
|
+
onPause: () => e.pause(),
|
|
1309
|
+
onSeek: (t) => e.seek(t / i()),
|
|
1310
|
+
easeOptions: $e,
|
|
1311
|
+
defaultKeyframes: rt
|
|
1376
1312
|
});
|
|
1377
|
-
return /* @__PURE__ */ U(V, { children: [
|
|
1378
|
-
/* @__PURE__ */ H("span", {
|
|
1379
|
-
className: "kol-helper-10 text-meta",
|
|
1380
|
-
children: "Keyframes"
|
|
1381
|
-
}),
|
|
1382
|
-
/* @__PURE__ */ H("div", {
|
|
1383
|
-
className: "flex flex-col gap-1",
|
|
1384
|
-
children: r.map((e, t) => /* @__PURE__ */ U(L, {
|
|
1385
|
-
variant: t === o ? "primary" : "secondary",
|
|
1386
|
-
size: "sm",
|
|
1387
|
-
className: "w-full",
|
|
1388
|
-
style: { justifyContent: "space-between" },
|
|
1389
|
-
onClick: () => u(t),
|
|
1390
|
-
children: [/* @__PURE__ */ U("span", { children: ["Key ", t + 1] }), /* @__PURE__ */ U("span", {
|
|
1391
|
-
className: "kol-helper-10 tabular-nums",
|
|
1392
|
-
children: [Math.round((e.t ?? 0) * 100), "%"]
|
|
1393
|
-
})]
|
|
1394
|
-
}, t))
|
|
1395
|
-
}),
|
|
1396
|
-
/* @__PURE__ */ U("div", {
|
|
1397
|
-
className: "flex gap-2",
|
|
1398
|
-
children: [/* @__PURE__ */ H(L, {
|
|
1399
|
-
variant: "primary",
|
|
1400
|
-
size: "sm",
|
|
1401
|
-
className: "flex-1",
|
|
1402
|
-
onClick: d,
|
|
1403
|
-
children: "Add @ playhead"
|
|
1404
|
-
}), /* @__PURE__ */ H(L, {
|
|
1405
|
-
variant: "ghost",
|
|
1406
|
-
size: "sm",
|
|
1407
|
-
title: "Delete keyframe",
|
|
1408
|
-
onClick: f,
|
|
1409
|
-
disabled: r.length <= 1,
|
|
1410
|
-
children: "Delete"
|
|
1411
|
-
})]
|
|
1412
|
-
}),
|
|
1413
|
-
/* @__PURE__ */ H("span", {
|
|
1414
|
-
className: "kol-helper-10 text-meta",
|
|
1415
|
-
children: "Pose"
|
|
1416
|
-
}),
|
|
1417
|
-
g("Rotate X", -360, 360, 1, at(s.rot?.[0]), (e) => m(0, e)),
|
|
1418
|
-
g("Rotate Y", -360, 360, 1, at(s.rot?.[1]), (e) => m(1, e)),
|
|
1419
|
-
g("Rotate Z", -360, 360, 1, at(s.rot?.[2]), (e) => m(2, e)),
|
|
1420
|
-
g("Move X", -2, 2, .05, s.pos?.[0] || 0, (e) => h(0, e)),
|
|
1421
|
-
g("Move Y", -2, 2, .05, s.pos?.[1] || 0, (e) => h(1, e)),
|
|
1422
|
-
g("Move Z", -2, 2, .05, s.pos?.[2] || 0, (e) => h(2, e)),
|
|
1423
|
-
g("Scale", .2, 2, .05, s.scale ?? 1, (e) => p({ scale: e })),
|
|
1424
|
-
/* @__PURE__ */ H(z, {
|
|
1425
|
-
label: "Ease",
|
|
1426
|
-
children: /* @__PURE__ */ H(R, {
|
|
1427
|
-
variant: "subtle",
|
|
1428
|
-
size: "sm",
|
|
1429
|
-
className: "w-full",
|
|
1430
|
-
options: Qe,
|
|
1431
|
-
value: s.ease || "inout",
|
|
1432
|
-
onChange: (e) => p({ ease: e })
|
|
1433
|
-
})
|
|
1434
|
-
})
|
|
1435
|
-
] });
|
|
1436
1313
|
}
|
|
1437
1314
|
//#endregion
|
|
1438
1315
|
//#region src/editor/compose/inspectors/CameraPoseSlots.jsx
|
|
1439
|
-
function
|
|
1316
|
+
function st({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1 }) {
|
|
1440
1317
|
let a = Array.isArray(e._camSlots) ? e._camSlots : [], o = [
|
|
1441
1318
|
a[0] ?? null,
|
|
1442
1319
|
a[1] ?? null,
|
|
@@ -1454,20 +1331,23 @@ function ct({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1454
1331
|
children: "Camera"
|
|
1455
1332
|
}), /* @__PURE__ */ U("div", {
|
|
1456
1333
|
className: "flex items-center gap-1",
|
|
1457
|
-
children: [n.length > 0 && o.map((e, t) => /* @__PURE__ */ H(
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1334
|
+
children: [n.length > 0 && o.map((e, t) => /* @__PURE__ */ H(B, {
|
|
1335
|
+
label: e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1336
|
+
children: /* @__PURE__ */ H(I, {
|
|
1337
|
+
"aria-label": e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1338
|
+
variant: e ? "secondary" : "ghost",
|
|
1339
|
+
size: "sm",
|
|
1340
|
+
onClick: (n) => n.shiftKey || !e ? s(t) : c(t),
|
|
1341
|
+
children: t + 1
|
|
1342
|
+
})
|
|
1343
|
+
}, t)), /* @__PURE__ */ H(I, {
|
|
1464
1344
|
variant: "primary",
|
|
1465
1345
|
size: "sm",
|
|
1466
1346
|
className: "ml-auto",
|
|
1467
1347
|
onClick: () => {
|
|
1468
1348
|
let i = {};
|
|
1469
1349
|
for (let e of n) i[e.key] = e.default;
|
|
1470
|
-
t(i), r && import("./host-
|
|
1350
|
+
t(i), r && import("./host-bXQMgZeW.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
|
|
1471
1351
|
},
|
|
1472
1352
|
children: "Reset"
|
|
1473
1353
|
})]
|
|
@@ -1475,14 +1355,14 @@ function ct({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1475
1355
|
}
|
|
1476
1356
|
//#endregion
|
|
1477
1357
|
//#region src/editor/compose/inspectors/RulesEditor.jsx
|
|
1478
|
-
function
|
|
1358
|
+
function ct({ layer: e, patch: t, seed: n }) {
|
|
1479
1359
|
let r = e.rules ?? [], i = (e, n) => t({
|
|
1480
1360
|
rules: e,
|
|
1481
1361
|
...n
|
|
1482
|
-
}), a = () => i([...r,
|
|
1483
|
-
let t = n.take(), a =
|
|
1362
|
+
}), a = () => i([...r, S()]), o = (e, t) => i(r.map((n, r) => r === e ? t : n)), s = (e) => i(r.filter((t, n) => n !== e)), c = (e) => {
|
|
1363
|
+
let t = n.take(), a = l(t >>> 0);
|
|
1484
1364
|
i(r.map((t, n) => n === e ? {
|
|
1485
|
-
...
|
|
1365
|
+
...w(a),
|
|
1486
1366
|
id: t.id
|
|
1487
1367
|
} : t), { _rollSeed: t });
|
|
1488
1368
|
};
|
|
@@ -1490,26 +1370,25 @@ function lt({ layer: e, patch: t, seed: n }) {
|
|
|
1490
1370
|
label: `Rules · ${r.length}`,
|
|
1491
1371
|
children: /* @__PURE__ */ U("div", {
|
|
1492
1372
|
className: "flex flex-col gap-2",
|
|
1493
|
-
children: [r.map((e, t) => /* @__PURE__ */ H(
|
|
1373
|
+
children: [r.map((e, t) => /* @__PURE__ */ H(pe, {
|
|
1494
1374
|
rule: e,
|
|
1495
1375
|
onChange: (e) => o(t, e),
|
|
1496
1376
|
onRemove: () => s(t),
|
|
1497
1377
|
onReroll: () => c(t)
|
|
1498
1378
|
}, e.id ?? t)), /* @__PURE__ */ U("div", {
|
|
1499
1379
|
className: "grid grid-cols-2 gap-2",
|
|
1500
|
-
children: [/* @__PURE__ */ H(
|
|
1501
|
-
iconComponent: h,
|
|
1380
|
+
children: [/* @__PURE__ */ H(I, {
|
|
1502
1381
|
variant: "primary",
|
|
1503
1382
|
size: "sm",
|
|
1504
1383
|
iconLeft: "plus",
|
|
1505
1384
|
onClick: a,
|
|
1506
1385
|
children: "Add rule"
|
|
1507
|
-
}), /* @__PURE__ */ H(
|
|
1386
|
+
}), /* @__PURE__ */ H(I, {
|
|
1508
1387
|
variant: "primary",
|
|
1509
1388
|
size: "sm",
|
|
1510
1389
|
onClick: () => {
|
|
1511
|
-
let e = n.take(), t =
|
|
1512
|
-
i(Array.from({ length: r }, () =>
|
|
1390
|
+
let e = n.take(), t = l(e >>> 0), r = 1 + Math.floor(t() * 3);
|
|
1391
|
+
i(Array.from({ length: r }, () => w(t)), { _rollSeed: e });
|
|
1513
1392
|
},
|
|
1514
1393
|
children: "Randomize"
|
|
1515
1394
|
})]
|
|
@@ -1519,23 +1398,23 @@ function lt({ layer: e, patch: t, seed: n }) {
|
|
|
1519
1398
|
}
|
|
1520
1399
|
//#endregion
|
|
1521
1400
|
//#region src/editor/compose/inspectors/ProfileEditor.jsx
|
|
1522
|
-
var G = 240, K = 120,
|
|
1523
|
-
function
|
|
1524
|
-
let n = Array.isArray(e) && e.length > 1 ? e :
|
|
1401
|
+
var G = 240, K = 120, lt = 12, q = (e, t, n) => Math.max(t, Math.min(n, e)), J = (e) => e * G, Y = (e) => K / 2 - e * (K / 2 - lt);
|
|
1402
|
+
function ut({ value: e, onChange: t }) {
|
|
1403
|
+
let n = Array.isArray(e) && e.length > 1 ? e : C, r = Se(null), i = Se(null), a = (e) => {
|
|
1525
1404
|
let t = r.current, n = t.createSVGPoint();
|
|
1526
1405
|
n.x = e.clientX, n.y = e.clientY;
|
|
1527
1406
|
let i = n.matrixTransform(t.getScreenCTM().inverse());
|
|
1528
1407
|
return {
|
|
1529
1408
|
nx: i.x / G,
|
|
1530
|
-
ny: (K / 2 - i.y) / (K / 2 -
|
|
1409
|
+
ny: (K / 2 - i.y) / (K / 2 - lt)
|
|
1531
1410
|
};
|
|
1532
1411
|
}, o = (e) => {
|
|
1533
1412
|
let r = i.current;
|
|
1534
1413
|
if (!r) return;
|
|
1535
|
-
let { nx: o, ny: s } = a(e), c =
|
|
1414
|
+
let { nx: o, ny: s } = a(e), c = q(s, -1, 1), l = n.map((e) => ({ ...e })), u = l[r.i];
|
|
1536
1415
|
if (r.type === "anchor") {
|
|
1537
1416
|
let e = r.i === 0, t = r.i === l.length - 1;
|
|
1538
|
-
!e && !t && (u.x =
|
|
1417
|
+
!e && !t && (u.x = q(o, l[r.i - 1].x + .02, l[r.i + 1].x - .02)), u.y = c, e && (l[l.length - 1].y = c), t && (l[0].y = c);
|
|
1539
1418
|
} else r.type === "hr" ? (u.hrx = o - u.x, u.hry = c - u.y) : (u.hlx = o - u.x, u.hly = c - u.y);
|
|
1540
1419
|
t(l);
|
|
1541
1420
|
}, s = (e, t) => (n) => {
|
|
@@ -1552,10 +1431,10 @@ function ft({ value: e, onChange: t }) {
|
|
|
1552
1431
|
e.target.releasePointerCapture(e.pointerId);
|
|
1553
1432
|
} catch {}
|
|
1554
1433
|
}, l = (e) => {
|
|
1555
|
-
let { nx: r, ny: i } = a(e), o =
|
|
1434
|
+
let { nx: r, ny: i } = a(e), o = q(r, .04, .96), s = n.findIndex((e) => e.x > o), c = s < 0 ? n.length - 1 : s, l = n.map((e) => ({ ...e }));
|
|
1556
1435
|
l.splice(c, 0, {
|
|
1557
1436
|
x: o,
|
|
1558
|
-
y:
|
|
1437
|
+
y: q(i, -1, 1),
|
|
1559
1438
|
hlx: -.08,
|
|
1560
1439
|
hly: 0,
|
|
1561
1440
|
hrx: .08,
|
|
@@ -1564,9 +1443,9 @@ function ft({ value: e, onChange: t }) {
|
|
|
1564
1443
|
}, u = (e) => (r) => {
|
|
1565
1444
|
r.stopPropagation(), !(e === 0 || e === n.length - 1 || n.length <= 3) && t(n.filter((t, n) => n !== e));
|
|
1566
1445
|
}, d = n.map((e, t) => {
|
|
1567
|
-
if (t === 0) return `M ${
|
|
1446
|
+
if (t === 0) return `M ${J(e.x)} ${Y(e.y)}`;
|
|
1568
1447
|
let r = n[t - 1];
|
|
1569
|
-
return `C ${
|
|
1448
|
+
return `C ${J(r.x + r.hrx)} ${Y(r.y + r.hry)}, ${J(e.x + e.hlx)} ${Y(e.y + e.hly)}, ${J(e.x)} ${Y(e.y)}`;
|
|
1570
1449
|
}).join(" ");
|
|
1571
1450
|
return /* @__PURE__ */ U("svg", {
|
|
1572
1451
|
ref: r,
|
|
@@ -1597,40 +1476,40 @@ function ft({ value: e, onChange: t }) {
|
|
|
1597
1476
|
}),
|
|
1598
1477
|
n.map((e, t) => /* @__PURE__ */ U("g", { children: [
|
|
1599
1478
|
/* @__PURE__ */ H("line", {
|
|
1600
|
-
x1:
|
|
1601
|
-
y1:
|
|
1602
|
-
x2:
|
|
1603
|
-
y2:
|
|
1479
|
+
x1: J(e.x),
|
|
1480
|
+
y1: Y(e.y),
|
|
1481
|
+
x2: J(e.x + e.hlx),
|
|
1482
|
+
y2: Y(e.y + e.hly),
|
|
1604
1483
|
stroke: "var(--kol-fg-32)",
|
|
1605
1484
|
vectorEffect: "non-scaling-stroke"
|
|
1606
1485
|
}),
|
|
1607
1486
|
/* @__PURE__ */ H("line", {
|
|
1608
|
-
x1:
|
|
1609
|
-
y1:
|
|
1610
|
-
x2:
|
|
1611
|
-
y2:
|
|
1487
|
+
x1: J(e.x),
|
|
1488
|
+
y1: Y(e.y),
|
|
1489
|
+
x2: J(e.x + e.hrx),
|
|
1490
|
+
y2: Y(e.y + e.hry),
|
|
1612
1491
|
stroke: "var(--kol-fg-32)",
|
|
1613
1492
|
vectorEffect: "non-scaling-stroke"
|
|
1614
1493
|
}),
|
|
1615
1494
|
/* @__PURE__ */ H("circle", {
|
|
1616
|
-
cx:
|
|
1617
|
-
cy:
|
|
1495
|
+
cx: J(e.x + e.hlx),
|
|
1496
|
+
cy: Y(e.y + e.hly),
|
|
1618
1497
|
r: "3.5",
|
|
1619
1498
|
fill: "var(--kol-fg-48)",
|
|
1620
1499
|
className: "cursor-grab",
|
|
1621
1500
|
onPointerDown: s("hl", t)
|
|
1622
1501
|
}),
|
|
1623
1502
|
/* @__PURE__ */ H("circle", {
|
|
1624
|
-
cx:
|
|
1625
|
-
cy:
|
|
1503
|
+
cx: J(e.x + e.hrx),
|
|
1504
|
+
cy: Y(e.y + e.hry),
|
|
1626
1505
|
r: "3.5",
|
|
1627
1506
|
fill: "var(--kol-fg-48)",
|
|
1628
1507
|
className: "cursor-grab",
|
|
1629
1508
|
onPointerDown: s("hr", t)
|
|
1630
1509
|
}),
|
|
1631
1510
|
/* @__PURE__ */ H("circle", {
|
|
1632
|
-
cx:
|
|
1633
|
-
cy:
|
|
1511
|
+
cx: J(e.x),
|
|
1512
|
+
cy: Y(e.y),
|
|
1634
1513
|
r: "5",
|
|
1635
1514
|
fill: "var(--kol-surface-on-primary)",
|
|
1636
1515
|
className: "cursor-grab",
|
|
@@ -1641,326 +1520,61 @@ function ft({ value: e, onChange: t }) {
|
|
|
1641
1520
|
]
|
|
1642
1521
|
});
|
|
1643
1522
|
}
|
|
1644
|
-
function
|
|
1523
|
+
function dt({ layer: e, patch: t }) {
|
|
1645
1524
|
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */ H(z, {
|
|
1646
1525
|
label: "Profile curve",
|
|
1647
|
-
children: /* @__PURE__ */ H(
|
|
1648
|
-
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve :
|
|
1526
|
+
children: /* @__PURE__ */ H(ut, {
|
|
1527
|
+
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve : C,
|
|
1649
1528
|
onChange: (e) => t({ waveCurve: e })
|
|
1650
1529
|
})
|
|
1651
1530
|
});
|
|
1652
1531
|
}
|
|
1653
1532
|
//#endregion
|
|
1654
1533
|
//#region src/editor/compose/inspectors/CurveEditor.jsx
|
|
1655
|
-
|
|
1656
|
-
let n =
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
a(t ?? "");
|
|
1663
|
-
}, [t]), /* @__PURE__ */ H(z, {
|
|
1664
|
-
label: e,
|
|
1665
|
-
hint: String(i).trim() !== "" && !b(i, n) ? "doesn’t compile — last good kept" : void 0,
|
|
1666
|
-
children: /* @__PURE__ */ H(he, {
|
|
1667
|
-
variant: "filled",
|
|
1668
|
-
size: "sm",
|
|
1669
|
-
className: "w-full",
|
|
1670
|
-
style: {
|
|
1671
|
-
fontFamily: "var(--kol-font-family-mono, monospace)",
|
|
1672
|
-
fontVariantLigatures: "none"
|
|
1673
|
-
},
|
|
1674
|
-
value: i,
|
|
1675
|
-
onChange: (e) => a(e.target.value),
|
|
1676
|
-
onBlur: () => {
|
|
1677
|
-
i !== t && r(i);
|
|
1678
|
-
},
|
|
1679
|
-
onKeyDown: (e) => {
|
|
1680
|
-
e.key === "Enter" && e.currentTarget.blur();
|
|
1681
|
-
}
|
|
1682
|
-
})
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
function mt({ def: e, commit: t }) {
|
|
1686
|
-
let [n, r] = e.range || [0, 1];
|
|
1687
|
-
return /* @__PURE__ */ U("div", {
|
|
1688
|
-
className: "grid grid-cols-2 gap-2",
|
|
1689
|
-
children: [/* @__PURE__ */ H(z, {
|
|
1690
|
-
label: "Start",
|
|
1691
|
-
children: /* @__PURE__ */ H(l, {
|
|
1692
|
-
variant: "filled",
|
|
1693
|
-
size: "sm",
|
|
1694
|
-
value: n,
|
|
1695
|
-
onCommit: (e) => t({ range: [Y(e, n), r] })
|
|
1696
|
-
})
|
|
1697
|
-
}), /* @__PURE__ */ H(z, {
|
|
1698
|
-
label: "End",
|
|
1699
|
-
children: /* @__PURE__ */ H(l, {
|
|
1700
|
-
variant: "filled",
|
|
1701
|
-
size: "sm",
|
|
1702
|
-
value: r,
|
|
1703
|
-
onCommit: (e) => t({ range: [n, Y(e, r)] })
|
|
1704
|
-
})
|
|
1705
|
-
})]
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
function ht({ def: e, commit: t }) {
|
|
1709
|
-
let n = e.terms || [], r = (e, r, i) => t({ terms: n.map((t, n) => n === e ? {
|
|
1710
|
-
...t,
|
|
1711
|
-
[r]: i
|
|
1712
|
-
} : t) }), i = () => t({ terms: [...n, {
|
|
1713
|
-
amp: .5,
|
|
1714
|
-
freq: 2,
|
|
1715
|
-
phase: 0
|
|
1716
|
-
}] }), a = (e) => t({ terms: n.filter((t, n) => n !== e) });
|
|
1717
|
-
return /* @__PURE__ */ U("div", {
|
|
1718
|
-
className: "flex flex-col gap-2",
|
|
1719
|
-
children: [/* @__PURE__ */ U("div", {
|
|
1720
|
-
className: "flex items-center justify-between",
|
|
1721
|
-
children: [/* @__PURE__ */ H("span", {
|
|
1722
|
-
className: "kol-helper-10 text-meta",
|
|
1723
|
-
children: "Vectors"
|
|
1724
|
-
}), /* @__PURE__ */ H(L, {
|
|
1725
|
-
variant: "primary",
|
|
1726
|
-
size: "sm",
|
|
1727
|
-
onClick: i,
|
|
1728
|
-
children: "Add"
|
|
1729
|
-
})]
|
|
1730
|
-
}), /* @__PURE__ */ U("div", {
|
|
1731
|
-
className: "grid grid-cols-[1fr_1fr_1fr_auto] gap-1.5 items-center min-w-0 [&>*]:min-w-0",
|
|
1732
|
-
children: [
|
|
1733
|
-
/* @__PURE__ */ H("span", {
|
|
1734
|
-
className: "kol-helper-10 text-fg-48 text-center",
|
|
1735
|
-
children: "amp"
|
|
1736
|
-
}),
|
|
1737
|
-
/* @__PURE__ */ H("span", {
|
|
1738
|
-
className: "kol-helper-10 text-fg-48 text-center",
|
|
1739
|
-
children: "freq"
|
|
1740
|
-
}),
|
|
1741
|
-
/* @__PURE__ */ H("span", {
|
|
1742
|
-
className: "kol-helper-10 text-fg-48 text-center",
|
|
1743
|
-
children: "phase"
|
|
1744
|
-
}),
|
|
1745
|
-
/* @__PURE__ */ H("span", {}),
|
|
1746
|
-
n.map((e, t) => /* @__PURE__ */ H(gt, {
|
|
1747
|
-
term: e,
|
|
1748
|
-
onSet: (e, n) => r(t, e, n),
|
|
1749
|
-
onRemove: () => a(t),
|
|
1750
|
-
canRemove: n.length > 1
|
|
1751
|
-
}, t))
|
|
1752
|
-
]
|
|
1753
|
-
})]
|
|
1754
|
-
});
|
|
1755
|
-
}
|
|
1756
|
-
function gt({ term: e, onSet: t, onRemove: n, canRemove: r }) {
|
|
1757
|
-
let i = (n, r) => /* @__PURE__ */ H(l, {
|
|
1758
|
-
variant: "filled",
|
|
1759
|
-
size: "sm",
|
|
1760
|
-
value: e[n] ?? r,
|
|
1761
|
-
onCommit: (i) => t(n, Y(i, e[n] ?? r))
|
|
1762
|
-
});
|
|
1763
|
-
return /* @__PURE__ */ U(V, { children: [
|
|
1764
|
-
i("amp", 1),
|
|
1765
|
-
i("freq", 1),
|
|
1766
|
-
i("phase", 0),
|
|
1767
|
-
/* @__PURE__ */ H(L, {
|
|
1768
|
-
variant: "ghost",
|
|
1769
|
-
size: "sm",
|
|
1770
|
-
onClick: n,
|
|
1771
|
-
disabled: !r,
|
|
1772
|
-
"aria-label": "Remove vector",
|
|
1773
|
-
children: "×"
|
|
1774
|
-
})
|
|
1775
|
-
] });
|
|
1776
|
-
}
|
|
1777
|
-
function _t({ layer: e, patch: t }) {
|
|
1778
|
-
let n = e.clip === "custom", r = n ? null : y(e.clip), i = n ? e.custom ?? C("polar") : r.def, a = i.kind || "polar", o = (a) => {
|
|
1779
|
-
let o = {};
|
|
1780
|
-
n || (o.clip = "custom", (e.copies ?? 1) <= 1 && r.copies > 1 && (o.copies = r.copies), !(e.spiral > 0) && r.spiral > 0 && (o.spiral = r.spiral)), t({
|
|
1781
|
-
...o,
|
|
1782
|
-
custom: {
|
|
1783
|
-
...i,
|
|
1784
|
-
...a
|
|
1785
|
-
}
|
|
1786
|
-
});
|
|
1534
|
+
function ft({ layer: e, patch: t }) {
|
|
1535
|
+
let n = e.clip === "custom", r = n ? null : _(e.clip), i = n ? null : {
|
|
1536
|
+
label: (v.find((t) => t.id === e.clip) || v[0]).label,
|
|
1537
|
+
copies: r.copies,
|
|
1538
|
+
spiral: r.spiral,
|
|
1539
|
+
layerCopies: e.copies,
|
|
1540
|
+
layerSpiral: e.spiral
|
|
1787
1541
|
};
|
|
1788
|
-
return /* @__PURE__ */
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
options: S,
|
|
1800
|
-
value: a,
|
|
1801
|
-
onChange: (e) => {
|
|
1802
|
-
e !== a && t({
|
|
1803
|
-
clip: "custom",
|
|
1804
|
-
custom: C(e)
|
|
1805
|
-
});
|
|
1806
|
-
}
|
|
1807
|
-
}),
|
|
1808
|
-
!n && /* @__PURE__ */ U("p", {
|
|
1809
|
-
className: "kol-helper-10 text-meta",
|
|
1810
|
-
children: [
|
|
1811
|
-
"Editing “",
|
|
1812
|
-
(x.find((t) => t.id === e.clip) || x[0]).label,
|
|
1813
|
-
"” forks it to a custom curve."
|
|
1814
|
-
]
|
|
1815
|
-
}),
|
|
1816
|
-
a === "epicycle" && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(z, {
|
|
1817
|
-
label: "Turns",
|
|
1818
|
-
children: /* @__PURE__ */ H(l, {
|
|
1819
|
-
variant: "filled",
|
|
1820
|
-
size: "sm",
|
|
1821
|
-
value: i.turns ?? 1,
|
|
1822
|
-
onCommit: (e) => o({ turns: Y(e, i.turns ?? 1) })
|
|
1823
|
-
})
|
|
1824
|
-
}), /* @__PURE__ */ H(ht, {
|
|
1825
|
-
def: i,
|
|
1826
|
-
commit: o
|
|
1827
|
-
})] }),
|
|
1828
|
-
a === "polar" && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(mt, {
|
|
1829
|
-
def: i,
|
|
1830
|
-
commit: o
|
|
1831
|
-
}), /* @__PURE__ */ H(X, {
|
|
1832
|
-
label: "r(th)",
|
|
1833
|
-
value: i.r,
|
|
1834
|
-
args: ["th"],
|
|
1835
|
-
onCommit: (e) => o({ r: e })
|
|
1836
|
-
})] }),
|
|
1837
|
-
(a === "param2d" || a === "param3d") && /* @__PURE__ */ U(V, { children: [
|
|
1838
|
-
/* @__PURE__ */ H(mt, {
|
|
1839
|
-
def: i,
|
|
1840
|
-
commit: o
|
|
1841
|
-
}),
|
|
1842
|
-
/* @__PURE__ */ H(X, {
|
|
1843
|
-
label: "x(t)",
|
|
1844
|
-
value: i.x,
|
|
1845
|
-
args: ["t"],
|
|
1846
|
-
onCommit: (e) => o({ x: e })
|
|
1847
|
-
}),
|
|
1848
|
-
/* @__PURE__ */ H(X, {
|
|
1849
|
-
label: "y(t)",
|
|
1850
|
-
value: i.y,
|
|
1851
|
-
args: ["t"],
|
|
1852
|
-
onCommit: (e) => o({ y: e })
|
|
1853
|
-
}),
|
|
1854
|
-
a === "param3d" && /* @__PURE__ */ H(X, {
|
|
1855
|
-
label: "z(t)",
|
|
1856
|
-
value: i.z,
|
|
1857
|
-
args: ["t"],
|
|
1858
|
-
onCommit: (e) => o({ z: e })
|
|
1859
|
-
})
|
|
1860
|
-
] }),
|
|
1861
|
-
a === "points" && /* @__PURE__ */ U(V, { children: [
|
|
1862
|
-
/* @__PURE__ */ H(z, {
|
|
1863
|
-
label: "Count",
|
|
1864
|
-
children: /* @__PURE__ */ H(l, {
|
|
1865
|
-
variant: "filled",
|
|
1866
|
-
size: "sm",
|
|
1867
|
-
value: i.count ?? 1400,
|
|
1868
|
-
onCommit: (e) => o({ count: Math.max(1, Math.round(Y(e, i.count ?? 1400))) })
|
|
1869
|
-
})
|
|
1870
|
-
}),
|
|
1871
|
-
/* @__PURE__ */ H(X, {
|
|
1872
|
-
label: "a(k)",
|
|
1873
|
-
value: i.a,
|
|
1874
|
-
args: ["k"],
|
|
1875
|
-
onCommit: (e) => o({ a: e })
|
|
1876
|
-
}),
|
|
1877
|
-
/* @__PURE__ */ H(X, {
|
|
1878
|
-
label: "r(k)",
|
|
1879
|
-
value: i.r,
|
|
1880
|
-
args: ["k"],
|
|
1881
|
-
onCommit: (e) => o({ r: e })
|
|
1882
|
-
})
|
|
1883
|
-
] }),
|
|
1884
|
-
a === "maurer" && /* @__PURE__ */ U("div", {
|
|
1885
|
-
className: "grid grid-cols-2 gap-2",
|
|
1886
|
-
children: [/* @__PURE__ */ H(z, {
|
|
1887
|
-
label: "n",
|
|
1888
|
-
children: /* @__PURE__ */ H(l, {
|
|
1889
|
-
variant: "filled",
|
|
1890
|
-
size: "sm",
|
|
1891
|
-
value: i.n ?? 6,
|
|
1892
|
-
onCommit: (e) => o({ n: Y(e, i.n ?? 6) })
|
|
1893
|
-
})
|
|
1894
|
-
}), /* @__PURE__ */ H(z, {
|
|
1895
|
-
label: "d°",
|
|
1896
|
-
children: /* @__PURE__ */ H(l, {
|
|
1897
|
-
variant: "filled",
|
|
1898
|
-
size: "sm",
|
|
1899
|
-
value: i.d ?? 71,
|
|
1900
|
-
onCommit: (e) => o({ d: Y(e, i.d ?? 71) })
|
|
1901
|
-
})
|
|
1902
|
-
})]
|
|
1903
|
-
})
|
|
1904
|
-
]
|
|
1905
|
-
});
|
|
1906
|
-
}
|
|
1907
|
-
//#endregion
|
|
1908
|
-
//#region src/editor/compose/inspectors/XYPad.jsx
|
|
1909
|
-
function vt({ xValue: e, yValue: t, xMin: n = 0, xMax: r = 1, yMin: i = 0, yMax: a = 1, onChange: o, xLabel: s, yLabel: c, className: l = "" }) {
|
|
1910
|
-
let u = xe(null), d = (e) => {
|
|
1911
|
-
let t = u.current;
|
|
1912
|
-
if (!t) return;
|
|
1913
|
-
let s = t.getBoundingClientRect(), c = Math.max(0, Math.min(1, (e.clientX - s.left) / s.width)), l = Math.max(0, Math.min(1, (e.clientY - s.top) / s.height)), d = n + c * (r - n), f = a - l * (a - i);
|
|
1914
|
-
o?.(d, f);
|
|
1915
|
-
}, f = (e) => {
|
|
1916
|
-
e.target.setPointerCapture?.(e.pointerId), d(e);
|
|
1917
|
-
}, p = (e) => {
|
|
1918
|
-
e.buttons !== 0 && d(e);
|
|
1919
|
-
}, m = (e, t) => e - t || 1, h = (e - n) / m(r, n) * 100, g = (1 - (t - i) / m(a, i)) * 100;
|
|
1920
|
-
return /* @__PURE__ */ U("div", {
|
|
1921
|
-
className: `flex flex-col gap-1 ${l}`,
|
|
1922
|
-
children: [/* @__PURE__ */ U("div", {
|
|
1923
|
-
className: "flex justify-between kol-helper-10 tracking-widest text-meta",
|
|
1924
|
-
children: [/* @__PURE__ */ H("span", { children: s }), /* @__PURE__ */ H("span", { children: c })]
|
|
1925
|
-
}), /* @__PURE__ */ U("div", {
|
|
1926
|
-
ref: u,
|
|
1927
|
-
onPointerDown: f,
|
|
1928
|
-
onPointerMove: p,
|
|
1929
|
-
className: "relative w-full aspect-square border border-oq-16 bg-fg-04 rounded cursor-crosshair touch-none",
|
|
1930
|
-
children: [
|
|
1931
|
-
/* @__PURE__ */ H("div", { className: "absolute inset-x-0 top-1/2 border-t border-oq-08" }),
|
|
1932
|
-
/* @__PURE__ */ H("div", { className: "absolute inset-y-0 left-1/2 border-l border-oq-08" }),
|
|
1933
|
-
/* @__PURE__ */ H("div", {
|
|
1934
|
-
className: "absolute w-3 h-3 -ml-1.5 -mt-1.5 rounded-full bg-fg-96 border border-oq-04 pointer-events-none",
|
|
1935
|
-
style: {
|
|
1936
|
-
left: `${h}%`,
|
|
1937
|
-
top: `${g}%`
|
|
1938
|
-
}
|
|
1939
|
-
})
|
|
1940
|
-
]
|
|
1941
|
-
})]
|
|
1542
|
+
return /* @__PURE__ */ H(L, {
|
|
1543
|
+
value: n ? e.custom ?? b("polar") : r.def,
|
|
1544
|
+
stock: i,
|
|
1545
|
+
onChange: (e, { extras: n }) => t({
|
|
1546
|
+
clip: "custom",
|
|
1547
|
+
...n,
|
|
1548
|
+
custom: e
|
|
1549
|
+
}),
|
|
1550
|
+
validate: te,
|
|
1551
|
+
kinds: y,
|
|
1552
|
+
defaultFor: b
|
|
1942
1553
|
});
|
|
1943
1554
|
}
|
|
1944
1555
|
//#endregion
|
|
1945
1556
|
//#region src/editor/compose/inspectors/ParatypeTools.jsx
|
|
1946
|
-
function
|
|
1947
|
-
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ H(
|
|
1557
|
+
function pt({ layer: e, patch: t, tab: n }) {
|
|
1558
|
+
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ H(mt, { layer: e }) : n === "style" ? /* @__PURE__ */ H(ht, {
|
|
1948
1559
|
layer: e,
|
|
1949
1560
|
patch: t
|
|
1950
1561
|
}) : null : null;
|
|
1951
1562
|
}
|
|
1952
|
-
function
|
|
1953
|
-
let { flattenParatype: t } =
|
|
1954
|
-
return t ? /* @__PURE__ */ H(
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1563
|
+
function mt({ layer: e }) {
|
|
1564
|
+
let { flattenParatype: t } = c();
|
|
1565
|
+
return t ? /* @__PURE__ */ H(B, {
|
|
1566
|
+
label: "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1567
|
+
children: /* @__PURE__ */ H(I, {
|
|
1568
|
+
"aria-label": "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1569
|
+
variant: "primary",
|
|
1570
|
+
size: "sm",
|
|
1571
|
+
className: "w-full",
|
|
1572
|
+
onClick: () => t(e.id),
|
|
1573
|
+
children: "Flatten to vector"
|
|
1574
|
+
})
|
|
1961
1575
|
}) : null;
|
|
1962
1576
|
}
|
|
1963
|
-
function
|
|
1577
|
+
function ht({ layer: e, patch: t }) {
|
|
1964
1578
|
let r = n(se(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
|
|
1965
1579
|
if (r.length < 2) return null;
|
|
1966
1580
|
let i = (e, t) => r.some((t) => t.key === e) && e !== t ? e : r.find((e) => e.key !== t)?.key, a = i(e._xyX ?? "stemWidth", null), o = i(e._xyY ?? "oWidth", a), s = r.find((e) => e.key === a), c = r.find((e) => e.key === o);
|
|
@@ -2001,7 +1615,7 @@ function xt({ layer: e, patch: t }) {
|
|
|
2001
1615
|
})
|
|
2002
1616
|
})]
|
|
2003
1617
|
}),
|
|
2004
|
-
/* @__PURE__ */ H(
|
|
1618
|
+
/* @__PURE__ */ H(be, {
|
|
2005
1619
|
xValue: l(a, s),
|
|
2006
1620
|
yValue: l(o, c),
|
|
2007
1621
|
xMin: s.min ?? 0,
|
|
@@ -2019,7 +1633,7 @@ function xt({ layer: e, patch: t }) {
|
|
|
2019
1633
|
}
|
|
2020
1634
|
//#endregion
|
|
2021
1635
|
//#region src/editor/compose/inspectors/SoftformsLayers.jsx
|
|
2022
|
-
var
|
|
1636
|
+
var X = 5, gt = [
|
|
2023
1637
|
{
|
|
2024
1638
|
value: "teardrop",
|
|
2025
1639
|
label: "Teardrop"
|
|
@@ -2040,7 +1654,7 @@ var St = 5, Ct = [
|
|
|
2040
1654
|
value: "super",
|
|
2041
1655
|
label: "Lozenge"
|
|
2042
1656
|
}
|
|
2043
|
-
],
|
|
1657
|
+
], _t = [
|
|
2044
1658
|
{
|
|
2045
1659
|
value: "sphere",
|
|
2046
1660
|
label: "Sphere"
|
|
@@ -2057,7 +1671,7 @@ var St = 5, Ct = [
|
|
|
2057
1671
|
value: "lozenge",
|
|
2058
1672
|
label: "Lozenge"
|
|
2059
1673
|
}
|
|
2060
|
-
],
|
|
1674
|
+
], vt = [
|
|
2061
1675
|
{
|
|
2062
1676
|
k: "x",
|
|
2063
1677
|
label: "Position X",
|
|
@@ -2107,7 +1721,7 @@ var St = 5, Ct = [
|
|
|
2107
1721
|
step: .01,
|
|
2108
1722
|
def: 0
|
|
2109
1723
|
}
|
|
2110
|
-
],
|
|
1724
|
+
], yt = [
|
|
2111
1725
|
{
|
|
2112
1726
|
k: "x",
|
|
2113
1727
|
label: "Position X",
|
|
@@ -2174,17 +1788,17 @@ var St = 5, Ct = [
|
|
|
2174
1788
|
step: .01,
|
|
2175
1789
|
def: 0
|
|
2176
1790
|
}
|
|
2177
|
-
],
|
|
2178
|
-
let n = t * Math.sqrt(e()), r = e() *
|
|
1791
|
+
], bt = Math.PI * 2, xt = (e, t, n) => Math.min(n, Math.max(t, e)), Z = (e) => Math.round(e * 100) / 100, Q = (e, t, n) => t + e() * (n - t), St = (e, t) => {
|
|
1792
|
+
let n = t * Math.sqrt(e()), r = e() * bt;
|
|
2179
1793
|
return [n * Math.cos(r), n * Math.sin(r)];
|
|
2180
|
-
},
|
|
2181
|
-
let n = t * Math.cbrt(e()), r = e() *
|
|
1794
|
+
}, Ct = (e, t) => {
|
|
1795
|
+
let n = t * Math.cbrt(e()), r = e() * bt, i = Math.acos(2 * e() - 1);
|
|
2182
1796
|
return [
|
|
2183
1797
|
n * Math.sin(i) * Math.cos(r),
|
|
2184
1798
|
n * Math.sin(i) * Math.sin(r),
|
|
2185
1799
|
n * Math.cos(i) * .8
|
|
2186
1800
|
];
|
|
2187
|
-
},
|
|
1801
|
+
}, wt = (e) => {
|
|
2188
1802
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
2189
1803
|
x: e.x + n.x / t,
|
|
2190
1804
|
y: e.y + n.y / t
|
|
@@ -2197,7 +1811,7 @@ var St = 5, Ct = [
|
|
|
2197
1811
|
x: Z(e.x - n.x),
|
|
2198
1812
|
y: Z(e.y - n.y)
|
|
2199
1813
|
}));
|
|
2200
|
-
},
|
|
1814
|
+
}, Tt = (e) => {
|
|
2201
1815
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
2202
1816
|
x: e.x + n.x / t,
|
|
2203
1817
|
y: e.y + n.y / t,
|
|
@@ -2213,27 +1827,27 @@ var St = 5, Ct = [
|
|
|
2213
1827
|
y: Z(e.y - n.y),
|
|
2214
1828
|
z: Z(e.z - n.z)
|
|
2215
1829
|
}));
|
|
2216
|
-
},
|
|
2217
|
-
function
|
|
2218
|
-
let { updateLayer: t } =
|
|
1830
|
+
}, Et = (e, t) => e.find((e) => e.value === t)?.label ?? t;
|
|
1831
|
+
function Dt({ layer: e }) {
|
|
1832
|
+
let { updateLayer: t } = c(), n = de(e.id, { history: "coalesce" }), r = e.loopId === "softforms3d", i = r && !!e.metaball, a = r ? _t : gt, o = r ? yt : vt, s = i ? 2 : 1, u = Array.isArray(e.forms) ? e.forms : [], [d, f] = Ce(-1), p = d >= 0 && d < u.length ? u[d] : null, h = (t) => {
|
|
2219
1833
|
f(t), window.dispatchEvent(new CustomEvent("kol:softform-select", { detail: {
|
|
2220
1834
|
id: e.id,
|
|
2221
1835
|
index: t,
|
|
2222
1836
|
from: "panel"
|
|
2223
1837
|
} }));
|
|
2224
1838
|
};
|
|
2225
|
-
|
|
1839
|
+
xe(() => {
|
|
2226
1840
|
let t = (t) => {
|
|
2227
1841
|
t.detail?.id === e.id && t.detail.from === "canvas" && f(t.detail.index);
|
|
2228
1842
|
};
|
|
2229
1843
|
return window.addEventListener("kol:softform-select", t), () => window.removeEventListener("kol:softform-select", t);
|
|
2230
1844
|
}, [e.id]);
|
|
2231
|
-
let g = (n) => t(e.id, { forms: n }),
|
|
1845
|
+
let g = (n) => t(e.id, { forms: n }), ee = (e, t) => n.patch({ forms: u.map((n, r) => r === d ? {
|
|
2232
1846
|
...n,
|
|
2233
1847
|
[e]: t
|
|
2234
|
-
} : n) }),
|
|
2235
|
-
if (u.length >=
|
|
2236
|
-
let e =
|
|
1848
|
+
} : n) }), _ = () => {
|
|
1849
|
+
if (u.length >= X) return;
|
|
1850
|
+
let e = r ? {
|
|
2237
1851
|
t: "sphere",
|
|
2238
1852
|
x: 0,
|
|
2239
1853
|
y: 0,
|
|
@@ -2252,25 +1866,25 @@ function Pt({ layer: e }) {
|
|
|
2252
1866
|
rot: 0,
|
|
2253
1867
|
hue: Z(Math.random())
|
|
2254
1868
|
};
|
|
2255
|
-
g([...u, e]),
|
|
2256
|
-
},
|
|
2257
|
-
if (u.length >=
|
|
1869
|
+
g([...u, e]), h(u.length);
|
|
1870
|
+
}, te = (e) => {
|
|
1871
|
+
if (u.length >= X) return;
|
|
2258
1872
|
let t = {
|
|
2259
1873
|
...u[e],
|
|
2260
|
-
x:
|
|
2261
|
-
y:
|
|
1874
|
+
x: xt((u[e].x ?? 0) + .12, -1.2, 1.2),
|
|
1875
|
+
y: xt((u[e].y ?? 0) - .1, -1.2, 1.2)
|
|
2262
1876
|
};
|
|
2263
1877
|
g([
|
|
2264
1878
|
...u.slice(0, e + 1),
|
|
2265
1879
|
t,
|
|
2266
1880
|
...u.slice(e + 1)
|
|
2267
|
-
]),
|
|
2268
|
-
},
|
|
2269
|
-
u.length <=
|
|
2270
|
-
},
|
|
1881
|
+
]), h(e + 1);
|
|
1882
|
+
}, ne = (e) => {
|
|
1883
|
+
u.length <= s || (g(u.filter((t, n) => n !== e)), h(-1));
|
|
1884
|
+
}, v = (e, t) => {
|
|
2271
1885
|
if (t < 0 || t >= u.length) return;
|
|
2272
1886
|
let n = [...u];
|
|
2273
|
-
[n[e], n[t]] = [n[t], n[e]], g(n),
|
|
1887
|
+
[n[e], n[t]] = [n[t], n[e]], g(n), h(t);
|
|
2274
1888
|
};
|
|
2275
1889
|
return /* @__PURE__ */ U("div", {
|
|
2276
1890
|
className: "flex flex-col gap-2",
|
|
@@ -2284,8 +1898,8 @@ function Pt({ layer: e }) {
|
|
|
2284
1898
|
children: u.map((e, t) => {
|
|
2285
1899
|
let n = u.length - 1 - t, r = u[n];
|
|
2286
1900
|
return /* @__PURE__ */ U("div", {
|
|
2287
|
-
onClick: () =>
|
|
2288
|
-
className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${n === d ? "bg-[color-mix(in_srgb,var(--kol-accent-primary)_26%,transparent)] text-emphasis" : "text-body hover:bg-
|
|
1901
|
+
onClick: () => h(n),
|
|
1902
|
+
className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${n === d ? "bg-[color-mix(in_srgb,var(--kol-accent-primary)_26%,transparent)] text-emphasis" : "text-body hover:bg-oq-04 hover:text-emphasis"}`,
|
|
2289
1903
|
children: [
|
|
2290
1904
|
/* @__PURE__ */ H("span", {
|
|
2291
1905
|
className: "kol-helper-10 text-meta shrink-0",
|
|
@@ -2293,90 +1907,96 @@ function Pt({ layer: e }) {
|
|
|
2293
1907
|
}),
|
|
2294
1908
|
/* @__PURE__ */ H("span", {
|
|
2295
1909
|
className: "truncate flex-1 min-w-0",
|
|
2296
|
-
children:
|
|
1910
|
+
children: Et(a, r.t)
|
|
2297
1911
|
}),
|
|
2298
|
-
/* @__PURE__ */ H(
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
1912
|
+
/* @__PURE__ */ H(B, {
|
|
1913
|
+
label: "Move form up",
|
|
1914
|
+
children: /* @__PURE__ */ H(I, {
|
|
1915
|
+
variant: "ghost",
|
|
1916
|
+
size: "sm",
|
|
1917
|
+
quiet: !0,
|
|
1918
|
+
iconOnly: "chevron-down",
|
|
1919
|
+
iconSize: 12,
|
|
1920
|
+
"aria-label": "Move form up",
|
|
1921
|
+
disabled: n >= u.length - 1,
|
|
1922
|
+
onClick: (e) => {
|
|
1923
|
+
e.stopPropagation(), v(n, n + 1);
|
|
1924
|
+
},
|
|
1925
|
+
style: { transform: "rotate(180deg)" }
|
|
1926
|
+
})
|
|
2312
1927
|
}),
|
|
2313
|
-
/* @__PURE__ */ H(
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
1928
|
+
/* @__PURE__ */ H(B, {
|
|
1929
|
+
label: "Move form down",
|
|
1930
|
+
children: /* @__PURE__ */ H(I, {
|
|
1931
|
+
variant: "ghost",
|
|
1932
|
+
size: "sm",
|
|
1933
|
+
quiet: !0,
|
|
1934
|
+
iconOnly: "chevron-down",
|
|
1935
|
+
iconSize: 12,
|
|
1936
|
+
"aria-label": "Move form down",
|
|
1937
|
+
disabled: n <= 0,
|
|
1938
|
+
onClick: (e) => {
|
|
1939
|
+
e.stopPropagation(), v(n, n - 1);
|
|
1940
|
+
}
|
|
1941
|
+
})
|
|
2326
1942
|
}),
|
|
2327
|
-
/* @__PURE__ */ H(
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
1943
|
+
/* @__PURE__ */ H(B, {
|
|
1944
|
+
label: "Duplicate form",
|
|
1945
|
+
children: /* @__PURE__ */ H(I, {
|
|
1946
|
+
variant: "ghost",
|
|
1947
|
+
size: "sm",
|
|
1948
|
+
quiet: !0,
|
|
1949
|
+
iconOnly: "copy",
|
|
1950
|
+
iconSize: 12,
|
|
1951
|
+
"aria-label": "Duplicate form",
|
|
1952
|
+
disabled: u.length >= X,
|
|
1953
|
+
onClick: (e) => {
|
|
1954
|
+
e.stopPropagation(), te(n);
|
|
1955
|
+
}
|
|
1956
|
+
})
|
|
2340
1957
|
}),
|
|
2341
|
-
/* @__PURE__ */ H(
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
1958
|
+
/* @__PURE__ */ H(B, {
|
|
1959
|
+
label: "Delete form",
|
|
1960
|
+
children: /* @__PURE__ */ H(I, {
|
|
1961
|
+
variant: "ghost",
|
|
1962
|
+
size: "sm",
|
|
1963
|
+
quiet: !0,
|
|
1964
|
+
iconOnly: "trash",
|
|
1965
|
+
iconSize: 12,
|
|
1966
|
+
"aria-label": "Delete form",
|
|
1967
|
+
disabled: u.length <= s,
|
|
1968
|
+
onClick: (e) => {
|
|
1969
|
+
e.stopPropagation(), ne(n);
|
|
1970
|
+
}
|
|
1971
|
+
})
|
|
2354
1972
|
})
|
|
2355
1973
|
]
|
|
2356
1974
|
}, n);
|
|
2357
1975
|
})
|
|
2358
1976
|
}),
|
|
2359
|
-
/* @__PURE__ */ H(
|
|
2360
|
-
iconComponent: h,
|
|
1977
|
+
/* @__PURE__ */ H(I, {
|
|
2361
1978
|
variant: "primary",
|
|
2362
1979
|
size: "sm",
|
|
2363
1980
|
className: "w-full",
|
|
2364
1981
|
iconLeft: "plus",
|
|
2365
1982
|
iconSize: 12,
|
|
2366
|
-
disabled: u.length >=
|
|
2367
|
-
onClick:
|
|
1983
|
+
disabled: u.length >= X,
|
|
1984
|
+
onClick: _,
|
|
2368
1985
|
children: "Add form"
|
|
2369
1986
|
}),
|
|
2370
|
-
!
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
1987
|
+
!r && /* @__PURE__ */ H(B, {
|
|
1988
|
+
label: "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
1989
|
+
children: /* @__PURE__ */ H(I, {
|
|
1990
|
+
"aria-label": "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
1991
|
+
variant: "primary",
|
|
1992
|
+
size: "sm",
|
|
1993
|
+
className: "w-full",
|
|
1994
|
+
onClick: () => window.dispatchEvent(new CustomEvent("kol:softform-edit", { detail: {
|
|
1995
|
+
id: e.id,
|
|
1996
|
+
index: Math.max(0, d)
|
|
1997
|
+
} })),
|
|
1998
|
+
children: "Edit forms on canvas"
|
|
1999
|
+
})
|
|
2380
2000
|
}),
|
|
2381
2001
|
p && /* @__PURE__ */ U("div", {
|
|
2382
2002
|
className: "flex flex-col gap-2 pt-1",
|
|
@@ -2391,7 +2011,7 @@ function Pt({ layer: e }) {
|
|
|
2391
2011
|
variant: "subtle",
|
|
2392
2012
|
size: "sm",
|
|
2393
2013
|
className: "w-full",
|
|
2394
|
-
options:
|
|
2014
|
+
options: a,
|
|
2395
2015
|
value: p.t,
|
|
2396
2016
|
onChange: (e) => g(u.map((t, n) => n === d ? {
|
|
2397
2017
|
...t,
|
|
@@ -2399,16 +2019,16 @@ function Pt({ layer: e }) {
|
|
|
2399
2019
|
} : t))
|
|
2400
2020
|
})
|
|
2401
2021
|
}),
|
|
2402
|
-
|
|
2022
|
+
o.map((e) => {
|
|
2403
2023
|
let t = p[e.k] ?? (e.fallback ? p[e.fallback] : void 0), n = typeof t == "number" ? t : e.def;
|
|
2404
2024
|
return /* @__PURE__ */ H(z, {
|
|
2405
2025
|
label: e.label,
|
|
2406
|
-
children: /* @__PURE__ */ H(
|
|
2026
|
+
children: /* @__PURE__ */ H(ve, {
|
|
2407
2027
|
min: e.min,
|
|
2408
2028
|
max: e.max,
|
|
2409
2029
|
step: e.step,
|
|
2410
2030
|
value: n,
|
|
2411
|
-
onChange: (t) =>
|
|
2031
|
+
onChange: (t) => ee(e.k, t)
|
|
2412
2032
|
})
|
|
2413
2033
|
}, e.k);
|
|
2414
2034
|
})
|
|
@@ -2421,11 +2041,11 @@ function Pt({ layer: e }) {
|
|
|
2421
2041
|
/* @__PURE__ */ U("div", {
|
|
2422
2042
|
className: "grid grid-cols-2 gap-2",
|
|
2423
2043
|
children: [
|
|
2424
|
-
/* @__PURE__ */ H(
|
|
2044
|
+
/* @__PURE__ */ H(I, {
|
|
2425
2045
|
variant: "primary",
|
|
2426
2046
|
size: "sm",
|
|
2427
2047
|
onClick: () => {
|
|
2428
|
-
let e =
|
|
2048
|
+
let e = l(m());
|
|
2429
2049
|
g(u.map((t) => ({
|
|
2430
2050
|
...t,
|
|
2431
2051
|
hue: Z(e())
|
|
@@ -2433,12 +2053,12 @@ function Pt({ layer: e }) {
|
|
|
2433
2053
|
},
|
|
2434
2054
|
children: "Color"
|
|
2435
2055
|
}),
|
|
2436
|
-
/* @__PURE__ */ H(
|
|
2056
|
+
/* @__PURE__ */ H(I, {
|
|
2437
2057
|
variant: "primary",
|
|
2438
2058
|
size: "sm",
|
|
2439
2059
|
onClick: () => {
|
|
2440
|
-
let e =
|
|
2441
|
-
g(u.map((t) =>
|
|
2060
|
+
let e = l(m());
|
|
2061
|
+
g(u.map((t) => r ? {
|
|
2442
2062
|
...t,
|
|
2443
2063
|
x: Z(Q(e, -.7, .7)),
|
|
2444
2064
|
y: Z(Q(e, -.7, .7)),
|
|
@@ -2453,32 +2073,32 @@ function Pt({ layer: e }) {
|
|
|
2453
2073
|
},
|
|
2454
2074
|
children: "Transform"
|
|
2455
2075
|
}),
|
|
2456
|
-
/* @__PURE__ */ H(
|
|
2076
|
+
/* @__PURE__ */ H(I, {
|
|
2457
2077
|
variant: "primary",
|
|
2458
2078
|
size: "sm",
|
|
2459
2079
|
onClick: () => {
|
|
2460
|
-
let e =
|
|
2080
|
+
let e = l(m());
|
|
2461
2081
|
g(u.map((t) => {
|
|
2462
|
-
let n = Z(Q(e, .35, .95)),
|
|
2463
|
-
return
|
|
2082
|
+
let n = Z(Q(e, .35, .95)), i = Z(Q(e, .35, .95));
|
|
2083
|
+
return r ? {
|
|
2464
2084
|
...t,
|
|
2465
2085
|
sx: n,
|
|
2466
|
-
sy:
|
|
2086
|
+
sy: i,
|
|
2467
2087
|
sz: Z(Q(e, .35, .95))
|
|
2468
2088
|
} : {
|
|
2469
2089
|
...t,
|
|
2470
2090
|
sx: n,
|
|
2471
|
-
sy:
|
|
2091
|
+
sy: i
|
|
2472
2092
|
};
|
|
2473
2093
|
}));
|
|
2474
2094
|
},
|
|
2475
2095
|
children: "Scale"
|
|
2476
2096
|
}),
|
|
2477
|
-
/* @__PURE__ */ H(
|
|
2097
|
+
/* @__PURE__ */ H(I, {
|
|
2478
2098
|
variant: "primary",
|
|
2479
2099
|
size: "sm",
|
|
2480
2100
|
onClick: () => {
|
|
2481
|
-
let n =
|
|
2101
|
+
let n = l(m());
|
|
2482
2102
|
t(e.id, {
|
|
2483
2103
|
motion: Z(Q(n, 0, 1.1)),
|
|
2484
2104
|
sweep: Math.round(Q(n, 0, 360))
|
|
@@ -2488,17 +2108,17 @@ function Pt({ layer: e }) {
|
|
|
2488
2108
|
})
|
|
2489
2109
|
]
|
|
2490
2110
|
}),
|
|
2491
|
-
/* @__PURE__ */ H(
|
|
2111
|
+
/* @__PURE__ */ H(I, {
|
|
2492
2112
|
variant: "primary",
|
|
2493
2113
|
size: "sm",
|
|
2494
2114
|
className: "w-full",
|
|
2495
2115
|
onClick: () => {
|
|
2496
|
-
let e =
|
|
2497
|
-
if (
|
|
2498
|
-
if (
|
|
2116
|
+
let e = l(m());
|
|
2117
|
+
if (r) {
|
|
2118
|
+
if (i) {
|
|
2499
2119
|
let t = 2 + Math.floor(e() * 4), n = Q(e, .45, .9);
|
|
2500
|
-
g(
|
|
2501
|
-
let [a, o, s] =
|
|
2120
|
+
g(Tt(Array.from({ length: t }, (r, i) => {
|
|
2121
|
+
let [a, o, s] = Ct(e, n), c = Z(Q(e, .5, .92));
|
|
2502
2122
|
return {
|
|
2503
2123
|
t: "sphere",
|
|
2504
2124
|
x: Z(a),
|
|
@@ -2513,8 +2133,8 @@ function Pt({ layer: e }) {
|
|
|
2513
2133
|
})));
|
|
2514
2134
|
} else {
|
|
2515
2135
|
let t = Q(e, .6, 1.15);
|
|
2516
|
-
g(
|
|
2517
|
-
let [r, i, a] =
|
|
2136
|
+
g(Tt(u.map((n) => {
|
|
2137
|
+
let [r, i, a] = Ct(e, t);
|
|
2518
2138
|
return {
|
|
2519
2139
|
...n,
|
|
2520
2140
|
x: Z(r),
|
|
@@ -2527,10 +2147,10 @@ function Pt({ layer: e }) {
|
|
|
2527
2147
|
return;
|
|
2528
2148
|
}
|
|
2529
2149
|
let t = 2 + Math.floor(e() * 4), n = Q(e, .45, .85);
|
|
2530
|
-
g(
|
|
2531
|
-
let [a, o] =
|
|
2150
|
+
g(wt(Array.from({ length: t }, (r, i) => {
|
|
2151
|
+
let [a, o] = St(e, n);
|
|
2532
2152
|
return {
|
|
2533
|
-
t:
|
|
2153
|
+
t: gt[Math.floor(e() * gt.length)].value,
|
|
2534
2154
|
x: Z(a),
|
|
2535
2155
|
y: Z(o),
|
|
2536
2156
|
sx: Z(Q(e, .4, .85)),
|
|
@@ -2547,8 +2167,8 @@ function Pt({ layer: e }) {
|
|
|
2547
2167
|
}
|
|
2548
2168
|
//#endregion
|
|
2549
2169
|
//#region src/loops/theme.js
|
|
2550
|
-
function
|
|
2551
|
-
let i =
|
|
2170
|
+
function Ot(e, t, n, r) {
|
|
2171
|
+
let i = M(n, r), a = {
|
|
2552
2172
|
bg: i.bg,
|
|
2553
2173
|
fg: i.fg,
|
|
2554
2174
|
accent: i.accent,
|
|
@@ -2560,7 +2180,7 @@ function Ft(e, t, n, r) {
|
|
|
2560
2180
|
}
|
|
2561
2181
|
//#endregion
|
|
2562
2182
|
//#region src/editor/compose/inspectors/LoopFields.jsx
|
|
2563
|
-
var
|
|
2183
|
+
var kt = (e, t) => {
|
|
2564
2184
|
let n = e.map((e) => ({
|
|
2565
2185
|
value: e.id,
|
|
2566
2186
|
label: e.label
|
|
@@ -2571,7 +2191,7 @@ var It = (e, t) => {
|
|
|
2571
2191
|
}, ...n] : n;
|
|
2572
2192
|
};
|
|
2573
2193
|
function $({ inline: e, label: t, align: n = "fill", children: r }) {
|
|
2574
|
-
return e ? /* @__PURE__ */ H(
|
|
2194
|
+
return e ? /* @__PURE__ */ H(_e, {
|
|
2575
2195
|
label: t,
|
|
2576
2196
|
align: n,
|
|
2577
2197
|
labelWidth: 96,
|
|
@@ -2581,119 +2201,120 @@ function $({ inline: e, label: t, align: n = "fill", children: r }) {
|
|
|
2581
2201
|
children: r
|
|
2582
2202
|
});
|
|
2583
2203
|
}
|
|
2584
|
-
var
|
|
2204
|
+
var At = [{
|
|
2585
2205
|
value: "off",
|
|
2586
2206
|
label: "Off"
|
|
2587
2207
|
}, {
|
|
2588
2208
|
value: "on",
|
|
2589
2209
|
label: "On"
|
|
2590
2210
|
}];
|
|
2591
|
-
function
|
|
2592
|
-
return e ? /* @__PURE__ */ H(
|
|
2211
|
+
function jt({ inline: e, cs: t, on: n, onChange: r }) {
|
|
2212
|
+
return e ? /* @__PURE__ */ H(ge, {
|
|
2213
|
+
variant: "filled",
|
|
2593
2214
|
size: t,
|
|
2594
|
-
className: `w-full ${
|
|
2595
|
-
options:
|
|
2215
|
+
className: `w-full ${h(t) ?? ""}`,
|
|
2216
|
+
options: At,
|
|
2596
2217
|
value: n ? "on" : "off",
|
|
2597
2218
|
onChange: (e) => r(e === "on")
|
|
2598
2219
|
}) : /* @__PURE__ */ H(ye, {
|
|
2599
2220
|
size: t,
|
|
2600
|
-
options:
|
|
2221
|
+
options: At,
|
|
2601
2222
|
viewMode: n ? "on" : "off",
|
|
2602
2223
|
onViewChange: (e) => r(e === "on")
|
|
2603
2224
|
});
|
|
2604
2225
|
}
|
|
2605
|
-
function
|
|
2606
|
-
let
|
|
2607
|
-
themeId:
|
|
2608
|
-
...
|
|
2609
|
-
}),
|
|
2610
|
-
themeInvert:
|
|
2611
|
-
...
|
|
2612
|
-
}),
|
|
2226
|
+
function Mt({ layer: e, setProp: n, patch: r, updateLayer: i, palette: c, renderAnimate: m, tab: h, tabStrip: ee, tree: _, picker: te = !0, inline: v = !1 }) {
|
|
2227
|
+
let y = t(), b = se(e.loopId), x = b?.params ?? [], S = e.themeId ?? "kol", C = !!e.themeInvert, w = (t) => i(e.id, {
|
|
2228
|
+
themeId: t,
|
|
2229
|
+
...Ot(e, b?.params, t, C)
|
|
2230
|
+
}), ae = (t) => i(e.id, {
|
|
2231
|
+
themeInvert: t,
|
|
2232
|
+
...Ot(e, b?.params, S, t)
|
|
2233
|
+
}), E = Ye(e.loopId), oe = E ? Object.keys(E).map((e) => ({
|
|
2613
2234
|
id: e,
|
|
2614
2235
|
label: e
|
|
2615
|
-
})) : null, D =
|
|
2616
|
-
let
|
|
2617
|
-
stripNoRandom: !!
|
|
2236
|
+
})) : null, D = E ? new Set(Object.values(E).flatMap((e) => Object.keys(e))) : null, O = o(e), k = d(x, e), A = Ke(e.loopId, e), j = (t, n, r) => {
|
|
2237
|
+
let o = a(e, t, O.take(), {
|
|
2238
|
+
stripNoRandom: !!n?.motion,
|
|
2618
2239
|
...r
|
|
2619
2240
|
});
|
|
2620
|
-
A &&
|
|
2621
|
-
}, M = (
|
|
2622
|
-
let
|
|
2623
|
-
for (let
|
|
2624
|
-
let
|
|
2625
|
-
|
|
2241
|
+
A && n?.motion && (n.id !== "Form" && (o._framePreset = "custom"), n.id !== "Frame" && (o._formPreset = "custom")), D && Object.keys(o).some((e) => D.has(e)) && (o._lookPreset = "custom"), i(e.id, o);
|
|
2242
|
+
}, M = (t) => {
|
|
2243
|
+
let n = T(e.loopGroup).find((t) => t.id === e.presetId)?.params ?? {}, r = {};
|
|
2244
|
+
for (let e of t) {
|
|
2245
|
+
let t = n[e.key] === void 0 ? e.default : n[e.key];
|
|
2246
|
+
t !== void 0 && (r[e.key] = t);
|
|
2626
2247
|
}
|
|
2627
|
-
|
|
2628
|
-
},
|
|
2248
|
+
i(e.id, r);
|
|
2249
|
+
}, N = A ? qe(A.frame) : null, ue = A ? qe(A.form) : null, P = (e, t) => {
|
|
2629
2250
|
let n = {};
|
|
2630
|
-
|
|
2251
|
+
N?.has(e) && (n._framePreset = "custom"), ue?.has(e) && (n._formPreset = "custom"), D?.has(e) && (n._lookPreset = "custom"), r({
|
|
2631
2252
|
[e]: t,
|
|
2632
2253
|
...n
|
|
2633
2254
|
});
|
|
2634
|
-
},
|
|
2635
|
-
let
|
|
2636
|
-
|
|
2255
|
+
}, de = (e, t) => (n) => {
|
|
2256
|
+
let i = t.find((e) => e.id === n);
|
|
2257
|
+
r({
|
|
2637
2258
|
[e]: n,
|
|
2638
|
-
...
|
|
2259
|
+
...i?.params ?? {}
|
|
2639
2260
|
});
|
|
2640
|
-
},
|
|
2261
|
+
}, pe = (e) => r({
|
|
2641
2262
|
_lookPreset: e,
|
|
2642
|
-
...
|
|
2643
|
-
}),
|
|
2263
|
+
...E?.[e] ?? {}
|
|
2264
|
+
}), L = b?.camera ? b.camera.map((e) => ({
|
|
2644
2265
|
...e,
|
|
2645
2266
|
section: "Camera"
|
|
2646
|
-
})) : null, me = [...
|
|
2267
|
+
})) : null, me = [...b?.camera ?? [], ...x.filter((e) => g(e) === "Camera")], z = b?.kind === "engine", ge = me.length > 0 || z && b?.orbit, _e = b?.engine === "scene" && (e.animMode === "keyframes" || e.animMode === "keyframe"), ve = b?.orbit ? {
|
|
2647
2268
|
yaw: 1,
|
|
2648
2269
|
dist: 1
|
|
2649
|
-
} : ce(
|
|
2650
|
-
className: `kol-mono-10 text-meta${
|
|
2270
|
+
} : ce(b), B = ve ? /* @__PURE__ */ U("p", {
|
|
2271
|
+
className: `kol-mono-10 text-meta${v ? "" : " col-span-2"}`,
|
|
2651
2272
|
children: [
|
|
2652
2273
|
"Press C (Orbit tool) to move the camera — ",
|
|
2653
|
-
|
|
2274
|
+
b?.orbit ? "drag to orbit, scroll to zoom" : ve.yaw ? "drag to rotate, scroll to zoom" : "scroll to zoom",
|
|
2654
2275
|
"."
|
|
2655
2276
|
]
|
|
2656
2277
|
}) : null;
|
|
2657
2278
|
return /* @__PURE__ */ U(V, { children: [
|
|
2658
|
-
|
|
2279
|
+
te && (v ? /* @__PURE__ */ H(he, {
|
|
2659
2280
|
divided: !0,
|
|
2660
|
-
children: /* @__PURE__ */ H(
|
|
2661
|
-
layer:
|
|
2662
|
-
tree:
|
|
2281
|
+
children: /* @__PURE__ */ H(Me, {
|
|
2282
|
+
layer: e,
|
|
2283
|
+
tree: _,
|
|
2663
2284
|
inline: !0
|
|
2664
2285
|
})
|
|
2665
|
-
}) : /* @__PURE__ */ H(
|
|
2666
|
-
layer:
|
|
2667
|
-
tree:
|
|
2286
|
+
}) : /* @__PURE__ */ H(Me, {
|
|
2287
|
+
layer: e,
|
|
2288
|
+
tree: _
|
|
2668
2289
|
})),
|
|
2669
|
-
|
|
2290
|
+
ee,
|
|
2670
2291
|
(h === "generate" || h === "labs-effect") && /* @__PURE__ */ U(V, { children: [
|
|
2671
|
-
(
|
|
2672
|
-
|
|
2673
|
-
inline:
|
|
2292
|
+
(e.loopId === "softforms" || e.loopId === "softforms3d") && /* @__PURE__ */ H(Dt, { layer: e }),
|
|
2293
|
+
E && !v && /* @__PURE__ */ H($, {
|
|
2294
|
+
inline: v,
|
|
2674
2295
|
label: "Look",
|
|
2675
2296
|
children: /* @__PURE__ */ H(R, {
|
|
2676
2297
|
variant: "subtle",
|
|
2677
|
-
size:
|
|
2298
|
+
size: y,
|
|
2678
2299
|
className: "w-full",
|
|
2679
|
-
options:
|
|
2680
|
-
value:
|
|
2681
|
-
onChange:
|
|
2300
|
+
options: kt(oe, e._lookPreset),
|
|
2301
|
+
value: e._lookPreset ?? "custom",
|
|
2302
|
+
onChange: pe
|
|
2682
2303
|
})
|
|
2683
2304
|
}),
|
|
2684
|
-
|
|
2305
|
+
v && /* @__PURE__ */ U(he, {
|
|
2685
2306
|
divided: !0,
|
|
2686
2307
|
children: [
|
|
2687
|
-
|
|
2308
|
+
E && /* @__PURE__ */ H($, {
|
|
2688
2309
|
inline: !0,
|
|
2689
2310
|
label: "Look",
|
|
2690
2311
|
children: /* @__PURE__ */ H(R, {
|
|
2691
2312
|
variant: "subtle",
|
|
2692
|
-
size:
|
|
2313
|
+
size: y,
|
|
2693
2314
|
className: "w-full",
|
|
2694
|
-
options:
|
|
2695
|
-
value:
|
|
2696
|
-
onChange:
|
|
2315
|
+
options: kt(oe, e._lookPreset),
|
|
2316
|
+
value: e._lookPreset ?? "custom",
|
|
2317
|
+
onChange: pe
|
|
2697
2318
|
})
|
|
2698
2319
|
}),
|
|
2699
2320
|
/* @__PURE__ */ H($, {
|
|
@@ -2701,37 +2322,37 @@ function zt({ layer: n, setProp: r, patch: i, updateLayer: s, palette: c, render
|
|
|
2701
2322
|
label: "Theme",
|
|
2702
2323
|
children: /* @__PURE__ */ H(R, {
|
|
2703
2324
|
variant: "subtle",
|
|
2704
|
-
size:
|
|
2325
|
+
size: y,
|
|
2705
2326
|
className: "w-full",
|
|
2706
|
-
options:
|
|
2707
|
-
value:
|
|
2708
|
-
onChange:
|
|
2327
|
+
options: le,
|
|
2328
|
+
value: S,
|
|
2329
|
+
onChange: w
|
|
2709
2330
|
})
|
|
2710
2331
|
}),
|
|
2711
2332
|
/* @__PURE__ */ H($, {
|
|
2712
2333
|
inline: !0,
|
|
2713
2334
|
label: "Invert",
|
|
2714
|
-
children: /* @__PURE__ */ H(
|
|
2335
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2715
2336
|
inline: !0,
|
|
2716
|
-
cs:
|
|
2717
|
-
on:
|
|
2718
|
-
onChange:
|
|
2337
|
+
cs: y,
|
|
2338
|
+
on: C,
|
|
2339
|
+
onChange: ae
|
|
2719
2340
|
})
|
|
2720
2341
|
}),
|
|
2721
|
-
|
|
2342
|
+
ie(b) && /* @__PURE__ */ H($, {
|
|
2722
2343
|
inline: !0,
|
|
2723
2344
|
label: "Background",
|
|
2724
|
-
children: /* @__PURE__ */ H(
|
|
2345
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2725
2346
|
inline: !0,
|
|
2726
|
-
cs:
|
|
2727
|
-
on:
|
|
2728
|
-
onChange: (e) =>
|
|
2347
|
+
cs: y,
|
|
2348
|
+
on: e.bgOn !== !1,
|
|
2349
|
+
onChange: (e) => n("bgOn", e)
|
|
2729
2350
|
})
|
|
2730
2351
|
}),
|
|
2731
2352
|
B
|
|
2732
2353
|
]
|
|
2733
2354
|
}),
|
|
2734
|
-
!
|
|
2355
|
+
!v && /* @__PURE__ */ U("div", {
|
|
2735
2356
|
className: "grid grid-cols-2 gap-2",
|
|
2736
2357
|
children: [
|
|
2737
2358
|
/* @__PURE__ */ H($, {
|
|
@@ -2739,118 +2360,118 @@ function zt({ layer: n, setProp: r, patch: i, updateLayer: s, palette: c, render
|
|
|
2739
2360
|
label: "Theme",
|
|
2740
2361
|
children: /* @__PURE__ */ H(R, {
|
|
2741
2362
|
variant: "subtle",
|
|
2742
|
-
size:
|
|
2363
|
+
size: y,
|
|
2743
2364
|
className: "w-full",
|
|
2744
|
-
options:
|
|
2745
|
-
value:
|
|
2746
|
-
onChange:
|
|
2365
|
+
options: le,
|
|
2366
|
+
value: S,
|
|
2367
|
+
onChange: w
|
|
2747
2368
|
})
|
|
2748
2369
|
}),
|
|
2749
2370
|
/* @__PURE__ */ H($, {
|
|
2750
2371
|
inline: !1,
|
|
2751
2372
|
label: "Invert",
|
|
2752
|
-
children: /* @__PURE__ */ H(
|
|
2373
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2753
2374
|
inline: !1,
|
|
2754
|
-
cs:
|
|
2755
|
-
on:
|
|
2756
|
-
onChange:
|
|
2375
|
+
cs: y,
|
|
2376
|
+
on: C,
|
|
2377
|
+
onChange: ae
|
|
2757
2378
|
})
|
|
2758
2379
|
}),
|
|
2759
|
-
|
|
2380
|
+
ie(b) && /* @__PURE__ */ H($, {
|
|
2760
2381
|
inline: !1,
|
|
2761
2382
|
label: "Background",
|
|
2762
|
-
children: /* @__PURE__ */ H(
|
|
2383
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2763
2384
|
inline: !1,
|
|
2764
|
-
cs:
|
|
2765
|
-
on:
|
|
2766
|
-
onChange: (e) =>
|
|
2385
|
+
cs: y,
|
|
2386
|
+
on: e.bgOn !== !1,
|
|
2387
|
+
onChange: (e) => n("bgOn", e)
|
|
2767
2388
|
})
|
|
2768
2389
|
}),
|
|
2769
2390
|
B
|
|
2770
2391
|
]
|
|
2771
2392
|
}),
|
|
2772
2393
|
/* @__PURE__ */ H(F, {
|
|
2773
|
-
schema:
|
|
2774
|
-
layer:
|
|
2775
|
-
setProp:
|
|
2394
|
+
schema: x,
|
|
2395
|
+
layer: e,
|
|
2396
|
+
setProp: P,
|
|
2776
2397
|
palette: c,
|
|
2777
|
-
renderAnimate:
|
|
2398
|
+
renderAnimate: m,
|
|
2778
2399
|
tab: "generate",
|
|
2779
|
-
inline:
|
|
2400
|
+
inline: v
|
|
2780
2401
|
}),
|
|
2781
|
-
|
|
2402
|
+
f(e).length > 0 && /* @__PURE__ */ H(I, {
|
|
2782
2403
|
variant: "primary",
|
|
2783
|
-
size:
|
|
2404
|
+
size: y,
|
|
2784
2405
|
className: "w-full",
|
|
2785
2406
|
onClick: () => {
|
|
2786
|
-
let
|
|
2787
|
-
|
|
2407
|
+
let t = s(e, O.take());
|
|
2408
|
+
t && i(e.id, t);
|
|
2788
2409
|
},
|
|
2789
2410
|
children: "Randomize preset"
|
|
2790
2411
|
}),
|
|
2791
|
-
/* @__PURE__ */ H(
|
|
2412
|
+
/* @__PURE__ */ H(I, {
|
|
2792
2413
|
variant: "primary",
|
|
2793
|
-
size:
|
|
2414
|
+
size: y,
|
|
2794
2415
|
className: "w-full",
|
|
2795
|
-
onClick: (
|
|
2416
|
+
onClick: (t) => t.altKey ? M(u(x, e)) : j(u(x, e), void 0, { withFilters: !0 }),
|
|
2796
2417
|
children: "Randomize all"
|
|
2797
2418
|
}),
|
|
2798
2419
|
k.length > 0 && /* @__PURE__ */ U("div", {
|
|
2799
2420
|
className: "grid grid-cols-2 gap-2",
|
|
2800
|
-
children: [k.map((e) => /* @__PURE__ */ H(
|
|
2421
|
+
children: [k.map((e) => /* @__PURE__ */ H(I, {
|
|
2801
2422
|
variant: "primary",
|
|
2802
|
-
size:
|
|
2423
|
+
size: y,
|
|
2803
2424
|
onClick: (t) => t.altKey ? M(e.params) : j(e.params, e),
|
|
2804
2425
|
children: e.label
|
|
2805
|
-
}, e.id)),
|
|
2426
|
+
}, e.id)), e.loopId === "math-expression" && /* @__PURE__ */ H(I, {
|
|
2806
2427
|
variant: "primary",
|
|
2807
|
-
size:
|
|
2808
|
-
onClick: (
|
|
2809
|
-
if (
|
|
2810
|
-
let
|
|
2811
|
-
|
|
2812
|
-
expr:
|
|
2813
|
-
_rollSeed:
|
|
2428
|
+
size: y,
|
|
2429
|
+
onClick: (t) => {
|
|
2430
|
+
if (t.altKey) return M(k.find((e) => e.id === "Expression")?.params ?? []);
|
|
2431
|
+
let n = O.take();
|
|
2432
|
+
i(e.id, {
|
|
2433
|
+
expr: re(l(n >>> 0)),
|
|
2434
|
+
_rollSeed: n
|
|
2814
2435
|
});
|
|
2815
2436
|
},
|
|
2816
2437
|
children: "Wild"
|
|
2817
2438
|
})]
|
|
2818
2439
|
}),
|
|
2819
|
-
!
|
|
2820
|
-
|
|
2821
|
-
layer:
|
|
2822
|
-
patch:
|
|
2440
|
+
!v && /* @__PURE__ */ H(p, { seed: O }),
|
|
2441
|
+
e.loopId === "pattern-rules" && (e.render ?? "tiles") === "tiles" && /* @__PURE__ */ H(ct, {
|
|
2442
|
+
layer: e,
|
|
2443
|
+
patch: r,
|
|
2823
2444
|
seed: O
|
|
2824
2445
|
})
|
|
2825
2446
|
] }),
|
|
2826
2447
|
(h === "style" || h === "labs-effect") && /* @__PURE__ */ U(V, { children: [
|
|
2827
2448
|
/* @__PURE__ */ H(F, {
|
|
2828
|
-
schema:
|
|
2829
|
-
layer:
|
|
2830
|
-
setProp:
|
|
2449
|
+
schema: x,
|
|
2450
|
+
layer: e,
|
|
2451
|
+
setProp: P,
|
|
2831
2452
|
palette: c,
|
|
2832
|
-
renderAnimate:
|
|
2453
|
+
renderAnimate: m,
|
|
2833
2454
|
tab: "style",
|
|
2834
|
-
inline:
|
|
2455
|
+
inline: v
|
|
2835
2456
|
}),
|
|
2836
|
-
|
|
2837
|
-
layer:
|
|
2838
|
-
patch:
|
|
2457
|
+
e.loopId === "pattern-rules" && /* @__PURE__ */ H(dt, {
|
|
2458
|
+
layer: e,
|
|
2459
|
+
patch: r
|
|
2839
2460
|
}),
|
|
2840
|
-
|
|
2841
|
-
layer:
|
|
2842
|
-
patch:
|
|
2461
|
+
e.loopId === "math-curves" && /* @__PURE__ */ H(ft, {
|
|
2462
|
+
layer: e,
|
|
2463
|
+
patch: r
|
|
2843
2464
|
}),
|
|
2844
|
-
|
|
2465
|
+
e.loopId === "math-expression" && /* @__PURE__ */ U("div", {
|
|
2845
2466
|
className: "grid grid-cols-2 gap-2",
|
|
2846
|
-
children: [/* @__PURE__ */ H(
|
|
2467
|
+
children: [/* @__PURE__ */ H(I, {
|
|
2847
2468
|
variant: "primary",
|
|
2848
|
-
size:
|
|
2849
|
-
onClick: () =>
|
|
2469
|
+
size: y,
|
|
2470
|
+
onClick: () => i(e.id, ne(e)),
|
|
2850
2471
|
children: "Fit"
|
|
2851
|
-
}), /* @__PURE__ */ H(
|
|
2472
|
+
}), /* @__PURE__ */ H(I, {
|
|
2852
2473
|
variant: "primary",
|
|
2853
|
-
size:
|
|
2474
|
+
size: y,
|
|
2854
2475
|
onClick: () => M(k.find((e) => e.id === "View")?.params ?? []),
|
|
2855
2476
|
children: "Reset"
|
|
2856
2477
|
})]
|
|
@@ -2863,96 +2484,96 @@ function zt({ layer: n, setProp: r, patch: i, updateLayer: s, palette: c, render
|
|
|
2863
2484
|
children: "Motion"
|
|
2864
2485
|
}),
|
|
2865
2486
|
/* @__PURE__ */ H($, {
|
|
2866
|
-
inline:
|
|
2487
|
+
inline: v,
|
|
2867
2488
|
label: "Frame",
|
|
2868
2489
|
children: /* @__PURE__ */ H(R, {
|
|
2869
2490
|
variant: "subtle",
|
|
2870
|
-
size:
|
|
2491
|
+
size: y,
|
|
2871
2492
|
className: "w-full",
|
|
2872
|
-
options:
|
|
2873
|
-
value:
|
|
2874
|
-
onChange:
|
|
2493
|
+
options: kt(A.frame, e._framePreset),
|
|
2494
|
+
value: e._framePreset ?? "custom",
|
|
2495
|
+
onChange: de("_framePreset", A.frame)
|
|
2875
2496
|
})
|
|
2876
2497
|
}),
|
|
2877
2498
|
/* @__PURE__ */ H($, {
|
|
2878
|
-
inline:
|
|
2499
|
+
inline: v,
|
|
2879
2500
|
label: "Form",
|
|
2880
2501
|
children: /* @__PURE__ */ H(R, {
|
|
2881
2502
|
variant: "subtle",
|
|
2882
|
-
size:
|
|
2503
|
+
size: y,
|
|
2883
2504
|
className: "w-full",
|
|
2884
|
-
options:
|
|
2885
|
-
value:
|
|
2886
|
-
onChange:
|
|
2505
|
+
options: kt(A.form, e._formPreset),
|
|
2506
|
+
value: e._formPreset ?? "custom",
|
|
2507
|
+
onChange: de("_formPreset", A.form)
|
|
2887
2508
|
})
|
|
2888
2509
|
})
|
|
2889
2510
|
] }),
|
|
2890
|
-
/* @__PURE__ */ H(
|
|
2891
|
-
layer:
|
|
2892
|
-
schema:
|
|
2893
|
-
setProp:
|
|
2511
|
+
/* @__PURE__ */ H(fe, {
|
|
2512
|
+
layer: e,
|
|
2513
|
+
schema: x,
|
|
2514
|
+
setProp: P
|
|
2894
2515
|
}),
|
|
2895
2516
|
/* @__PURE__ */ H(F, {
|
|
2896
|
-
schema:
|
|
2897
|
-
layer:
|
|
2898
|
-
setProp:
|
|
2517
|
+
schema: x,
|
|
2518
|
+
layer: e,
|
|
2519
|
+
setProp: P,
|
|
2899
2520
|
palette: c,
|
|
2900
|
-
renderAnimate:
|
|
2521
|
+
renderAnimate: m,
|
|
2901
2522
|
tab: "anim",
|
|
2902
|
-
inline:
|
|
2523
|
+
inline: v
|
|
2903
2524
|
}),
|
|
2904
|
-
_e && /* @__PURE__ */ H(
|
|
2905
|
-
layer:
|
|
2906
|
-
patch:
|
|
2907
|
-
defaultDuration:
|
|
2525
|
+
_e && /* @__PURE__ */ H(ot, {
|
|
2526
|
+
layer: e,
|
|
2527
|
+
patch: r,
|
|
2528
|
+
defaultDuration: b?.duration ?? 8
|
|
2908
2529
|
}),
|
|
2909
|
-
|
|
2910
|
-
schema:
|
|
2911
|
-
layer:
|
|
2912
|
-
setProp:
|
|
2530
|
+
L && /* @__PURE__ */ H(F, {
|
|
2531
|
+
schema: L,
|
|
2532
|
+
layer: e,
|
|
2533
|
+
setProp: n,
|
|
2913
2534
|
palette: c,
|
|
2914
|
-
renderAnimate:
|
|
2915
|
-
inline:
|
|
2535
|
+
renderAnimate: m,
|
|
2536
|
+
inline: v
|
|
2916
2537
|
}),
|
|
2917
|
-
|
|
2918
|
-
layer:
|
|
2919
|
-
patch:
|
|
2538
|
+
ge && /* @__PURE__ */ H(st, {
|
|
2539
|
+
layer: e,
|
|
2540
|
+
patch: r,
|
|
2920
2541
|
camParams: me,
|
|
2921
|
-
isEngine:
|
|
2922
|
-
showHeader: !
|
|
2542
|
+
isEngine: z,
|
|
2543
|
+
showHeader: !L
|
|
2923
2544
|
})
|
|
2924
2545
|
] }),
|
|
2925
|
-
/* @__PURE__ */ H(
|
|
2926
|
-
layer:
|
|
2927
|
-
patch:
|
|
2546
|
+
/* @__PURE__ */ H(pt, {
|
|
2547
|
+
layer: e,
|
|
2548
|
+
patch: r,
|
|
2928
2549
|
tab: h === "labs-effect" ? "style" : h
|
|
2929
2550
|
})
|
|
2930
2551
|
] });
|
|
2931
2552
|
}
|
|
2932
2553
|
//#endregion
|
|
2933
2554
|
//#region src/packs/generators.js
|
|
2934
|
-
var
|
|
2555
|
+
var Nt = {
|
|
2935
2556
|
layerTypes: ["loop", "misc"],
|
|
2936
2557
|
loopById: se,
|
|
2937
|
-
loopDrawParams:
|
|
2558
|
+
loopDrawParams: A,
|
|
2938
2559
|
resolveCameraKeys: ce,
|
|
2939
|
-
loopBgToggleable:
|
|
2940
|
-
presetById:
|
|
2941
|
-
presetParams:
|
|
2942
|
-
presetsInGroup:
|
|
2943
|
-
presetsInSub:
|
|
2944
|
-
presetLayerPatch:
|
|
2945
|
-
isToolPreset:
|
|
2946
|
-
groupById:
|
|
2947
|
-
drawLoopFrame:
|
|
2948
|
-
GENERATIVE_TREE:
|
|
2949
|
-
MISC_TREE:
|
|
2950
|
-
THEME_OPTIONS:
|
|
2951
|
-
buildParatypeFlattenGroup:
|
|
2952
|
-
LoopPicker:
|
|
2953
|
-
LoopFields:
|
|
2954
|
-
loadGlHost: () => import("./host-
|
|
2560
|
+
loopBgToggleable: ie,
|
|
2561
|
+
presetById: ae,
|
|
2562
|
+
presetParams: j,
|
|
2563
|
+
presetsInGroup: T,
|
|
2564
|
+
presetsInSub: E,
|
|
2565
|
+
presetLayerPatch: O,
|
|
2566
|
+
isToolPreset: oe,
|
|
2567
|
+
groupById: k,
|
|
2568
|
+
drawLoopFrame: x,
|
|
2569
|
+
GENERATIVE_TREE: we,
|
|
2570
|
+
MISC_TREE: Te,
|
|
2571
|
+
THEME_OPTIONS: le,
|
|
2572
|
+
buildParatypeFlattenGroup: je,
|
|
2573
|
+
LoopPicker: Me,
|
|
2574
|
+
LoopFields: Mt,
|
|
2575
|
+
loadGlHost: () => import("./host-bXQMgZeW.js")
|
|
2955
2576
|
};
|
|
2956
|
-
|
|
2577
|
+
i("generators", Nt);
|
|
2957
2578
|
//#endregion
|
|
2958
|
-
export {
|
|
2579
|
+
export { rt as a, Te as c, at as i, Mt as n, nt as o, it as r, we as s, Nt as t };
|