@kolkrabbi/design-editor 0.48.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/{BindDot-Cx-M0iQt.js → BindDot-BAAc-KSs.js} +1 -1
- package/dist/{KolboxView-BjYfn_tl.js → KolboxView-D-HMCPnW.js} +3137 -5182
- package/dist/{Timeline-CRr43b4B.js → Timeline-BH3BF2m4.js} +2 -2
- package/dist/{TreePicker-DXsAlHK6.js → TreePicker-RImJ6I_0.js} +11 -11
- package/dist/{core-BbKj9Svq.js → core-DyfKZlBI.js} +2213 -2185
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +6 -6
- package/dist/{effectCategories-wHY9ih8L.js → effectCategories-B5jhXEyy.js} +21 -21
- package/dist/effects-BAwNQ8Kj.js +447 -0
- package/dist/effects.js +1 -1
- package/dist/{generators-BtRZ3Stj.js → generators-OCg5XjTX.js} +838 -838
- package/dist/generators.js +1 -1
- package/dist/{host-II9SeVCH.js → host-DS-pAjP0.js} +2 -2
- package/dist/kolbox-pages.js +2218 -0
- package/dist/kolbox.css +1 -1
- package/dist/{morphStore-s-rjCe-y.js → morphStore-D6xiYiR_.js} +1 -1
- package/dist/{motion-CKtZAccJ.js → motion-p5pHH9_J.js} +95 -95
- package/dist/motion.js +1 -1
- package/dist/portable-Cdl5s09F.js +2129 -0
- package/dist/{rolls-Cnu6g8th.js → rolls-ZToBSscx.js} +1 -1
- package/dist/{src-3UkpFoNW.js → src-PZgdetsA.js} +416 -416
- package/dist/{store-YIW6P2zN.js → store-BDAxvWTE.js} +1 -1
- package/dist/{useLayerEdit-W_Tf3adq.js → useLayerEdit-D6vwfIoB.js} +90 -90
- package/package.json +9 -6
- package/dist/effects-D7J0e5xl.js +0 -447
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { C as e, E as t, T as n, d as r, o as i, s as a, u as o, w as s } from "./__vite-browser-external-y2xWjzgx.js";
|
|
2
|
-
import { $t as c, B as l, D as u, F as d,
|
|
3
|
-
import { n as
|
|
4
|
-
import { C as
|
|
5
|
-
import { r as pe } from "./TreePicker-
|
|
6
|
-
import { A as me, F as he, I as ge, M as _e, P as ve, R as ye, V as be, _ as xe, g as Se, h as Ce, j as we, v as Te, x as Ee, y as De, z as Oe } from "./generators-
|
|
7
|
-
import { b as ke, u as Ae } from "./store-
|
|
8
|
-
import { a as je, c as Me, d as Ne, f as Pe, i as Fe, l as Ie, n as Le, o as Re, p as ze, r as Be, s as q, t as Ve, u as He } from "./morphStore-
|
|
9
|
-
import { n as Ue, r as We, t as Ge } from "./BindDot-
|
|
10
|
-
import { n as Ke, r as qe } from "./effects-
|
|
11
|
-
import { c as Je, d as Ye, l as Xe, n as Ze, o as Qe } from "./motion-
|
|
12
|
-
import { t as $e } from "./Timeline-
|
|
13
|
-
import {
|
|
2
|
+
import { $t as c, B as l, D as u, F as d, I as f, In as p, J as m, Jn as h, Kn as g, L as _, Nr as v, P as y, Qn as b, Xt as x, Zn as S, a as C, bn as w, bt as T, d as E, en as D, f as O, i as k, j as A, n as j, o as M, p as N, qn as P, r as F, tr as I } from "./rolls-ZToBSscx.js";
|
|
3
|
+
import { n as L, r as R, t as z } from "./useLayerEdit-D6vwfIoB.js";
|
|
4
|
+
import { C as ee, D as B, E as V, _ as H, a as U, c as W, d as te, f as G, g as ne, i as re, l as ie, m as ae, n as oe, r as se, t as ce, u as le, v as ue, w as de, x as K, y as fe } from "./effectCategories-B5jhXEyy.js";
|
|
5
|
+
import { r as pe } from "./TreePicker-RImJ6I_0.js";
|
|
6
|
+
import { A as me, F as he, I as ge, M as _e, P as ve, R as ye, V as be, _ as xe, g as Se, h as Ce, j as we, v as Te, x as Ee, y as De, z as Oe } from "./generators-OCg5XjTX.js";
|
|
7
|
+
import { b as ke, u as Ae } from "./store-BDAxvWTE.js";
|
|
8
|
+
import { a as je, c as Me, d as Ne, f as Pe, i as Fe, l as Ie, n as Le, o as Re, p as ze, r as Be, s as q, t as Ve, u as He } from "./morphStore-D6xiYiR_.js";
|
|
9
|
+
import { n as Ue, r as We, t as Ge } from "./BindDot-BAAc-KSs.js";
|
|
10
|
+
import { n as Ke, r as qe } from "./effects-BAwNQ8Kj.js";
|
|
11
|
+
import { c as Je, d as Ye, l as Xe, n as Ze, o as Qe } from "./motion-p5pHH9_J.js";
|
|
12
|
+
import { t as $e } from "./Timeline-BH3BF2m4.js";
|
|
13
|
+
import { Cn as et, Ct as tt, H as nt, I as rt, K as it, M as at, Mt as ot, N as st, Nt as ct, O as lt, V as ut, X as dt, _t as ft, bn as pt, c as mt, cn as ht, ct as gt, d as _t, fn as vt, gn as yt, h as bt, ht as xt, in as St, j as Ct, jt as wt, l as Tt, ln as Et, m as Dt, mn as Ot, on as kt, ot as At, p as jt, pn as Mt, s as Nt, sn as Pt, t as Ft, u as It, un as Lt, v as Rt, wt as zt, xn as Bt, xt as Vt, yn as Ht } from "./core-DyfKZlBI.js";
|
|
14
14
|
import { Button as J, ButtonGroup as Ut, Divider as Wt, MultiSelect as Gt, StepList as Kt, Tag as qt, Tooltip as Jt, useGrabEdge as Yt, useModal as Xt } from "@kolkrabbi/kol-component";
|
|
15
15
|
import { Suspense as Zt, createContext as Qt, lazy as $t, useContext as en, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as tn } from "react";
|
|
16
16
|
import { Fragment as nn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
@@ -132,7 +132,7 @@ function xn(e) {
|
|
|
132
132
|
if (!bn) {
|
|
133
133
|
bn = /* @__PURE__ */ new Map();
|
|
134
134
|
let e = /* @__PURE__ */ new Set();
|
|
135
|
-
for (let t of
|
|
135
|
+
for (let t of ae) for (let n of V(t.id)) e.has(n.id) || fe(n) || (e.add(n.id), bn.has(n.loop) || bn.set(n.loop, []), bn.get(n.loop).push(n));
|
|
136
136
|
}
|
|
137
137
|
return bn.get(e) ?? [];
|
|
138
138
|
}
|
|
@@ -177,7 +177,7 @@ function On(e) {
|
|
|
177
177
|
fileId: null,
|
|
178
178
|
fileName: e.label,
|
|
179
179
|
presetId: e.id
|
|
180
|
-
}), i.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) ||
|
|
180
|
+
}), i.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || Bt("/morph"));
|
|
181
181
|
}
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/editor/labs/catalog.js
|
|
@@ -275,21 +275,21 @@ function Pn({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
275
275
|
presetLabel: e.label,
|
|
276
276
|
comp: Ye(e)
|
|
277
277
|
}), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
278
|
-
}, u = e?.presetId ?? null, d = (e?.filters ?? []).find((e) => e?.id !== "fx-media")?.id ?? null, f = u ?
|
|
279
|
-
let a =
|
|
278
|
+
}, u = e?.presetId ?? null, d = (e?.filters ?? []).find((e) => e?.id !== "fx-media")?.id ?? null, f = u ? V(e?.loopGroup).find((e) => e.id === u) ?? null : null, p = (n, r = "loop", i) => {
|
|
279
|
+
let a = V(n), o = [...new Set(a.map((e) => e.sub).filter(Boolean))], s = (e) => r === "misc" ? () => {
|
|
280
280
|
t("misc", de(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
281
281
|
} : () => c(e, n);
|
|
282
282
|
return o.length ? o.map((t) => ({
|
|
283
283
|
label: t,
|
|
284
|
-
onSelect: s(
|
|
284
|
+
onSelect: s(B(n, t)[0]),
|
|
285
285
|
active: e?.loopGroup === n && f?.sub === t
|
|
286
286
|
})) : [{
|
|
287
|
-
label: i ??
|
|
287
|
+
label: i ?? H(n).label,
|
|
288
288
|
onSelect: s(a[0]),
|
|
289
289
|
active: e?.loopGroup === n
|
|
290
290
|
}];
|
|
291
291
|
}, m = (e) => e.groups.flatMap((t) => {
|
|
292
|
-
let n = e.labels?.[t] ??
|
|
292
|
+
let n = e.labels?.[t] ?? H(t).label, r = V(t).some((e) => e.sub), i = p(t, "loop", n);
|
|
293
293
|
return e.groups.length > 1 && r ? [{
|
|
294
294
|
label: n,
|
|
295
295
|
children: i
|
|
@@ -307,17 +307,17 @@ function Pn({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
307
307
|
id: "sec:effects",
|
|
308
308
|
label: "Effects"
|
|
309
309
|
},
|
|
310
|
-
...
|
|
310
|
+
...se(G).map((t) => ({
|
|
311
311
|
id: `fx:${t.id}`,
|
|
312
312
|
label: t.label,
|
|
313
313
|
icon: kn[`fx:${t.id}`] ?? "square",
|
|
314
|
-
pages: t.rack ?
|
|
314
|
+
pages: t.rack ? ce.map((t) => ({
|
|
315
315
|
label: t.label,
|
|
316
316
|
onSelect: () => s(t.id),
|
|
317
317
|
active: e?.fxGroup === t.id
|
|
318
318
|
})) : t.id === "pattern" ? jn.map((t) => ({
|
|
319
319
|
label: t,
|
|
320
|
-
onSelect: () => c(
|
|
320
|
+
onSelect: () => c(B("optic", t)[0], "optic"),
|
|
321
321
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
322
322
|
})) : t.id === "scanline" ? Mn.map((t) => ({
|
|
323
323
|
label: t.label,
|
|
@@ -397,7 +397,7 @@ function Pn({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region src/editor/labs/LabsNav.jsx
|
|
399
399
|
function Fn() {
|
|
400
|
-
let { addFilter: e, patchFilter: t } =
|
|
400
|
+
let { addFilter: e, patchFilter: t } = m(), { layer: n, setOnly: r } = Te(), i = X(null);
|
|
401
401
|
Y(() => {
|
|
402
402
|
n?.type === "photo" && n.src && (i.current = {
|
|
403
403
|
src: n.src,
|
|
@@ -428,13 +428,13 @@ function Fn() {
|
|
|
428
428
|
let e = n.id.slice(4);
|
|
429
429
|
t.push({
|
|
430
430
|
icon: An[e] ?? "square",
|
|
431
|
-
path: `${
|
|
431
|
+
path: `${Nt}${n.id}`,
|
|
432
432
|
label: n.label,
|
|
433
433
|
sub: []
|
|
434
434
|
});
|
|
435
435
|
return;
|
|
436
436
|
}
|
|
437
|
-
let r = `${
|
|
437
|
+
let r = `${Nt}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
438
438
|
a && e.set(r, a);
|
|
439
439
|
let o = t[t.length - 1], s = {
|
|
440
440
|
icon: n.icon,
|
|
@@ -487,59 +487,59 @@ var In = (e, t) => JSON.stringify(e) === JSON.stringify(t), Ln = [
|
|
|
487
487
|
}
|
|
488
488
|
];
|
|
489
489
|
function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
490
|
-
let r = _(), a = He(), { steps: s, curve: c, cycle: l, mode: u, resolution: d, editing:
|
|
491
|
-
blend:
|
|
492
|
-
shape:
|
|
493
|
-
crossfade:
|
|
494
|
-
},
|
|
490
|
+
let r = _(), a = He(), { steps: s, curve: c, cycle: l, mode: u, resolution: d, editing: p, fileId: h, editRequest: v } = a, { updateLayer: y, removeLayer: b, setCurrentPresetId: x, setCurrentPresetName: C, palette: w } = m(), { setOnly: T } = Te(), { buildSavedSpec: E } = zt(), { addItem: D, updateItem: O } = ke(), k = Xt(), A = o(), j = z(e?.id ?? null, { history: "coalesce" }), [M, N] = Z("generate"), F = s[0], I = s.every((e) => e.loopId === F?.loopId), R = s.filter((e) => !ot(K(e.loopId)) || !wt(K(e.loopId))), ee = R.length === 0, B = {
|
|
491
|
+
blend: I ? null : "Blend tweens one generator — these steps are different generators",
|
|
492
|
+
shape: ee ? null : `No outline to morph: ${R.map((e) => Me(e, s.indexOf(e))).join(", ")} (GL)`,
|
|
493
|
+
crossfade: ee ? null : `Cannot fade: ${R.map((e) => Me(e, s.indexOf(e))).join(", ")} (GL)`
|
|
494
|
+
}, V = [
|
|
495
495
|
{
|
|
496
496
|
value: "shape",
|
|
497
497
|
label: "Shape",
|
|
498
|
-
disabled: !!
|
|
499
|
-
tooltip:
|
|
498
|
+
disabled: !!B.shape,
|
|
499
|
+
tooltip: B.shape ?? void 0
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
502
|
value: "blend",
|
|
503
503
|
label: "Blend",
|
|
504
|
-
disabled: !!
|
|
505
|
-
tooltip:
|
|
504
|
+
disabled: !!B.blend,
|
|
505
|
+
tooltip: B.blend ?? void 0
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
value: "crossfade",
|
|
509
509
|
label: "Crossfade",
|
|
510
|
-
disabled: !!
|
|
511
|
-
tooltip:
|
|
510
|
+
disabled: !!B.crossfade,
|
|
511
|
+
tooltip: B.crossfade ?? void 0
|
|
512
512
|
}
|
|
513
513
|
];
|
|
514
514
|
Y(() => {
|
|
515
|
-
if (t || s.length < 2 || !
|
|
515
|
+
if (t || s.length < 2 || !B[u]) return;
|
|
516
516
|
let e = [
|
|
517
517
|
"shape",
|
|
518
518
|
"crossfade",
|
|
519
519
|
"blend"
|
|
520
|
-
].find((e) => !
|
|
520
|
+
].find((e) => !B[e]);
|
|
521
521
|
e && q({ mode: e });
|
|
522
522
|
}, [
|
|
523
523
|
u,
|
|
524
|
+
I,
|
|
524
525
|
ee,
|
|
525
|
-
te,
|
|
526
526
|
s.length,
|
|
527
527
|
t
|
|
528
528
|
]), Y(() => {
|
|
529
529
|
!t && s.length === 0 && e?.type === "loop" && e.loopId && !e.morph && Ve(Se(e));
|
|
530
530
|
}, []);
|
|
531
|
-
let
|
|
532
|
-
let t = s.length <
|
|
533
|
-
if (
|
|
531
|
+
let H = X(s.length), U = () => {
|
|
532
|
+
let t = s.length < H.current;
|
|
533
|
+
if (H.current = s.length, s.length < 2) {
|
|
534
534
|
if (!e || !t) return;
|
|
535
535
|
if (s.length === 0) {
|
|
536
|
-
|
|
536
|
+
b(e.id);
|
|
537
537
|
return;
|
|
538
538
|
}
|
|
539
539
|
let n = {};
|
|
540
540
|
for (let t in e) e[t]?.bind === "track" && (n[t] = e[t].keys?.[0]?.v);
|
|
541
541
|
let r = s[0];
|
|
542
|
-
|
|
542
|
+
y(e.id, {
|
|
543
543
|
...n,
|
|
544
544
|
loopGroup: r.loopGroup,
|
|
545
545
|
presetId: r.presetId,
|
|
@@ -584,43 +584,43 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
584
584
|
morph: r,
|
|
585
585
|
morphT: {
|
|
586
586
|
bind: "track",
|
|
587
|
-
keys:
|
|
587
|
+
keys: ct(s.length, l, c)
|
|
588
588
|
}
|
|
589
589
|
};
|
|
590
|
-
e ?
|
|
591
|
-
},
|
|
592
|
-
|
|
593
|
-
let
|
|
590
|
+
e ? y(e.id, i) : T("loop", i);
|
|
591
|
+
}, W = X(U);
|
|
592
|
+
W.current = U;
|
|
593
|
+
let te = JSON.stringify([
|
|
594
594
|
u,
|
|
595
595
|
s.map((e) => [e.loopId, e.params]),
|
|
596
596
|
c,
|
|
597
597
|
l,
|
|
598
598
|
d,
|
|
599
599
|
a.syncLoop
|
|
600
|
-
]),
|
|
600
|
+
]), G = X(null);
|
|
601
601
|
Y(() => {
|
|
602
|
-
t ||
|
|
602
|
+
t || p != null || te === G.current || s.length >= 2 && B[u] || (G.current = te, W.current());
|
|
603
603
|
}, [
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
te,
|
|
605
|
+
p,
|
|
606
606
|
s.length,
|
|
607
607
|
t
|
|
608
608
|
]), Y(() => {
|
|
609
|
-
if (t ||
|
|
609
|
+
if (t || p == null || !e) return;
|
|
610
610
|
let n = Be(e, K(e.loopId)?.params ?? []);
|
|
611
|
-
In(n, s[
|
|
611
|
+
In(n, s[p]?.params) || Ie(p, n);
|
|
612
612
|
}, [e]), Y(() => {
|
|
613
|
-
t || !
|
|
613
|
+
t || !A || p == null || (q({ editing: null }), G.current = null);
|
|
614
614
|
}, [
|
|
615
|
-
|
|
616
|
-
|
|
615
|
+
A,
|
|
616
|
+
p,
|
|
617
617
|
t
|
|
618
618
|
]), Y(() => () => {
|
|
619
|
-
!t && a.editing != null && (q({ editing: null }),
|
|
619
|
+
!t && a.editing != null && (q({ editing: null }), W.current());
|
|
620
620
|
}, []);
|
|
621
|
-
let
|
|
621
|
+
let ne = (e) => {
|
|
622
622
|
let t = s[e];
|
|
623
|
-
t && (i.pause(), q({ editing: e }),
|
|
623
|
+
t && (i.pause(), q({ editing: e }), T("loop", {
|
|
624
624
|
loopGroup: t.loopGroup,
|
|
625
625
|
presetId: t.presetId,
|
|
626
626
|
presetLabel: t.presetLabel,
|
|
@@ -631,20 +631,20 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
631
631
|
}));
|
|
632
632
|
};
|
|
633
633
|
return Y(() => {
|
|
634
|
-
t ||
|
|
635
|
-
}, [
|
|
634
|
+
t || v == null || (q({ editRequest: null }), ne(v));
|
|
635
|
+
}, [v]), /* @__PURE__ */ $("div", {
|
|
636
636
|
className: "flex flex-col gap-5",
|
|
637
637
|
children: [
|
|
638
|
-
/* @__PURE__ */ Q(
|
|
638
|
+
/* @__PURE__ */ Q(P, {
|
|
639
639
|
layout: "joined",
|
|
640
640
|
tone: "sunken",
|
|
641
641
|
value: u,
|
|
642
642
|
onChange: (e) => !t && q({ mode: e }),
|
|
643
|
-
options:
|
|
643
|
+
options: V,
|
|
644
644
|
size: r,
|
|
645
|
-
className:
|
|
645
|
+
className: f(r)
|
|
646
646
|
}),
|
|
647
|
-
!t && /* @__PURE__ */ Q(
|
|
647
|
+
!t && /* @__PURE__ */ Q(S, {
|
|
648
648
|
divided: !0,
|
|
649
649
|
children: /* @__PURE__ */ Q(pe, {
|
|
650
650
|
tree: Tn(),
|
|
@@ -654,7 +654,7 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
654
654
|
onPick: On
|
|
655
655
|
})
|
|
656
656
|
}),
|
|
657
|
-
/* @__PURE__ */ $(
|
|
657
|
+
/* @__PURE__ */ $(S, {
|
|
658
658
|
divided: !0,
|
|
659
659
|
children: [
|
|
660
660
|
/* @__PURE__ */ Q(Kt, {
|
|
@@ -662,11 +662,11 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
662
662
|
id: t,
|
|
663
663
|
label: Me(e, t)
|
|
664
664
|
})),
|
|
665
|
-
activeIndex:
|
|
665
|
+
activeIndex: p,
|
|
666
666
|
reorder: "grab",
|
|
667
667
|
readOnly: t,
|
|
668
668
|
size: r,
|
|
669
|
-
onSelect:
|
|
669
|
+
onSelect: ne,
|
|
670
670
|
onRemove: Fe,
|
|
671
671
|
onMove: je,
|
|
672
672
|
onAdd: () => q({
|
|
@@ -679,32 +679,32 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
679
679
|
className: "kol-mono-12 text-meta",
|
|
680
680
|
children: "Two steps or more and the stage plays the morph."
|
|
681
681
|
}),
|
|
682
|
-
s.length >= 2 &&
|
|
682
|
+
s.length >= 2 && B[u] && /* @__PURE__ */ Q("p", {
|
|
683
683
|
className: "kol-mono-12 text-meta",
|
|
684
|
-
children:
|
|
684
|
+
children: B[u]
|
|
685
685
|
})
|
|
686
686
|
]
|
|
687
687
|
}),
|
|
688
|
-
|
|
689
|
-
label: `Step ${
|
|
688
|
+
p != null && !t && e && n && /* @__PURE__ */ $(S, {
|
|
689
|
+
label: `Step ${p + 1}`,
|
|
690
690
|
divided: !0,
|
|
691
691
|
children: [
|
|
692
|
-
/* @__PURE__ */ Q(
|
|
692
|
+
/* @__PURE__ */ Q(P, {
|
|
693
693
|
layout: "joined",
|
|
694
694
|
tone: "sunken",
|
|
695
|
-
value:
|
|
696
|
-
onChange:
|
|
695
|
+
value: M,
|
|
696
|
+
onChange: N,
|
|
697
697
|
options: n,
|
|
698
698
|
size: r,
|
|
699
|
-
className:
|
|
699
|
+
className: f(r)
|
|
700
700
|
}),
|
|
701
701
|
/* @__PURE__ */ Q(De, {
|
|
702
702
|
layer: e,
|
|
703
|
-
setProp:
|
|
704
|
-
patch:
|
|
705
|
-
updateLayer:
|
|
706
|
-
palette:
|
|
707
|
-
tab:
|
|
703
|
+
setProp: j.setProp,
|
|
704
|
+
patch: j.patch,
|
|
705
|
+
updateLayer: y,
|
|
706
|
+
palette: w,
|
|
707
|
+
tab: M,
|
|
708
708
|
tabStrip: null,
|
|
709
709
|
inline: !0,
|
|
710
710
|
picker: !1
|
|
@@ -713,13 +713,13 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
713
713
|
className: "kol-mono-12 text-emphasis",
|
|
714
714
|
children: [
|
|
715
715
|
"Editing step ",
|
|
716
|
-
|
|
716
|
+
p + 1,
|
|
717
717
|
" — press Play to run the morph."
|
|
718
718
|
]
|
|
719
719
|
})
|
|
720
720
|
]
|
|
721
721
|
}),
|
|
722
|
-
/* @__PURE__ */ Q(
|
|
722
|
+
/* @__PURE__ */ Q(L, {
|
|
723
723
|
schema: Ln,
|
|
724
724
|
layer: a,
|
|
725
725
|
setProp: (e, n) => {
|
|
@@ -727,19 +727,19 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
727
727
|
},
|
|
728
728
|
inline: !0
|
|
729
729
|
}),
|
|
730
|
-
!t && s.length >= 2 && /* @__PURE__ */ Q(
|
|
730
|
+
!t && s.length >= 2 && /* @__PURE__ */ Q(S, {
|
|
731
731
|
divided: !0,
|
|
732
|
-
children: /* @__PURE__ */ Q(
|
|
732
|
+
children: /* @__PURE__ */ Q(g, {
|
|
733
733
|
tone: "primary",
|
|
734
734
|
size: r,
|
|
735
735
|
className: "w-full",
|
|
736
736
|
onClick: async () => {
|
|
737
737
|
if (s.length < 2) return;
|
|
738
738
|
let e = a.fileName;
|
|
739
|
-
if (!
|
|
740
|
-
|
|
739
|
+
if (!h && (e = await k.prompt("Name this morph:", ""), e === null)) return;
|
|
740
|
+
p != null && (q({ editing: null }), W.current());
|
|
741
741
|
let t = {
|
|
742
|
-
...await
|
|
742
|
+
...await E(e || null),
|
|
743
743
|
mode: "morph",
|
|
744
744
|
morph: {
|
|
745
745
|
mode: u,
|
|
@@ -752,17 +752,17 @@ function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
752
752
|
seconds: i.getLoopSeconds()
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
|
-
if (
|
|
756
|
-
|
|
755
|
+
if (h) {
|
|
756
|
+
O("preset", h, t);
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
|
-
let n =
|
|
759
|
+
let n = D("preset", t);
|
|
760
760
|
n && (q({
|
|
761
761
|
fileId: n,
|
|
762
762
|
fileName: e || null
|
|
763
|
-
}),
|
|
763
|
+
}), x(n), C(e || null));
|
|
764
764
|
},
|
|
765
|
-
children:
|
|
765
|
+
children: h ? "Save" : "Save…"
|
|
766
766
|
})
|
|
767
767
|
})
|
|
768
768
|
]
|
|
@@ -803,12 +803,12 @@ function Hn({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
803
803
|
let a = t[e.key];
|
|
804
804
|
if (r === "off") {
|
|
805
805
|
let r = a?.transform?.range;
|
|
806
|
-
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 :
|
|
806
|
+
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : A(a, i.getCtx(), t) ?? e.default ?? e.min);
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
809
|
let o = zn.find((e) => e.value === r);
|
|
810
810
|
if (!o) return;
|
|
811
|
-
let s = Number(
|
|
811
|
+
let s = Number(A(a, i.getCtx(), t) ?? e.default ?? e.min), c = (e.max - e.min) * Bn, l = Math.max(e.min, s - c), u = Math.min(e.max, s + c);
|
|
812
812
|
n(e.key, {
|
|
813
813
|
bind: "mod",
|
|
814
814
|
source: o.source,
|
|
@@ -818,7 +818,7 @@ function Hn({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
820
|
};
|
|
821
|
-
return /* @__PURE__ */ Q(
|
|
821
|
+
return /* @__PURE__ */ Q(S, {
|
|
822
822
|
label: r,
|
|
823
823
|
divided: !0,
|
|
824
824
|
children: o.map((e) => {
|
|
@@ -836,11 +836,11 @@ function Hn({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
836
836
|
label: "Custom"
|
|
837
837
|
}] : []
|
|
838
838
|
];
|
|
839
|
-
return /* @__PURE__ */ Q(
|
|
839
|
+
return /* @__PURE__ */ Q(b, {
|
|
840
840
|
label: e.label,
|
|
841
841
|
align: "fill",
|
|
842
842
|
labelWidth: d,
|
|
843
|
-
children: /* @__PURE__ */ Q(
|
|
843
|
+
children: /* @__PURE__ */ Q(h, {
|
|
844
844
|
size: a,
|
|
845
845
|
variant: "subtle",
|
|
846
846
|
className: "w-full",
|
|
@@ -883,13 +883,13 @@ var Un = [
|
|
|
883
883
|
function Gn({ schema: e, layer: t, setProp: n, inputs: a = null }) {
|
|
884
884
|
let o = _(), s = D(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
885
885
|
if (!s.length) return null;
|
|
886
|
-
let c = new Map(s.map((e) => [e.key, e])), l = (a ?? []).filter((e) => c.has(e)), d = [...l, ...s.map((e) => e.key).filter((e) => !l.includes(e))],
|
|
886
|
+
let c = new Map(s.map((e) => [e.key, e])), l = (a ?? []).filter((e) => c.has(e)), d = [...l, ...s.map((e) => e.key).filter((e) => !l.includes(e))], f = l.length ? l : d.slice(0, 3), p = (e) => {
|
|
887
887
|
let n = t[e];
|
|
888
888
|
return u(n) && n.bind === "mod" && Wn.has(n.source);
|
|
889
|
-
},
|
|
889
|
+
}, m = d.filter(p), h = (e) => {
|
|
890
890
|
let n = c.get(e);
|
|
891
|
-
return Number(
|
|
892
|
-
}, v = (e, i, a = u(t[e]) ? t[e].transform?.base ??
|
|
891
|
+
return Number(A(t[e], i.getCtx(), t) ?? n.default ?? n.min);
|
|
892
|
+
}, v = (e, i, a = u(t[e]) ? t[e].transform?.base ?? h(e) : h(e)) => {
|
|
893
893
|
let o = c.get(e);
|
|
894
894
|
r(i)?.ensure?.().catch(() => {}), n(e, {
|
|
895
895
|
bind: "mod",
|
|
@@ -900,11 +900,11 @@ function Gn({ schema: e, layer: t, setProp: n, inputs: a = null }) {
|
|
|
900
900
|
...i.startsWith("lfo") ? { rate: 1 } : {}
|
|
901
901
|
}
|
|
902
902
|
});
|
|
903
|
-
}, y = (e) => n(e, u(t[e]) ? t[e].transform?.base ??
|
|
904
|
-
return /* @__PURE__ */ $(
|
|
903
|
+
}, y = (e) => n(e, u(t[e]) ? t[e].transform?.base ?? h(e) : h(e)), b = f.find((e) => !p(e)) ?? d.find((e) => !p(e));
|
|
904
|
+
return /* @__PURE__ */ $(S, {
|
|
905
905
|
label: "Inputs",
|
|
906
906
|
divided: !0,
|
|
907
|
-
children: [
|
|
907
|
+
children: [m.map((e) => /* @__PURE__ */ Q(Gt, {
|
|
908
908
|
size: o,
|
|
909
909
|
className: "w-full [&>button]:w-full",
|
|
910
910
|
groups: [{
|
|
@@ -916,7 +916,7 @@ function Gn({ schema: e, layer: t, setProp: n, inputs: a = null }) {
|
|
|
916
916
|
label: "Drives",
|
|
917
917
|
options: d.map((e) => ({
|
|
918
918
|
value: e,
|
|
919
|
-
label: c.get(e).label + (
|
|
919
|
+
label: c.get(e).label + (f.includes(e) ? " ★" : "")
|
|
920
920
|
}))
|
|
921
921
|
}],
|
|
922
922
|
value: {
|
|
@@ -929,15 +929,15 @@ function Gn({ schema: e, layer: t, setProp: n, inputs: a = null }) {
|
|
|
929
929
|
r === "off" ? y(e) : v(e, r);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
if (r === e ||
|
|
932
|
+
if (r === e || p(r)) return;
|
|
933
933
|
let i = t[e].source;
|
|
934
934
|
y(e), v(r, i);
|
|
935
935
|
}
|
|
936
|
-
}, e)),
|
|
936
|
+
}, e)), b && /* @__PURE__ */ Q(g, {
|
|
937
937
|
size: o,
|
|
938
938
|
iconLeft: "plus",
|
|
939
939
|
className: "w-full",
|
|
940
|
-
onClick: () => v(
|
|
940
|
+
onClick: () => v(b, "mouseX"),
|
|
941
941
|
children: "Add input"
|
|
942
942
|
})]
|
|
943
943
|
});
|
|
@@ -949,7 +949,7 @@ function Xn({ layer: e, setProp: t }) {
|
|
|
949
949
|
let n = _(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
950
950
|
t("meshSrc", e), t("meshType", n);
|
|
951
951
|
};
|
|
952
|
-
return /* @__PURE__ */ $(
|
|
952
|
+
return /* @__PURE__ */ $(S, {
|
|
953
953
|
label: "Model",
|
|
954
954
|
divided: !0,
|
|
955
955
|
children: [
|
|
@@ -959,12 +959,12 @@ function Xn({ layer: e, setProp: t }) {
|
|
|
959
959
|
}),
|
|
960
960
|
/* @__PURE__ */ $("div", {
|
|
961
961
|
className: "grid grid-cols-2 gap-2",
|
|
962
|
-
children: [/* @__PURE__ */ Q(
|
|
962
|
+
children: [/* @__PURE__ */ Q(g, {
|
|
963
963
|
tone: "primary",
|
|
964
964
|
size: n,
|
|
965
965
|
onClick: () => i(!0),
|
|
966
966
|
children: "From library"
|
|
967
|
-
}), /* @__PURE__ */ Q(
|
|
967
|
+
}), /* @__PURE__ */ Q(g, {
|
|
968
968
|
tone: "primary",
|
|
969
969
|
size: n,
|
|
970
970
|
onClick: () => a.current?.click(),
|
|
@@ -983,7 +983,7 @@ function Xn({ layer: e, setProp: t }) {
|
|
|
983
983
|
n.onload = () => o(n.result, Jn(t.name)), n.readAsDataURL(t);
|
|
984
984
|
}
|
|
985
985
|
}),
|
|
986
|
-
/* @__PURE__ */ Q(
|
|
986
|
+
/* @__PURE__ */ Q(Rt, {
|
|
987
987
|
open: r,
|
|
988
988
|
accept: qn,
|
|
989
989
|
onClose: () => i(!1),
|
|
@@ -999,7 +999,7 @@ function Xn({ layer: e, setProp: t }) {
|
|
|
999
999
|
function Zn(e, t) {
|
|
1000
1000
|
Y(() => {
|
|
1001
1001
|
let n = (n) => {
|
|
1002
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
1002
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || ft(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
1003
1003
|
};
|
|
1004
1004
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
1005
1005
|
});
|
|
@@ -1050,7 +1050,7 @@ function tr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
|
|
|
1050
1050
|
onClick: () => n(e.value),
|
|
1051
1051
|
children: e.label
|
|
1052
1052
|
}, e.value))
|
|
1053
|
-
}) : /* @__PURE__ */ Q(
|
|
1053
|
+
}) : /* @__PURE__ */ Q(P, {
|
|
1054
1054
|
layout: "joined",
|
|
1055
1055
|
tone: "sunken",
|
|
1056
1056
|
value: t ?? null,
|
|
@@ -1058,11 +1058,11 @@ function tr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
|
|
|
1058
1058
|
options: e,
|
|
1059
1059
|
size: a,
|
|
1060
1060
|
ariaLabel: "Siblings",
|
|
1061
|
-
className:
|
|
1061
|
+
className: f(a)
|
|
1062
1062
|
}) : null;
|
|
1063
1063
|
}
|
|
1064
1064
|
function nr() {
|
|
1065
|
-
let { undo: e, redo: t, canUndo: n, canRedo: r } =
|
|
1065
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = m(), i = _(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1066
1066
|
"aria-hidden": "true",
|
|
1067
1067
|
className: "invisible pointer-events-none",
|
|
1068
1068
|
children: t
|
|
@@ -1070,7 +1070,7 @@ function nr() {
|
|
|
1070
1070
|
return /* @__PURE__ */ $(nn, { children: [a(n, /* @__PURE__ */ Q(Jt, {
|
|
1071
1071
|
label: "Undo",
|
|
1072
1072
|
shortcut: "⌘Z",
|
|
1073
|
-
children: /* @__PURE__ */ Q(
|
|
1073
|
+
children: /* @__PURE__ */ Q(g, {
|
|
1074
1074
|
size: i,
|
|
1075
1075
|
iconOnly: "arrow-left",
|
|
1076
1076
|
"aria-label": "Undo",
|
|
@@ -1080,7 +1080,7 @@ function nr() {
|
|
|
1080
1080
|
})), a(r, /* @__PURE__ */ Q(Jt, {
|
|
1081
1081
|
label: "Redo",
|
|
1082
1082
|
shortcut: "⇧⌘Z",
|
|
1083
|
-
children: /* @__PURE__ */ Q(
|
|
1083
|
+
children: /* @__PURE__ */ Q(g, {
|
|
1084
1084
|
size: i,
|
|
1085
1085
|
iconOnly: "arrow-right",
|
|
1086
1086
|
"aria-label": "Redo",
|
|
@@ -1130,21 +1130,21 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1130
1130
|
let e = () => o("effect");
|
|
1131
1131
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
1132
1132
|
}, []);
|
|
1133
|
-
let { addFilter: l, replaceFilter: u, removeFilter:
|
|
1133
|
+
let { addFilter: l, replaceFilter: u, removeFilter: p, toggleFilter: v, updateLayer: y, palette: w } = m(), T = z(e.id, { history: "coalesce" }), E = x(e), D = E.findIndex((e) => !e.def?.first), k = D < 0 ? E.length : D, A = D < 0 ? null : E[D], M = se(G).find((e) => e.id === oe(A?.id)), F = M?.id === "halftone", I = F ? (M?.filters ?? []).map((e) => ({
|
|
1134
1134
|
value: e.id,
|
|
1135
1135
|
label: e.label
|
|
1136
|
-
})) : null,
|
|
1136
|
+
})) : null, ee = !F && A ? A.def.label : null, B = (t) => {
|
|
1137
1137
|
if (!A) {
|
|
1138
1138
|
l(e.id, t);
|
|
1139
1139
|
return;
|
|
1140
1140
|
}
|
|
1141
|
-
t !== A.id && u(e.id,
|
|
1142
|
-
},
|
|
1141
|
+
t !== A.id && u(e.id, k, t);
|
|
1142
|
+
}, V = E.map(({ def: e, ...t }) => t), H = A ? {
|
|
1143
1143
|
...e,
|
|
1144
1144
|
...A.params,
|
|
1145
1145
|
id: e.id
|
|
1146
|
-
} : e,
|
|
1147
|
-
let r =
|
|
1146
|
+
} : e, U = (e) => (t, n) => {
|
|
1147
|
+
let r = V.map((r, i) => i === e ? {
|
|
1148
1148
|
...r,
|
|
1149
1149
|
params: {
|
|
1150
1150
|
...r.params,
|
|
@@ -1152,12 +1152,12 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
} : r);
|
|
1154
1154
|
T.patch({ filters: r });
|
|
1155
|
-
},
|
|
1156
|
-
layer:
|
|
1155
|
+
}, W = U(k), ne = n ? (e) => /* @__PURE__ */ Q(Ge, {
|
|
1156
|
+
layer: H,
|
|
1157
1157
|
param: e,
|
|
1158
|
-
setProp:
|
|
1159
|
-
}) : void 0,
|
|
1160
|
-
let n =
|
|
1158
|
+
setProp: W
|
|
1159
|
+
}) : void 0, re = (t) => {
|
|
1160
|
+
let n = V.map((e, n) => n === k ? {
|
|
1161
1161
|
...e,
|
|
1162
1162
|
params: {
|
|
1163
1163
|
...e.params,
|
|
@@ -1167,48 +1167,48 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1167
1167
|
y(e.id, { filters: n });
|
|
1168
1168
|
};
|
|
1169
1169
|
Zn(() => {
|
|
1170
|
-
A && y(e.id, { filters:
|
|
1170
|
+
A && y(e.id, { filters: V.map((e, t) => t === 0 ? {
|
|
1171
1171
|
...e,
|
|
1172
1172
|
params: {}
|
|
1173
1173
|
} : e) });
|
|
1174
1174
|
}, () => {
|
|
1175
|
-
A &&
|
|
1175
|
+
A && re(C(H, j(A.def.params, H), N()));
|
|
1176
1176
|
});
|
|
1177
|
-
let
|
|
1178
|
-
if (
|
|
1177
|
+
let ae = e.fxGroup ? ce.find((t) => t.id === e.fxGroup) : null;
|
|
1178
|
+
if (ae) {
|
|
1179
1179
|
let t = {
|
|
1180
1180
|
chain: E,
|
|
1181
1181
|
layer: e,
|
|
1182
|
-
hostView:
|
|
1182
|
+
hostView: H,
|
|
1183
1183
|
toggleFilter: v,
|
|
1184
|
-
removeFilter:
|
|
1185
|
-
setStagePropAt:
|
|
1184
|
+
removeFilter: p,
|
|
1185
|
+
setStagePropAt: U,
|
|
1186
1186
|
palette: w,
|
|
1187
1187
|
showMod: n
|
|
1188
1188
|
}, r = [{
|
|
1189
1189
|
value: "",
|
|
1190
1190
|
label: "Add effect…"
|
|
1191
|
-
}, ...
|
|
1191
|
+
}, ...te(ae, G).map((e) => ({
|
|
1192
1192
|
value: e.id,
|
|
1193
1193
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1194
1194
|
}))];
|
|
1195
1195
|
return /* @__PURE__ */ $(rr, {
|
|
1196
1196
|
title: "Effects",
|
|
1197
1197
|
fx: !0,
|
|
1198
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1198
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1199
1199
|
layout: "joined",
|
|
1200
1200
|
tone: "sunken",
|
|
1201
1201
|
value: a,
|
|
1202
1202
|
onChange: o,
|
|
1203
1203
|
options: Qn,
|
|
1204
1204
|
size: i,
|
|
1205
|
-
className:
|
|
1205
|
+
className: f(i)
|
|
1206
1206
|
}),
|
|
1207
1207
|
children: [a === "effect" && /* @__PURE__ */ $(nn, { children: [
|
|
1208
|
-
/* @__PURE__ */ $(
|
|
1208
|
+
/* @__PURE__ */ $(S, {
|
|
1209
1209
|
label: "Effect stack",
|
|
1210
1210
|
divided: !0,
|
|
1211
|
-
children: [E.length === 0 && /* @__PURE__ */ Q(
|
|
1211
|
+
children: [E.length === 0 && /* @__PURE__ */ Q(R, {
|
|
1212
1212
|
className: "kol-mono-10 text-meta",
|
|
1213
1213
|
children: "No effects yet — add one below."
|
|
1214
1214
|
}), /* @__PURE__ */ Q(cr, {
|
|
@@ -1217,10 +1217,10 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1217
1217
|
})]
|
|
1218
1218
|
}),
|
|
1219
1219
|
/* @__PURE__ */ Q(Wt, {}),
|
|
1220
|
-
E.length < 8 && /* @__PURE__ */ Q(
|
|
1221
|
-
label:
|
|
1220
|
+
E.length < 8 && /* @__PURE__ */ Q(S, {
|
|
1221
|
+
label: ae.label,
|
|
1222
1222
|
divided: !0,
|
|
1223
|
-
children: /* @__PURE__ */ Q(
|
|
1223
|
+
children: /* @__PURE__ */ Q(h, {
|
|
1224
1224
|
variant: "subtle",
|
|
1225
1225
|
size: i,
|
|
1226
1226
|
className: "w-full",
|
|
@@ -1233,28 +1233,28 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1233
1233
|
})
|
|
1234
1234
|
] }), a === "anim" && A?.def?.sweeps && /* @__PURE__ */ Q(qe, {
|
|
1235
1235
|
sweeps: Array.isArray(A.params.sweeps) ? A.params.sweeps : [],
|
|
1236
|
-
onChange: (e) =>
|
|
1236
|
+
onChange: (e) => W("sweeps", e),
|
|
1237
1237
|
inline: !0
|
|
1238
1238
|
})]
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
1241
|
if (!A) return /* @__PURE__ */ Q(rr, {
|
|
1242
|
-
chips:
|
|
1242
|
+
chips: I,
|
|
1243
1243
|
active: null,
|
|
1244
|
-
onPick:
|
|
1245
|
-
spread:
|
|
1244
|
+
onPick: B,
|
|
1245
|
+
spread: F,
|
|
1246
1246
|
fx: !0,
|
|
1247
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1247
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1248
1248
|
layout: "joined",
|
|
1249
1249
|
tone: "sunken",
|
|
1250
1250
|
value: a,
|
|
1251
1251
|
onChange: o,
|
|
1252
1252
|
options: Qn,
|
|
1253
1253
|
size: i,
|
|
1254
|
-
className:
|
|
1254
|
+
className: f(i)
|
|
1255
1255
|
}),
|
|
1256
|
-
children: /* @__PURE__ */ Q(
|
|
1257
|
-
schema:
|
|
1256
|
+
children: /* @__PURE__ */ Q(L, {
|
|
1257
|
+
schema: bt,
|
|
1258
1258
|
layer: e,
|
|
1259
1259
|
setProp: T.setProp,
|
|
1260
1260
|
palette: w,
|
|
@@ -1267,85 +1267,85 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1267
1267
|
emptyHint: "Pick an effect from the nav."
|
|
1268
1268
|
})
|
|
1269
1269
|
});
|
|
1270
|
-
let
|
|
1270
|
+
let ue = A.def.params.filter((e) => c(e) !== "anim"), de = ie(A.def.id), K = de ? ue.findIndex((e) => e.key === de) : -1, fe = ue.length;
|
|
1271
1271
|
if (K >= 0) {
|
|
1272
1272
|
let e = K;
|
|
1273
|
-
for (; e + 1 <
|
|
1273
|
+
for (; e + 1 < ue.length && ue[e + 1].type === "select";) e++;
|
|
1274
1274
|
fe = e + 1;
|
|
1275
1275
|
}
|
|
1276
|
-
let pe = K > 0 ?
|
|
1276
|
+
let pe = K > 0 ? ue.slice(0, K) : [], me = K >= 0 ? ue.slice(K, fe).map((e) => ({
|
|
1277
1277
|
...e,
|
|
1278
1278
|
section: void 0
|
|
1279
|
-
})) :
|
|
1280
|
-
layer:
|
|
1281
|
-
setProp:
|
|
1279
|
+
})) : ue, ye = {
|
|
1280
|
+
layer: H,
|
|
1281
|
+
setProp: W,
|
|
1282
1282
|
palette: w,
|
|
1283
|
-
renderAnimate:
|
|
1283
|
+
renderAnimate: ne,
|
|
1284
1284
|
inline: !0
|
|
1285
1285
|
};
|
|
1286
1286
|
return /* @__PURE__ */ $(rr, {
|
|
1287
|
-
chips:
|
|
1287
|
+
chips: I,
|
|
1288
1288
|
active: A.id,
|
|
1289
|
-
onPick:
|
|
1290
|
-
spread:
|
|
1291
|
-
title:
|
|
1289
|
+
onPick: B,
|
|
1290
|
+
spread: F,
|
|
1291
|
+
title: ee,
|
|
1292
1292
|
fx: !0,
|
|
1293
1293
|
scope: A.id,
|
|
1294
1294
|
ghostLabels: A.def.params.map((e) => e.label).filter(Boolean),
|
|
1295
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1295
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1296
1296
|
layout: "joined",
|
|
1297
1297
|
tone: "sunken",
|
|
1298
1298
|
value: a,
|
|
1299
1299
|
onChange: o,
|
|
1300
1300
|
options: Qn,
|
|
1301
1301
|
size: i,
|
|
1302
|
-
className:
|
|
1302
|
+
className: f(i)
|
|
1303
1303
|
}),
|
|
1304
1304
|
children: [a === "effect" && /* @__PURE__ */ $(nn, { children: [
|
|
1305
|
-
pe.length > 0 && /* @__PURE__ */ Q(
|
|
1305
|
+
pe.length > 0 && /* @__PURE__ */ Q(L, {
|
|
1306
1306
|
schema: pe,
|
|
1307
1307
|
...ye
|
|
1308
1308
|
}),
|
|
1309
|
-
/* @__PURE__ */ $(
|
|
1309
|
+
/* @__PURE__ */ $(S, {
|
|
1310
1310
|
divided: !0,
|
|
1311
|
-
children: [/* @__PURE__ */ Q(
|
|
1311
|
+
children: [/* @__PURE__ */ Q(L, {
|
|
1312
1312
|
schema: me,
|
|
1313
1313
|
...ye
|
|
1314
1314
|
}), /* @__PURE__ */ Q(Ke, {
|
|
1315
1315
|
inline: !0,
|
|
1316
1316
|
def: A.def,
|
|
1317
|
-
view:
|
|
1317
|
+
view: H,
|
|
1318
1318
|
tab: "effect",
|
|
1319
|
-
onPatch:
|
|
1319
|
+
onPatch: re,
|
|
1320
1320
|
levels: /* @__PURE__ */ $(nn, { children: [
|
|
1321
1321
|
[
|
|
1322
1322
|
["type", "Type"],
|
|
1323
1323
|
["category", "Category"],
|
|
1324
1324
|
["preset", "Preset"]
|
|
1325
|
-
].filter(([e]) => _e(A.def, e)).map(([t, n]) => /* @__PURE__ */ Q(
|
|
1325
|
+
].filter(([e]) => _e(A.def, e)).map(([t, n]) => /* @__PURE__ */ Q(g, {
|
|
1326
1326
|
tone: "primary",
|
|
1327
1327
|
size: i,
|
|
1328
1328
|
className: "flex-1 min-w-0",
|
|
1329
1329
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
1330
1330
|
onClick: () => {
|
|
1331
|
-
let n =
|
|
1331
|
+
let n = O(N() >>> 0);
|
|
1332
1332
|
if (t === "preset") {
|
|
1333
|
-
let e = ge(A.def,
|
|
1334
|
-
e != null &&
|
|
1333
|
+
let e = ge(A.def, H, n);
|
|
1334
|
+
e != null && re(le(A.def, e));
|
|
1335
1335
|
return;
|
|
1336
1336
|
}
|
|
1337
1337
|
let r = he(A.id, t, n);
|
|
1338
|
-
r && u(e.id,
|
|
1338
|
+
r && u(e.id, k, r);
|
|
1339
1339
|
},
|
|
1340
1340
|
children: n
|
|
1341
1341
|
}, t)),
|
|
1342
|
-
/* @__PURE__ */ Q(
|
|
1342
|
+
/* @__PURE__ */ Q(g, {
|
|
1343
1343
|
tone: "primary",
|
|
1344
1344
|
size: i,
|
|
1345
1345
|
className: "flex-1 min-w-0",
|
|
1346
1346
|
"aria-label": "Randomize settings",
|
|
1347
1347
|
onClick: () => {
|
|
1348
|
-
|
|
1348
|
+
re(ve(H, j(A.def.params.filter((e) => c(e) !== "anim"), H), O(N() >>> 0)));
|
|
1349
1349
|
},
|
|
1350
1350
|
children: "Settings"
|
|
1351
1351
|
}),
|
|
@@ -1357,47 +1357,47 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1357
1357
|
})]
|
|
1358
1358
|
}),
|
|
1359
1359
|
/* @__PURE__ */ Q(Wt, {}),
|
|
1360
|
-
fe <
|
|
1361
|
-
schema:
|
|
1360
|
+
fe < ue.length && /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q(L, {
|
|
1361
|
+
schema: ue.slice(fe),
|
|
1362
1362
|
...ye
|
|
1363
1363
|
}), /* @__PURE__ */ Q(Wt, {})] }),
|
|
1364
1364
|
/* @__PURE__ */ Q(lr, {
|
|
1365
1365
|
chain: E,
|
|
1366
|
-
from:
|
|
1366
|
+
from: k + 1,
|
|
1367
1367
|
layer: e,
|
|
1368
|
-
hostView:
|
|
1368
|
+
hostView: H,
|
|
1369
1369
|
addFilter: l,
|
|
1370
|
-
removeFilter:
|
|
1370
|
+
removeFilter: p,
|
|
1371
1371
|
toggleFilter: v,
|
|
1372
|
-
setStagePropAt:
|
|
1372
|
+
setStagePropAt: U,
|
|
1373
1373
|
palette: w,
|
|
1374
1374
|
showMod: n
|
|
1375
1375
|
})
|
|
1376
1376
|
] }), a === "anim" && /* @__PURE__ */ $(nn, { children: [
|
|
1377
1377
|
/* @__PURE__ */ Q(Gn, {
|
|
1378
1378
|
schema: A.def.params,
|
|
1379
|
-
layer:
|
|
1380
|
-
setProp:
|
|
1379
|
+
layer: H,
|
|
1380
|
+
setProp: W,
|
|
1381
1381
|
inputs: A.def.inputs
|
|
1382
1382
|
}),
|
|
1383
|
-
/* @__PURE__ */ Q(
|
|
1383
|
+
/* @__PURE__ */ Q(L, {
|
|
1384
1384
|
schema: A.def.params,
|
|
1385
1385
|
...ye,
|
|
1386
1386
|
tab: "anim"
|
|
1387
1387
|
}),
|
|
1388
|
-
A.def.orbit && /* @__PURE__ */ Q(
|
|
1388
|
+
A.def.orbit && /* @__PURE__ */ Q(S, {
|
|
1389
1389
|
label: "Interaction",
|
|
1390
1390
|
divided: !0,
|
|
1391
|
-
children: /* @__PURE__ */ Q(
|
|
1391
|
+
children: /* @__PURE__ */ Q(b, {
|
|
1392
1392
|
label: "ORBIT (C)",
|
|
1393
1393
|
align: "fill",
|
|
1394
1394
|
labelWidth: d,
|
|
1395
|
-
children: /* @__PURE__ */ Q(
|
|
1395
|
+
children: /* @__PURE__ */ Q(P, {
|
|
1396
1396
|
layout: "joined",
|
|
1397
1397
|
tone: "sunken",
|
|
1398
1398
|
size: i,
|
|
1399
1399
|
className: "w-full",
|
|
1400
|
-
value: r.grab &&
|
|
1400
|
+
value: r.grab && H.orbit !== !1 ? "on" : "off",
|
|
1401
1401
|
options: [{
|
|
1402
1402
|
value: "off",
|
|
1403
1403
|
label: "Off"
|
|
@@ -1406,47 +1406,47 @@ function ir({ layer: e, showMod: n }) {
|
|
|
1406
1406
|
label: "On"
|
|
1407
1407
|
}],
|
|
1408
1408
|
onChange: (e) => {
|
|
1409
|
-
|
|
1409
|
+
W("orbit", e === "on"), e === "on" && !r.grab && s("grab", !0);
|
|
1410
1410
|
}
|
|
1411
1411
|
})
|
|
1412
1412
|
})
|
|
1413
1413
|
}),
|
|
1414
|
-
/* @__PURE__ */ Q(
|
|
1414
|
+
/* @__PURE__ */ Q(S, {
|
|
1415
1415
|
divided: !0,
|
|
1416
1416
|
children: /* @__PURE__ */ Q(Ke, {
|
|
1417
1417
|
inline: !0,
|
|
1418
1418
|
def: A.def,
|
|
1419
|
-
view:
|
|
1419
|
+
view: H,
|
|
1420
1420
|
tab: "anim",
|
|
1421
|
-
onPatch:
|
|
1421
|
+
onPatch: re
|
|
1422
1422
|
})
|
|
1423
1423
|
}),
|
|
1424
1424
|
A.def.sweeps && /* @__PURE__ */ Q(qe, {
|
|
1425
1425
|
sweeps: Array.isArray(A.params.sweeps) ? A.params.sweeps : [],
|
|
1426
|
-
onChange: (e) =>
|
|
1426
|
+
onChange: (e) => W("sweeps", e),
|
|
1427
1427
|
inline: !0
|
|
1428
1428
|
}),
|
|
1429
1429
|
/* @__PURE__ */ Q(Hn, {
|
|
1430
1430
|
schema: A.def.params,
|
|
1431
|
-
layer:
|
|
1432
|
-
setProp:
|
|
1431
|
+
layer: H,
|
|
1432
|
+
setProp: W
|
|
1433
1433
|
}),
|
|
1434
1434
|
/* @__PURE__ */ Q(sr, {
|
|
1435
1435
|
chain: E,
|
|
1436
1436
|
layer: e,
|
|
1437
|
-
hostView:
|
|
1437
|
+
hostView: H,
|
|
1438
1438
|
addFilter: l,
|
|
1439
|
-
removeFilter:
|
|
1440
|
-
setStagePropAt:
|
|
1439
|
+
removeFilter: p,
|
|
1440
|
+
setStagePropAt: U,
|
|
1441
1441
|
palette: w,
|
|
1442
1442
|
showMod: n
|
|
1443
1443
|
})
|
|
1444
1444
|
] })]
|
|
1445
1445
|
});
|
|
1446
1446
|
}
|
|
1447
|
-
var ar =
|
|
1447
|
+
var ar = G.filter((e) => !e.kind && !e.first);
|
|
1448
1448
|
function or({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1449
|
-
let { addFilter: i, removeFilter: a, toggleFilter: o } =
|
|
1449
|
+
let { addFilter: i, removeFilter: a, toggleFilter: o } = m(), s = x(e), c = s.map(({ def: e, ...t }) => t);
|
|
1450
1450
|
return /* @__PURE__ */ Q(lr, {
|
|
1451
1451
|
chain: s,
|
|
1452
1452
|
from: 0,
|
|
@@ -1472,22 +1472,22 @@ function sr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1472
1472
|
...n,
|
|
1473
1473
|
...u.params,
|
|
1474
1474
|
id: t.id
|
|
1475
|
-
} : null,
|
|
1476
|
-
return /* @__PURE__ */ Q(
|
|
1475
|
+
} : null, f = u ? a(l) : null;
|
|
1476
|
+
return /* @__PURE__ */ Q(S, {
|
|
1477
1477
|
label: "Media",
|
|
1478
1478
|
divided: !0,
|
|
1479
|
-
children: u?.def ? /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q(
|
|
1479
|
+
children: u?.def ? /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q(L, {
|
|
1480
1480
|
schema: u.def.params,
|
|
1481
1481
|
layer: d,
|
|
1482
|
-
setProp:
|
|
1482
|
+
setProp: f,
|
|
1483
1483
|
palette: o,
|
|
1484
1484
|
inline: !0,
|
|
1485
1485
|
renderAnimate: s ? (e) => /* @__PURE__ */ Q(Ge, {
|
|
1486
1486
|
layer: d,
|
|
1487
1487
|
param: e,
|
|
1488
|
-
setProp:
|
|
1488
|
+
setProp: f
|
|
1489
1489
|
}) : void 0
|
|
1490
|
-
}), /* @__PURE__ */ Q(
|
|
1490
|
+
}), /* @__PURE__ */ Q(g, {
|
|
1491
1491
|
tone: "primary",
|
|
1492
1492
|
size: c,
|
|
1493
1493
|
className: "w-full",
|
|
@@ -1495,7 +1495,7 @@ function sr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1495
1495
|
iconSize: 12,
|
|
1496
1496
|
onClick: () => i(t.id, l),
|
|
1497
1497
|
children: "Remove media motion"
|
|
1498
|
-
})] }) : e.length < 8 && /* @__PURE__ */ Q(
|
|
1498
|
+
})] }) : e.length < 8 && /* @__PURE__ */ Q(g, {
|
|
1499
1499
|
tone: "primary",
|
|
1500
1500
|
size: c,
|
|
1501
1501
|
className: "w-full",
|
|
@@ -1509,57 +1509,57 @@ function sr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1509
1509
|
function cr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: s, showMod: l }) {
|
|
1510
1510
|
let u = _();
|
|
1511
1511
|
return e.slice(t).map((e, d) => {
|
|
1512
|
-
let
|
|
1512
|
+
let f = d + t, p = e.enabled !== !1, m = {
|
|
1513
1513
|
...r,
|
|
1514
1514
|
...e.params,
|
|
1515
1515
|
id: n.id
|
|
1516
|
-
},
|
|
1516
|
+
}, h = o(f);
|
|
1517
1517
|
return /* @__PURE__ */ $("div", {
|
|
1518
1518
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1519
1519
|
children: [/* @__PURE__ */ $("div", {
|
|
1520
1520
|
className: "flex items-center gap-2",
|
|
1521
|
-
children: [/* @__PURE__ */ Q(
|
|
1521
|
+
children: [/* @__PURE__ */ Q(I, {
|
|
1522
1522
|
size: u,
|
|
1523
|
-
checked:
|
|
1524
|
-
onChange: () => i(n.id,
|
|
1523
|
+
checked: p,
|
|
1524
|
+
onChange: () => i(n.id, f),
|
|
1525
1525
|
label: e.def?.label ?? e.id
|
|
1526
1526
|
}), /* @__PURE__ */ Q(Jt, {
|
|
1527
1527
|
asChild: !0,
|
|
1528
1528
|
label: "Delete effect",
|
|
1529
|
-
children: /* @__PURE__ */ Q(
|
|
1529
|
+
children: /* @__PURE__ */ Q(g, {
|
|
1530
1530
|
tone: "ghost",
|
|
1531
1531
|
quiet: !0,
|
|
1532
1532
|
size: "xs",
|
|
1533
1533
|
iconOnly: "x",
|
|
1534
1534
|
"aria-label": "Delete effect",
|
|
1535
1535
|
className: "ml-auto shrink-0",
|
|
1536
|
-
onClick: () => a(n.id,
|
|
1536
|
+
onClick: () => a(n.id, f)
|
|
1537
1537
|
})
|
|
1538
1538
|
})]
|
|
1539
|
-
}),
|
|
1539
|
+
}), p && e.def && /* @__PURE__ */ Q(L, {
|
|
1540
1540
|
schema: e.def.params.filter((e) => c(e) !== "anim"),
|
|
1541
|
-
layer:
|
|
1542
|
-
setProp:
|
|
1541
|
+
layer: m,
|
|
1542
|
+
setProp: h,
|
|
1543
1543
|
palette: s,
|
|
1544
1544
|
inline: !0,
|
|
1545
1545
|
renderAnimate: l ? (e) => /* @__PURE__ */ Q(Ge, {
|
|
1546
|
-
layer:
|
|
1546
|
+
layer: m,
|
|
1547
1547
|
param: e,
|
|
1548
|
-
setProp:
|
|
1548
|
+
setProp: h
|
|
1549
1549
|
}) : void 0
|
|
1550
1550
|
})]
|
|
1551
|
-
}, e.key ??
|
|
1551
|
+
}, e.key ?? f);
|
|
1552
1552
|
});
|
|
1553
1553
|
}
|
|
1554
1554
|
function lr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: a, removeFilter: o, toggleFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
|
|
1555
1555
|
let d = _(), f = [{
|
|
1556
1556
|
value: "",
|
|
1557
1557
|
label: "Add FX…"
|
|
1558
|
-
}, ...(n ??
|
|
1558
|
+
}, ...(n ?? W(G)).map((e) => ({
|
|
1559
1559
|
value: e.id,
|
|
1560
1560
|
label: e.label ?? e.id
|
|
1561
1561
|
}))];
|
|
1562
|
-
return /* @__PURE__ */ $(
|
|
1562
|
+
return /* @__PURE__ */ $(S, {
|
|
1563
1563
|
label: "Post-Processing",
|
|
1564
1564
|
divided: !0,
|
|
1565
1565
|
children: [/* @__PURE__ */ Q(cr, {
|
|
@@ -1572,7 +1572,7 @@ function lr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1572
1572
|
setStagePropAt: c,
|
|
1573
1573
|
palette: l,
|
|
1574
1574
|
showMod: u
|
|
1575
|
-
}), e.length < 8 && /* @__PURE__ */ Q(
|
|
1575
|
+
}), e.length < 8 && /* @__PURE__ */ Q(h, {
|
|
1576
1576
|
variant: "subtle",
|
|
1577
1577
|
size: d,
|
|
1578
1578
|
className: "w-full",
|
|
@@ -1585,34 +1585,34 @@ function lr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1585
1585
|
});
|
|
1586
1586
|
}
|
|
1587
1587
|
function ur({ layer: e, showMod: t, tree: n }) {
|
|
1588
|
-
let r = _(), [i, a] = Z("generate"), { updateLayer: o, palette: s } =
|
|
1588
|
+
let r = _(), [i, a] = Z("generate"), { updateLayer: o, palette: s } = m(), { setOnly: c } = Te(), l = z(e.id, { history: "coalesce" }), u = V(e.loopGroup).find((t) => t.id === e.presetId), d = H(e.loopGroup), p = (n ?? Oe).find((t) => t.groups.includes(e.loopGroup)), h = p?.labels?.[e.loopGroup] ?? d?.label ?? "", g = p && p.label !== h ? `${p.label} / ${h}` : h, v = e.loopGroup === "paratype" && u?.sub === "Glyphs" ? B("paratype", "Glyphs") : null, y = v ? v.map((e) => ({
|
|
1589
1589
|
value: e.id,
|
|
1590
1590
|
label: e.label
|
|
1591
|
-
})) : null,
|
|
1592
|
-
let n =
|
|
1591
|
+
})) : null, b = (t) => {
|
|
1592
|
+
let n = v?.find((e) => e.id === t);
|
|
1593
1593
|
n && t !== e.presetId && c(e.type, de(n, e.loopGroup));
|
|
1594
|
-
},
|
|
1594
|
+
}, x = () => {
|
|
1595
1595
|
u && c(e.type, de(u, e.loopGroup));
|
|
1596
1596
|
};
|
|
1597
|
-
return Zn(
|
|
1597
|
+
return Zn(x, () => {
|
|
1598
1598
|
let t = K(e.loopId)?.params ?? [];
|
|
1599
|
-
o(e.id, C(e,
|
|
1599
|
+
o(e.id, C(e, j(t, e), N(), { withFilters: !0 }));
|
|
1600
1600
|
}), /* @__PURE__ */ $(rr, {
|
|
1601
|
-
title:
|
|
1602
|
-
chips:
|
|
1601
|
+
title: g,
|
|
1602
|
+
chips: y,
|
|
1603
1603
|
active: e.presetId,
|
|
1604
|
-
onPick:
|
|
1604
|
+
onPick: b,
|
|
1605
1605
|
pills: !0,
|
|
1606
1606
|
scope: e.loopId,
|
|
1607
1607
|
ghostLabels: (K(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1608
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1608
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1609
1609
|
layout: "joined",
|
|
1610
1610
|
tone: "sunken",
|
|
1611
1611
|
value: i,
|
|
1612
1612
|
onChange: a,
|
|
1613
1613
|
options: r === "sm" ? $n : er,
|
|
1614
1614
|
size: r,
|
|
1615
|
-
className:
|
|
1615
|
+
className: f(r)
|
|
1616
1616
|
}),
|
|
1617
1617
|
children: [
|
|
1618
1618
|
i === "anim" && /* @__PURE__ */ Q(Gn, {
|
|
@@ -1636,7 +1636,7 @@ function ur({ layer: e, showMod: t, tree: n }) {
|
|
|
1636
1636
|
tabStrip: null,
|
|
1637
1637
|
tree: n,
|
|
1638
1638
|
inline: !0,
|
|
1639
|
-
onReset:
|
|
1639
|
+
onReset: x
|
|
1640
1640
|
}),
|
|
1641
1641
|
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Xn, {
|
|
1642
1642
|
layer: e,
|
|
@@ -1657,7 +1657,7 @@ function ur({ layer: e, showMod: t, tree: n }) {
|
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
1659
|
function dr({ layer: e, showMod: t }) {
|
|
1660
|
-
let n = _(), [r, i] = Z("generate"), { updateLayer: a, palette: o } =
|
|
1660
|
+
let n = _(), [r, i] = Z("generate"), { updateLayer: a, palette: o } = m(), { setOnly: s } = Te(), c = z(e.id, { history: "coalesce" }), l = Je.find((t) => t.id === e.presetId), u = Xe.find((e) => e.subs.includes(l?.sub))?.label ?? "Kinetic";
|
|
1661
1661
|
return Zn(() => {
|
|
1662
1662
|
l && s("kinetic", {
|
|
1663
1663
|
presetId: l.id,
|
|
@@ -1665,7 +1665,7 @@ function dr({ layer: e, showMod: t }) {
|
|
|
1665
1665
|
comp: Ye(l)
|
|
1666
1666
|
});
|
|
1667
1667
|
}, () => {
|
|
1668
|
-
let t =
|
|
1668
|
+
let t = N(), n = O(t >>> 0), r = e.comp ?? { instances: [] };
|
|
1669
1669
|
(r.instances ?? []).forEach((e, t) => {
|
|
1670
1670
|
r = Qe(r, t, n);
|
|
1671
1671
|
}), a(e.id, {
|
|
@@ -1674,14 +1674,14 @@ function dr({ layer: e, showMod: t }) {
|
|
|
1674
1674
|
});
|
|
1675
1675
|
}), /* @__PURE__ */ Q(rr, {
|
|
1676
1676
|
title: u,
|
|
1677
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1677
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1678
1678
|
layout: "joined",
|
|
1679
1679
|
tone: "sunken",
|
|
1680
1680
|
value: r,
|
|
1681
1681
|
onChange: i,
|
|
1682
1682
|
options: n === "sm" ? $n : er,
|
|
1683
1683
|
size: n,
|
|
1684
|
-
className:
|
|
1684
|
+
className: f(n)
|
|
1685
1685
|
}),
|
|
1686
1686
|
children: /* @__PURE__ */ Q(Ze, {
|
|
1687
1687
|
layer: e,
|
|
@@ -1702,7 +1702,7 @@ function fr() {
|
|
|
1702
1702
|
let { layer: e } = Te(), t = He(), n = _(), r = We();
|
|
1703
1703
|
return Y(() => {
|
|
1704
1704
|
let e = (e) => {
|
|
1705
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1705
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || ft(e) || Ue();
|
|
1706
1706
|
};
|
|
1707
1707
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1708
1708
|
}, []), t.active ? /* @__PURE__ */ Q(rr, {
|
|
@@ -1724,7 +1724,7 @@ function fr() {
|
|
|
1724
1724
|
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(dr, {
|
|
1725
1725
|
layer: e,
|
|
1726
1726
|
showMod: r
|
|
1727
|
-
}, e.id) : /* @__PURE__ */ Q(
|
|
1727
|
+
}, e.id) : /* @__PURE__ */ Q(R, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(R, { children: "Pick an effect or generator from the nav." });
|
|
1728
1728
|
}
|
|
1729
1729
|
//#endregion
|
|
1730
1730
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
@@ -1760,7 +1760,7 @@ function mr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1760
1760
|
return /* @__PURE__ */ Q(J, {
|
|
1761
1761
|
tone: "primary",
|
|
1762
1762
|
size: "lg",
|
|
1763
|
-
className:
|
|
1763
|
+
className: Pt,
|
|
1764
1764
|
iconLeft: n,
|
|
1765
1765
|
iconRight: n,
|
|
1766
1766
|
onClick: () => e(t),
|
|
@@ -1796,7 +1796,7 @@ function mr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1796
1796
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1797
1797
|
var hr = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1798
1798
|
function gr(e) {
|
|
1799
|
-
let { patch: t } =
|
|
1799
|
+
let { patch: t } = z(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1800
1800
|
return {
|
|
1801
1801
|
nodes: /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q("input", {
|
|
1802
1802
|
ref: n,
|
|
@@ -1818,13 +1818,13 @@ function gr(e) {
|
|
|
1818
1818
|
});
|
|
1819
1819
|
return;
|
|
1820
1820
|
}
|
|
1821
|
-
|
|
1821
|
+
rt(r).then((e) => t({
|
|
1822
1822
|
src: e,
|
|
1823
1823
|
srcType: "image"
|
|
1824
1824
|
}));
|
|
1825
1825
|
}
|
|
1826
1826
|
}
|
|
1827
|
-
}), /* @__PURE__ */ Q(
|
|
1827
|
+
}), /* @__PURE__ */ Q(Rt, {
|
|
1828
1828
|
open: r,
|
|
1829
1829
|
accept: a ? hr : ["image", "video"],
|
|
1830
1830
|
onClose: () => i(!1),
|
|
@@ -1835,7 +1835,7 @@ function gr(e) {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
t({
|
|
1837
1837
|
src: Ct(e),
|
|
1838
|
-
srcType:
|
|
1838
|
+
srcType: lt(n) ? "video" : "image"
|
|
1839
1839
|
});
|
|
1840
1840
|
}
|
|
1841
1841
|
})] }),
|
|
@@ -1843,7 +1843,7 @@ function gr(e) {
|
|
|
1843
1843
|
openLibrary: () => i(!0),
|
|
1844
1844
|
openUpload: () => n.current?.click(),
|
|
1845
1845
|
openCamera: () => {
|
|
1846
|
-
|
|
1846
|
+
nt(e.id).then(() => t({
|
|
1847
1847
|
src: null,
|
|
1848
1848
|
srcType: "webcam"
|
|
1849
1849
|
})).catch(() => {});
|
|
@@ -1869,25 +1869,25 @@ function _r({ layer: e }) {
|
|
|
1869
1869
|
return /* @__PURE__ */ $("div", {
|
|
1870
1870
|
className: "flex flex-col gap-2",
|
|
1871
1871
|
children: [
|
|
1872
|
-
/* @__PURE__ */ Q(
|
|
1872
|
+
/* @__PURE__ */ Q(g, {
|
|
1873
1873
|
tone: "primary",
|
|
1874
1874
|
size: "lg",
|
|
1875
|
-
className:
|
|
1875
|
+
className: Pt,
|
|
1876
1876
|
iconLeft: "image",
|
|
1877
1877
|
iconRight: "image",
|
|
1878
1878
|
onClick: t.openLibrary,
|
|
1879
1879
|
children: "From library"
|
|
1880
1880
|
}),
|
|
1881
|
-
/* @__PURE__ */ Q(
|
|
1881
|
+
/* @__PURE__ */ Q(g, {
|
|
1882
1882
|
tone: "primary",
|
|
1883
1883
|
size: "lg",
|
|
1884
|
-
className:
|
|
1884
|
+
className: Pt,
|
|
1885
1885
|
iconLeft: "upload",
|
|
1886
1886
|
iconRight: "upload",
|
|
1887
1887
|
onClick: t.openUpload,
|
|
1888
1888
|
children: "Upload"
|
|
1889
1889
|
}),
|
|
1890
|
-
!t.svgMode && /* @__PURE__ */ Q(
|
|
1890
|
+
!t.svgMode && /* @__PURE__ */ Q(g, {
|
|
1891
1891
|
tone: "primary",
|
|
1892
1892
|
size: "lg",
|
|
1893
1893
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
@@ -1919,10 +1919,10 @@ function vr({ layer: e, title: t, onBack: n }) {
|
|
|
1919
1919
|
})]
|
|
1920
1920
|
}),
|
|
1921
1921
|
/* @__PURE__ */ Q(_r, { layer: e }),
|
|
1922
|
-
/* @__PURE__ */ Q(
|
|
1922
|
+
/* @__PURE__ */ Q(g, {
|
|
1923
1923
|
tone: "grey",
|
|
1924
1924
|
size: "lg",
|
|
1925
|
-
className:
|
|
1925
|
+
className: Pt,
|
|
1926
1926
|
iconLeft: "arrow-left",
|
|
1927
1927
|
iconRight: "arrow-left",
|
|
1928
1928
|
onClick: n,
|
|
@@ -2040,7 +2040,7 @@ function Tr({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2040
2040
|
children: [u.map((t) => /* @__PURE__ */ Q(J, {
|
|
2041
2041
|
tone: "primary",
|
|
2042
2042
|
size: "lg",
|
|
2043
|
-
className:
|
|
2043
|
+
className: Pt,
|
|
2044
2044
|
iconLeft: t.icon,
|
|
2045
2045
|
iconRight: t.icon,
|
|
2046
2046
|
onClick: () => {
|
|
@@ -2080,7 +2080,7 @@ function Er(e) {
|
|
|
2080
2080
|
pill: "Labs"
|
|
2081
2081
|
};
|
|
2082
2082
|
if (e.type === "loop" || e.type === "misc") return {
|
|
2083
|
-
title:
|
|
2083
|
+
title: H(e.loopGroup)?.label ?? "Labs",
|
|
2084
2084
|
kind: e.presetLabel,
|
|
2085
2085
|
pill: e.presetLabel
|
|
2086
2086
|
};
|
|
@@ -2107,7 +2107,7 @@ var Dr = .85, Or = .3, kr = 2.5, Ar = {
|
|
|
2107
2107
|
4: 2
|
|
2108
2108
|
}, jr = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2109
2109
|
function Mr() {
|
|
2110
|
-
let { layer: t } = Te(), { removeLayer: n, layers: r, updateLayer: a, beginTransaction: o, commitTransaction: s, select: c } =
|
|
2110
|
+
let { layer: t } = Te(), { removeLayer: n, layers: r, updateLayer: a, beginTransaction: o, commitTransaction: s, select: c } = m(), [l, u] = Z(null);
|
|
2111
2111
|
Y(() => {
|
|
2112
2112
|
let e = (e) => {
|
|
2113
2113
|
let { id: t, index: n } = e.detail || {};
|
|
@@ -2126,17 +2126,17 @@ function Mr() {
|
|
|
2126
2126
|
l,
|
|
2127
2127
|
c
|
|
2128
2128
|
]);
|
|
2129
|
-
let d = l && r.find((e) => e.id === l.id && e.type === "kinetic"), f = t?.type === "photo" && !t.src && t.srcType !== "webcam", [p,
|
|
2129
|
+
let d = l && r.find((e) => e.id === l.id && e.type === "kinetic"), f = t?.type === "photo" && !t.src && t.srcType !== "webcam", [p, h] = Z(1), [g, _] = Z(!1), v = T(g), y = X(null), b = (e) => Math.min(kr, Math.max(Or, e)), x = (e) => h((t) => b(t * (e > 0 ? 1.25 : .8))), { tool: S } = St(), C = S === "orbit", w = X(C);
|
|
2130
2130
|
w.current = C, Y(() => {
|
|
2131
2131
|
let t = y.current;
|
|
2132
2132
|
if (!t) return;
|
|
2133
2133
|
let n = (t) => {
|
|
2134
|
-
w.current || (t.preventDefault(), !e().zoomLock &&
|
|
2134
|
+
w.current || (t.preventDefault(), !e().zoomLock && h((e) => b(e * (t.deltaY > 0 ? .94 : 1.06))));
|
|
2135
2135
|
};
|
|
2136
2136
|
return t.addEventListener("wheel", n, { passive: !1 }), () => t.removeEventListener("wheel", n);
|
|
2137
2137
|
}, []), Y(() => {
|
|
2138
2138
|
let t = (t) => {
|
|
2139
|
-
if (!(t.metaKey || t.ctrlKey || t.altKey) && !
|
|
2139
|
+
if (!(t.metaKey || t.ctrlKey || t.altKey) && !ft(t)) {
|
|
2140
2140
|
if (t.key === "f" || t.key === "F") {
|
|
2141
2141
|
_((e) => !e);
|
|
2142
2142
|
return;
|
|
@@ -2150,7 +2150,7 @@ function Mr() {
|
|
|
2150
2150
|
x(1);
|
|
2151
2151
|
return;
|
|
2152
2152
|
}
|
|
2153
|
-
Ar[t.key] !== void 0 &&
|
|
2153
|
+
Ar[t.key] !== void 0 && h(Ar[t.key]);
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
2156
|
};
|
|
@@ -2201,7 +2201,7 @@ function Mr() {
|
|
|
2201
2201
|
}), n.pts.size >= 2 && n.start)) {
|
|
2202
2202
|
t.stopPropagation();
|
|
2203
2203
|
let [r, i] = [...n.pts.values()], a = n.start, o = e().zoomLock ? a.z0 : b(a.z0 * (Math.hypot(r.x - i.x, r.y - i.y) / a.d)), s = (r.x + i.x) / 2, c = (r.y + i.y) / 2;
|
|
2204
|
-
|
|
2204
|
+
h(o), D({
|
|
2205
2205
|
x: s - a.cx - o * a.qx,
|
|
2206
2206
|
y: c - a.cy - o * a.qy
|
|
2207
2207
|
});
|
|
@@ -2217,7 +2217,7 @@ function Mr() {
|
|
|
2217
2217
|
className: "relative w-full h-full flex items-center justify-center overflow-hidden touch-none",
|
|
2218
2218
|
style: { background: "var(--kol-surface-secondary)" },
|
|
2219
2219
|
onDoubleClick: () => {
|
|
2220
|
-
|
|
2220
|
+
h(1), D({
|
|
2221
2221
|
x: 0,
|
|
2222
2222
|
y: 0
|
|
2223
2223
|
});
|
|
@@ -2234,7 +2234,7 @@ function Mr() {
|
|
|
2234
2234
|
height: `${p * Dr * 100}%`,
|
|
2235
2235
|
transform: `translate(${E.x}px, ${E.y}px)`
|
|
2236
2236
|
},
|
|
2237
|
-
children: /* @__PURE__ */ Q(
|
|
2237
|
+
children: /* @__PURE__ */ Q(It, { overlay: d ? (e) => /* @__PURE__ */ Q(ut, {
|
|
2238
2238
|
layer: d,
|
|
2239
2239
|
initialIndex: l.index,
|
|
2240
2240
|
toVirtual: e,
|
|
@@ -2340,7 +2340,7 @@ function Lr({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2340
2340
|
icon: "home-01",
|
|
2341
2341
|
path: "#home",
|
|
2342
2342
|
label: "Home",
|
|
2343
|
-
onPress: () =>
|
|
2343
|
+
onPress: () => Bt("/")
|
|
2344
2344
|
},
|
|
2345
2345
|
{
|
|
2346
2346
|
icon: "grid",
|
|
@@ -2458,7 +2458,7 @@ var zr = {
|
|
|
2458
2458
|
{
|
|
2459
2459
|
slot: "right.footer",
|
|
2460
2460
|
order: 0,
|
|
2461
|
-
Component:
|
|
2461
|
+
Component: Dt
|
|
2462
2462
|
}
|
|
2463
2463
|
]
|
|
2464
2464
|
}, Br = {
|
|
@@ -2473,25 +2473,25 @@ var zr = {
|
|
|
2473
2473
|
} : e)]
|
|
2474
2474
|
};
|
|
2475
2475
|
function Vr() {
|
|
2476
|
-
let { setAspect: t } =
|
|
2476
|
+
let { setAspect: t } = m(), n = X(!1);
|
|
2477
2477
|
Y(() => {
|
|
2478
2478
|
if (n.current) return;
|
|
2479
2479
|
n.current = !0;
|
|
2480
2480
|
let r = e();
|
|
2481
2481
|
r.defaultAspect && r.defaultAspect !== "custom" && t(r.defaultAspect), r.defaultLoopSeconds && i.setLoopSeconds(r.defaultLoopSeconds);
|
|
2482
2482
|
}, []);
|
|
2483
|
-
let { clearHistory: r } =
|
|
2483
|
+
let { clearHistory: r } = m();
|
|
2484
2484
|
Y(() => {
|
|
2485
2485
|
let e = setTimeout(r, 800);
|
|
2486
2486
|
return () => clearTimeout(e);
|
|
2487
2487
|
}, [r]);
|
|
2488
2488
|
}
|
|
2489
2489
|
function Hr() {
|
|
2490
|
-
let { selectedId: n, select: r } =
|
|
2490
|
+
let { selectedId: n, select: r } = m(), { layer: a, setOnly: o } = Te(), c = vt(kt), l = Et() && !Ot() || c;
|
|
2491
2491
|
Y(() => {
|
|
2492
2492
|
l && document.documentElement.removeAttribute("data-rail");
|
|
2493
2493
|
}, [l]);
|
|
2494
|
-
let [u, d] = Z(!0), [f, p] = Z(!1), [
|
|
2494
|
+
let [u, d] = Z(!0), [f, p] = Z(!1), [h, g] = Z(null), _ = h ? `${h}px` : f ? xr.tall : xr.half, v = { "--kol-sheet-h": _ }, b = _n(), x = He(), [S, C] = Z(() => !a);
|
|
2495
2495
|
Y(() => {
|
|
2496
2496
|
C(!a);
|
|
2497
2497
|
}, [a?.id]);
|
|
@@ -2516,7 +2516,7 @@ function Hr() {
|
|
|
2516
2516
|
}), () => {
|
|
2517
2517
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2518
2518
|
};
|
|
2519
|
-
}, [x.active, l]), Y(() =>
|
|
2519
|
+
}, [x.active, l]), Y(() => Vt((e) => o("photo", {
|
|
2520
2520
|
src: e.url,
|
|
2521
2521
|
srcType: e.srcType
|
|
2522
2522
|
})), [o]), Y(() => {
|
|
@@ -2525,19 +2525,19 @@ function Hr() {
|
|
|
2525
2525
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2526
2526
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2527
2527
|
};
|
|
2528
|
-
}, [l]), xt(), Y(() => (
|
|
2528
|
+
}, [l]), xt(), Y(() => (et("labs"), () => et(null)), []), Vr();
|
|
2529
2529
|
let D = X(!1);
|
|
2530
2530
|
Y(() => {
|
|
2531
2531
|
if (D.current) return;
|
|
2532
2532
|
D.current = !0;
|
|
2533
|
-
let e =
|
|
2533
|
+
let e = tt();
|
|
2534
2534
|
if (e.open || e.fresh) return;
|
|
2535
|
-
let t = new URLSearchParams(window.location.search).get("preset"), n = t ?
|
|
2536
|
-
n && o("loop", de(
|
|
2535
|
+
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? ue(t) : null;
|
|
2536
|
+
n && o("loop", de(ee(t), n));
|
|
2537
2537
|
}, [o]);
|
|
2538
|
-
let { tool: O, setTool: k } =
|
|
2538
|
+
let { tool: O, setTool: k } = St(), A = X(O);
|
|
2539
2539
|
A.current = O;
|
|
2540
|
-
let { updateLayer: j, undo: M, redo: N } =
|
|
2540
|
+
let { updateLayer: j, undo: M, redo: N } = m(), P = X({
|
|
2541
2541
|
undo: M,
|
|
2542
2542
|
redo: N
|
|
2543
2543
|
});
|
|
@@ -2549,12 +2549,12 @@ function Hr() {
|
|
|
2549
2549
|
Y(() => {
|
|
2550
2550
|
k(F ? "orbit" : "select");
|
|
2551
2551
|
}, [F, k]);
|
|
2552
|
-
let
|
|
2553
|
-
|
|
2554
|
-
let
|
|
2555
|
-
return
|
|
2552
|
+
let I = X(a);
|
|
2553
|
+
I.current = a;
|
|
2554
|
+
let L = X(j);
|
|
2555
|
+
return L.current = j, Y(() => {
|
|
2556
2556
|
let t = (t) => {
|
|
2557
|
-
if (
|
|
2557
|
+
if (ft(t)) return;
|
|
2558
2558
|
if ((t.metaKey || t.ctrlKey) && (t.key === "z" || t.key === "Z")) {
|
|
2559
2559
|
t.preventDefault(), t.shiftKey ? P.current.redo() : P.current.undo();
|
|
2560
2560
|
return;
|
|
@@ -2576,9 +2576,9 @@ function Hr() {
|
|
|
2576
2576
|
return;
|
|
2577
2577
|
}
|
|
2578
2578
|
let n = !t.metaKey && !t.ctrlKey && !t.altKey && !t.shiftKey && we[t.key.length === 1 ? t.key.toLowerCase() : t.key];
|
|
2579
|
-
if (n &&
|
|
2580
|
-
let e = ye(
|
|
2581
|
-
e && (t.preventDefault(),
|
|
2579
|
+
if (n && I.current) {
|
|
2580
|
+
let e = ye(I.current, n[1], n[0]);
|
|
2581
|
+
e && (t.preventDefault(), L.current(I.current.id, e));
|
|
2582
2582
|
}
|
|
2583
2583
|
};
|
|
2584
2584
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
@@ -2611,7 +2611,7 @@ function Hr() {
|
|
|
2611
2611
|
},
|
|
2612
2612
|
children: [/* @__PURE__ */ Q(y.Provider, {
|
|
2613
2613
|
value: "md",
|
|
2614
|
-
children: /* @__PURE__ */ Q(
|
|
2614
|
+
children: /* @__PURE__ */ Q(it, {
|
|
2615
2615
|
registry: Br,
|
|
2616
2616
|
rightIn: (e) => b ? sn(/* @__PURE__ */ Q("div", {
|
|
2617
2617
|
className: "kol-editor-labs flex flex-col h-full",
|
|
@@ -2628,7 +2628,7 @@ function Hr() {
|
|
|
2628
2628
|
toggleCatalog: () => C((e) => !e),
|
|
2629
2629
|
railHeight: _
|
|
2630
2630
|
})]
|
|
2631
|
-
}) : /* @__PURE__ */ Q(
|
|
2631
|
+
}) : /* @__PURE__ */ Q(it, { registry: zr }),
|
|
2632
2632
|
S && !x.picker && !(x.active && !a) && /* @__PURE__ */ Q(Tr, {
|
|
2633
2633
|
initialOpen: w,
|
|
2634
2634
|
hasMedia: E,
|
|
@@ -2671,7 +2671,7 @@ function Wr() {
|
|
|
2671
2671
|
function Gr({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2672
2672
|
let [i, a] = Z(null);
|
|
2673
2673
|
pr(r);
|
|
2674
|
-
let { engineHost: o } =
|
|
2674
|
+
let { engineHost: o } = re(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = U(G.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2675
2675
|
return /* @__PURE__ */ Q("div", {
|
|
2676
2676
|
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",
|
|
2677
2677
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -2688,7 +2688,7 @@ function Gr({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2688
2688
|
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(J, {
|
|
2689
2689
|
tone: "primary",
|
|
2690
2690
|
size: "lg",
|
|
2691
|
-
className:
|
|
2691
|
+
className: Pt,
|
|
2692
2692
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2693
2693
|
iconRight: l ? "filter" : "chevron-right",
|
|
2694
2694
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
@@ -2698,7 +2698,7 @@ function Gr({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2698
2698
|
/* @__PURE__ */ Q(J, {
|
|
2699
2699
|
tone: "grey",
|
|
2700
2700
|
size: "lg",
|
|
2701
|
-
className:
|
|
2701
|
+
className: Pt,
|
|
2702
2702
|
iconLeft: "arrow-left",
|
|
2703
2703
|
iconRight: "arrow-left",
|
|
2704
2704
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2806,46 +2806,46 @@ var ri = [
|
|
|
2806
2806
|
}
|
|
2807
2807
|
];
|
|
2808
2808
|
function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectValue: a, onAspect: o, openEffects: s = !1, rail: c = !1, onRail: l, onSheet: u }) {
|
|
2809
|
-
let d = He(), { updateLayer: f, addFilter: p, removeFilter:
|
|
2809
|
+
let d = He(), { updateLayer: f, addFilter: p, removeFilter: h } = m(), { onExportPng: g } = zt(), [_, y] = Z(!1), [b, S] = Z(!0), [w, T] = Z(!1), [D, O] = Z(!1), [A, N] = Z("generate"), [P, I] = Z(!1), [L, R] = Z(!1), { aspect: z } = m(), [ee, B] = Z(null), U = E(e);
|
|
2810
2810
|
Y(() => {
|
|
2811
2811
|
s && (S(!0), O(!0));
|
|
2812
2812
|
}, [s]);
|
|
2813
|
-
let
|
|
2814
|
-
Y(() => (l?.(
|
|
2815
|
-
let
|
|
2816
|
-
Y(() => (u?.(
|
|
2817
|
-
let
|
|
2818
|
-
let t = e?.type === "loop" &&
|
|
2813
|
+
let W = c ? "sm" : "lg", te = c && !!e && b && !_;
|
|
2814
|
+
Y(() => (l?.(te), () => l?.(!1)), [te]);
|
|
2815
|
+
let G = !c && e && b && !_ ? ee ? `${ee}px` : P ? xr.tall : xr.half : null;
|
|
2816
|
+
Y(() => (u?.(G), () => u?.(null)), [G]);
|
|
2817
|
+
let ne = () => {
|
|
2818
|
+
let t = e?.type === "loop" && V(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2819
2819
|
t && f(e.id, de(t, e.loopGroup));
|
|
2820
2820
|
};
|
|
2821
|
-
if (Zn(
|
|
2822
|
-
e?.type === "loop" && f(e.id, C(e,
|
|
2821
|
+
if (Zn(ne, () => {
|
|
2822
|
+
e?.type === "loop" && f(e.id, C(e, j(K(e.loopId)?.params ?? [], e), U.take(), { withFilters: !0 }));
|
|
2823
2823
|
}), !e) return null;
|
|
2824
2824
|
if (_) return /* @__PURE__ */ Q("button", {
|
|
2825
2825
|
"aria-label": "Show controls",
|
|
2826
2826
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
2827
2827
|
onClick: () => y(!1)
|
|
2828
2828
|
});
|
|
2829
|
-
let
|
|
2830
|
-
let t =
|
|
2829
|
+
let ie = e.type === "loop", ae = ie ? `${H(e.loopGroup).label} · ${e.presetLabel}` : "Media", oe = ie ? K(e.loopId)?.params ?? [] : [], se = ie ? M(oe, e) : [], ce = () => f(e.id, C(e, j(oe, e), U.take(), { withFilters: !0 })), le = (t) => f(e.id, C(e, t.params, U.take(), { stripNoRandom: !!t.motion })), ue = () => {
|
|
2830
|
+
let t = k(e, U.take());
|
|
2831
2831
|
t && f(e.id, t);
|
|
2832
|
-
}, fe = x(e), { effectable: pe } =
|
|
2833
|
-
let t =
|
|
2832
|
+
}, fe = x(e), { effectable: pe } = re(e), he = () => {
|
|
2833
|
+
let t = F(e, U.take());
|
|
2834
2834
|
t && f(e.id, { filters: t });
|
|
2835
2835
|
};
|
|
2836
2836
|
if (!b) return /* @__PURE__ */ $(br, {
|
|
2837
|
-
label:
|
|
2837
|
+
label: ie ? e.presetLabel : "Media",
|
|
2838
2838
|
onOpen: () => S(!0),
|
|
2839
|
-
size:
|
|
2839
|
+
size: W,
|
|
2840
2840
|
children: [
|
|
2841
|
-
(
|
|
2841
|
+
(ie || fe.length > 0) && /* @__PURE__ */ Q(Jt, {
|
|
2842
2842
|
label: "Randomize all",
|
|
2843
2843
|
children: /* @__PURE__ */ Q(J, {
|
|
2844
2844
|
tone: "primary",
|
|
2845
|
-
size:
|
|
2845
|
+
size: W,
|
|
2846
2846
|
iconOnly: "bolt",
|
|
2847
2847
|
"aria-label": "Randomize all",
|
|
2848
|
-
onClick:
|
|
2848
|
+
onClick: ce,
|
|
2849
2849
|
className: "shrink-0"
|
|
2850
2850
|
})
|
|
2851
2851
|
}),
|
|
@@ -2853,7 +2853,7 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2853
2853
|
label: "Download",
|
|
2854
2854
|
children: /* @__PURE__ */ Q(J, {
|
|
2855
2855
|
tone: "primary",
|
|
2856
|
-
size:
|
|
2856
|
+
size: W,
|
|
2857
2857
|
iconOnly: "download",
|
|
2858
2858
|
"aria-label": "Download",
|
|
2859
2859
|
onClick: () => g(2),
|
|
@@ -2864,7 +2864,7 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2864
2864
|
label: "Hide UI",
|
|
2865
2865
|
children: /* @__PURE__ */ Q(J, {
|
|
2866
2866
|
tone: "primary",
|
|
2867
|
-
size:
|
|
2867
|
+
size: W,
|
|
2868
2868
|
iconOnly: "eye-off",
|
|
2869
2869
|
"aria-label": "Hide UI",
|
|
2870
2870
|
onClick: () => y(!0),
|
|
@@ -2875,27 +2875,27 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2875
2875
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2876
2876
|
children: /* @__PURE__ */ Q(J, {
|
|
2877
2877
|
tone: "primary",
|
|
2878
|
-
size:
|
|
2878
|
+
size: W,
|
|
2879
2879
|
iconOnly: "maximize",
|
|
2880
2880
|
"aria-label": a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2881
2881
|
"aria-pressed": a === "fill",
|
|
2882
|
-
onClick: () => o(a === "fill" ?
|
|
2882
|
+
onClick: () => o(a === "fill" ? z : "fill"),
|
|
2883
2883
|
className: "shrink-0"
|
|
2884
2884
|
})
|
|
2885
2885
|
})
|
|
2886
2886
|
]
|
|
2887
2887
|
});
|
|
2888
|
-
let ge = [...
|
|
2888
|
+
let ge = [...ie ? qr : Jr, ...ie && d.steps.length >= 2 ? [{
|
|
2889
2889
|
value: "morph",
|
|
2890
2890
|
label: "Morph"
|
|
2891
|
-
}] : []].filter((e) => (e.value !== "effects" || pe) && (e.value !== "transport" || v("motion"))), _e = ge.some((e) => e.value ===
|
|
2891
|
+
}] : []].filter((e) => (e.value !== "effects" || pe) && (e.value !== "transport" || v("motion"))), _e = ge.some((e) => e.value === A) ? A : ge[0].value;
|
|
2892
2892
|
return /* @__PURE__ */ $(nn, { children: [
|
|
2893
2893
|
/* @__PURE__ */ Q(me, {
|
|
2894
|
-
open:
|
|
2895
|
-
onClose: () =>
|
|
2896
|
-
schema:
|
|
2894
|
+
open: L,
|
|
2895
|
+
onClose: () => R(!1),
|
|
2896
|
+
schema: oe,
|
|
2897
2897
|
layer: e,
|
|
2898
|
-
size:
|
|
2898
|
+
size: W
|
|
2899
2899
|
}),
|
|
2900
2900
|
w && /* @__PURE__ */ Q(mr, {
|
|
2901
2901
|
onPick: (e) => {
|
|
@@ -2921,21 +2921,21 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2921
2921
|
className: c ? "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)]",
|
|
2922
2922
|
style: c ? Kr : {
|
|
2923
2923
|
...Kr,
|
|
2924
|
-
top: `calc(100dvh - ${
|
|
2924
|
+
top: `calc(100dvh - ${G ?? xr.half})`
|
|
2925
2925
|
},
|
|
2926
2926
|
children: [
|
|
2927
2927
|
!c && /* @__PURE__ */ Q(Cr, {
|
|
2928
2928
|
tall: P,
|
|
2929
2929
|
onToggle: () => {
|
|
2930
|
-
|
|
2930
|
+
B(null), I((e) => !e);
|
|
2931
2931
|
},
|
|
2932
|
-
onResize: (e) =>
|
|
2932
|
+
onResize: (e) => B(Math.max(96, Math.min(window.innerHeight * .92, e))),
|
|
2933
2933
|
onResizeEnd: (e) => {
|
|
2934
|
-
e < 96 && (
|
|
2934
|
+
e < 96 && (B(null), S(!1));
|
|
2935
2935
|
}
|
|
2936
2936
|
}),
|
|
2937
2937
|
/* @__PURE__ */ Q(yr, {
|
|
2938
|
-
title:
|
|
2938
|
+
title: ae,
|
|
2939
2939
|
onCollapse: () => S(!1),
|
|
2940
2940
|
className: c ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
2941
2941
|
action: /* @__PURE__ */ Q(J, {
|
|
@@ -2952,29 +2952,29 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2952
2952
|
/* @__PURE__ */ Q(Ut, {
|
|
2953
2953
|
layout: "joined",
|
|
2954
2954
|
value: _e,
|
|
2955
|
-
onChange:
|
|
2955
|
+
onChange: N,
|
|
2956
2956
|
options: ge,
|
|
2957
|
-
size:
|
|
2957
|
+
size: W,
|
|
2958
2958
|
className: c ? Yr : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2959
2959
|
}),
|
|
2960
|
-
_e === "morph" &&
|
|
2960
|
+
_e === "morph" && ie && /* @__PURE__ */ Q(Rn, {
|
|
2961
2961
|
layer: e,
|
|
2962
2962
|
readOnly: !0
|
|
2963
2963
|
}),
|
|
2964
|
-
_e === "generate" &&
|
|
2964
|
+
_e === "generate" && ie && /* @__PURE__ */ $("div", {
|
|
2965
2965
|
className: "flex flex-col gap-2 pt-3",
|
|
2966
2966
|
children: [
|
|
2967
2967
|
/* @__PURE__ */ $("div", {
|
|
2968
2968
|
className: "grid grid-cols-2 gap-2",
|
|
2969
2969
|
children: [/* @__PURE__ */ Q(J, {
|
|
2970
2970
|
tone: "primary",
|
|
2971
|
-
size:
|
|
2971
|
+
size: W,
|
|
2972
2972
|
iconRight: "refresh",
|
|
2973
|
-
onClick:
|
|
2973
|
+
onClick: ue,
|
|
2974
2974
|
children: "Preset"
|
|
2975
2975
|
}), /* @__PURE__ */ Q(J, {
|
|
2976
2976
|
tone: "primary",
|
|
2977
|
-
size:
|
|
2977
|
+
size: W,
|
|
2978
2978
|
onClick: () => T(!0),
|
|
2979
2979
|
children: "Generator"
|
|
2980
2980
|
})]
|
|
@@ -2984,19 +2984,19 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2984
2984
|
children: [
|
|
2985
2985
|
/* @__PURE__ */ Q(J, {
|
|
2986
2986
|
tone: "primary",
|
|
2987
|
-
size:
|
|
2987
|
+
size: W,
|
|
2988
2988
|
className: "flex-1 min-w-0",
|
|
2989
|
-
onClick:
|
|
2989
|
+
onClick: ce,
|
|
2990
2990
|
children: "Randomize all"
|
|
2991
2991
|
}),
|
|
2992
2992
|
/* @__PURE__ */ Q(Jt, {
|
|
2993
2993
|
label: "What Randomize all rolls",
|
|
2994
2994
|
children: /* @__PURE__ */ Q(J, {
|
|
2995
2995
|
tone: "primary",
|
|
2996
|
-
size:
|
|
2996
|
+
size: W,
|
|
2997
2997
|
iconOnly: "nav-settings",
|
|
2998
2998
|
"aria-label": "What Randomize all rolls",
|
|
2999
|
-
onClick: () =>
|
|
2999
|
+
onClick: () => R(!0),
|
|
3000
3000
|
className: "shrink-0"
|
|
3001
3001
|
})
|
|
3002
3002
|
}),
|
|
@@ -3005,21 +3005,21 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3005
3005
|
shortcut: "R",
|
|
3006
3006
|
children: /* @__PURE__ */ Q(J, {
|
|
3007
3007
|
tone: "primary",
|
|
3008
|
-
size:
|
|
3008
|
+
size: W,
|
|
3009
3009
|
iconOnly: "refresh",
|
|
3010
3010
|
"aria-label": "Reset to defaults",
|
|
3011
|
-
onClick:
|
|
3011
|
+
onClick: ne,
|
|
3012
3012
|
className: "shrink-0"
|
|
3013
3013
|
})
|
|
3014
3014
|
})
|
|
3015
3015
|
]
|
|
3016
3016
|
}),
|
|
3017
|
-
|
|
3018
|
-
size:
|
|
3019
|
-
cells: [...
|
|
3017
|
+
se.length > 0 && /* @__PURE__ */ Q(ei, {
|
|
3018
|
+
size: W,
|
|
3019
|
+
cells: [...se.map((e) => ({
|
|
3020
3020
|
value: e.id,
|
|
3021
3021
|
label: e.label,
|
|
3022
|
-
run: () =>
|
|
3022
|
+
run: () => le(e)
|
|
3023
3023
|
})), {
|
|
3024
3024
|
value: "__retrigger",
|
|
3025
3025
|
label: "Re-trigger",
|
|
@@ -3035,13 +3035,13 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3035
3035
|
children: [
|
|
3036
3036
|
/* @__PURE__ */ Q(J, {
|
|
3037
3037
|
tone: "primary",
|
|
3038
|
-
size:
|
|
3038
|
+
size: W,
|
|
3039
3039
|
onClick: () => O(!0),
|
|
3040
3040
|
children: "Add effect"
|
|
3041
3041
|
}),
|
|
3042
3042
|
fe.length > 0 && /* @__PURE__ */ Q(J, {
|
|
3043
3043
|
tone: "primary",
|
|
3044
|
-
size:
|
|
3044
|
+
size: W,
|
|
3045
3045
|
onClick: he,
|
|
3046
3046
|
children: "Randomize"
|
|
3047
3047
|
}),
|
|
@@ -3052,8 +3052,8 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3052
3052
|
...e,
|
|
3053
3053
|
...t.params,
|
|
3054
3054
|
id: e.id
|
|
3055
|
-
}, i = t.def ?
|
|
3056
|
-
let i = C(r, t.params,
|
|
3055
|
+
}, i = t.def ? M(t.def.params, r) : [], a = (t) => {
|
|
3056
|
+
let i = C(r, t.params, U.take(), { stripNoRandom: !!t.motion }), a = fe.map(({ def: e, ...t }) => t);
|
|
3057
3057
|
f(e.id, { filters: a.map((e, t) => t === n ? {
|
|
3058
3058
|
...e,
|
|
3059
3059
|
params: {
|
|
@@ -3066,14 +3066,14 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3066
3066
|
className: "flex flex-col gap-2",
|
|
3067
3067
|
children: [/* @__PURE__ */ Q(J, {
|
|
3068
3068
|
tone: "grey",
|
|
3069
|
-
size:
|
|
3069
|
+
size: W,
|
|
3070
3070
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3071
3071
|
iconLeft: "trash",
|
|
3072
3072
|
iconRight: "trash",
|
|
3073
|
-
onClick: () =>
|
|
3073
|
+
onClick: () => h(e.id, n),
|
|
3074
3074
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3075
3075
|
}), i.length > 0 && /* @__PURE__ */ Q(ei, {
|
|
3076
|
-
size:
|
|
3076
|
+
size: W,
|
|
3077
3077
|
cells: i.map((e) => ({
|
|
3078
3078
|
value: e.id,
|
|
3079
3079
|
label: e.label,
|
|
@@ -3087,8 +3087,8 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3087
3087
|
className: "flex flex-col gap-2 pt-3",
|
|
3088
3088
|
children: [(() => {
|
|
3089
3089
|
let e = v("motion").TransportBar;
|
|
3090
|
-
return /* @__PURE__ */ Q(e, { size:
|
|
3091
|
-
})(), /* @__PURE__ */ Q(ni, { size:
|
|
3090
|
+
return /* @__PURE__ */ Q(e, { size: W });
|
|
3091
|
+
})(), /* @__PURE__ */ Q(ni, { size: W })]
|
|
3092
3092
|
}),
|
|
3093
3093
|
_e === "output" && /* @__PURE__ */ $("div", {
|
|
3094
3094
|
className: "flex flex-col gap-2 pt-3",
|
|
@@ -3098,7 +3098,7 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3098
3098
|
value: a,
|
|
3099
3099
|
onChange: o,
|
|
3100
3100
|
options: ri,
|
|
3101
|
-
size:
|
|
3101
|
+
size: W,
|
|
3102
3102
|
ariaLabel: "Aspect"
|
|
3103
3103
|
}),
|
|
3104
3104
|
/* @__PURE__ */ Q(Ut, {
|
|
@@ -3106,7 +3106,7 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3106
3106
|
value: a,
|
|
3107
3107
|
onChange: o,
|
|
3108
3108
|
options: ii,
|
|
3109
|
-
size:
|
|
3109
|
+
size: W,
|
|
3110
3110
|
ariaLabel: "Aspect (landscape) and fill"
|
|
3111
3111
|
}),
|
|
3112
3112
|
/* @__PURE__ */ $("div", {
|
|
@@ -3114,25 +3114,25 @@ function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3114
3114
|
children: [
|
|
3115
3115
|
/* @__PURE__ */ Q(J, {
|
|
3116
3116
|
tone: "primary",
|
|
3117
|
-
size:
|
|
3117
|
+
size: W,
|
|
3118
3118
|
onClick: () => gt({ focusName: !0 }),
|
|
3119
3119
|
children: "Save…"
|
|
3120
3120
|
}),
|
|
3121
3121
|
/* @__PURE__ */ Q(J, {
|
|
3122
3122
|
tone: "primary",
|
|
3123
|
-
size:
|
|
3123
|
+
size: W,
|
|
3124
3124
|
onClick: () => g(2),
|
|
3125
3125
|
children: "Download"
|
|
3126
3126
|
}),
|
|
3127
3127
|
/* @__PURE__ */ Q(J, {
|
|
3128
3128
|
tone: "primary",
|
|
3129
|
-
size:
|
|
3129
|
+
size: W,
|
|
3130
3130
|
onClick: () => y(!0),
|
|
3131
3131
|
children: "Hide UI"
|
|
3132
3132
|
}),
|
|
3133
3133
|
/* @__PURE__ */ Q(J, {
|
|
3134
3134
|
tone: "primary",
|
|
3135
|
-
size:
|
|
3135
|
+
size: W,
|
|
3136
3136
|
onClick: r,
|
|
3137
3137
|
children: "Start over"
|
|
3138
3138
|
})
|
|
@@ -3166,45 +3166,45 @@ function oi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3166
3166
|
})]
|
|
3167
3167
|
}) : /* @__PURE__ */ Q("span", {
|
|
3168
3168
|
className: "kol-eyebrow text-body",
|
|
3169
|
-
children:
|
|
3169
|
+
children: pt("randomiser").label
|
|
3170
3170
|
}), /* @__PURE__ */ $("div", {
|
|
3171
3171
|
className: "flex flex-col gap-2",
|
|
3172
3172
|
children: [
|
|
3173
3173
|
/* @__PURE__ */ Q(J, {
|
|
3174
3174
|
tone: "primary",
|
|
3175
3175
|
size: "lg",
|
|
3176
|
-
className:
|
|
3177
|
-
iconLeft:
|
|
3178
|
-
iconRight:
|
|
3176
|
+
className: Pt,
|
|
3177
|
+
iconLeft: yt.randomiser,
|
|
3178
|
+
iconRight: yt.randomiser,
|
|
3179
3179
|
onClick: e,
|
|
3180
3180
|
children: "Generate"
|
|
3181
3181
|
}),
|
|
3182
3182
|
/* @__PURE__ */ Q(J, {
|
|
3183
3183
|
tone: "primary",
|
|
3184
3184
|
size: "lg",
|
|
3185
|
-
className:
|
|
3185
|
+
className: Pt,
|
|
3186
3186
|
iconLeft: "filter",
|
|
3187
3187
|
iconRight: "filter",
|
|
3188
3188
|
onClick: t,
|
|
3189
3189
|
children: "Effects"
|
|
3190
3190
|
}),
|
|
3191
|
-
n &&
|
|
3191
|
+
n && Lt() && /* @__PURE__ */ Q(J, {
|
|
3192
3192
|
tone: "primary",
|
|
3193
3193
|
size: "lg",
|
|
3194
3194
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3195
|
-
iconLeft:
|
|
3196
|
-
iconRight:
|
|
3197
|
-
onClick:
|
|
3198
|
-
children:
|
|
3195
|
+
iconLeft: yt.editor,
|
|
3196
|
+
iconRight: yt.editor,
|
|
3197
|
+
onClick: ht,
|
|
3198
|
+
children: pt("editor").label
|
|
3199
3199
|
}),
|
|
3200
3200
|
n && /* @__PURE__ */ Q(J, {
|
|
3201
3201
|
tone: "primary",
|
|
3202
3202
|
size: "lg",
|
|
3203
3203
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3204
|
-
iconLeft:
|
|
3205
|
-
iconRight:
|
|
3206
|
-
onClick:
|
|
3207
|
-
children:
|
|
3204
|
+
iconLeft: yt.labs,
|
|
3205
|
+
iconRight: yt.labs,
|
|
3206
|
+
onClick: Ht,
|
|
3207
|
+
children: pt("labs").label
|
|
3208
3208
|
}),
|
|
3209
3209
|
n && /* @__PURE__ */ Q(J, {
|
|
3210
3210
|
tone: "primary",
|
|
@@ -3212,7 +3212,7 @@ function oi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3212
3212
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3213
3213
|
iconLeft: "swap",
|
|
3214
3214
|
iconRight: "swap",
|
|
3215
|
-
onClick: () =>
|
|
3215
|
+
onClick: () => Bt("/morph"),
|
|
3216
3216
|
children: "Morph"
|
|
3217
3217
|
})
|
|
3218
3218
|
]
|
|
@@ -3221,10 +3221,10 @@ function oi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3221
3221
|
});
|
|
3222
3222
|
}
|
|
3223
3223
|
function si() {
|
|
3224
|
-
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, canvasW: a, canvasH: o, aspect: s, setAspect: c } =
|
|
3224
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, canvasW: a, canvasH: o, aspect: s, setAspect: c } = m(), { setTool: u } = St(), d = Et() && !Ot(), f = Mt(), h = () => {
|
|
3225
3225
|
let e = new URLSearchParams(window.location.search);
|
|
3226
3226
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3227
|
-
}, [g, _] = Z(
|
|
3227
|
+
}, [g, _] = Z(h), [v, y] = Z(!1), [b, x] = Z(null), [S, C] = Z("contain"), [w, T] = Z(!1), [E, D] = Z(null), [O, k] = Z({
|
|
3228
3228
|
s: 1,
|
|
3229
3229
|
x: 0,
|
|
3230
3230
|
y: 0
|
|
@@ -3263,7 +3263,7 @@ function si() {
|
|
|
3263
3263
|
py: (n.my - a - O.y) / O.s
|
|
3264
3264
|
}, j.current.live = O, i.setStagePointer(null), e.stopPropagation();
|
|
3265
3265
|
}
|
|
3266
|
-
},
|
|
3266
|
+
}, I = (e) => {
|
|
3267
3267
|
let t = j.current;
|
|
3268
3268
|
if (t.pts.has(e.pointerId) && (t.pts.set(e.pointerId, {
|
|
3269
3269
|
x: e.clientX,
|
|
@@ -3277,34 +3277,34 @@ function si() {
|
|
|
3277
3277
|
y: n.my - r.oy - i * r.py
|
|
3278
3278
|
}, A.current && (A.current.style.transform = P(t.live));
|
|
3279
3279
|
}
|
|
3280
|
-
},
|
|
3280
|
+
}, L = (e) => {
|
|
3281
3281
|
let t = M.current;
|
|
3282
|
-
t && t.id === e.pointerId && e.type === "pointerup" && g === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (
|
|
3282
|
+
t && t.id === e.pointerId && e.type === "pointerup" && g === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (R?.type === "loop" ? K(R.loopId) : null)?.group !== "penrose" && i.toggle(), t?.id === e.pointerId && (M.current = null), j.current.pts.delete(e.pointerId), j.current.pts.size < 2 && j.current.start && (j.current.start = null, k(j.current.live));
|
|
3283
3283
|
};
|
|
3284
|
-
on(), Y(() => (
|
|
3284
|
+
on(), Y(() => (et("randomiser"), () => et(null)), []), Y(() => {
|
|
3285
3285
|
c("4:5"), u("orbit");
|
|
3286
3286
|
}, []);
|
|
3287
|
-
let
|
|
3287
|
+
let R = e.find((e) => e.id === b) ?? (e.length === 1 ? e[0] : null), z = g === "live" && R?.type === "photo" && !R.src && R.srcType !== "webcam";
|
|
3288
3288
|
Y(() => {
|
|
3289
|
-
if (!
|
|
3289
|
+
if (!z) return;
|
|
3290
3290
|
let e = (e) => {
|
|
3291
|
-
e.key === "Escape" &&
|
|
3291
|
+
e.key === "Escape" && U();
|
|
3292
3292
|
};
|
|
3293
3293
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
3294
3294
|
}), Y(() => {
|
|
3295
|
-
if (!
|
|
3295
|
+
if (!z) return;
|
|
3296
3296
|
let e = i.isPlaying();
|
|
3297
3297
|
return i.pause(), () => {
|
|
3298
3298
|
e && i.play();
|
|
3299
3299
|
};
|
|
3300
|
-
}, [
|
|
3301
|
-
let
|
|
3302
|
-
let n =
|
|
3300
|
+
}, [z]);
|
|
3301
|
+
let ee = (e) => {
|
|
3302
|
+
let n = ne(e);
|
|
3303
3303
|
n && (x(t("loop", n)), _("live"));
|
|
3304
|
-
},
|
|
3305
|
-
let t =
|
|
3304
|
+
}, B = (e) => {
|
|
3305
|
+
let t = ne(e);
|
|
3306
3306
|
t && b && r(b, t);
|
|
3307
|
-
},
|
|
3307
|
+
}, V = () => {
|
|
3308
3308
|
x(t("photo", {
|
|
3309
3309
|
fit: "cover",
|
|
3310
3310
|
x: 0,
|
|
@@ -3315,28 +3315,28 @@ function si() {
|
|
|
3315
3315
|
};
|
|
3316
3316
|
Y(() => {
|
|
3317
3317
|
let e = new URL(window.location.href), t = e.searchParams.get("start");
|
|
3318
|
-
t && (t === "effects" && (y(!0),
|
|
3318
|
+
t && (t === "effects" && (y(!0), V()), e.searchParams.delete("start"), window.history.replaceState(window.history.state, "", e));
|
|
3319
3319
|
}, []);
|
|
3320
|
-
let
|
|
3320
|
+
let H = (e) => {
|
|
3321
3321
|
if (e === "fill") {
|
|
3322
3322
|
C("cover");
|
|
3323
3323
|
return;
|
|
3324
3324
|
}
|
|
3325
3325
|
C("contain"), c(e);
|
|
3326
|
-
let t =
|
|
3326
|
+
let t = p[e];
|
|
3327
3327
|
b && t && r(b, {
|
|
3328
3328
|
x: 0,
|
|
3329
3329
|
y: 0,
|
|
3330
3330
|
w: l,
|
|
3331
3331
|
h: Math.round(l * t.h / t.w)
|
|
3332
3332
|
});
|
|
3333
|
-
},
|
|
3333
|
+
}, U = () => {
|
|
3334
3334
|
for (let t of [...e]) n(t.id);
|
|
3335
3335
|
x(null), k({
|
|
3336
3336
|
s: 1,
|
|
3337
3337
|
x: 0,
|
|
3338
3338
|
y: 0
|
|
3339
|
-
}), y(!1), _(
|
|
3339
|
+
}), y(!1), _(h());
|
|
3340
3340
|
};
|
|
3341
3341
|
return /* @__PURE__ */ $("div", {
|
|
3342
3342
|
className: "kol-editor-randomiser relative h-dvh bg-black",
|
|
@@ -3351,50 +3351,50 @@ function si() {
|
|
|
3351
3351
|
bottom: E ?? 0
|
|
3352
3352
|
},
|
|
3353
3353
|
onPointerDownCapture: F,
|
|
3354
|
-
onPointerMoveCapture:
|
|
3355
|
-
onPointerUpCapture:
|
|
3356
|
-
onPointerCancelCapture:
|
|
3357
|
-
onPointerLeave:
|
|
3354
|
+
onPointerMoveCapture: I,
|
|
3355
|
+
onPointerUpCapture: L,
|
|
3356
|
+
onPointerCancelCapture: L,
|
|
3357
|
+
onPointerLeave: L,
|
|
3358
3358
|
children: /* @__PURE__ */ Q(_t, { fit: S })
|
|
3359
3359
|
}),
|
|
3360
3360
|
g === "entry" && /* @__PURE__ */ Q(oi, {
|
|
3361
3361
|
chromes: d,
|
|
3362
3362
|
onGenerate: () => _("category"),
|
|
3363
3363
|
onEffects: () => {
|
|
3364
|
-
y(!0),
|
|
3364
|
+
y(!0), V();
|
|
3365
3365
|
}
|
|
3366
3366
|
}),
|
|
3367
3367
|
g === "category" && /* @__PURE__ */ Q(mr, {
|
|
3368
|
-
onPick:
|
|
3369
|
-
onInsert:
|
|
3368
|
+
onPick: ee,
|
|
3369
|
+
onInsert: V,
|
|
3370
3370
|
onBack: () => _("entry")
|
|
3371
3371
|
}),
|
|
3372
|
-
g === "live" && !
|
|
3373
|
-
layer:
|
|
3374
|
-
onSwitchCategory:
|
|
3372
|
+
g === "live" && !z && /* @__PURE__ */ Q(ai, {
|
|
3373
|
+
layer: R,
|
|
3374
|
+
onSwitchCategory: B,
|
|
3375
3375
|
onInsert: () => {
|
|
3376
|
-
|
|
3376
|
+
U(), V();
|
|
3377
3377
|
},
|
|
3378
|
-
onRestart:
|
|
3378
|
+
onRestart: U,
|
|
3379
3379
|
aspectValue: S === "cover" ? "fill" : s,
|
|
3380
|
-
openEffects: v && !
|
|
3381
|
-
onAspect:
|
|
3380
|
+
openEffects: v && !z,
|
|
3381
|
+
onAspect: H,
|
|
3382
3382
|
rail: !d && !f,
|
|
3383
3383
|
onRail: T,
|
|
3384
3384
|
onSheet: D
|
|
3385
3385
|
}),
|
|
3386
|
-
|
|
3386
|
+
z && /* @__PURE__ */ $("div", {
|
|
3387
3387
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col",
|
|
3388
3388
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3389
3389
|
children: [/* @__PURE__ */ Q("div", {
|
|
3390
3390
|
className: "flex-1 min-h-0",
|
|
3391
|
-
children: /* @__PURE__ */ Q(_r, { layer:
|
|
3391
|
+
children: /* @__PURE__ */ Q(_r, { layer: R })
|
|
3392
3392
|
}), /* @__PURE__ */ Q("div", {
|
|
3393
3393
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3394
3394
|
children: /* @__PURE__ */ Q(J, {
|
|
3395
3395
|
tone: "outline",
|
|
3396
3396
|
size: "lg",
|
|
3397
|
-
onClick:
|
|
3397
|
+
onClick: U,
|
|
3398
3398
|
children: "Back"
|
|
3399
3399
|
})
|
|
3400
3400
|
})]
|
|
@@ -3411,11 +3411,11 @@ function ci() {
|
|
|
3411
3411
|
//#endregion
|
|
3412
3412
|
//#region src/index.jsx
|
|
3413
3413
|
function li(e = {}) {
|
|
3414
|
-
return e.variant === "kolbox" ? /* @__PURE__ */ Q(di, { ...e }) : /* @__PURE__ */ Q(
|
|
3414
|
+
return e.variant === "kolbox" ? /* @__PURE__ */ Q(di, { ...e }) : /* @__PURE__ */ Q(Ft, { ...e });
|
|
3415
3415
|
}
|
|
3416
|
-
var ui = $t(() => import("./KolboxView-
|
|
3416
|
+
var ui = $t(() => import("./KolboxView-D-HMCPnW.js"));
|
|
3417
3417
|
function di({ mediaProxyBase: e, mediaClient: t, settingsStore: r, pages: i, account: a }) {
|
|
3418
|
-
return e != null &&
|
|
3418
|
+
return e != null && st(e), t && at(t), Y(() => {
|
|
3419
3419
|
if (r) return n(r), () => n(null);
|
|
3420
3420
|
}, [r]), on(), ln({
|
|
3421
3421
|
client: t ?? null,
|