@kolkrabbi/design-editor 0.27.0 → 0.28.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-CMUtpJPX.js → BindDot-CaZu6Uuz.js} +5 -5
- package/dist/{ColorModesWindow-CWhL6nfm.js → ColorModesWindow-D65R5YR5.js} +289 -359
- package/dist/Timeline-OZsY9CvR.js +910 -0
- package/dist/TreePicker-BQYPaQv3.js +166 -0
- package/dist/{core-EWu8GfXL.js → core-nPy-QtEz.js} +5533 -4608
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +1223 -799
- package/dist/{useLayerEdit-BFcZhiNX.js → effectCategories-DJrQJ7vg.js} +3683 -3931
- package/dist/{effects-DZEmfY7a.js → effects-dbxBWOCp.js} +115 -114
- package/dist/effects.js +1 -1
- package/dist/{generators-D1tFSZgG.js → generators-CQQxNX9W.js} +721 -482
- package/dist/generators.js +1 -1
- package/dist/{host-ZLJKCZ54.js → host-DBTmkJuu.js} +1 -1
- package/dist/{host-CRsCCafL.js → host-DXizGh-A.js} +36 -36
- package/dist/morphStore-DaOLa9oj.js +145 -0
- package/dist/motion-yfgCBe5u.js +4261 -0
- package/dist/motion.js +1 -1
- package/dist/{previewScale-BMkeLc6w.js → previewScale-DsG-A1ZC.js} +1 -1
- package/dist/{rolls-BGtqxVYq.js → rolls-CGma4Bua.js} +1809 -2107
- package/dist/{src-BpTckTDZ.js → src-CMdJeS6j.js} +1 -1
- package/dist/useLayerEdit-CnPxtfWc.js +453 -0
- package/package.json +13 -10
- package/dist/Timeline-BObvcdXF.js +0 -3014
- package/dist/TreePicker-nMf17QGH.js +0 -68
- package/dist/motion-C_u7tsis.js +0 -2295
|
@@ -1,28 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { $t as e, C as t, Cn as n, D as r, En as i, F as a, I as o, J as s, L as c, On as l, Qt as u, S as d, a as f, bn as p, c as m, d as h, f as g, it as _, kn as v, l as ee, m as te, n as y, nt as ne, o as re, p as b, s as x, t as ie, tn as S, u as ae, vn as oe, x as se } from "./rolls-CGma4Bua.js";
|
|
2
|
+
import { c as ce, n as C, t as le } from "./useLayerEdit-CnPxtfWc.js";
|
|
3
|
+
import { C as ue, D as w, E as T, O as de, S as fe, T as E, _ as D, at as pe, b as me, ct as he, d as ge, dt as O, f as k, ft as _e, h as ve, ht as A, it as ye, l as j, lt as be, m as M, mt as N, n as P, nt as xe, ot as Se, pt as Ce, r as F, rt as we, st as Te, t as I, tt as Ee, v as De, w as Oe, x as L, y as R } from "./effectCategories-DJrQJ7vg.js";
|
|
4
|
+
import { n as z, t as ke } from "./TreePicker-BQYPaQv3.js";
|
|
5
|
+
import { A as Ae, D as je, c as Me, n as Ne } from "./ColorModesWindow-D65R5YR5.js";
|
|
6
|
+
import { h as Pe, r as Fe, s as Ie, t as Le, u as Re } from "./morphStore-DaOLa9oj.js";
|
|
7
|
+
import { BezierPathEditor as ze, Button as B, CurveEditor as Be, Divider as Ve, Dropdown as V, FullscreenOverlay as He, KeyframeEditor as Ue, LabeledControl as H, LabeledControlSection as U, SegmentedToggle as We, SettingsRow as Ge, ShellSearchOverlay as Ke, Slider as qe, StepList as Je, ToggleSwitch as Ye, Tooltip as W, ViewToggle as Xe, XYPad as Ze } from "@kolkrabbi/kol-component";
|
|
8
|
+
import { useCallback as Qe, useEffect as $e, useId as et, useMemo as tt, useState as nt } from "react";
|
|
7
9
|
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
8
|
-
//#region src/loops/
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
//#region src/loops/taxonomy.js
|
|
11
|
+
var rt = [
|
|
12
|
+
{
|
|
13
|
+
label: "Scanline",
|
|
14
|
+
groups: ["scanline"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Pattern",
|
|
18
|
+
groups: [
|
|
19
|
+
"pattern",
|
|
20
|
+
"patternloop",
|
|
21
|
+
"field"
|
|
22
|
+
],
|
|
23
|
+
labels: { pattern: "Rules" }
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "Loops",
|
|
27
|
+
groups: ["shape"]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "Math",
|
|
31
|
+
groups: ["math"]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "Penrose",
|
|
35
|
+
groups: ["penrose"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: "Flow",
|
|
39
|
+
groups: ["flow"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: "Letter Gap",
|
|
43
|
+
groups: ["lettergap"]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Drift",
|
|
47
|
+
groups: ["drift"]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "Gradients",
|
|
51
|
+
groups: ["gradients"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "Soft Forms",
|
|
55
|
+
groups: ["softforms"]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "3D Scene",
|
|
59
|
+
groups: [
|
|
60
|
+
"scene",
|
|
61
|
+
"ribbon",
|
|
62
|
+
"forms",
|
|
63
|
+
"environment",
|
|
64
|
+
"abstract",
|
|
65
|
+
"softforms3d"
|
|
66
|
+
],
|
|
67
|
+
labels: {
|
|
68
|
+
scene: "Primitive",
|
|
69
|
+
softforms3d: "Soft forms"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
], it = [{
|
|
73
|
+
label: "Para Type",
|
|
74
|
+
groups: ["paratype"]
|
|
75
|
+
}], at = rt, ot = {
|
|
76
|
+
optic: "Pattern · Effects",
|
|
77
|
+
paratype: "Para Type · Misc",
|
|
78
|
+
distress: "Distressor · Vector",
|
|
79
|
+
modulator: "Modulator · Vector"
|
|
80
|
+
}, st = Object.fromEntries(Ee.params.map((e) => [e.key, e.default]));
|
|
81
|
+
function ct(e) {
|
|
82
|
+
let t = { ...st };
|
|
83
|
+
for (let n of Object.keys(st)) {
|
|
13
84
|
let r = e[n];
|
|
14
85
|
r != null && typeof r != "object" && (t[n] = r);
|
|
15
86
|
}
|
|
16
87
|
return t;
|
|
17
88
|
}
|
|
18
|
-
function
|
|
89
|
+
function lt(e, t) {
|
|
19
90
|
let n = t.stemWidth ?? 18, r = 0;
|
|
20
91
|
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;
|
|
21
92
|
}
|
|
22
93
|
var J = (e) => Number(e.toFixed(2));
|
|
23
|
-
function
|
|
94
|
+
function ut(e, t, n) {
|
|
24
95
|
if (!e || e.loopId !== "paratype-glyph") return null;
|
|
25
|
-
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a =
|
|
96
|
+
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = ct(e), o = xe(a, r, i);
|
|
26
97
|
if (!o.length) return null;
|
|
27
98
|
let s = [];
|
|
28
99
|
t.bg && s.push({
|
|
@@ -39,7 +110,7 @@ function Qe(e, t, n) {
|
|
|
39
110
|
blend: "normal"
|
|
40
111
|
});
|
|
41
112
|
for (let e of o) {
|
|
42
|
-
let r =
|
|
113
|
+
let r = lt(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 ${J(o)} ${J(c)}" preserveAspectRatio="none"><g transform="translate(${J(r)} ${J(e.y1 + i)}) scale(1 -1)">${l}</g></svg>`;
|
|
43
114
|
s.push({
|
|
44
115
|
id: n("shape"),
|
|
45
116
|
type: "shape",
|
|
@@ -80,12 +151,12 @@ function Y(e, t) {
|
|
|
80
151
|
_framePreset: "custom",
|
|
81
152
|
_formPreset: "custom",
|
|
82
153
|
_lookPreset: "custom",
|
|
83
|
-
...
|
|
154
|
+
...E(e)
|
|
84
155
|
};
|
|
85
156
|
}
|
|
86
|
-
function
|
|
157
|
+
function dt(e, t, n = "preset") {
|
|
87
158
|
if (!e?.loopGroup) return null;
|
|
88
|
-
let r = e.loopGroup, i =
|
|
159
|
+
let r = e.loopGroup, i = T(r);
|
|
89
160
|
if (!i.length) return null;
|
|
90
161
|
let a = i.find((t) => t.id === e.presetId) ?? i[0], o = (e, t) => (e % t + t) % t;
|
|
91
162
|
if (n === "category") {
|
|
@@ -97,7 +168,7 @@ function $e(e, t, n = "preset") {
|
|
|
97
168
|
let s = a.sub ? i.filter((e) => e.sub === a.sub) : i;
|
|
98
169
|
return s.length < 2 ? null : Y(s[o(s.indexOf(a) + t, s.length)], r);
|
|
99
170
|
}
|
|
100
|
-
var
|
|
171
|
+
var ft = {
|
|
101
172
|
h: ["preset", -1],
|
|
102
173
|
ArrowLeft: ["preset", -1],
|
|
103
174
|
l: ["preset", 1],
|
|
@@ -107,16 +178,16 @@ var et = {
|
|
|
107
178
|
j: ["category", 1],
|
|
108
179
|
ArrowDown: ["category", 1]
|
|
109
180
|
};
|
|
110
|
-
function
|
|
181
|
+
function pt(e, t, n) {
|
|
111
182
|
let r = e?.loopGroup;
|
|
112
183
|
if (!r) return !1;
|
|
113
|
-
let i =
|
|
114
|
-
return t === "type" ? n.some((e) => e !== r &&
|
|
184
|
+
let i = T(r).filter((e) => !R(e)), a = i.find((t) => t.id === e.presetId) ?? i[0];
|
|
185
|
+
return t === "type" ? n.some((e) => e !== r && T(e).some((e) => !R(e))) : t === "category" ? new Set(i.map((e) => e.sub).filter((e) => e && e !== a?.sub)).size > 0 : i.some((e) => e.id !== a?.id && (!a?.sub || e.sub === a.sub));
|
|
115
186
|
}
|
|
116
|
-
function
|
|
187
|
+
function mt(e, t, n, r) {
|
|
117
188
|
let i = e?.loopGroup;
|
|
118
189
|
if (!i) return null;
|
|
119
|
-
let a = (e) => e[Math.floor(n() * e.length)], o = (e) =>
|
|
190
|
+
let a = (e) => e[Math.floor(n() * e.length)], o = (e) => T(e).filter((e) => !R(e));
|
|
120
191
|
if (t === "type") {
|
|
121
192
|
let e = r.filter((e) => e !== i && o(e).length);
|
|
122
193
|
if (!e.length) return null;
|
|
@@ -133,7 +204,7 @@ function nt(e, t, n, r) {
|
|
|
133
204
|
let l = s.filter((e) => e.id !== c?.id && (!c?.sub || e.sub === c.sub));
|
|
134
205
|
return l.length ? Y(a(l), i) : null;
|
|
135
206
|
}
|
|
136
|
-
function
|
|
207
|
+
function ht(e, t, n) {
|
|
137
208
|
let r = {};
|
|
138
209
|
for (let i of t) {
|
|
139
210
|
if (i.type !== "range" || i.noRandom || i.min == null || i.max == null) continue;
|
|
@@ -144,33 +215,33 @@ function rt(e, t, n) {
|
|
|
144
215
|
}
|
|
145
216
|
return r;
|
|
146
217
|
}
|
|
147
|
-
var
|
|
218
|
+
var gt = null, _t = () => gt ??= [...F(k).filter((e) => !e.rack).map((e) => ({
|
|
148
219
|
id: e.id,
|
|
149
220
|
filters: e.filters
|
|
150
|
-
})), ...
|
|
221
|
+
})), ...I.map((e) => ({
|
|
151
222
|
id: e.id,
|
|
152
|
-
filters:
|
|
223
|
+
filters: ge(e, k)
|
|
153
224
|
}))].filter((e) => e.filters.length);
|
|
154
|
-
function
|
|
155
|
-
let r = (e) => e[Math.floor(n() * e.length)], i =
|
|
225
|
+
function vt(e, t, n) {
|
|
226
|
+
let r = (e) => e[Math.floor(n() * e.length)], i = P(e);
|
|
156
227
|
if (t === "type") {
|
|
157
|
-
let e =
|
|
228
|
+
let e = _t().filter((e) => e.id !== i);
|
|
158
229
|
return e.length ? r(r(e).filters).id : null;
|
|
159
230
|
}
|
|
160
|
-
let a =
|
|
231
|
+
let a = _t().find((e) => e.id === i)?.filters.filter((t) => t.id !== e) ?? [];
|
|
161
232
|
return a.length ? r(a).id : null;
|
|
162
233
|
}
|
|
163
|
-
function
|
|
164
|
-
let r =
|
|
234
|
+
function yt(e, t, n) {
|
|
235
|
+
let r = j(e?.id), i = (e?.params.find((e) => e.key === r)?.options ?? []).map((e) => typeof e == "object" ? e.value : e).filter((e) => e !== t[r]);
|
|
165
236
|
return i.length ? i[Math.floor(n() * i.length)] : null;
|
|
166
237
|
}
|
|
167
|
-
function
|
|
168
|
-
return e ? t === "type" ?
|
|
238
|
+
function bt(e, t) {
|
|
239
|
+
return e ? t === "type" ? _t().length > 1 : t === "category" ? (_t().find((t) => t.id === P(e.id))?.filters.length ?? 0) > 1 : t === "preset" ? !!j(e.id) : !0 : !1;
|
|
169
240
|
}
|
|
170
241
|
//#endregion
|
|
171
242
|
//#region src/editor/compose/inspectors/LoopPicker.jsx
|
|
172
|
-
function
|
|
173
|
-
let { updateLayer: i } =
|
|
243
|
+
function xt({ layer: e, tree: t = at, inline: n = !0, about: r = null }) {
|
|
244
|
+
let { updateLayer: i } = s(), a = c(), o = e.loopGroup ?? "shape", l = t.find((e) => e.groups.includes(o)) ?? null, u = T(o), d = u.find((t) => t.id === e.presetId), f = [...new Set(u.map((e) => e.sub).filter(Boolean))], p = d?.sub ?? f[0], m = f.length ? u.filter((e) => e.sub === p) : u, h = (t, n = o) => {
|
|
174
245
|
t && i(e.id, {
|
|
175
246
|
loopGroup: n,
|
|
176
247
|
presetId: t.id,
|
|
@@ -179,16 +250,16 @@ function lt({ layer: e, tree: t = je, inline: n = !0, about: r = null }) {
|
|
|
179
250
|
_framePreset: "custom",
|
|
180
251
|
_formPreset: "custom",
|
|
181
252
|
_lookPreset: "custom",
|
|
182
|
-
...
|
|
253
|
+
...E(t)
|
|
183
254
|
});
|
|
184
255
|
};
|
|
185
256
|
return /* @__PURE__ */ q(G, { children: [
|
|
186
|
-
t.length > 1 || !l ? /* @__PURE__ */ K(
|
|
257
|
+
t.length > 1 || !l ? /* @__PURE__ */ K(z, {
|
|
187
258
|
label: "Type",
|
|
188
259
|
inline: n,
|
|
189
260
|
children: /* @__PURE__ */ q("div", {
|
|
190
261
|
className: "flex flex-col gap-1 w-full",
|
|
191
|
-
children: [l ? /* @__PURE__ */ K(
|
|
262
|
+
children: [l ? /* @__PURE__ */ K(ke, {
|
|
192
263
|
options: t.map((e) => ({
|
|
193
264
|
value: e.label,
|
|
194
265
|
label: e.label
|
|
@@ -196,22 +267,22 @@ function lt({ layer: e, tree: t = je, inline: n = !0, about: r = null }) {
|
|
|
196
267
|
value: l.label,
|
|
197
268
|
onChange: (e) => {
|
|
198
269
|
let n = t.find((t) => t.label === e);
|
|
199
|
-
n && h(
|
|
270
|
+
n && h(T(n.groups[0])[0], n.groups[0]);
|
|
200
271
|
}
|
|
201
272
|
}) : /* @__PURE__ */ K("span", {
|
|
202
273
|
className: "kol-helper-12 text-meta px-1",
|
|
203
|
-
children:
|
|
204
|
-
}), l && l.groups.length > 1 && /* @__PURE__ */ K(
|
|
274
|
+
children: ot[o] ?? D(o).label
|
|
275
|
+
}), l && l.groups.length > 1 && /* @__PURE__ */ K(ke, {
|
|
205
276
|
options: l.groups.map((e) => ({
|
|
206
277
|
value: e,
|
|
207
|
-
label: l.labels?.[e] ??
|
|
278
|
+
label: l.labels?.[e] ?? D(e).label
|
|
208
279
|
})),
|
|
209
|
-
value:
|
|
210
|
-
onChange: (e) => h(
|
|
280
|
+
value: o,
|
|
281
|
+
onChange: (e) => h(T(e)[0], e)
|
|
211
282
|
})]
|
|
212
283
|
})
|
|
213
284
|
}) : null,
|
|
214
|
-
f.length > 1 && /* @__PURE__ */ K(
|
|
285
|
+
f.length > 1 && /* @__PURE__ */ K(z, {
|
|
215
286
|
inline: n,
|
|
216
287
|
label: "Category",
|
|
217
288
|
options: f.map((e) => ({
|
|
@@ -221,22 +292,22 @@ function lt({ layer: e, tree: t = je, inline: n = !0, about: r = null }) {
|
|
|
221
292
|
value: p,
|
|
222
293
|
onChange: (e) => h(u.find((t) => t.sub === e))
|
|
223
294
|
}),
|
|
224
|
-
/* @__PURE__ */ K(
|
|
295
|
+
/* @__PURE__ */ K(z, {
|
|
225
296
|
inline: n,
|
|
226
297
|
label: "Preset",
|
|
227
298
|
children: /* @__PURE__ */ q("div", {
|
|
228
299
|
className: "flex w-full gap-1",
|
|
229
300
|
children: [
|
|
230
301
|
m.length > 1 && /* @__PURE__ */ K(B, {
|
|
231
|
-
size:
|
|
302
|
+
size: a,
|
|
232
303
|
iconOnly: "chevron-left",
|
|
233
304
|
"aria-label": "Previous preset (H)",
|
|
234
305
|
onClick: () => {
|
|
235
|
-
let t =
|
|
306
|
+
let t = dt(e, -1);
|
|
236
307
|
t && i(e.id, t);
|
|
237
308
|
}
|
|
238
309
|
}),
|
|
239
|
-
/* @__PURE__ */ K(
|
|
310
|
+
/* @__PURE__ */ K(ke, {
|
|
240
311
|
className: "flex-1 min-w-0",
|
|
241
312
|
options: m.map((e) => ({
|
|
242
313
|
value: e.id,
|
|
@@ -246,11 +317,11 @@ function lt({ layer: e, tree: t = je, inline: n = !0, about: r = null }) {
|
|
|
246
317
|
onChange: (e) => h(u.find((t) => t.id === e))
|
|
247
318
|
}),
|
|
248
319
|
m.length > 1 && /* @__PURE__ */ K(B, {
|
|
249
|
-
size:
|
|
320
|
+
size: a,
|
|
250
321
|
iconOnly: "chevron-right",
|
|
251
322
|
"aria-label": "Next preset (L)",
|
|
252
323
|
onClick: () => {
|
|
253
|
-
let t =
|
|
324
|
+
let t = dt(e, 1);
|
|
254
325
|
t && i(e.id, t);
|
|
255
326
|
}
|
|
256
327
|
}),
|
|
@@ -262,10 +333,10 @@ function lt({ layer: e, tree: t = je, inline: n = !0, about: r = null }) {
|
|
|
262
333
|
}
|
|
263
334
|
//#endregion
|
|
264
335
|
//#region src/editor/params/RollScopesDialog.jsx
|
|
265
|
-
function
|
|
266
|
-
if (
|
|
336
|
+
function St({ open: e, onClose: t, schema: n, layer: r, size: i = "md" }) {
|
|
337
|
+
if (p(), !e) return null;
|
|
267
338
|
let a = re(n ?? [], r);
|
|
268
|
-
return /* @__PURE__ */ K(
|
|
339
|
+
return /* @__PURE__ */ K(He, {
|
|
269
340
|
open: !0,
|
|
270
341
|
scrim: !0,
|
|
271
342
|
onClose: t,
|
|
@@ -279,18 +350,18 @@ function ut({ open: e, onClose: t, schema: n, layer: r, size: i = "md" }) {
|
|
|
279
350
|
}),
|
|
280
351
|
/* @__PURE__ */ q(U, {
|
|
281
352
|
divided: !0,
|
|
282
|
-
children: [a.map((e) => /* @__PURE__ */ K(
|
|
353
|
+
children: [a.map((e) => /* @__PURE__ */ K(Ge, {
|
|
283
354
|
label: e.label,
|
|
284
|
-
children: /* @__PURE__ */ K(
|
|
355
|
+
children: /* @__PURE__ */ K(Ye, {
|
|
285
356
|
checked: m(e.id),
|
|
286
|
-
onChange: (t) =>
|
|
357
|
+
onChange: (t) => ee(e.id, t),
|
|
287
358
|
"aria-label": e.label
|
|
288
359
|
})
|
|
289
|
-
}, e.id)), /* @__PURE__ */ K(
|
|
360
|
+
}, e.id)), /* @__PURE__ */ K(Ge, {
|
|
290
361
|
label: "Effects",
|
|
291
|
-
children: /* @__PURE__ */ K(
|
|
292
|
-
checked:
|
|
293
|
-
onChange: (e) =>
|
|
362
|
+
children: /* @__PURE__ */ K(Ye, {
|
|
363
|
+
checked: x(),
|
|
364
|
+
onChange: (e) => oe("rollEffects", !!e),
|
|
294
365
|
"aria-label": "Effects"
|
|
295
366
|
})
|
|
296
367
|
})]
|
|
@@ -312,7 +383,7 @@ function ut({ open: e, onClose: t, schema: n, layer: r, size: i = "md" }) {
|
|
|
312
383
|
}
|
|
313
384
|
//#endregion
|
|
314
385
|
//#region src/editor/params/motionPresets.js
|
|
315
|
-
var
|
|
386
|
+
var Ct = (e) => l("generators")?.loopById(e) ?? null, wt = {
|
|
316
387
|
frame: [
|
|
317
388
|
{
|
|
318
389
|
id: "static",
|
|
@@ -378,7 +449,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
378
449
|
}
|
|
379
450
|
}
|
|
380
451
|
]
|
|
381
|
-
},
|
|
452
|
+
}, Tt = [
|
|
382
453
|
{
|
|
383
454
|
id: "static",
|
|
384
455
|
label: "Static",
|
|
@@ -432,7 +503,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
432
503
|
panDir: "anti"
|
|
433
504
|
}
|
|
434
505
|
}
|
|
435
|
-
],
|
|
506
|
+
], Et = [
|
|
436
507
|
{
|
|
437
508
|
id: "static",
|
|
438
509
|
label: "Static",
|
|
@@ -545,7 +616,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
545
616
|
colorMix: 0
|
|
546
617
|
}
|
|
547
618
|
}
|
|
548
|
-
],
|
|
619
|
+
], Dt = [
|
|
549
620
|
{
|
|
550
621
|
id: "static",
|
|
551
622
|
label: "Static",
|
|
@@ -613,7 +684,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
613
684
|
stripeAngle: 135
|
|
614
685
|
}
|
|
615
686
|
}
|
|
616
|
-
],
|
|
687
|
+
], Ot = [
|
|
617
688
|
{
|
|
618
689
|
id: "static",
|
|
619
690
|
label: "Static",
|
|
@@ -678,7 +749,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
678
749
|
stripeAngle: 45
|
|
679
750
|
}
|
|
680
751
|
}
|
|
681
|
-
],
|
|
752
|
+
], kt = [
|
|
682
753
|
{
|
|
683
754
|
id: "static",
|
|
684
755
|
label: "Static",
|
|
@@ -715,7 +786,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
715
786
|
fieldCycles: 1
|
|
716
787
|
}
|
|
717
788
|
}
|
|
718
|
-
],
|
|
789
|
+
], At = [
|
|
719
790
|
{
|
|
720
791
|
id: "static",
|
|
721
792
|
label: "Static",
|
|
@@ -760,7 +831,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
760
831
|
fade: .4
|
|
761
832
|
}
|
|
762
833
|
}
|
|
763
|
-
],
|
|
834
|
+
], jt = {
|
|
764
835
|
frame: [
|
|
765
836
|
{
|
|
766
837
|
id: "static",
|
|
@@ -903,7 +974,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
903
974
|
}
|
|
904
975
|
}
|
|
905
976
|
]
|
|
906
|
-
},
|
|
977
|
+
}, Mt = {
|
|
907
978
|
frame: [
|
|
908
979
|
{
|
|
909
980
|
id: "static",
|
|
@@ -977,7 +1048,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
977
1048
|
}
|
|
978
1049
|
}
|
|
979
1050
|
]
|
|
980
|
-
},
|
|
1051
|
+
}, Nt = {
|
|
981
1052
|
frame: [
|
|
982
1053
|
{
|
|
983
1054
|
id: "static",
|
|
@@ -1064,7 +1135,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
1064
1135
|
}
|
|
1065
1136
|
}
|
|
1066
1137
|
]
|
|
1067
|
-
},
|
|
1138
|
+
}, Pt = {
|
|
1068
1139
|
frame: [
|
|
1069
1140
|
{
|
|
1070
1141
|
id: "static",
|
|
@@ -1146,7 +1217,7 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
1146
1217
|
}
|
|
1147
1218
|
}
|
|
1148
1219
|
]
|
|
1149
|
-
},
|
|
1220
|
+
}, Ft = {
|
|
1150
1221
|
frame: [
|
|
1151
1222
|
{
|
|
1152
1223
|
id: "static",
|
|
@@ -1216,30 +1287,30 @@ var dt = (e) => i("generators")?.loopById(e) ?? null, ft = {
|
|
|
1216
1287
|
}
|
|
1217
1288
|
]
|
|
1218
1289
|
};
|
|
1219
|
-
function
|
|
1290
|
+
function It(e, t = {}) {
|
|
1220
1291
|
switch (e) {
|
|
1221
|
-
case "scanline": return
|
|
1292
|
+
case "scanline": return wt;
|
|
1222
1293
|
case "pattern-rules": {
|
|
1223
1294
|
let e = t.render ?? "tiles", n = e === "field" && t.field === "organic";
|
|
1224
1295
|
return {
|
|
1225
|
-
frame: e === "tiles" ?
|
|
1226
|
-
form: e === "tiles" ?
|
|
1296
|
+
frame: e === "tiles" ? Tt : n ? Ot : Dt,
|
|
1297
|
+
form: e === "tiles" ? Et : e === "weave" ? At : kt
|
|
1227
1298
|
};
|
|
1228
1299
|
}
|
|
1229
|
-
case "math-waveform": return
|
|
1230
|
-
case "math-surface": return
|
|
1231
|
-
case "math-field": return (t.kind ?? "scalar") === "complex" ?
|
|
1232
|
-
default: return
|
|
1300
|
+
case "math-waveform": return jt;
|
|
1301
|
+
case "math-surface": return Mt;
|
|
1302
|
+
case "math-field": return (t.kind ?? "scalar") === "complex" ? Pt : Nt;
|
|
1303
|
+
default: return Ct(e)?.params?.some((e) => e.key === "vpSpin") ? Ft : null;
|
|
1233
1304
|
}
|
|
1234
1305
|
}
|
|
1235
|
-
function
|
|
1306
|
+
function Lt(e) {
|
|
1236
1307
|
let t = /* @__PURE__ */ new Set();
|
|
1237
1308
|
for (let n of e ?? []) for (let e of Object.keys(n.params ?? {})) t.add(e);
|
|
1238
1309
|
return t;
|
|
1239
1310
|
}
|
|
1240
1311
|
//#endregion
|
|
1241
1312
|
//#region src/editor/params/lookPresets.js
|
|
1242
|
-
var
|
|
1313
|
+
var Rt = {
|
|
1243
1314
|
Spectrum: {
|
|
1244
1315
|
palette: "spectrum",
|
|
1245
1316
|
spectral: !0,
|
|
@@ -1278,16 +1349,16 @@ var Et = {
|
|
|
1278
1349
|
rim: 1
|
|
1279
1350
|
}
|
|
1280
1351
|
};
|
|
1281
|
-
function
|
|
1282
|
-
return e === "softforms" || e === "softforms3d" ?
|
|
1352
|
+
function zt(e) {
|
|
1353
|
+
return e === "softforms" || e === "softforms3d" ? Rt : null;
|
|
1283
1354
|
}
|
|
1284
1355
|
//#endregion
|
|
1285
1356
|
//#region src/loops/gl/primitiveEasing.js
|
|
1286
|
-
function
|
|
1357
|
+
function Bt(e) {
|
|
1287
1358
|
let t = 7.5625, n = 2.75;
|
|
1288
1359
|
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);
|
|
1289
1360
|
}
|
|
1290
|
-
var
|
|
1361
|
+
var Vt = {
|
|
1291
1362
|
linear: (e) => e,
|
|
1292
1363
|
in: (e) => e * e,
|
|
1293
1364
|
out: (e) => 1 - (1 - e) * (1 - e),
|
|
@@ -1309,8 +1380,8 @@ var kt = {
|
|
|
1309
1380
|
let t = 2 * Math.PI / 3;
|
|
1310
1381
|
return 2 ** (-10 * e) * Math.sin((e * 10 - .75) * t) + 1;
|
|
1311
1382
|
},
|
|
1312
|
-
bounceOut:
|
|
1313
|
-
},
|
|
1383
|
+
bounceOut: Bt
|
|
1384
|
+
}, Ht = {
|
|
1314
1385
|
linear: "Linear",
|
|
1315
1386
|
in: "Ease in",
|
|
1316
1387
|
out: "Ease out",
|
|
@@ -1325,14 +1396,14 @@ var kt = {
|
|
|
1325
1396
|
backInOut: "Back in-out",
|
|
1326
1397
|
elasticOut: "Elastic out",
|
|
1327
1398
|
bounceOut: "Bounce out"
|
|
1328
|
-
},
|
|
1399
|
+
}, Ut = Object.keys(Vt).map((e) => ({
|
|
1329
1400
|
value: e,
|
|
1330
|
-
label:
|
|
1331
|
-
})),
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
],
|
|
1401
|
+
label: Ht[e] || e
|
|
1402
|
+
})), Wt = (e, t, n) => [
|
|
1403
|
+
i(e[0], t[0], n),
|
|
1404
|
+
i(e[1], t[1], n),
|
|
1405
|
+
i(e[2], t[2], n)
|
|
1406
|
+
], Gt = (e) => ({
|
|
1336
1407
|
rot: e.rot || [
|
|
1337
1408
|
0,
|
|
1338
1409
|
0,
|
|
@@ -1345,35 +1416,35 @@ var kt = {
|
|
|
1345
1416
|
],
|
|
1346
1417
|
scale: e.scale ?? 1
|
|
1347
1418
|
});
|
|
1348
|
-
function
|
|
1419
|
+
function Kt(e, t) {
|
|
1349
1420
|
if (!e || !e.length) return {};
|
|
1350
|
-
if (e.length === 1) return
|
|
1421
|
+
if (e.length === 1) return Gt(e[0]);
|
|
1351
1422
|
let n = 0;
|
|
1352
1423
|
for (; n < e.length - 1 && t > e[n + 1].t;) n++;
|
|
1353
|
-
let r = e[n],
|
|
1354
|
-
return
|
|
1355
|
-
rot:
|
|
1424
|
+
let r = e[n], a = e[n + 1] || r, o = a.t - r.t || 1, s = Math.max(0, Math.min(1, (t - r.t) / o));
|
|
1425
|
+
return s = (Vt[a.ease] || Vt.inout)(s), {
|
|
1426
|
+
rot: Wt(r.rot || [
|
|
1356
1427
|
0,
|
|
1357
1428
|
0,
|
|
1358
1429
|
0
|
|
1359
|
-
],
|
|
1430
|
+
], a.rot || [
|
|
1360
1431
|
0,
|
|
1361
1432
|
0,
|
|
1362
1433
|
0
|
|
1363
|
-
],
|
|
1364
|
-
pos:
|
|
1434
|
+
], s),
|
|
1435
|
+
pos: Wt(r.pos || [
|
|
1365
1436
|
0,
|
|
1366
1437
|
0,
|
|
1367
1438
|
0
|
|
1368
|
-
],
|
|
1439
|
+
], a.pos || [
|
|
1369
1440
|
0,
|
|
1370
1441
|
0,
|
|
1371
1442
|
0
|
|
1372
|
-
],
|
|
1373
|
-
scale:
|
|
1443
|
+
], s),
|
|
1444
|
+
scale: i(r.scale ?? 1, a.scale ?? 1, s)
|
|
1374
1445
|
};
|
|
1375
1446
|
}
|
|
1376
|
-
var
|
|
1447
|
+
var qt = [{
|
|
1377
1448
|
t: 0,
|
|
1378
1449
|
rot: [
|
|
1379
1450
|
0,
|
|
@@ -1404,48 +1475,48 @@ var Ft = [{
|
|
|
1404
1475
|
}];
|
|
1405
1476
|
//#endregion
|
|
1406
1477
|
//#region src/loops/gl/phase.js
|
|
1407
|
-
function
|
|
1478
|
+
function Jt(e, t) {
|
|
1408
1479
|
let n = Number(e), r = Number(t);
|
|
1409
1480
|
return !n || n <= 0 || !r || r <= 0 ? 1 : Math.max(1, Math.round(r / n));
|
|
1410
1481
|
}
|
|
1411
|
-
function
|
|
1482
|
+
function Yt(e, t) {
|
|
1412
1483
|
return e * t % 1;
|
|
1413
1484
|
}
|
|
1414
1485
|
//#endregion
|
|
1415
1486
|
//#region src/editor/compose/inspectors/KeyframeEditor.jsx
|
|
1416
|
-
function
|
|
1417
|
-
let r = () =>
|
|
1418
|
-
return /* @__PURE__ */ K(
|
|
1487
|
+
function Xt({ layer: e, patch: t, defaultDuration: n = 8 }) {
|
|
1488
|
+
let r = () => Jt(e.duration ?? n, S.getLoopSeconds());
|
|
1489
|
+
return /* @__PURE__ */ K(Ue, {
|
|
1419
1490
|
keyframes: e.keyframes,
|
|
1420
1491
|
onChange: (e) => t({ keyframes: e }),
|
|
1421
|
-
t: () =>
|
|
1422
|
-
onPause: () =>
|
|
1423
|
-
onSeek: (e) =>
|
|
1424
|
-
easeOptions:
|
|
1425
|
-
defaultKeyframes:
|
|
1492
|
+
t: () => S.getT() * r() % 1,
|
|
1493
|
+
onPause: () => S.pause(),
|
|
1494
|
+
onSeek: (e) => S.seek(e / r()),
|
|
1495
|
+
easeOptions: Ut,
|
|
1496
|
+
defaultKeyframes: qt
|
|
1426
1497
|
});
|
|
1427
1498
|
}
|
|
1428
1499
|
//#endregion
|
|
1429
1500
|
//#region src/editor/compose/inspectors/CameraPoseSlots.jsx
|
|
1430
|
-
function
|
|
1431
|
-
let a =
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1501
|
+
function Zt({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1 }) {
|
|
1502
|
+
let a = c(), o = Array.isArray(e._camSlots) ? e._camSlots : [], s = [
|
|
1503
|
+
o[0] ?? null,
|
|
1504
|
+
o[1] ?? null,
|
|
1505
|
+
o[2] ?? null
|
|
1435
1506
|
], l = (r) => {
|
|
1436
1507
|
let i = {};
|
|
1437
1508
|
for (let t of n) i[t.key] = e[t.key] ?? t.default;
|
|
1438
|
-
let a = [...
|
|
1509
|
+
let a = [...s];
|
|
1439
1510
|
a[r] = i, t({ _camSlots: a });
|
|
1440
1511
|
}, u = (e) => {
|
|
1441
|
-
|
|
1512
|
+
s[e] && t({ ...s[e] });
|
|
1442
1513
|
};
|
|
1443
1514
|
return /* @__PURE__ */ q(G, { children: [i && /* @__PURE__ */ K("span", {
|
|
1444
1515
|
className: "kol-eyebrow text-fg-80",
|
|
1445
1516
|
children: "Camera"
|
|
1446
1517
|
}), /* @__PURE__ */ q("div", {
|
|
1447
1518
|
className: "flex items-center gap-1",
|
|
1448
|
-
children: [n.length > 0 &&
|
|
1519
|
+
children: [n.length > 0 && s.map((e, t) => /* @__PURE__ */ K(W, {
|
|
1449
1520
|
label: e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1450
1521
|
children: /* @__PURE__ */ K(B, {
|
|
1451
1522
|
"aria-label": e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
@@ -1461,7 +1532,7 @@ function zt({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1461
1532
|
onClick: () => {
|
|
1462
1533
|
let i = {};
|
|
1463
1534
|
for (let e of n) i[e.key] = e.default;
|
|
1464
|
-
t(i), r && import("./host-
|
|
1535
|
+
t(i), r && import("./host-DXizGh-A.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
|
|
1465
1536
|
},
|
|
1466
1537
|
children: "Reset"
|
|
1467
1538
|
})]
|
|
@@ -1469,14 +1540,14 @@ function zt({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1469
1540
|
}
|
|
1470
1541
|
//#endregion
|
|
1471
1542
|
//#region src/editor/compose/inspectors/RulesEditor.jsx
|
|
1472
|
-
function
|
|
1473
|
-
let r =
|
|
1543
|
+
function Qt({ layer: e, patch: t, seed: n }) {
|
|
1544
|
+
let r = c(), i = e.rules ?? [], a = (e, n) => t({
|
|
1474
1545
|
rules: e,
|
|
1475
1546
|
...n
|
|
1476
|
-
}),
|
|
1477
|
-
let t = n.take(), r =
|
|
1547
|
+
}), o = () => a([...i, N()]), s = (e, t) => a(i.map((n, r) => r === e ? t : n)), l = (e) => a(i.filter((t, n) => n !== e)), u = (e) => {
|
|
1548
|
+
let t = n.take(), r = g(t >>> 0);
|
|
1478
1549
|
a(i.map((t, n) => n === e ? {
|
|
1479
|
-
...
|
|
1550
|
+
...A(r),
|
|
1480
1551
|
id: t.id
|
|
1481
1552
|
} : t), { _rollSeed: t });
|
|
1482
1553
|
};
|
|
@@ -1484,9 +1555,9 @@ function Bt({ layer: e, patch: t, seed: n }) {
|
|
|
1484
1555
|
label: `Rules · ${i.length}`,
|
|
1485
1556
|
children: /* @__PURE__ */ q("div", {
|
|
1486
1557
|
className: "flex flex-col gap-2",
|
|
1487
|
-
children: [i.map((e, t) => /* @__PURE__ */ K(
|
|
1558
|
+
children: [i.map((e, t) => /* @__PURE__ */ K(je, {
|
|
1488
1559
|
rule: e,
|
|
1489
|
-
onChange: (e) =>
|
|
1560
|
+
onChange: (e) => s(t, e),
|
|
1490
1561
|
onRemove: () => l(t),
|
|
1491
1562
|
onReroll: () => u(t)
|
|
1492
1563
|
}, e.id ?? t)), /* @__PURE__ */ q("div", {
|
|
@@ -1495,14 +1566,14 @@ function Bt({ layer: e, patch: t, seed: n }) {
|
|
|
1495
1566
|
tone: "primary",
|
|
1496
1567
|
size: r,
|
|
1497
1568
|
iconLeft: "plus",
|
|
1498
|
-
onClick:
|
|
1569
|
+
onClick: o,
|
|
1499
1570
|
children: "Add rule"
|
|
1500
1571
|
}), /* @__PURE__ */ K(B, {
|
|
1501
1572
|
tone: "primary",
|
|
1502
1573
|
size: r,
|
|
1503
1574
|
onClick: () => {
|
|
1504
|
-
let e = n.take(), t =
|
|
1505
|
-
a(Array.from({ length: r }, () =>
|
|
1575
|
+
let e = n.take(), t = g(e >>> 0), r = 1 + Math.floor(t() * 3);
|
|
1576
|
+
a(Array.from({ length: r }, () => A(t)), { _rollSeed: e });
|
|
1506
1577
|
},
|
|
1507
1578
|
children: "Randomize"
|
|
1508
1579
|
})]
|
|
@@ -1512,7 +1583,7 @@ function Bt({ layer: e, patch: t, seed: n }) {
|
|
|
1512
1583
|
}
|
|
1513
1584
|
//#endregion
|
|
1514
1585
|
//#region src/editor/compose/inspectors/ProfileEditor.jsx
|
|
1515
|
-
var
|
|
1586
|
+
var $t = (e) => e.map((e) => ({
|
|
1516
1587
|
x: e.x,
|
|
1517
1588
|
y: (1 - e.y) / 2,
|
|
1518
1589
|
hl: {
|
|
@@ -1523,76 +1594,76 @@ var Vt = (e) => e.map((e) => ({
|
|
|
1523
1594
|
x: e.hrx ?? 0,
|
|
1524
1595
|
y: -(e.hry ?? 0) / 2
|
|
1525
1596
|
}
|
|
1526
|
-
})),
|
|
1597
|
+
})), en = (e) => e.map((e) => ({
|
|
1527
1598
|
x: e.x,
|
|
1528
|
-
y:
|
|
1599
|
+
y: n(1 - 2 * e.y, -1, 1),
|
|
1529
1600
|
hlx: e.hl?.x ?? 0,
|
|
1530
1601
|
hly: -2 * (e.hl?.y ?? 0),
|
|
1531
1602
|
hrx: e.hr?.x ?? 0,
|
|
1532
1603
|
hry: -2 * (e.hr?.y ?? 0)
|
|
1533
1604
|
}));
|
|
1534
|
-
function
|
|
1535
|
-
let
|
|
1536
|
-
return /* @__PURE__ */ K(
|
|
1537
|
-
value:
|
|
1605
|
+
function tn({ value: e, onChange: t }) {
|
|
1606
|
+
let r = Array.isArray(e) && e.length > 1 ? e : Ce, i = c();
|
|
1607
|
+
return /* @__PURE__ */ K(ze, {
|
|
1608
|
+
value: $t(r),
|
|
1538
1609
|
onChange: (e) => {
|
|
1539
|
-
let
|
|
1540
|
-
if (
|
|
1541
|
-
|
|
1542
|
-
let
|
|
1543
|
-
|
|
1544
|
-
for (let e = 1; e <
|
|
1545
|
-
t(
|
|
1610
|
+
let i = en(e);
|
|
1611
|
+
if (i.length < 3 || i[0].x > .001 || i[i.length - 1].x < .999) return;
|
|
1612
|
+
i[0].x = 0, i[i.length - 1].x = 1;
|
|
1613
|
+
let a = Math.abs(i[0].y - r[0].y) > 1e-6 ? i[0].y : i[i.length - 1].y;
|
|
1614
|
+
i[0].y = a, i[i.length - 1].y = a;
|
|
1615
|
+
for (let e = 1; e < i.length - 1; e++) i[e].x = n(i[e].x, i[e - 1].x + .02, .98);
|
|
1616
|
+
t(i);
|
|
1546
1617
|
},
|
|
1547
1618
|
aspect: 2,
|
|
1548
|
-
size:
|
|
1619
|
+
size: i,
|
|
1549
1620
|
minPoints: 3,
|
|
1550
1621
|
ariaLabel: "Profile curve"
|
|
1551
1622
|
});
|
|
1552
1623
|
}
|
|
1553
|
-
function
|
|
1624
|
+
function nn({ layer: e, patch: t }) {
|
|
1554
1625
|
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */ K(H, {
|
|
1555
1626
|
label: "Profile curve",
|
|
1556
|
-
children: /* @__PURE__ */ K(
|
|
1557
|
-
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve :
|
|
1627
|
+
children: /* @__PURE__ */ K(tn, {
|
|
1628
|
+
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve : Ce,
|
|
1558
1629
|
onChange: (e) => t({ waveCurve: e })
|
|
1559
1630
|
})
|
|
1560
1631
|
});
|
|
1561
1632
|
}
|
|
1562
1633
|
//#endregion
|
|
1563
1634
|
//#region src/editor/compose/inspectors/CurveEditor.jsx
|
|
1564
|
-
function
|
|
1565
|
-
let n = e.clip === "custom", r = n ? null :
|
|
1566
|
-
label: (
|
|
1635
|
+
function rn({ layer: e, patch: t }) {
|
|
1636
|
+
let n = e.clip === "custom", r = n ? null : Se(e.clip), i = n ? null : {
|
|
1637
|
+
label: (we.find((t) => t.id === e.clip) || we[0]).label,
|
|
1567
1638
|
copies: r.copies,
|
|
1568
1639
|
spiral: r.spiral,
|
|
1569
1640
|
layerCopies: e.copies,
|
|
1570
1641
|
layerSpiral: e.spiral
|
|
1571
1642
|
};
|
|
1572
|
-
return /* @__PURE__ */ K(
|
|
1573
|
-
value: n ? e.custom ??
|
|
1643
|
+
return /* @__PURE__ */ K(Be, {
|
|
1644
|
+
value: n ? e.custom ?? pe("polar") : r.def,
|
|
1574
1645
|
stock: i,
|
|
1575
1646
|
onChange: (e, { extras: n }) => t({
|
|
1576
1647
|
clip: "custom",
|
|
1577
1648
|
...n,
|
|
1578
1649
|
custom: e
|
|
1579
1650
|
}),
|
|
1580
|
-
validate:
|
|
1581
|
-
kinds:
|
|
1582
|
-
defaultFor:
|
|
1651
|
+
validate: Te,
|
|
1652
|
+
kinds: ye,
|
|
1653
|
+
defaultFor: pe
|
|
1583
1654
|
});
|
|
1584
1655
|
}
|
|
1585
1656
|
//#endregion
|
|
1586
1657
|
//#region src/editor/compose/inspectors/ParatypeTools.jsx
|
|
1587
|
-
function
|
|
1588
|
-
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ K(
|
|
1658
|
+
function an({ layer: e, patch: t, tab: n, renderAnimate: r }) {
|
|
1659
|
+
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ K(on, { layer: e }) : n === "style" ? /* @__PURE__ */ K(sn, {
|
|
1589
1660
|
layer: e,
|
|
1590
1661
|
patch: t,
|
|
1591
1662
|
renderAnimate: r
|
|
1592
1663
|
}) : null : null;
|
|
1593
1664
|
}
|
|
1594
|
-
function
|
|
1595
|
-
let t =
|
|
1665
|
+
function on({ layer: e }) {
|
|
1666
|
+
let t = c(), { flattenParatype: n } = s();
|
|
1596
1667
|
return n ? /* @__PURE__ */ K(W, {
|
|
1597
1668
|
label: "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1598
1669
|
children: /* @__PURE__ */ K(B, {
|
|
@@ -1605,12 +1676,12 @@ function qt({ layer: e }) {
|
|
|
1605
1676
|
})
|
|
1606
1677
|
}) : null;
|
|
1607
1678
|
}
|
|
1608
|
-
function
|
|
1609
|
-
let i =
|
|
1679
|
+
function sn({ layer: e, patch: t, renderAnimate: n }) {
|
|
1680
|
+
let i = c(), a = _(L(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
|
|
1610
1681
|
if (a.length < 2) return null;
|
|
1611
|
-
let
|
|
1682
|
+
let o = (e, t) => a.some((t) => t.key === e) && e !== t ? e : a.find((e) => e.key !== t)?.key, s = o(e._xyX ?? "stemWidth", null), l = o(e._xyY ?? "oWidth", s), u = a.find((e) => e.key === s), d = a.find((e) => e.key === l);
|
|
1612
1683
|
if (!u || !d) return null;
|
|
1613
|
-
let f = (t, n) => typeof e[t] == "number" ? e[t] : n.default, p = (
|
|
1684
|
+
let f = (t, n) => typeof e[t] == "number" ? e[t] : n.default, p = (t) => r(e[t]), m = (e, t) => {
|
|
1614
1685
|
let n = t.step ?? 1;
|
|
1615
1686
|
return n < 1 ? Number((Math.round(e / n) * n).toFixed(4)) : Math.round(e);
|
|
1616
1687
|
}, h = a.map((e) => ({
|
|
@@ -1633,9 +1704,9 @@ function Jt({ layer: e, patch: n, renderAnimate: r }) {
|
|
|
1633
1704
|
size: i,
|
|
1634
1705
|
className: "w-full min-w-0",
|
|
1635
1706
|
options: h,
|
|
1636
|
-
value:
|
|
1637
|
-
onChange: (e) =>
|
|
1638
|
-
}),
|
|
1707
|
+
value: s,
|
|
1708
|
+
onChange: (e) => t({ _xyX: e })
|
|
1709
|
+
}), n?.(u)]
|
|
1639
1710
|
})
|
|
1640
1711
|
}), /* @__PURE__ */ K(H, {
|
|
1641
1712
|
label: "Y axis",
|
|
@@ -1647,13 +1718,13 @@ function Jt({ layer: e, patch: n, renderAnimate: r }) {
|
|
|
1647
1718
|
className: "w-full min-w-0",
|
|
1648
1719
|
options: h,
|
|
1649
1720
|
value: l,
|
|
1650
|
-
onChange: (e) =>
|
|
1651
|
-
}),
|
|
1721
|
+
onChange: (e) => t({ _xyY: e })
|
|
1722
|
+
}), n?.(d)]
|
|
1652
1723
|
})
|
|
1653
1724
|
})]
|
|
1654
1725
|
}),
|
|
1655
|
-
/* @__PURE__ */ K(
|
|
1656
|
-
xValue: f(
|
|
1726
|
+
/* @__PURE__ */ K(Ze, {
|
|
1727
|
+
xValue: f(s, u),
|
|
1657
1728
|
yValue: f(l, d),
|
|
1658
1729
|
xMin: u.min ?? 0,
|
|
1659
1730
|
xMax: u.max ?? 1,
|
|
@@ -1661,16 +1732,16 @@ function Jt({ layer: e, patch: n, renderAnimate: r }) {
|
|
|
1661
1732
|
yMax: d.max ?? 1,
|
|
1662
1733
|
xLabel: u.label,
|
|
1663
1734
|
yLabel: d.label,
|
|
1664
|
-
onChange: (e,
|
|
1665
|
-
...!p(
|
|
1666
|
-
...!p(l) && { [l]: m(
|
|
1735
|
+
onChange: (e, n) => t({
|
|
1736
|
+
...!p(s) && { [s]: m(e, u) },
|
|
1737
|
+
...!p(l) && { [l]: m(n, d) }
|
|
1667
1738
|
})
|
|
1668
1739
|
})
|
|
1669
1740
|
] });
|
|
1670
1741
|
}
|
|
1671
1742
|
//#endregion
|
|
1672
1743
|
//#region src/editor/compose/inspectors/SoftformsLayers.jsx
|
|
1673
|
-
var
|
|
1744
|
+
var cn = 5, ln = [
|
|
1674
1745
|
{
|
|
1675
1746
|
value: "teardrop",
|
|
1676
1747
|
label: "Teardrop"
|
|
@@ -1691,7 +1762,7 @@ var Yt = 5, Xt = [
|
|
|
1691
1762
|
value: "super",
|
|
1692
1763
|
label: "Lozenge"
|
|
1693
1764
|
}
|
|
1694
|
-
],
|
|
1765
|
+
], un = [
|
|
1695
1766
|
{
|
|
1696
1767
|
value: "sphere",
|
|
1697
1768
|
label: "Sphere"
|
|
@@ -1708,7 +1779,7 @@ var Yt = 5, Xt = [
|
|
|
1708
1779
|
value: "lozenge",
|
|
1709
1780
|
label: "Lozenge"
|
|
1710
1781
|
}
|
|
1711
|
-
],
|
|
1782
|
+
], dn = [
|
|
1712
1783
|
{
|
|
1713
1784
|
k: "x",
|
|
1714
1785
|
label: "Position X",
|
|
@@ -1758,7 +1829,7 @@ var Yt = 5, Xt = [
|
|
|
1758
1829
|
step: .01,
|
|
1759
1830
|
def: 0
|
|
1760
1831
|
}
|
|
1761
|
-
],
|
|
1832
|
+
], fn = [
|
|
1762
1833
|
{
|
|
1763
1834
|
k: "x",
|
|
1764
1835
|
label: "Position X",
|
|
@@ -1825,17 +1896,17 @@ var Yt = 5, Xt = [
|
|
|
1825
1896
|
step: .01,
|
|
1826
1897
|
def: 0
|
|
1827
1898
|
}
|
|
1828
|
-
],
|
|
1829
|
-
let n = t * Math.sqrt(e()), r = e() *
|
|
1899
|
+
], pn = Math.PI * 2, X = (e) => Math.round(e * 100) / 100, Z = (e, t, n) => t + e() * (n - t), mn = (e, t) => {
|
|
1900
|
+
let n = t * Math.sqrt(e()), r = e() * pn;
|
|
1830
1901
|
return [n * Math.cos(r), n * Math.sin(r)];
|
|
1831
|
-
},
|
|
1832
|
-
let n = t * Math.cbrt(e()), r = e() *
|
|
1902
|
+
}, hn = (e, t) => {
|
|
1903
|
+
let n = t * Math.cbrt(e()), r = e() * pn, i = Math.acos(2 * e() - 1);
|
|
1833
1904
|
return [
|
|
1834
1905
|
n * Math.sin(i) * Math.cos(r),
|
|
1835
1906
|
n * Math.sin(i) * Math.sin(r),
|
|
1836
1907
|
n * Math.cos(i) * .8
|
|
1837
1908
|
];
|
|
1838
|
-
},
|
|
1909
|
+
}, gn = (e) => {
|
|
1839
1910
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
1840
1911
|
x: e.x + n.x / t,
|
|
1841
1912
|
y: e.y + n.y / t
|
|
@@ -1848,7 +1919,7 @@ var Yt = 5, Xt = [
|
|
|
1848
1919
|
x: X(e.x - n.x),
|
|
1849
1920
|
y: X(e.y - n.y)
|
|
1850
1921
|
}));
|
|
1851
|
-
},
|
|
1922
|
+
}, _n = (e) => {
|
|
1852
1923
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
1853
1924
|
x: e.x + n.x / t,
|
|
1854
1925
|
y: e.y + n.y / t,
|
|
@@ -1864,27 +1935,27 @@ var Yt = 5, Xt = [
|
|
|
1864
1935
|
y: X(e.y - n.y),
|
|
1865
1936
|
z: X(e.z - n.z)
|
|
1866
1937
|
}));
|
|
1867
|
-
},
|
|
1868
|
-
function
|
|
1869
|
-
let t =
|
|
1870
|
-
|
|
1938
|
+
}, vn = (e, t) => e.find((e) => e.value === t)?.label ?? t;
|
|
1939
|
+
function yn({ layer: e }) {
|
|
1940
|
+
let t = c(), { updateLayer: r } = s(), i = le(e.id, { history: "coalesce" }), a = e.loopId === "softforms3d", o = a && !!e.metaball, l = a ? un : ln, u = a ? fn : dn, d = o ? 2 : 1, f = Array.isArray(e.forms) ? e.forms : [], [p, m] = nt(-1), h = p >= 0 && p < f.length ? f[p] : null, _ = (t) => {
|
|
1941
|
+
m(t), window.dispatchEvent(new CustomEvent("kol:softform-select", { detail: {
|
|
1871
1942
|
id: e.id,
|
|
1872
1943
|
index: t,
|
|
1873
1944
|
from: "panel"
|
|
1874
1945
|
} }));
|
|
1875
1946
|
};
|
|
1876
|
-
|
|
1947
|
+
$e(() => {
|
|
1877
1948
|
let t = (t) => {
|
|
1878
|
-
t.detail?.id === e.id && t.detail.from === "canvas" &&
|
|
1949
|
+
t.detail?.id === e.id && t.detail.from === "canvas" && m(t.detail.index);
|
|
1879
1950
|
};
|
|
1880
1951
|
return window.addEventListener("kol:softform-select", t), () => window.removeEventListener("kol:softform-select", t);
|
|
1881
1952
|
}, [e.id]);
|
|
1882
|
-
let
|
|
1953
|
+
let v = (t) => r(e.id, { forms: t }), ee = (e, t) => i.patch({ forms: f.map((n, r) => r === p ? {
|
|
1883
1954
|
...n,
|
|
1884
1955
|
[e]: t
|
|
1885
|
-
} : n) }),
|
|
1886
|
-
if (
|
|
1887
|
-
let e =
|
|
1956
|
+
} : n) }), te = () => {
|
|
1957
|
+
if (f.length >= cn) return;
|
|
1958
|
+
let e = a ? {
|
|
1888
1959
|
t: "sphere",
|
|
1889
1960
|
x: 0,
|
|
1890
1961
|
y: 0,
|
|
@@ -1903,25 +1974,25 @@ function sn({ layer: e }) {
|
|
|
1903
1974
|
rot: 0,
|
|
1904
1975
|
hue: X(Math.random())
|
|
1905
1976
|
};
|
|
1906
|
-
|
|
1907
|
-
},
|
|
1908
|
-
if (
|
|
1977
|
+
v([...f, e]), _(f.length);
|
|
1978
|
+
}, y = (e) => {
|
|
1979
|
+
if (f.length >= cn) return;
|
|
1909
1980
|
let t = {
|
|
1910
|
-
...
|
|
1911
|
-
x:
|
|
1912
|
-
y:
|
|
1981
|
+
...f[e],
|
|
1982
|
+
x: n((f[e].x ?? 0) + .12, -1.2, 1.2),
|
|
1983
|
+
y: n((f[e].y ?? 0) - .1, -1.2, 1.2)
|
|
1913
1984
|
};
|
|
1914
|
-
|
|
1915
|
-
...
|
|
1985
|
+
v([
|
|
1986
|
+
...f.slice(0, e + 1),
|
|
1916
1987
|
t,
|
|
1917
|
-
...
|
|
1918
|
-
]),
|
|
1919
|
-
},
|
|
1920
|
-
|
|
1921
|
-
},
|
|
1922
|
-
if (t < 0 || t >=
|
|
1923
|
-
let n = [...
|
|
1924
|
-
[n[e], n[t]] = [n[t], n[e]],
|
|
1988
|
+
...f.slice(e + 1)
|
|
1989
|
+
]), _(e + 1);
|
|
1990
|
+
}, ne = (e) => {
|
|
1991
|
+
f.length <= d || (v(f.filter((t, n) => n !== e)), _(-1));
|
|
1992
|
+
}, re = (e, t) => {
|
|
1993
|
+
if (t < 0 || t >= f.length) return;
|
|
1994
|
+
let n = [...f];
|
|
1995
|
+
[n[e], n[t]] = [n[t], n[e]], v(n), _(t);
|
|
1925
1996
|
};
|
|
1926
1997
|
return /* @__PURE__ */ q("div", {
|
|
1927
1998
|
className: "flex flex-col gap-2",
|
|
@@ -1930,41 +2001,41 @@ function sn({ layer: e }) {
|
|
|
1930
2001
|
className: "kol-eyebrow text-fg-80",
|
|
1931
2002
|
children: "Forms"
|
|
1932
2003
|
}),
|
|
1933
|
-
/* @__PURE__ */ K(
|
|
2004
|
+
/* @__PURE__ */ K(Je, {
|
|
1934
2005
|
size: t,
|
|
1935
2006
|
reorder: "grab",
|
|
1936
|
-
activeIndex:
|
|
1937
|
-
items:
|
|
1938
|
-
let n =
|
|
2007
|
+
activeIndex: p >= 0 ? f.length - 1 - p : null,
|
|
2008
|
+
items: f.map((e, t) => {
|
|
2009
|
+
let n = f.length - 1 - t;
|
|
1939
2010
|
return {
|
|
1940
2011
|
id: n,
|
|
1941
|
-
label:
|
|
2012
|
+
label: vn(l, f[n].t),
|
|
1942
2013
|
actions: [{
|
|
1943
2014
|
icon: "copy",
|
|
1944
2015
|
label: "Duplicate form",
|
|
1945
|
-
hidden:
|
|
1946
|
-
onClick: () =>
|
|
2016
|
+
hidden: f.length >= cn,
|
|
2017
|
+
onClick: () => y(n)
|
|
1947
2018
|
}, {
|
|
1948
2019
|
icon: "trash",
|
|
1949
2020
|
label: "Delete form",
|
|
1950
|
-
hidden:
|
|
1951
|
-
onClick: () =>
|
|
2021
|
+
hidden: f.length <= d,
|
|
2022
|
+
onClick: () => ne(n)
|
|
1952
2023
|
}]
|
|
1953
2024
|
};
|
|
1954
2025
|
}),
|
|
1955
|
-
onSelect: (e) =>
|
|
1956
|
-
onMove: (e, t) =>
|
|
2026
|
+
onSelect: (e) => _(f.length - 1 - e),
|
|
2027
|
+
onMove: (e, t) => re(f.length - 1 - e, f.length - 1 - t)
|
|
1957
2028
|
}),
|
|
1958
|
-
|
|
2029
|
+
f.length < cn && /* @__PURE__ */ K(B, {
|
|
1959
2030
|
tone: "primary",
|
|
1960
2031
|
size: t,
|
|
1961
2032
|
className: "w-full",
|
|
1962
2033
|
iconLeft: "plus",
|
|
1963
2034
|
iconSize: 12,
|
|
1964
|
-
onClick:
|
|
2035
|
+
onClick: te,
|
|
1965
2036
|
children: "Add form"
|
|
1966
2037
|
}),
|
|
1967
|
-
!
|
|
2038
|
+
!a && /* @__PURE__ */ K(W, {
|
|
1968
2039
|
label: "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
1969
2040
|
children: /* @__PURE__ */ K(B, {
|
|
1970
2041
|
"aria-label": "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
@@ -1973,12 +2044,12 @@ function sn({ layer: e }) {
|
|
|
1973
2044
|
className: "w-full",
|
|
1974
2045
|
onClick: () => window.dispatchEvent(new CustomEvent("kol:softform-edit", { detail: {
|
|
1975
2046
|
id: e.id,
|
|
1976
|
-
index: Math.max(0,
|
|
2047
|
+
index: Math.max(0, p)
|
|
1977
2048
|
} })),
|
|
1978
2049
|
children: "Edit forms on canvas"
|
|
1979
2050
|
})
|
|
1980
2051
|
}),
|
|
1981
|
-
|
|
2052
|
+
h && /* @__PURE__ */ q("div", {
|
|
1982
2053
|
className: "flex flex-col gap-2 pt-1",
|
|
1983
2054
|
children: [
|
|
1984
2055
|
/* @__PURE__ */ K("span", {
|
|
@@ -1991,19 +2062,19 @@ function sn({ layer: e }) {
|
|
|
1991
2062
|
variant: "subtle",
|
|
1992
2063
|
size: t,
|
|
1993
2064
|
className: "w-full",
|
|
1994
|
-
options:
|
|
1995
|
-
value:
|
|
1996
|
-
onChange: (e) =>
|
|
2065
|
+
options: l,
|
|
2066
|
+
value: h.t,
|
|
2067
|
+
onChange: (e) => v(f.map((t, n) => n === p ? {
|
|
1997
2068
|
...t,
|
|
1998
2069
|
t: e
|
|
1999
2070
|
} : t))
|
|
2000
2071
|
})
|
|
2001
2072
|
}),
|
|
2002
|
-
|
|
2003
|
-
let t =
|
|
2073
|
+
u.map((e) => {
|
|
2074
|
+
let t = h[e.k] ?? (e.fallback ? h[e.fallback] : void 0), n = typeof t == "number" ? t : e.def;
|
|
2004
2075
|
return /* @__PURE__ */ K(H, {
|
|
2005
2076
|
label: e.label,
|
|
2006
|
-
children: /* @__PURE__ */ K(
|
|
2077
|
+
children: /* @__PURE__ */ K(qe, {
|
|
2007
2078
|
min: e.min,
|
|
2008
2079
|
max: e.max,
|
|
2009
2080
|
step: e.step,
|
|
@@ -2025,8 +2096,8 @@ function sn({ layer: e }) {
|
|
|
2025
2096
|
tone: "primary",
|
|
2026
2097
|
size: t,
|
|
2027
2098
|
onClick: () => {
|
|
2028
|
-
let e =
|
|
2029
|
-
|
|
2099
|
+
let e = g(b());
|
|
2100
|
+
v(f.map((t) => ({
|
|
2030
2101
|
...t,
|
|
2031
2102
|
hue: X(e())
|
|
2032
2103
|
})));
|
|
@@ -2037,8 +2108,8 @@ function sn({ layer: e }) {
|
|
|
2037
2108
|
tone: "primary",
|
|
2038
2109
|
size: t,
|
|
2039
2110
|
onClick: () => {
|
|
2040
|
-
let e =
|
|
2041
|
-
|
|
2111
|
+
let e = g(b());
|
|
2112
|
+
v(f.map((t) => a ? {
|
|
2042
2113
|
...t,
|
|
2043
2114
|
x: X(Z(e, -.7, .7)),
|
|
2044
2115
|
y: X(Z(e, -.7, .7)),
|
|
@@ -2057,10 +2128,10 @@ function sn({ layer: e }) {
|
|
|
2057
2128
|
tone: "primary",
|
|
2058
2129
|
size: t,
|
|
2059
2130
|
onClick: () => {
|
|
2060
|
-
let e =
|
|
2061
|
-
|
|
2131
|
+
let e = g(b());
|
|
2132
|
+
v(f.map((t) => {
|
|
2062
2133
|
let n = X(Z(e, .35, .95)), r = X(Z(e, .35, .95));
|
|
2063
|
-
return
|
|
2134
|
+
return a ? {
|
|
2064
2135
|
...t,
|
|
2065
2136
|
sx: n,
|
|
2066
2137
|
sy: r,
|
|
@@ -2078,8 +2149,8 @@ function sn({ layer: e }) {
|
|
|
2078
2149
|
tone: "primary",
|
|
2079
2150
|
size: t,
|
|
2080
2151
|
onClick: () => {
|
|
2081
|
-
let t =
|
|
2082
|
-
|
|
2152
|
+
let t = g(b());
|
|
2153
|
+
r(e.id, {
|
|
2083
2154
|
motion: X(Z(t, 0, 1.1)),
|
|
2084
2155
|
sweep: Math.round(Z(t, 0, 360))
|
|
2085
2156
|
});
|
|
@@ -2093,12 +2164,12 @@ function sn({ layer: e }) {
|
|
|
2093
2164
|
size: t,
|
|
2094
2165
|
className: "w-full",
|
|
2095
2166
|
onClick: () => {
|
|
2096
|
-
let e =
|
|
2097
|
-
if (
|
|
2098
|
-
if (
|
|
2167
|
+
let e = g(b());
|
|
2168
|
+
if (a) {
|
|
2169
|
+
if (o) {
|
|
2099
2170
|
let t = 2 + Math.floor(e() * 4), n = Z(e, .45, .9);
|
|
2100
|
-
|
|
2101
|
-
let [a, o, s] =
|
|
2171
|
+
v(_n(Array.from({ length: t }, (r, i) => {
|
|
2172
|
+
let [a, o, s] = hn(e, n), c = X(Z(e, .5, .92));
|
|
2102
2173
|
return {
|
|
2103
2174
|
t: "sphere",
|
|
2104
2175
|
x: X(a),
|
|
@@ -2113,8 +2184,8 @@ function sn({ layer: e }) {
|
|
|
2113
2184
|
})));
|
|
2114
2185
|
} else {
|
|
2115
2186
|
let t = Z(e, .6, 1.15);
|
|
2116
|
-
|
|
2117
|
-
let [r, i, a] =
|
|
2187
|
+
v(_n(f.map((n) => {
|
|
2188
|
+
let [r, i, a] = hn(e, t);
|
|
2118
2189
|
return {
|
|
2119
2190
|
...n,
|
|
2120
2191
|
x: X(r),
|
|
@@ -2127,10 +2198,10 @@ function sn({ layer: e }) {
|
|
|
2127
2198
|
return;
|
|
2128
2199
|
}
|
|
2129
2200
|
let t = 2 + Math.floor(e() * 4), n = Z(e, .45, .85);
|
|
2130
|
-
|
|
2131
|
-
let [a, o] =
|
|
2201
|
+
v(gn(Array.from({ length: t }, (r, i) => {
|
|
2202
|
+
let [a, o] = mn(e, n);
|
|
2132
2203
|
return {
|
|
2133
|
-
t:
|
|
2204
|
+
t: ln[Math.floor(e() * ln.length)].value,
|
|
2134
2205
|
x: X(a),
|
|
2135
2206
|
y: X(o),
|
|
2136
2207
|
sx: X(Z(e, .4, .85)),
|
|
@@ -2147,7 +2218,7 @@ function sn({ layer: e }) {
|
|
|
2147
2218
|
}
|
|
2148
2219
|
//#endregion
|
|
2149
2220
|
//#region src/editor/compose/inspectors/PenroseLayers.jsx
|
|
2150
|
-
var
|
|
2221
|
+
var bn = [
|
|
2151
2222
|
{
|
|
2152
2223
|
role: "fg",
|
|
2153
2224
|
label: "Foreground"
|
|
@@ -2164,31 +2235,31 @@ var cn = [
|
|
|
2164
2235
|
role: "warm",
|
|
2165
2236
|
label: "Warm"
|
|
2166
2237
|
}
|
|
2167
|
-
],
|
|
2238
|
+
], xn = {
|
|
2168
2239
|
fg: 1,
|
|
2169
2240
|
accent: 1,
|
|
2170
2241
|
dim: 5,
|
|
2171
2242
|
warm: 1
|
|
2172
2243
|
};
|
|
2173
|
-
function
|
|
2174
|
-
let r =
|
|
2175
|
-
|
|
2176
|
-
let i =
|
|
2244
|
+
function Sn({ layer: e, setProp: t, patch: n }) {
|
|
2245
|
+
let r = c();
|
|
2246
|
+
_e();
|
|
2247
|
+
let i = O(e.loopId), a = bn.filter((e) => i?.has(e.role));
|
|
2177
2248
|
if (!a.length) return null;
|
|
2178
|
-
let
|
|
2249
|
+
let o = e._layerPrev ?? {};
|
|
2179
2250
|
return /* @__PURE__ */ K(U, {
|
|
2180
2251
|
label: "Layers",
|
|
2181
2252
|
divided: !0,
|
|
2182
|
-
children: /* @__PURE__ */ K(
|
|
2253
|
+
children: /* @__PURE__ */ K(Je, {
|
|
2183
2254
|
size: r,
|
|
2184
2255
|
items: a.map(({ role: n, label: r }) => {
|
|
2185
|
-
let i = `${n}Opacity`, a = Number(e[i] ??
|
|
2256
|
+
let i = `${n}Opacity`, a = Number(e[i] ?? xn[n]);
|
|
2186
2257
|
return {
|
|
2187
2258
|
id: n,
|
|
2188
2259
|
label: r,
|
|
2189
2260
|
swatch: e[n] ?? null,
|
|
2190
2261
|
shown: a > 0,
|
|
2191
|
-
control: /* @__PURE__ */ K(
|
|
2262
|
+
control: /* @__PURE__ */ K(qe, {
|
|
2192
2263
|
min: 0,
|
|
2193
2264
|
max: 5,
|
|
2194
2265
|
step: .1,
|
|
@@ -2203,21 +2274,21 @@ function un({ layer: e, setProp: t, patch: n }) {
|
|
|
2203
2274
|
};
|
|
2204
2275
|
}),
|
|
2205
2276
|
onToggleShown: (t) => {
|
|
2206
|
-
let { role: r } = a[t], i = `${r}Opacity`,
|
|
2207
|
-
n(
|
|
2277
|
+
let { role: r } = a[t], i = `${r}Opacity`, s = Number(e[i] ?? xn[r]);
|
|
2278
|
+
n(s > 0 ? {
|
|
2208
2279
|
[i]: 0,
|
|
2209
2280
|
_layerPrev: {
|
|
2210
|
-
...
|
|
2211
|
-
[r]:
|
|
2281
|
+
...o,
|
|
2282
|
+
[r]: s
|
|
2212
2283
|
}
|
|
2213
|
-
} : { [i]:
|
|
2284
|
+
} : { [i]: o[r] || xn[r] });
|
|
2214
2285
|
}
|
|
2215
2286
|
})
|
|
2216
2287
|
});
|
|
2217
2288
|
}
|
|
2218
2289
|
//#endregion
|
|
2219
2290
|
//#region src/loops/about.js
|
|
2220
|
-
var
|
|
2291
|
+
var Cn = {
|
|
2221
2292
|
"morph-circle": "Shape interpolation — a circle eased into polygons, point by point",
|
|
2222
2293
|
"square-circle": "Superellipse morph between a square and a circle",
|
|
2223
2294
|
"star-morph": "Star polygon whose inner radius and point count are tweened",
|
|
@@ -2355,34 +2426,34 @@ var dn = {
|
|
|
2355
2426
|
"filter-outline": "Outline around shapes",
|
|
2356
2427
|
"filter-reflection": "Water reflection with waves",
|
|
2357
2428
|
"filter-convolution": "Custom 3×3 convolution kernel"
|
|
2358
|
-
},
|
|
2429
|
+
}, wn = new Set([
|
|
2359
2430
|
"drift",
|
|
2360
2431
|
"iridescent",
|
|
2361
2432
|
"softforms",
|
|
2362
2433
|
"mesh"
|
|
2363
|
-
]),
|
|
2434
|
+
]), Tn = new Set([
|
|
2364
2435
|
"scene",
|
|
2365
2436
|
"forms",
|
|
2366
2437
|
"environment",
|
|
2367
2438
|
"ribbon"
|
|
2368
2439
|
]);
|
|
2369
|
-
function
|
|
2370
|
-
return t ? e.pixi || /^filter-/.test(e.id) ? "WebGL shader (PixiJS)" : e.kind === "engine" || /^gl-/.test(e.id) ? "WebGL shader" : "canvas 2D" : e.group === "field" && e.id !== "halftone" || e.id === "optic-moire" ? "WebGL shader" :
|
|
2440
|
+
function En(e, t = !1) {
|
|
2441
|
+
return t ? e.pixi || /^filter-/.test(e.id) ? "WebGL shader (PixiJS)" : e.kind === "engine" || /^gl-/.test(e.id) ? "WebGL shader" : "canvas 2D" : e.group === "field" && e.id !== "halftone" || e.id === "optic-moire" ? "WebGL shader" : Tn.has(e.engine) ? "three.js" : e.engine === "softforms3d" ? "WebGL shader (ray-marched)" : wn.has(e.engine) ? "WebGL shader" : "canvas 2D";
|
|
2371
2442
|
}
|
|
2372
|
-
function
|
|
2443
|
+
function Dn(e, t = !1) {
|
|
2373
2444
|
if (!e) return null;
|
|
2374
2445
|
let n = e.about ?? {};
|
|
2375
2446
|
return {
|
|
2376
2447
|
kind: n.kind ?? (t ? "effect" : "generative"),
|
|
2377
|
-
basis: n.basis ??
|
|
2378
|
-
engine: n.engine ??
|
|
2448
|
+
basis: n.basis ?? Cn[e.id] ?? null,
|
|
2449
|
+
engine: n.engine ?? En(e, t),
|
|
2379
2450
|
dimension: n.dimension ?? (e.is3D ? "3D" : "2D")
|
|
2380
2451
|
};
|
|
2381
2452
|
}
|
|
2382
2453
|
//#endregion
|
|
2383
2454
|
//#region src/editor/compose/inspectors/AboutLine.jsx
|
|
2384
|
-
function
|
|
2385
|
-
let n =
|
|
2455
|
+
function On({ def: e, isFilter: t = !1 }) {
|
|
2456
|
+
let n = et(), r = c(), i = Dn(e, t);
|
|
2386
2457
|
return i ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(B, {
|
|
2387
2458
|
size: r,
|
|
2388
2459
|
iconOnly: "info",
|
|
@@ -2409,12 +2480,12 @@ function gn({ def: e, isFilter: t = !1 }) {
|
|
|
2409
2480
|
}
|
|
2410
2481
|
//#endregion
|
|
2411
2482
|
//#region src/loops/theme.js
|
|
2412
|
-
function
|
|
2413
|
-
return
|
|
2483
|
+
function kn(n, r, i, a) {
|
|
2484
|
+
return se(n, r, t(e(i, a)));
|
|
2414
2485
|
}
|
|
2415
2486
|
//#endregion
|
|
2416
2487
|
//#region src/editor/compose/inspectors/LoopFields.jsx
|
|
2417
|
-
var
|
|
2488
|
+
var An = rt.flatMap((e) => e.groups), jn = (e, t) => {
|
|
2418
2489
|
let n = e.map((e) => ({
|
|
2419
2490
|
value: e.id,
|
|
2420
2491
|
label: e.label
|
|
@@ -2424,73 +2495,73 @@ var vn = Me.flatMap((e) => e.groups), yn = (e, t) => {
|
|
|
2424
2495
|
label: "Custom"
|
|
2425
2496
|
}, ...n] : n;
|
|
2426
2497
|
};
|
|
2427
|
-
function Q({ inline: e, label: t, align:
|
|
2428
|
-
return e ? /* @__PURE__ */ K(
|
|
2498
|
+
function Q({ inline: e, label: t, align: n = "fill", children: r }) {
|
|
2499
|
+
return e ? /* @__PURE__ */ K(Ge, {
|
|
2429
2500
|
label: t,
|
|
2430
|
-
align:
|
|
2431
|
-
labelWidth:
|
|
2432
|
-
children:
|
|
2501
|
+
align: n,
|
|
2502
|
+
labelWidth: a,
|
|
2503
|
+
children: r
|
|
2433
2504
|
}) : /* @__PURE__ */ K(H, {
|
|
2434
2505
|
label: t,
|
|
2435
|
-
children:
|
|
2506
|
+
children: r
|
|
2436
2507
|
});
|
|
2437
2508
|
}
|
|
2438
|
-
var
|
|
2509
|
+
var Mn = [{
|
|
2439
2510
|
value: "off",
|
|
2440
2511
|
label: "Off"
|
|
2441
2512
|
}, {
|
|
2442
2513
|
value: "on",
|
|
2443
2514
|
label: "On"
|
|
2444
2515
|
}];
|
|
2445
|
-
function $({ inline: e, cs: t, on: n, onChange:
|
|
2446
|
-
return e ? /* @__PURE__ */ K(
|
|
2516
|
+
function $({ inline: e, cs: t, on: n, onChange: r }) {
|
|
2517
|
+
return e ? /* @__PURE__ */ K(We, {
|
|
2447
2518
|
tone: "sunken",
|
|
2448
2519
|
size: t,
|
|
2449
|
-
className: `w-full ${
|
|
2450
|
-
options:
|
|
2520
|
+
className: `w-full ${o(t) ?? ""}`,
|
|
2521
|
+
options: Mn,
|
|
2451
2522
|
value: n ? "on" : "off",
|
|
2452
|
-
onChange: (e) =>
|
|
2453
|
-
}) : /* @__PURE__ */ K(
|
|
2523
|
+
onChange: (e) => r(e === "on")
|
|
2524
|
+
}) : /* @__PURE__ */ K(Xe, {
|
|
2454
2525
|
size: t,
|
|
2455
|
-
options:
|
|
2526
|
+
options: Mn,
|
|
2456
2527
|
viewMode: n ? "on" : "off",
|
|
2457
|
-
onViewChange: (e) =>
|
|
2528
|
+
onViewChange: (e) => r(e === "on")
|
|
2458
2529
|
});
|
|
2459
2530
|
}
|
|
2460
|
-
function
|
|
2461
|
-
let
|
|
2462
|
-
|
|
2463
|
-
},
|
|
2531
|
+
function Nn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, renderAnimate: a, tab: o, tabStrip: s, tree: l, picker: m = !0, inline: _ = !1, showSeed: v = !_, onReset: ee }) {
|
|
2532
|
+
let x = c(), S = L(e.loopId), ce = p(), le = (S?.params ?? []).some((e) => e.key === "orbit"), ue = (e) => {
|
|
2533
|
+
I("orbit", e), e && !ce.grab && oe("grab", !0);
|
|
2534
|
+
}, w = S?.params ?? [], fe = e.themeId ?? "kol", E = !!e.themeInvert, D = (t) => r(e.id, {
|
|
2464
2535
|
themeId: t,
|
|
2465
|
-
...
|
|
2466
|
-
}),
|
|
2536
|
+
...kn(e, S?.params, t, E)
|
|
2537
|
+
}), pe = (t) => r(e.id, {
|
|
2467
2538
|
themeInvert: t,
|
|
2468
|
-
...
|
|
2469
|
-
}),
|
|
2470
|
-
let i =
|
|
2539
|
+
...kn(e, S?.params, fe, t)
|
|
2540
|
+
}), ge = e._paletteRelation ?? "analogous", O = (S?.params ?? []).filter((e) => e.type === "color"), k = new Set(e._rollKeep ?? []), _e = (t = ge, n = {}) => {
|
|
2541
|
+
let i = d(g(b()), t), a = se(e, S?.params, i, { rotate: !0 });
|
|
2471
2542
|
r(e.id, {
|
|
2472
2543
|
...n,
|
|
2473
|
-
...Object.fromEntries(
|
|
2544
|
+
...Object.fromEntries(O.filter((e) => !k.has(e.key)).map((e) => [e.key, a[e.key]]))
|
|
2474
2545
|
});
|
|
2475
|
-
},
|
|
2546
|
+
}, ve = (e) => t("_rollKeep", k.has(e) ? [...k].filter((t) => t !== e) : [...k, e]), A = zt(e.loopId), ye = A ? Object.keys(A).map((e) => ({
|
|
2476
2547
|
id: e,
|
|
2477
2548
|
label: e
|
|
2478
|
-
})) : null,
|
|
2479
|
-
let a =
|
|
2549
|
+
})) : null, j = A ? new Set(Object.values(A).flatMap((e) => Object.keys(e))) : null, M = h(e), N = ae(re(w, e), y(w, e)), P = It(e.loopId, e), [xe, Se] = nt(!1), Ce = (t, n, i) => {
|
|
2550
|
+
let a = f(e, t, M.take(), {
|
|
2480
2551
|
stripNoRandom: !!n?.motion,
|
|
2481
2552
|
...i
|
|
2482
2553
|
});
|
|
2483
|
-
P && n?.motion && (n.id !== "Form" && (a._framePreset = "custom"), n.id !== "Frame" && (a._formPreset = "custom")),
|
|
2484
|
-
},
|
|
2485
|
-
let n =
|
|
2554
|
+
P && n?.motion && (n.id !== "Form" && (a._framePreset = "custom"), n.id !== "Frame" && (a._formPreset = "custom")), j && Object.keys(a).some((e) => j.has(e)) && (a._lookPreset = "custom"), r(e.id, a);
|
|
2555
|
+
}, F = (t) => {
|
|
2556
|
+
let n = T(e.loopGroup).find((t) => t.id === e.presetId)?.params ?? {}, i = {};
|
|
2486
2557
|
for (let e of t) {
|
|
2487
2558
|
let t = n[e.key] === void 0 ? e.default : n[e.key];
|
|
2488
2559
|
t !== void 0 && (i[e.key] = t);
|
|
2489
2560
|
}
|
|
2490
2561
|
r(e.id, i);
|
|
2491
|
-
},
|
|
2562
|
+
}, we = P ? Lt(P.frame) : null, Te = P ? Lt(P.form) : null, I = (e, t) => {
|
|
2492
2563
|
let r = {};
|
|
2493
|
-
|
|
2564
|
+
we?.has(e) && (r._framePreset = "custom"), Te?.has(e) && (r._formPreset = "custom"), j?.has(e) && (r._lookPreset = "custom"), n({
|
|
2494
2565
|
[e]: t,
|
|
2495
2566
|
...r
|
|
2496
2567
|
});
|
|
@@ -2500,61 +2571,61 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2500
2571
|
[e]: r,
|
|
2501
2572
|
...i?.params ?? {}
|
|
2502
2573
|
});
|
|
2503
|
-
},
|
|
2574
|
+
}, De = (e) => n({
|
|
2504
2575
|
_lookPreset: e,
|
|
2505
|
-
...
|
|
2506
|
-
}),
|
|
2576
|
+
...A?.[e] ?? {}
|
|
2577
|
+
}), Oe = S?.camera ? S.camera.map((e) => ({
|
|
2507
2578
|
...e,
|
|
2508
2579
|
section: "Camera"
|
|
2509
|
-
})) : null,
|
|
2580
|
+
})) : null, R = [...S?.camera ?? [], ...w.filter((e) => ne(e) === "Camera")], z = S?.kind === "engine", ke = R.length > 0 || z && S?.orbit, je = S?.engine === "scene" && (e.animMode === "keyframes" || e.animMode === "keyframe"), Me = S?.orbit ? {
|
|
2510
2581
|
yaw: 1,
|
|
2511
2582
|
dist: 1
|
|
2512
|
-
} :
|
|
2513
|
-
className: `kol-mono-10 text-meta${
|
|
2514
|
-
children: S?.orbit ? "Press C, then drag to orbit the camera and scroll to zoom." :
|
|
2583
|
+
} : de(S), Pe = Me ? /* @__PURE__ */ K("p", {
|
|
2584
|
+
className: `kol-mono-10 text-meta${_ ? "" : " col-span-2"}`,
|
|
2585
|
+
children: S?.orbit ? "Press C, then drag to orbit the camera and scroll to zoom." : Me.yaw ? "Press C, then drag to rotate and scroll to zoom." : "Press C, then scroll to zoom."
|
|
2515
2586
|
}) : null;
|
|
2516
2587
|
return /* @__PURE__ */ q(G, { children: [
|
|
2517
|
-
|
|
2518
|
-
m && (
|
|
2588
|
+
s,
|
|
2589
|
+
m && (_ ? o === "generate" && /* @__PURE__ */ K(U, {
|
|
2519
2590
|
divided: !0,
|
|
2520
|
-
children: /* @__PURE__ */ K(
|
|
2591
|
+
children: /* @__PURE__ */ K(xt, {
|
|
2521
2592
|
layer: e,
|
|
2522
2593
|
tree: l,
|
|
2523
2594
|
inline: !0,
|
|
2524
|
-
about: /* @__PURE__ */ K(
|
|
2595
|
+
about: /* @__PURE__ */ K(On, { def: S })
|
|
2525
2596
|
})
|
|
2526
|
-
}) : /* @__PURE__ */ K(
|
|
2597
|
+
}) : /* @__PURE__ */ K(xt, {
|
|
2527
2598
|
layer: e,
|
|
2528
2599
|
tree: l,
|
|
2529
|
-
about: /* @__PURE__ */ K(
|
|
2600
|
+
about: /* @__PURE__ */ K(On, { def: S })
|
|
2530
2601
|
})),
|
|
2531
|
-
(
|
|
2532
|
-
(e.loopId === "softforms" || e.loopId === "softforms3d") && /* @__PURE__ */ K(
|
|
2533
|
-
|
|
2534
|
-
inline:
|
|
2602
|
+
(o === "generate" || o === "labs-effect") && /* @__PURE__ */ q(G, { children: [
|
|
2603
|
+
(e.loopId === "softforms" || e.loopId === "softforms3d") && /* @__PURE__ */ K(yn, { layer: e }),
|
|
2604
|
+
A && !_ && /* @__PURE__ */ K(Q, {
|
|
2605
|
+
inline: _,
|
|
2535
2606
|
label: "Look",
|
|
2536
2607
|
children: /* @__PURE__ */ K(V, {
|
|
2537
2608
|
variant: "subtle",
|
|
2538
|
-
size:
|
|
2609
|
+
size: x,
|
|
2539
2610
|
className: "w-full",
|
|
2540
|
-
options:
|
|
2611
|
+
options: jn(ye, e._lookPreset),
|
|
2541
2612
|
value: e._lookPreset ?? "custom",
|
|
2542
|
-
onChange:
|
|
2613
|
+
onChange: De
|
|
2543
2614
|
})
|
|
2544
2615
|
}),
|
|
2545
|
-
|
|
2616
|
+
_ && /* @__PURE__ */ q(U, {
|
|
2546
2617
|
divided: !0,
|
|
2547
2618
|
children: [
|
|
2548
|
-
|
|
2619
|
+
A && /* @__PURE__ */ K(Q, {
|
|
2549
2620
|
inline: !0,
|
|
2550
2621
|
label: "Look",
|
|
2551
2622
|
children: /* @__PURE__ */ K(V, {
|
|
2552
2623
|
variant: "subtle",
|
|
2553
|
-
size:
|
|
2624
|
+
size: x,
|
|
2554
2625
|
className: "w-full",
|
|
2555
|
-
options:
|
|
2626
|
+
options: jn(ye, e._lookPreset),
|
|
2556
2627
|
value: e._lookPreset ?? "custom",
|
|
2557
|
-
onChange:
|
|
2628
|
+
onChange: De
|
|
2558
2629
|
})
|
|
2559
2630
|
}),
|
|
2560
2631
|
/* @__PURE__ */ K(Q, {
|
|
@@ -2562,11 +2633,11 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2562
2633
|
label: "Theme",
|
|
2563
2634
|
children: /* @__PURE__ */ K(V, {
|
|
2564
2635
|
variant: "subtle",
|
|
2565
|
-
size:
|
|
2636
|
+
size: x,
|
|
2566
2637
|
className: "w-full",
|
|
2567
|
-
options:
|
|
2568
|
-
value:
|
|
2569
|
-
onChange:
|
|
2638
|
+
options: u,
|
|
2639
|
+
value: fe,
|
|
2640
|
+
onChange: D
|
|
2570
2641
|
})
|
|
2571
2642
|
}),
|
|
2572
2643
|
/* @__PURE__ */ K(Q, {
|
|
@@ -2574,12 +2645,12 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2574
2645
|
label: "Invert",
|
|
2575
2646
|
children: /* @__PURE__ */ K($, {
|
|
2576
2647
|
inline: !0,
|
|
2577
|
-
cs:
|
|
2578
|
-
on:
|
|
2579
|
-
onChange:
|
|
2648
|
+
cs: x,
|
|
2649
|
+
on: E,
|
|
2650
|
+
onChange: pe
|
|
2580
2651
|
})
|
|
2581
2652
|
}),
|
|
2582
|
-
|
|
2653
|
+
O.length > 0 && /* @__PURE__ */ K(Q, {
|
|
2583
2654
|
inline: !0,
|
|
2584
2655
|
label: "Palette",
|
|
2585
2656
|
children: /* @__PURE__ */ q("div", {
|
|
@@ -2587,26 +2658,26 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2587
2658
|
children: [
|
|
2588
2659
|
/* @__PURE__ */ K(V, {
|
|
2589
2660
|
variant: "subtle",
|
|
2590
|
-
size:
|
|
2661
|
+
size: x,
|
|
2591
2662
|
className: "flex-1 min-w-0",
|
|
2592
2663
|
options: te.map((e) => ({
|
|
2593
2664
|
value: e.id,
|
|
2594
2665
|
label: e.label
|
|
2595
2666
|
})),
|
|
2596
|
-
value:
|
|
2597
|
-
onChange: (e) =>
|
|
2667
|
+
value: ge,
|
|
2668
|
+
onChange: (e) => _e(e, { _paletteRelation: e })
|
|
2598
2669
|
}),
|
|
2599
2670
|
/* @__PURE__ */ K(B, {
|
|
2600
2671
|
tone: "primary",
|
|
2601
|
-
size:
|
|
2602
|
-
onClick: () =>
|
|
2672
|
+
size: x,
|
|
2673
|
+
onClick: () => _e(),
|
|
2603
2674
|
children: "Roll"
|
|
2604
2675
|
}),
|
|
2605
2676
|
/* @__PURE__ */ K(W, {
|
|
2606
2677
|
label: "Edit in Color Modes",
|
|
2607
2678
|
children: /* @__PURE__ */ K(B, {
|
|
2608
2679
|
tone: "primary",
|
|
2609
|
-
size:
|
|
2680
|
+
size: x,
|
|
2610
2681
|
iconOnly: "clr-tri",
|
|
2611
2682
|
"aria-label": "Edit in Color Modes",
|
|
2612
2683
|
onClick: Ne
|
|
@@ -2615,27 +2686,27 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2615
2686
|
]
|
|
2616
2687
|
})
|
|
2617
2688
|
}),
|
|
2618
|
-
|
|
2689
|
+
O.length > 1 && /* @__PURE__ */ K(Q, {
|
|
2619
2690
|
inline: !0,
|
|
2620
2691
|
label: "Rolls",
|
|
2621
2692
|
children: /* @__PURE__ */ K("div", {
|
|
2622
2693
|
className: "flex w-full flex-wrap gap-1",
|
|
2623
|
-
children:
|
|
2624
|
-
size:
|
|
2625
|
-
tone:
|
|
2626
|
-
pressed: !
|
|
2694
|
+
children: O.map((e) => /* @__PURE__ */ K(B, {
|
|
2695
|
+
size: x,
|
|
2696
|
+
tone: k.has(e.key) ? "ghost" : "primary",
|
|
2697
|
+
pressed: !k.has(e.key),
|
|
2627
2698
|
"aria-label": `Roll ${e.label}`,
|
|
2628
|
-
onClick: () =>
|
|
2699
|
+
onClick: () => ve(e.key),
|
|
2629
2700
|
children: e.label
|
|
2630
2701
|
}, e.key))
|
|
2631
2702
|
})
|
|
2632
2703
|
}),
|
|
2633
|
-
|
|
2704
|
+
me(S) && /* @__PURE__ */ K(Q, {
|
|
2634
2705
|
inline: !0,
|
|
2635
2706
|
label: "Background",
|
|
2636
2707
|
children: /* @__PURE__ */ K($, {
|
|
2637
2708
|
inline: !0,
|
|
2638
|
-
cs:
|
|
2709
|
+
cs: x,
|
|
2639
2710
|
on: e.bgOn !== !1,
|
|
2640
2711
|
onChange: (e) => t("bgOn", e)
|
|
2641
2712
|
})
|
|
@@ -2643,7 +2714,7 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2643
2714
|
Pe
|
|
2644
2715
|
]
|
|
2645
2716
|
}),
|
|
2646
|
-
!
|
|
2717
|
+
!_ && /* @__PURE__ */ q("div", {
|
|
2647
2718
|
className: "grid grid-cols-2 gap-2",
|
|
2648
2719
|
children: [
|
|
2649
2720
|
/* @__PURE__ */ K(Q, {
|
|
@@ -2651,11 +2722,11 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2651
2722
|
label: "Theme",
|
|
2652
2723
|
children: /* @__PURE__ */ K(V, {
|
|
2653
2724
|
variant: "subtle",
|
|
2654
|
-
size:
|
|
2725
|
+
size: x,
|
|
2655
2726
|
className: "w-full",
|
|
2656
|
-
options:
|
|
2657
|
-
value:
|
|
2658
|
-
onChange:
|
|
2727
|
+
options: u,
|
|
2728
|
+
value: fe,
|
|
2729
|
+
onChange: D
|
|
2659
2730
|
})
|
|
2660
2731
|
}),
|
|
2661
2732
|
/* @__PURE__ */ K(Q, {
|
|
@@ -2663,17 +2734,17 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2663
2734
|
label: "Invert",
|
|
2664
2735
|
children: /* @__PURE__ */ K($, {
|
|
2665
2736
|
inline: !1,
|
|
2666
|
-
cs:
|
|
2667
|
-
on:
|
|
2668
|
-
onChange:
|
|
2737
|
+
cs: x,
|
|
2738
|
+
on: E,
|
|
2739
|
+
onChange: pe
|
|
2669
2740
|
})
|
|
2670
2741
|
}),
|
|
2671
|
-
|
|
2742
|
+
me(S) && /* @__PURE__ */ K(Q, {
|
|
2672
2743
|
inline: !1,
|
|
2673
2744
|
label: "Background",
|
|
2674
2745
|
children: /* @__PURE__ */ K($, {
|
|
2675
2746
|
inline: !1,
|
|
2676
|
-
cs:
|
|
2747
|
+
cs: x,
|
|
2677
2748
|
on: e.bgOn !== !1,
|
|
2678
2749
|
onChange: (e) => t("bgOn", e)
|
|
2679
2750
|
})
|
|
@@ -2681,16 +2752,16 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2681
2752
|
Pe
|
|
2682
2753
|
]
|
|
2683
2754
|
}),
|
|
2684
|
-
/* @__PURE__ */ K(
|
|
2685
|
-
schema:
|
|
2755
|
+
/* @__PURE__ */ K(C, {
|
|
2756
|
+
schema: w,
|
|
2686
2757
|
layer: e,
|
|
2687
|
-
setProp:
|
|
2758
|
+
setProp: I,
|
|
2688
2759
|
palette: i,
|
|
2689
2760
|
renderAnimate: a,
|
|
2690
2761
|
tab: "generate",
|
|
2691
|
-
inline:
|
|
2762
|
+
inline: _
|
|
2692
2763
|
}),
|
|
2693
|
-
|
|
2764
|
+
_ && /* @__PURE__ */ K(Ve, {}),
|
|
2694
2765
|
/* @__PURE__ */ q("div", {
|
|
2695
2766
|
className: "flex gap-2",
|
|
2696
2767
|
children: [
|
|
@@ -2698,13 +2769,13 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2698
2769
|
["type", "Type"],
|
|
2699
2770
|
["category", "Category"],
|
|
2700
2771
|
["preset", "Preset"]
|
|
2701
|
-
].filter(([t]) =>
|
|
2772
|
+
].filter(([t]) => pt(e, t, An)).map(([t, n]) => /* @__PURE__ */ K(B, {
|
|
2702
2773
|
tone: "primary",
|
|
2703
|
-
size:
|
|
2774
|
+
size: x,
|
|
2704
2775
|
className: "flex-1 min-w-0",
|
|
2705
2776
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
2706
2777
|
onClick: () => {
|
|
2707
|
-
let n =
|
|
2778
|
+
let n = M.take(), i = mt(e, t, g(n >>> 0), An);
|
|
2708
2779
|
i && r(e.id, {
|
|
2709
2780
|
...i,
|
|
2710
2781
|
_rollSeed: n
|
|
@@ -2714,14 +2785,14 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2714
2785
|
}, t)),
|
|
2715
2786
|
/* @__PURE__ */ K(B, {
|
|
2716
2787
|
tone: "primary",
|
|
2717
|
-
size:
|
|
2788
|
+
size: x,
|
|
2718
2789
|
className: "flex-1 min-w-0",
|
|
2719
2790
|
"aria-label": "Randomize settings",
|
|
2720
2791
|
onClick: (t) => {
|
|
2721
|
-
if (t.altKey) return
|
|
2722
|
-
let n =
|
|
2792
|
+
if (t.altKey) return F(y(w, e));
|
|
2793
|
+
let n = M.take();
|
|
2723
2794
|
r(e.id, {
|
|
2724
|
-
...
|
|
2795
|
+
...ht(e, y(w, e), g(n >>> 0)),
|
|
2725
2796
|
_rollSeed: n
|
|
2726
2797
|
});
|
|
2727
2798
|
},
|
|
@@ -2729,10 +2800,10 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2729
2800
|
}),
|
|
2730
2801
|
/* @__PURE__ */ K(B, {
|
|
2731
2802
|
tone: "primary",
|
|
2732
|
-
size:
|
|
2803
|
+
size: x,
|
|
2733
2804
|
iconOnly: "nav-settings",
|
|
2734
2805
|
"aria-label": "What Settings rolls",
|
|
2735
|
-
onClick: () =>
|
|
2806
|
+
onClick: () => Se(!0),
|
|
2736
2807
|
className: "shrink-0"
|
|
2737
2808
|
}),
|
|
2738
2809
|
/* @__PURE__ */ K(W, {
|
|
@@ -2740,73 +2811,73 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2740
2811
|
shortcut: "R",
|
|
2741
2812
|
children: /* @__PURE__ */ K(B, {
|
|
2742
2813
|
tone: "primary",
|
|
2743
|
-
size:
|
|
2814
|
+
size: x,
|
|
2744
2815
|
iconOnly: "refresh",
|
|
2745
2816
|
"aria-label": "Reset to defaults",
|
|
2746
|
-
onClick:
|
|
2817
|
+
onClick: ee ?? (() => F(y(w, e))),
|
|
2747
2818
|
className: "shrink-0"
|
|
2748
2819
|
})
|
|
2749
2820
|
})
|
|
2750
2821
|
]
|
|
2751
2822
|
}),
|
|
2752
|
-
/* @__PURE__ */ K(
|
|
2753
|
-
open:
|
|
2754
|
-
onClose: () =>
|
|
2755
|
-
schema:
|
|
2823
|
+
/* @__PURE__ */ K(St, {
|
|
2824
|
+
open: xe,
|
|
2825
|
+
onClose: () => Se(!1),
|
|
2826
|
+
schema: w,
|
|
2756
2827
|
layer: e,
|
|
2757
|
-
size:
|
|
2828
|
+
size: x
|
|
2758
2829
|
}),
|
|
2759
2830
|
N.length > 0 && /* @__PURE__ */ q("div", {
|
|
2760
|
-
className: `grid ${
|
|
2831
|
+
className: `grid ${_ ? "grid-cols-3" : "grid-cols-2"} gap-2`,
|
|
2761
2832
|
children: [N.map((e) => /* @__PURE__ */ K(B, {
|
|
2762
2833
|
tone: "primary",
|
|
2763
|
-
size:
|
|
2764
|
-
onClick: (t) => t.altKey ?
|
|
2834
|
+
size: x,
|
|
2835
|
+
onClick: (t) => t.altKey ? F(e.params) : Ce(e.params, e),
|
|
2765
2836
|
children: e.label
|
|
2766
2837
|
}, e.id)), e.loopId === "math-expression" && /* @__PURE__ */ K(B, {
|
|
2767
2838
|
tone: "primary",
|
|
2768
|
-
size:
|
|
2839
|
+
size: x,
|
|
2769
2840
|
onClick: (t) => {
|
|
2770
|
-
if (t.altKey) return
|
|
2771
|
-
let n =
|
|
2841
|
+
if (t.altKey) return F(N.find((e) => e.id === "Expression")?.params ?? []);
|
|
2842
|
+
let n = M.take();
|
|
2772
2843
|
r(e.id, {
|
|
2773
|
-
expr:
|
|
2844
|
+
expr: be(g(n >>> 0)),
|
|
2774
2845
|
_rollSeed: n
|
|
2775
2846
|
});
|
|
2776
2847
|
},
|
|
2777
2848
|
children: "Wild"
|
|
2778
2849
|
})]
|
|
2779
2850
|
}),
|
|
2780
|
-
|
|
2781
|
-
seed:
|
|
2782
|
-
inline:
|
|
2851
|
+
v && y(w, e).length >= 5 && /* @__PURE__ */ K(ie, {
|
|
2852
|
+
seed: M,
|
|
2853
|
+
inline: _
|
|
2783
2854
|
}),
|
|
2784
|
-
e.loopId === "pattern-rules" && (e.render ?? "tiles") === "tiles" && /* @__PURE__ */ K(
|
|
2855
|
+
e.loopId === "pattern-rules" && (e.render ?? "tiles") === "tiles" && /* @__PURE__ */ K(Qt, {
|
|
2785
2856
|
layer: e,
|
|
2786
2857
|
patch: n,
|
|
2787
|
-
seed:
|
|
2858
|
+
seed: M
|
|
2788
2859
|
})
|
|
2789
2860
|
] }),
|
|
2790
|
-
(
|
|
2791
|
-
/* @__PURE__ */ K(
|
|
2792
|
-
schema:
|
|
2861
|
+
(o === "style" || o === "labs-effect") && /* @__PURE__ */ q(G, { children: [
|
|
2862
|
+
/* @__PURE__ */ K(C, {
|
|
2863
|
+
schema: w,
|
|
2793
2864
|
layer: e,
|
|
2794
|
-
setProp:
|
|
2865
|
+
setProp: I,
|
|
2795
2866
|
palette: i,
|
|
2796
2867
|
renderAnimate: a,
|
|
2797
2868
|
tab: "style",
|
|
2798
|
-
inline:
|
|
2869
|
+
inline: _
|
|
2799
2870
|
}),
|
|
2800
|
-
S?.group === "penrose" && e.loopId?.startsWith("penrose-") && /* @__PURE__ */ K(
|
|
2871
|
+
S?.group === "penrose" && e.loopId?.startsWith("penrose-") && /* @__PURE__ */ K(Sn, {
|
|
2801
2872
|
layer: e,
|
|
2802
|
-
setProp:
|
|
2873
|
+
setProp: I,
|
|
2803
2874
|
patch: n
|
|
2804
2875
|
}),
|
|
2805
|
-
e.loopId === "pattern-rules" && /* @__PURE__ */ K(
|
|
2876
|
+
e.loopId === "pattern-rules" && /* @__PURE__ */ K(nn, {
|
|
2806
2877
|
layer: e,
|
|
2807
2878
|
patch: n
|
|
2808
2879
|
}),
|
|
2809
|
-
e.loopId === "math-curves" && /* @__PURE__ */ K(
|
|
2880
|
+
e.loopId === "math-curves" && /* @__PURE__ */ K(rn, {
|
|
2810
2881
|
layer: e,
|
|
2811
2882
|
patch: n
|
|
2812
2883
|
}),
|
|
@@ -2814,61 +2885,61 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2814
2885
|
className: "grid grid-cols-2 gap-2",
|
|
2815
2886
|
children: [/* @__PURE__ */ K(B, {
|
|
2816
2887
|
tone: "primary",
|
|
2817
|
-
size:
|
|
2888
|
+
size: x,
|
|
2818
2889
|
onClick: () => r(e.id, he(e)),
|
|
2819
2890
|
children: "Fit"
|
|
2820
2891
|
}), /* @__PURE__ */ K(B, {
|
|
2821
2892
|
tone: "primary",
|
|
2822
|
-
size:
|
|
2823
|
-
onClick: () =>
|
|
2893
|
+
size: x,
|
|
2894
|
+
onClick: () => F(N.find((e) => e.id === "View")?.params ?? []),
|
|
2824
2895
|
children: "Reset"
|
|
2825
2896
|
})]
|
|
2826
2897
|
})
|
|
2827
2898
|
] }),
|
|
2828
|
-
|
|
2899
|
+
o === "anim" && /* @__PURE__ */ q(G, { children: [
|
|
2829
2900
|
P && /* @__PURE__ */ q(U, {
|
|
2830
2901
|
label: "Motion",
|
|
2831
2902
|
divided: !0,
|
|
2832
2903
|
children: [/* @__PURE__ */ K(Q, {
|
|
2833
|
-
inline:
|
|
2904
|
+
inline: _,
|
|
2834
2905
|
label: "Frame",
|
|
2835
2906
|
children: /* @__PURE__ */ K(V, {
|
|
2836
2907
|
variant: "subtle",
|
|
2837
|
-
size:
|
|
2908
|
+
size: x,
|
|
2838
2909
|
className: "w-full",
|
|
2839
|
-
options:
|
|
2910
|
+
options: jn(P.frame, e._framePreset),
|
|
2840
2911
|
value: e._framePreset ?? "custom",
|
|
2841
2912
|
onChange: Ee("_framePreset", P.frame)
|
|
2842
2913
|
})
|
|
2843
2914
|
}), /* @__PURE__ */ K(Q, {
|
|
2844
|
-
inline:
|
|
2915
|
+
inline: _,
|
|
2845
2916
|
label: "Form",
|
|
2846
2917
|
children: /* @__PURE__ */ K(V, {
|
|
2847
2918
|
variant: "subtle",
|
|
2848
|
-
size:
|
|
2919
|
+
size: x,
|
|
2849
2920
|
className: "w-full",
|
|
2850
|
-
options:
|
|
2921
|
+
options: jn(P.form, e._formPreset),
|
|
2851
2922
|
value: e._formPreset ?? "custom",
|
|
2852
2923
|
onChange: Ee("_formPreset", P.form)
|
|
2853
2924
|
})
|
|
2854
2925
|
})]
|
|
2855
2926
|
}),
|
|
2856
|
-
/* @__PURE__ */ K(
|
|
2927
|
+
/* @__PURE__ */ K(Ae, {
|
|
2857
2928
|
layer: e,
|
|
2858
|
-
schema:
|
|
2859
|
-
setProp:
|
|
2929
|
+
schema: w,
|
|
2930
|
+
setProp: I
|
|
2860
2931
|
}),
|
|
2861
|
-
|
|
2932
|
+
le && !S?.is3D && /* @__PURE__ */ K(U, {
|
|
2862
2933
|
label: "Interaction",
|
|
2863
2934
|
divided: !0,
|
|
2864
2935
|
children: /* @__PURE__ */ K(Q, {
|
|
2865
|
-
inline:
|
|
2936
|
+
inline: _,
|
|
2866
2937
|
label: "Drag (C)",
|
|
2867
2938
|
children: /* @__PURE__ */ K($, {
|
|
2868
|
-
inline:
|
|
2869
|
-
cs:
|
|
2939
|
+
inline: _,
|
|
2940
|
+
cs: x,
|
|
2870
2941
|
on: !!ce.grab && e.orbit !== !1,
|
|
2871
|
-
onChange:
|
|
2942
|
+
onChange: ue
|
|
2872
2943
|
})
|
|
2873
2944
|
})
|
|
2874
2945
|
}),
|
|
@@ -2876,86 +2947,254 @@ function xn({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2876
2947
|
label: "3D",
|
|
2877
2948
|
divided: !0,
|
|
2878
2949
|
children: [/* @__PURE__ */ K(Q, {
|
|
2879
|
-
inline:
|
|
2950
|
+
inline: _,
|
|
2880
2951
|
label: "Orbit (C)",
|
|
2881
2952
|
children: /* @__PURE__ */ K($, {
|
|
2882
|
-
inline:
|
|
2883
|
-
cs:
|
|
2953
|
+
inline: _,
|
|
2954
|
+
cs: x,
|
|
2884
2955
|
on: !!ce.grab && e.orbit !== !1,
|
|
2885
|
-
onChange:
|
|
2956
|
+
onChange: ue
|
|
2886
2957
|
})
|
|
2887
|
-
}), S.zoom3dKey && /* @__PURE__ */ K(
|
|
2888
|
-
schema:
|
|
2958
|
+
}), S.zoom3dKey && /* @__PURE__ */ K(C, {
|
|
2959
|
+
schema: w.filter((e) => e.key === S.zoom3dKey).map(({ section: e, ...t }) => t),
|
|
2889
2960
|
layer: e,
|
|
2890
|
-
setProp:
|
|
2961
|
+
setProp: I,
|
|
2891
2962
|
palette: i,
|
|
2892
2963
|
renderAnimate: a,
|
|
2893
2964
|
tab: "anim",
|
|
2894
|
-
inline:
|
|
2965
|
+
inline: _
|
|
2895
2966
|
})]
|
|
2896
2967
|
}),
|
|
2897
|
-
/* @__PURE__ */ K(
|
|
2898
|
-
schema: S?.is3D && S.zoom3dKey ?
|
|
2968
|
+
/* @__PURE__ */ K(C, {
|
|
2969
|
+
schema: S?.is3D && S.zoom3dKey ? w.filter((e) => e.key !== S.zoom3dKey) : w,
|
|
2899
2970
|
layer: e,
|
|
2900
|
-
setProp:
|
|
2971
|
+
setProp: I,
|
|
2901
2972
|
palette: i,
|
|
2902
2973
|
renderAnimate: a,
|
|
2903
2974
|
tab: "anim",
|
|
2904
|
-
inline:
|
|
2975
|
+
inline: _
|
|
2905
2976
|
}),
|
|
2906
|
-
|
|
2977
|
+
je && /* @__PURE__ */ K(Xt, {
|
|
2907
2978
|
layer: e,
|
|
2908
2979
|
patch: n,
|
|
2909
2980
|
defaultDuration: S?.duration ?? 8
|
|
2910
2981
|
}),
|
|
2911
|
-
|
|
2912
|
-
schema:
|
|
2982
|
+
Oe && /* @__PURE__ */ K(C, {
|
|
2983
|
+
schema: Oe,
|
|
2913
2984
|
layer: e,
|
|
2914
2985
|
setProp: t,
|
|
2915
2986
|
palette: i,
|
|
2916
2987
|
renderAnimate: a,
|
|
2917
|
-
inline:
|
|
2988
|
+
inline: _
|
|
2918
2989
|
}),
|
|
2919
|
-
|
|
2990
|
+
ke && /* @__PURE__ */ K(Zt, {
|
|
2920
2991
|
layer: e,
|
|
2921
2992
|
patch: n,
|
|
2922
|
-
camParams:
|
|
2923
|
-
isEngine:
|
|
2924
|
-
showHeader: !
|
|
2993
|
+
camParams: R,
|
|
2994
|
+
isEngine: z,
|
|
2995
|
+
showHeader: !Oe
|
|
2925
2996
|
})
|
|
2926
2997
|
] }),
|
|
2927
|
-
/* @__PURE__ */ K(
|
|
2998
|
+
/* @__PURE__ */ K(an, {
|
|
2928
2999
|
layer: e,
|
|
2929
3000
|
patch: n,
|
|
2930
3001
|
renderAnimate: a,
|
|
2931
|
-
tab:
|
|
3002
|
+
tab: o === "labs-effect" ? "style" : o
|
|
2932
3003
|
})
|
|
2933
3004
|
] });
|
|
2934
3005
|
}
|
|
2935
3006
|
//#endregion
|
|
3007
|
+
//#region src/editor/labs/useLabsLayer.js
|
|
3008
|
+
function Pn() {
|
|
3009
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = s(), c = Qe((s, c) => {
|
|
3010
|
+
let [l, ...u] = e;
|
|
3011
|
+
a();
|
|
3012
|
+
for (let e of u) n(e.id);
|
|
3013
|
+
let d;
|
|
3014
|
+
return l && l.type === s ? (r(l.id, c), i(l.id), d = l.id) : (l && n(l.id), d = t(s, c)), o(), d;
|
|
3015
|
+
}, [
|
|
3016
|
+
e,
|
|
3017
|
+
t,
|
|
3018
|
+
n,
|
|
3019
|
+
r,
|
|
3020
|
+
i,
|
|
3021
|
+
a,
|
|
3022
|
+
o
|
|
3023
|
+
]);
|
|
3024
|
+
return {
|
|
3025
|
+
layer: e[0] ?? null,
|
|
3026
|
+
setOnly: c
|
|
3027
|
+
};
|
|
3028
|
+
}
|
|
3029
|
+
//#endregion
|
|
3030
|
+
//#region src/editor/morph/StepPicker.jsx
|
|
3031
|
+
function Fn(e) {
|
|
3032
|
+
let t = De(e.id), n = L(e.loop)?.params ?? [];
|
|
3033
|
+
return {
|
|
3034
|
+
loopId: e.loop,
|
|
3035
|
+
loopGroup: t,
|
|
3036
|
+
presetId: e.id,
|
|
3037
|
+
presetLabel: e.label,
|
|
3038
|
+
params: Fe(E(e), n),
|
|
3039
|
+
source: {
|
|
3040
|
+
kind: "preset",
|
|
3041
|
+
id: e.id,
|
|
3042
|
+
label: e.label
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
}
|
|
3046
|
+
function In(e, t) {
|
|
3047
|
+
let n = t ? Pe(e, t) : (e.layers ?? []).find((e) => e?.type === "loop");
|
|
3048
|
+
if (!n) return null;
|
|
3049
|
+
let r = L(n.loopId)?.params ?? [];
|
|
3050
|
+
return {
|
|
3051
|
+
loopId: n.loopId,
|
|
3052
|
+
loopGroup: n.loopGroup,
|
|
3053
|
+
presetId: n.presetId,
|
|
3054
|
+
presetLabel: n.presetLabel,
|
|
3055
|
+
params: Fe(n, r),
|
|
3056
|
+
source: {
|
|
3057
|
+
kind: "file",
|
|
3058
|
+
id: e.id,
|
|
3059
|
+
label: e.name || "Untitled"
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
3063
|
+
function Ln(e) {
|
|
3064
|
+
let t = L(e.loopId)?.params ?? [];
|
|
3065
|
+
return {
|
|
3066
|
+
loopId: e.loopId,
|
|
3067
|
+
loopGroup: e.loopGroup,
|
|
3068
|
+
presetId: e.presetId,
|
|
3069
|
+
presetLabel: e.presetLabel,
|
|
3070
|
+
params: Fe(e, t),
|
|
3071
|
+
source: {
|
|
3072
|
+
kind: "stage",
|
|
3073
|
+
label: e.presetLabel || "Stage"
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
}
|
|
3077
|
+
function Rn() {
|
|
3078
|
+
let e = Re(), { layer: t, setOnly: n } = Pn(), r = !!e.picker, i = e.mode === "blend" ? e.loopId : null, [a, o] = nt(""), s = t?.type === "loop" && (e.steps.length < 2 || e.editing != null), { rows: c, make: l } = tt(() => {
|
|
3079
|
+
let e = [], n = /* @__PURE__ */ new Map();
|
|
3080
|
+
if (!r) return {
|
|
3081
|
+
rows: e,
|
|
3082
|
+
make: n
|
|
3083
|
+
};
|
|
3084
|
+
s && (!i || t.loopId === i) && (e.push({
|
|
3085
|
+
id: "stage",
|
|
3086
|
+
label: t.presetLabel || "Current stage",
|
|
3087
|
+
group: "Current stage",
|
|
3088
|
+
hint: D(t.loopGroup)?.label
|
|
3089
|
+
}), n.set("stage", () => Ln(t)));
|
|
3090
|
+
for (let t of (Me().preset ?? []).filter((e) => !e.shipped)) {
|
|
3091
|
+
if (t.mode === "morph" || !(i ? Pe(t, i) : (t.layers ?? []).some((e) => e?.type === "loop"))) continue;
|
|
3092
|
+
let r = `file:${t.id}`;
|
|
3093
|
+
e.push({
|
|
3094
|
+
id: r,
|
|
3095
|
+
label: t.name || "Untitled",
|
|
3096
|
+
group: "My files"
|
|
3097
|
+
}), n.set(r, () => In(t, i));
|
|
3098
|
+
}
|
|
3099
|
+
for (let t of ve) {
|
|
3100
|
+
if (R(t) || i && t.loop !== i) continue;
|
|
3101
|
+
let r = `preset:${t.id}`;
|
|
3102
|
+
e.push({
|
|
3103
|
+
id: r,
|
|
3104
|
+
label: t.label,
|
|
3105
|
+
group: D(De(t.id))?.label ?? t.loop,
|
|
3106
|
+
hint: t.sub
|
|
3107
|
+
}), n.set(r, () => Fn(t));
|
|
3108
|
+
}
|
|
3109
|
+
return {
|
|
3110
|
+
rows: e,
|
|
3111
|
+
make: n
|
|
3112
|
+
};
|
|
3113
|
+
}, [
|
|
3114
|
+
r,
|
|
3115
|
+
i,
|
|
3116
|
+
s,
|
|
3117
|
+
t
|
|
3118
|
+
]), [u, d] = nt(null), f = tt(() => {
|
|
3119
|
+
if (u) return [{
|
|
3120
|
+
id: "back",
|
|
3121
|
+
label: "All categories",
|
|
3122
|
+
icon: "arrow-left",
|
|
3123
|
+
group: u,
|
|
3124
|
+
keepOpen: !0
|
|
3125
|
+
}, ...c.filter((e) => e.id.startsWith("preset:") && e.group === u)];
|
|
3126
|
+
let e = /* @__PURE__ */ new Map();
|
|
3127
|
+
for (let t of c) t.id.startsWith("preset:") && e.set(t.group, (e.get(t.group) ?? 0) + 1);
|
|
3128
|
+
let t = [...e].map(([e, t]) => ({
|
|
3129
|
+
id: `cat:${e}`,
|
|
3130
|
+
label: e,
|
|
3131
|
+
icon: "arrow-right",
|
|
3132
|
+
group: "Categories",
|
|
3133
|
+
hint: `${t}`,
|
|
3134
|
+
cat: e,
|
|
3135
|
+
keepOpen: !0
|
|
3136
|
+
}));
|
|
3137
|
+
return [...c.filter((e) => !e.id.startsWith("preset:")), ...t];
|
|
3138
|
+
}, [c, u]);
|
|
3139
|
+
if (!r) return null;
|
|
3140
|
+
let p = a.trim().toLowerCase();
|
|
3141
|
+
return /* @__PURE__ */ K(Ke, {
|
|
3142
|
+
open: !0,
|
|
3143
|
+
onClose: () => {
|
|
3144
|
+
Ie({ picker: null }), o(""), d(null);
|
|
3145
|
+
},
|
|
3146
|
+
suggestions: f,
|
|
3147
|
+
results: p ? c.filter((e) => [
|
|
3148
|
+
e.label,
|
|
3149
|
+
e.group,
|
|
3150
|
+
e.hint
|
|
3151
|
+
].some((e) => e && e.toLowerCase().includes(p))) : [],
|
|
3152
|
+
query: a,
|
|
3153
|
+
onQueryChange: o,
|
|
3154
|
+
onSelect: (t) => {
|
|
3155
|
+
if (t.keepOpen) {
|
|
3156
|
+
d(t.cat ?? null);
|
|
3157
|
+
return;
|
|
3158
|
+
}
|
|
3159
|
+
let r = l.get(t.id)?.();
|
|
3160
|
+
r && (e.steps.length === 0 && n("loop", {
|
|
3161
|
+
loopGroup: r.loopGroup,
|
|
3162
|
+
presetId: r.presetId,
|
|
3163
|
+
presetLabel: r.presetLabel,
|
|
3164
|
+
loopId: r.loopId,
|
|
3165
|
+
...r.params
|
|
3166
|
+
}), Le(r));
|
|
3167
|
+
},
|
|
3168
|
+
placeholder: "Search presets and files",
|
|
3169
|
+
selectLabel: "Add step"
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
//#endregion
|
|
2936
3173
|
//#region src/packs/generators.js
|
|
2937
|
-
var
|
|
3174
|
+
var zn = {
|
|
2938
3175
|
layerTypes: ["loop", "misc"],
|
|
2939
|
-
|
|
3176
|
+
GROUPS: M,
|
|
3177
|
+
loopById: L,
|
|
2940
3178
|
loopDrawParams: fe,
|
|
2941
|
-
resolveCameraKeys:
|
|
2942
|
-
loopBgToggleable:
|
|
2943
|
-
presetById:
|
|
2944
|
-
presetParams:
|
|
2945
|
-
presetsInGroup:
|
|
2946
|
-
presetsInSub:
|
|
2947
|
-
presetLayerPatch:
|
|
2948
|
-
isToolPreset:
|
|
2949
|
-
groupById:
|
|
2950
|
-
drawLoopFrame:
|
|
2951
|
-
GENERATIVE_TREE:
|
|
2952
|
-
MISC_TREE:
|
|
2953
|
-
THEME_OPTIONS:
|
|
2954
|
-
buildParatypeFlattenGroup:
|
|
2955
|
-
LoopPicker:
|
|
2956
|
-
LoopFields:
|
|
2957
|
-
|
|
3179
|
+
resolveCameraKeys: de,
|
|
3180
|
+
loopBgToggleable: me,
|
|
3181
|
+
presetById: ue,
|
|
3182
|
+
presetParams: E,
|
|
3183
|
+
presetsInGroup: T,
|
|
3184
|
+
presetsInSub: w,
|
|
3185
|
+
presetLayerPatch: Oe,
|
|
3186
|
+
isToolPreset: R,
|
|
3187
|
+
groupById: D,
|
|
3188
|
+
drawLoopFrame: ce,
|
|
3189
|
+
GENERATIVE_TREE: rt,
|
|
3190
|
+
MISC_TREE: it,
|
|
3191
|
+
THEME_OPTIONS: u,
|
|
3192
|
+
buildParatypeFlattenGroup: ut,
|
|
3193
|
+
LoopPicker: xt,
|
|
3194
|
+
LoopFields: Nn,
|
|
3195
|
+
stepFromPreset: Fn,
|
|
3196
|
+
loadGlHost: () => import("./host-DXizGh-A.js")
|
|
2958
3197
|
};
|
|
2959
|
-
|
|
3198
|
+
v("generators", zn);
|
|
2960
3199
|
//#endregion
|
|
2961
|
-
export {
|
|
3200
|
+
export { yt as _, Pn as a, it as b, Jt as c, Kt as d, St as f, vt as g, ht as h, Fn as i, Yt as l, bt as m, Rn as n, Nn as o, ft as p, Ln as r, On as s, zn as t, qt as u, dt as v, rt as y };
|