@wardic/core 1.3.2 → 1.4.1

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.
Files changed (228) hide show
  1. package/dist/Arc.d.ts +2 -2
  2. package/dist/Arc.js +1 -1
  3. package/dist/BaseValue.d.ts +11 -10
  4. package/dist/BaseValue.d.ts.map +1 -1
  5. package/dist/BaseValue.js +12 -15
  6. package/dist/BaseValue.js.map +1 -1
  7. package/dist/Batch.d.ts +15 -5
  8. package/dist/Batch.d.ts.map +1 -1
  9. package/dist/Batch.js +218 -20
  10. package/dist/Batch.js.map +1 -1
  11. package/dist/Clock.d.ts +7 -7
  12. package/dist/Clock.d.ts.map +1 -1
  13. package/dist/Clock.js +17 -16
  14. package/dist/Clock.js.map +1 -1
  15. package/dist/DefaultTransition.d.ts +3 -2
  16. package/dist/DefaultTransition.d.ts.map +1 -1
  17. package/dist/DefaultTransition.js +5 -3
  18. package/dist/DefaultTransition.js.map +1 -1
  19. package/dist/Drag.d.ts +24 -9
  20. package/dist/Drag.d.ts.map +1 -1
  21. package/dist/Drag.js +10 -10
  22. package/dist/Drag.js.map +1 -1
  23. package/dist/DragActivity.js +3 -3
  24. package/dist/DragRecognizer.d.ts +5 -4
  25. package/dist/DragRecognizer.d.ts.map +1 -1
  26. package/dist/DragRecognizer.js +37 -14
  27. package/dist/DragRecognizer.js.map +1 -1
  28. package/dist/Easing.d.ts +1 -1
  29. package/dist/Easing.js +1 -1
  30. package/dist/Frame.d.ts.map +1 -1
  31. package/dist/Frame.js +5 -3
  32. package/dist/Frame.js.map +1 -1
  33. package/dist/InputFeed.d.ts +1 -1
  34. package/dist/InputFeed.js +2 -2
  35. package/dist/InputSource.d.ts +3 -3
  36. package/dist/InputSource.js +2 -2
  37. package/dist/Interpolator.d.ts +2 -2
  38. package/dist/Interpolator.js +2 -2
  39. package/dist/InterpolatorRegistry.d.ts +29 -15
  40. package/dist/InterpolatorRegistry.d.ts.map +1 -1
  41. package/dist/InterpolatorRegistry.js +17 -8
  42. package/dist/InterpolatorRegistry.js.map +1 -1
  43. package/dist/LiveValue.d.ts +7 -6
  44. package/dist/LiveValue.d.ts.map +1 -1
  45. package/dist/LiveValue.js +45 -14
  46. package/dist/LiveValue.js.map +1 -1
  47. package/dist/Machine.d.ts +7 -4
  48. package/dist/Machine.d.ts.map +1 -1
  49. package/dist/Machine.js +146 -45
  50. package/dist/Machine.js.map +1 -1
  51. package/dist/Playback.d.ts.map +1 -1
  52. package/dist/Playback.js +6 -1
  53. package/dist/Playback.js.map +1 -1
  54. package/dist/Projection.d.ts +9 -9
  55. package/dist/Projection.js +2 -2
  56. package/dist/Recognizer.d.ts +4 -3
  57. package/dist/Recognizer.d.ts.map +1 -1
  58. package/dist/Recognizer.js +49 -20
  59. package/dist/Recognizer.js.map +1 -1
  60. package/dist/ReducedMotion.d.ts +4 -4
  61. package/dist/ReducedMotion.js +6 -6
  62. package/dist/Renderer.d.ts +5 -5
  63. package/dist/Renderer.js +6 -6
  64. package/dist/Renderer.js.map +1 -1
  65. package/dist/Reorder.d.ts +1 -1
  66. package/dist/Reorder.d.ts.map +1 -1
  67. package/dist/Reorder.js +2 -1
  68. package/dist/Reorder.js.map +1 -1
  69. package/dist/ScrollSource.d.ts +1 -1
  70. package/dist/ScrollSource.d.ts.map +1 -1
  71. package/dist/Sequence.d.ts +1 -1
  72. package/dist/SharedSource.d.ts +3 -3
  73. package/dist/SharedSource.js +5 -5
  74. package/dist/SharedSource.js.map +1 -1
  75. package/dist/Spring.d.ts.map +1 -1
  76. package/dist/Spring.js +2 -1
  77. package/dist/Spring.js.map +1 -1
  78. package/dist/Values.d.ts +2 -2
  79. package/dist/Values.js +1 -1
  80. package/dist/index.d.ts +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/internal/carried.d.ts +13 -0
  83. package/dist/internal/carried.d.ts.map +1 -0
  84. package/dist/internal/carried.js +23 -0
  85. package/dist/internal/carried.js.map +1 -0
  86. package/dist/internal/firstSteps.d.ts +66 -0
  87. package/dist/internal/firstSteps.d.ts.map +1 -0
  88. package/dist/internal/firstSteps.js +107 -0
  89. package/dist/internal/firstSteps.js.map +1 -0
  90. package/dist/internal/frameLoop.d.ts +1 -1
  91. package/dist/internal/frameLoop.d.ts.map +1 -1
  92. package/dist/internal/frameLoop.js +102 -81
  93. package/dist/internal/frameLoop.js.map +1 -1
  94. package/dist/internal/lerpsNumbers.d.ts +11 -0
  95. package/dist/internal/lerpsNumbers.d.ts.map +1 -0
  96. package/dist/internal/lerpsNumbers.js +38 -0
  97. package/dist/internal/lerpsNumbers.js.map +1 -0
  98. package/dist/internal/options.d.ts +7 -7
  99. package/dist/internal/options.d.ts.map +1 -1
  100. package/dist/internal/options.js +10 -10
  101. package/dist/internal/options.js.map +1 -1
  102. package/dist/internal/stepper.d.ts +13 -2
  103. package/dist/internal/stepper.d.ts.map +1 -1
  104. package/dist/internal/stepper.js +16 -1
  105. package/dist/internal/stepper.js.map +1 -1
  106. package/dist/internal/tracing.d.ts +1 -1
  107. package/dist/internal/tracing.js +1 -1
  108. package/dist/unstable/AnimationControls.d.ts +37 -38
  109. package/dist/unstable/AnimationControls.d.ts.map +1 -1
  110. package/dist/unstable/AnimationControls.js +39 -36
  111. package/dist/unstable/AnimationControls.js.map +1 -1
  112. package/dist/unstable/AppearHandoff.d.ts +5 -5
  113. package/dist/unstable/AppearHandoff.d.ts.map +1 -1
  114. package/dist/unstable/BatchCalls.d.ts +2 -2
  115. package/dist/unstable/BatchCalls.js +5 -5
  116. package/dist/unstable/Config.d.ts +19 -19
  117. package/dist/unstable/Config.d.ts.map +1 -1
  118. package/dist/unstable/FirstSteps.d.ts +25 -0
  119. package/dist/unstable/FirstSteps.d.ts.map +1 -0
  120. package/dist/unstable/FirstSteps.js +2 -0
  121. package/dist/unstable/FirstSteps.js.map +1 -0
  122. package/dist/unstable/FlushGate.d.ts +53 -51
  123. package/dist/unstable/FlushGate.d.ts.map +1 -1
  124. package/dist/unstable/FlushGate.js +56 -49
  125. package/dist/unstable/FlushGate.js.map +1 -1
  126. package/dist/unstable/FrameEffects.d.ts +2 -2
  127. package/dist/unstable/FrameEffects.js +2 -2
  128. package/dist/unstable/FrameTime.d.ts +1 -1
  129. package/dist/unstable/FrameTime.js +1 -1
  130. package/dist/unstable/Imperative.d.ts +29 -9
  131. package/dist/unstable/Imperative.d.ts.map +1 -1
  132. package/dist/unstable/Imperative.js +79 -47
  133. package/dist/unstable/Imperative.js.map +1 -1
  134. package/dist/unstable/OwnValues.js +1 -1
  135. package/dist/unstable/PresenceRecord.d.ts +26 -26
  136. package/dist/unstable/PresenceRecord.d.ts.map +1 -1
  137. package/dist/unstable/PresenceRecord.js +8 -8
  138. package/dist/unstable/PresenceRecord.js.map +1 -1
  139. package/dist/unstable/Projector.d.ts +34 -0
  140. package/dist/unstable/Projector.d.ts.map +1 -0
  141. package/dist/unstable/Projector.js +9 -0
  142. package/dist/unstable/Projector.js.map +1 -0
  143. package/dist/unstable/Report.d.ts +1 -1
  144. package/dist/unstable/Report.js +1 -1
  145. package/dist/unstable/RetargetLegs.d.ts +1 -1
  146. package/dist/unstable/RetargetLegs.d.ts.map +1 -1
  147. package/dist/unstable/RetargetLegs.js +9 -8
  148. package/dist/unstable/RetargetLegs.js.map +1 -1
  149. package/dist/unstable/Spine.d.ts +81 -72
  150. package/dist/unstable/Spine.d.ts.map +1 -1
  151. package/dist/unstable/Spine.js +152 -150
  152. package/dist/unstable/Spine.js.map +1 -1
  153. package/dist/unstable/Stops.d.ts +3 -3
  154. package/dist/unstable/Stops.js +4 -4
  155. package/dist/unstable/Subject.d.ts +2 -2
  156. package/dist/unstable/Subject.js +2 -2
  157. package/dist/unstable/Timelines.d.ts +11 -11
  158. package/dist/unstable/Timelines.d.ts.map +1 -1
  159. package/dist/unstable/Timelines.js +3 -3
  160. package/dist/unstable/VariantTarget.d.ts +7 -7
  161. package/dist/unstable/VariantTarget.d.ts.map +1 -1
  162. package/dist/unstable/VariantTarget.js +11 -11
  163. package/dist/unstable/VariantTarget.js.map +1 -1
  164. package/dist/unstable/VariantTree.d.ts +36 -36
  165. package/dist/unstable/VariantTree.d.ts.map +1 -1
  166. package/dist/unstable/VariantTree.js +33 -33
  167. package/dist/unstable/VariantTree.js.map +1 -1
  168. package/dist/unstable/WardicConfigValue.d.ts +13 -13
  169. package/dist/unstable/WardicConfigValue.d.ts.map +1 -1
  170. package/dist/unstable/WardicConfigValue.js +4 -4
  171. package/dist/unstable/WardicConfigValue.js.map +1 -1
  172. package/package.json +1 -1
  173. package/src/Arc.ts +3 -3
  174. package/src/BaseValue.ts +18 -21
  175. package/src/Batch.ts +236 -22
  176. package/src/Clock.ts +18 -17
  177. package/src/DefaultTransition.ts +5 -3
  178. package/src/Drag.ts +32 -14
  179. package/src/DragActivity.ts +3 -3
  180. package/src/DragRecognizer.ts +41 -16
  181. package/src/Easing.ts +1 -1
  182. package/src/Frame.ts +5 -3
  183. package/src/InputFeed.ts +2 -2
  184. package/src/InputSource.ts +5 -5
  185. package/src/Interpolator.ts +3 -3
  186. package/src/InterpolatorRegistry.ts +22 -13
  187. package/src/LiveValue.ts +47 -17
  188. package/src/Machine.ts +199 -61
  189. package/src/Playback.ts +5 -1
  190. package/src/Projection.ts +9 -9
  191. package/src/Recognizer.ts +69 -38
  192. package/src/ReducedMotion.ts +6 -6
  193. package/src/Renderer.ts +6 -6
  194. package/src/Reorder.ts +3 -2
  195. package/src/ScrollSource.ts +1 -1
  196. package/src/Sequence.ts +1 -1
  197. package/src/SharedSource.ts +5 -5
  198. package/src/Spring.ts +2 -1
  199. package/src/Values.ts +2 -2
  200. package/src/index.ts +1 -1
  201. package/src/internal/carried.ts +22 -0
  202. package/src/internal/firstSteps.ts +139 -0
  203. package/src/internal/frameLoop.ts +103 -87
  204. package/src/internal/lerpsNumbers.ts +53 -0
  205. package/src/internal/options.ts +10 -10
  206. package/src/internal/stepper.ts +20 -2
  207. package/src/internal/tracing.ts +1 -1
  208. package/src/unstable/AnimationControls.ts +59 -56
  209. package/src/unstable/AppearHandoff.ts +6 -6
  210. package/src/unstable/BatchCalls.ts +5 -5
  211. package/src/unstable/Config.ts +19 -19
  212. package/src/unstable/FirstSteps.ts +26 -0
  213. package/src/unstable/FlushGate.ts +92 -82
  214. package/src/unstable/FrameEffects.ts +2 -2
  215. package/src/unstable/FrameTime.ts +1 -1
  216. package/src/unstable/Imperative.ts +126 -56
  217. package/src/unstable/OwnValues.ts +1 -1
  218. package/src/unstable/PresenceRecord.ts +29 -29
  219. package/src/unstable/Projector.ts +45 -0
  220. package/src/unstable/Report.ts +1 -1
  221. package/src/unstable/RetargetLegs.ts +10 -9
  222. package/src/unstable/Spine.ts +190 -188
  223. package/src/unstable/Stops.ts +6 -6
  224. package/src/unstable/Subject.ts +2 -2
  225. package/src/unstable/Timelines.ts +12 -12
  226. package/src/unstable/VariantTarget.ts +13 -13
  227. package/src/unstable/VariantTree.ts +42 -42
  228. package/src/unstable/WardicConfigValue.ts +13 -13
package/src/Machine.ts CHANGED
@@ -51,6 +51,7 @@ import * as Frame from "./Frame.ts"
51
51
  import * as FrameLoop from "./FrameLoop.ts"
52
52
  import * as InterpolatorRegistry from "./InterpolatorRegistry.ts"
53
53
  import { sourceOf } from "./internal/driven.ts"
54
+ import * as LerpsNumbers from "./internal/lerpsNumbers.ts"
54
55
  import { cachedResolver, checked, finite } from "./internal/options.ts"
55
56
  import {
56
57
  initDecay,
@@ -72,8 +73,10 @@ import {
72
73
  stepTween,
73
74
  type WritableFrame,
74
75
  TweenFields,
76
+ TweenFrame,
75
77
  } from "./internal/stepper.ts"
76
78
  import * as Inertia from "./Inertia.ts"
79
+ import * as Scalar from "./Scalar.ts"
77
80
  import type * as Point from "./Point.ts"
78
81
  import * as Spring from "./Spring.ts"
79
82
  import * as UnitScale from "./UnitScale.ts"
@@ -167,7 +170,7 @@ export const isMachine = (u: unknown): u is Machine<Frame.Frame<unknown>> => Pre
167
170
  */
168
171
  // Every constructor clamps each step's `dt` here once (#78), in its leaves' steps and in `delay`'s hold,
169
172
  // so both drivers clamp and no stepper needs to defend itself; dom's projection pass clamps its own.
170
- // Inline, not a `clampDt` layer: a layer is one more call per element per frame, which V8 doesn't
173
+ // Inline, not a `clampDt` layer: a layer is one more call per Subject per frame, which V8 doesn't
171
174
  // inline (ADR-0028, *Implementation in #94*). Why 500 ms (#23, ADR-0017 *Amendment (#23)*): a stall up
172
175
  // to it reaches each consumer whole, so a tween, a spring, decay, inertia or a layout animation lands
173
176
  // where wall time puts it, as Motion's time-based animations do; a longer one advances it 500 ms. It
@@ -763,7 +766,7 @@ export type Streamed<F> = F extends Frame.SpringValues ? Frame.MultiPhysics : F
763
766
  // with its attributes; per-frame work is unlogged. Every Frame is copied (`owned`) before it's
764
767
  // emitted, so a consumer that collects Frames never sees one rewritten (ADR-0030, decision 11; #895). A
765
768
  // Stream, not a Channel: measured 2026-11-02, Stream's own layers were ~5% of a pull of the Clock's
766
- // ticks, and elements never use `toStream`, so a Channel would gain nothing measurable (#618, M5).
769
+ // ticks, and Subjects never use `toStream`, so a Channel would gain nothing measurable (#618, M5).
767
770
  export const toStream = <F extends Frame.Frame<unknown>>(self: Machine<F>): Stream.Stream<Streamed<F>, never, Clock.Clock> =>
768
771
  Stream.unwrap(
769
772
  Effect.gen(function* () {
@@ -794,8 +797,8 @@ export const toStream = <F extends Frame.Frame<unknown>>(self: Machine<F>): Stre
794
797
  // A plain call, typed `(frame) => undefined`, so a sink that returns an Effect doesn't compile
795
798
  // (ADR-0027, decision 8). Dies if the step or the sink throws, or with the loop's own failure. One span
796
799
  // per run, with a `<name>: start` debug log. The token (#200, ADR-0027 *Amendment (#200)*): it leaves the
797
- // loop at once, as an interrupted run does, about a sixth of the cost. `springValues`, a tween and the
798
- // blends rewrite one Frame per run (ADR-0030, decision 11 and *Amendment (#895)*). A machine built with a service: `Effect.flatMap(Machine.run(sink))`.
800
+ // loop at once, as an interrupted run does, about a sixth of the cost. `springValues`, a tween, the
801
+ // blends and `keyframesValues` rewrite one Frame per run (ADR-0030, decision 11 and *Amendments (#895, #1031)*). A machine built with a service: `Effect.flatMap(Machine.run(sink))`.
799
802
  export const run: {
800
803
  <F extends Frame.Frame<unknown>>(sink: FrameLoop.Sink<F>): (self: Machine<F>) => Effect.Effect<F, never, FrameLoop.FrameLoop>
801
804
  <F extends Frame.Frame<unknown>>(
@@ -817,11 +820,13 @@ export const run: {
817
820
 
818
821
  /**
819
822
  * `run`'s options: the token the run joins, so `Supersede.end` ends it with the others; and whether the
820
- * run keeps the frame timeline's time, its start read from it (an Appear animation's `currentTime`), so
821
- * the Frame loop never leaves a late frame's time out of its first steps (`Clock.LateFrames`).
823
+ * run keeps the frame timeline's time, so the Frame loop never leaves a late frame's time out of its first
824
+ * steps (`Clock.LateFrames`): one whose start is read from it (an Appear animation's `currentTime`), or one
825
+ * that reports the frames' time rather than animating from a start (`LiveValue.time`, `eachFrame` and
826
+ * `velocity`).
822
827
  */
823
- // #200; #1026: a run on wall time (a video's `currentTime`, `performance.now()`) leaves `onFrameTimeline`
824
- // out, and is right that way.
828
+ // #200; #1026: a run on a clock of its own (a video's `currentTime`, its own `performance.now()` reads) leaves
829
+ // `onFrameTimeline` out, and is right that way: the Frame loop's dt isn't its time.
825
830
  export interface RunOptions {
826
831
  readonly supersede?: Supersede.Supersede | undefined
827
832
  readonly onFrameTimeline?: boolean | undefined
@@ -838,7 +843,7 @@ const tweenLeaf = (from: number, to: number, tween: ResolvedTween, span: Span):
838
843
  span,
839
844
  start: () => {
840
845
  const state = initTween()
841
- const frame: WritableFrame<number> = { value: from, done: false }
846
+ const frame = new TweenFrame(from)
842
847
  // Per frame (ADR-0025): the tween resolved when the machine is built, `dt` clamped (#78).
843
848
  return (dt) => {
844
849
  stepTween(state, frame, Math.min(dt, MAX_DT), from, to, tween)
@@ -1386,7 +1391,7 @@ const resolveAnimate: (options: AnimateOptions) => ResolvedAnimate = cachedResol
1386
1391
  */
1387
1392
  // #77, #91. One leaf over one frame time, as Motion's `JSAnimation` is (#226): each step adds its `dt`
1388
1393
  // (clamped at `MAX_DT`) and reads the run's pass, the time into it and its direction off the total, so a
1389
- // tick across a turn paints that tick's value, not the turn. Then `delay(options.delay)`, and its own
1394
+ // tick across a turn draws that tick's value, not the turn. Then `delay(options.delay)`, and its own
1390
1395
  // span, `wardic.animate`.
1391
1396
  export const animate = (from: number, to: number, options: AnimateOptions = NO_OPTIONS): Machine<Frame.Frame<number>> => {
1392
1397
  const resolved = resolveAnimate(options)
@@ -1483,27 +1488,82 @@ export const keyframes = (stops: ReadonlyArray<number>, options: KeyframesOption
1483
1488
  /** One key's blend at a progress `t`, given whether that progress Frame is the run's last. */
1484
1489
  type Blender = InterpolatorRegistry.KeyBlend
1485
1490
 
1491
+ /** An `InterpolatorRegistry`'s service. */
1492
+ type Registry = InterpolatorRegistry.InterpolatorRegistry["Service"]
1493
+
1494
+ /**
1495
+ * How a key moves from one value to the next, decided once per leg: a `Lerp` is a pair of numbers core's
1496
+ * number blend takes, computed in the run's loop from its ends; a `Blend` is any other, through its blender.
1497
+ */
1498
+ // #1036 (ADR-0030, *Amendment (#1036)*): the number blend's frames with no call to make.
1499
+ type Plan =
1500
+ | { readonly _tag: "Lerp"; readonly from: number; readonly to: number }
1501
+ | { readonly _tag: "Blend"; readonly blend: Blender }
1502
+
1503
+ /** A key's plan through its blender. */
1504
+ const blendPlan = (blend: Blender): Plan => ({ _tag: "Blend", blend })
1505
+
1506
+ /** A key's plan computed in the loop, from `from` to `to`. */
1507
+ const lerpPlan = (from: number, to: number): Plan => ({ _tag: "Lerp", from, to })
1508
+
1509
+ /**
1510
+ * A leg's plans laid out for its run's loop: key `i`'s blender at `blenders[i]`, `null` for a `Lerp`, whose
1511
+ * ends are at `2i` and `2i + 1` of `ends`.
1512
+ */
1513
+ // #1036: the layout measured fastest. A key that isn't a `Lerp` reads what it read before; a flag and each end in
1514
+ // arrays of their own lost most of keyframes' gain, and cost 4–9% where no key was a `Lerp`. The ends in a plain
1515
+ // array: a `Float64Array` cost each start 230–565 B more, and no less a frame.
1516
+ interface Lanes {
1517
+ readonly blenders: ReadonlyArray<Blender | null>
1518
+ readonly ends: ReadonlyArray<number>
1519
+ }
1520
+
1521
+ /** A plan's blender, `null` for a `Lerp`. */
1522
+ const blenderOf = (plan: Plan): Blender | null => {
1523
+ if (plan._tag === "Lerp") return null
1524
+ return plan.blend
1525
+ }
1526
+
1527
+ /** `plans`, laid out. */
1528
+ const lanesOf = (plans: ReadonlyArray<Plan>): Lanes => {
1529
+ // Per leg (#460): `Arr`'s loops.
1530
+ const ends = new Array<number>(2 * plans.length).fill(0)
1531
+ Arr.forEach(plans, (plan, i) => {
1532
+ if (plan._tag === "Blend") return
1533
+ ends[2 * i] = plan.from
1534
+ ends[2 * i + 1] = plan.to
1535
+ })
1536
+ return { blenders: Arr.map(plans, blenderOf), ends }
1537
+ }
1538
+
1539
+ /** Each key of a leg, in `to`'s order, and its lanes. */
1540
+ interface KeyLanes {
1541
+ readonly keys: ReadonlyArray<string>
1542
+ readonly lanes: Lanes
1543
+ }
1544
+
1486
1545
  /**
1487
- * Each key's blender from `from[key]` (its target when absent) to `to[key]`, built once through the
1546
+ * Each key's plan from `from[key]` (its target when absent) to `to[key]`, built once through the
1488
1547
  * `InterpolatorRegistry`.
1489
1548
  *
1490
1549
  * - **A Key rule first** (ADR-0035): the Environment's rule for the key by name, when one takes the
1491
1550
  * pair, gives the key's whole blend. Core holds none. `@wardic/dom`'s keep a key that hides an
1492
- * element at its old value until the run's last Frame (ADR-0024, decision 4), grow a value from its
1551
+ * Subject at its old value until the run's last Frame (ADR-0024, decision 4), grow a value from its
1493
1552
  * Animatable none (ADR-0015, *Amendment (#61)*), and blend a list item by item.
1494
1553
  * - **Else by value**: the registry's blend. A pair it can't blend is a Discrete pair and switches
1495
- * at the first Frame past 0 (ADR-0024, decision 3).
1554
+ * at the first Frame past 0 (ADR-0024, decision 3). A pair of numbers the registry blends with
1555
+ * core's number blend is a `Lerp`.
1496
1556
  */
1497
- const blendersFor: (
1557
+ const keyLanesFor: (
1498
1558
  from: Readonly<Values.Values>,
1499
1559
  to: Readonly<Values.Values>,
1500
- ) => Effect.Effect<ReadonlyArray<readonly [key: string, blend: Blender]>, never, InterpolatorRegistry.InterpolatorRegistry> =
1560
+ ) => Effect.Effect<KeyLanes, never, InterpolatorRegistry.InterpolatorRegistry> =
1501
1561
  // Per leg (#460): one Effect a key, in `to`'s order, and no record built between.
1502
1562
  Effect.fnUntraced(function* (from: Readonly<Values.Values>, to: Readonly<Values.Values>) {
1503
- const registry = yield* InterpolatorRegistry.InterpolatorRegistry
1563
+ const plan = yield* planner
1504
1564
  const keys = Rec.keys(to)
1505
- const blenders = yield* Effect.forEach(keys, (key) => blenderFor(registry, key, startOf(from, key, to[key]), to[key]))
1506
- return Arr.zip(keys, blenders)
1565
+ const plans = yield* Effect.forEach(keys, (key) => plan(key, startOf(from, key, to[key]), to[key]))
1566
+ return { keys, lanes: lanesOf(plans) }
1507
1567
  })
1508
1568
 
1509
1569
  /** `key`'s start in `from`, else its target `b`: a statement (#460), as `Rec.get` reads an own key. */
@@ -1512,23 +1572,69 @@ const startOf = (from: Values.Values, key: string, b: number | string): number |
1512
1572
  return from[key]
1513
1573
  }
1514
1574
 
1515
- /** `key`'s blender from `a` to `b` ({@link blendersFor}'s, and each of a keyframes Interval's, #429). */
1516
- const blenderFor = (registry: InterpolatorRegistry.InterpolatorRegistry["Service"], key: string, a: number | string, b: number | string): Effect.Effect<Blender> =>
1575
+ /** A leg's planner: `key`'s plan from `a` to `b` ({@link keyLanesFor}'s, and each of a keyframes Interval's, #429). */
1576
+ type Planner = (key: string, a: number | string, b: number | string) => Effect.Effect<Plan>
1577
+
1578
+ /** `registry`'s planner, its number check read once a leg. */
1579
+ const plannerOf = (registry: Registry): Planner => {
1580
+ const lerps = LerpsNumbers.lerpsNumbersOf(registry)
1581
+ // Per key, each leg (#460): statements. #1036: a Key rule is asked first, and keeps any pair it takes; the
1582
+ // registry then says whether core's number blend reads a pair of numbers, not a kind an app registered ahead.
1583
+ return (key, a, b) => {
1584
+ const ruled = registry.keyBlendOf(key, a, b)
1585
+ if (Option.isSome(ruled)) return Effect.map(ruled.value, blendPlan)
1586
+ if (Predicate.isString(a)) return resolvedPlan(registry, a, b)
1587
+ if (Predicate.isString(b)) return resolvedPlan(registry, a, b)
1588
+ if (lerps(a, b)) return Effect.succeed(lerpPlan(a, b))
1589
+ return resolvedPlan(registry, a, b)
1590
+ }
1591
+ }
1592
+
1593
+ /** The Environment's planner. */
1594
+ const planner: Effect.Effect<Planner, never, InterpolatorRegistry.InterpolatorRegistry> = Effect.map(InterpolatorRegistry.InterpolatorRegistry, plannerOf)
1595
+
1596
+ /** The registry's blend of `a` and `b`, as a plan. */
1597
+ const resolvedPlan = (registry: Registry, a: number | string, b: number | string): Effect.Effect<Plan> =>
1517
1598
  // No rule takes it: the registry's blend, through a blender made here, as before #61. A blender
1518
1599
  // made by one shared factory for every key made its call site megamorphic, and Node's string
1519
1600
  // workloads 7–9% slower per frame (#61's bench).
1520
- Option.getOrElse(registry.keyBlendOf(key, a, b), () => Effect.map(registry.resolve(a, b), (blend): Blender => (t) => blend(t)))
1601
+ Effect.map(registry.resolve(a, b), (blend) => blendPlan((t) => blend(t)))
1602
+
1603
+ /**
1604
+ * A blend run's record of `keys`, each key there from the start, unset: a number stored there each frame is
1605
+ * boxed once, and every copy of the record takes that box as it is. Made empty, V8 would keep a number
1606
+ * key's field a raw number, and a copy that reads it would box it again.
1607
+ */
1608
+ // #1031 (ADR-0030, *Amendment (#1031)*): Chromium's `Object.assign` boxed each number at each of the Blend
1609
+ // sink's three copies a frame (the Snapshot, `keepFrame`'s record, the gate's `write`), 12 B a key each. V8
1610
+ // decides a field's form from its first value: `null` keeps it one that holds anything.
1611
+ // Per Subject at mount (#540): a loop. It runs at each run's start, a mount's and a Retarget's, over the items, each
1612
+ // key read by a function made once, so a start makes its record and nothing else: an `Arr.map` of the keys and an
1613
+ // `Arr.reduce` cost each start 300 B, and bench:solid's bytes per element per round +2% (#1031).
1614
+ const seededRecordOf = <A>(items: ReadonlyArray<A>, keyOf: (item: A) => string): Record<string, number | string> => {
1615
+ const record: Record<string, number | string | null> = {}
1616
+ for (let i = 0; i < items.length; i++) {
1617
+ const key = keyOf(items[i])
1618
+ // `__proto__` would set the record's prototype, not add a key: its first store meets it as before.
1619
+ if (key !== "__proto__") record[key] = null
1620
+ }
1621
+ return record as Record<string, number | string>
1622
+ }
1623
+
1624
+ /** A keyframes Track's key. */
1625
+ const trackKey = (track: Track): string => track.key
1521
1626
 
1522
1627
  /**
1523
1628
  * `progress`'s run with every key blended at the progress `at` reads off its Frame. On the per-frame path
1524
- * (ADR-0025): a loop over the `[key, blender]` pairs built with the machine, not `Rec.map`, which spreads the
1525
- * record and then reassigns every key (#63 measured `Rec.map` 1.6× this loop in Chromium, 2.3× in JSC).
1629
+ * (ADR-0025): a loop over the keys and their lanes, laid out with the leg, not `Rec.map`, which spreads the
1630
+ * record and then reassigns every key.
1526
1631
  */
1632
+ // #63 measured `Rec.map` 1.6× this loop in Chromium, 2.3× in JSC.
1527
1633
  // In place (#895, ADR-0030 *Amendment (#895)*): its record and its Frame are its run's, made at `start()` and
1528
1634
  // rewritten each tick, as `springValues`' are (decision 11); `toStream` copies what it emits.
1529
1635
  const blendedBy = <F extends Frame.Frame<unknown>>(
1530
1636
  progress: Machine<F>,
1531
- blenders: ReadonlyArray<readonly [key: string, blend: Blender]>,
1637
+ { keys, lanes }: KeyLanes,
1532
1638
  at: (frame: F) => number,
1533
1639
  ): Machine<Frame.Frame<Values.Values>> =>
1534
1640
  make({
@@ -1536,13 +1642,23 @@ const blendedBy = <F extends Frame.Frame<unknown>>(
1536
1642
  span: progress.span,
1537
1643
  start: () => {
1538
1644
  const step = progress.start()
1539
- const frame: WritableFrame<Record<string, number | string>> = { value: {}, done: false }
1645
+ const frame: WritableFrame<Record<string, number | string>> = { value: seededRecordOf(keys, identity), done: false }
1646
+ const { blenders, ends } = lanes
1540
1647
  return (dt) => {
1541
1648
  const stepped = step(dt)
1542
1649
  const t = at(stepped)
1543
1650
  const done = stepped.done
1544
1651
  const value = frame.value
1545
- for (const pair of blenders) value[pair[0]] = pair[1](t, done)
1652
+ // A `Lerp` through `Scalar.lerp`, the number blend's own step, so its frames are that blend's. In each
1653
+ // loop, not a function both call: called, one key's frame allocated 36.8 B in Node, not 20.8 (#1036).
1654
+ for (let i = 0; i < keys.length; i++) {
1655
+ const blend = blenders[i]
1656
+ if (Predicate.isNull(blend)) {
1657
+ value[keys[i]] = Scalar.lerp(ends[2 * i], ends[2 * i + 1], t)
1658
+ continue
1659
+ }
1660
+ value[keys[i]] = blend(t, done)
1661
+ }
1546
1662
  frame.done = done
1547
1663
  return frame
1548
1664
  }
@@ -1559,7 +1675,7 @@ const springProgressOf = (frame: Frame.SpringValues): number => frame.positions[
1559
1675
  * A bag of values tweened from `from` to `to`, each key blended as its Environment blends it: numbers,
1560
1676
  * unit strings, complex values, and its own kinds, such as `@wardic/dom`'s colours. One tween drives every
1561
1677
  * key, so the repeats and `delay` apply to the whole bag. A pair that can't blend switches at the first
1562
- * frame; the Environment can hold a key until the last, as `@wardic/dom` does a key that hides an element.
1678
+ * frame; the Environment can hold a key until the last, as `@wardic/dom` does a key that hides a Subject.
1563
1679
  * Building it needs the `InterpolatorRegistry`, once. Its Frame and its record are the run's, rewritten
1564
1680
  * every tick: copy one to keep it.
1565
1681
  *
@@ -1567,19 +1683,19 @@ const springProgressOf = (frame: Frame.SpringValues): number => frame.positions[
1567
1683
  * const fade = yield* Machine.animateValues({ opacity: 0, color: "#bf616a" }, { opacity: 1, color: "#a3be8c" }, { duration: 0.3 })
1568
1684
  */
1569
1685
  // One `animate(0, 1, options)` progress drives every key; `done` is its Frame's. Key rules: ADR-0024,
1570
- // ADR-0035. The registry is consulted once: each key resolves to a pure blender; per tick,
1571
- // `keys.length` direct calls.
1686
+ // ADR-0035. The registry is consulted once: each key resolves to a pure blender, or, a pair of numbers
1687
+ // core's number blend takes, to its ends (#1036); per tick, a direct call for each key but those.
1572
1688
  export const animateValues = (
1573
1689
  from: Readonly<Values.Values>,
1574
1690
  to: Readonly<Values.Values>,
1575
1691
  options: AnimateOptions = NO_OPTIONS,
1576
1692
  ): Effect.Effect<Machine<Frame.Frame<Values.Values>>, never, InterpolatorRegistry.InterpolatorRegistry> =>
1577
1693
  // Per leg (#460): the combinators called data-first.
1578
- Effect.map(blendersFor(from, to), (blenders) =>
1694
+ Effect.map(keyLanesFor(from, to), (keyed) =>
1579
1695
  withSpan(
1580
- blendedBy(animate(0, 1, options), blenders, tweenProgressOf),
1696
+ blendedBy(animate(0, 1, options), keyed, tweenProgressOf),
1581
1697
  "wardic.animateValues",
1582
- { attributes: { keys: blenders.length } },
1698
+ { attributes: { keys: keyed.keys.length } },
1583
1699
  ))
1584
1700
 
1585
1701
  /**
@@ -1603,40 +1719,40 @@ export const springBlend = (
1603
1719
  options: SpringOptions = NO_OPTIONS,
1604
1720
  ): Effect.Effect<Machine<Frame.Frame<Values.Values>>, never, InterpolatorRegistry.InterpolatorRegistry> =>
1605
1721
  // Per leg (#460): the combinators called data-first.
1606
- Effect.map(blendersFor(from, to), (blenders) =>
1722
+ Effect.map(keyLanesFor(from, to), (keyed) =>
1607
1723
  withSpan(
1608
1724
  // Its one key read by index (#663).
1609
- blendedBy(springValues({ progress: 100 }, options, { from: { progress: 0 }, velocity: { progress: 0 }, records: "value" }), blenders, springProgressOf),
1725
+ blendedBy(springValues({ progress: 100 }, options, { from: { progress: 0 }, velocity: { progress: 0 }, records: "value" }), keyed, springProgressOf),
1610
1726
  "wardic.springBlend",
1611
- { attributes: { keys: blenders.length } },
1727
+ { attributes: { keys: keyed.keys.length } },
1612
1728
  ))
1613
1729
 
1614
1730
  /**
1615
- * One key's keyframes in a bag (#429): its stops' times in a pass, and a blender for each Interval,
1616
- * read from first to last (`forward`) and, when a pass can read them from last to first, that way
1617
- * too (`backward`), as Motion's mirrored generator builds its own.
1731
+ * One key's keyframes in a bag (#429): its stops' times in a pass, and each Interval's plan, laid out,
1732
+ * read from first to last (`forward`, `forwardEnds`) and, when a pass can read them from last to first,
1733
+ * that way too (`backward`, `backwardEnds`), as Motion's mirrored generator builds its own.
1618
1734
  */
1735
+ // #1036: each direction's lanes flat on the Track, read in one step a frame. Read through a `Lanes` record,
1736
+ // keyframes with no `Lerp` (an app's number kind registered ahead) ran 7% slower a frame in Bun.
1619
1737
  interface Track {
1620
1738
  readonly key: string
1621
1739
  readonly stopTimes: ReadonlyArray<number>
1622
- readonly forward: ReadonlyArray<Blender>
1623
- readonly backward: ReadonlyArray<Blender>
1740
+ readonly forward: Lanes["blenders"]
1741
+ readonly forwardEnds: Lanes["ends"]
1742
+ readonly backward: Lanes["blenders"]
1743
+ readonly backwardEnds: Lanes["ends"]
1624
1744
  }
1625
1745
 
1626
- /** No blenders: a Track whose passes never read its stops from last to first. */
1627
- const NO_BLENDERS: ReadonlyArray<Blender> = []
1746
+ /** No lanes: a Track whose passes never read its stops from last to first. */
1747
+ const NO_LANES: Lanes = { blenders: [], ends: [] }
1628
1748
 
1629
- /** `key`'s blender for each Interval through `stops` (two or more). */
1630
- const intervalBlenders = (
1631
- registry: InterpolatorRegistry.InterpolatorRegistry["Service"],
1632
- key: string,
1633
- stops: ReadonlyArray<number | string>,
1634
- ): Effect.Effect<ReadonlyArray<Blender>> =>
1635
- Effect.all(Arr.map(Arr.range(0, stops.length - 2), (i) => blenderFor(registry, key, stops[i], stops[i + 1])))
1749
+ /** `key`'s plan for each Interval through `stops` (two or more), laid out. */
1750
+ const intervalLanes = (plan: Planner, key: string, stops: ReadonlyArray<number | string>): Effect.Effect<Lanes> =>
1751
+ Effect.map(Effect.all(Arr.map(Arr.range(0, stops.length - 2), (i) => plan(key, stops[i], stops[i + 1]))), lanesOf)
1636
1752
 
1637
1753
  /** `key`'s Track through `given` in a pass of `duration` seconds, its stops at `times` when there's one each. */
1638
1754
  const trackFor = (
1639
- registry: InterpolatorRegistry.InterpolatorRegistry["Service"],
1755
+ plan: Planner,
1640
1756
  key: string,
1641
1757
  given: Arr.NonEmptyReadonlyArray<number | string>,
1642
1758
  times: ReadonlyArray<number> | undefined,
@@ -1645,9 +1761,16 @@ const trackFor = (
1645
1761
  ): Effect.Effect<Track> => {
1646
1762
  const stops = stopsOf(given, given[0])
1647
1763
  return Effect.all({
1648
- forward: intervalBlenders(registry, key, stops),
1649
- backward: Bool.match(flips, { onTrue: () => intervalBlenders(registry, key, Arr.reverse(stops)), onFalse: () => Effect.succeed(NO_BLENDERS) }),
1650
- }).pipe(Effect.map(({ forward, backward }): Track => ({ key, stopTimes: stopTimesOf(stops.length, times, duration), forward, backward })))
1764
+ forward: intervalLanes(plan, key, stops),
1765
+ backward: Bool.match(flips, { onTrue: () => intervalLanes(plan, key, Arr.reverse(stops)), onFalse: () => Effect.succeed(NO_LANES) }),
1766
+ }).pipe(Effect.map(({ forward, backward }): Track => ({
1767
+ key,
1768
+ stopTimes: stopTimesOf(stops.length, times, duration),
1769
+ forward: forward.blenders,
1770
+ forwardEnds: forward.ends,
1771
+ backward: backward.blenders,
1772
+ backwardEnds: backward.ends,
1773
+ })))
1651
1774
  }
1652
1775
 
1653
1776
  /**
@@ -1655,7 +1778,8 @@ const trackFor = (
1655
1778
  * blends it, as `animateValues`' are. One run drives every key: its `duration`, `ease` (one, or one per
1656
1779
  * stretch) and repeats are the bag's. Each key has its own stops, at their places in `times` when there's
1657
1780
  * one per stop, evenly spaced otherwise. A key with one stop holds it, and one with none is left out.
1658
- * Building it needs the `InterpolatorRegistry`, once.
1781
+ * Building it needs the `InterpolatorRegistry`, once. Its Frame and its record are the run's, rewritten
1782
+ * every tick: copy one to keep it.
1659
1783
  */
1660
1784
  // #429. An Interval blends as a pair does: a Discrete pair switches at its first Frame past 0, and a Key
1661
1785
  // rule that holds a key until the run's last Frame (`@wardic/dom`'s for a key that hides an element) sees only the
@@ -1668,36 +1792,50 @@ export const keyframesValues: (
1668
1792
  function* (stops: Readonly<Record<string, ReadonlyArray<number | string>>>, options: KeyframesOptions = NO_OPTIONS) {
1669
1793
  const resolved = resolveKeyframes(options)
1670
1794
  const { run, eases, reverse } = resolved
1671
- const registry = yield* InterpolatorRegistry.InterpolatorRegistry
1795
+ const plan = yield* planner
1672
1796
  const flips = Bool.or(reverse, run.mirrors)
1673
1797
  const duration = run.tween.duration
1674
1798
  const tracks = yield* Effect.all(
1675
1799
  Arr.filterMap(Rec.toEntries(stops), ([key, given]) =>
1676
1800
  Arr.match(given, {
1677
1801
  onEmpty: () => Result.failVoid,
1678
- onNonEmpty: (some) => Result.succeed(trackFor(registry, key, some, resolved.times, duration, flips)),
1802
+ onNonEmpty: (some) => Result.succeed(trackFor(plan, key, some, resolved.times, duration, flips)),
1679
1803
  })),
1680
1804
  )
1681
1805
  const machine = make({
1682
1806
  settles: Number.isFinite(resolved.repeat),
1683
1807
  span: { name: "wardic.keyframesValues", attributes: {} },
1684
1808
  start: () => {
1685
- let elapsed = 0
1809
+ // Its time on a field, which V8 rewrites where it is: a closure's `let` boxed each frame's number (#1031).
1810
+ const state = initTween()
1686
1811
  const pass: Pass = { within: 0, reversed: false, flipped: false }
1812
+ // In place (#1031): its record and its Frame are its run's, rewritten each tick, as `blendedBy`'s are.
1813
+ const frame: WritableFrame<Record<string, number | string>> = { value: seededRecordOf(tracks, trackKey), done: false }
1687
1814
  // Per frame (ADR-0025): one time, `dt` clamped (#78); a loop over the Tracks built with the machine.
1688
1815
  return (dt): Frame.Frame<Values.Values> => {
1689
- elapsed += Math.min(dt, MAX_DT)
1816
+ const elapsed = state.elapsed + Math.min(dt, MAX_DT)
1817
+ state.elapsed = elapsed
1690
1818
  const done = passAt(elapsed, run, reverse, pass)
1691
1819
  const time = timeIn(pass, duration)
1692
- const value: Record<string, number | string> = {}
1820
+ const value = frame.value
1693
1821
  for (const track of tracks) {
1694
1822
  const i = intervalAt(time, track.stopTimes)
1695
1823
  const eased = eases[i % eases.length](intervalProgress(time, track.stopTimes, i))
1696
1824
  let blenders = track.forward
1697
1825
  if (pass.flipped) blenders = track.backward
1698
- value[track.key] = blenders[i](eased, done)
1826
+ // A `Lerp` through `Scalar.lerp`, as `blendedBy`'s loop computes one (#1036). Its ends are read
1827
+ // only for a `Lerp`: read for every Interval, a bag of string keys ran 5–6% slower a frame in Bun.
1828
+ const blend = blenders[i]
1829
+ if (Predicate.isNull(blend)) {
1830
+ let ends = track.forwardEnds
1831
+ if (pass.flipped) ends = track.backwardEnds
1832
+ value[track.key] = Scalar.lerp(ends[2 * i], ends[2 * i + 1], eased)
1833
+ continue
1834
+ }
1835
+ value[track.key] = blend(eased, done)
1699
1836
  }
1700
- return { value, done }
1837
+ frame.done = done
1838
+ return frame
1701
1839
  }
1702
1840
  },
1703
1841
  })
package/src/Playback.ts CHANGED
@@ -149,7 +149,11 @@ export const drive: {
149
149
  return held
150
150
  }
151
151
  held = undefined
152
- const by = tickOf(head, dt, Machine.MAX_DT)
152
+ // At speed 1 within the clamp, the frame's own `dt` (#1031): a number made here is boxed again as it's
153
+ // passed to a step V8 hasn't inlined, 16 B a run a frame, and whether it's inlined turns on when its
154
+ // optimised code was compiled. `tickOf` gives that same number.
155
+ let by = dt
156
+ if (head.speed !== 1 || dt > Machine.MAX_DT) by = tickOf(head, dt, Machine.MAX_DT)
153
157
  if (by >= 0) {
154
158
  own.time += by
155
159
  writable.time = own.time
package/src/Projection.ts CHANGED
@@ -48,7 +48,7 @@ export interface Delta {
48
48
 
49
49
  /**
50
50
  * The key a projection pass writes each node's `Value` under, each frame, for its Environment's renderer
51
- * to draw as one transform with the element's own rotation and skew. Namespaced, `@projection`, so it
51
+ * to draw as one transform with the Subject's own rotation and skew. Namespaced, `@projection`, so it
52
52
  * never collides with an animated key.
53
53
  */
54
54
  // ADR-0009. `@wardic/dom`'s renderer's `project()` reads it in place of its normal transform grouping.
@@ -69,27 +69,27 @@ export interface Value {
69
69
  /** Its ancestors' scale, multiplied together. */
70
70
  readonly treeScale: Point.Point
71
71
  /**
72
- * A twin's Crossfade, from 0 to 1: the element's own opacity is multiplied by it. The lead
72
+ * A twin's Crossfade, from 0 to 1: the Subject's own opacity is multiplied by it. The lead
73
73
  * fades in, the followers fade out. Absent for a plain layout node, so its own opacity shows.
74
74
  */
75
75
  // ADR-0010.
76
76
  readonly opacity?: number
77
77
  /**
78
- * A handover's blended opacity, from 0 to 1: drawn as the element's opacity in place of its own and of
79
- * any crossfade, from the leaving element's opacity to its own over the handover. Absent otherwise.
78
+ * A handover's blended opacity, from 0 to 1: drawn as the Subject's opacity in place of its own and of
79
+ * any crossfade, from the leaving Subject's opacity to its own over the handover. Absent otherwise.
80
80
  */
81
81
  // A Switch's (ADR-0010, *Amendment (#166)*).
82
82
  readonly blendOpacity?: number
83
83
  /**
84
- * A handover's blended rotation, in degrees: drawn in place of the element's own `rotate`, from its
84
+ * A handover's blended rotation, in degrees: drawn in place of the Subject's own `rotate`, from its
85
85
  * twin's to its own over the handover. A follower is drawn with its lead's. Absent otherwise, so the
86
- * element's own `rotate` shows.
86
+ * Subject's own `rotate` shows.
87
87
  */
88
88
  // ADR-0010, *Amendment (#166)*.
89
89
  readonly rotate?: number
90
90
  /**
91
91
  * A raise above its siblings: while it's set, the renderer draws the node above them, as a dragged
92
- * Reorder item is while it's off its place. Absent at rest, so the element's own stacking shows.
92
+ * Reorder item is while it's off its place. Absent at rest, so the Subject's own stacking shows.
93
93
  */
94
94
  // ADR-0016, *Amendment (Reorder)*: Motion's Reorder item, `zIndex: 1`; `@wardic/dom` writes it as
95
95
  // `z-index`.
@@ -97,7 +97,7 @@ export interface Value {
97
97
  /**
98
98
  * Set on a follower: pointer input passes through it to what's beneath, so a follower drawn on its
99
99
  * lead's box never takes the lead's input, fading out or hidden at rest, as Motion's. How a renderer
100
- * lets it through is its Environment's. Absent on a lead, so the element's own value shows.
100
+ * lets it through is its Environment's. Absent on a lead, so the Subject's own value shows.
101
101
  */
102
102
  // ADR-0010, *Amendment (#165)*; `@wardic/dom`'s renderer.
103
103
  readonly passesPointer?: true
@@ -107,7 +107,7 @@ export interface Value {
107
107
  const REST_AXIS: AxisDelta = { translate: 0, scale: 1, origin: 0.5, originPoint: 0 }
108
108
 
109
109
  /**
110
- * A node drawn at its own box: no delta, no ancestors' scale. The renderer draws it with the element's
110
+ * A node drawn at its own box: no delta, no ancestors' scale. The renderer draws it with the Subject's
111
111
  * own rotation, skew and scale, and leaves its own move out, as it draws a layout node at rest. What a
112
112
  * server, which measures nothing, draws a layout node's starting style and mount animation with.
113
113
  */