@kolkrabbi/design-editor 0.31.0 → 0.33.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/{Timeline-BKYyRqYg.js → Timeline-Cz-W72D0.js} +1 -1
- package/dist/{core-DBXPNsjJ.js → core-DCTuJ1dz.js} +167 -143
- package/dist/core.js +3 -3
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +396 -475
- package/dist/{effectCategories-BGIW_dEc.js → effectCategories-DV7i_AgK.js} +1 -1
- package/dist/{effects-RqPdJrRb.js → effects-Dn4_OzYx.js} +19 -17
- package/dist/effects.js +1 -1
- package/dist/{generators-BnuRmK-x.js → generators-XBzHN_kX.js} +34 -33
- package/dist/generators.js +1 -1
- package/dist/{host-DJ8bDKO7.js → host-B4QQewPr.js} +2 -2
- package/dist/{motion-DKZGyk14.js → motion-Cuwxm2ic.js} +25 -21
- package/dist/motion.js +1 -1
- package/dist/{store-D6Si8cRD.js → store-CF9s1Pb2.js} +417 -416
- package/dist/{useLayerEdit-BF9wI5pX.js → useLayerEdit-Cmtx3V3O.js} +20 -18
- package/package.json +10 -10
package/dist/design-editor.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { An as e, B as t, Bn as n, D as r, F as i, I as a, J as o, L as s, Lt as c, Mn as l, P as u, Vn as d, _n as f, a as p, d as m, f as h, ft as g, gt as _, ht as v, i as y, j as b, jn as x, kn as S, mn as C, n as w, nn as T, o as E, p as D, pn as O, r as ee, vn as k } from "./rolls-CEQmdcp3.js";
|
|
2
|
-
import { n as A, r as j, t as te } from "./useLayerEdit-
|
|
3
|
-
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-
|
|
2
|
+
import { n as A, r as j, t as te } from "./useLayerEdit-Cmtx3V3O.js";
|
|
3
|
+
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-DV7i_AgK.js";
|
|
4
4
|
import { r as ue } from "./TreePicker-1_NZG8GB.js";
|
|
5
|
-
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-
|
|
6
|
-
import { A as Te, C as Ee, D as De, E as Oe, M as ke, O as Ae, S as je, T as Me, _ as Ne, b as Pe, c as Fe, h as Ie, j as Le, k as Re, l as ze, m as Be, u as Ve, v as He, w as Ue, y as We } from "./store-
|
|
5
|
+
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-XBzHN_kX.js";
|
|
6
|
+
import { A as Te, C as Ee, D as De, E as Oe, M as ke, O as Ae, S as je, T as Me, _ as Ne, b as Pe, c as Fe, h as Ie, j as Le, k as Re, l as ze, m as Be, u as Ve, v as He, w as Ue, y as We } from "./store-CF9s1Pb2.js";
|
|
7
7
|
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-B5081ohW.js";
|
|
8
8
|
import { n as rt, r as it, t as at } from "./BindDot-Don6fG00.js";
|
|
9
|
-
import { n as ot, r as st } from "./effects-
|
|
10
|
-
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-
|
|
11
|
-
import { n as pt, r as mt, t as ht } from "./Timeline-
|
|
12
|
-
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, _t as Wt, a as Gt, at as Kt, b as qt, c as Jt, ct as Yt, d as Xt, dt as Zt, et as Qt, f as $t, ft as en, g as tn, gt as nn, h as rn, ht as an, i as on, it as sn, j as cn, k as ln, l as un, lt as dn, m as fn, mt as pn, n as mn, nt as hn, o as gn, ot as _n, p as vn, pt as yn, q as bn, r as xn, rt as Sn, s as Cn, st as wn, t as Tn, tt as En, u as Dn, ut as On, v as kn, vt as An, w as jn, x as Mn, y as Nn, z as Pn } from "./core-
|
|
13
|
-
import { Button as K, Divider as Fn, Dropdown as In, LabeledControlSection as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import {
|
|
17
|
-
import { AppFloatNav as
|
|
18
|
-
import { useDragResize as
|
|
19
|
-
import { createPortal as
|
|
9
|
+
import { n as ot, r as st } from "./effects-Dn4_OzYx.js";
|
|
10
|
+
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-Cuwxm2ic.js";
|
|
11
|
+
import { n as pt, r as mt, t as ht } from "./Timeline-Cz-W72D0.js";
|
|
12
|
+
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, _t as Wt, a as Gt, at as Kt, b as qt, c as Jt, ct as Yt, d as Xt, dt as Zt, et as Qt, f as $t, ft as en, g as tn, gt as nn, h as rn, ht as an, i as on, it as sn, j as cn, k as ln, l as un, lt as dn, m as fn, mt as pn, n as mn, nt as hn, o as gn, ot as _n, p as vn, pt as yn, q as bn, r as xn, rt as Sn, s as Cn, st as wn, t as Tn, tt as En, u as Dn, ut as On, v as kn, vt as An, w as jn, x as Mn, y as Nn, z as Pn } from "./core-DCTuJ1dz.js";
|
|
13
|
+
import { Button as K, ButtonGroup as q, Divider as Fn, Dropdown as In, LabeledControlSection as J, MultiSelect as Ln, SettingsRow as Rn, StepList as zn, Tag as Bn, ToggleSwitch as Vn, Tooltip as Hn, useGrabEdge as Un, useMediaQuery as Wn, useModal as Gn } from "@kolkrabbi/kol-component";
|
|
14
|
+
import { createContext as Kn, useContext as qn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Jn } from "react";
|
|
15
|
+
import { Fragment as Yn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
16
|
+
import { IconLoader as Xn } from "@kolkrabbi/kol-icons";
|
|
17
|
+
import { AppFloatNav as Zn, DocumentCapsule as Qn, FloatLayout as $n, GlobalActions as er, PropertyRail as tr } from "@kolkrabbi/kol-shell";
|
|
18
|
+
import { useDragResize as nr, useTheme as rr } from "@kolkrabbi/kol-framework";
|
|
19
|
+
import { createPortal as ir } from "react-dom";
|
|
20
20
|
//#region src/phoneFloats.js
|
|
21
|
-
var
|
|
21
|
+
var ar = (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: () => Jn(r, () => t, () => t)
|
|
28
28
|
};
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
var
|
|
29
|
+
}, or = ar(null), sr = ar(null), cr = or.set;
|
|
30
|
+
or.use, sr.set;
|
|
31
|
+
var lr = sr.use, ur = [
|
|
32
32
|
{
|
|
33
33
|
id: "shape",
|
|
34
34
|
label: "Shape",
|
|
@@ -44,7 +44,7 @@ var fr = ur.use, pr = [
|
|
|
44
44
|
label: "Crossfade",
|
|
45
45
|
icon: "dashed-circle"
|
|
46
46
|
}
|
|
47
|
-
],
|
|
47
|
+
], dr = {
|
|
48
48
|
shape: [
|
|
49
49
|
["Loops", ["morph-circle", "star-morph"]],
|
|
50
50
|
["Loops", [
|
|
@@ -118,21 +118,21 @@ var fr = ur.use, pr = [
|
|
|
118
118
|
2
|
|
119
119
|
]
|
|
120
120
|
]
|
|
121
|
-
},
|
|
122
|
-
function
|
|
123
|
-
if (!
|
|
124
|
-
|
|
121
|
+
}, fr = null;
|
|
122
|
+
function pr(e) {
|
|
123
|
+
if (!fr) {
|
|
124
|
+
fr = /* @__PURE__ */ new Map();
|
|
125
125
|
let e = /* @__PURE__ */ new Set();
|
|
126
|
-
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id),
|
|
126
|
+
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id), fr.has(n.loop) || fr.set(n.loop, []), fr.get(n.loop).push(n));
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return fr.get(e) ?? [];
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
130
|
+
var mr = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), hr = null;
|
|
131
|
+
function gr() {
|
|
132
|
+
if (hr) return hr;
|
|
133
133
|
let e = [];
|
|
134
|
-
for (let t of
|
|
135
|
-
let [r] = n, i = t.id === "blend" ?
|
|
134
|
+
for (let t of ur) for (let n of dr[t.id]) {
|
|
135
|
+
let [r] = n, i = t.id === "blend" ? mr(pr(n[1]), n[2]) : n[1].map((e) => pr(e)[0]);
|
|
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({
|
|
@@ -155,13 +155,13 @@ function yr() {
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return hr = e;
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var _r = () => ur.map((e) => ({
|
|
161
161
|
label: e.label,
|
|
162
|
-
subs: [...new Set(
|
|
163
|
-
})),
|
|
164
|
-
function
|
|
162
|
+
subs: [...new Set(gr().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
163
|
+
})), vr = (e, t) => gr().find((n) => n.type === e && (!t || n.category === t)), yr = (e) => gr().find((t) => t.id === e);
|
|
164
|
+
function br(e) {
|
|
165
165
|
e && (Qe({
|
|
166
166
|
active: !0,
|
|
167
167
|
...e.morph,
|
|
@@ -172,7 +172,7 @@ function Cr(e) {
|
|
|
172
172
|
}
|
|
173
173
|
//#endregion
|
|
174
174
|
//#region src/editor/labs/catalog.js
|
|
175
|
-
var
|
|
175
|
+
var xr = {
|
|
176
176
|
"fx:halftone": "ptrn-dot",
|
|
177
177
|
"fx:scanline": "grid-horizontal",
|
|
178
178
|
"fx:crt": "desktop",
|
|
@@ -196,19 +196,19 @@ var wr = {
|
|
|
196
196
|
"misc:Para Type": "aa",
|
|
197
197
|
"vec:Distressor": "scribble",
|
|
198
198
|
"vec:Modulator": "dashed-circle"
|
|
199
|
-
},
|
|
199
|
+
}, Sr = {
|
|
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
|
+
}, Cr = [
|
|
207
207
|
"Moiré",
|
|
208
208
|
"Mesh Gradient",
|
|
209
209
|
"Reaction",
|
|
210
210
|
"Halftone"
|
|
211
|
-
],
|
|
211
|
+
], wr = [
|
|
212
212
|
{
|
|
213
213
|
label: "Spaced",
|
|
214
214
|
patch: {
|
|
@@ -240,11 +240,11 @@ var wr = {
|
|
|
240
240
|
label: "Spiral",
|
|
241
241
|
patch: { geometry: "spiral" }
|
|
242
242
|
}
|
|
243
|
-
],
|
|
243
|
+
], Tr = (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 Er({ 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(),
|
|
@@ -301,19 +301,19 @@ function kr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
301
301
|
...oe(L).map((t) => ({
|
|
302
302
|
id: `fx:${t.id}`,
|
|
303
303
|
label: t.label,
|
|
304
|
-
icon:
|
|
304
|
+
icon: xr[`fx:${t.id}`] ?? "square",
|
|
305
305
|
pages: t.rack ? se.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" ? Cr.map((t) => ({
|
|
310
310
|
label: t,
|
|
311
311
|
onSelect: () => c(ne("optic", t)[0], "optic"),
|
|
312
312
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
313
|
-
})) : t.id === "scanline" ?
|
|
313
|
+
})) : t.id === "scanline" ? wr.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" && Tr((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),
|
|
@@ -327,22 +327,22 @@ function kr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
327
327
|
...we.map((e) => ({
|
|
328
328
|
id: `gen:${e.label}`,
|
|
329
329
|
label: e.label,
|
|
330
|
-
icon:
|
|
330
|
+
icon: xr[`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
|
+
...ur.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(gr().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
342
342
|
label: t,
|
|
343
|
-
onSelect: () =>
|
|
343
|
+
onSelect: () => br(vr(e.id, t)),
|
|
344
344
|
active: (() => {
|
|
345
|
-
let n =
|
|
345
|
+
let n = gr().find((e) => e.id === Ze().presetId);
|
|
346
346
|
return n?.type === e.id && n.category === t;
|
|
347
347
|
})()
|
|
348
348
|
}))
|
|
@@ -354,13 +354,13 @@ function kr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
354
354
|
{
|
|
355
355
|
id: "vec:Distressor",
|
|
356
356
|
label: "Distressor",
|
|
357
|
-
icon:
|
|
357
|
+
icon: xr["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: xr["vec:Modulator"] ?? "square",
|
|
364
364
|
pages: p("modulator")
|
|
365
365
|
},
|
|
366
366
|
{
|
|
@@ -370,7 +370,7 @@ function kr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
370
370
|
...ct.map((t) => ({
|
|
371
371
|
id: `kin:${t.label}`,
|
|
372
372
|
label: t.label,
|
|
373
|
-
icon:
|
|
373
|
+
icon: xr[`kin:${t.label}`] ?? "square",
|
|
374
374
|
pages: t.subs.map((t) => ({
|
|
375
375
|
label: t,
|
|
376
376
|
onSelect: () => l(lt.find((e) => e.sub === t)),
|
|
@@ -380,14 +380,14 @@ function kr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
380
380
|
...fe.map((e) => ({
|
|
381
381
|
id: `misc:${e.label}`,
|
|
382
382
|
label: e.label,
|
|
383
|
-
icon:
|
|
383
|
+
icon: xr[`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
|
|
390
|
+
function Dr() {
|
|
391
391
|
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
392
392
|
Y(() => {
|
|
393
393
|
n?.type === "photo" && n.src && (i.current = {
|
|
@@ -401,7 +401,7 @@ function Ar() {
|
|
|
401
401
|
n?.srcType,
|
|
402
402
|
n?.fit
|
|
403
403
|
]);
|
|
404
|
-
let a =
|
|
404
|
+
let a = Er({
|
|
405
405
|
layer: n,
|
|
406
406
|
setOnly: r,
|
|
407
407
|
addFilter: e,
|
|
@@ -418,7 +418,7 @@ function Ar() {
|
|
|
418
418
|
if (n.id.startsWith("sec:")) {
|
|
419
419
|
let e = n.id.slice(4);
|
|
420
420
|
t.push({
|
|
421
|
-
icon:
|
|
421
|
+
icon: Sr[e] ?? "square",
|
|
422
422
|
path: `${Jt}${n.id}`,
|
|
423
423
|
label: n.label,
|
|
424
424
|
sub: []
|
|
@@ -444,7 +444,7 @@ function Ar() {
|
|
|
444
444
|
}
|
|
445
445
|
//#endregion
|
|
446
446
|
//#region src/editor/morph/MorphTab.jsx
|
|
447
|
-
var
|
|
447
|
+
var Or = (e, t) => JSON.stringify(e) === JSON.stringify(t), kr = [
|
|
448
448
|
{
|
|
449
449
|
key: "curve",
|
|
450
450
|
label: "Curve",
|
|
@@ -477,8 +477,8 @@ var jr = (e, t) => JSON.stringify(e) === JSON.stringify(t), Mr = [
|
|
|
477
477
|
when: (e) => e.mode === "shape"
|
|
478
478
|
}
|
|
479
479
|
];
|
|
480
|
-
function
|
|
481
|
-
let r = s(), i = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = i, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = W(), { buildSavedSpec: C } = Et(), { addItem: w, updateItem: T } = He(), E =
|
|
480
|
+
function Ar({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
481
|
+
let r = s(), i = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = i, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = W(), { buildSavedSpec: C } = Et(), { addItem: w, updateItem: T } = He(), E = Gn(), D = f(), ee = te(e?.id ?? null, { history: "coalesce" }), [k, j] = Z("generate"), M = c[0], ne = c.every((e) => e.loopId === M?.loopId), N = c.filter((e) => !Bt(U(e.loopId)) || !Vt(U(e.loopId))), P = N.length === 0, F = {
|
|
482
482
|
blend: ne ? null : "Blend tweens one generator — these steps are different generators",
|
|
483
483
|
shape: P ? null : `No outline to morph: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`,
|
|
484
484
|
crossfade: P ? null : `Cannot fade: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`
|
|
@@ -599,7 +599,7 @@ function Nr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
599
599
|
]), Y(() => {
|
|
600
600
|
if (t || m == null || !e) return;
|
|
601
601
|
let n = et(e, U(e.loopId)?.params ?? []);
|
|
602
|
-
|
|
602
|
+
Or(n, c[m]?.params) || Xe(m, n);
|
|
603
603
|
}, [e]), Y(() => {
|
|
604
604
|
t || !D || m == null || (G({ editing: null }), ae.current = null);
|
|
605
605
|
}, [
|
|
@@ -626,7 +626,8 @@ function Nr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
626
626
|
}, [g]), /* @__PURE__ */ $("div", {
|
|
627
627
|
className: "flex flex-col gap-5",
|
|
628
628
|
children: [
|
|
629
|
-
/* @__PURE__ */ Q(
|
|
629
|
+
/* @__PURE__ */ Q(q, {
|
|
630
|
+
layout: "joined",
|
|
630
631
|
tone: "sunken",
|
|
631
632
|
value: d,
|
|
632
633
|
onChange: (e) => !t && G({ mode: e }),
|
|
@@ -634,20 +635,20 @@ function Nr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
634
635
|
size: r,
|
|
635
636
|
className: a(r)
|
|
636
637
|
}),
|
|
637
|
-
!t && /* @__PURE__ */ Q(
|
|
638
|
+
!t && /* @__PURE__ */ Q(J, {
|
|
638
639
|
divided: !0,
|
|
639
640
|
children: /* @__PURE__ */ Q(ue, {
|
|
640
|
-
tree:
|
|
641
|
-
presets:
|
|
642
|
-
current:
|
|
641
|
+
tree: _r(),
|
|
642
|
+
presets: gr(),
|
|
643
|
+
current: yr(i.presetId) ?? { typeLabel: ur.find((e) => e.id === d)?.label },
|
|
643
644
|
subLabel: (e) => e.split(" · ").pop(),
|
|
644
|
-
onPick:
|
|
645
|
+
onPick: br
|
|
645
646
|
})
|
|
646
647
|
}),
|
|
647
|
-
/* @__PURE__ */ $(
|
|
648
|
+
/* @__PURE__ */ $(J, {
|
|
648
649
|
divided: !0,
|
|
649
650
|
children: [
|
|
650
|
-
/* @__PURE__ */ Q(
|
|
651
|
+
/* @__PURE__ */ Q(zn, {
|
|
651
652
|
items: c.map((e, t) => ({
|
|
652
653
|
id: t,
|
|
653
654
|
label: Ke(e, t)
|
|
@@ -675,11 +676,12 @@ function Nr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
675
676
|
})
|
|
676
677
|
]
|
|
677
678
|
}),
|
|
678
|
-
m != null && !t && e && n && /* @__PURE__ */ $(
|
|
679
|
+
m != null && !t && e && n && /* @__PURE__ */ $(J, {
|
|
679
680
|
label: `Step ${m + 1}`,
|
|
680
681
|
divided: !0,
|
|
681
682
|
children: [
|
|
682
|
-
/* @__PURE__ */ Q(
|
|
683
|
+
/* @__PURE__ */ Q(q, {
|
|
684
|
+
layout: "joined",
|
|
683
685
|
tone: "sunken",
|
|
684
686
|
value: k,
|
|
685
687
|
onChange: j,
|
|
@@ -709,14 +711,14 @@ function Nr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
709
711
|
]
|
|
710
712
|
}),
|
|
711
713
|
/* @__PURE__ */ Q(A, {
|
|
712
|
-
schema:
|
|
714
|
+
schema: kr,
|
|
713
715
|
layer: i,
|
|
714
716
|
setProp: (e, n) => {
|
|
715
717
|
!t && (typeof n != "object" || !n) && G({ [e]: n });
|
|
716
718
|
},
|
|
717
719
|
inline: !0
|
|
718
720
|
}),
|
|
719
|
-
!t && c.length >= 2 && /* @__PURE__ */ Q(
|
|
721
|
+
!t && c.length >= 2 && /* @__PURE__ */ Q(J, {
|
|
720
722
|
divided: !0,
|
|
721
723
|
children: /* @__PURE__ */ Q(K, {
|
|
722
724
|
tone: "primary",
|
|
@@ -759,7 +761,7 @@ function Nr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
759
761
|
}
|
|
760
762
|
//#endregion
|
|
761
763
|
//#region src/editor/params/QuickMotion.jsx
|
|
762
|
-
var
|
|
764
|
+
var jr = [
|
|
763
765
|
{
|
|
764
766
|
value: "breathe",
|
|
765
767
|
label: "Breathe",
|
|
@@ -778,14 +780,14 @@ var Pr = [
|
|
|
778
780
|
source: "lfo-square",
|
|
779
781
|
rate: 8
|
|
780
782
|
}
|
|
781
|
-
],
|
|
782
|
-
function
|
|
783
|
+
], Mr = .2;
|
|
784
|
+
function Nr(e) {
|
|
783
785
|
if (!r(e)) return "off";
|
|
784
786
|
if (e.bind !== "mod") return "custom";
|
|
785
|
-
let t =
|
|
787
|
+
let t = jr.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
786
788
|
return t ? t.value : "custom";
|
|
787
789
|
}
|
|
788
|
-
function
|
|
790
|
+
function Pr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
789
791
|
let a = s(), o = _(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && v(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
790
792
|
if (!o.length) return null;
|
|
791
793
|
let c = (e, r) => {
|
|
@@ -795,9 +797,9 @@ function Lr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
795
797
|
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : b(i, O.getCtx(), t) ?? e.default ?? e.min);
|
|
796
798
|
return;
|
|
797
799
|
}
|
|
798
|
-
let a =
|
|
800
|
+
let a = jr.find((e) => e.value === r);
|
|
799
801
|
if (!a) return;
|
|
800
|
-
let o = Number(b(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) *
|
|
802
|
+
let o = Number(b(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) * Mr, c = Math.max(e.min, o - s), l = Math.min(e.max, o + s);
|
|
801
803
|
n(e.key, {
|
|
802
804
|
bind: "mod",
|
|
803
805
|
source: a.source,
|
|
@@ -807,16 +809,16 @@ function Lr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
807
809
|
}
|
|
808
810
|
});
|
|
809
811
|
};
|
|
810
|
-
return /* @__PURE__ */ Q(
|
|
812
|
+
return /* @__PURE__ */ Q(J, {
|
|
811
813
|
label: r,
|
|
812
814
|
divided: !0,
|
|
813
815
|
children: o.map((e) => {
|
|
814
|
-
let n =
|
|
816
|
+
let n = Nr(t[e.key]), r = [
|
|
815
817
|
{
|
|
816
818
|
value: "off",
|
|
817
819
|
label: "Off"
|
|
818
820
|
},
|
|
819
|
-
...
|
|
821
|
+
...jr.map(({ value: e, label: t }) => ({
|
|
820
822
|
value: e,
|
|
821
823
|
label: t
|
|
822
824
|
})),
|
|
@@ -825,7 +827,7 @@ function Lr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
825
827
|
label: "Custom"
|
|
826
828
|
}] : []
|
|
827
829
|
];
|
|
828
|
-
return /* @__PURE__ */ Q(
|
|
830
|
+
return /* @__PURE__ */ Q(Rn, {
|
|
829
831
|
label: e.label,
|
|
830
832
|
align: "fill",
|
|
831
833
|
labelWidth: i,
|
|
@@ -843,7 +845,7 @@ function Lr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
843
845
|
}
|
|
844
846
|
//#endregion
|
|
845
847
|
//#region src/editor/params/InputRows.jsx
|
|
846
|
-
var
|
|
848
|
+
var Fr = [
|
|
847
849
|
{
|
|
848
850
|
value: "off",
|
|
849
851
|
label: "Off"
|
|
@@ -868,13 +870,13 @@ var Rr = [
|
|
|
868
870
|
value: "lfo-sine",
|
|
869
871
|
label: "LFO"
|
|
870
872
|
}
|
|
871
|
-
],
|
|
872
|
-
function
|
|
873
|
+
], Ir = new Set(Fr.map((e) => e.value));
|
|
874
|
+
function Lr({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
873
875
|
let a = s(), o = _(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
874
876
|
if (!o.length) return null;
|
|
875
877
|
let c = new Map(o.map((e) => [e.key, e])), l = (i ?? []).filter((e) => c.has(e)), u = [...l, ...o.map((e) => e.key).filter((e) => !l.includes(e))], d = l.length ? l : u.slice(0, 3), f = (e) => {
|
|
876
878
|
let n = t[e];
|
|
877
|
-
return r(n) && n.bind === "mod" &&
|
|
879
|
+
return r(n) && n.bind === "mod" && Ir.has(n.source);
|
|
878
880
|
}, p = u.filter(f), m = (e) => {
|
|
879
881
|
let n = c.get(e);
|
|
880
882
|
return Number(b(t[e], O.getCtx(), t) ?? n.default ?? n.min);
|
|
@@ -890,7 +892,7 @@ function Br({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
890
892
|
}
|
|
891
893
|
});
|
|
892
894
|
}, g = (e) => n(e, r(t[e]) ? t[e].transform?.base ?? m(e) : m(e)), v = d.find((e) => !f(e)) ?? u.find((e) => !f(e));
|
|
893
|
-
return /* @__PURE__ */ $(
|
|
895
|
+
return /* @__PURE__ */ $(J, {
|
|
894
896
|
label: "Inputs",
|
|
895
897
|
divided: !0,
|
|
896
898
|
children: [p.map((e) => /* @__PURE__ */ Q(Ln, {
|
|
@@ -899,7 +901,7 @@ function Br({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
899
901
|
groups: [{
|
|
900
902
|
id: "source",
|
|
901
903
|
label: "Source",
|
|
902
|
-
options:
|
|
904
|
+
options: Fr
|
|
903
905
|
}, {
|
|
904
906
|
id: "drives",
|
|
905
907
|
label: "Drives",
|
|
@@ -912,7 +914,7 @@ function Br({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
912
914
|
source: t[e].source,
|
|
913
915
|
drives: e
|
|
914
916
|
},
|
|
915
|
-
label: `${
|
|
917
|
+
label: `${Fr.find((n) => n.value === t[e].source)?.label} → ${c.get(e).label}`,
|
|
916
918
|
onChange: (n, r) => {
|
|
917
919
|
if (n === "source") {
|
|
918
920
|
r === "off" ? g(e) : h(e, r);
|
|
@@ -933,18 +935,18 @@ function Br({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
|
933
935
|
}
|
|
934
936
|
//#endregion
|
|
935
937
|
//#region src/editor/labs/ModelSource.jsx
|
|
936
|
-
var
|
|
937
|
-
function
|
|
938
|
+
var Rr = /\.(obj|glb|gltf|stl)$/i, zr = (e) => Rr.test(e.key ?? e.name ?? ""), Br = (e) => (e.match(Rr)?.[1] ?? "obj").toLowerCase(), Vr = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
939
|
+
function Hr({ layer: e, setProp: t }) {
|
|
938
940
|
let n = s(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
939
941
|
t("meshSrc", e), t("meshType", n);
|
|
940
942
|
};
|
|
941
|
-
return /* @__PURE__ */ $(
|
|
943
|
+
return /* @__PURE__ */ $(J, {
|
|
942
944
|
label: "Model",
|
|
943
945
|
divided: !0,
|
|
944
946
|
children: [
|
|
945
947
|
/* @__PURE__ */ Q("span", {
|
|
946
948
|
className: "kol-mono-12 text-meta truncate",
|
|
947
|
-
children:
|
|
949
|
+
children: Vr(e.meshSrc)
|
|
948
950
|
}),
|
|
949
951
|
/* @__PURE__ */ $("div", {
|
|
950
952
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -969,15 +971,15 @@ function Gr({ layer: e, setProp: t }) {
|
|
|
969
971
|
let t = e.target.files?.[0];
|
|
970
972
|
if (e.target.value = "", !t) return;
|
|
971
973
|
let n = new FileReader();
|
|
972
|
-
n.onload = () => o(n.result,
|
|
974
|
+
n.onload = () => o(n.result, Br(t.name)), n.readAsDataURL(t);
|
|
973
975
|
}
|
|
974
976
|
}),
|
|
975
977
|
/* @__PURE__ */ Q(Ft, {
|
|
976
978
|
open: r,
|
|
977
|
-
accept:
|
|
979
|
+
accept: zr,
|
|
978
980
|
onClose: () => i(!1),
|
|
979
981
|
onSelect: (e) => {
|
|
980
|
-
i(!1), o(jn(e),
|
|
982
|
+
i(!1), o(jn(e), Br(e));
|
|
981
983
|
}
|
|
982
984
|
})
|
|
983
985
|
]
|
|
@@ -985,7 +987,7 @@ function Gr({ layer: e, setProp: t }) {
|
|
|
985
987
|
}
|
|
986
988
|
//#endregion
|
|
987
989
|
//#region src/editor/labs/useLabsKeys.js
|
|
988
|
-
function
|
|
990
|
+
function Ur(e, t) {
|
|
989
991
|
Y(() => {
|
|
990
992
|
let n = (n) => {
|
|
991
993
|
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || zt(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
@@ -995,13 +997,13 @@ function Kr(e, t) {
|
|
|
995
997
|
}
|
|
996
998
|
//#endregion
|
|
997
999
|
//#region src/editor/labs/LabsParams.jsx
|
|
998
|
-
var
|
|
1000
|
+
var Wr = [{
|
|
999
1001
|
value: "effect",
|
|
1000
1002
|
label: "Effect"
|
|
1001
1003
|
}, {
|
|
1002
1004
|
value: "anim",
|
|
1003
1005
|
label: "Motion"
|
|
1004
|
-
}],
|
|
1006
|
+
}], Gr = [
|
|
1005
1007
|
{
|
|
1006
1008
|
value: "generate",
|
|
1007
1009
|
label: "Generate"
|
|
@@ -1014,7 +1016,7 @@ var qr = [{
|
|
|
1014
1016
|
value: "anim",
|
|
1015
1017
|
label: "Animation"
|
|
1016
1018
|
}
|
|
1017
|
-
],
|
|
1019
|
+
], Kr = [
|
|
1018
1020
|
{
|
|
1019
1021
|
value: "generate",
|
|
1020
1022
|
label: "Gen"
|
|
@@ -1028,18 +1030,19 @@ var qr = [{
|
|
|
1028
1030
|
label: "Anim"
|
|
1029
1031
|
}
|
|
1030
1032
|
];
|
|
1031
|
-
function
|
|
1033
|
+
function qr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
|
|
1032
1034
|
let o = s();
|
|
1033
1035
|
return e?.length ? i ? /* @__PURE__ */ Q("div", {
|
|
1034
1036
|
className: "flex items-center gap-1 flex-wrap",
|
|
1035
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1037
|
+
children: e.map((e) => /* @__PURE__ */ Q(Bn, {
|
|
1036
1038
|
size: "xs",
|
|
1037
1039
|
hash: !1,
|
|
1038
1040
|
active: e.value === t,
|
|
1039
1041
|
onClick: () => n(e.value),
|
|
1040
1042
|
children: e.label
|
|
1041
1043
|
}, e.value))
|
|
1042
|
-
}) : /* @__PURE__ */ Q(
|
|
1044
|
+
}) : /* @__PURE__ */ Q(q, {
|
|
1045
|
+
layout: "joined",
|
|
1043
1046
|
tone: "sunken",
|
|
1044
1047
|
value: t ?? null,
|
|
1045
1048
|
onChange: n,
|
|
@@ -1049,13 +1052,13 @@ function Xr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
|
|
|
1049
1052
|
className: a(o)
|
|
1050
1053
|
}) : null;
|
|
1051
1054
|
}
|
|
1052
|
-
function
|
|
1055
|
+
function Jr() {
|
|
1053
1056
|
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = s(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1054
1057
|
"aria-hidden": "true",
|
|
1055
1058
|
className: "invisible pointer-events-none",
|
|
1056
1059
|
children: t
|
|
1057
1060
|
});
|
|
1058
|
-
return /* @__PURE__ */ $(
|
|
1061
|
+
return /* @__PURE__ */ $(Yn, { children: [a(n, /* @__PURE__ */ Q(Hn, {
|
|
1059
1062
|
label: "Undo",
|
|
1060
1063
|
shortcut: "⌘Z",
|
|
1061
1064
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1065,7 +1068,7 @@ function Zr() {
|
|
|
1065
1068
|
tabIndex: n ? void 0 : -1,
|
|
1066
1069
|
onClick: e
|
|
1067
1070
|
})
|
|
1068
|
-
})), a(r, /* @__PURE__ */ Q(
|
|
1071
|
+
})), a(r, /* @__PURE__ */ Q(Hn, {
|
|
1069
1072
|
label: "Redo",
|
|
1070
1073
|
shortcut: "⇧⌘Z",
|
|
1071
1074
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1077,7 +1080,7 @@ function Zr() {
|
|
|
1077
1080
|
})
|
|
1078
1081
|
}))] });
|
|
1079
1082
|
}
|
|
1080
|
-
function
|
|
1083
|
+
function Yr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tabStrip: c, preStrip: l, fx: u = !1, scope: d, ghostLabels: f, children: p }) {
|
|
1081
1084
|
let m = s() === "sm";
|
|
1082
1085
|
return /* @__PURE__ */ $("div", {
|
|
1083
1086
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
@@ -1088,9 +1091,9 @@ function Qr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tab
|
|
|
1088
1091
|
children: [/* @__PURE__ */ Q("p", {
|
|
1089
1092
|
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
1090
1093
|
children: o
|
|
1091
|
-
}), /* @__PURE__ */ Q(
|
|
1094
|
+
}), /* @__PURE__ */ Q(Jr, {})]
|
|
1092
1095
|
}),
|
|
1093
|
-
e && /* @__PURE__ */ Q(
|
|
1096
|
+
e && /* @__PURE__ */ Q(qr, {
|
|
1094
1097
|
options: e,
|
|
1095
1098
|
active: t,
|
|
1096
1099
|
onPick: n,
|
|
@@ -1112,7 +1115,7 @@ function Qr({ chips: e, active: t, onPick: n, spread: r, pills: a, title: o, tab
|
|
|
1112
1115
|
]
|
|
1113
1116
|
});
|
|
1114
1117
|
}
|
|
1115
|
-
function
|
|
1118
|
+
function Xr({ layer: t, showMod: n }) {
|
|
1116
1119
|
let r = l(), c = s(), [u, d] = Z("effect");
|
|
1117
1120
|
Y(() => {
|
|
1118
1121
|
let e = () => d("effect");
|
|
@@ -1154,7 +1157,7 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1154
1157
|
} : t);
|
|
1155
1158
|
b(t.id, { filters: n });
|
|
1156
1159
|
};
|
|
1157
|
-
|
|
1160
|
+
Ur(() => {
|
|
1158
1161
|
O && b(t.id, { filters: P.map((e, t) => t === 0 ? {
|
|
1159
1162
|
...e,
|
|
1160
1163
|
params: {}
|
|
@@ -1180,31 +1183,32 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1180
1183
|
value: e.id,
|
|
1181
1184
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1182
1185
|
}))];
|
|
1183
|
-
return /* @__PURE__ */ $(
|
|
1186
|
+
return /* @__PURE__ */ $(Yr, {
|
|
1184
1187
|
title: "Effects",
|
|
1185
1188
|
fx: !0,
|
|
1186
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1189
|
+
tabStrip: /* @__PURE__ */ Q(q, {
|
|
1190
|
+
layout: "joined",
|
|
1187
1191
|
tone: "sunken",
|
|
1188
1192
|
value: u,
|
|
1189
1193
|
onChange: d,
|
|
1190
|
-
options:
|
|
1194
|
+
options: Wr,
|
|
1191
1195
|
size: c,
|
|
1192
1196
|
className: a(c)
|
|
1193
1197
|
}),
|
|
1194
|
-
children: [u === "effect" && /* @__PURE__ */ $(
|
|
1195
|
-
/* @__PURE__ */ $(
|
|
1198
|
+
children: [u === "effect" && /* @__PURE__ */ $(Yn, { children: [
|
|
1199
|
+
/* @__PURE__ */ $(J, {
|
|
1196
1200
|
label: "Effect stack",
|
|
1197
1201
|
divided: !0,
|
|
1198
1202
|
children: [C.length === 0 && /* @__PURE__ */ Q(j, {
|
|
1199
1203
|
className: "kol-mono-10 text-meta",
|
|
1200
1204
|
children: "No effects yet — add one below."
|
|
1201
|
-
}), /* @__PURE__ */ Q(
|
|
1205
|
+
}), /* @__PURE__ */ Q(ei, {
|
|
1202
1206
|
...e,
|
|
1203
1207
|
from: 0
|
|
1204
1208
|
})]
|
|
1205
1209
|
}),
|
|
1206
1210
|
/* @__PURE__ */ Q(Fn, {}),
|
|
1207
|
-
C.length < 8 && /* @__PURE__ */ Q(
|
|
1211
|
+
C.length < 8 && /* @__PURE__ */ Q(J, {
|
|
1208
1212
|
label: V.label,
|
|
1209
1213
|
divided: !0,
|
|
1210
1214
|
children: /* @__PURE__ */ Q(In, {
|
|
@@ -1225,17 +1229,18 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1225
1229
|
})]
|
|
1226
1230
|
});
|
|
1227
1231
|
}
|
|
1228
|
-
if (!O) return /* @__PURE__ */ Q(
|
|
1232
|
+
if (!O) return /* @__PURE__ */ Q(Yr, {
|
|
1229
1233
|
chips: M,
|
|
1230
1234
|
active: null,
|
|
1231
1235
|
onPick: N,
|
|
1232
1236
|
spread: k,
|
|
1233
1237
|
fx: !0,
|
|
1234
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1238
|
+
tabStrip: /* @__PURE__ */ Q(q, {
|
|
1239
|
+
layout: "joined",
|
|
1235
1240
|
tone: "sunken",
|
|
1236
1241
|
value: u,
|
|
1237
1242
|
onChange: d,
|
|
1238
|
-
options:
|
|
1243
|
+
options: Wr,
|
|
1239
1244
|
size: c,
|
|
1240
1245
|
className: a(c)
|
|
1241
1246
|
}),
|
|
@@ -1269,7 +1274,7 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1269
1274
|
renderAnimate: ie,
|
|
1270
1275
|
inline: !0
|
|
1271
1276
|
};
|
|
1272
|
-
return /* @__PURE__ */ $(
|
|
1277
|
+
return /* @__PURE__ */ $(Yr, {
|
|
1273
1278
|
chips: M,
|
|
1274
1279
|
active: O.id,
|
|
1275
1280
|
onPick: N,
|
|
@@ -1278,20 +1283,21 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1278
1283
|
fx: !0,
|
|
1279
1284
|
scope: O.id,
|
|
1280
1285
|
ghostLabels: O.def.params.map((e) => e.label).filter(Boolean),
|
|
1281
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1286
|
+
tabStrip: /* @__PURE__ */ Q(q, {
|
|
1287
|
+
layout: "joined",
|
|
1282
1288
|
tone: "sunken",
|
|
1283
1289
|
value: u,
|
|
1284
1290
|
onChange: d,
|
|
1285
|
-
options:
|
|
1291
|
+
options: Wr,
|
|
1286
1292
|
size: c,
|
|
1287
1293
|
className: a(c)
|
|
1288
1294
|
}),
|
|
1289
|
-
children: [u === "effect" && /* @__PURE__ */ $(
|
|
1295
|
+
children: [u === "effect" && /* @__PURE__ */ $(Yn, { children: [
|
|
1290
1296
|
W.length > 0 && /* @__PURE__ */ Q(A, {
|
|
1291
1297
|
schema: W,
|
|
1292
1298
|
...pe
|
|
1293
1299
|
}),
|
|
1294
|
-
/* @__PURE__ */ $(
|
|
1300
|
+
/* @__PURE__ */ $(J, {
|
|
1295
1301
|
divided: !0,
|
|
1296
1302
|
children: [/* @__PURE__ */ Q(A, {
|
|
1297
1303
|
schema: fe,
|
|
@@ -1302,7 +1308,7 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1302
1308
|
view: F,
|
|
1303
1309
|
tab: "effect",
|
|
1304
1310
|
onPatch: z,
|
|
1305
|
-
levels: /* @__PURE__ */ $(
|
|
1311
|
+
levels: /* @__PURE__ */ $(Yn, { children: [
|
|
1306
1312
|
[
|
|
1307
1313
|
["type", "Type"],
|
|
1308
1314
|
["category", "Category"],
|
|
@@ -1342,11 +1348,11 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1342
1348
|
})]
|
|
1343
1349
|
}),
|
|
1344
1350
|
/* @__PURE__ */ Q(Fn, {}),
|
|
1345
|
-
ue < H.length && /* @__PURE__ */ $(
|
|
1351
|
+
ue < H.length && /* @__PURE__ */ $(Yn, { children: [/* @__PURE__ */ Q(A, {
|
|
1346
1352
|
schema: H.slice(ue),
|
|
1347
1353
|
...pe
|
|
1348
1354
|
}), /* @__PURE__ */ Q(Fn, {})] }),
|
|
1349
|
-
/* @__PURE__ */ Q(
|
|
1355
|
+
/* @__PURE__ */ Q(ti, {
|
|
1350
1356
|
chain: C,
|
|
1351
1357
|
from: E + 1,
|
|
1352
1358
|
layer: t,
|
|
@@ -1358,8 +1364,8 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1358
1364
|
palette: x,
|
|
1359
1365
|
showMod: n
|
|
1360
1366
|
})
|
|
1361
|
-
] }), u === "anim" && /* @__PURE__ */ $(
|
|
1362
|
-
/* @__PURE__ */ Q(
|
|
1367
|
+
] }), u === "anim" && /* @__PURE__ */ $(Yn, { children: [
|
|
1368
|
+
/* @__PURE__ */ Q(Lr, {
|
|
1363
1369
|
schema: O.def.params,
|
|
1364
1370
|
layer: F,
|
|
1365
1371
|
setProp: R,
|
|
@@ -1370,14 +1376,15 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1370
1376
|
...pe,
|
|
1371
1377
|
tab: "anim"
|
|
1372
1378
|
}),
|
|
1373
|
-
O.def.orbit && /* @__PURE__ */ Q(
|
|
1379
|
+
O.def.orbit && /* @__PURE__ */ Q(J, {
|
|
1374
1380
|
label: "Interaction",
|
|
1375
1381
|
divided: !0,
|
|
1376
|
-
children: /* @__PURE__ */ Q(
|
|
1382
|
+
children: /* @__PURE__ */ Q(Rn, {
|
|
1377
1383
|
label: "ORBIT (C)",
|
|
1378
1384
|
align: "fill",
|
|
1379
1385
|
labelWidth: i,
|
|
1380
|
-
children: /* @__PURE__ */ Q(
|
|
1386
|
+
children: /* @__PURE__ */ Q(q, {
|
|
1387
|
+
layout: "joined",
|
|
1381
1388
|
tone: "sunken",
|
|
1382
1389
|
size: c,
|
|
1383
1390
|
className: "w-full",
|
|
@@ -1395,7 +1402,7 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1395
1402
|
})
|
|
1396
1403
|
})
|
|
1397
1404
|
}),
|
|
1398
|
-
/* @__PURE__ */ Q(
|
|
1405
|
+
/* @__PURE__ */ Q(J, {
|
|
1399
1406
|
divided: !0,
|
|
1400
1407
|
children: /* @__PURE__ */ Q(ot, {
|
|
1401
1408
|
inline: !0,
|
|
@@ -1410,12 +1417,12 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1410
1417
|
onChange: (e) => R("sweeps", e),
|
|
1411
1418
|
inline: !0
|
|
1412
1419
|
}),
|
|
1413
|
-
/* @__PURE__ */ Q(
|
|
1420
|
+
/* @__PURE__ */ Q(Pr, {
|
|
1414
1421
|
schema: O.def.params,
|
|
1415
1422
|
layer: F,
|
|
1416
1423
|
setProp: R
|
|
1417
1424
|
}),
|
|
1418
|
-
/* @__PURE__ */ Q(
|
|
1425
|
+
/* @__PURE__ */ Q($r, {
|
|
1419
1426
|
chain: C,
|
|
1420
1427
|
layer: t,
|
|
1421
1428
|
hostView: F,
|
|
@@ -1428,13 +1435,13 @@ function $r({ layer: t, showMod: n }) {
|
|
|
1428
1435
|
] })]
|
|
1429
1436
|
});
|
|
1430
1437
|
}
|
|
1431
|
-
var
|
|
1432
|
-
function
|
|
1438
|
+
var Zr = L.filter((e) => !e.kind && !e.first);
|
|
1439
|
+
function Qr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1433
1440
|
let { addFilter: i, removeFilter: a, toggleFilter: s } = o(), c = g(e), l = c.map(({ def: e, ...t }) => t);
|
|
1434
|
-
return /* @__PURE__ */ Q(
|
|
1441
|
+
return /* @__PURE__ */ Q(ti, {
|
|
1435
1442
|
chain: c,
|
|
1436
1443
|
from: 0,
|
|
1437
|
-
filters:
|
|
1444
|
+
filters: Zr,
|
|
1438
1445
|
layer: e,
|
|
1439
1446
|
hostView: e,
|
|
1440
1447
|
addFilter: i,
|
|
@@ -1451,16 +1458,16 @@ function ti({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1451
1458
|
showMod: r
|
|
1452
1459
|
});
|
|
1453
1460
|
}
|
|
1454
|
-
function
|
|
1461
|
+
function $r({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: a, palette: o, showMod: c }) {
|
|
1455
1462
|
let l = s(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1456
1463
|
...n,
|
|
1457
1464
|
...d.params,
|
|
1458
1465
|
id: t.id
|
|
1459
1466
|
} : null, p = d ? a(u) : null;
|
|
1460
|
-
return /* @__PURE__ */ Q(
|
|
1467
|
+
return /* @__PURE__ */ Q(J, {
|
|
1461
1468
|
label: "Media",
|
|
1462
1469
|
divided: !0,
|
|
1463
|
-
children: d?.def ? /* @__PURE__ */ $(
|
|
1470
|
+
children: d?.def ? /* @__PURE__ */ $(Yn, { children: [/* @__PURE__ */ Q(A, {
|
|
1464
1471
|
schema: d.def.params,
|
|
1465
1472
|
layer: f,
|
|
1466
1473
|
setProp: p,
|
|
@@ -1490,7 +1497,7 @@ function ni({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1490
1497
|
})
|
|
1491
1498
|
});
|
|
1492
1499
|
}
|
|
1493
|
-
function
|
|
1500
|
+
function ei({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: c, showMod: l }) {
|
|
1494
1501
|
let u = s();
|
|
1495
1502
|
return e.slice(t).map((e, s) => {
|
|
1496
1503
|
let d = s + t, f = e.enabled !== !1, p = {
|
|
@@ -1502,12 +1509,12 @@ function ri({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1502
1509
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1503
1510
|
children: [/* @__PURE__ */ $("div", {
|
|
1504
1511
|
className: "flex items-center gap-2",
|
|
1505
|
-
children: [/* @__PURE__ */ Q(
|
|
1512
|
+
children: [/* @__PURE__ */ Q(Vn, {
|
|
1506
1513
|
size: u,
|
|
1507
1514
|
checked: f,
|
|
1508
1515
|
onChange: () => i(n.id, d),
|
|
1509
1516
|
label: e.def?.label ?? e.id
|
|
1510
|
-
}), /* @__PURE__ */ Q(
|
|
1517
|
+
}), /* @__PURE__ */ Q(Hn, {
|
|
1511
1518
|
asChild: !0,
|
|
1512
1519
|
label: "Delete effect",
|
|
1513
1520
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1535,7 +1542,7 @@ function ri({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1535
1542
|
}, e.key ?? d);
|
|
1536
1543
|
});
|
|
1537
1544
|
}
|
|
1538
|
-
function
|
|
1545
|
+
function ti({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: a, removeFilter: o, toggleFilter: c, setStagePropAt: l, palette: u, showMod: d }) {
|
|
1539
1546
|
let f = s(), p = [{
|
|
1540
1547
|
value: "",
|
|
1541
1548
|
label: "Add FX…"
|
|
@@ -1543,10 +1550,10 @@ function ii({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1543
1550
|
value: e.id,
|
|
1544
1551
|
label: e.label ?? e.id
|
|
1545
1552
|
}))];
|
|
1546
|
-
return /* @__PURE__ */ $(
|
|
1553
|
+
return /* @__PURE__ */ $(J, {
|
|
1547
1554
|
label: "Post-Processing",
|
|
1548
1555
|
divided: !0,
|
|
1549
|
-
children: [/* @__PURE__ */ Q(
|
|
1556
|
+
children: [/* @__PURE__ */ Q(ei, {
|
|
1550
1557
|
chain: e,
|
|
1551
1558
|
from: t,
|
|
1552
1559
|
layer: r,
|
|
@@ -1568,7 +1575,7 @@ function ii({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1568
1575
|
})]
|
|
1569
1576
|
});
|
|
1570
1577
|
}
|
|
1571
|
-
function
|
|
1578
|
+
function ni({ layer: e, showMod: t, tree: n }) {
|
|
1572
1579
|
let r = s(), [i, c] = Z("generate"), { updateLayer: l, palette: u } = o(), { setOnly: d } = W(), f = te(e.id, { history: "coalesce" }), m = N(e.loopGroup).find((t) => t.id === e.presetId), h = P(e.loopGroup), g = (n ?? we).find((t) => t.groups.includes(e.loopGroup)), _ = g?.labels?.[e.loopGroup] ?? h?.label ?? "", v = g && g.label !== _ ? `${g.label} / ${_}` : _, y = e.loopGroup === "paratype" && m?.sub === "Glyphs" ? ne("paratype", "Glyphs") : null, b = y ? y.map((e) => ({
|
|
1573
1580
|
value: e.id,
|
|
1574
1581
|
label: e.label
|
|
@@ -1578,10 +1585,10 @@ function ai({ layer: e, showMod: t, tree: n }) {
|
|
|
1578
1585
|
}, S = () => {
|
|
1579
1586
|
m && d(e.type, H(m, e.loopGroup));
|
|
1580
1587
|
};
|
|
1581
|
-
return
|
|
1588
|
+
return Ur(S, () => {
|
|
1582
1589
|
let t = U(e.loopId)?.params ?? [];
|
|
1583
1590
|
l(e.id, p(e, w(t, e), D(), { withFilters: !0 }));
|
|
1584
|
-
}), /* @__PURE__ */ $(
|
|
1591
|
+
}), /* @__PURE__ */ $(Yr, {
|
|
1585
1592
|
title: v,
|
|
1586
1593
|
chips: b,
|
|
1587
1594
|
active: e.presetId,
|
|
@@ -1589,16 +1596,17 @@ function ai({ layer: e, showMod: t, tree: n }) {
|
|
|
1589
1596
|
pills: !0,
|
|
1590
1597
|
scope: e.loopId,
|
|
1591
1598
|
ghostLabels: (U(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1592
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1599
|
+
tabStrip: /* @__PURE__ */ Q(q, {
|
|
1600
|
+
layout: "joined",
|
|
1593
1601
|
tone: "sunken",
|
|
1594
1602
|
value: i,
|
|
1595
1603
|
onChange: c,
|
|
1596
|
-
options: r === "sm" ?
|
|
1604
|
+
options: r === "sm" ? Gr : Kr,
|
|
1597
1605
|
size: r,
|
|
1598
1606
|
className: a(r)
|
|
1599
1607
|
}),
|
|
1600
1608
|
children: [
|
|
1601
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1609
|
+
i === "anim" && /* @__PURE__ */ Q(Lr, {
|
|
1602
1610
|
schema: U(e.loopId)?.params ?? [],
|
|
1603
1611
|
layer: e,
|
|
1604
1612
|
setProp: f.setProp,
|
|
@@ -1621,17 +1629,17 @@ function ai({ layer: e, showMod: t, tree: n }) {
|
|
|
1621
1629
|
inline: !0,
|
|
1622
1630
|
onReset: S
|
|
1623
1631
|
}),
|
|
1624
|
-
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(
|
|
1632
|
+
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Hr, {
|
|
1625
1633
|
layer: e,
|
|
1626
1634
|
setProp: f.setProp
|
|
1627
1635
|
}),
|
|
1628
|
-
i === "style" && /* @__PURE__ */ Q(
|
|
1636
|
+
i === "style" && /* @__PURE__ */ Q(Qr, {
|
|
1629
1637
|
layer: e,
|
|
1630
1638
|
edit: f,
|
|
1631
1639
|
palette: u,
|
|
1632
1640
|
showMod: t
|
|
1633
1641
|
}),
|
|
1634
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1642
|
+
i === "anim" && /* @__PURE__ */ Q(Pr, {
|
|
1635
1643
|
schema: U(e.loopId)?.params ?? [],
|
|
1636
1644
|
layer: e,
|
|
1637
1645
|
setProp: f.setProp
|
|
@@ -1639,9 +1647,9 @@ function ai({ layer: e, showMod: t, tree: n }) {
|
|
|
1639
1647
|
]
|
|
1640
1648
|
});
|
|
1641
1649
|
}
|
|
1642
|
-
function
|
|
1650
|
+
function ri({ layer: e, showMod: t }) {
|
|
1643
1651
|
let n = s(), [r, i] = Z("generate"), { updateLayer: c, palette: l } = o(), { setOnly: u } = W(), d = te(e.id, { history: "coalesce" }), f = lt.find((t) => t.id === e.presetId), p = ct.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
|
|
1644
|
-
return
|
|
1652
|
+
return Ur(() => {
|
|
1645
1653
|
f && u("kinetic", {
|
|
1646
1654
|
presetId: f.id,
|
|
1647
1655
|
presetLabel: f.label,
|
|
@@ -1655,13 +1663,14 @@ function oi({ layer: e, showMod: t }) {
|
|
|
1655
1663
|
comp: r,
|
|
1656
1664
|
_rollSeed: t
|
|
1657
1665
|
});
|
|
1658
|
-
}), /* @__PURE__ */ Q(
|
|
1666
|
+
}), /* @__PURE__ */ Q(Yr, {
|
|
1659
1667
|
title: p,
|
|
1660
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1668
|
+
tabStrip: /* @__PURE__ */ Q(q, {
|
|
1669
|
+
layout: "joined",
|
|
1661
1670
|
tone: "sunken",
|
|
1662
1671
|
value: r,
|
|
1663
1672
|
onChange: i,
|
|
1664
|
-
options: n === "sm" ?
|
|
1673
|
+
options: n === "sm" ? Gr : Kr,
|
|
1665
1674
|
size: n,
|
|
1666
1675
|
className: a(n)
|
|
1667
1676
|
}),
|
|
@@ -1680,37 +1689,37 @@ function oi({ layer: e, showMod: t }) {
|
|
|
1680
1689
|
})
|
|
1681
1690
|
});
|
|
1682
1691
|
}
|
|
1683
|
-
function
|
|
1692
|
+
function ii() {
|
|
1684
1693
|
let { layer: e } = W(), t = nt(), n = s(), r = it();
|
|
1685
1694
|
return Y(() => {
|
|
1686
1695
|
let e = (e) => {
|
|
1687
1696
|
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || zt(e) || rt();
|
|
1688
1697
|
};
|
|
1689
1698
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1690
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1699
|
+
}, []), t.active ? /* @__PURE__ */ Q(Yr, {
|
|
1691
1700
|
title: "Morph",
|
|
1692
|
-
children: /* @__PURE__ */ Q(
|
|
1701
|
+
children: /* @__PURE__ */ Q(Ar, {
|
|
1693
1702
|
layer: e,
|
|
1694
|
-
editTabs: n === "sm" ?
|
|
1703
|
+
editTabs: n === "sm" ? Gr : Kr
|
|
1695
1704
|
})
|
|
1696
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1705
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(Xr, {
|
|
1697
1706
|
layer: e,
|
|
1698
1707
|
showMod: r
|
|
1699
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1708
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(ni, {
|
|
1700
1709
|
layer: e,
|
|
1701
1710
|
showMod: r
|
|
1702
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1711
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(ni, {
|
|
1703
1712
|
layer: e,
|
|
1704
1713
|
showMod: r,
|
|
1705
1714
|
tree: fe
|
|
1706
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1715
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(ri, {
|
|
1707
1716
|
layer: e,
|
|
1708
1717
|
showMod: r
|
|
1709
1718
|
}, e.id) : /* @__PURE__ */ Q(j, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(j, { children: "Pick an effect or generator from the nav." });
|
|
1710
1719
|
}
|
|
1711
1720
|
//#endregion
|
|
1712
1721
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1713
|
-
function
|
|
1722
|
+
function ai(e) {
|
|
1714
1723
|
Y(() => {
|
|
1715
1724
|
let t = (t) => {
|
|
1716
1725
|
t.key === "Escape" && e?.();
|
|
@@ -1723,8 +1732,8 @@ function ci(e) {
|
|
|
1723
1732
|
};
|
|
1724
1733
|
}, []);
|
|
1725
1734
|
}
|
|
1726
|
-
function
|
|
1727
|
-
return
|
|
1735
|
+
function oi({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1736
|
+
return ai(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1728
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",
|
|
1729
1738
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1730
1739
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1738,7 +1747,7 @@ function li({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1738
1747
|
/* @__PURE__ */ Q("div", {
|
|
1739
1748
|
className: "flex flex-col gap-2",
|
|
1740
1749
|
children: we.map((t) => {
|
|
1741
|
-
let n =
|
|
1750
|
+
let n = xr[`gen:${t.label}`] ?? "square";
|
|
1742
1751
|
return /* @__PURE__ */ Q(K, {
|
|
1743
1752
|
tone: "primary",
|
|
1744
1753
|
size: "lg",
|
|
@@ -1776,11 +1785,11 @@ function li({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1776
1785
|
}
|
|
1777
1786
|
//#endregion
|
|
1778
1787
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1779
|
-
var
|
|
1780
|
-
function
|
|
1788
|
+
var si = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1789
|
+
function ci(e) {
|
|
1781
1790
|
let { patch: t } = te(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1782
1791
|
return {
|
|
1783
|
-
nodes: /* @__PURE__ */ $(
|
|
1792
|
+
nodes: /* @__PURE__ */ $(Yn, { children: [/* @__PURE__ */ Q("input", {
|
|
1784
1793
|
ref: n,
|
|
1785
1794
|
type: "file",
|
|
1786
1795
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1808,7 +1817,7 @@ function di(e) {
|
|
|
1808
1817
|
}
|
|
1809
1818
|
}), /* @__PURE__ */ Q(Ft, {
|
|
1810
1819
|
open: r,
|
|
1811
|
-
accept: a ?
|
|
1820
|
+
accept: a ? si : ["image", "video"],
|
|
1812
1821
|
onClose: () => i(!1),
|
|
1813
1822
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1814
1823
|
if (a) {
|
|
@@ -1846,8 +1855,8 @@ function di(e) {
|
|
|
1846
1855
|
label: "Camera"
|
|
1847
1856
|
}
|
|
1848
1857
|
].slice(0, 2);
|
|
1849
|
-
function
|
|
1850
|
-
let t =
|
|
1858
|
+
function li({ layer: e }) {
|
|
1859
|
+
let t = ci(e);
|
|
1851
1860
|
return /* @__PURE__ */ $("div", {
|
|
1852
1861
|
className: "flex flex-col gap-2",
|
|
1853
1862
|
children: [
|
|
@@ -1882,8 +1891,8 @@ function fi({ layer: e }) {
|
|
|
1882
1891
|
]
|
|
1883
1892
|
});
|
|
1884
1893
|
}
|
|
1885
|
-
function
|
|
1886
|
-
return
|
|
1894
|
+
function ui({ layer: e, title: t, onBack: n }) {
|
|
1895
|
+
return ai(n), /* @__PURE__ */ Q("div", {
|
|
1887
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",
|
|
1888
1897
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1889
1898
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1900,7 +1909,7 @@ function pi({ layer: e, title: t, onBack: n }) {
|
|
|
1900
1909
|
children: "Pick the media it works on."
|
|
1901
1910
|
})]
|
|
1902
1911
|
}),
|
|
1903
|
-
/* @__PURE__ */ Q(
|
|
1912
|
+
/* @__PURE__ */ Q(li, { layer: e }),
|
|
1904
1913
|
/* @__PURE__ */ Q(K, {
|
|
1905
1914
|
tone: "grey",
|
|
1906
1915
|
size: "lg",
|
|
@@ -1916,13 +1925,13 @@ function pi({ layer: e, title: t, onBack: n }) {
|
|
|
1916
1925
|
}
|
|
1917
1926
|
//#endregion
|
|
1918
1927
|
//#region src/editor/components/PanelHeader.jsx
|
|
1919
|
-
function
|
|
1928
|
+
function di({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1920
1929
|
return /* @__PURE__ */ $("div", {
|
|
1921
1930
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1922
1931
|
children: [/* @__PURE__ */ $("button", {
|
|
1923
1932
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1924
1933
|
onClick: t,
|
|
1925
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1934
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(Xn, {
|
|
1926
1935
|
name: "chevron-down",
|
|
1927
1936
|
size: 16,
|
|
1928
1937
|
className: "text-oq-48"
|
|
@@ -1930,7 +1939,7 @@ function mi({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1930
1939
|
}), n]
|
|
1931
1940
|
});
|
|
1932
1941
|
}
|
|
1933
|
-
function
|
|
1942
|
+
function fi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1934
1943
|
return /* @__PURE__ */ $("div", {
|
|
1935
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",
|
|
1936
1945
|
children: [/* @__PURE__ */ Q(K, {
|
|
@@ -1943,7 +1952,7 @@ function hi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1943
1952
|
children: [/* @__PURE__ */ Q("span", {
|
|
1944
1953
|
className: "truncate",
|
|
1945
1954
|
children: e
|
|
1946
|
-
}), /* @__PURE__ */ Q(
|
|
1955
|
+
}), /* @__PURE__ */ Q(Xn, {
|
|
1947
1956
|
name: "chevron-down",
|
|
1948
1957
|
size: 16,
|
|
1949
1958
|
className: "rotate-180 shrink-0"
|
|
@@ -1952,13 +1961,13 @@ function hi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1952
1961
|
}), i]
|
|
1953
1962
|
});
|
|
1954
1963
|
}
|
|
1955
|
-
var
|
|
1964
|
+
var pi = {
|
|
1956
1965
|
half: "50dvh",
|
|
1957
1966
|
tall: "85dvh"
|
|
1958
|
-
},
|
|
1959
|
-
function
|
|
1967
|
+
}, mi = 4;
|
|
1968
|
+
function hi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1960
1969
|
let a = X(null);
|
|
1961
|
-
|
|
1970
|
+
Un(a, { axis: "x" });
|
|
1962
1971
|
let o = X({
|
|
1963
1972
|
y: null,
|
|
1964
1973
|
h0: 0,
|
|
@@ -1978,7 +1987,7 @@ function vi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1978
1987
|
onPointerMove: (e) => {
|
|
1979
1988
|
if (o.y === null) return;
|
|
1980
1989
|
let t = e.clientY - o.y;
|
|
1981
|
-
Math.abs(t) >
|
|
1990
|
+
Math.abs(t) > mi && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
1982
1991
|
},
|
|
1983
1992
|
onPointerUp: (e) => {
|
|
1984
1993
|
if (o.y === null) return;
|
|
@@ -2000,10 +2009,10 @@ function vi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
2000
2009
|
}
|
|
2001
2010
|
//#endregion
|
|
2002
2011
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
2003
|
-
var
|
|
2004
|
-
function
|
|
2012
|
+
var gi = new Set(["#rail/sec:effects"]);
|
|
2013
|
+
function _i({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2005
2014
|
let { items: a, dispatch: o } = Dn(), [s, c] = Z(n);
|
|
2006
|
-
|
|
2015
|
+
ai(t);
|
|
2007
2016
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
2008
2017
|
return /* @__PURE__ */ Q("div", {
|
|
2009
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",
|
|
@@ -2026,7 +2035,7 @@ function bi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2026
2035
|
iconLeft: t.icon,
|
|
2027
2036
|
iconRight: t.icon,
|
|
2028
2037
|
onClick: () => {
|
|
2029
|
-
if (!l &&
|
|
2038
|
+
if (!l && gi.has(t.path) && !r && i) {
|
|
2030
2039
|
i(t.path);
|
|
2031
2040
|
return;
|
|
2032
2041
|
}
|
|
@@ -2052,7 +2061,7 @@ function bi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2052
2061
|
}
|
|
2053
2062
|
//#endregion
|
|
2054
2063
|
//#region src/editor/labs/sheetLabels.js
|
|
2055
|
-
function
|
|
2064
|
+
function vi(e) {
|
|
2056
2065
|
if (Ze().active) return {
|
|
2057
2066
|
title: "Morph",
|
|
2058
2067
|
pill: "Morph"
|
|
@@ -2080,14 +2089,14 @@ function xi(e) {
|
|
|
2080
2089
|
}
|
|
2081
2090
|
//#endregion
|
|
2082
2091
|
//#region src/editor/labs/LabsView.jsx
|
|
2083
|
-
var
|
|
2092
|
+
var yi = .85, bi = .3, xi = 2.5, Si = {
|
|
2084
2093
|
0: 1,
|
|
2085
2094
|
1: .5,
|
|
2086
2095
|
2: 1,
|
|
2087
2096
|
3: 1.5,
|
|
2088
2097
|
4: 2
|
|
2089
|
-
},
|
|
2090
|
-
function
|
|
2098
|
+
}, Ci = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2099
|
+
function wi() {
|
|
2091
2100
|
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction: i, commitTransaction: a, select: s } = o(), [c, l] = Z(null);
|
|
2092
2101
|
Y(() => {
|
|
2093
2102
|
let e = (e) => {
|
|
@@ -2107,7 +2116,7 @@ function Di() {
|
|
|
2107
2116
|
c,
|
|
2108
2117
|
s
|
|
2109
2118
|
]);
|
|
2110
|
-
let u = c && n.find((e) => e.id === c.id && e.type === "kinetic"), d = e?.type === "photo" && !e.src && e.srcType !== "webcam", [f, p] = Z(1), [m, h] = Z(!1), g = vt(m), _ = X(null), v = (e) => Math.min(
|
|
2119
|
+
let u = c && n.find((e) => e.id === c.id && e.type === "kinetic"), d = e?.type === "photo" && !e.src && e.srcType !== "webcam", [f, p] = Z(1), [m, h] = Z(!1), g = vt(m), _ = X(null), v = (e) => Math.min(xi, Math.max(bi, e)), y = (e) => p((t) => v(t * (e > 0 ? 1.25 : .8))), { tool: b } = Nt(), x = b === "orbit", C = X(x);
|
|
2111
2120
|
C.current = x, Y(() => {
|
|
2112
2121
|
let e = _.current;
|
|
2113
2122
|
if (!e) return;
|
|
@@ -2122,7 +2131,7 @@ function Di() {
|
|
|
2122
2131
|
h((e) => !e);
|
|
2123
2132
|
return;
|
|
2124
2133
|
}
|
|
2125
|
-
if (!(S().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" ||
|
|
2134
|
+
if (!(S().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || Si[e.key] !== void 0))) {
|
|
2126
2135
|
if (e.key === "-" || e.key === "_") {
|
|
2127
2136
|
y(-1);
|
|
2128
2137
|
return;
|
|
@@ -2131,7 +2140,7 @@ function Di() {
|
|
|
2131
2140
|
y(1);
|
|
2132
2141
|
return;
|
|
2133
2142
|
}
|
|
2134
|
-
|
|
2143
|
+
Si[e.key] !== void 0 && p(Si[e.key]);
|
|
2135
2144
|
}
|
|
2136
2145
|
}
|
|
2137
2146
|
};
|
|
@@ -2211,8 +2220,8 @@ function Di() {
|
|
|
2211
2220
|
/* @__PURE__ */ Q("div", {
|
|
2212
2221
|
style: {
|
|
2213
2222
|
flex: "none",
|
|
2214
|
-
width: `${f *
|
|
2215
|
-
height: `${f *
|
|
2223
|
+
width: `${f * yi * 100}%`,
|
|
2224
|
+
height: `${f * yi * 100}%`,
|
|
2216
2225
|
transform: `translate(${w.x}px, ${w.y}px)`
|
|
2217
2226
|
},
|
|
2218
2227
|
children: /* @__PURE__ */ Q(Xt, { overlay: u ? (e) => /* @__PURE__ */ Q(jt, {
|
|
@@ -2225,17 +2234,17 @@ function Di() {
|
|
|
2225
2234
|
onExit: () => l(null)
|
|
2226
2235
|
}) : void 0 })
|
|
2227
2236
|
}),
|
|
2228
|
-
d && /* @__PURE__ */ Q(
|
|
2237
|
+
d && /* @__PURE__ */ Q(ui, {
|
|
2229
2238
|
layer: e,
|
|
2230
|
-
title:
|
|
2239
|
+
title: vi(e).title,
|
|
2231
2240
|
onBack: () => t(e.id)
|
|
2232
2241
|
}),
|
|
2233
2242
|
m && /* @__PURE__ */ Q("div", {
|
|
2234
2243
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2235
|
-
children: /* @__PURE__ */ Q(
|
|
2244
|
+
children: /* @__PURE__ */ Q(Hn, {
|
|
2236
2245
|
label: "Framerate — press F to hide",
|
|
2237
2246
|
children: /* @__PURE__ */ $("span", {
|
|
2238
|
-
className:
|
|
2247
|
+
className: Ci,
|
|
2239
2248
|
children: [g, " fps"]
|
|
2240
2249
|
})
|
|
2241
2250
|
})
|
|
@@ -2243,8 +2252,8 @@ function Di() {
|
|
|
2243
2252
|
]
|
|
2244
2253
|
});
|
|
2245
2254
|
}
|
|
2246
|
-
function
|
|
2247
|
-
let e = X(null), { grabProps: t } =
|
|
2255
|
+
function Ti() {
|
|
2256
|
+
let e = X(null), { grabProps: t } = nr(e, {
|
|
2248
2257
|
token: "kol-rail",
|
|
2249
2258
|
side: "right"
|
|
2250
2259
|
});
|
|
@@ -2290,14 +2299,14 @@ function Oi() {
|
|
|
2290
2299
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2291
2300
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
2292
2301
|
className: "kol-compose-inspector-body",
|
|
2293
|
-
children: /* @__PURE__ */ Q(
|
|
2302
|
+
children: /* @__PURE__ */ Q(ii, {})
|
|
2294
2303
|
})]
|
|
2295
2304
|
});
|
|
2296
2305
|
}
|
|
2297
|
-
var
|
|
2298
|
-
function
|
|
2299
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
2300
|
-
return /* @__PURE__ */ Q(
|
|
2306
|
+
var Ei = Kn(null);
|
|
2307
|
+
function Di() {
|
|
2308
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = qn(Ei);
|
|
2309
|
+
return /* @__PURE__ */ Q(hi, {
|
|
2301
2310
|
tall: e,
|
|
2302
2311
|
onToggle: () => {
|
|
2303
2312
|
r(null), t((e) => !e);
|
|
@@ -2308,14 +2317,14 @@ function Ai() {
|
|
|
2308
2317
|
}
|
|
2309
2318
|
});
|
|
2310
2319
|
}
|
|
2311
|
-
var
|
|
2320
|
+
var Oi = [
|
|
2312
2321
|
2,
|
|
2313
2322
|
4,
|
|
2314
2323
|
8,
|
|
2315
2324
|
12,
|
|
2316
2325
|
16
|
|
2317
2326
|
];
|
|
2318
|
-
function
|
|
2327
|
+
function ki({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2319
2328
|
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } = C(), [f, p] = Z(!0), m = [
|
|
2320
2329
|
{
|
|
2321
2330
|
icon: "home-01",
|
|
@@ -2390,14 +2399,14 @@ function Mi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2390
2399
|
onPress: u
|
|
2391
2400
|
}
|
|
2392
2401
|
],
|
|
2393
|
-
sheetFor: { loop:
|
|
2402
|
+
sheetFor: { loop: Oi.map((e) => ({
|
|
2394
2403
|
label: `${e} s`,
|
|
2395
2404
|
checked: o === e,
|
|
2396
2405
|
onPress: () => d(e)
|
|
2397
2406
|
})) }
|
|
2398
2407
|
} : void 0;
|
|
2399
2408
|
return Y(() => {
|
|
2400
|
-
|
|
2409
|
+
cr({
|
|
2401
2410
|
items: m,
|
|
2402
2411
|
actions: h,
|
|
2403
2412
|
transport: g,
|
|
@@ -2411,20 +2420,20 @@ function Mi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2411
2420
|
a,
|
|
2412
2421
|
o,
|
|
2413
2422
|
i
|
|
2414
|
-
]), Y(() => () =>
|
|
2423
|
+
]), Y(() => () => cr(null), []), null;
|
|
2415
2424
|
}
|
|
2416
|
-
function
|
|
2425
|
+
function Ai() {
|
|
2417
2426
|
return /* @__PURE__ */ Q("div", {
|
|
2418
2427
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2419
2428
|
children: /* @__PURE__ */ Q("div", {
|
|
2420
2429
|
className: "kol-compose-inspector-body",
|
|
2421
|
-
children: /* @__PURE__ */ Q(
|
|
2430
|
+
children: /* @__PURE__ */ Q(ii, {})
|
|
2422
2431
|
})
|
|
2423
2432
|
});
|
|
2424
2433
|
}
|
|
2425
|
-
var
|
|
2434
|
+
var ji = {
|
|
2426
2435
|
topbar: () => null,
|
|
2427
|
-
canvas:
|
|
2436
|
+
canvas: wi,
|
|
2428
2437
|
panels: [
|
|
2429
2438
|
{
|
|
2430
2439
|
slot: "canvas.footer",
|
|
@@ -2434,7 +2443,7 @@ var Pi = {
|
|
|
2434
2443
|
{
|
|
2435
2444
|
slot: "right.body",
|
|
2436
2445
|
order: 0,
|
|
2437
|
-
Component:
|
|
2446
|
+
Component: Ti
|
|
2438
2447
|
},
|
|
2439
2448
|
{
|
|
2440
2449
|
slot: "right.footer",
|
|
@@ -2442,23 +2451,23 @@ var Pi = {
|
|
|
2442
2451
|
Component: qt
|
|
2443
2452
|
}
|
|
2444
2453
|
]
|
|
2445
|
-
},
|
|
2446
|
-
...
|
|
2454
|
+
}, Mi = {
|
|
2455
|
+
...ji,
|
|
2447
2456
|
panels: [{
|
|
2448
2457
|
slot: "right.header",
|
|
2449
2458
|
order: 0,
|
|
2450
|
-
Component:
|
|
2451
|
-
}, ...
|
|
2459
|
+
Component: Di
|
|
2460
|
+
}, ...ji.panels.map((e) => e.Component === Ti ? {
|
|
2452
2461
|
...e,
|
|
2453
|
-
Component:
|
|
2462
|
+
Component: Ai
|
|
2454
2463
|
} : e)]
|
|
2455
2464
|
};
|
|
2456
|
-
function
|
|
2465
|
+
function Ni() {
|
|
2457
2466
|
let { setAspect: t, selectedId: n, select: r } = o(), { layer: i, setOnly: a } = W(), s = X(!1), c = Kt(gt), d = hn() && !wn() || c;
|
|
2458
2467
|
Y(() => {
|
|
2459
2468
|
d && document.documentElement.removeAttribute("data-rail");
|
|
2460
2469
|
}, [d]);
|
|
2461
|
-
let [f, p] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ?
|
|
2470
|
+
let [f, p] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ? pi.tall : pi.half, y = { "--kol-sheet-h": v }, b = lr(), x = nt(), [C, w] = Z(() => !i);
|
|
2462
2471
|
Y(() => {
|
|
2463
2472
|
w(!i);
|
|
2464
2473
|
}, [i?.id]);
|
|
@@ -2576,8 +2585,8 @@ function Ii() {
|
|
|
2576
2585
|
"data-empty": i || x.active ? void 0 : "",
|
|
2577
2586
|
style: y,
|
|
2578
2587
|
children: [
|
|
2579
|
-
/* @__PURE__ */ Q(
|
|
2580
|
-
d ? /* @__PURE__ */ $(
|
|
2588
|
+
/* @__PURE__ */ Q(Dr, {}),
|
|
2589
|
+
d ? /* @__PURE__ */ $(Ei.Provider, {
|
|
2581
2590
|
value: {
|
|
2582
2591
|
collapseParams: () => p(!1),
|
|
2583
2592
|
tall: m,
|
|
@@ -2589,8 +2598,8 @@ function Ii() {
|
|
|
2589
2598
|
children: [/* @__PURE__ */ Q(u.Provider, {
|
|
2590
2599
|
value: "md",
|
|
2591
2600
|
children: /* @__PURE__ */ Q(_t, {
|
|
2592
|
-
registry:
|
|
2593
|
-
rightIn: (e) => b ?
|
|
2601
|
+
registry: Mi,
|
|
2602
|
+
rightIn: (e) => b ? ir(/* @__PURE__ */ Q("div", {
|
|
2594
2603
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2595
2604
|
"data-touch": "",
|
|
2596
2605
|
"data-params": "open",
|
|
@@ -2598,15 +2607,15 @@ function Ii() {
|
|
|
2598
2607
|
children: e
|
|
2599
2608
|
}), b) : null
|
|
2600
2609
|
})
|
|
2601
|
-
}), /* @__PURE__ */ Q(
|
|
2610
|
+
}), /* @__PURE__ */ Q(ki, {
|
|
2602
2611
|
paramsOpen: f,
|
|
2603
2612
|
setParamsOpen: p,
|
|
2604
2613
|
catalog: C,
|
|
2605
2614
|
toggleCatalog: () => w((e) => !e),
|
|
2606
2615
|
railHeight: v
|
|
2607
2616
|
})]
|
|
2608
|
-
}) : /* @__PURE__ */ Q(_t, { registry:
|
|
2609
|
-
C && !x.picker && !(x.active && !i) && /* @__PURE__ */ Q(
|
|
2617
|
+
}) : /* @__PURE__ */ Q(_t, { registry: ji }),
|
|
2618
|
+
C && !x.picker && !(x.active && !i) && /* @__PURE__ */ Q(_i, {
|
|
2610
2619
|
initialOpen: T,
|
|
2611
2620
|
hasMedia: D,
|
|
2612
2621
|
onNeedMedia: (e) => {
|
|
@@ -2625,8 +2634,8 @@ function Ii() {
|
|
|
2625
2634
|
]
|
|
2626
2635
|
});
|
|
2627
2636
|
}
|
|
2628
|
-
var
|
|
2629
|
-
function
|
|
2637
|
+
var Pi = "kol.editor.labs-draft";
|
|
2638
|
+
function Fi() {
|
|
2630
2639
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2631
2640
|
return Y(() => (G(e ? { active: !0 } : {
|
|
2632
2641
|
active: !1,
|
|
@@ -2635,9 +2644,9 @@ function Ri() {
|
|
|
2635
2644
|
active: !1,
|
|
2636
2645
|
editing: null
|
|
2637
2646
|
})), [e]), /* @__PURE__ */ $(fn, {
|
|
2638
|
-
draftKey:
|
|
2647
|
+
draftKey: Pi,
|
|
2639
2648
|
children: [
|
|
2640
|
-
/* @__PURE__ */ Q(
|
|
2649
|
+
/* @__PURE__ */ Q(Ni, {}),
|
|
2641
2650
|
/* @__PURE__ */ Q(St, {}),
|
|
2642
2651
|
/* @__PURE__ */ Q(ve, {})
|
|
2643
2652
|
]
|
|
@@ -2645,9 +2654,9 @@ function Ri() {
|
|
|
2645
2654
|
}
|
|
2646
2655
|
//#endregion
|
|
2647
2656
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2648
|
-
function
|
|
2657
|
+
function Ii({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2649
2658
|
let [i, a] = Z(null);
|
|
2650
|
-
|
|
2659
|
+
ai(r);
|
|
2651
2660
|
let { engineHost: o } = ie(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = F(L.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2652
2661
|
return /* @__PURE__ */ Q("div", {
|
|
2653
2662
|
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",
|
|
@@ -2687,7 +2696,7 @@ function zi({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2687
2696
|
}
|
|
2688
2697
|
//#endregion
|
|
2689
2698
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
2690
|
-
var
|
|
2699
|
+
var Li = { background: "var(--kol-surface-primary)" }, Ri = [
|
|
2691
2700
|
{
|
|
2692
2701
|
value: "generate",
|
|
2693
2702
|
label: "Generate"
|
|
@@ -2704,29 +2713,30 @@ var Bi = { background: "var(--kol-surface-primary)" }, Vi = [
|
|
|
2704
2713
|
value: "output",
|
|
2705
2714
|
label: "Output"
|
|
2706
2715
|
}
|
|
2707
|
-
],
|
|
2716
|
+
], zi = Ri.filter((e) => e.value !== "generate"), Bi = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover]:text-[var(--kol-oq-48)]", Vi = {
|
|
2708
2717
|
lg: 9.6,
|
|
2709
2718
|
sm: 7.2
|
|
2710
|
-
},
|
|
2711
|
-
function
|
|
2712
|
-
let n = t === "sm" ?
|
|
2719
|
+
}, Hi = 10, Ui = 232;
|
|
2720
|
+
function Wi(e, t) {
|
|
2721
|
+
let n = t === "sm" ? Ui : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
2713
2722
|
for (let o of e) {
|
|
2714
|
-
let e = o.label.length *
|
|
2723
|
+
let e = o.label.length * Vi[t] + Hi, s = Math.max(a, e);
|
|
2715
2724
|
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
2716
2725
|
}
|
|
2717
2726
|
return i.length && r.push(i), r;
|
|
2718
2727
|
}
|
|
2719
|
-
function
|
|
2720
|
-
return
|
|
2728
|
+
function Gi({ cells: e, size: t }) {
|
|
2729
|
+
return Wi(e, t).map((e, n) => /* @__PURE__ */ Q(q, {
|
|
2730
|
+
layout: "joined",
|
|
2721
2731
|
value: null,
|
|
2722
2732
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
2723
2733
|
options: e,
|
|
2724
2734
|
size: t,
|
|
2725
2735
|
ariaLabel: "Randomize scope",
|
|
2726
|
-
className:
|
|
2736
|
+
className: Bi
|
|
2727
2737
|
}, n));
|
|
2728
2738
|
}
|
|
2729
|
-
var
|
|
2739
|
+
var Ki = [
|
|
2730
2740
|
2,
|
|
2731
2741
|
4,
|
|
2732
2742
|
8,
|
|
@@ -2735,17 +2745,18 @@ var Yi = [
|
|
|
2735
2745
|
value: String(e),
|
|
2736
2746
|
label: `${e}s`
|
|
2737
2747
|
}));
|
|
2738
|
-
function
|
|
2748
|
+
function qi({ size: e }) {
|
|
2739
2749
|
let { loopSeconds: t, setLoopSeconds: n } = C();
|
|
2740
|
-
return /* @__PURE__ */ Q(
|
|
2750
|
+
return /* @__PURE__ */ Q(q, {
|
|
2751
|
+
layout: "joined",
|
|
2741
2752
|
value: String(t),
|
|
2742
2753
|
onChange: (e) => n(Number(e)),
|
|
2743
|
-
options:
|
|
2754
|
+
options: Ki,
|
|
2744
2755
|
size: e,
|
|
2745
2756
|
ariaLabel: "Loop length"
|
|
2746
2757
|
});
|
|
2747
2758
|
}
|
|
2748
|
-
var
|
|
2759
|
+
var Ji = [
|
|
2749
2760
|
{
|
|
2750
2761
|
value: "9:16",
|
|
2751
2762
|
label: "9:16"
|
|
@@ -2762,7 +2773,7 @@ var Zi = [
|
|
|
2762
2773
|
value: "1:1",
|
|
2763
2774
|
label: "1:1"
|
|
2764
2775
|
}
|
|
2765
|
-
],
|
|
2776
|
+
], Yi = [
|
|
2766
2777
|
{
|
|
2767
2778
|
value: "5:4",
|
|
2768
2779
|
label: "5:4"
|
|
@@ -2780,20 +2791,20 @@ var Zi = [
|
|
|
2780
2791
|
label: "Fill"
|
|
2781
2792
|
}
|
|
2782
2793
|
];
|
|
2783
|
-
function
|
|
2794
|
+
function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: d }) {
|
|
2784
2795
|
let f = nt(), { updateLayer: h, addFilter: _, removeFilter: v } = o(), { onExportPng: b } = Et(), [x, S] = Z(!1), [C, T] = Z(!0), [D, k] = Z(!1), [A, j] = Z(!1), [te, M] = Z("generate"), [ne, F] = Z(!1), [I, re] = Z(!1), { aspect: L } = o(), [R, ae] = Z(null), z = m(e);
|
|
2785
2796
|
Y(() => {
|
|
2786
2797
|
c && (T(!0), j(!0));
|
|
2787
2798
|
}, [c]);
|
|
2788
2799
|
let B = l ? "sm" : "lg", oe = l && !!e && C && !x;
|
|
2789
2800
|
Y(() => (u?.(oe), () => u?.(!1)), [oe]);
|
|
2790
|
-
let se = !l && e && C && !x ? R ? `${R}px` : ne ?
|
|
2801
|
+
let se = !l && e && C && !x ? R ? `${R}px` : ne ? pi.tall : pi.half : null;
|
|
2791
2802
|
Y(() => (d?.(se), () => d?.(null)), [se]);
|
|
2792
2803
|
let ce = () => {
|
|
2793
2804
|
let t = e?.type === "loop" && N(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2794
2805
|
t && h(e.id, H(t, e.loopGroup));
|
|
2795
2806
|
};
|
|
2796
|
-
if (
|
|
2807
|
+
if (Ur(ce, () => {
|
|
2797
2808
|
e?.type === "loop" && h(e.id, p(e, w(U(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2798
2809
|
}), !e) return null;
|
|
2799
2810
|
if (x) return /* @__PURE__ */ Q("button", {
|
|
@@ -2808,12 +2819,12 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2808
2819
|
let t = ee(e, z.take());
|
|
2809
2820
|
t && h(e.id, { filters: t });
|
|
2810
2821
|
};
|
|
2811
|
-
if (!C) return /* @__PURE__ */ $(
|
|
2822
|
+
if (!C) return /* @__PURE__ */ $(fi, {
|
|
2812
2823
|
label: V ? e.presetLabel : "Media",
|
|
2813
2824
|
onOpen: () => T(!0),
|
|
2814
2825
|
size: B,
|
|
2815
2826
|
children: [
|
|
2816
|
-
(V || he.length > 0) && /* @__PURE__ */ Q(
|
|
2827
|
+
(V || he.length > 0) && /* @__PURE__ */ Q(Hn, {
|
|
2817
2828
|
label: "Randomize all",
|
|
2818
2829
|
children: /* @__PURE__ */ Q(K, {
|
|
2819
2830
|
tone: "primary",
|
|
@@ -2824,7 +2835,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2824
2835
|
className: "shrink-0"
|
|
2825
2836
|
})
|
|
2826
2837
|
}),
|
|
2827
|
-
/* @__PURE__ */ Q(
|
|
2838
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2828
2839
|
label: "Download",
|
|
2829
2840
|
children: /* @__PURE__ */ Q(K, {
|
|
2830
2841
|
tone: "primary",
|
|
@@ -2835,7 +2846,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2835
2846
|
className: "shrink-0"
|
|
2836
2847
|
})
|
|
2837
2848
|
}),
|
|
2838
|
-
/* @__PURE__ */ Q(
|
|
2849
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2839
2850
|
label: "Hide UI",
|
|
2840
2851
|
children: /* @__PURE__ */ Q(K, {
|
|
2841
2852
|
tone: "primary",
|
|
@@ -2846,7 +2857,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2846
2857
|
className: "shrink-0"
|
|
2847
2858
|
})
|
|
2848
2859
|
}),
|
|
2849
|
-
/* @__PURE__ */ Q(
|
|
2860
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2850
2861
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2851
2862
|
children: /* @__PURE__ */ Q(K, {
|
|
2852
2863
|
tone: "primary",
|
|
@@ -2860,11 +2871,11 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2860
2871
|
})
|
|
2861
2872
|
]
|
|
2862
2873
|
});
|
|
2863
|
-
let ve = [...V ?
|
|
2874
|
+
let ve = [...V ? Ri : zi, ...V && f.steps.length >= 2 ? [{
|
|
2864
2875
|
value: "morph",
|
|
2865
2876
|
label: "Morph"
|
|
2866
2877
|
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" || n("motion"))), ye = ve.some((e) => e.value === te) ? te : ve[0].value;
|
|
2867
|
-
return /* @__PURE__ */ $(
|
|
2878
|
+
return /* @__PURE__ */ $(Yn, { children: [
|
|
2868
2879
|
/* @__PURE__ */ Q(pe, {
|
|
2869
2880
|
open: I,
|
|
2870
2881
|
onClose: () => re(!1),
|
|
@@ -2872,7 +2883,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2872
2883
|
layer: e,
|
|
2873
2884
|
size: B
|
|
2874
2885
|
}),
|
|
2875
|
-
D && /* @__PURE__ */ Q(
|
|
2886
|
+
D && /* @__PURE__ */ Q(oi, {
|
|
2876
2887
|
onPick: (e) => {
|
|
2877
2888
|
t(e), k(!1);
|
|
2878
2889
|
},
|
|
@@ -2884,7 +2895,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2884
2895
|
},
|
|
2885
2896
|
onDismiss: () => k(!1)
|
|
2886
2897
|
}),
|
|
2887
|
-
A && /* @__PURE__ */ Q(
|
|
2898
|
+
A && /* @__PURE__ */ Q(Ii, {
|
|
2888
2899
|
layer: e,
|
|
2889
2900
|
chain: he,
|
|
2890
2901
|
onPick: (t) => {
|
|
@@ -2894,12 +2905,12 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2894
2905
|
}),
|
|
2895
2906
|
/* @__PURE__ */ $("div", {
|
|
2896
2907
|
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)]",
|
|
2897
|
-
style: l ?
|
|
2898
|
-
...
|
|
2899
|
-
top: `calc(100dvh - ${se ??
|
|
2908
|
+
style: l ? Li : {
|
|
2909
|
+
...Li,
|
|
2910
|
+
top: `calc(100dvh - ${se ?? pi.half})`
|
|
2900
2911
|
},
|
|
2901
2912
|
children: [
|
|
2902
|
-
!l && /* @__PURE__ */ Q(
|
|
2913
|
+
!l && /* @__PURE__ */ Q(hi, {
|
|
2903
2914
|
tall: ne,
|
|
2904
2915
|
onToggle: () => {
|
|
2905
2916
|
ae(null), F((e) => !e);
|
|
@@ -2909,7 +2920,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2909
2920
|
e < 96 && (ae(null), T(!1));
|
|
2910
2921
|
}
|
|
2911
2922
|
}),
|
|
2912
|
-
/* @__PURE__ */ Q(
|
|
2923
|
+
/* @__PURE__ */ Q(di, {
|
|
2913
2924
|
title: le,
|
|
2914
2925
|
onCollapse: () => T(!1),
|
|
2915
2926
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
@@ -2924,14 +2935,15 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2924
2935
|
/* @__PURE__ */ $("div", {
|
|
2925
2936
|
className: l ? "px-4 pb-5" : "min-h-0 flex-1 overflow-y-auto px-3 pb-3",
|
|
2926
2937
|
children: [
|
|
2927
|
-
/* @__PURE__ */ Q(
|
|
2938
|
+
/* @__PURE__ */ Q(q, {
|
|
2939
|
+
layout: "joined",
|
|
2928
2940
|
value: ye,
|
|
2929
2941
|
onChange: M,
|
|
2930
2942
|
options: ve,
|
|
2931
2943
|
size: B,
|
|
2932
|
-
className: l ?
|
|
2944
|
+
className: l ? Bi : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2933
2945
|
}),
|
|
2934
|
-
ye === "morph" && V && /* @__PURE__ */ Q(
|
|
2946
|
+
ye === "morph" && V && /* @__PURE__ */ Q(Ar, {
|
|
2935
2947
|
layer: e,
|
|
2936
2948
|
readOnly: !0
|
|
2937
2949
|
}),
|
|
@@ -2963,7 +2975,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2963
2975
|
onClick: W,
|
|
2964
2976
|
children: "Randomize all"
|
|
2965
2977
|
}),
|
|
2966
|
-
/* @__PURE__ */ Q(
|
|
2978
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2967
2979
|
label: "What Randomize all rolls",
|
|
2968
2980
|
children: /* @__PURE__ */ Q(K, {
|
|
2969
2981
|
tone: "primary",
|
|
@@ -2974,7 +2986,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2974
2986
|
className: "shrink-0"
|
|
2975
2987
|
})
|
|
2976
2988
|
}),
|
|
2977
|
-
/* @__PURE__ */ Q(
|
|
2989
|
+
/* @__PURE__ */ Q(Hn, {
|
|
2978
2990
|
label: "Reset to defaults",
|
|
2979
2991
|
shortcut: "R",
|
|
2980
2992
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -2988,7 +3000,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
2988
3000
|
})
|
|
2989
3001
|
]
|
|
2990
3002
|
}),
|
|
2991
|
-
de.length > 0 && /* @__PURE__ */ Q(
|
|
3003
|
+
de.length > 0 && /* @__PURE__ */ Q(Gi, {
|
|
2992
3004
|
size: B,
|
|
2993
3005
|
cells: [...de.map((e) => ({
|
|
2994
3006
|
value: e.id,
|
|
@@ -3046,7 +3058,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3046
3058
|
iconRight: "trash",
|
|
3047
3059
|
onClick: () => v(e.id, n),
|
|
3048
3060
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3049
|
-
}), i.length > 0 && /* @__PURE__ */ Q(
|
|
3061
|
+
}), i.length > 0 && /* @__PURE__ */ Q(Gi, {
|
|
3050
3062
|
size: B,
|
|
3051
3063
|
cells: i.map((e) => ({
|
|
3052
3064
|
value: e.id,
|
|
@@ -3062,22 +3074,24 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3062
3074
|
children: [(() => {
|
|
3063
3075
|
let e = n("motion").TransportBar;
|
|
3064
3076
|
return /* @__PURE__ */ Q(e, { size: B });
|
|
3065
|
-
})(), /* @__PURE__ */ Q(
|
|
3077
|
+
})(), /* @__PURE__ */ Q(qi, { size: B })]
|
|
3066
3078
|
}),
|
|
3067
3079
|
ye === "output" && /* @__PURE__ */ $("div", {
|
|
3068
3080
|
className: "flex flex-col gap-2 pt-3",
|
|
3069
3081
|
children: [
|
|
3070
|
-
/* @__PURE__ */ Q(
|
|
3082
|
+
/* @__PURE__ */ Q(q, {
|
|
3083
|
+
layout: "joined",
|
|
3071
3084
|
value: a,
|
|
3072
3085
|
onChange: s,
|
|
3073
|
-
options:
|
|
3086
|
+
options: Ji,
|
|
3074
3087
|
size: B,
|
|
3075
3088
|
ariaLabel: "Aspect"
|
|
3076
3089
|
}),
|
|
3077
|
-
/* @__PURE__ */ Q(
|
|
3090
|
+
/* @__PURE__ */ Q(q, {
|
|
3091
|
+
layout: "joined",
|
|
3078
3092
|
value: a,
|
|
3079
3093
|
onChange: s,
|
|
3080
|
-
options:
|
|
3094
|
+
options: Yi,
|
|
3081
3095
|
size: B,
|
|
3082
3096
|
ariaLabel: "Aspect (landscape) and fill"
|
|
3083
3097
|
}),
|
|
@@ -3120,7 +3134,7 @@ function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
|
|
|
3120
3134
|
}
|
|
3121
3135
|
//#endregion
|
|
3122
3136
|
//#region src/editor/mobile/MobileView.jsx
|
|
3123
|
-
function
|
|
3137
|
+
function Zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
3124
3138
|
return /* @__PURE__ */ Q("div", {
|
|
3125
3139
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
3126
3140
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -3192,7 +3206,7 @@ function ea({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3192
3206
|
})
|
|
3193
3207
|
});
|
|
3194
3208
|
}
|
|
3195
|
-
function
|
|
3209
|
+
function Qi() {
|
|
3196
3210
|
let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: s, aspect: c, setAspect: l } = o(), { setTool: u } = Nt(), d = hn() && !wn(), f = _n(), p = () => {
|
|
3197
3211
|
let e = new URLSearchParams(window.location.search);
|
|
3198
3212
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
@@ -3253,7 +3267,7 @@ function ta() {
|
|
|
3253
3267
|
let t = j.current;
|
|
3254
3268
|
t && t.id === e.pointerId && e.type === "pointerup" && m === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (F?.type === "loop" ? U(F.loopId) : null)?.group !== "penrose" && O.toggle(), t?.id === e.pointerId && (j.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, ee(A.current.live));
|
|
3255
3269
|
};
|
|
3256
|
-
|
|
3270
|
+
rr(), Y(() => (nn("randomiser"), () => nn(null)), []), Y(() => {
|
|
3257
3271
|
l("4:5"), u("orbit");
|
|
3258
3272
|
}, []);
|
|
3259
3273
|
let F = e.find((e) => e.id === v) ?? (e.length === 1 ? e[0] : null), I = m === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
|
|
@@ -3329,19 +3343,19 @@ function ta() {
|
|
|
3329
3343
|
onPointerLeave: P,
|
|
3330
3344
|
children: /* @__PURE__ */ Q($t, { fit: b })
|
|
3331
3345
|
}),
|
|
3332
|
-
m === "entry" && /* @__PURE__ */ Q(
|
|
3346
|
+
m === "entry" && /* @__PURE__ */ Q(Zi, {
|
|
3333
3347
|
chromes: d,
|
|
3334
3348
|
onGenerate: () => h("category"),
|
|
3335
3349
|
onEffects: () => {
|
|
3336
3350
|
_(!0), ie();
|
|
3337
3351
|
}
|
|
3338
3352
|
}),
|
|
3339
|
-
m === "category" && /* @__PURE__ */ Q(
|
|
3353
|
+
m === "category" && /* @__PURE__ */ Q(oi, {
|
|
3340
3354
|
onPick: re,
|
|
3341
3355
|
onInsert: ie,
|
|
3342
3356
|
onBack: () => h("entry")
|
|
3343
3357
|
}),
|
|
3344
|
-
m === "live" && !I && /* @__PURE__ */ Q(
|
|
3358
|
+
m === "live" && !I && /* @__PURE__ */ Q(Xi, {
|
|
3345
3359
|
layer: F,
|
|
3346
3360
|
onSwitchCategory: L,
|
|
3347
3361
|
onInsert: () => {
|
|
@@ -3360,7 +3374,7 @@ function ta() {
|
|
|
3360
3374
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3361
3375
|
children: [/* @__PURE__ */ Q("div", {
|
|
3362
3376
|
className: "flex-1 min-h-0",
|
|
3363
|
-
children: /* @__PURE__ */ Q(
|
|
3377
|
+
children: /* @__PURE__ */ Q(li, { layer: F })
|
|
3364
3378
|
}), /* @__PURE__ */ Q("div", {
|
|
3365
3379
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3366
3380
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -3374,15 +3388,15 @@ function ta() {
|
|
|
3374
3388
|
]
|
|
3375
3389
|
});
|
|
3376
3390
|
}
|
|
3377
|
-
function
|
|
3391
|
+
function $i() {
|
|
3378
3392
|
return /* @__PURE__ */ $(fn, {
|
|
3379
3393
|
persistDraft: !1,
|
|
3380
|
-
children: [/* @__PURE__ */ Q(
|
|
3394
|
+
children: [/* @__PURE__ */ Q(Qi, {}), /* @__PURE__ */ Q(St, {})]
|
|
3381
3395
|
});
|
|
3382
3396
|
}
|
|
3383
3397
|
//#endregion
|
|
3384
3398
|
//#region src/editor/labs/FloatLabs.jsx
|
|
3385
|
-
function
|
|
3399
|
+
function ea() {
|
|
3386
3400
|
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = (e) => () => e(), a = (e) => () => window.dispatchEvent(new CustomEvent(e));
|
|
3387
3401
|
return {
|
|
3388
3402
|
app: {
|
|
@@ -3472,7 +3486,7 @@ function ra() {
|
|
|
3472
3486
|
}]
|
|
3473
3487
|
};
|
|
3474
3488
|
}
|
|
3475
|
-
function
|
|
3489
|
+
function ta() {
|
|
3476
3490
|
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
3477
3491
|
Y(() => {
|
|
3478
3492
|
n?.type === "photo" && n.src && (i.current = {
|
|
@@ -3486,7 +3500,7 @@ function ia() {
|
|
|
3486
3500
|
n?.srcType,
|
|
3487
3501
|
n?.fit
|
|
3488
3502
|
]);
|
|
3489
|
-
let a =
|
|
3503
|
+
let a = Er({
|
|
3490
3504
|
layer: n,
|
|
3491
3505
|
setOnly: r,
|
|
3492
3506
|
addFilter: e,
|
|
@@ -3500,7 +3514,7 @@ function ia() {
|
|
|
3500
3514
|
return a.forEach((e) => {
|
|
3501
3515
|
if (e.id.startsWith("sec:")) {
|
|
3502
3516
|
s.push({
|
|
3503
|
-
icon:
|
|
3517
|
+
icon: Sr[e.id.slice(4)] ?? "square",
|
|
3504
3518
|
label: e.label,
|
|
3505
3519
|
path: e.id,
|
|
3506
3520
|
sub: []
|
|
@@ -3521,10 +3535,10 @@ function ia() {
|
|
|
3521
3535
|
pick: (e) => c.get(e)?.()
|
|
3522
3536
|
};
|
|
3523
3537
|
}
|
|
3524
|
-
function
|
|
3538
|
+
function na() {
|
|
3525
3539
|
let { layer: e } = W(), { removeLayer: t } = o(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam";
|
|
3526
3540
|
return /* @__PURE__ */ $("div", {
|
|
3527
|
-
className: "kol-float-labs-stage
|
|
3541
|
+
className: "kol-float-labs-stage relative h-full min-h-[360px] flex items-center justify-center overflow-hidden rounded-[var(--kol-float-window-r)]",
|
|
3528
3542
|
style: { background: "var(--kol-surface-secondary)" },
|
|
3529
3543
|
children: [/* @__PURE__ */ Q("div", {
|
|
3530
3544
|
style: {
|
|
@@ -3533,197 +3547,104 @@ function aa() {
|
|
|
3533
3547
|
height: "85%"
|
|
3534
3548
|
},
|
|
3535
3549
|
children: /* @__PURE__ */ Q(Xt, {})
|
|
3536
|
-
}), n && /* @__PURE__ */ Q(
|
|
3550
|
+
}), n && /* @__PURE__ */ Q(ui, {
|
|
3537
3551
|
layer: e,
|
|
3538
|
-
title:
|
|
3552
|
+
title: vi(e).title,
|
|
3539
3553
|
onBack: () => t(e.id)
|
|
3540
3554
|
})]
|
|
3541
3555
|
});
|
|
3542
3556
|
}
|
|
3543
|
-
function
|
|
3544
|
-
let [i, a] = Z(null), o = X(0), s = () => clearTimeout(o.current), c = () => {
|
|
3545
|
-
s(), o.current = setTimeout(() => a(null), 160);
|
|
3546
|
-
};
|
|
3547
|
-
return /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q(Rn, {
|
|
3548
|
-
variant: "float",
|
|
3549
|
-
collapsed: !0,
|
|
3550
|
-
items: e,
|
|
3551
|
-
currentPath: t ?? "",
|
|
3552
|
-
title: "Labs",
|
|
3553
|
-
icon: "globe",
|
|
3554
|
-
onNavigate: (e) => n(e),
|
|
3555
|
-
onItemHover: (e, t) => {
|
|
3556
|
-
if (!e) return c();
|
|
3557
|
-
s(), a(e.sub?.length ? {
|
|
3558
|
-
item: e,
|
|
3559
|
-
el: t
|
|
3560
|
-
} : null);
|
|
3561
|
-
},
|
|
3562
|
-
className: r
|
|
3563
|
-
}), i && /* @__PURE__ */ Q("span", {
|
|
3564
|
-
className: "contents",
|
|
3565
|
-
onMouseEnter: s,
|
|
3566
|
-
onMouseLeave: c,
|
|
3567
|
-
children: /* @__PURE__ */ Q(ir, {
|
|
3568
|
-
icon: i.item.icon,
|
|
3569
|
-
title: i.item.label,
|
|
3570
|
-
items: i.item.sub,
|
|
3571
|
-
active: t,
|
|
3572
|
-
anchor: i.el,
|
|
3573
|
-
open: !0,
|
|
3574
|
-
onOpenChange: (e) => {
|
|
3575
|
-
e || a(null);
|
|
3576
|
-
},
|
|
3577
|
-
onPick: (e) => {
|
|
3578
|
-
a(null), n(e.path);
|
|
3579
|
-
}
|
|
3580
|
-
})
|
|
3581
|
-
})] });
|
|
3582
|
-
}
|
|
3583
|
-
function sa({ variant: e }) {
|
|
3557
|
+
function ra() {
|
|
3584
3558
|
wt();
|
|
3585
|
-
let
|
|
3559
|
+
let e = Wn("(max-width: 767px)"), { layer: t } = W(), { undo: n, redo: r, canUndo: i, canRedo: a, selectedId: s, select: c } = o();
|
|
3586
3560
|
Y(() => {
|
|
3587
|
-
|
|
3561
|
+
t && s !== t.id && c(t.id);
|
|
3588
3562
|
}, [
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3563
|
+
t,
|
|
3564
|
+
s,
|
|
3565
|
+
c
|
|
3592
3566
|
]);
|
|
3593
|
-
let {
|
|
3594
|
-
name:
|
|
3567
|
+
let { menus: l, end: u } = ea(), d = ta(), f = t ? vi(t).title : "Labs", p = d.items.filter((e) => e.sub?.length).map((e) => e.path), m = /* @__PURE__ */ Q(Qn, {
|
|
3568
|
+
name: f || "Untitled",
|
|
3595
3569
|
status: "Labs",
|
|
3596
3570
|
onBack: () => pn("/"),
|
|
3597
|
-
menuItems:
|
|
3571
|
+
menuItems: Nn([...l, ...u].map((e) => ({
|
|
3598
3572
|
label: e.label,
|
|
3599
3573
|
items: e.items
|
|
3600
|
-
})))
|
|
3601
|
-
}),
|
|
3602
|
-
onUndo: () =>
|
|
3603
|
-
onRedo: () =>
|
|
3574
|
+
})))
|
|
3575
|
+
}), h = /* @__PURE__ */ Q(er, {
|
|
3576
|
+
onUndo: () => i && n(),
|
|
3577
|
+
onRedo: () => a && r(),
|
|
3604
3578
|
onAction: () => cn("Output"),
|
|
3605
3579
|
onAccount: () => pn("/settings")
|
|
3606
|
-
}),
|
|
3580
|
+
}), g = /* @__PURE__ */ Q(Zn, {
|
|
3607
3581
|
variant: "mobile",
|
|
3608
3582
|
shape: "pill",
|
|
3609
|
-
labels: !
|
|
3583
|
+
labels: !e,
|
|
3610
3584
|
items: rn,
|
|
3611
3585
|
sheetItems: tn,
|
|
3612
3586
|
currentPath: "/labs",
|
|
3613
3587
|
onNavigate: kn
|
|
3614
|
-
}), b = /* @__PURE__ */ Q(rr, {
|
|
3615
|
-
title: m || "Parameters",
|
|
3616
|
-
width: t ? "100%" : 352,
|
|
3617
|
-
density: "compact",
|
|
3618
|
-
surface: "solid",
|
|
3619
|
-
sections: [{
|
|
3620
|
-
id: "labs-params",
|
|
3621
|
-
label: "Parameters",
|
|
3622
|
-
rows: [{
|
|
3623
|
-
id: "body",
|
|
3624
|
-
render: () => /* @__PURE__ */ Q("div", {
|
|
3625
|
-
className: "kol-editor-labs kol-float-labs-params",
|
|
3626
|
-
children: /* @__PURE__ */ Q("div", {
|
|
3627
|
-
className: "kol-compose-inspector-body",
|
|
3628
|
-
children: /* @__PURE__ */ Q(si, {})
|
|
3629
|
-
})
|
|
3630
|
-
})
|
|
3631
|
-
}]
|
|
3632
|
-
}],
|
|
3633
|
-
footer: /* @__PURE__ */ Q("div", {
|
|
3634
|
-
className: "kol-editor-labs",
|
|
3635
|
-
children: /* @__PURE__ */ Q(qt, {})
|
|
3636
|
-
}),
|
|
3637
|
-
className: "kol-float-labs-rail max-h-full overflow-y-auto scrollbar-none"
|
|
3638
3588
|
});
|
|
3639
|
-
return /* @__PURE__ */
|
|
3640
|
-
className: "kol-float-labs kol-editor-shell
|
|
3641
|
-
"data-variant": e,
|
|
3589
|
+
return /* @__PURE__ */ Q("div", {
|
|
3590
|
+
className: "kol-float-labs kol-editor-shell",
|
|
3642
3591
|
"data-editor-keep-selection": !0,
|
|
3643
|
-
children:
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
]
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
children: [_, !h && /* @__PURE__ */ Q($n, { items: [
|
|
3685
|
-
"FXR",
|
|
3686
|
-
"Labs",
|
|
3687
|
-
m || "Untitled"
|
|
3688
|
-
] })]
|
|
3689
|
-
}),
|
|
3690
|
-
/* @__PURE__ */ Q(Ut, { className: "absolute! left-1/2 -translate-x-1/2 top-6" }),
|
|
3691
|
-
/* @__PURE__ */ Q("div", {
|
|
3692
|
-
className: "absolute right-6 top-9",
|
|
3693
|
-
children: v
|
|
3694
|
-
}),
|
|
3695
|
-
h ? /* @__PURE__ */ Q(oa, {
|
|
3696
|
-
items: p.items,
|
|
3697
|
-
active: p.active,
|
|
3698
|
-
onPick: p.pick,
|
|
3699
|
-
className: "absolute! left-6 top-6 bottom-[120px] !h-auto"
|
|
3700
|
-
}) : /* @__PURE__ */ Q(Rn, {
|
|
3701
|
-
variant: "float",
|
|
3702
|
-
items: p.items,
|
|
3703
|
-
currentPath: p.active ?? "",
|
|
3704
|
-
onNavigate: p.pick,
|
|
3705
|
-
title: "Labs",
|
|
3706
|
-
icon: "globe",
|
|
3707
|
-
defaultExpanded: g,
|
|
3708
|
-
className: "absolute! left-6 top-[188px] bottom-[124px] !h-auto"
|
|
3709
|
-
}),
|
|
3710
|
-
/* @__PURE__ */ Q("div", {
|
|
3711
|
-
className: "absolute right-6 top-[108px] bottom-6 flex flex-col",
|
|
3712
|
-
children: b
|
|
3713
|
-
}),
|
|
3714
|
-
/* @__PURE__ */ Q("div", {
|
|
3715
|
-
className: "absolute left-6 bottom-[35px] w-[418px] h-[66px] [transform:translateZ(0)] [&_.kol-mobile-tabbar]:!flex",
|
|
3716
|
-
children: y
|
|
3592
|
+
children: /* @__PURE__ */ Q($n, {
|
|
3593
|
+
nav: d.items,
|
|
3594
|
+
currentPath: d.active ?? "",
|
|
3595
|
+
onNavigate: d.pick,
|
|
3596
|
+
title: "Labs",
|
|
3597
|
+
icon: "globe",
|
|
3598
|
+
defaultExpanded: p,
|
|
3599
|
+
breadcrumb: [
|
|
3600
|
+
"FXR",
|
|
3601
|
+
"Labs",
|
|
3602
|
+
f || "Untitled"
|
|
3603
|
+
],
|
|
3604
|
+
bar: {
|
|
3605
|
+
start: m,
|
|
3606
|
+
center: e ? void 0 : /* @__PURE__ */ Q(Ut, {}),
|
|
3607
|
+
end: h
|
|
3608
|
+
},
|
|
3609
|
+
inspectorLabel: "Parameters",
|
|
3610
|
+
inspector: ({ hide: t }) => /* @__PURE__ */ Q(tr, {
|
|
3611
|
+
title: f || "Parameters",
|
|
3612
|
+
onCollapse: t,
|
|
3613
|
+
width: e ? "100%" : 352,
|
|
3614
|
+
density: "compact",
|
|
3615
|
+
surface: "solid",
|
|
3616
|
+
sections: [{
|
|
3617
|
+
id: "labs-params",
|
|
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, {})
|
|
3717
3633
|
})
|
|
3718
|
-
|
|
3719
|
-
|
|
3634
|
+
}),
|
|
3635
|
+
bottom: e ? g : /* @__PURE__ */ Q("div", {
|
|
3636
|
+
className: "w-[418px] h-[66px] [transform:translateZ(0)] [&_.kol-mobile-tabbar]:!flex",
|
|
3637
|
+
children: g
|
|
3638
|
+
}),
|
|
3639
|
+
children: /* @__PURE__ */ Q(na, {})
|
|
3640
|
+
})
|
|
3720
3641
|
});
|
|
3721
3642
|
}
|
|
3722
|
-
function
|
|
3643
|
+
function ia() {
|
|
3723
3644
|
return /* @__PURE__ */ $(fn, {
|
|
3724
|
-
draftKey:
|
|
3725
|
-
children: [/* @__PURE__ */ Q(
|
|
3645
|
+
draftKey: Pi,
|
|
3646
|
+
children: [/* @__PURE__ */ Q(ra, {}), /* @__PURE__ */ Q(St, {})]
|
|
3726
3647
|
});
|
|
3727
3648
|
}
|
|
3728
3649
|
//#endregion
|
|
3729
|
-
export { kt as AppSettingsSections, Rt as BRAND, Tn as DesignEditor, Tn as default, At as DisplaySettingsDrawer, fn as EditorProviders, Pn as FilesDialog, mn as FloatDesignEditor,
|
|
3650
|
+
export { kt as AppSettingsSections, Rt as BRAND, Tn as DesignEditor, Tn as default, At as DisplaySettingsDrawer, fn as EditorProviders, Pn as FilesDialog, mn as FloatDesignEditor, ia as FloatLabsView, ze as GeneratorLibraryProvider, Pi as LABS_DRAFT_KEY, Ve as LIBRARY_SLOT_KEYS, Fi as LabsView, Yt as MODES, $i as MobileView, Xt as OutputCanvas, $t as OutputStage, vn as OutputView, Jt as RAIL_EXTRA_PREFIX, pt as TimelineRail, We as UnauthorizedError, On as VIEW_PATHS, Tt as closeFiles, Lt as comboLabel, xn as copyStored, Zt as currentView, on as duplicateStored, Pe as getLibraryApi, je as inviteFromRequest, hn as isMobileDevice, Ee as listInviteRequests, Be as loadLibrary, Ue as mintInvite, Ot as openFiles, Ie as readLibraryRaw, d as registerPack, Gt as removeStored, gn as renameStored, Me as requestInvite, Oe as setLibraryApi, It as setMediaClient, xt as setMediaProxyBase, an as setMode, Wt as setNavigator, un as setRailExtras, x as setSettingsStore, Cn as setThumbStored, sn as setWantsDesktop, Ct as shortcutsBySection, De as signInLibrary, Ae as signOutLibrary, Re as signUpLibrary, Ne as subscribeLibrary, mt as timelineView, Te as updateAccount, Le as useAccount, Pt as useFilesDialog, He as useGeneratorLibrary, ke as useLibrarySession, Dn as useRailExtras, Mt as useSettingsSections, wn as wantsDesktop, An as withView };
|