@pibbl/core 0.0.1 → 0.0.3-alpha.85.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 (374) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.txt +81 -0
  3. package/dist/features/machines/animation.d.ts +64 -0
  4. package/dist/features/machines/animation.js +55 -0
  5. package/dist/features/machines/animation.js.map +7 -0
  6. package/dist/features/machines/animation.mjs +1 -0
  7. package/dist/features/machines/assign.d.ts +16 -0
  8. package/dist/features/machines/assign.js +15 -0
  9. package/dist/features/machines/assign.js.map +7 -0
  10. package/dist/features/machines/callback.d.ts +9 -0
  11. package/dist/features/machines/callback.js +7 -0
  12. package/dist/features/machines/callback.js.map +7 -0
  13. package/dist/features/machines/hook.d.ts +30 -0
  14. package/dist/features/machines/hook.js +37 -0
  15. package/dist/features/machines/hook.js.map +7 -0
  16. package/dist/features/machines/index.d.ts +6 -0
  17. package/dist/features/machines/index.js +12 -0
  18. package/dist/features/machines/index.js.map +7 -0
  19. package/dist/features/machines/index.mjs +1 -0
  20. package/dist/features/machines/runtime.d.ts +18 -0
  21. package/dist/features/machines/runtime.js +363 -0
  22. package/dist/features/machines/runtime.js.map +7 -0
  23. package/dist/features/machines/types.d.ts +164 -0
  24. package/dist/features/physics/2d-geometry.d.ts +3 -3
  25. package/dist/features/physics/2d-geometry.js.map +1 -1
  26. package/dist/features/physics/2d.d.ts +115 -62
  27. package/dist/features/physics/2d.js +59 -28
  28. package/dist/features/physics/2d.js.map +2 -2
  29. package/dist/features/physics/lib/2d/query-types.d.ts +6 -0
  30. package/dist/features/physics/lib/2d/runtime/controller.d.ts +7 -6
  31. package/dist/features/physics/lib/2d/runtime/controller.js.map +2 -2
  32. package/dist/features/physics/lib/2d/types.d.ts +8 -30
  33. package/dist/features/physics/lib/2d/world/queries.d.ts +7 -6
  34. package/dist/features/physics/lib/2d/world/queries.js.map +2 -2
  35. package/dist/features/sprites/formats/aseprite.d.ts +5 -0
  36. package/dist/features/sprites/formats/texture-packer.d.ts +5 -0
  37. package/dist/features/sprites/index.d.ts +6 -0
  38. package/dist/features/sprites/loader.d.ts +25 -0
  39. package/dist/features/sprites/model.d.ts +75 -0
  40. package/dist/features/sprites/sprite.d.ts +22 -0
  41. package/dist/features/textures/index.d.ts +12 -2
  42. package/dist/features/textures/index.js +33 -1
  43. package/dist/features/textures/index.js.map +2 -2
  44. package/dist/features/textures/lib/chemical-field.d.ts +56 -0
  45. package/dist/features/textures/lib/chemical-field.js +154 -0
  46. package/dist/features/textures/lib/chemical-field.js.map +7 -0
  47. package/dist/features/textures/lib/chemical-recipes.d.ts +119 -0
  48. package/dist/features/textures/lib/chemical-recipes.js +275 -0
  49. package/dist/features/textures/lib/chemical-recipes.js.map +7 -0
  50. package/dist/features/textures/lib/definitions.d.ts +3 -18
  51. package/dist/features/textures/lib/definitions.js +15 -20
  52. package/dist/features/textures/lib/definitions.js.map +2 -2
  53. package/dist/features/textures/lib/geometric-patterns.d.ts +149 -0
  54. package/dist/features/textures/lib/geometric-patterns.js +305 -0
  55. package/dist/features/textures/lib/geometric-patterns.js.map +7 -0
  56. package/dist/features/textures/lib/gray-scott.d.ts +55 -0
  57. package/dist/features/textures/lib/gray-scott.js +39 -0
  58. package/dist/features/textures/lib/gray-scott.js.map +7 -0
  59. package/dist/features/textures/lib/patterns.d.ts +123 -0
  60. package/dist/features/textures/lib/patterns.js +344 -0
  61. package/dist/features/textures/lib/patterns.js.map +7 -0
  62. package/dist/features/textures/lib/reaction-diffusion.d.ts +3 -2
  63. package/dist/features/textures/lib/reaction-diffusion.js +9 -20
  64. package/dist/features/textures/lib/reaction-diffusion.js.map +2 -2
  65. package/dist/features/textures/lib/simulation.d.ts +10 -4
  66. package/dist/features/textures/lib/simulation.js +23 -13
  67. package/dist/features/textures/lib/simulation.js.map +2 -2
  68. package/dist/features/viz/index.d.ts +79 -5
  69. package/dist/features/viz/index.js +145 -4
  70. package/dist/features/viz/index.js.map +2 -2
  71. package/dist/features/viz/inspection/bar.d.ts +79 -0
  72. package/dist/features/viz/inspection/bar.js +49 -0
  73. package/dist/features/viz/inspection/bar.js.map +7 -0
  74. package/dist/features/viz/inspection/candle.d.ts +156 -0
  75. package/dist/features/viz/inspection/candle.js +120 -0
  76. package/dist/features/viz/inspection/candle.js.map +7 -0
  77. package/dist/features/viz/inspection/capture-types.d.ts +65 -0
  78. package/dist/features/viz/inspection/capture.d.ts +16 -0
  79. package/dist/features/viz/inspection/capture.js +49 -0
  80. package/dist/features/viz/inspection/capture.js.map +7 -0
  81. package/dist/features/viz/inspection/handler.d.ts +36 -0
  82. package/dist/features/viz/inspection/handler.js +91 -0
  83. package/dist/features/viz/inspection/handler.js.map +7 -0
  84. package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
  85. package/dist/features/viz/inspection/ohlc-bar.js +118 -0
  86. package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
  87. package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
  88. package/dist/features/viz/inspection/owned-ref.js +99 -0
  89. package/dist/features/viz/inspection/owned-ref.js.map +7 -0
  90. package/dist/features/viz/inspection/painted-point.d.ts +22 -0
  91. package/dist/features/viz/inspection/painted-point.js +29 -0
  92. package/dist/features/viz/inspection/painted-point.js.map +7 -0
  93. package/dist/features/viz/inspection/queries.d.ts +100 -0
  94. package/dist/features/viz/inspection/queries.js +192 -0
  95. package/dist/features/viz/inspection/queries.js.map +7 -0
  96. package/dist/features/viz/inspection/query-types.d.ts +177 -0
  97. package/dist/features/viz/inspection/volume.d.ts +104 -0
  98. package/dist/features/viz/inspection/volume.js +95 -0
  99. package/dist/features/viz/inspection/volume.js.map +7 -0
  100. package/dist/features/viz/inspection.d.ts +19 -0
  101. package/dist/features/viz/inspection.js +54 -0
  102. package/dist/features/viz/inspection.js.map +7 -0
  103. package/dist/features/viz/inspection.mjs +1 -0
  104. package/dist/features/viz/lib/area-series.d.ts +62 -0
  105. package/dist/features/viz/lib/area-series.js +120 -0
  106. package/dist/features/viz/lib/area-series.js.map +7 -0
  107. package/dist/features/viz/lib/axis-labels.d.ts +2 -0
  108. package/dist/features/viz/lib/axis-labels.js +41 -0
  109. package/dist/features/viz/lib/axis-labels.js.map +7 -0
  110. package/dist/features/viz/lib/axis-title.d.ts +23 -0
  111. package/dist/features/viz/lib/axis-title.js +23 -0
  112. package/dist/features/viz/lib/axis-title.js.map +7 -0
  113. package/dist/features/viz/lib/axis.d.ts +1 -1
  114. package/dist/features/viz/lib/axis.js +50 -50
  115. package/dist/features/viz/lib/axis.js.map +2 -2
  116. package/dist/features/viz/lib/bar-scale.d.ts +7 -0
  117. package/dist/features/viz/lib/bar-scale.js +34 -0
  118. package/dist/features/viz/lib/bar-scale.js.map +7 -0
  119. package/dist/features/viz/lib/bar-series.d.ts +3 -1
  120. package/dist/features/viz/lib/bar-series.js +21 -5
  121. package/dist/features/viz/lib/bar-series.js.map +2 -2
  122. package/dist/features/viz/lib/baseline-series.d.ts +55 -0
  123. package/dist/features/viz/lib/baseline-series.js +136 -0
  124. package/dist/features/viz/lib/baseline-series.js.map +7 -0
  125. package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
  126. package/dist/features/viz/lib/candlestick-series.js +150 -0
  127. package/dist/features/viz/lib/candlestick-series.js.map +7 -0
  128. package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
  129. package/dist/features/viz/lib/censored-point-series.js +129 -0
  130. package/dist/features/viz/lib/censored-point-series.js.map +7 -0
  131. package/dist/features/viz/lib/chart-lines.d.ts +41 -0
  132. package/dist/features/viz/lib/chart-lines.js +32 -0
  133. package/dist/features/viz/lib/chart-lines.js.map +7 -0
  134. package/dist/features/viz/lib/color-context.d.ts +4 -0
  135. package/dist/features/viz/lib/color-context.js +41 -0
  136. package/dist/features/viz/lib/color-context.js.map +7 -0
  137. package/dist/features/viz/lib/color-math.d.ts +4 -0
  138. package/dist/features/viz/lib/color-math.js +31 -0
  139. package/dist/features/viz/lib/color-math.js.map +7 -0
  140. package/dist/features/viz/lib/color-types.d.ts +53 -0
  141. package/dist/features/viz/lib/curve-definition.d.ts +49 -0
  142. package/dist/features/viz/lib/curve-definition.js +148 -0
  143. package/dist/features/viz/lib/curve-definition.js.map +7 -0
  144. package/dist/features/viz/lib/diverging-color-scale.d.ts +11 -0
  145. package/dist/features/viz/lib/diverging-color-scale.js +51 -0
  146. package/dist/features/viz/lib/diverging-color-scale.js.map +7 -0
  147. package/dist/features/viz/lib/domain-navigation.d.ts +40 -0
  148. package/dist/features/viz/lib/domain-navigation.js +77 -0
  149. package/dist/features/viz/lib/domain-navigation.js.map +7 -0
  150. package/dist/features/viz/lib/editable-chart-elements.d.ts +178 -0
  151. package/dist/features/viz/lib/editable-chart-elements.js +733 -0
  152. package/dist/features/viz/lib/editable-chart-elements.js.map +7 -0
  153. package/dist/features/viz/lib/financial-aggregation.d.ts +127 -0
  154. package/dist/features/viz/lib/financial-aggregation.js +116 -0
  155. package/dist/features/viz/lib/financial-aggregation.js.map +7 -0
  156. package/dist/features/viz/lib/financial-autoscale.d.ts +64 -0
  157. package/dist/features/viz/lib/financial-autoscale.js +61 -0
  158. package/dist/features/viz/lib/financial-autoscale.js.map +7 -0
  159. package/dist/features/viz/lib/financial-comparison.d.ts +62 -0
  160. package/dist/features/viz/lib/financial-comparison.js +98 -0
  161. package/dist/features/viz/lib/financial-comparison.js.map +7 -0
  162. package/dist/features/viz/lib/financial-geometry.d.ts +77 -0
  163. package/dist/features/viz/lib/financial-geometry.js +67 -0
  164. package/dist/features/viz/lib/financial-geometry.js.map +7 -0
  165. package/dist/features/viz/lib/financial-indicators.d.ts +114 -0
  166. package/dist/features/viz/lib/financial-indicators.js +135 -0
  167. package/dist/features/viz/lib/financial-indicators.js.map +7 -0
  168. package/dist/features/viz/lib/financial-oscillators.d.ts +171 -0
  169. package/dist/features/viz/lib/financial-oscillators.js +265 -0
  170. package/dist/features/viz/lib/financial-oscillators.js.map +7 -0
  171. package/dist/features/viz/lib/hover-data.d.ts +1 -1
  172. package/dist/features/viz/lib/hover-data.js +6 -3
  173. package/dist/features/viz/lib/hover-data.js.map +2 -2
  174. package/dist/features/viz/lib/hover-types.d.ts +5 -5
  175. package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
  176. package/dist/features/viz/lib/interval-band-series.js +136 -0
  177. package/dist/features/viz/lib/interval-band-series.js.map +7 -0
  178. package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
  179. package/dist/features/viz/lib/interval-diamond-series.js +124 -0
  180. package/dist/features/viz/lib/interval-diamond-series.js.map +7 -0
  181. package/dist/features/viz/lib/interval-series.d.ts +79 -0
  182. package/dist/features/viz/lib/interval-series.js +158 -0
  183. package/dist/features/viz/lib/interval-series.js.map +7 -0
  184. package/dist/features/viz/lib/line-series.d.ts +1 -1
  185. package/dist/features/viz/lib/line-series.js +47 -28
  186. package/dist/features/viz/lib/line-series.js.map +2 -2
  187. package/dist/features/viz/lib/linear-scale-component.d.ts +7 -0
  188. package/dist/features/viz/lib/linear-scale-component.js +18 -0
  189. package/dist/features/viz/lib/linear-scale-component.js.map +7 -0
  190. package/dist/features/viz/lib/linear-scale.js +1 -1
  191. package/dist/features/viz/lib/linear-scale.js.map +2 -2
  192. package/dist/features/viz/lib/log-scale-component.d.ts +7 -0
  193. package/dist/features/viz/lib/log-scale-component.js +19 -0
  194. package/dist/features/viz/lib/log-scale-component.js.map +7 -0
  195. package/dist/features/viz/lib/log-scale.d.ts +2 -0
  196. package/dist/features/viz/lib/log-scale.js +53 -0
  197. package/dist/features/viz/lib/log-scale.js.map +7 -0
  198. package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
  199. package/dist/features/viz/lib/monotone-curve.js +63 -0
  200. package/dist/features/viz/lib/monotone-curve.js.map +7 -0
  201. package/dist/features/viz/lib/nearest.d.ts +9 -9
  202. package/dist/features/viz/lib/nearest.js.map +1 -1
  203. package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
  204. package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
  205. package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
  206. package/dist/features/viz/lib/numeric-ticks.d.ts +38 -0
  207. package/dist/features/viz/lib/numeric-ticks.js +54 -0
  208. package/dist/features/viz/lib/numeric-ticks.js.map +7 -0
  209. package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
  210. package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
  211. package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
  212. package/dist/features/viz/lib/paired-series.d.ts +44 -0
  213. package/dist/features/viz/lib/paired-series.js +93 -0
  214. package/dist/features/viz/lib/paired-series.js.map +7 -0
  215. package/dist/features/viz/lib/plot-series.js +11 -6
  216. package/dist/features/viz/lib/plot-series.js.map +2 -2
  217. package/dist/features/viz/lib/plot-types.d.ts +4 -3
  218. package/dist/features/viz/lib/point-scale-component.d.ts +7 -0
  219. package/dist/features/viz/lib/point-scale-component.js +19 -0
  220. package/dist/features/viz/lib/point-scale-component.js.map +7 -0
  221. package/dist/features/viz/lib/point-scale.d.ts +2 -0
  222. package/dist/features/viz/lib/point-scale.js +45 -0
  223. package/dist/features/viz/lib/point-scale.js.map +7 -0
  224. package/dist/features/viz/lib/point-series.d.ts +1 -1
  225. package/dist/features/viz/lib/point-series.js +36 -9
  226. package/dist/features/viz/lib/point-series.js.map +2 -2
  227. package/dist/features/viz/lib/point-types.d.ts +5 -2
  228. package/dist/features/viz/lib/reference-band.d.ts +16 -0
  229. package/dist/features/viz/lib/reference-band.js +27 -0
  230. package/dist/features/viz/lib/reference-band.js.map +7 -0
  231. package/dist/features/viz/lib/scale-adjust.js +9 -4
  232. package/dist/features/viz/lib/scale-adjust.js.map +2 -2
  233. package/dist/features/viz/lib/scale-context.d.ts +5 -4
  234. package/dist/features/viz/lib/scale-context.js +15 -11
  235. package/dist/features/viz/lib/scale-context.js.map +2 -2
  236. package/dist/features/viz/lib/scale-provider.d.ts +2 -0
  237. package/dist/features/viz/lib/scale-provider.js +13 -0
  238. package/dist/features/viz/lib/scale-provider.js.map +7 -0
  239. package/dist/features/viz/lib/scale-ticks.d.ts +5 -0
  240. package/dist/features/viz/lib/scale-ticks.js +64 -0
  241. package/dist/features/viz/lib/scale-ticks.js.map +7 -0
  242. package/dist/features/viz/lib/scale-view.d.ts +4 -0
  243. package/dist/features/viz/lib/scale-view.js +21 -0
  244. package/dist/features/viz/lib/scale-view.js.map +7 -0
  245. package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
  246. package/dist/features/viz/lib/sequential-color-scale.js +49 -0
  247. package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
  248. package/dist/features/viz/lib/series-position.d.ts +12 -0
  249. package/dist/features/viz/lib/series-position.js +44 -0
  250. package/dist/features/viz/lib/series-position.js.map +7 -0
  251. package/dist/features/viz/lib/step-curves.d.ts +19 -0
  252. package/dist/features/viz/lib/step-curves.js +53 -0
  253. package/dist/features/viz/lib/step-curves.js.map +7 -0
  254. package/dist/features/viz/lib/symlog-scale-component.d.ts +7 -0
  255. package/dist/features/viz/lib/symlog-scale-component.js +19 -0
  256. package/dist/features/viz/lib/symlog-scale-component.js.map +7 -0
  257. package/dist/features/viz/lib/symlog-scale.d.ts +2 -0
  258. package/dist/features/viz/lib/symlog-scale.js +38 -0
  259. package/dist/features/viz/lib/symlog-scale.js.map +7 -0
  260. package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
  261. package/dist/features/viz/lib/threshold-color-scale.js +59 -0
  262. package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
  263. package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
  264. package/dist/features/viz/lib/trading-time-mapping.js +89 -0
  265. package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
  266. package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
  267. package/dist/features/viz/lib/trading-time-scale.js +96 -0
  268. package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
  269. package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
  270. package/dist/features/viz/lib/trajectory-series.js +111 -0
  271. package/dist/features/viz/lib/trajectory-series.js.map +7 -0
  272. package/dist/features/viz/lib/types.d.ts +114 -21
  273. package/dist/features/viz/lib/use-bar-scale.d.ts +8 -0
  274. package/dist/features/viz/lib/use-bar-scale.js +9 -0
  275. package/dist/features/viz/lib/use-bar-scale.js.map +7 -0
  276. package/dist/features/viz/lib/use-continuous-scale.d.ts +8 -0
  277. package/dist/features/viz/lib/use-continuous-scale.js +14 -0
  278. package/dist/features/viz/lib/use-continuous-scale.js.map +7 -0
  279. package/dist/features/viz/lib/use-linear-scale.d.ts +8 -0
  280. package/dist/features/viz/lib/use-linear-scale.js +9 -0
  281. package/dist/features/viz/lib/use-linear-scale.js.map +7 -0
  282. package/dist/features/viz/lib/use-log-scale.d.ts +8 -0
  283. package/dist/features/viz/lib/use-log-scale.js +9 -0
  284. package/dist/features/viz/lib/use-log-scale.js.map +7 -0
  285. package/dist/features/viz/lib/use-point-scale.d.ts +8 -0
  286. package/dist/features/viz/lib/use-point-scale.js +9 -0
  287. package/dist/features/viz/lib/use-point-scale.js.map +7 -0
  288. package/dist/features/viz/lib/use-symlog-scale.d.ts +8 -0
  289. package/dist/features/viz/lib/use-symlog-scale.js +9 -0
  290. package/dist/features/viz/lib/use-symlog-scale.js.map +7 -0
  291. package/dist/features/viz/lib/use-utc-scale.d.ts +8 -0
  292. package/dist/features/viz/lib/use-utc-scale.js +9 -0
  293. package/dist/features/viz/lib/use-utc-scale.js.map +7 -0
  294. package/dist/features/viz/lib/utc-labels.d.ts +12 -0
  295. package/dist/features/viz/lib/utc-labels.js +27 -0
  296. package/dist/features/viz/lib/utc-labels.js.map +7 -0
  297. package/dist/features/viz/lib/utc-scale-component.d.ts +7 -0
  298. package/dist/features/viz/lib/utc-scale-component.js +18 -0
  299. package/dist/features/viz/lib/utc-scale-component.js.map +7 -0
  300. package/dist/features/viz/lib/utc-scale.d.ts +21 -0
  301. package/dist/features/viz/lib/utc-scale.js +123 -0
  302. package/dist/features/viz/lib/utc-scale.js.map +7 -0
  303. package/dist/features/viz/lib/volume-series.d.ts +59 -0
  304. package/dist/features/viz/lib/volume-series.js +117 -0
  305. package/dist/features/viz/lib/volume-series.js.map +7 -0
  306. package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
  307. package/dist/features/viz/lib/weighted-point-series.js +169 -0
  308. package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
  309. package/dist/filters/emboss-gpu.d.ts +4 -0
  310. package/dist/filters/emboss-gpu.js +39 -0
  311. package/dist/filters/emboss-gpu.js.map +7 -0
  312. package/dist/filters/emboss.d.ts +32 -0
  313. package/dist/filters/emboss.js +106 -0
  314. package/dist/filters/emboss.js.map +7 -0
  315. package/dist/filters/reflection-gpu.d.ts +3 -1
  316. package/dist/filters/reflection-gpu.js +5 -2
  317. package/dist/filters/reflection-gpu.js.map +2 -2
  318. package/dist/filters/render-emboss-boundary.d.ts +13 -0
  319. package/dist/filters/render-emboss-boundary.js +131 -0
  320. package/dist/filters/render-emboss-boundary.js.map +7 -0
  321. package/dist/filters.d.ts +2 -0
  322. package/dist/filters.js +2 -0
  323. package/dist/filters.js.map +2 -2
  324. package/dist/index.d.ts +3 -1
  325. package/dist/index.js +3 -0
  326. package/dist/index.js.map +2 -2
  327. package/dist/internal.d.ts +2 -0
  328. package/dist/internal.js +4 -0
  329. package/dist/internal.js.map +2 -2
  330. package/dist/lib/animation/definition.d.ts +5 -3
  331. package/dist/lib/animation/definition.js +29 -4
  332. package/dist/lib/animation/definition.js.map +2 -2
  333. package/dist/lib/animation/playback.d.ts +8 -0
  334. package/dist/lib/animation/playback.js +33 -11
  335. package/dist/lib/animation/playback.js.map +2 -2
  336. package/dist/lib/animation/spring.d.ts +3 -1
  337. package/dist/lib/animation/spring.js.map +2 -2
  338. package/dist/lib/animation/types.d.ts +29 -73
  339. package/dist/lib/events/event-facade.d.ts +13 -0
  340. package/dist/lib/events/event-facade.js +23 -0
  341. package/dist/lib/events/event-facade.js.map +2 -2
  342. package/dist/lib/events/propagation.js +19 -14
  343. package/dist/lib/events/propagation.js.map +2 -2
  344. package/dist/lib/execute-render.js +13 -0
  345. package/dist/lib/execute-render.js.map +2 -2
  346. package/dist/lib/hooks/use-animated-value.d.ts +11 -21
  347. package/dist/lib/hooks/use-animated-value.js +23 -70
  348. package/dist/lib/hooks/use-animated-value.js.map +3 -3
  349. package/dist/lib/hooks/use-playback.js +1 -0
  350. package/dist/lib/hooks/use-playback.js.map +2 -2
  351. package/dist/lib/recording/recording.d.ts +43 -0
  352. package/dist/lib/recording/recording.js +555 -0
  353. package/dist/lib/recording/recording.js.map +7 -0
  354. package/dist/lib/recording/types.d.ts +118 -0
  355. package/dist/lib/recording/wasm-bytes.d.ts +1 -0
  356. package/dist/lib/recording/wasm-bytes.js +5 -0
  357. package/dist/lib/recording/wasm-bytes.js.map +7 -0
  358. package/dist/lib/recording/worker-source.d.ts +1 -0
  359. package/dist/lib/recording/worker-source.js +5 -0
  360. package/dist/lib/recording/worker-source.js.map +7 -0
  361. package/dist/lib/render-transaction.d.ts +5 -2
  362. package/dist/lib/render-transaction.js +23 -1
  363. package/dist/lib/render-transaction.js.map +2 -2
  364. package/dist/lib/series-inspection-frame.d.ts +18 -0
  365. package/dist/lib/series-inspection-frame.js +70 -0
  366. package/dist/lib/series-inspection-frame.js.map +7 -0
  367. package/dist/lib/types.d.ts +6 -0
  368. package/package.json +27 -5
  369. package/dist/features/viz/lib/scale.d.ts +0 -11
  370. package/dist/features/viz/lib/scale.js +0 -80
  371. package/dist/features/viz/lib/scale.js.map +0 -7
  372. package/dist/features/viz/lib/use-scale.d.ts +0 -20
  373. package/dist/features/viz/lib/use-scale.js +0 -10
  374. package/dist/features/viz/lib/use-scale.js.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/internal.ts"],
4
- "sourcesContent": ["import type { PibblInternalFrame, pibblInternalOnRenderFinish, pibblInternalRequestRender } from './lib/scheduler/renderer-participant.js';\nimport type { PibblConfig, PibblPixelRatio } from './lib/surface/types.js';\n/**\n * @packageDocumentation\n * Reserved for official Pibbl packages that are released in lockstep with\n * `@pibbl/core`. This version-coupled module is not a stable third-party plugin\n * API and intentionally does not re-export the public root module.\n */\n\nexport { createBackendToken } from \"./lib/backend/types.js\";\nexport type {\n PibblBackendDriver,\n PibblBackendEventTargetOptions,\n PibblBackendFrame,\n PibblBackendFrameInput,\n PibblBackendMount,\n PibblBackendMountOptions,\n PibblBackendPrimitiveDefinition,\n PibblBackendPrimitiveInput,\n PibblBackendPrimitiveProgram,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nexport type { SignalProgramProps, SignalStyle } from \"./lib/types.js\";\nexport {\n pibblInternalRunPurePrimitiveResolver,\n defineBackendPrimitive,\n derivePrimitive,\n} from \"./lib/define-primitive.js\";\nexport { mountBackendPibbl } from \"./lib/mount-pibbl.js\";\nexport {\n useInternalHookSlot,\n withHooksForbidden,\n} from \"./lib/hooks/hook-slot.js\";\nexport { useValueMemoSlot as useInternalValueMemoSlot } from \"./lib/hooks/use-value-memo-slot.js\";\nexport {\n haveSameLayerNodeTree,\n materializeRetainedLayerChildren,\n snapshotLayerNodeTree,\n} from \"./lib/components/layer-node-equality.js\";\nexport type { LayerNodeSnapshot } from \"./lib/components/layer-node-equality.js\";\nexport type { PibblEventTargetRegistration } from \"./lib/events/registrations.js\";\nexport type { PibblElementSource } from \"./lib/element/metadata.js\";\nexport { pibblInternalCreatePropAttachment } from \"./lib/element-enhancers.js\";\nexport type {\n PibblInternalMountedPropAttachment,\n PibblInternalPrimitiveAttachmentInput,\n} from \"./lib/element-enhancers.js\";\nexport type { PibblHitTestOutput } from \"./lib/events/paint-entry.js\";\nexport { hasPibblEventHandler } from \"./lib/events/event-definitions.js\";\nexport {\n pibblInternalCurrentSimulationOwner,\n pibblInternalOnSimulationRenderTransactionFinish,\n pibblInternalQueueSimulationBegin,\n pibblInternalQueueSimulationCommitAcknowledgement,\n pibblInternalQueueSimulationComplete,\n pibblInternalRegisterSimulationAdvance,\n pibblInternalRequestSimulationRender,\n} from \"./lib/scheduler/simulation-participant.js\";\nexport type {\n PibblInternalAdvanceLane,\n PibblInternalSimulationOwner,\n} from \"./lib/scheduler/simulation-participant.js\";\n\nimport type {\n PibblBackendEventTargetOptions,\n PibblBackendMount,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nimport {\n createTarget,\n releaseTarget,\n updateTarget,\n type PibblEventTargetRegistration,\n} from \"./lib/events/registrations.js\";\nimport { PibblPaintEntryKind } from \"./lib/events/paint-entry.js\";\nimport type { PibblEventHandlers, PibblPointerEvents } from \"./lib/events/types.js\";\nimport { getCurrentPibblInstance, GLOBAL_STATE } from \"./lib/global-state.js\";\nimport {\n requireHookContext,\n useInternalHookSlot,\n} from \"./lib/hooks/hook-slot.js\";\nimport { getCurrentWorldTransform } from \"./lib/render-target.js\";\nimport {\n getElementSource,\n type PibblElementSource,\n} from \"./lib/element/metadata.js\";\nimport { getSurfaceSnapshot } from \"./lib/surface/transform.js\";\nimport type {\n Canvas,\n PibblComponentRefs,\n PibblInstance,\n} from \"./lib/types.js\";\nimport type { PibblInteractionLayer } from \"./lib/types.js\";\nimport { update } from \"./lib/update.js\";\nimport { queueBeginCommand } from \"./lib/scheduler/realm-scheduler.js\";\nimport type { PibblBeginCommandHandle } from \"./lib/scheduler/types.js\";\n\ninterface CurrentInstanceFrameRequestState {\n readonly componentRefs: PibblComponentRefs<any>;\n readonly instance: PibblInstance;\n active: boolean;\n handle: PibblBeginCommandHandle | undefined;\n updateParents: boolean;\n}\n\nconst frameRequestsByComponent = new WeakMap<\n PibblComponentRefs<any>,\n CurrentInstanceFrameRequestState\n>();\n/**\n * Reads the selected official backend's current frame environment.\n *\n * @param token - Backend identity required by the caller. See {@link PibblBackendToken}.\n * @returns The active environment for that backend.\n *\n * @see {@link PibblBackendToken}\n */\nexport function getBackendEnvironment<E>(token: PibblBackendToken): E {\n const driver = GLOBAL_STATE.backendDriver;\n const frame = GLOBAL_STATE.backendFrame;\n if (!driver || !frame || driver.token !== token) {\n throw new Error(\"The requested Pibbl backend environment is not active.\");\n }\n return frame.environment as E;\n}\n\n/**\n * Returns the timestamp shared by the current Pibbl render transaction.\n *\n * @returns The active frame timestamp in milliseconds.\n *\n * @see {@link PibblInternalFrame}\n */\nexport function getCurrentFrameTimestamp(): number {\n return getCurrentPibblInstance().renderTimestamp;\n}\n\n/**\n * Returns the active instance's owning Canvas, never a transient filter target.\n *\n * @returns The host canvas of the active backend mount. See {@link Canvas}.\n *\n * @see {@link Canvas}\n */\nexport function getCurrentBackendHostCanvas(): Canvas {\n return getCurrentPibblInstance().canvas;\n}\n\n/**\n * Returns development JSX source metadata for the current component.\n *\n * @returns Source metadata for the current element, or undefined when unavailable. See\n * {@link PibblElementSource} .\n *\n * @see {@link PibblElementSource}\n */\nexport function getCurrentElementSource(): PibblElementSource | undefined {\n const { componentRefs } = requireHookContext();\n return getElementSource(componentRefs.element);\n}\n\n/**\n * Returns the active surface's independent effective backing densities.\n *\n * @returns Backing pixels per logical unit on each axis.\n *\n * @see {@link PibblPixelRatio}\n */\nexport function getCurrentSurfaceDensity(): Readonly<{ x: number; y: number }> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n x: surface.backingPixelsPerLogicalUnitX,\n y: surface.backingPixelsPerLogicalUnitY,\n });\n}\n\n/**\n * Returns the active root-logical viewport for an official renderer hook.\n *\n * @returns The current logical viewport width and height.\n *\n * @see {@link PibblConfig}\n */\nexport function getCurrentLogicalViewport(): Readonly<{\n width: number;\n height: number;\n}> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n width: surface.logicalWidth,\n height: surface.logicalHeight,\n });\n}\n\n/**\n * Registers a callback on the root-wide transaction containing this render.\n *\n * @param callback - Callback receiving whether the current render transaction succeeded.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function onCurrentRenderFinish(\n callback: (success: boolean) => void,\n): void {\n requireHookContext();\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error(\"No Pibbl render transaction is active.\");\n }\n transaction.onFinish(callback);\n}\n\n/**\n * Requests a coalesced frame for the current private backend instance.\n *\n * @param updateParents - Whether ancestor compositions should also receive a frame request.\n *\n * @see {@link pibblInternalRequestRender}\n */\nexport function requestCurrentInstanceFrame(updateParents: boolean): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n let state = frameRequestsByComponent.get(componentRefs);\n if (!state) {\n state = {\n componentRefs,\n instance: pibblInstance,\n active: true,\n handle: undefined,\n updateParents: false,\n };\n frameRequestsByComponent.set(componentRefs, state);\n componentRefs.teardowns.add(() =>\n releaseCurrentInstanceFrameRequest(state!),\n );\n }\n state.updateParents ||= updateParents;\n if (state.handle) return;\n state.handle = queueBeginCommand(() => {\n state!.handle = undefined;\n const updateParentsForFrame = state!.updateParents;\n state!.updateParents = false;\n if (!isCurrentInstanceFrameRequestActive(state!)) return;\n if (updateParentsForFrame) {\n update(state!.instance.canvas, undefined, true);\n } else {\n update(state!.instance.canvas);\n }\n });\n}\n\n/**\n * Retains one geometry-independent target for an official backend picker.\n *\n * @param handlers - Handlers for the backend target. See {@link PibblEventHandlers}.\n * @param options - Backend geometry and focus metadata. See {@link PibblBackendEventTargetOptions}.\n * @param pointerEvents - Pointer participation policy; defaults to auto. See\n * {@link PibblPointerEvents} .\n * @returns The live registration, or undefined when registration is unnecessary. See\n * {@link PibblEventTargetRegistration} .\n *\n * @see {@link PibblEventHandlers}\n * @see {@link PibblBackendEventTargetOptions}\n * @see {@link PibblPointerEvents}\n * @see {@link PibblEventTargetRegistration}\n */\nexport function useBackendEventTarget(\n handlers: PibblEventHandlers,\n options: PibblBackendEventTargetOptions = {},\n pointerEvents: PibblPointerEvents = \"auto\",\n): PibblEventTargetRegistration | undefined {\n const { componentRefs, pibblInstance } = requireHookContext();\n const hookIndex = GLOBAL_STATE.componentHookIndex;\n const slot = useInternalHookSlot(\"backendEventTarget\", (teardowns) => {\n const target = createTarget(pibblInstance, componentRefs, hookIndex);\n teardowns.add(() => releaseTarget(target));\n return { target, emptyPath: new Path2D() };\n });\n const { target, emptyPath } = slot.value;\n if (pointerEvents === \"none\") {\n releaseTarget(target);\n return undefined;\n }\n updateTarget(\n target,\n handlers,\n { ...options, path: emptyPath },\n true,\n options.deferKeyboardNavigationGeometry ?? false,\n );\n if (target.paintEntry) {\n target.owner.paintEntries.delete(target.paintEntry);\n target.paintEntry = undefined;\n }\n return target;\n}\n\n/**\n * Tests whether an official backend target can still win coordinate picking.\n *\n * @param target - Registration whose ownership is being checked. See\n * {@link PibblEventTargetRegistration} .\n * @returns Whether the target registration is still live.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function isBackendEventTargetLive(\n target: PibblEventTargetRegistration,\n): boolean {\n const { owner } = target;\n return (\n target.live &&\n !owner.mainTeardowns.closed &&\n owner.eventRoot.targets.has(target)\n );\n}\n\n/**\n * Temporarily releases one backend target; its retained hook may enroll it again.\n *\n * @param target - Target registration to release. See {@link PibblEventTargetRegistration}.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function releaseBackendEventTarget(\n target: PibblEventTargetRegistration,\n): void {\n releaseTarget(target);\n target.keyboardNavigationBounds = undefined;\n target.keyboardNavigationPoints = undefined;\n}\n\n/**\n * Registers work that runs after this component's rendered descendants.\n *\n * @param callback - Callback to execute after the current component renders.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function setCurrentComponentAfterRender(callback: () => void): void {\n const { componentRefs } = requireHookContext();\n const previous = componentRefs.onAfterRender;\n componentRefs.onAfterRender = previous\n ? () => {\n try {\n previous();\n } finally {\n callback();\n }\n }\n : callback;\n}\n\n/**\n * Installs one stable nested backend resolver in the current Canvas paint order.\n *\n * @param input - Nested coordinate resolver and its target metadata. See\n * {@link PibblNestedResolverInput} .\n *\n * @see {@link PibblNestedResolverInput}\n */\nexport function registerNestedInteractionResolver(\n input: PibblNestedResolverInput,\n): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n const childInstance = backendMountInstance(input.child);\n if (\n childInstance.parent !== pibblInstance.canvas ||\n childInstance.eventRoot !== pibblInstance.eventRoot\n ) {\n throw new Error(\n \"A nested Pibbl backend mount must belong to the current instance and same event root.\",\n );\n }\n const slot = useInternalHookSlot<{\n entry: PibblInteractionLayer;\n child: PibblBackendMount;\n }>(\"nestedInteractionResolver\", (teardowns) => {\n const entry: PibblInteractionLayer = {\n paintKind: PibblPaintEntryKind.Resolver,\n instance: childInstance,\n bounds: input.bounds,\n transform: new DOMMatrix(),\n clippingStack: [],\n resolveLocal: input.resolveLocal,\n };\n const value = { entry, child: input.child };\n teardowns.add(() => {\n pibblInstance.paintEntries.delete(entry);\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n });\n return value;\n });\n const { entry } = slot.value;\n if (\n (childInstance.eventParent !== undefined &&\n childInstance.eventParent !== componentRefs) ||\n (childInstance.focusParentBridge !== undefined &&\n childInstance.focusParentBridge !== entry)\n ) {\n throw new Error(\n \"A nested Pibbl backend mount already belongs to another nested resolver.\",\n );\n }\n pibblInstance.paintEntries.delete(entry);\n if (slot.value.child !== input.child) {\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n slot.value.child = input.child;\n }\n entry.instance = childInstance;\n entry.instance.eventParent = componentRefs;\n entry.bounds = input.bounds;\n entry.transform = getCurrentWorldTransform();\n entry.clippingStack = Array.from(GLOBAL_STATE.clippingStack);\n entry.resolveLocal = input.resolveLocal;\n entry.instance.focusParentBridge = entry;\n if (input.pointerEvents === \"auto\") {\n pibblInstance.paintEntries.add(entry);\n }\n}\n\nfunction backendMountInstance(mount: PibblBackendMount) {\n const instance = GLOBAL_STATE.pibblInstances.get(mount.canvas);\n if (!instance) {\n throw new Error(\"Nested Pibbl backend mount is not active.\");\n }\n return instance;\n}\n\nfunction cancelCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n state.handle?.cancel();\n state.handle = undefined;\n state.updateParents = false;\n}\n\nfunction releaseCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n if (!state.active) return;\n state.active = false;\n cancelCurrentInstanceFrameRequest(state);\n frameRequestsByComponent.delete(state.componentRefs);\n\n}\n\nfunction isCurrentInstanceFrameRequestActive(\n state: CurrentInstanceFrameRequestState,\n): boolean {\n return (\n state.active &&\n !state.componentRefs.teardowns.closed &&\n !state.instance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(state.instance.canvas) === state.instance &&\n state.instance.refs.get(state.componentRefs.id) === state.componentRefs\n );\n}\nexport {\n pibblInternalAssertCommandAllowed,\n pibblInternalCreateSignalConsumer,\n pibblInternalCurrentFrame,\n pibblInternalCurrentRenderOwner,\n pibblInternalOnRenderFinish,\n pibblInternalPaintTarget,\n pibblInternalQueueBegin,\n pibblInternalQueueComplete,\n pibblInternalQueueCurrentCommit,\n pibblInternalQueueCurrentComplete,\n pibblInternalRegisterAdvance,\n pibblInternalRequestRender,\n pibblInternalRequestRendererWork,\n} from \"./lib/scheduler/renderer-participant.js\";\nexport type {\n PibblInternalCommandHandle,\n PibblInternalFrame,\n PibblInternalRendererWorkKind,\n PibblInternalRenderOwner,\n PibblInternalSignalBatch,\n PibblInternalSignalConsumer,\n} from \"./lib/scheduler/renderer-participant.js\";\n\nexport { pushLayoutBox } from \"./lib/layout/context.js\";\n\nexport {\n ManualSchedulerDriver as PibblInternalManualSchedulerDriver,\n installSchedulerDriverForTest as pibblInternalInstallTestSchedulerDriver,\n snapshotRealmScheduler as pibblInternalSnapshotRealmScheduler,\n} from \"./lib/scheduler/testing.js\";\n\nexport { getCurrentWorldTransform as pibblInternalCurrentWorldTransform } from \"./lib/render-target.js\";\n\nexport { borrowTextureRaster, resolveTexturePaint, validateTexturePaint } from './lib/textures/texture-protocol.js';\nexport type { BorrowedTextureRaster } from './lib/textures/texture-protocol.js';\n"],
5
- "mappings": "AASA,SAAS,0BAA0B;AAenC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAA6B,wBAAgC;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,yCAAyC;AAMlD,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,2BAA2B;AAEpC,SAAS,yBAAyB,oBAAoB;AACtD;AAAA,EACE;AAAA,EACA,uBAAAA;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,0BAA0B;AAOnC,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAWlC,MAAM,2BAA2B,oBAAI,QAGnC;AASK,SAAS,sBAAyB,OAA6B;AACpE,QAAM,SAAS,aAAa;AAC5B,QAAM,QAAQ,aAAa;AAC3B,MAAI,CAAC,UAAU,CAAC,SAAS,OAAO,UAAU,OAAO;AAC/C,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AACA,SAAO,MAAM;AACf;AASO,SAAS,2BAAmC;AACjD,SAAO,wBAAwB,EAAE;AACnC;AASO,SAAS,8BAAsC;AACpD,SAAO,wBAAwB,EAAE;AACnC;AAUO,SAAS,0BAA0D;AACxE,QAAM,EAAE,cAAc,IAAI,mBAAmB;AAC7C,SAAO,iBAAiB,cAAc,OAAO;AAC/C;AASO,SAAS,2BAA+D;AAC7E,QAAM,UAAU,mBAAmB,wBAAwB,CAAC;A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AEA,SAAS,qBAAqB,OAA0B;AACtD,QAAM,WAAW,aAAa,eAAe,IAAI,MAAM,MAAM;AAC7D,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AACA,SAAO;AACT;AAEA,SAAS,kCACP,OACM;AACN,QAAM,QAAQ,OAAO;AACrB,QAAM,SAAS;AACf,QAAM,gBAAgB;AACxB;AAEA,SAAS,mCACP,OACM;AACN,MAAI,CAAC,MAAM,OAAQ;AACnB,QAAM,SAAS;AACf,oCAAkC,KAAK;AACvC,2BAAyB,OAAO,MAAM,aAAa;AAErD;AAEA,SAAS,oCACP,OACS;AACT,SACE,MAAM,UACN,CAAC,MAAM,cAAc,UAAU,UAC/B,CAAC,MAAM,SAAS,cAAc,UAC9B,aAAa,eAAe,IAAI,MAAM,SAAS,MAAM,MAAM,MAAM,YACjE,MAAM,SAAS,KAAK,IAAI,MAAM,cAAc,EAAE,MAAM,MAAM;AAE9D;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,SAAS,qBAAqB;AAE9B;AAAA,EAC2B;AAAA,EACQ;AAAA,EACP;AAAA,OACrB;AAEP,SAAqC,4BAA5BC,iCAAsE;AAE/E,SAAS,qBAAqB,qBAAqB,4BAA4B;",
4
+ "sourcesContent": ["import type { PibblInternalFrame, pibblInternalOnRenderFinish, pibblInternalRequestRender } from './lib/scheduler/renderer-participant.js';\nimport type { PibblConfig, PibblPixelRatio } from './lib/surface/types.js';\n/**\n * @packageDocumentation\n * Reserved for official Pibbl packages that are released in lockstep with\n * `@pibbl/core`. This version-coupled module is not a stable third-party plugin\n * API and intentionally does not re-export the public root module.\n */\n\nexport { createBackendToken } from \"./lib/backend/types.js\";\nexport type {\n PibblBackendDriver,\n PibblBackendEventTargetOptions,\n PibblBackendFrame,\n PibblBackendFrameInput,\n PibblBackendMount,\n PibblBackendMountOptions,\n PibblBackendPrimitiveDefinition,\n PibblBackendPrimitiveInput,\n PibblBackendPrimitiveProgram,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nexport type { SignalProgramProps, SignalStyle } from \"./lib/types.js\";\nexport {\n pibblInternalRunPurePrimitiveResolver,\n defineBackendPrimitive,\n derivePrimitive,\n} from \"./lib/define-primitive.js\";\nexport { mountBackendPibbl } from \"./lib/mount-pibbl.js\";\nexport {\n useInternalHookSlot,\n withHooksForbidden,\n} from \"./lib/hooks/hook-slot.js\";\nexport { useValueMemoSlot as useInternalValueMemoSlot } from \"./lib/hooks/use-value-memo-slot.js\";\nexport {\n haveSameLayerNodeTree,\n materializeRetainedLayerChildren,\n snapshotLayerNodeTree,\n} from \"./lib/components/layer-node-equality.js\";\nexport type { LayerNodeSnapshot } from \"./lib/components/layer-node-equality.js\";\nexport type { PibblEventTargetRegistration } from \"./lib/events/registrations.js\";\nexport type { PibblElementSource } from \"./lib/element/metadata.js\";\nexport { pibblInternalCreatePropAttachment } from \"./lib/element-enhancers.js\";\nexport type {\n PibblInternalMountedPropAttachment,\n PibblInternalPrimitiveAttachmentInput,\n} from \"./lib/element-enhancers.js\";\nexport type { PibblHitTestOutput } from \"./lib/events/paint-entry.js\";\nexport { hasPibblEventHandler } from \"./lib/events/event-definitions.js\";\nexport {\n pibblInternalCurrentSimulationOwner,\n pibblInternalOnSimulationRenderTransactionFinish,\n pibblInternalQueueSimulationBegin,\n pibblInternalQueueSimulationCommitAcknowledgement,\n pibblInternalQueueSimulationComplete,\n pibblInternalRegisterSimulationAdvance,\n pibblInternalRequestSimulationRender,\n} from \"./lib/scheduler/simulation-participant.js\";\nexport type {\n PibblInternalAdvanceLane,\n PibblInternalSimulationOwner,\n} from \"./lib/scheduler/simulation-participant.js\";\n\nimport type {\n PibblBackendEventTargetOptions,\n PibblBackendMount,\n PibblBackendToken,\n PibblNestedResolverInput,\n} from \"./lib/backend/types.js\";\nimport {\n createTarget,\n releaseTarget,\n updateTarget,\n type PibblEventTargetRegistration,\n} from \"./lib/events/registrations.js\";\nimport { PibblPaintEntryKind } from \"./lib/events/paint-entry.js\";\nimport type { PibblEventHandlers, PibblPointerEvents } from \"./lib/events/types.js\";\nimport { getCurrentPibblInstance, GLOBAL_STATE } from \"./lib/global-state.js\";\nexport { captureSeriesInspectionFrame } from \"./lib/series-inspection-frame.js\";\nexport { borrowDispatchResource } from \"./lib/events/event-facade.js\";\nimport {\n requireHookContext,\n useInternalHookSlot,\n} from \"./lib/hooks/hook-slot.js\";\nimport { getCurrentWorldTransform } from \"./lib/render-target.js\";\nimport {\n getElementSource,\n type PibblElementSource,\n} from \"./lib/element/metadata.js\";\nimport { getSurfaceSnapshot } from \"./lib/surface/transform.js\";\nimport type {\n Canvas,\n PibblComponentRefs,\n PibblInstance,\n} from \"./lib/types.js\";\nimport type { PibblInteractionLayer } from \"./lib/types.js\";\nimport { update } from \"./lib/update.js\";\nimport { queueBeginCommand } from \"./lib/scheduler/realm-scheduler.js\";\nimport type { PibblBeginCommandHandle } from \"./lib/scheduler/types.js\";\n\ninterface CurrentInstanceFrameRequestState {\n readonly componentRefs: PibblComponentRefs<any>;\n readonly instance: PibblInstance;\n active: boolean;\n handle: PibblBeginCommandHandle | undefined;\n updateParents: boolean;\n}\n\nconst frameRequestsByComponent = new WeakMap<\n PibblComponentRefs<any>,\n CurrentInstanceFrameRequestState\n>();\n/**\n * Reads the selected official backend's current frame environment.\n *\n * @param token - Backend identity required by the caller. See {@link PibblBackendToken}.\n * @returns The active environment for that backend.\n *\n * @see {@link PibblBackendToken}\n */\nexport function getBackendEnvironment<E>(token: PibblBackendToken): E {\n const driver = GLOBAL_STATE.backendDriver;\n const frame = GLOBAL_STATE.backendFrame;\n if (!driver || !frame || driver.token !== token) {\n throw new Error(\"The requested Pibbl backend environment is not active.\");\n }\n return frame.environment as E;\n}\n\n/**\n * Returns the timestamp shared by the current Pibbl render transaction.\n *\n * @returns The active frame timestamp in milliseconds.\n *\n * @see {@link PibblInternalFrame}\n */\nexport function getCurrentFrameTimestamp(): number {\n return getCurrentPibblInstance().renderTimestamp;\n}\n\n/**\n * Returns the active instance's owning Canvas, never a transient filter target.\n *\n * @returns The host canvas of the active backend mount. See {@link Canvas}.\n *\n * @see {@link Canvas}\n */\nexport function getCurrentBackendHostCanvas(): Canvas {\n return getCurrentPibblInstance().canvas;\n}\n\n/**\n * Returns development JSX source metadata for the current component.\n *\n * @returns Source metadata for the current element, or undefined when unavailable. See\n * {@link PibblElementSource} .\n *\n * @see {@link PibblElementSource}\n */\nexport function getCurrentElementSource(): PibblElementSource | undefined {\n const { componentRefs } = requireHookContext();\n return getElementSource(componentRefs.element);\n}\n\n/**\n * Returns the active surface's independent effective backing densities.\n *\n * @returns Backing pixels per logical unit on each axis.\n *\n * @see {@link PibblPixelRatio}\n */\nexport function getCurrentSurfaceDensity(): Readonly<{ x: number; y: number }> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n x: surface.backingPixelsPerLogicalUnitX,\n y: surface.backingPixelsPerLogicalUnitY,\n });\n}\n\n/**\n * Returns the active root-logical viewport for an official renderer hook.\n *\n * @returns The current logical viewport width and height.\n *\n * @see {@link PibblConfig}\n */\nexport function getCurrentLogicalViewport(): Readonly<{\n width: number;\n height: number;\n}> {\n const surface = getSurfaceSnapshot(getCurrentPibblInstance());\n return Object.freeze({\n width: surface.logicalWidth,\n height: surface.logicalHeight,\n });\n}\n\n/**\n * Registers a callback on the root-wide transaction containing this render.\n *\n * @param callback - Callback receiving whether the current render transaction succeeded.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function onCurrentRenderFinish(\n callback: (success: boolean) => void,\n): void {\n requireHookContext();\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error(\"No Pibbl render transaction is active.\");\n }\n transaction.onFinish(callback);\n}\n\n/**\n * Requests a coalesced frame for the current private backend instance.\n *\n * @param updateParents - Whether ancestor compositions should also receive a frame request.\n *\n * @see {@link pibblInternalRequestRender}\n */\nexport function requestCurrentInstanceFrame(updateParents: boolean): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n let state = frameRequestsByComponent.get(componentRefs);\n if (!state) {\n state = {\n componentRefs,\n instance: pibblInstance,\n active: true,\n handle: undefined,\n updateParents: false,\n };\n frameRequestsByComponent.set(componentRefs, state);\n componentRefs.teardowns.add(() =>\n releaseCurrentInstanceFrameRequest(state!),\n );\n }\n state.updateParents ||= updateParents;\n if (state.handle) return;\n state.handle = queueBeginCommand(() => {\n state!.handle = undefined;\n const updateParentsForFrame = state!.updateParents;\n state!.updateParents = false;\n if (!isCurrentInstanceFrameRequestActive(state!)) return;\n if (updateParentsForFrame) {\n update(state!.instance.canvas, undefined, true);\n } else {\n update(state!.instance.canvas);\n }\n });\n}\n\n/**\n * Retains one geometry-independent target for an official backend picker.\n *\n * @param handlers - Handlers for the backend target. See {@link PibblEventHandlers}.\n * @param options - Backend geometry and focus metadata. See {@link PibblBackendEventTargetOptions}.\n * @param pointerEvents - Pointer participation policy; defaults to auto. See\n * {@link PibblPointerEvents} .\n * @returns The live registration, or undefined when registration is unnecessary. See\n * {@link PibblEventTargetRegistration} .\n *\n * @see {@link PibblEventHandlers}\n * @see {@link PibblBackendEventTargetOptions}\n * @see {@link PibblPointerEvents}\n * @see {@link PibblEventTargetRegistration}\n */\nexport function useBackendEventTarget(\n handlers: PibblEventHandlers,\n options: PibblBackendEventTargetOptions = {},\n pointerEvents: PibblPointerEvents = \"auto\",\n): PibblEventTargetRegistration | undefined {\n const { componentRefs, pibblInstance } = requireHookContext();\n const hookIndex = GLOBAL_STATE.componentHookIndex;\n const slot = useInternalHookSlot(\"backendEventTarget\", (teardowns) => {\n const target = createTarget(pibblInstance, componentRefs, hookIndex);\n teardowns.add(() => releaseTarget(target));\n return { target, emptyPath: new Path2D() };\n });\n const { target, emptyPath } = slot.value;\n if (pointerEvents === \"none\") {\n releaseTarget(target);\n return undefined;\n }\n updateTarget(\n target,\n handlers,\n { ...options, path: emptyPath },\n true,\n options.deferKeyboardNavigationGeometry ?? false,\n );\n if (target.paintEntry) {\n target.owner.paintEntries.delete(target.paintEntry);\n target.paintEntry = undefined;\n }\n return target;\n}\n\n/**\n * Tests whether an official backend target can still win coordinate picking.\n *\n * @param target - Registration whose ownership is being checked. See\n * {@link PibblEventTargetRegistration} .\n * @returns Whether the target registration is still live.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function isBackendEventTargetLive(\n target: PibblEventTargetRegistration,\n): boolean {\n const { owner } = target;\n return (\n target.live &&\n !owner.mainTeardowns.closed &&\n owner.eventRoot.targets.has(target)\n );\n}\n\n/**\n * Temporarily releases one backend target; its retained hook may enroll it again.\n *\n * @param target - Target registration to release. See {@link PibblEventTargetRegistration}.\n *\n * @see {@link PibblEventTargetRegistration}\n */\nexport function releaseBackendEventTarget(\n target: PibblEventTargetRegistration,\n): void {\n releaseTarget(target);\n target.keyboardNavigationBounds = undefined;\n target.keyboardNavigationPoints = undefined;\n}\n\n/**\n * Registers work that runs after this component's rendered descendants.\n *\n * @param callback - Callback to execute after the current component renders.\n *\n * @see {@link pibblInternalOnRenderFinish}\n */\nexport function setCurrentComponentAfterRender(callback: () => void): void {\n const { componentRefs } = requireHookContext();\n const previous = componentRefs.onAfterRender;\n componentRefs.onAfterRender = previous\n ? () => {\n try {\n previous();\n } finally {\n callback();\n }\n }\n : callback;\n}\n\n/**\n * Installs one stable nested backend resolver in the current Canvas paint order.\n *\n * @param input - Nested coordinate resolver and its target metadata. See\n * {@link PibblNestedResolverInput} .\n *\n * @see {@link PibblNestedResolverInput}\n */\nexport function registerNestedInteractionResolver(\n input: PibblNestedResolverInput,\n): void {\n const { componentRefs, pibblInstance } = requireHookContext();\n const childInstance = backendMountInstance(input.child);\n if (\n childInstance.parent !== pibblInstance.canvas ||\n childInstance.eventRoot !== pibblInstance.eventRoot\n ) {\n throw new Error(\n \"A nested Pibbl backend mount must belong to the current instance and same event root.\",\n );\n }\n const slot = useInternalHookSlot<{\n entry: PibblInteractionLayer;\n child: PibblBackendMount;\n }>(\"nestedInteractionResolver\", (teardowns) => {\n const entry: PibblInteractionLayer = {\n paintKind: PibblPaintEntryKind.Resolver,\n instance: childInstance,\n bounds: input.bounds,\n transform: new DOMMatrix(),\n clippingStack: [],\n resolveLocal: input.resolveLocal,\n };\n const value = { entry, child: input.child };\n teardowns.add(() => {\n pibblInstance.paintEntries.delete(entry);\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n });\n return value;\n });\n const { entry } = slot.value;\n if (\n (childInstance.eventParent !== undefined &&\n childInstance.eventParent !== componentRefs) ||\n (childInstance.focusParentBridge !== undefined &&\n childInstance.focusParentBridge !== entry)\n ) {\n throw new Error(\n \"A nested Pibbl backend mount already belongs to another nested resolver.\",\n );\n }\n pibblInstance.paintEntries.delete(entry);\n if (slot.value.child !== input.child) {\n if (entry.instance.focusParentBridge === entry) {\n entry.instance.focusParentBridge = undefined;\n }\n if (entry.instance.eventParent === componentRefs) {\n entry.instance.eventParent = undefined;\n }\n slot.value.child = input.child;\n }\n entry.instance = childInstance;\n entry.instance.eventParent = componentRefs;\n entry.bounds = input.bounds;\n entry.transform = getCurrentWorldTransform();\n entry.clippingStack = Array.from(GLOBAL_STATE.clippingStack);\n entry.resolveLocal = input.resolveLocal;\n entry.instance.focusParentBridge = entry;\n if (input.pointerEvents === \"auto\") {\n pibblInstance.paintEntries.add(entry);\n }\n}\n\nfunction backendMountInstance(mount: PibblBackendMount) {\n const instance = GLOBAL_STATE.pibblInstances.get(mount.canvas);\n if (!instance) {\n throw new Error(\"Nested Pibbl backend mount is not active.\");\n }\n return instance;\n}\n\nfunction cancelCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n state.handle?.cancel();\n state.handle = undefined;\n state.updateParents = false;\n}\n\nfunction releaseCurrentInstanceFrameRequest(\n state: CurrentInstanceFrameRequestState,\n): void {\n if (!state.active) return;\n state.active = false;\n cancelCurrentInstanceFrameRequest(state);\n frameRequestsByComponent.delete(state.componentRefs);\n\n}\n\nfunction isCurrentInstanceFrameRequestActive(\n state: CurrentInstanceFrameRequestState,\n): boolean {\n return (\n state.active &&\n !state.componentRefs.teardowns.closed &&\n !state.instance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(state.instance.canvas) === state.instance &&\n state.instance.refs.get(state.componentRefs.id) === state.componentRefs\n );\n}\nexport {\n pibblInternalAssertCommandAllowed,\n pibblInternalCreateSignalConsumer,\n pibblInternalCurrentFrame,\n pibblInternalCurrentRenderOwner,\n pibblInternalOnRenderFinish,\n pibblInternalPaintTarget,\n pibblInternalQueueBegin,\n pibblInternalQueueComplete,\n pibblInternalQueueCurrentCommit,\n pibblInternalQueueCurrentComplete,\n pibblInternalRegisterAdvance,\n pibblInternalRequestRender,\n pibblInternalRequestRendererWork,\n} from \"./lib/scheduler/renderer-participant.js\";\nexport type {\n PibblInternalCommandHandle,\n PibblInternalFrame,\n PibblInternalRendererWorkKind,\n PibblInternalRenderOwner,\n PibblInternalSignalBatch,\n PibblInternalSignalConsumer,\n} from \"./lib/scheduler/renderer-participant.js\";\n\nexport { pushLayoutBox } from \"./lib/layout/context.js\";\n\nexport {\n ManualSchedulerDriver as PibblInternalManualSchedulerDriver,\n installSchedulerDriverForTest as pibblInternalInstallTestSchedulerDriver,\n snapshotRealmScheduler as pibblInternalSnapshotRealmScheduler,\n} from \"./lib/scheduler/testing.js\";\n\nexport { getCurrentWorldTransform as pibblInternalCurrentWorldTransform } from \"./lib/render-target.js\";\n\nexport { borrowTextureRaster, resolveTexturePaint, validateTexturePaint } from './lib/textures/texture-protocol.js';\nexport type { BorrowedTextureRaster } from './lib/textures/texture-protocol.js';\n"],
5
+ "mappings": "AASA,SAAS,0BAA0B;AAenC;AAAA,E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AA,EAC7D;AACA,SAAO;AACT;AAEA,SAAS,kCACP,OACM;AACN,QAAM,QAAQ,OAAO;AACrB,QAAM,SAAS;AACf,QAAM,gBAAgB;AACxB;AAEA,SAAS,mCACP,OACM;AACN,MAAI,CAAC,MAAM,OAAQ;AACnB,QAAM,SAAS;AACf,oCAAkC,KAAK;AACvC,2BAAyB,OAAO,MAAM,aAAa;AAErD;AAEA,SAAS,oCACP,OACS;AACT,SACE,MAAM,UACN,CAAC,MAAM,cAAc,UAAU,UAC/B,CAAC,MAAM,SAAS,cAAc,UAC9B,aAAa,eAAe,IAAI,MAAM,SAAS,MAAM,MAAM,MAAM,YACjE,MAAM,SAAS,KAAK,IAAI,MAAM,cAAc,EAAE,MAAM,MAAM;AAE9D;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,SAAS,qBAAqB;AAE9B;AAAA,EAC2B;AAAA,EACQ;AAAA,EACP;AAAA,OACrB;AAEP,SAAqC,4BAA5BC,iCAAsE;AAE/E,SAAS,qBAAqB,qBAAqB,4BAA4B;",
6
6
  "names": ["useInternalHookSlot", "target", "entry", "getCurrentWorldTransform"]
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { type SpringDefinitionRecord } from './spring.js';
2
- import type { PibblAnimationDefinition, PibblAnimationOptions, PibblAnimationSampleInput, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions } from './types.js';
2
+ import type { PibblAnimationDefinition, PibblAnimationTarget, PibblAnimationOptions, PibblAnimationSampleInput, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions } from './types.js';
3
3
  declare const seekableDefinitionActivationBrand: unique symbol;
4
4
  interface BaseDefinitionRecord {
5
5
  readonly duration: number;
@@ -47,6 +47,8 @@ export type SeekableDefinitionBoundaryValue<T> = {
47
47
  } | {
48
48
  readonly kind: 'unknown';
49
49
  };
50
+ /** @internal Resolves hook-owned endpoints using the definition's implementation. */
51
+ export declare function bindAnimationTarget<T>(definition: PibblAnimationDefinition<T>, target: PibblAnimationTarget<T>): PibblAnimationDefinition<T>;
50
52
  export interface AnimationDefinitionPerformanceSnapshot {
51
53
  readonly keyframeDefinitions: number;
52
54
  readonly keyframeStorageArrayAllocations: number;
@@ -67,7 +69,7 @@ export declare function snapshotAnimationActivationValue<T>(value: T, seen?: Wea
67
69
  * @see {@link PibblTweenOptions}
68
70
  * @see {@link PibblAnimationDefinition}
69
71
  */
70
- export declare function tween<T>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T>;
72
+ export declare function tween<T = number>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T>;
71
73
  /**
72
74
  * Returns an opaque immutable keyframe definition.
73
75
  *
@@ -90,7 +92,7 @@ export declare function keyframes<T>(options: Readonly<PibblKeyframesOptions<T>>
90
92
  * @see {@link PibblSpringOptions}
91
93
  * @see {@link PibblAnimationDefinition}
92
94
  */
93
- export declare function spring(options: Readonly<PibblSpringOptions>): PibblAnimationDefinition<number>;
95
+ export declare function spring(options?: Readonly<PibblSpringOptions>): PibblAnimationDefinition<number>;
94
96
  /**
95
97
  * Returns an opaque immutable definition from a custom seekable sampler.
96
98
  *
@@ -6,6 +6,17 @@ import {
6
6
  sampleSpring
7
7
  } from "./spring.js";
8
8
  const definitionRecords = /* @__PURE__ */ new WeakMap();
9
+ const targetBindings = /* @__PURE__ */ new WeakMap();
10
+ function targetDefinition(definition, unbound, bind) {
11
+ targetBindings.set(definition, { unbound, bind });
12
+ return definition;
13
+ }
14
+ function bindAnimationTarget(definition, target) {
15
+ const binding = targetBindings.get(definition);
16
+ if (binding) return binding.bind(target);
17
+ getDefinitionRecord(definition);
18
+ return definition;
19
+ }
9
20
  const seekableActivationRecords = /* @__PURE__ */ new WeakMap();
10
21
  let keyframeDefinitions = 0;
11
22
  let keyframeStorageArrayAllocations = 0;
@@ -342,7 +353,7 @@ function tween(options) {
342
353
  }
343
354
  const hasFrom = hasOwn(options, "from");
344
355
  const snapshots = /* @__PURE__ */ new WeakMap();
345
- return createDefinition({
356
+ const record = {
346
357
  kind: "tween",
347
358
  duration: options.duration,
348
359
  debugName: options.debugName,
@@ -351,7 +362,15 @@ function tween(options) {
351
362
  to: snapshotAnimationValue(options.to, snapshots),
352
363
  easing: options.easing ?? easing.linear,
353
364
  interpolate: options.interpolate
354
- });
365
+ };
366
+ return targetDefinition(createDefinition(record), !hasOwn(options, "to"), ({ from, to }) => tween({
367
+ from,
368
+ to,
369
+ duration: record.duration,
370
+ easing: record.easing,
371
+ interpolate: record.interpolate,
372
+ debugName: record.debugName
373
+ }));
355
374
  }
356
375
  function keyframes(options) {
357
376
  assertDuration(options.duration, options.debugName);
@@ -377,8 +396,10 @@ function keyframes(options) {
377
396
  interpolate: options.interpolate
378
397
  });
379
398
  }
380
- function spring(options) {
381
- return createDefinition(createSpringRecord(options));
399
+ function spring(options = {}) {
400
+ const unbound = !hasOwn(options, "to");
401
+ const record = createSpringRecord({ ...options, to: unbound ? 0 : options.to });
402
+ return targetDefinition(createDefinition(record), unbound, ({ from, to, velocity }) => spring({ ...record, from, to, initialVelocity: velocity ?? record.initialVelocity }));
382
403
  }
383
404
  function defineAnimation(options) {
384
405
  assertDuration(options.duration, options.debugName);
@@ -425,6 +446,9 @@ function stepper(options) {
425
446
  });
426
447
  }
427
448
  function getDefinitionRecord(definition) {
449
+ if (targetBindings.get(definition)?.unbound) {
450
+ throw new TypeError("Animation definition needs a target: supply to for drive(), or pass it to useAnimatedValue().");
451
+ }
428
452
  const record = definitionRecords.get(definition);
429
453
  if (record === void 0) throw new TypeError("Expected a Pibbl animation definition.");
430
454
  return record;
@@ -590,6 +614,7 @@ function getStaticSeekableDefinitionBoundaryValue(definition, boundary) {
590
614
  export {
591
615
  activateSeekableDefinition,
592
616
  animationDefinitionPerformanceSnapshot,
617
+ bindAnimationTarget,
593
618
  defineAnimation,
594
619
  getDefinitionRecord,
595
620
  getSeekableDefinitionBoundaryValue,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/animation/definition.ts"],
4
- "sourcesContent": ["import { withSignalWriteForbidden } from '../signals/graph.js';\nimport { easing } from './easing.js';\nimport {\n createSpringRecord,\n resolveSpringStart,\n sampleSpring,\n type SpringDefinitionRecord,\n} from './spring.js';\nimport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationSampleInput,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './types.js';\n\ndeclare const seekableDefinitionActivationBrand: unique symbol;\n\ninterface BaseDefinitionRecord {\n readonly duration: number;\n readonly debugName: string | undefined;\n}\n\ninterface TweenDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'tween';\n readonly hasFrom: boolean;\n readonly from: T | undefined;\n readonly to: T;\n readonly easing: PibblEasing;\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface KeyframesDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'keyframes';\n readonly values: readonly T[];\n readonly offsets: readonly number[];\n readonly easings: readonly PibblEasing[];\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface CustomDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'custom';\n readonly sample: (input: PibblAnimationSampleInput<T>) => T;\n}\n\nexport interface StepperDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'stepper';\n readonly stepMilliseconds: number;\n readonly maxElapsedMilliseconds: number;\n readonly initial: (currentValue: T) => unknown;\n readonly step: (state: unknown, deltaMilliseconds: number) => unknown;\n readonly read: (state: unknown) => T;\n readonly done: ((state: unknown) => boolean) | undefined;\n}\n\nexport type DefinitionRecord<T> =\n | TweenDefinitionRecord<T>\n | KeyframesDefinitionRecord<T>\n | CustomDefinitionRecord<T>\n | StepperDefinitionRecord<T>\n | SpringDefinitionRecord;\n\n/** @internal Opaque activation-time state for one seekable track instance. */\nexport interface SeekableDefinitionActivation<T> {\n readonly [seekableDefinitionActivationBrand]: T;\n readonly duration: number;\n readonly initialValue: T;\n}\n\n/** @internal Callback-free knowledge about a seekable definition boundary. */\nexport type SeekableDefinitionBoundaryValue<T> =\n | { readonly kind: 'known'; readonly value: T }\n | { readonly kind: 'unknown' };\n\ninterface SeekableDefinitionActivationRecord<T> {\n readonly definition: PibblAnimationDefinition<T>;\n readonly definitionRecord: Exclude<DefinitionRecord<T>, StepperDefinitionRecord<T>>;\n readonly initialValue: T;\n}\n\nconst definitionRecords = new WeakMap<\n PibblAnimationDefinition<unknown>,\n DefinitionRecord<unknown>\n>();\nconst seekableActivationRecords = new WeakMap<\n SeekableDefinitionActivation<unknown>,\n SeekableDefinitionActivationRecord<unknown>\n>();\nlet keyframeDefinitions = 0;\nlet keyframeStorageArrayAllocations = 0;\nlet keyframeSamples = 0;\nlet keyframeSampleArrayAllocations = 0;\nlet keyframeSampleDepth = 0;\n\nexport interface AnimationDefinitionPerformanceSnapshot {\n readonly keyframeDefinitions: number;\n readonly keyframeStorageArrayAllocations: number;\n readonly keyframeSamples: number;\n readonly keyframeSampleArrayAllocations: number;\n}\n\n/** @internal Deterministic structural counters for normalized keyframe sampling. */\nexport function animationDefinitionPerformanceSnapshot():\nAnimationDefinitionPerformanceSnapshot {\n return Object.freeze({\n keyframeDefinitions,\n keyframeStorageArrayAllocations,\n keyframeSamples,\n keyframeSampleArrayAllocations,\n });\n}\n\nfunction definitionLabel(debugName: string | undefined): string {\n return debugName === undefined ? 'Pibbl animation definition' :\n `Pibbl animation definition \"${debugName}\"`;\n}\n\nfunction assertDuration(duration: number, debugName: string | undefined): void {\n if (!Number.isFinite(duration) || duration < 0) {\n throw new RangeError(`${definitionLabel(debugName)} duration must be finite and nonnegative.`);\n }\n}\n\nfunction assertFiniteNumber(value: number, message: string): void {\n if (!Number.isFinite(value)) throw new RangeError(message);\n}\n\nconst MUTATING_MAP_METHODS = new Set<PropertyKey>(['set', 'delete', 'clear']);\nconst MUTATING_SET_METHODS = new Set<PropertyKey>(['add', 'delete', 'clear']);\nconst MUTATING_DATE_METHODS = new Set<PropertyKey>([\n 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes',\n 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',\n 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth',\n 'setUTCSeconds', 'setYear',\n]);\n\nfunction immutableBuiltin<T extends object>(\n target: T,\n mutatingMethods: ReadonlySet<PropertyKey>,\n): T {\n return new Proxy(target, {\n get(current, key) {\n if (mutatingMethods.has(key)) {\n return (): never => {\n throw new TypeError('Cannot mutate an animation definition snapshot.');\n };\n }\n const member = Reflect.get(current, key, current);\n return typeof member === 'function' && key !== 'constructor' ?\n member.bind(current) : member;\n },\n set(): false {\n return false;\n },\n defineProperty(): false {\n return false;\n },\n deleteProperty(): false {\n return false;\n },\n });\n}\n\nfunction rememberIdentity<T extends object>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n seen.set(value, value);\n return value;\n}\n\nfunction hasOwnProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).some(key => !allowed.has(key));\n}\n\nfunction hasOnlyDataProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).every(key => {\n if (allowed.has(key)) return true;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor !== undefined && 'value' in descriptor;\n });\n}\n\nconst ARRAY_OWN_KEYS = new Set<PropertyKey>(['length']);\nconst REGEXP_OWN_KEYS = new Set<PropertyKey>(['lastIndex']);\nconst snapshotsRequiringIsolation = new WeakSet<object>();\n\nfunction requiresIsolation(value: unknown): value is object {\n return (typeof value === 'object' && value !== null || typeof value === 'function') &&\n snapshotsRequiringIsolation.has(value as object);\n}\n\nfunction propagateIsolation(snapshot: object, value: unknown): void {\n if (requiresIsolation(value)) snapshotsRequiringIsolation.add(snapshot);\n}\n\nfunction isArrayIndex(key: PropertyKey): boolean {\n return typeof key === 'string' && /^(?:0|[1-9]\\d*)$/u.test(key);\n}\n\nfunction cloneTypedArray(\n value: ArrayBufferView,\n buffer?: ArrayBuffer,\n): ArrayBufferView {\n if (value instanceof DataView) {\n if (buffer !== undefined) {\n return new DataView(buffer, value.byteOffset, value.byteLength);\n }\n const bytes = value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength);\n return new DataView(bytes);\n }\n const TypedArray = value.constructor as unknown as {\n new (source: ArrayBufferView): ArrayBufferView;\n new (buffer: ArrayBuffer, byteOffset: number, length: number): ArrayBufferView;\n };\n return buffer === undefined ? new TypedArray(value) :\n new TypedArray(\n buffer,\n value.byteOffset,\n (value as ArrayBufferView & { readonly length: number }).length,\n );\n}\n\n/**\n * Definitions retain values after their caller has moved on. The context is\n * shared across one definition so aliases and cycles remain aliases and cycles\n * in its immutable snapshot. Only categories with stable, inspectable cloning\n * semantics are copied. Reconstructable values that cannot themselves be\n * frozen are marked so only the containing paths are rematerialized before a\n * callback or terminal return. Functions, classes, accessors, and opaque host\n * values (notably WeakMap, WeakSet, Promise, and host handles) remain usable\n * identity values because cloning them can manufacture an invalid receiver or\n * change their behavior; an absolute snapshot guarantee for those values\n * requires an explicit public clone contract that Pibbl does not currently\n * provide.\n */\nfunction snapshotAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n isolateStoredValue = false,\n): T {\n if (value === null || typeof value === 'function' || typeof value !== 'object') {\n return value;\n }\n const existing = seen.get(value);\n if (existing !== undefined) return existing as T;\n if (isolateStoredValue && !requiresIsolation(value)) {\n seen.set(value, value);\n return value;\n }\n\n if (value instanceof Date) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const snapshot = immutableBuiltin(new Date(value.getTime()), MUTATING_DATE_METHODS);\n seen.set(value, snapshot);\n return snapshot as T;\n }\n if (value instanceof Map) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Map();\n const snapshot = immutableBuiltin(target, MUTATING_MAP_METHODS);\n seen.set(value, snapshot);\n for (const [key, entry] of value) {\n const keySnapshot = snapshotAnimationValue(key, seen, isolateStoredValue);\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.set(keySnapshot, entrySnapshot);\n propagateIsolation(snapshot, keySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (value instanceof Set) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Set();\n const snapshot = immutableBuiltin(target, MUTATING_SET_METHODS);\n seen.set(value, snapshot);\n for (const entry of value) {\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.add(entrySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (Array.isArray(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (Object.getPrototypeOf(value) !== Array.prototype ||\n ownKeys.some(key => !ARRAY_OWN_KEYS.has(key) && !isArrayIndex(key)) ||\n !hasOnlyDataProperties(value, ARRAY_OWN_KEYS)) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot: unknown[] = new Array(value.length);\n if (keyframeSampleDepth > 0) keyframeSampleArrayAllocations++;\n seen.set(value, snapshot);\n for (const key of ownKeys) {\n if (ARRAY_OWN_KEYS.has(key)) continue;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !('value' in descriptor)) continue;\n const itemSnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: itemSnapshot,\n });\n propagateIsolation(snapshot, itemSnapshot);\n }\n return Object.freeze(snapshot) as T;\n }\n\n if (value instanceof RegExp) {\n if (hasOwnProperties(value, REGEXP_OWN_KEYS)) return rememberIdentity(value, seen) as T;\n const snapshot = new RegExp(value.source, value.flags);\n snapshot.lastIndex = value.lastIndex;\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (ArrayBuffer.isView(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (ownKeys.some(key => !isArrayIndex(key))) return rememberIdentity(value, seen) as T;\n const buffer = value.buffer instanceof ArrayBuffer ?\n snapshotAnimationValue(value.buffer, seen, isolateStoredValue) : undefined;\n const snapshot = cloneTypedArray(value, buffer);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (value instanceof ArrayBuffer) {\n const snapshot = value.slice(0);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null ||\n !hasOnlyDataProperties(value, new Set())) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot = Object.create(prototype) as Record<PropertyKey, unknown>;\n seen.set(value, snapshot);\n for (const key of Reflect.ownKeys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined) continue;\n const propertySnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: propertySnapshot,\n });\n propagateIsolation(snapshot, propertySnapshot);\n }\n return Object.freeze(snapshot) as T;\n}\n\nfunction isolateStoredAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n return snapshotAnimationValue(value, seen, true);\n}\n\n/** @internal Captures a committed output value for a playback activation. */\nexport function snapshotAnimationActivationValue<T>(\n value: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): T {\n return snapshotAnimationValue(value, seen);\n}\n\nfunction validateSampledValue<T>(sampled: T, debugName: string | undefined): T {\n if (typeof sampled === 'number' && !Number.isFinite(sampled)) {\n throw new RangeError(`${definitionLabel(debugName)} sampled value must be finite.`);\n }\n return sampled;\n}\n\nfunction createDefinition<T>(record: DefinitionRecord<T>): PibblAnimationDefinition<T> {\n const definition = Object.freeze({}) as PibblAnimationDefinition<T>;\n definitionRecords.set(\n definition as PibblAnimationDefinition<unknown>,\n Object.freeze(record) as DefinitionRecord<unknown>,\n );\n return definition;\n}\n\nfunction hasOwn(object: object, key: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction callback<T>(\n debugName: string | undefined,\n callback: () => T,\n): T {\n return withSignalWriteForbidden(\n `${definitionLabel(debugName)} callbacks cannot write to signals.`,\n callback,\n );\n}\n\nfunction sampledProgress(duration: number, localTime: number): {\n readonly localTime: number;\n readonly progress: number;\n} {\n assertFiniteNumber(localTime, 'Pibbl animation sample localTime must be finite.');\n if (duration === 0) return Object.freeze({ localTime: 0, progress: 1 });\n const normalizedLocalTime = Math.min(duration, Math.max(0, localTime));\n return Object.freeze({\n localTime: normalizedLocalTime,\n progress: normalizedLocalTime / duration,\n });\n}\n\nfunction interpolate<T>(\n from: T,\n to: T,\n progress: number,\n custom: PibblInterpolator<T> | undefined,\n debugName: string | undefined,\n): T {\n if (custom === undefined && (typeof from !== 'number' || typeof to !== 'number')) {\n throw new TypeError(`${definitionLabel(debugName)} requires an explicit interpolator for nonnumeric values.`);\n }\n let sampled: T;\n if (custom === undefined) {\n sampled = ((from as unknown as number) +\n ((to as unknown as number) - (from as unknown as number)) * progress) as T;\n } else {\n const isolated = new WeakMap<object, unknown>();\n const isolatedFrom = isolateStoredAnimationValue(from, isolated);\n const isolatedTo = isolateStoredAnimationValue(to, isolated);\n sampled = callback(debugName, () => custom(isolatedFrom, isolatedTo, progress));\n }\n return validateSampledValue(sampled, debugName);\n}\n\nfunction easedProgress(\n ease: PibblEasing,\n progress: number,\n debugName: string | undefined,\n): number {\n const eased = callback(debugName, () => ease(progress));\n if (!Number.isFinite(eased)) {\n throw new RangeError(`${definitionLabel(debugName)} easing result must be finite.`);\n }\n return eased;\n}\n\nfunction normalizeOffsets(\n values: readonly unknown[],\n offsets: readonly number[] | undefined,\n debugName: string | undefined,\n): readonly number[] {\n if (offsets === undefined) {\n return Object.freeze(values.map((_, index) => index / (values.length - 1)));\n }\n if (offsets.length !== values.length) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must match the values length.`);\n }\n const snapshot = [...offsets];\n for (const offset of snapshot) {\n if (!Number.isFinite(offset) || offset < 0 || offset > 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be finite values within [0, 1].`);\n }\n }\n if (snapshot[0] !== 0) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must start at 0.`);\n }\n if (snapshot.at(-1) !== 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must end at 1.`);\n }\n for (let index = 1; index < snapshot.length; index++) {\n if (snapshot[index] < snapshot[index - 1]) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be nondecreasing.`);\n }\n }\n return Object.freeze(snapshot);\n}\n\nfunction normalizeEasings(\n easingOption: PibblEasing | readonly PibblEasing[] | undefined,\n segmentCount: number,\n debugName: string | undefined,\n): readonly PibblEasing[] {\n if (Array.isArray(easingOption)) {\n if (easingOption.length !== segmentCount) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe easing list must have one entry per segment.`);\n }\n if (easingOption.some(ease => typeof ease !== 'function')) {\n throw new TypeError(`${definitionLabel(debugName)} keyframe easings must be functions.`);\n }\n return Object.freeze([...easingOption]);\n }\n const ease = easingOption ?? easing.linear;\n if (typeof ease !== 'function') {\n throw new TypeError(`${definitionLabel(debugName)} easing must be a function.`);\n }\n return Object.freeze(Array.from({ length: segmentCount }, () => ease));\n}\n\n/**\n * Returns an opaque immutable tween definition.\n *\n * @param options - Start and end values, duration, easing, and interpolation settings. See\n * {@link PibblTweenOptions} .\n * @returns An immutable tween definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblTweenOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function tween<T>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.easing !== 'undefined' && typeof options.easing !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} easing must be a function.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const hasFrom = hasOwn(options, 'from');\n const snapshots = new WeakMap<object, unknown>();\n return createDefinition({\n kind: 'tween',\n duration: options.duration,\n debugName: options.debugName,\n hasFrom,\n from: hasFrom ? snapshotAnimationValue(options.from as T, snapshots) : undefined,\n to: snapshotAnimationValue(options.to, snapshots),\n easing: options.easing ?? easing.linear,\n interpolate: options.interpolate,\n });\n}\n\n/**\n * Returns an opaque immutable keyframe definition.\n *\n * @param options - Keyframe values, timing, easing, and interpolation settings. See\n * {@link PibblKeyframesOptions} .\n * @returns An immutable animation definition sampling the keyframes. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblKeyframesOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function keyframes<T>(\n options: Readonly<PibblKeyframesOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (options.values.length < 2) {\n throw new RangeError(`${definitionLabel(options.debugName)} keyframes require at least two values.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const snapshots = new WeakMap<object, unknown>();\n const values = Object.freeze(options.values.map(value => snapshotAnimationValue(value, snapshots)));\n const offsets = normalizeOffsets(values, options.offsets, options.debugName);\n const easings = normalizeEasings(options.easing, values.length - 1, options.debugName);\n keyframeDefinitions++;\n keyframeStorageArrayAllocations += 3;\n return createDefinition({\n kind: 'keyframes',\n duration: options.duration,\n debugName: options.debugName,\n values,\n offsets,\n easings,\n interpolate: options.interpolate,\n });\n}\n\n/**\n * Returns an opaque immutable analytic one-dimensional spring definition.\n *\n * @param options - Target, initial conditions, and spring parameters. See {@link PibblSpringOptions}\n * .\n * @returns An analytic numeric spring definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblSpringOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function spring(\n options: Readonly<PibblSpringOptions>,\n): PibblAnimationDefinition<number> {\n return createDefinition(createSpringRecord(options));\n}\n\n/**\n * Returns an opaque immutable definition from a custom seekable sampler.\n *\n * @param options - Duration and pure sampling callback for the animation. See\n * {@link PibblAnimationOptions} .\n * @returns An immutable, seekable animation definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblAnimationOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function defineAnimation<T>(\n options: Readonly<PibblAnimationOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.sample !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} sample must be a function.`);\n }\n return createDefinition({\n kind: 'custom',\n duration: options.duration,\n debugName: options.debugName,\n sample: options.sample,\n });\n}\n\n/**\n * Returns an opaque immutable stepper definition. Steppers are evaluated by\n * the playback engine, not by the seekable sampler.\n *\n * @param options - Initial state, fixed-step integration, value reader, and completion predicate.\n * See {@link PibblStepperOptions} .\n * @returns A stateful animation definition advanced by fixed simulation steps. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblStepperOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function stepper<State, T>(\n options: Readonly<PibblStepperOptions<State, T>>,\n): PibblAnimationDefinition<T> {\n if (typeof options.initial !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper initial must be a function.`);\n }\n if (typeof options.step !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper step must be a function.`);\n }\n if (typeof options.read !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper read must be a function.`);\n }\n if (typeof options.done !== 'undefined' && typeof options.done !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper done must be a function.`);\n }\n if (!Number.isFinite(options.stepMilliseconds) || options.stepMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper stepMilliseconds must be finite and positive.`);\n }\n const maxElapsedMilliseconds = options.maxElapsedMilliseconds ?? 100;\n if (!Number.isFinite(maxElapsedMilliseconds) || maxElapsedMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper maxElapsedMilliseconds must be finite and positive.`);\n }\n return createDefinition({\n kind: 'stepper',\n duration: Number.POSITIVE_INFINITY,\n debugName: options.debugName,\n stepMilliseconds: options.stepMilliseconds,\n maxElapsedMilliseconds,\n initial: options.initial as (currentValue: T) => unknown,\n step: options.step as (state: unknown, deltaMilliseconds: number) => unknown,\n read: options.read as (state: unknown) => T,\n done: options.done as ((state: unknown) => boolean) | undefined,\n });\n}\n\n/** @internal Returns the private immutable record associated with a definition. */\nexport function getDefinitionRecord<T>(\n definition: PibblAnimationDefinition<T>,\n): DefinitionRecord<T> {\n const record = definitionRecords.get(definition as PibblAnimationDefinition<unknown>);\n if (record === undefined) throw new TypeError('Expected a Pibbl animation definition.');\n return record as DefinitionRecord<T>;\n}\n\n/** @internal Samples a non-stepper definition from its activation snapshot. */\nexport function sampleSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n input: Readonly<Pick<PibblAnimationSampleInput<T>, 'initialValue' | 'localTime'>>,\n): T {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'stepper') {\n throw new TypeError(\n `${definitionLabel(record.debugName)} is stateful and requires the stateful program evaluator.`,\n );\n }\n if (record.kind === 'spring') {\n const resolved = resolveSpringStart(record, input.initialValue as number);\n const timing = sampledProgress(resolved.duration, input.localTime);\n return sampleSpring(resolved, timing.localTime / 1000).position as T;\n }\n const timing = sampledProgress(record.duration, input.localTime);\n if (record.kind === 'custom') {\n const sampled = callback(record.debugName, () => record.sample(Object.freeze({\n initialValue: input.initialValue,\n localTime: timing.localTime,\n progress: timing.progress,\n })));\n return validateSampledValue(sampled, record.debugName);\n }\n if (record.kind === 'tween') {\n const from = record.hasFrom ? record.from as T : input.initialValue;\n return interpolate(\n from,\n record.to,\n easedProgress(record.easing, timing.progress, record.debugName),\n record.interpolate,\n record.debugName,\n );\n }\n\n keyframeSamples++;\n keyframeSampleDepth++;\n try {\n return sampleKeyframe(record, timing);\n } finally {\n keyframeSampleDepth--;\n }\n}\n\nfunction sampleKeyframe<T>(\n record: KeyframesDefinitionRecord<T>,\n timing: { readonly progress: number },\n): T {\n let segment = 0;\n for (let index = 1; index < record.offsets.length; index++) {\n if (record.offsets[index] <= timing.progress) segment = index;\n else break;\n }\n if (segment === record.values.length - 1) {\n return validateSampledValue(\n isolateStoredAnimationValue(record.values[segment], new WeakMap()),\n record.debugName,\n );\n }\n const start = record.offsets[segment];\n const end = record.offsets[segment + 1];\n return interpolate(\n record.values[segment],\n record.values[segment + 1],\n easedProgress(record.easings[segment], (timing.progress - start) / (end - start), record.debugName),\n record.interpolate,\n record.debugName,\n );\n}\n\n/**\n * @internal Resolves activation-dependent definition data exactly once for a\n * track instance. Stateful definitions use a separate playback-owned record.\n */\nexport function activateSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n initialValue: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): SeekableDefinitionActivation<T> {\n const definitionRecord = getDefinitionRecord(definition);\n if (definitionRecord.kind === 'stepper') {\n throw new TypeError(\n 'Stateful animation definitions require the stateful program evaluator.',\n );\n }\n const snapshot = snapshotAnimationActivationValue(initialValue, seen);\n const resolved = definitionRecord.kind === 'spring' ?\n resolveSpringStart(definitionRecord, snapshot as number) : definitionRecord;\n const activation = Object.freeze({\n duration: resolved.duration,\n initialValue: snapshot,\n }) as SeekableDefinitionActivation<T>;\n seekableActivationRecords.set(\n activation as SeekableDefinitionActivation<unknown>,\n Object.freeze({\n definition,\n definitionRecord: resolved,\n initialValue: snapshot,\n }) as SeekableDefinitionActivationRecord<unknown>,\n );\n return activation;\n}\n\n/** @internal Samples a definition from one retained activation record. */\nexport function sampleActivatedSeekableDefinition<T>(\n activation: SeekableDefinitionActivation<T>,\n localTime: number,\n): T {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n const timing = sampledProgress(record.duration, localTime);\n return sampleSpring(record, timing.localTime / 1000).position as T;\n }\n return sampleSeekableDefinition(activationRecord.definition, {\n initialValue: activationRecord.initialValue,\n localTime,\n });\n}\n\n/**\n * @internal Returns a boundary value only when the normalized definition makes\n * it exact without invoking user easing, interpolation, or sampling callbacks.\n */\nexport function getSeekableDefinitionBoundaryValue<T>(\n activation: SeekableDefinitionActivation<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n return Object.freeze({ kind: 'unknown' as const });\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n return Object.freeze({\n kind: 'known' as const,\n value: boundary === 'start' ?\n (record.hasFrom ? record.from as T : activationRecord.initialValue) : record.to,\n });\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n\n/**\n * @internal Returns a callback-free boundary that does not depend on a track's\n * activation value. This lets discovery recover known terminal state after an\n * earlier opaque custom value.\n */\nexport function getStaticSeekableDefinitionBoundaryValue<T>(\n definition: PibblAnimationDefinition<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'spring' && record.hasFrom) {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.to });\n }\n if (record.hasFrom) {\n return Object.freeze({ kind: 'known' as const, value: record.from as T });\n }\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n"],
5
- "mappings": "AAAA,SAAS,gCAAgC;AACzC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA6EP,MAAM,oBAAoB,oBAAI,QAG5B;AACF,MAAM,4BAA4B,oBAAI,QAGpC;AACF,IAAI,sBAAsB;AAC1B,IAAI,kCAAkC;AACtC,IAAI,kBAAkB;AACtB,IAAI,iCAAiC;AACrC,IAAI,sBAAsB;AAUnB,SAAS,yCACuB;AACrC,SAAO,OAAO,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEA,SAAS,gBAAgB,WAAuC;AAC9D,SAAO,cAAc,SAAY,+BAC/B,+BAA+B,SAAS;AAC5C;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;AACA,MAAI,OAAO,SAAS,aAAa;AAC/B,QAAI,aAAa,OAAO;AACtB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,OAAO,GAAG,EAAE,EAAG,CAAC;AAAA,IAC/E;AACA,QAAI,OAAO,gBAAgB,UAAa,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ;AAC3E,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,OAAO,CAAC,EAAG,CAAC;AAAA,IAC3E;AAAA,EACF;AACA,MAAI,OAAO,SAAS,WAAW,OAAO,gBAAgB,UACpD,OAAO,WAAW,OAAO,QAAQ;AACjC,QAAI,aAAa,OAAO;AACtB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,GAAG,CAAC;AAAA,IACnE;AACA,QAAI,OAAO,SAAS;AAClB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,KAAU,CAAC;AAAA,IAC1E;AAAA,EACF;AACA,SAAO,OAAO,OAAO,EAAE,MAAM,UAAmB,CAAC;AACnD;",
4
+ "sourcesContent": ["import { withSignalWriteForbidden } from '../signals/graph.js';\nimport { easing } from './easing.js';\nimport {\n createSpringRecord,\n resolveSpringStart,\n sampleSpring,\n type SpringDefinitionRecord,\n} from './spring.js';\nimport type {\n PibblAnimationDefinition,\n PibblAnimationTarget,\n PibblAnimationOptions,\n PibblAnimationSampleInput,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './types.js';\n\ndeclare const seekableDefinitionActivationBrand: unique symbol;\n\ninterface BaseDefinitionRecord {\n readonly duration: number;\n readonly debugName: string | undefined;\n}\n\ninterface TweenDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'tween';\n readonly hasFrom: boolean;\n readonly from: T | undefined;\n readonly to: T;\n readonly easing: PibblEasing;\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface KeyframesDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'keyframes';\n readonly values: readonly T[];\n readonly offsets: readonly number[];\n readonly easings: readonly PibblEasing[];\n readonly interpolate: PibblInterpolator<T> | undefined;\n}\n\ninterface CustomDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'custom';\n readonly sample: (input: PibblAnimationSampleInput<T>) => T;\n}\n\nexport interface StepperDefinitionRecord<T> extends BaseDefinitionRecord {\n readonly kind: 'stepper';\n readonly stepMilliseconds: number;\n readonly maxElapsedMilliseconds: number;\n readonly initial: (currentValue: T) => unknown;\n readonly step: (state: unknown, deltaMilliseconds: number) => unknown;\n readonly read: (state: unknown) => T;\n readonly done: ((state: unknown) => boolean) | undefined;\n}\n\nexport type DefinitionRecord<T> =\n | TweenDefinitionRecord<T>\n | KeyframesDefinitionRecord<T>\n | CustomDefinitionRecord<T>\n | StepperDefinitionRecord<T>\n | SpringDefinitionRecord;\n\n/** @internal Opaque activation-time state for one seekable track instance. */\nexport interface SeekableDefinitionActivation<T> {\n readonly [seekableDefinitionActivationBrand]: T;\n readonly duration: number;\n readonly initialValue: T;\n}\n\n/** @internal Callback-free knowledge about a seekable definition boundary. */\nexport type SeekableDefinitionBoundaryValue<T> =\n | { readonly kind: 'known'; readonly value: T }\n | { readonly kind: 'unknown' };\n\ninterface SeekableDefinitionActivationRecord<T> {\n readonly definition: PibblAnimationDefinition<T>;\n readonly definitionRecord: Exclude<DefinitionRecord<T>, StepperDefinitionRecord<T>>;\n readonly initialValue: T;\n}\n\nconst definitionRecords = new WeakMap<\n PibblAnimationDefinition<unknown>,\n DefinitionRecord<unknown>\n>();\n// Binding is carried by the definition, so the hook does not select algorithms.\nconst targetBindings = new WeakMap<object, {\n readonly unbound: boolean;\n readonly bind: (target: PibblAnimationTarget<any>) => PibblAnimationDefinition<any>;\n}>();\n\nfunction targetDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n unbound: boolean,\n bind: (target: PibblAnimationTarget<T>) => PibblAnimationDefinition<T>,\n): PibblAnimationDefinition<T> {\n targetBindings.set(definition, { unbound, bind });\n return definition;\n}\n\n/** @internal Resolves hook-owned endpoints using the definition's implementation. */\nexport function bindAnimationTarget<T>(\n definition: PibblAnimationDefinition<T>,\n target: PibblAnimationTarget<T>,\n): PibblAnimationDefinition<T> {\n const binding = targetBindings.get(definition);\n if (binding) return binding.bind(target);\n getDefinitionRecord(definition);\n return definition;\n}\n\nconst seekableActivationRecords = new WeakMap<\n SeekableDefinitionActivation<unknown>,\n SeekableDefinitionActivationRecord<unknown>\n>();\nlet keyframeDefinitions = 0;\nlet keyframeStorageArrayAllocations = 0;\nlet keyframeSamples = 0;\nlet keyframeSampleArrayAllocations = 0;\nlet keyframeSampleDepth = 0;\n\nexport interface AnimationDefinitionPerformanceSnapshot {\n readonly keyframeDefinitions: number;\n readonly keyframeStorageArrayAllocations: number;\n readonly keyframeSamples: number;\n readonly keyframeSampleArrayAllocations: number;\n}\n\n/** @internal Deterministic structural counters for normalized keyframe sampling. */\nexport function animationDefinitionPerformanceSnapshot():\nAnimationDefinitionPerformanceSnapshot {\n return Object.freeze({\n keyframeDefinitions,\n keyframeStorageArrayAllocations,\n keyframeSamples,\n keyframeSampleArrayAllocations,\n });\n}\n\nfunction definitionLabel(debugName: string | undefined): string {\n return debugName === undefined ? 'Pibbl animation definition' :\n `Pibbl animation definition \"${debugName}\"`;\n}\n\nfunction assertDuration(duration: number, debugName: string | undefined): void {\n if (!Number.isFinite(duration) || duration < 0) {\n throw new RangeError(`${definitionLabel(debugName)} duration must be finite and nonnegative.`);\n }\n}\n\nfunction assertFiniteNumber(value: number, message: string): void {\n if (!Number.isFinite(value)) throw new RangeError(message);\n}\n\nconst MUTATING_MAP_METHODS = new Set<PropertyKey>(['set', 'delete', 'clear']);\nconst MUTATING_SET_METHODS = new Set<PropertyKey>(['add', 'delete', 'clear']);\nconst MUTATING_DATE_METHODS = new Set<PropertyKey>([\n 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes',\n 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',\n 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth',\n 'setUTCSeconds', 'setYear',\n]);\n\nfunction immutableBuiltin<T extends object>(\n target: T,\n mutatingMethods: ReadonlySet<PropertyKey>,\n): T {\n return new Proxy(target, {\n get(current, key) {\n if (mutatingMethods.has(key)) {\n return (): never => {\n throw new TypeError('Cannot mutate an animation definition snapshot.');\n };\n }\n const member = Reflect.get(current, key, current);\n return typeof member === 'function' && key !== 'constructor' ?\n member.bind(current) : member;\n },\n set(): false {\n return false;\n },\n defineProperty(): false {\n return false;\n },\n deleteProperty(): false {\n return false;\n },\n });\n}\n\nfunction rememberIdentity<T extends object>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n seen.set(value, value);\n return value;\n}\n\nfunction hasOwnProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).some(key => !allowed.has(key));\n}\n\nfunction hasOnlyDataProperties(value: object, allowed: ReadonlySet<PropertyKey>): boolean {\n return Reflect.ownKeys(value).every(key => {\n if (allowed.has(key)) return true;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor !== undefined && 'value' in descriptor;\n });\n}\n\nconst ARRAY_OWN_KEYS = new Set<PropertyKey>(['length']);\nconst REGEXP_OWN_KEYS = new Set<PropertyKey>(['lastIndex']);\nconst snapshotsRequiringIsolation = new WeakSet<object>();\n\nfunction requiresIsolation(value: unknown): value is object {\n return (typeof value === 'object' && value !== null || typeof value === 'function') &&\n snapshotsRequiringIsolation.has(value as object);\n}\n\nfunction propagateIsolation(snapshot: object, value: unknown): void {\n if (requiresIsolation(value)) snapshotsRequiringIsolation.add(snapshot);\n}\n\nfunction isArrayIndex(key: PropertyKey): boolean {\n return typeof key === 'string' && /^(?:0|[1-9]\\d*)$/u.test(key);\n}\n\nfunction cloneTypedArray(\n value: ArrayBufferView,\n buffer?: ArrayBuffer,\n): ArrayBufferView {\n if (value instanceof DataView) {\n if (buffer !== undefined) {\n return new DataView(buffer, value.byteOffset, value.byteLength);\n }\n const bytes = value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength);\n return new DataView(bytes);\n }\n const TypedArray = value.constructor as unknown as {\n new (source: ArrayBufferView): ArrayBufferView;\n new (buffer: ArrayBuffer, byteOffset: number, length: number): ArrayBufferView;\n };\n return buffer === undefined ? new TypedArray(value) :\n new TypedArray(\n buffer,\n value.byteOffset,\n (value as ArrayBufferView & { readonly length: number }).length,\n );\n}\n\n/**\n * Definitions retain values after their caller has moved on. The context is\n * shared across one definition so aliases and cycles remain aliases and cycles\n * in its immutable snapshot. Only categories with stable, inspectable cloning\n * semantics are copied. Reconstructable values that cannot themselves be\n * frozen are marked so only the containing paths are rematerialized before a\n * callback or terminal return. Functions, classes, accessors, and opaque host\n * values (notably WeakMap, WeakSet, Promise, and host handles) remain usable\n * identity values because cloning them can manufacture an invalid receiver or\n * change their behavior; an absolute snapshot guarantee for those values\n * requires an explicit public clone contract that Pibbl does not currently\n * provide.\n */\nfunction snapshotAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n isolateStoredValue = false,\n): T {\n if (value === null || typeof value === 'function' || typeof value !== 'object') {\n return value;\n }\n const existing = seen.get(value);\n if (existing !== undefined) return existing as T;\n if (isolateStoredValue && !requiresIsolation(value)) {\n seen.set(value, value);\n return value;\n }\n\n if (value instanceof Date) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const snapshot = immutableBuiltin(new Date(value.getTime()), MUTATING_DATE_METHODS);\n seen.set(value, snapshot);\n return snapshot as T;\n }\n if (value instanceof Map) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Map();\n const snapshot = immutableBuiltin(target, MUTATING_MAP_METHODS);\n seen.set(value, snapshot);\n for (const [key, entry] of value) {\n const keySnapshot = snapshotAnimationValue(key, seen, isolateStoredValue);\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.set(keySnapshot, entrySnapshot);\n propagateIsolation(snapshot, keySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (value instanceof Set) {\n if (hasOwnProperties(value, new Set())) return rememberIdentity(value, seen) as T;\n const target = new Set();\n const snapshot = immutableBuiltin(target, MUTATING_SET_METHODS);\n seen.set(value, snapshot);\n for (const entry of value) {\n const entrySnapshot = snapshotAnimationValue(entry, seen, isolateStoredValue);\n target.add(entrySnapshot);\n propagateIsolation(snapshot, entrySnapshot);\n }\n return snapshot as T;\n }\n if (Array.isArray(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (Object.getPrototypeOf(value) !== Array.prototype ||\n ownKeys.some(key => !ARRAY_OWN_KEYS.has(key) && !isArrayIndex(key)) ||\n !hasOnlyDataProperties(value, ARRAY_OWN_KEYS)) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot: unknown[] = new Array(value.length);\n if (keyframeSampleDepth > 0) keyframeSampleArrayAllocations++;\n seen.set(value, snapshot);\n for (const key of ownKeys) {\n if (ARRAY_OWN_KEYS.has(key)) continue;\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !('value' in descriptor)) continue;\n const itemSnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: itemSnapshot,\n });\n propagateIsolation(snapshot, itemSnapshot);\n }\n return Object.freeze(snapshot) as T;\n }\n\n if (value instanceof RegExp) {\n if (hasOwnProperties(value, REGEXP_OWN_KEYS)) return rememberIdentity(value, seen) as T;\n const snapshot = new RegExp(value.source, value.flags);\n snapshot.lastIndex = value.lastIndex;\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (ArrayBuffer.isView(value)) {\n const ownKeys = Reflect.ownKeys(value);\n if (ownKeys.some(key => !isArrayIndex(key))) return rememberIdentity(value, seen) as T;\n const buffer = value.buffer instanceof ArrayBuffer ?\n snapshotAnimationValue(value.buffer, seen, isolateStoredValue) : undefined;\n const snapshot = cloneTypedArray(value, buffer);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n if (value instanceof ArrayBuffer) {\n const snapshot = value.slice(0);\n seen.set(value, snapshot);\n snapshotsRequiringIsolation.add(snapshot);\n return snapshot as T;\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null ||\n !hasOnlyDataProperties(value, new Set())) {\n return rememberIdentity(value, seen) as T;\n }\n const snapshot = Object.create(prototype) as Record<PropertyKey, unknown>;\n seen.set(value, snapshot);\n for (const key of Reflect.ownKeys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined) continue;\n const propertySnapshot = snapshotAnimationValue(\n descriptor.value,\n seen,\n isolateStoredValue,\n );\n Object.defineProperty(snapshot, key, {\n configurable: false,\n enumerable: descriptor.enumerable,\n writable: false,\n value: propertySnapshot,\n });\n propagateIsolation(snapshot, propertySnapshot);\n }\n return Object.freeze(snapshot) as T;\n}\n\nfunction isolateStoredAnimationValue<T>(\n value: T,\n seen: WeakMap<object, unknown>,\n): T {\n return snapshotAnimationValue(value, seen, true);\n}\n\n/** @internal Captures a committed output value for a playback activation. */\nexport function snapshotAnimationActivationValue<T>(\n value: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): T {\n return snapshotAnimationValue(value, seen);\n}\n\nfunction validateSampledValue<T>(sampled: T, debugName: string | undefined): T {\n if (typeof sampled === 'number' && !Number.isFinite(sampled)) {\n throw new RangeError(`${definitionLabel(debugName)} sampled value must be finite.`);\n }\n return sampled;\n}\n\nfunction createDefinition<T>(record: DefinitionRecord<T>): PibblAnimationDefinition<T> {\n const definition = Object.freeze({}) as PibblAnimationDefinition<T>;\n definitionRecords.set(\n definition as PibblAnimationDefinition<unknown>,\n Object.freeze(record) as DefinitionRecord<unknown>,\n );\n return definition;\n}\n\nfunction hasOwn(object: object, key: PropertyKey): boolean {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nfunction callback<T>(\n debugName: string | undefined,\n callback: () => T,\n): T {\n return withSignalWriteForbidden(\n `${definitionLabel(debugName)} callbacks cannot write to signals.`,\n callback,\n );\n}\n\nfunction sampledProgress(duration: number, localTime: number): {\n readonly localTime: number;\n readonly progress: number;\n} {\n assertFiniteNumber(localTime, 'Pibbl animation sample localTime must be finite.');\n if (duration === 0) return Object.freeze({ localTime: 0, progress: 1 });\n const normalizedLocalTime = Math.min(duration, Math.max(0, localTime));\n return Object.freeze({\n localTime: normalizedLocalTime,\n progress: normalizedLocalTime / duration,\n });\n}\n\nfunction interpolate<T>(\n from: T,\n to: T,\n progress: number,\n custom: PibblInterpolator<T> | undefined,\n debugName: string | undefined,\n): T {\n if (custom === undefined && (typeof from !== 'number' || typeof to !== 'number')) {\n throw new TypeError(`${definitionLabel(debugName)} requires an explicit interpolator for nonnumeric values.`);\n }\n let sampled: T;\n if (custom === undefined) {\n sampled = ((from as unknown as number) +\n ((to as unknown as number) - (from as unknown as number)) * progress) as T;\n } else {\n const isolated = new WeakMap<object, unknown>();\n const isolatedFrom = isolateStoredAnimationValue(from, isolated);\n const isolatedTo = isolateStoredAnimationValue(to, isolated);\n sampled = callback(debugName, () => custom(isolatedFrom, isolatedTo, progress));\n }\n return validateSampledValue(sampled, debugName);\n}\n\nfunction easedProgress(\n ease: PibblEasing,\n progress: number,\n debugName: string | undefined,\n): number {\n const eased = callback(debugName, () => ease(progress));\n if (!Number.isFinite(eased)) {\n throw new RangeError(`${definitionLabel(debugName)} easing result must be finite.`);\n }\n return eased;\n}\n\nfunction normalizeOffsets(\n values: readonly unknown[],\n offsets: readonly number[] | undefined,\n debugName: string | undefined,\n): readonly number[] {\n if (offsets === undefined) {\n return Object.freeze(values.map((_, index) => index / (values.length - 1)));\n }\n if (offsets.length !== values.length) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must match the values length.`);\n }\n const snapshot = [...offsets];\n for (const offset of snapshot) {\n if (!Number.isFinite(offset) || offset < 0 || offset > 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be finite values within [0, 1].`);\n }\n }\n if (snapshot[0] !== 0) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must start at 0.`);\n }\n if (snapshot.at(-1) !== 1) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must end at 1.`);\n }\n for (let index = 1; index < snapshot.length; index++) {\n if (snapshot[index] < snapshot[index - 1]) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe offsets must be nondecreasing.`);\n }\n }\n return Object.freeze(snapshot);\n}\n\nfunction normalizeEasings(\n easingOption: PibblEasing | readonly PibblEasing[] | undefined,\n segmentCount: number,\n debugName: string | undefined,\n): readonly PibblEasing[] {\n if (Array.isArray(easingOption)) {\n if (easingOption.length !== segmentCount) {\n throw new RangeError(`${definitionLabel(debugName)} keyframe easing list must have one entry per segment.`);\n }\n if (easingOption.some(ease => typeof ease !== 'function')) {\n throw new TypeError(`${definitionLabel(debugName)} keyframe easings must be functions.`);\n }\n return Object.freeze([...easingOption]);\n }\n const ease = easingOption ?? easing.linear;\n if (typeof ease !== 'function') {\n throw new TypeError(`${definitionLabel(debugName)} easing must be a function.`);\n }\n return Object.freeze(Array.from({ length: segmentCount }, () => ease));\n}\n\n/**\n * Returns an opaque immutable tween definition.\n *\n * @param options - Start and end values, duration, easing, and interpolation settings. See\n * {@link PibblTweenOptions} .\n * @returns An immutable tween definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblTweenOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function tween<T = number>(options: Readonly<PibblTweenOptions<T>>): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.easing !== 'undefined' && typeof options.easing !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} easing must be a function.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const hasFrom = hasOwn(options, 'from');\n const snapshots = new WeakMap<object, unknown>();\n const record: TweenDefinitionRecord<T> = {\n kind: 'tween',\n duration: options.duration,\n debugName: options.debugName,\n hasFrom,\n from: hasFrom ? snapshotAnimationValue(options.from as T, snapshots) : undefined,\n to: snapshotAnimationValue(options.to as T, snapshots),\n easing: options.easing ?? easing.linear,\n interpolate: options.interpolate,\n };\n return targetDefinition(createDefinition(record), !hasOwn(options, 'to'), ({ from, to }) =>\n tween({ from, to, duration: record.duration, easing: record.easing,\n interpolate: record.interpolate, debugName: record.debugName }));\n}\n\n/**\n * Returns an opaque immutable keyframe definition.\n *\n * @param options - Keyframe values, timing, easing, and interpolation settings. See\n * {@link PibblKeyframesOptions} .\n * @returns An immutable animation definition sampling the keyframes. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblKeyframesOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function keyframes<T>(\n options: Readonly<PibblKeyframesOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (options.values.length < 2) {\n throw new RangeError(`${definitionLabel(options.debugName)} keyframes require at least two values.`);\n }\n if (typeof options.interpolate !== 'undefined' && typeof options.interpolate !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} interpolator must be a function.`);\n }\n const snapshots = new WeakMap<object, unknown>();\n const values = Object.freeze(options.values.map(value => snapshotAnimationValue(value, snapshots)));\n const offsets = normalizeOffsets(values, options.offsets, options.debugName);\n const easings = normalizeEasings(options.easing, values.length - 1, options.debugName);\n keyframeDefinitions++;\n keyframeStorageArrayAllocations += 3;\n return createDefinition({\n kind: 'keyframes',\n duration: options.duration,\n debugName: options.debugName,\n values,\n offsets,\n easings,\n interpolate: options.interpolate,\n });\n}\n\n/**\n * Returns an opaque immutable analytic one-dimensional spring definition.\n *\n * @param options - Target, initial conditions, and spring parameters. See {@link PibblSpringOptions}\n * .\n * @returns An analytic numeric spring definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblSpringOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function spring(\n options: Readonly<PibblSpringOptions> = {},\n): PibblAnimationDefinition<number> {\n const unbound = !hasOwn(options, 'to');\n const record = createSpringRecord({ ...options, to: unbound ? 0 : options.to as number });\n return targetDefinition(createDefinition<number>(record), unbound, ({ from, to, velocity }) =>\n spring({ ...record, from, to, initialVelocity: velocity ?? record.initialVelocity }));\n}\n\n/**\n * Returns an opaque immutable definition from a custom seekable sampler.\n *\n * @param options - Duration and pure sampling callback for the animation. See\n * {@link PibblAnimationOptions} .\n * @returns An immutable, seekable animation definition. See {@link PibblAnimationDefinition}.\n *\n * @see {@link PibblAnimationOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function defineAnimation<T>(\n options: Readonly<PibblAnimationOptions<T>>,\n): PibblAnimationDefinition<T> {\n assertDuration(options.duration, options.debugName);\n if (typeof options.sample !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} sample must be a function.`);\n }\n return createDefinition({\n kind: 'custom',\n duration: options.duration,\n debugName: options.debugName,\n sample: options.sample,\n });\n}\n\n/**\n * Returns an opaque immutable stepper definition. Steppers are evaluated by\n * the playback engine, not by the seekable sampler.\n *\n * @param options - Initial state, fixed-step integration, value reader, and completion predicate.\n * See {@link PibblStepperOptions} .\n * @returns A stateful animation definition advanced by fixed simulation steps. See\n * {@link PibblAnimationDefinition} .\n *\n * @see {@link PibblStepperOptions}\n * @see {@link PibblAnimationDefinition}\n */\nexport function stepper<State, T>(\n options: Readonly<PibblStepperOptions<State, T>>,\n): PibblAnimationDefinition<T> {\n if (typeof options.initial !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper initial must be a function.`);\n }\n if (typeof options.step !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper step must be a function.`);\n }\n if (typeof options.read !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper read must be a function.`);\n }\n if (typeof options.done !== 'undefined' && typeof options.done !== 'function') {\n throw new TypeError(`${definitionLabel(options.debugName)} stepper done must be a function.`);\n }\n if (!Number.isFinite(options.stepMilliseconds) || options.stepMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper stepMilliseconds must be finite and positive.`);\n }\n const maxElapsedMilliseconds = options.maxElapsedMilliseconds ?? 100;\n if (!Number.isFinite(maxElapsedMilliseconds) || maxElapsedMilliseconds <= 0) {\n throw new RangeError(`${definitionLabel(options.debugName)} stepper maxElapsedMilliseconds must be finite and positive.`);\n }\n return createDefinition({\n kind: 'stepper',\n duration: Number.POSITIVE_INFINITY,\n debugName: options.debugName,\n stepMilliseconds: options.stepMilliseconds,\n maxElapsedMilliseconds,\n initial: options.initial as (currentValue: T) => unknown,\n step: options.step as (state: unknown, deltaMilliseconds: number) => unknown,\n read: options.read as (state: unknown) => T,\n done: options.done as ((state: unknown) => boolean) | undefined,\n });\n}\n\n/** @internal Returns the private immutable record associated with a definition. */\nexport function getDefinitionRecord<T>(\n definition: PibblAnimationDefinition<T>,\n): DefinitionRecord<T> {\n if (targetBindings.get(definition)?.unbound) {\n throw new TypeError('Animation definition needs a target: supply to for drive(), or pass it to useAnimatedValue().');\n }\n const record = definitionRecords.get(definition as PibblAnimationDefinition<unknown>);\n if (record === undefined) throw new TypeError('Expected a Pibbl animation definition.');\n return record as DefinitionRecord<T>;\n}\n\n/** @internal Samples a non-stepper definition from its activation snapshot. */\nexport function sampleSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n input: Readonly<Pick<PibblAnimationSampleInput<T>, 'initialValue' | 'localTime'>>,\n): T {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'stepper') {\n throw new TypeError(\n `${definitionLabel(record.debugName)} is stateful and requires the stateful program evaluator.`,\n );\n }\n if (record.kind === 'spring') {\n const resolved = resolveSpringStart(record, input.initialValue as number);\n const timing = sampledProgress(resolved.duration, input.localTime);\n return sampleSpring(resolved, timing.localTime / 1000).position as T;\n }\n const timing = sampledProgress(record.duration, input.localTime);\n if (record.kind === 'custom') {\n const sampled = callback(record.debugName, () => record.sample(Object.freeze({\n initialValue: input.initialValue,\n localTime: timing.localTime,\n progress: timing.progress,\n })));\n return validateSampledValue(sampled, record.debugName);\n }\n if (record.kind === 'tween') {\n const from = record.hasFrom ? record.from as T : input.initialValue;\n return interpolate(\n from,\n record.to,\n easedProgress(record.easing, timing.progress, record.debugName),\n record.interpolate,\n record.debugName,\n );\n }\n\n keyframeSamples++;\n keyframeSampleDepth++;\n try {\n return sampleKeyframe(record, timing);\n } finally {\n keyframeSampleDepth--;\n }\n}\n\nfunction sampleKeyframe<T>(\n record: KeyframesDefinitionRecord<T>,\n timing: { readonly progress: number },\n): T {\n let segment = 0;\n for (let index = 1; index < record.offsets.length; index++) {\n if (record.offsets[index] <= timing.progress) segment = index;\n else break;\n }\n if (segment === record.values.length - 1) {\n return validateSampledValue(\n isolateStoredAnimationValue(record.values[segment], new WeakMap()),\n record.debugName,\n );\n }\n const start = record.offsets[segment];\n const end = record.offsets[segment + 1];\n return interpolate(\n record.values[segment],\n record.values[segment + 1],\n easedProgress(record.easings[segment], (timing.progress - start) / (end - start), record.debugName),\n record.interpolate,\n record.debugName,\n );\n}\n\n/**\n * @internal Resolves activation-dependent definition data exactly once for a\n * track instance. Stateful definitions use a separate playback-owned record.\n */\nexport function activateSeekableDefinition<T>(\n definition: PibblAnimationDefinition<T>,\n initialValue: T,\n seen: WeakMap<object, unknown> = new WeakMap(),\n): SeekableDefinitionActivation<T> {\n const definitionRecord = getDefinitionRecord(definition);\n if (definitionRecord.kind === 'stepper') {\n throw new TypeError(\n 'Stateful animation definitions require the stateful program evaluator.',\n );\n }\n const snapshot = snapshotAnimationActivationValue(initialValue, seen);\n const resolved = definitionRecord.kind === 'spring' ?\n resolveSpringStart(definitionRecord, snapshot as number) : definitionRecord;\n const activation = Object.freeze({\n duration: resolved.duration,\n initialValue: snapshot,\n }) as SeekableDefinitionActivation<T>;\n seekableActivationRecords.set(\n activation as SeekableDefinitionActivation<unknown>,\n Object.freeze({\n definition,\n definitionRecord: resolved,\n initialValue: snapshot,\n }) as SeekableDefinitionActivationRecord<unknown>,\n );\n return activation;\n}\n\n/** @internal Samples a definition from one retained activation record. */\nexport function sampleActivatedSeekableDefinition<T>(\n activation: SeekableDefinitionActivation<T>,\n localTime: number,\n): T {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n const timing = sampledProgress(record.duration, localTime);\n return sampleSpring(record, timing.localTime / 1000).position as T;\n }\n return sampleSeekableDefinition(activationRecord.definition, {\n initialValue: activationRecord.initialValue,\n localTime,\n });\n}\n\n/**\n * @internal Returns a boundary value only when the normalized definition makes\n * it exact without invoking user easing, interpolation, or sampling callbacks.\n */\nexport function getSeekableDefinitionBoundaryValue<T>(\n activation: SeekableDefinitionActivation<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const activationRecord = seekableActivationRecords.get(\n activation as SeekableDefinitionActivation<unknown>,\n ) as SeekableDefinitionActivationRecord<T> | undefined;\n if (activationRecord === undefined) {\n throw new TypeError('Expected a seekable Pibbl animation definition activation.');\n }\n const record = activationRecord.definitionRecord;\n if (record.kind === 'spring') {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n return Object.freeze({ kind: 'unknown' as const });\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n return Object.freeze({\n kind: 'known' as const,\n value: boundary === 'start' ?\n (record.hasFrom ? record.from as T : activationRecord.initialValue) : record.to,\n });\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n\n/**\n * @internal Returns a callback-free boundary that does not depend on a track's\n * activation value. This lets discovery recover known terminal state after an\n * earlier opaque custom value.\n */\nexport function getStaticSeekableDefinitionBoundaryValue<T>(\n definition: PibblAnimationDefinition<T>,\n boundary: 'start' | 'end',\n): SeekableDefinitionBoundaryValue<T> {\n const record = getDefinitionRecord(definition);\n if (record.kind === 'spring' && record.hasFrom) {\n return Object.freeze({\n kind: 'known' as const,\n value: (boundary === 'start' ? record.from : record.to) as T,\n });\n }\n if (record.kind === 'keyframes') {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.values.at(-1)! });\n }\n if (record.interpolate === undefined && record.easings[0] === easing.linear) {\n return Object.freeze({ kind: 'known' as const, value: record.values[0]! });\n }\n }\n if (record.kind === 'tween' && record.interpolate === undefined &&\n record.easing === easing.linear) {\n if (boundary === 'end') {\n return Object.freeze({ kind: 'known' as const, value: record.to });\n }\n if (record.hasFrom) {\n return Object.freeze({ kind: 'known' as const, value: record.from as T });\n }\n }\n return Object.freeze({ kind: 'unknown' as const });\n}\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC;AACzC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA8EP,MAAM,oBAAoB,oBAAI,QAG5B;AAEF,MAAM,iBAAiB,oBAAI,QAGxB;AAEH,SAAS,iBACP,YACA,SACA,MAC6B;AAC7B,iBAAe,IAAI,YAAY,EAAE,SAAS,KAAK,CAAC;AAChD,SAAO;AACT;AAGO,SAAS,oBACd,YACA,QAC6B;AAC7B,QAAM,UAAU,eAAe,IAAI,UAAU;AAC7C,MAAI,QAAS,QAAO,QAA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AM,SAAkB,OAAO,OAAO,OAAO,CAAC,EAAG,CAAC;AAAA,IAC3E;AAAA,EACF;AACA,MAAI,OAAO,SAAS,WAAW,OAAO,gBAAgB,UACpD,OAAO,WAAW,OAAO,QAAQ;AACjC,QAAI,aAAa,OAAO;AACtB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,GAAG,CAAC;AAAA,IACnE;AACA,QAAI,OAAO,SAAS;AAClB,aAAO,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,OAAO,KAAU,CAAC;AAAA,IAC1E;AAAA,EACF;AACA,SAAO,OAAO,OAAO,EAAE,MAAM,UAAmB,CAAC;AACnD;",
6
6
  "names": ["snapshot", "callback", "ease", "timing"]
7
7
  }
@@ -8,11 +8,18 @@ export interface AnimationPlaybackSnapshot {
8
8
  readonly queuedMilestones: number;
9
9
  readonly outputStageAttempts: number;
10
10
  }
11
+ /** Internal root lifetime used to revoke a deferred disposal publication. */
12
+ interface DeferredStatusCommandOwner {
13
+ add(teardown: () => void): void;
14
+ remove(teardown: () => void): void;
15
+ }
11
16
  export interface AnimationPlaybackController {
12
17
  readonly handle: PibblPlayback;
13
18
  adopt(program: PibblAnimationProgram, options?: PibblPlaybackOptions): void;
14
19
  committedSpringSnapshot(): SpringSample | undefined;
15
20
  retarget(program: PibblAnimationProgram, options?: PibblPlaybackOptions): void;
21
+ /** @internal Associates render-phase disposal work with the owning root. */
22
+ setDeferredStatusCommandOwner(owner: DeferredStatusCommandOwner): void;
16
23
  dispose(): void;
17
24
  }
18
25
  export interface AnimationPlaybackCandidate {
@@ -28,3 +35,4 @@ export declare function normalizeAnimationPlaybackCandidate(program: PibblAnimat
28
35
  * usePlayback in the following implementation task.
29
36
  */
30
37
  export declare function createAnimationPlaybackController(initialProgram: PibblAnimationProgram, initialOptions?: PibblPlaybackOptions): AnimationPlaybackController;
38
+ export {};
@@ -123,6 +123,7 @@ function createAnimationPlaybackController(initialProgram, initialOptions = {})
123
123
  let storedPlaybackRate = 1;
124
124
  let delivery;
125
125
  let pendingRetarget;
126
+ let deferredStatusCommandOwner;
126
127
  const pendingCommands = /* @__PURE__ */ new Set();
127
128
  const metadataWriter = Object.freeze({ name: "Pibbl playback metadata" });
128
129
  const status = signal("idle", {
@@ -706,6 +707,34 @@ function createAnimationPlaybackController(initialProgram, initialOptions = {})
706
707
  pendingCommands.add(commandHandle);
707
708
  return commandHandle;
708
709
  }
710
+ function stageDisposedAfterRender() {
711
+ let command;
712
+ let revokeFromOwner;
713
+ command = queueBeginCommand((snapshot, batch) => {
714
+ try {
715
+ batch.stage(status, "disposed", metadataWriter);
716
+ recordSchedulerTrace({
717
+ kind: "animation-write",
718
+ frameId: snapshot.frameId,
719
+ logicalTime: snapshot.logicalTime,
720
+ debugName: debugName(),
721
+ target: "status",
722
+ outcome: "staged"
723
+ });
724
+ } finally {
725
+ revokeFromOwner?.();
726
+ }
727
+ });
728
+ const owner = deferredStatusCommandOwner;
729
+ if (owner === void 0) return;
730
+ const revoke = () => {
731
+ command.cancel();
732
+ const phase = snapshotRealmScheduler().phase;
733
+ if (phase !== "advance" && phase !== "render") status.set("disposed");
734
+ };
735
+ revokeFromOwner = () => owner.remove(revoke);
736
+ owner.add(revoke);
737
+ }
709
738
  function acceptCommandWithoutTrace(command, generation, snapshot, batch, argument) {
710
739
  if (command === "play") {
711
740
  acceptPlay(generation, argument, snapshot, batch);
@@ -888,6 +917,9 @@ function createAnimationPlaybackController(initialProgram, initialOptions = {})
888
917
  const generation = ++queuedGeneration;
889
918
  pendingRetarget = enqueue("play", generation, "replace");
890
919
  },
920
+ setDeferredStatusCommandOwner(owner) {
921
+ deferredStatusCommandOwner = owner;
922
+ },
891
923
  dispose() {
892
924
  if (disposed) return;
893
925
  disposed = true;
@@ -909,17 +941,7 @@ function createAnimationPlaybackController(initialProgram, initialOptions = {})
909
941
  if (schedulerPhase !== "advance" && schedulerPhase !== "render") {
910
942
  status.set("disposed");
911
943
  } else {
912
- queueBeginCommand((snapshot, batch) => {
913
- batch.stage(status, "disposed", metadataWriter);
914
- recordSchedulerTrace({
915
- kind: "animation-write",
916
- frameId: snapshot.frameId,
917
- logicalTime: snapshot.logicalTime,
918
- debugName: debugName(),
919
- target: "status",
920
- outcome: "staged"
921
- });
922
- });
944
+ stageDisposedAfterRender();
923
945
  }
924
946
  }
925
947
  });