@kolkrabbi/design-editor 0.47.0 → 0.49.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/README.md +18 -0
- package/dist/{BindDot-B85UV79g.js → BindDot-BAAc-KSs.js} +1 -1
- package/dist/{KolboxView-n6kEPJtV.js → KolboxView-DxcGz6MC.js} +3310 -5355
- package/dist/{Timeline-EbecYeGh.js → Timeline-BH3BF2m4.js} +3 -9
- package/dist/{TreePicker-2RUSyGl4.js → TreePicker-RImJ6I_0.js} +19 -19
- package/dist/{core-9UlJPBwX.js → core-DyfKZlBI.js} +3550 -5884
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +6 -6
- package/dist/{effectCategories-CCpYmxS0.js → effectCategories-B5jhXEyy.js} +32 -32
- package/dist/effects-BAwNQ8Kj.js +447 -0
- package/dist/effects.js +1 -1
- package/dist/{generators-DY4_ymWh.js → generators-OCg5XjTX.js} +986 -1021
- package/dist/generators.js +1 -1
- package/dist/{host-Bo6itV50.js → host-DS-pAjP0.js} +2 -2
- package/dist/kolbox-pages.js +2218 -0
- package/dist/kolbox-sheet.js +0 -0
- package/dist/kolbox.css +3 -0
- package/dist/{morphStore-Bm30Ekce.js → morphStore-D6xiYiR_.js} +1 -1
- package/dist/{motion-BOWE4m3Q.js → motion-p5pHH9_J.js} +103 -103
- package/dist/motion.js +1 -1
- package/dist/portable-Bs8ieXiu.js +2128 -0
- package/dist/{rolls-DugKaHUw.js → rolls-ZToBSscx.js} +2897 -3068
- package/dist/{src-BlvCHYVY.js → src-DEx6Oh0D.js} +754 -996
- package/dist/{store-BMGP1qou.js → store-BDAxvWTE.js} +15 -15
- package/dist/{useLayerEdit-B5nF5I9b.js → useLayerEdit-D6vwfIoB.js} +141 -141
- package/package.json +17 -14
- package/dist/effects-DspYFJAM.js +0 -447
package/dist/design-editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as e, T as t } from "./__vite-browser-external-y2xWjzgx.js";
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
2
|
+
import { Pr as n } from "./rolls-ZToBSscx.js";
|
|
3
|
+
import { A as r, D as i, E as a, M as o, N as s, O as c, P as l, S as u, T as d, _ as f, b as p, d as m, f as h, g, j as _, k as v, w as y, x as b, y as x } from "./store-BDAxvWTE.js";
|
|
4
|
+
import { i as S, n as C } from "./Timeline-BH3BF2m4.js";
|
|
5
|
+
import { i as w, n as T, r as E, t as D } from "./src-DEx6Oh0D.js";
|
|
6
|
+
import { M as O, N as k, Sn as ee, Tn as A, _n as j, a as M, at as N, bt as P, c as F, ct as I, d as L, dn as R, et as z, f as B, gt as V, hn as H, i as U, it as W, l as G, ln as K, lt as q, mn as J, mt as Y, n as X, nt as Z, o as Q, p as $, r as te, rt as ne, s as re, st as ie, tt as ae, u as oe, ut as se, vn as ce, wn as le } from "./core-DyfKZlBI.js";
|
|
7
|
+
export { z as AppSettingsSections, Y as BRAND, D as DesignEditor, D as default, ae as DisplaySettingsDrawer, $ as EditorProviders, se as FilesDialog, m as GeneratorLibraryProvider, E as LABS_DRAFT_KEY, h as LIBRARY_SLOT_KEYS, w as LabsView, H as MODES, T as MobileView, oe as OutputCanvas, L as OutputStage, B as OutputView, re as RAIL_EXTRA_PREFIX, ne as STYLE_OPTIONS, C as TimelineRail, b as UnauthorizedError, j as VIEW_PATHS, W as VariantContext, ie as closeFiles, V as comboLabel, X as copyStored, ce as currentView, te as duplicateStored, u as getLibraryApi, y as inviteFromRequest, K as isMobileDevice, d as listInviteRequests, g as loadLibrary, a as mintInvite, I as openFiles, f as readLibraryRaw, n as registerPack, U as removeStored, M as renameStored, i as requestInvite, c as setLibraryApi, O as setMediaClient, k as setMediaProxyBase, ee as setMode, le as setNavigator, F as setRailExtras, t as setSettingsStore, Q as setThumbStored, R as setWantsDesktop, P as shortcutsBySection, v as signInLibrary, r as signOutLibrary, _ as signUpLibrary, x as subscribeLibrary, S as timelineView, o as updateAccount, s as useAccount, e as useAppSettings, q as useFilesDialog, p as useGeneratorLibrary, l as useLibrarySession, G as useRailExtras, Z as useSettingsSections, N as useVariant, J as wantsDesktop, A as withView };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as e, D as t, M as n, P as r, a as i, h as a, j as o, k as s, o as c } from "./__vite-browser-external-y2xWjzgx.js";
|
|
2
|
-
import { ar as l,
|
|
3
|
-
import { a as x, i as S, o as C, s as w } from "./useLayerEdit-
|
|
4
|
-
import { o as T, u as E } from "./TreePicker-
|
|
2
|
+
import { ar as l, dr as u, fr as d, gr as f, ir as p, lr as m, mr as h, or as g, pr as _, rr as v, sr as y, ur as b } from "./rolls-ZToBSscx.js";
|
|
3
|
+
import { a as x, i as S, o as C, s as w } from "./useLayerEdit-D6vwfIoB.js";
|
|
4
|
+
import { o as T, u as E } from "./TreePicker-RImJ6I_0.js";
|
|
5
5
|
import { useSyncExternalStore as D } from "react";
|
|
6
6
|
//#region src/loops/lib/fill.js
|
|
7
7
|
var O = [
|
|
@@ -4702,7 +4702,7 @@ var yt = 1e3, bt = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(), St
|
|
|
4702
4702
|
function Tt(e, t, n) {
|
|
4703
4703
|
if (!n) return null;
|
|
4704
4704
|
let r = wt(e, t), i = bt.get(r);
|
|
4705
|
-
if (!i) return !xt.has(r) && !St.has(r) && (xt.add(r),
|
|
4705
|
+
if (!i) return !xt.has(r) && !St.has(r) && (xt.add(r), f(e, t, !1).then((e) => {
|
|
4706
4706
|
bt.set(r, e);
|
|
4707
4707
|
}).catch(() => {
|
|
4708
4708
|
St.add(r);
|
|
@@ -28889,7 +28889,7 @@ var lm = [
|
|
|
28889
28889
|
noRandom: !0,
|
|
28890
28890
|
label: "Mode",
|
|
28891
28891
|
type: "select",
|
|
28892
|
-
options:
|
|
28892
|
+
options: _,
|
|
28893
28893
|
default: "print-press"
|
|
28894
28894
|
},
|
|
28895
28895
|
{
|
|
@@ -28953,12 +28953,12 @@ var lm = [
|
|
|
28953
28953
|
e.fillStyle = a.bg, e.fillRect(0, 0, r, i);
|
|
28954
28954
|
let o = vm(typeof a.svgSrc == "string" && a.svgSrc || mm, a.frequency) ?? vm(mm, a.frequency);
|
|
28955
28955
|
if (!o || o.error || !o.elements.length) return;
|
|
28956
|
-
let s = Math.round(a.motion), c = t * n * s, l = s * 2, u = a.seed + (l > 0 ? Math.floor(n * l) % l * 101 : 0), d = Math.max(0, a.amount), f = Math.max(1, a.frequency <= 50 ? a.frequency / 6 : 50 / 6 + (a.frequency - 50) / 8),
|
|
28957
|
-
e.save(), e.translate((r - _ * y) / 2 -
|
|
28958
|
-
let r = t.pts.map((e, t) =>
|
|
28959
|
-
|
|
28956
|
+
let s = Math.round(a.motion), c = t * n * s, l = s * 2, u = a.seed + (l > 0 ? Math.floor(n * l) % l * 101 : 0), d = Math.max(0, a.amount), f = Math.max(1, a.frequency <= 50 ? a.frequency / 6 : 50 / 6 + (a.frequency - 50) / 8), p = a.smoothness > 0 ? Math.max(1, Math.round(a.smoothness / 30)) : 0, [m, g, _, v] = o.vb, y = Math.min(r * a.size / _, i * a.size / v);
|
|
28957
|
+
e.save(), e.translate((r - _ * y) / 2 - m * y, (i - v * y) / 2 - g * y), e.scale(y, y), o.elements.forEach((t, n) => {
|
|
28958
|
+
let r = t.pts.map((e, t) => h(a.mode, t + n * 1e3, e.t, d, f, u, c)), i = r;
|
|
28959
|
+
p > 0 && (i = r.map((e, n) => {
|
|
28960
28960
|
let i = 0, a = 0, o = 0;
|
|
28961
|
-
for (let e = -
|
|
28961
|
+
for (let e = -p; e <= p; e++) {
|
|
28962
28962
|
let s = n + e;
|
|
28963
28963
|
if (t.closed) s = (s + r.length) % r.length;
|
|
28964
28964
|
else if (s < 0 || s >= r.length) continue;
|
|
@@ -28974,8 +28974,8 @@ var lm = [
|
|
|
28974
28974
|
y: e.y + i[t].dy
|
|
28975
28975
|
})), t.closed), s = (e) => e === "currentColor" ? a.ink : e, l = s(t.fill ?? a.ink);
|
|
28976
28976
|
l && l !== "none" && (e.fillStyle = l, e.fill(o));
|
|
28977
|
-
let
|
|
28978
|
-
|
|
28977
|
+
let m = s(t.stroke);
|
|
28978
|
+
m && m !== "none" && (e.strokeStyle = m, e.lineWidth = t.strokeWidth || 1, e.stroke(o));
|
|
28979
28979
|
}), e.restore();
|
|
28980
28980
|
}
|
|
28981
28981
|
}], xm = (e, t, n, r = {}, i) => ({
|
|
@@ -36165,11 +36165,11 @@ var jv = Object.fromEntries(eh.params.map((e) => [e.key, e.default]));
|
|
|
36165
36165
|
//#endregion
|
|
36166
36166
|
//#region src/generate/lineSwell/index.js
|
|
36167
36167
|
function Mv(e, t, n = {}, r) {
|
|
36168
|
-
let i =
|
|
36168
|
+
let i = p(e).call, a = {
|
|
36169
36169
|
...t,
|
|
36170
36170
|
...r == null ? {} : { waveT: r }
|
|
36171
36171
|
};
|
|
36172
|
-
return i.fn === "vals" ?
|
|
36172
|
+
return i.fn === "vals" ? d(a, i.name, n) : u[i.fn](a, n);
|
|
36173
36173
|
}
|
|
36174
36174
|
var Nv = (e, t) => [
|
|
36175
36175
|
e[0] * t[0] + e[2] * t[1],
|
|
@@ -36268,7 +36268,7 @@ var zv = {
|
|
|
36268
36268
|
section: "Line Swell"
|
|
36269
36269
|
})),
|
|
36270
36270
|
draw(e, t, n, r) {
|
|
36271
|
-
|
|
36271
|
+
p(t.lsForm) && Lv(e, Mv(t.lsForm, t.lsValues ?? {}, Rv(n, r, y(t.lsForm, t.lsValues ?? {}))), n);
|
|
36272
36272
|
}
|
|
36273
36273
|
}, Bv = /* @__PURE__ */ r({
|
|
36274
36274
|
body: () => Zv,
|
|
@@ -36438,7 +36438,7 @@ var ey = new Set([
|
|
|
36438
36438
|
})) } : {},
|
|
36439
36439
|
...e.unit ? { format: (t) => `${t}${e.unit === "°" ? "°" : ` ${e.unit}`}` } : {}
|
|
36440
36440
|
}), iy = (e) => e.sections.flatMap((e) => e.controls.map((t) => ry(t, e.title))), ay = (e, t) => Object.fromEntries(e.sections.flatMap((e) => e.controls.map((e) => [e.name, t[ty(e.name)]]))), oy = (e) => e.split(/[,:]/)[0], sy = (e) => e ? { rings: Av([...e].pop()).map((e) => e.map(([e, t]) => [e * 5 / 7, t])) } : {}, cy = (e) => {
|
|
36441
|
-
let t =
|
|
36441
|
+
let t = m.forms[e];
|
|
36442
36442
|
if (!t.motion) return t;
|
|
36443
36443
|
let n = [...t.sections];
|
|
36444
36444
|
return n.splice(t.motion.at, 0, {
|
|
@@ -36456,7 +36456,7 @@ function dy(e) {
|
|
|
36456
36456
|
};
|
|
36457
36457
|
return {
|
|
36458
36458
|
id: ly(e),
|
|
36459
|
-
label: e === "master" ? "Swell" :
|
|
36459
|
+
label: e === "master" ? "Swell" : l({ form: e }),
|
|
36460
36460
|
group: "lineswell",
|
|
36461
36461
|
kind: "2d",
|
|
36462
36462
|
duration: 4,
|
|
@@ -36467,32 +36467,32 @@ function dy(e) {
|
|
|
36467
36467
|
kind: "form"
|
|
36468
36468
|
},
|
|
36469
36469
|
draw(n, r, a, o, s) {
|
|
36470
|
-
let c = ay(t, s),
|
|
36470
|
+
let c = ay(t, s), l = c.motion && c.motion !== "off", u = e === "master" && c.source === "wave" || l, { ink: d, ground: f } = v(e, c), p = JSON.stringify([
|
|
36471
36471
|
a,
|
|
36472
36472
|
o,
|
|
36473
|
-
|
|
36473
|
+
u ? r : 0,
|
|
36474
36474
|
c
|
|
36475
36475
|
]);
|
|
36476
|
-
if (
|
|
36476
|
+
if (p !== i.key) {
|
|
36477
36477
|
let t = String(c.letter || (c.shape === "letter" ? "R" : "")).trim(), n = Mv(e, {
|
|
36478
36478
|
...c,
|
|
36479
|
-
...
|
|
36480
|
-
}, sy(t), e === "master" && c.source === "wave" ? r : void 0), s = Math.min(a, o) / 800,
|
|
36479
|
+
...l ? { motionT: r } : {}
|
|
36480
|
+
}, sy(t), e === "master" && c.source === "wave" ? r : void 0), s = Math.min(a, o) / 800, u = Pv(n.rot), d = new Path2D();
|
|
36481
36481
|
for (let e of [
|
|
36482
36482
|
...Fv(n.d),
|
|
36483
36483
|
...Fv(n.d2),
|
|
36484
36484
|
...Fv(n.dh),
|
|
36485
36485
|
...Fv(n.d3)
|
|
36486
36486
|
]) e.forEach(([e, t], n) => {
|
|
36487
|
-
let r = a / 2 + (
|
|
36487
|
+
let r = a / 2 + (u[0] * e + u[2] * t + u[4] - 600) * s, i = o / 2 + (u[1] * e + u[3] * t + u[5] - 400) * s;
|
|
36488
36488
|
n ? d.lineTo(r, i) : d.moveTo(r, i);
|
|
36489
36489
|
}), d.closePath();
|
|
36490
36490
|
i = {
|
|
36491
|
-
key:
|
|
36491
|
+
key: p,
|
|
36492
36492
|
path: d
|
|
36493
36493
|
};
|
|
36494
36494
|
}
|
|
36495
|
-
n.fillStyle =
|
|
36495
|
+
n.fillStyle = f, n.fillRect(0, 0, a, o), n.fillStyle = d, n.fill(i.path, "evenodd");
|
|
36496
36496
|
}
|
|
36497
36497
|
};
|
|
36498
36498
|
}
|
|
@@ -36521,10 +36521,10 @@ function hy(e, t, n) {
|
|
|
36521
36521
|
} : t;
|
|
36522
36522
|
return Bv[r](i, n);
|
|
36523
36523
|
}
|
|
36524
|
-
return r === "keys" ?
|
|
36524
|
+
return r === "keys" ? b(t, n, sy(t.letter ? String(t.letter).trim() : "")) : u[r](t, n);
|
|
36525
36525
|
}
|
|
36526
36526
|
function gy(e) {
|
|
36527
|
-
let t =
|
|
36527
|
+
let t = m.loops[e], n = iy(t), { w: r, h: i } = t.frame, a = {
|
|
36528
36528
|
key: "",
|
|
36529
36529
|
v: null
|
|
36530
36530
|
};
|
|
@@ -36551,12 +36551,12 @@ function gy(e) {
|
|
|
36551
36551
|
}
|
|
36552
36552
|
};
|
|
36553
36553
|
}
|
|
36554
|
-
var _y = Object.keys(
|
|
36554
|
+
var _y = Object.keys(m.forms), vy = Object.keys(m.loops), yy = [..._y.map(dy), ...vy.map(gy)], by = {
|
|
36555
36555
|
blinds: "Presets",
|
|
36556
36556
|
master: "Master"
|
|
36557
36557
|
}, xy = (e) => ({
|
|
36558
36558
|
id: `lineswell-board-${e}`,
|
|
36559
|
-
label: e === "master" ? "Swell" :
|
|
36559
|
+
label: e === "master" ? "Swell" : l({ form: e }),
|
|
36560
36560
|
loop: ly(e),
|
|
36561
36561
|
sub: by[e] ?? "Line Effects",
|
|
36562
36562
|
params: {}
|
|
@@ -36569,7 +36569,7 @@ var _y = Object.keys(d.forms), vy = Object.keys(d.loops), yy = [..._y.map(dy), .
|
|
|
36569
36569
|
"Wave shapes"
|
|
36570
36570
|
], Cy = [
|
|
36571
36571
|
..._y.map(xy),
|
|
36572
|
-
..._y.flatMap((e) =>
|
|
36572
|
+
..._y.flatMap((e) => g(e).map((t) => ({
|
|
36573
36573
|
id: `lineswell-${t.id}`,
|
|
36574
36574
|
label: t.label,
|
|
36575
36575
|
loop: ly(e),
|
|
@@ -36578,9 +36578,9 @@ var _y = Object.keys(d.forms), vy = Object.keys(d.loops), yy = [..._y.map(dy), .
|
|
|
36578
36578
|
}))),
|
|
36579
36579
|
...vy.map((e) => ({
|
|
36580
36580
|
id: `lineswell-board-${e}`,
|
|
36581
|
-
label: oy(
|
|
36581
|
+
label: oy(m.loops[e].title),
|
|
36582
36582
|
loop: uy(e),
|
|
36583
|
-
sub:
|
|
36583
|
+
sub: m.loops[e].page,
|
|
36584
36584
|
params: {}
|
|
36585
36585
|
}))
|
|
36586
36586
|
].sort((e, t) => Sy.indexOf(e.sub) - Sy.indexOf(t.sub)), wy = [
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { $t as e, F as t, J as n, Jn as r, Kn as i, L as a, Pr as o, Qn as s, Xn as c, Xt as l, Zn as u, a as d, d as f, n as p, o as m, qn as h, t as g, tr as _, u as v, xn as y } from "./rolls-ZToBSscx.js";
|
|
2
|
+
import { n as b, r as x, t as S } from "./useLayerEdit-D6vwfIoB.js";
|
|
3
|
+
import { a as ee, at as C, ct as w, f as T, i as E, it as D, l as O, lt as k, nt as A, o as j, ot as M, p as N, r as P, rt as F, s as I, st as L, tt as R, u as te } from "./effectCategories-B5jhXEyy.js";
|
|
4
|
+
import { n as z, t as B } from "./TreePicker-RImJ6I_0.js";
|
|
5
|
+
import { t as V } from "./BindDot-BAAc-KSs.js";
|
|
6
|
+
import { Tooltip as H, XYPad as U } from "@kolkrabbi/kol-component";
|
|
7
|
+
import { useEffect as W, useRef as G, useState as K } from "react";
|
|
8
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
9
|
+
//#region src/editor/compose/inspectors/EffectsPanel.jsx
|
|
10
|
+
var ne = [{
|
|
11
|
+
value: "effect",
|
|
12
|
+
label: "Effect"
|
|
13
|
+
}, {
|
|
14
|
+
value: "anim",
|
|
15
|
+
label: "Animation"
|
|
16
|
+
}];
|
|
17
|
+
function X() {
|
|
18
|
+
let { selectedId: e, layers: t } = n(), r = e && e !== "canvas" ? y(t, e) : null;
|
|
19
|
+
return /* @__PURE__ */ J("div", {
|
|
20
|
+
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
21
|
+
children: /* @__PURE__ */ J("div", {
|
|
22
|
+
className: "kol-compose-inspector-body",
|
|
23
|
+
children: r ? /* @__PURE__ */ J(re, { layer: r }, r.id) : /* @__PURE__ */ J(x, {
|
|
24
|
+
always: !0,
|
|
25
|
+
children: "Select a layer to edit its effect."
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function re({ layer: i }) {
|
|
31
|
+
let o = a(), { palette: c, addFilter: u, removeFilter: d, toggleFilter: f, moveFilter: p, replaceFilter: m } = n(), g = S(i.id, { history: "coalesce" }), _ = l(i), v = _.some((e) => e.def?.kind === "engine"), { effectable: y, engineHost: x, engineLoop: C } = E(i), [w, D] = K(_.length ? 0 : null), k = w == null ? null : _[w] ?? null, [A, j] = K("effect"), M = G(_.map((e) => e.key));
|
|
32
|
+
if (W(() => {
|
|
33
|
+
let e = M.current, t = _.map((e) => e.key);
|
|
34
|
+
M.current = t;
|
|
35
|
+
let n = t.find((t) => !e.includes(t));
|
|
36
|
+
if (n != null) {
|
|
37
|
+
D(t.indexOf(n));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
w != null && w >= t.length && D(t.length ? t.length - 1 : null);
|
|
41
|
+
}, [_.length]), !y) return /* @__PURE__ */ J("p", {
|
|
42
|
+
className: "kol-mono-12 text-meta",
|
|
43
|
+
children: C ? "Engine loops can't host effects yet." : "This layer can't host an effect."
|
|
44
|
+
});
|
|
45
|
+
let N = (e) => {
|
|
46
|
+
let t = x && (e == null ? !v : _[e]?.def?.kind === "engine" || !v && e === _.length - 1), n = T.filter((e) => e.kind !== "engine" || t), r = /* @__PURE__ */ new Set();
|
|
47
|
+
return ee(n).flatMap((e) => {
|
|
48
|
+
let t = e.filters.filter((e) => !r.has(e.id) && r.add(e.id));
|
|
49
|
+
return t.length ? [{ heading: e.label }, ...t.map((e) => ({
|
|
50
|
+
value: e.id,
|
|
51
|
+
label: e.label
|
|
52
|
+
}))] : [];
|
|
53
|
+
});
|
|
54
|
+
}, P = _.map(({ def: e, ...t }) => t), F = k ? {
|
|
55
|
+
...i,
|
|
56
|
+
...k.params,
|
|
57
|
+
id: i.id
|
|
58
|
+
} : null, I = (e) => {
|
|
59
|
+
if (w == null) return;
|
|
60
|
+
let t = P.map((t, n) => n === w ? {
|
|
61
|
+
...t,
|
|
62
|
+
params: {
|
|
63
|
+
...t.params,
|
|
64
|
+
...e
|
|
65
|
+
}
|
|
66
|
+
} : t);
|
|
67
|
+
g.patch({ filters: t });
|
|
68
|
+
}, L = (e, t) => {
|
|
69
|
+
if (e === "cameraDrag") {
|
|
70
|
+
g.setProp(e, t);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
I({ [e]: t });
|
|
74
|
+
}, R = (e) => L("sweeps", e), B = (e) => /* @__PURE__ */ J(V, {
|
|
75
|
+
layer: F,
|
|
76
|
+
param: e,
|
|
77
|
+
setProp: L
|
|
78
|
+
}), H = k?.def ? O(k.def.id) : null, U = H ? k.def.params.find((e) => e.key === H) : null, X = k?.def ? k.def.params.filter((t) => e(t) !== "anim" && t !== U) : [];
|
|
79
|
+
return /* @__PURE__ */ Y("div", {
|
|
80
|
+
className: "flex flex-col gap-4",
|
|
81
|
+
children: [_.map((e, n) => /* @__PURE__ */ Y("div", {
|
|
82
|
+
className: "flex flex-col gap-3",
|
|
83
|
+
children: [/* @__PURE__ */ J(ie, {
|
|
84
|
+
stage: e,
|
|
85
|
+
selected: n === w,
|
|
86
|
+
options: N(n),
|
|
87
|
+
onSelect: () => D(n),
|
|
88
|
+
onPick: (t) => {
|
|
89
|
+
t && t !== e.id && m(i.id, n, t), D(n);
|
|
90
|
+
},
|
|
91
|
+
onToggle: () => f(i.id, n),
|
|
92
|
+
onRemove: () => d(i.id, n),
|
|
93
|
+
onUp: () => p(i.id, n, n - 1),
|
|
94
|
+
onDown: () => p(i.id, n, n + 1),
|
|
95
|
+
canUp: n > 0 && e.def?.kind !== "engine",
|
|
96
|
+
canDown: n < _.length - 1 && e.def?.kind !== "engine" && _[n + 1]?.def?.kind !== "engine"
|
|
97
|
+
}), n === w && k?.def && /* @__PURE__ */ Y("div", {
|
|
98
|
+
className: "flex flex-col gap-3",
|
|
99
|
+
children: [
|
|
100
|
+
U && /* @__PURE__ */ J(z, {
|
|
101
|
+
label: "Preset",
|
|
102
|
+
options: U.options,
|
|
103
|
+
value: k.params[U.key] ?? U.default,
|
|
104
|
+
onChange: (e) => I(te(k.def, e)),
|
|
105
|
+
inline: !0
|
|
106
|
+
}),
|
|
107
|
+
i.imgW != null && /* @__PURE__ */ J("span", {
|
|
108
|
+
className: "kol-helper-12 text-meta",
|
|
109
|
+
children: "Filters don't apply to cropped photos."
|
|
110
|
+
}),
|
|
111
|
+
k.def.orbit && /* @__PURE__ */ J(s, {
|
|
112
|
+
label: "Camera drag",
|
|
113
|
+
align: "fill",
|
|
114
|
+
labelWidth: t,
|
|
115
|
+
children: /* @__PURE__ */ J(h, {
|
|
116
|
+
layout: "joined",
|
|
117
|
+
size: o,
|
|
118
|
+
className: "w-full",
|
|
119
|
+
options: [{
|
|
120
|
+
value: "off",
|
|
121
|
+
label: "Off"
|
|
122
|
+
}, {
|
|
123
|
+
value: "on",
|
|
124
|
+
label: "On"
|
|
125
|
+
}],
|
|
126
|
+
value: i.cameraDrag ? "on" : "off",
|
|
127
|
+
onChange: (e) => L("cameraDrag", e === "on")
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ J(h, {
|
|
131
|
+
layout: "joined",
|
|
132
|
+
size: o,
|
|
133
|
+
className: "w-full",
|
|
134
|
+
value: A,
|
|
135
|
+
onChange: j,
|
|
136
|
+
options: ne
|
|
137
|
+
}),
|
|
138
|
+
A === "effect" && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(b, {
|
|
139
|
+
schema: X,
|
|
140
|
+
layer: F,
|
|
141
|
+
setProp: L,
|
|
142
|
+
palette: c,
|
|
143
|
+
renderAnimate: B
|
|
144
|
+
}), /* @__PURE__ */ J(Z, {
|
|
145
|
+
def: k.def,
|
|
146
|
+
view: F,
|
|
147
|
+
tab: "effect",
|
|
148
|
+
onPatch: I
|
|
149
|
+
})] }),
|
|
150
|
+
A === "anim" && /* @__PURE__ */ Y(q, { children: [
|
|
151
|
+
/* @__PURE__ */ J(b, {
|
|
152
|
+
schema: k.def.params,
|
|
153
|
+
layer: F,
|
|
154
|
+
setProp: L,
|
|
155
|
+
palette: c,
|
|
156
|
+
renderAnimate: B,
|
|
157
|
+
tab: "anim"
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ J(Z, {
|
|
160
|
+
def: k.def,
|
|
161
|
+
view: F,
|
|
162
|
+
tab: "anim",
|
|
163
|
+
onPatch: I
|
|
164
|
+
}),
|
|
165
|
+
k.def.sweeps && /* @__PURE__ */ J(Q, {
|
|
166
|
+
sweeps: Array.isArray(k.params.sweeps) ? k.params.sweeps : [],
|
|
167
|
+
onChange: R
|
|
168
|
+
})
|
|
169
|
+
] })
|
|
170
|
+
]
|
|
171
|
+
})]
|
|
172
|
+
}, e.key)), _.length < 8 ? /* @__PURE__ */ J(r, {
|
|
173
|
+
variant: "subtle",
|
|
174
|
+
size: o,
|
|
175
|
+
className: "w-full",
|
|
176
|
+
options: [{
|
|
177
|
+
value: "",
|
|
178
|
+
label: "Add effect…"
|
|
179
|
+
}, ...N(null)],
|
|
180
|
+
value: "",
|
|
181
|
+
onChange: (e) => {
|
|
182
|
+
e && u(i.id, e);
|
|
183
|
+
}
|
|
184
|
+
}) : /* @__PURE__ */ J("span", {
|
|
185
|
+
className: "kol-helper-12 text-meta",
|
|
186
|
+
children: "Chain is full (8 effects)"
|
|
187
|
+
})]
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function Z({ def: t, view: n, tab: r, onPatch: o, inline: s = !1, levels: c = null }) {
|
|
191
|
+
let l = a(), u = f(n), h = r === "anim", _ = t.params.filter((t) => e(t) === "anim" === h), y = h ? _.filter((e) => !e.noRandom) : p(_, n), b = v(m(_, n), y), x = (e, t) => {
|
|
192
|
+
e.length && o(d(n, e, u.take(), { stripNoRandom: !!t?.motion }));
|
|
193
|
+
}, S = (e) => {
|
|
194
|
+
let t = {};
|
|
195
|
+
for (let n of e) n.default !== void 0 && (t[n.key] = n.default);
|
|
196
|
+
Object.keys(t).length && o(t);
|
|
197
|
+
};
|
|
198
|
+
return !y.length && !b.length ? null : /* @__PURE__ */ Y("div", {
|
|
199
|
+
className: "flex flex-col gap-2",
|
|
200
|
+
children: [
|
|
201
|
+
y.length >= 5 && /* @__PURE__ */ J(g, {
|
|
202
|
+
seed: u,
|
|
203
|
+
inline: s
|
|
204
|
+
}),
|
|
205
|
+
y.length > 0 && /* @__PURE__ */ Y("div", {
|
|
206
|
+
className: "flex gap-2",
|
|
207
|
+
children: [c ?? /* @__PURE__ */ J(i, {
|
|
208
|
+
tone: "primary",
|
|
209
|
+
size: l,
|
|
210
|
+
className: "flex-1 min-w-0",
|
|
211
|
+
onClick: (e) => e.altKey ? S(y) : x(y),
|
|
212
|
+
children: h ? "Randomize motion" : "Randomize all"
|
|
213
|
+
}), /* @__PURE__ */ J(H, {
|
|
214
|
+
label: "Reset to defaults",
|
|
215
|
+
shortcut: "R",
|
|
216
|
+
children: /* @__PURE__ */ J(i, {
|
|
217
|
+
tone: "primary",
|
|
218
|
+
size: l,
|
|
219
|
+
iconOnly: "refresh",
|
|
220
|
+
"aria-label": "Reset to defaults",
|
|
221
|
+
onClick: () => S(y),
|
|
222
|
+
className: "shrink-0"
|
|
223
|
+
})
|
|
224
|
+
})]
|
|
225
|
+
}),
|
|
226
|
+
b.length > 0 && /* @__PURE__ */ J("div", {
|
|
227
|
+
className: `grid ${s ? "grid-cols-3" : "grid-cols-2"} gap-2`,
|
|
228
|
+
children: b.map((e) => /* @__PURE__ */ J(i, {
|
|
229
|
+
tone: "primary",
|
|
230
|
+
size: l,
|
|
231
|
+
onClick: (t) => t.altKey ? S(e.params) : x(e.params, e),
|
|
232
|
+
children: e.label
|
|
233
|
+
}, e.id))
|
|
234
|
+
})
|
|
235
|
+
]
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function ie({ stage: e, selected: t, options: n, onSelect: o, onPick: s, onToggle: c, onRemove: l, onUp: u, onDown: d, canUp: f, canDown: p }) {
|
|
239
|
+
let m = a(), h = e.enabled !== !1, g = (e, t, n, r, a = "") => {
|
|
240
|
+
let o = /* @__PURE__ */ J(H, {
|
|
241
|
+
label: e,
|
|
242
|
+
children: /* @__PURE__ */ J(i, {
|
|
243
|
+
tone: "ghost",
|
|
244
|
+
quiet: !0,
|
|
245
|
+
size: m,
|
|
246
|
+
iconOnly: r,
|
|
247
|
+
"aria-label": e,
|
|
248
|
+
tabIndex: n ? -1 : void 0,
|
|
249
|
+
onClick: (e) => {
|
|
250
|
+
e.stopPropagation(), n || t();
|
|
251
|
+
},
|
|
252
|
+
className: `shrink-0 ${a}`
|
|
253
|
+
})
|
|
254
|
+
});
|
|
255
|
+
return n ? /* @__PURE__ */ J("span", {
|
|
256
|
+
"aria-hidden": "true",
|
|
257
|
+
className: "invisible pointer-events-none shrink-0",
|
|
258
|
+
children: o
|
|
259
|
+
}) : o;
|
|
260
|
+
};
|
|
261
|
+
return /* @__PURE__ */ Y("div", {
|
|
262
|
+
onClick: o,
|
|
263
|
+
className: `flex items-center gap-1 rounded ${t ? "bg-oq-08" : ""}`,
|
|
264
|
+
children: [
|
|
265
|
+
g(h ? "Disable effect" : "Enable effect", c, !1, h ? "eye-on" : "eye-off"),
|
|
266
|
+
/* @__PURE__ */ J("div", {
|
|
267
|
+
className: `flex-1 min-w-0 ${h ? "" : "opacity-60"}`,
|
|
268
|
+
children: /* @__PURE__ */ J(r, {
|
|
269
|
+
variant: "subtle",
|
|
270
|
+
size: m,
|
|
271
|
+
className: "w-full",
|
|
272
|
+
options: n,
|
|
273
|
+
value: e.id,
|
|
274
|
+
onChange: s
|
|
275
|
+
})
|
|
276
|
+
}),
|
|
277
|
+
g("Move up", u, !f, "chevron-down", "rotate-180"),
|
|
278
|
+
g("Move down", d, !p, "chevron-down"),
|
|
279
|
+
g("Delete effect", l, !1, "x")
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
var ae = (e) => [
|
|
284
|
+
{
|
|
285
|
+
key: "shape",
|
|
286
|
+
label: "Shape",
|
|
287
|
+
type: "select",
|
|
288
|
+
options: F,
|
|
289
|
+
default: "linear"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
key: "target",
|
|
293
|
+
label: "Target",
|
|
294
|
+
type: "select",
|
|
295
|
+
options: D,
|
|
296
|
+
default: "brightness"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
key: "travel",
|
|
300
|
+
label: "Travel",
|
|
301
|
+
type: "select",
|
|
302
|
+
options: C,
|
|
303
|
+
default: "forward"
|
|
304
|
+
},
|
|
305
|
+
...e.target === "reveal" ? [] : [{
|
|
306
|
+
key: "amount",
|
|
307
|
+
label: "Amount",
|
|
308
|
+
type: "range",
|
|
309
|
+
min: -1,
|
|
310
|
+
max: 1,
|
|
311
|
+
step: .01,
|
|
312
|
+
default: .6
|
|
313
|
+
}],
|
|
314
|
+
{
|
|
315
|
+
key: "speed",
|
|
316
|
+
label: "Speed",
|
|
317
|
+
type: "range",
|
|
318
|
+
min: -8,
|
|
319
|
+
max: 8,
|
|
320
|
+
step: 1,
|
|
321
|
+
default: 1
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
key: "width",
|
|
325
|
+
label: "Width",
|
|
326
|
+
type: "range",
|
|
327
|
+
min: .05,
|
|
328
|
+
max: 1,
|
|
329
|
+
step: .01,
|
|
330
|
+
default: .35
|
|
331
|
+
},
|
|
332
|
+
...R.has(e.shape ?? "linear") ? [{
|
|
333
|
+
key: "angle",
|
|
334
|
+
label: "Angle",
|
|
335
|
+
type: "range",
|
|
336
|
+
min: 0,
|
|
337
|
+
max: 360,
|
|
338
|
+
step: 1,
|
|
339
|
+
default: 0
|
|
340
|
+
}] : []
|
|
341
|
+
];
|
|
342
|
+
function Q({ sweeps: e, onChange: n, inline: r = !1 }) {
|
|
343
|
+
let o = a(), s = (e) => F.find((t) => t.value === e)?.label ?? e, l = (t) => n([...e, t ? M(t.shape, t) : M()]), d = (t) => n(e.filter((e, n) => n !== t)), f = (t, r) => n(e.map((e, n) => n === t ? {
|
|
344
|
+
...e,
|
|
345
|
+
...r
|
|
346
|
+
} : e));
|
|
347
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y(u, {
|
|
348
|
+
label: "Motion",
|
|
349
|
+
divided: !0,
|
|
350
|
+
children: [/* @__PURE__ */ J(B, {
|
|
351
|
+
options: [{
|
|
352
|
+
value: "",
|
|
353
|
+
label: "Add motion…"
|
|
354
|
+
}, ...A.map((e) => ({
|
|
355
|
+
value: e.name,
|
|
356
|
+
label: e.name
|
|
357
|
+
}))],
|
|
358
|
+
value: "",
|
|
359
|
+
onChange: (e) => {
|
|
360
|
+
let t = A.find((t) => t.name === e);
|
|
361
|
+
t && l(t);
|
|
362
|
+
}
|
|
363
|
+
}), /* @__PURE__ */ J(i, {
|
|
364
|
+
tone: "primary",
|
|
365
|
+
size: o,
|
|
366
|
+
className: "w-full",
|
|
367
|
+
iconLeft: "plus",
|
|
368
|
+
iconSize: 12,
|
|
369
|
+
onClick: () => l(),
|
|
370
|
+
children: "Add custom sweep"
|
|
371
|
+
})]
|
|
372
|
+
}), e.map((e, n) => {
|
|
373
|
+
let a = e.enabled !== !1;
|
|
374
|
+
return /* @__PURE__ */ Y(u, {
|
|
375
|
+
divided: !0,
|
|
376
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
377
|
+
className: "flex items-center gap-2",
|
|
378
|
+
children: [
|
|
379
|
+
/* @__PURE__ */ J("span", {
|
|
380
|
+
className: `kol-eyebrow flex-1 truncate ${a ? "text-fg-80" : "text-meta"}`,
|
|
381
|
+
children: s(e.shape ?? "linear")
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ J(_, {
|
|
384
|
+
size: o,
|
|
385
|
+
checked: a,
|
|
386
|
+
onChange: (e) => f(n, { enabled: e })
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ J(H, {
|
|
389
|
+
label: "Delete sweep",
|
|
390
|
+
children: /* @__PURE__ */ J(i, {
|
|
391
|
+
tone: "ghost",
|
|
392
|
+
quiet: !0,
|
|
393
|
+
size: o,
|
|
394
|
+
iconOnly: "x",
|
|
395
|
+
"aria-label": "Delete sweep",
|
|
396
|
+
className: "shrink-0",
|
|
397
|
+
onClick: () => d(n)
|
|
398
|
+
})
|
|
399
|
+
})
|
|
400
|
+
]
|
|
401
|
+
}), a && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(b, {
|
|
402
|
+
schema: ae(e),
|
|
403
|
+
layer: e,
|
|
404
|
+
setProp: (e, t) => f(n, { [e]: t }),
|
|
405
|
+
inline: r
|
|
406
|
+
}), (e.shape ?? "linear") !== "noise" && /* @__PURE__ */ J(c, {
|
|
407
|
+
horizontal: !0,
|
|
408
|
+
label: "ORIGIN",
|
|
409
|
+
labelWidth: t,
|
|
410
|
+
children: /* @__PURE__ */ J("div", {
|
|
411
|
+
className: "w-full min-w-0",
|
|
412
|
+
children: /* @__PURE__ */ J(U, {
|
|
413
|
+
xValue: e.cx ?? .5,
|
|
414
|
+
yValue: e.cy ?? .5,
|
|
415
|
+
xMin: 0,
|
|
416
|
+
xMax: 1,
|
|
417
|
+
yMin: 1,
|
|
418
|
+
yMax: 0,
|
|
419
|
+
onChange: (e, t) => f(n, {
|
|
420
|
+
cx: Math.round(e * 100) / 100,
|
|
421
|
+
cy: Math.round(t * 100) / 100
|
|
422
|
+
})
|
|
423
|
+
})
|
|
424
|
+
})
|
|
425
|
+
})] })]
|
|
426
|
+
}, n);
|
|
427
|
+
})] });
|
|
428
|
+
}
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/packs/effects.js
|
|
431
|
+
var $ = {
|
|
432
|
+
FILTERS: T,
|
|
433
|
+
filterById: N,
|
|
434
|
+
makeSweep: M,
|
|
435
|
+
runChain: w,
|
|
436
|
+
invalidateSource: L,
|
|
437
|
+
stillOf: k,
|
|
438
|
+
effectCategories: P,
|
|
439
|
+
liveFilterGroups: j,
|
|
440
|
+
liveFilterLabel: I,
|
|
441
|
+
EffectsPanel: X,
|
|
442
|
+
loadPixiPipeline: () => import("./pipeline-hZsOKbHd.js"),
|
|
443
|
+
loadGlHost: () => import("./host-0qv2SCjk.js")
|
|
444
|
+
};
|
|
445
|
+
o("effects", $);
|
|
446
|
+
//#endregion
|
|
447
|
+
export { Z as n, Q as r, $ as t };
|
package/dist/effects.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./effects-
|
|
1
|
+
import { t as e } from "./effects-BAwNQ8Kj.js";
|
|
2
2
|
export { e as effects };
|