@kolkrabbi/design-editor 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BindDot-CaZu6Uuz.js → BindDot-Don6fG00.js} +5 -5
- package/dist/{Timeline-BxVRu-R0.js → Timeline-BKYyRqYg.js} +2 -2
- package/dist/{TreePicker-BQYPaQv3.js → TreePicker-1_NZG8GB.js} +1 -1
- package/dist/{core-CLlanqLg.js → core-CQuP1lUU.js} +4976 -6327
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +435 -435
- package/dist/{effectCategories-DJrQJ7vg.js → effectCategories-BGIW_dEc.js} +438 -438
- package/dist/{effects-dbxBWOCp.js → effects-RqPdJrRb.js} +115 -115
- package/dist/effects.js +1 -1
- package/dist/generators-BnuRmK-x.js +11148 -0
- package/dist/generators.js +1 -1
- package/dist/{host-DBTmkJuu.js → host-BUVR9I4S.js} +1 -1
- package/dist/{host-DXizGh-A.js → host-DJ8bDKO7.js} +4 -4
- package/dist/{morphStore-DaOLa9oj.js → morphStore-B5081ohW.js} +1 -1
- package/dist/{motion-CeoqVj9I.js → motion-DKZGyk14.js} +285 -285
- package/dist/motion.js +1 -1
- package/dist/{previewScale-DsG-A1ZC.js → previewScale-CA0ComGv.js} +8 -8
- package/dist/{rolls-CGma4Bua.js → rolls-CEQmdcp3.js} +865 -300
- package/dist/{src-CMdJeS6j.js → src-CzKMsyZO.js} +1 -1
- package/dist/{ColorModesWindow-D65R5YR5.js → store-D6Si8cRD.js} +407 -369
- package/dist/{useLayerEdit-CnPxtfWc.js → useLayerEdit-BF9wI5pX.js} +4 -4
- package/package.json +8 -8
- package/dist/generators-CQQxNX9W.js +0 -3200
package/dist/design-editor.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as A, r as j, t as te } from "./useLayerEdit-
|
|
3
|
-
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-
|
|
4
|
-
import { r as ue } from "./TreePicker-
|
|
5
|
-
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-
|
|
6
|
-
import {
|
|
7
|
-
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-
|
|
8
|
-
import { n as rt, r as it, t as at } from "./BindDot-
|
|
9
|
-
import { n as ot, r as st } from "./effects-
|
|
10
|
-
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-
|
|
11
|
-
import { n as pt, r as mt, t as ht } from "./Timeline-
|
|
12
|
-
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, a as Wt, at as Gt, b as Kt, c as qt, ct as Jt, d as Yt, dt as Xt, et as Zt, f as Qt, ft as $t, g as en, h as tn, i as nn, it as rn, j as an, k as on, l as sn, lt as cn, m as ln, n as un, nt as dn, o as fn, ot as pn, p as mn, pt as hn, q as gn, r as _n, rt as vn, s as yn, st as bn, t as xn, tt as Sn, u as Cn, ut as wn, v as Tn, w as En, x as Dn, y as On, z as kn } from "./core-
|
|
1
|
+
import { An as e, B as t, Bn as n, D as r, F as i, I as a, J as o, L as s, Lt as c, Mn as l, P as u, Vn as d, _n as f, a as p, d as m, f as h, ft as g, gt as _, ht as v, i as y, j as b, jn as x, kn as S, mn as C, n as w, nn as T, o as E, p as D, pn as O, r as ee, vn as k } from "./rolls-CEQmdcp3.js";
|
|
2
|
+
import { n as A, r as j, t as te } from "./useLayerEdit-BF9wI5pX.js";
|
|
3
|
+
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-BGIW_dEc.js";
|
|
4
|
+
import { r as ue } from "./TreePicker-1_NZG8GB.js";
|
|
5
|
+
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-BnuRmK-x.js";
|
|
6
|
+
import { A as Te, C as Ee, D as De, E as Oe, M as ke, O as Ae, S as je, T as Me, _ as Ne, b as Pe, c as Fe, h as Ie, j as Le, k as Re, l as ze, m as Be, u as Ve, v as He, w as Ue, y as We } from "./store-D6Si8cRD.js";
|
|
7
|
+
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-B5081ohW.js";
|
|
8
|
+
import { n as rt, r as it, t as at } from "./BindDot-Don6fG00.js";
|
|
9
|
+
import { n as ot, r as st } from "./effects-RqPdJrRb.js";
|
|
10
|
+
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-DKZGyk14.js";
|
|
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, a as Wt, at as Gt, b as Kt, c as qt, ct as Jt, d as Yt, dt as Xt, et as Zt, f as Qt, ft as $t, g as en, h as tn, i as nn, it as rn, j as an, k as on, l as sn, lt as cn, m as ln, n as un, nt as dn, o as fn, ot as pn, p as mn, pt as hn, q as gn, r as _n, rt as vn, s as yn, st as bn, t as xn, tt as Sn, u as Cn, ut as wn, v as Tn, w as En, x as Dn, y as On, z as kn } from "./core-CQuP1lUU.js";
|
|
13
13
|
import { Button as K, Divider as An, Dropdown as jn, LabeledControlSection as q, MultiSelect as Mn, SegmentedToggle as J, SettingsRow as Nn, StepList as Pn, Tag as Fn, ToggleSwitch as In, Tooltip as Ln, useGrabEdge as Rn, useModal as zn } from "@kolkrabbi/kol-component";
|
|
14
14
|
import { createContext as Bn, useContext as Vn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Hn } from "react";
|
|
15
15
|
import { Fragment as Un, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
@@ -290,7 +290,7 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
290
290
|
id: "color",
|
|
291
291
|
label: "Color",
|
|
292
292
|
icon: "clr-tri",
|
|
293
|
-
onSelect:
|
|
293
|
+
onSelect: Fe,
|
|
294
294
|
pages: []
|
|
295
295
|
},
|
|
296
296
|
{
|
|
@@ -387,9 +387,9 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
387
387
|
//#endregion
|
|
388
388
|
//#region src/editor/labs/LabsNav.jsx
|
|
389
389
|
function gr() {
|
|
390
|
-
let { addFilter: e, patchFilter: t } =
|
|
390
|
+
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
391
391
|
Y(() => {
|
|
392
|
-
n?.type === "photo" && n.src && (
|
|
392
|
+
n?.type === "photo" && n.src && (i.current = {
|
|
393
393
|
src: n.src,
|
|
394
394
|
srcType: n.srcType,
|
|
395
395
|
fit: n.fit
|
|
@@ -400,7 +400,7 @@ function gr() {
|
|
|
400
400
|
n?.srcType,
|
|
401
401
|
n?.fit
|
|
402
402
|
]);
|
|
403
|
-
let
|
|
403
|
+
let a = hr({
|
|
404
404
|
layer: n,
|
|
405
405
|
setOnly: r,
|
|
406
406
|
addFilter: e,
|
|
@@ -409,11 +409,11 @@ function gr() {
|
|
|
409
409
|
src: n.src,
|
|
410
410
|
srcType: n.srcType,
|
|
411
411
|
fit: n.fit
|
|
412
|
-
} :
|
|
412
|
+
} : i.current ?? {}
|
|
413
413
|
});
|
|
414
414
|
return Y(() => {
|
|
415
415
|
let e = /* @__PURE__ */ new Map(), t = [];
|
|
416
|
-
return
|
|
416
|
+
return a.forEach((n) => {
|
|
417
417
|
if (n.id.startsWith("sec:")) {
|
|
418
418
|
let e = n.id.slice(4);
|
|
419
419
|
t.push({
|
|
@@ -477,7 +477,7 @@ var _r = (e, t) => JSON.stringify(e) === JSON.stringify(t), vr = [
|
|
|
477
477
|
}
|
|
478
478
|
];
|
|
479
479
|
function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
480
|
-
let
|
|
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 } = Lt(), { addItem: w, updateItem: T } = He(), E = zn(), 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) => !Ct(U(e.loopId)) || !zt(U(e.loopId))), P = N.length === 0, F = {
|
|
481
481
|
blend: ne ? null : "Blend tweens one generator — these steps are different generators",
|
|
482
482
|
shape: P ? null : `No outline to morph: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`,
|
|
483
483
|
crossfade: P ? null : `Cannot fade: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`
|
|
@@ -556,9 +556,9 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
556
556
|
cycle: u,
|
|
557
557
|
curve: l,
|
|
558
558
|
resolution: p,
|
|
559
|
-
syncLoop:
|
|
560
|
-
name:
|
|
561
|
-
},
|
|
559
|
+
syncLoop: i.syncLoop,
|
|
560
|
+
name: i.fileName
|
|
561
|
+
}, a = d === "blend" ? {
|
|
562
562
|
...n,
|
|
563
563
|
...$e({
|
|
564
564
|
snapshots: c.map((e) => e.params),
|
|
@@ -577,7 +577,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
577
577
|
keys: Dt(c.length, u, l)
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
|
-
e ? _(e.id,
|
|
580
|
+
e ? _(e.id, a) : S("loop", a);
|
|
581
581
|
}, R = X(L);
|
|
582
582
|
R.current = L;
|
|
583
583
|
let ie = JSON.stringify([
|
|
@@ -586,7 +586,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
586
586
|
l,
|
|
587
587
|
u,
|
|
588
588
|
p,
|
|
589
|
-
|
|
589
|
+
i.syncLoop
|
|
590
590
|
]), ae = X(null);
|
|
591
591
|
Y(() => {
|
|
592
592
|
t || m != null || ie === ae.current || c.length >= 2 && F[d] || (ae.current = ie, R.current());
|
|
@@ -606,7 +606,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
606
606
|
m,
|
|
607
607
|
t
|
|
608
608
|
]), Y(() => () => {
|
|
609
|
-
!t &&
|
|
609
|
+
!t && i.editing != null && (G({ editing: null }), R.current());
|
|
610
610
|
}, []);
|
|
611
611
|
let z = (e) => {
|
|
612
612
|
let t = c[e];
|
|
@@ -630,15 +630,15 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
630
630
|
value: d,
|
|
631
631
|
onChange: (e) => !t && G({ mode: e }),
|
|
632
632
|
options: I,
|
|
633
|
-
size:
|
|
634
|
-
className: r
|
|
633
|
+
size: r,
|
|
634
|
+
className: a(r)
|
|
635
635
|
}),
|
|
636
636
|
!t && /* @__PURE__ */ Q(q, {
|
|
637
637
|
divided: !0,
|
|
638
638
|
children: /* @__PURE__ */ Q(ue, {
|
|
639
639
|
tree: or(),
|
|
640
640
|
presets: ar(),
|
|
641
|
-
current: cr(
|
|
641
|
+
current: cr(i.presetId) ?? { typeLabel: $n.find((e) => e.id === d)?.label },
|
|
642
642
|
subLabel: (e) => e.split(" · ").pop(),
|
|
643
643
|
onPick: lr
|
|
644
644
|
})
|
|
@@ -654,7 +654,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
654
654
|
activeIndex: m,
|
|
655
655
|
reorder: "grab",
|
|
656
656
|
readOnly: t,
|
|
657
|
-
size:
|
|
657
|
+
size: r,
|
|
658
658
|
onSelect: z,
|
|
659
659
|
onRemove: Ye,
|
|
660
660
|
onMove: Ge,
|
|
@@ -683,8 +683,8 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
683
683
|
value: k,
|
|
684
684
|
onChange: j,
|
|
685
685
|
options: n,
|
|
686
|
-
size:
|
|
687
|
-
className: r
|
|
686
|
+
size: r,
|
|
687
|
+
className: a(r)
|
|
688
688
|
}),
|
|
689
689
|
/* @__PURE__ */ Q(ye, {
|
|
690
690
|
layer: e,
|
|
@@ -709,7 +709,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
709
709
|
}),
|
|
710
710
|
/* @__PURE__ */ Q(A, {
|
|
711
711
|
schema: vr,
|
|
712
|
-
layer:
|
|
712
|
+
layer: i,
|
|
713
713
|
setProp: (e, n) => {
|
|
714
714
|
!t && (typeof n != "object" || !n) && G({ [e]: n });
|
|
715
715
|
},
|
|
@@ -719,11 +719,11 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
719
719
|
divided: !0,
|
|
720
720
|
children: /* @__PURE__ */ Q(K, {
|
|
721
721
|
tone: "primary",
|
|
722
|
-
size:
|
|
722
|
+
size: r,
|
|
723
723
|
className: "w-full",
|
|
724
724
|
onClick: async () => {
|
|
725
725
|
if (c.length < 2) return;
|
|
726
|
-
let e =
|
|
726
|
+
let e = i.fileName;
|
|
727
727
|
if (!h && (e = await E.prompt("Name this morph:", ""), e === null)) return;
|
|
728
728
|
m != null && (G({ editing: null }), R.current());
|
|
729
729
|
let t = {
|
|
@@ -731,12 +731,12 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
731
731
|
mode: "morph",
|
|
732
732
|
morph: {
|
|
733
733
|
mode: d,
|
|
734
|
-
loopId:
|
|
734
|
+
loopId: i.loopId,
|
|
735
735
|
steps: c,
|
|
736
736
|
curve: l,
|
|
737
737
|
cycle: u,
|
|
738
738
|
resolution: p,
|
|
739
|
-
syncLoop:
|
|
739
|
+
syncLoop: i.syncLoop,
|
|
740
740
|
seconds: O.getLoopSeconds()
|
|
741
741
|
}
|
|
742
742
|
};
|
|
@@ -779,25 +779,25 @@ var br = [
|
|
|
779
779
|
}
|
|
780
780
|
], xr = .2;
|
|
781
781
|
function Sr(e) {
|
|
782
|
-
if (!
|
|
782
|
+
if (!r(e)) return "off";
|
|
783
783
|
if (e.bind !== "mod") return "custom";
|
|
784
|
-
let
|
|
785
|
-
return
|
|
784
|
+
let t = br.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
785
|
+
return t ? t.value : "custom";
|
|
786
786
|
}
|
|
787
|
-
function Cr({ schema: e, layer: t, setProp:
|
|
788
|
-
let
|
|
789
|
-
if (!
|
|
790
|
-
let c = (e,
|
|
787
|
+
function Cr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
788
|
+
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
|
+
if (!o.length) return null;
|
|
790
|
+
let c = (e, r) => {
|
|
791
791
|
let i = t[e.key];
|
|
792
|
-
if (
|
|
793
|
-
let
|
|
794
|
-
|
|
792
|
+
if (r === "off") {
|
|
793
|
+
let r = i?.transform?.range;
|
|
794
|
+
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : b(i, O.getCtx(), t) ?? e.default ?? e.min);
|
|
795
795
|
return;
|
|
796
796
|
}
|
|
797
|
-
let a = br.find((e) => e.value ===
|
|
797
|
+
let a = br.find((e) => e.value === r);
|
|
798
798
|
if (!a) return;
|
|
799
|
-
let o = Number(
|
|
800
|
-
|
|
799
|
+
let o = Number(b(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) * xr, c = Math.max(e.min, o - s), l = Math.min(e.max, o + s);
|
|
800
|
+
n(e.key, {
|
|
801
801
|
bind: "mod",
|
|
802
802
|
source: a.source,
|
|
803
803
|
transform: {
|
|
@@ -807,10 +807,10 @@ function Cr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
807
807
|
});
|
|
808
808
|
};
|
|
809
809
|
return /* @__PURE__ */ Q(q, {
|
|
810
|
-
label:
|
|
810
|
+
label: r,
|
|
811
811
|
divided: !0,
|
|
812
|
-
children:
|
|
813
|
-
let
|
|
812
|
+
children: o.map((e) => {
|
|
813
|
+
let n = Sr(t[e.key]), r = [
|
|
814
814
|
{
|
|
815
815
|
value: "off",
|
|
816
816
|
label: "Off"
|
|
@@ -819,7 +819,7 @@ function Cr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
819
819
|
value: e,
|
|
820
820
|
label: t
|
|
821
821
|
})),
|
|
822
|
-
...
|
|
822
|
+
...n === "custom" ? [{
|
|
823
823
|
value: "custom",
|
|
824
824
|
label: "Custom"
|
|
825
825
|
}] : []
|
|
@@ -827,13 +827,13 @@ function Cr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
827
827
|
return /* @__PURE__ */ Q(Nn, {
|
|
828
828
|
label: e.label,
|
|
829
829
|
align: "fill",
|
|
830
|
-
labelWidth:
|
|
830
|
+
labelWidth: i,
|
|
831
831
|
children: /* @__PURE__ */ Q(jn, {
|
|
832
|
-
size:
|
|
832
|
+
size: a,
|
|
833
833
|
variant: "subtle",
|
|
834
834
|
className: "w-full",
|
|
835
|
-
options:
|
|
836
|
-
value:
|
|
835
|
+
options: r,
|
|
836
|
+
value: n,
|
|
837
837
|
onChange: (t) => t !== "custom" && c(e, t)
|
|
838
838
|
})
|
|
839
839
|
}, e.key);
|
|
@@ -868,18 +868,18 @@ var wr = [
|
|
|
868
868
|
label: "LFO"
|
|
869
869
|
}
|
|
870
870
|
], Tr = new Set(wr.map((e) => e.value));
|
|
871
|
-
function Er({ schema: e, layer:
|
|
872
|
-
let
|
|
873
|
-
if (!
|
|
874
|
-
let c = new Map(
|
|
875
|
-
let
|
|
876
|
-
return
|
|
871
|
+
function Er({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
872
|
+
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
|
+
if (!o.length) return null;
|
|
874
|
+
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
|
+
let n = t[e];
|
|
876
|
+
return r(n) && n.bind === "mod" && Tr.has(n.source);
|
|
877
877
|
}, p = u.filter(f), m = (e) => {
|
|
878
|
-
let
|
|
879
|
-
return Number(
|
|
880
|
-
}, h = (e, i, a = t
|
|
878
|
+
let n = c.get(e);
|
|
879
|
+
return Number(b(t[e], O.getCtx(), t) ?? n.default ?? n.min);
|
|
880
|
+
}, h = (e, i, a = r(t[e]) ? t[e].transform?.base ?? m(e) : m(e)) => {
|
|
881
881
|
let o = c.get(e);
|
|
882
|
-
|
|
882
|
+
k(i)?.ensure?.().catch(() => {}), n(e, {
|
|
883
883
|
bind: "mod",
|
|
884
884
|
source: i,
|
|
885
885
|
transform: {
|
|
@@ -888,12 +888,12 @@ function Er({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
888
888
|
...i.startsWith("lfo") ? { rate: 1 } : {}
|
|
889
889
|
}
|
|
890
890
|
});
|
|
891
|
-
}, g = (e) =>
|
|
891
|
+
}, g = (e) => n(e, r(t[e]) ? t[e].transform?.base ?? m(e) : m(e)), v = d.find((e) => !f(e)) ?? u.find((e) => !f(e));
|
|
892
892
|
return /* @__PURE__ */ $(q, {
|
|
893
893
|
label: "Inputs",
|
|
894
894
|
divided: !0,
|
|
895
895
|
children: [p.map((e) => /* @__PURE__ */ Q(Mn, {
|
|
896
|
-
size:
|
|
896
|
+
size: a,
|
|
897
897
|
className: "w-full [&>button]:w-full",
|
|
898
898
|
groups: [{
|
|
899
899
|
id: "source",
|
|
@@ -908,24 +908,24 @@ function Er({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
908
908
|
}))
|
|
909
909
|
}],
|
|
910
910
|
value: {
|
|
911
|
-
source:
|
|
911
|
+
source: t[e].source,
|
|
912
912
|
drives: e
|
|
913
913
|
},
|
|
914
|
-
label: `${wr.find((
|
|
915
|
-
onChange: (
|
|
916
|
-
if (
|
|
914
|
+
label: `${wr.find((n) => n.value === t[e].source)?.label} → ${c.get(e).label}`,
|
|
915
|
+
onChange: (n, r) => {
|
|
916
|
+
if (n === "source") {
|
|
917
917
|
r === "off" ? g(e) : h(e, r);
|
|
918
918
|
return;
|
|
919
919
|
}
|
|
920
920
|
if (r === e || f(r)) return;
|
|
921
|
-
let i =
|
|
921
|
+
let i = t[e].source;
|
|
922
922
|
g(e), h(r, i);
|
|
923
923
|
}
|
|
924
|
-
}, e)),
|
|
925
|
-
size:
|
|
924
|
+
}, e)), v && /* @__PURE__ */ Q(K, {
|
|
925
|
+
size: a,
|
|
926
926
|
iconLeft: "plus",
|
|
927
927
|
className: "w-full",
|
|
928
|
-
onClick: () => h(
|
|
928
|
+
onClick: () => h(v, "mouseX"),
|
|
929
929
|
children: "Add input"
|
|
930
930
|
})]
|
|
931
931
|
});
|
|
@@ -934,7 +934,7 @@ function Er({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
934
934
|
//#region src/editor/labs/ModelSource.jsx
|
|
935
935
|
var Dr = /\.(obj|glb|gltf|stl)$/i, Or = (e) => Dr.test(e.key ?? e.name ?? ""), kr = (e) => (e.match(Dr)?.[1] ?? "obj").toLowerCase(), Ar = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
936
936
|
function jr({ layer: e, setProp: t }) {
|
|
937
|
-
let n =
|
|
937
|
+
let n = s(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
938
938
|
t("meshSrc", e), t("meshType", n);
|
|
939
939
|
};
|
|
940
940
|
return /* @__PURE__ */ $(q, {
|
|
@@ -955,12 +955,12 @@ function jr({ layer: e, setProp: t }) {
|
|
|
955
955
|
}), /* @__PURE__ */ Q(K, {
|
|
956
956
|
tone: "primary",
|
|
957
957
|
size: n,
|
|
958
|
-
onClick: () =>
|
|
958
|
+
onClick: () => a.current?.click(),
|
|
959
959
|
children: "Upload"
|
|
960
960
|
})]
|
|
961
961
|
}),
|
|
962
962
|
/* @__PURE__ */ Q("input", {
|
|
963
|
-
ref:
|
|
963
|
+
ref: a,
|
|
964
964
|
type: "file",
|
|
965
965
|
accept: ".obj,.glb,.gltf,.stl",
|
|
966
966
|
className: "hidden",
|
|
@@ -968,7 +968,7 @@ function jr({ layer: e, setProp: t }) {
|
|
|
968
968
|
let t = e.target.files?.[0];
|
|
969
969
|
if (e.target.value = "", !t) return;
|
|
970
970
|
let n = new FileReader();
|
|
971
|
-
n.onload = () =>
|
|
971
|
+
n.onload = () => o(n.result, kr(t.name)), n.readAsDataURL(t);
|
|
972
972
|
}
|
|
973
973
|
}),
|
|
974
974
|
/* @__PURE__ */ Q(Ut, {
|
|
@@ -976,7 +976,7 @@ function jr({ layer: e, setProp: t }) {
|
|
|
976
976
|
accept: Or,
|
|
977
977
|
onClose: () => i(!1),
|
|
978
978
|
onSelect: (e) => {
|
|
979
|
-
i(!1),
|
|
979
|
+
i(!1), o(On(e), kr(e));
|
|
980
980
|
}
|
|
981
981
|
})
|
|
982
982
|
]
|
|
@@ -1027,9 +1027,9 @@ var Nr = [{
|
|
|
1027
1027
|
label: "Anim"
|
|
1028
1028
|
}
|
|
1029
1029
|
];
|
|
1030
|
-
function Ir({ options: e, active: t, onPick: n, spread:
|
|
1031
|
-
let
|
|
1032
|
-
return e?.length ?
|
|
1030
|
+
function Ir({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
|
|
1031
|
+
let o = s();
|
|
1032
|
+
return e?.length ? i ? /* @__PURE__ */ Q("div", {
|
|
1033
1033
|
className: "flex items-center gap-1 flex-wrap",
|
|
1034
1034
|
children: e.map((e) => /* @__PURE__ */ Q(Fn, {
|
|
1035
1035
|
size: "xs",
|
|
@@ -1043,32 +1043,32 @@ function Ir({ options: e, active: t, onPick: n, spread: i = !1, pills: o = !1 })
|
|
|
1043
1043
|
value: t ?? null,
|
|
1044
1044
|
onChange: n,
|
|
1045
1045
|
options: e,
|
|
1046
|
-
size:
|
|
1046
|
+
size: o,
|
|
1047
1047
|
ariaLabel: "Siblings",
|
|
1048
|
-
className:
|
|
1048
|
+
className: a(o)
|
|
1049
1049
|
}) : null;
|
|
1050
1050
|
}
|
|
1051
1051
|
function Lr() {
|
|
1052
|
-
let { undo: e, redo: t, canUndo: n, canRedo: r } =
|
|
1052
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = s(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1053
1053
|
"aria-hidden": "true",
|
|
1054
1054
|
className: "invisible pointer-events-none",
|
|
1055
1055
|
children: t
|
|
1056
1056
|
});
|
|
1057
|
-
return /* @__PURE__ */ $(Un, { children: [
|
|
1057
|
+
return /* @__PURE__ */ $(Un, { children: [a(n, /* @__PURE__ */ Q(Ln, {
|
|
1058
1058
|
label: "Undo",
|
|
1059
1059
|
shortcut: "⌘Z",
|
|
1060
1060
|
children: /* @__PURE__ */ Q(K, {
|
|
1061
|
-
size:
|
|
1061
|
+
size: i,
|
|
1062
1062
|
iconOnly: "arrow-left",
|
|
1063
1063
|
"aria-label": "Undo",
|
|
1064
1064
|
tabIndex: n ? void 0 : -1,
|
|
1065
1065
|
onClick: e
|
|
1066
1066
|
})
|
|
1067
|
-
})),
|
|
1067
|
+
})), a(r, /* @__PURE__ */ Q(Ln, {
|
|
1068
1068
|
label: "Redo",
|
|
1069
1069
|
shortcut: "⇧⌘Z",
|
|
1070
1070
|
children: /* @__PURE__ */ Q(K, {
|
|
1071
|
-
size:
|
|
1071
|
+
size: i,
|
|
1072
1072
|
iconOnly: "arrow-right",
|
|
1073
1073
|
"aria-label": "Redo",
|
|
1074
1074
|
tabIndex: r ? void 0 : -1,
|
|
@@ -1076,25 +1076,25 @@ function Lr() {
|
|
|
1076
1076
|
})
|
|
1077
1077
|
}))] });
|
|
1078
1078
|
}
|
|
1079
|
-
function Rr({ chips: e, active: t, onPick:
|
|
1080
|
-
let m =
|
|
1079
|
+
function Rr({ 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
|
+
let m = s() === "sm";
|
|
1081
1081
|
return /* @__PURE__ */ $("div", {
|
|
1082
1082
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
1083
1083
|
"data-label-scope": d,
|
|
1084
1084
|
children: [
|
|
1085
|
-
|
|
1085
|
+
o && m && /* @__PURE__ */ $("div", {
|
|
1086
1086
|
className: "flex items-center gap-1",
|
|
1087
1087
|
children: [/* @__PURE__ */ Q("p", {
|
|
1088
1088
|
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
1089
|
-
children:
|
|
1089
|
+
children: o
|
|
1090
1090
|
}), /* @__PURE__ */ Q(Lr, {})]
|
|
1091
1091
|
}),
|
|
1092
1092
|
e && /* @__PURE__ */ Q(Ir, {
|
|
1093
1093
|
options: e,
|
|
1094
1094
|
active: t,
|
|
1095
|
-
onPick:
|
|
1096
|
-
spread:
|
|
1097
|
-
pills:
|
|
1095
|
+
onPick: n,
|
|
1096
|
+
spread: r,
|
|
1097
|
+
pills: a
|
|
1098
1098
|
}),
|
|
1099
1099
|
l,
|
|
1100
1100
|
c,
|
|
@@ -1104,33 +1104,33 @@ function Rr({ chips: e, active: t, onPick: r, spread: i, pills: o, title: s, tab
|
|
|
1104
1104
|
className: "invisible h-0 overflow-hidden flex flex-col",
|
|
1105
1105
|
children: f.map((e, t) => /* @__PURE__ */ Q("span", {
|
|
1106
1106
|
className: "kol-helper-10 tracking-widest whitespace-nowrap",
|
|
1107
|
-
style: { width:
|
|
1107
|
+
style: { width: i },
|
|
1108
1108
|
children: String(e).toUpperCase()
|
|
1109
1109
|
}, t))
|
|
1110
1110
|
})
|
|
1111
1111
|
]
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
|
-
function zr({ layer:
|
|
1115
|
-
let
|
|
1114
|
+
function zr({ layer: t, showMod: n }) {
|
|
1115
|
+
let r = l(), c = s(), [u, d] = Z("effect");
|
|
1116
1116
|
Y(() => {
|
|
1117
|
-
let e = () =>
|
|
1117
|
+
let e = () => d("effect");
|
|
1118
1118
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
1119
1119
|
}, []);
|
|
1120
|
-
let { addFilter:
|
|
1120
|
+
let { addFilter: f, replaceFilter: m, removeFilter: _, toggleFilter: y, updateLayer: b, palette: x } = o(), S = te(t.id, { history: "coalesce" }), C = g(t), T = C.findIndex((e) => !e.def?.first), E = T < 0 ? C.length : T, O = T < 0 ? null : C[T], ee = oe(L).find((e) => e.id === B(O?.id)), k = ee?.id === "halftone", M = k ? (ee?.filters ?? []).map((e) => ({
|
|
1121
1121
|
value: e.id,
|
|
1122
1122
|
label: e.label
|
|
1123
|
-
})) : null, ne = !k &&
|
|
1124
|
-
if (!
|
|
1125
|
-
|
|
1123
|
+
})) : null, ne = !k && O ? O.def.label : null, N = (e) => {
|
|
1124
|
+
if (!O) {
|
|
1125
|
+
f(t.id, e);
|
|
1126
1126
|
return;
|
|
1127
1127
|
}
|
|
1128
|
-
|
|
1129
|
-
}, P =
|
|
1130
|
-
...
|
|
1131
|
-
...
|
|
1132
|
-
id:
|
|
1133
|
-
} :
|
|
1128
|
+
e !== O.id && m(t.id, E, e);
|
|
1129
|
+
}, P = C.map(({ def: e, ...t }) => t), F = O ? {
|
|
1130
|
+
...t,
|
|
1131
|
+
...O.params,
|
|
1132
|
+
id: t.id
|
|
1133
|
+
} : t, I = (e) => (t, n) => {
|
|
1134
1134
|
let r = P.map((r, i) => i === e ? {
|
|
1135
1135
|
...r,
|
|
1136
1136
|
params: {
|
|
@@ -1138,41 +1138,41 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1138
1138
|
[t]: n
|
|
1139
1139
|
}
|
|
1140
1140
|
} : r);
|
|
1141
|
-
|
|
1142
|
-
}, R = I(
|
|
1141
|
+
S.patch({ filters: r });
|
|
1142
|
+
}, R = I(E), ie = n ? (e) => /* @__PURE__ */ Q(at, {
|
|
1143
1143
|
layer: F,
|
|
1144
1144
|
param: e,
|
|
1145
1145
|
setProp: R
|
|
1146
|
-
}) : void 0, z = (
|
|
1147
|
-
let n = P.map((
|
|
1148
|
-
...
|
|
1146
|
+
}) : void 0, z = (e) => {
|
|
1147
|
+
let n = P.map((t, n) => n === E ? {
|
|
1148
|
+
...t,
|
|
1149
1149
|
params: {
|
|
1150
|
-
...
|
|
1151
|
-
...
|
|
1150
|
+
...t.params,
|
|
1151
|
+
...e
|
|
1152
1152
|
}
|
|
1153
|
-
} :
|
|
1154
|
-
|
|
1153
|
+
} : t);
|
|
1154
|
+
b(t.id, { filters: n });
|
|
1155
1155
|
};
|
|
1156
1156
|
Mr(() => {
|
|
1157
|
-
|
|
1157
|
+
O && b(t.id, { filters: P.map((e, t) => t === 0 ? {
|
|
1158
1158
|
...e,
|
|
1159
1159
|
params: {}
|
|
1160
1160
|
} : e) });
|
|
1161
1161
|
}, () => {
|
|
1162
|
-
|
|
1162
|
+
O && z(p(F, w(O.def.params, F), D()));
|
|
1163
1163
|
});
|
|
1164
|
-
let V =
|
|
1164
|
+
let V = t.fxGroup ? se.find((e) => e.id === t.fxGroup) : null;
|
|
1165
1165
|
if (V) {
|
|
1166
|
-
let
|
|
1167
|
-
chain:
|
|
1168
|
-
layer:
|
|
1166
|
+
let e = {
|
|
1167
|
+
chain: C,
|
|
1168
|
+
layer: t,
|
|
1169
1169
|
hostView: F,
|
|
1170
|
-
toggleFilter:
|
|
1171
|
-
removeFilter:
|
|
1170
|
+
toggleFilter: y,
|
|
1171
|
+
removeFilter: _,
|
|
1172
1172
|
setStagePropAt: I,
|
|
1173
|
-
palette:
|
|
1174
|
-
showMod:
|
|
1175
|
-
},
|
|
1173
|
+
palette: x,
|
|
1174
|
+
showMod: n
|
|
1175
|
+
}, r = [{
|
|
1176
1176
|
value: "",
|
|
1177
1177
|
label: "Add effect…"
|
|
1178
1178
|
}, ...re(V, L).map((e) => ({
|
|
@@ -1184,47 +1184,47 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1184
1184
|
fx: !0,
|
|
1185
1185
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1186
1186
|
tone: "sunken",
|
|
1187
|
-
value:
|
|
1188
|
-
onChange:
|
|
1187
|
+
value: u,
|
|
1188
|
+
onChange: d,
|
|
1189
1189
|
options: Nr,
|
|
1190
|
-
size:
|
|
1191
|
-
className:
|
|
1190
|
+
size: c,
|
|
1191
|
+
className: a(c)
|
|
1192
1192
|
}),
|
|
1193
|
-
children: [
|
|
1193
|
+
children: [u === "effect" && /* @__PURE__ */ $(Un, { children: [
|
|
1194
1194
|
/* @__PURE__ */ $(q, {
|
|
1195
1195
|
label: "Effect stack",
|
|
1196
1196
|
divided: !0,
|
|
1197
|
-
children: [
|
|
1197
|
+
children: [C.length === 0 && /* @__PURE__ */ Q(j, {
|
|
1198
1198
|
className: "kol-mono-10 text-meta",
|
|
1199
1199
|
children: "No effects yet — add one below."
|
|
1200
1200
|
}), /* @__PURE__ */ Q(Ur, {
|
|
1201
|
-
...
|
|
1201
|
+
...e,
|
|
1202
1202
|
from: 0
|
|
1203
1203
|
})]
|
|
1204
1204
|
}),
|
|
1205
1205
|
/* @__PURE__ */ Q(An, {}),
|
|
1206
|
-
|
|
1206
|
+
C.length < 8 && /* @__PURE__ */ Q(q, {
|
|
1207
1207
|
label: V.label,
|
|
1208
1208
|
divided: !0,
|
|
1209
1209
|
children: /* @__PURE__ */ Q(jn, {
|
|
1210
1210
|
variant: "subtle",
|
|
1211
|
-
size:
|
|
1211
|
+
size: c,
|
|
1212
1212
|
className: "w-full",
|
|
1213
|
-
options:
|
|
1213
|
+
options: r,
|
|
1214
1214
|
value: "",
|
|
1215
|
-
onChange: (
|
|
1216
|
-
|
|
1215
|
+
onChange: (e) => {
|
|
1216
|
+
e && f(t.id, e);
|
|
1217
1217
|
}
|
|
1218
1218
|
})
|
|
1219
1219
|
})
|
|
1220
|
-
] }),
|
|
1221
|
-
sweeps: Array.isArray(
|
|
1220
|
+
] }), u === "anim" && O?.def?.sweeps && /* @__PURE__ */ Q(st, {
|
|
1221
|
+
sweeps: Array.isArray(O.params.sweeps) ? O.params.sweeps : [],
|
|
1222
1222
|
onChange: (e) => R("sweeps", e),
|
|
1223
1223
|
inline: !0
|
|
1224
1224
|
})]
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
1227
|
-
if (!
|
|
1227
|
+
if (!O) return /* @__PURE__ */ Q(Rr, {
|
|
1228
1228
|
chips: M,
|
|
1229
1229
|
active: null,
|
|
1230
1230
|
onPick: N,
|
|
@@ -1232,27 +1232,27 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1232
1232
|
fx: !0,
|
|
1233
1233
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1234
1234
|
tone: "sunken",
|
|
1235
|
-
value:
|
|
1236
|
-
onChange:
|
|
1235
|
+
value: u,
|
|
1236
|
+
onChange: d,
|
|
1237
1237
|
options: Nr,
|
|
1238
|
-
size:
|
|
1239
|
-
className:
|
|
1238
|
+
size: c,
|
|
1239
|
+
className: a(c)
|
|
1240
1240
|
}),
|
|
1241
1241
|
children: /* @__PURE__ */ Q(A, {
|
|
1242
1242
|
schema: en,
|
|
1243
|
-
layer:
|
|
1244
|
-
setProp:
|
|
1245
|
-
palette:
|
|
1246
|
-
renderAnimate: (
|
|
1247
|
-
layer:
|
|
1248
|
-
param:
|
|
1249
|
-
setProp:
|
|
1243
|
+
layer: t,
|
|
1244
|
+
setProp: S.setProp,
|
|
1245
|
+
palette: x,
|
|
1246
|
+
renderAnimate: (e) => /* @__PURE__ */ Q(at, {
|
|
1247
|
+
layer: t,
|
|
1248
|
+
param: e,
|
|
1249
|
+
setProp: S.setProp
|
|
1250
1250
|
}),
|
|
1251
|
-
tab:
|
|
1251
|
+
tab: u === "anim" ? "anim" : "style",
|
|
1252
1252
|
emptyHint: "Pick an effect from the nav."
|
|
1253
1253
|
})
|
|
1254
1254
|
});
|
|
1255
|
-
let H =
|
|
1255
|
+
let H = O.def.params.filter((e) => v(e) !== "anim"), U = ae(O.def.id), le = U ? H.findIndex((e) => e.key === U) : -1, ue = H.length;
|
|
1256
1256
|
if (le >= 0) {
|
|
1257
1257
|
let e = le;
|
|
1258
1258
|
for (; e + 1 < H.length && H[e + 1].type === "select";) e++;
|
|
@@ -1264,28 +1264,28 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1264
1264
|
})) : H, pe = {
|
|
1265
1265
|
layer: F,
|
|
1266
1266
|
setProp: R,
|
|
1267
|
-
palette:
|
|
1267
|
+
palette: x,
|
|
1268
1268
|
renderAnimate: ie,
|
|
1269
1269
|
inline: !0
|
|
1270
1270
|
};
|
|
1271
1271
|
return /* @__PURE__ */ $(Rr, {
|
|
1272
1272
|
chips: M,
|
|
1273
|
-
active:
|
|
1273
|
+
active: O.id,
|
|
1274
1274
|
onPick: N,
|
|
1275
1275
|
spread: k,
|
|
1276
1276
|
title: ne,
|
|
1277
1277
|
fx: !0,
|
|
1278
|
-
scope:
|
|
1279
|
-
ghostLabels:
|
|
1278
|
+
scope: O.id,
|
|
1279
|
+
ghostLabels: O.def.params.map((e) => e.label).filter(Boolean),
|
|
1280
1280
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1281
1281
|
tone: "sunken",
|
|
1282
|
-
value:
|
|
1283
|
-
onChange:
|
|
1282
|
+
value: u,
|
|
1283
|
+
onChange: d,
|
|
1284
1284
|
options: Nr,
|
|
1285
|
-
size:
|
|
1286
|
-
className:
|
|
1285
|
+
size: c,
|
|
1286
|
+
className: a(c)
|
|
1287
1287
|
}),
|
|
1288
|
-
children: [
|
|
1288
|
+
children: [u === "effect" && /* @__PURE__ */ $(Un, { children: [
|
|
1289
1289
|
W.length > 0 && /* @__PURE__ */ Q(A, {
|
|
1290
1290
|
schema: W,
|
|
1291
1291
|
...pe
|
|
@@ -1297,7 +1297,7 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1297
1297
|
...pe
|
|
1298
1298
|
}), /* @__PURE__ */ Q(ot, {
|
|
1299
1299
|
inline: !0,
|
|
1300
|
-
def:
|
|
1300
|
+
def: O.def,
|
|
1301
1301
|
view: F,
|
|
1302
1302
|
tab: "effect",
|
|
1303
1303
|
onPatch: z,
|
|
@@ -1306,35 +1306,35 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1306
1306
|
["type", "Type"],
|
|
1307
1307
|
["category", "Category"],
|
|
1308
1308
|
["preset", "Preset"]
|
|
1309
|
-
].filter(([e]) => _e(
|
|
1309
|
+
].filter(([e]) => _e(O.def, e)).map(([e, n]) => /* @__PURE__ */ Q(K, {
|
|
1310
1310
|
tone: "primary",
|
|
1311
|
-
size:
|
|
1311
|
+
size: c,
|
|
1312
1312
|
className: "flex-1 min-w-0",
|
|
1313
1313
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
1314
1314
|
onClick: () => {
|
|
1315
|
-
let n =
|
|
1316
|
-
if (
|
|
1317
|
-
let e = de(
|
|
1318
|
-
e != null && z(ce(
|
|
1315
|
+
let n = h(D() >>> 0);
|
|
1316
|
+
if (e === "preset") {
|
|
1317
|
+
let e = de(O.def, F, n);
|
|
1318
|
+
e != null && z(ce(O.def, e));
|
|
1319
1319
|
return;
|
|
1320
1320
|
}
|
|
1321
|
-
let r = me(
|
|
1322
|
-
r &&
|
|
1321
|
+
let r = me(O.id, e, n);
|
|
1322
|
+
r && m(t.id, E, r);
|
|
1323
1323
|
},
|
|
1324
1324
|
children: n
|
|
1325
|
-
},
|
|
1325
|
+
}, e)),
|
|
1326
1326
|
/* @__PURE__ */ Q(K, {
|
|
1327
1327
|
tone: "primary",
|
|
1328
|
-
size:
|
|
1328
|
+
size: c,
|
|
1329
1329
|
className: "flex-1 min-w-0",
|
|
1330
1330
|
"aria-label": "Randomize settings",
|
|
1331
1331
|
onClick: () => {
|
|
1332
|
-
z(he(F,
|
|
1332
|
+
z(he(F, w(O.def.params.filter((e) => v(e) !== "anim"), F), h(D() >>> 0)));
|
|
1333
1333
|
},
|
|
1334
1334
|
children: "Settings"
|
|
1335
1335
|
}),
|
|
1336
1336
|
/* @__PURE__ */ Q(Se, {
|
|
1337
|
-
def:
|
|
1337
|
+
def: O.def,
|
|
1338
1338
|
isFilter: !0
|
|
1339
1339
|
})
|
|
1340
1340
|
] })
|
|
@@ -1346,41 +1346,41 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1346
1346
|
...pe
|
|
1347
1347
|
}), /* @__PURE__ */ Q(An, {})] }),
|
|
1348
1348
|
/* @__PURE__ */ Q(Wr, {
|
|
1349
|
-
chain:
|
|
1350
|
-
from:
|
|
1351
|
-
layer:
|
|
1349
|
+
chain: C,
|
|
1350
|
+
from: E + 1,
|
|
1351
|
+
layer: t,
|
|
1352
1352
|
hostView: F,
|
|
1353
|
-
addFilter:
|
|
1354
|
-
removeFilter:
|
|
1355
|
-
toggleFilter:
|
|
1353
|
+
addFilter: f,
|
|
1354
|
+
removeFilter: _,
|
|
1355
|
+
toggleFilter: y,
|
|
1356
1356
|
setStagePropAt: I,
|
|
1357
|
-
palette:
|
|
1358
|
-
showMod:
|
|
1357
|
+
palette: x,
|
|
1358
|
+
showMod: n
|
|
1359
1359
|
})
|
|
1360
|
-
] }),
|
|
1360
|
+
] }), u === "anim" && /* @__PURE__ */ $(Un, { children: [
|
|
1361
1361
|
/* @__PURE__ */ Q(Er, {
|
|
1362
|
-
schema:
|
|
1362
|
+
schema: O.def.params,
|
|
1363
1363
|
layer: F,
|
|
1364
1364
|
setProp: R,
|
|
1365
|
-
inputs:
|
|
1365
|
+
inputs: O.def.inputs
|
|
1366
1366
|
}),
|
|
1367
1367
|
/* @__PURE__ */ Q(A, {
|
|
1368
|
-
schema:
|
|
1368
|
+
schema: O.def.params,
|
|
1369
1369
|
...pe,
|
|
1370
1370
|
tab: "anim"
|
|
1371
1371
|
}),
|
|
1372
|
-
|
|
1372
|
+
O.def.orbit && /* @__PURE__ */ Q(q, {
|
|
1373
1373
|
label: "Interaction",
|
|
1374
1374
|
divided: !0,
|
|
1375
1375
|
children: /* @__PURE__ */ Q(Nn, {
|
|
1376
1376
|
label: "ORBIT (C)",
|
|
1377
1377
|
align: "fill",
|
|
1378
|
-
labelWidth:
|
|
1378
|
+
labelWidth: i,
|
|
1379
1379
|
children: /* @__PURE__ */ Q(J, {
|
|
1380
1380
|
tone: "sunken",
|
|
1381
|
-
size:
|
|
1381
|
+
size: c,
|
|
1382
1382
|
className: "w-full",
|
|
1383
|
-
value:
|
|
1383
|
+
value: r.grab && F.orbit !== !1 ? "on" : "off",
|
|
1384
1384
|
options: [{
|
|
1385
1385
|
value: "off",
|
|
1386
1386
|
label: "Off"
|
|
@@ -1388,8 +1388,8 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1388
1388
|
value: "on",
|
|
1389
1389
|
label: "On"
|
|
1390
1390
|
}],
|
|
1391
|
-
onChange: (
|
|
1392
|
-
R("orbit",
|
|
1391
|
+
onChange: (t) => {
|
|
1392
|
+
R("orbit", t === "on"), t === "on" && !r.grab && e("grab", !0);
|
|
1393
1393
|
}
|
|
1394
1394
|
})
|
|
1395
1395
|
})
|
|
@@ -1398,46 +1398,46 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1398
1398
|
divided: !0,
|
|
1399
1399
|
children: /* @__PURE__ */ Q(ot, {
|
|
1400
1400
|
inline: !0,
|
|
1401
|
-
def:
|
|
1401
|
+
def: O.def,
|
|
1402
1402
|
view: F,
|
|
1403
1403
|
tab: "anim",
|
|
1404
1404
|
onPatch: z
|
|
1405
1405
|
})
|
|
1406
1406
|
}),
|
|
1407
|
-
|
|
1408
|
-
sweeps: Array.isArray(
|
|
1407
|
+
O.def.sweeps && /* @__PURE__ */ Q(st, {
|
|
1408
|
+
sweeps: Array.isArray(O.params.sweeps) ? O.params.sweeps : [],
|
|
1409
1409
|
onChange: (e) => R("sweeps", e),
|
|
1410
1410
|
inline: !0
|
|
1411
1411
|
}),
|
|
1412
1412
|
/* @__PURE__ */ Q(Cr, {
|
|
1413
|
-
schema:
|
|
1413
|
+
schema: O.def.params,
|
|
1414
1414
|
layer: F,
|
|
1415
1415
|
setProp: R
|
|
1416
1416
|
}),
|
|
1417
1417
|
/* @__PURE__ */ Q(Hr, {
|
|
1418
|
-
chain:
|
|
1419
|
-
layer:
|
|
1418
|
+
chain: C,
|
|
1419
|
+
layer: t,
|
|
1420
1420
|
hostView: F,
|
|
1421
|
-
addFilter:
|
|
1422
|
-
removeFilter:
|
|
1421
|
+
addFilter: f,
|
|
1422
|
+
removeFilter: _,
|
|
1423
1423
|
setStagePropAt: I,
|
|
1424
|
-
palette:
|
|
1425
|
-
showMod:
|
|
1424
|
+
palette: x,
|
|
1425
|
+
showMod: n
|
|
1426
1426
|
})
|
|
1427
1427
|
] })]
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
1430
|
var Br = L.filter((e) => !e.kind && !e.first);
|
|
1431
1431
|
function Vr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1432
|
-
let { addFilter:
|
|
1432
|
+
let { addFilter: i, removeFilter: a, toggleFilter: s } = o(), c = g(e), l = c.map(({ def: e, ...t }) => t);
|
|
1433
1433
|
return /* @__PURE__ */ Q(Wr, {
|
|
1434
1434
|
chain: c,
|
|
1435
1435
|
from: 0,
|
|
1436
1436
|
filters: Br,
|
|
1437
1437
|
layer: e,
|
|
1438
1438
|
hostView: e,
|
|
1439
|
-
addFilter:
|
|
1440
|
-
removeFilter:
|
|
1439
|
+
addFilter: i,
|
|
1440
|
+
removeFilter: a,
|
|
1441
1441
|
toggleFilter: s,
|
|
1442
1442
|
setStagePropAt: (e) => (n, r) => t.patch({ filters: l.map((t, i) => i === e ? {
|
|
1443
1443
|
...t,
|
|
@@ -1450,12 +1450,12 @@ function Vr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1450
1450
|
showMod: r
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
1453
|
-
function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt:
|
|
1454
|
-
let l =
|
|
1453
|
+
function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: a, palette: o, showMod: c }) {
|
|
1454
|
+
let l = s(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1455
1455
|
...n,
|
|
1456
1456
|
...d.params,
|
|
1457
1457
|
id: t.id
|
|
1458
|
-
} : null, p = d ?
|
|
1458
|
+
} : null, p = d ? a(u) : null;
|
|
1459
1459
|
return /* @__PURE__ */ Q(q, {
|
|
1460
1460
|
label: "Media",
|
|
1461
1461
|
divided: !0,
|
|
@@ -1463,7 +1463,7 @@ function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1463
1463
|
schema: d.def.params,
|
|
1464
1464
|
layer: f,
|
|
1465
1465
|
setProp: p,
|
|
1466
|
-
palette:
|
|
1466
|
+
palette: o,
|
|
1467
1467
|
inline: !0,
|
|
1468
1468
|
renderAnimate: c ? (e) => /* @__PURE__ */ Q(at, {
|
|
1469
1469
|
layer: f,
|
|
@@ -1489,14 +1489,14 @@ function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1489
1489
|
})
|
|
1490
1490
|
});
|
|
1491
1491
|
}
|
|
1492
|
-
function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter:
|
|
1493
|
-
let u =
|
|
1494
|
-
return e.slice(t).map((e,
|
|
1495
|
-
let d =
|
|
1492
|
+
function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: c, showMod: l }) {
|
|
1493
|
+
let u = s();
|
|
1494
|
+
return e.slice(t).map((e, s) => {
|
|
1495
|
+
let d = s + t, f = e.enabled !== !1, p = {
|
|
1496
1496
|
...r,
|
|
1497
1497
|
...e.params,
|
|
1498
1498
|
id: n.id
|
|
1499
|
-
}, m =
|
|
1499
|
+
}, m = o(d);
|
|
1500
1500
|
return /* @__PURE__ */ $("div", {
|
|
1501
1501
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1502
1502
|
children: [/* @__PURE__ */ $("div", {
|
|
@@ -1516,11 +1516,11 @@ function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1516
1516
|
iconOnly: "x",
|
|
1517
1517
|
"aria-label": "Delete effect",
|
|
1518
1518
|
className: "ml-auto shrink-0",
|
|
1519
|
-
onClick: () =>
|
|
1519
|
+
onClick: () => a(n.id, d)
|
|
1520
1520
|
})
|
|
1521
1521
|
})]
|
|
1522
1522
|
}), f && e.def && /* @__PURE__ */ Q(A, {
|
|
1523
|
-
schema: e.def.params.filter((e) =>
|
|
1523
|
+
schema: e.def.params.filter((e) => v(e) !== "anim"),
|
|
1524
1524
|
layer: p,
|
|
1525
1525
|
setProp: m,
|
|
1526
1526
|
palette: c,
|
|
@@ -1534,8 +1534,8 @@ function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1534
1534
|
}, e.key ?? d);
|
|
1535
1535
|
});
|
|
1536
1536
|
}
|
|
1537
|
-
function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter:
|
|
1538
|
-
let f =
|
|
1537
|
+
function Wr({ 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
|
+
let f = s(), p = [{
|
|
1539
1539
|
value: "",
|
|
1540
1540
|
label: "Add FX…"
|
|
1541
1541
|
}, ...(n ?? I(L)).map((e) => ({
|
|
@@ -1551,7 +1551,7 @@ function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1551
1551
|
layer: r,
|
|
1552
1552
|
hostView: i,
|
|
1553
1553
|
toggleFilter: c,
|
|
1554
|
-
removeFilter:
|
|
1554
|
+
removeFilter: o,
|
|
1555
1555
|
setStagePropAt: l,
|
|
1556
1556
|
palette: u,
|
|
1557
1557
|
showMod: d
|
|
@@ -1562,84 +1562,84 @@ function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1562
1562
|
options: p,
|
|
1563
1563
|
value: "",
|
|
1564
1564
|
onChange: (e) => {
|
|
1565
|
-
e &&
|
|
1565
|
+
e && a(r.id, e);
|
|
1566
1566
|
}
|
|
1567
1567
|
})]
|
|
1568
1568
|
});
|
|
1569
1569
|
}
|
|
1570
1570
|
function Gr({ layer: e, showMod: t, tree: n }) {
|
|
1571
|
-
let
|
|
1571
|
+
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
1572
|
value: e.id,
|
|
1573
1573
|
label: e.label
|
|
1574
|
-
})) : null,
|
|
1574
|
+
})) : null, x = (t) => {
|
|
1575
1575
|
let n = y?.find((e) => e.id === t);
|
|
1576
|
-
n && t !== e.presetId &&
|
|
1577
|
-
},
|
|
1578
|
-
m &&
|
|
1576
|
+
n && t !== e.presetId && d(e.type, H(n, e.loopGroup));
|
|
1577
|
+
}, S = () => {
|
|
1578
|
+
m && d(e.type, H(m, e.loopGroup));
|
|
1579
1579
|
};
|
|
1580
|
-
return Mr(
|
|
1580
|
+
return Mr(S, () => {
|
|
1581
1581
|
let t = U(e.loopId)?.params ?? [];
|
|
1582
|
-
l(e.id,
|
|
1582
|
+
l(e.id, p(e, w(t, e), D(), { withFilters: !0 }));
|
|
1583
1583
|
}), /* @__PURE__ */ $(Rr, {
|
|
1584
1584
|
title: v,
|
|
1585
1585
|
chips: b,
|
|
1586
1586
|
active: e.presetId,
|
|
1587
|
-
onPick:
|
|
1587
|
+
onPick: x,
|
|
1588
1588
|
pills: !0,
|
|
1589
1589
|
scope: e.loopId,
|
|
1590
1590
|
ghostLabels: (U(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1591
1591
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1592
1592
|
tone: "sunken",
|
|
1593
|
-
value:
|
|
1593
|
+
value: i,
|
|
1594
1594
|
onChange: c,
|
|
1595
|
-
options:
|
|
1596
|
-
size:
|
|
1597
|
-
className: r
|
|
1595
|
+
options: r === "sm" ? Pr : Fr,
|
|
1596
|
+
size: r,
|
|
1597
|
+
className: a(r)
|
|
1598
1598
|
}),
|
|
1599
1599
|
children: [
|
|
1600
|
-
|
|
1600
|
+
i === "anim" && /* @__PURE__ */ Q(Er, {
|
|
1601
1601
|
schema: U(e.loopId)?.params ?? [],
|
|
1602
1602
|
layer: e,
|
|
1603
|
-
setProp:
|
|
1603
|
+
setProp: f.setProp,
|
|
1604
1604
|
inputs: U(e.loopId)?.inputs
|
|
1605
1605
|
}),
|
|
1606
1606
|
/* @__PURE__ */ Q(ye, {
|
|
1607
1607
|
layer: e,
|
|
1608
|
-
setProp:
|
|
1609
|
-
patch:
|
|
1608
|
+
setProp: f.setProp,
|
|
1609
|
+
patch: f.patch,
|
|
1610
1610
|
updateLayer: l,
|
|
1611
1611
|
palette: u,
|
|
1612
1612
|
renderAnimate: t ? (t) => /* @__PURE__ */ Q(at, {
|
|
1613
1613
|
layer: e,
|
|
1614
1614
|
param: t,
|
|
1615
|
-
setProp:
|
|
1615
|
+
setProp: f.setProp
|
|
1616
1616
|
}) : void 0,
|
|
1617
|
-
tab:
|
|
1617
|
+
tab: i,
|
|
1618
1618
|
tabStrip: null,
|
|
1619
1619
|
tree: n,
|
|
1620
1620
|
inline: !0,
|
|
1621
|
-
onReset:
|
|
1621
|
+
onReset: S
|
|
1622
1622
|
}),
|
|
1623
|
-
|
|
1623
|
+
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(jr, {
|
|
1624
1624
|
layer: e,
|
|
1625
|
-
setProp:
|
|
1625
|
+
setProp: f.setProp
|
|
1626
1626
|
}),
|
|
1627
|
-
|
|
1627
|
+
i === "style" && /* @__PURE__ */ Q(Vr, {
|
|
1628
1628
|
layer: e,
|
|
1629
|
-
edit:
|
|
1629
|
+
edit: f,
|
|
1630
1630
|
palette: u,
|
|
1631
1631
|
showMod: t
|
|
1632
1632
|
}),
|
|
1633
|
-
|
|
1633
|
+
i === "anim" && /* @__PURE__ */ Q(Cr, {
|
|
1634
1634
|
schema: U(e.loopId)?.params ?? [],
|
|
1635
1635
|
layer: e,
|
|
1636
|
-
setProp:
|
|
1636
|
+
setProp: f.setProp
|
|
1637
1637
|
})
|
|
1638
1638
|
]
|
|
1639
1639
|
});
|
|
1640
1640
|
}
|
|
1641
1641
|
function Kr({ layer: e, showMod: t }) {
|
|
1642
|
-
let n =
|
|
1642
|
+
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
1643
|
return Mr(() => {
|
|
1644
1644
|
f && u("kinetic", {
|
|
1645
1645
|
presetId: f.id,
|
|
@@ -1647,7 +1647,7 @@ function Kr({ layer: e, showMod: t }) {
|
|
|
1647
1647
|
comp: dt(f)
|
|
1648
1648
|
});
|
|
1649
1649
|
}, () => {
|
|
1650
|
-
let t =
|
|
1650
|
+
let t = D(), n = h(t >>> 0), r = e.comp ?? { instances: [] };
|
|
1651
1651
|
(r.instances ?? []).forEach((e, t) => {
|
|
1652
1652
|
r = ft(r, t, n);
|
|
1653
1653
|
}), c(e.id, {
|
|
@@ -1658,11 +1658,11 @@ function Kr({ layer: e, showMod: t }) {
|
|
|
1658
1658
|
title: p,
|
|
1659
1659
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1660
1660
|
tone: "sunken",
|
|
1661
|
-
value:
|
|
1662
|
-
onChange:
|
|
1661
|
+
value: r,
|
|
1662
|
+
onChange: i,
|
|
1663
1663
|
options: n === "sm" ? Pr : Fr,
|
|
1664
1664
|
size: n,
|
|
1665
|
-
className:
|
|
1665
|
+
className: a(n)
|
|
1666
1666
|
}),
|
|
1667
1667
|
children: /* @__PURE__ */ Q(ut, {
|
|
1668
1668
|
layer: e,
|
|
@@ -1674,13 +1674,13 @@ function Kr({ layer: e, showMod: t }) {
|
|
|
1674
1674
|
param: t,
|
|
1675
1675
|
setProp: d.setProp
|
|
1676
1676
|
}) : () => null,
|
|
1677
|
-
tab:
|
|
1677
|
+
tab: r,
|
|
1678
1678
|
tabStrip: null
|
|
1679
1679
|
})
|
|
1680
1680
|
});
|
|
1681
1681
|
}
|
|
1682
1682
|
function qr() {
|
|
1683
|
-
let { layer: e } = W(), t = nt(), n =
|
|
1683
|
+
let { layer: e } = W(), t = nt(), n = s(), r = it();
|
|
1684
1684
|
return Y(() => {
|
|
1685
1685
|
let e = (e) => {
|
|
1686
1686
|
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || kn(e) || rt();
|
|
@@ -2065,7 +2065,7 @@ function si(e) {
|
|
|
2065
2065
|
pill: e.presetLabel
|
|
2066
2066
|
};
|
|
2067
2067
|
if (e.type === "photo") {
|
|
2068
|
-
let t =
|
|
2068
|
+
let t = g(e)[0]?.def?.label ?? "Media";
|
|
2069
2069
|
return {
|
|
2070
2070
|
title: t,
|
|
2071
2071
|
pill: t
|
|
@@ -2087,7 +2087,7 @@ var ci = .85, li = .3, ui = 2.5, di = {
|
|
|
2087
2087
|
4: 2
|
|
2088
2088
|
}, fi = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2089
2089
|
function pi() {
|
|
2090
|
-
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction:
|
|
2090
|
+
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction: i, commitTransaction: a, select: s } = o(), [c, l] = Z(null);
|
|
2091
2091
|
Y(() => {
|
|
2092
2092
|
let e = (e) => {
|
|
2093
2093
|
let { id: t, index: r } = e.detail || {};
|
|
@@ -2106,31 +2106,31 @@ function pi() {
|
|
|
2106
2106
|
c,
|
|
2107
2107
|
s
|
|
2108
2108
|
]);
|
|
2109
|
-
let
|
|
2110
|
-
C.current =
|
|
2111
|
-
let e =
|
|
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 = St(m), _ = X(null), v = (e) => Math.min(ui, Math.max(li, e)), y = (e) => p((t) => v(t * (e > 0 ? 1.25 : .8))), { tool: b } = gn(), x = b === "orbit", C = X(x);
|
|
2110
|
+
C.current = x, Y(() => {
|
|
2111
|
+
let e = _.current;
|
|
2112
2112
|
if (!e) return;
|
|
2113
2113
|
let t = (e) => {
|
|
2114
|
-
C.current || (e.preventDefault(), !
|
|
2114
|
+
C.current || (e.preventDefault(), !S().zoomLock && p((t) => v(t * (e.deltaY > 0 ? .94 : 1.06))));
|
|
2115
2115
|
};
|
|
2116
2116
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2117
2117
|
}, []), Y(() => {
|
|
2118
2118
|
let e = (e) => {
|
|
2119
2119
|
if (!(e.metaKey || e.ctrlKey || e.altKey) && !kn(e)) {
|
|
2120
2120
|
if (e.key === "f" || e.key === "F") {
|
|
2121
|
-
|
|
2121
|
+
h((e) => !e);
|
|
2122
2122
|
return;
|
|
2123
2123
|
}
|
|
2124
|
-
if (!(
|
|
2124
|
+
if (!(S().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || di[e.key] !== void 0))) {
|
|
2125
2125
|
if (e.key === "-" || e.key === "_") {
|
|
2126
|
-
|
|
2126
|
+
y(-1);
|
|
2127
2127
|
return;
|
|
2128
2128
|
}
|
|
2129
2129
|
if (e.key === "+" || e.key === "=") {
|
|
2130
|
-
|
|
2130
|
+
y(1);
|
|
2131
2131
|
return;
|
|
2132
2132
|
}
|
|
2133
|
-
di[e.key] !== void 0 &&
|
|
2133
|
+
di[e.key] !== void 0 && p(di[e.key]);
|
|
2134
2134
|
}
|
|
2135
2135
|
}
|
|
2136
2136
|
};
|
|
@@ -2144,11 +2144,11 @@ function pi() {
|
|
|
2144
2144
|
start: null,
|
|
2145
2145
|
tap: null
|
|
2146
2146
|
}), D = X({
|
|
2147
|
-
zoom:
|
|
2147
|
+
zoom: f,
|
|
2148
2148
|
pan: w
|
|
2149
2149
|
});
|
|
2150
2150
|
D.current = {
|
|
2151
|
-
zoom:
|
|
2151
|
+
zoom: f,
|
|
2152
2152
|
pan: w
|
|
2153
2153
|
};
|
|
2154
2154
|
let ee = (e) => {
|
|
@@ -2163,7 +2163,7 @@ function pi() {
|
|
|
2163
2163
|
y: e.clientY,
|
|
2164
2164
|
at: performance.now()
|
|
2165
2165
|
} : null, t.pts.size === 2) {
|
|
2166
|
-
let [n, r] = [...t.pts.values()], i =
|
|
2166
|
+
let [n, r] = [...t.pts.values()], i = _.current.getBoundingClientRect(), a = i.left + i.width / 2, o = i.top + i.height / 2, s = (n.x + r.x) / 2, c = (n.y + r.y) / 2, { zoom: l, pan: u } = D.current;
|
|
2167
2167
|
t.start = {
|
|
2168
2168
|
d: Math.hypot(n.x - r.x, n.y - r.y),
|
|
2169
2169
|
cx: a,
|
|
@@ -2180,8 +2180,8 @@ function pi() {
|
|
|
2180
2180
|
y: e.clientY
|
|
2181
2181
|
}), t.pts.size >= 2 && t.start)) {
|
|
2182
2182
|
e.stopPropagation();
|
|
2183
|
-
let [n, r] = [...t.pts.values()], i = t.start, a =
|
|
2184
|
-
|
|
2183
|
+
let [n, r] = [...t.pts.values()], i = t.start, a = S().zoomLock ? i.z0 : v(i.z0 * (Math.hypot(n.x - r.x, n.y - r.y) / i.d)), o = (n.x + r.x) / 2, s = (n.y + r.y) / 2;
|
|
2184
|
+
p(a), T({
|
|
2185
2185
|
x: o - i.cx - a * i.qx,
|
|
2186
2186
|
y: s - i.cy - a * i.qy
|
|
2187
2187
|
});
|
|
@@ -2193,11 +2193,11 @@ function pi() {
|
|
|
2193
2193
|
r && r.id === t.pointerId && t.type === "pointerup" && !n.start && performance.now() - r.at < 350 && Math.hypot(t.clientX - r.x, t.clientY - r.y) < 12 && (e?.type === "loop" ? U(e.loopId) : null)?.group !== "penrose" && O.toggle(), r?.id === t.pointerId && (n.tap = null), n.pts.delete(t.pointerId), n.pts.size < 2 && (n.start = null);
|
|
2194
2194
|
};
|
|
2195
2195
|
return /* @__PURE__ */ $("div", {
|
|
2196
|
-
ref:
|
|
2196
|
+
ref: _,
|
|
2197
2197
|
className: "relative w-full h-full flex items-center justify-center overflow-hidden touch-none",
|
|
2198
2198
|
style: { background: "var(--kol-surface-secondary)" },
|
|
2199
2199
|
onDoubleClick: () => {
|
|
2200
|
-
|
|
2200
|
+
p(1), T({
|
|
2201
2201
|
x: 0,
|
|
2202
2202
|
y: 0
|
|
2203
2203
|
});
|
|
@@ -2210,32 +2210,32 @@ function pi() {
|
|
|
2210
2210
|
/* @__PURE__ */ Q("div", {
|
|
2211
2211
|
style: {
|
|
2212
2212
|
flex: "none",
|
|
2213
|
-
width: `${
|
|
2214
|
-
height: `${
|
|
2213
|
+
width: `${f * ci * 100}%`,
|
|
2214
|
+
height: `${f * ci * 100}%`,
|
|
2215
2215
|
transform: `translate(${w.x}px, ${w.y}px)`
|
|
2216
2216
|
},
|
|
2217
|
-
children: /* @__PURE__ */ Q(Yt, { overlay:
|
|
2218
|
-
layer:
|
|
2217
|
+
children: /* @__PURE__ */ Q(Yt, { overlay: u ? (e) => /* @__PURE__ */ Q(yt, {
|
|
2218
|
+
layer: u,
|
|
2219
2219
|
initialIndex: c.index,
|
|
2220
2220
|
toVirtual: e,
|
|
2221
2221
|
updateLayer: r,
|
|
2222
|
-
beginTransaction:
|
|
2223
|
-
commitTransaction:
|
|
2222
|
+
beginTransaction: i,
|
|
2223
|
+
commitTransaction: a,
|
|
2224
2224
|
onExit: () => l(null)
|
|
2225
2225
|
}) : void 0 })
|
|
2226
2226
|
}),
|
|
2227
|
-
|
|
2227
|
+
d && /* @__PURE__ */ Q($r, {
|
|
2228
2228
|
layer: e,
|
|
2229
2229
|
title: si(e).title,
|
|
2230
2230
|
onBack: () => t(e.id)
|
|
2231
2231
|
}),
|
|
2232
|
-
|
|
2232
|
+
m && /* @__PURE__ */ Q("div", {
|
|
2233
2233
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2234
2234
|
children: /* @__PURE__ */ Q(Ln, {
|
|
2235
2235
|
label: "Framerate — press F to hide",
|
|
2236
2236
|
children: /* @__PURE__ */ $("span", {
|
|
2237
2237
|
className: fi,
|
|
2238
|
-
children: [
|
|
2238
|
+
children: [g, " fps"]
|
|
2239
2239
|
})
|
|
2240
2240
|
})
|
|
2241
2241
|
})
|
|
@@ -2315,7 +2315,7 @@ var _i = [
|
|
|
2315
2315
|
16
|
|
2316
2316
|
];
|
|
2317
2317
|
function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2318
|
-
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } =
|
|
2318
|
+
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } = C(), [f, p] = Z(!0), m = [
|
|
2319
2319
|
{
|
|
2320
2320
|
icon: "home-01",
|
|
2321
2321
|
path: "#home",
|
|
@@ -2453,67 +2453,67 @@ var bi = {
|
|
|
2453
2453
|
} : e)]
|
|
2454
2454
|
};
|
|
2455
2455
|
function Si() {
|
|
2456
|
-
let { setAspect:
|
|
2456
|
+
let { setAspect: t, selectedId: n, select: r } = o(), { layer: i, setOnly: a } = W(), s = X(!1), c = Zt(Et), d = Ht() && !dn() || c;
|
|
2457
2457
|
Y(() => {
|
|
2458
|
-
|
|
2459
|
-
}, [
|
|
2460
|
-
let [
|
|
2458
|
+
d && document.documentElement.removeAttribute("data-rail");
|
|
2459
|
+
}, [d]);
|
|
2460
|
+
let [f, p] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ? ni.tall : ni.half, y = { "--kol-sheet-h": v }, b = Qn(), x = nt(), [C, w] = Z(() => !i);
|
|
2461
2461
|
Y(() => {
|
|
2462
|
-
|
|
2463
|
-
}, [
|
|
2464
|
-
let [
|
|
2462
|
+
w(!i);
|
|
2463
|
+
}, [i?.id]);
|
|
2464
|
+
let [T, E] = Z(null), D = i?.type === "photo" && (!!i.src || i.srcType === "webcam");
|
|
2465
2465
|
Y(() => {
|
|
2466
|
-
|
|
2467
|
-
}, [
|
|
2468
|
-
|
|
2469
|
-
}, [
|
|
2470
|
-
if (!
|
|
2466
|
+
T && D && w(!0);
|
|
2467
|
+
}, [T, D]), Y(() => {
|
|
2468
|
+
i || E(null);
|
|
2469
|
+
}, [i]), Y(() => {
|
|
2470
|
+
if (!i || d) return;
|
|
2471
2471
|
let e = 0, t = 0;
|
|
2472
2472
|
return e = requestAnimationFrame(() => {
|
|
2473
2473
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2474
2474
|
}), () => {
|
|
2475
2475
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2476
2476
|
};
|
|
2477
|
-
}, [
|
|
2478
|
-
if (!x.active ||
|
|
2477
|
+
}, [i?.id]), Y(() => {
|
|
2478
|
+
if (!x.active || d) return;
|
|
2479
2479
|
let e = 0, t = 0;
|
|
2480
2480
|
return e = requestAnimationFrame(() => {
|
|
2481
2481
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2482
2482
|
}), () => {
|
|
2483
2483
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2484
2484
|
};
|
|
2485
|
-
}, [x.active,
|
|
2485
|
+
}, [x.active, d]), Y(() => Rt((e) => a("photo", {
|
|
2486
2486
|
src: e.url,
|
|
2487
2487
|
srcType: e.srcType
|
|
2488
2488
|
})), [a]), Y(() => {
|
|
2489
|
-
if (!
|
|
2490
|
-
let e = () =>
|
|
2489
|
+
if (!d) return;
|
|
2490
|
+
let e = () => p(!0);
|
|
2491
2491
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2492
2492
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2493
2493
|
};
|
|
2494
|
-
}, [
|
|
2495
|
-
if (
|
|
2496
|
-
|
|
2497
|
-
let
|
|
2498
|
-
|
|
2494
|
+
}, [d]), Ot(), Y(() => (Xt("labs"), () => Xt(null)), []), Y(() => {
|
|
2495
|
+
if (s.current) return;
|
|
2496
|
+
s.current = !0;
|
|
2497
|
+
let e = S();
|
|
2498
|
+
e.defaultAspect && e.defaultAspect !== "custom" && t(e.defaultAspect), e.defaultLoopSeconds && O.setLoopSeconds(e.defaultLoopSeconds);
|
|
2499
2499
|
}, []);
|
|
2500
|
-
let
|
|
2500
|
+
let ee = X(!1);
|
|
2501
2501
|
Y(() => {
|
|
2502
|
-
if (
|
|
2503
|
-
|
|
2502
|
+
if (ee.current) return;
|
|
2503
|
+
ee.current = !0;
|
|
2504
2504
|
let e = wt();
|
|
2505
2505
|
if (e.open || e.fresh) return;
|
|
2506
2506
|
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? V(t) : null;
|
|
2507
2507
|
n && a("loop", H(M(t), n));
|
|
2508
2508
|
}, [a]);
|
|
2509
|
-
let { clearHistory: k } =
|
|
2509
|
+
let { clearHistory: k } = o();
|
|
2510
2510
|
Y(() => {
|
|
2511
2511
|
let e = setTimeout(k, 800);
|
|
2512
2512
|
return () => clearTimeout(e);
|
|
2513
2513
|
}, [k]);
|
|
2514
2514
|
let { tool: A, setTool: j } = gn(), te = X(A);
|
|
2515
2515
|
te.current = A;
|
|
2516
|
-
let { updateLayer: ne, undo: N, redo: P } =
|
|
2516
|
+
let { updateLayer: ne, undo: N, redo: P } = o(), F = X({
|
|
2517
2517
|
undo: N,
|
|
2518
2518
|
redo: P
|
|
2519
2519
|
});
|
|
@@ -2521,71 +2521,71 @@ function Si() {
|
|
|
2521
2521
|
undo: N,
|
|
2522
2522
|
redo: P
|
|
2523
2523
|
};
|
|
2524
|
-
let I = !!
|
|
2524
|
+
let I = !!l().grab;
|
|
2525
2525
|
Y(() => {
|
|
2526
2526
|
j(I ? "orbit" : "select");
|
|
2527
2527
|
}, [I, j]);
|
|
2528
|
-
let re = X(
|
|
2529
|
-
re.current =
|
|
2528
|
+
let re = X(i);
|
|
2529
|
+
re.current = i;
|
|
2530
2530
|
let L = X(ne);
|
|
2531
2531
|
return L.current = ne, Y(() => {
|
|
2532
|
-
let
|
|
2533
|
-
if (kn(
|
|
2534
|
-
if ((
|
|
2535
|
-
|
|
2532
|
+
let t = (t) => {
|
|
2533
|
+
if (kn(t)) return;
|
|
2534
|
+
if ((t.metaKey || t.ctrlKey) && (t.key === "z" || t.key === "Z")) {
|
|
2535
|
+
t.preventDefault(), t.shiftKey ? F.current.redo() : F.current.undo();
|
|
2536
2536
|
return;
|
|
2537
2537
|
}
|
|
2538
|
-
if (
|
|
2539
|
-
|
|
2538
|
+
if (t.code === "Space") {
|
|
2539
|
+
t.preventDefault(), O.toggle();
|
|
2540
2540
|
return;
|
|
2541
2541
|
}
|
|
2542
|
-
if ((
|
|
2542
|
+
if ((t.key === "s" || t.key === "S") && !t.metaKey && !t.ctrlKey && !t.altKey) {
|
|
2543
2543
|
window.dispatchEvent(new CustomEvent("kol:show-shortcuts"));
|
|
2544
2544
|
return;
|
|
2545
2545
|
}
|
|
2546
|
-
if ((
|
|
2547
|
-
|
|
2546
|
+
if ((t.key === "c" || t.key === "C") && !t.metaKey && !t.ctrlKey && !t.altKey) {
|
|
2547
|
+
e("grab", !S().grab);
|
|
2548
2548
|
return;
|
|
2549
2549
|
}
|
|
2550
|
-
if ((
|
|
2551
|
-
|
|
2550
|
+
if ((t.key === "z" || t.key === "Z") && !t.metaKey && !t.ctrlKey && !t.altKey) {
|
|
2551
|
+
e("zoomLock", !S().zoomLock);
|
|
2552
2552
|
return;
|
|
2553
2553
|
}
|
|
2554
|
-
let
|
|
2555
|
-
if (
|
|
2556
|
-
let
|
|
2557
|
-
|
|
2554
|
+
let n = !t.metaKey && !t.ctrlKey && !t.altKey && !t.shiftKey && be[t.key.length === 1 ? t.key.toLowerCase() : t.key];
|
|
2555
|
+
if (n && re.current) {
|
|
2556
|
+
let e = Ce(re.current, n[1], n[0]);
|
|
2557
|
+
e && (t.preventDefault(), L.current(re.current.id, e));
|
|
2558
2558
|
}
|
|
2559
2559
|
};
|
|
2560
|
-
return window.addEventListener("keydown",
|
|
2560
|
+
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
2561
2561
|
}, [j]), Y(() => {
|
|
2562
|
-
if (!
|
|
2562
|
+
if (!i?.presetId) return;
|
|
2563
2563
|
let e = new URLSearchParams(window.location.search);
|
|
2564
|
-
e.get("preset") !==
|
|
2565
|
-
}, [
|
|
2566
|
-
|
|
2564
|
+
e.get("preset") !== i.presetId && (e.delete("view"), e.set("preset", i.presetId), i.loopGroup ? e.set("cat", i.loopGroup) : e.delete("cat"), window.history.replaceState(null, "", `${window.location.pathname}?${e}`));
|
|
2565
|
+
}, [i?.presetId, i?.loopGroup]), Y(() => {
|
|
2566
|
+
i && n !== i.id && r(i.id);
|
|
2567
2567
|
}, [
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2568
|
+
i,
|
|
2569
|
+
n,
|
|
2570
|
+
r
|
|
2571
2571
|
]), /* @__PURE__ */ $("div", {
|
|
2572
2572
|
className: "kol-editor-labs contents",
|
|
2573
|
-
"data-touch":
|
|
2574
|
-
"data-params":
|
|
2575
|
-
"data-empty":
|
|
2573
|
+
"data-touch": d || void 0,
|
|
2574
|
+
"data-params": f ? "open" : void 0,
|
|
2575
|
+
"data-empty": i || x.active ? void 0 : "",
|
|
2576
2576
|
style: y,
|
|
2577
2577
|
children: [
|
|
2578
2578
|
/* @__PURE__ */ Q(gr, {}),
|
|
2579
|
-
|
|
2579
|
+
d ? /* @__PURE__ */ $(hi.Provider, {
|
|
2580
2580
|
value: {
|
|
2581
|
-
collapseParams: () =>
|
|
2581
|
+
collapseParams: () => p(!1),
|
|
2582
2582
|
tall: m,
|
|
2583
2583
|
setTall: h,
|
|
2584
2584
|
setSheetPx: _,
|
|
2585
|
-
catalog:
|
|
2586
|
-
toggleCatalog: () =>
|
|
2585
|
+
catalog: C,
|
|
2586
|
+
toggleCatalog: () => w((e) => !e)
|
|
2587
2587
|
},
|
|
2588
|
-
children: [/* @__PURE__ */ Q(
|
|
2588
|
+
children: [/* @__PURE__ */ Q(u.Provider, {
|
|
2589
2589
|
value: "md",
|
|
2590
2590
|
children: /* @__PURE__ */ Q(It, {
|
|
2591
2591
|
registry: xi,
|
|
@@ -2598,27 +2598,27 @@ function Si() {
|
|
|
2598
2598
|
}), b) : null
|
|
2599
2599
|
})
|
|
2600
2600
|
}), /* @__PURE__ */ Q(vi, {
|
|
2601
|
-
paramsOpen:
|
|
2602
|
-
setParamsOpen:
|
|
2603
|
-
catalog:
|
|
2604
|
-
toggleCatalog: () =>
|
|
2601
|
+
paramsOpen: f,
|
|
2602
|
+
setParamsOpen: p,
|
|
2603
|
+
catalog: C,
|
|
2604
|
+
toggleCatalog: () => w((e) => !e),
|
|
2605
2605
|
railHeight: v
|
|
2606
2606
|
})]
|
|
2607
2607
|
}) : /* @__PURE__ */ Q(It, { registry: bi }),
|
|
2608
|
-
|
|
2609
|
-
initialOpen:
|
|
2610
|
-
hasMedia:
|
|
2608
|
+
C && !x.picker && !(x.active && !i) && /* @__PURE__ */ Q(oi, {
|
|
2609
|
+
initialOpen: T,
|
|
2610
|
+
hasMedia: D,
|
|
2611
2611
|
onNeedMedia: (e) => {
|
|
2612
|
-
|
|
2612
|
+
E(e), a("photo", {
|
|
2613
2613
|
filters: [],
|
|
2614
2614
|
fxGroup: null
|
|
2615
2615
|
});
|
|
2616
2616
|
},
|
|
2617
2617
|
onPicked: () => {
|
|
2618
|
-
|
|
2618
|
+
E(null), w(!1);
|
|
2619
2619
|
},
|
|
2620
2620
|
onClose: () => {
|
|
2621
|
-
|
|
2621
|
+
E(null), w(!1);
|
|
2622
2622
|
}
|
|
2623
2623
|
})
|
|
2624
2624
|
]
|
|
@@ -2735,7 +2735,7 @@ var Fi = [
|
|
|
2735
2735
|
label: `${e}s`
|
|
2736
2736
|
}));
|
|
2737
2737
|
function Ii({ size: e }) {
|
|
2738
|
-
let { loopSeconds: t, setLoopSeconds: n } =
|
|
2738
|
+
let { loopSeconds: t, setLoopSeconds: n } = C();
|
|
2739
2739
|
return /* @__PURE__ */ Q(J, {
|
|
2740
2740
|
value: String(t),
|
|
2741
2741
|
onChange: (e) => n(Number(e)),
|
|
@@ -2779,37 +2779,37 @@ var Li = [
|
|
|
2779
2779
|
label: "Fill"
|
|
2780
2780
|
}
|
|
2781
2781
|
];
|
|
2782
|
-
function zi({ layer: e, onSwitchCategory: t, onInsert:
|
|
2783
|
-
let
|
|
2782
|
+
function zi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: d }) {
|
|
2783
|
+
let f = nt(), { updateLayer: h, addFilter: _, removeFilter: v } = o(), { onExportPng: b } = Lt(), [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
2784
|
Y(() => {
|
|
2785
|
-
c && (
|
|
2785
|
+
c && (T(!0), j(!0));
|
|
2786
2786
|
}, [c]);
|
|
2787
|
-
let B = l ? "sm" : "lg", oe = l && !!e &&
|
|
2787
|
+
let B = l ? "sm" : "lg", oe = l && !!e && C && !x;
|
|
2788
2788
|
Y(() => (u?.(oe), () => u?.(!1)), [oe]);
|
|
2789
|
-
let se = !l && e &&
|
|
2790
|
-
Y(() => (
|
|
2789
|
+
let se = !l && e && C && !x ? R ? `${R}px` : ne ? ni.tall : ni.half : null;
|
|
2790
|
+
Y(() => (d?.(se), () => d?.(null)), [se]);
|
|
2791
2791
|
let ce = () => {
|
|
2792
2792
|
let t = e?.type === "loop" && N(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2793
|
-
t &&
|
|
2793
|
+
t && h(e.id, H(t, e.loopGroup));
|
|
2794
2794
|
};
|
|
2795
2795
|
if (Mr(ce, () => {
|
|
2796
|
-
e?.type === "loop" &&
|
|
2796
|
+
e?.type === "loop" && h(e.id, p(e, w(U(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2797
2797
|
}), !e) return null;
|
|
2798
|
-
if (
|
|
2798
|
+
if (x) return /* @__PURE__ */ Q("button", {
|
|
2799
2799
|
"aria-label": "Show controls",
|
|
2800
2800
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
2801
|
-
onClick: () =>
|
|
2801
|
+
onClick: () => S(!1)
|
|
2802
2802
|
});
|
|
2803
|
-
let V = e.type === "loop", le = V ? `${P(e.loopGroup).label} · ${e.presetLabel}` : "Media", ue = V ? U(e.loopId)?.params ?? [] : [], de = V ?
|
|
2804
|
-
let t =
|
|
2805
|
-
t &&
|
|
2806
|
-
}, he =
|
|
2807
|
-
let t =
|
|
2808
|
-
t &&
|
|
2803
|
+
let V = e.type === "loop", le = V ? `${P(e.loopGroup).label} · ${e.presetLabel}` : "Media", ue = V ? U(e.loopId)?.params ?? [] : [], de = V ? E(ue, e) : [], W = () => h(e.id, p(e, w(ue, e), z.take(), { withFilters: !0 })), fe = (t) => h(e.id, p(e, t.params, z.take(), { stripNoRandom: !!t.motion })), me = () => {
|
|
2804
|
+
let t = y(e, z.take());
|
|
2805
|
+
t && h(e.id, t);
|
|
2806
|
+
}, he = g(e), { effectable: ge } = ie(e), _e = () => {
|
|
2807
|
+
let t = ee(e, z.take());
|
|
2808
|
+
t && h(e.id, { filters: t });
|
|
2809
2809
|
};
|
|
2810
|
-
if (!
|
|
2810
|
+
if (!C) return /* @__PURE__ */ $(ti, {
|
|
2811
2811
|
label: V ? e.presetLabel : "Media",
|
|
2812
|
-
onOpen: () =>
|
|
2812
|
+
onOpen: () => T(!0),
|
|
2813
2813
|
size: B,
|
|
2814
2814
|
children: [
|
|
2815
2815
|
(V || he.length > 0) && /* @__PURE__ */ Q(Ln, {
|
|
@@ -2841,7 +2841,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2841
2841
|
size: B,
|
|
2842
2842
|
iconOnly: "eye-off",
|
|
2843
2843
|
"aria-label": "Hide UI",
|
|
2844
|
-
onClick: () =>
|
|
2844
|
+
onClick: () => S(!0),
|
|
2845
2845
|
className: "shrink-0"
|
|
2846
2846
|
})
|
|
2847
2847
|
}),
|
|
@@ -2859,10 +2859,10 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2859
2859
|
})
|
|
2860
2860
|
]
|
|
2861
2861
|
});
|
|
2862
|
-
let ve = [...V ? Di : Oi, ...V &&
|
|
2862
|
+
let ve = [...V ? Di : Oi, ...V && f.steps.length >= 2 ? [{
|
|
2863
2863
|
value: "morph",
|
|
2864
2864
|
label: "Morph"
|
|
2865
|
-
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" ||
|
|
2865
|
+
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" || n("motion"))), ye = ve.some((e) => e.value === te) ? te : ve[0].value;
|
|
2866
2866
|
return /* @__PURE__ */ $(Un, { children: [
|
|
2867
2867
|
/* @__PURE__ */ Q(pe, {
|
|
2868
2868
|
open: I,
|
|
@@ -2871,15 +2871,15 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2871
2871
|
layer: e,
|
|
2872
2872
|
size: B
|
|
2873
2873
|
}),
|
|
2874
|
-
|
|
2874
|
+
D && /* @__PURE__ */ Q(Yr, {
|
|
2875
2875
|
onPick: (e) => {
|
|
2876
2876
|
t(e), k(!1);
|
|
2877
2877
|
},
|
|
2878
2878
|
onInsert: () => {
|
|
2879
|
-
k(!1),
|
|
2879
|
+
k(!1), r();
|
|
2880
2880
|
},
|
|
2881
2881
|
onBack: () => {
|
|
2882
|
-
k(!1),
|
|
2882
|
+
k(!1), i();
|
|
2883
2883
|
},
|
|
2884
2884
|
onDismiss: () => k(!1)
|
|
2885
2885
|
}),
|
|
@@ -2887,7 +2887,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2887
2887
|
layer: e,
|
|
2888
2888
|
chain: he,
|
|
2889
2889
|
onPick: (t) => {
|
|
2890
|
-
|
|
2890
|
+
_(e.id, t), j(!1);
|
|
2891
2891
|
},
|
|
2892
2892
|
onBack: () => j(!1)
|
|
2893
2893
|
}),
|
|
@@ -2905,18 +2905,18 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2905
2905
|
},
|
|
2906
2906
|
onResize: (e) => ae(Math.max(96, Math.min(window.innerHeight * .92, e))),
|
|
2907
2907
|
onResizeEnd: (e) => {
|
|
2908
|
-
e < 96 && (ae(null),
|
|
2908
|
+
e < 96 && (ae(null), T(!1));
|
|
2909
2909
|
}
|
|
2910
2910
|
}),
|
|
2911
2911
|
/* @__PURE__ */ Q(ei, {
|
|
2912
2912
|
title: le,
|
|
2913
|
-
onCollapse: () =>
|
|
2913
|
+
onCollapse: () => T(!1),
|
|
2914
2914
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
2915
2915
|
action: /* @__PURE__ */ Q(K, {
|
|
2916
2916
|
tone: "ghost",
|
|
2917
2917
|
quiet: !0,
|
|
2918
2918
|
size: "sm",
|
|
2919
|
-
onClick:
|
|
2919
|
+
onClick: i,
|
|
2920
2920
|
children: "Start over"
|
|
2921
2921
|
})
|
|
2922
2922
|
}),
|
|
@@ -3025,9 +3025,9 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3025
3025
|
...e,
|
|
3026
3026
|
...t.params,
|
|
3027
3027
|
id: e.id
|
|
3028
|
-
}, i = t.def ?
|
|
3029
|
-
let i =
|
|
3030
|
-
|
|
3028
|
+
}, i = t.def ? E(t.def.params, r) : [], a = (t) => {
|
|
3029
|
+
let i = p(r, t.params, z.take(), { stripNoRandom: !!t.motion }), a = he.map(({ def: e, ...t }) => t);
|
|
3030
|
+
h(e.id, { filters: a.map((e, t) => t === n ? {
|
|
3031
3031
|
...e,
|
|
3032
3032
|
params: {
|
|
3033
3033
|
...e.params,
|
|
@@ -3043,7 +3043,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3043
3043
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3044
3044
|
iconLeft: "trash",
|
|
3045
3045
|
iconRight: "trash",
|
|
3046
|
-
onClick: () =>
|
|
3046
|
+
onClick: () => v(e.id, n),
|
|
3047
3047
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3048
3048
|
}), i.length > 0 && /* @__PURE__ */ Q(Pi, {
|
|
3049
3049
|
size: B,
|
|
@@ -3056,10 +3056,10 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3056
3056
|
}, t.key);
|
|
3057
3057
|
})]
|
|
3058
3058
|
}),
|
|
3059
|
-
ye === "transport" &&
|
|
3059
|
+
ye === "transport" && n("motion") && /* @__PURE__ */ $("div", {
|
|
3060
3060
|
className: "flex flex-col gap-2 pt-3",
|
|
3061
3061
|
children: [(() => {
|
|
3062
|
-
let e =
|
|
3062
|
+
let e = n("motion").TransportBar;
|
|
3063
3063
|
return /* @__PURE__ */ Q(e, { size: B });
|
|
3064
3064
|
})(), /* @__PURE__ */ Q(Ii, { size: B })]
|
|
3065
3065
|
}),
|
|
@@ -3098,13 +3098,13 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3098
3098
|
/* @__PURE__ */ Q(K, {
|
|
3099
3099
|
tone: "primary",
|
|
3100
3100
|
size: B,
|
|
3101
|
-
onClick: () =>
|
|
3101
|
+
onClick: () => S(!0),
|
|
3102
3102
|
children: "Hide UI"
|
|
3103
3103
|
}),
|
|
3104
3104
|
/* @__PURE__ */ Q(K, {
|
|
3105
3105
|
tone: "primary",
|
|
3106
3106
|
size: B,
|
|
3107
|
-
onClick:
|
|
3107
|
+
onClick: i,
|
|
3108
3108
|
children: "Start over"
|
|
3109
3109
|
})
|
|
3110
3110
|
]
|
|
@@ -3192,10 +3192,10 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3192
3192
|
});
|
|
3193
3193
|
}
|
|
3194
3194
|
function Vi() {
|
|
3195
|
-
let { layers:
|
|
3195
|
+
let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: s, aspect: c, setAspect: l } = o(), { setTool: u } = gn(), d = Ht() && !dn(), f = Sn(), p = () => {
|
|
3196
3196
|
let e = new URLSearchParams(window.location.search);
|
|
3197
3197
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3198
|
-
}, [
|
|
3198
|
+
}, [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({
|
|
3199
3199
|
s: 1,
|
|
3200
3200
|
x: 0,
|
|
3201
3201
|
y: 0
|
|
@@ -3250,12 +3250,12 @@ function Vi() {
|
|
|
3250
3250
|
}
|
|
3251
3251
|
}, P = (e) => {
|
|
3252
3252
|
let t = j.current;
|
|
3253
|
-
t && t.id === e.pointerId && e.type === "pointerup" &&
|
|
3253
|
+
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
3254
|
};
|
|
3255
3255
|
Kn(), Y(() => (Xt("randomiser"), () => Xt(null)), []), Y(() => {
|
|
3256
|
-
|
|
3256
|
+
l("4:5"), u("orbit");
|
|
3257
3257
|
}, []);
|
|
3258
|
-
let F =
|
|
3258
|
+
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";
|
|
3259
3259
|
Y(() => {
|
|
3260
3260
|
if (!I) return;
|
|
3261
3261
|
let e = (e) => {
|
|
@@ -3271,43 +3271,43 @@ function Vi() {
|
|
|
3271
3271
|
}, [I]);
|
|
3272
3272
|
let re = (e) => {
|
|
3273
3273
|
let t = R(e);
|
|
3274
|
-
t && (
|
|
3274
|
+
t && (y(n("loop", t)), h("live"));
|
|
3275
3275
|
}, L = (e) => {
|
|
3276
3276
|
let t = R(e);
|
|
3277
|
-
t &&
|
|
3277
|
+
t && v && i(v, t);
|
|
3278
3278
|
}, ie = () => {
|
|
3279
|
-
|
|
3279
|
+
y(n("photo", {
|
|
3280
3280
|
fit: "cover",
|
|
3281
3281
|
x: 0,
|
|
3282
3282
|
y: 0,
|
|
3283
|
-
w:
|
|
3284
|
-
h: Math.round(
|
|
3285
|
-
})),
|
|
3283
|
+
w: t,
|
|
3284
|
+
h: Math.round(t * s / a)
|
|
3285
|
+
})), h("live");
|
|
3286
3286
|
};
|
|
3287
3287
|
Y(() => {
|
|
3288
3288
|
let e = new URL(window.location.href), t = e.searchParams.get("start");
|
|
3289
|
-
t && (t === "effects" && (
|
|
3289
|
+
t && (t === "effects" && (_(!0), ie()), e.searchParams.delete("start"), window.history.replaceState(window.history.state, "", e));
|
|
3290
3290
|
}, []);
|
|
3291
|
-
let ae = (
|
|
3292
|
-
if (
|
|
3293
|
-
|
|
3291
|
+
let ae = (e) => {
|
|
3292
|
+
if (e === "fill") {
|
|
3293
|
+
x("cover");
|
|
3294
3294
|
return;
|
|
3295
3295
|
}
|
|
3296
|
-
|
|
3297
|
-
let n =
|
|
3298
|
-
|
|
3296
|
+
x("contain"), l(e);
|
|
3297
|
+
let n = T[e];
|
|
3298
|
+
v && n && i(v, {
|
|
3299
3299
|
x: 0,
|
|
3300
3300
|
y: 0,
|
|
3301
|
-
w:
|
|
3302
|
-
h: Math.round(
|
|
3301
|
+
w: t,
|
|
3302
|
+
h: Math.round(t * n.h / n.w)
|
|
3303
3303
|
});
|
|
3304
3304
|
}, z = () => {
|
|
3305
|
-
for (let
|
|
3306
|
-
|
|
3305
|
+
for (let t of [...e]) r(t.id);
|
|
3306
|
+
y(null), ee({
|
|
3307
3307
|
s: 1,
|
|
3308
3308
|
x: 0,
|
|
3309
3309
|
y: 0
|
|
3310
|
-
}),
|
|
3310
|
+
}), _(!1), h(p());
|
|
3311
3311
|
};
|
|
3312
3312
|
return /* @__PURE__ */ $("div", {
|
|
3313
3313
|
className: "kol-editor-randomiser relative h-dvh bg-black",
|
|
@@ -3318,40 +3318,40 @@ function Vi() {
|
|
|
3318
3318
|
style: {
|
|
3319
3319
|
transform: M(D),
|
|
3320
3320
|
transformOrigin: "0 0",
|
|
3321
|
-
right:
|
|
3322
|
-
bottom:
|
|
3321
|
+
right: S ? "var(--kol-sidenav-w, 320px)" : 0,
|
|
3322
|
+
bottom: w ?? 0
|
|
3323
3323
|
},
|
|
3324
3324
|
onPointerDownCapture: ne,
|
|
3325
3325
|
onPointerMoveCapture: N,
|
|
3326
3326
|
onPointerUpCapture: P,
|
|
3327
3327
|
onPointerCancelCapture: P,
|
|
3328
3328
|
onPointerLeave: P,
|
|
3329
|
-
children: /* @__PURE__ */ Q(Qt, { fit:
|
|
3329
|
+
children: /* @__PURE__ */ Q(Qt, { fit: b })
|
|
3330
3330
|
}),
|
|
3331
|
-
|
|
3332
|
-
chromes:
|
|
3333
|
-
onGenerate: () =>
|
|
3331
|
+
m === "entry" && /* @__PURE__ */ Q(Bi, {
|
|
3332
|
+
chromes: d,
|
|
3333
|
+
onGenerate: () => h("category"),
|
|
3334
3334
|
onEffects: () => {
|
|
3335
|
-
|
|
3335
|
+
_(!0), ie();
|
|
3336
3336
|
}
|
|
3337
3337
|
}),
|
|
3338
|
-
|
|
3338
|
+
m === "category" && /* @__PURE__ */ Q(Yr, {
|
|
3339
3339
|
onPick: re,
|
|
3340
3340
|
onInsert: ie,
|
|
3341
|
-
onBack: () =>
|
|
3341
|
+
onBack: () => h("entry")
|
|
3342
3342
|
}),
|
|
3343
|
-
|
|
3343
|
+
m === "live" && !I && /* @__PURE__ */ Q(zi, {
|
|
3344
3344
|
layer: F,
|
|
3345
3345
|
onSwitchCategory: L,
|
|
3346
3346
|
onInsert: () => {
|
|
3347
3347
|
z(), ie();
|
|
3348
3348
|
},
|
|
3349
3349
|
onRestart: z,
|
|
3350
|
-
aspectValue:
|
|
3351
|
-
openEffects:
|
|
3350
|
+
aspectValue: b === "cover" ? "fill" : c,
|
|
3351
|
+
openEffects: g && !I,
|
|
3352
3352
|
onAspect: ae,
|
|
3353
|
-
rail: !
|
|
3354
|
-
onRail:
|
|
3353
|
+
rail: !d && !f,
|
|
3354
|
+
onRail: C,
|
|
3355
3355
|
onSheet: E
|
|
3356
3356
|
}),
|
|
3357
3357
|
I && /* @__PURE__ */ $("div", {
|
|
@@ -3380,4 +3380,4 @@ function Hi() {
|
|
|
3380
3380
|
});
|
|
3381
3381
|
}
|
|
3382
3382
|
//#endregion
|
|
3383
|
-
export { bt as AppSettingsSections, Tt as BRAND, xn as DesignEditor, xn as default, jt as DisplaySettingsDrawer, ln as EditorProviders, Mt as FilesDialog, un as FloatDesignEditor,
|
|
3383
|
+
export { bt as AppSettingsSections, Tt as BRAND, xn as DesignEditor, xn as default, jt as DisplaySettingsDrawer, ln as EditorProviders, Mt as FilesDialog, un as FloatDesignEditor, ze as GeneratorLibraryProvider, Ci as LABS_DRAFT_KEY, Ve as LIBRARY_SLOT_KEYS, wi as LabsView, vn as MODES, Hi as MobileView, Yt as OutputCanvas, Qt as OutputStage, mn as OutputView, qt as RAIL_EXTRA_PREFIX, pt as TimelineRail, We as UnauthorizedError, Gt as VIEW_PATHS, an as closeFiles, Pt as comboLabel, _n as copyStored, pn as currentView, nn as duplicateStored, Pe as getLibraryApi, je as inviteFromRequest, Ht as isMobileDevice, Ee as listInviteRequests, Be as loadLibrary, Ue as mintInvite, kt as openFiles, Ie as readLibraryRaw, d as registerPack, Wt as removeStored, fn as renameStored, Me as requestInvite, Oe as setLibraryApi, Kt as setMediaClient, Dn as setMediaProxyBase, wn as setMode, $t as setNavigator, sn as setRailExtras, x as setSettingsStore, yn as setThumbStored, gt as setWantsDesktop, vt as shortcutsBySection, De as signInLibrary, Ae as signOutLibrary, Re as signUpLibrary, Ne as subscribeLibrary, mt as timelineView, Te as updateAccount, Le as useAccount, At as useFilesDialog, He as useGeneratorLibrary, ke as useLibrarySession, Cn as useRailExtras, on as useSettingsSections, dn as wantsDesktop, hn as withView };
|