@lumencast/runtime 0.1.0 → 0.2.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/.tsbuildinfo +1 -1
- package/dist/{broadcast-BqOhSNsY.js → broadcast-DzDvyVhx.js} +3 -3
- package/dist/{broadcast-BqOhSNsY.js.map → broadcast-DzDvyVhx.js.map} +1 -1
- package/dist/{control-CRFn328D.js → control-B6Yr-dDz.js} +4 -4
- package/dist/{control-CRFn328D.js.map → control-B6Yr-dDz.js.map} +1 -1
- package/dist/{index-DUhPPRvw.js → index-X6EOQGho.js} +4 -4
- package/dist/{index-DUhPPRvw.js.map → index-X6EOQGho.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/lumencast.js +1 -1
- package/dist/render/primitives/image.d.ts.map +1 -1
- package/dist/render/primitives/image.js +16 -2
- package/dist/render/primitives/image.js.map +1 -1
- package/dist/render/primitives/text.d.ts.map +1 -1
- package/dist/render/primitives/text.js +4 -0
- package/dist/render/primitives/text.js.map +1 -1
- package/dist/{status-pill-DCHvrd_y.js → status-pill-DpO4hqUL.js} +2 -2
- package/dist/{status-pill-DCHvrd_y.js.map → status-pill-DpO4hqUL.js.map} +1 -1
- package/dist/{test-DBCtwx_I.js → test-Dr0J0H6Q.js} +4 -4
- package/dist/{test-DBCtwx_I.js.map → test-Dr0J0H6Q.js.map} +1 -1
- package/dist/{tree-CnhX02kd.js → tree-B_wLlJ36.js} +155 -149
- package/dist/tree-B_wLlJ36.js.map +1 -0
- package/package.json +4 -4
- package/src/render/primitives/image.tsx +15 -2
- package/src/render/primitives/text.tsx +4 -0
- package/dist/tree-CnhX02kd.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useSignals as
|
|
3
|
-
import { useContext as _, createContext as
|
|
1
|
+
import { jsx as a, jsxs as B, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useSignals as C } from "@preact/signals-react/runtime";
|
|
3
|
+
import { useContext as _, createContext as D, useRef as G, useEffect as X, useMemo as Y } from "react";
|
|
4
4
|
import { motion as w } from "framer-motion";
|
|
5
|
-
import { t as S } from "./index-
|
|
6
|
-
function
|
|
7
|
-
const i = t.direction ?? "vertical", e = R(t.gap, 0), r = t.wrap === !0, o = R(t.crossGap, 0),
|
|
5
|
+
import { t as S } from "./index-X6EOQGho.js";
|
|
6
|
+
function J({ resolved: t, children: n }) {
|
|
7
|
+
const i = t.direction ?? "vertical", e = R(t.gap, 0), r = t.wrap === !0, o = R(t.crossGap, 0), c = t.align ?? "stretch", s = t.justify ?? "flex-start", l = i === "horizontal", u = {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexDirection: l ? "row" : "column",
|
|
10
|
-
alignItems:
|
|
11
|
-
justifyContent:
|
|
10
|
+
alignItems: c,
|
|
11
|
+
justifyContent: s
|
|
12
12
|
};
|
|
13
13
|
return r ? (u.flexWrap = "wrap", l ? (u.columnGap = e, u.rowGap = o) : (u.rowGap = e, u.columnGap = o)) : u.gap = e, /* @__PURE__ */ a("div", { style: u, children: n });
|
|
14
14
|
}
|
|
15
15
|
function R(t, n) {
|
|
16
16
|
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Q({ resolved: t, children: n }) {
|
|
19
19
|
const i = t.cols ?? "1fr", e = t.rows ?? "auto", r = t.gap ?? 0;
|
|
20
20
|
return /* @__PURE__ */ a(
|
|
21
21
|
"div",
|
|
@@ -30,16 +30,16 @@ function J({ resolved: t, children: n }) {
|
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
let
|
|
34
|
-
function
|
|
35
|
-
return
|
|
33
|
+
let M = 0;
|
|
34
|
+
function Z() {
|
|
35
|
+
return M = (M + 1) % 1e6, `lumen-grad-${M.toString(36)}`;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function tt(t) {
|
|
38
38
|
if (t.kind === "solid")
|
|
39
39
|
return { defs: [], ref: t.color };
|
|
40
|
-
const n =
|
|
40
|
+
const n = Z();
|
|
41
41
|
if (t.kind === "linear-gradient") {
|
|
42
|
-
const
|
|
42
|
+
const s = ((t.angle_deg ?? 0) - 90) * Math.PI / 180, l = 0.5 - 0.5 * Math.cos(s), u = 0.5 - 0.5 * Math.sin(s), f = 0.5 + 0.5 * Math.cos(s), g = 0.5 + 0.5 * Math.sin(s);
|
|
43
43
|
return { defs: [
|
|
44
44
|
/* @__PURE__ */ a(
|
|
45
45
|
"linearGradient",
|
|
@@ -49,12 +49,12 @@ function Z(t) {
|
|
|
49
49
|
y1: `${u * 100}%`,
|
|
50
50
|
x2: `${f * 100}%`,
|
|
51
51
|
y2: `${g * 100}%`,
|
|
52
|
-
children: t.stops.map((
|
|
52
|
+
children: t.stops.map((d, m) => /* @__PURE__ */ a(
|
|
53
53
|
"stop",
|
|
54
54
|
{
|
|
55
|
-
offset:
|
|
56
|
-
stopColor:
|
|
57
|
-
...
|
|
55
|
+
offset: d.offset,
|
|
56
|
+
stopColor: d.color,
|
|
57
|
+
...d.opacity !== void 0 ? { stopOpacity: d.opacity } : {}
|
|
58
58
|
},
|
|
59
59
|
m
|
|
60
60
|
))
|
|
@@ -65,31 +65,31 @@ function Z(t) {
|
|
|
65
65
|
}
|
|
66
66
|
const i = t.center?.x ?? 0.5, e = t.center?.y ?? 0.5, r = t.radius ?? 0.5;
|
|
67
67
|
return { defs: [
|
|
68
|
-
/* @__PURE__ */ a("radialGradient", { id: n, cx: `${i * 100}%`, cy: `${e * 100}%`, r: `${r * 100}%`, children: t.stops.map((
|
|
68
|
+
/* @__PURE__ */ a("radialGradient", { id: n, cx: `${i * 100}%`, cy: `${e * 100}%`, r: `${r * 100}%`, children: t.stops.map((c, s) => /* @__PURE__ */ a(
|
|
69
69
|
"stop",
|
|
70
70
|
{
|
|
71
|
-
offset:
|
|
72
|
-
stopColor:
|
|
73
|
-
...
|
|
71
|
+
offset: c.offset,
|
|
72
|
+
stopColor: c.color,
|
|
73
|
+
...c.opacity !== void 0 ? { stopOpacity: c.opacity } : {}
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
s
|
|
76
76
|
)) }, n)
|
|
77
77
|
], ref: `url(#${n})` };
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const n = t.map(
|
|
79
|
+
function nt(t) {
|
|
80
|
+
const n = t.map(it).filter(Boolean);
|
|
81
81
|
return n.length === 0 ? {} : { backgroundImage: n.join(", ") };
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function it(t) {
|
|
84
84
|
if (t.kind === "solid")
|
|
85
85
|
return `linear-gradient(${t.color}, ${t.color})`;
|
|
86
|
-
const n = t.stops.map((r) => `${r.opacity !== void 0 ?
|
|
86
|
+
const n = t.stops.map((r) => `${r.opacity !== void 0 ? et(r.color, r.opacity) : r.color} ${(r.offset * 100).toFixed(2)}%`).join(", ");
|
|
87
87
|
if (t.kind === "linear-gradient")
|
|
88
88
|
return `linear-gradient(${t.angle_deg ?? 0}deg, ${n})`;
|
|
89
89
|
const i = (t.center?.x ?? 0.5) * 100, e = (t.center?.y ?? 0.5) * 100;
|
|
90
90
|
return `radial-gradient(circle at ${i}% ${e}%, ${n})`;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function et(t, n) {
|
|
93
93
|
const i = t.match(/^#([0-9a-f]{6})$/i);
|
|
94
94
|
if (i) {
|
|
95
95
|
const e = Math.round(n * 255).toString(16).padStart(2, "0");
|
|
@@ -97,29 +97,29 @@ function it(t, n) {
|
|
|
97
97
|
}
|
|
98
98
|
return `color-mix(in srgb, ${t} ${n * 100}%, transparent)`;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return Array.isArray(t) ? t.filter(
|
|
100
|
+
function V(t) {
|
|
101
|
+
return Array.isArray(t) ? t.filter(rt) : [];
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function rt(t) {
|
|
104
104
|
if (typeof t != "object" || t === null) return !1;
|
|
105
105
|
const n = t.kind;
|
|
106
106
|
return n === "solid" || n === "linear-gradient" || n === "radial-gradient";
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const e = b(t.x, 0), r = b(t.y, 0), o = T(t.width),
|
|
108
|
+
function ot({ resolved: t, transitionFor: n, children: i }) {
|
|
109
|
+
const e = b(t.x, 0), r = b(t.y, 0), o = T(t.width), c = T(t.height), s = b(t.opacity, 1), l = b(t.scale, 1), u = b(t.rotate, 0), f = t.background ?? void 0, g = V(t.backgrounds), h = n("opacity") ?? n("scale") ?? n("rotate") ?? n("x") ?? n("y"), d = {
|
|
110
110
|
position: "absolute",
|
|
111
111
|
left: 0,
|
|
112
112
|
top: 0,
|
|
113
113
|
width: o,
|
|
114
|
-
height:
|
|
114
|
+
height: c,
|
|
115
115
|
willChange: "transform, opacity"
|
|
116
116
|
};
|
|
117
|
-
return g.length > 0 ? Object.assign(
|
|
117
|
+
return g.length > 0 ? Object.assign(d, nt(g)) : f !== void 0 && (d.background = f), /* @__PURE__ */ a(
|
|
118
118
|
w.div,
|
|
119
119
|
{
|
|
120
|
-
style:
|
|
120
|
+
style: d,
|
|
121
121
|
animate: {
|
|
122
|
-
opacity:
|
|
122
|
+
opacity: s,
|
|
123
123
|
x: e,
|
|
124
124
|
y: r,
|
|
125
125
|
scale: l,
|
|
@@ -136,32 +136,35 @@ function b(t, n) {
|
|
|
136
136
|
function T(t) {
|
|
137
137
|
if (typeof t == "number" && Number.isFinite(t) || typeof t == "string" && t.length > 0) return t;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
const i = t.value === void 0 ? "" : String(t.value), e = t.size ?? "1rem", r = t.weight ?? 400,
|
|
139
|
+
function st({ resolved: t, transitionFor: n }) {
|
|
140
|
+
const i = t.value === void 0 ? "" : String(t.value), e = t.size ?? "1rem", r = t.font, o = t.weight ?? 400, c = t.colour ?? "currentColor", s = t.align ?? "start", l = ct(t.opacity, 1), u = n("opacity") ?? n("value");
|
|
141
141
|
return /* @__PURE__ */ a(
|
|
142
142
|
w.span,
|
|
143
143
|
{
|
|
144
144
|
style: {
|
|
145
145
|
display: "inline-block",
|
|
146
146
|
fontSize: e,
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
// `font` carries LSML text.style.fontFamily (spec'd in schema.json).
|
|
148
|
+
// Omitted => inherit the host/container font.
|
|
149
|
+
...r !== void 0 ? { fontFamily: r } : {},
|
|
150
|
+
fontWeight: o,
|
|
151
|
+
color: c,
|
|
149
152
|
textAlign: s,
|
|
150
153
|
willChange: "opacity"
|
|
151
154
|
},
|
|
152
|
-
animate: { opacity:
|
|
153
|
-
transition: S(
|
|
155
|
+
animate: { opacity: l },
|
|
156
|
+
transition: S(u),
|
|
154
157
|
children: i
|
|
155
158
|
}
|
|
156
159
|
);
|
|
157
160
|
}
|
|
158
|
-
function
|
|
161
|
+
function ct(t, n) {
|
|
159
162
|
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
160
163
|
}
|
|
161
|
-
function
|
|
164
|
+
function at({ resolved: t, transitionFor: n }) {
|
|
162
165
|
const i = t.src;
|
|
163
166
|
if (!i) return null;
|
|
164
|
-
const e = t.fit ?? "contain", r = t.position ?? "center", o =
|
|
167
|
+
const e = t.fit ?? "contain", r = t.position ?? "center", o = ut(t.opacity, 1), c = z(t.width, "100%"), s = z(t.height, "100%"), l = n("opacity") ?? n("src");
|
|
165
168
|
return /* @__PURE__ */ a(
|
|
166
169
|
w.img,
|
|
167
170
|
{
|
|
@@ -169,77 +172,80 @@ function ct({ resolved: t, transitionFor: n }) {
|
|
|
169
172
|
style: {
|
|
170
173
|
objectFit: e,
|
|
171
174
|
objectPosition: r,
|
|
172
|
-
width:
|
|
173
|
-
height:
|
|
175
|
+
width: c,
|
|
176
|
+
height: s,
|
|
174
177
|
willChange: "opacity"
|
|
175
178
|
},
|
|
176
179
|
animate: { opacity: o },
|
|
177
|
-
transition: S(
|
|
180
|
+
transition: S(l),
|
|
178
181
|
draggable: !1
|
|
179
182
|
}
|
|
180
183
|
);
|
|
181
184
|
}
|
|
182
|
-
function
|
|
185
|
+
function ut(t, n) {
|
|
183
186
|
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
184
187
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
188
|
+
function z(t, n) {
|
|
189
|
+
return typeof t == "number" && Number.isFinite(t) ? `${t}px` : typeof t == "string" && t.length > 0 ? t : n;
|
|
190
|
+
}
|
|
191
|
+
function lt({ resolved: t, transitionFor: n }) {
|
|
192
|
+
const i = t.kind ?? "rect", e = t.fill ?? "transparent", r = t.stroke ?? "transparent", o = x(t.stroke_width, 0), c = x(t.width, 100), s = x(t.height, 100), l = x(t.radius, 0), u = x(t.opacity, 1), f = n("opacity"), g = S(f), h = V(t.fills), d = ft(t.strokes), m = h.map(tt), A = m.flatMap((y) => y.defs), q = m.length > 0 ? m.map((y) => y.ref) : [e], H = d.length > 0 ? d.map((y) => ({ color: y.color ?? "transparent", width: y.width ?? 0 })) : [{ color: r, width: o }], L = [...q].reverse(), U = [...H].reverse(), I = (y, p, F) => i === "circle" ? /* @__PURE__ */ a(
|
|
187
193
|
"circle",
|
|
188
194
|
{
|
|
189
|
-
cx:
|
|
190
|
-
cy:
|
|
191
|
-
r: Math.min(
|
|
192
|
-
fill:
|
|
195
|
+
cx: c / 2,
|
|
196
|
+
cy: s / 2,
|
|
197
|
+
r: Math.min(c, s) / 2 - p.width / 2,
|
|
198
|
+
fill: y,
|
|
193
199
|
stroke: p.color,
|
|
194
200
|
strokeWidth: p.width
|
|
195
201
|
},
|
|
196
|
-
|
|
202
|
+
F
|
|
197
203
|
) : i === "line" ? /* @__PURE__ */ a(
|
|
198
204
|
"line",
|
|
199
205
|
{
|
|
200
206
|
x1: "0",
|
|
201
|
-
y1:
|
|
202
|
-
x2:
|
|
203
|
-
y2:
|
|
204
|
-
stroke: p.color ||
|
|
207
|
+
y1: s / 2,
|
|
208
|
+
x2: c,
|
|
209
|
+
y2: s / 2,
|
|
210
|
+
stroke: p.color || y,
|
|
205
211
|
strokeWidth: p.width || 1
|
|
206
212
|
},
|
|
207
|
-
|
|
213
|
+
F
|
|
208
214
|
) : /* @__PURE__ */ a(
|
|
209
215
|
"rect",
|
|
210
216
|
{
|
|
211
217
|
x: p.width / 2,
|
|
212
218
|
y: p.width / 2,
|
|
213
|
-
width: Math.max(0,
|
|
214
|
-
height: Math.max(0,
|
|
219
|
+
width: Math.max(0, c - p.width),
|
|
220
|
+
height: Math.max(0, s - p.width),
|
|
215
221
|
rx: l,
|
|
216
222
|
ry: l,
|
|
217
|
-
fill:
|
|
223
|
+
fill: y,
|
|
218
224
|
stroke: p.color,
|
|
219
225
|
strokeWidth: p.width
|
|
220
226
|
},
|
|
221
|
-
|
|
227
|
+
F
|
|
222
228
|
);
|
|
223
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ B(
|
|
224
230
|
w.svg,
|
|
225
231
|
{
|
|
226
|
-
width:
|
|
227
|
-
height:
|
|
228
|
-
viewBox: `0 0 ${
|
|
232
|
+
width: c,
|
|
233
|
+
height: s,
|
|
234
|
+
viewBox: `0 0 ${c} ${s}`,
|
|
229
235
|
animate: { opacity: u },
|
|
230
236
|
transition: g,
|
|
231
237
|
style: { willChange: "opacity" },
|
|
232
238
|
children: [
|
|
233
239
|
A.length > 0 && /* @__PURE__ */ a("defs", { children: A }),
|
|
234
|
-
|
|
235
|
-
(
|
|
240
|
+
L.map(
|
|
241
|
+
(y, p) => I(y, { color: "transparent", width: 0 }, `fill-${p}`)
|
|
236
242
|
),
|
|
237
|
-
|
|
243
|
+
U.map((y, p) => I("none", y, `stroke-${p}`))
|
|
238
244
|
]
|
|
239
245
|
}
|
|
240
246
|
);
|
|
241
247
|
}
|
|
242
|
-
function
|
|
248
|
+
function ft(t) {
|
|
243
249
|
return Array.isArray(t) ? t.filter(
|
|
244
250
|
(n) => typeof n == "object" && n !== null && ("color" in n || "width" in n)
|
|
245
251
|
) : [];
|
|
@@ -247,7 +253,7 @@ function lt(t) {
|
|
|
247
253
|
function x(t, n) {
|
|
248
254
|
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
249
255
|
}
|
|
250
|
-
function
|
|
256
|
+
function pt({ resolved: t }) {
|
|
251
257
|
const n = t.src;
|
|
252
258
|
if (!n) return null;
|
|
253
259
|
const i = t.loop ?? !0, e = t.mute ?? !0, r = t.autoplay ?? !0, o = t.fit ?? "cover";
|
|
@@ -267,7 +273,7 @@ function ft({ resolved: t }) {
|
|
|
267
273
|
}
|
|
268
274
|
);
|
|
269
275
|
}
|
|
270
|
-
function
|
|
276
|
+
function yt({ resolved: t }) {
|
|
271
277
|
const n = t.scene_id, i = t.scene_version;
|
|
272
278
|
if (!n || !i)
|
|
273
279
|
return null;
|
|
@@ -290,26 +296,26 @@ function pt({ resolved: t }) {
|
|
|
290
296
|
);
|
|
291
297
|
}
|
|
292
298
|
const dt = {
|
|
293
|
-
stack:
|
|
294
|
-
grid:
|
|
295
|
-
frame:
|
|
296
|
-
text:
|
|
297
|
-
image:
|
|
298
|
-
shape:
|
|
299
|
-
media:
|
|
300
|
-
instance:
|
|
301
|
-
},
|
|
302
|
-
function
|
|
303
|
-
const i = _(
|
|
304
|
-
return /* @__PURE__ */ a(
|
|
299
|
+
stack: J,
|
|
300
|
+
grid: Q,
|
|
301
|
+
frame: ot,
|
|
302
|
+
text: st,
|
|
303
|
+
image: at,
|
|
304
|
+
shape: lt,
|
|
305
|
+
media: pt,
|
|
306
|
+
instance: yt
|
|
307
|
+
}, j = D("");
|
|
308
|
+
function gt({ prefix: t, children: n }) {
|
|
309
|
+
const i = _(j), e = i ? `${i}.${t}` : t;
|
|
310
|
+
return /* @__PURE__ */ a(j.Provider, { value: e, children: n });
|
|
305
311
|
}
|
|
306
312
|
function P() {
|
|
307
|
-
return _(
|
|
313
|
+
return _(j);
|
|
308
314
|
}
|
|
309
315
|
function $(t, n) {
|
|
310
316
|
return !t || n.startsWith("__") ? n : `${t}.${n}`;
|
|
311
317
|
}
|
|
312
|
-
function
|
|
318
|
+
function W(t) {
|
|
313
319
|
switch (t) {
|
|
314
320
|
case "fixed":
|
|
315
321
|
return "0 0 auto";
|
|
@@ -321,7 +327,7 @@ function z(t) {
|
|
|
321
327
|
return;
|
|
322
328
|
}
|
|
323
329
|
}
|
|
324
|
-
function
|
|
330
|
+
function ht({
|
|
325
331
|
visible: t,
|
|
326
332
|
opacity: n,
|
|
327
333
|
rotation: i,
|
|
@@ -330,44 +336,44 @@ function gt({
|
|
|
330
336
|
}) {
|
|
331
337
|
if (t === !1)
|
|
332
338
|
return null;
|
|
333
|
-
const o = typeof n == "number" && n !== 1,
|
|
334
|
-
if (!o && !
|
|
335
|
-
return /* @__PURE__ */ a(
|
|
339
|
+
const o = typeof n == "number" && n !== 1, c = typeof i == "number" && i !== 0, s = e?.x !== void 0 || e?.y !== void 0;
|
|
340
|
+
if (!o && !c && !s)
|
|
341
|
+
return /* @__PURE__ */ a(O, { children: r });
|
|
336
342
|
const l = {};
|
|
337
|
-
if (o && (l.opacity = n),
|
|
338
|
-
const u =
|
|
343
|
+
if (o && (l.opacity = n), c && (l.transform = `rotate(${i}deg)`), s) {
|
|
344
|
+
const u = W(e?.x), f = W(e?.y);
|
|
339
345
|
u === f && u !== void 0 ? l.flex = u : l.flex = u ?? f;
|
|
340
346
|
}
|
|
341
347
|
return /* @__PURE__ */ a("div", { style: l, children: r });
|
|
342
348
|
}
|
|
343
|
-
const
|
|
349
|
+
const mt = {
|
|
344
350
|
linear: "linear",
|
|
345
351
|
"ease-in": "easeIn",
|
|
346
352
|
"ease-out": "easeOut",
|
|
347
353
|
"ease-in-out": "easeInOut"
|
|
348
354
|
};
|
|
349
|
-
function
|
|
355
|
+
function bt(t) {
|
|
350
356
|
const n = t.steps;
|
|
351
357
|
if (!Array.isArray(n) || n.length < 2) return;
|
|
352
358
|
const i = n[0], e = n[n.length - 1];
|
|
353
359
|
if (i.at !== 0 || e.at !== 1) return;
|
|
354
|
-
const r = n.map((
|
|
355
|
-
return
|
|
360
|
+
const r = n.map((c) => c.at), o = {};
|
|
361
|
+
return N(n, "opacity", o), N(n, "filter", o), k(n, "scale", o), k(n, "translateX", o), k(n, "translateY", o), k(n, "rotate", o), {
|
|
356
362
|
animate: o,
|
|
357
363
|
transition: {
|
|
358
364
|
duration: t.duration_ms / 1e3,
|
|
359
|
-
ease:
|
|
365
|
+
ease: mt[t.easing ?? "linear"],
|
|
360
366
|
times: r
|
|
361
367
|
}
|
|
362
368
|
};
|
|
363
369
|
}
|
|
364
|
-
function
|
|
370
|
+
function N(t, n, i) {
|
|
365
371
|
let e = !1;
|
|
366
372
|
const r = [];
|
|
367
373
|
let o;
|
|
368
|
-
for (const
|
|
369
|
-
const
|
|
370
|
-
|
|
374
|
+
for (const c of t) {
|
|
375
|
+
const s = c[n];
|
|
376
|
+
s !== void 0 ? (e = !0, o = s, r.push(s)) : r.push(o ?? (n === "opacity" ? 1 : "none"));
|
|
371
377
|
}
|
|
372
378
|
e && (i[n] = r);
|
|
373
379
|
}
|
|
@@ -375,64 +381,64 @@ function k(t, n, i) {
|
|
|
375
381
|
let e = !1;
|
|
376
382
|
const r = [];
|
|
377
383
|
let o;
|
|
378
|
-
for (const
|
|
379
|
-
const
|
|
380
|
-
typeof
|
|
384
|
+
for (const c of t) {
|
|
385
|
+
const s = c.transform?.[n];
|
|
386
|
+
typeof s == "number" ? (e = !0, o = s, r.push(s)) : r.push(o ?? xt(n));
|
|
381
387
|
}
|
|
382
|
-
e && (n === "rotate" ? i.rotate = r.map((
|
|
388
|
+
e && (n === "rotate" ? i.rotate = r.map((c) => `${c}deg`) : i[n] = r);
|
|
383
389
|
}
|
|
384
|
-
function
|
|
390
|
+
function xt(t) {
|
|
385
391
|
return t === "scale" ? 1 : 0;
|
|
386
392
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
393
|
+
const K = D(0), E = 2e3;
|
|
394
|
+
function wt(t, n) {
|
|
389
395
|
if (n <= 0) return 0;
|
|
390
396
|
const i = t * n;
|
|
391
|
-
return i >
|
|
397
|
+
return i > E ? E : i;
|
|
392
398
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
395
|
-
const e = P(), r = _(
|
|
399
|
+
function $t({ keyframes: t, store: n, children: i }) {
|
|
400
|
+
C();
|
|
401
|
+
const e = P(), r = _(K), o = G(void 0), c = G(0);
|
|
396
402
|
if (t.key !== void 0) {
|
|
397
403
|
const u = n.signal($(e, t.key)).value;
|
|
398
|
-
o.current !== u && (o.current = u,
|
|
404
|
+
o.current !== u && (o.current = u, c.current += 1);
|
|
399
405
|
}
|
|
400
|
-
const
|
|
401
|
-
if (!
|
|
402
|
-
return /* @__PURE__ */ a(
|
|
403
|
-
const l = r > 0 ? { ...
|
|
404
|
-
return /* @__PURE__ */
|
|
406
|
+
const s = bt(t);
|
|
407
|
+
if (!s)
|
|
408
|
+
return /* @__PURE__ */ a(O, { children: i });
|
|
409
|
+
const l = r > 0 ? { ...s.transition, delay: r / 1e3 } : s.transition;
|
|
410
|
+
return /* @__PURE__ */ B(
|
|
405
411
|
w.div,
|
|
406
412
|
{
|
|
407
413
|
style: { display: "contents" },
|
|
408
|
-
initial:
|
|
409
|
-
animate:
|
|
414
|
+
initial: St(s.animate),
|
|
415
|
+
animate: s.animate,
|
|
410
416
|
transition: l,
|
|
411
417
|
children: [
|
|
412
|
-
/* @__PURE__ */ a(
|
|
418
|
+
/* @__PURE__ */ a(kt, {}),
|
|
413
419
|
i
|
|
414
420
|
]
|
|
415
421
|
},
|
|
416
|
-
|
|
422
|
+
c.current
|
|
417
423
|
);
|
|
418
424
|
}
|
|
419
|
-
function
|
|
420
|
-
return
|
|
425
|
+
function kt() {
|
|
426
|
+
return X(() => {
|
|
421
427
|
}, []), null;
|
|
422
428
|
}
|
|
423
|
-
function
|
|
429
|
+
function St(t) {
|
|
424
430
|
const n = {};
|
|
425
431
|
for (const [i, e] of Object.entries(t))
|
|
426
432
|
e.length > 0 && (n[i] = e[0]);
|
|
427
433
|
return n;
|
|
428
434
|
}
|
|
429
|
-
function
|
|
430
|
-
return t.kind === "repeat" ? /* @__PURE__ */ a(jt, { node: t, store: n }) : /* @__PURE__ */ a(
|
|
435
|
+
function v({ node: t, store: n }) {
|
|
436
|
+
return t.kind === "repeat" ? /* @__PURE__ */ a(jt, { node: t, store: n }) : /* @__PURE__ */ a(Ft, { node: t, store: n });
|
|
431
437
|
}
|
|
432
|
-
function
|
|
433
|
-
|
|
434
|
-
const i = P(), e =
|
|
435
|
-
() =>
|
|
438
|
+
function Ft({ node: t, store: n }) {
|
|
439
|
+
C();
|
|
440
|
+
const i = P(), e = Y(
|
|
441
|
+
() => Ot(t, n, i),
|
|
436
442
|
// We re-build per render — signals re-render cheaply, and the
|
|
437
443
|
// resolution itself is O(bindings) which is small. The memo is a
|
|
438
444
|
// micro-optimisation to keep object identity stable across renders
|
|
@@ -447,13 +453,13 @@ function St({ node: t, store: n }) {
|
|
|
447
453
|
const h = n.transitionSignal($(i, g)).value;
|
|
448
454
|
h !== void 0 && (o[f] = h);
|
|
449
455
|
}
|
|
450
|
-
const
|
|
456
|
+
const c = (f) => f in o ? o[f] : t.transitions?.[f], s = t.children?.map((f, g) => /* @__PURE__ */ a(v, { node: f, store: n }, f.id ?? g)), l = {
|
|
451
457
|
visible: typeof e.visible == "boolean" ? e.visible : void 0,
|
|
452
458
|
opacity: typeof e.universal_opacity == "number" ? e.universal_opacity : void 0,
|
|
453
459
|
rotation: typeof e.rotation == "number" ? e.rotation : void 0,
|
|
454
460
|
sizing: Mt(e.sizing)
|
|
455
|
-
}, u = /* @__PURE__ */ a(
|
|
456
|
-
return t.keyframes ? /* @__PURE__ */ a(
|
|
461
|
+
}, u = /* @__PURE__ */ a(ht, { ...l, children: /* @__PURE__ */ a(r, { resolved: e, transitionFor: c, children: s }) });
|
|
462
|
+
return t.keyframes ? /* @__PURE__ */ a($t, { keyframes: t.keyframes, store: n, children: u }) : u;
|
|
457
463
|
}
|
|
458
464
|
function Mt(t) {
|
|
459
465
|
if (typeof t != "object" || t === null) return;
|
|
@@ -461,23 +467,23 @@ function Mt(t) {
|
|
|
461
467
|
return (n.x === "fixed" || n.x === "hug" || n.x === "fill") && (i.x = n.x), (n.y === "fixed" || n.y === "hug" || n.y === "fill") && (i.y = n.y), i.x !== void 0 || i.y !== void 0 ? i : void 0;
|
|
462
468
|
}
|
|
463
469
|
function jt({ node: t, store: n }) {
|
|
464
|
-
|
|
470
|
+
C();
|
|
465
471
|
const i = P(), e = t.bindings?.items, r = e === void 0 ? [] : n.signal($(i, e)).value ?? [];
|
|
466
472
|
if (!Array.isArray(r)) return null;
|
|
467
473
|
const o = t.children?.[0];
|
|
468
474
|
if (!o) return null;
|
|
469
|
-
const
|
|
470
|
-
return /* @__PURE__ */ a(
|
|
471
|
-
const u =
|
|
472
|
-
return u <= 0 ? f : /* @__PURE__ */ a(
|
|
475
|
+
const c = typeof t.stagger_ms == "number" ? t.stagger_ms : 0;
|
|
476
|
+
return /* @__PURE__ */ a(O, { children: r.map((s, l) => {
|
|
477
|
+
const u = wt(l, c), f = /* @__PURE__ */ a(gt, { prefix: `${e ?? ""}.${l}`, children: /* @__PURE__ */ a(v, { node: o, store: n }) }, l);
|
|
478
|
+
return u <= 0 ? f : /* @__PURE__ */ a(K.Provider, { value: u, children: f }, l);
|
|
473
479
|
}) });
|
|
474
480
|
}
|
|
475
|
-
function
|
|
481
|
+
function Ot(t, n, i) {
|
|
476
482
|
const e = { ...t.props ?? {} };
|
|
477
483
|
if (t.bindings)
|
|
478
484
|
for (const [r, o] of Object.entries(t.bindings)) {
|
|
479
|
-
const
|
|
480
|
-
e[r] = n.signal(
|
|
485
|
+
const c = $(i, o);
|
|
486
|
+
e[r] = n.signal(c).value;
|
|
481
487
|
}
|
|
482
488
|
return e;
|
|
483
489
|
}
|
|
@@ -489,6 +495,6 @@ function Ct(t, n, i) {
|
|
|
489
495
|
return e;
|
|
490
496
|
}
|
|
491
497
|
export {
|
|
492
|
-
|
|
498
|
+
v as T
|
|
493
499
|
};
|
|
494
|
-
//# sourceMappingURL=tree-
|
|
500
|
+
//# sourceMappingURL=tree-B_wLlJ36.js.map
|