@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
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pibbl/core
2
2
 
3
- > **ALPHA — NOT FOR PRODUCTION USE.** Pibbl 0.0.1 is experimental. APIs may change or be removed without notice. Use it only for evaluation and experimentation.
3
+ > **ALPHA — NOT FOR PRODUCTION USE.** Pibbl 0.0.2 is experimental. APIs may change or be removed without notice. Use it only for evaluation and experimentation.
4
4
 
5
5
  The ESM Canvas 2D component runtime for Pibbl, with an automatic JSX runtime and
6
6
  an equivalent `createElement` API. It has no React dependency. Drawing stays on
@@ -203,3 +203,84 @@ License: Apache-2.0
203
203
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204
204
  See the License for the specific language governing permissions and
205
205
  limitations under the License.
206
+
207
+
208
+ Recording/GIF WASM dependency: gif-0.14.1
209
+ Source: https://github.com/image-rs/image-gif
210
+ License: MIT
211
+
212
+ The MIT License (MIT)
213
+
214
+ Copyright (c) 2015 nwin
215
+
216
+ Permission is hereby granted, free of charge, to any person obtaining a copy
217
+ of this software and associated documentation files (the "Software"), to deal
218
+ in the Software without restriction, including without limitation the rights
219
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
220
+ copies of the Software, and to permit persons to whom the Software is
221
+ furnished to do so, subject to the following conditions:
222
+
223
+ The above copyright notice and this permission notice shall be included in all
224
+ copies or substantial portions of the Software.
225
+
226
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
227
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
228
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
229
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
230
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
231
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
232
+ SOFTWARE.
233
+
234
+
235
+ Recording/GIF WASM dependency: color_quant-1.1.0
236
+ Source: https://github.com/image-rs/color_quant
237
+ License: MIT
238
+
239
+ The MIT License (MIT)
240
+
241
+ Copyright (c) 2016 PistonDevelopers
242
+
243
+ Permission is hereby granted, free of charge, to any person obtaining a copy
244
+ of this software and associated documentation files (the "Software"), to deal
245
+ in the Software without restriction, including without limitation the rights
246
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
247
+ copies of the Software, and to permit persons to whom the Software is
248
+ furnished to do so, subject to the following conditions:
249
+
250
+ The above copyright notice and this permission notice shall be included in all
251
+ copies or substantial portions of the Software.
252
+
253
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
254
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
255
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
256
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
257
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
258
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
259
+ SOFTWARE.
260
+
261
+
262
+ Recording/GIF WASM dependency: weezl-0.1.12
263
+ Source: https://github.com/image-rs/weezl
264
+ License: MIT
265
+
266
+ The MIT License (MIT)
267
+
268
+ Copyright (c) HeroicKatora 2020
269
+
270
+ Permission is hereby granted, free of charge, to any person obtaining a copy
271
+ of this software and associated documentation files (the "Software"), to deal
272
+ in the Software without restriction, including without limitation the rights
273
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
274
+ copies of the Software, and to permit persons to whom the Software is
275
+ furnished to do so, subject to the following conditions:
276
+
277
+ The above copyright notice and this permission notice shall be included in all
278
+ copies or substantial portions of the Software.
279
+
280
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
281
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
282
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
283
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
284
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
285
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
286
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ import type { PibblAnimationProgram, PibblPlaybackOptions } from '../../lib/animation/types.js';
2
+ import type { MachineTask, MachineTaskContext, MachineEvent } from './types.js';
3
+ /**
4
+ * Playback options owned by a machine animation task.
5
+ *
6
+ * Lifecycle callbacks are deliberately omitted: task completion and failure
7
+ * become the invocation's `onDone` and `onError` transitions instead.
8
+ *
9
+ * @see {@link playAnimation}
10
+ */
11
+ export interface MachineAnimationOptions {
12
+ /**
13
+ * Selects the existing writer-conflict policy for this state-owned playback.
14
+ * Defaults to the animation runtime's explicit-error policy.
15
+ */
16
+ readonly conflict?: PibblPlaybackOptions['conflict'];
17
+ /** Optional label included in animation scheduler diagnostics. */
18
+ readonly debugName?: string;
19
+ }
20
+ /**
21
+ * Builds the animation program for one state entry.
22
+ *
23
+ * The callback runs once when the invocation starts. It receives the entry's
24
+ * immutable context and event, the machine input, the cancellation signal, and
25
+ * `send` for application-defined machine events.
26
+ *
27
+ * @typeParam Context - Context captured when this state entry began.
28
+ * @typeParam Event - Event type accepted by the owning machine.
29
+ * @typeParam Input - Input captured by the owning machine actor.
30
+ * @param context - Immutable state-entry values used to create this program.
31
+ * @returns The program that the machine invocation owns until it finishes or is cancelled.
32
+ * @see {@link MachineTaskContext}
33
+ */
34
+ export type MachineAnimationProgramFactory<Context, Event extends MachineEvent, Input> = (context: MachineTaskContext<Context, Event, Input>) => PibblAnimationProgram;
35
+ /**
36
+ * Adapts a Pibbl animation program into state-owned cancelable machine work.
37
+ *
38
+ * A finite program resolves the state invocation after the animation scheduler
39
+ * delivers its `finish` event, allowing the invocation's `onDone` transition to
40
+ * run. Repeating programs remain active until their state exits or the actor
41
+ * stops. Cancellation disposes only this adapter's playback and never sends a
42
+ * completion or error transition.
43
+ *
44
+ * @typeParam Context - Context captured when this state entry began.
45
+ * @typeParam Event - Event type accepted by the owning machine.
46
+ * @typeParam Input - Input captured by the owning machine actor.
47
+ * @param program - Factory that creates the program for this state entry.
48
+ * @param options - Playback conflict policy and diagnostic label.
49
+ * @returns A task suitable for a state's `invoke.task` field.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * running: {
54
+ * invoke: {
55
+ * task: playAnimation(({ input }) =>
56
+ * repeat(drive(input.frame, input.animations.run), { iterations: Infinity }),
57
+ * ),
58
+ * },
59
+ * }
60
+ * ```
61
+ *
62
+ * @see {@link MachineAnimationOptions}
63
+ */
64
+ export declare function playAnimation<Context, Event extends MachineEvent, Input>(program: MachineAnimationProgramFactory<Context, Event, Input>, options?: MachineAnimationOptions): MachineTask<Context, Event, Input, void>;
@@ -0,0 +1,55 @@
1
+ import {
2
+ createAnimationPlaybackController
3
+ } from "../../lib/animation/playback.js";
4
+ function playAnimation(program, options = {}) {
5
+ return (taskContext) => {
6
+ if (taskContext.signal.aborted) return;
7
+ const animation = program(taskContext);
8
+ return new Promise((resolve, reject) => {
9
+ let settled = false;
10
+ let controller;
11
+ controller = createAnimationPlaybackController(animation, {
12
+ conflict: options.conflict,
13
+ debugName: options.debugName,
14
+ onEvent(event) {
15
+ if (event.type !== "finish" || settled) return;
16
+ settled = true;
17
+ detachAbort();
18
+ controller.dispose();
19
+ resolve();
20
+ },
21
+ onError(error) {
22
+ if (settled) return;
23
+ settled = true;
24
+ detachAbort();
25
+ controller.dispose();
26
+ reject(error);
27
+ }
28
+ });
29
+ const abort = () => {
30
+ if (settled) return;
31
+ settled = true;
32
+ detachAbort();
33
+ controller.dispose();
34
+ };
35
+ const detachAbort = () => {
36
+ taskContext.signal.removeEventListener("abort", abort);
37
+ };
38
+ taskContext.signal.addEventListener("abort", abort, { once: true });
39
+ if (taskContext.signal.aborted) {
40
+ abort();
41
+ return;
42
+ }
43
+ try {
44
+ controller.handle.play();
45
+ } catch (error) {
46
+ abort();
47
+ reject(error);
48
+ }
49
+ });
50
+ };
51
+ }
52
+ export {
53
+ playAnimation
54
+ };
55
+ //# sourceMappingURL=animation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/machines/animation.ts"],
4
+ "sourcesContent": ["import {\n createAnimationPlaybackController,\n type AnimationPlaybackController,\n} from '../../lib/animation/playback.js';\nimport type {\n PibblAnimationProgram,\n PibblPlaybackOptions,\n} from '../../lib/animation/types.js';\nimport type {\n MachineTask,\n MachineTaskContext,\n MachineEvent,\n} from './types.js';\n\n/**\n * Playback options owned by a machine animation task.\n *\n * Lifecycle callbacks are deliberately omitted: task completion and failure\n * become the invocation's `onDone` and `onError` transitions instead.\n *\n * @see {@link playAnimation}\n */\nexport interface MachineAnimationOptions {\n /**\n * Selects the existing writer-conflict policy for this state-owned playback.\n * Defaults to the animation runtime's explicit-error policy.\n */\n readonly conflict?: PibblPlaybackOptions['conflict'];\n /** Optional label included in animation scheduler diagnostics. */\n readonly debugName?: string;\n}\n\n/**\n * Builds the animation program for one state entry.\n *\n * The callback runs once when the invocation starts. It receives the entry's\n * immutable context and event, the machine input, the cancellation signal, and\n * `send` for application-defined machine events.\n *\n * @typeParam Context - Context captured when this state entry began.\n * @typeParam Event - Event type accepted by the owning machine.\n * @typeParam Input - Input captured by the owning machine actor.\n * @param context - Immutable state-entry values used to create this program.\n * @returns The program that the machine invocation owns until it finishes or is cancelled.\n * @see {@link MachineTaskContext}\n */\nexport type MachineAnimationProgramFactory<Context, Event extends MachineEvent, Input> = (\n context: MachineTaskContext<Context, Event, Input>,\n) => PibblAnimationProgram;\n\n/**\n * Adapts a Pibbl animation program into state-owned cancelable machine work.\n *\n * A finite program resolves the state invocation after the animation scheduler\n * delivers its `finish` event, allowing the invocation's `onDone` transition to\n * run. Repeating programs remain active until their state exits or the actor\n * stops. Cancellation disposes only this adapter's playback and never sends a\n * completion or error transition.\n *\n * @typeParam Context - Context captured when this state entry began.\n * @typeParam Event - Event type accepted by the owning machine.\n * @typeParam Input - Input captured by the owning machine actor.\n * @param program - Factory that creates the program for this state entry.\n * @param options - Playback conflict policy and diagnostic label.\n * @returns A task suitable for a state's `invoke.task` field.\n *\n * @example\n * ```ts\n * running: {\n * invoke: {\n * task: playAnimation(({ input }) =>\n * repeat(drive(input.frame, input.animations.run), { iterations: Infinity }),\n * ),\n * },\n * }\n * ```\n *\n * @see {@link MachineAnimationOptions}\n */\nexport function playAnimation<Context, Event extends MachineEvent, Input>(\n program: MachineAnimationProgramFactory<Context, Event, Input>,\n options: MachineAnimationOptions = {},\n): MachineTask<Context, Event, Input, void> {\n return taskContext => {\n if (taskContext.signal.aborted) return;\n\n const animation = program(taskContext);\n return new Promise<void>((resolve, reject) => {\n let settled = false;\n let controller!: AnimationPlaybackController;\n controller = createAnimationPlaybackController(animation, {\n conflict: options.conflict,\n debugName: options.debugName,\n onEvent(event): void {\n if (event.type !== 'finish' || settled) return;\n settled = true;\n detachAbort();\n controller.dispose();\n resolve();\n },\n onError(error): void {\n if (settled) return;\n settled = true;\n detachAbort();\n controller.dispose();\n reject(error);\n },\n });\n\n const abort = (): void => {\n if (settled) return;\n settled = true;\n detachAbort();\n controller.dispose();\n };\n const detachAbort = (): void => {\n taskContext.signal.removeEventListener('abort', abort);\n };\n\n taskContext.signal.addEventListener('abort', abort, { once: true });\n if (taskContext.signal.aborted) {\n abort();\n return;\n }\n try {\n controller.handle.play();\n } catch (error) {\n abort();\n reject(error);\n }\n });\n };\n}\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAEK;AA4EA,SAAS,cACd,SACA,UAAmC,CAAC,GACM;AAC1C,SAAO,iBAAe;AACpB,QAAI,YAAY,OAAO,QAAS;AAEhC,UAAM,YAAY,QAAQ,WAAW;AACrC,WAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,UAAI,UAAU;AACd,UAAI;AACJ,mBAAa,kCAAkC,WAAW;AAAA,QACxD,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,QAAQ,OAAa;AACnB,cAAI,MAAM,SAAS,YAAY,QAAS;AACxC,oBAAU;AACV,sBAAY;AACZ,qBAAW,QAAQ;AACnB,kBAAQ;AAAA,QACV;AAAA,QACA,QAAQ,OAAa;AACnB,cAAI,QAAS;AACb,oBAAU;AACV,sBAAY;AACZ,qBAAW,QAAQ;AACnB,iBAAO,KAAK;AAAA,QACd;AAAA,MACF,CAAC;AAED,YAAM,QAAQ,MAAY;AACxB,YAAI,QAAS;AACb,kBAAU;AACV,oBAAY;AACZ,mBAAW,QAAQ;AAAA,MACrB;AACA,YAAM,cAAc,MAAY;AAC9B,oBAAY,OAAO,oBAAoB,SAAS,KAAK;AAAA,MACvD;AAEA,kBAAY,OAAO,iBAAiB,SAAS,OAAO,EAAE,MAAM,KAAK,CAAC;AAClE,UAAI,YAAY,OAAO,SAAS;AAC9B,cAAM;AACN;AAAA,MACF;AACA,UAAI;AACF,mBAAW,OAAO,KAAK;AAAA,MACzB,SAAS,OAAO;AACd,cAAM;AACN,eAAO,KAAK;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './animation.js';
@@ -0,0 +1,16 @@
1
+ import type { MachineAction, MachineActionContext, MachineEvent } from './types.js';
2
+ /** @internal Returns the context patch represented by an assign action. */
3
+ export declare function assignmentOf(action: Function): ((context: MachineActionContext<object, MachineEvent, unknown>) => object) | undefined;
4
+ /**
5
+ * Creates an action that shallowly merges a context patch. Earlier assignments in the same
6
+ * transition are visible to later actions. Context itself remains application-owned data.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const collect = assign(({ context }) => ({ coins: context.coins + 1 }));
11
+ * ```
12
+ * @param update - Produces the shallow context patch for this transition.
13
+ * @returns An action accepted by state entry, exit, and transition action lists.
14
+ * @see {@link MachineAction}
15
+ */
16
+ export declare function assign<Context extends object, Event extends MachineEvent, Input>(update: (context: MachineActionContext<Context, Event, Input>) => Partial<Context>): MachineAction<Context, Event, Input>;
@@ -0,0 +1,15 @@
1
+ const assignments = /* @__PURE__ */ new WeakMap();
2
+ function assignmentOf(action) {
3
+ return assignments.get(action);
4
+ }
5
+ function assign(update) {
6
+ const action = () => {
7
+ };
8
+ assignments.set(action, update);
9
+ return action;
10
+ }
11
+ export {
12
+ assign,
13
+ assignmentOf
14
+ };
15
+ //# sourceMappingURL=assign.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/machines/assign.ts"],
4
+ "sourcesContent": ["import type { MachineAction, MachineActionContext, MachineEvent } from './types.js';\n\nconst assignments = new WeakMap<Function, (context: MachineActionContext<object, MachineEvent, unknown>) => object>();\n\n/** @internal Returns the context patch represented by an assign action. */\nexport function assignmentOf(action: Function): ((context: MachineActionContext<object, MachineEvent, unknown>) => object) | undefined {\n return assignments.get(action);\n}\n\n/**\n * Creates an action that shallowly merges a context patch. Earlier assignments in the same\n * transition are visible to later actions. Context itself remains application-owned data.\n *\n * @example\n * ```ts\n * const collect = assign(({ context }) => ({ coins: context.coins + 1 }));\n * ```\n * @param update - Produces the shallow context patch for this transition.\n * @returns An action accepted by state entry, exit, and transition action lists.\n * @see {@link MachineAction}\n */\nexport function assign<Context extends object, Event extends MachineEvent, Input>(\n update: (context: MachineActionContext<Context, Event, Input>) => Partial<Context>,\n): MachineAction<Context, Event, Input> {\n const action: MachineAction<Context, Event, Input> = () => {};\n assignments.set(action, update as unknown as (context: MachineActionContext<object, MachineEvent, unknown>) => object);\n return action;\n}\n"],
5
+ "mappings": "AAEA,MAAM,cAAc,oBAAI,QAA4F;AAG7G,SAAS,aAAa,QAA0G;AACrI,SAAO,YAAY,IAAI,MAAM;AAC/B;AAcO,SAAS,OACd,QACsC;AACtC,QAAM,SAA+C,MAAM;AAAA,EAAC;AAC5D,cAAY,IAAI,QAAQ,MAA6F;AACrH,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import type { MachineEvent, MachineTask } from './types.js';
2
+ /**
3
+ * Marks callback-style cancelable work as a machine task. The callback may return a cleanup;
4
+ * its cleanup runs exactly once when the owning state exits or the actor stops.
5
+ * @param callback - Callback task to retain as state-owned work.
6
+ * @returns The same callback, typed for an invocation's `task` field.
7
+ * @see {@link MachineTask}
8
+ */
9
+ export declare function fromCallback<Context, Event extends MachineEvent, Input>(callback: MachineTask<Context, Event, Input>): MachineTask<Context, Event, Input>;
@@ -0,0 +1,7 @@
1
+ function fromCallback(callback) {
2
+ return callback;
3
+ }
4
+ export {
5
+ fromCallback
6
+ };
7
+ //# sourceMappingURL=callback.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/machines/callback.ts"],
4
+ "sourcesContent": ["import type { MachineEvent, MachineTask } from './types.js';\n\n/**\n * Marks callback-style cancelable work as a machine task. The callback may return a cleanup;\n * its cleanup runs exactly once when the owning state exits or the actor stops.\n * @param callback - Callback task to retain as state-owned work.\n * @returns The same callback, typed for an invocation's `task` field.\n * @see {@link MachineTask}\n */\nexport function fromCallback<Context, Event extends MachineEvent, Input>(\n callback: MachineTask<Context, Event, Input>,\n): MachineTask<Context, Event, Input> {\n return callback;\n}\n"],
5
+ "mappings": "AASO,SAAS,aACd,UACoC;AACpC,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,30 @@
1
+ import type { createMachine } from "./runtime.js";
2
+ import type { MachineActor, MachineDefinition, MachineEvent } from './types.js';
3
+ /**
4
+ * Creates one component-owned state-machine actor for a hook slot.
5
+ *
6
+ * The actor starts only after its mounting render commits successfully and stops
7
+ * when the component unmounts. Its input is captured on the initial mount;
8
+ * changing an input object on a later render does not recreate or restart the
9
+ * actor. Use machine events for application state changes.
10
+ *
11
+ * @typeParam Context - Immutable machine context carried by each snapshot.
12
+ * @typeParam Event - Events accepted by the machine actor.
13
+ * @typeParam Input - Immutable input captured when this hook slot mounts.
14
+ * @param definition - Immutable machine behavior shared by all actor instances.
15
+ * @param options - Input used to initialize this mounted actor.
16
+ * @returns A stable actor with a readonly reactive snapshot.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * const actor = useMachine(menuMachine, { input: { initialOpen: false } });
21
+ * const open = () => actor.send({ type: 'OPEN' });
22
+ * return <Text>{actor.snapshot.get().value}</Text>;
23
+ * ```
24
+ *
25
+ * @see {@link createMachine}
26
+ * @see {@link MachineActor}
27
+ */
28
+ export declare function useMachine<Context, Event extends MachineEvent, Input, State extends string>(definition: MachineDefinition<Context, Event, Input, State>, options: {
29
+ readonly input: Input;
30
+ }): MachineActor<Context, Event, Input, State>;
@@ -0,0 +1,37 @@
1
+ import { GLOBAL_STATE } from "../../lib/global-state.js";
2
+ import { requireHookContext, useHookSlot } from "../../lib/hooks/hook-slot.js";
3
+ import { createMachine } from "./runtime.js";
4
+ function isCurrentSlot(slot) {
5
+ return !slot.componentRefs.teardowns.closed && !slot.pibblInstance.mainTeardowns.closed && GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance && slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;
6
+ }
7
+ function useMachine(definition, options) {
8
+ const { componentRefs, pibblInstance } = requireHookContext();
9
+ const slot = useHookSlot(
10
+ "machine",
11
+ (teardowns) => {
12
+ const actor = createMachine(definition, options);
13
+ const value = {
14
+ actor,
15
+ componentRefs,
16
+ pibblInstance,
17
+ started: false
18
+ };
19
+ teardowns.add(() => actor.stop());
20
+ return value;
21
+ }
22
+ ).value;
23
+ const transaction = GLOBAL_STATE.renderTransaction;
24
+ if (!transaction) {
25
+ throw new Error("useMachine requires an active Pibbl render transaction.");
26
+ }
27
+ transaction.onFinish((success) => {
28
+ if (!success || slot.started || !isCurrentSlot(slot)) return;
29
+ slot.started = true;
30
+ slot.actor.start();
31
+ });
32
+ return slot.actor;
33
+ }
34
+ export {
35
+ useMachine
36
+ };
37
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/machines/hook.ts"],
4
+ "sourcesContent": ["import { GLOBAL_STATE } from '../../lib/global-state.js';\nimport type { PibblComponentRefs, PibblInstance } from '../../lib/types.js';\nimport { requireHookContext, useHookSlot } from '../../lib/hooks/hook-slot.js';\nimport { createMachine } from './runtime.js';\nimport type {\n MachineActor,\n MachineDefinition,\n MachineEvent,\n} from './types.js';\n\ninterface MachineHookSlot<Context, Event extends MachineEvent, Input, State extends string> {\n readonly actor: MachineActor<Context, Event, Input, State>;\n readonly componentRefs: PibblComponentRefs<unknown>;\n readonly pibblInstance: PibblInstance;\n started: boolean;\n}\n\nfunction isCurrentSlot<Context, Event extends MachineEvent, Input, State extends string>(\n slot: MachineHookSlot<Context, Event, Input, State>,\n): boolean {\n return !slot.componentRefs.teardowns.closed &&\n !slot.pibblInstance.mainTeardowns.closed &&\n GLOBAL_STATE.pibblInstances.get(slot.pibblInstance.canvas) === slot.pibblInstance &&\n slot.pibblInstance.refs.get(slot.componentRefs.id) === slot.componentRefs;\n}\n\n/**\n * Creates one component-owned state-machine actor for a hook slot.\n *\n * The actor starts only after its mounting render commits successfully and stops\n * when the component unmounts. Its input is captured on the initial mount;\n * changing an input object on a later render does not recreate or restart the\n * actor. Use machine events for application state changes.\n *\n * @typeParam Context - Immutable machine context carried by each snapshot.\n * @typeParam Event - Events accepted by the machine actor.\n * @typeParam Input - Immutable input captured when this hook slot mounts.\n * @param definition - Immutable machine behavior shared by all actor instances.\n * @param options - Input used to initialize this mounted actor.\n * @returns A stable actor with a readonly reactive snapshot.\n *\n * @example\n * ```tsx\n * const actor = useMachine(menuMachine, { input: { initialOpen: false } });\n * const open = () => actor.send({ type: 'OPEN' });\n * return <Text>{actor.snapshot.get().value}</Text>;\n * ```\n *\n * @see {@link createMachine}\n * @see {@link MachineActor}\n */\nexport function useMachine<Context, Event extends MachineEvent, Input, State extends string>(\n definition: MachineDefinition<Context, Event, Input, State>,\n options: { readonly input: Input },\n): MachineActor<Context, Event, Input, State> {\n const { componentRefs, pibblInstance } = requireHookContext();\n\n const slot = useHookSlot<MachineHookSlot<Context, Event, Input, State>>(\n 'machine',\n teardowns => {\n const actor = createMachine(definition, options);\n const value: MachineHookSlot<Context, Event, Input, State> = {\n actor,\n componentRefs,\n pibblInstance,\n started: false,\n };\n teardowns.add(() => actor.stop());\n return value;\n },\n ).value;\n\n const transaction = GLOBAL_STATE.renderTransaction;\n if (!transaction) {\n throw new Error('useMachine requires an active Pibbl render transaction.');\n }\n transaction.onFinish(success => {\n if (!success || slot.started || !isCurrentSlot(slot)) return;\n slot.started = true;\n slot.actor.start();\n });\n return slot.actor;\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAE7B,SAAS,oBAAoB,mBAAmB;AAChD,SAAS,qBAAqB;AAc9B,SAAS,cACP,MACS;AACT,SAAO,CAAC,KAAK,cAAc,UAAU,UACnC,CAAC,KAAK,cAAc,cAAc,UAClC,aAAa,eAAe,IAAI,KAAK,cAAc,MAAM,MAAM,KAAK,iBACpE,KAAK,cAAc,KAAK,IAAI,KAAK,cAAc,EAAE,MAAM,KAAK;AAChE;AA2BO,SAAS,WACd,YACA,SAC4C;AAC5C,QAAM,EAAE,eAAe,cAAc,IAAI,mBAAmB;AAE5D,QAAM,OAAO;AAAA,IACX;AAAA,IACA,eAAa;AACX,YAAM,QAAQ,cAAc,YAAY,OAAO;AAC/C,YAAM,QAAuD;AAAA,QAC3D;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,MACX;AACA,gBAAU,IAAI,MAAM,MAAM,KAAK,CAAC;AAChC,aAAO;AAAA,IACT;AAAA,EACF,EAAE;AAEF,QAAM,cAAc,aAAa;AACjC,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AACA,cAAY,SAAS,aAAW;AAC9B,QAAI,CAAC,WAAW,KAAK,WAAW,CAAC,cAAc,IAAI,EAAG;AACtD,SAAK,UAAU;AACf,SAAK,MAAM,MAAM;AAAA,EACnB,CAAC;AACD,SAAO,KAAK;AACd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ /** General-purpose, signal-backed flat state machines. */
2
+ export { assign } from './assign.js';
3
+ export { fromCallback } from './callback.js';
4
+ export { createMachine, defineMachine } from './runtime.js';
5
+ export { useMachine } from './hook.js';
6
+ export type { CreateMachineOptions, MachineAction, MachineActionContext, MachineActions, MachineActor, MachineDefinition, MachineEvent, MachineEventRoutes, MachineInvocation, MachineSnapshot, MachineState, MachineStatus, MachineTask, MachineTaskCleanup, MachineTaskContext, MachineTaskDoneEvent, MachineTaskErrorEvent, MachineTransition, MachineTransitionConfig, } from './types.js';
@@ -0,0 +1,12 @@
1
+ import { assign } from "./assign.js";
2
+ import { fromCallback } from "./callback.js";
3
+ import { createMachine, defineMachine } from "./runtime.js";
4
+ import { useMachine } from "./hook.js";
5
+ export {
6
+ assign,
7
+ createMachine,
8
+ defineMachine,
9
+ fromCallback,
10
+ useMachine
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/machines/index.ts"],
4
+ "sourcesContent": ["/** General-purpose, signal-backed flat state machines. */\nexport { assign } from './assign.js';\nexport { fromCallback } from './callback.js';\nexport { createMachine, defineMachine } from './runtime.js';\nexport { useMachine } from './hook.js';\nexport type {\n CreateMachineOptions,\n MachineAction,\n MachineActionContext,\n MachineActions,\n MachineActor,\n MachineDefinition,\n MachineEvent,\n MachineEventRoutes,\n MachineInvocation,\n MachineSnapshot,\n MachineState,\n MachineStatus,\n MachineTask,\n MachineTaskCleanup,\n MachineTaskContext,\n MachineTaskDoneEvent,\n MachineTaskErrorEvent,\n MachineTransition,\n MachineTransitionConfig,\n} from './types.js';\n"],
5
+ "mappings": "AACA,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,eAAe,qBAAqB;AAC7C,SAAS,kBAAkB;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './index.js';
@@ -0,0 +1,18 @@
1
+ import type { CreateMachineOptions, MachineActor, MachineDefinition, MachineEvent } from './types.js';
2
+ /**
3
+ * Validates and records a reusable flat machine definition. Calling this function performs no
4
+ * work and creates no actor; use {@link createMachine} or `useMachine` to execute it.
5
+ * @param definition - Reusable machine behavior to validate and normalize.
6
+ * @returns The supplied definition, suitable for actor creation.
7
+ * @see {@link MachineDefinition}
8
+ */
9
+ export declare function defineMachine<Context, Event extends MachineEvent, Input = undefined, State extends string = string>(definition: MachineDefinition<Context, Event, Input, State>): MachineDefinition<Context, Event, Input, State>;
10
+ /**
11
+ * Creates an explicitly owned, initially idle machine actor. Call `start()` when ownership begins
12
+ * and `stop()` when it ends. The actor has no renderer, scheduler, or animation dependency.
13
+ * @param definition - Reusable behavior previously authored with {@link defineMachine}.
14
+ * @param options - Immutable input supplied to this actor.
15
+ * @returns An idle actor that owns no task until it starts.
16
+ * @see {@link MachineActor}
17
+ */
18
+ export declare function createMachine<Context, Event extends MachineEvent, Input, State extends string = string>(definition: MachineDefinition<Context, Event, Input, State>, options: CreateMachineOptions<Input>): MachineActor<Context, Event, Input, State>;