@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
@@ -19,6 +19,7 @@ export interface ReflectionSettings {
19
19
  readonly threshold: number;
20
20
  readonly softness: number;
21
21
  readonly direction: readonly [number, number];
22
+ readonly depth?: number;
22
23
  }
23
24
  export type ReflectionLight = {
24
25
  readonly color: string;
@@ -35,6 +36,7 @@ export interface ReflectionWarp {
35
36
  /** Optional synchronous image processor; scene pixels are never read back. */
36
37
  export declare class ReflectionGpu {
37
38
  private readonly callbacks;
39
+ private readonly fragment;
38
40
  private readonly canvas;
39
41
  private gl;
40
42
  private resources;
@@ -46,7 +48,7 @@ export declare class ReflectionGpu {
46
48
  private lost;
47
49
  private readonly onContextLost;
48
50
  private readonly onContextRestored;
49
- constructor(callbacks?: Readonly<ReflectionGpuCallbacks>);
51
+ constructor(callbacks?: Readonly<ReflectionGpuCallbacks>, fragment?: string);
50
52
  get isContextLost(): boolean;
51
53
  private acquireResources;
52
54
  apply(source: OffscreenCanvas, map: BorrowedTextureRaster, light: ReflectionLight, settings: ReflectionSettings, coordinates: ReflectionCoordinates, warp?: ReflectionWarp): ImageBitmap;
@@ -38,12 +38,14 @@ void main() {
38
38
  }
39
39
  `;
40
40
  class ReflectionGpu {
41
- constructor(callbacks = {}) {
41
+ constructor(callbacks = {}, fragment = fragmentSource) {
42
42
  this.callbacks = callbacks;
43
+ this.fragment = fragment;
43
44
  this.canvas.addEventListener("webglcontextlost", this.onContextLost);
44
45
  this.canvas.addEventListener("webglcontextrestored", this.onContextRestored);
45
46
  }
46
47
  callbacks;
48
+ fragment;
47
49
  canvas = new OffscreenCanvas(1, 1);
48
50
  gl;
49
51
  resources;
@@ -80,7 +82,7 @@ class ReflectionGpu {
80
82
  let fragment;
81
83
  let program = null;
82
84
  try {
83
- fragment = compile(gl, gl.FRAGMENT_SHADER, fragmentSource);
85
+ fragment = compile(gl, gl.FRAGMENT_SHADER, this.fragment);
84
86
  program = gl.createProgram();
85
87
  if (!program) throw new Error("Could not allocate reflection program.");
86
88
  gl.attachShader(program, vertex);
@@ -186,6 +188,7 @@ class ReflectionGpu {
186
188
  placement("warpOrigin", "warpSize", "warpRotation", warp?.map.placement ?? map.placement, warp?.region ?? coordinates.region, warp?.map.width ?? map.width, warp?.map.height ?? map.height);
187
189
  gl.uniform2f(uniform("warpStrength"), (warp?.strength ?? 0) * coordinates.density / source.width, (warp?.strength ?? 0) * coordinates.density / source.height);
188
190
  gl.uniform2f(uniform("direction"), settings.direction[0], settings.direction[1]);
191
+ gl.uniform1f(uniform("depth"), settings.depth ?? 0);
189
192
  gl.uniform1f(uniform("opacity"), settings.opacity);
190
193
  gl.uniform1f(uniform("threshold"), settings.threshold);
191
194
  gl.uniform1f(uniform("softness"), settings.softness);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/filters/reflection-gpu.ts"],
4
- "sourcesContent": ["import type { BorrowedTextureRaster, TexturePlacement } from '../lib/textures/texture-protocol.js';\n\nexport interface ReflectionCoordinates {\n readonly originX: number;\n readonly originY: number;\n readonly density: number;\n readonly region: Readonly<{ x: number; y: number; width: number; height: number }>;\n}\nexport interface ReflectionGpuCallbacks {\n readonly onContextLost?: () => void;\n readonly onContextRestored?: () => void;\n}\nconst vertexSource = `#version 300 es\nin vec2 p;\nout vec2 uv;\nvoid main() { uv = vec2((p.x + 1.) * .5, 1. - (p.y + 1.) * .5); gl_Position = vec4(p, 0, 1); }\n`;\nexport interface ReflectionSettings {\n readonly opacity: number; readonly threshold: number; readonly softness: number;\n readonly direction: readonly [number, number];\n}\nexport type ReflectionLight = { readonly color: string } | { readonly image: HTMLImageElement | ImageBitmap } | { readonly raster: BorrowedTextureRaster };\nexport interface ReflectionWarp { readonly map: BorrowedTextureRaster; readonly strength: number; readonly region: ReflectionCoordinates['region']; }\nconst fragmentSource = `#version 300 es\nprecision highp float;\nuniform sampler2D scene, map, lightMap, warpMap;\nuniform vec2 logicalOrigin, logicalSize, mapOrigin, tileSize, lightOrigin, lightSize, warpOrigin, warpSize, warpStrength, direction;\nuniform float rotation, lightRotation, warpRotation, opacity, threshold, softness;\nin vec2 uv;\nout vec4 outputColor;\nfloat decode(float c) { float b=c*255.; return (b-128.)/(b<128.?128.:127.); }\nvec2 coordinates(vec2 origin, vec2 size, float angle) {\n vec2 p=logicalOrigin+uv*logicalSize-origin;\n float c=cos(angle),s=sin(angle);\n return vec2(c*p.x+s*p.y,-s*p.x+c*p.y)/size;\n}\nvec4 sourcePixel(ivec2 p) {\n ivec2 size=textureSize(scene,0);\n if(any(lessThan(p,ivec2(0)))||any(greaterThanEqual(p,size))) return vec4(0);\n return texelFetch(scene,p,0);\n}\nvec4 sourceSample(vec2 p) {\n vec2 pixel=p*vec2(textureSize(scene,0))-.5;\n ivec2 base=ivec2(floor(pixel)); vec2 f=fract(pixel);\n return mix(mix(sourcePixel(base),sourcePixel(base+ivec2(1,0)),f.x),mix(sourcePixel(base+ivec2(0,1)),sourcePixel(base+ivec2(1,1)),f.x),f.y);\n}\nvoid main() {\n vec4 warp=texture(warpMap,coordinates(warpOrigin,warpSize,warpRotation));\n vec4 base=sourceSample(uv+vec2(decode(warp.r),decode(warp.g))*warp.a*warpStrength);\n vec4 field=texture(map,coordinates(mapOrigin,tileSize,rotation));\n vec2 slope=vec2(decode(field.r),decode(field.g));\n float coverage=smoothstep(threshold,threshold+softness,dot(slope,direction))*field.a*opacity;\n vec4 light=texture(lightMap,coordinates(lightOrigin,lightSize,lightRotation)+slope*.035);\n float amount=coverage*light.a;\n outputColor=vec4(base.rgb*(1.-amount)+base.a*light.rgb*amount,base.a);\n}\n`;\n\n/** Optional synchronous image processor; scene pixels are never read back. */\nexport class ReflectionGpu {\n private readonly canvas = new OffscreenCanvas(1, 1);\n private gl: WebGL2RenderingContext | undefined;\n private resources: ReflectionResources | undefined;\n private readonly maps = new Map<object, { texture: WebGLTexture; revision: number }>();\n private readonly directKey = {};\n private colorCanvas: OffscreenCanvas | undefined;\n private directRevision = 0;\n private disposed = false;\n private lost = false;\n private readonly onContextLost = (event: Event): void => {\n event.preventDefault();\n if (this.disposed || this.lost) return;\n this.lost = true;\n this.releaseResources(false);\n this.callbacks.onContextLost?.();\n };\n private readonly onContextRestored = (): void => {\n if (this.disposed || !this.lost) return;\n this.lost = false;\n this.callbacks.onContextRestored?.();\n };\n\n constructor(private readonly callbacks: Readonly<ReflectionGpuCallbacks> = {}) {\n this.canvas.addEventListener('webglcontextlost', this.onContextLost);\n this.canvas.addEventListener('webglcontextrestored', this.onContextRestored);\n }\n\n get isContextLost(): boolean {\n return this.lost || this.gl?.isContextLost() === true;\n }\n\n private acquireResources(): ReflectionResources {\n if (this.disposed) throw new Error('Cannot use a disposed reflection processor.');\n if (this.isContextLost) throw new Error('Reflection WebGL2 context was lost.');\n if (this.resources) return this.resources;\n const gl = this.canvas.getContext('webgl2', { premultipliedAlpha: true, preserveDrawingBuffer: false });\n if (!gl) throw new Error('Reflection requires OffscreenCanvas WebGL2 support.');\n if (gl.isContextLost()) throw new Error('Reflection WebGL2 context was lost.');\n this.gl = gl;\n const vertex = compile(gl, gl.VERTEX_SHADER, vertexSource);\n let fragment: WebGLShader | undefined;\n let program: WebGLProgram | null = null;\n try {\n fragment = compile(gl, gl.FRAGMENT_SHADER, fragmentSource);\n program = gl.createProgram();\n if (!program) throw new Error('Could not allocate reflection program.');\n gl.attachShader(program, vertex); gl.attachShader(program, fragment); gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) throw new Error(`Reflection shader link failed: ${gl.getProgramInfoLog(program)}`);\n } catch (error) { if (program) gl.deleteProgram(program); throw error; }\n finally { gl.deleteShader(vertex); if (fragment) gl.deleteShader(fragment); }\n const vao = gl.createVertexArray(), buffer = gl.createBuffer();\n if (!vao || !buffer) { if (vao) gl.deleteVertexArray(vao); if (buffer) gl.deleteBuffer(buffer); gl.deleteProgram(program); throw new Error('Could not allocate reflection geometry.'); }\n gl.bindVertexArray(vao); gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n const location = gl.getAttribLocation(program, 'p');\n gl.enableVertexAttribArray(location); gl.vertexAttribPointer(location, 2, gl.FLOAT, false, 0, 0);\n const source = gl.createTexture();\n if (!source) {\n if (source) gl.deleteTexture(source);\n gl.deleteBuffer(buffer); gl.deleteVertexArray(vao); gl.deleteProgram(program);\n throw new Error('Could not allocate reflection textures.');\n }\n const resources: ReflectionResources = { program, vao, buffer, source };\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n this.resources = resources;\n return resources;\n }\n\n apply(source: OffscreenCanvas, map: BorrowedTextureRaster, light: ReflectionLight, settings: ReflectionSettings, coordinates: ReflectionCoordinates, warp?: ReflectionWarp): ImageBitmap {\n const { gl, program, vao, source: sourceTexture } = this.acquireResourcesWithContext();\n const maximum = gl.getParameter(gl.MAX_TEXTURE_SIZE) as number;\n if (Math.max(source.width, source.height, map.width, map.height, warp?.map.width ?? 0, warp?.map.height ?? 0) > maximum) throw new RangeError('Reflection target exceeds WebGL2 maximum texture size.');\n if (this.canvas.width !== source.width) this.canvas.width = source.width;\n if (this.canvas.height !== source.height) this.canvas.height = source.height;\n gl.viewport(0, 0, source.width, source.height); gl.useProgram(program); gl.bindVertexArray(vao);\n this.upload(gl, 0, sourceTexture, source, true, false);\n const uploaded = new Map<object, number>();\n const bind = (unit: number, raster: {source: TexImageSource; width:number; height:number; resource:object; revision:number; placement:Readonly<TexturePlacement>}) => {\n if (Math.max(raster.width,raster.height)>maximum) throw new RangeError('Reflection light exceeds WebGL2 maximum texture size.');\n let cached=this.maps.get(raster.resource);\n if (!cached) {\n const texture=gl.createTexture(); if(!texture) throw new Error('Could not allocate reflection input texture.');\n cached={texture,revision:-1}; this.maps.set(raster.resource,cached);\n }\n this.upload(gl,unit,cached.texture,raster.source,false,raster.placement.mode!=='stretch',cached.revision!==raster.revision && uploaded.get(raster.resource)!==raster.revision);\n uploaded.set(raster.resource,raster.revision);\n };\n bind(1,map); bind(3,warp?.map ?? map);\n let lightPlacement: Readonly<TexturePlacement> = {mode:'stretch'};\n let lightWidth=1,lightHeight=1;\n if ('raster' in light) { bind(2,light.raster); lightPlacement=light.raster.placement; lightWidth=light.raster.width; lightHeight=light.raster.height; }\n else {\n let image: TexImageSource;\n if ('color' in light) {\n const canvas=this.colorCanvas ??= new OffscreenCanvas(1,1);\n const ctx=canvas.getContext('2d'); if(!ctx) throw new Error('Reflection colors require Canvas 2D.');\n ctx.clearRect(0,0,1,1); ctx.fillStyle=light.color; ctx.fillRect(0,0,1,1); image=canvas;\n } else { image=light.image; lightWidth='naturalWidth' in light.image?light.image.naturalWidth:light.image.width; lightHeight='naturalHeight' in light.image?light.image.naturalHeight:light.image.height; }\n bind(2,{source:image,width:lightWidth,height:lightHeight,resource:this.directKey,revision:++this.directRevision,placement:lightPlacement});\n }\n const uniform=(name:string)=>gl.getUniformLocation(program,name);\n const placement=(origin:string,size:string,angle:string,value:Readonly<TexturePlacement>,region:ReflectionCoordinates['region'],width:number,height:number)=>{\n gl.uniform2f(uniform(origin),region.x+(value.offsetX??0),region.y+(value.offsetY??0));\n gl.uniform2f(uniform(size),value.mode==='stretch'?region.width:value.tileWidth??width,value.mode==='stretch'?region.height:value.tileHeight??height);\n gl.uniform1f(uniform(angle),(value.rotation??0)*Math.PI/180);\n };\n gl.uniform1i(uniform('scene'),0); gl.uniform1i(uniform('map'),1); gl.uniform1i(uniform('lightMap'),2); gl.uniform1i(uniform('warpMap'),3);\n gl.uniform2f(uniform('logicalOrigin'),coordinates.originX,coordinates.originY);\n gl.uniform2f(uniform('logicalSize'),source.width/coordinates.density,source.height/coordinates.density);\n placement('mapOrigin','tileSize','rotation',map.placement,coordinates.region,map.width,map.height);\n placement('lightOrigin','lightSize','lightRotation',lightPlacement,coordinates.region,lightWidth,lightHeight);\n placement('warpOrigin','warpSize','warpRotation',warp?.map.placement??map.placement,warp?.region??coordinates.region,warp?.map.width??map.width,warp?.map.height??map.height);\n gl.uniform2f(uniform('warpStrength'),(warp?.strength??0)*coordinates.density/source.width,(warp?.strength??0)*coordinates.density/source.height);\n gl.uniform2f(uniform('direction'),settings.direction[0],settings.direction[1]);\n gl.uniform1f(uniform('opacity'),settings.opacity); gl.uniform1f(uniform('threshold'),settings.threshold); gl.uniform1f(uniform('softness'),settings.softness);\n gl.drawArrays(gl.TRIANGLE_STRIP,0,4);\n if(this.isContextLost) throw new Error('Reflection WebGL2 context was lost.');\n const error=gl.getError(); if(error!==gl.NO_ERROR) throw new Error(`Reflection GPU processing failed (${error}).`);\n for(const [resource,revision] of uploaded) this.maps.get(resource)!.revision=revision;\n return this.canvas.transferToImageBitmap();\n }\n private acquireResourcesWithContext(): ReflectionResources & { gl: WebGL2RenderingContext } {\n const resources = this.acquireResources();\n const gl = this.gl;\n if (!gl || gl.isContextLost()) throw new Error('Reflection WebGL2 context was lost.');\n return { ...resources, gl };\n }\n private upload(gl: WebGL2RenderingContext, unit: number, texture: WebGLTexture, canvas: TexImageSource, premultiply: boolean, repeat: boolean, upload = true): void {\n gl.activeTexture(gl.TEXTURE0 + unit); gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, repeat ? gl.REPEAT : gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, repeat ? gl.REPEAT : gl.CLAMP_TO_EDGE);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiply);\n if (upload) gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);\n }\n retainMaps(resources: ReadonlySet<object>): void {\n const gl = this.gl;\n for (const [resource, cached] of this.maps) {\n if (resource !== this.directKey && !resources.has(resource)) { if (gl && !gl.isContextLost()) gl.deleteTexture(cached.texture); this.maps.delete(resource); }\n }\n }\n private releaseResources(deleteResources: boolean): void {\n const gl = this.gl;\n const resources = this.resources;\n this.resources = undefined;\n if (gl && !gl.isContextLost() && deleteResources) {\n gl.deleteTexture(resources?.source ?? null);\n for (const cached of this.maps.values()) gl.deleteTexture(cached.texture);\n if (resources) { gl.deleteBuffer(resources.buffer); gl.deleteVertexArray(resources.vao); gl.deleteProgram(resources.program); }\n }\n this.maps.clear();\n }\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n this.canvas.removeEventListener('webglcontextlost', this.onContextLost);\n this.canvas.removeEventListener('webglcontextrestored', this.onContextRestored);\n this.releaseResources(true);\n this.canvas.width = 0; this.canvas.height = 0;\n if(this.colorCanvas) this.colorCanvas.width=this.colorCanvas.height=0;\n this.colorCanvas=undefined;\n }\n}\ninterface ReflectionResources {\n readonly program: WebGLProgram;\n readonly vao: WebGLVertexArrayObject;\n readonly buffer: WebGLBuffer;\n readonly source: WebGLTexture;\n}\nfunction compile(gl: WebGL2RenderingContext, kind: number, source: string): WebGLShader {\n const shader = gl.createShader(kind);\n if (!shader) throw new Error('Could not allocate reflection shader.');\n gl.shaderSource(shader, source); gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const error = gl.getShaderInfoLog(shader); gl.deleteShader(shader);\n throw new Error(`Reflection shader compile failed: ${error}`);\n }\n return shader;\n}\n"],
5
- "mappings": "AAYA,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAWrB,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoChB,MAAM,cAAc;AAAA,EAuBzB,YAA6B,YAA8C,CAAC,GAAG;AAAlD;AAC3B,SAAK,OAAO,iBAAiB,oBAAoB,KAAK,aAAa;AACnE,SAAK,OAAO,iBAAiB,wBAAwB,KAAK,i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IAC9J;AAAA,EACF;AAAA,EACQ,iBAAiB,iBAAgC;AACvD,UAAM,KAAK,KAAK;AAChB,UAAM,YAAY,KAAK;AACvB,SAAK,YAAY;AACjB,QAAI,MAAM,CAAC,GAAG,cAAc,KAAK,iBAAiB;AAChD,SAAG,cAAc,WAAW,UAAU,IAAI;AAC1C,iBAAW,UAAU,KAAK,KAAK,OAAO,EAAG,IAAG,cAAc,OAAO,OAAO;AACxE,UAAI,WAAW;AAAE,WAAG,aAAa,UAAU,MAAM;AAAG,WAAG,kBAAkB,UAAU,GAAG;AAAG,WAAG,cAAc,UAAU,OAAO;AAAA,MAAG;AAAA,IAChI;AACA,SAAK,KAAK,MAAM;AAAA,EAClB;AAAA,EACA,UAAgB;AACd,QAAI,KAAK,SAAU;AACnB,SAAK,WAAW;AAChB,SAAK,OAAO,oBAAoB,oBAAoB,KAAK,aAAa;AACtE,SAAK,OAAO,oBAAoB,wBAAwB,KAAK,iBAAiB;AAC9E,SAAK,iBAAiB,IAAI;AAC1B,SAAK,OAAO,QAAQ;AAAG,SAAK,OAAO,SAAS;AAC5C,QAAG,KAAK,YAAa,MAAK,YAAY,QAAM,KAAK,YAAY,SAAO;AACpE,SAAK,cAAY;AAAA,EACnB;AACF;AAOA,SAAS,QAAQ,IAA4B,MAAc,QAA6B;AACtF,QAAM,SAAS,GAAG,aAAa,IAAI;AACnC,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,uCAAuC;AACpE,KAAG,aAAa,QAAQ,MAAM;AAAG,KAAG,cAAc,MAAM;AACxD,MAAI,CAAC,GAAG,mBAAmB,QAAQ,GAAG,cAAc,GAAG;AACrD,UAAM,QAAQ,GAAG,iBAAiB,MAAM;AAAG,OAAG,aAAa,MAAM;AACjE,UAAM,IAAI,MAAM,qCAAqC,KAAK,EAAE;AAAA,EAC9D;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import type { BorrowedTextureRaster, TexturePlacement } from '../lib/textures/texture-protocol.js';\n\nexport interface ReflectionCoordinates {\n readonly originX: number;\n readonly originY: number;\n readonly density: number;\n readonly region: Readonly<{ x: number; y: number; width: number; height: number }>;\n}\nexport interface ReflectionGpuCallbacks {\n readonly onContextLost?: () => void;\n readonly onContextRestored?: () => void;\n}\nconst vertexSource = `#version 300 es\nin vec2 p;\nout vec2 uv;\nvoid main() { uv = vec2((p.x + 1.) * .5, 1. - (p.y + 1.) * .5); gl_Position = vec4(p, 0, 1); }\n`;\nexport interface ReflectionSettings {\n readonly opacity: number; readonly threshold: number; readonly softness: number;\n readonly direction: readonly [number, number];\n readonly depth?: number;\n}\nexport type ReflectionLight = { readonly color: string } | { readonly image: HTMLImageElement | ImageBitmap } | { readonly raster: BorrowedTextureRaster };\nexport interface ReflectionWarp { readonly map: BorrowedTextureRaster; readonly strength: number; readonly region: ReflectionCoordinates['region']; }\nconst fragmentSource = `#version 300 es\nprecision highp float;\nuniform sampler2D scene, map, lightMap, warpMap;\nuniform vec2 logicalOrigin, logicalSize, mapOrigin, tileSize, lightOrigin, lightSize, warpOrigin, warpSize, warpStrength, direction;\nuniform float rotation, lightRotation, warpRotation, opacity, threshold, softness;\nin vec2 uv;\nout vec4 outputColor;\nfloat decode(float c) { float b=c*255.; return (b-128.)/(b<128.?128.:127.); }\nvec2 coordinates(vec2 origin, vec2 size, float angle) {\n vec2 p=logicalOrigin+uv*logicalSize-origin;\n float c=cos(angle),s=sin(angle);\n return vec2(c*p.x+s*p.y,-s*p.x+c*p.y)/size;\n}\nvec4 sourcePixel(ivec2 p) {\n ivec2 size=textureSize(scene,0);\n if(any(lessThan(p,ivec2(0)))||any(greaterThanEqual(p,size))) return vec4(0);\n return texelFetch(scene,p,0);\n}\nvec4 sourceSample(vec2 p) {\n vec2 pixel=p*vec2(textureSize(scene,0))-.5;\n ivec2 base=ivec2(floor(pixel)); vec2 f=fract(pixel);\n return mix(mix(sourcePixel(base),sourcePixel(base+ivec2(1,0)),f.x),mix(sourcePixel(base+ivec2(0,1)),sourcePixel(base+ivec2(1,1)),f.x),f.y);\n}\nvoid main() {\n vec4 warp=texture(warpMap,coordinates(warpOrigin,warpSize,warpRotation));\n vec4 base=sourceSample(uv+vec2(decode(warp.r),decode(warp.g))*warp.a*warpStrength);\n vec4 field=texture(map,coordinates(mapOrigin,tileSize,rotation));\n vec2 slope=vec2(decode(field.r),decode(field.g));\n float coverage=smoothstep(threshold,threshold+softness,dot(slope,direction))*field.a*opacity;\n vec4 light=texture(lightMap,coordinates(lightOrigin,lightSize,lightRotation)+slope*.035);\n float amount=coverage*light.a;\n outputColor=vec4(base.rgb*(1.-amount)+base.a*light.rgb*amount,base.a);\n}\n`;\n\n/** Optional synchronous image processor; scene pixels are never read back. */\nexport class ReflectionGpu {\n private readonly canvas = new OffscreenCanvas(1, 1);\n private gl: WebGL2RenderingContext | undefined;\n private resources: ReflectionResources | undefined;\n private readonly maps = new Map<object, { texture: WebGLTexture; revision: number }>();\n private readonly directKey = {};\n private colorCanvas: OffscreenCanvas | undefined;\n private directRevision = 0;\n private disposed = false;\n private lost = false;\n private readonly onContextLost = (event: Event): void => {\n event.preventDefault();\n if (this.disposed || this.lost) return;\n this.lost = true;\n this.releaseResources(false);\n this.callbacks.onContextLost?.();\n };\n private readonly onContextRestored = (): void => {\n if (this.disposed || !this.lost) return;\n this.lost = false;\n this.callbacks.onContextRestored?.();\n };\n\n constructor(private readonly callbacks: Readonly<ReflectionGpuCallbacks> = {}, private readonly fragment = fragmentSource) {\n this.canvas.addEventListener('webglcontextlost', this.onContextLost);\n this.canvas.addEventListener('webglcontextrestored', this.onContextRestored);\n }\n\n get isContextLost(): boolean {\n return this.lost || this.gl?.isContextLost() === true;\n }\n\n private acquireResources(): ReflectionResources {\n if (this.disposed) throw new Error('Cannot use a disposed reflection processor.');\n if (this.isContextLost) throw new Error('Reflection WebGL2 context was lost.');\n if (this.resources) return this.resources;\n const gl = this.canvas.getContext('webgl2', { premultipliedAlpha: true, preserveDrawingBuffer: false });\n if (!gl) throw new Error('Reflection requires OffscreenCanvas WebGL2 support.');\n if (gl.isContextLost()) throw new Error('Reflection WebGL2 context was lost.');\n this.gl = gl;\n const vertex = compile(gl, gl.VERTEX_SHADER, vertexSource);\n let fragment: WebGLShader | undefined;\n let program: WebGLProgram | null = null;\n try {\n fragment = compile(gl, gl.FRAGMENT_SHADER, this.fragment);\n program = gl.createProgram();\n if (!program) throw new Error('Could not allocate reflection program.');\n gl.attachShader(program, vertex); gl.attachShader(program, fragment); gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) throw new Error(`Reflection shader link failed: ${gl.getProgramInfoLog(program)}`);\n } catch (error) { if (program) gl.deleteProgram(program); throw error; }\n finally { gl.deleteShader(vertex); if (fragment) gl.deleteShader(fragment); }\n const vao = gl.createVertexArray(), buffer = gl.createBuffer();\n if (!vao || !buffer) { if (vao) gl.deleteVertexArray(vao); if (buffer) gl.deleteBuffer(buffer); gl.deleteProgram(program); throw new Error('Could not allocate reflection geometry.'); }\n gl.bindVertexArray(vao); gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n const location = gl.getAttribLocation(program, 'p');\n gl.enableVertexAttribArray(location); gl.vertexAttribPointer(location, 2, gl.FLOAT, false, 0, 0);\n const source = gl.createTexture();\n if (!source) {\n if (source) gl.deleteTexture(source);\n gl.deleteBuffer(buffer); gl.deleteVertexArray(vao); gl.deleteProgram(program);\n throw new Error('Could not allocate reflection textures.');\n }\n const resources: ReflectionResources = { program, vao, buffer, source };\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n this.resources = resources;\n return resources;\n }\n\n apply(source: OffscreenCanvas, map: BorrowedTextureRaster, light: ReflectionLight, settings: ReflectionSettings, coordinates: ReflectionCoordinates, warp?: ReflectionWarp): ImageBitmap {\n const { gl, program, vao, source: sourceTexture } = this.acquireResourcesWithContext();\n const maximum = gl.getParameter(gl.MAX_TEXTURE_SIZE) as number;\n if (Math.max(source.width, source.height, map.width, map.height, warp?.map.width ?? 0, warp?.map.height ?? 0) > maximum) throw new RangeError('Reflection target exceeds WebGL2 maximum texture size.');\n if (this.canvas.width !== source.width) this.canvas.width = source.width;\n if (this.canvas.height !== source.height) this.canvas.height = source.height;\n gl.viewport(0, 0, source.width, source.height); gl.useProgram(program); gl.bindVertexArray(vao);\n this.upload(gl, 0, sourceTexture, source, true, false);\n const uploaded = new Map<object, number>();\n const bind = (unit: number, raster: {source: TexImageSource; width:number; height:number; resource:object; revision:number; placement:Readonly<TexturePlacement>}) => {\n if (Math.max(raster.width,raster.height)>maximum) throw new RangeError('Reflection light exceeds WebGL2 maximum texture size.');\n let cached=this.maps.get(raster.resource);\n if (!cached) {\n const texture=gl.createTexture(); if(!texture) throw new Error('Could not allocate reflection input texture.');\n cached={texture,revision:-1}; this.maps.set(raster.resource,cached);\n }\n this.upload(gl,unit,cached.texture,raster.source,false,raster.placement.mode!=='stretch',cached.revision!==raster.revision && uploaded.get(raster.resource)!==raster.revision);\n uploaded.set(raster.resource,raster.revision);\n };\n bind(1,map); bind(3,warp?.map ?? map);\n let lightPlacement: Readonly<TexturePlacement> = {mode:'stretch'};\n let lightWidth=1,lightHeight=1;\n if ('raster' in light) { bind(2,light.raster); lightPlacement=light.raster.placement; lightWidth=light.raster.width; lightHeight=light.raster.height; }\n else {\n let image: TexImageSource;\n if ('color' in light) {\n const canvas=this.colorCanvas ??= new OffscreenCanvas(1,1);\n const ctx=canvas.getContext('2d'); if(!ctx) throw new Error('Reflection colors require Canvas 2D.');\n ctx.clearRect(0,0,1,1); ctx.fillStyle=light.color; ctx.fillRect(0,0,1,1); image=canvas;\n } else { image=light.image; lightWidth='naturalWidth' in light.image?light.image.naturalWidth:light.image.width; lightHeight='naturalHeight' in light.image?light.image.naturalHeight:light.image.height; }\n bind(2,{source:image,width:lightWidth,height:lightHeight,resource:this.directKey,revision:++this.directRevision,placement:lightPlacement});\n }\n const uniform=(name:string)=>gl.getUniformLocation(program,name);\n const placement=(origin:string,size:string,angle:string,value:Readonly<TexturePlacement>,region:ReflectionCoordinates['region'],width:number,height:number)=>{\n gl.uniform2f(uniform(origin),region.x+(value.offsetX??0),region.y+(value.offsetY??0));\n gl.uniform2f(uniform(size),value.mode==='stretch'?region.width:value.tileWidth??width,value.mode==='stretch'?region.height:value.tileHeight??height);\n gl.uniform1f(uniform(angle),(value.rotation??0)*Math.PI/180);\n };\n gl.uniform1i(uniform('scene'),0); gl.uniform1i(uniform('map'),1); gl.uniform1i(uniform('lightMap'),2); gl.uniform1i(uniform('warpMap'),3);\n gl.uniform2f(uniform('logicalOrigin'),coordinates.originX,coordinates.originY);\n gl.uniform2f(uniform('logicalSize'),source.width/coordinates.density,source.height/coordinates.density);\n placement('mapOrigin','tileSize','rotation',map.placement,coordinates.region,map.width,map.height);\n placement('lightOrigin','lightSize','lightRotation',lightPlacement,coordinates.region,lightWidth,lightHeight);\n placement('warpOrigin','warpSize','warpRotation',warp?.map.placement??map.placement,warp?.region??coordinates.region,warp?.map.width??map.width,warp?.map.height??map.height);\n gl.uniform2f(uniform('warpStrength'),(warp?.strength??0)*coordinates.density/source.width,(warp?.strength??0)*coordinates.density/source.height);\n gl.uniform2f(uniform('direction'),settings.direction[0],settings.direction[1]);\n gl.uniform1f(uniform('depth'),settings.depth ?? 0);\n gl.uniform1f(uniform('opacity'),settings.opacity); gl.uniform1f(uniform('threshold'),settings.threshold); gl.uniform1f(uniform('softness'),settings.softness);\n gl.drawArrays(gl.TRIANGLE_STRIP,0,4);\n if(this.isContextLost) throw new Error('Reflection WebGL2 context was lost.');\n const error=gl.getError(); if(error!==gl.NO_ERROR) throw new Error(`Reflection GPU processing failed (${error}).`);\n for(const [resource,revision] of uploaded) this.maps.get(resource)!.revision=revision;\n return this.canvas.transferToImageBitmap();\n }\n private acquireResourcesWithContext(): ReflectionResources & { gl: WebGL2RenderingContext } {\n const resources = this.acquireResources();\n const gl = this.gl;\n if (!gl || gl.isContextLost()) throw new Error('Reflection WebGL2 context was lost.');\n return { ...resources, gl };\n }\n private upload(gl: WebGL2RenderingContext, unit: number, texture: WebGLTexture, canvas: TexImageSource, premultiply: boolean, repeat: boolean, upload = true): void {\n gl.activeTexture(gl.TEXTURE0 + unit); gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, repeat ? gl.REPEAT : gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, repeat ? gl.REPEAT : gl.CLAMP_TO_EDGE);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiply);\n if (upload) gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);\n }\n retainMaps(resources: ReadonlySet<object>): void {\n const gl = this.gl;\n for (const [resource, cached] of this.maps) {\n if (resource !== this.directKey && !resources.has(resource)) { if (gl && !gl.isContextLost()) gl.deleteTexture(cached.texture); this.maps.delete(resource); }\n }\n }\n private releaseResources(deleteResources: boolean): void {\n const gl = this.gl;\n const resources = this.resources;\n this.resources = undefined;\n if (gl && !gl.isContextLost() && deleteResources) {\n gl.deleteTexture(resources?.source ?? null);\n for (const cached of this.maps.values()) gl.deleteTexture(cached.texture);\n if (resources) { gl.deleteBuffer(resources.buffer); gl.deleteVertexArray(resources.vao); gl.deleteProgram(resources.program); }\n }\n this.maps.clear();\n }\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n this.canvas.removeEventListener('webglcontextlost', this.onContextLost);\n this.canvas.removeEventListener('webglcontextrestored', this.onContextRestored);\n this.releaseResources(true);\n this.canvas.width = 0; this.canvas.height = 0;\n if(this.colorCanvas) this.colorCanvas.width=this.colorCanvas.height=0;\n this.colorCanvas=undefined;\n }\n}\ninterface ReflectionResources {\n readonly program: WebGLProgram;\n readonly vao: WebGLVertexArrayObject;\n readonly buffer: WebGLBuffer;\n readonly source: WebGLTexture;\n}\nfunction compile(gl: WebGL2RenderingContext, kind: number, source: string): WebGLShader {\n const shader = gl.createShader(kind);\n if (!shader) throw new Error('Could not allocate reflection shader.');\n gl.shaderSource(shader, source); gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const error = gl.getShaderInfoLog(shader); gl.deleteShader(shader);\n throw new Error(`Reflection shader compile failed: ${error}`);\n }\n return shader;\n}\n"],
5
+ "mappings": "AAYA,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAYrB,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoChB,MAAM,cAAc;AAAA,EAuBzB,YAA6B,YAA8C,CAAC,GAAoB,WAAW,gBAAgB;AAA9F;AAAmE;AAC9F,SAAK,OAAO,iBAAiB,oBAAoB,KAAK,aAAa;AACnE,SAAK,OAAO,iBAAiB,wBAAwB,KAAK,iBAAiB;AAAA,EAC7E;AAAA,EAH6B;AAAA,EAAmE;AAAA,EAtB/E,SAAS,IAAI,gBAAgB,GAAG,CAAC;AAAA,EAC1C;AAAA,EACA;AAAA,EACS,OAAO,oBAAI,IAAyD;AAAA,EACpE,YAAY,CAAC;AAAA,EACtB;AAAA,EACA,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACE,gBAAgB,CAAC,UAAuB;AACvD,UAAM,eAAe;AACrB,QAAI,KAAK,YAAY,KAAK,KAAM;AAChC,SAAK,OAAO;AACZ,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UAAI,WAAW;AAAE,WAAG,aAAa,UAAU,MAAM;AAAG,WAAG,kBAAkB,UAAU,GAAG;AAAG,WAAG,cAAc,UAAU,OAAO;AAAA,MAAG;AAAA,IAChI;AACA,SAAK,KAAK,MAAM;AAAA,EAClB;AAAA,EACA,UAAgB;AACd,QAAI,KAAK,SAAU;AACnB,SAAK,WAAW;AAChB,SAAK,OAAO,oBAAoB,oBAAoB,KAAK,aAAa;AACtE,SAAK,OAAO,oBAAoB,wBAAwB,KAAK,iBAAiB;AAC9E,SAAK,iBAAiB,IAAI;AAC1B,SAAK,OAAO,QAAQ;AAAG,SAAK,OAAO,SAAS;AAC5C,QAAG,KAAK,YAAa,MAAK,YAAY,QAAM,KAAK,YAAY,SAAO;AACpE,SAAK,cAAY;AAAA,EACnB;AACF;AAOA,SAAS,QAAQ,IAA4B,MAAc,QAA6B;AACtF,QAAM,SAAS,GAAG,aAAa,IAAI;AACnC,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,uCAAuC;AACpE,KAAG,aAAa,QAAQ,MAAM;AAAG,KAAG,cAAc,MAAM;AACxD,MAAI,CAAC,GAAG,mBAAmB,QAAQ,GAAG,cAAc,GAAG;AACrD,UAAM,QAAQ,GAAG,iBAAiB,MAAM;AAAG,OAAG,aAAa,MAAM;AACjE,UAAM,IAAI,MAAM,qCAAqC,KAAK,EAAE;AAAA,EAC9D;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,13 @@
1
+ import { type TexturePaint } from "../lib/textures/texture-protocol.js";
2
+ import type { PibblInstance } from "../lib/types.js";
3
+ import type { FilterWindows } from "../lib/filter/filter-region.js";
4
+ import { EmbossGpu } from "./emboss-gpu.js";
5
+ import type { ReflectionSettings } from "./reflection-gpu.js";
6
+ /** @internal Test-only read-only access; it never creates a GPU service. */
7
+ export declare function peekEmbossGpu(instance: PibblInstance): EmbossGpu | undefined;
8
+ export declare function processEmboss(source: OffscreenCanvas, windows: FilterWindows, paint: TexturePaint, settings: ReflectionSettings, region: Readonly<{
9
+ x: number;
10
+ y: number;
11
+ width: number;
12
+ height: number;
13
+ }>): ImageBitmap;
@@ -0,0 +1,131 @@
1
+ import {
2
+ borrowTextureRaster
3
+ } from "../lib/textures/texture-protocol.js";
4
+ import { GLOBAL_STATE, getPibblInstance } from "../lib/global-state.js";
5
+ import { getOptionalService } from "../lib/optional-services.js";
6
+ import { update } from "../lib/update.js";
7
+ import { EmbossGpu } from "./emboss-gpu.js";
8
+ const GPU_BORROWER = /* @__PURE__ */ Symbol("pibbl.emboss-borrower");
9
+ const rootServices = /* @__PURE__ */ new WeakMap();
10
+ class RootGpuService {
11
+ constructor(root) {
12
+ this.root = root;
13
+ this.gpu = new EmbossGpu({
14
+ onContextRestored: () => {
15
+ if (this.disposed || this.recoveryRequested || this.root.mainTeardowns.closed)
16
+ return;
17
+ this.recoveryRequested = true;
18
+ for (const borrower of this.borrowers)
19
+ update(borrower.instance.canvas, void 0, true);
20
+ }
21
+ });
22
+ }
23
+ root;
24
+ gpu;
25
+ borrowers = /* @__PURE__ */ new Set();
26
+ disposed = false;
27
+ recoveryRequested = false;
28
+ beginRender() {
29
+ this.recoveryRequested = false;
30
+ }
31
+ pruneMaps() {
32
+ const resources = /* @__PURE__ */ new Set();
33
+ for (const borrower of this.borrowers)
34
+ for (const resource of borrower.resources) resources.add(resource);
35
+ this.gpu.retainMaps(resources);
36
+ }
37
+ dispose() {
38
+ this.disposed = true;
39
+ this.gpu.dispose();
40
+ }
41
+ }
42
+ class GpuBorrower {
43
+ constructor(instance) {
44
+ this.instance = instance;
45
+ let root = instance;
46
+ while (root.parent) root = getPibblInstance(root.parent);
47
+ this.root = root;
48
+ let shared = rootServices.get(root);
49
+ if (!shared) {
50
+ shared = new RootGpuService(root);
51
+ rootServices.set(root, shared);
52
+ }
53
+ this.shared = shared;
54
+ shared.borrowers.add(this);
55
+ }
56
+ instance;
57
+ used = false;
58
+ resources = /* @__PURE__ */ new Set();
59
+ candidates = /* @__PURE__ */ new Set();
60
+ committed = false;
61
+ disposed = false;
62
+ shared;
63
+ root;
64
+ beginRender() {
65
+ this.shared.beginRender();
66
+ this.used = false;
67
+ this.candidates.clear();
68
+ }
69
+ useMap(resource) {
70
+ this.candidates.add(resource);
71
+ }
72
+ endRender(success) {
73
+ if (success && this.used) {
74
+ this.committed = true;
75
+ this.resources = new Set(this.candidates);
76
+ this.shared.pruneMaps();
77
+ return;
78
+ }
79
+ if (success || !this.committed) {
80
+ this.dispose();
81
+ return;
82
+ }
83
+ if (!this.shared.gpu.isContextLost) this.shared.pruneMaps();
84
+ }
85
+ dispose() {
86
+ if (this.disposed) return;
87
+ this.disposed = true;
88
+ this.instance.optionalServices.delete(GPU_BORROWER);
89
+ this.shared.borrowers.delete(this);
90
+ if (this.shared.borrowers.size === 0) {
91
+ rootServices.delete(this.root);
92
+ this.shared.dispose();
93
+ } else this.shared.pruneMaps();
94
+ }
95
+ }
96
+ function peekEmbossGpu(instance) {
97
+ let root = instance;
98
+ while (root.parent) root = getPibblInstance(root.parent);
99
+ return rootServices.get(root)?.gpu;
100
+ }
101
+ function processEmboss(source, windows, paint, settings, region) {
102
+ const instance = GLOBAL_STATE.currentPibblInstance;
103
+ if (!instance) throw new Error("Emboss requires an active Pibbl instance.");
104
+ const borrower = getOptionalService(
105
+ instance,
106
+ GPU_BORROWER,
107
+ () => new GpuBorrower(instance)
108
+ );
109
+ borrower.used = true;
110
+ return borrowTextureRaster(paint, (map) => {
111
+ borrower.useMap(map.resource);
112
+ const coordinates = {
113
+ originX: windows.source.backingX / windows.density,
114
+ originY: windows.source.backingY / windows.density,
115
+ density: windows.density,
116
+ region
117
+ };
118
+ return borrower.shared.gpu.apply(
119
+ source,
120
+ map,
121
+ { color: "#ffffff" },
122
+ settings,
123
+ coordinates
124
+ );
125
+ });
126
+ }
127
+ export {
128
+ peekEmbossGpu,
129
+ processEmboss
130
+ };
131
+ //# sourceMappingURL=render-emboss-boundary.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/filters/render-emboss-boundary.ts"],
4
+ "sourcesContent": ["import {\n borrowTextureRaster,\n type TexturePaint,\n} from \"../lib/textures/texture-protocol.js\";\nimport { GLOBAL_STATE, getPibblInstance } from \"../lib/global-state.js\";\nimport { getOptionalService } from \"../lib/optional-services.js\";\nimport { update } from \"../lib/update.js\";\nimport type { PibblInstance } from \"../lib/types.js\";\nimport type { FilterWindows } from \"../lib/filter/filter-region.js\";\nimport { EmbossGpu } from \"./emboss-gpu.js\";\nimport type { ReflectionSettings } from \"./reflection-gpu.js\";\n\nconst GPU_BORROWER = Symbol(\"pibbl.emboss-borrower\");\nconst rootServices = new WeakMap<PibblInstance, RootGpuService>();\n\nclass RootGpuService {\n readonly gpu: EmbossGpu;\n readonly borrowers = new Set<GpuBorrower>();\n private disposed = false;\n private recoveryRequested = false;\n constructor(private readonly root: PibblInstance) {\n this.gpu = new EmbossGpu({\n onContextRestored: () => {\n if (\n this.disposed ||\n this.recoveryRequested ||\n this.root.mainTeardowns.closed\n )\n return;\n this.recoveryRequested = true;\n for (const borrower of this.borrowers)\n update(borrower.instance.canvas, undefined, true);\n },\n });\n }\n beginRender(): void {\n this.recoveryRequested = false;\n }\n pruneMaps(): void {\n const resources = new Set<object>();\n for (const borrower of this.borrowers)\n for (const resource of borrower.resources) resources.add(resource);\n this.gpu.retainMaps(resources);\n }\n dispose(): void {\n this.disposed = true;\n this.gpu.dispose();\n }\n}\n\nclass GpuBorrower {\n used = false;\n resources = new Set<object>();\n private candidates = new Set<object>();\n private committed = false;\n private disposed = false;\n readonly shared: RootGpuService;\n private readonly root: PibblInstance;\n constructor(readonly instance: PibblInstance) {\n let root = instance;\n while (root.parent) root = getPibblInstance(root.parent);\n this.root = root;\n let shared = rootServices.get(root);\n if (!shared) {\n shared = new RootGpuService(root);\n rootServices.set(root, shared);\n }\n this.shared = shared;\n shared.borrowers.add(this);\n }\n beginRender(): void {\n this.shared.beginRender();\n this.used = false;\n this.candidates.clear();\n }\n useMap(resource: object): void {\n this.candidates.add(resource);\n }\n endRender(success: boolean): void {\n if (success && this.used) {\n this.committed = true;\n this.resources = new Set(this.candidates);\n this.shared.pruneMaps();\n return;\n }\n if (success || !this.committed) {\n this.dispose();\n return;\n }\n if (!this.shared.gpu.isContextLost) this.shared.pruneMaps();\n }\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n this.instance.optionalServices.delete(GPU_BORROWER);\n this.shared.borrowers.delete(this);\n if (this.shared.borrowers.size === 0) {\n rootServices.delete(this.root);\n this.shared.dispose();\n } else this.shared.pruneMaps();\n }\n}\n\n/** @internal Test-only read-only access; it never creates a GPU service. */\nexport function peekEmbossGpu(instance: PibblInstance): EmbossGpu | undefined {\n let root = instance;\n while (root.parent) root = getPibblInstance(root.parent);\n return rootServices.get(root)?.gpu;\n}\n\nexport function processEmboss(\n source: OffscreenCanvas,\n windows: FilterWindows,\n paint: TexturePaint,\n settings: ReflectionSettings,\n region: Readonly<{ x: number; y: number; width: number; height: number }>,\n): ImageBitmap {\n const instance = GLOBAL_STATE.currentPibblInstance;\n if (!instance) throw new Error(\"Emboss requires an active Pibbl instance.\");\n const borrower = getOptionalService(\n instance,\n GPU_BORROWER,\n () => new GpuBorrower(instance),\n );\n borrower.used = true;\n return borrowTextureRaster(paint, (map) => {\n borrower.useMap(map.resource);\n const coordinates = {\n originX: windows.source.backingX / windows.density,\n originY: windows.source.backingY / windows.density,\n density: windows.density,\n region,\n };\n return borrower.shared.gpu.apply(\n source,\n map,\n { color: \"#ffffff\" },\n settings,\n coordinates,\n );\n });\n}\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,cAAc,wBAAwB;AAC/C,SAAS,0BAA0B;AACnC,SAAS,cAAc;AAGvB,SAAS,iBAAiB;AAG1B,MAAM,eAAe,uBAAO,uBAAuB;AACnD,MAAM,eAAe,oBAAI,QAAuC;AAEhE,MAAM,eAAe;AAAA,EAKnB,YAA6B,MAAqB;A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AAAA,IACF;AACA,WAAO,SAAS,OAAO,IAAI;AAAA,MACzB;AAAA,MACA;AAAA,MACA,EAAE,OAAO,UAAU;AAAA,MACnB;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
6
+ "names": []
7
+ }
package/dist/filters.d.ts CHANGED
@@ -3,3 +3,5 @@ export { displacement } from './filters/displacement.js';
3
3
  export type { PibblFilter, PibblBlurFilterOptions, PibblBrightnessFilterOptions, PibblContrastFilterOptions, PibblDropShadowFilterOptions, PibblGrayscaleFilterOptions, PibblHueRotateFilterOptions, PibblInvertFilterOptions, PibblOpacityFilterOptions, PibblSaturateFilterOptions, PibblSepiaFilterOptions, PibblDisplacementFilterOptions, } from './lib/style/filter-types.js';
4
4
  export { reflectedLight } from './filters/reflected-light.js';
5
5
  export type { PibblReflectedLightFilterOptions, PibblReflectedLightSource } from './lib/style/filter-types.js';
6
+ export { emboss } from './filters/emboss.js';
7
+ export type { PibblEmbossFilterOptions } from './filters/emboss.js';
package/dist/filters.js CHANGED
@@ -12,12 +12,14 @@ import {
12
12
  } from "./filters/native.js";
13
13
  import { displacement } from "./filters/displacement.js";
14
14
  import { reflectedLight } from "./filters/reflected-light.js";
15
+ import { emboss } from "./filters/emboss.js";
15
16
  export {
16
17
  blur,
17
18
  brightness,
18
19
  contrast,
19
20
  displacement,
20
21
  dropShadow,
22
+ emboss,
21
23
  grayscale,
22
24
  hueRotate,
23
25
  invert,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/filters.ts"],
4
- "sourcesContent": ["export {\n blur,\n brightness,\n contrast,\n dropShadow,\n grayscale,\n hueRotate,\n invert,\n opacity,\n saturate,\n sepia,\n} from './filters/native.js';\nexport { displacement } from './filters/displacement.js';\nexport type {\n PibblFilter,\n PibblBlurFilterOptions,\n PibblBrightnessFilterOptions,\n PibblContrastFilterOptions,\n PibblDropShadowFilterOptions,\n PibblGrayscaleFilterOptions,\n PibblHueRotateFilterOptions,\n PibblInvertFilterOptions,\n PibblOpacityFilterOptions,\n PibblSaturateFilterOptions,\n PibblSepiaFilterOptions,\n PibblDisplacementFilterOptions,\n} from './lib/style/filter-types.js';\n\nexport { reflectedLight } from './filters/reflected-light.js';\nexport type { PibblReflectedLightFilterOptions, PibblReflectedLightSource } from './lib/style/filter-types.js';\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAgB7B,SAAS,sBAAsB;",
4
+ "sourcesContent": ["export {\n blur,\n brightness,\n contrast,\n dropShadow,\n grayscale,\n hueRotate,\n invert,\n opacity,\n saturate,\n sepia,\n} from './filters/native.js';\nexport { displacement } from './filters/displacement.js';\nexport type {\n PibblFilter,\n PibblBlurFilterOptions,\n PibblBrightnessFilterOptions,\n PibblContrastFilterOptions,\n PibblDropShadowFilterOptions,\n PibblGrayscaleFilterOptions,\n PibblHueRotateFilterOptions,\n PibblInvertFilterOptions,\n PibblOpacityFilterOptions,\n PibblSaturateFilterOptions,\n PibblSepiaFilterOptions,\n PibblDisplacementFilterOptions,\n} from './lib/style/filter-types.js';\n\nexport { reflectedLight } from './filters/reflected-light.js';\nexport type { PibblReflectedLightFilterOptions, PibblReflectedLightSource } from './lib/style/filter-types.js';\n\nexport { emboss } from './filters/emboss.js';\nexport type { PibblEmbossFilterOptions } from './filters/emboss.js';\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAgB7B,SAAS,sBAAsB;AAG/B,SAAS,cAAc;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export type { Signal, SignalEquals, SignalOptions, SignalValue, WritableSignal,
40
40
  export { easing } from './lib/animation/easing.js';
41
41
  export { defineAnimation, keyframes, spring, stepper, tween, } from './lib/animation/definition.js';
42
42
  export { marker, parallel, repeat, sequence, drive, wait, } from './lib/animation/program.js';
43
- export type { PibblAnimationDefinition, PibblAnimationOptions, PibblAnimationProgram, PibblAnimationRepeatDirection, PibblAnimationRepeatOptions, PibblAnimationSampleInput, PibblSpringAnimatedValueOptions, PibblPlayback, PibblPlaybackEvent, PibblPlaybackOptions, PibblPlaybackStatus, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions, PibblTweenAnimatedValueOptions, } from './lib/animation/types.js';
43
+ export type { PibblAnimationDefinition, PibblAnimationOptions, PibblAnimationProgram, PibblAnimationRepeatDirection, PibblAnimationRepeatOptions, PibblAnimationSampleInput, PibblAnimatedValueOptions, PibblAnimationTarget, PibblPlayback, PibblPlaybackEvent, PibblPlaybackOptions, PibblPlaybackStatus, PibblEasing, PibblInterpolator, PibblKeyframesOptions, PibblSpringOptions, PibblStepperOptions, PibblTweenOptions, } from './lib/animation/types.js';
44
44
  export type { PibblConfig, PibblFit, PibblFixedViewportConfig, PibblPixelRatio, PibblResponsiveViewportConfig, } from './lib/surface/types.js';
45
45
  export { Absolute, type AbsoluteProps, type AbsoluteStyle, } from './lib/layout/absolute.js';
46
46
  export { Overlay, type OverlayProps, type OverlayStyle, } from './lib/layout/overlay.js';
@@ -109,3 +109,5 @@ export type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRe
109
109
  export { defineTransition } from './lib/transitions/define-transition.js';
110
110
  export type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';
111
111
  export type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';
112
+ export { recordFrames, exportGif } from './lib/recording/recording.js';
113
+ export type { PibblFrameRecordingOptions, PibblFrameRecordingSession, PibblRecordedFrameInfo, PibblRecordedFrame, PibblFrameRecording, PibblGifExportOptions, PibblRenderCompletion, } from './lib/recording/types.js';
package/dist/index.js CHANGED
@@ -178,6 +178,7 @@ import { hologram } from "./lib/transitions/hologram.js";
178
178
  import { bifrost } from "./lib/transitions/bifrost.js";
179
179
  import { slide, zoom, wipe, blurReveal, dissolve } from "./lib/transitions/common.js";
180
180
  import { defineTransition } from "./lib/transitions/define-transition.js";
181
+ import { recordFrames, exportGif } from "./lib/recording/recording.js";
181
182
  export {
182
183
  Absolute,
183
184
  Arc,
@@ -243,6 +244,7 @@ export {
243
244
  easing,
244
245
  embers,
245
246
  envelopeTransform,
247
+ exportGif,
246
248
  fade,
247
249
  flattenPath,
248
250
  flattenPathWang,
@@ -258,6 +260,7 @@ export {
258
260
  pathBendTransform,
259
261
  pibbl,
260
262
  quadTransform,
263
+ recordFrames,
261
264
  repeat,
262
265
  resolveBox,
263
266
  resolveLength,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export {\n meshTransform,\n arcBendTransform,\n pathBendTransform,\n type MeshTransformOptions,\n type ArcBendTransformOptions,\n type PathBendTransformOptions,\n transformPath,\n composeTransforms,\n affineTransform,\n quadTransform,\n envelopeTransform,\n type PathTransform,\n type PathPoint,\n type PathRect,\n type TransformPathOptions,\n type QuadTransformOptions,\n type PathQuadCorners,\n type PathQuadMode,\n type BendTransformOptions,\n type EnvelopeTransformOptions,\n type EnvelopeGuide,\n type PathGuide,\n type PathGuideOptions,\n type PathGuideStation,\n} from './lib/geometry/path-transforms.js';\nexport { type PathBendArc, type PathBendAlign, type PathBendBaseline, type PathBendFit, type PathBendOverflow } from './lib/geometry/path-bending.js';\nexport { flattenPathWang } from './lib/geometry/path-wang.js';\nexport { simplifyPathRadial } from './lib/geometry/path-radial.js';\nexport { PathGeometry, type PathSegment } from './lib/geometry/path-geometry.js';\nexport { toPath2D, toSvgPathData } from './lib/geometry/path-conversion.js';\nexport {\n flattenPath,\n simplifyPath,\n subdividePath,\n type FlattenPathOptions,\n type SimplifyPathOptions,\n type SubdividePathOptions,\n} from './lib/geometry/path-utilities.js';\n// components\nexport { Arc, type ArcProps, type ArcStyle } from './lib/components/arc.js';\nexport {\n Circle,\n type CircleProps,\n type CircleStyle,\n} from './lib/components/circle.js';\nexport { Clip, type ClipProps, type ClipStyle } from './lib/components/clip.js';\nexport {\n Ellipse,\n type EllipseProps,\n type EllipseStyle,\n} from './lib/components/ellipse.js';\nexport {\n Group,\n type GroupProps,\n type GStyle,\n} from './lib/components/g.js';\nexport {\n HorizontalLine,\n type HorizontalLineProps,\n type HorizontalLineStyle,\n} from './lib/components/horizontal-line.js';\n\nexport {\n Image,\n type ImageProps,\n} from './lib/components/img.js';\nexport {\n Layer,\n type LayerProps,\n type LayerStyle,\n} from './lib/components/layer.js';\nexport {\n Line,\n type LineProps,\n type LineStyle,\n} from './lib/components/line.js';\nexport { Path, type PathProps } from './lib/components/path.js';\nexport {\n Polygon,\n type PolygonProps,\n type PolygonStyle,\n} from './lib/components/polygon.js';\nexport {\n RegularPolygon,\n type RegularPolygonProps,\n type RegularPolygonStyle,\n} from './lib/components/regular-polygon.js';\nexport {\n Rectangle,\n type RectangleProps,\n} from './lib/components/rect.js';\nexport {\n Star,\n type StarProps,\n type StarStyle,\n} from './lib/components/star.js';\nexport {\n SvgPath,\n type SvgPathProps,\n} from './lib/components/svg-path.js';\nexport { Text, type TextProps } from './lib/components/text.js';\nexport {\n VerticalLine,\n type VerticalLineProps,\n type VerticalLineStyle,\n} from './lib/components/vertical-line.js';\nexport {\n Wedge,\n type WedgeProps,\n type WedgeStyle,\n} from './lib/components/wedge.js';\nexport {\n createArcPath,\n createWedgePath,\n type ArcPathOptions,\n type WedgePathOptions,\n} from './lib/geometry/circular-sweep.js';\nexport {\n createCirclePath,\n type CirclePathOptions,\n} from './lib/geometry/circle.js';\nexport {\n createEllipsePath,\n type EllipsePathOptions,\n} from './lib/geometry/ellipse.js';\nexport {\n createLinePath,\n type LinePathOptions,\n} from './lib/geometry/line.js';\nexport {\n createPolygonPath,\n type PolygonPathOptions,\n} from './lib/geometry/polygon.js';\nexport {\n createRectanglePath,\n type RectanglePathOptions,\n} from './lib/geometry/rectangle.js';\nexport {\n createRegularPolygonPath,\n type RegularPolygonNumericSize,\n type RegularPolygonPathOptions,\n type RegularPolygonPathPosition,\n} from './lib/geometry/regular-polygon.js';\nexport {\n createStarPath,\n type StarPathOptions,\n} from './lib/geometry/star.js';\nexport {\n createSvgPath,\n type SvgPathOptions,\n} from './lib/geometry/svg-path.js';\nexport type { RoundedCornerPathOptions } from './lib/geometry/rounded-corners.js';\nexport { pibbl } from './lib/pibbl.js';\nexport {\n batch,\n computed,\n isSignal,\n signal,\n untracked,\n} from './lib/signals/graph.js';\nexport { resolveSignalValue } from './lib/signals/resolve-signal-value.js';\nexport type {\n Signal,\n SignalEquals,\n SignalOptions,\n SignalValue,\n WritableSignal,\n} from './lib/signals/types.js';\nexport { easing } from './lib/animation/easing.js';\nexport {\n defineAnimation,\n keyframes,\n spring,\n stepper,\n tween,\n} from './lib/animation/definition.js';\nexport {\n marker,\n parallel,\n repeat,\n sequence,\n drive,\n wait,\n} from './lib/animation/program.js';\nexport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationProgram,\n PibblAnimationRepeatDirection,\n PibblAnimationRepeatOptions,\n PibblAnimationSampleInput,\n PibblSpringAnimatedValueOptions,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n PibblPlaybackStatus,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n PibblTweenAnimatedValueOptions,\n} from './lib/animation/types.js';\nexport type {\n PibblConfig,\n PibblFit,\n PibblFixedViewportConfig,\n PibblPixelRatio,\n PibblResponsiveViewportConfig,\n} from './lib/surface/types.js';\nexport {\n Absolute,\n type AbsoluteProps,\n type AbsoluteStyle,\n} from './lib/layout/absolute.js';\nexport {\n Overlay,\n type OverlayProps,\n type OverlayStyle,\n} from './lib/layout/overlay.js';\nexport {\n Flow,\n type FlowProps,\n type FlowStyle,\n} from './lib/layout/flow.js';\nexport {\n Flex,\n type FlexProps,\n type FlexStyle,\n} from './lib/layout/flex.js';\nexport {\n Grid,\n type GridProps,\n type GridStyle,\n type GridTrack,\n} from './lib/layout/grid.js';\nexport { measureElement } from './lib/layout/measure.js';\n\nexport {\n FocusManagement,\n KeyboardNavigation,\n type FocusManagementProps,\n type KeyboardNavigationProps,\n} from './lib/focus/policy-components.js';\nexport type { PibblKeyboardNavigationOptions } from './lib/focus/types.js';\n\nexport { definePrimitive } from './lib/define-primitive.js';\nexport { defineRenderLayer } from './lib/render-layer/define-render-layer.js';\nexport type {\n PibblRenderLayerComponentProps,\n PibblRenderLayerDefinition,\n PibblRenderLayerFrame,\n PibblRenderLayerContext,\n PibblRenderLayerHit,\n PibblRenderLayerInput,\n PibblRenderLayerInteraction,\n PibblRenderLayerInteractionSnapshot,\n PibblRenderLayerProps,\n PibblRenderLayerSize,\n PibblRenderLayerStyle,\n PibblRenderLayerTarget,\n} from './lib/render-layer/types.js';\nexport { createElement } from './lib/element/create-element.js';\nexport { Fragment } from './lib/element/fragment.js';\nexport type {\n BoxStyle,\n CursorStyle,\n EdgeValues,\n FlexItemStyle,\n GridItemStyle,\n ImgStyle,\n LayoutItemStyle,\n Length,\n PaintStyle,\n PathStyle,\n RectStyle,\n ResolvedBoxStyle,\n SvgPathStyle,\n TextFit,\n TextStyle,\n Percentage,\n RoundedCornerStyle,\n} from './lib/style/types.js';\nexport {\n LayoutDiagnostic,\n layoutDiagnostic,\n type LayoutDiagnosticContext,\n type LayoutDiagnosticInput,\n} from './lib/style/diagnostics.js';\nexport { normalizeEdges } from './lib/style/normalize.js';\nexport { resolveLength } from './lib/style/resolve-length.js';\nexport { resolveBox } from './lib/layout/box.js';\nexport type {\n PibblFilter,\n} from './lib/style/filter-types.js';\nexport type {\n Constraints,\n Edges,\n LayoutBox,\n Size,\n} from './lib/layout/types.js';\n// hooks\nexport { useCursor } from './lib/hooks/use-cursor.js';\nexport { useCanvasContext } from './lib/hooks/use-canvas-context.js';\nexport { useComputed } from './lib/hooks/use-computed.js';\nexport { useConst } from './lib/hooks/use-const.js';\nexport { useEventListener } from './lib/hooks/use-event-listener.js';\nexport { useEventTarget } from './lib/hooks/use-event-target.js';\nexport { useLinePath } from './lib/hooks/use-line-path.js';\nexport { useLayoutBox } from './lib/hooks/use-layout-box.js';\nexport { useRectPath } from './lib/hooks/use-rect-path.js';\nexport { useRef, type PibblRef } from './lib/hooks/use-ref.js';\nexport { usePlayback } from './lib/hooks/use-playback.js';\nexport {\n useReaction,\n type PibblReactionOptions,\n} from './lib/hooks/use-reaction.js';\nexport { useAnimatedValue } from './lib/hooks/use-animated-value.js';\nexport { useSignal } from './lib/hooks/use-signal.js';\nexport { useSvgPath } from './lib/hooks/use-svg-path.js';\nexport type {\n Canvas,\n CanvasMeasurementService,\n PibblController,\n PibblComponent,\n PibblContainerChild,\n PibblElement,\n PibblElementType,\n PibblEmptyNode,\n PibblKey,\n PibblNode,\n PibblNodeInput,\n PibblPhysics2DPropExtension,\n PibblPrimitiveComponent,\n PibblTextChild,\n PibblTextInput,\n PibblRenderResult,\n PibblSizeQuery,\n PibblStyleRule,\n PibblResponsiveStyle,\n PrimitiveInputOf,\n PrimitiveCapabilities,\n PrimitiveInput,\n PrimitiveProgramProps,\n PrimitiveRender,\n FillStyle,\n MeasureInput,\n MeasureResult,\n PixelGridAlignment,\n NormalizedStyle,\n RenderingContext2D,\n ResolvedStyle,\n SpecifiedStyle,\n StyleResolutionContext,\n StrokeStyle,\n SystemStyle,\n} from './lib/types.js';\nexport type {\n PibblClipboardEvent,\n PibblCompositionEvent,\n PibblDragEvent,\n PibblEvent,\n PibblEventCapturePropName,\n PibblEventHandler,\n PibblEventHandlers,\n PibblEventMap,\n PibblEventParticipationOptions,\n PibblEventPhase,\n PibblEventPropName,\n PibblEventTarget,\n PibblEventTargetOptions,\n PibblEventTargetSnapshot,\n PibblEventType,\n PibblFocusEvent,\n PibblInputEvent,\n PibblKeyboardEvent,\n PibblLogicalMouseEvent,\n PibblPointerEvent,\n PibblPointerEvents,\n PibblTouchEvent,\n PibblWheelEvent,\n} from './lib/events/types.js';\n\nexport { useManipulation } from './lib/manipulation/controller.js';\nexport { ManipulationFrame } from './lib/manipulation/frame.js';\nexport { DragHandle, ResizeHandle, ResizeHandles, RotationHandle } from './lib/manipulation/handles.js';\nexport type { PibblManipulationController, PibblManipulationOptions, PibblManipulationSnapshot, PibblManipulationEvent, PibblManipulationCommitEvent, PibblManipulationCancelEvent, PibblManipulationCancelReason, PibblManipulationGeometry, PibblManipulationOperation, PibblManipulationActive, PibblManipulationFrameProps, PibblManipulationMoveInput, PibblManipulationResizeInput, PibblManipulationRotateInput } from './lib/manipulation/controller-types.js';\nexport type { PibblManipulationBox, PibblManipulationPoint, PibblManipulationWhen, PibblResizePosition } from './lib/manipulation/types.js';\nexport type { PibblDragHandleProps, PibblDragHandleStyle } from './lib/manipulation/handles.js';\n\nexport type { PibblResizeHandleProps, PibblResizeHandlesProps, PibblRotationHandleProps, PibblResizeHandleStyle, PibblRotationHandleStyle, PibblManipulationReadoutStyle, PibblManipulationReadoutStateStyle, PibblRotationConnectorStyle, PibblRotationArcStyle } from './lib/manipulation/handles.js';\n\nexport { degrees } from './lib/manipulation/degrees.js';\nexport { Manipulable } from './lib/manipulation/manipulable.js';\nexport type { PibblManipulableProps } from './lib/manipulation/manipulable.js';\n\nexport { defineTexture, useTexture } from './lib/textures/texture.js';\nexport type { Texture, TexturePaint, TextureRecipe, TextureDefinition, TextureOptions, TexturePlacement, TextureContext, TextureFrame } from './lib/textures/texture.js';\n\nexport { HtmlBox } from './lib/components/html-box.js';\nexport type { HtmlBoxProps, HtmlBoxStyle, HtmlMountCallback, HtmlUpdateFunction, HtmlBoxFocusState } from './lib/html/types.js';\n\nexport { fade } from './lib/transitions/fade.js';\nexport type { PibblTransitionEffect } from './lib/transitions/fade.js';\nexport type { PibblTransitionBinding } from './lib/transitions/binding.js';\nexport { useVisibilityTransition } from './lib/hooks/use-visibility-transition.js';\nexport type { PibblVisibilityTransition, PibblVisibilityTransitionOptions, PibblVisibilityTransitionResult, PibblVisibilityTransitionStatus } from './lib/hooks/use-visibility-transition.js';\n\nexport { embers } from './lib/transitions/embers.js';\nexport type { PibblEmbersOptions } from './lib/transitions/embers.js';\n\nexport { hologram } from './lib/transitions/hologram.js';\nexport type { PibblHologramOptions } from './lib/transitions/hologram.js';\nexport { bifrost } from './lib/transitions/bifrost.js';\nexport type { PibblBifrostOptions } from './lib/transitions/bifrost.js';\n\nexport { slide, zoom, wipe, blurReveal, dissolve } from './lib/transitions/common.js';\nexport type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRevealOptions, PibblDissolveOptions } from './lib/transitions/common.js';\n\nexport { defineTransition } from './lib/transitions/define-transition.js';\nexport type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';\n\nexport type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEP,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,oBAAsC;AAC/C,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,WAAyC;AAClD;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4C;AACrD;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OA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B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,cAA6B;AACtC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,OAEK;AACP,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAgE3B,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,YAAY,cAAc,eAAe,sBAAsB;AAOxE,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAG5B,SAAS,eAAe,kBAAkB;AAG1C,SAAS,eAAe;AAGxB,SAAS,YAAY;AAGrB,SAAS,+BAA+B;AAGxC,SAAS,cAAc;AAGvB,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AAGxB,SAAS,OAAO,MAAM,MAAM,YAAY,gBAAgB;AAGxD,SAAS,wBAAwB;",
4
+ "sourcesContent": ["export {\n meshTransform,\n arcBendTransform,\n pathBendTransform,\n type MeshTransformOptions,\n type ArcBendTransformOptions,\n type PathBendTransformOptions,\n transformPath,\n composeTransforms,\n affineTransform,\n quadTransform,\n envelopeTransform,\n type PathTransform,\n type PathPoint,\n type PathRect,\n type TransformPathOptions,\n type QuadTransformOptions,\n type PathQuadCorners,\n type PathQuadMode,\n type BendTransformOptions,\n type EnvelopeTransformOptions,\n type EnvelopeGuide,\n type PathGuide,\n type PathGuideOptions,\n type PathGuideStation,\n} from './lib/geometry/path-transforms.js';\nexport { type PathBendArc, type PathBendAlign, type PathBendBaseline, type PathBendFit, type PathBendOverflow } from './lib/geometry/path-bending.js';\nexport { flattenPathWang } from './lib/geometry/path-wang.js';\nexport { simplifyPathRadial } from './lib/geometry/path-radial.js';\nexport { PathGeometry, type PathSegment } from './lib/geometry/path-geometry.js';\nexport { toPath2D, toSvgPathData } from './lib/geometry/path-conversion.js';\nexport {\n flattenPath,\n simplifyPath,\n subdividePath,\n type FlattenPathOptions,\n type SimplifyPathOptions,\n type SubdividePathOptions,\n} from './lib/geometry/path-utilities.js';\n// components\nexport { Arc, type ArcProps, type ArcStyle } from './lib/components/arc.js';\nexport {\n Circle,\n type CircleProps,\n type CircleStyle,\n} from './lib/components/circle.js';\nexport { Clip, type ClipProps, type ClipStyle } from './lib/components/clip.js';\nexport {\n Ellipse,\n type EllipseProps,\n type EllipseStyle,\n} from './lib/components/ellipse.js';\nexport {\n Group,\n type GroupProps,\n type GStyle,\n} from './lib/components/g.js';\nexport {\n HorizontalLine,\n type HorizontalLineProps,\n type HorizontalLineStyle,\n} from './lib/components/horizontal-line.js';\n\nexport {\n Image,\n type ImageProps,\n} from './lib/components/img.js';\nexport {\n Layer,\n type LayerProps,\n type LayerStyle,\n} from './lib/components/layer.js';\nexport {\n Line,\n type LineProps,\n type LineStyle,\n} from './lib/components/line.js';\nexport { Path, type PathProps } from './lib/components/path.js';\nexport {\n Polygon,\n type PolygonProps,\n type PolygonStyle,\n} from './lib/components/polygon.js';\nexport {\n RegularPolygon,\n type RegularPolygonProps,\n type RegularPolygonStyle,\n} from './lib/components/regular-polygon.js';\nexport {\n Rectangle,\n type RectangleProps,\n} from './lib/components/rect.js';\nexport {\n Star,\n type StarProps,\n type StarStyle,\n} from './lib/components/star.js';\nexport {\n SvgPath,\n type SvgPathProps,\n} from './lib/components/svg-path.js';\nexport { Text, type TextProps } from './lib/components/text.js';\nexport {\n VerticalLine,\n type VerticalLineProps,\n type VerticalLineStyle,\n} from './lib/components/vertical-line.js';\nexport {\n Wedge,\n type WedgeProps,\n type WedgeStyle,\n} from './lib/components/wedge.js';\nexport {\n createArcPath,\n createWedgePath,\n type ArcPathOptions,\n type WedgePathOptions,\n} from './lib/geometry/circular-sweep.js';\nexport {\n createCirclePath,\n type CirclePathOptions,\n} from './lib/geometry/circle.js';\nexport {\n createEllipsePath,\n type EllipsePathOptions,\n} from './lib/geometry/ellipse.js';\nexport {\n createLinePath,\n type LinePathOptions,\n} from './lib/geometry/line.js';\nexport {\n createPolygonPath,\n type PolygonPathOptions,\n} from './lib/geometry/polygon.js';\nexport {\n createRectanglePath,\n type RectanglePathOptions,\n} from './lib/geometry/rectangle.js';\nexport {\n createRegularPolygonPath,\n type RegularPolygonNumericSize,\n type RegularPolygonPathOptions,\n type RegularPolygonPathPosition,\n} from './lib/geometry/regular-polygon.js';\nexport {\n createStarPath,\n type StarPathOptions,\n} from './lib/geometry/star.js';\nexport {\n createSvgPath,\n type SvgPathOptions,\n} from './lib/geometry/svg-path.js';\nexport type { RoundedCornerPathOptions } from './lib/geometry/rounded-corners.js';\nexport { pibbl } from './lib/pibbl.js';\nexport {\n batch,\n computed,\n isSignal,\n signal,\n untracked,\n} from './lib/signals/graph.js';\nexport { resolveSignalValue } from './lib/signals/resolve-signal-value.js';\nexport type {\n Signal,\n SignalEquals,\n SignalOptions,\n SignalValue,\n WritableSignal,\n} from './lib/signals/types.js';\nexport { easing } from './lib/animation/easing.js';\nexport {\n defineAnimation,\n keyframes,\n spring,\n stepper,\n tween,\n} from './lib/animation/definition.js';\nexport {\n marker,\n parallel,\n repeat,\n sequence,\n drive,\n wait,\n} from './lib/animation/program.js';\nexport type {\n PibblAnimationDefinition,\n PibblAnimationOptions,\n PibblAnimationProgram,\n PibblAnimationRepeatDirection,\n PibblAnimationRepeatOptions,\n PibblAnimationSampleInput,\n PibblAnimatedValueOptions,\n PibblAnimationTarget,\n PibblPlayback,\n PibblPlaybackEvent,\n PibblPlaybackOptions,\n PibblPlaybackStatus,\n PibblEasing,\n PibblInterpolator,\n PibblKeyframesOptions,\n PibblSpringOptions,\n PibblStepperOptions,\n PibblTweenOptions,\n} from './lib/animation/types.js';\nexport type {\n PibblConfig,\n PibblFit,\n PibblFixedViewportConfig,\n PibblPixelRatio,\n PibblResponsiveViewportConfig,\n} from './lib/surface/types.js';\nexport {\n Absolute,\n type AbsoluteProps,\n type AbsoluteStyle,\n} from './lib/layout/absolute.js';\nexport {\n Overlay,\n type OverlayProps,\n type OverlayStyle,\n} from './lib/layout/overlay.js';\nexport {\n Flow,\n type FlowProps,\n type FlowStyle,\n} from './lib/layout/flow.js';\nexport {\n Flex,\n type FlexProps,\n type FlexStyle,\n} from './lib/layout/flex.js';\nexport {\n Grid,\n type GridProps,\n type GridStyle,\n type GridTrack,\n} from './lib/layout/grid.js';\nexport { measureElement } from './lib/layout/measure.js';\n\nexport {\n FocusManagement,\n KeyboardNavigation,\n type FocusManagementProps,\n type KeyboardNavigationProps,\n} from './lib/focus/policy-components.js';\nexport type { PibblKeyboardNavigationOptions } from './lib/focus/types.js';\n\nexport { definePrimitive } from './lib/define-primitive.js';\nexport { defineRenderLayer } from './lib/render-layer/define-render-layer.js';\nexport type {\n PibblRenderLayerComponentProps,\n PibblRenderLayerDefinition,\n PibblRenderLayerFrame,\n PibblRenderLayerContext,\n PibblRenderLayerHit,\n PibblRenderLayerInput,\n PibblRenderLayerInteraction,\n PibblRenderLayerInteractionSnapshot,\n PibblRenderLayerProps,\n PibblRenderLayerSize,\n PibblRenderLayerStyle,\n PibblRenderLayerTarget,\n} from './lib/render-layer/types.js';\nexport { createElement } from './lib/element/create-element.js';\nexport { Fragment } from './lib/element/fragment.js';\nexport type {\n BoxStyle,\n CursorStyle,\n EdgeValues,\n FlexItemStyle,\n GridItemStyle,\n ImgStyle,\n LayoutItemStyle,\n Length,\n PaintStyle,\n PathStyle,\n RectStyle,\n ResolvedBoxStyle,\n SvgPathStyle,\n TextFit,\n TextStyle,\n Percentage,\n RoundedCornerStyle,\n} from './lib/style/types.js';\nexport {\n LayoutDiagnostic,\n layoutDiagnostic,\n type LayoutDiagnosticContext,\n type LayoutDiagnosticInput,\n} from './lib/style/diagnostics.js';\nexport { normalizeEdges } from './lib/style/normalize.js';\nexport { resolveLength } from './lib/style/resolve-length.js';\nexport { resolveBox } from './lib/layout/box.js';\nexport type {\n PibblFilter,\n} from './lib/style/filter-types.js';\nexport type {\n Constraints,\n Edges,\n LayoutBox,\n Size,\n} from './lib/layout/types.js';\n// hooks\nexport { useCursor } from './lib/hooks/use-cursor.js';\nexport { useCanvasContext } from './lib/hooks/use-canvas-context.js';\nexport { useComputed } from './lib/hooks/use-computed.js';\nexport { useConst } from './lib/hooks/use-const.js';\nexport { useEventListener } from './lib/hooks/use-event-listener.js';\nexport { useEventTarget } from './lib/hooks/use-event-target.js';\nexport { useLinePath } from './lib/hooks/use-line-path.js';\nexport { useLayoutBox } from './lib/hooks/use-layout-box.js';\nexport { useRectPath } from './lib/hooks/use-rect-path.js';\nexport { useRef, type PibblRef } from './lib/hooks/use-ref.js';\nexport { usePlayback } from './lib/hooks/use-playback.js';\nexport {\n useReaction,\n type PibblReactionOptions,\n} from './lib/hooks/use-reaction.js';\nexport { useAnimatedValue } from './lib/hooks/use-animated-value.js';\nexport { useSignal } from './lib/hooks/use-signal.js';\nexport { useSvgPath } from './lib/hooks/use-svg-path.js';\nexport type {\n Canvas,\n CanvasMeasurementService,\n PibblController,\n PibblComponent,\n PibblContainerChild,\n PibblElement,\n PibblElementType,\n PibblEmptyNode,\n PibblKey,\n PibblNode,\n PibblNodeInput,\n PibblPhysics2DPropExtension,\n PibblPrimitiveComponent,\n PibblTextChild,\n PibblTextInput,\n PibblRenderResult,\n PibblSizeQuery,\n PibblStyleRule,\n PibblResponsiveStyle,\n PrimitiveInputOf,\n PrimitiveCapabilities,\n PrimitiveInput,\n PrimitiveProgramProps,\n PrimitiveRender,\n FillStyle,\n MeasureInput,\n MeasureResult,\n PixelGridAlignment,\n NormalizedStyle,\n RenderingContext2D,\n ResolvedStyle,\n SpecifiedStyle,\n StyleResolutionContext,\n StrokeStyle,\n SystemStyle,\n} from './lib/types.js';\nexport type {\n PibblClipboardEvent,\n PibblCompositionEvent,\n PibblDragEvent,\n PibblEvent,\n PibblEventCapturePropName,\n PibblEventHandler,\n PibblEventHandlers,\n PibblEventMap,\n PibblEventParticipationOptions,\n PibblEventPhase,\n PibblEventPropName,\n PibblEventTarget,\n PibblEventTargetOptions,\n PibblEventTargetSnapshot,\n PibblEventType,\n PibblFocusEvent,\n PibblInputEvent,\n PibblKeyboardEvent,\n PibblLogicalMouseEvent,\n PibblPointerEvent,\n PibblPointerEvents,\n PibblTouchEvent,\n PibblWheelEvent,\n} from './lib/events/types.js';\n\nexport { useManipulation } from './lib/manipulation/controller.js';\nexport { ManipulationFrame } from './lib/manipulation/frame.js';\nexport { DragHandle, ResizeHandle, ResizeHandles, RotationHandle } from './lib/manipulation/handles.js';\nexport type { PibblManipulationController, PibblManipulationOptions, PibblManipulationSnapshot, PibblManipulationEvent, PibblManipulationCommitEvent, PibblManipulationCancelEvent, PibblManipulationCancelReason, PibblManipulationGeometry, PibblManipulationOperation, PibblManipulationActive, PibblManipulationFrameProps, PibblManipulationMoveInput, PibblManipulationResizeInput, PibblManipulationRotateInput } from './lib/manipulation/controller-types.js';\nexport type { PibblManipulationBox, PibblManipulationPoint, PibblManipulationWhen, PibblResizePosition } from './lib/manipulation/types.js';\nexport type { PibblDragHandleProps, PibblDragHandleStyle } from './lib/manipulation/handles.js';\n\nexport type { PibblResizeHandleProps, PibblResizeHandlesProps, PibblRotationHandleProps, PibblResizeHandleStyle, PibblRotationHandleStyle, PibblManipulationReadoutStyle, PibblManipulationReadoutStateStyle, PibblRotationConnectorStyle, PibblRotationArcStyle } from './lib/manipulation/handles.js';\n\nexport { degrees } from './lib/manipulation/degrees.js';\nexport { Manipulable } from './lib/manipulation/manipulable.js';\nexport type { PibblManipulableProps } from './lib/manipulation/manipulable.js';\n\nexport { defineTexture, useTexture } from './lib/textures/texture.js';\nexport type { Texture, TexturePaint, TextureRecipe, TextureDefinition, TextureOptions, TexturePlacement, TextureContext, TextureFrame } from './lib/textures/texture.js';\n\nexport { HtmlBox } from './lib/components/html-box.js';\nexport type { HtmlBoxProps, HtmlBoxStyle, HtmlMountCallback, HtmlUpdateFunction, HtmlBoxFocusState } from './lib/html/types.js';\n\nexport { fade } from './lib/transitions/fade.js';\nexport type { PibblTransitionEffect } from './lib/transitions/fade.js';\nexport type { PibblTransitionBinding } from './lib/transitions/binding.js';\nexport { useVisibilityTransition } from './lib/hooks/use-visibility-transition.js';\nexport type { PibblVisibilityTransition, PibblVisibilityTransitionOptions, PibblVisibilityTransitionResult, PibblVisibilityTransitionStatus } from './lib/hooks/use-visibility-transition.js';\n\nexport { embers } from './lib/transitions/embers.js';\nexport type { PibblEmbersOptions } from './lib/transitions/embers.js';\n\nexport { hologram } from './lib/transitions/hologram.js';\nexport type { PibblHologramOptions } from './lib/transitions/hologram.js';\nexport { bifrost } from './lib/transitions/bifrost.js';\nexport type { PibblBifrostOptions } from './lib/transitions/bifrost.js';\n\nexport { slide, zoom, wipe, blurReveal, dissolve } from './lib/transitions/common.js';\nexport type { PibblSlideOptions, PibblZoomOptions, PibblWipeOptions, PibblBlurRevealOptions, PibblDissolveOptions } from './lib/transitions/common.js';\n\nexport { defineTransition } from './lib/transitions/define-transition.js';\nexport type { PibblTransitionDefinition, PibblTransitionRenderFrame } from './lib/transitions/define-transition.js';\n\nexport type { PibblEmbersPhysicsOptions, PibblEmberCollision } from './lib/transitions/embers-physics.js';\n\nexport { recordFrames, exportGif } from './lib/recording/recording.js';\nexport type {\n PibblFrameRecordingOptions,\n PibblFrameRecordingSession,\n PibblRecordedFrameInfo,\n PibblRecordedFrame,\n PibblFrameRecording,\n PibblGifExportOptions,\n PibblRenderCompletion,\n} from './lib/recording/types.js';\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEP,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,oBAAsC;AAC/C,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,WAAyC;AAClD;AAAA,EACE;AAAA,OAGK;AACP,SAAS,YAA4C;AACrD;AAAA,EACE;AAAA,OAGK;AACP;AAAA,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AAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAW3B,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,cAA6B;AACtC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,OAEK;AACP,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAgE3B,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,YAAY,cAAc,eAAe,sBAAsB;AAOxE,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAG5B,SAAS,eAAe,kBAAkB;AAG1C,SAAS,eAAe;AAGxB,SAAS,YAAY;AAGrB,SAAS,+BAA+B;AAGxC,SAAS,cAAc;AAGvB,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AAGxB,SAAS,OAAO,MAAM,MAAM,YAAY,gBAAgB;AAGxD,SAAS,wBAAwB;AAKjC,SAAS,cAAc,iBAAiB;",
6
6
  "names": []
7
7
  }
@@ -26,6 +26,8 @@ export type { PibblInternalAdvanceLane, PibblInternalSimulationOwner, } from "./
26
26
  import type { PibblBackendEventTargetOptions, PibblBackendToken, PibblNestedResolverInput } from "./lib/backend/types.js";
27
27
  import { type PibblEventTargetRegistration } from "./lib/events/registrations.js";
28
28
  import type { PibblEventHandlers, PibblPointerEvents } from "./lib/events/types.js";
29
+ export { captureSeriesInspectionFrame } from "./lib/series-inspection-frame.js";
30
+ export { borrowDispatchResource } from "./lib/events/event-facade.js";
29
31
  import { type PibblElementSource } from "./lib/element/metadata.js";
30
32
  import type { Canvas } from "./lib/types.js";
31
33
  /**
package/dist/internal.js CHANGED
@@ -33,6 +33,8 @@ import {
33
33
  } from "./lib/events/registrations.js";
34
34
  import { PibblPaintEntryKind } from "./lib/events/paint-entry.js";
35
35
  import { getCurrentPibblInstance, GLOBAL_STATE } from "./lib/global-state.js";
36
+ import { captureSeriesInspectionFrame } from "./lib/series-inspection-frame.js";
37
+ import { borrowDispatchResource } from "./lib/events/event-facade.js";
36
38
  import {
37
39
  requireHookContext,
38
40
  useInternalHookSlot as useInternalHookSlot2
@@ -263,7 +265,9 @@ import { getCurrentWorldTransform as getCurrentWorldTransform2 } from "./lib/ren
263
265
  import { borrowTextureRaster, resolveTexturePaint, validateTexturePaint } from "./lib/textures/texture-protocol.js";
264
266
  export {
265
267
  ManualSchedulerDriver as PibblInternalManualSchedulerDriver,
268
+ borrowDispatchResource,
266
269
  borrowTextureRaster,
270
+ captureSeriesInspectionFrame,
267
271
  createBackendToken,
268
272
  defineBackendPrimitive,
269
273
  derivePrimitive,