@motionscript/core 0.1.0-alpha.9 → 0.1.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1064) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/assets/asset-index.d.ts +1 -8
  3. package/dist/assets/asset-index.d.ts.map +1 -1
  4. package/dist/assets/asset-index.js +1 -8
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +10 -72
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +3 -29
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts +8 -20
  11. package/dist/assets/errors.d.ts.map +1 -1
  12. package/dist/assets/errors.js +8 -20
  13. package/dist/assets/errors.js.map +1 -1
  14. package/dist/assets/index.d.ts.map +1 -1
  15. package/dist/assets/index.js.map +1 -1
  16. package/dist/assets/manager.d.ts +9 -51
  17. package/dist/assets/manager.d.ts.map +1 -1
  18. package/dist/assets/manager.js +13 -78
  19. package/dist/assets/manager.js.map +1 -1
  20. package/dist/assets/record.d.ts +2 -18
  21. package/dist/assets/record.d.ts.map +1 -1
  22. package/dist/assets/record.js.map +1 -1
  23. package/dist/assets/scope.d.ts +3 -18
  24. package/dist/assets/scope.d.ts.map +1 -1
  25. package/dist/assets/scope.js +2 -11
  26. package/dist/assets/scope.js.map +1 -1
  27. package/dist/attributes/audio/effects/chain.d.ts +2 -12
  28. package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
  29. package/dist/attributes/audio/effects/chain.js +1 -7
  30. package/dist/attributes/audio/effects/chain.js.map +1 -1
  31. package/dist/attributes/audio/effects/registry.d.ts +3 -18
  32. package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
  33. package/dist/attributes/audio/effects/registry.js +4 -23
  34. package/dist/attributes/audio/effects/registry.js.map +1 -1
  35. package/dist/attributes/audio/ramp.d.ts +5 -38
  36. package/dist/attributes/audio/ramp.d.ts.map +1 -1
  37. package/dist/attributes/audio/ramp.js +3 -28
  38. package/dist/attributes/audio/ramp.js.map +1 -1
  39. package/dist/attributes/audio/request.d.ts +10 -80
  40. package/dist/attributes/audio/request.d.ts.map +1 -1
  41. package/dist/attributes/audio/request.js +1 -4
  42. package/dist/attributes/audio/request.js.map +1 -1
  43. package/dist/attributes/audio/schedule.d.ts +2 -12
  44. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  45. package/dist/attributes/audio/schedule.js +2 -11
  46. package/dist/attributes/audio/schedule.js.map +1 -1
  47. package/dist/attributes/audio/sound.d.ts +2 -26
  48. package/dist/attributes/audio/sound.d.ts.map +1 -1
  49. package/dist/attributes/audio/sound.js +1 -9
  50. package/dist/attributes/audio/sound.js.map +1 -1
  51. package/dist/attributes/audio/transition.d.ts +1 -8
  52. package/dist/attributes/audio/transition.d.ts.map +1 -1
  53. package/dist/attributes/audio/transition.js.map +1 -1
  54. package/dist/attributes/layout/alignment.d.ts +6 -38
  55. package/dist/attributes/layout/alignment.d.ts.map +1 -1
  56. package/dist/attributes/layout/alignment.js.map +1 -1
  57. package/dist/attributes/layout/insets.d.ts +2 -27
  58. package/dist/attributes/layout/insets.d.ts.map +1 -1
  59. package/dist/attributes/layout/insets.js.map +1 -1
  60. package/dist/attributes/layout/matrix2d.d.ts +29 -114
  61. package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js +26 -110
  63. package/dist/attributes/layout/matrix2d.js.map +1 -1
  64. package/dist/attributes/layout/size.d.ts +3 -25
  65. package/dist/attributes/layout/size.d.ts.map +1 -1
  66. package/dist/attributes/layout/size.js +2 -18
  67. package/dist/attributes/layout/size.js.map +1 -1
  68. package/dist/attributes/layout/space3d.d.ts +16 -79
  69. package/dist/attributes/layout/space3d.d.ts.map +1 -1
  70. package/dist/attributes/layout/space3d.js +17 -81
  71. package/dist/attributes/layout/space3d.js.map +1 -1
  72. package/dist/attributes/layout/transform3d.d.ts +2 -23
  73. package/dist/attributes/layout/transform3d.d.ts.map +1 -1
  74. package/dist/attributes/layout/transform3d.js +1 -7
  75. package/dist/attributes/layout/transform3d.js.map +1 -1
  76. package/dist/attributes/layout/world-transform.d.ts +2 -16
  77. package/dist/attributes/layout/world-transform.d.ts.map +1 -1
  78. package/dist/attributes/layout/world-transform.js.map +1 -1
  79. package/dist/attributes/properties/decorator.d.ts +13 -73
  80. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  81. package/dist/attributes/properties/decorator.js +9 -40
  82. package/dist/attributes/properties/decorator.js.map +1 -1
  83. package/dist/attributes/properties/typed.d.ts +6 -45
  84. package/dist/attributes/properties/typed.d.ts.map +1 -1
  85. package/dist/attributes/properties/typed.js +6 -37
  86. package/dist/attributes/properties/typed.js.map +1 -1
  87. package/dist/attributes/render3d/orbit.d.ts +11 -83
  88. package/dist/attributes/render3d/orbit.d.ts.map +1 -1
  89. package/dist/attributes/render3d/orbit.js +10 -73
  90. package/dist/attributes/render3d/orbit.js.map +1 -1
  91. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
  92. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  94. package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
  95. package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
  96. package/dist/attributes/shape/corners/corner-style.js +2 -12
  97. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  98. package/dist/attributes/shape/corners/corners.d.ts +2 -21
  99. package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js +2 -12
  101. package/dist/attributes/shape/corners/corners.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
  103. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  104. package/dist/attributes/shape/effects/backdrop.js +3 -26
  105. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  106. package/dist/attributes/shape/effects/chain.d.ts +36 -328
  107. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  108. package/dist/attributes/shape/effects/chain.js +24 -242
  109. package/dist/attributes/shape/effects/chain.js.map +1 -1
  110. package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
  111. package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
  112. package/dist/attributes/shape/effects/effect-data.js +6 -33
  113. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
  115. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
  117. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
  119. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
  121. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
  123. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
  125. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
  127. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
  129. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
  131. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/blur.js +0 -1
  133. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
  135. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
  137. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
  139. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
  141. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  142. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
  143. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  144. package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
  145. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  146. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
  147. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  148. package/dist/attributes/shape/effects/implementations/curves.js +1 -6
  149. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  150. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
  151. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  152. package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
  153. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  154. package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
  155. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  156. package/dist/attributes/shape/effects/implementations/dither.js +1 -7
  157. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  158. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
  159. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  160. package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
  161. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  162. package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
  163. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  164. package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
  165. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  166. package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
  167. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  168. package/dist/attributes/shape/effects/implementations/edges.js +0 -1
  169. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  170. package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
  171. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  172. package/dist/attributes/shape/effects/implementations/glass.js +0 -1
  173. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  174. package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
  175. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  176. package/dist/attributes/shape/effects/implementations/glow.js +1 -9
  177. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  178. package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
  179. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  180. package/dist/attributes/shape/effects/implementations/grain.js +0 -1
  181. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  182. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
  183. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  184. package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
  185. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  186. package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
  187. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  188. package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
  189. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  190. package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
  191. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  192. package/dist/attributes/shape/effects/implementations/invert.js +0 -1
  193. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  194. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
  195. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  196. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
  197. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  198. package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
  199. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  200. package/dist/attributes/shape/effects/implementations/lut.js +2 -8
  201. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  202. package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
  203. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  204. package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
  205. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  206. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
  207. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  208. package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
  209. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  210. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
  211. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  212. package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
  213. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  214. package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
  215. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  216. package/dist/attributes/shape/effects/implementations/outline.js +0 -1
  217. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  218. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
  219. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  220. package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
  221. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  222. package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
  223. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  224. package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
  225. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  226. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
  227. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  228. package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
  229. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  230. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
  231. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  232. package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
  233. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  234. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
  235. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  236. package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
  237. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  238. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
  239. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  240. package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
  241. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  242. package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
  243. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  244. package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
  245. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  246. package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
  247. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  248. package/dist/attributes/shape/effects/implementations/shader.js +2 -9
  249. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  250. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
  251. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  252. package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
  253. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  254. package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
  255. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  256. package/dist/attributes/shape/effects/implementations/streak.js +0 -1
  257. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  258. package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
  259. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  260. package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
  261. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  262. package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
  263. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  264. package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
  265. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  266. package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
  267. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  268. package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
  269. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  270. package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
  271. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  272. package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
  273. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  274. package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
  275. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  276. package/dist/attributes/shape/effects/implementations/wave.js +1 -5
  277. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  278. package/dist/attributes/shape/effects/registry.d.ts +6 -41
  279. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  280. package/dist/attributes/shape/effects/registry.js +7 -45
  281. package/dist/attributes/shape/effects/registry.js.map +1 -1
  282. package/dist/attributes/shape/effects/spec.d.ts +6 -30
  283. package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
  284. package/dist/attributes/shape/effects/spec.js +3 -9
  285. package/dist/attributes/shape/effects/spec.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.d.ts +1 -17
  287. package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
  288. package/dist/attributes/shape/fill/blend.js +2 -15
  289. package/dist/attributes/shape/fill/blend.js.map +1 -1
  290. package/dist/attributes/shape/fill/chain.d.ts +17 -125
  291. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  292. package/dist/attributes/shape/fill/chain.js +22 -109
  293. package/dist/attributes/shape/fill/chain.js.map +1 -1
  294. package/dist/attributes/shape/fill/coerce.d.ts +10 -35
  295. package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
  296. package/dist/attributes/shape/fill/coerce.js +12 -47
  297. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  298. package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
  299. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  300. package/dist/attributes/shape/fill/color/parser.js +35 -96
  301. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  302. package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
  303. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
  304. package/dist/attributes/shape/fill/gradient-stops.js +2 -13
  305. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  306. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
  307. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
  308. package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
  309. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
  311. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
  312. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  313. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
  314. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  315. package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
  316. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  317. package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
  318. package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
  319. package/dist/attributes/shape/fill/implementations/grid.js +2 -8
  320. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  321. package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
  322. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  323. package/dist/attributes/shape/fill/implementations/image.js +6 -23
  324. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  325. package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
  326. package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
  327. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  328. package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
  329. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  330. package/dist/attributes/shape/fill/implementations/shader.js +5 -17
  331. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  332. package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
  333. package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
  334. package/dist/attributes/shape/fill/implementations/video.js +12 -50
  335. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  336. package/dist/attributes/shape/fill/lerp.d.ts +2 -13
  337. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  338. package/dist/attributes/shape/fill/lerp.js +2 -9
  339. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  340. package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
  341. package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
  342. package/dist/attributes/shape/fill/media-preset.js +8 -35
  343. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  344. package/dist/attributes/shape/fill/registry.d.ts +2 -26
  345. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  346. package/dist/attributes/shape/fill/registry.js +5 -40
  347. package/dist/attributes/shape/fill/registry.js.map +1 -1
  348. package/dist/attributes/shape/fill/union.d.ts +6 -30
  349. package/dist/attributes/shape/fill/union.d.ts.map +1 -1
  350. package/dist/attributes/shape/fill/union.js +1 -9
  351. package/dist/attributes/shape/fill/union.js.map +1 -1
  352. package/dist/attributes/shape/filters/chain.d.ts +15 -168
  353. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  354. package/dist/attributes/shape/filters/chain.js +8 -132
  355. package/dist/attributes/shape/filters/chain.js.map +1 -1
  356. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
  357. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  358. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  359. package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
  360. package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
  361. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  362. package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
  363. package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
  364. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  365. package/dist/attributes/shape/filters/index.d.ts +1 -6
  366. package/dist/attributes/shape/filters/index.d.ts.map +1 -1
  367. package/dist/attributes/shape/filters/index.js +0 -2
  368. package/dist/attributes/shape/filters/index.js.map +1 -1
  369. package/dist/attributes/shape/filters/registry.d.ts +5 -35
  370. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  371. package/dist/attributes/shape/filters/registry.js +7 -50
  372. package/dist/attributes/shape/filters/registry.js.map +1 -1
  373. package/dist/attributes/shape/filters/union.d.ts +10 -51
  374. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  375. package/dist/attributes/shape/filters/union.js.map +1 -1
  376. package/dist/attributes/shape/path/anchors.d.ts +18 -106
  377. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  378. package/dist/attributes/shape/path/anchors.js +15 -124
  379. package/dist/attributes/shape/path/anchors.js.map +1 -1
  380. package/dist/attributes/shape/path/bezier.d.ts +6 -54
  381. package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
  382. package/dist/attributes/shape/path/bezier.js +10 -98
  383. package/dist/attributes/shape/path/bezier.js.map +1 -1
  384. package/dist/attributes/shape/path/index.d.ts +1 -11
  385. package/dist/attributes/shape/path/index.d.ts.map +1 -1
  386. package/dist/attributes/shape/path/index.js +1 -11
  387. package/dist/attributes/shape/path/index.js.map +1 -1
  388. package/dist/attributes/shape/path/measure.d.ts +5 -41
  389. package/dist/attributes/shape/path/measure.d.ts.map +1 -1
  390. package/dist/attributes/shape/path/measure.js +8 -57
  391. package/dist/attributes/shape/path/measure.js.map +1 -1
  392. package/dist/attributes/shape/path/morph.d.ts +4 -41
  393. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  394. package/dist/attributes/shape/path/morph.js +17 -117
  395. package/dist/attributes/shape/path/morph.js.map +1 -1
  396. package/dist/attributes/shape/path/ops.d.ts +5 -19
  397. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  398. package/dist/attributes/shape/path/ops.js.map +1 -1
  399. package/dist/attributes/shape/path/types.d.ts +10 -67
  400. package/dist/attributes/shape/path/types.d.ts.map +1 -1
  401. package/dist/attributes/shape/path/types.js +0 -1
  402. package/dist/attributes/shape/path/types.js.map +1 -1
  403. package/dist/attributes/shape/path/walk.d.ts +9 -63
  404. package/dist/attributes/shape/path/walk.d.ts.map +1 -1
  405. package/dist/attributes/shape/path/walk.js +21 -100
  406. package/dist/attributes/shape/path/walk.js.map +1 -1
  407. package/dist/attributes/shape/shaders/language.d.ts +2 -14
  408. package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
  409. package/dist/attributes/shape/shaders/language.js +1 -8
  410. package/dist/attributes/shape/shaders/language.js.map +1 -1
  411. package/dist/attributes/shape/shaders/pack.d.ts +13 -78
  412. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  413. package/dist/attributes/shape/shaders/pack.js +1 -10
  414. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  415. package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
  416. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  417. package/dist/attributes/shape/shaders/resolve.js +3 -28
  418. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  419. package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
  420. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
  421. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  422. package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
  423. package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
  424. package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
  425. package/dist/attributes/shape/shadow/shadow.js +0 -3
  426. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  427. package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
  428. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  429. package/dist/attributes/shape/stroke/stroke.js +0 -6
  430. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  431. package/dist/attributes/shared/operators.d.ts +1 -8
  432. package/dist/attributes/shared/operators.d.ts.map +1 -1
  433. package/dist/attributes/shared/operators.js.map +1 -1
  434. package/dist/attributes/text/index.d.ts +1 -11
  435. package/dist/attributes/text/index.d.ts.map +1 -1
  436. package/dist/attributes/text/index.js +1 -11
  437. package/dist/attributes/text/index.js.map +1 -1
  438. package/dist/attributes/text/ops.d.ts +4 -30
  439. package/dist/attributes/text/ops.d.ts.map +1 -1
  440. package/dist/attributes/text/ops.js +7 -23
  441. package/dist/attributes/text/ops.js.map +1 -1
  442. package/dist/attributes/text/types.d.ts +5 -28
  443. package/dist/attributes/text/types.d.ts.map +1 -1
  444. package/dist/attributes/text/types.js.map +1 -1
  445. package/dist/browser/chunks/chunk-3ZIUZZC7.js +13 -0
  446. package/dist/browser/chunks/chunk-3ZIUZZC7.js.map +7 -0
  447. package/dist/browser/chunks/chunk-5TDMGUXQ.js +3 -0
  448. package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
  449. package/dist/browser/chunks/chunk-7YOYMMXK.js +6 -0
  450. package/dist/browser/chunks/chunk-7YOYMMXK.js.map +7 -0
  451. package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
  452. package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
  453. package/dist/browser/component.js +1 -1
  454. package/dist/browser/experimental.js +1 -1
  455. package/dist/browser/index.js +1 -1
  456. package/dist/browser/index.js.map +4 -4
  457. package/dist/browser/manifest.json +1 -1
  458. package/dist/browser/sdk.js +1 -1
  459. package/dist/component.d.ts +3 -10
  460. package/dist/component.d.ts.map +1 -1
  461. package/dist/component.js +3 -10
  462. package/dist/component.js.map +1 -1
  463. package/dist/components/builtins/geometry/geometry.d.ts +15 -62
  464. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
  465. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  466. package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
  467. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
  468. package/dist/components/builtins/geometry/shape-outline.js +29 -168
  469. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  470. package/dist/components/builtins/layout/layout.d.ts +1 -14
  471. package/dist/components/builtins/layout/layout.d.ts.map +1 -1
  472. package/dist/components/builtins/layout/layout.js.map +1 -1
  473. package/dist/components/builtins/media/media.d.ts +11 -51
  474. package/dist/components/builtins/media/media.d.ts.map +1 -1
  475. package/dist/components/builtins/media/media.js +3 -7
  476. package/dist/components/builtins/media/media.js.map +1 -1
  477. package/dist/components/builtins/text/number-format.d.ts +14 -47
  478. package/dist/components/builtins/text/number-format.d.ts.map +1 -1
  479. package/dist/components/builtins/text/number-format.js +19 -69
  480. package/dist/components/builtins/text/number-format.js.map +1 -1
  481. package/dist/components/builtins/text/number-pattern.d.ts +3 -37
  482. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
  483. package/dist/components/builtins/text/number-pattern.js +6 -48
  484. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  485. package/dist/components/builtins/text/text-defaults.d.ts +7 -25
  486. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
  487. package/dist/components/builtins/text/text-defaults.js +7 -25
  488. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  489. package/dist/components/builtins/text/text-layout.d.ts +2 -11
  490. package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
  491. package/dist/components/builtins/text/text-layout.js +7 -22
  492. package/dist/components/builtins/text/text-layout.js.map +1 -1
  493. package/dist/components/builtins/text/text.d.ts +8 -46
  494. package/dist/components/builtins/text/text.d.ts.map +1 -1
  495. package/dist/components/builtins/text/text.js.map +1 -1
  496. package/dist/components/builtins/three/canvas3d.d.ts +6 -51
  497. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
  498. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  499. package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
  500. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
  501. package/dist/components/builtins/three/grid-geometry3d.js +8 -46
  502. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  503. package/dist/components/builtins/three/three.d.ts +22 -117
  504. package/dist/components/builtins/three/three.d.ts.map +1 -1
  505. package/dist/components/builtins/three/three.js +5 -17
  506. package/dist/components/builtins/three/three.js.map +1 -1
  507. package/dist/components/factory/api.d.ts.map +1 -1
  508. package/dist/components/factory/api.js.map +1 -1
  509. package/dist/components/factory/views.d.ts.map +1 -1
  510. package/dist/components/factory/views.js +41 -3
  511. package/dist/components/factory/views.js.map +1 -1
  512. package/dist/components/trees/2d/group-bounds.d.ts +12 -41
  513. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
  514. package/dist/components/trees/2d/group-bounds.js +3 -22
  515. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  516. package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
  517. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
  518. package/dist/components/trees/2d/node-lifecycle.js +35 -127
  519. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  520. package/dist/components/trees/2d/node-motion.d.ts +4 -36
  521. package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
  522. package/dist/components/trees/2d/node-motion.js +3 -31
  523. package/dist/components/trees/2d/node-motion.js.map +1 -1
  524. package/dist/components/trees/2d/node-render.d.ts +3 -20
  525. package/dist/components/trees/2d/node-render.d.ts.map +1 -1
  526. package/dist/components/trees/2d/node-render.js +4 -23
  527. package/dist/components/trees/2d/node-render.js.map +1 -1
  528. package/dist/components/trees/2d/node-space.d.ts +4 -23
  529. package/dist/components/trees/2d/node-space.d.ts.map +1 -1
  530. package/dist/components/trees/2d/node-space.js +3 -17
  531. package/dist/components/trees/2d/node-space.js.map +1 -1
  532. package/dist/components/trees/2d/node-transform.d.ts +4 -33
  533. package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
  534. package/dist/components/trees/2d/node-transform.js +4 -33
  535. package/dist/components/trees/2d/node-transform.js.map +1 -1
  536. package/dist/components/trees/2d/node2d.d.ts +112 -622
  537. package/dist/components/trees/2d/node2d.d.ts.map +1 -1
  538. package/dist/components/trees/2d/node2d.js +131 -605
  539. package/dist/components/trees/2d/node2d.js.map +1 -1
  540. package/dist/components/trees/audio/node-audio.d.ts +17 -65
  541. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  542. package/dist/components/trees/audio/node-audio.js +18 -68
  543. package/dist/components/trees/audio/node-audio.js.map +1 -1
  544. package/dist/components/trees/node/node-editor-state.d.ts +5 -45
  545. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
  546. package/dist/components/trees/node/node-editor-state.js +1 -13
  547. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  548. package/dist/components/trees/node/node-reactive.d.ts +6 -54
  549. package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
  550. package/dist/components/trees/node/node-reactive.js +13 -39
  551. package/dist/components/trees/node/node-reactive.js.map +1 -1
  552. package/dist/components/trees/node/node-time.d.ts +2 -15
  553. package/dist/components/trees/node/node-time.d.ts.map +1 -1
  554. package/dist/components/trees/node/node-time.js.map +1 -1
  555. package/dist/components/trees/node/node-walk.d.ts +7 -32
  556. package/dist/components/trees/node/node-walk.d.ts.map +1 -1
  557. package/dist/components/trees/node/node-walk.js +7 -32
  558. package/dist/components/trees/node/node-walk.js.map +1 -1
  559. package/dist/components/trees/node/node.d.ts +43 -248
  560. package/dist/components/trees/node/node.d.ts.map +1 -1
  561. package/dist/components/trees/node/node.js +51 -229
  562. package/dist/components/trees/node/node.js.map +1 -1
  563. package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
  564. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
  565. package/dist/components/trees/root/canvas2d-node.js +7 -47
  566. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  567. package/dist/components/trees/three/node3d.d.ts +24 -112
  568. package/dist/components/trees/three/node3d.d.ts.map +1 -1
  569. package/dist/components/trees/three/node3d.js +22 -104
  570. package/dist/components/trees/three/node3d.js.map +1 -1
  571. package/dist/document/audio.d.ts +9 -21
  572. package/dist/document/audio.d.ts.map +1 -1
  573. package/dist/document/audio.js +13 -28
  574. package/dist/document/audio.js.map +1 -1
  575. package/dist/document/builtins.d.ts +3 -9
  576. package/dist/document/builtins.d.ts.map +1 -1
  577. package/dist/document/builtins.js +43 -89
  578. package/dist/document/builtins.js.map +1 -1
  579. package/dist/document/command-traits.d.ts +15 -30
  580. package/dist/document/command-traits.d.ts.map +1 -1
  581. package/dist/document/command-traits.js +31 -31
  582. package/dist/document/command-traits.js.map +1 -1
  583. package/dist/document/deny-globals.d.ts +9 -43
  584. package/dist/document/deny-globals.d.ts.map +1 -1
  585. package/dist/document/deny-globals.js +18 -58
  586. package/dist/document/deny-globals.js.map +1 -1
  587. package/dist/document/diff.d.ts +6 -16
  588. package/dist/document/diff.d.ts.map +1 -1
  589. package/dist/document/diff.js +5 -11
  590. package/dist/document/diff.js.map +1 -1
  591. package/dist/document/doc-index.d.ts +5 -13
  592. package/dist/document/doc-index.d.ts.map +1 -1
  593. package/dist/document/doc-index.js +0 -2
  594. package/dist/document/doc-index.js.map +1 -1
  595. package/dist/document/expression/compile.d.ts +2 -2
  596. package/dist/document/expression/compile.d.ts.map +1 -1
  597. package/dist/document/expression/compile.js +8 -18
  598. package/dist/document/expression/compile.js.map +1 -1
  599. package/dist/document/expression/index.d.ts +11 -41
  600. package/dist/document/expression/index.d.ts.map +1 -1
  601. package/dist/document/expression/index.js +11 -41
  602. package/dist/document/expression/index.js.map +1 -1
  603. package/dist/document/expression/ops.d.ts +3 -12
  604. package/dist/document/expression/ops.d.ts.map +1 -1
  605. package/dist/document/expression/ops.js +4 -20
  606. package/dist/document/expression/ops.js.map +1 -1
  607. package/dist/document/expression/parse.d.ts +4 -14
  608. package/dist/document/expression/parse.d.ts.map +1 -1
  609. package/dist/document/expression/parse.js +34 -55
  610. package/dist/document/expression/parse.js.map +1 -1
  611. package/dist/document/expression/refs.d.ts +2 -8
  612. package/dist/document/expression/refs.d.ts.map +1 -1
  613. package/dist/document/expression/refs.js +2 -6
  614. package/dist/document/expression/refs.js.map +1 -1
  615. package/dist/document/expression/types.d.ts +18 -63
  616. package/dist/document/expression/types.d.ts.map +1 -1
  617. package/dist/document/expression/types.js +4 -15
  618. package/dist/document/expression/types.js.map +1 -1
  619. package/dist/document/expression/walk.d.ts +6 -20
  620. package/dist/document/expression/walk.d.ts.map +1 -1
  621. package/dist/document/expression/walk.js +18 -44
  622. package/dist/document/expression/walk.js.map +1 -1
  623. package/dist/document/index.js +2 -3
  624. package/dist/document/index.js.map +1 -1
  625. package/dist/document/migrate.d.ts +7 -22
  626. package/dist/document/migrate.d.ts.map +1 -1
  627. package/dist/document/migrate.js +44 -15
  628. package/dist/document/migrate.js.map +1 -1
  629. package/dist/document/missing-node.d.ts +4 -11
  630. package/dist/document/missing-node.d.ts.map +1 -1
  631. package/dist/document/missing-node.js +2 -5
  632. package/dist/document/missing-node.js.map +1 -1
  633. package/dist/document/node-decorator.d.ts +12 -53
  634. package/dist/document/node-decorator.d.ts.map +1 -1
  635. package/dist/document/node-decorator.js +16 -57
  636. package/dist/document/node-decorator.js.map +1 -1
  637. package/dist/document/node-descriptor.d.ts +25 -62
  638. package/dist/document/node-descriptor.d.ts.map +1 -1
  639. package/dist/document/node-descriptor.js.map +1 -1
  640. package/dist/document/placement.d.ts +18 -41
  641. package/dist/document/placement.d.ts.map +1 -1
  642. package/dist/document/placement.js +4 -11
  643. package/dist/document/placement.js.map +1 -1
  644. package/dist/document/project.d.ts +19 -52
  645. package/dist/document/project.d.ts.map +1 -1
  646. package/dist/document/project.js +2 -6
  647. package/dist/document/project.js.map +1 -1
  648. package/dist/document/prop-evolution.d.ts +10 -20
  649. package/dist/document/prop-evolution.d.ts.map +1 -1
  650. package/dist/document/prop-evolution.js +3 -7
  651. package/dist/document/prop-evolution.js.map +1 -1
  652. package/dist/document/registry.d.ts +80 -318
  653. package/dist/document/registry.d.ts.map +1 -1
  654. package/dist/document/registry.js +43 -147
  655. package/dist/document/registry.js.map +1 -1
  656. package/dist/document/settled-index.d.ts +12 -18
  657. package/dist/document/settled-index.d.ts.map +1 -1
  658. package/dist/document/settled-index.js +29 -31
  659. package/dist/document/settled-index.js.map +1 -1
  660. package/dist/document/timeline-patch.d.ts +6 -15
  661. package/dist/document/timeline-patch.d.ts.map +1 -1
  662. package/dist/document/timeline-patch.js +12 -21
  663. package/dist/document/timeline-patch.js.map +1 -1
  664. package/dist/document/timeline.d.ts +56 -263
  665. package/dist/document/timeline.d.ts.map +1 -1
  666. package/dist/document/timeline.js +97 -281
  667. package/dist/document/timeline.js.map +1 -1
  668. package/dist/document/types.d.ts +90 -264
  669. package/dist/document/types.d.ts.map +1 -1
  670. package/dist/document/types.js +13 -30
  671. package/dist/document/types.js.map +1 -1
  672. package/dist/document/validate.d.ts +10 -40
  673. package/dist/document/validate.d.ts.map +1 -1
  674. package/dist/document/validate.js +72 -137
  675. package/dist/document/validate.js.map +1 -1
  676. package/dist/document/vocabulary.d.ts +4 -7
  677. package/dist/document/vocabulary.d.ts.map +1 -1
  678. package/dist/document/vocabulary.js +0 -1
  679. package/dist/document/vocabulary.js.map +1 -1
  680. package/dist/index.d.ts +0 -1
  681. package/dist/index.d.ts.map +1 -1
  682. package/dist/index.js +0 -1
  683. package/dist/index.js.map +1 -1
  684. package/dist/layout/bounds.d.ts +1 -11
  685. package/dist/layout/bounds.d.ts.map +1 -1
  686. package/dist/layout/bounds.js.map +1 -1
  687. package/dist/layout/flex.d.ts +6 -20
  688. package/dist/layout/flex.d.ts.map +1 -1
  689. package/dist/layout/flex.js +7 -28
  690. package/dist/layout/flex.js.map +1 -1
  691. package/dist/layout/ops.d.ts +2 -11
  692. package/dist/layout/ops.d.ts.map +1 -1
  693. package/dist/layout/ops.js +2 -22
  694. package/dist/layout/ops.js.map +1 -1
  695. package/dist/layout/types.d.ts +11 -55
  696. package/dist/layout/types.d.ts.map +1 -1
  697. package/dist/layout/types.js.map +1 -1
  698. package/dist/platform/audio-sink.d.ts +7 -43
  699. package/dist/platform/audio-sink.d.ts.map +1 -1
  700. package/dist/platform/audio-sink.js +4 -29
  701. package/dist/platform/audio-sink.js.map +1 -1
  702. package/dist/platform/exporter.d.ts +5 -31
  703. package/dist/platform/exporter.d.ts.map +1 -1
  704. package/dist/platform/exporter.js.map +1 -1
  705. package/dist/platform/stepped-clock.d.ts +1 -16
  706. package/dist/platform/stepped-clock.d.ts.map +1 -1
  707. package/dist/platform/stepped-clock.js +1 -16
  708. package/dist/platform/stepped-clock.js.map +1 -1
  709. package/dist/platform/storage-adapter.d.ts +8 -68
  710. package/dist/platform/storage-adapter.d.ts.map +1 -1
  711. package/dist/platform/storage-adapter.js +8 -60
  712. package/dist/platform/storage-adapter.js.map +1 -1
  713. package/dist/platform/ticker.d.ts +11 -45
  714. package/dist/platform/ticker.d.ts.map +1 -1
  715. package/dist/platform/ticker.js +10 -37
  716. package/dist/platform/ticker.js.map +1 -1
  717. package/dist/project/config.d.ts +4 -14
  718. package/dist/project/config.d.ts.map +1 -1
  719. package/dist/project/config.js.map +1 -1
  720. package/dist/project/tree.d.ts +6 -35
  721. package/dist/project/tree.d.ts.map +1 -1
  722. package/dist/project/tree.js +1 -8
  723. package/dist/project/tree.js.map +1 -1
  724. package/dist/props/host.d.ts +7 -13
  725. package/dist/props/host.d.ts.map +1 -1
  726. package/dist/props/host.js +3 -1
  727. package/dist/props/host.js.map +1 -1
  728. package/dist/props/layout.d.ts +18 -0
  729. package/dist/props/layout.d.ts.map +1 -0
  730. package/dist/props/layout.js +73 -0
  731. package/dist/props/layout.js.map +1 -0
  732. package/dist/props/observer.d.ts +1 -7
  733. package/dist/props/observer.d.ts.map +1 -1
  734. package/dist/props/observer.js.map +1 -1
  735. package/dist/props/slot.d.ts +6 -19
  736. package/dist/props/slot.d.ts.map +1 -1
  737. package/dist/props/slot.js +5 -14
  738. package/dist/props/slot.js.map +1 -1
  739. package/dist/render/canvas-render-context2d.d.ts +8 -68
  740. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  741. package/dist/render/canvas-render-context2d.js +8 -69
  742. package/dist/render/canvas-render-context2d.js.map +1 -1
  743. package/dist/render/clip-contains.d.ts +2 -16
  744. package/dist/render/clip-contains.d.ts.map +1 -1
  745. package/dist/render/clip-contains.js +21 -82
  746. package/dist/render/clip-contains.js.map +1 -1
  747. package/dist/render/clip.d.ts +7 -25
  748. package/dist/render/clip.d.ts.map +1 -1
  749. package/dist/render/clip.js +5 -17
  750. package/dist/render/clip.js.map +1 -1
  751. package/dist/render/descriptors/ellipse.d.ts.map +1 -1
  752. package/dist/render/descriptors/ellipse.js +0 -1
  753. package/dist/render/descriptors/ellipse.js.map +1 -1
  754. package/dist/render/descriptors/line.d.ts.map +1 -1
  755. package/dist/render/descriptors/line.js +0 -1
  756. package/dist/render/descriptors/line.js.map +1 -1
  757. package/dist/render/descriptors/path-builder.d.ts +4 -32
  758. package/dist/render/descriptors/path-builder.d.ts.map +1 -1
  759. package/dist/render/descriptors/path-builder.js +3 -25
  760. package/dist/render/descriptors/path-builder.js.map +1 -1
  761. package/dist/render/descriptors/path.d.ts +1 -11
  762. package/dist/render/descriptors/path.d.ts.map +1 -1
  763. package/dist/render/descriptors/path.js +0 -1
  764. package/dist/render/descriptors/path.js.map +1 -1
  765. package/dist/render/descriptors/polygon.d.ts.map +1 -1
  766. package/dist/render/descriptors/polygon.js +0 -1
  767. package/dist/render/descriptors/polygon.js.map +1 -1
  768. package/dist/render/descriptors/polygram.d.ts.map +1 -1
  769. package/dist/render/descriptors/polygram.js +0 -1
  770. package/dist/render/descriptors/polygram.js.map +1 -1
  771. package/dist/render/descriptors/rect.d.ts.map +1 -1
  772. package/dist/render/descriptors/rect.js +0 -1
  773. package/dist/render/descriptors/rect.js.map +1 -1
  774. package/dist/render/descriptors/richtext.d.ts.map +1 -1
  775. package/dist/render/descriptors/richtext.js +0 -1
  776. package/dist/render/descriptors/richtext.js.map +1 -1
  777. package/dist/render/descriptors/shape.d.ts +17 -77
  778. package/dist/render/descriptors/shape.d.ts.map +1 -1
  779. package/dist/render/descriptors/shape.js +13 -47
  780. package/dist/render/descriptors/shape.js.map +1 -1
  781. package/dist/render/descriptors/text.d.ts +15 -94
  782. package/dist/render/descriptors/text.d.ts.map +1 -1
  783. package/dist/render/descriptors/text.js +8 -50
  784. package/dist/render/descriptors/text.js.map +1 -1
  785. package/dist/render/descriptors/transform.d.ts +5 -16
  786. package/dist/render/descriptors/transform.d.ts.map +1 -1
  787. package/dist/render/descriptors/transform.js +1 -17
  788. package/dist/render/descriptors/transform.js.map +1 -1
  789. package/dist/render/graphics2d.d.ts +24 -116
  790. package/dist/render/graphics2d.d.ts.map +1 -1
  791. package/dist/render/graphics2d.js +23 -108
  792. package/dist/render/graphics2d.js.map +1 -1
  793. package/dist/render/measure-context.d.ts +5 -29
  794. package/dist/render/measure-context.d.ts.map +1 -1
  795. package/dist/render/measure-context.js.map +1 -1
  796. package/dist/render/null-render-context.d.ts +2 -20
  797. package/dist/render/null-render-context.d.ts.map +1 -1
  798. package/dist/render/null-render-context.js +2 -20
  799. package/dist/render/null-render-context.js.map +1 -1
  800. package/dist/render/render-context2d.d.ts +52 -208
  801. package/dist/render/render-context2d.d.ts.map +1 -1
  802. package/dist/render/render-context2d.js.map +1 -1
  803. package/dist/render/surface.d.ts +2 -19
  804. package/dist/render/surface.d.ts.map +1 -1
  805. package/dist/render/surface.js.map +1 -1
  806. package/dist/render/text-defaults.d.ts +1 -17
  807. package/dist/render/text-defaults.d.ts.map +1 -1
  808. package/dist/render/text-defaults.js +6 -40
  809. package/dist/render/text-defaults.js.map +1 -1
  810. package/dist/render/text-layout.d.ts +12 -55
  811. package/dist/render/text-layout.d.ts.map +1 -1
  812. package/dist/render/text-layout.js +2 -16
  813. package/dist/render/text-layout.js.map +1 -1
  814. package/dist/render3d/bounds3d.d.ts +10 -32
  815. package/dist/render3d/bounds3d.d.ts.map +1 -1
  816. package/dist/render3d/bounds3d.js +2 -12
  817. package/dist/render3d/bounds3d.js.map +1 -1
  818. package/dist/render3d/builders.d.ts +8 -35
  819. package/dist/render3d/builders.d.ts.map +1 -1
  820. package/dist/render3d/builders.js +8 -35
  821. package/dist/render3d/builders.js.map +1 -1
  822. package/dist/render3d/camera.d.ts +10 -57
  823. package/dist/render3d/camera.d.ts.map +1 -1
  824. package/dist/render3d/camera.js +4 -26
  825. package/dist/render3d/camera.js.map +1 -1
  826. package/dist/render3d/fill3d.d.ts +7 -45
  827. package/dist/render3d/fill3d.d.ts.map +1 -1
  828. package/dist/render3d/fill3d.js +15 -85
  829. package/dist/render3d/fill3d.js.map +1 -1
  830. package/dist/render3d/geometry.d.ts +18 -106
  831. package/dist/render3d/geometry.d.ts.map +1 -1
  832. package/dist/render3d/geometry.js +2 -20
  833. package/dist/render3d/geometry.js.map +1 -1
  834. package/dist/render3d/graphics3d.d.ts +29 -133
  835. package/dist/render3d/graphics3d.d.ts.map +1 -1
  836. package/dist/render3d/graphics3d.js +23 -110
  837. package/dist/render3d/graphics3d.js.map +1 -1
  838. package/dist/render3d/index.d.ts +1 -16
  839. package/dist/render3d/index.d.ts.map +1 -1
  840. package/dist/render3d/index.js +1 -16
  841. package/dist/render3d/index.js.map +1 -1
  842. package/dist/render3d/inert.d.ts.map +1 -1
  843. package/dist/render3d/inert.js +1 -14
  844. package/dist/render3d/inert.js.map +1 -1
  845. package/dist/render3d/light.d.ts +3 -26
  846. package/dist/render3d/light.d.ts.map +1 -1
  847. package/dist/render3d/light.js.map +1 -1
  848. package/dist/render3d/material.d.ts +13 -87
  849. package/dist/render3d/material.d.ts.map +1 -1
  850. package/dist/render3d/material.js +2 -16
  851. package/dist/render3d/material.js.map +1 -1
  852. package/dist/render3d/matrix4.d.ts +14 -68
  853. package/dist/render3d/matrix4.d.ts.map +1 -1
  854. package/dist/render3d/matrix4.js +11 -60
  855. package/dist/render3d/matrix4.js.map +1 -1
  856. package/dist/render3d/render-context3d.d.ts +13 -51
  857. package/dist/render3d/render-context3d.d.ts.map +1 -1
  858. package/dist/render3d/render-context3d.js +9 -21
  859. package/dist/render3d/render-context3d.js.map +1 -1
  860. package/dist/render3d/resources.d.ts +9 -53
  861. package/dist/render3d/resources.d.ts.map +1 -1
  862. package/dist/render3d/resources.js +8 -48
  863. package/dist/render3d/resources.js.map +1 -1
  864. package/dist/render3d/rounded-box.d.ts +7 -21
  865. package/dist/render3d/rounded-box.d.ts.map +1 -1
  866. package/dist/render3d/rounded-box.js +7 -46
  867. package/dist/render3d/rounded-box.js.map +1 -1
  868. package/dist/render3d/scene-settings.d.ts +20 -78
  869. package/dist/render3d/scene-settings.d.ts.map +1 -1
  870. package/dist/render3d/scene-settings.js.map +1 -1
  871. package/dist/render3d/scene3d.d.ts +11 -53
  872. package/dist/render3d/scene3d.d.ts.map +1 -1
  873. package/dist/render3d/scene3d.js +12 -59
  874. package/dist/render3d/scene3d.js.map +1 -1
  875. package/dist/render3d/segments.d.ts +2 -25
  876. package/dist/render3d/segments.d.ts.map +1 -1
  877. package/dist/render3d/segments.js +1 -11
  878. package/dist/render3d/segments.js.map +1 -1
  879. package/dist/render3d/texture.d.ts +25 -112
  880. package/dist/render3d/texture.d.ts.map +1 -1
  881. package/dist/render3d/texture.js +3 -27
  882. package/dist/render3d/texture.js.map +1 -1
  883. package/dist/render3d/tracking.d.ts +2 -19
  884. package/dist/render3d/tracking.d.ts.map +1 -1
  885. package/dist/render3d/tracking.js +2 -19
  886. package/dist/render3d/tracking.js.map +1 -1
  887. package/dist/render3d/transform.d.ts +14 -60
  888. package/dist/render3d/transform.d.ts.map +1 -1
  889. package/dist/render3d/transform.js +0 -2
  890. package/dist/render3d/transform.js.map +1 -1
  891. package/dist/render3d/vector3.d.ts +6 -48
  892. package/dist/render3d/vector3.d.ts.map +1 -1
  893. package/dist/render3d/vector3.js +4 -38
  894. package/dist/render3d/vector3.js.map +1 -1
  895. package/dist/render3d/walk.d.ts +3 -27
  896. package/dist/render3d/walk.d.ts.map +1 -1
  897. package/dist/render3d/walk.js +5 -33
  898. package/dist/render3d/walk.js.map +1 -1
  899. package/dist/runtime/asset-refine.d.ts +34 -20
  900. package/dist/runtime/asset-refine.d.ts.map +1 -1
  901. package/dist/runtime/asset-refine.js +127 -31
  902. package/dist/runtime/asset-refine.js.map +1 -1
  903. package/dist/runtime/asset-timeline.d.ts +14 -53
  904. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  905. package/dist/runtime/asset-timeline.js +6 -27
  906. package/dist/runtime/asset-timeline.js.map +1 -1
  907. package/dist/runtime/asset-update.d.ts +7 -26
  908. package/dist/runtime/asset-update.d.ts.map +1 -1
  909. package/dist/runtime/asset-update.js +6 -18
  910. package/dist/runtime/asset-update.js.map +1 -1
  911. package/dist/runtime/audio-index.d.ts +0 -2
  912. package/dist/runtime/audio-index.d.ts.map +1 -1
  913. package/dist/runtime/audio-index.js +0 -2
  914. package/dist/runtime/audio-index.js.map +1 -1
  915. package/dist/runtime/builtin-context.d.ts +3 -9
  916. package/dist/runtime/builtin-context.d.ts.map +1 -1
  917. package/dist/runtime/builtin-context.js +3 -9
  918. package/dist/runtime/builtin-context.js.map +1 -1
  919. package/dist/runtime/clip-instance.d.ts +12 -39
  920. package/dist/runtime/clip-instance.d.ts.map +1 -1
  921. package/dist/runtime/clip-instance.js +21 -45
  922. package/dist/runtime/clip-instance.js.map +1 -1
  923. package/dist/runtime/clip-store.d.ts +26 -68
  924. package/dist/runtime/clip-store.d.ts.map +1 -1
  925. package/dist/runtime/clip-store.js +47 -81
  926. package/dist/runtime/clip-store.js.map +1 -1
  927. package/dist/runtime/engine.d.ts +31 -85
  928. package/dist/runtime/engine.d.ts.map +1 -1
  929. package/dist/runtime/engine.js +16 -49
  930. package/dist/runtime/engine.js.map +1 -1
  931. package/dist/runtime/frame-time.d.ts +4 -15
  932. package/dist/runtime/frame-time.d.ts.map +1 -1
  933. package/dist/runtime/frame-time.js +5 -12
  934. package/dist/runtime/frame-time.js.map +1 -1
  935. package/dist/runtime/index.d.ts +0 -1
  936. package/dist/runtime/index.d.ts.map +1 -1
  937. package/dist/runtime/index.js +0 -1
  938. package/dist/runtime/index.js.map +1 -1
  939. package/dist/runtime/node-picking.d.ts +59 -139
  940. package/dist/runtime/node-picking.d.ts.map +1 -1
  941. package/dist/runtime/node-picking.js +87 -157
  942. package/dist/runtime/node-picking.js.map +1 -1
  943. package/dist/runtime/node-picking3d.d.ts +39 -96
  944. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  945. package/dist/runtime/node-picking3d.js +98 -141
  946. package/dist/runtime/node-picking3d.js.map +1 -1
  947. package/dist/runtime/placement.d.ts +8 -17
  948. package/dist/runtime/placement.d.ts.map +1 -1
  949. package/dist/runtime/placement.js +7 -16
  950. package/dist/runtime/placement.js.map +1 -1
  951. package/dist/runtime/playback-controller.d.ts +78 -207
  952. package/dist/runtime/playback-controller.d.ts.map +1 -1
  953. package/dist/runtime/playback-controller.js +111 -226
  954. package/dist/runtime/playback-controller.js.map +1 -1
  955. package/dist/runtime/playback.d.ts +6 -14
  956. package/dist/runtime/playback.d.ts.map +1 -1
  957. package/dist/runtime/playback.js +6 -14
  958. package/dist/runtime/playback.js.map +1 -1
  959. package/dist/runtime/project-assets.d.ts +6 -14
  960. package/dist/runtime/project-assets.d.ts.map +1 -1
  961. package/dist/runtime/project-assets.js +7 -16
  962. package/dist/runtime/project-assets.js.map +1 -1
  963. package/dist/runtime/session.d.ts +22 -45
  964. package/dist/runtime/session.d.ts.map +1 -1
  965. package/dist/runtime/session.js +26 -46
  966. package/dist/runtime/session.js.map +1 -1
  967. package/dist/runtime/settle.d.ts +4 -10
  968. package/dist/runtime/settle.d.ts.map +1 -1
  969. package/dist/runtime/settle.js +4 -10
  970. package/dist/runtime/settle.js.map +1 -1
  971. package/dist/runtime/state-evaluator.d.ts +15 -37
  972. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  973. package/dist/runtime/state-evaluator.js +27 -44
  974. package/dist/runtime/state-evaluator.js.map +1 -1
  975. package/dist/runtime/text-geometry.d.ts +18 -47
  976. package/dist/runtime/text-geometry.d.ts.map +1 -1
  977. package/dist/runtime/text-geometry.js +13 -27
  978. package/dist/runtime/text-geometry.js.map +1 -1
  979. package/dist/sdk/index.d.ts +1 -7
  980. package/dist/sdk/index.d.ts.map +1 -1
  981. package/dist/sdk/index.js +30 -138
  982. package/dist/sdk/index.js.map +1 -1
  983. package/dist/tween/command-decorator.d.ts +6 -26
  984. package/dist/tween/command-decorator.d.ts.map +1 -1
  985. package/dist/tween/command-decorator.js +1 -6
  986. package/dist/tween/command-decorator.js.map +1 -1
  987. package/dist/tween/command.d.ts +6 -53
  988. package/dist/tween/command.d.ts.map +1 -1
  989. package/dist/tween/command.js +5 -40
  990. package/dist/tween/command.js.map +1 -1
  991. package/dist/tween/ease/curve.d.ts +2 -17
  992. package/dist/tween/ease/curve.d.ts.map +1 -1
  993. package/dist/tween/ease/curve.js +1 -6
  994. package/dist/tween/ease/curve.js.map +1 -1
  995. package/dist/tween/ease/describe.d.ts +0 -11
  996. package/dist/tween/ease/describe.d.ts.map +1 -1
  997. package/dist/tween/ease/describe.js +0 -23
  998. package/dist/tween/ease/describe.js.map +1 -1
  999. package/dist/tween/ease/spec.d.ts +2 -18
  1000. package/dist/tween/ease/spec.d.ts.map +1 -1
  1001. package/dist/tween/ease/spec.js.map +1 -1
  1002. package/dist/tween/inert.d.ts +1 -14
  1003. package/dist/tween/inert.d.ts.map +1 -1
  1004. package/dist/tween/inert.js +1 -14
  1005. package/dist/tween/inert.js.map +1 -1
  1006. package/dist/tween/lerp.d.ts +2 -26
  1007. package/dist/tween/lerp.d.ts.map +1 -1
  1008. package/dist/tween/lerp.js +2 -26
  1009. package/dist/tween/lerp.js.map +1 -1
  1010. package/dist/tween/loop.d.ts +9 -50
  1011. package/dist/tween/loop.d.ts.map +1 -1
  1012. package/dist/tween/loop.js +6 -31
  1013. package/dist/tween/loop.js.map +1 -1
  1014. package/dist/tween/prepare.d.ts +2 -30
  1015. package/dist/tween/prepare.d.ts.map +1 -1
  1016. package/dist/tween/prepare.js +2 -30
  1017. package/dist/tween/prepare.js.map +1 -1
  1018. package/dist/tween/stepper.d.ts +4 -25
  1019. package/dist/tween/stepper.d.ts.map +1 -1
  1020. package/dist/tween/stepper.js.map +1 -1
  1021. package/dist/tween/to-command.d.ts +1 -8
  1022. package/dist/tween/to-command.d.ts.map +1 -1
  1023. package/dist/tween/to-command.js +2 -25
  1024. package/dist/tween/to-command.js.map +1 -1
  1025. package/dist/util/context.d.ts +4 -29
  1026. package/dist/util/context.d.ts.map +1 -1
  1027. package/dist/util/context.js +3 -15
  1028. package/dist/util/context.js.map +1 -1
  1029. package/dist/util/csv.d.ts +4 -29
  1030. package/dist/util/csv.d.ts.map +1 -1
  1031. package/dist/util/csv.js +3 -22
  1032. package/dist/util/csv.js.map +1 -1
  1033. package/dist/util/metrics.d.ts +2 -26
  1034. package/dist/util/metrics.d.ts.map +1 -1
  1035. package/dist/util/metrics.js +2 -26
  1036. package/dist/util/metrics.js.map +1 -1
  1037. package/dist/util/random.d.ts +20 -87
  1038. package/dist/util/random.d.ts.map +1 -1
  1039. package/dist/util/random.js +20 -87
  1040. package/dist/util/random.js.map +1 -1
  1041. package/dist/util/reference.d.ts +6 -35
  1042. package/dist/util/reference.d.ts.map +1 -1
  1043. package/dist/util/reference.js +1 -4
  1044. package/dist/util/reference.js.map +1 -1
  1045. package/dist/util/scheduler.d.ts +6 -27
  1046. package/dist/util/scheduler.d.ts.map +1 -1
  1047. package/dist/util/scheduler.js +8 -35
  1048. package/dist/util/scheduler.js.map +1 -1
  1049. package/package.json +1 -1
  1050. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
  1051. package/dist/browser/chunks/chunk-7DB6BI27.js +0 -6
  1052. package/dist/browser/chunks/chunk-7DB6BI27.js.map +0 -7
  1053. package/dist/browser/chunks/chunk-IX53IFBD.js +0 -13
  1054. package/dist/browser/chunks/chunk-IX53IFBD.js.map +0 -7
  1055. package/dist/browser/chunks/chunk-Q55UPA3E.js +0 -3
  1056. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +0 -7
  1057. package/dist/renamed-scene-names.d.ts +0 -17
  1058. package/dist/renamed-scene-names.d.ts.map +0 -1
  1059. package/dist/renamed-scene-names.js +0 -9
  1060. package/dist/renamed-scene-names.js.map +0 -1
  1061. package/dist/runtime/precompisition.d.ts +0 -24
  1062. package/dist/runtime/precompisition.d.ts.map +0 -1
  1063. package/dist/runtime/precompisition.js +0 -7
  1064. package/dist/runtime/precompisition.js.map +0 -1
package/dist/util/csv.js CHANGED
@@ -1,9 +1,4 @@
1
- /**
2
- * Parse CSV text into an array of row records keyed by the header row.
3
- * Handles quoted fields (embedded delimiters, newlines, and `""` escapes) and
4
- * both CRLF/LF line endings. Synchronous and dependency-free, so it's safe to
5
- * call at module-eval time on text pulled in via a `?raw` import.
6
- */
1
+ /** Parses CSV text into row records keyed by the header row. Handles quoted fields (embedded delimiters, newlines, `""` escapes) and CRLF/LF. Synchronous and dependency-free, so safe at module-eval time on `?raw` text. */
7
2
  export function parseCSV(text, options = {}) {
8
3
  const delimiter = options.delimiter ?? ',';
9
4
  const rows = splitRows(text, delimiter);
@@ -37,22 +32,13 @@ export function parseCSV(text, options = {}) {
37
32
  return out;
38
33
  });
39
34
  }
40
- /**
41
- * `parseData` only ever runs as an inlined literal — the
42
- * `@motionscript/vite-plugin` build-time macro replaces
43
- * `parseData("file.csv")` call sites with the already-parsed rows before this
44
- * body ever executes. This implementation exists purely so the call
45
- * type-checks and so an unresolved call site (missing plugin, or a
46
- * non-literal argument the macro couldn't statically inline) fails loudly
47
- * instead of silently returning nothing.
48
- */
35
+ /** Only ever an inlined literal: the `@motionscript/vite-plugin` macro replaces `parseData("file.csv")` call sites with the parsed rows before this runs. This body exists so the call type-checks and an unresolved call site (no plugin, non-literal argument) fails loudly instead of returning nothing. */
49
36
  export function parseData(file, _options) {
50
37
  throw new Error(`parseData("${file}") must be called with a static string literal so the ` +
51
38
  `@motionscript/vite-plugin macro can inline it at build time. If you're seeing ` +
52
39
  `this error at runtime, either the plugin isn't installed/registered, or this ` +
53
40
  `call's argument isn't a plain string literal.`);
54
41
  }
55
- /** Decide which columns to coerce, per {@link ParseCSVOptions.numeric}. */
56
42
  function resolveNumericColumns(header, records, numeric) {
57
43
  if (numeric === false)
58
44
  return [];
@@ -71,7 +57,6 @@ function resolveNumericColumns(header, records, numeric) {
71
57
  return sawValue;
72
58
  });
73
59
  }
74
- /** Decide which columns to coerce, per {@link ParseCSVOptions.boolean}. */
75
60
  function resolveBooleanColumns(header, records, numericCols, bool) {
76
61
  if (bool === false)
77
62
  return [];
@@ -93,11 +78,7 @@ function resolveBooleanColumns(header, records, numericCols, bool) {
93
78
  return sawValue;
94
79
  });
95
80
  }
96
- /**
97
- * Split raw CSV text into rows of raw (unquoted) string cells. A minimal
98
- * hand-rolled scanner rather than a `split(',')`/`split('\n')` pair so quoted
99
- * fields can safely contain the delimiter, newlines, and escaped (`""`) quotes.
100
- */
81
+ /** Splits raw CSV text into rows of unquoted cells. A hand-rolled scanner, not `split(',')`, so quoted fields can contain the delimiter, newlines and `""` escapes. */
101
82
  function splitRows(text, delimiter) {
102
83
  const rows = [];
103
84
  let row = [];
@@ -1 +1 @@
1
- {"version":3,"file":"csv.js","sourceRoot":"","sources":["../../src/util/csv.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,UAA2B,EAAE;IAChE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,GAAG,CAAC;IAC3C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACxC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,MAAM,OAAO,GAA6B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACrD,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,MAAM,CAAC,OAAO,CAAC,C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,KAAK,IAAI,EAAE,CAAC;YAChB,CAAC;YACD,SAAS;QACb,CAAC;QAED,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YAAC,QAAQ,GAAG,IAAI,CAAC;YAAC,WAAW,GAAG,IAAI,CAAC;YAAC,SAAS;QAAC,CAAC;QAClE,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YAAC,WAAW,GAAG,IAAI,CAAC;YAAC,SAAS,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACpE,IAAI,EAAE,KAAK,IAAI;YAAE,SAAS;QAC1B,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;YAAC,IAAI,WAAW,IAAI,KAAK;gBAAE,OAAO,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACnE,KAAK,IAAI,EAAE,CAAC;QACZ,WAAW,GAAG,IAAI,CAAC;IACvB,CAAC;IACD,qEAAqE;IACrE,IAAI,WAAW,IAAI,KAAK;QAAE,OAAO,EAAE,CAAC;IAEpC,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["/** One parsed data record: column name → cell value (string, or number/boolean\n * when the column auto-coerces — see {@link ParseCSVOptions.numeric} and\n * {@link ParseCSVOptions.boolean}). */\nexport type DataRecord = Record<string, string | number | boolean>;\n\nexport interface ParseCSVOptions {\n /** Field separator. Default: ','. */\n delimiter?: string;\n /**\n * Which columns to coerce to `number`. An explicit list forces just those\n * columns; `false` disables coercion entirely (every cell stays a string).\n * Default (omitted/`true`): auto-detect — a column becomes numeric only if\n * every non-empty cell in it parses as a finite number, so a text column\n * that happens to contain a numeric-looking value here and there is left\n * alone rather than partially coerced.\n */\n numeric?: string[] | boolean;\n /**\n * Which columns to coerce to `boolean`, same shape/semantics as\n * {@link numeric}. Default (omitted/`true`): auto-detect — a column\n * becomes boolean only if every non-empty cell is exactly `\"true\"` or\n * `\"false\"`. Never applied to a column already coerced to numeric.\n */\n boolean?: string[] | boolean;\n}\n\n/**\n * Parse CSV text into an array of row records keyed by the header row.\n * Handles quoted fields (embedded delimiters, newlines, and `\"\"` escapes) and\n * both CRLF/LF line endings. Synchronous and dependency-free, so it's safe to\n * call at module-eval time on text pulled in via a `?raw` import.\n */\nexport function parseCSV(text: string, options: ParseCSVOptions = {}): DataRecord[] {\n const delimiter = options.delimiter ?? ',';\n const rows = splitRows(text, delimiter);\n if (rows.length === 0) return [];\n\n const header = rows[0].map(cell => cell.trim());\n const body = rows.slice(1);\n\n const records: Record<string, string>[] = body.map(row => {\n const record: Record<string, string> = {};\n header.forEach((key, i) => { record[key] = row[i] ?? ''; });\n return record;\n });\n\n const numericCols = resolveNumericColumns(header, records, options.numeric);\n const booleanCols = resolveBooleanColumns(header, records, numericCols, options.boolean);\n if (numericCols.length === 0 && booleanCols.length === 0) return records;\n\n return records.map(record => {\n const out: DataRecord = { ...record };\n for (const col of numericCols) {\n const raw = record[col];\n if (raw === '') continue;\n out[col] = Number(raw);\n }\n for (const col of booleanCols) {\n const raw = record[col];\n if (raw === '') continue;\n out[col] = raw === 'true';\n }\n return out;\n });\n}\n\n/**\n * `parseData` only ever runs as an inlined literal — the\n * `@motionscript/vite-plugin` build-time macro replaces\n * `parseData(\"file.csv\")` call sites with the already-parsed rows before this\n * body ever executes. This implementation exists purely so the call\n * type-checks and so an unresolved call site (missing plugin, or a\n * non-literal argument the macro couldn't statically inline) fails loudly\n * instead of silently returning nothing.\n */\nexport function parseData(file: string, _options?: ParseCSVOptions): DataRecord[] {\n throw new Error(\n `parseData(\"${file}\") must be called with a static string literal so the ` +\n `@motionscript/vite-plugin macro can inline it at build time. If you're seeing ` +\n `this error at runtime, either the plugin isn't installed/registered, or this ` +\n `call's argument isn't a plain string literal.`\n );\n}\n\n/** Decide which columns to coerce, per {@link ParseCSVOptions.numeric}. */\nfunction resolveNumericColumns(\n header: string[],\n records: Record<string, string>[],\n numeric: string[] | boolean | undefined,\n): string[] {\n if (numeric === false) return [];\n if (Array.isArray(numeric)) return numeric;\n\n return header.filter(col => {\n let sawValue = false;\n for (const record of records) {\n const raw = record[col];\n if (raw === '') continue;\n if (!Number.isFinite(Number(raw))) return false;\n sawValue = true;\n }\n return sawValue;\n });\n}\n\n/** Decide which columns to coerce, per {@link ParseCSVOptions.boolean}. */\nfunction resolveBooleanColumns(\n header: string[],\n records: Record<string, string>[],\n numericCols: string[],\n bool: string[] | boolean | undefined,\n): string[] {\n if (bool === false) return [];\n if (Array.isArray(bool)) return bool;\n\n const numericSet = new Set(numericCols);\n return header.filter(col => {\n if (numericSet.has(col)) return false;\n let sawValue = false;\n for (const record of records) {\n const raw = record[col];\n if (raw === '') continue;\n if (raw !== 'true' && raw !== 'false') return false;\n sawValue = true;\n }\n return sawValue;\n });\n}\n\n/**\n * Split raw CSV text into rows of raw (unquoted) string cells. A minimal\n * hand-rolled scanner rather than a `split(',')`/`split('\\n')` pair so quoted\n * fields can safely contain the delimiter, newlines, and escaped (`\"\"`) quotes.\n */\nfunction splitRows(text: string, delimiter: string): string[][] {\n const rows: string[][] = [];\n let row: string[] = [];\n let field = '';\n let inQuotes = false;\n let sawAnyField = false;\n\n const pushField = () => { row.push(field); field = ''; };\n const pushRow = () => { pushField(); rows.push(row); row = []; sawAnyField = false; };\n\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n\n if (inQuotes) {\n if (ch === '\"') {\n if (text[i + 1] === '\"') { field += '\"'; i++; }\n else inQuotes = false;\n } else {\n field += ch;\n }\n continue;\n }\n\n if (ch === '\"') { inQuotes = true; sawAnyField = true; continue; }\n if (ch === delimiter) { sawAnyField = true; pushField(); continue; }\n if (ch === '\\r') continue;\n if (ch === '\\n') { if (sawAnyField || field) pushRow(); continue; }\n field += ch;\n sawAnyField = true;\n }\n // Flush a final row left over when the text has no trailing newline.\n if (sawAnyField || field) pushRow();\n\n return rows;\n}\n"]}
1
+ {"version":3,"file":"csv.js","sourceRoot":"","sources":["../../src/util/csv.ts"],"names":[],"mappings":"AAcA,8NAA8N;AAC9N,MAAM,UAAU,QAAQ,CAAC,IAAY,E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AG,GAAG,EAAE,CAAC,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEnB,IAAI,QAAQ,EAAE,CAAC;YACX,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBACb,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;oBAAC,KAAK,IAAI,GAAG,CAAC;oBAAC,CAAC,EAAE,CAAC;gBAAC,CAAC;;oBAC1C,QAAQ,GAAG,KAAK,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACJ,KAAK,IAAI,EAAE,CAAC;YAChB,CAAC;YACD,SAAS;QACb,CAAC;QAED,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YAAC,QAAQ,GAAG,IAAI,CAAC;YAAC,WAAW,GAAG,IAAI,CAAC;YAAC,SAAS;QAAC,CAAC;QAClE,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YAAC,WAAW,GAAG,IAAI,CAAC;YAAC,SAAS,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACpE,IAAI,EAAE,KAAK,IAAI;YAAE,SAAS;QAC1B,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;YAAC,IAAI,WAAW,IAAI,KAAK;gBAAE,OAAO,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACnE,KAAK,IAAI,EAAE,CAAC;QACZ,WAAW,GAAG,IAAI,CAAC;IACvB,CAAC;IACD,qEAAqE;IACrE,IAAI,WAAW,IAAI,KAAK;QAAE,OAAO,EAAE,CAAC;IAEpC,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["/** One parsed data record: column name → cell value (string, or number/boolean\n * when the column auto-coerces — see {@link ParseCSVOptions.numeric} and\n * {@link ParseCSVOptions.boolean}). */\nexport type DataRecord = Record<string, string | number | boolean>;\n\nexport interface ParseCSVOptions {\n /** Field separator. Default: ','. */\n delimiter?: string;\n /** Columns to coerce to `number`: an explicit list forces just those, `false` disables coercion, and the default auto-detects (numeric only if every non-empty cell parses as a finite number, so a text column with a stray numeric-looking value isn't partially coerced). */\n numeric?: string[] | boolean;\n /** Columns to coerce to `boolean`, as {@link numeric}; auto-detect makes a column boolean only if every non-empty cell is exactly `\"true\"` or `\"false\"`. Never applied to a column already numeric. */\n boolean?: string[] | boolean;\n}\n\n/** Parses CSV text into row records keyed by the header row. Handles quoted fields (embedded delimiters, newlines, `\"\"` escapes) and CRLF/LF. Synchronous and dependency-free, so safe at module-eval time on `?raw` text. */\nexport function parseCSV(text: string, options: ParseCSVOptions = {}): DataRecord[] {\n const delimiter = options.delimiter ?? ',';\n const rows = splitRows(text, delimiter);\n if (rows.length === 0) return [];\n\n const header = rows[0].map(cell => cell.trim());\n const body = rows.slice(1);\n\n const records: Record<string, string>[] = body.map(row => {\n const record: Record<string, string> = {};\n header.forEach((key, i) => { record[key] = row[i] ?? ''; });\n return record;\n });\n\n const numericCols = resolveNumericColumns(header, records, options.numeric);\n const booleanCols = resolveBooleanColumns(header, records, numericCols, options.boolean);\n if (numericCols.length === 0 && booleanCols.length === 0) return records;\n\n return records.map(record => {\n const out: DataRecord = { ...record };\n for (const col of numericCols) {\n const raw = record[col];\n if (raw === '') continue;\n out[col] = Number(raw);\n }\n for (const col of booleanCols) {\n const raw = record[col];\n if (raw === '') continue;\n out[col] = raw === 'true';\n }\n return out;\n });\n}\n\n/** Only ever an inlined literal: the `@motionscript/vite-plugin` macro replaces `parseData(\"file.csv\")` call sites with the parsed rows before this runs. This body exists so the call type-checks and an unresolved call site (no plugin, non-literal argument) fails loudly instead of returning nothing. */\nexport function parseData(file: string, _options?: ParseCSVOptions): DataRecord[] {\n throw new Error(\n `parseData(\"${file}\") must be called with a static string literal so the ` +\n `@motionscript/vite-plugin macro can inline it at build time. If you're seeing ` +\n `this error at runtime, either the plugin isn't installed/registered, or this ` +\n `call's argument isn't a plain string literal.`\n );\n}\n\nfunction resolveNumericColumns(\n header: string[],\n records: Record<string, string>[],\n numeric: string[] | boolean | undefined,\n): string[] {\n if (numeric === false) return [];\n if (Array.isArray(numeric)) return numeric;\n\n return header.filter(col => {\n let sawValue = false;\n for (const record of records) {\n const raw = record[col];\n if (raw === '') continue;\n if (!Number.isFinite(Number(raw))) return false;\n sawValue = true;\n }\n return sawValue;\n });\n}\n\nfunction resolveBooleanColumns(\n header: string[],\n records: Record<string, string>[],\n numericCols: string[],\n bool: string[] | boolean | undefined,\n): string[] {\n if (bool === false) return [];\n if (Array.isArray(bool)) return bool;\n\n const numericSet = new Set(numericCols);\n return header.filter(col => {\n if (numericSet.has(col)) return false;\n let sawValue = false;\n for (const record of records) {\n const raw = record[col];\n if (raw === '') continue;\n if (raw !== 'true' && raw !== 'false') return false;\n sawValue = true;\n }\n return sawValue;\n });\n}\n\n/** Splits raw CSV text into rows of unquoted cells. A hand-rolled scanner, not `split(',')`, so quoted fields can contain the delimiter, newlines and `\"\"` escapes. */\nfunction splitRows(text: string, delimiter: string): string[][] {\n const rows: string[][] = [];\n let row: string[] = [];\n let field = '';\n let inQuotes = false;\n let sawAnyField = false;\n\n const pushField = () => { row.push(field); field = ''; };\n const pushRow = () => { pushField(); rows.push(row); row = []; sawAnyField = false; };\n\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n\n if (inQuotes) {\n if (ch === '\"') {\n if (text[i + 1] === '\"') { field += '\"'; i++; }\n else inQuotes = false;\n } else {\n field += ch;\n }\n continue;\n }\n\n if (ch === '\"') { inQuotes = true; sawAnyField = true; continue; }\n if (ch === delimiter) { sawAnyField = true; pushField(); continue; }\n if (ch === '\\r') continue;\n if (ch === '\\n') { if (sawAnyField || field) pushRow(); continue; }\n field += ch;\n sawAnyField = true;\n }\n // Flush a final row left over when the text has no trailing newline.\n if (sawAnyField || field) pushRow();\n\n return rows;\n}\n"]}
@@ -1,31 +1,7 @@
1
- /**
2
- * Two numbers a component ends up needing, neither of which belongs to any one
3
- * of them.
4
- *
5
- * Both were written for the chart family and are used well outside it — a
6
- * graph's plane rounds its ticks with one, a diagram divides its entrance with
7
- * the other. Leaving them there would make a package with nothing to do with
8
- * charts depend on charts for a page of arithmetic.
9
- */
1
+ /** Two numbers a component needs that belong to none of them: written for the chart family but used well outside it (a graph rounds ticks with one, a diagram divides its entrance with the other), so keeping them there would make a non-chart package depend on charts. */
10
2
  /** Round a raw step up to a tidy value (1/2/5 × 10ⁿ) so markers land round. */
11
3
  export declare function niceStep(raw: number): number;
12
- /**
13
- * How an axis's staggered entrance is divided up, so the whole thing fits inside
14
- * `duration` instead of running past it.
15
- *
16
- * The standalone components this family was ported from read `duration` as *one
17
- * marker's* slide, and then added the stagger between them and a full-length
18
- * caption move on the end — so `enter(0.8)` on a five-marker axis actually took
19
- * about 2.2 seconds. That's fine when a scene is a hand-written script whose
20
- * beats are whatever they turn out to be. It is not fine here: an editor lays a
21
- * command out on the timeline at the duration it declares, times its parallel
22
- * siblings against it, and sums those durations into the scene's length. A
23
- * generator that overruns is a command that renders in the wrong place.
24
- *
25
- * So the budget runs the other way: the caption takes a fixed share off the top,
26
- * and the markers' per-move duration is solved for from what's left, given the
27
- * stagger. Same shape of animation, honest arithmetic.
28
- */
4
+ /** Divides an axis's staggered entrance so the whole thing fits inside `duration`. The ported components read `duration` as one marker's slide and then added stagger and a caption move, so `enter(0.8)` on five markers took ~2.2 s; an editor lays a command at its declared duration and sums those into the scene's length, so an overrun renders in the wrong place. The caption takes a fixed share off the top and the per-marker move is solved from what's left, given the stagger. */
29
5
  export declare function enterBudget(duration: number, count: number, hasCaption: boolean,
30
6
  /** An explicit gap between markers; derived from `duration` when omitted. */
31
7
  stagger?: number): {
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/util/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM5C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO;AACnB,6EAA6E;AAC7E,OAAO,CAAC,EAAE,MAAM,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAmBhD"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/util/metrics.ts"],"names":[],"mappings":"AAAA,8QAA8Q;AAE9Q,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM5C;AAED,ieAAie;AACje,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO;AACnB,6EAA6E;AAC7E,OAAO,CAAC,EAAE,MAAM,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAmBhD"}
@@ -1,12 +1,4 @@
1
- /**
2
- * Two numbers a component ends up needing, neither of which belongs to any one
3
- * of them.
4
- *
5
- * Both were written for the chart family and are used well outside it — a
6
- * graph's plane rounds its ticks with one, a diagram divides its entrance with
7
- * the other. Leaving them there would make a package with nothing to do with
8
- * charts depend on charts for a page of arithmetic.
9
- */
1
+ /** Two numbers a component needs that belong to none of them: written for the chart family but used well outside it (a graph rounds ticks with one, a diagram divides its entrance with the other), so keeping them there would make a non-chart package depend on charts. */
10
2
  /** Round a raw step up to a tidy value (1/2/5 × 10ⁿ) so markers land round. */
11
3
  export function niceStep(raw) {
12
4
  if (raw <= 0)
@@ -16,23 +8,7 @@ export function niceStep(raw) {
16
8
  const nice = norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 5 ? 5 : 10;
17
9
  return nice * mag;
18
10
  }
19
- /**
20
- * How an axis's staggered entrance is divided up, so the whole thing fits inside
21
- * `duration` instead of running past it.
22
- *
23
- * The standalone components this family was ported from read `duration` as *one
24
- * marker's* slide, and then added the stagger between them and a full-length
25
- * caption move on the end — so `enter(0.8)` on a five-marker axis actually took
26
- * about 2.2 seconds. That's fine when a scene is a hand-written script whose
27
- * beats are whatever they turn out to be. It is not fine here: an editor lays a
28
- * command out on the timeline at the duration it declares, times its parallel
29
- * siblings against it, and sums those durations into the scene's length. A
30
- * generator that overruns is a command that renders in the wrong place.
31
- *
32
- * So the budget runs the other way: the caption takes a fixed share off the top,
33
- * and the markers' per-move duration is solved for from what's left, given the
34
- * stagger. Same shape of animation, honest arithmetic.
35
- */
11
+ /** Divides an axis's staggered entrance so the whole thing fits inside `duration`. The ported components read `duration` as one marker's slide and then added stagger and a caption move, so `enter(0.8)` on five markers took ~2.2 s; an editor lays a command at its declared duration and sums those into the scene's length, so an overrun renders in the wrong place. The caption takes a fixed share off the top and the per-marker move is solved from what's left, given the stagger. */
36
12
  export function enterBudget(duration, count, hasCaption,
37
13
  /** An explicit gap between markers; derived from `duration` when omitted. */
38
14
  stagger) {
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/util/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAC/E,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,IAAI,GAAG,IAAI,CAAC;QAAE,OAAO,CAAC,CAAA;IACtB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACrD,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;IACtB,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/D,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,KAAa,EACb,UAAmB;AACnB,6EAA6E;AAC7E,OAAgB;IAEhB,wEAAwE;IACxE,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAA;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;IAEnC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,wEAAwE;QACxE,8DAA8D;QAC9D,OAAO;YACL,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;YAC1C,OAAO;SACR,CAAA;IACH,CAAC;IACD,2EAA2E;IAC3E,iEAAiE;IACjE,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAA;AACxC,CAAC","sourcesContent":["/**\n * Two numbers a component ends up needing, neither of which belongs to any one\n * of them.\n *\n * Both were written for the chart family and are used well outside it — a\n * graph's plane rounds its ticks with one, a diagram divides its entrance with\n * the other. Leaving them there would make a package with nothing to do with\n * charts depend on charts for a page of arithmetic.\n */\n\n/** Round a raw step up to a tidy value (1/2/5 × 10ⁿ) so markers land round. */\nexport function niceStep(raw: number): number {\n if (raw <= 0) return 1\n const mag = Math.pow(10, Math.floor(Math.log10(raw)))\n const norm = raw / mag\n const nice = norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 5 ? 5 : 10\n return nice * mag\n}\n\n/**\n * How an axis's staggered entrance is divided up, so the whole thing fits inside\n * `duration` instead of running past it.\n *\n * The standalone components this family was ported from read `duration` as *one\n * marker's* slide, and then added the stagger between them and a full-length\n * caption move on the end — so `enter(0.8)` on a five-marker axis actually took\n * about 2.2 seconds. That's fine when a scene is a hand-written script whose\n * beats are whatever they turn out to be. It is not fine here: an editor lays a\n * command out on the timeline at the duration it declares, times its parallel\n * siblings against it, and sums those durations into the scene's length. A\n * generator that overruns is a command that renders in the wrong place.\n *\n * So the budget runs the other way: the caption takes a fixed share off the top,\n * and the markers' per-move duration is solved for from what's left, given the\n * stagger. Same shape of animation, honest arithmetic.\n */\nexport function enterBudget(\n duration: number,\n count: number,\n hasCaption: boolean,\n /** An explicit gap between markers; derived from `duration` when omitted. */\n stagger?: number\n): { step: number; per: number; caption: number } {\n // The caption lands *after* the last marker, so it needs its own slice.\n const caption = hasCaption ? duration * 0.3 : 0\n const markers = Math.max(0, duration - caption)\n const gaps = Math.max(0, count - 1)\n\n if (stagger !== undefined) {\n // An explicit gap wins; the per-marker move takes whatever is left, and\n // can't go negative on an axis with more markers than budget.\n return {\n step: stagger,\n per: Math.max(0, markers - stagger * gaps),\n caption,\n }\n }\n // Default rhythm: each gap is a fifth of a marker's own move, which is the\n // ratio the original used — solved for here rather than assumed.\n const per = markers / (1 + gaps / 5)\n return { step: per / 5, per, caption }\n}\n"]}
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/util/metrics.ts"],"names":[],"mappings":"AAAA,8QAA8Q;AAE9Q,+EAA+E;AAC/E,MAAM,UAAU,QAAQ,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,IAAI,GAAG,CAAC,CAAC,CAAA;IACpC,OAAO,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAA;AACxC,CAAC","sourcesContent":["/** Two numbers a component needs that belong to none of them: written for the chart family but used well outside it (a graph rounds ticks with one, a diagram divides its entrance with the other), so keeping them there would make a non-chart package depend on charts. */\n\n/** Round a raw step up to a tidy value (1/2/5 × 10ⁿ) so markers land round. */\nexport function niceStep(raw: number): number {\n if (raw <= 0) return 1\n const mag = Math.pow(10, Math.floor(Math.log10(raw)))\n const norm = raw / mag\n const nice = norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 5 ? 5 : 10\n return nice * mag\n}\n\n/** Divides an axis's staggered entrance so the whole thing fits inside `duration`. The ported components read `duration` as one marker's slide and then added stagger and a caption move, so `enter(0.8)` on five markers took ~2.2 s; an editor lays a command at its declared duration and sums those into the scene's length, so an overrun renders in the wrong place. The caption takes a fixed share off the top and the per-marker move is solved from what's left, given the stagger. */\nexport function enterBudget(\n duration: number,\n count: number,\n hasCaption: boolean,\n /** An explicit gap between markers; derived from `duration` when omitted. */\n stagger?: number\n): { step: number; per: number; caption: number } {\n // The caption lands *after* the last marker, so it needs its own slice.\n const caption = hasCaption ? duration * 0.3 : 0\n const markers = Math.max(0, duration - caption)\n const gaps = Math.max(0, count - 1)\n\n if (stagger !== undefined) {\n // An explicit gap wins; the per-marker move takes whatever is left, and\n // can't go negative on an axis with more markers than budget.\n return {\n step: stagger,\n per: Math.max(0, markers - stagger * gaps),\n caption,\n }\n }\n // Default rhythm: each gap is a fifth of a marker's own move, which is the\n // ratio the original used — solved for here rather than assumed.\n const per = markers / (1 + gaps / 5)\n return { step: per / 5, per, caption }\n}\n"]}
@@ -1,121 +1,54 @@
1
- /**
2
- * Deterministic pseudo-random number generator based on the mulberry32 algorithm.
3
- * Produces the same sequence for the same seed, making animations reproducible.
4
- *
5
- * This is the low-level engine. Scene authors use the higher-level {@link Random}
6
- * facade (handed out by `stage.random(seed)`), which wraps a `SeedGenerator` and
7
- * adds typed draws (`nextFloat`/`nextInt`/`gauss`/arrays) plus seeded `noise`.
8
- */
1
+ /** Deterministic mulberry32 PRNG: the same seed gives the same sequence. Scene authors use the {@link Random} facade from `stage.random(seed)`, which wraps this. */
9
2
  export declare class SeedGenerator {
10
3
  private state;
11
4
  constructor(seed: string | number);
12
- /**
13
- * Resets the generator to a new seed.
14
- * String seeds are hashed via djb2 into a 32-bit integer.
15
- */
5
+ /** String seeds are hashed via djb2 into a 32-bit integer. */
16
6
  setSeed(seed: string | number): void;
17
- /** Returns the next pseudo-random float in [0, 1). */
18
7
  next(): number;
19
8
  }
20
9
  /**
21
- * A seeded random source handed to scene generators by `stage.random(seed)`.
10
+ * A seeded random source handed out by `stage.random(seed)`; wraps a {@link SeedGenerator} (mulberry32). Determinism
11
+ * is scoped per source: scenes each get their own reproducible stream without a shared stage-level seed.
22
12
  *
23
- * Wraps a {@link SeedGenerator} (mulberry32) and exposes the author-facing draw
24
- * surface. Because the seed lives on the `Random` instance, determinism is
25
- * scoped per source: two scenes can each `stage.random("name")` and get their
26
- * own reproducible stream without touching a shared stage-level seed.
27
- *
28
- * const random = stage.random("sparkle");
29
- * const xs = random.floatArray(40, -100, 100); // 40 reproducible offsets
30
- * const drift = random.noise(t, 6); // smooth field over time
31
- *
32
- * Two families live here, and they are NOT interchangeable:
33
- * - **Independent draws** — `nextFloat`/`nextInt`/`gauss` and their array
34
- * forms. Successive calls are uncorrelated; `gauss` only changes the
35
- * *distribution* (bell curve vs flat), not the independence.
36
- * - **Correlated field** — `noise(t)`. Nearby inputs return nearby values, so
37
- * it is the right tool for smooth motion over time/space (drift, shake,
38
- * waves). No distribution draw can reproduce that smoothness.
13
+ * Two families that are NOT interchangeable: **independent draws** (`nextFloat`/`nextInt`/`gauss` and array forms,
14
+ * uncorrelated; `gauss` changes only the distribution) and the **correlated field** `noise(t)`, where nearby inputs
15
+ * give nearby values, the right tool for smooth motion (drift, shake, waves).
39
16
  */
40
17
  export declare class Random {
41
- /** The seed this source rewinds to; reassign via {@link seed} or
42
- * {@link reset}. Set by {@link adopt} (definitely assigned via the
43
- * constructor's `adopt` call). */
18
+ /** The seed this source rewinds to; set by {@link adopt}. */
44
19
  private _seed;
45
- /** Numeric form of {@link _seed}, used to mix `noise`'s lattice. Kept in
46
- * lockstep with `_seed` through {@link adopt}. */
20
+ /** Numeric form of {@link _seed}, used to mix `noise`'s lattice; kept in lockstep through {@link adopt}. */
47
21
  private numericSeed;
48
22
  private readonly gen;
49
23
  /** A spare gaussian sample from the last Box–Muller pair (see {@link gauss}). */
50
24
  private spareGauss;
51
25
  constructor(seed: string | number);
52
- /** The seed this source rewinds to. Assigning a new value re-anchors the
53
- * source (same effect as `reset(seed)`): the next draws reproduce the
54
- * sequence for that seed, and `noise`'s lattice shifts to match. */
26
+ /** The seed this source rewinds to. Assigning re-anchors the source (as `reset(seed)`): draws reproduce that seed's sequence and `noise`'s lattice shifts to match. */
55
27
  get seed(): string | number;
56
28
  set seed(seed: string | number);
57
- /** Numeric form of a seed: string seeds are hashed (the same djb2-style mix
58
- * the generator uses), numbers pass through. Shared so the constructor, the
59
- * {@link seed} setter, and {@link reset} all derive `numericSeed` identically. */
29
+ /** Numeric form of a seed (strings hashed djb2-style), shared so the constructor, setter and {@link reset} derive `numericSeed` identically. */
60
30
  private static toNumeric;
61
- /** Take `seed` as the new origin and rewind to it: store it, recompute the
62
- * `noise` lattice anchor, reset the generator, and drop any spare gauss. The
63
- * single seed-adoption path behind the constructor, {@link seed}, and a
64
- * seeded {@link reset}. */
31
+ /** Takes `seed` as the new origin and rewinds to it; the single seed-adoption path behind the constructor, {@link seed} and a seeded {@link reset}. */
65
32
  private adopt;
66
- /**
67
- * The next pseudo-random float in `[from, to)`. Defaults to `[0, 1)`.
68
- */
33
+ /** The next float in `[from, to)`, default `[0, 1)`. */
69
34
  nextFloat(from?: number, to?: number): number;
70
- /**
71
- * The next pseudo-random integer in `[from, to)`. Defaults to the full
72
- * unsigned 32-bit range `[0, 2^32)`.
73
- */
35
+ /** The next integer in `[from, to)`, default the full unsigned 32-bit range. */
74
36
  nextInt(from?: number, to?: number): number;
75
37
  /** `size` independent floats in `[from, to)`. */
76
38
  floatArray(size: number, from?: number, to?: number): number[];
77
39
  /** `size` independent integers in `[from, to)`. */
78
40
  intArray(size: number, from?: number, to?: number): number[];
79
- /**
80
- * A normally-distributed sample with the given `mean` and `stdev` (default
81
- * standard normal). Values cluster near the mean and tail off — useful for
82
- * natural-looking scatter where most draws stay central with occasional
83
- * outliers.
84
- *
85
- * Uses the polar Box–Muller transform, which yields two independent normals
86
- * per pair of uniforms; the spare is cached and returned on the next call.
87
- */
41
+ /** A normal sample (default standard). Uses the polar Box–Muller transform, which yields two normals per pair of uniforms; the spare is cached for the next call. */
88
42
  gauss(mean?: number, stdev?: number): number;
89
43
  /**
90
- * Smooth 1-D value noise in `[0, 1]`.
91
- *
92
- * Samples two adjacent lattice points around `time * frequency`, then
93
- * interpolates with a smoothstep curve (`3t² - 2t³`) to avoid the linear
94
- * kinks of plain lerp. Unlike {@link nextFloat}/{@link gauss}, nearby
95
- * `time` inputs return nearby values — this is the correlated field used for
96
- * organic, continuously varying motion (camera shake, drift, waves).
97
- *
98
- * @param time Sample position (e.g. normalized timeline `[0, 1]`, or a
99
- * spatial index).
100
- * @param frequency Scales `time` before sampling; higher = faster
101
- * oscillation / more crests across the same span.
44
+ * Smooth 1-D value noise in `[0, 1]`: lattice points around `time * frequency` interpolated with a smoothstep.
45
+ * Unlike {@link nextFloat}/{@link gauss}, nearby `time` inputs give nearby values (camera shake, drift, waves).
46
+ * Higher `frequency` means more crests across the same span.
102
47
  */
103
48
  noise(time: number, frequency?: number): number;
104
- /**
105
- * Rewind this source so the next draws reproduce a sequence from the start.
106
- *
107
- * With no argument, rewinds to the current {@link seed} — what authors call to
108
- * repeat a sequence within a scene. Pass a `seed` to adopt it as the new origin
109
- * first (equivalent to assigning {@link seed}), so the source both re-seeds and
110
- * rewinds in one call — e.g. in a node's constructor to give it a distinct
111
- * reproducible stream.
112
- */
49
+ /** Rewinds so the next draws reproduce a sequence from the start. With a `seed`, adopts it as the new origin first (equivalent to assigning {@link seed}), e.g. in a node's constructor for a distinct stream. */
113
50
  reset(seed?: string | number): void;
114
- /**
115
- * Deterministic value in `[0, 1)` for a given integer lattice point `x`,
116
- * mixed with this source's seed via `sin`. Pure in `x` (no generator state),
117
- * so {@link noise} is stable regardless of how many draws preceded it.
118
- */
51
+ /** Deterministic value in `[0, 1)` for lattice point `x`, mixed with the seed via `sin`. Pure in `x`, so {@link noise} is stable regardless of preceding draws. */
119
52
  private latticeValue;
120
53
  }
121
54
  //# sourceMappingURL=random.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/util/random.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,aAAa;IACtB,OAAO,CAAC,KAAK,CAAa;gBAEd,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAM7B,sDAAsD;IACtD,IAAI;CAMP;AAKD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,MAAM;IACf;;sCAEkC;IAClC,OAAO,CAAC,KAAK,CAAmB;IAEhC;sDACkD;IAClD,OAAO,CAAC,WAAW,CAAU;IAE7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IAEpC,iFAAiF;IACjF,OAAO,CAAC,UAAU,CAAuB;gBAE7B,IAAI,EAAE,MAAM,GAAG,MAAM;IAKjC;;wEAEoE;IACpE,IAAI,IAAI,IAAI,MAAM,GAAG,MAAM,CAE1B;IACD,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAE7B;IAED;;sFAEkF;IAClF,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB;;;+BAG2B;IAC3B,OAAO,CAAC,KAAK;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AM,GAAG,MAAM;IAKjC,uKAAuK;IACvK,IAAI,IAAI,IAAI,MAAM,GAAG,MAAM,CAE1B;IACD,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAE7B;IAED,gJAAgJ;IAChJ,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB,uJAAuJ;IACvJ,OAAO,CAAC,KAAK;IAOb,wDAAwD;IACxD,SAAS,CAAC,IAAI,GAAE,MAAU,EAAE,EAAE,GAAE,MAAU,GAAG,MAAM;IAInD,gFAAgF;IAChF,OAAO,CAAC,IAAI,GAAE,MAAU,EAAE,EAAE,GAAE,MAAqB,GAAG,MAAM;IAI5D,iDAAiD;IACjD,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,EAAE,EAAE,GAAE,MAAU,GAAG,MAAM,EAAE;IAMpE,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,EAAE,EAAE,GAAE,MAAqB,GAAG,MAAM,EAAE;IAM7E,qKAAqK;IACrK,KAAK,CAAC,IAAI,GAAE,MAAU,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM;IAkBlD;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAU,GAAG,MAAM;IAWlD,kNAAkN;IAClN,KAAK,CAAC,IAAI,GAAE,MAAM,GAAG,MAAmB,GAAG,IAAI;IAI/C,mKAAmK;IACnK,OAAO,CAAC,YAAY;CAIvB"}
@@ -1,26 +1,15 @@
1
- /**
2
- * Deterministic pseudo-random number generator based on the mulberry32 algorithm.
3
- * Produces the same sequence for the same seed, making animations reproducible.
4
- *
5
- * This is the low-level engine. Scene authors use the higher-level {@link Random}
6
- * facade (handed out by `stage.random(seed)`), which wraps a `SeedGenerator` and
7
- * adds typed draws (`nextFloat`/`nextInt`/`gauss`/arrays) plus seeded `noise`.
8
- */
1
+ /** Deterministic mulberry32 PRNG: the same seed gives the same sequence. Scene authors use the {@link Random} facade from `stage.random(seed)`, which wraps this. */
9
2
  export class SeedGenerator {
10
3
  state = 0;
11
4
  constructor(seed) {
12
5
  this.setSeed(seed);
13
6
  }
14
- /**
15
- * Resets the generator to a new seed.
16
- * String seeds are hashed via djb2 into a 32-bit integer.
17
- */
7
+ /** String seeds are hashed via djb2 into a 32-bit integer. */
18
8
  setSeed(seed) {
19
9
  this.state = typeof seed === 'string'
20
10
  ? seed.split('').reduce((a, b) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0)
21
11
  : seed;
22
12
  }
23
- /** Returns the next pseudo-random float in [0, 1). */
24
13
  next() {
25
14
  this.state |= 0;
26
15
  this.state = this.state + 0x6D2B79F5 | 0;
@@ -32,32 +21,17 @@ export class SeedGenerator {
32
21
  /** Upper bound of {@link Random.nextInt} / {@link Random.intArray} (2^32). */
33
22
  const UINT32_RANGE = 4294967296;
34
23
  /**
35
- * A seeded random source handed to scene generators by `stage.random(seed)`.
24
+ * A seeded random source handed out by `stage.random(seed)`; wraps a {@link SeedGenerator} (mulberry32). Determinism
25
+ * is scoped per source: scenes each get their own reproducible stream without a shared stage-level seed.
36
26
  *
37
- * Wraps a {@link SeedGenerator} (mulberry32) and exposes the author-facing draw
38
- * surface. Because the seed lives on the `Random` instance, determinism is
39
- * scoped per source: two scenes can each `stage.random("name")` and get their
40
- * own reproducible stream without touching a shared stage-level seed.
41
- *
42
- * const random = stage.random("sparkle");
43
- * const xs = random.floatArray(40, -100, 100); // 40 reproducible offsets
44
- * const drift = random.noise(t, 6); // smooth field over time
45
- *
46
- * Two families live here, and they are NOT interchangeable:
47
- * - **Independent draws** — `nextFloat`/`nextInt`/`gauss` and their array
48
- * forms. Successive calls are uncorrelated; `gauss` only changes the
49
- * *distribution* (bell curve vs flat), not the independence.
50
- * - **Correlated field** — `noise(t)`. Nearby inputs return nearby values, so
51
- * it is the right tool for smooth motion over time/space (drift, shake,
52
- * waves). No distribution draw can reproduce that smoothness.
27
+ * Two families that are NOT interchangeable: **independent draws** (`nextFloat`/`nextInt`/`gauss` and array forms,
28
+ * uncorrelated; `gauss` changes only the distribution) and the **correlated field** `noise(t)`, where nearby inputs
29
+ * give nearby values, the right tool for smooth motion (drift, shake, waves).
53
30
  */
54
31
  export class Random {
55
- /** The seed this source rewinds to; reassign via {@link seed} or
56
- * {@link reset}. Set by {@link adopt} (definitely assigned via the
57
- * constructor's `adopt` call). */
32
+ /** The seed this source rewinds to; set by {@link adopt}. */
58
33
  _seed;
59
- /** Numeric form of {@link _seed}, used to mix `noise`'s lattice. Kept in
60
- * lockstep with `_seed` through {@link adopt}. */
34
+ /** Numeric form of {@link _seed}, used to mix `noise`'s lattice; kept in lockstep through {@link adopt}. */
61
35
  numericSeed;
62
36
  gen;
63
37
  /** A spare gaussian sample from the last Box–Muller pair (see {@link gauss}). */
@@ -66,43 +40,31 @@ export class Random {
66
40
  this.gen = new SeedGenerator(seed);
67
41
  this.adopt(seed);
68
42
  }
69
- /** The seed this source rewinds to. Assigning a new value re-anchors the
70
- * source (same effect as `reset(seed)`): the next draws reproduce the
71
- * sequence for that seed, and `noise`'s lattice shifts to match. */
43
+ /** The seed this source rewinds to. Assigning re-anchors the source (as `reset(seed)`): draws reproduce that seed's sequence and `noise`'s lattice shifts to match. */
72
44
  get seed() {
73
45
  return this._seed;
74
46
  }
75
47
  set seed(seed) {
76
48
  this.adopt(seed);
77
49
  }
78
- /** Numeric form of a seed: string seeds are hashed (the same djb2-style mix
79
- * the generator uses), numbers pass through. Shared so the constructor, the
80
- * {@link seed} setter, and {@link reset} all derive `numericSeed` identically. */
50
+ /** Numeric form of a seed (strings hashed djb2-style), shared so the constructor, setter and {@link reset} derive `numericSeed` identically. */
81
51
  static toNumeric(seed) {
82
52
  return typeof seed === 'string'
83
53
  ? seed.split('').reduce((a, b) => (a << 5) - a + b.charCodeAt(0), 0)
84
54
  : seed;
85
55
  }
86
- /** Take `seed` as the new origin and rewind to it: store it, recompute the
87
- * `noise` lattice anchor, reset the generator, and drop any spare gauss. The
88
- * single seed-adoption path behind the constructor, {@link seed}, and a
89
- * seeded {@link reset}. */
56
+ /** Takes `seed` as the new origin and rewinds to it; the single seed-adoption path behind the constructor, {@link seed} and a seeded {@link reset}. */
90
57
  adopt(seed) {
91
58
  this._seed = seed;
92
59
  this.numericSeed = Random.toNumeric(seed);
93
60
  this.gen.setSeed(seed);
94
61
  this.spareGauss = null;
95
62
  }
96
- /**
97
- * The next pseudo-random float in `[from, to)`. Defaults to `[0, 1)`.
98
- */
63
+ /** The next float in `[from, to)`, default `[0, 1)`. */
99
64
  nextFloat(from = 0, to = 1) {
100
65
  return this.gen.next() * (to - from) + from;
101
66
  }
102
- /**
103
- * The next pseudo-random integer in `[from, to)`. Defaults to the full
104
- * unsigned 32-bit range `[0, 2^32)`.
105
- */
67
+ /** The next integer in `[from, to)`, default the full unsigned 32-bit range. */
106
68
  nextInt(from = 0, to = UINT32_RANGE) {
107
69
  return Math.floor(this.gen.next() * (to - from)) + from;
108
70
  }
@@ -120,15 +82,7 @@ export class Random {
120
82
  out[i] = this.nextInt(from, to);
121
83
  return out;
122
84
  }
123
- /**
124
- * A normally-distributed sample with the given `mean` and `stdev` (default
125
- * standard normal). Values cluster near the mean and tail off — useful for
126
- * natural-looking scatter where most draws stay central with occasional
127
- * outliers.
128
- *
129
- * Uses the polar Box–Muller transform, which yields two independent normals
130
- * per pair of uniforms; the spare is cached and returned on the next call.
131
- */
85
+ /** A normal sample (default standard). Uses the polar Box–Muller transform, which yields two normals per pair of uniforms; the spare is cached for the next call. */
132
86
  gauss(mean = 0, stdev = 1) {
133
87
  if (this.spareGauss !== null) {
134
88
  const z = this.spareGauss;
@@ -147,18 +101,9 @@ export class Random {
147
101
  return mean + stdev * (u * mul);
148
102
  }
149
103
  /**
150
- * Smooth 1-D value noise in `[0, 1]`.
151
- *
152
- * Samples two adjacent lattice points around `time * frequency`, then
153
- * interpolates with a smoothstep curve (`3t² - 2t³`) to avoid the linear
154
- * kinks of plain lerp. Unlike {@link nextFloat}/{@link gauss}, nearby
155
- * `time` inputs return nearby values — this is the correlated field used for
156
- * organic, continuously varying motion (camera shake, drift, waves).
157
- *
158
- * @param time Sample position (e.g. normalized timeline `[0, 1]`, or a
159
- * spatial index).
160
- * @param frequency Scales `time` before sampling; higher = faster
161
- * oscillation / more crests across the same span.
104
+ * Smooth 1-D value noise in `[0, 1]`: lattice points around `time * frequency` interpolated with a smoothstep.
105
+ * Unlike {@link nextFloat}/{@link gauss}, nearby `time` inputs give nearby values (camera shake, drift, waves).
106
+ * Higher `frequency` means more crests across the same span.
162
107
  */
163
108
  noise(time, frequency = 1) {
164
109
  const t = time * frequency;
@@ -170,23 +115,11 @@ export class Random {
170
115
  const r2 = this.latticeValue(i + 1);
171
116
  return r1 + (r2 - r1) * curve;
172
117
  }
173
- /**
174
- * Rewind this source so the next draws reproduce a sequence from the start.
175
- *
176
- * With no argument, rewinds to the current {@link seed} — what authors call to
177
- * repeat a sequence within a scene. Pass a `seed` to adopt it as the new origin
178
- * first (equivalent to assigning {@link seed}), so the source both re-seeds and
179
- * rewinds in one call — e.g. in a node's constructor to give it a distinct
180
- * reproducible stream.
181
- */
118
+ /** Rewinds so the next draws reproduce a sequence from the start. With a `seed`, adopts it as the new origin first (equivalent to assigning {@link seed}), e.g. in a node's constructor for a distinct stream. */
182
119
  reset(seed = this._seed) {
183
120
  this.adopt(seed);
184
121
  }
185
- /**
186
- * Deterministic value in `[0, 1)` for a given integer lattice point `x`,
187
- * mixed with this source's seed via `sin`. Pure in `x` (no generator state),
188
- * so {@link noise} is stable regardless of how many draws preceded it.
189
- */
122
+ /** Deterministic value in `[0, 1)` for lattice point `x`, mixed with the seed via `sin`. Pure in `x`, so {@link noise} is stable regardless of preceding draws. */
190
123
  latticeValue(x) {
191
124
  const h = Math.sin(x + this.numericSeed) * 10000;
192
125
  return h - Math.floor(h);
@@ -1 +1 @@
1
- {"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/util/random.ts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B,IAAI,CAAC,KAAK;QACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACK,YAAY,CAAC,CAAS;QAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;QACjD,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["/**\n * Deterministic pseudo-random number generator based on the mulberry32 algorithm.\n * Produces the same sequence for the same seed, making animations reproducible.\n *\n * This is the low-level engine. Scene authors use the higher-level {@link Random}\n * facade (handed out by `stage.random(seed)`), which wraps a `SeedGenerator` and\n * adds typed draws (`nextFloat`/`nextInt`/`gauss`/arrays) plus seeded `noise`.\n */\nexport class SeedGenerator {\n private state: number = 0;\n\n constructor(seed: string | number) {\n this.setSeed(seed);\n }\n\n /**\n * Resets the generator to a new seed.\n * String seeds are hashed via djb2 into a 32-bit integer.\n */\n setSeed(seed: string | number) {\n this.state = typeof seed === 'string'\n ? seed.split('').reduce((a, b) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0)\n : seed;\n }\n\n /** Returns the next pseudo-random float in [0, 1). */\n next() {\n this.state |= 0; this.state = this.state + 0x6D2B79F5 | 0;\n var t = Math.imul(this.state ^ this.state >>> 15, 1 | this.state);\n t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;\n return ((t ^ t >>> 14) >>> 0) / 4294967296;\n }\n}\n\n/** Upper bound of {@link Random.nextInt} / {@link Random.intArray} (2^32). */\nconst UINT32_RANGE = 4294967296;\n\n/**\n * A seeded random source handed to scene generators by `stage.random(seed)`.\n *\n * Wraps a {@link SeedGenerator} (mulberry32) and exposes the author-facing draw\n * surface. Because the seed lives on the `Random` instance, determinism is\n * scoped per source: two scenes can each `stage.random(\"name\")` and get their\n * own reproducible stream without touching a shared stage-level seed.\n *\n * const random = stage.random(\"sparkle\");\n * const xs = random.floatArray(40, -100, 100); // 40 reproducible offsets\n * const drift = random.noise(t, 6); // smooth field over time\n *\n * Two families live here, and they are NOT interchangeable:\n * - **Independent draws** — `nextFloat`/`nextInt`/`gauss` and their array\n * forms. Successive calls are uncorrelated; `gauss` only changes the\n * *distribution* (bell curve vs flat), not the independence.\n * - **Correlated field** — `noise(t)`. Nearby inputs return nearby values, so\n * it is the right tool for smooth motion over time/space (drift, shake,\n * waves). No distribution draw can reproduce that smoothness.\n */\nexport class Random {\n /** The seed this source rewinds to; reassign via {@link seed} or\n * {@link reset}. Set by {@link adopt} (definitely assigned via the\n * constructor's `adopt` call). */\n private _seed!: string | number;\n\n /** Numeric form of {@link _seed}, used to mix `noise`'s lattice. Kept in\n * lockstep with `_seed` through {@link adopt}. */\n private numericSeed!: number;\n\n private readonly gen: SeedGenerator;\n\n /** A spare gaussian sample from the last Box–Muller pair (see {@link gauss}). */\n private spareGauss: number | null = null;\n\n constructor(seed: string | number) {\n this.gen = new SeedGenerator(seed);\n this.adopt(seed);\n }\n\n /** The seed this source rewinds to. Assigning a new value re-anchors the\n * source (same effect as `reset(seed)`): the next draws reproduce the\n * sequence for that seed, and `noise`'s lattice shifts to match. */\n get seed(): string | number {\n return this._seed;\n }\n set seed(seed: string | number) {\n this.adopt(seed);\n }\n\n /** Numeric form of a seed: string seeds are hashed (the same djb2-style mix\n * the generator uses), numbers pass through. Shared so the constructor, the\n * {@link seed} setter, and {@link reset} all derive `numericSeed` identically. */\n private static toNumeric(seed: string | number): number {\n return typeof seed === 'string'\n ? seed.split('').reduce((a, b) => (a << 5) - a + b.charCodeAt(0), 0)\n : seed;\n }\n\n /** Take `seed` as the new origin and rewind to it: store it, recompute the\n * `noise` lattice anchor, reset the generator, and drop any spare gauss. The\n * single seed-adoption path behind the constructor, {@link seed}, and a\n * seeded {@link reset}. */\n private adopt(seed: string | number): void {\n this._seed = seed;\n this.numericSeed = Random.toNumeric(seed);\n this.gen.setSeed(seed);\n this.spareGauss = null;\n }\n\n /**\n * The next pseudo-random float in `[from, to)`. Defaults to `[0, 1)`.\n */\n nextFloat(from: number = 0, to: number = 1): number {\n return this.gen.next() * (to - from) + from;\n }\n\n /**\n * The next pseudo-random integer in `[from, to)`. Defaults to the full\n * unsigned 32-bit range `[0, 2^32)`.\n */\n nextInt(from: number = 0, to: number = UINT32_RANGE): number {\n return Math.floor(this.gen.next() * (to - from)) + from;\n }\n\n /** `size` independent floats in `[from, to)`. */\n floatArray(size: number, from: number = 0, to: number = 1): number[] {\n const out = new Array<number>(size);\n for (let i = 0; i < size; i++) out[i] = this.nextFloat(from, to);\n return out;\n }\n\n /** `size` independent integers in `[from, to)`. */\n intArray(size: number, from: number = 0, to: number = UINT32_RANGE): number[] {\n const out = new Array<number>(size);\n for (let i = 0; i < size; i++) out[i] = this.nextInt(from, to);\n return out;\n }\n\n /**\n * A normally-distributed sample with the given `mean` and `stdev` (default\n * standard normal). Values cluster near the mean and tail off — useful for\n * natural-looking scatter where most draws stay central with occasional\n * outliers.\n *\n * Uses the polar Box–Muller transform, which yields two independent normals\n * per pair of uniforms; the spare is cached and returned on the next call.\n */\n gauss(mean: number = 0, stdev: number = 1): number {\n if (this.spareGauss !== null) {\n const z = this.spareGauss;\n this.spareGauss = null;\n return mean + stdev * z;\n }\n // Rejection-sample a point in the unit circle, then map to two normals.\n let u: number, v: number, s: number;\n do {\n u = this.gen.next() * 2 - 1;\n v = this.gen.next() * 2 - 1;\n s = u * u + v * v;\n } while (s >= 1 || s === 0);\n const mul = Math.sqrt(-2 * Math.log(s) / s);\n this.spareGauss = v * mul;\n return mean + stdev * (u * mul);\n }\n\n /**\n * Smooth 1-D value noise in `[0, 1]`.\n *\n * Samples two adjacent lattice points around `time * frequency`, then\n * interpolates with a smoothstep curve (`3t² - 2t³`) to avoid the linear\n * kinks of plain lerp. Unlike {@link nextFloat}/{@link gauss}, nearby\n * `time` inputs return nearby values — this is the correlated field used for\n * organic, continuously varying motion (camera shake, drift, waves).\n *\n * @param time Sample position (e.g. normalized timeline `[0, 1]`, or a\n * spatial index).\n * @param frequency Scales `time` before sampling; higher = faster\n * oscillation / more crests across the same span.\n */\n noise(time: number, frequency: number = 1): number {\n const t = time * frequency;\n const i = Math.floor(t);\n const f = t - i;\n // Smoothstep: maps f through 3f²-2f³ to ease in/out between lattice points.\n const curve = f * f * (3 - 2 * f);\n const r1 = this.latticeValue(i);\n const r2 = this.latticeValue(i + 1);\n return r1 + (r2 - r1) * curve;\n }\n\n /**\n * Rewind this source so the next draws reproduce a sequence from the start.\n *\n * With no argument, rewinds to the current {@link seed} — what authors call to\n * repeat a sequence within a scene. Pass a `seed` to adopt it as the new origin\n * first (equivalent to assigning {@link seed}), so the source both re-seeds and\n * rewinds in one call — e.g. in a node's constructor to give it a distinct\n * reproducible stream.\n */\n reset(seed: string | number = this._seed): void {\n this.adopt(seed);\n }\n\n /**\n * Deterministic value in `[0, 1)` for a given integer lattice point `x`,\n * mixed with this source's seed via `sin`. Pure in `x` (no generator state),\n * so {@link noise} is stable regardless of how many draws preceded it.\n */\n private latticeValue(x: number): number {\n const h = Math.sin(x + this.numericSeed) * 10000;\n return h - Math.floor(h);\n }\n}\n"]}
1
+ {"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/util/random.ts"],"names":[],"mappings":"AAAA,qKAAqK;AACrK,MAAM,OAAO,aAAa;IACd,KAAK,GAAW,CAAC,CAAC;IAE1B,YAAY,IAAqB;QAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,8DAA8D;IAC9D,OAAO,CAAC,IAAqB;QACzB,IAAI,CAAC,KAAK,GAAG,OAAO,IAAI,KAAK,QAAQ;YACjC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,C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CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,CAAC,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAY,EAAE,YAAoB,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;QAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,4EAA4E;QAC5E,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAClC,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpC,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,kNAAkN;IAClN,KAAK,CAAC,OAAwB,IAAI,CAAC,KAAK;QACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,mKAAmK;IAC3J,YAAY,CAAC,CAAS;QAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;QACjD,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["/** Deterministic mulberry32 PRNG: the same seed gives the same sequence. Scene authors use the {@link Random} facade from `stage.random(seed)`, which wraps this. */\nexport class SeedGenerator {\n private state: number = 0;\n\n constructor(seed: string | number) {\n this.setSeed(seed);\n }\n\n /** String seeds are hashed via djb2 into a 32-bit integer. */\n setSeed(seed: string | number) {\n this.state = typeof seed === 'string'\n ? seed.split('').reduce((a, b) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0)\n : seed;\n }\n\n next() {\n this.state |= 0; this.state = this.state + 0x6D2B79F5 | 0;\n var t = Math.imul(this.state ^ this.state >>> 15, 1 | this.state);\n t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;\n return ((t ^ t >>> 14) >>> 0) / 4294967296;\n }\n}\n\n/** Upper bound of {@link Random.nextInt} / {@link Random.intArray} (2^32). */\nconst UINT32_RANGE = 4294967296;\n\n/**\n * A seeded random source handed out by `stage.random(seed)`; wraps a {@link SeedGenerator} (mulberry32). Determinism\n * is scoped per source: scenes each get their own reproducible stream without a shared stage-level seed.\n *\n * Two families that are NOT interchangeable: **independent draws** (`nextFloat`/`nextInt`/`gauss` and array forms,\n * uncorrelated; `gauss` changes only the distribution) and the **correlated field** `noise(t)`, where nearby inputs\n * give nearby values, the right tool for smooth motion (drift, shake, waves).\n */\nexport class Random {\n /** The seed this source rewinds to; set by {@link adopt}. */\n private _seed!: string | number;\n\n /** Numeric form of {@link _seed}, used to mix `noise`'s lattice; kept in lockstep through {@link adopt}. */\n private numericSeed!: number;\n\n private readonly gen: SeedGenerator;\n\n /** A spare gaussian sample from the last Box–Muller pair (see {@link gauss}). */\n private spareGauss: number | null = null;\n\n constructor(seed: string | number) {\n this.gen = new SeedGenerator(seed);\n this.adopt(seed);\n }\n\n /** The seed this source rewinds to. Assigning re-anchors the source (as `reset(seed)`): draws reproduce that seed's sequence and `noise`'s lattice shifts to match. */\n get seed(): string | number {\n return this._seed;\n }\n set seed(seed: string | number) {\n this.adopt(seed);\n }\n\n /** Numeric form of a seed (strings hashed djb2-style), shared so the constructor, setter and {@link reset} derive `numericSeed` identically. */\n private static toNumeric(seed: string | number): number {\n return typeof seed === 'string'\n ? seed.split('').reduce((a, b) => (a << 5) - a + b.charCodeAt(0), 0)\n : seed;\n }\n\n /** Takes `seed` as the new origin and rewinds to it; the single seed-adoption path behind the constructor, {@link seed} and a seeded {@link reset}. */\n private adopt(seed: string | number): void {\n this._seed = seed;\n this.numericSeed = Random.toNumeric(seed);\n this.gen.setSeed(seed);\n this.spareGauss = null;\n }\n\n /** The next float in `[from, to)`, default `[0, 1)`. */\n nextFloat(from: number = 0, to: number = 1): number {\n return this.gen.next() * (to - from) + from;\n }\n\n /** The next integer in `[from, to)`, default the full unsigned 32-bit range. */\n nextInt(from: number = 0, to: number = UINT32_RANGE): number {\n return Math.floor(this.gen.next() * (to - from)) + from;\n }\n\n /** `size` independent floats in `[from, to)`. */\n floatArray(size: number, from: number = 0, to: number = 1): number[] {\n const out = new Array<number>(size);\n for (let i = 0; i < size; i++) out[i] = this.nextFloat(from, to);\n return out;\n }\n\n /** `size` independent integers in `[from, to)`. */\n intArray(size: number, from: number = 0, to: number = UINT32_RANGE): number[] {\n const out = new Array<number>(size);\n for (let i = 0; i < size; i++) out[i] = this.nextInt(from, to);\n return out;\n }\n\n /** A normal sample (default standard). Uses the polar Box–Muller transform, which yields two normals per pair of uniforms; the spare is cached for the next call. */\n gauss(mean: number = 0, stdev: number = 1): number {\n if (this.spareGauss !== null) {\n const z = this.spareGauss;\n this.spareGauss = null;\n return mean + stdev * z;\n }\n // Rejection-sample a point in the unit circle, then map to two normals.\n let u: number, v: number, s: number;\n do {\n u = this.gen.next() * 2 - 1;\n v = this.gen.next() * 2 - 1;\n s = u * u + v * v;\n } while (s >= 1 || s === 0);\n const mul = Math.sqrt(-2 * Math.log(s) / s);\n this.spareGauss = v * mul;\n return mean + stdev * (u * mul);\n }\n\n /**\n * Smooth 1-D value noise in `[0, 1]`: lattice points around `time * frequency` interpolated with a smoothstep.\n * Unlike {@link nextFloat}/{@link gauss}, nearby `time` inputs give nearby values (camera shake, drift, waves).\n * Higher `frequency` means more crests across the same span.\n */\n noise(time: number, frequency: number = 1): number {\n const t = time * frequency;\n const i = Math.floor(t);\n const f = t - i;\n // Smoothstep: maps f through 3f²-2f³ to ease in/out between lattice points.\n const curve = f * f * (3 - 2 * f);\n const r1 = this.latticeValue(i);\n const r2 = this.latticeValue(i + 1);\n return r1 + (r2 - r1) * curve;\n }\n\n /** Rewinds so the next draws reproduce a sequence from the start. With a `seed`, adopts it as the new origin first (equivalent to assigning {@link seed}), e.g. in a node's constructor for a distinct stream. */\n reset(seed: string | number = this._seed): void {\n this.adopt(seed);\n }\n\n /** Deterministic value in `[0, 1)` for lattice point `x`, mixed with the seed via `sin`. Pure in `x`, so {@link noise} is stable regardless of preceding draws. */\n private latticeValue(x: number): number {\n const h = Math.sin(x + this.numericSeed) * 10000;\n return h - Math.floor(h);\n }\n}\n"]}