@kolkrabbi/design-editor 0.37.0 → 0.38.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/{BindDot-dBz2NUVr.js → BindDot-CFTKW7W4.js} +1 -1
- package/dist/{Timeline-BDMxiVYe.js → Timeline-ckBCdlTr.js} +2 -2
- package/dist/{TreePicker-BawzFyzV.js → TreePicker-D4vypelv.js} +1 -1
- package/dist/{core-d8m3o_mg.js → core-VWNEmGcX.js} +21 -17
- package/dist/core.js +4 -4
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +14 -13
- package/dist/{effectCategories-D1t5Vdqf.js → effectCategories-o8c1BoBZ.js} +3 -3
- package/dist/{effects-BFAtGRPu.js → effects-fBuIj2Pn.js} +6 -6
- package/dist/effects.js +1 -1
- package/dist/{generators-JkPVwcTT.js → generators-D0TkUp8a.js} +910 -889
- package/dist/generators.js +1 -1
- package/dist/{host-CsF4CKfw.js → host-BCPL5xi5.js} +4 -4
- package/dist/{host-C3_Oy1ck.js → host-mBJsX8-O.js} +1 -1
- package/dist/{morphStore-CidzL7wV.js → morphStore-CJc9nt6q.js} +1 -1
- package/dist/{motion-KvPCj1EZ.js → motion-BBBfa2mP.js} +3 -3
- package/dist/motion.js +1 -1
- package/dist/{previewScale-BAmIBoWY.js → previewScale-BCpuL5uC.js} +1 -1
- package/dist/{rolls-5hhrWX96.js → rolls-yFvM7gmE.js} +751 -722
- package/dist/{src-8EvSuuNG.js → src-BTZk0nvE.js} +1 -1
- package/dist/{store-QnsWv-26.js → store-rdo7FUxn.js} +1 -1
- package/dist/{useLayerEdit-BikuFIoi.js → useLayerEdit-BLjEK2Gv.js} +8 -8
- package/package.json +7 -7
|
@@ -3714,7 +3714,7 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3714
3714
|
} else throw Error("CFF Table CID Font FDSelect table has unsupported format " + c);
|
|
3715
3715
|
return a;
|
|
3716
3716
|
}
|
|
3717
|
-
function
|
|
3717
|
+
function wn(e, t, n, r) {
|
|
3718
3718
|
let i, a = sn(e, t);
|
|
3719
3719
|
i = a.formatMajor === 2 ? n.tables.cff2 = {} : n.tables.cff = {};
|
|
3720
3720
|
let o = a.formatMajor > 1 ? null : Zt(e, a.endOffset, X.bytesToString), s = a.formatMajor > 1 ? null : Zt(e, o.endOffset), c = a.formatMajor > 1 ? null : Zt(e, s.endOffset, X.bytesToString);
|
|
@@ -3762,11 +3762,11 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3762
3762
|
l._vstore = n.parseVariationStore();
|
|
3763
3763
|
}
|
|
3764
3764
|
}
|
|
3765
|
-
function
|
|
3765
|
+
function Tn(e, t) {
|
|
3766
3766
|
let n, r = ft.indexOf(e);
|
|
3767
3767
|
return r >= 0 && (n = r), r = t.indexOf(e), r >= 0 ? n = r + ft.length : (n = ft.length + t.length, t.push(e)), n;
|
|
3768
3768
|
}
|
|
3769
|
-
function
|
|
3769
|
+
function Z() {
|
|
3770
3770
|
return new J.Record("Header", [
|
|
3771
3771
|
{
|
|
3772
3772
|
name: "major",
|
|
@@ -3808,7 +3808,7 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3808
3808
|
let r = {};
|
|
3809
3809
|
for (let i = 0; i < e.length; i += 1) {
|
|
3810
3810
|
let a = e[i], o = t[a.name];
|
|
3811
|
-
o !== void 0 && !Jt(o, a.value) && (a.type === "SID" && (o =
|
|
3811
|
+
o !== void 0 && !Jt(o, a.value) && (a.type === "SID" && (o = Tn(o, n)), r[a.op] = {
|
|
3812
3812
|
name: a.name,
|
|
3813
3813
|
type: a.type,
|
|
3814
3814
|
value: o
|
|
@@ -3816,7 +3816,7 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3816
3816
|
}
|
|
3817
3817
|
return r;
|
|
3818
3818
|
}
|
|
3819
|
-
function
|
|
3819
|
+
function On(e, t, n) {
|
|
3820
3820
|
let r = new J.Record("Top DICT", [{
|
|
3821
3821
|
name: "dict",
|
|
3822
3822
|
type: "DICT",
|
|
@@ -3824,7 +3824,7 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3824
3824
|
}]);
|
|
3825
3825
|
return r.dict = Dn(n > 1 ? ln : cn, e, t), r;
|
|
3826
3826
|
}
|
|
3827
|
-
function
|
|
3827
|
+
function kn(e) {
|
|
3828
3828
|
let t = new J.Record("Top DICT INDEX", [{
|
|
3829
3829
|
name: "topDicts",
|
|
3830
3830
|
type: "INDEX",
|
|
@@ -3836,7 +3836,7 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3836
3836
|
value: e
|
|
3837
3837
|
}], t;
|
|
3838
3838
|
}
|
|
3839
|
-
function
|
|
3839
|
+
function Q(e) {
|
|
3840
3840
|
let t = new J.Record("String INDEX", [{
|
|
3841
3841
|
name: "strings",
|
|
3842
3842
|
type: "INDEX",
|
|
@@ -3864,7 +3864,7 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
3864
3864
|
value: 0
|
|
3865
3865
|
}]);
|
|
3866
3866
|
for (let r = 0; r < e.length; r += 1) {
|
|
3867
|
-
let i = e[r], a =
|
|
3867
|
+
let i = e[r], a = Tn(i, t);
|
|
3868
3868
|
n.fields.push({
|
|
3869
3869
|
name: "glyph_" + r,
|
|
3870
3870
|
type: "SID",
|
|
@@ -4046,12 +4046,12 @@ var ae = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
4046
4046
|
let o = {}, s = [], c;
|
|
4047
4047
|
for (let t = 1; t < e.length; t += 1) c = e.get(t), s.push(c.name);
|
|
4048
4048
|
let l = [];
|
|
4049
|
-
n.header =
|
|
4050
|
-
let u =
|
|
4051
|
-
return n.topDictIndex =
|
|
4049
|
+
n.header = Z(), n.nameIndex = En([t.postScriptName]);
|
|
4050
|
+
let u = On(i, l);
|
|
4051
|
+
return n.topDictIndex = kn(u), n.globalSubrIndex = An(), n.charsets = jn(s, l), n.charStringsIndex = Nn(e, 1), n.privateDict = Pn(o, l), n.stringIndex = Q(l), i.charset = n.header.sizeOf() + n.nameIndex.sizeOf() + n.topDictIndex.sizeOf() + n.stringIndex.sizeOf() + n.globalSubrIndex.sizeOf(), i.encoding = 0, i.charStrings = i.charset + n.charsets.sizeOf(), i.private[1] = i.charStrings + n.charStringsIndex.sizeOf(), u = On(i, l), n.topDictIndex = kn(u), n;
|
|
4052
4052
|
}
|
|
4053
4053
|
var In = {
|
|
4054
|
-
parse:
|
|
4054
|
+
parse: wn,
|
|
4055
4055
|
make: Fn
|
|
4056
4056
|
};
|
|
4057
4057
|
function Ln(e, t) {
|
|
@@ -11343,12 +11343,31 @@ function tn({ options: e = [], value: t, onChange: n, ariaLabel: i, className: a
|
|
|
11343
11343
|
className: a
|
|
11344
11344
|
});
|
|
11345
11345
|
}
|
|
11346
|
-
|
|
11346
|
+
var nn = (e = []) => e.length === 2 && e.every((e) => /^(off|on)$/i.test(String(e.value))) && e.some((e) => /^on$/i.test(String(e.value)));
|
|
11347
|
+
function rn({ options: e, value: t, onChange: n, ariaLabel: r, className: i = "" }) {
|
|
11348
|
+
let a = e.find((e) => /^on$/i.test(String(e.value))).value, o = e.find((e) => e.value !== a).value;
|
|
11349
|
+
return /* @__PURE__ */ B("span", {
|
|
11350
|
+
className: `flex w-full items-center justify-end ${i.replace(/\bw-full\b/g, "")}`.trim(),
|
|
11351
|
+
children: /* @__PURE__ */ B(g, {
|
|
11352
|
+
variant: "float",
|
|
11353
|
+
checked: t === a,
|
|
11354
|
+
onChange: (e) => n?.(e ? a : o),
|
|
11355
|
+
"aria-label": r
|
|
11356
|
+
})
|
|
11357
|
+
});
|
|
11358
|
+
}
|
|
11359
|
+
function an({ variant: e, tone: t, size: n, ...r }) {
|
|
11347
11360
|
return Qt() !== "float" || r.layout !== "joined" ? /* @__PURE__ */ B(i, {
|
|
11348
11361
|
variant: e,
|
|
11349
11362
|
tone: t,
|
|
11350
11363
|
size: n,
|
|
11351
11364
|
...r
|
|
11365
|
+
}) : nn(r.options) ? /* @__PURE__ */ B(rn, {
|
|
11366
|
+
options: r.options,
|
|
11367
|
+
value: r.value,
|
|
11368
|
+
onChange: r.onChange,
|
|
11369
|
+
ariaLabel: r.ariaLabel,
|
|
11370
|
+
className: r.className
|
|
11352
11371
|
}) : /* @__PURE__ */ B(tn, {
|
|
11353
11372
|
options: r.options,
|
|
11354
11373
|
value: r.value,
|
|
@@ -11357,13 +11376,13 @@ function nn({ variant: e, tone: t, size: n, ...r }) {
|
|
|
11357
11376
|
className: r.className
|
|
11358
11377
|
});
|
|
11359
11378
|
}
|
|
11360
|
-
function
|
|
11379
|
+
function on({ variant: e, ...t }) {
|
|
11361
11380
|
return /* @__PURE__ */ B(g, {
|
|
11362
11381
|
variant: Qt() === "float" ? "float" : e,
|
|
11363
11382
|
...t
|
|
11364
11383
|
});
|
|
11365
11384
|
}
|
|
11366
|
-
function
|
|
11385
|
+
function sn({ variant: e, size: t, ...n }) {
|
|
11367
11386
|
return Qt() === "float" ? /* @__PURE__ */ B(s, {
|
|
11368
11387
|
variant: "float",
|
|
11369
11388
|
size: "sm",
|
|
@@ -11374,13 +11393,13 @@ function an({ variant: e, size: t, ...n }) {
|
|
|
11374
11393
|
...n
|
|
11375
11394
|
});
|
|
11376
11395
|
}
|
|
11377
|
-
function
|
|
11396
|
+
function cn({ variant: e, ...t }) {
|
|
11378
11397
|
return /* @__PURE__ */ B(p, {
|
|
11379
11398
|
variant: Qt() === "float" && (!e || e === "minimal") ? "float" : e,
|
|
11380
11399
|
...t
|
|
11381
11400
|
});
|
|
11382
11401
|
}
|
|
11383
|
-
function
|
|
11402
|
+
function ln({ variant: e, size: t, ...n }) {
|
|
11384
11403
|
return Qt() === "float" ? /* @__PURE__ */ B(l, {
|
|
11385
11404
|
variant: "float",
|
|
11386
11405
|
size: "sm",
|
|
@@ -11392,7 +11411,7 @@ function sn({ variant: e, size: t, ...n }) {
|
|
|
11392
11411
|
...n
|
|
11393
11412
|
});
|
|
11394
11413
|
}
|
|
11395
|
-
function
|
|
11414
|
+
function un({ variant: e, size: t, ...n }) {
|
|
11396
11415
|
return Qt() === "float" ? /* @__PURE__ */ B(h, {
|
|
11397
11416
|
variant: "float",
|
|
11398
11417
|
size: "sm",
|
|
@@ -11403,7 +11422,7 @@ function cn({ variant: e, size: t, ...n }) {
|
|
|
11403
11422
|
...n
|
|
11404
11423
|
});
|
|
11405
11424
|
}
|
|
11406
|
-
function
|
|
11425
|
+
function dn({ variant: e, options: t = [], viewMode: n, onViewChange: r, size: i, className: a, ...o }) {
|
|
11407
11426
|
return Qt() === "float" ? e === "icon" ? /* @__PURE__ */ B(v, {
|
|
11408
11427
|
variant: "float",
|
|
11409
11428
|
options: t,
|
|
@@ -11411,6 +11430,12 @@ function ln({ variant: e, options: t = [], viewMode: n, onViewChange: r, size: i
|
|
|
11411
11430
|
onViewChange: r,
|
|
11412
11431
|
className: a,
|
|
11413
11432
|
...o
|
|
11433
|
+
}) : nn(t) ? /* @__PURE__ */ B(rn, {
|
|
11434
|
+
options: t,
|
|
11435
|
+
value: n,
|
|
11436
|
+
onChange: r,
|
|
11437
|
+
ariaLabel: o.ariaLabel,
|
|
11438
|
+
className: a
|
|
11414
11439
|
}) : /* @__PURE__ */ B(tn, {
|
|
11415
11440
|
options: t,
|
|
11416
11441
|
value: n,
|
|
@@ -11426,13 +11451,15 @@ function ln({ variant: e, options: t = [], viewMode: n, onViewChange: r, size: i
|
|
|
11426
11451
|
...o
|
|
11427
11452
|
});
|
|
11428
11453
|
}
|
|
11429
|
-
function
|
|
11454
|
+
function fn({ variant: e, labelWidth: t, ...n }) {
|
|
11455
|
+
let r = Qt() === "float" && !e;
|
|
11430
11456
|
return /* @__PURE__ */ B(u, {
|
|
11431
|
-
variant:
|
|
11432
|
-
|
|
11457
|
+
variant: r ? "float" : e,
|
|
11458
|
+
labelWidth: r && t !== "auto" ? void 0 : t,
|
|
11459
|
+
...n
|
|
11433
11460
|
});
|
|
11434
11461
|
}
|
|
11435
|
-
function
|
|
11462
|
+
function pn({ label: e, hint: t, align: n = "end", labelWidth: r = 160, text: i = !1, stack: a = !1, children: o }) {
|
|
11436
11463
|
if (Qt() !== "float") return /* @__PURE__ */ B(f, {
|
|
11437
11464
|
label: e,
|
|
11438
11465
|
hint: t,
|
|
@@ -11448,7 +11475,7 @@ function dn({ label: e, hint: t, align: n = "end", labelWidth: r = 160, text: i
|
|
|
11448
11475
|
inline: !a,
|
|
11449
11476
|
text: i,
|
|
11450
11477
|
label: e,
|
|
11451
|
-
labelWidth: r,
|
|
11478
|
+
labelWidth: r === "auto" ? "auto" : void 0,
|
|
11452
11479
|
children: t ? /* @__PURE__ */ B(_, {
|
|
11453
11480
|
label: t,
|
|
11454
11481
|
triggerClassName: s,
|
|
@@ -11459,16 +11486,18 @@ function dn({ label: e, hint: t, align: n = "end", labelWidth: r = 160, text: i
|
|
|
11459
11486
|
})
|
|
11460
11487
|
});
|
|
11461
11488
|
}
|
|
11462
|
-
function
|
|
11463
|
-
return Qt() === "float" ? /* @__PURE__ */
|
|
11464
|
-
|
|
11465
|
-
|
|
11489
|
+
function mn({ label: e, divided: t = !1, rowGap: n = 2, children: r, className: i = "" }) {
|
|
11490
|
+
return Qt() === "float" ? /* @__PURE__ */ B(u, {
|
|
11491
|
+
variant: "float",
|
|
11492
|
+
label: e && /* @__PURE__ */ B("span", {
|
|
11466
11493
|
className: "kol-float-label text-fg-emphasis",
|
|
11467
11494
|
children: e
|
|
11468
|
-
}),
|
|
11495
|
+
}),
|
|
11496
|
+
className: `${t ? "kol-section--divided" : ""} ${i}`.replace(/\s+/g, " ").trim(),
|
|
11497
|
+
children: /* @__PURE__ */ B("div", {
|
|
11469
11498
|
className: `flex flex-col ${n === 1 ? "gap-1" : "gap-2"}`,
|
|
11470
11499
|
children: r
|
|
11471
|
-
})
|
|
11500
|
+
})
|
|
11472
11501
|
}) : /* @__PURE__ */ B(d, {
|
|
11473
11502
|
label: e,
|
|
11474
11503
|
divided: t,
|
|
@@ -11477,7 +11506,7 @@ function fn({ label: e, divided: t = !1, rowGap: n = 2, children: r, className:
|
|
|
11477
11506
|
children: r
|
|
11478
11507
|
});
|
|
11479
11508
|
}
|
|
11480
|
-
function
|
|
11509
|
+
function hn({ title: e, ...t }) {
|
|
11481
11510
|
return /* @__PURE__ */ B(n, {
|
|
11482
11511
|
title: Qt() === "float" && typeof e == "string" ? /* @__PURE__ */ B("span", {
|
|
11483
11512
|
className: "kol-float-label text-fg-emphasis",
|
|
@@ -11488,19 +11517,19 @@ function pn({ title: e, ...t }) {
|
|
|
11488
11517
|
}
|
|
11489
11518
|
//#endregion
|
|
11490
11519
|
//#region src/editor/compose/composeContext.js
|
|
11491
|
-
var
|
|
11520
|
+
var gn = j(null);
|
|
11492
11521
|
//#endregion
|
|
11493
11522
|
//#region src/editor/color/cssVar.js
|
|
11494
|
-
function
|
|
11523
|
+
function _n(e) {
|
|
11495
11524
|
if (typeof window > "u" || typeof document > "u") return "";
|
|
11496
11525
|
let t = document.createElement("div");
|
|
11497
11526
|
t.style.position = "absolute", t.style.visibility = "hidden", t.style.color = `var(${e})`, document.body.appendChild(t);
|
|
11498
11527
|
let n = getComputedStyle(t).color;
|
|
11499
11528
|
document.body.removeChild(t);
|
|
11500
11529
|
let r = n.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
11501
|
-
return r ?
|
|
11530
|
+
return r ? vn(+r[1], +r[2], +r[3]) : n;
|
|
11502
11531
|
}
|
|
11503
|
-
function
|
|
11532
|
+
function vn(e, t, n) {
|
|
11504
11533
|
return "#" + [
|
|
11505
11534
|
e,
|
|
11506
11535
|
t,
|
|
@@ -11509,7 +11538,7 @@ function gn(e, t, n) {
|
|
|
11509
11538
|
}
|
|
11510
11539
|
//#endregion
|
|
11511
11540
|
//#region src/editor/modes/palette/pools.js
|
|
11512
|
-
var
|
|
11541
|
+
var yn = {
|
|
11513
11542
|
yellow: [
|
|
11514
11543
|
100,
|
|
11515
11544
|
200,
|
|
@@ -11564,21 +11593,21 @@ var _n = {
|
|
|
11564
11593
|
800,
|
|
11565
11594
|
900
|
|
11566
11595
|
].map((e) => `--grey-${e}`)
|
|
11567
|
-
},
|
|
11568
|
-
function
|
|
11596
|
+
}, bn = (e) => e.map((e) => _n(e));
|
|
11597
|
+
function xn(e, t, n, r, i = {}) {
|
|
11569
11598
|
return {
|
|
11570
11599
|
id: e,
|
|
11571
11600
|
label: t,
|
|
11572
11601
|
get colors() {
|
|
11573
|
-
return
|
|
11602
|
+
return bn(n);
|
|
11574
11603
|
},
|
|
11575
11604
|
get defaults() {
|
|
11576
|
-
return
|
|
11605
|
+
return bn(r);
|
|
11577
11606
|
},
|
|
11578
11607
|
...i
|
|
11579
11608
|
};
|
|
11580
11609
|
}
|
|
11581
|
-
var
|
|
11610
|
+
var Sn = [
|
|
11582
11611
|
{
|
|
11583
11612
|
id: "seed",
|
|
11584
11613
|
label: "Seed color",
|
|
@@ -11593,7 +11622,7 @@ var bn = [
|
|
|
11593
11622
|
],
|
|
11594
11623
|
isSeed: !0
|
|
11595
11624
|
},
|
|
11596
|
-
|
|
11625
|
+
xn("brand", "Brand", [...yn.yellow, ...yn.red], [
|
|
11597
11626
|
"--kol-color-yellow-300",
|
|
11598
11627
|
"--kol-color-red-200",
|
|
11599
11628
|
"--kol-color-cream-100",
|
|
@@ -11601,14 +11630,14 @@ var bn = [
|
|
|
11601
11630
|
"--kol-color-orange-300",
|
|
11602
11631
|
"--kol-color-cream-300"
|
|
11603
11632
|
]),
|
|
11604
|
-
|
|
11605
|
-
...
|
|
11606
|
-
...
|
|
11607
|
-
...
|
|
11608
|
-
...
|
|
11609
|
-
...
|
|
11610
|
-
...
|
|
11611
|
-
...
|
|
11633
|
+
xn("all-light", "All · light", [
|
|
11634
|
+
...yn.yellow,
|
|
11635
|
+
...yn.red,
|
|
11636
|
+
...yn.blue,
|
|
11637
|
+
...yn.orange,
|
|
11638
|
+
...yn.teal,
|
|
11639
|
+
...yn.cream,
|
|
11640
|
+
...yn.grey
|
|
11612
11641
|
], [
|
|
11613
11642
|
"--kol-color-yellow-300",
|
|
11614
11643
|
"--kol-color-red-200",
|
|
@@ -11617,14 +11646,14 @@ var bn = [
|
|
|
11617
11646
|
"--kol-color-orange-300",
|
|
11618
11647
|
"--kol-color-cream-200"
|
|
11619
11648
|
]),
|
|
11620
|
-
|
|
11621
|
-
...
|
|
11622
|
-
...
|
|
11623
|
-
...
|
|
11624
|
-
...
|
|
11625
|
-
...
|
|
11626
|
-
...
|
|
11627
|
-
...
|
|
11649
|
+
xn("all-dark", "All · dark", [
|
|
11650
|
+
...yn.yellow,
|
|
11651
|
+
...yn.red,
|
|
11652
|
+
...yn.blue,
|
|
11653
|
+
...yn.orange,
|
|
11654
|
+
...yn.teal,
|
|
11655
|
+
...yn.cream,
|
|
11656
|
+
...yn.grey
|
|
11628
11657
|
], [
|
|
11629
11658
|
"--kol-color-yellow-300",
|
|
11630
11659
|
"--kol-color-orange-300",
|
|
@@ -11633,13 +11662,13 @@ var bn = [
|
|
|
11633
11662
|
"--kol-color-red-200",
|
|
11634
11663
|
"--kol-color-blue-500"
|
|
11635
11664
|
]),
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11665
|
+
xn("yellow", "Yellow", yn.yellow, [...yn.yellow, "--kol-color-yellow-100"]),
|
|
11666
|
+
xn("red", "Red", yn.red, [...yn.red, "--kol-color-red-100"]),
|
|
11667
|
+
xn("blue", "Blue", yn.blue, [...yn.blue, "--kol-color-blue-100"]),
|
|
11668
|
+
xn("orange", "Orange", yn.orange, [...yn.orange, "--kol-color-orange-100"]),
|
|
11669
|
+
xn("teal", "Teal", yn.teal, [...yn.teal, "--kol-color-teal-100"]),
|
|
11670
|
+
xn("cream", "Cream", yn.cream, [...yn.cream, "--kol-color-orange-100"]),
|
|
11671
|
+
xn("greyscale", "Greyscale", yn.grey, [
|
|
11643
11672
|
"--grey-50",
|
|
11644
11673
|
"--grey-200",
|
|
11645
11674
|
"--grey-400",
|
|
@@ -11647,21 +11676,21 @@ var bn = [
|
|
|
11647
11676
|
"--grey-900",
|
|
11648
11677
|
"--grey-500"
|
|
11649
11678
|
])
|
|
11650
|
-
],
|
|
11651
|
-
function
|
|
11679
|
+
], Cn = null;
|
|
11680
|
+
function wn() {
|
|
11652
11681
|
let e = {};
|
|
11653
|
-
for (let t of Object.values(
|
|
11654
|
-
let t =
|
|
11682
|
+
for (let t of Object.values(yn)) for (let n of t) {
|
|
11683
|
+
let t = _n(n).toUpperCase(), r = n.replace(/^--kol-color-/, "").replace(/^--/, "");
|
|
11655
11684
|
t && (e[t] = r);
|
|
11656
11685
|
}
|
|
11657
11686
|
return e;
|
|
11658
11687
|
}
|
|
11659
11688
|
new Proxy({}, { get(e, t) {
|
|
11660
|
-
return
|
|
11689
|
+
return Cn ||= wn(), Cn[t];
|
|
11661
11690
|
} });
|
|
11662
11691
|
//#endregion
|
|
11663
11692
|
//#region src/editor/modes/palette/colorMath.js
|
|
11664
|
-
function
|
|
11693
|
+
function Tn(e) {
|
|
11665
11694
|
let t = parseInt(e.slice(1, 3), 16) / 255, n = parseInt(e.slice(3, 5), 16) / 255, r = parseInt(e.slice(5, 7), 16) / 255, i = Math.max(t, n, r), a = Math.min(t, n, r), o = 0, s = 0, c = (i + a) / 2;
|
|
11666
11695
|
if (i !== a) {
|
|
11667
11696
|
let e = i - a;
|
|
@@ -11691,15 +11720,15 @@ function Z(e, t, n) {
|
|
|
11691
11720
|
let l = (e) => Math.round((e + a) * 255).toString(16).padStart(2, "0");
|
|
11692
11721
|
return `#${l(o)}${l(s)}${l(c)}`.toUpperCase();
|
|
11693
11722
|
}
|
|
11694
|
-
var
|
|
11723
|
+
var En = (e) => e[Math.floor(Math.random() * e.length)], Dn = (e) => [...e].sort(() => Math.random() - .5), On = (e, t) => {
|
|
11695
11724
|
if (e.length >= t) return e.slice(0, t);
|
|
11696
11725
|
let n = [...e];
|
|
11697
|
-
for (; n.length < t;) n.push(
|
|
11726
|
+
for (; n.length < t;) n.push(En(e));
|
|
11698
11727
|
return n;
|
|
11699
|
-
},
|
|
11700
|
-
random: (e) =>
|
|
11728
|
+
}, kn = {
|
|
11729
|
+
random: (e) => On(Dn(e), 6),
|
|
11701
11730
|
monochromatic: (e) => {
|
|
11702
|
-
let { h: t, s: n } =
|
|
11731
|
+
let { h: t, s: n } = Tn(En(e));
|
|
11703
11732
|
return [
|
|
11704
11733
|
10,
|
|
11705
11734
|
25,
|
|
@@ -11710,7 +11739,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11710
11739
|
].map((e) => Z(t, n, e));
|
|
11711
11740
|
},
|
|
11712
11741
|
analogous: (e) => {
|
|
11713
|
-
let { h: t, s: n, l: r } =
|
|
11742
|
+
let { h: t, s: n, l: r } = Tn(En(e));
|
|
11714
11743
|
return [
|
|
11715
11744
|
-45,
|
|
11716
11745
|
-25,
|
|
@@ -11721,7 +11750,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11721
11750
|
].map((e) => Z((t + e + 360) % 360, n, r));
|
|
11722
11751
|
},
|
|
11723
11752
|
complementary: (e) => {
|
|
11724
|
-
let { h: t, s: n, l: r } =
|
|
11753
|
+
let { h: t, s: n, l: r } = Tn(En(e));
|
|
11725
11754
|
return [
|
|
11726
11755
|
Z(t, n, Math.max(15, r - 25)),
|
|
11727
11756
|
Z(t, n, r),
|
|
@@ -11732,7 +11761,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11732
11761
|
];
|
|
11733
11762
|
},
|
|
11734
11763
|
triadic: (e) => {
|
|
11735
|
-
let { h: t, s: n, l: r } =
|
|
11764
|
+
let { h: t, s: n, l: r } = Tn(En(e));
|
|
11736
11765
|
return [
|
|
11737
11766
|
Z(t, n, r),
|
|
11738
11767
|
Z((t + 120) % 360, n, r),
|
|
@@ -11743,7 +11772,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11743
11772
|
];
|
|
11744
11773
|
},
|
|
11745
11774
|
doubleComplementary: (e) => {
|
|
11746
|
-
let { h: t, s: n, l: r } =
|
|
11775
|
+
let { h: t, s: n, l: r } = Tn(En(e));
|
|
11747
11776
|
return [
|
|
11748
11777
|
Z(t, n, r),
|
|
11749
11778
|
Z((t + 90) % 360, n, r),
|
|
@@ -11753,9 +11782,9 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11753
11782
|
Z((t + 180) % 360, n, Math.max(15, r - 20))
|
|
11754
11783
|
];
|
|
11755
11784
|
}
|
|
11756
|
-
}, Q = (e) => (Math.random() - .5) * 2 * e,
|
|
11785
|
+
}, Q = (e) => (Math.random() - .5) * 2 * e, An = {
|
|
11757
11786
|
random: (e) => {
|
|
11758
|
-
let { h: t, s: n, l: r } =
|
|
11787
|
+
let { h: t, s: n, l: r } = Tn(e);
|
|
11759
11788
|
return [
|
|
11760
11789
|
e,
|
|
11761
11790
|
Z((t + Math.random() * 360) % 360, n, r),
|
|
@@ -11766,7 +11795,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11766
11795
|
];
|
|
11767
11796
|
},
|
|
11768
11797
|
monochromatic: (e) => {
|
|
11769
|
-
let { h: t, s: n, l: r } =
|
|
11798
|
+
let { h: t, s: n, l: r } = Tn(e);
|
|
11770
11799
|
return [
|
|
11771
11800
|
e,
|
|
11772
11801
|
Z(t, n, Math.max(10, r - 30 + Q(8))),
|
|
@@ -11777,7 +11806,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11777
11806
|
];
|
|
11778
11807
|
},
|
|
11779
11808
|
analogous: (e) => {
|
|
11780
|
-
let { h: t, s: n, l: r } =
|
|
11809
|
+
let { h: t, s: n, l: r } = Tn(e);
|
|
11781
11810
|
return [
|
|
11782
11811
|
e,
|
|
11783
11812
|
Z((t - 30 + Q(8) + 360) % 360, n, r),
|
|
@@ -11788,7 +11817,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11788
11817
|
];
|
|
11789
11818
|
},
|
|
11790
11819
|
complementary: (e) => {
|
|
11791
|
-
let { h: t, s: n, l: r } =
|
|
11820
|
+
let { h: t, s: n, l: r } = Tn(e);
|
|
11792
11821
|
return [
|
|
11793
11822
|
e,
|
|
11794
11823
|
Z(t, n, Math.max(15, r - 25 + Q(8))),
|
|
@@ -11799,7 +11828,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11799
11828
|
];
|
|
11800
11829
|
},
|
|
11801
11830
|
triadic: (e) => {
|
|
11802
|
-
let { h: t, s: n, l: r } =
|
|
11831
|
+
let { h: t, s: n, l: r } = Tn(e);
|
|
11803
11832
|
return [
|
|
11804
11833
|
e,
|
|
11805
11834
|
Z((t + 120 + Q(10)) % 360, n, r),
|
|
@@ -11810,7 +11839,7 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11810
11839
|
];
|
|
11811
11840
|
},
|
|
11812
11841
|
doubleComplementary: (e) => {
|
|
11813
|
-
let { h: t, s: n, l: r } =
|
|
11842
|
+
let { h: t, s: n, l: r } = Tn(e);
|
|
11814
11843
|
return [
|
|
11815
11844
|
e,
|
|
11816
11845
|
Z((t + 90 + Q(10)) % 360, n, r),
|
|
@@ -11821,10 +11850,10 @@ var wn = (e) => e[Math.floor(Math.random() * e.length)], Tn = (e) => [...e].sort
|
|
|
11821
11850
|
];
|
|
11822
11851
|
}
|
|
11823
11852
|
};
|
|
11824
|
-
function
|
|
11853
|
+
function jn(e, t) {
|
|
11825
11854
|
let n = new Set(e.map((e) => e.toUpperCase())), r = t.filter((e) => !n.has(e.toUpperCase()));
|
|
11826
|
-
if (r.length > 0) return
|
|
11827
|
-
let { h: i, s: a, l: o } =
|
|
11855
|
+
if (r.length > 0) return En(r);
|
|
11856
|
+
let { h: i, s: a, l: o } = Tn(En(t));
|
|
11828
11857
|
for (let e of [
|
|
11829
11858
|
-20,
|
|
11830
11859
|
20,
|
|
@@ -11838,8 +11867,8 @@ function kn(e, t) {
|
|
|
11838
11867
|
}
|
|
11839
11868
|
return Z(i, a, o > 50 ? 5 : 95);
|
|
11840
11869
|
}
|
|
11841
|
-
function
|
|
11842
|
-
let n = new Set(e.map((e) => e.toUpperCase())), { h: r, s: i, l: a } =
|
|
11870
|
+
function Mn(e, t) {
|
|
11871
|
+
let n = new Set(e.map((e) => e.toUpperCase())), { h: r, s: i, l: a } = Tn(t);
|
|
11843
11872
|
for (let e of [
|
|
11844
11873
|
-50,
|
|
11845
11874
|
50,
|
|
@@ -11853,13 +11882,13 @@ function An(e, t) {
|
|
|
11853
11882
|
}
|
|
11854
11883
|
return Z(r, i, a > 50 ? 5 : 95);
|
|
11855
11884
|
}
|
|
11856
|
-
function
|
|
11885
|
+
function Nn(e, t, n, r, i) {
|
|
11857
11886
|
let a, o;
|
|
11858
|
-
return i ? (a = (
|
|
11887
|
+
return i ? (a = (An[t] ?? An.random)(i).slice(0, 5), o = Mn(a, i)) : (a = (kn[t] ?? kn.random)(e).slice(0, 5), o = jn(a, e)), [...a, o].map((e, t) => r[t] ? n[t] : e);
|
|
11859
11888
|
}
|
|
11860
11889
|
//#endregion
|
|
11861
11890
|
//#region src/editor/modes/pattern/shapes.js
|
|
11862
|
-
var
|
|
11891
|
+
var Pn = Object.entries(/* @__PURE__ */ Object.assign({
|
|
11863
11892
|
"./abstracts/abstract-01.svg": "<svg width=\"640\" height=\"800\" viewBox=\"0 0 640 800\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M591.998 656.037C591.998 707.715 551.164 749.856 500.002 751.955C497.794 752.046 495.998 750.246 495.998 748.037V494.524C495.998 492.315 494.207 490.524 491.998 490.524H484C481.791 490.524 480 492.315 480 494.524V544.038C480 657.572 389.037 749.86 276.014 751.999C273.806 752.041 272 750.246 272 748.037V494.524C272 492.315 270.209 490.524 268 490.524H260C257.791 490.524 256 492.315 256 494.524V544.038C256 657.572 165.037 749.86 52.0143 751.999C49.8056 752.041 48 750.246 48 748.037V325.011C48 273.333 88.8338 231.192 139.996 229.093C142.204 229.002 144 230.802 144 233.011V486.524C144 488.734 145.791 490.524 148 490.524H156C158.209 490.524 160 488.734 160 486.524V255.963C160 142.429 250.963 50.1402 363.986 48.0008C366.194 47.959 368 49.7537 368 51.9629V486.524C368 488.734 369.791 490.524 372 490.524H380C382.209 490.524 384 488.734 384 486.524V255.963C384 142.429 474.963 50.1402 587.986 48.0008C590.194 47.959 592 49.7537 592 51.9629V490.523L591.998 490.525V656.037Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
11864
11893
|
"./abstracts/abstract-02.svg": "<svg width=\"640\" height=\"800\" viewBox=\"0 0 640 800\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M591.995 400.772C591.582 433.428 564.981 459.773 532.227 459.773H432C429.899 459.773 427.818 459.946 425.877 460.279C423.936 460.613 422.172 461.102 420.687 461.719C419.201 462.335 418.022 463.067 417.218 463.873C416.414 464.679 416 465.543 416 466.415C416 467.287 416.414 468.151 417.218 468.957C418.022 469.763 419.201 470.495 420.687 471.111C422.172 471.728 423.936 472.217 425.877 472.551C427.818 472.885 429.899 473.057 432 473.057H576C584.837 473.057 592.101 480.254 591.05 489.028C583.161 554.857 527.125 605.887 459.17 605.887H432C429.899 605.887 427.818 606.059 425.877 606.393C423.936 606.726 422.172 607.215 420.687 607.832C419.201 608.449 418.022 609.181 417.218 609.986C416.414 610.792 416 611.656 416 612.528C416 613.4 416.414 614.265 417.218 615.07C418.022 615.876 419.201 616.608 420.687 617.225C422.172 617.841 423.936 618.33 425.877 618.664C427.818 618.998 429.899 619.17 432 619.17H576C584.837 619.17 592.101 626.367 591.05 635.141C583.161 700.971 527.125 752 459.17 752H331.773C304.236 752 281.048 733.379 274.115 708.042C271.782 699.519 279.163 692.227 288 692.227H432C434.101 692.227 436.182 692.054 438.123 691.721C440.064 691.387 441.828 690.898 443.313 690.281C444.799 689.665 445.978 688.933 446.782 688.127C447.586 687.321 448 686.457 448 685.585C448 684.713 447.586 683.849 446.782 683.043C445.978 682.237 444.799 681.505 443.313 680.889C441.828 680.272 440.064 679.783 438.123 679.449C436.182 679.115 434.101 678.943 432 678.943H180.83C112.875 678.943 56.8389 627.914 48.9503 562.084C47.8989 553.31 55.1635 546.113 64 546.113H432C434.101 546.113 436.182 545.941 438.123 545.607C440.064 545.274 441.828 544.785 443.313 544.168C444.799 543.551 445.978 542.819 446.782 542.014C447.586 541.208 448 540.344 448 539.472C448 538.6 447.586 537.735 446.782 536.93C445.978 536.124 444.799 535.392 443.313 534.775C441.828 534.159 440.064 533.67 438.123 533.336C436.182 533.002 434.101 532.83 432 532.83H180.83C107.47 532.83 48.0001 473.36 48 400C48 366.988 74.7615 340.227 107.773 340.227H208C210.101 340.227 212.182 340.054 214.123 339.721C216.064 339.387 217.828 338.898 219.313 338.281C220.799 337.665 221.978 336.933 222.782 336.127C223.586 335.321 224 334.457 224 333.585C224 332.713 223.586 331.849 222.782 331.043C221.978 330.237 220.799 329.505 219.313 328.889C217.828 328.272 216.064 327.783 214.123 327.449C212.182 327.115 210.101 326.943 208 326.943H64C55.1635 326.943 47.8989 319.746 48.9503 310.972C56.8389 245.143 112.875 194.113 180.83 194.113H208C210.101 194.113 212.182 193.941 214.123 193.607C216.064 193.274 217.828 192.785 219.313 192.168C220.799 191.551 221.978 190.819 222.782 190.014C223.586 189.208 224 188.344 224 187.472C224 186.6 223.586 185.735 222.782 184.93C221.978 184.124 220.799 183.392 219.313 182.775C217.828 182.159 216.064 181.67 214.123 181.336C212.182 181.002 210.101 180.83 208 180.83H64C55.1635 180.83 47.8989 173.633 48.9503 164.859C56.8389 99.0295 112.875 48 180.83 48H308.227C335.764 48.0001 358.952 66.6211 365.885 91.9582C368.218 100.481 360.837 107.773 352 107.773H208C205.899 107.773 203.818 107.946 201.877 108.279C199.936 108.613 198.172 109.102 196.687 109.719C195.201 110.335 194.022 111.067 193.218 111.873C192.414 112.679 192 113.543 192 114.415C192 115.287 192.414 116.151 193.218 116.957C194.022 117.763 195.201 118.495 196.687 119.111C198.172 119.728 199.936 120.217 201.877 120.551C203.818 120.885 205.899 121.057 208 121.057H459.17C527.125 121.057 583.161 172.086 591.05 237.916C592.101 246.69 584.837 253.887 576 253.887H208C205.899 253.887 203.818 254.059 201.877 254.393C199.936 254.726 198.172 255.215 196.687 255.832C195.201 256.449 194.022 257.181 193.218 257.986C192.414 258.792 192 259.656 192 260.528C192 261.4 192.414 262.265 193.218 263.07C194.022 263.876 195.201 264.608 196.687 265.225C198.172 265.841 199.936 266.33 201.877 266.664C203.818 266.998 205.899 267.17 208 267.17H459.17C532.53 267.17 592 326.64 592 400L591.995 400.772Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
11865
11894
|
"./abstracts/abstract-03.svg": "<svg width=\"640\" height=\"800\" viewBox=\"0 0 640 800\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M214.123 339.215C212.182 339.883 210.101 340.226 208 340.226C119.634 340.226 48 399.697 48 473.057L48 589.887C48 598.723 55.1634 605.887 64 605.887H208C210.101 605.887 212.182 606.23 214.123 606.898C216.064 607.565 217.828 608.544 219.314 609.777C220.799 611.011 221.978 612.475 222.782 614.087C223.586 615.698 224 617.425 224 619.17C224 620.914 223.586 622.641 222.782 624.253C221.978 625.865 220.799 627.329 219.314 628.562C217.828 629.796 216.064 630.774 214.123 631.442C212.182 632.109 210.101 632.453 208 632.453H192C118.981 632.453 58.6555 677.572 49.2688 736.061C47.8686 744.785 55.1634 752 64 752H576C584.837 752 592.06 744.817 591.429 736.003C581.466 596.731 442.261 486.34 272 486.34H208C205.899 486.34 203.818 485.996 201.877 485.329C199.936 484.661 198.172 483.683 196.686 482.449C195.201 481.216 194.022 479.751 193.218 478.14C192.414 476.528 192 474.801 192 473.057C192 471.312 192.414 469.585 193.218 467.973C194.022 466.362 195.201 464.898 196.686 463.664C198.172 462.431 199.936 461.452 201.877 460.785C203.818 460.117 205.899 459.774 208 459.774L576 459.774C584.837 459.774 592.06 452.59 591.429 443.776C581.466 304.505 442.261 194.113 272 194.113H208C205.899 194.113 203.818 193.77 201.877 193.102C199.936 192.435 198.172 191.456 196.686 190.223C195.201 188.989 194.022 187.525 193.218 185.913C192.414 184.302 192 182.575 192 180.83C192 179.086 192.414 177.359 193.218 175.747C194.022 174.135 195.201 172.671 196.686 171.438C198.172 170.204 199.936 169.226 201.877 168.558C203.818 167.891 205.899 167.547 208 167.547L352 167.547C360.837 167.547 368.131 160.333 366.731 151.608C357.345 93.1194 297.019 48 224 48L208 48C119.634 48 48 107.47 48 180.83L48 297.66C48 306.497 55.1635 313.66 64 313.66H208C210.101 313.66 212.182 314.004 214.123 314.671C216.064 315.339 217.828 316.317 219.314 317.551C220.799 318.784 221.978 320.249 222.782 321.86C223.586 323.472 224 325.199 224 326.943C224 328.688 223.586 330.415 222.782 332.027C221.978 333.638 220.799 335.102 219.314 336.336C217.828 337.569 216.064 338.548 214.123 339.215Z\" fill=\"currentColor\"/>\n</svg>\n",
|
|
@@ -11871,19 +11900,19 @@ var Mn = Object.entries(/* @__PURE__ */ Object.assign({
|
|
|
11871
11900
|
label: n,
|
|
11872
11901
|
svg: t
|
|
11873
11902
|
};
|
|
11874
|
-
}).sort((e, t) => e.label.localeCompare(t.label)),
|
|
11903
|
+
}).sort((e, t) => e.label.localeCompare(t.label)), Fn = [...Pn.map((e) => ({
|
|
11875
11904
|
value: e.id,
|
|
11876
11905
|
label: e.label
|
|
11877
11906
|
})), {
|
|
11878
11907
|
value: "custom",
|
|
11879
11908
|
label: "Custom SVG…"
|
|
11880
|
-
}],
|
|
11881
|
-
function
|
|
11882
|
-
return e === "custom" ? t :
|
|
11909
|
+
}], In = Pn[0]?.id ?? "custom";
|
|
11910
|
+
function Ln(e, t = "") {
|
|
11911
|
+
return e === "custom" ? t : Pn.find((t) => t.id === e)?.svg ?? "";
|
|
11883
11912
|
}
|
|
11884
11913
|
//#endregion
|
|
11885
11914
|
//#region src/editor/shell/aspects.js
|
|
11886
|
-
var
|
|
11915
|
+
var Rn = [
|
|
11887
11916
|
{
|
|
11888
11917
|
id: "1:1",
|
|
11889
11918
|
label: "1:1",
|
|
@@ -11924,7 +11953,7 @@ var In = [
|
|
|
11924
11953
|
label: "Custom",
|
|
11925
11954
|
ratio: 1
|
|
11926
11955
|
}
|
|
11927
|
-
],
|
|
11956
|
+
], zn = {
|
|
11928
11957
|
"1:1": {
|
|
11929
11958
|
w: 1080,
|
|
11930
11959
|
h: 1080
|
|
@@ -11953,17 +11982,17 @@ var In = [
|
|
|
11953
11982
|
w: 1920,
|
|
11954
11983
|
h: 1080
|
|
11955
11984
|
}
|
|
11956
|
-
},
|
|
11957
|
-
function
|
|
11985
|
+
}, Bn = "0 0 24 24";
|
|
11986
|
+
function Vn(e) {
|
|
11958
11987
|
return e ? {
|
|
11959
|
-
viewBox: e.match(/viewBox=["']([^"']+)["']/i)?.[1] ??
|
|
11988
|
+
viewBox: e.match(/viewBox=["']([^"']+)["']/i)?.[1] ?? Bn,
|
|
11960
11989
|
body: (e.match(/<svg[^>]*>([\s\S]*)<\/svg>/i)?.[1] ?? "").trim()
|
|
11961
11990
|
} : {
|
|
11962
|
-
viewBox:
|
|
11991
|
+
viewBox: Bn,
|
|
11963
11992
|
body: ""
|
|
11964
11993
|
};
|
|
11965
11994
|
}
|
|
11966
|
-
function
|
|
11995
|
+
function Hn(e) {
|
|
11967
11996
|
if (!e || typeof e != "string") return null;
|
|
11968
11997
|
try {
|
|
11969
11998
|
return Function("i", "col", "row", "cols", "rows", `with(Math){return (${e}) > 0}`);
|
|
@@ -11971,7 +12000,7 @@ function Bn(e) {
|
|
|
11971
12000
|
return null;
|
|
11972
12001
|
}
|
|
11973
12002
|
}
|
|
11974
|
-
function
|
|
12003
|
+
function Un(e, t, n) {
|
|
11975
12004
|
let r = Math.max(1, e.groupW | 0 || 1), i = Math.max(1, e.groupH | 0 || 1), a = Math.floor(t.col / r), o = Math.floor(t.row / i), s = Math.ceil(t.cols / r), c = Math.ceil(t.rows / i), l = o * s + a;
|
|
11976
12005
|
switch (e.selectKind) {
|
|
11977
12006
|
case "all": return !0;
|
|
@@ -11988,7 +12017,7 @@ function Vn(e, t, n) {
|
|
|
11988
12017
|
default: return !1;
|
|
11989
12018
|
}
|
|
11990
12019
|
}
|
|
11991
|
-
function
|
|
12020
|
+
function Wn(e, t, n) {
|
|
11992
12021
|
let r = {
|
|
11993
12022
|
rotate: 0,
|
|
11994
12023
|
scaleX: 1,
|
|
@@ -11998,19 +12027,19 @@ function Hn(e, t, n) {
|
|
|
11998
12027
|
};
|
|
11999
12028
|
for (let i = 0; i < e.length; i++) {
|
|
12000
12029
|
let a = e[i];
|
|
12001
|
-
|
|
12030
|
+
Un(a, n, t[i]) && (a.hide && (r.hidden = !0), a.flipH && (r.scaleX *= -1), a.flipV && (r.scaleY *= -1), a.rotate && (r.rotate = (r.rotate + Number(a.rotate)) % 360), typeof a.opacity == "number" && a.opacity !== 1 && (r.opacity *= Math.max(0, Math.min(1, a.opacity))));
|
|
12002
12031
|
}
|
|
12003
12032
|
return r;
|
|
12004
12033
|
}
|
|
12005
|
-
function
|
|
12034
|
+
function Gn({ rotate: e, scaleX: t, scaleY: n }, r, i) {
|
|
12006
12035
|
if (!e && t === 1 && n === 1) return "";
|
|
12007
12036
|
let a = [`translate(${r.toFixed(2)} ${i.toFixed(2)})`];
|
|
12008
12037
|
return e && a.push(`rotate(${e})`), (t !== 1 || n !== 1) && a.push(`scale(${t} ${n})`), a.push(`translate(${(-r).toFixed(2)} ${(-i).toFixed(2)})`), ` transform="${a.join(" ")}"`;
|
|
12009
12038
|
}
|
|
12010
|
-
function
|
|
12011
|
-
let { viewBox: p, body: m } =
|
|
12039
|
+
function Kn({ shapeSvg: e, cols: t = 4, rows: n = 4, gap: r = 0, stretch: i = !1, padding: a = 0, overflow: o = !1, rules: s = [], color: c = "#0E0E11", bg: l = "#FCFBF8", stroke: u = null, strokeWidth: d = 0, size: f = 256 }) {
|
|
12040
|
+
let { viewBox: p, body: m } = Vn(e), h = Math.max(1, Math.floor(t)), g = Math.max(1, Math.floor(n)), _ = Number(r) || 0, v = Number(a) || 0, y = f - 2 * v, b = f - 2 * v, x = (y - _ * (h - 1)) / h, S = (b - _ * (g - 1)) / g, C = i ? "none" : "xMidYMid meet", w = s.map((e) => e.selectKind === "expression" ? Hn(e.expression) : null), T = [];
|
|
12012
12041
|
for (let e = 0; e < g; e++) for (let t = 0; t < h; t++) {
|
|
12013
|
-
let n = e * h + t, r =
|
|
12042
|
+
let n = e * h + t, r = Wn(s, w, {
|
|
12014
12043
|
row: e,
|
|
12015
12044
|
col: t,
|
|
12016
12045
|
cols: h,
|
|
@@ -12018,7 +12047,7 @@ function Wn({ shapeSvg: e, cols: t = 4, rows: n = 4, gap: r = 0, stretch: i = !1
|
|
|
12018
12047
|
i: n
|
|
12019
12048
|
});
|
|
12020
12049
|
if (r.hidden) continue;
|
|
12021
|
-
let i = v + t * (x + _), a = v + e * (S + _), o =
|
|
12050
|
+
let i = v + t * (x + _), a = v + e * (S + _), o = Gn(r, i + x / 2, a + S / 2), c = r.opacity === 1 ? "" : ` opacity="${r.opacity.toFixed(3)}"`;
|
|
12022
12051
|
T.push(`<use href="#shape" x="${i.toFixed(2)}" y="${a.toFixed(2)}" width="${x.toFixed(2)}" height="${S.toFixed(2)}"${o}${c}/>`);
|
|
12023
12052
|
}
|
|
12024
12053
|
let E = o ? " overflow=\"visible\"" : "", D = u && d > 0, O = [];
|
|
@@ -12033,7 +12062,7 @@ ${T.join("\n")}
|
|
|
12033
12062
|
}
|
|
12034
12063
|
//#endregion
|
|
12035
12064
|
//#region src/data/typography-cuts.js
|
|
12036
|
-
var
|
|
12065
|
+
var qn = [
|
|
12037
12066
|
{
|
|
12038
12067
|
id: 100,
|
|
12039
12068
|
label: "Fine"
|
|
@@ -12062,7 +12091,7 @@ var Gn = [
|
|
|
12062
12091
|
id: 900,
|
|
12063
12092
|
label: "Black"
|
|
12064
12093
|
}
|
|
12065
|
-
],
|
|
12094
|
+
], Jn = (e) => e === "mono" ? "JetBrains Mono" : e === "base" ? "Right Grotesk" : `Right Grotesk ${e}`, Yn = (e, t) => t === "upper" ? e.toUpperCase() : t === "lower" ? e.toLowerCase() : t === "sentence" ? e.charAt(0).toUpperCase() + e.slice(1).toLowerCase() : e, Xn = [
|
|
12066
12095
|
{
|
|
12067
12096
|
id: "base",
|
|
12068
12097
|
label: "Display"
|
|
@@ -12095,7 +12124,7 @@ var Gn = [
|
|
|
12095
12124
|
id: "mono",
|
|
12096
12125
|
label: "Mono"
|
|
12097
12126
|
}
|
|
12098
|
-
],
|
|
12127
|
+
], Zn = [
|
|
12099
12128
|
{
|
|
12100
12129
|
id: "original",
|
|
12101
12130
|
label: "Aa"
|
|
@@ -12112,19 +12141,19 @@ var Gn = [
|
|
|
12112
12141
|
id: "sentence",
|
|
12113
12142
|
label: "Aa."
|
|
12114
12143
|
}
|
|
12115
|
-
],
|
|
12116
|
-
for (let e of
|
|
12117
|
-
function
|
|
12144
|
+
], Qn = [];
|
|
12145
|
+
for (let e of Xn) for (let t of qn) Qn.push([e.id, t.id]);
|
|
12146
|
+
function $n(e) {
|
|
12118
12147
|
return e = (e | 0) >>> 0, e = (e ^ 61 ^ e >>> 16) >>> 0, e = e + (e << 3) >>> 0, e = (e ^ e >>> 4) >>> 0, e = Math.imul(e, 668265261) >>> 0, e = (e ^ e >>> 15) >>> 0, e;
|
|
12119
12148
|
}
|
|
12120
|
-
function
|
|
12121
|
-
let r =
|
|
12122
|
-
n.widthLock && (r = r.filter(([e]) => e === n.widthLock)), n.weightLock && (r = r.filter(([, e]) => e === Number(n.weightLock))), r.length === 0 && (r =
|
|
12123
|
-
let i =
|
|
12149
|
+
function er(e, t, n = {}) {
|
|
12150
|
+
let r = Qn;
|
|
12151
|
+
n.widthLock && (r = r.filter(([e]) => e === n.widthLock)), n.weightLock && (r = r.filter(([, e]) => e === Number(n.weightLock))), r.length === 0 && (r = Qn);
|
|
12152
|
+
let i = $n(e * 374761393 + (t | 0) * 668265263);
|
|
12124
12153
|
return r[i % r.length];
|
|
12125
12154
|
}
|
|
12126
|
-
var
|
|
12127
|
-
function
|
|
12155
|
+
var tr = (e) => Math.floor((e ?? 0) * 99991), nr = Math.PI * 2;
|
|
12156
|
+
function rr(e, t, n, r, i) {
|
|
12128
12157
|
if (i <= 0) return 0;
|
|
12129
12158
|
if (i >= 1) return 1;
|
|
12130
12159
|
let a = 0, o = 1;
|
|
@@ -12135,7 +12164,7 @@ function tr(e, t, n, r, i) {
|
|
|
12135
12164
|
let s = (a + o) / 2, c = 1 - s;
|
|
12136
12165
|
return 3 * c * c * s * t + 3 * c * s * s * r + s * s * s;
|
|
12137
12166
|
}
|
|
12138
|
-
function
|
|
12167
|
+
function ir(e, t, n, r, i) {
|
|
12139
12168
|
let a = (n - .5) * 2;
|
|
12140
12169
|
switch (t) {
|
|
12141
12170
|
case "linear": return W(e + a);
|
|
@@ -12144,12 +12173,12 @@ function nr(e, t, n, r, i) {
|
|
|
12144
12173
|
case "expo-in": return W(e ** 3 + a);
|
|
12145
12174
|
case "expo-out": return W(1 - (1 - e) ** 3 + a);
|
|
12146
12175
|
case "log": return W(Math.log(1 + e * 9) / Math.log(10) + a);
|
|
12147
|
-
case "sine": return .5 + .5 * Math.sin((e + n) *
|
|
12148
|
-
case "custom": return W(
|
|
12176
|
+
case "sine": return .5 + .5 * Math.sin((e + n) * nr);
|
|
12177
|
+
case "custom": return W(rr(r.x, r.y, i.x, i.y, e) + a);
|
|
12149
12178
|
default: return n;
|
|
12150
12179
|
}
|
|
12151
12180
|
}
|
|
12152
|
-
var
|
|
12181
|
+
var ar = [
|
|
12153
12182
|
{
|
|
12154
12183
|
value: "flat",
|
|
12155
12184
|
label: "Flat — uniform blend"
|
|
@@ -12186,8 +12215,8 @@ var rr = [
|
|
|
12186
12215
|
value: "custom",
|
|
12187
12216
|
label: "Custom — drag on canvas"
|
|
12188
12217
|
}
|
|
12189
|
-
],
|
|
12190
|
-
function
|
|
12218
|
+
], or = Math.PI * 2;
|
|
12219
|
+
function sr(e) {
|
|
12191
12220
|
let t = e >>> 0;
|
|
12192
12221
|
return function() {
|
|
12193
12222
|
t |= 0, t = t + 1831565813 | 0;
|
|
@@ -12195,9 +12224,9 @@ function ar(e) {
|
|
|
12195
12224
|
return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
12196
12225
|
};
|
|
12197
12226
|
}
|
|
12198
|
-
var
|
|
12199
|
-
function
|
|
12200
|
-
if (
|
|
12227
|
+
var cr = /* @__PURE__ */ new Map();
|
|
12228
|
+
function lr(e) {
|
|
12229
|
+
if (cr.has(e)) return cr.get(e);
|
|
12201
12230
|
let t = (async () => {
|
|
12202
12231
|
let t = await fetch(e).then((t) => {
|
|
12203
12232
|
if (!t.ok) throw Error(`font fetch failed: ${e}`);
|
|
@@ -12205,16 +12234,16 @@ function sr(e) {
|
|
|
12205
12234
|
});
|
|
12206
12235
|
return ae.default.parse(t);
|
|
12207
12236
|
})();
|
|
12208
|
-
return
|
|
12237
|
+
return cr.set(e, t), t.catch(() => cr.delete(e)), t;
|
|
12209
12238
|
}
|
|
12210
|
-
var
|
|
12211
|
-
function
|
|
12212
|
-
return
|
|
12239
|
+
var ur = /* @__PURE__ */ new Map();
|
|
12240
|
+
function dr(e) {
|
|
12241
|
+
return ur.get(e) || null;
|
|
12213
12242
|
}
|
|
12214
|
-
function
|
|
12215
|
-
return
|
|
12243
|
+
function fr(e) {
|
|
12244
|
+
return ur.has(e) ? Promise.resolve(ur.get(e)) : lr(e).then((t) => (ur.set(e, t), t));
|
|
12216
12245
|
}
|
|
12217
|
-
function
|
|
12246
|
+
function pr(e) {
|
|
12218
12247
|
let t = [];
|
|
12219
12248
|
for (let n of e) switch (n.type) {
|
|
12220
12249
|
case "M":
|
|
@@ -12236,18 +12265,18 @@ function dr(e) {
|
|
|
12236
12265
|
}
|
|
12237
12266
|
return t.join("");
|
|
12238
12267
|
}
|
|
12239
|
-
function
|
|
12268
|
+
function mr(e, t) {
|
|
12240
12269
|
if (e.length !== t.length) return !1;
|
|
12241
12270
|
for (let n = 0; n < e.length; n++) if (e[n].type !== t[n].type) return !1;
|
|
12242
12271
|
return !0;
|
|
12243
12272
|
}
|
|
12244
|
-
function
|
|
12273
|
+
function hr(e, t, n) {
|
|
12245
12274
|
return e.map((e, r) => {
|
|
12246
12275
|
let i = t[r], a = { type: e.type };
|
|
12247
12276
|
return "x" in e && "x" in i && (a.x = re(e.x, i.x, n)), "y" in e && "y" in i && (a.y = re(e.y, i.y, n)), "x1" in e && "x1" in i && (a.x1 = re(e.x1, i.x1, n)), "y1" in e && "y1" in i && (a.y1 = re(e.y1, i.y1, n)), "x2" in e && "x2" in i && (a.x2 = re(e.x2, i.x2, n)), "y2" in e && "y2" in i && (a.y2 = re(e.y2, i.y2, n)), a;
|
|
12248
12277
|
});
|
|
12249
12278
|
}
|
|
12250
|
-
function
|
|
12279
|
+
function gr(e) {
|
|
12251
12280
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
12252
12281
|
for (let a of e) {
|
|
12253
12282
|
for (let e of [
|
|
@@ -12273,21 +12302,21 @@ function mr(e) {
|
|
|
12273
12302
|
y2: i
|
|
12274
12303
|
};
|
|
12275
12304
|
}
|
|
12276
|
-
var
|
|
12305
|
+
var _r = (e, t) => {
|
|
12277
12306
|
if (!t || !e.tables || !e.tables.fvar) return;
|
|
12278
12307
|
let n = {};
|
|
12279
12308
|
for (let r of e.tables.fvar.axes) t[r.tag] != null && (n[r.tag] = t[r.tag]);
|
|
12280
12309
|
return Object.keys(n).length ? n : void 0;
|
|
12281
12310
|
};
|
|
12282
|
-
function
|
|
12283
|
-
let i = {}, a =
|
|
12311
|
+
function vr(e, t, n, r) {
|
|
12312
|
+
let i = {}, a = _r(e, r);
|
|
12284
12313
|
return a && (i.variation = a), e.getPath(t, 0, 0, n, i).commands;
|
|
12285
12314
|
}
|
|
12286
|
-
var
|
|
12287
|
-
function
|
|
12288
|
-
return e === " " ? n * .32 + r :
|
|
12315
|
+
var yr = (e) => Math.max(0, e.x2 - e.x1);
|
|
12316
|
+
function br(e, t, n, r) {
|
|
12317
|
+
return e === " " ? n * .32 + r : yr(t) * 1.22 + r;
|
|
12289
12318
|
}
|
|
12290
|
-
function
|
|
12319
|
+
function xr(e, t, n, r, i) {
|
|
12291
12320
|
if (i <= 0) return 0;
|
|
12292
12321
|
if (i >= 1) return 1;
|
|
12293
12322
|
let a = 0, o = 1;
|
|
@@ -12298,7 +12327,7 @@ function yr(e, t, n, r, i) {
|
|
|
12298
12327
|
let s = (a + o) / 2, c = 1 - s;
|
|
12299
12328
|
return 3 * c * c * s * t + 3 * c * s * s * r + s * s * s;
|
|
12300
12329
|
}
|
|
12301
|
-
function
|
|
12330
|
+
function Sr(e, t, n, r, i) {
|
|
12302
12331
|
let a = (n - .5) * 2;
|
|
12303
12332
|
switch (t) {
|
|
12304
12333
|
case "linear": return W(e + a);
|
|
@@ -12307,12 +12336,12 @@ function br(e, t, n, r, i) {
|
|
|
12307
12336
|
case "expo-in": return W(e ** 3 + a);
|
|
12308
12337
|
case "expo-out": return W(1 - (1 - e) ** 3 + a);
|
|
12309
12338
|
case "log": return W(Math.log(1 + e * 9) / Math.log(10) + a);
|
|
12310
|
-
case "sine": return .5 + .5 * Math.sin((e + n) *
|
|
12311
|
-
case "custom": return W(
|
|
12339
|
+
case "sine": return .5 + .5 * Math.sin((e + n) * or);
|
|
12340
|
+
case "custom": return W(xr(r.x, r.y, i.x, i.y, e) + a);
|
|
12312
12341
|
default: return n;
|
|
12313
12342
|
}
|
|
12314
12343
|
}
|
|
12315
|
-
var
|
|
12344
|
+
var Cr = [
|
|
12316
12345
|
{
|
|
12317
12346
|
value: "flat",
|
|
12318
12347
|
label: "Flat — uniform blend"
|
|
@@ -12349,7 +12378,7 @@ var xr = [
|
|
|
12349
12378
|
value: "custom",
|
|
12350
12379
|
label: "Custom (bézier)"
|
|
12351
12380
|
}
|
|
12352
|
-
],
|
|
12381
|
+
], wr = [
|
|
12353
12382
|
{
|
|
12354
12383
|
value: "morph",
|
|
12355
12384
|
label: "Morph paths"
|
|
@@ -12363,39 +12392,39 @@ var xr = [
|
|
|
12363
12392
|
label: "Random / letter"
|
|
12364
12393
|
}
|
|
12365
12394
|
];
|
|
12366
|
-
function
|
|
12395
|
+
function Tr(e, t, n, r, i) {
|
|
12367
12396
|
let a = Array.from(n).filter((e) => e !== "\n"), o = Math.max(1, a.length - 1), { mode: s = "morph", blend: c = .5, curve: l = "flat" } = i, u = i.cp1 || {
|
|
12368
12397
|
x: .33,
|
|
12369
12398
|
y: .33
|
|
12370
12399
|
}, d = i.cp2 || {
|
|
12371
12400
|
x: .66,
|
|
12372
12401
|
y: .66
|
|
12373
|
-
}, f = i.axes || [], p = i.gap == null ? r * .12 : i.gap, m = s === "random" ?
|
|
12402
|
+
}, f = i.axes || [], p = i.gap == null ? r * .12 : i.gap, m = s === "random" ? sr(Math.floor((c || 0) * 1e5) + 1) : null, h = [], g = 0;
|
|
12374
12403
|
for (let n = 0; n < a.length; n++) {
|
|
12375
|
-
let _ = a[n], v =
|
|
12404
|
+
let _ = a[n], v = Sr(n / o, l, c, u, d);
|
|
12376
12405
|
if (s === "random") {
|
|
12377
12406
|
let t = {};
|
|
12378
12407
|
for (let e of f) t[e.tag] = Math.round(e.min + m() * (e.max - e.min));
|
|
12379
|
-
let n =
|
|
12408
|
+
let n = vr(e, _, r, t), i = gr(n), a = br(_, i, r, p);
|
|
12380
12409
|
h.push({
|
|
12381
12410
|
ch: _,
|
|
12382
12411
|
mode: s,
|
|
12383
|
-
d:
|
|
12412
|
+
d: pr(n),
|
|
12384
12413
|
bbox: i,
|
|
12385
12414
|
advance: a
|
|
12386
12415
|
}), g += a;
|
|
12387
12416
|
continue;
|
|
12388
12417
|
}
|
|
12389
|
-
let y =
|
|
12418
|
+
let y = vr(e, _, r, i.coordsA), b = vr(t, _, r, i.coordsB);
|
|
12390
12419
|
if (s === "fade") {
|
|
12391
|
-
let e =
|
|
12420
|
+
let e = gr(y), t = gr(b), n = Math.max(br(_, e, r, p), br(_, t, r, p));
|
|
12392
12421
|
h.push({
|
|
12393
12422
|
ch: _,
|
|
12394
12423
|
mode: s,
|
|
12395
|
-
dA:
|
|
12424
|
+
dA: pr(y),
|
|
12396
12425
|
bboxA: e,
|
|
12397
12426
|
opA: 1 - v,
|
|
12398
|
-
dB:
|
|
12427
|
+
dB: pr(b),
|
|
12399
12428
|
bboxB: t,
|
|
12400
12429
|
opB: v,
|
|
12401
12430
|
advance: n
|
|
@@ -12403,12 +12432,12 @@ function Cr(e, t, n, r, i) {
|
|
|
12403
12432
|
continue;
|
|
12404
12433
|
}
|
|
12405
12434
|
let x;
|
|
12406
|
-
x =
|
|
12407
|
-
let S =
|
|
12435
|
+
x = mr(y, b) ? hr(y, b, v) : v < .5 ? y : b, x = Array.isArray(x) ? x : [];
|
|
12436
|
+
let S = gr(x), C = br(_, S, r, p);
|
|
12408
12437
|
h.push({
|
|
12409
12438
|
ch: _,
|
|
12410
12439
|
mode: s,
|
|
12411
|
-
d:
|
|
12440
|
+
d: pr(x),
|
|
12412
12441
|
bbox: S,
|
|
12413
12442
|
advance: C
|
|
12414
12443
|
}), g += C;
|
|
@@ -12420,18 +12449,18 @@ function Cr(e, t, n, r, i) {
|
|
|
12420
12449
|
}
|
|
12421
12450
|
//#endregion
|
|
12422
12451
|
//#region src/editor/modes/type/buildTypeSvg.js
|
|
12423
|
-
function
|
|
12452
|
+
function Er(e, t, n) {
|
|
12424
12453
|
return e === "left" ? 0 : e === "right" ? t - n : (t - n) / 2;
|
|
12425
12454
|
}
|
|
12426
|
-
async function
|
|
12455
|
+
async function Dr(e) {
|
|
12427
12456
|
let t = await le(e.width, e.weight, e.italic), n = t, r = e.axisMode ?? "morph";
|
|
12428
12457
|
return e.axisOn && (r === "morph" || r === "fade") && (n = await le(e.width2, e.weight2, e.italic)), {
|
|
12429
12458
|
a: t,
|
|
12430
12459
|
b: n
|
|
12431
12460
|
};
|
|
12432
12461
|
}
|
|
12433
|
-
async function
|
|
12434
|
-
let t =
|
|
12462
|
+
async function Or(e) {
|
|
12463
|
+
let t = Yn(e.text, e.case), n = Array.from(t).filter((e) => e !== "\n").length;
|
|
12435
12464
|
if (n === 0) return {
|
|
12436
12465
|
glyphs: [],
|
|
12437
12466
|
totalW: 0,
|
|
@@ -12439,24 +12468,24 @@ async function Er(e) {
|
|
|
12439
12468
|
tx: e.x,
|
|
12440
12469
|
ty: e.y
|
|
12441
12470
|
};
|
|
12442
|
-
let { a: r, b: i } = await
|
|
12471
|
+
let { a: r, b: i } = await Dr(e), a = e.size, o = e.axisMode ?? "morph", s = (e.tracking ?? -.01) * a, c = Math.max(1, n - 1), l = e.blend ?? e.axisBlend ?? .5, u = a / r.unitsPerEm, d = r.ascender * u, f = -r.descender * u, p = (e.lineHeight ?? 1.05) * a, m = t.split("\n"), h = Math.max(m.length * p, a), g = e.h ?? h, _ = e.verticalAlign === "top" ? 0 : e.verticalAlign === "bottom" ? g - h : (g - h) / 2, v = [], y = 0, b = 0, x = 0;
|
|
12443
12472
|
for (let t = 0; t < m.length; t++) {
|
|
12444
12473
|
let n = Array.from(m[t]), u = _ + t * p + (p - (d + f)) / 2 + d, h = [], g = 0;
|
|
12445
12474
|
for (let t of n) {
|
|
12446
12475
|
let n = x / c, d, f, p;
|
|
12447
12476
|
if (e.axisOn && o === "morph") {
|
|
12448
|
-
let o =
|
|
12477
|
+
let o = ir(n, e.axisCurve ?? "flat", l, e.curveCp1 ?? {
|
|
12449
12478
|
x: .33,
|
|
12450
12479
|
y: .33
|
|
12451
12480
|
}, e.curveCp2 ?? {
|
|
12452
12481
|
x: .66,
|
|
12453
12482
|
y: .66
|
|
12454
|
-
}), c = r.getPath(t, 0, 0, a), u = i.getPath(t, 0, 0, a), m =
|
|
12455
|
-
d =
|
|
12483
|
+
}), c = r.getPath(t, 0, 0, a), u = i.getPath(t, 0, 0, a), m = mr(c.commands, u.commands) ? hr(c.commands, u.commands, o) : (o < .5 ? c : u).commands;
|
|
12484
|
+
d = pr(m), p = gr(m);
|
|
12456
12485
|
let h = r.charToGlyph(t).advanceWidth * (a / r.unitsPerEm), g = i.charToGlyph(t).advanceWidth * (a / i.unitsPerEm);
|
|
12457
12486
|
f = h * (1 - o) + g * o + s;
|
|
12458
12487
|
} else if (e.axisOn && o === "random") {
|
|
12459
|
-
let n =
|
|
12488
|
+
let n = tr(l), [r, i] = er(b, n, {
|
|
12460
12489
|
widthLock: e.randomWidthLock,
|
|
12461
12490
|
weightLock: e.randomWeightLock
|
|
12462
12491
|
}), o = await le(r, i, e.italic), c = o.getPath(t, 0, 0, a);
|
|
@@ -12477,7 +12506,7 @@ async function Er(e) {
|
|
|
12477
12506
|
b += 1;
|
|
12478
12507
|
let S = g;
|
|
12479
12508
|
for (let e = h.length - 1; e >= 0 && /\s/.test(h[e].ch); e--) S -= h[e].advance;
|
|
12480
|
-
let C =
|
|
12509
|
+
let C = Er(e.textAlign ?? "center", e.w, S);
|
|
12481
12510
|
for (let e of h) e.x += C;
|
|
12482
12511
|
v.push(...h), y = Math.max(y, S);
|
|
12483
12512
|
}
|
|
@@ -12491,11 +12520,11 @@ async function Er(e) {
|
|
|
12491
12520
|
}
|
|
12492
12521
|
//#endregion
|
|
12493
12522
|
//#region src/editor/compose/helpers.js
|
|
12494
|
-
function
|
|
12523
|
+
function kr(e, t) {
|
|
12495
12524
|
for (let n of e) {
|
|
12496
12525
|
if (n.id === t) return n;
|
|
12497
12526
|
if (Array.isArray(n.children)) {
|
|
12498
|
-
let e =
|
|
12527
|
+
let e = kr(n.children, t);
|
|
12499
12528
|
if (e) return e;
|
|
12500
12529
|
}
|
|
12501
12530
|
}
|
|
@@ -12503,66 +12532,66 @@ function Dr(e, t) {
|
|
|
12503
12532
|
}
|
|
12504
12533
|
//#endregion
|
|
12505
12534
|
//#region src/editor/lib/clipStore.js
|
|
12506
|
-
var
|
|
12507
|
-
let n = indexedDB.open(
|
|
12508
|
-
n.onupgradeneeded = () => n.result.createObjectStore(
|
|
12535
|
+
var Ar = "kol-editor-clips", jr = "clips", Mr = () => new Promise((e, t) => {
|
|
12536
|
+
let n = indexedDB.open(Ar, 1);
|
|
12537
|
+
n.onupgradeneeded = () => n.result.createObjectStore(jr), n.onsuccess = () => e(n.result), n.onerror = () => t(n.error);
|
|
12509
12538
|
});
|
|
12510
|
-
async function
|
|
12539
|
+
async function Nr(e, t) {
|
|
12511
12540
|
try {
|
|
12512
|
-
let n = await
|
|
12541
|
+
let n = await Mr();
|
|
12513
12542
|
await new Promise((r, i) => {
|
|
12514
|
-
let a = n.transaction(
|
|
12515
|
-
a.objectStore(
|
|
12543
|
+
let a = n.transaction(jr, "readwrite");
|
|
12544
|
+
a.objectStore(jr).put(t, e), a.oncomplete = r, a.onerror = () => i(a.error);
|
|
12516
12545
|
});
|
|
12517
12546
|
} catch {}
|
|
12518
12547
|
}
|
|
12519
|
-
async function
|
|
12548
|
+
async function Pr(e) {
|
|
12520
12549
|
try {
|
|
12521
|
-
let t = await
|
|
12550
|
+
let t = await Mr();
|
|
12522
12551
|
return await new Promise((n, r) => {
|
|
12523
|
-
let i = t.transaction(
|
|
12552
|
+
let i = t.transaction(jr, "readonly").objectStore(jr).get(e);
|
|
12524
12553
|
i.onsuccess = () => n(i.result || null), i.onerror = () => r(i.error);
|
|
12525
12554
|
});
|
|
12526
12555
|
} catch {
|
|
12527
12556
|
return null;
|
|
12528
12557
|
}
|
|
12529
12558
|
}
|
|
12530
|
-
async function
|
|
12559
|
+
async function Fr(e) {
|
|
12531
12560
|
try {
|
|
12532
|
-
let t = await
|
|
12561
|
+
let t = await Mr();
|
|
12533
12562
|
await new Promise((n) => {
|
|
12534
|
-
let r = t.transaction(
|
|
12535
|
-
r.objectStore(
|
|
12563
|
+
let r = t.transaction(jr, "readwrite");
|
|
12564
|
+
r.objectStore(jr).delete(e), r.oncomplete = n;
|
|
12536
12565
|
});
|
|
12537
12566
|
} catch {}
|
|
12538
12567
|
}
|
|
12539
|
-
async function
|
|
12568
|
+
async function Ir(e) {
|
|
12540
12569
|
try {
|
|
12541
|
-
if (typeof indexedDB.databases == "function" && !(await indexedDB.databases()).some((e) => e.name ===
|
|
12542
|
-
let t = new Set(
|
|
12543
|
-
let r = n.transaction(
|
|
12570
|
+
if (typeof indexedDB.databases == "function" && !(await indexedDB.databases()).some((e) => e.name === Ar)) return;
|
|
12571
|
+
let t = new Set(Rr(e)), n = await Mr(), r = (await new Promise((e, t) => {
|
|
12572
|
+
let r = n.transaction(jr, "readonly").objectStore(jr).getAllKeys();
|
|
12544
12573
|
r.onsuccess = () => e(r.result || []), r.onerror = () => t(r.error);
|
|
12545
12574
|
})).filter((e) => !t.has(e));
|
|
12546
12575
|
if (r.length === 0) return;
|
|
12547
12576
|
await new Promise((e) => {
|
|
12548
|
-
let t = n.transaction(
|
|
12577
|
+
let t = n.transaction(jr, "readwrite"), i = t.objectStore(jr);
|
|
12549
12578
|
r.forEach((e) => i.delete(e)), t.oncomplete = e;
|
|
12550
12579
|
});
|
|
12551
12580
|
} catch {}
|
|
12552
12581
|
}
|
|
12553
|
-
var
|
|
12554
|
-
function
|
|
12555
|
-
for (let n of e)
|
|
12582
|
+
var Lr = (e) => (e?.srcType === "video" || e?.srcType === "image") && typeof e?.src == "string" && e.src.startsWith("blob:");
|
|
12583
|
+
function Rr(e, t = []) {
|
|
12584
|
+
for (let n of e) Lr(n) && n?.id && t.push(n.id), Array.isArray(n?.children) && Rr(n.children, t);
|
|
12556
12585
|
return t;
|
|
12557
12586
|
}
|
|
12558
|
-
function
|
|
12587
|
+
function zr(e, t) {
|
|
12559
12588
|
let n = !1, r = e.map((e) => {
|
|
12560
12589
|
let r = e;
|
|
12561
|
-
if (
|
|
12590
|
+
if (Lr(e) && t[e.id] && (r = {
|
|
12562
12591
|
...e,
|
|
12563
12592
|
src: t[e.id]
|
|
12564
12593
|
}, n = !0), Array.isArray(e?.children)) {
|
|
12565
|
-
let i =
|
|
12594
|
+
let i = zr(e.children, t);
|
|
12566
12595
|
i !== e.children && (r = {
|
|
12567
12596
|
...r,
|
|
12568
12597
|
children: i
|
|
@@ -12572,18 +12601,18 @@ function Lr(e, t) {
|
|
|
12572
12601
|
});
|
|
12573
12602
|
return n ? r : e;
|
|
12574
12603
|
}
|
|
12575
|
-
async function
|
|
12576
|
-
let t =
|
|
12604
|
+
async function Br(e) {
|
|
12605
|
+
let t = Rr(e);
|
|
12577
12606
|
if (t.length === 0) return e;
|
|
12578
12607
|
let n = {};
|
|
12579
12608
|
return await Promise.all(t.map(async (e) => {
|
|
12580
|
-
let t = await
|
|
12609
|
+
let t = await Pr(e);
|
|
12581
12610
|
t && (n[e] = URL.createObjectURL(t));
|
|
12582
|
-
})), Object.keys(n).length ?
|
|
12611
|
+
})), Object.keys(n).length ? zr(e, n) : e;
|
|
12583
12612
|
}
|
|
12584
12613
|
//#endregion
|
|
12585
12614
|
//#region src/editor/compose/vectorEffects.js
|
|
12586
|
-
var
|
|
12615
|
+
var Vr = (e) => !!e.distressOn, Hr = [
|
|
12587
12616
|
{
|
|
12588
12617
|
key: "offsetOn",
|
|
12589
12618
|
label: "Offset path",
|
|
@@ -12775,7 +12804,7 @@ var zr = (e) => !!e.distressOn, Br = [
|
|
|
12775
12804
|
type: "select",
|
|
12776
12805
|
options: Xt,
|
|
12777
12806
|
default: "print-press",
|
|
12778
|
-
when:
|
|
12807
|
+
when: Vr,
|
|
12779
12808
|
section: "Vector effects"
|
|
12780
12809
|
},
|
|
12781
12810
|
{
|
|
@@ -12786,7 +12815,7 @@ var zr = (e) => !!e.distressOn, Br = [
|
|
|
12786
12815
|
max: 80,
|
|
12787
12816
|
step: 1,
|
|
12788
12817
|
default: 12,
|
|
12789
|
-
when:
|
|
12818
|
+
when: Vr,
|
|
12790
12819
|
section: "Vector effects",
|
|
12791
12820
|
animatable: !1
|
|
12792
12821
|
},
|
|
@@ -12798,7 +12827,7 @@ var zr = (e) => !!e.distressOn, Br = [
|
|
|
12798
12827
|
max: 100,
|
|
12799
12828
|
step: 1,
|
|
12800
12829
|
default: 30,
|
|
12801
|
-
when:
|
|
12830
|
+
when: Vr,
|
|
12802
12831
|
section: "Vector effects",
|
|
12803
12832
|
animatable: !1
|
|
12804
12833
|
},
|
|
@@ -12810,7 +12839,7 @@ var zr = (e) => !!e.distressOn, Br = [
|
|
|
12810
12839
|
max: 100,
|
|
12811
12840
|
step: 1,
|
|
12812
12841
|
default: 20,
|
|
12813
|
-
when:
|
|
12842
|
+
when: Vr,
|
|
12814
12843
|
section: "Vector effects",
|
|
12815
12844
|
animatable: !1
|
|
12816
12845
|
},
|
|
@@ -12822,23 +12851,23 @@ var zr = (e) => !!e.distressOn, Br = [
|
|
|
12822
12851
|
max: 9999,
|
|
12823
12852
|
step: 1,
|
|
12824
12853
|
default: 7,
|
|
12825
|
-
when:
|
|
12854
|
+
when: Vr,
|
|
12826
12855
|
section: "Vector effects",
|
|
12827
12856
|
animatable: !1,
|
|
12828
12857
|
noRandom: !0
|
|
12829
12858
|
}
|
|
12830
|
-
],
|
|
12859
|
+
], Ur = (e, t, n) => {
|
|
12831
12860
|
let r = e.out ?? e, i = t.in ?? t, a = 1 - n;
|
|
12832
12861
|
return {
|
|
12833
12862
|
x: a * a * a * e.x + 3 * a * a * n * r.x + 3 * a * n * n * i.x + n * n * n * t.x,
|
|
12834
12863
|
y: a * a * a * e.y + 3 * a * a * n * r.y + 3 * a * n * n * i.y + n * n * n * t.y
|
|
12835
12864
|
};
|
|
12836
12865
|
};
|
|
12837
|
-
function
|
|
12866
|
+
function Wr(e, t, n) {
|
|
12838
12867
|
let r = t ? e.length : e.length - 1, i = [];
|
|
12839
12868
|
for (let t = 0; t < r; t++) {
|
|
12840
12869
|
let n = e[t], r = e[(t + 1) % e.length];
|
|
12841
|
-
for (let e = 0; e < 24; e++) i.push(
|
|
12870
|
+
for (let e = 0; e < 24; e++) i.push(Ur(n, r, e / 24));
|
|
12842
12871
|
}
|
|
12843
12872
|
i.push(t ? i[0] : e[e.length - 1]);
|
|
12844
12873
|
let a = [0];
|
|
@@ -12858,7 +12887,7 @@ function Hr(e, t, n) {
|
|
|
12858
12887
|
}
|
|
12859
12888
|
return u;
|
|
12860
12889
|
}
|
|
12861
|
-
function
|
|
12890
|
+
function Gr(e, t) {
|
|
12862
12891
|
let n = e.length, r = (r) => t ? e[(r + n) % n] : e[Math.min(Math.max(r, 0), n - 1)], i = e.map((e) => ({
|
|
12863
12892
|
x: e.x,
|
|
12864
12893
|
y: e.y,
|
|
@@ -12879,7 +12908,7 @@ function Ur(e, t) {
|
|
|
12879
12908
|
}
|
|
12880
12909
|
return i;
|
|
12881
12910
|
}
|
|
12882
|
-
function
|
|
12911
|
+
function Kr(e, t, n) {
|
|
12883
12912
|
let r = (e.smoothAmount ?? 100) / 100 / 6, i = t.length;
|
|
12884
12913
|
return t.map((e, a) => {
|
|
12885
12914
|
let o = t[n ? (a - 1 + i) % i : Math.max(0, a - 1)], s = t[n ? (a + 1) % i : Math.min(i - 1, a + 1)], c = (s.x - o.x) * r, l = (s.y - o.y) * r;
|
|
@@ -12897,8 +12926,8 @@ function Wr(e, t, n) {
|
|
|
12897
12926
|
};
|
|
12898
12927
|
});
|
|
12899
12928
|
}
|
|
12900
|
-
function
|
|
12901
|
-
let r = e.offsetDist ?? 12, i =
|
|
12929
|
+
function qr(e, t, n) {
|
|
12930
|
+
let r = e.offsetDist ?? 12, i = Wr(t, n, 90);
|
|
12902
12931
|
if (i.length < 3 || !r) return t;
|
|
12903
12932
|
let a = i.length, o = 0;
|
|
12904
12933
|
for (let e = 0; e < a; e++) {
|
|
@@ -12906,7 +12935,7 @@ function Gr(e, t, n) {
|
|
|
12906
12935
|
o += t.x * n.y - n.x * t.y;
|
|
12907
12936
|
}
|
|
12908
12937
|
let s = n && o < 0 ? -1 : 1;
|
|
12909
|
-
return
|
|
12938
|
+
return Gr(i.map((e, t) => {
|
|
12910
12939
|
let o = i[n ? (t - 1 + a) % a : Math.max(0, t - 1)], c = i[n ? (t + 1) % a : Math.min(a - 1, t + 1)], l = c.x - o.x, u = c.y - o.y, d = Math.hypot(l, u) || 1;
|
|
12911
12940
|
return {
|
|
12912
12941
|
x: e.x + u / d * r * s,
|
|
@@ -12914,8 +12943,8 @@ function Gr(e, t, n) {
|
|
|
12914
12943
|
};
|
|
12915
12944
|
}), n);
|
|
12916
12945
|
}
|
|
12917
|
-
function
|
|
12918
|
-
let r =
|
|
12946
|
+
function Jr(e, t, n) {
|
|
12947
|
+
let r = Yr(e, 96), i = Yr(t, 96);
|
|
12919
12948
|
if (!r.length || !i.length) return [];
|
|
12920
12949
|
let a = (e) => e.reduce((t, n, r) => {
|
|
12921
12950
|
let i = e[(r + 1) % e.length];
|
|
@@ -12947,10 +12976,10 @@ function Kr(e, t, n) {
|
|
|
12947
12976
|
}
|
|
12948
12977
|
return f;
|
|
12949
12978
|
}
|
|
12950
|
-
var
|
|
12951
|
-
let n =
|
|
12979
|
+
var Yr = (e, t) => {
|
|
12980
|
+
let n = Wr(e.nodes, !0, 100);
|
|
12952
12981
|
return n.length < 3 ? [] : Array.from({ length: t }, (e, r) => n[Math.floor(r / t * n.length)]);
|
|
12953
|
-
},
|
|
12982
|
+
}, Xr = (e) => {
|
|
12954
12983
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
12955
12984
|
for (let a of e) t = Math.min(t, a.x), n = Math.min(n, a.y), r = Math.max(r, a.x), i = Math.max(i, a.y);
|
|
12956
12985
|
return {
|
|
@@ -12962,8 +12991,8 @@ var qr = (e, t) => {
|
|
|
12962
12991
|
cy: (n + i) / 2
|
|
12963
12992
|
};
|
|
12964
12993
|
};
|
|
12965
|
-
function
|
|
12966
|
-
let r = (e.puckerAmount ?? 40) / 100, i =
|
|
12994
|
+
function Zr(e, t, n) {
|
|
12995
|
+
let r = (e.puckerAmount ?? 40) / 100, i = Xr(t), a = t.length, o = (e, t, n) => ({
|
|
12967
12996
|
x: e.x + (t.x - e.x) * n,
|
|
12968
12997
|
y: e.y + (t.y - e.y) * n
|
|
12969
12998
|
}), s = (e, t) => ({
|
|
@@ -12979,11 +13008,11 @@ function Yr(e, t, n) {
|
|
|
12979
13008
|
};
|
|
12980
13009
|
});
|
|
12981
13010
|
}
|
|
12982
|
-
function
|
|
12983
|
-
let r =
|
|
13011
|
+
function Qr(e, t, n) {
|
|
13012
|
+
let r = Wr(t, n, 70);
|
|
12984
13013
|
if (r.length < 3) return t;
|
|
12985
|
-
let i =
|
|
12986
|
-
return
|
|
13014
|
+
let i = Xr(r), a = Math.hypot(i.w, i.h) / 2, o = (e.twistAngle ?? 90) * Math.PI / 180;
|
|
13015
|
+
return Gr(r.map((e) => {
|
|
12987
13016
|
let t = e.x - i.cx, n = e.y - i.cy, r = o * (1 - Math.min(1, Math.hypot(t, n) / a));
|
|
12988
13017
|
return {
|
|
12989
13018
|
x: i.cx + t * Math.cos(r) - n * Math.sin(r),
|
|
@@ -12991,11 +13020,11 @@ function Xr(e, t, n) {
|
|
|
12991
13020
|
};
|
|
12992
13021
|
}), n);
|
|
12993
13022
|
}
|
|
12994
|
-
function
|
|
12995
|
-
let r =
|
|
13023
|
+
function $r(e, t, n) {
|
|
13024
|
+
let r = Wr(t, n, 70);
|
|
12996
13025
|
if (r.length < 3) return t;
|
|
12997
|
-
let i =
|
|
12998
|
-
return
|
|
13026
|
+
let i = Xr(r), a = (e.warpBend ?? 40) / 100, o = e.warpStyle ?? "arc";
|
|
13027
|
+
return Gr(r.map((e) => {
|
|
12999
13028
|
let t = (e.x - i.x0) / i.w, n = (e.y - i.y0) / i.h, r = 1 - (2 * t - 1) ** 2, s = o === "arc" ? -a * i.h * .5 * r : o === "bulge" ? (n - .5) * 2 * a * i.h * .35 * r : o === "wave" ? a * i.h * .25 * Math.sin(2 * Math.PI * t) : a * i.h * .25 * Math.sin(2 * Math.PI * t) * t;
|
|
13000
13029
|
return {
|
|
13001
13030
|
x: e.x,
|
|
@@ -13003,8 +13032,8 @@ function Zr(e, t, n) {
|
|
|
13003
13032
|
};
|
|
13004
13033
|
}), n);
|
|
13005
13034
|
}
|
|
13006
|
-
function
|
|
13007
|
-
let r = Math.max(4, Math.round(e.zigzagRidges ?? 40)), i =
|
|
13035
|
+
function ei(e, t, n) {
|
|
13036
|
+
let r = Math.max(4, Math.round(e.zigzagRidges ?? 40)), i = Wr(t, n, 50);
|
|
13008
13037
|
if (i.length < 3) return t;
|
|
13009
13038
|
let a = r * 2, o = [];
|
|
13010
13039
|
for (let e = 0; e < a; e++) o.push(i[Math.min(i.length - 1, Math.round(e / a * (n ? i.length : i.length - 1)))]);
|
|
@@ -13015,16 +13044,16 @@ function Qr(e, t, n) {
|
|
|
13015
13044
|
y: e.y + c / u * d
|
|
13016
13045
|
};
|
|
13017
13046
|
});
|
|
13018
|
-
return (e.zigzagSmooth ?? "corner") === "smooth" ?
|
|
13047
|
+
return (e.zigzagSmooth ?? "corner") === "smooth" ? Gr(c, n) : c.map((e) => ({
|
|
13019
13048
|
x: e.x,
|
|
13020
13049
|
y: e.y,
|
|
13021
13050
|
in: null,
|
|
13022
13051
|
out: null
|
|
13023
13052
|
}));
|
|
13024
13053
|
}
|
|
13025
|
-
function
|
|
13026
|
-
if (!Array.isArray(t) || t.length < 2 || (e?.offsetOn && (t =
|
|
13027
|
-
let r = e.distressFreq ?? 30, i =
|
|
13054
|
+
function ti(e, t, n) {
|
|
13055
|
+
if (!Array.isArray(t) || t.length < 2 || (e?.offsetOn && (t = qr(e, t, n)), e?.smoothOn && (t = Kr(e, t, n)), e?.puckerOn && (t = Zr(e, t, n)), e?.twistOn && (t = Qr(e, t, n)), e?.warpOn && (t = $r(e, t, n)), e?.zigzagOn && (t = ei(e, t, n)), !e?.distressOn)) return t;
|
|
13056
|
+
let r = e.distressFreq ?? 30, i = Wr(t, n, r);
|
|
13028
13057
|
if (i.length < 3) return t;
|
|
13029
13058
|
let a = Math.max(0, e.distressAmount ?? 12), o = Math.max(1, r <= 50 ? r / 6 : 50 / 6 + (r - 50) / 8), s = e.distressSeed ?? 7, c = e.distressSmooth ?? 20, l = c > 0 ? Math.max(1, Math.round(c / 30)) : 0, u = i.map((t, n) => Yt(e.distressMode ?? "print-press", n, t.t, a, o, s, 0)), d = l > 0 ? u.map((e, t) => {
|
|
13030
13059
|
let r = 0, i = 0, a = 0;
|
|
@@ -13039,14 +13068,14 @@ function $r(e, t, n) {
|
|
|
13039
13068
|
dy: i / a
|
|
13040
13069
|
};
|
|
13041
13070
|
}) : u;
|
|
13042
|
-
return
|
|
13071
|
+
return Gr(i.map((e, t) => ({
|
|
13043
13072
|
x: e.x + d[t].dx,
|
|
13044
13073
|
y: e.y + d[t].dy
|
|
13045
13074
|
})), n);
|
|
13046
13075
|
}
|
|
13047
13076
|
//#endregion
|
|
13048
13077
|
//#region src/editor/compose/shape-math.js
|
|
13049
|
-
function
|
|
13078
|
+
function ni(e, t, n, r = 0) {
|
|
13050
13079
|
let i = e / 2, a = t / 2, o = Math.max(0, e / 2 - r), s = Math.max(0, t / 2 - r), c = Math.max(3, Math.min(12, n | 0)), l = [];
|
|
13051
13080
|
for (let e = 0; e < c; e++) {
|
|
13052
13081
|
let t = -Math.PI / 2 + e * 2 * Math.PI / c;
|
|
@@ -13054,7 +13083,7 @@ function ei(e, t, n, r = 0) {
|
|
|
13054
13083
|
}
|
|
13055
13084
|
return l.join(" ");
|
|
13056
13085
|
}
|
|
13057
|
-
function
|
|
13086
|
+
function ri(e, t, n, r = .5, i = 0) {
|
|
13058
13087
|
let a = e / 2, o = t / 2, s = Math.max(0, e / 2 - i), c = Math.max(0, t / 2 - i), l = Math.max(.1, Math.min(.95, r)), u = s * l, d = c * l, f = Math.max(3, Math.min(12, n | 0)), p = f * 2, m = [];
|
|
13059
13088
|
for (let e = 0; e < p; e++) {
|
|
13060
13089
|
let t = -Math.PI / 2 + e * Math.PI / f, n = e % 2 == 0, r = n ? s : u, i = n ? c : d;
|
|
@@ -13062,10 +13091,10 @@ function ti(e, t, n, r = .5, i = 0) {
|
|
|
13062
13091
|
}
|
|
13063
13092
|
return m.join(" ");
|
|
13064
13093
|
}
|
|
13065
|
-
function
|
|
13094
|
+
function ii(e, t, n = 0, r = .5) {
|
|
13066
13095
|
return `${n + (e - n * 2) * Math.max(0, Math.min(1, r))},${n} ${n},${t - n} ${e - n},${t - n}`;
|
|
13067
13096
|
}
|
|
13068
|
-
var
|
|
13097
|
+
var ai = .5523, oi = (e) => e.split(" ").map((e) => {
|
|
13069
13098
|
let [t, n] = e.split(",").map(Number);
|
|
13070
13099
|
return {
|
|
13071
13100
|
x: t,
|
|
@@ -13074,7 +13103,7 @@ var ri = .5523, ii = (e) => e.split(" ").map((e) => {
|
|
|
13074
13103
|
out: null
|
|
13075
13104
|
};
|
|
13076
13105
|
});
|
|
13077
|
-
function
|
|
13106
|
+
function si(e, t) {
|
|
13078
13107
|
let n = (e) => Array.isArray(t) ? t[e] ?? 0 : t;
|
|
13079
13108
|
if (e.length < 3 || !e.some((e, t) => n(t) > 0)) return e;
|
|
13080
13109
|
let r = [], i = e.length;
|
|
@@ -13095,21 +13124,21 @@ function ai(e, t) {
|
|
|
13095
13124
|
...d,
|
|
13096
13125
|
in: null,
|
|
13097
13126
|
out: {
|
|
13098
|
-
x: d.x + (a.x - d.x) *
|
|
13099
|
-
y: d.y + (a.y - d.y) *
|
|
13127
|
+
x: d.x + (a.x - d.x) * ai,
|
|
13128
|
+
y: d.y + (a.y - d.y) * ai
|
|
13100
13129
|
}
|
|
13101
13130
|
}), r.push({
|
|
13102
13131
|
...f,
|
|
13103
13132
|
in: {
|
|
13104
|
-
x: f.x + (a.x - f.x) *
|
|
13105
|
-
y: f.y + (a.y - f.y) *
|
|
13133
|
+
x: f.x + (a.x - f.x) * ai,
|
|
13134
|
+
y: f.y + (a.y - f.y) * ai
|
|
13106
13135
|
},
|
|
13107
13136
|
out: null
|
|
13108
13137
|
});
|
|
13109
13138
|
}
|
|
13110
13139
|
return r;
|
|
13111
13140
|
}
|
|
13112
|
-
function
|
|
13141
|
+
function ci(e, t, n, r, i, a) {
|
|
13113
13142
|
let o = ((a - i) % 360 + 360) % 360;
|
|
13114
13143
|
o === 0 && (o = 360);
|
|
13115
13144
|
let s = i * Math.PI / 180, c = Math.max(1, Math.ceil(o / 90)), l = o / c * Math.PI / 180, u = 4 / 3 * Math.tan(l / 4), d = (i) => ({
|
|
@@ -13140,18 +13169,18 @@ function oi(e, t, n, r, i, a) {
|
|
|
13140
13169
|
}
|
|
13141
13170
|
return p;
|
|
13142
13171
|
}
|
|
13143
|
-
var
|
|
13172
|
+
var li = (e) => {
|
|
13144
13173
|
let t = e.arcStart ?? 0;
|
|
13145
13174
|
return (((e.arcEnd ?? 360) - t) % 360 + 360) % 360 != 0;
|
|
13146
13175
|
};
|
|
13147
|
-
function
|
|
13176
|
+
function ui(e) {
|
|
13148
13177
|
let t = Math.max(1, e.w ?? 0), n = Math.max(1, e.h ?? 0), r = e.strokeWidth ?? (e.kind === "line" ? 2 : 0), i = r > 0 ? r / 2 : 0;
|
|
13149
13178
|
switch (e.kind) {
|
|
13150
13179
|
case "rect": {
|
|
13151
13180
|
let r = i, a = i, o = t - i, s = n - i;
|
|
13152
13181
|
return {
|
|
13153
13182
|
closed: !0,
|
|
13154
|
-
nodes:
|
|
13183
|
+
nodes: si([
|
|
13155
13184
|
{
|
|
13156
13185
|
x: r,
|
|
13157
13186
|
y: a,
|
|
@@ -13176,16 +13205,16 @@ function ci(e) {
|
|
|
13176
13205
|
in: null,
|
|
13177
13206
|
out: null
|
|
13178
13207
|
}
|
|
13179
|
-
],
|
|
13208
|
+
], fi(e))
|
|
13180
13209
|
};
|
|
13181
13210
|
}
|
|
13182
13211
|
case "ellipse": {
|
|
13183
13212
|
let r = t / 2, a = n / 2, o = Math.max(0, t / 2 - i), s = Math.max(0, n / 2 - i);
|
|
13184
|
-
if (
|
|
13213
|
+
if (li(e)) return {
|
|
13185
13214
|
closed: !0,
|
|
13186
|
-
nodes:
|
|
13215
|
+
nodes: ci(r, a, o, s, e.arcStart ?? 0, e.arcEnd ?? 360)
|
|
13187
13216
|
};
|
|
13188
|
-
let c = o *
|
|
13217
|
+
let c = o * ai, l = s * ai;
|
|
13189
13218
|
return {
|
|
13190
13219
|
closed: !0,
|
|
13191
13220
|
nodes: [
|
|
@@ -13242,15 +13271,15 @@ function ci(e) {
|
|
|
13242
13271
|
}
|
|
13243
13272
|
case "triangle": return {
|
|
13244
13273
|
closed: !0,
|
|
13245
|
-
nodes:
|
|
13274
|
+
nodes: si(oi(ii(t, n, i, e.apex ?? .5)), e.radius ?? 0)
|
|
13246
13275
|
};
|
|
13247
13276
|
case "polygon": return {
|
|
13248
13277
|
closed: !0,
|
|
13249
|
-
nodes:
|
|
13278
|
+
nodes: si(oi(ni(t, n, e.sides ?? 5, i)), e.radius ?? 0)
|
|
13250
13279
|
};
|
|
13251
13280
|
case "star": return {
|
|
13252
13281
|
closed: !0,
|
|
13253
|
-
nodes:
|
|
13282
|
+
nodes: si(oi(ri(t, n, e.points ?? 5, e.innerRatio ?? .5, i)), e.radius ?? 0)
|
|
13254
13283
|
};
|
|
13255
13284
|
case "line": return {
|
|
13256
13285
|
closed: !1,
|
|
@@ -13279,15 +13308,15 @@ function ci(e) {
|
|
|
13279
13308
|
default: return null;
|
|
13280
13309
|
}
|
|
13281
13310
|
}
|
|
13282
|
-
function
|
|
13283
|
-
let t =
|
|
13284
|
-
return t ? T(
|
|
13311
|
+
function di(e) {
|
|
13312
|
+
let t = ui(e);
|
|
13313
|
+
return t ? T(ti(e, t.nodes, t.closed), t.closed) : "";
|
|
13285
13314
|
}
|
|
13286
|
-
var
|
|
13315
|
+
var fi = (e) => Array.isArray(e.radii) ? e.radii : e.radius ?? 0, pi = (e) => !!(e.distressOn || e.zigzagOn || e.offsetOn || e.smoothOn || e.puckerOn || e.twistOn || e.warpOn) || e.kind === "ellipse" && li(e) || e.kind === "rect" && Array.isArray(e.radii), mi = /* @__PURE__ */ t(((e, t) => {
|
|
13287
13316
|
t.exports = {};
|
|
13288
|
-
})),
|
|
13317
|
+
})), hi = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
13289
13318
|
(function(e, n) {
|
|
13290
|
-
e ||=
|
|
13319
|
+
e ||= mi();
|
|
13291
13320
|
var r = e.window, i = e.document, a = new function() {
|
|
13292
13321
|
var e = /^(statics|enumerable|beans|preserve)$/, t = [], r = t.slice, i = Object.create, a = Object.getOwnPropertyDescriptor, o = Object.defineProperty, s = t.forEach || function(e, t) {
|
|
13293
13322
|
for (var n = 0, r = this.length; n < r; n++) e.call(t, this[n], n, this);
|
|
@@ -21605,57 +21634,57 @@ var ui = (e) => Array.isArray(e.radii) ? e.radii : e.radius ?? 0, di = (e) => !!
|
|
|
21605
21634
|
Symbol: O,
|
|
21606
21635
|
PlacedSymbol: D
|
|
21607
21636
|
}))();
|
|
21608
|
-
return q.agent.node &&
|
|
21637
|
+
return q.agent.node && mi()(q), typeof define == "function" && define.amd ? define("paper", q) : typeof t == "object" && t && (t.exports = q), q;
|
|
21609
21638
|
}).call(e, typeof self == "object" ? self : null);
|
|
21610
|
-
})))(), 1),
|
|
21639
|
+
})))(), 1), gi = new Set([
|
|
21611
21640
|
"rect",
|
|
21612
21641
|
"ellipse",
|
|
21613
21642
|
"triangle",
|
|
21614
21643
|
"polygon",
|
|
21615
21644
|
"star"
|
|
21616
21645
|
]);
|
|
21617
|
-
function
|
|
21618
|
-
return e ? e.type === "path" ? !!e.closed && (e.nodes?.length ?? 0) >= 3 : e.type === "shape" ?
|
|
21646
|
+
function _i(e) {
|
|
21647
|
+
return e ? e.type === "path" ? !!e.closed && (e.nodes?.length ?? 0) >= 3 : e.type === "shape" ? gi.has(e.kind) : e.type === "bool" ? (e.children?.length ?? 0) >= 1 : !1 : !1;
|
|
21619
21648
|
}
|
|
21620
|
-
function
|
|
21621
|
-
return !!e && !e.locked &&
|
|
21649
|
+
function vi(e) {
|
|
21650
|
+
return !!e && !e.locked && _i(e);
|
|
21622
21651
|
}
|
|
21623
|
-
var
|
|
21624
|
-
function
|
|
21625
|
-
|
|
21652
|
+
var yi = !1;
|
|
21653
|
+
function bi() {
|
|
21654
|
+
yi ||= (hi.default.setup(new hi.default.Size(1, 1)), !0);
|
|
21626
21655
|
}
|
|
21627
|
-
function
|
|
21656
|
+
function xi(e) {
|
|
21628
21657
|
let t = null;
|
|
21629
21658
|
if (e.type === "path") {
|
|
21630
21659
|
let n = [e.nodes, ...e.holes ?? []].map((t) => T(t.map((t) => O(t, e.x, e.y)), !0)).join(" ");
|
|
21631
|
-
t =
|
|
21660
|
+
t = hi.default.PathItem.create(n), t.fillRule = "evenodd";
|
|
21632
21661
|
} else if (e.type === "bool") {
|
|
21633
|
-
let n =
|
|
21662
|
+
let n = Ei(e.children, e.op);
|
|
21634
21663
|
if (!n) return null;
|
|
21635
21664
|
let r = [n.nodes, ...n.holes ?? []].map((t) => T(t.map((t) => O(t, e.x, e.y)), !0)).join(" ");
|
|
21636
|
-
t =
|
|
21665
|
+
t = hi.default.PathItem.create(r), t.fillRule = "evenodd";
|
|
21637
21666
|
} else if (e.type === "shape") {
|
|
21638
21667
|
let { x: n, y: r, w: i, h: a } = e;
|
|
21639
21668
|
switch (e.kind) {
|
|
21640
21669
|
case "rect":
|
|
21641
|
-
if (
|
|
21642
|
-
t =
|
|
21670
|
+
if (pi(e)) {
|
|
21671
|
+
t = hi.default.PathItem.create(di({
|
|
21643
21672
|
...e,
|
|
21644
21673
|
strokeWidth: 0
|
|
21645
|
-
})), t.translate(new
|
|
21674
|
+
})), t.translate(new hi.default.Point(n, r));
|
|
21646
21675
|
break;
|
|
21647
21676
|
}
|
|
21648
|
-
t = new
|
|
21677
|
+
t = new hi.default.Path.Rectangle({
|
|
21649
21678
|
point: [n, r],
|
|
21650
21679
|
size: [i, a],
|
|
21651
21680
|
radius: e.radius > 0 ? e.radius : 0
|
|
21652
21681
|
});
|
|
21653
21682
|
break;
|
|
21654
21683
|
case "ellipse":
|
|
21655
|
-
|
|
21684
|
+
pi(e) ? (t = hi.default.PathItem.create(di({
|
|
21656
21685
|
...e,
|
|
21657
21686
|
strokeWidth: 0
|
|
21658
|
-
})), t.translate(new
|
|
21687
|
+
})), t.translate(new hi.default.Point(n, r))) : t = new hi.default.Path.Ellipse({
|
|
21659
21688
|
point: [n, r],
|
|
21660
21689
|
size: [i, a]
|
|
21661
21690
|
});
|
|
@@ -21663,19 +21692,19 @@ function yi(e) {
|
|
|
21663
21692
|
case "triangle":
|
|
21664
21693
|
case "polygon":
|
|
21665
21694
|
case "star":
|
|
21666
|
-
t =
|
|
21695
|
+
t = hi.default.PathItem.create(di({
|
|
21667
21696
|
...e,
|
|
21668
21697
|
strokeWidth: 0
|
|
21669
|
-
})), t.translate(new
|
|
21698
|
+
})), t.translate(new hi.default.Point(n, r));
|
|
21670
21699
|
break;
|
|
21671
21700
|
default: return null;
|
|
21672
21701
|
}
|
|
21673
21702
|
}
|
|
21674
21703
|
if (!t) return null;
|
|
21675
|
-
let n = new
|
|
21704
|
+
let n = new hi.default.Point(e.x + e.w / 2, e.y + e.h / 2);
|
|
21676
21705
|
return (e.flipX || e.flipY) && t.scale(e.flipX ? -1 : 1, e.flipY ? -1 : 1, n), e.rotation && t.rotate(e.rotation, n), t;
|
|
21677
21706
|
}
|
|
21678
|
-
function
|
|
21707
|
+
function Si(e) {
|
|
21679
21708
|
return e.segments.map((e) => ({
|
|
21680
21709
|
x: e.point.x,
|
|
21681
21710
|
y: e.point.y,
|
|
@@ -21689,14 +21718,14 @@ function bi(e) {
|
|
|
21689
21718
|
}
|
|
21690
21719
|
}));
|
|
21691
21720
|
}
|
|
21692
|
-
function
|
|
21721
|
+
function Ci(e) {
|
|
21693
21722
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
21694
21723
|
for (let a of e) a.x < t && (t = a.x), a.y < n && (n = a.y), a.x > r && (r = a.x), a.y > i && (i = a.y);
|
|
21695
21724
|
return (r - t) * (i - n);
|
|
21696
21725
|
}
|
|
21697
|
-
function
|
|
21698
|
-
|
|
21699
|
-
let n = e.map(
|
|
21726
|
+
function wi(e, t) {
|
|
21727
|
+
bi();
|
|
21728
|
+
let n = e.map(xi);
|
|
21700
21729
|
try {
|
|
21701
21730
|
if (n.length < 1 || n.some((e) => !e)) return null;
|
|
21702
21731
|
let e = n[0];
|
|
@@ -21706,8 +21735,8 @@ function Si(e, t) {
|
|
|
21706
21735
|
}
|
|
21707
21736
|
let r = (e.className === "CompoundPath" ? e.children : [e]).filter((e) => e.segments && e.segments.length >= 2);
|
|
21708
21737
|
if (e.remove(), r.length === 0) return null;
|
|
21709
|
-
let i = r.map(
|
|
21710
|
-
return i.sort((e, t) =>
|
|
21738
|
+
let i = r.map(Si);
|
|
21739
|
+
return i.sort((e, t) => Ci(t) - Ci(e)), {
|
|
21711
21740
|
nodes: i[0],
|
|
21712
21741
|
holes: i.length > 1 ? i.slice(1) : null
|
|
21713
21742
|
};
|
|
@@ -21715,7 +21744,7 @@ function Si(e, t) {
|
|
|
21715
21744
|
n.forEach((e) => e?.remove());
|
|
21716
21745
|
}
|
|
21717
21746
|
}
|
|
21718
|
-
function
|
|
21747
|
+
function Ti(e) {
|
|
21719
21748
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
21720
21749
|
for (let a of e) for (let e of a) e.x < t && (t = e.x), e.y < n && (n = e.y), e.x > r && (r = e.x), e.y > i && (i = e.y);
|
|
21721
21750
|
return Number.isFinite(t) ? {
|
|
@@ -21730,31 +21759,31 @@ function Ci(e) {
|
|
|
21730
21759
|
h: 1
|
|
21731
21760
|
};
|
|
21732
21761
|
}
|
|
21733
|
-
function
|
|
21734
|
-
let n = (e ?? []).filter((e) => e.visible !== !1 &&
|
|
21762
|
+
function Ei(e, t) {
|
|
21763
|
+
let n = (e ?? []).filter((e) => e.visible !== !1 && _i(e));
|
|
21735
21764
|
if (n.length === 0) return null;
|
|
21736
|
-
let r =
|
|
21765
|
+
let r = wi(n, t);
|
|
21737
21766
|
return !r || (r.nodes?.length ?? 0) < 2 ? null : {
|
|
21738
21767
|
...r,
|
|
21739
|
-
bounds:
|
|
21768
|
+
bounds: Ti([r.nodes, ...r.holes ?? []])
|
|
21740
21769
|
};
|
|
21741
21770
|
}
|
|
21742
|
-
var
|
|
21743
|
-
function
|
|
21744
|
-
let t = e.children ?? [], n =
|
|
21771
|
+
var Di = /* @__PURE__ */ new WeakMap();
|
|
21772
|
+
function Oi(e) {
|
|
21773
|
+
let t = e.children ?? [], n = Di.get(t);
|
|
21745
21774
|
if (n && n.op === e.op) return n.result;
|
|
21746
|
-
let r =
|
|
21747
|
-
return
|
|
21775
|
+
let r = Ei(t, e.op);
|
|
21776
|
+
return Di.set(t, {
|
|
21748
21777
|
op: e.op,
|
|
21749
21778
|
result: r
|
|
21750
21779
|
}), r;
|
|
21751
21780
|
}
|
|
21752
|
-
var
|
|
21753
|
-
function
|
|
21754
|
-
let t =
|
|
21781
|
+
var ki = .01;
|
|
21782
|
+
function Ai(e) {
|
|
21783
|
+
let t = Oi(e);
|
|
21755
21784
|
if (!t) return e;
|
|
21756
21785
|
let { x: n, y: r, w: i, h: a } = t.bounds;
|
|
21757
|
-
if (Math.abs(n) <
|
|
21786
|
+
if (Math.abs(n) < ki && Math.abs(r) < ki) return Math.abs((e.w ?? 0) - i) < ki && Math.abs((e.h ?? 0) - a) < ki ? e : {
|
|
21758
21787
|
...e,
|
|
21759
21788
|
w: i,
|
|
21760
21789
|
h: a
|
|
@@ -21764,7 +21793,7 @@ function Oi(e) {
|
|
|
21764
21793
|
x: (e.x ?? 0) - n,
|
|
21765
21794
|
y: (e.y ?? 0) - r
|
|
21766
21795
|
}));
|
|
21767
|
-
return
|
|
21796
|
+
return Di.set(o, {
|
|
21768
21797
|
op: e.op,
|
|
21769
21798
|
result: {
|
|
21770
21799
|
nodes: t.nodes.map((e) => O(e, -n, -r)),
|
|
@@ -21785,7 +21814,7 @@ function Oi(e) {
|
|
|
21785
21814
|
children: o
|
|
21786
21815
|
};
|
|
21787
21816
|
}
|
|
21788
|
-
function
|
|
21817
|
+
function ji(e, t, n) {
|
|
21789
21818
|
return (e ?? []).map((e) => {
|
|
21790
21819
|
let r = {
|
|
21791
21820
|
...e,
|
|
@@ -21794,43 +21823,43 @@ function ki(e, t, n) {
|
|
|
21794
21823
|
w: (e.w ?? 0) * t,
|
|
21795
21824
|
h: (e.h ?? 0) * n
|
|
21796
21825
|
};
|
|
21797
|
-
return e.type === "path" && Array.isArray(e.nodes) && (r.nodes = D(e.nodes, t, n), e.holes?.length && (r.holes = e.holes.map((e) => D(e, t, n)))), e.type === "bool" && Array.isArray(e.children) && (r.children =
|
|
21826
|
+
return e.type === "path" && Array.isArray(e.nodes) && (r.nodes = D(e.nodes, t, n), e.holes?.length && (r.holes = e.holes.map((e) => D(e, t, n)))), e.type === "bool" && Array.isArray(e.children) && (r.children = ji(e.children, t, n)), r;
|
|
21798
21827
|
});
|
|
21799
21828
|
}
|
|
21800
21829
|
//#endregion
|
|
21801
21830
|
//#region src/editor/params/schema.js
|
|
21802
|
-
function
|
|
21831
|
+
function Mi(e) {
|
|
21803
21832
|
let t = {};
|
|
21804
21833
|
for (let n of e) t[n.key] = n.default;
|
|
21805
21834
|
return t;
|
|
21806
21835
|
}
|
|
21807
|
-
function
|
|
21836
|
+
function Ni(e, t) {
|
|
21808
21837
|
return e.filter((e) => !e.when || e.when(t));
|
|
21809
21838
|
}
|
|
21810
|
-
var
|
|
21811
|
-
function
|
|
21812
|
-
return e.animatable ??
|
|
21839
|
+
var Pi = new Set(["range", "color"]);
|
|
21840
|
+
function Fi(e) {
|
|
21841
|
+
return e.animatable ?? Pi.has(e.type);
|
|
21813
21842
|
}
|
|
21814
|
-
function
|
|
21843
|
+
function Ii(e) {
|
|
21815
21844
|
return e.tab === "anim" || e.tab === "generate" ? e.tab : "style";
|
|
21816
21845
|
}
|
|
21817
|
-
function
|
|
21846
|
+
function Li(e) {
|
|
21818
21847
|
return e.section ?? (e.tab === "color" ? "Color" : null);
|
|
21819
21848
|
}
|
|
21820
21849
|
//#endregion
|
|
21821
21850
|
//#region src/editor/compose/filterChain.js
|
|
21822
|
-
var
|
|
21823
|
-
function
|
|
21824
|
-
let t =
|
|
21851
|
+
var Ri = (e) => H("effects")?.filterById(e) ?? null, zi = (...e) => H("effects").makeSweep(...e), Bi = () => `st-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
21852
|
+
function Vi(e) {
|
|
21853
|
+
let t = Ri(e), n = t ? Mi(t.params) : {};
|
|
21825
21854
|
return t?.sweeps && (n.sweeps = []), {
|
|
21826
21855
|
id: e,
|
|
21827
|
-
key:
|
|
21856
|
+
key: Bi(),
|
|
21828
21857
|
enabled: !0,
|
|
21829
21858
|
params: n
|
|
21830
21859
|
};
|
|
21831
21860
|
}
|
|
21832
|
-
function
|
|
21833
|
-
return !e.animate || !H("effects") ? [] : [
|
|
21861
|
+
function Hi(e) {
|
|
21862
|
+
return !e.animate || !H("effects") ? [] : [zi(e.sweepShape ?? "linear", {
|
|
21834
21863
|
target: e.sweepTarget ?? "brightness",
|
|
21835
21864
|
amount: e.sweepAmount ?? .6,
|
|
21836
21865
|
speed: e.sweepSpeed ?? 1,
|
|
@@ -21838,11 +21867,11 @@ function Bi(e) {
|
|
|
21838
21867
|
angle: e.sweepAngle ?? 0
|
|
21839
21868
|
})];
|
|
21840
21869
|
}
|
|
21841
|
-
function
|
|
21842
|
-
let t =
|
|
21870
|
+
function Ui(e) {
|
|
21871
|
+
let t = Ri(e.filterId), n = {};
|
|
21843
21872
|
if (t) {
|
|
21844
21873
|
for (let r of t.params) n[r.key] = e[r.key] === void 0 ? r.default : e[r.key];
|
|
21845
|
-
t.sweeps && (n.sweeps =
|
|
21874
|
+
t.sweeps && (n.sweeps = Hi(e));
|
|
21846
21875
|
}
|
|
21847
21876
|
return {
|
|
21848
21877
|
id: e.filterId,
|
|
@@ -21851,20 +21880,20 @@ function Vi(e) {
|
|
|
21851
21880
|
params: n
|
|
21852
21881
|
};
|
|
21853
21882
|
}
|
|
21854
|
-
function
|
|
21883
|
+
function Wi(e) {
|
|
21855
21884
|
return !e || typeof e != "object" || !e.id ? null : typeof e.key == "string" && e.enabled !== void 0 && e.params && typeof e.params == "object" ? e : {
|
|
21856
21885
|
id: e.id,
|
|
21857
|
-
key: typeof e.key == "string" ? e.key :
|
|
21886
|
+
key: typeof e.key == "string" ? e.key : Bi(),
|
|
21858
21887
|
enabled: e.enabled !== !1,
|
|
21859
|
-
params: e.params && typeof e.params == "object" ? e.params :
|
|
21888
|
+
params: e.params && typeof e.params == "object" ? e.params : Mi(Ri(e.id)?.params ?? [])
|
|
21860
21889
|
};
|
|
21861
21890
|
}
|
|
21862
|
-
function
|
|
21891
|
+
function Gi(e) {
|
|
21863
21892
|
if (!e || typeof e != "object") return e;
|
|
21864
21893
|
if (Array.isArray(e.filters)) {
|
|
21865
21894
|
let t = !1, n = [];
|
|
21866
21895
|
for (let r of e.filters) {
|
|
21867
|
-
let e =
|
|
21896
|
+
let e = Wi(r);
|
|
21868
21897
|
if (e === null) {
|
|
21869
21898
|
t = !0;
|
|
21870
21899
|
continue;
|
|
@@ -21881,18 +21910,18 @@ function Ui(e) {
|
|
|
21881
21910
|
if (e.filterId) {
|
|
21882
21911
|
let t = {
|
|
21883
21912
|
...e,
|
|
21884
|
-
filters: [
|
|
21913
|
+
filters: [Ui(e)]
|
|
21885
21914
|
};
|
|
21886
21915
|
return delete t.filterId, t;
|
|
21887
21916
|
}
|
|
21888
21917
|
return e;
|
|
21889
21918
|
}
|
|
21890
|
-
function
|
|
21919
|
+
function Ki(e) {
|
|
21891
21920
|
if (!Array.isArray(e)) return e;
|
|
21892
21921
|
let t = !1, n = e.map((e) => {
|
|
21893
|
-
let n =
|
|
21922
|
+
let n = Gi(e);
|
|
21894
21923
|
if (Array.isArray(n.children)) {
|
|
21895
|
-
let e =
|
|
21924
|
+
let e = Ki(n.children);
|
|
21896
21925
|
e !== n.children && (n = {
|
|
21897
21926
|
...n,
|
|
21898
21927
|
children: e
|
|
@@ -21902,52 +21931,52 @@ function Wi(e) {
|
|
|
21902
21931
|
});
|
|
21903
21932
|
return t ? n : e;
|
|
21904
21933
|
}
|
|
21905
|
-
function
|
|
21906
|
-
let t =
|
|
21934
|
+
function qi(e) {
|
|
21935
|
+
let t = Gi(e);
|
|
21907
21936
|
return Array.isArray(t.filters) ? t.filters : [];
|
|
21908
21937
|
}
|
|
21909
|
-
function
|
|
21910
|
-
return
|
|
21938
|
+
function Ji(e) {
|
|
21939
|
+
return qi(e).map((e) => ({
|
|
21911
21940
|
...e,
|
|
21912
|
-
def:
|
|
21941
|
+
def: Ri(e.id)
|
|
21913
21942
|
}));
|
|
21914
21943
|
}
|
|
21915
|
-
function
|
|
21916
|
-
return
|
|
21944
|
+
function Yi(e) {
|
|
21945
|
+
return Ji(e).filter((e) => e.enabled && e.def && e.def.kind !== "engine" && e.def.kind !== "pixi");
|
|
21917
21946
|
}
|
|
21918
|
-
function
|
|
21919
|
-
return
|
|
21947
|
+
function Xi(e) {
|
|
21948
|
+
return Ji(e).filter((e) => e.enabled && e.def?.kind === "pixi");
|
|
21920
21949
|
}
|
|
21921
|
-
function
|
|
21922
|
-
let t =
|
|
21950
|
+
function Zi(e) {
|
|
21951
|
+
let t = Ji(e).filter((e) => e.enabled && e.def?.kind === "engine");
|
|
21923
21952
|
return t.length ? t[t.length - 1] : null;
|
|
21924
21953
|
}
|
|
21925
|
-
function
|
|
21954
|
+
function Qi(e) {
|
|
21926
21955
|
return Array.isArray(e?.filters) ? e.filters.some((e) => e && e.enabled !== !1 && e.id) : !!e?.filterId;
|
|
21927
21956
|
}
|
|
21928
21957
|
//#endregion
|
|
21929
21958
|
//#region src/generate/geom.js
|
|
21930
|
-
var
|
|
21931
|
-
function
|
|
21959
|
+
var $i = (e) => Math.round(e * 100) / 100;
|
|
21960
|
+
function ea() {
|
|
21932
21961
|
return {
|
|
21933
21962
|
polys: [],
|
|
21934
21963
|
circles: [],
|
|
21935
21964
|
compounds: []
|
|
21936
21965
|
};
|
|
21937
21966
|
}
|
|
21938
|
-
var
|
|
21967
|
+
var ta = (e) => {
|
|
21939
21968
|
let t = 0;
|
|
21940
21969
|
for (let n = 0, r = e.length - 1; n < e.length; r = n++) t += (e[r][0] - e[n][0]) * (e[r][1] + e[n][1]);
|
|
21941
21970
|
return t / 2;
|
|
21942
21971
|
};
|
|
21943
|
-
function
|
|
21972
|
+
function na(e, t) {
|
|
21944
21973
|
let n = t.filter((e) => e.length >= 3);
|
|
21945
21974
|
if (!n.length) return;
|
|
21946
|
-
n.sort((e, t) => Math.abs(
|
|
21947
|
-
let r = n.map((e, t) =>
|
|
21975
|
+
n.sort((e, t) => Math.abs(ta(t)) - Math.abs(ta(e)));
|
|
21976
|
+
let r = n.map((e, t) => ta(e) > 0 == (t === 0) ? e : [...e].reverse());
|
|
21948
21977
|
e.compounds.push(r);
|
|
21949
21978
|
}
|
|
21950
|
-
function
|
|
21979
|
+
function ra(e, t, n, r, i) {
|
|
21951
21980
|
r <= 0 || i <= 0 || e.polys.push([
|
|
21952
21981
|
[t, n],
|
|
21953
21982
|
[t + r, n],
|
|
@@ -21955,7 +21984,7 @@ function ta(e, t, n, r, i) {
|
|
|
21955
21984
|
[t, n + i]
|
|
21956
21985
|
]);
|
|
21957
21986
|
}
|
|
21958
|
-
function
|
|
21987
|
+
function ia(e, t, n, r, i, a) {
|
|
21959
21988
|
if (r <= 0 || i <= 0) return;
|
|
21960
21989
|
let o = Math.cos(a), s = Math.sin(a), c = r / 2, l = i / 2;
|
|
21961
21990
|
e.polys.push([
|
|
@@ -21965,7 +21994,7 @@ function na(e, t, n, r, i, a) {
|
|
|
21965
21994
|
[-c, l]
|
|
21966
21995
|
].map(([e, r]) => [t + e * o - r * s, n + e * s + r * o]));
|
|
21967
21996
|
}
|
|
21968
|
-
function
|
|
21997
|
+
function aa(e, t, n, r, i) {
|
|
21969
21998
|
r > .05 && e.circles.push(i != null && i !== r ? [
|
|
21970
21999
|
t,
|
|
21971
22000
|
n,
|
|
@@ -21977,10 +22006,10 @@ function ra(e, t, n, r, i) {
|
|
|
21977
22006
|
r
|
|
21978
22007
|
]);
|
|
21979
22008
|
}
|
|
21980
|
-
function
|
|
22009
|
+
function oa(e, t) {
|
|
21981
22010
|
t.length >= 3 && e.polys.push(t);
|
|
21982
22011
|
}
|
|
21983
|
-
function
|
|
22012
|
+
function sa(e, t) {
|
|
21984
22013
|
let n = [
|
|
21985
22014
|
(e) => e[0] >= t.x,
|
|
21986
22015
|
(e) => e[0] <= t.x + t.w,
|
|
@@ -22014,30 +22043,30 @@ function aa(e, t) {
|
|
|
22014
22043
|
}
|
|
22015
22044
|
return i;
|
|
22016
22045
|
}
|
|
22017
|
-
function
|
|
22046
|
+
function ca(e) {
|
|
22018
22047
|
return e.polys.length + e.circles.length + (e.compounds?.length ?? 0);
|
|
22019
22048
|
}
|
|
22020
|
-
function
|
|
22049
|
+
function la(e) {
|
|
22021
22050
|
let t = "";
|
|
22022
22051
|
for (let n of e.polys) {
|
|
22023
|
-
t += `M${
|
|
22024
|
-
for (let e = 1; e < n.length; e++) t += `L${
|
|
22052
|
+
t += `M${$i(n[0][0])} ${$i(n[0][1])}`;
|
|
22053
|
+
for (let e = 1; e < n.length; e++) t += `L${$i(n[e][0])} ${$i(n[e][1])}`;
|
|
22025
22054
|
t += "Z";
|
|
22026
22055
|
}
|
|
22027
22056
|
for (let n of e.compounds ?? []) for (let e of n) {
|
|
22028
|
-
t += `M${
|
|
22029
|
-
for (let n = 1; n < e.length; n++) t += `L${
|
|
22057
|
+
t += `M${$i(e[0][0])} ${$i(e[0][1])}`;
|
|
22058
|
+
for (let n = 1; n < e.length; n++) t += `L${$i(e[n][0])} ${$i(e[n][1])}`;
|
|
22030
22059
|
t += "Z";
|
|
22031
22060
|
}
|
|
22032
22061
|
for (let [n, r, i, a = i] of e.circles) {
|
|
22033
|
-
let e =
|
|
22034
|
-
t += `M${
|
|
22062
|
+
let e = $i(i), o = $i(a);
|
|
22063
|
+
t += `M${$i(n - i)} ${$i(r)}a${e} ${o} 0 1 0 ${$i(2 * i)} 0a${e} ${o} 0 1 0 ${$i(-2 * i)} 0Z`;
|
|
22035
22064
|
}
|
|
22036
22065
|
return t;
|
|
22037
22066
|
}
|
|
22038
|
-
var
|
|
22039
|
-
function
|
|
22040
|
-
let i = n *
|
|
22067
|
+
var ua = .5523;
|
|
22068
|
+
function da(e, t, n, r = n) {
|
|
22069
|
+
let i = n * ua, a = r * ua;
|
|
22041
22070
|
return [
|
|
22042
22071
|
{
|
|
22043
22072
|
x: e + n,
|
|
@@ -22089,45 +22118,45 @@ function la(e, t, n, r = n) {
|
|
|
22089
22118
|
}
|
|
22090
22119
|
];
|
|
22091
22120
|
}
|
|
22092
|
-
var
|
|
22121
|
+
var fa = (e) => e.map(([e, t]) => ({
|
|
22093
22122
|
x: e,
|
|
22094
22123
|
y: t,
|
|
22095
22124
|
in: null,
|
|
22096
22125
|
out: null
|
|
22097
22126
|
}));
|
|
22098
|
-
function
|
|
22127
|
+
function pa(e) {
|
|
22099
22128
|
return [
|
|
22100
22129
|
...e.polys.map((e) => ({
|
|
22101
|
-
nodes:
|
|
22130
|
+
nodes: fa(e),
|
|
22102
22131
|
holes: null
|
|
22103
22132
|
})),
|
|
22104
22133
|
...(e.compounds ?? []).map(([e, ...t]) => ({
|
|
22105
|
-
nodes:
|
|
22106
|
-
holes: t.length ? t.map(
|
|
22134
|
+
nodes: fa(e),
|
|
22135
|
+
holes: t.length ? t.map(fa) : null
|
|
22107
22136
|
})),
|
|
22108
22137
|
...e.circles.map(([e, t, n, r]) => ({
|
|
22109
|
-
nodes:
|
|
22138
|
+
nodes: da(e, t, n, r),
|
|
22110
22139
|
holes: null
|
|
22111
22140
|
}))
|
|
22112
22141
|
];
|
|
22113
22142
|
}
|
|
22114
22143
|
//#endregion
|
|
22115
22144
|
//#region src/generate/repeat.js
|
|
22116
|
-
var
|
|
22145
|
+
var ma = (e, t) => [
|
|
22117
22146
|
e[0] * t[0] + e[2] * t[1],
|
|
22118
22147
|
e[1] * t[0] + e[3] * t[1],
|
|
22119
22148
|
e[0] * t[2] + e[2] * t[3],
|
|
22120
22149
|
e[1] * t[2] + e[3] * t[3],
|
|
22121
22150
|
e[0] * t[4] + e[2] * t[5] + e[4],
|
|
22122
22151
|
e[1] * t[4] + e[3] * t[5] + e[5]
|
|
22123
|
-
],
|
|
22152
|
+
], ha = (e, t) => [
|
|
22124
22153
|
1,
|
|
22125
22154
|
0,
|
|
22126
22155
|
0,
|
|
22127
22156
|
1,
|
|
22128
22157
|
e,
|
|
22129
22158
|
t
|
|
22130
|
-
],
|
|
22159
|
+
], ga = (e) => {
|
|
22131
22160
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
22132
22161
|
return [
|
|
22133
22162
|
n,
|
|
@@ -22137,14 +22166,14 @@ var fa = (e, t) => [
|
|
|
22137
22166
|
0,
|
|
22138
22167
|
0
|
|
22139
22168
|
];
|
|
22140
|
-
},
|
|
22169
|
+
}, _a = (e, t = e) => [
|
|
22141
22170
|
e,
|
|
22142
22171
|
0,
|
|
22143
22172
|
0,
|
|
22144
22173
|
t,
|
|
22145
22174
|
0,
|
|
22146
22175
|
0
|
|
22147
|
-
],
|
|
22176
|
+
], va = (e, t, n) => ma(ha(e, t), ma(n, ha(-e, -t))), ya = (e, t, n) => [e[0] * t + e[2] * n + e[4], e[1] * t + e[3] * n + e[5]], ba = {
|
|
22148
22177
|
repMode: "radial",
|
|
22149
22178
|
repCount: 8,
|
|
22150
22179
|
repRadius: 200,
|
|
@@ -22164,28 +22193,28 @@ var fa = (e, t) => [
|
|
|
22164
22193
|
repPoint: !1,
|
|
22165
22194
|
repReverse: !1
|
|
22166
22195
|
};
|
|
22167
|
-
function
|
|
22196
|
+
function xa(e, t) {
|
|
22168
22197
|
let n = {
|
|
22169
|
-
...
|
|
22198
|
+
...ba,
|
|
22170
22199
|
...e
|
|
22171
|
-
}, r = t.x + t.w / 2, i = t.y + t.h / 2, a = (e) =>
|
|
22200
|
+
}, r = t.x + t.w / 2, i = t.y + t.h / 2, a = (e) => va(r, i, ma(ga((n.repRotate ?? 0) * e), _a((n.repScale ?? 1) ** e))), o = [];
|
|
22172
22201
|
if (n.repMode === "mirror") {
|
|
22173
22202
|
let e = r + (n.repAxisX ?? 0), t = i + (n.repAxisY ?? 0), a = n.repAxisAngle ?? 90;
|
|
22174
|
-
o.push(n.repPoint ?
|
|
22203
|
+
o.push(n.repPoint ? va(e, t, ga(180)) : va(e, t, ma(ga(a), ma(_a(1, -1), ga(-a)))));
|
|
22175
22204
|
} else if (n.repMode === "grid") {
|
|
22176
22205
|
let e = Math.max(1, Math.round(n.repCols)), r = Math.max(1, Math.round(n.repRows));
|
|
22177
22206
|
for (let i = 0; i < r; i++) for (let r = 0; r < e; r++) {
|
|
22178
22207
|
if (!r && !i) continue;
|
|
22179
22208
|
let s = i * e + r, c = r * (t.w + n.repGapX) + i * n.repRowShift, l = i * (t.h + n.repGapY) + r * n.repColShift;
|
|
22180
|
-
o.push(
|
|
22209
|
+
o.push(ma(ha(c, l), a(s)));
|
|
22181
22210
|
}
|
|
22182
22211
|
} else {
|
|
22183
22212
|
let e = Math.max(1, Math.round(n.repCount)), t = (n.repPivotAngle ?? 90) * Math.PI / 180, s = r + Math.cos(t) * n.repRadius, c = i + Math.sin(t) * n.repRadius, l = (n.repSpan ?? 360) >= 360 ? 360 / e : (n.repSpan ?? 360) / Math.max(1, e - 1);
|
|
22184
|
-
for (let t = 1; t < e; t++) o.push(
|
|
22213
|
+
for (let t = 1; t < e; t++) o.push(ma(va(s, c, ga(l * t)), a(t)));
|
|
22185
22214
|
}
|
|
22186
22215
|
return n.repReverse ? o.reverse() : o;
|
|
22187
22216
|
}
|
|
22188
|
-
function
|
|
22217
|
+
function Sa(e) {
|
|
22189
22218
|
let t = e[0] * e[3] - e[1] * e[2], n = Math.sqrt(Math.abs(t));
|
|
22190
22219
|
return {
|
|
22191
22220
|
rotation: Math.atan2(e[1], e[0]) * 180 / Math.PI,
|
|
@@ -22193,12 +22222,12 @@ function ba(e) {
|
|
|
22193
22222
|
mirror: t < 0
|
|
22194
22223
|
};
|
|
22195
22224
|
}
|
|
22196
|
-
var
|
|
22225
|
+
var Ca = (e) => (t) => (t.repMode ?? "radial") === e, wa = {
|
|
22197
22226
|
min: -180,
|
|
22198
22227
|
max: 180,
|
|
22199
22228
|
step: 1,
|
|
22200
22229
|
format: (e) => `${e}°`
|
|
22201
|
-
},
|
|
22230
|
+
}, Ta = [
|
|
22202
22231
|
{
|
|
22203
22232
|
key: "repCount",
|
|
22204
22233
|
label: "Count",
|
|
@@ -22207,7 +22236,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22207
22236
|
max: 64,
|
|
22208
22237
|
step: 1,
|
|
22209
22238
|
default: 8,
|
|
22210
|
-
when:
|
|
22239
|
+
when: Ca("radial")
|
|
22211
22240
|
},
|
|
22212
22241
|
{
|
|
22213
22242
|
key: "repRadius",
|
|
@@ -22218,15 +22247,15 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22218
22247
|
step: 1,
|
|
22219
22248
|
default: 200,
|
|
22220
22249
|
format: (e) => `${e}px`,
|
|
22221
|
-
when:
|
|
22250
|
+
when: Ca("radial")
|
|
22222
22251
|
},
|
|
22223
22252
|
{
|
|
22224
22253
|
key: "repPivotAngle",
|
|
22225
22254
|
label: "Pivot angle",
|
|
22226
22255
|
type: "range",
|
|
22227
|
-
...
|
|
22256
|
+
...wa,
|
|
22228
22257
|
default: 90,
|
|
22229
|
-
when:
|
|
22258
|
+
when: Ca("radial")
|
|
22230
22259
|
},
|
|
22231
22260
|
{
|
|
22232
22261
|
key: "repSpan",
|
|
@@ -22237,7 +22266,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22237
22266
|
step: 1,
|
|
22238
22267
|
default: 360,
|
|
22239
22268
|
format: (e) => `${e}°`,
|
|
22240
|
-
when:
|
|
22269
|
+
when: Ca("radial")
|
|
22241
22270
|
},
|
|
22242
22271
|
{
|
|
22243
22272
|
key: "repCols",
|
|
@@ -22247,7 +22276,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22247
22276
|
max: 40,
|
|
22248
22277
|
step: 1,
|
|
22249
22278
|
default: 3,
|
|
22250
|
-
when:
|
|
22279
|
+
when: Ca("grid")
|
|
22251
22280
|
},
|
|
22252
22281
|
{
|
|
22253
22282
|
key: "repRows",
|
|
@@ -22257,7 +22286,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22257
22286
|
max: 40,
|
|
22258
22287
|
step: 1,
|
|
22259
22288
|
default: 3,
|
|
22260
|
-
when:
|
|
22289
|
+
when: Ca("grid")
|
|
22261
22290
|
},
|
|
22262
22291
|
{
|
|
22263
22292
|
key: "repGapX",
|
|
@@ -22268,7 +22297,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22268
22297
|
step: 1,
|
|
22269
22298
|
default: 20,
|
|
22270
22299
|
format: (e) => `${e}px`,
|
|
22271
|
-
when:
|
|
22300
|
+
when: Ca("grid")
|
|
22272
22301
|
},
|
|
22273
22302
|
{
|
|
22274
22303
|
key: "repGapY",
|
|
@@ -22279,7 +22308,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22279
22308
|
step: 1,
|
|
22280
22309
|
default: 20,
|
|
22281
22310
|
format: (e) => `${e}px`,
|
|
22282
|
-
when:
|
|
22311
|
+
when: Ca("grid")
|
|
22283
22312
|
},
|
|
22284
22313
|
{
|
|
22285
22314
|
key: "repRowShift",
|
|
@@ -22290,7 +22319,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22290
22319
|
step: 1,
|
|
22291
22320
|
default: 0,
|
|
22292
22321
|
format: (e) => `${e}px`,
|
|
22293
|
-
when:
|
|
22322
|
+
when: Ca("grid")
|
|
22294
22323
|
},
|
|
22295
22324
|
{
|
|
22296
22325
|
key: "repColShift",
|
|
@@ -22301,15 +22330,15 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22301
22330
|
step: 1,
|
|
22302
22331
|
default: 0,
|
|
22303
22332
|
format: (e) => `${e}px`,
|
|
22304
|
-
when:
|
|
22333
|
+
when: Ca("grid")
|
|
22305
22334
|
},
|
|
22306
22335
|
{
|
|
22307
22336
|
key: "repRotate",
|
|
22308
22337
|
label: "Rotate per step",
|
|
22309
22338
|
type: "range",
|
|
22310
|
-
...
|
|
22339
|
+
...wa,
|
|
22311
22340
|
default: 0,
|
|
22312
|
-
when: (e) => !
|
|
22341
|
+
when: (e) => !Ca("mirror")(e)
|
|
22313
22342
|
},
|
|
22314
22343
|
{
|
|
22315
22344
|
key: "repScale",
|
|
@@ -22320,15 +22349,15 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22320
22349
|
step: .005,
|
|
22321
22350
|
default: 1,
|
|
22322
22351
|
format: (e) => `${Math.round(e * 100)}%`,
|
|
22323
|
-
when: (e) => !
|
|
22352
|
+
when: (e) => !Ca("mirror")(e)
|
|
22324
22353
|
},
|
|
22325
22354
|
{
|
|
22326
22355
|
key: "repAxisAngle",
|
|
22327
22356
|
label: "Axis angle",
|
|
22328
22357
|
type: "range",
|
|
22329
|
-
...
|
|
22358
|
+
...wa,
|
|
22330
22359
|
default: 90,
|
|
22331
|
-
when:
|
|
22360
|
+
when: Ca("mirror")
|
|
22332
22361
|
},
|
|
22333
22362
|
{
|
|
22334
22363
|
key: "repAxisX",
|
|
@@ -22339,7 +22368,7 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22339
22368
|
step: 1,
|
|
22340
22369
|
default: 0,
|
|
22341
22370
|
format: (e) => `${e}px`,
|
|
22342
|
-
when:
|
|
22371
|
+
when: Ca("mirror")
|
|
22343
22372
|
},
|
|
22344
22373
|
{
|
|
22345
22374
|
key: "repAxisY",
|
|
@@ -22350,14 +22379,14 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22350
22379
|
step: 1,
|
|
22351
22380
|
default: 0,
|
|
22352
22381
|
format: (e) => `${e}px`,
|
|
22353
|
-
when:
|
|
22382
|
+
when: Ca("mirror")
|
|
22354
22383
|
},
|
|
22355
22384
|
{
|
|
22356
22385
|
key: "repPoint",
|
|
22357
22386
|
label: "Point mirror",
|
|
22358
22387
|
type: "toggle",
|
|
22359
22388
|
default: !1,
|
|
22360
|
-
when:
|
|
22389
|
+
when: Ca("mirror")
|
|
22361
22390
|
},
|
|
22362
22391
|
{
|
|
22363
22392
|
key: "repReverse",
|
|
@@ -22365,39 +22394,39 @@ var xa = (e) => (t) => (t.repMode ?? "radial") === e, Sa = {
|
|
|
22365
22394
|
type: "toggle",
|
|
22366
22395
|
default: !1
|
|
22367
22396
|
}
|
|
22368
|
-
],
|
|
22397
|
+
], Ea = () => H("generators"), Da = () => H("motion"), Oa = (e) => H("effects")?.filterById(e) ?? null, ka = new Set([
|
|
22369
22398
|
"background",
|
|
22370
22399
|
"pattern",
|
|
22371
22400
|
"shape",
|
|
22372
22401
|
"text",
|
|
22373
22402
|
"path",
|
|
22374
22403
|
"bool"
|
|
22375
|
-
]),
|
|
22404
|
+
]), Aa = "kol.editor.draft", ja = new Set([
|
|
22376
22405
|
"mouseX",
|
|
22377
22406
|
"mouseY",
|
|
22378
22407
|
"layerX",
|
|
22379
22408
|
"layerY"
|
|
22380
|
-
]),
|
|
22381
|
-
for (let t in e) if (
|
|
22409
|
+
]), Ma = (e) => typeof e == "object" && !!e && e.bind === "mod" && ja.has(e.source), Na = (e) => e.some((e) => {
|
|
22410
|
+
for (let t in e) if (Ma(e[t])) return !0;
|
|
22382
22411
|
if (Array.isArray(e.filters)) for (let t of e.filters) {
|
|
22383
22412
|
let e = t?.params;
|
|
22384
22413
|
if (e) {
|
|
22385
|
-
for (let t in e) if (
|
|
22414
|
+
for (let t in e) if (Ma(e[t])) return !0;
|
|
22386
22415
|
}
|
|
22387
22416
|
}
|
|
22388
|
-
return Array.isArray(e.children) &&
|
|
22389
|
-
}),
|
|
22417
|
+
return Array.isArray(e.children) && Na(e.children);
|
|
22418
|
+
}), Pa = [
|
|
22390
22419
|
!1,
|
|
22391
22420
|
!1,
|
|
22392
22421
|
!1,
|
|
22393
22422
|
!1,
|
|
22394
22423
|
!1,
|
|
22395
22424
|
!1
|
|
22396
|
-
],
|
|
22397
|
-
let i =
|
|
22398
|
-
return
|
|
22399
|
-
},
|
|
22400
|
-
function
|
|
22425
|
+
], Fa = (e) => Sn.find((t) => t.id === e) ?? Sn[0], Ia = (e, t, n, r) => {
|
|
22426
|
+
let i = Fa(e), a = i.isSeed ? n[0] : void 0;
|
|
22427
|
+
return Nn(i.colors, t, n, r, a);
|
|
22428
|
+
}, La = (e) => `${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
22429
|
+
function Ra(e, t, n) {
|
|
22401
22430
|
let r = !1, i = e.map((e) => {
|
|
22402
22431
|
if (e.id === t) {
|
|
22403
22432
|
r = !0;
|
|
@@ -22405,29 +22434,29 @@ function Ia(e, t, n) {
|
|
|
22405
22434
|
...e,
|
|
22406
22435
|
...n
|
|
22407
22436
|
};
|
|
22408
|
-
return t.type === "bool" && ("op" in n || "children" in n) ?
|
|
22437
|
+
return t.type === "bool" && ("op" in n || "children" in n) ? Ai(t) : t;
|
|
22409
22438
|
}
|
|
22410
22439
|
if (Array.isArray(e.children)) {
|
|
22411
|
-
let i =
|
|
22440
|
+
let i = Ra(e.children, t, n);
|
|
22412
22441
|
if (i !== e.children) {
|
|
22413
22442
|
r = !0;
|
|
22414
22443
|
let t = {
|
|
22415
22444
|
...e,
|
|
22416
22445
|
children: i
|
|
22417
22446
|
};
|
|
22418
|
-
return e.type === "bool" ?
|
|
22447
|
+
return e.type === "bool" ? Ai(t) : t;
|
|
22419
22448
|
}
|
|
22420
22449
|
}
|
|
22421
22450
|
return e;
|
|
22422
22451
|
});
|
|
22423
22452
|
return r ? i : e;
|
|
22424
22453
|
}
|
|
22425
|
-
function
|
|
22454
|
+
function za(e, t = []) {
|
|
22426
22455
|
if (!e) return t;
|
|
22427
|
-
if ((e.srcType === "video" || e.srcType === "image") && t.push(e.id), Array.isArray(e.children)) for (let n of e.children)
|
|
22456
|
+
if ((e.srcType === "video" || e.srcType === "image") && t.push(e.id), Array.isArray(e.children)) for (let n of e.children) za(n, t);
|
|
22428
22457
|
return t;
|
|
22429
22458
|
}
|
|
22430
|
-
function
|
|
22459
|
+
function Ba(e, t) {
|
|
22431
22460
|
let n = !1, r = [];
|
|
22432
22461
|
for (let i of e) {
|
|
22433
22462
|
if (i.id === t) {
|
|
@@ -22435,14 +22464,14 @@ function Ra(e, t) {
|
|
|
22435
22464
|
continue;
|
|
22436
22465
|
}
|
|
22437
22466
|
if (Array.isArray(i.children)) {
|
|
22438
|
-
let e =
|
|
22467
|
+
let e = Ba(i.children, t);
|
|
22439
22468
|
if (e !== i.children) {
|
|
22440
22469
|
n = !0;
|
|
22441
22470
|
let t = {
|
|
22442
22471
|
...i,
|
|
22443
22472
|
children: e
|
|
22444
22473
|
};
|
|
22445
|
-
r.push(i.type === "bool" ?
|
|
22474
|
+
r.push(i.type === "bool" ? Ai(t) : t);
|
|
22446
22475
|
continue;
|
|
22447
22476
|
}
|
|
22448
22477
|
}
|
|
@@ -22450,7 +22479,7 @@ function Ra(e, t) {
|
|
|
22450
22479
|
}
|
|
22451
22480
|
return n ? r : e;
|
|
22452
22481
|
}
|
|
22453
|
-
function
|
|
22482
|
+
function Va(e, t, n, r) {
|
|
22454
22483
|
if (t == null) {
|
|
22455
22484
|
let t = [...e];
|
|
22456
22485
|
return t.splice(Math.max(0, Math.min(t.length, n)), 0, r), t;
|
|
@@ -22464,42 +22493,42 @@ function za(e, t, n, r) {
|
|
|
22464
22493
|
...e,
|
|
22465
22494
|
children: t
|
|
22466
22495
|
};
|
|
22467
|
-
return e.type === "bool" ?
|
|
22496
|
+
return e.type === "bool" ? Ai(a) : a;
|
|
22468
22497
|
}
|
|
22469
22498
|
if (Array.isArray(e.children)) {
|
|
22470
|
-
let a =
|
|
22499
|
+
let a = Va(e.children, t, n, r);
|
|
22471
22500
|
if (a !== e.children) {
|
|
22472
22501
|
i = !0;
|
|
22473
22502
|
let t = {
|
|
22474
22503
|
...e,
|
|
22475
22504
|
children: a
|
|
22476
22505
|
};
|
|
22477
|
-
return e.type === "bool" ?
|
|
22506
|
+
return e.type === "bool" ? Ai(t) : t;
|
|
22478
22507
|
}
|
|
22479
22508
|
}
|
|
22480
22509
|
return e;
|
|
22481
22510
|
});
|
|
22482
22511
|
return i ? a : e;
|
|
22483
22512
|
}
|
|
22484
|
-
function
|
|
22513
|
+
function Ha(e, t, n) {
|
|
22485
22514
|
let r = !1, i = e.map((e) => {
|
|
22486
22515
|
if (e.id === t) return r = !0, n;
|
|
22487
22516
|
if (Array.isArray(e.children)) {
|
|
22488
|
-
let i =
|
|
22517
|
+
let i = Ha(e.children, t, n);
|
|
22489
22518
|
if (i !== e.children) {
|
|
22490
22519
|
r = !0;
|
|
22491
22520
|
let t = {
|
|
22492
22521
|
...e,
|
|
22493
22522
|
children: i
|
|
22494
22523
|
};
|
|
22495
|
-
return e.type === "bool" ?
|
|
22524
|
+
return e.type === "bool" ? Ai(t) : t;
|
|
22496
22525
|
}
|
|
22497
22526
|
}
|
|
22498
22527
|
return e;
|
|
22499
22528
|
});
|
|
22500
22529
|
return r ? i : e;
|
|
22501
22530
|
}
|
|
22502
|
-
function
|
|
22531
|
+
function Ua(e, t, n = 0, r = 0, i = null) {
|
|
22503
22532
|
for (let a = 0; a < e.length; a++) {
|
|
22504
22533
|
let o = e[a];
|
|
22505
22534
|
if (o.id === t) return {
|
|
@@ -22510,13 +22539,13 @@ function Va(e, t, n = 0, r = 0, i = null) {
|
|
|
22510
22539
|
originY: r
|
|
22511
22540
|
};
|
|
22512
22541
|
if (Array.isArray(o.children)) {
|
|
22513
|
-
let e =
|
|
22542
|
+
let e = Ua(o.children, t, n + (o.x ?? 0), r + (o.y ?? 0), o);
|
|
22514
22543
|
if (e) return e;
|
|
22515
22544
|
}
|
|
22516
22545
|
}
|
|
22517
22546
|
return null;
|
|
22518
22547
|
}
|
|
22519
|
-
function
|
|
22548
|
+
function Wa(e, t) {
|
|
22520
22549
|
let n = {
|
|
22521
22550
|
...t,
|
|
22522
22551
|
x: (t.x ?? 0) + (e.x ?? 0),
|
|
@@ -22536,7 +22565,7 @@ function Ha(e, t) {
|
|
|
22536
22565
|
} else i && (n.flipX = !t.flipX), a && (n.flipY = !t.flipY);
|
|
22537
22566
|
return n;
|
|
22538
22567
|
}
|
|
22539
|
-
function
|
|
22568
|
+
function Ga(e) {
|
|
22540
22569
|
let t = Math.min(...e.map((e) => e.x ?? 0)), n = Math.min(...e.map((e) => e.y ?? 0));
|
|
22541
22570
|
return {
|
|
22542
22571
|
x: t,
|
|
@@ -22545,24 +22574,24 @@ function Ua(e) {
|
|
|
22545
22574
|
h: Math.max(1, Math.max(...e.map((e) => (e.y ?? 0) + (e.h ?? 0))) - n)
|
|
22546
22575
|
};
|
|
22547
22576
|
}
|
|
22548
|
-
var
|
|
22549
|
-
function
|
|
22550
|
-
let i =
|
|
22577
|
+
var Ka = 1080, qa = 1080, Ja = ["background"], Ya = 80;
|
|
22578
|
+
function Xa(e, t, n, r = qa) {
|
|
22579
|
+
let i = Ka - t - Ya, a = r - n - Ya, o = (Ka - t) / 2, s = (r - n) / 2;
|
|
22551
22580
|
switch (e) {
|
|
22552
22581
|
case "TL": return {
|
|
22553
|
-
x:
|
|
22554
|
-
y:
|
|
22582
|
+
x: Ya,
|
|
22583
|
+
y: Ya
|
|
22555
22584
|
};
|
|
22556
22585
|
case "TC": return {
|
|
22557
22586
|
x: o,
|
|
22558
|
-
y:
|
|
22587
|
+
y: Ya
|
|
22559
22588
|
};
|
|
22560
22589
|
case "TR": return {
|
|
22561
22590
|
x: i,
|
|
22562
|
-
y:
|
|
22591
|
+
y: Ya
|
|
22563
22592
|
};
|
|
22564
22593
|
case "ML": return {
|
|
22565
|
-
x:
|
|
22594
|
+
x: Ya,
|
|
22566
22595
|
y: s
|
|
22567
22596
|
};
|
|
22568
22597
|
case "C": return {
|
|
@@ -22574,7 +22603,7 @@ function Ja(e, t, n, r = Ga) {
|
|
|
22574
22603
|
y: s
|
|
22575
22604
|
};
|
|
22576
22605
|
case "BL": return {
|
|
22577
|
-
x:
|
|
22606
|
+
x: Ya,
|
|
22578
22607
|
y: a
|
|
22579
22608
|
};
|
|
22580
22609
|
case "BC": return {
|
|
@@ -22591,7 +22620,7 @@ function Ja(e, t, n, r = Ga) {
|
|
|
22591
22620
|
};
|
|
22592
22621
|
}
|
|
22593
22622
|
}
|
|
22594
|
-
var
|
|
22623
|
+
var Za = {
|
|
22595
22624
|
family: "right-grotesk",
|
|
22596
22625
|
width: "Tight",
|
|
22597
22626
|
weight: 600,
|
|
@@ -22619,8 +22648,8 @@ var Ya = {
|
|
|
22619
22648
|
},
|
|
22620
22649
|
randomWidthLock: "",
|
|
22621
22650
|
randomWeightLock: ""
|
|
22622
|
-
},
|
|
22623
|
-
shapeId:
|
|
22651
|
+
}, Qa = {
|
|
22652
|
+
shapeId: In,
|
|
22624
22653
|
customSvg: "",
|
|
22625
22654
|
cols: 4,
|
|
22626
22655
|
rows: 4,
|
|
@@ -22633,24 +22662,24 @@ var Ya = {
|
|
|
22633
22662
|
rules: [],
|
|
22634
22663
|
scale: 256
|
|
22635
22664
|
};
|
|
22636
|
-
function
|
|
22665
|
+
function $a(e = {}, { color: t = "palette:secondary" } = {}) {
|
|
22637
22666
|
return {
|
|
22638
|
-
shapeId: e.shapeId ??
|
|
22639
|
-
customSvg: e.customSvg ??
|
|
22640
|
-
cols: e.cols ??
|
|
22641
|
-
rows: e.rows ??
|
|
22642
|
-
gap: e.gap ??
|
|
22643
|
-
padding: e.padding ??
|
|
22644
|
-
stretch: e.stretch ??
|
|
22645
|
-
overflow: e.overflow ??
|
|
22667
|
+
shapeId: e.shapeId ?? Qa.shapeId,
|
|
22668
|
+
customSvg: e.customSvg ?? Qa.customSvg,
|
|
22669
|
+
cols: e.cols ?? Qa.cols,
|
|
22670
|
+
rows: e.rows ?? Qa.rows,
|
|
22671
|
+
gap: e.gap ?? Qa.gap,
|
|
22672
|
+
padding: e.padding ?? Qa.padding,
|
|
22673
|
+
stretch: e.stretch ?? Qa.stretch,
|
|
22674
|
+
overflow: e.overflow ?? Qa.overflow,
|
|
22646
22675
|
bgOn: e.bg != null,
|
|
22647
|
-
bg: e.bg ??
|
|
22648
|
-
rules: e.rules ??
|
|
22649
|
-
scale: e.scale ??
|
|
22676
|
+
bg: e.bg ?? Qa.bg,
|
|
22677
|
+
rules: e.rules ?? Qa.rules,
|
|
22678
|
+
scale: e.scale ?? Qa.scale,
|
|
22650
22679
|
color: e.color ?? t
|
|
22651
22680
|
};
|
|
22652
22681
|
}
|
|
22653
|
-
var
|
|
22682
|
+
var eo = [], to = [
|
|
22654
22683
|
{
|
|
22655
22684
|
id: "pattern",
|
|
22656
22685
|
label: "Pattern"
|
|
@@ -22687,28 +22716,28 @@ var Qa = [], $a = [
|
|
|
22687
22716
|
id: "generate",
|
|
22688
22717
|
label: "Generate"
|
|
22689
22718
|
}
|
|
22690
|
-
],
|
|
22719
|
+
], no = {
|
|
22691
22720
|
loop: "generators",
|
|
22692
22721
|
misc: "generators",
|
|
22693
22722
|
generate: "generators",
|
|
22694
22723
|
kinetic: "motion"
|
|
22695
|
-
},
|
|
22724
|
+
}, ro = () => to.filter((e) => !no[e.id] || H(no[e.id])), io = (e, t = qa) => {
|
|
22696
22725
|
let n = (e) => ({ ...e }), r = (e, n, r) => ({
|
|
22697
|
-
...
|
|
22726
|
+
...Xa("C", e, n, t),
|
|
22698
22727
|
w: e,
|
|
22699
22728
|
h: n,
|
|
22700
22729
|
...r
|
|
22701
22730
|
}), i = (e) => ({
|
|
22702
22731
|
x: 0,
|
|
22703
22732
|
y: 0,
|
|
22704
|
-
w:
|
|
22733
|
+
w: Ka,
|
|
22705
22734
|
h: t,
|
|
22706
22735
|
...e
|
|
22707
22736
|
});
|
|
22708
22737
|
switch (e) {
|
|
22709
22738
|
case "background": return n({ color: "palette:primary" });
|
|
22710
22739
|
case "pattern": return i({
|
|
22711
|
-
...
|
|
22740
|
+
...Qa,
|
|
22712
22741
|
color: "palette:secondary"
|
|
22713
22742
|
});
|
|
22714
22743
|
case "photo": return i({
|
|
@@ -22722,37 +22751,37 @@ var Qa = [], $a = [
|
|
|
22722
22751
|
color: "palette:dark"
|
|
22723
22752
|
});
|
|
22724
22753
|
case "loop": {
|
|
22725
|
-
let e =
|
|
22754
|
+
let e = Ea().presetById();
|
|
22726
22755
|
return i({
|
|
22727
22756
|
loopGroup: "shape",
|
|
22728
22757
|
presetId: e.id,
|
|
22729
22758
|
presetLabel: e.label,
|
|
22730
22759
|
loopId: e.loop,
|
|
22731
|
-
...
|
|
22760
|
+
...Ea().presetParams(e),
|
|
22732
22761
|
themeId: he().defaultTheme
|
|
22733
22762
|
});
|
|
22734
22763
|
}
|
|
22735
22764
|
case "misc": {
|
|
22736
|
-
let e =
|
|
22765
|
+
let e = Ea().presetById("paratype-o");
|
|
22737
22766
|
return i({
|
|
22738
22767
|
loopGroup: "paratype",
|
|
22739
22768
|
presetId: e.id,
|
|
22740
22769
|
presetLabel: e.label,
|
|
22741
22770
|
loopId: e.loop,
|
|
22742
|
-
...
|
|
22771
|
+
...Ea().presetParams(e),
|
|
22743
22772
|
themeId: he().defaultTheme
|
|
22744
22773
|
});
|
|
22745
22774
|
}
|
|
22746
22775
|
case "kinetic": {
|
|
22747
|
-
let e =
|
|
22776
|
+
let e = Da().kineticPresetById();
|
|
22748
22777
|
return i({
|
|
22749
22778
|
presetId: e.id,
|
|
22750
22779
|
presetLabel: e.label,
|
|
22751
|
-
comp:
|
|
22780
|
+
comp: Da().presetComp(e)
|
|
22752
22781
|
});
|
|
22753
22782
|
}
|
|
22754
22783
|
case "text": return r(600, 120, {
|
|
22755
|
-
...
|
|
22784
|
+
...Za,
|
|
22756
22785
|
text: "New text",
|
|
22757
22786
|
color: "palette:dark"
|
|
22758
22787
|
});
|
|
@@ -22760,9 +22789,9 @@ var Qa = [], $a = [
|
|
|
22760
22789
|
children: [],
|
|
22761
22790
|
name: "Layer"
|
|
22762
22791
|
});
|
|
22763
|
-
case "generate": return i(
|
|
22792
|
+
case "generate": return i(Ea().generateParamsFor("lineScreen", "eclipse"));
|
|
22764
22793
|
case "repeat": return i({
|
|
22765
|
-
...
|
|
22794
|
+
...ba,
|
|
22766
22795
|
name: "Repeat"
|
|
22767
22796
|
});
|
|
22768
22797
|
case "path": return {
|
|
@@ -22779,12 +22808,12 @@ var Qa = [], $a = [
|
|
|
22779
22808
|
default: return {};
|
|
22780
22809
|
}
|
|
22781
22810
|
};
|
|
22782
|
-
function
|
|
22783
|
-
let [r, i] = L("4:5"), [a, o] = L(1080), [s, c] = L(1080), l = a / s, u = I(
|
|
22784
|
-
u.current =
|
|
22811
|
+
function ao({ children: e, persistDraft: t = !0, draftKey: n = Aa }) {
|
|
22812
|
+
let [r, i] = L("4:5"), [a, o] = L(1080), [s, c] = L(1080), l = a / s, u = I(qa);
|
|
22813
|
+
u.current = Ka / l;
|
|
22785
22814
|
let d = M((e) => {
|
|
22786
22815
|
i(e);
|
|
22787
|
-
let t =
|
|
22816
|
+
let t = zn[e];
|
|
22788
22817
|
t && (o(t.w), c(t.h));
|
|
22789
22818
|
}, []), f = M((e, t) => {
|
|
22790
22819
|
let n = Math.max(16, Math.round(e) || 0), r = Math.max(16, Math.round(t) || 0);
|
|
@@ -22792,7 +22821,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22792
22821
|
}, []), [p, m] = L(!1), h = M(() => m((e) => !e), []), [g, _] = L(!0), v = M(() => _((e) => !e), []), [y, b] = L({
|
|
22793
22822
|
h: [],
|
|
22794
22823
|
v: []
|
|
22795
|
-
}), [x, S] = L("single"), [T, k] = L("var(--kol-surface-ab-split)"), [j, N] = L(1), [R, z] = L("var(--kol-surface-secondary)"), [V, ee] = L("fill"), [te, H] = L("#FFFFFF"), [U, ne] = L(null), [W, re] = L("brand"), [ie, G] = L("random"), [K, ae] = L(() =>
|
|
22824
|
+
}), [x, S] = L("single"), [T, k] = L("var(--kol-surface-ab-split)"), [j, N] = L(1), [R, z] = L("var(--kol-surface-secondary)"), [V, ee] = L("fill"), [te, H] = L("#FFFFFF"), [U, ne] = L(null), [W, re] = L("brand"), [ie, G] = L("random"), [K, ae] = L(() => Fa("brand").defaults), [oe, se] = L(Pa), [ce, le] = L(Pa), [ue, de] = L(!1), [fe, q] = L(!1), [pe, me] = L(eo), [he, ge] = L([]), _e = he[0] ?? null, [ve, ye] = L(null), [be, xe] = L(null), [Se, J] = L(!0), Ce = M(() => J((e) => !e), []), we = M((e) => {
|
|
22796
22825
|
ge(e == null ? [] : [e]);
|
|
22797
22826
|
}, []), Te = M(() => {
|
|
22798
22827
|
ge(["canvas", ...Ne.current.map((e) => e.id)]);
|
|
@@ -22824,7 +22853,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22824
22853
|
}
|
|
22825
22854
|
}, []), Le = I(null);
|
|
22826
22855
|
P(() => {
|
|
22827
|
-
let e =
|
|
22856
|
+
let e = Ka / (a / s), t = Le.current;
|
|
22828
22857
|
if (Le.current = e, t == null || Math.abs(t - e) < .5) return;
|
|
22829
22858
|
let n = (e) => e.x === 0 && e.y === 0 && e.w === 1080 && Math.abs(e.h - t) < .5;
|
|
22830
22859
|
X((t) => t.some(n) ? t.map((t) => n(t) ? {
|
|
@@ -22859,7 +22888,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22859
22888
|
if (e.length === 0) return;
|
|
22860
22889
|
let t = e[0], n = [...Fe.current, Ie()].slice(-100), r = e.slice(1);
|
|
22861
22890
|
Fe.current = n, Y.current = r, Ne.current = t.layers, Pe.current = t.selectedIds, ke(n), je(r), me(t.layers), ge(t.selectedIds);
|
|
22862
|
-
}, []), Ue =
|
|
22891
|
+
}, []), Ue = Fa(W).isSeed, We = Ue && !fe, Ge = F(() => {
|
|
22863
22892
|
let e = K[0];
|
|
22864
22893
|
return {
|
|
22865
22894
|
primary: K[0] ?? e,
|
|
@@ -22877,15 +22906,15 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22877
22906
|
H(typeof e == "string" && e.startsWith("var(") ? null : e ?? null);
|
|
22878
22907
|
return;
|
|
22879
22908
|
}
|
|
22880
|
-
let e =
|
|
22881
|
-
!e || !
|
|
22909
|
+
let e = kr(Ke.current, _e);
|
|
22910
|
+
!e || !ka.has(e.type) || (e.color !== void 0 && H(so(e.color, qe.current) ?? null), e.stroke !== void 0 && ne(so(e.stroke, qe.current) ?? null));
|
|
22882
22911
|
}, [_e]), P(() => {
|
|
22883
|
-
Pt.setPointerInterest(
|
|
22912
|
+
Pt.setPointerInterest(Na(pe));
|
|
22884
22913
|
}, [pe]);
|
|
22885
22914
|
let Ye = I(te), Xe = I(U);
|
|
22886
22915
|
Ye.current = te, Xe.current = U;
|
|
22887
22916
|
let Ze = M((e, t = {}) => {
|
|
22888
|
-
let n =
|
|
22917
|
+
let n = La(e), r = ka.has(e) ? e === "background" ? { color: Ye.current } : {
|
|
22889
22918
|
color: Ye.current,
|
|
22890
22919
|
stroke: Xe.current
|
|
22891
22920
|
} : {};
|
|
@@ -22895,13 +22924,13 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22895
22924
|
visible: !0,
|
|
22896
22925
|
opacity: 1,
|
|
22897
22926
|
blend: "normal",
|
|
22898
|
-
...
|
|
22927
|
+
...io(e, u.current),
|
|
22899
22928
|
...r,
|
|
22900
22929
|
...t
|
|
22901
22930
|
}]), ge([n]), n;
|
|
22902
22931
|
}, [X]), Qe = M((e) => {
|
|
22903
|
-
let t =
|
|
22904
|
-
t &&
|
|
22932
|
+
let t = kr(Ne.current, e);
|
|
22933
|
+
t && za(t).forEach((e) => Fr(e)), X((t) => Ba(t, e)), ge((t) => t.includes(e) ? t.filter((t) => t !== e) : t);
|
|
22905
22934
|
}, [X]), $e = M(() => {
|
|
22906
22935
|
let e = he.filter((e) => e !== "canvas");
|
|
22907
22936
|
e.length !== 0 && (Re(), e.forEach(Qe), ze());
|
|
@@ -22911,20 +22940,20 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22911
22940
|
Re,
|
|
22912
22941
|
ze
|
|
22913
22942
|
]), et = M((e, t) => {
|
|
22914
|
-
X((n) =>
|
|
22943
|
+
X((n) => Ra(n, e, t));
|
|
22915
22944
|
}, [X]), tt = M((e, t) => {
|
|
22916
22945
|
X((n) => {
|
|
22917
|
-
let r =
|
|
22946
|
+
let r = kr(n, e);
|
|
22918
22947
|
if (!r) return n;
|
|
22919
|
-
let i =
|
|
22920
|
-
return !a || a === i ? n :
|
|
22948
|
+
let i = qi(r), a = t(i, r);
|
|
22949
|
+
return !a || a === i ? n : Ra(n, e, { filters: a });
|
|
22921
22950
|
});
|
|
22922
22951
|
}, [X]), nt = M((e, t) => {
|
|
22923
|
-
let n =
|
|
22952
|
+
let n = Oa(t);
|
|
22924
22953
|
n && tt(e, (e) => {
|
|
22925
22954
|
if (e.length >= 8) return null;
|
|
22926
|
-
let r = e.findIndex((e) =>
|
|
22927
|
-
if (n.kind === "engine") return r >= 0 ? null : [...e,
|
|
22955
|
+
let r = e.findIndex((e) => Oa(e.id)?.kind === "engine");
|
|
22956
|
+
if (n.kind === "engine") return r >= 0 ? null : [...e, Vi(t)];
|
|
22928
22957
|
let i;
|
|
22929
22958
|
if (n.first) {
|
|
22930
22959
|
if (e.some((e) => e.id === t)) return null;
|
|
@@ -22932,13 +22961,13 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22932
22961
|
} else if (n.kind === "pixi") i = r >= 0 ? r : e.length;
|
|
22933
22962
|
else {
|
|
22934
22963
|
let t = e.findIndex((e) => {
|
|
22935
|
-
let t =
|
|
22964
|
+
let t = Oa(e.id)?.kind;
|
|
22936
22965
|
return t === "pixi" || t === "engine";
|
|
22937
22966
|
});
|
|
22938
22967
|
i = t >= 0 ? t : e.length;
|
|
22939
22968
|
}
|
|
22940
22969
|
let a = [...e];
|
|
22941
|
-
return a.splice(i, 0,
|
|
22970
|
+
return a.splice(i, 0, Vi(t)), a;
|
|
22942
22971
|
});
|
|
22943
22972
|
}, [tt]), rt = M((e, t) => {
|
|
22944
22973
|
tt(e, (e) => t >= 0 && t < e.length ? e.filter((e, n) => n !== t) : null);
|
|
@@ -22952,7 +22981,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22952
22981
|
if (t === n || t < 0 || t >= e.length || n < 0 || n >= e.length) return null;
|
|
22953
22982
|
let r = [...e], [i] = r.splice(t, 1);
|
|
22954
22983
|
r.splice(n, 0, i);
|
|
22955
|
-
let a = r.findIndex((e) =>
|
|
22984
|
+
let a = r.findIndex((e) => Oa(e.id)?.kind === "engine");
|
|
22956
22985
|
return a >= 0 && a !== r.length - 1 ? null : r;
|
|
22957
22986
|
});
|
|
22958
22987
|
}, [tt]), ot = M((e, t, n) => {
|
|
@@ -22964,12 +22993,12 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22964
22993
|
}
|
|
22965
22994
|
} : e) : null);
|
|
22966
22995
|
}, [tt]), st = M((e, t, n) => {
|
|
22967
|
-
let r =
|
|
22996
|
+
let r = Oa(n);
|
|
22968
22997
|
r && tt(e, (e) => {
|
|
22969
22998
|
if (t < 0 || t >= e.length) return null;
|
|
22970
|
-
let i = e.some((e, n) => n !== t &&
|
|
22999
|
+
let i = e.some((e, n) => n !== t && Oa(e.id)?.kind === "engine");
|
|
22971
23000
|
return r.kind === "engine" && (i || t !== e.length - 1) ? null : e.map((e, r) => r === t ? {
|
|
22972
|
-
...
|
|
23001
|
+
...Vi(n),
|
|
22973
23002
|
key: e.key,
|
|
22974
23003
|
enabled: e.enabled
|
|
22975
23004
|
} : e);
|
|
@@ -22986,16 +23015,16 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
22986
23015
|
} : t));
|
|
22987
23016
|
}, [X]), ut = M((e, t) => {
|
|
22988
23017
|
X((n) => {
|
|
22989
|
-
let r =
|
|
22990
|
-
if (!r || r.locked ||
|
|
23018
|
+
let r = kr(n, e);
|
|
23019
|
+
if (!r || r.locked || Ja.includes(r.type)) return n;
|
|
22991
23020
|
if (r.type === "path" && Array.isArray(r.nodes)) {
|
|
22992
23021
|
let i = t === "h" ? -1 : 1, a = t === "v" ? -1 : 1, o = w(D(r.nodes, i, a), r.holes?.map((e) => D(e, i, a)));
|
|
22993
|
-
return
|
|
23022
|
+
return Ra(n, e, {
|
|
22994
23023
|
nodes: o.nodes,
|
|
22995
23024
|
holes: o.holes
|
|
22996
23025
|
});
|
|
22997
23026
|
}
|
|
22998
|
-
return r.x == null || r.w == null ? n :
|
|
23027
|
+
return r.x == null || r.w == null ? n : Ra(n, e, t === "h" ? { flipX: !r.flipX } : { flipY: !r.flipY });
|
|
22999
23028
|
});
|
|
23000
23029
|
}, [X]), dt = M((e) => {
|
|
23001
23030
|
let t = he.filter((e) => e !== "canvas");
|
|
@@ -23006,9 +23035,9 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23006
23035
|
Re,
|
|
23007
23036
|
ze
|
|
23008
23037
|
]), ft = M((e) => {
|
|
23009
|
-
let t = Ne.current.filter((e) => he.includes(e.id) &&
|
|
23038
|
+
let t = Ne.current.filter((e) => he.includes(e.id) && vi(e));
|
|
23010
23039
|
if (t.length < 2) return;
|
|
23011
|
-
let n = t[0], r =
|
|
23040
|
+
let n = t[0], r = Ei(t, e)?.bounds ?? Ga(t), i = La("bool"), a = !1;
|
|
23012
23041
|
X((o) => {
|
|
23013
23042
|
let s = new Set(t.map((e) => e.id)), c = Math.max(...o.map((e, t) => s.has(e.id) ? t : -1));
|
|
23014
23043
|
if (c < 0) return o;
|
|
@@ -23037,11 +23066,11 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23037
23066
|
}), a = !0, u;
|
|
23038
23067
|
}), a && ge([i]);
|
|
23039
23068
|
}, [he, X]), pt = M(() => {
|
|
23040
|
-
let e = Ne.current.filter((e) => he.includes(e.id) &&
|
|
23069
|
+
let e = Ne.current.filter((e) => he.includes(e.id) && vi(e));
|
|
23041
23070
|
if (e.length === 0 || e.length === 1 && e[0].type !== "bool") return;
|
|
23042
|
-
let t =
|
|
23071
|
+
let t = wi(e, "unite");
|
|
23043
23072
|
if (!t || (t.nodes?.length ?? 0) < 2) return;
|
|
23044
|
-
let n = w(t.nodes, t.holes), r = e[0], i =
|
|
23073
|
+
let n = w(t.nodes, t.holes), r = e[0], i = La("path"), a = !1;
|
|
23045
23074
|
X((t) => {
|
|
23046
23075
|
let o = new Set(e.map((e) => e.id)), s = Math.max(...t.map((e, t) => o.has(e.id) ? t : -1));
|
|
23047
23076
|
if (s < 0) return t;
|
|
@@ -23069,7 +23098,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23069
23098
|
}, [he, X]), mt = M((e) => {
|
|
23070
23099
|
X((t) => t.map((t) => {
|
|
23071
23100
|
if (t.id !== e || t.type !== "shape") return t;
|
|
23072
|
-
let n =
|
|
23101
|
+
let n = ui(t);
|
|
23073
23102
|
if (!n) return t;
|
|
23074
23103
|
let r = n.nodes, i = (t.w ?? 0) / 2, a = (t.h ?? 0) / 2;
|
|
23075
23104
|
(t.flipX || t.flipY) && (r = D(r, t.flipX ? -1 : 1, t.flipY ? -1 : 1).map((e) => O(e, t.flipX ? i * 2 : 0, t.flipY ? a * 2 : 0)));
|
|
@@ -23098,21 +23127,21 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23098
23127
|
};
|
|
23099
23128
|
}));
|
|
23100
23129
|
}, [X]), ht = M((e, { offset: t = 24 } = {}) => {
|
|
23101
|
-
let n =
|
|
23130
|
+
let n = Ua(Ne.current, e), r = n ? La(n.layer.type) : null;
|
|
23102
23131
|
return r ? (X((n) => {
|
|
23103
|
-
let i =
|
|
23132
|
+
let i = Ua(n, e);
|
|
23104
23133
|
if (!i) return n;
|
|
23105
23134
|
let a = {
|
|
23106
23135
|
...i.layer,
|
|
23107
23136
|
id: r
|
|
23108
23137
|
};
|
|
23109
|
-
return Array.isArray(a.children) && (a.children = Ot(a.children)), a.x != null && (a.x += t, a.y += t),
|
|
23138
|
+
return Array.isArray(a.children) && (a.children = Ot(a.children)), a.x != null && (a.x += t, a.y += t), Va(n, i.parent?.id ?? null, i.index + 1, a);
|
|
23110
23139
|
}), r) : null;
|
|
23111
23140
|
}, [X]), gt = M(() => {
|
|
23112
23141
|
X(() => []), ge([]), ye(null), xe(null);
|
|
23113
23142
|
}, [X]), _t = M((e) => {
|
|
23114
23143
|
if (!Array.isArray(e) || e.length < 2) return;
|
|
23115
|
-
let t =
|
|
23144
|
+
let t = La("group"), n = !1;
|
|
23116
23145
|
X((r) => {
|
|
23117
23146
|
let i = new Set(e), a = [], o = (e, t, n) => {
|
|
23118
23147
|
for (let r of e) {
|
|
@@ -23133,7 +23162,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23133
23162
|
x: e.x - d,
|
|
23134
23163
|
y: e.y - f
|
|
23135
23164
|
})), g = r;
|
|
23136
|
-
for (let e of a) g =
|
|
23165
|
+
for (let e of a) g = Ba(g, e.id);
|
|
23137
23166
|
let _ = {
|
|
23138
23167
|
id: t,
|
|
23139
23168
|
type: "group",
|
|
@@ -23155,7 +23184,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23155
23184
|
if (r < 0) return n;
|
|
23156
23185
|
let i = n[r];
|
|
23157
23186
|
if (i.type !== "group") return n;
|
|
23158
|
-
let a = (i.children ?? []).map((e) =>
|
|
23187
|
+
let a = (i.children ?? []).map((e) => Wa(i, e));
|
|
23159
23188
|
t = a.map((e) => e.id);
|
|
23160
23189
|
let o = [...n];
|
|
23161
23190
|
return o.splice(r, 1, ...a), o;
|
|
@@ -23167,7 +23196,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23167
23196
|
if (r < 0) return n;
|
|
23168
23197
|
let i = n[r];
|
|
23169
23198
|
if (i.type !== "bool") return n;
|
|
23170
|
-
let a = (i.children ?? []).map((e) =>
|
|
23199
|
+
let a = (i.children ?? []).map((e) => Wa(i, e));
|
|
23171
23200
|
t = a.map((e) => e.id);
|
|
23172
23201
|
let o = [...n];
|
|
23173
23202
|
return o.splice(r, 1, ...a), o;
|
|
@@ -23176,20 +23205,20 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23176
23205
|
if (!e || e === "canvas" || e === t) return;
|
|
23177
23206
|
let r = !1;
|
|
23178
23207
|
X((i) => {
|
|
23179
|
-
let a =
|
|
23208
|
+
let a = Ua(i, e);
|
|
23180
23209
|
if (!a) return i;
|
|
23181
23210
|
let o = a.layer;
|
|
23182
23211
|
if (t != null) {
|
|
23183
|
-
let e =
|
|
23184
|
-
if (!e || e.type !== "group" && e.type !== "bool" ||
|
|
23212
|
+
let e = kr(i, t);
|
|
23213
|
+
if (!e || e.type !== "group" && e.type !== "bool" || kr([o], t) || e.type === "bool" && !_i(o)) return i;
|
|
23185
23214
|
}
|
|
23186
|
-
let s = a.originX + (o.x ?? 0), c = a.originY + (o.y ?? 0), l =
|
|
23215
|
+
let s = a.originX + (o.x ?? 0), c = a.originY + (o.y ?? 0), l = Ba(i, e), u = 0, d = 0;
|
|
23187
23216
|
if (t != null) {
|
|
23188
|
-
let e =
|
|
23217
|
+
let e = Ua(l, t);
|
|
23189
23218
|
if (!e) return i;
|
|
23190
23219
|
u = e.originX + (e.layer.x ?? 0), d = e.originY + (e.layer.y ?? 0);
|
|
23191
23220
|
}
|
|
23192
|
-
return r = !0,
|
|
23221
|
+
return r = !0, Va(l, t, n, {
|
|
23193
23222
|
...o,
|
|
23194
23223
|
x: s - u,
|
|
23195
23224
|
y: c - d
|
|
@@ -23197,9 +23226,9 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23197
23226
|
}), r && ge([e]);
|
|
23198
23227
|
}, [X]), xt = M((e, t) => {
|
|
23199
23228
|
X((n) => {
|
|
23200
|
-
let r = Pe.current.filter((e) => e !== "canvas").map((e) =>
|
|
23229
|
+
let r = Pe.current.filter((e) => e !== "canvas").map((e) => Ua(n, e)).filter((e) => e && typeof e.layer.x == "number" && typeof e.layer.y == "number" && !e.layer.locked);
|
|
23201
23230
|
if (r.length < 1) return n;
|
|
23202
|
-
let i = r.map((e) => e.originX + e.layer.x), a = r.map((e) => e.originY + e.layer.y), o = r.map((e, t) => i[t] + (e.layer.w ?? 0)), s = r.map((e, t) => a[t] + (e.layer.h ?? 0)), c = r.length === 1, l = c ? 0 : Math.min(...i), d = c ? 0 : Math.min(...a), f = c ?
|
|
23231
|
+
let i = r.map((e) => e.originX + e.layer.x), a = r.map((e) => e.originY + e.layer.y), o = r.map((e, t) => i[t] + (e.layer.w ?? 0)), s = r.map((e, t) => a[t] + (e.layer.h ?? 0)), c = r.length === 1, l = c ? 0 : Math.min(...i), d = c ? 0 : Math.min(...a), f = c ? Ka : Math.max(...o) - l, p = c ? u.current : Math.max(...s) - d, m = null;
|
|
23203
23232
|
if (t === "distribute") {
|
|
23204
23233
|
if (r.length < 3) return n;
|
|
23205
23234
|
let t = e === "h" ? i : a, o = r.map((t) => e === "h" ? t.layer.w ?? 0 : t.layer.h ?? 0), s = r.map((e, t) => t).sort((e, n) => t[e] - t[n]), c = s[0], l = s[s.length - 1], u = (t[l] + o[l] - t[c] - o.reduce((e, t) => e + t, 0)) / (s.length - 1);
|
|
@@ -23213,19 +23242,19 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23213
23242
|
return r.forEach((n, r) => {
|
|
23214
23243
|
let o = n.layer, s = i[r], c = a[r];
|
|
23215
23244
|
m ? e === "h" ? s = m[r] : c = m[r] : e === "h" ? (t === "start" && (s = l), t === "center" && (s = l + (f - (o.w ?? 0)) / 2), t === "end" && (s = l + f - (o.w ?? 0))) : e === "v" && (t === "start" && (c = d), t === "center" && (c = d + (p - (o.h ?? 0)) / 2), t === "end" && (c = d + p - (o.h ?? 0)));
|
|
23216
|
-
let u =
|
|
23245
|
+
let u = Ua(h, o.id);
|
|
23217
23246
|
if (!u) return;
|
|
23218
23247
|
let g = s - u.originX, _ = c - u.originY;
|
|
23219
|
-
e === "h" && g !== u.layer.x && (h =
|
|
23248
|
+
e === "h" && g !== u.layer.x && (h = Ra(h, o.id, { x: g })), e === "v" && _ !== u.layer.y && (h = Ra(h, o.id, { y: _ }));
|
|
23220
23249
|
}), h;
|
|
23221
23250
|
});
|
|
23222
23251
|
}, [X]), St = M((e) => {
|
|
23223
23252
|
X((t) => {
|
|
23224
|
-
let n =
|
|
23253
|
+
let n = kr(t, e);
|
|
23225
23254
|
if (!n || n.type !== "pattern") return t;
|
|
23226
|
-
let r =
|
|
23255
|
+
let r = Ln(n.shapeId, n.customSvg);
|
|
23227
23256
|
if (!r) return t;
|
|
23228
|
-
let i =
|
|
23257
|
+
let i = so(n.color, Ge) ?? "#FFFFFF", a = n.bgOn ? so(n.bg, Ge) ?? null : null, o = so(n.stroke, Ge), s = n.strokeWidth ?? 0, c = Kn({
|
|
23229
23258
|
shapeSvg: r,
|
|
23230
23259
|
cols: n.cols,
|
|
23231
23260
|
rows: n.rows,
|
|
@@ -23239,7 +23268,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23239
23268
|
stroke: s > 0 ? o : null,
|
|
23240
23269
|
strokeWidth: s,
|
|
23241
23270
|
size: n.scale ?? 256
|
|
23242
|
-
}), l =
|
|
23271
|
+
}), l = La("shape"), u = La("group"), d = {
|
|
23243
23272
|
id: l,
|
|
23244
23273
|
type: "shape",
|
|
23245
23274
|
kind: "flatten",
|
|
@@ -23253,7 +23282,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23253
23282
|
opacity: 1,
|
|
23254
23283
|
blend: "normal"
|
|
23255
23284
|
};
|
|
23256
|
-
return
|
|
23285
|
+
return Ha(t, e, {
|
|
23257
23286
|
id: u,
|
|
23258
23287
|
type: "group",
|
|
23259
23288
|
x: n.x ?? 0,
|
|
@@ -23268,16 +23297,16 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23268
23297
|
});
|
|
23269
23298
|
}, [X, Ge]), Ct = M((e) => {
|
|
23270
23299
|
X((t) => {
|
|
23271
|
-
let n =
|
|
23300
|
+
let n = kr(t, e);
|
|
23272
23301
|
if (!n || n.type !== "generate") return t;
|
|
23273
|
-
let { generateMarks: r, generateBody: i } =
|
|
23302
|
+
let { generateMarks: r, generateBody: i } = Ea(), a = r(n), o = so(n.color, Ge) ?? "#FFFFFF", s = n.bg == null ? null : so(n.bg, Ge), c = n.x ?? 0, l = n.y ?? 0, u = n.w ?? 1080, d = n.h ?? 1080, f = {
|
|
23274
23303
|
visible: !0,
|
|
23275
23304
|
opacity: 1,
|
|
23276
23305
|
blend: "normal"
|
|
23277
23306
|
}, p = [];
|
|
23278
23307
|
if (s && p.push({
|
|
23279
23308
|
...f,
|
|
23280
|
-
id:
|
|
23309
|
+
id: La("shape"),
|
|
23281
23310
|
type: "shape",
|
|
23282
23311
|
kind: "rect",
|
|
23283
23312
|
x: c,
|
|
@@ -23286,11 +23315,11 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23286
23315
|
h: d,
|
|
23287
23316
|
color: s,
|
|
23288
23317
|
name: "Ground"
|
|
23289
|
-
}),
|
|
23318
|
+
}), ca(a) <= 2e3) for (let e of pa(a)) {
|
|
23290
23319
|
let t = w(e.nodes, e.holes), n = Math.floor(c + t.dx), r = Math.floor(l + t.dy), i = c + t.dx - n, a = l + t.dy - r, s = (e) => e.map((e) => O(e, i, a));
|
|
23291
23320
|
p.push({
|
|
23292
23321
|
...f,
|
|
23293
|
-
id:
|
|
23322
|
+
id: La("path"),
|
|
23294
23323
|
type: "path",
|
|
23295
23324
|
nodes: s(t.nodes),
|
|
23296
23325
|
holes: t.holes?.length ? t.holes.map(s) : void 0,
|
|
@@ -23311,7 +23340,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23311
23340
|
}, a)}</svg>`;
|
|
23312
23341
|
p.push({
|
|
23313
23342
|
...f,
|
|
23314
|
-
id:
|
|
23343
|
+
id: La("shape"),
|
|
23315
23344
|
type: "shape",
|
|
23316
23345
|
kind: "flatten",
|
|
23317
23346
|
svg: e,
|
|
@@ -23323,8 +23352,8 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23323
23352
|
name: "Marks"
|
|
23324
23353
|
});
|
|
23325
23354
|
}
|
|
23326
|
-
return
|
|
23327
|
-
id:
|
|
23355
|
+
return Ha(t, e, {
|
|
23356
|
+
id: La("group"),
|
|
23328
23357
|
type: "group",
|
|
23329
23358
|
name: n.genLabel ?? "Generate",
|
|
23330
23359
|
x: c,
|
|
@@ -23339,9 +23368,9 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23339
23368
|
});
|
|
23340
23369
|
}, [X, Ge]), wt = M((e) => {
|
|
23341
23370
|
X((t) => {
|
|
23342
|
-
let n =
|
|
23371
|
+
let n = kr(t, e);
|
|
23343
23372
|
if (!n || n.type !== "repeat") return t;
|
|
23344
|
-
let r = n.sourceId ?
|
|
23373
|
+
let r = n.sourceId ? kr(t, n.sourceId) : null;
|
|
23345
23374
|
if (!r || r.w == null) return t;
|
|
23346
23375
|
let i = {
|
|
23347
23376
|
x: r.x ?? 0,
|
|
@@ -23350,10 +23379,10 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23350
23379
|
h: r.h
|
|
23351
23380
|
}, a = i.x + i.w / 2, o = i.y + i.h / 2, s = (e) => ({
|
|
23352
23381
|
...e,
|
|
23353
|
-
id:
|
|
23382
|
+
id: La(e.type),
|
|
23354
23383
|
...e.children ? { children: e.children.map(s) } : {}
|
|
23355
|
-
}), c =
|
|
23356
|
-
let { rotation: t, scale: n, mirror: c } =
|
|
23384
|
+
}), c = xa(n, i).map((e) => {
|
|
23385
|
+
let { rotation: t, scale: n, mirror: c } = Sa(e), [l, u] = ya(e, a, o), d = i.w * n, f = i.h * n, p = r.rotation ?? 0, m = s(r), h = m.nodes;
|
|
23357
23386
|
return m.type === "path" && h && n !== 1 && (h = D(h, n, n)), {
|
|
23358
23387
|
...m,
|
|
23359
23388
|
...h ? { nodes: h } : {},
|
|
@@ -23365,13 +23394,13 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23365
23394
|
...c ? { flipY: !r.flipY } : {}
|
|
23366
23395
|
};
|
|
23367
23396
|
});
|
|
23368
|
-
return
|
|
23369
|
-
id:
|
|
23397
|
+
return Ha(t, e, {
|
|
23398
|
+
id: La("group"),
|
|
23370
23399
|
type: "group",
|
|
23371
23400
|
name: n.name ?? "Repeat",
|
|
23372
23401
|
x: 0,
|
|
23373
23402
|
y: 0,
|
|
23374
|
-
w:
|
|
23403
|
+
w: Ka,
|
|
23375
23404
|
h: u.current ?? 1080,
|
|
23376
23405
|
visible: n.visible ?? !0,
|
|
23377
23406
|
opacity: n.opacity ?? 1,
|
|
@@ -23380,9 +23409,9 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23380
23409
|
});
|
|
23381
23410
|
});
|
|
23382
23411
|
}, [X]), Tt = M(async (e) => {
|
|
23383
|
-
let t =
|
|
23412
|
+
let t = kr(Ne.current, e);
|
|
23384
23413
|
if (!t || t.type !== "text") return;
|
|
23385
|
-
let n =
|
|
23414
|
+
let n = so(t.color, Ge) ?? "#FFFFFF", { glyphs: r, offset: i } = await Or({
|
|
23386
23415
|
...t,
|
|
23387
23416
|
x: 0,
|
|
23388
23417
|
y: 0,
|
|
@@ -23392,7 +23421,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23392
23421
|
let o = t.size ?? 96, s = o, c = a.map((e) => {
|
|
23393
23422
|
let { x1: t, y1: r, x2: a, y2: o } = e.bbox, c = Math.max(a - t, 4), l = Math.max(o - r, 4), u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c.toFixed(2)} ${l.toFixed(2)}" preserveAspectRatio="none"><path d="${e.d}" transform="translate(${(-t).toFixed(2)} ${(-r).toFixed(2)})" fill="currentColor" fill-rule="evenodd"/></svg>`;
|
|
23394
23423
|
return {
|
|
23395
|
-
id:
|
|
23424
|
+
id: La("shape"),
|
|
23396
23425
|
type: "shape",
|
|
23397
23426
|
kind: "flatten",
|
|
23398
23427
|
svg: u,
|
|
@@ -23407,7 +23436,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23407
23436
|
blend: "normal"
|
|
23408
23437
|
};
|
|
23409
23438
|
}), l = {
|
|
23410
|
-
id:
|
|
23439
|
+
id: La("group"),
|
|
23411
23440
|
type: "group",
|
|
23412
23441
|
x: t.x ?? 0,
|
|
23413
23442
|
y: t.y ?? 0,
|
|
@@ -23418,19 +23447,19 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23418
23447
|
blend: t.blend ?? "normal",
|
|
23419
23448
|
children: c
|
|
23420
23449
|
};
|
|
23421
|
-
X((t) =>
|
|
23450
|
+
X((t) => Ha(t, e, l));
|
|
23422
23451
|
}, [X, Ge]), Et = M((e) => {
|
|
23423
23452
|
X((t) => {
|
|
23424
|
-
let n =
|
|
23453
|
+
let n = kr(t, e);
|
|
23425
23454
|
if (!n) return t;
|
|
23426
23455
|
let r = {
|
|
23427
|
-
fg:
|
|
23428
|
-
bg: n.bgOn === !1 ? null :
|
|
23429
|
-
}, i =
|
|
23430
|
-
return i ?
|
|
23456
|
+
fg: so(n.fg, Ge) ?? "#e8e4dc",
|
|
23457
|
+
bg: n.bgOn === !1 ? null : so(n.bg, Ge) ?? "#0b0b0e"
|
|
23458
|
+
}, i = Ea()?.buildParatypeFlattenGroup(n, r, La);
|
|
23459
|
+
return i ? Ha(t, e, i) : t;
|
|
23431
23460
|
});
|
|
23432
23461
|
}, [X, Ge]), Dt = M(async (e) => {
|
|
23433
|
-
let t =
|
|
23462
|
+
let t = so(e.color, Ge) ?? "#FFFFFF", { glyphs: n, offset: r } = await Or({
|
|
23434
23463
|
...e,
|
|
23435
23464
|
x: 0,
|
|
23436
23465
|
y: 0,
|
|
@@ -23440,7 +23469,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23440
23469
|
let a = e.size ?? 96, o = a, s = i.map((e) => {
|
|
23441
23470
|
let { x1: n, y1: i, x2: a, y2: s } = e.bbox, c = Math.max(a - n, 4), l = Math.max(s - i, 4), u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c.toFixed(2)} ${l.toFixed(2)}" preserveAspectRatio="none"><path d="${e.d}" transform="translate(${(-n).toFixed(2)} ${(-i).toFixed(2)})" fill="currentColor" fill-rule="evenodd"/></svg>`;
|
|
23442
23471
|
return {
|
|
23443
|
-
id:
|
|
23472
|
+
id: La("shape"),
|
|
23444
23473
|
type: "shape",
|
|
23445
23474
|
kind: "flatten",
|
|
23446
23475
|
svg: u,
|
|
@@ -23454,8 +23483,8 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23454
23483
|
opacity: 1,
|
|
23455
23484
|
blend: "normal"
|
|
23456
23485
|
};
|
|
23457
|
-
}), c = e.w ?? 600, l = e.h ?? a * 1.2, { x: d, y: f } =
|
|
23458
|
-
id:
|
|
23486
|
+
}), c = e.w ?? 600, l = e.h ?? a * 1.2, { x: d, y: f } = Xa("C", c, l, u.current), p = {
|
|
23487
|
+
id: La("group"),
|
|
23459
23488
|
type: "group",
|
|
23460
23489
|
x: d,
|
|
23461
23490
|
y: f,
|
|
@@ -23467,20 +23496,20 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23467
23496
|
children: s
|
|
23468
23497
|
};
|
|
23469
23498
|
X((e) => [...e, p]), ge([p.id]);
|
|
23470
|
-
}, [X, Ge]), Ot = (e) =>
|
|
23499
|
+
}, [X, Ge]), Ot = (e) => Ki(Array.isArray(e) ? e : []).map((e) => ({
|
|
23471
23500
|
...e,
|
|
23472
|
-
id:
|
|
23501
|
+
id: La(e.type ?? "layer"),
|
|
23473
23502
|
...Array.isArray(e.children) ? { children: Ot(e.children) } : {}
|
|
23474
23503
|
})), kt = M((e) => {
|
|
23475
23504
|
if (!e) return;
|
|
23476
|
-
e.aspect && i(e.aspect), typeof e.canvasW == "number" && typeof e.canvasH == "number" ? (o(e.canvasW), c(e.canvasH)) : e.aspect &&
|
|
23505
|
+
e.aspect && i(e.aspect), typeof e.canvasW == "number" && typeof e.canvasH == "number" ? (o(e.canvasW), c(e.canvasH)) : e.aspect && zn[e.aspect] && (o(zn[e.aspect].w), c(zn[e.aspect].h)), e.palette && (e.palette.poolId && re(e.palette.poolId), e.palette.modeId && G(e.palette.modeId), Array.isArray(e.palette.colors) && ae(e.palette.colors), Array.isArray(e.palette.locks) && se(e.palette.locks));
|
|
23477
23506
|
let t = Ot(e.layers), n = [], r = (e, t) => (e ?? []).forEach((e, i) => {
|
|
23478
23507
|
n.push([e, t[i]]), Array.isArray(e?.children) && r(e.children, t[i]?.children);
|
|
23479
23508
|
});
|
|
23480
23509
|
r(e.layers, t);
|
|
23481
|
-
for (let [e, t] of n) !t || typeof e?.src != "string" || !e.src.startsWith("blob:") ||
|
|
23510
|
+
for (let [e, t] of n) !t || typeof e?.src != "string" || !e.src.startsWith("blob:") || Pr(e.id).then((e) => {
|
|
23482
23511
|
if (!e) return;
|
|
23483
|
-
|
|
23512
|
+
Nr(t.id, e);
|
|
23484
23513
|
let n = URL.createObjectURL(e), r = (e) => e.map((e) => e.id === t.id ? {
|
|
23485
23514
|
...e,
|
|
23486
23515
|
src: n
|
|
@@ -23507,16 +23536,16 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23507
23536
|
}
|
|
23508
23537
|
if (e === "pattern") {
|
|
23509
23538
|
let e = {
|
|
23510
|
-
id:
|
|
23539
|
+
id: La("pattern"),
|
|
23511
23540
|
type: "pattern",
|
|
23512
23541
|
visible: !0,
|
|
23513
23542
|
opacity: 1,
|
|
23514
23543
|
blend: "normal",
|
|
23515
23544
|
x: 0,
|
|
23516
23545
|
y: 0,
|
|
23517
|
-
w:
|
|
23546
|
+
w: Ka,
|
|
23518
23547
|
h: u.current,
|
|
23519
|
-
|
|
23548
|
+
...$a(t)
|
|
23520
23549
|
};
|
|
23521
23550
|
X((t) => [...t, e]), ge([e.id]);
|
|
23522
23551
|
return;
|
|
@@ -23525,8 +23554,8 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23525
23554
|
let e = n ? {
|
|
23526
23555
|
x: n.vx - 600 / 2,
|
|
23527
23556
|
y: n.vy - 120 / 2
|
|
23528
|
-
} :
|
|
23529
|
-
id:
|
|
23557
|
+
} : Xa("C", 600, 120, u.current), r = {
|
|
23558
|
+
id: La("text"),
|
|
23530
23559
|
type: "text",
|
|
23531
23560
|
visible: !0,
|
|
23532
23561
|
opacity: 1,
|
|
@@ -23553,7 +23582,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23553
23582
|
P(() => {
|
|
23554
23583
|
if (Mt.current || (Mt.current = !0, !t)) return;
|
|
23555
23584
|
let e = (e) => {
|
|
23556
|
-
Nt.current = !0,
|
|
23585
|
+
Nt.current = !0, Ir(e);
|
|
23557
23586
|
};
|
|
23558
23587
|
{
|
|
23559
23588
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -23601,7 +23630,7 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23601
23630
|
Array.isArray(e) && !e.every((t) => t === e[0]) && ae(e), Array.isArray(a.palette.locks) && se(a.palette.locks);
|
|
23602
23631
|
}
|
|
23603
23632
|
a.paint && (a.paint.fill !== void 0 && H(a.paint.fill), a.paint.stroke !== void 0 && ne(a.paint.stroke), (a.paint.active === "fill" || a.paint.active === "stroke") && ee(a.paint.active));
|
|
23604
|
-
let t = await
|
|
23633
|
+
let t = await Br(Ki(a.layers));
|
|
23605
23634
|
me(t), ge([]), e(t);
|
|
23606
23635
|
} else {
|
|
23607
23636
|
try {
|
|
@@ -23668,23 +23697,23 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23668
23697
|
]);
|
|
23669
23698
|
let Ft = M((e, t) => {
|
|
23670
23699
|
X((n) => {
|
|
23671
|
-
let r =
|
|
23700
|
+
let r = Ua(n, e);
|
|
23672
23701
|
if (!r) return n;
|
|
23673
23702
|
let i = [...r.parent ? r.parent.children ?? [] : n];
|
|
23674
23703
|
i.splice(r.index, 1);
|
|
23675
23704
|
let a = Math.max(0, Math.min(i.length, t));
|
|
23676
|
-
return a === r.index ? n : (i.splice(a, 0, r.layer), r.parent ?
|
|
23705
|
+
return a === r.index ? n : (i.splice(a, 0, r.layer), r.parent ? Ra(n, r.parent.id, { children: i }) : i);
|
|
23677
23706
|
});
|
|
23678
23707
|
}, [X]), It = M((e) => {
|
|
23679
|
-
re(e), ae(
|
|
23708
|
+
re(e), ae(Fa(e).defaults), se(Pa), le(Pa), q(!1);
|
|
23680
23709
|
}, []), Lt = M((e) => {
|
|
23681
|
-
G(e),
|
|
23710
|
+
G(e), Fa(W).isSeed || (ae(Ia(W, e, K, Pa)), se(Pa), le(Pa));
|
|
23682
23711
|
}, [W, K]), Rt = M((e) => {
|
|
23683
23712
|
se((t) => t.map((t, n) => n === e ? !t : t));
|
|
23684
23713
|
}, []), zt = M((e, t) => {
|
|
23685
23714
|
ae((n) => n.map((n, r) => r === e ? t : n)), We && e === 0 || le((t) => t.map((t, n) => n === e ? !0 : t));
|
|
23686
23715
|
}, [We]), Bt = M(() => {
|
|
23687
|
-
let e =
|
|
23716
|
+
let e = Ia(W, ie, K, oe), t = e.map((e, t) => t).filter((e) => !oe[e]), n = t.map((t) => e[t]);
|
|
23688
23717
|
for (let e = n.length - 1; e > 0; e--) {
|
|
23689
23718
|
let t = Math.floor(Math.random() * (e + 1));
|
|
23690
23719
|
[n[e], n[t]] = [n[t], n[e]];
|
|
@@ -23700,9 +23729,9 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23700
23729
|
oe,
|
|
23701
23730
|
Ue
|
|
23702
23731
|
]), Vt = M(() => {
|
|
23703
|
-
se(
|
|
23732
|
+
se(Pa), ae(Fa(W).defaults), le(Pa), q(!1);
|
|
23704
23733
|
}, [W]), Ht = M(() => de((e) => !e), []), Ut = M((e) => {
|
|
23705
|
-
e && (e.poolId && re(e.poolId), e.modeId && G(e.modeId), Array.isArray(e.colors) && ae(e.colors), typeof e.bgEnabled == "boolean" && de(e.bgEnabled), se(
|
|
23734
|
+
e && (e.poolId && re(e.poolId), e.modeId && G(e.modeId), Array.isArray(e.colors) && ae(e.colors), typeof e.bgEnabled == "boolean" && de(e.bgEnabled), se(Pa), le(Pa), q(!1));
|
|
23706
23735
|
}, []), Wt = Oe.length > 0, Gt = Ae.length > 0, Kt = F(() => ({
|
|
23707
23736
|
selectedId: _e,
|
|
23708
23737
|
selectedIds: he,
|
|
@@ -23894,45 +23923,45 @@ function ro({ children: e, persistDraft: t = !0, draftKey: n = Oa }) {
|
|
|
23894
23923
|
Oe,
|
|
23895
23924
|
Ae
|
|
23896
23925
|
]);
|
|
23897
|
-
return /* @__PURE__ */ B(
|
|
23926
|
+
return /* @__PURE__ */ B(gn.Provider, {
|
|
23898
23927
|
value: Kt,
|
|
23899
23928
|
children: e
|
|
23900
23929
|
});
|
|
23901
23930
|
}
|
|
23902
|
-
function
|
|
23903
|
-
let e = N(
|
|
23931
|
+
function oo() {
|
|
23932
|
+
let e = N(gn);
|
|
23904
23933
|
if (!e) throw Error("useComposeState must be inside <ComposeStateProvider>");
|
|
23905
23934
|
return e;
|
|
23906
23935
|
}
|
|
23907
|
-
function
|
|
23936
|
+
function so(e, t) {
|
|
23908
23937
|
return !e || typeof e != "string" ? null : e.startsWith("palette:") ? t?.[e.slice(8)] ?? null : e;
|
|
23909
23938
|
}
|
|
23910
23939
|
//#endregion
|
|
23911
23940
|
//#region src/editor/params/controlSize.js
|
|
23912
|
-
var
|
|
23941
|
+
var co = j("sm"), lo = () => N(co), uo = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover:not(.is-active)]:text-[var(--kol-oq-48)]", fo = (e) => e === "sm" ? void 0 : uo, po = "var(--fxr-label-w, 112px)", mo = ".kol-compose-inspector-body, .kol-inspector-rail-body", ho = "[style*=\"--fxr-label-w\"]", go = (e) => {
|
|
23913
23942
|
let t = document.createRange();
|
|
23914
23943
|
return t.selectNodeContents(e), t.getBoundingClientRect().width;
|
|
23915
23944
|
};
|
|
23916
|
-
function
|
|
23917
|
-
for (let t of e.querySelectorAll(
|
|
23945
|
+
function _o(e = document) {
|
|
23946
|
+
for (let t of e.querySelectorAll(mo)) {
|
|
23918
23947
|
let e = t.style.getPropertyValue("--fxr-label-w");
|
|
23919
23948
|
t.style.removeProperty("--fxr-label-w");
|
|
23920
23949
|
let n = 0;
|
|
23921
|
-
for (let e of t.querySelectorAll(
|
|
23950
|
+
for (let e of t.querySelectorAll(ho)) e.closest(mo) === t && (n = Math.max(n, go(e)));
|
|
23922
23951
|
let r = t.querySelector("[data-label-scope]")?.dataset.labelScope ?? "";
|
|
23923
23952
|
t._labelScope === r && (n = Math.max(n, t._labelMax ?? 0)), t._labelScope = r, t._labelMax = n;
|
|
23924
23953
|
let i = n ? `${Math.min(112, Math.max(40, Math.ceil(n) + 4))}px` : "";
|
|
23925
23954
|
i ? t.style.setProperty("--fxr-label-w", i) : e && t.style.removeProperty("--fxr-label-w");
|
|
23926
23955
|
}
|
|
23927
23956
|
}
|
|
23928
|
-
function
|
|
23957
|
+
function vo() {
|
|
23929
23958
|
P(() => {
|
|
23930
23959
|
let e = 0, t = () => {
|
|
23931
23960
|
e ||= setTimeout(() => {
|
|
23932
|
-
e = 0,
|
|
23961
|
+
e = 0, _o();
|
|
23933
23962
|
}, 200);
|
|
23934
23963
|
}, n = new MutationObserver((e) => {
|
|
23935
|
-
e.some((e) => e.target.closest?.(
|
|
23964
|
+
e.some((e) => e.target.closest?.(mo)) && t();
|
|
23936
23965
|
});
|
|
23937
23966
|
return n.observe(document.body, {
|
|
23938
23967
|
childList: !0,
|
|
@@ -23944,7 +23973,7 @@ function go() {
|
|
|
23944
23973
|
}
|
|
23945
23974
|
//#endregion
|
|
23946
23975
|
//#region src/editor/params/easing.js
|
|
23947
|
-
var
|
|
23976
|
+
var yo = {
|
|
23948
23977
|
linear: [
|
|
23949
23978
|
0,
|
|
23950
23979
|
0,
|
|
@@ -23975,7 +24004,7 @@ var _o = {
|
|
|
23975
24004
|
.58,
|
|
23976
24005
|
1
|
|
23977
24006
|
]
|
|
23978
|
-
},
|
|
24007
|
+
}, bo = [
|
|
23979
24008
|
{
|
|
23980
24009
|
value: "linear",
|
|
23981
24010
|
label: "Linear"
|
|
@@ -24001,7 +24030,7 @@ var _o = {
|
|
|
24001
24030
|
label: "Hold"
|
|
24002
24031
|
}
|
|
24003
24032
|
];
|
|
24004
|
-
function
|
|
24033
|
+
function xo(e, t, n) {
|
|
24005
24034
|
if (n <= 0) return 0;
|
|
24006
24035
|
if (n >= 1) return 1;
|
|
24007
24036
|
let r = 3 * e, i = 3 * (t - e) - r, a = 1 - r - i, o = (e) => ((a * e + i) * e + r) * e, s = (e) => (3 * a * e + 2 * i) * e + r, c = n;
|
|
@@ -24014,29 +24043,29 @@ function yo(e, t, n) {
|
|
|
24014
24043
|
}
|
|
24015
24044
|
return c;
|
|
24016
24045
|
}
|
|
24017
|
-
function
|
|
24046
|
+
function So(e, t) {
|
|
24018
24047
|
if (e === "hold") return 0;
|
|
24019
|
-
let [n, r, i, a] = Array.isArray(e) ? e :
|
|
24048
|
+
let [n, r, i, a] = Array.isArray(e) ? e : yo[e] ?? yo.linear, o = xo(n, i, Math.min(1, Math.max(0, t))), s = 3 * r, c = 3 * (a - r) - s;
|
|
24020
24049
|
return (((1 - s - c) * o + c) * o + s) * o;
|
|
24021
24050
|
}
|
|
24022
24051
|
//#endregion
|
|
24023
24052
|
//#region src/editor/params/resolve.js
|
|
24024
|
-
function
|
|
24053
|
+
function Co(e) {
|
|
24025
24054
|
return typeof e == "object" && !!e && typeof e.bind == "string";
|
|
24026
24055
|
}
|
|
24027
|
-
function
|
|
24028
|
-
for (let t in e) if (
|
|
24056
|
+
function wo(e) {
|
|
24057
|
+
for (let t in e) if (Co(e[t])) return !0;
|
|
24029
24058
|
if (Array.isArray(e.filters)) for (let t of e.filters) {
|
|
24030
24059
|
let e = t?.params;
|
|
24031
24060
|
if (e) {
|
|
24032
|
-
for (let t in e) if (
|
|
24061
|
+
for (let t in e) if (Co(e[t])) return !0;
|
|
24033
24062
|
}
|
|
24034
24063
|
}
|
|
24035
24064
|
return !1;
|
|
24036
24065
|
}
|
|
24037
|
-
function
|
|
24066
|
+
function To(e) {
|
|
24038
24067
|
if (!e?.length) return e;
|
|
24039
|
-
let t =
|
|
24068
|
+
let t = ko(e, 0), n = e.filter((e) => e.t > 0 && e.t < 1);
|
|
24040
24069
|
return [
|
|
24041
24070
|
{
|
|
24042
24071
|
...e.find((e) => e.t <= 0) ?? {
|
|
@@ -24054,31 +24083,31 @@ function Co(e) {
|
|
|
24054
24083
|
}
|
|
24055
24084
|
];
|
|
24056
24085
|
}
|
|
24057
|
-
function
|
|
24058
|
-
if (!
|
|
24059
|
-
if (e.bind === "track") return
|
|
24060
|
-
if (e.bind === "mod") return
|
|
24086
|
+
function Eo(e, t, n) {
|
|
24087
|
+
if (!Co(e)) return e;
|
|
24088
|
+
if (e.bind === "track") return ko(n?.morph?.syncLoop ? To(e.keys) : e.keys, t?.t ?? 0);
|
|
24089
|
+
if (e.bind === "mod") return Po(e, t, n);
|
|
24061
24090
|
}
|
|
24062
|
-
function
|
|
24063
|
-
if (!
|
|
24091
|
+
function Do(e, t) {
|
|
24092
|
+
if (!wo(e)) return e;
|
|
24064
24093
|
let n = { ...e };
|
|
24065
|
-
for (let r in e)
|
|
24094
|
+
for (let r in e) Co(e[r]) && (n[r] = Eo(e[r], t, e));
|
|
24066
24095
|
return Array.isArray(e.filters) && (n.filters = e.filters.map((n) => {
|
|
24067
24096
|
let r = n?.params;
|
|
24068
24097
|
if (!r) return n;
|
|
24069
24098
|
let i = !1, a = { ...r };
|
|
24070
|
-
for (let n in r)
|
|
24099
|
+
for (let n in r) Co(r[n]) && (a[n] = Eo(r[n], t, e), i = !0);
|
|
24071
24100
|
return i ? {
|
|
24072
24101
|
...n,
|
|
24073
24102
|
params: a
|
|
24074
24103
|
} : n;
|
|
24075
24104
|
})), n;
|
|
24076
24105
|
}
|
|
24077
|
-
function
|
|
24106
|
+
function Oo(e, t) {
|
|
24078
24107
|
return e.map((e) => {
|
|
24079
|
-
let n =
|
|
24108
|
+
let n = Do(e, t);
|
|
24080
24109
|
if (Array.isArray(e.children)) {
|
|
24081
|
-
let r =
|
|
24110
|
+
let r = Oo(e.children, t);
|
|
24082
24111
|
return r.some((t, n) => t !== e.children[n]) || n !== e ? {
|
|
24083
24112
|
...n,
|
|
24084
24113
|
children: r
|
|
@@ -24087,27 +24116,27 @@ function Eo(e, t) {
|
|
|
24087
24116
|
return n;
|
|
24088
24117
|
});
|
|
24089
24118
|
}
|
|
24090
|
-
function
|
|
24119
|
+
function ko(e, t) {
|
|
24091
24120
|
if (!e || e.length === 0) return;
|
|
24092
24121
|
if (e.length === 1 || t <= e[0].t) return e[0].v;
|
|
24093
24122
|
let n = e[e.length - 1];
|
|
24094
24123
|
if (t >= n.t) return n.v;
|
|
24095
24124
|
let r = 0;
|
|
24096
24125
|
for (; r < e.length - 1 && e[r + 1].t <= t;) r++;
|
|
24097
|
-
let i = e[r], a = e[r + 1], o = a.t - i.t || 1, s =
|
|
24098
|
-
return
|
|
24126
|
+
let i = e[r], a = e[r + 1], o = a.t - i.t || 1, s = So(i.easing, (t - i.t) / o);
|
|
24127
|
+
return jo(i.v, a.v, s);
|
|
24099
24128
|
}
|
|
24100
|
-
var
|
|
24101
|
-
function
|
|
24129
|
+
var Ao = /^#[0-9a-f]{6}$/i;
|
|
24130
|
+
function jo(e, t, n) {
|
|
24102
24131
|
if (typeof e == "number" && typeof t == "number") return e + (t - e) * n;
|
|
24103
|
-
if (typeof e == "string" && typeof t == "string" &&
|
|
24132
|
+
if (typeof e == "string" && typeof t == "string" && Ao.test(e) && Ao.test(t)) {
|
|
24104
24133
|
let r = parseInt(e.slice(1), 16), i = parseInt(t.slice(1), 16), a = (e) => Math.round((r >> e & 255) + ((i >> e & 255) - (r >> e & 255)) * n);
|
|
24105
24134
|
return `#${(a(16) << 16 | a(8) << 8 | a(0)).toString(16).padStart(6, "0")}`;
|
|
24106
24135
|
}
|
|
24107
24136
|
return e;
|
|
24108
24137
|
}
|
|
24109
|
-
var
|
|
24110
|
-
function
|
|
24138
|
+
var Mo = /* @__PURE__ */ new WeakMap(), No = () => /* @__PURE__ */ new WeakMap();
|
|
24139
|
+
function Po(e, t, n) {
|
|
24111
24140
|
let r = e.transform, i = vt(e.source, t, {
|
|
24112
24141
|
transform: r,
|
|
24113
24142
|
layer: n
|
|
@@ -24115,7 +24144,7 @@ function Mo(e, t, n) {
|
|
|
24115
24144
|
r?.invert && (i = 1 - i);
|
|
24116
24145
|
let a = r?.smooth;
|
|
24117
24146
|
if (a > 0) {
|
|
24118
|
-
let n = t?.smoothState ??
|
|
24147
|
+
let n = t?.smoothState ?? Mo, r = n.get(e);
|
|
24119
24148
|
i = r == null ? i : r + (i - r) * (1 - Math.min(.95, a)), n.set(e, i);
|
|
24120
24149
|
}
|
|
24121
24150
|
let o = r?.curve;
|
|
@@ -24125,7 +24154,7 @@ function Mo(e, t, n) {
|
|
|
24125
24154
|
}
|
|
24126
24155
|
//#endregion
|
|
24127
24156
|
//#region src/editor/compose/inspectors/ColorField.jsx
|
|
24128
|
-
var
|
|
24157
|
+
var Fo = [
|
|
24129
24158
|
{
|
|
24130
24159
|
value: "palette:primary",
|
|
24131
24160
|
label: "Primary"
|
|
@@ -24151,8 +24180,8 @@ var No = [
|
|
|
24151
24180
|
label: "Background"
|
|
24152
24181
|
}
|
|
24153
24182
|
];
|
|
24154
|
-
function
|
|
24155
|
-
let f =
|
|
24183
|
+
function Io({ value: e, onChange: t, palette: n, label: i = "Color", hideLabel: s = !1, autoValue: c = null, inline: d = !1 }) {
|
|
24184
|
+
let f = lo(), p = typeof e == "string" && e.startsWith("palette:"), m = e == null, h = typeof e == "string" && e.startsWith("var("), g = so(e, n) ?? "#FFFFFF", _ = m ? "None" : h ? "Theme" : p ? Fo.find((t) => t.value === e)?.label ?? e : g.toUpperCase(), v = i === "Stroke", y = m || h ? "" : g.replace(/^#/, "").toUpperCase(), [b, x] = L(y);
|
|
24156
24185
|
P(() => {
|
|
24157
24186
|
x(y);
|
|
24158
24187
|
}, [y]);
|
|
@@ -24179,8 +24208,8 @@ function Po({ value: e, onChange: t, palette: n, label: i = "Color", hideLabel:
|
|
|
24179
24208
|
className: "flex flex-col gap-2",
|
|
24180
24209
|
children: [/* @__PURE__ */ B("div", {
|
|
24181
24210
|
className: "grid grid-cols-6 gap-1",
|
|
24182
|
-
children:
|
|
24183
|
-
hex:
|
|
24211
|
+
children: Fo.map((r) => /* @__PURE__ */ B(o, {
|
|
24212
|
+
hex: so(r.value, n) ?? "#000000",
|
|
24184
24213
|
size: "fill",
|
|
24185
24214
|
selected: e === r.value,
|
|
24186
24215
|
title: r.label,
|
|
@@ -24248,7 +24277,7 @@ function Po({ value: e, onChange: t, palette: n, label: i = "Color", hideLabel:
|
|
|
24248
24277
|
}
|
|
24249
24278
|
//#endregion
|
|
24250
24279
|
//#region src/editor/compose/inspectors/NumberField.jsx
|
|
24251
|
-
function
|
|
24280
|
+
function Lo({ value: e, onCommit: t, ...n }) {
|
|
24252
24281
|
let [r, i] = L(String(e));
|
|
24253
24282
|
return P(() => {
|
|
24254
24283
|
i(String(e));
|
|
@@ -24270,13 +24299,13 @@ function Fo({ value: e, onCommit: t, ...n }) {
|
|
|
24270
24299
|
}
|
|
24271
24300
|
//#endregion
|
|
24272
24301
|
//#region src/editor/color/palette.js
|
|
24273
|
-
var
|
|
24302
|
+
var Ro = [
|
|
24274
24303
|
"bg",
|
|
24275
24304
|
"fg",
|
|
24276
24305
|
"accent",
|
|
24277
24306
|
"dim",
|
|
24278
24307
|
"warm"
|
|
24279
|
-
],
|
|
24308
|
+
], zo = [
|
|
24280
24309
|
...c.map((e) => ({
|
|
24281
24310
|
id: e.id,
|
|
24282
24311
|
label: e.label
|
|
@@ -24289,7 +24318,7 @@ var Io = [
|
|
|
24289
24318
|
id: "random",
|
|
24290
24319
|
label: "Random"
|
|
24291
24320
|
}
|
|
24292
|
-
],
|
|
24321
|
+
], Bo = (e) => ({
|
|
24293
24322
|
id: `theme:${e.id}`,
|
|
24294
24323
|
name: e.label,
|
|
24295
24324
|
source: "theme",
|
|
@@ -24308,54 +24337,54 @@ var Io = [
|
|
|
24308
24337
|
e.warm ?? e.accent
|
|
24309
24338
|
]
|
|
24310
24339
|
});
|
|
24311
|
-
function
|
|
24340
|
+
function Vo(e, { id: t, name: n, source: r }) {
|
|
24312
24341
|
return {
|
|
24313
24342
|
id: t,
|
|
24314
24343
|
name: n,
|
|
24315
24344
|
source: r,
|
|
24316
24345
|
colors: e,
|
|
24317
|
-
roles:
|
|
24346
|
+
roles: Jo(e)
|
|
24318
24347
|
};
|
|
24319
24348
|
}
|
|
24320
|
-
var
|
|
24349
|
+
var Ho = () => {
|
|
24321
24350
|
try {
|
|
24322
24351
|
return JSON.parse(localStorage.getItem("kol.editor.swatches") ?? "[]");
|
|
24323
24352
|
} catch {
|
|
24324
24353
|
return [];
|
|
24325
24354
|
}
|
|
24326
24355
|
};
|
|
24327
|
-
function
|
|
24328
|
-
let t =
|
|
24356
|
+
function Uo(e = {}) {
|
|
24357
|
+
let t = Ho().map((e) => typeof e == "string" ? e : e?.hex).filter(Boolean);
|
|
24329
24358
|
return [
|
|
24330
|
-
...Wt.map(
|
|
24331
|
-
...t.length >= 2 ? [
|
|
24359
|
+
...Wt.map(Bo),
|
|
24360
|
+
...t.length >= 2 ? [Vo(t, {
|
|
24332
24361
|
id: "swatches",
|
|
24333
24362
|
name: "Swatches",
|
|
24334
24363
|
source: "editor"
|
|
24335
24364
|
})] : [],
|
|
24336
|
-
...(e.palette ?? []).filter((e) => Array.isArray(e.colors) && e.colors.length).map((e) =>
|
|
24365
|
+
...(e.palette ?? []).filter((e) => Array.isArray(e.colors) && e.colors.length).map((e) => Vo(e.colors.map((e) => typeof e == "string" ? e : e.hex), {
|
|
24337
24366
|
id: e.id,
|
|
24338
24367
|
name: e.name || "Palette",
|
|
24339
24368
|
source: "local"
|
|
24340
24369
|
}))
|
|
24341
24370
|
];
|
|
24342
24371
|
}
|
|
24343
|
-
var
|
|
24372
|
+
var Wo = (e, t, n) => {
|
|
24344
24373
|
let r = t * Math.cos(n * Math.PI / 180), i = t * Math.sin(n * Math.PI / 180), a = (e + .3963377774 * r + .2158037573 * i) ** 3, o = (e - .1055613458 * r - .0638541728 * i) ** 3, s = (e - .0894841775 * r - 1.291485548 * i) ** 3;
|
|
24345
24374
|
return [
|
|
24346
24375
|
4.0767416621 * a - 3.3077115913 * o + .2309699292 * s,
|
|
24347
24376
|
-1.2684380046 * a + 2.6097574011 * o - .3413193965 * s,
|
|
24348
24377
|
-.0041960863 * a - .7034186147 * o + 1.707614701 * s
|
|
24349
24378
|
];
|
|
24350
|
-
},
|
|
24351
|
-
function
|
|
24352
|
-
let r = 0, i = t, a =
|
|
24353
|
-
if (!
|
|
24379
|
+
}, Go = (e) => e.every((e) => e >= -1e-4 && e <= 1.0001);
|
|
24380
|
+
function Ko(e, t, n) {
|
|
24381
|
+
let r = 0, i = t, a = Wo(e, t, n);
|
|
24382
|
+
if (!Go(a)) {
|
|
24354
24383
|
for (let t = 0; t < 20; t++) {
|
|
24355
24384
|
let t = (r + i) / 2;
|
|
24356
|
-
|
|
24385
|
+
Go(Wo(e, t, n)) ? r = t : i = t;
|
|
24357
24386
|
}
|
|
24358
|
-
a =
|
|
24387
|
+
a = Wo(e, r, n);
|
|
24359
24388
|
}
|
|
24360
24389
|
let o = (e) => {
|
|
24361
24390
|
let t = Math.min(1, Math.max(0, e));
|
|
@@ -24363,7 +24392,7 @@ function Wo(e, t, n) {
|
|
|
24363
24392
|
};
|
|
24364
24393
|
return "#" + a.map((e) => o(e).toString(16).padStart(2, "0")).join("");
|
|
24365
24394
|
}
|
|
24366
|
-
function
|
|
24395
|
+
function qo(e) {
|
|
24367
24396
|
let [t, n, r] = [
|
|
24368
24397
|
1,
|
|
24369
24398
|
3,
|
|
@@ -24375,9 +24404,9 @@ function Go(e) {
|
|
|
24375
24404
|
(Math.atan2(l, c) * 180 / Math.PI + 360) % 360
|
|
24376
24405
|
];
|
|
24377
24406
|
}
|
|
24378
|
-
function
|
|
24407
|
+
function Jo(e) {
|
|
24379
24408
|
let t = e.map((e, t) => {
|
|
24380
|
-
let [n, r] =
|
|
24409
|
+
let [n, r] = qo(e);
|
|
24381
24410
|
return {
|
|
24382
24411
|
hex: e,
|
|
24383
24412
|
i: t,
|
|
@@ -24393,9 +24422,9 @@ function Ko(e) {
|
|
|
24393
24422
|
warm: u.hex
|
|
24394
24423
|
};
|
|
24395
24424
|
}
|
|
24396
|
-
var
|
|
24397
|
-
function
|
|
24398
|
-
let i = Math.min(8, Math.max(2, Math.round(r))), [a, o, s] =
|
|
24425
|
+
var Yo = (e) => [...new Set(c.find((t) => t.id === e)?.roleOffsets ?? [0])];
|
|
24426
|
+
function Xo(e, { base: t, relation: n = "analogous", count: r = 5 }) {
|
|
24427
|
+
let i = Math.min(8, Math.max(2, Math.round(r))), [a, o, s] = qo(t), c = Math.min(.2, Math.max(.06, o)) * (.85 + e() * .3), l = n === "monochromatic" ? [0] : Yo(n), u = (t) => n === "random" ? e() * 360 : s + l[t % l.length], d = [t.toLowerCase()], f = i - 1;
|
|
24399
24428
|
for (let t = 0; t < f; t++) {
|
|
24400
24429
|
let n = u(t + 1), r, o;
|
|
24401
24430
|
if (i >= 3 && t === 0) r = .14 + e() * .05, o = c * .3;
|
|
@@ -24405,23 +24434,23 @@ function Jo(e, { base: t, relation: n = "analogous", count: r = 5 }) {
|
|
|
24405
24434
|
let n = f - 2, i = t - 2;
|
|
24406
24435
|
r = .4 + (n === 1 ? .25 : .4 * i / (n - 1)) + (e() - .5) * .06, o = c * (.7 + e() * .3);
|
|
24407
24436
|
}
|
|
24408
|
-
d.push(
|
|
24437
|
+
d.push(Ko(r, o, n));
|
|
24409
24438
|
}
|
|
24410
24439
|
return d;
|
|
24411
24440
|
}
|
|
24412
|
-
var
|
|
24441
|
+
var Zo = (e) => {
|
|
24413
24442
|
let t = [
|
|
24414
24443
|
1,
|
|
24415
24444
|
3,
|
|
24416
24445
|
5
|
|
24417
24446
|
].map((t) => parseInt(e.slice(t, t + 2), 16) / 255).map((e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4);
|
|
24418
24447
|
return .2126 * t[0] + .7152 * t[1] + .0722 * t[2];
|
|
24419
|
-
},
|
|
24420
|
-
let [n, r] = [
|
|
24448
|
+
}, Qo = (e, t) => {
|
|
24449
|
+
let [n, r] = [Zo(e), Zo(t)].sort((e, t) => t - e);
|
|
24421
24450
|
return (n + .05) / (r + .05);
|
|
24422
24451
|
};
|
|
24423
|
-
function
|
|
24424
|
-
let n = t ??
|
|
24452
|
+
function $o(e, t) {
|
|
24453
|
+
let n = t ?? zo[Math.floor(e() * zo.length)].id, r = e() * 360, i = .09 + e() * .1, a = .62 + e() * .08, o = e() < .7, s;
|
|
24425
24454
|
s = n === "monochromatic" ? [
|
|
24426
24455
|
,
|
|
24427
24456
|
,
|
|
@@ -24433,11 +24462,11 @@ function Zo(e, t) {
|
|
|
24433
24462
|
lightness: 55
|
|
24434
24463
|
}).map((e) => x(e).h);
|
|
24435
24464
|
let [c, l, u, d, f] = s, p = {
|
|
24436
|
-
bg:
|
|
24437
|
-
fg:
|
|
24438
|
-
accent:
|
|
24439
|
-
dim:
|
|
24440
|
-
warm:
|
|
24465
|
+
bg: Ko(o ? .14 + e() * .05 : .95 + e() * .03, i * .25, c),
|
|
24466
|
+
fg: Ko(o ? .93 + e() * .04 : .2 + e() * .05, i * .2, l ?? c),
|
|
24467
|
+
accent: Ko(a, i, u ?? c),
|
|
24468
|
+
dim: Ko(o ? .4 + e() * .06 : .74 + e() * .06, i * .6, d ?? c),
|
|
24469
|
+
warm: Ko(o ? a + .1 : a - .1, i, f ?? c)
|
|
24441
24470
|
};
|
|
24442
24471
|
return {
|
|
24443
24472
|
id: "rolled",
|
|
@@ -24445,18 +24474,18 @@ function Zo(e, t) {
|
|
|
24445
24474
|
source: "generated",
|
|
24446
24475
|
relation: n,
|
|
24447
24476
|
roles: p,
|
|
24448
|
-
colors:
|
|
24449
|
-
contrastOk:
|
|
24477
|
+
colors: Ro.map((e) => p[e]),
|
|
24478
|
+
contrastOk: Qo(p.bg, p.fg) >= 4.5
|
|
24450
24479
|
};
|
|
24451
24480
|
}
|
|
24452
|
-
function
|
|
24481
|
+
function es(e, t, n, { rotate: r = !1 } = {}) {
|
|
24453
24482
|
let i = { ...e }, a = 0;
|
|
24454
24483
|
for (let e of t || []) e?.type === "color" && (e.role && n.roles?.[e.role] ? i[e.key] = n.roles[e.role] : r && n.colors?.length && (i[e.key] = n.colors[a++ % n.colors.length]));
|
|
24455
24484
|
return i;
|
|
24456
24485
|
}
|
|
24457
24486
|
//#endregion
|
|
24458
24487
|
//#region src/editor/lib/rng.js
|
|
24459
|
-
function
|
|
24488
|
+
function ts(e) {
|
|
24460
24489
|
let t = e >>> 0;
|
|
24461
24490
|
return function() {
|
|
24462
24491
|
t |= 0, t = t + 1831565813 | 0;
|
|
@@ -24464,10 +24493,10 @@ function $o(e) {
|
|
|
24464
24493
|
return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
24465
24494
|
};
|
|
24466
24495
|
}
|
|
24467
|
-
function
|
|
24496
|
+
function ns() {
|
|
24468
24497
|
return Math.floor(Math.random() * 1e9);
|
|
24469
24498
|
}
|
|
24470
|
-
function
|
|
24499
|
+
function rs(e, t) {
|
|
24471
24500
|
let n = {};
|
|
24472
24501
|
if (!Array.isArray(e)) return n;
|
|
24473
24502
|
let r = null, i = 0;
|
|
@@ -24484,11 +24513,11 @@ function ts(e, t) {
|
|
|
24484
24513
|
if (!e.length) continue;
|
|
24485
24514
|
let r = e[Math.floor(t() * e.length)];
|
|
24486
24515
|
n[a.key] = r && typeof r == "object" ? r.value : r;
|
|
24487
|
-
} else a.type === "toggle" || a.type === "boolean" ? n[a.key] = t() > .5 : a.type === "color" && (r ??=
|
|
24516
|
+
} else a.type === "toggle" || a.type === "boolean" ? n[a.key] = t() > .5 : a.type === "color" && (r ??= $o(t), n[a.key] = a.role && r.roles[a.role] || r.colors[i++ % r.colors.length]);
|
|
24488
24517
|
}
|
|
24489
24518
|
return n;
|
|
24490
24519
|
}
|
|
24491
|
-
function
|
|
24520
|
+
function is(e, t) {
|
|
24492
24521
|
let n = { ...e };
|
|
24493
24522
|
for (let [r, i] of Object.entries(t)) {
|
|
24494
24523
|
let t = e?.[r];
|
|
@@ -24498,55 +24527,55 @@ function ns(e, t) {
|
|
|
24498
24527
|
}
|
|
24499
24528
|
//#endregion
|
|
24500
24529
|
//#region src/editor/params/rolls.jsx
|
|
24501
|
-
var
|
|
24530
|
+
var as = new Set([
|
|
24502
24531
|
"Motion",
|
|
24503
24532
|
"Frame",
|
|
24504
24533
|
"Form"
|
|
24505
|
-
]),
|
|
24506
|
-
[
|
|
24534
|
+
]), os = new Set(["theme", "invert"]), ss = "__color", cs = {
|
|
24535
|
+
[ss]: "Color",
|
|
24507
24536
|
Frame: "Motion Frame",
|
|
24508
24537
|
Form: "Motion Form"
|
|
24509
24538
|
};
|
|
24510
|
-
function
|
|
24539
|
+
function ls(e, t) {
|
|
24511
24540
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
24512
|
-
for (let i of
|
|
24513
|
-
if (
|
|
24514
|
-
let e = i.type === "color" ?
|
|
24541
|
+
for (let i of Ni(e ?? [], t)) {
|
|
24542
|
+
if (os.has(i.key)) continue;
|
|
24543
|
+
let e = i.type === "color" ? ss : i.section;
|
|
24515
24544
|
if (!e) continue;
|
|
24516
|
-
let t =
|
|
24545
|
+
let t = cs[e] ?? e, a = r.get(t);
|
|
24517
24546
|
a || (a = {
|
|
24518
24547
|
id: e,
|
|
24519
24548
|
label: t,
|
|
24520
|
-
motion:
|
|
24549
|
+
motion: as.has(e),
|
|
24521
24550
|
params: []
|
|
24522
24551
|
}, r.set(t, a), n.push(a)), a.params.push(i);
|
|
24523
24552
|
}
|
|
24524
24553
|
return n;
|
|
24525
24554
|
}
|
|
24526
|
-
function
|
|
24555
|
+
function $(e, t) {
|
|
24527
24556
|
let n = new Set(t.map((e) => e.key)), r = (e) => e.params.length === n.size && e.params.every((e) => n.has(e.key)), i = e.filter((e) => !r(e));
|
|
24528
24557
|
return i.length || t.length < 2 || t.length > 6 ? i : t.map((e) => ({
|
|
24529
24558
|
id: e.key,
|
|
24530
24559
|
label: e.label,
|
|
24531
|
-
motion:
|
|
24560
|
+
motion: as.has(e.section),
|
|
24532
24561
|
params: [e]
|
|
24533
24562
|
}));
|
|
24534
24563
|
}
|
|
24535
|
-
var
|
|
24564
|
+
var us = (e) => !as.has(e) && e !== "Camera", ds = (e) => {
|
|
24536
24565
|
let t = he().rollScopes?.[e];
|
|
24537
|
-
return typeof t == "boolean" ? t :
|
|
24538
|
-
},
|
|
24566
|
+
return typeof t == "boolean" ? t : us(e);
|
|
24567
|
+
}, fs = (e, t) => ge("rollScopes", {
|
|
24539
24568
|
...he().rollScopes ?? {},
|
|
24540
24569
|
[e]: !!t
|
|
24541
|
-
}),
|
|
24542
|
-
function
|
|
24543
|
-
return
|
|
24570
|
+
}), ps = () => he().rollEffects !== !1;
|
|
24571
|
+
function ms(e, t) {
|
|
24572
|
+
return Ni(e ?? [], t).filter((e) => !os.has(e.key) && ds(e.type === "color" ? ss : e.section));
|
|
24544
24573
|
}
|
|
24545
|
-
function
|
|
24574
|
+
function hs(e, t, n, { stripNoRandom: r = !1, withFilters: i = !1 } = {}) {
|
|
24546
24575
|
let a = r ? t.map((e) => e.noRandom ? {
|
|
24547
24576
|
...e,
|
|
24548
24577
|
noRandom: !1
|
|
24549
|
-
} : e) : t, o =
|
|
24578
|
+
} : e) : t, o = rs(a, ts(n >>> 0));
|
|
24550
24579
|
for (let t of a) {
|
|
24551
24580
|
if (t.type !== "range" || t.key in o) continue;
|
|
24552
24581
|
let n = e[t.key];
|
|
@@ -24557,49 +24586,49 @@ function ps(e, t, n, { stripNoRandom: r = !1, withFilters: i = !1 } = {}) {
|
|
|
24557
24586
|
let s = {};
|
|
24558
24587
|
for (let t of Object.keys(o)) s[t] = e[t];
|
|
24559
24588
|
let c = {
|
|
24560
|
-
...
|
|
24589
|
+
...is(s, o),
|
|
24561
24590
|
_rollSeed: n
|
|
24562
24591
|
};
|
|
24563
|
-
if (i &&
|
|
24564
|
-
let t =
|
|
24592
|
+
if (i && ps()) {
|
|
24593
|
+
let t = gs(e, n);
|
|
24565
24594
|
t && (c.filters = t);
|
|
24566
24595
|
}
|
|
24567
24596
|
return c;
|
|
24568
24597
|
}
|
|
24569
|
-
function
|
|
24570
|
-
let n =
|
|
24598
|
+
function gs(e, t) {
|
|
24599
|
+
let n = Ji(e);
|
|
24571
24600
|
if (!n.length) return null;
|
|
24572
|
-
let r =
|
|
24601
|
+
let r = ts(t + 2654435769 >>> 0);
|
|
24573
24602
|
return n.map(({ def: e, ...t }) => e ? {
|
|
24574
24603
|
...t,
|
|
24575
|
-
params:
|
|
24604
|
+
params: is(t.params, rs(e.params, r))
|
|
24576
24605
|
} : t);
|
|
24577
24606
|
}
|
|
24578
|
-
function
|
|
24607
|
+
function _s(e) {
|
|
24579
24608
|
let t = H("generators");
|
|
24580
24609
|
return t ? t.presetsInGroup(e.loopGroup).filter((n) => n.id !== e.presetId && !t.isToolPreset(n)) : [];
|
|
24581
24610
|
}
|
|
24582
|
-
function
|
|
24583
|
-
let n =
|
|
24611
|
+
function vs(e, t) {
|
|
24612
|
+
let n = _s(e);
|
|
24584
24613
|
if (!n.length) return null;
|
|
24585
|
-
let r = n[Math.floor(
|
|
24614
|
+
let r = n[Math.floor(ts(t >>> 0)() * n.length)];
|
|
24586
24615
|
return {
|
|
24587
24616
|
...H("generators").presetLayerPatch(r, e.loopGroup),
|
|
24588
24617
|
_rollSeed: t
|
|
24589
24618
|
};
|
|
24590
24619
|
}
|
|
24591
|
-
function
|
|
24620
|
+
function ys(e) {
|
|
24592
24621
|
let [t, n] = L(null);
|
|
24593
24622
|
return {
|
|
24594
24623
|
value: t ?? e?._rollSeed ?? 0,
|
|
24595
24624
|
commit: n,
|
|
24596
|
-
take: () => t == null ?
|
|
24625
|
+
take: () => t == null ? ns() : (n(null), t)
|
|
24597
24626
|
};
|
|
24598
24627
|
}
|
|
24599
|
-
function
|
|
24600
|
-
let n = /* @__PURE__ */ B(
|
|
24628
|
+
function bs({ seed: e, inline: t = !0 }) {
|
|
24629
|
+
let n = /* @__PURE__ */ B(Lo, {
|
|
24601
24630
|
variant: "filled",
|
|
24602
|
-
size:
|
|
24631
|
+
size: lo(),
|
|
24603
24632
|
chars: 10,
|
|
24604
24633
|
value: e.value,
|
|
24605
24634
|
onCommit: (t) => {
|
|
@@ -24610,7 +24639,7 @@ function vs({ seed: e, inline: t = !0 }) {
|
|
|
24610
24639
|
return t ? /* @__PURE__ */ B(f, {
|
|
24611
24640
|
label: "Seed",
|
|
24612
24641
|
align: "fill",
|
|
24613
|
-
labelWidth:
|
|
24642
|
+
labelWidth: po,
|
|
24614
24643
|
children: n
|
|
24615
24644
|
}) : /* @__PURE__ */ B(u, {
|
|
24616
24645
|
label: "Seed",
|
|
@@ -24618,4 +24647,4 @@ function vs({ seed: e, inline: t = !0 }) {
|
|
|
24618
24647
|
});
|
|
24619
24648
|
}
|
|
24620
24649
|
//#endregion
|
|
24621
|
-
export {
|
|
24650
|
+
export { aa as $, K as $n, Jn as $t, Oo as A, Ut as An, C as At, Ka as B, Y as Bn, Cr as Bt, Bo as C, Yt as Cn, ui as Ct, Co as D, Pt as Dn, Gr as Dt, wo as E, Kt as En, Jr as Et, po as F, ct as Fn, O as Ft, ro as G, ve as Gn, ar as Gt, Ja as H, Ie as Hn, Tr as Ht, fo as I, rt as In, k as It, oo as J, U as Jn, tr as Jt, $a as K, be as Kn, ir as Kt, lo as L, st as Ln, Nr as Lt, yo as M, gt as Mn, T as Mt, bo as N, _t as Nn, E as Nt, No as O, zt as On, y as Ot, co as P, pt as Pn, D as Pt, xa as Q, re as Qn, Yn as Qt, vo as R, Je as Rn, kr as Rt, $o as S, Xt as Sn, di as St, Io as T, qt as Tn, ti as Tt, ao as U, he as Un, fr as Ut, ka as V, Fe as Vn, wr as Vt, Za as W, ge as Wn, dr as Wt, Ta as X, ne as Xn, Xn as Xt, ba as Y, W as Yn, Zn as Yt, ya as Z, G as Zn, qn as Zt, Jo as _, un as _n, Oi as _t, hs as a, Ln as an, ra as at, Ko as b, Zt as bn, mi as bt, ds as c, hn as cn, Yi as ct, ys as d, sn as dn, Xi as dt, Kn as en, H as er, sa as et, ts as f, ln as fn, Ji as ft, Uo as g, cn as gn, Ni as gt, Ro as h, pn as hn, Ii as ht, vs as i, Fn as in, oa as it, Eo as j, Ht as jn, w as jt, Do as k, Rt as kn, S as kt, fs as l, en as ln, Zi as lt, zo as m, mn, Li as mt, ms as n, zn as nn, ea as nt, ls as o, _n as on, ia as ot, ns as p, fn as pn, Fi as pt, so as q, le as qn, er as qt, gs as r, In as rn, la as rt, ps as s, vn as sn, qi as st, bs as t, Rn as tn, te as tr, na as tt, $ as u, an as un, Qi as ut, Qo as v, on as vn, vi as vt, Lo as w, Gt as wn, Hr as wt, es as x, Qt as xn, pi as xt, Xo as y, dn as yn, ji as yt, qa as z, Le as zn, Or as zt };
|