@kolkrabbi/design-editor 0.27.0 → 0.27.1
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-DP3uwW4A.js} +3263 -3861
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +1219 -795
- 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 +7 -7
- package/dist/Timeline-BObvcdXF.js +0 -3014
- package/dist/TreePicker-nMf17QGH.js +0 -68
- package/dist/motion-C_u7tsis.js +0 -2295
package/dist/design-editor.js
CHANGED
|
@@ -1,37 +1,395 @@
|
|
|
1
|
-
import { B as e, D as t, F as n, I as r,
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import { n as Re,
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import { n as ot, r as st } from "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import { B as e, D as t, F as n, I as r, J as i, L as a, On as o, P as s, Tt as c, Wt as l, _n as u, a as d, an as f, bn as p, d as m, et as h, f as g, i as _, it as v, j as y, kn as b, n as x, nn as S, o as C, on as w, p as T, r as E, rt as D, tn as O, vn as ee, yn as k } from "./rolls-CGma4Bua.js";
|
|
2
|
+
import { n as A, r as j, t as te } from "./useLayerEdit-CnPxtfWc.js";
|
|
3
|
+
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-DJrQJ7vg.js";
|
|
4
|
+
import { r as ue } from "./TreePicker-BQYPaQv3.js";
|
|
5
|
+
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-CQQxNX9W.js";
|
|
6
|
+
import { C as Te, E as Ee, S as De, T as Oe, _ as ke, b as Ae, c as je, d as Me, f as Ne, g as Pe, i as Fe, l as Ie, m as Le, n as Re, p as ze, r as Be, v as Ve, w as He, x as Ue, y as We } from "./ColorModesWindow-D65R5YR5.js";
|
|
7
|
+
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-DaOLa9oj.js";
|
|
8
|
+
import { n as rt, r as it, t as at } from "./BindDot-CaZu6Uuz.js";
|
|
9
|
+
import { n as ot, r as st } from "./effects-dbxBWOCp.js";
|
|
10
|
+
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-yfgCBe5u.js";
|
|
11
|
+
import { n as pt, r as mt, t as ht } from "./Timeline-OZsY9CvR.js";
|
|
12
|
+
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, a as Wt, at as Gt, b as Kt, c as qt, ct as Jt, d as Yt, dt as Xt, et as Zt, f as Qt, ft as $t, g as en, h as tn, i as nn, it as rn, j as an, k as on, l as sn, lt as cn, m as ln, n as un, nt as dn, o as fn, ot as pn, p as mn, q as hn, r as gn, rt as _n, s as vn, st as yn, t as bn, tt as xn, u as Sn, ut as Cn, v as wn, w as Tn, x as En, y as Dn, z as On } from "./core-DP3uwW4A.js";
|
|
13
|
+
import { Button as K, Divider as kn, Dropdown as An, LabeledControlSection as q, MultiSelect as jn, SegmentedToggle as J, SettingsRow as Mn, StepList as Nn, Tag as Pn, ToggleSwitch as Fn, Tooltip as In, useGrabEdge as Ln, useModal as Rn } from "@kolkrabbi/kol-component";
|
|
14
|
+
import { createContext as zn, useContext as Bn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Vn } from "react";
|
|
15
|
+
import { Fragment as Hn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
16
|
+
import { Icon as Un } from "@kolkrabbi/kol-icons";
|
|
17
|
+
import { useDragResize as Wn, useTheme as Gn } from "@kolkrabbi/kol-framework";
|
|
18
|
+
import { createPortal as Kn } from "react-dom";
|
|
17
19
|
//#region src/phoneFloats.js
|
|
18
|
-
var
|
|
20
|
+
var qn = (e) => {
|
|
19
21
|
let t = e, n = /* @__PURE__ */ new Set(), r = (e) => (n.add(e), () => n.delete(e));
|
|
20
22
|
return {
|
|
21
23
|
set: (e) => {
|
|
22
24
|
e !== t && (t = e, n.forEach((e) => e()));
|
|
23
25
|
},
|
|
24
|
-
use: () =>
|
|
26
|
+
use: () => Vn(r, () => t, () => t)
|
|
25
27
|
};
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
var
|
|
28
|
+
}, Jn = qn(null), Yn = qn(null), Xn = Jn.set;
|
|
29
|
+
Jn.use, Yn.set;
|
|
30
|
+
var Zn = Yn.use, Qn = [
|
|
31
|
+
{
|
|
32
|
+
id: "shape",
|
|
33
|
+
label: "Shape",
|
|
34
|
+
icon: "line-circle"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "blend",
|
|
38
|
+
label: "Blend",
|
|
39
|
+
icon: "shaper-scurve"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "crossfade",
|
|
43
|
+
label: "Crossfade",
|
|
44
|
+
icon: "dashed-circle"
|
|
45
|
+
}
|
|
46
|
+
], $n = {
|
|
47
|
+
shape: [
|
|
48
|
+
["Loops", ["morph-circle", "star-morph"]],
|
|
49
|
+
["Loops", [
|
|
50
|
+
"square-circle",
|
|
51
|
+
"blob",
|
|
52
|
+
"lissajous"
|
|
53
|
+
]],
|
|
54
|
+
["Loops", [
|
|
55
|
+
"morph-circle",
|
|
56
|
+
"star-morph",
|
|
57
|
+
"blob",
|
|
58
|
+
"spiral"
|
|
59
|
+
]],
|
|
60
|
+
["Math", ["math-spinner", "math-threads"]],
|
|
61
|
+
["Field", ["halftone", "checker-field"]],
|
|
62
|
+
["Flow", ["flow-obstacles", "flow-voronoi"]]
|
|
63
|
+
],
|
|
64
|
+
crossfade: [
|
|
65
|
+
["Scanline", ["scanline", "plasma"]],
|
|
66
|
+
["Scanline", [
|
|
67
|
+
"scanline",
|
|
68
|
+
"flow-charges",
|
|
69
|
+
"math-surface"
|
|
70
|
+
]],
|
|
71
|
+
["Field", ["plasma", "math-field"]],
|
|
72
|
+
["Field", ["gradient-field", "optic-moire"]],
|
|
73
|
+
["Penrose", ["penrose-02-diffgrow", "flow-growth"]],
|
|
74
|
+
["Penrose", [
|
|
75
|
+
"penrose-01-packing-lloyd",
|
|
76
|
+
"optic-reaction",
|
|
77
|
+
"abstract-rd",
|
|
78
|
+
"flow-voronoi"
|
|
79
|
+
]],
|
|
80
|
+
["Math", ["math-threads", "flow-ascii"]],
|
|
81
|
+
["Math", ["math-waveform", "scanline"]]
|
|
82
|
+
],
|
|
83
|
+
blend: [
|
|
84
|
+
[
|
|
85
|
+
"Scanline",
|
|
86
|
+
"scanline",
|
|
87
|
+
2
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"Scanline",
|
|
91
|
+
"scanline",
|
|
92
|
+
3
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"Field",
|
|
96
|
+
"plasma",
|
|
97
|
+
2
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"Math",
|
|
101
|
+
"math-curves",
|
|
102
|
+
2
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
"Math",
|
|
106
|
+
"math-spinner",
|
|
107
|
+
4
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
"Optic",
|
|
111
|
+
"optic-moire",
|
|
112
|
+
2
|
|
113
|
+
],
|
|
114
|
+
[
|
|
115
|
+
"Flow",
|
|
116
|
+
"flow-obstacles",
|
|
117
|
+
2
|
|
118
|
+
]
|
|
119
|
+
]
|
|
120
|
+
}, er = null;
|
|
121
|
+
function tr(e) {
|
|
122
|
+
if (!er) {
|
|
123
|
+
er = /* @__PURE__ */ new Map();
|
|
124
|
+
let e = /* @__PURE__ */ new Set();
|
|
125
|
+
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id), er.has(n.loop) || er.set(n.loop, []), er.get(n.loop).push(n));
|
|
126
|
+
}
|
|
127
|
+
return er.get(e) ?? [];
|
|
128
|
+
}
|
|
129
|
+
var nr = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), rr = null;
|
|
130
|
+
function ir() {
|
|
131
|
+
if (rr) return rr;
|
|
132
|
+
let e = [];
|
|
133
|
+
for (let t of Qn) for (let n of $n[t.id]) {
|
|
134
|
+
let [r] = n, i = t.id === "blend" ? nr(tr(n[1]), n[2]) : n[1].map((e) => tr(e)[0]);
|
|
135
|
+
if (!i || i.some((e) => !e) || new Set(i.map((e) => e.id)).size < i.length) continue;
|
|
136
|
+
let a = i.map((e) => e.label).join(" → "), o = `ship:morph:${t.id}:${i.map((e) => e.id).join("--")}`;
|
|
137
|
+
e.push({
|
|
138
|
+
id: o,
|
|
139
|
+
type: t.id,
|
|
140
|
+
typeLabel: t.label,
|
|
141
|
+
category: r,
|
|
142
|
+
sub: `${t.label} · ${r}`,
|
|
143
|
+
label: a,
|
|
144
|
+
steps: i,
|
|
145
|
+
morph: {
|
|
146
|
+
mode: t.id,
|
|
147
|
+
loopId: i[0].loop,
|
|
148
|
+
steps: i.map(ge),
|
|
149
|
+
curve: "in-out",
|
|
150
|
+
cycle: "loop",
|
|
151
|
+
resolution: 0,
|
|
152
|
+
syncLoop: !1,
|
|
153
|
+
seconds: 2 * i.length
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return rr = e;
|
|
158
|
+
}
|
|
159
|
+
var ar = () => Qn.map((e) => ({
|
|
160
|
+
label: e.label,
|
|
161
|
+
subs: [...new Set(ir().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
162
|
+
})), or = (e, t) => ir().find((n) => n.type === e && (!t || n.category === t)), sr = (e) => ir().find((t) => t.id === e);
|
|
163
|
+
function cr(e) {
|
|
164
|
+
e && (Qe({
|
|
165
|
+
active: !0,
|
|
166
|
+
...e.morph,
|
|
167
|
+
fileId: null,
|
|
168
|
+
fileName: e.label,
|
|
169
|
+
presetId: e.id
|
|
170
|
+
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || Jt("/morph"));
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/editor/labs/catalog.js
|
|
174
|
+
var lr = {
|
|
175
|
+
"fx:halftone": "ptrn-dot",
|
|
176
|
+
"fx:scanline": "grid-horizontal",
|
|
177
|
+
"fx:crt": "desktop",
|
|
178
|
+
"fx:refraction": "circle",
|
|
179
|
+
"fx:fx-rack": "target",
|
|
180
|
+
"fx:pattern": "ptrn-checker",
|
|
181
|
+
"fx:other": "more",
|
|
182
|
+
"gen:Scanline": "grid-horizontal",
|
|
183
|
+
"gen:Pattern": "ptrn-checker",
|
|
184
|
+
"gen:Loops": "refresh",
|
|
185
|
+
"gen:Math": "sum",
|
|
186
|
+
"gen:Penrose": "a-framed",
|
|
187
|
+
"gen:Flow": "wave",
|
|
188
|
+
"gen:Letter Gap": "letter-spacing",
|
|
189
|
+
"gen:Drift": "dith-flow",
|
|
190
|
+
"gen:Gradients": "circle",
|
|
191
|
+
"gen:Soft Forms": "paint-drop",
|
|
192
|
+
"gen:3D Scene": "ball",
|
|
193
|
+
"kin:Type": "font-01",
|
|
194
|
+
"kin:Kinetic": "font-01",
|
|
195
|
+
"misc:Para Type": "aa",
|
|
196
|
+
"vec:Distressor": "scribble",
|
|
197
|
+
"vec:Modulator": "dashed-circle"
|
|
198
|
+
}, ur = {
|
|
199
|
+
effects: "filter",
|
|
200
|
+
generative: "layers",
|
|
201
|
+
vector: "pen-nib",
|
|
202
|
+
composition: "type",
|
|
203
|
+
morph: "swap",
|
|
204
|
+
mode: "mode-toggle-01"
|
|
205
|
+
}, dr = [
|
|
206
|
+
"Moiré",
|
|
207
|
+
"Mesh Gradient",
|
|
208
|
+
"Reaction",
|
|
209
|
+
"Halftone"
|
|
210
|
+
], fr = [
|
|
211
|
+
{
|
|
212
|
+
label: "Spaced",
|
|
213
|
+
patch: {
|
|
214
|
+
geometry: "rows",
|
|
215
|
+
mark: "dots"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: "Glyph",
|
|
220
|
+
patch: { mark: "glyph" }
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
label: "Lattice",
|
|
224
|
+
patch: { mark: "lattice" }
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
label: "Vortex",
|
|
228
|
+
patch: {
|
|
229
|
+
geometry: "radial",
|
|
230
|
+
swirl: .8,
|
|
231
|
+
rayCount: 220
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: "Rings",
|
|
236
|
+
patch: { geometry: "rings" }
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: "Spiral",
|
|
240
|
+
patch: { geometry: "spiral" }
|
|
241
|
+
}
|
|
242
|
+
], pr = (e = {}) => {
|
|
243
|
+
let t = e.geometry ?? "rows";
|
|
244
|
+
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
245
|
+
};
|
|
246
|
+
function mr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
247
|
+
let a = () => e?.type === "photo" ? (e.filters ?? []).filter((e) => e?.id === "fx-media") : [], o = (e, o) => {
|
|
248
|
+
let s = a(), c = t("photo", {
|
|
249
|
+
...i(),
|
|
250
|
+
filters: s,
|
|
251
|
+
fxGroup: null
|
|
252
|
+
});
|
|
253
|
+
c && (n(c, e), o && r(c, s.length, o)), window.dispatchEvent(new CustomEvent("kol:open-effects"));
|
|
254
|
+
}, s = (e) => {
|
|
255
|
+
t("photo", {
|
|
256
|
+
...i(),
|
|
257
|
+
filters: a(),
|
|
258
|
+
fxGroup: e
|
|
259
|
+
}), window.dispatchEvent(new CustomEvent("kol:open-effects"));
|
|
260
|
+
}, c = (e, n) => {
|
|
261
|
+
t("loop", H(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
262
|
+
}, l = (e) => {
|
|
263
|
+
t("kinetic", {
|
|
264
|
+
presetId: e.id,
|
|
265
|
+
presetLabel: e.label,
|
|
266
|
+
comp: dt(e)
|
|
267
|
+
}), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
268
|
+
}, u = e?.presetId ?? null, d = (e?.filters ?? []).find((e) => e?.id !== "fx-media")?.id ?? null, f = u ? N(e?.loopGroup).find((e) => e.id === u) ?? null : null, p = (n, r = "loop", i) => {
|
|
269
|
+
let a = N(n), o = [...new Set(a.map((e) => e.sub).filter(Boolean))], s = (e) => r === "misc" ? () => {
|
|
270
|
+
t("misc", H(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
271
|
+
} : () => c(e, n);
|
|
272
|
+
return o.length ? o.map((t) => ({
|
|
273
|
+
label: t,
|
|
274
|
+
onSelect: s(ne(n, t)[0]),
|
|
275
|
+
active: e?.loopGroup === n && f?.sub === t
|
|
276
|
+
})) : [{
|
|
277
|
+
label: i ?? P(n).label,
|
|
278
|
+
onSelect: s(a[0]),
|
|
279
|
+
active: e?.loopGroup === n
|
|
280
|
+
}];
|
|
281
|
+
}, m = (e) => e.groups.flatMap((t) => {
|
|
282
|
+
let n = e.labels?.[t] ?? P(t).label, r = N(t).some((e) => e.sub), i = p(t, "loop", n);
|
|
283
|
+
return e.groups.length > 1 && r ? [{
|
|
284
|
+
label: n,
|
|
285
|
+
children: i
|
|
286
|
+
}] : i;
|
|
287
|
+
});
|
|
288
|
+
return [
|
|
289
|
+
{
|
|
290
|
+
id: "color",
|
|
291
|
+
label: "Color",
|
|
292
|
+
icon: "clr-tri",
|
|
293
|
+
onSelect: Re,
|
|
294
|
+
pages: []
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
id: "sec:effects",
|
|
298
|
+
label: "Effects"
|
|
299
|
+
},
|
|
300
|
+
...oe(L).map((t) => ({
|
|
301
|
+
id: `fx:${t.id}`,
|
|
302
|
+
label: t.label,
|
|
303
|
+
icon: lr[`fx:${t.id}`] ?? "square",
|
|
304
|
+
pages: t.rack ? se.map((t) => ({
|
|
305
|
+
label: t.label,
|
|
306
|
+
onSelect: () => s(t.id),
|
|
307
|
+
active: e?.fxGroup === t.id
|
|
308
|
+
})) : t.id === "pattern" ? dr.map((t) => ({
|
|
309
|
+
label: t,
|
|
310
|
+
onSelect: () => c(ne("optic", t)[0], "optic"),
|
|
311
|
+
active: e?.loopGroup === "optic" && f?.sub === t
|
|
312
|
+
})) : t.id === "scanline" ? fr.map((t) => ({
|
|
313
|
+
label: t.label,
|
|
314
|
+
onSelect: () => o("scanline", t.patch),
|
|
315
|
+
active: !e?.fxGroup && d === "scanline" && pr((e?.filters ?? []).find((e) => e?.id === "scanline")?.params) === t.label
|
|
316
|
+
})) : t.filters.map((t) => ({
|
|
317
|
+
label: t.label ?? t.id,
|
|
318
|
+
onSelect: () => o(t.id),
|
|
319
|
+
active: !e?.fxGroup && d === t.id
|
|
320
|
+
}))
|
|
321
|
+
})),
|
|
322
|
+
{
|
|
323
|
+
id: "sec:generative",
|
|
324
|
+
label: "Generative"
|
|
325
|
+
},
|
|
326
|
+
...we.map((e) => ({
|
|
327
|
+
id: `gen:${e.label}`,
|
|
328
|
+
label: e.label,
|
|
329
|
+
icon: lr[`gen:${e.label}`] ?? "square",
|
|
330
|
+
pages: m(e)
|
|
331
|
+
})),
|
|
332
|
+
{
|
|
333
|
+
id: "sec:morph",
|
|
334
|
+
label: "Morph"
|
|
335
|
+
},
|
|
336
|
+
...Qn.map((e) => ({
|
|
337
|
+
id: `morph:${e.id}`,
|
|
338
|
+
label: e.label,
|
|
339
|
+
icon: e.icon,
|
|
340
|
+
pages: [...new Set(ir().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
341
|
+
label: t,
|
|
342
|
+
onSelect: () => cr(or(e.id, t)),
|
|
343
|
+
active: (() => {
|
|
344
|
+
let n = ir().find((e) => e.id === Ze().presetId);
|
|
345
|
+
return n?.type === e.id && n.category === t;
|
|
346
|
+
})()
|
|
347
|
+
}))
|
|
348
|
+
})),
|
|
349
|
+
{
|
|
350
|
+
id: "sec:vector",
|
|
351
|
+
label: "Vector"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: "vec:Distressor",
|
|
355
|
+
label: "Distressor",
|
|
356
|
+
icon: lr["vec:Distressor"] ?? "square",
|
|
357
|
+
pages: p("distress")
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id: "vec:Modulator",
|
|
361
|
+
label: "Modulator",
|
|
362
|
+
icon: lr["vec:Modulator"] ?? "square",
|
|
363
|
+
pages: p("modulator")
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: "sec:composition",
|
|
367
|
+
label: "Composition"
|
|
368
|
+
},
|
|
369
|
+
...ct.map((t) => ({
|
|
370
|
+
id: `kin:${t.label}`,
|
|
371
|
+
label: t.label,
|
|
372
|
+
icon: lr[`kin:${t.label}`] ?? "square",
|
|
373
|
+
pages: t.subs.map((t) => ({
|
|
374
|
+
label: t,
|
|
375
|
+
onSelect: () => l(lt.find((e) => e.sub === t)),
|
|
376
|
+
active: e?.type === "kinetic" && lt.some((e) => e.sub === t && e.id === u)
|
|
377
|
+
}))
|
|
378
|
+
})),
|
|
379
|
+
...fe.map((e) => ({
|
|
380
|
+
id: `misc:${e.label}`,
|
|
381
|
+
label: e.label,
|
|
382
|
+
icon: lr[`misc:${e.label}`] ?? "square",
|
|
383
|
+
pages: e.groups.flatMap((e) => p(e, "misc"))
|
|
384
|
+
}))
|
|
385
|
+
];
|
|
386
|
+
}
|
|
29
387
|
//#endregion
|
|
30
388
|
//#region src/editor/labs/LabsNav.jsx
|
|
31
|
-
function
|
|
32
|
-
let { addFilter: e, patchFilter: t } =
|
|
389
|
+
function hr() {
|
|
390
|
+
let { addFilter: e, patchFilter: t } = i(), { layer: n, setOnly: r } = W(), a = X(null);
|
|
33
391
|
Y(() => {
|
|
34
|
-
n?.type === "photo" && n.src && (
|
|
392
|
+
n?.type === "photo" && n.src && (a.current = {
|
|
35
393
|
src: n.src,
|
|
36
394
|
srcType: n.srcType,
|
|
37
395
|
fit: n.fit
|
|
@@ -42,7 +400,7 @@ function nr() {
|
|
|
42
400
|
n?.srcType,
|
|
43
401
|
n?.fit
|
|
44
402
|
]);
|
|
45
|
-
let o =
|
|
403
|
+
let o = mr({
|
|
46
404
|
layer: n,
|
|
47
405
|
setOnly: r,
|
|
48
406
|
addFilter: e,
|
|
@@ -51,7 +409,7 @@ function nr() {
|
|
|
51
409
|
src: n.src,
|
|
52
410
|
srcType: n.srcType,
|
|
53
411
|
fit: n.fit
|
|
54
|
-
} :
|
|
412
|
+
} : a.current ?? {}
|
|
55
413
|
});
|
|
56
414
|
return Y(() => {
|
|
57
415
|
let e = /* @__PURE__ */ new Map(), t = [];
|
|
@@ -59,7 +417,7 @@ function nr() {
|
|
|
59
417
|
if (n.id.startsWith("sec:")) {
|
|
60
418
|
let e = n.id.slice(4);
|
|
61
419
|
t.push({
|
|
62
|
-
icon:
|
|
420
|
+
icon: ur[e] ?? "square",
|
|
63
421
|
path: `${vn}${n.id}`,
|
|
64
422
|
label: n.label,
|
|
65
423
|
sub: []
|
|
@@ -74,30 +432,30 @@ function nr() {
|
|
|
74
432
|
label: n.label
|
|
75
433
|
};
|
|
76
434
|
o?.sub ? o.sub.push(s) : t.push(s);
|
|
77
|
-
}),
|
|
435
|
+
}), qt({
|
|
78
436
|
items: t,
|
|
79
437
|
dispatch: (t) => {
|
|
80
438
|
let n = e.get(t);
|
|
81
439
|
return n ? (n(), !0) : !1;
|
|
82
440
|
}
|
|
83
|
-
}), () =>
|
|
441
|
+
}), () => qt(null);
|
|
84
442
|
}), null;
|
|
85
443
|
}
|
|
86
444
|
//#endregion
|
|
87
445
|
//#region src/editor/morph/MorphTab.jsx
|
|
88
|
-
var
|
|
446
|
+
var gr = (e, t) => JSON.stringify(e) === JSON.stringify(t), _r = [
|
|
89
447
|
{
|
|
90
448
|
key: "curve",
|
|
91
449
|
label: "Curve",
|
|
92
450
|
type: "select",
|
|
93
|
-
options:
|
|
451
|
+
options: qe,
|
|
94
452
|
section: "Curve"
|
|
95
453
|
},
|
|
96
454
|
{
|
|
97
455
|
key: "cycle",
|
|
98
456
|
label: "Cycle",
|
|
99
457
|
type: "select",
|
|
100
|
-
options:
|
|
458
|
+
options: Je,
|
|
101
459
|
section: "Curve"
|
|
102
460
|
},
|
|
103
461
|
{
|
|
@@ -118,51 +476,51 @@ var rr = (e, t) => JSON.stringify(e) === JSON.stringify(t), ir = [
|
|
|
118
476
|
when: (e) => e.mode === "shape"
|
|
119
477
|
}
|
|
120
478
|
];
|
|
121
|
-
function
|
|
122
|
-
let
|
|
123
|
-
blend:
|
|
124
|
-
shape:
|
|
125
|
-
crossfade:
|
|
126
|
-
},
|
|
479
|
+
function vr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
480
|
+
let o = a(), s = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = s, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = i(), { setOnly: S } = W(), { buildSavedSpec: C } = wt(), { addItem: w, updateItem: T } = Ne(), E = Rn(), D = f(), ee = te(e?.id ?? null, { history: "coalesce" }), [k, j] = Z("generate"), M = c[0], ne = c.every((e) => e.loopId === M?.loopId), N = c.filter((e) => !zt(U(e.loopId)) || !Lt(U(e.loopId))), P = N.length === 0, F = {
|
|
481
|
+
blend: ne ? null : "Blend tweens one generator — these steps are different generators",
|
|
482
|
+
shape: P ? null : `No outline to morph: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`,
|
|
483
|
+
crossfade: P ? null : `Cannot fade: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`
|
|
484
|
+
}, I = [
|
|
127
485
|
{
|
|
128
486
|
value: "shape",
|
|
129
487
|
label: "Shape",
|
|
130
|
-
disabled: !!
|
|
131
|
-
tooltip:
|
|
488
|
+
disabled: !!F.shape,
|
|
489
|
+
tooltip: F.shape ?? void 0
|
|
132
490
|
},
|
|
133
491
|
{
|
|
134
492
|
value: "blend",
|
|
135
493
|
label: "Blend",
|
|
136
|
-
disabled: !!
|
|
137
|
-
tooltip:
|
|
494
|
+
disabled: !!F.blend,
|
|
495
|
+
tooltip: F.blend ?? void 0
|
|
138
496
|
},
|
|
139
497
|
{
|
|
140
498
|
value: "crossfade",
|
|
141
499
|
label: "Crossfade",
|
|
142
|
-
disabled: !!
|
|
143
|
-
tooltip:
|
|
500
|
+
disabled: !!F.crossfade,
|
|
501
|
+
tooltip: F.crossfade ?? void 0
|
|
144
502
|
}
|
|
145
503
|
];
|
|
146
504
|
Y(() => {
|
|
147
|
-
if (t || c.length < 2 || !
|
|
505
|
+
if (t || c.length < 2 || !F[d]) return;
|
|
148
506
|
let e = [
|
|
149
507
|
"shape",
|
|
150
508
|
"crossfade",
|
|
151
509
|
"blend"
|
|
152
|
-
].find((e) => !
|
|
510
|
+
].find((e) => !F[e]);
|
|
153
511
|
e && G({ mode: e });
|
|
154
512
|
}, [
|
|
155
513
|
d,
|
|
156
|
-
|
|
157
|
-
|
|
514
|
+
ne,
|
|
515
|
+
P,
|
|
158
516
|
c.length,
|
|
159
517
|
t
|
|
160
518
|
]), Y(() => {
|
|
161
|
-
!t && c.length === 0 && e?.type === "loop" && e.loopId && !e.morph &&
|
|
519
|
+
!t && c.length === 0 && e?.type === "loop" && e.loopId && !e.morph && tt(xe(e));
|
|
162
520
|
}, []);
|
|
163
|
-
let
|
|
164
|
-
let t = c.length <
|
|
165
|
-
if (
|
|
521
|
+
let re = X(c.length), L = () => {
|
|
522
|
+
let t = c.length < re.current;
|
|
523
|
+
if (re.current = c.length, c.length < 2) {
|
|
166
524
|
if (!e || !t) return;
|
|
167
525
|
if (c.length === 0) {
|
|
168
526
|
v(e.id);
|
|
@@ -193,18 +551,18 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
193
551
|
steps: c.map((e, t) => ({
|
|
194
552
|
loopId: e.loopId,
|
|
195
553
|
params: e.params,
|
|
196
|
-
label:
|
|
554
|
+
label: Ke(e, t)
|
|
197
555
|
})),
|
|
198
556
|
cycle: u,
|
|
199
557
|
curve: l,
|
|
200
|
-
resolution:
|
|
558
|
+
resolution: p,
|
|
201
559
|
syncLoop: s.syncLoop,
|
|
202
560
|
name: s.fileName
|
|
203
561
|
}, i = d === "blend" ? {
|
|
204
562
|
...n,
|
|
205
|
-
|
|
563
|
+
...$e({
|
|
206
564
|
snapshots: c.map((e) => e.params),
|
|
207
|
-
schema:
|
|
565
|
+
schema: U(M.loopId)?.params ?? [],
|
|
208
566
|
curve: l,
|
|
209
567
|
cycle: u
|
|
210
568
|
}).patch,
|
|
@@ -216,43 +574,43 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
216
574
|
morph: r,
|
|
217
575
|
morphT: {
|
|
218
576
|
bind: "track",
|
|
219
|
-
keys:
|
|
577
|
+
keys: Ct(c.length, u, l)
|
|
220
578
|
}
|
|
221
579
|
};
|
|
222
|
-
e ? _(e.id, i) :
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
let
|
|
580
|
+
e ? _(e.id, i) : S("loop", i);
|
|
581
|
+
}, R = X(L);
|
|
582
|
+
R.current = L;
|
|
583
|
+
let ie = JSON.stringify([
|
|
226
584
|
d,
|
|
227
585
|
c.map((e) => [e.loopId, e.params]),
|
|
228
586
|
l,
|
|
229
587
|
u,
|
|
230
|
-
|
|
588
|
+
p,
|
|
231
589
|
s.syncLoop
|
|
232
|
-
]),
|
|
590
|
+
]), ae = X(null);
|
|
233
591
|
Y(() => {
|
|
234
|
-
t ||
|
|
592
|
+
t || m != null || ie === ae.current || c.length >= 2 && F[d] || (ae.current = ie, R.current());
|
|
235
593
|
}, [
|
|
236
|
-
|
|
237
|
-
|
|
594
|
+
ie,
|
|
595
|
+
m,
|
|
238
596
|
c.length,
|
|
239
597
|
t
|
|
240
598
|
]), Y(() => {
|
|
241
|
-
if (t ||
|
|
242
|
-
let n =
|
|
243
|
-
|
|
599
|
+
if (t || m == null || !e) return;
|
|
600
|
+
let n = et(e, U(e.loopId)?.params ?? []);
|
|
601
|
+
gr(n, c[m]?.params) || Xe(m, n);
|
|
244
602
|
}, [e]), Y(() => {
|
|
245
|
-
t || !
|
|
603
|
+
t || !D || m == null || (G({ editing: null }), ae.current = null);
|
|
246
604
|
}, [
|
|
247
|
-
|
|
248
|
-
|
|
605
|
+
D,
|
|
606
|
+
m,
|
|
249
607
|
t
|
|
250
608
|
]), Y(() => () => {
|
|
251
|
-
!t && s.editing != null && (G({ editing: null }),
|
|
609
|
+
!t && s.editing != null && (G({ editing: null }), R.current());
|
|
252
610
|
}, []);
|
|
253
|
-
let
|
|
611
|
+
let z = (e) => {
|
|
254
612
|
let t = c[e];
|
|
255
|
-
t && (
|
|
613
|
+
t && (O.pause(), G({ editing: e }), S("loop", {
|
|
256
614
|
loopGroup: t.loopGroup,
|
|
257
615
|
presetId: t.presetId,
|
|
258
616
|
presetLabel: t.presetLabel,
|
|
@@ -263,7 +621,7 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
263
621
|
}));
|
|
264
622
|
};
|
|
265
623
|
return Y(() => {
|
|
266
|
-
t || g == null || (G({ editRequest: null }),
|
|
624
|
+
t || g == null || (G({ editRequest: null }), z(g));
|
|
267
625
|
}, [g]), /* @__PURE__ */ $("div", {
|
|
268
626
|
className: "flex flex-col gap-5",
|
|
269
627
|
children: [
|
|
@@ -271,35 +629,35 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
271
629
|
tone: "sunken",
|
|
272
630
|
value: d,
|
|
273
631
|
onChange: (e) => !t && G({ mode: e }),
|
|
274
|
-
options:
|
|
275
|
-
size:
|
|
276
|
-
className: r(
|
|
632
|
+
options: I,
|
|
633
|
+
size: o,
|
|
634
|
+
className: r(o)
|
|
277
635
|
}),
|
|
278
636
|
!t && /* @__PURE__ */ Q(q, {
|
|
279
637
|
divided: !0,
|
|
280
|
-
children: /* @__PURE__ */ Q(
|
|
281
|
-
tree:
|
|
282
|
-
presets:
|
|
283
|
-
current:
|
|
638
|
+
children: /* @__PURE__ */ Q(ue, {
|
|
639
|
+
tree: ar(),
|
|
640
|
+
presets: ir(),
|
|
641
|
+
current: sr(s.presetId) ?? { typeLabel: Qn.find((e) => e.id === d)?.label },
|
|
284
642
|
subLabel: (e) => e.split(" · ").pop(),
|
|
285
|
-
onPick:
|
|
643
|
+
onPick: cr
|
|
286
644
|
})
|
|
287
645
|
}),
|
|
288
646
|
/* @__PURE__ */ $(q, {
|
|
289
647
|
divided: !0,
|
|
290
648
|
children: [
|
|
291
|
-
/* @__PURE__ */ Q(
|
|
649
|
+
/* @__PURE__ */ Q(Nn, {
|
|
292
650
|
items: c.map((e, t) => ({
|
|
293
651
|
id: t,
|
|
294
|
-
label:
|
|
652
|
+
label: Ke(e, t)
|
|
295
653
|
})),
|
|
296
|
-
activeIndex:
|
|
654
|
+
activeIndex: m,
|
|
297
655
|
reorder: "grab",
|
|
298
656
|
readOnly: t,
|
|
299
|
-
size:
|
|
300
|
-
onSelect:
|
|
301
|
-
onRemove:
|
|
302
|
-
onMove:
|
|
657
|
+
size: o,
|
|
658
|
+
onSelect: z,
|
|
659
|
+
onRemove: Ye,
|
|
660
|
+
onMove: Ge,
|
|
303
661
|
onAdd: () => G({
|
|
304
662
|
active: !0,
|
|
305
663
|
picker: "preset"
|
|
@@ -310,31 +668,31 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
310
668
|
className: "kol-mono-12 text-meta",
|
|
311
669
|
children: "Two steps or more and the stage plays the morph."
|
|
312
670
|
}),
|
|
313
|
-
c.length >= 2 &&
|
|
671
|
+
c.length >= 2 && F[d] && /* @__PURE__ */ Q("p", {
|
|
314
672
|
className: "kol-mono-12 text-meta",
|
|
315
|
-
children:
|
|
673
|
+
children: F[d]
|
|
316
674
|
})
|
|
317
675
|
]
|
|
318
676
|
}),
|
|
319
|
-
|
|
320
|
-
label: `Step ${
|
|
677
|
+
m != null && !t && e && n && /* @__PURE__ */ $(q, {
|
|
678
|
+
label: `Step ${m + 1}`,
|
|
321
679
|
divided: !0,
|
|
322
680
|
children: [
|
|
323
681
|
/* @__PURE__ */ Q(J, {
|
|
324
682
|
tone: "sunken",
|
|
325
|
-
value:
|
|
683
|
+
value: k,
|
|
326
684
|
onChange: j,
|
|
327
685
|
options: n,
|
|
328
|
-
size:
|
|
329
|
-
className: r(
|
|
686
|
+
size: o,
|
|
687
|
+
className: r(o)
|
|
330
688
|
}),
|
|
331
|
-
/* @__PURE__ */ Q(
|
|
689
|
+
/* @__PURE__ */ Q(ye, {
|
|
332
690
|
layer: e,
|
|
333
|
-
setProp:
|
|
334
|
-
patch:
|
|
691
|
+
setProp: ee.setProp,
|
|
692
|
+
patch: ee.patch,
|
|
335
693
|
updateLayer: _,
|
|
336
|
-
palette:
|
|
337
|
-
tab:
|
|
694
|
+
palette: x,
|
|
695
|
+
tab: k,
|
|
338
696
|
tabStrip: null,
|
|
339
697
|
inline: !0,
|
|
340
698
|
picker: !1
|
|
@@ -343,14 +701,14 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
343
701
|
className: "kol-mono-12 text-emphasis",
|
|
344
702
|
children: [
|
|
345
703
|
"Editing step ",
|
|
346
|
-
|
|
704
|
+
m + 1,
|
|
347
705
|
" — press Play to run the morph."
|
|
348
706
|
]
|
|
349
707
|
})
|
|
350
708
|
]
|
|
351
709
|
}),
|
|
352
|
-
/* @__PURE__ */ Q(
|
|
353
|
-
schema:
|
|
710
|
+
/* @__PURE__ */ Q(A, {
|
|
711
|
+
schema: _r,
|
|
354
712
|
layer: s,
|
|
355
713
|
setProp: (e, n) => {
|
|
356
714
|
!t && (typeof n != "object" || !n) && G({ [e]: n });
|
|
@@ -361,15 +719,15 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
361
719
|
divided: !0,
|
|
362
720
|
children: /* @__PURE__ */ Q(K, {
|
|
363
721
|
tone: "primary",
|
|
364
|
-
size:
|
|
722
|
+
size: o,
|
|
365
723
|
className: "w-full",
|
|
366
724
|
onClick: async () => {
|
|
367
725
|
if (c.length < 2) return;
|
|
368
726
|
let e = s.fileName;
|
|
369
|
-
if (!
|
|
370
|
-
|
|
727
|
+
if (!h && (e = await E.prompt("Name this morph:", ""), e === null)) return;
|
|
728
|
+
m != null && (G({ editing: null }), R.current());
|
|
371
729
|
let t = {
|
|
372
|
-
...await
|
|
730
|
+
...await C(e || null),
|
|
373
731
|
mode: "morph",
|
|
374
732
|
morph: {
|
|
375
733
|
mode: d,
|
|
@@ -377,22 +735,22 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
377
735
|
steps: c,
|
|
378
736
|
curve: l,
|
|
379
737
|
cycle: u,
|
|
380
|
-
resolution:
|
|
738
|
+
resolution: p,
|
|
381
739
|
syncLoop: s.syncLoop,
|
|
382
|
-
seconds:
|
|
740
|
+
seconds: O.getLoopSeconds()
|
|
383
741
|
}
|
|
384
742
|
};
|
|
385
|
-
if (
|
|
386
|
-
|
|
743
|
+
if (h) {
|
|
744
|
+
T("preset", h, t);
|
|
387
745
|
return;
|
|
388
746
|
}
|
|
389
|
-
let n =
|
|
747
|
+
let n = w("preset", t);
|
|
390
748
|
n && (G({
|
|
391
749
|
fileId: n,
|
|
392
750
|
fileName: e || null
|
|
393
|
-
}), y(n),
|
|
751
|
+
}), y(n), b(e || null));
|
|
394
752
|
},
|
|
395
|
-
children:
|
|
753
|
+
children: h ? "Save" : "Save…"
|
|
396
754
|
})
|
|
397
755
|
})
|
|
398
756
|
]
|
|
@@ -400,7 +758,7 @@ function ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
400
758
|
}
|
|
401
759
|
//#endregion
|
|
402
760
|
//#region src/editor/params/QuickMotion.jsx
|
|
403
|
-
var
|
|
761
|
+
var yr = [
|
|
404
762
|
{
|
|
405
763
|
value: "breathe",
|
|
406
764
|
label: "Breathe",
|
|
@@ -419,26 +777,26 @@ var or = [
|
|
|
419
777
|
source: "lfo-square",
|
|
420
778
|
rate: 8
|
|
421
779
|
}
|
|
422
|
-
],
|
|
423
|
-
function
|
|
780
|
+
], br = .2;
|
|
781
|
+
function xr(e) {
|
|
424
782
|
if (!t(e)) return "off";
|
|
425
783
|
if (e.bind !== "mod") return "custom";
|
|
426
|
-
let n =
|
|
784
|
+
let n = yr.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
427
785
|
return n ? n.value : "custom";
|
|
428
786
|
}
|
|
429
|
-
function
|
|
430
|
-
let
|
|
787
|
+
function Sr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
788
|
+
let o = a(), s = v(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && D(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
431
789
|
if (!s.length) return null;
|
|
432
790
|
let c = (e, n) => {
|
|
433
791
|
let i = t[e.key];
|
|
434
792
|
if (n === "off") {
|
|
435
793
|
let n = i?.transform?.range;
|
|
436
|
-
r(e.key, Array.isArray(n) ? (n[0] + n[1]) / 2 :
|
|
794
|
+
r(e.key, Array.isArray(n) ? (n[0] + n[1]) / 2 : y(i, O.getCtx(), t) ?? e.default ?? e.min);
|
|
437
795
|
return;
|
|
438
796
|
}
|
|
439
|
-
let a =
|
|
797
|
+
let a = yr.find((e) => e.value === n);
|
|
440
798
|
if (!a) return;
|
|
441
|
-
let o = Number(
|
|
799
|
+
let o = Number(y(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) * br, c = Math.max(e.min, o - s), l = Math.min(e.max, o + s);
|
|
442
800
|
r(e.key, {
|
|
443
801
|
bind: "mod",
|
|
444
802
|
source: a.source,
|
|
@@ -452,12 +810,12 @@ function lr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
452
810
|
label: i,
|
|
453
811
|
divided: !0,
|
|
454
812
|
children: s.map((e) => {
|
|
455
|
-
let r =
|
|
813
|
+
let r = xr(t[e.key]), i = [
|
|
456
814
|
{
|
|
457
815
|
value: "off",
|
|
458
816
|
label: "Off"
|
|
459
817
|
},
|
|
460
|
-
...
|
|
818
|
+
...yr.map(({ value: e, label: t }) => ({
|
|
461
819
|
value: e,
|
|
462
820
|
label: t
|
|
463
821
|
})),
|
|
@@ -466,12 +824,12 @@ function lr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
466
824
|
label: "Custom"
|
|
467
825
|
}] : []
|
|
468
826
|
];
|
|
469
|
-
return /* @__PURE__ */ Q(
|
|
827
|
+
return /* @__PURE__ */ Q(Mn, {
|
|
470
828
|
label: e.label,
|
|
471
829
|
align: "fill",
|
|
472
830
|
labelWidth: n,
|
|
473
|
-
children: /* @__PURE__ */ Q(
|
|
474
|
-
size:
|
|
831
|
+
children: /* @__PURE__ */ Q(An, {
|
|
832
|
+
size: o,
|
|
475
833
|
variant: "subtle",
|
|
476
834
|
className: "w-full",
|
|
477
835
|
options: i,
|
|
@@ -484,7 +842,7 @@ function lr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
484
842
|
}
|
|
485
843
|
//#endregion
|
|
486
844
|
//#region src/editor/params/InputRows.jsx
|
|
487
|
-
var
|
|
845
|
+
var Cr = [
|
|
488
846
|
{
|
|
489
847
|
value: "off",
|
|
490
848
|
label: "Off"
|
|
@@ -509,19 +867,19 @@ var ur = [
|
|
|
509
867
|
value: "lfo-sine",
|
|
510
868
|
label: "LFO"
|
|
511
869
|
}
|
|
512
|
-
],
|
|
513
|
-
function
|
|
514
|
-
let
|
|
870
|
+
], wr = new Set(Cr.map((e) => e.value));
|
|
871
|
+
function Tr({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
872
|
+
let o = a(), s = v(e ?? [], n).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
515
873
|
if (!s.length) return null;
|
|
516
874
|
let c = new Map(s.map((e) => [e.key, e])), l = (i ?? []).filter((e) => c.has(e)), u = [...l, ...s.map((e) => e.key).filter((e) => !l.includes(e))], d = l.length ? l : u.slice(0, 3), f = (e) => {
|
|
517
875
|
let r = n[e];
|
|
518
|
-
return t(r) && r.bind === "mod" &&
|
|
519
|
-
},
|
|
876
|
+
return t(r) && r.bind === "mod" && wr.has(r.source);
|
|
877
|
+
}, p = u.filter(f), m = (e) => {
|
|
520
878
|
let t = c.get(e);
|
|
521
|
-
return Number(
|
|
522
|
-
},
|
|
879
|
+
return Number(y(n[e], O.getCtx(), n) ?? t.default ?? t.min);
|
|
880
|
+
}, h = (e, i, a = t(n[e]) ? n[e].transform?.base ?? m(e) : m(e)) => {
|
|
523
881
|
let o = c.get(e);
|
|
524
|
-
|
|
882
|
+
w(i)?.ensure?.().catch(() => {}), r(e, {
|
|
525
883
|
bind: "mod",
|
|
526
884
|
source: i,
|
|
527
885
|
transform: {
|
|
@@ -530,17 +888,17 @@ function fr({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
530
888
|
...i.startsWith("lfo") ? { rate: 1 } : {}
|
|
531
889
|
}
|
|
532
890
|
});
|
|
533
|
-
},
|
|
891
|
+
}, g = (e) => r(e, t(n[e]) ? n[e].transform?.base ?? m(e) : m(e)), _ = d.find((e) => !f(e)) ?? u.find((e) => !f(e));
|
|
534
892
|
return /* @__PURE__ */ $(q, {
|
|
535
893
|
label: "Inputs",
|
|
536
894
|
divided: !0,
|
|
537
|
-
children: [
|
|
538
|
-
size:
|
|
895
|
+
children: [p.map((e) => /* @__PURE__ */ Q(jn, {
|
|
896
|
+
size: o,
|
|
539
897
|
className: "w-full [&>button]:w-full",
|
|
540
898
|
groups: [{
|
|
541
899
|
id: "source",
|
|
542
900
|
label: "Source",
|
|
543
|
-
options:
|
|
901
|
+
options: Cr
|
|
544
902
|
}, {
|
|
545
903
|
id: "drives",
|
|
546
904
|
label: "Drives",
|
|
@@ -553,30 +911,30 @@ function fr({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
553
911
|
source: n[e].source,
|
|
554
912
|
drives: e
|
|
555
913
|
},
|
|
556
|
-
label: `${
|
|
914
|
+
label: `${Cr.find((t) => t.value === n[e].source)?.label} → ${c.get(e).label}`,
|
|
557
915
|
onChange: (t, r) => {
|
|
558
916
|
if (t === "source") {
|
|
559
|
-
r === "off" ?
|
|
917
|
+
r === "off" ? g(e) : h(e, r);
|
|
560
918
|
return;
|
|
561
919
|
}
|
|
562
920
|
if (r === e || f(r)) return;
|
|
563
921
|
let i = n[e].source;
|
|
564
|
-
|
|
922
|
+
g(e), h(r, i);
|
|
565
923
|
}
|
|
566
|
-
}, e)),
|
|
567
|
-
size:
|
|
924
|
+
}, e)), _ && /* @__PURE__ */ Q(K, {
|
|
925
|
+
size: o,
|
|
568
926
|
iconLeft: "plus",
|
|
569
927
|
className: "w-full",
|
|
570
|
-
onClick: () => _
|
|
928
|
+
onClick: () => h(_, "mouseX"),
|
|
571
929
|
children: "Add input"
|
|
572
930
|
})]
|
|
573
931
|
});
|
|
574
932
|
}
|
|
575
933
|
//#endregion
|
|
576
934
|
//#region src/editor/labs/ModelSource.jsx
|
|
577
|
-
var
|
|
578
|
-
function
|
|
579
|
-
let n =
|
|
935
|
+
var Er = /\.(obj|glb|gltf|stl)$/i, Dr = (e) => Er.test(e.key ?? e.name ?? ""), Or = (e) => (e.match(Er)?.[1] ?? "obj").toLowerCase(), kr = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
936
|
+
function Ar({ layer: e, setProp: t }) {
|
|
937
|
+
let n = a(), [r, i] = Z(!1), o = X(null), s = (e, n) => {
|
|
580
938
|
t("meshSrc", e), t("meshType", n);
|
|
581
939
|
};
|
|
582
940
|
return /* @__PURE__ */ $(q, {
|
|
@@ -585,7 +943,7 @@ function _r({ layer: e, setProp: t }) {
|
|
|
585
943
|
children: [
|
|
586
944
|
/* @__PURE__ */ Q("span", {
|
|
587
945
|
className: "kol-mono-12 text-meta truncate",
|
|
588
|
-
children:
|
|
946
|
+
children: kr(e.meshSrc)
|
|
589
947
|
}),
|
|
590
948
|
/* @__PURE__ */ $("div", {
|
|
591
949
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -597,12 +955,12 @@ function _r({ layer: e, setProp: t }) {
|
|
|
597
955
|
}), /* @__PURE__ */ Q(K, {
|
|
598
956
|
tone: "primary",
|
|
599
957
|
size: n,
|
|
600
|
-
onClick: () =>
|
|
958
|
+
onClick: () => o.current?.click(),
|
|
601
959
|
children: "Upload"
|
|
602
960
|
})]
|
|
603
961
|
}),
|
|
604
962
|
/* @__PURE__ */ Q("input", {
|
|
605
|
-
ref:
|
|
963
|
+
ref: o,
|
|
606
964
|
type: "file",
|
|
607
965
|
accept: ".obj,.glb,.gltf,.stl",
|
|
608
966
|
className: "hidden",
|
|
@@ -610,15 +968,15 @@ function _r({ layer: e, setProp: t }) {
|
|
|
610
968
|
let t = e.target.files?.[0];
|
|
611
969
|
if (e.target.value = "", !t) return;
|
|
612
970
|
let n = new FileReader();
|
|
613
|
-
n.onload = () => s(n.result,
|
|
971
|
+
n.onload = () => s(n.result, Or(t.name)), n.readAsDataURL(t);
|
|
614
972
|
}
|
|
615
973
|
}),
|
|
616
|
-
/* @__PURE__ */ Q(
|
|
974
|
+
/* @__PURE__ */ Q(en, {
|
|
617
975
|
open: r,
|
|
618
|
-
accept:
|
|
976
|
+
accept: Dr,
|
|
619
977
|
onClose: () => i(!1),
|
|
620
978
|
onSelect: (e) => {
|
|
621
|
-
i(!1), s(wn(e),
|
|
979
|
+
i(!1), s(wn(e), Or(e));
|
|
622
980
|
}
|
|
623
981
|
})
|
|
624
982
|
]
|
|
@@ -626,23 +984,23 @@ function _r({ layer: e, setProp: t }) {
|
|
|
626
984
|
}
|
|
627
985
|
//#endregion
|
|
628
986
|
//#region src/editor/labs/useLabsKeys.js
|
|
629
|
-
function
|
|
987
|
+
function jr(e, t) {
|
|
630
988
|
Y(() => {
|
|
631
989
|
let n = (n) => {
|
|
632
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
990
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || Pt(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
633
991
|
};
|
|
634
992
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
635
993
|
});
|
|
636
994
|
}
|
|
637
995
|
//#endregion
|
|
638
996
|
//#region src/editor/labs/LabsParams.jsx
|
|
639
|
-
var
|
|
997
|
+
var Mr = [{
|
|
640
998
|
value: "effect",
|
|
641
999
|
label: "Effect"
|
|
642
1000
|
}, {
|
|
643
1001
|
value: "anim",
|
|
644
1002
|
label: "Motion"
|
|
645
|
-
}],
|
|
1003
|
+
}], Nr = [
|
|
646
1004
|
{
|
|
647
1005
|
value: "generate",
|
|
648
1006
|
label: "Generate"
|
|
@@ -655,7 +1013,7 @@ var yr = [{
|
|
|
655
1013
|
value: "anim",
|
|
656
1014
|
label: "Animation"
|
|
657
1015
|
}
|
|
658
|
-
],
|
|
1016
|
+
], Pr = [
|
|
659
1017
|
{
|
|
660
1018
|
value: "generate",
|
|
661
1019
|
label: "Gen"
|
|
@@ -669,11 +1027,11 @@ var yr = [{
|
|
|
669
1027
|
label: "Anim"
|
|
670
1028
|
}
|
|
671
1029
|
];
|
|
672
|
-
function
|
|
673
|
-
let s =
|
|
674
|
-
return e?.length ?
|
|
1030
|
+
function Fr({ options: e, active: t, onPick: n, spread: i = !1, pills: o = !1 }) {
|
|
1031
|
+
let s = a();
|
|
1032
|
+
return e?.length ? o ? /* @__PURE__ */ Q("div", {
|
|
675
1033
|
className: "flex items-center gap-1 flex-wrap",
|
|
676
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1034
|
+
children: e.map((e) => /* @__PURE__ */ Q(Pn, {
|
|
677
1035
|
size: "xs",
|
|
678
1036
|
hash: !1,
|
|
679
1037
|
active: e.value === t,
|
|
@@ -690,27 +1048,27 @@ function Sr({ options: e, active: t, onPick: n, spread: i = !1, pills: a = !1 })
|
|
|
690
1048
|
className: r(s)
|
|
691
1049
|
}) : null;
|
|
692
1050
|
}
|
|
693
|
-
function
|
|
694
|
-
let { undo: e, redo: t, canUndo: n, canRedo: r } =
|
|
1051
|
+
function Ir() {
|
|
1052
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = i(), o = a(), s = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
695
1053
|
"aria-hidden": "true",
|
|
696
1054
|
className: "invisible pointer-events-none",
|
|
697
1055
|
children: t
|
|
698
1056
|
});
|
|
699
|
-
return /* @__PURE__ */ $(
|
|
1057
|
+
return /* @__PURE__ */ $(Hn, { children: [s(n, /* @__PURE__ */ Q(In, {
|
|
700
1058
|
label: "Undo",
|
|
701
1059
|
shortcut: "⌘Z",
|
|
702
1060
|
children: /* @__PURE__ */ Q(K, {
|
|
703
|
-
size:
|
|
1061
|
+
size: o,
|
|
704
1062
|
iconOnly: "arrow-left",
|
|
705
1063
|
"aria-label": "Undo",
|
|
706
1064
|
tabIndex: n ? void 0 : -1,
|
|
707
1065
|
onClick: e
|
|
708
1066
|
})
|
|
709
|
-
})), s(r, /* @__PURE__ */ Q(
|
|
1067
|
+
})), s(r, /* @__PURE__ */ Q(In, {
|
|
710
1068
|
label: "Redo",
|
|
711
1069
|
shortcut: "⇧⌘Z",
|
|
712
1070
|
children: /* @__PURE__ */ Q(K, {
|
|
713
|
-
size:
|
|
1071
|
+
size: o,
|
|
714
1072
|
iconOnly: "arrow-right",
|
|
715
1073
|
"aria-label": "Redo",
|
|
716
1074
|
tabIndex: r ? void 0 : -1,
|
|
@@ -718,8 +1076,8 @@ function Cr() {
|
|
|
718
1076
|
})
|
|
719
1077
|
}))] });
|
|
720
1078
|
}
|
|
721
|
-
function
|
|
722
|
-
let m =
|
|
1079
|
+
function Lr({ chips: e, active: t, onPick: r, spread: i, pills: o, title: s, tabStrip: c, preStrip: l, fx: u = !1, scope: d, ghostLabels: f, children: p }) {
|
|
1080
|
+
let m = a() === "sm";
|
|
723
1081
|
return /* @__PURE__ */ $("div", {
|
|
724
1082
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
725
1083
|
"data-label-scope": d,
|
|
@@ -729,14 +1087,14 @@ function wr({ chips: e, active: t, onPick: r, spread: i, pills: a, title: s, tab
|
|
|
729
1087
|
children: [/* @__PURE__ */ Q("p", {
|
|
730
1088
|
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
731
1089
|
children: s
|
|
732
|
-
}), /* @__PURE__ */ Q(
|
|
1090
|
+
}), /* @__PURE__ */ Q(Ir, {})]
|
|
733
1091
|
}),
|
|
734
|
-
e && /* @__PURE__ */ Q(
|
|
1092
|
+
e && /* @__PURE__ */ Q(Fr, {
|
|
735
1093
|
options: e,
|
|
736
1094
|
active: t,
|
|
737
1095
|
onPick: r,
|
|
738
1096
|
spread: i,
|
|
739
|
-
pills:
|
|
1097
|
+
pills: o
|
|
740
1098
|
}),
|
|
741
1099
|
l,
|
|
742
1100
|
c,
|
|
@@ -753,27 +1111,27 @@ function wr({ chips: e, active: t, onPick: r, spread: i, pills: a, title: s, tab
|
|
|
753
1111
|
]
|
|
754
1112
|
});
|
|
755
1113
|
}
|
|
756
|
-
function
|
|
757
|
-
let
|
|
1114
|
+
function Rr({ layer: e, showMod: t }) {
|
|
1115
|
+
let o = p(), s = a(), [c, l] = Z("effect");
|
|
758
1116
|
Y(() => {
|
|
759
1117
|
let e = () => l("effect");
|
|
760
1118
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
761
1119
|
}, []);
|
|
762
|
-
let { addFilter: u, replaceFilter:
|
|
1120
|
+
let { addFilter: u, replaceFilter: f, removeFilter: m, toggleFilter: _, updateLayer: v, palette: y } = i(), b = te(e.id, { history: "coalesce" }), S = h(e), C = S.findIndex((e) => !e.def?.first), w = C < 0 ? S.length : C, E = C < 0 ? null : S[C], O = oe(L).find((e) => e.id === B(E?.id)), k = O?.id === "halftone", M = k ? (O?.filters ?? []).map((e) => ({
|
|
763
1121
|
value: e.id,
|
|
764
1122
|
label: e.label
|
|
765
|
-
})) : null,
|
|
1123
|
+
})) : null, ne = !k && E ? E.def.label : null, N = (t) => {
|
|
766
1124
|
if (!E) {
|
|
767
1125
|
u(e.id, t);
|
|
768
1126
|
return;
|
|
769
1127
|
}
|
|
770
|
-
t !== E.id &&
|
|
771
|
-
},
|
|
1128
|
+
t !== E.id && f(e.id, w, t);
|
|
1129
|
+
}, P = S.map(({ def: e, ...t }) => t), F = E ? {
|
|
772
1130
|
...e,
|
|
773
1131
|
...E.params,
|
|
774
1132
|
id: e.id
|
|
775
|
-
} : e,
|
|
776
|
-
let r =
|
|
1133
|
+
} : e, I = (e) => (t, n) => {
|
|
1134
|
+
let r = P.map((r, i) => i === e ? {
|
|
777
1135
|
...r,
|
|
778
1136
|
params: {
|
|
779
1137
|
...r.params,
|
|
@@ -781,12 +1139,12 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
781
1139
|
}
|
|
782
1140
|
} : r);
|
|
783
1141
|
b.patch({ filters: r });
|
|
784
|
-
},
|
|
785
|
-
layer:
|
|
1142
|
+
}, R = I(w), ie = t ? (e) => /* @__PURE__ */ Q(at, {
|
|
1143
|
+
layer: F,
|
|
786
1144
|
param: e,
|
|
787
|
-
setProp:
|
|
788
|
-
}) : void 0,
|
|
789
|
-
let n =
|
|
1145
|
+
setProp: R
|
|
1146
|
+
}) : void 0, z = (t) => {
|
|
1147
|
+
let n = P.map((e, n) => n === w ? {
|
|
790
1148
|
...e,
|
|
791
1149
|
params: {
|
|
792
1150
|
...e.params,
|
|
@@ -795,60 +1153,60 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
795
1153
|
} : e);
|
|
796
1154
|
v(e.id, { filters: n });
|
|
797
1155
|
};
|
|
798
|
-
|
|
799
|
-
E && v(e.id, { filters:
|
|
1156
|
+
jr(() => {
|
|
1157
|
+
E && v(e.id, { filters: P.map((e, t) => t === 0 ? {
|
|
800
1158
|
...e,
|
|
801
1159
|
params: {}
|
|
802
1160
|
} : e) });
|
|
803
1161
|
}, () => {
|
|
804
|
-
E &&
|
|
1162
|
+
E && z(d(F, x(E.def.params, F), T()));
|
|
805
1163
|
});
|
|
806
|
-
let
|
|
807
|
-
if (
|
|
1164
|
+
let V = e.fxGroup ? se.find((t) => t.id === e.fxGroup) : null;
|
|
1165
|
+
if (V) {
|
|
808
1166
|
let n = {
|
|
809
|
-
chain:
|
|
1167
|
+
chain: S,
|
|
810
1168
|
layer: e,
|
|
811
|
-
hostView:
|
|
812
|
-
toggleFilter:
|
|
1169
|
+
hostView: F,
|
|
1170
|
+
toggleFilter: _,
|
|
813
1171
|
removeFilter: m,
|
|
814
|
-
setStagePropAt:
|
|
1172
|
+
setStagePropAt: I,
|
|
815
1173
|
palette: y,
|
|
816
1174
|
showMod: t
|
|
817
1175
|
}, i = [{
|
|
818
1176
|
value: "",
|
|
819
1177
|
label: "Add effect…"
|
|
820
|
-
}, ...
|
|
1178
|
+
}, ...re(V, L).map((e) => ({
|
|
821
1179
|
value: e.id,
|
|
822
1180
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
823
1181
|
}))];
|
|
824
|
-
return /* @__PURE__ */ $(
|
|
1182
|
+
return /* @__PURE__ */ $(Lr, {
|
|
825
1183
|
title: "Effects",
|
|
826
1184
|
fx: !0,
|
|
827
1185
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
828
1186
|
tone: "sunken",
|
|
829
1187
|
value: c,
|
|
830
1188
|
onChange: l,
|
|
831
|
-
options:
|
|
1189
|
+
options: Mr,
|
|
832
1190
|
size: s,
|
|
833
1191
|
className: r(s)
|
|
834
1192
|
}),
|
|
835
|
-
children: [c === "effect" && /* @__PURE__ */ $(
|
|
1193
|
+
children: [c === "effect" && /* @__PURE__ */ $(Hn, { children: [
|
|
836
1194
|
/* @__PURE__ */ $(q, {
|
|
837
1195
|
label: "Effect stack",
|
|
838
1196
|
divided: !0,
|
|
839
|
-
children: [
|
|
1197
|
+
children: [S.length === 0 && /* @__PURE__ */ Q(j, {
|
|
840
1198
|
className: "kol-mono-10 text-meta",
|
|
841
1199
|
children: "No effects yet — add one below."
|
|
842
|
-
}), /* @__PURE__ */ Q(
|
|
1200
|
+
}), /* @__PURE__ */ Q(Hr, {
|
|
843
1201
|
...n,
|
|
844
1202
|
from: 0
|
|
845
1203
|
})]
|
|
846
1204
|
}),
|
|
847
|
-
/* @__PURE__ */ Q(
|
|
848
|
-
|
|
849
|
-
label:
|
|
1205
|
+
/* @__PURE__ */ Q(kn, {}),
|
|
1206
|
+
S.length < 8 && /* @__PURE__ */ Q(q, {
|
|
1207
|
+
label: V.label,
|
|
850
1208
|
divided: !0,
|
|
851
|
-
children: /* @__PURE__ */ Q(
|
|
1209
|
+
children: /* @__PURE__ */ Q(An, {
|
|
852
1210
|
variant: "subtle",
|
|
853
1211
|
size: s,
|
|
854
1212
|
className: "w-full",
|
|
@@ -859,15 +1217,15 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
859
1217
|
}
|
|
860
1218
|
})
|
|
861
1219
|
})
|
|
862
|
-
] }), c === "anim" && E?.def?.sweeps && /* @__PURE__ */ Q(
|
|
1220
|
+
] }), c === "anim" && E?.def?.sweeps && /* @__PURE__ */ Q(st, {
|
|
863
1221
|
sweeps: Array.isArray(E.params.sweeps) ? E.params.sweeps : [],
|
|
864
|
-
onChange: (e) =>
|
|
1222
|
+
onChange: (e) => R("sweeps", e),
|
|
865
1223
|
inline: !0
|
|
866
1224
|
})]
|
|
867
1225
|
});
|
|
868
1226
|
}
|
|
869
|
-
if (!E) return /* @__PURE__ */ Q(
|
|
870
|
-
chips:
|
|
1227
|
+
if (!E) return /* @__PURE__ */ Q(Lr, {
|
|
1228
|
+
chips: M,
|
|
871
1229
|
active: null,
|
|
872
1230
|
onPick: N,
|
|
873
1231
|
spread: k,
|
|
@@ -876,16 +1234,16 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
876
1234
|
tone: "sunken",
|
|
877
1235
|
value: c,
|
|
878
1236
|
onChange: l,
|
|
879
|
-
options:
|
|
1237
|
+
options: Mr,
|
|
880
1238
|
size: s,
|
|
881
1239
|
className: r(s)
|
|
882
1240
|
}),
|
|
883
|
-
children: /* @__PURE__ */ Q(
|
|
884
|
-
schema:
|
|
1241
|
+
children: /* @__PURE__ */ Q(A, {
|
|
1242
|
+
schema: tn,
|
|
885
1243
|
layer: e,
|
|
886
1244
|
setProp: b.setProp,
|
|
887
1245
|
palette: y,
|
|
888
|
-
renderAnimate: (t) => /* @__PURE__ */ Q(
|
|
1246
|
+
renderAnimate: (t) => /* @__PURE__ */ Q(at, {
|
|
889
1247
|
layer: e,
|
|
890
1248
|
param: t,
|
|
891
1249
|
setProp: b.setProp
|
|
@@ -894,28 +1252,28 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
894
1252
|
emptyHint: "Pick an effect from the nav."
|
|
895
1253
|
})
|
|
896
1254
|
});
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
899
|
-
let e =
|
|
900
|
-
for (; e + 1 <
|
|
901
|
-
|
|
1255
|
+
let H = E.def.params.filter((e) => D(e) !== "anim"), U = ae(E.def.id), le = U ? H.findIndex((e) => e.key === U) : -1, ue = H.length;
|
|
1256
|
+
if (le >= 0) {
|
|
1257
|
+
let e = le;
|
|
1258
|
+
for (; e + 1 < H.length && H[e + 1].type === "select";) e++;
|
|
1259
|
+
ue = e + 1;
|
|
902
1260
|
}
|
|
903
|
-
let
|
|
1261
|
+
let W = le > 0 ? H.slice(0, le) : [], fe = le >= 0 ? H.slice(le, ue).map((e) => ({
|
|
904
1262
|
...e,
|
|
905
1263
|
section: void 0
|
|
906
|
-
})) :
|
|
907
|
-
layer:
|
|
908
|
-
setProp:
|
|
1264
|
+
})) : H, pe = {
|
|
1265
|
+
layer: F,
|
|
1266
|
+
setProp: R,
|
|
909
1267
|
palette: y,
|
|
910
|
-
renderAnimate:
|
|
1268
|
+
renderAnimate: ie,
|
|
911
1269
|
inline: !0
|
|
912
1270
|
};
|
|
913
|
-
return /* @__PURE__ */ $(
|
|
914
|
-
chips:
|
|
1271
|
+
return /* @__PURE__ */ $(Lr, {
|
|
1272
|
+
chips: M,
|
|
915
1273
|
active: E.id,
|
|
916
1274
|
onPick: N,
|
|
917
1275
|
spread: k,
|
|
918
|
-
title:
|
|
1276
|
+
title: ne,
|
|
919
1277
|
fx: !0,
|
|
920
1278
|
scope: E.id,
|
|
921
1279
|
ghostLabels: E.def.params.map((e) => e.label).filter(Boolean),
|
|
@@ -923,45 +1281,45 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
923
1281
|
tone: "sunken",
|
|
924
1282
|
value: c,
|
|
925
1283
|
onChange: l,
|
|
926
|
-
options:
|
|
1284
|
+
options: Mr,
|
|
927
1285
|
size: s,
|
|
928
1286
|
className: r(s)
|
|
929
1287
|
}),
|
|
930
|
-
children: [c === "effect" && /* @__PURE__ */ $(
|
|
931
|
-
|
|
932
|
-
schema:
|
|
933
|
-
...
|
|
1288
|
+
children: [c === "effect" && /* @__PURE__ */ $(Hn, { children: [
|
|
1289
|
+
W.length > 0 && /* @__PURE__ */ Q(A, {
|
|
1290
|
+
schema: W,
|
|
1291
|
+
...pe
|
|
934
1292
|
}),
|
|
935
1293
|
/* @__PURE__ */ $(q, {
|
|
936
1294
|
divided: !0,
|
|
937
|
-
children: [/* @__PURE__ */ Q(
|
|
938
|
-
schema:
|
|
939
|
-
...
|
|
940
|
-
}), /* @__PURE__ */ Q(
|
|
1295
|
+
children: [/* @__PURE__ */ Q(A, {
|
|
1296
|
+
schema: fe,
|
|
1297
|
+
...pe
|
|
1298
|
+
}), /* @__PURE__ */ Q(ot, {
|
|
941
1299
|
inline: !0,
|
|
942
1300
|
def: E.def,
|
|
943
|
-
view:
|
|
1301
|
+
view: F,
|
|
944
1302
|
tab: "effect",
|
|
945
|
-
onPatch:
|
|
946
|
-
levels: /* @__PURE__ */ $(
|
|
1303
|
+
onPatch: z,
|
|
1304
|
+
levels: /* @__PURE__ */ $(Hn, { children: [
|
|
947
1305
|
[
|
|
948
1306
|
["type", "Type"],
|
|
949
1307
|
["category", "Category"],
|
|
950
1308
|
["preset", "Preset"]
|
|
951
|
-
].filter(([e]) =>
|
|
1309
|
+
].filter(([e]) => _e(E.def, e)).map(([t, n]) => /* @__PURE__ */ Q(K, {
|
|
952
1310
|
tone: "primary",
|
|
953
1311
|
size: s,
|
|
954
1312
|
className: "flex-1 min-w-0",
|
|
955
1313
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
956
1314
|
onClick: () => {
|
|
957
|
-
let n =
|
|
1315
|
+
let n = g(T() >>> 0);
|
|
958
1316
|
if (t === "preset") {
|
|
959
|
-
let e =
|
|
960
|
-
e != null &&
|
|
1317
|
+
let e = de(E.def, F, n);
|
|
1318
|
+
e != null && z(ce(E.def, e));
|
|
961
1319
|
return;
|
|
962
1320
|
}
|
|
963
|
-
let r =
|
|
964
|
-
r &&
|
|
1321
|
+
let r = me(E.id, t, n);
|
|
1322
|
+
r && f(e.id, w, r);
|
|
965
1323
|
},
|
|
966
1324
|
children: n
|
|
967
1325
|
}, t)),
|
|
@@ -971,50 +1329,50 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
971
1329
|
className: "flex-1 min-w-0",
|
|
972
1330
|
"aria-label": "Randomize settings",
|
|
973
1331
|
onClick: () => {
|
|
974
|
-
|
|
1332
|
+
z(he(F, x(E.def.params.filter((e) => D(e) !== "anim"), F), g(T() >>> 0)));
|
|
975
1333
|
},
|
|
976
1334
|
children: "Settings"
|
|
977
1335
|
}),
|
|
978
|
-
/* @__PURE__ */ Q(
|
|
1336
|
+
/* @__PURE__ */ Q(Se, {
|
|
979
1337
|
def: E.def,
|
|
980
1338
|
isFilter: !0
|
|
981
1339
|
})
|
|
982
1340
|
] })
|
|
983
1341
|
})]
|
|
984
1342
|
}),
|
|
985
|
-
/* @__PURE__ */ Q(
|
|
986
|
-
|
|
987
|
-
schema:
|
|
988
|
-
...
|
|
989
|
-
}), /* @__PURE__ */ Q(
|
|
990
|
-
/* @__PURE__ */ Q(
|
|
991
|
-
chain:
|
|
1343
|
+
/* @__PURE__ */ Q(kn, {}),
|
|
1344
|
+
ue < H.length && /* @__PURE__ */ $(Hn, { children: [/* @__PURE__ */ Q(A, {
|
|
1345
|
+
schema: H.slice(ue),
|
|
1346
|
+
...pe
|
|
1347
|
+
}), /* @__PURE__ */ Q(kn, {})] }),
|
|
1348
|
+
/* @__PURE__ */ Q(Ur, {
|
|
1349
|
+
chain: S,
|
|
992
1350
|
from: w + 1,
|
|
993
1351
|
layer: e,
|
|
994
|
-
hostView:
|
|
1352
|
+
hostView: F,
|
|
995
1353
|
addFilter: u,
|
|
996
1354
|
removeFilter: m,
|
|
997
|
-
toggleFilter:
|
|
998
|
-
setStagePropAt:
|
|
1355
|
+
toggleFilter: _,
|
|
1356
|
+
setStagePropAt: I,
|
|
999
1357
|
palette: y,
|
|
1000
1358
|
showMod: t
|
|
1001
1359
|
})
|
|
1002
|
-
] }), c === "anim" && /* @__PURE__ */ $(
|
|
1003
|
-
/* @__PURE__ */ Q(
|
|
1360
|
+
] }), c === "anim" && /* @__PURE__ */ $(Hn, { children: [
|
|
1361
|
+
/* @__PURE__ */ Q(Tr, {
|
|
1004
1362
|
schema: E.def.params,
|
|
1005
|
-
layer:
|
|
1006
|
-
setProp:
|
|
1363
|
+
layer: F,
|
|
1364
|
+
setProp: R,
|
|
1007
1365
|
inputs: E.def.inputs
|
|
1008
1366
|
}),
|
|
1009
|
-
/* @__PURE__ */ Q(
|
|
1367
|
+
/* @__PURE__ */ Q(A, {
|
|
1010
1368
|
schema: E.def.params,
|
|
1011
|
-
...
|
|
1369
|
+
...pe,
|
|
1012
1370
|
tab: "anim"
|
|
1013
1371
|
}),
|
|
1014
1372
|
E.def.orbit && /* @__PURE__ */ Q(q, {
|
|
1015
1373
|
label: "Interaction",
|
|
1016
1374
|
divided: !0,
|
|
1017
|
-
children: /* @__PURE__ */ Q(
|
|
1375
|
+
children: /* @__PURE__ */ Q(Mn, {
|
|
1018
1376
|
label: "ORBIT (C)",
|
|
1019
1377
|
align: "fill",
|
|
1020
1378
|
labelWidth: n,
|
|
@@ -1022,7 +1380,7 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
1022
1380
|
tone: "sunken",
|
|
1023
1381
|
size: s,
|
|
1024
1382
|
className: "w-full",
|
|
1025
|
-
value:
|
|
1383
|
+
value: o.grab && F.orbit !== !1 ? "on" : "off",
|
|
1026
1384
|
options: [{
|
|
1027
1385
|
value: "off",
|
|
1028
1386
|
label: "Off"
|
|
@@ -1031,54 +1389,54 @@ function Tr({ layer: e, showMod: t }) {
|
|
|
1031
1389
|
label: "On"
|
|
1032
1390
|
}],
|
|
1033
1391
|
onChange: (e) => {
|
|
1034
|
-
|
|
1392
|
+
R("orbit", e === "on"), e === "on" && !o.grab && ee("grab", !0);
|
|
1035
1393
|
}
|
|
1036
1394
|
})
|
|
1037
1395
|
})
|
|
1038
1396
|
}),
|
|
1039
1397
|
/* @__PURE__ */ Q(q, {
|
|
1040
1398
|
divided: !0,
|
|
1041
|
-
children: /* @__PURE__ */ Q(
|
|
1399
|
+
children: /* @__PURE__ */ Q(ot, {
|
|
1042
1400
|
inline: !0,
|
|
1043
1401
|
def: E.def,
|
|
1044
|
-
view:
|
|
1402
|
+
view: F,
|
|
1045
1403
|
tab: "anim",
|
|
1046
|
-
onPatch:
|
|
1404
|
+
onPatch: z
|
|
1047
1405
|
})
|
|
1048
1406
|
}),
|
|
1049
|
-
E.def.sweeps && /* @__PURE__ */ Q(
|
|
1407
|
+
E.def.sweeps && /* @__PURE__ */ Q(st, {
|
|
1050
1408
|
sweeps: Array.isArray(E.params.sweeps) ? E.params.sweeps : [],
|
|
1051
|
-
onChange: (e) =>
|
|
1409
|
+
onChange: (e) => R("sweeps", e),
|
|
1052
1410
|
inline: !0
|
|
1053
1411
|
}),
|
|
1054
|
-
/* @__PURE__ */ Q(
|
|
1412
|
+
/* @__PURE__ */ Q(Sr, {
|
|
1055
1413
|
schema: E.def.params,
|
|
1056
|
-
layer:
|
|
1057
|
-
setProp:
|
|
1414
|
+
layer: F,
|
|
1415
|
+
setProp: R
|
|
1058
1416
|
}),
|
|
1059
|
-
/* @__PURE__ */ Q(
|
|
1060
|
-
chain:
|
|
1417
|
+
/* @__PURE__ */ Q(Vr, {
|
|
1418
|
+
chain: S,
|
|
1061
1419
|
layer: e,
|
|
1062
|
-
hostView:
|
|
1420
|
+
hostView: F,
|
|
1063
1421
|
addFilter: u,
|
|
1064
1422
|
removeFilter: m,
|
|
1065
|
-
setStagePropAt:
|
|
1423
|
+
setStagePropAt: I,
|
|
1066
1424
|
palette: y,
|
|
1067
1425
|
showMod: t
|
|
1068
1426
|
})
|
|
1069
1427
|
] })]
|
|
1070
1428
|
});
|
|
1071
1429
|
}
|
|
1072
|
-
var
|
|
1073
|
-
function
|
|
1074
|
-
let { addFilter:
|
|
1075
|
-
return /* @__PURE__ */ Q(
|
|
1430
|
+
var zr = L.filter((e) => !e.kind && !e.first);
|
|
1431
|
+
function Br({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1432
|
+
let { addFilter: a, removeFilter: o, toggleFilter: s } = i(), c = h(e), l = c.map(({ def: e, ...t }) => t);
|
|
1433
|
+
return /* @__PURE__ */ Q(Ur, {
|
|
1076
1434
|
chain: c,
|
|
1077
1435
|
from: 0,
|
|
1078
|
-
filters:
|
|
1436
|
+
filters: zr,
|
|
1079
1437
|
layer: e,
|
|
1080
1438
|
hostView: e,
|
|
1081
|
-
addFilter:
|
|
1439
|
+
addFilter: a,
|
|
1082
1440
|
removeFilter: o,
|
|
1083
1441
|
toggleFilter: s,
|
|
1084
1442
|
setStagePropAt: (e) => (n, r) => t.patch({ filters: l.map((t, i) => i === e ? {
|
|
@@ -1092,22 +1450,22 @@ function Dr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1092
1450
|
showMod: r
|
|
1093
1451
|
});
|
|
1094
1452
|
}
|
|
1095
|
-
function
|
|
1096
|
-
let l =
|
|
1453
|
+
function Vr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: o, palette: s, showMod: c }) {
|
|
1454
|
+
let l = a(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1097
1455
|
...n,
|
|
1098
1456
|
...d.params,
|
|
1099
1457
|
id: t.id
|
|
1100
|
-
} : null, p = d ?
|
|
1458
|
+
} : null, p = d ? o(u) : null;
|
|
1101
1459
|
return /* @__PURE__ */ Q(q, {
|
|
1102
1460
|
label: "Media",
|
|
1103
1461
|
divided: !0,
|
|
1104
|
-
children: d?.def ? /* @__PURE__ */ $(
|
|
1462
|
+
children: d?.def ? /* @__PURE__ */ $(Hn, { children: [/* @__PURE__ */ Q(A, {
|
|
1105
1463
|
schema: d.def.params,
|
|
1106
1464
|
layer: f,
|
|
1107
1465
|
setProp: p,
|
|
1108
1466
|
palette: s,
|
|
1109
1467
|
inline: !0,
|
|
1110
|
-
renderAnimate: c ? (e) => /* @__PURE__ */ Q(
|
|
1468
|
+
renderAnimate: c ? (e) => /* @__PURE__ */ Q(at, {
|
|
1111
1469
|
layer: f,
|
|
1112
1470
|
param: e,
|
|
1113
1471
|
setProp: p
|
|
@@ -1131,10 +1489,10 @@ function Or({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1131
1489
|
})
|
|
1132
1490
|
});
|
|
1133
1491
|
}
|
|
1134
|
-
function
|
|
1135
|
-
let u =
|
|
1136
|
-
return e.slice(t).map((e,
|
|
1137
|
-
let d =
|
|
1492
|
+
function Hr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
|
|
1493
|
+
let u = a();
|
|
1494
|
+
return e.slice(t).map((e, a) => {
|
|
1495
|
+
let d = a + t, f = e.enabled !== !1, p = {
|
|
1138
1496
|
...r,
|
|
1139
1497
|
...e.params,
|
|
1140
1498
|
id: n.id
|
|
@@ -1143,12 +1501,12 @@ function kr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1143
1501
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1144
1502
|
children: [/* @__PURE__ */ $("div", {
|
|
1145
1503
|
className: "flex items-center gap-2",
|
|
1146
|
-
children: [/* @__PURE__ */ Q(
|
|
1504
|
+
children: [/* @__PURE__ */ Q(Fn, {
|
|
1147
1505
|
size: u,
|
|
1148
1506
|
checked: f,
|
|
1149
1507
|
onChange: () => i(n.id, d),
|
|
1150
1508
|
label: e.def?.label ?? e.id
|
|
1151
|
-
}), /* @__PURE__ */ Q(
|
|
1509
|
+
}), /* @__PURE__ */ Q(In, {
|
|
1152
1510
|
asChild: !0,
|
|
1153
1511
|
label: "Delete effect",
|
|
1154
1512
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1158,16 +1516,16 @@ function kr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1158
1516
|
iconOnly: "x",
|
|
1159
1517
|
"aria-label": "Delete effect",
|
|
1160
1518
|
className: "ml-auto shrink-0",
|
|
1161
|
-
onClick: () =>
|
|
1519
|
+
onClick: () => o(n.id, d)
|
|
1162
1520
|
})
|
|
1163
1521
|
})]
|
|
1164
|
-
}), f && e.def && /* @__PURE__ */ Q(
|
|
1522
|
+
}), f && e.def && /* @__PURE__ */ Q(A, {
|
|
1165
1523
|
schema: e.def.params.filter((e) => D(e) !== "anim"),
|
|
1166
1524
|
layer: p,
|
|
1167
1525
|
setProp: m,
|
|
1168
1526
|
palette: c,
|
|
1169
1527
|
inline: !0,
|
|
1170
|
-
renderAnimate: l ? (e) => /* @__PURE__ */ Q(
|
|
1528
|
+
renderAnimate: l ? (e) => /* @__PURE__ */ Q(at, {
|
|
1171
1529
|
layer: p,
|
|
1172
1530
|
param: e,
|
|
1173
1531
|
setProp: m
|
|
@@ -1176,18 +1534,18 @@ function kr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1176
1534
|
}, e.key ?? d);
|
|
1177
1535
|
});
|
|
1178
1536
|
}
|
|
1179
|
-
function
|
|
1180
|
-
let f =
|
|
1537
|
+
function Ur({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: o, removeFilter: s, toggleFilter: c, setStagePropAt: l, palette: u, showMod: d }) {
|
|
1538
|
+
let f = a(), p = [{
|
|
1181
1539
|
value: "",
|
|
1182
1540
|
label: "Add FX…"
|
|
1183
|
-
}, ...(n ?? L
|
|
1541
|
+
}, ...(n ?? I(L)).map((e) => ({
|
|
1184
1542
|
value: e.id,
|
|
1185
1543
|
label: e.label ?? e.id
|
|
1186
1544
|
}))];
|
|
1187
1545
|
return /* @__PURE__ */ $(q, {
|
|
1188
1546
|
label: "Post-Processing",
|
|
1189
1547
|
divided: !0,
|
|
1190
|
-
children: [/* @__PURE__ */ Q(
|
|
1548
|
+
children: [/* @__PURE__ */ Q(Hr, {
|
|
1191
1549
|
chain: e,
|
|
1192
1550
|
from: t,
|
|
1193
1551
|
layer: r,
|
|
@@ -1197,61 +1555,61 @@ function Ar({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1197
1555
|
setStagePropAt: l,
|
|
1198
1556
|
palette: u,
|
|
1199
1557
|
showMod: d
|
|
1200
|
-
}), e.length < 8 && /* @__PURE__ */ Q(
|
|
1558
|
+
}), e.length < 8 && /* @__PURE__ */ Q(An, {
|
|
1201
1559
|
variant: "subtle",
|
|
1202
1560
|
size: f,
|
|
1203
1561
|
className: "w-full",
|
|
1204
1562
|
options: p,
|
|
1205
1563
|
value: "",
|
|
1206
1564
|
onChange: (e) => {
|
|
1207
|
-
e &&
|
|
1565
|
+
e && o(r.id, e);
|
|
1208
1566
|
}
|
|
1209
1567
|
})]
|
|
1210
1568
|
});
|
|
1211
1569
|
}
|
|
1212
|
-
function
|
|
1213
|
-
let
|
|
1570
|
+
function Wr({ layer: e, showMod: t, tree: n }) {
|
|
1571
|
+
let o = a(), [s, c] = Z("generate"), { updateLayer: l, palette: u } = i(), { setOnly: f } = W(), p = te(e.id, { history: "coalesce" }), m = N(e.loopGroup).find((t) => t.id === e.presetId), h = P(e.loopGroup), g = (n ?? we).find((t) => t.groups.includes(e.loopGroup)), _ = g?.labels?.[e.loopGroup] ?? h?.label ?? "", v = g && g.label !== _ ? `${g.label} / ${_}` : _, y = e.loopGroup === "paratype" && m?.sub === "Glyphs" ? ne("paratype", "Glyphs") : null, b = y ? y.map((e) => ({
|
|
1214
1572
|
value: e.id,
|
|
1215
1573
|
label: e.label
|
|
1216
|
-
})) : null,
|
|
1574
|
+
})) : null, S = (t) => {
|
|
1217
1575
|
let n = y?.find((e) => e.id === t);
|
|
1218
|
-
n && t !== e.presetId &&
|
|
1219
|
-
},
|
|
1220
|
-
m &&
|
|
1576
|
+
n && t !== e.presetId && f(e.type, H(n, e.loopGroup));
|
|
1577
|
+
}, C = () => {
|
|
1578
|
+
m && f(e.type, H(m, e.loopGroup));
|
|
1221
1579
|
};
|
|
1222
|
-
return
|
|
1223
|
-
let t =
|
|
1224
|
-
l(e.id,
|
|
1225
|
-
}), /* @__PURE__ */ $(
|
|
1580
|
+
return jr(C, () => {
|
|
1581
|
+
let t = U(e.loopId)?.params ?? [];
|
|
1582
|
+
l(e.id, d(e, x(t, e), T(), { withFilters: !0 }));
|
|
1583
|
+
}), /* @__PURE__ */ $(Lr, {
|
|
1226
1584
|
title: v,
|
|
1227
1585
|
chips: b,
|
|
1228
1586
|
active: e.presetId,
|
|
1229
|
-
onPick:
|
|
1587
|
+
onPick: S,
|
|
1230
1588
|
pills: !0,
|
|
1231
1589
|
scope: e.loopId,
|
|
1232
|
-
ghostLabels: (
|
|
1590
|
+
ghostLabels: (U(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1233
1591
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1234
1592
|
tone: "sunken",
|
|
1235
1593
|
value: s,
|
|
1236
1594
|
onChange: c,
|
|
1237
|
-
options:
|
|
1238
|
-
size:
|
|
1239
|
-
className: r(
|
|
1595
|
+
options: o === "sm" ? Nr : Pr,
|
|
1596
|
+
size: o,
|
|
1597
|
+
className: r(o)
|
|
1240
1598
|
}),
|
|
1241
1599
|
children: [
|
|
1242
|
-
s === "anim" && /* @__PURE__ */ Q(
|
|
1243
|
-
schema:
|
|
1600
|
+
s === "anim" && /* @__PURE__ */ Q(Tr, {
|
|
1601
|
+
schema: U(e.loopId)?.params ?? [],
|
|
1244
1602
|
layer: e,
|
|
1245
1603
|
setProp: p.setProp,
|
|
1246
|
-
inputs:
|
|
1604
|
+
inputs: U(e.loopId)?.inputs
|
|
1247
1605
|
}),
|
|
1248
|
-
/* @__PURE__ */ Q(
|
|
1606
|
+
/* @__PURE__ */ Q(ye, {
|
|
1249
1607
|
layer: e,
|
|
1250
1608
|
setProp: p.setProp,
|
|
1251
1609
|
patch: p.patch,
|
|
1252
1610
|
updateLayer: l,
|
|
1253
1611
|
palette: u,
|
|
1254
|
-
renderAnimate: t ? (t) => /* @__PURE__ */ Q(
|
|
1612
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Q(at, {
|
|
1255
1613
|
layer: e,
|
|
1256
1614
|
param: t,
|
|
1257
1615
|
setProp: p.setProp
|
|
@@ -1260,102 +1618,168 @@ function jr({ layer: e, showMod: t, tree: n }) {
|
|
|
1260
1618
|
tabStrip: null,
|
|
1261
1619
|
tree: n,
|
|
1262
1620
|
inline: !0,
|
|
1263
|
-
onReset:
|
|
1621
|
+
onReset: C
|
|
1264
1622
|
}),
|
|
1265
|
-
s === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(
|
|
1623
|
+
s === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Ar, {
|
|
1266
1624
|
layer: e,
|
|
1267
1625
|
setProp: p.setProp
|
|
1268
1626
|
}),
|
|
1269
|
-
s === "style" && /* @__PURE__ */ Q(
|
|
1627
|
+
s === "style" && /* @__PURE__ */ Q(Br, {
|
|
1270
1628
|
layer: e,
|
|
1271
1629
|
edit: p,
|
|
1272
1630
|
palette: u,
|
|
1273
1631
|
showMod: t
|
|
1274
1632
|
}),
|
|
1275
|
-
s === "anim" && /* @__PURE__ */ Q(
|
|
1276
|
-
schema:
|
|
1633
|
+
s === "anim" && /* @__PURE__ */ Q(Sr, {
|
|
1634
|
+
schema: U(e.loopId)?.params ?? [],
|
|
1277
1635
|
layer: e,
|
|
1278
1636
|
setProp: p.setProp
|
|
1279
1637
|
})
|
|
1280
1638
|
]
|
|
1281
1639
|
});
|
|
1282
1640
|
}
|
|
1283
|
-
function
|
|
1284
|
-
let n =
|
|
1285
|
-
return
|
|
1641
|
+
function Gr({ layer: e, showMod: t }) {
|
|
1642
|
+
let n = a(), [o, s] = Z("generate"), { updateLayer: c, palette: l } = i(), { setOnly: u } = W(), d = te(e.id, { history: "coalesce" }), f = lt.find((t) => t.id === e.presetId), p = ct.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
|
|
1643
|
+
return jr(() => {
|
|
1286
1644
|
f && u("kinetic", {
|
|
1287
1645
|
presetId: f.id,
|
|
1288
1646
|
presetLabel: f.label,
|
|
1289
|
-
comp:
|
|
1647
|
+
comp: dt(f)
|
|
1290
1648
|
});
|
|
1291
1649
|
}, () => {
|
|
1292
|
-
let t = T(), n =
|
|
1650
|
+
let t = T(), n = g(t >>> 0), r = e.comp ?? { instances: [] };
|
|
1293
1651
|
(r.instances ?? []).forEach((e, t) => {
|
|
1294
|
-
r =
|
|
1652
|
+
r = ft(r, t, n);
|
|
1295
1653
|
}), c(e.id, {
|
|
1296
1654
|
comp: r,
|
|
1297
1655
|
_rollSeed: t
|
|
1298
1656
|
});
|
|
1299
|
-
}), /* @__PURE__ */ Q(
|
|
1657
|
+
}), /* @__PURE__ */ Q(Lr, {
|
|
1300
1658
|
title: p,
|
|
1301
1659
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1302
1660
|
tone: "sunken",
|
|
1303
|
-
value:
|
|
1661
|
+
value: o,
|
|
1304
1662
|
onChange: s,
|
|
1305
|
-
options: n === "sm" ?
|
|
1663
|
+
options: n === "sm" ? Nr : Pr,
|
|
1306
1664
|
size: n,
|
|
1307
1665
|
className: r(n)
|
|
1308
1666
|
}),
|
|
1309
|
-
children: /* @__PURE__ */ Q(
|
|
1667
|
+
children: /* @__PURE__ */ Q(ut, {
|
|
1310
1668
|
layer: e,
|
|
1311
1669
|
setProp: d.setProp,
|
|
1312
1670
|
updateLayer: c,
|
|
1313
1671
|
palette: l,
|
|
1314
|
-
renderAnimate: t ? (t) => /* @__PURE__ */ Q(
|
|
1672
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Q(at, {
|
|
1315
1673
|
layer: e,
|
|
1316
1674
|
param: t,
|
|
1317
1675
|
setProp: d.setProp
|
|
1318
1676
|
}) : () => null,
|
|
1319
|
-
tab:
|
|
1677
|
+
tab: o,
|
|
1320
1678
|
tabStrip: null
|
|
1321
1679
|
})
|
|
1322
1680
|
});
|
|
1323
1681
|
}
|
|
1324
|
-
function
|
|
1325
|
-
let { layer: e } =
|
|
1682
|
+
function Kr() {
|
|
1683
|
+
let { layer: e } = W(), t = nt(), n = a(), r = it();
|
|
1326
1684
|
return Y(() => {
|
|
1327
1685
|
let e = (e) => {
|
|
1328
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1686
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || Pt(e) || rt();
|
|
1329
1687
|
};
|
|
1330
1688
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1331
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1689
|
+
}, []), t.active ? /* @__PURE__ */ Q(Lr, {
|
|
1332
1690
|
title: "Morph",
|
|
1333
|
-
children: /* @__PURE__ */ Q(
|
|
1691
|
+
children: /* @__PURE__ */ Q(vr, {
|
|
1334
1692
|
layer: e,
|
|
1335
|
-
editTabs: n === "sm" ?
|
|
1693
|
+
editTabs: n === "sm" ? Nr : Pr
|
|
1336
1694
|
})
|
|
1337
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1695
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(Rr, {
|
|
1338
1696
|
layer: e,
|
|
1339
1697
|
showMod: r
|
|
1340
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1698
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(Wr, {
|
|
1341
1699
|
layer: e,
|
|
1342
1700
|
showMod: r
|
|
1343
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1701
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(Wr, {
|
|
1344
1702
|
layer: e,
|
|
1345
1703
|
showMod: r,
|
|
1346
|
-
tree:
|
|
1347
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1704
|
+
tree: fe
|
|
1705
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(Gr, {
|
|
1348
1706
|
layer: e,
|
|
1349
1707
|
showMod: r
|
|
1350
|
-
}, e.id) : /* @__PURE__ */ Q(
|
|
1708
|
+
}, e.id) : /* @__PURE__ */ Q(j, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(j, { children: "Pick an effect or generator from the nav." });
|
|
1709
|
+
}
|
|
1710
|
+
//#endregion
|
|
1711
|
+
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1712
|
+
function qr(e) {
|
|
1713
|
+
Y(() => {
|
|
1714
|
+
let t = (t) => {
|
|
1715
|
+
t.key === "Escape" && e?.();
|
|
1716
|
+
};
|
|
1717
|
+
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
1718
|
+
}, [e]), Y(() => {
|
|
1719
|
+
let e = O.isPlaying();
|
|
1720
|
+
return O.pause(), () => {
|
|
1721
|
+
e && O.play();
|
|
1722
|
+
};
|
|
1723
|
+
}, []);
|
|
1724
|
+
}
|
|
1725
|
+
function Jr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1726
|
+
return qr(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1727
|
+
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
1728
|
+
style: { zIndex: "var(--kol-z-modal)" },
|
|
1729
|
+
children: /* @__PURE__ */ $("div", {
|
|
1730
|
+
className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
|
|
1731
|
+
style: { background: "var(--kol-surface-primary)" },
|
|
1732
|
+
children: [
|
|
1733
|
+
/* @__PURE__ */ Q("div", {
|
|
1734
|
+
className: "kol-eyebrow text-body",
|
|
1735
|
+
children: "Pick a generator"
|
|
1736
|
+
}),
|
|
1737
|
+
/* @__PURE__ */ Q("div", {
|
|
1738
|
+
className: "flex flex-col gap-2",
|
|
1739
|
+
children: we.map((t) => {
|
|
1740
|
+
let n = lr[`gen:${t.label}`] ?? "square";
|
|
1741
|
+
return /* @__PURE__ */ Q(K, {
|
|
1742
|
+
tone: "primary",
|
|
1743
|
+
size: "lg",
|
|
1744
|
+
className: Et,
|
|
1745
|
+
iconLeft: n,
|
|
1746
|
+
iconRight: n,
|
|
1747
|
+
onClick: () => e(t),
|
|
1748
|
+
children: t.label
|
|
1749
|
+
}, t.label);
|
|
1750
|
+
})
|
|
1751
|
+
}),
|
|
1752
|
+
/* @__PURE__ */ $("div", {
|
|
1753
|
+
className: "flex flex-col gap-2",
|
|
1754
|
+
children: [t && /* @__PURE__ */ Q(K, {
|
|
1755
|
+
tone: "grey",
|
|
1756
|
+
size: "lg",
|
|
1757
|
+
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1758
|
+
iconLeft: "image",
|
|
1759
|
+
iconRight: "image",
|
|
1760
|
+
onClick: t,
|
|
1761
|
+
children: "Insert image or video"
|
|
1762
|
+
}), n && /* @__PURE__ */ Q(K, {
|
|
1763
|
+
tone: "grey",
|
|
1764
|
+
size: "lg",
|
|
1765
|
+
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1766
|
+
iconLeft: "arrow-left",
|
|
1767
|
+
iconRight: "arrow-left",
|
|
1768
|
+
onClick: n,
|
|
1769
|
+
children: "Back"
|
|
1770
|
+
})]
|
|
1771
|
+
})
|
|
1772
|
+
]
|
|
1773
|
+
})
|
|
1774
|
+
});
|
|
1351
1775
|
}
|
|
1352
1776
|
//#endregion
|
|
1353
1777
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1354
|
-
var
|
|
1355
|
-
function
|
|
1356
|
-
let { patch: t } =
|
|
1778
|
+
var Yr = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1779
|
+
function Xr(e) {
|
|
1780
|
+
let { patch: t } = te(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1357
1781
|
return {
|
|
1358
|
-
nodes: /* @__PURE__ */ $(
|
|
1782
|
+
nodes: /* @__PURE__ */ $(Hn, { children: [/* @__PURE__ */ Q("input", {
|
|
1359
1783
|
ref: n,
|
|
1360
1784
|
type: "file",
|
|
1361
1785
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1369,21 +1793,21 @@ function Fr(e) {
|
|
|
1369
1793
|
return;
|
|
1370
1794
|
}
|
|
1371
1795
|
if (r.type.startsWith("video/")) {
|
|
1372
|
-
|
|
1796
|
+
c(e.id, r), t({
|
|
1373
1797
|
src: URL.createObjectURL(r),
|
|
1374
1798
|
srcType: "video"
|
|
1375
1799
|
});
|
|
1376
1800
|
return;
|
|
1377
1801
|
}
|
|
1378
|
-
|
|
1802
|
+
En(r).then((e) => t({
|
|
1379
1803
|
src: e,
|
|
1380
1804
|
srcType: "image"
|
|
1381
1805
|
}));
|
|
1382
1806
|
}
|
|
1383
1807
|
}
|
|
1384
|
-
}), /* @__PURE__ */ Q(
|
|
1808
|
+
}), /* @__PURE__ */ Q(en, {
|
|
1385
1809
|
open: r,
|
|
1386
|
-
accept: a ?
|
|
1810
|
+
accept: a ? Yr : ["image", "video"],
|
|
1387
1811
|
onClose: () => i(!1),
|
|
1388
1812
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1389
1813
|
if (a) {
|
|
@@ -1392,7 +1816,7 @@ function Fr(e) {
|
|
|
1392
1816
|
}
|
|
1393
1817
|
t({
|
|
1394
1818
|
src: wn(e),
|
|
1395
|
-
srcType:
|
|
1819
|
+
srcType: Ut(n) ? "video" : "image"
|
|
1396
1820
|
});
|
|
1397
1821
|
}
|
|
1398
1822
|
})] }),
|
|
@@ -1400,7 +1824,7 @@ function Fr(e) {
|
|
|
1400
1824
|
openLibrary: () => i(!0),
|
|
1401
1825
|
openUpload: () => n.current?.click(),
|
|
1402
1826
|
openCamera: () => {
|
|
1403
|
-
|
|
1827
|
+
yt(e.id).then(() => t({
|
|
1404
1828
|
src: null,
|
|
1405
1829
|
srcType: "webcam"
|
|
1406
1830
|
})).catch(() => {});
|
|
@@ -1421,15 +1845,15 @@ function Fr(e) {
|
|
|
1421
1845
|
label: "Camera"
|
|
1422
1846
|
}
|
|
1423
1847
|
].slice(0, 2);
|
|
1424
|
-
function
|
|
1425
|
-
let t =
|
|
1848
|
+
function Zr({ layer: e }) {
|
|
1849
|
+
let t = Xr(e);
|
|
1426
1850
|
return /* @__PURE__ */ $("div", {
|
|
1427
1851
|
className: "flex flex-col gap-2",
|
|
1428
1852
|
children: [
|
|
1429
1853
|
/* @__PURE__ */ Q(K, {
|
|
1430
1854
|
tone: "primary",
|
|
1431
1855
|
size: "lg",
|
|
1432
|
-
className:
|
|
1856
|
+
className: Et,
|
|
1433
1857
|
iconLeft: "image",
|
|
1434
1858
|
iconRight: "image",
|
|
1435
1859
|
onClick: t.openLibrary,
|
|
@@ -1438,7 +1862,7 @@ function Ir({ layer: e }) {
|
|
|
1438
1862
|
/* @__PURE__ */ Q(K, {
|
|
1439
1863
|
tone: "primary",
|
|
1440
1864
|
size: "lg",
|
|
1441
|
-
className:
|
|
1865
|
+
className: Et,
|
|
1442
1866
|
iconLeft: "upload",
|
|
1443
1867
|
iconRight: "upload",
|
|
1444
1868
|
onClick: t.openUpload,
|
|
@@ -1457,8 +1881,8 @@ function Ir({ layer: e }) {
|
|
|
1457
1881
|
]
|
|
1458
1882
|
});
|
|
1459
1883
|
}
|
|
1460
|
-
function
|
|
1461
|
-
return
|
|
1884
|
+
function Qr({ layer: e, title: t, onBack: n }) {
|
|
1885
|
+
return qr(n), /* @__PURE__ */ Q("div", {
|
|
1462
1886
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
1463
1887
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1464
1888
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1475,11 +1899,11 @@ function Lr({ layer: e, title: t, onBack: n }) {
|
|
|
1475
1899
|
children: "Pick the media it works on."
|
|
1476
1900
|
})]
|
|
1477
1901
|
}),
|
|
1478
|
-
/* @__PURE__ */ Q(
|
|
1902
|
+
/* @__PURE__ */ Q(Zr, { layer: e }),
|
|
1479
1903
|
/* @__PURE__ */ Q(K, {
|
|
1480
1904
|
tone: "grey",
|
|
1481
1905
|
size: "lg",
|
|
1482
|
-
className:
|
|
1906
|
+
className: Et,
|
|
1483
1907
|
iconLeft: "arrow-left",
|
|
1484
1908
|
iconRight: "arrow-left",
|
|
1485
1909
|
onClick: n,
|
|
@@ -1491,13 +1915,13 @@ function Lr({ layer: e, title: t, onBack: n }) {
|
|
|
1491
1915
|
}
|
|
1492
1916
|
//#endregion
|
|
1493
1917
|
//#region src/editor/components/PanelHeader.jsx
|
|
1494
|
-
function
|
|
1918
|
+
function $r({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1495
1919
|
return /* @__PURE__ */ $("div", {
|
|
1496
1920
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1497
1921
|
children: [/* @__PURE__ */ $("button", {
|
|
1498
1922
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1499
1923
|
onClick: t,
|
|
1500
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1924
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(Un, {
|
|
1501
1925
|
name: "chevron-down",
|
|
1502
1926
|
size: 16,
|
|
1503
1927
|
className: "text-oq-48"
|
|
@@ -1505,7 +1929,7 @@ function Rr({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1505
1929
|
}), n]
|
|
1506
1930
|
});
|
|
1507
1931
|
}
|
|
1508
|
-
function
|
|
1932
|
+
function ei({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1509
1933
|
return /* @__PURE__ */ $("div", {
|
|
1510
1934
|
className: "pointer-events-none fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-[var(--fxr-rail,0px)] right-0 z-10 flex flex-nowrap items-center gap-2 px-3 [&>*]:pointer-events-auto",
|
|
1511
1935
|
children: [/* @__PURE__ */ Q(K, {
|
|
@@ -1518,7 +1942,7 @@ function zr({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1518
1942
|
children: [/* @__PURE__ */ Q("span", {
|
|
1519
1943
|
className: "truncate",
|
|
1520
1944
|
children: e
|
|
1521
|
-
}), /* @__PURE__ */ Q(
|
|
1945
|
+
}), /* @__PURE__ */ Q(Un, {
|
|
1522
1946
|
name: "chevron-down",
|
|
1523
1947
|
size: 16,
|
|
1524
1948
|
className: "rotate-180 shrink-0"
|
|
@@ -1527,13 +1951,13 @@ function zr({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1527
1951
|
}), i]
|
|
1528
1952
|
});
|
|
1529
1953
|
}
|
|
1530
|
-
var
|
|
1954
|
+
var ti = {
|
|
1531
1955
|
half: "50dvh",
|
|
1532
1956
|
tall: "85dvh"
|
|
1533
|
-
},
|
|
1534
|
-
function
|
|
1957
|
+
}, ni = 4;
|
|
1958
|
+
function ri({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1535
1959
|
let a = X(null);
|
|
1536
|
-
|
|
1960
|
+
Ln(a, { axis: "x" });
|
|
1537
1961
|
let o = X({
|
|
1538
1962
|
y: null,
|
|
1539
1963
|
h0: 0,
|
|
@@ -1553,7 +1977,7 @@ function Hr({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1553
1977
|
onPointerMove: (e) => {
|
|
1554
1978
|
if (o.y === null) return;
|
|
1555
1979
|
let t = e.clientY - o.y;
|
|
1556
|
-
Math.abs(t) >
|
|
1980
|
+
Math.abs(t) > ni && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
1557
1981
|
},
|
|
1558
1982
|
onPointerUp: (e) => {
|
|
1559
1983
|
if (o.y === null) return;
|
|
@@ -1575,10 +1999,10 @@ function Hr({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1575
1999
|
}
|
|
1576
2000
|
//#endregion
|
|
1577
2001
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
1578
|
-
var
|
|
1579
|
-
function
|
|
1580
|
-
let { items: a, dispatch: o } =
|
|
1581
|
-
|
|
2002
|
+
var ii = new Set(["#rail/sec:effects"]);
|
|
2003
|
+
function ai({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2004
|
+
let { items: a, dispatch: o } = sn(), [s, c] = Z(n);
|
|
2005
|
+
qr(t);
|
|
1582
2006
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
1583
2007
|
return /* @__PURE__ */ Q("div", {
|
|
1584
2008
|
className: "fixed bottom-0 top-12 md:top-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
@@ -1597,11 +2021,11 @@ function Wr({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
1597
2021
|
children: [u.map((t) => /* @__PURE__ */ Q(K, {
|
|
1598
2022
|
tone: "primary",
|
|
1599
2023
|
size: "lg",
|
|
1600
|
-
className:
|
|
2024
|
+
className: Et,
|
|
1601
2025
|
iconLeft: t.icon,
|
|
1602
2026
|
iconRight: t.icon,
|
|
1603
2027
|
onClick: () => {
|
|
1604
|
-
if (!l &&
|
|
2028
|
+
if (!l && ii.has(t.path) && !r && i) {
|
|
1605
2029
|
i(t.path);
|
|
1606
2030
|
return;
|
|
1607
2031
|
}
|
|
@@ -1627,8 +2051,8 @@ function Wr({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
1627
2051
|
}
|
|
1628
2052
|
//#endregion
|
|
1629
2053
|
//#region src/editor/labs/sheetLabels.js
|
|
1630
|
-
function
|
|
1631
|
-
if (
|
|
2054
|
+
function oi(e) {
|
|
2055
|
+
if (Ze().active) return {
|
|
1632
2056
|
title: "Morph",
|
|
1633
2057
|
pill: "Morph"
|
|
1634
2058
|
};
|
|
@@ -1637,11 +2061,11 @@ function Gr(e) {
|
|
|
1637
2061
|
pill: "Labs"
|
|
1638
2062
|
};
|
|
1639
2063
|
if (e.type === "loop" || e.type === "misc") return {
|
|
1640
|
-
title: `${
|
|
2064
|
+
title: `${P(e.loopGroup)?.label ?? "Labs"} · ${e.presetLabel}`,
|
|
1641
2065
|
pill: e.presetLabel
|
|
1642
2066
|
};
|
|
1643
2067
|
if (e.type === "photo") {
|
|
1644
|
-
let t =
|
|
2068
|
+
let t = h(e)[0]?.def?.label ?? "Media";
|
|
1645
2069
|
return {
|
|
1646
2070
|
title: t,
|
|
1647
2071
|
pill: t
|
|
@@ -1655,15 +2079,15 @@ function Gr(e) {
|
|
|
1655
2079
|
}
|
|
1656
2080
|
//#endregion
|
|
1657
2081
|
//#region src/editor/labs/LabsView.jsx
|
|
1658
|
-
var
|
|
2082
|
+
var si = .85, ci = .3, li = 2.5, ui = {
|
|
1659
2083
|
0: 1,
|
|
1660
2084
|
1: .5,
|
|
1661
2085
|
2: 1,
|
|
1662
2086
|
3: 1.5,
|
|
1663
2087
|
4: 2
|
|
1664
|
-
},
|
|
1665
|
-
function
|
|
1666
|
-
let { layer: e } =
|
|
2088
|
+
}, di = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2089
|
+
function fi() {
|
|
2090
|
+
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction: a, commitTransaction: o, select: s } = i(), [c, l] = Z(null);
|
|
1667
2091
|
Y(() => {
|
|
1668
2092
|
let e = (e) => {
|
|
1669
2093
|
let { id: t, index: r } = e.detail || {};
|
|
@@ -1682,54 +2106,54 @@ function Zr() {
|
|
|
1682
2106
|
c,
|
|
1683
2107
|
s
|
|
1684
2108
|
]);
|
|
1685
|
-
let
|
|
1686
|
-
|
|
1687
|
-
let e =
|
|
2109
|
+
let d = c && n.find((e) => e.id === c.id && e.type === "kinetic"), f = e?.type === "photo" && !e.src && e.srcType !== "webcam", [p, m] = Z(1), [h, g] = Z(!1), _ = Mt(h), v = X(null), y = (e) => Math.min(li, Math.max(ci, e)), b = (e) => m((t) => y(t * (e > 0 ? 1.25 : .8))), { tool: x } = Dt(), S = x === "orbit", C = X(S);
|
|
2110
|
+
C.current = S, Y(() => {
|
|
2111
|
+
let e = v.current;
|
|
1688
2112
|
if (!e) return;
|
|
1689
2113
|
let t = (e) => {
|
|
1690
|
-
|
|
2114
|
+
C.current || (e.preventDefault(), !u().zoomLock && m((t) => y(t * (e.deltaY > 0 ? .94 : 1.06))));
|
|
1691
2115
|
};
|
|
1692
2116
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
1693
2117
|
}, []), Y(() => {
|
|
1694
2118
|
let e = (e) => {
|
|
1695
|
-
if (!(e.metaKey || e.ctrlKey || e.altKey) && !
|
|
2119
|
+
if (!(e.metaKey || e.ctrlKey || e.altKey) && !Pt(e)) {
|
|
1696
2120
|
if (e.key === "f" || e.key === "F") {
|
|
1697
2121
|
g((e) => !e);
|
|
1698
2122
|
return;
|
|
1699
2123
|
}
|
|
1700
|
-
if (!(
|
|
2124
|
+
if (!(u().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || ui[e.key] !== void 0))) {
|
|
1701
2125
|
if (e.key === "-" || e.key === "_") {
|
|
1702
|
-
|
|
2126
|
+
b(-1);
|
|
1703
2127
|
return;
|
|
1704
2128
|
}
|
|
1705
2129
|
if (e.key === "+" || e.key === "=") {
|
|
1706
|
-
|
|
2130
|
+
b(1);
|
|
1707
2131
|
return;
|
|
1708
2132
|
}
|
|
1709
|
-
|
|
2133
|
+
ui[e.key] !== void 0 && m(ui[e.key]);
|
|
1710
2134
|
}
|
|
1711
2135
|
}
|
|
1712
2136
|
};
|
|
1713
2137
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1714
2138
|
}, []);
|
|
1715
|
-
let [
|
|
2139
|
+
let [w, T] = Z({
|
|
1716
2140
|
x: 0,
|
|
1717
2141
|
y: 0
|
|
1718
|
-
}),
|
|
2142
|
+
}), E = X({
|
|
1719
2143
|
pts: /* @__PURE__ */ new Map(),
|
|
1720
2144
|
start: null,
|
|
1721
2145
|
tap: null
|
|
1722
|
-
}),
|
|
1723
|
-
zoom:
|
|
1724
|
-
pan:
|
|
2146
|
+
}), D = X({
|
|
2147
|
+
zoom: p,
|
|
2148
|
+
pan: w
|
|
1725
2149
|
});
|
|
1726
|
-
|
|
1727
|
-
zoom:
|
|
1728
|
-
pan:
|
|
2150
|
+
D.current = {
|
|
2151
|
+
zoom: p,
|
|
2152
|
+
pan: w
|
|
1729
2153
|
};
|
|
1730
|
-
let
|
|
2154
|
+
let ee = (e) => {
|
|
1731
2155
|
if (e.pointerType !== "touch") return;
|
|
1732
|
-
let t =
|
|
2156
|
+
let t = E.current;
|
|
1733
2157
|
if (t.pts.set(e.pointerId, {
|
|
1734
2158
|
x: e.clientX,
|
|
1735
2159
|
y: e.clientY
|
|
@@ -1739,7 +2163,7 @@ function Zr() {
|
|
|
1739
2163
|
y: e.clientY,
|
|
1740
2164
|
at: performance.now()
|
|
1741
2165
|
} : null, t.pts.size === 2) {
|
|
1742
|
-
let [n, r] = [...t.pts.values()], i =
|
|
2166
|
+
let [n, r] = [...t.pts.values()], i = v.current.getBoundingClientRect(), a = i.left + i.width / 2, o = i.top + i.height / 2, s = (n.x + r.x) / 2, c = (n.y + r.y) / 2, { zoom: l, pan: u } = D.current;
|
|
1743
2167
|
t.start = {
|
|
1744
2168
|
d: Math.hypot(n.x - r.x, n.y - r.y),
|
|
1745
2169
|
cx: a,
|
|
@@ -1747,70 +2171,70 @@ function Zr() {
|
|
|
1747
2171
|
z0: l,
|
|
1748
2172
|
qx: (s - a - u.x) / l,
|
|
1749
2173
|
qy: (c - o - u.y) / l
|
|
1750
|
-
},
|
|
2174
|
+
}, O.setStagePointer?.(null), e.stopPropagation();
|
|
1751
2175
|
}
|
|
1752
|
-
},
|
|
1753
|
-
let t =
|
|
2176
|
+
}, k = (e) => {
|
|
2177
|
+
let t = E.current;
|
|
1754
2178
|
if (!(e.pointerType !== "touch" || !t.pts.has(e.pointerId)) && (t.pts.set(e.pointerId, {
|
|
1755
2179
|
x: e.clientX,
|
|
1756
2180
|
y: e.clientY
|
|
1757
2181
|
}), t.pts.size >= 2 && t.start)) {
|
|
1758
2182
|
e.stopPropagation();
|
|
1759
|
-
let [n, r] = [...t.pts.values()], i = t.start, a =
|
|
1760
|
-
|
|
2183
|
+
let [n, r] = [...t.pts.values()], i = t.start, a = u().zoomLock ? i.z0 : y(i.z0 * (Math.hypot(n.x - r.x, n.y - r.y) / i.d)), o = (n.x + r.x) / 2, s = (n.y + r.y) / 2;
|
|
2184
|
+
m(a), T({
|
|
1761
2185
|
x: o - i.cx - a * i.qx,
|
|
1762
2186
|
y: s - i.cy - a * i.qy
|
|
1763
2187
|
});
|
|
1764
2188
|
}
|
|
1765
|
-
},
|
|
1766
|
-
let n =
|
|
2189
|
+
}, A = (t) => {
|
|
2190
|
+
let n = E.current;
|
|
1767
2191
|
if (t.pointerType !== "touch") return;
|
|
1768
2192
|
let r = n.tap;
|
|
1769
|
-
r && r.id === t.pointerId && t.type === "pointerup" && !n.start && performance.now() - r.at < 350 && Math.hypot(t.clientX - r.x, t.clientY - r.y) < 12 && (e?.type === "loop" ?
|
|
2193
|
+
r && r.id === t.pointerId && t.type === "pointerup" && !n.start && performance.now() - r.at < 350 && Math.hypot(t.clientX - r.x, t.clientY - r.y) < 12 && (e?.type === "loop" ? U(e.loopId) : null)?.group !== "penrose" && O.toggle(), r?.id === t.pointerId && (n.tap = null), n.pts.delete(t.pointerId), n.pts.size < 2 && (n.start = null);
|
|
1770
2194
|
};
|
|
1771
2195
|
return /* @__PURE__ */ $("div", {
|
|
1772
|
-
ref:
|
|
2196
|
+
ref: v,
|
|
1773
2197
|
className: "relative w-full h-full flex items-center justify-center overflow-hidden touch-none",
|
|
1774
2198
|
style: { background: "var(--kol-surface-secondary)" },
|
|
1775
2199
|
onDoubleClick: () => {
|
|
1776
|
-
|
|
2200
|
+
m(1), T({
|
|
1777
2201
|
x: 0,
|
|
1778
2202
|
y: 0
|
|
1779
2203
|
});
|
|
1780
2204
|
},
|
|
1781
|
-
onPointerDownCapture:
|
|
1782
|
-
onPointerMoveCapture:
|
|
1783
|
-
onPointerUpCapture:
|
|
1784
|
-
onPointerCancelCapture:
|
|
2205
|
+
onPointerDownCapture: ee,
|
|
2206
|
+
onPointerMoveCapture: k,
|
|
2207
|
+
onPointerUpCapture: A,
|
|
2208
|
+
onPointerCancelCapture: A,
|
|
1785
2209
|
children: [
|
|
1786
2210
|
/* @__PURE__ */ Q("div", {
|
|
1787
2211
|
style: {
|
|
1788
2212
|
flex: "none",
|
|
1789
|
-
width: `${
|
|
1790
|
-
height: `${
|
|
1791
|
-
transform: `translate(${
|
|
2213
|
+
width: `${p * si * 100}%`,
|
|
2214
|
+
height: `${p * si * 100}%`,
|
|
2215
|
+
transform: `translate(${w.x}px, ${w.y}px)`
|
|
1792
2216
|
},
|
|
1793
|
-
children: /* @__PURE__ */ Q(Sn, { overlay:
|
|
1794
|
-
layer:
|
|
2217
|
+
children: /* @__PURE__ */ Q(Sn, { overlay: d ? (e) => /* @__PURE__ */ Q(Ft, {
|
|
2218
|
+
layer: d,
|
|
1795
2219
|
initialIndex: c.index,
|
|
1796
2220
|
toVirtual: e,
|
|
1797
2221
|
updateLayer: r,
|
|
1798
|
-
beginTransaction:
|
|
2222
|
+
beginTransaction: a,
|
|
1799
2223
|
commitTransaction: o,
|
|
1800
2224
|
onExit: () => l(null)
|
|
1801
2225
|
}) : void 0 })
|
|
1802
2226
|
}),
|
|
1803
|
-
|
|
2227
|
+
f && /* @__PURE__ */ Q(Qr, {
|
|
1804
2228
|
layer: e,
|
|
1805
|
-
title:
|
|
2229
|
+
title: oi(e).title,
|
|
1806
2230
|
onBack: () => t(e.id)
|
|
1807
2231
|
}),
|
|
1808
|
-
|
|
2232
|
+
h && /* @__PURE__ */ Q("div", {
|
|
1809
2233
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
1810
|
-
children: /* @__PURE__ */ Q(
|
|
2234
|
+
children: /* @__PURE__ */ Q(In, {
|
|
1811
2235
|
label: "Framerate — press F to hide",
|
|
1812
2236
|
children: /* @__PURE__ */ $("span", {
|
|
1813
|
-
className:
|
|
2237
|
+
className: di,
|
|
1814
2238
|
children: [_, " fps"]
|
|
1815
2239
|
})
|
|
1816
2240
|
})
|
|
@@ -1818,8 +2242,8 @@ function Zr() {
|
|
|
1818
2242
|
]
|
|
1819
2243
|
});
|
|
1820
2244
|
}
|
|
1821
|
-
function
|
|
1822
|
-
let e = X(null), { grabProps: t } =
|
|
2245
|
+
function pi() {
|
|
2246
|
+
let e = X(null), { grabProps: t } = Wn(e, {
|
|
1823
2247
|
token: "kol-rail",
|
|
1824
2248
|
side: "right"
|
|
1825
2249
|
});
|
|
@@ -1865,14 +2289,14 @@ function Qr() {
|
|
|
1865
2289
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
1866
2290
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
1867
2291
|
className: "kol-compose-inspector-body",
|
|
1868
|
-
children: /* @__PURE__ */ Q(
|
|
2292
|
+
children: /* @__PURE__ */ Q(Kr, {})
|
|
1869
2293
|
})]
|
|
1870
2294
|
});
|
|
1871
2295
|
}
|
|
1872
|
-
var
|
|
1873
|
-
function
|
|
1874
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
1875
|
-
return /* @__PURE__ */ Q(
|
|
2296
|
+
var mi = zn(null);
|
|
2297
|
+
function hi() {
|
|
2298
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = Bn(mi);
|
|
2299
|
+
return /* @__PURE__ */ Q(ri, {
|
|
1876
2300
|
tall: e,
|
|
1877
2301
|
onToggle: () => {
|
|
1878
2302
|
r(null), t((e) => !e);
|
|
@@ -1883,20 +2307,20 @@ function ei() {
|
|
|
1883
2307
|
}
|
|
1884
2308
|
});
|
|
1885
2309
|
}
|
|
1886
|
-
var
|
|
2310
|
+
var gi = [
|
|
1887
2311
|
2,
|
|
1888
2312
|
4,
|
|
1889
2313
|
8,
|
|
1890
2314
|
12,
|
|
1891
2315
|
16
|
|
1892
2316
|
];
|
|
1893
|
-
function
|
|
1894
|
-
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } =
|
|
2317
|
+
function _i({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2318
|
+
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } = S(), [f, p] = Z(!0), m = [
|
|
1895
2319
|
{
|
|
1896
2320
|
icon: "home-01",
|
|
1897
2321
|
path: "#home",
|
|
1898
2322
|
label: "Home",
|
|
1899
|
-
onPress: () =>
|
|
2323
|
+
onPress: () => Jt("/")
|
|
1900
2324
|
},
|
|
1901
2325
|
{
|
|
1902
2326
|
icon: "grid",
|
|
@@ -1923,13 +2347,13 @@ function ni({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
1923
2347
|
icon: "download",
|
|
1924
2348
|
label: "Output",
|
|
1925
2349
|
onPress: () => {
|
|
1926
|
-
t(!0),
|
|
2350
|
+
t(!0), It("Output");
|
|
1927
2351
|
}
|
|
1928
2352
|
}, {
|
|
1929
2353
|
icon: "file",
|
|
1930
2354
|
label: "File",
|
|
1931
2355
|
onPress: () => {
|
|
1932
|
-
t(!0),
|
|
2356
|
+
t(!0), It("File");
|
|
1933
2357
|
}
|
|
1934
2358
|
}], g = f ? {
|
|
1935
2359
|
items: [
|
|
@@ -1965,14 +2389,14 @@ function ni({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
1965
2389
|
onPress: u
|
|
1966
2390
|
}
|
|
1967
2391
|
],
|
|
1968
|
-
sheetFor: { loop:
|
|
2392
|
+
sheetFor: { loop: gi.map((e) => ({
|
|
1969
2393
|
label: `${e} s`,
|
|
1970
2394
|
checked: o === e,
|
|
1971
2395
|
onPress: () => d(e)
|
|
1972
2396
|
})) }
|
|
1973
2397
|
} : void 0;
|
|
1974
2398
|
return Y(() => {
|
|
1975
|
-
|
|
2399
|
+
Xn({
|
|
1976
2400
|
items: m,
|
|
1977
2401
|
actions: h,
|
|
1978
2402
|
transport: g,
|
|
@@ -1986,62 +2410,62 @@ function ni({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
1986
2410
|
a,
|
|
1987
2411
|
o,
|
|
1988
2412
|
i
|
|
1989
|
-
]), Y(() => () =>
|
|
2413
|
+
]), Y(() => () => Xn(null), []), null;
|
|
1990
2414
|
}
|
|
1991
|
-
function
|
|
2415
|
+
function vi() {
|
|
1992
2416
|
return /* @__PURE__ */ Q("div", {
|
|
1993
2417
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
1994
2418
|
children: /* @__PURE__ */ Q("div", {
|
|
1995
2419
|
className: "kol-compose-inspector-body",
|
|
1996
|
-
children: /* @__PURE__ */ Q(
|
|
2420
|
+
children: /* @__PURE__ */ Q(Kr, {})
|
|
1997
2421
|
})
|
|
1998
2422
|
});
|
|
1999
2423
|
}
|
|
2000
|
-
var
|
|
2424
|
+
var yi = {
|
|
2001
2425
|
topbar: () => null,
|
|
2002
|
-
canvas:
|
|
2426
|
+
canvas: fi,
|
|
2003
2427
|
panels: [
|
|
2004
2428
|
{
|
|
2005
2429
|
slot: "canvas.footer",
|
|
2006
2430
|
order: 0,
|
|
2007
|
-
Component:
|
|
2431
|
+
Component: ht
|
|
2008
2432
|
},
|
|
2009
2433
|
{
|
|
2010
2434
|
slot: "right.body",
|
|
2011
2435
|
order: 0,
|
|
2012
|
-
Component:
|
|
2436
|
+
Component: pi
|
|
2013
2437
|
},
|
|
2014
2438
|
{
|
|
2015
2439
|
slot: "right.footer",
|
|
2016
2440
|
order: 0,
|
|
2017
|
-
Component:
|
|
2441
|
+
Component: ln
|
|
2018
2442
|
}
|
|
2019
2443
|
]
|
|
2020
|
-
},
|
|
2021
|
-
...
|
|
2444
|
+
}, bi = {
|
|
2445
|
+
...yi,
|
|
2022
2446
|
panels: [{
|
|
2023
2447
|
slot: "right.header",
|
|
2024
2448
|
order: 0,
|
|
2025
|
-
Component:
|
|
2026
|
-
}, ...
|
|
2449
|
+
Component: hi
|
|
2450
|
+
}, ...yi.panels.map((e) => e.Component === pi ? {
|
|
2027
2451
|
...e,
|
|
2028
|
-
Component:
|
|
2452
|
+
Component: vi
|
|
2029
2453
|
} : e)]
|
|
2030
2454
|
};
|
|
2031
|
-
function
|
|
2032
|
-
let { setAspect: e, selectedId: t, select: n } =
|
|
2455
|
+
function xi() {
|
|
2456
|
+
let { setAspect: e, selectedId: t, select: n } = i(), { layer: r, setOnly: a } = W(), o = X(!1), c = gt(hn), l = Bt() && !xn() || c;
|
|
2033
2457
|
Y(() => {
|
|
2034
2458
|
l && document.documentElement.removeAttribute("data-rail");
|
|
2035
2459
|
}, [l]);
|
|
2036
|
-
let [
|
|
2460
|
+
let [d, f] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ? ti.tall : ti.half, y = { "--kol-sheet-h": v }, b = Zn(), x = nt(), [S, C] = Z(() => !r);
|
|
2037
2461
|
Y(() => {
|
|
2038
|
-
|
|
2462
|
+
C(!r);
|
|
2039
2463
|
}, [r?.id]);
|
|
2040
|
-
let [
|
|
2464
|
+
let [w, T] = Z(null), E = r?.type === "photo" && (!!r.src || r.srcType === "webcam");
|
|
2041
2465
|
Y(() => {
|
|
2042
|
-
|
|
2043
|
-
}, [
|
|
2044
|
-
r ||
|
|
2466
|
+
w && E && C(!0);
|
|
2467
|
+
}, [w, E]), Y(() => {
|
|
2468
|
+
r || T(null);
|
|
2045
2469
|
}, [r]), Y(() => {
|
|
2046
2470
|
if (!r || l) return;
|
|
2047
2471
|
let e = 0, t = 0;
|
|
@@ -2051,68 +2475,68 @@ function oi() {
|
|
|
2051
2475
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2052
2476
|
};
|
|
2053
2477
|
}, [r?.id]), Y(() => {
|
|
2054
|
-
if (!
|
|
2478
|
+
if (!x.active || l) return;
|
|
2055
2479
|
let e = 0, t = 0;
|
|
2056
2480
|
return e = requestAnimationFrame(() => {
|
|
2057
2481
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2058
2482
|
}), () => {
|
|
2059
2483
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2060
2484
|
};
|
|
2061
|
-
}, [
|
|
2485
|
+
}, [x.active, l]), Y(() => vt((e) => a("photo", {
|
|
2062
2486
|
src: e.url,
|
|
2063
2487
|
srcType: e.srcType
|
|
2064
|
-
})), [
|
|
2488
|
+
})), [a]), Y(() => {
|
|
2065
2489
|
if (!l) return;
|
|
2066
2490
|
let e = () => f(!0);
|
|
2067
2491
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2068
2492
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2069
2493
|
};
|
|
2070
|
-
}, [l]),
|
|
2494
|
+
}, [l]), Tt(), Y(() => (Cn("labs"), () => Cn(null)), []), Y(() => {
|
|
2071
2495
|
if (o.current) return;
|
|
2072
2496
|
o.current = !0;
|
|
2073
|
-
let t =
|
|
2074
|
-
t.defaultAspect && t.defaultAspect !== "custom" && e(t.defaultAspect), t.defaultLoopSeconds &&
|
|
2497
|
+
let t = u();
|
|
2498
|
+
t.defaultAspect && t.defaultAspect !== "custom" && e(t.defaultAspect), t.defaultLoopSeconds && O.setLoopSeconds(t.defaultLoopSeconds);
|
|
2075
2499
|
}, []);
|
|
2076
|
-
let
|
|
2500
|
+
let D = X(!1);
|
|
2077
2501
|
Y(() => {
|
|
2078
|
-
if (
|
|
2079
|
-
|
|
2080
|
-
let e =
|
|
2502
|
+
if (D.current) return;
|
|
2503
|
+
D.current = !0;
|
|
2504
|
+
let e = Rt();
|
|
2081
2505
|
if (e.open || e.fresh) return;
|
|
2082
|
-
let t = new URLSearchParams(window.location.search).get("preset"), n = t ?
|
|
2083
|
-
n &&
|
|
2084
|
-
}, [
|
|
2085
|
-
let { clearHistory: k } =
|
|
2506
|
+
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? V(t) : null;
|
|
2507
|
+
n && a("loop", H(M(t), n));
|
|
2508
|
+
}, [a]);
|
|
2509
|
+
let { clearHistory: k } = i();
|
|
2086
2510
|
Y(() => {
|
|
2087
2511
|
let e = setTimeout(k, 800);
|
|
2088
2512
|
return () => clearTimeout(e);
|
|
2089
2513
|
}, [k]);
|
|
2090
|
-
let { tool:
|
|
2091
|
-
|
|
2092
|
-
let { updateLayer:
|
|
2093
|
-
undo:
|
|
2094
|
-
redo:
|
|
2514
|
+
let { tool: A, setTool: j } = Dt(), te = X(A);
|
|
2515
|
+
te.current = A;
|
|
2516
|
+
let { updateLayer: ne, undo: N, redo: P } = i(), F = X({
|
|
2517
|
+
undo: N,
|
|
2518
|
+
redo: P
|
|
2095
2519
|
});
|
|
2096
|
-
|
|
2097
|
-
undo:
|
|
2098
|
-
redo:
|
|
2520
|
+
F.current = {
|
|
2521
|
+
undo: N,
|
|
2522
|
+
redo: P
|
|
2099
2523
|
};
|
|
2100
|
-
let
|
|
2524
|
+
let I = !!p().grab;
|
|
2101
2525
|
Y(() => {
|
|
2102
|
-
|
|
2103
|
-
}, [
|
|
2104
|
-
let
|
|
2105
|
-
|
|
2106
|
-
let
|
|
2107
|
-
return
|
|
2526
|
+
j(I ? "orbit" : "select");
|
|
2527
|
+
}, [I, j]);
|
|
2528
|
+
let re = X(r);
|
|
2529
|
+
re.current = r;
|
|
2530
|
+
let L = X(ne);
|
|
2531
|
+
return L.current = ne, Y(() => {
|
|
2108
2532
|
let e = (e) => {
|
|
2109
|
-
if (
|
|
2533
|
+
if (Pt(e)) return;
|
|
2110
2534
|
if ((e.metaKey || e.ctrlKey) && (e.key === "z" || e.key === "Z")) {
|
|
2111
|
-
e.preventDefault(), e.shiftKey ?
|
|
2535
|
+
e.preventDefault(), e.shiftKey ? F.current.redo() : F.current.undo();
|
|
2112
2536
|
return;
|
|
2113
2537
|
}
|
|
2114
2538
|
if (e.code === "Space") {
|
|
2115
|
-
e.preventDefault(),
|
|
2539
|
+
e.preventDefault(), O.toggle();
|
|
2116
2540
|
return;
|
|
2117
2541
|
}
|
|
2118
2542
|
if ((e.key === "s" || e.key === "S") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
@@ -2120,21 +2544,21 @@ function oi() {
|
|
|
2120
2544
|
return;
|
|
2121
2545
|
}
|
|
2122
2546
|
if ((e.key === "c" || e.key === "C") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
2123
|
-
|
|
2547
|
+
ee("grab", !u().grab);
|
|
2124
2548
|
return;
|
|
2125
2549
|
}
|
|
2126
2550
|
if ((e.key === "z" || e.key === "Z") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
2127
|
-
|
|
2551
|
+
ee("zoomLock", !u().zoomLock);
|
|
2128
2552
|
return;
|
|
2129
2553
|
}
|
|
2130
|
-
let t = !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey &&
|
|
2131
|
-
if (t &&
|
|
2132
|
-
let n =
|
|
2133
|
-
n && (e.preventDefault(),
|
|
2554
|
+
let t = !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey && be[e.key.length === 1 ? e.key.toLowerCase() : e.key];
|
|
2555
|
+
if (t && re.current) {
|
|
2556
|
+
let n = Ce(re.current, t[1], t[0]);
|
|
2557
|
+
n && (e.preventDefault(), L.current(re.current.id, n));
|
|
2134
2558
|
}
|
|
2135
2559
|
};
|
|
2136
2560
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2137
|
-
}, [
|
|
2561
|
+
}, [j]), Y(() => {
|
|
2138
2562
|
if (!r?.presetId) return;
|
|
2139
2563
|
let e = new URLSearchParams(window.location.search);
|
|
2140
2564
|
e.get("preset") !== r.presetId && (e.delete("view"), e.set("preset", r.presetId), r.loopGroup ? e.set("cat", r.loopGroup) : e.delete("cat"), window.history.replaceState(null, "", `${window.location.pathname}?${e}`));
|
|
@@ -2147,61 +2571,61 @@ function oi() {
|
|
|
2147
2571
|
]), /* @__PURE__ */ $("div", {
|
|
2148
2572
|
className: "kol-editor-labs contents",
|
|
2149
2573
|
"data-touch": l || void 0,
|
|
2150
|
-
"data-params":
|
|
2151
|
-
"data-empty": r ||
|
|
2152
|
-
style:
|
|
2574
|
+
"data-params": d ? "open" : void 0,
|
|
2575
|
+
"data-empty": r || x.active ? void 0 : "",
|
|
2576
|
+
style: y,
|
|
2153
2577
|
children: [
|
|
2154
|
-
/* @__PURE__ */ Q(
|
|
2155
|
-
l ? /* @__PURE__ */ $(
|
|
2578
|
+
/* @__PURE__ */ Q(hr, {}),
|
|
2579
|
+
l ? /* @__PURE__ */ $(mi.Provider, {
|
|
2156
2580
|
value: {
|
|
2157
2581
|
collapseParams: () => f(!1),
|
|
2158
|
-
tall:
|
|
2159
|
-
setTall:
|
|
2582
|
+
tall: m,
|
|
2583
|
+
setTall: h,
|
|
2160
2584
|
setSheetPx: _,
|
|
2161
|
-
catalog:
|
|
2162
|
-
toggleCatalog: () =>
|
|
2585
|
+
catalog: S,
|
|
2586
|
+
toggleCatalog: () => C((e) => !e)
|
|
2163
2587
|
},
|
|
2164
|
-
children: [/* @__PURE__ */ Q(
|
|
2588
|
+
children: [/* @__PURE__ */ Q(s.Provider, {
|
|
2165
2589
|
value: "md",
|
|
2166
|
-
children: /* @__PURE__ */ Q(
|
|
2167
|
-
registry:
|
|
2168
|
-
rightIn: (e) =>
|
|
2590
|
+
children: /* @__PURE__ */ Q(Tn, {
|
|
2591
|
+
registry: bi,
|
|
2592
|
+
rightIn: (e) => b ? Kn(/* @__PURE__ */ Q("div", {
|
|
2169
2593
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2170
2594
|
"data-touch": "",
|
|
2171
2595
|
"data-params": "open",
|
|
2172
|
-
style:
|
|
2596
|
+
style: y,
|
|
2173
2597
|
children: e
|
|
2174
|
-
}),
|
|
2598
|
+
}), b) : null
|
|
2175
2599
|
})
|
|
2176
|
-
}), /* @__PURE__ */ Q(
|
|
2177
|
-
paramsOpen:
|
|
2600
|
+
}), /* @__PURE__ */ Q(_i, {
|
|
2601
|
+
paramsOpen: d,
|
|
2178
2602
|
setParamsOpen: f,
|
|
2179
|
-
catalog:
|
|
2180
|
-
toggleCatalog: () =>
|
|
2181
|
-
railHeight:
|
|
2603
|
+
catalog: S,
|
|
2604
|
+
toggleCatalog: () => C((e) => !e),
|
|
2605
|
+
railHeight: v
|
|
2182
2606
|
})]
|
|
2183
|
-
}) : /* @__PURE__ */ Q(
|
|
2184
|
-
|
|
2185
|
-
initialOpen:
|
|
2186
|
-
hasMedia:
|
|
2607
|
+
}) : /* @__PURE__ */ Q(Tn, { registry: yi }),
|
|
2608
|
+
S && !x.picker && !(x.active && !r) && /* @__PURE__ */ Q(ai, {
|
|
2609
|
+
initialOpen: w,
|
|
2610
|
+
hasMedia: E,
|
|
2187
2611
|
onNeedMedia: (e) => {
|
|
2188
|
-
|
|
2612
|
+
T(e), a("photo", {
|
|
2189
2613
|
filters: [],
|
|
2190
2614
|
fxGroup: null
|
|
2191
2615
|
});
|
|
2192
2616
|
},
|
|
2193
2617
|
onPicked: () => {
|
|
2194
|
-
|
|
2618
|
+
T(null), C(!1);
|
|
2195
2619
|
},
|
|
2196
2620
|
onClose: () => {
|
|
2197
|
-
|
|
2621
|
+
T(null), C(!1);
|
|
2198
2622
|
}
|
|
2199
2623
|
})
|
|
2200
2624
|
]
|
|
2201
2625
|
});
|
|
2202
2626
|
}
|
|
2203
|
-
var
|
|
2204
|
-
function
|
|
2627
|
+
var Si = "kol.editor.labs-draft";
|
|
2628
|
+
function Ci() {
|
|
2205
2629
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2206
2630
|
return Y(() => (G(e ? { active: !0 } : {
|
|
2207
2631
|
active: !1,
|
|
@@ -2209,21 +2633,21 @@ function ci() {
|
|
|
2209
2633
|
}), () => G({
|
|
2210
2634
|
active: !1,
|
|
2211
2635
|
editing: null
|
|
2212
|
-
})), [e]), /* @__PURE__ */ $(
|
|
2213
|
-
draftKey:
|
|
2636
|
+
})), [e]), /* @__PURE__ */ $(mn, {
|
|
2637
|
+
draftKey: Si,
|
|
2214
2638
|
children: [
|
|
2215
|
-
/* @__PURE__ */ Q(
|
|
2216
|
-
/* @__PURE__ */ Q(
|
|
2217
|
-
/* @__PURE__ */ Q(
|
|
2639
|
+
/* @__PURE__ */ Q(xi, {}),
|
|
2640
|
+
/* @__PURE__ */ Q(on, {}),
|
|
2641
|
+
/* @__PURE__ */ Q(ve, {})
|
|
2218
2642
|
]
|
|
2219
2643
|
});
|
|
2220
2644
|
}
|
|
2221
2645
|
//#endregion
|
|
2222
2646
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2223
|
-
function
|
|
2647
|
+
function wi({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2224
2648
|
let [i, a] = Z(null);
|
|
2225
|
-
|
|
2226
|
-
let { engineHost: o } =
|
|
2649
|
+
qr(r);
|
|
2650
|
+
let { engineHost: o } = ie(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = F(L.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2227
2651
|
return /* @__PURE__ */ Q("div", {
|
|
2228
2652
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
2229
2653
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -2240,7 +2664,7 @@ function li({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2240
2664
|
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(K, {
|
|
2241
2665
|
tone: "primary",
|
|
2242
2666
|
size: "lg",
|
|
2243
|
-
className:
|
|
2667
|
+
className: Et,
|
|
2244
2668
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2245
2669
|
iconRight: l ? "filter" : "chevron-right",
|
|
2246
2670
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
@@ -2250,7 +2674,7 @@ function li({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2250
2674
|
/* @__PURE__ */ Q(K, {
|
|
2251
2675
|
tone: "grey",
|
|
2252
2676
|
size: "lg",
|
|
2253
|
-
className:
|
|
2677
|
+
className: Et,
|
|
2254
2678
|
iconLeft: "arrow-left",
|
|
2255
2679
|
iconRight: "arrow-left",
|
|
2256
2680
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2262,7 +2686,7 @@ function li({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2262
2686
|
}
|
|
2263
2687
|
//#endregion
|
|
2264
2688
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
2265
|
-
var
|
|
2689
|
+
var Ti = { background: "var(--kol-surface-primary)" }, Ei = [
|
|
2266
2690
|
{
|
|
2267
2691
|
value: "generate",
|
|
2268
2692
|
label: "Generate"
|
|
@@ -2279,29 +2703,29 @@ var ui = { background: "var(--kol-surface-primary)" }, di = [
|
|
|
2279
2703
|
value: "output",
|
|
2280
2704
|
label: "Output"
|
|
2281
2705
|
}
|
|
2282
|
-
],
|
|
2706
|
+
], Di = Ei.filter((e) => e.value !== "generate"), Oi = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover]:text-[var(--kol-oq-48)]", ki = {
|
|
2283
2707
|
lg: 9.6,
|
|
2284
2708
|
sm: 7.2
|
|
2285
|
-
},
|
|
2286
|
-
function
|
|
2287
|
-
let n = t === "sm" ?
|
|
2709
|
+
}, Ai = 10, ji = 232;
|
|
2710
|
+
function Mi(e, t) {
|
|
2711
|
+
let n = t === "sm" ? ji : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
2288
2712
|
for (let o of e) {
|
|
2289
|
-
let e = o.label.length *
|
|
2713
|
+
let e = o.label.length * ki[t] + Ai, s = Math.max(a, e);
|
|
2290
2714
|
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
2291
2715
|
}
|
|
2292
2716
|
return i.length && r.push(i), r;
|
|
2293
2717
|
}
|
|
2294
|
-
function
|
|
2295
|
-
return
|
|
2718
|
+
function Ni({ cells: e, size: t }) {
|
|
2719
|
+
return Mi(e, t).map((e, n) => /* @__PURE__ */ Q(J, {
|
|
2296
2720
|
value: null,
|
|
2297
2721
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
2298
2722
|
options: e,
|
|
2299
2723
|
size: t,
|
|
2300
2724
|
ariaLabel: "Randomize scope",
|
|
2301
|
-
className:
|
|
2725
|
+
className: Oi
|
|
2302
2726
|
}, n));
|
|
2303
2727
|
}
|
|
2304
|
-
var
|
|
2728
|
+
var Pi = [
|
|
2305
2729
|
2,
|
|
2306
2730
|
4,
|
|
2307
2731
|
8,
|
|
@@ -2310,17 +2734,17 @@ var yi = [
|
|
|
2310
2734
|
value: String(e),
|
|
2311
2735
|
label: `${e}s`
|
|
2312
2736
|
}));
|
|
2313
|
-
function
|
|
2314
|
-
let { loopSeconds: t, setLoopSeconds: n } =
|
|
2737
|
+
function Fi({ size: e }) {
|
|
2738
|
+
let { loopSeconds: t, setLoopSeconds: n } = S();
|
|
2315
2739
|
return /* @__PURE__ */ Q(J, {
|
|
2316
2740
|
value: String(t),
|
|
2317
2741
|
onChange: (e) => n(Number(e)),
|
|
2318
|
-
options:
|
|
2742
|
+
options: Pi,
|
|
2319
2743
|
size: e,
|
|
2320
2744
|
ariaLabel: "Loop length"
|
|
2321
2745
|
});
|
|
2322
2746
|
}
|
|
2323
|
-
var
|
|
2747
|
+
var Ii = [
|
|
2324
2748
|
{
|
|
2325
2749
|
value: "9:16",
|
|
2326
2750
|
label: "9:16"
|
|
@@ -2337,7 +2761,7 @@ var xi = [
|
|
|
2337
2761
|
value: "1:1",
|
|
2338
2762
|
label: "1:1"
|
|
2339
2763
|
}
|
|
2340
|
-
],
|
|
2764
|
+
], Li = [
|
|
2341
2765
|
{
|
|
2342
2766
|
value: "5:4",
|
|
2343
2767
|
label: "5:4"
|
|
@@ -2355,138 +2779,138 @@ var xi = [
|
|
|
2355
2779
|
label: "Fill"
|
|
2356
2780
|
}
|
|
2357
2781
|
];
|
|
2358
|
-
function
|
|
2359
|
-
let p =
|
|
2782
|
+
function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: f }) {
|
|
2783
|
+
let p = nt(), { updateLayer: g, addFilter: v, removeFilter: y } = i(), { onExportPng: b } = wt(), [S, w] = Z(!1), [T, D] = Z(!0), [ee, k] = Z(!1), [A, j] = Z(!1), [te, M] = Z("generate"), [ne, F] = Z(!1), [I, re] = Z(!1), { aspect: L } = i(), [R, ae] = Z(null), z = m(e);
|
|
2360
2784
|
Y(() => {
|
|
2361
|
-
c && (
|
|
2785
|
+
c && (D(!0), j(!0));
|
|
2362
2786
|
}, [c]);
|
|
2363
|
-
let
|
|
2787
|
+
let B = l ? "sm" : "lg", oe = l && !!e && T && !S;
|
|
2364
2788
|
Y(() => (u?.(oe), () => u?.(!1)), [oe]);
|
|
2365
|
-
let se = !l && e &&
|
|
2366
|
-
Y(() => (
|
|
2367
|
-
let
|
|
2368
|
-
let t = e?.type === "loop" &&
|
|
2369
|
-
t &&
|
|
2789
|
+
let se = !l && e && T && !S ? R ? `${R}px` : ne ? ti.tall : ti.half : null;
|
|
2790
|
+
Y(() => (f?.(se), () => f?.(null)), [se]);
|
|
2791
|
+
let ce = () => {
|
|
2792
|
+
let t = e?.type === "loop" && N(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2793
|
+
t && g(e.id, H(t, e.loopGroup));
|
|
2370
2794
|
};
|
|
2371
|
-
if (
|
|
2372
|
-
e?.type === "loop" &&
|
|
2795
|
+
if (jr(ce, () => {
|
|
2796
|
+
e?.type === "loop" && g(e.id, d(e, x(U(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2373
2797
|
}), !e) return null;
|
|
2374
2798
|
if (S) return /* @__PURE__ */ Q("button", {
|
|
2375
2799
|
"aria-label": "Show controls",
|
|
2376
2800
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
2377
|
-
onClick: () =>
|
|
2801
|
+
onClick: () => w(!1)
|
|
2378
2802
|
});
|
|
2379
|
-
let
|
|
2380
|
-
let t =
|
|
2381
|
-
t &&
|
|
2382
|
-
},
|
|
2383
|
-
let t = E(e,
|
|
2384
|
-
t &&
|
|
2803
|
+
let V = e.type === "loop", le = V ? `${P(e.loopGroup).label} · ${e.presetLabel}` : "Media", ue = V ? U(e.loopId)?.params ?? [] : [], de = V ? C(ue, e) : [], W = () => g(e.id, d(e, x(ue, e), z.take(), { withFilters: !0 })), fe = (t) => g(e.id, d(e, t.params, z.take(), { stripNoRandom: !!t.motion })), me = () => {
|
|
2804
|
+
let t = _(e, z.take());
|
|
2805
|
+
t && g(e.id, t);
|
|
2806
|
+
}, he = h(e), { effectable: ge } = ie(e), _e = () => {
|
|
2807
|
+
let t = E(e, z.take());
|
|
2808
|
+
t && g(e.id, { filters: t });
|
|
2385
2809
|
};
|
|
2386
|
-
if (!
|
|
2387
|
-
label:
|
|
2388
|
-
onOpen: () =>
|
|
2389
|
-
size:
|
|
2810
|
+
if (!T) return /* @__PURE__ */ $(ei, {
|
|
2811
|
+
label: V ? e.presetLabel : "Media",
|
|
2812
|
+
onOpen: () => D(!0),
|
|
2813
|
+
size: B,
|
|
2390
2814
|
children: [
|
|
2391
|
-
(
|
|
2815
|
+
(V || he.length > 0) && /* @__PURE__ */ Q(In, {
|
|
2392
2816
|
label: "Randomize all",
|
|
2393
2817
|
children: /* @__PURE__ */ Q(K, {
|
|
2394
2818
|
tone: "primary",
|
|
2395
|
-
size:
|
|
2819
|
+
size: B,
|
|
2396
2820
|
iconOnly: "bolt",
|
|
2397
2821
|
"aria-label": "Randomize all",
|
|
2398
|
-
onClick:
|
|
2822
|
+
onClick: W,
|
|
2399
2823
|
className: "shrink-0"
|
|
2400
2824
|
})
|
|
2401
2825
|
}),
|
|
2402
|
-
/* @__PURE__ */ Q(
|
|
2826
|
+
/* @__PURE__ */ Q(In, {
|
|
2403
2827
|
label: "Download",
|
|
2404
2828
|
children: /* @__PURE__ */ Q(K, {
|
|
2405
2829
|
tone: "primary",
|
|
2406
|
-
size:
|
|
2830
|
+
size: B,
|
|
2407
2831
|
iconOnly: "download",
|
|
2408
2832
|
"aria-label": "Download",
|
|
2409
|
-
onClick: () =>
|
|
2833
|
+
onClick: () => b(2),
|
|
2410
2834
|
className: "shrink-0"
|
|
2411
2835
|
})
|
|
2412
2836
|
}),
|
|
2413
|
-
/* @__PURE__ */ Q(
|
|
2837
|
+
/* @__PURE__ */ Q(In, {
|
|
2414
2838
|
label: "Hide UI",
|
|
2415
2839
|
children: /* @__PURE__ */ Q(K, {
|
|
2416
2840
|
tone: "primary",
|
|
2417
|
-
size:
|
|
2841
|
+
size: B,
|
|
2418
2842
|
iconOnly: "eye-off",
|
|
2419
2843
|
"aria-label": "Hide UI",
|
|
2420
|
-
onClick: () =>
|
|
2844
|
+
onClick: () => w(!0),
|
|
2421
2845
|
className: "shrink-0"
|
|
2422
2846
|
})
|
|
2423
2847
|
}),
|
|
2424
|
-
/* @__PURE__ */ Q(
|
|
2425
|
-
label:
|
|
2848
|
+
/* @__PURE__ */ Q(In, {
|
|
2849
|
+
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2426
2850
|
children: /* @__PURE__ */ Q(K, {
|
|
2427
2851
|
tone: "primary",
|
|
2428
|
-
size:
|
|
2852
|
+
size: B,
|
|
2429
2853
|
iconOnly: "maximize",
|
|
2430
|
-
"aria-label":
|
|
2431
|
-
"aria-pressed":
|
|
2432
|
-
onClick: () => s(
|
|
2854
|
+
"aria-label": a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2855
|
+
"aria-pressed": a === "fill",
|
|
2856
|
+
onClick: () => s(a === "fill" ? L : "fill"),
|
|
2433
2857
|
className: "shrink-0"
|
|
2434
2858
|
})
|
|
2435
2859
|
})
|
|
2436
2860
|
]
|
|
2437
2861
|
});
|
|
2438
|
-
let
|
|
2862
|
+
let ve = [...V ? Ei : Di, ...V && p.steps.length >= 2 ? [{
|
|
2439
2863
|
value: "morph",
|
|
2440
2864
|
label: "Morph"
|
|
2441
|
-
}] : []].filter((e) => (e.value !== "effects" ||
|
|
2442
|
-
return /* @__PURE__ */ $(
|
|
2443
|
-
/* @__PURE__ */ Q(
|
|
2444
|
-
open:
|
|
2445
|
-
onClose: () =>
|
|
2446
|
-
schema:
|
|
2865
|
+
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" || o("motion"))), ye = ve.some((e) => e.value === te) ? te : ve[0].value;
|
|
2866
|
+
return /* @__PURE__ */ $(Hn, { children: [
|
|
2867
|
+
/* @__PURE__ */ Q(pe, {
|
|
2868
|
+
open: I,
|
|
2869
|
+
onClose: () => re(!1),
|
|
2870
|
+
schema: ue,
|
|
2447
2871
|
layer: e,
|
|
2448
|
-
size:
|
|
2872
|
+
size: B
|
|
2449
2873
|
}),
|
|
2450
|
-
|
|
2874
|
+
ee && /* @__PURE__ */ Q(Jr, {
|
|
2451
2875
|
onPick: (e) => {
|
|
2452
|
-
t(e),
|
|
2876
|
+
t(e), k(!1);
|
|
2453
2877
|
},
|
|
2454
2878
|
onInsert: () => {
|
|
2455
|
-
|
|
2879
|
+
k(!1), n();
|
|
2456
2880
|
},
|
|
2457
2881
|
onBack: () => {
|
|
2458
|
-
|
|
2882
|
+
k(!1), r();
|
|
2459
2883
|
},
|
|
2460
|
-
onDismiss: () =>
|
|
2884
|
+
onDismiss: () => k(!1)
|
|
2461
2885
|
}),
|
|
2462
|
-
|
|
2886
|
+
A && /* @__PURE__ */ Q(wi, {
|
|
2463
2887
|
layer: e,
|
|
2464
|
-
chain:
|
|
2888
|
+
chain: he,
|
|
2465
2889
|
onPick: (t) => {
|
|
2466
|
-
v(e.id, t),
|
|
2890
|
+
v(e.id, t), j(!1);
|
|
2467
2891
|
},
|
|
2468
|
-
onBack: () =>
|
|
2892
|
+
onBack: () => j(!1)
|
|
2469
2893
|
}),
|
|
2470
2894
|
/* @__PURE__ */ $("div", {
|
|
2471
2895
|
className: l ? "fixed top-0 right-0 bottom-0 z-10 flex w-[var(--kol-sidenav-w,320px)] flex-col overflow-y-auto border-l border-oq-08" : "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
2472
|
-
style: l ?
|
|
2473
|
-
...
|
|
2474
|
-
top: `calc(100dvh - ${se ??
|
|
2896
|
+
style: l ? Ti : {
|
|
2897
|
+
...Ti,
|
|
2898
|
+
top: `calc(100dvh - ${se ?? ti.half})`
|
|
2475
2899
|
},
|
|
2476
2900
|
children: [
|
|
2477
|
-
!l && /* @__PURE__ */ Q(
|
|
2478
|
-
tall:
|
|
2901
|
+
!l && /* @__PURE__ */ Q(ri, {
|
|
2902
|
+
tall: ne,
|
|
2479
2903
|
onToggle: () => {
|
|
2480
|
-
|
|
2904
|
+
ae(null), F((e) => !e);
|
|
2481
2905
|
},
|
|
2482
|
-
onResize: (e) =>
|
|
2906
|
+
onResize: (e) => ae(Math.max(96, Math.min(window.innerHeight * .92, e))),
|
|
2483
2907
|
onResizeEnd: (e) => {
|
|
2484
|
-
e < 96 && (
|
|
2908
|
+
e < 96 && (ae(null), D(!1));
|
|
2485
2909
|
}
|
|
2486
2910
|
}),
|
|
2487
|
-
/* @__PURE__ */ Q(
|
|
2488
|
-
title:
|
|
2489
|
-
onCollapse: () =>
|
|
2911
|
+
/* @__PURE__ */ Q($r, {
|
|
2912
|
+
title: le,
|
|
2913
|
+
onCollapse: () => D(!1),
|
|
2490
2914
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
2491
2915
|
action: /* @__PURE__ */ Q(K, {
|
|
2492
2916
|
tone: "ghost",
|
|
@@ -2500,31 +2924,31 @@ function Ci({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2500
2924
|
className: l ? "px-4 pb-5" : "min-h-0 flex-1 overflow-y-auto px-3 pb-3",
|
|
2501
2925
|
children: [
|
|
2502
2926
|
/* @__PURE__ */ Q(J, {
|
|
2503
|
-
value:
|
|
2504
|
-
onChange:
|
|
2505
|
-
options:
|
|
2506
|
-
size:
|
|
2507
|
-
className: l ?
|
|
2927
|
+
value: ye,
|
|
2928
|
+
onChange: M,
|
|
2929
|
+
options: ve,
|
|
2930
|
+
size: B,
|
|
2931
|
+
className: l ? Oi : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2508
2932
|
}),
|
|
2509
|
-
|
|
2933
|
+
ye === "morph" && V && /* @__PURE__ */ Q(vr, {
|
|
2510
2934
|
layer: e,
|
|
2511
2935
|
readOnly: !0
|
|
2512
2936
|
}),
|
|
2513
|
-
|
|
2937
|
+
ye === "generate" && V && /* @__PURE__ */ $("div", {
|
|
2514
2938
|
className: "flex flex-col gap-2 pt-3",
|
|
2515
2939
|
children: [
|
|
2516
2940
|
/* @__PURE__ */ $("div", {
|
|
2517
2941
|
className: "grid grid-cols-2 gap-2",
|
|
2518
2942
|
children: [/* @__PURE__ */ Q(K, {
|
|
2519
2943
|
tone: "primary",
|
|
2520
|
-
size:
|
|
2944
|
+
size: B,
|
|
2521
2945
|
iconRight: "refresh",
|
|
2522
|
-
onClick:
|
|
2946
|
+
onClick: me,
|
|
2523
2947
|
children: "Preset"
|
|
2524
2948
|
}), /* @__PURE__ */ Q(K, {
|
|
2525
2949
|
tone: "primary",
|
|
2526
|
-
size:
|
|
2527
|
-
onClick: () =>
|
|
2950
|
+
size: B,
|
|
2951
|
+
onClick: () => k(!0),
|
|
2528
2952
|
children: "Generator"
|
|
2529
2953
|
})]
|
|
2530
2954
|
}),
|
|
@@ -2533,77 +2957,77 @@ function Ci({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2533
2957
|
children: [
|
|
2534
2958
|
/* @__PURE__ */ Q(K, {
|
|
2535
2959
|
tone: "primary",
|
|
2536
|
-
size:
|
|
2960
|
+
size: B,
|
|
2537
2961
|
className: "flex-1 min-w-0",
|
|
2538
|
-
onClick:
|
|
2962
|
+
onClick: W,
|
|
2539
2963
|
children: "Randomize all"
|
|
2540
2964
|
}),
|
|
2541
|
-
/* @__PURE__ */ Q(
|
|
2965
|
+
/* @__PURE__ */ Q(In, {
|
|
2542
2966
|
label: "What Randomize all rolls",
|
|
2543
2967
|
children: /* @__PURE__ */ Q(K, {
|
|
2544
2968
|
tone: "primary",
|
|
2545
|
-
size:
|
|
2969
|
+
size: B,
|
|
2546
2970
|
iconOnly: "nav-settings",
|
|
2547
2971
|
"aria-label": "What Randomize all rolls",
|
|
2548
|
-
onClick: () =>
|
|
2972
|
+
onClick: () => re(!0),
|
|
2549
2973
|
className: "shrink-0"
|
|
2550
2974
|
})
|
|
2551
2975
|
}),
|
|
2552
|
-
/* @__PURE__ */ Q(
|
|
2976
|
+
/* @__PURE__ */ Q(In, {
|
|
2553
2977
|
label: "Reset to defaults",
|
|
2554
2978
|
shortcut: "R",
|
|
2555
2979
|
children: /* @__PURE__ */ Q(K, {
|
|
2556
2980
|
tone: "primary",
|
|
2557
|
-
size:
|
|
2981
|
+
size: B,
|
|
2558
2982
|
iconOnly: "refresh",
|
|
2559
2983
|
"aria-label": "Reset to defaults",
|
|
2560
|
-
onClick:
|
|
2984
|
+
onClick: ce,
|
|
2561
2985
|
className: "shrink-0"
|
|
2562
2986
|
})
|
|
2563
2987
|
})
|
|
2564
2988
|
]
|
|
2565
2989
|
}),
|
|
2566
|
-
|
|
2567
|
-
size:
|
|
2568
|
-
cells: [...
|
|
2990
|
+
de.length > 0 && /* @__PURE__ */ Q(Ni, {
|
|
2991
|
+
size: B,
|
|
2992
|
+
cells: [...de.map((e) => ({
|
|
2569
2993
|
value: e.id,
|
|
2570
2994
|
label: e.label,
|
|
2571
2995
|
run: () => fe(e)
|
|
2572
2996
|
})), {
|
|
2573
2997
|
value: "__retrigger",
|
|
2574
2998
|
label: "Re-trigger",
|
|
2575
|
-
run: () =>
|
|
2999
|
+
run: () => O.rewind()
|
|
2576
3000
|
}]
|
|
2577
3001
|
})
|
|
2578
3002
|
]
|
|
2579
3003
|
}),
|
|
2580
|
-
|
|
3004
|
+
ye === "effects" && /* @__PURE__ */ $("div", {
|
|
2581
3005
|
className: "flex flex-col gap-2 pt-3",
|
|
2582
3006
|
children: [/* @__PURE__ */ $("div", {
|
|
2583
3007
|
className: "grid grid-cols-2 gap-2",
|
|
2584
3008
|
children: [
|
|
2585
3009
|
/* @__PURE__ */ Q(K, {
|
|
2586
3010
|
tone: "primary",
|
|
2587
|
-
size:
|
|
2588
|
-
onClick: () =>
|
|
3011
|
+
size: B,
|
|
3012
|
+
onClick: () => j(!0),
|
|
2589
3013
|
children: "Add effect"
|
|
2590
3014
|
}),
|
|
2591
|
-
|
|
3015
|
+
he.length > 0 && /* @__PURE__ */ Q(K, {
|
|
2592
3016
|
tone: "primary",
|
|
2593
|
-
size:
|
|
2594
|
-
onClick:
|
|
3017
|
+
size: B,
|
|
3018
|
+
onClick: _e,
|
|
2595
3019
|
children: "Randomize"
|
|
2596
3020
|
}),
|
|
2597
3021
|
" "
|
|
2598
3022
|
]
|
|
2599
|
-
}),
|
|
3023
|
+
}), he.map((t, n) => {
|
|
2600
3024
|
let r = {
|
|
2601
3025
|
...e,
|
|
2602
3026
|
...t.params,
|
|
2603
3027
|
id: e.id
|
|
2604
|
-
}, i = t.def ?
|
|
2605
|
-
let i =
|
|
2606
|
-
|
|
3028
|
+
}, i = t.def ? C(t.def.params, r) : [], a = (t) => {
|
|
3029
|
+
let i = d(r, t.params, z.take(), { stripNoRandom: !!t.motion }), a = he.map(({ def: e, ...t }) => t);
|
|
3030
|
+
g(e.id, { filters: a.map((e, t) => t === n ? {
|
|
2607
3031
|
...e,
|
|
2608
3032
|
params: {
|
|
2609
3033
|
...e.params,
|
|
@@ -2615,14 +3039,14 @@ function Ci({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2615
3039
|
className: "flex flex-col gap-2",
|
|
2616
3040
|
children: [/* @__PURE__ */ Q(K, {
|
|
2617
3041
|
tone: "grey",
|
|
2618
|
-
size:
|
|
3042
|
+
size: B,
|
|
2619
3043
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
2620
3044
|
iconLeft: "trash",
|
|
2621
3045
|
iconRight: "trash",
|
|
2622
|
-
onClick: () =>
|
|
3046
|
+
onClick: () => y(e.id, n),
|
|
2623
3047
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
2624
|
-
}), i.length > 0 && /* @__PURE__ */ Q(
|
|
2625
|
-
size:
|
|
3048
|
+
}), i.length > 0 && /* @__PURE__ */ Q(Ni, {
|
|
3049
|
+
size: B,
|
|
2626
3050
|
cells: i.map((e) => ({
|
|
2627
3051
|
value: e.id,
|
|
2628
3052
|
label: e.label,
|
|
@@ -2632,28 +3056,28 @@ function Ci({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2632
3056
|
}, t.key);
|
|
2633
3057
|
})]
|
|
2634
3058
|
}),
|
|
2635
|
-
|
|
3059
|
+
ye === "transport" && o("motion") && /* @__PURE__ */ $("div", {
|
|
2636
3060
|
className: "flex flex-col gap-2 pt-3",
|
|
2637
3061
|
children: [(() => {
|
|
2638
|
-
let e =
|
|
2639
|
-
return /* @__PURE__ */ Q(e, { size:
|
|
2640
|
-
})(), /* @__PURE__ */ Q(
|
|
3062
|
+
let e = o("motion").TransportBar;
|
|
3063
|
+
return /* @__PURE__ */ Q(e, { size: B });
|
|
3064
|
+
})(), /* @__PURE__ */ Q(Fi, { size: B })]
|
|
2641
3065
|
}),
|
|
2642
|
-
|
|
3066
|
+
ye === "output" && /* @__PURE__ */ $("div", {
|
|
2643
3067
|
className: "flex flex-col gap-2 pt-3",
|
|
2644
3068
|
children: [
|
|
2645
3069
|
/* @__PURE__ */ Q(J, {
|
|
2646
|
-
value:
|
|
3070
|
+
value: a,
|
|
2647
3071
|
onChange: s,
|
|
2648
|
-
options:
|
|
2649
|
-
size:
|
|
3072
|
+
options: Ii,
|
|
3073
|
+
size: B,
|
|
2650
3074
|
ariaLabel: "Aspect"
|
|
2651
3075
|
}),
|
|
2652
3076
|
/* @__PURE__ */ Q(J, {
|
|
2653
|
-
value:
|
|
3077
|
+
value: a,
|
|
2654
3078
|
onChange: s,
|
|
2655
|
-
options:
|
|
2656
|
-
size:
|
|
3079
|
+
options: Li,
|
|
3080
|
+
size: B,
|
|
2657
3081
|
ariaLabel: "Aspect (landscape) and fill"
|
|
2658
3082
|
}),
|
|
2659
3083
|
/* @__PURE__ */ $("div", {
|
|
@@ -2661,25 +3085,25 @@ function Ci({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2661
3085
|
children: [
|
|
2662
3086
|
/* @__PURE__ */ Q(K, {
|
|
2663
3087
|
tone: "primary",
|
|
2664
|
-
size:
|
|
2665
|
-
onClick: () =>
|
|
3088
|
+
size: B,
|
|
3089
|
+
onClick: () => an({ focusName: !0 }),
|
|
2666
3090
|
children: "Save…"
|
|
2667
3091
|
}),
|
|
2668
3092
|
/* @__PURE__ */ Q(K, {
|
|
2669
3093
|
tone: "primary",
|
|
2670
|
-
size:
|
|
2671
|
-
onClick: () =>
|
|
3094
|
+
size: B,
|
|
3095
|
+
onClick: () => b(2),
|
|
2672
3096
|
children: "Download"
|
|
2673
3097
|
}),
|
|
2674
3098
|
/* @__PURE__ */ Q(K, {
|
|
2675
3099
|
tone: "primary",
|
|
2676
|
-
size:
|
|
2677
|
-
onClick: () =>
|
|
3100
|
+
size: B,
|
|
3101
|
+
onClick: () => w(!0),
|
|
2678
3102
|
children: "Hide UI"
|
|
2679
3103
|
}),
|
|
2680
3104
|
/* @__PURE__ */ Q(K, {
|
|
2681
3105
|
tone: "primary",
|
|
2682
|
-
size:
|
|
3106
|
+
size: B,
|
|
2683
3107
|
onClick: r,
|
|
2684
3108
|
children: "Start over"
|
|
2685
3109
|
})
|
|
@@ -2695,7 +3119,7 @@ function Ci({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2695
3119
|
}
|
|
2696
3120
|
//#endregion
|
|
2697
3121
|
//#region src/editor/mobile/MobileView.jsx
|
|
2698
|
-
function
|
|
3122
|
+
function zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
2699
3123
|
return /* @__PURE__ */ Q("div", {
|
|
2700
3124
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
2701
3125
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -2713,45 +3137,45 @@ function wi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
2713
3137
|
})]
|
|
2714
3138
|
}) : /* @__PURE__ */ Q("span", {
|
|
2715
3139
|
className: "kol-eyebrow text-body",
|
|
2716
|
-
children:
|
|
3140
|
+
children: yn("randomiser").label
|
|
2717
3141
|
}), /* @__PURE__ */ $("div", {
|
|
2718
3142
|
className: "flex flex-col gap-2",
|
|
2719
3143
|
children: [
|
|
2720
3144
|
/* @__PURE__ */ Q(K, {
|
|
2721
3145
|
tone: "primary",
|
|
2722
3146
|
size: "lg",
|
|
2723
|
-
className:
|
|
2724
|
-
iconLeft:
|
|
2725
|
-
iconRight:
|
|
3147
|
+
className: Et,
|
|
3148
|
+
iconLeft: _n.randomiser,
|
|
3149
|
+
iconRight: _n.randomiser,
|
|
2726
3150
|
onClick: e,
|
|
2727
3151
|
children: "Generate"
|
|
2728
3152
|
}),
|
|
2729
3153
|
/* @__PURE__ */ Q(K, {
|
|
2730
3154
|
tone: "primary",
|
|
2731
3155
|
size: "lg",
|
|
2732
|
-
className:
|
|
3156
|
+
className: Et,
|
|
2733
3157
|
iconLeft: "filter",
|
|
2734
3158
|
iconRight: "filter",
|
|
2735
3159
|
onClick: t,
|
|
2736
3160
|
children: "Effects"
|
|
2737
3161
|
}),
|
|
2738
|
-
n &&
|
|
3162
|
+
n && Ht() && /* @__PURE__ */ Q(K, {
|
|
2739
3163
|
tone: "primary",
|
|
2740
3164
|
size: "lg",
|
|
2741
3165
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
2742
|
-
iconLeft:
|
|
2743
|
-
iconRight:
|
|
2744
|
-
onClick:
|
|
2745
|
-
children:
|
|
3166
|
+
iconLeft: _n.editor,
|
|
3167
|
+
iconRight: _n.editor,
|
|
3168
|
+
onClick: Vt,
|
|
3169
|
+
children: yn("editor").label
|
|
2746
3170
|
}),
|
|
2747
3171
|
n && /* @__PURE__ */ Q(K, {
|
|
2748
3172
|
tone: "primary",
|
|
2749
3173
|
size: "lg",
|
|
2750
3174
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
2751
|
-
iconLeft:
|
|
2752
|
-
iconRight:
|
|
2753
|
-
onClick:
|
|
2754
|
-
children:
|
|
3175
|
+
iconLeft: _n.labs,
|
|
3176
|
+
iconRight: _n.labs,
|
|
3177
|
+
onClick: pn,
|
|
3178
|
+
children: yn("labs").label
|
|
2755
3179
|
}),
|
|
2756
3180
|
n && /* @__PURE__ */ Q(K, {
|
|
2757
3181
|
tone: "primary",
|
|
@@ -2759,7 +3183,7 @@ function wi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
2759
3183
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
2760
3184
|
iconLeft: "swap",
|
|
2761
3185
|
iconRight: "swap",
|
|
2762
|
-
onClick: () =>
|
|
3186
|
+
onClick: () => Jt("/morph"),
|
|
2763
3187
|
children: "Morph"
|
|
2764
3188
|
})
|
|
2765
3189
|
]
|
|
@@ -2767,15 +3191,15 @@ function wi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
2767
3191
|
})
|
|
2768
3192
|
});
|
|
2769
3193
|
}
|
|
2770
|
-
function
|
|
2771
|
-
let { layers: t, addLayer: n, removeLayer: r, updateLayer:
|
|
3194
|
+
function Bi() {
|
|
3195
|
+
let { layers: t, addLayer: n, removeLayer: r, updateLayer: a, canvasW: o, canvasH: s, aspect: c, setAspect: u } = i(), { setTool: d } = Dt(), f = Bt() && !xn(), p = Zt(), m = () => {
|
|
2772
3196
|
let e = new URLSearchParams(window.location.search);
|
|
2773
3197
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
2774
|
-
}, [
|
|
3198
|
+
}, [h, g] = Z(m), [_, v] = Z(!1), [y, b] = Z(null), [x, S] = Z("contain"), [C, w] = Z(!1), [T, E] = Z(null), [D, ee] = Z({
|
|
2775
3199
|
s: 1,
|
|
2776
3200
|
x: 0,
|
|
2777
3201
|
y: 0
|
|
2778
|
-
}),
|
|
3202
|
+
}), k = X(null), A = X({
|
|
2779
3203
|
pts: /* @__PURE__ */ new Map(),
|
|
2780
3204
|
start: null,
|
|
2781
3205
|
live: {
|
|
@@ -2783,165 +3207,165 @@ function Ti() {
|
|
|
2783
3207
|
x: 0,
|
|
2784
3208
|
y: 0
|
|
2785
3209
|
}
|
|
2786
|
-
}),
|
|
2787
|
-
let [e, t] = [...
|
|
3210
|
+
}), j = X(null), te = () => {
|
|
3211
|
+
let [e, t] = [...A.current.pts.values()];
|
|
2788
3212
|
return {
|
|
2789
3213
|
d: Math.hypot(e.x - t.x, e.y - t.y),
|
|
2790
3214
|
mx: (e.x + t.x) / 2,
|
|
2791
3215
|
my: (e.y + t.y) / 2
|
|
2792
3216
|
};
|
|
2793
|
-
},
|
|
2794
|
-
if (
|
|
3217
|
+
}, M = (e) => `translate(${e.x}px, ${e.y}px) scale(${e.s})`, ne = (e) => {
|
|
3218
|
+
if (A.current.pts.set(e.pointerId, {
|
|
2795
3219
|
x: e.clientX,
|
|
2796
3220
|
y: e.clientY
|
|
2797
|
-
}),
|
|
3221
|
+
}), j.current = A.current.pts.size === 1 ? {
|
|
2798
3222
|
id: e.pointerId,
|
|
2799
3223
|
x: e.clientX,
|
|
2800
3224
|
y: e.clientY,
|
|
2801
3225
|
t: performance.now()
|
|
2802
|
-
} : null,
|
|
2803
|
-
let t =
|
|
2804
|
-
|
|
3226
|
+
} : null, A.current.pts.size === 2) {
|
|
3227
|
+
let t = k.current?.getBoundingClientRect(), n = te(), r = (t?.left ?? 0) - D.x, i = (t?.top ?? 0) - D.y;
|
|
3228
|
+
A.current.start = {
|
|
2805
3229
|
...n,
|
|
2806
3230
|
ox: r,
|
|
2807
3231
|
oy: i,
|
|
2808
|
-
v:
|
|
2809
|
-
px: (n.mx - r -
|
|
2810
|
-
py: (n.my - i -
|
|
2811
|
-
},
|
|
3232
|
+
v: D,
|
|
3233
|
+
px: (n.mx - r - D.x) / D.s,
|
|
3234
|
+
py: (n.my - i - D.y) / D.s
|
|
3235
|
+
}, A.current.live = D, O.setStagePointer(null), e.stopPropagation();
|
|
2812
3236
|
}
|
|
2813
|
-
},
|
|
2814
|
-
let t =
|
|
3237
|
+
}, N = (e) => {
|
|
3238
|
+
let t = A.current;
|
|
2815
3239
|
if (t.pts.has(e.pointerId) && (t.pts.set(e.pointerId, {
|
|
2816
3240
|
x: e.clientX,
|
|
2817
3241
|
y: e.clientY
|
|
2818
3242
|
}), t.pts.size >= 2 && t.start)) {
|
|
2819
3243
|
e.stopPropagation();
|
|
2820
|
-
let n =
|
|
3244
|
+
let n = te(), r = t.start, i = Math.min(4, Math.max(.5, r.v.s * (n.d / r.d)));
|
|
2821
3245
|
t.live = {
|
|
2822
3246
|
s: i,
|
|
2823
3247
|
x: n.mx - r.ox - i * r.px,
|
|
2824
3248
|
y: n.my - r.oy - i * r.py
|
|
2825
|
-
},
|
|
3249
|
+
}, k.current && (k.current.style.transform = M(t.live));
|
|
2826
3250
|
}
|
|
2827
|
-
},
|
|
2828
|
-
let t =
|
|
2829
|
-
t && t.id === e.pointerId && e.type === "pointerup" &&
|
|
3251
|
+
}, P = (e) => {
|
|
3252
|
+
let t = j.current;
|
|
3253
|
+
t && t.id === e.pointerId && e.type === "pointerup" && h === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (F?.type === "loop" ? U(F.loopId) : null)?.group !== "penrose" && O.toggle(), t?.id === e.pointerId && (j.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, ee(A.current.live));
|
|
2830
3254
|
};
|
|
2831
|
-
|
|
2832
|
-
|
|
3255
|
+
Gn(), Y(() => (Cn("randomiser"), () => Cn(null)), []), Y(() => {
|
|
3256
|
+
u("4:5"), d("orbit");
|
|
2833
3257
|
}, []);
|
|
2834
|
-
let
|
|
3258
|
+
let F = t.find((e) => e.id === y) ?? (t.length === 1 ? t[0] : null), I = h === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
|
|
2835
3259
|
Y(() => {
|
|
2836
|
-
if (!
|
|
3260
|
+
if (!I) return;
|
|
2837
3261
|
let e = (e) => {
|
|
2838
|
-
e.key === "Escape" &&
|
|
3262
|
+
e.key === "Escape" && z();
|
|
2839
3263
|
};
|
|
2840
3264
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2841
3265
|
}), Y(() => {
|
|
2842
|
-
if (!
|
|
2843
|
-
let e =
|
|
2844
|
-
return
|
|
2845
|
-
e &&
|
|
3266
|
+
if (!I) return;
|
|
3267
|
+
let e = O.isPlaying();
|
|
3268
|
+
return O.pause(), () => {
|
|
3269
|
+
e && O.play();
|
|
2846
3270
|
};
|
|
2847
|
-
}, [
|
|
2848
|
-
let
|
|
2849
|
-
let t =
|
|
2850
|
-
t && (
|
|
2851
|
-
},
|
|
2852
|
-
let t =
|
|
2853
|
-
t &&
|
|
2854
|
-
},
|
|
2855
|
-
|
|
3271
|
+
}, [I]);
|
|
3272
|
+
let re = (e) => {
|
|
3273
|
+
let t = R(e);
|
|
3274
|
+
t && (b(n("loop", t)), g("live"));
|
|
3275
|
+
}, L = (e) => {
|
|
3276
|
+
let t = R(e);
|
|
3277
|
+
t && y && a(y, t);
|
|
3278
|
+
}, ie = () => {
|
|
3279
|
+
b(n("photo", {
|
|
2856
3280
|
fit: "cover",
|
|
2857
3281
|
x: 0,
|
|
2858
3282
|
y: 0,
|
|
2859
3283
|
w: e,
|
|
2860
3284
|
h: Math.round(e * s / o)
|
|
2861
|
-
})),
|
|
3285
|
+
})), g("live");
|
|
2862
3286
|
};
|
|
2863
3287
|
Y(() => {
|
|
2864
3288
|
let e = new URL(window.location.href), t = e.searchParams.get("start");
|
|
2865
|
-
t && (t === "effects" && (
|
|
3289
|
+
t && (t === "effects" && (v(!0), ie()), e.searchParams.delete("start"), window.history.replaceState(window.history.state, "", e));
|
|
2866
3290
|
}, []);
|
|
2867
|
-
let
|
|
3291
|
+
let ae = (t) => {
|
|
2868
3292
|
if (t === "fill") {
|
|
2869
|
-
|
|
3293
|
+
S("cover");
|
|
2870
3294
|
return;
|
|
2871
3295
|
}
|
|
2872
|
-
|
|
2873
|
-
let n =
|
|
2874
|
-
|
|
3296
|
+
S("contain"), u(t);
|
|
3297
|
+
let n = l[t];
|
|
3298
|
+
y && n && a(y, {
|
|
2875
3299
|
x: 0,
|
|
2876
3300
|
y: 0,
|
|
2877
3301
|
w: e,
|
|
2878
3302
|
h: Math.round(e * n.h / n.w)
|
|
2879
3303
|
});
|
|
2880
|
-
},
|
|
3304
|
+
}, z = () => {
|
|
2881
3305
|
for (let e of [...t]) r(e.id);
|
|
2882
|
-
|
|
3306
|
+
b(null), ee({
|
|
2883
3307
|
s: 1,
|
|
2884
3308
|
x: 0,
|
|
2885
3309
|
y: 0
|
|
2886
|
-
}),
|
|
3310
|
+
}), v(!1), g(m());
|
|
2887
3311
|
};
|
|
2888
3312
|
return /* @__PURE__ */ $("div", {
|
|
2889
3313
|
className: "kol-editor-randomiser relative h-dvh bg-black",
|
|
2890
3314
|
children: [
|
|
2891
3315
|
/* @__PURE__ */ Q("div", {
|
|
2892
|
-
ref:
|
|
3316
|
+
ref: k,
|
|
2893
3317
|
className: "absolute inset-y-0 left-0 touch-none overflow-hidden",
|
|
2894
3318
|
style: {
|
|
2895
|
-
transform:
|
|
3319
|
+
transform: M(D),
|
|
2896
3320
|
transformOrigin: "0 0",
|
|
2897
|
-
right:
|
|
2898
|
-
bottom:
|
|
3321
|
+
right: C ? "var(--kol-sidenav-w, 320px)" : 0,
|
|
3322
|
+
bottom: T ?? 0
|
|
2899
3323
|
},
|
|
2900
|
-
onPointerDownCapture:
|
|
2901
|
-
onPointerMoveCapture:
|
|
2902
|
-
onPointerUpCapture:
|
|
2903
|
-
onPointerCancelCapture:
|
|
2904
|
-
onPointerLeave:
|
|
2905
|
-
children: /* @__PURE__ */ Q(
|
|
3324
|
+
onPointerDownCapture: ne,
|
|
3325
|
+
onPointerMoveCapture: N,
|
|
3326
|
+
onPointerUpCapture: P,
|
|
3327
|
+
onPointerCancelCapture: P,
|
|
3328
|
+
onPointerLeave: P,
|
|
3329
|
+
children: /* @__PURE__ */ Q(Yt, { fit: x })
|
|
2906
3330
|
}),
|
|
2907
|
-
|
|
3331
|
+
h === "entry" && /* @__PURE__ */ Q(zi, {
|
|
2908
3332
|
chromes: f,
|
|
2909
|
-
onGenerate: () =>
|
|
3333
|
+
onGenerate: () => g("category"),
|
|
2910
3334
|
onEffects: () => {
|
|
2911
|
-
|
|
3335
|
+
v(!0), ie();
|
|
2912
3336
|
}
|
|
2913
3337
|
}),
|
|
2914
|
-
|
|
2915
|
-
onPick:
|
|
2916
|
-
onInsert:
|
|
2917
|
-
onBack: () =>
|
|
3338
|
+
h === "category" && /* @__PURE__ */ Q(Jr, {
|
|
3339
|
+
onPick: re,
|
|
3340
|
+
onInsert: ie,
|
|
3341
|
+
onBack: () => g("entry")
|
|
2918
3342
|
}),
|
|
2919
|
-
|
|
2920
|
-
layer:
|
|
2921
|
-
onSwitchCategory:
|
|
3343
|
+
h === "live" && !I && /* @__PURE__ */ Q(Ri, {
|
|
3344
|
+
layer: F,
|
|
3345
|
+
onSwitchCategory: L,
|
|
2922
3346
|
onInsert: () => {
|
|
2923
|
-
|
|
3347
|
+
z(), ie();
|
|
2924
3348
|
},
|
|
2925
|
-
onRestart:
|
|
2926
|
-
aspectValue:
|
|
2927
|
-
openEffects:
|
|
2928
|
-
onAspect:
|
|
3349
|
+
onRestart: z,
|
|
3350
|
+
aspectValue: x === "cover" ? "fill" : c,
|
|
3351
|
+
openEffects: _ && !I,
|
|
3352
|
+
onAspect: ae,
|
|
2929
3353
|
rail: !f && !p,
|
|
2930
|
-
onRail:
|
|
2931
|
-
onSheet:
|
|
3354
|
+
onRail: w,
|
|
3355
|
+
onSheet: E
|
|
2932
3356
|
}),
|
|
2933
|
-
|
|
3357
|
+
I && /* @__PURE__ */ $("div", {
|
|
2934
3358
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col",
|
|
2935
3359
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
2936
3360
|
children: [/* @__PURE__ */ Q("div", {
|
|
2937
3361
|
className: "flex-1 min-h-0",
|
|
2938
|
-
children: /* @__PURE__ */ Q(
|
|
3362
|
+
children: /* @__PURE__ */ Q(Zr, { layer: F })
|
|
2939
3363
|
}), /* @__PURE__ */ Q("div", {
|
|
2940
3364
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
2941
3365
|
children: /* @__PURE__ */ Q(K, {
|
|
2942
3366
|
tone: "outline",
|
|
2943
3367
|
size: "lg",
|
|
2944
|
-
onClick:
|
|
3368
|
+
onClick: z,
|
|
2945
3369
|
children: "Back"
|
|
2946
3370
|
})
|
|
2947
3371
|
})]
|
|
@@ -2949,11 +3373,11 @@ function Ti() {
|
|
|
2949
3373
|
]
|
|
2950
3374
|
});
|
|
2951
3375
|
}
|
|
2952
|
-
function
|
|
2953
|
-
return /* @__PURE__ */ $(
|
|
3376
|
+
function Vi() {
|
|
3377
|
+
return /* @__PURE__ */ $(mn, {
|
|
2954
3378
|
persistDraft: !1,
|
|
2955
|
-
children: [/* @__PURE__ */ Q(
|
|
3379
|
+
children: [/* @__PURE__ */ Q(Bi, {}), /* @__PURE__ */ Q(on, {})]
|
|
2956
3380
|
});
|
|
2957
3381
|
}
|
|
2958
3382
|
//#endregion
|
|
2959
|
-
export {
|
|
3383
|
+
export { xt as AppSettingsSections, St as BRAND, bn as DesignEditor, bn as default, bt as DisplaySettingsDrawer, mn as EditorProviders, At as FilesDialog, Be as GeneratorLibraryProvider, Si as LABS_DRAFT_KEY, Fe as LIBRARY_SLOT_KEYS, Ci as LabsView, dn as MODES, Vi as MobileView, Sn as OutputCanvas, Yt as OutputStage, Qt as OutputView, vn as RAIL_EXTRA_PREFIX, pt as TimelineRail, ze as UnauthorizedError, rn as VIEW_PATHS, _t as closeFiles, Ot as comboLabel, un as copyStored, Gt as currentView, gn as duplicateStored, Le as getLibraryApi, Pe as inviteFromRequest, Bt as isMobileDevice, ke as listInviteRequests, je as loadLibrary, Ve as mintInvite, an as openFiles, Ie as readLibraryRaw, b as registerPack, nn as removeStored, Wt as renameStored, We as requestInvite, Ae as setLibraryApi, Dn as setMediaClient, Kt as setMediaProxyBase, cn as setMode, Xt as setNavigator, qt as setRailExtras, k as setSettingsStore, fn as setThumbStored, Nt as setWantsDesktop, On as shortcutsBySection, Ue as signInLibrary, De as signOutLibrary, Te as signUpLibrary, Me as subscribeLibrary, mt as timelineView, He as updateAccount, Oe as useAccount, kt as useFilesDialog, Ne as useGeneratorLibrary, Ee as useLibrarySession, sn as useRailExtras, jt as useSettingsSections, xn as wantsDesktop, $t as withView };
|