@kolkrabbi/design-editor 0.17.0 → 0.18.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/{core-Cq8xJc_c.js → core-U5SftIcH.js} +400 -340
- package/dist/core.js +1 -1
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +4 -4
- package/dist/{effects-B743CHEU.js → effects-DehkU1My.js} +1 -1
- package/dist/effects.js +1 -1
- package/dist/{generators-B0uhjxUs.js → generators-Bk3mvrsm.js} +3 -3
- package/dist/generators.js +1 -1
- package/dist/{host-bXQMgZeW.js → host-B8_Ri9EV.js} +1 -1
- package/dist/{useLayerEdit-BDXtPeAP.js → useLayerEdit-DRZ09kNJ.js} +8 -7
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as e, A as t, At as n, C as r, Ct as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, H as d, I as f, It as p, J as m, Jt as h, K as g, Kt as _, Lt as v, M as y, Mt as b, N as x, Nt as S, O as C, Ot as w, P as T, Pt as E, Q as D, Rt as ee, S as te, St as ne, T as re, Tt as ie, U as O, W as ae, X as oe, Xt as k, Y as se, Yt as A, Z as ce, _ as le, _t as ue, a as de, at as fe, bt as pe, c as me, d as he, et as ge, f as _e, g as ve, gt as ye, h as j, ht as M, it as be, j as N, jt as xe, k as Se, kt as P, m as Ce, mt as we, n as Te, nt as Ee, ot as De, p as Oe, pt as ke, q as Ae, qt as je, rt as Me, st as Ne, t as Pe, tt as Fe, vt as F, w as Ie, wt as Le, x as Re, xt as ze, yt as Be, zt as Ve } from "./rolls-CkmuE-Ya.js";
|
|
2
|
-
import { n as He, r as Ue, t as We } from "./useLayerEdit-
|
|
2
|
+
import { n as He, r as Ue, t as We } from "./useLayerEdit-DRZ09kNJ.js";
|
|
3
3
|
import { i as Ge, n as I, r as Ke, t as qe } from "./RuleRow-DlouS36V.js";
|
|
4
4
|
import { n as Je, t as Ye } from "./BindDot-CuCS4LS-.js";
|
|
5
5
|
import { n as Xe } from "./labels-B10g9Um5.js";
|
|
@@ -8389,8 +8389,30 @@ function qc() {
|
|
|
8389
8389
|
});
|
|
8390
8390
|
}
|
|
8391
8391
|
//#endregion
|
|
8392
|
-
//#region src/editor/
|
|
8393
|
-
var Jc =
|
|
8392
|
+
//#region src/editor/library/mediaLibrary.js
|
|
8393
|
+
var Jc = Object.values(rn).map((e) => ({
|
|
8394
|
+
value: e.id,
|
|
8395
|
+
label: e.label
|
|
8396
|
+
})), Yc = () => Qc && Zc.buckets ? Zc.buckets().map((e) => ({
|
|
8397
|
+
value: e.id,
|
|
8398
|
+
label: e.label
|
|
8399
|
+
})) : Jc, Xc = "/media/", Zc = an({
|
|
8400
|
+
buckets: !0,
|
|
8401
|
+
proxyPath: Xc
|
|
8402
|
+
}), Qc = !1, $c = (e) => {
|
|
8403
|
+
Xc = e, Qc || (Zc = an({
|
|
8404
|
+
buckets: !0,
|
|
8405
|
+
proxyPath: Xc
|
|
8406
|
+
}));
|
|
8407
|
+
}, el = (e) => {
|
|
8408
|
+
Qc = !!e, Zc = e ?? an({
|
|
8409
|
+
buckets: !0,
|
|
8410
|
+
proxyPath: Xc
|
|
8411
|
+
});
|
|
8412
|
+
}, tl = (e, t = "r2") => Zc.mediaUrl(e, t), nl = (e) => Zc.proxied(e), rl = (e, t = "r2") => Zc.proxied(Zc.mediaUrl(e, t)), il = (e = "", { signal: t, bucket: n = "r2" } = {}) => Zc.listMedia(e, {
|
|
8413
|
+
signal: t,
|
|
8414
|
+
bucket: n
|
|
8415
|
+
}), al = [{
|
|
8394
8416
|
value: "list",
|
|
8395
8417
|
label: "List view",
|
|
8396
8418
|
icon: "view-list"
|
|
@@ -8398,8 +8420,64 @@ var Jc = [{
|
|
|
8398
8420
|
value: "grid",
|
|
8399
8421
|
label: "Grid view",
|
|
8400
8422
|
icon: "grid"
|
|
8401
|
-
}];
|
|
8402
|
-
function
|
|
8423
|
+
}], ol = 12;
|
|
8424
|
+
function sl() {
|
|
8425
|
+
let { addLayer: e } = N(), [t, n] = q({
|
|
8426
|
+
status: "loading",
|
|
8427
|
+
items: [],
|
|
8428
|
+
bucket: null
|
|
8429
|
+
});
|
|
8430
|
+
return G(() => {
|
|
8431
|
+
let e = new AbortController(), t = Yc()[0]?.value ?? "r2";
|
|
8432
|
+
return il("", {
|
|
8433
|
+
bucket: t,
|
|
8434
|
+
signal: e.signal
|
|
8435
|
+
}).then((e) => n({
|
|
8436
|
+
status: "ready",
|
|
8437
|
+
bucket: t,
|
|
8438
|
+
items: e.filter((e) => sn(e.contentType)).slice(0, ol)
|
|
8439
|
+
})).catch((e) => {
|
|
8440
|
+
e.name !== "AbortError" && n({
|
|
8441
|
+
status: "error",
|
|
8442
|
+
items: [],
|
|
8443
|
+
bucket: t
|
|
8444
|
+
});
|
|
8445
|
+
}), () => e.abort();
|
|
8446
|
+
}, []), t.status === "error" || t.status === "ready" && !t.items.length ? null : /* @__PURE__ */ X("div", {
|
|
8447
|
+
className: "flex flex-col gap-3",
|
|
8448
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
8449
|
+
className: "kol-helper-10 uppercase tracking-widest text-meta",
|
|
8450
|
+
children: "Images"
|
|
8451
|
+
}), t.status === "loading" ? /* @__PURE__ */ Y("p", {
|
|
8452
|
+
className: "kol-helper-12 text-meta",
|
|
8453
|
+
children: "Loading…"
|
|
8454
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
8455
|
+
className: "grid grid-cols-3 gap-2",
|
|
8456
|
+
children: t.items.map((n) => {
|
|
8457
|
+
let r = n.key.split("/").pop();
|
|
8458
|
+
return /* @__PURE__ */ Y(H, {
|
|
8459
|
+
label: r,
|
|
8460
|
+
children: /* @__PURE__ */ Y("button", {
|
|
8461
|
+
type: "button",
|
|
8462
|
+
"aria-label": r,
|
|
8463
|
+
onClick: () => e("photo", {
|
|
8464
|
+
src: rl(n.key, t.bucket),
|
|
8465
|
+
fit: "cover"
|
|
8466
|
+
}),
|
|
8467
|
+
className: "block aspect-square overflow-hidden rounded bg-oq-04 hover:bg-oq-08 cursor-pointer",
|
|
8468
|
+
children: /* @__PURE__ */ Y("img", {
|
|
8469
|
+
src: rl(n.key, t.bucket),
|
|
8470
|
+
alt: "",
|
|
8471
|
+
loading: "lazy",
|
|
8472
|
+
className: "h-full w-full object-cover"
|
|
8473
|
+
})
|
|
8474
|
+
})
|
|
8475
|
+
}, n.key);
|
|
8476
|
+
})
|
|
8477
|
+
})]
|
|
8478
|
+
});
|
|
8479
|
+
}
|
|
8480
|
+
function cl() {
|
|
8403
8481
|
let { addLayer: e } = N(), [t, n] = q("list"), i = (t) => {
|
|
8404
8482
|
let n = ao[t] ?? {
|
|
8405
8483
|
w: 320,
|
|
@@ -8415,66 +8493,70 @@ function Yc() {
|
|
|
8415
8493
|
};
|
|
8416
8494
|
return /* @__PURE__ */ X("div", {
|
|
8417
8495
|
className: "px-4 py-3 flex flex-col gap-3",
|
|
8418
|
-
children: [
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
children: /* @__PURE__ */
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
className: "
|
|
8440
|
-
children: /* @__PURE__ */ Y(
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
children: /* @__PURE__ */
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
className: "
|
|
8461
|
-
children: /* @__PURE__ */ Y(
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8496
|
+
children: [
|
|
8497
|
+
/* @__PURE__ */ X("div", {
|
|
8498
|
+
className: "flex items-center justify-between",
|
|
8499
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
8500
|
+
className: "kol-helper-10 uppercase tracking-widest text-meta",
|
|
8501
|
+
children: "Logos"
|
|
8502
|
+
}), /* @__PURE__ */ Y(Vt, {
|
|
8503
|
+
variant: "icon",
|
|
8504
|
+
viewMode: t,
|
|
8505
|
+
onViewChange: n,
|
|
8506
|
+
options: al
|
|
8507
|
+
})]
|
|
8508
|
+
}),
|
|
8509
|
+
t === "grid" ? /* @__PURE__ */ Y("div", {
|
|
8510
|
+
className: "grid grid-cols-2 gap-2",
|
|
8511
|
+
children: io.map((e) => /* @__PURE__ */ Y(H, {
|
|
8512
|
+
label: e,
|
|
8513
|
+
children: /* @__PURE__ */ X("button", {
|
|
8514
|
+
"aria-label": e,
|
|
8515
|
+
type: "button",
|
|
8516
|
+
onClick: () => i(e),
|
|
8517
|
+
className: "bg-oq-04 hover:bg-oq-08 rounded p-3 flex flex-col items-center gap-2 cursor-pointer",
|
|
8518
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
8519
|
+
className: "block w-full h-12 text-emphasis",
|
|
8520
|
+
children: /* @__PURE__ */ Y(oo, {
|
|
8521
|
+
variant: e,
|
|
8522
|
+
className: "block w-full h-full"
|
|
8523
|
+
})
|
|
8524
|
+
}), /* @__PURE__ */ Y("span", {
|
|
8525
|
+
className: "kol-helper-10 text-meta normal-case tracking-normal truncate w-full text-center",
|
|
8526
|
+
children: e
|
|
8527
|
+
})]
|
|
8528
|
+
})
|
|
8529
|
+
}, e))
|
|
8530
|
+
}) : /* @__PURE__ */ Y("ul", {
|
|
8531
|
+
className: "flex flex-col",
|
|
8532
|
+
children: io.map((e) => /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ Y(H, {
|
|
8533
|
+
label: e,
|
|
8534
|
+
children: /* @__PURE__ */ X("button", {
|
|
8535
|
+
"aria-label": e,
|
|
8536
|
+
type: "button",
|
|
8537
|
+
onClick: () => i(e),
|
|
8538
|
+
className: "w-full flex items-center gap-3 px-2 py-1.5 rounded hover:bg-oq-04 cursor-pointer text-left",
|
|
8539
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
8540
|
+
className: "block w-8 h-6 shrink-0 text-emphasis",
|
|
8541
|
+
children: /* @__PURE__ */ Y(oo, {
|
|
8542
|
+
variant: e,
|
|
8543
|
+
className: "block w-full h-full"
|
|
8544
|
+
})
|
|
8545
|
+
}), /* @__PURE__ */ Y("span", {
|
|
8546
|
+
className: "kol-helper-12 text-emphasis normal-case tracking-normal truncate flex-1",
|
|
8547
|
+
children: e
|
|
8548
|
+
})]
|
|
8549
|
+
})
|
|
8550
|
+
}) }, e))
|
|
8551
|
+
}),
|
|
8552
|
+
/* @__PURE__ */ Y(sl, {})
|
|
8553
|
+
]
|
|
8472
8554
|
});
|
|
8473
8555
|
}
|
|
8474
8556
|
//#endregion
|
|
8475
8557
|
//#region src/editor/shell/panels/LayersAssetsPanel.jsx
|
|
8476
|
-
var
|
|
8477
|
-
function
|
|
8558
|
+
var ll = ["Layers", "Assets"];
|
|
8559
|
+
function ul() {
|
|
8478
8560
|
let [e, t] = q("Layers");
|
|
8479
8561
|
return /* @__PURE__ */ X("div", {
|
|
8480
8562
|
className: "kol-compose-rail border-b border-oq-08",
|
|
@@ -8485,7 +8567,7 @@ function Zc() {
|
|
|
8485
8567
|
children: /* @__PURE__ */ Y("div", {
|
|
8486
8568
|
className: "px-3",
|
|
8487
8569
|
children: /* @__PURE__ */ Y(Rt, {
|
|
8488
|
-
tabs:
|
|
8570
|
+
tabs: ll.map((e) => ({
|
|
8489
8571
|
id: e,
|
|
8490
8572
|
label: e
|
|
8491
8573
|
})),
|
|
@@ -8496,36 +8578,14 @@ function Zc() {
|
|
|
8496
8578
|
}), e === "Layers" && /* @__PURE__ */ Y(Kc, {})]
|
|
8497
8579
|
}), /* @__PURE__ */ X("div", {
|
|
8498
8580
|
className: "flex-1 min-h-0 overflow-y-auto",
|
|
8499
|
-
children: [e === "Layers" && /* @__PURE__ */ Y(qc, {}), e === "Assets" && /* @__PURE__ */ Y(
|
|
8581
|
+
children: [e === "Layers" && /* @__PURE__ */ Y(qc, {}), e === "Assets" && /* @__PURE__ */ Y(cl, {})]
|
|
8500
8582
|
})]
|
|
8501
8583
|
});
|
|
8502
8584
|
}
|
|
8503
8585
|
//#endregion
|
|
8504
|
-
//#region src/editor/library/
|
|
8505
|
-
var
|
|
8506
|
-
|
|
8507
|
-
label: e.label
|
|
8508
|
-
})), $c = () => nl && tl.buckets ? tl.buckets().map((e) => ({
|
|
8509
|
-
value: e.id,
|
|
8510
|
-
label: e.label
|
|
8511
|
-
})) : Qc, el = "/media/", tl = an({
|
|
8512
|
-
buckets: !0,
|
|
8513
|
-
proxyPath: el
|
|
8514
|
-
}), nl = !1, rl = (e) => {
|
|
8515
|
-
el = e, nl || (tl = an({
|
|
8516
|
-
buckets: !0,
|
|
8517
|
-
proxyPath: el
|
|
8518
|
-
}));
|
|
8519
|
-
}, il = (e) => {
|
|
8520
|
-
nl = !!e, tl = e ?? an({
|
|
8521
|
-
buckets: !0,
|
|
8522
|
-
proxyPath: el
|
|
8523
|
-
});
|
|
8524
|
-
}, al = (e, t = "r2") => tl.mediaUrl(e, t), ol = (e) => tl.proxied(e), sl = (e, t = "r2") => tl.proxied(tl.mediaUrl(e, t)), cl = (e = "", { signal: t, bucket: n = "r2" } = {}) => tl.listMedia(e, {
|
|
8525
|
-
signal: t,
|
|
8526
|
-
bucket: n
|
|
8527
|
-
}), ll = (e) => /svg/i.test(e || "");
|
|
8528
|
-
function ul(e, t) {
|
|
8586
|
+
//#region src/editor/library/MediaPicker.jsx
|
|
8587
|
+
var dl = (e) => /svg/i.test(e || "");
|
|
8588
|
+
function fl(e, t) {
|
|
8529
8589
|
let n = /* @__PURE__ */ new Set(), r = [];
|
|
8530
8590
|
for (let i of e) {
|
|
8531
8591
|
let e = t ? i.key.slice(t.length) : i.key, a = e.indexOf("/");
|
|
@@ -8539,7 +8599,7 @@ function ul(e, t) {
|
|
|
8539
8599
|
files: r
|
|
8540
8600
|
};
|
|
8541
8601
|
}
|
|
8542
|
-
function
|
|
8602
|
+
function pl({ dir: e = "left", size: t = 22 }) {
|
|
8543
8603
|
return /* @__PURE__ */ Y("svg", {
|
|
8544
8604
|
width: t,
|
|
8545
8605
|
height: t,
|
|
@@ -8555,18 +8615,18 @@ function dl({ dir: e = "left", size: t = 22 }) {
|
|
|
8555
8615
|
})
|
|
8556
8616
|
});
|
|
8557
8617
|
}
|
|
8558
|
-
function
|
|
8618
|
+
function ml({ files: e, index: t, onClose: n, onIndexChange: r, onUse: i, accept: a, bucket: o }) {
|
|
8559
8619
|
let [s, c] = q(!1);
|
|
8560
8620
|
G(() => {
|
|
8561
8621
|
c(!1);
|
|
8562
8622
|
}, [t]);
|
|
8563
8623
|
let l = e.map((e) => ({
|
|
8564
|
-
url:
|
|
8624
|
+
url: rl(e.key, o),
|
|
8565
8625
|
alt: e.displayKey,
|
|
8566
8626
|
kind: cn(e.contentType) ? "video" : "image"
|
|
8567
8627
|
})), u = async (e) => {
|
|
8568
8628
|
try {
|
|
8569
|
-
await navigator.clipboard.writeText(
|
|
8629
|
+
await navigator.clipboard.writeText(tl(e.key, o));
|
|
8570
8630
|
} catch {}
|
|
8571
8631
|
c(!0), setTimeout(() => c(!1), 1500);
|
|
8572
8632
|
};
|
|
@@ -8579,7 +8639,7 @@ function fl({ files: e, index: t, onClose: n, onIndexChange: r, onUse: i, accept
|
|
|
8579
8639
|
actions: (t, n) => {
|
|
8580
8640
|
let r = e[n];
|
|
8581
8641
|
if (!r) return null;
|
|
8582
|
-
let o = a === "video" ? cn(r.contentType) : a === "image" ? sn(r.contentType) : a === "svg" ?
|
|
8642
|
+
let o = a === "video" ? cn(r.contentType) : a === "image" ? sn(r.contentType) : a === "svg" ? dl(r.contentType) : sn(r.contentType) || cn(r.contentType);
|
|
8583
8643
|
return /* @__PURE__ */ X("div", {
|
|
8584
8644
|
className: "flex flex-col items-center gap-2",
|
|
8585
8645
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -8620,12 +8680,12 @@ function fl({ files: e, index: t, onClose: n, onIndexChange: r, onUse: i, accept
|
|
|
8620
8680
|
}
|
|
8621
8681
|
});
|
|
8622
8682
|
}
|
|
8623
|
-
function
|
|
8683
|
+
function hl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
8624
8684
|
let [i, a] = q("r2"), [o, s] = q(""), [c, l] = q(""), [u, d] = q([]), [f, p] = q(!1), [m, h] = q(null), [g, _] = q(null);
|
|
8625
8685
|
if (G(() => {
|
|
8626
8686
|
if (!e) return;
|
|
8627
8687
|
let t = new AbortController(), n = !1;
|
|
8628
|
-
return p(!0), h(null), s(""), l(""), _(null), d([]),
|
|
8688
|
+
return p(!0), h(null), s(""), l(""), _(null), d([]), il("", {
|
|
8629
8689
|
bucket: i,
|
|
8630
8690
|
signal: t.signal
|
|
8631
8691
|
}).then((e) => {
|
|
@@ -8648,8 +8708,8 @@ function pl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
|
8648
8708
|
t,
|
|
8649
8709
|
g
|
|
8650
8710
|
]), !e) return null;
|
|
8651
|
-
let v = (e) => r === "video" ? cn(e.contentType) : r === "image" ? sn(e.contentType) : r === "svg" ?
|
|
8652
|
-
n?.(
|
|
8711
|
+
let v = (e) => r === "video" ? cn(e.contentType) : r === "image" ? sn(e.contentType) : r === "svg" ? dl(e.contentType) : sn(e.contentType) || cn(e.contentType), { folders: y, files: b } = fl(o ? u.filter((e) => e.key.startsWith(o)) : u, o), x = c.trim().toLowerCase(), S = x ? y.filter((e) => e.toLowerCase().includes(x)) : y, C = (x ? b.filter((e) => e.displayKey.toLowerCase().includes(x)) : b).filter(v), w = o ? o.replace(/\/$/, "").split("/") : [], T = (e) => {
|
|
8712
|
+
n?.(tl(e.key, i), { contentType: e.contentType }), t?.();
|
|
8653
8713
|
};
|
|
8654
8714
|
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(dt, {
|
|
8655
8715
|
open: !0,
|
|
@@ -8671,7 +8731,7 @@ function pl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
|
8671
8731
|
}),
|
|
8672
8732
|
/* @__PURE__ */ Y(R, {
|
|
8673
8733
|
variant: "grey",
|
|
8674
|
-
options:
|
|
8734
|
+
options: Yc(),
|
|
8675
8735
|
value: i,
|
|
8676
8736
|
onChange: a,
|
|
8677
8737
|
"aria-label": "Store"
|
|
@@ -8737,7 +8797,7 @@ function pl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
|
8737
8797
|
children: [/* @__PURE__ */ Y("span", {
|
|
8738
8798
|
className: "kol-mono-12 text-emphasis flex-1",
|
|
8739
8799
|
children: e
|
|
8740
|
-
}), /* @__PURE__ */ Y(
|
|
8800
|
+
}), /* @__PURE__ */ Y(pl, {
|
|
8741
8801
|
dir: "right",
|
|
8742
8802
|
size: 14
|
|
8743
8803
|
})]
|
|
@@ -8759,12 +8819,12 @@ function pl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
|
8759
8819
|
children: [/* @__PURE__ */ X("div", {
|
|
8760
8820
|
className: "group relative aspect-square bg-oq-04 rounded overflow-hidden border border-oq-08 hover:border-oq-24 transition-colors",
|
|
8761
8821
|
children: [cn(e.contentType) ? /* @__PURE__ */ Y("video", {
|
|
8762
|
-
src:
|
|
8822
|
+
src: rl(e.key, i),
|
|
8763
8823
|
muted: !0,
|
|
8764
8824
|
preload: "metadata",
|
|
8765
8825
|
className: "w-full h-full object-cover"
|
|
8766
8826
|
}) : /* @__PURE__ */ Y("img", {
|
|
8767
|
-
src:
|
|
8827
|
+
src: rl(e.key, i),
|
|
8768
8828
|
alt: "",
|
|
8769
8829
|
loading: "lazy",
|
|
8770
8830
|
className: "w-full h-full object-cover"
|
|
@@ -8793,7 +8853,7 @@ function pl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
|
8793
8853
|
})
|
|
8794
8854
|
]
|
|
8795
8855
|
})
|
|
8796
|
-
}), g !== null && C[g] && /* @__PURE__ */ Y(
|
|
8856
|
+
}), g !== null && C[g] && /* @__PURE__ */ Y(ml, {
|
|
8797
8857
|
files: C,
|
|
8798
8858
|
index: g,
|
|
8799
8859
|
accept: r,
|
|
@@ -8805,7 +8865,7 @@ function pl({ open: e, onClose: t, onPick: n, accept: r = "all" }) {
|
|
|
8805
8865
|
}
|
|
8806
8866
|
//#endregion
|
|
8807
8867
|
//#region src/editor/compose/AlignmentPanel.jsx
|
|
8808
|
-
var
|
|
8868
|
+
var gl = [
|
|
8809
8869
|
{
|
|
8810
8870
|
value: "start",
|
|
8811
8871
|
label: /* @__PURE__ */ Y(Z, {
|
|
@@ -8830,7 +8890,7 @@ var ml = [
|
|
|
8830
8890
|
}),
|
|
8831
8891
|
ariaLabel: "Align right"
|
|
8832
8892
|
}
|
|
8833
|
-
],
|
|
8893
|
+
], _l = [
|
|
8834
8894
|
{
|
|
8835
8895
|
value: "start",
|
|
8836
8896
|
label: /* @__PURE__ */ Y(Z, {
|
|
@@ -8856,7 +8916,7 @@ var ml = [
|
|
|
8856
8916
|
ariaLabel: "Align bottom"
|
|
8857
8917
|
}
|
|
8858
8918
|
];
|
|
8859
|
-
function
|
|
8919
|
+
function vl() {
|
|
8860
8920
|
let { alignSelected: e } = N();
|
|
8861
8921
|
return /* @__PURE__ */ X("div", {
|
|
8862
8922
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -8865,30 +8925,30 @@ function gl() {
|
|
|
8865
8925
|
size: "sm",
|
|
8866
8926
|
ariaLabel: "Horizontal alignment",
|
|
8867
8927
|
value: null,
|
|
8868
|
-
options:
|
|
8928
|
+
options: gl,
|
|
8869
8929
|
onChange: (t) => e("h", t)
|
|
8870
8930
|
}), /* @__PURE__ */ Y(kt, {
|
|
8871
8931
|
variant: "filled",
|
|
8872
8932
|
size: "sm",
|
|
8873
8933
|
ariaLabel: "Vertical alignment",
|
|
8874
8934
|
value: null,
|
|
8875
|
-
options:
|
|
8935
|
+
options: _l,
|
|
8876
8936
|
onChange: (t) => e("v", t)
|
|
8877
8937
|
})]
|
|
8878
8938
|
});
|
|
8879
8939
|
}
|
|
8880
8940
|
//#endregion
|
|
8881
8941
|
//#region src/editor/params/schemas/text.js
|
|
8882
|
-
var
|
|
8942
|
+
var yl = F.map((e) => ({
|
|
8883
8943
|
value: e.id,
|
|
8884
8944
|
label: e.label
|
|
8885
|
-
})),
|
|
8945
|
+
})), bl = Be.map((e) => ({
|
|
8886
8946
|
value: e.id,
|
|
8887
8947
|
label: e.label
|
|
8888
|
-
})),
|
|
8948
|
+
})), xl = ue.map((e) => ({
|
|
8889
8949
|
value: e.id,
|
|
8890
8950
|
label: e.label
|
|
8891
|
-
})),
|
|
8951
|
+
})), Sl = [
|
|
8892
8952
|
{
|
|
8893
8953
|
key: "text",
|
|
8894
8954
|
label: "Content",
|
|
@@ -8901,7 +8961,7 @@ var _l = F.map((e) => ({
|
|
|
8901
8961
|
label: "Cut",
|
|
8902
8962
|
type: "select",
|
|
8903
8963
|
default: "Tight",
|
|
8904
|
-
options:
|
|
8964
|
+
options: yl,
|
|
8905
8965
|
section: "Font"
|
|
8906
8966
|
},
|
|
8907
8967
|
{
|
|
@@ -8909,7 +8969,7 @@ var _l = F.map((e) => ({
|
|
|
8909
8969
|
label: "Weight",
|
|
8910
8970
|
type: "select",
|
|
8911
8971
|
default: 600,
|
|
8912
|
-
options:
|
|
8972
|
+
options: bl,
|
|
8913
8973
|
numeric: !0,
|
|
8914
8974
|
section: "Font"
|
|
8915
8975
|
},
|
|
@@ -8918,7 +8978,7 @@ var _l = F.map((e) => ({
|
|
|
8918
8978
|
label: "Case",
|
|
8919
8979
|
type: "select",
|
|
8920
8980
|
default: "original",
|
|
8921
|
-
options:
|
|
8981
|
+
options: xl,
|
|
8922
8982
|
section: "Font"
|
|
8923
8983
|
},
|
|
8924
8984
|
{
|
|
@@ -8993,7 +9053,7 @@ var _l = F.map((e) => ({
|
|
|
8993
9053
|
format: (e) => `${Math.round(e * 100)}%`,
|
|
8994
9054
|
section: "Font"
|
|
8995
9055
|
}
|
|
8996
|
-
],
|
|
9056
|
+
], Cl = new Set([
|
|
8997
9057
|
"text",
|
|
8998
9058
|
"width",
|
|
8999
9059
|
"weight",
|
|
@@ -9004,24 +9064,24 @@ var _l = F.map((e) => ({
|
|
|
9004
9064
|
"tracking",
|
|
9005
9065
|
"lineHeight",
|
|
9006
9066
|
"axisBlend"
|
|
9007
|
-
]),
|
|
9067
|
+
]), wl = ke.map((e) => e.value === "custom" ? {
|
|
9008
9068
|
...e,
|
|
9009
9069
|
label: "Custom"
|
|
9010
|
-
} : e),
|
|
9070
|
+
} : e), Tl = F.map((e) => ({
|
|
9011
9071
|
value: e.id,
|
|
9012
9072
|
label: e.label
|
|
9013
|
-
})),
|
|
9073
|
+
})), El = Be.map((e) => ({
|
|
9014
9074
|
value: e.id,
|
|
9015
9075
|
label: e.label
|
|
9016
|
-
})),
|
|
9076
|
+
})), Dl = ue.map((e) => ({
|
|
9017
9077
|
value: e.id,
|
|
9018
9078
|
label: e.label
|
|
9019
|
-
})),
|
|
9020
|
-
...
|
|
9079
|
+
})), Ol = (e, t, n) => ({
|
|
9080
|
+
...Sl.find((t) => t.key === e),
|
|
9021
9081
|
label: t,
|
|
9022
9082
|
format: n
|
|
9023
9083
|
});
|
|
9024
|
-
function
|
|
9084
|
+
function kl(e, t) {
|
|
9025
9085
|
let n = { family: t }, r = ii(t);
|
|
9026
9086
|
if (t === "right-grotesk") (!e.width || e.width === "mono") && (n.width = "Tight"), Be.some((t) => t.id === e.weight) || (n.weight = 600);
|
|
9027
9087
|
else if (t === "jetbrains-mono") n.width = "mono", [
|
|
@@ -9035,14 +9095,14 @@ function Dl(e, t) {
|
|
|
9035
9095
|
}
|
|
9036
9096
|
return n;
|
|
9037
9097
|
}
|
|
9038
|
-
function
|
|
9098
|
+
function Al({ layer: e }) {
|
|
9039
9099
|
let { palette: n } = N(), { saveType: r } = Rn(), i = We(e.id, { history: "coalesce" }), a = i.setProp, o = $r(e), s = ii(o), [c, l] = q(!1), u = Jt({
|
|
9040
9100
|
open: c,
|
|
9041
9101
|
onOpenChange: l,
|
|
9042
9102
|
placement: "bottom-end",
|
|
9043
9103
|
offset: 4
|
|
9044
9104
|
}), d = (t) => {
|
|
9045
|
-
si(t), i.patch(
|
|
9105
|
+
si(t), i.patch(kl(e, t));
|
|
9046
9106
|
}, f = (e) => {
|
|
9047
9107
|
let t = s.find((t) => t.value === e);
|
|
9048
9108
|
t && i.patch(t.patch);
|
|
@@ -9104,7 +9164,7 @@ function Ol({ layer: e }) {
|
|
|
9104
9164
|
})),
|
|
9105
9165
|
value: ai(e),
|
|
9106
9166
|
onChange: f
|
|
9107
|
-
}), /* @__PURE__ */ Y(
|
|
9167
|
+
}), /* @__PURE__ */ Y(Nl, {
|
|
9108
9168
|
layer: e,
|
|
9109
9169
|
setProp: a
|
|
9110
9170
|
})]
|
|
@@ -9116,15 +9176,15 @@ function Ol({ layer: e }) {
|
|
|
9116
9176
|
triggerClassName: "flex min-w-0",
|
|
9117
9177
|
children: /* @__PURE__ */ X("div", {
|
|
9118
9178
|
className: "flex flex-1 items-center gap-1 min-w-0",
|
|
9119
|
-
children: [/* @__PURE__ */ Y(
|
|
9120
|
-
param:
|
|
9179
|
+
children: [/* @__PURE__ */ Y(jl, {
|
|
9180
|
+
param: Ol("lineHeight", "Line height"),
|
|
9121
9181
|
layer: e,
|
|
9122
9182
|
setProp: a,
|
|
9123
9183
|
step: .01,
|
|
9124
9184
|
icon: "line-height"
|
|
9125
9185
|
}), /* @__PURE__ */ Y(Ye, {
|
|
9126
9186
|
layer: e,
|
|
9127
|
-
param:
|
|
9187
|
+
param: Ol("lineHeight", "Line height"),
|
|
9128
9188
|
setProp: a
|
|
9129
9189
|
})]
|
|
9130
9190
|
})
|
|
@@ -9133,8 +9193,8 @@ function Ol({ layer: e }) {
|
|
|
9133
9193
|
triggerClassName: "flex min-w-0",
|
|
9134
9194
|
children: /* @__PURE__ */ X("div", {
|
|
9135
9195
|
className: "flex flex-1 items-center gap-1 min-w-0",
|
|
9136
|
-
children: [/* @__PURE__ */ Y(
|
|
9137
|
-
param:
|
|
9196
|
+
children: [/* @__PURE__ */ Y(jl, {
|
|
9197
|
+
param: Ol("tracking", "Tracking"),
|
|
9138
9198
|
layer: e,
|
|
9139
9199
|
setProp: a,
|
|
9140
9200
|
suffix: "em",
|
|
@@ -9142,7 +9202,7 @@ function Ol({ layer: e }) {
|
|
|
9142
9202
|
icon: "letter-spacing"
|
|
9143
9203
|
}), /* @__PURE__ */ Y(Ye, {
|
|
9144
9204
|
layer: e,
|
|
9145
|
-
param:
|
|
9205
|
+
param: Ol("tracking", "Tracking"),
|
|
9146
9206
|
setProp: a
|
|
9147
9207
|
})]
|
|
9148
9208
|
})
|
|
@@ -9225,7 +9285,7 @@ function Ol({ layer: e }) {
|
|
|
9225
9285
|
children: [/* @__PURE__ */ Y(B, {
|
|
9226
9286
|
label: "Case",
|
|
9227
9287
|
children: /* @__PURE__ */ Y(Vt, {
|
|
9228
|
-
options:
|
|
9288
|
+
options: Dl,
|
|
9229
9289
|
viewMode: e.case ?? "original",
|
|
9230
9290
|
onViewChange: (e) => a("case", e)
|
|
9231
9291
|
})
|
|
@@ -9248,7 +9308,7 @@ function Ol({ layer: e }) {
|
|
|
9248
9308
|
]
|
|
9249
9309
|
});
|
|
9250
9310
|
}
|
|
9251
|
-
function
|
|
9311
|
+
function jl({ param: e, layer: t, setProp: n, suffix: r, step: i, round: a = !1, icon: o, slotRight: s }) {
|
|
9252
9312
|
let c = t[e.key];
|
|
9253
9313
|
if (Ce(c)) return /* @__PURE__ */ Y("span", {
|
|
9254
9314
|
className: "kol-helper-12 text-meta italic",
|
|
@@ -9275,7 +9335,7 @@ function kl({ param: e, layer: t, setProp: n, suffix: r, step: i, round: a = !1,
|
|
|
9275
9335
|
}
|
|
9276
9336
|
});
|
|
9277
9337
|
}
|
|
9278
|
-
var
|
|
9338
|
+
var Ml = [
|
|
9279
9339
|
12,
|
|
9280
9340
|
16,
|
|
9281
9341
|
24,
|
|
@@ -9289,18 +9349,18 @@ var Al = [
|
|
|
9289
9349
|
256,
|
|
9290
9350
|
320
|
|
9291
9351
|
];
|
|
9292
|
-
function
|
|
9352
|
+
function Nl({ layer: e, setProp: t }) {
|
|
9293
9353
|
let [n, r] = q(!1), i = Jt({
|
|
9294
9354
|
open: n,
|
|
9295
9355
|
onOpenChange: r,
|
|
9296
9356
|
placement: "bottom-end",
|
|
9297
9357
|
offset: 4,
|
|
9298
9358
|
role: "menu"
|
|
9299
|
-
}), a =
|
|
9359
|
+
}), a = Ol("size", "Size");
|
|
9300
9360
|
return /* @__PURE__ */ X("div", {
|
|
9301
9361
|
className: "flex items-center gap-1 min-w-0",
|
|
9302
9362
|
children: [
|
|
9303
|
-
/* @__PURE__ */ Y(
|
|
9363
|
+
/* @__PURE__ */ Y(jl, {
|
|
9304
9364
|
param: a,
|
|
9305
9365
|
layer: e,
|
|
9306
9366
|
setProp: t,
|
|
@@ -9331,7 +9391,7 @@ function jl({ layer: e, setProp: t }) {
|
|
|
9331
9391
|
maxHeight: "40vh",
|
|
9332
9392
|
overflowY: "auto"
|
|
9333
9393
|
},
|
|
9334
|
-
children:
|
|
9394
|
+
children: Ml.map((n) => /* @__PURE__ */ X("button", {
|
|
9335
9395
|
type: "button",
|
|
9336
9396
|
onClick: () => {
|
|
9337
9397
|
t("size", n), r(!1);
|
|
@@ -9354,8 +9414,8 @@ function jl({ layer: e, setProp: t }) {
|
|
|
9354
9414
|
]
|
|
9355
9415
|
});
|
|
9356
9416
|
}
|
|
9357
|
-
function
|
|
9358
|
-
let n = e.axisMode ?? "morph", r = !!e.axisOn, i =
|
|
9417
|
+
function Pl({ layer: e, setProp: t }) {
|
|
9418
|
+
let n = e.axisMode ?? "morph", r = !!e.axisOn, i = Ol("axisBlend", n === "random" ? "Seed" : "Blend", (e) => `${Math.round(e * 100)}%`), a = (n, r, i) => /* @__PURE__ */ X("div", {
|
|
9359
9419
|
className: "flex items-center gap-2",
|
|
9360
9420
|
children: [/* @__PURE__ */ Y("span", {
|
|
9361
9421
|
className: "kol-helper-10 text-meta shrink-0",
|
|
@@ -9452,7 +9512,7 @@ function Ml({ layer: e, setProp: t }) {
|
|
|
9452
9512
|
variant: "subtle",
|
|
9453
9513
|
size: "sm",
|
|
9454
9514
|
className: "w-full",
|
|
9455
|
-
options:
|
|
9515
|
+
options: wl,
|
|
9456
9516
|
value: e.axisCurve ?? "flat",
|
|
9457
9517
|
onChange: (e) => t("axisCurve", e)
|
|
9458
9518
|
})
|
|
@@ -9466,7 +9526,7 @@ function Ml({ layer: e, setProp: t }) {
|
|
|
9466
9526
|
a("P2 Y", "curveCp2", "y")
|
|
9467
9527
|
]
|
|
9468
9528
|
}),
|
|
9469
|
-
/* @__PURE__ */ Y(
|
|
9529
|
+
/* @__PURE__ */ Y(Fl, {
|
|
9470
9530
|
param: i,
|
|
9471
9531
|
layer: e,
|
|
9472
9532
|
setProp: t
|
|
@@ -9482,7 +9542,7 @@ function Ml({ layer: e, setProp: t }) {
|
|
|
9482
9542
|
options: [{
|
|
9483
9543
|
value: "",
|
|
9484
9544
|
label: "Any"
|
|
9485
|
-
}, ...
|
|
9545
|
+
}, ...Tl],
|
|
9486
9546
|
value: e.randomWidthLock ?? "",
|
|
9487
9547
|
onChange: (e) => t("randomWidthLock", e)
|
|
9488
9548
|
})
|
|
@@ -9495,7 +9555,7 @@ function Ml({ layer: e, setProp: t }) {
|
|
|
9495
9555
|
options: [{
|
|
9496
9556
|
value: "",
|
|
9497
9557
|
label: "Any"
|
|
9498
|
-
}, ...
|
|
9558
|
+
}, ...El.map((e) => ({
|
|
9499
9559
|
value: String(e.value),
|
|
9500
9560
|
label: e.label
|
|
9501
9561
|
}))],
|
|
@@ -9507,7 +9567,7 @@ function Ml({ layer: e, setProp: t }) {
|
|
|
9507
9567
|
] })]
|
|
9508
9568
|
});
|
|
9509
9569
|
}
|
|
9510
|
-
function
|
|
9570
|
+
function Fl({ param: e, layer: t, setProp: n }) {
|
|
9511
9571
|
let r = t[e.key], i = Ce(r), a = typeof r == "number" ? r : e.default;
|
|
9512
9572
|
return /* @__PURE__ */ X("div", {
|
|
9513
9573
|
className: "flex items-center gap-2",
|
|
@@ -9540,7 +9600,7 @@ function Nl({ param: e, layer: t, setProp: n }) {
|
|
|
9540
9600
|
}
|
|
9541
9601
|
//#endregion
|
|
9542
9602
|
//#region src/editor/compose/inspectors/LayerInspector.jsx
|
|
9543
|
-
function
|
|
9603
|
+
function Il({ layer: e }) {
|
|
9544
9604
|
let { ungroupLayer: t, flipLayer: n, palette: r } = N(), i = k("generators"), a = We(e.id, { history: "coalesce" }), o = a.setProp, c = !s.includes(e.type);
|
|
9545
9605
|
return /* @__PURE__ */ X("div", {
|
|
9546
9606
|
className: "flex flex-col",
|
|
@@ -9549,12 +9609,12 @@ function Pl({ layer: e }) {
|
|
|
9549
9609
|
pane: !0,
|
|
9550
9610
|
label: "Transform",
|
|
9551
9611
|
children: [
|
|
9552
|
-
/* @__PURE__ */ Y(
|
|
9553
|
-
/* @__PURE__ */ Y(
|
|
9612
|
+
/* @__PURE__ */ Y(vl, {}),
|
|
9613
|
+
/* @__PURE__ */ Y(Kl, {
|
|
9554
9614
|
layer: e,
|
|
9555
9615
|
setProp: o
|
|
9556
9616
|
}),
|
|
9557
|
-
/* @__PURE__ */ Y(
|
|
9617
|
+
/* @__PURE__ */ Y(ql, {
|
|
9558
9618
|
layer: e,
|
|
9559
9619
|
setProp: o,
|
|
9560
9620
|
patch: a.patch
|
|
@@ -9563,7 +9623,7 @@ function Pl({ layer: e }) {
|
|
|
9563
9623
|
className: "grid grid-cols-2 gap-2",
|
|
9564
9624
|
children: [/* @__PURE__ */ X("div", {
|
|
9565
9625
|
className: "flex items-center gap-1 min-w-0",
|
|
9566
|
-
children: [/* @__PURE__ */ Y(
|
|
9626
|
+
children: [/* @__PURE__ */ Y(Wl, {
|
|
9567
9627
|
label: /* @__PURE__ */ Y(Z, {
|
|
9568
9628
|
name: "angle",
|
|
9569
9629
|
size: U("sm")
|
|
@@ -9678,7 +9738,7 @@ function Pl({ layer: e }) {
|
|
|
9678
9738
|
})
|
|
9679
9739
|
]
|
|
9680
9740
|
}),
|
|
9681
|
-
/* @__PURE__ */ Y(
|
|
9741
|
+
/* @__PURE__ */ Y(Rl, {
|
|
9682
9742
|
layer: e,
|
|
9683
9743
|
setProp: o,
|
|
9684
9744
|
first: !c
|
|
@@ -9704,11 +9764,11 @@ function Pl({ layer: e }) {
|
|
|
9704
9764
|
})
|
|
9705
9765
|
})]
|
|
9706
9766
|
}),
|
|
9707
|
-
e.type === "text" && /* @__PURE__ */ Y(
|
|
9767
|
+
e.type === "text" && /* @__PURE__ */ Y(Al, { layer: e }, e.id),
|
|
9708
9768
|
e.type === "photo" && /* @__PURE__ */ Y(_t, {
|
|
9709
9769
|
pane: !0,
|
|
9710
9770
|
label: "Image",
|
|
9711
|
-
children: /* @__PURE__ */ Y(
|
|
9771
|
+
children: /* @__PURE__ */ Y(Ul, {
|
|
9712
9772
|
layer: e,
|
|
9713
9773
|
patch: a.patch
|
|
9714
9774
|
})
|
|
@@ -9728,11 +9788,11 @@ function Pl({ layer: e }) {
|
|
|
9728
9788
|
onViewChange: (e) => o("closed", e === "closed")
|
|
9729
9789
|
})
|
|
9730
9790
|
}),
|
|
9731
|
-
/* @__PURE__ */ Y(
|
|
9791
|
+
/* @__PURE__ */ Y(Vl, { layer: e }),
|
|
9732
9792
|
e.type === "group" && /* @__PURE__ */ Y(_t, {
|
|
9733
9793
|
pane: !0,
|
|
9734
9794
|
label: "Group",
|
|
9735
|
-
children: /* @__PURE__ */ Y(
|
|
9795
|
+
children: /* @__PURE__ */ Y(Hl, {
|
|
9736
9796
|
layer: e,
|
|
9737
9797
|
ungroupLayer: t
|
|
9738
9798
|
})
|
|
@@ -9740,7 +9800,7 @@ function Pl({ layer: e }) {
|
|
|
9740
9800
|
]
|
|
9741
9801
|
});
|
|
9742
9802
|
}
|
|
9743
|
-
function
|
|
9803
|
+
function Ll({ label: e, onClick: t, active: n = !1, refProps: r = {}, children: i }) {
|
|
9744
9804
|
return /* @__PURE__ */ Y(H, {
|
|
9745
9805
|
asChild: !0,
|
|
9746
9806
|
label: e,
|
|
@@ -9760,7 +9820,7 @@ function Fl({ label: e, onClick: t, active: n = !1, refProps: r = {}, children:
|
|
|
9760
9820
|
})
|
|
9761
9821
|
});
|
|
9762
9822
|
}
|
|
9763
|
-
function
|
|
9823
|
+
function Rl({ layer: e, setProp: t, first: n }) {
|
|
9764
9824
|
let { toggleLayer: r } = N(), [i, a] = q(!1), o = Jt({
|
|
9765
9825
|
open: i,
|
|
9766
9826
|
onOpenChange: a,
|
|
@@ -9774,7 +9834,7 @@ function Il({ layer: e, setProp: t, first: n }) {
|
|
|
9774
9834
|
pane: !0,
|
|
9775
9835
|
label: "Appearance",
|
|
9776
9836
|
actions: /* @__PURE__ */ X(J, { children: [
|
|
9777
|
-
/* @__PURE__ */ Y(
|
|
9837
|
+
/* @__PURE__ */ Y(Ll, {
|
|
9778
9838
|
label: c ? "Hide layer" : "Show layer",
|
|
9779
9839
|
active: !c,
|
|
9780
9840
|
onClick: () => r(e.id),
|
|
@@ -9783,7 +9843,7 @@ function Il({ layer: e, setProp: t, first: n }) {
|
|
|
9783
9843
|
size: U("sm")
|
|
9784
9844
|
})
|
|
9785
9845
|
}),
|
|
9786
|
-
/* @__PURE__ */ Y(
|
|
9846
|
+
/* @__PURE__ */ Y(Ll, {
|
|
9787
9847
|
label: `Blend: ${Qe.find((e) => e.value === l)?.label ?? l}`,
|
|
9788
9848
|
active: l !== "normal" || i,
|
|
9789
9849
|
refProps: {
|
|
@@ -9855,15 +9915,15 @@ function Il({ layer: e, setProp: t, first: n }) {
|
|
|
9855
9915
|
})
|
|
9856
9916
|
});
|
|
9857
9917
|
}
|
|
9858
|
-
var
|
|
9918
|
+
var zl = {
|
|
9859
9919
|
shape: () => "Shape parameters",
|
|
9860
9920
|
pattern: () => "Pattern parameters",
|
|
9861
9921
|
loop: (e) => `Loop · ${e.presetLabel ?? "parameters"}`,
|
|
9862
9922
|
misc: (e) => `Misc · ${e.presetLabel ?? "parameters"}`,
|
|
9863
9923
|
kinetic: (e) => `Kinetic · ${e.presetLabel ?? "parameters"}`
|
|
9864
|
-
},
|
|
9865
|
-
function
|
|
9866
|
-
let t = () => window.dispatchEvent(new CustomEvent(
|
|
9924
|
+
}, Bl = { pattern: "kol:open-pattern" };
|
|
9925
|
+
function Vl({ layer: e }) {
|
|
9926
|
+
let t = () => window.dispatchEvent(new CustomEvent(Bl[e.type] ?? "kol:open-params")), n = zl[e.type];
|
|
9867
9927
|
return n ? /* @__PURE__ */ Y(_t, {
|
|
9868
9928
|
pane: !0,
|
|
9869
9929
|
label: "Parameters",
|
|
@@ -9880,7 +9940,7 @@ function zl({ layer: e }) {
|
|
|
9880
9940
|
})
|
|
9881
9941
|
}) : null;
|
|
9882
9942
|
}
|
|
9883
|
-
function
|
|
9943
|
+
function Hl({ layer: e, ungroupLayer: t }) {
|
|
9884
9944
|
let n = Array.isArray(e.children) ? e.children.length : 0;
|
|
9885
9945
|
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(B, {
|
|
9886
9946
|
label: "Children",
|
|
@@ -9900,7 +9960,7 @@ function Bl({ layer: e, ungroupLayer: t }) {
|
|
|
9900
9960
|
children: "Ungroup"
|
|
9901
9961
|
})] });
|
|
9902
9962
|
}
|
|
9903
|
-
function
|
|
9963
|
+
function Ul({ layer: e, patch: t }) {
|
|
9904
9964
|
let n = K(null), [r, i] = q(!1);
|
|
9905
9965
|
return G(() => {
|
|
9906
9966
|
let t = (t) => {
|
|
@@ -9983,12 +10043,12 @@ function Vl({ layer: e, patch: t }) {
|
|
|
9983
10043
|
})
|
|
9984
10044
|
]
|
|
9985
10045
|
}),
|
|
9986
|
-
/* @__PURE__ */ Y(
|
|
10046
|
+
/* @__PURE__ */ Y(hl, {
|
|
9987
10047
|
open: r,
|
|
9988
10048
|
onClose: () => i(!1),
|
|
9989
10049
|
onPick: (e, { contentType: n } = {}) => {
|
|
9990
10050
|
t({
|
|
9991
|
-
src:
|
|
10051
|
+
src: nl(e),
|
|
9992
10052
|
srcType: cn(n) ? "video" : "image"
|
|
9993
10053
|
});
|
|
9994
10054
|
}
|
|
@@ -9996,7 +10056,7 @@ function Vl({ layer: e, patch: t }) {
|
|
|
9996
10056
|
]
|
|
9997
10057
|
});
|
|
9998
10058
|
}
|
|
9999
|
-
function
|
|
10059
|
+
function Wl({ label: e, value: t, onCommit: n, suffix: r, tooltip: i }) {
|
|
10000
10060
|
return /* @__PURE__ */ Y(H, {
|
|
10001
10061
|
label: i,
|
|
10002
10062
|
triggerClassName: "flex flex-1 min-w-0",
|
|
@@ -10014,27 +10074,27 @@ function Hl({ label: e, value: t, onCommit: n, suffix: r, tooltip: i }) {
|
|
|
10014
10074
|
})
|
|
10015
10075
|
});
|
|
10016
10076
|
}
|
|
10017
|
-
var
|
|
10077
|
+
var Gl = (e) => {
|
|
10018
10078
|
let t = Number(e);
|
|
10019
10079
|
return Number.isFinite(t) ? Math.round(t) : 0;
|
|
10020
10080
|
};
|
|
10021
|
-
function
|
|
10081
|
+
function Kl({ layer: e, setProp: t }) {
|
|
10022
10082
|
return /* @__PURE__ */ X("div", {
|
|
10023
10083
|
className: "grid grid-cols-2 gap-2",
|
|
10024
|
-
children: [/* @__PURE__ */ Y(
|
|
10084
|
+
children: [/* @__PURE__ */ Y(Wl, {
|
|
10025
10085
|
label: "X",
|
|
10026
10086
|
tooltip: "X position",
|
|
10027
10087
|
value: Math.round(e.x),
|
|
10028
|
-
onCommit: (e) => t("x",
|
|
10029
|
-
}), /* @__PURE__ */ Y(
|
|
10088
|
+
onCommit: (e) => t("x", Gl(e))
|
|
10089
|
+
}), /* @__PURE__ */ Y(Wl, {
|
|
10030
10090
|
label: "Y",
|
|
10031
10091
|
tooltip: "Y position",
|
|
10032
10092
|
value: Math.round(e.y),
|
|
10033
|
-
onCommit: (e) => t("y",
|
|
10093
|
+
onCommit: (e) => t("y", Gl(e))
|
|
10034
10094
|
})]
|
|
10035
10095
|
});
|
|
10036
10096
|
}
|
|
10037
|
-
function
|
|
10097
|
+
function ql({ layer: e, setProp: t, patch: n }) {
|
|
10038
10098
|
let r = Number.isFinite(e.aspectLocked) && e.aspectLocked > 0 ? e.aspectLocked : null, i = r !== null, a = () => {
|
|
10039
10099
|
i ? t("aspectLocked", null) : e.h > 0 && t("aspectLocked", e.w / e.h);
|
|
10040
10100
|
}, o = e.type === "path" && Array.isArray(e.nodes), s = (t) => {
|
|
@@ -10050,23 +10110,23 @@ function Gl({ layer: e, setProp: t, patch: n }) {
|
|
|
10050
10110
|
className: "flex items-center gap-2",
|
|
10051
10111
|
children: [/* @__PURE__ */ X("div", {
|
|
10052
10112
|
className: "grid grid-cols-2 gap-2 flex-1 min-w-0",
|
|
10053
|
-
children: [/* @__PURE__ */ Y(
|
|
10113
|
+
children: [/* @__PURE__ */ Y(Wl, {
|
|
10054
10114
|
label: "W",
|
|
10055
10115
|
tooltip: "Width",
|
|
10056
10116
|
value: Math.round(e.w),
|
|
10057
10117
|
onCommit: (e) => {
|
|
10058
|
-
let a = Math.max(8,
|
|
10118
|
+
let a = Math.max(8, Gl(e));
|
|
10059
10119
|
i ? n(s({
|
|
10060
10120
|
w: a,
|
|
10061
10121
|
h: Math.max(8, Math.round(a / r))
|
|
10062
10122
|
})) : o ? n(s({ w: a })) : t("w", a);
|
|
10063
10123
|
}
|
|
10064
|
-
}), /* @__PURE__ */ Y(
|
|
10124
|
+
}), /* @__PURE__ */ Y(Wl, {
|
|
10065
10125
|
label: "H",
|
|
10066
10126
|
tooltip: "Height",
|
|
10067
10127
|
value: Math.round(e.h),
|
|
10068
10128
|
onCommit: (e) => {
|
|
10069
|
-
let a = Math.max(8,
|
|
10129
|
+
let a = Math.max(8, Gl(e));
|
|
10070
10130
|
i ? n(s({
|
|
10071
10131
|
w: Math.max(8, Math.round(a * r)),
|
|
10072
10132
|
h: a
|
|
@@ -10088,11 +10148,11 @@ function Gl({ layer: e, setProp: t, patch: n }) {
|
|
|
10088
10148
|
}
|
|
10089
10149
|
//#endregion
|
|
10090
10150
|
//#region src/editor/compose/inspectors/CanvasInspector.jsx
|
|
10091
|
-
var
|
|
10151
|
+
var Jl = i.map((e) => ({
|
|
10092
10152
|
value: e.id,
|
|
10093
10153
|
label: e.label
|
|
10094
10154
|
}));
|
|
10095
|
-
function
|
|
10155
|
+
function Yl() {
|
|
10096
10156
|
let e = Es(), { aspect: t, setAspect: n, canvasW: r, canvasH: i, setCanvasSize: a, showGrid: o, toggleGrid: s, canvasFill: c, setCanvasFill: l, canvasFillOpacity: u, setCanvasFillOpacity: d, infiniteFill: f, setInfiniteFill: p, palette: m } = N(), h = (e, t) => {
|
|
10097
10157
|
let n = Number(e);
|
|
10098
10158
|
return Number.isFinite(n) && n > 0 ? Math.round(n) : t;
|
|
@@ -10109,7 +10169,7 @@ function ql() {
|
|
|
10109
10169
|
variant: "subtle",
|
|
10110
10170
|
size: "sm",
|
|
10111
10171
|
className: "w-full",
|
|
10112
|
-
options:
|
|
10172
|
+
options: Jl,
|
|
10113
10173
|
value: t,
|
|
10114
10174
|
onChange: n
|
|
10115
10175
|
})
|
|
@@ -10118,12 +10178,12 @@ function ql() {
|
|
|
10118
10178
|
className: "flex flex-col gap-1",
|
|
10119
10179
|
children: /* @__PURE__ */ X("div", {
|
|
10120
10180
|
className: "grid grid-cols-2 gap-2",
|
|
10121
|
-
children: [/* @__PURE__ */ Y(
|
|
10181
|
+
children: [/* @__PURE__ */ Y(Xl, {
|
|
10122
10182
|
label: "W",
|
|
10123
10183
|
value: r,
|
|
10124
10184
|
onCommit: (e) => a(e, i),
|
|
10125
10185
|
num: h
|
|
10126
|
-
}), /* @__PURE__ */ Y(
|
|
10186
|
+
}), /* @__PURE__ */ Y(Xl, {
|
|
10127
10187
|
label: "H",
|
|
10128
10188
|
value: i,
|
|
10129
10189
|
onCommit: (e) => a(r, e),
|
|
@@ -10175,7 +10235,7 @@ function ql() {
|
|
|
10175
10235
|
})]
|
|
10176
10236
|
});
|
|
10177
10237
|
}
|
|
10178
|
-
function
|
|
10238
|
+
function Xl({ label: e, value: t, onCommit: n, num: r }) {
|
|
10179
10239
|
return /* @__PURE__ */ Y(he, {
|
|
10180
10240
|
variant: "filled",
|
|
10181
10241
|
size: "sm",
|
|
@@ -10188,17 +10248,17 @@ function Jl({ label: e, value: t, onCommit: n, num: r }) {
|
|
|
10188
10248
|
}
|
|
10189
10249
|
//#endregion
|
|
10190
10250
|
//#region src/editor/compose/InspectorRail.jsx
|
|
10191
|
-
function
|
|
10251
|
+
function Zl() {
|
|
10192
10252
|
let { selectedIds: e, layers: t, groupLayers: n } = N();
|
|
10193
10253
|
return /* @__PURE__ */ Y(gt, {
|
|
10194
10254
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
10195
10255
|
selectedIds: e,
|
|
10196
10256
|
canvasId: "canvas",
|
|
10197
10257
|
renderers: {
|
|
10198
|
-
canvas: () => /* @__PURE__ */ Y(
|
|
10258
|
+
canvas: () => /* @__PURE__ */ Y(Yl, {}),
|
|
10199
10259
|
single: (e) => {
|
|
10200
10260
|
let n = Ee(t, e);
|
|
10201
|
-
return n ? /* @__PURE__ */ Y(
|
|
10261
|
+
return n ? /* @__PURE__ */ Y(Il, { layer: n }) : null;
|
|
10202
10262
|
},
|
|
10203
10263
|
multi: (e) => /* @__PURE__ */ X(_t, {
|
|
10204
10264
|
pane: !0,
|
|
@@ -10207,7 +10267,7 @@ function Yl() {
|
|
|
10207
10267
|
className: "kol-helper-12 text-meta",
|
|
10208
10268
|
children: [e.length, " layers selected."]
|
|
10209
10269
|
}),
|
|
10210
|
-
/* @__PURE__ */ Y(
|
|
10270
|
+
/* @__PURE__ */ Y(vl, {}),
|
|
10211
10271
|
/* @__PURE__ */ Y(L, {
|
|
10212
10272
|
variant: "primary",
|
|
10213
10273
|
size: "sm",
|
|
@@ -10223,7 +10283,7 @@ function Yl() {
|
|
|
10223
10283
|
}
|
|
10224
10284
|
//#endregion
|
|
10225
10285
|
//#region src/editor/params/schemas/shape.js
|
|
10226
|
-
var
|
|
10286
|
+
var Ql = [
|
|
10227
10287
|
{
|
|
10228
10288
|
value: "logo",
|
|
10229
10289
|
label: "Logo"
|
|
@@ -10256,7 +10316,7 @@ var Xl = [
|
|
|
10256
10316
|
value: "flatten",
|
|
10257
10317
|
label: "Flatten"
|
|
10258
10318
|
}
|
|
10259
|
-
],
|
|
10319
|
+
], $l = [
|
|
10260
10320
|
{
|
|
10261
10321
|
value: "logomark",
|
|
10262
10322
|
label: "Logomark"
|
|
@@ -10273,41 +10333,41 @@ var Xl = [
|
|
|
10273
10333
|
value: "lockup-vert",
|
|
10274
10334
|
label: "Lockup · vertical"
|
|
10275
10335
|
}
|
|
10276
|
-
],
|
|
10336
|
+
], eu = [{
|
|
10277
10337
|
value: "fill",
|
|
10278
10338
|
label: "Stretch (fill)"
|
|
10279
10339
|
}, {
|
|
10280
10340
|
value: "contain",
|
|
10281
10341
|
label: "Aspect (contain)"
|
|
10282
|
-
}],
|
|
10342
|
+
}], tu = [{
|
|
10283
10343
|
value: "\\",
|
|
10284
10344
|
label: "↘"
|
|
10285
10345
|
}, {
|
|
10286
10346
|
value: "/",
|
|
10287
10347
|
label: "↗"
|
|
10288
|
-
}],
|
|
10348
|
+
}], nu = (e) => (t) => (t.kind ?? "logo") === e, ru = [
|
|
10289
10349
|
{
|
|
10290
10350
|
key: "kind",
|
|
10291
10351
|
label: "Kind",
|
|
10292
10352
|
type: "select",
|
|
10293
10353
|
default: "logo",
|
|
10294
|
-
options:
|
|
10354
|
+
options: Ql
|
|
10295
10355
|
},
|
|
10296
10356
|
{
|
|
10297
10357
|
key: "variant",
|
|
10298
10358
|
label: "Variant",
|
|
10299
10359
|
type: "select",
|
|
10300
10360
|
default: "logomark",
|
|
10301
|
-
options:
|
|
10302
|
-
when:
|
|
10361
|
+
options: $l,
|
|
10362
|
+
when: nu("logo")
|
|
10303
10363
|
},
|
|
10304
10364
|
{
|
|
10305
10365
|
key: "fit",
|
|
10306
10366
|
label: "Fit",
|
|
10307
10367
|
type: "segmented",
|
|
10308
10368
|
default: "fill",
|
|
10309
|
-
options:
|
|
10310
|
-
when:
|
|
10369
|
+
options: eu,
|
|
10370
|
+
when: nu("flatten")
|
|
10311
10371
|
},
|
|
10312
10372
|
{
|
|
10313
10373
|
key: "sides",
|
|
@@ -10318,7 +10378,7 @@ var Xl = [
|
|
|
10318
10378
|
step: 1,
|
|
10319
10379
|
default: 5,
|
|
10320
10380
|
format: (e) => `${e}`,
|
|
10321
|
-
when:
|
|
10381
|
+
when: nu("polygon"),
|
|
10322
10382
|
animatable: !1,
|
|
10323
10383
|
section: "Geometry"
|
|
10324
10384
|
},
|
|
@@ -10331,7 +10391,7 @@ var Xl = [
|
|
|
10331
10391
|
step: 1,
|
|
10332
10392
|
default: 5,
|
|
10333
10393
|
format: (e) => `${e}`,
|
|
10334
|
-
when:
|
|
10394
|
+
when: nu("star"),
|
|
10335
10395
|
animatable: !1,
|
|
10336
10396
|
section: "Geometry"
|
|
10337
10397
|
},
|
|
@@ -10344,7 +10404,7 @@ var Xl = [
|
|
|
10344
10404
|
step: .05,
|
|
10345
10405
|
default: .5,
|
|
10346
10406
|
format: (e) => e.toFixed(2),
|
|
10347
|
-
when:
|
|
10407
|
+
when: nu("star"),
|
|
10348
10408
|
animatable: !1,
|
|
10349
10409
|
section: "Geometry"
|
|
10350
10410
|
},
|
|
@@ -10353,11 +10413,11 @@ var Xl = [
|
|
|
10353
10413
|
label: "Slope",
|
|
10354
10414
|
type: "segmented",
|
|
10355
10415
|
default: "\\",
|
|
10356
|
-
options:
|
|
10357
|
-
when:
|
|
10416
|
+
options: tu,
|
|
10417
|
+
when: nu("line"),
|
|
10358
10418
|
section: "Geometry"
|
|
10359
10419
|
}
|
|
10360
|
-
],
|
|
10420
|
+
], iu = [
|
|
10361
10421
|
{
|
|
10362
10422
|
key: "shapeId",
|
|
10363
10423
|
label: "Shape",
|
|
@@ -10461,7 +10521,7 @@ var Xl = [
|
|
|
10461
10521
|
when: (e) => !!e.bgOn,
|
|
10462
10522
|
section: "Color"
|
|
10463
10523
|
}
|
|
10464
|
-
],
|
|
10524
|
+
], au = (e) => e.srcType === "video", ou = (e) => e.srcType === "webcam", su = (e) => `${Math.round(e * 100)}%`, cu = [
|
|
10465
10525
|
{
|
|
10466
10526
|
key: "fit",
|
|
10467
10527
|
label: "Fit",
|
|
@@ -10491,7 +10551,7 @@ var Xl = [
|
|
|
10491
10551
|
step: .05,
|
|
10492
10552
|
default: 1,
|
|
10493
10553
|
section: "Video",
|
|
10494
|
-
when:
|
|
10554
|
+
when: au
|
|
10495
10555
|
},
|
|
10496
10556
|
{
|
|
10497
10557
|
key: "trimIn",
|
|
@@ -10501,10 +10561,10 @@ var Xl = [
|
|
|
10501
10561
|
max: 1,
|
|
10502
10562
|
step: .01,
|
|
10503
10563
|
default: 0,
|
|
10504
|
-
format:
|
|
10564
|
+
format: su,
|
|
10505
10565
|
animatable: !1,
|
|
10506
10566
|
section: "Video",
|
|
10507
|
-
when:
|
|
10567
|
+
when: au
|
|
10508
10568
|
},
|
|
10509
10569
|
{
|
|
10510
10570
|
key: "trimOut",
|
|
@@ -10514,10 +10574,10 @@ var Xl = [
|
|
|
10514
10574
|
max: 1,
|
|
10515
10575
|
step: .01,
|
|
10516
10576
|
default: 1,
|
|
10517
|
-
format:
|
|
10577
|
+
format: su,
|
|
10518
10578
|
animatable: !1,
|
|
10519
10579
|
section: "Video",
|
|
10520
|
-
when:
|
|
10580
|
+
when: au
|
|
10521
10581
|
},
|
|
10522
10582
|
{
|
|
10523
10583
|
key: "videoLoop",
|
|
@@ -10525,7 +10585,7 @@ var Xl = [
|
|
|
10525
10585
|
type: "toggle",
|
|
10526
10586
|
default: !0,
|
|
10527
10587
|
section: "Video",
|
|
10528
|
-
when:
|
|
10588
|
+
when: au
|
|
10529
10589
|
},
|
|
10530
10590
|
{
|
|
10531
10591
|
key: "videoMuted",
|
|
@@ -10533,7 +10593,7 @@ var Xl = [
|
|
|
10533
10593
|
type: "toggle",
|
|
10534
10594
|
default: !0,
|
|
10535
10595
|
section: "Video",
|
|
10536
|
-
when:
|
|
10596
|
+
when: au
|
|
10537
10597
|
},
|
|
10538
10598
|
{
|
|
10539
10599
|
key: "mirror",
|
|
@@ -10541,9 +10601,9 @@ var Xl = [
|
|
|
10541
10601
|
type: "toggle",
|
|
10542
10602
|
default: !0,
|
|
10543
10603
|
section: "Camera",
|
|
10544
|
-
when:
|
|
10604
|
+
when: ou
|
|
10545
10605
|
}
|
|
10546
|
-
],
|
|
10606
|
+
], lu = [
|
|
10547
10607
|
{
|
|
10548
10608
|
value: "generate",
|
|
10549
10609
|
label: "Generate"
|
|
@@ -10556,21 +10616,21 @@ var Xl = [
|
|
|
10556
10616
|
value: "anim",
|
|
10557
10617
|
label: "Animation"
|
|
10558
10618
|
}
|
|
10559
|
-
],
|
|
10560
|
-
function
|
|
10619
|
+
], uu = Sl.filter((e) => !Cl.has(e.key));
|
|
10620
|
+
function du() {
|
|
10561
10621
|
let { selectedId: e, layers: t } = N(), n = e && e !== "canvas" ? Ee(t, e) : null;
|
|
10562
10622
|
return /* @__PURE__ */ Y("div", {
|
|
10563
10623
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
10564
10624
|
children: /* @__PURE__ */ Y("div", {
|
|
10565
10625
|
className: "kol-compose-inspector-body",
|
|
10566
|
-
children: n ? /* @__PURE__ */ Y(
|
|
10626
|
+
children: n ? /* @__PURE__ */ Y(fu, { layer: n }, n.id) : /* @__PURE__ */ Y(Ue, {
|
|
10567
10627
|
className: "kol-helper-12 text-meta",
|
|
10568
10628
|
children: "Select a layer to edit its parameters."
|
|
10569
10629
|
})
|
|
10570
10630
|
})
|
|
10571
10631
|
});
|
|
10572
10632
|
}
|
|
10573
|
-
function
|
|
10633
|
+
function fu({ layer: e }) {
|
|
10574
10634
|
let { updateLayer: t, convertShapeToPath: n, palette: r } = N(), i = We(e.id, { history: "coalesce" }), a = i.setProp, [o, s] = q("style");
|
|
10575
10635
|
G(() => {
|
|
10576
10636
|
let e = (e) => {
|
|
@@ -10594,7 +10654,7 @@ function uu({ layer: e }) {
|
|
|
10594
10654
|
variant: "filled",
|
|
10595
10655
|
value: o,
|
|
10596
10656
|
onChange: s,
|
|
10597
|
-
options:
|
|
10657
|
+
options: lu
|
|
10598
10658
|
}), d = null, f = !1;
|
|
10599
10659
|
if (e.type === "shape") d = /* @__PURE__ */ X(J, { children: [
|
|
10600
10660
|
o === "generate" && [
|
|
@@ -10616,7 +10676,7 @@ function uu({ layer: e }) {
|
|
|
10616
10676
|
})
|
|
10617
10677
|
}),
|
|
10618
10678
|
o === "style" && /* @__PURE__ */ Y(He, {
|
|
10619
|
-
schema:
|
|
10679
|
+
schema: ru,
|
|
10620
10680
|
layer: e,
|
|
10621
10681
|
setProp: a,
|
|
10622
10682
|
palette: r,
|
|
@@ -10625,10 +10685,10 @@ function uu({ layer: e }) {
|
|
|
10625
10685
|
}),
|
|
10626
10686
|
o === "anim" && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ge, {
|
|
10627
10687
|
layer: e,
|
|
10628
|
-
schema:
|
|
10688
|
+
schema: ru,
|
|
10629
10689
|
setProp: a
|
|
10630
10690
|
}), /* @__PURE__ */ Y(He, {
|
|
10631
|
-
schema:
|
|
10691
|
+
schema: ru,
|
|
10632
10692
|
layer: e,
|
|
10633
10693
|
setProp: a,
|
|
10634
10694
|
palette: r,
|
|
@@ -10636,10 +10696,10 @@ function uu({ layer: e }) {
|
|
|
10636
10696
|
tab: "anim"
|
|
10637
10697
|
})] })
|
|
10638
10698
|
] });
|
|
10639
|
-
else if (e.type === "text") d = /* @__PURE__ */ Y(
|
|
10640
|
-
else if (e.type === "pattern") d = /* @__PURE__ */ Y(
|
|
10699
|
+
else if (e.type === "text") d = /* @__PURE__ */ Y(mu, { ...l });
|
|
10700
|
+
else if (e.type === "pattern") d = /* @__PURE__ */ Y(pu, { ...l });
|
|
10641
10701
|
else if (e.type === "photo") d = /* @__PURE__ */ X(J, { children: [o === "style" && /* @__PURE__ */ Y(He, {
|
|
10642
|
-
schema:
|
|
10702
|
+
schema: cu,
|
|
10643
10703
|
layer: e,
|
|
10644
10704
|
setProp: a,
|
|
10645
10705
|
palette: r,
|
|
@@ -10647,10 +10707,10 @@ function uu({ layer: e }) {
|
|
|
10647
10707
|
tab: "style"
|
|
10648
10708
|
}), o === "anim" && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ge, {
|
|
10649
10709
|
layer: e,
|
|
10650
|
-
schema:
|
|
10710
|
+
schema: cu,
|
|
10651
10711
|
setProp: a
|
|
10652
10712
|
}), /* @__PURE__ */ Y(He, {
|
|
10653
|
-
schema:
|
|
10713
|
+
schema: cu,
|
|
10654
10714
|
layer: e,
|
|
10655
10715
|
setProp: a,
|
|
10656
10716
|
palette: r,
|
|
@@ -10698,7 +10758,7 @@ function uu({ layer: e }) {
|
|
|
10698
10758
|
children: [!f && u, d]
|
|
10699
10759
|
});
|
|
10700
10760
|
}
|
|
10701
|
-
function
|
|
10761
|
+
function pu({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i, tab: a }) {
|
|
10702
10762
|
let { library: o } = Rn(), { flattenPattern: s } = N(), c = o.pattern ?? [], l = [{
|
|
10703
10763
|
value: "",
|
|
10704
10764
|
label: "— pick spec"
|
|
@@ -10752,10 +10812,10 @@ function du({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i
|
|
|
10752
10812
|
}),
|
|
10753
10813
|
a === "anim" && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ge, {
|
|
10754
10814
|
layer: e,
|
|
10755
|
-
schema:
|
|
10815
|
+
schema: iu,
|
|
10756
10816
|
setProp: t
|
|
10757
10817
|
}), /* @__PURE__ */ Y(He, {
|
|
10758
|
-
schema:
|
|
10818
|
+
schema: iu,
|
|
10759
10819
|
layer: e,
|
|
10760
10820
|
setProp: t,
|
|
10761
10821
|
palette: r,
|
|
@@ -10764,7 +10824,7 @@ function du({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i
|
|
|
10764
10824
|
})] })
|
|
10765
10825
|
] });
|
|
10766
10826
|
}
|
|
10767
|
-
function
|
|
10827
|
+
function mu({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i, tab: a }) {
|
|
10768
10828
|
let { library: o } = Rn(), { flattenText: s } = N(), c = o.type ?? [], l = () => s(e.id), u = [{
|
|
10769
10829
|
value: "",
|
|
10770
10830
|
label: "— free-form"
|
|
@@ -10809,11 +10869,11 @@ function fu({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i
|
|
|
10809
10869
|
children: "Flatten"
|
|
10810
10870
|
})
|
|
10811
10871
|
})] }),
|
|
10812
|
-
a === "style" && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(
|
|
10872
|
+
a === "style" && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Pl, {
|
|
10813
10873
|
layer: e,
|
|
10814
10874
|
setProp: t
|
|
10815
10875
|
}), /* @__PURE__ */ Y(He, {
|
|
10816
|
-
schema:
|
|
10876
|
+
schema: uu,
|
|
10817
10877
|
layer: e,
|
|
10818
10878
|
setProp: t,
|
|
10819
10879
|
palette: r,
|
|
@@ -10822,10 +10882,10 @@ function fu({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i
|
|
|
10822
10882
|
})] }),
|
|
10823
10883
|
a === "anim" && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ge, {
|
|
10824
10884
|
layer: e,
|
|
10825
|
-
schema:
|
|
10885
|
+
schema: Sl,
|
|
10826
10886
|
setProp: t
|
|
10827
10887
|
}), /* @__PURE__ */ Y(He, {
|
|
10828
|
-
schema:
|
|
10888
|
+
schema: Sl,
|
|
10829
10889
|
layer: e,
|
|
10830
10890
|
setProp: t,
|
|
10831
10891
|
palette: r,
|
|
@@ -10836,13 +10896,13 @@ function fu({ layer: e, setProp: t, updateLayer: n, palette: r, renderAnimate: i
|
|
|
10836
10896
|
}
|
|
10837
10897
|
//#endregion
|
|
10838
10898
|
//#region src/editor/modes/pattern/ColorPicker.jsx
|
|
10839
|
-
var
|
|
10899
|
+
var hu = [{
|
|
10840
10900
|
value: "color",
|
|
10841
10901
|
label: "Color"
|
|
10842
10902
|
}, {
|
|
10843
10903
|
value: "background",
|
|
10844
10904
|
label: "Background"
|
|
10845
|
-
}],
|
|
10905
|
+
}], gu = [
|
|
10846
10906
|
"--kol-color-cream-100",
|
|
10847
10907
|
"--kol-color-cream-200",
|
|
10848
10908
|
"--kol-color-cream-300",
|
|
@@ -10853,7 +10913,7 @@ var pu = [{
|
|
|
10853
10913
|
"--kol-color-red-300",
|
|
10854
10914
|
"--kol-color-red-400",
|
|
10855
10915
|
"--kol-color-red-500"
|
|
10856
|
-
],
|
|
10916
|
+
], _u = [
|
|
10857
10917
|
"--grey-50",
|
|
10858
10918
|
"--grey-100",
|
|
10859
10919
|
"--grey-200",
|
|
@@ -10865,7 +10925,7 @@ var pu = [{
|
|
|
10865
10925
|
"--grey-800",
|
|
10866
10926
|
"--grey-900"
|
|
10867
10927
|
];
|
|
10868
|
-
function
|
|
10928
|
+
function vu({ values: e, onChange: n, onCopyCss: r, onReset: i }) {
|
|
10869
10929
|
let [a, o] = q("color"), s = e?.[a], c = s ?? "", l = s === null, { palette: u } = N(), d = (e) => n?.(a, e), f = (e, t) => {
|
|
10870
10930
|
t.altKey ? (t.preventDefault(), d(null)) : d(e);
|
|
10871
10931
|
}, p = (e) => {
|
|
@@ -10877,12 +10937,12 @@ function gu({ values: e, onChange: n, onCopyCss: r, onReset: i }) {
|
|
|
10877
10937
|
let n = t(e, u);
|
|
10878
10938
|
n && d(n);
|
|
10879
10939
|
} else d(e);
|
|
10880
|
-
}, m = Qt(() => [
|
|
10940
|
+
}, m = Qt(() => [gu.map((e) => S(e)), _u.map((e) => S(e))], []);
|
|
10881
10941
|
return /* @__PURE__ */ X("div", {
|
|
10882
10942
|
className: "flex flex-col gap-3",
|
|
10883
10943
|
children: [
|
|
10884
10944
|
/* @__PURE__ */ Y(Vt, {
|
|
10885
|
-
options:
|
|
10945
|
+
options: hu,
|
|
10886
10946
|
viewMode: a,
|
|
10887
10947
|
onViewChange: o
|
|
10888
10948
|
}),
|
|
@@ -10925,31 +10985,31 @@ function gu({ values: e, onChange: n, onCopyCss: r, onReset: i }) {
|
|
|
10925
10985
|
}
|
|
10926
10986
|
//#endregion
|
|
10927
10987
|
//#region src/editor/compose/inspectors/PatternPanel.jsx
|
|
10928
|
-
var
|
|
10988
|
+
var yu = {
|
|
10929
10989
|
cols: { label: "Columns" },
|
|
10930
10990
|
rows: { label: "Rows" },
|
|
10931
10991
|
bgOn: {
|
|
10932
10992
|
label: "Bg",
|
|
10933
10993
|
section: "Tile"
|
|
10934
10994
|
}
|
|
10935
|
-
},
|
|
10995
|
+
}, bu = iu.filter((e) => e.key !== "bg").map((e) => yu[e.key] ? {
|
|
10936
10996
|
...e,
|
|
10937
|
-
...
|
|
10997
|
+
...yu[e.key]
|
|
10938
10998
|
} : e);
|
|
10939
|
-
function
|
|
10999
|
+
function xu() {
|
|
10940
11000
|
let { selectedId: e, layers: t } = N(), n = e && e !== "canvas" ? Ee(t, e) : null, r = n?.type === "pattern" ? n : null;
|
|
10941
11001
|
return /* @__PURE__ */ Y("div", {
|
|
10942
11002
|
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
10943
11003
|
children: /* @__PURE__ */ Y("div", {
|
|
10944
11004
|
className: "kol-compose-inspector-body",
|
|
10945
|
-
children: r ? /* @__PURE__ */ Y(
|
|
11005
|
+
children: r ? /* @__PURE__ */ Y(Su, { layer: r }, r.id) : /* @__PURE__ */ Y("p", {
|
|
10946
11006
|
className: "kol-helper-12 text-meta",
|
|
10947
11007
|
children: "Select a pattern layer to edit it."
|
|
10948
11008
|
})
|
|
10949
11009
|
})
|
|
10950
11010
|
});
|
|
10951
11011
|
}
|
|
10952
|
-
function
|
|
11012
|
+
function Su({ layer: e }) {
|
|
10953
11013
|
let { updateLayer: n, palette: r } = N(), { savePattern: i } = Rn(), a = We(e.id, { history: "coalesce" }).setProp, o = (t) => /* @__PURE__ */ Y(Ye, {
|
|
10954
11014
|
layer: e,
|
|
10955
11015
|
param: t,
|
|
@@ -10997,12 +11057,12 @@ function bu({ layer: e }) {
|
|
|
10997
11057
|
variant: "primary",
|
|
10998
11058
|
size: "sm",
|
|
10999
11059
|
className: "w-full",
|
|
11000
|
-
onClick: () => n(e.id, de(e, Te(
|
|
11060
|
+
onClick: () => n(e.id, de(e, Te(bu, e), b.take())),
|
|
11001
11061
|
children: "Randomize all"
|
|
11002
11062
|
}),
|
|
11003
11063
|
/* @__PURE__ */ Y(Pe, { seed: b }),
|
|
11004
11064
|
/* @__PURE__ */ Y(He, {
|
|
11005
|
-
schema:
|
|
11065
|
+
schema: bu,
|
|
11006
11066
|
layer: e,
|
|
11007
11067
|
setProp: a,
|
|
11008
11068
|
palette: r,
|
|
@@ -11036,7 +11096,7 @@ function bu({ layer: e }) {
|
|
|
11036
11096
|
}),
|
|
11037
11097
|
/* @__PURE__ */ Y(B, {
|
|
11038
11098
|
label: "Color",
|
|
11039
|
-
children: /* @__PURE__ */ Y(
|
|
11099
|
+
children: /* @__PURE__ */ Y(vu, {
|
|
11040
11100
|
values: {
|
|
11041
11101
|
color: m,
|
|
11042
11102
|
background: h
|
|
@@ -11062,13 +11122,13 @@ function bu({ layer: e }) {
|
|
|
11062
11122
|
}
|
|
11063
11123
|
//#endregion
|
|
11064
11124
|
//#region src/editor/shell/panels/SelectionPalettePanel.jsx
|
|
11065
|
-
var
|
|
11125
|
+
var Cu = () => k("effects") ? [
|
|
11066
11126
|
"Inspector",
|
|
11067
11127
|
"Parameters",
|
|
11068
11128
|
"Effects"
|
|
11069
11129
|
] : ["Inspector", "Parameters"];
|
|
11070
|
-
function
|
|
11071
|
-
let { selectedId: e, selectedIds: t, layers: n, deleteSelected: r, booleanSelected: i, flattenSelected: a, flattenText: o, releaseBoolean: s, updateLayer: c } = N(), l = Kt(), [u, d] = q("Inspector"), f = k("effects")?.EffectsPanel, p = e && e !== "canvas" ? Ee(n, e) : null, m = p?.type === "pattern" ? [...
|
|
11130
|
+
function wu() {
|
|
11131
|
+
let { selectedId: e, selectedIds: t, layers: n, deleteSelected: r, booleanSelected: i, flattenSelected: a, flattenText: o, releaseBoolean: s, updateLayer: c } = N(), l = Kt(), [u, d] = q("Inspector"), f = k("effects")?.EffectsPanel, p = e && e !== "canvas" ? Ee(n, e) : null, m = p?.type === "pattern" ? [...Cu(), "Pattern"] : Cu(), h = e === "canvas", g = (t ?? []).filter((e) => e !== "canvas"), _ = !h && g.length > 0, v = m.includes(u) ? u : "Inspector";
|
|
11072
11132
|
return G(() => {
|
|
11073
11133
|
e && e !== "canvas" && d("Inspector");
|
|
11074
11134
|
}, [e]), G(() => {
|
|
@@ -11092,7 +11152,7 @@ function Su() {
|
|
|
11092
11152
|
onChange: d
|
|
11093
11153
|
})
|
|
11094
11154
|
}),
|
|
11095
|
-
p && /* @__PURE__ */ Y(
|
|
11155
|
+
p && /* @__PURE__ */ Y(Eu, {
|
|
11096
11156
|
layer: p,
|
|
11097
11157
|
layerOnlyIds: g,
|
|
11098
11158
|
layers: n,
|
|
@@ -11120,15 +11180,15 @@ function Su() {
|
|
|
11120
11180
|
}), /* @__PURE__ */ X("div", {
|
|
11121
11181
|
className: "flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable]",
|
|
11122
11182
|
children: [
|
|
11123
|
-
v === "Inspector" && /* @__PURE__ */ Y(
|
|
11124
|
-
v === "Parameters" && /* @__PURE__ */ Y(
|
|
11183
|
+
v === "Inspector" && /* @__PURE__ */ Y(Zl, {}),
|
|
11184
|
+
v === "Parameters" && /* @__PURE__ */ Y(du, {}),
|
|
11125
11185
|
v === "Effects" && f && /* @__PURE__ */ Y(f, {}),
|
|
11126
|
-
v === "Pattern" && /* @__PURE__ */ Y(
|
|
11186
|
+
v === "Pattern" && /* @__PURE__ */ Y(xu, {})
|
|
11127
11187
|
]
|
|
11128
11188
|
})]
|
|
11129
11189
|
});
|
|
11130
11190
|
}
|
|
11131
|
-
var
|
|
11191
|
+
var Tu = [
|
|
11132
11192
|
{
|
|
11133
11193
|
id: "unite",
|
|
11134
11194
|
label: "Union"
|
|
@@ -11146,7 +11206,7 @@ var Cu = [
|
|
|
11146
11206
|
label: "Exclude"
|
|
11147
11207
|
}
|
|
11148
11208
|
];
|
|
11149
|
-
function
|
|
11209
|
+
function Eu({ layer: e, layerOnlyIds: t, layers: n, ops: r }) {
|
|
11150
11210
|
let [i, a] = q(!1), o = Jt({
|
|
11151
11211
|
open: i,
|
|
11152
11212
|
onOpenChange: a,
|
|
@@ -11182,7 +11242,7 @@ function wu({ layer: e, layerOnlyIds: t, layers: n, ops: r }) {
|
|
|
11182
11242
|
className: "z-[var(--kol-z-tooltip)] bg-surface-secondary border border-oq-08 rounded shadow-lg py-1",
|
|
11183
11243
|
style: { width: 176 },
|
|
11184
11244
|
children: [
|
|
11185
|
-
|
|
11245
|
+
Tu.map((e) => /* @__PURE__ */ Y(V, {
|
|
11186
11246
|
disabled: !s,
|
|
11187
11247
|
onClick: l(() => r.booleanSelected(e.id)),
|
|
11188
11248
|
children: e.label
|
|
@@ -11213,25 +11273,25 @@ function wu({ layer: e, layerOnlyIds: t, layers: n, ops: r }) {
|
|
|
11213
11273
|
}
|
|
11214
11274
|
//#endregion
|
|
11215
11275
|
//#region src/editor/shell/panels/ToolPalette.jsx
|
|
11216
|
-
var
|
|
11276
|
+
var Du = (e) => ({
|
|
11217
11277
|
kind: "tool",
|
|
11218
11278
|
id: e,
|
|
11219
11279
|
label: un[e].label,
|
|
11220
11280
|
icon: un[e].icon,
|
|
11221
11281
|
shortcut: un[e].shortcut || void 0
|
|
11222
|
-
}),
|
|
11282
|
+
}), Ou = (e) => ({
|
|
11223
11283
|
id: e,
|
|
11224
11284
|
label: un[e].label,
|
|
11225
11285
|
icon: un[e].icon,
|
|
11226
11286
|
shortcut: un[e].shortcut || void 0
|
|
11227
|
-
}),
|
|
11287
|
+
}), ku = [
|
|
11228
11288
|
"rect",
|
|
11229
11289
|
"ellipse",
|
|
11230
11290
|
"triangle",
|
|
11231
11291
|
"line",
|
|
11232
11292
|
"polygon",
|
|
11233
11293
|
"star"
|
|
11234
|
-
].map(
|
|
11294
|
+
].map(Ou), Au = [
|
|
11235
11295
|
{
|
|
11236
11296
|
id: "unite",
|
|
11237
11297
|
icon: "boolean-unite",
|
|
@@ -11252,8 +11312,8 @@ var Tu = (e) => ({
|
|
|
11252
11312
|
icon: "boolean-exclude",
|
|
11253
11313
|
label: "Exclude"
|
|
11254
11314
|
}
|
|
11255
|
-
],
|
|
11256
|
-
function
|
|
11315
|
+
], ju = { kind: "divider" };
|
|
11316
|
+
function Mu() {
|
|
11257
11317
|
let { tool: e, setTool: t } = pn(), { layers: n, selectedId: i, selectedIds: a, flipSelected: o, duplicateLayer: c, updateLayer: l, addLayer: u, booleanSelected: d } = N(), f = i && i !== "canvas" ? Ee(n, i) : null, p = a.some((e) => e !== "canvas"), m = !!f && !s.includes(f.type) && !f.locked, h = n.filter((e) => a.includes(e.id) && O(e)).length >= 2, g = (e) => {
|
|
11258
11318
|
let t = f.rotation ?? 0;
|
|
11259
11319
|
l(f.id, { rotation: (Math.round(t + e) % 360 + 360) % 360 });
|
|
@@ -11279,29 +11339,29 @@ function Au() {
|
|
|
11279
11339
|
};
|
|
11280
11340
|
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Bt, {
|
|
11281
11341
|
items: [
|
|
11282
|
-
|
|
11342
|
+
Du("select"),
|
|
11283
11343
|
{
|
|
11284
11344
|
kind: "split",
|
|
11285
11345
|
id: "text-fold",
|
|
11286
11346
|
label: "Text",
|
|
11287
|
-
variants: [
|
|
11347
|
+
variants: [Ou("text"), ...k("motion") ? [{
|
|
11288
11348
|
id: "kinetic",
|
|
11289
11349
|
label: "Kinetic type",
|
|
11290
11350
|
icon: "type",
|
|
11291
11351
|
action: !0
|
|
11292
11352
|
}] : []]
|
|
11293
11353
|
},
|
|
11294
|
-
|
|
11354
|
+
Du("pen"),
|
|
11295
11355
|
{
|
|
11296
11356
|
kind: "split",
|
|
11297
11357
|
id: "shape-fold",
|
|
11298
11358
|
label: "Shape",
|
|
11299
|
-
variants:
|
|
11359
|
+
variants: ku
|
|
11300
11360
|
},
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11361
|
+
Du("pattern"),
|
|
11362
|
+
Du("zoom"),
|
|
11363
|
+
Du("orbit"),
|
|
11364
|
+
ju,
|
|
11305
11365
|
{
|
|
11306
11366
|
kind: "action",
|
|
11307
11367
|
id: "flip-horizontal",
|
|
@@ -11332,16 +11392,16 @@ function Au() {
|
|
|
11332
11392
|
label: "Rotate 90° right",
|
|
11333
11393
|
disabled: !m
|
|
11334
11394
|
},
|
|
11335
|
-
|
|
11395
|
+
ju,
|
|
11336
11396
|
{
|
|
11337
11397
|
kind: "split",
|
|
11338
11398
|
id: "boolean-fold",
|
|
11339
11399
|
label: "Boolean",
|
|
11340
11400
|
action: !0,
|
|
11341
|
-
variants:
|
|
11401
|
+
variants: Au,
|
|
11342
11402
|
disabled: !h
|
|
11343
11403
|
},
|
|
11344
|
-
|
|
11404
|
+
ju,
|
|
11345
11405
|
{
|
|
11346
11406
|
kind: "action",
|
|
11347
11407
|
id: "image",
|
|
@@ -11367,7 +11427,7 @@ function Au() {
|
|
|
11367
11427
|
activeId: e,
|
|
11368
11428
|
onSelect: t,
|
|
11369
11429
|
onAction: (e) => {
|
|
11370
|
-
e === "kinetic" ? u("kinetic") : e === "flip-horizontal" ? o("h") : e === "flip-vertical" ? o("v") : e === "rotate-left" ? g(-90) : e === "rotate-right" ? g(90) :
|
|
11430
|
+
e === "kinetic" ? u("kinetic") : e === "flip-horizontal" ? o("h") : e === "flip-vertical" ? o("v") : e === "rotate-left" ? g(-90) : e === "rotate-right" ? g(90) : Au.some((t) => t.id === e) ? d(e) : e === "image" ? _.current?.click() : e === "crop" ? window.dispatchEvent(new CustomEvent("kol:enter-crop", { detail: f.id })) : e === "duplicate" && c(f.id);
|
|
11371
11431
|
},
|
|
11372
11432
|
size: "md",
|
|
11373
11433
|
className: "px-3 h-12"
|
|
@@ -11381,7 +11441,7 @@ function Au() {
|
|
|
11381
11441
|
}
|
|
11382
11442
|
//#endregion
|
|
11383
11443
|
//#region src/editor/params/AudioInputRow.jsx
|
|
11384
|
-
var
|
|
11444
|
+
var Nu = [
|
|
11385
11445
|
{
|
|
11386
11446
|
value: "off",
|
|
11387
11447
|
label: "Off"
|
|
@@ -11395,7 +11455,7 @@ var ju = [
|
|
|
11395
11455
|
label: "File"
|
|
11396
11456
|
}
|
|
11397
11457
|
];
|
|
11398
|
-
function
|
|
11458
|
+
function Pu() {
|
|
11399
11459
|
let [e, t] = q(_() ?? "off"), [n, r] = q(null), i = K(null);
|
|
11400
11460
|
return /* @__PURE__ */ X("div", {
|
|
11401
11461
|
className: "flex flex-col gap-1 mt-3",
|
|
@@ -11420,7 +11480,7 @@ function Mu() {
|
|
|
11420
11480
|
t(e ? "mic" : "off"), e || r("Mic blocked — allow it for this site (check the address bar)");
|
|
11421
11481
|
} else i.current?.click();
|
|
11422
11482
|
},
|
|
11423
|
-
options:
|
|
11483
|
+
options: Nu,
|
|
11424
11484
|
size: "sm",
|
|
11425
11485
|
className: "flex-1"
|
|
11426
11486
|
}),
|
|
@@ -11447,12 +11507,12 @@ function Mu() {
|
|
|
11447
11507
|
}
|
|
11448
11508
|
//#endregion
|
|
11449
11509
|
//#region src/editor/shell/panels/BatchExportModal.jsx
|
|
11450
|
-
var
|
|
11510
|
+
var Fu = [
|
|
11451
11511
|
1,
|
|
11452
11512
|
2,
|
|
11453
11513
|
3
|
|
11454
|
-
],
|
|
11455
|
-
function
|
|
11514
|
+
], Iu = i.filter((e) => e.id !== "custom");
|
|
11515
|
+
function Lu({ open: e, onClose: t, runBatchExport: n, baseAspect: r, defaultScale: i = 1 }) {
|
|
11456
11516
|
let [a, o] = q(() => /* @__PURE__ */ new Set()), [s, c] = q(() => /* @__PURE__ */ new Set()), [l, u] = q(null);
|
|
11457
11517
|
G(() => {
|
|
11458
11518
|
e && (o(new Set([Le[r] ? r : "1:1"])), c(new Set([[
|
|
@@ -11481,7 +11541,7 @@ function Fu({ open: e, onClose: t, runBatchExport: n, baseAspect: r, defaultScal
|
|
|
11481
11541
|
let n = new Set(e);
|
|
11482
11542
|
return n.has(t) ? n.delete(t) : n.add(t), n;
|
|
11483
11543
|
}), p = f(o), m = f(c), h = [];
|
|
11484
|
-
for (let e of
|
|
11544
|
+
for (let e of Iu) if (a.has(e.id)) for (let t of Fu) s.has(t) && h.push({
|
|
11485
11545
|
aspectId: e.id,
|
|
11486
11546
|
scale: t
|
|
11487
11547
|
});
|
|
@@ -11513,7 +11573,7 @@ function Fu({ open: e, onClose: t, runBatchExport: n, baseAspect: r, defaultScal
|
|
|
11513
11573
|
children: "Aspects"
|
|
11514
11574
|
}), /* @__PURE__ */ Y("div", {
|
|
11515
11575
|
className: "grid grid-cols-2 gap-1.5",
|
|
11516
|
-
children:
|
|
11576
|
+
children: Iu.map((e) => /* @__PURE__ */ Y(Ru, {
|
|
11517
11577
|
checked: a.has(e.id),
|
|
11518
11578
|
disabled: d,
|
|
11519
11579
|
onToggle: () => p(e.id),
|
|
@@ -11528,7 +11588,7 @@ function Fu({ open: e, onClose: t, runBatchExport: n, baseAspect: r, defaultScal
|
|
|
11528
11588
|
children: "Scale"
|
|
11529
11589
|
}), /* @__PURE__ */ Y("div", {
|
|
11530
11590
|
className: "grid grid-cols-3 gap-1.5",
|
|
11531
|
-
children:
|
|
11591
|
+
children: Fu.map((e) => /* @__PURE__ */ Y(Ru, {
|
|
11532
11592
|
checked: s.has(e),
|
|
11533
11593
|
disabled: d,
|
|
11534
11594
|
onToggle: () => m(e),
|
|
@@ -11571,7 +11631,7 @@ function Fu({ open: e, onClose: t, runBatchExport: n, baseAspect: r, defaultScal
|
|
|
11571
11631
|
})
|
|
11572
11632
|
});
|
|
11573
11633
|
}
|
|
11574
|
-
function
|
|
11634
|
+
function Ru({ checked: e, disabled: t, onToggle: n, label: r, meta: i }) {
|
|
11575
11635
|
return /* @__PURE__ */ X("button", {
|
|
11576
11636
|
type: "button",
|
|
11577
11637
|
disabled: t,
|
|
@@ -11598,7 +11658,7 @@ function Iu({ checked: e, disabled: t, onToggle: n, label: r, meta: i }) {
|
|
|
11598
11658
|
}
|
|
11599
11659
|
//#endregion
|
|
11600
11660
|
//#region src/editor/shell/panels/EditorFooter.jsx
|
|
11601
|
-
var
|
|
11661
|
+
var zu = [
|
|
11602
11662
|
{
|
|
11603
11663
|
value: "transport",
|
|
11604
11664
|
label: "Transport"
|
|
@@ -11611,8 +11671,8 @@ var Lu = [
|
|
|
11611
11671
|
value: "file",
|
|
11612
11672
|
label: "File"
|
|
11613
11673
|
}
|
|
11614
|
-
],
|
|
11615
|
-
function
|
|
11674
|
+
], Bu = zu.filter((e) => e.value !== "transport"), Vu = "h-[26px]";
|
|
11675
|
+
function Hu() {
|
|
11616
11676
|
let e = () => document.documentElement.getAttribute("data-rail") === "collapsed", [t, n] = q(e);
|
|
11617
11677
|
return G(() => {
|
|
11618
11678
|
n(e());
|
|
@@ -11623,7 +11683,7 @@ function Bu() {
|
|
|
11623
11683
|
}), () => t.disconnect();
|
|
11624
11684
|
}, []), t;
|
|
11625
11685
|
}
|
|
11626
|
-
function
|
|
11686
|
+
function Uu({ layer: e }) {
|
|
11627
11687
|
let t = te(), { patch: n } = We(e.id), r = K(null), i = K(null), [a, o] = q(!1);
|
|
11628
11688
|
return /* @__PURE__ */ X("div", {
|
|
11629
11689
|
className: "flex flex-col gap-2",
|
|
@@ -11711,12 +11771,12 @@ function Vu({ layer: e }) {
|
|
|
11711
11771
|
},
|
|
11712
11772
|
children: "Clear image"
|
|
11713
11773
|
}),
|
|
11714
|
-
/* @__PURE__ */ Y(
|
|
11774
|
+
/* @__PURE__ */ Y(hl, {
|
|
11715
11775
|
open: a,
|
|
11716
11776
|
onClose: () => o(!1),
|
|
11717
11777
|
onPick: (e, { contentType: t } = {}) => {
|
|
11718
11778
|
n({
|
|
11719
|
-
src:
|
|
11779
|
+
src: nl(e),
|
|
11720
11780
|
srcType: cn(t) ? "video" : "image"
|
|
11721
11781
|
});
|
|
11722
11782
|
}
|
|
@@ -11724,7 +11784,7 @@ function Vu({ layer: e }) {
|
|
|
11724
11784
|
]
|
|
11725
11785
|
});
|
|
11726
11786
|
}
|
|
11727
|
-
function
|
|
11787
|
+
function Wu({ onSaveSettings: e, onLoadSettings: t, onSave: n, currentPresetId: r }) {
|
|
11728
11788
|
let i = te(), a = K(null), [o, s] = q("");
|
|
11729
11789
|
return /* @__PURE__ */ X("div", {
|
|
11730
11790
|
className: "flex flex-col gap-2",
|
|
@@ -11786,8 +11846,8 @@ function Hu({ onSaveSettings: e, onLoadSettings: t, onSave: n, currentPresetId:
|
|
|
11786
11846
|
]
|
|
11787
11847
|
});
|
|
11788
11848
|
}
|
|
11789
|
-
function
|
|
11790
|
-
let e = te(), t = e !== "sm", n = k("motion")?.TransportBar ?? null, r = t || !n ?
|
|
11849
|
+
function Gu() {
|
|
11850
|
+
let e = te(), t = e !== "sm", n = k("motion")?.TransportBar ?? null, r = t || !n ? Bu : zu, [a, o] = q(t || !n ? "output" : "transport"), [s, c] = q(!1), [l, u] = q(1), [d, f] = q(!1), [m, h] = q(!1), [g, _] = q(null), { onSave: v, onExportPng: y, onExportWebm: b, runBatchExport: x, onRecordStart: S, onRecordStop: C, onSaveSettings: w, onLoadSettings: T, openOutputWindow: E, currentPresetId: D } = la(), { aspect: ee, setAspect: ne, canvasW: re, canvasH: ie, selectedId: O, layers: ae } = N(), oe = Hu(), { playing: se, play: A, pause: ce } = p();
|
|
11791
11851
|
G(() => () => {
|
|
11792
11852
|
C();
|
|
11793
11853
|
}, []);
|
|
@@ -11858,7 +11918,7 @@ function Uu() {
|
|
|
11858
11918
|
onChange: o,
|
|
11859
11919
|
options: r,
|
|
11860
11920
|
size: e,
|
|
11861
|
-
className: `flex-1 min-w-0 ${e === "sm" ?
|
|
11921
|
+
className: `flex-1 min-w-0 ${e === "sm" ? Vu : Re(e) ?? ""}`.trim()
|
|
11862
11922
|
})]
|
|
11863
11923
|
}),
|
|
11864
11924
|
n && /* @__PURE__ */ Y("div", {
|
|
@@ -11964,12 +12024,12 @@ function Uu() {
|
|
|
11964
12024
|
]
|
|
11965
12025
|
})]
|
|
11966
12026
|
}),
|
|
11967
|
-
a === "file" && /* @__PURE__ */ X(J, { children: [me ? /* @__PURE__ */ Y(
|
|
12027
|
+
a === "file" && /* @__PURE__ */ X(J, { children: [me ? /* @__PURE__ */ Y(Uu, { layer: me }) : /* @__PURE__ */ Y(Wu, {
|
|
11968
12028
|
onSaveSettings: w,
|
|
11969
12029
|
onLoadSettings: T,
|
|
11970
12030
|
onSave: v,
|
|
11971
12031
|
currentPresetId: D
|
|
11972
|
-
}), /* @__PURE__ */ Y(
|
|
12032
|
+
}), /* @__PURE__ */ Y(Pu, {})] }),
|
|
11973
12033
|
g && /* @__PURE__ */ Y(dt, {
|
|
11974
12034
|
open: !0,
|
|
11975
12035
|
closeButton: !1,
|
|
@@ -12007,7 +12067,7 @@ function Uu() {
|
|
|
12007
12067
|
})]
|
|
12008
12068
|
})
|
|
12009
12069
|
}),
|
|
12010
|
-
/* @__PURE__ */ Y(
|
|
12070
|
+
/* @__PURE__ */ Y(Lu, {
|
|
12011
12071
|
open: d,
|
|
12012
12072
|
onClose: () => f(!1),
|
|
12013
12073
|
runBatchExport: x,
|
|
@@ -12019,13 +12079,13 @@ function Uu() {
|
|
|
12019
12079
|
}
|
|
12020
12080
|
//#endregion
|
|
12021
12081
|
//#region src/editor/Compose.jsx
|
|
12022
|
-
var
|
|
12082
|
+
var Ku = () => ({
|
|
12023
12083
|
canvas: Ns,
|
|
12024
12084
|
panels: [
|
|
12025
12085
|
{
|
|
12026
12086
|
slot: "canvas.header",
|
|
12027
12087
|
order: 0,
|
|
12028
|
-
Component:
|
|
12088
|
+
Component: Mu
|
|
12029
12089
|
},
|
|
12030
12090
|
{
|
|
12031
12091
|
slot: "left.body",
|
|
@@ -12035,17 +12095,17 @@ var Wu = () => ({
|
|
|
12035
12095
|
{
|
|
12036
12096
|
slot: "left.body",
|
|
12037
12097
|
order: 0,
|
|
12038
|
-
Component:
|
|
12098
|
+
Component: ul
|
|
12039
12099
|
},
|
|
12040
12100
|
{
|
|
12041
12101
|
slot: "left.footer",
|
|
12042
12102
|
order: 0,
|
|
12043
|
-
Component:
|
|
12103
|
+
Component: Gu
|
|
12044
12104
|
},
|
|
12045
12105
|
{
|
|
12046
12106
|
slot: "right.body",
|
|
12047
12107
|
order: 0,
|
|
12048
|
-
Component:
|
|
12108
|
+
Component: wu
|
|
12049
12109
|
},
|
|
12050
12110
|
...k("motion") ? [{
|
|
12051
12111
|
slot: "canvas.footer",
|
|
@@ -12053,41 +12113,41 @@ var Wu = () => ({
|
|
|
12053
12113
|
Component: k("motion").TimelineDock
|
|
12054
12114
|
}] : []
|
|
12055
12115
|
]
|
|
12056
|
-
}),
|
|
12057
|
-
function
|
|
12058
|
-
return /* @__PURE__ */ Y(no, { registry:
|
|
12116
|
+
}), qu = null;
|
|
12117
|
+
function Ju() {
|
|
12118
|
+
return /* @__PURE__ */ Y(no, { registry: qu ??= Ku() });
|
|
12059
12119
|
}
|
|
12060
12120
|
//#endregion
|
|
12061
12121
|
//#region src/editor/Editor.jsx
|
|
12062
|
-
function
|
|
12122
|
+
function Yu() {
|
|
12063
12123
|
Qn();
|
|
12064
12124
|
let { setAspect: e } = N();
|
|
12065
12125
|
return G(() => {
|
|
12066
12126
|
let t = Me();
|
|
12067
12127
|
t.autoplay && u.play(), t.defaultAspect && t.defaultAspect !== "custom" && e(t.defaultAspect);
|
|
12068
12128
|
}, []), /* @__PURE__ */ X(J, { children: [
|
|
12069
|
-
/* @__PURE__ */ Y(
|
|
12129
|
+
/* @__PURE__ */ Y(Ju, {}),
|
|
12070
12130
|
/* @__PURE__ */ Y(Ar, {}),
|
|
12071
12131
|
/* @__PURE__ */ Y(ua, {})
|
|
12072
12132
|
] });
|
|
12073
12133
|
}
|
|
12074
|
-
function
|
|
12134
|
+
function Xu({ children: e, persistDraft: t = !0, draftKey: n }) {
|
|
12075
12135
|
return /* @__PURE__ */ Y(ln, { children: /* @__PURE__ */ Y(wt, { children: /* @__PURE__ */ Y(Ln, { children: /* @__PURE__ */ Y(fn, { children: /* @__PURE__ */ Y(a, {
|
|
12076
12136
|
persistDraft: t,
|
|
12077
12137
|
draftKey: n,
|
|
12078
12138
|
children: /* @__PURE__ */ Y(rr, { children: /* @__PURE__ */ Y(lr, { children: /* @__PURE__ */ Y(vr, { children: e }) }) })
|
|
12079
12139
|
}) }) }) }) });
|
|
12080
12140
|
}
|
|
12081
|
-
function
|
|
12082
|
-
return /* @__PURE__ */ Y(
|
|
12141
|
+
function Zu() {
|
|
12142
|
+
return /* @__PURE__ */ Y(Xu, { children: /* @__PURE__ */ Y(Yu, {}) });
|
|
12083
12143
|
}
|
|
12084
12144
|
//#endregion
|
|
12085
12145
|
//#region src/editor/OutputView.jsx
|
|
12086
|
-
function
|
|
12146
|
+
function Qu(e, t) {
|
|
12087
12147
|
return !e || typeof e != "string" ? e : `color-mix(in srgb, ${e} ${Math.round(t * 100)}%, transparent)`;
|
|
12088
12148
|
}
|
|
12089
|
-
function
|
|
12090
|
-
let { aspect: n, canvasW: r, canvasH: i, layers: a, palette: o, canvasFill: s, canvasFillOpacity: c } = N(), l = t(s, o), d = l ? c < 1 ?
|
|
12149
|
+
function $u({ fit: e = "contain" }) {
|
|
12150
|
+
let { aspect: n, canvasW: r, canvasH: i, layers: a, palette: o, canvasFill: s, canvasFillOpacity: c } = N(), l = t(s, o), d = l ? c < 1 ? Qu(l, c) : l : null;
|
|
12091
12151
|
return /* @__PURE__ */ Y(fr, {
|
|
12092
12152
|
aspect: n,
|
|
12093
12153
|
customRatio: r / i,
|
|
@@ -12126,14 +12186,14 @@ function Zu({ fit: e = "contain" }) {
|
|
|
12126
12186
|
})
|
|
12127
12187
|
});
|
|
12128
12188
|
}
|
|
12129
|
-
function
|
|
12189
|
+
function ed({ fit: e = "contain" }) {
|
|
12130
12190
|
return /* @__PURE__ */ Y("div", {
|
|
12131
12191
|
className: "fixed inset-0",
|
|
12132
12192
|
style: { background: "#000" },
|
|
12133
|
-
children: /* @__PURE__ */ Y(
|
|
12193
|
+
children: /* @__PURE__ */ Y($u, { fit: e })
|
|
12134
12194
|
});
|
|
12135
12195
|
}
|
|
12136
|
-
function
|
|
12196
|
+
function td() {
|
|
12137
12197
|
let { loadPreset: e } = N();
|
|
12138
12198
|
return tn(), G(() => {
|
|
12139
12199
|
try {
|
|
@@ -12141,48 +12201,48 @@ function $u() {
|
|
|
12141
12201
|
n?.spec && e(n.spec);
|
|
12142
12202
|
} catch {}
|
|
12143
12203
|
u.play();
|
|
12144
|
-
}, []), /* @__PURE__ */ Y(
|
|
12204
|
+
}, []), /* @__PURE__ */ Y(ed, {});
|
|
12145
12205
|
}
|
|
12146
|
-
function
|
|
12147
|
-
return /* @__PURE__ */ Y(
|
|
12206
|
+
function nd() {
|
|
12207
|
+
return /* @__PURE__ */ Y(Xu, {
|
|
12148
12208
|
persistDraft: !1,
|
|
12149
|
-
children: /* @__PURE__ */ Y(
|
|
12209
|
+
children: /* @__PURE__ */ Y(td, {})
|
|
12150
12210
|
});
|
|
12151
12211
|
}
|
|
12152
12212
|
//#endregion
|
|
12153
12213
|
//#region src/railExtras.js
|
|
12154
|
-
var
|
|
12214
|
+
var rd = "#rail/", id = {
|
|
12155
12215
|
items: [],
|
|
12156
12216
|
dispatch: null
|
|
12157
|
-
},
|
|
12158
|
-
function
|
|
12159
|
-
|
|
12217
|
+
}, ad = /* @__PURE__ */ new Set();
|
|
12218
|
+
function od(e) {
|
|
12219
|
+
id = e ?? {
|
|
12160
12220
|
items: [],
|
|
12161
12221
|
dispatch: null
|
|
12162
|
-
},
|
|
12222
|
+
}, ad.forEach((e) => e());
|
|
12163
12223
|
}
|
|
12164
|
-
var
|
|
12224
|
+
var sd = (e) => (ad.add(e), () => ad.delete(e)), cd = () => $t(sd, () => id, () => id), ld = () => window.matchMedia("(pointer: coarse)").matches && navigator.maxTouchPoints > 0, ud = () => Math.min(window.screen.width, window.screen.height) >= 600, dd = "kol-desktop", fd = () => {
|
|
12165
12225
|
try {
|
|
12166
|
-
return localStorage.getItem(
|
|
12226
|
+
return localStorage.getItem(dd) === "1";
|
|
12167
12227
|
} catch {
|
|
12168
12228
|
return !1;
|
|
12169
12229
|
}
|
|
12170
|
-
},
|
|
12230
|
+
}, pd = (e) => {
|
|
12171
12231
|
try {
|
|
12172
|
-
e ? localStorage.setItem(
|
|
12232
|
+
e ? localStorage.setItem(dd, "1") : localStorage.removeItem(dd);
|
|
12173
12233
|
} catch {}
|
|
12174
|
-
},
|
|
12175
|
-
|
|
12234
|
+
}, md = () => {
|
|
12235
|
+
pd(!0), Fa(Aa("desktop"));
|
|
12176
12236
|
};
|
|
12177
12237
|
//#endregion
|
|
12178
12238
|
//#region src/core.jsx
|
|
12179
|
-
function
|
|
12180
|
-
return e != null &&
|
|
12239
|
+
function hd({ mediaProxyBase: e, mediaClient: t, settingsStore: n } = {}) {
|
|
12240
|
+
return e != null && $c(e), t && el(t), G(() => {
|
|
12181
12241
|
if (n) return fe(n), () => fe(null);
|
|
12182
12242
|
}, [n]), tn(), /* @__PURE__ */ Y("div", {
|
|
12183
12243
|
className: "kol-design-editor",
|
|
12184
|
-
children: /* @__PURE__ */ Y(
|
|
12244
|
+
children: /* @__PURE__ */ Y(Zu, {})
|
|
12185
12245
|
});
|
|
12186
12246
|
}
|
|
12187
12247
|
//#endregion
|
|
12188
|
-
export { Aa as A, $n as B, Da as C, Oa as D, La as E, Vr as F, zn as G, Jn as H, Br as I, Rn as K, Ur as L, ya as M, ga as N, Ma as O, la as P, Ir as R, no as S, za as T, Xn as U, Qn as V, Ln as W, cn as _,
|
|
12248
|
+
export { Aa as A, $n as B, Da as C, Oa as D, La as E, Vr as F, zn as G, Jn as H, Br as I, Rn as K, Ur as L, ya as M, ga as N, Ma as O, la as P, Ir as R, no as S, za as T, Xn as U, Qn as V, Ln as W, cn as _, pd as a, $c as b, od as c, ed as d, nd as f, hl as g, cu as h, ud as i, _a as j, Pa as k, cd as l, Gu as m, md as n, fd as o, Xu as p, pn as q, ld as r, rd as s, hd as t, $u as u, nl as v, ka as w, go as x, el as y, Gt as z };
|