@lumencast/runtime 0.2.0 → 0.4.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/animate/transitions.d.ts +50 -0
- package/dist/animate/transitions.d.ts.map +1 -1
- package/dist/animate/transitions.js +91 -0
- package/dist/animate/transitions.js.map +1 -1
- package/dist/{broadcast-DzDvyVhx.js → broadcast-DzZ8TVGZ.js} +3 -3
- package/dist/{broadcast-DzDvyVhx.js.map → broadcast-DzZ8TVGZ.js.map} +1 -1
- package/dist/{control-B6Yr-dDz.js → control-gbDGvdR0.js} +4 -4
- package/dist/{control-B6Yr-dDz.js.map → control-gbDGvdR0.js.map} +1 -1
- package/dist/{index-X6EOQGho.js → index-oteiocFe.js} +108 -74
- package/dist/index-oteiocFe.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/lumencast.js +2 -2
- package/dist/render/bundle.d.ts +8 -0
- package/dist/render/bundle.d.ts.map +1 -1
- package/dist/render/bundle.js.map +1 -1
- package/dist/render/primitives/frame.d.ts +1 -1
- package/dist/render/primitives/frame.d.ts.map +1 -1
- package/dist/render/primitives/frame.js +5 -14
- package/dist/render/primitives/frame.js.map +1 -1
- package/dist/render/primitives/image.d.ts +4 -2
- package/dist/render/primitives/image.d.ts.map +1 -1
- package/dist/render/primitives/image.js +9 -6
- package/dist/render/primitives/image.js.map +1 -1
- package/dist/render/primitives/index.d.ts +6 -0
- package/dist/render/primitives/index.d.ts.map +1 -1
- package/dist/render/primitives/index.js.map +1 -1
- package/dist/render/primitives/shape.d.ts +1 -1
- package/dist/render/primitives/shape.d.ts.map +1 -1
- package/dist/render/primitives/shape.js +5 -4
- package/dist/render/primitives/shape.js.map +1 -1
- package/dist/render/primitives/text.d.ts +3 -2
- package/dist/render/primitives/text.d.ts.map +1 -1
- package/dist/render/primitives/text.js +8 -6
- package/dist/render/primitives/text.js.map +1 -1
- package/dist/render/tree.js +1 -1
- package/dist/render/tree.js.map +1 -1
- package/dist/{status-pill-DpO4hqUL.js → status-pill-Cgdl9FtP.js} +2 -2
- package/dist/{status-pill-DpO4hqUL.js.map → status-pill-Cgdl9FtP.js.map} +1 -1
- package/dist/{test-Dr0J0H6Q.js → test-CAnkHA0n.js} +4 -4
- package/dist/{test-Dr0J0H6Q.js.map → test-CAnkHA0n.js.map} +1 -1
- package/dist/tree-DVYXwItH.js +512 -0
- package/dist/tree-DVYXwItH.js.map +1 -0
- package/package.json +4 -4
- package/src/animate/transitions.ts +106 -0
- package/src/render/bundle.ts +8 -0
- package/src/render/primitives/frame.tsx +11 -15
- package/src/render/primitives/image.tsx +10 -6
- package/src/render/primitives/index.ts +6 -0
- package/src/render/primitives/shape.tsx +7 -5
- package/src/render/primitives/text.tsx +9 -6
- package/src/render/tree.tsx +5 -1
- package/dist/index-X6EOQGho.js.map +0 -1
- package/dist/tree-B_wLlJ36.js +0 -500
- package/dist/tree-B_wLlJ36.js.map +0 -1
package/dist/tree-B_wLlJ36.js
DELETED
|
@@ -1,500 +0,0 @@
|
|
|
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
|
-
import { motion as w } from "framer-motion";
|
|
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
|
-
display: "flex",
|
|
9
|
-
flexDirection: l ? "row" : "column",
|
|
10
|
-
alignItems: c,
|
|
11
|
-
justifyContent: s
|
|
12
|
-
};
|
|
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
|
-
}
|
|
15
|
-
function R(t, n) {
|
|
16
|
-
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
17
|
-
}
|
|
18
|
-
function Q({ resolved: t, children: n }) {
|
|
19
|
-
const i = t.cols ?? "1fr", e = t.rows ?? "auto", r = t.gap ?? 0;
|
|
20
|
-
return /* @__PURE__ */ a(
|
|
21
|
-
"div",
|
|
22
|
-
{
|
|
23
|
-
style: {
|
|
24
|
-
display: "grid",
|
|
25
|
-
gridTemplateColumns: i,
|
|
26
|
-
gridTemplateRows: e,
|
|
27
|
-
gap: r
|
|
28
|
-
},
|
|
29
|
-
children: n
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
let M = 0;
|
|
34
|
-
function Z() {
|
|
35
|
-
return M = (M + 1) % 1e6, `lumen-grad-${M.toString(36)}`;
|
|
36
|
-
}
|
|
37
|
-
function tt(t) {
|
|
38
|
-
if (t.kind === "solid")
|
|
39
|
-
return { defs: [], ref: t.color };
|
|
40
|
-
const n = Z();
|
|
41
|
-
if (t.kind === "linear-gradient") {
|
|
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
|
-
return { defs: [
|
|
44
|
-
/* @__PURE__ */ a(
|
|
45
|
-
"linearGradient",
|
|
46
|
-
{
|
|
47
|
-
id: n,
|
|
48
|
-
x1: `${l * 100}%`,
|
|
49
|
-
y1: `${u * 100}%`,
|
|
50
|
-
x2: `${f * 100}%`,
|
|
51
|
-
y2: `${g * 100}%`,
|
|
52
|
-
children: t.stops.map((d, m) => /* @__PURE__ */ a(
|
|
53
|
-
"stop",
|
|
54
|
-
{
|
|
55
|
-
offset: d.offset,
|
|
56
|
-
stopColor: d.color,
|
|
57
|
-
...d.opacity !== void 0 ? { stopOpacity: d.opacity } : {}
|
|
58
|
-
},
|
|
59
|
-
m
|
|
60
|
-
))
|
|
61
|
-
},
|
|
62
|
-
n
|
|
63
|
-
)
|
|
64
|
-
], ref: `url(#${n})` };
|
|
65
|
-
}
|
|
66
|
-
const i = t.center?.x ?? 0.5, e = t.center?.y ?? 0.5, r = t.radius ?? 0.5;
|
|
67
|
-
return { defs: [
|
|
68
|
-
/* @__PURE__ */ a("radialGradient", { id: n, cx: `${i * 100}%`, cy: `${e * 100}%`, r: `${r * 100}%`, children: t.stops.map((c, s) => /* @__PURE__ */ a(
|
|
69
|
-
"stop",
|
|
70
|
-
{
|
|
71
|
-
offset: c.offset,
|
|
72
|
-
stopColor: c.color,
|
|
73
|
-
...c.opacity !== void 0 ? { stopOpacity: c.opacity } : {}
|
|
74
|
-
},
|
|
75
|
-
s
|
|
76
|
-
)) }, n)
|
|
77
|
-
], ref: `url(#${n})` };
|
|
78
|
-
}
|
|
79
|
-
function nt(t) {
|
|
80
|
-
const n = t.map(it).filter(Boolean);
|
|
81
|
-
return n.length === 0 ? {} : { backgroundImage: n.join(", ") };
|
|
82
|
-
}
|
|
83
|
-
function it(t) {
|
|
84
|
-
if (t.kind === "solid")
|
|
85
|
-
return `linear-gradient(${t.color}, ${t.color})`;
|
|
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
|
-
if (t.kind === "linear-gradient")
|
|
88
|
-
return `linear-gradient(${t.angle_deg ?? 0}deg, ${n})`;
|
|
89
|
-
const i = (t.center?.x ?? 0.5) * 100, e = (t.center?.y ?? 0.5) * 100;
|
|
90
|
-
return `radial-gradient(circle at ${i}% ${e}%, ${n})`;
|
|
91
|
-
}
|
|
92
|
-
function et(t, n) {
|
|
93
|
-
const i = t.match(/^#([0-9a-f]{6})$/i);
|
|
94
|
-
if (i) {
|
|
95
|
-
const e = Math.round(n * 255).toString(16).padStart(2, "0");
|
|
96
|
-
return `#${i[1]}${e}`;
|
|
97
|
-
}
|
|
98
|
-
return `color-mix(in srgb, ${t} ${n * 100}%, transparent)`;
|
|
99
|
-
}
|
|
100
|
-
function V(t) {
|
|
101
|
-
return Array.isArray(t) ? t.filter(rt) : [];
|
|
102
|
-
}
|
|
103
|
-
function rt(t) {
|
|
104
|
-
if (typeof t != "object" || t === null) return !1;
|
|
105
|
-
const n = t.kind;
|
|
106
|
-
return n === "solid" || n === "linear-gradient" || n === "radial-gradient";
|
|
107
|
-
}
|
|
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
|
-
position: "absolute",
|
|
111
|
-
left: 0,
|
|
112
|
-
top: 0,
|
|
113
|
-
width: o,
|
|
114
|
-
height: c,
|
|
115
|
-
willChange: "transform, opacity"
|
|
116
|
-
};
|
|
117
|
-
return g.length > 0 ? Object.assign(d, nt(g)) : f !== void 0 && (d.background = f), /* @__PURE__ */ a(
|
|
118
|
-
w.div,
|
|
119
|
-
{
|
|
120
|
-
style: d,
|
|
121
|
-
animate: {
|
|
122
|
-
opacity: s,
|
|
123
|
-
x: e,
|
|
124
|
-
y: r,
|
|
125
|
-
scale: l,
|
|
126
|
-
rotate: u
|
|
127
|
-
},
|
|
128
|
-
transition: S(h),
|
|
129
|
-
children: i
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
function b(t, n) {
|
|
134
|
-
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
135
|
-
}
|
|
136
|
-
function T(t) {
|
|
137
|
-
if (typeof t == "number" && Number.isFinite(t) || typeof t == "string" && t.length > 0) return t;
|
|
138
|
-
}
|
|
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
|
-
return /* @__PURE__ */ a(
|
|
142
|
-
w.span,
|
|
143
|
-
{
|
|
144
|
-
style: {
|
|
145
|
-
display: "inline-block",
|
|
146
|
-
fontSize: e,
|
|
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,
|
|
152
|
-
textAlign: s,
|
|
153
|
-
willChange: "opacity"
|
|
154
|
-
},
|
|
155
|
-
animate: { opacity: l },
|
|
156
|
-
transition: S(u),
|
|
157
|
-
children: i
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
function ct(t, n) {
|
|
162
|
-
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
163
|
-
}
|
|
164
|
-
function at({ resolved: t, transitionFor: n }) {
|
|
165
|
-
const i = t.src;
|
|
166
|
-
if (!i) return null;
|
|
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");
|
|
168
|
-
return /* @__PURE__ */ a(
|
|
169
|
-
w.img,
|
|
170
|
-
{
|
|
171
|
-
src: i,
|
|
172
|
-
style: {
|
|
173
|
-
objectFit: e,
|
|
174
|
-
objectPosition: r,
|
|
175
|
-
width: c,
|
|
176
|
-
height: s,
|
|
177
|
-
willChange: "opacity"
|
|
178
|
-
},
|
|
179
|
-
animate: { opacity: o },
|
|
180
|
-
transition: S(l),
|
|
181
|
-
draggable: !1
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
function ut(t, n) {
|
|
186
|
-
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
187
|
-
}
|
|
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(
|
|
193
|
-
"circle",
|
|
194
|
-
{
|
|
195
|
-
cx: c / 2,
|
|
196
|
-
cy: s / 2,
|
|
197
|
-
r: Math.min(c, s) / 2 - p.width / 2,
|
|
198
|
-
fill: y,
|
|
199
|
-
stroke: p.color,
|
|
200
|
-
strokeWidth: p.width
|
|
201
|
-
},
|
|
202
|
-
F
|
|
203
|
-
) : i === "line" ? /* @__PURE__ */ a(
|
|
204
|
-
"line",
|
|
205
|
-
{
|
|
206
|
-
x1: "0",
|
|
207
|
-
y1: s / 2,
|
|
208
|
-
x2: c,
|
|
209
|
-
y2: s / 2,
|
|
210
|
-
stroke: p.color || y,
|
|
211
|
-
strokeWidth: p.width || 1
|
|
212
|
-
},
|
|
213
|
-
F
|
|
214
|
-
) : /* @__PURE__ */ a(
|
|
215
|
-
"rect",
|
|
216
|
-
{
|
|
217
|
-
x: p.width / 2,
|
|
218
|
-
y: p.width / 2,
|
|
219
|
-
width: Math.max(0, c - p.width),
|
|
220
|
-
height: Math.max(0, s - p.width),
|
|
221
|
-
rx: l,
|
|
222
|
-
ry: l,
|
|
223
|
-
fill: y,
|
|
224
|
-
stroke: p.color,
|
|
225
|
-
strokeWidth: p.width
|
|
226
|
-
},
|
|
227
|
-
F
|
|
228
|
-
);
|
|
229
|
-
return /* @__PURE__ */ B(
|
|
230
|
-
w.svg,
|
|
231
|
-
{
|
|
232
|
-
width: c,
|
|
233
|
-
height: s,
|
|
234
|
-
viewBox: `0 0 ${c} ${s}`,
|
|
235
|
-
animate: { opacity: u },
|
|
236
|
-
transition: g,
|
|
237
|
-
style: { willChange: "opacity" },
|
|
238
|
-
children: [
|
|
239
|
-
A.length > 0 && /* @__PURE__ */ a("defs", { children: A }),
|
|
240
|
-
L.map(
|
|
241
|
-
(y, p) => I(y, { color: "transparent", width: 0 }, `fill-${p}`)
|
|
242
|
-
),
|
|
243
|
-
U.map((y, p) => I("none", y, `stroke-${p}`))
|
|
244
|
-
]
|
|
245
|
-
}
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
function ft(t) {
|
|
249
|
-
return Array.isArray(t) ? t.filter(
|
|
250
|
-
(n) => typeof n == "object" && n !== null && ("color" in n || "width" in n)
|
|
251
|
-
) : [];
|
|
252
|
-
}
|
|
253
|
-
function x(t, n) {
|
|
254
|
-
return typeof t == "number" && Number.isFinite(t) ? t : n;
|
|
255
|
-
}
|
|
256
|
-
function pt({ resolved: t }) {
|
|
257
|
-
const n = t.src;
|
|
258
|
-
if (!n) return null;
|
|
259
|
-
const i = t.loop ?? !0, e = t.mute ?? !0, r = t.autoplay ?? !0, o = t.fit ?? "cover";
|
|
260
|
-
return /* @__PURE__ */ a(
|
|
261
|
-
"video",
|
|
262
|
-
{
|
|
263
|
-
src: n,
|
|
264
|
-
autoPlay: r,
|
|
265
|
-
loop: i,
|
|
266
|
-
muted: e,
|
|
267
|
-
playsInline: !0,
|
|
268
|
-
style: {
|
|
269
|
-
width: "100%",
|
|
270
|
-
height: "100%",
|
|
271
|
-
objectFit: o
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
function yt({ resolved: t }) {
|
|
277
|
-
const n = t.scene_id, i = t.scene_version;
|
|
278
|
-
if (!n || !i)
|
|
279
|
-
return null;
|
|
280
|
-
const e = t.size, r = t.position;
|
|
281
|
-
return /* @__PURE__ */ a(
|
|
282
|
-
"div",
|
|
283
|
-
{
|
|
284
|
-
"data-lumencast-instance": n,
|
|
285
|
-
"data-lumencast-version": i,
|
|
286
|
-
style: {
|
|
287
|
-
position: r ? "absolute" : "relative",
|
|
288
|
-
left: r?.x,
|
|
289
|
-
top: r?.y,
|
|
290
|
-
width: e?.w,
|
|
291
|
-
height: e?.h,
|
|
292
|
-
outline: "none",
|
|
293
|
-
boxSizing: "border-box"
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
const dt = {
|
|
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 });
|
|
311
|
-
}
|
|
312
|
-
function P() {
|
|
313
|
-
return _(j);
|
|
314
|
-
}
|
|
315
|
-
function $(t, n) {
|
|
316
|
-
return !t || n.startsWith("__") ? n : `${t}.${n}`;
|
|
317
|
-
}
|
|
318
|
-
function W(t) {
|
|
319
|
-
switch (t) {
|
|
320
|
-
case "fixed":
|
|
321
|
-
return "0 0 auto";
|
|
322
|
-
case "hug":
|
|
323
|
-
return "0 1 auto";
|
|
324
|
-
case "fill":
|
|
325
|
-
return "1 1 auto";
|
|
326
|
-
default:
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
function ht({
|
|
331
|
-
visible: t,
|
|
332
|
-
opacity: n,
|
|
333
|
-
rotation: i,
|
|
334
|
-
sizing: e,
|
|
335
|
-
children: r
|
|
336
|
-
}) {
|
|
337
|
-
if (t === !1)
|
|
338
|
-
return null;
|
|
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 });
|
|
342
|
-
const l = {};
|
|
343
|
-
if (o && (l.opacity = n), c && (l.transform = `rotate(${i}deg)`), s) {
|
|
344
|
-
const u = W(e?.x), f = W(e?.y);
|
|
345
|
-
u === f && u !== void 0 ? l.flex = u : l.flex = u ?? f;
|
|
346
|
-
}
|
|
347
|
-
return /* @__PURE__ */ a("div", { style: l, children: r });
|
|
348
|
-
}
|
|
349
|
-
const mt = {
|
|
350
|
-
linear: "linear",
|
|
351
|
-
"ease-in": "easeIn",
|
|
352
|
-
"ease-out": "easeOut",
|
|
353
|
-
"ease-in-out": "easeInOut"
|
|
354
|
-
};
|
|
355
|
-
function bt(t) {
|
|
356
|
-
const n = t.steps;
|
|
357
|
-
if (!Array.isArray(n) || n.length < 2) return;
|
|
358
|
-
const i = n[0], e = n[n.length - 1];
|
|
359
|
-
if (i.at !== 0 || e.at !== 1) 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), {
|
|
362
|
-
animate: o,
|
|
363
|
-
transition: {
|
|
364
|
-
duration: t.duration_ms / 1e3,
|
|
365
|
-
ease: mt[t.easing ?? "linear"],
|
|
366
|
-
times: r
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
function N(t, n, i) {
|
|
371
|
-
let e = !1;
|
|
372
|
-
const r = [];
|
|
373
|
-
let o;
|
|
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"));
|
|
377
|
-
}
|
|
378
|
-
e && (i[n] = r);
|
|
379
|
-
}
|
|
380
|
-
function k(t, n, i) {
|
|
381
|
-
let e = !1;
|
|
382
|
-
const r = [];
|
|
383
|
-
let o;
|
|
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));
|
|
387
|
-
}
|
|
388
|
-
e && (n === "rotate" ? i.rotate = r.map((c) => `${c}deg`) : i[n] = r);
|
|
389
|
-
}
|
|
390
|
-
function xt(t) {
|
|
391
|
-
return t === "scale" ? 1 : 0;
|
|
392
|
-
}
|
|
393
|
-
const K = D(0), E = 2e3;
|
|
394
|
-
function wt(t, n) {
|
|
395
|
-
if (n <= 0) return 0;
|
|
396
|
-
const i = t * n;
|
|
397
|
-
return i > E ? E : i;
|
|
398
|
-
}
|
|
399
|
-
function $t({ keyframes: t, store: n, children: i }) {
|
|
400
|
-
C();
|
|
401
|
-
const e = P(), r = _(K), o = G(void 0), c = G(0);
|
|
402
|
-
if (t.key !== void 0) {
|
|
403
|
-
const u = n.signal($(e, t.key)).value;
|
|
404
|
-
o.current !== u && (o.current = u, c.current += 1);
|
|
405
|
-
}
|
|
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(
|
|
411
|
-
w.div,
|
|
412
|
-
{
|
|
413
|
-
style: { display: "contents" },
|
|
414
|
-
initial: St(s.animate),
|
|
415
|
-
animate: s.animate,
|
|
416
|
-
transition: l,
|
|
417
|
-
children: [
|
|
418
|
-
/* @__PURE__ */ a(kt, {}),
|
|
419
|
-
i
|
|
420
|
-
]
|
|
421
|
-
},
|
|
422
|
-
c.current
|
|
423
|
-
);
|
|
424
|
-
}
|
|
425
|
-
function kt() {
|
|
426
|
-
return X(() => {
|
|
427
|
-
}, []), null;
|
|
428
|
-
}
|
|
429
|
-
function St(t) {
|
|
430
|
-
const n = {};
|
|
431
|
-
for (const [i, e] of Object.entries(t))
|
|
432
|
-
e.length > 0 && (n[i] = e[0]);
|
|
433
|
-
return n;
|
|
434
|
-
}
|
|
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 });
|
|
437
|
-
}
|
|
438
|
-
function Ft({ node: t, store: n }) {
|
|
439
|
-
C();
|
|
440
|
-
const i = P(), e = Y(
|
|
441
|
-
() => Ot(t, n, i),
|
|
442
|
-
// We re-build per render — signals re-render cheaply, and the
|
|
443
|
-
// resolution itself is O(bindings) which is small. The memo is a
|
|
444
|
-
// micro-optimisation to keep object identity stable across renders
|
|
445
|
-
// when the inputs haven't changed.
|
|
446
|
-
[t, n, i, ...Ct(t, n, i)]
|
|
447
|
-
), r = dt[t.kind];
|
|
448
|
-
if (!r)
|
|
449
|
-
return null;
|
|
450
|
-
const o = {};
|
|
451
|
-
if (t.bindings)
|
|
452
|
-
for (const [f, g] of Object.entries(t.bindings)) {
|
|
453
|
-
const h = n.transitionSignal($(i, g)).value;
|
|
454
|
-
h !== void 0 && (o[f] = h);
|
|
455
|
-
}
|
|
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 = {
|
|
457
|
-
visible: typeof e.visible == "boolean" ? e.visible : void 0,
|
|
458
|
-
opacity: typeof e.universal_opacity == "number" ? e.universal_opacity : void 0,
|
|
459
|
-
rotation: typeof e.rotation == "number" ? e.rotation : void 0,
|
|
460
|
-
sizing: Mt(e.sizing)
|
|
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;
|
|
463
|
-
}
|
|
464
|
-
function Mt(t) {
|
|
465
|
-
if (typeof t != "object" || t === null) return;
|
|
466
|
-
const n = t, i = {};
|
|
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;
|
|
468
|
-
}
|
|
469
|
-
function jt({ node: t, store: n }) {
|
|
470
|
-
C();
|
|
471
|
-
const i = P(), e = t.bindings?.items, r = e === void 0 ? [] : n.signal($(i, e)).value ?? [];
|
|
472
|
-
if (!Array.isArray(r)) return null;
|
|
473
|
-
const o = t.children?.[0];
|
|
474
|
-
if (!o) return null;
|
|
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);
|
|
479
|
-
}) });
|
|
480
|
-
}
|
|
481
|
-
function Ot(t, n, i) {
|
|
482
|
-
const e = { ...t.props ?? {} };
|
|
483
|
-
if (t.bindings)
|
|
484
|
-
for (const [r, o] of Object.entries(t.bindings)) {
|
|
485
|
-
const c = $(i, o);
|
|
486
|
-
e[r] = n.signal(c).value;
|
|
487
|
-
}
|
|
488
|
-
return e;
|
|
489
|
-
}
|
|
490
|
-
function Ct(t, n, i) {
|
|
491
|
-
if (!t.bindings) return [];
|
|
492
|
-
const e = [];
|
|
493
|
-
for (const r of Object.values(t.bindings))
|
|
494
|
-
e.push(n.signal($(i, r)).value);
|
|
495
|
-
return e;
|
|
496
|
-
}
|
|
497
|
-
export {
|
|
498
|
-
v as T
|
|
499
|
-
};
|
|
500
|
-
//# sourceMappingURL=tree-B_wLlJ36.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-B_wLlJ36.js","sources":["../src/render/primitives/stack.tsx","../src/render/primitives/grid.tsx","../src/render/fill.tsx","../src/render/primitives/frame.tsx","../src/render/primitives/text.tsx","../src/render/primitives/image.tsx","../src/render/primitives/shape.tsx","../src/render/primitives/media.tsx","../src/render/primitives/instance.tsx","../src/render/primitives/index.ts","../src/render/scope.tsx","../src/render/universal-wrapper.tsx","../src/animate/keyframes.ts","../src/render/stagger-context.tsx","../src/render/keyframe-player.tsx","../src/render/tree.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport type { PrimitiveProps } from \"./index\";\n\n/** Vertical or horizontal flex container. Layout-only — bindings\n * here are unusual but tolerated.\n *\n * LSML 1.1 §4.1 adds `wrap` (boolean) and `crossGap` (number) :\n * - wrap: true sets `flex-wrap: wrap` so children flow onto the\n * next row / column when they overflow the main axis.\n * - crossGap is the spacing between rows / columns when wrapping.\n * Mapped to CSS `row-gap` (horizontal stack) or `column-gap`\n * (vertical stack). Ignored when `wrap` is false.\n */\nexport function Stack({ resolved, children }: PrimitiveProps) {\n const direction = (resolved.direction as string) ?? \"vertical\";\n const gap = numberOr(resolved.gap, 0);\n const wrap = resolved.wrap === true;\n const crossGap = numberOr(resolved.crossGap, 0);\n const align = (resolved.align as string) ?? \"stretch\";\n const justify = (resolved.justify as string) ?? \"flex-start\";\n const isHorizontal = direction === \"horizontal\";\n\n const style: CSSProperties = {\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n alignItems: align,\n justifyContent: justify,\n };\n\n if (wrap) {\n style.flexWrap = \"wrap\";\n if (isHorizontal) {\n style.columnGap = gap;\n style.rowGap = crossGap;\n } else {\n style.rowGap = gap;\n style.columnGap = crossGap;\n }\n } else {\n style.gap = gap;\n }\n\n return <div style={style}>{children}</div>;\n}\n\nfunction numberOr(v: unknown, fallback: number): number {\n return typeof v === \"number\" && Number.isFinite(v) ? v : fallback;\n}\n","import type { PrimitiveProps } from \"./index\";\n\n/** CSS Grid container with declared rows / cols. */\nexport function Grid({ resolved, children }: PrimitiveProps) {\n const cols = (resolved.cols as string) ?? \"1fr\";\n const rows = (resolved.rows as string) ?? \"auto\";\n const gap = (resolved.gap as number | string | undefined) ?? 0;\n return (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: cols,\n gridTemplateRows: rows,\n gap,\n }}\n >\n {children}\n </div>\n );\n}\n","// Fill rendering helpers (LSML 1.1 §4.12).\n//\n// A Fill is a discriminated union :\n// - solid : { kind: \"solid\", color, opacity? }\n// - linear-gradient : { kind: \"linear-gradient\", angle_deg?, stops, opacity? }\n// - radial-gradient : { kind: \"radial-gradient\", center?, radius?, stops, opacity? }\n//\n// shape.fills[] and frame.backgrounds[] both use this shape. Each fill\n// renders as a separate SVG element layered top-to-bottom (first entry\n// renders on top per §4.12).\n\nimport type { CSSProperties, ReactElement } from \"react\";\n\nexport interface FillStop {\n offset: number;\n color: string;\n opacity?: number;\n}\n\nexport type Fill =\n | { kind: \"solid\"; color: string; opacity?: number }\n | {\n kind: \"linear-gradient\";\n angle_deg?: number;\n stops: FillStop[];\n opacity?: number;\n }\n | {\n kind: \"radial-gradient\";\n center?: { x: number; y: number };\n radius?: number;\n stops: FillStop[];\n opacity?: number;\n };\n\nlet gradientIdSeq = 0;\nfunction nextGradientId(): string {\n gradientIdSeq = (gradientIdSeq + 1) % 1_000_000;\n return `lumen-grad-${gradientIdSeq.toString(36)}`;\n}\n\nexport interface FillRenderResult {\n /** SVG <defs> contributions (gradient definitions). */\n defs: ReactElement[];\n /** Reference to use as the `fill` attribute on the shape. */\n ref: string;\n}\n\n/** Compile a Fill into an SVG `<defs>` entry + a `fill=\"url(#…)\"` ref.\n * Solid fills produce no defs and return the colour directly. */\nexport function renderFill(fill: Fill): FillRenderResult {\n if (fill.kind === \"solid\") {\n // Solid fill — no defs needed, just hand the colour to fill.\n // SVG fill-opacity composes with element opacity multiplicatively\n // so we apply both consistently.\n return { defs: [], ref: fill.color };\n }\n const id = nextGradientId();\n if (fill.kind === \"linear-gradient\") {\n // angle_deg : 0 = bottom-to-top per §4.12 (matches CSS `linear-gradient`)\n const angle = fill.angle_deg ?? 0;\n // Translate angle (degrees from up) to SVG x1/y1/x2/y2 in user space.\n const rad = ((angle - 90) * Math.PI) / 180; // 0° → x1=0,y1=1 (bottom-up)\n const x1 = 0.5 - 0.5 * Math.cos(rad);\n const y1 = 0.5 - 0.5 * Math.sin(rad);\n const x2 = 0.5 + 0.5 * Math.cos(rad);\n const y2 = 0.5 + 0.5 * Math.sin(rad);\n const defs = [\n <linearGradient\n key={id}\n id={id}\n x1={`${x1 * 100}%`}\n y1={`${y1 * 100}%`}\n x2={`${x2 * 100}%`}\n y2={`${y2 * 100}%`}\n >\n {fill.stops.map((s, i) => (\n <stop\n key={i}\n offset={s.offset}\n stopColor={s.color}\n {...(s.opacity !== undefined ? { stopOpacity: s.opacity } : {})}\n />\n ))}\n </linearGradient>,\n ];\n return { defs, ref: `url(#${id})` };\n }\n // radial-gradient\n const cx = fill.center?.x ?? 0.5;\n const cy = fill.center?.y ?? 0.5;\n const r = fill.radius ?? 0.5;\n const defs = [\n <radialGradient key={id} id={id} cx={`${cx * 100}%`} cy={`${cy * 100}%`} r={`${r * 100}%`}>\n {fill.stops.map((s, i) => (\n <stop\n key={i}\n offset={s.offset}\n stopColor={s.color}\n {...(s.opacity !== undefined ? { stopOpacity: s.opacity } : {})}\n />\n ))}\n </radialGradient>,\n ];\n return { defs, ref: `url(#${id})` };\n}\n\n/** Compile an array of Fill into a CSS `background-image` value usable\n * on a `<div>` (frame backgrounds — non-SVG context). Returns the CSS\n * string + opacity. Stops use percentages in CSS gradient syntax. */\nexport function backgroundsToCss(fills: Fill[]): CSSProperties {\n // Per §4.12, fills[0] renders on top — CSS background-image stacks\n // first → top-most. Match by passing in the same order.\n const layers = fills.map(fillToCss).filter(Boolean) as string[];\n if (layers.length === 0) return {};\n return { backgroundImage: layers.join(\", \") };\n}\n\nfunction fillToCss(fill: Fill): string | null {\n if (fill.kind === \"solid\") {\n // Wrap solid in linear-gradient so it can stack with other layers.\n return `linear-gradient(${fill.color}, ${fill.color})`;\n }\n const stops = fill.stops\n .map((s) => {\n const c = s.opacity !== undefined ? cssWithOpacity(s.color, s.opacity) : s.color;\n return `${c} ${(s.offset * 100).toFixed(2)}%`;\n })\n .join(\", \");\n if (fill.kind === \"linear-gradient\") {\n const angle = fill.angle_deg ?? 0;\n return `linear-gradient(${angle}deg, ${stops})`;\n }\n // radial-gradient\n const cx = (fill.center?.x ?? 0.5) * 100;\n const cy = (fill.center?.y ?? 0.5) * 100;\n return `radial-gradient(circle at ${cx}% ${cy}%, ${stops})`;\n}\n\nfunction cssWithOpacity(color: string, opacity: number): string {\n // Best-effort wrapper — for hex/rgb we can append alpha. For\n // unrecognised forms, fall back to color-mix.\n const hex = color.match(/^#([0-9a-f]{6})$/i);\n if (hex) {\n const a = Math.round(opacity * 255)\n .toString(16)\n .padStart(2, \"0\");\n return `#${hex[1]}${a}`;\n }\n return `color-mix(in srgb, ${color} ${opacity * 100}%, transparent)`;\n}\n\n/** Coerce loose JSON into a Fill array. Returns [] for non-arrays. */\nexport function parseFills(value: unknown): Fill[] {\n if (!Array.isArray(value)) return [];\n return value.filter(isFill) as Fill[];\n}\n\nfunction isFill(v: unknown): v is Fill {\n if (typeof v !== \"object\" || v === null) return false;\n const k = (v as { kind?: unknown }).kind;\n return k === \"solid\" || k === \"linear-gradient\" || k === \"radial-gradient\";\n}\n","import { motion } from \"framer-motion\";\nimport type { CSSProperties } from \"react\";\nimport type { PrimitiveProps } from \"./index\";\nimport { toFramer } from \"../../animate/transitions\";\nimport { backgroundsToCss, parseFills } from \"../fill\";\n\n/** Absolute-positioned container with size + transform + opacity.\n * Animatable on `transform` and `opacity` only — width/height/position\n * changes are intentionally *not* animatable to keep the broadcast\n * off the layout path.\n *\n * LSML 1.1 §4.3 + §4.12 add `backgrounds[]` as an alternative to the\n * legacy `background` (single color). The array form supports stacked\n * fills with linear / radial gradients ; first entry renders on top.\n */\nexport function Frame({ resolved, transitionFor, children }: PrimitiveProps) {\n const x = numberOr(resolved.x, 0);\n const y = numberOr(resolved.y, 0);\n const width = sizeProp(resolved.width);\n const height = sizeProp(resolved.height);\n const opacity = numberOr(resolved.opacity, 1);\n const scale = numberOr(resolved.scale, 1);\n const rotate = numberOr(resolved.rotate, 0);\n\n // 1.0 single-fill prop — used as fallback when 1.1 `backgrounds[]`\n // is empty.\n const legacyBackground = (resolved.background as string | undefined) ?? undefined;\n const backgrounds = parseFills(resolved.backgrounds);\n\n // Pick the most expressive declared transition among the animated\n // bindings (transform / opacity). If none, no animation.\n const tx =\n transitionFor(\"opacity\") ??\n transitionFor(\"scale\") ??\n transitionFor(\"rotate\") ??\n transitionFor(\"x\") ??\n transitionFor(\"y\");\n\n const style: CSSProperties = {\n position: \"absolute\",\n left: 0,\n top: 0,\n width,\n height,\n willChange: \"transform, opacity\",\n };\n if (backgrounds.length > 0) {\n Object.assign(style, backgroundsToCss(backgrounds));\n } else if (legacyBackground !== undefined) {\n style.background = legacyBackground;\n }\n\n return (\n <motion.div\n style={style}\n animate={{\n opacity,\n x,\n y,\n scale,\n rotate,\n }}\n transition={toFramer(tx)}\n >\n {children}\n </motion.div>\n );\n}\n\nfunction numberOr(v: unknown, fallback: number): number {\n return typeof v === \"number\" && Number.isFinite(v) ? v : fallback;\n}\n\nfunction sizeProp(v: unknown): number | string | undefined {\n if (typeof v === \"number\" && Number.isFinite(v)) return v;\n if (typeof v === \"string\" && v.length > 0) return v;\n return undefined;\n}\n","import { motion } from \"framer-motion\";\nimport type { PrimitiveProps } from \"./index\";\nimport { toFramer } from \"../../animate/transitions\";\n\n/** Text leaf. Value renders as the displayed string ; style props\n * cover size / weight / colour / alignment. Opacity is animated when\n * a transition is declared on `opacity` or `value`. */\nexport function Text({ resolved, transitionFor }: PrimitiveProps) {\n const value = resolved.value === undefined ? \"\" : String(resolved.value);\n const size = (resolved.size as string | number | undefined) ?? \"1rem\";\n const font = resolved.font as string | undefined;\n const weight = (resolved.weight as number | undefined) ?? 400;\n const colour = (resolved.colour as string | undefined) ?? \"currentColor\";\n const align = (resolved.align as string | undefined) ?? \"start\";\n const opacity = numberOr(resolved.opacity, 1);\n\n const tx = transitionFor(\"opacity\") ?? transitionFor(\"value\");\n\n return (\n <motion.span\n style={{\n display: \"inline-block\",\n fontSize: size,\n // `font` carries LSML text.style.fontFamily (spec'd in schema.json).\n // Omitted => inherit the host/container font.\n ...(font !== undefined ? { fontFamily: font } : {}),\n fontWeight: weight,\n color: colour,\n textAlign: align as React.CSSProperties[\"textAlign\"],\n willChange: \"opacity\",\n }}\n animate={{ opacity }}\n transition={toFramer(tx)}\n >\n {value}\n </motion.span>\n );\n}\n\nfunction numberOr(v: unknown, fallback: number): number {\n return typeof v === \"number\" && Number.isFinite(v) ? v : fallback;\n}\n","import { motion } from \"framer-motion\";\nimport type { PrimitiveProps } from \"./index\";\nimport { toFramer } from \"../../animate/transitions\";\n\n/** Image leaf. `src`, `fit` (cover/contain/fill), `position`,\n * `opacity`. Opacity is animated when a transition is declared. */\nexport function Image({ resolved, transitionFor }: PrimitiveProps) {\n const src = resolved.src as string | undefined;\n if (!src) return null;\n const fit = (resolved.fit as string | undefined) ?? \"contain\";\n const position = (resolved.position as string | undefined) ?? \"center\";\n const opacity = numberOr(resolved.opacity, 1);\n // `width`/`height` carry LSML image.size (compiler maps size.w/.h → width/height).\n // When present, honour the intrinsic image dimensions; otherwise fill the\n // container (the prior behaviour — a sized parent drives the layout).\n const width = dimOr(resolved.width, \"100%\");\n const height = dimOr(resolved.height, \"100%\");\n\n const tx = transitionFor(\"opacity\") ?? transitionFor(\"src\");\n\n return (\n <motion.img\n src={src}\n style={{\n objectFit: fit as React.CSSProperties[\"objectFit\"],\n objectPosition: position,\n width,\n height,\n willChange: \"opacity\",\n }}\n animate={{ opacity }}\n transition={toFramer(tx)}\n draggable={false}\n />\n );\n}\n\nfunction numberOr(v: unknown, fallback: number): number {\n return typeof v === \"number\" && Number.isFinite(v) ? v : fallback;\n}\n\n/** A render dimension: a finite number → px, a non-empty string → verbatim\n * (e.g. \"100%\"), anything else → the fallback. */\nfunction dimOr(v: unknown, fallback: string): string {\n if (typeof v === \"number\" && Number.isFinite(v)) return `${v}px`;\n if (typeof v === \"string\" && v.length > 0) return v;\n return fallback;\n}\n","import { motion } from \"framer-motion\";\nimport type { ReactElement } from \"react\";\nimport type { PrimitiveProps } from \"./index\";\nimport { toFramer } from \"../../animate/transitions\";\nimport { parseFills, renderFill } from \"../fill\";\n\ninterface StrokeSpec {\n color?: string;\n width?: number;\n}\n\n/** Rectangle / circle / line. Renders as SVG so stroke + fill behave\n * predictably across hosts. Opacity animatable.\n *\n * LSML 1.1 §4.6 + §4.12 add `fills[]` / `strokes[]` arrays as the\n * preferred way to declare multi-layer fills with linear/radial\n * gradients. The legacy single `fill` / `stroke` props remain\n * accepted for 1.0 bundles ; when both are present the array form\n * wins (the spec forbids mixing, but we tolerate to ease migration).\n */\nexport function Shape({ resolved, transitionFor }: PrimitiveProps) {\n const kind = (resolved.kind as string | undefined) ?? \"rect\";\n const legacyFill = (resolved.fill as string | undefined) ?? \"transparent\";\n const legacyStroke = (resolved.stroke as string | undefined) ?? \"transparent\";\n const legacyStrokeWidth = numberOr(resolved.stroke_width, 0);\n const width = numberOr(resolved.width, 100);\n const height = numberOr(resolved.height, 100);\n const radius = numberOr(resolved.radius, 0);\n const opacity = numberOr(resolved.opacity, 1);\n\n const tx = transitionFor(\"opacity\");\n const transition = toFramer(tx);\n\n // LSML 1.1 §4.6 — `fills[]` is the preferred multi-fill form. Fall\n // back to the singular `fill` for 1.0 bundles.\n const fills = parseFills(resolved.fills);\n const strokes = parseStrokes(resolved.strokes);\n\n // Each fill compiles to a (defs, ref) pair. We render the shape\n // outline once per fill, layered top-to-bottom (first entry → on\n // top, per §4.12). The defs are aggregated for a single <defs>.\n const fillRenders = fills.map(renderFill);\n const allDefs = fillRenders.flatMap((r) => r.defs);\n const fillRefs = fillRenders.length > 0 ? fillRenders.map((r) => r.ref) : [legacyFill];\n\n // Strokes : same layered approach, but solid colours only (gradient\n // strokes are out of scope for §4.6 1.1). Each stroke is rendered\n // as an additional pass over the same shape outline.\n const strokeLayers =\n strokes.length > 0\n ? strokes.map((s) => ({ color: s.color ?? \"transparent\", width: s.width ?? 0 }))\n : [{ color: legacyStroke, width: legacyStrokeWidth }];\n\n // Stack order : fillRefs are emitted top-to-bottom per §4.12. SVG\n // paints later siblings on top, so we reverse here so the first\n // entry in fills[] ends up rendered last (visually on top).\n const stackedFills = [...fillRefs].reverse();\n const stackedStrokes = [...strokeLayers].reverse();\n\n const renderShape = (\n fill: string,\n stroke: { color: string; width: number },\n keyPrefix: string,\n ): ReactElement => {\n if (kind === \"circle\") {\n return (\n <circle\n key={keyPrefix}\n cx={width / 2}\n cy={height / 2}\n r={Math.min(width, height) / 2 - stroke.width / 2}\n fill={fill}\n stroke={stroke.color}\n strokeWidth={stroke.width}\n />\n );\n }\n if (kind === \"line\") {\n return (\n <line\n key={keyPrefix}\n x1=\"0\"\n y1={height / 2}\n x2={width}\n y2={height / 2}\n stroke={stroke.color || fill}\n strokeWidth={stroke.width || 1}\n />\n );\n }\n // rect default\n return (\n <rect\n key={keyPrefix}\n x={stroke.width / 2}\n y={stroke.width / 2}\n width={Math.max(0, width - stroke.width)}\n height={Math.max(0, height - stroke.width)}\n rx={radius}\n ry={radius}\n fill={fill}\n stroke={stroke.color}\n strokeWidth={stroke.width}\n />\n );\n };\n\n return (\n <motion.svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n animate={{ opacity }}\n transition={transition}\n style={{ willChange: \"opacity\" }}\n >\n {allDefs.length > 0 && <defs>{allDefs}</defs>}\n {stackedFills.map((ref, i) =>\n renderShape(ref, { color: \"transparent\", width: 0 }, `fill-${i}`),\n )}\n {stackedStrokes.map((s, i) => renderShape(\"none\", s, `stroke-${i}`))}\n </motion.svg>\n );\n}\n\nfunction parseStrokes(value: unknown): StrokeSpec[] {\n if (!Array.isArray(value)) return [];\n return value.filter(\n (v): v is StrokeSpec => typeof v === \"object\" && v !== null && (\"color\" in v || \"width\" in v),\n );\n}\n\nfunction numberOr(v: unknown, fallback: number): number {\n return typeof v === \"number\" && Number.isFinite(v) ? v : fallback;\n}\n","import type { PrimitiveProps } from \"./index\";\n\n/** Embedded video. `src`, `loop`, `mute`, `autoplay`. Audio is muted\n * by default — broadcast audio is Pulsar-side, not from the browser\n * source. */\nexport function Media({ resolved }: PrimitiveProps) {\n const src = resolved.src as string | undefined;\n if (!src) return null;\n const loop = (resolved.loop as boolean | undefined) ?? true;\n const mute = (resolved.mute as boolean | undefined) ?? true;\n const autoplay = (resolved.autoplay as boolean | undefined) ?? true;\n const fit = (resolved.fit as string | undefined) ?? \"cover\";\n\n return (\n <video\n src={src}\n autoPlay={autoplay}\n loop={loop}\n muted={mute}\n playsInline\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: fit as React.CSSProperties[\"objectFit\"],\n }}\n />\n );\n}\n","// LSML 1.1 §4.9 — `instance` primitive (composite-instance reuse).\n//\n// Mounts a sub-scene by `scene_id` + `scene_version`. The sub-scene's\n// state is exposed to its tree under the `__params.*` reserved\n// namespace ; resolution happens via the runtime's bundle fetcher.\n//\n// This implementation is a SCAFFOLD : the visual slot is rendered\n// (size/position honoured) but the sub-tree is replaced by a\n// \"deferred load\" placeholder until the async bundle-fetch path is\n// wired. The composite-reuse rendering is the next iteration's work.\n//\n// What this primitive does today :\n// - parse scene_id, scene_version, params, fit, size, position\n// - reserve the slot in the parent layout\n// - log a one-time warning so authors know it's a scaffold\n//\n// What it does NOT do (yet) :\n// - fetch the inner bundle via the runtime's bundle resolver\n// - render the inner tree with __params.* injected into the store\n// - cycle detection (LSML 1.1 §4.9.2) — depth-8 limit applied at the\n// resolver layer rather than the renderer\n\nimport type { ReactElement } from \"react\";\nimport type { PrimitiveProps } from \"./index\";\n\nconst warned = new Set<string>();\n\nexport function Instance({ resolved }: PrimitiveProps): ReactElement | null {\n const sceneId = resolved.scene_id as string | undefined;\n const sceneVersion = resolved.scene_version as string | undefined;\n if (!sceneId || !sceneVersion) {\n if (import.meta.env.DEV) {\n console.warn(\"[lumencast/instance] missing scene_id or scene_version\", resolved);\n }\n return null;\n }\n\n // One-time DEV warning per (sceneId,version) so authors know the\n // scaffold limitation.\n if (import.meta.env.DEV) {\n const key = `${sceneId}:${sceneVersion}`;\n if (!warned.has(key)) {\n warned.add(key);\n console.warn(\n `[lumencast/instance] scaffold render — async bundle fetch + ` +\n `__params.* injection are not yet wired (LSML 1.1 §4.9). ` +\n `scene_id=${sceneId}`,\n );\n }\n }\n\n const size = resolved.size as { w?: number; h?: number } | undefined;\n const position = resolved.position as { x?: number; y?: number } | undefined;\n\n return (\n <div\n data-lumencast-instance={sceneId}\n data-lumencast-version={sceneVersion}\n style={{\n position: position ? \"absolute\" : \"relative\",\n left: position?.x,\n top: position?.y,\n width: size?.w,\n height: size?.h,\n outline: import.meta.env.DEV ? \"1px dashed rgba(255,180,0,0.5)\" : \"none\",\n boxSizing: \"border-box\",\n }}\n />\n );\n}\n","// Primitive component registry. Tree dispatch uses this map to look\n// up the React component for each `kind` ; user components are inlined\n// at compile time so Lumencast's runtime never sees them.\n\nimport type { ComponentType, ReactNode } from \"react\";\nimport type { RenderKind } from \"../bundle\";\nimport type { Transition } from \"../../animate/transitions\";\nimport { Stack } from \"./stack\";\nimport { Grid } from \"./grid\";\nimport { Frame } from \"./frame\";\nimport { Text } from \"./text\";\nimport { Image } from \"./image\";\nimport { Shape } from \"./shape\";\nimport { Media } from \"./media\";\nimport { Instance } from \"./instance\";\n// `repeat` is dispatched specially in the tree (it iterates a bound\n// array and provides a path scope to its children) ; it does not\n// appear here as a regular primitive.\n\nexport interface PrimitiveProps {\n resolved: Record<string, unknown>;\n transitionFor: (key: string) => Transition | undefined;\n children?: ReactNode;\n}\n\nexport const PRIMITIVES: Partial<Record<RenderKind, ComponentType<PrimitiveProps>>> = {\n stack: Stack,\n grid: Grid,\n frame: Frame,\n text: Text,\n image: Image,\n shape: Shape,\n media: Media,\n instance: Instance,\n};\n","import { createContext, useContext, type ReactNode } from \"react\";\n\n/** Path-scope context. Children inside a `repeat` get a `prefix` that\n * is prepended to their declared bindings, so a single template can\n * bind to per-item paths like `items.{i}.score`. */\nconst PathScopeContext = createContext<string>(\"\");\n\nexport function PathScopeProvider({ prefix, children }: { prefix: string; children: ReactNode }) {\n const parent = useContext(PathScopeContext);\n const next = parent ? `${parent}.${prefix}` : prefix;\n return <PathScopeContext.Provider value={next}>{children}</PathScopeContext.Provider>;\n}\n\n/** Returns the current path prefix, or \"\" if there is no scope. */\nexport function usePathScope(): string {\n return useContext(PathScopeContext);\n}\n\n/** Resolve a binding path under the current scope. */\nexport function scopedPath(prefix: string, path: string): string {\n if (!prefix) return path;\n // Path may itself start with a literal prefix (e.g. `__system.*`),\n // which should NOT be scoped — only paths that are clearly relative\n // get prefixed.\n if (path.startsWith(\"__\")) return path;\n return `${prefix}.${path}`;\n}\n","// Universal-props wrapper (LSML 1.1 §5.4).\n//\n// Every primitive renders inside this wrapper, which applies the four\n// universal props uniformly :\n//\n// - `visible: false` → display: none (slot collapses in flex layouts)\n// - `opacity` → CSS opacity, multiplicative with whatever animation\n// a primitive may apply via framer-motion (browsers compose them)\n// - `rotation` → CSS transform: rotate(<deg>)\n// - `sizing.x`/`sizing.y` → flex shorthand on the wrapping div, lets\n// a primitive participate in its parent flex layout's auto-sizing\n//\n// `bindUniversal` is resolved by the Tree renderer before the wrapper\n// sees its values, so this component only deals with concrete numbers\n// and booleans.\n\nimport type { ReactNode, CSSProperties } from \"react\";\n\nexport type SizingMode = \"fixed\" | \"hug\" | \"fill\";\n\nexport interface UniversalProps {\n visible?: boolean;\n opacity?: number;\n rotation?: number;\n sizing?: { x?: SizingMode; y?: SizingMode };\n}\n\nexport interface UniversalWrapperProps extends UniversalProps {\n children: ReactNode;\n}\n\n/**\n * Maps a SizingMode onto a flex shorthand. Per LSML 1.1 §5.4.1 :\n * - fixed : the primitive honours its declared size verbatim\n * - hug : the primitive shrinks to its intrinsic content size\n * - fill : the primitive grows to fill available space\n */\nfunction flexFor(mode: SizingMode | undefined): string | undefined {\n switch (mode) {\n case \"fixed\":\n return \"0 0 auto\";\n case \"hug\":\n return \"0 1 auto\";\n case \"fill\":\n return \"1 1 auto\";\n default:\n return undefined;\n }\n}\n\nexport function UniversalWrapper({\n visible,\n opacity,\n rotation,\n sizing,\n children,\n}: UniversalWrapperProps) {\n if (visible === false) {\n return null; // slot collapses in flex/grid layouts (§5.4)\n }\n\n // No-op fast path — when no universal props are set, render children\n // directly. Lets simple bundles avoid an extra DOM node per primitive.\n const hasOpacity = typeof opacity === \"number\" && opacity !== 1;\n const hasRotation = typeof rotation === \"number\" && rotation !== 0;\n const hasSizing = sizing?.x !== undefined || sizing?.y !== undefined;\n if (!hasOpacity && !hasRotation && !hasSizing) {\n return <>{children}</>;\n }\n\n const style: CSSProperties = {};\n if (hasOpacity) style.opacity = opacity;\n if (hasRotation) style.transform = `rotate(${rotation}deg)`;\n\n // sizing.x / sizing.y map to flex / row-flex behaviour. The\n // x-axis applies along the main axis of a horizontal stack ; the\n // y-axis along a vertical stack. We emit `flex` (covers both via\n // CSS's flex-direction) and rely on the parent stack for orientation.\n if (hasSizing) {\n const x = flexFor(sizing?.x);\n const y = flexFor(sizing?.y);\n // Emit a single flex declaration when both axes agree, otherwise\n // ship explicit grow/shrink/basis based on the dominant intent.\n if (x === y && x !== undefined) {\n style.flex = x;\n } else {\n // Heuristic : honour x for horizontal stacks (most common in\n // broadcast UIs). Renderer doesn't know the parent's axis here ;\n // a future iteration could thread that through context.\n style.flex = x ?? y;\n }\n }\n\n return <div style={style}>{children}</div>;\n}\n","// LSML 1.1 §6.6 — keyframe sequence playback.\n//\n// A primitive's `keyframes` block describes a path through animatable\n// property values over time, applied once on (re)mount or whenever the\n// `key` LeafPath value changes. The shapes here mirror the spec verbatim\n// ; `compileForFramer` flattens them into the per-property arrays\n// (`scale: [0.8, 1.05, 1]`) plus `times: [0, 0.6, 1]` that framer-motion\n// expects on its `animate` / `transition` props.\n\nexport type KeyframeEasing = \"linear\" | \"ease-in\" | \"ease-out\" | \"ease-in-out\";\n\nexport interface KeyframeStep {\n /** Timeline position in [0, 1]. First step is 0 ; last step is 1. */\n at: number;\n /** Optional transform target at this waypoint. */\n transform?: KeyframeTransform;\n /** Optional opacity in [0, 1]. */\n opacity?: number;\n /** Optional CSS filter string. */\n filter?: string;\n}\n\nexport interface KeyframeTransform {\n scale?: number;\n translateX?: number;\n translateY?: number;\n rotate?: number;\n}\n\nexport interface Keyframes {\n /** LeafPath whose value-change replays the sequence. Omitted = mount-only. */\n key?: string;\n steps: KeyframeStep[];\n duration_ms: number;\n easing?: KeyframeEasing;\n}\n\nconst FRAMER_EASE_MAP: Record<KeyframeEasing, \"linear\" | \"easeIn\" | \"easeOut\" | \"easeInOut\"> = {\n linear: \"linear\",\n \"ease-in\": \"easeIn\",\n \"ease-out\": \"easeOut\",\n \"ease-in-out\": \"easeInOut\",\n};\n\nexport interface CompiledKeyframes {\n /** Per-CSS-property animate target (array of values, one per step). */\n animate: Record<string, (number | string)[]>;\n /** Framer transition config — duration in seconds, ease curve, times[]. */\n transition: {\n duration: number;\n ease: \"linear\" | \"easeIn\" | \"easeOut\" | \"easeInOut\";\n times: number[];\n };\n}\n\n/**\n * Flatten a 1.1 keyframe sequence into the per-property arrays + times[]\n * shape framer-motion expects. Returns `undefined` when `steps` is empty\n * or invariants are violated (first.at !== 0 or last.at !== 1) — the\n * caller then falls back to no animation.\n */\nexport function compileForFramer(kf: Keyframes): CompiledKeyframes | undefined {\n const steps = kf.steps;\n if (!Array.isArray(steps) || steps.length < 2) return undefined;\n const first = steps[0];\n const last = steps[steps.length - 1];\n if (first.at !== 0 || last.at !== 1) return undefined;\n\n const times = steps.map((s) => s.at);\n const animate: Record<string, (number | string)[]> = {};\n\n // For each animatable property, pull the value at every step. When a\n // step omits the property, we fall back to the previous step's value\n // (last-known-good) so framer-motion sees a coherent waypoint chain.\n pullChannel(steps, \"opacity\", animate);\n pullChannel(steps, \"filter\", animate);\n pullTransform(steps, \"scale\", animate);\n pullTransform(steps, \"translateX\", animate);\n pullTransform(steps, \"translateY\", animate);\n pullTransform(steps, \"rotate\", animate);\n\n return {\n animate,\n transition: {\n duration: kf.duration_ms / 1000,\n ease: FRAMER_EASE_MAP[kf.easing ?? \"linear\"],\n times,\n },\n };\n}\n\nfunction pullChannel(\n steps: KeyframeStep[],\n prop: \"opacity\" | \"filter\",\n out: Record<string, (number | string)[]>,\n): void {\n let any = false;\n const values: (number | string)[] = [];\n let last: number | string | undefined;\n for (const s of steps) {\n const v = s[prop];\n if (v !== undefined) {\n any = true;\n last = v;\n values.push(v);\n } else {\n values.push(last ?? (prop === \"opacity\" ? 1 : \"none\"));\n }\n }\n if (any) out[prop] = values;\n}\n\nfunction pullTransform(\n steps: KeyframeStep[],\n prop: keyof KeyframeTransform,\n out: Record<string, (number | string)[]>,\n): void {\n let any = false;\n const values: number[] = [];\n let last: number | undefined;\n for (const s of steps) {\n const v = s.transform?.[prop];\n if (typeof v === \"number\") {\n any = true;\n last = v;\n values.push(v);\n } else {\n values.push(last ?? defaultFor(prop));\n }\n }\n if (any) {\n if (prop === \"rotate\") {\n out.rotate = values.map((n) => `${n}deg`);\n } else {\n out[prop] = values;\n }\n }\n}\n\nfunction defaultFor(prop: keyof KeyframeTransform): number {\n return prop === \"scale\" ? 1 : 0;\n}\n","// LSML 1.1 §6.7 — stagger context.\n//\n// `repeat.stagger_ms` produces wave-like reveals : iteration N's\n// animations start `N * stagger_ms` after iteration 0. The Repeat\n// renderer computes the per-iteration delay and threads it through\n// React context so KeyframePlayer (and future animate-aware primitives)\n// can pick it up without per-primitive wiring.\n\nimport { createContext } from \"react\";\n\n/** Per-iteration stagger delay in milliseconds. `0` means no offset\n * (the implicit default outside a staggered repeat). */\nexport const StaggerContext = createContext<number>(0);\n\n/** Spec hint : runtimes MAY cap effective stagger to avoid pathological\n * wait times on large lists. We cap at 2 s. */\nexport const STAGGER_CAP_MS = 2000;\n\n/** Compute the effective per-iteration delay, applying the runtime cap. */\nexport function computeStaggerDelayMs(index: number, staggerMs: number): number {\n if (staggerMs <= 0) return 0;\n const raw = index * staggerMs;\n return raw > STAGGER_CAP_MS ? STAGGER_CAP_MS : raw;\n}\n","// LSML 1.1 §6.6 — keyframe sequence playback wrapper.\n//\n// Wraps a primitive subtree in a framer-motion `motion.div` that plays\n// out the compiled keyframe arrays once on (re)mount, or whenever the\n// bound `key` LeafPath changes. We trigger replay via React's `key=`\n// reconciliation — bumping a counter when the keyframe key value flips\n// remounts the motion subtree, restarting the animation from `at: 0`.\n//\n// LSML 1.1 §6.7 — when this player runs inside a `repeat` iteration, a\n// `staggerDelay` (ms) is provided through `StaggerContext` and added to\n// framer's transition.delay so each iteration starts `index * stagger_ms`\n// after the previous one.\n\nimport { motion } from \"framer-motion\";\nimport { useContext, useEffect, useRef, type ReactNode } from \"react\";\nimport { useSignals } from \"@preact/signals-react/runtime\";\nimport type { Store } from \"../state/store\";\nimport { compileForFramer, type Keyframes } from \"../animate/keyframes\";\nimport { StaggerContext } from \"./stagger-context\";\nimport { scopedPath, usePathScope } from \"./scope\";\n\nexport interface KeyframePlayerProps {\n keyframes: Keyframes;\n store: Store;\n children: ReactNode;\n}\n\nexport function KeyframePlayer({ keyframes, store, children }: KeyframePlayerProps): ReactNode {\n useSignals();\n const scope = usePathScope();\n const staggerDelayMs = useContext(StaggerContext);\n\n // Pull the latest `key` LeafPath value and remount whenever it\n // changes. We track via a ref + counter so React's reconciliation\n // gives us a fresh motion.div (and thus a fresh animation pass).\n const lastKeyValue = useRef<unknown>(undefined);\n const replayTokenRef = useRef(0);\n if (keyframes.key !== undefined) {\n const v = store.signal(scopedPath(scope, keyframes.key)).value;\n if (lastKeyValue.current !== v) {\n lastKeyValue.current = v;\n replayTokenRef.current += 1;\n }\n }\n\n const compiled = compileForFramer(keyframes);\n if (!compiled) {\n return <>{children}</>;\n }\n\n const transition =\n staggerDelayMs > 0\n ? { ...compiled.transition, delay: staggerDelayMs / 1000 }\n : compiled.transition;\n\n return (\n <motion.div\n key={replayTokenRef.current}\n style={{ display: \"contents\" }}\n initial={firstFrame(compiled.animate)}\n animate={compiled.animate}\n transition={transition}\n >\n <ReplayOnMount />\n {children}\n </motion.div>\n );\n}\n\n/** No-op effect placeholder — kept for symmetry / future hooks like\n * reporting playback completion to the renderer. */\nfunction ReplayOnMount(): null {\n useEffect(() => {\n // intentional no-op\n }, []);\n return null;\n}\n\n/** Pluck the `at: 0` waypoint values into a framer-motion `initial` prop\n * so the very first frame matches the start of the keyframe path. Without\n * this, framer interpolates from the element's current style which can\n * produce a visible jump on mount. */\nfunction firstFrame(animate: Record<string, (number | string)[]>): Record<string, number | string> {\n const out: Record<string, number | string> = {};\n for (const [k, arr] of Object.entries(animate)) {\n if (arr.length > 0) out[k] = arr[0];\n }\n return out;\n}\n","// Recursive tree renderer — resolves bindings, dispatches to\n// primitives, handles `repeat` specially.\n\nimport { useSignals } from \"@preact/signals-react/runtime\";\nimport { useMemo, type ReactNode } from \"react\";\nimport type { Store } from \"../state/store\";\nimport type { Transition } from \"../animate/transitions\";\nimport { PRIMITIVES } from \"./primitives\";\nimport { PathScopeProvider, scopedPath, usePathScope } from \"./scope\";\nimport type { RenderNode } from \"./bundle\";\nimport { UniversalWrapper, type SizingMode } from \"./universal-wrapper\";\nimport { KeyframePlayer } from \"./keyframe-player\";\nimport { StaggerContext, computeStaggerDelayMs } from \"./stagger-context\";\n\nexport interface TreeProps {\n node: RenderNode;\n store: Store;\n}\n\nexport function Tree({ node, store }: TreeProps): ReactNode {\n if (node.kind === \"repeat\") {\n return <Repeat node={node} store={store} />;\n }\n return <Node node={node} store={store} />;\n}\n\nfunction Node({ node, store }: TreeProps): ReactNode {\n // useSignals() lets the surrounding component subscribe to any\n // signal read during render. Each leaf path has its own signal so\n // re-renders only fire on touched paths.\n useSignals();\n const scope = usePathScope();\n\n // Hooks must run unconditionally — the early-return for unknown\n // kinds happens *after* every hook has fired.\n const resolved = useMemo(\n () => resolveProps(node, store, scope),\n // We re-build per render — signals re-render cheaply, and the\n // resolution itself is O(bindings) which is small. The memo is a\n // micro-optimisation to keep object identity stable across renders\n // when the inputs haven't changed.\n [node, store, scope, ...readBindingValues(node, store, scope)],\n );\n\n const Primitive = PRIMITIVES[node.kind as keyof typeof PRIMITIVES];\n if (!Primitive) {\n if (import.meta.env.DEV) {\n console.warn(`[lumencast] unknown render kind : ${node.kind}`);\n }\n return null;\n }\n\n // LSDP/1.1 §3.2.2 — a per-leaf transition on the most recent delta\n // takes precedence over the bundle-level default. Only bound props\n // can carry a wire transition (a static prop never moves). Snapshots\n // clear the directive, so the bundle default reapplies after a reset.\n //\n // We resolve here in the parent's render (useSignals() above tracks\n // these reads) rather than inside the primitive's callback — that way\n // a transition signal change re-renders this Node, which in turn re-\n // renders the primitive with the new transition prop.\n const liveTransitions: Record<string, Transition | undefined> = {};\n if (node.bindings) {\n for (const [key, path] of Object.entries(node.bindings)) {\n const ts = store.transitionSignal(scopedPath(scope, path)).value;\n if (ts !== undefined) liveTransitions[key] = ts;\n }\n }\n const transitionFor = (key: string): Transition | undefined => {\n if (key in liveTransitions) return liveTransitions[key];\n return node.transitions?.[key];\n };\n\n const children = node.children?.map((child, idx) => (\n <Tree key={child.id ?? idx} node={child} store={store} />\n ));\n\n // LSML 1.1 §5.4 — universal props applied uniformly across all\n // primitives. Pulled out of `resolved` so primitives can ignore\n // them ; the wrapper composes with whatever transform/opacity the\n // primitive's own framer-motion may apply.\n const universal = {\n visible: typeof resolved.visible === \"boolean\" ? resolved.visible : undefined,\n opacity:\n typeof resolved.universal_opacity === \"number\" ? resolved.universal_opacity : undefined,\n rotation: typeof resolved.rotation === \"number\" ? resolved.rotation : undefined,\n sizing: extractSizing(resolved.sizing),\n };\n\n const body = (\n <UniversalWrapper {...universal}>\n <Primitive resolved={resolved} transitionFor={transitionFor}>\n {children}\n </Primitive>\n </UniversalWrapper>\n );\n\n // LSML 1.1 §6.6 — when a primitive declares keyframes, wrap the\n // rendered subtree in a player that drives framer-motion through the\n // step path. The player handles replay-on-key-change and reads any\n // ambient stagger delay from StaggerContext (§6.7).\n if (node.keyframes) {\n return (\n <KeyframePlayer keyframes={node.keyframes} store={store}>\n {body}\n </KeyframePlayer>\n );\n }\n return body;\n}\n\nfunction extractSizing(value: unknown): { x?: SizingMode; y?: SizingMode } | undefined {\n if (typeof value !== \"object\" || value === null) return undefined;\n const obj = value as { x?: unknown; y?: unknown };\n const out: { x?: SizingMode; y?: SizingMode } = {};\n if (obj.x === \"fixed\" || obj.x === \"hug\" || obj.x === \"fill\") out.x = obj.x;\n if (obj.y === \"fixed\" || obj.y === \"hug\" || obj.y === \"fill\") out.y = obj.y;\n return out.x !== undefined || out.y !== undefined ? out : undefined;\n}\n\nfunction Repeat({ node, store }: TreeProps): ReactNode {\n useSignals();\n const scope = usePathScope();\n\n const itemsBinding = node.bindings?.items;\n const items =\n itemsBinding === undefined\n ? []\n : ((store.signal(scopedPath(scope, itemsBinding)).value as unknown[] | undefined) ?? []);\n if (!Array.isArray(items)) return null;\n\n const template = node.children?.[0];\n if (!template) return null;\n\n // LSML 1.1 §6.7 — `stagger_ms` produces wave-like reveals across\n // iterations. We compute the per-iteration delay (capped) and feed\n // it to descendants via StaggerContext so the KeyframePlayer (and\n // future animate-aware primitives) can pick it up without per-\n // iteration scripting. `stagger_ms: 0` (or unset) is a no-op.\n const staggerMs = typeof node.stagger_ms === \"number\" ? node.stagger_ms : 0;\n\n return (\n <>\n {items.map((_item, idx) => {\n const delayMs = computeStaggerDelayMs(idx, staggerMs);\n const tree = (\n <PathScopeProvider key={idx} prefix={`${itemsBinding ?? \"\"}.${idx}`}>\n <Tree node={template} store={store} />\n </PathScopeProvider>\n );\n if (delayMs <= 0) return tree;\n return (\n <StaggerContext.Provider key={idx} value={delayMs}>\n {tree}\n </StaggerContext.Provider>\n );\n })}\n </>\n );\n}\n\nfunction resolveProps(node: RenderNode, store: Store, scope: string): Record<string, unknown> {\n const out: Record<string, unknown> = { ...(node.props ?? {}) };\n if (node.bindings) {\n for (const [propKey, path] of Object.entries(node.bindings)) {\n const fullPath = scopedPath(scope, path);\n out[propKey] = store.signal(fullPath).value;\n }\n }\n return out;\n}\n\n/** Helper for the useMemo deps array — read each bound signal so the\n * memo invalidates when any binding moves. */\nfunction readBindingValues(node: RenderNode, store: Store, scope: string): unknown[] {\n if (!node.bindings) return [];\n const values: unknown[] = [];\n for (const path of Object.values(node.bindings)) {\n values.push(store.signal(scopedPath(scope, path)).value);\n }\n return values;\n}\n"],"names":["Stack","resolved","children","direction","gap","numberOr","wrap","crossGap","align","justify","isHorizontal","style","jsx","v","fallback","Grid","cols","rows","gradientIdSeq","nextGradientId","renderFill","fill","id","rad","x1","y1","x2","y2","s","i","cx","cy","backgroundsToCss","fills","layers","fillToCss","stops","cssWithOpacity","color","opacity","hex","a","parseFills","value","isFill","k","Frame","transitionFor","x","y","width","sizeProp","height","scale","rotate","legacyBackground","backgrounds","tx","motion","toFramer","Text","size","font","weight","colour","Image","src","fit","position","dimOr","Shape","kind","legacyFill","legacyStroke","legacyStrokeWidth","radius","transition","strokes","parseStrokes","fillRenders","allDefs","r","fillRefs","strokeLayers","stackedFills","stackedStrokes","renderShape","stroke","keyPrefix","jsxs","ref","Media","loop","mute","autoplay","Instance","sceneId","sceneVersion","PRIMITIVES","PathScopeContext","createContext","PathScopeProvider","prefix","parent","useContext","next","usePathScope","scopedPath","path","flexFor","mode","UniversalWrapper","visible","rotation","sizing","hasOpacity","hasRotation","hasSizing","FRAMER_EASE_MAP","compileForFramer","kf","steps","first","last","times","animate","pullChannel","pullTransform","prop","out","any","values","defaultFor","n","StaggerContext","STAGGER_CAP_MS","computeStaggerDelayMs","index","staggerMs","raw","KeyframePlayer","keyframes","store","useSignals","scope","staggerDelayMs","lastKeyValue","useRef","replayTokenRef","compiled","firstFrame","ReplayOnMount","useEffect","arr","Tree","node","Repeat","Node","useMemo","resolveProps","readBindingValues","Primitive","liveTransitions","key","ts","child","idx","universal","extractSizing","body","obj","itemsBinding","items","template","Fragment","_item","delayMs","tree","propKey","fullPath"],"mappings":";;;;;AAaO,SAASA,EAAM,EAAE,UAAAC,GAAU,UAAAC,KAA4B;AAC5D,QAAMC,IAAaF,EAAS,aAAwB,YAC9CG,IAAMC,EAASJ,EAAS,KAAK,CAAC,GAC9BK,IAAOL,EAAS,SAAS,IACzBM,IAAWF,EAASJ,EAAS,UAAU,CAAC,GACxCO,IAASP,EAAS,SAAoB,WACtCQ,IAAWR,EAAS,WAAsB,cAC1CS,IAAeP,MAAc,cAE7BQ,IAAuB;AAAA,IAC3B,SAAS;AAAA,IACT,eAAeD,IAAe,QAAQ;AAAA,IACtC,YAAYF;AAAA,IACZ,gBAAgBC;AAAA,EAAA;AAGlB,SAAIH,KACFK,EAAM,WAAW,QACbD,KACFC,EAAM,YAAYP,GAClBO,EAAM,SAASJ,MAEfI,EAAM,SAASP,GACfO,EAAM,YAAYJ,MAGpBI,EAAM,MAAMP,GAGP,gBAAAQ,EAAC,OAAA,EAAI,OAAAD,GAAe,UAAAT,EAAA,CAAS;AACtC;AAEA,SAASG,EAASQ,GAAYC,GAA0B;AACtD,SAAO,OAAOD,KAAM,YAAY,OAAO,SAASA,CAAC,IAAIA,IAAIC;AAC3D;AC5CO,SAASC,EAAK,EAAE,UAAAd,GAAU,UAAAC,KAA4B;AAC3D,QAAMc,IAAQf,EAAS,QAAmB,OACpCgB,IAAQhB,EAAS,QAAmB,QACpCG,IAAOH,EAAS,OAAuC;A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