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