@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
@@ -1,93 +1,47 @@
1
1
  import type { ShaderUniformRecord } from "./uniforms.js";
2
2
  import type { ShaderLanguage } from "./language.js";
3
3
  /**
4
- * A **shader pack**: a program, plus what a host may edit about it.
5
- *
6
- * The interchange format for a shader — authored as JSON, imported as a value,
7
- * handed to `Fills.shader` or `Effects.shader`. It exists because a bare source
8
- * string says nothing about which of its uniforms are meant to be touched, what
9
- * they are called in a panel, or what range they take, so every host that wanted
10
- * to offer a slider had to keep that table itself, beside a program it did not
11
- * own.
12
- *
13
- * **Two scopes, one shape.** A fill paints inside a shape's path and may sample
14
- * textures; an effect paints over a layer and may sample what is beneath it.
15
- * Those are the only two differences, and making them arms of a union rather
16
- * than optional fields on one type is what makes `Fills.shader(anEffectShader)`
17
- * a compile error instead of a program that fails at the first frame.
4
+ * A **shader pack**: a program plus what a host may edit about it, the interchange format for a shader (authored as
5
+ * JSON, handed to `Fills.shader` or `Effects.shader`). A bare source string says nothing about which uniforms are
6
+ * editable, their panel names or ranges. **Two scopes, one shape**: a fill paints inside a shape's path and may
7
+ * sample textures, an effect paints over a layer and may sample what is beneath it; as union arms,
8
+ * `Fills.shader(anEffectShader)` is a compile error instead of a first-frame failure.
18
9
  */
19
10
  export type Shader = FillShader | EffectShader;
20
- /** What both scopes carry. */
21
11
  export interface ShaderBase {
22
- /**
23
- * Format tag, so a file that is not one of these can be told apart from one
24
- * that is merely from a newer version.
25
- */
12
+ /** Format tag, so a file that is not one of these can be told from one merely from a newer version. */
26
13
  $kind?: string;
27
- /**
28
- * Provenance, when the pack came from a library row. **Not** how it is
29
- * registered — `Registry.addShader` takes the key separately, exactly as
30
- * `Registry.addNode` does, so the same file can be registered under whatever
31
- * name a project wants and the file itself stays portable.
32
- */
14
+ /** Provenance, when the pack came from a library row. **Not** how it is registered: `Registry.addShader` takes the key separately (as `addNode` does), so the file stays portable. */
33
15
  id?: string;
34
16
  name: string;
35
17
  description?: string;
36
18
  /** The language `source` is written in; normalising a pack stamps WGSL when absent. */
37
19
  language?: ShaderLanguage;
38
- /**
39
- * The program. In WGSL, a fill defines `fn fill(in: FillIn) -> vec4f` and an
40
- * effect `fn effect(in: EffectIn) -> vec4f`, and the uniforms are the
41
- * members of `struct Params` (types, layout and all); `properties` name
42
- * those members in their `inputs`.
43
- */
20
+ /** The program. WGSL: a fill defines `fn fill(in: FillIn) -> vec4f`, an effect `fn effect(in: EffectIn) -> vec4f`; uniforms are the members of `struct Params`, which `properties` name in their `inputs`. */
44
21
  source: string;
45
22
  /** Uniform values the properties do not cover, by name. */
46
23
  uniforms?: ShaderUniformRecord;
47
24
  /** The editable values, by property id. */
48
25
  properties: Record<string, ShaderProperty>;
49
26
  }
50
- /** A shader that paints inside a shape's path. */
51
27
  export interface FillShader extends ShaderBase {
52
28
  scope: "fill";
53
- /**
54
- * The images the program samples, by name. In WGSL, `sample_texture(uv)`
55
- * samples the first; the fill that applies the pack supplies each `src`.
56
- */
29
+ /** The images the program samples, by name; WGSL `sample_texture(uv)` samples the first. The applying fill supplies each `src`. */
57
30
  textures?: readonly {
58
31
  name: string;
59
32
  description?: string;
60
33
  }[];
61
34
  }
62
- /** A shader that paints over a layer. */
63
35
  export interface EffectShader extends ShaderBase {
64
36
  scope: "effect";
65
- /**
66
- * Whether the program is meant to run on the backdrop path, where
67
- * `sample_src` reads what is beneath the node rather than its own layer.
68
- *
69
- * A fact about the **program**, which is why it lives here rather than on
70
- * the effect instance: the instance keeps `mode`, the cross-cutting field
71
- * five generic consumers read without knowing what type they hold. The
72
- * builder maps this to `mode: "backdrop"` as the default and a caller may
73
- * still override it.
74
- */
37
+ /** Whether the program runs on the backdrop path (`sample_src` reads what is beneath the node). A fact about the **program**, not the instance, which keeps the cross-cutting `mode`; the builder defaults `mode` to `"backdrop"` from this and a caller may override. */
75
38
  backdrop?: boolean;
76
39
  }
77
- /** One editable value. */
78
40
  export type ShaderProperty = KnownShaderProperty | UnknownShaderProperty;
79
41
  export type KnownShaderProperty = NumberProperty | SliderProperty | AngleProperty | HueProperty | BooleanProperty | ColorProperty | VectorProperty | PointProperty;
80
42
  interface ShaderPropertyBase {
81
- /** What a panel calls it. Falls back to the property id. */
82
43
  name?: string;
83
- /**
84
- * The uniform each of this property's components writes.
85
- *
86
- * The composite mechanism, and the reason a property is not just a uniform
87
- * under another name: one editable value may span several uniforms. A
88
- * scalar names one component, `value`; a point may name `value` for a
89
- * `float2`, or `x` and `y` for two separate floats.
90
- */
44
+ /** The uniform each of this property's components writes: one editable value may span several (a scalar names `value`; a point `value` for a `float2`, or `x` and `y` for two floats). */
91
45
  inputs: Record<string, string>;
92
46
  }
93
47
  /** A scalar, drawn as a number input. */
@@ -139,17 +93,7 @@ export interface PointProperty extends ShaderPropertyBase {
139
93
  y: number;
140
94
  };
141
95
  }
142
- /**
143
- * A property whose kind this version of the vocabulary does not name.
144
- *
145
- * Open at the edges on purpose: a pack written against a newer version should
146
- * draw the controls a host knows and say so about the rest, instead of
147
- * failing to load at all.
148
- *
149
- * An unknown property is still *resolved* — its `default` is written to its
150
- * `inputs` unchanged — so a shader whose panel a host cannot fully draw still
151
- * renders correctly.
152
- */
96
+ /** A property whose kind this vocabulary version does not name. Open at the edges on purpose: a newer pack draws the controls a host knows and says so about the rest. Its `default` is still written to its `inputs`, so the shader renders correctly. */
153
97
  export interface UnknownShaderProperty extends ShaderPropertyBase {
154
98
  kind: string;
155
99
  default?: unknown;
@@ -161,16 +105,7 @@ export declare function isKnownShaderProperty(property: ShaderProperty): propert
161
105
  export declare const MAX_SHADER_PROPERTIES = 64;
162
106
  /** Ceiling on source length, matching what a compile cache can reasonably hold. */
163
107
  export declare const MAX_SHADER_SOURCE = 64000;
164
- /**
165
- * Validate and normalise an authored pack.
166
- *
167
- * **Throws** when the pack is structurally not one — no source, no usable
168
- * scope — because there is nothing to render and a silent empty shader is a
169
- * blank frame with no explanation. **Warns and drops** an individual malformed
170
- * property, because the rest of the shader still works and a panel missing one
171
- * control is a better answer than a scene that will not build. That split is the
172
- * same one `normalizeUniforms` makes.
173
- */
108
+ /** Validates and normalises an authored pack. **Throws** when it is structurally not one (no source, no usable scope): a silent empty shader is an unexplained blank frame. **Warns and drops** a malformed property, since the rest still works (the same split as `normalizeUniforms`). */
174
109
  export declare function normalizeShaderPack(input: unknown): Shader;
175
110
  export {};
176
111
  //# sourceMappingURL=pack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;AAE/C,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC9C;AAED,kDAAkD;AAClD,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,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A2P;AAC3P,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAMD,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,QAAQ,IAAI,mBAAmB,CAE/F;AAED,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC,6RAA6R;AAC7R,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAsD1D"}
@@ -9,16 +9,7 @@ export function isKnownShaderProperty(property) {
9
9
  export const MAX_SHADER_PROPERTIES = 64;
10
10
  /** Ceiling on source length, matching what a compile cache can reasonably hold. */
11
11
  export const MAX_SHADER_SOURCE = 64_000;
12
- /**
13
- * Validate and normalise an authored pack.
14
- *
15
- * **Throws** when the pack is structurally not one — no source, no usable
16
- * scope — because there is nothing to render and a silent empty shader is a
17
- * blank frame with no explanation. **Warns and drops** an individual malformed
18
- * property, because the rest of the shader still works and a panel missing one
19
- * control is a better answer than a scene that will not build. That split is the
20
- * same one `normalizeUniforms` makes.
21
- */
12
+ /** Validates and normalises an authored pack. **Throws** when it is structurally not one (no source, no usable scope): a silent empty shader is an unexplained blank frame. **Warns and drops** a malformed property, since the rest still works (the same split as `normalizeUniforms`). */
22
13
  export function normalizeShaderPack(input) {
23
14
  if (typeof input !== "object" || input === null) {
24
15
  throw new Error("A shader pack must be an object.");
@@ -1 +1 @@
1
- {"version":3,"file":"pack.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAgLA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IACxB,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,O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,CAAC;gBAChB,MAAM;YACV,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,QAAQ;YAAE,SAAS;QAEvB,GAAG,CAAC,EAAE,CAAC,GAAG,KAAkC,CAAC;IACjD,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,6EAA6E;AAC7E,SAAS,IAAI,CAAC,OAAe;IACzB,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAChC,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import type { ShaderUniformRecord } from \"./uniforms\";\nimport type { ShaderLanguage } from \"./language\";\n\n/**\n * A **shader pack**: a program, plus what a host may edit about it.\n *\n * The interchange format for a shader — authored as JSON, imported as a value,\n * handed to `Fills.shader` or `Effects.shader`. It exists because a bare source\n * string says nothing about which of its uniforms are meant to be touched, what\n * they are called in a panel, or what range they take, so every host that wanted\n * to offer a slider had to keep that table itself, beside a program it did not\n * own.\n *\n * **Two scopes, one shape.** A fill paints inside a shape's path and may sample\n * textures; an effect paints over a layer and may sample what is beneath it.\n * Those are the only two differences, and making them arms of a union rather\n * than optional fields on one type is what makes `Fills.shader(anEffectShader)`\n * a compile error instead of a program that fails at the first frame.\n */\nexport type Shader = FillShader | EffectShader;\n\n/** What both scopes carry. */\nexport interface ShaderBase {\n /**\n * Format tag, so a file that is not one of these can be told apart from one\n * that is merely from a newer version.\n */\n $kind?: string;\n /**\n * Provenance, when the pack came from a library row. **Not** how it is\n * registered — `Registry.addShader` takes the key separately, exactly as\n * `Registry.addNode` does, so the same file can be registered under whatever\n * name a project wants and the file itself stays portable.\n */\n id?: string;\n name: string;\n description?: string;\n /** The language `source` is written in; normalising a pack stamps WGSL when absent. */\n language?: ShaderLanguage;\n /**\n * The program. In WGSL, a fill defines `fn fill(in: FillIn) -> vec4f` and an\n * effect `fn effect(in: EffectIn) -> vec4f`, and the uniforms are the\n * members of `struct Params` (types, layout and all); `properties` name\n * those members in their `inputs`.\n */\n source: string;\n /** Uniform values the properties do not cover, by name. */\n uniforms?: ShaderUniformRecord;\n /** The editable values, by property id. */\n properties: Record<string, ShaderProperty>;\n}\n\n/** A shader that paints inside a shape's path. */\nexport interface FillShader extends ShaderBase {\n scope: \"fill\";\n /**\n * The images the program samples, by name. In WGSL, `sample_texture(uv)`\n * samples the first; the fill that applies the pack supplies each `src`.\n */\n textures?: readonly { name: string; description?: string }[];\n}\n\n/** A shader that paints over a layer. */\nexport interface EffectShader extends ShaderBase {\n scope: \"effect\";\n /**\n * Whether the program is meant to run on the backdrop path, where\n * `sample_src` reads what is beneath the node rather than its own layer.\n *\n * A fact about the **program**, which is why it lives here rather than on\n * the effect instance: the instance keeps `mode`, the cross-cutting field\n * five generic consumers read without knowing what type they hold. The\n * builder maps this to `mode: \"backdrop\"` as the default and a caller may\n * still override it.\n */\n backdrop?: boolean;\n}\n\n/** One editable value. */\nexport type ShaderProperty = KnownShaderProperty | UnknownShaderProperty;\n\nexport type KnownShaderProperty =\n | NumberProperty\n | SliderProperty\n | AngleProperty\n | HueProperty\n | BooleanProperty\n | ColorProperty\n | VectorProperty\n | PointProperty;\n\ninterface ShaderPropertyBase {\n /** What a panel calls it. Falls back to the property id. */\n name?: string;\n /**\n * The uniform each of this property's components writes.\n *\n * The composite mechanism, and the reason a property is not just a uniform\n * under another name: one editable value may span several uniforms. A\n * scalar names one component, `value`; a point may name `value` for a\n * `float2`, or `x` and `y` for two separate floats.\n */\n inputs: Record<string, string>;\n}\n\n/** A scalar, drawn as a number input. */\nexport interface NumberProperty extends ShaderPropertyBase {\n kind: \"number\";\n default: number;\n min?: number;\n max?: number;\n step?: number;\n}\n\n/** A scalar with a bounded range, drawn as a slider. */\nexport interface SliderProperty extends ShaderPropertyBase {\n kind: \"slider\";\n default: number;\n min: number;\n max: number;\n step?: number;\n}\n\n/** Degrees, matching every other angle in the library. */\nexport interface AngleProperty extends ShaderPropertyBase {\n kind: \"angle\";\n default: number;\n}\n\n/** Degrees around the colour wheel. */\nexport interface HueProperty extends ShaderPropertyBase {\n kind: \"hue\";\n default: number;\n}\n\n/** Written to its uniform as 1 or 0, since a `bool` cannot be a uniform member in WGSL. */\nexport interface BooleanProperty extends ShaderPropertyBase {\n kind: \"boolean\";\n default: boolean;\n}\n\n/** RGBA in 0–1. A CSS string is accepted and parsed, so theme tokens work. */\nexport interface ColorProperty extends ShaderPropertyBase {\n kind: \"color\";\n default: string | readonly number[];\n}\n\n/** A fixed-width run of floats. */\nexport interface VectorProperty extends ShaderPropertyBase {\n kind: \"vector\";\n default: readonly number[];\n}\n\n/** Two floats, as one `float2` or as separate `x`/`y` uniforms. */\nexport interface PointProperty extends ShaderPropertyBase {\n kind: \"point\";\n default: readonly number[] | { x: number; y: number };\n}\n\n/**\n * A property whose kind this version of the vocabulary does not name.\n *\n * Open at the edges on purpose: a pack written against a newer version should\n * draw the controls a host knows and say so about the rest, instead of\n * failing to load at all.\n *\n * An unknown property is still *resolved* — its `default` is written to its\n * `inputs` unchanged — so a shader whose panel a host cannot fully draw still\n * renders correctly.\n */\nexport interface UnknownShaderProperty extends ShaderPropertyBase {\n kind: string;\n default?: unknown;\n [option: string]: unknown;\n}\n\nconst KNOWN_KINDS = new Set([\n \"number\", \"slider\", \"angle\", \"hue\", \"boolean\", \"color\", \"vector\", \"point\",\n]);\n\n/** Whether `property` is one this version knows how to draw. */\nexport function isKnownShaderProperty(property: ShaderProperty): property is KnownShaderProperty {\n return KNOWN_KINDS.has(property.kind);\n}\n\n/** Ceiling on properties in one pack, so a malformed import cannot exhaust a host. */\nexport const MAX_SHADER_PROPERTIES = 64;\n\n/** Ceiling on source length, matching what a compile cache can reasonably hold. */\nexport const MAX_SHADER_SOURCE = 64_000;\n\n/**\n * Validate and normalise an authored pack.\n *\n * **Throws** when the pack is structurally not one — no source, no usable\n * scope — because there is nothing to render and a silent empty shader is a\n * blank frame with no explanation. **Warns and drops** an individual malformed\n * property, because the rest of the shader still works and a panel missing one\n * control is a better answer than a scene that will not build. That split is the\n * same one `normalizeUniforms` makes.\n */\nexport function normalizeShaderPack(input: unknown): Shader {\n if (typeof input !== \"object\" || input === null) {\n throw new Error(\"A shader pack must be an object.\");\n }\n const raw = input as Record<string, unknown>;\n\n const scope = raw.scope;\n if (scope !== \"fill\" && scope !== \"effect\") {\n throw new Error(\n `A shader pack needs scope \"fill\" or \"effect\", got ${JSON.stringify(scope)}. ` +\n `The two are written against different contracts — a fill has no backdrop to ` +\n `sample and an effect has no shape box to map coordinates onto.`,\n );\n }\n\n const source = typeof raw.source === \"string\" ? raw.source.trim() : \"\";\n if (source === \"\") throw new Error(`Shader pack \"${String(raw.name ?? \"?\")}\" has no source.`);\n if (source.length > MAX_SHADER_SOURCE) {\n throw new Error(\n `Shader pack \"${String(raw.name ?? \"?\")}\" source is ${source.length} characters, ` +\n `over the ${MAX_SHADER_SOURCE} ceiling.`,\n );\n }\n\n if (raw.language !== undefined && raw.language !== \"wgsl\") {\n throw new Error(\n `Shader pack \"${String(raw.name ?? \"?\")}\" is written in ${JSON.stringify(raw.language)}; ` +\n `only WGSL is supported. Port it to WGSL.`,\n );\n }\n\n const base: ShaderBase = {\n ...(typeof raw.$kind === \"string\" ? { $kind: raw.$kind } : {}),\n ...(typeof raw.id === \"string\" ? { id: raw.id } : {}),\n name: typeof raw.name === \"string\" && raw.name !== \"\" ? raw.name : \"Shader\",\n ...(typeof raw.description === \"string\" ? { description: raw.description } : {}),\n language: \"wgsl\",\n source,\n ...(isRecord(raw.uniforms) ? { uniforms: raw.uniforms as ShaderUniformRecord } : {}),\n properties: normalizeProperties(raw.properties, String(raw.name ?? \"?\")),\n };\n\n if (scope === \"fill\") {\n const textures = Array.isArray(raw.textures)\n ? (raw.textures as unknown[]).filter((t): t is { name: string; description?: string } =>\n isRecord(t) && typeof t.name === \"string\").map((t) => ({ name: t.name, ...(typeof t.description === \"string\" ? { description: t.description } : {}) }))\n : [];\n return {\n ...base,\n scope: \"fill\",\n ...(textures.length ? { textures } : {}),\n };\n }\n return { ...base, scope: \"effect\", ...(raw.backdrop === true ? { backdrop: true } : {}) };\n}\n\nfunction normalizeProperties(input: unknown, where: string): Record<string, ShaderProperty> {\n if (!isRecord(input)) return {};\n const out: Record<string, ShaderProperty> = {};\n const claimed = new Map<string, string>();\n\n for (const [id, value] of Object.entries(input)) {\n if (Object.keys(out).length >= MAX_SHADER_PROPERTIES) {\n warn(`shader \"${where}\" declares more than ${MAX_SHADER_PROPERTIES} properties; the rest are ignored.`);\n break;\n }\n if (!isRecord(value) || typeof value.kind !== \"string\") {\n warn(`shader \"${where}\" property \"${id}\" has no kind; ignored.`);\n continue;\n }\n const inputs = value.inputs;\n if (!isRecord(inputs) || Object.keys(inputs).length === 0) {\n warn(`shader \"${where}\" property \"${id}\" names no uniform in \"inputs\"; ignored.`);\n continue;\n }\n let conflict = false;\n for (const uniform of Object.values(inputs)) {\n if (typeof uniform !== \"string\") {\n warn(`shader \"${where}\" property \"${id}\" has a non-string uniform name; ignored.`);\n conflict = true;\n break;\n }\n const prior = claimed.get(uniform);\n if (prior !== undefined) {\n // Two properties writing one uniform means the panel has two\n // controls for one value and whichever resolves last silently wins.\n warn(`shader \"${where}\" properties \"${prior}\" and \"${id}\" both write uniform \"${uniform}\"; \"${id}\" ignored.`);\n conflict = true;\n break;\n }\n claimed.set(uniform, id);\n }\n if (conflict) continue;\n\n out[id] = value as unknown as ShaderProperty;\n }\n return out;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nconst warned = new Set<string>();\n\n/** Warn once per message — a pack may be normalised on every scene build. */\nfunction warn(message: string): void {\n if (warned.has(message)) return;\n if (warned.size > 256) warned.clear();\n warned.add(message);\n console.warn(`[shader] ${message}`);\n}\n"]}
1
+ {"version":3,"file":"pack.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAwHA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IACxB,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;CAC5E,CAAC,CAAC;AAEH,gEAAgE;AAChE,MAAM,UAAU,qBAAqB,CAAC,QAAwB;IAC1D,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,6RAA6R;AAC7R,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACxB,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACX,qDAAqD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI;YAC9E,8EAA8E;YAC9E,gEAA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"./uniforms\";\nimport type { ShaderLanguage } from \"./language\";\n\n/**\n * A **shader pack**: a program plus what a host may edit about it, the interchange format for a shader (authored as\n * JSON, handed to `Fills.shader` or `Effects.shader`). A bare source string says nothing about which uniforms are\n * editable, their panel names or ranges. **Two scopes, one shape**: a fill paints inside a shape's path and may\n * sample textures, an effect paints over a layer and may sample what is beneath it; as union arms,\n * `Fills.shader(anEffectShader)` is a compile error instead of a first-frame failure.\n */\nexport type Shader = FillShader | EffectShader;\n\nexport interface ShaderBase {\n /** Format tag, so a file that is not one of these can be told from one merely from a newer version. */\n $kind?: string;\n /** Provenance, when the pack came from a library row. **Not** how it is registered: `Registry.addShader` takes the key separately (as `addNode` does), so the file stays portable. */\n id?: string;\n name: string;\n description?: string;\n /** The language `source` is written in; normalising a pack stamps WGSL when absent. */\n language?: ShaderLanguage;\n /** The program. WGSL: a fill defines `fn fill(in: FillIn) -> vec4f`, an effect `fn effect(in: EffectIn) -> vec4f`; uniforms are the members of `struct Params`, which `properties` name in their `inputs`. */\n source: string;\n /** Uniform values the properties do not cover, by name. */\n uniforms?: ShaderUniformRecord;\n /** The editable values, by property id. */\n properties: Record<string, ShaderProperty>;\n}\n\nexport interface FillShader extends ShaderBase {\n scope: \"fill\";\n /** The images the program samples, by name; WGSL `sample_texture(uv)` samples the first. The applying fill supplies each `src`. */\n textures?: readonly { name: string; description?: string }[];\n}\n\nexport interface EffectShader extends ShaderBase {\n scope: \"effect\";\n /** Whether the program runs on the backdrop path (`sample_src` reads what is beneath the node). A fact about the **program**, not the instance, which keeps the cross-cutting `mode`; the builder defaults `mode` to `\"backdrop\"` from this and a caller may override. */\n backdrop?: boolean;\n}\n\nexport type ShaderProperty = KnownShaderProperty | UnknownShaderProperty;\n\nexport type KnownShaderProperty =\n | NumberProperty\n | SliderProperty\n | AngleProperty\n | HueProperty\n | BooleanProperty\n | ColorProperty\n | VectorProperty\n | PointProperty;\n\ninterface ShaderPropertyBase {\n name?: string;\n /** The uniform each of this property's components writes: one editable value may span several (a scalar names `value`; a point `value` for a `float2`, or `x` and `y` for two floats). */\n inputs: Record<string, string>;\n}\n\n/** A scalar, drawn as a number input. */\nexport interface NumberProperty extends ShaderPropertyBase {\n kind: \"number\";\n default: number;\n min?: number;\n max?: number;\n step?: number;\n}\n\n/** A scalar with a bounded range, drawn as a slider. */\nexport interface SliderProperty extends ShaderPropertyBase {\n kind: \"slider\";\n default: number;\n min: number;\n max: number;\n step?: number;\n}\n\n/** Degrees, matching every other angle in the library. */\nexport interface AngleProperty extends ShaderPropertyBase {\n kind: \"angle\";\n default: number;\n}\n\n/** Degrees around the colour wheel. */\nexport interface HueProperty extends ShaderPropertyBase {\n kind: \"hue\";\n default: number;\n}\n\n/** Written to its uniform as 1 or 0, since a `bool` cannot be a uniform member in WGSL. */\nexport interface BooleanProperty extends ShaderPropertyBase {\n kind: \"boolean\";\n default: boolean;\n}\n\n/** RGBA in 0–1. A CSS string is accepted and parsed, so theme tokens work. */\nexport interface ColorProperty extends ShaderPropertyBase {\n kind: \"color\";\n default: string | readonly number[];\n}\n\n/** A fixed-width run of floats. */\nexport interface VectorProperty extends ShaderPropertyBase {\n kind: \"vector\";\n default: readonly number[];\n}\n\n/** Two floats, as one `float2` or as separate `x`/`y` uniforms. */\nexport interface PointProperty extends ShaderPropertyBase {\n kind: \"point\";\n default: readonly number[] | { x: number; y: number };\n}\n\n/** A property whose kind this vocabulary version does not name. Open at the edges on purpose: a newer pack draws the controls a host knows and says so about the rest. Its `default` is still written to its `inputs`, so the shader renders correctly. */\nexport interface UnknownShaderProperty extends ShaderPropertyBase {\n kind: string;\n default?: unknown;\n [option: string]: unknown;\n}\n\nconst KNOWN_KINDS = new Set([\n \"number\", \"slider\", \"angle\", \"hue\", \"boolean\", \"color\", \"vector\", \"point\",\n]);\n\n/** Whether `property` is one this version knows how to draw. */\nexport function isKnownShaderProperty(property: ShaderProperty): property is KnownShaderProperty {\n return KNOWN_KINDS.has(property.kind);\n}\n\n/** Ceiling on properties in one pack, so a malformed import cannot exhaust a host. */\nexport const MAX_SHADER_PROPERTIES = 64;\n\n/** Ceiling on source length, matching what a compile cache can reasonably hold. */\nexport const MAX_SHADER_SOURCE = 64_000;\n\n/** Validates and normalises an authored pack. **Throws** when it is structurally not one (no source, no usable scope): a silent empty shader is an unexplained blank frame. **Warns and drops** a malformed property, since the rest still works (the same split as `normalizeUniforms`). */\nexport function normalizeShaderPack(input: unknown): Shader {\n if (typeof input !== \"object\" || input === null) {\n throw new Error(\"A shader pack must be an object.\");\n }\n const raw = input as Record<string, unknown>;\n\n const scope = raw.scope;\n if (scope !== \"fill\" && scope !== \"effect\") {\n throw new Error(\n `A shader pack needs scope \"fill\" or \"effect\", got ${JSON.stringify(scope)}. ` +\n `The two are written against different contracts — a fill has no backdrop to ` +\n `sample and an effect has no shape box to map coordinates onto.`,\n );\n }\n\n const source = typeof raw.source === \"string\" ? raw.source.trim() : \"\";\n if (source === \"\") throw new Error(`Shader pack \"${String(raw.name ?? \"?\")}\" has no source.`);\n if (source.length > MAX_SHADER_SOURCE) {\n throw new Error(\n `Shader pack \"${String(raw.name ?? \"?\")}\" source is ${source.length} characters, ` +\n `over the ${MAX_SHADER_SOURCE} ceiling.`,\n );\n }\n\n if (raw.language !== undefined && raw.language !== \"wgsl\") {\n throw new Error(\n `Shader pack \"${String(raw.name ?? \"?\")}\" is written in ${JSON.stringify(raw.language)}; ` +\n `only WGSL is supported. Port it to WGSL.`,\n );\n }\n\n const base: ShaderBase = {\n ...(typeof raw.$kind === \"string\" ? { $kind: raw.$kind } : {}),\n ...(typeof raw.id === \"string\" ? { id: raw.id } : {}),\n name: typeof raw.name === \"string\" && raw.name !== \"\" ? raw.name : \"Shader\",\n ...(typeof raw.description === \"string\" ? { description: raw.description } : {}),\n language: \"wgsl\",\n source,\n ...(isRecord(raw.uniforms) ? { uniforms: raw.uniforms as ShaderUniformRecord } : {}),\n properties: normalizeProperties(raw.properties, String(raw.name ?? \"?\")),\n };\n\n if (scope === \"fill\") {\n const textures = Array.isArray(raw.textures)\n ? (raw.textures as unknown[]).filter((t): t is { name: string; description?: string } =>\n isRecord(t) && typeof t.name === \"string\").map((t) => ({ name: t.name, ...(typeof t.description === \"string\" ? { description: t.description } : {}) }))\n : [];\n return {\n ...base,\n scope: \"fill\",\n ...(textures.length ? { textures } : {}),\n };\n }\n return { ...base, scope: \"effect\", ...(raw.backdrop === true ? { backdrop: true } : {}) };\n}\n\nfunction normalizeProperties(input: unknown, where: string): Record<string, ShaderProperty> {\n if (!isRecord(input)) return {};\n const out: Record<string, ShaderProperty> = {};\n const claimed = new Map<string, string>();\n\n for (const [id, value] of Object.entries(input)) {\n if (Object.keys(out).length >= MAX_SHADER_PROPERTIES) {\n warn(`shader \"${where}\" declares more than ${MAX_SHADER_PROPERTIES} properties; the rest are ignored.`);\n break;\n }\n if (!isRecord(value) || typeof value.kind !== \"string\") {\n warn(`shader \"${where}\" property \"${id}\" has no kind; ignored.`);\n continue;\n }\n const inputs = value.inputs;\n if (!isRecord(inputs) || Object.keys(inputs).length === 0) {\n warn(`shader \"${where}\" property \"${id}\" names no uniform in \"inputs\"; ignored.`);\n continue;\n }\n let conflict = false;\n for (const uniform of Object.values(inputs)) {\n if (typeof uniform !== \"string\") {\n warn(`shader \"${where}\" property \"${id}\" has a non-string uniform name; ignored.`);\n conflict = true;\n break;\n }\n const prior = claimed.get(uniform);\n if (prior !== undefined) {\n // Two properties writing one uniform means the panel has two\n // controls for one value and whichever resolves last silently wins.\n warn(`shader \"${where}\" properties \"${prior}\" and \"${id}\" both write uniform \"${uniform}\"; \"${id}\" ignored.`);\n conflict = true;\n break;\n }\n claimed.set(uniform, id);\n }\n if (conflict) continue;\n\n out[id] = value as unknown as ShaderProperty;\n }\n return out;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nconst warned = new Set<string>();\n\n/** Warn once per message — a pack may be normalised on every scene build. */\nfunction warn(message: string): void {\n if (warned.has(message)) return;\n if (warned.size > 256) warned.clear();\n warned.add(message);\n console.warn(`[shader] ${message}`);\n}\n"]}
@@ -2,16 +2,6 @@ import type { ShaderUniformRecord } from "./uniforms.js";
2
2
  import type { Shader } from "./pack.js";
3
3
  /** Overrides for a pack's properties, by property id. */
4
4
  export type ShaderPropertyValues = Record<string, unknown>;
5
- /**
6
- * Turn a pack's properties, plus any overrides, into the uniform record the
7
- * renderer writes.
8
- *
9
- * This is the whole job of a property: it is an *editable* value, and a uniform
10
- * is where that value has to end up. One property may feed several uniforms —
11
- * see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.
12
- *
13
- * The pack's own `uniforms` are merged in first and the properties win: the
14
- * more specific statement of the same value takes it.
15
- */
5
+ /** Turns a pack's properties, plus overrides, into the uniform record the renderer writes. One property may feed several uniforms (see `ShaderPropertyBase.inputs`), so this is not a rename. The pack's own `uniforms` merge in first and properties win: the more specific statement of a value takes it. */
16
6
  export declare function resolveShaderProperties(pack: Shader, overrides?: ShaderPropertyValues): ShaderUniformRecord;
17
7
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAErD,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAM3D;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,oBAAoB,GACjC,mBAAmB,CAyBrB"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAErD,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAM3D,+SAA+S;AAC/S,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,oBAAoB,GACjC,mBAAmB,CAyBrB"}
@@ -2,17 +2,7 @@ import { parseColor } from "../fill/color/parser.js";
2
2
  /** Component names a multi-part property may map, in the order they index. */
3
3
  const COMPONENTS = ["x", "y", "z", "w"];
4
4
  const COLOR_COMPONENTS = ["r", "g", "b", "a"];
5
- /**
6
- * Turn a pack's properties, plus any overrides, into the uniform record the
7
- * renderer writes.
8
- *
9
- * This is the whole job of a property: it is an *editable* value, and a uniform
10
- * is where that value has to end up. One property may feed several uniforms —
11
- * see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.
12
- *
13
- * The pack's own `uniforms` are merged in first and the properties win: the
14
- * more specific statement of the same value takes it.
15
- */
5
+ /** Turns a pack's properties, plus overrides, into the uniform record the renderer writes. One property may feed several uniforms (see `ShaderPropertyBase.inputs`), so this is not a rename. The pack's own `uniforms` merge in first and properties win: the more specific statement of a value takes it. */
16
6
  export function resolveShaderProperties(pack, overrides) {
17
7
  const out = { ...(pack.uniforms ?? {}) };
18
8
  for (const [id, property] of Object.entries(pack.properties)) {
@@ -38,14 +28,7 @@ export function resolveShaderProperties(pack, overrides) {
38
28
  }
39
29
  return out;
40
30
  }
41
- /**
42
- * Split one property's value across the components its `inputs` name.
43
- *
44
- * A property naming only `value` passes its whole value through, which is the
45
- * common case and the reason a scalar needs no ceremony. One naming `x`/`y` (or
46
- * `r`/`g`/`b`/`a`) indexes into the value, which is what lets a `point` drive two
47
- * separate `float` uniforms in a source that never declared a `float2`.
48
- */
31
+ /** Splits one property's value across the components its `inputs` name. A property naming only `value` passes its whole value through; one naming `x`/`y` (or `r`/`g`/`b`/`a`) indexes into it, so a `point` can drive two separate `float` uniforms. */
49
32
  function componentsOf(property, value, id, where) {
50
33
  const flat = toUniformValue(property, value, id, where);
51
34
  if (flat === undefined)
@@ -65,7 +48,6 @@ function componentsOf(property, value, id, where) {
65
48
  }
66
49
  return out;
67
50
  }
68
- /** One property's value as floats, by its kind. */
69
51
  function toUniformValue(property, value, id, where) {
70
52
  switch (property.kind) {
71
53
  case "number":
@@ -95,14 +77,7 @@ function asFinite(value, id, where) {
95
77
  warn(`shader "${where}" property "${id}" expects a number, got ${JSON.stringify(value)}.`);
96
78
  return undefined;
97
79
  }
98
- /**
99
- * A colour as four floats in 0–1.
100
- *
101
- * A CSS string is parsed rather than refused, so a theme token, an `oklch()` and
102
- * the `"white/10"` opacity suffix all reach a shader — `parseColor` is the one
103
- * place any of those are understood, and a shader pack has no reason to be the
104
- * exception.
105
- */
80
+ /** A colour as four floats in 0–1. A CSS string is parsed (via `parseColor`, the one place those are understood), so theme tokens, `oklch()` and `"white/10"` all reach a shader. */
106
81
  function asColor(value, id, where) {
107
82
  if (typeof value === "string") {
108
83
  const [r, g, b, a] = parseColor(value);
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD,8EAA8E;AAC9E,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AACjD,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CACnC,IAAY,EACZ,SAAgC;IAEhC,MAAM,GAAG,GAAwB,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC;IAE9D,KAAK,MAA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,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1F,OAAO,KAAiB,CAAC;IAC7B,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAqC,CAAC;QACpD,IAAI,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IACD,IAAI,CAAC,WAAW,KAAK,eAAe,EAAE,0BAA0B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1F,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,SAAS,IAAI,CAAC,OAAe;IACzB,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAChC,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import { parseColor } from \"../fill/color/parser\";\nimport type { ShaderUniformRecord, ShaderUniformValue } from \"./uniforms\";\nimport type { Shader, ShaderProperty } from \"./pack\";\n\n/** Overrides for a pack's properties, by property id. */\nexport type ShaderPropertyValues = Record<string, unknown>;\n\n/** Component names a multi-part property may map, in the order they index. */\nconst COMPONENTS = [\"x\", \"y\", \"z\", \"w\"] as const;\nconst COLOR_COMPONENTS = [\"r\", \"g\", \"b\", \"a\"] as const;\n\n/**\n * Turn a pack's properties, plus any overrides, into the uniform record the\n * renderer writes.\n *\n * This is the whole job of a property: it is an *editable* value, and a uniform\n * is where that value has to end up. One property may feed several uniforms —\n * see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.\n *\n * The pack's own `uniforms` are merged in first and the properties win: the\n * more specific statement of the same value takes it.\n */\nexport function resolveShaderProperties(\n pack: Shader,\n overrides?: ShaderPropertyValues,\n): ShaderUniformRecord {\n const out: ShaderUniformRecord = { ...(pack.uniforms ?? {}) };\n\n for (const [id, property] of Object.entries(pack.properties)) {\n const supplied = overrides && id in overrides ? overrides[id] : property.default;\n const parts = componentsOf(property, supplied, id, pack.name);\n if (!parts) continue;\n for (const [component, uniform] of Object.entries(property.inputs)) {\n const value = parts[component];\n if (value === undefined) {\n warn(`shader \"${pack.name}\" property \"${id}\" has no \"${component}\" to write to \"${uniform}\".`);\n continue;\n }\n out[uniform] = value;\n }\n }\n\n if (overrides) {\n for (const id of Object.keys(overrides)) {\n if (id in pack.properties) continue;\n warn(`shader \"${pack.name}\" has no property \"${id}\"; the override is ignored.`);\n }\n }\n\n return out;\n}\n\n/**\n * Split one property's value across the components its `inputs` name.\n *\n * A property naming only `value` passes its whole value through, which is the\n * common case and the reason a scalar needs no ceremony. One naming `x`/`y` (or\n * `r`/`g`/`b`/`a`) indexes into the value, which is what lets a `point` drive two\n * separate `float` uniforms in a source that never declared a `float2`.\n */\nfunction componentsOf(\n property: ShaderProperty,\n value: unknown,\n id: string,\n where: string,\n): Record<string, ShaderUniformValue> | undefined {\n const flat = toUniformValue(property, value, id, where);\n if (flat === undefined) return undefined;\n\n const names = Object.keys(property.inputs);\n if (names.length === 1 && names[0] === \"value\") return { value: flat };\n\n const parts = typeof flat === \"number\" ? [flat] : flat;\n const out: Record<string, ShaderUniformValue> = { value: flat };\n for (const [index, name] of COMPONENTS.entries()) {\n if (parts[index] !== undefined) out[name] = parts[index];\n }\n for (const [index, name] of COLOR_COMPONENTS.entries()) {\n if (parts[index] !== undefined) out[name] = parts[index];\n }\n return out;\n}\n\n/** One property's value as floats, by its kind. */\nfunction toUniformValue(\n property: ShaderProperty,\n value: unknown,\n id: string,\n where: string,\n): ShaderUniformValue | undefined {\n switch (property.kind) {\n case \"number\":\n case \"slider\":\n case \"angle\":\n case \"hue\":\n return asFinite(value, id, where);\n\n // A `bool` cannot be a uniform member in WGSL; a float of 1 or 0 is what a shader can branch on.\n case \"boolean\":\n return value ? 1 : 0;\n\n case \"color\":\n return asColor(value, id, where);\n\n case \"vector\":\n case \"point\":\n return asFloats(value, id, where);\n\n // An unknown kind still resolves: its value reaches its uniforms\n // untouched, so a shader a host cannot fully draw still renders.\n default:\n return typeof value === \"number\" || Array.isArray(value)\n ? (value as ShaderUniformValue)\n : undefined;\n }\n}\n\nfunction asFinite(value: unknown, id: string, where: string): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value)) return value;\n warn(`shader \"${where}\" property \"${id}\" expects a number, got ${JSON.stringify(value)}.`);\n return undefined;\n}\n\n/**\n * A colour as four floats in 0–1.\n *\n * A CSS string is parsed rather than refused, so a theme token, an `oklch()` and\n * the `\"white/10\"` opacity suffix all reach a shader — `parseColor` is the one\n * place any of those are understood, and a shader pack has no reason to be the\n * exception.\n */\nfunction asColor(value: unknown, id: string, where: string): number[] | undefined {\n if (typeof value === \"string\") {\n const [r, g, b, a] = parseColor(value);\n return [r, g, b, a];\n }\n return asFloats(value, id, where);\n}\n\nfunction asFloats(value: unknown, id: string, where: string): number[] | undefined {\n if (Array.isArray(value) && value.every((v) => typeof v === \"number\" && Number.isFinite(v))) {\n return value as number[];\n }\n if (typeof value === \"object\" && value !== null) {\n const point = value as { x?: unknown; y?: unknown };\n if (typeof point.x === \"number\" && typeof point.y === \"number\") return [point.x, point.y];\n }\n warn(`shader \"${where}\" property \"${id}\" expects numbers, got ${JSON.stringify(value)}.`);\n return undefined;\n}\n\nconst warned = new Set<string>();\n\nfunction warn(message: string): void {\n if (warned.has(message)) return;\n if (warned.size > 256) warned.clear();\n warned.add(message);\n console.warn(`[shader] ${message}`);\n}\n"]}
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD,8EAA8E;AAC9E,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AACjD,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAEvD,+SAA+S;AAC/S,MAAM,UAAU,uBAAuB,CACnC,IAAY,EACZ,SAAgC;IAEhC,MAAM,GAAG,GAAwB,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC;IAE9D,KAAK,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,MAAM,QAAQ,GAAG,SAAS,IAAI,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;QACjF,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACjE,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,IAAI,CAAC,WA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,CAAC;AACrB,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,SAAS,IAAI,CAAC,OAAe;IACzB,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAChC,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import { parseColor } from \"../fill/color/parser\";\nimport type { ShaderUniformRecord, ShaderUniformValue } from \"./uniforms\";\nimport type { Shader, ShaderProperty } from \"./pack\";\n\n/** Overrides for a pack's properties, by property id. */\nexport type ShaderPropertyValues = Record<string, unknown>;\n\n/** Component names a multi-part property may map, in the order they index. */\nconst COMPONENTS = [\"x\", \"y\", \"z\", \"w\"] as const;\nconst COLOR_COMPONENTS = [\"r\", \"g\", \"b\", \"a\"] as const;\n\n/** Turns a pack's properties, plus overrides, into the uniform record the renderer writes. One property may feed several uniforms (see `ShaderPropertyBase.inputs`), so this is not a rename. The pack's own `uniforms` merge in first and properties win: the more specific statement of a value takes it. */\nexport function resolveShaderProperties(\n pack: Shader,\n overrides?: ShaderPropertyValues,\n): ShaderUniformRecord {\n const out: ShaderUniformRecord = { ...(pack.uniforms ?? {}) };\n\n for (const [id, property] of Object.entries(pack.properties)) {\n const supplied = overrides && id in overrides ? overrides[id] : property.default;\n const parts = componentsOf(property, supplied, id, pack.name);\n if (!parts) continue;\n for (const [component, uniform] of Object.entries(property.inputs)) {\n const value = parts[component];\n if (value === undefined) {\n warn(`shader \"${pack.name}\" property \"${id}\" has no \"${component}\" to write to \"${uniform}\".`);\n continue;\n }\n out[uniform] = value;\n }\n }\n\n if (overrides) {\n for (const id of Object.keys(overrides)) {\n if (id in pack.properties) continue;\n warn(`shader \"${pack.name}\" has no property \"${id}\"; the override is ignored.`);\n }\n }\n\n return out;\n}\n\n/** Splits one property's value across the components its `inputs` name. A property naming only `value` passes its whole value through; one naming `x`/`y` (or `r`/`g`/`b`/`a`) indexes into it, so a `point` can drive two separate `float` uniforms. */\nfunction componentsOf(\n property: ShaderProperty,\n value: unknown,\n id: string,\n where: string,\n): Record<string, ShaderUniformValue> | undefined {\n const flat = toUniformValue(property, value, id, where);\n if (flat === undefined) return undefined;\n\n const names = Object.keys(property.inputs);\n if (names.length === 1 && names[0] === \"value\") return { value: flat };\n\n const parts = typeof flat === \"number\" ? [flat] : flat;\n const out: Record<string, ShaderUniformValue> = { value: flat };\n for (const [index, name] of COMPONENTS.entries()) {\n if (parts[index] !== undefined) out[name] = parts[index];\n }\n for (const [index, name] of COLOR_COMPONENTS.entries()) {\n if (parts[index] !== undefined) out[name] = parts[index];\n }\n return out;\n}\n\nfunction toUniformValue(\n property: ShaderProperty,\n value: unknown,\n id: string,\n where: string,\n): ShaderUniformValue | undefined {\n switch (property.kind) {\n case \"number\":\n case \"slider\":\n case \"angle\":\n case \"hue\":\n return asFinite(value, id, where);\n\n // A `bool` cannot be a uniform member in WGSL; a float of 1 or 0 is what a shader can branch on.\n case \"boolean\":\n return value ? 1 : 0;\n\n case \"color\":\n return asColor(value, id, where);\n\n case \"vector\":\n case \"point\":\n return asFloats(value, id, where);\n\n // An unknown kind still resolves: its value reaches its uniforms\n // untouched, so a shader a host cannot fully draw still renders.\n default:\n return typeof value === \"number\" || Array.isArray(value)\n ? (value as ShaderUniformValue)\n : undefined;\n }\n}\n\nfunction asFinite(value: unknown, id: string, where: string): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value)) return value;\n warn(`shader \"${where}\" property \"${id}\" expects a number, got ${JSON.stringify(value)}.`);\n return undefined;\n}\n\n/** A colour as four floats in 0–1. A CSS string is parsed (via `parseColor`, the one place those are understood), so theme tokens, `oklch()` and `\"white/10\"` all reach a shader. */\nfunction asColor(value: unknown, id: string, where: string): number[] | undefined {\n if (typeof value === \"string\") {\n const [r, g, b, a] = parseColor(value);\n return [r, g, b, a];\n }\n return asFloats(value, id, where);\n}\n\nfunction asFloats(value: unknown, id: string, where: string): number[] | undefined {\n if (Array.isArray(value) && value.every((v) => typeof v === \"number\" && Number.isFinite(v))) {\n return value as number[];\n }\n if (typeof value === \"object\" && value !== null) {\n const point = value as { x?: unknown; y?: unknown };\n if (typeof point.x === \"number\" && typeof point.y === \"number\") return [point.x, point.y];\n }\n warn(`shader \"${where}\" property \"${id}\" expects numbers, got ${JSON.stringify(value)}.`);\n return undefined;\n}\n\nconst warned = new Set<string>();\n\nfunction warn(message: string): void {\n if (warned.has(message)) return;\n if (warned.size > 256) warned.clear();\n warned.add(message);\n console.warn(`[shader] ${message}`);\n}\n"]}
@@ -1,9 +1,4 @@
1
- /**
2
- * Uniform values shared by the `shader` fill and the `shader` effect: the
3
- * authoring shapes, their canonical record, and how two records interpolate
4
- * and compare. The renderer binds the record to the program's `struct Params`
5
- * by name.
6
- */
1
+ /** Uniform values shared by the `shader` fill and effect: authoring shapes, their canonical record, and how records interpolate and compare. The renderer binds the record to `struct Params` by name. */
7
2
  /** A single uniform value: a float, or a flat array for a vector/matrix/array uniform. */
8
3
  export type ShaderUniformValue = number | number[];
9
4
  /** A named uniform, in the positional `[{name, value}]` form older shader effects were written with. */
@@ -13,28 +8,12 @@ export interface ShaderUniform {
13
8
  }
14
9
  /** Uniform values keyed by the name they are declared under in the shader. */
15
10
  export type ShaderUniformRecord = Record<string, ShaderUniformValue>;
16
- /**
17
- * Normalise either authoring shape to a canonical record.
18
- *
19
- * Accepts the record form and the positional `[{name, value}]` array older
20
- * shader effects were written with. Keys are **sorted**, which makes the resolved fill canonical: two
21
- * authors writing the same uniforms in a different order produce the same object,
22
- * so `equals` and any structural diff agree with the renderer (which reads by
23
- * name and never sees the order at all).
24
- */
11
+ /** Normalises either authoring shape (the record, or the positional `[{name, value}]` array older shader effects used) to a canonical record. Keys are **sorted**, so authors writing the same uniforms in different order produce the same object and `equals` agrees with the renderer (which reads by name). */
25
12
  export declare function normalizeUniforms(input: ShaderUniformRecord | readonly ShaderUniform[] | undefined): ShaderUniformRecord;
26
13
  /** Component-wise lerp. Mismatched shapes snap, since there is no in-between arity. */
27
14
  export declare function lerpUniformValue(a: ShaderUniformValue, b: ShaderUniformValue, t: number): ShaderUniformValue;
28
15
  export declare function uniformValuesEqual(a: ShaderUniformValue, b: ShaderUniformValue): boolean;
29
- /**
30
- * Interpolate two uniform records over the **union** of their keys.
31
- *
32
- * A key present on one side only holds at the value it has rather than
33
- * interpolating from zero: the shader still declares it, so dropping it would
34
- * write zeros mid-tween and read as the uniform snapping to black/none. This is
35
- * also what makes the self-pair `lerpFillArray` builds for an unmatched fill
36
- * layer a no-op on the uniforms.
37
- */
16
+ /** Interpolates two uniform records over the **union** of their keys. A key on one side only holds its value instead of interpolating from zero (the shader still declares it; zero would read as snapping to black), which also makes the self-pair `lerpFillArray` builds for an unmatched layer a no-op. */
38
17
  export declare function lerpUniformRecord(a: ShaderUniformRecord, b: ShaderUniformRecord, t: number): ShaderUniformRecord;
39
18
  /** Compare by key *set*, not insertion order. */
40
19
  export declare function uniformRecordsEqual(a: ShaderUniformRecord, b: ShaderUniformRecord): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/uniforms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,0FAA0F;AAC1F,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEnD,wGAAwG;AACxG,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,kBAAkB,CAAC;CAC7B;AAED,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAsDrE;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,mBA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;IAC9E,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,KAAK,KAAK,SAAS,IAAI,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/**\n * Uniform values shared by the `shader` fill and the `shader` effect: the\n * authoring shapes, their canonical record, and how two records interpolate\n * and compare. The renderer binds the record to the program's `struct Params`\n * by name.\n */\n\nimport { lerpNumber } from '@/tween/lerp';\n\n/** A single uniform value: a float, or a flat array for a vector/matrix/array uniform. */\nexport type ShaderUniformValue = number | number[];\n\n/** A named uniform, in the positional `[{name, value}]` form older shader effects were written with. */\nexport interface ShaderUniform {\n name: string;\n value: ShaderUniformValue;\n}\n\n/** Uniform values keyed by the name they are declared under in the shader. */\nexport type ShaderUniformRecord = Record<string, ShaderUniformValue>;\n\n// ---------------------------------------------------------------------------\n// Diagnostics\n// ---------------------------------------------------------------------------\n\n/**\n * Warnings already emitted, keyed by scope + message.\n *\n * Normalising runs on every resolve, so an unguarded warn is thousands of\n * identical lines in an export. Cleared past a ceiling so a pathological scene\n * can't grow this without bound.\n */\nconst warned = new Set<string>();\n\nfunction warnOnce(scope: string, message: string): void {\n const key = `${scope}\u0000${message}`;\n if (warned.has(key)) return;\n if (warned.size > 512) warned.clear();\n warned.add(key);\n console.warn(`[shader] ${message}`);\n}\n\n// ---------------------------------------------------------------------------\n// Authoring shapes → canonical record\n// ---------------------------------------------------------------------------\n\n/** Flatten a value to the float list it contributes, or null if it isn't numeric. */\nfunction flattenValue(name: string, value: unknown): ShaderUniformValue | null {\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n warnOnce('normalize', `uniform \"${name}\" is ${value}; ignoring it.`);\n return null;\n }\n return value;\n }\n if (!Array.isArray(value)) {\n warnOnce('normalize', `uniform \"${name}\" is not a number or number array; ignoring it.`);\n return null;\n }\n // `[[r,g,b,a], …]` is how an author naturally writes a colour array uniform,\n // and the renderer takes the whole thing as one flat float run either way.\n const flat = (value as unknown[]).flat(Infinity) as unknown[];\n const out: number[] = [];\n for (const entry of flat) {\n if (typeof entry !== 'number' || !Number.isFinite(entry)) {\n warnOnce('normalize', `uniform \"${name}\" contains a non-finite entry; ignoring it.`);\n return null;\n }\n out.push(entry);\n }\n return out;\n}\n\n/**\n * Normalise either authoring shape to a canonical record.\n *\n * Accepts the record form and the positional `[{name, value}]` array older\n * shader effects were written with. Keys are **sorted**, which makes the resolved fill canonical: two\n * authors writing the same uniforms in a different order produce the same object,\n * so `equals` and any structural diff agree with the renderer (which reads by\n * name and never sees the order at all).\n */\nexport function normalizeUniforms(\n input: ShaderUniformRecord | readonly ShaderUniform[] | undefined,\n): ShaderUniformRecord {\n if (!input) return {};\n const pairs: Array<[string, unknown]> = Array.isArray(input)\n ? (input as readonly ShaderUniform[]).map((u) => [u.name, u.value])\n : Object.entries(input as ShaderUniformRecord);\n\n const out: ShaderUniformRecord = {};\n for (const [name, value] of pairs.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))) {\n const flat = flattenValue(name, value);\n if (flat !== null) out[name] = flat;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Interpolation and equality\n// ---------------------------------------------------------------------------\n\n/** Component-wise lerp. Mismatched shapes snap, since there is no in-between arity. */\nexport function lerpUniformValue(a: ShaderUniformValue, b: ShaderUniformValue, t: number): ShaderUniformValue {\n if (typeof a === 'number' && typeof b === 'number') return lerpNumber(a, b, t);\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length);\n return Array.from({ length: len }, (_, i) => lerpNumber(a[i] ?? 0, b[i] ?? 0, t));\n }\n return t < 0.5 ? a : b;\n}\n\nexport function uniformValuesEqual(a: ShaderUniformValue, b: ShaderUniformValue): boolean {\n if (typeof a === 'number' && typeof b === 'number') return a === b;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n return false;\n}\n\n/**\n * Interpolate two uniform records over the **union** of their keys.\n *\n * A key present on one side only holds at the value it has rather than\n * interpolating from zero: the shader still declares it, so dropping it would\n * write zeros mid-tween and read as the uniform snapping to black/none. This is\n * also what makes the self-pair `lerpFillArray` builds for an unmatched fill\n * layer a no-op on the uniforms.\n */\nexport function lerpUniformRecord(\n a: ShaderUniformRecord,\n b: ShaderUniformRecord,\n t: number,\n): ShaderUniformRecord {\n const out: ShaderUniformRecord = {};\n for (const name of [...Object.keys(a), ...Object.keys(b)].sort()) {\n if (name in out) continue;\n const from = a[name];\n const to = b[name];\n if (from === undefined) out[name] = to;\n else if (to === undefined) out[name] = from;\n else out[name] = lerpUniformValue(from, to, t);\n }\n return out;\n}\n\n/** Compare by key *set*, not insertion order. */\nexport function uniformRecordsEqual(a: ShaderUniformRecord, b: ShaderUniformRecord): boolean {\n const aKeys = Object.keys(a);\n if (aKeys.length !== Object.keys(b).length) return false;\n return aKeys.every((name) => {\n const other = b[name];\n return other !== undefined && uniformValuesEqual(a[name], other);\n });\n}\n"]}
1
+ {"version":3,"file":"uniforms.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/uniforms.ts"],"names":[],"mappings":"AAAA,0MAA0M;AAE1M,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc1C,wMAAwM;AACxM,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,SAAS,QAAQ,CAAC,KAAa,EAAE,OAAe;IAC5C,MAAM,GAAG,GAAG,GAAG,KAAK,IAAI,OAAO,EAAE,CAAC;IAClC,IAAI,MAAM,CAAC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C,IAAI,CAAC,CAAC;QACrB,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACnB,IAAI,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;aAClC,IAAI,EAAE,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;;YACvC,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,mBAAmB,CAAC,CAAsB,EAAE,CAAsB;IAC9E,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,KAAK,KAAK,SAAS,IAAI,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/** Uniform values shared by the `shader` fill and effect: authoring shapes, their canonical record, and how records interpolate and compare. The renderer binds the record to `struct Params` by name. */\n\nimport { lerpNumber } from '@/tween/lerp';\n\n/** A single uniform value: a float, or a flat array for a vector/matrix/array uniform. */\nexport type ShaderUniformValue = number | number[];\n\n/** A named uniform, in the positional `[{name, value}]` form older shader effects were written with. */\nexport interface ShaderUniform {\n name: string;\n value: ShaderUniformValue;\n}\n\n/** Uniform values keyed by the name they are declared under in the shader. */\nexport type ShaderUniformRecord = Record<string, ShaderUniformValue>;\n\n/** Warnings already emitted, keyed by scope + message: normalising runs on every resolve, so an unguarded warn is thousands of identical lines in an export. Cleared past a ceiling to stay bounded. */\nconst warned = new Set<string>();\n\nfunction warnOnce(scope: string, message: string): void {\n const key = `${scope}\u0000${message}`;\n if (warned.has(key)) return;\n if (warned.size > 512) warned.clear();\n warned.add(key);\n console.warn(`[shader] ${message}`);\n}\n\n/** Flatten a value to the float list it contributes, or null if it isn't numeric. */\nfunction flattenValue(name: string, value: unknown): ShaderUniformValue | null {\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n warnOnce('normalize', `uniform \"${name}\" is ${value}; ignoring it.`);\n return null;\n }\n return value;\n }\n if (!Array.isArray(value)) {\n warnOnce('normalize', `uniform \"${name}\" is not a number or number array; ignoring it.`);\n return null;\n }\n // `[[r,g,b,a], …]` is how an author naturally writes a colour array uniform,\n // and the renderer takes the whole thing as one flat float run either way.\n const flat = (value as unknown[]).flat(Infinity) as unknown[];\n const out: number[] = [];\n for (const entry of flat) {\n if (typeof entry !== 'number' || !Number.isFinite(entry)) {\n warnOnce('normalize', `uniform \"${name}\" contains a non-finite entry; ignoring it.`);\n return null;\n }\n out.push(entry);\n }\n return out;\n}\n\n/** Normalises either authoring shape (the record, or the positional `[{name, value}]` array older shader effects used) to a canonical record. Keys are **sorted**, so authors writing the same uniforms in different order produce the same object and `equals` agrees with the renderer (which reads by name). */\nexport function normalizeUniforms(\n input: ShaderUniformRecord | readonly ShaderUniform[] | undefined,\n): ShaderUniformRecord {\n if (!input) return {};\n const pairs: Array<[string, unknown]> = Array.isArray(input)\n ? (input as readonly ShaderUniform[]).map((u) => [u.name, u.value])\n : Object.entries(input as ShaderUniformRecord);\n\n const out: ShaderUniformRecord = {};\n for (const [name, value] of pairs.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))) {\n const flat = flattenValue(name, value);\n if (flat !== null) out[name] = flat;\n }\n return out;\n}\n\n/** Component-wise lerp. Mismatched shapes snap, since there is no in-between arity. */\nexport function lerpUniformValue(a: ShaderUniformValue, b: ShaderUniformValue, t: number): ShaderUniformValue {\n if (typeof a === 'number' && typeof b === 'number') return lerpNumber(a, b, t);\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length);\n return Array.from({ length: len }, (_, i) => lerpNumber(a[i] ?? 0, b[i] ?? 0, t));\n }\n return t < 0.5 ? a : b;\n}\n\nexport function uniformValuesEqual(a: ShaderUniformValue, b: ShaderUniformValue): boolean {\n if (typeof a === 'number' && typeof b === 'number') return a === b;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n return false;\n}\n\n/** Interpolates two uniform records over the **union** of their keys. A key on one side only holds its value instead of interpolating from zero (the shader still declares it; zero would read as snapping to black), which also makes the self-pair `lerpFillArray` builds for an unmatched layer a no-op. */\nexport function lerpUniformRecord(\n a: ShaderUniformRecord,\n b: ShaderUniformRecord,\n t: number,\n): ShaderUniformRecord {\n const out: ShaderUniformRecord = {};\n for (const name of [...Object.keys(a), ...Object.keys(b)].sort()) {\n if (name in out) continue;\n const from = a[name];\n const to = b[name];\n if (from === undefined) out[name] = to;\n else if (to === undefined) out[name] = from;\n else out[name] = lerpUniformValue(from, to, t);\n }\n return out;\n}\n\n/** Compare by key *set*, not insertion order. */\nexport function uniformRecordsEqual(a: ShaderUniformRecord, b: ShaderUniformRecord): boolean {\n const aKeys = Object.keys(a);\n if (aKeys.length !== Object.keys(b).length) return false;\n return aKeys.every((name) => {\n const other = b[name];\n return other !== undefined && uniformValuesEqual(a[name], other);\n });\n}\n"]}
@@ -10,38 +10,21 @@ export interface ShadowProp {
10
10
  fill?: Fill;
11
11
  /** When true, the shadow is cast inward (inset) instead of as a drop shadow. Defaults to false. */
12
12
  inner?: boolean;
13
- /**
14
- * Grows (positive) or shrinks (negative) the shadow's silhouette before it
15
- * is offset and blurred, like CSS `box-shadow` spread. Only honoured for
16
- * ellipses and rectangles, whose geometry can be resized cleanly; ignored
17
- * for other shapes. Defaults to 0.
18
- */
13
+ /** Grows (positive) or shrinks (negative) the silhouette before offset and blur, like CSS `box-shadow` spread. Only honoured for ellipses and rectangles, whose geometry resizes cleanly. Defaults to 0. */
19
14
  spread?: number;
20
15
  }
21
- /**
22
- * Fully resolved shadow — all fields normalised with defaults applied.
23
- * Compatible with the lerp registry (IFill is used for fill to avoid
24
- * breaking the existing lerp/registry pipeline).
25
- */
16
+ /** Fully resolved shadow: all fields normalised, defaults applied. */
26
17
  export interface ShadowResolved {
27
18
  blur: number;
28
- /** Offset of the shadow from the shape, in px. */
29
19
  offset?: Vector2;
30
- /** Resolved fill layers, painted bottom-to-top like a node's `fill`. */
31
20
  fill: FillResolved[];
32
21
  /** When true, the shadow is cast inward (inset) instead of as a drop shadow. */
33
22
  inner: boolean;
34
23
  /** Silhouette grow (positive) / shrink (negative) before blur, in px. Only ellipses and rects honour it. */
35
24
  spread: number;
36
25
  }
37
- /**
38
- * Accepted shapes for a node's `shadow` prop: a single loose {@link ShadowProp},
39
- * an array of them (stacked), or an already-resolved {@link ShadowResolved}/array
40
- * — resolved values pass through `resolveShadow` idempotently, so a node's
41
- * read-back `shadow` can be assigned straight back.
42
- */
26
+ /** Accepted shapes for a node's `shadow`: a loose {@link ShadowProp}, an array of them (stacked), or already-resolved values, which pass through `resolveShadow` idempotently so a read-back `shadow` can be assigned straight back. */
43
27
  export type Shadow = ShadowProp | ShadowResolved | (ShadowProp | ShadowResolved)[];
44
28
  export declare function resolveShadow(prop: ShadowProp, previous?: ShadowResolved): ShadowResolved;
45
- /** The shadow-layer attribute's op set — the `shadow` prop's resolve/lerp pair. */
46
29
  export declare const shadowOps: AttributeOps<Shadow, ShadowResolved[]>;
47
30
  //# sourceMappingURL=shadow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shadow/shadow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,IAAI,E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,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,UAAU;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iHAAiH;IACjH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,mGAAmG;IACnG,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4MAA4M;IAC5M,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,gFAAgF;IAChF,KAAK,EAAE,OAAO,CAAC;IACf,4GAA4G;IAC5G,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wOAAwO;AACxO,MAAM,MAAM,MAAM,GACZ,UAAU,GACV,cAAc,GACd,CAAC,UAAU,GAAG,cAAc,CAAC,EAAE,CAAC;AAEtC,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,cAAc,CAQzF;AAaD,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAmB5D,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { fillOps } from '../fill/registry.js';
2
2
  import { lerpVector2 } from '../../../attributes/layout/vector2.js';
3
- // ── Resolve ──────────────────────────────────────────────────────────────────
4
3
  export function resolveShadow(prop, previous) {
5
4
  return {
6
5
  blur: prop.blur ?? previous?.blur ?? 0,
@@ -10,7 +9,6 @@ export function resolveShadow(prop, previous) {
10
9
  spread: prop.spread ?? previous?.spread ?? 0,
11
10
  };
12
11
  }
13
- // ── Lerp ─────────────────────────────────────────────────────────────────────
14
12
  function lerpShadow(from, to, t) {
15
13
  return {
16
14
  blur: from.blur + (to.blur - from.blur) * t,
@@ -21,7 +19,6 @@ function lerpShadow(from, to, t) {
21
19
  spread: from.spread + (to.spread - from.spread) * t,
22
20
  };
23
21
  }
24
- /** The shadow-layer attribute's op set — the `shadow` prop's resolve/lerp pair. */
25
22
  export const shadowOps = {
26
23
  resolve: (prop, previous) => {
27
24
  if (prop == null)