@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.
@@ -1,21 +1,21 @@
1
- import { jsx as a, jsxs as N, Fragment as C } from "react/jsx-runtime";
2
- import { useSignals as O } from "@preact/signals-react/runtime";
3
- import { useContext as _, createContext as E, useRef as G, useEffect as U, useMemo as X } from "react";
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-DUhPPRvw.js";
6
- function Y({ resolved: t, children: n }) {
7
- const i = t.direction ?? "vertical", e = R(t.gap, 0), r = t.wrap === !0, o = R(t.crossGap, 0), s = t.align ?? "stretch", c = t.justify ?? "flex-start", l = i === "horizontal", u = {
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: s,
11
- justifyContent: c
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 J({ resolved: t, children: n }) {
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 j = 0;
34
- function Q() {
35
- return j = (j + 1) % 1e6, `lumen-grad-${j.toString(36)}`;
33
+ let M = 0;
34
+ function Z() {
35
+ return M = (M + 1) % 1e6, `lumen-grad-${M.toString(36)}`;
36
36
  }
37
- function Z(t) {
37
+ function tt(t) {
38
38
  if (t.kind === "solid")
39
39
  return { defs: [], ref: t.color };
40
- const n = Q();
40
+ const n = Z();
41
41
  if (t.kind === "linear-gradient") {
42
- const c = ((t.angle_deg ?? 0) - 90) * Math.PI / 180, l = 0.5 - 0.5 * Math.cos(c), u = 0.5 - 0.5 * Math.sin(c), f = 0.5 + 0.5 * Math.cos(c), g = 0.5 + 0.5 * Math.sin(c);
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((y, m) => /* @__PURE__ */ a(
52
+ children: t.stops.map((d, m) => /* @__PURE__ */ a(
53
53
  "stop",
54
54
  {
55
- offset: y.offset,
56
- stopColor: y.color,
57
- ...y.opacity !== void 0 ? { stopOpacity: y.opacity } : {}
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((s, c) => /* @__PURE__ */ a(
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: s.offset,
72
- stopColor: s.color,
73
- ...s.opacity !== void 0 ? { stopOpacity: s.opacity } : {}
71
+ offset: c.offset,
72
+ stopColor: c.color,
73
+ ...c.opacity !== void 0 ? { stopOpacity: c.opacity } : {}
74
74
  },
75
- c
75
+ s
76
76
  )) }, n)
77
77
  ], ref: `url(#${n})` };
78
78
  }
79
- function tt(t) {
80
- const n = t.map(nt).filter(Boolean);
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 nt(t) {
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 ? it(r.color, r.opacity) : r.color} ${(r.offset * 100).toFixed(2)}%`).join(", ");
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 it(t, n) {
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 B(t) {
101
- return Array.isArray(t) ? t.filter(et) : [];
100
+ function V(t) {
101
+ return Array.isArray(t) ? t.filter(rt) : [];
102
102
  }
103
- function et(t) {
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 rt({ resolved: t, transitionFor: n, children: i }) {
109
- const e = b(t.x, 0), r = b(t.y, 0), o = T(t.width), s = T(t.height), c = b(t.opacity, 1), l = b(t.scale, 1), u = b(t.rotate, 0), f = t.background ?? void 0, g = B(t.backgrounds), h = n("opacity") ?? n("scale") ?? n("rotate") ?? n("x") ?? n("y"), y = {
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: s,
114
+ height: c,
115
115
  willChange: "transform, opacity"
116
116
  };
117
- return g.length > 0 ? Object.assign(y, tt(g)) : f !== void 0 && (y.background = f), /* @__PURE__ */ a(
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: y,
120
+ style: d,
121
121
  animate: {
122
- opacity: c,
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 ot({ resolved: t, transitionFor: n }) {
140
- const i = t.value === void 0 ? "" : String(t.value), e = t.size ?? "1rem", r = t.weight ?? 400, o = t.colour ?? "currentColor", s = t.align ?? "start", c = st(t.opacity, 1), l = n("opacity") ?? n("value");
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
- fontWeight: r,
148
- color: o,
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: c },
153
- transition: S(l),
155
+ animate: { opacity: l },
156
+ transition: S(u),
154
157
  children: i
155
158
  }
156
159
  );
157
160
  }
158
- function st(t, n) {
161
+ function ct(t, n) {
159
162
  return typeof t == "number" && Number.isFinite(t) ? t : n;
160
163
  }
161
- function ct({ resolved: t, transitionFor: n }) {
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 = at(t.opacity, 1), s = n("opacity") ?? n("src");
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: "100%",
173
- height: "100%",
175
+ width: c,
176
+ height: s,
174
177
  willChange: "opacity"
175
178
  },
176
179
  animate: { opacity: o },
177
- transition: S(s),
180
+ transition: S(l),
178
181
  draggable: !1
179
182
  }
180
183
  );
181
184
  }
182
- function at(t, n) {
185
+ function ut(t, n) {
183
186
  return typeof t == "number" && Number.isFinite(t) ? t : n;
184
187
  }
185
- function ut({ resolved: t, transitionFor: n }) {
186
- const i = t.kind ?? "rect", e = t.fill ?? "transparent", r = t.stroke ?? "transparent", o = x(t.stroke_width, 0), s = x(t.width, 100), c = x(t.height, 100), l = x(t.radius, 0), u = x(t.opacity, 1), f = n("opacity"), g = S(f), h = B(t.fills), y = lt(t.strokes), m = h.map(Z), A = m.flatMap((d) => d.defs), K = m.length > 0 ? m.map((d) => d.ref) : [e], q = y.length > 0 ? y.map((d) => ({ color: d.color ?? "transparent", width: d.width ?? 0 })) : [{ color: r, width: o }], H = [...K].reverse(), L = [...q].reverse(), I = (d, p, M) => i === "circle" ? /* @__PURE__ */ a(
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: s / 2,
190
- cy: c / 2,
191
- r: Math.min(s, c) / 2 - p.width / 2,
192
- fill: d,
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
- M
202
+ F
197
203
  ) : i === "line" ? /* @__PURE__ */ a(
198
204
  "line",
199
205
  {
200
206
  x1: "0",
201
- y1: c / 2,
202
- x2: s,
203
- y2: c / 2,
204
- stroke: p.color || d,
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
- M
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, s - p.width),
214
- height: Math.max(0, c - p.width),
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: d,
223
+ fill: y,
218
224
  stroke: p.color,
219
225
  strokeWidth: p.width
220
226
  },
221
- M
227
+ F
222
228
  );
223
- return /* @__PURE__ */ N(
229
+ return /* @__PURE__ */ B(
224
230
  w.svg,
225
231
  {
226
- width: s,
227
- height: c,
228
- viewBox: `0 0 ${s} ${c}`,
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
- H.map(
235
- (d, p) => I(d, { color: "transparent", width: 0 }, `fill-${p}`)
240
+ L.map(
241
+ (y, p) => I(y, { color: "transparent", width: 0 }, `fill-${p}`)
236
242
  ),
237
- L.map((d, p) => I("none", d, `stroke-${p}`))
243
+ U.map((y, p) => I("none", y, `stroke-${p}`))
238
244
  ]
239
245
  }
240
246
  );
241
247
  }
242
- function lt(t) {
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 ft({ resolved: t }) {
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 pt({ resolved: t }) {
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: Y,
294
- grid: J,
295
- frame: rt,
296
- text: ot,
297
- image: ct,
298
- shape: ut,
299
- media: ft,
300
- instance: pt
301
- }, F = E("");
302
- function yt({ prefix: t, children: n }) {
303
- const i = _(F), e = i ? `${i}.${t}` : t;
304
- return /* @__PURE__ */ a(F.Provider, { value: e, children: n });
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 _(F);
313
+ return _(j);
308
314
  }
309
315
  function $(t, n) {
310
316
  return !t || n.startsWith("__") ? n : `${t}.${n}`;
311
317
  }
312
- function z(t) {
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 gt({
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, s = typeof i == "number" && i !== 0, c = e?.x !== void 0 || e?.y !== void 0;
334
- if (!o && !s && !c)
335
- return /* @__PURE__ */ a(C, { children: r });
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), s && (l.transform = `rotate(${i}deg)`), c) {
338
- const u = z(e?.x), f = z(e?.y);
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 ht = {
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 mt(t) {
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((s) => s.at), o = {};
355
- return v(n, "opacity", o), v(n, "filter", o), k(n, "scale", o), k(n, "translateX", o), k(n, "translateY", o), k(n, "rotate", o), {
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: ht[t.easing ?? "linear"],
365
+ ease: mt[t.easing ?? "linear"],
360
366
  times: r
361
367
  }
362
368
  };
363
369
  }
364
- function v(t, n, i) {
370
+ function N(t, n, i) {
365
371
  let e = !1;
366
372
  const r = [];
367
373
  let o;
368
- for (const s of t) {
369
- const c = s[n];
370
- c !== void 0 ? (e = !0, o = c, r.push(c)) : r.push(o ?? (n === "opacity" ? 1 : "none"));
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 s of t) {
379
- const c = s.transform?.[n];
380
- typeof c == "number" ? (e = !0, o = c, r.push(c)) : r.push(o ?? bt(n));
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((s) => `${s}deg`) : i[n] = r);
388
+ e && (n === "rotate" ? i.rotate = r.map((c) => `${c}deg`) : i[n] = r);
383
389
  }
384
- function bt(t) {
390
+ function xt(t) {
385
391
  return t === "scale" ? 1 : 0;
386
392
  }
387
- const D = E(0), W = 2e3;
388
- function xt(t, n) {
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 > W ? W : i;
397
+ return i > E ? E : i;
392
398
  }
393
- function wt({ keyframes: t, store: n, children: i }) {
394
- O();
395
- const e = P(), r = _(D), o = G(void 0), s = G(0);
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, s.current += 1);
404
+ o.current !== u && (o.current = u, c.current += 1);
399
405
  }
400
- const c = mt(t);
401
- if (!c)
402
- return /* @__PURE__ */ a(C, { children: i });
403
- const l = r > 0 ? { ...c.transition, delay: r / 1e3 } : c.transition;
404
- return /* @__PURE__ */ N(
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: kt(c.animate),
409
- animate: c.animate,
414
+ initial: St(s.animate),
415
+ animate: s.animate,
410
416
  transition: l,
411
417
  children: [
412
- /* @__PURE__ */ a($t, {}),
418
+ /* @__PURE__ */ a(kt, {}),
413
419
  i
414
420
  ]
415
421
  },
416
- s.current
422
+ c.current
417
423
  );
418
424
  }
419
- function $t() {
420
- return U(() => {
425
+ function kt() {
426
+ return X(() => {
421
427
  }, []), null;
422
428
  }
423
- function kt(t) {
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 V({ node: t, store: n }) {
430
- return t.kind === "repeat" ? /* @__PURE__ */ a(jt, { node: t, store: n }) : /* @__PURE__ */ a(St, { node: t, store: n });
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 St({ node: t, store: n }) {
433
- O();
434
- const i = P(), e = X(
435
- () => Ft(t, n, i),
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 s = (f) => f in o ? o[f] : t.transitions?.[f], c = t.children?.map((f, g) => /* @__PURE__ */ a(V, { node: f, store: n }, f.id ?? g)), l = {
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(gt, { ...l, children: /* @__PURE__ */ a(r, { resolved: e, transitionFor: s, children: c }) });
456
- return t.keyframes ? /* @__PURE__ */ a(wt, { keyframes: t.keyframes, store: n, children: u }) : u;
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
- O();
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 s = typeof t.stagger_ms == "number" ? t.stagger_ms : 0;
470
- return /* @__PURE__ */ a(C, { children: r.map((c, l) => {
471
- const u = xt(l, s), f = /* @__PURE__ */ a(yt, { prefix: `${e ?? ""}.${l}`, children: /* @__PURE__ */ a(V, { node: o, store: n }) }, l);
472
- return u <= 0 ? f : /* @__PURE__ */ a(D.Provider, { value: u, children: f }, l);
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 Ft(t, n, i) {
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 s = $(i, o);
480
- e[r] = n.signal(s).value;
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
- V as T
498
+ v as T
493
499
  };
494
- //# sourceMappingURL=tree-CnhX02kd.js.map
500
+ //# sourceMappingURL=tree-B_wLlJ36.js.map