@kolkrabbi/design-editor 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{core-CQuP1lUU.js → core-Cs-PEiuU.js} +3054 -2690
- package/dist/core.js +2 -2
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +590 -337
- package/package.json +7 -7
package/dist/design-editor.js
CHANGED
|
@@ -9,25 +9,26 @@ import { n as rt, r as it, t as at } from "./BindDot-Don6fG00.js";
|
|
|
9
9
|
import { n as ot, r as st } from "./effects-RqPdJrRb.js";
|
|
10
10
|
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-DKZGyk14.js";
|
|
11
11
|
import { n as pt, r as mt, t as ht } from "./Timeline-BKYyRqYg.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,
|
|
13
|
-
import { Button as K, Divider as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { Icon as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
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, _t as Wt, a as Gt, at as Kt, b as qt, c as Jt, ct as Yt, d as Xt, dt as Zt, et as Qt, f as $t, ft as en, g as tn, gt as nn, h as rn, ht as an, i as on, it as sn, j as cn, k as ln, l as un, lt as dn, m as fn, mt as pn, n as mn, nt as hn, o as gn, ot as _n, p as vn, pt as yn, q as bn, r as xn, rt as Sn, s as Cn, st as wn, t as Tn, tt as En, u as Dn, ut as On, v as kn, vt as An, w as jn, x as Mn, y as Nn, z as Pn } from "./core-Cs-PEiuU.js";
|
|
13
|
+
import { Button as K, Divider as Fn, Dropdown as In, LabeledControlSection as q, MultiSelect as Ln, SegmentedToggle as J, SettingsRow as Rn, StepList as zn, Tag as Bn, ToggleSwitch as Vn, Tooltip as Hn, useGrabEdge as Un, useMediaQuery as Wn, useModal as Gn } from "@kolkrabbi/kol-component";
|
|
14
|
+
import { createContext as Kn, useContext as qn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Jn } from "react";
|
|
15
|
+
import { Fragment as Yn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
16
|
+
import { Icon as Xn } from "@kolkrabbi/kol-icons";
|
|
17
|
+
import { AppFloatNav as Zn, DocumentCapsule as Qn, FloatLayout as $n, GlobalActions as er, PropertyRail as tr } from "@kolkrabbi/kol-shell";
|
|
18
|
+
import { useDragResize as nr, useTheme as rr } from "@kolkrabbi/kol-framework";
|
|
19
|
+
import { createPortal as ir } from "react-dom";
|
|
19
20
|
//#region src/phoneFloats.js
|
|
20
|
-
var
|
|
21
|
+
var ar = (e) => {
|
|
21
22
|
let t = e, n = /* @__PURE__ */ new Set(), r = (e) => (n.add(e), () => n.delete(e));
|
|
22
23
|
return {
|
|
23
24
|
set: (e) => {
|
|
24
25
|
e !== t && (t = e, n.forEach((e) => e()));
|
|
25
26
|
},
|
|
26
|
-
use: () =>
|
|
27
|
+
use: () => Jn(r, () => t, () => t)
|
|
27
28
|
};
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
var
|
|
29
|
+
}, or = ar(null), sr = ar(null), cr = or.set;
|
|
30
|
+
or.use, sr.set;
|
|
31
|
+
var lr = sr.use, ur = [
|
|
31
32
|
{
|
|
32
33
|
id: "shape",
|
|
33
34
|
label: "Shape",
|
|
@@ -43,7 +44,7 @@ var Qn = Xn.use, $n = [
|
|
|
43
44
|
label: "Crossfade",
|
|
44
45
|
icon: "dashed-circle"
|
|
45
46
|
}
|
|
46
|
-
],
|
|
47
|
+
], dr = {
|
|
47
48
|
shape: [
|
|
48
49
|
["Loops", ["morph-circle", "star-morph"]],
|
|
49
50
|
["Loops", [
|
|
@@ -117,21 +118,21 @@ var Qn = Xn.use, $n = [
|
|
|
117
118
|
2
|
|
118
119
|
]
|
|
119
120
|
]
|
|
120
|
-
},
|
|
121
|
-
function
|
|
122
|
-
if (!
|
|
123
|
-
|
|
121
|
+
}, fr = null;
|
|
122
|
+
function pr(e) {
|
|
123
|
+
if (!fr) {
|
|
124
|
+
fr = /* @__PURE__ */ new Map();
|
|
124
125
|
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),
|
|
126
|
+
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id), fr.has(n.loop) || fr.set(n.loop, []), fr.get(n.loop).push(n));
|
|
126
127
|
}
|
|
127
|
-
return
|
|
128
|
+
return fr.get(e) ?? [];
|
|
128
129
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
130
|
+
var mr = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), hr = null;
|
|
131
|
+
function gr() {
|
|
132
|
+
if (hr) return hr;
|
|
132
133
|
let e = [];
|
|
133
|
-
for (let t of
|
|
134
|
-
let [r] = n, i = t.id === "blend" ?
|
|
134
|
+
for (let t of ur) for (let n of dr[t.id]) {
|
|
135
|
+
let [r] = n, i = t.id === "blend" ? mr(pr(n[1]), n[2]) : n[1].map((e) => pr(e)[0]);
|
|
135
136
|
if (!i || i.some((e) => !e) || new Set(i.map((e) => e.id)).size < i.length) continue;
|
|
136
137
|
let a = i.map((e) => e.label).join(" → "), o = `ship:morph:${t.id}:${i.map((e) => e.id).join("--")}`;
|
|
137
138
|
e.push({
|
|
@@ -154,24 +155,24 @@ function ar() {
|
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
|
-
return
|
|
158
|
+
return hr = e;
|
|
158
159
|
}
|
|
159
|
-
var
|
|
160
|
+
var _r = () => ur.map((e) => ({
|
|
160
161
|
label: e.label,
|
|
161
|
-
subs: [...new Set(
|
|
162
|
-
})),
|
|
163
|
-
function
|
|
162
|
+
subs: [...new Set(gr().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
163
|
+
})), vr = (e, t) => gr().find((n) => n.type === e && (!t || n.category === t)), yr = (e) => gr().find((t) => t.id === e);
|
|
164
|
+
function br(e) {
|
|
164
165
|
e && (Qe({
|
|
165
166
|
active: !0,
|
|
166
167
|
...e.morph,
|
|
167
168
|
fileId: null,
|
|
168
169
|
fileName: e.label,
|
|
169
170
|
presetId: e.id
|
|
170
|
-
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) ||
|
|
171
|
+
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || pn("/morph"));
|
|
171
172
|
}
|
|
172
173
|
//#endregion
|
|
173
174
|
//#region src/editor/labs/catalog.js
|
|
174
|
-
var
|
|
175
|
+
var xr = {
|
|
175
176
|
"fx:halftone": "ptrn-dot",
|
|
176
177
|
"fx:scanline": "grid-horizontal",
|
|
177
178
|
"fx:crt": "desktop",
|
|
@@ -195,19 +196,19 @@ var ur = {
|
|
|
195
196
|
"misc:Para Type": "aa",
|
|
196
197
|
"vec:Distressor": "scribble",
|
|
197
198
|
"vec:Modulator": "dashed-circle"
|
|
198
|
-
},
|
|
199
|
+
}, Sr = {
|
|
199
200
|
effects: "filter",
|
|
200
201
|
generative: "layers",
|
|
201
202
|
vector: "pen-nib",
|
|
202
203
|
composition: "type",
|
|
203
204
|
morph: "swap",
|
|
204
205
|
mode: "mode-toggle-01"
|
|
205
|
-
},
|
|
206
|
+
}, Cr = [
|
|
206
207
|
"Moiré",
|
|
207
208
|
"Mesh Gradient",
|
|
208
209
|
"Reaction",
|
|
209
210
|
"Halftone"
|
|
210
|
-
],
|
|
211
|
+
], wr = [
|
|
211
212
|
{
|
|
212
213
|
label: "Spaced",
|
|
213
214
|
patch: {
|
|
@@ -239,11 +240,11 @@ var ur = {
|
|
|
239
240
|
label: "Spiral",
|
|
240
241
|
patch: { geometry: "spiral" }
|
|
241
242
|
}
|
|
242
|
-
],
|
|
243
|
+
], Tr = (e = {}) => {
|
|
243
244
|
let t = e.geometry ?? "rows";
|
|
244
245
|
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
245
246
|
};
|
|
246
|
-
function
|
|
247
|
+
function Er({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
247
248
|
let a = () => e?.type === "photo" ? (e.filters ?? []).filter((e) => e?.id === "fx-media") : [], o = (e, o) => {
|
|
248
249
|
let s = a(), c = t("photo", {
|
|
249
250
|
...i(),
|
|
@@ -300,19 +301,19 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
300
301
|
...oe(L).map((t) => ({
|
|
301
302
|
id: `fx:${t.id}`,
|
|
302
303
|
label: t.label,
|
|
303
|
-
icon:
|
|
304
|
+
icon: xr[`fx:${t.id}`] ?? "square",
|
|
304
305
|
pages: t.rack ? se.map((t) => ({
|
|
305
306
|
label: t.label,
|
|
306
307
|
onSelect: () => s(t.id),
|
|
307
308
|
active: e?.fxGroup === t.id
|
|
308
|
-
})) : t.id === "pattern" ?
|
|
309
|
+
})) : t.id === "pattern" ? Cr.map((t) => ({
|
|
309
310
|
label: t,
|
|
310
311
|
onSelect: () => c(ne("optic", t)[0], "optic"),
|
|
311
312
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
312
|
-
})) : t.id === "scanline" ?
|
|
313
|
+
})) : t.id === "scanline" ? wr.map((t) => ({
|
|
313
314
|
label: t.label,
|
|
314
315
|
onSelect: () => o("scanline", t.patch),
|
|
315
|
-
active: !e?.fxGroup && d === "scanline" &&
|
|
316
|
+
active: !e?.fxGroup && d === "scanline" && Tr((e?.filters ?? []).find((e) => e?.id === "scanline")?.params) === t.label
|
|
316
317
|
})) : t.filters.map((t) => ({
|
|
317
318
|
label: t.label ?? t.id,
|
|
318
319
|
onSelect: () => o(t.id),
|
|
@@ -326,22 +327,22 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
326
327
|
...we.map((e) => ({
|
|
327
328
|
id: `gen:${e.label}`,
|
|
328
329
|
label: e.label,
|
|
329
|
-
icon:
|
|
330
|
+
icon: xr[`gen:${e.label}`] ?? "square",
|
|
330
331
|
pages: m(e)
|
|
331
332
|
})),
|
|
332
333
|
{
|
|
333
334
|
id: "sec:morph",
|
|
334
335
|
label: "Morph"
|
|
335
336
|
},
|
|
336
|
-
|
|
337
|
+
...ur.map((e) => ({
|
|
337
338
|
id: `morph:${e.id}`,
|
|
338
339
|
label: e.label,
|
|
339
340
|
icon: e.icon,
|
|
340
|
-
pages: [...new Set(
|
|
341
|
+
pages: [...new Set(gr().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
341
342
|
label: t,
|
|
342
|
-
onSelect: () =>
|
|
343
|
+
onSelect: () => br(vr(e.id, t)),
|
|
343
344
|
active: (() => {
|
|
344
|
-
let n =
|
|
345
|
+
let n = gr().find((e) => e.id === Ze().presetId);
|
|
345
346
|
return n?.type === e.id && n.category === t;
|
|
346
347
|
})()
|
|
347
348
|
}))
|
|
@@ -353,13 +354,13 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
353
354
|
{
|
|
354
355
|
id: "vec:Distressor",
|
|
355
356
|
label: "Distressor",
|
|
356
|
-
icon:
|
|
357
|
+
icon: xr["vec:Distressor"] ?? "square",
|
|
357
358
|
pages: p("distress")
|
|
358
359
|
},
|
|
359
360
|
{
|
|
360
361
|
id: "vec:Modulator",
|
|
361
362
|
label: "Modulator",
|
|
362
|
-
icon:
|
|
363
|
+
icon: xr["vec:Modulator"] ?? "square",
|
|
363
364
|
pages: p("modulator")
|
|
364
365
|
},
|
|
365
366
|
{
|
|
@@ -369,7 +370,7 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
369
370
|
...ct.map((t) => ({
|
|
370
371
|
id: `kin:${t.label}`,
|
|
371
372
|
label: t.label,
|
|
372
|
-
icon:
|
|
373
|
+
icon: xr[`kin:${t.label}`] ?? "square",
|
|
373
374
|
pages: t.subs.map((t) => ({
|
|
374
375
|
label: t,
|
|
375
376
|
onSelect: () => l(lt.find((e) => e.sub === t)),
|
|
@@ -379,14 +380,14 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
379
380
|
...fe.map((e) => ({
|
|
380
381
|
id: `misc:${e.label}`,
|
|
381
382
|
label: e.label,
|
|
382
|
-
icon:
|
|
383
|
+
icon: xr[`misc:${e.label}`] ?? "square",
|
|
383
384
|
pages: e.groups.flatMap((e) => p(e, "misc"))
|
|
384
385
|
}))
|
|
385
386
|
];
|
|
386
387
|
}
|
|
387
388
|
//#endregion
|
|
388
389
|
//#region src/editor/labs/LabsNav.jsx
|
|
389
|
-
function
|
|
390
|
+
function Dr() {
|
|
390
391
|
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
391
392
|
Y(() => {
|
|
392
393
|
n?.type === "photo" && n.src && (i.current = {
|
|
@@ -400,7 +401,7 @@ function gr() {
|
|
|
400
401
|
n?.srcType,
|
|
401
402
|
n?.fit
|
|
402
403
|
]);
|
|
403
|
-
let a =
|
|
404
|
+
let a = Er({
|
|
404
405
|
layer: n,
|
|
405
406
|
setOnly: r,
|
|
406
407
|
addFilter: e,
|
|
@@ -417,14 +418,14 @@ function gr() {
|
|
|
417
418
|
if (n.id.startsWith("sec:")) {
|
|
418
419
|
let e = n.id.slice(4);
|
|
419
420
|
t.push({
|
|
420
|
-
icon:
|
|
421
|
-
path: `${
|
|
421
|
+
icon: Sr[e] ?? "square",
|
|
422
|
+
path: `${Jt}${n.id}`,
|
|
422
423
|
label: n.label,
|
|
423
424
|
sub: []
|
|
424
425
|
});
|
|
425
426
|
return;
|
|
426
427
|
}
|
|
427
|
-
let r = `${
|
|
428
|
+
let r = `${Jt}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
428
429
|
a && e.set(r, a);
|
|
429
430
|
let o = t[t.length - 1], s = {
|
|
430
431
|
icon: n.icon,
|
|
@@ -432,18 +433,18 @@ function gr() {
|
|
|
432
433
|
label: n.label
|
|
433
434
|
};
|
|
434
435
|
o?.sub ? o.sub.push(s) : t.push(s);
|
|
435
|
-
}),
|
|
436
|
+
}), un({
|
|
436
437
|
items: t,
|
|
437
438
|
dispatch: (t) => {
|
|
438
439
|
let n = e.get(t);
|
|
439
440
|
return n ? (n(), !0) : !1;
|
|
440
441
|
}
|
|
441
|
-
}), () =>
|
|
442
|
+
}), () => un(null);
|
|
442
443
|
}), null;
|
|
443
444
|
}
|
|
444
445
|
//#endregion
|
|
445
446
|
//#region src/editor/morph/MorphTab.jsx
|
|
446
|
-
var
|
|
447
|
+
var Or = (e, t) => JSON.stringify(e) === JSON.stringify(t), kr = [
|
|
447
448
|
{
|
|
448
449
|
key: "curve",
|
|
449
450
|
label: "Curve",
|
|
@@ -476,8 +477,8 @@ var _r = (e, t) => JSON.stringify(e) === JSON.stringify(t), vr = [
|
|
|
476
477
|
when: (e) => e.mode === "shape"
|
|
477
478
|
}
|
|
478
479
|
];
|
|
479
|
-
function
|
|
480
|
-
let r = s(), i = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = i, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = W(), { buildSavedSpec: C } =
|
|
480
|
+
function Ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
481
|
+
let r = s(), i = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = i, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = W(), { buildSavedSpec: C } = Et(), { addItem: w, updateItem: T } = He(), E = Gn(), 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) => !Bt(U(e.loopId)) || !Vt(U(e.loopId))), P = N.length === 0, F = {
|
|
481
482
|
blend: ne ? null : "Blend tweens one generator — these steps are different generators",
|
|
482
483
|
shape: P ? null : `No outline to morph: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`,
|
|
483
484
|
crossfade: P ? null : `Cannot fade: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`
|
|
@@ -574,7 +575,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
574
575
|
morph: r,
|
|
575
576
|
morphT: {
|
|
576
577
|
bind: "track",
|
|
577
|
-
keys:
|
|
578
|
+
keys: Ht(c.length, u, l)
|
|
578
579
|
}
|
|
579
580
|
};
|
|
580
581
|
e ? _(e.id, a) : S("loop", a);
|
|
@@ -598,7 +599,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
598
599
|
]), Y(() => {
|
|
599
600
|
if (t || m == null || !e) return;
|
|
600
601
|
let n = et(e, U(e.loopId)?.params ?? []);
|
|
601
|
-
|
|
602
|
+
Or(n, c[m]?.params) || Xe(m, n);
|
|
602
603
|
}, [e]), Y(() => {
|
|
603
604
|
t || !D || m == null || (G({ editing: null }), ae.current = null);
|
|
604
605
|
}, [
|
|
@@ -636,17 +637,17 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
636
637
|
!t && /* @__PURE__ */ Q(q, {
|
|
637
638
|
divided: !0,
|
|
638
639
|
children: /* @__PURE__ */ Q(ue, {
|
|
639
|
-
tree:
|
|
640
|
-
presets:
|
|
641
|
-
current:
|
|
640
|
+
tree: _r(),
|
|
641
|
+
presets: gr(),
|
|
642
|
+
current: yr(i.presetId) ?? { typeLabel: ur.find((e) => e.id === d)?.label },
|
|
642
643
|
subLabel: (e) => e.split(" · ").pop(),
|
|
643
|
-
onPick:
|
|
644
|
+
onPick: br
|
|
644
645
|
})
|
|
645
646
|
}),
|
|
646
647
|
/* @__PURE__ */ $(q, {
|
|
647
648
|
divided: !0,
|
|
648
649
|
children: [
|
|
649
|
-
/* @__PURE__ */ Q(
|
|
650
|
+
/* @__PURE__ */ Q(zn, {
|
|
650
651
|
items: c.map((e, t) => ({
|
|
651
652
|
id: t,
|
|
652
653
|
label: Ke(e, t)
|
|
@@ -708,7 +709,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
708
709
|
]
|
|
709
710
|
}),
|
|
710
711
|
/* @__PURE__ */ Q(A, {
|
|
711
|
-
schema:
|
|
712
|
+
schema: kr,
|
|
712
713
|
layer: i,
|
|
713
714
|
setProp: (e, n) => {
|
|
714
715
|
!t && (typeof n != "object" || !n) && G({ [e]: n });
|
|
@@ -758,7 +759,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
758
759
|
}
|
|
759
760
|
//#endregion
|
|
760
761
|
//#region src/editor/params/QuickMotion.jsx
|
|
761
|
-
var
|
|
762
|
+
var jr = [
|
|
762
763
|
{
|
|
763
764
|
value: "breathe",
|
|
764
765
|
label: "Breathe",
|
|
@@ -777,14 +778,14 @@ var br = [
|
|
|
777
778
|
source: "lfo-square",
|
|
778
779
|
rate: 8
|
|
779
780
|
}
|
|
780
|
-
],
|
|
781
|
-
function
|
|
781
|
+
], Mr = .2;
|
|
782
|
+
function Nr(e) {
|
|
782
783
|
if (!r(e)) return "off";
|
|
783
784
|
if (e.bind !== "mod") return "custom";
|
|
784
|
-
let t =
|
|
785
|
+
let t = jr.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
785
786
|
return t ? t.value : "custom";
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
+
function Pr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
788
789
|
let a = s(), o = _(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && v(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
789
790
|
if (!o.length) return null;
|
|
790
791
|
let c = (e, r) => {
|
|
@@ -794,9 +795,9 @@ function Cr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
794
795
|
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : b(i, O.getCtx(), t) ?? e.default ?? e.min);
|
|
795
796
|
return;
|
|
796
797
|
}
|
|
797
|
-
let a =
|
|
798
|
+
let a = jr.find((e) => e.value === r);
|
|
798
799
|
if (!a) return;
|
|
799
|
-
let o = Number(b(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) *
|
|
800
|
+
let o = Number(b(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) * Mr, c = Math.max(e.min, o - s), l = Math.min(e.max, o + s);
|
|
800
801
|
n(e.key, {
|
|
801
802
|
bind: "mod",
|
|
802
803
|
source: a.source,
|
|
@@ -810,12 +811,12 @@ function Cr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
810
811
|
label: r,
|
|
811
812
|
divided: !0,
|
|
812
813
|
children: o.map((e) => {
|
|
813
|
-
let n =
|
|
814
|
+
let n = Nr(t[e.key]), r = [
|
|
814
815
|
{
|
|
815
816
|
value: "off",
|
|
816
817
|
label: "Off"
|
|
817
818
|
},
|
|
818
|
-
...
|
|
819
|
+
...jr.map(({ value: e, label: t }) => ({
|
|
819
820
|
value: e,
|
|
820
821
|
label: t
|
|
821
822
|
})),
|
|
@@ -824,11 +825,11 @@ function Cr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
824
825
|
label: "Custom"
|
|
825
826
|
}] : []
|
|
826
827
|
];
|
|
827
|
-
return /* @__PURE__ */ Q(
|
|
828
|
+
return /* @__PURE__ */ Q(Rn, {
|
|
828
829
|
label: e.label,
|
|
829
830
|
align: "fill",
|
|
830
831
|
labelWidth: i,
|
|
831
|
-
children: /* @__PURE__ */ Q(
|
|
832
|
+
children: /* @__PURE__ */ Q(In, {
|
|
832
833
|
size: a,
|
|
833
834
|
variant: "subtle",
|
|
834
835
|
className: "w-full",
|
|
@@ -842,7 +843,7 @@ function Cr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
842
843
|
}
|
|
843
844
|
//#endregion
|
|
844
845
|
//#region src/editor/params/InputRows.jsx
|
|
845
|
-
var
|
|
846
|
+
var Fr = [
|
|
846
847
|
{
|
|
847
848
|
value: "off",
|
|
848
849
|
label: "Off"
|
|
@@ -867,13 +868,13 @@ var wr = [
|
|
|
867
868
|
value: "lfo-sine",
|
|
868
869
|
label: "LFO"
|
|
869
870
|
}
|
|
870
|
-
],
|
|
871
|
-
function
|
|
871
|
+
], Ir = new Set(Fr.map((e) => e.value));
|
|
872
|
+
function Lr({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
872
873
|
let a = s(), o = _(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
873
874
|
if (!o.length) return null;
|
|
874
875
|
let c = new Map(o.map((e) => [e.key, e])), l = (i ?? []).filter((e) => c.has(e)), u = [...l, ...o.map((e) => e.key).filter((e) => !l.includes(e))], d = l.length ? l : u.slice(0, 3), f = (e) => {
|
|
875
876
|
let n = t[e];
|
|
876
|
-
return r(n) && n.bind === "mod" &&
|
|
877
|
+
return r(n) && n.bind === "mod" && Ir.has(n.source);
|
|
877
878
|
}, p = u.filter(f), m = (e) => {
|
|
878
879
|
let n = c.get(e);
|
|
879
880
|
return Number(b(t[e], O.getCtx(), t) ?? n.default ?? n.min);
|
|
@@ -892,13 +893,13 @@ function Er({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
892
893
|
return /* @__PURE__ */ $(q, {
|
|
893
894
|
label: "Inputs",
|
|
894
895
|
divided: !0,
|
|
895
|
-
children: [p.map((e) => /* @__PURE__ */ Q(
|
|
896
|
+
children: [p.map((e) => /* @__PURE__ */ Q(Ln, {
|
|
896
897
|
size: a,
|
|
897
898
|
className: "w-full [&>button]:w-full",
|
|
898
899
|
groups: [{
|
|
899
900
|
id: "source",
|
|
900
901
|
label: "Source",
|
|
901
|
-
options:
|
|
902
|
+
options: Fr
|
|
902
903
|
}, {
|
|
903
904
|
id: "drives",
|
|
904
905
|
label: "Drives",
|
|
@@ -911,7 +912,7 @@ function Er({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
911
912
|
source: t[e].source,
|
|
912
913
|
drives: e
|
|
913
914
|
},
|
|
914
|
-
label: `${
|
|
915
|
+
label: `${Fr.find((n) => n.value === t[e].source)?.label} → ${c.get(e).label}`,
|
|
915
916
|
onChange: (n, r) => {
|
|
916
917
|
if (n === "source") {
|
|
917
918
|
r === "off" ? g(e) : h(e, r);
|
|
@@ -932,8 +933,8 @@ function Er({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
932
933
|
}
|
|
933
934
|
//#endregion
|
|
934
935
|
//#region src/editor/labs/ModelSource.jsx
|
|
935
|
-
var
|
|
936
|
-
function
|
|
936
|
+
var Rr = /\.(obj|glb|gltf|stl)$/i, zr = (e) => Rr.test(e.key ?? e.name ?? ""), Br = (e) => (e.match(Rr)?.[1] ?? "obj").toLowerCase(), Vr = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
937
|
+
function Hr({ layer: e, setProp: t }) {
|
|
937
938
|
let n = s(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
938
939
|
t("meshSrc", e), t("meshType", n);
|
|
939
940
|
};
|
|
@@ -943,7 +944,7 @@ function jr({ layer: e, setProp: t }) {
|
|
|
943
944
|
children: [
|
|
944
945
|
/* @__PURE__ */ Q("span", {
|
|
945
946
|
className: "kol-mono-12 text-meta truncate",
|
|
946
|
-
children:
|
|
947
|
+
children: Vr(e.meshSrc)
|
|
947
948
|
}),
|
|
948
949
|
/* @__PURE__ */ $("div", {
|
|
949
950
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -968,15 +969,15 @@ function jr({ layer: e, setProp: t }) {
|
|
|
968
969
|
let t = e.target.files?.[0];
|
|
969
970
|
if (e.target.value = "", !t) return;
|
|
970
971
|
let n = new FileReader();
|
|
971
|
-
n.onload = () => o(n.result,
|
|
972
|
+
n.onload = () => o(n.result, Br(t.name)), n.readAsDataURL(t);
|
|
972
973
|
}
|
|
973
974
|
}),
|
|
974
|
-
/* @__PURE__ */ Q(
|
|
975
|
+
/* @__PURE__ */ Q(Ft, {
|
|
975
976
|
open: r,
|
|
976
|
-
accept:
|
|
977
|
+
accept: zr,
|
|
977
978
|
onClose: () => i(!1),
|
|
978
979
|
onSelect: (e) => {
|
|
979
|
-
i(!1), o(
|
|
980
|
+
i(!1), o(jn(e), Br(e));
|
|
980
981
|
}
|
|
981
982
|
})
|
|
982
983
|
]
|
|
@@ -984,23 +985,23 @@ function jr({ layer: e, setProp: t }) {
|
|
|
984
985
|
}
|
|
985
986
|
//#endregion
|
|
986
987
|
//#region src/editor/labs/useLabsKeys.js
|
|
987
|
-
function
|
|
988
|
+
function Ur(e, t) {
|
|
988
989
|
Y(() => {
|
|
989
990
|
let n = (n) => {
|
|
990
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
991
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || zt(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
991
992
|
};
|
|
992
993
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
993
994
|
});
|
|
994
995
|
}
|
|
995
996
|
//#endregion
|
|
996
997
|
//#region src/editor/labs/LabsParams.jsx
|
|
997
|
-
var
|
|
998
|
+
var Wr = [{
|
|
998
999
|
value: "effect",
|
|
999
1000
|
label: "Effect"
|
|
1000
1001
|
}, {
|
|
1001
1002
|
value: "anim",
|
|
1002
1003
|
label: "Motion"
|
|
1003
|
-
}],
|
|
1004
|
+
}], Gr = [
|
|
1004
1005
|
{
|
|
1005
1006
|
value: "generate",
|
|
1006
1007
|
label: "Generate"
|
|
@@ -1013,7 +1014,7 @@ var Nr = [{
|
|
|
1013
1014
|
value: "anim",
|
|
1014
1015
|
label: "Animation"
|
|
1015
1016
|
}
|
|
1016
|
-
],
|
|
1017
|
+
], Kr = [
|
|
1017
1018
|
{
|
|
1018
1019
|
value: "generate",
|
|
1019
1020
|
label: "Gen"
|
|
@@ -1027,11 +1028,11 @@ var Nr = [{
|
|
|
1027
1028
|
label: "Anim"
|
|
1028
1029
|
}
|
|
1029
1030
|
];
|
|
1030
|
-
function
|
|
1031
|
+
function qr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
|
|
1031
1032
|
let o = s();
|
|
1032
1033
|
return e?.length ? i ? /* @__PURE__ */ Q("div", {
|
|
1033
1034
|
className: "flex items-center gap-1 flex-wrap",
|
|
1034
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1035
|
+
children: e.map((e) => /* @__PURE__ */ Q(Bn, {
|
|
1035
1036
|
size: "xs",
|
|
1036
1037
|
hash: !1,
|
|
1037
1038
|
active: e.value === t,
|
|
@@ -1048,13 +1049,13 @@ function Ir({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
|
|
|
1048
1049
|
className: a(o)
|
|
1049
1050
|
}) : null;
|
|
1050
1051
|
}
|
|
1051
|
-
function
|
|
1052
|
+
function Jr() {
|
|
1052
1053
|
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = s(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1053
1054
|
"aria-hidden": "true",
|
|
1054
1055
|
className: "invisible pointer-events-none",
|
|
1055
1056
|
children: t
|
|
1056
1057
|
});
|
|
1057
|
-
return /* @__PURE__ */ $(
|
|
1058
|
+
return /* @__PURE__ */ $(Yn, { children: [a(n, /* @__PURE__ */ Q(Hn, {
|
|
1058
1059
|
label: "Undo",
|
|
1059
1060
|
shortcut: "⌘Z",
|
|
1060
1061
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1064,7 +1065,7 @@ function Lr() {
|
|
|
1064
1065
|
tabIndex: n ? void 0 : -1,
|
|
1065
1066
|
onClick: e
|
|
1066
1067
|
})
|
|
1067
|
-
})), a(r, /* @__PURE__ */ Q(
|
|
1068
|
+
})), a(r, /* @__PURE__ */ Q(Hn, {
|
|
1068
1069
|
label: "Redo",
|
|
1069
1070
|
shortcut: "⇧⌘Z",
|
|
1070
1071
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1076,7 +1077,7 @@ function Lr() {
|
|
|
1076
1077
|
})
|
|
1077
1078
|
}))] });
|
|
1078
1079
|
}
|
|
1079
|
-
function
|
|
1080
|
+
function Yr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tabStrip: c, preStrip: l, fx: u = !1, scope: d, ghostLabels: f, children: p }) {
|
|
1080
1081
|
let m = s() === "sm";
|
|
1081
1082
|
return /* @__PURE__ */ $("div", {
|
|
1082
1083
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
@@ -1087,9 +1088,9 @@ function Rr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tab
|
|
|
1087
1088
|
children: [/* @__PURE__ */ Q("p", {
|
|
1088
1089
|
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
1089
1090
|
children: o
|
|
1090
|
-
}), /* @__PURE__ */ Q(
|
|
1091
|
+
}), /* @__PURE__ */ Q(Jr, {})]
|
|
1091
1092
|
}),
|
|
1092
|
-
e && /* @__PURE__ */ Q(
|
|
1093
|
+
e && /* @__PURE__ */ Q(qr, {
|
|
1093
1094
|
options: e,
|
|
1094
1095
|
active: t,
|
|
1095
1096
|
onPick: n,
|
|
@@ -1111,7 +1112,7 @@ function Rr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tab
|
|
|
1111
1112
|
]
|
|
1112
1113
|
});
|
|
1113
1114
|
}
|
|
1114
|
-
function
|
|
1115
|
+
function Xr({ layer: t, showMod: n }) {
|
|
1115
1116
|
let r = l(), c = s(), [u, d] = Z("effect");
|
|
1116
1117
|
Y(() => {
|
|
1117
1118
|
let e = () => d("effect");
|
|
@@ -1153,7 +1154,7 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1153
1154
|
} : t);
|
|
1154
1155
|
b(t.id, { filters: n });
|
|
1155
1156
|
};
|
|
1156
|
-
|
|
1157
|
+
Ur(() => {
|
|
1157
1158
|
O && b(t.id, { filters: P.map((e, t) => t === 0 ? {
|
|
1158
1159
|
...e,
|
|
1159
1160
|
params: {}
|
|
@@ -1179,34 +1180,34 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1179
1180
|
value: e.id,
|
|
1180
1181
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1181
1182
|
}))];
|
|
1182
|
-
return /* @__PURE__ */ $(
|
|
1183
|
+
return /* @__PURE__ */ $(Yr, {
|
|
1183
1184
|
title: "Effects",
|
|
1184
1185
|
fx: !0,
|
|
1185
1186
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1186
1187
|
tone: "sunken",
|
|
1187
1188
|
value: u,
|
|
1188
1189
|
onChange: d,
|
|
1189
|
-
options:
|
|
1190
|
+
options: Wr,
|
|
1190
1191
|
size: c,
|
|
1191
1192
|
className: a(c)
|
|
1192
1193
|
}),
|
|
1193
|
-
children: [u === "effect" && /* @__PURE__ */ $(
|
|
1194
|
+
children: [u === "effect" && /* @__PURE__ */ $(Yn, { children: [
|
|
1194
1195
|
/* @__PURE__ */ $(q, {
|
|
1195
1196
|
label: "Effect stack",
|
|
1196
1197
|
divided: !0,
|
|
1197
1198
|
children: [C.length === 0 && /* @__PURE__ */ Q(j, {
|
|
1198
1199
|
className: "kol-mono-10 text-meta",
|
|
1199
1200
|
children: "No effects yet — add one below."
|
|
1200
|
-
}), /* @__PURE__ */ Q(
|
|
1201
|
+
}), /* @__PURE__ */ Q(ei, {
|
|
1201
1202
|
...e,
|
|
1202
1203
|
from: 0
|
|
1203
1204
|
})]
|
|
1204
1205
|
}),
|
|
1205
|
-
/* @__PURE__ */ Q(
|
|
1206
|
+
/* @__PURE__ */ Q(Fn, {}),
|
|
1206
1207
|
C.length < 8 && /* @__PURE__ */ Q(q, {
|
|
1207
1208
|
label: V.label,
|
|
1208
1209
|
divided: !0,
|
|
1209
|
-
children: /* @__PURE__ */ Q(
|
|
1210
|
+
children: /* @__PURE__ */ Q(In, {
|
|
1210
1211
|
variant: "subtle",
|
|
1211
1212
|
size: c,
|
|
1212
1213
|
className: "w-full",
|
|
@@ -1224,7 +1225,7 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1224
1225
|
})]
|
|
1225
1226
|
});
|
|
1226
1227
|
}
|
|
1227
|
-
if (!O) return /* @__PURE__ */ Q(
|
|
1228
|
+
if (!O) return /* @__PURE__ */ Q(Yr, {
|
|
1228
1229
|
chips: M,
|
|
1229
1230
|
active: null,
|
|
1230
1231
|
onPick: N,
|
|
@@ -1234,12 +1235,12 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1234
1235
|
tone: "sunken",
|
|
1235
1236
|
value: u,
|
|
1236
1237
|
onChange: d,
|
|
1237
|
-
options:
|
|
1238
|
+
options: Wr,
|
|
1238
1239
|
size: c,
|
|
1239
1240
|
className: a(c)
|
|
1240
1241
|
}),
|
|
1241
1242
|
children: /* @__PURE__ */ Q(A, {
|
|
1242
|
-
schema:
|
|
1243
|
+
schema: Mn,
|
|
1243
1244
|
layer: t,
|
|
1244
1245
|
setProp: S.setProp,
|
|
1245
1246
|
palette: x,
|
|
@@ -1268,7 +1269,7 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1268
1269
|
renderAnimate: ie,
|
|
1269
1270
|
inline: !0
|
|
1270
1271
|
};
|
|
1271
|
-
return /* @__PURE__ */ $(
|
|
1272
|
+
return /* @__PURE__ */ $(Yr, {
|
|
1272
1273
|
chips: M,
|
|
1273
1274
|
active: O.id,
|
|
1274
1275
|
onPick: N,
|
|
@@ -1281,11 +1282,11 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1281
1282
|
tone: "sunken",
|
|
1282
1283
|
value: u,
|
|
1283
1284
|
onChange: d,
|
|
1284
|
-
options:
|
|
1285
|
+
options: Wr,
|
|
1285
1286
|
size: c,
|
|
1286
1287
|
className: a(c)
|
|
1287
1288
|
}),
|
|
1288
|
-
children: [u === "effect" && /* @__PURE__ */ $(
|
|
1289
|
+
children: [u === "effect" && /* @__PURE__ */ $(Yn, { children: [
|
|
1289
1290
|
W.length > 0 && /* @__PURE__ */ Q(A, {
|
|
1290
1291
|
schema: W,
|
|
1291
1292
|
...pe
|
|
@@ -1301,7 +1302,7 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1301
1302
|
view: F,
|
|
1302
1303
|
tab: "effect",
|
|
1303
1304
|
onPatch: z,
|
|
1304
|
-
levels: /* @__PURE__ */ $(
|
|
1305
|
+
levels: /* @__PURE__ */ $(Yn, { children: [
|
|
1305
1306
|
[
|
|
1306
1307
|
["type", "Type"],
|
|
1307
1308
|
["category", "Category"],
|
|
@@ -1340,12 +1341,12 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1340
1341
|
] })
|
|
1341
1342
|
})]
|
|
1342
1343
|
}),
|
|
1343
|
-
/* @__PURE__ */ Q(
|
|
1344
|
-
ue < H.length && /* @__PURE__ */ $(
|
|
1344
|
+
/* @__PURE__ */ Q(Fn, {}),
|
|
1345
|
+
ue < H.length && /* @__PURE__ */ $(Yn, { children: [/* @__PURE__ */ Q(A, {
|
|
1345
1346
|
schema: H.slice(ue),
|
|
1346
1347
|
...pe
|
|
1347
|
-
}), /* @__PURE__ */ Q(
|
|
1348
|
-
/* @__PURE__ */ Q(
|
|
1348
|
+
}), /* @__PURE__ */ Q(Fn, {})] }),
|
|
1349
|
+
/* @__PURE__ */ Q(ti, {
|
|
1349
1350
|
chain: C,
|
|
1350
1351
|
from: E + 1,
|
|
1351
1352
|
layer: t,
|
|
@@ -1357,8 +1358,8 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1357
1358
|
palette: x,
|
|
1358
1359
|
showMod: n
|
|
1359
1360
|
})
|
|
1360
|
-
] }), u === "anim" && /* @__PURE__ */ $(
|
|
1361
|
-
/* @__PURE__ */ Q(
|
|
1361
|
+
] }), u === "anim" && /* @__PURE__ */ $(Yn, { children: [
|
|
1362
|
+
/* @__PURE__ */ Q(Lr, {
|
|
1362
1363
|
schema: O.def.params,
|
|
1363
1364
|
layer: F,
|
|
1364
1365
|
setProp: R,
|
|
@@ -1372,7 +1373,7 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1372
1373
|
O.def.orbit && /* @__PURE__ */ Q(q, {
|
|
1373
1374
|
label: "Interaction",
|
|
1374
1375
|
divided: !0,
|
|
1375
|
-
children: /* @__PURE__ */ Q(
|
|
1376
|
+
children: /* @__PURE__ */ Q(Rn, {
|
|
1376
1377
|
label: "ORBIT (C)",
|
|
1377
1378
|
align: "fill",
|
|
1378
1379
|
labelWidth: i,
|
|
@@ -1409,12 +1410,12 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1409
1410
|
onChange: (e) => R("sweeps", e),
|
|
1410
1411
|
inline: !0
|
|
1411
1412
|
}),
|
|
1412
|
-
/* @__PURE__ */ Q(
|
|
1413
|
+
/* @__PURE__ */ Q(Pr, {
|
|
1413
1414
|
schema: O.def.params,
|
|
1414
1415
|
layer: F,
|
|
1415
1416
|
setProp: R
|
|
1416
1417
|
}),
|
|
1417
|
-
/* @__PURE__ */ Q(
|
|
1418
|
+
/* @__PURE__ */ Q($r, {
|
|
1418
1419
|
chain: C,
|
|
1419
1420
|
layer: t,
|
|
1420
1421
|
hostView: F,
|
|
@@ -1427,13 +1428,13 @@ function zr({ layer: t, showMod: n }) {
|
|
|
1427
1428
|
] })]
|
|
1428
1429
|
});
|
|
1429
1430
|
}
|
|
1430
|
-
var
|
|
1431
|
-
function
|
|
1431
|
+
var Zr = L.filter((e) => !e.kind && !e.first);
|
|
1432
|
+
function Qr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1432
1433
|
let { addFilter: i, removeFilter: a, toggleFilter: s } = o(), c = g(e), l = c.map(({ def: e, ...t }) => t);
|
|
1433
|
-
return /* @__PURE__ */ Q(
|
|
1434
|
+
return /* @__PURE__ */ Q(ti, {
|
|
1434
1435
|
chain: c,
|
|
1435
1436
|
from: 0,
|
|
1436
|
-
filters:
|
|
1437
|
+
filters: Zr,
|
|
1437
1438
|
layer: e,
|
|
1438
1439
|
hostView: e,
|
|
1439
1440
|
addFilter: i,
|
|
@@ -1450,7 +1451,7 @@ function Vr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1450
1451
|
showMod: r
|
|
1451
1452
|
});
|
|
1452
1453
|
}
|
|
1453
|
-
function
|
|
1454
|
+
function $r({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: a, palette: o, showMod: c }) {
|
|
1454
1455
|
let l = s(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1455
1456
|
...n,
|
|
1456
1457
|
...d.params,
|
|
@@ -1459,7 +1460,7 @@ function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1459
1460
|
return /* @__PURE__ */ Q(q, {
|
|
1460
1461
|
label: "Media",
|
|
1461
1462
|
divided: !0,
|
|
1462
|
-
children: d?.def ? /* @__PURE__ */ $(
|
|
1463
|
+
children: d?.def ? /* @__PURE__ */ $(Yn, { children: [/* @__PURE__ */ Q(A, {
|
|
1463
1464
|
schema: d.def.params,
|
|
1464
1465
|
layer: f,
|
|
1465
1466
|
setProp: p,
|
|
@@ -1489,7 +1490,7 @@ function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1489
1490
|
})
|
|
1490
1491
|
});
|
|
1491
1492
|
}
|
|
1492
|
-
function
|
|
1493
|
+
function ei({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: c, showMod: l }) {
|
|
1493
1494
|
let u = s();
|
|
1494
1495
|
return e.slice(t).map((e, s) => {
|
|
1495
1496
|
let d = s + t, f = e.enabled !== !1, p = {
|
|
@@ -1501,12 +1502,12 @@ function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1501
1502
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1502
1503
|
children: [/* @__PURE__ */ $("div", {
|
|
1503
1504
|
className: "flex items-center gap-2",
|
|
1504
|
-
children: [/* @__PURE__ */ Q(
|
|
1505
|
+
children: [/* @__PURE__ */ Q(Vn, {
|
|
1505
1506
|
size: u,
|
|
1506
1507
|
checked: f,
|
|
1507
1508
|
onChange: () => i(n.id, d),
|
|
1508
1509
|
label: e.def?.label ?? e.id
|
|
1509
|
-
}), /* @__PURE__ */ Q(
|
|
1510
|
+
}), /* @__PURE__ */ Q(Hn, {
|
|
1510
1511
|
asChild: !0,
|
|
1511
1512
|
label: "Delete effect",
|
|
1512
1513
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1534,7 +1535,7 @@ function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1534
1535
|
}, e.key ?? d);
|
|
1535
1536
|
});
|
|
1536
1537
|
}
|
|
1537
|
-
function
|
|
1538
|
+
function ti({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: a, removeFilter: o, toggleFilter: c, setStagePropAt: l, palette: u, showMod: d }) {
|
|
1538
1539
|
let f = s(), p = [{
|
|
1539
1540
|
value: "",
|
|
1540
1541
|
label: "Add FX…"
|
|
@@ -1545,7 +1546,7 @@ function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1545
1546
|
return /* @__PURE__ */ $(q, {
|
|
1546
1547
|
label: "Post-Processing",
|
|
1547
1548
|
divided: !0,
|
|
1548
|
-
children: [/* @__PURE__ */ Q(
|
|
1549
|
+
children: [/* @__PURE__ */ Q(ei, {
|
|
1549
1550
|
chain: e,
|
|
1550
1551
|
from: t,
|
|
1551
1552
|
layer: r,
|
|
@@ -1555,7 +1556,7 @@ function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1555
1556
|
setStagePropAt: l,
|
|
1556
1557
|
palette: u,
|
|
1557
1558
|
showMod: d
|
|
1558
|
-
}), e.length < 8 && /* @__PURE__ */ Q(
|
|
1559
|
+
}), e.length < 8 && /* @__PURE__ */ Q(In, {
|
|
1559
1560
|
variant: "subtle",
|
|
1560
1561
|
size: f,
|
|
1561
1562
|
className: "w-full",
|
|
@@ -1567,7 +1568,7 @@ function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1567
1568
|
})]
|
|
1568
1569
|
});
|
|
1569
1570
|
}
|
|
1570
|
-
function
|
|
1571
|
+
function ni({ layer: e, showMod: t, tree: n }) {
|
|
1571
1572
|
let r = s(), [i, c] = Z("generate"), { updateLayer: l, palette: u } = o(), { setOnly: d } = W(), f = 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) => ({
|
|
1572
1573
|
value: e.id,
|
|
1573
1574
|
label: e.label
|
|
@@ -1577,10 +1578,10 @@ function Gr({ layer: e, showMod: t, tree: n }) {
|
|
|
1577
1578
|
}, S = () => {
|
|
1578
1579
|
m && d(e.type, H(m, e.loopGroup));
|
|
1579
1580
|
};
|
|
1580
|
-
return
|
|
1581
|
+
return Ur(S, () => {
|
|
1581
1582
|
let t = U(e.loopId)?.params ?? [];
|
|
1582
1583
|
l(e.id, p(e, w(t, e), D(), { withFilters: !0 }));
|
|
1583
|
-
}), /* @__PURE__ */ $(
|
|
1584
|
+
}), /* @__PURE__ */ $(Yr, {
|
|
1584
1585
|
title: v,
|
|
1585
1586
|
chips: b,
|
|
1586
1587
|
active: e.presetId,
|
|
@@ -1592,12 +1593,12 @@ function Gr({ layer: e, showMod: t, tree: n }) {
|
|
|
1592
1593
|
tone: "sunken",
|
|
1593
1594
|
value: i,
|
|
1594
1595
|
onChange: c,
|
|
1595
|
-
options: r === "sm" ?
|
|
1596
|
+
options: r === "sm" ? Gr : Kr,
|
|
1596
1597
|
size: r,
|
|
1597
1598
|
className: a(r)
|
|
1598
1599
|
}),
|
|
1599
1600
|
children: [
|
|
1600
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1601
|
+
i === "anim" && /* @__PURE__ */ Q(Lr, {
|
|
1601
1602
|
schema: U(e.loopId)?.params ?? [],
|
|
1602
1603
|
layer: e,
|
|
1603
1604
|
setProp: f.setProp,
|
|
@@ -1620,17 +1621,17 @@ function Gr({ layer: e, showMod: t, tree: n }) {
|
|
|
1620
1621
|
inline: !0,
|
|
1621
1622
|
onReset: S
|
|
1622
1623
|
}),
|
|
1623
|
-
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(
|
|
1624
|
+
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Hr, {
|
|
1624
1625
|
layer: e,
|
|
1625
1626
|
setProp: f.setProp
|
|
1626
1627
|
}),
|
|
1627
|
-
i === "style" && /* @__PURE__ */ Q(
|
|
1628
|
+
i === "style" && /* @__PURE__ */ Q(Qr, {
|
|
1628
1629
|
layer: e,
|
|
1629
1630
|
edit: f,
|
|
1630
1631
|
palette: u,
|
|
1631
1632
|
showMod: t
|
|
1632
1633
|
}),
|
|
1633
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1634
|
+
i === "anim" && /* @__PURE__ */ Q(Pr, {
|
|
1634
1635
|
schema: U(e.loopId)?.params ?? [],
|
|
1635
1636
|
layer: e,
|
|
1636
1637
|
setProp: f.setProp
|
|
@@ -1638,9 +1639,9 @@ function Gr({ layer: e, showMod: t, tree: n }) {
|
|
|
1638
1639
|
]
|
|
1639
1640
|
});
|
|
1640
1641
|
}
|
|
1641
|
-
function
|
|
1642
|
+
function ri({ layer: e, showMod: t }) {
|
|
1642
1643
|
let n = s(), [r, i] = Z("generate"), { updateLayer: c, palette: l } = o(), { 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
|
|
1644
|
+
return Ur(() => {
|
|
1644
1645
|
f && u("kinetic", {
|
|
1645
1646
|
presetId: f.id,
|
|
1646
1647
|
presetLabel: f.label,
|
|
@@ -1654,13 +1655,13 @@ function Kr({ layer: e, showMod: t }) {
|
|
|
1654
1655
|
comp: r,
|
|
1655
1656
|
_rollSeed: t
|
|
1656
1657
|
});
|
|
1657
|
-
}), /* @__PURE__ */ Q(
|
|
1658
|
+
}), /* @__PURE__ */ Q(Yr, {
|
|
1658
1659
|
title: p,
|
|
1659
1660
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1660
1661
|
tone: "sunken",
|
|
1661
1662
|
value: r,
|
|
1662
1663
|
onChange: i,
|
|
1663
|
-
options: n === "sm" ?
|
|
1664
|
+
options: n === "sm" ? Gr : Kr,
|
|
1664
1665
|
size: n,
|
|
1665
1666
|
className: a(n)
|
|
1666
1667
|
}),
|
|
@@ -1679,37 +1680,37 @@ function Kr({ layer: e, showMod: t }) {
|
|
|
1679
1680
|
})
|
|
1680
1681
|
});
|
|
1681
1682
|
}
|
|
1682
|
-
function
|
|
1683
|
+
function ii() {
|
|
1683
1684
|
let { layer: e } = W(), t = nt(), n = s(), r = it();
|
|
1684
1685
|
return Y(() => {
|
|
1685
1686
|
let e = (e) => {
|
|
1686
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1687
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || zt(e) || rt();
|
|
1687
1688
|
};
|
|
1688
1689
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1689
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1690
|
+
}, []), t.active ? /* @__PURE__ */ Q(Yr, {
|
|
1690
1691
|
title: "Morph",
|
|
1691
|
-
children: /* @__PURE__ */ Q(
|
|
1692
|
+
children: /* @__PURE__ */ Q(Ar, {
|
|
1692
1693
|
layer: e,
|
|
1693
|
-
editTabs: n === "sm" ?
|
|
1694
|
+
editTabs: n === "sm" ? Gr : Kr
|
|
1694
1695
|
})
|
|
1695
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1696
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(Xr, {
|
|
1696
1697
|
layer: e,
|
|
1697
1698
|
showMod: r
|
|
1698
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1699
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(ni, {
|
|
1699
1700
|
layer: e,
|
|
1700
1701
|
showMod: r
|
|
1701
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1702
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(ni, {
|
|
1702
1703
|
layer: e,
|
|
1703
1704
|
showMod: r,
|
|
1704
1705
|
tree: fe
|
|
1705
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1706
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(ri, {
|
|
1706
1707
|
layer: e,
|
|
1707
1708
|
showMod: r
|
|
1708
1709
|
}, 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
|
}
|
|
1710
1711
|
//#endregion
|
|
1711
1712
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1712
|
-
function
|
|
1713
|
+
function ai(e) {
|
|
1713
1714
|
Y(() => {
|
|
1714
1715
|
let t = (t) => {
|
|
1715
1716
|
t.key === "Escape" && e?.();
|
|
@@ -1722,8 +1723,8 @@ function Jr(e) {
|
|
|
1722
1723
|
};
|
|
1723
1724
|
}, []);
|
|
1724
1725
|
}
|
|
1725
|
-
function
|
|
1726
|
-
return
|
|
1726
|
+
function oi({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1727
|
+
return ai(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1727
1728
|
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
1729
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1729
1730
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1737,11 +1738,11 @@ function Yr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1737
1738
|
/* @__PURE__ */ Q("div", {
|
|
1738
1739
|
className: "flex flex-col gap-2",
|
|
1739
1740
|
children: we.map((t) => {
|
|
1740
|
-
let n =
|
|
1741
|
+
let n = xr[`gen:${t.label}`] ?? "square";
|
|
1741
1742
|
return /* @__PURE__ */ Q(K, {
|
|
1742
1743
|
tone: "primary",
|
|
1743
1744
|
size: "lg",
|
|
1744
|
-
className:
|
|
1745
|
+
className: Qt,
|
|
1745
1746
|
iconLeft: n,
|
|
1746
1747
|
iconRight: n,
|
|
1747
1748
|
onClick: () => e(t),
|
|
@@ -1775,11 +1776,11 @@ function Yr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1775
1776
|
}
|
|
1776
1777
|
//#endregion
|
|
1777
1778
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1778
|
-
var
|
|
1779
|
-
function
|
|
1779
|
+
var si = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1780
|
+
function ci(e) {
|
|
1780
1781
|
let { patch: t } = te(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1781
1782
|
return {
|
|
1782
|
-
nodes: /* @__PURE__ */ $(
|
|
1783
|
+
nodes: /* @__PURE__ */ $(Yn, { children: [/* @__PURE__ */ Q("input", {
|
|
1783
1784
|
ref: n,
|
|
1784
1785
|
type: "file",
|
|
1785
1786
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1799,24 +1800,24 @@ function Zr(e) {
|
|
|
1799
1800
|
});
|
|
1800
1801
|
return;
|
|
1801
1802
|
}
|
|
1802
|
-
|
|
1803
|
+
bt(r).then((e) => t({
|
|
1803
1804
|
src: e,
|
|
1804
1805
|
srcType: "image"
|
|
1805
1806
|
}));
|
|
1806
1807
|
}
|
|
1807
1808
|
}
|
|
1808
|
-
}), /* @__PURE__ */ Q(
|
|
1809
|
+
}), /* @__PURE__ */ Q(Ft, {
|
|
1809
1810
|
open: r,
|
|
1810
|
-
accept: a ?
|
|
1811
|
+
accept: a ? si : ["image", "video"],
|
|
1811
1812
|
onClose: () => i(!1),
|
|
1812
1813
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1813
1814
|
if (a) {
|
|
1814
|
-
t({ svgSrc:
|
|
1815
|
+
t({ svgSrc: jn(e) });
|
|
1815
1816
|
return;
|
|
1816
1817
|
}
|
|
1817
1818
|
t({
|
|
1818
|
-
src:
|
|
1819
|
-
srcType:
|
|
1819
|
+
src: jn(e),
|
|
1820
|
+
srcType: yt(n) ? "video" : "image"
|
|
1820
1821
|
});
|
|
1821
1822
|
}
|
|
1822
1823
|
})] }),
|
|
@@ -1824,7 +1825,7 @@ function Zr(e) {
|
|
|
1824
1825
|
openLibrary: () => i(!0),
|
|
1825
1826
|
openUpload: () => n.current?.click(),
|
|
1826
1827
|
openCamera: () => {
|
|
1827
|
-
|
|
1828
|
+
ln(e.id).then(() => t({
|
|
1828
1829
|
src: null,
|
|
1829
1830
|
srcType: "webcam"
|
|
1830
1831
|
})).catch(() => {});
|
|
@@ -1845,15 +1846,15 @@ function Zr(e) {
|
|
|
1845
1846
|
label: "Camera"
|
|
1846
1847
|
}
|
|
1847
1848
|
].slice(0, 2);
|
|
1848
|
-
function
|
|
1849
|
-
let t =
|
|
1849
|
+
function li({ layer: e }) {
|
|
1850
|
+
let t = ci(e);
|
|
1850
1851
|
return /* @__PURE__ */ $("div", {
|
|
1851
1852
|
className: "flex flex-col gap-2",
|
|
1852
1853
|
children: [
|
|
1853
1854
|
/* @__PURE__ */ Q(K, {
|
|
1854
1855
|
tone: "primary",
|
|
1855
1856
|
size: "lg",
|
|
1856
|
-
className:
|
|
1857
|
+
className: Qt,
|
|
1857
1858
|
iconLeft: "image",
|
|
1858
1859
|
iconRight: "image",
|
|
1859
1860
|
onClick: t.openLibrary,
|
|
@@ -1862,7 +1863,7 @@ function Qr({ layer: e }) {
|
|
|
1862
1863
|
/* @__PURE__ */ Q(K, {
|
|
1863
1864
|
tone: "primary",
|
|
1864
1865
|
size: "lg",
|
|
1865
|
-
className:
|
|
1866
|
+
className: Qt,
|
|
1866
1867
|
iconLeft: "upload",
|
|
1867
1868
|
iconRight: "upload",
|
|
1868
1869
|
onClick: t.openUpload,
|
|
@@ -1881,8 +1882,8 @@ function Qr({ layer: e }) {
|
|
|
1881
1882
|
]
|
|
1882
1883
|
});
|
|
1883
1884
|
}
|
|
1884
|
-
function
|
|
1885
|
-
return
|
|
1885
|
+
function ui({ layer: e, title: t, onBack: n }) {
|
|
1886
|
+
return ai(n), /* @__PURE__ */ Q("div", {
|
|
1886
1887
|
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",
|
|
1887
1888
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1888
1889
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1899,11 +1900,11 @@ function $r({ layer: e, title: t, onBack: n }) {
|
|
|
1899
1900
|
children: "Pick the media it works on."
|
|
1900
1901
|
})]
|
|
1901
1902
|
}),
|
|
1902
|
-
/* @__PURE__ */ Q(
|
|
1903
|
+
/* @__PURE__ */ Q(li, { layer: e }),
|
|
1903
1904
|
/* @__PURE__ */ Q(K, {
|
|
1904
1905
|
tone: "grey",
|
|
1905
1906
|
size: "lg",
|
|
1906
|
-
className:
|
|
1907
|
+
className: Qt,
|
|
1907
1908
|
iconLeft: "arrow-left",
|
|
1908
1909
|
iconRight: "arrow-left",
|
|
1909
1910
|
onClick: n,
|
|
@@ -1915,13 +1916,13 @@ function $r({ layer: e, title: t, onBack: n }) {
|
|
|
1915
1916
|
}
|
|
1916
1917
|
//#endregion
|
|
1917
1918
|
//#region src/editor/components/PanelHeader.jsx
|
|
1918
|
-
function
|
|
1919
|
+
function di({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1919
1920
|
return /* @__PURE__ */ $("div", {
|
|
1920
1921
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1921
1922
|
children: [/* @__PURE__ */ $("button", {
|
|
1922
1923
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1923
1924
|
onClick: t,
|
|
1924
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1925
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(Xn, {
|
|
1925
1926
|
name: "chevron-down",
|
|
1926
1927
|
size: 16,
|
|
1927
1928
|
className: "text-oq-48"
|
|
@@ -1929,7 +1930,7 @@ function ei({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1929
1930
|
}), n]
|
|
1930
1931
|
});
|
|
1931
1932
|
}
|
|
1932
|
-
function
|
|
1933
|
+
function fi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1933
1934
|
return /* @__PURE__ */ $("div", {
|
|
1934
1935
|
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",
|
|
1935
1936
|
children: [/* @__PURE__ */ Q(K, {
|
|
@@ -1942,7 +1943,7 @@ function ti({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1942
1943
|
children: [/* @__PURE__ */ Q("span", {
|
|
1943
1944
|
className: "truncate",
|
|
1944
1945
|
children: e
|
|
1945
|
-
}), /* @__PURE__ */ Q(
|
|
1946
|
+
}), /* @__PURE__ */ Q(Xn, {
|
|
1946
1947
|
name: "chevron-down",
|
|
1947
1948
|
size: 16,
|
|
1948
1949
|
className: "rotate-180 shrink-0"
|
|
@@ -1951,13 +1952,13 @@ function ti({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1951
1952
|
}), i]
|
|
1952
1953
|
});
|
|
1953
1954
|
}
|
|
1954
|
-
var
|
|
1955
|
+
var pi = {
|
|
1955
1956
|
half: "50dvh",
|
|
1956
1957
|
tall: "85dvh"
|
|
1957
|
-
},
|
|
1958
|
-
function
|
|
1958
|
+
}, mi = 4;
|
|
1959
|
+
function hi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1959
1960
|
let a = X(null);
|
|
1960
|
-
|
|
1961
|
+
Un(a, { axis: "x" });
|
|
1961
1962
|
let o = X({
|
|
1962
1963
|
y: null,
|
|
1963
1964
|
h0: 0,
|
|
@@ -1977,7 +1978,7 @@ function ii({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1977
1978
|
onPointerMove: (e) => {
|
|
1978
1979
|
if (o.y === null) return;
|
|
1979
1980
|
let t = e.clientY - o.y;
|
|
1980
|
-
Math.abs(t) >
|
|
1981
|
+
Math.abs(t) > mi && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
1981
1982
|
},
|
|
1982
1983
|
onPointerUp: (e) => {
|
|
1983
1984
|
if (o.y === null) return;
|
|
@@ -1999,10 +2000,10 @@ function ii({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1999
2000
|
}
|
|
2000
2001
|
//#endregion
|
|
2001
2002
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
2002
|
-
var
|
|
2003
|
-
function
|
|
2004
|
-
let { items: a, dispatch: o } =
|
|
2005
|
-
|
|
2003
|
+
var gi = new Set(["#rail/sec:effects"]);
|
|
2004
|
+
function _i({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2005
|
+
let { items: a, dispatch: o } = Dn(), [s, c] = Z(n);
|
|
2006
|
+
ai(t);
|
|
2006
2007
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
2007
2008
|
return /* @__PURE__ */ Q("div", {
|
|
2008
2009
|
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",
|
|
@@ -2021,11 +2022,11 @@ function oi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2021
2022
|
children: [u.map((t) => /* @__PURE__ */ Q(K, {
|
|
2022
2023
|
tone: "primary",
|
|
2023
2024
|
size: "lg",
|
|
2024
|
-
className:
|
|
2025
|
+
className: Qt,
|
|
2025
2026
|
iconLeft: t.icon,
|
|
2026
2027
|
iconRight: t.icon,
|
|
2027
2028
|
onClick: () => {
|
|
2028
|
-
if (!l &&
|
|
2029
|
+
if (!l && gi.has(t.path) && !r && i) {
|
|
2029
2030
|
i(t.path);
|
|
2030
2031
|
return;
|
|
2031
2032
|
}
|
|
@@ -2051,7 +2052,7 @@ function oi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2051
2052
|
}
|
|
2052
2053
|
//#endregion
|
|
2053
2054
|
//#region src/editor/labs/sheetLabels.js
|
|
2054
|
-
function
|
|
2055
|
+
function vi(e) {
|
|
2055
2056
|
if (Ze().active) return {
|
|
2056
2057
|
title: "Morph",
|
|
2057
2058
|
pill: "Morph"
|
|
@@ -2079,14 +2080,14 @@ function si(e) {
|
|
|
2079
2080
|
}
|
|
2080
2081
|
//#endregion
|
|
2081
2082
|
//#region src/editor/labs/LabsView.jsx
|
|
2082
|
-
var
|
|
2083
|
+
var yi = .85, bi = .3, xi = 2.5, Si = {
|
|
2083
2084
|
0: 1,
|
|
2084
2085
|
1: .5,
|
|
2085
2086
|
2: 1,
|
|
2086
2087
|
3: 1.5,
|
|
2087
2088
|
4: 2
|
|
2088
|
-
},
|
|
2089
|
-
function
|
|
2089
|
+
}, Ci = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2090
|
+
function wi() {
|
|
2090
2091
|
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction: i, commitTransaction: a, select: s } = o(), [c, l] = Z(null);
|
|
2091
2092
|
Y(() => {
|
|
2092
2093
|
let e = (e) => {
|
|
@@ -2106,7 +2107,7 @@ function pi() {
|
|
|
2106
2107
|
c,
|
|
2107
2108
|
s
|
|
2108
2109
|
]);
|
|
2109
|
-
let u = c && n.find((e) => e.id === c.id && e.type === "kinetic"), d = e?.type === "photo" && !e.src && e.srcType !== "webcam", [f, p] = Z(1), [m, h] = Z(!1), g =
|
|
2110
|
+
let u = c && n.find((e) => e.id === c.id && e.type === "kinetic"), d = e?.type === "photo" && !e.src && e.srcType !== "webcam", [f, p] = Z(1), [m, h] = Z(!1), g = vt(m), _ = X(null), v = (e) => Math.min(xi, Math.max(bi, e)), y = (e) => p((t) => v(t * (e > 0 ? 1.25 : .8))), { tool: b } = Nt(), x = b === "orbit", C = X(x);
|
|
2110
2111
|
C.current = x, Y(() => {
|
|
2111
2112
|
let e = _.current;
|
|
2112
2113
|
if (!e) return;
|
|
@@ -2116,12 +2117,12 @@ function pi() {
|
|
|
2116
2117
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2117
2118
|
}, []), Y(() => {
|
|
2118
2119
|
let e = (e) => {
|
|
2119
|
-
if (!(e.metaKey || e.ctrlKey || e.altKey) && !
|
|
2120
|
+
if (!(e.metaKey || e.ctrlKey || e.altKey) && !zt(e)) {
|
|
2120
2121
|
if (e.key === "f" || e.key === "F") {
|
|
2121
2122
|
h((e) => !e);
|
|
2122
2123
|
return;
|
|
2123
2124
|
}
|
|
2124
|
-
if (!(S().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" ||
|
|
2125
|
+
if (!(S().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || Si[e.key] !== void 0))) {
|
|
2125
2126
|
if (e.key === "-" || e.key === "_") {
|
|
2126
2127
|
y(-1);
|
|
2127
2128
|
return;
|
|
@@ -2130,7 +2131,7 @@ function pi() {
|
|
|
2130
2131
|
y(1);
|
|
2131
2132
|
return;
|
|
2132
2133
|
}
|
|
2133
|
-
|
|
2134
|
+
Si[e.key] !== void 0 && p(Si[e.key]);
|
|
2134
2135
|
}
|
|
2135
2136
|
}
|
|
2136
2137
|
};
|
|
@@ -2210,11 +2211,11 @@ function pi() {
|
|
|
2210
2211
|
/* @__PURE__ */ Q("div", {
|
|
2211
2212
|
style: {
|
|
2212
2213
|
flex: "none",
|
|
2213
|
-
width: `${f *
|
|
2214
|
-
height: `${f *
|
|
2214
|
+
width: `${f * yi * 100}%`,
|
|
2215
|
+
height: `${f * yi * 100}%`,
|
|
2215
2216
|
transform: `translate(${w.x}px, ${w.y}px)`
|
|
2216
2217
|
},
|
|
2217
|
-
children: /* @__PURE__ */ Q(
|
|
2218
|
+
children: /* @__PURE__ */ Q(Xt, { overlay: u ? (e) => /* @__PURE__ */ Q(jt, {
|
|
2218
2219
|
layer: u,
|
|
2219
2220
|
initialIndex: c.index,
|
|
2220
2221
|
toVirtual: e,
|
|
@@ -2224,17 +2225,17 @@ function pi() {
|
|
|
2224
2225
|
onExit: () => l(null)
|
|
2225
2226
|
}) : void 0 })
|
|
2226
2227
|
}),
|
|
2227
|
-
d && /* @__PURE__ */ Q(
|
|
2228
|
+
d && /* @__PURE__ */ Q(ui, {
|
|
2228
2229
|
layer: e,
|
|
2229
|
-
title:
|
|
2230
|
+
title: vi(e).title,
|
|
2230
2231
|
onBack: () => t(e.id)
|
|
2231
2232
|
}),
|
|
2232
2233
|
m && /* @__PURE__ */ Q("div", {
|
|
2233
2234
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2234
|
-
children: /* @__PURE__ */ Q(
|
|
2235
|
+
children: /* @__PURE__ */ Q(Hn, {
|
|
2235
2236
|
label: "Framerate — press F to hide",
|
|
2236
2237
|
children: /* @__PURE__ */ $("span", {
|
|
2237
|
-
className:
|
|
2238
|
+
className: Ci,
|
|
2238
2239
|
children: [g, " fps"]
|
|
2239
2240
|
})
|
|
2240
2241
|
})
|
|
@@ -2242,8 +2243,8 @@ function pi() {
|
|
|
2242
2243
|
]
|
|
2243
2244
|
});
|
|
2244
2245
|
}
|
|
2245
|
-
function
|
|
2246
|
-
let e = X(null), { grabProps: t } =
|
|
2246
|
+
function Ti() {
|
|
2247
|
+
let e = X(null), { grabProps: t } = nr(e, {
|
|
2247
2248
|
token: "kol-rail",
|
|
2248
2249
|
side: "right"
|
|
2249
2250
|
});
|
|
@@ -2289,14 +2290,14 @@ function mi() {
|
|
|
2289
2290
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2290
2291
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
2291
2292
|
className: "kol-compose-inspector-body",
|
|
2292
|
-
children: /* @__PURE__ */ Q(
|
|
2293
|
+
children: /* @__PURE__ */ Q(ii, {})
|
|
2293
2294
|
})]
|
|
2294
2295
|
});
|
|
2295
2296
|
}
|
|
2296
|
-
var
|
|
2297
|
-
function
|
|
2298
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
2299
|
-
return /* @__PURE__ */ Q(
|
|
2297
|
+
var Ei = Kn(null);
|
|
2298
|
+
function Di() {
|
|
2299
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = qn(Ei);
|
|
2300
|
+
return /* @__PURE__ */ Q(hi, {
|
|
2300
2301
|
tall: e,
|
|
2301
2302
|
onToggle: () => {
|
|
2302
2303
|
r(null), t((e) => !e);
|
|
@@ -2307,20 +2308,20 @@ function gi() {
|
|
|
2307
2308
|
}
|
|
2308
2309
|
});
|
|
2309
2310
|
}
|
|
2310
|
-
var
|
|
2311
|
+
var Oi = [
|
|
2311
2312
|
2,
|
|
2312
2313
|
4,
|
|
2313
2314
|
8,
|
|
2314
2315
|
12,
|
|
2315
2316
|
16
|
|
2316
2317
|
];
|
|
2317
|
-
function
|
|
2318
|
+
function ki({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2318
2319
|
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } = C(), [f, p] = Z(!0), m = [
|
|
2319
2320
|
{
|
|
2320
2321
|
icon: "home-01",
|
|
2321
2322
|
path: "#home",
|
|
2322
2323
|
label: "Home",
|
|
2323
|
-
onPress: () =>
|
|
2324
|
+
onPress: () => pn("/")
|
|
2324
2325
|
},
|
|
2325
2326
|
{
|
|
2326
2327
|
icon: "grid",
|
|
@@ -2347,13 +2348,13 @@ function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2347
2348
|
icon: "download",
|
|
2348
2349
|
label: "Output",
|
|
2349
2350
|
onPress: () => {
|
|
2350
|
-
t(!0),
|
|
2351
|
+
t(!0), cn("Output");
|
|
2351
2352
|
}
|
|
2352
2353
|
}, {
|
|
2353
2354
|
icon: "file",
|
|
2354
2355
|
label: "File",
|
|
2355
2356
|
onPress: () => {
|
|
2356
|
-
t(!0),
|
|
2357
|
+
t(!0), cn("File");
|
|
2357
2358
|
}
|
|
2358
2359
|
}], g = f ? {
|
|
2359
2360
|
items: [
|
|
@@ -2389,14 +2390,14 @@ function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2389
2390
|
onPress: u
|
|
2390
2391
|
}
|
|
2391
2392
|
],
|
|
2392
|
-
sheetFor: { loop:
|
|
2393
|
+
sheetFor: { loop: Oi.map((e) => ({
|
|
2393
2394
|
label: `${e} s`,
|
|
2394
2395
|
checked: o === e,
|
|
2395
2396
|
onPress: () => d(e)
|
|
2396
2397
|
})) }
|
|
2397
2398
|
} : void 0;
|
|
2398
2399
|
return Y(() => {
|
|
2399
|
-
|
|
2400
|
+
cr({
|
|
2400
2401
|
items: m,
|
|
2401
2402
|
actions: h,
|
|
2402
2403
|
transport: g,
|
|
@@ -2410,20 +2411,20 @@ function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2410
2411
|
a,
|
|
2411
2412
|
o,
|
|
2412
2413
|
i
|
|
2413
|
-
]), Y(() => () =>
|
|
2414
|
+
]), Y(() => () => cr(null), []), null;
|
|
2414
2415
|
}
|
|
2415
|
-
function
|
|
2416
|
+
function Ai() {
|
|
2416
2417
|
return /* @__PURE__ */ Q("div", {
|
|
2417
2418
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2418
2419
|
children: /* @__PURE__ */ Q("div", {
|
|
2419
2420
|
className: "kol-compose-inspector-body",
|
|
2420
|
-
children: /* @__PURE__ */ Q(
|
|
2421
|
+
children: /* @__PURE__ */ Q(ii, {})
|
|
2421
2422
|
})
|
|
2422
2423
|
});
|
|
2423
2424
|
}
|
|
2424
|
-
var
|
|
2425
|
+
var ji = {
|
|
2425
2426
|
topbar: () => null,
|
|
2426
|
-
canvas:
|
|
2427
|
+
canvas: wi,
|
|
2427
2428
|
panels: [
|
|
2428
2429
|
{
|
|
2429
2430
|
slot: "canvas.footer",
|
|
@@ -2433,31 +2434,31 @@ var bi = {
|
|
|
2433
2434
|
{
|
|
2434
2435
|
slot: "right.body",
|
|
2435
2436
|
order: 0,
|
|
2436
|
-
Component:
|
|
2437
|
+
Component: Ti
|
|
2437
2438
|
},
|
|
2438
2439
|
{
|
|
2439
2440
|
slot: "right.footer",
|
|
2440
2441
|
order: 0,
|
|
2441
|
-
Component:
|
|
2442
|
+
Component: qt
|
|
2442
2443
|
}
|
|
2443
2444
|
]
|
|
2444
|
-
},
|
|
2445
|
-
...
|
|
2445
|
+
}, Mi = {
|
|
2446
|
+
...ji,
|
|
2446
2447
|
panels: [{
|
|
2447
2448
|
slot: "right.header",
|
|
2448
2449
|
order: 0,
|
|
2449
|
-
Component:
|
|
2450
|
-
}, ...
|
|
2450
|
+
Component: Di
|
|
2451
|
+
}, ...ji.panels.map((e) => e.Component === Ti ? {
|
|
2451
2452
|
...e,
|
|
2452
|
-
Component:
|
|
2453
|
+
Component: Ai
|
|
2453
2454
|
} : e)]
|
|
2454
2455
|
};
|
|
2455
|
-
function
|
|
2456
|
-
let { setAspect: t, selectedId: n, select: r } = o(), { layer: i, setOnly: a } = W(), s = X(!1), c =
|
|
2456
|
+
function Ni() {
|
|
2457
|
+
let { setAspect: t, selectedId: n, select: r } = o(), { layer: i, setOnly: a } = W(), s = X(!1), c = Kt(gt), d = hn() && !wn() || c;
|
|
2457
2458
|
Y(() => {
|
|
2458
2459
|
d && document.documentElement.removeAttribute("data-rail");
|
|
2459
2460
|
}, [d]);
|
|
2460
|
-
let [f, p] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ?
|
|
2461
|
+
let [f, p] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ? pi.tall : pi.half, y = { "--kol-sheet-h": v }, b = lr(), x = nt(), [C, w] = Z(() => !i);
|
|
2461
2462
|
Y(() => {
|
|
2462
2463
|
w(!i);
|
|
2463
2464
|
}, [i?.id]);
|
|
@@ -2482,7 +2483,7 @@ function Si() {
|
|
|
2482
2483
|
}), () => {
|
|
2483
2484
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2484
2485
|
};
|
|
2485
|
-
}, [x.active, d]), Y(() =>
|
|
2486
|
+
}, [x.active, d]), Y(() => Dt((e) => a("photo", {
|
|
2486
2487
|
src: e.url,
|
|
2487
2488
|
srcType: e.srcType
|
|
2488
2489
|
})), [a]), Y(() => {
|
|
@@ -2491,7 +2492,7 @@ function Si() {
|
|
|
2491
2492
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2492
2493
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2493
2494
|
};
|
|
2494
|
-
}, [d]),
|
|
2495
|
+
}, [d]), wt(), Y(() => (nn("labs"), () => nn(null)), []), Y(() => {
|
|
2495
2496
|
if (s.current) return;
|
|
2496
2497
|
s.current = !0;
|
|
2497
2498
|
let e = S();
|
|
@@ -2501,7 +2502,7 @@ function Si() {
|
|
|
2501
2502
|
Y(() => {
|
|
2502
2503
|
if (ee.current) return;
|
|
2503
2504
|
ee.current = !0;
|
|
2504
|
-
let e =
|
|
2505
|
+
let e = bn();
|
|
2505
2506
|
if (e.open || e.fresh) return;
|
|
2506
2507
|
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? V(t) : null;
|
|
2507
2508
|
n && a("loop", H(M(t), n));
|
|
@@ -2511,7 +2512,7 @@ function Si() {
|
|
|
2511
2512
|
let e = setTimeout(k, 800);
|
|
2512
2513
|
return () => clearTimeout(e);
|
|
2513
2514
|
}, [k]);
|
|
2514
|
-
let { tool: A, setTool: j } =
|
|
2515
|
+
let { tool: A, setTool: j } = Nt(), te = X(A);
|
|
2515
2516
|
te.current = A;
|
|
2516
2517
|
let { updateLayer: ne, undo: N, redo: P } = o(), F = X({
|
|
2517
2518
|
undo: N,
|
|
@@ -2530,7 +2531,7 @@ function Si() {
|
|
|
2530
2531
|
let L = X(ne);
|
|
2531
2532
|
return L.current = ne, Y(() => {
|
|
2532
2533
|
let t = (t) => {
|
|
2533
|
-
if (
|
|
2534
|
+
if (zt(t)) return;
|
|
2534
2535
|
if ((t.metaKey || t.ctrlKey) && (t.key === "z" || t.key === "Z")) {
|
|
2535
2536
|
t.preventDefault(), t.shiftKey ? F.current.redo() : F.current.undo();
|
|
2536
2537
|
return;
|
|
@@ -2575,8 +2576,8 @@ function Si() {
|
|
|
2575
2576
|
"data-empty": i || x.active ? void 0 : "",
|
|
2576
2577
|
style: y,
|
|
2577
2578
|
children: [
|
|
2578
|
-
/* @__PURE__ */ Q(
|
|
2579
|
-
d ? /* @__PURE__ */ $(
|
|
2579
|
+
/* @__PURE__ */ Q(Dr, {}),
|
|
2580
|
+
d ? /* @__PURE__ */ $(Ei.Provider, {
|
|
2580
2581
|
value: {
|
|
2581
2582
|
collapseParams: () => p(!1),
|
|
2582
2583
|
tall: m,
|
|
@@ -2587,9 +2588,9 @@ function Si() {
|
|
|
2587
2588
|
},
|
|
2588
2589
|
children: [/* @__PURE__ */ Q(u.Provider, {
|
|
2589
2590
|
value: "md",
|
|
2590
|
-
children: /* @__PURE__ */ Q(
|
|
2591
|
-
registry:
|
|
2592
|
-
rightIn: (e) => b ?
|
|
2591
|
+
children: /* @__PURE__ */ Q(_t, {
|
|
2592
|
+
registry: Mi,
|
|
2593
|
+
rightIn: (e) => b ? ir(/* @__PURE__ */ Q("div", {
|
|
2593
2594
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2594
2595
|
"data-touch": "",
|
|
2595
2596
|
"data-params": "open",
|
|
@@ -2597,15 +2598,15 @@ function Si() {
|
|
|
2597
2598
|
children: e
|
|
2598
2599
|
}), b) : null
|
|
2599
2600
|
})
|
|
2600
|
-
}), /* @__PURE__ */ Q(
|
|
2601
|
+
}), /* @__PURE__ */ Q(ki, {
|
|
2601
2602
|
paramsOpen: f,
|
|
2602
2603
|
setParamsOpen: p,
|
|
2603
2604
|
catalog: C,
|
|
2604
2605
|
toggleCatalog: () => w((e) => !e),
|
|
2605
2606
|
railHeight: v
|
|
2606
2607
|
})]
|
|
2607
|
-
}) : /* @__PURE__ */ Q(
|
|
2608
|
-
C && !x.picker && !(x.active && !i) && /* @__PURE__ */ Q(
|
|
2608
|
+
}) : /* @__PURE__ */ Q(_t, { registry: ji }),
|
|
2609
|
+
C && !x.picker && !(x.active && !i) && /* @__PURE__ */ Q(_i, {
|
|
2609
2610
|
initialOpen: T,
|
|
2610
2611
|
hasMedia: D,
|
|
2611
2612
|
onNeedMedia: (e) => {
|
|
@@ -2624,8 +2625,8 @@ function Si() {
|
|
|
2624
2625
|
]
|
|
2625
2626
|
});
|
|
2626
2627
|
}
|
|
2627
|
-
var
|
|
2628
|
-
function
|
|
2628
|
+
var Pi = "kol.editor.labs-draft";
|
|
2629
|
+
function Fi() {
|
|
2629
2630
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2630
2631
|
return Y(() => (G(e ? { active: !0 } : {
|
|
2631
2632
|
active: !1,
|
|
@@ -2633,20 +2634,20 @@ function wi() {
|
|
|
2633
2634
|
}), () => G({
|
|
2634
2635
|
active: !1,
|
|
2635
2636
|
editing: null
|
|
2636
|
-
})), [e]), /* @__PURE__ */ $(
|
|
2637
|
-
draftKey:
|
|
2637
|
+
})), [e]), /* @__PURE__ */ $(fn, {
|
|
2638
|
+
draftKey: Pi,
|
|
2638
2639
|
children: [
|
|
2639
|
-
/* @__PURE__ */ Q(
|
|
2640
|
-
/* @__PURE__ */ Q(
|
|
2640
|
+
/* @__PURE__ */ Q(Ni, {}),
|
|
2641
|
+
/* @__PURE__ */ Q(St, {}),
|
|
2641
2642
|
/* @__PURE__ */ Q(ve, {})
|
|
2642
2643
|
]
|
|
2643
2644
|
});
|
|
2644
2645
|
}
|
|
2645
2646
|
//#endregion
|
|
2646
2647
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2647
|
-
function
|
|
2648
|
+
function Ii({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2648
2649
|
let [i, a] = Z(null);
|
|
2649
|
-
|
|
2650
|
+
ai(r);
|
|
2650
2651
|
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;
|
|
2651
2652
|
return /* @__PURE__ */ Q("div", {
|
|
2652
2653
|
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",
|
|
@@ -2664,7 +2665,7 @@ function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2664
2665
|
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(K, {
|
|
2665
2666
|
tone: "primary",
|
|
2666
2667
|
size: "lg",
|
|
2667
|
-
className:
|
|
2668
|
+
className: Qt,
|
|
2668
2669
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2669
2670
|
iconRight: l ? "filter" : "chevron-right",
|
|
2670
2671
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
@@ -2674,7 +2675,7 @@ function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2674
2675
|
/* @__PURE__ */ Q(K, {
|
|
2675
2676
|
tone: "grey",
|
|
2676
2677
|
size: "lg",
|
|
2677
|
-
className:
|
|
2678
|
+
className: Qt,
|
|
2678
2679
|
iconLeft: "arrow-left",
|
|
2679
2680
|
iconRight: "arrow-left",
|
|
2680
2681
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2686,7 +2687,7 @@ function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2686
2687
|
}
|
|
2687
2688
|
//#endregion
|
|
2688
2689
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
2689
|
-
var
|
|
2690
|
+
var Li = { background: "var(--kol-surface-primary)" }, Ri = [
|
|
2690
2691
|
{
|
|
2691
2692
|
value: "generate",
|
|
2692
2693
|
label: "Generate"
|
|
@@ -2703,29 +2704,29 @@ var Ei = { background: "var(--kol-surface-primary)" }, Di = [
|
|
|
2703
2704
|
value: "output",
|
|
2704
2705
|
label: "Output"
|
|
2705
2706
|
}
|
|
2706
|
-
],
|
|
2707
|
+
], zi = Ri.filter((e) => e.value !== "generate"), Bi = "[&_.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)]", Vi = {
|
|
2707
2708
|
lg: 9.6,
|
|
2708
2709
|
sm: 7.2
|
|
2709
|
-
},
|
|
2710
|
-
function
|
|
2711
|
-
let n = t === "sm" ?
|
|
2710
|
+
}, Hi = 10, Ui = 232;
|
|
2711
|
+
function Wi(e, t) {
|
|
2712
|
+
let n = t === "sm" ? Ui : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
2712
2713
|
for (let o of e) {
|
|
2713
|
-
let e = o.label.length *
|
|
2714
|
+
let e = o.label.length * Vi[t] + Hi, s = Math.max(a, e);
|
|
2714
2715
|
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
2715
2716
|
}
|
|
2716
2717
|
return i.length && r.push(i), r;
|
|
2717
2718
|
}
|
|
2718
|
-
function
|
|
2719
|
-
return
|
|
2719
|
+
function Gi({ cells: e, size: t }) {
|
|
2720
|
+
return Wi(e, t).map((e, n) => /* @__PURE__ */ Q(J, {
|
|
2720
2721
|
value: null,
|
|
2721
2722
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
2722
2723
|
options: e,
|
|
2723
2724
|
size: t,
|
|
2724
2725
|
ariaLabel: "Randomize scope",
|
|
2725
|
-
className:
|
|
2726
|
+
className: Bi
|
|
2726
2727
|
}, n));
|
|
2727
2728
|
}
|
|
2728
|
-
var
|
|
2729
|
+
var Ki = [
|
|
2729
2730
|
2,
|
|
2730
2731
|
4,
|
|
2731
2732
|
8,
|
|
@@ -2734,17 +2735,17 @@ var Fi = [
|
|
|
2734
2735
|
value: String(e),
|
|
2735
2736
|
label: `${e}s`
|
|
2736
2737
|
}));
|
|
2737
|
-
function
|
|
2738
|
+
function qi({ size: e }) {
|
|
2738
2739
|
let { loopSeconds: t, setLoopSeconds: n } = C();
|
|
2739
2740
|
return /* @__PURE__ */ Q(J, {
|
|
2740
2741
|
value: String(t),
|
|
2741
2742
|
onChange: (e) => n(Number(e)),
|
|
2742
|
-
options:
|
|
2743
|
+
options: Ki,
|
|
2743
2744
|
size: e,
|
|
2744
2745
|
ariaLabel: "Loop length"
|
|
2745
2746
|
});
|
|
2746
2747
|
}
|
|
2747
|
-
var
|
|
2748
|
+
var Ji = [
|
|
2748
2749
|
{
|
|
2749
2750
|
value: "9:16",
|
|
2750
2751
|
label: "9:16"
|
|
@@ -2761,7 +2762,7 @@ var Li = [
|
|
|
2761
2762
|
value: "1:1",
|
|
2762
2763
|
label: "1:1"
|
|
2763
2764
|
}
|
|
2764
|
-
],
|
|
2765
|
+
], Yi = [
|
|
2765
2766
|
{
|
|
2766
2767
|
value: "5:4",
|
|
2767
2768
|
label: "5:4"
|
|
@@ -2779,20 +2780,20 @@ var Li = [
|
|
|
2779
2780
|
label: "Fill"
|
|
2780
2781
|
}
|
|
2781
2782
|
];
|
|
2782
|
-
function
|
|
2783
|
-
let f = nt(), { updateLayer: h, addFilter: _, removeFilter: v } = o(), { onExportPng: b } =
|
|
2783
|
+
function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: d }) {
|
|
2784
|
+
let f = nt(), { updateLayer: h, addFilter: _, removeFilter: v } = o(), { onExportPng: b } = Et(), [x, S] = Z(!1), [C, T] = Z(!0), [D, k] = Z(!1), [A, j] = Z(!1), [te, M] = Z("generate"), [ne, F] = Z(!1), [I, re] = Z(!1), { aspect: L } = o(), [R, ae] = Z(null), z = m(e);
|
|
2784
2785
|
Y(() => {
|
|
2785
2786
|
c && (T(!0), j(!0));
|
|
2786
2787
|
}, [c]);
|
|
2787
2788
|
let B = l ? "sm" : "lg", oe = l && !!e && C && !x;
|
|
2788
2789
|
Y(() => (u?.(oe), () => u?.(!1)), [oe]);
|
|
2789
|
-
let se = !l && e && C && !x ? R ? `${R}px` : ne ?
|
|
2790
|
+
let se = !l && e && C && !x ? R ? `${R}px` : ne ? pi.tall : pi.half : null;
|
|
2790
2791
|
Y(() => (d?.(se), () => d?.(null)), [se]);
|
|
2791
2792
|
let ce = () => {
|
|
2792
2793
|
let t = e?.type === "loop" && N(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2793
2794
|
t && h(e.id, H(t, e.loopGroup));
|
|
2794
2795
|
};
|
|
2795
|
-
if (
|
|
2796
|
+
if (Ur(ce, () => {
|
|
2796
2797
|
e?.type === "loop" && h(e.id, p(e, w(U(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2797
2798
|
}), !e) return null;
|
|
2798
2799
|
if (x) return /* @__PURE__ */ Q("button", {
|
|
@@ -2807,12 +2808,12 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2807
2808
|
let t = ee(e, z.take());
|
|
2808
2809
|
t && h(e.id, { filters: t });
|
|
2809
2810
|
};
|
|
2810
|
-
if (!C) return /* @__PURE__ */ $(
|
|
2811
|
+
if (!C) return /* @__PURE__ */ $(fi, {
|
|
2811
2812
|
label: V ? e.presetLabel : "Media",
|
|
2812
2813
|
onOpen: () => T(!0),
|
|
2813
2814
|
size: B,
|
|
2814
2815
|
children: [
|
|
2815
|
-
(V || he.length > 0) && /* @__PURE__ */ Q(
|
|
2816
|
+
(V || he.length > 0) && /* @__PURE__ */ Q(Hn, {
|
|
2816
2817
|
label: "Randomize all",
|
|
2817
2818
|
children: /* @__PURE__ */ Q(K, {
|
|
2818
2819
|
tone: "primary",
|
|
@@ -2823,7 +2824,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2823
2824
|
className: "shrink-0"
|
|
2824
2825
|
})
|
|
2825
2826
|
}),
|
|
2826
|
-
/* @__PURE__ */ Q(
|
|
2827
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2827
2828
|
label: "Download",
|
|
2828
2829
|
children: /* @__PURE__ */ Q(K, {
|
|
2829
2830
|
tone: "primary",
|
|
@@ -2834,7 +2835,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2834
2835
|
className: "shrink-0"
|
|
2835
2836
|
})
|
|
2836
2837
|
}),
|
|
2837
|
-
/* @__PURE__ */ Q(
|
|
2838
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2838
2839
|
label: "Hide UI",
|
|
2839
2840
|
children: /* @__PURE__ */ Q(K, {
|
|
2840
2841
|
tone: "primary",
|
|
@@ -2845,7 +2846,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2845
2846
|
className: "shrink-0"
|
|
2846
2847
|
})
|
|
2847
2848
|
}),
|
|
2848
|
-
/* @__PURE__ */ Q(
|
|
2849
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2849
2850
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2850
2851
|
children: /* @__PURE__ */ Q(K, {
|
|
2851
2852
|
tone: "primary",
|
|
@@ -2859,11 +2860,11 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2859
2860
|
})
|
|
2860
2861
|
]
|
|
2861
2862
|
});
|
|
2862
|
-
let ve = [...V ?
|
|
2863
|
+
let ve = [...V ? Ri : zi, ...V && f.steps.length >= 2 ? [{
|
|
2863
2864
|
value: "morph",
|
|
2864
2865
|
label: "Morph"
|
|
2865
2866
|
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" || n("motion"))), ye = ve.some((e) => e.value === te) ? te : ve[0].value;
|
|
2866
|
-
return /* @__PURE__ */ $(
|
|
2867
|
+
return /* @__PURE__ */ $(Yn, { children: [
|
|
2867
2868
|
/* @__PURE__ */ Q(pe, {
|
|
2868
2869
|
open: I,
|
|
2869
2870
|
onClose: () => re(!1),
|
|
@@ -2871,7 +2872,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2871
2872
|
layer: e,
|
|
2872
2873
|
size: B
|
|
2873
2874
|
}),
|
|
2874
|
-
D && /* @__PURE__ */ Q(
|
|
2875
|
+
D && /* @__PURE__ */ Q(oi, {
|
|
2875
2876
|
onPick: (e) => {
|
|
2876
2877
|
t(e), k(!1);
|
|
2877
2878
|
},
|
|
@@ -2883,7 +2884,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2883
2884
|
},
|
|
2884
2885
|
onDismiss: () => k(!1)
|
|
2885
2886
|
}),
|
|
2886
|
-
A && /* @__PURE__ */ Q(
|
|
2887
|
+
A && /* @__PURE__ */ Q(Ii, {
|
|
2887
2888
|
layer: e,
|
|
2888
2889
|
chain: he,
|
|
2889
2890
|
onPick: (t) => {
|
|
@@ -2893,12 +2894,12 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2893
2894
|
}),
|
|
2894
2895
|
/* @__PURE__ */ $("div", {
|
|
2895
2896
|
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)]",
|
|
2896
|
-
style: l ?
|
|
2897
|
-
...
|
|
2898
|
-
top: `calc(100dvh - ${se ??
|
|
2897
|
+
style: l ? Li : {
|
|
2898
|
+
...Li,
|
|
2899
|
+
top: `calc(100dvh - ${se ?? pi.half})`
|
|
2899
2900
|
},
|
|
2900
2901
|
children: [
|
|
2901
|
-
!l && /* @__PURE__ */ Q(
|
|
2902
|
+
!l && /* @__PURE__ */ Q(hi, {
|
|
2902
2903
|
tall: ne,
|
|
2903
2904
|
onToggle: () => {
|
|
2904
2905
|
ae(null), F((e) => !e);
|
|
@@ -2908,7 +2909,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2908
2909
|
e < 96 && (ae(null), T(!1));
|
|
2909
2910
|
}
|
|
2910
2911
|
}),
|
|
2911
|
-
/* @__PURE__ */ Q(
|
|
2912
|
+
/* @__PURE__ */ Q(di, {
|
|
2912
2913
|
title: le,
|
|
2913
2914
|
onCollapse: () => T(!1),
|
|
2914
2915
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
@@ -2928,9 +2929,9 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2928
2929
|
onChange: M,
|
|
2929
2930
|
options: ve,
|
|
2930
2931
|
size: B,
|
|
2931
|
-
className: l ?
|
|
2932
|
+
className: l ? Bi : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2932
2933
|
}),
|
|
2933
|
-
ye === "morph" && V && /* @__PURE__ */ Q(
|
|
2934
|
+
ye === "morph" && V && /* @__PURE__ */ Q(Ar, {
|
|
2934
2935
|
layer: e,
|
|
2935
2936
|
readOnly: !0
|
|
2936
2937
|
}),
|
|
@@ -2962,7 +2963,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2962
2963
|
onClick: W,
|
|
2963
2964
|
children: "Randomize all"
|
|
2964
2965
|
}),
|
|
2965
|
-
/* @__PURE__ */ Q(
|
|
2966
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2966
2967
|
label: "What Randomize all rolls",
|
|
2967
2968
|
children: /* @__PURE__ */ Q(K, {
|
|
2968
2969
|
tone: "primary",
|
|
@@ -2973,7 +2974,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2973
2974
|
className: "shrink-0"
|
|
2974
2975
|
})
|
|
2975
2976
|
}),
|
|
2976
|
-
/* @__PURE__ */ Q(
|
|
2977
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2977
2978
|
label: "Reset to defaults",
|
|
2978
2979
|
shortcut: "R",
|
|
2979
2980
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -2987,7 +2988,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2987
2988
|
})
|
|
2988
2989
|
]
|
|
2989
2990
|
}),
|
|
2990
|
-
de.length > 0 && /* @__PURE__ */ Q(
|
|
2991
|
+
de.length > 0 && /* @__PURE__ */ Q(Gi, {
|
|
2991
2992
|
size: B,
|
|
2992
2993
|
cells: [...de.map((e) => ({
|
|
2993
2994
|
value: e.id,
|
|
@@ -3045,7 +3046,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3045
3046
|
iconRight: "trash",
|
|
3046
3047
|
onClick: () => v(e.id, n),
|
|
3047
3048
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3048
|
-
}), i.length > 0 && /* @__PURE__ */ Q(
|
|
3049
|
+
}), i.length > 0 && /* @__PURE__ */ Q(Gi, {
|
|
3049
3050
|
size: B,
|
|
3050
3051
|
cells: i.map((e) => ({
|
|
3051
3052
|
value: e.id,
|
|
@@ -3061,7 +3062,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3061
3062
|
children: [(() => {
|
|
3062
3063
|
let e = n("motion").TransportBar;
|
|
3063
3064
|
return /* @__PURE__ */ Q(e, { size: B });
|
|
3064
|
-
})(), /* @__PURE__ */ Q(
|
|
3065
|
+
})(), /* @__PURE__ */ Q(qi, { size: B })]
|
|
3065
3066
|
}),
|
|
3066
3067
|
ye === "output" && /* @__PURE__ */ $("div", {
|
|
3067
3068
|
className: "flex flex-col gap-2 pt-3",
|
|
@@ -3069,14 +3070,14 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3069
3070
|
/* @__PURE__ */ Q(J, {
|
|
3070
3071
|
value: a,
|
|
3071
3072
|
onChange: s,
|
|
3072
|
-
options:
|
|
3073
|
+
options: Ji,
|
|
3073
3074
|
size: B,
|
|
3074
3075
|
ariaLabel: "Aspect"
|
|
3075
3076
|
}),
|
|
3076
3077
|
/* @__PURE__ */ Q(J, {
|
|
3077
3078
|
value: a,
|
|
3078
3079
|
onChange: s,
|
|
3079
|
-
options:
|
|
3080
|
+
options: Yi,
|
|
3080
3081
|
size: B,
|
|
3081
3082
|
ariaLabel: "Aspect (landscape) and fill"
|
|
3082
3083
|
}),
|
|
@@ -3086,7 +3087,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3086
3087
|
/* @__PURE__ */ Q(K, {
|
|
3087
3088
|
tone: "primary",
|
|
3088
3089
|
size: B,
|
|
3089
|
-
onClick: () =>
|
|
3090
|
+
onClick: () => Ot({ focusName: !0 }),
|
|
3090
3091
|
children: "Save…"
|
|
3091
3092
|
}),
|
|
3092
3093
|
/* @__PURE__ */ Q(K, {
|
|
@@ -3119,7 +3120,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3119
3120
|
}
|
|
3120
3121
|
//#endregion
|
|
3121
3122
|
//#region src/editor/mobile/MobileView.jsx
|
|
3122
|
-
function
|
|
3123
|
+
function Zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
3123
3124
|
return /* @__PURE__ */ Q("div", {
|
|
3124
3125
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
3125
3126
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -3137,45 +3138,45 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3137
3138
|
})]
|
|
3138
3139
|
}) : /* @__PURE__ */ Q("span", {
|
|
3139
3140
|
className: "kol-eyebrow text-body",
|
|
3140
|
-
children:
|
|
3141
|
+
children: yn("randomiser").label
|
|
3141
3142
|
}), /* @__PURE__ */ $("div", {
|
|
3142
3143
|
className: "flex flex-col gap-2",
|
|
3143
3144
|
children: [
|
|
3144
3145
|
/* @__PURE__ */ Q(K, {
|
|
3145
3146
|
tone: "primary",
|
|
3146
3147
|
size: "lg",
|
|
3147
|
-
className:
|
|
3148
|
-
iconLeft:
|
|
3149
|
-
iconRight:
|
|
3148
|
+
className: Qt,
|
|
3149
|
+
iconLeft: dn.randomiser,
|
|
3150
|
+
iconRight: dn.randomiser,
|
|
3150
3151
|
onClick: e,
|
|
3151
3152
|
children: "Generate"
|
|
3152
3153
|
}),
|
|
3153
3154
|
/* @__PURE__ */ Q(K, {
|
|
3154
3155
|
tone: "primary",
|
|
3155
3156
|
size: "lg",
|
|
3156
|
-
className:
|
|
3157
|
+
className: Qt,
|
|
3157
3158
|
iconLeft: "filter",
|
|
3158
3159
|
iconRight: "filter",
|
|
3159
3160
|
onClick: t,
|
|
3160
3161
|
children: "Effects"
|
|
3161
3162
|
}),
|
|
3162
|
-
n &&
|
|
3163
|
+
n && Sn() && /* @__PURE__ */ Q(K, {
|
|
3163
3164
|
tone: "primary",
|
|
3164
3165
|
size: "lg",
|
|
3165
3166
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3166
|
-
iconLeft:
|
|
3167
|
-
iconRight:
|
|
3168
|
-
onClick:
|
|
3169
|
-
children:
|
|
3167
|
+
iconLeft: dn.editor,
|
|
3168
|
+
iconRight: dn.editor,
|
|
3169
|
+
onClick: En,
|
|
3170
|
+
children: yn("editor").label
|
|
3170
3171
|
}),
|
|
3171
3172
|
n && /* @__PURE__ */ Q(K, {
|
|
3172
3173
|
tone: "primary",
|
|
3173
3174
|
size: "lg",
|
|
3174
3175
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3175
|
-
iconLeft:
|
|
3176
|
-
iconRight:
|
|
3177
|
-
onClick:
|
|
3178
|
-
children:
|
|
3176
|
+
iconLeft: dn.labs,
|
|
3177
|
+
iconRight: dn.labs,
|
|
3178
|
+
onClick: en,
|
|
3179
|
+
children: yn("labs").label
|
|
3179
3180
|
}),
|
|
3180
3181
|
n && /* @__PURE__ */ Q(K, {
|
|
3181
3182
|
tone: "primary",
|
|
@@ -3183,7 +3184,7 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3183
3184
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3184
3185
|
iconLeft: "swap",
|
|
3185
3186
|
iconRight: "swap",
|
|
3186
|
-
onClick: () =>
|
|
3187
|
+
onClick: () => pn("/morph"),
|
|
3187
3188
|
children: "Morph"
|
|
3188
3189
|
})
|
|
3189
3190
|
]
|
|
@@ -3191,8 +3192,8 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3191
3192
|
})
|
|
3192
3193
|
});
|
|
3193
3194
|
}
|
|
3194
|
-
function
|
|
3195
|
-
let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: s, aspect: c, setAspect: l } = o(), { setTool: u } =
|
|
3195
|
+
function Qi() {
|
|
3196
|
+
let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: s, aspect: c, setAspect: l } = o(), { setTool: u } = Nt(), d = hn() && !wn(), f = _n(), p = () => {
|
|
3196
3197
|
let e = new URLSearchParams(window.location.search);
|
|
3197
3198
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3198
3199
|
}, [m, h] = Z(p), [g, _] = Z(!1), [v, y] = Z(null), [b, x] = Z("contain"), [S, C] = Z(!1), [w, E] = Z(null), [D, ee] = Z({
|
|
@@ -3252,7 +3253,7 @@ function Vi() {
|
|
|
3252
3253
|
let t = j.current;
|
|
3253
3254
|
t && t.id === e.pointerId && e.type === "pointerup" && m === "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));
|
|
3254
3255
|
};
|
|
3255
|
-
|
|
3256
|
+
rr(), Y(() => (nn("randomiser"), () => nn(null)), []), Y(() => {
|
|
3256
3257
|
l("4:5"), u("orbit");
|
|
3257
3258
|
}, []);
|
|
3258
3259
|
let F = e.find((e) => e.id === v) ?? (e.length === 1 ? e[0] : null), I = m === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
|
|
@@ -3326,21 +3327,21 @@ function Vi() {
|
|
|
3326
3327
|
onPointerUpCapture: P,
|
|
3327
3328
|
onPointerCancelCapture: P,
|
|
3328
3329
|
onPointerLeave: P,
|
|
3329
|
-
children: /* @__PURE__ */ Q(
|
|
3330
|
+
children: /* @__PURE__ */ Q($t, { fit: b })
|
|
3330
3331
|
}),
|
|
3331
|
-
m === "entry" && /* @__PURE__ */ Q(
|
|
3332
|
+
m === "entry" && /* @__PURE__ */ Q(Zi, {
|
|
3332
3333
|
chromes: d,
|
|
3333
3334
|
onGenerate: () => h("category"),
|
|
3334
3335
|
onEffects: () => {
|
|
3335
3336
|
_(!0), ie();
|
|
3336
3337
|
}
|
|
3337
3338
|
}),
|
|
3338
|
-
m === "category" && /* @__PURE__ */ Q(
|
|
3339
|
+
m === "category" && /* @__PURE__ */ Q(oi, {
|
|
3339
3340
|
onPick: re,
|
|
3340
3341
|
onInsert: ie,
|
|
3341
3342
|
onBack: () => h("entry")
|
|
3342
3343
|
}),
|
|
3343
|
-
m === "live" && !I && /* @__PURE__ */ Q(
|
|
3344
|
+
m === "live" && !I && /* @__PURE__ */ Q(Xi, {
|
|
3344
3345
|
layer: F,
|
|
3345
3346
|
onSwitchCategory: L,
|
|
3346
3347
|
onInsert: () => {
|
|
@@ -3359,7 +3360,7 @@ function Vi() {
|
|
|
3359
3360
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3360
3361
|
children: [/* @__PURE__ */ Q("div", {
|
|
3361
3362
|
className: "flex-1 min-h-0",
|
|
3362
|
-
children: /* @__PURE__ */ Q(
|
|
3363
|
+
children: /* @__PURE__ */ Q(li, { layer: F })
|
|
3363
3364
|
}), /* @__PURE__ */ Q("div", {
|
|
3364
3365
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3365
3366
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -3373,11 +3374,263 @@ function Vi() {
|
|
|
3373
3374
|
]
|
|
3374
3375
|
});
|
|
3375
3376
|
}
|
|
3376
|
-
function
|
|
3377
|
-
return /* @__PURE__ */ $(
|
|
3377
|
+
function $i() {
|
|
3378
|
+
return /* @__PURE__ */ $(fn, {
|
|
3378
3379
|
persistDraft: !1,
|
|
3379
|
-
children: [/* @__PURE__ */ Q(
|
|
3380
|
+
children: [/* @__PURE__ */ Q(Qi, {}), /* @__PURE__ */ Q(St, {})]
|
|
3381
|
+
});
|
|
3382
|
+
}
|
|
3383
|
+
//#endregion
|
|
3384
|
+
//#region src/editor/labs/FloatLabs.jsx
|
|
3385
|
+
function ea() {
|
|
3386
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = (e) => () => e(), a = (e) => () => window.dispatchEvent(new CustomEvent(e));
|
|
3387
|
+
return {
|
|
3388
|
+
app: {
|
|
3389
|
+
label: "FXR",
|
|
3390
|
+
items: [{
|
|
3391
|
+
label: "Home",
|
|
3392
|
+
onClick: () => pn("/")
|
|
3393
|
+
}, {
|
|
3394
|
+
label: "Settings",
|
|
3395
|
+
onClick: () => pn("/settings")
|
|
3396
|
+
}]
|
|
3397
|
+
},
|
|
3398
|
+
menus: [
|
|
3399
|
+
{
|
|
3400
|
+
label: "File",
|
|
3401
|
+
width: 240,
|
|
3402
|
+
items: [
|
|
3403
|
+
{
|
|
3404
|
+
label: "Files…",
|
|
3405
|
+
kbd: "⌘O",
|
|
3406
|
+
onClick: i(() => Ot())
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
label: "Save patch",
|
|
3410
|
+
kbd: "⌘S",
|
|
3411
|
+
onClick: () => cn("File")
|
|
3412
|
+
},
|
|
3413
|
+
{ divider: !0 },
|
|
3414
|
+
{
|
|
3415
|
+
label: "Output…",
|
|
3416
|
+
onClick: () => cn("Output")
|
|
3417
|
+
},
|
|
3418
|
+
{
|
|
3419
|
+
label: "File…",
|
|
3420
|
+
onClick: () => cn("File")
|
|
3421
|
+
}
|
|
3422
|
+
]
|
|
3423
|
+
},
|
|
3424
|
+
{
|
|
3425
|
+
label: "Edit",
|
|
3426
|
+
width: 220,
|
|
3427
|
+
items: [{
|
|
3428
|
+
label: "Undo",
|
|
3429
|
+
kbd: "⌘Z",
|
|
3430
|
+
disabled: !n,
|
|
3431
|
+
onClick: e
|
|
3432
|
+
}, {
|
|
3433
|
+
label: "Redo",
|
|
3434
|
+
kbd: "⇧⌘Z",
|
|
3435
|
+
disabled: !r,
|
|
3436
|
+
onClick: t
|
|
3437
|
+
}]
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
label: "View",
|
|
3441
|
+
width: 240,
|
|
3442
|
+
items: [
|
|
3443
|
+
{
|
|
3444
|
+
label: "Play / pause",
|
|
3445
|
+
kbd: "Space",
|
|
3446
|
+
onClick: () => O.toggle()
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
label: "Rewind",
|
|
3450
|
+
onClick: () => O.rewind()
|
|
3451
|
+
},
|
|
3452
|
+
{ divider: !0 },
|
|
3453
|
+
{
|
|
3454
|
+
label: "Transport",
|
|
3455
|
+
onClick: () => cn("Transport")
|
|
3456
|
+
},
|
|
3457
|
+
{
|
|
3458
|
+
label: "Shortcuts",
|
|
3459
|
+
kbd: "S",
|
|
3460
|
+
onClick: a("kol:show-shortcuts")
|
|
3461
|
+
}
|
|
3462
|
+
]
|
|
3463
|
+
}
|
|
3464
|
+
],
|
|
3465
|
+
end: [{
|
|
3466
|
+
label: "Help",
|
|
3467
|
+
items: [{
|
|
3468
|
+
label: "Keyboard shortcuts",
|
|
3469
|
+
kbd: "S",
|
|
3470
|
+
onClick: a("kol:show-shortcuts")
|
|
3471
|
+
}]
|
|
3472
|
+
}]
|
|
3473
|
+
};
|
|
3474
|
+
}
|
|
3475
|
+
function ta() {
|
|
3476
|
+
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
3477
|
+
Y(() => {
|
|
3478
|
+
n?.type === "photo" && n.src && (i.current = {
|
|
3479
|
+
src: n.src,
|
|
3480
|
+
srcType: n.srcType,
|
|
3481
|
+
fit: n.fit
|
|
3482
|
+
});
|
|
3483
|
+
}, [
|
|
3484
|
+
n?.type,
|
|
3485
|
+
n?.src,
|
|
3486
|
+
n?.srcType,
|
|
3487
|
+
n?.fit
|
|
3488
|
+
]);
|
|
3489
|
+
let a = Er({
|
|
3490
|
+
layer: n,
|
|
3491
|
+
setOnly: r,
|
|
3492
|
+
addFilter: e,
|
|
3493
|
+
patchFilter: t,
|
|
3494
|
+
carriedSource: () => n?.type === "photo" ? {
|
|
3495
|
+
src: n.src,
|
|
3496
|
+
srcType: n.srcType,
|
|
3497
|
+
fit: n.fit
|
|
3498
|
+
} : i.current ?? {}
|
|
3499
|
+
}), s = [], c = /* @__PURE__ */ new Map(), l = null;
|
|
3500
|
+
return a.forEach((e) => {
|
|
3501
|
+
if (e.id.startsWith("sec:")) {
|
|
3502
|
+
s.push({
|
|
3503
|
+
icon: Sr[e.id.slice(4)] ?? "square",
|
|
3504
|
+
label: e.label,
|
|
3505
|
+
path: e.id,
|
|
3506
|
+
sub: []
|
|
3507
|
+
});
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
let t = e.pages ?? [], n = e.onSelect ?? t[0]?.onSelect ?? t[0]?.children?.[0]?.onSelect;
|
|
3511
|
+
n && c.set(e.id, n), (e.active || t.some((e) => e.active || e.children?.some((e) => e.active))) && (l = e.id);
|
|
3512
|
+
let r = {
|
|
3513
|
+
icon: e.icon,
|
|
3514
|
+
label: e.label,
|
|
3515
|
+
path: e.id
|
|
3516
|
+
}, i = s[s.length - 1];
|
|
3517
|
+
i?.sub ? i.sub.push(r) : s.push(r);
|
|
3518
|
+
}), {
|
|
3519
|
+
items: s,
|
|
3520
|
+
active: l,
|
|
3521
|
+
pick: (e) => c.get(e)?.()
|
|
3522
|
+
};
|
|
3523
|
+
}
|
|
3524
|
+
function na() {
|
|
3525
|
+
let { layer: e } = W(), { removeLayer: t } = o(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam";
|
|
3526
|
+
return /* @__PURE__ */ $("div", {
|
|
3527
|
+
className: "kol-float-labs-stage relative h-full min-h-[360px] flex items-center justify-center overflow-hidden rounded-[var(--kol-float-window-r)]",
|
|
3528
|
+
style: { background: "var(--kol-surface-secondary)" },
|
|
3529
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
3530
|
+
style: {
|
|
3531
|
+
flex: "none",
|
|
3532
|
+
width: "85%",
|
|
3533
|
+
height: "85%"
|
|
3534
|
+
},
|
|
3535
|
+
children: /* @__PURE__ */ Q(Xt, {})
|
|
3536
|
+
}), n && /* @__PURE__ */ Q(ui, {
|
|
3537
|
+
layer: e,
|
|
3538
|
+
title: vi(e).title,
|
|
3539
|
+
onBack: () => t(e.id)
|
|
3540
|
+
})]
|
|
3541
|
+
});
|
|
3542
|
+
}
|
|
3543
|
+
function ra() {
|
|
3544
|
+
wt();
|
|
3545
|
+
let e = Wn("(max-width: 767px)"), { layer: t } = W(), { undo: n, redo: r, canUndo: i, canRedo: a, selectedId: s, select: c } = o();
|
|
3546
|
+
Y(() => {
|
|
3547
|
+
t && s !== t.id && c(t.id);
|
|
3548
|
+
}, [
|
|
3549
|
+
t,
|
|
3550
|
+
s,
|
|
3551
|
+
c
|
|
3552
|
+
]);
|
|
3553
|
+
let { menus: l, end: u } = ea(), d = ta(), f = t ? vi(t).title : "Labs", p = d.items.filter((e) => e.sub?.length).map((e) => e.path), m = /* @__PURE__ */ Q(Qn, {
|
|
3554
|
+
name: f || "Untitled",
|
|
3555
|
+
status: "Labs",
|
|
3556
|
+
onBack: () => pn("/"),
|
|
3557
|
+
menuItems: Nn([...l, ...u].map((e) => ({
|
|
3558
|
+
label: e.label,
|
|
3559
|
+
items: e.items
|
|
3560
|
+
})))
|
|
3561
|
+
}), h = /* @__PURE__ */ Q(er, {
|
|
3562
|
+
onUndo: () => i && n(),
|
|
3563
|
+
onRedo: () => a && r(),
|
|
3564
|
+
onAction: () => cn("Output"),
|
|
3565
|
+
onAccount: () => pn("/settings")
|
|
3566
|
+
}), g = /* @__PURE__ */ Q(Zn, {
|
|
3567
|
+
variant: "mobile",
|
|
3568
|
+
shape: "pill",
|
|
3569
|
+
labels: !e,
|
|
3570
|
+
items: rn,
|
|
3571
|
+
sheetItems: tn,
|
|
3572
|
+
currentPath: "/labs",
|
|
3573
|
+
onNavigate: kn
|
|
3574
|
+
});
|
|
3575
|
+
return /* @__PURE__ */ Q("div", {
|
|
3576
|
+
className: "kol-float-labs kol-editor-shell",
|
|
3577
|
+
"data-editor-keep-selection": !0,
|
|
3578
|
+
children: /* @__PURE__ */ Q($n, {
|
|
3579
|
+
nav: d.items,
|
|
3580
|
+
currentPath: d.active ?? "",
|
|
3581
|
+
onNavigate: d.pick,
|
|
3582
|
+
title: "Labs",
|
|
3583
|
+
icon: "globe",
|
|
3584
|
+
defaultExpanded: p,
|
|
3585
|
+
breadcrumb: [
|
|
3586
|
+
"FXR",
|
|
3587
|
+
"Labs",
|
|
3588
|
+
f || "Untitled"
|
|
3589
|
+
],
|
|
3590
|
+
bar: {
|
|
3591
|
+
start: m,
|
|
3592
|
+
center: e ? void 0 : /* @__PURE__ */ Q(Ut, {}),
|
|
3593
|
+
end: h
|
|
3594
|
+
},
|
|
3595
|
+
inspectorLabel: "Parameters",
|
|
3596
|
+
inspector: ({ hide: t }) => /* @__PURE__ */ Q(tr, {
|
|
3597
|
+
title: f || "Parameters",
|
|
3598
|
+
onCollapse: t,
|
|
3599
|
+
width: e ? "100%" : 352,
|
|
3600
|
+
density: "compact",
|
|
3601
|
+
surface: "solid",
|
|
3602
|
+
sections: [{
|
|
3603
|
+
id: "labs-params",
|
|
3604
|
+
label: "Parameters",
|
|
3605
|
+
rows: [{
|
|
3606
|
+
id: "body",
|
|
3607
|
+
render: () => /* @__PURE__ */ Q("div", {
|
|
3608
|
+
className: "kol-editor-labs",
|
|
3609
|
+
children: /* @__PURE__ */ Q("div", {
|
|
3610
|
+
className: "kol-compose-inspector-body",
|
|
3611
|
+
children: /* @__PURE__ */ Q(ii, {})
|
|
3612
|
+
})
|
|
3613
|
+
})
|
|
3614
|
+
}]
|
|
3615
|
+
}],
|
|
3616
|
+
footer: /* @__PURE__ */ Q("div", {
|
|
3617
|
+
className: "kol-editor-labs",
|
|
3618
|
+
children: /* @__PURE__ */ Q(qt, {})
|
|
3619
|
+
})
|
|
3620
|
+
}),
|
|
3621
|
+
bottom: e ? g : /* @__PURE__ */ Q("div", {
|
|
3622
|
+
className: "w-[418px] h-[66px] [transform:translateZ(0)] [&_.kol-mobile-tabbar]:!flex",
|
|
3623
|
+
children: g
|
|
3624
|
+
}),
|
|
3625
|
+
children: /* @__PURE__ */ Q(na, {})
|
|
3626
|
+
})
|
|
3627
|
+
});
|
|
3628
|
+
}
|
|
3629
|
+
function ia() {
|
|
3630
|
+
return /* @__PURE__ */ $(fn, {
|
|
3631
|
+
draftKey: Pi,
|
|
3632
|
+
children: [/* @__PURE__ */ Q(ra, {}), /* @__PURE__ */ Q(St, {})]
|
|
3380
3633
|
});
|
|
3381
3634
|
}
|
|
3382
3635
|
//#endregion
|
|
3383
|
-
export {
|
|
3636
|
+
export { kt as AppSettingsSections, Rt as BRAND, Tn as DesignEditor, Tn as default, At as DisplaySettingsDrawer, fn as EditorProviders, Pn as FilesDialog, mn as FloatDesignEditor, ia as FloatLabsView, ze as GeneratorLibraryProvider, Pi as LABS_DRAFT_KEY, Ve as LIBRARY_SLOT_KEYS, Fi as LabsView, Yt as MODES, $i as MobileView, Xt as OutputCanvas, $t as OutputStage, vn as OutputView, Jt as RAIL_EXTRA_PREFIX, pt as TimelineRail, We as UnauthorizedError, On as VIEW_PATHS, Tt as closeFiles, Lt as comboLabel, xn as copyStored, Zt as currentView, on as duplicateStored, Pe as getLibraryApi, je as inviteFromRequest, hn as isMobileDevice, Ee as listInviteRequests, Be as loadLibrary, Ue as mintInvite, Ot as openFiles, Ie as readLibraryRaw, d as registerPack, Gt as removeStored, gn as renameStored, Me as requestInvite, Oe as setLibraryApi, It as setMediaClient, xt as setMediaProxyBase, an as setMode, Wt as setNavigator, un as setRailExtras, x as setSettingsStore, Cn as setThumbStored, sn as setWantsDesktop, Ct as shortcutsBySection, De as signInLibrary, Ae as signOutLibrary, Re as signUpLibrary, Ne as subscribeLibrary, mt as timelineView, Te as updateAccount, Le as useAccount, Pt as useFilesDialog, He as useGeneratorLibrary, ke as useLibrarySession, Dn as useRailExtras, Mt as useSettingsSections, wn as wantsDesktop, An as withView };
|