@kolkrabbi/design-editor 0.27.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Timeline-OZsY9CvR.js → Timeline-BxVRu-R0.js} +1 -1
- package/dist/{core-DP3uwW4A.js → core-CLlanqLg.js} +6744 -3253
- package/dist/core.js +3 -3
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +339 -339
- package/dist/{motion-yfgCBe5u.js → motion-CeoqVj9I.js} +1 -1
- package/dist/motion.js +1 -1
- package/package.json +12 -9
package/dist/design-editor.js
CHANGED
|
@@ -7,27 +7,27 @@ import { C as Te, E as Ee, S as De, T as Oe, _ as ke, b as Ae, c as je, d as Me,
|
|
|
7
7
|
import { a as Ge, c as Ke, d as qe, f as Je, i as Ye, l as Xe, n as Ze, o as Qe, p as $e, r as et, s as G, t as tt, u as nt } from "./morphStore-DaOLa9oj.js";
|
|
8
8
|
import { n as rt, r as it, t as at } from "./BindDot-CaZu6Uuz.js";
|
|
9
9
|
import { n as ot, r as st } from "./effects-dbxBWOCp.js";
|
|
10
|
-
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-
|
|
11
|
-
import { n as pt, r as mt, t as ht } from "./Timeline-
|
|
12
|
-
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, a as Wt, at as Gt, b as Kt, c as qt, ct as Jt, d as Yt, dt as Xt, et as Zt, f as Qt, ft as $t, g as en, h as tn, i as nn, it as rn, j as an, k as on, l as sn, lt as cn, m as ln, n as un, nt as dn, o as fn, ot as pn, p as mn,
|
|
13
|
-
import { Button as K, Divider as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { Icon as
|
|
17
|
-
import { useDragResize as
|
|
18
|
-
import { createPortal as
|
|
10
|
+
import { a as ct, i as lt, n as ut, o as dt, r as ft } from "./motion-CeoqVj9I.js";
|
|
11
|
+
import { n as pt, r as mt, t as ht } from "./Timeline-BxVRu-R0.js";
|
|
12
|
+
import { $ as gt, A as _t, B as vt, C as yt, D as bt, E as xt, F as St, G as Ct, H as wt, I as Tt, J as Et, K as Dt, L as Ot, M as kt, N as At, O as jt, P as Mt, Q as Nt, R as Pt, S as Ft, T as It, U as Lt, V as Rt, W as zt, X as Bt, Y as Vt, Z as Ht, _ as Ut, a as Wt, at as Gt, b as Kt, c as qt, ct as Jt, d as Yt, dt as Xt, et as Zt, f as Qt, ft as $t, g as en, h as tn, i as nn, it as rn, j as an, k as on, l as sn, lt as cn, m as ln, n as un, nt as dn, o as fn, ot as pn, p as mn, pt as hn, q as gn, r as _n, rt as vn, s as yn, st as bn, t as xn, tt as Sn, u as Cn, ut as wn, v as Tn, w as En, x as Dn, y as On, z as kn } from "./core-CLlanqLg.js";
|
|
13
|
+
import { Button as K, Divider as An, Dropdown as jn, LabeledControlSection as q, MultiSelect as Mn, SegmentedToggle as J, SettingsRow as Nn, StepList as Pn, Tag as Fn, ToggleSwitch as In, Tooltip as Ln, useGrabEdge as Rn, useModal as zn } from "@kolkrabbi/kol-component";
|
|
14
|
+
import { createContext as Bn, useContext as Vn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Hn } from "react";
|
|
15
|
+
import { Fragment as Un, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
16
|
+
import { Icon as Wn } from "@kolkrabbi/kol-icons";
|
|
17
|
+
import { useDragResize as Gn, useTheme as Kn } from "@kolkrabbi/kol-framework";
|
|
18
|
+
import { createPortal as qn } from "react-dom";
|
|
19
19
|
//#region src/phoneFloats.js
|
|
20
|
-
var
|
|
20
|
+
var Jn = (e) => {
|
|
21
21
|
let t = e, n = /* @__PURE__ */ new Set(), r = (e) => (n.add(e), () => n.delete(e));
|
|
22
22
|
return {
|
|
23
23
|
set: (e) => {
|
|
24
24
|
e !== t && (t = e, n.forEach((e) => e()));
|
|
25
25
|
},
|
|
26
|
-
use: () =>
|
|
26
|
+
use: () => Hn(r, () => t, () => t)
|
|
27
27
|
};
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
var
|
|
28
|
+
}, Yn = Jn(null), Xn = Jn(null), Zn = Yn.set;
|
|
29
|
+
Yn.use, Xn.set;
|
|
30
|
+
var Qn = Xn.use, $n = [
|
|
31
31
|
{
|
|
32
32
|
id: "shape",
|
|
33
33
|
label: "Shape",
|
|
@@ -43,7 +43,7 @@ var Zn = Yn.use, Qn = [
|
|
|
43
43
|
label: "Crossfade",
|
|
44
44
|
icon: "dashed-circle"
|
|
45
45
|
}
|
|
46
|
-
],
|
|
46
|
+
], er = {
|
|
47
47
|
shape: [
|
|
48
48
|
["Loops", ["morph-circle", "star-morph"]],
|
|
49
49
|
["Loops", [
|
|
@@ -117,21 +117,21 @@ var Zn = Yn.use, Qn = [
|
|
|
117
117
|
2
|
|
118
118
|
]
|
|
119
119
|
]
|
|
120
|
-
},
|
|
121
|
-
function
|
|
122
|
-
if (!
|
|
123
|
-
|
|
120
|
+
}, tr = null;
|
|
121
|
+
function nr(e) {
|
|
122
|
+
if (!tr) {
|
|
123
|
+
tr = /* @__PURE__ */ new Map();
|
|
124
124
|
let e = /* @__PURE__ */ new Set();
|
|
125
|
-
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id),
|
|
125
|
+
for (let t of z) for (let n of N(t.id)) e.has(n.id) || le(n) || (e.add(n.id), tr.has(n.loop) || tr.set(n.loop, []), tr.get(n.loop).push(n));
|
|
126
126
|
}
|
|
127
|
-
return
|
|
127
|
+
return tr.get(e) ?? [];
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
129
|
+
var rr = (e, t) => e.length < t ? null : Array.from({ length: t }, (n, r) => e[Math.round(r * (e.length - 1) / (t - 1))]), ir = null;
|
|
130
|
+
function ar() {
|
|
131
|
+
if (ir) return ir;
|
|
132
132
|
let e = [];
|
|
133
|
-
for (let t of
|
|
134
|
-
let [r] = n, i = t.id === "blend" ? nr(
|
|
133
|
+
for (let t of $n) for (let n of er[t.id]) {
|
|
134
|
+
let [r] = n, i = t.id === "blend" ? rr(nr(n[1]), n[2]) : n[1].map((e) => nr(e)[0]);
|
|
135
135
|
if (!i || i.some((e) => !e) || new Set(i.map((e) => e.id)).size < i.length) continue;
|
|
136
136
|
let a = i.map((e) => e.label).join(" → "), o = `ship:morph:${t.id}:${i.map((e) => e.id).join("--")}`;
|
|
137
137
|
e.push({
|
|
@@ -154,24 +154,24 @@ function ir() {
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
return
|
|
157
|
+
return ir = e;
|
|
158
158
|
}
|
|
159
|
-
var
|
|
159
|
+
var or = () => $n.map((e) => ({
|
|
160
160
|
label: e.label,
|
|
161
|
-
subs: [...new Set(
|
|
162
|
-
})),
|
|
163
|
-
function
|
|
161
|
+
subs: [...new Set(ar().filter((t) => t.type === e.id).map((e) => e.sub))]
|
|
162
|
+
})), sr = (e, t) => ar().find((n) => n.type === e && (!t || n.category === t)), cr = (e) => ar().find((t) => t.id === e);
|
|
163
|
+
function lr(e) {
|
|
164
164
|
e && (Qe({
|
|
165
165
|
active: !0,
|
|
166
166
|
...e.morph,
|
|
167
167
|
fileId: null,
|
|
168
168
|
fileName: e.label,
|
|
169
169
|
presetId: e.id
|
|
170
|
-
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) ||
|
|
170
|
+
}), O.setLoopSeconds(e.morph.seconds), /\/morph\/?$/.test(window.location.pathname) || cn("/morph"));
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/editor/labs/catalog.js
|
|
174
|
-
var
|
|
174
|
+
var ur = {
|
|
175
175
|
"fx:halftone": "ptrn-dot",
|
|
176
176
|
"fx:scanline": "grid-horizontal",
|
|
177
177
|
"fx:crt": "desktop",
|
|
@@ -195,19 +195,19 @@ var lr = {
|
|
|
195
195
|
"misc:Para Type": "aa",
|
|
196
196
|
"vec:Distressor": "scribble",
|
|
197
197
|
"vec:Modulator": "dashed-circle"
|
|
198
|
-
},
|
|
198
|
+
}, dr = {
|
|
199
199
|
effects: "filter",
|
|
200
200
|
generative: "layers",
|
|
201
201
|
vector: "pen-nib",
|
|
202
202
|
composition: "type",
|
|
203
203
|
morph: "swap",
|
|
204
204
|
mode: "mode-toggle-01"
|
|
205
|
-
},
|
|
205
|
+
}, fr = [
|
|
206
206
|
"Moiré",
|
|
207
207
|
"Mesh Gradient",
|
|
208
208
|
"Reaction",
|
|
209
209
|
"Halftone"
|
|
210
|
-
],
|
|
210
|
+
], pr = [
|
|
211
211
|
{
|
|
212
212
|
label: "Spaced",
|
|
213
213
|
patch: {
|
|
@@ -239,11 +239,11 @@ var lr = {
|
|
|
239
239
|
label: "Spiral",
|
|
240
240
|
patch: { geometry: "spiral" }
|
|
241
241
|
}
|
|
242
|
-
],
|
|
242
|
+
], mr = (e = {}) => {
|
|
243
243
|
let t = e.geometry ?? "rows";
|
|
244
244
|
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
245
245
|
};
|
|
246
|
-
function
|
|
246
|
+
function hr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
247
247
|
let a = () => e?.type === "photo" ? (e.filters ?? []).filter((e) => e?.id === "fx-media") : [], o = (e, o) => {
|
|
248
248
|
let s = a(), c = t("photo", {
|
|
249
249
|
...i(),
|
|
@@ -300,19 +300,19 @@ function mr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
300
300
|
...oe(L).map((t) => ({
|
|
301
301
|
id: `fx:${t.id}`,
|
|
302
302
|
label: t.label,
|
|
303
|
-
icon:
|
|
303
|
+
icon: ur[`fx:${t.id}`] ?? "square",
|
|
304
304
|
pages: t.rack ? se.map((t) => ({
|
|
305
305
|
label: t.label,
|
|
306
306
|
onSelect: () => s(t.id),
|
|
307
307
|
active: e?.fxGroup === t.id
|
|
308
|
-
})) : t.id === "pattern" ?
|
|
308
|
+
})) : t.id === "pattern" ? fr.map((t) => ({
|
|
309
309
|
label: t,
|
|
310
310
|
onSelect: () => c(ne("optic", t)[0], "optic"),
|
|
311
311
|
active: e?.loopGroup === "optic" && f?.sub === t
|
|
312
|
-
})) : t.id === "scanline" ?
|
|
312
|
+
})) : t.id === "scanline" ? pr.map((t) => ({
|
|
313
313
|
label: t.label,
|
|
314
314
|
onSelect: () => o("scanline", t.patch),
|
|
315
|
-
active: !e?.fxGroup && d === "scanline" &&
|
|
315
|
+
active: !e?.fxGroup && d === "scanline" && mr((e?.filters ?? []).find((e) => e?.id === "scanline")?.params) === t.label
|
|
316
316
|
})) : t.filters.map((t) => ({
|
|
317
317
|
label: t.label ?? t.id,
|
|
318
318
|
onSelect: () => o(t.id),
|
|
@@ -326,22 +326,22 @@ function mr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
326
326
|
...we.map((e) => ({
|
|
327
327
|
id: `gen:${e.label}`,
|
|
328
328
|
label: e.label,
|
|
329
|
-
icon:
|
|
329
|
+
icon: ur[`gen:${e.label}`] ?? "square",
|
|
330
330
|
pages: m(e)
|
|
331
331
|
})),
|
|
332
332
|
{
|
|
333
333
|
id: "sec:morph",
|
|
334
334
|
label: "Morph"
|
|
335
335
|
},
|
|
336
|
-
|
|
336
|
+
...$n.map((e) => ({
|
|
337
337
|
id: `morph:${e.id}`,
|
|
338
338
|
label: e.label,
|
|
339
339
|
icon: e.icon,
|
|
340
|
-
pages: [...new Set(
|
|
340
|
+
pages: [...new Set(ar().filter((t) => t.type === e.id).map((e) => e.category))].map((t) => ({
|
|
341
341
|
label: t,
|
|
342
|
-
onSelect: () =>
|
|
342
|
+
onSelect: () => lr(sr(e.id, t)),
|
|
343
343
|
active: (() => {
|
|
344
|
-
let n =
|
|
344
|
+
let n = ar().find((e) => e.id === Ze().presetId);
|
|
345
345
|
return n?.type === e.id && n.category === t;
|
|
346
346
|
})()
|
|
347
347
|
}))
|
|
@@ -353,13 +353,13 @@ function mr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
353
353
|
{
|
|
354
354
|
id: "vec:Distressor",
|
|
355
355
|
label: "Distressor",
|
|
356
|
-
icon:
|
|
356
|
+
icon: ur["vec:Distressor"] ?? "square",
|
|
357
357
|
pages: p("distress")
|
|
358
358
|
},
|
|
359
359
|
{
|
|
360
360
|
id: "vec:Modulator",
|
|
361
361
|
label: "Modulator",
|
|
362
|
-
icon:
|
|
362
|
+
icon: ur["vec:Modulator"] ?? "square",
|
|
363
363
|
pages: p("modulator")
|
|
364
364
|
},
|
|
365
365
|
{
|
|
@@ -369,7 +369,7 @@ function mr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
369
369
|
...ct.map((t) => ({
|
|
370
370
|
id: `kin:${t.label}`,
|
|
371
371
|
label: t.label,
|
|
372
|
-
icon:
|
|
372
|
+
icon: ur[`kin:${t.label}`] ?? "square",
|
|
373
373
|
pages: t.subs.map((t) => ({
|
|
374
374
|
label: t,
|
|
375
375
|
onSelect: () => l(lt.find((e) => e.sub === t)),
|
|
@@ -379,14 +379,14 @@ function mr({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource:
|
|
|
379
379
|
...fe.map((e) => ({
|
|
380
380
|
id: `misc:${e.label}`,
|
|
381
381
|
label: e.label,
|
|
382
|
-
icon:
|
|
382
|
+
icon: ur[`misc:${e.label}`] ?? "square",
|
|
383
383
|
pages: e.groups.flatMap((e) => p(e, "misc"))
|
|
384
384
|
}))
|
|
385
385
|
];
|
|
386
386
|
}
|
|
387
387
|
//#endregion
|
|
388
388
|
//#region src/editor/labs/LabsNav.jsx
|
|
389
|
-
function
|
|
389
|
+
function gr() {
|
|
390
390
|
let { addFilter: e, patchFilter: t } = i(), { layer: n, setOnly: r } = W(), a = X(null);
|
|
391
391
|
Y(() => {
|
|
392
392
|
n?.type === "photo" && n.src && (a.current = {
|
|
@@ -400,7 +400,7 @@ function hr() {
|
|
|
400
400
|
n?.srcType,
|
|
401
401
|
n?.fit
|
|
402
402
|
]);
|
|
403
|
-
let o =
|
|
403
|
+
let o = hr({
|
|
404
404
|
layer: n,
|
|
405
405
|
setOnly: r,
|
|
406
406
|
addFilter: e,
|
|
@@ -417,14 +417,14 @@ function hr() {
|
|
|
417
417
|
if (n.id.startsWith("sec:")) {
|
|
418
418
|
let e = n.id.slice(4);
|
|
419
419
|
t.push({
|
|
420
|
-
icon:
|
|
421
|
-
path: `${
|
|
420
|
+
icon: dr[e] ?? "square",
|
|
421
|
+
path: `${qt}${n.id}`,
|
|
422
422
|
label: n.label,
|
|
423
423
|
sub: []
|
|
424
424
|
});
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
|
-
let r = `${
|
|
427
|
+
let r = `${qt}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
428
428
|
a && e.set(r, a);
|
|
429
429
|
let o = t[t.length - 1], s = {
|
|
430
430
|
icon: n.icon,
|
|
@@ -432,18 +432,18 @@ function hr() {
|
|
|
432
432
|
label: n.label
|
|
433
433
|
};
|
|
434
434
|
o?.sub ? o.sub.push(s) : t.push(s);
|
|
435
|
-
}),
|
|
435
|
+
}), sn({
|
|
436
436
|
items: t,
|
|
437
437
|
dispatch: (t) => {
|
|
438
438
|
let n = e.get(t);
|
|
439
439
|
return n ? (n(), !0) : !1;
|
|
440
440
|
}
|
|
441
|
-
}), () =>
|
|
441
|
+
}), () => sn(null);
|
|
442
442
|
}), null;
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/editor/morph/MorphTab.jsx
|
|
446
|
-
var
|
|
446
|
+
var _r = (e, t) => JSON.stringify(e) === JSON.stringify(t), vr = [
|
|
447
447
|
{
|
|
448
448
|
key: "curve",
|
|
449
449
|
label: "Curve",
|
|
@@ -476,8 +476,8 @@ var gr = (e, t) => JSON.stringify(e) === JSON.stringify(t), _r = [
|
|
|
476
476
|
when: (e) => e.mode === "shape"
|
|
477
477
|
}
|
|
478
478
|
];
|
|
479
|
-
function
|
|
480
|
-
let o = a(), s = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = s, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = i(), { setOnly: S } = W(), { buildSavedSpec: C } =
|
|
479
|
+
function yr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
480
|
+
let o = a(), s = nt(), { steps: c, curve: l, cycle: u, mode: d, resolution: p, editing: m, fileId: h, editRequest: g } = s, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = i(), { setOnly: S } = W(), { buildSavedSpec: C } = Lt(), { addItem: w, updateItem: T } = Ne(), E = zn(), D = f(), ee = te(e?.id ?? null, { history: "coalesce" }), [k, j] = Z("generate"), M = c[0], ne = c.every((e) => e.loopId === M?.loopId), N = c.filter((e) => !Ct(U(e.loopId)) || !zt(U(e.loopId))), P = N.length === 0, F = {
|
|
481
481
|
blend: ne ? null : "Blend tweens one generator — these steps are different generators",
|
|
482
482
|
shape: P ? null : `No outline to morph: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`,
|
|
483
483
|
crossfade: P ? null : `Cannot fade: ${N.map((e) => Ke(e, c.indexOf(e))).join(", ")} (GL)`
|
|
@@ -574,7 +574,7 @@ function vr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
574
574
|
morph: r,
|
|
575
575
|
morphT: {
|
|
576
576
|
bind: "track",
|
|
577
|
-
keys:
|
|
577
|
+
keys: Dt(c.length, u, l)
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
e ? _(e.id, i) : S("loop", i);
|
|
@@ -598,7 +598,7 @@ function vr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
598
598
|
]), Y(() => {
|
|
599
599
|
if (t || m == null || !e) return;
|
|
600
600
|
let n = et(e, U(e.loopId)?.params ?? []);
|
|
601
|
-
|
|
601
|
+
_r(n, c[m]?.params) || Xe(m, n);
|
|
602
602
|
}, [e]), Y(() => {
|
|
603
603
|
t || !D || m == null || (G({ editing: null }), ae.current = null);
|
|
604
604
|
}, [
|
|
@@ -636,17 +636,17 @@ function vr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
636
636
|
!t && /* @__PURE__ */ Q(q, {
|
|
637
637
|
divided: !0,
|
|
638
638
|
children: /* @__PURE__ */ Q(ue, {
|
|
639
|
-
tree:
|
|
640
|
-
presets:
|
|
641
|
-
current:
|
|
639
|
+
tree: or(),
|
|
640
|
+
presets: ar(),
|
|
641
|
+
current: cr(s.presetId) ?? { typeLabel: $n.find((e) => e.id === d)?.label },
|
|
642
642
|
subLabel: (e) => e.split(" · ").pop(),
|
|
643
|
-
onPick:
|
|
643
|
+
onPick: lr
|
|
644
644
|
})
|
|
645
645
|
}),
|
|
646
646
|
/* @__PURE__ */ $(q, {
|
|
647
647
|
divided: !0,
|
|
648
648
|
children: [
|
|
649
|
-
/* @__PURE__ */ Q(
|
|
649
|
+
/* @__PURE__ */ Q(Pn, {
|
|
650
650
|
items: c.map((e, t) => ({
|
|
651
651
|
id: t,
|
|
652
652
|
label: Ke(e, t)
|
|
@@ -708,7 +708,7 @@ function vr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
708
708
|
]
|
|
709
709
|
}),
|
|
710
710
|
/* @__PURE__ */ Q(A, {
|
|
711
|
-
schema:
|
|
711
|
+
schema: vr,
|
|
712
712
|
layer: s,
|
|
713
713
|
setProp: (e, n) => {
|
|
714
714
|
!t && (typeof n != "object" || !n) && G({ [e]: n });
|
|
@@ -758,7 +758,7 @@ function vr({ layer: e, readOnly: t = !1, editTabs: n = null }) {
|
|
|
758
758
|
}
|
|
759
759
|
//#endregion
|
|
760
760
|
//#region src/editor/params/QuickMotion.jsx
|
|
761
|
-
var
|
|
761
|
+
var br = [
|
|
762
762
|
{
|
|
763
763
|
value: "breathe",
|
|
764
764
|
label: "Breathe",
|
|
@@ -777,14 +777,14 @@ var yr = [
|
|
|
777
777
|
source: "lfo-square",
|
|
778
778
|
rate: 8
|
|
779
779
|
}
|
|
780
|
-
],
|
|
781
|
-
function
|
|
780
|
+
], xr = .2;
|
|
781
|
+
function Sr(e) {
|
|
782
782
|
if (!t(e)) return "off";
|
|
783
783
|
if (e.bind !== "mod") return "custom";
|
|
784
|
-
let n =
|
|
784
|
+
let n = br.find((t) => t.source === e.source && (e.transform?.rate ?? 1) === t.rate);
|
|
785
785
|
return n ? n.value : "custom";
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function Cr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
788
788
|
let o = a(), s = v(e ?? [], t).filter((e) => e.type === "range" && e.animatable !== !1 && D(e) !== "anim" && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
789
789
|
if (!s.length) return null;
|
|
790
790
|
let c = (e, n) => {
|
|
@@ -794,9 +794,9 @@ function Sr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
794
794
|
r(e.key, Array.isArray(n) ? (n[0] + n[1]) / 2 : y(i, O.getCtx(), t) ?? e.default ?? e.min);
|
|
795
795
|
return;
|
|
796
796
|
}
|
|
797
|
-
let a =
|
|
797
|
+
let a = br.find((e) => e.value === n);
|
|
798
798
|
if (!a) return;
|
|
799
|
-
let o = Number(y(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) *
|
|
799
|
+
let o = Number(y(i, O.getCtx(), t) ?? e.default ?? e.min), s = (e.max - e.min) * xr, c = Math.max(e.min, o - s), l = Math.min(e.max, o + s);
|
|
800
800
|
r(e.key, {
|
|
801
801
|
bind: "mod",
|
|
802
802
|
source: a.source,
|
|
@@ -810,12 +810,12 @@ function Sr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
810
810
|
label: i,
|
|
811
811
|
divided: !0,
|
|
812
812
|
children: s.map((e) => {
|
|
813
|
-
let r =
|
|
813
|
+
let r = Sr(t[e.key]), i = [
|
|
814
814
|
{
|
|
815
815
|
value: "off",
|
|
816
816
|
label: "Off"
|
|
817
817
|
},
|
|
818
|
-
...
|
|
818
|
+
...br.map(({ value: e, label: t }) => ({
|
|
819
819
|
value: e,
|
|
820
820
|
label: t
|
|
821
821
|
})),
|
|
@@ -824,11 +824,11 @@ function Sr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
824
824
|
label: "Custom"
|
|
825
825
|
}] : []
|
|
826
826
|
];
|
|
827
|
-
return /* @__PURE__ */ Q(
|
|
827
|
+
return /* @__PURE__ */ Q(Nn, {
|
|
828
828
|
label: e.label,
|
|
829
829
|
align: "fill",
|
|
830
830
|
labelWidth: n,
|
|
831
|
-
children: /* @__PURE__ */ Q(
|
|
831
|
+
children: /* @__PURE__ */ Q(jn, {
|
|
832
832
|
size: o,
|
|
833
833
|
variant: "subtle",
|
|
834
834
|
className: "w-full",
|
|
@@ -842,7 +842,7 @@ function Sr({ schema: e, layer: t, setProp: r, label: i = "Modulate" }) {
|
|
|
842
842
|
}
|
|
843
843
|
//#endregion
|
|
844
844
|
//#region src/editor/params/InputRows.jsx
|
|
845
|
-
var
|
|
845
|
+
var wr = [
|
|
846
846
|
{
|
|
847
847
|
value: "off",
|
|
848
848
|
label: "Off"
|
|
@@ -867,13 +867,13 @@ var Cr = [
|
|
|
867
867
|
value: "lfo-sine",
|
|
868
868
|
label: "LFO"
|
|
869
869
|
}
|
|
870
|
-
],
|
|
871
|
-
function
|
|
870
|
+
], Tr = new Set(wr.map((e) => e.value));
|
|
871
|
+
function Er({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
872
872
|
let o = a(), s = v(e ?? [], n).filter((e) => e.type === "range" && e.animatable !== !1 && e.min != null && e.max != null && !/seed/i.test(e.key));
|
|
873
873
|
if (!s.length) return null;
|
|
874
874
|
let c = new Map(s.map((e) => [e.key, e])), l = (i ?? []).filter((e) => c.has(e)), u = [...l, ...s.map((e) => e.key).filter((e) => !l.includes(e))], d = l.length ? l : u.slice(0, 3), f = (e) => {
|
|
875
875
|
let r = n[e];
|
|
876
|
-
return t(r) && r.bind === "mod" &&
|
|
876
|
+
return t(r) && r.bind === "mod" && Tr.has(r.source);
|
|
877
877
|
}, p = u.filter(f), m = (e) => {
|
|
878
878
|
let t = c.get(e);
|
|
879
879
|
return Number(y(n[e], O.getCtx(), n) ?? t.default ?? t.min);
|
|
@@ -892,13 +892,13 @@ function Tr({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
892
892
|
return /* @__PURE__ */ $(q, {
|
|
893
893
|
label: "Inputs",
|
|
894
894
|
divided: !0,
|
|
895
|
-
children: [p.map((e) => /* @__PURE__ */ Q(
|
|
895
|
+
children: [p.map((e) => /* @__PURE__ */ Q(Mn, {
|
|
896
896
|
size: o,
|
|
897
897
|
className: "w-full [&>button]:w-full",
|
|
898
898
|
groups: [{
|
|
899
899
|
id: "source",
|
|
900
900
|
label: "Source",
|
|
901
|
-
options:
|
|
901
|
+
options: wr
|
|
902
902
|
}, {
|
|
903
903
|
id: "drives",
|
|
904
904
|
label: "Drives",
|
|
@@ -911,7 +911,7 @@ function Tr({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
911
911
|
source: n[e].source,
|
|
912
912
|
drives: e
|
|
913
913
|
},
|
|
914
|
-
label: `${
|
|
914
|
+
label: `${wr.find((t) => t.value === n[e].source)?.label} → ${c.get(e).label}`,
|
|
915
915
|
onChange: (t, r) => {
|
|
916
916
|
if (t === "source") {
|
|
917
917
|
r === "off" ? g(e) : h(e, r);
|
|
@@ -932,8 +932,8 @@ function Tr({ schema: e, layer: n, setProp: r, inputs: i = null }) {
|
|
|
932
932
|
}
|
|
933
933
|
//#endregion
|
|
934
934
|
//#region src/editor/labs/ModelSource.jsx
|
|
935
|
-
var
|
|
936
|
-
function
|
|
935
|
+
var Dr = /\.(obj|glb|gltf|stl)$/i, Or = (e) => Dr.test(e.key ?? e.name ?? ""), kr = (e) => (e.match(Dr)?.[1] ?? "obj").toLowerCase(), Ar = (e) => e?.startsWith("data:") ? "Local file" : decodeURIComponent(String(e ?? "").split("/").pop() || "—");
|
|
936
|
+
function jr({ layer: e, setProp: t }) {
|
|
937
937
|
let n = a(), [r, i] = Z(!1), o = X(null), s = (e, n) => {
|
|
938
938
|
t("meshSrc", e), t("meshType", n);
|
|
939
939
|
};
|
|
@@ -943,7 +943,7 @@ function Ar({ layer: e, setProp: t }) {
|
|
|
943
943
|
children: [
|
|
944
944
|
/* @__PURE__ */ Q("span", {
|
|
945
945
|
className: "kol-mono-12 text-meta truncate",
|
|
946
|
-
children:
|
|
946
|
+
children: Ar(e.meshSrc)
|
|
947
947
|
}),
|
|
948
948
|
/* @__PURE__ */ $("div", {
|
|
949
949
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -968,15 +968,15 @@ function Ar({ layer: e, setProp: t }) {
|
|
|
968
968
|
let t = e.target.files?.[0];
|
|
969
969
|
if (e.target.value = "", !t) return;
|
|
970
970
|
let n = new FileReader();
|
|
971
|
-
n.onload = () => s(n.result,
|
|
971
|
+
n.onload = () => s(n.result, kr(t.name)), n.readAsDataURL(t);
|
|
972
972
|
}
|
|
973
973
|
}),
|
|
974
|
-
/* @__PURE__ */ Q(
|
|
974
|
+
/* @__PURE__ */ Q(Ut, {
|
|
975
975
|
open: r,
|
|
976
|
-
accept:
|
|
976
|
+
accept: Or,
|
|
977
977
|
onClose: () => i(!1),
|
|
978
978
|
onSelect: (e) => {
|
|
979
|
-
i(!1), s(
|
|
979
|
+
i(!1), s(On(e), kr(e));
|
|
980
980
|
}
|
|
981
981
|
})
|
|
982
982
|
]
|
|
@@ -984,23 +984,23 @@ function Ar({ layer: e, setProp: t }) {
|
|
|
984
984
|
}
|
|
985
985
|
//#endregion
|
|
986
986
|
//#region src/editor/labs/useLabsKeys.js
|
|
987
|
-
function
|
|
987
|
+
function Mr(e, t) {
|
|
988
988
|
Y(() => {
|
|
989
989
|
let n = (n) => {
|
|
990
|
-
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey ||
|
|
990
|
+
n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey || kn(n) || (n.preventDefault(), n.shiftKey ? t?.() : e?.());
|
|
991
991
|
};
|
|
992
992
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
993
993
|
});
|
|
994
994
|
}
|
|
995
995
|
//#endregion
|
|
996
996
|
//#region src/editor/labs/LabsParams.jsx
|
|
997
|
-
var
|
|
997
|
+
var Nr = [{
|
|
998
998
|
value: "effect",
|
|
999
999
|
label: "Effect"
|
|
1000
1000
|
}, {
|
|
1001
1001
|
value: "anim",
|
|
1002
1002
|
label: "Motion"
|
|
1003
|
-
}],
|
|
1003
|
+
}], Pr = [
|
|
1004
1004
|
{
|
|
1005
1005
|
value: "generate",
|
|
1006
1006
|
label: "Generate"
|
|
@@ -1013,7 +1013,7 @@ var Mr = [{
|
|
|
1013
1013
|
value: "anim",
|
|
1014
1014
|
label: "Animation"
|
|
1015
1015
|
}
|
|
1016
|
-
],
|
|
1016
|
+
], Fr = [
|
|
1017
1017
|
{
|
|
1018
1018
|
value: "generate",
|
|
1019
1019
|
label: "Gen"
|
|
@@ -1027,11 +1027,11 @@ var Mr = [{
|
|
|
1027
1027
|
label: "Anim"
|
|
1028
1028
|
}
|
|
1029
1029
|
];
|
|
1030
|
-
function
|
|
1030
|
+
function Ir({ options: e, active: t, onPick: n, spread: i = !1, pills: o = !1 }) {
|
|
1031
1031
|
let s = a();
|
|
1032
1032
|
return e?.length ? o ? /* @__PURE__ */ Q("div", {
|
|
1033
1033
|
className: "flex items-center gap-1 flex-wrap",
|
|
1034
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
1034
|
+
children: e.map((e) => /* @__PURE__ */ Q(Fn, {
|
|
1035
1035
|
size: "xs",
|
|
1036
1036
|
hash: !1,
|
|
1037
1037
|
active: e.value === t,
|
|
@@ -1048,13 +1048,13 @@ function Fr({ options: e, active: t, onPick: n, spread: i = !1, pills: o = !1 })
|
|
|
1048
1048
|
className: r(s)
|
|
1049
1049
|
}) : null;
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function Lr() {
|
|
1052
1052
|
let { undo: e, redo: t, canUndo: n, canRedo: r } = i(), o = a(), s = (e, t) => e ? t : /* @__PURE__ */ Q("span", {
|
|
1053
1053
|
"aria-hidden": "true",
|
|
1054
1054
|
className: "invisible pointer-events-none",
|
|
1055
1055
|
children: t
|
|
1056
1056
|
});
|
|
1057
|
-
return /* @__PURE__ */ $(
|
|
1057
|
+
return /* @__PURE__ */ $(Un, { children: [s(n, /* @__PURE__ */ Q(Ln, {
|
|
1058
1058
|
label: "Undo",
|
|
1059
1059
|
shortcut: "⌘Z",
|
|
1060
1060
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1064,7 +1064,7 @@ function Ir() {
|
|
|
1064
1064
|
tabIndex: n ? void 0 : -1,
|
|
1065
1065
|
onClick: e
|
|
1066
1066
|
})
|
|
1067
|
-
})), s(r, /* @__PURE__ */ Q(
|
|
1067
|
+
})), s(r, /* @__PURE__ */ Q(Ln, {
|
|
1068
1068
|
label: "Redo",
|
|
1069
1069
|
shortcut: "⇧⌘Z",
|
|
1070
1070
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1076,7 +1076,7 @@ function Ir() {
|
|
|
1076
1076
|
})
|
|
1077
1077
|
}))] });
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function Rr({ chips: e, active: t, onPick: r, spread: i, pills: o, title: s, tabStrip: c, preStrip: l, fx: u = !1, scope: d, ghostLabels: f, children: p }) {
|
|
1080
1080
|
let m = a() === "sm";
|
|
1081
1081
|
return /* @__PURE__ */ $("div", {
|
|
1082
1082
|
className: `flex flex-col gap-5${u ? " kol-labs-fx" : ""}`,
|
|
@@ -1087,9 +1087,9 @@ function Lr({ chips: e, active: t, onPick: r, spread: i, pills: o, title: s, tab
|
|
|
1087
1087
|
children: [/* @__PURE__ */ Q("p", {
|
|
1088
1088
|
className: "kol-eyebrow text-fg-96 flex-1 min-w-0",
|
|
1089
1089
|
children: s
|
|
1090
|
-
}), /* @__PURE__ */ Q(
|
|
1090
|
+
}), /* @__PURE__ */ Q(Lr, {})]
|
|
1091
1091
|
}),
|
|
1092
|
-
e && /* @__PURE__ */ Q(
|
|
1092
|
+
e && /* @__PURE__ */ Q(Ir, {
|
|
1093
1093
|
options: e,
|
|
1094
1094
|
active: t,
|
|
1095
1095
|
onPick: r,
|
|
@@ -1111,7 +1111,7 @@ function Lr({ chips: e, active: t, onPick: r, spread: i, pills: o, title: s, tab
|
|
|
1111
1111
|
]
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function zr({ layer: e, showMod: t }) {
|
|
1115
1115
|
let o = p(), s = a(), [c, l] = Z("effect");
|
|
1116
1116
|
Y(() => {
|
|
1117
1117
|
let e = () => l("effect");
|
|
@@ -1153,7 +1153,7 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1153
1153
|
} : e);
|
|
1154
1154
|
v(e.id, { filters: n });
|
|
1155
1155
|
};
|
|
1156
|
-
|
|
1156
|
+
Mr(() => {
|
|
1157
1157
|
E && v(e.id, { filters: P.map((e, t) => t === 0 ? {
|
|
1158
1158
|
...e,
|
|
1159
1159
|
params: {}
|
|
@@ -1179,34 +1179,34 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1179
1179
|
value: e.id,
|
|
1180
1180
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
1181
1181
|
}))];
|
|
1182
|
-
return /* @__PURE__ */ $(
|
|
1182
|
+
return /* @__PURE__ */ $(Rr, {
|
|
1183
1183
|
title: "Effects",
|
|
1184
1184
|
fx: !0,
|
|
1185
1185
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1186
1186
|
tone: "sunken",
|
|
1187
1187
|
value: c,
|
|
1188
1188
|
onChange: l,
|
|
1189
|
-
options:
|
|
1189
|
+
options: Nr,
|
|
1190
1190
|
size: s,
|
|
1191
1191
|
className: r(s)
|
|
1192
1192
|
}),
|
|
1193
|
-
children: [c === "effect" && /* @__PURE__ */ $(
|
|
1193
|
+
children: [c === "effect" && /* @__PURE__ */ $(Un, { children: [
|
|
1194
1194
|
/* @__PURE__ */ $(q, {
|
|
1195
1195
|
label: "Effect stack",
|
|
1196
1196
|
divided: !0,
|
|
1197
1197
|
children: [S.length === 0 && /* @__PURE__ */ Q(j, {
|
|
1198
1198
|
className: "kol-mono-10 text-meta",
|
|
1199
1199
|
children: "No effects yet — add one below."
|
|
1200
|
-
}), /* @__PURE__ */ Q(
|
|
1200
|
+
}), /* @__PURE__ */ Q(Ur, {
|
|
1201
1201
|
...n,
|
|
1202
1202
|
from: 0
|
|
1203
1203
|
})]
|
|
1204
1204
|
}),
|
|
1205
|
-
/* @__PURE__ */ Q(
|
|
1205
|
+
/* @__PURE__ */ Q(An, {}),
|
|
1206
1206
|
S.length < 8 && /* @__PURE__ */ Q(q, {
|
|
1207
1207
|
label: V.label,
|
|
1208
1208
|
divided: !0,
|
|
1209
|
-
children: /* @__PURE__ */ Q(
|
|
1209
|
+
children: /* @__PURE__ */ Q(jn, {
|
|
1210
1210
|
variant: "subtle",
|
|
1211
1211
|
size: s,
|
|
1212
1212
|
className: "w-full",
|
|
@@ -1224,7 +1224,7 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1224
1224
|
})]
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
1227
|
-
if (!E) return /* @__PURE__ */ Q(
|
|
1227
|
+
if (!E) return /* @__PURE__ */ Q(Rr, {
|
|
1228
1228
|
chips: M,
|
|
1229
1229
|
active: null,
|
|
1230
1230
|
onPick: N,
|
|
@@ -1234,12 +1234,12 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1234
1234
|
tone: "sunken",
|
|
1235
1235
|
value: c,
|
|
1236
1236
|
onChange: l,
|
|
1237
|
-
options:
|
|
1237
|
+
options: Nr,
|
|
1238
1238
|
size: s,
|
|
1239
1239
|
className: r(s)
|
|
1240
1240
|
}),
|
|
1241
1241
|
children: /* @__PURE__ */ Q(A, {
|
|
1242
|
-
schema:
|
|
1242
|
+
schema: en,
|
|
1243
1243
|
layer: e,
|
|
1244
1244
|
setProp: b.setProp,
|
|
1245
1245
|
palette: y,
|
|
@@ -1268,7 +1268,7 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1268
1268
|
renderAnimate: ie,
|
|
1269
1269
|
inline: !0
|
|
1270
1270
|
};
|
|
1271
|
-
return /* @__PURE__ */ $(
|
|
1271
|
+
return /* @__PURE__ */ $(Rr, {
|
|
1272
1272
|
chips: M,
|
|
1273
1273
|
active: E.id,
|
|
1274
1274
|
onPick: N,
|
|
@@ -1281,11 +1281,11 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1281
1281
|
tone: "sunken",
|
|
1282
1282
|
value: c,
|
|
1283
1283
|
onChange: l,
|
|
1284
|
-
options:
|
|
1284
|
+
options: Nr,
|
|
1285
1285
|
size: s,
|
|
1286
1286
|
className: r(s)
|
|
1287
1287
|
}),
|
|
1288
|
-
children: [c === "effect" && /* @__PURE__ */ $(
|
|
1288
|
+
children: [c === "effect" && /* @__PURE__ */ $(Un, { children: [
|
|
1289
1289
|
W.length > 0 && /* @__PURE__ */ Q(A, {
|
|
1290
1290
|
schema: W,
|
|
1291
1291
|
...pe
|
|
@@ -1301,7 +1301,7 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1301
1301
|
view: F,
|
|
1302
1302
|
tab: "effect",
|
|
1303
1303
|
onPatch: z,
|
|
1304
|
-
levels: /* @__PURE__ */ $(
|
|
1304
|
+
levels: /* @__PURE__ */ $(Un, { children: [
|
|
1305
1305
|
[
|
|
1306
1306
|
["type", "Type"],
|
|
1307
1307
|
["category", "Category"],
|
|
@@ -1340,12 +1340,12 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1340
1340
|
] })
|
|
1341
1341
|
})]
|
|
1342
1342
|
}),
|
|
1343
|
-
/* @__PURE__ */ Q(
|
|
1344
|
-
ue < H.length && /* @__PURE__ */ $(
|
|
1343
|
+
/* @__PURE__ */ Q(An, {}),
|
|
1344
|
+
ue < H.length && /* @__PURE__ */ $(Un, { children: [/* @__PURE__ */ Q(A, {
|
|
1345
1345
|
schema: H.slice(ue),
|
|
1346
1346
|
...pe
|
|
1347
|
-
}), /* @__PURE__ */ Q(
|
|
1348
|
-
/* @__PURE__ */ Q(
|
|
1347
|
+
}), /* @__PURE__ */ Q(An, {})] }),
|
|
1348
|
+
/* @__PURE__ */ Q(Wr, {
|
|
1349
1349
|
chain: S,
|
|
1350
1350
|
from: w + 1,
|
|
1351
1351
|
layer: e,
|
|
@@ -1357,8 +1357,8 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1357
1357
|
palette: y,
|
|
1358
1358
|
showMod: t
|
|
1359
1359
|
})
|
|
1360
|
-
] }), c === "anim" && /* @__PURE__ */ $(
|
|
1361
|
-
/* @__PURE__ */ Q(
|
|
1360
|
+
] }), c === "anim" && /* @__PURE__ */ $(Un, { children: [
|
|
1361
|
+
/* @__PURE__ */ Q(Er, {
|
|
1362
1362
|
schema: E.def.params,
|
|
1363
1363
|
layer: F,
|
|
1364
1364
|
setProp: R,
|
|
@@ -1372,7 +1372,7 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1372
1372
|
E.def.orbit && /* @__PURE__ */ Q(q, {
|
|
1373
1373
|
label: "Interaction",
|
|
1374
1374
|
divided: !0,
|
|
1375
|
-
children: /* @__PURE__ */ Q(
|
|
1375
|
+
children: /* @__PURE__ */ Q(Nn, {
|
|
1376
1376
|
label: "ORBIT (C)",
|
|
1377
1377
|
align: "fill",
|
|
1378
1378
|
labelWidth: n,
|
|
@@ -1409,12 +1409,12 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1409
1409
|
onChange: (e) => R("sweeps", e),
|
|
1410
1410
|
inline: !0
|
|
1411
1411
|
}),
|
|
1412
|
-
/* @__PURE__ */ Q(
|
|
1412
|
+
/* @__PURE__ */ Q(Cr, {
|
|
1413
1413
|
schema: E.def.params,
|
|
1414
1414
|
layer: F,
|
|
1415
1415
|
setProp: R
|
|
1416
1416
|
}),
|
|
1417
|
-
/* @__PURE__ */ Q(
|
|
1417
|
+
/* @__PURE__ */ Q(Hr, {
|
|
1418
1418
|
chain: S,
|
|
1419
1419
|
layer: e,
|
|
1420
1420
|
hostView: F,
|
|
@@ -1427,13 +1427,13 @@ function Rr({ layer: e, showMod: t }) {
|
|
|
1427
1427
|
] })]
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
|
-
var
|
|
1431
|
-
function
|
|
1430
|
+
var Br = L.filter((e) => !e.kind && !e.first);
|
|
1431
|
+
function Vr({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
1432
1432
|
let { addFilter: a, removeFilter: o, toggleFilter: s } = i(), c = h(e), l = c.map(({ def: e, ...t }) => t);
|
|
1433
|
-
return /* @__PURE__ */ Q(
|
|
1433
|
+
return /* @__PURE__ */ Q(Wr, {
|
|
1434
1434
|
chain: c,
|
|
1435
1435
|
from: 0,
|
|
1436
|
-
filters:
|
|
1436
|
+
filters: Br,
|
|
1437
1437
|
layer: e,
|
|
1438
1438
|
hostView: e,
|
|
1439
1439
|
addFilter: a,
|
|
@@ -1450,7 +1450,7 @@ function Br({ layer: e, edit: t, palette: n, showMod: r }) {
|
|
|
1450
1450
|
showMod: r
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1453
|
+
function Hr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, setStagePropAt: o, palette: s, showMod: c }) {
|
|
1454
1454
|
let l = a(), u = e.findIndex((e) => e.id === "fx-media"), d = u < 0 ? null : e[u], f = d ? {
|
|
1455
1455
|
...n,
|
|
1456
1456
|
...d.params,
|
|
@@ -1459,7 +1459,7 @@ function Vr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1459
1459
|
return /* @__PURE__ */ Q(q, {
|
|
1460
1460
|
label: "Media",
|
|
1461
1461
|
divided: !0,
|
|
1462
|
-
children: d?.def ? /* @__PURE__ */ $(
|
|
1462
|
+
children: d?.def ? /* @__PURE__ */ $(Un, { children: [/* @__PURE__ */ Q(A, {
|
|
1463
1463
|
schema: d.def.params,
|
|
1464
1464
|
layer: f,
|
|
1465
1465
|
setProp: p,
|
|
@@ -1489,7 +1489,7 @@ function Vr({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: i, se
|
|
|
1489
1489
|
})
|
|
1490
1490
|
});
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function Ur({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, removeFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
|
|
1493
1493
|
let u = a();
|
|
1494
1494
|
return e.slice(t).map((e, a) => {
|
|
1495
1495
|
let d = a + t, f = e.enabled !== !1, p = {
|
|
@@ -1501,12 +1501,12 @@ function Hr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1501
1501
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
1502
1502
|
children: [/* @__PURE__ */ $("div", {
|
|
1503
1503
|
className: "flex items-center gap-2",
|
|
1504
|
-
children: [/* @__PURE__ */ Q(
|
|
1504
|
+
children: [/* @__PURE__ */ Q(In, {
|
|
1505
1505
|
size: u,
|
|
1506
1506
|
checked: f,
|
|
1507
1507
|
onChange: () => i(n.id, d),
|
|
1508
1508
|
label: e.def?.label ?? e.id
|
|
1509
|
-
}), /* @__PURE__ */ Q(
|
|
1509
|
+
}), /* @__PURE__ */ Q(Ln, {
|
|
1510
1510
|
asChild: !0,
|
|
1511
1511
|
label: "Delete effect",
|
|
1512
1512
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -1534,7 +1534,7 @@ function Hr({ chain: e, from: t = 0, layer: n, hostView: r, toggleFilter: i, rem
|
|
|
1534
1534
|
}, e.key ?? d);
|
|
1535
1535
|
});
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1537
|
+
function Wr({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, addFilter: o, removeFilter: s, toggleFilter: c, setStagePropAt: l, palette: u, showMod: d }) {
|
|
1538
1538
|
let f = a(), p = [{
|
|
1539
1539
|
value: "",
|
|
1540
1540
|
label: "Add FX…"
|
|
@@ -1545,7 +1545,7 @@ function Ur({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1545
1545
|
return /* @__PURE__ */ $(q, {
|
|
1546
1546
|
label: "Post-Processing",
|
|
1547
1547
|
divided: !0,
|
|
1548
|
-
children: [/* @__PURE__ */ Q(
|
|
1548
|
+
children: [/* @__PURE__ */ Q(Ur, {
|
|
1549
1549
|
chain: e,
|
|
1550
1550
|
from: t,
|
|
1551
1551
|
layer: r,
|
|
@@ -1555,7 +1555,7 @@ function Ur({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1555
1555
|
setStagePropAt: l,
|
|
1556
1556
|
palette: u,
|
|
1557
1557
|
showMod: d
|
|
1558
|
-
}), e.length < 8 && /* @__PURE__ */ Q(
|
|
1558
|
+
}), e.length < 8 && /* @__PURE__ */ Q(jn, {
|
|
1559
1559
|
variant: "subtle",
|
|
1560
1560
|
size: f,
|
|
1561
1561
|
className: "w-full",
|
|
@@ -1567,7 +1567,7 @@ function Ur({ chain: e, from: t = 1, filters: n = null, layer: r, hostView: i, a
|
|
|
1567
1567
|
})]
|
|
1568
1568
|
});
|
|
1569
1569
|
}
|
|
1570
|
-
function
|
|
1570
|
+
function Gr({ layer: e, showMod: t, tree: n }) {
|
|
1571
1571
|
let o = a(), [s, c] = Z("generate"), { updateLayer: l, palette: u } = i(), { setOnly: f } = W(), p = te(e.id, { history: "coalesce" }), m = N(e.loopGroup).find((t) => t.id === e.presetId), h = P(e.loopGroup), g = (n ?? we).find((t) => t.groups.includes(e.loopGroup)), _ = g?.labels?.[e.loopGroup] ?? h?.label ?? "", v = g && g.label !== _ ? `${g.label} / ${_}` : _, y = e.loopGroup === "paratype" && m?.sub === "Glyphs" ? ne("paratype", "Glyphs") : null, b = y ? y.map((e) => ({
|
|
1572
1572
|
value: e.id,
|
|
1573
1573
|
label: e.label
|
|
@@ -1577,10 +1577,10 @@ function Wr({ layer: e, showMod: t, tree: n }) {
|
|
|
1577
1577
|
}, C = () => {
|
|
1578
1578
|
m && f(e.type, H(m, e.loopGroup));
|
|
1579
1579
|
};
|
|
1580
|
-
return
|
|
1580
|
+
return Mr(C, () => {
|
|
1581
1581
|
let t = U(e.loopId)?.params ?? [];
|
|
1582
1582
|
l(e.id, d(e, x(t, e), T(), { withFilters: !0 }));
|
|
1583
|
-
}), /* @__PURE__ */ $(
|
|
1583
|
+
}), /* @__PURE__ */ $(Rr, {
|
|
1584
1584
|
title: v,
|
|
1585
1585
|
chips: b,
|
|
1586
1586
|
active: e.presetId,
|
|
@@ -1592,12 +1592,12 @@ function Wr({ layer: e, showMod: t, tree: n }) {
|
|
|
1592
1592
|
tone: "sunken",
|
|
1593
1593
|
value: s,
|
|
1594
1594
|
onChange: c,
|
|
1595
|
-
options: o === "sm" ?
|
|
1595
|
+
options: o === "sm" ? Pr : Fr,
|
|
1596
1596
|
size: o,
|
|
1597
1597
|
className: r(o)
|
|
1598
1598
|
}),
|
|
1599
1599
|
children: [
|
|
1600
|
-
s === "anim" && /* @__PURE__ */ Q(
|
|
1600
|
+
s === "anim" && /* @__PURE__ */ Q(Er, {
|
|
1601
1601
|
schema: U(e.loopId)?.params ?? [],
|
|
1602
1602
|
layer: e,
|
|
1603
1603
|
setProp: p.setProp,
|
|
@@ -1620,17 +1620,17 @@ function Wr({ layer: e, showMod: t, tree: n }) {
|
|
|
1620
1620
|
inline: !0,
|
|
1621
1621
|
onReset: C
|
|
1622
1622
|
}),
|
|
1623
|
-
s === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(
|
|
1623
|
+
s === "generate" && e.loopId === "scene3d" && e.primitive === "mesh" && /* @__PURE__ */ Q(jr, {
|
|
1624
1624
|
layer: e,
|
|
1625
1625
|
setProp: p.setProp
|
|
1626
1626
|
}),
|
|
1627
|
-
s === "style" && /* @__PURE__ */ Q(
|
|
1627
|
+
s === "style" && /* @__PURE__ */ Q(Vr, {
|
|
1628
1628
|
layer: e,
|
|
1629
1629
|
edit: p,
|
|
1630
1630
|
palette: u,
|
|
1631
1631
|
showMod: t
|
|
1632
1632
|
}),
|
|
1633
|
-
s === "anim" && /* @__PURE__ */ Q(
|
|
1633
|
+
s === "anim" && /* @__PURE__ */ Q(Cr, {
|
|
1634
1634
|
schema: U(e.loopId)?.params ?? [],
|
|
1635
1635
|
layer: e,
|
|
1636
1636
|
setProp: p.setProp
|
|
@@ -1638,9 +1638,9 @@ function Wr({ layer: e, showMod: t, tree: n }) {
|
|
|
1638
1638
|
]
|
|
1639
1639
|
});
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function Kr({ layer: e, showMod: t }) {
|
|
1642
1642
|
let n = a(), [o, s] = Z("generate"), { updateLayer: c, palette: l } = i(), { setOnly: u } = W(), d = te(e.id, { history: "coalesce" }), f = lt.find((t) => t.id === e.presetId), p = ct.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
|
|
1643
|
-
return
|
|
1643
|
+
return Mr(() => {
|
|
1644
1644
|
f && u("kinetic", {
|
|
1645
1645
|
presetId: f.id,
|
|
1646
1646
|
presetLabel: f.label,
|
|
@@ -1654,13 +1654,13 @@ function Gr({ layer: e, showMod: t }) {
|
|
|
1654
1654
|
comp: r,
|
|
1655
1655
|
_rollSeed: t
|
|
1656
1656
|
});
|
|
1657
|
-
}), /* @__PURE__ */ Q(
|
|
1657
|
+
}), /* @__PURE__ */ Q(Rr, {
|
|
1658
1658
|
title: p,
|
|
1659
1659
|
tabStrip: /* @__PURE__ */ Q(J, {
|
|
1660
1660
|
tone: "sunken",
|
|
1661
1661
|
value: o,
|
|
1662
1662
|
onChange: s,
|
|
1663
|
-
options: n === "sm" ?
|
|
1663
|
+
options: n === "sm" ? Pr : Fr,
|
|
1664
1664
|
size: n,
|
|
1665
1665
|
className: r(n)
|
|
1666
1666
|
}),
|
|
@@ -1679,37 +1679,37 @@ function Gr({ layer: e, showMod: t }) {
|
|
|
1679
1679
|
})
|
|
1680
1680
|
});
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function qr() {
|
|
1683
1683
|
let { layer: e } = W(), t = nt(), n = a(), r = it();
|
|
1684
1684
|
return Y(() => {
|
|
1685
1685
|
let e = (e) => {
|
|
1686
|
-
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey ||
|
|
1686
|
+
e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey || kn(e) || rt();
|
|
1687
1687
|
};
|
|
1688
1688
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1689
|
-
}, []), t.active ? /* @__PURE__ */ Q(
|
|
1689
|
+
}, []), t.active ? /* @__PURE__ */ Q(Rr, {
|
|
1690
1690
|
title: "Morph",
|
|
1691
|
-
children: /* @__PURE__ */ Q(
|
|
1691
|
+
children: /* @__PURE__ */ Q(yr, {
|
|
1692
1692
|
layer: e,
|
|
1693
|
-
editTabs: n === "sm" ?
|
|
1693
|
+
editTabs: n === "sm" ? Pr : Fr
|
|
1694
1694
|
})
|
|
1695
|
-
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(
|
|
1695
|
+
}) : e ? e.type === "photo" ? /* @__PURE__ */ Q(zr, {
|
|
1696
1696
|
layer: e,
|
|
1697
1697
|
showMod: r
|
|
1698
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(
|
|
1698
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Q(Gr, {
|
|
1699
1699
|
layer: e,
|
|
1700
1700
|
showMod: r
|
|
1701
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(
|
|
1701
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Q(Gr, {
|
|
1702
1702
|
layer: e,
|
|
1703
1703
|
showMod: r,
|
|
1704
1704
|
tree: fe
|
|
1705
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(
|
|
1705
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Q(Kr, {
|
|
1706
1706
|
layer: e,
|
|
1707
1707
|
showMod: r
|
|
1708
1708
|
}, e.id) : /* @__PURE__ */ Q(j, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Q(j, { children: "Pick an effect or generator from the nav." });
|
|
1709
1709
|
}
|
|
1710
1710
|
//#endregion
|
|
1711
1711
|
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1712
|
-
function
|
|
1712
|
+
function Jr(e) {
|
|
1713
1713
|
Y(() => {
|
|
1714
1714
|
let t = (t) => {
|
|
1715
1715
|
t.key === "Escape" && e?.();
|
|
@@ -1722,8 +1722,8 @@ function qr(e) {
|
|
|
1722
1722
|
};
|
|
1723
1723
|
}, []);
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1726
|
-
return
|
|
1725
|
+
function Yr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1726
|
+
return Jr(r ?? n), /* @__PURE__ */ Q("div", {
|
|
1727
1727
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
1728
1728
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1729
1729
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1737,11 +1737,11 @@ function Jr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1737
1737
|
/* @__PURE__ */ Q("div", {
|
|
1738
1738
|
className: "flex flex-col gap-2",
|
|
1739
1739
|
children: we.map((t) => {
|
|
1740
|
-
let n =
|
|
1740
|
+
let n = ur[`gen:${t.label}`] ?? "square";
|
|
1741
1741
|
return /* @__PURE__ */ Q(K, {
|
|
1742
1742
|
tone: "primary",
|
|
1743
1743
|
size: "lg",
|
|
1744
|
-
className:
|
|
1744
|
+
className: Vt,
|
|
1745
1745
|
iconLeft: n,
|
|
1746
1746
|
iconRight: n,
|
|
1747
1747
|
onClick: () => e(t),
|
|
@@ -1775,11 +1775,11 @@ function Jr({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
//#endregion
|
|
1777
1777
|
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
1778
|
-
var
|
|
1779
|
-
function
|
|
1778
|
+
var Xr = (e) => /\.svg$/i.test(e.key) || /svg/i.test(e.contentType || "");
|
|
1779
|
+
function Zr(e) {
|
|
1780
1780
|
let { patch: t } = te(e.id), n = X(null), [r, i] = Z(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
1781
1781
|
return {
|
|
1782
|
-
nodes: /* @__PURE__ */ $(
|
|
1782
|
+
nodes: /* @__PURE__ */ $(Un, { children: [/* @__PURE__ */ Q("input", {
|
|
1783
1783
|
ref: n,
|
|
1784
1784
|
type: "file",
|
|
1785
1785
|
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
@@ -1799,24 +1799,24 @@ function Xr(e) {
|
|
|
1799
1799
|
});
|
|
1800
1800
|
return;
|
|
1801
1801
|
}
|
|
1802
|
-
|
|
1802
|
+
Ft(r).then((e) => t({
|
|
1803
1803
|
src: e,
|
|
1804
1804
|
srcType: "image"
|
|
1805
1805
|
}));
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
|
-
}), /* @__PURE__ */ Q(
|
|
1808
|
+
}), /* @__PURE__ */ Q(Ut, {
|
|
1809
1809
|
open: r,
|
|
1810
|
-
accept: a ?
|
|
1810
|
+
accept: a ? Xr : ["image", "video"],
|
|
1811
1811
|
onClose: () => i(!1),
|
|
1812
1812
|
onSelect: (e, { contentType: n } = {}) => {
|
|
1813
1813
|
if (a) {
|
|
1814
|
-
t({ svgSrc:
|
|
1814
|
+
t({ svgSrc: On(e) });
|
|
1815
1815
|
return;
|
|
1816
1816
|
}
|
|
1817
1817
|
t({
|
|
1818
|
-
src:
|
|
1819
|
-
srcType:
|
|
1818
|
+
src: On(e),
|
|
1819
|
+
srcType: Tn(n) ? "video" : "image"
|
|
1820
1820
|
});
|
|
1821
1821
|
}
|
|
1822
1822
|
})] }),
|
|
@@ -1824,7 +1824,7 @@ function Xr(e) {
|
|
|
1824
1824
|
openLibrary: () => i(!0),
|
|
1825
1825
|
openUpload: () => n.current?.click(),
|
|
1826
1826
|
openCamera: () => {
|
|
1827
|
-
|
|
1827
|
+
En(e.id).then(() => t({
|
|
1828
1828
|
src: null,
|
|
1829
1829
|
srcType: "webcam"
|
|
1830
1830
|
})).catch(() => {});
|
|
@@ -1845,15 +1845,15 @@ function Xr(e) {
|
|
|
1845
1845
|
label: "Camera"
|
|
1846
1846
|
}
|
|
1847
1847
|
].slice(0, 2);
|
|
1848
|
-
function
|
|
1849
|
-
let t =
|
|
1848
|
+
function Qr({ layer: e }) {
|
|
1849
|
+
let t = Zr(e);
|
|
1850
1850
|
return /* @__PURE__ */ $("div", {
|
|
1851
1851
|
className: "flex flex-col gap-2",
|
|
1852
1852
|
children: [
|
|
1853
1853
|
/* @__PURE__ */ Q(K, {
|
|
1854
1854
|
tone: "primary",
|
|
1855
1855
|
size: "lg",
|
|
1856
|
-
className:
|
|
1856
|
+
className: Vt,
|
|
1857
1857
|
iconLeft: "image",
|
|
1858
1858
|
iconRight: "image",
|
|
1859
1859
|
onClick: t.openLibrary,
|
|
@@ -1862,7 +1862,7 @@ function Zr({ layer: e }) {
|
|
|
1862
1862
|
/* @__PURE__ */ Q(K, {
|
|
1863
1863
|
tone: "primary",
|
|
1864
1864
|
size: "lg",
|
|
1865
|
-
className:
|
|
1865
|
+
className: Vt,
|
|
1866
1866
|
iconLeft: "upload",
|
|
1867
1867
|
iconRight: "upload",
|
|
1868
1868
|
onClick: t.openUpload,
|
|
@@ -1881,8 +1881,8 @@ function Zr({ layer: e }) {
|
|
|
1881
1881
|
]
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1885
|
-
return
|
|
1884
|
+
function $r({ layer: e, title: t, onBack: n }) {
|
|
1885
|
+
return Jr(n), /* @__PURE__ */ Q("div", {
|
|
1886
1886
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
1887
1887
|
style: { zIndex: "calc(var(--kol-z-sticky) - 2)" },
|
|
1888
1888
|
children: /* @__PURE__ */ $("div", {
|
|
@@ -1899,11 +1899,11 @@ function Qr({ layer: e, title: t, onBack: n }) {
|
|
|
1899
1899
|
children: "Pick the media it works on."
|
|
1900
1900
|
})]
|
|
1901
1901
|
}),
|
|
1902
|
-
/* @__PURE__ */ Q(
|
|
1902
|
+
/* @__PURE__ */ Q(Qr, { layer: e }),
|
|
1903
1903
|
/* @__PURE__ */ Q(K, {
|
|
1904
1904
|
tone: "grey",
|
|
1905
1905
|
size: "lg",
|
|
1906
|
-
className:
|
|
1906
|
+
className: Vt,
|
|
1907
1907
|
iconLeft: "arrow-left",
|
|
1908
1908
|
iconRight: "arrow-left",
|
|
1909
1909
|
onClick: n,
|
|
@@ -1915,13 +1915,13 @@ function Qr({ layer: e, title: t, onBack: n }) {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
//#endregion
|
|
1917
1917
|
//#region src/editor/components/PanelHeader.jsx
|
|
1918
|
-
function
|
|
1918
|
+
function ei({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
1919
1919
|
return /* @__PURE__ */ $("div", {
|
|
1920
1920
|
className: `flex w-full shrink-0 items-center ${r}`,
|
|
1921
1921
|
children: [/* @__PURE__ */ $("button", {
|
|
1922
1922
|
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
1923
1923
|
onClick: t,
|
|
1924
|
-
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(
|
|
1924
|
+
children: [/* @__PURE__ */ Q("span", { children: e }), /* @__PURE__ */ Q(Wn, {
|
|
1925
1925
|
name: "chevron-down",
|
|
1926
1926
|
size: 16,
|
|
1927
1927
|
className: "text-oq-48"
|
|
@@ -1929,7 +1929,7 @@ function $r({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
|
1929
1929
|
}), n]
|
|
1930
1930
|
});
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function ti({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
1933
1933
|
return /* @__PURE__ */ $("div", {
|
|
1934
1934
|
className: "pointer-events-none fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-[var(--fxr-rail,0px)] right-0 z-10 flex flex-nowrap items-center gap-2 px-3 [&>*]:pointer-events-auto",
|
|
1935
1935
|
children: [/* @__PURE__ */ Q(K, {
|
|
@@ -1942,7 +1942,7 @@ function ei({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1942
1942
|
children: [/* @__PURE__ */ Q("span", {
|
|
1943
1943
|
className: "truncate",
|
|
1944
1944
|
children: e
|
|
1945
|
-
}), /* @__PURE__ */ Q(
|
|
1945
|
+
}), /* @__PURE__ */ Q(Wn, {
|
|
1946
1946
|
name: "chevron-down",
|
|
1947
1947
|
size: 16,
|
|
1948
1948
|
className: "rotate-180 shrink-0"
|
|
@@ -1951,13 +1951,13 @@ function ei({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
|
|
|
1951
1951
|
}), i]
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
|
-
var
|
|
1954
|
+
var ni = {
|
|
1955
1955
|
half: "50dvh",
|
|
1956
1956
|
tall: "85dvh"
|
|
1957
|
-
},
|
|
1958
|
-
function
|
|
1957
|
+
}, ri = 4;
|
|
1958
|
+
function ii({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
1959
1959
|
let a = X(null);
|
|
1960
|
-
|
|
1960
|
+
Rn(a, { axis: "x" });
|
|
1961
1961
|
let o = X({
|
|
1962
1962
|
y: null,
|
|
1963
1963
|
h0: 0,
|
|
@@ -1977,7 +1977,7 @@ function ri({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1977
1977
|
onPointerMove: (e) => {
|
|
1978
1978
|
if (o.y === null) return;
|
|
1979
1979
|
let t = e.clientY - o.y;
|
|
1980
|
-
Math.abs(t) >
|
|
1980
|
+
Math.abs(t) > ri && (o.moved = !0), o.moved && r && (o.last = o.h0 - t, r(o.last));
|
|
1981
1981
|
},
|
|
1982
1982
|
onPointerUp: (e) => {
|
|
1983
1983
|
if (o.y === null) return;
|
|
@@ -1999,10 +1999,10 @@ function ri({ tall: e, onToggle: t, onDrag: n, onResize: r, onResizeEnd: i }) {
|
|
|
1999
1999
|
}
|
|
2000
2000
|
//#endregion
|
|
2001
2001
|
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
2002
|
-
var
|
|
2003
|
-
function
|
|
2004
|
-
let { items: a, dispatch: o } =
|
|
2005
|
-
|
|
2002
|
+
var ai = new Set(["#rail/sec:effects"]);
|
|
2003
|
+
function oi({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0, onNeedMedia: i }) {
|
|
2004
|
+
let { items: a, dispatch: o } = Cn(), [s, c] = Z(n);
|
|
2005
|
+
Jr(t);
|
|
2006
2006
|
let l = a.find((e) => e.path === s) ?? null, u = l ? l.sub : a;
|
|
2007
2007
|
return /* @__PURE__ */ Q("div", {
|
|
2008
2008
|
className: "fixed bottom-0 top-12 md:top-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
@@ -2021,11 +2021,11 @@ function ai({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2021
2021
|
children: [u.map((t) => /* @__PURE__ */ Q(K, {
|
|
2022
2022
|
tone: "primary",
|
|
2023
2023
|
size: "lg",
|
|
2024
|
-
className:
|
|
2024
|
+
className: Vt,
|
|
2025
2025
|
iconLeft: t.icon,
|
|
2026
2026
|
iconRight: t.icon,
|
|
2027
2027
|
onClick: () => {
|
|
2028
|
-
if (!l &&
|
|
2028
|
+
if (!l && ai.has(t.path) && !r && i) {
|
|
2029
2029
|
i(t.path);
|
|
2030
2030
|
return;
|
|
2031
2031
|
}
|
|
@@ -2051,7 +2051,7 @@ function ai({ onPicked: e, onClose: t, initialOpen: n = null, hasMedia: r = !0,
|
|
|
2051
2051
|
}
|
|
2052
2052
|
//#endregion
|
|
2053
2053
|
//#region src/editor/labs/sheetLabels.js
|
|
2054
|
-
function
|
|
2054
|
+
function si(e) {
|
|
2055
2055
|
if (Ze().active) return {
|
|
2056
2056
|
title: "Morph",
|
|
2057
2057
|
pill: "Morph"
|
|
@@ -2079,14 +2079,14 @@ function oi(e) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
//#endregion
|
|
2081
2081
|
//#region src/editor/labs/LabsView.jsx
|
|
2082
|
-
var
|
|
2082
|
+
var ci = .85, li = .3, ui = 2.5, di = {
|
|
2083
2083
|
0: 1,
|
|
2084
2084
|
1: .5,
|
|
2085
2085
|
2: 1,
|
|
2086
2086
|
3: 1.5,
|
|
2087
2087
|
4: 2
|
|
2088
|
-
},
|
|
2089
|
-
function
|
|
2088
|
+
}, fi = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
2089
|
+
function pi() {
|
|
2090
2090
|
let { layer: e } = W(), { removeLayer: t, layers: n, updateLayer: r, beginTransaction: a, commitTransaction: o, select: s } = i(), [c, l] = Z(null);
|
|
2091
2091
|
Y(() => {
|
|
2092
2092
|
let e = (e) => {
|
|
@@ -2106,7 +2106,7 @@ function fi() {
|
|
|
2106
2106
|
c,
|
|
2107
2107
|
s
|
|
2108
2108
|
]);
|
|
2109
|
-
let d = c && n.find((e) => e.id === c.id && e.type === "kinetic"), f = e?.type === "photo" && !e.src && e.srcType !== "webcam", [p, m] = Z(1), [h, g] = Z(!1), _ =
|
|
2109
|
+
let d = c && n.find((e) => e.id === c.id && e.type === "kinetic"), f = e?.type === "photo" && !e.src && e.srcType !== "webcam", [p, m] = Z(1), [h, g] = Z(!1), _ = St(h), v = X(null), y = (e) => Math.min(ui, Math.max(li, e)), b = (e) => m((t) => y(t * (e > 0 ? 1.25 : .8))), { tool: x } = gn(), S = x === "orbit", C = X(S);
|
|
2110
2110
|
C.current = S, Y(() => {
|
|
2111
2111
|
let e = v.current;
|
|
2112
2112
|
if (!e) return;
|
|
@@ -2116,12 +2116,12 @@ function fi() {
|
|
|
2116
2116
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2117
2117
|
}, []), Y(() => {
|
|
2118
2118
|
let e = (e) => {
|
|
2119
|
-
if (!(e.metaKey || e.ctrlKey || e.altKey) && !
|
|
2119
|
+
if (!(e.metaKey || e.ctrlKey || e.altKey) && !kn(e)) {
|
|
2120
2120
|
if (e.key === "f" || e.key === "F") {
|
|
2121
2121
|
g((e) => !e);
|
|
2122
2122
|
return;
|
|
2123
2123
|
}
|
|
2124
|
-
if (!(u().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" ||
|
|
2124
|
+
if (!(u().zoomLock && (e.key === "-" || e.key === "_" || e.key === "+" || e.key === "=" || di[e.key] !== void 0))) {
|
|
2125
2125
|
if (e.key === "-" || e.key === "_") {
|
|
2126
2126
|
b(-1);
|
|
2127
2127
|
return;
|
|
@@ -2130,7 +2130,7 @@ function fi() {
|
|
|
2130
2130
|
b(1);
|
|
2131
2131
|
return;
|
|
2132
2132
|
}
|
|
2133
|
-
|
|
2133
|
+
di[e.key] !== void 0 && m(di[e.key]);
|
|
2134
2134
|
}
|
|
2135
2135
|
}
|
|
2136
2136
|
};
|
|
@@ -2210,11 +2210,11 @@ function fi() {
|
|
|
2210
2210
|
/* @__PURE__ */ Q("div", {
|
|
2211
2211
|
style: {
|
|
2212
2212
|
flex: "none",
|
|
2213
|
-
width: `${p *
|
|
2214
|
-
height: `${p *
|
|
2213
|
+
width: `${p * ci * 100}%`,
|
|
2214
|
+
height: `${p * ci * 100}%`,
|
|
2215
2215
|
transform: `translate(${w.x}px, ${w.y}px)`
|
|
2216
2216
|
},
|
|
2217
|
-
children: /* @__PURE__ */ Q(
|
|
2217
|
+
children: /* @__PURE__ */ Q(Yt, { overlay: d ? (e) => /* @__PURE__ */ Q(yt, {
|
|
2218
2218
|
layer: d,
|
|
2219
2219
|
initialIndex: c.index,
|
|
2220
2220
|
toVirtual: e,
|
|
@@ -2224,17 +2224,17 @@ function fi() {
|
|
|
2224
2224
|
onExit: () => l(null)
|
|
2225
2225
|
}) : void 0 })
|
|
2226
2226
|
}),
|
|
2227
|
-
f && /* @__PURE__ */ Q(
|
|
2227
|
+
f && /* @__PURE__ */ Q($r, {
|
|
2228
2228
|
layer: e,
|
|
2229
|
-
title:
|
|
2229
|
+
title: si(e).title,
|
|
2230
2230
|
onBack: () => t(e.id)
|
|
2231
2231
|
}),
|
|
2232
2232
|
h && /* @__PURE__ */ Q("div", {
|
|
2233
2233
|
className: "absolute bottom-3 right-3 z-[var(--kol-z-base)] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
2234
|
-
children: /* @__PURE__ */ Q(
|
|
2234
|
+
children: /* @__PURE__ */ Q(Ln, {
|
|
2235
2235
|
label: "Framerate — press F to hide",
|
|
2236
2236
|
children: /* @__PURE__ */ $("span", {
|
|
2237
|
-
className:
|
|
2237
|
+
className: fi,
|
|
2238
2238
|
children: [_, " fps"]
|
|
2239
2239
|
})
|
|
2240
2240
|
})
|
|
@@ -2242,8 +2242,8 @@ function fi() {
|
|
|
2242
2242
|
]
|
|
2243
2243
|
});
|
|
2244
2244
|
}
|
|
2245
|
-
function
|
|
2246
|
-
let e = X(null), { grabProps: t } =
|
|
2245
|
+
function mi() {
|
|
2246
|
+
let e = X(null), { grabProps: t } = Gn(e, {
|
|
2247
2247
|
token: "kol-rail",
|
|
2248
2248
|
side: "right"
|
|
2249
2249
|
});
|
|
@@ -2289,14 +2289,14 @@ function pi() {
|
|
|
2289
2289
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2290
2290
|
children: [/* @__PURE__ */ Q("div", { ...t }), /* @__PURE__ */ Q("div", {
|
|
2291
2291
|
className: "kol-compose-inspector-body",
|
|
2292
|
-
children: /* @__PURE__ */ Q(
|
|
2292
|
+
children: /* @__PURE__ */ Q(qr, {})
|
|
2293
2293
|
})]
|
|
2294
2294
|
});
|
|
2295
2295
|
}
|
|
2296
|
-
var
|
|
2297
|
-
function
|
|
2298
|
-
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } =
|
|
2299
|
-
return /* @__PURE__ */ Q(
|
|
2296
|
+
var hi = Bn(null);
|
|
2297
|
+
function gi() {
|
|
2298
|
+
let { tall: e, setTall: t, collapseParams: n, setSheetPx: r } = Vn(hi);
|
|
2299
|
+
return /* @__PURE__ */ Q(ii, {
|
|
2300
2300
|
tall: e,
|
|
2301
2301
|
onToggle: () => {
|
|
2302
2302
|
r(null), t((e) => !e);
|
|
@@ -2307,20 +2307,20 @@ function hi() {
|
|
|
2307
2307
|
}
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
|
-
var
|
|
2310
|
+
var _i = [
|
|
2311
2311
|
2,
|
|
2312
2312
|
4,
|
|
2313
2313
|
8,
|
|
2314
2314
|
12,
|
|
2315
2315
|
16
|
|
2316
2316
|
];
|
|
2317
|
-
function
|
|
2317
|
+
function vi({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, railHeight: i }) {
|
|
2318
2318
|
let { playing: a, loopSeconds: o, play: s, pause: c, stop: l, rewind: u, setLoopSeconds: d } = S(), [f, p] = Z(!0), m = [
|
|
2319
2319
|
{
|
|
2320
2320
|
icon: "home-01",
|
|
2321
2321
|
path: "#home",
|
|
2322
2322
|
label: "Home",
|
|
2323
|
-
onPress: () =>
|
|
2323
|
+
onPress: () => cn("/")
|
|
2324
2324
|
},
|
|
2325
2325
|
{
|
|
2326
2326
|
icon: "grid",
|
|
@@ -2347,13 +2347,13 @@ function _i({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2347
2347
|
icon: "download",
|
|
2348
2348
|
label: "Output",
|
|
2349
2349
|
onPress: () => {
|
|
2350
|
-
t(!0),
|
|
2350
|
+
t(!0), xt("Output");
|
|
2351
2351
|
}
|
|
2352
2352
|
}, {
|
|
2353
2353
|
icon: "file",
|
|
2354
2354
|
label: "File",
|
|
2355
2355
|
onPress: () => {
|
|
2356
|
-
t(!0),
|
|
2356
|
+
t(!0), xt("File");
|
|
2357
2357
|
}
|
|
2358
2358
|
}], g = f ? {
|
|
2359
2359
|
items: [
|
|
@@ -2389,14 +2389,14 @@ function _i({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2389
2389
|
onPress: u
|
|
2390
2390
|
}
|
|
2391
2391
|
],
|
|
2392
|
-
sheetFor: { loop:
|
|
2392
|
+
sheetFor: { loop: _i.map((e) => ({
|
|
2393
2393
|
label: `${e} s`,
|
|
2394
2394
|
checked: o === e,
|
|
2395
2395
|
onPress: () => d(e)
|
|
2396
2396
|
})) }
|
|
2397
2397
|
} : void 0;
|
|
2398
2398
|
return Y(() => {
|
|
2399
|
-
|
|
2399
|
+
Zn({
|
|
2400
2400
|
items: m,
|
|
2401
2401
|
actions: h,
|
|
2402
2402
|
transport: g,
|
|
@@ -2410,20 +2410,20 @@ function _i({ paramsOpen: e, setParamsOpen: t, catalog: n, toggleCatalog: r, rai
|
|
|
2410
2410
|
a,
|
|
2411
2411
|
o,
|
|
2412
2412
|
i
|
|
2413
|
-
]), Y(() => () =>
|
|
2413
|
+
]), Y(() => () => Zn(null), []), null;
|
|
2414
2414
|
}
|
|
2415
|
-
function
|
|
2415
|
+
function yi() {
|
|
2416
2416
|
return /* @__PURE__ */ Q("div", {
|
|
2417
2417
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
2418
2418
|
children: /* @__PURE__ */ Q("div", {
|
|
2419
2419
|
className: "kol-compose-inspector-body",
|
|
2420
|
-
children: /* @__PURE__ */ Q(
|
|
2420
|
+
children: /* @__PURE__ */ Q(qr, {})
|
|
2421
2421
|
})
|
|
2422
2422
|
});
|
|
2423
2423
|
}
|
|
2424
|
-
var
|
|
2424
|
+
var bi = {
|
|
2425
2425
|
topbar: () => null,
|
|
2426
|
-
canvas:
|
|
2426
|
+
canvas: pi,
|
|
2427
2427
|
panels: [
|
|
2428
2428
|
{
|
|
2429
2429
|
slot: "canvas.footer",
|
|
@@ -2433,31 +2433,31 @@ var yi = {
|
|
|
2433
2433
|
{
|
|
2434
2434
|
slot: "right.body",
|
|
2435
2435
|
order: 0,
|
|
2436
|
-
Component:
|
|
2436
|
+
Component: mi
|
|
2437
2437
|
},
|
|
2438
2438
|
{
|
|
2439
2439
|
slot: "right.footer",
|
|
2440
2440
|
order: 0,
|
|
2441
|
-
Component:
|
|
2441
|
+
Component: tn
|
|
2442
2442
|
}
|
|
2443
2443
|
]
|
|
2444
|
-
},
|
|
2445
|
-
...
|
|
2444
|
+
}, xi = {
|
|
2445
|
+
...bi,
|
|
2446
2446
|
panels: [{
|
|
2447
2447
|
slot: "right.header",
|
|
2448
2448
|
order: 0,
|
|
2449
|
-
Component:
|
|
2450
|
-
}, ...
|
|
2449
|
+
Component: gi
|
|
2450
|
+
}, ...bi.panels.map((e) => e.Component === mi ? {
|
|
2451
2451
|
...e,
|
|
2452
|
-
Component:
|
|
2452
|
+
Component: yi
|
|
2453
2453
|
} : e)]
|
|
2454
2454
|
};
|
|
2455
|
-
function
|
|
2456
|
-
let { setAspect: e, selectedId: t, select: n } = i(), { layer: r, setOnly: a } = W(), o = X(!1), c =
|
|
2455
|
+
function Si() {
|
|
2456
|
+
let { setAspect: e, selectedId: t, select: n } = i(), { layer: r, setOnly: a } = W(), o = X(!1), c = Zt(Et), l = Ht() && !dn() || c;
|
|
2457
2457
|
Y(() => {
|
|
2458
2458
|
l && document.documentElement.removeAttribute("data-rail");
|
|
2459
2459
|
}, [l]);
|
|
2460
|
-
let [d, f] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ?
|
|
2460
|
+
let [d, f] = Z(!0), [m, h] = Z(!1), [g, _] = Z(null), v = g ? `${g}px` : m ? ni.tall : ni.half, y = { "--kol-sheet-h": v }, b = Qn(), x = nt(), [S, C] = Z(() => !r);
|
|
2461
2461
|
Y(() => {
|
|
2462
2462
|
C(!r);
|
|
2463
2463
|
}, [r?.id]);
|
|
@@ -2482,7 +2482,7 @@ function xi() {
|
|
|
2482
2482
|
}), () => {
|
|
2483
2483
|
cancelAnimationFrame(e), cancelAnimationFrame(t);
|
|
2484
2484
|
};
|
|
2485
|
-
}, [x.active, l]), Y(() =>
|
|
2485
|
+
}, [x.active, l]), Y(() => Rt((e) => a("photo", {
|
|
2486
2486
|
src: e.url,
|
|
2487
2487
|
srcType: e.srcType
|
|
2488
2488
|
})), [a]), Y(() => {
|
|
@@ -2491,7 +2491,7 @@ function xi() {
|
|
|
2491
2491
|
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
2492
2492
|
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
2493
2493
|
};
|
|
2494
|
-
}, [l]),
|
|
2494
|
+
}, [l]), Ot(), Y(() => (Xt("labs"), () => Xt(null)), []), Y(() => {
|
|
2495
2495
|
if (o.current) return;
|
|
2496
2496
|
o.current = !0;
|
|
2497
2497
|
let t = u();
|
|
@@ -2501,7 +2501,7 @@ function xi() {
|
|
|
2501
2501
|
Y(() => {
|
|
2502
2502
|
if (D.current) return;
|
|
2503
2503
|
D.current = !0;
|
|
2504
|
-
let e =
|
|
2504
|
+
let e = wt();
|
|
2505
2505
|
if (e.open || e.fresh) return;
|
|
2506
2506
|
let t = new URLSearchParams(window.location.search).get("preset"), n = t ? V(t) : null;
|
|
2507
2507
|
n && a("loop", H(M(t), n));
|
|
@@ -2511,7 +2511,7 @@ function xi() {
|
|
|
2511
2511
|
let e = setTimeout(k, 800);
|
|
2512
2512
|
return () => clearTimeout(e);
|
|
2513
2513
|
}, [k]);
|
|
2514
|
-
let { tool: A, setTool: j } =
|
|
2514
|
+
let { tool: A, setTool: j } = gn(), te = X(A);
|
|
2515
2515
|
te.current = A;
|
|
2516
2516
|
let { updateLayer: ne, undo: N, redo: P } = i(), F = X({
|
|
2517
2517
|
undo: N,
|
|
@@ -2530,7 +2530,7 @@ function xi() {
|
|
|
2530
2530
|
let L = X(ne);
|
|
2531
2531
|
return L.current = ne, Y(() => {
|
|
2532
2532
|
let e = (e) => {
|
|
2533
|
-
if (
|
|
2533
|
+
if (kn(e)) return;
|
|
2534
2534
|
if ((e.metaKey || e.ctrlKey) && (e.key === "z" || e.key === "Z")) {
|
|
2535
2535
|
e.preventDefault(), e.shiftKey ? F.current.redo() : F.current.undo();
|
|
2536
2536
|
return;
|
|
@@ -2575,8 +2575,8 @@ function xi() {
|
|
|
2575
2575
|
"data-empty": r || x.active ? void 0 : "",
|
|
2576
2576
|
style: y,
|
|
2577
2577
|
children: [
|
|
2578
|
-
/* @__PURE__ */ Q(
|
|
2579
|
-
l ? /* @__PURE__ */ $(
|
|
2578
|
+
/* @__PURE__ */ Q(gr, {}),
|
|
2579
|
+
l ? /* @__PURE__ */ $(hi.Provider, {
|
|
2580
2580
|
value: {
|
|
2581
2581
|
collapseParams: () => f(!1),
|
|
2582
2582
|
tall: m,
|
|
@@ -2587,9 +2587,9 @@ function xi() {
|
|
|
2587
2587
|
},
|
|
2588
2588
|
children: [/* @__PURE__ */ Q(s.Provider, {
|
|
2589
2589
|
value: "md",
|
|
2590
|
-
children: /* @__PURE__ */ Q(
|
|
2591
|
-
registry:
|
|
2592
|
-
rightIn: (e) => b ?
|
|
2590
|
+
children: /* @__PURE__ */ Q(It, {
|
|
2591
|
+
registry: xi,
|
|
2592
|
+
rightIn: (e) => b ? qn(/* @__PURE__ */ Q("div", {
|
|
2593
2593
|
className: "kol-editor-labs flex flex-col h-full",
|
|
2594
2594
|
"data-touch": "",
|
|
2595
2595
|
"data-params": "open",
|
|
@@ -2597,15 +2597,15 @@ function xi() {
|
|
|
2597
2597
|
children: e
|
|
2598
2598
|
}), b) : null
|
|
2599
2599
|
})
|
|
2600
|
-
}), /* @__PURE__ */ Q(
|
|
2600
|
+
}), /* @__PURE__ */ Q(vi, {
|
|
2601
2601
|
paramsOpen: d,
|
|
2602
2602
|
setParamsOpen: f,
|
|
2603
2603
|
catalog: S,
|
|
2604
2604
|
toggleCatalog: () => C((e) => !e),
|
|
2605
2605
|
railHeight: v
|
|
2606
2606
|
})]
|
|
2607
|
-
}) : /* @__PURE__ */ Q(
|
|
2608
|
-
S && !x.picker && !(x.active && !r) && /* @__PURE__ */ Q(
|
|
2607
|
+
}) : /* @__PURE__ */ Q(It, { registry: bi }),
|
|
2608
|
+
S && !x.picker && !(x.active && !r) && /* @__PURE__ */ Q(oi, {
|
|
2609
2609
|
initialOpen: w,
|
|
2610
2610
|
hasMedia: E,
|
|
2611
2611
|
onNeedMedia: (e) => {
|
|
@@ -2624,8 +2624,8 @@ function xi() {
|
|
|
2624
2624
|
]
|
|
2625
2625
|
});
|
|
2626
2626
|
}
|
|
2627
|
-
var
|
|
2628
|
-
function
|
|
2627
|
+
var Ci = "kol.editor.labs-draft";
|
|
2628
|
+
function wi() {
|
|
2629
2629
|
let e = /\/morph\/?$/.test(typeof window > "u" ? "" : window.location.pathname);
|
|
2630
2630
|
return Y(() => (G(e ? { active: !0 } : {
|
|
2631
2631
|
active: !1,
|
|
@@ -2633,20 +2633,20 @@ function Ci() {
|
|
|
2633
2633
|
}), () => G({
|
|
2634
2634
|
active: !1,
|
|
2635
2635
|
editing: null
|
|
2636
|
-
})), [e]), /* @__PURE__ */ $(
|
|
2637
|
-
draftKey:
|
|
2636
|
+
})), [e]), /* @__PURE__ */ $(ln, {
|
|
2637
|
+
draftKey: Ci,
|
|
2638
2638
|
children: [
|
|
2639
|
-
/* @__PURE__ */ Q(
|
|
2640
|
-
/* @__PURE__ */ Q(
|
|
2639
|
+
/* @__PURE__ */ Q(Si, {}),
|
|
2640
|
+
/* @__PURE__ */ Q(_t, {}),
|
|
2641
2641
|
/* @__PURE__ */ Q(ve, {})
|
|
2642
2642
|
]
|
|
2643
2643
|
});
|
|
2644
2644
|
}
|
|
2645
2645
|
//#endregion
|
|
2646
2646
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
2647
|
-
function
|
|
2647
|
+
function Ti({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
2648
2648
|
let [i, a] = Z(null);
|
|
2649
|
-
|
|
2649
|
+
Jr(r);
|
|
2650
2650
|
let { engineHost: o } = ie(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = F(L.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
2651
2651
|
return /* @__PURE__ */ Q("div", {
|
|
2652
2652
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
|
|
@@ -2664,7 +2664,7 @@ function wi({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2664
2664
|
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Q(K, {
|
|
2665
2665
|
tone: "primary",
|
|
2666
2666
|
size: "lg",
|
|
2667
|
-
className:
|
|
2667
|
+
className: Vt,
|
|
2668
2668
|
iconLeft: l ? "filter" : "chevron-right",
|
|
2669
2669
|
iconRight: l ? "filter" : "chevron-right",
|
|
2670
2670
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
@@ -2674,7 +2674,7 @@ function wi({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2674
2674
|
/* @__PURE__ */ Q(K, {
|
|
2675
2675
|
tone: "grey",
|
|
2676
2676
|
size: "lg",
|
|
2677
|
-
className:
|
|
2677
|
+
className: Vt,
|
|
2678
2678
|
iconLeft: "arrow-left",
|
|
2679
2679
|
iconRight: "arrow-left",
|
|
2680
2680
|
onClick: () => l ? a(null) : r(),
|
|
@@ -2686,7 +2686,7 @@ function wi({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
//#endregion
|
|
2688
2688
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
2689
|
-
var
|
|
2689
|
+
var Ei = { background: "var(--kol-surface-primary)" }, Di = [
|
|
2690
2690
|
{
|
|
2691
2691
|
value: "generate",
|
|
2692
2692
|
label: "Generate"
|
|
@@ -2703,29 +2703,29 @@ var Ti = { background: "var(--kol-surface-primary)" }, Ei = [
|
|
|
2703
2703
|
value: "output",
|
|
2704
2704
|
label: "Output"
|
|
2705
2705
|
}
|
|
2706
|
-
],
|
|
2706
|
+
], Oi = Di.filter((e) => e.value !== "generate"), ki = "[&_.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)]", Ai = {
|
|
2707
2707
|
lg: 9.6,
|
|
2708
2708
|
sm: 7.2
|
|
2709
|
-
},
|
|
2710
|
-
function
|
|
2711
|
-
let n = t === "sm" ?
|
|
2709
|
+
}, ji = 10, Mi = 232;
|
|
2710
|
+
function Ni(e, t) {
|
|
2711
|
+
let n = t === "sm" ? Mi : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
2712
2712
|
for (let o of e) {
|
|
2713
|
-
let e = o.label.length *
|
|
2713
|
+
let e = o.label.length * Ai[t] + ji, s = Math.max(a, e);
|
|
2714
2714
|
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
2715
2715
|
}
|
|
2716
2716
|
return i.length && r.push(i), r;
|
|
2717
2717
|
}
|
|
2718
|
-
function
|
|
2719
|
-
return
|
|
2718
|
+
function Pi({ cells: e, size: t }) {
|
|
2719
|
+
return Ni(e, t).map((e, n) => /* @__PURE__ */ Q(J, {
|
|
2720
2720
|
value: null,
|
|
2721
2721
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
2722
2722
|
options: e,
|
|
2723
2723
|
size: t,
|
|
2724
2724
|
ariaLabel: "Randomize scope",
|
|
2725
|
-
className:
|
|
2725
|
+
className: ki
|
|
2726
2726
|
}, n));
|
|
2727
2727
|
}
|
|
2728
|
-
var
|
|
2728
|
+
var Fi = [
|
|
2729
2729
|
2,
|
|
2730
2730
|
4,
|
|
2731
2731
|
8,
|
|
@@ -2734,17 +2734,17 @@ var Pi = [
|
|
|
2734
2734
|
value: String(e),
|
|
2735
2735
|
label: `${e}s`
|
|
2736
2736
|
}));
|
|
2737
|
-
function
|
|
2737
|
+
function Ii({ size: e }) {
|
|
2738
2738
|
let { loopSeconds: t, setLoopSeconds: n } = S();
|
|
2739
2739
|
return /* @__PURE__ */ Q(J, {
|
|
2740
2740
|
value: String(t),
|
|
2741
2741
|
onChange: (e) => n(Number(e)),
|
|
2742
|
-
options:
|
|
2742
|
+
options: Fi,
|
|
2743
2743
|
size: e,
|
|
2744
2744
|
ariaLabel: "Loop length"
|
|
2745
2745
|
});
|
|
2746
2746
|
}
|
|
2747
|
-
var
|
|
2747
|
+
var Li = [
|
|
2748
2748
|
{
|
|
2749
2749
|
value: "9:16",
|
|
2750
2750
|
label: "9:16"
|
|
@@ -2761,7 +2761,7 @@ var Ii = [
|
|
|
2761
2761
|
value: "1:1",
|
|
2762
2762
|
label: "1:1"
|
|
2763
2763
|
}
|
|
2764
|
-
],
|
|
2764
|
+
], Ri = [
|
|
2765
2765
|
{
|
|
2766
2766
|
value: "5:4",
|
|
2767
2767
|
label: "5:4"
|
|
@@ -2779,20 +2779,20 @@ var Ii = [
|
|
|
2779
2779
|
label: "Fill"
|
|
2780
2780
|
}
|
|
2781
2781
|
];
|
|
2782
|
-
function
|
|
2783
|
-
let p = nt(), { updateLayer: g, addFilter: v, removeFilter: y } = i(), { onExportPng: b } =
|
|
2782
|
+
function zi({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: f }) {
|
|
2783
|
+
let p = nt(), { updateLayer: g, addFilter: v, removeFilter: y } = i(), { onExportPng: b } = Lt(), [S, w] = Z(!1), [T, D] = Z(!0), [ee, k] = Z(!1), [A, j] = Z(!1), [te, M] = Z("generate"), [ne, F] = Z(!1), [I, re] = Z(!1), { aspect: L } = i(), [R, ae] = Z(null), z = m(e);
|
|
2784
2784
|
Y(() => {
|
|
2785
2785
|
c && (D(!0), j(!0));
|
|
2786
2786
|
}, [c]);
|
|
2787
2787
|
let B = l ? "sm" : "lg", oe = l && !!e && T && !S;
|
|
2788
2788
|
Y(() => (u?.(oe), () => u?.(!1)), [oe]);
|
|
2789
|
-
let se = !l && e && T && !S ? R ? `${R}px` : ne ?
|
|
2789
|
+
let se = !l && e && T && !S ? R ? `${R}px` : ne ? ni.tall : ni.half : null;
|
|
2790
2790
|
Y(() => (f?.(se), () => f?.(null)), [se]);
|
|
2791
2791
|
let ce = () => {
|
|
2792
2792
|
let t = e?.type === "loop" && N(e.loopGroup).find((t) => t.id === e.presetId);
|
|
2793
2793
|
t && g(e.id, H(t, e.loopGroup));
|
|
2794
2794
|
};
|
|
2795
|
-
if (
|
|
2795
|
+
if (Mr(ce, () => {
|
|
2796
2796
|
e?.type === "loop" && g(e.id, d(e, x(U(e.loopId)?.params ?? [], e), z.take(), { withFilters: !0 }));
|
|
2797
2797
|
}), !e) return null;
|
|
2798
2798
|
if (S) return /* @__PURE__ */ Q("button", {
|
|
@@ -2807,12 +2807,12 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2807
2807
|
let t = E(e, z.take());
|
|
2808
2808
|
t && g(e.id, { filters: t });
|
|
2809
2809
|
};
|
|
2810
|
-
if (!T) return /* @__PURE__ */ $(
|
|
2810
|
+
if (!T) return /* @__PURE__ */ $(ti, {
|
|
2811
2811
|
label: V ? e.presetLabel : "Media",
|
|
2812
2812
|
onOpen: () => D(!0),
|
|
2813
2813
|
size: B,
|
|
2814
2814
|
children: [
|
|
2815
|
-
(V || he.length > 0) && /* @__PURE__ */ Q(
|
|
2815
|
+
(V || he.length > 0) && /* @__PURE__ */ Q(Ln, {
|
|
2816
2816
|
label: "Randomize all",
|
|
2817
2817
|
children: /* @__PURE__ */ Q(K, {
|
|
2818
2818
|
tone: "primary",
|
|
@@ -2823,7 +2823,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2823
2823
|
className: "shrink-0"
|
|
2824
2824
|
})
|
|
2825
2825
|
}),
|
|
2826
|
-
/* @__PURE__ */ Q(
|
|
2826
|
+
/* @__PURE__ */ Q(Ln, {
|
|
2827
2827
|
label: "Download",
|
|
2828
2828
|
children: /* @__PURE__ */ Q(K, {
|
|
2829
2829
|
tone: "primary",
|
|
@@ -2834,7 +2834,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2834
2834
|
className: "shrink-0"
|
|
2835
2835
|
})
|
|
2836
2836
|
}),
|
|
2837
|
-
/* @__PURE__ */ Q(
|
|
2837
|
+
/* @__PURE__ */ Q(Ln, {
|
|
2838
2838
|
label: "Hide UI",
|
|
2839
2839
|
children: /* @__PURE__ */ Q(K, {
|
|
2840
2840
|
tone: "primary",
|
|
@@ -2845,7 +2845,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2845
2845
|
className: "shrink-0"
|
|
2846
2846
|
})
|
|
2847
2847
|
}),
|
|
2848
|
-
/* @__PURE__ */ Q(
|
|
2848
|
+
/* @__PURE__ */ Q(Ln, {
|
|
2849
2849
|
label: a === "fill" ? "Back to the frame" : "Fill the screen",
|
|
2850
2850
|
children: /* @__PURE__ */ Q(K, {
|
|
2851
2851
|
tone: "primary",
|
|
@@ -2859,11 +2859,11 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2859
2859
|
})
|
|
2860
2860
|
]
|
|
2861
2861
|
});
|
|
2862
|
-
let ve = [...V ?
|
|
2862
|
+
let ve = [...V ? Di : Oi, ...V && p.steps.length >= 2 ? [{
|
|
2863
2863
|
value: "morph",
|
|
2864
2864
|
label: "Morph"
|
|
2865
2865
|
}] : []].filter((e) => (e.value !== "effects" || ge) && (e.value !== "transport" || o("motion"))), ye = ve.some((e) => e.value === te) ? te : ve[0].value;
|
|
2866
|
-
return /* @__PURE__ */ $(
|
|
2866
|
+
return /* @__PURE__ */ $(Un, { children: [
|
|
2867
2867
|
/* @__PURE__ */ Q(pe, {
|
|
2868
2868
|
open: I,
|
|
2869
2869
|
onClose: () => re(!1),
|
|
@@ -2871,7 +2871,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2871
2871
|
layer: e,
|
|
2872
2872
|
size: B
|
|
2873
2873
|
}),
|
|
2874
|
-
ee && /* @__PURE__ */ Q(
|
|
2874
|
+
ee && /* @__PURE__ */ Q(Yr, {
|
|
2875
2875
|
onPick: (e) => {
|
|
2876
2876
|
t(e), k(!1);
|
|
2877
2877
|
},
|
|
@@ -2883,7 +2883,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2883
2883
|
},
|
|
2884
2884
|
onDismiss: () => k(!1)
|
|
2885
2885
|
}),
|
|
2886
|
-
A && /* @__PURE__ */ Q(
|
|
2886
|
+
A && /* @__PURE__ */ Q(Ti, {
|
|
2887
2887
|
layer: e,
|
|
2888
2888
|
chain: he,
|
|
2889
2889
|
onPick: (t) => {
|
|
@@ -2893,12 +2893,12 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2893
2893
|
}),
|
|
2894
2894
|
/* @__PURE__ */ $("div", {
|
|
2895
2895
|
className: l ? "fixed top-0 right-0 bottom-0 z-10 flex w-[var(--kol-sidenav-w,320px)] flex-col overflow-y-auto border-l border-oq-08" : "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
2896
|
-
style: l ?
|
|
2897
|
-
...
|
|
2898
|
-
top: `calc(100dvh - ${se ??
|
|
2896
|
+
style: l ? Ei : {
|
|
2897
|
+
...Ei,
|
|
2898
|
+
top: `calc(100dvh - ${se ?? ni.half})`
|
|
2899
2899
|
},
|
|
2900
2900
|
children: [
|
|
2901
|
-
!l && /* @__PURE__ */ Q(
|
|
2901
|
+
!l && /* @__PURE__ */ Q(ii, {
|
|
2902
2902
|
tall: ne,
|
|
2903
2903
|
onToggle: () => {
|
|
2904
2904
|
ae(null), F((e) => !e);
|
|
@@ -2908,7 +2908,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2908
2908
|
e < 96 && (ae(null), D(!1));
|
|
2909
2909
|
}
|
|
2910
2910
|
}),
|
|
2911
|
-
/* @__PURE__ */ Q(
|
|
2911
|
+
/* @__PURE__ */ Q(ei, {
|
|
2912
2912
|
title: le,
|
|
2913
2913
|
onCollapse: () => D(!1),
|
|
2914
2914
|
className: l ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
@@ -2928,9 +2928,9 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2928
2928
|
onChange: M,
|
|
2929
2929
|
options: ve,
|
|
2930
2930
|
size: B,
|
|
2931
|
-
className: l ?
|
|
2931
|
+
className: l ? ki : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
2932
2932
|
}),
|
|
2933
|
-
ye === "morph" && V && /* @__PURE__ */ Q(
|
|
2933
|
+
ye === "morph" && V && /* @__PURE__ */ Q(yr, {
|
|
2934
2934
|
layer: e,
|
|
2935
2935
|
readOnly: !0
|
|
2936
2936
|
}),
|
|
@@ -2962,7 +2962,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2962
2962
|
onClick: W,
|
|
2963
2963
|
children: "Randomize all"
|
|
2964
2964
|
}),
|
|
2965
|
-
/* @__PURE__ */ Q(
|
|
2965
|
+
/* @__PURE__ */ Q(Ln, {
|
|
2966
2966
|
label: "What Randomize all rolls",
|
|
2967
2967
|
children: /* @__PURE__ */ Q(K, {
|
|
2968
2968
|
tone: "primary",
|
|
@@ -2973,7 +2973,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2973
2973
|
className: "shrink-0"
|
|
2974
2974
|
})
|
|
2975
2975
|
}),
|
|
2976
|
-
/* @__PURE__ */ Q(
|
|
2976
|
+
/* @__PURE__ */ Q(Ln, {
|
|
2977
2977
|
label: "Reset to defaults",
|
|
2978
2978
|
shortcut: "R",
|
|
2979
2979
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -2987,7 +2987,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
2987
2987
|
})
|
|
2988
2988
|
]
|
|
2989
2989
|
}),
|
|
2990
|
-
de.length > 0 && /* @__PURE__ */ Q(
|
|
2990
|
+
de.length > 0 && /* @__PURE__ */ Q(Pi, {
|
|
2991
2991
|
size: B,
|
|
2992
2992
|
cells: [...de.map((e) => ({
|
|
2993
2993
|
value: e.id,
|
|
@@ -3045,7 +3045,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3045
3045
|
iconRight: "trash",
|
|
3046
3046
|
onClick: () => y(e.id, n),
|
|
3047
3047
|
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
3048
|
-
}), i.length > 0 && /* @__PURE__ */ Q(
|
|
3048
|
+
}), i.length > 0 && /* @__PURE__ */ Q(Pi, {
|
|
3049
3049
|
size: B,
|
|
3050
3050
|
cells: i.map((e) => ({
|
|
3051
3051
|
value: e.id,
|
|
@@ -3061,7 +3061,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3061
3061
|
children: [(() => {
|
|
3062
3062
|
let e = o("motion").TransportBar;
|
|
3063
3063
|
return /* @__PURE__ */ Q(e, { size: B });
|
|
3064
|
-
})(), /* @__PURE__ */ Q(
|
|
3064
|
+
})(), /* @__PURE__ */ Q(Ii, { size: B })]
|
|
3065
3065
|
}),
|
|
3066
3066
|
ye === "output" && /* @__PURE__ */ $("div", {
|
|
3067
3067
|
className: "flex flex-col gap-2 pt-3",
|
|
@@ -3069,14 +3069,14 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3069
3069
|
/* @__PURE__ */ Q(J, {
|
|
3070
3070
|
value: a,
|
|
3071
3071
|
onChange: s,
|
|
3072
|
-
options:
|
|
3072
|
+
options: Li,
|
|
3073
3073
|
size: B,
|
|
3074
3074
|
ariaLabel: "Aspect"
|
|
3075
3075
|
}),
|
|
3076
3076
|
/* @__PURE__ */ Q(J, {
|
|
3077
3077
|
value: a,
|
|
3078
3078
|
onChange: s,
|
|
3079
|
-
options:
|
|
3079
|
+
options: Ri,
|
|
3080
3080
|
size: B,
|
|
3081
3081
|
ariaLabel: "Aspect (landscape) and fill"
|
|
3082
3082
|
}),
|
|
@@ -3086,7 +3086,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3086
3086
|
/* @__PURE__ */ Q(K, {
|
|
3087
3087
|
tone: "primary",
|
|
3088
3088
|
size: B,
|
|
3089
|
-
onClick: () =>
|
|
3089
|
+
onClick: () => kt({ focusName: !0 }),
|
|
3090
3090
|
children: "Save…"
|
|
3091
3091
|
}),
|
|
3092
3092
|
/* @__PURE__ */ Q(K, {
|
|
@@ -3119,7 +3119,7 @@ function Ri({ layer: e, onSwitchCategory: t, onInsert: n, onRestart: r, aspectVa
|
|
|
3119
3119
|
}
|
|
3120
3120
|
//#endregion
|
|
3121
3121
|
//#region src/editor/mobile/MobileView.jsx
|
|
3122
|
-
function
|
|
3122
|
+
function Bi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
3123
3123
|
return /* @__PURE__ */ Q("div", {
|
|
3124
3124
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
3125
3125
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
@@ -3137,45 +3137,45 @@ function zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3137
3137
|
})]
|
|
3138
3138
|
}) : /* @__PURE__ */ Q("span", {
|
|
3139
3139
|
className: "kol-eyebrow text-body",
|
|
3140
|
-
children:
|
|
3140
|
+
children: Jt("randomiser").label
|
|
3141
3141
|
}), /* @__PURE__ */ $("div", {
|
|
3142
3142
|
className: "flex flex-col gap-2",
|
|
3143
3143
|
children: [
|
|
3144
3144
|
/* @__PURE__ */ Q(K, {
|
|
3145
3145
|
tone: "primary",
|
|
3146
3146
|
size: "lg",
|
|
3147
|
-
className:
|
|
3148
|
-
iconLeft:
|
|
3149
|
-
iconRight:
|
|
3147
|
+
className: Vt,
|
|
3148
|
+
iconLeft: rn.randomiser,
|
|
3149
|
+
iconRight: rn.randomiser,
|
|
3150
3150
|
onClick: e,
|
|
3151
3151
|
children: "Generate"
|
|
3152
3152
|
}),
|
|
3153
3153
|
/* @__PURE__ */ Q(K, {
|
|
3154
3154
|
tone: "primary",
|
|
3155
3155
|
size: "lg",
|
|
3156
|
-
className:
|
|
3156
|
+
className: Vt,
|
|
3157
3157
|
iconLeft: "filter",
|
|
3158
3158
|
iconRight: "filter",
|
|
3159
3159
|
onClick: t,
|
|
3160
3160
|
children: "Effects"
|
|
3161
3161
|
}),
|
|
3162
|
-
n &&
|
|
3162
|
+
n && Nt() && /* @__PURE__ */ Q(K, {
|
|
3163
3163
|
tone: "primary",
|
|
3164
3164
|
size: "lg",
|
|
3165
3165
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3166
|
-
iconLeft:
|
|
3167
|
-
iconRight:
|
|
3168
|
-
onClick:
|
|
3169
|
-
children:
|
|
3166
|
+
iconLeft: rn.editor,
|
|
3167
|
+
iconRight: rn.editor,
|
|
3168
|
+
onClick: Bt,
|
|
3169
|
+
children: Jt("editor").label
|
|
3170
3170
|
}),
|
|
3171
3171
|
n && /* @__PURE__ */ Q(K, {
|
|
3172
3172
|
tone: "primary",
|
|
3173
3173
|
size: "lg",
|
|
3174
3174
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3175
|
-
iconLeft:
|
|
3176
|
-
iconRight:
|
|
3177
|
-
onClick:
|
|
3178
|
-
children:
|
|
3175
|
+
iconLeft: rn.labs,
|
|
3176
|
+
iconRight: rn.labs,
|
|
3177
|
+
onClick: bn,
|
|
3178
|
+
children: Jt("labs").label
|
|
3179
3179
|
}),
|
|
3180
3180
|
n && /* @__PURE__ */ Q(K, {
|
|
3181
3181
|
tone: "primary",
|
|
@@ -3183,7 +3183,7 @@ function zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3183
3183
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
3184
3184
|
iconLeft: "swap",
|
|
3185
3185
|
iconRight: "swap",
|
|
3186
|
-
onClick: () =>
|
|
3186
|
+
onClick: () => cn("/morph"),
|
|
3187
3187
|
children: "Morph"
|
|
3188
3188
|
})
|
|
3189
3189
|
]
|
|
@@ -3191,8 +3191,8 @@ function zi({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
3191
3191
|
})
|
|
3192
3192
|
});
|
|
3193
3193
|
}
|
|
3194
|
-
function
|
|
3195
|
-
let { layers: t, addLayer: n, removeLayer: r, updateLayer: a, canvasW: o, canvasH: s, aspect: c, setAspect: u } = i(), { setTool: d } =
|
|
3194
|
+
function Vi() {
|
|
3195
|
+
let { layers: t, addLayer: n, removeLayer: r, updateLayer: a, canvasW: o, canvasH: s, aspect: c, setAspect: u } = i(), { setTool: d } = gn(), f = Ht() && !dn(), p = Sn(), m = () => {
|
|
3196
3196
|
let e = new URLSearchParams(window.location.search);
|
|
3197
3197
|
return e.get("open") ? "live" : e.get("start") === "category" ? "category" : "entry";
|
|
3198
3198
|
}, [h, g] = Z(m), [_, v] = Z(!1), [y, b] = Z(null), [x, S] = Z("contain"), [C, w] = Z(!1), [T, E] = Z(null), [D, ee] = Z({
|
|
@@ -3252,7 +3252,7 @@ function Bi() {
|
|
|
3252
3252
|
let t = j.current;
|
|
3253
3253
|
t && t.id === e.pointerId && e.type === "pointerup" && h === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (F?.type === "loop" ? U(F.loopId) : null)?.group !== "penrose" && O.toggle(), t?.id === e.pointerId && (j.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, ee(A.current.live));
|
|
3254
3254
|
};
|
|
3255
|
-
|
|
3255
|
+
Kn(), Y(() => (Xt("randomiser"), () => Xt(null)), []), Y(() => {
|
|
3256
3256
|
u("4:5"), d("orbit");
|
|
3257
3257
|
}, []);
|
|
3258
3258
|
let F = t.find((e) => e.id === y) ?? (t.length === 1 ? t[0] : null), I = h === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
|
|
@@ -3326,21 +3326,21 @@ function Bi() {
|
|
|
3326
3326
|
onPointerUpCapture: P,
|
|
3327
3327
|
onPointerCancelCapture: P,
|
|
3328
3328
|
onPointerLeave: P,
|
|
3329
|
-
children: /* @__PURE__ */ Q(
|
|
3329
|
+
children: /* @__PURE__ */ Q(Qt, { fit: x })
|
|
3330
3330
|
}),
|
|
3331
|
-
h === "entry" && /* @__PURE__ */ Q(
|
|
3331
|
+
h === "entry" && /* @__PURE__ */ Q(Bi, {
|
|
3332
3332
|
chromes: f,
|
|
3333
3333
|
onGenerate: () => g("category"),
|
|
3334
3334
|
onEffects: () => {
|
|
3335
3335
|
v(!0), ie();
|
|
3336
3336
|
}
|
|
3337
3337
|
}),
|
|
3338
|
-
h === "category" && /* @__PURE__ */ Q(
|
|
3338
|
+
h === "category" && /* @__PURE__ */ Q(Yr, {
|
|
3339
3339
|
onPick: re,
|
|
3340
3340
|
onInsert: ie,
|
|
3341
3341
|
onBack: () => g("entry")
|
|
3342
3342
|
}),
|
|
3343
|
-
h === "live" && !I && /* @__PURE__ */ Q(
|
|
3343
|
+
h === "live" && !I && /* @__PURE__ */ Q(zi, {
|
|
3344
3344
|
layer: F,
|
|
3345
3345
|
onSwitchCategory: L,
|
|
3346
3346
|
onInsert: () => {
|
|
@@ -3359,7 +3359,7 @@ function Bi() {
|
|
|
3359
3359
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
3360
3360
|
children: [/* @__PURE__ */ Q("div", {
|
|
3361
3361
|
className: "flex-1 min-h-0",
|
|
3362
|
-
children: /* @__PURE__ */ Q(
|
|
3362
|
+
children: /* @__PURE__ */ Q(Qr, { layer: F })
|
|
3363
3363
|
}), /* @__PURE__ */ Q("div", {
|
|
3364
3364
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
3365
3365
|
children: /* @__PURE__ */ Q(K, {
|
|
@@ -3373,11 +3373,11 @@ function Bi() {
|
|
|
3373
3373
|
]
|
|
3374
3374
|
});
|
|
3375
3375
|
}
|
|
3376
|
-
function
|
|
3377
|
-
return /* @__PURE__ */ $(
|
|
3376
|
+
function Hi() {
|
|
3377
|
+
return /* @__PURE__ */ $(ln, {
|
|
3378
3378
|
persistDraft: !1,
|
|
3379
|
-
children: [/* @__PURE__ */ Q(
|
|
3379
|
+
children: [/* @__PURE__ */ Q(Vi, {}), /* @__PURE__ */ Q(_t, {})]
|
|
3380
3380
|
});
|
|
3381
3381
|
}
|
|
3382
3382
|
//#endregion
|
|
3383
|
-
export {
|
|
3383
|
+
export { bt as AppSettingsSections, Tt as BRAND, xn as DesignEditor, xn as default, jt as DisplaySettingsDrawer, ln as EditorProviders, Mt as FilesDialog, un as FloatDesignEditor, Be as GeneratorLibraryProvider, Ci as LABS_DRAFT_KEY, Fe as LIBRARY_SLOT_KEYS, wi as LabsView, vn as MODES, Hi as MobileView, Yt as OutputCanvas, Qt as OutputStage, mn as OutputView, qt as RAIL_EXTRA_PREFIX, pt as TimelineRail, ze as UnauthorizedError, Gt as VIEW_PATHS, an as closeFiles, Pt as comboLabel, _n as copyStored, pn as currentView, nn as duplicateStored, Le as getLibraryApi, Pe as inviteFromRequest, Ht as isMobileDevice, ke as listInviteRequests, je as loadLibrary, Ve as mintInvite, kt as openFiles, Ie as readLibraryRaw, b as registerPack, Wt as removeStored, fn as renameStored, We as requestInvite, Ae as setLibraryApi, Kt as setMediaClient, Dn as setMediaProxyBase, wn as setMode, $t as setNavigator, sn as setRailExtras, k as setSettingsStore, yn as setThumbStored, gt as setWantsDesktop, vt as shortcutsBySection, Ue as signInLibrary, De as signOutLibrary, Te as signUpLibrary, Me as subscribeLibrary, mt as timelineView, He as updateAccount, Oe as useAccount, At as useFilesDialog, Ne as useGeneratorLibrary, Ee as useLibrarySession, Cn as useRailExtras, on as useSettingsSections, dn as wantsDesktop, hn as withView };
|