@kolkrabbi/design-editor 0.19.0 → 0.21.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/{RuleRow-DlouS36V.js → RuleRow-BXkjpTyN.js} +139 -79
- package/dist/TreePicker-DLmMl0aU.js +68 -0
- package/dist/{core-BeIRJu1Z.js → core-B2bfXyS5.js} +2561 -2192
- package/dist/core.js +3 -3
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +1069 -1292
- package/dist/{effects-DehkU1My.js → effectCategories-BcaQSD_V.js} +734 -1076
- package/dist/effects-pCd8YTdQ.js +469 -0
- package/dist/effects.js +1 -1
- package/dist/{generators-Bk3mvrsm.js → generators-B8_StNAy.js} +283 -345
- package/dist/generators.js +1 -1
- package/dist/{host-B8_Ri9EV.js → host-B4SRaN9h.js} +170 -171
- package/dist/labels-B5qkocWy.js +2007 -0
- package/dist/motion-DFnAar_2.js +2263 -0
- package/dist/motion.js +1 -1
- package/dist/{rolls-CkmuE-Ya.js → rolls-Bg1XHuvJ.js} +2198 -1963
- package/dist/{src-DFtETCsY.js → src-B5fQgAVE.js} +1 -1
- package/dist/{registry-CSOtIU7o.js → useLayerEdit-ieOjHx6x.js} +2873 -2619
- package/package.json +9 -9
- package/dist/BindDot-CuCS4LS-.js +0 -127
- package/dist/TreePicker-D5XZT0Zi.js +0 -303
- package/dist/labels-B10g9Um5.js +0 -40
- package/dist/motion-9j3WO6a2.js +0 -4223
- package/dist/useLayerEdit-DRZ09kNJ.js +0 -259
package/dist/design-editor.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { B as e,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { B as e, L as t, Rt as n, S as r, a as i, at as a, b as o, c as s, i as c, it as l, j as u, l as d, mn as f, n as p, o as m, ot as h, pn as g, r as _, rt as v, tt as y, u as b, w as x, wt as ee, x as S, zt as C } from "./rolls-Bg1XHuvJ.js";
|
|
2
|
+
import { a as te, d as ne, f as w, g as T, h as E, i as D, l as re, m as O, n as k, o as A, r as j, t as M } from "./useLayerEdit-ieOjHx6x.js";
|
|
3
|
+
import { s as N } from "./RuleRow-BXkjpTyN.js";
|
|
4
|
+
import { n as P } from "./generators-B8_StNAy.js";
|
|
5
|
+
import { a as F, f as I, i as L, l as ie, n as R, o as ae, r as z, s as oe, t as se, u as B } from "./effectCategories-BcaQSD_V.js";
|
|
6
|
+
import { n as ce, r as V } from "./effects-pCd8YTdQ.js";
|
|
7
|
+
import { c as le, i as H, r as ue } from "./labels-B5qkocWy.js";
|
|
8
|
+
import { i as U, n as de, r as fe } from "./motion-DFnAar_2.js";
|
|
9
|
+
import { $ as pe, A as me, B as he, C as ge, D as _e, E as ve, F as ye, G as be, H as xe, I as W, J as Se, K as Ce, L as we, M as Te, N as Ee, O as De, P as Oe, Q as ke, R as G, S as Ae, T as je, U as Me, V as Ne, W as Pe, X as Fe, Y as Ie, Z as Le, _ as Re, a as ze, b as Be, c as Ve, d as He, et as Ue, f as We, g as Ge, h as Ke, i as qe, j as Je, k as Ye, l as Xe, m as Ze, n as Qe, nt as $e, o as et, p as tt, q as nt, r as rt, rt as it, s as at, t as ot, tt as st, u as ct, v as lt, w as ut, x as dt, y as ft, z as pt } from "./core-B2bfXyS5.js";
|
|
10
|
+
import { Button as K, Divider as mt, Dropdown as ht, LabeledControlSection as gt, SegmentedToggle as q, ToggleSwitch as _t, Tooltip as vt } from "@kolkrabbi/kol-component";
|
|
11
|
+
import { createContext as yt, useCallback as bt, useContext as xt, useEffect as J, useRef as Y, useState as X } from "react";
|
|
12
|
+
import { Fragment as St, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
13
|
+
import { Icon as Ct } from "@kolkrabbi/kol-icons";
|
|
14
|
+
import { useDragResize as wt, useTheme as Tt } from "@kolkrabbi/kol-framework";
|
|
14
15
|
//#region src/editor/labs/useLabsLayer.js
|
|
15
|
-
function
|
|
16
|
-
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } =
|
|
16
|
+
function $() {
|
|
17
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = u(), s = bt((s, c) => {
|
|
17
18
|
let [l, ...u] = e;
|
|
18
19
|
a();
|
|
19
20
|
for (let e of u) n(e.id);
|
|
@@ -34,214 +35,10 @@ function vt() {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
//#endregion
|
|
37
|
-
//#region src/editor/labs/catalog.js
|
|
38
|
-
var $ = {
|
|
39
|
-
"fx:halftone": "ptrn-dot",
|
|
40
|
-
"fx:scanline": "grid-horizontal",
|
|
41
|
-
"fx:crt": "desktop",
|
|
42
|
-
"fx:refraction": "circle",
|
|
43
|
-
"fx:fx-rack": "target",
|
|
44
|
-
"fx:pattern": "ptrn-checker",
|
|
45
|
-
"fx:other": "more",
|
|
46
|
-
"gen:Scanline": "grid-horizontal",
|
|
47
|
-
"gen:Pattern": "ptrn-checker",
|
|
48
|
-
"gen:Loops": "refresh",
|
|
49
|
-
"gen:Math": "sum",
|
|
50
|
-
"gen:Penrose": "a-framed",
|
|
51
|
-
"gen:Drift": "dith-flow",
|
|
52
|
-
"gen:Gradients": "circle",
|
|
53
|
-
"gen:Soft Forms": "paint-drop",
|
|
54
|
-
"gen:Soft Forms 3D": "ball",
|
|
55
|
-
"gen:3D Scene": "ball",
|
|
56
|
-
"kin:Type": "font-01",
|
|
57
|
-
"kin:Kinetic": "font-01",
|
|
58
|
-
"misc:Para Type": "aa",
|
|
59
|
-
"vec:Distressor": "scribble",
|
|
60
|
-
"vec:Modulator": "dashed-circle"
|
|
61
|
-
}, yt = {
|
|
62
|
-
effects: "filter",
|
|
63
|
-
generative: "layers",
|
|
64
|
-
vector: "pen-nib",
|
|
65
|
-
composition: "type",
|
|
66
|
-
modulation: "frequency",
|
|
67
|
-
mode: "mode-toggle-01"
|
|
68
|
-
}, bt = {
|
|
69
|
-
editor: "desktop",
|
|
70
|
-
labs: "globe",
|
|
71
|
-
randomiser: "refresh"
|
|
72
|
-
}, xt = [
|
|
73
|
-
"Moiré",
|
|
74
|
-
"Mesh Gradient",
|
|
75
|
-
"Reaction",
|
|
76
|
-
"Halftone"
|
|
77
|
-
], St = [
|
|
78
|
-
{
|
|
79
|
-
label: "Spaced",
|
|
80
|
-
patch: {
|
|
81
|
-
geometry: "rows",
|
|
82
|
-
mark: "dots"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
label: "Glyph",
|
|
87
|
-
patch: { mark: "glyph" }
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
label: "Lattice",
|
|
91
|
-
patch: { mark: "lattice" }
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: "Vortex",
|
|
95
|
-
patch: {
|
|
96
|
-
geometry: "radial",
|
|
97
|
-
swirl: .8,
|
|
98
|
-
rayCount: 220
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: "Rings",
|
|
103
|
-
patch: { geometry: "rings" }
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
label: "Spiral",
|
|
107
|
-
patch: { geometry: "spiral" }
|
|
108
|
-
}
|
|
109
|
-
], Ct = (e = {}) => {
|
|
110
|
-
let t = e.geometry ?? "rows";
|
|
111
|
-
return t === "radial" ? "Vortex" : t === "rings" ? "Rings" : t === "spiral" ? "Spiral" : e.mark === "glyph" ? "Glyph" : e.mark === "lattice" ? "Lattice" : "Spaced";
|
|
112
|
-
};
|
|
113
|
-
function wt({ layer: e, setOnly: t, addFilter: n, patchFilter: r, carriedSource: i }) {
|
|
114
|
-
let a = (e, a) => {
|
|
115
|
-
let o = t("photo", {
|
|
116
|
-
...i(),
|
|
117
|
-
filters: [],
|
|
118
|
-
fxGroup: null
|
|
119
|
-
});
|
|
120
|
-
o && (n(o, e), a && r(o, 0, a)), window.dispatchEvent(new CustomEvent("kol:open-effects"));
|
|
121
|
-
}, o = (e) => {
|
|
122
|
-
t("photo", {
|
|
123
|
-
...i(),
|
|
124
|
-
filters: [],
|
|
125
|
-
fxGroup: e
|
|
126
|
-
}), window.dispatchEvent(new CustomEvent("kol:open-effects"));
|
|
127
|
-
}, s = (e, n) => {
|
|
128
|
-
t("loop", D(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
129
|
-
}, c = (e) => {
|
|
130
|
-
t("kinetic", {
|
|
131
|
-
presetId: e.id,
|
|
132
|
-
presetLabel: e.label,
|
|
133
|
-
comp: he(e)
|
|
134
|
-
}), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
135
|
-
}, l = e?.presetId ?? null, u = e?.filters?.[0]?.id ?? null, d = l ? T(e?.loopGroup).find((e) => e.id === l) ?? null : null, f = (n, r = "loop", i) => {
|
|
136
|
-
let a = T(n), o = [...new Set(a.map((e) => e.sub).filter(Boolean))], c = (e) => r === "misc" ? () => {
|
|
137
|
-
t("misc", D(e, n)), window.dispatchEvent(new CustomEvent("kol:open-params"));
|
|
138
|
-
} : () => s(e, n);
|
|
139
|
-
return o.length ? o.map((t) => ({
|
|
140
|
-
label: t,
|
|
141
|
-
onSelect: c(E(n, t)[0]),
|
|
142
|
-
active: e?.loopGroup === n && d?.sub === t
|
|
143
|
-
})) : [{
|
|
144
|
-
label: i ?? O(n).label,
|
|
145
|
-
onSelect: c(a[0]),
|
|
146
|
-
active: e?.loopGroup === n
|
|
147
|
-
}];
|
|
148
|
-
}, p = (e) => e.groups.flatMap((t) => {
|
|
149
|
-
let n = e.labels?.[t] ?? O(t).label, r = T(t).some((e) => e.sub), i = f(t, "loop", n);
|
|
150
|
-
return e.groups.length > 1 && r ? [{
|
|
151
|
-
label: n,
|
|
152
|
-
children: i
|
|
153
|
-
}] : i;
|
|
154
|
-
});
|
|
155
|
-
return [
|
|
156
|
-
{
|
|
157
|
-
id: "sec:effects",
|
|
158
|
-
label: "Effects"
|
|
159
|
-
},
|
|
160
|
-
...oe(z).map((t) => ({
|
|
161
|
-
id: `fx:${t.id}`,
|
|
162
|
-
label: t.label,
|
|
163
|
-
icon: $[`fx:${t.id}`] ?? "square",
|
|
164
|
-
pages: t.rack ? ie.map((t) => ({
|
|
165
|
-
label: t.label,
|
|
166
|
-
onSelect: () => o(t.id),
|
|
167
|
-
active: e?.fxGroup === t.id
|
|
168
|
-
})) : t.id === "pattern" ? xt.map((t) => ({
|
|
169
|
-
label: t,
|
|
170
|
-
onSelect: () => s(E("optic", t)[0], "optic"),
|
|
171
|
-
active: e?.loopGroup === "optic" && d?.sub === t
|
|
172
|
-
})) : t.id === "scanline" ? St.map((t) => ({
|
|
173
|
-
label: t.label,
|
|
174
|
-
onSelect: () => a("scanline", t.patch),
|
|
175
|
-
active: !e?.fxGroup && u === "scanline" && Ct(e?.filters?.[0]?.params) === t.label
|
|
176
|
-
})) : t.filters.map((t) => ({
|
|
177
|
-
label: t.label ?? t.id,
|
|
178
|
-
onSelect: () => a(t.id),
|
|
179
|
-
active: !e?.fxGroup && u === t.id
|
|
180
|
-
}))
|
|
181
|
-
})),
|
|
182
|
-
{
|
|
183
|
-
id: "sec:generative",
|
|
184
|
-
label: "Generative"
|
|
185
|
-
},
|
|
186
|
-
...P.map((e) => ({
|
|
187
|
-
id: `gen:${e.label}`,
|
|
188
|
-
label: e.label,
|
|
189
|
-
icon: $[`gen:${e.label}`] ?? "square",
|
|
190
|
-
pages: p(e)
|
|
191
|
-
})),
|
|
192
|
-
{
|
|
193
|
-
id: "sec:vector",
|
|
194
|
-
label: "Vector"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
id: "vec:Distressor",
|
|
198
|
-
label: "Distressor",
|
|
199
|
-
icon: $["vec:Distressor"] ?? "square",
|
|
200
|
-
pages: f("distress")
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
id: "vec:Modulator",
|
|
204
|
-
label: "Modulator",
|
|
205
|
-
icon: $["vec:Modulator"] ?? "square",
|
|
206
|
-
pages: f("modulator")
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
id: "sec:composition",
|
|
210
|
-
label: "Composition"
|
|
211
|
-
},
|
|
212
|
-
...pe.map((t) => ({
|
|
213
|
-
id: `kin:${t.label}`,
|
|
214
|
-
label: t.label,
|
|
215
|
-
icon: $[`kin:${t.label}`] ?? "square",
|
|
216
|
-
pages: t.subs.map((t) => ({
|
|
217
|
-
label: t,
|
|
218
|
-
onSelect: () => c(V.find((e) => e.sub === t)),
|
|
219
|
-
active: e?.type === "kinetic" && V.some((e) => e.sub === t && e.id === l)
|
|
220
|
-
}))
|
|
221
|
-
})),
|
|
222
|
-
...M.map((e) => ({
|
|
223
|
-
id: `misc:${e.label}`,
|
|
224
|
-
label: e.label,
|
|
225
|
-
icon: $[`misc:${e.label}`] ?? "square",
|
|
226
|
-
pages: e.groups.flatMap((e) => f(e, "misc"))
|
|
227
|
-
})),
|
|
228
|
-
{
|
|
229
|
-
id: "sec:modulation",
|
|
230
|
-
label: "Modulation"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
id: "mod:animation",
|
|
234
|
-
label: "Animation",
|
|
235
|
-
icon: "frequency",
|
|
236
|
-
onSelect: () => window.dispatchEvent(new CustomEvent("kol:open-params"))
|
|
237
|
-
}
|
|
238
|
-
];
|
|
239
|
-
}
|
|
240
|
-
//#endregion
|
|
241
38
|
//#region src/editor/labs/LabsNav.jsx
|
|
242
|
-
function
|
|
243
|
-
let { addFilter: e, patchFilter:
|
|
244
|
-
|
|
39
|
+
function Et() {
|
|
40
|
+
let { addFilter: e, patchFilter: t } = u(), { layer: r, setOnly: i } = $(), a = Y(null);
|
|
41
|
+
J(() => {
|
|
245
42
|
r?.type === "photo" && r.src && (a.current = {
|
|
246
43
|
src: r.src,
|
|
247
44
|
srcType: r.srcType,
|
|
@@ -253,193 +50,53 @@ function Tt() {
|
|
|
253
50
|
r?.srcType,
|
|
254
51
|
r?.fit
|
|
255
52
|
]);
|
|
256
|
-
let o =
|
|
53
|
+
let o = he({
|
|
257
54
|
layer: r,
|
|
258
55
|
setOnly: i,
|
|
259
56
|
addFilter: e,
|
|
260
|
-
patchFilter:
|
|
57
|
+
patchFilter: t,
|
|
261
58
|
carriedSource: () => r?.type === "photo" ? {
|
|
262
59
|
src: r.src,
|
|
263
60
|
srcType: r.srcType,
|
|
264
61
|
fit: r.fit
|
|
265
62
|
} : a.current ?? {}
|
|
266
63
|
});
|
|
267
|
-
return
|
|
268
|
-
let e = /* @__PURE__ */ new Map(),
|
|
269
|
-
o.forEach((
|
|
270
|
-
if (
|
|
271
|
-
let e =
|
|
272
|
-
|
|
273
|
-
icon:
|
|
274
|
-
path: `${
|
|
275
|
-
label:
|
|
64
|
+
return J(() => {
|
|
65
|
+
let e = /* @__PURE__ */ new Map(), t = [];
|
|
66
|
+
o.forEach((n) => {
|
|
67
|
+
if (n.id.startsWith("sec:")) {
|
|
68
|
+
let e = n.id.slice(4);
|
|
69
|
+
t.push({
|
|
70
|
+
icon: pt[e] ?? "square",
|
|
71
|
+
path: `${Qe}${n.id}`,
|
|
72
|
+
label: n.label,
|
|
276
73
|
sub: []
|
|
277
74
|
});
|
|
278
75
|
return;
|
|
279
76
|
}
|
|
280
|
-
let r = `${
|
|
77
|
+
let r = `${Qe}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
|
|
281
78
|
a && e.set(r, a);
|
|
282
|
-
let o =
|
|
283
|
-
icon:
|
|
79
|
+
let o = t[t.length - 1], s = {
|
|
80
|
+
icon: n.icon,
|
|
284
81
|
path: r,
|
|
285
|
-
label:
|
|
82
|
+
label: n.label
|
|
286
83
|
};
|
|
287
|
-
o?.sub ? o.sub.push(s) :
|
|
84
|
+
o?.sub ? o.sub.push(s) : t.push(s);
|
|
288
85
|
});
|
|
289
|
-
let r =
|
|
290
|
-
return
|
|
291
|
-
items:
|
|
292
|
-
dispatch: (
|
|
293
|
-
let i = e.get(
|
|
294
|
-
return i ? (i(), r &&
|
|
86
|
+
let r = Me() && !Se();
|
|
87
|
+
return rt({
|
|
88
|
+
items: t,
|
|
89
|
+
dispatch: (t) => {
|
|
90
|
+
let i = e.get(t);
|
|
91
|
+
return i ? (i(), r && n.play(), !0) : !1;
|
|
295
92
|
}
|
|
296
|
-
}), () =>
|
|
93
|
+
}), () => rt(null);
|
|
297
94
|
}), null;
|
|
298
95
|
}
|
|
299
96
|
//#endregion
|
|
300
|
-
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
301
|
-
function Et(e) {
|
|
302
|
-
let { patch: t } = ne(e.id), n = q(null), [r, i] = J(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
303
|
-
return {
|
|
304
|
-
nodes: /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X("input", {
|
|
305
|
-
ref: n,
|
|
306
|
-
type: "file",
|
|
307
|
-
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
308
|
-
className: "hidden",
|
|
309
|
-
onChange: (n) => {
|
|
310
|
-
let r = n.target.files?.[0];
|
|
311
|
-
if (n.target.value = "", !r) return;
|
|
312
|
-
if (a) {
|
|
313
|
-
let e = new FileReader();
|
|
314
|
-
e.onload = () => t({ svgSrc: e.result }), e.readAsText(r);
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
if (r.type.startsWith("video/")) {
|
|
318
|
-
b(e.id, r), t({
|
|
319
|
-
src: URL.createObjectURL(r),
|
|
320
|
-
srcType: "video"
|
|
321
|
-
});
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
let i = new FileReader();
|
|
325
|
-
i.onload = () => t({
|
|
326
|
-
src: i.result,
|
|
327
|
-
srcType: "image"
|
|
328
|
-
}), i.readAsDataURL(r);
|
|
329
|
-
}
|
|
330
|
-
}), /* @__PURE__ */ X(Ue, {
|
|
331
|
-
open: r,
|
|
332
|
-
onClose: () => i(!1),
|
|
333
|
-
onPick: (e, { contentType: n } = {}) => {
|
|
334
|
-
if (a) {
|
|
335
|
-
t({ svgSrc: it(e) });
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
t({
|
|
339
|
-
src: it(e),
|
|
340
|
-
srcType: Le(n) ? "video" : "image"
|
|
341
|
-
});
|
|
342
|
-
},
|
|
343
|
-
accept: a ? "svg" : "all"
|
|
344
|
-
})] }),
|
|
345
|
-
svgMode: a,
|
|
346
|
-
openLibrary: () => i(!0),
|
|
347
|
-
openUpload: () => n.current?.click(),
|
|
348
|
-
openCamera: () => {
|
|
349
|
-
ot(e.id).then(() => t({
|
|
350
|
-
src: null,
|
|
351
|
-
srcType: "webcam"
|
|
352
|
-
})).catch(() => {});
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
function Dt({ layer: e }) {
|
|
357
|
-
let t = i(), n = Et(e);
|
|
358
|
-
return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(W, {
|
|
359
|
-
variant: "filled",
|
|
360
|
-
value: null,
|
|
361
|
-
onChange: (e) => ({
|
|
362
|
-
library: n.openLibrary,
|
|
363
|
-
upload: n.openUpload,
|
|
364
|
-
camera: n.openCamera
|
|
365
|
-
})[e]?.(),
|
|
366
|
-
options: n.svgMode ? kt : Ot,
|
|
367
|
-
size: t,
|
|
368
|
-
ariaLabel: "Source",
|
|
369
|
-
className: C(t)
|
|
370
|
-
}), n.nodes] });
|
|
371
|
-
}
|
|
372
|
-
var Ot = [
|
|
373
|
-
{
|
|
374
|
-
value: "library",
|
|
375
|
-
label: "Library"
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
value: "upload",
|
|
379
|
-
label: "Upload"
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
value: "camera",
|
|
383
|
-
label: "Camera"
|
|
384
|
-
}
|
|
385
|
-
], kt = Ot.slice(0, 2);
|
|
386
|
-
function At({ layer: e }) {
|
|
387
|
-
let t = Et(e), n = "flex-1 flex flex-col items-center justify-center gap-3 cursor-pointer text-oq-48 hover:text-emphasis hover:bg-oq-02 transition-colors";
|
|
388
|
-
return /* @__PURE__ */ Z("div", {
|
|
389
|
-
className: "w-full h-full flex items-stretch p-6 gap-px",
|
|
390
|
-
children: [
|
|
391
|
-
/* @__PURE__ */ Z("button", {
|
|
392
|
-
type: "button",
|
|
393
|
-
className: n,
|
|
394
|
-
onClick: t.openLibrary,
|
|
395
|
-
children: [/* @__PURE__ */ X(Q, {
|
|
396
|
-
name: "image",
|
|
397
|
-
size: 28
|
|
398
|
-
}), /* @__PURE__ */ X("span", {
|
|
399
|
-
className: "kol-mono-12",
|
|
400
|
-
children: "From library"
|
|
401
|
-
})]
|
|
402
|
-
}),
|
|
403
|
-
/* @__PURE__ */ X("div", {
|
|
404
|
-
className: "w-px",
|
|
405
|
-
style: { background: "var(--kol-oq-08)" }
|
|
406
|
-
}),
|
|
407
|
-
/* @__PURE__ */ Z("button", {
|
|
408
|
-
type: "button",
|
|
409
|
-
className: n,
|
|
410
|
-
onClick: t.openUpload,
|
|
411
|
-
children: [/* @__PURE__ */ X(Q, {
|
|
412
|
-
name: "upload",
|
|
413
|
-
size: 28
|
|
414
|
-
}), /* @__PURE__ */ X("span", {
|
|
415
|
-
className: "kol-mono-12",
|
|
416
|
-
children: "Upload"
|
|
417
|
-
})]
|
|
418
|
-
}),
|
|
419
|
-
/* @__PURE__ */ X("div", {
|
|
420
|
-
className: "w-px",
|
|
421
|
-
style: { background: "var(--kol-oq-08)" }
|
|
422
|
-
}),
|
|
423
|
-
/* @__PURE__ */ Z("button", {
|
|
424
|
-
type: "button",
|
|
425
|
-
className: n,
|
|
426
|
-
onClick: t.openCamera,
|
|
427
|
-
children: [/* @__PURE__ */ X(Q, {
|
|
428
|
-
name: "camera",
|
|
429
|
-
size: 28
|
|
430
|
-
}), /* @__PURE__ */ X("span", {
|
|
431
|
-
className: "kol-mono-12",
|
|
432
|
-
children: "Camera"
|
|
433
|
-
})]
|
|
434
|
-
}),
|
|
435
|
-
t.nodes
|
|
436
|
-
]
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
//#endregion
|
|
440
97
|
//#region src/editor/labs/LabsParams.jsx
|
|
441
|
-
function
|
|
442
|
-
|
|
98
|
+
function Dt(e, t) {
|
|
99
|
+
J(() => {
|
|
443
100
|
let n = (n) => {
|
|
444
101
|
if (n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey) return;
|
|
445
102
|
let r = n.target;
|
|
@@ -448,13 +105,13 @@ function jt(e, t) {
|
|
|
448
105
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
449
106
|
});
|
|
450
107
|
}
|
|
451
|
-
var
|
|
108
|
+
var Ot = [{
|
|
452
109
|
value: "effect",
|
|
453
110
|
label: "Effect"
|
|
454
111
|
}, {
|
|
455
112
|
value: "anim",
|
|
456
113
|
label: "Motion"
|
|
457
|
-
}],
|
|
114
|
+
}], kt = [
|
|
458
115
|
{
|
|
459
116
|
value: "generate",
|
|
460
117
|
label: "Generate"
|
|
@@ -467,7 +124,7 @@ var Mt = [{
|
|
|
467
124
|
value: "anim",
|
|
468
125
|
label: "Animation"
|
|
469
126
|
}
|
|
470
|
-
],
|
|
127
|
+
], At = [
|
|
471
128
|
{
|
|
472
129
|
value: "generate",
|
|
473
130
|
label: "Gen"
|
|
@@ -481,67 +138,68 @@ var Mt = [{
|
|
|
481
138
|
label: "Anim"
|
|
482
139
|
}
|
|
483
140
|
];
|
|
484
|
-
function
|
|
485
|
-
|
|
141
|
+
function jt({ options: e, active: t, onPick: n, spread: i = !1, pills: a = !1 }) {
|
|
142
|
+
let o = r();
|
|
143
|
+
return e?.length ? a ? /* @__PURE__ */ Z("div", {
|
|
486
144
|
className: "flex items-center gap-1 flex-wrap",
|
|
487
|
-
children: e.map((e) => /* @__PURE__ */
|
|
145
|
+
children: e.map((e) => /* @__PURE__ */ Z("button", {
|
|
488
146
|
type: "button",
|
|
489
147
|
onClick: () => n(e.value),
|
|
490
148
|
className: `px-2 py-0.5 rounded kol-helper-10 tracking-widest border transition-colors cursor-pointer ${e.value === t ? "bg-fg-16 border-oq-24 text-emphasis" : "bg-transparent border-oq-08 text-meta hover:border-oq-16 hover:text-body"}`,
|
|
491
149
|
children: e.label
|
|
492
150
|
}, e.value))
|
|
493
|
-
}) : /* @__PURE__ */
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}, e.value))
|
|
151
|
+
}) : /* @__PURE__ */ Z(q, {
|
|
152
|
+
value: t ?? null,
|
|
153
|
+
onChange: n,
|
|
154
|
+
options: e,
|
|
155
|
+
size: o,
|
|
156
|
+
ariaLabel: "Siblings",
|
|
157
|
+
className: S(o)
|
|
501
158
|
}) : null;
|
|
502
159
|
}
|
|
503
|
-
function
|
|
504
|
-
|
|
505
|
-
|
|
160
|
+
function Mt({ chips: e, active: t, onPick: n, spread: i, pills: a, title: o, tabStrip: s, preStrip: c, fx: l = !1, children: u }) {
|
|
161
|
+
let d = r() === "sm";
|
|
162
|
+
return /* @__PURE__ */ Q("div", {
|
|
163
|
+
className: `flex flex-col gap-5${l ? " kol-labs-fx" : ""}`,
|
|
506
164
|
children: [
|
|
507
|
-
|
|
165
|
+
o && d && /* @__PURE__ */ Z("p", {
|
|
508
166
|
className: "kol-eyebrow text-fg-96",
|
|
509
|
-
children:
|
|
167
|
+
children: o
|
|
510
168
|
}),
|
|
511
|
-
e && /* @__PURE__ */
|
|
169
|
+
e && /* @__PURE__ */ Z(jt, {
|
|
512
170
|
options: e,
|
|
513
171
|
active: t,
|
|
514
172
|
onPick: n,
|
|
515
|
-
spread:
|
|
516
|
-
pills:
|
|
173
|
+
spread: i,
|
|
174
|
+
pills: a
|
|
517
175
|
}),
|
|
176
|
+
c,
|
|
518
177
|
s,
|
|
519
|
-
|
|
520
|
-
l
|
|
178
|
+
u
|
|
521
179
|
]
|
|
522
180
|
});
|
|
523
181
|
}
|
|
524
|
-
function
|
|
525
|
-
let
|
|
526
|
-
|
|
182
|
+
function Nt({ layer: n, showMod: a }) {
|
|
183
|
+
let o = r(), [s, c] = X("effect");
|
|
184
|
+
J(() => {
|
|
527
185
|
let e = () => c("effect");
|
|
528
186
|
return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
|
|
529
187
|
}, []);
|
|
530
|
-
let { addFilter: l, replaceFilter:
|
|
188
|
+
let { addFilter: l, replaceFilter: d, removeFilter: f, toggleFilter: m, updateLayer: h, palette: g } = u(), _ = M(n.id, { history: "coalesce" }), v = t(n), y = v[0] ?? null, x = z(I).find((e) => e.id === R(y?.id)), ee = x?.id === "halftone", C = ee ? (x?.filters ?? []).map((e) => ({
|
|
531
189
|
value: e.id,
|
|
532
190
|
label: e.label
|
|
533
|
-
})) : null,
|
|
191
|
+
})) : null, te = !ee && y ? y.def.label : null, ne = (e) => {
|
|
534
192
|
if (!y) {
|
|
535
|
-
l(
|
|
193
|
+
l(n.id, e);
|
|
536
194
|
return;
|
|
537
195
|
}
|
|
538
|
-
e !== y.id &&
|
|
539
|
-
},
|
|
540
|
-
...
|
|
196
|
+
e !== y.id && d(n.id, 0, e);
|
|
197
|
+
}, w = v.map(({ def: e, ...t }) => t), T = y ? {
|
|
198
|
+
...n,
|
|
541
199
|
...y.params,
|
|
542
|
-
id:
|
|
543
|
-
} :
|
|
544
|
-
let r =
|
|
200
|
+
id: n.id
|
|
201
|
+
} : n, E = (e) => (t, n) => {
|
|
202
|
+
let r = w.map((r, i) => i === e ? {
|
|
545
203
|
...r,
|
|
546
204
|
params: {
|
|
547
205
|
...r.params,
|
|
@@ -549,249 +207,245 @@ function Lt({ layer: t, showMod: n }) {
|
|
|
549
207
|
}
|
|
550
208
|
} : r);
|
|
551
209
|
_.patch({ filters: r });
|
|
552
|
-
},
|
|
553
|
-
layer:
|
|
210
|
+
}, D = E(0), re = a ? (e) => /* @__PURE__ */ Z(B, {
|
|
211
|
+
layer: T,
|
|
554
212
|
param: e,
|
|
555
|
-
setProp:
|
|
556
|
-
}) : void 0,
|
|
557
|
-
let
|
|
213
|
+
setProp: D
|
|
214
|
+
}) : void 0, O = (e) => {
|
|
215
|
+
let t = w.map((t, n) => n === 0 ? {
|
|
558
216
|
...t,
|
|
559
217
|
params: {
|
|
560
218
|
...t.params,
|
|
561
219
|
...e
|
|
562
220
|
}
|
|
563
221
|
} : t);
|
|
564
|
-
|
|
222
|
+
h(n.id, { filters: t });
|
|
565
223
|
};
|
|
566
|
-
|
|
567
|
-
y &&
|
|
224
|
+
Dt(() => {
|
|
225
|
+
y && h(n.id, { filters: w.map((e, t) => t === 0 ? {
|
|
568
226
|
...e,
|
|
569
227
|
params: {}
|
|
570
228
|
} : e) });
|
|
571
229
|
}, () => {
|
|
572
|
-
y &&
|
|
230
|
+
y && O(i(T, p(y.def.params, T), b()));
|
|
573
231
|
});
|
|
574
|
-
let
|
|
575
|
-
if (
|
|
232
|
+
let A = n.fxGroup ? se.find((e) => e.id === n.fxGroup) : null;
|
|
233
|
+
if (A) {
|
|
576
234
|
let e = {
|
|
577
235
|
chain: v,
|
|
578
|
-
layer:
|
|
579
|
-
hostView:
|
|
580
|
-
toggleFilter:
|
|
581
|
-
removeFilter:
|
|
582
|
-
setStagePropAt:
|
|
236
|
+
layer: n,
|
|
237
|
+
hostView: T,
|
|
238
|
+
toggleFilter: m,
|
|
239
|
+
removeFilter: f,
|
|
240
|
+
setStagePropAt: E,
|
|
583
241
|
palette: g,
|
|
584
|
-
showMod:
|
|
585
|
-
},
|
|
242
|
+
showMod: a
|
|
243
|
+
}, t = [{
|
|
586
244
|
value: "",
|
|
587
245
|
label: "Add effect…"
|
|
588
|
-
}, ...
|
|
246
|
+
}, ...ie(A, I).map((e) => ({
|
|
589
247
|
value: e.id,
|
|
590
248
|
label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
|
|
591
249
|
}))];
|
|
592
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ Q(Mt, {
|
|
593
251
|
title: "Effects",
|
|
594
252
|
fx: !0,
|
|
595
|
-
tabStrip: /* @__PURE__ */
|
|
596
|
-
|
|
597
|
-
value: o,
|
|
253
|
+
tabStrip: /* @__PURE__ */ Z(q, {
|
|
254
|
+
value: s,
|
|
598
255
|
onChange: c,
|
|
599
|
-
options:
|
|
600
|
-
size:
|
|
601
|
-
className:
|
|
256
|
+
options: Ot,
|
|
257
|
+
size: o,
|
|
258
|
+
className: S(o)
|
|
602
259
|
}),
|
|
603
|
-
children: [
|
|
604
|
-
/* @__PURE__ */
|
|
260
|
+
children: [s === "effect" && /* @__PURE__ */ Q(St, { children: [
|
|
261
|
+
/* @__PURE__ */ Q(gt, {
|
|
605
262
|
label: "Effect Stack",
|
|
606
263
|
divided: !0,
|
|
607
|
-
children: [v.length === 0 && /* @__PURE__ */
|
|
264
|
+
children: [v.length === 0 && /* @__PURE__ */ Z(j, {
|
|
608
265
|
className: "kol-mono-10 text-meta",
|
|
609
266
|
children: "No effects yet — add one below."
|
|
610
|
-
}), /* @__PURE__ */
|
|
267
|
+
}), /* @__PURE__ */ Z(Pt, {
|
|
611
268
|
...e,
|
|
612
269
|
from: 0
|
|
613
270
|
})]
|
|
614
271
|
}),
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
label:
|
|
272
|
+
/* @__PURE__ */ Z(mt, {}),
|
|
273
|
+
/* @__PURE__ */ Z(gt, {
|
|
274
|
+
label: A.label,
|
|
618
275
|
divided: !0,
|
|
619
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ Z(ht, {
|
|
620
277
|
variant: "subtle",
|
|
621
|
-
size:
|
|
278
|
+
size: o,
|
|
622
279
|
className: "w-full",
|
|
623
|
-
options:
|
|
280
|
+
options: t,
|
|
624
281
|
value: "",
|
|
625
282
|
disabled: v.length >= 8,
|
|
626
283
|
onChange: (e) => {
|
|
627
|
-
e && l(
|
|
284
|
+
e && l(n.id, e);
|
|
628
285
|
}
|
|
629
286
|
})
|
|
630
287
|
})
|
|
631
|
-
] }),
|
|
288
|
+
] }), s === "anim" && y?.def?.sweeps && /* @__PURE__ */ Z(V, {
|
|
632
289
|
sweeps: Array.isArray(y.params.sweeps) ? y.params.sweeps : [],
|
|
633
|
-
onChange: (e) =>
|
|
290
|
+
onChange: (e) => D("sweeps", e),
|
|
634
291
|
inline: !0
|
|
635
292
|
})]
|
|
636
293
|
});
|
|
637
294
|
}
|
|
638
|
-
if (!y) return /* @__PURE__ */
|
|
639
|
-
chips:
|
|
295
|
+
if (!y) return /* @__PURE__ */ Z(Mt, {
|
|
296
|
+
chips: C,
|
|
640
297
|
active: null,
|
|
641
|
-
onPick:
|
|
642
|
-
spread:
|
|
298
|
+
onPick: ne,
|
|
299
|
+
spread: ee,
|
|
643
300
|
fx: !0,
|
|
644
|
-
tabStrip: /* @__PURE__ */
|
|
645
|
-
|
|
646
|
-
value: o,
|
|
301
|
+
tabStrip: /* @__PURE__ */ Z(q, {
|
|
302
|
+
value: s,
|
|
647
303
|
onChange: c,
|
|
648
|
-
options:
|
|
649
|
-
size:
|
|
650
|
-
className:
|
|
304
|
+
options: Ot,
|
|
305
|
+
size: o,
|
|
306
|
+
className: S(o)
|
|
651
307
|
}),
|
|
652
|
-
children: /* @__PURE__ */
|
|
653
|
-
schema:
|
|
654
|
-
layer:
|
|
308
|
+
children: /* @__PURE__ */ Z(k, {
|
|
309
|
+
schema: ct,
|
|
310
|
+
layer: n,
|
|
655
311
|
setProp: _.setProp,
|
|
656
312
|
palette: g,
|
|
657
|
-
renderAnimate: (e) => /* @__PURE__ */
|
|
658
|
-
layer:
|
|
313
|
+
renderAnimate: (e) => /* @__PURE__ */ Z(B, {
|
|
314
|
+
layer: n,
|
|
659
315
|
param: e,
|
|
660
316
|
setProp: _.setProp
|
|
661
317
|
}),
|
|
662
|
-
tab:
|
|
318
|
+
tab: s === "anim" ? "anim" : "style",
|
|
663
319
|
emptyHint: "Pick an effect from the nav."
|
|
664
320
|
})
|
|
665
321
|
});
|
|
666
|
-
let
|
|
667
|
-
if (
|
|
668
|
-
let e =
|
|
669
|
-
for (; e + 1 <
|
|
670
|
-
|
|
322
|
+
let N = y.def.params.filter((t) => e(t) !== "anim"), P = oe(y.def.id), F = P ? N.findIndex((e) => e.key === P) : -1, L = N.length;
|
|
323
|
+
if (F >= 0) {
|
|
324
|
+
let e = F;
|
|
325
|
+
for (; e + 1 < N.length && N[e + 1].type === "select";) e++;
|
|
326
|
+
L = e + 1;
|
|
671
327
|
}
|
|
672
|
-
let
|
|
328
|
+
let ae = F > 0 ? N.slice(0, F) : [], le = F >= 0 ? N.slice(F, L).map((e) => ({
|
|
673
329
|
...e,
|
|
674
330
|
section: void 0
|
|
675
|
-
})) :
|
|
676
|
-
layer:
|
|
677
|
-
setProp:
|
|
331
|
+
})) : N, H = {
|
|
332
|
+
layer: T,
|
|
333
|
+
setProp: D,
|
|
678
334
|
palette: g,
|
|
679
|
-
renderAnimate:
|
|
335
|
+
renderAnimate: re,
|
|
680
336
|
inline: !0
|
|
681
337
|
};
|
|
682
|
-
return /* @__PURE__ */
|
|
683
|
-
chips:
|
|
338
|
+
return /* @__PURE__ */ Q(Mt, {
|
|
339
|
+
chips: C,
|
|
684
340
|
active: y.id,
|
|
685
|
-
onPick:
|
|
686
|
-
spread:
|
|
687
|
-
title:
|
|
341
|
+
onPick: ne,
|
|
342
|
+
spread: ee,
|
|
343
|
+
title: te,
|
|
688
344
|
fx: !0,
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
variant: "filled",
|
|
692
|
-
value: o,
|
|
345
|
+
tabStrip: /* @__PURE__ */ Z(q, {
|
|
346
|
+
value: s,
|
|
693
347
|
onChange: c,
|
|
694
|
-
options:
|
|
695
|
-
size:
|
|
696
|
-
className:
|
|
348
|
+
options: Ot,
|
|
349
|
+
size: o,
|
|
350
|
+
className: S(o)
|
|
697
351
|
}),
|
|
698
|
-
children: [
|
|
699
|
-
|
|
700
|
-
schema:
|
|
701
|
-
...
|
|
352
|
+
children: [s === "effect" && /* @__PURE__ */ Q(St, { children: [
|
|
353
|
+
ae.length > 0 && /* @__PURE__ */ Z(k, {
|
|
354
|
+
schema: ae,
|
|
355
|
+
...H
|
|
702
356
|
}),
|
|
703
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ Q(gt, {
|
|
704
358
|
divided: !0,
|
|
705
|
-
children: [/* @__PURE__ */
|
|
706
|
-
schema:
|
|
707
|
-
...
|
|
708
|
-
}), /* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ Z(k, {
|
|
360
|
+
schema: le,
|
|
361
|
+
...H
|
|
362
|
+
}), /* @__PURE__ */ Z(ce, {
|
|
709
363
|
inline: !0,
|
|
710
364
|
def: y.def,
|
|
711
|
-
view:
|
|
365
|
+
view: T,
|
|
712
366
|
tab: "effect",
|
|
713
|
-
onPatch:
|
|
367
|
+
onPatch: O
|
|
714
368
|
})]
|
|
715
369
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
-
|
|
718
|
-
schema:
|
|
719
|
-
...
|
|
720
|
-
}), /* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ Z(mt, {}),
|
|
371
|
+
L < N.length && /* @__PURE__ */ Q(St, { children: [/* @__PURE__ */ Z(k, {
|
|
372
|
+
schema: N.slice(L),
|
|
373
|
+
...H
|
|
374
|
+
}), /* @__PURE__ */ Z(mt, {})] }),
|
|
375
|
+
/* @__PURE__ */ Z(Ft, {
|
|
722
376
|
chain: v,
|
|
723
|
-
layer:
|
|
724
|
-
hostView:
|
|
377
|
+
layer: n,
|
|
378
|
+
hostView: T,
|
|
725
379
|
addFilter: l,
|
|
726
|
-
removeFilter:
|
|
727
|
-
toggleFilter:
|
|
728
|
-
setStagePropAt:
|
|
380
|
+
removeFilter: f,
|
|
381
|
+
toggleFilter: m,
|
|
382
|
+
setStagePropAt: E,
|
|
729
383
|
palette: g,
|
|
730
|
-
showMod:
|
|
384
|
+
showMod: a
|
|
731
385
|
})
|
|
732
|
-
] }),
|
|
733
|
-
/* @__PURE__ */
|
|
386
|
+
] }), s === "anim" && /* @__PURE__ */ Q(St, { children: [
|
|
387
|
+
/* @__PURE__ */ Z(k, {
|
|
734
388
|
schema: y.def.params,
|
|
735
|
-
...
|
|
389
|
+
...H,
|
|
736
390
|
tab: "anim"
|
|
737
391
|
}),
|
|
738
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ Z(ce, {
|
|
739
393
|
inline: !0,
|
|
740
394
|
def: y.def,
|
|
741
|
-
view:
|
|
395
|
+
view: T,
|
|
742
396
|
tab: "anim",
|
|
743
|
-
onPatch:
|
|
397
|
+
onPatch: O
|
|
744
398
|
}),
|
|
745
|
-
y.def.sweeps && /* @__PURE__ */
|
|
399
|
+
y.def.sweeps && /* @__PURE__ */ Z(V, {
|
|
746
400
|
sweeps: Array.isArray(y.params.sweeps) ? y.params.sweeps : [],
|
|
747
|
-
onChange: (e) =>
|
|
401
|
+
onChange: (e) => D("sweeps", e),
|
|
748
402
|
inline: !0
|
|
749
403
|
})
|
|
750
404
|
] })]
|
|
751
405
|
});
|
|
752
406
|
}
|
|
753
|
-
function
|
|
754
|
-
let d =
|
|
755
|
-
return t.slice(n).map((t,
|
|
756
|
-
let f =
|
|
407
|
+
function Pt({ chain: t, from: n = 0, layer: i, hostView: a, toggleFilter: o, removeFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
|
|
408
|
+
let d = r();
|
|
409
|
+
return t.slice(n).map((t, r) => {
|
|
410
|
+
let f = r + n, p = t.enabled !== !1, m = {
|
|
757
411
|
...a,
|
|
758
412
|
...t.params,
|
|
759
|
-
id:
|
|
413
|
+
id: i.id
|
|
760
414
|
}, h = c(f);
|
|
761
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ Q("div", {
|
|
762
416
|
className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
|
|
763
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
764
418
|
className: "flex items-center gap-2",
|
|
765
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ Z(_t, {
|
|
766
420
|
size: d,
|
|
767
421
|
checked: p,
|
|
768
|
-
onChange: () => o(
|
|
422
|
+
onChange: () => o(i.id, f),
|
|
769
423
|
label: t.def?.label ?? t.id
|
|
770
|
-
}), /* @__PURE__ */
|
|
424
|
+
}), /* @__PURE__ */ Z(vt, {
|
|
771
425
|
asChild: !0,
|
|
772
426
|
label: "Remove effect",
|
|
773
|
-
children: /* @__PURE__ */
|
|
427
|
+
children: /* @__PURE__ */ Z("button", {
|
|
774
428
|
type: "button",
|
|
775
429
|
"aria-label": "Remove effect",
|
|
776
|
-
onClick: () => s(
|
|
430
|
+
onClick: () => s(i.id, f),
|
|
777
431
|
className: "ml-auto inline-flex items-center justify-center w-5 h-5 shrink-0 text-oq-64 hover:text-emphasis cursor-pointer",
|
|
778
432
|
style: {
|
|
779
433
|
border: "none",
|
|
780
434
|
background: "transparent"
|
|
781
435
|
},
|
|
782
|
-
children: /* @__PURE__ */
|
|
436
|
+
children: /* @__PURE__ */ Z(Ct, {
|
|
783
437
|
name: "x",
|
|
784
438
|
size: 12
|
|
785
439
|
})
|
|
786
440
|
})
|
|
787
441
|
})]
|
|
788
|
-
}), p && t.def && /* @__PURE__ */
|
|
442
|
+
}), p && t.def && /* @__PURE__ */ Z(k, {
|
|
789
443
|
schema: t.def.params.filter((t) => e(t) !== "anim"),
|
|
790
444
|
layer: m,
|
|
791
445
|
setProp: h,
|
|
792
446
|
palette: l,
|
|
793
447
|
inline: !0,
|
|
794
|
-
renderAnimate: u ? (e) => /* @__PURE__ */
|
|
448
|
+
renderAnimate: u ? (e) => /* @__PURE__ */ Z(B, {
|
|
795
449
|
layer: m,
|
|
796
450
|
param: e,
|
|
797
451
|
setProp: h
|
|
@@ -800,18 +454,18 @@ function Rt({ chain: t, from: n = 0, layer: r, hostView: a, toggleFilter: o, rem
|
|
|
800
454
|
}, t.key ?? f);
|
|
801
455
|
});
|
|
802
456
|
}
|
|
803
|
-
function
|
|
804
|
-
let u =
|
|
457
|
+
function Ft({ chain: e, layer: t, hostView: n, addFilter: i, removeFilter: a, toggleFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
|
|
458
|
+
let u = r(), d = [{
|
|
805
459
|
value: "",
|
|
806
460
|
label: "Add FX..."
|
|
807
|
-
}, ...
|
|
461
|
+
}, ...ae(I).map((e) => ({
|
|
808
462
|
value: e.id,
|
|
809
463
|
label: e.label ?? e.id
|
|
810
464
|
}))];
|
|
811
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ Q(gt, {
|
|
812
466
|
label: "Post-Processing",
|
|
813
467
|
divided: !0,
|
|
814
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ Z(Pt, {
|
|
815
469
|
chain: e,
|
|
816
470
|
from: 1,
|
|
817
471
|
layer: t,
|
|
@@ -821,7 +475,7 @@ function zt({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, to
|
|
|
821
475
|
setStagePropAt: s,
|
|
822
476
|
palette: c,
|
|
823
477
|
showMod: l
|
|
824
|
-
}), /* @__PURE__ */
|
|
478
|
+
}), /* @__PURE__ */ Z(ht, {
|
|
825
479
|
variant: "subtle",
|
|
826
480
|
size: u,
|
|
827
481
|
className: "w-full",
|
|
@@ -829,341 +483,475 @@ function zt({ chain: e, layer: t, hostView: n, addFilter: r, removeFilter: a, to
|
|
|
829
483
|
value: "",
|
|
830
484
|
disabled: e.length >= 8,
|
|
831
485
|
onChange: (e) => {
|
|
832
|
-
e &&
|
|
486
|
+
e && i(t.id, e);
|
|
833
487
|
}
|
|
834
488
|
})]
|
|
835
489
|
});
|
|
836
490
|
}
|
|
837
|
-
function
|
|
838
|
-
let
|
|
491
|
+
function It({ layer: e, showMod: t, tree: n }) {
|
|
492
|
+
let a = r(), [o, s] = X("generate"), { updateLayer: c, palette: l } = u(), { setOnly: d } = $(), f = M(e.id, { history: "coalesce" }), m = O(e.loopGroup).find((t) => t.id === e.presetId), h = te(e.loopGroup)?.label ?? "", g = e.loopGroup === "paratype" && m?.sub === "Glyphs" ? E("paratype", "Glyphs") : null, _ = g ? g.map((e) => ({
|
|
839
493
|
value: e.id,
|
|
840
494
|
label: e.label
|
|
841
495
|
})) : null;
|
|
842
|
-
return
|
|
843
|
-
|
|
496
|
+
return Dt(() => {
|
|
497
|
+
m && d(e.type, w(m, e.loopGroup));
|
|
844
498
|
}, () => {
|
|
845
|
-
let t =
|
|
846
|
-
c(e.id,
|
|
847
|
-
}), /* @__PURE__ */
|
|
848
|
-
title:
|
|
499
|
+
let t = re(e.loopId)?.params ?? [];
|
|
500
|
+
c(e.id, i(e, p(t, e), b(), { withFilters: !0 }));
|
|
501
|
+
}), /* @__PURE__ */ Z(Mt, {
|
|
502
|
+
title: h,
|
|
849
503
|
chips: _,
|
|
850
504
|
active: e.presetId,
|
|
851
505
|
onPick: (t) => {
|
|
852
506
|
let n = g?.find((e) => e.id === t);
|
|
853
|
-
n && t !== e.presetId &&
|
|
507
|
+
n && t !== e.presetId && d(e.type, w(n, e.loopGroup));
|
|
854
508
|
},
|
|
855
509
|
pills: !0,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
size: r,
|
|
863
|
-
className: C(r)
|
|
510
|
+
tabStrip: /* @__PURE__ */ Z(q, {
|
|
511
|
+
value: o,
|
|
512
|
+
onChange: s,
|
|
513
|
+
options: a === "sm" ? kt : At,
|
|
514
|
+
size: a,
|
|
515
|
+
className: S(a)
|
|
864
516
|
}),
|
|
865
|
-
children: /* @__PURE__ */
|
|
517
|
+
children: /* @__PURE__ */ Z(P, {
|
|
866
518
|
layer: e,
|
|
867
|
-
setProp:
|
|
868
|
-
patch:
|
|
519
|
+
setProp: f.setProp,
|
|
520
|
+
patch: f.patch,
|
|
869
521
|
updateLayer: c,
|
|
870
522
|
palette: l,
|
|
871
|
-
renderAnimate: t ? (t) => /* @__PURE__ */
|
|
523
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Z(B, {
|
|
872
524
|
layer: e,
|
|
873
525
|
param: t,
|
|
874
|
-
setProp:
|
|
526
|
+
setProp: f.setProp
|
|
875
527
|
}) : void 0,
|
|
876
|
-
tab:
|
|
528
|
+
tab: o,
|
|
877
529
|
tabStrip: null,
|
|
878
530
|
tree: n,
|
|
879
531
|
inline: !0
|
|
880
532
|
})
|
|
881
533
|
});
|
|
882
534
|
}
|
|
883
|
-
function
|
|
884
|
-
let n =
|
|
885
|
-
return
|
|
886
|
-
|
|
887
|
-
presetId:
|
|
888
|
-
presetLabel:
|
|
889
|
-
comp:
|
|
535
|
+
function Lt({ layer: e, showMod: t }) {
|
|
536
|
+
let n = r(), [i, a] = X("generate"), { updateLayer: o, palette: s } = u(), { setOnly: c } = $(), l = M(e.id, { history: "coalesce" }), f = ue.find((t) => t.id === e.presetId), p = H.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
|
|
537
|
+
return Dt(() => {
|
|
538
|
+
f && c("kinetic", {
|
|
539
|
+
presetId: f.id,
|
|
540
|
+
presetLabel: f.label,
|
|
541
|
+
comp: le(f)
|
|
890
542
|
});
|
|
891
543
|
}, () => {
|
|
892
|
-
let t =
|
|
544
|
+
let t = b(), n = d(t >>> 0), r = e.comp ?? { instances: [] };
|
|
893
545
|
(r.instances ?? []).forEach((e, t) => {
|
|
894
|
-
r =
|
|
546
|
+
r = U(r, t, n);
|
|
895
547
|
}), o(e.id, {
|
|
896
548
|
comp: r,
|
|
897
549
|
_rollSeed: t
|
|
898
550
|
});
|
|
899
|
-
}), /* @__PURE__ */
|
|
900
|
-
title:
|
|
901
|
-
tabStrip: /* @__PURE__ */
|
|
902
|
-
|
|
903
|
-
value: r,
|
|
551
|
+
}), /* @__PURE__ */ Z(Mt, {
|
|
552
|
+
title: p,
|
|
553
|
+
tabStrip: /* @__PURE__ */ Z(q, {
|
|
554
|
+
value: i,
|
|
904
555
|
onChange: a,
|
|
905
|
-
options: n === "sm" ?
|
|
556
|
+
options: n === "sm" ? kt : At,
|
|
906
557
|
size: n,
|
|
907
|
-
className:
|
|
558
|
+
className: S(n)
|
|
908
559
|
}),
|
|
909
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ Z(fe, {
|
|
910
561
|
layer: e,
|
|
911
562
|
setProp: l.setProp,
|
|
912
563
|
updateLayer: o,
|
|
913
564
|
palette: s,
|
|
914
|
-
renderAnimate: t ? (t) => /* @__PURE__ */
|
|
565
|
+
renderAnimate: t ? (t) => /* @__PURE__ */ Z(B, {
|
|
915
566
|
layer: e,
|
|
916
567
|
param: t,
|
|
917
568
|
setProp: l.setProp
|
|
918
569
|
}) : () => null,
|
|
919
|
-
tab:
|
|
570
|
+
tab: i,
|
|
920
571
|
tabStrip: null
|
|
921
572
|
})
|
|
922
573
|
});
|
|
923
574
|
}
|
|
924
|
-
function
|
|
925
|
-
let { layer: e } =
|
|
926
|
-
return
|
|
575
|
+
function Rt() {
|
|
576
|
+
let { layer: e } = $(), t = !!h().labsModDots;
|
|
577
|
+
return J(() => {
|
|
927
578
|
let e = (e) => {
|
|
928
579
|
if (e.key !== "m" && e.key !== "M" || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
929
580
|
let t = e.target;
|
|
930
|
-
t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable ||
|
|
581
|
+
t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable || l("labsModDots", !v().labsModDots);
|
|
931
582
|
};
|
|
932
583
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
933
|
-
}, []), e ? e.type === "photo" ? /* @__PURE__ */
|
|
584
|
+
}, []), e ? e.type === "photo" ? /* @__PURE__ */ Z(Nt, {
|
|
934
585
|
layer: e,
|
|
935
586
|
showMod: t
|
|
936
|
-
}, e.id) : e.type === "loop" ? /* @__PURE__ */
|
|
587
|
+
}, e.id) : e.type === "loop" ? /* @__PURE__ */ Z(It, {
|
|
937
588
|
layer: e,
|
|
938
589
|
showMod: t
|
|
939
|
-
}, e.id) : e.type === "misc" ? /* @__PURE__ */
|
|
590
|
+
}, e.id) : e.type === "misc" ? /* @__PURE__ */ Z(It, {
|
|
940
591
|
layer: e,
|
|
941
592
|
showMod: t,
|
|
942
|
-
tree:
|
|
943
|
-
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */
|
|
593
|
+
tree: N
|
|
594
|
+
}, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Z(Lt, {
|
|
944
595
|
layer: e,
|
|
945
596
|
showMod: t
|
|
946
|
-
}, e.id) : /* @__PURE__ */
|
|
597
|
+
}, e.id) : /* @__PURE__ */ Z(j, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Z(j, { children: "Pick an effect or generator from the nav." });
|
|
947
598
|
}
|
|
948
599
|
//#endregion
|
|
949
|
-
//#region src/editor/labs/
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
600
|
+
//#region src/editor/labs/LabsSourcePicker.jsx
|
|
601
|
+
function zt(e) {
|
|
602
|
+
let { patch: t } = M(e.id), n = Y(null), [r, i] = X(!1), a = e.type === "loop" && e.loopGroup === "distress";
|
|
603
|
+
return {
|
|
604
|
+
nodes: /* @__PURE__ */ Q(St, { children: [/* @__PURE__ */ Z("input", {
|
|
605
|
+
ref: n,
|
|
606
|
+
type: "file",
|
|
607
|
+
accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
|
|
608
|
+
className: "hidden",
|
|
609
|
+
onChange: (n) => {
|
|
610
|
+
let r = n.target.files?.[0];
|
|
611
|
+
if (n.target.value = "", !r) return;
|
|
612
|
+
if (a) {
|
|
613
|
+
let e = new FileReader();
|
|
614
|
+
e.onload = () => t({ svgSrc: e.result }), e.readAsText(r);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (r.type.startsWith("video/")) {
|
|
618
|
+
y(e.id, r), t({
|
|
619
|
+
src: URL.createObjectURL(r),
|
|
620
|
+
srcType: "video"
|
|
621
|
+
});
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
let i = new FileReader();
|
|
625
|
+
i.onload = () => t({
|
|
626
|
+
src: i.result,
|
|
627
|
+
srcType: "image"
|
|
628
|
+
}), i.readAsDataURL(r);
|
|
629
|
+
}
|
|
630
|
+
}), /* @__PURE__ */ Z(He, {
|
|
631
|
+
open: r,
|
|
632
|
+
onClose: () => i(!1),
|
|
633
|
+
onPick: (e, { contentType: n } = {}) => {
|
|
634
|
+
if (a) {
|
|
635
|
+
t({ svgSrc: tt(e) });
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
t({
|
|
639
|
+
src: tt(e),
|
|
640
|
+
srcType: We(n) ? "video" : "image"
|
|
641
|
+
});
|
|
983
642
|
},
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
})
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
643
|
+
accept: a ? "svg" : "all"
|
|
644
|
+
})] }),
|
|
645
|
+
svgMode: a,
|
|
646
|
+
openLibrary: () => i(!0),
|
|
647
|
+
openUpload: () => n.current?.click(),
|
|
648
|
+
openCamera: () => {
|
|
649
|
+
Ge(e.id).then(() => t({
|
|
650
|
+
src: null,
|
|
651
|
+
srcType: "webcam"
|
|
652
|
+
})).catch(() => {});
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
[
|
|
657
|
+
{
|
|
658
|
+
value: "library",
|
|
659
|
+
label: "Library"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
value: "upload",
|
|
663
|
+
label: "Upload"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
value: "camera",
|
|
667
|
+
label: "Camera"
|
|
668
|
+
}
|
|
669
|
+
].slice(0, 2);
|
|
670
|
+
function Bt({ layer: e }) {
|
|
671
|
+
let t = zt(e);
|
|
672
|
+
return /* @__PURE__ */ Q("div", {
|
|
673
|
+
className: "flex flex-col gap-2",
|
|
674
|
+
children: [
|
|
675
|
+
/* @__PURE__ */ Z(K, {
|
|
676
|
+
tone: "primary",
|
|
677
|
+
size: "lg",
|
|
678
|
+
className: W,
|
|
679
|
+
iconLeft: "image",
|
|
680
|
+
iconRight: "image",
|
|
681
|
+
onClick: t.openLibrary,
|
|
682
|
+
children: "From library"
|
|
683
|
+
}),
|
|
684
|
+
/* @__PURE__ */ Z(K, {
|
|
685
|
+
tone: "primary",
|
|
686
|
+
size: "lg",
|
|
687
|
+
className: W,
|
|
688
|
+
iconLeft: "upload",
|
|
689
|
+
iconRight: "upload",
|
|
690
|
+
onClick: t.openUpload,
|
|
691
|
+
children: "Upload"
|
|
692
|
+
}),
|
|
693
|
+
!t.svgMode && /* @__PURE__ */ Z(K, {
|
|
694
|
+
tone: "primary",
|
|
695
|
+
size: "lg",
|
|
696
|
+
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
697
|
+
iconLeft: "camera",
|
|
698
|
+
iconRight: "camera",
|
|
699
|
+
onClick: t.openCamera,
|
|
700
|
+
children: "Camera"
|
|
701
|
+
}),
|
|
702
|
+
t.nodes
|
|
703
|
+
]
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
function Vt({ layer: e, title: t, onBack: n }) {
|
|
707
|
+
return we(n), /* @__PURE__ */ Z("div", {
|
|
708
|
+
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",
|
|
709
|
+
style: { zIndex: "var(--kol-z-modal)" },
|
|
710
|
+
children: /* @__PURE__ */ Q("div", {
|
|
711
|
+
className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
|
|
712
|
+
style: { background: "var(--kol-surface-primary)" },
|
|
713
|
+
children: [
|
|
714
|
+
/* @__PURE__ */ Q("div", {
|
|
715
|
+
className: "flex flex-col gap-2",
|
|
716
|
+
children: [/* @__PURE__ */ Z("span", {
|
|
717
|
+
className: "kol-eyebrow text-body",
|
|
718
|
+
children: t
|
|
719
|
+
}), /* @__PURE__ */ Z("span", {
|
|
720
|
+
className: "kol-mono-12 text-meta",
|
|
721
|
+
children: "Pick the media it works on."
|
|
722
|
+
})]
|
|
723
|
+
}),
|
|
724
|
+
/* @__PURE__ */ Z(Bt, { layer: e }),
|
|
725
|
+
/* @__PURE__ */ Z(K, {
|
|
726
|
+
tone: "grey",
|
|
727
|
+
size: "lg",
|
|
728
|
+
className: W,
|
|
729
|
+
iconLeft: "arrow-left",
|
|
730
|
+
iconRight: "arrow-left",
|
|
731
|
+
onClick: n,
|
|
732
|
+
children: "Back"
|
|
733
|
+
})
|
|
734
|
+
]
|
|
735
|
+
})
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region src/editor/components/PanelHeader.jsx
|
|
740
|
+
function Ht({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
|
|
741
|
+
return /* @__PURE__ */ Q("div", {
|
|
742
|
+
className: `flex w-full shrink-0 items-center ${r}`,
|
|
743
|
+
children: [/* @__PURE__ */ Q("button", {
|
|
744
|
+
className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
|
|
745
|
+
onClick: t,
|
|
746
|
+
children: [/* @__PURE__ */ Z("span", { children: e }), /* @__PURE__ */ Z(Ct, {
|
|
747
|
+
name: "chevron-down",
|
|
748
|
+
size: 16,
|
|
749
|
+
className: "text-oq-48"
|
|
750
|
+
})]
|
|
751
|
+
}), n]
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
function Ut({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
|
|
755
|
+
return /* @__PURE__ */ Q("div", {
|
|
756
|
+
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-wrap-reverse gap-2 px-3 [&>*]:pointer-events-auto",
|
|
757
|
+
children: [/* @__PURE__ */ Z(K, {
|
|
758
|
+
tone: r,
|
|
759
|
+
size: n,
|
|
760
|
+
onClick: t,
|
|
761
|
+
children: /* @__PURE__ */ Q("span", {
|
|
762
|
+
className: "flex items-center gap-2",
|
|
763
|
+
children: [e, /* @__PURE__ */ Z(Ct, {
|
|
764
|
+
name: "chevron-down",
|
|
765
|
+
size: 16,
|
|
766
|
+
className: "rotate-180"
|
|
767
|
+
})]
|
|
768
|
+
})
|
|
769
|
+
}), i]
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
var Wt = {
|
|
773
|
+
half: "50dvh",
|
|
774
|
+
tall: "85dvh"
|
|
775
|
+
};
|
|
776
|
+
function Gt({ tall: e, onToggle: t, onDrag: n }) {
|
|
777
|
+
let r = Y({
|
|
778
|
+
y: null,
|
|
779
|
+
moved: !1,
|
|
780
|
+
swallow: !1
|
|
781
|
+
}).current;
|
|
782
|
+
return /* @__PURE__ */ Z("button", {
|
|
783
|
+
type: "button",
|
|
784
|
+
"aria-label": e ? "Lower the sheet" : "Raise the sheet",
|
|
785
|
+
"aria-pressed": e,
|
|
786
|
+
className: "flex h-6 w-full shrink-0 touch-none items-center justify-center",
|
|
787
|
+
onPointerDown: (e) => {
|
|
788
|
+
r.y = e.clientY, r.moved = !1, e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
789
|
+
},
|
|
790
|
+
onPointerMove: (e) => {
|
|
791
|
+
r.y !== null && Math.abs(e.clientY - r.y) > 32 && (r.moved = !0);
|
|
792
|
+
},
|
|
793
|
+
onPointerUp: (e) => {
|
|
794
|
+
if (r.y === null) return;
|
|
795
|
+
let t = e.clientY - r.y;
|
|
796
|
+
r.y = null, r.moved && n && (n(t < 0 ? -1 : 1), r.swallow = !0);
|
|
797
|
+
},
|
|
798
|
+
onPointerCancel: () => {
|
|
799
|
+
r.y = null;
|
|
800
|
+
},
|
|
801
|
+
onClick: () => {
|
|
802
|
+
if (r.swallow) {
|
|
803
|
+
r.swallow = !1;
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
t?.();
|
|
807
|
+
},
|
|
808
|
+
children: /* @__PURE__ */ Z("span", { className: "h-1 w-9 rounded-full bg-oq-16" })
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
//#endregion
|
|
812
|
+
//#region src/editor/labs/LabsCatalogCard.jsx
|
|
813
|
+
function Kt({ onPicked: e, onClose: t }) {
|
|
814
|
+
let { items: n, dispatch: r } = qe(), [i, a] = X(null);
|
|
815
|
+
we(t);
|
|
816
|
+
let o = n.filter((e) => e.path !== "#rail/sec:modulation"), s = o.find((e) => e.path === i) ?? null, c = s ? s.sub : o;
|
|
817
|
+
return /* @__PURE__ */ Z("div", {
|
|
818
|
+
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",
|
|
819
|
+
style: { zIndex: "var(--kol-z-modal)" },
|
|
820
|
+
children: /* @__PURE__ */ Q("div", {
|
|
821
|
+
className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
|
|
822
|
+
style: { background: "var(--kol-surface-primary)" },
|
|
823
|
+
children: [/* @__PURE__ */ Z("span", {
|
|
824
|
+
className: "kol-eyebrow text-body",
|
|
825
|
+
children: s ? s.label : "Labs"
|
|
826
|
+
}), /* @__PURE__ */ Q("div", {
|
|
827
|
+
className: "flex flex-col gap-2",
|
|
828
|
+
children: [c.map((t) => /* @__PURE__ */ Z(K, {
|
|
829
|
+
tone: "primary",
|
|
830
|
+
size: "lg",
|
|
831
|
+
className: W,
|
|
832
|
+
iconLeft: t.icon,
|
|
833
|
+
iconRight: t.icon,
|
|
834
|
+
onClick: () => {
|
|
835
|
+
if (!s && t.sub?.length) {
|
|
836
|
+
a(t.path);
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
r?.(t.path) && e?.();
|
|
840
|
+
},
|
|
841
|
+
children: t.label
|
|
842
|
+
}, t.path)), s && /* @__PURE__ */ Z(K, {
|
|
843
|
+
tone: "grey",
|
|
844
|
+
size: "lg",
|
|
845
|
+
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
846
|
+
iconLeft: "arrow-left",
|
|
847
|
+
iconRight: "arrow-left",
|
|
848
|
+
onClick: () => a(null),
|
|
849
|
+
children: "Back"
|
|
850
|
+
})]
|
|
1071
851
|
})]
|
|
1072
852
|
})
|
|
1073
|
-
})
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region src/editor/labs/sheetLabels.js
|
|
857
|
+
function qt(e) {
|
|
858
|
+
if (!e) return {
|
|
859
|
+
title: "Labs",
|
|
860
|
+
pill: "Labs"
|
|
861
|
+
};
|
|
862
|
+
if (e.type === "loop" || e.type === "misc") return {
|
|
863
|
+
title: `${te(e.loopGroup)?.label ?? "Labs"} · ${e.presetLabel}`,
|
|
864
|
+
pill: e.presetLabel
|
|
865
|
+
};
|
|
866
|
+
if (e.type === "photo") {
|
|
867
|
+
let n = t(e)[0]?.def?.label ?? "Media";
|
|
868
|
+
return {
|
|
869
|
+
title: n,
|
|
870
|
+
pill: n
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
let n = e.presetLabel ?? "Labs";
|
|
874
|
+
return {
|
|
875
|
+
title: n,
|
|
876
|
+
pill: n
|
|
877
|
+
};
|
|
1074
878
|
}
|
|
1075
879
|
//#endregion
|
|
1076
880
|
//#region src/editor/labs/LabsView.jsx
|
|
1077
|
-
var
|
|
881
|
+
var Jt = .85, Yt = .3, Xt = 2.5, Zt = {
|
|
1078
882
|
0: 1,
|
|
1079
883
|
1: .5,
|
|
1080
884
|
2: 1,
|
|
1081
885
|
3: 1.5,
|
|
1082
886
|
4: 2
|
|
1083
|
-
},
|
|
1084
|
-
function
|
|
1085
|
-
let { layer: e } =
|
|
1086
|
-
return
|
|
1087
|
-
let e =
|
|
887
|
+
}, Qt = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
|
|
888
|
+
function $t() {
|
|
889
|
+
let { layer: e } = $(), { removeLayer: t } = u(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam", [r, i] = X(1), [a, o] = X(!1), s = ve(a), c = Y(null), l = (e) => Math.min(Xt, Math.max(Yt, e)), d = (e) => i((t) => l(t * (e > 0 ? 1.25 : .8))), { tool: f } = Oe(), p = f === "orbit", m = Y(p);
|
|
890
|
+
return m.current = p, J(() => {
|
|
891
|
+
let e = c.current;
|
|
1088
892
|
if (!e) return;
|
|
1089
893
|
let t = (e) => {
|
|
1090
|
-
|
|
894
|
+
m.current || (e.preventDefault(), i((t) => l(t * (e.deltaY > 0 ? .94 : 1.06))));
|
|
1091
895
|
};
|
|
1092
896
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
1093
|
-
}, []),
|
|
897
|
+
}, []), J(() => {
|
|
1094
898
|
let e = (e) => {
|
|
1095
899
|
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
1096
900
|
let t = e.target;
|
|
1097
901
|
if (!(t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable)) {
|
|
1098
902
|
if (e.key === "f" || e.key === "F") {
|
|
1099
|
-
|
|
903
|
+
o((e) => !e);
|
|
1100
904
|
return;
|
|
1101
905
|
}
|
|
1102
|
-
|
|
906
|
+
if (e.key === "-" || e.key === "_") {
|
|
907
|
+
d(-1);
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
if (e.key === "+" || e.key === "=") {
|
|
911
|
+
d(1);
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
Zt[e.key] !== void 0 && i(Zt[e.key]);
|
|
1103
915
|
}
|
|
1104
916
|
};
|
|
1105
917
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1106
|
-
}, []), /* @__PURE__ */
|
|
1107
|
-
ref:
|
|
918
|
+
}, []), /* @__PURE__ */ Q("div", {
|
|
919
|
+
ref: c,
|
|
1108
920
|
className: "relative w-full h-full flex items-center justify-center",
|
|
1109
921
|
style: { background: "var(--kol-surface-secondary)" },
|
|
1110
|
-
onDoubleClick: () =>
|
|
1111
|
-
children: [
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
children: "−"
|
|
1128
|
-
})
|
|
1129
|
-
}),
|
|
1130
|
-
/* @__PURE__ */ X(G, {
|
|
1131
|
-
label: "Reset zoom (0)",
|
|
1132
|
-
children: /* @__PURE__ */ Z("button", {
|
|
1133
|
-
"aria-label": "Reset zoom (0)",
|
|
1134
|
-
type: "button",
|
|
1135
|
-
className: Zt,
|
|
1136
|
-
onClick: () => r(1),
|
|
1137
|
-
children: [Math.round(n * 100), "%"]
|
|
1138
|
-
})
|
|
1139
|
-
}),
|
|
1140
|
-
/* @__PURE__ */ X(G, {
|
|
1141
|
-
label: "Zoom in",
|
|
1142
|
-
children: /* @__PURE__ */ X("button", {
|
|
1143
|
-
"aria-label": "Zoom in",
|
|
1144
|
-
type: "button",
|
|
1145
|
-
className: Zt,
|
|
1146
|
-
onClick: () => l(1),
|
|
1147
|
-
children: "+"
|
|
1148
|
-
})
|
|
1149
|
-
}),
|
|
1150
|
-
i && /* @__PURE__ */ X(G, {
|
|
922
|
+
onDoubleClick: () => i(1),
|
|
923
|
+
children: [
|
|
924
|
+
/* @__PURE__ */ Z("div", {
|
|
925
|
+
style: {
|
|
926
|
+
width: `${r * Jt * 100}%`,
|
|
927
|
+
height: `${r * Jt * 100}%`
|
|
928
|
+
},
|
|
929
|
+
children: /* @__PURE__ */ Z(ze, {})
|
|
930
|
+
}),
|
|
931
|
+
n && /* @__PURE__ */ Z(Vt, {
|
|
932
|
+
layer: e,
|
|
933
|
+
title: qt(e).title,
|
|
934
|
+
onBack: () => t(e.id)
|
|
935
|
+
}),
|
|
936
|
+
a && /* @__PURE__ */ Z("div", {
|
|
937
|
+
className: "absolute bottom-3 right-3 z-[3] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
|
|
938
|
+
children: /* @__PURE__ */ Z(vt, {
|
|
1151
939
|
label: "Framerate — press F to hide",
|
|
1152
|
-
children: /* @__PURE__ */
|
|
1153
|
-
className:
|
|
1154
|
-
children: [
|
|
940
|
+
children: /* @__PURE__ */ Q("span", {
|
|
941
|
+
className: Qt,
|
|
942
|
+
children: [s, " fps"]
|
|
1155
943
|
})
|
|
1156
944
|
})
|
|
1157
|
-
|
|
1158
|
-
|
|
945
|
+
})
|
|
946
|
+
]
|
|
1159
947
|
});
|
|
1160
948
|
}
|
|
1161
|
-
function
|
|
1162
|
-
let e =
|
|
949
|
+
function en() {
|
|
950
|
+
let e = Y(null), { grabProps: t } = wt(e, {
|
|
1163
951
|
token: "kol-rail",
|
|
1164
952
|
side: "right"
|
|
1165
953
|
});
|
|
1166
|
-
return
|
|
954
|
+
return J(() => {
|
|
1167
955
|
let e = document.documentElement, t = !1, n = () => {
|
|
1168
956
|
let t = parseFloat(getComputedStyle(e).getPropertyValue("--kol-shell-rail-width"));
|
|
1169
957
|
return Number.isFinite(t) ? t <= 49 : null;
|
|
@@ -1200,235 +988,216 @@ function $t() {
|
|
|
1200
988
|
}), () => {
|
|
1201
989
|
c.disconnect(), l.disconnect();
|
|
1202
990
|
};
|
|
1203
|
-
}, []), /* @__PURE__ */
|
|
991
|
+
}, []), /* @__PURE__ */ Q("div", {
|
|
1204
992
|
ref: e,
|
|
1205
993
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
1206
|
-
children: [/* @__PURE__ */
|
|
994
|
+
children: [/* @__PURE__ */ Z("div", { ...t }), /* @__PURE__ */ Z("div", {
|
|
1207
995
|
className: "kol-compose-inspector-body",
|
|
1208
|
-
children: /* @__PURE__ */
|
|
996
|
+
children: /* @__PURE__ */ Z(Rt, {})
|
|
1209
997
|
})]
|
|
1210
998
|
});
|
|
1211
999
|
}
|
|
1212
|
-
var
|
|
1213
|
-
function
|
|
1214
|
-
let {
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
onClick: t
|
|
1226
|
-
})
|
|
1227
|
-
})
|
|
1000
|
+
var tn = yt(null);
|
|
1001
|
+
function nn() {
|
|
1002
|
+
let { collapseParams: e, catalog: t, toggleCatalog: n } = xt(tn), { layer: r } = $(), i = /* @__PURE__ */ Z("button", {
|
|
1003
|
+
className: "kol-helper-12 text-meta py-2.5",
|
|
1004
|
+
"aria-pressed": t,
|
|
1005
|
+
onClick: n,
|
|
1006
|
+
children: "Catalog"
|
|
1007
|
+
});
|
|
1008
|
+
return /* @__PURE__ */ Z(Ht, {
|
|
1009
|
+
title: qt(r).title,
|
|
1010
|
+
onCollapse: e,
|
|
1011
|
+
className: "px-4",
|
|
1012
|
+
action: i
|
|
1228
1013
|
});
|
|
1229
1014
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1015
|
+
function rn() {
|
|
1016
|
+
let { tall: e, setTall: t, collapseParams: n } = xt(tn);
|
|
1017
|
+
return /* @__PURE__ */ Z(Gt, {
|
|
1018
|
+
tall: e,
|
|
1019
|
+
onToggle: () => t((e) => !e),
|
|
1020
|
+
onDrag: (r) => {
|
|
1021
|
+
r < 0 ? t(!0) : e ? t(!1) : n();
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
function an() {
|
|
1026
|
+
return /* @__PURE__ */ Z("div", {
|
|
1232
1027
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
1233
|
-
children: /* @__PURE__ */
|
|
1028
|
+
children: /* @__PURE__ */ Z("div", {
|
|
1234
1029
|
className: "kol-compose-inspector-body",
|
|
1235
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ Z(Rt, {})
|
|
1236
1031
|
})
|
|
1237
1032
|
});
|
|
1238
1033
|
}
|
|
1239
|
-
var
|
|
1034
|
+
var on = {
|
|
1240
1035
|
topbar: () => null,
|
|
1241
|
-
canvas:
|
|
1036
|
+
canvas: $t,
|
|
1242
1037
|
panels: [
|
|
1243
1038
|
{
|
|
1244
1039
|
slot: "canvas.footer",
|
|
1245
1040
|
order: 0,
|
|
1246
|
-
Component:
|
|
1041
|
+
Component: de
|
|
1247
1042
|
},
|
|
1248
1043
|
{
|
|
1249
1044
|
slot: "right.body",
|
|
1250
1045
|
order: 0,
|
|
1251
|
-
Component:
|
|
1046
|
+
Component: en
|
|
1252
1047
|
},
|
|
1253
1048
|
{
|
|
1254
1049
|
slot: "right.footer",
|
|
1255
1050
|
order: 0,
|
|
1256
|
-
Component:
|
|
1051
|
+
Component: Xe
|
|
1257
1052
|
}
|
|
1258
1053
|
]
|
|
1259
|
-
},
|
|
1260
|
-
...
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1054
|
+
}, sn = {
|
|
1055
|
+
...on,
|
|
1056
|
+
panels: [
|
|
1057
|
+
{
|
|
1058
|
+
slot: "right.header",
|
|
1059
|
+
order: 0,
|
|
1060
|
+
Component: rn
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
slot: "right.header",
|
|
1064
|
+
order: 1,
|
|
1065
|
+
Component: nn
|
|
1066
|
+
},
|
|
1067
|
+
...on.panels.map((e) => e.Component === en ? {
|
|
1068
|
+
...e,
|
|
1069
|
+
Component: an
|
|
1070
|
+
} : e)
|
|
1071
|
+
]
|
|
1266
1072
|
};
|
|
1267
|
-
function
|
|
1268
|
-
let { setAspect: e, selectedId:
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1073
|
+
function cn() {
|
|
1074
|
+
let { setAspect: e, selectedId: t, select: r } = u(), { layer: i, setOnly: a } = $(), s = Y(!1), c = Ce(Ne), l = Me() && !Se() || c;
|
|
1075
|
+
J(() => {
|
|
1076
|
+
l && document.documentElement.removeAttribute("data-rail");
|
|
1077
|
+
}, [l]);
|
|
1078
|
+
let [d, f] = X(!0), [p, m] = X(!1), [h, g] = X(() => !i);
|
|
1079
|
+
J(() => {
|
|
1080
|
+
g(!i);
|
|
1081
|
+
}, [i?.id]), J(() => {
|
|
1082
|
+
i && !l && document.documentElement.removeAttribute("data-rail");
|
|
1083
|
+
}, [i?.id]), J(() => {
|
|
1084
|
+
if (!l) return;
|
|
1085
|
+
let e = () => f(!0);
|
|
1086
|
+
return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
|
|
1087
|
+
window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
|
|
1088
|
+
};
|
|
1089
|
+
}, [l]), De(), J(() => (st("labs"), () => st(null)), []), J(() => {
|
|
1090
|
+
if (s.current) return;
|
|
1091
|
+
s.current = !0;
|
|
1092
|
+
let t = v();
|
|
1093
|
+
t.defaultAspect && t.defaultAspect !== "custom" && e(t.defaultAspect), t.defaultLoopSeconds && n.setLoopSeconds(t.defaultLoopSeconds);
|
|
1274
1094
|
}, []);
|
|
1275
|
-
let
|
|
1276
|
-
|
|
1277
|
-
if (
|
|
1278
|
-
|
|
1095
|
+
let _ = Y(!1);
|
|
1096
|
+
J(() => {
|
|
1097
|
+
if (_.current) return;
|
|
1098
|
+
_.current = !0;
|
|
1279
1099
|
let e = new URLSearchParams(window.location.search).get("preset"), t = e ? A(e) : null;
|
|
1280
|
-
t && a("loop",
|
|
1100
|
+
t && a("loop", w(ne(e), t));
|
|
1281
1101
|
}, [a]);
|
|
1282
|
-
let { tool:
|
|
1283
|
-
return
|
|
1102
|
+
let { tool: y, setTool: b } = Oe(), x = Y(y);
|
|
1103
|
+
return x.current = y, J(() => {
|
|
1284
1104
|
let e = (e) => {
|
|
1285
|
-
let
|
|
1286
|
-
if (!(
|
|
1105
|
+
let t = e.target;
|
|
1106
|
+
if (!(t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable)) {
|
|
1287
1107
|
if (e.code === "Space") {
|
|
1288
|
-
e.preventDefault(),
|
|
1108
|
+
e.preventDefault(), n.toggle();
|
|
1289
1109
|
return;
|
|
1290
1110
|
}
|
|
1291
|
-
(e.key === "
|
|
1111
|
+
if ((e.key === "s" || e.key === "S") && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
1112
|
+
window.dispatchEvent(new CustomEvent("kol:show-shortcuts"));
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
(e.key === "c" || e.key === "C") && !e.metaKey && !e.ctrlKey && !e.altKey && b(x.current === "orbit" ? "select" : "orbit");
|
|
1292
1116
|
}
|
|
1293
1117
|
};
|
|
1294
1118
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1295
|
-
}, [
|
|
1119
|
+
}, [b]), J(() => {
|
|
1296
1120
|
if (!i?.presetId) return;
|
|
1297
1121
|
let e = new URLSearchParams(window.location.search);
|
|
1298
1122
|
e.get("preset") !== i.presetId && (e.set("view", "labs"), e.set("preset", i.presetId), i.loopGroup ? e.set("cat", i.loopGroup) : e.delete("cat"), window.history.replaceState(null, "", `${window.location.pathname}?${e}`));
|
|
1299
|
-
}, [i?.presetId, i?.loopGroup]),
|
|
1300
|
-
i &&
|
|
1123
|
+
}, [i?.presetId, i?.loopGroup]), J(() => {
|
|
1124
|
+
i && t !== i.id && r(i.id);
|
|
1301
1125
|
}, [
|
|
1302
1126
|
i,
|
|
1303
|
-
|
|
1127
|
+
t,
|
|
1304
1128
|
r
|
|
1305
|
-
]), /* @__PURE__ */
|
|
1129
|
+
]), /* @__PURE__ */ Q("div", {
|
|
1306
1130
|
className: "kol-editor-labs contents",
|
|
1307
|
-
"data-touch":
|
|
1308
|
-
"data-params":
|
|
1131
|
+
"data-touch": l || void 0,
|
|
1132
|
+
"data-params": d ? "open" : void 0,
|
|
1133
|
+
"data-empty": i ? void 0 : "",
|
|
1134
|
+
style: p ? { "--kol-sheet-h": Wt.tall } : void 0,
|
|
1309
1135
|
children: [
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
|
|
1136
|
+
/* @__PURE__ */ Z(Et, {}),
|
|
1137
|
+
l ? /* @__PURE__ */ Q(tn.Provider, {
|
|
1312
1138
|
value: {
|
|
1313
|
-
|
|
1314
|
-
|
|
1139
|
+
collapseParams: () => f(!1),
|
|
1140
|
+
tall: p,
|
|
1141
|
+
setTall: m,
|
|
1142
|
+
catalog: h,
|
|
1143
|
+
toggleCatalog: () => g((e) => !e)
|
|
1315
1144
|
},
|
|
1316
|
-
children: /* @__PURE__ */
|
|
1145
|
+
children: [/* @__PURE__ */ Z(o.Provider, {
|
|
1317
1146
|
value: "md",
|
|
1318
|
-
children: /* @__PURE__ */
|
|
1319
|
-
})
|
|
1320
|
-
|
|
1321
|
-
|
|
1147
|
+
children: /* @__PURE__ */ Z(Re, { registry: sn })
|
|
1148
|
+
}), !d && /* @__PURE__ */ Z(Ut, {
|
|
1149
|
+
tone: "grey",
|
|
1150
|
+
label: qt(i).pill,
|
|
1151
|
+
onOpen: () => f(!0)
|
|
1152
|
+
})]
|
|
1153
|
+
}) : /* @__PURE__ */ Z(Re, { registry: on }),
|
|
1154
|
+
h && /* @__PURE__ */ Z(Kt, {
|
|
1155
|
+
onPicked: () => g(!1),
|
|
1156
|
+
onClose: () => g(!1)
|
|
1157
|
+
})
|
|
1322
1158
|
]
|
|
1323
1159
|
});
|
|
1324
1160
|
}
|
|
1325
|
-
var
|
|
1326
|
-
function
|
|
1327
|
-
return /* @__PURE__ */
|
|
1328
|
-
draftKey:
|
|
1329
|
-
children: /* @__PURE__ */
|
|
1330
|
-
});
|
|
1331
|
-
}
|
|
1332
|
-
//#endregion
|
|
1333
|
-
//#region src/editor/mobile/CategoryScreen.jsx
|
|
1334
|
-
var ln = "w-full [&>span]:w-full [&>span]:justify-between";
|
|
1335
|
-
function un(e) {
|
|
1336
|
-
K(() => {
|
|
1337
|
-
let t = (t) => {
|
|
1338
|
-
t.key === "Escape" && e?.();
|
|
1339
|
-
};
|
|
1340
|
-
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
1341
|
-
}, [e]), K(() => {
|
|
1342
|
-
let e = t.isPlaying();
|
|
1343
|
-
return t.pause(), () => {
|
|
1344
|
-
e && t.play();
|
|
1345
|
-
};
|
|
1346
|
-
}, []);
|
|
1347
|
-
}
|
|
1348
|
-
function dn({ onPick: e, onInsert: t, onBack: n, onDismiss: r }) {
|
|
1349
|
-
return un(r ?? n), /* @__PURE__ */ X("div", {
|
|
1350
|
-
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",
|
|
1351
|
-
style: { zIndex: "var(--kol-z-modal)" },
|
|
1352
|
-
children: /* @__PURE__ */ Z("div", {
|
|
1353
|
-
className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
|
|
1354
|
-
style: { background: "var(--kol-surface-primary)" },
|
|
1355
|
-
children: [
|
|
1356
|
-
/* @__PURE__ */ X("div", {
|
|
1357
|
-
className: "kol-eyebrow text-body",
|
|
1358
|
-
children: "Pick a generator"
|
|
1359
|
-
}),
|
|
1360
|
-
/* @__PURE__ */ X("div", {
|
|
1361
|
-
className: "flex flex-col gap-2",
|
|
1362
|
-
children: P.map((t) => {
|
|
1363
|
-
let n = $[`gen:${t.label}`] ?? "square";
|
|
1364
|
-
return /* @__PURE__ */ X(H, {
|
|
1365
|
-
variant: "primary",
|
|
1366
|
-
size: "lg",
|
|
1367
|
-
className: ln,
|
|
1368
|
-
iconLeft: n,
|
|
1369
|
-
iconRight: n,
|
|
1370
|
-
onClick: () => e(t),
|
|
1371
|
-
children: t.label
|
|
1372
|
-
}, t.label);
|
|
1373
|
-
})
|
|
1374
|
-
}),
|
|
1375
|
-
/* @__PURE__ */ Z("div", {
|
|
1376
|
-
className: "flex flex-col gap-2",
|
|
1377
|
-
children: [t && /* @__PURE__ */ X(H, {
|
|
1378
|
-
variant: "grey",
|
|
1379
|
-
size: "lg",
|
|
1380
|
-
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1381
|
-
iconLeft: "image",
|
|
1382
|
-
iconRight: "image",
|
|
1383
|
-
onClick: t,
|
|
1384
|
-
children: "Insert image or video"
|
|
1385
|
-
}), n && /* @__PURE__ */ X(H, {
|
|
1386
|
-
variant: "grey",
|
|
1387
|
-
size: "lg",
|
|
1388
|
-
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1389
|
-
iconLeft: "arrow-left",
|
|
1390
|
-
iconRight: "arrow-left",
|
|
1391
|
-
onClick: n,
|
|
1392
|
-
children: "Back"
|
|
1393
|
-
})]
|
|
1394
|
-
})
|
|
1395
|
-
]
|
|
1396
|
-
})
|
|
1161
|
+
var ln = "kol.editor.labs-draft";
|
|
1162
|
+
function un() {
|
|
1163
|
+
return /* @__PURE__ */ Z(Ve, {
|
|
1164
|
+
draftKey: ln,
|
|
1165
|
+
children: /* @__PURE__ */ Z(cn, {})
|
|
1397
1166
|
});
|
|
1398
1167
|
}
|
|
1399
1168
|
//#endregion
|
|
1400
1169
|
//#region src/editor/mobile/EffectScreen.jsx
|
|
1401
|
-
function
|
|
1402
|
-
let [i, a] =
|
|
1403
|
-
|
|
1404
|
-
let { engineHost: o } =
|
|
1405
|
-
return /* @__PURE__ */
|
|
1170
|
+
function dn({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
1171
|
+
let [i, a] = X(null);
|
|
1172
|
+
we(r);
|
|
1173
|
+
let { engineHost: o } = L(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = F(I.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
|
|
1174
|
+
return /* @__PURE__ */ Z("div", {
|
|
1406
1175
|
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",
|
|
1407
1176
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1408
|
-
children: /* @__PURE__ */
|
|
1177
|
+
children: /* @__PURE__ */ Q("div", {
|
|
1409
1178
|
className: "my-auto w-full max-w-sm rounded p-8 flex flex-col gap-6",
|
|
1410
1179
|
style: { background: "var(--kol-surface-primary)" },
|
|
1411
1180
|
children: [
|
|
1412
|
-
/* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ Z("div", {
|
|
1413
1182
|
className: "kol-eyebrow text-body",
|
|
1414
1183
|
children: l ? l.label : "Pick an effect"
|
|
1415
1184
|
}),
|
|
1416
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ Z("div", {
|
|
1417
1186
|
className: "flex flex-col gap-2",
|
|
1418
|
-
children: (l ? l.filters : c).map((e) => /* @__PURE__ */
|
|
1419
|
-
|
|
1187
|
+
children: (l ? l.filters : c).map((e) => /* @__PURE__ */ Z(K, {
|
|
1188
|
+
tone: "primary",
|
|
1420
1189
|
size: "lg",
|
|
1421
|
-
className:
|
|
1190
|
+
className: W,
|
|
1422
1191
|
iconLeft: l ? "filter" : "chevron-right",
|
|
1423
1192
|
iconRight: l ? "filter" : "chevron-right",
|
|
1424
1193
|
onClick: () => l ? n(e.id) : a(e.id),
|
|
1425
1194
|
children: e.label
|
|
1426
1195
|
}, e.id))
|
|
1427
1196
|
}),
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
-
|
|
1197
|
+
/* @__PURE__ */ Z(K, {
|
|
1198
|
+
tone: "grey",
|
|
1430
1199
|
size: "lg",
|
|
1431
|
-
className:
|
|
1200
|
+
className: W,
|
|
1432
1201
|
iconLeft: "arrow-left",
|
|
1433
1202
|
iconRight: "arrow-left",
|
|
1434
1203
|
onClick: () => l ? a(null) : r(),
|
|
@@ -1440,7 +1209,7 @@ function fn({ layer: e, chain: t, onPick: n, onBack: r }) {
|
|
|
1440
1209
|
}
|
|
1441
1210
|
//#endregion
|
|
1442
1211
|
//#region src/editor/mobile/MobileOverlay.jsx
|
|
1443
|
-
var
|
|
1212
|
+
var fn = { background: "var(--kol-surface-primary)" }, pn = [
|
|
1444
1213
|
{
|
|
1445
1214
|
value: "generate",
|
|
1446
1215
|
label: "Generate"
|
|
@@ -1457,25 +1226,27 @@ var pn = { background: "var(--kol-surface-primary)" }, mn = [
|
|
|
1457
1226
|
value: "output",
|
|
1458
1227
|
label: "Output"
|
|
1459
1228
|
}
|
|
1460
|
-
],
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1229
|
+
], mn = pn.filter((e) => e.value !== "generate"), hn = "[&_.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)]", gn = {
|
|
1230
|
+
lg: 9.6,
|
|
1231
|
+
sm: 7.2
|
|
1232
|
+
}, _n = 10, vn = 232;
|
|
1233
|
+
function yn(e, t) {
|
|
1234
|
+
let n = t === "sm" ? vn : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
|
|
1235
|
+
for (let o of e) {
|
|
1236
|
+
let e = o.label.length * gn[t] + _n, s = Math.max(a, e);
|
|
1237
|
+
i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
|
|
1466
1238
|
}
|
|
1467
|
-
return
|
|
1239
|
+
return i.length && r.push(i), r;
|
|
1468
1240
|
}
|
|
1469
|
-
function bn({ cells: e }) {
|
|
1470
|
-
return yn(e).map((e,
|
|
1471
|
-
variant: "filled",
|
|
1241
|
+
function bn({ cells: e, size: t }) {
|
|
1242
|
+
return yn(e, t).map((e, n) => /* @__PURE__ */ Z(q, {
|
|
1472
1243
|
value: null,
|
|
1473
1244
|
onChange: (t) => e.find((e) => e.value === t)?.run(),
|
|
1474
1245
|
options: e,
|
|
1475
|
-
size:
|
|
1246
|
+
size: t,
|
|
1476
1247
|
ariaLabel: "Randomize scope",
|
|
1477
|
-
className:
|
|
1478
|
-
},
|
|
1248
|
+
className: hn
|
|
1249
|
+
}, n));
|
|
1479
1250
|
}
|
|
1480
1251
|
var xn = [
|
|
1481
1252
|
2,
|
|
@@ -1486,14 +1257,13 @@ var xn = [
|
|
|
1486
1257
|
value: String(e),
|
|
1487
1258
|
label: `${e}s`
|
|
1488
1259
|
}));
|
|
1489
|
-
function Sn() {
|
|
1490
|
-
let { loopSeconds:
|
|
1491
|
-
return /* @__PURE__ */
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
onChange: (e) => t(Number(e)),
|
|
1260
|
+
function Sn({ size: e }) {
|
|
1261
|
+
let { loopSeconds: t, setLoopSeconds: n } = C();
|
|
1262
|
+
return /* @__PURE__ */ Z(q, {
|
|
1263
|
+
value: String(t),
|
|
1264
|
+
onChange: (e) => n(Number(e)),
|
|
1495
1265
|
options: xn,
|
|
1496
|
-
size:
|
|
1266
|
+
size: e,
|
|
1497
1267
|
ariaLabel: "Loop length"
|
|
1498
1268
|
});
|
|
1499
1269
|
}
|
|
@@ -1532,304 +1302,304 @@ var Cn = [
|
|
|
1532
1302
|
label: "Fill"
|
|
1533
1303
|
}
|
|
1534
1304
|
];
|
|
1535
|
-
function Tn({ layer: e, onSwitchCategory:
|
|
1536
|
-
let { updateLayer:
|
|
1537
|
-
|
|
1538
|
-
f && (
|
|
1539
|
-
}, [f])
|
|
1540
|
-
|
|
1305
|
+
function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectValue: l, onAspect: d, openEffects: f = !1, rail: h = !1, onRail: v, onSheet: y }) {
|
|
1306
|
+
let { updateLayer: b, addFilter: x, removeFilter: ee } = u(), { onExportPng: S } = dt(), [C, ne] = X(!1), [w, T] = X(!0), [E, D] = X(!1), [O, k] = X(!1), [A, j] = X("generate"), [M, N] = X(!1), P = s(e);
|
|
1307
|
+
J(() => {
|
|
1308
|
+
f && (T(!0), k(!0));
|
|
1309
|
+
}, [f]);
|
|
1310
|
+
let F = h ? "sm" : "lg", I = h && !!e && w && !C;
|
|
1311
|
+
J(() => (v?.(I), () => v?.(!1)), [I]);
|
|
1312
|
+
let ie = !h && e && w && !C ? M ? Wt.tall : Wt.half : null;
|
|
1313
|
+
if (J(() => (y?.(ie), () => y?.(null)), [ie]), !e) return null;
|
|
1314
|
+
if (C) return /* @__PURE__ */ Z("button", {
|
|
1541
1315
|
"aria-label": "Show controls",
|
|
1542
1316
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
|
|
1543
|
-
onClick: () =>
|
|
1317
|
+
onClick: () => ne(!1)
|
|
1544
1318
|
});
|
|
1545
|
-
let
|
|
1546
|
-
let t =
|
|
1547
|
-
t &&
|
|
1548
|
-
},
|
|
1549
|
-
let t =
|
|
1550
|
-
t &&
|
|
1319
|
+
let R = e.type === "loop", ae = R ? `${te(e.loopGroup).label} · ${e.presetLabel}` : "Media", z = R ? re(e.loopId)?.params ?? [] : [], oe = R ? m(z, e) : [], se = () => b(e.id, i(e, p(z, e), P.take(), { withFilters: !0 })), B = (t) => b(e.id, i(e, t.params, P.take(), { stripNoRandom: !!t.motion })), ce = () => {
|
|
1320
|
+
let t = c(e, P.take());
|
|
1321
|
+
t && b(e.id, t);
|
|
1322
|
+
}, V = t(e), { effectable: le } = L(e), H = () => {
|
|
1323
|
+
let t = _(e, P.take());
|
|
1324
|
+
t && b(e.id, { filters: t });
|
|
1551
1325
|
};
|
|
1552
|
-
if (!
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
}),
|
|
1568
|
-
(M || R.length > 0) && /* @__PURE__ */ X(H, {
|
|
1569
|
-
variant: "primary",
|
|
1570
|
-
size: "lg",
|
|
1571
|
-
onClick: I,
|
|
1572
|
-
children: "Randomize all"
|
|
1573
|
-
}),
|
|
1574
|
-
/* @__PURE__ */ X(H, {
|
|
1575
|
-
variant: "primary",
|
|
1576
|
-
size: "lg",
|
|
1577
|
-
onClick: () => b(2),
|
|
1578
|
-
children: "Download"
|
|
1579
|
-
})
|
|
1580
|
-
]
|
|
1326
|
+
if (!w) return /* @__PURE__ */ Q(Ut, {
|
|
1327
|
+
label: R ? e.presetLabel : "Media",
|
|
1328
|
+
onOpen: () => T(!0),
|
|
1329
|
+
size: F,
|
|
1330
|
+
children: [(R || V.length > 0) && /* @__PURE__ */ Z(K, {
|
|
1331
|
+
tone: "primary",
|
|
1332
|
+
size: F,
|
|
1333
|
+
onClick: se,
|
|
1334
|
+
children: "Randomize all"
|
|
1335
|
+
}), /* @__PURE__ */ Z(K, {
|
|
1336
|
+
tone: "primary",
|
|
1337
|
+
size: F,
|
|
1338
|
+
onClick: () => S(2),
|
|
1339
|
+
children: "Download"
|
|
1340
|
+
})]
|
|
1581
1341
|
});
|
|
1582
|
-
let
|
|
1583
|
-
return /* @__PURE__ */
|
|
1584
|
-
|
|
1342
|
+
let ue = (R ? pn : mn).filter((e) => (e.value !== "effects" || le) && (e.value !== "transport" || g("motion"))), U = ue.some((e) => e.value === A) ? A : ue[0].value;
|
|
1343
|
+
return /* @__PURE__ */ Q(St, { children: [
|
|
1344
|
+
E && /* @__PURE__ */ Z(ye, {
|
|
1585
1345
|
onPick: (e) => {
|
|
1586
|
-
|
|
1346
|
+
r(e), D(!1);
|
|
1587
1347
|
},
|
|
1588
1348
|
onInsert: () => {
|
|
1589
|
-
|
|
1349
|
+
D(!1), a();
|
|
1590
1350
|
},
|
|
1591
1351
|
onBack: () => {
|
|
1592
|
-
|
|
1352
|
+
D(!1), o();
|
|
1593
1353
|
},
|
|
1594
|
-
onDismiss: () =>
|
|
1354
|
+
onDismiss: () => D(!1)
|
|
1595
1355
|
}),
|
|
1596
|
-
|
|
1356
|
+
O && /* @__PURE__ */ Z(dn, {
|
|
1597
1357
|
layer: e,
|
|
1598
|
-
chain:
|
|
1358
|
+
chain: V,
|
|
1599
1359
|
onPick: (t) => {
|
|
1600
|
-
|
|
1360
|
+
x(e.id, t), k(!1);
|
|
1601
1361
|
},
|
|
1602
|
-
onBack: () =>
|
|
1362
|
+
onBack: () => k(!1)
|
|
1603
1363
|
}),
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
className: "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 pb-[env(safe-area-inset-bottom)]",
|
|
1606
|
-
style:
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
}
|
|
1617
|
-
}),
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1364
|
+
/* @__PURE__ */ Q("div", {
|
|
1365
|
+
className: h ? "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)]",
|
|
1366
|
+
style: h ? fn : {
|
|
1367
|
+
...fn,
|
|
1368
|
+
top: `calc(100dvh - ${ie ?? Wt.half})`
|
|
1369
|
+
},
|
|
1370
|
+
children: [
|
|
1371
|
+
!h && /* @__PURE__ */ Z(Gt, {
|
|
1372
|
+
tall: M,
|
|
1373
|
+
onToggle: () => N((e) => !e),
|
|
1374
|
+
onDrag: (e) => {
|
|
1375
|
+
e < 0 ? N(!0) : M ? N(!1) : T(!1);
|
|
1376
|
+
}
|
|
1377
|
+
}),
|
|
1378
|
+
/* @__PURE__ */ Z(Ht, {
|
|
1379
|
+
title: ae,
|
|
1380
|
+
onCollapse: () => T(!1),
|
|
1381
|
+
className: h ? "px-4 pt-2.5 pb-1.5" : "px-3",
|
|
1382
|
+
action: /* @__PURE__ */ Z("button", {
|
|
1383
|
+
className: "kol-helper-12 text-meta py-2.5",
|
|
1384
|
+
onClick: o,
|
|
1385
|
+
children: "Start over"
|
|
1386
|
+
})
|
|
1387
|
+
}),
|
|
1388
|
+
/* @__PURE__ */ Q("div", {
|
|
1389
|
+
className: h ? "px-4 pb-5" : "min-h-0 flex-1 overflow-y-auto px-3 pb-3",
|
|
1390
|
+
children: [
|
|
1391
|
+
/* @__PURE__ */ Z(q, {
|
|
1392
|
+
value: U,
|
|
1393
|
+
onChange: j,
|
|
1394
|
+
options: ue,
|
|
1395
|
+
size: F,
|
|
1396
|
+
className: h ? hn : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
|
|
1397
|
+
}),
|
|
1398
|
+
U === "generate" && R && /* @__PURE__ */ Q("div", {
|
|
1399
|
+
className: "flex flex-col gap-2 pt-3",
|
|
1400
|
+
children: [
|
|
1401
|
+
/* @__PURE__ */ Q("div", {
|
|
1402
|
+
className: "grid grid-cols-2 gap-2",
|
|
1403
|
+
children: [/* @__PURE__ */ Z(K, {
|
|
1404
|
+
tone: "primary",
|
|
1405
|
+
size: F,
|
|
1406
|
+
iconRight: "refresh",
|
|
1407
|
+
onClick: ce,
|
|
1408
|
+
children: "Preset"
|
|
1409
|
+
}), /* @__PURE__ */ Z(K, {
|
|
1410
|
+
tone: "primary",
|
|
1411
|
+
size: F,
|
|
1412
|
+
onClick: () => D(!0),
|
|
1413
|
+
children: "Generator"
|
|
1414
|
+
})]
|
|
1415
|
+
}),
|
|
1416
|
+
/* @__PURE__ */ Z(K, {
|
|
1417
|
+
tone: "primary",
|
|
1418
|
+
size: F,
|
|
1419
|
+
className: "w-full",
|
|
1420
|
+
onClick: se,
|
|
1421
|
+
children: "Randomize all"
|
|
1422
|
+
}),
|
|
1423
|
+
oe.length > 0 && /* @__PURE__ */ Z(bn, {
|
|
1424
|
+
size: F,
|
|
1425
|
+
cells: [...oe.map((e) => ({
|
|
1426
|
+
value: e.id,
|
|
1427
|
+
label: e.label,
|
|
1428
|
+
run: () => B(e)
|
|
1429
|
+
})), {
|
|
1430
|
+
value: "__retrigger",
|
|
1431
|
+
label: "Re-trigger",
|
|
1432
|
+
run: () => n.rewind()
|
|
1433
|
+
}]
|
|
1434
|
+
})
|
|
1435
|
+
]
|
|
1436
|
+
}),
|
|
1437
|
+
U === "effects" && /* @__PURE__ */ Q("div", {
|
|
1438
|
+
className: "flex flex-col gap-2 pt-3",
|
|
1439
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
1637
1440
|
className: "grid grid-cols-2 gap-2",
|
|
1638
|
-
children: [/* @__PURE__ */
|
|
1639
|
-
|
|
1640
|
-
size:
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
onClick:
|
|
1648
|
-
children: "
|
|
1441
|
+
children: [/* @__PURE__ */ Z(K, {
|
|
1442
|
+
tone: "primary",
|
|
1443
|
+
size: F,
|
|
1444
|
+
onClick: () => k(!0),
|
|
1445
|
+
children: "Add effect"
|
|
1446
|
+
}), /* @__PURE__ */ Z(K, {
|
|
1447
|
+
tone: "primary",
|
|
1448
|
+
size: F,
|
|
1449
|
+
disabled: !V.length,
|
|
1450
|
+
onClick: H,
|
|
1451
|
+
children: "Randomize"
|
|
1649
1452
|
})]
|
|
1650
|
-
}),
|
|
1651
|
-
|
|
1652
|
-
variant: "primary",
|
|
1653
|
-
size: "lg",
|
|
1654
|
-
className: "w-full",
|
|
1655
|
-
onClick: I,
|
|
1656
|
-
children: "Randomize all"
|
|
1657
|
-
}),
|
|
1658
|
-
F.length > 0 && /* @__PURE__ */ X(bn, { cells: [...F.map((e) => ({
|
|
1659
|
-
value: e.id,
|
|
1660
|
-
label: e.label,
|
|
1661
|
-
run: () => ne(e)
|
|
1662
|
-
})), {
|
|
1663
|
-
value: "__retrigger",
|
|
1664
|
-
label: "Re-trigger",
|
|
1665
|
-
run: () => t.rewind()
|
|
1666
|
-
}] })
|
|
1667
|
-
]
|
|
1668
|
-
}),
|
|
1669
|
-
B === "effects" && /* @__PURE__ */ Z("div", {
|
|
1670
|
-
className: "flex flex-col gap-2 pt-3",
|
|
1671
|
-
children: [/* @__PURE__ */ Z("div", {
|
|
1672
|
-
className: "grid grid-cols-2 gap-2",
|
|
1673
|
-
children: [/* @__PURE__ */ X(H, {
|
|
1674
|
-
variant: "primary",
|
|
1675
|
-
size: "lg",
|
|
1676
|
-
onClick: () => D(!0),
|
|
1677
|
-
children: "Add effect"
|
|
1678
|
-
}), /* @__PURE__ */ X(H, {
|
|
1679
|
-
variant: "primary",
|
|
1680
|
-
size: "lg",
|
|
1681
|
-
disabled: !R.length,
|
|
1682
|
-
onClick: z,
|
|
1683
|
-
children: "Randomize"
|
|
1684
|
-
})]
|
|
1685
|
-
}), R.map((t, n) => {
|
|
1686
|
-
let r = {
|
|
1687
|
-
...e,
|
|
1688
|
-
...t.params,
|
|
1689
|
-
id: e.id
|
|
1690
|
-
}, i = t.def ? g(t.def.params, r) : [], a = (t) => {
|
|
1691
|
-
let i = s(r, t.params, j.take(), { stripNoRandom: !!t.motion }), a = R.map(({ def: e, ...t }) => t);
|
|
1692
|
-
m(e.id, { filters: a.map((e, t) => t === n ? {
|
|
1453
|
+
}), V.map((t, n) => {
|
|
1454
|
+
let r = {
|
|
1693
1455
|
...e,
|
|
1694
|
-
params
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1456
|
+
...t.params,
|
|
1457
|
+
id: e.id
|
|
1458
|
+
}, a = t.def ? m(t.def.params, r) : [], o = (t) => {
|
|
1459
|
+
let a = i(r, t.params, P.take(), { stripNoRandom: !!t.motion }), o = V.map(({ def: e, ...t }) => t);
|
|
1460
|
+
b(e.id, { filters: o.map((e, t) => t === n ? {
|
|
1461
|
+
...e,
|
|
1462
|
+
params: {
|
|
1463
|
+
...e.params,
|
|
1464
|
+
...a
|
|
1465
|
+
}
|
|
1466
|
+
} : e) });
|
|
1467
|
+
};
|
|
1468
|
+
return /* @__PURE__ */ Q("div", {
|
|
1469
|
+
className: "flex flex-col gap-2",
|
|
1470
|
+
children: [/* @__PURE__ */ Z(K, {
|
|
1471
|
+
tone: "grey",
|
|
1472
|
+
size: F,
|
|
1473
|
+
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1474
|
+
iconLeft: "trash",
|
|
1475
|
+
iconRight: "trash",
|
|
1476
|
+
onClick: () => ee(e.id, n),
|
|
1477
|
+
children: `${n + 1}. ${t.def?.label ?? t.id}`
|
|
1478
|
+
}), a.length > 0 && /* @__PURE__ */ Z(bn, {
|
|
1479
|
+
size: F,
|
|
1480
|
+
cells: a.map((e) => ({
|
|
1481
|
+
value: e.id,
|
|
1482
|
+
label: e.label,
|
|
1483
|
+
run: () => o(e)
|
|
1484
|
+
}))
|
|
1485
|
+
})]
|
|
1486
|
+
}, t.key);
|
|
1487
|
+
})]
|
|
1488
|
+
}),
|
|
1489
|
+
U === "transport" && g("motion") && /* @__PURE__ */ Q("div", {
|
|
1490
|
+
className: "flex flex-col gap-2 pt-3",
|
|
1491
|
+
children: [(() => {
|
|
1492
|
+
let e = g("motion").TransportBar;
|
|
1493
|
+
return /* @__PURE__ */ Z(e, { size: F });
|
|
1494
|
+
})(), /* @__PURE__ */ Z(Sn, { size: F })]
|
|
1495
|
+
}),
|
|
1496
|
+
U === "output" && /* @__PURE__ */ Q("div", {
|
|
1497
|
+
className: "flex flex-col gap-2 pt-3",
|
|
1498
|
+
children: [
|
|
1499
|
+
/* @__PURE__ */ Z(q, {
|
|
1500
|
+
value: l,
|
|
1501
|
+
onChange: d,
|
|
1502
|
+
options: Cn,
|
|
1503
|
+
size: F,
|
|
1504
|
+
ariaLabel: "Aspect"
|
|
1505
|
+
}),
|
|
1506
|
+
/* @__PURE__ */ Z(q, {
|
|
1507
|
+
value: l,
|
|
1508
|
+
onChange: d,
|
|
1509
|
+
options: wn,
|
|
1510
|
+
size: F,
|
|
1511
|
+
ariaLabel: "Aspect (landscape) and fill"
|
|
1512
|
+
}),
|
|
1513
|
+
/* @__PURE__ */ Q("div", {
|
|
1514
|
+
className: "grid grid-cols-3 gap-2",
|
|
1515
|
+
children: [
|
|
1516
|
+
/* @__PURE__ */ Z(K, {
|
|
1517
|
+
tone: "primary",
|
|
1518
|
+
size: F,
|
|
1519
|
+
onClick: () => S(2),
|
|
1520
|
+
children: "Download"
|
|
1521
|
+
}),
|
|
1522
|
+
/* @__PURE__ */ Z(K, {
|
|
1523
|
+
tone: "primary",
|
|
1524
|
+
size: F,
|
|
1525
|
+
onClick: () => ne(!0),
|
|
1526
|
+
children: "Hide UI"
|
|
1527
|
+
}),
|
|
1528
|
+
/* @__PURE__ */ Z(K, {
|
|
1529
|
+
tone: "primary",
|
|
1530
|
+
size: F,
|
|
1531
|
+
onClick: o,
|
|
1532
|
+
children: "Start over"
|
|
1533
|
+
})
|
|
1534
|
+
]
|
|
1535
|
+
})
|
|
1536
|
+
]
|
|
1537
|
+
})
|
|
1538
|
+
]
|
|
1539
|
+
})
|
|
1540
|
+
]
|
|
1771
1541
|
})
|
|
1772
1542
|
] });
|
|
1773
1543
|
}
|
|
1774
1544
|
//#endregion
|
|
1775
1545
|
//#region src/editor/mobile/MobileView.jsx
|
|
1776
1546
|
function En({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
1777
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ Z("div", {
|
|
1778
1548
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
|
|
1779
1549
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1780
|
-
children: /* @__PURE__ */
|
|
1550
|
+
children: /* @__PURE__ */ Q("div", {
|
|
1781
1551
|
className: "w-full max-w-sm rounded p-8 flex flex-col gap-6",
|
|
1782
1552
|
style: { background: "var(--kol-surface-primary)" },
|
|
1783
|
-
children: [n ? /* @__PURE__ */
|
|
1553
|
+
children: [n ? /* @__PURE__ */ Q("div", {
|
|
1784
1554
|
className: "flex flex-col gap-2",
|
|
1785
|
-
children: [/* @__PURE__ */
|
|
1555
|
+
children: [/* @__PURE__ */ Z("span", {
|
|
1786
1556
|
className: "kol-eyebrow text-body",
|
|
1787
1557
|
children: "Select chrome"
|
|
1788
|
-
}), /* @__PURE__ */
|
|
1558
|
+
}), /* @__PURE__ */ Z("span", {
|
|
1789
1559
|
className: "kol-mono-16 text-emphasis",
|
|
1790
1560
|
children: "Effexor FXR"
|
|
1791
1561
|
})]
|
|
1792
|
-
}) : /* @__PURE__ */
|
|
1562
|
+
}) : /* @__PURE__ */ Z("span", {
|
|
1793
1563
|
className: "kol-eyebrow text-body",
|
|
1794
|
-
children:
|
|
1795
|
-
}), /* @__PURE__ */
|
|
1564
|
+
children: pe("randomiser").label
|
|
1565
|
+
}), /* @__PURE__ */ Q("div", {
|
|
1796
1566
|
className: "flex flex-col gap-2",
|
|
1797
1567
|
children: [
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
|
|
1568
|
+
/* @__PURE__ */ Z(K, {
|
|
1569
|
+
tone: "primary",
|
|
1800
1570
|
size: "lg",
|
|
1801
|
-
className:
|
|
1802
|
-
iconLeft:
|
|
1803
|
-
iconRight:
|
|
1571
|
+
className: W,
|
|
1572
|
+
iconLeft: G.randomiser,
|
|
1573
|
+
iconRight: G.randomiser,
|
|
1804
1574
|
onClick: e,
|
|
1805
1575
|
children: "Generate"
|
|
1806
1576
|
}),
|
|
1807
|
-
/* @__PURE__ */
|
|
1808
|
-
|
|
1577
|
+
/* @__PURE__ */ Z(K, {
|
|
1578
|
+
tone: "primary",
|
|
1809
1579
|
size: "lg",
|
|
1810
|
-
className:
|
|
1580
|
+
className: W,
|
|
1811
1581
|
iconLeft: "filter",
|
|
1812
1582
|
iconRight: "filter",
|
|
1813
1583
|
onClick: t,
|
|
1814
1584
|
children: "Effects"
|
|
1815
1585
|
}),
|
|
1816
|
-
n &&
|
|
1817
|
-
|
|
1586
|
+
n && Pe() && /* @__PURE__ */ Z(K, {
|
|
1587
|
+
tone: "primary",
|
|
1818
1588
|
size: "lg",
|
|
1819
1589
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1820
|
-
iconLeft:
|
|
1821
|
-
iconRight:
|
|
1822
|
-
onClick:
|
|
1823
|
-
children:
|
|
1590
|
+
iconLeft: G.editor,
|
|
1591
|
+
iconRight: G.editor,
|
|
1592
|
+
onClick: xe,
|
|
1593
|
+
children: pe("editor").label
|
|
1824
1594
|
}),
|
|
1825
|
-
n && /* @__PURE__ */
|
|
1826
|
-
|
|
1595
|
+
n && /* @__PURE__ */ Z(K, {
|
|
1596
|
+
tone: "primary",
|
|
1827
1597
|
size: "lg",
|
|
1828
1598
|
className: "w-full [&>span]:w-full [&>span]:justify-between",
|
|
1829
|
-
iconLeft:
|
|
1830
|
-
iconRight:
|
|
1831
|
-
onClick:
|
|
1832
|
-
children:
|
|
1599
|
+
iconLeft: G.labs,
|
|
1600
|
+
iconRight: G.labs,
|
|
1601
|
+
onClick: ke,
|
|
1602
|
+
children: pe("labs").label
|
|
1833
1603
|
})
|
|
1834
1604
|
]
|
|
1835
1605
|
})]
|
|
@@ -1837,133 +1607,140 @@ function En({ onGenerate: e, onEffects: t, chromes: n }) {
|
|
|
1837
1607
|
});
|
|
1838
1608
|
}
|
|
1839
1609
|
function Dn() {
|
|
1840
|
-
let { layers: e, addLayer:
|
|
1610
|
+
let { layers: e, addLayer: t, removeLayer: r, updateLayer: i, canvasW: a, canvasH: o, aspect: s, setAspect: c } = u(), { setTool: l } = Oe(), d = Me() && !Se(), f = nt(), p = () => "entry", [m, h] = X(p), [g, _] = X(!1), [v, y] = X(null), [b, S] = X("contain"), [C, te] = X(!1), [ne, w] = X(null), [E, O] = X(1), k = Y({
|
|
1841
1611
|
pts: /* @__PURE__ */ new Map(),
|
|
1842
1612
|
startDist: 0,
|
|
1843
1613
|
startScale: 1
|
|
1844
|
-
}),
|
|
1845
|
-
let [e, t] = [...
|
|
1614
|
+
}), A = Y(null), j = () => {
|
|
1615
|
+
let [e, t] = [...k.current.pts.values()];
|
|
1846
1616
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
1847
|
-
},
|
|
1848
|
-
|
|
1617
|
+
}, M = (e) => {
|
|
1618
|
+
k.current.pts.set(e.pointerId, {
|
|
1849
1619
|
x: e.clientX,
|
|
1850
1620
|
y: e.clientY
|
|
1851
|
-
}),
|
|
1621
|
+
}), A.current = k.current.pts.size === 1 ? {
|
|
1852
1622
|
id: e.pointerId,
|
|
1853
1623
|
x: e.clientX,
|
|
1854
1624
|
y: e.clientY,
|
|
1855
1625
|
t: performance.now()
|
|
1856
|
-
} : null,
|
|
1857
|
-
},
|
|
1858
|
-
let t =
|
|
1626
|
+
} : null, k.current.pts.size === 2 && (k.current.startDist = j(), k.current.startScale = E, n.setStagePointer(null), e.stopPropagation());
|
|
1627
|
+
}, N = (e) => {
|
|
1628
|
+
let t = k.current;
|
|
1859
1629
|
t.pts.has(e.pointerId) && (t.pts.set(e.pointerId, {
|
|
1860
1630
|
x: e.clientX,
|
|
1861
1631
|
y: e.clientY
|
|
1862
|
-
}), t.pts.size >= 2 && t.startDist > 0 && (e.stopPropagation(),
|
|
1863
|
-
},
|
|
1864
|
-
let
|
|
1865
|
-
if (
|
|
1866
|
-
let e =
|
|
1867
|
-
e && e.group !== "penrose" && e.kind !== "engine" && !
|
|
1632
|
+
}), t.pts.size >= 2 && t.startDist > 0 && (e.stopPropagation(), O(Math.min(3, Math.max(.5, t.startScale * (j() / t.startDist))))));
|
|
1633
|
+
}, P = (e) => {
|
|
1634
|
+
let t = A.current;
|
|
1635
|
+
if (t && t.id === e.pointerId && e.type === "pointerup" && m === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && F?.type === "loop") {
|
|
1636
|
+
let e = re(F.loopId);
|
|
1637
|
+
e && e.group !== "penrose" && e.kind !== "engine" && !T(e) && n.rewind();
|
|
1868
1638
|
}
|
|
1869
|
-
|
|
1639
|
+
t?.id === e.pointerId && (A.current = null), k.current.pts.delete(e.pointerId), k.current.pts.size < 2 && (k.current.startDist = 0);
|
|
1870
1640
|
};
|
|
1871
|
-
|
|
1641
|
+
Tt(), J(() => (st("randomiser"), () => st(null)), []), J(() => {
|
|
1872
1642
|
c("4:5"), l("orbit");
|
|
1873
1643
|
}, []);
|
|
1874
|
-
let
|
|
1875
|
-
|
|
1876
|
-
if (!
|
|
1644
|
+
let F = e.find((e) => e.id === v) ?? (e.length === 1 ? e[0] : null), I = m === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
|
|
1645
|
+
J(() => {
|
|
1646
|
+
if (!I) return;
|
|
1877
1647
|
let e = (e) => {
|
|
1878
|
-
e.key === "Escape" &&
|
|
1648
|
+
e.key === "Escape" && z();
|
|
1879
1649
|
};
|
|
1880
1650
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1881
|
-
}),
|
|
1882
|
-
if (!
|
|
1883
|
-
let e =
|
|
1884
|
-
return
|
|
1885
|
-
e &&
|
|
1651
|
+
}), J(() => {
|
|
1652
|
+
if (!I) return;
|
|
1653
|
+
let e = n.isPlaying();
|
|
1654
|
+
return n.pause(), () => {
|
|
1655
|
+
e && n.play();
|
|
1886
1656
|
};
|
|
1887
|
-
}, [
|
|
1888
|
-
let
|
|
1889
|
-
let r =
|
|
1890
|
-
r && (
|
|
1891
|
-
},
|
|
1892
|
-
let t =
|
|
1893
|
-
t &&
|
|
1894
|
-
},
|
|
1895
|
-
|
|
1657
|
+
}, [I]);
|
|
1658
|
+
let L = (e) => {
|
|
1659
|
+
let r = D(e);
|
|
1660
|
+
r && (y(t("loop", r)), n.play(), h("live"));
|
|
1661
|
+
}, ie = (e) => {
|
|
1662
|
+
let t = D(e);
|
|
1663
|
+
t && v && i(v, t);
|
|
1664
|
+
}, R = () => {
|
|
1665
|
+
y(t("photo", {
|
|
1896
1666
|
fit: "cover",
|
|
1897
1667
|
x: 0,
|
|
1898
1668
|
y: 0,
|
|
1899
|
-
w:
|
|
1900
|
-
h: Math.round(
|
|
1901
|
-
})),
|
|
1902
|
-
},
|
|
1669
|
+
w: x,
|
|
1670
|
+
h: Math.round(x * o / a)
|
|
1671
|
+
})), n.play(), h("live");
|
|
1672
|
+
}, ae = (e) => {
|
|
1903
1673
|
if (e === "fill") {
|
|
1904
|
-
|
|
1674
|
+
S("cover");
|
|
1905
1675
|
return;
|
|
1906
1676
|
}
|
|
1907
|
-
|
|
1677
|
+
S("contain"), c(e);
|
|
1908
1678
|
let t = ee[e];
|
|
1909
|
-
|
|
1679
|
+
v && t && i(v, {
|
|
1910
1680
|
x: 0,
|
|
1911
1681
|
y: 0,
|
|
1912
|
-
w:
|
|
1913
|
-
h: Math.round(
|
|
1682
|
+
w: x,
|
|
1683
|
+
h: Math.round(x * t.h / t.w)
|
|
1914
1684
|
});
|
|
1915
|
-
},
|
|
1685
|
+
}, z = () => {
|
|
1916
1686
|
for (let t of [...e]) r(t.id);
|
|
1917
|
-
|
|
1687
|
+
y(null), O(1), _(!1), h(p());
|
|
1918
1688
|
};
|
|
1919
|
-
return /* @__PURE__ */
|
|
1920
|
-
className: "relative h-dvh bg-black",
|
|
1689
|
+
return /* @__PURE__ */ Q("div", {
|
|
1690
|
+
className: "kol-editor-randomiser relative h-dvh bg-black",
|
|
1921
1691
|
children: [
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
className: "absolute inset-0 touch-none",
|
|
1924
|
-
style: {
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1692
|
+
/* @__PURE__ */ Z("div", {
|
|
1693
|
+
className: "absolute inset-y-0 left-0 touch-none overflow-hidden",
|
|
1694
|
+
style: {
|
|
1695
|
+
transform: `scale(${E})`,
|
|
1696
|
+
right: C ? "var(--kol-sidenav-w, 320px)" : 0,
|
|
1697
|
+
bottom: ne ?? 0
|
|
1698
|
+
},
|
|
1699
|
+
onPointerDownCapture: M,
|
|
1700
|
+
onPointerMoveCapture: N,
|
|
1701
|
+
onPointerUpCapture: P,
|
|
1702
|
+
onPointerCancelCapture: P,
|
|
1703
|
+
onPointerLeave: P,
|
|
1704
|
+
children: /* @__PURE__ */ Z(et, { fit: b })
|
|
1931
1705
|
}),
|
|
1932
|
-
|
|
1933
|
-
chromes:
|
|
1934
|
-
onGenerate: () =>
|
|
1706
|
+
m === "entry" && /* @__PURE__ */ Z(En, {
|
|
1707
|
+
chromes: d,
|
|
1708
|
+
onGenerate: () => h("category"),
|
|
1935
1709
|
onEffects: () => {
|
|
1936
|
-
|
|
1710
|
+
_(!0), R();
|
|
1937
1711
|
}
|
|
1938
1712
|
}),
|
|
1939
|
-
|
|
1940
|
-
onPick:
|
|
1941
|
-
onInsert:
|
|
1942
|
-
onBack: () =>
|
|
1713
|
+
m === "category" && /* @__PURE__ */ Z(ye, {
|
|
1714
|
+
onPick: L,
|
|
1715
|
+
onInsert: R,
|
|
1716
|
+
onBack: () => h("entry")
|
|
1943
1717
|
}),
|
|
1944
|
-
|
|
1945
|
-
layer:
|
|
1946
|
-
onSwitchCategory:
|
|
1718
|
+
m === "live" && !I && /* @__PURE__ */ Z(Tn, {
|
|
1719
|
+
layer: F,
|
|
1720
|
+
onSwitchCategory: ie,
|
|
1947
1721
|
onInsert: () => {
|
|
1948
|
-
|
|
1722
|
+
z(), R();
|
|
1949
1723
|
},
|
|
1950
|
-
onRestart:
|
|
1951
|
-
aspectValue:
|
|
1952
|
-
openEffects:
|
|
1953
|
-
onAspect:
|
|
1724
|
+
onRestart: z,
|
|
1725
|
+
aspectValue: b === "cover" ? "fill" : s,
|
|
1726
|
+
openEffects: g && !I,
|
|
1727
|
+
onAspect: ae,
|
|
1728
|
+
rail: !d && !f,
|
|
1729
|
+
onRail: te,
|
|
1730
|
+
onSheet: w
|
|
1954
1731
|
}),
|
|
1955
|
-
|
|
1732
|
+
I && /* @__PURE__ */ Q("div", {
|
|
1956
1733
|
className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col",
|
|
1957
1734
|
style: { zIndex: "var(--kol-z-modal)" },
|
|
1958
|
-
children: [/* @__PURE__ */
|
|
1735
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
1959
1736
|
className: "flex-1 min-h-0",
|
|
1960
|
-
children: /* @__PURE__ */
|
|
1961
|
-
}), /* @__PURE__ */
|
|
1737
|
+
children: /* @__PURE__ */ Z(Bt, { layer: F })
|
|
1738
|
+
}), /* @__PURE__ */ Z("div", {
|
|
1962
1739
|
className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
1963
|
-
children: /* @__PURE__ */
|
|
1964
|
-
|
|
1740
|
+
children: /* @__PURE__ */ Z(K, {
|
|
1741
|
+
tone: "outline",
|
|
1965
1742
|
size: "lg",
|
|
1966
|
-
onClick:
|
|
1743
|
+
onClick: z,
|
|
1967
1744
|
children: "Back"
|
|
1968
1745
|
})
|
|
1969
1746
|
})]
|
|
@@ -1972,10 +1749,10 @@ function Dn() {
|
|
|
1972
1749
|
});
|
|
1973
1750
|
}
|
|
1974
1751
|
function On() {
|
|
1975
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ Z(Ve, {
|
|
1976
1753
|
persistDraft: !1,
|
|
1977
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ Z(Dn, {})
|
|
1978
1755
|
});
|
|
1979
1756
|
}
|
|
1980
1757
|
//#endregion
|
|
1981
|
-
export {
|
|
1758
|
+
export { lt as AppSettingsSections, _e as BRAND, ot as DesignEditor, ot as default, ft as DisplaySettingsDrawer, Ve as EditorProviders, je as FilesDialog, Je as GeneratorLibraryProvider, ln as LABS_DRAFT_KEY, Te as LIBRARY_SLOT_KEYS, un as LabsView, Ie as MODES, On as MobileView, ze as OutputCanvas, et as OutputStage, at as OutputView, Qe as RAIL_EXTRA_PREFIX, Fe as VIEW_PATHS, Ae as closeFiles, Ye as comboLabel, Le as currentView, Me as isMobileDevice, ge as openFiles, f as registerPack, Ze as setMediaClient, Ke as setMediaProxyBase, Ue as setMode, $e as setNavigator, rt as setRailExtras, a as setSettingsStore, be as setWantsDesktop, me as shortcutsBySection, ut as useFilesDialog, Ee as useGeneratorLibrary, qe as useRailExtras, Be as useSettingsSections, Se as wantsDesktop, it as withView };
|