@kolkrabbi/design-editor 0.35.0 → 0.37.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-Don6fG00.js → BindDot-dBz2NUVr.js} +5 -5
- package/dist/{Timeline-Cz-W72D0.js → Timeline-BDMxiVYe.js} +31 -31
- package/dist/{TreePicker-1_NZG8GB.js → TreePicker-BawzFyzV.js} +4 -4
- package/dist/{core-DJet1D7E.js → core-d8m3o_mg.js} +4382 -4379
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +1204 -1236
- package/dist/{effectCategories-DV7i_AgK.js → effectCategories-D1t5Vdqf.js} +696 -696
- package/dist/{effects-Dn4_OzYx.js → effects-BFAtGRPu.js} +126 -126
- package/dist/effects.js +1 -1
- package/dist/{generators-Bf08F0NV.js → generators-JkPVwcTT.js} +1439 -1439
- package/dist/generators.js +1 -1
- package/dist/{host-BUVR9I4S.js → host-C3_Oy1ck.js} +1 -1
- package/dist/{host-CRRiwlrB.js → host-CsF4CKfw.js} +22 -22
- package/dist/{morphStore-B5081ohW.js → morphStore-CidzL7wV.js} +1 -1
- package/dist/{motion-Cuwxm2ic.js → motion-KvPCj1EZ.js} +534 -533
- package/dist/motion.js +1 -1
- package/dist/{previewScale-CA0ComGv.js → previewScale-BAmIBoWY.js} +1 -1
- package/dist/{rolls-CEQmdcp3.js → rolls-5hhrWX96.js} +1501 -1312
- package/dist/{src-CzKMsyZO.js → src-8EvSuuNG.js} +1 -1
- package/dist/{store-DZUWPE2s.js → store-QnsWv-26.js} +448 -448
- package/dist/{useLayerEdit-Cmtx3V3O.js → useLayerEdit-BikuFIoi.js} +118 -119
- package/package.json +8 -8
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Bt as e, D as t, F as n, Ht as r,
|
|
2
|
-
import { c as
|
|
3
|
-
import { i as
|
|
4
|
-
import { BezierPathEditor as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { IconLoader as
|
|
1
|
+
import { Bt as e, D as t, F as n, Ht as r, Jn as i, L as a, On as o, Qn as s, T as c, Tn as l, Ut as u, Vt as d, Wt as f, Xn as p, _n as m, d as h, dn as g, f as _, gn as v, hn as y, ln as b, pn as x, q as S, t as ee, tr as C, un as te, wn as w } from "./rolls-5hhrWX96.js";
|
|
2
|
+
import { c as T, d as E, f as ne, i as D, l as re, o as ie, r as ae, s as oe, u as se } from "./TreePicker-BawzFyzV.js";
|
|
3
|
+
import { i as O, t as k } from "./Timeline-BDMxiVYe.js";
|
|
4
|
+
import { BezierPathEditor as ce, ButtonGroup as le, Input as ue, MenuDropdownItem as de, PopoverPanel as A, ToggleCheckbox as fe, Tooltip as j, glyphSize as pe, usePopover as me } from "@kolkrabbi/kol-component";
|
|
5
|
+
import { Fragment as he, useEffect as ge, useState as M } from "react";
|
|
6
|
+
import { Fragment as _e, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
7
|
+
import { IconLoader as ve } from "@kolkrabbi/kol-icons";
|
|
8
8
|
//#region src/kinetic/paths.js
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var F = Math.PI * 2, I = (e) => Math.round(e * 100) / 100;
|
|
10
|
+
function ye(e) {
|
|
11
11
|
return e.map((e, t) => `${t === 0 ? "M" : "L"} ${I(e[0])} ${I(e[1])}`).join(" ");
|
|
12
12
|
}
|
|
13
|
-
var
|
|
13
|
+
var be = [
|
|
14
14
|
[.12, .55],
|
|
15
15
|
[.37, .32],
|
|
16
16
|
[.63, .68],
|
|
17
17
|
[.88, .45]
|
|
18
18
|
];
|
|
19
|
-
function
|
|
19
|
+
function xe(e, t, n) {
|
|
20
20
|
let r = e.map(([e, r]) => [e * t, r * n]);
|
|
21
21
|
if (r.length < 2) return `M ${I(t / 2)} ${I(n / 2)} L ${I(t / 2 + 1)} ${I(n / 2)}`;
|
|
22
22
|
let i = `M ${I(r[0][0])} ${I(r[0][1])}`;
|
|
@@ -26,7 +26,7 @@ function be(e, t, n) {
|
|
|
26
26
|
}
|
|
27
27
|
return i;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
29
|
+
var Se = (e) => e === "array", Ce = (e) => e === "radial", we = (e) => e === "rings", Te = {
|
|
30
30
|
amp: .4,
|
|
31
31
|
freq: 2,
|
|
32
32
|
turns: 3,
|
|
@@ -39,8 +39,8 @@ var xe = (e) => e === "array", Se = (e) => e === "radial", Ce = (e) => e === "ri
|
|
|
39
39
|
twist: .5,
|
|
40
40
|
grow: .6
|
|
41
41
|
};
|
|
42
|
-
function
|
|
43
|
-
let i = t / 2, a = n / 2, o = Math.min(t, n) * .12, s = r.amp ??
|
|
42
|
+
function Ee(e, t, n, r = {}) {
|
|
43
|
+
let i = t / 2, a = n / 2, o = Math.min(t, n) * .12, s = r.amp ?? Te.amp, c = Math.max(1, Math.round(r.freq ?? Te.freq)), l = Math.max(1, Math.round(r.turns ?? Te.turns)), u = r.radius ?? Te.radius;
|
|
44
44
|
switch (e) {
|
|
45
45
|
case "arc": {
|
|
46
46
|
let e = n * .62, r = e - s * n * .7;
|
|
@@ -67,21 +67,21 @@ function we(e, t, n, r = {}) {
|
|
|
67
67
|
let e = [];
|
|
68
68
|
for (let r = 0; r <= 120; r++) {
|
|
69
69
|
let i = r / 120;
|
|
70
|
-
e.push([o + i * (t - 2 * o), a + s * n * .32 * Math.sin(i * c *
|
|
70
|
+
e.push([o + i * (t - 2 * o), a + s * n * .32 * Math.sin(i * c * F)]);
|
|
71
71
|
}
|
|
72
72
|
return {
|
|
73
|
-
d:
|
|
73
|
+
d: ye(e),
|
|
74
74
|
closed: !1
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
case "spiral": {
|
|
78
78
|
let e = Math.min(t, n) * .45 * u, r = [];
|
|
79
79
|
for (let t = 0; t <= 420; t++) {
|
|
80
|
-
let n = t / 420, o = n * l *
|
|
80
|
+
let n = t / 420, o = n * l * F, s = n * e;
|
|
81
81
|
r.push([i + Math.cos(o) * s, a + Math.sin(o) * s]);
|
|
82
82
|
}
|
|
83
83
|
return {
|
|
84
|
-
d:
|
|
84
|
+
d: ye(r),
|
|
85
85
|
closed: !1
|
|
86
86
|
};
|
|
87
87
|
}
|
|
@@ -92,12 +92,12 @@ function we(e, t, n, r = {}) {
|
|
|
92
92
|
r.push([o + c * (t - 2 * o), a + (i % 2 == 0 ? -1 : 1) * s * n * .28]);
|
|
93
93
|
}
|
|
94
94
|
return {
|
|
95
|
-
d:
|
|
95
|
+
d: ye(r),
|
|
96
96
|
closed: !1
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
case "custom": return {
|
|
100
|
-
d:
|
|
100
|
+
d: xe(Array.isArray(r.points) && r.points.length >= 2 ? r.points : be, t, n),
|
|
101
101
|
closed: !1
|
|
102
102
|
};
|
|
103
103
|
default: {
|
|
@@ -111,7 +111,7 @@ function we(e, t, n, r = {}) {
|
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/kinetic/presets.js
|
|
114
|
-
var
|
|
114
|
+
var De = "#0b0d12", L = "#e8e4dc", R = {
|
|
115
115
|
text: "Kinetic",
|
|
116
116
|
font: "gullhamrar",
|
|
117
117
|
fontSize: 120,
|
|
@@ -134,7 +134,7 @@ var Te = "#0b0d12", Ee = "#e8e4dc", R = {
|
|
|
134
134
|
showPath: !1,
|
|
135
135
|
path: {
|
|
136
136
|
type: "line",
|
|
137
|
-
...
|
|
137
|
+
...Te
|
|
138
138
|
},
|
|
139
139
|
motion: {
|
|
140
140
|
mode: "none",
|
|
@@ -162,12 +162,12 @@ var Te = "#0b0d12", Ee = "#e8e4dc", R = {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
|
-
function
|
|
166
|
-
let n =
|
|
165
|
+
function Oe(e, t = {}) {
|
|
166
|
+
let n = T(e), r = oe(n);
|
|
167
167
|
for (let e of n.axes) t[e.tag] != null && (r[e.tag] = t[e.tag]);
|
|
168
168
|
return r;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function ke(e = {}, t = 0) {
|
|
171
171
|
let n = {
|
|
172
172
|
id: e.id || `i${t}`,
|
|
173
173
|
...R,
|
|
@@ -195,21 +195,21 @@ function Oe(e = {}, t = 0) {
|
|
|
195
195
|
vf2: { ...e.morph?.vf2 || {} }
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
return n.vf =
|
|
198
|
+
return n.vf = Oe(n.font, e.vf), n;
|
|
199
199
|
}
|
|
200
200
|
var z = (e) => ({
|
|
201
|
-
bg:
|
|
202
|
-
instances: [
|
|
201
|
+
bg: De,
|
|
202
|
+
instances: [ke({
|
|
203
203
|
font: "rot",
|
|
204
|
-
fill:
|
|
204
|
+
fill: L,
|
|
205
205
|
...e
|
|
206
206
|
}, 0)]
|
|
207
|
-
}),
|
|
208
|
-
bg:
|
|
209
|
-
instances: e.map((e, t) =>
|
|
210
|
-
}),
|
|
207
|
+
}), Ae = "#16202E", B = (...e) => ({
|
|
208
|
+
bg: Ae,
|
|
209
|
+
instances: e.map((e, t) => ke(e, t))
|
|
210
|
+
}), je = (e, ...t) => ({
|
|
211
211
|
bg: e,
|
|
212
|
-
instances: t.map((e, t) =>
|
|
212
|
+
instances: t.map((e, t) => ke(e, t))
|
|
213
213
|
}), V = [
|
|
214
214
|
{
|
|
215
215
|
id: "sunburst",
|
|
@@ -673,7 +673,7 @@ var z = (e) => ({
|
|
|
673
673
|
id: "baseline-light",
|
|
674
674
|
label: "On paper",
|
|
675
675
|
sub: "Lines",
|
|
676
|
-
comp:
|
|
676
|
+
comp: je("#f4f1ea", {
|
|
677
677
|
text: "Reykjavik",
|
|
678
678
|
font: "malromur",
|
|
679
679
|
fontSize: 130,
|
|
@@ -1011,7 +1011,7 @@ var z = (e) => ({
|
|
|
1011
1011
|
id: "malromur-heavy",
|
|
1012
1012
|
label: "Heavy swing",
|
|
1013
1013
|
sub: "Weight",
|
|
1014
|
-
comp:
|
|
1014
|
+
comp: je("#f4f1ea", {
|
|
1015
1015
|
text: "Malromur",
|
|
1016
1016
|
font: "malromur",
|
|
1017
1017
|
fontSize: 130,
|
|
@@ -1927,7 +1927,7 @@ var z = (e) => ({
|
|
|
1927
1927
|
id: "grid-and-ring",
|
|
1928
1928
|
label: "Grid + ring",
|
|
1929
1929
|
sub: "Composite",
|
|
1930
|
-
comp:
|
|
1930
|
+
comp: je("#0a0b14", {
|
|
1931
1931
|
id: "a",
|
|
1932
1932
|
text: "echo",
|
|
1933
1933
|
font: "rot",
|
|
@@ -1962,24 +1962,24 @@ var z = (e) => ({
|
|
|
1962
1962
|
}
|
|
1963
1963
|
})
|
|
1964
1964
|
}
|
|
1965
|
-
],
|
|
1965
|
+
], Me = (e) => V.find((t) => t.id === e) || V[0], Ne = [
|
|
1966
1966
|
"Radial",
|
|
1967
1967
|
"Rings",
|
|
1968
1968
|
"Path"
|
|
1969
|
-
],
|
|
1969
|
+
], Pe = [{
|
|
1970
1970
|
label: "Type",
|
|
1971
|
-
subs:
|
|
1971
|
+
subs: Ne
|
|
1972
1972
|
}, {
|
|
1973
1973
|
label: "Kinetic",
|
|
1974
|
-
subs: [...new Set(V.map((e) => e.sub))].filter((e) => !
|
|
1975
|
-
}],
|
|
1974
|
+
subs: [...new Set(V.map((e) => e.sub))].filter((e) => !Ne.includes(e))
|
|
1975
|
+
}], Fe = (e) => structuredClone(e.comp), H = {
|
|
1976
1976
|
dLen: 0,
|
|
1977
1977
|
dNormal: 0,
|
|
1978
1978
|
scale: 1,
|
|
1979
1979
|
dRot: 0,
|
|
1980
1980
|
opacity: 1,
|
|
1981
1981
|
vf: null
|
|
1982
|
-
},
|
|
1982
|
+
}, Ie = {
|
|
1983
1983
|
none: () => H,
|
|
1984
1984
|
march: (e) => ({
|
|
1985
1985
|
...H,
|
|
@@ -1990,21 +1990,21 @@ var z = (e) => ({
|
|
|
1990
1990
|
dLen: e.u * e.pathLen * Math.max(1, Math.round(e.m.cycles || 1))
|
|
1991
1991
|
}),
|
|
1992
1992
|
vfwave: (e) => {
|
|
1993
|
-
let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u *
|
|
1993
|
+
let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u * i * t - e.i * (e.m.phase ?? .5));
|
|
1994
1994
|
return {
|
|
1995
1995
|
...H,
|
|
1996
1996
|
vf: { [e.axisTag]: s(e.axisMin, e.axisMax, n) }
|
|
1997
1997
|
};
|
|
1998
1998
|
},
|
|
1999
1999
|
glyphwave: (e) => {
|
|
2000
|
-
let t = Math.max(1, Math.round(e.m.cycles || 1)), n = Math.sin(e.u *
|
|
2000
|
+
let t = Math.max(1, Math.round(e.m.cycles || 1)), n = Math.sin(e.u * i * t - e.i * (e.m.phase ?? .5));
|
|
2001
2001
|
return {
|
|
2002
2002
|
...H,
|
|
2003
2003
|
dNormal: (e.m.amp ?? .3) * e.sizePx * n
|
|
2004
2004
|
};
|
|
2005
2005
|
},
|
|
2006
2006
|
cascade: (e) => {
|
|
2007
|
-
let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u *
|
|
2007
|
+
let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u * i * t - e.i * (e.m.phase ?? .6));
|
|
2008
2008
|
return {
|
|
2009
2009
|
...H,
|
|
2010
2010
|
scale: s(.25, 1, n),
|
|
@@ -2012,7 +2012,7 @@ var z = (e) => ({
|
|
|
2012
2012
|
};
|
|
2013
2013
|
},
|
|
2014
2014
|
sweep: (e) => {
|
|
2015
|
-
let t =
|
|
2015
|
+
let t = Be(e);
|
|
2016
2016
|
return {
|
|
2017
2017
|
...H,
|
|
2018
2018
|
scale: s(.25, 1, t),
|
|
@@ -2020,49 +2020,49 @@ var z = (e) => ({
|
|
|
2020
2020
|
};
|
|
2021
2021
|
},
|
|
2022
2022
|
sweepWeight: (e) => {
|
|
2023
|
-
let t =
|
|
2023
|
+
let t = Be(e);
|
|
2024
2024
|
return {
|
|
2025
2025
|
...H,
|
|
2026
2026
|
vf: { [e.axisTag]: s(e.axisMin, e.axisMax, t) }
|
|
2027
2027
|
};
|
|
2028
2028
|
},
|
|
2029
2029
|
sweepShift: (e) => {
|
|
2030
|
-
let t =
|
|
2030
|
+
let t = Be(e);
|
|
2031
2031
|
return {
|
|
2032
2032
|
...H,
|
|
2033
2033
|
dNormal: t * .6 * e.sizePx
|
|
2034
2034
|
};
|
|
2035
2035
|
}
|
|
2036
|
-
},
|
|
2037
|
-
function
|
|
2036
|
+
}, Le = (e) => e - Math.floor(e);
|
|
2037
|
+
function Re(e, t) {
|
|
2038
2038
|
if (t <= 0) return 0;
|
|
2039
2039
|
let n = Math.min(1, e / t);
|
|
2040
2040
|
return 1 - n * n * (3 - 2 * n);
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2043
|
-
let s =
|
|
2044
|
-
let t = Math.abs(
|
|
2045
|
-
return
|
|
2042
|
+
function ze(e, t, n, r, a, o) {
|
|
2043
|
+
let s = Le(r * a), c = Math.max(.02, o * .5), l = (e) => {
|
|
2044
|
+
let t = Math.abs(Le(e) - s);
|
|
2045
|
+
return Re(Math.min(t, 1 - t), c);
|
|
2046
2046
|
};
|
|
2047
2047
|
switch (e) {
|
|
2048
2048
|
case "y": return l(n);
|
|
2049
2049
|
case "diagonal": return l(.5 + (t - .5) * .7071 + (n - .5) * .7071);
|
|
2050
2050
|
case "radial": return l(Math.hypot(t - .5, n - .5) / .7071);
|
|
2051
|
-
case "angular": return l(Math.atan2(n - .5, t - .5) /
|
|
2051
|
+
case "angular": return l(Math.atan2(n - .5, t - .5) / i + .5);
|
|
2052
2052
|
case "wave": {
|
|
2053
|
-
let e = Math.max(1, Math.round(1 + (1 -
|
|
2054
|
-
return .5 + .5 * Math.sin((t * e - r *
|
|
2053
|
+
let e = Math.max(1, Math.round(1 + (1 - o) * 6));
|
|
2054
|
+
return .5 + .5 * Math.sin((t * e - r * a) * i);
|
|
2055
2055
|
}
|
|
2056
2056
|
default: return l(t);
|
|
2057
2057
|
}
|
|
2058
2058
|
}
|
|
2059
|
-
var
|
|
2060
|
-
function
|
|
2061
|
-
return (
|
|
2059
|
+
var Be = (e) => ze(e.m.field || "x", e.nx ?? .5, e.ny ?? .5, e.u, Math.max(1, Math.round(e.m.cycles || 1)), e.m.amp ?? .35);
|
|
2060
|
+
function Ve(e, t) {
|
|
2061
|
+
return (Ie[e] || Ie.none)(t);
|
|
2062
2062
|
}
|
|
2063
2063
|
//#endregion
|
|
2064
2064
|
//#region src/kinetic/features.js
|
|
2065
|
-
var
|
|
2065
|
+
var He = [
|
|
2066
2066
|
{
|
|
2067
2067
|
tag: "liga",
|
|
2068
2068
|
label: "Ligatures"
|
|
@@ -2104,7 +2104,7 @@ var Ve = [
|
|
|
2104
2104
|
label: "Stylistic set 2"
|
|
2105
2105
|
}
|
|
2106
2106
|
];
|
|
2107
|
-
function
|
|
2107
|
+
function Ue(e) {
|
|
2108
2108
|
if (!e) return "normal";
|
|
2109
2109
|
let t = [];
|
|
2110
2110
|
for (let [n, r] of Object.entries(e)) t.push(`"${n}" ${+!!r}`);
|
|
@@ -2112,11 +2112,11 @@ function He(e) {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
//#endregion
|
|
2114
2114
|
//#region src/kinetic/KineticType.js
|
|
2115
|
-
var
|
|
2116
|
-
function
|
|
2115
|
+
var We = "http://www.w3.org/2000/svg", U = (e) => e - Math.floor(e), W = (e) => document.createElementNS(We, e);
|
|
2116
|
+
function Ge(e, t) {
|
|
2117
2117
|
return !e || !t || t === "none" ? e || "" : t === "upper" ? e.toUpperCase() : t === "lower" ? e.toLowerCase() : t === "title" ? e.replace(/\b\w/g, (e) => e.toUpperCase()) : e;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function Ke(e) {
|
|
2120
2120
|
if (!e) return {
|
|
2121
2121
|
bg: "#16202E",
|
|
2122
2122
|
instances: []
|
|
@@ -2131,11 +2131,11 @@ function Ge(e) {
|
|
|
2131
2131
|
}]
|
|
2132
2132
|
};
|
|
2133
2133
|
}
|
|
2134
|
-
var
|
|
2134
|
+
var qe = class {
|
|
2135
2135
|
constructor(e) {
|
|
2136
|
-
this.host = e, this.params =
|
|
2136
|
+
this.host = e, this.params = Ke(null), this.w = 0, this.h = 0, this._rt = /* @__PURE__ */ new Map(), this._instSig = "", this._needsRemeasure = !1;
|
|
2137
2137
|
let t = W("svg");
|
|
2138
|
-
t.setAttribute("xmlns",
|
|
2138
|
+
t.setAttribute("xmlns", We), t.style.display = "block", t.style.maxWidth = "100%", t.style.maxHeight = "100%", t.style.pointerEvents = "none", t.style.overflow = "hidden", this._clipApplied = !0, this.bg = W("rect"), this.layer = W("g"), this.measEl = W("text"), this.measEl.setAttribute("x", "0"), this.measEl.setAttribute("y", "0"), this.measEl.style.visibility = "hidden", t.append(this.bg, this.layer, this.measEl), e.appendChild(t), this.svg = t, e.__kolKineticEngine = this, typeof document < "u" && document.fonts && document.fonts.ready.then(() => {
|
|
2139
2139
|
this._needsRemeasure = !0;
|
|
2140
2140
|
}).catch(() => {});
|
|
2141
2141
|
}
|
|
@@ -2144,10 +2144,10 @@ var Ke = class {
|
|
|
2144
2144
|
for (let e of this._rt.values()) e.cache = null;
|
|
2145
2145
|
}
|
|
2146
2146
|
setComposition(e) {
|
|
2147
|
-
this.params =
|
|
2147
|
+
this.params = Ke(e);
|
|
2148
2148
|
}
|
|
2149
2149
|
renderAt(e) {
|
|
2150
|
-
!this.w || !this.h || this._render(
|
|
2150
|
+
!this.w || !this.h || this._render(p(e));
|
|
2151
2151
|
}
|
|
2152
2152
|
getInstanceRect(e) {
|
|
2153
2153
|
let t = this._rt.get(e);
|
|
@@ -2228,10 +2228,10 @@ var Ke = class {
|
|
|
2228
2228
|
}
|
|
2229
2229
|
}
|
|
2230
2230
|
_measure(e, t, n, r) {
|
|
2231
|
-
let i = t.letterSpacing || 0, a =
|
|
2231
|
+
let i = t.letterSpacing || 0, a = Ue(t.opentype), o = `${r}|${n.family}|${t.fontSize}|${i}|${E(t.vf)}|${a}`;
|
|
2232
2232
|
if (e.cache && e.cache.key === o) return e.cache;
|
|
2233
2233
|
let s = this.measEl;
|
|
2234
|
-
s.style.fontFamily = `'${n.family}'`, s.style.fontSize = `${t.fontSize}px`, s.style.letterSpacing = `${i}px`, s.style.fontVariationSettings =
|
|
2234
|
+
s.style.fontFamily = `'${n.family}'`, s.style.fontSize = `${t.fontSize}px`, s.style.letterSpacing = `${i}px`, s.style.fontVariationSettings = E(t.vf), s.style.fontFeatureSettings = a, s.textContent = r;
|
|
2235
2235
|
let c = r.length, l = Array(c), u = 0;
|
|
2236
2236
|
try {
|
|
2237
2237
|
u = s.getComputedTextLength();
|
|
@@ -2249,43 +2249,43 @@ var Ke = class {
|
|
|
2249
2249
|
}, e.cache;
|
|
2250
2250
|
}
|
|
2251
2251
|
_renderInstance(e, t, n) {
|
|
2252
|
-
let r =
|
|
2253
|
-
if (t.group.setAttribute("transform", `translate(${
|
|
2254
|
-
let n = r.url, a = e.morph.face2 ?
|
|
2255
|
-
if (
|
|
2256
|
-
this._setKind(t, "morph"), this._renderMorph(e, t, i,
|
|
2252
|
+
let r = T(e.font), i = e.phase ? U(n + e.phase) : n, a = Ge(e.text || "", e.case), o = Math.max(1, Math.round(e.multiply || 1)), s = o > 1 && a ? Array(o).fill(a).join(" ") : a, c = e.path?.type || "line", l = (e.offset?.x || 0) * this.w, d = (e.offset?.y || 0) * this.h;
|
|
2253
|
+
if (t.group.setAttribute("transform", `translate(${l.toFixed(2)} ${d.toFixed(2)})`), e.morph?.on && !Ce(c) && !we(c)) {
|
|
2254
|
+
let n = r.url, a = e.morph.face2 ? T(e.morph.face2) : null, o = a ? a.url : n, l = f(n), d = f(o);
|
|
2255
|
+
if (l && d) {
|
|
2256
|
+
this._setKind(t, "morph"), this._renderMorph(e, t, i, l, d, r, s, c);
|
|
2257
2257
|
return;
|
|
2258
2258
|
}
|
|
2259
|
-
|
|
2259
|
+
l || u(n).catch(() => {}), !d && o !== n && u(o).catch(() => {});
|
|
2260
2260
|
}
|
|
2261
|
-
if (this._setKind(t, "text"),
|
|
2261
|
+
if (this._setKind(t, "text"), Se(c)) {
|
|
2262
2262
|
t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
|
|
2263
2263
|
let n = Math.max(1, Math.round(e.path?.rows ?? 2)), a = Math.max(1, Math.round(e.path?.cols ?? 3));
|
|
2264
2264
|
if (this._ensureGlyphs(t, s, r, n * a), !s.length) return;
|
|
2265
2265
|
this._measure(t, e, r, s), this._placeArray(e, t, r, i, t.glyphEls, n, a);
|
|
2266
2266
|
return;
|
|
2267
2267
|
}
|
|
2268
|
-
if (
|
|
2268
|
+
if (Ce(c) || we(c)) {
|
|
2269
2269
|
t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
|
|
2270
2270
|
let n = Math.max(1, Math.round(e.path?.count ?? 12));
|
|
2271
2271
|
if (this._ensureGlyphs(t, s, r, n), !s.length) return;
|
|
2272
|
-
this._measure(t, e, r, s),
|
|
2272
|
+
this._measure(t, e, r, s), Ce(c) ? this._placeRadial(e, t, r, i, t.glyphEls, n) : this._placeRings(e, t, r, i, t.glyphEls, n);
|
|
2273
2273
|
return;
|
|
2274
2274
|
}
|
|
2275
|
-
let p =
|
|
2275
|
+
let p = Ee(c, this.w, this.h, e.path || {});
|
|
2276
2276
|
t.closed = p.closed, t.pathEl.setAttribute("d", p.d), t.pathEl.setAttribute("stroke", e.showPath ? e.fill || "#888" : "none"), t.pathEl.setAttribute("stroke-width", +!!e.showPath), t.pathEl.style.opacity = e.showPath ? .25 : 0, this._ensureGlyphs(t, s, r, 1), s.length && (this._measure(t, e, r, s), this._placeOnPath(e, t, r, i, t.glyphEls));
|
|
2277
2277
|
}
|
|
2278
2278
|
_styleGlyph(e, t, n, r) {
|
|
2279
|
-
e.style.fontFamily = `'${n.family}'`, e.style.fontSize = `${t.fontSize}px`, e.style.fontStyle = t.italic ? "italic" : "normal", e.style.fontVariationSettings =
|
|
2279
|
+
e.style.fontFamily = `'${n.family}'`, e.style.fontSize = `${t.fontSize}px`, e.style.fontStyle = t.italic ? "italic" : "normal", e.style.fontVariationSettings = E(r.vf ? {
|
|
2280
2280
|
...t.vf,
|
|
2281
2281
|
...r.vf
|
|
2282
|
-
} : t.vf), e.style.fontFeatureSettings =
|
|
2282
|
+
} : t.vf), e.style.fontFeatureSettings = Ue(t.opentype), e.setAttribute("fill", t.fill || "#e8e4dc"), e.setAttribute("opacity", r.opacity);
|
|
2283
2283
|
}
|
|
2284
2284
|
_anim(e, t, n) {
|
|
2285
2285
|
let r = e.motions && e.motions.length ? [e.motion, ...e.motions] : [e.motion], i = 0, a = 0, o = 0, s = 1, c = 1, l = null;
|
|
2286
2286
|
for (let e of r) {
|
|
2287
2287
|
if (!e || (e.mode || "none") === "none") continue;
|
|
2288
|
-
let r = n.axes.find((t) => t.tag === (e.axis || n.axes[0] && n.axes[0].tag)), u =
|
|
2288
|
+
let r = n.axes.find((t) => t.tag === (e.axis || n.axes[0] && n.axes[0].tag)), u = Ve(e.mode, {
|
|
2289
2289
|
...t,
|
|
2290
2290
|
m: e,
|
|
2291
2291
|
axisTag: r ? r.tag : "wght",
|
|
@@ -2306,105 +2306,105 @@ var Ke = class {
|
|
|
2306
2306
|
vf: l
|
|
2307
2307
|
};
|
|
2308
2308
|
}
|
|
2309
|
-
_placeOnPath(e, t, n, r,
|
|
2310
|
-
let
|
|
2309
|
+
_placeOnPath(e, t, n, r, i) {
|
|
2310
|
+
let a = t.cache;
|
|
2311
|
+
if (!a) return;
|
|
2312
|
+
let o = t.pathEl.getTotalLength();
|
|
2311
2313
|
if (!o) return;
|
|
2312
|
-
let s = t.
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
let n = e < 0 ? 0 : s, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - f)), a = t.pathEl.getPointAtLength(Math.min(s, n + f)), o = a.x - i.x, c = a.y - i.y, l = Math.hypot(o, c) || 1;
|
|
2317
|
-
o /= l, c /= l;
|
|
2314
|
+
let { centers: s, total: c } = a, l = e.align || "center", u = l === "start" ? 0 : l === "end" ? o - c : (o - c) / 2, d = .75, f = t.closed, m = e.flow === "flow" && !f, h = (e) => f ? (e % o + o) % o : Math.max(0, Math.min(o, e)), g = (e) => {
|
|
2315
|
+
if (m && (e < 0 || e > o)) {
|
|
2316
|
+
let n = e < 0 ? 0 : o, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - d)), a = t.pathEl.getPointAtLength(Math.min(o, n + d)), s = a.x - i.x, c = a.y - i.y, l = Math.hypot(s, c) || 1;
|
|
2317
|
+
s /= l, c /= l;
|
|
2318
2318
|
let u = e - n;
|
|
2319
2319
|
return {
|
|
2320
|
-
x: r.x +
|
|
2320
|
+
x: r.x + s * u,
|
|
2321
2321
|
y: r.y + c * u
|
|
2322
2322
|
};
|
|
2323
2323
|
}
|
|
2324
2324
|
return t.pathEl.getPointAtLength(h(e));
|
|
2325
|
-
}, _ = Math.min(
|
|
2325
|
+
}, _ = Math.min(i.length, s.length), v = p(e.stagger || 0), y = Math.max(1, Math.round(e.multiply || 1)), b = (s.length + 2) / y;
|
|
2326
2326
|
for (let t = 0; t < _; t++) {
|
|
2327
|
-
let
|
|
2327
|
+
let a = u + s[t], c = g(a), l = v && y > 1 ? U(r + v * Math.floor(t / b) / y) : r, f = this._anim(e, {
|
|
2328
2328
|
i: t,
|
|
2329
|
-
n:
|
|
2329
|
+
n: s.length,
|
|
2330
2330
|
u: l,
|
|
2331
2331
|
sizePx: e.fontSize,
|
|
2332
|
-
pathLen:
|
|
2333
|
-
nx: this.w ?
|
|
2334
|
-
ny: this.h ?
|
|
2335
|
-
}, n), p =
|
|
2336
|
-
|
|
2332
|
+
pathLen: o,
|
|
2333
|
+
nx: this.w ? c.x / this.w : .5,
|
|
2334
|
+
ny: this.h ? c.y / this.h : .5
|
|
2335
|
+
}, n), p = a + f.dLen, m = g(p), h = g(p - d), _ = g(p + d), x = Math.atan2(_.y - h.y, _.x - h.x) * 180 / Math.PI;
|
|
2336
|
+
i[t].setAttribute("transform", `translate(${m.x.toFixed(2)} ${m.y.toFixed(2)}) rotate(${(x + f.dRot).toFixed(2)}) translate(0 ${(-f.dNormal).toFixed(2)}) scale(${f.scale.toFixed(3)})`), this._styleGlyph(i[t], e, n, f);
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
2339
|
-
_placeArray(e, t, n, r, a, o
|
|
2340
|
-
let
|
|
2341
|
-
if (!
|
|
2342
|
-
let { centers:
|
|
2343
|
-
if (!
|
|
2344
|
-
let
|
|
2339
|
+
_placeArray(e, t, n, r, i, a, o) {
|
|
2340
|
+
let s = t.cache;
|
|
2341
|
+
if (!s) return;
|
|
2342
|
+
let { centers: c, total: l } = s, u = c.length;
|
|
2343
|
+
if (!u) return;
|
|
2344
|
+
let d = Math.min(this.w, this.h) * .08, f = (this.w - 2 * d) / o, m = (this.h - 2 * d) / a, h = p(e.stagger || 0), g = a * o;
|
|
2345
2345
|
for (let t = 0; t < g; t++) {
|
|
2346
|
-
let
|
|
2347
|
-
for (let r = 0; r <
|
|
2348
|
-
let
|
|
2349
|
-
if (!
|
|
2350
|
-
let o = _ +
|
|
2351
|
-
i: t *
|
|
2352
|
-
n: g *
|
|
2346
|
+
let a = Math.floor(t / o), s = d + t % o * f + f / 2, p = d + a * m + m / 2, _ = s - l / 2, v = h ? U(r + h * t / g) : r;
|
|
2347
|
+
for (let r = 0; r < u; r++) {
|
|
2348
|
+
let a = i[t * u + r];
|
|
2349
|
+
if (!a) continue;
|
|
2350
|
+
let o = _ + c[r], s = this._anim(e, {
|
|
2351
|
+
i: t * u + r,
|
|
2352
|
+
n: g * u,
|
|
2353
2353
|
u: v,
|
|
2354
2354
|
sizePx: e.fontSize,
|
|
2355
2355
|
pathLen: 0,
|
|
2356
2356
|
nx: this.w ? o / this.w : .5,
|
|
2357
|
-
ny: this.h ?
|
|
2358
|
-
}, n),
|
|
2359
|
-
|
|
2357
|
+
ny: this.h ? p / this.h : .5
|
|
2358
|
+
}, n), l = p - s.dNormal;
|
|
2359
|
+
a.setAttribute("transform", `translate(${o.toFixed(2)} ${l.toFixed(2)}) rotate(${s.dRot.toFixed(2)}) scale(${s.scale.toFixed(3)})`), this._styleGlyph(a, e, n, s);
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
_placeRadial(e, t, n, r, a,
|
|
2364
|
-
let
|
|
2365
|
-
if (!
|
|
2366
|
-
let { centers:
|
|
2367
|
-
if (!
|
|
2368
|
-
let
|
|
2369
|
-
for (let t = 0; t <
|
|
2370
|
-
let
|
|
2371
|
-
for (let r = 0; r <
|
|
2372
|
-
let i = t *
|
|
2373
|
-
if (!
|
|
2374
|
-
let
|
|
2363
|
+
_placeRadial(e, t, n, r, a, o) {
|
|
2364
|
+
let s = t.cache;
|
|
2365
|
+
if (!s) return;
|
|
2366
|
+
let { centers: c } = s, l = c.length;
|
|
2367
|
+
if (!l) return;
|
|
2368
|
+
let u = this.w / 2, d = this.h / 2, f = Math.min(this.w, this.h) * .5, m = f * Math.max(0, Math.min(.95, e.path?.inner ?? .12)), h = Math.round(e.path?.spin ?? 1), g = p(e.stagger || 0);
|
|
2369
|
+
for (let t = 0; t < o; t++) {
|
|
2370
|
+
let s = o > 1 ? t / (o - 1) : 0, p = h + (g ? Math.round(g * 2 * s) : 0), _ = t / o * i + r * i * p, v = g ? U(r + g * t / o) : r, y = Math.cos(_), b = Math.sin(_), x = _ * 180 / Math.PI;
|
|
2371
|
+
for (let r = 0; r < l; r++) {
|
|
2372
|
+
let i = t * l + r, s = a[i];
|
|
2373
|
+
if (!s) continue;
|
|
2374
|
+
let p = m + c[r], h = u + y * p, g = d + b * p, _ = this._anim(e, {
|
|
2375
2375
|
i,
|
|
2376
|
-
n:
|
|
2376
|
+
n: o * l,
|
|
2377
2377
|
u: v,
|
|
2378
2378
|
sizePx: e.fontSize,
|
|
2379
|
-
pathLen:
|
|
2379
|
+
pathLen: f,
|
|
2380
2380
|
nx: this.w ? h / this.w : .5,
|
|
2381
2381
|
ny: this.h ? g / this.h : .5
|
|
2382
|
-
}, n), S =
|
|
2383
|
-
|
|
2382
|
+
}, n), S = p + _.dLen, ee = u + y * S, C = d + b * S;
|
|
2383
|
+
s.setAttribute("transform", `translate(${ee.toFixed(2)} ${C.toFixed(2)}) rotate(${(x + _.dRot).toFixed(2)}) translate(0 ${(-_.dNormal).toFixed(2)}) scale(${_.scale.toFixed(3)})`), this._styleGlyph(s, e, n, _);
|
|
2384
2384
|
}
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
|
-
_placeRings(e, t, n, r, a,
|
|
2388
|
-
let
|
|
2389
|
-
if (!
|
|
2390
|
-
let { centers:
|
|
2391
|
-
if (!
|
|
2392
|
-
let
|
|
2393
|
-
for (let t = 0; t <
|
|
2394
|
-
let
|
|
2395
|
-
for (let r = 0; r <
|
|
2396
|
-
let
|
|
2387
|
+
_placeRings(e, t, n, r, a, o) {
|
|
2388
|
+
let s = t.cache;
|
|
2389
|
+
if (!s) return;
|
|
2390
|
+
let { centers: c, total: l } = s, u = c.length;
|
|
2391
|
+
if (!u) return;
|
|
2392
|
+
let d = this.w / 2, f = this.h / 2, m = Math.min(this.w, this.h) * .5 * Math.max(.1, Math.min(1, e.path?.radius ?? .92)), h = m * Math.max(.02, Math.min(.95, e.path?.inner ?? .14)), g = Math.round(e.path?.spin ?? 1), _ = e.path?.twist ?? .5, v = e.path?.grow ?? .6, y = p(e.stagger || 0);
|
|
2393
|
+
for (let t = 0; t < o; t++) {
|
|
2394
|
+
let s = o > 1 ? t / (o - 1) : 0, p = Math.max(1, h + s * (m - h)), b = g + (y ? Math.round(y * 2 * s) : 0), x = r * i * b + s * _ * i, S = y ? U(r + y * t / o) : r, ee = 1 + v * s;
|
|
2395
|
+
for (let r = 0; r < u; r++) {
|
|
2396
|
+
let s = t * u + r, m = a[s];
|
|
2397
2397
|
if (!m) continue;
|
|
2398
|
-
let h = x + (
|
|
2399
|
-
i,
|
|
2400
|
-
n:
|
|
2398
|
+
let h = x + (c[r] - l / 2) / p, g = d + Math.cos(h) * p, _ = f + Math.sin(h) * p, v = this._anim(e, {
|
|
2399
|
+
i: s,
|
|
2400
|
+
n: o * u,
|
|
2401
2401
|
u: S,
|
|
2402
2402
|
sizePx: e.fontSize,
|
|
2403
|
-
pathLen:
|
|
2403
|
+
pathLen: i * p,
|
|
2404
2404
|
nx: this.w ? g / this.w : .5,
|
|
2405
2405
|
ny: this.h ? _ / this.h : .5
|
|
2406
|
-
}, n), y = h + v.dLen /
|
|
2407
|
-
m.setAttribute("transform", `translate(${
|
|
2406
|
+
}, n), y = h + v.dLen / p, b = p - v.dNormal, C = d + Math.cos(y) * b, te = f + Math.sin(y) * b, w = y * 180 / Math.PI + 90 + v.dRot;
|
|
2407
|
+
m.setAttribute("transform", `translate(${C.toFixed(2)} ${te.toFixed(2)}) rotate(${w.toFixed(2)}) scale(${(v.scale * ee).toFixed(3)})`), this._styleGlyph(m, e, n, v);
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
@@ -2455,18 +2455,18 @@ var Ke = class {
|
|
|
2455
2455
|
for (let t of e.glyphs) n.push(o + t.advance / 2), o += t.advance;
|
|
2456
2456
|
t.morphCenters = n, t.morphTotal = e.totalAdvance;
|
|
2457
2457
|
}
|
|
2458
|
-
let
|
|
2459
|
-
if (!s.length || !
|
|
2458
|
+
let ee = t.morphData?.glyphs.length || 0;
|
|
2459
|
+
if (!s.length || !ee) {
|
|
2460
2460
|
t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
|
|
2461
2461
|
return;
|
|
2462
2462
|
}
|
|
2463
|
-
let
|
|
2464
|
-
if ((S ||
|
|
2465
|
-
t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0, this._placeMorphArray(e, t, o, n,
|
|
2463
|
+
let C = Se(c), te = C ? Math.max(1, Math.round(e.path?.rows ?? 2)) : 1, w = C ? Math.max(1, Math.round(e.path?.cols ?? 3)) : 1, T = C ? te * w : 1, E = this._ensureMorphPool(t, ee, T, h);
|
|
2464
|
+
if ((S || E) && this._refreshMorphPaths(t, T, h, b), C) {
|
|
2465
|
+
t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0, this._placeMorphArray(e, t, o, n, te, w);
|
|
2466
2466
|
return;
|
|
2467
2467
|
}
|
|
2468
|
-
let
|
|
2469
|
-
t.closed =
|
|
2468
|
+
let ne = Ee(c, this.w, this.h, e.path || {});
|
|
2469
|
+
t.closed = ne.closed, t.pathEl.setAttribute("d", ne.d), t.pathEl.setAttribute("stroke", e.showPath ? e.fill || "#888" : "none"), t.pathEl.setAttribute("stroke-width", +!!e.showPath), t.pathEl.style.opacity = e.showPath ? .25 : 0, this._placeMorphOnPath(e, t, o, n);
|
|
2470
2470
|
}
|
|
2471
2471
|
_ensureMorphPool(e, t, n, r) {
|
|
2472
2472
|
let i = `${t}|${n}|${r}`;
|
|
@@ -2494,57 +2494,57 @@ var Ke = class {
|
|
|
2494
2494
|
let a = (n.x1 + n.x2) / 2, o = (n.y1 + n.y2) / 2;
|
|
2495
2495
|
e.setAttribute("transform", `translate(${(-a).toFixed(2)} ${(-o).toFixed(2)})`);
|
|
2496
2496
|
}
|
|
2497
|
-
_placeMorphOnPath(e, t, n, r,
|
|
2498
|
-
let
|
|
2499
|
-
if (!
|
|
2500
|
-
let
|
|
2501
|
-
if (!
|
|
2502
|
-
let
|
|
2503
|
-
if (
|
|
2504
|
-
let n = e < 0 ? 0 :
|
|
2505
|
-
o /= l,
|
|
2506
|
-
let
|
|
2497
|
+
_placeMorphOnPath(e, t, n, r, i = t.morphEls) {
|
|
2498
|
+
let a = t.morphCenters, o = t.morphTotal;
|
|
2499
|
+
if (!a || !i) return;
|
|
2500
|
+
let s = t.pathEl.getTotalLength();
|
|
2501
|
+
if (!s) return;
|
|
2502
|
+
let c = e.align || "center", l = c === "start" ? 0 : c === "end" ? s - o : (s - o) / 2, u = .75, d = t.closed, f = e.flow === "flow" && !d, m = (e) => d ? (e % s + s) % s : Math.max(0, Math.min(s, e)), h = (e) => {
|
|
2503
|
+
if (f && (e < 0 || e > s)) {
|
|
2504
|
+
let n = e < 0 ? 0 : s, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - u)), a = t.pathEl.getPointAtLength(Math.min(s, n + u)), o = a.x - i.x, c = a.y - i.y, l = Math.hypot(o, c) || 1;
|
|
2505
|
+
o /= l, c /= l;
|
|
2506
|
+
let d = e - n;
|
|
2507
2507
|
return {
|
|
2508
|
-
x: r.x + o *
|
|
2509
|
-
y: r.y +
|
|
2508
|
+
x: r.x + o * d,
|
|
2509
|
+
y: r.y + c * d
|
|
2510
2510
|
};
|
|
2511
2511
|
}
|
|
2512
2512
|
return t.pathEl.getPointAtLength(m(e));
|
|
2513
|
-
}, g = e.italic ? " skewX(-12)" : "", _ = Math.min(
|
|
2513
|
+
}, g = e.italic ? " skewX(-12)" : "", _ = Math.min(i.length, a.length), v = p(e.stagger || 0), y = Math.max(1, Math.round(e.multiply || 1)), b = (a.length + 2) / y;
|
|
2514
2514
|
for (let t = 0; t < _; t++) {
|
|
2515
|
-
let
|
|
2515
|
+
let o = l + a[t], c = h(o), d = v && y > 1 ? U(r + v * Math.floor(t / b) / y) : r, f = this._anim(e, {
|
|
2516
2516
|
i: t,
|
|
2517
|
-
n:
|
|
2518
|
-
u:
|
|
2517
|
+
n: a.length,
|
|
2518
|
+
u: d,
|
|
2519
2519
|
sizePx: e.fontSize,
|
|
2520
|
-
pathLen:
|
|
2521
|
-
nx: this.w ?
|
|
2522
|
-
ny: this.h ?
|
|
2523
|
-
}, n), p =
|
|
2524
|
-
|
|
2520
|
+
pathLen: s,
|
|
2521
|
+
nx: this.w ? c.x / this.w : .5,
|
|
2522
|
+
ny: this.h ? c.y / this.h : .5
|
|
2523
|
+
}, n), p = o + f.dLen, m = h(p), _ = h(p - u), x = h(p + u), S = Math.atan2(x.y - _.y, x.x - _.x) * 180 / Math.PI;
|
|
2524
|
+
i[t].setAttribute("transform", `translate(${m.x.toFixed(2)} ${m.y.toFixed(2)}) rotate(${(S + f.dRot).toFixed(2)}) translate(0 ${(-f.dNormal).toFixed(2)}) scale(${f.scale.toFixed(3)})${g}`), i[t].setAttribute("opacity", f.opacity);
|
|
2525
2525
|
}
|
|
2526
2526
|
}
|
|
2527
|
-
_placeMorphArray(e, t, n, r, a, o
|
|
2528
|
-
let
|
|
2529
|
-
if (!
|
|
2530
|
-
let
|
|
2531
|
-
if (!
|
|
2532
|
-
let
|
|
2527
|
+
_placeMorphArray(e, t, n, r, i, a, o = t.morphEls) {
|
|
2528
|
+
let s = t.morphCenters, c = t.morphTotal;
|
|
2529
|
+
if (!s || !o) return;
|
|
2530
|
+
let l = s.length;
|
|
2531
|
+
if (!l) return;
|
|
2532
|
+
let u = Math.min(this.w, this.h) * .08, d = (this.w - 2 * u) / a, f = (this.h - 2 * u) / i, m = e.italic ? " skewX(-12)" : "", h = p(e.stagger || 0), g = i * a;
|
|
2533
2533
|
for (let t = 0; t < g; t++) {
|
|
2534
|
-
let i = Math.floor(t /
|
|
2535
|
-
for (let r = 0; r <
|
|
2536
|
-
let i = t *
|
|
2534
|
+
let i = Math.floor(t / a), p = u + t % a * d + d / 2, _ = u + i * f + f / 2, v = p - c / 2, y = h ? U(r + h * t / g) : r;
|
|
2535
|
+
for (let r = 0; r < l; r++) {
|
|
2536
|
+
let i = t * l + r, a = o[i];
|
|
2537
2537
|
if (!a) continue;
|
|
2538
|
-
let
|
|
2538
|
+
let c = v + s[r], u = this._anim(e, {
|
|
2539
2539
|
i,
|
|
2540
|
-
n: g *
|
|
2540
|
+
n: g * l,
|
|
2541
2541
|
u: y,
|
|
2542
2542
|
sizePx: e.fontSize,
|
|
2543
2543
|
pathLen: 0,
|
|
2544
|
-
nx: this.w ?
|
|
2544
|
+
nx: this.w ? c / this.w : .5,
|
|
2545
2545
|
ny: this.h ? _ / this.h : .5
|
|
2546
|
-
}, n), d = _ -
|
|
2547
|
-
a.setAttribute("transform", `translate(${
|
|
2546
|
+
}, n), d = _ - u.dNormal;
|
|
2547
|
+
a.setAttribute("transform", `translate(${c.toFixed(2)} ${d.toFixed(2)}) rotate(${u.dRot.toFixed(2)}) scale(${u.scale.toFixed(3)})${m}`), a.setAttribute("opacity", u.opacity);
|
|
2548
2548
|
}
|
|
2549
2549
|
}
|
|
2550
2550
|
}
|
|
@@ -2554,7 +2554,7 @@ var Ke = class {
|
|
|
2554
2554
|
...e,
|
|
2555
2555
|
...t
|
|
2556
2556
|
} : e)
|
|
2557
|
-
}),
|
|
2557
|
+
}), Je = (e, t) => ({
|
|
2558
2558
|
...e,
|
|
2559
2559
|
instances: (e.instances ?? []).map((e, n, r) => ({
|
|
2560
2560
|
...e,
|
|
@@ -2566,11 +2566,11 @@ var Ke = class {
|
|
|
2566
2566
|
} }, n), J = (e, t, n = 0) => K(e, { motion: {
|
|
2567
2567
|
...G(e, n)?.motion ?? {},
|
|
2568
2568
|
...t
|
|
2569
|
-
} }, n), Y = (e, t = 0) => G(e, t)?.path?.type ?? "line",
|
|
2569
|
+
} }, n), Y = (e, t = 0) => G(e, t)?.path?.type ?? "line", Ye = (e, t = 0) => G(e, t)?.motion?.mode ?? "none", Xe = (e, t = 0) => ![
|
|
2570
2570
|
"radial",
|
|
2571
2571
|
"rings",
|
|
2572
2572
|
"array"
|
|
2573
|
-
].includes(Y(e, t)),
|
|
2573
|
+
].includes(Y(e, t)), Ze = [
|
|
2574
2574
|
{
|
|
2575
2575
|
value: "line",
|
|
2576
2576
|
label: "Line"
|
|
@@ -2615,24 +2615,24 @@ var Ke = class {
|
|
|
2615
2615
|
value: "rings",
|
|
2616
2616
|
label: "Rings"
|
|
2617
2617
|
}
|
|
2618
|
-
],
|
|
2618
|
+
], X = (e, t = 0) => G(e, t)?.morph ?? {}, Z = (e, t, n = 0) => K(e, { morph: {
|
|
2619
2619
|
...G(e, n)?.morph ?? {},
|
|
2620
2620
|
...t
|
|
2621
|
-
} }, n),
|
|
2622
|
-
...
|
|
2621
|
+
} }, n), Qe = (e, t, n, r = 0) => Z(e, { vf2: {
|
|
2622
|
+
...X(e, r).vf2 ?? {},
|
|
2623
2623
|
[t]: n
|
|
2624
|
-
} }, r),
|
|
2624
|
+
} }, r), $e = (e, t = 0) => !["radial", "rings"].includes(Y(e, t)), et = (e, t = 0) => $e(e, t) && !!X(e, t).on, Q = (e, t = 0) => X(e, t).mode ?? "morph", tt = (e, t = 0) => et(e, t) && ["morph", "fade"].includes(Q(e, t)), $ = (e, t, n = 0) => T(G(e, n)?.font).axes.find((e) => e.tag === t), nt = (e, t, n, r = 0) => {
|
|
2625
2625
|
let i = $(e, t, r), a = i ? Math.min(i.max, Math.max(i.min, n)) : n;
|
|
2626
|
-
return
|
|
2627
|
-
},
|
|
2626
|
+
return Qe(e, t, Math.round(a), r);
|
|
2627
|
+
}, rt = (e, t, n, r = 0) => {
|
|
2628
2628
|
let i = $(e, t, r), a = i ? Math.min(i.max, Math.max(i.min, n)) : n;
|
|
2629
2629
|
return K(e, { vf: {
|
|
2630
2630
|
...G(e, r)?.vf ?? {},
|
|
2631
2631
|
[t]: Math.round(a)
|
|
2632
2632
|
} }, r);
|
|
2633
|
-
},
|
|
2633
|
+
}, it = (e) => ({
|
|
2634
2634
|
key: `vf${e[0].toUpperCase()}${e.slice(1)}`,
|
|
2635
|
-
label:
|
|
2635
|
+
label: D[e] || e,
|
|
2636
2636
|
tab: "style",
|
|
2637
2637
|
section: "Axes",
|
|
2638
2638
|
type: "range",
|
|
@@ -2641,8 +2641,8 @@ var Ke = class {
|
|
|
2641
2641
|
max: (t, n = 0) => $(t, e, n)?.max ?? 1e3,
|
|
2642
2642
|
when: (t, n = 0) => !!$(t, e, n),
|
|
2643
2643
|
get: (t, n = 0) => G(t, n)?.vf?.[e] ?? $(t, e, n)?.def ?? 0,
|
|
2644
|
-
set: (t, n, r = 0) =>
|
|
2645
|
-
}),
|
|
2644
|
+
set: (t, n, r = 0) => rt(t, e, n, r)
|
|
2645
|
+
}), at = (e, t = 0) => et(e, t) && Q(e, t) === "morph" && (X(e, t).curve ?? "flat") === "custom", ot = (e, t) => ({
|
|
2646
2646
|
key: `morphC${e}${t}`,
|
|
2647
2647
|
label: `P${e} ${t.toUpperCase()}`,
|
|
2648
2648
|
tab: "style",
|
|
@@ -2652,16 +2652,16 @@ var Ke = class {
|
|
|
2652
2652
|
max: 1,
|
|
2653
2653
|
step: .01,
|
|
2654
2654
|
noRandom: !0,
|
|
2655
|
-
when:
|
|
2656
|
-
get: (n, r = 0) =>
|
|
2657
|
-
set: (n, r, i = 0) =>
|
|
2658
|
-
...
|
|
2655
|
+
when: at,
|
|
2656
|
+
get: (n, r = 0) => X(n, r)[`cp${e}`]?.[t] ?? (e === 1 ? .33 : .66),
|
|
2657
|
+
set: (n, r, i = 0) => Z(n, { [`cp${e}`]: {
|
|
2658
|
+
...X(n, i)[`cp${e}`] ?? {
|
|
2659
2659
|
x: e === 1 ? .33 : .66,
|
|
2660
2660
|
y: e === 1 ? .33 : .66
|
|
2661
2661
|
},
|
|
2662
2662
|
[t]: r
|
|
2663
2663
|
} }, i)
|
|
2664
|
-
}),
|
|
2664
|
+
}), st = [
|
|
2665
2665
|
{
|
|
2666
2666
|
key: "bg",
|
|
2667
2667
|
label: "Background",
|
|
@@ -2690,12 +2690,12 @@ var Ke = class {
|
|
|
2690
2690
|
label: "Font",
|
|
2691
2691
|
tab: "style",
|
|
2692
2692
|
type: "select",
|
|
2693
|
-
options:
|
|
2693
|
+
options: ie,
|
|
2694
2694
|
noRandom: !0,
|
|
2695
2695
|
get: (e, t = 0) => G(e, t)?.font,
|
|
2696
2696
|
set: (e, t, n = 0) => K(e, {
|
|
2697
2697
|
font: t,
|
|
2698
|
-
vf:
|
|
2698
|
+
vf: Oe(t, G(e, n)?.vf)
|
|
2699
2699
|
}, n)
|
|
2700
2700
|
},
|
|
2701
2701
|
{
|
|
@@ -2773,7 +2773,7 @@ var Ke = class {
|
|
|
2773
2773
|
tab: "style",
|
|
2774
2774
|
type: "select",
|
|
2775
2775
|
noRandom: !0,
|
|
2776
|
-
when:
|
|
2776
|
+
when: Xe,
|
|
2777
2777
|
options: [
|
|
2778
2778
|
{
|
|
2779
2779
|
value: "start",
|
|
@@ -2800,12 +2800,12 @@ var Ke = class {
|
|
|
2800
2800
|
max: 24,
|
|
2801
2801
|
step: 1,
|
|
2802
2802
|
noRandom: !0,
|
|
2803
|
-
when:
|
|
2803
|
+
when: Xe,
|
|
2804
2804
|
get: (e, t = 0) => G(e, t)?.multiply ?? 1,
|
|
2805
2805
|
set: (e, t, n = 0) => K(e, { multiply: Math.round(t) }, n)
|
|
2806
2806
|
},
|
|
2807
|
-
|
|
2808
|
-
|
|
2807
|
+
it("wdth"),
|
|
2808
|
+
it("wght"),
|
|
2809
2809
|
{
|
|
2810
2810
|
key: "arrangement",
|
|
2811
2811
|
label: "Arrangement",
|
|
@@ -2813,7 +2813,7 @@ var Ke = class {
|
|
|
2813
2813
|
section: "Arrangement",
|
|
2814
2814
|
type: "select",
|
|
2815
2815
|
noRandom: !0,
|
|
2816
|
-
options:
|
|
2816
|
+
options: Ze,
|
|
2817
2817
|
get: Y,
|
|
2818
2818
|
set: (e, t, n = 0) => q(e, { type: t }, n)
|
|
2819
2819
|
},
|
|
@@ -3014,7 +3014,7 @@ var Ke = class {
|
|
|
3014
3014
|
section: "Arrangement",
|
|
3015
3015
|
type: "select",
|
|
3016
3016
|
noRandom: !0,
|
|
3017
|
-
when:
|
|
3017
|
+
when: Xe,
|
|
3018
3018
|
options: [{
|
|
3019
3019
|
value: "flow",
|
|
3020
3020
|
label: "Flow"
|
|
@@ -3032,7 +3032,7 @@ var Ke = class {
|
|
|
3032
3032
|
section: "Arrangement",
|
|
3033
3033
|
type: "select",
|
|
3034
3034
|
noRandom: !0,
|
|
3035
|
-
when:
|
|
3035
|
+
when: Xe,
|
|
3036
3036
|
options: [{
|
|
3037
3037
|
value: "off",
|
|
3038
3038
|
label: "Off"
|
|
@@ -3082,7 +3082,7 @@ var Ke = class {
|
|
|
3082
3082
|
section: "Morph",
|
|
3083
3083
|
type: "select",
|
|
3084
3084
|
noRandom: !0,
|
|
3085
|
-
when:
|
|
3085
|
+
when: $e,
|
|
3086
3086
|
options: [{
|
|
3087
3087
|
value: "off",
|
|
3088
3088
|
label: "Off"
|
|
@@ -3090,8 +3090,8 @@ var Ke = class {
|
|
|
3090
3090
|
value: "on",
|
|
3091
3091
|
label: "On"
|
|
3092
3092
|
}],
|
|
3093
|
-
get: (e, t = 0) =>
|
|
3094
|
-
set: (e, t, n = 0) =>
|
|
3093
|
+
get: (e, t = 0) => X(e, t).on ? "on" : "off",
|
|
3094
|
+
set: (e, t, n = 0) => Z(e, { on: t === "on" }, n)
|
|
3095
3095
|
},
|
|
3096
3096
|
{
|
|
3097
3097
|
key: "morphMode",
|
|
@@ -3099,10 +3099,10 @@ var Ke = class {
|
|
|
3099
3099
|
tab: "style",
|
|
3100
3100
|
section: "Morph",
|
|
3101
3101
|
type: "select",
|
|
3102
|
-
when:
|
|
3102
|
+
when: et,
|
|
3103
3103
|
options: d,
|
|
3104
|
-
get:
|
|
3105
|
-
set: (e, t, n = 0) =>
|
|
3104
|
+
get: Q,
|
|
3105
|
+
set: (e, t, n = 0) => Z(e, { mode: t }, n)
|
|
3106
3106
|
},
|
|
3107
3107
|
{
|
|
3108
3108
|
key: "morphFace2",
|
|
@@ -3111,13 +3111,13 @@ var Ke = class {
|
|
|
3111
3111
|
section: "Morph",
|
|
3112
3112
|
type: "select",
|
|
3113
3113
|
noRandom: !0,
|
|
3114
|
-
when:
|
|
3114
|
+
when: tt,
|
|
3115
3115
|
options: (e, t = 0) => [{
|
|
3116
3116
|
value: "",
|
|
3117
3117
|
label: "Off"
|
|
3118
|
-
}, ...
|
|
3119
|
-
get: (e, t = 0) =>
|
|
3120
|
-
set: (e, t, n = 0) =>
|
|
3118
|
+
}, ...ie.filter((n) => n.value !== G(e, t)?.font)],
|
|
3119
|
+
get: (e, t = 0) => X(e, t).face2 ?? "",
|
|
3120
|
+
set: (e, t, n = 0) => Z(e, { face2: t }, n)
|
|
3121
3121
|
},
|
|
3122
3122
|
{
|
|
3123
3123
|
key: "morphVf2Wdth",
|
|
@@ -3128,9 +3128,9 @@ var Ke = class {
|
|
|
3128
3128
|
min: 64,
|
|
3129
3129
|
max: 172,
|
|
3130
3130
|
step: 1,
|
|
3131
|
-
when: (e, t = 0) =>
|
|
3132
|
-
get: (e, t = 0) =>
|
|
3133
|
-
set: (e, t, n = 0) =>
|
|
3131
|
+
when: (e, t = 0) => tt(e, t) && !X(e, t).face2 && !!$(e, "wdth", t),
|
|
3132
|
+
get: (e, t = 0) => X(e, t).vf2?.wdth ?? $(e, "wdth", t)?.max ?? 172,
|
|
3133
|
+
set: (e, t, n = 0) => nt(e, "wdth", t, n)
|
|
3134
3134
|
},
|
|
3135
3135
|
{
|
|
3136
3136
|
key: "morphVf2Wght",
|
|
@@ -3141,9 +3141,9 @@ var Ke = class {
|
|
|
3141
3141
|
min: 100,
|
|
3142
3142
|
max: 900,
|
|
3143
3143
|
step: 1,
|
|
3144
|
-
when: (e, t = 0) =>
|
|
3145
|
-
get: (e, t = 0) =>
|
|
3146
|
-
set: (e, t, n = 0) =>
|
|
3144
|
+
when: (e, t = 0) => tt(e, t) && !X(e, t).face2 && !!$(e, "wght", t),
|
|
3145
|
+
get: (e, t = 0) => X(e, t).vf2?.wght ?? $(e, "wght", t)?.max ?? 900,
|
|
3146
|
+
set: (e, t, n = 0) => nt(e, "wght", t, n)
|
|
3147
3147
|
},
|
|
3148
3148
|
{
|
|
3149
3149
|
key: "morphCurve",
|
|
@@ -3151,15 +3151,15 @@ var Ke = class {
|
|
|
3151
3151
|
tab: "style",
|
|
3152
3152
|
section: "Morph",
|
|
3153
3153
|
type: "select",
|
|
3154
|
-
when: (e, t = 0) =>
|
|
3154
|
+
when: (e, t = 0) => et(e, t) && Q(e, t) === "morph",
|
|
3155
3155
|
options: e,
|
|
3156
|
-
get: (e, t = 0) =>
|
|
3157
|
-
set: (e, t, n = 0) =>
|
|
3156
|
+
get: (e, t = 0) => X(e, t).curve ?? "flat",
|
|
3157
|
+
set: (e, t, n = 0) => Z(e, { curve: t }, n)
|
|
3158
3158
|
},
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3159
|
+
ot(1, "x"),
|
|
3160
|
+
ot(1, "y"),
|
|
3161
|
+
ot(2, "x"),
|
|
3162
|
+
ot(2, "y"),
|
|
3163
3163
|
{
|
|
3164
3164
|
key: "morphBlend",
|
|
3165
3165
|
label: "Blend",
|
|
@@ -3169,9 +3169,9 @@ var Ke = class {
|
|
|
3169
3169
|
min: 0,
|
|
3170
3170
|
max: 1,
|
|
3171
3171
|
step: .01,
|
|
3172
|
-
when: (e, t = 0) =>
|
|
3173
|
-
get: (e, t = 0) =>
|
|
3174
|
-
set: (e, t, n = 0) =>
|
|
3172
|
+
when: (e, t = 0) => et(e, t) && Q(e, t) !== "random",
|
|
3173
|
+
get: (e, t = 0) => X(e, t).blend ?? .5,
|
|
3174
|
+
set: (e, t, n = 0) => Z(e, { blend: t }, n)
|
|
3175
3175
|
},
|
|
3176
3176
|
{
|
|
3177
3177
|
key: "morphSeed",
|
|
@@ -3182,9 +3182,9 @@ var Ke = class {
|
|
|
3182
3182
|
min: 0,
|
|
3183
3183
|
max: 1,
|
|
3184
3184
|
step: .01,
|
|
3185
|
-
when: (e, t = 0) =>
|
|
3186
|
-
get: (e, t = 0) =>
|
|
3187
|
-
set: (e, t, n = 0) =>
|
|
3185
|
+
when: (e, t = 0) => et(e, t) && Q(e, t) === "random",
|
|
3186
|
+
get: (e, t = 0) => X(e, t).blend ?? .5,
|
|
3187
|
+
set: (e, t, n = 0) => Z(e, { blend: t }, n)
|
|
3188
3188
|
},
|
|
3189
3189
|
{
|
|
3190
3190
|
key: "mode",
|
|
@@ -3230,7 +3230,7 @@ var Ke = class {
|
|
|
3230
3230
|
label: "Sweep shift"
|
|
3231
3231
|
}
|
|
3232
3232
|
],
|
|
3233
|
-
get:
|
|
3233
|
+
get: Ye,
|
|
3234
3234
|
set: (e, t, n = 0) => J(e, { mode: t }, n)
|
|
3235
3235
|
},
|
|
3236
3236
|
{
|
|
@@ -3245,7 +3245,7 @@ var Ke = class {
|
|
|
3245
3245
|
step: 1,
|
|
3246
3246
|
rMin: 1,
|
|
3247
3247
|
rMax: 3,
|
|
3248
|
-
when: (e, t = 0) =>
|
|
3248
|
+
when: (e, t = 0) => Ye(e, t) !== "none",
|
|
3249
3249
|
get: (e, t = 0) => G(e, t)?.motion?.cycles ?? 1,
|
|
3250
3250
|
set: (e, t, n = 0) => J(e, { cycles: Math.round(t) }, n)
|
|
3251
3251
|
},
|
|
@@ -3264,7 +3264,7 @@ var Ke = class {
|
|
|
3264
3264
|
"sweep",
|
|
3265
3265
|
"sweepWeight",
|
|
3266
3266
|
"sweepShift"
|
|
3267
|
-
].includes(
|
|
3267
|
+
].includes(Ye(e, t)),
|
|
3268
3268
|
get: (e, t = 0) => G(e, t)?.motion?.amp ?? .3,
|
|
3269
3269
|
set: (e, t, n = 0) => J(e, { amp: t }, n)
|
|
3270
3270
|
},
|
|
@@ -3282,7 +3282,7 @@ var Ke = class {
|
|
|
3282
3282
|
"vfwave",
|
|
3283
3283
|
"glyphwave",
|
|
3284
3284
|
"cascade"
|
|
3285
|
-
].includes(
|
|
3285
|
+
].includes(Ye(e, t)),
|
|
3286
3286
|
get: (e, t = 0) => G(e, t)?.motion?.phase ?? .5,
|
|
3287
3287
|
set: (e, t, n = 0) => J(e, { phase: t }, n)
|
|
3288
3288
|
},
|
|
@@ -3291,10 +3291,10 @@ var Ke = class {
|
|
|
3291
3291
|
label: "Axis",
|
|
3292
3292
|
tab: "anim",
|
|
3293
3293
|
type: "select",
|
|
3294
|
-
when: (e, t = 0) => ["vfwave", "sweepWeight"].includes(
|
|
3295
|
-
options: (e, t = 0) =>
|
|
3294
|
+
when: (e, t = 0) => ["vfwave", "sweepWeight"].includes(Ye(e, t)) && T(G(e, t)?.font).axes.length > 1,
|
|
3295
|
+
options: (e, t = 0) => T(G(e, t)?.font).axes.map((e) => ({
|
|
3296
3296
|
value: e.tag,
|
|
3297
|
-
label:
|
|
3297
|
+
label: D[e.tag] || e.tag
|
|
3298
3298
|
})),
|
|
3299
3299
|
get: (e, t = 0) => G(e, t)?.motion?.axis ?? "wght",
|
|
3300
3300
|
set: (e, t, n = 0) => J(e, { axis: t }, n)
|
|
@@ -3308,7 +3308,7 @@ var Ke = class {
|
|
|
3308
3308
|
"sweep",
|
|
3309
3309
|
"sweepWeight",
|
|
3310
3310
|
"sweepShift"
|
|
3311
|
-
].includes(
|
|
3311
|
+
].includes(Ye(e, t)),
|
|
3312
3312
|
options: [
|
|
3313
3313
|
{
|
|
3314
3314
|
value: "x",
|
|
@@ -3347,7 +3347,7 @@ var Ke = class {
|
|
|
3347
3347
|
max: 1,
|
|
3348
3348
|
step: .01,
|
|
3349
3349
|
get: (e) => G(e)?.stagger ?? 0,
|
|
3350
|
-
set: (e, t) =>
|
|
3350
|
+
set: (e, t) => Je(e, (e, n, r) => ({
|
|
3351
3351
|
stagger: t,
|
|
3352
3352
|
phase: r > 1 ? n / r * t : 0
|
|
3353
3353
|
}))
|
|
@@ -3368,37 +3368,37 @@ var Ke = class {
|
|
|
3368
3368
|
get: (e, t = 0) => G(e, t)?.path?.spin ?? 1,
|
|
3369
3369
|
set: (e, t, n = 0) => q(e, { spin: Math.round(t) }, n)
|
|
3370
3370
|
}
|
|
3371
|
-
],
|
|
3371
|
+
], ct = (e, t, n = 0) => typeof e.options == "function" ? e.options(t, n) : e.options ?? [], lt = (e, t, n = 0) => ({
|
|
3372
3372
|
min: typeof e.min == "function" ? e.min(t, n) : e.min,
|
|
3373
3373
|
max: typeof e.max == "function" ? e.max(t, n) : e.max
|
|
3374
3374
|
});
|
|
3375
|
-
function
|
|
3375
|
+
function ut(e, t = 0, n = Math.random, r = null) {
|
|
3376
3376
|
let i = e;
|
|
3377
|
-
for (let e of
|
|
3377
|
+
for (let e of st) if (!(e.noRandom || e.type === "color") && !(r && !r.includes(e.tab)) && !(e.when && !e.when(i, t))) {
|
|
3378
3378
|
if (e.type === "range") {
|
|
3379
|
-
let r =
|
|
3379
|
+
let r = lt(e, i, t), a = e.rMin ?? r.min, o = e.rMax ?? r.max, s = e.step ?? 1, c = a + n() * (o - a);
|
|
3380
3380
|
i = e.set(i, Math.min(o, Math.max(a, Number((Math.round(c / s) * s).toFixed(4)))), t);
|
|
3381
3381
|
} else if (e.type === "select") {
|
|
3382
|
-
let r =
|
|
3382
|
+
let r = ct(e, i, t);
|
|
3383
3383
|
r.length && (i = e.set(i, r[Math.floor(n() * r.length)].value, t));
|
|
3384
3384
|
}
|
|
3385
3385
|
}
|
|
3386
3386
|
return i;
|
|
3387
3387
|
}
|
|
3388
|
-
var
|
|
3389
|
-
function
|
|
3388
|
+
var dt = (e, t) => `kin:${e}:${t}`;
|
|
3389
|
+
function ft(e, t) {
|
|
3390
3390
|
let n = e;
|
|
3391
3391
|
for (let e in t) {
|
|
3392
3392
|
let r = /^kin:(\d+):(.+)$/.exec(e);
|
|
3393
3393
|
if (!r || typeof t[e] != "number") continue;
|
|
3394
|
-
let i =
|
|
3394
|
+
let i = st.find((e) => e.key === r[2]);
|
|
3395
3395
|
i?.type === "range" && (n = i.set(n, t[e], Number(r[1])));
|
|
3396
3396
|
}
|
|
3397
3397
|
return n;
|
|
3398
3398
|
}
|
|
3399
3399
|
//#endregion
|
|
3400
3400
|
//#region src/editor/compose/inspectors/KineticPanel.jsx
|
|
3401
|
-
var
|
|
3401
|
+
var pt = {
|
|
3402
3402
|
key: "morphBlend",
|
|
3403
3403
|
label: "Morph blend",
|
|
3404
3404
|
type: "range",
|
|
@@ -3406,21 +3406,21 @@ var ft = {
|
|
|
3406
3406
|
max: 1,
|
|
3407
3407
|
step: .01,
|
|
3408
3408
|
default: .5
|
|
3409
|
-
},
|
|
3409
|
+
}, mt = new Set([
|
|
3410
3410
|
"mode",
|
|
3411
3411
|
"cycles",
|
|
3412
3412
|
"motionAmp",
|
|
3413
3413
|
"motionPhase",
|
|
3414
3414
|
"axis",
|
|
3415
3415
|
"field"
|
|
3416
|
-
]),
|
|
3416
|
+
]), ht = {
|
|
3417
3417
|
mode: "glyphwave",
|
|
3418
3418
|
cycles: 1,
|
|
3419
3419
|
phase: .5,
|
|
3420
3420
|
amp: .3,
|
|
3421
3421
|
axis: "wght",
|
|
3422
3422
|
field: "x"
|
|
3423
|
-
},
|
|
3423
|
+
}, gt = new Set([
|
|
3424
3424
|
"align",
|
|
3425
3425
|
"italic",
|
|
3426
3426
|
"fill",
|
|
@@ -3428,205 +3428,205 @@ var ft = {
|
|
|
3428
3428
|
"vfWght",
|
|
3429
3429
|
"offsetX",
|
|
3430
3430
|
"offsetY"
|
|
3431
|
-
]),
|
|
3432
|
-
function
|
|
3433
|
-
let
|
|
3431
|
+
]), _t = (e, t) => e ? String.fromCharCode(97 + t.indexOf(e) % 26) : null;
|
|
3432
|
+
function vt({ layer: e, setProp: t, updateLayer: r, palette: i, renderAnimate: o, tab: s, tabStrip: u, picker: d = !0 }) {
|
|
3433
|
+
let f = a(), p = e.comp ?? {
|
|
3434
3434
|
bg: "#0b0d12",
|
|
3435
3435
|
instances: []
|
|
3436
|
-
},
|
|
3437
|
-
|
|
3436
|
+
}, v = p.instances ?? [], [C, T] = M(0), E = Math.min(C, Math.max(0, v.length - 1)), ne = (t) => {
|
|
3437
|
+
T(t), window.dispatchEvent(new CustomEvent("kol:kinetic-element", { detail: {
|
|
3438
3438
|
id: e.id,
|
|
3439
3439
|
index: t,
|
|
3440
3440
|
from: "panel"
|
|
3441
3441
|
} }));
|
|
3442
3442
|
};
|
|
3443
|
-
|
|
3443
|
+
ge(() => {
|
|
3444
3444
|
let t = (t) => {
|
|
3445
|
-
t.detail?.id === e.id && t.detail.from === "canvas" &&
|
|
3445
|
+
t.detail?.id === e.id && t.detail.from === "canvas" && T(t.detail.index);
|
|
3446
3446
|
};
|
|
3447
3447
|
return window.addEventListener("kol:kinetic-element", t), () => window.removeEventListener("kol:kinetic-element", t);
|
|
3448
3448
|
}, [e.id]);
|
|
3449
|
-
let [
|
|
3450
|
-
let t =
|
|
3451
|
-
return t ?
|
|
3452
|
-
}, [
|
|
3449
|
+
let [D, re] = M([]), ie = (e) => re((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), ae = (e) => {
|
|
3450
|
+
let t = v[e]?.group;
|
|
3451
|
+
return t ? v.reduce((e, n, r) => n.group === t ? [...e, r] : e, []) : [e];
|
|
3452
|
+
}, [oe, se] = M(0), O = v[E]?.motions ?? [], k = Math.min(oe, O.length), ce = (e) => ({
|
|
3453
3453
|
...e,
|
|
3454
|
-
instances: (e.instances ?? []).map((e, t) => t ===
|
|
3454
|
+
instances: (e.instances ?? []).map((e, t) => t === E ? {
|
|
3455
3455
|
...e,
|
|
3456
|
-
motion: { ...e.motions?.[
|
|
3456
|
+
motion: { ...e.motions?.[k - 1] ?? {} }
|
|
3457
3457
|
} : e)
|
|
3458
|
-
}),
|
|
3458
|
+
}), le = (e) => mt.has(e.key) && k > 0 ? ce(p) : p, ue = (t) => {
|
|
3459
3459
|
t && (r(e.id, {
|
|
3460
3460
|
presetId: t.id,
|
|
3461
3461
|
presetLabel: t.label,
|
|
3462
|
-
comp:
|
|
3463
|
-
}),
|
|
3464
|
-
},
|
|
3465
|
-
...
|
|
3462
|
+
comp: Fe(t)
|
|
3463
|
+
}), T(0), se(0));
|
|
3464
|
+
}, de = (e) => t("comp", e), A = (t) => r(e.id, { comp: {
|
|
3465
|
+
...p,
|
|
3466
3466
|
instances: t
|
|
3467
|
-
} }),
|
|
3468
|
-
...
|
|
3469
|
-
instances:
|
|
3467
|
+
} }), fe = (e, t) => de({
|
|
3468
|
+
...p,
|
|
3469
|
+
instances: v.map((n, r) => r === e ? {
|
|
3470
3470
|
...n,
|
|
3471
3471
|
...t
|
|
3472
3472
|
} : n)
|
|
3473
|
-
}),
|
|
3474
|
-
if (
|
|
3475
|
-
let e = new Set(
|
|
3473
|
+
}), pe = () => {
|
|
3474
|
+
if (D.length < 2) return;
|
|
3475
|
+
let e = new Set(v.map((e) => e.group).filter(Boolean)), t = 1;
|
|
3476
3476
|
for (; e.has(`g${t}`);) t++;
|
|
3477
|
-
|
|
3477
|
+
A(v.map((e) => D.includes(e.id) ? {
|
|
3478
3478
|
...e,
|
|
3479
3479
|
group: `g${t}`
|
|
3480
|
-
} : e)),
|
|
3481
|
-
},
|
|
3482
|
-
|
|
3480
|
+
} : e)), re([]);
|
|
3481
|
+
}, me = () => {
|
|
3482
|
+
D.length && (A(v.map((e) => D.includes(e.id) ? {
|
|
3483
3483
|
...e,
|
|
3484
3484
|
group: null
|
|
3485
|
-
} : e)),
|
|
3486
|
-
},
|
|
3487
|
-
if (
|
|
3488
|
-
let n = e.set(
|
|
3489
|
-
|
|
3485
|
+
} : e)), re([]));
|
|
3486
|
+
}, ve = (e, t) => {
|
|
3487
|
+
if (mt.has(e.key) && k > 0) {
|
|
3488
|
+
let n = e.set(ce(p), t, E).instances?.[E]?.motion ?? {};
|
|
3489
|
+
fe(E, { motions: O.map((e, t) => t === k - 1 ? n : e) });
|
|
3490
3490
|
return;
|
|
3491
3491
|
}
|
|
3492
|
-
let n =
|
|
3493
|
-
if (n.length > 1 &&
|
|
3494
|
-
let r =
|
|
3492
|
+
let n = ae(E);
|
|
3493
|
+
if (n.length > 1 && gt.has(e.key)) {
|
|
3494
|
+
let r = p;
|
|
3495
3495
|
if (e.key === "fontSize") {
|
|
3496
|
-
let i = Number(e.get(
|
|
3496
|
+
let i = Number(e.get(p, E)) || 1, a = t / i;
|
|
3497
3497
|
for (let t of n) {
|
|
3498
|
-
let n = Number(e.get(
|
|
3498
|
+
let n = Number(e.get(p, t)) || i;
|
|
3499
3499
|
r = e.set(r, Math.max(8, Math.min(1200, Math.round(n * a))), t);
|
|
3500
3500
|
}
|
|
3501
3501
|
} else if (e.key === "offsetX" || e.key === "offsetY") {
|
|
3502
|
-
let i = t - (Number(e.get(
|
|
3503
|
-
for (let t of n) r = e.set(r, (Number(e.get(
|
|
3502
|
+
let i = t - (Number(e.get(p, E)) || 0);
|
|
3503
|
+
for (let t of n) r = e.set(r, (Number(e.get(p, t)) || 0) + i, t);
|
|
3504
3504
|
} else for (let i of n) r = e.set(r, t, i);
|
|
3505
|
-
|
|
3505
|
+
de(r);
|
|
3506
3506
|
return;
|
|
3507
3507
|
}
|
|
3508
|
-
|
|
3509
|
-
},
|
|
3510
|
-
let n =
|
|
3508
|
+
de(e.set(p, t, E));
|
|
3509
|
+
}, F = h(e), I = (t = null) => {
|
|
3510
|
+
let n = F.take();
|
|
3511
3511
|
r(e.id, {
|
|
3512
|
-
comp:
|
|
3512
|
+
comp: ut(p, E, _(n >>> 0), t),
|
|
3513
3513
|
_rollSeed: n
|
|
3514
3514
|
});
|
|
3515
3515
|
}, ye = () => {
|
|
3516
|
-
let t =
|
|
3517
|
-
|
|
3518
|
-
i =
|
|
3516
|
+
let t = F.take(), n = _(t >>> 0), i = p;
|
|
3517
|
+
v.forEach((e, t) => {
|
|
3518
|
+
i = ut(i, t, n);
|
|
3519
3519
|
}), r(e.id, {
|
|
3520
3520
|
comp: i,
|
|
3521
3521
|
_rollSeed: t
|
|
3522
3522
|
});
|
|
3523
3523
|
}, be = () => {
|
|
3524
3524
|
let t = V.find((t) => t.id === e.presetId), n = V.filter((e) => e.id !== t?.id && (!t || e.sub === t.sub));
|
|
3525
|
-
n.length &&
|
|
3525
|
+
n.length && ue(n[Math.floor(_(F.take() >>> 0)() * n.length)]);
|
|
3526
3526
|
}, xe = () => {
|
|
3527
|
-
let e =
|
|
3528
|
-
Ce(
|
|
3529
|
-
}, Se = () =>
|
|
3530
|
-
let i =
|
|
3527
|
+
let e = _(F.take() >>> 0);
|
|
3528
|
+
Ce(w[Math.floor(e() * w.length)].value, e() < .5);
|
|
3529
|
+
}, Se = () => ue(V.find((t) => t.id === e.presetId) ?? V[0]), Ce = (t, n) => {
|
|
3530
|
+
let i = l(t, n);
|
|
3531
3531
|
r(e.id, {
|
|
3532
3532
|
themeId: t,
|
|
3533
3533
|
themeInvert: n,
|
|
3534
3534
|
comp: {
|
|
3535
|
-
...
|
|
3535
|
+
...p,
|
|
3536
3536
|
bg: i.bg,
|
|
3537
|
-
instances:
|
|
3537
|
+
instances: v.map((e) => ({
|
|
3538
3538
|
...e,
|
|
3539
3539
|
fill: i.fg
|
|
3540
3540
|
}))
|
|
3541
3541
|
}
|
|
3542
3542
|
});
|
|
3543
|
-
},
|
|
3544
|
-
...
|
|
3545
|
-
instances:
|
|
3543
|
+
}, we = (e) => de({
|
|
3544
|
+
...p,
|
|
3545
|
+
instances: v.map((t) => ({
|
|
3546
3546
|
...t,
|
|
3547
3547
|
fill: e
|
|
3548
3548
|
}))
|
|
3549
|
-
}),
|
|
3550
|
-
return /* @__PURE__ */
|
|
3551
|
-
|
|
3552
|
-
|
|
3549
|
+
}), Te = s === "labs-effect" ? "style" : s, Ee = st.filter((e) => e.tab === Te && (!e.when || e.when(le(e), E))), De = v.some((e) => e?.morph?.on), L = v[E];
|
|
3550
|
+
return /* @__PURE__ */ P(_e, { children: [
|
|
3551
|
+
u,
|
|
3552
|
+
d && /* @__PURE__ */ N(yt, {
|
|
3553
3553
|
layer: e,
|
|
3554
|
-
onPreset:
|
|
3554
|
+
onPreset: ue
|
|
3555
3555
|
}),
|
|
3556
|
-
s === "generate" || s === "labs-effect" ? /* @__PURE__ */
|
|
3556
|
+
s === "generate" || s === "labs-effect" ? /* @__PURE__ */ P("div", {
|
|
3557
3557
|
className: "flex flex-col gap-1",
|
|
3558
3558
|
children: [
|
|
3559
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ N("span", {
|
|
3560
3560
|
className: "kol-eyebrow text-fg-80",
|
|
3561
3561
|
children: "Elements"
|
|
3562
3562
|
}),
|
|
3563
|
-
/* @__PURE__ */
|
|
3564
|
-
insts:
|
|
3565
|
-
idx:
|
|
3566
|
-
onSelect:
|
|
3567
|
-
onWrite:
|
|
3568
|
-
marked:
|
|
3569
|
-
onMark:
|
|
3570
|
-
onGroup:
|
|
3571
|
-
onUngroup:
|
|
3563
|
+
/* @__PURE__ */ N(bt, {
|
|
3564
|
+
insts: v,
|
|
3565
|
+
idx: E,
|
|
3566
|
+
onSelect: ne,
|
|
3567
|
+
onWrite: A,
|
|
3568
|
+
marked: D,
|
|
3569
|
+
onMark: ie,
|
|
3570
|
+
onGroup: pe,
|
|
3571
|
+
onUngroup: me
|
|
3572
3572
|
}),
|
|
3573
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ N(j, {
|
|
3574
3574
|
label: "Edit elements on the canvas (click to select, drag to move, corners to scale)",
|
|
3575
|
-
children: /* @__PURE__ */
|
|
3575
|
+
children: /* @__PURE__ */ N(b, {
|
|
3576
3576
|
"aria-label": "Edit elements on the canvas (click to select, drag to move, corners to scale)",
|
|
3577
3577
|
tone: "primary",
|
|
3578
|
-
size:
|
|
3578
|
+
size: f,
|
|
3579
3579
|
className: "w-full",
|
|
3580
3580
|
onClick: () => window.dispatchEvent(new CustomEvent("kol:kinetic-edit", { detail: {
|
|
3581
3581
|
id: e.id,
|
|
3582
|
-
index:
|
|
3582
|
+
index: E
|
|
3583
3583
|
} })),
|
|
3584
3584
|
children: "Edit on canvas"
|
|
3585
3585
|
})
|
|
3586
3586
|
})
|
|
3587
3587
|
]
|
|
3588
|
-
}) :
|
|
3588
|
+
}) : v.length > 1 && /* @__PURE__ */ P("span", {
|
|
3589
3589
|
className: "kol-helper-12 text-meta truncate",
|
|
3590
3590
|
children: [
|
|
3591
3591
|
"Element ",
|
|
3592
|
-
|
|
3592
|
+
E + 1,
|
|
3593
3593
|
" · ",
|
|
3594
|
-
|
|
3594
|
+
L?.text || "—"
|
|
3595
3595
|
]
|
|
3596
3596
|
}),
|
|
3597
|
-
(s === "generate" || s === "labs-effect") && /* @__PURE__ */
|
|
3598
|
-
/* @__PURE__ */
|
|
3597
|
+
(s === "generate" || s === "labs-effect") && /* @__PURE__ */ P(_e, { children: [
|
|
3598
|
+
/* @__PURE__ */ N(x, {
|
|
3599
3599
|
label: "TEXT",
|
|
3600
|
-
children: /* @__PURE__ */
|
|
3600
|
+
children: /* @__PURE__ */ N(m, {
|
|
3601
3601
|
variant: "filled",
|
|
3602
|
-
size:
|
|
3602
|
+
size: f,
|
|
3603
3603
|
rows: 2,
|
|
3604
3604
|
axis: "y",
|
|
3605
|
-
value:
|
|
3606
|
-
onChange: (e) =>
|
|
3605
|
+
value: v[E]?.text ?? "",
|
|
3606
|
+
onChange: (e) => fe(E, { text: e.target.value })
|
|
3607
3607
|
})
|
|
3608
3608
|
}),
|
|
3609
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ P("div", {
|
|
3610
3610
|
className: "flex flex-col gap-2",
|
|
3611
|
-
children: [/* @__PURE__ */
|
|
3611
|
+
children: [/* @__PURE__ */ N(y, {
|
|
3612
3612
|
label: "Theme",
|
|
3613
3613
|
align: "fill",
|
|
3614
3614
|
labelWidth: n,
|
|
3615
|
-
children: /* @__PURE__ */
|
|
3615
|
+
children: /* @__PURE__ */ N(g, {
|
|
3616
3616
|
variant: "subtle",
|
|
3617
|
-
size:
|
|
3617
|
+
size: f,
|
|
3618
3618
|
className: "w-full",
|
|
3619
|
-
options:
|
|
3619
|
+
options: w,
|
|
3620
3620
|
value: e.themeId ?? "kol",
|
|
3621
3621
|
onChange: (t) => Ce(t, !!e.themeInvert)
|
|
3622
3622
|
})
|
|
3623
|
-
}), /* @__PURE__ */
|
|
3623
|
+
}), /* @__PURE__ */ N(y, {
|
|
3624
3624
|
label: "Invert",
|
|
3625
3625
|
align: "fill",
|
|
3626
3626
|
labelWidth: n,
|
|
3627
|
-
children: /* @__PURE__ */
|
|
3627
|
+
children: /* @__PURE__ */ N(te, {
|
|
3628
3628
|
layout: "joined",
|
|
3629
|
-
size:
|
|
3629
|
+
size: f,
|
|
3630
3630
|
className: "w-full",
|
|
3631
3631
|
options: [{
|
|
3632
3632
|
value: "off",
|
|
@@ -3640,33 +3640,33 @@ function _t({ layer: e, setProp: t, updateLayer: r, palette: i, renderAnimate: o
|
|
|
3640
3640
|
})
|
|
3641
3641
|
})]
|
|
3642
3642
|
}),
|
|
3643
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ N(c, {
|
|
3644
3644
|
inline: !0,
|
|
3645
3645
|
label: "Text color",
|
|
3646
|
-
value:
|
|
3647
|
-
onChange: (e) =>
|
|
3646
|
+
value: v[0]?.fill,
|
|
3647
|
+
onChange: (e) => we(S(e, i) ?? e),
|
|
3648
3648
|
palette: i
|
|
3649
3649
|
}),
|
|
3650
|
-
/* @__PURE__ */
|
|
3650
|
+
/* @__PURE__ */ N(b, {
|
|
3651
3651
|
tone: "primary",
|
|
3652
|
-
size:
|
|
3652
|
+
size: f,
|
|
3653
3653
|
className: "w-full",
|
|
3654
3654
|
onClick: be,
|
|
3655
3655
|
children: "Randomize preset"
|
|
3656
3656
|
}),
|
|
3657
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ P("div", {
|
|
3658
3658
|
className: "flex gap-2",
|
|
3659
|
-
children: [/* @__PURE__ */
|
|
3659
|
+
children: [/* @__PURE__ */ N(b, {
|
|
3660
3660
|
tone: "primary",
|
|
3661
|
-
size:
|
|
3661
|
+
size: f,
|
|
3662
3662
|
className: "flex-1 min-w-0",
|
|
3663
|
-
onClick: () =>
|
|
3663
|
+
onClick: () => I(),
|
|
3664
3664
|
children: "Randomize all"
|
|
3665
|
-
}), /* @__PURE__ */
|
|
3665
|
+
}), /* @__PURE__ */ N(j, {
|
|
3666
3666
|
label: "Reset to defaults",
|
|
3667
|
-
children: /* @__PURE__ */
|
|
3667
|
+
children: /* @__PURE__ */ N(b, {
|
|
3668
3668
|
tone: "primary",
|
|
3669
|
-
size:
|
|
3669
|
+
size: f,
|
|
3670
3670
|
iconOnly: "refresh",
|
|
3671
3671
|
"aria-label": "Reset to defaults",
|
|
3672
3672
|
onClick: Se,
|
|
@@ -3674,109 +3674,109 @@ function _t({ layer: e, setProp: t, updateLayer: r, palette: i, renderAnimate: o
|
|
|
3674
3674
|
})
|
|
3675
3675
|
})]
|
|
3676
3676
|
}),
|
|
3677
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ P("div", {
|
|
3678
3678
|
className: "grid grid-cols-2 gap-2",
|
|
3679
3679
|
children: [
|
|
3680
|
-
/* @__PURE__ */
|
|
3680
|
+
/* @__PURE__ */ N(b, {
|
|
3681
3681
|
tone: "primary",
|
|
3682
|
-
size:
|
|
3682
|
+
size: f,
|
|
3683
3683
|
onClick: xe,
|
|
3684
3684
|
children: "Color"
|
|
3685
3685
|
}),
|
|
3686
|
-
/* @__PURE__ */
|
|
3686
|
+
/* @__PURE__ */ N(b, {
|
|
3687
3687
|
tone: "primary",
|
|
3688
|
-
size:
|
|
3689
|
-
onClick: () =>
|
|
3688
|
+
size: f,
|
|
3689
|
+
onClick: () => I(["style"]),
|
|
3690
3690
|
children: "Type"
|
|
3691
3691
|
}),
|
|
3692
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ N(b, {
|
|
3693
3693
|
tone: "primary",
|
|
3694
|
-
size:
|
|
3695
|
-
onClick: () =>
|
|
3694
|
+
size: f,
|
|
3695
|
+
onClick: () => I(["anim"]),
|
|
3696
3696
|
children: "Motion"
|
|
3697
3697
|
}),
|
|
3698
|
-
/* @__PURE__ */
|
|
3698
|
+
/* @__PURE__ */ N(b, {
|
|
3699
3699
|
tone: "primary",
|
|
3700
|
-
size:
|
|
3700
|
+
size: f,
|
|
3701
3701
|
onClick: ye,
|
|
3702
3702
|
children: "All elements"
|
|
3703
3703
|
})
|
|
3704
3704
|
]
|
|
3705
3705
|
}),
|
|
3706
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ N(ee, { seed: F })
|
|
3707
3707
|
] }),
|
|
3708
|
-
s === "anim" && /* @__PURE__ */
|
|
3709
|
-
motions:
|
|
3710
|
-
mIdx:
|
|
3711
|
-
onSelect:
|
|
3708
|
+
s === "anim" && /* @__PURE__ */ N(St, {
|
|
3709
|
+
motions: O,
|
|
3710
|
+
mIdx: k,
|
|
3711
|
+
onSelect: se,
|
|
3712
3712
|
onAdd: () => {
|
|
3713
|
-
|
|
3713
|
+
A(v.map((e, t) => t === E ? {
|
|
3714
3714
|
...e,
|
|
3715
|
-
motions: [...
|
|
3716
|
-
} : e)),
|
|
3715
|
+
motions: [...O, { ...ht }]
|
|
3716
|
+
} : e)), se(O.length + 1);
|
|
3717
3717
|
},
|
|
3718
3718
|
onRemove: () => {
|
|
3719
|
-
|
|
3719
|
+
k !== 0 && (A(v.map((e, t) => t === E ? {
|
|
3720
3720
|
...e,
|
|
3721
|
-
motions:
|
|
3722
|
-
} : e)),
|
|
3721
|
+
motions: O.filter((e, t) => t !== k - 1)
|
|
3722
|
+
} : e)), se(k - 1));
|
|
3723
3723
|
}
|
|
3724
3724
|
}),
|
|
3725
|
-
s !== "generate" &&
|
|
3726
|
-
n.key === "arrangement" && /* @__PURE__ */
|
|
3725
|
+
s !== "generate" && Ee.map((n, r) => /* @__PURE__ */ P(he, { children: [
|
|
3726
|
+
n.key === "arrangement" && /* @__PURE__ */ P(_e, { children: [/* @__PURE__ */ N("span", {
|
|
3727
3727
|
className: "kol-eyebrow text-fg-80",
|
|
3728
3728
|
children: "OpenType"
|
|
3729
|
-
}), /* @__PURE__ */
|
|
3730
|
-
value:
|
|
3731
|
-
onToggle: (e, t) =>
|
|
3732
|
-
...
|
|
3729
|
+
}), /* @__PURE__ */ N(Ct, {
|
|
3730
|
+
value: L?.opentype ?? {},
|
|
3731
|
+
onToggle: (e, t) => fe(E, { opentype: {
|
|
3732
|
+
...L?.opentype ?? {},
|
|
3733
3733
|
[e]: t
|
|
3734
3734
|
} })
|
|
3735
3735
|
})] }),
|
|
3736
|
-
n.section && n.section !==
|
|
3736
|
+
n.section && n.section !== Ee[r - 1]?.section && /* @__PURE__ */ N("span", {
|
|
3737
3737
|
className: "kol-eyebrow text-fg-80",
|
|
3738
3738
|
children: n.section
|
|
3739
3739
|
}),
|
|
3740
|
-
/* @__PURE__ */
|
|
3740
|
+
/* @__PURE__ */ N(xt, {
|
|
3741
3741
|
knob: n,
|
|
3742
|
-
comp:
|
|
3743
|
-
idx:
|
|
3742
|
+
comp: le(n),
|
|
3743
|
+
idx: E,
|
|
3744
3744
|
palette: i,
|
|
3745
|
-
onWrite:
|
|
3746
|
-
bridge:
|
|
3745
|
+
onWrite: ve,
|
|
3746
|
+
bridge: mt.has(n.key) && k > 0 ? null : {
|
|
3747
3747
|
layer: e,
|
|
3748
3748
|
setProp: t,
|
|
3749
3749
|
renderAnimate: o,
|
|
3750
|
-
key:
|
|
3750
|
+
key: dt(E, n.key)
|
|
3751
3751
|
}
|
|
3752
3752
|
}),
|
|
3753
|
-
n.key === "showPath" &&
|
|
3754
|
-
inst:
|
|
3753
|
+
n.key === "showPath" && L?.path?.type === "custom" && /* @__PURE__ */ N(wt, {
|
|
3754
|
+
inst: L,
|
|
3755
3755
|
layer: e,
|
|
3756
|
-
onPoints: (e) =>
|
|
3757
|
-
...
|
|
3756
|
+
onPoints: (e) => fe(E, { path: {
|
|
3757
|
+
...L?.path ?? {},
|
|
3758
3758
|
points: e
|
|
3759
3759
|
} })
|
|
3760
3760
|
})
|
|
3761
3761
|
] }, n.key)),
|
|
3762
|
-
s === "anim" &&
|
|
3762
|
+
s === "anim" && De && /* @__PURE__ */ N(Tt, {
|
|
3763
3763
|
layer: e,
|
|
3764
3764
|
setProp: t,
|
|
3765
|
-
insts:
|
|
3765
|
+
insts: v,
|
|
3766
3766
|
renderAnimate: o
|
|
3767
3767
|
})
|
|
3768
3768
|
] });
|
|
3769
3769
|
}
|
|
3770
|
-
function
|
|
3771
|
-
return /* @__PURE__ */
|
|
3772
|
-
tree:
|
|
3770
|
+
function yt({ layer: e, onPreset: t }) {
|
|
3771
|
+
return /* @__PURE__ */ N(ae, {
|
|
3772
|
+
tree: Pe,
|
|
3773
3773
|
presets: V,
|
|
3774
3774
|
current: V.find((t) => t.id === e.presetId) ?? V[0],
|
|
3775
3775
|
onPick: t,
|
|
3776
3776
|
inline: !0
|
|
3777
3777
|
});
|
|
3778
3778
|
}
|
|
3779
|
-
function
|
|
3779
|
+
function bt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, onGroup: s, onUngroup: c }) {
|
|
3780
3780
|
let l = a(), u = () => {
|
|
3781
3781
|
let t = e.length;
|
|
3782
3782
|
for (; e.some((e) => e.id === `i${t}`);) t++;
|
|
@@ -3786,7 +3786,7 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3786
3786
|
id: u(),
|
|
3787
3787
|
text: "Text"
|
|
3788
3788
|
};
|
|
3789
|
-
e[t]?.fill && (i.fill = e[t].fill), r([...e,
|
|
3789
|
+
e[t]?.fill && (i.fill = e[t].fill), r([...e, ke(i, e.length)]), n(e.length);
|
|
3790
3790
|
}, f = (t) => {
|
|
3791
3791
|
let i = {
|
|
3792
3792
|
...structuredClone(e[t]),
|
|
@@ -3801,39 +3801,39 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3801
3801
|
let o = [...e], [s] = o.splice(t, 1);
|
|
3802
3802
|
o.splice(a, 0, s), r(o), n(a);
|
|
3803
3803
|
}, h = [...new Set(e.map((e) => e.group).filter(Boolean))];
|
|
3804
|
-
return /* @__PURE__ */
|
|
3805
|
-
/* @__PURE__ */
|
|
3804
|
+
return /* @__PURE__ */ P(_e, { children: [
|
|
3805
|
+
/* @__PURE__ */ N("div", {
|
|
3806
3806
|
className: "flex flex-col gap-1",
|
|
3807
3807
|
children: e.map((r, a) => {
|
|
3808
|
-
let s =
|
|
3809
|
-
return /* @__PURE__ */
|
|
3808
|
+
let s = _t(r.group, h);
|
|
3809
|
+
return /* @__PURE__ */ P("div", {
|
|
3810
3810
|
onClick: () => n(a),
|
|
3811
3811
|
className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${a === t ? "bg-oq-08 text-emphasis" : "text-body hover:bg-oq-04 hover:text-emphasis"}`,
|
|
3812
3812
|
children: [
|
|
3813
|
-
/* @__PURE__ */
|
|
3813
|
+
/* @__PURE__ */ N("span", {
|
|
3814
3814
|
onClick: (e) => e.stopPropagation(),
|
|
3815
3815
|
className: "shrink-0",
|
|
3816
3816
|
style: { lineHeight: 0 },
|
|
3817
|
-
children: /* @__PURE__ */
|
|
3817
|
+
children: /* @__PURE__ */ N(fe, {
|
|
3818
3818
|
checked: i.includes(r.id),
|
|
3819
3819
|
onChange: () => o(r.id)
|
|
3820
3820
|
})
|
|
3821
3821
|
}),
|
|
3822
|
-
/* @__PURE__ */
|
|
3822
|
+
/* @__PURE__ */ N("span", {
|
|
3823
3823
|
className: "kol-helper-10 text-meta shrink-0",
|
|
3824
3824
|
children: a + 1
|
|
3825
3825
|
}),
|
|
3826
|
-
/* @__PURE__ */
|
|
3826
|
+
/* @__PURE__ */ N("span", {
|
|
3827
3827
|
className: "truncate flex-1 min-w-0",
|
|
3828
3828
|
children: r.text || "—"
|
|
3829
3829
|
}),
|
|
3830
|
-
s && /* @__PURE__ */
|
|
3830
|
+
s && /* @__PURE__ */ P("span", {
|
|
3831
3831
|
className: "shrink-0 kol-helper-10 text-meta",
|
|
3832
3832
|
children: ["grp ", s]
|
|
3833
3833
|
}),
|
|
3834
|
-
/* @__PURE__ */
|
|
3834
|
+
/* @__PURE__ */ N(j, {
|
|
3835
3835
|
label: "Duplicate element",
|
|
3836
|
-
children: /* @__PURE__ */
|
|
3836
|
+
children: /* @__PURE__ */ N(b, {
|
|
3837
3837
|
tone: "ghost",
|
|
3838
3838
|
size: l,
|
|
3839
3839
|
quiet: !0,
|
|
@@ -3845,12 +3845,12 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3845
3845
|
}
|
|
3846
3846
|
})
|
|
3847
3847
|
}),
|
|
3848
|
-
/* @__PURE__ */
|
|
3848
|
+
/* @__PURE__ */ N("span", {
|
|
3849
3849
|
className: e.length <= 1 ? "invisible pointer-events-none" : "contents",
|
|
3850
3850
|
"aria-hidden": e.length <= 1 || void 0,
|
|
3851
|
-
children: /* @__PURE__ */
|
|
3851
|
+
children: /* @__PURE__ */ N(j, {
|
|
3852
3852
|
label: "Delete element",
|
|
3853
|
-
children: /* @__PURE__ */
|
|
3853
|
+
children: /* @__PURE__ */ N(b, {
|
|
3854
3854
|
tone: "ghost",
|
|
3855
3855
|
size: l,
|
|
3856
3856
|
quiet: !0,
|
|
@@ -3867,24 +3867,24 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3867
3867
|
}, r.id ?? a);
|
|
3868
3868
|
})
|
|
3869
3869
|
}),
|
|
3870
|
-
i.length > 0 && /* @__PURE__ */
|
|
3870
|
+
i.length > 0 && /* @__PURE__ */ P("div", {
|
|
3871
3871
|
className: "grid grid-cols-2 gap-1",
|
|
3872
|
-
children: [i.length >= 2 && /* @__PURE__ */
|
|
3872
|
+
children: [i.length >= 2 && /* @__PURE__ */ N(b, {
|
|
3873
3873
|
tone: "primary",
|
|
3874
3874
|
size: l,
|
|
3875
3875
|
onClick: s,
|
|
3876
3876
|
children: "Group"
|
|
3877
|
-
}), /* @__PURE__ */
|
|
3877
|
+
}), /* @__PURE__ */ N(b, {
|
|
3878
3878
|
tone: "primary",
|
|
3879
3879
|
size: l,
|
|
3880
3880
|
onClick: c,
|
|
3881
3881
|
children: "Ungroup"
|
|
3882
3882
|
})]
|
|
3883
3883
|
}),
|
|
3884
|
-
/* @__PURE__ */
|
|
3884
|
+
/* @__PURE__ */ P("div", {
|
|
3885
3885
|
className: "flex items-center gap-1",
|
|
3886
3886
|
children: [
|
|
3887
|
-
/* @__PURE__ */
|
|
3887
|
+
/* @__PURE__ */ N(b, {
|
|
3888
3888
|
tone: "primary",
|
|
3889
3889
|
size: l,
|
|
3890
3890
|
className: "flex-1",
|
|
@@ -3893,12 +3893,12 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3893
3893
|
onClick: d,
|
|
3894
3894
|
children: "Add element"
|
|
3895
3895
|
}),
|
|
3896
|
-
/* @__PURE__ */
|
|
3896
|
+
/* @__PURE__ */ N("span", {
|
|
3897
3897
|
className: t <= 0 ? "invisible pointer-events-none" : "contents",
|
|
3898
3898
|
"aria-hidden": t <= 0 || void 0,
|
|
3899
|
-
children: /* @__PURE__ */
|
|
3899
|
+
children: /* @__PURE__ */ N(j, {
|
|
3900
3900
|
label: "Move element up",
|
|
3901
|
-
children: /* @__PURE__ */
|
|
3901
|
+
children: /* @__PURE__ */ N(b, {
|
|
3902
3902
|
tone: "ghost",
|
|
3903
3903
|
size: l,
|
|
3904
3904
|
quiet: !0,
|
|
@@ -3909,12 +3909,12 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3909
3909
|
})
|
|
3910
3910
|
})
|
|
3911
3911
|
}),
|
|
3912
|
-
/* @__PURE__ */
|
|
3912
|
+
/* @__PURE__ */ N("span", {
|
|
3913
3913
|
className: t >= e.length - 1 ? "invisible pointer-events-none" : "contents",
|
|
3914
3914
|
"aria-hidden": t >= e.length - 1 || void 0,
|
|
3915
|
-
children: /* @__PURE__ */
|
|
3915
|
+
children: /* @__PURE__ */ N(j, {
|
|
3916
3916
|
label: "Move element down",
|
|
3917
|
-
children: /* @__PURE__ */
|
|
3917
|
+
children: /* @__PURE__ */ N(b, {
|
|
3918
3918
|
tone: "ghost",
|
|
3919
3919
|
size: l,
|
|
3920
3920
|
quiet: !0,
|
|
@@ -3928,46 +3928,46 @@ function yt({ insts: e, idx: t, onSelect: n, onWrite: r, marked: i, onMark: o, o
|
|
|
3928
3928
|
})
|
|
3929
3929
|
] });
|
|
3930
3930
|
}
|
|
3931
|
-
function
|
|
3931
|
+
function xt({ knob: e, comp: r, idx: i, palette: o, onWrite: s, bridge: l }) {
|
|
3932
3932
|
let u = a(), d = e.get(r, i), f = (t) => s(e, t);
|
|
3933
|
-
if (e.type === "color") return /* @__PURE__ */
|
|
3933
|
+
if (e.type === "color") return /* @__PURE__ */ N(c, {
|
|
3934
3934
|
label: e.label,
|
|
3935
3935
|
value: d,
|
|
3936
|
-
onChange: (e) => f(
|
|
3936
|
+
onChange: (e) => f(S(e, o) ?? e),
|
|
3937
3937
|
palette: o,
|
|
3938
3938
|
inline: !0
|
|
3939
3939
|
});
|
|
3940
|
-
if (e.type === "select") return /* @__PURE__ */
|
|
3940
|
+
if (e.type === "select") return /* @__PURE__ */ N(y, {
|
|
3941
3941
|
label: e.label,
|
|
3942
3942
|
align: "fill",
|
|
3943
3943
|
labelWidth: n,
|
|
3944
|
-
children: /* @__PURE__ */
|
|
3944
|
+
children: /* @__PURE__ */ N(g, {
|
|
3945
3945
|
variant: "subtle",
|
|
3946
3946
|
size: u,
|
|
3947
3947
|
className: "w-full",
|
|
3948
|
-
options:
|
|
3948
|
+
options: ct(e, r, i),
|
|
3949
3949
|
value: d,
|
|
3950
3950
|
onChange: f
|
|
3951
3951
|
})
|
|
3952
3952
|
});
|
|
3953
|
-
let { min: p, max: m } =
|
|
3954
|
-
return /* @__PURE__ */
|
|
3953
|
+
let { min: p, max: m } = lt(e, r, i), h = l && l.layer[l.key], _ = t(h), b = typeof h == "number" ? h : d, x = typeof h == "number" ? (e) => l.setProp(l.key, e) : f;
|
|
3954
|
+
return /* @__PURE__ */ N(y, {
|
|
3955
3955
|
label: e.label,
|
|
3956
3956
|
align: "fill",
|
|
3957
3957
|
labelWidth: n,
|
|
3958
|
-
children: /* @__PURE__ */
|
|
3958
|
+
children: /* @__PURE__ */ P("div", {
|
|
3959
3959
|
className: "flex flex-1 items-center gap-2",
|
|
3960
|
-
children: [/* @__PURE__ */
|
|
3960
|
+
children: [/* @__PURE__ */ N("div", {
|
|
3961
3961
|
className: "flex-1 min-w-0",
|
|
3962
|
-
children:
|
|
3962
|
+
children: _ ? /* @__PURE__ */ N("div", {
|
|
3963
3963
|
className: "kol-helper-12 text-meta italic px-1",
|
|
3964
3964
|
children: "animated"
|
|
3965
|
-
}) : /* @__PURE__ */
|
|
3965
|
+
}) : /* @__PURE__ */ N(v, {
|
|
3966
3966
|
min: p,
|
|
3967
3967
|
max: m,
|
|
3968
3968
|
step: e.step ?? 1,
|
|
3969
|
-
value: typeof
|
|
3970
|
-
onChange:
|
|
3969
|
+
value: typeof b == "number" ? b : p,
|
|
3970
|
+
onChange: x,
|
|
3971
3971
|
displayWidth: String(m).length,
|
|
3972
3972
|
className: "flex-1"
|
|
3973
3973
|
})
|
|
@@ -3983,7 +3983,7 @@ function bt({ knob: e, comp: r, idx: i, palette: o, onWrite: s, bridge: l }) {
|
|
|
3983
3983
|
})
|
|
3984
3984
|
});
|
|
3985
3985
|
}
|
|
3986
|
-
function
|
|
3986
|
+
function St({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: i }) {
|
|
3987
3987
|
let o = a(), s = [{
|
|
3988
3988
|
value: "0",
|
|
3989
3989
|
label: "1"
|
|
@@ -3991,17 +3991,17 @@ function xt({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: i }) {
|
|
|
3991
3991
|
value: String(t + 1),
|
|
3992
3992
|
label: String(t + 2)
|
|
3993
3993
|
}))];
|
|
3994
|
-
return /* @__PURE__ */
|
|
3994
|
+
return /* @__PURE__ */ P("div", {
|
|
3995
3995
|
className: "flex flex-col gap-1",
|
|
3996
|
-
children: [/* @__PURE__ */
|
|
3996
|
+
children: [/* @__PURE__ */ N("span", {
|
|
3997
3997
|
className: "kol-eyebrow text-fg-80",
|
|
3998
3998
|
children: "Motion layers"
|
|
3999
|
-
}), /* @__PURE__ */
|
|
3999
|
+
}), /* @__PURE__ */ P("div", {
|
|
4000
4000
|
className: "flex items-center gap-1",
|
|
4001
4001
|
children: [
|
|
4002
|
-
/* @__PURE__ */
|
|
4002
|
+
/* @__PURE__ */ N("div", {
|
|
4003
4003
|
className: "flex-1 min-w-0",
|
|
4004
|
-
children: /* @__PURE__ */
|
|
4004
|
+
children: /* @__PURE__ */ N(te, {
|
|
4005
4005
|
layout: "joined",
|
|
4006
4006
|
size: o,
|
|
4007
4007
|
value: String(t),
|
|
@@ -4009,9 +4009,9 @@ function xt({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: i }) {
|
|
|
4009
4009
|
options: s
|
|
4010
4010
|
})
|
|
4011
4011
|
}),
|
|
4012
|
-
/* @__PURE__ */
|
|
4012
|
+
/* @__PURE__ */ N(j, {
|
|
4013
4013
|
label: "Add motion layer",
|
|
4014
|
-
children: /* @__PURE__ */
|
|
4014
|
+
children: /* @__PURE__ */ N(b, {
|
|
4015
4015
|
tone: "ghost",
|
|
4016
4016
|
size: o,
|
|
4017
4017
|
quiet: !0,
|
|
@@ -4021,12 +4021,12 @@ function xt({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: i }) {
|
|
|
4021
4021
|
onClick: r
|
|
4022
4022
|
})
|
|
4023
4023
|
}),
|
|
4024
|
-
/* @__PURE__ */
|
|
4024
|
+
/* @__PURE__ */ N("span", {
|
|
4025
4025
|
className: t === 0 ? "invisible pointer-events-none" : "contents",
|
|
4026
4026
|
"aria-hidden": t === 0 || void 0,
|
|
4027
|
-
children: /* @__PURE__ */
|
|
4027
|
+
children: /* @__PURE__ */ N(j, {
|
|
4028
4028
|
label: "Delete motion layer (the primary can only be set to None)",
|
|
4029
|
-
children: /* @__PURE__ */
|
|
4029
|
+
children: /* @__PURE__ */ N(b, {
|
|
4030
4030
|
tone: "ghost",
|
|
4031
4031
|
size: o,
|
|
4032
4032
|
quiet: !0,
|
|
@@ -4041,8 +4041,8 @@ function xt({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: i }) {
|
|
|
4041
4041
|
})]
|
|
4042
4042
|
});
|
|
4043
4043
|
}
|
|
4044
|
-
function
|
|
4045
|
-
let n = a(), [r, i] =
|
|
4044
|
+
function Ct({ value: e = {}, onToggle: t }) {
|
|
4045
|
+
let n = a(), [r, i] = M(!1), o = me({
|
|
4046
4046
|
open: r,
|
|
4047
4047
|
onOpenChange: i,
|
|
4048
4048
|
placement: "bottom-start",
|
|
@@ -4050,10 +4050,10 @@ function St({ value: e = {}, onToggle: t }) {
|
|
|
4050
4050
|
flip: !1,
|
|
4051
4051
|
matchReferenceWidth: !0,
|
|
4052
4052
|
role: "listbox"
|
|
4053
|
-
}), s =
|
|
4054
|
-
return /* @__PURE__ */
|
|
4053
|
+
}), s = He.filter((t) => e[t.tag]).length;
|
|
4054
|
+
return /* @__PURE__ */ P("div", {
|
|
4055
4055
|
className: "relative w-full",
|
|
4056
|
-
children: [/* @__PURE__ */
|
|
4056
|
+
children: [/* @__PURE__ */ N(b, {
|
|
4057
4057
|
ref: o.refs.setReference,
|
|
4058
4058
|
...o.getReferenceProps(),
|
|
4059
4059
|
tone: "primary",
|
|
@@ -4063,7 +4063,7 @@ function St({ value: e = {}, onToggle: t }) {
|
|
|
4063
4063
|
"aria-haspopup": "listbox",
|
|
4064
4064
|
"aria-expanded": r,
|
|
4065
4065
|
children: s ? `${s} feature${s > 1 ? "s" : ""}` : "None"
|
|
4066
|
-
}), /* @__PURE__ */
|
|
4066
|
+
}), /* @__PURE__ */ N(A, {
|
|
4067
4067
|
popover: o,
|
|
4068
4068
|
panel: !1,
|
|
4069
4069
|
focus: !1,
|
|
@@ -4073,12 +4073,12 @@ function St({ value: e = {}, onToggle: t }) {
|
|
|
4073
4073
|
borderRadius: "0 0 4px 4px",
|
|
4074
4074
|
zIndex: "var(--kol-z-dropdown)"
|
|
4075
4075
|
},
|
|
4076
|
-
children: /* @__PURE__ */
|
|
4076
|
+
children: /* @__PURE__ */ N("div", {
|
|
4077
4077
|
className: "flex max-h-[300px] flex-col items-stretch overflow-y-auto",
|
|
4078
4078
|
role: "listbox",
|
|
4079
|
-
children:
|
|
4079
|
+
children: He.map((n) => /* @__PURE__ */ N(de, {
|
|
4080
4080
|
onClick: () => t(n.tag, !e[n.tag]),
|
|
4081
|
-
shortcut: e[n.tag] ? /* @__PURE__ */
|
|
4081
|
+
shortcut: e[n.tag] ? /* @__PURE__ */ N(ve, {
|
|
4082
4082
|
name: "check",
|
|
4083
4083
|
size: 11
|
|
4084
4084
|
}) : void 0,
|
|
@@ -4088,11 +4088,11 @@ function St({ value: e = {}, onToggle: t }) {
|
|
|
4088
4088
|
})]
|
|
4089
4089
|
});
|
|
4090
4090
|
}
|
|
4091
|
-
function
|
|
4092
|
-
let r = a(), i = e?.path?.points, o = Array.isArray(i) && i.length >= 2 ? i :
|
|
4093
|
-
return /* @__PURE__ */
|
|
4091
|
+
function wt({ inst: e, layer: t, onPoints: n }) {
|
|
4092
|
+
let r = a(), i = e?.path?.points, o = Array.isArray(i) && i.length >= 2 ? i : be, s = t.w > 0 && t.h > 0 ? t.w / t.h : 1;
|
|
4093
|
+
return /* @__PURE__ */ P("div", {
|
|
4094
4094
|
className: "flex flex-col gap-2",
|
|
4095
|
-
children: [/* @__PURE__ */
|
|
4095
|
+
children: [/* @__PURE__ */ N(ce, {
|
|
4096
4096
|
value: o.map(([e, t]) => ({
|
|
4097
4097
|
x: e,
|
|
4098
4098
|
y: t
|
|
@@ -4102,14 +4102,14 @@ function Ct({ inst: e, layer: t, onPoints: n }) {
|
|
|
4102
4102
|
size: r,
|
|
4103
4103
|
minPoints: 2,
|
|
4104
4104
|
ariaLabel: "Custom path points"
|
|
4105
|
-
}), /* @__PURE__ */
|
|
4105
|
+
}), /* @__PURE__ */ P("div", {
|
|
4106
4106
|
className: "grid grid-cols-2 gap-2",
|
|
4107
|
-
children: [/* @__PURE__ */
|
|
4107
|
+
children: [/* @__PURE__ */ N(b, {
|
|
4108
4108
|
tone: "primary",
|
|
4109
4109
|
size: r,
|
|
4110
4110
|
onClick: () => n([...o, [.5, .5]]),
|
|
4111
4111
|
children: "Add point"
|
|
4112
|
-
}), o.length > 2 && /* @__PURE__ */
|
|
4112
|
+
}), o.length > 2 && /* @__PURE__ */ N(b, {
|
|
4113
4113
|
tone: "primary",
|
|
4114
4114
|
size: r,
|
|
4115
4115
|
onClick: () => n(o.slice(0, -1)),
|
|
@@ -4118,24 +4118,24 @@ function Ct({ inst: e, layer: t, onPoints: n }) {
|
|
|
4118
4118
|
})]
|
|
4119
4119
|
});
|
|
4120
4120
|
}
|
|
4121
|
-
function
|
|
4122
|
-
let o =
|
|
4121
|
+
function Tt({ layer: e, setProp: r, insts: i, renderAnimate: a }) {
|
|
4122
|
+
let o = pt, s = e[o.key], c = t(s), l = i.find((e) => e?.morph?.on)?.morph?.blend ?? o.default, u = typeof s == "number" ? s : l, d = c ? /* @__PURE__ */ N("div", {
|
|
4123
4123
|
className: "kol-helper-12 text-meta italic px-1",
|
|
4124
4124
|
children: "animated"
|
|
4125
|
-
}) : /* @__PURE__ */
|
|
4125
|
+
}) : /* @__PURE__ */ N(v, {
|
|
4126
4126
|
min: o.min,
|
|
4127
4127
|
max: o.max,
|
|
4128
4128
|
step: o.step,
|
|
4129
4129
|
value: u,
|
|
4130
4130
|
onChange: (e) => r(o.key, e)
|
|
4131
4131
|
});
|
|
4132
|
-
return /* @__PURE__ */
|
|
4132
|
+
return /* @__PURE__ */ N(y, {
|
|
4133
4133
|
label: o.label,
|
|
4134
4134
|
align: "fill",
|
|
4135
4135
|
labelWidth: n,
|
|
4136
|
-
children: /* @__PURE__ */
|
|
4136
|
+
children: /* @__PURE__ */ P("div", {
|
|
4137
4137
|
className: "flex flex-1 items-center gap-2",
|
|
4138
|
-
children: [/* @__PURE__ */
|
|
4138
|
+
children: [/* @__PURE__ */ N("div", {
|
|
4139
4139
|
className: "flex-1 min-w-0",
|
|
4140
4140
|
children: d
|
|
4141
4141
|
}), a(o)]
|
|
@@ -4144,14 +4144,14 @@ function wt({ layer: e, setProp: r, insts: i, renderAnimate: a }) {
|
|
|
4144
4144
|
}
|
|
4145
4145
|
//#endregion
|
|
4146
4146
|
//#region src/editor/params/TransportBar.jsx
|
|
4147
|
-
function
|
|
4148
|
-
let r = String(e), [i, a] =
|
|
4149
|
-
return
|
|
4147
|
+
function Et({ seconds: e, onCommit: t, size: n }) {
|
|
4148
|
+
let r = String(e), [i, a] = M(r), [o, s] = M(!1);
|
|
4149
|
+
return ge(() => {
|
|
4150
4150
|
o || a(r);
|
|
4151
|
-
}, [r, o]), /* @__PURE__ */
|
|
4151
|
+
}, [r, o]), /* @__PURE__ */ N(j, {
|
|
4152
4152
|
label: "Loop length",
|
|
4153
4153
|
triggerClassName: "flex w-full",
|
|
4154
|
-
children: /* @__PURE__ */
|
|
4154
|
+
children: /* @__PURE__ */ N(ue, {
|
|
4155
4155
|
type: "text",
|
|
4156
4156
|
inputMode: "decimal",
|
|
4157
4157
|
variant: "property",
|
|
@@ -4182,61 +4182,62 @@ function Tt({ seconds: e, onCommit: t, size: n }) {
|
|
|
4182
4182
|
})
|
|
4183
4183
|
});
|
|
4184
4184
|
}
|
|
4185
|
-
var
|
|
4185
|
+
var Dt = (e, t, n = !1) => /* @__PURE__ */ N(ve, {
|
|
4186
4186
|
name: e,
|
|
4187
|
-
|
|
4188
|
-
|
|
4187
|
+
variant: n ? "solid" : "outline",
|
|
4188
|
+
size: pe(t, !0)
|
|
4189
|
+
}), Ot = {
|
|
4189
4190
|
sm: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-sm)]",
|
|
4190
4191
|
md: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-md)]",
|
|
4191
4192
|
lg: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-lg)]"
|
|
4192
4193
|
};
|
|
4193
|
-
function
|
|
4194
|
-
let { playing: t, loopSeconds: n, play: r, pause: i, stop: a, rewind:
|
|
4195
|
-
return /* @__PURE__ */
|
|
4194
|
+
function kt({ size: e = "sm" }) {
|
|
4195
|
+
let { playing: t, loopSeconds: n, play: r, pause: i, stop: a, rewind: s, setLoopSeconds: c } = o();
|
|
4196
|
+
return /* @__PURE__ */ P("div", {
|
|
4196
4197
|
className: "flex items-center gap-2",
|
|
4197
4198
|
children: [
|
|
4198
|
-
/* @__PURE__ */
|
|
4199
|
+
/* @__PURE__ */ N(le, {
|
|
4199
4200
|
layout: "joined",
|
|
4200
4201
|
size: e,
|
|
4201
4202
|
ariaLabel: "Playback",
|
|
4202
4203
|
value: t ? "play" : "pause",
|
|
4203
|
-
className:
|
|
4204
|
+
className: Ot[e],
|
|
4204
4205
|
onChange: (e) => e === "play" ? r() : i(),
|
|
4205
4206
|
options: [{
|
|
4206
4207
|
value: "play",
|
|
4207
4208
|
ariaLabel: "Play",
|
|
4208
4209
|
tooltip: "Play (Space)",
|
|
4209
|
-
label:
|
|
4210
|
+
label: Dt("play", e, t)
|
|
4210
4211
|
}, {
|
|
4211
4212
|
value: "pause",
|
|
4212
4213
|
ariaLabel: "Pause",
|
|
4213
4214
|
tooltip: "Pause (Space)",
|
|
4214
|
-
label:
|
|
4215
|
+
label: Dt("pause", e, !t)
|
|
4215
4216
|
}]
|
|
4216
4217
|
}),
|
|
4217
|
-
/* @__PURE__ */
|
|
4218
|
+
/* @__PURE__ */ N("div", {
|
|
4218
4219
|
className: "flex-1 min-w-0",
|
|
4219
|
-
children: /* @__PURE__ */
|
|
4220
|
+
children: /* @__PURE__ */ N(Et, {
|
|
4220
4221
|
seconds: n,
|
|
4221
|
-
onCommit:
|
|
4222
|
+
onCommit: c,
|
|
4222
4223
|
size: e
|
|
4223
4224
|
})
|
|
4224
4225
|
}),
|
|
4225
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ N(le, {
|
|
4226
4227
|
layout: "joined",
|
|
4227
4228
|
size: e,
|
|
4228
4229
|
ariaLabel: "Reset",
|
|
4229
4230
|
value: null,
|
|
4230
|
-
className:
|
|
4231
|
-
onChange: (e) => e === "stop" ? a() :
|
|
4231
|
+
className: Ot[e],
|
|
4232
|
+
onChange: (e) => e === "stop" ? a() : s(),
|
|
4232
4233
|
options: [{
|
|
4233
4234
|
value: "stop",
|
|
4234
4235
|
ariaLabel: "Stop",
|
|
4235
|
-
label:
|
|
4236
|
+
label: Dt("stop", e)
|
|
4236
4237
|
}, {
|
|
4237
4238
|
value: "rewind",
|
|
4238
4239
|
ariaLabel: "Rewind",
|
|
4239
|
-
label:
|
|
4240
|
+
label: Dt("rewind", e)
|
|
4240
4241
|
}]
|
|
4241
4242
|
})
|
|
4242
4243
|
]
|
|
@@ -4244,22 +4245,22 @@ function Ot({ size: e = "sm" }) {
|
|
|
4244
4245
|
}
|
|
4245
4246
|
//#endregion
|
|
4246
4247
|
//#region src/packs/motion.js
|
|
4247
|
-
var
|
|
4248
|
+
var At = {
|
|
4248
4249
|
layerTypes: ["kinetic"],
|
|
4249
|
-
kineticPresetById:
|
|
4250
|
-
presetComp:
|
|
4251
|
-
KINETIC_TREE:
|
|
4250
|
+
kineticPresetById: Me,
|
|
4251
|
+
presetComp: Fe,
|
|
4252
|
+
KINETIC_TREE: Pe,
|
|
4252
4253
|
KINETIC_PRESETS: V,
|
|
4253
|
-
KineticType:
|
|
4254
|
-
applyKnobBridges:
|
|
4255
|
-
loadFonts:
|
|
4256
|
-
warmFontCss:
|
|
4257
|
-
kineticFontCss:
|
|
4258
|
-
KineticPanel:
|
|
4259
|
-
TimelineDock:
|
|
4260
|
-
useTimelineUp:
|
|
4261
|
-
TransportBar:
|
|
4254
|
+
KineticType: qe,
|
|
4255
|
+
applyKnobBridges: ft,
|
|
4256
|
+
loadFonts: se,
|
|
4257
|
+
warmFontCss: ne,
|
|
4258
|
+
kineticFontCss: re,
|
|
4259
|
+
KineticPanel: vt,
|
|
4260
|
+
TimelineDock: k,
|
|
4261
|
+
useTimelineUp: O,
|
|
4262
|
+
TransportBar: kt
|
|
4262
4263
|
};
|
|
4263
|
-
|
|
4264
|
+
C("motion", At);
|
|
4264
4265
|
//#endregion
|
|
4265
|
-
export {
|
|
4266
|
+
export { Pe as a, V as i, vt as n, Fe as o, ut as r, At as t };
|