@kolkrabbi/design-editor 0.47.0 → 0.48.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-B85UV79g.js → BindDot-Cx-M0iQt.js} +1 -1
- package/dist/{KolboxView-n6kEPJtV.js → KolboxView-BjYfn_tl.js} +934 -934
- package/dist/{Timeline-EbecYeGh.js → Timeline-CRr43b4B.js} +3 -9
- package/dist/{TreePicker-2RUSyGl4.js → TreePicker-DXsAlHK6.js} +24 -24
- package/dist/{core-9UlJPBwX.js → core-BbKj9Svq.js} +3652 -6014
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +6 -6
- package/dist/{effectCategories-CCpYmxS0.js → effectCategories-wHY9ih8L.js} +32 -32
- package/dist/{effects-DspYFJAM.js → effects-D7J0e5xl.js} +40 -40
- package/dist/effects.js +1 -1
- package/dist/{generators-DY4_ymWh.js → generators-BtRZ3Stj.js} +608 -643
- package/dist/generators.js +1 -1
- package/dist/{host-Bo6itV50.js → host-II9SeVCH.js} +2 -2
- package/dist/kolbox-sheet.js +0 -0
- package/dist/kolbox.css +3 -0
- package/dist/{morphStore-Bm30Ekce.js → morphStore-s-rjCe-y.js} +1 -1
- package/dist/{motion-BOWE4m3Q.js → motion-CKtZAccJ.js} +28 -28
- package/dist/motion.js +1 -1
- package/dist/{rolls-DugKaHUw.js → rolls-Cnu6g8th.js} +2897 -3068
- package/dist/{src-BlvCHYVY.js → src-3UkpFoNW.js} +727 -969
- package/dist/{store-BMGP1qou.js → store-YIW6P2zN.js} +15 -15
- package/dist/{useLayerEdit-B5nF5I9b.js → useLayerEdit-W_Tf3adq.js} +91 -91
- package/package.json +14 -14
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
import { C as e, E as t, T as n, d as r, o as i, s as a, u as o, w as s } from "./__vite-browser-external-y2xWjzgx.js";
|
|
2
|
-
import { $t as c, B as l, D as u, F as d,
|
|
3
|
-
import { n as
|
|
4
|
-
import { C as
|
|
5
|
-
import { r as
|
|
6
|
-
import { A as
|
|
7
|
-
import { b as
|
|
8
|
-
import { a as
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { c as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { Button as J, ButtonGroup as
|
|
15
|
-
import { Suspense as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { IconLoader as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { createPortal as gn } from "react-dom";
|
|
2
|
+
import { $t as c, B as l, D as u, F as d, Gn as f, I as p, In as m, J as h, Kn as g, L as _, Mr as v, P as y, Xn as b, Xt as x, Zn as S, a as C, bn as w, bt as T, d as E, en as D, er as O, f as k, i as A, j, n as M, o as N, p as P, qn as F, r as ee } from "./rolls-Cnu6g8th.js";
|
|
3
|
+
import { n as I, r as L, t as R } from "./useLayerEdit-W_Tf3adq.js";
|
|
4
|
+
import { C as te, D as z, E as B, _ as V, a as H, c as U, d as ne, f as W, g as re, i as ie, l as ae, m as oe, n as se, r as ce, t as le, u as ue, v as G, w as de, x as K, y as fe } from "./effectCategories-wHY9ih8L.js";
|
|
5
|
+
import { r as pe } from "./TreePicker-DXsAlHK6.js";
|
|
6
|
+
import { A as me, F as he, I as ge, M as _e, P as ve, R as ye, V as be, _ as xe, g as Se, h as Ce, j as we, v as Te, x as Ee, y as De, z as Oe } from "./generators-BtRZ3Stj.js";
|
|
7
|
+
import { b as ke, u as Ae } from "./store-YIW6P2zN.js";
|
|
8
|
+
import { a as je, c as Me, d as Ne, f as Pe, i as Fe, l as Ie, n as Le, o as Re, p as ze, r as Be, s as q, t as Ve, u as He } from "./morphStore-s-rjCe-y.js";
|
|
9
|
+
import { n as Ue, r as We, t as Ge } from "./BindDot-Cx-M0iQt.js";
|
|
10
|
+
import { n as Ke, r as qe } from "./effects-D7J0e5xl.js";
|
|
11
|
+
import { c as Je, d as Ye, l as Xe, n as Ze, o as Qe } from "./motion-CKtZAccJ.js";
|
|
12
|
+
import { t as $e } from "./Timeline-CRr43b4B.js";
|
|
13
|
+
import { Ct as et, H as tt, I as nt, K as rt, M as it, Mt as at, N as ot, Nt as st, O as ct, Qt as lt, V as ut, X as dt, _n as ft, _t as pt, c as mt, cn as ht, ct as gt, d as _t, en as vt, h as yt, hn as bt, ht as xt, in as St, j as Ct, jt as wt, l as Tt, m as Et, mn as Dt, nn as Ot, on as kt, ot as At, p as jt, pn as Mt, rn as Nt, s as Pt, sn as Ft, t as It, tn as Lt, u as Rt, un as zt, v as Bt, wt as Vt, xt as Ht } from "./core-BbKj9Svq.js";
|
|
14
|
+
import { Button as J, ButtonGroup as Ut, Divider as Wt, MultiSelect as Gt, StepList as Kt, Tag as qt, Tooltip as Jt, useGrabEdge as Yt, useModal as Xt } from "@kolkrabbi/kol-component";
|
|
15
|
+
import { Suspense as Zt, createContext as Qt, lazy as $t, useContext as en, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as tn } from "react";
|
|
16
|
+
import { Fragment as nn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
17
|
+
import { IconLoader as rn } from "@kolkrabbi/kol-icons";
|
|
18
|
+
import { useDragResize as an, useTheme as on } from "@kolkrabbi/kol-framework";
|
|
19
|
+
import { createPortal as sn } from "react-dom";
|
|
21
20
|
//#region src/editor/kolbox/host.js
|
|
22
|
-
var
|
|
21
|
+
var cn = {
|
|
23
22
|
client: null,
|
|
24
23
|
store: () => null,
|
|
25
24
|
account: null
|
|
26
25
|
};
|
|
27
|
-
function
|
|
28
|
-
let t =
|
|
29
|
-
Object.assign(
|
|
26
|
+
function ln(e) {
|
|
27
|
+
let t = cn.account;
|
|
28
|
+
Object.assign(cn, e), "account" in e && e.account !== t && queueMicrotask(() => window.dispatchEvent(new CustomEvent("kolbox:account")));
|
|
30
29
|
}
|
|
31
|
-
var
|
|
30
|
+
var un = () => cn.client, dn = (e) => cn.store(e), fn = () => cn.account, pn = (e) => {
|
|
32
31
|
let t = e, n = /* @__PURE__ */ new Set(), r = (e) => (n.add(e), () => n.delete(e));
|
|
33
32
|
return {
|
|
34
33
|
set: (e) => {
|
|
35
34
|
e !== t && (t = e, n.forEach((e) => e()));
|
|
36
35
|
},
|
|
37
|
-
use: () =>
|
|
36
|
+
use: () => tn(r, () => t, () => t)
|
|
38
37
|
};
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
var
|
|
38
|
+
}, mn = pn(null), hn = pn(null), gn = mn.set;
|
|
39
|
+
mn.use, hn.set;
|
|
40
|
+
var _n = hn.use, vn = [
|
|
42
41
|
{
|
|
43
42
|
id: "shape",
|
|
44
43
|
label: "Shape",
|
|
@@ -54,7 +53,7 @@ var En = wn.use, Dn = [
|
|
|
54
53
|
label: "Crossfade",
|
|
55
54
|
icon: "dashed-circle"
|
|
56
55
|
}
|
|
57
|
-
],
|
|
56
|
+
], yn = {
|
|
58
57
|
shape: [
|
|
59
58
|
["Loops", ["morph-circle", "star-morph"]],
|
|
60
59
|
["Loops", [
|
|
@@ -128,21 +127,21 @@ var En = wn.use, Dn = [
|
|
|
128
127
|
2
|
|
129
128
|
]
|
|
130
129
|
]
|
|
131
|
-
},
|
|
132
|
-
function
|
|
133
|
-
if (!
|
|
134
|
-
|
|
130
|
+
}, bn = null;
|
|
131
|
+
function xn(e) {
|
|
132
|
+
if (!bn) {
|
|
133
|
+
bn = /* @__PURE__ */ new Map();
|
|
135
134
|
let e = /* @__PURE__ */ new Set();
|
|
136
|
-
for (let t of
|
|
135
|
+
for (let t of oe) for (let n of B(t.id)) e.has(n.id) || fe(n) || (e.add(n.id), bn.has(n.loop) || bn.set(n.loop, []), bn.get(n.loop).push(n));
|
|
137
136
|
}
|
|
138
|
-
return
|
|
137
|
+
return bn.get(e) ?? [];
|
|
139
138
|
}
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
if (
|
|
139
|
+
var Sn = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), Cn = null;
|
|
140
|
+
function wn() {
|
|
141
|
+
if (Cn) return Cn;
|
|
143
142
|
let e = [];
|
|
144
|
-
for (let t of
|
|
145
|
-
let [r] = n, i = t.id === "blend" ?
|
|
143
|
+
for (let t of vn) for (let n of yn[t.id]) {
|
|
144
|
+
let [r] = n, i = t.id === "blend" ? Sn(xn(n[1]), n[2]) : n[1].map((e) => xn(e)[0]);
|
|
146
145
|
if (!i || i.some((e) => !e) || new Set(i.map((e) => e.id)).size < i.length) continue;
|
|
147
146
|
let a = i.map((e) => e.label).join(" → "), o = `ship:morph:${t.id}:${i.map((e) => e.id).join("--")}`;
|
|
148
147
|
e.push({
|
|
@@ -156,7 +155,7 @@ function Nn() {
|
|
|
156
155
|
morph: {
|
|
157
156
|
mode: t.id,
|
|
158
157
|
loopId: i[0].loop,
|
|
159
|
-
steps: i.map(
|
|
158
|
+
steps: i.map(xe),
|
|
160
159
|
curve: "in-out",
|
|
161
160
|
cycle: "loop",
|
|
162
161
|
resolution: 0,
|
|
@@ -165,24 +164,24 @@ function Nn() {
|
|
|
165
164
|
}
|
|
166
165
|
});
|
|
167
166
|
}
|
|
168
|
-
return
|
|
167
|
+
return Cn = e;
|
|
169
168
|
}
|
|
170
|
-
var
|
|
169
|
+
var Tn = () => vn.map((e) => ({
|
|
171
170
|
label: e.label,
|
|
172
|
-
subs: [...new Set(
|
|
173
|
-
})),
|
|
174
|
-
function
|
|
175
|
-
e && (
|
|
171
|
+
subs: [...new Set(wn().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
172
|
+
})), En = (e, t) => wn().find((n) => n.type === e && (!t || n.category === t)), Dn = (e) => wn().find((t) => t.id === e);
|
|
173
|
+
function On(e) {
|
|
174
|
+
e && (Re({
|
|
176
175
|
active: !0,
|
|
177
176
|
...e.morph,
|
|
178
177
|
fileId: null,
|
|
179
178
|
fileName: e.label,
|
|
180
179
|
presetId: e.id
|
|
181
|
-
}), i.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) ||
|
|
180
|
+
}), i.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || bt("/morph"));
|
|
182
181
|
}
|
|
183
182
|
//#endregion
|
|
184
183
|
//#region src/editor/labs/catalog.js
|
|
185
|
-
var
|
|
184
|
+
var kn = {
|
|
186
185
|
"fx:halftone": "ptrn-dot",
|
|
187
186
|
"fx:scanline": "grid-horizontal",
|
|
188
187
|
"fx:crt": "desktop",
|
|
@@ -206,19 +205,19 @@ var Rn = {
|
|
|
206
205
|
"misc:Para Type": "aa",
|
|
207
206
|
"vec:Distressor": "scribble",
|
|
208
207
|
"vec:Modulator": "dashed-circle"
|
|
209
|
-
},
|
|
208
|
+
}, An = {
|
|
210
209
|
effects: "filter",
|
|
211
210
|
generative: "layers",
|
|
212
211
|
vector: "pen-nib",
|
|
213
212
|
composition: "type",
|
|
214
213
|
morph: "swap",
|
|
215
214
|
mode: "mode-toggle-01"
|
|
216
|
-
},
|
|
215
|
+
}, jn = [
|
|
217
216
|
"Moiré",
|
|
218
217
|
"Mesh Gradient",
|
|
219
218
|
"Reaction",
|
|
220
219
|
"Halftone"
|
|
221
|
-
],
|
|
220
|
+
], Mn = [
|
|
222
221
|
{
|
|
223
222
|
label: "Spaced",
|
|
224
223
|
patch: {
|
|
@@ -250,11 +249,11 @@ var Rn = {
|
|
|
250
249
|
label: "Spiral",
|
|
251
250
|
patch: { geometry: "spiral" }
|
|
252
251
|
}
|
|
253
|
-
],
|
|
252
|
+
], Nn = (e = {}) => {
|
|
254
253
|
let t = e.geometry ?? "rows";
|
|
255
254
|
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
256
255
|
};
|
|
257
|
-
function
|
|
256
|
+
function Pn({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
258
257
|
let a = () => e?.type === "photo" ? (e.filters ?? []).filter((e) => e?.id === "fx-media") : [], o = (e, o) => {
|
|
259
258
|
let s = a(), c = t("photo", {
|
|
260
259
|
...i(),
|
|
@@ -269,28 +268,28 @@ function Un({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
269
268
|
fxGroup: e
|
|
270
269
|
}), window.dispatchEvent(new CustomEvent("kol:open-effects"));
|
|
271
270
|
}, c = (e, n) => {
|
|
272
|
-
t("loop",
|
|
271
|
+
t("loop", de(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
273
272
|
}, l = (e) => {
|
|
274
273
|
t("kinetic", {
|
|
275
274
|
presetId: e.id,
|
|
276
275
|
presetLabel: e.label,
|
|
277
|
-
comp:
|
|
276
|
+
comp: Ye(e)
|
|
278
277
|
}), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
279
|
-
}, u = e?.presetId ?? null, d = (e?.filters ?? []).find((e) => e?.id !== "fx-media")?.id ?? null, f = u ?
|
|
280
|
-
let a =
|
|
281
|
-
t("misc",
|
|
278
|
+
}, u = e?.presetId ?? null, d = (e?.filters ?? []).find((e) => e?.id !== "fx-media")?.id ?? null, f = u ? B(e?.loopGroup).find((e) => e.id === u) ?? null : null, p = (n, r = "loop", i) => {
|
|
279
|
+
let a = B(n), o = [...new Set(a.map((e) => e.sub).filter(Boolean))], s = (e) => r === "misc" ? () => {
|
|
280
|
+
t("misc", de(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
282
281
|
} : () => c(e, n);
|
|
283
282
|
return o.length ? o.map((t) => ({
|
|
284
283
|
label: t,
|
|
285
|
-
onSelect: s(
|
|
284
|
+
onSelect: s(z(n, t)[0]),
|
|
286
285
|
active: e?.loopGroup === n && f?.sub === t
|
|
287
286
|
})) : [{
|
|
288
|
-
label: i ??
|
|
287
|
+
label: i ?? V(n).label,
|
|
289
288
|
onSelect: s(a[0]),
|
|
290
289
|
active: e?.loopGroup === n
|
|
291
290
|
}];
|
|
292
291
|
}, m = (e) => e.groups.flatMap((t) => {
|
|
293
|
-
let n = e.labels?.[t] ??
|
|
292
|
+
let n = e.labels?.[t] ?? V(t).label, r = B(t).some((e) => e.sub), i = p(t, "loop", n);
|
|
294
293
|
return e.groups.length > 1 && r ? [{
|
|
295
294
|
label: n,
|
|
296
295
|
children: i
|
|
@@ -301,29 +300,29 @@ function Un({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
301
300
|
id: "color",
|
|
302
301
|
label: "Color",
|
|
303
302
|
icon: "clr-tri",
|
|
304
|
-
onSelect:
|
|
303
|
+
onSelect: Ae,
|
|
305
304
|
pages: []
|
|
306
305
|
},
|
|
307
306
|
{
|
|
308
307
|
id: "sec:effects",
|
|
309
308
|
label: "Effects"
|
|
310
309
|
},
|
|
311
|
-
...
|
|
310
|
+
...ce(W).map((t) => ({
|
|
312
311
|
id: `fx:${t.id}`,
|
|
313
312
|
label: t.label,
|
|
314
|
-
icon:
|
|
315
|
-
pages: t.rack ?
|
|
313
|
+
icon: kn[`fx:${t.id}`] ?? "square",
|
|
314
|
+
pages: t.rack ? le.map((t) => ({
|
|
316
315
|
label: t.label,
|
|
317
316
|
onSelect: () => s(t.id),
|
|
318
317
|
active: e?.fxGroup === t.id
|
|
319
|
-
})) : t.id === "pattern" ?
|
|
318
|
+
})) : t.id === "pattern" ? jn.map((t) => ({
|
|
320
319
|
label: t,
|
|
321
|
-
onSelect: () => c(
|
|
320
|
+
onSelect: () => c(z("optic", t)[0], "optic"),
|
|
322
321
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
323
|
-
})) : t.id === "scanline" ?
|
|
322
|
+
})) : t.id === "scanline" ? Mn.map((t) => ({
|
|
324
323
|
label: t.label,
|
|
325
324
|
onSelect: () => o("scanline", t.patch),
|
|
326
|
-
active: !e?.fxGroup && d === "scanline" &&
|
|
325
|
+
active: !e?.fxGroup && d === "scanline" && Nn((e?.filters ?? []).find((e) => e?.id === "scanline")?.params) === t.label
|
|
327
326
|
})) : t.filters.map((t) => ({
|
|
328
327
|
label: t.label ?? t.id,
|
|
329
328
|
onSelect: () => o(t.id),
|
|
@@ -334,25 +333,25 @@ function Un({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
334
333
|
id: "sec:generative",
|
|
335
334
|
label: "Generative"
|
|
336
335
|
},
|
|
337
|
-
...
|
|
336
|
+
...Oe.map((e) => ({
|
|
338
337
|
id: `gen:${e.label}`,
|
|
339
338
|
label: e.label,
|
|
340
|
-
icon:
|
|
339
|
+
icon: kn[`gen:${e.label}`] ?? "square",
|
|
341
340
|
pages: m(e)
|
|
342
341
|
})),
|
|
343
342
|
{
|
|
344
343
|
id: "sec:morph",
|
|
345
344
|
label: "Morph"
|
|
346
345
|
},
|
|
347
|
-
...
|
|
346
|
+
...vn.map((e) => ({
|
|
348
347
|
id: `morph:${e.id}`,
|
|
349
348
|
label: e.label,
|
|
350
349
|
icon: e.icon,
|
|
351
|
-
pages: [...new Set(
|
|
350
|
+
pages: [...new Set(wn().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
352
351
|
label: t,
|
|
353
|
-
onSelect: () =>
|
|
352
|
+
onSelect: () => On(En(e.id, t)),
|
|
354
353
|
active: (() => {
|
|
355
|
-
let n =
|
|
354
|
+
let n = wn().find((e) => e.id === Le().presetId);
|
|
356
355
|
return n?.type === e.id && n.category === t;
|
|
357
356
|
})()
|
|
358
357
|
}))
|
|
@@ -364,41 +363,41 @@ function Un({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
364
363
|
{
|
|
365
364
|
id: "vec:Distressor",
|
|
366
365
|
label: "Distressor",
|
|
367
|
-
icon:
|
|
366
|
+
icon: kn["vec:Distressor"] ?? "square",
|
|
368
367
|
pages: p("distress")
|
|
369
368
|
},
|
|
370
369
|
{
|
|
371
370
|
id: "vec:Modulator",
|
|
372
371
|
label: "Modulator",
|
|
373
|
-
icon:
|
|
372
|
+
icon: kn["vec:Modulator"] ?? "square",
|
|
374
373
|
pages: p("modulator")
|
|
375
374
|
},
|
|
376
375
|
{
|
|
377
376
|
id: "sec:composition",
|
|
378
377
|
label: "Composition"
|
|
379
378
|
},
|
|
380
|
-
...
|
|
379
|
+
...Xe.map((t) => ({
|
|
381
380
|
id: `kin:${t.label}`,
|
|
382
381
|
label: t.label,
|
|
383
|
-
icon:
|
|
382
|
+
icon: kn[`kin:${t.label}`] ?? "square",
|
|
384
383
|
pages: t.subs.map((t) => ({
|
|
385
384
|
label: t,
|
|
386
|
-
onSelect: () => l(
|
|
387
|
-
active: e?.type === "kinetic" &&
|
|
385
|
+
onSelect: () => l(Je.find((e) => e.sub === t)),
|
|
386
|
+
active: e?.type === "kinetic" && Je.some((e) => e.sub === t && e.id === u)
|
|
388
387
|
}))
|
|
389
388
|
})),
|
|
390
|
-
...
|
|
389
|
+
...be.map((e) => ({
|
|
391
390
|
id: `misc:${e.label}`,
|
|
392
391
|
label: e.label,
|
|
393
|
-
icon:
|
|
392
|
+
icon: kn[`misc:${e.label}`] ?? "square",
|
|
394
393
|
pages: e.groups.flatMap((e) => p(e, "misc"))
|
|
395
394
|
}))
|
|
396
395
|
];
|
|
397
396
|
}
|
|
398
397
|
//#endregion
|
|
399
398
|
//#region src/editor/labs/LabsNav.jsx
|
|
400
|
-
function
|
|
401
|
-
let { addFilter: e, patchFilter: t } =
|
|
399
|
+
function Fn() {
|
|
400
|
+
let { addFilter: e, patchFilter: t } = h(), { layer: n, setOnly: r } = Te(), i = X(null);
|
|
402
401
|
Y(() => {
|
|
403
402
|
n?.type === "photo" && n.src && (i.current = {
|
|
404
403
|
src: n.src,
|
|
@@ -411,7 +410,7 @@ function Wn() {
|
|
|
411
410
|
n?.srcType,
|
|
412
411
|
n?.fit
|
|
413
412
|
]);
|
|
414
|
-
let a =
|
|
413
|
+
let a = Pn({
|
|
415
414
|
layer: n,
|
|
416
415
|
setOnly: r,
|
|
417
416
|
addFilter: e,
|
|
@@ -428,14 +427,14 @@ function Wn() {
|
|
|
428
427
|
if (n.id.startsWith("sec:")) {
|
|
429
428
|
let e = n.id.slice(4);
|
|
430
429
|
t.push({
|
|
431
|
-
icon:
|
|
432
|
-
path: `${
|
|
430
|
+
icon: An[e] ?? "square",
|
|
431
|
+
path: `${Pt}${n.id}`,
|
|
433
432
|
label: n.label,
|
|
434
433
|
sub: []
|
|
435
434
|
});
|
|
436
435
|
return;
|
|
437
436
|
}
|
|
438
|
-
let r = `${
|
|
437
|
+
let r = `${Pt}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
439
438
|
a && e.set(r, a);
|
|
440
439
|
let o = t[t.length - 1], s = {
|
|
441
440
|
icon: n.icon,
|
|
@@ -443,30 +442,30 @@ function Wn() {
|
|
|
443
442
|
label: n.label
|
|
444
443
|
};
|
|
445
444
|
o?.sub ? o.sub.push(s) : t.push(s);
|
|
446
|
-
}),
|
|
445
|
+
}), mt({
|
|
447
446
|
items: t,
|
|
448
447
|
dispatch: (t) => {
|
|
449
448
|
let n = e.get(t);
|
|
450
449
|
return n ? (n(), !0) : !1;
|
|
451
450
|
}
|
|
452
|
-
}), () =>
|
|
451
|
+
}), () => mt(null);
|
|
453
452
|
}), null;
|
|
454
453
|
}
|
|
455
454
|
//#endregion
|
|
456
455
|
//#region src/editor/morph/MorphTab.jsx
|
|
457
|
-
var
|
|
456
|
+
var In = (e, t) => JSON.stringify(e) === JSON.stringify(t), Ln = [
|
|
458
457
|
{
|
|
459
458
|
key: "curve",
|
|
460
459
|
label: "Curve",
|
|
461
460
|
type: "select",
|
|
462
|
-
options:
|
|
461
|
+
options: Ne,
|
|
463
462
|
section: "Curve"
|
|
464
463
|
},
|
|
465
464
|
{
|
|
466
465
|
key: "cycle",
|
|
467
466
|
label: "Cycle",
|
|
468
467
|
type: "select",
|
|
469
|
-
options:
|
|
468
|
+
options: Pe,
|
|
470
469
|
section: "Curve"
|
|
471
470
|
},
|
|
472
471
|
{
|
|
@@ -487,51 +486,51 @@ var Gn = (e, t) => JSON.stringify(e) === JSON.stringify(t), Kn = [
|
|
|
487
486
|
when: (e) => e.mode === "shape"
|
|
488
487
|
}
|
|
489
488
|
];
|
|
490
|
-
function
|
|
491
|
-
let r =
|
|
492
|
-
blend:
|
|
493
|
-
shape:
|
|
494
|
-
crossfade:
|
|
495
|
-
},
|
|
489
|
+
function Rn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
490
|
+
let r = _(), a = He(), { steps: s, curve: c, cycle: l, mode: u, resolution: d, editing: m, fileId: v, editRequest: y } = a, { updateLayer: x, removeLayer: S, setCurrentPresetId: C, setCurrentPresetName: w, palette: T } = h(), { setOnly: E } = Te(), { buildSavedSpec: D } = Vt(), { addItem: O, updateItem: k } = ke(), A = Xt(), j = o(), M = R(e?.id ?? null, { history: "coalesce" }), [N, P] = Z("generate"), F = s[0], ee = s.every((e) => e.loopId === F?.loopId), L = s.filter((e) => !at(K(e.loopId)) || !wt(K(e.loopId))), te = L.length === 0, z = {
|
|
491
|
+
blend: ee ? null : "Blend tweens one generator — these steps are different generators",
|
|
492
|
+
shape: te ? null : `No outline to morph: ${L.map((e) => Me(e, s.indexOf(e))).join(", ")} (GL)`,
|
|
493
|
+
crossfade: te ? null : `Cannot fade: ${L.map((e) => Me(e, s.indexOf(e))).join(", ")} (GL)`
|
|
494
|
+
}, B = [
|
|
496
495
|
{
|
|
497
496
|
value: "shape",
|
|
498
497
|
label: "Shape",
|
|
499
|
-
disabled: !!
|
|
500
|
-
tooltip:
|
|
498
|
+
disabled: !!z.shape,
|
|
499
|
+
tooltip: z.shape ?? void 0
|
|
501
500
|
},
|
|
502
501
|
{
|
|
503
502
|
value: "blend",
|
|
504
503
|
label: "Blend",
|
|
505
|
-
disabled: !!
|
|
506
|
-
tooltip:
|
|
504
|
+
disabled: !!z.blend,
|
|
505
|
+
tooltip: z.blend ?? void 0
|
|
507
506
|
},
|
|
508
507
|
{
|
|
509
508
|
value: "crossfade",
|
|
510
509
|
label: "Crossfade",
|
|
511
|
-
disabled: !!
|
|
512
|
-
tooltip:
|
|
510
|
+
disabled: !!z.crossfade,
|
|
511
|
+
tooltip: z.crossfade ?? void 0
|
|
513
512
|
}
|
|
514
513
|
];
|
|
515
514
|
Y(() => {
|
|
516
|
-
if (t || s.length < 2 || !
|
|
515
|
+
if (t || s.length < 2 || !z[u]) return;
|
|
517
516
|
let e = [
|
|
518
517
|
"shape",
|
|
519
518
|
"crossfade",
|
|
520
519
|
"blend"
|
|
521
|
-
].find((e) => !
|
|
520
|
+
].find((e) => !z[e]);
|
|
522
521
|
e && q({ mode: e });
|
|
523
522
|
}, [
|
|
524
523
|
u,
|
|
525
|
-
|
|
526
|
-
|
|
524
|
+
ee,
|
|
525
|
+
te,
|
|
527
526
|
s.length,
|
|
528
527
|
t
|
|
529
528
|
]), Y(() => {
|
|
530
|
-
!t && s.length === 0 && e?.type === "loop" && e.loopId && !e.morph &&
|
|
529
|
+
!t && s.length === 0 && e?.type === "loop" && e.loopId && !e.morph && Ve(Se(e));
|
|
531
530
|
}, []);
|
|
532
|
-
let
|
|
533
|
-
let t = s.length <
|
|
534
|
-
if (
|
|
531
|
+
let V = X(s.length), H = () => {
|
|
532
|
+
let t = s.length < V.current;
|
|
533
|
+
if (V.current = s.length, s.length < 2) {
|
|
535
534
|
if (!e || !t) return;
|
|
536
535
|
if (s.length === 0) {
|
|
537
536
|
S(e.id);
|
|
@@ -553,16 +552,16 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
553
552
|
return;
|
|
554
553
|
}
|
|
555
554
|
let n = {
|
|
556
|
-
loopGroup:
|
|
557
|
-
presetId:
|
|
558
|
-
presetLabel:
|
|
559
|
-
loopId:
|
|
555
|
+
loopGroup: F.loopGroup,
|
|
556
|
+
presetId: F.presetId,
|
|
557
|
+
presetLabel: F.presetLabel,
|
|
558
|
+
loopId: F.loopId
|
|
560
559
|
}, r = {
|
|
561
560
|
mode: u,
|
|
562
561
|
steps: s.map((e, t) => ({
|
|
563
562
|
loopId: e.loopId,
|
|
564
563
|
params: e.params,
|
|
565
|
-
label:
|
|
564
|
+
label: Me(e, t)
|
|
566
565
|
})),
|
|
567
566
|
cycle: l,
|
|
568
567
|
curve: c,
|
|
@@ -571,9 +570,9 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
571
570
|
name: a.fileName
|
|
572
571
|
}, i = u === "blend" ? {
|
|
573
572
|
...n,
|
|
574
|
-
...
|
|
573
|
+
...ze({
|
|
575
574
|
snapshots: s.map((e) => e.params),
|
|
576
|
-
schema: K(
|
|
575
|
+
schema: K(F.loopId)?.params ?? [],
|
|
577
576
|
curve: c,
|
|
578
577
|
cycle: l
|
|
579
578
|
}).patch,
|
|
@@ -581,45 +580,45 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
581
580
|
morphT: null
|
|
582
581
|
} : {
|
|
583
582
|
...n,
|
|
584
|
-
...
|
|
583
|
+
...F.params,
|
|
585
584
|
morph: r,
|
|
586
585
|
morphT: {
|
|
587
586
|
bind: "track",
|
|
588
|
-
keys:
|
|
587
|
+
keys: st(s.length, l, c)
|
|
589
588
|
}
|
|
590
589
|
};
|
|
591
590
|
e ? x(e.id, i) : E("loop", i);
|
|
592
|
-
},
|
|
593
|
-
|
|
594
|
-
let
|
|
591
|
+
}, U = X(H);
|
|
592
|
+
U.current = H;
|
|
593
|
+
let ne = JSON.stringify([
|
|
595
594
|
u,
|
|
596
595
|
s.map((e) => [e.loopId, e.params]),
|
|
597
596
|
c,
|
|
598
597
|
l,
|
|
599
598
|
d,
|
|
600
599
|
a.syncLoop
|
|
601
|
-
]),
|
|
600
|
+
]), W = X(null);
|
|
602
601
|
Y(() => {
|
|
603
|
-
t ||
|
|
602
|
+
t || m != null || ne === W.current || s.length >= 2 && z[u] || (W.current = ne, U.current());
|
|
604
603
|
}, [
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
ne,
|
|
605
|
+
m,
|
|
607
606
|
s.length,
|
|
608
607
|
t
|
|
609
608
|
]), Y(() => {
|
|
610
|
-
if (t ||
|
|
611
|
-
let n =
|
|
612
|
-
|
|
609
|
+
if (t || m == null || !e) return;
|
|
610
|
+
let n = Be(e, K(e.loopId)?.params ?? []);
|
|
611
|
+
In(n, s[m]?.params) || Ie(m, n);
|
|
613
612
|
}, [e]), Y(() => {
|
|
614
|
-
t || !j ||
|
|
613
|
+
t || !j || m == null || (q({ editing: null }), W.current = null);
|
|
615
614
|
}, [
|
|
616
615
|
j,
|
|
617
|
-
|
|
616
|
+
m,
|
|
618
617
|
t
|
|
619
618
|
]), Y(() => () => {
|
|
620
|
-
!t && a.editing != null && (q({ editing: null }),
|
|
619
|
+
!t && a.editing != null && (q({ editing: null }), U.current());
|
|
621
620
|
}, []);
|
|
622
|
-
let
|
|
621
|
+
let re = (e) => {
|
|
623
622
|
let t = s[e];
|
|
624
623
|
t && (i.pause(), q({ editing: e }), E("loop", {
|
|
625
624
|
loopGroup: t.loopGroup,
|
|
@@ -632,44 +631,44 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
632
631
|
}));
|
|
633
632
|
};
|
|
634
633
|
return Y(() => {
|
|
635
|
-
t || y == null || (q({ editRequest: null }),
|
|
634
|
+
t || y == null || (q({ editRequest: null }), re(y));
|
|
636
635
|
}, [y]), /* @__PURE__ */ $("div", {
|
|
637
636
|
className: "flex flex-col gap-5",
|
|
638
637
|
children: [
|
|
639
|
-
/* @__PURE__ */ Q(
|
|
638
|
+
/* @__PURE__ */ Q(g, {
|
|
640
639
|
layout: "joined",
|
|
641
640
|
tone: "sunken",
|
|
642
641
|
value: u,
|
|
643
642
|
onChange: (e) => !t && q({ mode: e }),
|
|
644
|
-
options:
|
|
643
|
+
options: B,
|
|
645
644
|
size: r,
|
|
646
|
-
className:
|
|
645
|
+
className: p(r)
|
|
647
646
|
}),
|
|
648
647
|
!t && /* @__PURE__ */ Q(b, {
|
|
649
648
|
divided: !0,
|
|
650
|
-
children: /* @__PURE__ */ Q(
|
|
651
|
-
tree:
|
|
652
|
-
presets:
|
|
653
|
-
current:
|
|
649
|
+
children: /* @__PURE__ */ Q(pe, {
|
|
650
|
+
tree: Tn(),
|
|
651
|
+
presets: wn(),
|
|
652
|
+
current: Dn(a.presetId) ?? { typeLabel: vn.find((e) => e.id === u)?.label },
|
|
654
653
|
subLabel: (e) => e.split(" · ").pop(),
|
|
655
|
-
onPick:
|
|
654
|
+
onPick: On
|
|
656
655
|
})
|
|
657
656
|
}),
|
|
658
657
|
/* @__PURE__ */ $(b, {
|
|
659
658
|
divided: !0,
|
|
660
659
|
children: [
|
|
661
|
-
/* @__PURE__ */ Q(
|
|
660
|
+
/* @__PURE__ */ Q(Kt, {
|
|
662
661
|
items: s.map((e, t) => ({
|
|
663
662
|
id: t,
|
|
664
|
-
label:
|
|
663
|
+
label: Me(e, t)
|
|
665
664
|
})),
|
|
666
|
-
activeIndex:
|
|
665
|
+
activeIndex: m,
|
|
667
666
|
reorder: "grab",
|
|
668
667
|
readOnly: t,
|
|
669
668
|
size: r,
|
|
670
|
-
onSelect:
|
|
671
|
-
onRemove:
|
|
672
|
-
onMove:
|
|
669
|
+
onSelect: re,
|
|
670
|
+
onRemove: Fe,
|
|
671
|
+
onMove: je,
|
|
673
672
|
onAdd: () => q({
|
|
674
673
|
active: !0,
|
|
675
674
|
picker: "preset"
|
|
@@ -680,26 +679,26 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
680
679
|
className: "kol-mono-12 text-meta",
|
|
681
680
|
children: "Two steps or more and the stage plays the morph."
|
|
682
681
|
}),
|
|
683
|
-
s.length >= 2 &&
|
|
682
|
+
s.length >= 2 && z[u] && /* @__PURE__ */ Q("p", {
|
|
684
683
|
className: "kol-mono-12 text-meta",
|
|
685
|
-
children:
|
|
684
|
+
children: z[u]
|
|
686
685
|
})
|
|
687
686
|
]
|
|
688
687
|
}),
|
|
689
|
-
|
|
690
|
-
label: `Step ${
|
|
688
|
+
m != null && !t && e && n && /* @__PURE__ */ $(b, {
|
|
689
|
+
label: `Step ${m + 1}`,
|
|
691
690
|
divided: !0,
|
|
692
691
|
children: [
|
|
693
|
-
/* @__PURE__ */ Q(
|
|
692
|
+
/* @__PURE__ */ Q(g, {
|
|
694
693
|
layout: "joined",
|
|
695
694
|
tone: "sunken",
|
|
696
695
|
value: N,
|
|
697
|
-
onChange:
|
|
696
|
+
onChange: P,
|
|
698
697
|
options: n,
|
|
699
698
|
size: r,
|
|
700
|
-
className:
|
|
699
|
+
className: p(r)
|
|
701
700
|
}),
|
|
702
|
-
/* @__PURE__ */ Q(
|
|
701
|
+
/* @__PURE__ */ Q(De, {
|
|
703
702
|
layer: e,
|
|
704
703
|
setProp: M.setProp,
|
|
705
704
|
patch: M.patch,
|
|
@@ -714,14 +713,14 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
714
713
|
className: "kol-mono-12 text-emphasis",
|
|
715
714
|
children: [
|
|
716
715
|
"Editing step ",
|
|
717
|
-
|
|
716
|
+
m + 1,
|
|
718
717
|
" — press Play to run the morph."
|
|
719
718
|
]
|
|
720
719
|
})
|
|
721
720
|
]
|
|
722
721
|
}),
|
|
723
|
-
/* @__PURE__ */ Q(
|
|
724
|
-
schema:
|
|
722
|
+
/* @__PURE__ */ Q(I, {
|
|
723
|
+
schema: Ln,
|
|
725
724
|
layer: a,
|
|
726
725
|
setProp: (e, n) => {
|
|
727
726
|
!t && (typeof n != "object" || !n) && q({ [e]: n });
|
|
@@ -730,15 +729,15 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
730
729
|
}),
|
|
731
730
|
!t && s.length >= 2 && /* @__PURE__ */ Q(b, {
|
|
732
731
|
divided: !0,
|
|
733
|
-
children: /* @__PURE__ */ Q(
|
|
732
|
+
children: /* @__PURE__ */ Q(f, {
|
|
734
733
|
tone: "primary",
|
|
735
734
|
size: r,
|
|
736
735
|
className: "w-full",
|
|
737
736
|
onClick: async () => {
|
|
738
737
|
if (s.length < 2) return;
|
|
739
738
|
let e = a.fileName;
|
|
740
|
-
if (!
|
|
741
|
-
|
|
739
|
+
if (!v && (e = await A.prompt("Name this morph:", ""), e === null)) return;
|
|
740
|
+
m != null && (q({ editing: null }), U.current());
|
|
742
741
|
let t = {
|
|
743
742
|
...await D(e || null),
|
|
744
743
|
mode: "morph",
|
|
@@ -753,8 +752,8 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
753
752
|
seconds: i.getLoopSeconds()
|
|
754
753
|
}
|
|
755
754
|
};
|
|
756
|
-
if (
|
|
757
|
-
k("preset",
|
|
755
|
+
if (v) {
|
|
756
|
+
k("preset", v, t);
|
|
758
757
|
return;
|
|
759
758
|
}
|
|
760
759
|
let n = O("preset", t);
|
|
@@ -763,7 +762,7 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
763
762
|
fileName: e || null
|
|
764
763
|
}), C(n), w(e || null));
|
|
765
764
|
},
|
|
766
|
-
children:
|
|
765
|
+
children: v ? "Save" : "Save…"
|
|
767
766
|
})
|
|
768
767
|
})
|
|
769
768
|
]
|
|
@@ -771,7 +770,7 @@ function qn({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
771
770
|
}
|
|
772
771
|
//#endregion
|
|
773
772
|
//#region src/editor/params/QuickMotion.jsx
|
|
774
|
-
var
|
|
773
|
+
var zn = [
|
|
775
774
|
{
|
|
776
775
|
value: "breathe",
|
|
777
776
|
label: "Breathe",
|
|
@@ -790,26 +789,26 @@ var Jn = [
|
|
|
790
789
|
source: "lfo-square",
|
|
791
790
|
rate: 8
|
|
792
791
|
}
|
|
793
|
-
],
|
|
794
|
-
function
|
|
792
|
+
], Bn = .2;
|
|
793
|
+
function Vn(e) {
|
|
795
794
|
if (!u(e)) return "off";
|
|
796
795
|
if (e.bind !== "mod") return "custom";
|
|
797
|
-
let t =
|
|
796
|
+
let t = zn.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
798
797
|
return t ? t.value : "custom";
|
|
799
798
|
}
|
|
800
|
-
function
|
|
801
|
-
let a =
|
|
799
|
+
function Hn({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
800
|
+
let a = _(), o = D(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && c(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
802
801
|
if (!o.length) return null;
|
|
803
802
|
let s = (e, r) => {
|
|
804
803
|
let a = t[e.key];
|
|
805
804
|
if (r === "off") {
|
|
806
805
|
let r = a?.transform?.range;
|
|
807
|
-
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 :
|
|
806
|
+
n(e.key, Array.isArray(r) ? (r[0] + r[1]) / 2 : j(a, i.getCtx(), t) ?? e.default ?? e.min);
|
|
808
807
|
return;
|
|
809
808
|
}
|
|
810
|
-
let o =
|
|
809
|
+
let o = zn.find((e) => e.value === r);
|
|
811
810
|
if (!o) return;
|
|
812
|
-
let s = Number(
|
|
811
|
+
let s = Number(j(a, i.getCtx(), t) ?? e.default ?? e.min), c = (e.max - e.min) * Bn, l = Math.max(e.min, s - c), u = Math.min(e.max, s + c);
|
|
813
812
|
n(e.key, {
|
|
814
813
|
bind: "mod",
|
|
815
814
|
source: o.source,
|
|
@@ -823,12 +822,12 @@ function Zn({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
823
822
|
label: r,
|
|
824
823
|
divided: !0,
|
|
825
824
|
children: o.map((e) => {
|
|
826
|
-
let n =
|
|
825
|
+
let n = Vn(t[e.key]), r = [
|
|
827
826
|
{
|
|
828
827
|
value: "off",
|
|
829
828
|
label: "Off"
|
|
830
829
|
},
|
|
831
|
-
...
|
|
830
|
+
...zn.map(({ value: e, label: t }) => ({
|
|
832
831
|
value: e,
|
|
833
832
|
label: t
|
|
834
833
|
})),
|
|
@@ -855,7 +854,7 @@ function Zn({ schema: e, layer: t, setProp: n, label: r = "Modulate" }) {
|
|
|
855
854
|
}
|
|
856
855
|
//#endregion
|
|
857
856
|
//#region src/editor/params/InputRows.jsx
|
|
858
|
-
var
|
|
857
|
+
var Un = [
|
|
859
858
|
{
|
|
860
859
|
value: "off",
|
|
861
860
|
label: "Off"
|
|
@@ -880,17 +879,17 @@ var Qn = [
|
|
|
880
879
|
value: "lfo-sine",
|
|
881
880
|
label: "LFO"
|
|
882
881
|
}
|
|
883
|
-
],
|
|
884
|
-
function
|
|
885
|
-
let o =
|
|
882
|
+
], Wn = new Set(Un.map((e) => e.value));
|
|
883
|
+
function Gn({ schema: e, layer: t, setProp: n, inputs: a = null }) {
|
|
884
|
+
let o = _(), s = D(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
886
885
|
if (!s.length) return null;
|
|
887
|
-
let c = new Map(s.map((e) => [e.key, e])), l = (a ?? []).filter((e) => c.has(e)), d = [...l, ...s.map((e) => e.key).filter((e) => !l.includes(e))],
|
|
886
|
+
let c = new Map(s.map((e) => [e.key, e])), l = (a ?? []).filter((e) => c.has(e)), d = [...l, ...s.map((e) => e.key).filter((e) => !l.includes(e))], p = l.length ? l : d.slice(0, 3), m = (e) => {
|
|
888
887
|
let n = t[e];
|
|
889
|
-
return u(n) && n.bind === "mod" &&
|
|
888
|
+
return u(n) && n.bind === "mod" && Wn.has(n.source);
|
|
890
889
|
}, h = d.filter(m), g = (e) => {
|
|
891
890
|
let n = c.get(e);
|
|
892
|
-
return Number(
|
|
893
|
-
},
|
|
891
|
+
return Number(j(t[e], i.getCtx(), t) ?? n.default ?? n.min);
|
|
892
|
+
}, v = (e, i, a = u(t[e]) ? t[e].transform?.base ?? g(e) : g(e)) => {
|
|
894
893
|
let o = c.get(e);
|
|
895
894
|
r(i)?.ensure?.().catch(() => {}), n(e, {
|
|
896
895
|
bind: "mod",
|
|
@@ -901,53 +900,53 @@ function er({ schema: e, layer: t, setProp: n, inputs: a = null }) {
|
|
|
901
900
|
...i.startsWith("lfo") ? { rate: 1 } : {}
|
|
902
901
|
}
|
|
903
902
|
});
|
|
904
|
-
}, y = (e) => n(e, u(t[e]) ? t[e].transform?.base ?? g(e) : g(e)), x =
|
|
903
|
+
}, y = (e) => n(e, u(t[e]) ? t[e].transform?.base ?? g(e) : g(e)), x = p.find((e) => !m(e)) ?? d.find((e) => !m(e));
|
|
905
904
|
return /* @__PURE__ */ $(b, {
|
|
906
905
|
label: "Inputs",
|
|
907
906
|
divided: !0,
|
|
908
|
-
children: [h.map((e) => /* @__PURE__ */ Q(
|
|
907
|
+
children: [h.map((e) => /* @__PURE__ */ Q(Gt, {
|
|
909
908
|
size: o,
|
|
910
909
|
className: "w-full [&>button]:w-full",
|
|
911
910
|
groups: [{
|
|
912
911
|
id: "source",
|
|
913
912
|
label: "Source",
|
|
914
|
-
options:
|
|
913
|
+
options: Un
|
|
915
914
|
}, {
|
|
916
915
|
id: "drives",
|
|
917
916
|
label: "Drives",
|
|
918
917
|
options: d.map((e) => ({
|
|
919
918
|
value: e,
|
|
920
|
-
label: c.get(e).label + (
|
|
919
|
+
label: c.get(e).label + (p.includes(e) ? " ★" : "")
|
|
921
920
|
}))
|
|
922
921
|
}],
|
|
923
922
|
value: {
|
|
924
923
|
source: t[e].source,
|
|
925
924
|
drives: e
|
|
926
925
|
},
|
|
927
|
-
label: `${
|
|
926
|
+
label: `${Un.find((n) => n.value === t[e].source)?.label} → ${c.get(e).label}`,
|
|
928
927
|
onChange: (n, r) => {
|
|
929
928
|
if (n === "source") {
|
|
930
|
-
r === "off" ? y(e) :
|
|
929
|
+
r === "off" ? y(e) : v(e, r);
|
|
931
930
|
return;
|
|
932
931
|
}
|
|
933
932
|
if (r === e || m(r)) return;
|
|
934
933
|
let i = t[e].source;
|
|
935
|
-
y(e),
|
|
934
|
+
y(e), v(r, i);
|
|
936
935
|
}
|
|
937
|
-
}, e)), x && /* @__PURE__ */ Q(
|
|
936
|
+
}, e)), x && /* @__PURE__ */ Q(f, {
|
|
938
937
|
size: o,
|
|
939
938
|
iconLeft: "plus",
|
|
940
939
|
className: "w-full",
|
|
941
|
-
onClick: () =>
|
|
940
|
+
onClick: () => v(x, "mouseX"),
|
|
942
941
|
children: "Add input"
|
|
943
942
|
})]
|
|
944
943
|
});
|
|
945
944
|
}
|
|
946
945
|
//#endregion
|
|
947
946
|
//#region src/editor/labs/ModelSource.jsx
|
|
948
|
-
var
|
|
949
|
-
function
|
|
950
|
-
let n =
|
|
947
|
+
var Kn = /\.(obj|glb|gltf|stl)$/i, qn = (e) => Kn.test(e.key ?? e.name ?? ""), Jn = (e) => (e.match(Kn)?.[1] ?? "obj").toLowerCase(), Yn = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
948
|
+
function Xn({ layer: e, setProp: t }) {
|
|
949
|
+
let n = _(), [r, i] = Z(!1), a = X(null), o = (e, n) => {
|
|
951
950
|
t("meshSrc", e), t("meshType", n);
|
|
952
951
|
};
|
|
953
952
|
return /* @__PURE__ */ $(b, {
|
|
@@ -956,16 +955,16 @@ function ar({ layer: e, setProp: t }) {
|
|
|
956
955
|
children: [
|
|
957
956
|
/* @__PURE__ */ Q("span", {
|
|
958
957
|
className: "kol-mono-12 text-meta truncate",
|
|
959
|
-
children:
|
|
958
|
+
children: Yn(e.meshSrc)
|
|
960
959
|
}),
|
|
961
960
|
/* @__PURE__ */ $("div", {
|
|
962
961
|
className: "grid grid-cols-2 gap-2",
|
|
963
|
-
children: [/* @__PURE__ */ Q(
|
|
962
|
+
children: [/* @__PURE__ */ Q(f, {
|
|
964
963
|
tone: "primary",
|
|
965
964
|
size: n,
|
|
966
965
|
onClick: () => i(!0),
|
|
967
966
|
children: "From library"
|
|
968
|
-
}), /* @__PURE__ */ Q(
|
|
967
|
+
}), /* @__PURE__ */ Q(f, {
|
|
969
968
|
tone: "primary",
|
|
970
969
|
size: n,
|
|
971
970
|
onClick: () => a.current?.click(),
|
|
@@ -981,15 +980,15 @@ function ar({ layer: e, setProp: t }) {
|
|
|
981
980
|
let t = e.target.files?.[0];
|
|
982
981
|
if (e.target.value = "", !t) return;
|
|
983
982
|
let n = new FileReader();
|
|
984
|
-
n.onload = () => o(n.result,
|
|
983
|
+
n.onload = () => o(n.result, Jn(t.name)), n.readAsDataURL(t);
|
|
985
984
|
}
|
|
986
985
|
}),
|
|
987
|
-
/* @__PURE__ */ Q(
|
|
986
|
+
/* @__PURE__ */ Q(Bt, {
|
|
988
987
|
open: r,
|
|
989
|
-
accept:
|
|
988
|
+
accept: qn,
|
|
990
989
|
onClose: () => i(!1),
|
|
991
990
|
onSelect: (e) => {
|
|
992
|
-
i(!1), o(
|
|
991
|
+
i(!1), o(Ct(e), Jn(e));
|
|
993
992
|
}
|
|
994
993
|
})
|
|
995
994
|
]
|
|
@@ -997,23 +996,23 @@ function ar({ layer: e, setProp: t }) {
|
|
|
997
996
|
}
|
|
998
997
|
//#endregion
|
|
999
998
|
//#region src/editor/labs/useLabsKeys.js
|
|
1000
|
-
function
|
|
999
|
+
function Zn(e, t) {
|
|
1001
1000
|
Y(() => {
|
|
1002
1001
|
let n = (n) => {
|
|
1003
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
1002
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || pt(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
1004
1003
|
};
|
|
1005
1004
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
1006
1005
|
});
|
|
1007
1006
|
}
|
|
1008
1007
|
//#endregion
|
|
1009
1008
|
//#region src/editor/labs/LabsParams.jsx
|
|
1010
|
-
var
|
|
1009
|
+
var Qn = [{
|
|
1011
1010
|
value: "effect",
|
|
1012
1011
|
label: "Effect"
|
|
1013
1012
|
}, {
|
|
1014
1013
|
value: "anim",
|
|
1015
1014
|
label: "Motion"
|
|
1016
|
-
}],
|
|
1015
|
+
}], $n = [
|
|
1017
1016
|
{
|
|
1018
1017
|
value: "generate",
|
|
1019
1018
|
label: "Generate"
|
|
@@ -1026,7 +1025,7 @@ var sr = [{
|
|
|
1026
1025
|
value: "anim",
|
|
1027
1026
|
label: "Animation"
|
|
1028
1027
|
}
|
|
1029
|
-
],
|
|
1028
|
+
], er = [
|
|
1030
1029
|
{
|
|
1031
1030
|
value: "generate",
|
|
1032
1031
|
label: "Gen"
|
|
@@ -1040,18 +1039,18 @@ var sr = [{
|
|
|
1040
1039
|
label: "Anim"
|
|
1041
1040
|
}
|
|
1042
1041
|
];
|
|
1043
|
-
function
|
|
1044
|
-
let a =
|
|
1042
|
+
function tr({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 }) {
|
|
1043
|
+
let a = _();
|
|
1045
1044
|
return e?.length ? i ? /* @__PURE__ */ Q("div", {
|
|
1046
1045
|
className: "flex items-center gap-1 flex-wrap",
|
|
1047
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1046
|
+
children: e.map((e) => /* @__PURE__ */ Q(qt, {
|
|
1048
1047
|
size: "xs",
|
|
1049
1048
|
hash: !1,
|
|
1050
1049
|
active: e.value === t,
|
|
1051
1050
|
onClick: () => n(e.value),
|
|
1052
1051
|
children: e.label
|
|
1053
1052
|
}, e.value))
|
|
1054
|
-
}) : /* @__PURE__ */ Q(
|
|
1053
|
+
}) : /* @__PURE__ */ Q(g, {
|
|
1055
1054
|
layout: "joined",
|
|
1056
1055
|
tone: "sunken",
|
|
1057
1056
|
value: t ?? null,
|
|
@@ -1059,29 +1058,29 @@ function ur({ options: e, active: t, onPick: n, spread: r = !1, pills: i = !1 })
|
|
|
1059
1058
|
options: e,
|
|
1060
1059
|
size: a,
|
|
1061
1060
|
ariaLabel: "Siblings",
|
|
1062
|
-
className:
|
|
1061
|
+
className: p(a)
|
|
1063
1062
|
}) : null;
|
|
1064
1063
|
}
|
|
1065
|
-
function
|
|
1066
|
-
let { undo: e, redo: t, canUndo: n, canRedo: r } =
|
|
1064
|
+
function nr() {
|
|
1065
|
+
let { undo: e, redo: t, canUndo: n, canRedo: r } = h(), i = _(), a = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1067
1066
|
"aria-hidden": "true",
|
|
1068
1067
|
className: "invisible pointer-events-none",
|
|
1069
1068
|
children: t
|
|
1070
1069
|
});
|
|
1071
|
-
return /* @__PURE__ */ $(
|
|
1070
|
+
return /* @__PURE__ */ $(nn, { children: [a(n, /* @__PURE__ */ Q(Jt, {
|
|
1072
1071
|
label: "Undo",
|
|
1073
1072
|
shortcut: "⌘Z",
|
|
1074
|
-
children: /* @__PURE__ */ Q(
|
|
1073
|
+
children: /* @__PURE__ */ Q(f, {
|
|
1075
1074
|
size: i,
|
|
1076
1075
|
iconOnly: "arrow-left",
|
|
1077
1076
|
"aria-label": "Undo",
|
|
1078
1077
|
tabIndex: n ? void 0 : -1,
|
|
1079
1078
|
onClick: e
|
|
1080
1079
|
})
|
|
1081
|
-
})), a(r, /* @__PURE__ */ Q(
|
|
1080
|
+
})), a(r, /* @__PURE__ */ Q(Jt, {
|
|
1082
1081
|
label: "Redo",
|
|
1083
1082
|
shortcut: "⇧⌘Z",
|
|
1084
|
-
children: /* @__PURE__ */ Q(
|
|
1083
|
+
children: /* @__PURE__ */ Q(f, {
|
|
1085
1084
|
size: i,
|
|
1086
1085
|
iconOnly: "arrow-right",
|
|
1087
1086
|
"aria-label": "Redo",
|
|
@@ -1090,8 +1089,8 @@ function dr() {
|
|
|
1090
1089
|
})
|
|
1091
1090
|
}))] });
|
|
1092
1091
|
}
|
|
1093
|
-
function
|
|
1094
|
-
let p =
|
|
1092
|
+
function rr({ chips: e, active: t, onPick: n, spread: r, pills: i, title: a, tabStrip: o, preStrip: s, fx: c = !1, scope: l, ghostLabels: u, children: f }) {
|
|
1093
|
+
let p = _() === "sm";
|
|
1095
1094
|
return /* @__PURE__ */ $("div", {
|
|
1096
1095
|
className: `flex flex-col gap-5${c ? " kol-labs-fx" : ""}`,
|
|
1097
1096
|
"data-label-scope": l,
|
|
@@ -1099,11 +1098,11 @@ function fr({ chips: e, active: t, onPick: n, spread: r, pills: i, title: a, tab
|
|
|
1099
1098
|
a && p && /* @__PURE__ */ $("div", {
|
|
1100
1099
|
className: "flex items-center gap-1",
|
|
1101
1100
|
children: [/* @__PURE__ */ Q("p", {
|
|
1102
|
-
className:
|
|
1101
|
+
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
1103
1102
|
children: a
|
|
1104
|
-
}), /* @__PURE__ */ Q(
|
|
1103
|
+
}), /* @__PURE__ */ Q(nr, {})]
|
|
1105
1104
|
}),
|
|
1106
|
-
e && /* @__PURE__ */ Q(
|
|
1105
|
+
e && /* @__PURE__ */ Q(tr, {
|
|
1107
1106
|
options: e,
|
|
1108
1107
|
active: t,
|
|
1109
1108
|
onPick: n,
|
|
@@ -1125,27 +1124,27 @@ function fr({ chips: e, active: t, onPick: n, spread: r, pills: i, title: a, tab
|
|
|
1125
1124
|
]
|
|
1126
1125
|
});
|
|
1127
1126
|
}
|
|
1128
|
-
function
|
|
1129
|
-
let r = t(), i =
|
|
1127
|
+
function ir({ layer: e, showMod: n }) {
|
|
1128
|
+
let r = t(), i = _(), [a, o] = Z("effect");
|
|
1130
1129
|
Y(() => {
|
|
1131
1130
|
let e = () => o("effect");
|
|
1132
1131
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
1133
1132
|
}, []);
|
|
1134
|
-
let { addFilter: l, replaceFilter: u, removeFilter:
|
|
1133
|
+
let { addFilter: l, replaceFilter: u, removeFilter: m, toggleFilter: v, updateLayer: y, palette: w } = h(), T = R(e.id, { history: "coalesce" }), E = x(e), D = E.findIndex((e) => !e.def?.first), O = D < 0 ? E.length : D, A = D < 0 ? null : E[D], j = ce(W).find((e) => e.id === se(A?.id)), N = j?.id === "halftone", ee = N ? (j?.filters ?? []).map((e) => ({
|
|
1135
1134
|
value: e.id,
|
|
1136
1135
|
label: e.label
|
|
1137
|
-
})) : null, te = !
|
|
1136
|
+
})) : null, te = !N && A ? A.def.label : null, z = (t) => {
|
|
1138
1137
|
if (!A) {
|
|
1139
1138
|
l(e.id, t);
|
|
1140
1139
|
return;
|
|
1141
1140
|
}
|
|
1142
1141
|
t !== A.id && u(e.id, O, t);
|
|
1143
|
-
},
|
|
1142
|
+
}, B = E.map(({ def: e, ...t }) => t), V = A ? {
|
|
1144
1143
|
...e,
|
|
1145
1144
|
...A.params,
|
|
1146
1145
|
id: e.id
|
|
1147
|
-
} : e,
|
|
1148
|
-
let r =
|
|
1146
|
+
} : e, H = (e) => (t, n) => {
|
|
1147
|
+
let r = B.map((r, i) => i === e ? {
|
|
1149
1148
|
...r,
|
|
1150
1149
|
params: {
|
|
1151
1150
|
...r.params,
|
|
@@ -1153,12 +1152,12 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1153
1152
|
}
|
|
1154
1153
|
} : r);
|
|
1155
1154
|
T.patch({ filters: r });
|
|
1156
|
-
},
|
|
1157
|
-
layer:
|
|
1155
|
+
}, U = H(O), re = n ? (e) => /* @__PURE__ */ Q(Ge, {
|
|
1156
|
+
layer: V,
|
|
1158
1157
|
param: e,
|
|
1159
|
-
setProp:
|
|
1160
|
-
}) : void 0,
|
|
1161
|
-
let n =
|
|
1158
|
+
setProp: U
|
|
1159
|
+
}) : void 0, ie = (t) => {
|
|
1160
|
+
let n = B.map((e, n) => n === O ? {
|
|
1162
1161
|
...e,
|
|
1163
1162
|
params: {
|
|
1164
1163
|
...e.params,
|
|
@@ -1167,59 +1166,59 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1167
1166
|
} : e);
|
|
1168
1167
|
y(e.id, { filters: n });
|
|
1169
1168
|
};
|
|
1170
|
-
|
|
1171
|
-
A && y(e.id, { filters:
|
|
1169
|
+
Zn(() => {
|
|
1170
|
+
A && y(e.id, { filters: B.map((e, t) => t === 0 ? {
|
|
1172
1171
|
...e,
|
|
1173
1172
|
params: {}
|
|
1174
1173
|
} : e) });
|
|
1175
1174
|
}, () => {
|
|
1176
|
-
A &&
|
|
1175
|
+
A && ie(C(V, M(A.def.params, V), P()));
|
|
1177
1176
|
});
|
|
1178
|
-
let
|
|
1179
|
-
if (
|
|
1177
|
+
let oe = e.fxGroup ? le.find((t) => t.id === e.fxGroup) : null;
|
|
1178
|
+
if (oe) {
|
|
1180
1179
|
let t = {
|
|
1181
1180
|
chain: E,
|
|
1182
1181
|
layer: e,
|
|
1183
|
-
hostView:
|
|
1184
|
-
toggleFilter:
|
|
1185
|
-
removeFilter:
|
|
1186
|
-
setStagePropAt:
|
|
1182
|
+
hostView: V,
|
|
1183
|
+
toggleFilter: v,
|
|
1184
|
+
removeFilter: m,
|
|
1185
|
+
setStagePropAt: H,
|
|
1187
1186
|
palette: w,
|
|
1188
1187
|
showMod: n
|
|
1189
1188
|
}, r = [{
|
|
1190
1189
|
value: "",
|
|
1191
1190
|
label: "Add effect…"
|
|
1192
|
-
}, ...
|
|
1191
|
+
}, ...ne(oe, W).map((e) => ({
|
|
1193
1192
|
value: e.id,
|
|
1194
1193
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1195
1194
|
}))];
|
|
1196
|
-
return /* @__PURE__ */ $(
|
|
1195
|
+
return /* @__PURE__ */ $(rr, {
|
|
1197
1196
|
title: "Effects",
|
|
1198
1197
|
fx: !0,
|
|
1199
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1198
|
+
tabStrip: /* @__PURE__ */ Q(g, {
|
|
1200
1199
|
layout: "joined",
|
|
1201
1200
|
tone: "sunken",
|
|
1202
1201
|
value: a,
|
|
1203
1202
|
onChange: o,
|
|
1204
|
-
options:
|
|
1203
|
+
options: Qn,
|
|
1205
1204
|
size: i,
|
|
1206
|
-
className:
|
|
1205
|
+
className: p(i)
|
|
1207
1206
|
}),
|
|
1208
|
-
children: [a === "effect" && /* @__PURE__ */ $(
|
|
1207
|
+
children: [a === "effect" && /* @__PURE__ */ $(nn, { children: [
|
|
1209
1208
|
/* @__PURE__ */ $(b, {
|
|
1210
1209
|
label: "Effect stack",
|
|
1211
1210
|
divided: !0,
|
|
1212
|
-
children: [E.length === 0 && /* @__PURE__ */ Q(
|
|
1211
|
+
children: [E.length === 0 && /* @__PURE__ */ Q(L, {
|
|
1213
1212
|
className: "kol-mono-10 text-meta",
|
|
1214
1213
|
children: "No effects yet — add one below."
|
|
1215
|
-
}), /* @__PURE__ */ Q(
|
|
1214
|
+
}), /* @__PURE__ */ Q(cr, {
|
|
1216
1215
|
...t,
|
|
1217
1216
|
from: 0
|
|
1218
1217
|
})]
|
|
1219
1218
|
}),
|
|
1220
|
-
/* @__PURE__ */ Q(
|
|
1219
|
+
/* @__PURE__ */ Q(Wt, {}),
|
|
1221
1220
|
E.length < 8 && /* @__PURE__ */ Q(b, {
|
|
1222
|
-
label:
|
|
1221
|
+
label: oe.label,
|
|
1223
1222
|
divided: !0,
|
|
1224
1223
|
children: /* @__PURE__ */ Q(F, {
|
|
1225
1224
|
variant: "subtle",
|
|
@@ -1232,34 +1231,34 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1232
1231
|
}
|
|
1233
1232
|
})
|
|
1234
1233
|
})
|
|
1235
|
-
] }), a === "anim" && A?.def?.sweeps && /* @__PURE__ */ Q(
|
|
1234
|
+
] }), a === "anim" && A?.def?.sweeps && /* @__PURE__ */ Q(qe, {
|
|
1236
1235
|
sweeps: Array.isArray(A.params.sweeps) ? A.params.sweeps : [],
|
|
1237
|
-
onChange: (e) =>
|
|
1236
|
+
onChange: (e) => U("sweeps", e),
|
|
1238
1237
|
inline: !0
|
|
1239
1238
|
})]
|
|
1240
1239
|
});
|
|
1241
1240
|
}
|
|
1242
|
-
if (!A) return /* @__PURE__ */ Q(
|
|
1241
|
+
if (!A) return /* @__PURE__ */ Q(rr, {
|
|
1243
1242
|
chips: ee,
|
|
1244
1243
|
active: null,
|
|
1245
|
-
onPick:
|
|
1246
|
-
spread:
|
|
1244
|
+
onPick: z,
|
|
1245
|
+
spread: N,
|
|
1247
1246
|
fx: !0,
|
|
1248
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1247
|
+
tabStrip: /* @__PURE__ */ Q(g, {
|
|
1249
1248
|
layout: "joined",
|
|
1250
1249
|
tone: "sunken",
|
|
1251
1250
|
value: a,
|
|
1252
1251
|
onChange: o,
|
|
1253
|
-
options:
|
|
1252
|
+
options: Qn,
|
|
1254
1253
|
size: i,
|
|
1255
|
-
className:
|
|
1254
|
+
className: p(i)
|
|
1256
1255
|
}),
|
|
1257
|
-
children: /* @__PURE__ */ Q(
|
|
1258
|
-
schema:
|
|
1256
|
+
children: /* @__PURE__ */ Q(I, {
|
|
1257
|
+
schema: yt,
|
|
1259
1258
|
layer: e,
|
|
1260
1259
|
setProp: T.setProp,
|
|
1261
1260
|
palette: w,
|
|
1262
|
-
renderAnimate: (t) => /* @__PURE__ */ Q(
|
|
1261
|
+
renderAnimate: (t) => /* @__PURE__ */ Q(Ge, {
|
|
1263
1262
|
layer: e,
|
|
1264
1263
|
param: t,
|
|
1265
1264
|
setProp: T.setProp
|
|
@@ -1268,62 +1267,62 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1268
1267
|
emptyHint: "Pick an effect from the nav."
|
|
1269
1268
|
})
|
|
1270
1269
|
});
|
|
1271
|
-
let G = A.def.params.filter((e) => c(e) !== "anim"),
|
|
1272
|
-
if (
|
|
1273
|
-
let e =
|
|
1270
|
+
let G = A.def.params.filter((e) => c(e) !== "anim"), de = ae(A.def.id), K = de ? G.findIndex((e) => e.key === de) : -1, fe = G.length;
|
|
1271
|
+
if (K >= 0) {
|
|
1272
|
+
let e = K;
|
|
1274
1273
|
for (; e + 1 < G.length && G[e + 1].type === "select";) e++;
|
|
1275
|
-
|
|
1274
|
+
fe = e + 1;
|
|
1276
1275
|
}
|
|
1277
|
-
let
|
|
1276
|
+
let pe = K > 0 ? G.slice(0, K) : [], me = K >= 0 ? G.slice(K, fe).map((e) => ({
|
|
1278
1277
|
...e,
|
|
1279
1278
|
section: void 0
|
|
1280
|
-
})) : G,
|
|
1281
|
-
layer:
|
|
1282
|
-
setProp:
|
|
1279
|
+
})) : G, ye = {
|
|
1280
|
+
layer: V,
|
|
1281
|
+
setProp: U,
|
|
1283
1282
|
palette: w,
|
|
1284
1283
|
renderAnimate: re,
|
|
1285
1284
|
inline: !0
|
|
1286
1285
|
};
|
|
1287
|
-
return /* @__PURE__ */ $(
|
|
1286
|
+
return /* @__PURE__ */ $(rr, {
|
|
1288
1287
|
chips: ee,
|
|
1289
1288
|
active: A.id,
|
|
1290
|
-
onPick:
|
|
1291
|
-
spread:
|
|
1289
|
+
onPick: z,
|
|
1290
|
+
spread: N,
|
|
1292
1291
|
title: te,
|
|
1293
1292
|
fx: !0,
|
|
1294
1293
|
scope: A.id,
|
|
1295
1294
|
ghostLabels: A.def.params.map((e) => e.label).filter(Boolean),
|
|
1296
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1295
|
+
tabStrip: /* @__PURE__ */ Q(g, {
|
|
1297
1296
|
layout: "joined",
|
|
1298
1297
|
tone: "sunken",
|
|
1299
1298
|
value: a,
|
|
1300
1299
|
onChange: o,
|
|
1301
|
-
options:
|
|
1300
|
+
options: Qn,
|
|
1302
1301
|
size: i,
|
|
1303
|
-
className:
|
|
1302
|
+
className: p(i)
|
|
1304
1303
|
}),
|
|
1305
|
-
children: [a === "effect" && /* @__PURE__ */ $(
|
|
1306
|
-
|
|
1307
|
-
schema:
|
|
1308
|
-
...
|
|
1304
|
+
children: [a === "effect" && /* @__PURE__ */ $(nn, { children: [
|
|
1305
|
+
pe.length > 0 && /* @__PURE__ */ Q(I, {
|
|
1306
|
+
schema: pe,
|
|
1307
|
+
...ye
|
|
1309
1308
|
}),
|
|
1310
1309
|
/* @__PURE__ */ $(b, {
|
|
1311
1310
|
divided: !0,
|
|
1312
|
-
children: [/* @__PURE__ */ Q(
|
|
1311
|
+
children: [/* @__PURE__ */ Q(I, {
|
|
1313
1312
|
schema: me,
|
|
1314
|
-
...
|
|
1315
|
-
}), /* @__PURE__ */ Q(
|
|
1313
|
+
...ye
|
|
1314
|
+
}), /* @__PURE__ */ Q(Ke, {
|
|
1316
1315
|
inline: !0,
|
|
1317
1316
|
def: A.def,
|
|
1318
|
-
view:
|
|
1317
|
+
view: V,
|
|
1319
1318
|
tab: "effect",
|
|
1320
|
-
onPatch:
|
|
1321
|
-
levels: /* @__PURE__ */ $(
|
|
1319
|
+
onPatch: ie,
|
|
1320
|
+
levels: /* @__PURE__ */ $(nn, { children: [
|
|
1322
1321
|
[
|
|
1323
1322
|
["type", "Type"],
|
|
1324
1323
|
["category", "Category"],
|
|
1325
1324
|
["preset", "Preset"]
|
|
1326
|
-
].filter(([e]) =>
|
|
1325
|
+
].filter(([e]) => _e(A.def, e)).map(([t, n]) => /* @__PURE__ */ Q(f, {
|
|
1327
1326
|
tone: "primary",
|
|
1328
1327
|
size: i,
|
|
1329
1328
|
className: "flex-1 min-w-0",
|
|
@@ -1331,59 +1330,59 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1331
1330
|
onClick: () => {
|
|
1332
1331
|
let n = k(P() >>> 0);
|
|
1333
1332
|
if (t === "preset") {
|
|
1334
|
-
let e =
|
|
1335
|
-
e != null &&
|
|
1333
|
+
let e = ge(A.def, V, n);
|
|
1334
|
+
e != null && ie(ue(A.def, e));
|
|
1336
1335
|
return;
|
|
1337
1336
|
}
|
|
1338
|
-
let r =
|
|
1337
|
+
let r = he(A.id, t, n);
|
|
1339
1338
|
r && u(e.id, O, r);
|
|
1340
1339
|
},
|
|
1341
1340
|
children: n
|
|
1342
1341
|
}, t)),
|
|
1343
|
-
/* @__PURE__ */ Q(
|
|
1342
|
+
/* @__PURE__ */ Q(f, {
|
|
1344
1343
|
tone: "primary",
|
|
1345
1344
|
size: i,
|
|
1346
1345
|
className: "flex-1 min-w-0",
|
|
1347
1346
|
"aria-label": "Randomize settings",
|
|
1348
1347
|
onClick: () => {
|
|
1349
|
-
|
|
1348
|
+
ie(ve(V, M(A.def.params.filter((e) => c(e) !== "anim"), V), k(P() >>> 0)));
|
|
1350
1349
|
},
|
|
1351
1350
|
children: "Settings"
|
|
1352
1351
|
}),
|
|
1353
|
-
/* @__PURE__ */ Q(
|
|
1352
|
+
/* @__PURE__ */ Q(Ee, {
|
|
1354
1353
|
def: A.def,
|
|
1355
1354
|
isFilter: !0
|
|
1356
1355
|
})
|
|
1357
1356
|
] })
|
|
1358
1357
|
})]
|
|
1359
1358
|
}),
|
|
1360
|
-
/* @__PURE__ */ Q(
|
|
1361
|
-
|
|
1362
|
-
schema: G.slice(
|
|
1363
|
-
...
|
|
1364
|
-
}), /* @__PURE__ */ Q(
|
|
1365
|
-
/* @__PURE__ */ Q(
|
|
1359
|
+
/* @__PURE__ */ Q(Wt, {}),
|
|
1360
|
+
fe < G.length && /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q(I, {
|
|
1361
|
+
schema: G.slice(fe),
|
|
1362
|
+
...ye
|
|
1363
|
+
}), /* @__PURE__ */ Q(Wt, {})] }),
|
|
1364
|
+
/* @__PURE__ */ Q(lr, {
|
|
1366
1365
|
chain: E,
|
|
1367
1366
|
from: O + 1,
|
|
1368
1367
|
layer: e,
|
|
1369
|
-
hostView:
|
|
1368
|
+
hostView: V,
|
|
1370
1369
|
addFilter: l,
|
|
1371
|
-
removeFilter:
|
|
1372
|
-
toggleFilter:
|
|
1373
|
-
setStagePropAt:
|
|
1370
|
+
removeFilter: m,
|
|
1371
|
+
toggleFilter: v,
|
|
1372
|
+
setStagePropAt: H,
|
|
1374
1373
|
palette: w,
|
|
1375
1374
|
showMod: n
|
|
1376
1375
|
})
|
|
1377
|
-
] }), a === "anim" && /* @__PURE__ */ $(
|
|
1378
|
-
/* @__PURE__ */ Q(
|
|
1376
|
+
] }), a === "anim" && /* @__PURE__ */ $(nn, { children: [
|
|
1377
|
+
/* @__PURE__ */ Q(Gn, {
|
|
1379
1378
|
schema: A.def.params,
|
|
1380
|
-
layer:
|
|
1381
|
-
setProp:
|
|
1379
|
+
layer: V,
|
|
1380
|
+
setProp: U,
|
|
1382
1381
|
inputs: A.def.inputs
|
|
1383
1382
|
}),
|
|
1384
|
-
/* @__PURE__ */ Q(
|
|
1383
|
+
/* @__PURE__ */ Q(I, {
|
|
1385
1384
|
schema: A.def.params,
|
|
1386
|
-
...
|
|
1385
|
+
...ye,
|
|
1387
1386
|
tab: "anim"
|
|
1388
1387
|
}),
|
|
1389
1388
|
A.def.orbit && /* @__PURE__ */ Q(b, {
|
|
@@ -1393,12 +1392,12 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1393
1392
|
label: "ORBIT (C)",
|
|
1394
1393
|
align: "fill",
|
|
1395
1394
|
labelWidth: d,
|
|
1396
|
-
children: /* @__PURE__ */ Q(
|
|
1395
|
+
children: /* @__PURE__ */ Q(g, {
|
|
1397
1396
|
layout: "joined",
|
|
1398
1397
|
tone: "sunken",
|
|
1399
1398
|
size: i,
|
|
1400
1399
|
className: "w-full",
|
|
1401
|
-
value: r.grab &&
|
|
1400
|
+
value: r.grab && V.orbit !== !1 ? "on" : "off",
|
|
1402
1401
|
options: [{
|
|
1403
1402
|
value: "off",
|
|
1404
1403
|
label: "Off"
|
|
@@ -1407,51 +1406,51 @@ function pr({ layer: e, showMod: n }) {
|
|
|
1407
1406
|
label: "On"
|
|
1408
1407
|
}],
|
|
1409
1408
|
onChange: (e) => {
|
|
1410
|
-
|
|
1409
|
+
U("orbit", e === "on"), e === "on" && !r.grab && s("grab", !0);
|
|
1411
1410
|
}
|
|
1412
1411
|
})
|
|
1413
1412
|
})
|
|
1414
1413
|
}),
|
|
1415
1414
|
/* @__PURE__ */ Q(b, {
|
|
1416
1415
|
divided: !0,
|
|
1417
|
-
children: /* @__PURE__ */ Q(
|
|
1416
|
+
children: /* @__PURE__ */ Q(Ke, {
|
|
1418
1417
|
inline: !0,
|
|
1419
1418
|
def: A.def,
|
|
1420
|
-
view:
|
|
1419
|
+
view: V,
|
|
1421
1420
|
tab: "anim",
|
|
1422
|
-
onPatch:
|
|
1421
|
+
onPatch: ie
|
|
1423
1422
|
})
|
|
1424
1423
|
}),
|
|
1425
|
-
A.def.sweeps && /* @__PURE__ */ Q(
|
|
1424
|
+
A.def.sweeps && /* @__PURE__ */ Q(qe, {
|
|
1426
1425
|
sweeps: Array.isArray(A.params.sweeps) ? A.params.sweeps : [],
|
|
1427
|
-
onChange: (e) =>
|
|
1426
|
+
onChange: (e) => U("sweeps", e),
|
|
1428
1427
|
inline: !0
|
|
1429
1428
|
}),
|
|
1430
|
-
/* @__PURE__ */ Q(
|
|
1429
|
+
/* @__PURE__ */ Q(Hn, {
|
|
1431
1430
|
schema: A.def.params,
|
|
1432
|
-
layer:
|
|
1433
|
-
setProp:
|
|
1431
|
+
layer: V,
|
|
1432
|
+
setProp: U
|
|
1434
1433
|
}),
|
|
1435
|
-
/* @__PURE__ */ Q(
|
|
1434
|
+
/* @__PURE__ */ Q(sr, {
|
|
1436
1435
|
chain: E,
|
|
1437
1436
|
layer: e,
|
|
1438
|
-
hostView:
|
|
1437
|
+
hostView: V,
|
|
1439
1438
|
addFilter: l,
|
|
1440
|
-
removeFilter:
|
|
1441
|
-
setStagePropAt:
|
|
1439
|
+
removeFilter: m,
|
|
1440
|
+
setStagePropAt: H,
|
|
1442
1441
|
palette: w,
|
|
1443
1442
|
showMod: n
|
|
1444
1443
|
})
|
|
1445
1444
|
] })]
|
|
1446
1445
|
});
|
|
1447
1446
|
}
|
|
1448
|
-
var
|
|
1449
|
-
function
|
|
1450
|
-
let { addFilter: i, removeFilter: a, toggleFilter: o } =
|
|
1451
|
-
return /* @__PURE__ */ Q(
|
|
1447
|
+
var ar = W.filter((e) => !e.kind && !e.first);
|
|
1448
|
+
function or({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1449
|
+
let { addFilter: i, removeFilter: a, toggleFilter: o } = h(), s = x(e), c = s.map(({ def: e, ...t }) => t);
|
|
1450
|
+
return /* @__PURE__ */ Q(lr, {
|
|
1452
1451
|
chain: s,
|
|
1453
1452
|
from: 0,
|
|
1454
|
-
filters:
|
|
1453
|
+
filters: ar,
|
|
1455
1454
|
layer: e,
|
|
1456
1455
|
hostView: e,
|
|
1457
1456
|
addFilter: i,
|
|
@@ -1468,27 +1467,27 @@ function hr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1468
1467
|
showMod: r
|
|
1469
1468
|
});
|
|
1470
1469
|
}
|
|
1471
|
-
function
|
|
1472
|
-
let c =
|
|
1470
|
+
function sr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: a, palette: o, showMod: s }) {
|
|
1471
|
+
let c = _(), l = e.findIndex((e) => e.id === "fx-media"), u = l < 0 ? null : e[l], d = u ? {
|
|
1473
1472
|
...n,
|
|
1474
1473
|
...u.params,
|
|
1475
1474
|
id: t.id
|
|
1476
|
-
} : null,
|
|
1475
|
+
} : null, p = u ? a(l) : null;
|
|
1477
1476
|
return /* @__PURE__ */ Q(b, {
|
|
1478
1477
|
label: "Media",
|
|
1479
1478
|
divided: !0,
|
|
1480
|
-
children: u?.def ? /* @__PURE__ */ $(
|
|
1479
|
+
children: u?.def ? /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q(I, {
|
|
1481
1480
|
schema: u.def.params,
|
|
1482
1481
|
layer: d,
|
|
1483
|
-
setProp:
|
|
1482
|
+
setProp: p,
|
|
1484
1483
|
palette: o,
|
|
1485
1484
|
inline: !0,
|
|
1486
|
-
renderAnimate: s ? (e) => /* @__PURE__ */ Q(
|
|
1485
|
+
renderAnimate: s ? (e) => /* @__PURE__ */ Q(Ge, {
|
|
1487
1486
|
layer: d,
|
|
1488
1487
|
param: e,
|
|
1489
|
-
setProp:
|
|
1488
|
+
setProp: p
|
|
1490
1489
|
}) : void 0
|
|
1491
|
-
}), /* @__PURE__ */ Q(
|
|
1490
|
+
}), /* @__PURE__ */ Q(f, {
|
|
1492
1491
|
tone: "primary",
|
|
1493
1492
|
size: c,
|
|
1494
1493
|
className: "w-full",
|
|
@@ -1496,7 +1495,7 @@ function gr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1496
1495
|
iconSize: 12,
|
|
1497
1496
|
onClick: () => i(t.id, l),
|
|
1498
1497
|
children: "Remove media motion"
|
|
1499
|
-
})] }) : e.length < 8 && /* @__PURE__ */ Q(
|
|
1498
|
+
})] }) : e.length < 8 && /* @__PURE__ */ Q(f, {
|
|
1500
1499
|
tone: "primary",
|
|
1501
1500
|
size: c,
|
|
1502
1501
|
className: "w-full",
|
|
@@ -1507,14 +1506,14 @@ function gr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1507
1506
|
})
|
|
1508
1507
|
});
|
|
1509
1508
|
}
|
|
1510
|
-
function
|
|
1511
|
-
let u =
|
|
1509
|
+
function cr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: a, setStagePropAt: o, palette: s, showMod: l }) {
|
|
1510
|
+
let u = _();
|
|
1512
1511
|
return e.slice(t).map((e, d) => {
|
|
1513
|
-
let
|
|
1512
|
+
let p = d + t, m = e.enabled !== !1, h = {
|
|
1514
1513
|
...r,
|
|
1515
1514
|
...e.params,
|
|
1516
1515
|
id: n.id
|
|
1517
|
-
}, g = o(
|
|
1516
|
+
}, g = o(p);
|
|
1518
1517
|
return /* @__PURE__ */ $("div", {
|
|
1519
1518
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1520
1519
|
children: [/* @__PURE__ */ $("div", {
|
|
@@ -1522,38 +1521,38 @@ function _r({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1522
1521
|
children: [/* @__PURE__ */ Q(O, {
|
|
1523
1522
|
size: u,
|
|
1524
1523
|
checked: m,
|
|
1525
|
-
onChange: () => i(n.id,
|
|
1524
|
+
onChange: () => i(n.id, p),
|
|
1526
1525
|
label: e.def?.label ?? e.id
|
|
1527
|
-
}), /* @__PURE__ */ Q(
|
|
1526
|
+
}), /* @__PURE__ */ Q(Jt, {
|
|
1528
1527
|
asChild: !0,
|
|
1529
1528
|
label: "Delete effect",
|
|
1530
|
-
children: /* @__PURE__ */ Q(
|
|
1529
|
+
children: /* @__PURE__ */ Q(f, {
|
|
1531
1530
|
tone: "ghost",
|
|
1532
1531
|
quiet: !0,
|
|
1533
1532
|
size: "xs",
|
|
1534
1533
|
iconOnly: "x",
|
|
1535
1534
|
"aria-label": "Delete effect",
|
|
1536
1535
|
className: "ml-auto shrink-0",
|
|
1537
|
-
onClick: () => a(n.id,
|
|
1536
|
+
onClick: () => a(n.id, p)
|
|
1538
1537
|
})
|
|
1539
1538
|
})]
|
|
1540
|
-
}), m && e.def && /* @__PURE__ */ Q(
|
|
1539
|
+
}), m && e.def && /* @__PURE__ */ Q(I, {
|
|
1541
1540
|
schema: e.def.params.filter((e) => c(e) !== "anim"),
|
|
1542
1541
|
layer: h,
|
|
1543
1542
|
setProp: g,
|
|
1544
1543
|
palette: s,
|
|
1545
1544
|
inline: !0,
|
|
1546
|
-
renderAnimate: l ? (e) => /* @__PURE__ */ Q(
|
|
1545
|
+
renderAnimate: l ? (e) => /* @__PURE__ */ Q(Ge, {
|
|
1547
1546
|
layer: h,
|
|
1548
1547
|
param: e,
|
|
1549
1548
|
setProp: g
|
|
1550
1549
|
}) : void 0
|
|
1551
1550
|
})]
|
|
1552
|
-
}, e.key ??
|
|
1551
|
+
}, e.key ?? p);
|
|
1553
1552
|
});
|
|
1554
1553
|
}
|
|
1555
|
-
function
|
|
1556
|
-
let d =
|
|
1554
|
+
function lr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: a, removeFilter: o, toggleFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
|
|
1555
|
+
let d = _(), f = [{
|
|
1557
1556
|
value: "",
|
|
1558
1557
|
label: "Add FX…"
|
|
1559
1558
|
}, ...(n ?? U(W)).map((e) => ({
|
|
@@ -1563,7 +1562,7 @@ function vr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1563
1562
|
return /* @__PURE__ */ $(b, {
|
|
1564
1563
|
label: "Post-Processing",
|
|
1565
1564
|
divided: !0,
|
|
1566
|
-
children: [/* @__PURE__ */ Q(
|
|
1565
|
+
children: [/* @__PURE__ */ Q(cr, {
|
|
1567
1566
|
chain: e,
|
|
1568
1567
|
from: t,
|
|
1569
1568
|
layer: r,
|
|
@@ -1585,50 +1584,50 @@ function vr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1585
1584
|
})]
|
|
1586
1585
|
});
|
|
1587
1586
|
}
|
|
1588
|
-
function
|
|
1589
|
-
let r =
|
|
1587
|
+
function ur({ layer: e, showMod: t, tree: n }) {
|
|
1588
|
+
let r = _(), [i, a] = Z("generate"), { updateLayer: o, palette: s } = h(), { setOnly: c } = Te(), l = R(e.id, { history: "coalesce" }), u = B(e.loopGroup).find((t) => t.id === e.presetId), d = V(e.loopGroup), f = (n ?? Oe).find((t) => t.groups.includes(e.loopGroup)), m = f?.labels?.[e.loopGroup] ?? d?.label ?? "", v = f && f.label !== m ? `${f.label} / ${m}` : m, y = e.loopGroup === "paratype" && u?.sub === "Glyphs" ? z("paratype", "Glyphs") : null, b = y ? y.map((e) => ({
|
|
1590
1589
|
value: e.id,
|
|
1591
1590
|
label: e.label
|
|
1592
1591
|
})) : null, x = (t) => {
|
|
1593
1592
|
let n = y?.find((e) => e.id === t);
|
|
1594
|
-
n && t !== e.presetId && c(e.type,
|
|
1593
|
+
n && t !== e.presetId && c(e.type, de(n, e.loopGroup));
|
|
1595
1594
|
}, S = () => {
|
|
1596
|
-
u && c(e.type,
|
|
1595
|
+
u && c(e.type, de(u, e.loopGroup));
|
|
1597
1596
|
};
|
|
1598
|
-
return
|
|
1597
|
+
return Zn(S, () => {
|
|
1599
1598
|
let t = K(e.loopId)?.params ?? [];
|
|
1600
|
-
o(e.id, C(e,
|
|
1601
|
-
}), /* @__PURE__ */ $(
|
|
1602
|
-
title:
|
|
1599
|
+
o(e.id, C(e, M(t, e), P(), { withFilters: !0 }));
|
|
1600
|
+
}), /* @__PURE__ */ $(rr, {
|
|
1601
|
+
title: v,
|
|
1603
1602
|
chips: b,
|
|
1604
1603
|
active: e.presetId,
|
|
1605
1604
|
onPick: x,
|
|
1606
1605
|
pills: !0,
|
|
1607
1606
|
scope: e.loopId,
|
|
1608
1607
|
ghostLabels: (K(e.loopId)?.params ?? []).filter((e) => e.type !== "color" && e.label).map((e) => e.label),
|
|
1609
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1608
|
+
tabStrip: /* @__PURE__ */ Q(g, {
|
|
1610
1609
|
layout: "joined",
|
|
1611
1610
|
tone: "sunken",
|
|
1612
1611
|
value: i,
|
|
1613
1612
|
onChange: a,
|
|
1614
|
-
options: r === "sm" ?
|
|
1613
|
+
options: r === "sm" ? $n : er,
|
|
1615
1614
|
size: r,
|
|
1616
|
-
className:
|
|
1615
|
+
className: p(r)
|
|
1617
1616
|
}),
|
|
1618
1617
|
children: [
|
|
1619
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1618
|
+
i === "anim" && /* @__PURE__ */ Q(Gn, {
|
|
1620
1619
|
schema: K(e.loopId)?.params ?? [],
|
|
1621
1620
|
layer: e,
|
|
1622
1621
|
setProp: l.setProp,
|
|
1623
1622
|
inputs: K(e.loopId)?.inputs
|
|
1624
1623
|
}),
|
|
1625
|
-
/* @__PURE__ */ Q(
|
|
1624
|
+
/* @__PURE__ */ Q(De, {
|
|
1626
1625
|
layer: e,
|
|
1627
1626
|
setProp: l.setProp,
|
|
1628
1627
|
patch: l.patch,
|
|
1629
1628
|
updateLayer: o,
|
|
1630
1629
|
palette: s,
|
|
1631
|
-
renderAnimate: t ? (t) => /* @__PURE__ */ Q(
|
|
1630
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Q(Ge, {
|
|
1632
1631
|
layer: e,
|
|
1633
1632
|
param: t,
|
|
1634
1633
|
setProp: l.setProp
|
|
@@ -1639,17 +1638,17 @@ function yr({ layer: e, showMod: t, tree: n }) {
|
|
|
1639
1638
|
inline: !0,
|
|
1640
1639
|
onReset: S
|
|
1641
1640
|
}),
|
|
1642
|
-
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(
|
|
1641
|
+
i === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(Xn, {
|
|
1643
1642
|
layer: e,
|
|
1644
1643
|
setProp: l.setProp
|
|
1645
1644
|
}),
|
|
1646
|
-
i === "style" && /* @__PURE__ */ Q(
|
|
1645
|
+
i === "style" && /* @__PURE__ */ Q(or, {
|
|
1647
1646
|
layer: e,
|
|
1648
1647
|
edit: l,
|
|
1649
1648
|
palette: s,
|
|
1650
1649
|
showMod: t
|
|
1651
1650
|
}),
|
|
1652
|
-
i === "anim" && /* @__PURE__ */ Q(
|
|
1651
|
+
i === "anim" && /* @__PURE__ */ Q(Hn, {
|
|
1653
1652
|
schema: K(e.loopId)?.params ?? [],
|
|
1654
1653
|
layer: e,
|
|
1655
1654
|
setProp: l.setProp
|
|
@@ -1657,39 +1656,39 @@ function yr({ layer: e, showMod: t, tree: n }) {
|
|
|
1657
1656
|
]
|
|
1658
1657
|
});
|
|
1659
1658
|
}
|
|
1660
|
-
function
|
|
1661
|
-
let n =
|
|
1662
|
-
return
|
|
1659
|
+
function dr({ layer: e, showMod: t }) {
|
|
1660
|
+
let n = _(), [r, i] = Z("generate"), { updateLayer: a, palette: o } = h(), { setOnly: s } = Te(), c = R(e.id, { history: "coalesce" }), l = Je.find((t) => t.id === e.presetId), u = Xe.find((e) => e.subs.includes(l?.sub))?.label ?? "Kinetic";
|
|
1661
|
+
return Zn(() => {
|
|
1663
1662
|
l && s("kinetic", {
|
|
1664
1663
|
presetId: l.id,
|
|
1665
1664
|
presetLabel: l.label,
|
|
1666
|
-
comp:
|
|
1665
|
+
comp: Ye(l)
|
|
1667
1666
|
});
|
|
1668
1667
|
}, () => {
|
|
1669
1668
|
let t = P(), n = k(t >>> 0), r = e.comp ?? { instances: [] };
|
|
1670
1669
|
(r.instances ?? []).forEach((e, t) => {
|
|
1671
|
-
r =
|
|
1670
|
+
r = Qe(r, t, n);
|
|
1672
1671
|
}), a(e.id, {
|
|
1673
1672
|
comp: r,
|
|
1674
1673
|
_rollSeed: t
|
|
1675
1674
|
});
|
|
1676
|
-
}), /* @__PURE__ */ Q(
|
|
1675
|
+
}), /* @__PURE__ */ Q(rr, {
|
|
1677
1676
|
title: u,
|
|
1678
|
-
tabStrip: /* @__PURE__ */ Q(
|
|
1677
|
+
tabStrip: /* @__PURE__ */ Q(g, {
|
|
1679
1678
|
layout: "joined",
|
|
1680
1679
|
tone: "sunken",
|
|
1681
1680
|
value: r,
|
|
1682
1681
|
onChange: i,
|
|
1683
|
-
options: n === "sm" ?
|
|
1682
|
+
options: n === "sm" ? $n : er,
|
|
1684
1683
|
size: n,
|
|
1685
|
-
className:
|
|
1684
|
+
className: p(n)
|
|
1686
1685
|
}),
|
|
1687
|
-
children: /* @__PURE__ */ Q(
|
|
1686
|
+
children: /* @__PURE__ */ Q(Ze, {
|
|
1688
1687
|
layer: e,
|
|
1689
1688
|
setProp: c.setProp,
|
|
1690
1689
|
updateLayer: a,
|
|
1691
1690
|
palette: o,
|
|
1692
|
-
renderAnimate: t ? (t) => /* @__PURE__ */ Q(
|
|
1691
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Q(Ge, {
|
|
1693
1692
|
layer: e,
|
|
1694
1693
|
param: t,
|
|
1695
1694
|
setProp: c.setProp
|
|
@@ -1699,37 +1698,37 @@ function br({ layer: e, showMod: t }) {
|
|
|
1699
1698
|
})
|
|
1700
1699
|
});
|
|
1701
1700
|
}
|
|
1702
|
-
function
|
|
1703
|
-
let { layer: e } =
|
|
1701
|
+
function fr() {
|
|
1702
|
+
let { layer: e } = Te(), t = He(), n = _(), r = We();
|
|
1704
1703
|
return Y(() => {
|
|
1705
1704
|
let e = (e) => {
|
|
1706
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1705
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || pt(e) || Ue();
|
|
1707
1706
|
};
|
|
1708
1707
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1709
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1708
|
+
}, []), t.active ? /* @__PURE__ */ Q(rr, {
|
|
1710
1709
|
title: "Morph",
|
|
1711
|
-
children: /* @__PURE__ */ Q(
|
|
1710
|
+
children: /* @__PURE__ */ Q(Rn, {
|
|
1712
1711
|
layer: e,
|
|
1713
|
-
editTabs: n === "sm" ?
|
|
1712
|
+
editTabs: n === "sm" ? $n : er
|
|
1714
1713
|
})
|
|
1715
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1714
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(ir, {
|
|
1716
1715
|
layer: e,
|
|
1717
1716
|
showMod: r
|
|
1718
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1717
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(ur, {
|
|
1719
1718
|
layer: e,
|
|
1720
1719
|
showMod: r
|
|
1721
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1720
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(ur, {
|
|
1722
1721
|
layer: e,
|
|
1723
1722
|
showMod: r,
|
|
1724
|
-
tree:
|
|
1725
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1723
|
+
tree: be
|
|
1724
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(dr, {
|
|
1726
1725
|
layer: e,
|
|
1727
1726
|
showMod: r
|
|
1728
|
-
}, e.id) : /* @__PURE__ */ Q(
|
|
1727
|
+
}, e.id) : /* @__PURE__ */ Q(L, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(L, { children: "Pick an effect or generator from the nav." });
|
|
1729
1728
|
}
|
|
1730
1729
|
//#endregion
|
|
1731
1730
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1732
|
-
function
|
|
1731
|
+
function pr(e) {
|
|
1733
1732
|
Y(() => {
|
|
1734
1733
|
let t = (t) => {
|
|
1735
1734
|
t.key === "Escape" && e?.();
|
|
@@ -1742,8 +1741,8 @@ function Sr(e) {
|
|
|
1742
1741
|
};
|
|
1743
1742
|
}, []);
|
|
1744
1743
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return
|
|
1744
|
+
function mr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1745
|
+
return pr(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1747
1746
|
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",
|
|
1748
1747
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1749
1748
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1756,12 +1755,12 @@ function Cr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1756
1755
|
}),
|
|
1757
1756
|
/* @__PURE__ */ Q("div", {
|
|
1758
1757
|
className: "flex flex-col gap-2",
|
|
1759
|
-
children:
|
|
1760
|
-
let n =
|
|
1758
|
+
children: Oe.map((t) => {
|
|
1759
|
+
let n = kn[`gen:${t.label}`] ?? "square";
|
|
1761
1760
|
return /* @__PURE__ */ Q(J, {
|
|
1762
1761
|
tone: "primary",
|
|
1763
1762
|
size: "lg",
|
|
1764
|
-
className:
|
|
1763
|
+
className: Lt,
|
|
1765
1764
|
iconLeft: n,
|
|
1766
1765
|
iconRight: n,
|
|
1767
1766
|
onClick: () => e(t),
|
|
@@ -1795,11 +1794,11 @@ function Cr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1795
1794
|
}
|
|
1796
1795
|
//#endregion
|
|
1797
1796
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1798
|
-
var
|
|
1799
|
-
function
|
|
1800
|
-
let { patch: t } =
|
|
1797
|
+
var hr = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1798
|
+
function gr(e) {
|
|
1799
|
+
let { patch: t } = R(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1801
1800
|
return {
|
|
1802
|
-
nodes: /* @__PURE__ */ $(
|
|
1801
|
+
nodes: /* @__PURE__ */ $(nn, { children: [/* @__PURE__ */ Q("input", {
|
|
1803
1802
|
ref: n,
|
|
1804
1803
|
type: "file",
|
|
1805
1804
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1819,24 +1818,24 @@ function Tr(e) {
|
|
|
1819
1818
|
});
|
|
1820
1819
|
return;
|
|
1821
1820
|
}
|
|
1822
|
-
|
|
1821
|
+
nt(r).then((e) => t({
|
|
1823
1822
|
src: e,
|
|
1824
1823
|
srcType: "image"
|
|
1825
1824
|
}));
|
|
1826
1825
|
}
|
|
1827
1826
|
}
|
|
1828
|
-
}), /* @__PURE__ */ Q(
|
|
1827
|
+
}), /* @__PURE__ */ Q(Bt, {
|
|
1829
1828
|
open: r,
|
|
1830
|
-
accept: a ?
|
|
1829
|
+
accept: a ? hr : ["image", "video"],
|
|
1831
1830
|
onClose: () => i(!1),
|
|
1832
1831
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1833
1832
|
if (a) {
|
|
1834
|
-
t({ svgSrc:
|
|
1833
|
+
t({ svgSrc: Ct(e) });
|
|
1835
1834
|
return;
|
|
1836
1835
|
}
|
|
1837
1836
|
t({
|
|
1838
|
-
src:
|
|
1839
|
-
srcType:
|
|
1837
|
+
src: Ct(e),
|
|
1838
|
+
srcType: ct(n) ? "video" : "image"
|
|
1840
1839
|
});
|
|
1841
1840
|
}
|
|
1842
1841
|
})] }),
|
|
@@ -1844,7 +1843,7 @@ function Tr(e) {
|
|
|
1844
1843
|
openLibrary: () => i(!0),
|
|
1845
1844
|
openUpload: () => n.current?.click(),
|
|
1846
1845
|
openCamera: () => {
|
|
1847
|
-
|
|
1846
|
+
tt(e.id).then(() => t({
|
|
1848
1847
|
src: null,
|
|
1849
1848
|
srcType: "webcam"
|
|
1850
1849
|
})).catch(() => {});
|
|
@@ -1865,30 +1864,30 @@ function Tr(e) {
|
|
|
1865
1864
|
label: "Camera"
|
|
1866
1865
|
}
|
|
1867
1866
|
].slice(0, 2);
|
|
1868
|
-
function
|
|
1869
|
-
let t =
|
|
1867
|
+
function _r({ layer: e }) {
|
|
1868
|
+
let t = gr(e);
|
|
1870
1869
|
return /* @__PURE__ */ $("div", {
|
|
1871
1870
|
className: "flex flex-col gap-2",
|
|
1872
1871
|
children: [
|
|
1873
|
-
/* @__PURE__ */ Q(
|
|
1872
|
+
/* @__PURE__ */ Q(f, {
|
|
1874
1873
|
tone: "primary",
|
|
1875
1874
|
size: "lg",
|
|
1876
|
-
className:
|
|
1875
|
+
className: Lt,
|
|
1877
1876
|
iconLeft: "image",
|
|
1878
1877
|
iconRight: "image",
|
|
1879
1878
|
onClick: t.openLibrary,
|
|
1880
1879
|
children: "From library"
|
|
1881
1880
|
}),
|
|
1882
|
-
/* @__PURE__ */ Q(
|
|
1881
|
+
/* @__PURE__ */ Q(f, {
|
|
1883
1882
|
tone: "primary",
|
|
1884
1883
|
size: "lg",
|
|
1885
|
-
className:
|
|
1884
|
+
className: Lt,
|
|
1886
1885
|
iconLeft: "upload",
|
|
1887
1886
|
iconRight: "upload",
|
|
1888
1887
|
onClick: t.openUpload,
|
|
1889
1888
|
children: "Upload"
|
|
1890
1889
|
}),
|
|
1891
|
-
!t.svgMode && /* @__PURE__ */ Q(
|
|
1890
|
+
!t.svgMode && /* @__PURE__ */ Q(f, {
|
|
1892
1891
|
tone: "primary",
|
|
1893
1892
|
size: "lg",
|
|
1894
1893
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
@@ -1901,8 +1900,8 @@ function Er({ layer: e }) {
|
|
|
1901
1900
|
]
|
|
1902
1901
|
});
|
|
1903
1902
|
}
|
|
1904
|
-
function
|
|
1905
|
-
return
|
|
1903
|
+
function vr({ layer: e, title: t, onBack: n }) {
|
|
1904
|
+
return pr(n), /* @__PURE__ */ Q("div", {
|
|
1906
1905
|
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",
|
|
1907
1906
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1908
1907
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1919,11 +1918,11 @@ function Dr({ layer: e, title: t, onBack: n }) {
|
|
|
1919
1918
|
children: "Pick the media it works on."
|
|
1920
1919
|
})]
|
|
1921
1920
|
}),
|
|
1922
|
-
/* @__PURE__ */ Q(
|
|
1923
|
-
/* @__PURE__ */ Q(
|
|
1921
|
+
/* @__PURE__ */ Q(_r, { layer: e }),
|
|
1922
|
+
/* @__PURE__ */ Q(f, {
|
|
1924
1923
|
tone: "grey",
|
|
1925
1924
|
size: "lg",
|
|
1926
|
-
className:
|
|
1925
|
+
className: Lt,
|
|
1927
1926
|
iconLeft: "arrow-left",
|
|
1928
1927
|
iconRight: "arrow-left",
|
|
1929
1928
|
onClick: n,
|
|
@@ -1935,13 +1934,13 @@ function Dr({ layer: e, title: t, onBack: n }) {
|
|
|
1935
1934
|
}
|
|
1936
1935
|
//#endregion
|
|
1937
1936
|
//#region src/editor/components/PanelHeader.jsx
|
|
1938
|
-
function
|
|
1937
|
+
function yr({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1939
1938
|
return /* @__PURE__ */ $("div", {
|
|
1940
1939
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1941
1940
|
children: [/* @__PURE__ */ $("button", {
|
|
1942
1941
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1943
1942
|
onClick: t,
|
|
1944
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1943
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(rn, {
|
|
1945
1944
|
name: "chevron-down",
|
|
1946
1945
|
size: 16,
|
|
1947
1946
|
className: "text-oq-48"
|
|
@@ -1949,7 +1948,7 @@ function Or({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1949
1948
|
}), n]
|
|
1950
1949
|
});
|
|
1951
1950
|
}
|
|
1952
|
-
function
|
|
1951
|
+
function br({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1953
1952
|
return /* @__PURE__ */ $("div", {
|
|
1954
1953
|
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",
|
|
1955
1954
|
children: [/* @__PURE__ */ Q(J, {
|
|
@@ -1962,7 +1961,7 @@ function kr({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1962
1961
|
children: [/* @__PURE__ */ Q("span", {
|
|
1963
1962
|
className: "truncate",
|
|
1964
1963
|
children: e
|
|
1965
|
-
}), /* @__PURE__ */ Q(
|
|
1964
|
+
}), /* @__PURE__ */ Q(rn, {
|
|
1966
1965
|
name: "chevron-down",
|
|
1967
1966
|
size: 16,
|
|
1968
1967
|
className: "rotate-180 shrink-0"
|
|
@@ -1971,13 +1970,13 @@ function kr({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1971
1970
|
}), i]
|
|
1972
1971
|
});
|
|
1973
1972
|
}
|
|
1974
|
-
var
|
|
1973
|
+
var xr = {
|
|
1975
1974
|
half: "50dvh",
|
|
1976
1975
|
tall: "85dvh"
|
|
1977
|
-
},
|
|
1978
|
-
function
|
|
1976
|
+
}, Sr = 4;
|
|
1977
|
+
function Cr({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1979
1978
|
let a = X(null);
|
|
1980
|
-
|
|
1979
|
+
Yt(a, { axis: "x" });
|
|
1981
1980
|
let o = X({
|
|
1982
1981
|
y: null,
|
|
1983
1982
|
h0: 0,
|
|
@@ -1997,7 +1996,7 @@ function Mr({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1997
1996
|
onPointerMove: (e) => {
|
|
1998
1997
|
if (o.y === null) return;
|
|
1999
1998
|
let t = e.clientY - o.y;
|
|
2000
|
-
Math.abs(t) >
|
|
1999
|
+
Math.abs(t) > Sr && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
2001
2000
|
},
|
|
2002
2001
|
onPointerUp: (e) => {
|
|
2003
2002
|
if (o.y === null) return;
|
|
@@ -2019,10 +2018,10 @@ function Mr({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
2019
2018
|
}
|
|
2020
2019
|
//#endregion
|
|
2021
2020
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
2022
|
-
var
|
|
2023
|
-
function
|
|
2024
|
-
let { items: a, dispatch: o } =
|
|
2025
|
-
|
|
2021
|
+
var wr = new Set(["#rail/sec:effects"]);
|
|
2022
|
+
function Tr({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2023
|
+
let { items: a, dispatch: o } = Tt(), [s, c] = Z(n);
|
|
2024
|
+
pr(t);
|
|
2026
2025
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
2027
2026
|
return /* @__PURE__ */ Q("div", {
|
|
2028
2027
|
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",
|
|
@@ -2041,11 +2040,11 @@ function Pr({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2041
2040
|
children: [u.map((t) => /* @__PURE__ */ Q(J, {
|
|
2042
2041
|
tone: "primary",
|
|
2043
2042
|
size: "lg",
|
|
2044
|
-
className:
|
|
2043
|
+
className: Lt,
|
|
2045
2044
|
iconLeft: t.icon,
|
|
2046
2045
|
iconRight: t.icon,
|
|
2047
2046
|
onClick: () => {
|
|
2048
|
-
if (!l &&
|
|
2047
|
+
if (!l && wr.has(t.path) && !r && i) {
|
|
2049
2048
|
i(t.path);
|
|
2050
2049
|
return;
|
|
2051
2050
|
}
|
|
@@ -2071,8 +2070,8 @@ function Pr({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2071
2070
|
}
|
|
2072
2071
|
//#endregion
|
|
2073
2072
|
//#region src/editor/labs/sheetLabels.js
|
|
2074
|
-
function
|
|
2075
|
-
if (
|
|
2073
|
+
function Er(e) {
|
|
2074
|
+
if (Le().active) return {
|
|
2076
2075
|
title: "Morph",
|
|
2077
2076
|
pill: "Morph"
|
|
2078
2077
|
};
|
|
@@ -2081,7 +2080,7 @@ function Fr(e) {
|
|
|
2081
2080
|
pill: "Labs"
|
|
2082
2081
|
};
|
|
2083
2082
|
if (e.type === "loop" || e.type === "misc") return {
|
|
2084
|
-
title:
|
|
2083
|
+
title: V(e.loopGroup)?.label ?? "Labs",
|
|
2085
2084
|
kind: e.presetLabel,
|
|
2086
2085
|
pill: e.presetLabel
|
|
2087
2086
|
};
|
|
@@ -2100,15 +2099,15 @@ function Fr(e) {
|
|
|
2100
2099
|
}
|
|
2101
2100
|
//#endregion
|
|
2102
2101
|
//#region src/editor/labs/LabsView.jsx
|
|
2103
|
-
var
|
|
2102
|
+
var Dr = .85, Or = .3, kr = 2.5, Ar = {
|
|
2104
2103
|
0: 1,
|
|
2105
2104
|
1: .5,
|
|
2106
2105
|
2: 1,
|
|
2107
2106
|
3: 1.5,
|
|
2108
2107
|
4: 2
|
|
2109
|
-
},
|
|
2110
|
-
function
|
|
2111
|
-
let { layer: t } =
|
|
2108
|
+
}, jr = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2109
|
+
function Mr() {
|
|
2110
|
+
let { layer: t } = Te(), { removeLayer: n, layers: r, updateLayer: a, beginTransaction: o, commitTransaction: s, select: c } = h(), [l, u] = Z(null);
|
|
2112
2111
|
Y(() => {
|
|
2113
2112
|
let e = (e) => {
|
|
2114
2113
|
let { id: t, index: n } = e.detail || {};
|
|
@@ -2127,7 +2126,7 @@ function Vr() {
|
|
|
2127
2126
|
l,
|
|
2128
2127
|
c
|
|
2129
2128
|
]);
|
|
2130
|
-
let d = l && r.find((e) => e.id === l.id && e.type === "kinetic"), f = t?.type === "photo" && !t.src && t.srcType !== "webcam", [p, m] = Z(1), [
|
|
2129
|
+
let d = l && r.find((e) => e.id === l.id && e.type === "kinetic"), f = t?.type === "photo" && !t.src && t.srcType !== "webcam", [p, m] = Z(1), [g, _] = Z(!1), v = T(g), y = X(null), b = (e) => Math.min(kr, Math.max(Or, e)), x = (e) => m((t) => b(t * (e > 0 ? 1.25 : .8))), { tool: S } = lt(), C = S === "orbit", w = X(C);
|
|
2131
2130
|
w.current = C, Y(() => {
|
|
2132
2131
|
let t = y.current;
|
|
2133
2132
|
if (!t) return;
|
|
@@ -2137,12 +2136,12 @@ function Vr() {
|
|
|
2137
2136
|
return t.addEventListener("wheel", n, { passive: !1 }), () => t.removeEventListener("wheel", n);
|
|
2138
2137
|
}, []), Y(() => {
|
|
2139
2138
|
let t = (t) => {
|
|
2140
|
-
if (!(t.metaKey || t.ctrlKey || t.altKey) && !
|
|
2139
|
+
if (!(t.metaKey || t.ctrlKey || t.altKey) && !pt(t)) {
|
|
2141
2140
|
if (t.key === "f" || t.key === "F") {
|
|
2142
2141
|
_((e) => !e);
|
|
2143
2142
|
return;
|
|
2144
2143
|
}
|
|
2145
|
-
if (!(e().zoomLock && (t.key === "-" || t.key === "_" || t.key === "+" || t.key === "=" ||
|
|
2144
|
+
if (!(e().zoomLock && (t.key === "-" || t.key === "_" || t.key === "+" || t.key === "=" || Ar[t.key] !== void 0))) {
|
|
2146
2145
|
if (t.key === "-" || t.key === "_") {
|
|
2147
2146
|
x(-1);
|
|
2148
2147
|
return;
|
|
@@ -2151,7 +2150,7 @@ function Vr() {
|
|
|
2151
2150
|
x(1);
|
|
2152
2151
|
return;
|
|
2153
2152
|
}
|
|
2154
|
-
|
|
2153
|
+
Ar[t.key] !== void 0 && m(Ar[t.key]);
|
|
2155
2154
|
}
|
|
2156
2155
|
}
|
|
2157
2156
|
};
|
|
@@ -2231,11 +2230,11 @@ function Vr() {
|
|
|
2231
2230
|
/* @__PURE__ */ Q("div", {
|
|
2232
2231
|
style: {
|
|
2233
2232
|
flex: "none",
|
|
2234
|
-
width: `${p *
|
|
2235
|
-
height: `${p *
|
|
2233
|
+
width: `${p * Dr * 100}%`,
|
|
2234
|
+
height: `${p * Dr * 100}%`,
|
|
2236
2235
|
transform: `translate(${E.x}px, ${E.y}px)`
|
|
2237
2236
|
},
|
|
2238
|
-
children: /* @__PURE__ */ Q(
|
|
2237
|
+
children: /* @__PURE__ */ Q(Rt, { overlay: d ? (e) => /* @__PURE__ */ Q(ut, {
|
|
2239
2238
|
layer: d,
|
|
2240
2239
|
initialIndex: l.index,
|
|
2241
2240
|
toVirtual: e,
|
|
@@ -2245,17 +2244,17 @@ function Vr() {
|
|
|
2245
2244
|
onExit: () => u(null)
|
|
2246
2245
|
}) : void 0 })
|
|
2247
2246
|
}),
|
|
2248
|
-
f && /* @__PURE__ */ Q(
|
|
2247
|
+
f && /* @__PURE__ */ Q(vr, {
|
|
2249
2248
|
layer: t,
|
|
2250
|
-
title:
|
|
2249
|
+
title: Er(t).title,
|
|
2251
2250
|
onBack: () => n(t.id)
|
|
2252
2251
|
}),
|
|
2253
|
-
|
|
2252
|
+
g && /* @__PURE__ */ Q("div", {
|
|
2254
2253
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2255
|
-
children: /* @__PURE__ */ Q(
|
|
2254
|
+
children: /* @__PURE__ */ Q(Jt, {
|
|
2256
2255
|
label: "Framerate — press F to hide",
|
|
2257
2256
|
children: /* @__PURE__ */ $("span", {
|
|
2258
|
-
className:
|
|
2257
|
+
className: jr,
|
|
2259
2258
|
children: [v, " fps"]
|
|
2260
2259
|
})
|
|
2261
2260
|
})
|
|
@@ -2263,8 +2262,8 @@ function Vr() {
|
|
|
2263
2262
|
]
|
|
2264
2263
|
});
|
|
2265
2264
|
}
|
|
2266
|
-
function
|
|
2267
|
-
let e = X(null), { grabProps: t } =
|
|
2265
|
+
function Nr() {
|
|
2266
|
+
let e = X(null), { grabProps: t } = an(e, {
|
|
2268
2267
|
token: "kol-rail",
|
|
2269
2268
|
side: "right"
|
|
2270
2269
|
});
|
|
@@ -2310,14 +2309,14 @@ function Hr() {
|
|
|
2310
2309
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2311
2310
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
2312
2311
|
className: "kol-compose-inspector-body",
|
|
2313
|
-
children: /* @__PURE__ */ Q(
|
|
2312
|
+
children: /* @__PURE__ */ Q(fr, {})
|
|
2314
2313
|
})]
|
|
2315
2314
|
});
|
|
2316
2315
|
}
|
|
2317
|
-
var
|
|
2318
|
-
function
|
|
2319
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
2320
|
-
return /* @__PURE__ */ Q(
|
|
2316
|
+
var Pr = Qt(null);
|
|
2317
|
+
function Fr() {
|
|
2318
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = en(Pr);
|
|
2319
|
+
return /* @__PURE__ */ Q(Cr, {
|
|
2321
2320
|
tall: e,
|
|
2322
2321
|
onToggle: () => {
|
|
2323
2322
|
r(null), t((e) => !e);
|
|
@@ -2328,20 +2327,20 @@ function Wr() {
|
|
|
2328
2327
|
}
|
|
2329
2328
|
});
|
|
2330
2329
|
}
|
|
2331
|
-
var
|
|
2330
|
+
var Ir = [
|
|
2332
2331
|
2,
|
|
2333
2332
|
4,
|
|
2334
2333
|
8,
|
|
2335
2334
|
12,
|
|
2336
2335
|
16
|
|
2337
2336
|
];
|
|
2338
|
-
function
|
|
2337
|
+
function Lr({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2339
2338
|
let { playing: o, loopSeconds: s, play: c, pause: l, stop: u, rewind: d, setLoopSeconds: f } = a(), [p, m] = Z(!0), h = [
|
|
2340
2339
|
{
|
|
2341
2340
|
icon: "home-01",
|
|
2342
2341
|
path: "#home",
|
|
2343
2342
|
label: "Home",
|
|
2344
|
-
onPress: () =>
|
|
2343
|
+
onPress: () => bt("/")
|
|
2345
2344
|
},
|
|
2346
2345
|
{
|
|
2347
2346
|
icon: "grid",
|
|
@@ -2410,14 +2409,14 @@ function Kr({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2410
2409
|
onPress: d
|
|
2411
2410
|
}
|
|
2412
2411
|
],
|
|
2413
|
-
sheetFor: { loop:
|
|
2412
|
+
sheetFor: { loop: Ir.map((e) => ({
|
|
2414
2413
|
label: `${e} s`,
|
|
2415
2414
|
checked: s === e,
|
|
2416
2415
|
onPress: () => f(e)
|
|
2417
2416
|
})) }
|
|
2418
2417
|
} : void 0;
|
|
2419
2418
|
return Y(() => {
|
|
2420
|
-
|
|
2419
|
+
gn({
|
|
2421
2420
|
items: h,
|
|
2422
2421
|
actions: g,
|
|
2423
2422
|
transport: _,
|
|
@@ -2431,68 +2430,68 @@ function Kr({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2431
2430
|
o,
|
|
2432
2431
|
s,
|
|
2433
2432
|
i
|
|
2434
|
-
]), Y(() => () =>
|
|
2433
|
+
]), Y(() => () => gn(null), []), null;
|
|
2435
2434
|
}
|
|
2436
|
-
function
|
|
2435
|
+
function Rr() {
|
|
2437
2436
|
return /* @__PURE__ */ Q("div", {
|
|
2438
2437
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2439
2438
|
children: /* @__PURE__ */ Q("div", {
|
|
2440
2439
|
className: "kol-compose-inspector-body",
|
|
2441
|
-
children: /* @__PURE__ */ Q(
|
|
2440
|
+
children: /* @__PURE__ */ Q(fr, {})
|
|
2442
2441
|
})
|
|
2443
2442
|
});
|
|
2444
2443
|
}
|
|
2445
|
-
var
|
|
2444
|
+
var zr = {
|
|
2446
2445
|
topbar: () => null,
|
|
2447
|
-
canvas:
|
|
2446
|
+
canvas: Mr,
|
|
2448
2447
|
panels: [
|
|
2449
2448
|
{
|
|
2450
2449
|
slot: "canvas.footer",
|
|
2451
2450
|
order: 0,
|
|
2452
|
-
Component:
|
|
2451
|
+
Component: $e
|
|
2453
2452
|
},
|
|
2454
2453
|
{
|
|
2455
2454
|
slot: "right.body",
|
|
2456
2455
|
order: 0,
|
|
2457
|
-
Component:
|
|
2456
|
+
Component: Nr
|
|
2458
2457
|
},
|
|
2459
2458
|
{
|
|
2460
2459
|
slot: "right.footer",
|
|
2461
2460
|
order: 0,
|
|
2462
|
-
Component:
|
|
2461
|
+
Component: Et
|
|
2463
2462
|
}
|
|
2464
2463
|
]
|
|
2465
|
-
},
|
|
2466
|
-
...
|
|
2464
|
+
}, Br = {
|
|
2465
|
+
...zr,
|
|
2467
2466
|
panels: [{
|
|
2468
2467
|
slot: "right.header",
|
|
2469
2468
|
order: 0,
|
|
2470
|
-
Component:
|
|
2471
|
-
}, ...
|
|
2469
|
+
Component: Fr
|
|
2470
|
+
}, ...zr.panels.map((e) => e.Component === Nr ? {
|
|
2472
2471
|
...e,
|
|
2473
|
-
Component:
|
|
2472
|
+
Component: Rr
|
|
2474
2473
|
} : e)]
|
|
2475
2474
|
};
|
|
2476
|
-
function
|
|
2477
|
-
let { setAspect: t } =
|
|
2475
|
+
function Vr() {
|
|
2476
|
+
let { setAspect: t } = h(), n = X(!1);
|
|
2478
2477
|
Y(() => {
|
|
2479
2478
|
if (n.current) return;
|
|
2480
2479
|
n.current = !0;
|
|
2481
2480
|
let r = e();
|
|
2482
2481
|
r.defaultAspect && r.defaultAspect !== "custom" && t(r.defaultAspect), r.defaultLoopSeconds && i.setLoopSeconds(r.defaultLoopSeconds);
|
|
2483
2482
|
}, []);
|
|
2484
|
-
let { clearHistory: r } =
|
|
2483
|
+
let { clearHistory: r } = h();
|
|
2485
2484
|
Y(() => {
|
|
2486
2485
|
let e = setTimeout(r, 800);
|
|
2487
2486
|
return () => clearTimeout(e);
|
|
2488
2487
|
}, [r]);
|
|
2489
2488
|
}
|
|
2490
|
-
function
|
|
2491
|
-
let { selectedId: n, select: r } =
|
|
2489
|
+
function Hr() {
|
|
2490
|
+
let { selectedId: n, select: r } = h(), { layer: a, setOnly: o } = Te(), c = kt(vt), l = Nt() && !ht() || c;
|
|
2492
2491
|
Y(() => {
|
|
2493
2492
|
l && document.documentElement.removeAttribute("data-rail");
|
|
2494
2493
|
}, [l]);
|
|
2495
|
-
let [u, d] = Z(!0), [f, p] = Z(!1), [m,
|
|
2494
|
+
let [u, d] = Z(!0), [f, p] = Z(!1), [m, g] = Z(null), _ = m ? `${m}px` : f ? xr.tall : xr.half, v = { "--kol-sheet-h": _ }, b = _n(), x = He(), [S, C] = Z(() => !a);
|
|
2496
2495
|
Y(() => {
|
|
2497
2496
|
C(!a);
|
|
2498
2497
|
}, [a?.id]);
|
|
@@ -2517,7 +2516,7 @@ function Zr() {
|
|
|
2517
2516
|
}), () => {
|
|
2518
2517
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2519
2518
|
};
|
|
2520
|
-
}, [x.active, l]), Y(() =>
|
|
2519
|
+
}, [x.active, l]), Y(() => Ht((e) => o("photo", {
|
|
2521
2520
|
src: e.url,
|
|
2522
2521
|
srcType: e.srcType
|
|
2523
2522
|
})), [o]), Y(() => {
|
|
@@ -2526,38 +2525,38 @@ function Zr() {
|
|
|
2526
2525
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2527
2526
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2528
2527
|
};
|
|
2529
|
-
}, [l]),
|
|
2528
|
+
}, [l]), xt(), Y(() => (ft("labs"), () => ft(null)), []), Vr();
|
|
2530
2529
|
let D = X(!1);
|
|
2531
2530
|
Y(() => {
|
|
2532
2531
|
if (D.current) return;
|
|
2533
2532
|
D.current = !0;
|
|
2534
|
-
let e =
|
|
2533
|
+
let e = et();
|
|
2535
2534
|
if (e.open || e.fresh) return;
|
|
2536
|
-
let t = new URLSearchParams(window.location.search).get("preset"), n = t ?
|
|
2537
|
-
n && o("loop",
|
|
2535
|
+
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? G(t) : null;
|
|
2536
|
+
n && o("loop", de(te(t), n));
|
|
2538
2537
|
}, [o]);
|
|
2539
|
-
let { tool: O, setTool: k } =
|
|
2538
|
+
let { tool: O, setTool: k } = lt(), A = X(O);
|
|
2540
2539
|
A.current = O;
|
|
2541
|
-
let { updateLayer: j, undo: M, redo: N } =
|
|
2540
|
+
let { updateLayer: j, undo: M, redo: N } = h(), P = X({
|
|
2542
2541
|
undo: M,
|
|
2543
2542
|
redo: N
|
|
2544
2543
|
});
|
|
2545
|
-
|
|
2544
|
+
P.current = {
|
|
2546
2545
|
undo: M,
|
|
2547
2546
|
redo: N
|
|
2548
2547
|
};
|
|
2549
|
-
let
|
|
2548
|
+
let F = !!t().grab;
|
|
2550
2549
|
Y(() => {
|
|
2551
|
-
k(
|
|
2552
|
-
}, [
|
|
2553
|
-
let
|
|
2554
|
-
|
|
2555
|
-
let
|
|
2556
|
-
return
|
|
2550
|
+
k(F ? "orbit" : "select");
|
|
2551
|
+
}, [F, k]);
|
|
2552
|
+
let ee = X(a);
|
|
2553
|
+
ee.current = a;
|
|
2554
|
+
let I = X(j);
|
|
2555
|
+
return I.current = j, Y(() => {
|
|
2557
2556
|
let t = (t) => {
|
|
2558
|
-
if (
|
|
2557
|
+
if (pt(t)) return;
|
|
2559
2558
|
if ((t.metaKey || t.ctrlKey) && (t.key === "z" || t.key === "Z")) {
|
|
2560
|
-
t.preventDefault(), t.shiftKey ?
|
|
2559
|
+
t.preventDefault(), t.shiftKey ? P.current.redo() : P.current.undo();
|
|
2561
2560
|
return;
|
|
2562
2561
|
}
|
|
2563
2562
|
if (t.code === "Space") {
|
|
@@ -2576,10 +2575,10 @@ function Zr() {
|
|
|
2576
2575
|
s("zoomLock", !e().zoomLock);
|
|
2577
2576
|
return;
|
|
2578
2577
|
}
|
|
2579
|
-
let n = !t.metaKey && !t.ctrlKey && !t.altKey && !t.shiftKey &&
|
|
2580
|
-
if (n &&
|
|
2581
|
-
let e =
|
|
2582
|
-
e && (t.preventDefault(),
|
|
2578
|
+
let n = !t.metaKey && !t.ctrlKey && !t.altKey && !t.shiftKey && we[t.key.length === 1 ? t.key.toLowerCase() : t.key];
|
|
2579
|
+
if (n && ee.current) {
|
|
2580
|
+
let e = ye(ee.current, n[1], n[0]);
|
|
2581
|
+
e && (t.preventDefault(), I.current(ee.current.id, e));
|
|
2583
2582
|
}
|
|
2584
2583
|
};
|
|
2585
2584
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
@@ -2600,21 +2599,21 @@ function Zr() {
|
|
|
2600
2599
|
"data-empty": a || x.active ? void 0 : "",
|
|
2601
2600
|
style: v,
|
|
2602
2601
|
children: [
|
|
2603
|
-
/* @__PURE__ */ Q(
|
|
2604
|
-
l ? /* @__PURE__ */ $(
|
|
2602
|
+
/* @__PURE__ */ Q(Fn, {}),
|
|
2603
|
+
l ? /* @__PURE__ */ $(Pr.Provider, {
|
|
2605
2604
|
value: {
|
|
2606
2605
|
collapseParams: () => d(!1),
|
|
2607
2606
|
tall: f,
|
|
2608
2607
|
setTall: p,
|
|
2609
|
-
setSheetPx:
|
|
2608
|
+
setSheetPx: g,
|
|
2610
2609
|
catalog: S,
|
|
2611
2610
|
toggleCatalog: () => C((e) => !e)
|
|
2612
2611
|
},
|
|
2613
2612
|
children: [/* @__PURE__ */ Q(y.Provider, {
|
|
2614
2613
|
value: "md",
|
|
2615
|
-
children: /* @__PURE__ */ Q(
|
|
2616
|
-
registry:
|
|
2617
|
-
rightIn: (e) => b ?
|
|
2614
|
+
children: /* @__PURE__ */ Q(rt, {
|
|
2615
|
+
registry: Br,
|
|
2616
|
+
rightIn: (e) => b ? sn(/* @__PURE__ */ Q("div", {
|
|
2618
2617
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2619
2618
|
"data-touch": "",
|
|
2620
2619
|
"data-params": "open",
|
|
@@ -2622,15 +2621,15 @@ function Zr() {
|
|
|
2622
2621
|
children: e
|
|
2623
2622
|
}), b) : null
|
|
2624
2623
|
})
|
|
2625
|
-
}), /* @__PURE__ */ Q(
|
|
2624
|
+
}), /* @__PURE__ */ Q(Lr, {
|
|
2626
2625
|
paramsOpen: u,
|
|
2627
2626
|
setParamsOpen: d,
|
|
2628
2627
|
catalog: S,
|
|
2629
2628
|
toggleCatalog: () => C((e) => !e),
|
|
2630
2629
|
railHeight: _
|
|
2631
2630
|
})]
|
|
2632
|
-
}) : /* @__PURE__ */ Q(
|
|
2633
|
-
S && !x.picker && !(x.active && !a) && /* @__PURE__ */ Q(
|
|
2631
|
+
}) : /* @__PURE__ */ Q(rt, { registry: zr }),
|
|
2632
|
+
S && !x.picker && !(x.active && !a) && /* @__PURE__ */ Q(Tr, {
|
|
2634
2633
|
initialOpen: w,
|
|
2635
2634
|
hasMedia: E,
|
|
2636
2635
|
onNeedMedia: (e) => {
|
|
@@ -2649,8 +2648,8 @@ function Zr() {
|
|
|
2649
2648
|
]
|
|
2650
2649
|
});
|
|
2651
2650
|
}
|
|
2652
|
-
var
|
|
2653
|
-
function
|
|
2651
|
+
var Ur = "kol.editor.labs-draft";
|
|
2652
|
+
function Wr() {
|
|
2654
2653
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2655
2654
|
return Y(() => (q(e ? { active: !0 } : {
|
|
2656
2655
|
active: !1,
|
|
@@ -2658,21 +2657,21 @@ function $r() {
|
|
|
2658
2657
|
}), () => q({
|
|
2659
2658
|
active: !1,
|
|
2660
2659
|
editing: null
|
|
2661
|
-
})), [e]), /* @__PURE__ */ $(
|
|
2662
|
-
draftKey:
|
|
2660
|
+
})), [e]), /* @__PURE__ */ $(jt, {
|
|
2661
|
+
draftKey: Ur,
|
|
2663
2662
|
children: [
|
|
2664
|
-
/* @__PURE__ */ Q(
|
|
2665
|
-
/* @__PURE__ */ Q(
|
|
2666
|
-
/* @__PURE__ */ Q(
|
|
2663
|
+
/* @__PURE__ */ Q(Hr, {}),
|
|
2664
|
+
/* @__PURE__ */ Q(At, {}),
|
|
2665
|
+
/* @__PURE__ */ Q(Ce, {})
|
|
2667
2666
|
]
|
|
2668
2667
|
});
|
|
2669
2668
|
}
|
|
2670
2669
|
//#endregion
|
|
2671
2670
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2672
|
-
function
|
|
2671
|
+
function Gr({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2673
2672
|
let [i, a] = Z(null);
|
|
2674
|
-
|
|
2675
|
-
let { engineHost: o } =
|
|
2673
|
+
pr(r);
|
|
2674
|
+
let { engineHost: o } = ie(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = H(W.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2676
2675
|
return /* @__PURE__ */ Q("div", {
|
|
2677
2676
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
2678
2677
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -2689,7 +2688,7 @@ function ei({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2689
2688
|
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(J, {
|
|
2690
2689
|
tone: "primary",
|
|
2691
2690
|
size: "lg",
|
|
2692
|
-
className:
|
|
2691
|
+
className: Lt,
|
|
2693
2692
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2694
2693
|
iconRight: l ? "filter" : "chevron-right",
|
|
2695
2694
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
@@ -2699,7 +2698,7 @@ function ei({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2699
2698
|
/* @__PURE__ */ Q(J, {
|
|
2700
2699
|
tone: "grey",
|
|
2701
2700
|
size: "lg",
|
|
2702
|
-
className:
|
|
2701
|
+
className: Lt,
|
|
2703
2702
|
iconLeft: "arrow-left",
|
|
2704
2703
|
iconRight: "arrow-left",
|
|
2705
2704
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2711,7 +2710,7 @@ function ei({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2711
2710
|
}
|
|
2712
2711
|
//#endregion
|
|
2713
2712
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
2714
|
-
var
|
|
2713
|
+
var Kr = { background: "var(--kol-surface-primary)" }, qr = [
|
|
2715
2714
|
{
|
|
2716
2715
|
value: "generate",
|
|
2717
2716
|
label: "Generate"
|
|
@@ -2728,30 +2727,30 @@ var ti = { background: "var(--kol-surface-primary)" }, ni = [
|
|
|
2728
2727
|
value: "output",
|
|
2729
2728
|
label: "Output"
|
|
2730
2729
|
}
|
|
2731
|
-
],
|
|
2730
|
+
], Jr = qr.filter((e) => e.value !== "generate"), Yr = "[&_.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)]", Xr = {
|
|
2732
2731
|
lg: 9.6,
|
|
2733
2732
|
sm: 7.2
|
|
2734
|
-
},
|
|
2735
|
-
function
|
|
2736
|
-
let n = t === "sm" ?
|
|
2733
|
+
}, Zr = 10, Qr = 232;
|
|
2734
|
+
function $r(e, t) {
|
|
2735
|
+
let n = t === "sm" ? Qr : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
2737
2736
|
for (let o of e) {
|
|
2738
|
-
let e = o.label.length *
|
|
2737
|
+
let e = o.label.length * Xr[t] + Zr, s = Math.max(a, e);
|
|
2739
2738
|
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
2740
2739
|
}
|
|
2741
2740
|
return i.length && r.push(i), r;
|
|
2742
2741
|
}
|
|
2743
|
-
function
|
|
2744
|
-
return
|
|
2742
|
+
function ei({ cells: e, size: t }) {
|
|
2743
|
+
return $r(e, t).map((e, n) => /* @__PURE__ */ Q(Ut, {
|
|
2745
2744
|
layout: "joined",
|
|
2746
2745
|
value: null,
|
|
2747
2746
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
2748
2747
|
options: e,
|
|
2749
2748
|
size: t,
|
|
2750
2749
|
ariaLabel: "Randomize scope",
|
|
2751
|
-
className:
|
|
2750
|
+
className: Yr
|
|
2752
2751
|
}, n));
|
|
2753
2752
|
}
|
|
2754
|
-
var
|
|
2753
|
+
var ti = [
|
|
2755
2754
|
2,
|
|
2756
2755
|
4,
|
|
2757
2756
|
8,
|
|
@@ -2760,18 +2759,18 @@ var ui = [
|
|
|
2760
2759
|
value: String(e),
|
|
2761
2760
|
label: `${e}s`
|
|
2762
2761
|
}));
|
|
2763
|
-
function
|
|
2762
|
+
function ni({ size: e }) {
|
|
2764
2763
|
let { loopSeconds: t, setLoopSeconds: n } = a();
|
|
2765
|
-
return /* @__PURE__ */ Q(
|
|
2764
|
+
return /* @__PURE__ */ Q(Ut, {
|
|
2766
2765
|
layout: "joined",
|
|
2767
2766
|
value: String(t),
|
|
2768
2767
|
onChange: (e) => n(Number(e)),
|
|
2769
|
-
options:
|
|
2768
|
+
options: ti,
|
|
2770
2769
|
size: e,
|
|
2771
2770
|
ariaLabel: "Loop length"
|
|
2772
2771
|
});
|
|
2773
2772
|
}
|
|
2774
|
-
var
|
|
2773
|
+
var ri = [
|
|
2775
2774
|
{
|
|
2776
2775
|
value: "9:16",
|
|
2777
2776
|
label: "9:16"
|
|
@@ -2788,7 +2787,7 @@ var fi = [
|
|
|
2788
2787
|
value: "1:1",
|
|
2789
2788
|
label: "1:1"
|
|
2790
2789
|
}
|
|
2791
|
-
],
|
|
2790
|
+
], ii = [
|
|
2792
2791
|
{
|
|
2793
2792
|
value: "5:4",
|
|
2794
2793
|
label: "5:4"
|
|
@@ -2806,99 +2805,99 @@ var fi = [
|
|
|
2806
2805
|
label: "Fill"
|
|
2807
2806
|
}
|
|
2808
2807
|
];
|
|
2809
|
-
function
|
|
2810
|
-
let d =
|
|
2808
|
+
function ai({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectValue: a, onAspect: o, openEffects: s = !1, rail: c = !1, onRail: l, onSheet: u }) {
|
|
2809
|
+
let d = He(), { updateLayer: f, addFilter: p, removeFilter: m } = h(), { onExportPng: g } = Vt(), [_, y] = Z(!1), [b, S] = Z(!0), [w, T] = Z(!1), [D, O] = Z(!1), [k, j] = Z("generate"), [P, F] = Z(!1), [I, L] = Z(!1), { aspect: R } = h(), [te, z] = Z(null), H = E(e);
|
|
2811
2810
|
Y(() => {
|
|
2812
2811
|
s && (S(!0), O(!0));
|
|
2813
2812
|
}, [s]);
|
|
2814
|
-
let
|
|
2815
|
-
Y(() => (l?.(
|
|
2816
|
-
let
|
|
2817
|
-
Y(() => (u?.(
|
|
2818
|
-
let
|
|
2819
|
-
let t = e?.type === "loop" &&
|
|
2820
|
-
t &&
|
|
2813
|
+
let U = c ? "sm" : "lg", ne = c && !!e && b && !_;
|
|
2814
|
+
Y(() => (l?.(ne), () => l?.(!1)), [ne]);
|
|
2815
|
+
let W = !c && e && b && !_ ? te ? `${te}px` : P ? xr.tall : xr.half : null;
|
|
2816
|
+
Y(() => (u?.(W), () => u?.(null)), [W]);
|
|
2817
|
+
let re = () => {
|
|
2818
|
+
let t = e?.type === "loop" && B(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2819
|
+
t && f(e.id, de(t, e.loopGroup));
|
|
2821
2820
|
};
|
|
2822
|
-
if (
|
|
2823
|
-
e?.type === "loop" &&
|
|
2821
|
+
if (Zn(re, () => {
|
|
2822
|
+
e?.type === "loop" && f(e.id, C(e, M(K(e.loopId)?.params ?? [], e), H.take(), { withFilters: !0 }));
|
|
2824
2823
|
}), !e) return null;
|
|
2825
|
-
if (
|
|
2824
|
+
if (_) return /* @__PURE__ */ Q("button", {
|
|
2826
2825
|
"aria-label": "Show controls",
|
|
2827
2826
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
2828
2827
|
onClick: () => y(!1)
|
|
2829
2828
|
});
|
|
2830
|
-
let
|
|
2831
|
-
let t = A(e,
|
|
2832
|
-
t &&
|
|
2833
|
-
},
|
|
2834
|
-
let t =
|
|
2835
|
-
t &&
|
|
2829
|
+
let ae = e.type === "loop", oe = ae ? `${V(e.loopGroup).label} · ${e.presetLabel}` : "Media", se = ae ? K(e.loopId)?.params ?? [] : [], ce = ae ? N(se, e) : [], le = () => f(e.id, C(e, M(se, e), H.take(), { withFilters: !0 })), ue = (t) => f(e.id, C(e, t.params, H.take(), { stripNoRandom: !!t.motion })), G = () => {
|
|
2830
|
+
let t = A(e, H.take());
|
|
2831
|
+
t && f(e.id, t);
|
|
2832
|
+
}, fe = x(e), { effectable: pe } = ie(e), he = () => {
|
|
2833
|
+
let t = ee(e, H.take());
|
|
2834
|
+
t && f(e.id, { filters: t });
|
|
2836
2835
|
};
|
|
2837
|
-
if (!b) return /* @__PURE__ */ $(
|
|
2838
|
-
label:
|
|
2836
|
+
if (!b) return /* @__PURE__ */ $(br, {
|
|
2837
|
+
label: ae ? e.presetLabel : "Media",
|
|
2839
2838
|
onOpen: () => S(!0),
|
|
2840
|
-
size:
|
|
2839
|
+
size: U,
|
|
2841
2840
|
children: [
|
|
2842
|
-
(
|
|
2841
|
+
(ae || fe.length > 0) && /* @__PURE__ */ Q(Jt, {
|
|
2843
2842
|
label: "Randomize all",
|
|
2844
2843
|
children: /* @__PURE__ */ Q(J, {
|
|
2845
2844
|
tone: "primary",
|
|
2846
|
-
size:
|
|
2845
|
+
size: U,
|
|
2847
2846
|
iconOnly: "bolt",
|
|
2848
2847
|
"aria-label": "Randomize all",
|
|
2849
|
-
onClick:
|
|
2848
|
+
onClick: le,
|
|
2850
2849
|
className: "shrink-0"
|
|
2851
2850
|
})
|
|
2852
2851
|
}),
|
|
2853
|
-
/* @__PURE__ */ Q(
|
|
2852
|
+
/* @__PURE__ */ Q(Jt, {
|
|
2854
2853
|
label: "Download",
|
|
2855
2854
|
children: /* @__PURE__ */ Q(J, {
|
|
2856
2855
|
tone: "primary",
|
|
2857
|
-
size:
|
|
2856
|
+
size: U,
|
|
2858
2857
|
iconOnly: "download",
|
|
2859
2858
|
"aria-label": "Download",
|
|
2860
|
-
onClick: () =>
|
|
2859
|
+
onClick: () => g(2),
|
|
2861
2860
|
className: "shrink-0"
|
|
2862
2861
|
})
|
|
2863
2862
|
}),
|
|
2864
|
-
/* @__PURE__ */ Q(
|
|
2863
|
+
/* @__PURE__ */ Q(Jt, {
|
|
2865
2864
|
label: "Hide UI",
|
|
2866
2865
|
children: /* @__PURE__ */ Q(J, {
|
|
2867
2866
|
tone: "primary",
|
|
2868
|
-
size:
|
|
2867
|
+
size: U,
|
|
2869
2868
|
iconOnly: "eye-off",
|
|
2870
2869
|
"aria-label": "Hide UI",
|
|
2871
2870
|
onClick: () => y(!0),
|
|
2872
2871
|
className: "shrink-0"
|
|
2873
2872
|
})
|
|
2874
2873
|
}),
|
|
2875
|
-
/* @__PURE__ */ Q(
|
|
2874
|
+
/* @__PURE__ */ Q(Jt, {
|
|
2876
2875
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2877
2876
|
children: /* @__PURE__ */ Q(J, {
|
|
2878
2877
|
tone: "primary",
|
|
2879
|
-
size:
|
|
2878
|
+
size: U,
|
|
2880
2879
|
iconOnly: "maximize",
|
|
2881
2880
|
"aria-label": a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2882
2881
|
"aria-pressed": a === "fill",
|
|
2883
|
-
onClick: () => o(a === "fill" ?
|
|
2882
|
+
onClick: () => o(a === "fill" ? R : "fill"),
|
|
2884
2883
|
className: "shrink-0"
|
|
2885
2884
|
})
|
|
2886
2885
|
})
|
|
2887
2886
|
]
|
|
2888
2887
|
});
|
|
2889
|
-
let
|
|
2888
|
+
let ge = [...ae ? qr : Jr, ...ae && d.steps.length >= 2 ? [{
|
|
2890
2889
|
value: "morph",
|
|
2891
2890
|
label: "Morph"
|
|
2892
|
-
}] : []].filter((e) => (e.value !== "effects" ||
|
|
2893
|
-
return /* @__PURE__ */ $(
|
|
2894
|
-
/* @__PURE__ */ Q(
|
|
2895
|
-
open:
|
|
2896
|
-
onClose: () =>
|
|
2897
|
-
schema:
|
|
2891
|
+
}] : []].filter((e) => (e.value !== "effects" || pe) && (e.value !== "transport" || v("motion"))), _e = ge.some((e) => e.value === k) ? k : ge[0].value;
|
|
2892
|
+
return /* @__PURE__ */ $(nn, { children: [
|
|
2893
|
+
/* @__PURE__ */ Q(me, {
|
|
2894
|
+
open: I,
|
|
2895
|
+
onClose: () => L(!1),
|
|
2896
|
+
schema: se,
|
|
2898
2897
|
layer: e,
|
|
2899
|
-
size:
|
|
2898
|
+
size: U
|
|
2900
2899
|
}),
|
|
2901
|
-
w && /* @__PURE__ */ Q(
|
|
2900
|
+
w && /* @__PURE__ */ Q(mr, {
|
|
2902
2901
|
onPick: (e) => {
|
|
2903
2902
|
t(e), T(!1);
|
|
2904
2903
|
},
|
|
@@ -2910,33 +2909,33 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2910
2909
|
},
|
|
2911
2910
|
onDismiss: () => T(!1)
|
|
2912
2911
|
}),
|
|
2913
|
-
D && /* @__PURE__ */ Q(
|
|
2912
|
+
D && /* @__PURE__ */ Q(Gr, {
|
|
2914
2913
|
layer: e,
|
|
2915
|
-
chain:
|
|
2914
|
+
chain: fe,
|
|
2916
2915
|
onPick: (t) => {
|
|
2917
|
-
|
|
2916
|
+
p(e.id, t), O(!1);
|
|
2918
2917
|
},
|
|
2919
2918
|
onBack: () => O(!1)
|
|
2920
2919
|
}),
|
|
2921
2920
|
/* @__PURE__ */ $("div", {
|
|
2922
2921
|
className: c ? "fixed top-0 right-0 bottom-0 z-10 flex w-[var(--kol-sidenav-w,320px)] flex-col overflow-y-auto border-l border-oq-08" : "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
2923
|
-
style: c ?
|
|
2924
|
-
...
|
|
2925
|
-
top: `calc(100dvh - ${
|
|
2922
|
+
style: c ? Kr : {
|
|
2923
|
+
...Kr,
|
|
2924
|
+
top: `calc(100dvh - ${W ?? xr.half})`
|
|
2926
2925
|
},
|
|
2927
2926
|
children: [
|
|
2928
|
-
!c && /* @__PURE__ */ Q(
|
|
2929
|
-
tall:
|
|
2927
|
+
!c && /* @__PURE__ */ Q(Cr, {
|
|
2928
|
+
tall: P,
|
|
2930
2929
|
onToggle: () => {
|
|
2931
|
-
|
|
2930
|
+
z(null), F((e) => !e);
|
|
2932
2931
|
},
|
|
2933
|
-
onResize: (e) =>
|
|
2932
|
+
onResize: (e) => z(Math.max(96, Math.min(window.innerHeight * .92, e))),
|
|
2934
2933
|
onResizeEnd: (e) => {
|
|
2935
|
-
e < 96 && (
|
|
2934
|
+
e < 96 && (z(null), S(!1));
|
|
2936
2935
|
}
|
|
2937
2936
|
}),
|
|
2938
|
-
/* @__PURE__ */ Q(
|
|
2939
|
-
title:
|
|
2937
|
+
/* @__PURE__ */ Q(yr, {
|
|
2938
|
+
title: oe,
|
|
2940
2939
|
onCollapse: () => S(!1),
|
|
2941
2940
|
className: c ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
2942
2941
|
action: /* @__PURE__ */ Q(J, {
|
|
@@ -2950,32 +2949,32 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2950
2949
|
/* @__PURE__ */ $("div", {
|
|
2951
2950
|
className: c ? "px-4 pb-5" : "min-h-0 flex-1 overflow-y-auto px-3 pb-3",
|
|
2952
2951
|
children: [
|
|
2953
|
-
/* @__PURE__ */ Q(
|
|
2952
|
+
/* @__PURE__ */ Q(Ut, {
|
|
2954
2953
|
layout: "joined",
|
|
2955
2954
|
value: _e,
|
|
2956
2955
|
onChange: j,
|
|
2957
|
-
options:
|
|
2958
|
-
size:
|
|
2959
|
-
className: c ?
|
|
2956
|
+
options: ge,
|
|
2957
|
+
size: U,
|
|
2958
|
+
className: c ? Yr : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2960
2959
|
}),
|
|
2961
|
-
_e === "morph" &&
|
|
2960
|
+
_e === "morph" && ae && /* @__PURE__ */ Q(Rn, {
|
|
2962
2961
|
layer: e,
|
|
2963
2962
|
readOnly: !0
|
|
2964
2963
|
}),
|
|
2965
|
-
_e === "generate" &&
|
|
2964
|
+
_e === "generate" && ae && /* @__PURE__ */ $("div", {
|
|
2966
2965
|
className: "flex flex-col gap-2 pt-3",
|
|
2967
2966
|
children: [
|
|
2968
2967
|
/* @__PURE__ */ $("div", {
|
|
2969
2968
|
className: "grid grid-cols-2 gap-2",
|
|
2970
2969
|
children: [/* @__PURE__ */ Q(J, {
|
|
2971
2970
|
tone: "primary",
|
|
2972
|
-
size:
|
|
2971
|
+
size: U,
|
|
2973
2972
|
iconRight: "refresh",
|
|
2974
|
-
onClick:
|
|
2973
|
+
onClick: G,
|
|
2975
2974
|
children: "Preset"
|
|
2976
2975
|
}), /* @__PURE__ */ Q(J, {
|
|
2977
2976
|
tone: "primary",
|
|
2978
|
-
size:
|
|
2977
|
+
size: U,
|
|
2979
2978
|
onClick: () => T(!0),
|
|
2980
2979
|
children: "Generator"
|
|
2981
2980
|
})]
|
|
@@ -2985,42 +2984,42 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2985
2984
|
children: [
|
|
2986
2985
|
/* @__PURE__ */ Q(J, {
|
|
2987
2986
|
tone: "primary",
|
|
2988
|
-
size:
|
|
2987
|
+
size: U,
|
|
2989
2988
|
className: "flex-1 min-w-0",
|
|
2990
|
-
onClick:
|
|
2989
|
+
onClick: le,
|
|
2991
2990
|
children: "Randomize all"
|
|
2992
2991
|
}),
|
|
2993
|
-
/* @__PURE__ */ Q(
|
|
2992
|
+
/* @__PURE__ */ Q(Jt, {
|
|
2994
2993
|
label: "What Randomize all rolls",
|
|
2995
2994
|
children: /* @__PURE__ */ Q(J, {
|
|
2996
2995
|
tone: "primary",
|
|
2997
|
-
size:
|
|
2996
|
+
size: U,
|
|
2998
2997
|
iconOnly: "nav-settings",
|
|
2999
2998
|
"aria-label": "What Randomize all rolls",
|
|
3000
|
-
onClick: () =>
|
|
2999
|
+
onClick: () => L(!0),
|
|
3001
3000
|
className: "shrink-0"
|
|
3002
3001
|
})
|
|
3003
3002
|
}),
|
|
3004
|
-
/* @__PURE__ */ Q(
|
|
3003
|
+
/* @__PURE__ */ Q(Jt, {
|
|
3005
3004
|
label: "Reset to defaults",
|
|
3006
3005
|
shortcut: "R",
|
|
3007
3006
|
children: /* @__PURE__ */ Q(J, {
|
|
3008
3007
|
tone: "primary",
|
|
3009
|
-
size:
|
|
3008
|
+
size: U,
|
|
3010
3009
|
iconOnly: "refresh",
|
|
3011
3010
|
"aria-label": "Reset to defaults",
|
|
3012
|
-
onClick:
|
|
3011
|
+
onClick: re,
|
|
3013
3012
|
className: "shrink-0"
|
|
3014
3013
|
})
|
|
3015
3014
|
})
|
|
3016
3015
|
]
|
|
3017
3016
|
}),
|
|
3018
|
-
|
|
3019
|
-
size:
|
|
3020
|
-
cells: [...
|
|
3017
|
+
ce.length > 0 && /* @__PURE__ */ Q(ei, {
|
|
3018
|
+
size: U,
|
|
3019
|
+
cells: [...ce.map((e) => ({
|
|
3021
3020
|
value: e.id,
|
|
3022
3021
|
label: e.label,
|
|
3023
|
-
run: () =>
|
|
3022
|
+
run: () => ue(e)
|
|
3024
3023
|
})), {
|
|
3025
3024
|
value: "__retrigger",
|
|
3026
3025
|
label: "Re-trigger",
|
|
@@ -3036,26 +3035,26 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3036
3035
|
children: [
|
|
3037
3036
|
/* @__PURE__ */ Q(J, {
|
|
3038
3037
|
tone: "primary",
|
|
3039
|
-
size:
|
|
3038
|
+
size: U,
|
|
3040
3039
|
onClick: () => O(!0),
|
|
3041
3040
|
children: "Add effect"
|
|
3042
3041
|
}),
|
|
3043
|
-
|
|
3042
|
+
fe.length > 0 && /* @__PURE__ */ Q(J, {
|
|
3044
3043
|
tone: "primary",
|
|
3045
|
-
size:
|
|
3046
|
-
onClick:
|
|
3044
|
+
size: U,
|
|
3045
|
+
onClick: he,
|
|
3047
3046
|
children: "Randomize"
|
|
3048
3047
|
}),
|
|
3049
3048
|
" "
|
|
3050
3049
|
]
|
|
3051
|
-
}),
|
|
3050
|
+
}), fe.map((t, n) => {
|
|
3052
3051
|
let r = {
|
|
3053
3052
|
...e,
|
|
3054
3053
|
...t.params,
|
|
3055
3054
|
id: e.id
|
|
3056
|
-
}, i = t.def ?
|
|
3057
|
-
let i = C(r, t.params,
|
|
3058
|
-
|
|
3055
|
+
}, i = t.def ? N(t.def.params, r) : [], a = (t) => {
|
|
3056
|
+
let i = C(r, t.params, H.take(), { stripNoRandom: !!t.motion }), a = fe.map(({ def: e, ...t }) => t);
|
|
3057
|
+
f(e.id, { filters: a.map((e, t) => t === n ? {
|
|
3059
3058
|
...e,
|
|
3060
3059
|
params: {
|
|
3061
3060
|
...e.params,
|
|
@@ -3067,14 +3066,14 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3067
3066
|
className: "flex flex-col gap-2",
|
|
3068
3067
|
children: [/* @__PURE__ */ Q(J, {
|
|
3069
3068
|
tone: "grey",
|
|
3070
|
-
size:
|
|
3069
|
+
size: U,
|
|
3071
3070
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3072
3071
|
iconLeft: "trash",
|
|
3073
3072
|
iconRight: "trash",
|
|
3074
|
-
onClick: () =>
|
|
3073
|
+
onClick: () => m(e.id, n),
|
|
3075
3074
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3076
|
-
}), i.length > 0 && /* @__PURE__ */ Q(
|
|
3077
|
-
size:
|
|
3075
|
+
}), i.length > 0 && /* @__PURE__ */ Q(ei, {
|
|
3076
|
+
size: U,
|
|
3078
3077
|
cells: i.map((e) => ({
|
|
3079
3078
|
value: e.id,
|
|
3080
3079
|
label: e.label,
|
|
@@ -3084,30 +3083,30 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3084
3083
|
}, t.key);
|
|
3085
3084
|
})]
|
|
3086
3085
|
}),
|
|
3087
|
-
_e === "transport" &&
|
|
3086
|
+
_e === "transport" && v("motion") && /* @__PURE__ */ $("div", {
|
|
3088
3087
|
className: "flex flex-col gap-2 pt-3",
|
|
3089
3088
|
children: [(() => {
|
|
3090
|
-
let e =
|
|
3091
|
-
return /* @__PURE__ */ Q(e, { size:
|
|
3092
|
-
})(), /* @__PURE__ */ Q(
|
|
3089
|
+
let e = v("motion").TransportBar;
|
|
3090
|
+
return /* @__PURE__ */ Q(e, { size: U });
|
|
3091
|
+
})(), /* @__PURE__ */ Q(ni, { size: U })]
|
|
3093
3092
|
}),
|
|
3094
3093
|
_e === "output" && /* @__PURE__ */ $("div", {
|
|
3095
3094
|
className: "flex flex-col gap-2 pt-3",
|
|
3096
3095
|
children: [
|
|
3097
|
-
/* @__PURE__ */ Q(
|
|
3096
|
+
/* @__PURE__ */ Q(Ut, {
|
|
3098
3097
|
layout: "joined",
|
|
3099
3098
|
value: a,
|
|
3100
3099
|
onChange: o,
|
|
3101
|
-
options:
|
|
3102
|
-
size:
|
|
3100
|
+
options: ri,
|
|
3101
|
+
size: U,
|
|
3103
3102
|
ariaLabel: "Aspect"
|
|
3104
3103
|
}),
|
|
3105
|
-
/* @__PURE__ */ Q(
|
|
3104
|
+
/* @__PURE__ */ Q(Ut, {
|
|
3106
3105
|
layout: "joined",
|
|
3107
3106
|
value: a,
|
|
3108
3107
|
onChange: o,
|
|
3109
|
-
options:
|
|
3110
|
-
size:
|
|
3108
|
+
options: ii,
|
|
3109
|
+
size: U,
|
|
3111
3110
|
ariaLabel: "Aspect (landscape) and fill"
|
|
3112
3111
|
}),
|
|
3113
3112
|
/* @__PURE__ */ $("div", {
|
|
@@ -3115,25 +3114,25 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3115
3114
|
children: [
|
|
3116
3115
|
/* @__PURE__ */ Q(J, {
|
|
3117
3116
|
tone: "primary",
|
|
3118
|
-
size:
|
|
3119
|
-
onClick: () =>
|
|
3117
|
+
size: U,
|
|
3118
|
+
onClick: () => gt({ focusName: !0 }),
|
|
3120
3119
|
children: "Save…"
|
|
3121
3120
|
}),
|
|
3122
3121
|
/* @__PURE__ */ Q(J, {
|
|
3123
3122
|
tone: "primary",
|
|
3124
|
-
size:
|
|
3125
|
-
onClick: () =>
|
|
3123
|
+
size: U,
|
|
3124
|
+
onClick: () => g(2),
|
|
3126
3125
|
children: "Download"
|
|
3127
3126
|
}),
|
|
3128
3127
|
/* @__PURE__ */ Q(J, {
|
|
3129
3128
|
tone: "primary",
|
|
3130
|
-
size:
|
|
3129
|
+
size: U,
|
|
3131
3130
|
onClick: () => y(!0),
|
|
3132
3131
|
children: "Hide UI"
|
|
3133
3132
|
}),
|
|
3134
3133
|
/* @__PURE__ */ Q(J, {
|
|
3135
3134
|
tone: "primary",
|
|
3136
|
-
size:
|
|
3135
|
+
size: U,
|
|
3137
3136
|
onClick: r,
|
|
3138
3137
|
children: "Start over"
|
|
3139
3138
|
})
|
|
@@ -3149,7 +3148,7 @@ function mi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3149
3148
|
}
|
|
3150
3149
|
//#endregion
|
|
3151
3150
|
//#region src/editor/mobile/MobileView.jsx
|
|
3152
|
-
function
|
|
3151
|
+
function oi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
3153
3152
|
return /* @__PURE__ */ Q("div", {
|
|
3154
3153
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
3155
3154
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -3167,45 +3166,45 @@ function hi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3167
3166
|
})]
|
|
3168
3167
|
}) : /* @__PURE__ */ Q("span", {
|
|
3169
3168
|
className: "kol-eyebrow text-body",
|
|
3170
|
-
children:
|
|
3169
|
+
children: Dt("randomiser").label
|
|
3171
3170
|
}), /* @__PURE__ */ $("div", {
|
|
3172
3171
|
className: "flex flex-col gap-2",
|
|
3173
3172
|
children: [
|
|
3174
3173
|
/* @__PURE__ */ Q(J, {
|
|
3175
3174
|
tone: "primary",
|
|
3176
3175
|
size: "lg",
|
|
3177
|
-
className:
|
|
3178
|
-
iconLeft:
|
|
3179
|
-
iconRight:
|
|
3176
|
+
className: Lt,
|
|
3177
|
+
iconLeft: zt.randomiser,
|
|
3178
|
+
iconRight: zt.randomiser,
|
|
3180
3179
|
onClick: e,
|
|
3181
3180
|
children: "Generate"
|
|
3182
3181
|
}),
|
|
3183
3182
|
/* @__PURE__ */ Q(J, {
|
|
3184
3183
|
tone: "primary",
|
|
3185
3184
|
size: "lg",
|
|
3186
|
-
className:
|
|
3185
|
+
className: Lt,
|
|
3187
3186
|
iconLeft: "filter",
|
|
3188
3187
|
iconRight: "filter",
|
|
3189
3188
|
onClick: t,
|
|
3190
3189
|
children: "Effects"
|
|
3191
3190
|
}),
|
|
3192
|
-
n &&
|
|
3191
|
+
n && St() && /* @__PURE__ */ Q(J, {
|
|
3193
3192
|
tone: "primary",
|
|
3194
3193
|
size: "lg",
|
|
3195
3194
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3196
|
-
iconLeft:
|
|
3197
|
-
iconRight:
|
|
3198
|
-
onClick:
|
|
3199
|
-
children:
|
|
3195
|
+
iconLeft: zt.editor,
|
|
3196
|
+
iconRight: zt.editor,
|
|
3197
|
+
onClick: Ot,
|
|
3198
|
+
children: Dt("editor").label
|
|
3200
3199
|
}),
|
|
3201
3200
|
n && /* @__PURE__ */ Q(J, {
|
|
3202
3201
|
tone: "primary",
|
|
3203
3202
|
size: "lg",
|
|
3204
3203
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3205
|
-
iconLeft:
|
|
3206
|
-
iconRight:
|
|
3207
|
-
onClick:
|
|
3208
|
-
children:
|
|
3204
|
+
iconLeft: zt.labs,
|
|
3205
|
+
iconRight: zt.labs,
|
|
3206
|
+
onClick: Mt,
|
|
3207
|
+
children: Dt("labs").label
|
|
3209
3208
|
}),
|
|
3210
3209
|
n && /* @__PURE__ */ Q(J, {
|
|
3211
3210
|
tone: "primary",
|
|
@@ -3213,7 +3212,7 @@ function hi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3213
3212
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3214
3213
|
iconLeft: "swap",
|
|
3215
3214
|
iconRight: "swap",
|
|
3216
|
-
onClick: () =>
|
|
3215
|
+
onClick: () => bt("/morph"),
|
|
3217
3216
|
children: "Morph"
|
|
3218
3217
|
})
|
|
3219
3218
|
]
|
|
@@ -3221,11 +3220,11 @@ function hi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3221
3220
|
})
|
|
3222
3221
|
});
|
|
3223
3222
|
}
|
|
3224
|
-
function
|
|
3225
|
-
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, canvasW: a, canvasH: o, aspect: s, setAspect: c } =
|
|
3223
|
+
function si() {
|
|
3224
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, canvasW: a, canvasH: o, aspect: s, setAspect: c } = h(), { setTool: u } = lt(), d = Nt() && !ht(), f = Ft(), p = () => {
|
|
3226
3225
|
let e = new URLSearchParams(window.location.search);
|
|
3227
3226
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3228
|
-
}, [
|
|
3227
|
+
}, [g, _] = Z(p), [v, y] = Z(!1), [b, x] = Z(null), [S, C] = Z("contain"), [w, T] = Z(!1), [E, D] = Z(null), [O, k] = Z({
|
|
3229
3228
|
s: 1,
|
|
3230
3229
|
x: 0,
|
|
3231
3230
|
y: 0
|
|
@@ -3244,7 +3243,7 @@ function gi() {
|
|
|
3244
3243
|
mx: (e.x + t.x) / 2,
|
|
3245
3244
|
my: (e.y + t.y) / 2
|
|
3246
3245
|
};
|
|
3247
|
-
},
|
|
3246
|
+
}, P = (e) => `translate(${e.x}px, ${e.y}px) scale(${e.s})`, F = (e) => {
|
|
3248
3247
|
if (j.current.pts.set(e.pointerId, {
|
|
3249
3248
|
x: e.clientX,
|
|
3250
3249
|
y: e.clientY
|
|
@@ -3264,7 +3263,7 @@ function gi() {
|
|
|
3264
3263
|
py: (n.my - a - O.y) / O.s
|
|
3265
3264
|
}, j.current.live = O, i.setStagePointer(null), e.stopPropagation();
|
|
3266
3265
|
}
|
|
3267
|
-
},
|
|
3266
|
+
}, ee = (e) => {
|
|
3268
3267
|
let t = j.current;
|
|
3269
3268
|
if (t.pts.has(e.pointerId) && (t.pts.set(e.pointerId, {
|
|
3270
3269
|
x: e.clientX,
|
|
@@ -3276,36 +3275,36 @@ function gi() {
|
|
|
3276
3275
|
s: i,
|
|
3277
3276
|
x: n.mx - r.ox - i * r.px,
|
|
3278
3277
|
y: n.my - r.oy - i * r.py
|
|
3279
|
-
}, A.current && (A.current.style.transform =
|
|
3278
|
+
}, A.current && (A.current.style.transform = P(t.live));
|
|
3280
3279
|
}
|
|
3281
|
-
},
|
|
3280
|
+
}, I = (e) => {
|
|
3282
3281
|
let t = M.current;
|
|
3283
|
-
t && t.id === e.pointerId && e.type === "pointerup" &&
|
|
3282
|
+
t && t.id === e.pointerId && e.type === "pointerup" && g === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (L?.type === "loop" ? K(L.loopId) : null)?.group !== "penrose" && i.toggle(), t?.id === e.pointerId && (M.current = null), j.current.pts.delete(e.pointerId), j.current.pts.size < 2 && j.current.start && (j.current.start = null, k(j.current.live));
|
|
3284
3283
|
};
|
|
3285
|
-
|
|
3284
|
+
on(), Y(() => (ft("randomiser"), () => ft(null)), []), Y(() => {
|
|
3286
3285
|
c("4:5"), u("orbit");
|
|
3287
3286
|
}, []);
|
|
3288
|
-
let
|
|
3287
|
+
let L = e.find((e) => e.id === b) ?? (e.length === 1 ? e[0] : null), R = g === "live" && L?.type === "photo" && !L.src && L.srcType !== "webcam";
|
|
3289
3288
|
Y(() => {
|
|
3290
|
-
if (!
|
|
3289
|
+
if (!R) return;
|
|
3291
3290
|
let e = (e) => {
|
|
3292
|
-
e.key === "Escape" &&
|
|
3291
|
+
e.key === "Escape" && H();
|
|
3293
3292
|
};
|
|
3294
3293
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
3295
3294
|
}), Y(() => {
|
|
3296
|
-
if (!
|
|
3295
|
+
if (!R) return;
|
|
3297
3296
|
let e = i.isPlaying();
|
|
3298
3297
|
return i.pause(), () => {
|
|
3299
3298
|
e && i.play();
|
|
3300
3299
|
};
|
|
3301
|
-
}, [
|
|
3302
|
-
let
|
|
3303
|
-
let n =
|
|
3300
|
+
}, [R]);
|
|
3301
|
+
let te = (e) => {
|
|
3302
|
+
let n = re(e);
|
|
3304
3303
|
n && (x(t("loop", n)), _("live"));
|
|
3305
|
-
},
|
|
3306
|
-
let t =
|
|
3304
|
+
}, z = (e) => {
|
|
3305
|
+
let t = re(e);
|
|
3307
3306
|
t && b && r(b, t);
|
|
3308
|
-
},
|
|
3307
|
+
}, B = () => {
|
|
3309
3308
|
x(t("photo", {
|
|
3310
3309
|
fit: "cover",
|
|
3311
3310
|
x: 0,
|
|
@@ -3316,22 +3315,22 @@ function gi() {
|
|
|
3316
3315
|
};
|
|
3317
3316
|
Y(() => {
|
|
3318
3317
|
let e = new URL(window.location.href), t = e.searchParams.get("start");
|
|
3319
|
-
t && (t === "effects" && (y(!0),
|
|
3318
|
+
t && (t === "effects" && (y(!0), B()), e.searchParams.delete("start"), window.history.replaceState(window.history.state, "", e));
|
|
3320
3319
|
}, []);
|
|
3321
|
-
let
|
|
3320
|
+
let V = (e) => {
|
|
3322
3321
|
if (e === "fill") {
|
|
3323
3322
|
C("cover");
|
|
3324
3323
|
return;
|
|
3325
3324
|
}
|
|
3326
3325
|
C("contain"), c(e);
|
|
3327
|
-
let t =
|
|
3326
|
+
let t = m[e];
|
|
3328
3327
|
b && t && r(b, {
|
|
3329
3328
|
x: 0,
|
|
3330
3329
|
y: 0,
|
|
3331
3330
|
w: l,
|
|
3332
3331
|
h: Math.round(l * t.h / t.w)
|
|
3333
3332
|
});
|
|
3334
|
-
},
|
|
3333
|
+
}, H = () => {
|
|
3335
3334
|
for (let t of [...e]) n(t.id);
|
|
3336
3335
|
x(null), k({
|
|
3337
3336
|
s: 1,
|
|
@@ -3346,56 +3345,56 @@ function gi() {
|
|
|
3346
3345
|
ref: A,
|
|
3347
3346
|
className: "absolute inset-y-0 left-0 touch-none overflow-hidden",
|
|
3348
3347
|
style: {
|
|
3349
|
-
transform:
|
|
3348
|
+
transform: P(O),
|
|
3350
3349
|
transformOrigin: "0 0",
|
|
3351
3350
|
right: w ? "var(--kol-sidenav-w, 320px)" : 0,
|
|
3352
3351
|
bottom: E ?? 0
|
|
3353
3352
|
},
|
|
3354
|
-
onPointerDownCapture:
|
|
3355
|
-
onPointerMoveCapture:
|
|
3356
|
-
onPointerUpCapture:
|
|
3357
|
-
onPointerCancelCapture:
|
|
3358
|
-
onPointerLeave:
|
|
3359
|
-
children: /* @__PURE__ */ Q(
|
|
3353
|
+
onPointerDownCapture: F,
|
|
3354
|
+
onPointerMoveCapture: ee,
|
|
3355
|
+
onPointerUpCapture: I,
|
|
3356
|
+
onPointerCancelCapture: I,
|
|
3357
|
+
onPointerLeave: I,
|
|
3358
|
+
children: /* @__PURE__ */ Q(_t, { fit: S })
|
|
3360
3359
|
}),
|
|
3361
|
-
|
|
3360
|
+
g === "entry" && /* @__PURE__ */ Q(oi, {
|
|
3362
3361
|
chromes: d,
|
|
3363
3362
|
onGenerate: () => _("category"),
|
|
3364
3363
|
onEffects: () => {
|
|
3365
|
-
y(!0),
|
|
3364
|
+
y(!0), B();
|
|
3366
3365
|
}
|
|
3367
3366
|
}),
|
|
3368
|
-
|
|
3369
|
-
onPick:
|
|
3370
|
-
onInsert:
|
|
3367
|
+
g === "category" && /* @__PURE__ */ Q(mr, {
|
|
3368
|
+
onPick: te,
|
|
3369
|
+
onInsert: B,
|
|
3371
3370
|
onBack: () => _("entry")
|
|
3372
3371
|
}),
|
|
3373
|
-
|
|
3374
|
-
layer:
|
|
3375
|
-
onSwitchCategory:
|
|
3372
|
+
g === "live" && !R && /* @__PURE__ */ Q(ai, {
|
|
3373
|
+
layer: L,
|
|
3374
|
+
onSwitchCategory: z,
|
|
3376
3375
|
onInsert: () => {
|
|
3377
|
-
|
|
3376
|
+
H(), B();
|
|
3378
3377
|
},
|
|
3379
|
-
onRestart:
|
|
3378
|
+
onRestart: H,
|
|
3380
3379
|
aspectValue: S === "cover" ? "fill" : s,
|
|
3381
|
-
openEffects: v && !
|
|
3382
|
-
onAspect:
|
|
3380
|
+
openEffects: v && !R,
|
|
3381
|
+
onAspect: V,
|
|
3383
3382
|
rail: !d && !f,
|
|
3384
3383
|
onRail: T,
|
|
3385
3384
|
onSheet: D
|
|
3386
3385
|
}),
|
|
3387
|
-
|
|
3386
|
+
R && /* @__PURE__ */ $("div", {
|
|
3388
3387
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col",
|
|
3389
3388
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3390
3389
|
children: [/* @__PURE__ */ Q("div", {
|
|
3391
3390
|
className: "flex-1 min-h-0",
|
|
3392
|
-
children: /* @__PURE__ */ Q(
|
|
3391
|
+
children: /* @__PURE__ */ Q(_r, { layer: L })
|
|
3393
3392
|
}), /* @__PURE__ */ Q("div", {
|
|
3394
3393
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3395
3394
|
children: /* @__PURE__ */ Q(J, {
|
|
3396
3395
|
tone: "outline",
|
|
3397
3396
|
size: "lg",
|
|
3398
|
-
onClick:
|
|
3397
|
+
onClick: H,
|
|
3399
3398
|
children: "Back"
|
|
3400
3399
|
})
|
|
3401
3400
|
})]
|
|
@@ -3403,270 +3402,29 @@ function gi() {
|
|
|
3403
3402
|
]
|
|
3404
3403
|
});
|
|
3405
3404
|
}
|
|
3406
|
-
function
|
|
3407
|
-
return /* @__PURE__ */ $(
|
|
3405
|
+
function ci() {
|
|
3406
|
+
return /* @__PURE__ */ $(jt, {
|
|
3408
3407
|
persistDraft: !1,
|
|
3409
|
-
children: [/* @__PURE__ */ Q(
|
|
3410
|
-
});
|
|
3411
|
-
}
|
|
3412
|
-
//#endregion
|
|
3413
|
-
//#region src/editor/float/Movable.jsx
|
|
3414
|
-
var vi = "button, a, input, select, textarea, [role=button], [role=tab], [role=slider]", yi = (e, t) => Math.max(0, Math.min(e, t));
|
|
3415
|
-
function bi({ id: e, start: t = {
|
|
3416
|
-
right: 24,
|
|
3417
|
-
bottom: 24
|
|
3418
|
-
}, onMoved: n, className: r = "", children: i }) {
|
|
3419
|
-
let a = `kol-float-pos:${e}`, o = JSON.stringify(t), [s, c] = Z(() => {
|
|
3420
|
-
try {
|
|
3421
|
-
let e = JSON.parse(localStorage.getItem(a));
|
|
3422
|
-
return e?.start === o ? e.right == null ? {
|
|
3423
|
-
left: e.left,
|
|
3424
|
-
top: e.top
|
|
3425
|
-
} : {
|
|
3426
|
-
right: e.right,
|
|
3427
|
-
bottom: e.bottom
|
|
3428
|
-
} : null;
|
|
3429
|
-
} catch {
|
|
3430
|
-
return null;
|
|
3431
|
-
}
|
|
3432
|
-
}), l = X(null);
|
|
3433
|
-
return Y(() => {
|
|
3434
|
-
n?.(!!s);
|
|
3435
|
-
}, [!!s]), /* @__PURE__ */ Q("div", {
|
|
3436
|
-
ref: l,
|
|
3437
|
-
onPointerDown: (e) => {
|
|
3438
|
-
if (e.button !== 0 || e.target.closest(vi)) return;
|
|
3439
|
-
let t = l.current, n = t.getBoundingClientRect(), r = t.offsetParent.getBoundingClientRect(), i = e.clientX - n.left, s = e.clientY - n.top, u = null;
|
|
3440
|
-
t.setPointerCapture(e.pointerId);
|
|
3441
|
-
let d = (t) => {
|
|
3442
|
-
if (!u && Math.hypot(t.clientX - e.clientX, t.clientY - e.clientY) < 4) return;
|
|
3443
|
-
let a = yi(t.clientX - r.left - i, r.width - n.width), o = yi(t.clientY - r.top - s, r.height - n.height);
|
|
3444
|
-
u = {
|
|
3445
|
-
right: r.width - a - n.width,
|
|
3446
|
-
bottom: r.height - o - n.height
|
|
3447
|
-
}, c(u);
|
|
3448
|
-
}, f = () => {
|
|
3449
|
-
if (t.removeEventListener("pointermove", d), t.removeEventListener("pointerup", f), t.removeEventListener("pointercancel", f), u) try {
|
|
3450
|
-
localStorage.setItem(a, JSON.stringify({
|
|
3451
|
-
...u,
|
|
3452
|
-
start: o
|
|
3453
|
-
}));
|
|
3454
|
-
} catch {}
|
|
3455
|
-
};
|
|
3456
|
-
t.addEventListener("pointermove", d), t.addEventListener("pointerup", f), t.addEventListener("pointercancel", f);
|
|
3457
|
-
},
|
|
3458
|
-
style: s ?? t,
|
|
3459
|
-
onDoubleClick: (e) => {
|
|
3460
|
-
if (!e.target.closest(vi)) {
|
|
3461
|
-
c(null);
|
|
3462
|
-
try {
|
|
3463
|
-
localStorage.removeItem(a);
|
|
3464
|
-
} catch {}
|
|
3465
|
-
}
|
|
3466
|
-
},
|
|
3467
|
-
className: `absolute z-[var(--kol-z-sticky)] cursor-grab active:cursor-grabbing touch-none select-none ${r}`.trim(),
|
|
3468
|
-
children: i
|
|
3469
|
-
});
|
|
3470
|
-
}
|
|
3471
|
-
//#endregion
|
|
3472
|
-
//#region src/editor/labs/FloatLabs.jsx
|
|
3473
|
-
function xi() {
|
|
3474
|
-
let { addFilter: e, patchFilter: t } = g(), { layer: n, setOnly: r } = De(), i = X(null);
|
|
3475
|
-
Y(() => {
|
|
3476
|
-
n?.type === "photo" && n.src && (i.current = {
|
|
3477
|
-
src: n.src,
|
|
3478
|
-
srcType: n.srcType,
|
|
3479
|
-
fit: n.fit
|
|
3480
|
-
});
|
|
3481
|
-
}, [
|
|
3482
|
-
n?.type,
|
|
3483
|
-
n?.src,
|
|
3484
|
-
n?.srcType,
|
|
3485
|
-
n?.fit
|
|
3486
|
-
]);
|
|
3487
|
-
let a = Un({
|
|
3488
|
-
layer: n,
|
|
3489
|
-
setOnly: r,
|
|
3490
|
-
addFilter: e,
|
|
3491
|
-
patchFilter: t,
|
|
3492
|
-
carriedSource: () => n?.type === "photo" ? {
|
|
3493
|
-
src: n.src,
|
|
3494
|
-
srcType: n.srcType,
|
|
3495
|
-
fit: n.fit
|
|
3496
|
-
} : i.current ?? {}
|
|
3497
|
-
}), o = [], s = /* @__PURE__ */ new Map(), c = null;
|
|
3498
|
-
return a.forEach((e) => {
|
|
3499
|
-
if (e.id.startsWith("sec:")) {
|
|
3500
|
-
o.push({
|
|
3501
|
-
icon: zn[e.id.slice(4)] ?? "square",
|
|
3502
|
-
label: e.label,
|
|
3503
|
-
path: e.id,
|
|
3504
|
-
sub: []
|
|
3505
|
-
});
|
|
3506
|
-
return;
|
|
3507
|
-
}
|
|
3508
|
-
let t = e.pages ?? [], n = e.onSelect ?? t[0]?.onSelect ?? t[0]?.children?.[0]?.onSelect;
|
|
3509
|
-
n && s.set(e.id, n), (e.active || t.some((e) => e.active || e.children?.some((e) => e.active))) && (c = e.id);
|
|
3510
|
-
let r = {
|
|
3511
|
-
icon: e.icon,
|
|
3512
|
-
label: e.label,
|
|
3513
|
-
path: e.id
|
|
3514
|
-
}, i = o[o.length - 1];
|
|
3515
|
-
i?.sub ? i.sub.push(r) : o.push(r);
|
|
3516
|
-
}), {
|
|
3517
|
-
items: o,
|
|
3518
|
-
active: c,
|
|
3519
|
-
pick: (e) => s.get(e)?.()
|
|
3520
|
-
};
|
|
3521
|
-
}
|
|
3522
|
-
function Si() {
|
|
3523
|
-
let { layer: e } = De(), { removeLayer: t } = g(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam";
|
|
3524
|
-
return /* @__PURE__ */ $("div", {
|
|
3525
|
-
className: "kol-float-labs-stage absolute inset-0 flex items-center justify-center overflow-hidden bg-surface-primary",
|
|
3526
|
-
children: [/* @__PURE__ */ Q("div", {
|
|
3527
|
-
style: {
|
|
3528
|
-
flex: "none",
|
|
3529
|
-
width: "85%",
|
|
3530
|
-
height: "85%"
|
|
3531
|
-
},
|
|
3532
|
-
children: /* @__PURE__ */ Q(Ct, {})
|
|
3533
|
-
}), n && /* @__PURE__ */ Q(Dr, {
|
|
3534
|
-
layer: e,
|
|
3535
|
-
title: Fr(e).title,
|
|
3536
|
-
onBack: () => t(e.id)
|
|
3537
|
-
})]
|
|
3538
|
-
});
|
|
3539
|
-
}
|
|
3540
|
-
function Ci() {
|
|
3541
|
-
It(), Xr();
|
|
3542
|
-
let e = tn("(max-width: 767px)"), { layer: t } = De(), { selectedId: n, select: r } = g();
|
|
3543
|
-
Y(() => {
|
|
3544
|
-
t && n !== t.id && r(t.id);
|
|
3545
|
-
}, [
|
|
3546
|
-
t,
|
|
3547
|
-
n,
|
|
3548
|
-
r
|
|
3549
|
-
]);
|
|
3550
|
-
let i = xi(), { title: a, kind: o } = t ? Fr(t) : { title: "Labs" }, s = i.items.filter((e) => e.sub?.length).map((e) => e.path), [c, l] = Z(e), [u, d] = Z(e), [f, p] = Z(!1), [m, h] = Z(!1);
|
|
3551
|
-
return /* @__PURE__ */ $("div", {
|
|
3552
|
-
className: "kol-float-labs kol-editor-shell relative h-dvh overflow-hidden",
|
|
3553
|
-
"data-editor-keep-selection": !0,
|
|
3554
|
-
children: [
|
|
3555
|
-
/* @__PURE__ */ Q(Si, {}),
|
|
3556
|
-
u ? /* @__PURE__ */ Q(pn, {
|
|
3557
|
-
items: i.items,
|
|
3558
|
-
currentPath: i.active ?? "",
|
|
3559
|
-
onNavigate: i.pick,
|
|
3560
|
-
title: "Labs",
|
|
3561
|
-
breadcrumb: ["Labs", a],
|
|
3562
|
-
onRestore: () => d(!1),
|
|
3563
|
-
className: "absolute left-6 top-6 z-[var(--kol-z-sticky)]"
|
|
3564
|
-
}) : /* @__PURE__ */ Q(Xt, {
|
|
3565
|
-
variant: "float",
|
|
3566
|
-
items: i.items,
|
|
3567
|
-
currentPath: i.active ?? "",
|
|
3568
|
-
onNavigate: i.pick,
|
|
3569
|
-
title: "Labs",
|
|
3570
|
-
icon: "globe",
|
|
3571
|
-
defaultExpanded: s,
|
|
3572
|
-
collapsed: c,
|
|
3573
|
-
onCollapsedChange: l,
|
|
3574
|
-
onHide: () => d(!0),
|
|
3575
|
-
collapsibleV: !0,
|
|
3576
|
-
collapsedV: m,
|
|
3577
|
-
onCollapseV: h,
|
|
3578
|
-
footer: c ? void 0 : /* @__PURE__ */ Q(fn, {
|
|
3579
|
-
onCollapse: () => l(!0),
|
|
3580
|
-
onHide: () => d(!0)
|
|
3581
|
-
}),
|
|
3582
|
-
className: `absolute left-6 top-6 z-[var(--kol-z-sticky)] ${m && !c ? "" : "bottom-6 !h-auto"}`
|
|
3583
|
-
}),
|
|
3584
|
-
!e && /* @__PURE__ */ Q(bi, {
|
|
3585
|
-
id: "labs-transport",
|
|
3586
|
-
start: {
|
|
3587
|
-
right: 24,
|
|
3588
|
-
bottom: 24
|
|
3589
|
-
},
|
|
3590
|
-
onMoved: p,
|
|
3591
|
-
children: /* @__PURE__ */ Q(At, { collapsibleH: !0 })
|
|
3592
|
-
}),
|
|
3593
|
-
/* @__PURE__ */ Q("div", {
|
|
3594
|
-
className: `absolute ${e ? "left-6 right-6 top-[88px]" : "top-6 right-6"} ${!e && !f ? "bottom-24" : "bottom-6"} z-[var(--kol-z-sticky)] flex flex-col pointer-events-none [&>*]:pointer-events-auto`,
|
|
3595
|
-
children: /* @__PURE__ */ Q(dn, {
|
|
3596
|
-
wide: !0,
|
|
3597
|
-
width: e ? "100%" : void 0,
|
|
3598
|
-
density: "compact",
|
|
3599
|
-
surface: "solid",
|
|
3600
|
-
className: "max-h-full",
|
|
3601
|
-
windows: [
|
|
3602
|
-
{
|
|
3603
|
-
id: "params",
|
|
3604
|
-
title: a || "Labs",
|
|
3605
|
-
kind: o,
|
|
3606
|
-
defaultCollapsedV: e,
|
|
3607
|
-
className: "[&_.kol-compose-inspector-body]:!p-0",
|
|
3608
|
-
children: t ? /* @__PURE__ */ Q("div", {
|
|
3609
|
-
className: "kol-editor-labs",
|
|
3610
|
-
children: /* @__PURE__ */ Q("div", {
|
|
3611
|
-
className: "kol-compose-inspector-body",
|
|
3612
|
-
children: /* @__PURE__ */ Q(xr, {})
|
|
3613
|
-
})
|
|
3614
|
-
}) : /* @__PURE__ */ Q(Jt, {
|
|
3615
|
-
variant: "float",
|
|
3616
|
-
label: "Parameters"
|
|
3617
|
-
})
|
|
3618
|
-
},
|
|
3619
|
-
{
|
|
3620
|
-
id: "output",
|
|
3621
|
-
title: "Output",
|
|
3622
|
-
defaultCollapsedV: e,
|
|
3623
|
-
children: /* @__PURE__ */ Q("div", {
|
|
3624
|
-
className: "kol-editor-labs",
|
|
3625
|
-
children: /* @__PURE__ */ Q(Dt, { part: "output" })
|
|
3626
|
-
})
|
|
3627
|
-
},
|
|
3628
|
-
{
|
|
3629
|
-
id: "file",
|
|
3630
|
-
title: "File",
|
|
3631
|
-
defaultCollapsedV: e,
|
|
3632
|
-
children: /* @__PURE__ */ Q("div", {
|
|
3633
|
-
className: "kol-editor-labs",
|
|
3634
|
-
children: /* @__PURE__ */ Q(Dt, { part: "file" })
|
|
3635
|
-
})
|
|
3636
|
-
}
|
|
3637
|
-
]
|
|
3638
|
-
})
|
|
3639
|
-
})
|
|
3640
|
-
]
|
|
3641
|
-
});
|
|
3642
|
-
}
|
|
3643
|
-
function wi() {
|
|
3644
|
-
return /* @__PURE__ */ Q(I.Provider, {
|
|
3645
|
-
value: "float",
|
|
3646
|
-
children: /* @__PURE__ */ $(Pt, {
|
|
3647
|
-
draftKey: Qr,
|
|
3648
|
-
modalVariant: "float",
|
|
3649
|
-
children: [/* @__PURE__ */ Q(Ci, {}), /* @__PURE__ */ Q(yt, {})]
|
|
3650
|
-
})
|
|
3408
|
+
children: [/* @__PURE__ */ Q(si, {}), /* @__PURE__ */ Q(At, {})]
|
|
3651
3409
|
});
|
|
3652
3410
|
}
|
|
3653
3411
|
//#endregion
|
|
3654
3412
|
//#region src/index.jsx
|
|
3655
|
-
function
|
|
3656
|
-
return e.variant === "kolbox" ? /* @__PURE__ */ Q(
|
|
3413
|
+
function li(e = {}) {
|
|
3414
|
+
return e.variant === "kolbox" ? /* @__PURE__ */ Q(di, { ...e }) : /* @__PURE__ */ Q(It, { ...e });
|
|
3657
3415
|
}
|
|
3658
|
-
var
|
|
3659
|
-
function
|
|
3660
|
-
return e != null && ot(e), t &&
|
|
3416
|
+
var ui = $t(() => import("./KolboxView-BjYfn_tl.js"));
|
|
3417
|
+
function di({ mediaProxyBase: e, mediaClient: t, settingsStore: r, pages: i, account: a }) {
|
|
3418
|
+
return e != null && ot(e), t && it(t), Y(() => {
|
|
3661
3419
|
if (r) return n(r), () => n(null);
|
|
3662
|
-
}, [r]),
|
|
3420
|
+
}, [r]), on(), ln({
|
|
3663
3421
|
client: t ?? null,
|
|
3664
3422
|
store: () => r ?? null,
|
|
3665
3423
|
account: a ?? null
|
|
3666
|
-
}), /* @__PURE__ */ Q(
|
|
3424
|
+
}), /* @__PURE__ */ Q(Zt, {
|
|
3667
3425
|
fallback: null,
|
|
3668
|
-
children: /* @__PURE__ */ Q(
|
|
3426
|
+
children: /* @__PURE__ */ Q(ui, { pages: i })
|
|
3669
3427
|
});
|
|
3670
3428
|
}
|
|
3671
3429
|
//#endregion
|
|
3672
|
-
export {
|
|
3430
|
+
export { dn as _, Vr as a, kn as c, vn as d, En as f, un as g, fn as h, Wr as i, An as l, wn as m, ci as n, Er as o, Dn as p, Ur as r, Zn as s, li as t, Pn as u };
|