@kolkrabbi/design-editor 0.35.0 → 0.36.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-Don6fG00.js → BindDot-dBz2NUVr.js} +5 -5
- package/dist/{Timeline-Cz-W72D0.js → Timeline-BDMxiVYe.js} +31 -31
- package/dist/{TreePicker-1_NZG8GB.js → TreePicker-BawzFyzV.js} +4 -4
- package/dist/{core-DJet1D7E.js → core-d8m3o_mg.js} +4382 -4379
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +1202 -1236
- package/dist/{effectCategories-DV7i_AgK.js → effectCategories-D1t5Vdqf.js} +696 -696
- package/dist/{effects-Dn4_OzYx.js → effects-BFAtGRPu.js} +126 -126
- package/dist/effects.js +1 -1
- package/dist/{generators-Bf08F0NV.js → generators-JkPVwcTT.js} +1439 -1439
- package/dist/generators.js +1 -1
- package/dist/{host-BUVR9I4S.js → host-C3_Oy1ck.js} +1 -1
- package/dist/{host-CRRiwlrB.js → host-CsF4CKfw.js} +22 -22
- package/dist/{morphStore-B5081ohW.js → morphStore-CidzL7wV.js} +1 -1
- package/dist/{motion-Cuwxm2ic.js → motion-KvPCj1EZ.js} +534 -533
- package/dist/motion.js +1 -1
- package/dist/{previewScale-CA0ComGv.js → previewScale-BAmIBoWY.js} +1 -1
- package/dist/{rolls-CEQmdcp3.js → rolls-5hhrWX96.js} +1501 -1312
- package/dist/{src-CzKMsyZO.js → src-8EvSuuNG.js} +1 -1
- package/dist/{store-DZUWPE2s.js → store-QnsWv-26.js} +448 -448
- package/dist/{useLayerEdit-Cmtx3V3O.js → useLayerEdit-BikuFIoi.js} +118 -119
- package/package.json +9 -9
package/dist/design-editor.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { C as
|
|
4
|
-
import { r as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { A as
|
|
7
|
-
import { a as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import { a as
|
|
11
|
-
import { n as
|
|
12
|
-
import { $ as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { IconLoader as
|
|
17
|
-
import {
|
|
18
|
-
import { useDragResize as
|
|
19
|
-
import { createPortal as
|
|
1
|
+
import { B as e, D as t, Dn as n, F as r, Gn as i, I as a, J as o, Kn as s, L as c, Lt as l, Mn as u, On as d, P as f, Un as p, Wn as m, a as h, bn as g, d as _, dn as v, er as y, f as b, ft as x, gt as S, hn as C, ht as w, i as T, j as E, jn as D, ln as O, mn as k, n as A, nn as j, o as ee, p as M, r as N, tr as te, un as P, vn as F, xn as I } from "./rolls-5hhrWX96.js";
|
|
2
|
+
import { n as L, r as R, t as ne } from "./useLayerEdit-BikuFIoi.js";
|
|
3
|
+
import { C as z, D as B, E as V, _ as H, a as re, c as U, d as ie, f as W, g as ae, i as G, l as oe, m as se, n as ce, r as le, t as ue, u as de, v as fe, w as pe, x as K, y as me } from "./effectCategories-D1t5Vdqf.js";
|
|
4
|
+
import { r as he } from "./TreePicker-BawzFyzV.js";
|
|
5
|
+
import { _ as ge, a as _e, b as ve, f as ye, g as be, h as xe, i as Se, m as Ce, n as we, o as Te, p as Ee, r as De, s as Oe, v as ke, y as Ae } from "./generators-JkPVwcTT.js";
|
|
6
|
+
import { A as je, C as Me, D as Ne, E as Pe, M as Fe, O as Ie, S as Le, T as Re, _ as ze, b as Be, c as Ve, h as He, j as Ue, k as We, l as Ge, m as Ke, u as qe, v as Je, w as Ye, y as Xe } from "./store-QnsWv-26.js";
|
|
7
|
+
import { a as Ze, c as Qe, d as $e, f as et, i as tt, l as nt, n as rt, o as it, p as at, r as ot, s as q, t as st, u as ct } from "./morphStore-CidzL7wV.js";
|
|
8
|
+
import { n as lt, r as ut, t as dt } from "./BindDot-dBz2NUVr.js";
|
|
9
|
+
import { n as ft, r as pt } from "./effects-BFAtGRPu.js";
|
|
10
|
+
import { a as mt, i as ht, n as gt, o as _t, r as vt } from "./motion-KvPCj1EZ.js";
|
|
11
|
+
import { n as yt, r as bt, t as xt } from "./Timeline-BDMxiVYe.js";
|
|
12
|
+
import { $ as St, A as Ct, B as wt, C as Tt, D as Et, E as Dt, F as Ot, G as kt, H as At, I as jt, J as Mt, K as Nt, L as Pt, M as Ft, N as It, O as Lt, P as Rt, Q as zt, R as Bt, S as Vt, T as Ht, U as Ut, V as Wt, W as Gt, X as Kt, Y as qt, Z as Jt, _ as Yt, a as Xt, at as Zt, b as Qt, c as $t, ct as en, d as tn, dt as nn, et as rn, f as an, ft as on, g as sn, h as cn, i as ln, it as un, j as dn, k as fn, l as pn, lt as mn, m as hn, mt as gn, n as _n, nt as vn, o as yn, ot as bn, p as xn, pt as Sn, q as Cn, r as wn, rt as Tn, s as En, st as Dn, t as On, tt as kn, u as An, ut as jn, v as Mn, w as Nn, x as Pn, y as Fn, z as In } from "./core-d8m3o_mg.js";
|
|
13
|
+
import { Button as J, ButtonGroup as Ln, Divider as Rn, MultiSelect as zn, NavRail as Bn, StepList as Vn, Tag as Hn, Tooltip as Un, useGrabEdge as Wn, useMediaQuery as Gn, useModal as Kn } from "@kolkrabbi/kol-component";
|
|
14
|
+
import { createContext as qn, useContext as Jn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Yn } from "react";
|
|
15
|
+
import { Fragment as Xn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
16
|
+
import { IconLoader as Zn } from "@kolkrabbi/kol-icons";
|
|
17
|
+
import { PropertyRail as Qn, RailDisplayControls as $n, RailTrigger as er } from "@kolkrabbi/kol-shell";
|
|
18
|
+
import { useDragResize as tr, useTheme as nr } from "@kolkrabbi/kol-framework";
|
|
19
|
+
import { createPortal as rr } from "react-dom";
|
|
20
20
|
//#region src/phoneFloats.js
|
|
21
|
-
var
|
|
21
|
+
var ir = (e) => {
|
|
22
22
|
let t = e, n = /* @__PURE__ */ new Set(), r = (e) => (n.add(e), () => n.delete(e));
|
|
23
23
|
return {
|
|
24
24
|
set: (e) => {
|
|
25
25
|
e !== t && (t = e, n.forEach((e) => e()));
|
|
26
26
|
},
|
|
27
|
-
use: () =>
|
|
27
|
+
use: () => Yn(r, () => t, () => t)
|
|
28
28
|
};
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
var
|
|
29
|
+
}, ar = ir(null), or = ir(null), sr = ar.set;
|
|
30
|
+
ar.use, or.set;
|
|
31
|
+
var cr = or.use, lr = [
|
|
32
32
|
{
|
|
33
33
|
id: "shape",
|
|
34
34
|
label: "Shape",
|
|
@@ -44,7 +44,7 @@ var lr = sr.use, ur = [
|
|
|
44
44
|
label: "Crossfade",
|
|
45
45
|
icon: "dashed-circle"
|
|
46
46
|
}
|
|
47
|
-
],
|
|
47
|
+
], ur = {
|
|
48
48
|
shape: [
|
|
49
49
|
["Loops", ["morph-circle", "star-morph"]],
|
|
50
50
|
["Loops", [
|
|
@@ -118,21 +118,21 @@ var lr = sr.use, ur = [
|
|
|
118
118
|
2
|
|
119
119
|
]
|
|
120
120
|
]
|
|
121
|
-
},
|
|
122
|
-
function
|
|
123
|
-
if (!
|
|
124
|
-
|
|
121
|
+
}, dr = null;
|
|
122
|
+
function fr(e) {
|
|
123
|
+
if (!dr) {
|
|
124
|
+
dr = /* @__PURE__ */ new Map();
|
|
125
125
|
let e = /* @__PURE__ */ new Set();
|
|
126
|
-
for (let t of
|
|
126
|
+
for (let t of se) for (let n of V(t.id)) e.has(n.id) || me(n) || (e.add(n.id), dr.has(n.loop) || dr.set(n.loop, []), dr.get(n.loop).push(n));
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return dr.get(e) ?? [];
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
130
|
+
var pr = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), mr = null;
|
|
131
|
+
function hr() {
|
|
132
|
+
if (mr) return mr;
|
|
133
133
|
let e = [];
|
|
134
|
-
for (let t of
|
|
135
|
-
let [r] = n, i = t.id === "blend" ?
|
|
134
|
+
for (let t of lr) for (let n of ur[t.id]) {
|
|
135
|
+
let [r] = n, i = t.id === "blend" ? pr(fr(n[1]), n[2]) : n[1].map((e) => fr(e)[0]);
|
|
136
136
|
if (!i || i.some((e) => !e) || new Set(i.map((e) => e.id)).size < i.length) continue;
|
|
137
137
|
let a = i.map((e) => e.label).join(" → "), o = `ship:morph:${t.id}:${i.map((e) => e.id).join("--")}`;
|
|
138
138
|
e.push({
|
|
@@ -146,7 +146,7 @@ function gr() {
|
|
|
146
146
|
morph: {
|
|
147
147
|
mode: t.id,
|
|
148
148
|
loopId: i[0].loop,
|
|
149
|
-
steps: i.map(
|
|
149
|
+
steps: i.map(Se),
|
|
150
150
|
curve: "in-out",
|
|
151
151
|
cycle: "loop",
|
|
152
152
|
resolution: 0,
|
|
@@ -155,24 +155,24 @@ function gr() {
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return mr = e;
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var gr = () => lr.map((e) => ({
|
|
161
161
|
label: e.label,
|
|
162
|
-
subs: [...new Set(
|
|
163
|
-
})),
|
|
164
|
-
function
|
|
165
|
-
e && (
|
|
162
|
+
subs: [...new Set(hr().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
163
|
+
})), _r = (e, t) => hr().find((n) => n.type === e && (!t || n.category === t)), vr = (e) => hr().find((t) => t.id === e);
|
|
164
|
+
function yr(e) {
|
|
165
|
+
e && (it({
|
|
166
166
|
active: !0,
|
|
167
167
|
...e.morph,
|
|
168
168
|
fileId: null,
|
|
169
169
|
fileName: e.label,
|
|
170
170
|
presetId: e.id
|
|
171
|
-
}),
|
|
171
|
+
}), n.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || jn("/morph"));
|
|
172
172
|
}
|
|
173
173
|
//#endregion
|
|
174
174
|
//#region src/editor/labs/catalog.js
|
|
175
|
-
var
|
|
175
|
+
var br = {
|
|
176
176
|
"fx:halftone": "ptrn-dot",
|
|
177
177
|
"fx:scanline": "grid-horizontal",
|
|
178
178
|
"fx:crt": "desktop",
|
|
@@ -196,19 +196,19 @@ var xr = {
|
|
|
196
196
|
"misc:Para Type": "aa",
|
|
197
197
|
"vec:Distressor": "scribble",
|
|
198
198
|
"vec:Modulator": "dashed-circle"
|
|
199
|
-
},
|
|
199
|
+
}, xr = {
|
|
200
200
|
effects: "filter",
|
|
201
201
|
generative: "layers",
|
|
202
202
|
vector: "pen-nib",
|
|
203
203
|
composition: "type",
|
|
204
204
|
morph: "swap",
|
|
205
205
|
mode: "mode-toggle-01"
|
|
206
|
-
},
|
|
206
|
+
}, Sr = [
|
|
207
207
|
"Moiré",
|
|
208
208
|
"Mesh Gradient",
|
|
209
209
|
"Reaction",
|
|
210
210
|
"Halftone"
|
|
211
|
-
],
|
|
211
|
+
], Cr = [
|
|
212
212
|
{
|
|
213
213
|
label: "Spaced",
|
|
214
214
|
patch: {
|
|
@@ -240,11 +240,11 @@ var xr = {
|
|
|
240
240
|
label: "Spiral",
|
|
241
241
|
patch: { geometry: "spiral" }
|
|
242
242
|
}
|
|
243
|
-
],
|
|
243
|
+
], wr = (e = {}) => {
|
|
244
244
|
let t = e.geometry ?? "rows";
|
|
245
245
|
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
246
246
|
};
|
|
247
|
-
function
|
|
247
|
+
function Tr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
248
248
|
let a = () => e?.type === "photo" ? (e.filters ?? []).filter((e) => e?.id === "fx-media") : [], o = (e, o) => {
|
|
249
249
|
let s = a(), c = t("photo", {
|
|
250
250
|
...i(),
|
|
@@ -259,28 +259,28 @@ function Er({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
259
259
|
fxGroup: e
|
|
260
260
|
}), window.dispatchEvent(new CustomEvent("kol:open-effects"));
|
|
261
261
|
}, c = (e, n) => {
|
|
262
|
-
t("loop",
|
|
262
|
+
t("loop", pe(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
263
263
|
}, l = (e) => {
|
|
264
264
|
t("kinetic", {
|
|
265
265
|
presetId: e.id,
|
|
266
266
|
presetLabel: e.label,
|
|
267
|
-
comp:
|
|
267
|
+
comp: _t(e)
|
|
268
268
|
}), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
269
|
-
}, u = e?.presetId ?? null, d = (e?.filters ?? []).find((e) => e?.id !== "fx-media")?.id ?? null, f = u ?
|
|
270
|
-
let a =
|
|
271
|
-
t("misc",
|
|
269
|
+
}, 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) => {
|
|
270
|
+
let a = V(n), o = [...new Set(a.map((e) => e.sub).filter(Boolean))], s = (e) => r === "misc" ? () => {
|
|
271
|
+
t("misc", pe(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
272
272
|
} : () => c(e, n);
|
|
273
273
|
return o.length ? o.map((t) => ({
|
|
274
274
|
label: t,
|
|
275
|
-
onSelect: s(
|
|
275
|
+
onSelect: s(B(n, t)[0]),
|
|
276
276
|
active: e?.loopGroup === n && f?.sub === t
|
|
277
277
|
})) : [{
|
|
278
|
-
label: i ??
|
|
278
|
+
label: i ?? H(n).label,
|
|
279
279
|
onSelect: s(a[0]),
|
|
280
280
|
active: e?.loopGroup === n
|
|
281
281
|
}];
|
|
282
282
|
}, m = (e) => e.groups.flatMap((t) => {
|
|
283
|
-
let n = e.labels?.[t] ??
|
|
283
|
+
let n = e.labels?.[t] ?? H(t).label, r = V(t).some((e) => e.sub), i = p(t, "loop", n);
|
|
284
284
|
return e.groups.length > 1 && r ? [{
|
|
285
285
|
label: n,
|
|
286
286
|
children: i
|
|
@@ -291,29 +291,29 @@ function Er({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
291
291
|
id: "color",
|
|
292
292
|
label: "Color",
|
|
293
293
|
icon: "clr-tri",
|
|
294
|
-
onSelect:
|
|
294
|
+
onSelect: Ve,
|
|
295
295
|
pages: []
|
|
296
296
|
},
|
|
297
297
|
{
|
|
298
298
|
id: "sec:effects",
|
|
299
299
|
label: "Effects"
|
|
300
300
|
},
|
|
301
|
-
...
|
|
301
|
+
...le(W).map((t) => ({
|
|
302
302
|
id: `fx:${t.id}`,
|
|
303
303
|
label: t.label,
|
|
304
|
-
icon:
|
|
305
|
-
pages: t.rack ?
|
|
304
|
+
icon: br[`fx:${t.id}`] ?? "square",
|
|
305
|
+
pages: t.rack ? ue.map((t) => ({
|
|
306
306
|
label: t.label,
|
|
307
307
|
onSelect: () => s(t.id),
|
|
308
308
|
active: e?.fxGroup === t.id
|
|
309
|
-
})) : t.id === "pattern" ?
|
|
309
|
+
})) : t.id === "pattern" ? Sr.map((t) => ({
|
|
310
310
|
label: t,
|
|
311
|
-
onSelect: () => c(
|
|
311
|
+
onSelect: () => c(B("optic", t)[0], "optic"),
|
|
312
312
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
313
|
-
})) : t.id === "scanline" ?
|
|
313
|
+
})) : t.id === "scanline" ? Cr.map((t) => ({
|
|
314
314
|
label: t.label,
|
|
315
315
|
onSelect: () => o("scanline", t.patch),
|
|
316
|
-
active: !e?.fxGroup && d === "scanline" &&
|
|
316
|
+
active: !e?.fxGroup && d === "scanline" && wr((e?.filters ?? []).find((e) => e?.id === "scanline")?.params) === t.label
|
|
317
317
|
})) : t.filters.map((t) => ({
|
|
318
318
|
label: t.label ?? t.id,
|
|
319
319
|
onSelect: () => o(t.id),
|
|
@@ -324,25 +324,25 @@ function Er({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
324
324
|
id: "sec:generative",
|
|
325
325
|
label: "Generative"
|
|
326
326
|
},
|
|
327
|
-
...
|
|
327
|
+
...Ae.map((e) => ({
|
|
328
328
|
id: `gen:${e.label}`,
|
|
329
329
|
label: e.label,
|
|
330
|
-
icon:
|
|
330
|
+
icon: br[`gen:${e.label}`] ?? "square",
|
|
331
331
|
pages: m(e)
|
|
332
332
|
})),
|
|
333
333
|
{
|
|
334
334
|
id: "sec:morph",
|
|
335
335
|
label: "Morph"
|
|
336
336
|
},
|
|
337
|
-
...
|
|
337
|
+
...lr.map((e) => ({
|
|
338
338
|
id: `morph:${e.id}`,
|
|
339
339
|
label: e.label,
|
|
340
340
|
icon: e.icon,
|
|
341
|
-
pages: [...new Set(
|
|
341
|
+
pages: [...new Set(hr().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
342
342
|
label: t,
|
|
343
|
-
onSelect: () =>
|
|
343
|
+
onSelect: () => yr(_r(e.id, t)),
|
|
344
344
|
active: (() => {
|
|
345
|
-
let n =
|
|
345
|
+
let n = hr().find((e) => e.id === rt().presetId);
|
|
346
346
|
return n?.type === e.id && n.category === t;
|
|
347
347
|
})()
|
|
348
348
|
}))
|
|
@@ -354,41 +354,41 @@ function Er({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
354
354
|
{
|
|
355
355
|
id: "vec:Distressor",
|
|
356
356
|
label: "Distressor",
|
|
357
|
-
icon:
|
|
357
|
+
icon: br["vec:Distressor"] ?? "square",
|
|
358
358
|
pages: p("distress")
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
361
|
id: "vec:Modulator",
|
|
362
362
|
label: "Modulator",
|
|
363
|
-
icon:
|
|
363
|
+
icon: br["vec:Modulator"] ?? "square",
|
|
364
364
|
pages: p("modulator")
|
|
365
365
|
},
|
|
366
366
|
{
|
|
367
367
|
id: "sec:composition",
|
|
368
368
|
label: "Composition"
|
|
369
369
|
},
|
|
370
|
-
...
|
|
370
|
+
...mt.map((t) => ({
|
|
371
371
|
id: `kin:${t.label}`,
|
|
372
372
|
label: t.label,
|
|
373
|
-
icon:
|
|
373
|
+
icon: br[`kin:${t.label}`] ?? "square",
|
|
374
374
|
pages: t.subs.map((t) => ({
|
|
375
375
|
label: t,
|
|
376
|
-
onSelect: () => l(
|
|
377
|
-
active: e?.type === "kinetic" &&
|
|
376
|
+
onSelect: () => l(ht.find((e) => e.sub === t)),
|
|
377
|
+
active: e?.type === "kinetic" && ht.some((e) => e.sub === t && e.id === u)
|
|
378
378
|
}))
|
|
379
379
|
})),
|
|
380
|
-
...
|
|
380
|
+
...ve.map((e) => ({
|
|
381
381
|
id: `misc:${e.label}`,
|
|
382
382
|
label: e.label,
|
|
383
|
-
icon:
|
|
383
|
+
icon: br[`misc:${e.label}`] ?? "square",
|
|
384
384
|
pages: e.groups.flatMap((e) => p(e, "misc"))
|
|
385
385
|
}))
|
|
386
386
|
];
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/editor/labs/LabsNav.jsx
|
|
390
|
-
function
|
|
391
|
-
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } =
|
|
390
|
+
function Er() {
|
|
391
|
+
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = _e(), i = X(null);
|
|
392
392
|
Y(() => {
|
|
393
393
|
n?.type === "photo" && n.src && (i.current = {
|
|
394
394
|
src: n.src,
|
|
@@ -401,7 +401,7 @@ function Dr() {
|
|
|
401
401
|
n?.srcType,
|
|
402
402
|
n?.fit
|
|
403
403
|
]);
|
|
404
|
-
let a =
|
|
404
|
+
let a = Tr({
|
|
405
405
|
layer: n,
|
|
406
406
|
setOnly: r,
|
|
407
407
|
addFilter: e,
|
|
@@ -418,14 +418,14 @@ function Dr() {
|
|
|
418
418
|
if (n.id.startsWith("sec:")) {
|
|
419
419
|
let e = n.id.slice(4);
|
|
420
420
|
t.push({
|
|
421
|
-
icon:
|
|
422
|
-
path: `${
|
|
421
|
+
icon: xr[e] ?? "square",
|
|
422
|
+
path: `${$t}${n.id}`,
|
|
423
423
|
label: n.label,
|
|
424
424
|
sub: []
|
|
425
425
|
});
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
|
-
let r = `${
|
|
428
|
+
let r = `${$t}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
429
429
|
a && e.set(r, a);
|
|
430
430
|
let o = t[t.length - 1], s = {
|
|
431
431
|
icon: n.icon,
|
|
@@ -433,30 +433,30 @@ function Dr() {
|
|
|
433
433
|
label: n.label
|
|
434
434
|
};
|
|
435
435
|
o?.sub ? o.sub.push(s) : t.push(s);
|
|
436
|
-
}),
|
|
436
|
+
}), pn({
|
|
437
437
|
items: t,
|
|
438
438
|
dispatch: (t) => {
|
|
439
439
|
let n = e.get(t);
|
|
440
440
|
return n ? (n(), !0) : !1;
|
|
441
441
|
}
|
|
442
|
-
}), () =>
|
|
442
|
+
}), () => pn(null);
|
|
443
443
|
}), null;
|
|
444
444
|
}
|
|
445
445
|
//#endregion
|
|
446
446
|
//#region src/editor/morph/MorphTab.jsx
|
|
447
|
-
var
|
|
447
|
+
var Dr = (e, t) => JSON.stringify(e) === JSON.stringify(t), Or = [
|
|
448
448
|
{
|
|
449
449
|
key: "curve",
|
|
450
450
|
label: "Curve",
|
|
451
451
|
type: "select",
|
|
452
|
-
options:
|
|
452
|
+
options: $e,
|
|
453
453
|
section: "Curve"
|
|
454
454
|
},
|
|
455
455
|
{
|
|
456
456
|
key: "cycle",
|
|
457
457
|
label: "Cycle",
|
|
458
458
|
type: "select",
|
|
459
|
-
options:
|
|
459
|
+
options: et,
|
|
460
460
|
section: "Curve"
|
|
461
461
|
},
|
|
462
462
|
{
|
|
@@ -477,59 +477,59 @@ var Or = (e, t) => JSON.stringify(e) === JSON.stringify(t), kr = [
|
|
|
477
477
|
when: (e) => e.mode === "shape"
|
|
478
478
|
}
|
|
479
479
|
];
|
|
480
|
-
function
|
|
481
|
-
let
|
|
482
|
-
blend:
|
|
483
|
-
shape:
|
|
484
|
-
crossfade:
|
|
485
|
-
},
|
|
480
|
+
function kr({ layer: e, readOnly: t = !1, editTabs: r = null }) {
|
|
481
|
+
let i = c(), s = ct(), { steps: l, curve: u, cycle: d, mode: f, resolution: p, editing: m, fileId: h, editRequest: g } = s, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = _e(), { buildSavedSpec: C } = Gt(), { addItem: w, updateItem: T } = Je(), E = Kn(), A = D(), j = ne(e?.id ?? null, { history: "coalesce" }), [ee, M] = Z("generate"), N = l[0], te = l.every((e) => e.loopId === N?.loopId), F = l.filter((e) => !Nt(K(e.loopId)) || !kt(K(e.loopId))), I = F.length === 0, R = {
|
|
482
|
+
blend: te ? null : "Blend tweens one generator — these steps are different generators",
|
|
483
|
+
shape: I ? null : `No outline to morph: ${F.map((e) => Qe(e, l.indexOf(e))).join(", ")} (GL)`,
|
|
484
|
+
crossfade: I ? null : `Cannot fade: ${F.map((e) => Qe(e, l.indexOf(e))).join(", ")} (GL)`
|
|
485
|
+
}, z = [
|
|
486
486
|
{
|
|
487
487
|
value: "shape",
|
|
488
488
|
label: "Shape",
|
|
489
|
-
disabled: !!
|
|
490
|
-
tooltip:
|
|
489
|
+
disabled: !!R.shape,
|
|
490
|
+
tooltip: R.shape ?? void 0
|
|
491
491
|
},
|
|
492
492
|
{
|
|
493
493
|
value: "blend",
|
|
494
494
|
label: "Blend",
|
|
495
|
-
disabled: !!
|
|
496
|
-
tooltip:
|
|
495
|
+
disabled: !!R.blend,
|
|
496
|
+
tooltip: R.blend ?? void 0
|
|
497
497
|
},
|
|
498
498
|
{
|
|
499
499
|
value: "crossfade",
|
|
500
500
|
label: "Crossfade",
|
|
501
|
-
disabled: !!
|
|
502
|
-
tooltip:
|
|
501
|
+
disabled: !!R.crossfade,
|
|
502
|
+
tooltip: R.crossfade ?? void 0
|
|
503
503
|
}
|
|
504
504
|
];
|
|
505
505
|
Y(() => {
|
|
506
|
-
if (t ||
|
|
506
|
+
if (t || l.length < 2 || !R[f]) return;
|
|
507
507
|
let e = [
|
|
508
508
|
"shape",
|
|
509
509
|
"crossfade",
|
|
510
510
|
"blend"
|
|
511
|
-
].find((e) => !
|
|
512
|
-
e &&
|
|
511
|
+
].find((e) => !R[e]);
|
|
512
|
+
e && q({ mode: e });
|
|
513
513
|
}, [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
514
|
+
f,
|
|
515
|
+
te,
|
|
516
|
+
I,
|
|
517
|
+
l.length,
|
|
518
518
|
t
|
|
519
519
|
]), Y(() => {
|
|
520
|
-
!t &&
|
|
520
|
+
!t && l.length === 0 && e?.type === "loop" && e.loopId && !e.morph && st(De(e));
|
|
521
521
|
}, []);
|
|
522
|
-
let
|
|
523
|
-
let t =
|
|
524
|
-
if (
|
|
522
|
+
let B = X(l.length), V = () => {
|
|
523
|
+
let t = l.length < B.current;
|
|
524
|
+
if (B.current = l.length, l.length < 2) {
|
|
525
525
|
if (!e || !t) return;
|
|
526
|
-
if (
|
|
526
|
+
if (l.length === 0) {
|
|
527
527
|
v(e.id);
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
530
|
let n = {};
|
|
531
531
|
for (let t in e) e[t]?.bind === "track" && (n[t] = e[t].keys?.[0]?.v);
|
|
532
|
-
let r =
|
|
532
|
+
let r = l[0];
|
|
533
533
|
_(e.id, {
|
|
534
534
|
...n,
|
|
535
535
|
loopGroup: r.loopGroup,
|
|
@@ -543,75 +543,75 @@ function Ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
545
545
|
let n = {
|
|
546
|
-
loopGroup:
|
|
547
|
-
presetId:
|
|
548
|
-
presetLabel:
|
|
549
|
-
loopId:
|
|
546
|
+
loopGroup: N.loopGroup,
|
|
547
|
+
presetId: N.presetId,
|
|
548
|
+
presetLabel: N.presetLabel,
|
|
549
|
+
loopId: N.loopId
|
|
550
550
|
}, r = {
|
|
551
|
-
mode:
|
|
552
|
-
steps:
|
|
551
|
+
mode: f,
|
|
552
|
+
steps: l.map((e, t) => ({
|
|
553
553
|
loopId: e.loopId,
|
|
554
554
|
params: e.params,
|
|
555
|
-
label:
|
|
555
|
+
label: Qe(e, t)
|
|
556
556
|
})),
|
|
557
|
-
cycle:
|
|
558
|
-
curve:
|
|
557
|
+
cycle: d,
|
|
558
|
+
curve: u,
|
|
559
559
|
resolution: p,
|
|
560
|
-
syncLoop:
|
|
561
|
-
name:
|
|
562
|
-
},
|
|
560
|
+
syncLoop: s.syncLoop,
|
|
561
|
+
name: s.fileName
|
|
562
|
+
}, i = f === "blend" ? {
|
|
563
563
|
...n,
|
|
564
|
-
|
|
565
|
-
snapshots:
|
|
566
|
-
schema:
|
|
567
|
-
curve:
|
|
568
|
-
cycle:
|
|
564
|
+
...at({
|
|
565
|
+
snapshots: l.map((e) => e.params),
|
|
566
|
+
schema: K(N.loopId)?.params ?? [],
|
|
567
|
+
curve: u,
|
|
568
|
+
cycle: d
|
|
569
569
|
}).patch,
|
|
570
570
|
morph: r,
|
|
571
571
|
morphT: null
|
|
572
572
|
} : {
|
|
573
573
|
...n,
|
|
574
|
-
...
|
|
574
|
+
...N.params,
|
|
575
575
|
morph: r,
|
|
576
576
|
morphT: {
|
|
577
577
|
bind: "track",
|
|
578
|
-
keys:
|
|
578
|
+
keys: Cn(l.length, d, u)
|
|
579
579
|
}
|
|
580
580
|
};
|
|
581
|
-
e ? _(e.id,
|
|
582
|
-
},
|
|
583
|
-
|
|
584
|
-
let
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
l,
|
|
581
|
+
e ? _(e.id, i) : S("loop", i);
|
|
582
|
+
}, H = X(V);
|
|
583
|
+
H.current = V;
|
|
584
|
+
let re = JSON.stringify([
|
|
585
|
+
f,
|
|
586
|
+
l.map((e) => [e.loopId, e.params]),
|
|
588
587
|
u,
|
|
588
|
+
d,
|
|
589
589
|
p,
|
|
590
|
-
|
|
591
|
-
]),
|
|
590
|
+
s.syncLoop
|
|
591
|
+
]), U = X(null);
|
|
592
592
|
Y(() => {
|
|
593
|
-
t || m != null ||
|
|
593
|
+
t || m != null || re === U.current || l.length >= 2 && R[f] || (U.current = re, H.current());
|
|
594
594
|
}, [
|
|
595
|
-
|
|
595
|
+
re,
|
|
596
596
|
m,
|
|
597
|
-
|
|
597
|
+
l.length,
|
|
598
598
|
t
|
|
599
599
|
]), Y(() => {
|
|
600
600
|
if (t || m == null || !e) return;
|
|
601
|
-
let n =
|
|
602
|
-
|
|
601
|
+
let n = ot(e, K(e.loopId)?.params ?? []);
|
|
602
|
+
Dr(n, l[m]?.params) || nt(m, n);
|
|
603
603
|
}, [e]), Y(() => {
|
|
604
|
-
t || !
|
|
604
|
+
t || !A || m == null || (q({ editing: null }), U.current = null);
|
|
605
605
|
}, [
|
|
606
|
-
|
|
606
|
+
A,
|
|
607
607
|
m,
|
|
608
608
|
t
|
|
609
609
|
]), Y(() => () => {
|
|
610
|
-
!t &&
|
|
610
|
+
!t && s.editing != null && (q({ editing: null }), H.current());
|
|
611
611
|
}, []);
|
|
612
|
-
let
|
|
613
|
-
let t =
|
|
614
|
-
t && (
|
|
612
|
+
let ie = (e) => {
|
|
613
|
+
let t = l[e];
|
|
614
|
+
t && (n.pause(), q({ editing: e }), S("loop", {
|
|
615
615
|
loopGroup: t.loopGroup,
|
|
616
616
|
presetId: t.presetId,
|
|
617
617
|
presetLabel: t.presetLabel,
|
|
@@ -622,80 +622,80 @@ function Ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
622
622
|
}));
|
|
623
623
|
};
|
|
624
624
|
return Y(() => {
|
|
625
|
-
t || g == null || (
|
|
625
|
+
t || g == null || (q({ editRequest: null }), ie(g));
|
|
626
626
|
}, [g]), /* @__PURE__ */ $("div", {
|
|
627
627
|
className: "flex flex-col gap-5",
|
|
628
628
|
children: [
|
|
629
|
-
/* @__PURE__ */ Q(
|
|
629
|
+
/* @__PURE__ */ Q(P, {
|
|
630
630
|
layout: "joined",
|
|
631
631
|
tone: "sunken",
|
|
632
|
-
value:
|
|
633
|
-
onChange: (e) => !t &&
|
|
634
|
-
options:
|
|
635
|
-
size:
|
|
636
|
-
className: a(
|
|
632
|
+
value: f,
|
|
633
|
+
onChange: (e) => !t && q({ mode: e }),
|
|
634
|
+
options: z,
|
|
635
|
+
size: i,
|
|
636
|
+
className: a(i)
|
|
637
637
|
}),
|
|
638
|
-
!t && /* @__PURE__ */ Q(
|
|
638
|
+
!t && /* @__PURE__ */ Q(k, {
|
|
639
639
|
divided: !0,
|
|
640
|
-
children: /* @__PURE__ */ Q(
|
|
641
|
-
tree:
|
|
642
|
-
presets:
|
|
643
|
-
current:
|
|
640
|
+
children: /* @__PURE__ */ Q(he, {
|
|
641
|
+
tree: gr(),
|
|
642
|
+
presets: hr(),
|
|
643
|
+
current: vr(s.presetId) ?? { typeLabel: lr.find((e) => e.id === f)?.label },
|
|
644
644
|
subLabel: (e) => e.split(" · ").pop(),
|
|
645
|
-
onPick:
|
|
645
|
+
onPick: yr
|
|
646
646
|
})
|
|
647
647
|
}),
|
|
648
|
-
/* @__PURE__ */ $(
|
|
648
|
+
/* @__PURE__ */ $(k, {
|
|
649
649
|
divided: !0,
|
|
650
650
|
children: [
|
|
651
|
-
/* @__PURE__ */ Q(
|
|
652
|
-
items:
|
|
651
|
+
/* @__PURE__ */ Q(Vn, {
|
|
652
|
+
items: l.map((e, t) => ({
|
|
653
653
|
id: t,
|
|
654
|
-
label:
|
|
654
|
+
label: Qe(e, t)
|
|
655
655
|
})),
|
|
656
656
|
activeIndex: m,
|
|
657
657
|
reorder: "grab",
|
|
658
658
|
readOnly: t,
|
|
659
|
-
size:
|
|
660
|
-
onSelect:
|
|
661
|
-
onRemove:
|
|
662
|
-
onMove:
|
|
663
|
-
onAdd: () =>
|
|
659
|
+
size: i,
|
|
660
|
+
onSelect: ie,
|
|
661
|
+
onRemove: tt,
|
|
662
|
+
onMove: Ze,
|
|
663
|
+
onAdd: () => q({
|
|
664
664
|
active: !0,
|
|
665
665
|
picker: "preset"
|
|
666
666
|
}),
|
|
667
667
|
addLabel: "Add a step"
|
|
668
668
|
}),
|
|
669
|
-
|
|
669
|
+
l.length < 2 && !t && /* @__PURE__ */ Q("p", {
|
|
670
670
|
className: "kol-mono-12 text-meta",
|
|
671
671
|
children: "Two steps or more and the stage plays the morph."
|
|
672
672
|
}),
|
|
673
|
-
|
|
673
|
+
l.length >= 2 && R[f] && /* @__PURE__ */ Q("p", {
|
|
674
674
|
className: "kol-mono-12 text-meta",
|
|
675
|
-
children:
|
|
675
|
+
children: R[f]
|
|
676
676
|
})
|
|
677
677
|
]
|
|
678
678
|
}),
|
|
679
|
-
m != null && !t && e &&
|
|
679
|
+
m != null && !t && e && r && /* @__PURE__ */ $(k, {
|
|
680
680
|
label: `Step ${m + 1}`,
|
|
681
681
|
divided: !0,
|
|
682
682
|
children: [
|
|
683
|
-
/* @__PURE__ */ Q(
|
|
683
|
+
/* @__PURE__ */ Q(P, {
|
|
684
684
|
layout: "joined",
|
|
685
685
|
tone: "sunken",
|
|
686
|
-
value:
|
|
687
|
-
onChange:
|
|
688
|
-
options:
|
|
689
|
-
size:
|
|
690
|
-
className: a(
|
|
686
|
+
value: ee,
|
|
687
|
+
onChange: M,
|
|
688
|
+
options: r,
|
|
689
|
+
size: i,
|
|
690
|
+
className: a(i)
|
|
691
691
|
}),
|
|
692
|
-
/* @__PURE__ */ Q(
|
|
692
|
+
/* @__PURE__ */ Q(Te, {
|
|
693
693
|
layer: e,
|
|
694
|
-
setProp:
|
|
695
|
-
patch:
|
|
694
|
+
setProp: j.setProp,
|
|
695
|
+
patch: j.patch,
|
|
696
696
|
updateLayer: _,
|
|
697
697
|
palette: x,
|
|
698
|
-
tab:
|
|
698
|
+
tab: ee,
|
|
699
699
|
tabStrip: null,
|
|
700
700
|
inline: !0,
|
|
701
701
|
picker: !1
|
|
@@ -710,48 +710,48 @@ function Ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
710
710
|
})
|
|
711
711
|
]
|
|
712
712
|
}),
|
|
713
|
-
/* @__PURE__ */ Q(
|
|
714
|
-
schema:
|
|
715
|
-
layer:
|
|
713
|
+
/* @__PURE__ */ Q(L, {
|
|
714
|
+
schema: Or,
|
|
715
|
+
layer: s,
|
|
716
716
|
setProp: (e, n) => {
|
|
717
|
-
!t && (typeof n != "object" || !n) &&
|
|
717
|
+
!t && (typeof n != "object" || !n) && q({ [e]: n });
|
|
718
718
|
},
|
|
719
719
|
inline: !0
|
|
720
720
|
}),
|
|
721
|
-
!t &&
|
|
721
|
+
!t && l.length >= 2 && /* @__PURE__ */ Q(k, {
|
|
722
722
|
divided: !0,
|
|
723
|
-
children: /* @__PURE__ */ Q(
|
|
723
|
+
children: /* @__PURE__ */ Q(O, {
|
|
724
724
|
tone: "primary",
|
|
725
|
-
size:
|
|
725
|
+
size: i,
|
|
726
726
|
className: "w-full",
|
|
727
727
|
onClick: async () => {
|
|
728
|
-
if (
|
|
729
|
-
let e =
|
|
728
|
+
if (l.length < 2) return;
|
|
729
|
+
let e = s.fileName;
|
|
730
730
|
if (!h && (e = await E.prompt("Name this morph:", ""), e === null)) return;
|
|
731
|
-
m != null && (
|
|
731
|
+
m != null && (q({ editing: null }), H.current());
|
|
732
732
|
let t = {
|
|
733
733
|
...await C(e || null),
|
|
734
734
|
mode: "morph",
|
|
735
735
|
morph: {
|
|
736
|
-
mode:
|
|
737
|
-
loopId:
|
|
738
|
-
steps:
|
|
739
|
-
curve:
|
|
740
|
-
cycle:
|
|
736
|
+
mode: f,
|
|
737
|
+
loopId: s.loopId,
|
|
738
|
+
steps: l,
|
|
739
|
+
curve: u,
|
|
740
|
+
cycle: d,
|
|
741
741
|
resolution: p,
|
|
742
|
-
syncLoop:
|
|
743
|
-
seconds:
|
|
742
|
+
syncLoop: s.syncLoop,
|
|
743
|
+
seconds: n.getLoopSeconds()
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
746
|
if (h) {
|
|
747
747
|
T("preset", h, t);
|
|
748
748
|
return;
|
|
749
749
|
}
|
|
750
|
-
let
|
|
751
|
-
|
|
752
|
-
fileId:
|
|
750
|
+
let r = w("preset", t);
|
|
751
|
+
r && (q({
|
|
752
|
+
fileId: r,
|
|
753
753
|
fileName: e || null
|
|
754
|
-
}), y(
|
|
754
|
+
}), y(r), b(e || null));
|
|
755
755
|
},
|
|
756
756
|
children: h ? "Save" : "Save…"
|
|
757
757
|
})
|
|
@@ -761,7 +761,7 @@ function Ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
761
761
|
}
|
|
762
762
|
//#endregion
|
|
763
763
|
//#region src/editor/params/QuickMotion.jsx
|
|
764
|
-
var
|
|
764
|
+
var Ar = [
|
|
765
765
|
{
|
|
766
766
|
value: "breathe",
|
|
767
767
|
label: "Breathe",
|
|
@@ -780,45 +780,45 @@ var jr = [
|
|
|
780
780
|
source: "lfo-square",
|
|
781
781
|
rate: 8
|
|
782
782
|
}
|
|
783
|
-
],
|
|
784
|
-
function
|
|
785
|
-
if (!
|
|
783
|
+
], jr = .2;
|
|
784
|
+
function Mr(e) {
|
|
785
|
+
if (!t(e)) return "off";
|
|
786
786
|
if (e.bind !== "mod") return "custom";
|
|
787
|
-
let
|
|
788
|
-
return
|
|
787
|
+
let n = Ar.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
788
|
+
return n ? n.value : "custom";
|
|
789
789
|
}
|
|
790
|
-
function
|
|
791
|
-
let
|
|
792
|
-
if (!
|
|
793
|
-
let
|
|
794
|
-
let
|
|
790
|
+
function Nr({ schema: e, layer: t, setProp: i, label: a = "Modulate" }) {
|
|
791
|
+
let o = c(), s = S(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && w(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
792
|
+
if (!s.length) return null;
|
|
793
|
+
let l = (e, r) => {
|
|
794
|
+
let a = t[e.key];
|
|
795
795
|
if (r === "off") {
|
|
796
|
-
let r =
|
|
797
|
-
|
|
796
|
+
let r = a?.transform?.range;
|
|
797
|
+
i(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : E(a, n.getCtx(), t) ?? e.default ?? e.min);
|
|
798
798
|
return;
|
|
799
799
|
}
|
|
800
|
-
let
|
|
801
|
-
if (!
|
|
802
|
-
let
|
|
803
|
-
|
|
800
|
+
let o = Ar.find((e) => e.value === r);
|
|
801
|
+
if (!o) return;
|
|
802
|
+
let s = Number(E(a, n.getCtx(), t) ?? e.default ?? e.min), c = (e.max - e.min) * jr, l = Math.max(e.min, s - c), u = Math.min(e.max, s + c);
|
|
803
|
+
i(e.key, {
|
|
804
804
|
bind: "mod",
|
|
805
|
-
source:
|
|
805
|
+
source: o.source,
|
|
806
806
|
transform: {
|
|
807
|
-
range: [
|
|
808
|
-
rate:
|
|
807
|
+
range: [l, u],
|
|
808
|
+
rate: o.rate
|
|
809
809
|
}
|
|
810
810
|
});
|
|
811
811
|
};
|
|
812
|
-
return /* @__PURE__ */ Q(
|
|
813
|
-
label:
|
|
812
|
+
return /* @__PURE__ */ Q(k, {
|
|
813
|
+
label: a,
|
|
814
814
|
divided: !0,
|
|
815
|
-
children:
|
|
816
|
-
let n =
|
|
815
|
+
children: s.map((e) => {
|
|
816
|
+
let n = Mr(t[e.key]), i = [
|
|
817
817
|
{
|
|
818
818
|
value: "off",
|
|
819
819
|
label: "Off"
|
|
820
820
|
},
|
|
821
|
-
...
|
|
821
|
+
...Ar.map(({ value: e, label: t }) => ({
|
|
822
822
|
value: e,
|
|
823
823
|
label: t
|
|
824
824
|
})),
|
|
@@ -827,17 +827,17 @@ function Pr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
827
827
|
label: "Custom"
|
|
828
828
|
}] : []
|
|
829
829
|
];
|
|
830
|
-
return /* @__PURE__ */ Q(
|
|
830
|
+
return /* @__PURE__ */ Q(C, {
|
|
831
831
|
label: e.label,
|
|
832
832
|
align: "fill",
|
|
833
|
-
labelWidth:
|
|
834
|
-
children: /* @__PURE__ */ Q(
|
|
835
|
-
size:
|
|
833
|
+
labelWidth: r,
|
|
834
|
+
children: /* @__PURE__ */ Q(v, {
|
|
835
|
+
size: o,
|
|
836
836
|
variant: "subtle",
|
|
837
837
|
className: "w-full",
|
|
838
|
-
options:
|
|
838
|
+
options: i,
|
|
839
839
|
value: n,
|
|
840
|
-
onChange: (t) => t !== "custom" &&
|
|
840
|
+
onChange: (t) => t !== "custom" && l(e, t)
|
|
841
841
|
})
|
|
842
842
|
}, e.key);
|
|
843
843
|
})
|
|
@@ -845,7 +845,7 @@ function Pr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/editor/params/InputRows.jsx
|
|
848
|
-
var
|
|
848
|
+
var Pr = [
|
|
849
849
|
{
|
|
850
850
|
value: "off",
|
|
851
851
|
label: "Off"
|
|
@@ -870,92 +870,92 @@ var Fr = [
|
|
|
870
870
|
value: "lfo-sine",
|
|
871
871
|
label: "LFO"
|
|
872
872
|
}
|
|
873
|
-
],
|
|
874
|
-
function
|
|
875
|
-
let
|
|
876
|
-
if (!
|
|
877
|
-
let
|
|
878
|
-
let n =
|
|
879
|
-
return
|
|
880
|
-
},
|
|
881
|
-
let
|
|
882
|
-
return Number(
|
|
883
|
-
},
|
|
884
|
-
let o =
|
|
885
|
-
|
|
873
|
+
], Fr = new Set(Pr.map((e) => e.value));
|
|
874
|
+
function Ir({ schema: e, layer: r, setProp: i, inputs: a = null }) {
|
|
875
|
+
let o = c(), s = S(e ?? [], r).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
876
|
+
if (!s.length) return null;
|
|
877
|
+
let l = new Map(s.map((e) => [e.key, e])), d = (a ?? []).filter((e) => l.has(e)), f = [...d, ...s.map((e) => e.key).filter((e) => !d.includes(e))], p = d.length ? d : f.slice(0, 3), m = (e) => {
|
|
878
|
+
let n = r[e];
|
|
879
|
+
return t(n) && n.bind === "mod" && Fr.has(n.source);
|
|
880
|
+
}, h = f.filter(m), g = (e) => {
|
|
881
|
+
let t = l.get(e);
|
|
882
|
+
return Number(E(r[e], n.getCtx(), r) ?? t.default ?? t.min);
|
|
883
|
+
}, _ = (e, n, a = t(r[e]) ? r[e].transform?.base ?? g(e) : g(e)) => {
|
|
884
|
+
let o = l.get(e);
|
|
885
|
+
u(n)?.ensure?.().catch(() => {}), i(e, {
|
|
886
886
|
bind: "mod",
|
|
887
|
-
source:
|
|
887
|
+
source: n,
|
|
888
888
|
transform: {
|
|
889
889
|
range: [o.min, o.max],
|
|
890
890
|
base: a,
|
|
891
|
-
...
|
|
891
|
+
...n.startsWith("lfo") ? { rate: 1 } : {}
|
|
892
892
|
}
|
|
893
893
|
});
|
|
894
|
-
},
|
|
895
|
-
return /* @__PURE__ */ $(
|
|
894
|
+
}, v = (e) => i(e, t(r[e]) ? r[e].transform?.base ?? g(e) : g(e)), y = p.find((e) => !m(e)) ?? f.find((e) => !m(e));
|
|
895
|
+
return /* @__PURE__ */ $(k, {
|
|
896
896
|
label: "Inputs",
|
|
897
897
|
divided: !0,
|
|
898
|
-
children: [
|
|
899
|
-
size:
|
|
898
|
+
children: [h.map((e) => /* @__PURE__ */ Q(zn, {
|
|
899
|
+
size: o,
|
|
900
900
|
className: "w-full [&>button]:w-full",
|
|
901
901
|
groups: [{
|
|
902
902
|
id: "source",
|
|
903
903
|
label: "Source",
|
|
904
|
-
options:
|
|
904
|
+
options: Pr
|
|
905
905
|
}, {
|
|
906
906
|
id: "drives",
|
|
907
907
|
label: "Drives",
|
|
908
|
-
options:
|
|
908
|
+
options: f.map((e) => ({
|
|
909
909
|
value: e,
|
|
910
|
-
label:
|
|
910
|
+
label: l.get(e).label + (p.includes(e) ? " ★" : "")
|
|
911
911
|
}))
|
|
912
912
|
}],
|
|
913
913
|
value: {
|
|
914
|
-
source:
|
|
914
|
+
source: r[e].source,
|
|
915
915
|
drives: e
|
|
916
916
|
},
|
|
917
|
-
label: `${
|
|
918
|
-
onChange: (
|
|
919
|
-
if (
|
|
920
|
-
|
|
917
|
+
label: `${Pr.find((t) => t.value === r[e].source)?.label} → ${l.get(e).label}`,
|
|
918
|
+
onChange: (t, n) => {
|
|
919
|
+
if (t === "source") {
|
|
920
|
+
n === "off" ? v(e) : _(e, n);
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
|
-
if (
|
|
924
|
-
let i =
|
|
925
|
-
|
|
923
|
+
if (n === e || m(n)) return;
|
|
924
|
+
let i = r[e].source;
|
|
925
|
+
v(e), _(n, i);
|
|
926
926
|
}
|
|
927
|
-
}, e)),
|
|
928
|
-
size:
|
|
927
|
+
}, e)), y && /* @__PURE__ */ Q(O, {
|
|
928
|
+
size: o,
|
|
929
929
|
iconLeft: "plus",
|
|
930
930
|
className: "w-full",
|
|
931
|
-
onClick: () =>
|
|
931
|
+
onClick: () => _(y, "mouseX"),
|
|
932
932
|
children: "Add input"
|
|
933
933
|
})]
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
936
|
//#endregion
|
|
937
937
|
//#region src/editor/labs/ModelSource.jsx
|
|
938
|
-
var
|
|
939
|
-
function
|
|
940
|
-
let n =
|
|
938
|
+
var Lr = /\.(obj|glb|gltf|stl)$/i, Rr = (e) => Lr.test(e.key ?? e.name ?? ""), zr = (e) => (e.match(Lr)?.[1] ?? "obj").toLowerCase(), Br = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
939
|
+
function Vr({ layer: e, setProp: t }) {
|
|
940
|
+
let n = c(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
941
941
|
t("meshSrc", e), t("meshType", n);
|
|
942
942
|
};
|
|
943
|
-
return /* @__PURE__ */ $(
|
|
943
|
+
return /* @__PURE__ */ $(k, {
|
|
944
944
|
label: "Model",
|
|
945
945
|
divided: !0,
|
|
946
946
|
children: [
|
|
947
947
|
/* @__PURE__ */ Q("span", {
|
|
948
948
|
className: "kol-mono-12 text-meta truncate",
|
|
949
|
-
children:
|
|
949
|
+
children: Br(e.meshSrc)
|
|
950
950
|
}),
|
|
951
951
|
/* @__PURE__ */ $("div", {
|
|
952
952
|
className: "grid grid-cols-2 gap-2",
|
|
953
|
-
children: [/* @__PURE__ */ Q(
|
|
953
|
+
children: [/* @__PURE__ */ Q(O, {
|
|
954
954
|
tone: "primary",
|
|
955
955
|
size: n,
|
|
956
956
|
onClick: () => i(!0),
|
|
957
957
|
children: "From library"
|
|
958
|
-
}), /* @__PURE__ */ Q(
|
|
958
|
+
}), /* @__PURE__ */ Q(O, {
|
|
959
959
|
tone: "primary",
|
|
960
960
|
size: n,
|
|
961
961
|
onClick: () => a.current?.click(),
|
|
@@ -971,15 +971,15 @@ function Hr({ layer: e, setProp: t }) {
|
|
|
971
971
|
let t = e.target.files?.[0];
|
|
972
972
|
if (e.target.value = "", !t) return;
|
|
973
973
|
let n = new FileReader();
|
|
974
|
-
n.onload = () => o(n.result,
|
|
974
|
+
n.onload = () => o(n.result, zr(t.name)), n.readAsDataURL(t);
|
|
975
975
|
}
|
|
976
976
|
}),
|
|
977
|
-
/* @__PURE__ */ Q(
|
|
977
|
+
/* @__PURE__ */ Q(Mn, {
|
|
978
978
|
open: r,
|
|
979
|
-
accept:
|
|
979
|
+
accept: Rr,
|
|
980
980
|
onClose: () => i(!1),
|
|
981
981
|
onSelect: (e) => {
|
|
982
|
-
i(!1), o(
|
|
982
|
+
i(!1), o(Qt(e), zr(e));
|
|
983
983
|
}
|
|
984
984
|
})
|
|
985
985
|
]
|
|
@@ -987,23 +987,23 @@ function Hr({ layer: e, setProp: t }) {
|
|
|
987
987
|
}
|
|
988
988
|
//#endregion
|
|
989
989
|
//#region src/editor/labs/useLabsKeys.js
|
|
990
|
-
function
|
|
990
|
+
function Hr(e, t) {
|
|
991
991
|
Y(() => {
|
|
992
992
|
let n = (n) => {
|
|
993
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
993
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || wt(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
994
994
|
};
|
|
995
995
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
996
996
|
});
|
|
997
997
|
}
|
|
998
998
|
//#endregion
|
|
999
999
|
//#region src/editor/labs/LabsParams.jsx
|
|
1000
|
-
var
|
|
1000
|
+
var Ur = [{
|
|
1001
1001
|
value: "effect",
|
|
1002
1002
|
label: "Effect"
|
|
1003
1003
|
}, {
|
|
1004
1004
|
value: "anim",
|
|
1005
1005
|
label: "Motion"
|
|
1006
|
-
}],
|
|
1006
|
+
}], Wr = [
|
|
1007
1007
|
{
|
|
1008
1008
|
value: "generate",
|
|
1009
1009
|
label: "Generate"
|
|
@@ -1016,7 +1016,7 @@ var Wr = [{
|
|
|
1016
1016
|
value: "anim",
|
|
1017
1017
|
label: "Animation"
|
|
1018
1018
|
}
|
|
1019
|
-
],
|
|
1019
|
+
], Gr = [
|
|
1020
1020
|
{
|
|
1021
1021
|
value: "generate",
|
|
1022
1022
|
label: "Gen"
|
|
@@ -1030,18 +1030,18 @@ var Wr = [{
|
|
|
1030
1030
|
label: "Anim"
|
|
1031
1031
|
}
|
|
1032
1032
|
];
|
|
1033
|
-
function
|
|
1034
|
-
let o =
|
|
1033
|
+
function Kr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
|
|
1034
|
+
let o = c();
|
|
1035
1035
|
return e?.length ? i ? /* @__PURE__ */ Q("div", {
|
|
1036
1036
|
className: "flex items-center gap-1 flex-wrap",
|
|
1037
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1037
|
+
children: e.map((e) => /* @__PURE__ */ Q(Hn, {
|
|
1038
1038
|
size: "xs",
|
|
1039
1039
|
hash: !1,
|
|
1040
1040
|
active: e.value === t,
|
|
1041
1041
|
onClick: () => n(e.value),
|
|
1042
1042
|
children: e.label
|
|
1043
1043
|
}, e.value))
|
|
1044
|
-
}) : /* @__PURE__ */ Q(
|
|
1044
|
+
}) : /* @__PURE__ */ Q(P, {
|
|
1045
1045
|
layout: "joined",
|
|
1046
1046
|
tone: "sunken",
|
|
1047
1047
|
value: t ?? null,
|
|
@@ -1052,26 +1052,26 @@ function qr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
|
|
|
1052
1052
|
className: a(o)
|
|
1053
1053
|
}) : null;
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1056
|
-
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i =
|
|
1055
|
+
function qr() {
|
|
1056
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = c(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1057
1057
|
"aria-hidden": "true",
|
|
1058
1058
|
className: "invisible pointer-events-none",
|
|
1059
1059
|
children: t
|
|
1060
1060
|
});
|
|
1061
|
-
return /* @__PURE__ */ $(
|
|
1061
|
+
return /* @__PURE__ */ $(Xn, { children: [a(n, /* @__PURE__ */ Q(Un, {
|
|
1062
1062
|
label: "Undo",
|
|
1063
1063
|
shortcut: "⌘Z",
|
|
1064
|
-
children: /* @__PURE__ */ Q(
|
|
1064
|
+
children: /* @__PURE__ */ Q(O, {
|
|
1065
1065
|
size: i,
|
|
1066
1066
|
iconOnly: "arrow-left",
|
|
1067
1067
|
"aria-label": "Undo",
|
|
1068
1068
|
tabIndex: n ? void 0 : -1,
|
|
1069
1069
|
onClick: e
|
|
1070
1070
|
})
|
|
1071
|
-
})), a(r, /* @__PURE__ */ Q(
|
|
1071
|
+
})), a(r, /* @__PURE__ */ Q(Un, {
|
|
1072
1072
|
label: "Redo",
|
|
1073
1073
|
shortcut: "⇧⌘Z",
|
|
1074
|
-
children: /* @__PURE__ */ Q(
|
|
1074
|
+
children: /* @__PURE__ */ Q(O, {
|
|
1075
1075
|
size: i,
|
|
1076
1076
|
iconOnly: "arrow-right",
|
|
1077
1077
|
"aria-label": "Redo",
|
|
@@ -1080,8 +1080,8 @@ function Jr() {
|
|
|
1080
1080
|
})
|
|
1081
1081
|
}))] });
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1084
|
-
let m =
|
|
1083
|
+
function Jr({ chips: e, active: t, onPick: n, spread: i, pills: a, title: o, tabStrip: s, preStrip: l, fx: u = !1, scope: d, ghostLabels: f, children: p }) {
|
|
1084
|
+
let m = c() === "sm", h = I() === "float";
|
|
1085
1085
|
return /* @__PURE__ */ $("div", {
|
|
1086
1086
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
1087
1087
|
"data-label-scope": d,
|
|
@@ -1089,53 +1089,53 @@ function Yr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tab
|
|
|
1089
1089
|
o && m && /* @__PURE__ */ $("div", {
|
|
1090
1090
|
className: "flex items-center gap-1",
|
|
1091
1091
|
children: [/* @__PURE__ */ Q("p", {
|
|
1092
|
-
className: "kol-eyebrow text-fg-96 flex-1 min-w-0
|
|
1092
|
+
className: `${h ? "kol-float-label text-fg-emphasis" : "kol-eyebrow text-fg-96"} flex-1 min-w-0`,
|
|
1093
1093
|
children: o
|
|
1094
|
-
}), /* @__PURE__ */ Q(
|
|
1094
|
+
}), /* @__PURE__ */ Q(qr, {})]
|
|
1095
1095
|
}),
|
|
1096
|
-
e && /* @__PURE__ */ Q(
|
|
1096
|
+
e && /* @__PURE__ */ Q(Kr, {
|
|
1097
1097
|
options: e,
|
|
1098
1098
|
active: t,
|
|
1099
1099
|
onPick: n,
|
|
1100
|
-
spread:
|
|
1100
|
+
spread: i,
|
|
1101
1101
|
pills: a
|
|
1102
1102
|
}),
|
|
1103
1103
|
l,
|
|
1104
|
-
|
|
1104
|
+
s,
|
|
1105
1105
|
p,
|
|
1106
1106
|
f?.length > 0 && /* @__PURE__ */ Q("div", {
|
|
1107
1107
|
"aria-hidden": "true",
|
|
1108
1108
|
className: "invisible h-0 overflow-hidden flex flex-col",
|
|
1109
1109
|
children: f.map((e, t) => /* @__PURE__ */ Q("span", {
|
|
1110
1110
|
className: "kol-helper-10 tracking-widest whitespace-nowrap",
|
|
1111
|
-
style: { width:
|
|
1111
|
+
style: { width: r },
|
|
1112
1112
|
children: String(e).toUpperCase()
|
|
1113
1113
|
}, t))
|
|
1114
1114
|
})
|
|
1115
1115
|
]
|
|
1116
1116
|
});
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1119
|
-
let
|
|
1118
|
+
function Yr({ layer: e, showMod: t }) {
|
|
1119
|
+
let n = s(), i = c(), [l, u] = Z("effect");
|
|
1120
1120
|
Y(() => {
|
|
1121
|
-
let e = () =>
|
|
1121
|
+
let e = () => u("effect");
|
|
1122
1122
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
1123
1123
|
}, []);
|
|
1124
|
-
let { addFilter:
|
|
1124
|
+
let { addFilter: d, replaceFilter: f, removeFilter: p, toggleFilter: g, updateLayer: _, palette: y } = o(), S = ne(e.id, { history: "coalesce" }), T = x(e), E = T.findIndex((e) => !e.def?.first), D = E < 0 ? T.length : E, j = E < 0 ? null : T[E], ee = le(W).find((e) => e.id === ce(j?.id)), N = ee?.id === "halftone", te = N ? (ee?.filters ?? []).map((e) => ({
|
|
1125
1125
|
value: e.id,
|
|
1126
1126
|
label: e.label
|
|
1127
|
-
})) : null,
|
|
1128
|
-
if (!
|
|
1129
|
-
|
|
1127
|
+
})) : null, F = !N && j ? j.def.label : null, I = (t) => {
|
|
1128
|
+
if (!j) {
|
|
1129
|
+
d(e.id, t);
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
|
-
|
|
1133
|
-
},
|
|
1134
|
-
...
|
|
1135
|
-
...
|
|
1136
|
-
id:
|
|
1137
|
-
} :
|
|
1138
|
-
let r =
|
|
1132
|
+
t !== j.id && f(e.id, D, t);
|
|
1133
|
+
}, z = T.map(({ def: e, ...t }) => t), B = j ? {
|
|
1134
|
+
...e,
|
|
1135
|
+
...j.params,
|
|
1136
|
+
id: e.id
|
|
1137
|
+
} : e, V = (e) => (t, n) => {
|
|
1138
|
+
let r = z.map((r, i) => i === e ? {
|
|
1139
1139
|
...r,
|
|
1140
1140
|
params: {
|
|
1141
1141
|
...r.params,
|
|
@@ -1143,252 +1143,252 @@ function Xr({ layer: t, showMod: n }) {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
} : r);
|
|
1145
1145
|
S.patch({ filters: r });
|
|
1146
|
-
},
|
|
1147
|
-
layer:
|
|
1146
|
+
}, H = V(D), re = t ? (e) => /* @__PURE__ */ Q(dt, {
|
|
1147
|
+
layer: B,
|
|
1148
1148
|
param: e,
|
|
1149
|
-
setProp:
|
|
1150
|
-
}) : void 0,
|
|
1151
|
-
let n =
|
|
1152
|
-
...
|
|
1149
|
+
setProp: H
|
|
1150
|
+
}) : void 0, U = (t) => {
|
|
1151
|
+
let n = z.map((e, n) => n === D ? {
|
|
1152
|
+
...e,
|
|
1153
1153
|
params: {
|
|
1154
|
-
...
|
|
1155
|
-
...
|
|
1154
|
+
...e.params,
|
|
1155
|
+
...t
|
|
1156
1156
|
}
|
|
1157
|
-
} :
|
|
1158
|
-
|
|
1157
|
+
} : e);
|
|
1158
|
+
_(e.id, { filters: n });
|
|
1159
1159
|
};
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
Hr(() => {
|
|
1161
|
+
j && _(e.id, { filters: z.map((e, t) => t === 0 ? {
|
|
1162
1162
|
...e,
|
|
1163
1163
|
params: {}
|
|
1164
1164
|
} : e) });
|
|
1165
1165
|
}, () => {
|
|
1166
|
-
|
|
1166
|
+
j && U(h(B, A(j.def.params, B), M()));
|
|
1167
1167
|
});
|
|
1168
|
-
let
|
|
1169
|
-
if (
|
|
1170
|
-
let
|
|
1171
|
-
chain:
|
|
1172
|
-
layer:
|
|
1173
|
-
hostView:
|
|
1174
|
-
toggleFilter:
|
|
1175
|
-
removeFilter:
|
|
1176
|
-
setStagePropAt:
|
|
1177
|
-
palette:
|
|
1178
|
-
showMod:
|
|
1168
|
+
let ae = e.fxGroup ? ue.find((t) => t.id === e.fxGroup) : null;
|
|
1169
|
+
if (ae) {
|
|
1170
|
+
let n = {
|
|
1171
|
+
chain: T,
|
|
1172
|
+
layer: e,
|
|
1173
|
+
hostView: B,
|
|
1174
|
+
toggleFilter: g,
|
|
1175
|
+
removeFilter: p,
|
|
1176
|
+
setStagePropAt: V,
|
|
1177
|
+
palette: y,
|
|
1178
|
+
showMod: t
|
|
1179
1179
|
}, r = [{
|
|
1180
1180
|
value: "",
|
|
1181
1181
|
label: "Add effect…"
|
|
1182
|
-
}, ...
|
|
1182
|
+
}, ...ie(ae, W).map((e) => ({
|
|
1183
1183
|
value: e.id,
|
|
1184
1184
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1185
1185
|
}))];
|
|
1186
|
-
return /* @__PURE__ */ $(
|
|
1186
|
+
return /* @__PURE__ */ $(Jr, {
|
|
1187
1187
|
title: "Effects",
|
|
1188
1188
|
fx: !0,
|
|
1189
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1189
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1190
1190
|
layout: "joined",
|
|
1191
1191
|
tone: "sunken",
|
|
1192
|
-
value:
|
|
1193
|
-
onChange:
|
|
1194
|
-
options:
|
|
1195
|
-
size:
|
|
1196
|
-
className: a(
|
|
1192
|
+
value: l,
|
|
1193
|
+
onChange: u,
|
|
1194
|
+
options: Ur,
|
|
1195
|
+
size: i,
|
|
1196
|
+
className: a(i)
|
|
1197
1197
|
}),
|
|
1198
|
-
children: [
|
|
1199
|
-
/* @__PURE__ */ $(
|
|
1198
|
+
children: [l === "effect" && /* @__PURE__ */ $(Xn, { children: [
|
|
1199
|
+
/* @__PURE__ */ $(k, {
|
|
1200
1200
|
label: "Effect stack",
|
|
1201
1201
|
divided: !0,
|
|
1202
|
-
children: [
|
|
1202
|
+
children: [T.length === 0 && /* @__PURE__ */ Q(R, {
|
|
1203
1203
|
className: "kol-mono-10 text-meta",
|
|
1204
1204
|
children: "No effects yet — add one below."
|
|
1205
|
-
}), /* @__PURE__ */ Q(
|
|
1206
|
-
...
|
|
1205
|
+
}), /* @__PURE__ */ Q($r, {
|
|
1206
|
+
...n,
|
|
1207
1207
|
from: 0
|
|
1208
1208
|
})]
|
|
1209
1209
|
}),
|
|
1210
|
-
/* @__PURE__ */ Q(
|
|
1211
|
-
|
|
1212
|
-
label:
|
|
1210
|
+
/* @__PURE__ */ Q(Rn, {}),
|
|
1211
|
+
T.length < 8 && /* @__PURE__ */ Q(k, {
|
|
1212
|
+
label: ae.label,
|
|
1213
1213
|
divided: !0,
|
|
1214
|
-
children: /* @__PURE__ */ Q(
|
|
1214
|
+
children: /* @__PURE__ */ Q(v, {
|
|
1215
1215
|
variant: "subtle",
|
|
1216
|
-
size:
|
|
1216
|
+
size: i,
|
|
1217
1217
|
className: "w-full",
|
|
1218
1218
|
options: r,
|
|
1219
1219
|
value: "",
|
|
1220
|
-
onChange: (
|
|
1221
|
-
|
|
1220
|
+
onChange: (t) => {
|
|
1221
|
+
t && d(e.id, t);
|
|
1222
1222
|
}
|
|
1223
1223
|
})
|
|
1224
1224
|
})
|
|
1225
|
-
] }),
|
|
1226
|
-
sweeps: Array.isArray(
|
|
1227
|
-
onChange: (e) =>
|
|
1225
|
+
] }), l === "anim" && j?.def?.sweeps && /* @__PURE__ */ Q(pt, {
|
|
1226
|
+
sweeps: Array.isArray(j.params.sweeps) ? j.params.sweeps : [],
|
|
1227
|
+
onChange: (e) => H("sweeps", e),
|
|
1228
1228
|
inline: !0
|
|
1229
1229
|
})]
|
|
1230
1230
|
});
|
|
1231
1231
|
}
|
|
1232
|
-
if (!
|
|
1233
|
-
chips:
|
|
1232
|
+
if (!j) return /* @__PURE__ */ Q(Jr, {
|
|
1233
|
+
chips: te,
|
|
1234
1234
|
active: null,
|
|
1235
|
-
onPick:
|
|
1236
|
-
spread:
|
|
1235
|
+
onPick: I,
|
|
1236
|
+
spread: N,
|
|
1237
1237
|
fx: !0,
|
|
1238
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1238
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1239
1239
|
layout: "joined",
|
|
1240
1240
|
tone: "sunken",
|
|
1241
|
-
value:
|
|
1242
|
-
onChange:
|
|
1243
|
-
options:
|
|
1244
|
-
size:
|
|
1245
|
-
className: a(
|
|
1241
|
+
value: l,
|
|
1242
|
+
onChange: u,
|
|
1243
|
+
options: Ur,
|
|
1244
|
+
size: i,
|
|
1245
|
+
className: a(i)
|
|
1246
1246
|
}),
|
|
1247
|
-
children: /* @__PURE__ */ Q(
|
|
1248
|
-
schema:
|
|
1249
|
-
layer:
|
|
1247
|
+
children: /* @__PURE__ */ Q(L, {
|
|
1248
|
+
schema: Yt,
|
|
1249
|
+
layer: e,
|
|
1250
1250
|
setProp: S.setProp,
|
|
1251
|
-
palette:
|
|
1252
|
-
renderAnimate: (
|
|
1253
|
-
layer:
|
|
1254
|
-
param:
|
|
1251
|
+
palette: y,
|
|
1252
|
+
renderAnimate: (t) => /* @__PURE__ */ Q(dt, {
|
|
1253
|
+
layer: e,
|
|
1254
|
+
param: t,
|
|
1255
1255
|
setProp: S.setProp
|
|
1256
1256
|
}),
|
|
1257
|
-
tab:
|
|
1257
|
+
tab: l === "anim" ? "anim" : "style",
|
|
1258
1258
|
emptyHint: "Pick an effect from the nav."
|
|
1259
1259
|
})
|
|
1260
1260
|
});
|
|
1261
|
-
let
|
|
1262
|
-
if (
|
|
1263
|
-
let e =
|
|
1264
|
-
for (; e + 1 <
|
|
1265
|
-
|
|
1261
|
+
let G = j.def.params.filter((e) => w(e) !== "anim"), se = oe(j.def.id), fe = se ? G.findIndex((e) => e.key === se) : -1, pe = G.length;
|
|
1262
|
+
if (fe >= 0) {
|
|
1263
|
+
let e = fe;
|
|
1264
|
+
for (; e + 1 < G.length && G[e + 1].type === "select";) e++;
|
|
1265
|
+
pe = e + 1;
|
|
1266
1266
|
}
|
|
1267
|
-
let
|
|
1267
|
+
let K = fe > 0 ? G.slice(0, fe) : [], me = fe >= 0 ? G.slice(fe, pe).map((e) => ({
|
|
1268
1268
|
...e,
|
|
1269
1269
|
section: void 0
|
|
1270
|
-
})) :
|
|
1271
|
-
layer:
|
|
1272
|
-
setProp:
|
|
1273
|
-
palette:
|
|
1274
|
-
renderAnimate:
|
|
1270
|
+
})) : G, he = {
|
|
1271
|
+
layer: B,
|
|
1272
|
+
setProp: H,
|
|
1273
|
+
palette: y,
|
|
1274
|
+
renderAnimate: re,
|
|
1275
1275
|
inline: !0
|
|
1276
1276
|
};
|
|
1277
|
-
return /* @__PURE__ */ $(
|
|
1278
|
-
chips:
|
|
1279
|
-
active:
|
|
1280
|
-
onPick:
|
|
1281
|
-
spread:
|
|
1282
|
-
title:
|
|
1277
|
+
return /* @__PURE__ */ $(Jr, {
|
|
1278
|
+
chips: te,
|
|
1279
|
+
active: j.id,
|
|
1280
|
+
onPick: I,
|
|
1281
|
+
spread: N,
|
|
1282
|
+
title: F,
|
|
1283
1283
|
fx: !0,
|
|
1284
|
-
scope:
|
|
1285
|
-
ghostLabels:
|
|
1286
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1284
|
+
scope: j.id,
|
|
1285
|
+
ghostLabels: j.def.params.map((e) => e.label).filter(Boolean),
|
|
1286
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1287
1287
|
layout: "joined",
|
|
1288
1288
|
tone: "sunken",
|
|
1289
|
-
value:
|
|
1290
|
-
onChange:
|
|
1291
|
-
options:
|
|
1292
|
-
size:
|
|
1293
|
-
className: a(
|
|
1289
|
+
value: l,
|
|
1290
|
+
onChange: u,
|
|
1291
|
+
options: Ur,
|
|
1292
|
+
size: i,
|
|
1293
|
+
className: a(i)
|
|
1294
1294
|
}),
|
|
1295
|
-
children: [
|
|
1296
|
-
|
|
1297
|
-
schema:
|
|
1298
|
-
...
|
|
1295
|
+
children: [l === "effect" && /* @__PURE__ */ $(Xn, { children: [
|
|
1296
|
+
K.length > 0 && /* @__PURE__ */ Q(L, {
|
|
1297
|
+
schema: K,
|
|
1298
|
+
...he
|
|
1299
1299
|
}),
|
|
1300
|
-
/* @__PURE__ */ $(
|
|
1300
|
+
/* @__PURE__ */ $(k, {
|
|
1301
1301
|
divided: !0,
|
|
1302
|
-
children: [/* @__PURE__ */ Q(
|
|
1303
|
-
schema:
|
|
1304
|
-
...
|
|
1305
|
-
}), /* @__PURE__ */ Q(
|
|
1302
|
+
children: [/* @__PURE__ */ Q(L, {
|
|
1303
|
+
schema: me,
|
|
1304
|
+
...he
|
|
1305
|
+
}), /* @__PURE__ */ Q(ft, {
|
|
1306
1306
|
inline: !0,
|
|
1307
|
-
def:
|
|
1308
|
-
view:
|
|
1307
|
+
def: j.def,
|
|
1308
|
+
view: B,
|
|
1309
1309
|
tab: "effect",
|
|
1310
|
-
onPatch:
|
|
1311
|
-
levels: /* @__PURE__ */ $(
|
|
1310
|
+
onPatch: U,
|
|
1311
|
+
levels: /* @__PURE__ */ $(Xn, { children: [
|
|
1312
1312
|
[
|
|
1313
1313
|
["type", "Type"],
|
|
1314
1314
|
["category", "Category"],
|
|
1315
1315
|
["preset", "Preset"]
|
|
1316
|
-
].filter(([e]) =>
|
|
1316
|
+
].filter(([e]) => Ce(j.def, e)).map(([t, n]) => /* @__PURE__ */ Q(O, {
|
|
1317
1317
|
tone: "primary",
|
|
1318
|
-
size:
|
|
1318
|
+
size: i,
|
|
1319
1319
|
className: "flex-1 min-w-0",
|
|
1320
1320
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
1321
1321
|
onClick: () => {
|
|
1322
|
-
let n =
|
|
1323
|
-
if (
|
|
1324
|
-
let e =
|
|
1325
|
-
e != null &&
|
|
1322
|
+
let n = b(M() >>> 0);
|
|
1323
|
+
if (t === "preset") {
|
|
1324
|
+
let e = ge(j.def, B, n);
|
|
1325
|
+
e != null && U(de(j.def, e));
|
|
1326
1326
|
return;
|
|
1327
1327
|
}
|
|
1328
|
-
let r =
|
|
1329
|
-
r &&
|
|
1328
|
+
let r = be(j.id, t, n);
|
|
1329
|
+
r && f(e.id, D, r);
|
|
1330
1330
|
},
|
|
1331
1331
|
children: n
|
|
1332
|
-
},
|
|
1333
|
-
/* @__PURE__ */ Q(
|
|
1332
|
+
}, t)),
|
|
1333
|
+
/* @__PURE__ */ Q(O, {
|
|
1334
1334
|
tone: "primary",
|
|
1335
|
-
size:
|
|
1335
|
+
size: i,
|
|
1336
1336
|
className: "flex-1 min-w-0",
|
|
1337
1337
|
"aria-label": "Randomize settings",
|
|
1338
1338
|
onClick: () => {
|
|
1339
|
-
|
|
1339
|
+
U(xe(B, A(j.def.params.filter((e) => w(e) !== "anim"), B), b(M() >>> 0)));
|
|
1340
1340
|
},
|
|
1341
1341
|
children: "Settings"
|
|
1342
1342
|
}),
|
|
1343
|
-
/* @__PURE__ */ Q(
|
|
1344
|
-
def:
|
|
1343
|
+
/* @__PURE__ */ Q(Oe, {
|
|
1344
|
+
def: j.def,
|
|
1345
1345
|
isFilter: !0
|
|
1346
1346
|
})
|
|
1347
1347
|
] })
|
|
1348
1348
|
})]
|
|
1349
1349
|
}),
|
|
1350
|
-
/* @__PURE__ */ Q(
|
|
1351
|
-
|
|
1352
|
-
schema:
|
|
1353
|
-
...
|
|
1354
|
-
}), /* @__PURE__ */ Q(
|
|
1355
|
-
/* @__PURE__ */ Q(
|
|
1356
|
-
chain:
|
|
1357
|
-
from:
|
|
1358
|
-
layer:
|
|
1359
|
-
hostView:
|
|
1360
|
-
addFilter:
|
|
1361
|
-
removeFilter:
|
|
1362
|
-
toggleFilter:
|
|
1363
|
-
setStagePropAt:
|
|
1364
|
-
palette:
|
|
1365
|
-
showMod:
|
|
1350
|
+
/* @__PURE__ */ Q(Rn, {}),
|
|
1351
|
+
pe < G.length && /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q(L, {
|
|
1352
|
+
schema: G.slice(pe),
|
|
1353
|
+
...he
|
|
1354
|
+
}), /* @__PURE__ */ Q(Rn, {})] }),
|
|
1355
|
+
/* @__PURE__ */ Q(ei, {
|
|
1356
|
+
chain: T,
|
|
1357
|
+
from: D + 1,
|
|
1358
|
+
layer: e,
|
|
1359
|
+
hostView: B,
|
|
1360
|
+
addFilter: d,
|
|
1361
|
+
removeFilter: p,
|
|
1362
|
+
toggleFilter: g,
|
|
1363
|
+
setStagePropAt: V,
|
|
1364
|
+
palette: y,
|
|
1365
|
+
showMod: t
|
|
1366
1366
|
})
|
|
1367
|
-
] }),
|
|
1368
|
-
/* @__PURE__ */ Q(
|
|
1369
|
-
schema:
|
|
1370
|
-
layer:
|
|
1371
|
-
setProp:
|
|
1372
|
-
inputs:
|
|
1367
|
+
] }), l === "anim" && /* @__PURE__ */ $(Xn, { children: [
|
|
1368
|
+
/* @__PURE__ */ Q(Ir, {
|
|
1369
|
+
schema: j.def.params,
|
|
1370
|
+
layer: B,
|
|
1371
|
+
setProp: H,
|
|
1372
|
+
inputs: j.def.inputs
|
|
1373
1373
|
}),
|
|
1374
|
-
/* @__PURE__ */ Q(
|
|
1375
|
-
schema:
|
|
1376
|
-
...
|
|
1374
|
+
/* @__PURE__ */ Q(L, {
|
|
1375
|
+
schema: j.def.params,
|
|
1376
|
+
...he,
|
|
1377
1377
|
tab: "anim"
|
|
1378
1378
|
}),
|
|
1379
|
-
|
|
1379
|
+
j.def.orbit && /* @__PURE__ */ Q(k, {
|
|
1380
1380
|
label: "Interaction",
|
|
1381
1381
|
divided: !0,
|
|
1382
|
-
children: /* @__PURE__ */ Q(
|
|
1382
|
+
children: /* @__PURE__ */ Q(C, {
|
|
1383
1383
|
label: "ORBIT (C)",
|
|
1384
1384
|
align: "fill",
|
|
1385
|
-
labelWidth:
|
|
1386
|
-
children: /* @__PURE__ */ Q(
|
|
1385
|
+
labelWidth: r,
|
|
1386
|
+
children: /* @__PURE__ */ Q(P, {
|
|
1387
1387
|
layout: "joined",
|
|
1388
1388
|
tone: "sunken",
|
|
1389
|
-
size:
|
|
1389
|
+
size: i,
|
|
1390
1390
|
className: "w-full",
|
|
1391
|
-
value:
|
|
1391
|
+
value: n.grab && B.orbit !== !1 ? "on" : "off",
|
|
1392
1392
|
options: [{
|
|
1393
1393
|
value: "off",
|
|
1394
1394
|
label: "Off"
|
|
@@ -1396,52 +1396,52 @@ function Xr({ layer: t, showMod: n }) {
|
|
|
1396
1396
|
value: "on",
|
|
1397
1397
|
label: "On"
|
|
1398
1398
|
}],
|
|
1399
|
-
onChange: (
|
|
1400
|
-
|
|
1399
|
+
onChange: (e) => {
|
|
1400
|
+
H("orbit", e === "on"), e === "on" && !n.grab && m("grab", !0);
|
|
1401
1401
|
}
|
|
1402
1402
|
})
|
|
1403
1403
|
})
|
|
1404
1404
|
}),
|
|
1405
|
-
/* @__PURE__ */ Q(
|
|
1405
|
+
/* @__PURE__ */ Q(k, {
|
|
1406
1406
|
divided: !0,
|
|
1407
|
-
children: /* @__PURE__ */ Q(
|
|
1407
|
+
children: /* @__PURE__ */ Q(ft, {
|
|
1408
1408
|
inline: !0,
|
|
1409
|
-
def:
|
|
1410
|
-
view:
|
|
1409
|
+
def: j.def,
|
|
1410
|
+
view: B,
|
|
1411
1411
|
tab: "anim",
|
|
1412
|
-
onPatch:
|
|
1412
|
+
onPatch: U
|
|
1413
1413
|
})
|
|
1414
1414
|
}),
|
|
1415
|
-
|
|
1416
|
-
sweeps: Array.isArray(
|
|
1417
|
-
onChange: (e) =>
|
|
1415
|
+
j.def.sweeps && /* @__PURE__ */ Q(pt, {
|
|
1416
|
+
sweeps: Array.isArray(j.params.sweeps) ? j.params.sweeps : [],
|
|
1417
|
+
onChange: (e) => H("sweeps", e),
|
|
1418
1418
|
inline: !0
|
|
1419
1419
|
}),
|
|
1420
|
-
/* @__PURE__ */ Q(
|
|
1421
|
-
schema:
|
|
1422
|
-
layer:
|
|
1423
|
-
setProp:
|
|
1420
|
+
/* @__PURE__ */ Q(Nr, {
|
|
1421
|
+
schema: j.def.params,
|
|
1422
|
+
layer: B,
|
|
1423
|
+
setProp: H
|
|
1424
1424
|
}),
|
|
1425
|
-
/* @__PURE__ */ Q(
|
|
1426
|
-
chain:
|
|
1427
|
-
layer:
|
|
1428
|
-
hostView:
|
|
1429
|
-
addFilter:
|
|
1430
|
-
removeFilter:
|
|
1431
|
-
setStagePropAt:
|
|
1432
|
-
palette:
|
|
1433
|
-
showMod:
|
|
1425
|
+
/* @__PURE__ */ Q(Qr, {
|
|
1426
|
+
chain: T,
|
|
1427
|
+
layer: e,
|
|
1428
|
+
hostView: B,
|
|
1429
|
+
addFilter: d,
|
|
1430
|
+
removeFilter: p,
|
|
1431
|
+
setStagePropAt: V,
|
|
1432
|
+
palette: y,
|
|
1433
|
+
showMod: t
|
|
1434
1434
|
})
|
|
1435
1435
|
] })]
|
|
1436
1436
|
});
|
|
1437
1437
|
}
|
|
1438
|
-
var
|
|
1439
|
-
function
|
|
1440
|
-
let { addFilter: i, removeFilter: a, toggleFilter: s } = o(), c =
|
|
1441
|
-
return /* @__PURE__ */ Q(
|
|
1438
|
+
var Xr = W.filter((e) => !e.kind && !e.first);
|
|
1439
|
+
function Zr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1440
|
+
let { addFilter: i, removeFilter: a, toggleFilter: s } = o(), c = x(e), l = c.map(({ def: e, ...t }) => t);
|
|
1441
|
+
return /* @__PURE__ */ Q(ei, {
|
|
1442
1442
|
chain: c,
|
|
1443
1443
|
from: 0,
|
|
1444
|
-
filters:
|
|
1444
|
+
filters: Xr,
|
|
1445
1445
|
layer: e,
|
|
1446
1446
|
hostView: e,
|
|
1447
1447
|
addFilter: i,
|
|
@@ -1458,27 +1458,27 @@ function Qr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1458
1458
|
showMod: r
|
|
1459
1459
|
});
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1462
|
-
let l =
|
|
1461
|
+
function Qr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: a, palette: o, showMod: s }) {
|
|
1462
|
+
let l = c(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1463
1463
|
...n,
|
|
1464
1464
|
...d.params,
|
|
1465
1465
|
id: t.id
|
|
1466
1466
|
} : null, p = d ? a(u) : null;
|
|
1467
|
-
return /* @__PURE__ */ Q(
|
|
1467
|
+
return /* @__PURE__ */ Q(k, {
|
|
1468
1468
|
label: "Media",
|
|
1469
1469
|
divided: !0,
|
|
1470
|
-
children: d?.def ? /* @__PURE__ */ $(
|
|
1470
|
+
children: d?.def ? /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q(L, {
|
|
1471
1471
|
schema: d.def.params,
|
|
1472
1472
|
layer: f,
|
|
1473
1473
|
setProp: p,
|
|
1474
1474
|
palette: o,
|
|
1475
1475
|
inline: !0,
|
|
1476
|
-
renderAnimate:
|
|
1476
|
+
renderAnimate: s ? (e) => /* @__PURE__ */ Q(dt, {
|
|
1477
1477
|
layer: f,
|
|
1478
1478
|
param: e,
|
|
1479
1479
|
setProp: p
|
|
1480
1480
|
}) : void 0
|
|
1481
|
-
}), /* @__PURE__ */ Q(
|
|
1481
|
+
}), /* @__PURE__ */ Q(O, {
|
|
1482
1482
|
tone: "primary",
|
|
1483
1483
|
size: l,
|
|
1484
1484
|
className: "w-full",
|
|
@@ -1486,7 +1486,7 @@ function $r({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1486
1486
|
iconSize: 12,
|
|
1487
1487
|
onClick: () => i(t.id, u),
|
|
1488
1488
|
children: "Remove media motion"
|
|
1489
|
-
})] }) : e.length < 8 && /* @__PURE__ */ Q(
|
|
1489
|
+
})] }) : e.length < 8 && /* @__PURE__ */ Q(O, {
|
|
1490
1490
|
tone: "primary",
|
|
1491
1491
|
size: l,
|
|
1492
1492
|
className: "w-full",
|
|
@@ -1497,10 +1497,10 @@ function $r({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1497
1497
|
})
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1501
|
-
let u =
|
|
1502
|
-
return e.slice(t).map((e,
|
|
1503
|
-
let d =
|
|
1500
|
+
function $r({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: s, showMod: l }) {
|
|
1501
|
+
let u = c();
|
|
1502
|
+
return e.slice(t).map((e, c) => {
|
|
1503
|
+
let d = c + t, f = e.enabled !== !1, p = {
|
|
1504
1504
|
...r,
|
|
1505
1505
|
...e.params,
|
|
1506
1506
|
id: n.id
|
|
@@ -1509,15 +1509,15 @@ function ei({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1509
1509
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1510
1510
|
children: [/* @__PURE__ */ $("div", {
|
|
1511
1511
|
className: "flex items-center gap-2",
|
|
1512
|
-
children: [/* @__PURE__ */ Q(
|
|
1512
|
+
children: [/* @__PURE__ */ Q(F, {
|
|
1513
1513
|
size: u,
|
|
1514
1514
|
checked: f,
|
|
1515
1515
|
onChange: () => i(n.id, d),
|
|
1516
1516
|
label: e.def?.label ?? e.id
|
|
1517
|
-
}), /* @__PURE__ */ Q(
|
|
1517
|
+
}), /* @__PURE__ */ Q(Un, {
|
|
1518
1518
|
asChild: !0,
|
|
1519
1519
|
label: "Delete effect",
|
|
1520
|
-
children: /* @__PURE__ */ Q(
|
|
1520
|
+
children: /* @__PURE__ */ Q(O, {
|
|
1521
1521
|
tone: "ghost",
|
|
1522
1522
|
quiet: !0,
|
|
1523
1523
|
size: "xs",
|
|
@@ -1527,13 +1527,13 @@ function ei({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1527
1527
|
onClick: () => a(n.id, d)
|
|
1528
1528
|
})
|
|
1529
1529
|
})]
|
|
1530
|
-
}), f && e.def && /* @__PURE__ */ Q(
|
|
1531
|
-
schema: e.def.params.filter((e) =>
|
|
1530
|
+
}), f && e.def && /* @__PURE__ */ Q(L, {
|
|
1531
|
+
schema: e.def.params.filter((e) => w(e) !== "anim"),
|
|
1532
1532
|
layer: p,
|
|
1533
1533
|
setProp: m,
|
|
1534
|
-
palette:
|
|
1534
|
+
palette: s,
|
|
1535
1535
|
inline: !0,
|
|
1536
|
-
renderAnimate: l ? (e) => /* @__PURE__ */ Q(
|
|
1536
|
+
renderAnimate: l ? (e) => /* @__PURE__ */ Q(dt, {
|
|
1537
1537
|
layer: p,
|
|
1538
1538
|
param: e,
|
|
1539
1539
|
setProp: m
|
|
@@ -1542,28 +1542,28 @@ function ei({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1542
1542
|
}, e.key ?? d);
|
|
1543
1543
|
});
|
|
1544
1544
|
}
|
|
1545
|
-
function
|
|
1546
|
-
let f =
|
|
1545
|
+
function ei({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: a, removeFilter: o, toggleFilter: s, setStagePropAt: l, palette: u, showMod: d }) {
|
|
1546
|
+
let f = c(), p = [{
|
|
1547
1547
|
value: "",
|
|
1548
1548
|
label: "Add FX…"
|
|
1549
|
-
}, ...(n ??
|
|
1549
|
+
}, ...(n ?? U(W)).map((e) => ({
|
|
1550
1550
|
value: e.id,
|
|
1551
1551
|
label: e.label ?? e.id
|
|
1552
1552
|
}))];
|
|
1553
|
-
return /* @__PURE__ */ $(
|
|
1553
|
+
return /* @__PURE__ */ $(k, {
|
|
1554
1554
|
label: "Post-Processing",
|
|
1555
1555
|
divided: !0,
|
|
1556
|
-
children: [/* @__PURE__ */ Q(
|
|
1556
|
+
children: [/* @__PURE__ */ Q($r, {
|
|
1557
1557
|
chain: e,
|
|
1558
1558
|
from: t,
|
|
1559
1559
|
layer: r,
|
|
1560
1560
|
hostView: i,
|
|
1561
|
-
toggleFilter:
|
|
1561
|
+
toggleFilter: s,
|
|
1562
1562
|
removeFilter: o,
|
|
1563
1563
|
setStagePropAt: l,
|
|
1564
1564
|
palette: u,
|
|
1565
1565
|
showMod: d
|
|
1566
|
-
}), e.length < 8 && /* @__PURE__ */ Q(
|
|
1566
|
+
}), e.length < 8 && /* @__PURE__ */ Q(v, {
|
|
1567
1567
|
variant: "subtle",
|
|
1568
1568
|
size: f,
|
|
1569
1569
|
className: "w-full",
|
|
@@ -1575,50 +1575,50 @@ function ti({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1575
1575
|
})]
|
|
1576
1576
|
});
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1579
|
-
let r =
|
|
1578
|
+
function ti({ layer: e, showMod: t, tree: n }) {
|
|
1579
|
+
let r = c(), [i, s] = Z("generate"), { updateLayer: l, palette: u } = o(), { setOnly: d } = _e(), f = ne(e.id, { history: "coalesce" }), p = V(e.loopGroup).find((t) => t.id === e.presetId), m = H(e.loopGroup), g = (n ?? Ae).find((t) => t.groups.includes(e.loopGroup)), _ = g?.labels?.[e.loopGroup] ?? m?.label ?? "", v = g && g.label !== _ ? `${g.label} / ${_}` : _, y = e.loopGroup === "paratype" && p?.sub === "Glyphs" ? B("paratype", "Glyphs") : null, b = y ? y.map((e) => ({
|
|
1580
1580
|
value: e.id,
|
|
1581
1581
|
label: e.label
|
|
1582
1582
|
})) : null, x = (t) => {
|
|
1583
1583
|
let n = y?.find((e) => e.id === t);
|
|
1584
|
-
n && t !== e.presetId && d(e.type,
|
|
1584
|
+
n && t !== e.presetId && d(e.type, pe(n, e.loopGroup));
|
|
1585
1585
|
}, S = () => {
|
|
1586
|
-
|
|
1586
|
+
p && d(e.type, pe(p, e.loopGroup));
|
|
1587
1587
|
};
|
|
1588
|
-
return
|
|
1589
|
-
let t =
|
|
1590
|
-
l(e.id,
|
|
1591
|
-
}), /* @__PURE__ */ $(
|
|
1588
|
+
return Hr(S, () => {
|
|
1589
|
+
let t = K(e.loopId)?.params ?? [];
|
|
1590
|
+
l(e.id, h(e, A(t, e), M(), { withFilters: !0 }));
|
|
1591
|
+
}), /* @__PURE__ */ $(Jr, {
|
|
1592
1592
|
title: v,
|
|
1593
1593
|
chips: b,
|
|
1594
1594
|
active: e.presetId,
|
|
1595
1595
|
onPick: x,
|
|
1596
1596
|
pills: !0,
|
|
1597
1597
|
scope: e.loopId,
|
|
1598
|
-
ghostLabels: (
|
|
1599
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1598
|
+
ghostLabels: (K(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1599
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1600
1600
|
layout: "joined",
|
|
1601
1601
|
tone: "sunken",
|
|
1602
1602
|
value: i,
|
|
1603
|
-
onChange:
|
|
1604
|
-
options: r === "sm" ?
|
|
1603
|
+
onChange: s,
|
|
1604
|
+
options: r === "sm" ? Wr : Gr,
|
|
1605
1605
|
size: r,
|
|
1606
1606
|
className: a(r)
|
|
1607
1607
|
}),
|
|
1608
1608
|
children: [
|
|
1609
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1610
|
-
schema:
|
|
1609
|
+
i === "anim" && /* @__PURE__ */ Q(Ir, {
|
|
1610
|
+
schema: K(e.loopId)?.params ?? [],
|
|
1611
1611
|
layer: e,
|
|
1612
1612
|
setProp: f.setProp,
|
|
1613
|
-
inputs:
|
|
1613
|
+
inputs: K(e.loopId)?.inputs
|
|
1614
1614
|
}),
|
|
1615
|
-
/* @__PURE__ */ Q(
|
|
1615
|
+
/* @__PURE__ */ Q(Te, {
|
|
1616
1616
|
layer: e,
|
|
1617
1617
|
setProp: f.setProp,
|
|
1618
1618
|
patch: f.patch,
|
|
1619
1619
|
updateLayer: l,
|
|
1620
1620
|
palette: u,
|
|
1621
|
-
renderAnimate: t ? (t) => /* @__PURE__ */ Q(
|
|
1621
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Q(dt, {
|
|
1622
1622
|
layer: e,
|
|
1623
1623
|
param: t,
|
|
1624
1624
|
setProp: f.setProp
|
|
@@ -1629,57 +1629,57 @@ function ni({ layer: e, showMod: t, tree: n }) {
|
|
|
1629
1629
|
inline: !0,
|
|
1630
1630
|
onReset: S
|
|
1631
1631
|
}),
|
|
1632
|
-
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(
|
|
1632
|
+
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Vr, {
|
|
1633
1633
|
layer: e,
|
|
1634
1634
|
setProp: f.setProp
|
|
1635
1635
|
}),
|
|
1636
|
-
i === "style" && /* @__PURE__ */ Q(
|
|
1636
|
+
i === "style" && /* @__PURE__ */ Q(Zr, {
|
|
1637
1637
|
layer: e,
|
|
1638
1638
|
edit: f,
|
|
1639
1639
|
palette: u,
|
|
1640
1640
|
showMod: t
|
|
1641
1641
|
}),
|
|
1642
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1643
|
-
schema:
|
|
1642
|
+
i === "anim" && /* @__PURE__ */ Q(Nr, {
|
|
1643
|
+
schema: K(e.loopId)?.params ?? [],
|
|
1644
1644
|
layer: e,
|
|
1645
1645
|
setProp: f.setProp
|
|
1646
1646
|
})
|
|
1647
1647
|
]
|
|
1648
1648
|
});
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1651
|
-
let n =
|
|
1652
|
-
return
|
|
1650
|
+
function ni({ layer: e, showMod: t }) {
|
|
1651
|
+
let n = c(), [r, i] = Z("generate"), { updateLayer: s, palette: l } = o(), { setOnly: u } = _e(), d = ne(e.id, { history: "coalesce" }), f = ht.find((t) => t.id === e.presetId), p = mt.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
|
|
1652
|
+
return Hr(() => {
|
|
1653
1653
|
f && u("kinetic", {
|
|
1654
1654
|
presetId: f.id,
|
|
1655
1655
|
presetLabel: f.label,
|
|
1656
|
-
comp:
|
|
1656
|
+
comp: _t(f)
|
|
1657
1657
|
});
|
|
1658
1658
|
}, () => {
|
|
1659
|
-
let t =
|
|
1659
|
+
let t = M(), n = b(t >>> 0), r = e.comp ?? { instances: [] };
|
|
1660
1660
|
(r.instances ?? []).forEach((e, t) => {
|
|
1661
|
-
r =
|
|
1662
|
-
}),
|
|
1661
|
+
r = vt(r, t, n);
|
|
1662
|
+
}), s(e.id, {
|
|
1663
1663
|
comp: r,
|
|
1664
1664
|
_rollSeed: t
|
|
1665
1665
|
});
|
|
1666
|
-
}), /* @__PURE__ */ Q(
|
|
1666
|
+
}), /* @__PURE__ */ Q(Jr, {
|
|
1667
1667
|
title: p,
|
|
1668
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1668
|
+
tabStrip: /* @__PURE__ */ Q(P, {
|
|
1669
1669
|
layout: "joined",
|
|
1670
1670
|
tone: "sunken",
|
|
1671
1671
|
value: r,
|
|
1672
1672
|
onChange: i,
|
|
1673
|
-
options: n === "sm" ?
|
|
1673
|
+
options: n === "sm" ? Wr : Gr,
|
|
1674
1674
|
size: n,
|
|
1675
1675
|
className: a(n)
|
|
1676
1676
|
}),
|
|
1677
|
-
children: /* @__PURE__ */ Q(
|
|
1677
|
+
children: /* @__PURE__ */ Q(gt, {
|
|
1678
1678
|
layer: e,
|
|
1679
1679
|
setProp: d.setProp,
|
|
1680
|
-
updateLayer:
|
|
1680
|
+
updateLayer: s,
|
|
1681
1681
|
palette: l,
|
|
1682
|
-
renderAnimate: t ? (t) => /* @__PURE__ */ Q(
|
|
1682
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Q(dt, {
|
|
1683
1683
|
layer: e,
|
|
1684
1684
|
param: t,
|
|
1685
1685
|
setProp: d.setProp
|
|
@@ -1689,51 +1689,51 @@ function ri({ layer: e, showMod: t }) {
|
|
|
1689
1689
|
})
|
|
1690
1690
|
});
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1693
|
-
let { layer: e } =
|
|
1692
|
+
function ri() {
|
|
1693
|
+
let { layer: e } = _e(), t = ct(), n = c(), r = ut();
|
|
1694
1694
|
return Y(() => {
|
|
1695
1695
|
let e = (e) => {
|
|
1696
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1696
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || wt(e) || lt();
|
|
1697
1697
|
};
|
|
1698
1698
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1699
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1699
|
+
}, []), t.active ? /* @__PURE__ */ Q(Jr, {
|
|
1700
1700
|
title: "Morph",
|
|
1701
|
-
children: /* @__PURE__ */ Q(
|
|
1701
|
+
children: /* @__PURE__ */ Q(kr, {
|
|
1702
1702
|
layer: e,
|
|
1703
|
-
editTabs: n === "sm" ?
|
|
1703
|
+
editTabs: n === "sm" ? Wr : Gr
|
|
1704
1704
|
})
|
|
1705
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1705
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(Yr, {
|
|
1706
1706
|
layer: e,
|
|
1707
1707
|
showMod: r
|
|
1708
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1708
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(ti, {
|
|
1709
1709
|
layer: e,
|
|
1710
1710
|
showMod: r
|
|
1711
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1711
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(ti, {
|
|
1712
1712
|
layer: e,
|
|
1713
1713
|
showMod: r,
|
|
1714
|
-
tree:
|
|
1715
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1714
|
+
tree: ve
|
|
1715
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(ni, {
|
|
1716
1716
|
layer: e,
|
|
1717
1717
|
showMod: r
|
|
1718
|
-
}, e.id) : /* @__PURE__ */ Q(
|
|
1718
|
+
}, e.id) : /* @__PURE__ */ Q(R, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(R, { children: "Pick an effect or generator from the nav." });
|
|
1719
1719
|
}
|
|
1720
1720
|
//#endregion
|
|
1721
1721
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1722
|
-
function
|
|
1722
|
+
function ii(e) {
|
|
1723
1723
|
Y(() => {
|
|
1724
1724
|
let t = (t) => {
|
|
1725
1725
|
t.key === "Escape" && e?.();
|
|
1726
1726
|
};
|
|
1727
1727
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
1728
1728
|
}, [e]), Y(() => {
|
|
1729
|
-
let e =
|
|
1730
|
-
return
|
|
1731
|
-
e &&
|
|
1729
|
+
let e = n.isPlaying();
|
|
1730
|
+
return n.pause(), () => {
|
|
1731
|
+
e && n.play();
|
|
1732
1732
|
};
|
|
1733
1733
|
}, []);
|
|
1734
1734
|
}
|
|
1735
|
-
function
|
|
1736
|
-
return
|
|
1735
|
+
function ai({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1736
|
+
return ii(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1737
1737
|
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",
|
|
1738
1738
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1739
1739
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1746,12 +1746,12 @@ function oi({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1746
1746
|
}),
|
|
1747
1747
|
/* @__PURE__ */ Q("div", {
|
|
1748
1748
|
className: "flex flex-col gap-2",
|
|
1749
|
-
children:
|
|
1750
|
-
let n =
|
|
1751
|
-
return /* @__PURE__ */ Q(
|
|
1749
|
+
children: Ae.map((t) => {
|
|
1750
|
+
let n = br[`gen:${t.label}`] ?? "square";
|
|
1751
|
+
return /* @__PURE__ */ Q(J, {
|
|
1752
1752
|
tone: "primary",
|
|
1753
1753
|
size: "lg",
|
|
1754
|
-
className:
|
|
1754
|
+
className: Kt,
|
|
1755
1755
|
iconLeft: n,
|
|
1756
1756
|
iconRight: n,
|
|
1757
1757
|
onClick: () => e(t),
|
|
@@ -1761,7 +1761,7 @@ function oi({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1761
1761
|
}),
|
|
1762
1762
|
/* @__PURE__ */ $("div", {
|
|
1763
1763
|
className: "flex flex-col gap-2",
|
|
1764
|
-
children: [t && /* @__PURE__ */ Q(
|
|
1764
|
+
children: [t && /* @__PURE__ */ Q(J, {
|
|
1765
1765
|
tone: "grey",
|
|
1766
1766
|
size: "lg",
|
|
1767
1767
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
@@ -1769,7 +1769,7 @@ function oi({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1769
1769
|
iconRight: "image",
|
|
1770
1770
|
onClick: t,
|
|
1771
1771
|
children: "Insert image or video"
|
|
1772
|
-
}), n && /* @__PURE__ */ Q(
|
|
1772
|
+
}), n && /* @__PURE__ */ Q(J, {
|
|
1773
1773
|
tone: "grey",
|
|
1774
1774
|
size: "lg",
|
|
1775
1775
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
@@ -1785,11 +1785,11 @@ function oi({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
//#endregion
|
|
1787
1787
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1788
|
-
var
|
|
1789
|
-
function
|
|
1790
|
-
let { patch: t } =
|
|
1788
|
+
var oi = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1789
|
+
function si(e) {
|
|
1790
|
+
let { patch: t } = ne(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1791
1791
|
return {
|
|
1792
|
-
nodes: /* @__PURE__ */ $(
|
|
1792
|
+
nodes: /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q("input", {
|
|
1793
1793
|
ref: n,
|
|
1794
1794
|
type: "file",
|
|
1795
1795
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1803,30 +1803,30 @@ function ci(e) {
|
|
|
1803
1803
|
return;
|
|
1804
1804
|
}
|
|
1805
1805
|
if (r.type.startsWith("video/")) {
|
|
1806
|
-
|
|
1806
|
+
l(e.id, r), t({
|
|
1807
1807
|
src: URL.createObjectURL(r),
|
|
1808
1808
|
srcType: "video"
|
|
1809
1809
|
});
|
|
1810
1810
|
return;
|
|
1811
1811
|
}
|
|
1812
|
-
|
|
1812
|
+
Tt(r).then((e) => t({
|
|
1813
1813
|
src: e,
|
|
1814
1814
|
srcType: "image"
|
|
1815
1815
|
}));
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
|
-
}), /* @__PURE__ */ Q(
|
|
1818
|
+
}), /* @__PURE__ */ Q(Mn, {
|
|
1819
1819
|
open: r,
|
|
1820
|
-
accept: a ?
|
|
1820
|
+
accept: a ? oi : ["image", "video"],
|
|
1821
1821
|
onClose: () => i(!1),
|
|
1822
1822
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1823
1823
|
if (a) {
|
|
1824
|
-
t({ svgSrc:
|
|
1824
|
+
t({ svgSrc: Qt(e) });
|
|
1825
1825
|
return;
|
|
1826
1826
|
}
|
|
1827
1827
|
t({
|
|
1828
|
-
src:
|
|
1829
|
-
srcType:
|
|
1828
|
+
src: Qt(e),
|
|
1829
|
+
srcType: Fn(n) ? "video" : "image"
|
|
1830
1830
|
});
|
|
1831
1831
|
}
|
|
1832
1832
|
})] }),
|
|
@@ -1834,7 +1834,7 @@ function ci(e) {
|
|
|
1834
1834
|
openLibrary: () => i(!0),
|
|
1835
1835
|
openUpload: () => n.current?.click(),
|
|
1836
1836
|
openCamera: () => {
|
|
1837
|
-
|
|
1837
|
+
Ht(e.id).then(() => t({
|
|
1838
1838
|
src: null,
|
|
1839
1839
|
srcType: "webcam"
|
|
1840
1840
|
})).catch(() => {});
|
|
@@ -1855,30 +1855,30 @@ function ci(e) {
|
|
|
1855
1855
|
label: "Camera"
|
|
1856
1856
|
}
|
|
1857
1857
|
].slice(0, 2);
|
|
1858
|
-
function
|
|
1859
|
-
let t =
|
|
1858
|
+
function ci({ layer: e }) {
|
|
1859
|
+
let t = si(e);
|
|
1860
1860
|
return /* @__PURE__ */ $("div", {
|
|
1861
1861
|
className: "flex flex-col gap-2",
|
|
1862
1862
|
children: [
|
|
1863
|
-
/* @__PURE__ */ Q(
|
|
1863
|
+
/* @__PURE__ */ Q(O, {
|
|
1864
1864
|
tone: "primary",
|
|
1865
1865
|
size: "lg",
|
|
1866
|
-
className:
|
|
1866
|
+
className: Kt,
|
|
1867
1867
|
iconLeft: "image",
|
|
1868
1868
|
iconRight: "image",
|
|
1869
1869
|
onClick: t.openLibrary,
|
|
1870
1870
|
children: "From library"
|
|
1871
1871
|
}),
|
|
1872
|
-
/* @__PURE__ */ Q(
|
|
1872
|
+
/* @__PURE__ */ Q(O, {
|
|
1873
1873
|
tone: "primary",
|
|
1874
1874
|
size: "lg",
|
|
1875
|
-
className:
|
|
1875
|
+
className: Kt,
|
|
1876
1876
|
iconLeft: "upload",
|
|
1877
1877
|
iconRight: "upload",
|
|
1878
1878
|
onClick: t.openUpload,
|
|
1879
1879
|
children: "Upload"
|
|
1880
1880
|
}),
|
|
1881
|
-
!t.svgMode && /* @__PURE__ */ Q(
|
|
1881
|
+
!t.svgMode && /* @__PURE__ */ Q(O, {
|
|
1882
1882
|
tone: "primary",
|
|
1883
1883
|
size: "lg",
|
|
1884
1884
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
@@ -1891,8 +1891,8 @@ function li({ layer: e }) {
|
|
|
1891
1891
|
]
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1895
|
-
return
|
|
1894
|
+
function li({ layer: e, title: t, onBack: n }) {
|
|
1895
|
+
return ii(n), /* @__PURE__ */ Q("div", {
|
|
1896
1896
|
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",
|
|
1897
1897
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1898
1898
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1909,11 +1909,11 @@ function ui({ layer: e, title: t, onBack: n }) {
|
|
|
1909
1909
|
children: "Pick the media it works on."
|
|
1910
1910
|
})]
|
|
1911
1911
|
}),
|
|
1912
|
-
/* @__PURE__ */ Q(
|
|
1913
|
-
/* @__PURE__ */ Q(
|
|
1912
|
+
/* @__PURE__ */ Q(ci, { layer: e }),
|
|
1913
|
+
/* @__PURE__ */ Q(O, {
|
|
1914
1914
|
tone: "grey",
|
|
1915
1915
|
size: "lg",
|
|
1916
|
-
className:
|
|
1916
|
+
className: Kt,
|
|
1917
1917
|
iconLeft: "arrow-left",
|
|
1918
1918
|
iconRight: "arrow-left",
|
|
1919
1919
|
onClick: n,
|
|
@@ -1925,13 +1925,13 @@ function ui({ layer: e, title: t, onBack: n }) {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
//#endregion
|
|
1927
1927
|
//#region src/editor/components/PanelHeader.jsx
|
|
1928
|
-
function
|
|
1928
|
+
function ui({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1929
1929
|
return /* @__PURE__ */ $("div", {
|
|
1930
1930
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1931
1931
|
children: [/* @__PURE__ */ $("button", {
|
|
1932
1932
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1933
1933
|
onClick: t,
|
|
1934
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1934
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(Zn, {
|
|
1935
1935
|
name: "chevron-down",
|
|
1936
1936
|
size: 16,
|
|
1937
1937
|
className: "text-oq-48"
|
|
@@ -1939,10 +1939,10 @@ function di({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1939
1939
|
}), n]
|
|
1940
1940
|
});
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function di({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1943
1943
|
return /* @__PURE__ */ $("div", {
|
|
1944
1944
|
className: "pointer-events-none fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-[var(--fxr-rail,0px)] right-0 z-10 flex flex-nowrap items-center gap-2 px-3 [&>*]:pointer-events-auto",
|
|
1945
|
-
children: [/* @__PURE__ */ Q(
|
|
1945
|
+
children: [/* @__PURE__ */ Q(J, {
|
|
1946
1946
|
tone: r,
|
|
1947
1947
|
size: n,
|
|
1948
1948
|
onClick: t,
|
|
@@ -1952,7 +1952,7 @@ function fi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1952
1952
|
children: [/* @__PURE__ */ Q("span", {
|
|
1953
1953
|
className: "truncate",
|
|
1954
1954
|
children: e
|
|
1955
|
-
}), /* @__PURE__ */ Q(
|
|
1955
|
+
}), /* @__PURE__ */ Q(Zn, {
|
|
1956
1956
|
name: "chevron-down",
|
|
1957
1957
|
size: 16,
|
|
1958
1958
|
className: "rotate-180 shrink-0"
|
|
@@ -1961,13 +1961,13 @@ function fi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1961
1961
|
}), i]
|
|
1962
1962
|
});
|
|
1963
1963
|
}
|
|
1964
|
-
var
|
|
1964
|
+
var fi = {
|
|
1965
1965
|
half: "50dvh",
|
|
1966
1966
|
tall: "85dvh"
|
|
1967
|
-
},
|
|
1968
|
-
function
|
|
1967
|
+
}, pi = 4;
|
|
1968
|
+
function mi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1969
1969
|
let a = X(null);
|
|
1970
|
-
|
|
1970
|
+
Wn(a, { axis: "x" });
|
|
1971
1971
|
let o = X({
|
|
1972
1972
|
y: null,
|
|
1973
1973
|
h0: 0,
|
|
@@ -1987,7 +1987,7 @@ function hi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1987
1987
|
onPointerMove: (e) => {
|
|
1988
1988
|
if (o.y === null) return;
|
|
1989
1989
|
let t = e.clientY - o.y;
|
|
1990
|
-
Math.abs(t) >
|
|
1990
|
+
Math.abs(t) > pi && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
1991
1991
|
},
|
|
1992
1992
|
onPointerUp: (e) => {
|
|
1993
1993
|
if (o.y === null) return;
|
|
@@ -2009,10 +2009,10 @@ function hi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
//#endregion
|
|
2011
2011
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
2012
|
-
var
|
|
2013
|
-
function
|
|
2014
|
-
let { items: a, dispatch: o } =
|
|
2015
|
-
|
|
2012
|
+
var hi = new Set(["#rail/sec:effects"]);
|
|
2013
|
+
function gi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2014
|
+
let { items: a, dispatch: o } = An(), [s, c] = Z(n);
|
|
2015
|
+
ii(t);
|
|
2016
2016
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
2017
2017
|
return /* @__PURE__ */ Q("div", {
|
|
2018
2018
|
className: "fixed bottom-0 top-12 md:top-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
@@ -2028,14 +2028,14 @@ function _i({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2028
2028
|
children: l ? l.label : "Labs"
|
|
2029
2029
|
}), /* @__PURE__ */ $("div", {
|
|
2030
2030
|
className: "flex flex-col gap-2",
|
|
2031
|
-
children: [u.map((t) => /* @__PURE__ */ Q(
|
|
2031
|
+
children: [u.map((t) => /* @__PURE__ */ Q(J, {
|
|
2032
2032
|
tone: "primary",
|
|
2033
2033
|
size: "lg",
|
|
2034
|
-
className:
|
|
2034
|
+
className: Kt,
|
|
2035
2035
|
iconLeft: t.icon,
|
|
2036
2036
|
iconRight: t.icon,
|
|
2037
2037
|
onClick: () => {
|
|
2038
|
-
if (!l &&
|
|
2038
|
+
if (!l && hi.has(t.path) && !r && i) {
|
|
2039
2039
|
i(t.path);
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
@@ -2046,7 +2046,7 @@ function _i({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2046
2046
|
o?.(t.path) && e?.();
|
|
2047
2047
|
},
|
|
2048
2048
|
children: t.label
|
|
2049
|
-
}, t.path)), l && /* @__PURE__ */ Q(
|
|
2049
|
+
}, t.path)), l && /* @__PURE__ */ Q(J, {
|
|
2050
2050
|
tone: "grey",
|
|
2051
2051
|
size: "lg",
|
|
2052
2052
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
@@ -2061,8 +2061,8 @@ function _i({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2061
2061
|
}
|
|
2062
2062
|
//#endregion
|
|
2063
2063
|
//#region src/editor/labs/sheetLabels.js
|
|
2064
|
-
function
|
|
2065
|
-
if (
|
|
2064
|
+
function _i(e) {
|
|
2065
|
+
if (rt().active) return {
|
|
2066
2066
|
title: "Morph",
|
|
2067
2067
|
pill: "Morph"
|
|
2068
2068
|
};
|
|
@@ -2071,11 +2071,11 @@ function vi(e) {
|
|
|
2071
2071
|
pill: "Labs"
|
|
2072
2072
|
};
|
|
2073
2073
|
if (e.type === "loop" || e.type === "misc") return {
|
|
2074
|
-
title: `${
|
|
2074
|
+
title: `${H(e.loopGroup)?.label ?? "Labs"} · ${e.presetLabel}`,
|
|
2075
2075
|
pill: e.presetLabel
|
|
2076
2076
|
};
|
|
2077
2077
|
if (e.type === "photo") {
|
|
2078
|
-
let t =
|
|
2078
|
+
let t = x(e)[0]?.def?.label ?? "Media";
|
|
2079
2079
|
return {
|
|
2080
2080
|
title: t,
|
|
2081
2081
|
pill: t
|
|
@@ -2089,81 +2089,81 @@ function vi(e) {
|
|
|
2089
2089
|
}
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region src/editor/labs/LabsView.jsx
|
|
2092
|
-
var
|
|
2092
|
+
var vi = .85, yi = .3, bi = 2.5, xi = {
|
|
2093
2093
|
0: 1,
|
|
2094
2094
|
1: .5,
|
|
2095
2095
|
2: 1,
|
|
2096
2096
|
3: 1.5,
|
|
2097
2097
|
4: 2
|
|
2098
|
-
},
|
|
2099
|
-
function
|
|
2100
|
-
let { layer: e } =
|
|
2098
|
+
}, Si = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2099
|
+
function Ci() {
|
|
2100
|
+
let { layer: e } = _e(), { removeLayer: t, layers: r, updateLayer: i, beginTransaction: a, commitTransaction: s, select: c } = o(), [l, u] = Z(null);
|
|
2101
2101
|
Y(() => {
|
|
2102
2102
|
let e = (e) => {
|
|
2103
|
-
let { id: t, index:
|
|
2104
|
-
if (
|
|
2105
|
-
|
|
2103
|
+
let { id: t, index: n } = e.detail || {};
|
|
2104
|
+
if (l?.id === t) {
|
|
2105
|
+
u(null);
|
|
2106
2106
|
return;
|
|
2107
2107
|
}
|
|
2108
|
-
|
|
2108
|
+
r.some((e) => e.id === t && e.type === "kinetic" && !e.locked) && (c(t), u({
|
|
2109
2109
|
id: t,
|
|
2110
|
-
index:
|
|
2110
|
+
index: n ?? 0
|
|
2111
2111
|
}));
|
|
2112
2112
|
};
|
|
2113
2113
|
return window.addEventListener("kol:kinetic-edit", e), () => window.removeEventListener("kol:kinetic-edit", e);
|
|
2114
2114
|
}, [
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2115
|
+
r,
|
|
2116
|
+
l,
|
|
2117
|
+
c
|
|
2118
2118
|
]);
|
|
2119
|
-
let
|
|
2120
|
-
|
|
2121
|
-
let e =
|
|
2119
|
+
let d = l && r.find((e) => e.id === l.id && e.type === "kinetic"), f = e?.type === "photo" && !e.src && e.srcType !== "webcam", [m, h] = Z(1), [g, _] = Z(!1), v = jt(g), y = X(null), b = (e) => Math.min(bi, Math.max(yi, e)), x = (e) => h((t) => b(t * (e > 0 ? 1.25 : .8))), { tool: S } = Mt(), C = S === "orbit", w = X(C);
|
|
2120
|
+
w.current = C, Y(() => {
|
|
2121
|
+
let e = y.current;
|
|
2122
2122
|
if (!e) return;
|
|
2123
2123
|
let t = (e) => {
|
|
2124
|
-
|
|
2124
|
+
w.current || (e.preventDefault(), !p().zoomLock && h((t) => b(t * (e.deltaY > 0 ? .94 : 1.06))));
|
|
2125
2125
|
};
|
|
2126
2126
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2127
2127
|
}, []), Y(() => {
|
|
2128
2128
|
let e = (e) => {
|
|
2129
|
-
if (!(e.metaKey || e.ctrlKey || e.altKey) && !
|
|
2129
|
+
if (!(e.metaKey || e.ctrlKey || e.altKey) && !wt(e)) {
|
|
2130
2130
|
if (e.key === "f" || e.key === "F") {
|
|
2131
|
-
|
|
2131
|
+
_((e) => !e);
|
|
2132
2132
|
return;
|
|
2133
2133
|
}
|
|
2134
|
-
if (!(
|
|
2134
|
+
if (!(p().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || xi[e.key] !== void 0))) {
|
|
2135
2135
|
if (e.key === "-" || e.key === "_") {
|
|
2136
|
-
|
|
2136
|
+
x(-1);
|
|
2137
2137
|
return;
|
|
2138
2138
|
}
|
|
2139
2139
|
if (e.key === "+" || e.key === "=") {
|
|
2140
|
-
|
|
2140
|
+
x(1);
|
|
2141
2141
|
return;
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2143
|
+
xi[e.key] !== void 0 && h(xi[e.key]);
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
2146
|
};
|
|
2147
2147
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2148
2148
|
}, []);
|
|
2149
|
-
let [
|
|
2149
|
+
let [T, E] = Z({
|
|
2150
2150
|
x: 0,
|
|
2151
2151
|
y: 0
|
|
2152
|
-
}),
|
|
2152
|
+
}), D = X({
|
|
2153
2153
|
pts: /* @__PURE__ */ new Map(),
|
|
2154
2154
|
start: null,
|
|
2155
2155
|
tap: null
|
|
2156
|
-
}),
|
|
2157
|
-
zoom:
|
|
2158
|
-
pan:
|
|
2156
|
+
}), O = X({
|
|
2157
|
+
zoom: m,
|
|
2158
|
+
pan: T
|
|
2159
2159
|
});
|
|
2160
|
-
|
|
2161
|
-
zoom:
|
|
2162
|
-
pan:
|
|
2160
|
+
O.current = {
|
|
2161
|
+
zoom: m,
|
|
2162
|
+
pan: T
|
|
2163
2163
|
};
|
|
2164
|
-
let
|
|
2164
|
+
let k = (e) => {
|
|
2165
2165
|
if (e.pointerType !== "touch") return;
|
|
2166
|
-
let t =
|
|
2166
|
+
let t = D.current;
|
|
2167
2167
|
if (t.pts.set(e.pointerId, {
|
|
2168
2168
|
x: e.clientX,
|
|
2169
2169
|
y: e.clientY
|
|
@@ -2173,87 +2173,87 @@ function wi() {
|
|
|
2173
2173
|
y: e.clientY,
|
|
2174
2174
|
at: performance.now()
|
|
2175
2175
|
} : null, t.pts.size === 2) {
|
|
2176
|
-
let [
|
|
2176
|
+
let [r, i] = [...t.pts.values()], a = y.current.getBoundingClientRect(), o = a.left + a.width / 2, s = a.top + a.height / 2, c = (r.x + i.x) / 2, l = (r.y + i.y) / 2, { zoom: u, pan: d } = O.current;
|
|
2177
2177
|
t.start = {
|
|
2178
|
-
d: Math.hypot(
|
|
2179
|
-
cx:
|
|
2180
|
-
cy:
|
|
2181
|
-
z0:
|
|
2182
|
-
qx: (
|
|
2183
|
-
qy: (
|
|
2184
|
-
},
|
|
2178
|
+
d: Math.hypot(r.x - i.x, r.y - i.y),
|
|
2179
|
+
cx: o,
|
|
2180
|
+
cy: s,
|
|
2181
|
+
z0: u,
|
|
2182
|
+
qx: (c - o - d.x) / u,
|
|
2183
|
+
qy: (l - s - d.y) / u
|
|
2184
|
+
}, n.setStagePointer?.(null), e.stopPropagation();
|
|
2185
2185
|
}
|
|
2186
|
-
},
|
|
2187
|
-
let t =
|
|
2186
|
+
}, A = (e) => {
|
|
2187
|
+
let t = D.current;
|
|
2188
2188
|
if (!(e.pointerType !== "touch" || !t.pts.has(e.pointerId)) && (t.pts.set(e.pointerId, {
|
|
2189
2189
|
x: e.clientX,
|
|
2190
2190
|
y: e.clientY
|
|
2191
2191
|
}), t.pts.size >= 2 && t.start)) {
|
|
2192
2192
|
e.stopPropagation();
|
|
2193
|
-
let [n, r] = [...t.pts.values()], i = t.start, a =
|
|
2194
|
-
|
|
2193
|
+
let [n, r] = [...t.pts.values()], i = t.start, a = p().zoomLock ? i.z0 : b(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;
|
|
2194
|
+
h(a), E({
|
|
2195
2195
|
x: o - i.cx - a * i.qx,
|
|
2196
2196
|
y: s - i.cy - a * i.qy
|
|
2197
2197
|
});
|
|
2198
2198
|
}
|
|
2199
|
-
},
|
|
2200
|
-
let
|
|
2199
|
+
}, j = (t) => {
|
|
2200
|
+
let r = D.current;
|
|
2201
2201
|
if (t.pointerType !== "touch") return;
|
|
2202
|
-
let
|
|
2203
|
-
|
|
2202
|
+
let i = r.tap;
|
|
2203
|
+
i && i.id === t.pointerId && t.type === "pointerup" && !r.start && performance.now() - i.at < 350 && Math.hypot(t.clientX - i.x, t.clientY - i.y) < 12 && (e?.type === "loop" ? K(e.loopId) : null)?.group !== "penrose" && n.toggle(), i?.id === t.pointerId && (r.tap = null), r.pts.delete(t.pointerId), r.pts.size < 2 && (r.start = null);
|
|
2204
2204
|
};
|
|
2205
2205
|
return /* @__PURE__ */ $("div", {
|
|
2206
|
-
ref:
|
|
2206
|
+
ref: y,
|
|
2207
2207
|
className: "relative w-full h-full flex items-center justify-center overflow-hidden touch-none",
|
|
2208
2208
|
style: { background: "var(--kol-surface-secondary)" },
|
|
2209
2209
|
onDoubleClick: () => {
|
|
2210
|
-
|
|
2210
|
+
h(1), E({
|
|
2211
2211
|
x: 0,
|
|
2212
2212
|
y: 0
|
|
2213
2213
|
});
|
|
2214
2214
|
},
|
|
2215
|
-
onPointerDownCapture:
|
|
2216
|
-
onPointerMoveCapture:
|
|
2217
|
-
onPointerUpCapture:
|
|
2218
|
-
onPointerCancelCapture:
|
|
2215
|
+
onPointerDownCapture: k,
|
|
2216
|
+
onPointerMoveCapture: A,
|
|
2217
|
+
onPointerUpCapture: j,
|
|
2218
|
+
onPointerCancelCapture: j,
|
|
2219
2219
|
children: [
|
|
2220
2220
|
/* @__PURE__ */ Q("div", {
|
|
2221
2221
|
style: {
|
|
2222
2222
|
flex: "none",
|
|
2223
|
-
width: `${
|
|
2224
|
-
height: `${
|
|
2225
|
-
transform: `translate(${
|
|
2223
|
+
width: `${m * vi * 100}%`,
|
|
2224
|
+
height: `${m * vi * 100}%`,
|
|
2225
|
+
transform: `translate(${T.x}px, ${T.y}px)`
|
|
2226
2226
|
},
|
|
2227
|
-
children: /* @__PURE__ */ Q(
|
|
2228
|
-
layer:
|
|
2229
|
-
initialIndex:
|
|
2227
|
+
children: /* @__PURE__ */ Q(tn, { overlay: d ? (e) => /* @__PURE__ */ Q(Nn, {
|
|
2228
|
+
layer: d,
|
|
2229
|
+
initialIndex: l.index,
|
|
2230
2230
|
toVirtual: e,
|
|
2231
|
-
updateLayer:
|
|
2232
|
-
beginTransaction:
|
|
2233
|
-
commitTransaction:
|
|
2234
|
-
onExit: () =>
|
|
2231
|
+
updateLayer: i,
|
|
2232
|
+
beginTransaction: a,
|
|
2233
|
+
commitTransaction: s,
|
|
2234
|
+
onExit: () => u(null)
|
|
2235
2235
|
}) : void 0 })
|
|
2236
2236
|
}),
|
|
2237
|
-
|
|
2237
|
+
f && /* @__PURE__ */ Q(li, {
|
|
2238
2238
|
layer: e,
|
|
2239
|
-
title:
|
|
2239
|
+
title: _i(e).title,
|
|
2240
2240
|
onBack: () => t(e.id)
|
|
2241
2241
|
}),
|
|
2242
|
-
|
|
2242
|
+
g && /* @__PURE__ */ Q("div", {
|
|
2243
2243
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2244
|
-
children: /* @__PURE__ */ Q(
|
|
2244
|
+
children: /* @__PURE__ */ Q(Un, {
|
|
2245
2245
|
label: "Framerate — press F to hide",
|
|
2246
2246
|
children: /* @__PURE__ */ $("span", {
|
|
2247
|
-
className:
|
|
2248
|
-
children: [
|
|
2247
|
+
className: Si,
|
|
2248
|
+
children: [v, " fps"]
|
|
2249
2249
|
})
|
|
2250
2250
|
})
|
|
2251
2251
|
})
|
|
2252
2252
|
]
|
|
2253
2253
|
});
|
|
2254
2254
|
}
|
|
2255
|
-
function
|
|
2256
|
-
let e = X(null), { grabProps: t } =
|
|
2255
|
+
function wi() {
|
|
2256
|
+
let e = X(null), { grabProps: t } = tr(e, {
|
|
2257
2257
|
token: "kol-rail",
|
|
2258
2258
|
side: "right"
|
|
2259
2259
|
});
|
|
@@ -2299,14 +2299,14 @@ function Ti() {
|
|
|
2299
2299
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2300
2300
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
2301
2301
|
className: "kol-compose-inspector-body",
|
|
2302
|
-
children: /* @__PURE__ */ Q(
|
|
2302
|
+
children: /* @__PURE__ */ Q(ri, {})
|
|
2303
2303
|
})]
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
|
-
var
|
|
2307
|
-
function
|
|
2308
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
2309
|
-
return /* @__PURE__ */ Q(
|
|
2306
|
+
var Ti = qn(null);
|
|
2307
|
+
function Ei() {
|
|
2308
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = Jn(Ti);
|
|
2309
|
+
return /* @__PURE__ */ Q(mi, {
|
|
2310
2310
|
tall: e,
|
|
2311
2311
|
onToggle: () => {
|
|
2312
2312
|
r(null), t((e) => !e);
|
|
@@ -2317,20 +2317,20 @@ function Di() {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
});
|
|
2319
2319
|
}
|
|
2320
|
-
var
|
|
2320
|
+
var Di = [
|
|
2321
2321
|
2,
|
|
2322
2322
|
4,
|
|
2323
2323
|
8,
|
|
2324
2324
|
12,
|
|
2325
2325
|
16
|
|
2326
2326
|
];
|
|
2327
|
-
function
|
|
2328
|
-
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds:
|
|
2327
|
+
function Oi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2328
|
+
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: f } = d(), [p, m] = Z(!0), h = [
|
|
2329
2329
|
{
|
|
2330
2330
|
icon: "home-01",
|
|
2331
2331
|
path: "#home",
|
|
2332
2332
|
label: "Home",
|
|
2333
|
-
onPress: () =>
|
|
2333
|
+
onPress: () => jn("/")
|
|
2334
2334
|
},
|
|
2335
2335
|
{
|
|
2336
2336
|
icon: "grid",
|
|
@@ -2347,25 +2347,25 @@ function ki({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2347
2347
|
selected: e
|
|
2348
2348
|
},
|
|
2349
2349
|
{
|
|
2350
|
-
icon: "play",
|
|
2350
|
+
icon: "play-solid",
|
|
2351
2351
|
path: "#transport",
|
|
2352
2352
|
label: "Transport",
|
|
2353
|
-
onPress: () =>
|
|
2354
|
-
selected:
|
|
2353
|
+
onPress: () => m((e) => !e),
|
|
2354
|
+
selected: p
|
|
2355
2355
|
}
|
|
2356
|
-
],
|
|
2356
|
+
], g = [{
|
|
2357
2357
|
icon: "download",
|
|
2358
2358
|
label: "Output",
|
|
2359
2359
|
onPress: () => {
|
|
2360
|
-
t(!0),
|
|
2360
|
+
t(!0), Et("Output");
|
|
2361
2361
|
}
|
|
2362
2362
|
}, {
|
|
2363
2363
|
icon: "file",
|
|
2364
2364
|
label: "File",
|
|
2365
2365
|
onPress: () => {
|
|
2366
|
-
t(!0),
|
|
2366
|
+
t(!0), Et("File");
|
|
2367
2367
|
}
|
|
2368
|
-
}],
|
|
2368
|
+
}], _ = p ? {
|
|
2369
2369
|
items: [
|
|
2370
2370
|
{
|
|
2371
2371
|
id: "play",
|
|
@@ -2399,207 +2399,211 @@ function ki({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2399
2399
|
onPress: u
|
|
2400
2400
|
}
|
|
2401
2401
|
],
|
|
2402
|
-
sheetFor: { loop:
|
|
2402
|
+
sheetFor: { loop: Di.map((e) => ({
|
|
2403
2403
|
label: `${e} s`,
|
|
2404
2404
|
checked: o === e,
|
|
2405
|
-
onPress: () =>
|
|
2405
|
+
onPress: () => f(e)
|
|
2406
2406
|
})) }
|
|
2407
2407
|
} : void 0;
|
|
2408
2408
|
return Y(() => {
|
|
2409
|
-
|
|
2410
|
-
items:
|
|
2411
|
-
actions:
|
|
2412
|
-
transport:
|
|
2409
|
+
sr({
|
|
2410
|
+
items: h,
|
|
2411
|
+
actions: g,
|
|
2412
|
+
transport: _,
|
|
2413
2413
|
railOpen: e,
|
|
2414
2414
|
railHeight: i
|
|
2415
2415
|
});
|
|
2416
2416
|
}, [
|
|
2417
2417
|
e,
|
|
2418
2418
|
n,
|
|
2419
|
-
|
|
2419
|
+
p,
|
|
2420
2420
|
a,
|
|
2421
2421
|
o,
|
|
2422
2422
|
i
|
|
2423
|
-
]), Y(() => () =>
|
|
2423
|
+
]), Y(() => () => sr(null), []), null;
|
|
2424
2424
|
}
|
|
2425
|
-
function
|
|
2425
|
+
function ki() {
|
|
2426
2426
|
return /* @__PURE__ */ Q("div", {
|
|
2427
2427
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2428
2428
|
children: /* @__PURE__ */ Q("div", {
|
|
2429
2429
|
className: "kol-compose-inspector-body",
|
|
2430
|
-
children: /* @__PURE__ */ Q(
|
|
2430
|
+
children: /* @__PURE__ */ Q(ri, {})
|
|
2431
2431
|
})
|
|
2432
2432
|
});
|
|
2433
2433
|
}
|
|
2434
|
-
var
|
|
2434
|
+
var Ai = {
|
|
2435
2435
|
topbar: () => null,
|
|
2436
|
-
canvas:
|
|
2436
|
+
canvas: Ci,
|
|
2437
2437
|
panels: [
|
|
2438
2438
|
{
|
|
2439
2439
|
slot: "canvas.footer",
|
|
2440
2440
|
order: 0,
|
|
2441
|
-
Component:
|
|
2441
|
+
Component: xt
|
|
2442
2442
|
},
|
|
2443
2443
|
{
|
|
2444
2444
|
slot: "right.body",
|
|
2445
2445
|
order: 0,
|
|
2446
|
-
Component:
|
|
2446
|
+
Component: wi
|
|
2447
2447
|
},
|
|
2448
2448
|
{
|
|
2449
2449
|
slot: "right.footer",
|
|
2450
2450
|
order: 0,
|
|
2451
|
-
Component:
|
|
2451
|
+
Component: sn
|
|
2452
2452
|
}
|
|
2453
2453
|
]
|
|
2454
|
-
},
|
|
2455
|
-
...
|
|
2454
|
+
}, ji = {
|
|
2455
|
+
...Ai,
|
|
2456
2456
|
panels: [{
|
|
2457
2457
|
slot: "right.header",
|
|
2458
2458
|
order: 0,
|
|
2459
|
-
Component:
|
|
2460
|
-
}, ...
|
|
2459
|
+
Component: Ei
|
|
2460
|
+
}, ...Ai.panels.map((e) => e.Component === wi ? {
|
|
2461
2461
|
...e,
|
|
2462
|
-
Component:
|
|
2462
|
+
Component: ki
|
|
2463
2463
|
} : e)]
|
|
2464
2464
|
};
|
|
2465
|
+
function Mi() {
|
|
2466
|
+
let { setAspect: e } = o(), t = X(!1);
|
|
2467
|
+
Y(() => {
|
|
2468
|
+
if (t.current) return;
|
|
2469
|
+
t.current = !0;
|
|
2470
|
+
let r = p();
|
|
2471
|
+
r.defaultAspect && r.defaultAspect !== "custom" && e(r.defaultAspect), r.defaultLoopSeconds && n.setLoopSeconds(r.defaultLoopSeconds);
|
|
2472
|
+
}, []);
|
|
2473
|
+
let { clearHistory: r } = o();
|
|
2474
|
+
Y(() => {
|
|
2475
|
+
let e = setTimeout(r, 800);
|
|
2476
|
+
return () => clearTimeout(e);
|
|
2477
|
+
}, [r]);
|
|
2478
|
+
}
|
|
2465
2479
|
function Ni() {
|
|
2466
|
-
let {
|
|
2480
|
+
let { selectedId: e, select: t } = o(), { layer: r, setOnly: i } = _e(), a = kn(qt), c = zt() && !Tn() || a;
|
|
2467
2481
|
Y(() => {
|
|
2468
|
-
|
|
2469
|
-
}, [
|
|
2470
|
-
let [
|
|
2482
|
+
c && document.documentElement.removeAttribute("data-rail");
|
|
2483
|
+
}, [c]);
|
|
2484
|
+
let [l, u] = Z(!0), [d, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : d ? fi.tall : fi.half, y = { "--kol-sheet-h": v }, b = cr(), x = ct(), [S, C] = Z(() => !r);
|
|
2471
2485
|
Y(() => {
|
|
2472
|
-
|
|
2473
|
-
}, [
|
|
2474
|
-
let [
|
|
2486
|
+
C(!r);
|
|
2487
|
+
}, [r?.id]);
|
|
2488
|
+
let [w, T] = Z(null), E = r?.type === "photo" && (!!r.src || r.srcType === "webcam");
|
|
2475
2489
|
Y(() => {
|
|
2476
|
-
|
|
2477
|
-
}, [
|
|
2478
|
-
|
|
2479
|
-
}, [
|
|
2480
|
-
if (!
|
|
2490
|
+
w && E && C(!0);
|
|
2491
|
+
}, [w, E]), Y(() => {
|
|
2492
|
+
r || T(null);
|
|
2493
|
+
}, [r]), Y(() => {
|
|
2494
|
+
if (!r || c) return;
|
|
2481
2495
|
let e = 0, t = 0;
|
|
2482
2496
|
return e = requestAnimationFrame(() => {
|
|
2483
2497
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2484
2498
|
}), () => {
|
|
2485
2499
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2486
2500
|
};
|
|
2487
|
-
}, [
|
|
2488
|
-
if (!x.active ||
|
|
2501
|
+
}, [r?.id]), Y(() => {
|
|
2502
|
+
if (!x.active || c) return;
|
|
2489
2503
|
let e = 0, t = 0;
|
|
2490
2504
|
return e = requestAnimationFrame(() => {
|
|
2491
2505
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2492
2506
|
}), () => {
|
|
2493
2507
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2494
2508
|
};
|
|
2495
|
-
}, [x.active,
|
|
2509
|
+
}, [x.active, c]), Y(() => At((e) => i("photo", {
|
|
2496
2510
|
src: e.url,
|
|
2497
2511
|
srcType: e.srcType
|
|
2498
|
-
})), [
|
|
2499
|
-
if (!
|
|
2500
|
-
let e = () =>
|
|
2512
|
+
})), [i]), Y(() => {
|
|
2513
|
+
if (!c) return;
|
|
2514
|
+
let e = () => u(!0);
|
|
2501
2515
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2502
2516
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2503
2517
|
};
|
|
2504
|
-
}, [
|
|
2505
|
-
|
|
2506
|
-
s.current = !0;
|
|
2507
|
-
let e = S();
|
|
2508
|
-
e.defaultAspect && e.defaultAspect !== "custom" && t(e.defaultAspect), e.defaultLoopSeconds && O.setLoopSeconds(e.defaultLoopSeconds);
|
|
2509
|
-
}, []);
|
|
2510
|
-
let ee = X(!1);
|
|
2518
|
+
}, [c]), Bt(), Y(() => (on("labs"), () => on(null)), []), Mi();
|
|
2519
|
+
let D = X(!1);
|
|
2511
2520
|
Y(() => {
|
|
2512
|
-
if (
|
|
2513
|
-
|
|
2514
|
-
let e =
|
|
2521
|
+
if (D.current) return;
|
|
2522
|
+
D.current = !0;
|
|
2523
|
+
let e = Ut();
|
|
2515
2524
|
if (e.open || e.fresh) return;
|
|
2516
|
-
let t = new URLSearchParams(window.location.search).get("preset"), n = t ?
|
|
2517
|
-
n &&
|
|
2518
|
-
}, [
|
|
2519
|
-
let {
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
let { tool: A, setTool: j } = Nt(), te = X(A);
|
|
2525
|
-
te.current = A;
|
|
2526
|
-
let { updateLayer: ne, undo: N, redo: P } = o(), F = X({
|
|
2527
|
-
undo: N,
|
|
2528
|
-
redo: P
|
|
2525
|
+
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? fe(t) : null;
|
|
2526
|
+
n && i("loop", pe(z(t), n));
|
|
2527
|
+
}, [i]);
|
|
2528
|
+
let { tool: O, setTool: k } = Mt(), A = X(O);
|
|
2529
|
+
A.current = O;
|
|
2530
|
+
let { updateLayer: j, undo: ee, redo: M } = o(), N = X({
|
|
2531
|
+
undo: ee,
|
|
2532
|
+
redo: M
|
|
2529
2533
|
});
|
|
2530
|
-
|
|
2531
|
-
undo:
|
|
2532
|
-
redo:
|
|
2534
|
+
N.current = {
|
|
2535
|
+
undo: ee,
|
|
2536
|
+
redo: M
|
|
2533
2537
|
};
|
|
2534
|
-
let
|
|
2538
|
+
let te = !!s().grab;
|
|
2535
2539
|
Y(() => {
|
|
2536
|
-
|
|
2537
|
-
}, [
|
|
2538
|
-
let
|
|
2539
|
-
|
|
2540
|
-
let
|
|
2541
|
-
return
|
|
2542
|
-
let
|
|
2543
|
-
if (
|
|
2544
|
-
if ((
|
|
2545
|
-
|
|
2540
|
+
k(te ? "orbit" : "select");
|
|
2541
|
+
}, [te, k]);
|
|
2542
|
+
let P = X(r);
|
|
2543
|
+
P.current = r;
|
|
2544
|
+
let F = X(j);
|
|
2545
|
+
return F.current = j, Y(() => {
|
|
2546
|
+
let e = (e) => {
|
|
2547
|
+
if (wt(e)) return;
|
|
2548
|
+
if ((e.metaKey || e.ctrlKey) && (e.key === "z" || e.key === "Z")) {
|
|
2549
|
+
e.preventDefault(), e.shiftKey ? N.current.redo() : N.current.undo();
|
|
2546
2550
|
return;
|
|
2547
2551
|
}
|
|
2548
|
-
if (
|
|
2549
|
-
|
|
2552
|
+
if (e.code === "Space") {
|
|
2553
|
+
e.preventDefault(), n.toggle();
|
|
2550
2554
|
return;
|
|
2551
2555
|
}
|
|
2552
|
-
if ((
|
|
2556
|
+
if ((e.key === "s" || e.key === "S") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
2553
2557
|
window.dispatchEvent(new CustomEvent("kol:show-shortcuts"));
|
|
2554
2558
|
return;
|
|
2555
2559
|
}
|
|
2556
|
-
if ((
|
|
2557
|
-
|
|
2560
|
+
if ((e.key === "c" || e.key === "C") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
2561
|
+
m("grab", !p().grab);
|
|
2558
2562
|
return;
|
|
2559
2563
|
}
|
|
2560
|
-
if ((
|
|
2561
|
-
|
|
2564
|
+
if ((e.key === "z" || e.key === "Z") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
2565
|
+
m("zoomLock", !p().zoomLock);
|
|
2562
2566
|
return;
|
|
2563
2567
|
}
|
|
2564
|
-
let
|
|
2565
|
-
if (
|
|
2566
|
-
let
|
|
2567
|
-
|
|
2568
|
+
let t = !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey && Ee[e.key.length === 1 ? e.key.toLowerCase() : e.key];
|
|
2569
|
+
if (t && P.current) {
|
|
2570
|
+
let n = ke(P.current, t[1], t[0]);
|
|
2571
|
+
n && (e.preventDefault(), F.current(P.current.id, n));
|
|
2568
2572
|
}
|
|
2569
2573
|
};
|
|
2570
|
-
return window.addEventListener("keydown",
|
|
2571
|
-
}, [
|
|
2572
|
-
if (!
|
|
2574
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2575
|
+
}, [k]), Y(() => {
|
|
2576
|
+
if (!r?.presetId) return;
|
|
2573
2577
|
let e = new URLSearchParams(window.location.search);
|
|
2574
|
-
e.get("preset") !==
|
|
2575
|
-
}, [
|
|
2576
|
-
|
|
2578
|
+
e.get("preset") !== r.presetId && (e.delete("view"), e.set("preset", r.presetId), r.loopGroup ? e.set("cat", r.loopGroup) : e.delete("cat"), window.history.replaceState(null, "", `${window.location.pathname}?${e}`));
|
|
2579
|
+
}, [r?.presetId, r?.loopGroup]), Y(() => {
|
|
2580
|
+
r && e !== r.id && t(r.id);
|
|
2577
2581
|
}, [
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2582
|
+
r,
|
|
2583
|
+
e,
|
|
2584
|
+
t
|
|
2581
2585
|
]), /* @__PURE__ */ $("div", {
|
|
2582
2586
|
className: "kol-editor-labs contents",
|
|
2583
|
-
"data-touch":
|
|
2584
|
-
"data-params":
|
|
2585
|
-
"data-empty":
|
|
2587
|
+
"data-touch": c || void 0,
|
|
2588
|
+
"data-params": l ? "open" : void 0,
|
|
2589
|
+
"data-empty": r || x.active ? void 0 : "",
|
|
2586
2590
|
style: y,
|
|
2587
2591
|
children: [
|
|
2588
|
-
/* @__PURE__ */ Q(
|
|
2589
|
-
|
|
2592
|
+
/* @__PURE__ */ Q(Er, {}),
|
|
2593
|
+
c ? /* @__PURE__ */ $(Ti.Provider, {
|
|
2590
2594
|
value: {
|
|
2591
|
-
collapseParams: () =>
|
|
2592
|
-
tall:
|
|
2595
|
+
collapseParams: () => u(!1),
|
|
2596
|
+
tall: d,
|
|
2593
2597
|
setTall: h,
|
|
2594
2598
|
setSheetPx: _,
|
|
2595
|
-
catalog:
|
|
2596
|
-
toggleCatalog: () =>
|
|
2599
|
+
catalog: S,
|
|
2600
|
+
toggleCatalog: () => C((e) => !e)
|
|
2597
2601
|
},
|
|
2598
|
-
children: [/* @__PURE__ */ Q(
|
|
2602
|
+
children: [/* @__PURE__ */ Q(f.Provider, {
|
|
2599
2603
|
value: "md",
|
|
2600
|
-
children: /* @__PURE__ */ Q(
|
|
2601
|
-
registry:
|
|
2602
|
-
rightIn: (e) => b ?
|
|
2604
|
+
children: /* @__PURE__ */ Q(Dt, {
|
|
2605
|
+
registry: ji,
|
|
2606
|
+
rightIn: (e) => b ? rr(/* @__PURE__ */ Q("div", {
|
|
2603
2607
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2604
2608
|
"data-touch": "",
|
|
2605
2609
|
"data-params": "open",
|
|
@@ -2607,28 +2611,28 @@ function Ni() {
|
|
|
2607
2611
|
children: e
|
|
2608
2612
|
}), b) : null
|
|
2609
2613
|
})
|
|
2610
|
-
}), /* @__PURE__ */ Q(
|
|
2611
|
-
paramsOpen:
|
|
2612
|
-
setParamsOpen:
|
|
2613
|
-
catalog:
|
|
2614
|
-
toggleCatalog: () =>
|
|
2614
|
+
}), /* @__PURE__ */ Q(Oi, {
|
|
2615
|
+
paramsOpen: l,
|
|
2616
|
+
setParamsOpen: u,
|
|
2617
|
+
catalog: S,
|
|
2618
|
+
toggleCatalog: () => C((e) => !e),
|
|
2615
2619
|
railHeight: v
|
|
2616
2620
|
})]
|
|
2617
|
-
}) : /* @__PURE__ */ Q(
|
|
2618
|
-
|
|
2619
|
-
initialOpen:
|
|
2620
|
-
hasMedia:
|
|
2621
|
+
}) : /* @__PURE__ */ Q(Dt, { registry: Ai }),
|
|
2622
|
+
S && !x.picker && !(x.active && !r) && /* @__PURE__ */ Q(gi, {
|
|
2623
|
+
initialOpen: w,
|
|
2624
|
+
hasMedia: E,
|
|
2621
2625
|
onNeedMedia: (e) => {
|
|
2622
|
-
|
|
2626
|
+
T(e), i("photo", {
|
|
2623
2627
|
filters: [],
|
|
2624
2628
|
fxGroup: null
|
|
2625
2629
|
});
|
|
2626
2630
|
},
|
|
2627
2631
|
onPicked: () => {
|
|
2628
|
-
|
|
2632
|
+
T(null), C(!1);
|
|
2629
2633
|
},
|
|
2630
2634
|
onClose: () => {
|
|
2631
|
-
|
|
2635
|
+
T(null), C(!1);
|
|
2632
2636
|
}
|
|
2633
2637
|
})
|
|
2634
2638
|
]
|
|
@@ -2637,18 +2641,18 @@ function Ni() {
|
|
|
2637
2641
|
var Pi = "kol.editor.labs-draft";
|
|
2638
2642
|
function Fi() {
|
|
2639
2643
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2640
|
-
return Y(() => (
|
|
2644
|
+
return Y(() => (q(e ? { active: !0 } : {
|
|
2641
2645
|
active: !1,
|
|
2642
2646
|
editing: null
|
|
2643
|
-
}), () =>
|
|
2647
|
+
}), () => q({
|
|
2644
2648
|
active: !1,
|
|
2645
2649
|
editing: null
|
|
2646
|
-
})), [e]), /* @__PURE__ */ $(
|
|
2650
|
+
})), [e]), /* @__PURE__ */ $(hn, {
|
|
2647
2651
|
draftKey: Pi,
|
|
2648
2652
|
children: [
|
|
2649
2653
|
/* @__PURE__ */ Q(Ni, {}),
|
|
2650
|
-
/* @__PURE__ */ Q(
|
|
2651
|
-
/* @__PURE__ */ Q(
|
|
2654
|
+
/* @__PURE__ */ Q(dn, {}),
|
|
2655
|
+
/* @__PURE__ */ Q(we, {})
|
|
2652
2656
|
]
|
|
2653
2657
|
});
|
|
2654
2658
|
}
|
|
@@ -2656,8 +2660,8 @@ function Fi() {
|
|
|
2656
2660
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2657
2661
|
function Ii({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2658
2662
|
let [i, a] = Z(null);
|
|
2659
|
-
|
|
2660
|
-
let { engineHost: o } =
|
|
2663
|
+
ii(r);
|
|
2664
|
+
let { engineHost: o } = G(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = re(W.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2661
2665
|
return /* @__PURE__ */ Q("div", {
|
|
2662
2666
|
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",
|
|
2663
2667
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -2671,20 +2675,20 @@ function Ii({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2671
2675
|
}),
|
|
2672
2676
|
/* @__PURE__ */ Q("div", {
|
|
2673
2677
|
className: "flex flex-col gap-2",
|
|
2674
|
-
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(
|
|
2678
|
+
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(J, {
|
|
2675
2679
|
tone: "primary",
|
|
2676
2680
|
size: "lg",
|
|
2677
|
-
className:
|
|
2681
|
+
className: Kt,
|
|
2678
2682
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2679
2683
|
iconRight: l ? "filter" : "chevron-right",
|
|
2680
2684
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
2681
2685
|
children: e.label
|
|
2682
2686
|
}, e.id))
|
|
2683
2687
|
}),
|
|
2684
|
-
/* @__PURE__ */ Q(
|
|
2688
|
+
/* @__PURE__ */ Q(J, {
|
|
2685
2689
|
tone: "grey",
|
|
2686
2690
|
size: "lg",
|
|
2687
|
-
className:
|
|
2691
|
+
className: Kt,
|
|
2688
2692
|
iconLeft: "arrow-left",
|
|
2689
2693
|
iconRight: "arrow-left",
|
|
2690
2694
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2726,7 +2730,7 @@ function Wi(e, t) {
|
|
|
2726
2730
|
return i.length && r.push(i), r;
|
|
2727
2731
|
}
|
|
2728
2732
|
function Gi({ cells: e, size: t }) {
|
|
2729
|
-
return Wi(e, t).map((e, n) => /* @__PURE__ */ Q(
|
|
2733
|
+
return Wi(e, t).map((e, n) => /* @__PURE__ */ Q(Ln, {
|
|
2730
2734
|
layout: "joined",
|
|
2731
2735
|
value: null,
|
|
2732
2736
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
@@ -2746,8 +2750,8 @@ var Ki = [
|
|
|
2746
2750
|
label: `${e}s`
|
|
2747
2751
|
}));
|
|
2748
2752
|
function qi({ size: e }) {
|
|
2749
|
-
let { loopSeconds: t, setLoopSeconds: n } =
|
|
2750
|
-
return /* @__PURE__ */ Q(
|
|
2753
|
+
let { loopSeconds: t, setLoopSeconds: n } = d();
|
|
2754
|
+
return /* @__PURE__ */ Q(Ln, {
|
|
2751
2755
|
layout: "joined",
|
|
2752
2756
|
value: String(t),
|
|
2753
2757
|
onChange: (e) => n(Number(e)),
|
|
@@ -2792,63 +2796,63 @@ var Ji = [
|
|
|
2792
2796
|
}
|
|
2793
2797
|
];
|
|
2794
2798
|
function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: d }) {
|
|
2795
|
-
let f =
|
|
2799
|
+
let f = ct(), { updateLayer: p, addFilter: m, removeFilter: g } = o(), { onExportPng: v } = Gt(), [b, S] = Z(!1), [C, w] = Z(!0), [E, D] = Z(!1), [O, k] = Z(!1), [j, M] = Z("generate"), [te, P] = Z(!1), [F, I] = Z(!1), { aspect: L } = o(), [R, ne] = Z(null), z = _(e);
|
|
2796
2800
|
Y(() => {
|
|
2797
|
-
c && (
|
|
2801
|
+
c && (w(!0), k(!0));
|
|
2798
2802
|
}, [c]);
|
|
2799
|
-
let B = l ? "sm" : "lg",
|
|
2800
|
-
Y(() => (u?.(
|
|
2801
|
-
let
|
|
2802
|
-
Y(() => (d?.(
|
|
2803
|
-
let
|
|
2804
|
-
let t = e?.type === "loop" &&
|
|
2805
|
-
t &&
|
|
2803
|
+
let B = l ? "sm" : "lg", re = l && !!e && C && !b;
|
|
2804
|
+
Y(() => (u?.(re), () => u?.(!1)), [re]);
|
|
2805
|
+
let U = !l && e && C && !b ? R ? `${R}px` : te ? fi.tall : fi.half : null;
|
|
2806
|
+
Y(() => (d?.(U), () => d?.(null)), [U]);
|
|
2807
|
+
let ie = () => {
|
|
2808
|
+
let t = e?.type === "loop" && V(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2809
|
+
t && p(e.id, pe(t, e.loopGroup));
|
|
2806
2810
|
};
|
|
2807
|
-
if (
|
|
2808
|
-
e?.type === "loop" &&
|
|
2811
|
+
if (Hr(ie, () => {
|
|
2812
|
+
e?.type === "loop" && p(e.id, h(e, A(K(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2809
2813
|
}), !e) return null;
|
|
2810
|
-
if (
|
|
2814
|
+
if (b) return /* @__PURE__ */ Q("button", {
|
|
2811
2815
|
"aria-label": "Show controls",
|
|
2812
2816
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
2813
2817
|
onClick: () => S(!1)
|
|
2814
2818
|
});
|
|
2815
|
-
let
|
|
2816
|
-
let t =
|
|
2817
|
-
t &&
|
|
2818
|
-
},
|
|
2819
|
-
let t =
|
|
2820
|
-
t &&
|
|
2819
|
+
let W = e.type === "loop", ae = W ? `${H(e.loopGroup).label} · ${e.presetLabel}` : "Media", oe = W ? K(e.loopId)?.params ?? [] : [], se = W ? ee(oe, e) : [], ce = () => p(e.id, h(e, A(oe, e), z.take(), { withFilters: !0 })), le = (t) => p(e.id, h(e, t.params, z.take(), { stripNoRandom: !!t.motion })), ue = () => {
|
|
2820
|
+
let t = T(e, z.take());
|
|
2821
|
+
t && p(e.id, t);
|
|
2822
|
+
}, de = x(e), { effectable: fe } = G(e), me = () => {
|
|
2823
|
+
let t = N(e, z.take());
|
|
2824
|
+
t && p(e.id, { filters: t });
|
|
2821
2825
|
};
|
|
2822
|
-
if (!C) return /* @__PURE__ */ $(
|
|
2823
|
-
label:
|
|
2824
|
-
onOpen: () =>
|
|
2826
|
+
if (!C) return /* @__PURE__ */ $(di, {
|
|
2827
|
+
label: W ? e.presetLabel : "Media",
|
|
2828
|
+
onOpen: () => w(!0),
|
|
2825
2829
|
size: B,
|
|
2826
2830
|
children: [
|
|
2827
|
-
(
|
|
2831
|
+
(W || de.length > 0) && /* @__PURE__ */ Q(Un, {
|
|
2828
2832
|
label: "Randomize all",
|
|
2829
|
-
children: /* @__PURE__ */ Q(
|
|
2833
|
+
children: /* @__PURE__ */ Q(J, {
|
|
2830
2834
|
tone: "primary",
|
|
2831
2835
|
size: B,
|
|
2832
2836
|
iconOnly: "bolt",
|
|
2833
2837
|
"aria-label": "Randomize all",
|
|
2834
|
-
onClick:
|
|
2838
|
+
onClick: ce,
|
|
2835
2839
|
className: "shrink-0"
|
|
2836
2840
|
})
|
|
2837
2841
|
}),
|
|
2838
|
-
/* @__PURE__ */ Q(
|
|
2842
|
+
/* @__PURE__ */ Q(Un, {
|
|
2839
2843
|
label: "Download",
|
|
2840
|
-
children: /* @__PURE__ */ Q(
|
|
2844
|
+
children: /* @__PURE__ */ Q(J, {
|
|
2841
2845
|
tone: "primary",
|
|
2842
2846
|
size: B,
|
|
2843
2847
|
iconOnly: "download",
|
|
2844
2848
|
"aria-label": "Download",
|
|
2845
|
-
onClick: () =>
|
|
2849
|
+
onClick: () => v(2),
|
|
2846
2850
|
className: "shrink-0"
|
|
2847
2851
|
})
|
|
2848
2852
|
}),
|
|
2849
|
-
/* @__PURE__ */ Q(
|
|
2853
|
+
/* @__PURE__ */ Q(Un, {
|
|
2850
2854
|
label: "Hide UI",
|
|
2851
|
-
children: /* @__PURE__ */ Q(
|
|
2855
|
+
children: /* @__PURE__ */ Q(J, {
|
|
2852
2856
|
tone: "primary",
|
|
2853
2857
|
size: B,
|
|
2854
2858
|
iconOnly: "eye-off",
|
|
@@ -2857,9 +2861,9 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2857
2861
|
className: "shrink-0"
|
|
2858
2862
|
})
|
|
2859
2863
|
}),
|
|
2860
|
-
/* @__PURE__ */ Q(
|
|
2864
|
+
/* @__PURE__ */ Q(Un, {
|
|
2861
2865
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2862
|
-
children: /* @__PURE__ */ Q(
|
|
2866
|
+
children: /* @__PURE__ */ Q(J, {
|
|
2863
2867
|
tone: "primary",
|
|
2864
2868
|
size: B,
|
|
2865
2869
|
iconOnly: "maximize",
|
|
@@ -2871,60 +2875,60 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2871
2875
|
})
|
|
2872
2876
|
]
|
|
2873
2877
|
});
|
|
2874
|
-
let
|
|
2878
|
+
let he = [...W ? Ri : zi, ...W && f.steps.length >= 2 ? [{
|
|
2875
2879
|
value: "morph",
|
|
2876
2880
|
label: "Morph"
|
|
2877
|
-
}] : []].filter((e) => (e.value !== "effects" ||
|
|
2878
|
-
return /* @__PURE__ */ $(
|
|
2879
|
-
/* @__PURE__ */ Q(
|
|
2880
|
-
open:
|
|
2881
|
-
onClose: () =>
|
|
2882
|
-
schema:
|
|
2881
|
+
}] : []].filter((e) => (e.value !== "effects" || fe) && (e.value !== "transport" || y("motion"))), ge = he.some((e) => e.value === j) ? j : he[0].value;
|
|
2882
|
+
return /* @__PURE__ */ $(Xn, { children: [
|
|
2883
|
+
/* @__PURE__ */ Q(ye, {
|
|
2884
|
+
open: F,
|
|
2885
|
+
onClose: () => I(!1),
|
|
2886
|
+
schema: oe,
|
|
2883
2887
|
layer: e,
|
|
2884
2888
|
size: B
|
|
2885
2889
|
}),
|
|
2886
|
-
|
|
2890
|
+
E && /* @__PURE__ */ Q(ai, {
|
|
2887
2891
|
onPick: (e) => {
|
|
2888
|
-
t(e),
|
|
2892
|
+
t(e), D(!1);
|
|
2889
2893
|
},
|
|
2890
2894
|
onInsert: () => {
|
|
2891
|
-
|
|
2895
|
+
D(!1), r();
|
|
2892
2896
|
},
|
|
2893
2897
|
onBack: () => {
|
|
2894
|
-
|
|
2898
|
+
D(!1), i();
|
|
2895
2899
|
},
|
|
2896
|
-
onDismiss: () =>
|
|
2900
|
+
onDismiss: () => D(!1)
|
|
2897
2901
|
}),
|
|
2898
|
-
|
|
2902
|
+
O && /* @__PURE__ */ Q(Ii, {
|
|
2899
2903
|
layer: e,
|
|
2900
|
-
chain:
|
|
2904
|
+
chain: de,
|
|
2901
2905
|
onPick: (t) => {
|
|
2902
|
-
|
|
2906
|
+
m(e.id, t), k(!1);
|
|
2903
2907
|
},
|
|
2904
|
-
onBack: () =>
|
|
2908
|
+
onBack: () => k(!1)
|
|
2905
2909
|
}),
|
|
2906
2910
|
/* @__PURE__ */ $("div", {
|
|
2907
2911
|
className: l ? "fixed top-0 right-0 bottom-0 z-10 flex w-[var(--kol-sidenav-w,320px)] flex-col overflow-y-auto border-l border-oq-08" : "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
2908
2912
|
style: l ? Li : {
|
|
2909
2913
|
...Li,
|
|
2910
|
-
top: `calc(100dvh - ${
|
|
2914
|
+
top: `calc(100dvh - ${U ?? fi.half})`
|
|
2911
2915
|
},
|
|
2912
2916
|
children: [
|
|
2913
|
-
!l && /* @__PURE__ */ Q(
|
|
2914
|
-
tall:
|
|
2917
|
+
!l && /* @__PURE__ */ Q(mi, {
|
|
2918
|
+
tall: te,
|
|
2915
2919
|
onToggle: () => {
|
|
2916
|
-
|
|
2920
|
+
ne(null), P((e) => !e);
|
|
2917
2921
|
},
|
|
2918
|
-
onResize: (e) =>
|
|
2922
|
+
onResize: (e) => ne(Math.max(96, Math.min(window.innerHeight * .92, e))),
|
|
2919
2923
|
onResizeEnd: (e) => {
|
|
2920
|
-
e < 96 && (
|
|
2924
|
+
e < 96 && (ne(null), w(!1));
|
|
2921
2925
|
}
|
|
2922
2926
|
}),
|
|
2923
|
-
/* @__PURE__ */ Q(
|
|
2924
|
-
title:
|
|
2925
|
-
onCollapse: () =>
|
|
2927
|
+
/* @__PURE__ */ Q(ui, {
|
|
2928
|
+
title: ae,
|
|
2929
|
+
onCollapse: () => w(!1),
|
|
2926
2930
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
2927
|
-
action: /* @__PURE__ */ Q(
|
|
2931
|
+
action: /* @__PURE__ */ Q(J, {
|
|
2928
2932
|
tone: "ghost",
|
|
2929
2933
|
quiet: !0,
|
|
2930
2934
|
size: "sm",
|
|
@@ -2935,112 +2939,112 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2935
2939
|
/* @__PURE__ */ $("div", {
|
|
2936
2940
|
className: l ? "px-4 pb-5" : "min-h-0 flex-1 overflow-y-auto px-3 pb-3",
|
|
2937
2941
|
children: [
|
|
2938
|
-
/* @__PURE__ */ Q(
|
|
2942
|
+
/* @__PURE__ */ Q(Ln, {
|
|
2939
2943
|
layout: "joined",
|
|
2940
|
-
value:
|
|
2944
|
+
value: ge,
|
|
2941
2945
|
onChange: M,
|
|
2942
|
-
options:
|
|
2946
|
+
options: he,
|
|
2943
2947
|
size: B,
|
|
2944
2948
|
className: l ? Bi : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2945
2949
|
}),
|
|
2946
|
-
|
|
2950
|
+
ge === "morph" && W && /* @__PURE__ */ Q(kr, {
|
|
2947
2951
|
layer: e,
|
|
2948
2952
|
readOnly: !0
|
|
2949
2953
|
}),
|
|
2950
|
-
|
|
2954
|
+
ge === "generate" && W && /* @__PURE__ */ $("div", {
|
|
2951
2955
|
className: "flex flex-col gap-2 pt-3",
|
|
2952
2956
|
children: [
|
|
2953
2957
|
/* @__PURE__ */ $("div", {
|
|
2954
2958
|
className: "grid grid-cols-2 gap-2",
|
|
2955
|
-
children: [/* @__PURE__ */ Q(
|
|
2959
|
+
children: [/* @__PURE__ */ Q(J, {
|
|
2956
2960
|
tone: "primary",
|
|
2957
2961
|
size: B,
|
|
2958
2962
|
iconRight: "refresh",
|
|
2959
|
-
onClick:
|
|
2963
|
+
onClick: ue,
|
|
2960
2964
|
children: "Preset"
|
|
2961
|
-
}), /* @__PURE__ */ Q(
|
|
2965
|
+
}), /* @__PURE__ */ Q(J, {
|
|
2962
2966
|
tone: "primary",
|
|
2963
2967
|
size: B,
|
|
2964
|
-
onClick: () =>
|
|
2968
|
+
onClick: () => D(!0),
|
|
2965
2969
|
children: "Generator"
|
|
2966
2970
|
})]
|
|
2967
2971
|
}),
|
|
2968
2972
|
/* @__PURE__ */ $("div", {
|
|
2969
2973
|
className: "flex gap-2",
|
|
2970
2974
|
children: [
|
|
2971
|
-
/* @__PURE__ */ Q(
|
|
2975
|
+
/* @__PURE__ */ Q(J, {
|
|
2972
2976
|
tone: "primary",
|
|
2973
2977
|
size: B,
|
|
2974
2978
|
className: "flex-1 min-w-0",
|
|
2975
|
-
onClick:
|
|
2979
|
+
onClick: ce,
|
|
2976
2980
|
children: "Randomize all"
|
|
2977
2981
|
}),
|
|
2978
|
-
/* @__PURE__ */ Q(
|
|
2982
|
+
/* @__PURE__ */ Q(Un, {
|
|
2979
2983
|
label: "What Randomize all rolls",
|
|
2980
|
-
children: /* @__PURE__ */ Q(
|
|
2984
|
+
children: /* @__PURE__ */ Q(J, {
|
|
2981
2985
|
tone: "primary",
|
|
2982
2986
|
size: B,
|
|
2983
2987
|
iconOnly: "nav-settings",
|
|
2984
2988
|
"aria-label": "What Randomize all rolls",
|
|
2985
|
-
onClick: () =>
|
|
2989
|
+
onClick: () => I(!0),
|
|
2986
2990
|
className: "shrink-0"
|
|
2987
2991
|
})
|
|
2988
2992
|
}),
|
|
2989
|
-
/* @__PURE__ */ Q(
|
|
2993
|
+
/* @__PURE__ */ Q(Un, {
|
|
2990
2994
|
label: "Reset to defaults",
|
|
2991
2995
|
shortcut: "R",
|
|
2992
|
-
children: /* @__PURE__ */ Q(
|
|
2996
|
+
children: /* @__PURE__ */ Q(J, {
|
|
2993
2997
|
tone: "primary",
|
|
2994
2998
|
size: B,
|
|
2995
2999
|
iconOnly: "refresh",
|
|
2996
3000
|
"aria-label": "Reset to defaults",
|
|
2997
|
-
onClick:
|
|
3001
|
+
onClick: ie,
|
|
2998
3002
|
className: "shrink-0"
|
|
2999
3003
|
})
|
|
3000
3004
|
})
|
|
3001
3005
|
]
|
|
3002
3006
|
}),
|
|
3003
|
-
|
|
3007
|
+
se.length > 0 && /* @__PURE__ */ Q(Gi, {
|
|
3004
3008
|
size: B,
|
|
3005
|
-
cells: [...
|
|
3009
|
+
cells: [...se.map((e) => ({
|
|
3006
3010
|
value: e.id,
|
|
3007
3011
|
label: e.label,
|
|
3008
|
-
run: () =>
|
|
3012
|
+
run: () => le(e)
|
|
3009
3013
|
})), {
|
|
3010
3014
|
value: "__retrigger",
|
|
3011
3015
|
label: "Re-trigger",
|
|
3012
|
-
run: () =>
|
|
3016
|
+
run: () => n.rewind()
|
|
3013
3017
|
}]
|
|
3014
3018
|
})
|
|
3015
3019
|
]
|
|
3016
3020
|
}),
|
|
3017
|
-
|
|
3021
|
+
ge === "effects" && /* @__PURE__ */ $("div", {
|
|
3018
3022
|
className: "flex flex-col gap-2 pt-3",
|
|
3019
3023
|
children: [/* @__PURE__ */ $("div", {
|
|
3020
3024
|
className: "grid grid-cols-2 gap-2",
|
|
3021
3025
|
children: [
|
|
3022
|
-
/* @__PURE__ */ Q(
|
|
3026
|
+
/* @__PURE__ */ Q(J, {
|
|
3023
3027
|
tone: "primary",
|
|
3024
3028
|
size: B,
|
|
3025
|
-
onClick: () =>
|
|
3029
|
+
onClick: () => k(!0),
|
|
3026
3030
|
children: "Add effect"
|
|
3027
3031
|
}),
|
|
3028
|
-
|
|
3032
|
+
de.length > 0 && /* @__PURE__ */ Q(J, {
|
|
3029
3033
|
tone: "primary",
|
|
3030
3034
|
size: B,
|
|
3031
|
-
onClick:
|
|
3035
|
+
onClick: me,
|
|
3032
3036
|
children: "Randomize"
|
|
3033
3037
|
}),
|
|
3034
3038
|
" "
|
|
3035
3039
|
]
|
|
3036
|
-
}),
|
|
3040
|
+
}), de.map((t, n) => {
|
|
3037
3041
|
let r = {
|
|
3038
3042
|
...e,
|
|
3039
3043
|
...t.params,
|
|
3040
3044
|
id: e.id
|
|
3041
|
-
}, i = t.def ?
|
|
3042
|
-
let i =
|
|
3043
|
-
|
|
3045
|
+
}, i = t.def ? ee(t.def.params, r) : [], a = (t) => {
|
|
3046
|
+
let i = h(r, t.params, z.take(), { stripNoRandom: !!t.motion }), a = de.map(({ def: e, ...t }) => t);
|
|
3047
|
+
p(e.id, { filters: a.map((e, t) => t === n ? {
|
|
3044
3048
|
...e,
|
|
3045
3049
|
params: {
|
|
3046
3050
|
...e.params,
|
|
@@ -3050,13 +3054,13 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3050
3054
|
};
|
|
3051
3055
|
return /* @__PURE__ */ $("div", {
|
|
3052
3056
|
className: "flex flex-col gap-2",
|
|
3053
|
-
children: [/* @__PURE__ */ Q(
|
|
3057
|
+
children: [/* @__PURE__ */ Q(J, {
|
|
3054
3058
|
tone: "grey",
|
|
3055
3059
|
size: B,
|
|
3056
3060
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3057
3061
|
iconLeft: "trash",
|
|
3058
3062
|
iconRight: "trash",
|
|
3059
|
-
onClick: () =>
|
|
3063
|
+
onClick: () => g(e.id, n),
|
|
3060
3064
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3061
3065
|
}), i.length > 0 && /* @__PURE__ */ Q(Gi, {
|
|
3062
3066
|
size: B,
|
|
@@ -3069,17 +3073,17 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3069
3073
|
}, t.key);
|
|
3070
3074
|
})]
|
|
3071
3075
|
}),
|
|
3072
|
-
|
|
3076
|
+
ge === "transport" && y("motion") && /* @__PURE__ */ $("div", {
|
|
3073
3077
|
className: "flex flex-col gap-2 pt-3",
|
|
3074
3078
|
children: [(() => {
|
|
3075
|
-
let e =
|
|
3079
|
+
let e = y("motion").TransportBar;
|
|
3076
3080
|
return /* @__PURE__ */ Q(e, { size: B });
|
|
3077
3081
|
})(), /* @__PURE__ */ Q(qi, { size: B })]
|
|
3078
3082
|
}),
|
|
3079
|
-
|
|
3083
|
+
ge === "output" && /* @__PURE__ */ $("div", {
|
|
3080
3084
|
className: "flex flex-col gap-2 pt-3",
|
|
3081
3085
|
children: [
|
|
3082
|
-
/* @__PURE__ */ Q(
|
|
3086
|
+
/* @__PURE__ */ Q(Ln, {
|
|
3083
3087
|
layout: "joined",
|
|
3084
3088
|
value: a,
|
|
3085
3089
|
onChange: s,
|
|
@@ -3087,7 +3091,7 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3087
3091
|
size: B,
|
|
3088
3092
|
ariaLabel: "Aspect"
|
|
3089
3093
|
}),
|
|
3090
|
-
/* @__PURE__ */ Q(
|
|
3094
|
+
/* @__PURE__ */ Q(Ln, {
|
|
3091
3095
|
layout: "joined",
|
|
3092
3096
|
value: a,
|
|
3093
3097
|
onChange: s,
|
|
@@ -3098,25 +3102,25 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3098
3102
|
/* @__PURE__ */ $("div", {
|
|
3099
3103
|
className: "grid grid-cols-2 gap-2",
|
|
3100
3104
|
children: [
|
|
3101
|
-
/* @__PURE__ */ Q(
|
|
3105
|
+
/* @__PURE__ */ Q(J, {
|
|
3102
3106
|
tone: "primary",
|
|
3103
3107
|
size: B,
|
|
3104
|
-
onClick: () =>
|
|
3108
|
+
onClick: () => It({ focusName: !0 }),
|
|
3105
3109
|
children: "Save…"
|
|
3106
3110
|
}),
|
|
3107
|
-
/* @__PURE__ */ Q(
|
|
3111
|
+
/* @__PURE__ */ Q(J, {
|
|
3108
3112
|
tone: "primary",
|
|
3109
3113
|
size: B,
|
|
3110
|
-
onClick: () =>
|
|
3114
|
+
onClick: () => v(2),
|
|
3111
3115
|
children: "Download"
|
|
3112
3116
|
}),
|
|
3113
|
-
/* @__PURE__ */ Q(
|
|
3117
|
+
/* @__PURE__ */ Q(J, {
|
|
3114
3118
|
tone: "primary",
|
|
3115
3119
|
size: B,
|
|
3116
3120
|
onClick: () => S(!0),
|
|
3117
3121
|
children: "Hide UI"
|
|
3118
3122
|
}),
|
|
3119
|
-
/* @__PURE__ */ Q(
|
|
3123
|
+
/* @__PURE__ */ Q(J, {
|
|
3120
3124
|
tone: "primary",
|
|
3121
3125
|
size: B,
|
|
3122
3126
|
onClick: i,
|
|
@@ -3152,53 +3156,53 @@ function Zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3152
3156
|
})]
|
|
3153
3157
|
}) : /* @__PURE__ */ Q("span", {
|
|
3154
3158
|
className: "kol-eyebrow text-body",
|
|
3155
|
-
children:
|
|
3159
|
+
children: mn("randomiser").label
|
|
3156
3160
|
}), /* @__PURE__ */ $("div", {
|
|
3157
3161
|
className: "flex flex-col gap-2",
|
|
3158
3162
|
children: [
|
|
3159
|
-
/* @__PURE__ */ Q(
|
|
3163
|
+
/* @__PURE__ */ Q(J, {
|
|
3160
3164
|
tone: "primary",
|
|
3161
3165
|
size: "lg",
|
|
3162
|
-
className:
|
|
3163
|
-
iconLeft:
|
|
3164
|
-
iconRight:
|
|
3166
|
+
className: Kt,
|
|
3167
|
+
iconLeft: Zt.randomiser,
|
|
3168
|
+
iconRight: Zt.randomiser,
|
|
3165
3169
|
onClick: e,
|
|
3166
3170
|
children: "Generate"
|
|
3167
3171
|
}),
|
|
3168
|
-
/* @__PURE__ */ Q(
|
|
3172
|
+
/* @__PURE__ */ Q(J, {
|
|
3169
3173
|
tone: "primary",
|
|
3170
3174
|
size: "lg",
|
|
3171
|
-
className:
|
|
3175
|
+
className: Kt,
|
|
3172
3176
|
iconLeft: "filter",
|
|
3173
3177
|
iconRight: "filter",
|
|
3174
3178
|
onClick: t,
|
|
3175
3179
|
children: "Effects"
|
|
3176
3180
|
}),
|
|
3177
|
-
n &&
|
|
3181
|
+
n && St() && /* @__PURE__ */ Q(J, {
|
|
3178
3182
|
tone: "primary",
|
|
3179
3183
|
size: "lg",
|
|
3180
3184
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3181
|
-
iconLeft:
|
|
3182
|
-
iconRight:
|
|
3183
|
-
onClick:
|
|
3184
|
-
children:
|
|
3185
|
+
iconLeft: Zt.editor,
|
|
3186
|
+
iconRight: Zt.editor,
|
|
3187
|
+
onClick: Jt,
|
|
3188
|
+
children: mn("editor").label
|
|
3185
3189
|
}),
|
|
3186
|
-
n && /* @__PURE__ */ Q(
|
|
3190
|
+
n && /* @__PURE__ */ Q(J, {
|
|
3187
3191
|
tone: "primary",
|
|
3188
3192
|
size: "lg",
|
|
3189
3193
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3190
|
-
iconLeft:
|
|
3191
|
-
iconRight:
|
|
3194
|
+
iconLeft: Zt.labs,
|
|
3195
|
+
iconRight: Zt.labs,
|
|
3192
3196
|
onClick: en,
|
|
3193
|
-
children:
|
|
3197
|
+
children: mn("labs").label
|
|
3194
3198
|
}),
|
|
3195
|
-
n && /* @__PURE__ */ Q(
|
|
3199
|
+
n && /* @__PURE__ */ Q(J, {
|
|
3196
3200
|
tone: "primary",
|
|
3197
3201
|
size: "lg",
|
|
3198
3202
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3199
3203
|
iconLeft: "swap",
|
|
3200
3204
|
iconRight: "swap",
|
|
3201
|
-
onClick: () =>
|
|
3205
|
+
onClick: () => jn("/morph"),
|
|
3202
3206
|
children: "Morph"
|
|
3203
3207
|
})
|
|
3204
3208
|
]
|
|
@@ -3207,10 +3211,10 @@ function Zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3207
3211
|
});
|
|
3208
3212
|
}
|
|
3209
3213
|
function Qi() {
|
|
3210
|
-
let { layers:
|
|
3214
|
+
let { layers: t, addLayer: r, removeLayer: i, updateLayer: a, canvasW: s, canvasH: c, aspect: l, setAspect: u } = o(), { setTool: d } = Mt(), f = zt() && !Tn(), p = vn(), m = () => {
|
|
3211
3215
|
let e = new URLSearchParams(window.location.search);
|
|
3212
3216
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3213
|
-
}, [
|
|
3217
|
+
}, [h, g] = Z(m), [_, v] = Z(!1), [y, b] = Z(null), [x, S] = Z("contain"), [C, w] = Z(!1), [T, E] = Z(null), [D, O] = Z({
|
|
3214
3218
|
s: 1,
|
|
3215
3219
|
x: 0,
|
|
3216
3220
|
y: 0
|
|
@@ -3222,107 +3226,107 @@ function Qi() {
|
|
|
3222
3226
|
x: 0,
|
|
3223
3227
|
y: 0
|
|
3224
3228
|
}
|
|
3225
|
-
}),
|
|
3229
|
+
}), ee = X(null), M = () => {
|
|
3226
3230
|
let [e, t] = [...A.current.pts.values()];
|
|
3227
3231
|
return {
|
|
3228
3232
|
d: Math.hypot(e.x - t.x, e.y - t.y),
|
|
3229
3233
|
mx: (e.x + t.x) / 2,
|
|
3230
3234
|
my: (e.y + t.y) / 2
|
|
3231
3235
|
};
|
|
3232
|
-
},
|
|
3236
|
+
}, N = (e) => `translate(${e.x}px, ${e.y}px) scale(${e.s})`, te = (e) => {
|
|
3233
3237
|
if (A.current.pts.set(e.pointerId, {
|
|
3234
3238
|
x: e.clientX,
|
|
3235
3239
|
y: e.clientY
|
|
3236
|
-
}),
|
|
3240
|
+
}), ee.current = A.current.pts.size === 1 ? {
|
|
3237
3241
|
id: e.pointerId,
|
|
3238
3242
|
x: e.clientX,
|
|
3239
3243
|
y: e.clientY,
|
|
3240
3244
|
t: performance.now()
|
|
3241
3245
|
} : null, A.current.pts.size === 2) {
|
|
3242
|
-
let t = k.current?.getBoundingClientRect(),
|
|
3246
|
+
let t = k.current?.getBoundingClientRect(), r = M(), i = (t?.left ?? 0) - D.x, a = (t?.top ?? 0) - D.y;
|
|
3243
3247
|
A.current.start = {
|
|
3244
|
-
...
|
|
3245
|
-
ox:
|
|
3246
|
-
oy:
|
|
3248
|
+
...r,
|
|
3249
|
+
ox: i,
|
|
3250
|
+
oy: a,
|
|
3247
3251
|
v: D,
|
|
3248
|
-
px: (
|
|
3249
|
-
py: (
|
|
3250
|
-
}, A.current.live = D,
|
|
3252
|
+
px: (r.mx - i - D.x) / D.s,
|
|
3253
|
+
py: (r.my - a - D.y) / D.s
|
|
3254
|
+
}, A.current.live = D, n.setStagePointer(null), e.stopPropagation();
|
|
3251
3255
|
}
|
|
3252
|
-
},
|
|
3256
|
+
}, P = (e) => {
|
|
3253
3257
|
let t = A.current;
|
|
3254
3258
|
if (t.pts.has(e.pointerId) && (t.pts.set(e.pointerId, {
|
|
3255
3259
|
x: e.clientX,
|
|
3256
3260
|
y: e.clientY
|
|
3257
3261
|
}), t.pts.size >= 2 && t.start)) {
|
|
3258
3262
|
e.stopPropagation();
|
|
3259
|
-
let n =
|
|
3263
|
+
let n = M(), r = t.start, i = Math.min(4, Math.max(.5, r.v.s * (n.d / r.d)));
|
|
3260
3264
|
t.live = {
|
|
3261
3265
|
s: i,
|
|
3262
3266
|
x: n.mx - r.ox - i * r.px,
|
|
3263
3267
|
y: n.my - r.oy - i * r.py
|
|
3264
|
-
}, k.current && (k.current.style.transform =
|
|
3268
|
+
}, k.current && (k.current.style.transform = N(t.live));
|
|
3265
3269
|
}
|
|
3266
|
-
},
|
|
3267
|
-
let t =
|
|
3268
|
-
t && t.id === e.pointerId && e.type === "pointerup" &&
|
|
3270
|
+
}, F = (e) => {
|
|
3271
|
+
let t = ee.current;
|
|
3272
|
+
t && t.id === e.pointerId && e.type === "pointerup" && h === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (I?.type === "loop" ? K(I.loopId) : null)?.group !== "penrose" && n.toggle(), t?.id === e.pointerId && (ee.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, O(A.current.live));
|
|
3269
3273
|
};
|
|
3270
|
-
|
|
3271
|
-
|
|
3274
|
+
nr(), Y(() => (on("randomiser"), () => on(null)), []), Y(() => {
|
|
3275
|
+
u("4:5"), d("orbit");
|
|
3272
3276
|
}, []);
|
|
3273
|
-
let
|
|
3277
|
+
let I = t.find((e) => e.id === y) ?? (t.length === 1 ? t[0] : null), L = h === "live" && I?.type === "photo" && !I.src && I.srcType !== "webcam";
|
|
3274
3278
|
Y(() => {
|
|
3275
|
-
if (!
|
|
3279
|
+
if (!L) return;
|
|
3276
3280
|
let e = (e) => {
|
|
3277
|
-
e.key === "Escape" &&
|
|
3281
|
+
e.key === "Escape" && V();
|
|
3278
3282
|
};
|
|
3279
3283
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
3280
3284
|
}), Y(() => {
|
|
3281
|
-
if (!
|
|
3282
|
-
let e =
|
|
3283
|
-
return
|
|
3284
|
-
e &&
|
|
3285
|
+
if (!L) return;
|
|
3286
|
+
let e = n.isPlaying();
|
|
3287
|
+
return n.pause(), () => {
|
|
3288
|
+
e && n.play();
|
|
3285
3289
|
};
|
|
3286
|
-
}, [
|
|
3287
|
-
let
|
|
3288
|
-
let t =
|
|
3289
|
-
t && (
|
|
3290
|
-
},
|
|
3291
|
-
let t =
|
|
3292
|
-
t &&
|
|
3293
|
-
},
|
|
3294
|
-
|
|
3290
|
+
}, [L]);
|
|
3291
|
+
let R = (e) => {
|
|
3292
|
+
let t = ae(e);
|
|
3293
|
+
t && (b(r("loop", t)), g("live"));
|
|
3294
|
+
}, ne = (e) => {
|
|
3295
|
+
let t = ae(e);
|
|
3296
|
+
t && y && a(y, t);
|
|
3297
|
+
}, z = () => {
|
|
3298
|
+
b(r("photo", {
|
|
3295
3299
|
fit: "cover",
|
|
3296
3300
|
x: 0,
|
|
3297
3301
|
y: 0,
|
|
3298
|
-
w:
|
|
3299
|
-
h: Math.round(
|
|
3300
|
-
})),
|
|
3302
|
+
w: e,
|
|
3303
|
+
h: Math.round(e * c / s)
|
|
3304
|
+
})), g("live");
|
|
3301
3305
|
};
|
|
3302
3306
|
Y(() => {
|
|
3303
3307
|
let e = new URL(window.location.href), t = e.searchParams.get("start");
|
|
3304
|
-
t && (t === "effects" && (
|
|
3308
|
+
t && (t === "effects" && (v(!0), z()), e.searchParams.delete("start"), window.history.replaceState(window.history.state, "", e));
|
|
3305
3309
|
}, []);
|
|
3306
|
-
let
|
|
3307
|
-
if (
|
|
3308
|
-
|
|
3310
|
+
let B = (t) => {
|
|
3311
|
+
if (t === "fill") {
|
|
3312
|
+
S("cover");
|
|
3309
3313
|
return;
|
|
3310
3314
|
}
|
|
3311
|
-
|
|
3312
|
-
let n =
|
|
3313
|
-
|
|
3315
|
+
S("contain"), u(t);
|
|
3316
|
+
let n = j[t];
|
|
3317
|
+
y && n && a(y, {
|
|
3314
3318
|
x: 0,
|
|
3315
3319
|
y: 0,
|
|
3316
|
-
w:
|
|
3317
|
-
h: Math.round(
|
|
3320
|
+
w: e,
|
|
3321
|
+
h: Math.round(e * n.h / n.w)
|
|
3318
3322
|
});
|
|
3319
|
-
},
|
|
3320
|
-
for (let
|
|
3321
|
-
|
|
3323
|
+
}, V = () => {
|
|
3324
|
+
for (let e of [...t]) i(e.id);
|
|
3325
|
+
b(null), O({
|
|
3322
3326
|
s: 1,
|
|
3323
3327
|
x: 0,
|
|
3324
3328
|
y: 0
|
|
3325
|
-
}),
|
|
3329
|
+
}), v(!1), g(m());
|
|
3326
3330
|
};
|
|
3327
3331
|
return /* @__PURE__ */ $("div", {
|
|
3328
3332
|
className: "kol-editor-randomiser relative h-dvh bg-black",
|
|
@@ -3331,56 +3335,56 @@ function Qi() {
|
|
|
3331
3335
|
ref: k,
|
|
3332
3336
|
className: "absolute inset-y-0 left-0 touch-none overflow-hidden",
|
|
3333
3337
|
style: {
|
|
3334
|
-
transform:
|
|
3338
|
+
transform: N(D),
|
|
3335
3339
|
transformOrigin: "0 0",
|
|
3336
|
-
right:
|
|
3337
|
-
bottom:
|
|
3340
|
+
right: C ? "var(--kol-sidenav-w, 320px)" : 0,
|
|
3341
|
+
bottom: T ?? 0
|
|
3338
3342
|
},
|
|
3339
|
-
onPointerDownCapture:
|
|
3340
|
-
onPointerMoveCapture:
|
|
3341
|
-
onPointerUpCapture:
|
|
3342
|
-
onPointerCancelCapture:
|
|
3343
|
-
onPointerLeave:
|
|
3344
|
-
children: /* @__PURE__ */ Q(
|
|
3343
|
+
onPointerDownCapture: te,
|
|
3344
|
+
onPointerMoveCapture: P,
|
|
3345
|
+
onPointerUpCapture: F,
|
|
3346
|
+
onPointerCancelCapture: F,
|
|
3347
|
+
onPointerLeave: F,
|
|
3348
|
+
children: /* @__PURE__ */ Q(an, { fit: x })
|
|
3345
3349
|
}),
|
|
3346
|
-
|
|
3347
|
-
chromes:
|
|
3348
|
-
onGenerate: () =>
|
|
3350
|
+
h === "entry" && /* @__PURE__ */ Q(Zi, {
|
|
3351
|
+
chromes: f,
|
|
3352
|
+
onGenerate: () => g("category"),
|
|
3349
3353
|
onEffects: () => {
|
|
3350
|
-
|
|
3354
|
+
v(!0), z();
|
|
3351
3355
|
}
|
|
3352
3356
|
}),
|
|
3353
|
-
|
|
3354
|
-
onPick:
|
|
3355
|
-
onInsert:
|
|
3356
|
-
onBack: () =>
|
|
3357
|
+
h === "category" && /* @__PURE__ */ Q(ai, {
|
|
3358
|
+
onPick: R,
|
|
3359
|
+
onInsert: z,
|
|
3360
|
+
onBack: () => g("entry")
|
|
3357
3361
|
}),
|
|
3358
|
-
|
|
3359
|
-
layer:
|
|
3360
|
-
onSwitchCategory:
|
|
3362
|
+
h === "live" && !L && /* @__PURE__ */ Q(Xi, {
|
|
3363
|
+
layer: I,
|
|
3364
|
+
onSwitchCategory: ne,
|
|
3361
3365
|
onInsert: () => {
|
|
3362
|
-
|
|
3366
|
+
V(), z();
|
|
3363
3367
|
},
|
|
3364
|
-
onRestart:
|
|
3365
|
-
aspectValue:
|
|
3366
|
-
openEffects:
|
|
3367
|
-
onAspect:
|
|
3368
|
-
rail: !
|
|
3369
|
-
onRail:
|
|
3368
|
+
onRestart: V,
|
|
3369
|
+
aspectValue: x === "cover" ? "fill" : l,
|
|
3370
|
+
openEffects: _ && !L,
|
|
3371
|
+
onAspect: B,
|
|
3372
|
+
rail: !f && !p,
|
|
3373
|
+
onRail: w,
|
|
3370
3374
|
onSheet: E
|
|
3371
3375
|
}),
|
|
3372
|
-
|
|
3376
|
+
L && /* @__PURE__ */ $("div", {
|
|
3373
3377
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col",
|
|
3374
3378
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3375
3379
|
children: [/* @__PURE__ */ Q("div", {
|
|
3376
3380
|
className: "flex-1 min-h-0",
|
|
3377
|
-
children: /* @__PURE__ */ Q(
|
|
3381
|
+
children: /* @__PURE__ */ Q(ci, { layer: I })
|
|
3378
3382
|
}), /* @__PURE__ */ Q("div", {
|
|
3379
3383
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3380
|
-
children: /* @__PURE__ */ Q(
|
|
3384
|
+
children: /* @__PURE__ */ Q(J, {
|
|
3381
3385
|
tone: "outline",
|
|
3382
3386
|
size: "lg",
|
|
3383
|
-
onClick:
|
|
3387
|
+
onClick: V,
|
|
3384
3388
|
children: "Back"
|
|
3385
3389
|
})
|
|
3386
3390
|
})]
|
|
@@ -3389,105 +3393,69 @@ function Qi() {
|
|
|
3389
3393
|
});
|
|
3390
3394
|
}
|
|
3391
3395
|
function $i() {
|
|
3392
|
-
return /* @__PURE__ */ $(
|
|
3396
|
+
return /* @__PURE__ */ $(hn, {
|
|
3393
3397
|
persistDraft: !1,
|
|
3394
|
-
children: [/* @__PURE__ */ Q(Qi, {}), /* @__PURE__ */ Q(
|
|
3398
|
+
children: [/* @__PURE__ */ Q(Qi, {}), /* @__PURE__ */ Q(dn, {})]
|
|
3395
3399
|
});
|
|
3396
3400
|
}
|
|
3397
3401
|
//#endregion
|
|
3398
|
-
//#region src/editor/
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
}
|
|
3402
|
+
//#region src/editor/float/Movable.jsx
|
|
3403
|
+
var ea = "button, a, input, select, textarea, [role=button], [role=tab], [role=slider]", ta = (e, t) => Math.max(0, Math.min(e, t));
|
|
3404
|
+
function na({ id: e, start: t = {
|
|
3405
|
+
right: 24,
|
|
3406
|
+
bottom: 24
|
|
3407
|
+
}, onMoved: n, className: r = "", children: i }) {
|
|
3408
|
+
let a = `kol-float-pos:${e}`, o = JSON.stringify(t), [s, c] = Z(() => {
|
|
3409
|
+
try {
|
|
3410
|
+
let e = JSON.parse(localStorage.getItem(a));
|
|
3411
|
+
return e?.start === o ? {
|
|
3412
|
+
left: e.left,
|
|
3413
|
+
top: e.top
|
|
3414
|
+
} : null;
|
|
3415
|
+
} catch {
|
|
3416
|
+
return null;
|
|
3417
|
+
}
|
|
3418
|
+
}), l = X(null);
|
|
3419
|
+
return Y(() => {
|
|
3420
|
+
n?.(!!s);
|
|
3421
|
+
}, [!!s]), /* @__PURE__ */ Q("div", {
|
|
3422
|
+
ref: l,
|
|
3423
|
+
onPointerDown: (e) => {
|
|
3424
|
+
if (e.button !== 0 || e.target.closest(ea)) return;
|
|
3425
|
+
let t = l.current, n = t.getBoundingClientRect(), r = t.offsetParent.getBoundingClientRect(), i = e.clientX - n.left, s = e.clientY - n.top, u = null;
|
|
3426
|
+
t.setPointerCapture(e.pointerId);
|
|
3427
|
+
let d = (t) => {
|
|
3428
|
+
!u && Math.hypot(t.clientX - e.clientX, t.clientY - e.clientY) < 4 || (u = {
|
|
3429
|
+
left: ta(t.clientX - r.left - i, r.width - n.width),
|
|
3430
|
+
top: ta(t.clientY - r.top - s, r.height - n.height)
|
|
3431
|
+
}, c(u));
|
|
3432
|
+
}, f = () => {
|
|
3433
|
+
if (t.removeEventListener("pointermove", d), t.removeEventListener("pointerup", f), t.removeEventListener("pointercancel", f), u) try {
|
|
3434
|
+
localStorage.setItem(a, JSON.stringify({
|
|
3435
|
+
...u,
|
|
3436
|
+
start: o
|
|
3437
|
+
}));
|
|
3438
|
+
} catch {}
|
|
3439
|
+
};
|
|
3440
|
+
t.addEventListener("pointermove", d), t.addEventListener("pointerup", f), t.addEventListener("pointercancel", f);
|
|
3411
3441
|
},
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
kbd: "⌘O",
|
|
3420
|
-
onClick: i(() => Ot())
|
|
3421
|
-
},
|
|
3422
|
-
{
|
|
3423
|
-
label: "Save patch",
|
|
3424
|
-
kbd: "⌘S",
|
|
3425
|
-
onClick: () => cn("File")
|
|
3426
|
-
},
|
|
3427
|
-
{ divider: !0 },
|
|
3428
|
-
{
|
|
3429
|
-
label: "Output…",
|
|
3430
|
-
onClick: () => cn("Output")
|
|
3431
|
-
},
|
|
3432
|
-
{
|
|
3433
|
-
label: "File…",
|
|
3434
|
-
onClick: () => cn("File")
|
|
3435
|
-
}
|
|
3436
|
-
]
|
|
3437
|
-
},
|
|
3438
|
-
{
|
|
3439
|
-
label: "Edit",
|
|
3440
|
-
width: 220,
|
|
3441
|
-
items: [{
|
|
3442
|
-
label: "Undo",
|
|
3443
|
-
kbd: "⌘Z",
|
|
3444
|
-
disabled: !n,
|
|
3445
|
-
onClick: e
|
|
3446
|
-
}, {
|
|
3447
|
-
label: "Redo",
|
|
3448
|
-
kbd: "⇧⌘Z",
|
|
3449
|
-
disabled: !r,
|
|
3450
|
-
onClick: t
|
|
3451
|
-
}]
|
|
3452
|
-
},
|
|
3453
|
-
{
|
|
3454
|
-
label: "View",
|
|
3455
|
-
width: 240,
|
|
3456
|
-
items: [
|
|
3457
|
-
{
|
|
3458
|
-
label: "Play / pause",
|
|
3459
|
-
kbd: "Space",
|
|
3460
|
-
onClick: () => O.toggle()
|
|
3461
|
-
},
|
|
3462
|
-
{
|
|
3463
|
-
label: "Rewind",
|
|
3464
|
-
onClick: () => O.rewind()
|
|
3465
|
-
},
|
|
3466
|
-
{ divider: !0 },
|
|
3467
|
-
{
|
|
3468
|
-
label: "Transport",
|
|
3469
|
-
onClick: () => cn("Transport")
|
|
3470
|
-
},
|
|
3471
|
-
{
|
|
3472
|
-
label: "Shortcuts",
|
|
3473
|
-
kbd: "S",
|
|
3474
|
-
onClick: a("kol:show-shortcuts")
|
|
3475
|
-
}
|
|
3476
|
-
]
|
|
3442
|
+
style: s ?? t,
|
|
3443
|
+
onDoubleClick: (e) => {
|
|
3444
|
+
if (!e.target.closest(ea)) {
|
|
3445
|
+
c(null);
|
|
3446
|
+
try {
|
|
3447
|
+
localStorage.removeItem(a);
|
|
3448
|
+
} catch {}
|
|
3477
3449
|
}
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
label: "Keyboard shortcuts",
|
|
3483
|
-
kbd: "S",
|
|
3484
|
-
onClick: a("kol:show-shortcuts")
|
|
3485
|
-
}]
|
|
3486
|
-
}]
|
|
3487
|
-
};
|
|
3450
|
+
},
|
|
3451
|
+
className: `absolute z-[var(--kol-z-sticky)] cursor-grab active:cursor-grabbing touch-none select-none ${r}`.trim(),
|
|
3452
|
+
children: i
|
|
3453
|
+
});
|
|
3488
3454
|
}
|
|
3489
|
-
|
|
3490
|
-
|
|
3455
|
+
//#endregion
|
|
3456
|
+
//#region src/editor/labs/FloatLabs.jsx
|
|
3457
|
+
function ra() {
|
|
3458
|
+
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = _e(), i = X(null);
|
|
3491
3459
|
Y(() => {
|
|
3492
3460
|
n?.type === "photo" && n.src && (i.current = {
|
|
3493
3461
|
src: n.src,
|
|
@@ -3500,7 +3468,7 @@ function ta() {
|
|
|
3500
3468
|
n?.srcType,
|
|
3501
3469
|
n?.fit
|
|
3502
3470
|
]);
|
|
3503
|
-
let a =
|
|
3471
|
+
let a = Tr({
|
|
3504
3472
|
layer: n,
|
|
3505
3473
|
setOnly: r,
|
|
3506
3474
|
addFilter: e,
|
|
@@ -3514,7 +3482,7 @@ function ta() {
|
|
|
3514
3482
|
return a.forEach((e) => {
|
|
3515
3483
|
if (e.id.startsWith("sec:")) {
|
|
3516
3484
|
s.push({
|
|
3517
|
-
icon:
|
|
3485
|
+
icon: xr[e.id.slice(4)] ?? "square",
|
|
3518
3486
|
label: e.label,
|
|
3519
3487
|
path: e.id,
|
|
3520
3488
|
sub: []
|
|
@@ -3535,116 +3503,114 @@ function ta() {
|
|
|
3535
3503
|
pick: (e) => c.get(e)?.()
|
|
3536
3504
|
};
|
|
3537
3505
|
}
|
|
3538
|
-
function
|
|
3539
|
-
let { layer: e } =
|
|
3506
|
+
function ia() {
|
|
3507
|
+
let { layer: e } = _e(), { removeLayer: t } = o(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam";
|
|
3540
3508
|
return /* @__PURE__ */ $("div", {
|
|
3541
|
-
className: "kol-float-labs-stage
|
|
3542
|
-
style: { background: "var(--kol-surface-secondary)" },
|
|
3509
|
+
className: "kol-float-labs-stage absolute inset-0 flex items-center justify-center overflow-hidden bg-surface-primary",
|
|
3543
3510
|
children: [/* @__PURE__ */ Q("div", {
|
|
3544
3511
|
style: {
|
|
3545
3512
|
flex: "none",
|
|
3546
3513
|
width: "85%",
|
|
3547
3514
|
height: "85%"
|
|
3548
3515
|
},
|
|
3549
|
-
children: /* @__PURE__ */ Q(
|
|
3550
|
-
}), n && /* @__PURE__ */ Q(
|
|
3516
|
+
children: /* @__PURE__ */ Q(tn, {})
|
|
3517
|
+
}), n && /* @__PURE__ */ Q(li, {
|
|
3551
3518
|
layer: e,
|
|
3552
|
-
title:
|
|
3519
|
+
title: _i(e).title,
|
|
3553
3520
|
onBack: () => t(e.id)
|
|
3554
3521
|
})]
|
|
3555
3522
|
});
|
|
3556
3523
|
}
|
|
3557
|
-
function
|
|
3558
|
-
|
|
3559
|
-
let e =
|
|
3524
|
+
function aa() {
|
|
3525
|
+
Bt(), Mi();
|
|
3526
|
+
let e = Gn("(max-width: 767px)"), { layer: t } = _e(), { selectedId: n, select: r } = o();
|
|
3560
3527
|
Y(() => {
|
|
3561
|
-
t &&
|
|
3528
|
+
t && n !== t.id && r(t.id);
|
|
3562
3529
|
}, [
|
|
3563
3530
|
t,
|
|
3564
|
-
|
|
3565
|
-
|
|
3531
|
+
n,
|
|
3532
|
+
r
|
|
3566
3533
|
]);
|
|
3567
|
-
let
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
onBack: () => pn("/"),
|
|
3571
|
-
menuItems: Nn([...l, ...u].map((e) => ({
|
|
3572
|
-
label: e.label,
|
|
3573
|
-
items: e.items
|
|
3574
|
-
})))
|
|
3575
|
-
}), h = /* @__PURE__ */ Q(er, {
|
|
3576
|
-
onUndo: () => i && n(),
|
|
3577
|
-
onRedo: () => a && r(),
|
|
3578
|
-
onAction: () => cn("Output"),
|
|
3579
|
-
onAccount: () => pn("/settings")
|
|
3580
|
-
}), g = /* @__PURE__ */ Q(Zn, {
|
|
3581
|
-
variant: "mobile",
|
|
3582
|
-
shape: "pill",
|
|
3583
|
-
labels: !e,
|
|
3584
|
-
items: rn,
|
|
3585
|
-
sheetItems: tn,
|
|
3586
|
-
currentPath: "/labs",
|
|
3587
|
-
onNavigate: kn
|
|
3588
|
-
});
|
|
3589
|
-
return /* @__PURE__ */ Q("div", {
|
|
3590
|
-
className: "kol-float-labs kol-editor-shell",
|
|
3534
|
+
let i = ra(), a = t ? _i(t).title : "Labs", s = i.items.filter((e) => e.sub?.length).map((e) => e.path), [c, l] = Z(e), [u, d] = Z(!1), [f, p] = Z(!1);
|
|
3535
|
+
return /* @__PURE__ */ $("div", {
|
|
3536
|
+
className: "kol-float-labs kol-editor-shell relative h-dvh overflow-hidden",
|
|
3591
3537
|
"data-editor-keep-selection": !0,
|
|
3592
|
-
children:
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
"
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
label: "Parameters",
|
|
3619
|
-
rows: [{
|
|
3620
|
-
id: "body",
|
|
3621
|
-
render: () => /* @__PURE__ */ Q("div", {
|
|
3622
|
-
className: "kol-editor-labs",
|
|
3623
|
-
children: /* @__PURE__ */ Q("div", {
|
|
3624
|
-
className: "kol-compose-inspector-body",
|
|
3625
|
-
children: /* @__PURE__ */ Q(ii, {})
|
|
3626
|
-
})
|
|
3627
|
-
})
|
|
3628
|
-
}]
|
|
3629
|
-
}],
|
|
3630
|
-
footer: /* @__PURE__ */ Q("div", {
|
|
3631
|
-
className: "kol-editor-labs",
|
|
3632
|
-
children: /* @__PURE__ */ Q(qt, {})
|
|
3633
|
-
})
|
|
3538
|
+
children: [
|
|
3539
|
+
/* @__PURE__ */ Q(ia, {}),
|
|
3540
|
+
u ? /* @__PURE__ */ Q(er, {
|
|
3541
|
+
items: i.items,
|
|
3542
|
+
currentPath: i.active ?? "",
|
|
3543
|
+
onNavigate: i.pick,
|
|
3544
|
+
title: "Labs",
|
|
3545
|
+
breadcrumb: ["Labs", a],
|
|
3546
|
+
onRestore: () => d(!1),
|
|
3547
|
+
className: "absolute left-6 top-6 z-[var(--kol-z-sticky)]"
|
|
3548
|
+
}) : /* @__PURE__ */ Q(Bn, {
|
|
3549
|
+
variant: "float",
|
|
3550
|
+
items: i.items,
|
|
3551
|
+
currentPath: i.active ?? "",
|
|
3552
|
+
onNavigate: i.pick,
|
|
3553
|
+
title: "Labs",
|
|
3554
|
+
icon: "globe",
|
|
3555
|
+
defaultExpanded: s,
|
|
3556
|
+
collapsed: c,
|
|
3557
|
+
onCollapsedChange: l,
|
|
3558
|
+
onHide: () => d(!0),
|
|
3559
|
+
footer: c ? void 0 : /* @__PURE__ */ Q($n, {
|
|
3560
|
+
onCollapse: () => l(!0),
|
|
3561
|
+
onHide: () => d(!0)
|
|
3562
|
+
}),
|
|
3563
|
+
className: "absolute inset-y-6 left-6 z-[var(--kol-z-sticky)] !h-auto"
|
|
3634
3564
|
}),
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3565
|
+
!e && /* @__PURE__ */ Q(na, {
|
|
3566
|
+
id: "labs-transport",
|
|
3567
|
+
start: {
|
|
3568
|
+
right: 24,
|
|
3569
|
+
bottom: 24
|
|
3570
|
+
},
|
|
3571
|
+
onMoved: p,
|
|
3572
|
+
children: /* @__PURE__ */ Q(cn, {})
|
|
3638
3573
|
}),
|
|
3639
|
-
|
|
3640
|
-
|
|
3574
|
+
/* @__PURE__ */ Q("div", {
|
|
3575
|
+
className: `absolute top-6 right-6 ${!e && !f ? "bottom-24" : "bottom-6"} z-[var(--kol-z-sticky)] flex flex-col pointer-events-none [&>*]:pointer-events-auto`,
|
|
3576
|
+
children: /* @__PURE__ */ Q(Qn, {
|
|
3577
|
+
title: a || "Parameters",
|
|
3578
|
+
width: e ? 300 : 352,
|
|
3579
|
+
density: "compact",
|
|
3580
|
+
surface: "solid",
|
|
3581
|
+
className: "max-h-full min-h-0 overflow-y-auto [scrollbar-width:none] [&_.kol-compose-inspector-body]:!p-0",
|
|
3582
|
+
sections: [{
|
|
3583
|
+
id: "labs-params",
|
|
3584
|
+
label: "Parameters",
|
|
3585
|
+
rows: [{
|
|
3586
|
+
id: "body",
|
|
3587
|
+
render: () => /* @__PURE__ */ Q("div", {
|
|
3588
|
+
className: "kol-editor-labs",
|
|
3589
|
+
children: /* @__PURE__ */ Q("div", {
|
|
3590
|
+
className: "kol-compose-inspector-body",
|
|
3591
|
+
children: /* @__PURE__ */ Q(ri, {})
|
|
3592
|
+
})
|
|
3593
|
+
})
|
|
3594
|
+
}]
|
|
3595
|
+
}],
|
|
3596
|
+
footer: /* @__PURE__ */ Q("div", {
|
|
3597
|
+
className: "kol-editor-labs",
|
|
3598
|
+
children: /* @__PURE__ */ Q(sn, {})
|
|
3599
|
+
})
|
|
3600
|
+
})
|
|
3601
|
+
})
|
|
3602
|
+
]
|
|
3641
3603
|
});
|
|
3642
3604
|
}
|
|
3643
|
-
function
|
|
3644
|
-
return /* @__PURE__ */
|
|
3645
|
-
|
|
3646
|
-
children:
|
|
3605
|
+
function oa() {
|
|
3606
|
+
return /* @__PURE__ */ Q(g.Provider, {
|
|
3607
|
+
value: "float",
|
|
3608
|
+
children: /* @__PURE__ */ $(hn, {
|
|
3609
|
+
draftKey: Pi,
|
|
3610
|
+
modalVariant: "float",
|
|
3611
|
+
children: [/* @__PURE__ */ Q(aa, {}), /* @__PURE__ */ Q(dn, {})]
|
|
3612
|
+
})
|
|
3647
3613
|
});
|
|
3648
3614
|
}
|
|
3649
3615
|
//#endregion
|
|
3650
|
-
export {
|
|
3616
|
+
export { Lt as AppSettingsSections, Pt as BRAND, On as DesignEditor, On as default, fn as DisplaySettingsDrawer, hn as EditorProviders, Ot as FilesDialog, _n as FloatDesignEditor, oa as FloatLabsView, Ge as GeneratorLibraryProvider, Pi as LABS_DRAFT_KEY, qe as LIBRARY_SLOT_KEYS, Fi as LabsView, un as MODES, $i as MobileView, tn as OutputCanvas, an as OutputStage, xn as OutputView, $t as RAIL_EXTRA_PREFIX, yt as TimelineRail, Xe as UnauthorizedError, bn as VIEW_PATHS, Ft as closeFiles, In as comboLabel, wn as copyStored, Dn as currentView, ln as duplicateStored, Be as getLibraryApi, Le as inviteFromRequest, zt as isMobileDevice, Me as listInviteRequests, Ke as loadLibrary, Ye as mintInvite, It as openFiles, He as readLibraryRaw, te as registerPack, Xt as removeStored, yn as renameStored, Re as requestInvite, Pe as setLibraryApi, Pn as setMediaClient, Vt as setMediaProxyBase, nn as setMode, Sn as setNavigator, pn as setRailExtras, i as setSettingsStore, En as setThumbStored, rn as setWantsDesktop, Wt as shortcutsBySection, Ne as signInLibrary, Ie as signOutLibrary, We as signUpLibrary, ze as subscribeLibrary, bt as timelineView, je as updateAccount, Ue as useAccount, Rt as useFilesDialog, Je as useGeneratorLibrary, Fe as useLibrarySession, An as useRailExtras, Ct as useSettingsSections, Tn as wantsDesktop, gn as withView };
|