@kolkrabbi/design-editor 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BindDot-CaZu6Uuz.js → BindDot-Don6fG00.js} +5 -5
- package/dist/{Timeline-BxVRu-R0.js → Timeline-BKYyRqYg.js} +2 -2
- package/dist/{TreePicker-BQYPaQv3.js → TreePicker-1_NZG8GB.js} +1 -1
- package/dist/{core-CLlanqLg.js → core-DBXPNsjJ.js} +5422 -6412
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +1060 -714
- package/dist/{effectCategories-DJrQJ7vg.js → effectCategories-BGIW_dEc.js} +438 -438
- package/dist/{effects-dbxBWOCp.js → effects-RqPdJrRb.js} +115 -115
- package/dist/effects.js +1 -1
- package/dist/generators-BnuRmK-x.js +11148 -0
- package/dist/generators.js +1 -1
- package/dist/{host-DBTmkJuu.js → host-BUVR9I4S.js} +1 -1
- package/dist/{host-DXizGh-A.js → host-DJ8bDKO7.js} +4 -4
- package/dist/{morphStore-DaOLa9oj.js → morphStore-B5081ohW.js} +1 -1
- package/dist/{motion-CeoqVj9I.js → motion-DKZGyk14.js} +285 -285
- package/dist/motion.js +1 -1
- package/dist/{previewScale-DsG-A1ZC.js → previewScale-CA0ComGv.js} +8 -8
- package/dist/{rolls-CGma4Bua.js → rolls-CEQmdcp3.js} +865 -300
- package/dist/{src-CMdJeS6j.js → src-CzKMsyZO.js} +1 -1
- package/dist/{ColorModesWindow-D65R5YR5.js → store-D6Si8cRD.js} +407 -369
- package/dist/{useLayerEdit-CnPxtfWc.js → useLayerEdit-BF9wI5pX.js} +4 -4
- package/package.json +8 -8
- package/dist/generators-CQQxNX9W.js +0 -3200
package/dist/design-editor.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as A, r as j, t as te } from "./useLayerEdit-
|
|
3
|
-
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-
|
|
4
|
-
import { r as ue } from "./TreePicker-
|
|
5
|
-
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-
|
|
6
|
-
import {
|
|
7
|
-
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-
|
|
8
|
-
import { n as rt, r as it, t as at } from "./BindDot-
|
|
9
|
-
import { n as ot, r as st } from "./effects-
|
|
10
|
-
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-
|
|
11
|
-
import { n as pt, r as mt, t as ht } from "./Timeline-
|
|
12
|
-
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut,
|
|
13
|
-
import { Button as K, Divider as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { Icon as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
1
|
+
import { An as e, B as t, Bn as n, D as r, F as i, I as a, J as o, L as s, Lt as c, Mn as l, P as u, Vn as d, _n as f, a as p, d as m, f as h, ft as g, gt as _, ht as v, i as y, j as b, jn as x, kn as S, mn as C, n as w, nn as T, o as E, p as D, pn as O, r as ee, vn as k } from "./rolls-CEQmdcp3.js";
|
|
2
|
+
import { n as A, r as j, t as te } from "./useLayerEdit-BF9wI5pX.js";
|
|
3
|
+
import { C as M, D as ne, E as N, _ as P, a as F, c as I, d as re, f as L, g as R, i as ie, l as ae, m as z, n as B, r as oe, t as se, u as ce, v as V, w as H, x as U, y as le } from "./effectCategories-BGIW_dEc.js";
|
|
4
|
+
import { r as ue } from "./TreePicker-1_NZG8GB.js";
|
|
5
|
+
import { _ as de, a as W, b as fe, f as pe, g as me, h as he, i as ge, m as _e, n as ve, o as ye, p as be, r as xe, s as Se, v as Ce, y as we } from "./generators-BnuRmK-x.js";
|
|
6
|
+
import { A as Te, C as Ee, D as De, E as Oe, M as ke, O as Ae, S as je, T as Me, _ as Ne, b as Pe, c as Fe, h as Ie, j as Le, k as Re, l as ze, m as Be, u as Ve, v as He, w as Ue, y as We } from "./store-D6Si8cRD.js";
|
|
7
|
+
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-B5081ohW.js";
|
|
8
|
+
import { n as rt, r as it, t as at } from "./BindDot-Don6fG00.js";
|
|
9
|
+
import { n as ot, r as st } from "./effects-RqPdJrRb.js";
|
|
10
|
+
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-DKZGyk14.js";
|
|
11
|
+
import { n as pt, r as mt, t as ht } from "./Timeline-BKYyRqYg.js";
|
|
12
|
+
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, _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-DBXPNsjJ.js";
|
|
13
|
+
import { Button as K, Divider as Fn, Dropdown as In, LabeledControlSection as q, MultiSelect as Ln, NavRail as Rn, SegmentedToggle as J, SettingsRow as zn, StepList as Bn, Tag as Vn, ToggleSwitch as Hn, Tooltip as Un, useGrabEdge as Wn, useMediaQuery as Gn, useModal as Kn } from "@kolkrabbi/kol-component";
|
|
14
|
+
import { createContext as qn, useContext as Jn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Yn } from "react";
|
|
15
|
+
import { Fragment as Xn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
16
|
+
import { Icon as Zn } from "@kolkrabbi/kol-icons";
|
|
17
|
+
import { AppFloatNav as Qn, Breadcrumb as $n, DocumentCapsule as er, GlobalActions as tr, MenuBar as nr, PropertyRail as rr, RailFlyout as ir } from "@kolkrabbi/kol-shell";
|
|
18
|
+
import { useDragResize as ar, useTheme as or } from "@kolkrabbi/kol-framework";
|
|
19
|
+
import { createPortal as sr } from "react-dom";
|
|
19
20
|
//#region src/phoneFloats.js
|
|
20
|
-
var
|
|
21
|
+
var cr = (e) => {
|
|
21
22
|
let t = e, n = /* @__PURE__ */ new Set(), r = (e) => (n.add(e), () => n.delete(e));
|
|
22
23
|
return {
|
|
23
24
|
set: (e) => {
|
|
24
25
|
e !== t && (t = e, n.forEach((e) => e()));
|
|
25
26
|
},
|
|
26
|
-
use: () =>
|
|
27
|
+
use: () => Yn(r, () => t, () => t)
|
|
27
28
|
};
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
var
|
|
29
|
+
}, lr = cr(null), ur = cr(null), dr = lr.set;
|
|
30
|
+
lr.use, ur.set;
|
|
31
|
+
var fr = ur.use, pr = [
|
|
31
32
|
{
|
|
32
33
|
id: "shape",
|
|
33
34
|
label: "Shape",
|
|
@@ -43,7 +44,7 @@ var Qn = Xn.use, $n = [
|
|
|
43
44
|
label: "Crossfade",
|
|
44
45
|
icon: "dashed-circle"
|
|
45
46
|
}
|
|
46
|
-
],
|
|
47
|
+
], mr = {
|
|
47
48
|
shape: [
|
|
48
49
|
["Loops", ["morph-circle", "star-morph"]],
|
|
49
50
|
["Loops", [
|
|
@@ -117,21 +118,21 @@ var Qn = Xn.use, $n = [
|
|
|
117
118
|
2
|
|
118
119
|
]
|
|
119
120
|
]
|
|
120
|
-
},
|
|
121
|
-
function
|
|
122
|
-
if (!
|
|
123
|
-
|
|
121
|
+
}, hr = null;
|
|
122
|
+
function gr(e) {
|
|
123
|
+
if (!hr) {
|
|
124
|
+
hr = /* @__PURE__ */ new Map();
|
|
124
125
|
let e = /* @__PURE__ */ new Set();
|
|
125
|
-
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id),
|
|
126
|
+
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id), hr.has(n.loop) || hr.set(n.loop, []), hr.get(n.loop).push(n));
|
|
126
127
|
}
|
|
127
|
-
return
|
|
128
|
+
return hr.get(e) ?? [];
|
|
128
129
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
130
|
+
var _r = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), vr = null;
|
|
131
|
+
function yr() {
|
|
132
|
+
if (vr) return vr;
|
|
132
133
|
let e = [];
|
|
133
|
-
for (let t of
|
|
134
|
-
let [r] = n, i = t.id === "blend" ?
|
|
134
|
+
for (let t of pr) for (let n of mr[t.id]) {
|
|
135
|
+
let [r] = n, i = t.id === "blend" ? _r(gr(n[1]), n[2]) : n[1].map((e) => gr(e)[0]);
|
|
135
136
|
if (!i || i.some((e) => !e) || new Set(i.map((e) => e.id)).size < i.length) continue;
|
|
136
137
|
let a = i.map((e) => e.label).join(" → "), o = `ship:morph:${t.id}:${i.map((e) => e.id).join("--")}`;
|
|
137
138
|
e.push({
|
|
@@ -154,24 +155,24 @@ function ar() {
|
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
|
-
return
|
|
158
|
+
return vr = e;
|
|
158
159
|
}
|
|
159
|
-
var
|
|
160
|
+
var br = () => pr.map((e) => ({
|
|
160
161
|
label: e.label,
|
|
161
|
-
subs: [...new Set(
|
|
162
|
-
})),
|
|
163
|
-
function
|
|
162
|
+
subs: [...new Set(yr().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
163
|
+
})), xr = (e, t) => yr().find((n) => n.type === e && (!t || n.category === t)), Sr = (e) => yr().find((t) => t.id === e);
|
|
164
|
+
function Cr(e) {
|
|
164
165
|
e && (Qe({
|
|
165
166
|
active: !0,
|
|
166
167
|
...e.morph,
|
|
167
168
|
fileId: null,
|
|
168
169
|
fileName: e.label,
|
|
169
170
|
presetId: e.id
|
|
170
|
-
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) ||
|
|
171
|
+
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || pn("/morph"));
|
|
171
172
|
}
|
|
172
173
|
//#endregion
|
|
173
174
|
//#region src/editor/labs/catalog.js
|
|
174
|
-
var
|
|
175
|
+
var wr = {
|
|
175
176
|
"fx:halftone": "ptrn-dot",
|
|
176
177
|
"fx:scanline": "grid-horizontal",
|
|
177
178
|
"fx:crt": "desktop",
|
|
@@ -195,19 +196,19 @@ var ur = {
|
|
|
195
196
|
"misc:Para Type": "aa",
|
|
196
197
|
"vec:Distressor": "scribble",
|
|
197
198
|
"vec:Modulator": "dashed-circle"
|
|
198
|
-
},
|
|
199
|
+
}, Tr = {
|
|
199
200
|
effects: "filter",
|
|
200
201
|
generative: "layers",
|
|
201
202
|
vector: "pen-nib",
|
|
202
203
|
composition: "type",
|
|
203
204
|
morph: "swap",
|
|
204
205
|
mode: "mode-toggle-01"
|
|
205
|
-
},
|
|
206
|
+
}, Er = [
|
|
206
207
|
"Moiré",
|
|
207
208
|
"Mesh Gradient",
|
|
208
209
|
"Reaction",
|
|
209
210
|
"Halftone"
|
|
210
|
-
],
|
|
211
|
+
], Dr = [
|
|
211
212
|
{
|
|
212
213
|
label: "Spaced",
|
|
213
214
|
patch: {
|
|
@@ -239,11 +240,11 @@ var ur = {
|
|
|
239
240
|
label: "Spiral",
|
|
240
241
|
patch: { geometry: "spiral" }
|
|
241
242
|
}
|
|
242
|
-
],
|
|
243
|
+
], Or = (e = {}) => {
|
|
243
244
|
let t = e.geometry ?? "rows";
|
|
244
245
|
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
245
246
|
};
|
|
246
|
-
function
|
|
247
|
+
function kr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
247
248
|
let a = () => e?.type === "photo" ? (e.filters ?? []).filter((e) => e?.id === "fx-media") : [], o = (e, o) => {
|
|
248
249
|
let s = a(), c = t("photo", {
|
|
249
250
|
...i(),
|
|
@@ -290,7 +291,7 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
290
291
|
id: "color",
|
|
291
292
|
label: "Color",
|
|
292
293
|
icon: "clr-tri",
|
|
293
|
-
onSelect:
|
|
294
|
+
onSelect: Fe,
|
|
294
295
|
pages: []
|
|
295
296
|
},
|
|
296
297
|
{
|
|
@@ -300,19 +301,19 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
300
301
|
...oe(L).map((t) => ({
|
|
301
302
|
id: `fx:${t.id}`,
|
|
302
303
|
label: t.label,
|
|
303
|
-
icon:
|
|
304
|
+
icon: wr[`fx:${t.id}`] ?? "square",
|
|
304
305
|
pages: t.rack ? se.map((t) => ({
|
|
305
306
|
label: t.label,
|
|
306
307
|
onSelect: () => s(t.id),
|
|
307
308
|
active: e?.fxGroup === t.id
|
|
308
|
-
})) : t.id === "pattern" ?
|
|
309
|
+
})) : t.id === "pattern" ? Er.map((t) => ({
|
|
309
310
|
label: t,
|
|
310
311
|
onSelect: () => c(ne("optic", t)[0], "optic"),
|
|
311
312
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
312
|
-
})) : t.id === "scanline" ?
|
|
313
|
+
})) : t.id === "scanline" ? Dr.map((t) => ({
|
|
313
314
|
label: t.label,
|
|
314
315
|
onSelect: () => o("scanline", t.patch),
|
|
315
|
-
active: !e?.fxGroup && d === "scanline" &&
|
|
316
|
+
active: !e?.fxGroup && d === "scanline" && Or((e?.filters ?? []).find((e) => e?.id === "scanline")?.params) === t.label
|
|
316
317
|
})) : t.filters.map((t) => ({
|
|
317
318
|
label: t.label ?? t.id,
|
|
318
319
|
onSelect: () => o(t.id),
|
|
@@ -326,22 +327,22 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
326
327
|
...we.map((e) => ({
|
|
327
328
|
id: `gen:${e.label}`,
|
|
328
329
|
label: e.label,
|
|
329
|
-
icon:
|
|
330
|
+
icon: wr[`gen:${e.label}`] ?? "square",
|
|
330
331
|
pages: m(e)
|
|
331
332
|
})),
|
|
332
333
|
{
|
|
333
334
|
id: "sec:morph",
|
|
334
335
|
label: "Morph"
|
|
335
336
|
},
|
|
336
|
-
|
|
337
|
+
...pr.map((e) => ({
|
|
337
338
|
id: `morph:${e.id}`,
|
|
338
339
|
label: e.label,
|
|
339
340
|
icon: e.icon,
|
|
340
|
-
pages: [...new Set(
|
|
341
|
+
pages: [...new Set(yr().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
341
342
|
label: t,
|
|
342
|
-
onSelect: () =>
|
|
343
|
+
onSelect: () => Cr(xr(e.id, t)),
|
|
343
344
|
active: (() => {
|
|
344
|
-
let n =
|
|
345
|
+
let n = yr().find((e) => e.id === Ze().presetId);
|
|
345
346
|
return n?.type === e.id && n.category === t;
|
|
346
347
|
})()
|
|
347
348
|
}))
|
|
@@ -353,13 +354,13 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
353
354
|
{
|
|
354
355
|
id: "vec:Distressor",
|
|
355
356
|
label: "Distressor",
|
|
356
|
-
icon:
|
|
357
|
+
icon: wr["vec:Distressor"] ?? "square",
|
|
357
358
|
pages: p("distress")
|
|
358
359
|
},
|
|
359
360
|
{
|
|
360
361
|
id: "vec:Modulator",
|
|
361
362
|
label: "Modulator",
|
|
362
|
-
icon:
|
|
363
|
+
icon: wr["vec:Modulator"] ?? "square",
|
|
363
364
|
pages: p("modulator")
|
|
364
365
|
},
|
|
365
366
|
{
|
|
@@ -369,7 +370,7 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
369
370
|
...ct.map((t) => ({
|
|
370
371
|
id: `kin:${t.label}`,
|
|
371
372
|
label: t.label,
|
|
372
|
-
icon:
|
|
373
|
+
icon: wr[`kin:${t.label}`] ?? "square",
|
|
373
374
|
pages: t.subs.map((t) => ({
|
|
374
375
|
label: t,
|
|
375
376
|
onSelect: () => l(lt.find((e) => e.sub === t)),
|
|
@@ -379,17 +380,17 @@ function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
379
380
|
...fe.map((e) => ({
|
|
380
381
|
id: `misc:${e.label}`,
|
|
381
382
|
label: e.label,
|
|
382
|
-
icon:
|
|
383
|
+
icon: wr[`misc:${e.label}`] ?? "square",
|
|
383
384
|
pages: e.groups.flatMap((e) => p(e, "misc"))
|
|
384
385
|
}))
|
|
385
386
|
];
|
|
386
387
|
}
|
|
387
388
|
//#endregion
|
|
388
389
|
//#region src/editor/labs/LabsNav.jsx
|
|
389
|
-
function
|
|
390
|
-
let { addFilter: e, patchFilter: t } =
|
|
390
|
+
function Ar() {
|
|
391
|
+
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
391
392
|
Y(() => {
|
|
392
|
-
n?.type === "photo" && n.src && (
|
|
393
|
+
n?.type === "photo" && n.src && (i.current = {
|
|
393
394
|
src: n.src,
|
|
394
395
|
srcType: n.srcType,
|
|
395
396
|
fit: n.fit
|
|
@@ -400,7 +401,7 @@ function gr() {
|
|
|
400
401
|
n?.srcType,
|
|
401
402
|
n?.fit
|
|
402
403
|
]);
|
|
403
|
-
let
|
|
404
|
+
let a = kr({
|
|
404
405
|
layer: n,
|
|
405
406
|
setOnly: r,
|
|
406
407
|
addFilter: e,
|
|
@@ -409,22 +410,22 @@ function gr() {
|
|
|
409
410
|
src: n.src,
|
|
410
411
|
srcType: n.srcType,
|
|
411
412
|
fit: n.fit
|
|
412
|
-
} :
|
|
413
|
+
} : i.current ?? {}
|
|
413
414
|
});
|
|
414
415
|
return Y(() => {
|
|
415
416
|
let e = /* @__PURE__ */ new Map(), t = [];
|
|
416
|
-
return
|
|
417
|
+
return a.forEach((n) => {
|
|
417
418
|
if (n.id.startsWith("sec:")) {
|
|
418
419
|
let e = n.id.slice(4);
|
|
419
420
|
t.push({
|
|
420
|
-
icon:
|
|
421
|
-
path: `${
|
|
421
|
+
icon: Tr[e] ?? "square",
|
|
422
|
+
path: `${Jt}${n.id}`,
|
|
422
423
|
label: n.label,
|
|
423
424
|
sub: []
|
|
424
425
|
});
|
|
425
426
|
return;
|
|
426
427
|
}
|
|
427
|
-
let r = `${
|
|
428
|
+
let r = `${Jt}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
428
429
|
a && e.set(r, a);
|
|
429
430
|
let o = t[t.length - 1], s = {
|
|
430
431
|
icon: n.icon,
|
|
@@ -432,18 +433,18 @@ function gr() {
|
|
|
432
433
|
label: n.label
|
|
433
434
|
};
|
|
434
435
|
o?.sub ? o.sub.push(s) : t.push(s);
|
|
435
|
-
}),
|
|
436
|
+
}), un({
|
|
436
437
|
items: t,
|
|
437
438
|
dispatch: (t) => {
|
|
438
439
|
let n = e.get(t);
|
|
439
440
|
return n ? (n(), !0) : !1;
|
|
440
441
|
}
|
|
441
|
-
}), () =>
|
|
442
|
+
}), () => un(null);
|
|
442
443
|
}), null;
|
|
443
444
|
}
|
|
444
445
|
//#endregion
|
|
445
446
|
//#region src/editor/morph/MorphTab.jsx
|
|
446
|
-
var
|
|
447
|
+
var jr = (e, t) => JSON.stringify(e) === JSON.stringify(t), Mr = [
|
|
447
448
|
{
|
|
448
449
|
key: "curve",
|
|
449
450
|
label: "Curve",
|
|
@@ -476,8 +477,8 @@ var _r = (e, t) => JSON.stringify(e) === JSON.stringify(t), vr = [
|
|
|
476
477
|
when: (e) => e.mode === "shape"
|
|
477
478
|
}
|
|
478
479
|
];
|
|
479
|
-
function
|
|
480
|
-
let
|
|
480
|
+
function Nr({ 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 = Kn(), D = f(), ee = te(e?.id ?? null, { history: "coalesce" }), [k, j] = Z("generate"), M = c[0], ne = c.every((e) => e.loopId === M?.loopId), N = c.filter((e) => !Bt(U(e.loopId)) || !Vt(U(e.loopId))), P = N.length === 0, F = {
|
|
481
482
|
blend: ne ? null : "Blend tweens one generator — these steps are different generators",
|
|
482
483
|
shape: P ? null : `No outline to morph: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`,
|
|
483
484
|
crossfade: P ? null : `Cannot fade: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`
|
|
@@ -556,9 +557,9 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
556
557
|
cycle: u,
|
|
557
558
|
curve: l,
|
|
558
559
|
resolution: p,
|
|
559
|
-
syncLoop:
|
|
560
|
-
name:
|
|
561
|
-
},
|
|
560
|
+
syncLoop: i.syncLoop,
|
|
561
|
+
name: i.fileName
|
|
562
|
+
}, a = d === "blend" ? {
|
|
562
563
|
...n,
|
|
563
564
|
...$e({
|
|
564
565
|
snapshots: c.map((e) => e.params),
|
|
@@ -574,10 +575,10 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
574
575
|
morph: r,
|
|
575
576
|
morphT: {
|
|
576
577
|
bind: "track",
|
|
577
|
-
keys:
|
|
578
|
+
keys: Ht(c.length, u, l)
|
|
578
579
|
}
|
|
579
580
|
};
|
|
580
|
-
e ? _(e.id,
|
|
581
|
+
e ? _(e.id, a) : S("loop", a);
|
|
581
582
|
}, R = X(L);
|
|
582
583
|
R.current = L;
|
|
583
584
|
let ie = JSON.stringify([
|
|
@@ -586,7 +587,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
586
587
|
l,
|
|
587
588
|
u,
|
|
588
589
|
p,
|
|
589
|
-
|
|
590
|
+
i.syncLoop
|
|
590
591
|
]), ae = X(null);
|
|
591
592
|
Y(() => {
|
|
592
593
|
t || m != null || ie === ae.current || c.length >= 2 && F[d] || (ae.current = ie, R.current());
|
|
@@ -598,7 +599,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
598
599
|
]), Y(() => {
|
|
599
600
|
if (t || m == null || !e) return;
|
|
600
601
|
let n = et(e, U(e.loopId)?.params ?? []);
|
|
601
|
-
|
|
602
|
+
jr(n, c[m]?.params) || Xe(m, n);
|
|
602
603
|
}, [e]), Y(() => {
|
|
603
604
|
t || !D || m == null || (G({ editing: null }), ae.current = null);
|
|
604
605
|
}, [
|
|
@@ -606,7 +607,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
606
607
|
m,
|
|
607
608
|
t
|
|
608
609
|
]), Y(() => () => {
|
|
609
|
-
!t &&
|
|
610
|
+
!t && i.editing != null && (G({ editing: null }), R.current());
|
|
610
611
|
}, []);
|
|
611
612
|
let z = (e) => {
|
|
612
613
|
let t = c[e];
|
|
@@ -630,23 +631,23 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
630
631
|
value: d,
|
|
631
632
|
onChange: (e) => !t && G({ mode: e }),
|
|
632
633
|
options: I,
|
|
633
|
-
size:
|
|
634
|
-
className: r
|
|
634
|
+
size: r,
|
|
635
|
+
className: a(r)
|
|
635
636
|
}),
|
|
636
637
|
!t && /* @__PURE__ */ Q(q, {
|
|
637
638
|
divided: !0,
|
|
638
639
|
children: /* @__PURE__ */ Q(ue, {
|
|
639
|
-
tree:
|
|
640
|
-
presets:
|
|
641
|
-
current:
|
|
640
|
+
tree: br(),
|
|
641
|
+
presets: yr(),
|
|
642
|
+
current: Sr(i.presetId) ?? { typeLabel: pr.find((e) => e.id === d)?.label },
|
|
642
643
|
subLabel: (e) => e.split(" · ").pop(),
|
|
643
|
-
onPick:
|
|
644
|
+
onPick: Cr
|
|
644
645
|
})
|
|
645
646
|
}),
|
|
646
647
|
/* @__PURE__ */ $(q, {
|
|
647
648
|
divided: !0,
|
|
648
649
|
children: [
|
|
649
|
-
/* @__PURE__ */ Q(
|
|
650
|
+
/* @__PURE__ */ Q(Bn, {
|
|
650
651
|
items: c.map((e, t) => ({
|
|
651
652
|
id: t,
|
|
652
653
|
label: Ke(e, t)
|
|
@@ -654,7 +655,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
654
655
|
activeIndex: m,
|
|
655
656
|
reorder: "grab",
|
|
656
657
|
readOnly: t,
|
|
657
|
-
size:
|
|
658
|
+
size: r,
|
|
658
659
|
onSelect: z,
|
|
659
660
|
onRemove: Ye,
|
|
660
661
|
onMove: Ge,
|
|
@@ -683,8 +684,8 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
683
684
|
value: k,
|
|
684
685
|
onChange: j,
|
|
685
686
|
options: n,
|
|
686
|
-
size:
|
|
687
|
-
className: r
|
|
687
|
+
size: r,
|
|
688
|
+
className: a(r)
|
|
688
689
|
}),
|
|
689
690
|
/* @__PURE__ */ Q(ye, {
|
|
690
691
|
layer: e,
|
|
@@ -708,8 +709,8 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
708
709
|
]
|
|
709
710
|
}),
|
|
710
711
|
/* @__PURE__ */ Q(A, {
|
|
711
|
-
schema:
|
|
712
|
-
layer:
|
|
712
|
+
schema: Mr,
|
|
713
|
+
layer: i,
|
|
713
714
|
setProp: (e, n) => {
|
|
714
715
|
!t && (typeof n != "object" || !n) && G({ [e]: n });
|
|
715
716
|
},
|
|
@@ -719,11 +720,11 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
719
720
|
divided: !0,
|
|
720
721
|
children: /* @__PURE__ */ Q(K, {
|
|
721
722
|
tone: "primary",
|
|
722
|
-
size:
|
|
723
|
+
size: r,
|
|
723
724
|
className: "w-full",
|
|
724
725
|
onClick: async () => {
|
|
725
726
|
if (c.length < 2) return;
|
|
726
|
-
let e =
|
|
727
|
+
let e = i.fileName;
|
|
727
728
|
if (!h && (e = await E.prompt("Name this morph:", ""), e === null)) return;
|
|
728
729
|
m != null && (G({ editing: null }), R.current());
|
|
729
730
|
let t = {
|
|
@@ -731,12 +732,12 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
731
732
|
mode: "morph",
|
|
732
733
|
morph: {
|
|
733
734
|
mode: d,
|
|
734
|
-
loopId:
|
|
735
|
+
loopId: i.loopId,
|
|
735
736
|
steps: c,
|
|
736
737
|
curve: l,
|
|
737
738
|
cycle: u,
|
|
738
739
|
resolution: p,
|
|
739
|
-
syncLoop:
|
|
740
|
+
syncLoop: i.syncLoop,
|
|
740
741
|
seconds: O.getLoopSeconds()
|
|
741
742
|
}
|
|
742
743
|
};
|
|
@@ -758,7 +759,7 @@ function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
758
759
|
}
|
|
759
760
|
//#endregion
|
|
760
761
|
//#region src/editor/params/QuickMotion.jsx
|
|
761
|
-
var
|
|
762
|
+
var Pr = [
|
|
762
763
|
{
|
|
763
764
|
value: "breathe",
|
|
764
765
|
label: "Breathe",
|
|
@@ -777,27 +778,27 @@ var br = [
|
|
|
777
778
|
source: "lfo-square",
|
|
778
779
|
rate: 8
|
|
779
780
|
}
|
|
780
|
-
],
|
|
781
|
-
function
|
|
782
|
-
if (!
|
|
781
|
+
], Fr = .2;
|
|
782
|
+
function Ir(e) {
|
|
783
|
+
if (!r(e)) return "off";
|
|
783
784
|
if (e.bind !== "mod") return "custom";
|
|
784
|
-
let
|
|
785
|
-
return
|
|
785
|
+
let t = Pr.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
786
|
+
return t ? t.value : "custom";
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
-
let
|
|
789
|
-
if (!
|
|
790
|
-
let c = (e,
|
|
788
|
+
function Lr({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
789
|
+
let a = s(), o = _(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && v(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
790
|
+
if (!o.length) return null;
|
|
791
|
+
let c = (e, r) => {
|
|
791
792
|
let i = t[e.key];
|
|
792
|
-
if (
|
|
793
|
-
let
|
|
794
|
-
|
|
793
|
+
if (r === "off") {
|
|
794
|
+
let r = i?.transform?.range;
|
|
795
|
+
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : b(i, O.getCtx(), t) ?? e.default ?? e.min);
|
|
795
796
|
return;
|
|
796
797
|
}
|
|
797
|
-
let a =
|
|
798
|
+
let a = Pr.find((e) => e.value === r);
|
|
798
799
|
if (!a) return;
|
|
799
|
-
let o = Number(
|
|
800
|
-
|
|
800
|
+
let o = Number(b(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) * Fr, c = Math.max(e.min, o - s), l = Math.min(e.max, o + s);
|
|
801
|
+
n(e.key, {
|
|
801
802
|
bind: "mod",
|
|
802
803
|
source: a.source,
|
|
803
804
|
transform: {
|
|
@@ -807,33 +808,33 @@ function Cr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
807
808
|
});
|
|
808
809
|
};
|
|
809
810
|
return /* @__PURE__ */ Q(q, {
|
|
810
|
-
label:
|
|
811
|
+
label: r,
|
|
811
812
|
divided: !0,
|
|
812
|
-
children:
|
|
813
|
-
let
|
|
813
|
+
children: o.map((e) => {
|
|
814
|
+
let n = Ir(t[e.key]), r = [
|
|
814
815
|
{
|
|
815
816
|
value: "off",
|
|
816
817
|
label: "Off"
|
|
817
818
|
},
|
|
818
|
-
...
|
|
819
|
+
...Pr.map(({ value: e, label: t }) => ({
|
|
819
820
|
value: e,
|
|
820
821
|
label: t
|
|
821
822
|
})),
|
|
822
|
-
...
|
|
823
|
+
...n === "custom" ? [{
|
|
823
824
|
value: "custom",
|
|
824
825
|
label: "Custom"
|
|
825
826
|
}] : []
|
|
826
827
|
];
|
|
827
|
-
return /* @__PURE__ */ Q(
|
|
828
|
+
return /* @__PURE__ */ Q(zn, {
|
|
828
829
|
label: e.label,
|
|
829
830
|
align: "fill",
|
|
830
|
-
labelWidth:
|
|
831
|
-
children: /* @__PURE__ */ Q(
|
|
832
|
-
size:
|
|
831
|
+
labelWidth: i,
|
|
832
|
+
children: /* @__PURE__ */ Q(In, {
|
|
833
|
+
size: a,
|
|
833
834
|
variant: "subtle",
|
|
834
835
|
className: "w-full",
|
|
835
|
-
options:
|
|
836
|
-
value:
|
|
836
|
+
options: r,
|
|
837
|
+
value: n,
|
|
837
838
|
onChange: (t) => t !== "custom" && c(e, t)
|
|
838
839
|
})
|
|
839
840
|
}, e.key);
|
|
@@ -842,7 +843,7 @@ function Cr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
842
843
|
}
|
|
843
844
|
//#endregion
|
|
844
845
|
//#region src/editor/params/InputRows.jsx
|
|
845
|
-
var
|
|
846
|
+
var Rr = [
|
|
846
847
|
{
|
|
847
848
|
value: "off",
|
|
848
849
|
label: "Off"
|
|
@@ -867,19 +868,19 @@ var wr = [
|
|
|
867
868
|
value: "lfo-sine",
|
|
868
869
|
label: "LFO"
|
|
869
870
|
}
|
|
870
|
-
],
|
|
871
|
-
function
|
|
872
|
-
let
|
|
873
|
-
if (!
|
|
874
|
-
let c = new Map(
|
|
875
|
-
let
|
|
876
|
-
return
|
|
871
|
+
], zr = new Set(Rr.map((e) => e.value));
|
|
872
|
+
function Br({ schema: e, layer: t, setProp: n, inputs: i = null }) {
|
|
873
|
+
let a = s(), o = _(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
874
|
+
if (!o.length) return null;
|
|
875
|
+
let c = new Map(o.map((e) => [e.key, e])), l = (i ?? []).filter((e) => c.has(e)), u = [...l, ...o.map((e) => e.key).filter((e) => !l.includes(e))], d = l.length ? l : u.slice(0, 3), f = (e) => {
|
|
876
|
+
let n = t[e];
|
|
877
|
+
return r(n) && n.bind === "mod" && zr.has(n.source);
|
|
877
878
|
}, p = u.filter(f), m = (e) => {
|
|
878
|
-
let
|
|
879
|
-
return Number(
|
|
880
|
-
}, h = (e, i, a = t
|
|
879
|
+
let n = c.get(e);
|
|
880
|
+
return Number(b(t[e], O.getCtx(), t) ?? n.default ?? n.min);
|
|
881
|
+
}, h = (e, i, a = r(t[e]) ? t[e].transform?.base ?? m(e) : m(e)) => {
|
|
881
882
|
let o = c.get(e);
|
|
882
|
-
|
|
883
|
+
k(i)?.ensure?.().catch(() => {}), n(e, {
|
|
883
884
|
bind: "mod",
|
|
884
885
|
source: i,
|
|
885
886
|
transform: {
|
|
@@ -888,17 +889,17 @@ function Er({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
888
889
|
...i.startsWith("lfo") ? { rate: 1 } : {}
|
|
889
890
|
}
|
|
890
891
|
});
|
|
891
|
-
}, g = (e) =>
|
|
892
|
+
}, g = (e) => n(e, r(t[e]) ? t[e].transform?.base ?? m(e) : m(e)), v = d.find((e) => !f(e)) ?? u.find((e) => !f(e));
|
|
892
893
|
return /* @__PURE__ */ $(q, {
|
|
893
894
|
label: "Inputs",
|
|
894
895
|
divided: !0,
|
|
895
|
-
children: [p.map((e) => /* @__PURE__ */ Q(
|
|
896
|
-
size:
|
|
896
|
+
children: [p.map((e) => /* @__PURE__ */ Q(Ln, {
|
|
897
|
+
size: a,
|
|
897
898
|
className: "w-full [&>button]:w-full",
|
|
898
899
|
groups: [{
|
|
899
900
|
id: "source",
|
|
900
901
|
label: "Source",
|
|
901
|
-
options:
|
|
902
|
+
options: Rr
|
|
902
903
|
}, {
|
|
903
904
|
id: "drives",
|
|
904
905
|
label: "Drives",
|
|
@@ -908,33 +909,33 @@ function Er({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
908
909
|
}))
|
|
909
910
|
}],
|
|
910
911
|
value: {
|
|
911
|
-
source:
|
|
912
|
+
source: t[e].source,
|
|
912
913
|
drives: e
|
|
913
914
|
},
|
|
914
|
-
label: `${
|
|
915
|
-
onChange: (
|
|
916
|
-
if (
|
|
915
|
+
label: `${Rr.find((n) => n.value === t[e].source)?.label} → ${c.get(e).label}`,
|
|
916
|
+
onChange: (n, r) => {
|
|
917
|
+
if (n === "source") {
|
|
917
918
|
r === "off" ? g(e) : h(e, r);
|
|
918
919
|
return;
|
|
919
920
|
}
|
|
920
921
|
if (r === e || f(r)) return;
|
|
921
|
-
let i =
|
|
922
|
+
let i = t[e].source;
|
|
922
923
|
g(e), h(r, i);
|
|
923
924
|
}
|
|
924
|
-
}, e)),
|
|
925
|
-
size:
|
|
925
|
+
}, e)), v && /* @__PURE__ */ Q(K, {
|
|
926
|
+
size: a,
|
|
926
927
|
iconLeft: "plus",
|
|
927
928
|
className: "w-full",
|
|
928
|
-
onClick: () => h(
|
|
929
|
+
onClick: () => h(v, "mouseX"),
|
|
929
930
|
children: "Add input"
|
|
930
931
|
})]
|
|
931
932
|
});
|
|
932
933
|
}
|
|
933
934
|
//#endregion
|
|
934
935
|
//#region src/editor/labs/ModelSource.jsx
|
|
935
|
-
var
|
|
936
|
-
function
|
|
937
|
-
let n =
|
|
936
|
+
var Vr = /\.(obj|glb|gltf|stl)$/i, Hr = (e) => Vr.test(e.key ?? e.name ?? ""), Ur = (e) => (e.match(Vr)?.[1] ?? "obj").toLowerCase(), Wr = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
937
|
+
function Gr({ layer: e, setProp: t }) {
|
|
938
|
+
let n = s(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
938
939
|
t("meshSrc", e), t("meshType", n);
|
|
939
940
|
};
|
|
940
941
|
return /* @__PURE__ */ $(q, {
|
|
@@ -943,7 +944,7 @@ function jr({ layer: e, setProp: t }) {
|
|
|
943
944
|
children: [
|
|
944
945
|
/* @__PURE__ */ Q("span", {
|
|
945
946
|
className: "kol-mono-12 text-meta truncate",
|
|
946
|
-
children:
|
|
947
|
+
children: Wr(e.meshSrc)
|
|
947
948
|
}),
|
|
948
949
|
/* @__PURE__ */ $("div", {
|
|
949
950
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -955,12 +956,12 @@ function jr({ layer: e, setProp: t }) {
|
|
|
955
956
|
}), /* @__PURE__ */ Q(K, {
|
|
956
957
|
tone: "primary",
|
|
957
958
|
size: n,
|
|
958
|
-
onClick: () =>
|
|
959
|
+
onClick: () => a.current?.click(),
|
|
959
960
|
children: "Upload"
|
|
960
961
|
})]
|
|
961
962
|
}),
|
|
962
963
|
/* @__PURE__ */ Q("input", {
|
|
963
|
-
ref:
|
|
964
|
+
ref: a,
|
|
964
965
|
type: "file",
|
|
965
966
|
accept: ".obj,.glb,.gltf,.stl",
|
|
966
967
|
className: "hidden",
|
|
@@ -968,15 +969,15 @@ function jr({ layer: e, setProp: t }) {
|
|
|
968
969
|
let t = e.target.files?.[0];
|
|
969
970
|
if (e.target.value = "", !t) return;
|
|
970
971
|
let n = new FileReader();
|
|
971
|
-
n.onload = () =>
|
|
972
|
+
n.onload = () => o(n.result, Ur(t.name)), n.readAsDataURL(t);
|
|
972
973
|
}
|
|
973
974
|
}),
|
|
974
|
-
/* @__PURE__ */ Q(
|
|
975
|
+
/* @__PURE__ */ Q(Ft, {
|
|
975
976
|
open: r,
|
|
976
|
-
accept:
|
|
977
|
+
accept: Hr,
|
|
977
978
|
onClose: () => i(!1),
|
|
978
979
|
onSelect: (e) => {
|
|
979
|
-
i(!1),
|
|
980
|
+
i(!1), o(jn(e), Ur(e));
|
|
980
981
|
}
|
|
981
982
|
})
|
|
982
983
|
]
|
|
@@ -984,23 +985,23 @@ function jr({ layer: e, setProp: t }) {
|
|
|
984
985
|
}
|
|
985
986
|
//#endregion
|
|
986
987
|
//#region src/editor/labs/useLabsKeys.js
|
|
987
|
-
function
|
|
988
|
+
function Kr(e, t) {
|
|
988
989
|
Y(() => {
|
|
989
990
|
let n = (n) => {
|
|
990
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
991
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || zt(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
991
992
|
};
|
|
992
993
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
993
994
|
});
|
|
994
995
|
}
|
|
995
996
|
//#endregion
|
|
996
997
|
//#region src/editor/labs/LabsParams.jsx
|
|
997
|
-
var
|
|
998
|
+
var qr = [{
|
|
998
999
|
value: "effect",
|
|
999
1000
|
label: "Effect"
|
|
1000
1001
|
}, {
|
|
1001
1002
|
value: "anim",
|
|
1002
1003
|
label: "Motion"
|
|
1003
|
-
}],
|
|
1004
|
+
}], Jr = [
|
|
1004
1005
|
{
|
|
1005
1006
|
value: "generate",
|
|
1006
1007
|
label: "Generate"
|
|
@@ -1013,7 +1014,7 @@ var Nr = [{
|
|
|
1013
1014
|
value: "anim",
|
|
1014
1015
|
label: "Animation"
|
|
1015
1016
|
}
|
|
1016
|
-
],
|
|
1017
|
+
], Yr = [
|
|
1017
1018
|
{
|
|
1018
1019
|
value: "generate",
|
|
1019
1020
|
label: "Gen"
|
|
@@ -1027,11 +1028,11 @@ var Nr = [{
|
|
|
1027
1028
|
label: "Anim"
|
|
1028
1029
|
}
|
|
1029
1030
|
];
|
|
1030
|
-
function
|
|
1031
|
-
let
|
|
1032
|
-
return e?.length ?
|
|
1031
|
+
function Xr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
|
|
1032
|
+
let o = s();
|
|
1033
|
+
return e?.length ? i ? /* @__PURE__ */ Q("div", {
|
|
1033
1034
|
className: "flex items-center gap-1 flex-wrap",
|
|
1034
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1035
|
+
children: e.map((e) => /* @__PURE__ */ Q(Vn, {
|
|
1035
1036
|
size: "xs",
|
|
1036
1037
|
hash: !1,
|
|
1037
1038
|
active: e.value === t,
|
|
@@ -1043,32 +1044,32 @@ function Ir({ options: e, active: t, onPick: n, spread: i = !1, pills: o = !1 })
|
|
|
1043
1044
|
value: t ?? null,
|
|
1044
1045
|
onChange: n,
|
|
1045
1046
|
options: e,
|
|
1046
|
-
size:
|
|
1047
|
+
size: o,
|
|
1047
1048
|
ariaLabel: "Siblings",
|
|
1048
|
-
className:
|
|
1049
|
+
className: a(o)
|
|
1049
1050
|
}) : null;
|
|
1050
1051
|
}
|
|
1051
|
-
function
|
|
1052
|
-
let { undo: e, redo: t, canUndo: n, canRedo: r } =
|
|
1052
|
+
function Zr() {
|
|
1053
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = s(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1053
1054
|
"aria-hidden": "true",
|
|
1054
1055
|
className: "invisible pointer-events-none",
|
|
1055
1056
|
children: t
|
|
1056
1057
|
});
|
|
1057
|
-
return /* @__PURE__ */ $(
|
|
1058
|
+
return /* @__PURE__ */ $(Xn, { children: [a(n, /* @__PURE__ */ Q(Un, {
|
|
1058
1059
|
label: "Undo",
|
|
1059
1060
|
shortcut: "⌘Z",
|
|
1060
1061
|
children: /* @__PURE__ */ Q(K, {
|
|
1061
|
-
size:
|
|
1062
|
+
size: i,
|
|
1062
1063
|
iconOnly: "arrow-left",
|
|
1063
1064
|
"aria-label": "Undo",
|
|
1064
1065
|
tabIndex: n ? void 0 : -1,
|
|
1065
1066
|
onClick: e
|
|
1066
1067
|
})
|
|
1067
|
-
})),
|
|
1068
|
+
})), a(r, /* @__PURE__ */ Q(Un, {
|
|
1068
1069
|
label: "Redo",
|
|
1069
1070
|
shortcut: "⇧⌘Z",
|
|
1070
1071
|
children: /* @__PURE__ */ Q(K, {
|
|
1071
|
-
size:
|
|
1072
|
+
size: i,
|
|
1072
1073
|
iconOnly: "arrow-right",
|
|
1073
1074
|
"aria-label": "Redo",
|
|
1074
1075
|
tabIndex: r ? void 0 : -1,
|
|
@@ -1076,25 +1077,25 @@ function Lr() {
|
|
|
1076
1077
|
})
|
|
1077
1078
|
}))] });
|
|
1078
1079
|
}
|
|
1079
|
-
function
|
|
1080
|
-
let m =
|
|
1080
|
+
function Qr({ 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
|
+
let m = s() === "sm";
|
|
1081
1082
|
return /* @__PURE__ */ $("div", {
|
|
1082
1083
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
1083
1084
|
"data-label-scope": d,
|
|
1084
1085
|
children: [
|
|
1085
|
-
|
|
1086
|
+
o && m && /* @__PURE__ */ $("div", {
|
|
1086
1087
|
className: "flex items-center gap-1",
|
|
1087
1088
|
children: [/* @__PURE__ */ Q("p", {
|
|
1088
1089
|
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
1089
|
-
children:
|
|
1090
|
-
}), /* @__PURE__ */ Q(
|
|
1090
|
+
children: o
|
|
1091
|
+
}), /* @__PURE__ */ Q(Zr, {})]
|
|
1091
1092
|
}),
|
|
1092
|
-
e && /* @__PURE__ */ Q(
|
|
1093
|
+
e && /* @__PURE__ */ Q(Xr, {
|
|
1093
1094
|
options: e,
|
|
1094
1095
|
active: t,
|
|
1095
|
-
onPick:
|
|
1096
|
-
spread:
|
|
1097
|
-
pills:
|
|
1096
|
+
onPick: n,
|
|
1097
|
+
spread: r,
|
|
1098
|
+
pills: a
|
|
1098
1099
|
}),
|
|
1099
1100
|
l,
|
|
1100
1101
|
c,
|
|
@@ -1104,33 +1105,33 @@ function Rr({ chips: e, active: t, onPick: r, spread: i, pills: o, title: s, tab
|
|
|
1104
1105
|
className: "invisible h-0 overflow-hidden flex flex-col",
|
|
1105
1106
|
children: f.map((e, t) => /* @__PURE__ */ Q("span", {
|
|
1106
1107
|
className: "kol-helper-10 tracking-widest whitespace-nowrap",
|
|
1107
|
-
style: { width:
|
|
1108
|
+
style: { width: i },
|
|
1108
1109
|
children: String(e).toUpperCase()
|
|
1109
1110
|
}, t))
|
|
1110
1111
|
})
|
|
1111
1112
|
]
|
|
1112
1113
|
});
|
|
1113
1114
|
}
|
|
1114
|
-
function
|
|
1115
|
-
let
|
|
1115
|
+
function $r({ layer: t, showMod: n }) {
|
|
1116
|
+
let r = l(), c = s(), [u, d] = Z("effect");
|
|
1116
1117
|
Y(() => {
|
|
1117
|
-
let e = () =>
|
|
1118
|
+
let e = () => d("effect");
|
|
1118
1119
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
1119
1120
|
}, []);
|
|
1120
|
-
let { addFilter:
|
|
1121
|
+
let { addFilter: f, replaceFilter: m, removeFilter: _, toggleFilter: y, updateLayer: b, palette: x } = o(), S = te(t.id, { history: "coalesce" }), C = g(t), T = C.findIndex((e) => !e.def?.first), E = T < 0 ? C.length : T, O = T < 0 ? null : C[T], ee = oe(L).find((e) => e.id === B(O?.id)), k = ee?.id === "halftone", M = k ? (ee?.filters ?? []).map((e) => ({
|
|
1121
1122
|
value: e.id,
|
|
1122
1123
|
label: e.label
|
|
1123
|
-
})) : null, ne = !k &&
|
|
1124
|
-
if (!
|
|
1125
|
-
|
|
1124
|
+
})) : null, ne = !k && O ? O.def.label : null, N = (e) => {
|
|
1125
|
+
if (!O) {
|
|
1126
|
+
f(t.id, e);
|
|
1126
1127
|
return;
|
|
1127
1128
|
}
|
|
1128
|
-
|
|
1129
|
-
}, P =
|
|
1130
|
-
...
|
|
1131
|
-
...
|
|
1132
|
-
id:
|
|
1133
|
-
} :
|
|
1129
|
+
e !== O.id && m(t.id, E, e);
|
|
1130
|
+
}, P = C.map(({ def: e, ...t }) => t), F = O ? {
|
|
1131
|
+
...t,
|
|
1132
|
+
...O.params,
|
|
1133
|
+
id: t.id
|
|
1134
|
+
} : t, I = (e) => (t, n) => {
|
|
1134
1135
|
let r = P.map((r, i) => i === e ? {
|
|
1135
1136
|
...r,
|
|
1136
1137
|
params: {
|
|
@@ -1138,93 +1139,93 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1138
1139
|
[t]: n
|
|
1139
1140
|
}
|
|
1140
1141
|
} : r);
|
|
1141
|
-
|
|
1142
|
-
}, R = I(
|
|
1142
|
+
S.patch({ filters: r });
|
|
1143
|
+
}, R = I(E), ie = n ? (e) => /* @__PURE__ */ Q(at, {
|
|
1143
1144
|
layer: F,
|
|
1144
1145
|
param: e,
|
|
1145
1146
|
setProp: R
|
|
1146
|
-
}) : void 0, z = (
|
|
1147
|
-
let n = P.map((
|
|
1148
|
-
...
|
|
1147
|
+
}) : void 0, z = (e) => {
|
|
1148
|
+
let n = P.map((t, n) => n === E ? {
|
|
1149
|
+
...t,
|
|
1149
1150
|
params: {
|
|
1150
|
-
...
|
|
1151
|
-
...
|
|
1151
|
+
...t.params,
|
|
1152
|
+
...e
|
|
1152
1153
|
}
|
|
1153
|
-
} :
|
|
1154
|
-
|
|
1154
|
+
} : t);
|
|
1155
|
+
b(t.id, { filters: n });
|
|
1155
1156
|
};
|
|
1156
|
-
|
|
1157
|
-
|
|
1157
|
+
Kr(() => {
|
|
1158
|
+
O && b(t.id, { filters: P.map((e, t) => t === 0 ? {
|
|
1158
1159
|
...e,
|
|
1159
1160
|
params: {}
|
|
1160
1161
|
} : e) });
|
|
1161
1162
|
}, () => {
|
|
1162
|
-
|
|
1163
|
+
O && z(p(F, w(O.def.params, F), D()));
|
|
1163
1164
|
});
|
|
1164
|
-
let V =
|
|
1165
|
+
let V = t.fxGroup ? se.find((e) => e.id === t.fxGroup) : null;
|
|
1165
1166
|
if (V) {
|
|
1166
|
-
let
|
|
1167
|
-
chain:
|
|
1168
|
-
layer:
|
|
1167
|
+
let e = {
|
|
1168
|
+
chain: C,
|
|
1169
|
+
layer: t,
|
|
1169
1170
|
hostView: F,
|
|
1170
|
-
toggleFilter:
|
|
1171
|
-
removeFilter:
|
|
1171
|
+
toggleFilter: y,
|
|
1172
|
+
removeFilter: _,
|
|
1172
1173
|
setStagePropAt: I,
|
|
1173
|
-
palette:
|
|
1174
|
-
showMod:
|
|
1175
|
-
},
|
|
1174
|
+
palette: x,
|
|
1175
|
+
showMod: n
|
|
1176
|
+
}, r = [{
|
|
1176
1177
|
value: "",
|
|
1177
1178
|
label: "Add effect…"
|
|
1178
1179
|
}, ...re(V, L).map((e) => ({
|
|
1179
1180
|
value: e.id,
|
|
1180
1181
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1181
1182
|
}))];
|
|
1182
|
-
return /* @__PURE__ */ $(
|
|
1183
|
+
return /* @__PURE__ */ $(Qr, {
|
|
1183
1184
|
title: "Effects",
|
|
1184
1185
|
fx: !0,
|
|
1185
1186
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1186
1187
|
tone: "sunken",
|
|
1187
|
-
value:
|
|
1188
|
-
onChange:
|
|
1189
|
-
options:
|
|
1190
|
-
size:
|
|
1191
|
-
className:
|
|
1188
|
+
value: u,
|
|
1189
|
+
onChange: d,
|
|
1190
|
+
options: qr,
|
|
1191
|
+
size: c,
|
|
1192
|
+
className: a(c)
|
|
1192
1193
|
}),
|
|
1193
|
-
children: [
|
|
1194
|
+
children: [u === "effect" && /* @__PURE__ */ $(Xn, { children: [
|
|
1194
1195
|
/* @__PURE__ */ $(q, {
|
|
1195
1196
|
label: "Effect stack",
|
|
1196
1197
|
divided: !0,
|
|
1197
|
-
children: [
|
|
1198
|
+
children: [C.length === 0 && /* @__PURE__ */ Q(j, {
|
|
1198
1199
|
className: "kol-mono-10 text-meta",
|
|
1199
1200
|
children: "No effects yet — add one below."
|
|
1200
|
-
}), /* @__PURE__ */ Q(
|
|
1201
|
-
...
|
|
1201
|
+
}), /* @__PURE__ */ Q(ri, {
|
|
1202
|
+
...e,
|
|
1202
1203
|
from: 0
|
|
1203
1204
|
})]
|
|
1204
1205
|
}),
|
|
1205
|
-
/* @__PURE__ */ Q(
|
|
1206
|
-
|
|
1206
|
+
/* @__PURE__ */ Q(Fn, {}),
|
|
1207
|
+
C.length < 8 && /* @__PURE__ */ Q(q, {
|
|
1207
1208
|
label: V.label,
|
|
1208
1209
|
divided: !0,
|
|
1209
|
-
children: /* @__PURE__ */ Q(
|
|
1210
|
+
children: /* @__PURE__ */ Q(In, {
|
|
1210
1211
|
variant: "subtle",
|
|
1211
|
-
size:
|
|
1212
|
+
size: c,
|
|
1212
1213
|
className: "w-full",
|
|
1213
|
-
options:
|
|
1214
|
+
options: r,
|
|
1214
1215
|
value: "",
|
|
1215
|
-
onChange: (
|
|
1216
|
-
|
|
1216
|
+
onChange: (e) => {
|
|
1217
|
+
e && f(t.id, e);
|
|
1217
1218
|
}
|
|
1218
1219
|
})
|
|
1219
1220
|
})
|
|
1220
|
-
] }),
|
|
1221
|
-
sweeps: Array.isArray(
|
|
1221
|
+
] }), u === "anim" && O?.def?.sweeps && /* @__PURE__ */ Q(st, {
|
|
1222
|
+
sweeps: Array.isArray(O.params.sweeps) ? O.params.sweeps : [],
|
|
1222
1223
|
onChange: (e) => R("sweeps", e),
|
|
1223
1224
|
inline: !0
|
|
1224
1225
|
})]
|
|
1225
1226
|
});
|
|
1226
1227
|
}
|
|
1227
|
-
if (!
|
|
1228
|
+
if (!O) return /* @__PURE__ */ Q(Qr, {
|
|
1228
1229
|
chips: M,
|
|
1229
1230
|
active: null,
|
|
1230
1231
|
onPick: N,
|
|
@@ -1232,27 +1233,27 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1232
1233
|
fx: !0,
|
|
1233
1234
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1234
1235
|
tone: "sunken",
|
|
1235
|
-
value:
|
|
1236
|
-
onChange:
|
|
1237
|
-
options:
|
|
1238
|
-
size:
|
|
1239
|
-
className:
|
|
1236
|
+
value: u,
|
|
1237
|
+
onChange: d,
|
|
1238
|
+
options: qr,
|
|
1239
|
+
size: c,
|
|
1240
|
+
className: a(c)
|
|
1240
1241
|
}),
|
|
1241
1242
|
children: /* @__PURE__ */ Q(A, {
|
|
1242
|
-
schema:
|
|
1243
|
-
layer:
|
|
1244
|
-
setProp:
|
|
1245
|
-
palette:
|
|
1246
|
-
renderAnimate: (
|
|
1247
|
-
layer:
|
|
1248
|
-
param:
|
|
1249
|
-
setProp:
|
|
1243
|
+
schema: Mn,
|
|
1244
|
+
layer: t,
|
|
1245
|
+
setProp: S.setProp,
|
|
1246
|
+
palette: x,
|
|
1247
|
+
renderAnimate: (e) => /* @__PURE__ */ Q(at, {
|
|
1248
|
+
layer: t,
|
|
1249
|
+
param: e,
|
|
1250
|
+
setProp: S.setProp
|
|
1250
1251
|
}),
|
|
1251
|
-
tab:
|
|
1252
|
+
tab: u === "anim" ? "anim" : "style",
|
|
1252
1253
|
emptyHint: "Pick an effect from the nav."
|
|
1253
1254
|
})
|
|
1254
1255
|
});
|
|
1255
|
-
let H =
|
|
1256
|
+
let H = O.def.params.filter((e) => v(e) !== "anim"), U = ae(O.def.id), le = U ? H.findIndex((e) => e.key === U) : -1, ue = H.length;
|
|
1256
1257
|
if (le >= 0) {
|
|
1257
1258
|
let e = le;
|
|
1258
1259
|
for (; e + 1 < H.length && H[e + 1].type === "select";) e++;
|
|
@@ -1264,28 +1265,28 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1264
1265
|
})) : H, pe = {
|
|
1265
1266
|
layer: F,
|
|
1266
1267
|
setProp: R,
|
|
1267
|
-
palette:
|
|
1268
|
+
palette: x,
|
|
1268
1269
|
renderAnimate: ie,
|
|
1269
1270
|
inline: !0
|
|
1270
1271
|
};
|
|
1271
|
-
return /* @__PURE__ */ $(
|
|
1272
|
+
return /* @__PURE__ */ $(Qr, {
|
|
1272
1273
|
chips: M,
|
|
1273
|
-
active:
|
|
1274
|
+
active: O.id,
|
|
1274
1275
|
onPick: N,
|
|
1275
1276
|
spread: k,
|
|
1276
1277
|
title: ne,
|
|
1277
1278
|
fx: !0,
|
|
1278
|
-
scope:
|
|
1279
|
-
ghostLabels:
|
|
1279
|
+
scope: O.id,
|
|
1280
|
+
ghostLabels: O.def.params.map((e) => e.label).filter(Boolean),
|
|
1280
1281
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1281
1282
|
tone: "sunken",
|
|
1282
|
-
value:
|
|
1283
|
-
onChange:
|
|
1284
|
-
options:
|
|
1285
|
-
size:
|
|
1286
|
-
className:
|
|
1283
|
+
value: u,
|
|
1284
|
+
onChange: d,
|
|
1285
|
+
options: qr,
|
|
1286
|
+
size: c,
|
|
1287
|
+
className: a(c)
|
|
1287
1288
|
}),
|
|
1288
|
-
children: [
|
|
1289
|
+
children: [u === "effect" && /* @__PURE__ */ $(Xn, { children: [
|
|
1289
1290
|
W.length > 0 && /* @__PURE__ */ Q(A, {
|
|
1290
1291
|
schema: W,
|
|
1291
1292
|
...pe
|
|
@@ -1297,90 +1298,90 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1297
1298
|
...pe
|
|
1298
1299
|
}), /* @__PURE__ */ Q(ot, {
|
|
1299
1300
|
inline: !0,
|
|
1300
|
-
def:
|
|
1301
|
+
def: O.def,
|
|
1301
1302
|
view: F,
|
|
1302
1303
|
tab: "effect",
|
|
1303
1304
|
onPatch: z,
|
|
1304
|
-
levels: /* @__PURE__ */ $(
|
|
1305
|
+
levels: /* @__PURE__ */ $(Xn, { children: [
|
|
1305
1306
|
[
|
|
1306
1307
|
["type", "Type"],
|
|
1307
1308
|
["category", "Category"],
|
|
1308
1309
|
["preset", "Preset"]
|
|
1309
|
-
].filter(([e]) => _e(
|
|
1310
|
+
].filter(([e]) => _e(O.def, e)).map(([e, n]) => /* @__PURE__ */ Q(K, {
|
|
1310
1311
|
tone: "primary",
|
|
1311
|
-
size:
|
|
1312
|
+
size: c,
|
|
1312
1313
|
className: "flex-1 min-w-0",
|
|
1313
1314
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
1314
1315
|
onClick: () => {
|
|
1315
|
-
let n =
|
|
1316
|
-
if (
|
|
1317
|
-
let e = de(
|
|
1318
|
-
e != null && z(ce(
|
|
1316
|
+
let n = h(D() >>> 0);
|
|
1317
|
+
if (e === "preset") {
|
|
1318
|
+
let e = de(O.def, F, n);
|
|
1319
|
+
e != null && z(ce(O.def, e));
|
|
1319
1320
|
return;
|
|
1320
1321
|
}
|
|
1321
|
-
let r = me(
|
|
1322
|
-
r &&
|
|
1322
|
+
let r = me(O.id, e, n);
|
|
1323
|
+
r && m(t.id, E, r);
|
|
1323
1324
|
},
|
|
1324
1325
|
children: n
|
|
1325
|
-
},
|
|
1326
|
+
}, e)),
|
|
1326
1327
|
/* @__PURE__ */ Q(K, {
|
|
1327
1328
|
tone: "primary",
|
|
1328
|
-
size:
|
|
1329
|
+
size: c,
|
|
1329
1330
|
className: "flex-1 min-w-0",
|
|
1330
1331
|
"aria-label": "Randomize settings",
|
|
1331
1332
|
onClick: () => {
|
|
1332
|
-
z(he(F,
|
|
1333
|
+
z(he(F, w(O.def.params.filter((e) => v(e) !== "anim"), F), h(D() >>> 0)));
|
|
1333
1334
|
},
|
|
1334
1335
|
children: "Settings"
|
|
1335
1336
|
}),
|
|
1336
1337
|
/* @__PURE__ */ Q(Se, {
|
|
1337
|
-
def:
|
|
1338
|
+
def: O.def,
|
|
1338
1339
|
isFilter: !0
|
|
1339
1340
|
})
|
|
1340
1341
|
] })
|
|
1341
1342
|
})]
|
|
1342
1343
|
}),
|
|
1343
|
-
/* @__PURE__ */ Q(
|
|
1344
|
-
ue < H.length && /* @__PURE__ */ $(
|
|
1344
|
+
/* @__PURE__ */ Q(Fn, {}),
|
|
1345
|
+
ue < H.length && /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q(A, {
|
|
1345
1346
|
schema: H.slice(ue),
|
|
1346
1347
|
...pe
|
|
1347
|
-
}), /* @__PURE__ */ Q(
|
|
1348
|
-
/* @__PURE__ */ Q(
|
|
1349
|
-
chain:
|
|
1350
|
-
from:
|
|
1351
|
-
layer:
|
|
1348
|
+
}), /* @__PURE__ */ Q(Fn, {})] }),
|
|
1349
|
+
/* @__PURE__ */ Q(ii, {
|
|
1350
|
+
chain: C,
|
|
1351
|
+
from: E + 1,
|
|
1352
|
+
layer: t,
|
|
1352
1353
|
hostView: F,
|
|
1353
|
-
addFilter:
|
|
1354
|
-
removeFilter:
|
|
1355
|
-
toggleFilter:
|
|
1354
|
+
addFilter: f,
|
|
1355
|
+
removeFilter: _,
|
|
1356
|
+
toggleFilter: y,
|
|
1356
1357
|
setStagePropAt: I,
|
|
1357
|
-
palette:
|
|
1358
|
-
showMod:
|
|
1358
|
+
palette: x,
|
|
1359
|
+
showMod: n
|
|
1359
1360
|
})
|
|
1360
|
-
] }),
|
|
1361
|
-
/* @__PURE__ */ Q(
|
|
1362
|
-
schema:
|
|
1361
|
+
] }), u === "anim" && /* @__PURE__ */ $(Xn, { children: [
|
|
1362
|
+
/* @__PURE__ */ Q(Br, {
|
|
1363
|
+
schema: O.def.params,
|
|
1363
1364
|
layer: F,
|
|
1364
1365
|
setProp: R,
|
|
1365
|
-
inputs:
|
|
1366
|
+
inputs: O.def.inputs
|
|
1366
1367
|
}),
|
|
1367
1368
|
/* @__PURE__ */ Q(A, {
|
|
1368
|
-
schema:
|
|
1369
|
+
schema: O.def.params,
|
|
1369
1370
|
...pe,
|
|
1370
1371
|
tab: "anim"
|
|
1371
1372
|
}),
|
|
1372
|
-
|
|
1373
|
+
O.def.orbit && /* @__PURE__ */ Q(q, {
|
|
1373
1374
|
label: "Interaction",
|
|
1374
1375
|
divided: !0,
|
|
1375
|
-
children: /* @__PURE__ */ Q(
|
|
1376
|
+
children: /* @__PURE__ */ Q(zn, {
|
|
1376
1377
|
label: "ORBIT (C)",
|
|
1377
1378
|
align: "fill",
|
|
1378
|
-
labelWidth:
|
|
1379
|
+
labelWidth: i,
|
|
1379
1380
|
children: /* @__PURE__ */ Q(J, {
|
|
1380
1381
|
tone: "sunken",
|
|
1381
|
-
size:
|
|
1382
|
+
size: c,
|
|
1382
1383
|
className: "w-full",
|
|
1383
|
-
value:
|
|
1384
|
+
value: r.grab && F.orbit !== !1 ? "on" : "off",
|
|
1384
1385
|
options: [{
|
|
1385
1386
|
value: "off",
|
|
1386
1387
|
label: "Off"
|
|
@@ -1388,8 +1389,8 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1388
1389
|
value: "on",
|
|
1389
1390
|
label: "On"
|
|
1390
1391
|
}],
|
|
1391
|
-
onChange: (
|
|
1392
|
-
R("orbit",
|
|
1392
|
+
onChange: (t) => {
|
|
1393
|
+
R("orbit", t === "on"), t === "on" && !r.grab && e("grab", !0);
|
|
1393
1394
|
}
|
|
1394
1395
|
})
|
|
1395
1396
|
})
|
|
@@ -1398,46 +1399,46 @@ function zr({ layer: e, showMod: t }) {
|
|
|
1398
1399
|
divided: !0,
|
|
1399
1400
|
children: /* @__PURE__ */ Q(ot, {
|
|
1400
1401
|
inline: !0,
|
|
1401
|
-
def:
|
|
1402
|
+
def: O.def,
|
|
1402
1403
|
view: F,
|
|
1403
1404
|
tab: "anim",
|
|
1404
1405
|
onPatch: z
|
|
1405
1406
|
})
|
|
1406
1407
|
}),
|
|
1407
|
-
|
|
1408
|
-
sweeps: Array.isArray(
|
|
1408
|
+
O.def.sweeps && /* @__PURE__ */ Q(st, {
|
|
1409
|
+
sweeps: Array.isArray(O.params.sweeps) ? O.params.sweeps : [],
|
|
1409
1410
|
onChange: (e) => R("sweeps", e),
|
|
1410
1411
|
inline: !0
|
|
1411
1412
|
}),
|
|
1412
|
-
/* @__PURE__ */ Q(
|
|
1413
|
-
schema:
|
|
1413
|
+
/* @__PURE__ */ Q(Lr, {
|
|
1414
|
+
schema: O.def.params,
|
|
1414
1415
|
layer: F,
|
|
1415
1416
|
setProp: R
|
|
1416
1417
|
}),
|
|
1417
|
-
/* @__PURE__ */ Q(
|
|
1418
|
-
chain:
|
|
1419
|
-
layer:
|
|
1418
|
+
/* @__PURE__ */ Q(ni, {
|
|
1419
|
+
chain: C,
|
|
1420
|
+
layer: t,
|
|
1420
1421
|
hostView: F,
|
|
1421
|
-
addFilter:
|
|
1422
|
-
removeFilter:
|
|
1422
|
+
addFilter: f,
|
|
1423
|
+
removeFilter: _,
|
|
1423
1424
|
setStagePropAt: I,
|
|
1424
|
-
palette:
|
|
1425
|
-
showMod:
|
|
1425
|
+
palette: x,
|
|
1426
|
+
showMod: n
|
|
1426
1427
|
})
|
|
1427
1428
|
] })]
|
|
1428
1429
|
});
|
|
1429
1430
|
}
|
|
1430
|
-
var
|
|
1431
|
-
function
|
|
1432
|
-
let { addFilter:
|
|
1433
|
-
return /* @__PURE__ */ Q(
|
|
1431
|
+
var ei = L.filter((e) => !e.kind && !e.first);
|
|
1432
|
+
function ti({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1433
|
+
let { addFilter: i, removeFilter: a, toggleFilter: s } = o(), c = g(e), l = c.map(({ def: e, ...t }) => t);
|
|
1434
|
+
return /* @__PURE__ */ Q(ii, {
|
|
1434
1435
|
chain: c,
|
|
1435
1436
|
from: 0,
|
|
1436
|
-
filters:
|
|
1437
|
+
filters: ei,
|
|
1437
1438
|
layer: e,
|
|
1438
1439
|
hostView: e,
|
|
1439
|
-
addFilter:
|
|
1440
|
-
removeFilter:
|
|
1440
|
+
addFilter: i,
|
|
1441
|
+
removeFilter: a,
|
|
1441
1442
|
toggleFilter: s,
|
|
1442
1443
|
setStagePropAt: (e) => (n, r) => t.patch({ filters: l.map((t, i) => i === e ? {
|
|
1443
1444
|
...t,
|
|
@@ -1450,20 +1451,20 @@ function Vr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1450
1451
|
showMod: r
|
|
1451
1452
|
});
|
|
1452
1453
|
}
|
|
1453
|
-
function
|
|
1454
|
-
let l =
|
|
1454
|
+
function ni({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: a, palette: o, showMod: c }) {
|
|
1455
|
+
let l = s(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1455
1456
|
...n,
|
|
1456
1457
|
...d.params,
|
|
1457
1458
|
id: t.id
|
|
1458
|
-
} : null, p = d ?
|
|
1459
|
+
} : null, p = d ? a(u) : null;
|
|
1459
1460
|
return /* @__PURE__ */ Q(q, {
|
|
1460
1461
|
label: "Media",
|
|
1461
1462
|
divided: !0,
|
|
1462
|
-
children: d?.def ? /* @__PURE__ */ $(
|
|
1463
|
+
children: d?.def ? /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q(A, {
|
|
1463
1464
|
schema: d.def.params,
|
|
1464
1465
|
layer: f,
|
|
1465
1466
|
setProp: p,
|
|
1466
|
-
palette:
|
|
1467
|
+
palette: o,
|
|
1467
1468
|
inline: !0,
|
|
1468
1469
|
renderAnimate: c ? (e) => /* @__PURE__ */ Q(at, {
|
|
1469
1470
|
layer: f,
|
|
@@ -1489,24 +1490,24 @@ function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1489
1490
|
})
|
|
1490
1491
|
});
|
|
1491
1492
|
}
|
|
1492
|
-
function
|
|
1493
|
-
let u =
|
|
1494
|
-
return e.slice(t).map((e,
|
|
1495
|
-
let d =
|
|
1493
|
+
function ri({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: c, showMod: l }) {
|
|
1494
|
+
let u = s();
|
|
1495
|
+
return e.slice(t).map((e, s) => {
|
|
1496
|
+
let d = s + t, f = e.enabled !== !1, p = {
|
|
1496
1497
|
...r,
|
|
1497
1498
|
...e.params,
|
|
1498
1499
|
id: n.id
|
|
1499
|
-
}, m =
|
|
1500
|
+
}, m = o(d);
|
|
1500
1501
|
return /* @__PURE__ */ $("div", {
|
|
1501
1502
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1502
1503
|
children: [/* @__PURE__ */ $("div", {
|
|
1503
1504
|
className: "flex items-center gap-2",
|
|
1504
|
-
children: [/* @__PURE__ */ Q(
|
|
1505
|
+
children: [/* @__PURE__ */ Q(Hn, {
|
|
1505
1506
|
size: u,
|
|
1506
1507
|
checked: f,
|
|
1507
1508
|
onChange: () => i(n.id, d),
|
|
1508
1509
|
label: e.def?.label ?? e.id
|
|
1509
|
-
}), /* @__PURE__ */ Q(
|
|
1510
|
+
}), /* @__PURE__ */ Q(Un, {
|
|
1510
1511
|
asChild: !0,
|
|
1511
1512
|
label: "Delete effect",
|
|
1512
1513
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1516,11 +1517,11 @@ function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1516
1517
|
iconOnly: "x",
|
|
1517
1518
|
"aria-label": "Delete effect",
|
|
1518
1519
|
className: "ml-auto shrink-0",
|
|
1519
|
-
onClick: () =>
|
|
1520
|
+
onClick: () => a(n.id, d)
|
|
1520
1521
|
})
|
|
1521
1522
|
})]
|
|
1522
1523
|
}), f && e.def && /* @__PURE__ */ Q(A, {
|
|
1523
|
-
schema: e.def.params.filter((e) =>
|
|
1524
|
+
schema: e.def.params.filter((e) => v(e) !== "anim"),
|
|
1524
1525
|
layer: p,
|
|
1525
1526
|
setProp: m,
|
|
1526
1527
|
palette: c,
|
|
@@ -1534,8 +1535,8 @@ function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1534
1535
|
}, e.key ?? d);
|
|
1535
1536
|
});
|
|
1536
1537
|
}
|
|
1537
|
-
function
|
|
1538
|
-
let f =
|
|
1538
|
+
function ii({ 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
|
+
let f = s(), p = [{
|
|
1539
1540
|
value: "",
|
|
1540
1541
|
label: "Add FX…"
|
|
1541
1542
|
}, ...(n ?? I(L)).map((e) => ({
|
|
@@ -1545,124 +1546,124 @@ function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1545
1546
|
return /* @__PURE__ */ $(q, {
|
|
1546
1547
|
label: "Post-Processing",
|
|
1547
1548
|
divided: !0,
|
|
1548
|
-
children: [/* @__PURE__ */ Q(
|
|
1549
|
+
children: [/* @__PURE__ */ Q(ri, {
|
|
1549
1550
|
chain: e,
|
|
1550
1551
|
from: t,
|
|
1551
1552
|
layer: r,
|
|
1552
1553
|
hostView: i,
|
|
1553
1554
|
toggleFilter: c,
|
|
1554
|
-
removeFilter:
|
|
1555
|
+
removeFilter: o,
|
|
1555
1556
|
setStagePropAt: l,
|
|
1556
1557
|
palette: u,
|
|
1557
1558
|
showMod: d
|
|
1558
|
-
}), e.length < 8 && /* @__PURE__ */ Q(
|
|
1559
|
+
}), e.length < 8 && /* @__PURE__ */ Q(In, {
|
|
1559
1560
|
variant: "subtle",
|
|
1560
1561
|
size: f,
|
|
1561
1562
|
className: "w-full",
|
|
1562
1563
|
options: p,
|
|
1563
1564
|
value: "",
|
|
1564
1565
|
onChange: (e) => {
|
|
1565
|
-
e &&
|
|
1566
|
+
e && a(r.id, e);
|
|
1566
1567
|
}
|
|
1567
1568
|
})]
|
|
1568
1569
|
});
|
|
1569
1570
|
}
|
|
1570
|
-
function
|
|
1571
|
-
let
|
|
1571
|
+
function ai({ layer: e, showMod: t, tree: n }) {
|
|
1572
|
+
let r = s(), [i, c] = Z("generate"), { updateLayer: l, palette: u } = o(), { setOnly: d } = W(), f = te(e.id, { history: "coalesce" }), m = N(e.loopGroup).find((t) => t.id === e.presetId), h = P(e.loopGroup), g = (n ?? we).find((t) => t.groups.includes(e.loopGroup)), _ = g?.labels?.[e.loopGroup] ?? h?.label ?? "", v = g && g.label !== _ ? `${g.label} / ${_}` : _, y = e.loopGroup === "paratype" && m?.sub === "Glyphs" ? ne("paratype", "Glyphs") : null, b = y ? y.map((e) => ({
|
|
1572
1573
|
value: e.id,
|
|
1573
1574
|
label: e.label
|
|
1574
|
-
})) : null,
|
|
1575
|
+
})) : null, x = (t) => {
|
|
1575
1576
|
let n = y?.find((e) => e.id === t);
|
|
1576
|
-
n && t !== e.presetId &&
|
|
1577
|
-
},
|
|
1578
|
-
m &&
|
|
1577
|
+
n && t !== e.presetId && d(e.type, H(n, e.loopGroup));
|
|
1578
|
+
}, S = () => {
|
|
1579
|
+
m && d(e.type, H(m, e.loopGroup));
|
|
1579
1580
|
};
|
|
1580
|
-
return
|
|
1581
|
+
return Kr(S, () => {
|
|
1581
1582
|
let t = U(e.loopId)?.params ?? [];
|
|
1582
|
-
l(e.id,
|
|
1583
|
-
}), /* @__PURE__ */ $(
|
|
1583
|
+
l(e.id, p(e, w(t, e), D(), { withFilters: !0 }));
|
|
1584
|
+
}), /* @__PURE__ */ $(Qr, {
|
|
1584
1585
|
title: v,
|
|
1585
1586
|
chips: b,
|
|
1586
1587
|
active: e.presetId,
|
|
1587
|
-
onPick:
|
|
1588
|
+
onPick: x,
|
|
1588
1589
|
pills: !0,
|
|
1589
1590
|
scope: e.loopId,
|
|
1590
1591
|
ghostLabels: (U(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1591
1592
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1592
1593
|
tone: "sunken",
|
|
1593
|
-
value:
|
|
1594
|
+
value: i,
|
|
1594
1595
|
onChange: c,
|
|
1595
|
-
options:
|
|
1596
|
-
size:
|
|
1597
|
-
className: r
|
|
1596
|
+
options: r === "sm" ? Jr : Yr,
|
|
1597
|
+
size: r,
|
|
1598
|
+
className: a(r)
|
|
1598
1599
|
}),
|
|
1599
1600
|
children: [
|
|
1600
|
-
|
|
1601
|
+
i === "anim" && /* @__PURE__ */ Q(Br, {
|
|
1601
1602
|
schema: U(e.loopId)?.params ?? [],
|
|
1602
1603
|
layer: e,
|
|
1603
|
-
setProp:
|
|
1604
|
+
setProp: f.setProp,
|
|
1604
1605
|
inputs: U(e.loopId)?.inputs
|
|
1605
1606
|
}),
|
|
1606
1607
|
/* @__PURE__ */ Q(ye, {
|
|
1607
1608
|
layer: e,
|
|
1608
|
-
setProp:
|
|
1609
|
-
patch:
|
|
1609
|
+
setProp: f.setProp,
|
|
1610
|
+
patch: f.patch,
|
|
1610
1611
|
updateLayer: l,
|
|
1611
1612
|
palette: u,
|
|
1612
1613
|
renderAnimate: t ? (t) => /* @__PURE__ */ Q(at, {
|
|
1613
1614
|
layer: e,
|
|
1614
1615
|
param: t,
|
|
1615
|
-
setProp:
|
|
1616
|
+
setProp: f.setProp
|
|
1616
1617
|
}) : void 0,
|
|
1617
|
-
tab:
|
|
1618
|
+
tab: i,
|
|
1618
1619
|
tabStrip: null,
|
|
1619
1620
|
tree: n,
|
|
1620
1621
|
inline: !0,
|
|
1621
|
-
onReset:
|
|
1622
|
+
onReset: S
|
|
1622
1623
|
}),
|
|
1623
|
-
|
|
1624
|
+
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Gr, {
|
|
1624
1625
|
layer: e,
|
|
1625
|
-
setProp:
|
|
1626
|
+
setProp: f.setProp
|
|
1626
1627
|
}),
|
|
1627
|
-
|
|
1628
|
+
i === "style" && /* @__PURE__ */ Q(ti, {
|
|
1628
1629
|
layer: e,
|
|
1629
|
-
edit:
|
|
1630
|
+
edit: f,
|
|
1630
1631
|
palette: u,
|
|
1631
1632
|
showMod: t
|
|
1632
1633
|
}),
|
|
1633
|
-
|
|
1634
|
+
i === "anim" && /* @__PURE__ */ Q(Lr, {
|
|
1634
1635
|
schema: U(e.loopId)?.params ?? [],
|
|
1635
1636
|
layer: e,
|
|
1636
|
-
setProp:
|
|
1637
|
+
setProp: f.setProp
|
|
1637
1638
|
})
|
|
1638
1639
|
]
|
|
1639
1640
|
});
|
|
1640
1641
|
}
|
|
1641
|
-
function
|
|
1642
|
-
let n =
|
|
1643
|
-
return
|
|
1642
|
+
function oi({ layer: e, showMod: t }) {
|
|
1643
|
+
let n = s(), [r, i] = Z("generate"), { updateLayer: c, palette: l } = o(), { setOnly: u } = W(), d = te(e.id, { history: "coalesce" }), f = lt.find((t) => t.id === e.presetId), p = ct.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
|
|
1644
|
+
return Kr(() => {
|
|
1644
1645
|
f && u("kinetic", {
|
|
1645
1646
|
presetId: f.id,
|
|
1646
1647
|
presetLabel: f.label,
|
|
1647
1648
|
comp: dt(f)
|
|
1648
1649
|
});
|
|
1649
1650
|
}, () => {
|
|
1650
|
-
let t =
|
|
1651
|
+
let t = D(), n = h(t >>> 0), r = e.comp ?? { instances: [] };
|
|
1651
1652
|
(r.instances ?? []).forEach((e, t) => {
|
|
1652
1653
|
r = ft(r, t, n);
|
|
1653
1654
|
}), c(e.id, {
|
|
1654
1655
|
comp: r,
|
|
1655
1656
|
_rollSeed: t
|
|
1656
1657
|
});
|
|
1657
|
-
}), /* @__PURE__ */ Q(
|
|
1658
|
+
}), /* @__PURE__ */ Q(Qr, {
|
|
1658
1659
|
title: p,
|
|
1659
1660
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1660
1661
|
tone: "sunken",
|
|
1661
|
-
value:
|
|
1662
|
-
onChange:
|
|
1663
|
-
options: n === "sm" ?
|
|
1662
|
+
value: r,
|
|
1663
|
+
onChange: i,
|
|
1664
|
+
options: n === "sm" ? Jr : Yr,
|
|
1664
1665
|
size: n,
|
|
1665
|
-
className:
|
|
1666
|
+
className: a(n)
|
|
1666
1667
|
}),
|
|
1667
1668
|
children: /* @__PURE__ */ Q(ut, {
|
|
1668
1669
|
layer: e,
|
|
@@ -1674,42 +1675,42 @@ function Kr({ layer: e, showMod: t }) {
|
|
|
1674
1675
|
param: t,
|
|
1675
1676
|
setProp: d.setProp
|
|
1676
1677
|
}) : () => null,
|
|
1677
|
-
tab:
|
|
1678
|
+
tab: r,
|
|
1678
1679
|
tabStrip: null
|
|
1679
1680
|
})
|
|
1680
1681
|
});
|
|
1681
1682
|
}
|
|
1682
|
-
function
|
|
1683
|
-
let { layer: e } = W(), t = nt(), n =
|
|
1683
|
+
function si() {
|
|
1684
|
+
let { layer: e } = W(), t = nt(), n = s(), r = it();
|
|
1684
1685
|
return Y(() => {
|
|
1685
1686
|
let e = (e) => {
|
|
1686
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1687
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || zt(e) || rt();
|
|
1687
1688
|
};
|
|
1688
1689
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1689
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1690
|
+
}, []), t.active ? /* @__PURE__ */ Q(Qr, {
|
|
1690
1691
|
title: "Morph",
|
|
1691
|
-
children: /* @__PURE__ */ Q(
|
|
1692
|
+
children: /* @__PURE__ */ Q(Nr, {
|
|
1692
1693
|
layer: e,
|
|
1693
|
-
editTabs: n === "sm" ?
|
|
1694
|
+
editTabs: n === "sm" ? Jr : Yr
|
|
1694
1695
|
})
|
|
1695
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1696
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q($r, {
|
|
1696
1697
|
layer: e,
|
|
1697
1698
|
showMod: r
|
|
1698
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1699
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(ai, {
|
|
1699
1700
|
layer: e,
|
|
1700
1701
|
showMod: r
|
|
1701
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1702
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(ai, {
|
|
1702
1703
|
layer: e,
|
|
1703
1704
|
showMod: r,
|
|
1704
1705
|
tree: fe
|
|
1705
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1706
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(oi, {
|
|
1706
1707
|
layer: e,
|
|
1707
1708
|
showMod: r
|
|
1708
1709
|
}, e.id) : /* @__PURE__ */ Q(j, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(j, { children: "Pick an effect or generator from the nav." });
|
|
1709
1710
|
}
|
|
1710
1711
|
//#endregion
|
|
1711
1712
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1712
|
-
function
|
|
1713
|
+
function ci(e) {
|
|
1713
1714
|
Y(() => {
|
|
1714
1715
|
let t = (t) => {
|
|
1715
1716
|
t.key === "Escape" && e?.();
|
|
@@ -1722,8 +1723,8 @@ function Jr(e) {
|
|
|
1722
1723
|
};
|
|
1723
1724
|
}, []);
|
|
1724
1725
|
}
|
|
1725
|
-
function
|
|
1726
|
-
return
|
|
1726
|
+
function li({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1727
|
+
return ci(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1727
1728
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
1728
1729
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1729
1730
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1737,11 +1738,11 @@ function Yr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1737
1738
|
/* @__PURE__ */ Q("div", {
|
|
1738
1739
|
className: "flex flex-col gap-2",
|
|
1739
1740
|
children: we.map((t) => {
|
|
1740
|
-
let n =
|
|
1741
|
+
let n = wr[`gen:${t.label}`] ?? "square";
|
|
1741
1742
|
return /* @__PURE__ */ Q(K, {
|
|
1742
1743
|
tone: "primary",
|
|
1743
1744
|
size: "lg",
|
|
1744
|
-
className:
|
|
1745
|
+
className: Qt,
|
|
1745
1746
|
iconLeft: n,
|
|
1746
1747
|
iconRight: n,
|
|
1747
1748
|
onClick: () => e(t),
|
|
@@ -1775,11 +1776,11 @@ function Yr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1775
1776
|
}
|
|
1776
1777
|
//#endregion
|
|
1777
1778
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1778
|
-
var
|
|
1779
|
-
function
|
|
1779
|
+
var ui = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1780
|
+
function di(e) {
|
|
1780
1781
|
let { patch: t } = te(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1781
1782
|
return {
|
|
1782
|
-
nodes: /* @__PURE__ */ $(
|
|
1783
|
+
nodes: /* @__PURE__ */ $(Xn, { children: [/* @__PURE__ */ Q("input", {
|
|
1783
1784
|
ref: n,
|
|
1784
1785
|
type: "file",
|
|
1785
1786
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1799,24 +1800,24 @@ function Zr(e) {
|
|
|
1799
1800
|
});
|
|
1800
1801
|
return;
|
|
1801
1802
|
}
|
|
1802
|
-
|
|
1803
|
+
bt(r).then((e) => t({
|
|
1803
1804
|
src: e,
|
|
1804
1805
|
srcType: "image"
|
|
1805
1806
|
}));
|
|
1806
1807
|
}
|
|
1807
1808
|
}
|
|
1808
|
-
}), /* @__PURE__ */ Q(
|
|
1809
|
+
}), /* @__PURE__ */ Q(Ft, {
|
|
1809
1810
|
open: r,
|
|
1810
|
-
accept: a ?
|
|
1811
|
+
accept: a ? ui : ["image", "video"],
|
|
1811
1812
|
onClose: () => i(!1),
|
|
1812
1813
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1813
1814
|
if (a) {
|
|
1814
|
-
t({ svgSrc:
|
|
1815
|
+
t({ svgSrc: jn(e) });
|
|
1815
1816
|
return;
|
|
1816
1817
|
}
|
|
1817
1818
|
t({
|
|
1818
|
-
src:
|
|
1819
|
-
srcType:
|
|
1819
|
+
src: jn(e),
|
|
1820
|
+
srcType: yt(n) ? "video" : "image"
|
|
1820
1821
|
});
|
|
1821
1822
|
}
|
|
1822
1823
|
})] }),
|
|
@@ -1824,7 +1825,7 @@ function Zr(e) {
|
|
|
1824
1825
|
openLibrary: () => i(!0),
|
|
1825
1826
|
openUpload: () => n.current?.click(),
|
|
1826
1827
|
openCamera: () => {
|
|
1827
|
-
|
|
1828
|
+
ln(e.id).then(() => t({
|
|
1828
1829
|
src: null,
|
|
1829
1830
|
srcType: "webcam"
|
|
1830
1831
|
})).catch(() => {});
|
|
@@ -1845,15 +1846,15 @@ function Zr(e) {
|
|
|
1845
1846
|
label: "Camera"
|
|
1846
1847
|
}
|
|
1847
1848
|
].slice(0, 2);
|
|
1848
|
-
function
|
|
1849
|
-
let t =
|
|
1849
|
+
function fi({ layer: e }) {
|
|
1850
|
+
let t = di(e);
|
|
1850
1851
|
return /* @__PURE__ */ $("div", {
|
|
1851
1852
|
className: "flex flex-col gap-2",
|
|
1852
1853
|
children: [
|
|
1853
1854
|
/* @__PURE__ */ Q(K, {
|
|
1854
1855
|
tone: "primary",
|
|
1855
1856
|
size: "lg",
|
|
1856
|
-
className:
|
|
1857
|
+
className: Qt,
|
|
1857
1858
|
iconLeft: "image",
|
|
1858
1859
|
iconRight: "image",
|
|
1859
1860
|
onClick: t.openLibrary,
|
|
@@ -1862,7 +1863,7 @@ function Qr({ layer: e }) {
|
|
|
1862
1863
|
/* @__PURE__ */ Q(K, {
|
|
1863
1864
|
tone: "primary",
|
|
1864
1865
|
size: "lg",
|
|
1865
|
-
className:
|
|
1866
|
+
className: Qt,
|
|
1866
1867
|
iconLeft: "upload",
|
|
1867
1868
|
iconRight: "upload",
|
|
1868
1869
|
onClick: t.openUpload,
|
|
@@ -1881,8 +1882,8 @@ function Qr({ layer: e }) {
|
|
|
1881
1882
|
]
|
|
1882
1883
|
});
|
|
1883
1884
|
}
|
|
1884
|
-
function
|
|
1885
|
-
return
|
|
1885
|
+
function pi({ layer: e, title: t, onBack: n }) {
|
|
1886
|
+
return ci(n), /* @__PURE__ */ Q("div", {
|
|
1886
1887
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
1887
1888
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1888
1889
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1899,11 +1900,11 @@ function $r({ layer: e, title: t, onBack: n }) {
|
|
|
1899
1900
|
children: "Pick the media it works on."
|
|
1900
1901
|
})]
|
|
1901
1902
|
}),
|
|
1902
|
-
/* @__PURE__ */ Q(
|
|
1903
|
+
/* @__PURE__ */ Q(fi, { layer: e }),
|
|
1903
1904
|
/* @__PURE__ */ Q(K, {
|
|
1904
1905
|
tone: "grey",
|
|
1905
1906
|
size: "lg",
|
|
1906
|
-
className:
|
|
1907
|
+
className: Qt,
|
|
1907
1908
|
iconLeft: "arrow-left",
|
|
1908
1909
|
iconRight: "arrow-left",
|
|
1909
1910
|
onClick: n,
|
|
@@ -1915,13 +1916,13 @@ function $r({ layer: e, title: t, onBack: n }) {
|
|
|
1915
1916
|
}
|
|
1916
1917
|
//#endregion
|
|
1917
1918
|
//#region src/editor/components/PanelHeader.jsx
|
|
1918
|
-
function
|
|
1919
|
+
function mi({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1919
1920
|
return /* @__PURE__ */ $("div", {
|
|
1920
1921
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1921
1922
|
children: [/* @__PURE__ */ $("button", {
|
|
1922
1923
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1923
1924
|
onClick: t,
|
|
1924
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1925
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(Zn, {
|
|
1925
1926
|
name: "chevron-down",
|
|
1926
1927
|
size: 16,
|
|
1927
1928
|
className: "text-oq-48"
|
|
@@ -1929,7 +1930,7 @@ function ei({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1929
1930
|
}), n]
|
|
1930
1931
|
});
|
|
1931
1932
|
}
|
|
1932
|
-
function
|
|
1933
|
+
function hi({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1933
1934
|
return /* @__PURE__ */ $("div", {
|
|
1934
1935
|
className: "pointer-events-none fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-[var(--fxr-rail,0px)] right-0 z-10 flex flex-nowrap items-center gap-2 px-3 [&>*]:pointer-events-auto",
|
|
1935
1936
|
children: [/* @__PURE__ */ Q(K, {
|
|
@@ -1942,7 +1943,7 @@ function ti({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1942
1943
|
children: [/* @__PURE__ */ Q("span", {
|
|
1943
1944
|
className: "truncate",
|
|
1944
1945
|
children: e
|
|
1945
|
-
}), /* @__PURE__ */ Q(
|
|
1946
|
+
}), /* @__PURE__ */ Q(Zn, {
|
|
1946
1947
|
name: "chevron-down",
|
|
1947
1948
|
size: 16,
|
|
1948
1949
|
className: "rotate-180 shrink-0"
|
|
@@ -1951,13 +1952,13 @@ function ti({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1951
1952
|
}), i]
|
|
1952
1953
|
});
|
|
1953
1954
|
}
|
|
1954
|
-
var
|
|
1955
|
+
var gi = {
|
|
1955
1956
|
half: "50dvh",
|
|
1956
1957
|
tall: "85dvh"
|
|
1957
|
-
},
|
|
1958
|
-
function
|
|
1958
|
+
}, _i = 4;
|
|
1959
|
+
function vi({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1959
1960
|
let a = X(null);
|
|
1960
|
-
|
|
1961
|
+
Wn(a, { axis: "x" });
|
|
1961
1962
|
let o = X({
|
|
1962
1963
|
y: null,
|
|
1963
1964
|
h0: 0,
|
|
@@ -1977,7 +1978,7 @@ function ii({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1977
1978
|
onPointerMove: (e) => {
|
|
1978
1979
|
if (o.y === null) return;
|
|
1979
1980
|
let t = e.clientY - o.y;
|
|
1980
|
-
Math.abs(t) >
|
|
1981
|
+
Math.abs(t) > _i && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
1981
1982
|
},
|
|
1982
1983
|
onPointerUp: (e) => {
|
|
1983
1984
|
if (o.y === null) return;
|
|
@@ -1999,10 +2000,10 @@ function ii({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1999
2000
|
}
|
|
2000
2001
|
//#endregion
|
|
2001
2002
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
2002
|
-
var
|
|
2003
|
-
function
|
|
2004
|
-
let { items: a, dispatch: o } =
|
|
2005
|
-
|
|
2003
|
+
var yi = new Set(["#rail/sec:effects"]);
|
|
2004
|
+
function bi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2005
|
+
let { items: a, dispatch: o } = Dn(), [s, c] = Z(n);
|
|
2006
|
+
ci(t);
|
|
2006
2007
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
2007
2008
|
return /* @__PURE__ */ Q("div", {
|
|
2008
2009
|
className: "fixed bottom-0 top-12 md:top-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
@@ -2021,11 +2022,11 @@ function oi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2021
2022
|
children: [u.map((t) => /* @__PURE__ */ Q(K, {
|
|
2022
2023
|
tone: "primary",
|
|
2023
2024
|
size: "lg",
|
|
2024
|
-
className:
|
|
2025
|
+
className: Qt,
|
|
2025
2026
|
iconLeft: t.icon,
|
|
2026
2027
|
iconRight: t.icon,
|
|
2027
2028
|
onClick: () => {
|
|
2028
|
-
if (!l &&
|
|
2029
|
+
if (!l && yi.has(t.path) && !r && i) {
|
|
2029
2030
|
i(t.path);
|
|
2030
2031
|
return;
|
|
2031
2032
|
}
|
|
@@ -2051,7 +2052,7 @@ function oi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2051
2052
|
}
|
|
2052
2053
|
//#endregion
|
|
2053
2054
|
//#region src/editor/labs/sheetLabels.js
|
|
2054
|
-
function
|
|
2055
|
+
function xi(e) {
|
|
2055
2056
|
if (Ze().active) return {
|
|
2056
2057
|
title: "Morph",
|
|
2057
2058
|
pill: "Morph"
|
|
@@ -2065,7 +2066,7 @@ function si(e) {
|
|
|
2065
2066
|
pill: e.presetLabel
|
|
2066
2067
|
};
|
|
2067
2068
|
if (e.type === "photo") {
|
|
2068
|
-
let t =
|
|
2069
|
+
let t = g(e)[0]?.def?.label ?? "Media";
|
|
2069
2070
|
return {
|
|
2070
2071
|
title: t,
|
|
2071
2072
|
pill: t
|
|
@@ -2079,15 +2080,15 @@ function si(e) {
|
|
|
2079
2080
|
}
|
|
2080
2081
|
//#endregion
|
|
2081
2082
|
//#region src/editor/labs/LabsView.jsx
|
|
2082
|
-
var
|
|
2083
|
+
var Si = .85, Ci = .3, wi = 2.5, Ti = {
|
|
2083
2084
|
0: 1,
|
|
2084
2085
|
1: .5,
|
|
2085
2086
|
2: 1,
|
|
2086
2087
|
3: 1.5,
|
|
2087
2088
|
4: 2
|
|
2088
|
-
},
|
|
2089
|
-
function
|
|
2090
|
-
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction:
|
|
2089
|
+
}, Ei = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2090
|
+
function Di() {
|
|
2091
|
+
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction: i, commitTransaction: a, select: s } = o(), [c, l] = Z(null);
|
|
2091
2092
|
Y(() => {
|
|
2092
2093
|
let e = (e) => {
|
|
2093
2094
|
let { id: t, index: r } = e.detail || {};
|
|
@@ -2106,31 +2107,31 @@ function pi() {
|
|
|
2106
2107
|
c,
|
|
2107
2108
|
s
|
|
2108
2109
|
]);
|
|
2109
|
-
let
|
|
2110
|
-
C.current =
|
|
2111
|
-
let e =
|
|
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(wi, Math.max(Ci, e)), y = (e) => p((t) => v(t * (e > 0 ? 1.25 : .8))), { tool: b } = Nt(), x = b === "orbit", C = X(x);
|
|
2111
|
+
C.current = x, Y(() => {
|
|
2112
|
+
let e = _.current;
|
|
2112
2113
|
if (!e) return;
|
|
2113
2114
|
let t = (e) => {
|
|
2114
|
-
C.current || (e.preventDefault(), !
|
|
2115
|
+
C.current || (e.preventDefault(), !S().zoomLock && p((t) => v(t * (e.deltaY > 0 ? .94 : 1.06))));
|
|
2115
2116
|
};
|
|
2116
2117
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2117
2118
|
}, []), Y(() => {
|
|
2118
2119
|
let e = (e) => {
|
|
2119
|
-
if (!(e.metaKey || e.ctrlKey || e.altKey) && !
|
|
2120
|
+
if (!(e.metaKey || e.ctrlKey || e.altKey) && !zt(e)) {
|
|
2120
2121
|
if (e.key === "f" || e.key === "F") {
|
|
2121
|
-
|
|
2122
|
+
h((e) => !e);
|
|
2122
2123
|
return;
|
|
2123
2124
|
}
|
|
2124
|
-
if (!(
|
|
2125
|
+
if (!(S().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || Ti[e.key] !== void 0))) {
|
|
2125
2126
|
if (e.key === "-" || e.key === "_") {
|
|
2126
|
-
|
|
2127
|
+
y(-1);
|
|
2127
2128
|
return;
|
|
2128
2129
|
}
|
|
2129
2130
|
if (e.key === "+" || e.key === "=") {
|
|
2130
|
-
|
|
2131
|
+
y(1);
|
|
2131
2132
|
return;
|
|
2132
2133
|
}
|
|
2133
|
-
|
|
2134
|
+
Ti[e.key] !== void 0 && p(Ti[e.key]);
|
|
2134
2135
|
}
|
|
2135
2136
|
}
|
|
2136
2137
|
};
|
|
@@ -2144,11 +2145,11 @@ function pi() {
|
|
|
2144
2145
|
start: null,
|
|
2145
2146
|
tap: null
|
|
2146
2147
|
}), D = X({
|
|
2147
|
-
zoom:
|
|
2148
|
+
zoom: f,
|
|
2148
2149
|
pan: w
|
|
2149
2150
|
});
|
|
2150
2151
|
D.current = {
|
|
2151
|
-
zoom:
|
|
2152
|
+
zoom: f,
|
|
2152
2153
|
pan: w
|
|
2153
2154
|
};
|
|
2154
2155
|
let ee = (e) => {
|
|
@@ -2163,7 +2164,7 @@ function pi() {
|
|
|
2163
2164
|
y: e.clientY,
|
|
2164
2165
|
at: performance.now()
|
|
2165
2166
|
} : null, t.pts.size === 2) {
|
|
2166
|
-
let [n, r] = [...t.pts.values()], i =
|
|
2167
|
+
let [n, r] = [...t.pts.values()], i = _.current.getBoundingClientRect(), a = i.left + i.width / 2, o = i.top + i.height / 2, s = (n.x + r.x) / 2, c = (n.y + r.y) / 2, { zoom: l, pan: u } = D.current;
|
|
2167
2168
|
t.start = {
|
|
2168
2169
|
d: Math.hypot(n.x - r.x, n.y - r.y),
|
|
2169
2170
|
cx: a,
|
|
@@ -2180,8 +2181,8 @@ function pi() {
|
|
|
2180
2181
|
y: e.clientY
|
|
2181
2182
|
}), t.pts.size >= 2 && t.start)) {
|
|
2182
2183
|
e.stopPropagation();
|
|
2183
|
-
let [n, r] = [...t.pts.values()], i = t.start, a =
|
|
2184
|
-
|
|
2184
|
+
let [n, r] = [...t.pts.values()], i = t.start, a = S().zoomLock ? i.z0 : v(i.z0 * (Math.hypot(n.x - r.x, n.y - r.y) / i.d)), o = (n.x + r.x) / 2, s = (n.y + r.y) / 2;
|
|
2185
|
+
p(a), T({
|
|
2185
2186
|
x: o - i.cx - a * i.qx,
|
|
2186
2187
|
y: s - i.cy - a * i.qy
|
|
2187
2188
|
});
|
|
@@ -2193,11 +2194,11 @@ function pi() {
|
|
|
2193
2194
|
r && r.id === t.pointerId && t.type === "pointerup" && !n.start && performance.now() - r.at < 350 && Math.hypot(t.clientX - r.x, t.clientY - r.y) < 12 && (e?.type === "loop" ? U(e.loopId) : null)?.group !== "penrose" && O.toggle(), r?.id === t.pointerId && (n.tap = null), n.pts.delete(t.pointerId), n.pts.size < 2 && (n.start = null);
|
|
2194
2195
|
};
|
|
2195
2196
|
return /* @__PURE__ */ $("div", {
|
|
2196
|
-
ref:
|
|
2197
|
+
ref: _,
|
|
2197
2198
|
className: "relative w-full h-full flex items-center justify-center overflow-hidden touch-none",
|
|
2198
2199
|
style: { background: "var(--kol-surface-secondary)" },
|
|
2199
2200
|
onDoubleClick: () => {
|
|
2200
|
-
|
|
2201
|
+
p(1), T({
|
|
2201
2202
|
x: 0,
|
|
2202
2203
|
y: 0
|
|
2203
2204
|
});
|
|
@@ -2210,40 +2211,40 @@ function pi() {
|
|
|
2210
2211
|
/* @__PURE__ */ Q("div", {
|
|
2211
2212
|
style: {
|
|
2212
2213
|
flex: "none",
|
|
2213
|
-
width: `${
|
|
2214
|
-
height: `${
|
|
2214
|
+
width: `${f * Si * 100}%`,
|
|
2215
|
+
height: `${f * Si * 100}%`,
|
|
2215
2216
|
transform: `translate(${w.x}px, ${w.y}px)`
|
|
2216
2217
|
},
|
|
2217
|
-
children: /* @__PURE__ */ Q(
|
|
2218
|
-
layer:
|
|
2218
|
+
children: /* @__PURE__ */ Q(Xt, { overlay: u ? (e) => /* @__PURE__ */ Q(jt, {
|
|
2219
|
+
layer: u,
|
|
2219
2220
|
initialIndex: c.index,
|
|
2220
2221
|
toVirtual: e,
|
|
2221
2222
|
updateLayer: r,
|
|
2222
|
-
beginTransaction:
|
|
2223
|
-
commitTransaction:
|
|
2223
|
+
beginTransaction: i,
|
|
2224
|
+
commitTransaction: a,
|
|
2224
2225
|
onExit: () => l(null)
|
|
2225
2226
|
}) : void 0 })
|
|
2226
2227
|
}),
|
|
2227
|
-
|
|
2228
|
+
d && /* @__PURE__ */ Q(pi, {
|
|
2228
2229
|
layer: e,
|
|
2229
|
-
title:
|
|
2230
|
+
title: xi(e).title,
|
|
2230
2231
|
onBack: () => t(e.id)
|
|
2231
2232
|
}),
|
|
2232
|
-
|
|
2233
|
+
m && /* @__PURE__ */ Q("div", {
|
|
2233
2234
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2234
|
-
children: /* @__PURE__ */ Q(
|
|
2235
|
+
children: /* @__PURE__ */ Q(Un, {
|
|
2235
2236
|
label: "Framerate — press F to hide",
|
|
2236
2237
|
children: /* @__PURE__ */ $("span", {
|
|
2237
|
-
className:
|
|
2238
|
-
children: [
|
|
2238
|
+
className: Ei,
|
|
2239
|
+
children: [g, " fps"]
|
|
2239
2240
|
})
|
|
2240
2241
|
})
|
|
2241
2242
|
})
|
|
2242
2243
|
]
|
|
2243
2244
|
});
|
|
2244
2245
|
}
|
|
2245
|
-
function
|
|
2246
|
-
let e = X(null), { grabProps: t } =
|
|
2246
|
+
function Oi() {
|
|
2247
|
+
let e = X(null), { grabProps: t } = ar(e, {
|
|
2247
2248
|
token: "kol-rail",
|
|
2248
2249
|
side: "right"
|
|
2249
2250
|
});
|
|
@@ -2289,14 +2290,14 @@ function mi() {
|
|
|
2289
2290
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2290
2291
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
2291
2292
|
className: "kol-compose-inspector-body",
|
|
2292
|
-
children: /* @__PURE__ */ Q(
|
|
2293
|
+
children: /* @__PURE__ */ Q(si, {})
|
|
2293
2294
|
})]
|
|
2294
2295
|
});
|
|
2295
2296
|
}
|
|
2296
|
-
var
|
|
2297
|
-
function
|
|
2298
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
2299
|
-
return /* @__PURE__ */ Q(
|
|
2297
|
+
var ki = qn(null);
|
|
2298
|
+
function Ai() {
|
|
2299
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = Jn(ki);
|
|
2300
|
+
return /* @__PURE__ */ Q(vi, {
|
|
2300
2301
|
tall: e,
|
|
2301
2302
|
onToggle: () => {
|
|
2302
2303
|
r(null), t((e) => !e);
|
|
@@ -2307,20 +2308,20 @@ function gi() {
|
|
|
2307
2308
|
}
|
|
2308
2309
|
});
|
|
2309
2310
|
}
|
|
2310
|
-
var
|
|
2311
|
+
var ji = [
|
|
2311
2312
|
2,
|
|
2312
2313
|
4,
|
|
2313
2314
|
8,
|
|
2314
2315
|
12,
|
|
2315
2316
|
16
|
|
2316
2317
|
];
|
|
2317
|
-
function
|
|
2318
|
-
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } =
|
|
2318
|
+
function Mi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2319
|
+
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } = C(), [f, p] = Z(!0), m = [
|
|
2319
2320
|
{
|
|
2320
2321
|
icon: "home-01",
|
|
2321
2322
|
path: "#home",
|
|
2322
2323
|
label: "Home",
|
|
2323
|
-
onPress: () =>
|
|
2324
|
+
onPress: () => pn("/")
|
|
2324
2325
|
},
|
|
2325
2326
|
{
|
|
2326
2327
|
icon: "grid",
|
|
@@ -2347,13 +2348,13 @@ function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2347
2348
|
icon: "download",
|
|
2348
2349
|
label: "Output",
|
|
2349
2350
|
onPress: () => {
|
|
2350
|
-
t(!0),
|
|
2351
|
+
t(!0), cn("Output");
|
|
2351
2352
|
}
|
|
2352
2353
|
}, {
|
|
2353
2354
|
icon: "file",
|
|
2354
2355
|
label: "File",
|
|
2355
2356
|
onPress: () => {
|
|
2356
|
-
t(!0),
|
|
2357
|
+
t(!0), cn("File");
|
|
2357
2358
|
}
|
|
2358
2359
|
}], g = f ? {
|
|
2359
2360
|
items: [
|
|
@@ -2389,14 +2390,14 @@ function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2389
2390
|
onPress: u
|
|
2390
2391
|
}
|
|
2391
2392
|
],
|
|
2392
|
-
sheetFor: { loop:
|
|
2393
|
+
sheetFor: { loop: ji.map((e) => ({
|
|
2393
2394
|
label: `${e} s`,
|
|
2394
2395
|
checked: o === e,
|
|
2395
2396
|
onPress: () => d(e)
|
|
2396
2397
|
})) }
|
|
2397
2398
|
} : void 0;
|
|
2398
2399
|
return Y(() => {
|
|
2399
|
-
|
|
2400
|
+
dr({
|
|
2400
2401
|
items: m,
|
|
2401
2402
|
actions: h,
|
|
2402
2403
|
transport: g,
|
|
@@ -2410,20 +2411,20 @@ function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2410
2411
|
a,
|
|
2411
2412
|
o,
|
|
2412
2413
|
i
|
|
2413
|
-
]), Y(() => () =>
|
|
2414
|
+
]), Y(() => () => dr(null), []), null;
|
|
2414
2415
|
}
|
|
2415
|
-
function
|
|
2416
|
+
function Ni() {
|
|
2416
2417
|
return /* @__PURE__ */ Q("div", {
|
|
2417
2418
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2418
2419
|
children: /* @__PURE__ */ Q("div", {
|
|
2419
2420
|
className: "kol-compose-inspector-body",
|
|
2420
|
-
children: /* @__PURE__ */ Q(
|
|
2421
|
+
children: /* @__PURE__ */ Q(si, {})
|
|
2421
2422
|
})
|
|
2422
2423
|
});
|
|
2423
2424
|
}
|
|
2424
|
-
var
|
|
2425
|
+
var Pi = {
|
|
2425
2426
|
topbar: () => null,
|
|
2426
|
-
canvas:
|
|
2427
|
+
canvas: Di,
|
|
2427
2428
|
panels: [
|
|
2428
2429
|
{
|
|
2429
2430
|
slot: "canvas.footer",
|
|
@@ -2433,87 +2434,87 @@ var bi = {
|
|
|
2433
2434
|
{
|
|
2434
2435
|
slot: "right.body",
|
|
2435
2436
|
order: 0,
|
|
2436
|
-
Component:
|
|
2437
|
+
Component: Oi
|
|
2437
2438
|
},
|
|
2438
2439
|
{
|
|
2439
2440
|
slot: "right.footer",
|
|
2440
2441
|
order: 0,
|
|
2441
|
-
Component:
|
|
2442
|
+
Component: qt
|
|
2442
2443
|
}
|
|
2443
2444
|
]
|
|
2444
|
-
},
|
|
2445
|
-
...
|
|
2445
|
+
}, Fi = {
|
|
2446
|
+
...Pi,
|
|
2446
2447
|
panels: [{
|
|
2447
2448
|
slot: "right.header",
|
|
2448
2449
|
order: 0,
|
|
2449
|
-
Component:
|
|
2450
|
-
}, ...
|
|
2450
|
+
Component: Ai
|
|
2451
|
+
}, ...Pi.panels.map((e) => e.Component === Oi ? {
|
|
2451
2452
|
...e,
|
|
2452
|
-
Component:
|
|
2453
|
+
Component: Ni
|
|
2453
2454
|
} : e)]
|
|
2454
2455
|
};
|
|
2455
|
-
function
|
|
2456
|
-
let { setAspect:
|
|
2456
|
+
function Ii() {
|
|
2457
|
+
let { setAspect: t, selectedId: n, select: r } = o(), { layer: i, setOnly: a } = W(), s = X(!1), c = Kt(gt), d = hn() && !wn() || c;
|
|
2457
2458
|
Y(() => {
|
|
2458
|
-
|
|
2459
|
-
}, [
|
|
2460
|
-
let [
|
|
2459
|
+
d && document.documentElement.removeAttribute("data-rail");
|
|
2460
|
+
}, [d]);
|
|
2461
|
+
let [f, p] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ? gi.tall : gi.half, y = { "--kol-sheet-h": v }, b = fr(), x = nt(), [C, w] = Z(() => !i);
|
|
2461
2462
|
Y(() => {
|
|
2462
|
-
|
|
2463
|
-
}, [
|
|
2464
|
-
let [
|
|
2463
|
+
w(!i);
|
|
2464
|
+
}, [i?.id]);
|
|
2465
|
+
let [T, E] = Z(null), D = i?.type === "photo" && (!!i.src || i.srcType === "webcam");
|
|
2465
2466
|
Y(() => {
|
|
2466
|
-
|
|
2467
|
-
}, [
|
|
2468
|
-
|
|
2469
|
-
}, [
|
|
2470
|
-
if (!
|
|
2467
|
+
T && D && w(!0);
|
|
2468
|
+
}, [T, D]), Y(() => {
|
|
2469
|
+
i || E(null);
|
|
2470
|
+
}, [i]), Y(() => {
|
|
2471
|
+
if (!i || d) return;
|
|
2471
2472
|
let e = 0, t = 0;
|
|
2472
2473
|
return e = requestAnimationFrame(() => {
|
|
2473
2474
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2474
2475
|
}), () => {
|
|
2475
2476
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2476
2477
|
};
|
|
2477
|
-
}, [
|
|
2478
|
-
if (!x.active ||
|
|
2478
|
+
}, [i?.id]), Y(() => {
|
|
2479
|
+
if (!x.active || d) return;
|
|
2479
2480
|
let e = 0, t = 0;
|
|
2480
2481
|
return e = requestAnimationFrame(() => {
|
|
2481
2482
|
t = requestAnimationFrame(() => document.documentElement.removeAttribute("data-rail"));
|
|
2482
2483
|
}), () => {
|
|
2483
2484
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2484
2485
|
};
|
|
2485
|
-
}, [x.active,
|
|
2486
|
+
}, [x.active, d]), Y(() => Dt((e) => a("photo", {
|
|
2486
2487
|
src: e.url,
|
|
2487
2488
|
srcType: e.srcType
|
|
2488
2489
|
})), [a]), Y(() => {
|
|
2489
|
-
if (!
|
|
2490
|
-
let e = () =>
|
|
2490
|
+
if (!d) return;
|
|
2491
|
+
let e = () => p(!0);
|
|
2491
2492
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2492
2493
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2493
2494
|
};
|
|
2494
|
-
}, [
|
|
2495
|
-
if (
|
|
2496
|
-
|
|
2497
|
-
let
|
|
2498
|
-
|
|
2495
|
+
}, [d]), wt(), Y(() => (nn("labs"), () => nn(null)), []), Y(() => {
|
|
2496
|
+
if (s.current) return;
|
|
2497
|
+
s.current = !0;
|
|
2498
|
+
let e = S();
|
|
2499
|
+
e.defaultAspect && e.defaultAspect !== "custom" && t(e.defaultAspect), e.defaultLoopSeconds && O.setLoopSeconds(e.defaultLoopSeconds);
|
|
2499
2500
|
}, []);
|
|
2500
|
-
let
|
|
2501
|
+
let ee = X(!1);
|
|
2501
2502
|
Y(() => {
|
|
2502
|
-
if (
|
|
2503
|
-
|
|
2504
|
-
let e =
|
|
2503
|
+
if (ee.current) return;
|
|
2504
|
+
ee.current = !0;
|
|
2505
|
+
let e = bn();
|
|
2505
2506
|
if (e.open || e.fresh) return;
|
|
2506
2507
|
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? V(t) : null;
|
|
2507
2508
|
n && a("loop", H(M(t), n));
|
|
2508
2509
|
}, [a]);
|
|
2509
|
-
let { clearHistory: k } =
|
|
2510
|
+
let { clearHistory: k } = o();
|
|
2510
2511
|
Y(() => {
|
|
2511
2512
|
let e = setTimeout(k, 800);
|
|
2512
2513
|
return () => clearTimeout(e);
|
|
2513
2514
|
}, [k]);
|
|
2514
|
-
let { tool: A, setTool: j } =
|
|
2515
|
+
let { tool: A, setTool: j } = Nt(), te = X(A);
|
|
2515
2516
|
te.current = A;
|
|
2516
|
-
let { updateLayer: ne, undo: N, redo: P } =
|
|
2517
|
+
let { updateLayer: ne, undo: N, redo: P } = o(), F = X({
|
|
2517
2518
|
undo: N,
|
|
2518
2519
|
redo: P
|
|
2519
2520
|
});
|
|
@@ -2521,75 +2522,75 @@ function Si() {
|
|
|
2521
2522
|
undo: N,
|
|
2522
2523
|
redo: P
|
|
2523
2524
|
};
|
|
2524
|
-
let I = !!
|
|
2525
|
+
let I = !!l().grab;
|
|
2525
2526
|
Y(() => {
|
|
2526
2527
|
j(I ? "orbit" : "select");
|
|
2527
2528
|
}, [I, j]);
|
|
2528
|
-
let re = X(
|
|
2529
|
-
re.current =
|
|
2529
|
+
let re = X(i);
|
|
2530
|
+
re.current = i;
|
|
2530
2531
|
let L = X(ne);
|
|
2531
2532
|
return L.current = ne, Y(() => {
|
|
2532
|
-
let
|
|
2533
|
-
if (
|
|
2534
|
-
if ((
|
|
2535
|
-
|
|
2533
|
+
let t = (t) => {
|
|
2534
|
+
if (zt(t)) return;
|
|
2535
|
+
if ((t.metaKey || t.ctrlKey) && (t.key === "z" || t.key === "Z")) {
|
|
2536
|
+
t.preventDefault(), t.shiftKey ? F.current.redo() : F.current.undo();
|
|
2536
2537
|
return;
|
|
2537
2538
|
}
|
|
2538
|
-
if (
|
|
2539
|
-
|
|
2539
|
+
if (t.code === "Space") {
|
|
2540
|
+
t.preventDefault(), O.toggle();
|
|
2540
2541
|
return;
|
|
2541
2542
|
}
|
|
2542
|
-
if ((
|
|
2543
|
+
if ((t.key === "s" || t.key === "S") && !t.metaKey && !t.ctrlKey && !t.altKey) {
|
|
2543
2544
|
window.dispatchEvent(new CustomEvent("kol:show-shortcuts"));
|
|
2544
2545
|
return;
|
|
2545
2546
|
}
|
|
2546
|
-
if ((
|
|
2547
|
-
|
|
2547
|
+
if ((t.key === "c" || t.key === "C") && !t.metaKey && !t.ctrlKey && !t.altKey) {
|
|
2548
|
+
e("grab", !S().grab);
|
|
2548
2549
|
return;
|
|
2549
2550
|
}
|
|
2550
|
-
if ((
|
|
2551
|
-
|
|
2551
|
+
if ((t.key === "z" || t.key === "Z") && !t.metaKey && !t.ctrlKey && !t.altKey) {
|
|
2552
|
+
e("zoomLock", !S().zoomLock);
|
|
2552
2553
|
return;
|
|
2553
2554
|
}
|
|
2554
|
-
let
|
|
2555
|
-
if (
|
|
2556
|
-
let
|
|
2557
|
-
|
|
2555
|
+
let n = !t.metaKey && !t.ctrlKey && !t.altKey && !t.shiftKey && be[t.key.length === 1 ? t.key.toLowerCase() : t.key];
|
|
2556
|
+
if (n && re.current) {
|
|
2557
|
+
let e = Ce(re.current, n[1], n[0]);
|
|
2558
|
+
e && (t.preventDefault(), L.current(re.current.id, e));
|
|
2558
2559
|
}
|
|
2559
2560
|
};
|
|
2560
|
-
return window.addEventListener("keydown",
|
|
2561
|
+
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
2561
2562
|
}, [j]), Y(() => {
|
|
2562
|
-
if (!
|
|
2563
|
+
if (!i?.presetId) return;
|
|
2563
2564
|
let e = new URLSearchParams(window.location.search);
|
|
2564
|
-
e.get("preset") !==
|
|
2565
|
-
}, [
|
|
2566
|
-
|
|
2565
|
+
e.get("preset") !== i.presetId && (e.delete("view"), e.set("preset", i.presetId), i.loopGroup ? e.set("cat", i.loopGroup) : e.delete("cat"), window.history.replaceState(null, "", `${window.location.pathname}?${e}`));
|
|
2566
|
+
}, [i?.presetId, i?.loopGroup]), Y(() => {
|
|
2567
|
+
i && n !== i.id && r(i.id);
|
|
2567
2568
|
}, [
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2569
|
+
i,
|
|
2570
|
+
n,
|
|
2571
|
+
r
|
|
2571
2572
|
]), /* @__PURE__ */ $("div", {
|
|
2572
2573
|
className: "kol-editor-labs contents",
|
|
2573
|
-
"data-touch":
|
|
2574
|
-
"data-params":
|
|
2575
|
-
"data-empty":
|
|
2574
|
+
"data-touch": d || void 0,
|
|
2575
|
+
"data-params": f ? "open" : void 0,
|
|
2576
|
+
"data-empty": i || x.active ? void 0 : "",
|
|
2576
2577
|
style: y,
|
|
2577
2578
|
children: [
|
|
2578
|
-
/* @__PURE__ */ Q(
|
|
2579
|
-
|
|
2579
|
+
/* @__PURE__ */ Q(Ar, {}),
|
|
2580
|
+
d ? /* @__PURE__ */ $(ki.Provider, {
|
|
2580
2581
|
value: {
|
|
2581
|
-
collapseParams: () =>
|
|
2582
|
+
collapseParams: () => p(!1),
|
|
2582
2583
|
tall: m,
|
|
2583
2584
|
setTall: h,
|
|
2584
2585
|
setSheetPx: _,
|
|
2585
|
-
catalog:
|
|
2586
|
-
toggleCatalog: () =>
|
|
2586
|
+
catalog: C,
|
|
2587
|
+
toggleCatalog: () => w((e) => !e)
|
|
2587
2588
|
},
|
|
2588
|
-
children: [/* @__PURE__ */ Q(
|
|
2589
|
+
children: [/* @__PURE__ */ Q(u.Provider, {
|
|
2589
2590
|
value: "md",
|
|
2590
|
-
children: /* @__PURE__ */ Q(
|
|
2591
|
-
registry:
|
|
2592
|
-
rightIn: (e) => b ?
|
|
2591
|
+
children: /* @__PURE__ */ Q(_t, {
|
|
2592
|
+
registry: Fi,
|
|
2593
|
+
rightIn: (e) => b ? sr(/* @__PURE__ */ Q("div", {
|
|
2593
2594
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2594
2595
|
"data-touch": "",
|
|
2595
2596
|
"data-params": "open",
|
|
@@ -2597,35 +2598,35 @@ function Si() {
|
|
|
2597
2598
|
children: e
|
|
2598
2599
|
}), b) : null
|
|
2599
2600
|
})
|
|
2600
|
-
}), /* @__PURE__ */ Q(
|
|
2601
|
-
paramsOpen:
|
|
2602
|
-
setParamsOpen:
|
|
2603
|
-
catalog:
|
|
2604
|
-
toggleCatalog: () =>
|
|
2601
|
+
}), /* @__PURE__ */ Q(Mi, {
|
|
2602
|
+
paramsOpen: f,
|
|
2603
|
+
setParamsOpen: p,
|
|
2604
|
+
catalog: C,
|
|
2605
|
+
toggleCatalog: () => w((e) => !e),
|
|
2605
2606
|
railHeight: v
|
|
2606
2607
|
})]
|
|
2607
|
-
}) : /* @__PURE__ */ Q(
|
|
2608
|
-
|
|
2609
|
-
initialOpen:
|
|
2610
|
-
hasMedia:
|
|
2608
|
+
}) : /* @__PURE__ */ Q(_t, { registry: Pi }),
|
|
2609
|
+
C && !x.picker && !(x.active && !i) && /* @__PURE__ */ Q(bi, {
|
|
2610
|
+
initialOpen: T,
|
|
2611
|
+
hasMedia: D,
|
|
2611
2612
|
onNeedMedia: (e) => {
|
|
2612
|
-
|
|
2613
|
+
E(e), a("photo", {
|
|
2613
2614
|
filters: [],
|
|
2614
2615
|
fxGroup: null
|
|
2615
2616
|
});
|
|
2616
2617
|
},
|
|
2617
2618
|
onPicked: () => {
|
|
2618
|
-
|
|
2619
|
+
E(null), w(!1);
|
|
2619
2620
|
},
|
|
2620
2621
|
onClose: () => {
|
|
2621
|
-
|
|
2622
|
+
E(null), w(!1);
|
|
2622
2623
|
}
|
|
2623
2624
|
})
|
|
2624
2625
|
]
|
|
2625
2626
|
});
|
|
2626
2627
|
}
|
|
2627
|
-
var
|
|
2628
|
-
function
|
|
2628
|
+
var Li = "kol.editor.labs-draft";
|
|
2629
|
+
function Ri() {
|
|
2629
2630
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2630
2631
|
return Y(() => (G(e ? { active: !0 } : {
|
|
2631
2632
|
active: !1,
|
|
@@ -2633,20 +2634,20 @@ function wi() {
|
|
|
2633
2634
|
}), () => G({
|
|
2634
2635
|
active: !1,
|
|
2635
2636
|
editing: null
|
|
2636
|
-
})), [e]), /* @__PURE__ */ $(
|
|
2637
|
-
draftKey:
|
|
2637
|
+
})), [e]), /* @__PURE__ */ $(fn, {
|
|
2638
|
+
draftKey: Li,
|
|
2638
2639
|
children: [
|
|
2639
|
-
/* @__PURE__ */ Q(
|
|
2640
|
-
/* @__PURE__ */ Q(
|
|
2640
|
+
/* @__PURE__ */ Q(Ii, {}),
|
|
2641
|
+
/* @__PURE__ */ Q(St, {}),
|
|
2641
2642
|
/* @__PURE__ */ Q(ve, {})
|
|
2642
2643
|
]
|
|
2643
2644
|
});
|
|
2644
2645
|
}
|
|
2645
2646
|
//#endregion
|
|
2646
2647
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2647
|
-
function
|
|
2648
|
+
function zi({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2648
2649
|
let [i, a] = Z(null);
|
|
2649
|
-
|
|
2650
|
+
ci(r);
|
|
2650
2651
|
let { engineHost: o } = ie(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = F(L.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2651
2652
|
return /* @__PURE__ */ Q("div", {
|
|
2652
2653
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
@@ -2664,7 +2665,7 @@ function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2664
2665
|
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(K, {
|
|
2665
2666
|
tone: "primary",
|
|
2666
2667
|
size: "lg",
|
|
2667
|
-
className:
|
|
2668
|
+
className: Qt,
|
|
2668
2669
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2669
2670
|
iconRight: l ? "filter" : "chevron-right",
|
|
2670
2671
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
@@ -2674,7 +2675,7 @@ function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2674
2675
|
/* @__PURE__ */ Q(K, {
|
|
2675
2676
|
tone: "grey",
|
|
2676
2677
|
size: "lg",
|
|
2677
|
-
className:
|
|
2678
|
+
className: Qt,
|
|
2678
2679
|
iconLeft: "arrow-left",
|
|
2679
2680
|
iconRight: "arrow-left",
|
|
2680
2681
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2686,7 +2687,7 @@ function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2686
2687
|
}
|
|
2687
2688
|
//#endregion
|
|
2688
2689
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
2689
|
-
var
|
|
2690
|
+
var Bi = { background: "var(--kol-surface-primary)" }, Vi = [
|
|
2690
2691
|
{
|
|
2691
2692
|
value: "generate",
|
|
2692
2693
|
label: "Generate"
|
|
@@ -2703,29 +2704,29 @@ var Ei = { background: "var(--kol-surface-primary)" }, Di = [
|
|
|
2703
2704
|
value: "output",
|
|
2704
2705
|
label: "Output"
|
|
2705
2706
|
}
|
|
2706
|
-
],
|
|
2707
|
+
], Hi = Vi.filter((e) => e.value !== "generate"), Ui = "[&_.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)]", Wi = {
|
|
2707
2708
|
lg: 9.6,
|
|
2708
2709
|
sm: 7.2
|
|
2709
|
-
},
|
|
2710
|
-
function
|
|
2711
|
-
let n = t === "sm" ?
|
|
2710
|
+
}, Gi = 10, Ki = 232;
|
|
2711
|
+
function qi(e, t) {
|
|
2712
|
+
let n = t === "sm" ? Ki : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
2712
2713
|
for (let o of e) {
|
|
2713
|
-
let e = o.label.length *
|
|
2714
|
+
let e = o.label.length * Wi[t] + Gi, s = Math.max(a, e);
|
|
2714
2715
|
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
2715
2716
|
}
|
|
2716
2717
|
return i.length && r.push(i), r;
|
|
2717
2718
|
}
|
|
2718
|
-
function
|
|
2719
|
-
return
|
|
2719
|
+
function Ji({ cells: e, size: t }) {
|
|
2720
|
+
return qi(e, t).map((e, n) => /* @__PURE__ */ Q(J, {
|
|
2720
2721
|
value: null,
|
|
2721
2722
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
2722
2723
|
options: e,
|
|
2723
2724
|
size: t,
|
|
2724
2725
|
ariaLabel: "Randomize scope",
|
|
2725
|
-
className:
|
|
2726
|
+
className: Ui
|
|
2726
2727
|
}, n));
|
|
2727
2728
|
}
|
|
2728
|
-
var
|
|
2729
|
+
var Yi = [
|
|
2729
2730
|
2,
|
|
2730
2731
|
4,
|
|
2731
2732
|
8,
|
|
@@ -2734,17 +2735,17 @@ var Fi = [
|
|
|
2734
2735
|
value: String(e),
|
|
2735
2736
|
label: `${e}s`
|
|
2736
2737
|
}));
|
|
2737
|
-
function
|
|
2738
|
-
let { loopSeconds: t, setLoopSeconds: n } =
|
|
2738
|
+
function Xi({ size: e }) {
|
|
2739
|
+
let { loopSeconds: t, setLoopSeconds: n } = C();
|
|
2739
2740
|
return /* @__PURE__ */ Q(J, {
|
|
2740
2741
|
value: String(t),
|
|
2741
2742
|
onChange: (e) => n(Number(e)),
|
|
2742
|
-
options:
|
|
2743
|
+
options: Yi,
|
|
2743
2744
|
size: e,
|
|
2744
2745
|
ariaLabel: "Loop length"
|
|
2745
2746
|
});
|
|
2746
2747
|
}
|
|
2747
|
-
var
|
|
2748
|
+
var Zi = [
|
|
2748
2749
|
{
|
|
2749
2750
|
value: "9:16",
|
|
2750
2751
|
label: "9:16"
|
|
@@ -2761,7 +2762,7 @@ var Li = [
|
|
|
2761
2762
|
value: "1:1",
|
|
2762
2763
|
label: "1:1"
|
|
2763
2764
|
}
|
|
2764
|
-
],
|
|
2765
|
+
], Qi = [
|
|
2765
2766
|
{
|
|
2766
2767
|
value: "5:4",
|
|
2767
2768
|
label: "5:4"
|
|
@@ -2779,40 +2780,40 @@ var Li = [
|
|
|
2779
2780
|
label: "Fill"
|
|
2780
2781
|
}
|
|
2781
2782
|
];
|
|
2782
|
-
function
|
|
2783
|
-
let
|
|
2783
|
+
function $i({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: d }) {
|
|
2784
|
+
let f = nt(), { updateLayer: h, addFilter: _, removeFilter: v } = o(), { onExportPng: b } = Et(), [x, S] = Z(!1), [C, T] = Z(!0), [D, k] = Z(!1), [A, j] = Z(!1), [te, M] = Z("generate"), [ne, F] = Z(!1), [I, re] = Z(!1), { aspect: L } = o(), [R, ae] = Z(null), z = m(e);
|
|
2784
2785
|
Y(() => {
|
|
2785
|
-
c && (
|
|
2786
|
+
c && (T(!0), j(!0));
|
|
2786
2787
|
}, [c]);
|
|
2787
|
-
let B = l ? "sm" : "lg", oe = l && !!e &&
|
|
2788
|
+
let B = l ? "sm" : "lg", oe = l && !!e && C && !x;
|
|
2788
2789
|
Y(() => (u?.(oe), () => u?.(!1)), [oe]);
|
|
2789
|
-
let se = !l && e &&
|
|
2790
|
-
Y(() => (
|
|
2790
|
+
let se = !l && e && C && !x ? R ? `${R}px` : ne ? gi.tall : gi.half : null;
|
|
2791
|
+
Y(() => (d?.(se), () => d?.(null)), [se]);
|
|
2791
2792
|
let ce = () => {
|
|
2792
2793
|
let t = e?.type === "loop" && N(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2793
|
-
t &&
|
|
2794
|
+
t && h(e.id, H(t, e.loopGroup));
|
|
2794
2795
|
};
|
|
2795
|
-
if (
|
|
2796
|
-
e?.type === "loop" &&
|
|
2796
|
+
if (Kr(ce, () => {
|
|
2797
|
+
e?.type === "loop" && h(e.id, p(e, w(U(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2797
2798
|
}), !e) return null;
|
|
2798
|
-
if (
|
|
2799
|
+
if (x) return /* @__PURE__ */ Q("button", {
|
|
2799
2800
|
"aria-label": "Show controls",
|
|
2800
2801
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
2801
|
-
onClick: () =>
|
|
2802
|
+
onClick: () => S(!1)
|
|
2802
2803
|
});
|
|
2803
|
-
let V = e.type === "loop", le = V ? `${P(e.loopGroup).label} · ${e.presetLabel}` : "Media", ue = V ? U(e.loopId)?.params ?? [] : [], de = V ?
|
|
2804
|
-
let t =
|
|
2805
|
-
t &&
|
|
2806
|
-
}, he =
|
|
2807
|
-
let t =
|
|
2808
|
-
t &&
|
|
2804
|
+
let V = e.type === "loop", le = V ? `${P(e.loopGroup).label} · ${e.presetLabel}` : "Media", ue = V ? U(e.loopId)?.params ?? [] : [], de = V ? E(ue, e) : [], W = () => h(e.id, p(e, w(ue, e), z.take(), { withFilters: !0 })), fe = (t) => h(e.id, p(e, t.params, z.take(), { stripNoRandom: !!t.motion })), me = () => {
|
|
2805
|
+
let t = y(e, z.take());
|
|
2806
|
+
t && h(e.id, t);
|
|
2807
|
+
}, he = g(e), { effectable: ge } = ie(e), _e = () => {
|
|
2808
|
+
let t = ee(e, z.take());
|
|
2809
|
+
t && h(e.id, { filters: t });
|
|
2809
2810
|
};
|
|
2810
|
-
if (!
|
|
2811
|
+
if (!C) return /* @__PURE__ */ $(hi, {
|
|
2811
2812
|
label: V ? e.presetLabel : "Media",
|
|
2812
|
-
onOpen: () =>
|
|
2813
|
+
onOpen: () => T(!0),
|
|
2813
2814
|
size: B,
|
|
2814
2815
|
children: [
|
|
2815
|
-
(V || he.length > 0) && /* @__PURE__ */ Q(
|
|
2816
|
+
(V || he.length > 0) && /* @__PURE__ */ Q(Un, {
|
|
2816
2817
|
label: "Randomize all",
|
|
2817
2818
|
children: /* @__PURE__ */ Q(K, {
|
|
2818
2819
|
tone: "primary",
|
|
@@ -2823,7 +2824,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2823
2824
|
className: "shrink-0"
|
|
2824
2825
|
})
|
|
2825
2826
|
}),
|
|
2826
|
-
/* @__PURE__ */ Q(
|
|
2827
|
+
/* @__PURE__ */ Q(Un, {
|
|
2827
2828
|
label: "Download",
|
|
2828
2829
|
children: /* @__PURE__ */ Q(K, {
|
|
2829
2830
|
tone: "primary",
|
|
@@ -2834,18 +2835,18 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2834
2835
|
className: "shrink-0"
|
|
2835
2836
|
})
|
|
2836
2837
|
}),
|
|
2837
|
-
/* @__PURE__ */ Q(
|
|
2838
|
+
/* @__PURE__ */ Q(Un, {
|
|
2838
2839
|
label: "Hide UI",
|
|
2839
2840
|
children: /* @__PURE__ */ Q(K, {
|
|
2840
2841
|
tone: "primary",
|
|
2841
2842
|
size: B,
|
|
2842
2843
|
iconOnly: "eye-off",
|
|
2843
2844
|
"aria-label": "Hide UI",
|
|
2844
|
-
onClick: () =>
|
|
2845
|
+
onClick: () => S(!0),
|
|
2845
2846
|
className: "shrink-0"
|
|
2846
2847
|
})
|
|
2847
2848
|
}),
|
|
2848
|
-
/* @__PURE__ */ Q(
|
|
2849
|
+
/* @__PURE__ */ Q(Un, {
|
|
2849
2850
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2850
2851
|
children: /* @__PURE__ */ Q(K, {
|
|
2851
2852
|
tone: "primary",
|
|
@@ -2859,11 +2860,11 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2859
2860
|
})
|
|
2860
2861
|
]
|
|
2861
2862
|
});
|
|
2862
|
-
let ve = [...V ?
|
|
2863
|
+
let ve = [...V ? Vi : Hi, ...V && f.steps.length >= 2 ? [{
|
|
2863
2864
|
value: "morph",
|
|
2864
2865
|
label: "Morph"
|
|
2865
|
-
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" ||
|
|
2866
|
-
return /* @__PURE__ */ $(
|
|
2866
|
+
}] : []].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__ */ $(Xn, { children: [
|
|
2867
2868
|
/* @__PURE__ */ Q(pe, {
|
|
2868
2869
|
open: I,
|
|
2869
2870
|
onClose: () => re(!1),
|
|
@@ -2871,52 +2872,52 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2871
2872
|
layer: e,
|
|
2872
2873
|
size: B
|
|
2873
2874
|
}),
|
|
2874
|
-
|
|
2875
|
+
D && /* @__PURE__ */ Q(li, {
|
|
2875
2876
|
onPick: (e) => {
|
|
2876
2877
|
t(e), k(!1);
|
|
2877
2878
|
},
|
|
2878
2879
|
onInsert: () => {
|
|
2879
|
-
k(!1),
|
|
2880
|
+
k(!1), r();
|
|
2880
2881
|
},
|
|
2881
2882
|
onBack: () => {
|
|
2882
|
-
k(!1),
|
|
2883
|
+
k(!1), i();
|
|
2883
2884
|
},
|
|
2884
2885
|
onDismiss: () => k(!1)
|
|
2885
2886
|
}),
|
|
2886
|
-
A && /* @__PURE__ */ Q(
|
|
2887
|
+
A && /* @__PURE__ */ Q(zi, {
|
|
2887
2888
|
layer: e,
|
|
2888
2889
|
chain: he,
|
|
2889
2890
|
onPick: (t) => {
|
|
2890
|
-
|
|
2891
|
+
_(e.id, t), j(!1);
|
|
2891
2892
|
},
|
|
2892
2893
|
onBack: () => j(!1)
|
|
2893
2894
|
}),
|
|
2894
2895
|
/* @__PURE__ */ $("div", {
|
|
2895
2896
|
className: l ? "fixed top-0 right-0 bottom-0 z-10 flex w-[var(--kol-sidenav-w,320px)] flex-col overflow-y-auto border-l border-oq-08" : "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
2896
|
-
style: l ?
|
|
2897
|
-
...
|
|
2898
|
-
top: `calc(100dvh - ${se ??
|
|
2897
|
+
style: l ? Bi : {
|
|
2898
|
+
...Bi,
|
|
2899
|
+
top: `calc(100dvh - ${se ?? gi.half})`
|
|
2899
2900
|
},
|
|
2900
2901
|
children: [
|
|
2901
|
-
!l && /* @__PURE__ */ Q(
|
|
2902
|
+
!l && /* @__PURE__ */ Q(vi, {
|
|
2902
2903
|
tall: ne,
|
|
2903
2904
|
onToggle: () => {
|
|
2904
2905
|
ae(null), F((e) => !e);
|
|
2905
2906
|
},
|
|
2906
2907
|
onResize: (e) => ae(Math.max(96, Math.min(window.innerHeight * .92, e))),
|
|
2907
2908
|
onResizeEnd: (e) => {
|
|
2908
|
-
e < 96 && (ae(null),
|
|
2909
|
+
e < 96 && (ae(null), T(!1));
|
|
2909
2910
|
}
|
|
2910
2911
|
}),
|
|
2911
|
-
/* @__PURE__ */ Q(
|
|
2912
|
+
/* @__PURE__ */ Q(mi, {
|
|
2912
2913
|
title: le,
|
|
2913
|
-
onCollapse: () =>
|
|
2914
|
+
onCollapse: () => T(!1),
|
|
2914
2915
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
2915
2916
|
action: /* @__PURE__ */ Q(K, {
|
|
2916
2917
|
tone: "ghost",
|
|
2917
2918
|
quiet: !0,
|
|
2918
2919
|
size: "sm",
|
|
2919
|
-
onClick:
|
|
2920
|
+
onClick: i,
|
|
2920
2921
|
children: "Start over"
|
|
2921
2922
|
})
|
|
2922
2923
|
}),
|
|
@@ -2928,9 +2929,9 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2928
2929
|
onChange: M,
|
|
2929
2930
|
options: ve,
|
|
2930
2931
|
size: B,
|
|
2931
|
-
className: l ?
|
|
2932
|
+
className: l ? Ui : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2932
2933
|
}),
|
|
2933
|
-
ye === "morph" && V && /* @__PURE__ */ Q(
|
|
2934
|
+
ye === "morph" && V && /* @__PURE__ */ Q(Nr, {
|
|
2934
2935
|
layer: e,
|
|
2935
2936
|
readOnly: !0
|
|
2936
2937
|
}),
|
|
@@ -2962,7 +2963,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2962
2963
|
onClick: W,
|
|
2963
2964
|
children: "Randomize all"
|
|
2964
2965
|
}),
|
|
2965
|
-
/* @__PURE__ */ Q(
|
|
2966
|
+
/* @__PURE__ */ Q(Un, {
|
|
2966
2967
|
label: "What Randomize all rolls",
|
|
2967
2968
|
children: /* @__PURE__ */ Q(K, {
|
|
2968
2969
|
tone: "primary",
|
|
@@ -2973,7 +2974,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2973
2974
|
className: "shrink-0"
|
|
2974
2975
|
})
|
|
2975
2976
|
}),
|
|
2976
|
-
/* @__PURE__ */ Q(
|
|
2977
|
+
/* @__PURE__ */ Q(Un, {
|
|
2977
2978
|
label: "Reset to defaults",
|
|
2978
2979
|
shortcut: "R",
|
|
2979
2980
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -2987,7 +2988,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2987
2988
|
})
|
|
2988
2989
|
]
|
|
2989
2990
|
}),
|
|
2990
|
-
de.length > 0 && /* @__PURE__ */ Q(
|
|
2991
|
+
de.length > 0 && /* @__PURE__ */ Q(Ji, {
|
|
2991
2992
|
size: B,
|
|
2992
2993
|
cells: [...de.map((e) => ({
|
|
2993
2994
|
value: e.id,
|
|
@@ -3025,9 +3026,9 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3025
3026
|
...e,
|
|
3026
3027
|
...t.params,
|
|
3027
3028
|
id: e.id
|
|
3028
|
-
}, i = t.def ?
|
|
3029
|
-
let i =
|
|
3030
|
-
|
|
3029
|
+
}, i = t.def ? E(t.def.params, r) : [], a = (t) => {
|
|
3030
|
+
let i = p(r, t.params, z.take(), { stripNoRandom: !!t.motion }), a = he.map(({ def: e, ...t }) => t);
|
|
3031
|
+
h(e.id, { filters: a.map((e, t) => t === n ? {
|
|
3031
3032
|
...e,
|
|
3032
3033
|
params: {
|
|
3033
3034
|
...e.params,
|
|
@@ -3043,9 +3044,9 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3043
3044
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3044
3045
|
iconLeft: "trash",
|
|
3045
3046
|
iconRight: "trash",
|
|
3046
|
-
onClick: () =>
|
|
3047
|
+
onClick: () => v(e.id, n),
|
|
3047
3048
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3048
|
-
}), i.length > 0 && /* @__PURE__ */ Q(
|
|
3049
|
+
}), i.length > 0 && /* @__PURE__ */ Q(Ji, {
|
|
3049
3050
|
size: B,
|
|
3050
3051
|
cells: i.map((e) => ({
|
|
3051
3052
|
value: e.id,
|
|
@@ -3056,12 +3057,12 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3056
3057
|
}, t.key);
|
|
3057
3058
|
})]
|
|
3058
3059
|
}),
|
|
3059
|
-
ye === "transport" &&
|
|
3060
|
+
ye === "transport" && n("motion") && /* @__PURE__ */ $("div", {
|
|
3060
3061
|
className: "flex flex-col gap-2 pt-3",
|
|
3061
3062
|
children: [(() => {
|
|
3062
|
-
let e =
|
|
3063
|
+
let e = n("motion").TransportBar;
|
|
3063
3064
|
return /* @__PURE__ */ Q(e, { size: B });
|
|
3064
|
-
})(), /* @__PURE__ */ Q(
|
|
3065
|
+
})(), /* @__PURE__ */ Q(Xi, { size: B })]
|
|
3065
3066
|
}),
|
|
3066
3067
|
ye === "output" && /* @__PURE__ */ $("div", {
|
|
3067
3068
|
className: "flex flex-col gap-2 pt-3",
|
|
@@ -3069,14 +3070,14 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3069
3070
|
/* @__PURE__ */ Q(J, {
|
|
3070
3071
|
value: a,
|
|
3071
3072
|
onChange: s,
|
|
3072
|
-
options:
|
|
3073
|
+
options: Zi,
|
|
3073
3074
|
size: B,
|
|
3074
3075
|
ariaLabel: "Aspect"
|
|
3075
3076
|
}),
|
|
3076
3077
|
/* @__PURE__ */ Q(J, {
|
|
3077
3078
|
value: a,
|
|
3078
3079
|
onChange: s,
|
|
3079
|
-
options:
|
|
3080
|
+
options: Qi,
|
|
3080
3081
|
size: B,
|
|
3081
3082
|
ariaLabel: "Aspect (landscape) and fill"
|
|
3082
3083
|
}),
|
|
@@ -3086,7 +3087,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3086
3087
|
/* @__PURE__ */ Q(K, {
|
|
3087
3088
|
tone: "primary",
|
|
3088
3089
|
size: B,
|
|
3089
|
-
onClick: () =>
|
|
3090
|
+
onClick: () => Ot({ focusName: !0 }),
|
|
3090
3091
|
children: "Save…"
|
|
3091
3092
|
}),
|
|
3092
3093
|
/* @__PURE__ */ Q(K, {
|
|
@@ -3098,13 +3099,13 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3098
3099
|
/* @__PURE__ */ Q(K, {
|
|
3099
3100
|
tone: "primary",
|
|
3100
3101
|
size: B,
|
|
3101
|
-
onClick: () =>
|
|
3102
|
+
onClick: () => S(!0),
|
|
3102
3103
|
children: "Hide UI"
|
|
3103
3104
|
}),
|
|
3104
3105
|
/* @__PURE__ */ Q(K, {
|
|
3105
3106
|
tone: "primary",
|
|
3106
3107
|
size: B,
|
|
3107
|
-
onClick:
|
|
3108
|
+
onClick: i,
|
|
3108
3109
|
children: "Start over"
|
|
3109
3110
|
})
|
|
3110
3111
|
]
|
|
@@ -3119,7 +3120,7 @@ function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3119
3120
|
}
|
|
3120
3121
|
//#endregion
|
|
3121
3122
|
//#region src/editor/mobile/MobileView.jsx
|
|
3122
|
-
function
|
|
3123
|
+
function ea({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
3123
3124
|
return /* @__PURE__ */ Q("div", {
|
|
3124
3125
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
3125
3126
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -3137,45 +3138,45 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3137
3138
|
})]
|
|
3138
3139
|
}) : /* @__PURE__ */ Q("span", {
|
|
3139
3140
|
className: "kol-eyebrow text-body",
|
|
3140
|
-
children:
|
|
3141
|
+
children: yn("randomiser").label
|
|
3141
3142
|
}), /* @__PURE__ */ $("div", {
|
|
3142
3143
|
className: "flex flex-col gap-2",
|
|
3143
3144
|
children: [
|
|
3144
3145
|
/* @__PURE__ */ Q(K, {
|
|
3145
3146
|
tone: "primary",
|
|
3146
3147
|
size: "lg",
|
|
3147
|
-
className:
|
|
3148
|
-
iconLeft:
|
|
3149
|
-
iconRight:
|
|
3148
|
+
className: Qt,
|
|
3149
|
+
iconLeft: dn.randomiser,
|
|
3150
|
+
iconRight: dn.randomiser,
|
|
3150
3151
|
onClick: e,
|
|
3151
3152
|
children: "Generate"
|
|
3152
3153
|
}),
|
|
3153
3154
|
/* @__PURE__ */ Q(K, {
|
|
3154
3155
|
tone: "primary",
|
|
3155
3156
|
size: "lg",
|
|
3156
|
-
className:
|
|
3157
|
+
className: Qt,
|
|
3157
3158
|
iconLeft: "filter",
|
|
3158
3159
|
iconRight: "filter",
|
|
3159
3160
|
onClick: t,
|
|
3160
3161
|
children: "Effects"
|
|
3161
3162
|
}),
|
|
3162
|
-
n &&
|
|
3163
|
+
n && Sn() && /* @__PURE__ */ Q(K, {
|
|
3163
3164
|
tone: "primary",
|
|
3164
3165
|
size: "lg",
|
|
3165
3166
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3166
|
-
iconLeft:
|
|
3167
|
-
iconRight:
|
|
3168
|
-
onClick:
|
|
3169
|
-
children:
|
|
3167
|
+
iconLeft: dn.editor,
|
|
3168
|
+
iconRight: dn.editor,
|
|
3169
|
+
onClick: En,
|
|
3170
|
+
children: yn("editor").label
|
|
3170
3171
|
}),
|
|
3171
3172
|
n && /* @__PURE__ */ Q(K, {
|
|
3172
3173
|
tone: "primary",
|
|
3173
3174
|
size: "lg",
|
|
3174
3175
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3175
|
-
iconLeft:
|
|
3176
|
-
iconRight:
|
|
3177
|
-
onClick:
|
|
3178
|
-
children:
|
|
3176
|
+
iconLeft: dn.labs,
|
|
3177
|
+
iconRight: dn.labs,
|
|
3178
|
+
onClick: en,
|
|
3179
|
+
children: yn("labs").label
|
|
3179
3180
|
}),
|
|
3180
3181
|
n && /* @__PURE__ */ Q(K, {
|
|
3181
3182
|
tone: "primary",
|
|
@@ -3183,7 +3184,7 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3183
3184
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3184
3185
|
iconLeft: "swap",
|
|
3185
3186
|
iconRight: "swap",
|
|
3186
|
-
onClick: () =>
|
|
3187
|
+
onClick: () => pn("/morph"),
|
|
3187
3188
|
children: "Morph"
|
|
3188
3189
|
})
|
|
3189
3190
|
]
|
|
@@ -3191,11 +3192,11 @@ function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3191
3192
|
})
|
|
3192
3193
|
});
|
|
3193
3194
|
}
|
|
3194
|
-
function
|
|
3195
|
-
let { layers:
|
|
3195
|
+
function ta() {
|
|
3196
|
+
let { layers: e, addLayer: n, removeLayer: r, updateLayer: i, canvasW: a, canvasH: s, aspect: c, setAspect: l } = o(), { setTool: u } = Nt(), d = hn() && !wn(), f = _n(), p = () => {
|
|
3196
3197
|
let e = new URLSearchParams(window.location.search);
|
|
3197
3198
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3198
|
-
}, [
|
|
3199
|
+
}, [m, h] = Z(p), [g, _] = Z(!1), [v, y] = Z(null), [b, x] = Z("contain"), [S, C] = Z(!1), [w, E] = Z(null), [D, ee] = Z({
|
|
3199
3200
|
s: 1,
|
|
3200
3201
|
x: 0,
|
|
3201
3202
|
y: 0
|
|
@@ -3250,12 +3251,12 @@ function Vi() {
|
|
|
3250
3251
|
}
|
|
3251
3252
|
}, P = (e) => {
|
|
3252
3253
|
let t = j.current;
|
|
3253
|
-
t && t.id === e.pointerId && e.type === "pointerup" &&
|
|
3254
|
+
t && t.id === e.pointerId && e.type === "pointerup" && m === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (F?.type === "loop" ? U(F.loopId) : null)?.group !== "penrose" && O.toggle(), t?.id === e.pointerId && (j.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, ee(A.current.live));
|
|
3254
3255
|
};
|
|
3255
|
-
|
|
3256
|
-
|
|
3256
|
+
or(), Y(() => (nn("randomiser"), () => nn(null)), []), Y(() => {
|
|
3257
|
+
l("4:5"), u("orbit");
|
|
3257
3258
|
}, []);
|
|
3258
|
-
let F =
|
|
3259
|
+
let F = e.find((e) => e.id === v) ?? (e.length === 1 ? e[0] : null), I = m === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
|
|
3259
3260
|
Y(() => {
|
|
3260
3261
|
if (!I) return;
|
|
3261
3262
|
let e = (e) => {
|
|
@@ -3271,43 +3272,43 @@ function Vi() {
|
|
|
3271
3272
|
}, [I]);
|
|
3272
3273
|
let re = (e) => {
|
|
3273
3274
|
let t = R(e);
|
|
3274
|
-
t && (
|
|
3275
|
+
t && (y(n("loop", t)), h("live"));
|
|
3275
3276
|
}, L = (e) => {
|
|
3276
3277
|
let t = R(e);
|
|
3277
|
-
t &&
|
|
3278
|
+
t && v && i(v, t);
|
|
3278
3279
|
}, ie = () => {
|
|
3279
|
-
|
|
3280
|
+
y(n("photo", {
|
|
3280
3281
|
fit: "cover",
|
|
3281
3282
|
x: 0,
|
|
3282
3283
|
y: 0,
|
|
3283
|
-
w:
|
|
3284
|
-
h: Math.round(
|
|
3285
|
-
})),
|
|
3284
|
+
w: t,
|
|
3285
|
+
h: Math.round(t * s / a)
|
|
3286
|
+
})), h("live");
|
|
3286
3287
|
};
|
|
3287
3288
|
Y(() => {
|
|
3288
3289
|
let e = new URL(window.location.href), t = e.searchParams.get("start");
|
|
3289
|
-
t && (t === "effects" && (
|
|
3290
|
+
t && (t === "effects" && (_(!0), ie()), e.searchParams.delete("start"), window.history.replaceState(window.history.state, "", e));
|
|
3290
3291
|
}, []);
|
|
3291
|
-
let ae = (
|
|
3292
|
-
if (
|
|
3293
|
-
|
|
3292
|
+
let ae = (e) => {
|
|
3293
|
+
if (e === "fill") {
|
|
3294
|
+
x("cover");
|
|
3294
3295
|
return;
|
|
3295
3296
|
}
|
|
3296
|
-
|
|
3297
|
-
let n =
|
|
3298
|
-
|
|
3297
|
+
x("contain"), l(e);
|
|
3298
|
+
let n = T[e];
|
|
3299
|
+
v && n && i(v, {
|
|
3299
3300
|
x: 0,
|
|
3300
3301
|
y: 0,
|
|
3301
|
-
w:
|
|
3302
|
-
h: Math.round(
|
|
3302
|
+
w: t,
|
|
3303
|
+
h: Math.round(t * n.h / n.w)
|
|
3303
3304
|
});
|
|
3304
3305
|
}, z = () => {
|
|
3305
|
-
for (let
|
|
3306
|
-
|
|
3306
|
+
for (let t of [...e]) r(t.id);
|
|
3307
|
+
y(null), ee({
|
|
3307
3308
|
s: 1,
|
|
3308
3309
|
x: 0,
|
|
3309
3310
|
y: 0
|
|
3310
|
-
}),
|
|
3311
|
+
}), _(!1), h(p());
|
|
3311
3312
|
};
|
|
3312
3313
|
return /* @__PURE__ */ $("div", {
|
|
3313
3314
|
className: "kol-editor-randomiser relative h-dvh bg-black",
|
|
@@ -3318,40 +3319,40 @@ function Vi() {
|
|
|
3318
3319
|
style: {
|
|
3319
3320
|
transform: M(D),
|
|
3320
3321
|
transformOrigin: "0 0",
|
|
3321
|
-
right:
|
|
3322
|
-
bottom:
|
|
3322
|
+
right: S ? "var(--kol-sidenav-w, 320px)" : 0,
|
|
3323
|
+
bottom: w ?? 0
|
|
3323
3324
|
},
|
|
3324
3325
|
onPointerDownCapture: ne,
|
|
3325
3326
|
onPointerMoveCapture: N,
|
|
3326
3327
|
onPointerUpCapture: P,
|
|
3327
3328
|
onPointerCancelCapture: P,
|
|
3328
3329
|
onPointerLeave: P,
|
|
3329
|
-
children: /* @__PURE__ */ Q(
|
|
3330
|
+
children: /* @__PURE__ */ Q($t, { fit: b })
|
|
3330
3331
|
}),
|
|
3331
|
-
|
|
3332
|
-
chromes:
|
|
3333
|
-
onGenerate: () =>
|
|
3332
|
+
m === "entry" && /* @__PURE__ */ Q(ea, {
|
|
3333
|
+
chromes: d,
|
|
3334
|
+
onGenerate: () => h("category"),
|
|
3334
3335
|
onEffects: () => {
|
|
3335
|
-
|
|
3336
|
+
_(!0), ie();
|
|
3336
3337
|
}
|
|
3337
3338
|
}),
|
|
3338
|
-
|
|
3339
|
+
m === "category" && /* @__PURE__ */ Q(li, {
|
|
3339
3340
|
onPick: re,
|
|
3340
3341
|
onInsert: ie,
|
|
3341
|
-
onBack: () =>
|
|
3342
|
+
onBack: () => h("entry")
|
|
3342
3343
|
}),
|
|
3343
|
-
|
|
3344
|
+
m === "live" && !I && /* @__PURE__ */ Q($i, {
|
|
3344
3345
|
layer: F,
|
|
3345
3346
|
onSwitchCategory: L,
|
|
3346
3347
|
onInsert: () => {
|
|
3347
3348
|
z(), ie();
|
|
3348
3349
|
},
|
|
3349
3350
|
onRestart: z,
|
|
3350
|
-
aspectValue:
|
|
3351
|
-
openEffects:
|
|
3351
|
+
aspectValue: b === "cover" ? "fill" : c,
|
|
3352
|
+
openEffects: g && !I,
|
|
3352
3353
|
onAspect: ae,
|
|
3353
|
-
rail: !
|
|
3354
|
-
onRail:
|
|
3354
|
+
rail: !d && !f,
|
|
3355
|
+
onRail: C,
|
|
3355
3356
|
onSheet: E
|
|
3356
3357
|
}),
|
|
3357
3358
|
I && /* @__PURE__ */ $("div", {
|
|
@@ -3359,7 +3360,7 @@ function Vi() {
|
|
|
3359
3360
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3360
3361
|
children: [/* @__PURE__ */ Q("div", {
|
|
3361
3362
|
className: "flex-1 min-h-0",
|
|
3362
|
-
children: /* @__PURE__ */ Q(
|
|
3363
|
+
children: /* @__PURE__ */ Q(fi, { layer: F })
|
|
3363
3364
|
}), /* @__PURE__ */ Q("div", {
|
|
3364
3365
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3365
3366
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -3373,11 +3374,356 @@ function Vi() {
|
|
|
3373
3374
|
]
|
|
3374
3375
|
});
|
|
3375
3376
|
}
|
|
3376
|
-
function
|
|
3377
|
-
return /* @__PURE__ */ $(
|
|
3377
|
+
function na() {
|
|
3378
|
+
return /* @__PURE__ */ $(fn, {
|
|
3378
3379
|
persistDraft: !1,
|
|
3379
|
-
children: [/* @__PURE__ */ Q(
|
|
3380
|
+
children: [/* @__PURE__ */ Q(ta, {}), /* @__PURE__ */ Q(St, {})]
|
|
3381
|
+
});
|
|
3382
|
+
}
|
|
3383
|
+
//#endregion
|
|
3384
|
+
//#region src/editor/labs/FloatLabs.jsx
|
|
3385
|
+
function ra() {
|
|
3386
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = o(), i = (e) => () => e(), a = (e) => () => window.dispatchEvent(new CustomEvent(e));
|
|
3387
|
+
return {
|
|
3388
|
+
app: {
|
|
3389
|
+
label: "FXR",
|
|
3390
|
+
items: [{
|
|
3391
|
+
label: "Home",
|
|
3392
|
+
onClick: () => pn("/")
|
|
3393
|
+
}, {
|
|
3394
|
+
label: "Settings",
|
|
3395
|
+
onClick: () => pn("/settings")
|
|
3396
|
+
}]
|
|
3397
|
+
},
|
|
3398
|
+
menus: [
|
|
3399
|
+
{
|
|
3400
|
+
label: "File",
|
|
3401
|
+
width: 240,
|
|
3402
|
+
items: [
|
|
3403
|
+
{
|
|
3404
|
+
label: "Files…",
|
|
3405
|
+
kbd: "⌘O",
|
|
3406
|
+
onClick: i(() => Ot())
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
label: "Save patch",
|
|
3410
|
+
kbd: "⌘S",
|
|
3411
|
+
onClick: () => cn("File")
|
|
3412
|
+
},
|
|
3413
|
+
{ divider: !0 },
|
|
3414
|
+
{
|
|
3415
|
+
label: "Output…",
|
|
3416
|
+
onClick: () => cn("Output")
|
|
3417
|
+
},
|
|
3418
|
+
{
|
|
3419
|
+
label: "File…",
|
|
3420
|
+
onClick: () => cn("File")
|
|
3421
|
+
}
|
|
3422
|
+
]
|
|
3423
|
+
},
|
|
3424
|
+
{
|
|
3425
|
+
label: "Edit",
|
|
3426
|
+
width: 220,
|
|
3427
|
+
items: [{
|
|
3428
|
+
label: "Undo",
|
|
3429
|
+
kbd: "⌘Z",
|
|
3430
|
+
disabled: !n,
|
|
3431
|
+
onClick: e
|
|
3432
|
+
}, {
|
|
3433
|
+
label: "Redo",
|
|
3434
|
+
kbd: "⇧⌘Z",
|
|
3435
|
+
disabled: !r,
|
|
3436
|
+
onClick: t
|
|
3437
|
+
}]
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
label: "View",
|
|
3441
|
+
width: 240,
|
|
3442
|
+
items: [
|
|
3443
|
+
{
|
|
3444
|
+
label: "Play / pause",
|
|
3445
|
+
kbd: "Space",
|
|
3446
|
+
onClick: () => O.toggle()
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
label: "Rewind",
|
|
3450
|
+
onClick: () => O.rewind()
|
|
3451
|
+
},
|
|
3452
|
+
{ divider: !0 },
|
|
3453
|
+
{
|
|
3454
|
+
label: "Transport",
|
|
3455
|
+
onClick: () => cn("Transport")
|
|
3456
|
+
},
|
|
3457
|
+
{
|
|
3458
|
+
label: "Shortcuts",
|
|
3459
|
+
kbd: "S",
|
|
3460
|
+
onClick: a("kol:show-shortcuts")
|
|
3461
|
+
}
|
|
3462
|
+
]
|
|
3463
|
+
}
|
|
3464
|
+
],
|
|
3465
|
+
end: [{
|
|
3466
|
+
label: "Help",
|
|
3467
|
+
items: [{
|
|
3468
|
+
label: "Keyboard shortcuts",
|
|
3469
|
+
kbd: "S",
|
|
3470
|
+
onClick: a("kol:show-shortcuts")
|
|
3471
|
+
}]
|
|
3472
|
+
}]
|
|
3473
|
+
};
|
|
3474
|
+
}
|
|
3475
|
+
function ia() {
|
|
3476
|
+
let { addFilter: e, patchFilter: t } = o(), { layer: n, setOnly: r } = W(), i = X(null);
|
|
3477
|
+
Y(() => {
|
|
3478
|
+
n?.type === "photo" && n.src && (i.current = {
|
|
3479
|
+
src: n.src,
|
|
3480
|
+
srcType: n.srcType,
|
|
3481
|
+
fit: n.fit
|
|
3482
|
+
});
|
|
3483
|
+
}, [
|
|
3484
|
+
n?.type,
|
|
3485
|
+
n?.src,
|
|
3486
|
+
n?.srcType,
|
|
3487
|
+
n?.fit
|
|
3488
|
+
]);
|
|
3489
|
+
let a = kr({
|
|
3490
|
+
layer: n,
|
|
3491
|
+
setOnly: r,
|
|
3492
|
+
addFilter: e,
|
|
3493
|
+
patchFilter: t,
|
|
3494
|
+
carriedSource: () => n?.type === "photo" ? {
|
|
3495
|
+
src: n.src,
|
|
3496
|
+
srcType: n.srcType,
|
|
3497
|
+
fit: n.fit
|
|
3498
|
+
} : i.current ?? {}
|
|
3499
|
+
}), s = [], c = /* @__PURE__ */ new Map(), l = null;
|
|
3500
|
+
return a.forEach((e) => {
|
|
3501
|
+
if (e.id.startsWith("sec:")) {
|
|
3502
|
+
s.push({
|
|
3503
|
+
icon: Tr[e.id.slice(4)] ?? "square",
|
|
3504
|
+
label: e.label,
|
|
3505
|
+
path: e.id,
|
|
3506
|
+
sub: []
|
|
3507
|
+
});
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
let t = e.pages ?? [], n = e.onSelect ?? t[0]?.onSelect ?? t[0]?.children?.[0]?.onSelect;
|
|
3511
|
+
n && c.set(e.id, n), (e.active || t.some((e) => e.active || e.children?.some((e) => e.active))) && (l = e.id);
|
|
3512
|
+
let r = {
|
|
3513
|
+
icon: e.icon,
|
|
3514
|
+
label: e.label,
|
|
3515
|
+
path: e.id
|
|
3516
|
+
}, i = s[s.length - 1];
|
|
3517
|
+
i?.sub ? i.sub.push(r) : s.push(r);
|
|
3518
|
+
}), {
|
|
3519
|
+
items: s,
|
|
3520
|
+
active: l,
|
|
3521
|
+
pick: (e) => c.get(e)?.()
|
|
3522
|
+
};
|
|
3523
|
+
}
|
|
3524
|
+
function aa() {
|
|
3525
|
+
let { layer: e } = W(), { removeLayer: t } = o(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam";
|
|
3526
|
+
return /* @__PURE__ */ $("div", {
|
|
3527
|
+
className: "kol-float-labs-stage absolute inset-0 flex items-center justify-center overflow-hidden",
|
|
3528
|
+
style: { background: "var(--kol-surface-secondary)" },
|
|
3529
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
3530
|
+
style: {
|
|
3531
|
+
flex: "none",
|
|
3532
|
+
width: "85%",
|
|
3533
|
+
height: "85%"
|
|
3534
|
+
},
|
|
3535
|
+
children: /* @__PURE__ */ Q(Xt, {})
|
|
3536
|
+
}), n && /* @__PURE__ */ Q(pi, {
|
|
3537
|
+
layer: e,
|
|
3538
|
+
title: xi(e).title,
|
|
3539
|
+
onBack: () => t(e.id)
|
|
3540
|
+
})]
|
|
3541
|
+
});
|
|
3542
|
+
}
|
|
3543
|
+
function oa({ items: e, active: t, onPick: n, className: r }) {
|
|
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 }) {
|
|
3584
|
+
wt();
|
|
3585
|
+
let t = Gn("(max-width: 767px)"), { layer: n } = W(), { undo: r, redo: i, canUndo: a, canRedo: s, selectedId: c, select: l } = o();
|
|
3586
|
+
Y(() => {
|
|
3587
|
+
n && c !== n.id && l(n.id);
|
|
3588
|
+
}, [
|
|
3589
|
+
n,
|
|
3590
|
+
c,
|
|
3591
|
+
l
|
|
3592
|
+
]);
|
|
3593
|
+
let { app: u, menus: d, end: f } = ra(), p = ia(), m = n ? xi(n).title : "Labs", h = e === "float", g = p.items.filter((e) => e.sub?.length).map((e) => e.path), _ = /* @__PURE__ */ Q(er, {
|
|
3594
|
+
name: m || "Untitled",
|
|
3595
|
+
status: "Labs",
|
|
3596
|
+
onBack: () => pn("/"),
|
|
3597
|
+
menuItems: h ? Nn([...d, ...f].map((e) => ({
|
|
3598
|
+
label: e.label,
|
|
3599
|
+
items: e.items
|
|
3600
|
+
}))) : void 0
|
|
3601
|
+
}), v = /* @__PURE__ */ Q(tr, {
|
|
3602
|
+
onUndo: () => a && r(),
|
|
3603
|
+
onRedo: () => s && i(),
|
|
3604
|
+
onAction: () => cn("Output"),
|
|
3605
|
+
onAccount: () => pn("/settings")
|
|
3606
|
+
}), y = /* @__PURE__ */ Q(Qn, {
|
|
3607
|
+
variant: "mobile",
|
|
3608
|
+
shape: "pill",
|
|
3609
|
+
labels: !t,
|
|
3610
|
+
items: rn,
|
|
3611
|
+
sheetItems: tn,
|
|
3612
|
+
currentPath: "/labs",
|
|
3613
|
+
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
|
+
});
|
|
3639
|
+
return /* @__PURE__ */ $("div", {
|
|
3640
|
+
className: "kol-float-labs kol-editor-shell flex flex-col h-full w-full overflow-hidden bg-surface-primary",
|
|
3641
|
+
"data-variant": e,
|
|
3642
|
+
"data-editor-keep-selection": !0,
|
|
3643
|
+
children: [!h && !t && /* @__PURE__ */ Q(nr, {
|
|
3644
|
+
app: u,
|
|
3645
|
+
menus: d,
|
|
3646
|
+
end: f
|
|
3647
|
+
}), /* @__PURE__ */ $("div", {
|
|
3648
|
+
className: "relative flex-1 min-h-0",
|
|
3649
|
+
children: [/* @__PURE__ */ Q(aa, {}), t ? /* @__PURE__ */ $("div", {
|
|
3650
|
+
className: "absolute inset-0 z-[1] pointer-events-none [&>*]:pointer-events-auto",
|
|
3651
|
+
children: [
|
|
3652
|
+
/* @__PURE__ */ Q("div", {
|
|
3653
|
+
className: "absolute left-4 top-5",
|
|
3654
|
+
children: _
|
|
3655
|
+
}),
|
|
3656
|
+
/* @__PURE__ */ Q("div", {
|
|
3657
|
+
className: "absolute right-4 top-[82px] [&_.kol-global-actions]:gap-2",
|
|
3658
|
+
children: v
|
|
3659
|
+
}),
|
|
3660
|
+
h ? /* @__PURE__ */ Q(oa, {
|
|
3661
|
+
items: p.items,
|
|
3662
|
+
active: p.active,
|
|
3663
|
+
onPick: p.pick,
|
|
3664
|
+
className: "absolute! left-4 top-[140px] !h-auto"
|
|
3665
|
+
}) : /* @__PURE__ */ Q(Rn, {
|
|
3666
|
+
variant: "float",
|
|
3667
|
+
items: p.items,
|
|
3668
|
+
currentPath: p.active ?? "",
|
|
3669
|
+
onNavigate: p.pick,
|
|
3670
|
+
title: "Labs",
|
|
3671
|
+
icon: "globe",
|
|
3672
|
+
defaultExpanded: g,
|
|
3673
|
+
className: "absolute! left-4 right-4 top-[140px] h-[180px]! w-auto!"
|
|
3674
|
+
}),
|
|
3675
|
+
/* @__PURE__ */ Q("div", {
|
|
3676
|
+
className: `absolute right-4 ${h ? "left-[100px] top-[140px]" : "left-4 top-[336px]"} bottom-[204px] flex flex-col overflow-y-auto scrollbar-none`,
|
|
3677
|
+
children: b
|
|
3678
|
+
}),
|
|
3679
|
+
y
|
|
3680
|
+
]
|
|
3681
|
+
}) : /* @__PURE__ */ $(Xn, { children: [
|
|
3682
|
+
/* @__PURE__ */ $("div", {
|
|
3683
|
+
className: `absolute top-6 flex flex-col items-start gap-10 ${h ? "left-[120px]" : "left-6"}`,
|
|
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
|
|
3717
|
+
})
|
|
3718
|
+
] })]
|
|
3719
|
+
})]
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
function ca({ variant: e = "editor" }) {
|
|
3723
|
+
return /* @__PURE__ */ $(fn, {
|
|
3724
|
+
draftKey: Li,
|
|
3725
|
+
children: [/* @__PURE__ */ Q(sa, { variant: e }), /* @__PURE__ */ Q(St, {})]
|
|
3380
3726
|
});
|
|
3381
3727
|
}
|
|
3382
3728
|
//#endregion
|
|
3383
|
-
export {
|
|
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, ca as FloatLabsView, ze as GeneratorLibraryProvider, Li as LABS_DRAFT_KEY, Ve as LIBRARY_SLOT_KEYS, Ri as LabsView, Yt as MODES, na 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 };
|