@motionscript/core 0.1.0-alpha.7 → 0.1.0-alpha.9

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 (1133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +49 -48
  4. package/README.md +91 -91
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.js.map +1 -1
  7. package/dist/assets/errors.js.map +1 -1
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/assets/manager.d.ts.map +1 -1
  10. package/dist/assets/manager.js +7 -5
  11. package/dist/assets/manager.js.map +1 -1
  12. package/dist/assets/manifest.js.map +1 -1
  13. package/dist/assets/record.js.map +1 -1
  14. package/dist/assets/scope.js.map +1 -1
  15. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  16. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  17. package/dist/attributes/audio/effects/chain.js +67 -0
  18. package/dist/attributes/audio/effects/chain.js.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  20. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  21. package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
  22. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  24. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  25. package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
  26. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  28. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  29. package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
  30. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  31. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  32. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  33. package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
  34. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  35. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  36. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  37. package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
  38. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  39. package/dist/attributes/audio/effects/index.d.ts +12 -0
  40. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  41. package/dist/attributes/audio/effects/index.js +4 -0
  42. package/dist/attributes/audio/effects/index.js.map +1 -0
  43. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  44. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  45. package/dist/attributes/audio/effects/registry.js +80 -0
  46. package/dist/attributes/audio/effects/registry.js.map +1 -0
  47. package/dist/attributes/audio/effects/union.d.ts +14 -0
  48. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  49. package/dist/attributes/audio/effects/union.js +24 -0
  50. package/dist/attributes/audio/effects/union.js.map +1 -0
  51. package/dist/attributes/audio/ramp.d.ts +103 -0
  52. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  53. package/dist/attributes/audio/ramp.js +246 -0
  54. package/dist/attributes/audio/ramp.js.map +1 -0
  55. package/dist/attributes/audio/request.d.ts +24 -13
  56. package/dist/attributes/audio/request.d.ts.map +1 -1
  57. package/dist/attributes/audio/request.js +4 -3
  58. package/dist/attributes/audio/request.js.map +1 -1
  59. package/dist/attributes/audio/schedule.d.ts +21 -13
  60. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  61. package/dist/attributes/audio/schedule.js +42 -28
  62. package/dist/attributes/audio/schedule.js.map +1 -1
  63. package/dist/attributes/audio/sound.d.ts +15 -12
  64. package/dist/attributes/audio/sound.d.ts.map +1 -1
  65. package/dist/attributes/audio/sound.js +8 -10
  66. package/dist/attributes/audio/sound.js.map +1 -1
  67. package/dist/attributes/audio/transition.d.ts +33 -0
  68. package/dist/attributes/audio/transition.d.ts.map +1 -0
  69. package/dist/attributes/audio/transition.js +48 -0
  70. package/dist/attributes/audio/transition.js.map +1 -0
  71. package/dist/attributes/index.d.ts +4 -3
  72. package/dist/attributes/index.d.ts.map +1 -1
  73. package/dist/attributes/index.js +4 -7
  74. package/dist/attributes/index.js.map +1 -1
  75. package/dist/attributes/layout/alignment.js.map +1 -1
  76. package/dist/attributes/layout/index.js.map +1 -1
  77. package/dist/attributes/layout/insets.js.map +1 -1
  78. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  79. package/dist/attributes/layout/matrix2d.js.map +1 -1
  80. package/dist/attributes/layout/size.js.map +1 -1
  81. package/dist/attributes/layout/space3d.js +1 -1
  82. package/dist/attributes/layout/space3d.js.map +1 -1
  83. package/dist/attributes/layout/transform3d.js.map +1 -1
  84. package/dist/attributes/layout/vector2.js.map +1 -1
  85. package/dist/attributes/layout/world-transform.js.map +1 -1
  86. package/dist/attributes/mask/boolean.js.map +1 -1
  87. package/dist/attributes/mask/mask.js.map +1 -1
  88. package/dist/attributes/properties/decorator.js.map +1 -1
  89. package/dist/attributes/properties/inputs.js.map +1 -1
  90. package/dist/attributes/properties/typed.d.ts +7 -7
  91. package/dist/attributes/properties/typed.d.ts.map +1 -1
  92. package/dist/attributes/properties/typed.js +6 -6
  93. package/dist/attributes/properties/typed.js.map +1 -1
  94. package/dist/attributes/render3d/orbit.js.map +1 -1
  95. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -2
  96. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  97. package/dist/attributes/shape/corners/corner-radius.js +1 -2
  98. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  99. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js.map +1 -1
  101. package/dist/attributes/shape/corners/index.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  103. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  104. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  105. package/dist/attributes/shape/effects/chain.js +93 -283
  106. package/dist/attributes/shape/effects/chain.js.map +1 -1
  107. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  108. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  110. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  112. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  114. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  116. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  118. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  120. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  122. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  124. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  126. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  128. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  130. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  132. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  134. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  136. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  138. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  140. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  142. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  144. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  146. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  148. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  150. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  152. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +46 -14
  154. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  156. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  158. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  160. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  162. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  164. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  166. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  168. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  170. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  172. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  174. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  176. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  178. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  180. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  182. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  184. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  186. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  188. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  190. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  192. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  194. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  196. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  198. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  200. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  202. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  204. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  206. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  208. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  210. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  212. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  214. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  216. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  218. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  220. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  222. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  224. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  226. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  228. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  230. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  232. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  234. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  236. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  238. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  240. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  242. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  244. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  246. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  248. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  249. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  250. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  251. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  252. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  253. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  254. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  255. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  256. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  257. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  258. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  259. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  260. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  261. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  262. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  263. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  264. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  265. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  266. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  267. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  268. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  269. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  270. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  271. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  272. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  273. package/dist/attributes/shape/effects/index.d.ts +4 -2
  274. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  275. package/dist/attributes/shape/effects/index.js +1 -1
  276. package/dist/attributes/shape/effects/index.js.map +1 -1
  277. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  278. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  279. package/dist/attributes/shape/effects/registry.js +113 -102
  280. package/dist/attributes/shape/effects/registry.js.map +1 -1
  281. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  282. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  283. package/dist/attributes/shape/effects/spec.js +178 -0
  284. package/dist/attributes/shape/effects/spec.js.map +1 -0
  285. package/dist/attributes/shape/effects/union.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.js.map +1 -1
  287. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  288. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  289. package/dist/attributes/shape/fill/chain.js +9 -11
  290. package/dist/attributes/shape/fill/chain.js.map +1 -1
  291. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  292. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  293. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  294. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  295. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  296. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  297. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  298. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  299. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  300. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  301. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  302. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  303. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  304. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  305. package/dist/attributes/shape/fill/implementations/shader.d.ts +27 -26
  306. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  307. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  308. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  309. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  311. package/dist/attributes/shape/fill/index.d.ts +1 -1
  312. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  313. package/dist/attributes/shape/fill/index.js.map +1 -1
  314. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  315. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  316. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  317. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  318. package/dist/attributes/shape/fill/registry.js +1 -2
  319. package/dist/attributes/shape/fill/registry.js.map +1 -1
  320. package/dist/attributes/shape/fill/union.js.map +1 -1
  321. package/dist/attributes/shape/filters/chain.d.ts +2 -6
  322. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  323. package/dist/attributes/shape/filters/chain.js +1 -5
  324. package/dist/attributes/shape/filters/chain.js.map +1 -1
  325. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  326. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  327. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  328. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  329. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  330. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  331. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  332. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  333. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  334. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  335. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  336. package/dist/attributes/shape/filters/index.js.map +1 -1
  337. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  338. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  339. package/dist/attributes/shape/filters/registry.js +3 -3
  340. package/dist/attributes/shape/filters/registry.js.map +1 -1
  341. package/dist/attributes/shape/filters/union.d.ts +2 -3
  342. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  343. package/dist/attributes/shape/filters/union.js.map +1 -1
  344. package/dist/attributes/shape/path/anchors.js.map +1 -1
  345. package/dist/attributes/shape/path/bezier.js.map +1 -1
  346. package/dist/attributes/shape/path/index.js.map +1 -1
  347. package/dist/attributes/shape/path/measure.js.map +1 -1
  348. package/dist/attributes/shape/path/morph.js.map +1 -1
  349. package/dist/attributes/shape/path/ops.js.map +1 -1
  350. package/dist/attributes/shape/path/types.js.map +1 -1
  351. package/dist/attributes/shape/path/walk.js.map +1 -1
  352. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  353. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  354. package/dist/attributes/shape/shaders/index.js +2 -0
  355. package/dist/attributes/shape/shaders/index.js.map +1 -1
  356. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  357. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  358. package/dist/attributes/shape/shaders/language.js +20 -0
  359. package/dist/attributes/shape/shaders/language.js.map +1 -0
  360. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  361. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  362. package/dist/attributes/shape/shaders/pack.js +9 -4
  363. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  364. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  365. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  366. package/dist/attributes/shape/shaders/resolve.js +3 -6
  367. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  368. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  369. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  370. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  371. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  372. package/dist/attributes/shape/shadow/index.js.map +1 -1
  373. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  374. package/dist/attributes/shape/stroke/index.js.map +1 -1
  375. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  376. package/dist/attributes/shared/operators.js.map +1 -1
  377. package/dist/attributes/text/index.js.map +1 -1
  378. package/dist/attributes/text/ops.js.map +1 -1
  379. package/dist/attributes/text/types.js.map +1 -1
  380. package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
  381. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
  382. package/dist/browser/chunks/chunk-7DB6BI27.js +6 -0
  383. package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
  384. package/dist/browser/chunks/chunk-IX53IFBD.js +13 -0
  385. package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
  386. package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
  387. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
  388. package/dist/browser/component.js +1 -1
  389. package/dist/browser/experimental.js +1 -1
  390. package/dist/browser/experimental.js.map +4 -4
  391. package/dist/browser/index.js +1 -1
  392. package/dist/browser/index.js.map +2 -2
  393. package/dist/browser/manifest.json +1 -1
  394. package/dist/browser/sdk.js +1 -1
  395. package/dist/component.js.map +1 -1
  396. package/dist/components/builtins/audio/audio.d.ts +14 -5
  397. package/dist/components/builtins/audio/audio.d.ts.map +1 -1
  398. package/dist/components/builtins/audio/audio.js +10 -13
  399. package/dist/components/builtins/audio/audio.js.map +1 -1
  400. package/dist/components/builtins/geometry/composite.d.ts +3 -3
  401. package/dist/components/builtins/geometry/composite.js.map +1 -1
  402. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  403. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  404. package/dist/components/builtins/layout/layout.js.map +1 -1
  405. package/dist/components/builtins/media/media.d.ts +7 -7
  406. package/dist/components/builtins/media/media.d.ts.map +1 -1
  407. package/dist/components/builtins/media/media.js +4 -10
  408. package/dist/components/builtins/media/media.js.map +1 -1
  409. package/dist/components/builtins/providers/providers.js.map +1 -1
  410. package/dist/components/builtins/text/number-format.js.map +1 -1
  411. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  412. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  413. package/dist/components/builtins/text/text-layout.js.map +1 -1
  414. package/dist/components/builtins/text/text.d.ts +9 -9
  415. package/dist/components/builtins/text/text.d.ts.map +1 -1
  416. package/dist/components/builtins/text/text.js +3 -0
  417. package/dist/components/builtins/text/text.js.map +1 -1
  418. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  419. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  420. package/dist/components/builtins/three/three.js.map +1 -1
  421. package/dist/components/factory/api.d.ts +38 -11
  422. package/dist/components/factory/api.d.ts.map +1 -1
  423. package/dist/components/factory/api.js.map +1 -1
  424. package/dist/components/factory/clip-of.js.map +1 -1
  425. package/dist/components/factory/commands-for.js.map +1 -1
  426. package/dist/components/factory/component-audio.js.map +1 -1
  427. package/dist/components/factory/component2d.js.map +1 -1
  428. package/dist/components/factory/component3d.d.ts.map +1 -1
  429. package/dist/components/factory/component3d.js +11 -3
  430. package/dist/components/factory/component3d.js.map +1 -1
  431. package/dist/components/factory/factory.d.ts +3 -0
  432. package/dist/components/factory/factory.d.ts.map +1 -1
  433. package/dist/components/factory/factory.js +39 -5
  434. package/dist/components/factory/factory.js.map +1 -1
  435. package/dist/components/factory/timeline.js.map +1 -1
  436. package/dist/components/factory/type-def.js.map +1 -1
  437. package/dist/components/factory/types.js.map +1 -1
  438. package/dist/components/factory/views.js.map +1 -1
  439. package/dist/components/modules/aim.js.map +1 -1
  440. package/dist/components/modules/corners.js.map +1 -1
  441. package/dist/components/modules/flow.js.map +1 -1
  442. package/dist/components/modules/material.js.map +1 -1
  443. package/dist/components/modules/paint.js.map +1 -1
  444. package/dist/components/modules/shapes.js.map +1 -1
  445. package/dist/components/modules/text-layout.js.map +1 -1
  446. package/dist/components/modules/text-style.js.map +1 -1
  447. package/dist/components/modules/three-entries.js.map +1 -1
  448. package/dist/components/modules/view3d.js.map +1 -1
  449. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  450. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  451. package/dist/components/trees/2d/node-motion.js.map +1 -1
  452. package/dist/components/trees/2d/node-render.d.ts +1 -1
  453. package/dist/components/trees/2d/node-render.js +1 -1
  454. package/dist/components/trees/2d/node-render.js.map +1 -1
  455. package/dist/components/trees/2d/node-space.js.map +1 -1
  456. package/dist/components/trees/2d/node-transform.js.map +1 -1
  457. package/dist/components/trees/2d/node2d.d.ts +1 -1
  458. package/dist/components/trees/2d/node2d.js +1 -1
  459. package/dist/components/trees/2d/node2d.js.map +1 -1
  460. package/dist/components/trees/audio/index.js.map +1 -1
  461. package/dist/components/trees/audio/node-audio.d.ts +16 -9
  462. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  463. package/dist/components/trees/audio/node-audio.js +15 -11
  464. package/dist/components/trees/audio/node-audio.js.map +1 -1
  465. package/dist/components/trees/index.js.map +1 -1
  466. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  467. package/dist/components/trees/node/node-reactive.js.map +1 -1
  468. package/dist/components/trees/node/node-time.js.map +1 -1
  469. package/dist/components/trees/node/node-walk.js.map +1 -1
  470. package/dist/components/trees/node/node.js.map +1 -1
  471. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  472. package/dist/components/trees/three/node3d.js.map +1 -1
  473. package/dist/document/audio.js.map +1 -1
  474. package/dist/document/builtins.js.map +1 -1
  475. package/dist/document/command-traits.d.ts +12 -2
  476. package/dist/document/command-traits.d.ts.map +1 -1
  477. package/dist/document/command-traits.js +34 -6
  478. package/dist/document/command-traits.js.map +1 -1
  479. package/dist/document/deny-globals.js.map +1 -1
  480. package/dist/document/diff.js.map +1 -1
  481. package/dist/document/doc-index.js.map +1 -1
  482. package/dist/document/expression/compile.js.map +1 -1
  483. package/dist/document/expression/index.js.map +1 -1
  484. package/dist/document/expression/ops.js.map +1 -1
  485. package/dist/document/expression/parse.js.map +1 -1
  486. package/dist/document/expression/refs.js.map +1 -1
  487. package/dist/document/expression/types.js.map +1 -1
  488. package/dist/document/expression/walk.js.map +1 -1
  489. package/dist/document/index.d.ts +8 -0
  490. package/dist/document/index.d.ts.map +1 -1
  491. package/dist/document/index.js +4 -0
  492. package/dist/document/index.js.map +1 -1
  493. package/dist/document/migrate.d.ts +70 -0
  494. package/dist/document/migrate.d.ts.map +1 -0
  495. package/dist/document/migrate.js +202 -0
  496. package/dist/document/migrate.js.map +1 -0
  497. package/dist/document/missing-node.d.ts +27 -0
  498. package/dist/document/missing-node.d.ts.map +1 -0
  499. package/dist/document/missing-node.js +48 -0
  500. package/dist/document/missing-node.js.map +1 -0
  501. package/dist/document/node-decorator.js.map +1 -1
  502. package/dist/document/node-descriptor.d.ts +4 -0
  503. package/dist/document/node-descriptor.d.ts.map +1 -1
  504. package/dist/document/node-descriptor.js.map +1 -1
  505. package/dist/document/placement.d.ts +2 -1
  506. package/dist/document/placement.d.ts.map +1 -1
  507. package/dist/document/placement.js.map +1 -1
  508. package/dist/document/project.d.ts +2 -0
  509. package/dist/document/project.d.ts.map +1 -1
  510. package/dist/document/project.js +1 -0
  511. package/dist/document/project.js.map +1 -1
  512. package/dist/document/prop-evolution.d.ts +51 -0
  513. package/dist/document/prop-evolution.d.ts.map +1 -0
  514. package/dist/document/prop-evolution.js +83 -0
  515. package/dist/document/prop-evolution.js.map +1 -0
  516. package/dist/document/registry.d.ts +16 -0
  517. package/dist/document/registry.d.ts.map +1 -1
  518. package/dist/document/registry.js +30 -4
  519. package/dist/document/registry.js.map +1 -1
  520. package/dist/document/settled-index.d.ts +2 -0
  521. package/dist/document/settled-index.d.ts.map +1 -1
  522. package/dist/document/settled-index.js +5 -5
  523. package/dist/document/settled-index.js.map +1 -1
  524. package/dist/document/timeline-patch.d.ts +4 -0
  525. package/dist/document/timeline-patch.d.ts.map +1 -1
  526. package/dist/document/timeline-patch.js +28 -3
  527. package/dist/document/timeline-patch.js.map +1 -1
  528. package/dist/document/timeline.d.ts +45 -1
  529. package/dist/document/timeline.d.ts.map +1 -1
  530. package/dist/document/timeline.js +172 -42
  531. package/dist/document/timeline.js.map +1 -1
  532. package/dist/document/types.d.ts +14 -28
  533. package/dist/document/types.d.ts.map +1 -1
  534. package/dist/document/types.js.map +1 -1
  535. package/dist/document/validate.d.ts +17 -5
  536. package/dist/document/validate.d.ts.map +1 -1
  537. package/dist/document/validate.js +158 -21
  538. package/dist/document/validate.js.map +1 -1
  539. package/dist/document/vocabulary.d.ts +28 -0
  540. package/dist/document/vocabulary.d.ts.map +1 -0
  541. package/dist/document/vocabulary.js +42 -0
  542. package/dist/document/vocabulary.js.map +1 -0
  543. package/dist/experimental.d.ts +68 -8
  544. package/dist/experimental.d.ts.map +1 -1
  545. package/dist/experimental.js +22 -8
  546. package/dist/experimental.js.map +1 -1
  547. package/dist/index.js.map +1 -1
  548. package/dist/layout/bounds.js.map +1 -1
  549. package/dist/layout/constraints.js.map +1 -1
  550. package/dist/layout/flex.js.map +1 -1
  551. package/dist/layout/freeform.js.map +1 -1
  552. package/dist/layout/grid.js.map +1 -1
  553. package/dist/layout/index.js.map +1 -1
  554. package/dist/layout/item.js.map +1 -1
  555. package/dist/layout/ops.js.map +1 -1
  556. package/dist/layout/types.js.map +1 -1
  557. package/dist/platform/audio-sink.js.map +1 -1
  558. package/dist/platform/exporter.d.ts +13 -0
  559. package/dist/platform/exporter.d.ts.map +1 -1
  560. package/dist/platform/exporter.js.map +1 -1
  561. package/dist/platform/index.js.map +1 -1
  562. package/dist/platform/stepped-clock.js.map +1 -1
  563. package/dist/platform/storage-adapter.js.map +1 -1
  564. package/dist/platform/ticker.js.map +1 -1
  565. package/dist/project/config.js.map +1 -1
  566. package/dist/project/index.js.map +1 -1
  567. package/dist/project/tree.js.map +1 -1
  568. package/dist/props/host.js.map +1 -1
  569. package/dist/props/index.js.map +1 -1
  570. package/dist/props/observer.js.map +1 -1
  571. package/dist/props/slot.js.map +1 -1
  572. package/dist/renamed-scene-names.d.ts +1 -1
  573. package/dist/renamed-scene-names.d.ts.map +1 -1
  574. package/dist/renamed-scene-names.js +1 -1
  575. package/dist/renamed-scene-names.js.map +1 -1
  576. package/dist/render/canvas-render-context2d.d.ts +9 -0
  577. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  578. package/dist/render/canvas-render-context2d.js +10 -0
  579. package/dist/render/canvas-render-context2d.js.map +1 -1
  580. package/dist/render/clip-contains.js +1 -1
  581. package/dist/render/clip-contains.js.map +1 -1
  582. package/dist/render/clip.js.map +1 -1
  583. package/dist/render/descriptors/ellipse.js.map +1 -1
  584. package/dist/render/descriptors/line.js.map +1 -1
  585. package/dist/render/descriptors/path-builder.js.map +1 -1
  586. package/dist/render/descriptors/path.js.map +1 -1
  587. package/dist/render/descriptors/polygon.js.map +1 -1
  588. package/dist/render/descriptors/polygram.js.map +1 -1
  589. package/dist/render/descriptors/rect.js.map +1 -1
  590. package/dist/render/descriptors/richtext.js.map +1 -1
  591. package/dist/render/descriptors/shape.js.map +1 -1
  592. package/dist/render/descriptors/text.d.ts +2 -2
  593. package/dist/render/descriptors/text.js +2 -2
  594. package/dist/render/descriptors/text.js.map +1 -1
  595. package/dist/render/descriptors/transform.js.map +1 -1
  596. package/dist/render/graphics2d.js.map +1 -1
  597. package/dist/render/index.d.ts +2 -0
  598. package/dist/render/index.d.ts.map +1 -1
  599. package/dist/render/index.js +1 -0
  600. package/dist/render/index.js.map +1 -1
  601. package/dist/render/measure-context.js.map +1 -1
  602. package/dist/render/null-render-context.js.map +1 -1
  603. package/dist/render/render-context2d.d.ts +1 -1
  604. package/dist/render/render-context2d.js.map +1 -1
  605. package/dist/render/render-issue.d.ts +39 -0
  606. package/dist/render/render-issue.d.ts.map +1 -0
  607. package/dist/render/render-issue.js +29 -0
  608. package/dist/render/render-issue.js.map +1 -0
  609. package/dist/render/surface.d.ts +2 -2
  610. package/dist/render/surface.js.map +1 -1
  611. package/dist/render/text-defaults.js.map +1 -1
  612. package/dist/render/text-layout.js.map +1 -1
  613. package/dist/render3d/bounds3d.js.map +1 -1
  614. package/dist/render3d/builders.js.map +1 -1
  615. package/dist/render3d/camera.js.map +1 -1
  616. package/dist/render3d/fill3d.js.map +1 -1
  617. package/dist/render3d/geometry.js.map +1 -1
  618. package/dist/render3d/graphics3d.d.ts.map +1 -1
  619. package/dist/render3d/graphics3d.js +54 -5
  620. package/dist/render3d/graphics3d.js.map +1 -1
  621. package/dist/render3d/index.js.map +1 -1
  622. package/dist/render3d/inert.js.map +1 -1
  623. package/dist/render3d/light.js.map +1 -1
  624. package/dist/render3d/material.js.map +1 -1
  625. package/dist/render3d/matrix4.js.map +1 -1
  626. package/dist/render3d/render-context3d.js.map +1 -1
  627. package/dist/render3d/resources.js.map +1 -1
  628. package/dist/render3d/rounded-box.js.map +1 -1
  629. package/dist/render3d/scene-settings.js.map +1 -1
  630. package/dist/render3d/scene3d.js.map +1 -1
  631. package/dist/render3d/segments.js.map +1 -1
  632. package/dist/render3d/texture.js.map +1 -1
  633. package/dist/render3d/tracking.js.map +1 -1
  634. package/dist/render3d/transform.js.map +1 -1
  635. package/dist/render3d/vector3.js.map +1 -1
  636. package/dist/render3d/walk.js.map +1 -1
  637. package/dist/runtime/asset-refine.js +2 -1
  638. package/dist/runtime/asset-refine.js.map +1 -1
  639. package/dist/runtime/asset-timeline.d.ts +10 -0
  640. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  641. package/dist/runtime/asset-timeline.js.map +1 -1
  642. package/dist/runtime/asset-update.d.ts.map +1 -1
  643. package/dist/runtime/asset-update.js +7 -0
  644. package/dist/runtime/asset-update.js.map +1 -1
  645. package/dist/runtime/audio-index.js.map +1 -1
  646. package/dist/runtime/builtin-context.js.map +1 -1
  647. package/dist/runtime/clip-instance.d.ts +3 -1
  648. package/dist/runtime/clip-instance.d.ts.map +1 -1
  649. package/dist/runtime/clip-instance.js +4 -0
  650. package/dist/runtime/clip-instance.js.map +1 -1
  651. package/dist/runtime/clip-store.d.ts.map +1 -1
  652. package/dist/runtime/clip-store.js +17 -2
  653. package/dist/runtime/clip-store.js.map +1 -1
  654. package/dist/runtime/engine.d.ts +5 -3
  655. package/dist/runtime/engine.d.ts.map +1 -1
  656. package/dist/runtime/engine.js +2 -1
  657. package/dist/runtime/engine.js.map +1 -1
  658. package/dist/runtime/frame-time.js.map +1 -1
  659. package/dist/runtime/index.js.map +1 -1
  660. package/dist/runtime/node-picking.js.map +1 -1
  661. package/dist/runtime/node-picking3d.js.map +1 -1
  662. package/dist/runtime/placement.js.map +1 -1
  663. package/dist/runtime/playback-controller.d.ts.map +1 -1
  664. package/dist/runtime/playback-controller.js +14 -4
  665. package/dist/runtime/playback-controller.js.map +1 -1
  666. package/dist/runtime/playback.js.map +1 -1
  667. package/dist/runtime/precompisition.js.map +1 -1
  668. package/dist/runtime/project-assets.js.map +1 -1
  669. package/dist/runtime/session.d.ts +7 -3
  670. package/dist/runtime/session.d.ts.map +1 -1
  671. package/dist/runtime/session.js +11 -4
  672. package/dist/runtime/session.js.map +1 -1
  673. package/dist/runtime/settle.js.map +1 -1
  674. package/dist/runtime/state-evaluator.js.map +1 -1
  675. package/dist/runtime/text-geometry.d.ts +1 -1
  676. package/dist/runtime/text-geometry.js.map +1 -1
  677. package/dist/sdk/index.d.ts +8 -6
  678. package/dist/sdk/index.d.ts.map +1 -1
  679. package/dist/sdk/index.js +10 -3
  680. package/dist/sdk/index.js.map +1 -1
  681. package/dist/tween/command-decorator.d.ts +7 -0
  682. package/dist/tween/command-decorator.d.ts.map +1 -1
  683. package/dist/tween/command-decorator.js +1 -0
  684. package/dist/tween/command-decorator.js.map +1 -1
  685. package/dist/tween/command.js.map +1 -1
  686. package/dist/tween/ease/constants.js.map +1 -1
  687. package/dist/tween/ease/curve.js.map +1 -1
  688. package/dist/tween/ease/describe.d.ts +2 -0
  689. package/dist/tween/ease/describe.d.ts.map +1 -1
  690. package/dist/tween/ease/describe.js +4 -0
  691. package/dist/tween/ease/describe.js.map +1 -1
  692. package/dist/tween/ease/spec.d.ts +31 -0
  693. package/dist/tween/ease/spec.d.ts.map +1 -0
  694. package/dist/tween/ease/spec.js +51 -0
  695. package/dist/tween/ease/spec.js.map +1 -0
  696. package/dist/tween/ease/type.js.map +1 -1
  697. package/dist/tween/index.d.ts +1 -0
  698. package/dist/tween/index.d.ts.map +1 -1
  699. package/dist/tween/index.js +1 -0
  700. package/dist/tween/index.js.map +1 -1
  701. package/dist/tween/inert.js.map +1 -1
  702. package/dist/tween/lerp.js.map +1 -1
  703. package/dist/tween/loop.js.map +1 -1
  704. package/dist/tween/prepare.js.map +1 -1
  705. package/dist/tween/stepper.js.map +1 -1
  706. package/dist/tween/to-command.js.map +1 -1
  707. package/dist/util/clamp.js.map +1 -1
  708. package/dist/util/context.js.map +1 -1
  709. package/dist/util/csv.js.map +1 -1
  710. package/dist/util/generateList.js.map +1 -1
  711. package/dist/util/index.js.map +1 -1
  712. package/dist/util/metrics.js.map +1 -1
  713. package/dist/util/random.js.map +1 -1
  714. package/dist/util/reference.js.map +1 -1
  715. package/dist/util/scheduler.js.map +1 -1
  716. package/package.json +2 -2
  717. package/dist/attributes/audio/filters/chain.d.ts +0 -113
  718. package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
  719. package/dist/attributes/audio/filters/chain.js +0 -104
  720. package/dist/attributes/audio/filters/chain.js.map +0 -1
  721. package/dist/attributes/audio/filters/curve.d.ts +0 -152
  722. package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
  723. package/dist/attributes/audio/filters/curve.js +0 -250
  724. package/dist/attributes/audio/filters/curve.js.map +0 -1
  725. package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
  726. package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
  727. package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
  728. package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
  729. package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
  730. package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
  731. package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
  732. package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
  733. package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
  734. package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
  735. package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
  736. package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
  737. package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
  738. package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
  739. package/dist/attributes/audio/filters/implementations/speed.js +0 -6
  740. package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
  741. package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
  742. package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
  743. package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
  744. package/dist/attributes/audio/filters/index.d.ts +0 -22
  745. package/dist/attributes/audio/filters/index.d.ts.map +0 -1
  746. package/dist/attributes/audio/filters/index.js +0 -8
  747. package/dist/attributes/audio/filters/index.js.map +0 -1
  748. package/dist/attributes/audio/filters/registry.d.ts +0 -36
  749. package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
  750. package/dist/attributes/audio/filters/registry.js +0 -82
  751. package/dist/attributes/audio/filters/registry.js.map +0 -1
  752. package/dist/attributes/audio/filters/union.d.ts +0 -18
  753. package/dist/attributes/audio/filters/union.d.ts.map +0 -1
  754. package/dist/attributes/audio/filters/union.js +0 -28
  755. package/dist/attributes/audio/filters/union.js.map +0 -1
  756. package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
  757. package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
  758. package/dist/attributes/shape/sksl-uniforms.js +0 -0
  759. package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
  760. package/dist/browser/chunks/chunk-D4FSTPML.js +0 -14
  761. package/dist/browser/chunks/chunk-D4FSTPML.js.map +0 -7
  762. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
  763. package/dist/browser/chunks/chunk-RTNATFWX.js +0 -5
  764. package/dist/browser/chunks/chunk-RTNATFWX.js.map +0 -7
  765. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
  766. package/dist/component/api.d.ts +0 -508
  767. package/dist/component/api.d.ts.map +0 -1
  768. package/dist/component/api.js +0 -4
  769. package/dist/component/api.js.map +0 -1
  770. package/dist/component/builtins/audio.d.ts +0 -26
  771. package/dist/component/builtins/audio.d.ts.map +0 -1
  772. package/dist/component/builtins/audio.js +0 -41
  773. package/dist/component/builtins/audio.js.map +0 -1
  774. package/dist/component/builtins/canvas3d.d.ts +0 -98
  775. package/dist/component/builtins/canvas3d.d.ts.map +0 -1
  776. package/dist/component/builtins/canvas3d.js +0 -21
  777. package/dist/component/builtins/canvas3d.js.map +0 -1
  778. package/dist/component/builtins/composite.d.ts +0 -56
  779. package/dist/component/builtins/composite.d.ts.map +0 -1
  780. package/dist/component/builtins/composite.js +0 -25
  781. package/dist/component/builtins/composite.js.map +0 -1
  782. package/dist/component/builtins/geometry.d.ts +0 -505
  783. package/dist/component/builtins/geometry.d.ts.map +0 -1
  784. package/dist/component/builtins/geometry.js +0 -107
  785. package/dist/component/builtins/geometry.js.map +0 -1
  786. package/dist/component/builtins/layout.d.ts +0 -88
  787. package/dist/component/builtins/layout.d.ts.map +0 -1
  788. package/dist/component/builtins/layout.js +0 -84
  789. package/dist/component/builtins/layout.js.map +0 -1
  790. package/dist/component/builtins/media.d.ts +0 -95
  791. package/dist/component/builtins/media.d.ts.map +0 -1
  792. package/dist/component/builtins/media.js +0 -149
  793. package/dist/component/builtins/media.js.map +0 -1
  794. package/dist/component/builtins/providers.d.ts +0 -23
  795. package/dist/component/builtins/providers.d.ts.map +0 -1
  796. package/dist/component/builtins/providers.js +0 -30
  797. package/dist/component/builtins/providers.js.map +0 -1
  798. package/dist/component/builtins/text.d.ts +0 -193
  799. package/dist/component/builtins/text.d.ts.map +0 -1
  800. package/dist/component/builtins/text.js +0 -113
  801. package/dist/component/builtins/text.js.map +0 -1
  802. package/dist/component/builtins/three.d.ts +0 -1085
  803. package/dist/component/builtins/three.d.ts.map +0 -1
  804. package/dist/component/builtins/three.js +0 -265
  805. package/dist/component/builtins/three.js.map +0 -1
  806. package/dist/component/clip-of.d.ts +0 -5
  807. package/dist/component/clip-of.d.ts.map +0 -1
  808. package/dist/component/clip-of.js +0 -33
  809. package/dist/component/clip-of.js.map +0 -1
  810. package/dist/component/commands-for.d.ts +0 -19
  811. package/dist/component/commands-for.d.ts.map +0 -1
  812. package/dist/component/commands-for.js +0 -5
  813. package/dist/component/commands-for.js.map +0 -1
  814. package/dist/component/component-audio.d.ts +0 -9
  815. package/dist/component/component-audio.d.ts.map +0 -1
  816. package/dist/component/component-audio.js +0 -18
  817. package/dist/component/component-audio.js.map +0 -1
  818. package/dist/component/component2d.d.ts +0 -9
  819. package/dist/component/component2d.d.ts.map +0 -1
  820. package/dist/component/component2d.js +0 -239
  821. package/dist/component/component2d.js.map +0 -1
  822. package/dist/component/component3d.d.ts +0 -9
  823. package/dist/component/component3d.d.ts.map +0 -1
  824. package/dist/component/component3d.js +0 -99
  825. package/dist/component/component3d.js.map +0 -1
  826. package/dist/component/factory.d.ts +0 -63
  827. package/dist/component/factory.d.ts.map +0 -1
  828. package/dist/component/factory.js +0 -313
  829. package/dist/component/factory.js.map +0 -1
  830. package/dist/component/modules/aim.d.ts +0 -30
  831. package/dist/component/modules/aim.d.ts.map +0 -1
  832. package/dist/component/modules/aim.js +0 -39
  833. package/dist/component/modules/aim.js.map +0 -1
  834. package/dist/component/modules/corners.d.ts +0 -13
  835. package/dist/component/modules/corners.d.ts.map +0 -1
  836. package/dist/component/modules/corners.js +0 -12
  837. package/dist/component/modules/corners.js.map +0 -1
  838. package/dist/component/modules/flow.d.ts +0 -26
  839. package/dist/component/modules/flow.d.ts.map +0 -1
  840. package/dist/component/modules/flow.js +0 -55
  841. package/dist/component/modules/flow.js.map +0 -1
  842. package/dist/component/modules/material.d.ts +0 -40
  843. package/dist/component/modules/material.d.ts.map +0 -1
  844. package/dist/component/modules/material.js +0 -75
  845. package/dist/component/modules/material.js.map +0 -1
  846. package/dist/component/modules/paint.d.ts +0 -71
  847. package/dist/component/modules/paint.d.ts.map +0 -1
  848. package/dist/component/modules/paint.js +0 -106
  849. package/dist/component/modules/paint.js.map +0 -1
  850. package/dist/component/modules/shapes.d.ts +0 -31
  851. package/dist/component/modules/shapes.d.ts.map +0 -1
  852. package/dist/component/modules/shapes.js +0 -43
  853. package/dist/component/modules/shapes.js.map +0 -1
  854. package/dist/component/modules/text-layout.d.ts +0 -26
  855. package/dist/component/modules/text-layout.d.ts.map +0 -1
  856. package/dist/component/modules/text-layout.js +0 -57
  857. package/dist/component/modules/text-layout.js.map +0 -1
  858. package/dist/component/modules/text-style.d.ts +0 -48
  859. package/dist/component/modules/text-style.d.ts.map +0 -1
  860. package/dist/component/modules/text-style.js +0 -63
  861. package/dist/component/modules/text-style.js.map +0 -1
  862. package/dist/component/modules/three-entries.d.ts +0 -23
  863. package/dist/component/modules/three-entries.d.ts.map +0 -1
  864. package/dist/component/modules/three-entries.js +0 -41
  865. package/dist/component/modules/three-entries.js.map +0 -1
  866. package/dist/component/modules/view3d.d.ts +0 -55
  867. package/dist/component/modules/view3d.d.ts.map +0 -1
  868. package/dist/component/modules/view3d.js +0 -160
  869. package/dist/component/modules/view3d.js.map +0 -1
  870. package/dist/component/timeline.d.ts +0 -22
  871. package/dist/component/timeline.d.ts.map +0 -1
  872. package/dist/component/timeline.js +0 -128
  873. package/dist/component/timeline.js.map +0 -1
  874. package/dist/component/type-def.d.ts +0 -26
  875. package/dist/component/type-def.d.ts.map +0 -1
  876. package/dist/component/type-def.js +0 -16
  877. package/dist/component/type-def.js.map +0 -1
  878. package/dist/component/types.d.ts +0 -91
  879. package/dist/component/types.d.ts.map +0 -1
  880. package/dist/component/types.js +0 -88
  881. package/dist/component/types.js.map +0 -1
  882. package/dist/component/views.d.ts +0 -121
  883. package/dist/component/views.d.ts.map +0 -1
  884. package/dist/component/views.js +0 -413
  885. package/dist/component/views.js.map +0 -1
  886. package/dist/document/withdraw.d.ts +0 -28
  887. package/dist/document/withdraw.d.ts.map +0 -1
  888. package/dist/document/withdraw.js +0 -61
  889. package/dist/document/withdraw.js.map +0 -1
  890. package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
  891. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  892. package/dist/jsx/jsx-dev-runtime.js +0 -3
  893. package/dist/jsx/jsx-dev-runtime.js.map +0 -1
  894. package/dist/jsx/jsx-runtime.d.ts +0 -27
  895. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  896. package/dist/jsx/jsx-runtime.js +0 -26
  897. package/dist/jsx/jsx-runtime.js.map +0 -1
  898. package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
  899. package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
  900. package/dist/nodes/2d/node-lifecycle.js +0 -264
  901. package/dist/nodes/2d/node-lifecycle.js.map +0 -1
  902. package/dist/nodes/2d/node-motion.d.ts +0 -56
  903. package/dist/nodes/2d/node-motion.d.ts.map +0 -1
  904. package/dist/nodes/2d/node-motion.js +0 -86
  905. package/dist/nodes/2d/node-motion.js.map +0 -1
  906. package/dist/nodes/2d/node-render.d.ts +0 -44
  907. package/dist/nodes/2d/node-render.d.ts.map +0 -1
  908. package/dist/nodes/2d/node-render.js +0 -80
  909. package/dist/nodes/2d/node-render.js.map +0 -1
  910. package/dist/nodes/2d/node-space.d.ts +0 -63
  911. package/dist/nodes/2d/node-space.d.ts.map +0 -1
  912. package/dist/nodes/2d/node-space.js +0 -131
  913. package/dist/nodes/2d/node-space.js.map +0 -1
  914. package/dist/nodes/2d/node-transform.d.ts +0 -55
  915. package/dist/nodes/2d/node-transform.d.ts.map +0 -1
  916. package/dist/nodes/2d/node-transform.js +0 -73
  917. package/dist/nodes/2d/node-transform.js.map +0 -1
  918. package/dist/nodes/2d/node2d.d.ts +0 -1111
  919. package/dist/nodes/2d/node2d.d.ts.map +0 -1
  920. package/dist/nodes/2d/node2d.js +0 -1665
  921. package/dist/nodes/2d/node2d.js.map +0 -1
  922. package/dist/nodes/2d/paint-node.d.ts +0 -142
  923. package/dist/nodes/2d/paint-node.d.ts.map +0 -1
  924. package/dist/nodes/2d/paint-node.js +0 -232
  925. package/dist/nodes/2d/paint-node.js.map +0 -1
  926. package/dist/nodes/audio/audio-bus.d.ts +0 -28
  927. package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
  928. package/dist/nodes/audio/audio-bus.js +0 -33
  929. package/dist/nodes/audio/audio-bus.js.map +0 -1
  930. package/dist/nodes/audio/index.d.ts +0 -4
  931. package/dist/nodes/audio/index.d.ts.map +0 -1
  932. package/dist/nodes/audio/index.js +0 -2
  933. package/dist/nodes/audio/index.js.map +0 -1
  934. package/dist/nodes/audio/node-audio.d.ts +0 -107
  935. package/dist/nodes/audio/node-audio.d.ts.map +0 -1
  936. package/dist/nodes/audio/node-audio.js +0 -179
  937. package/dist/nodes/audio/node-audio.js.map +0 -1
  938. package/dist/nodes/audio/sound-node.d.ts +0 -41
  939. package/dist/nodes/audio/sound-node.d.ts.map +0 -1
  940. package/dist/nodes/audio/sound-node.js +0 -71
  941. package/dist/nodes/audio/sound-node.js.map +0 -1
  942. package/dist/nodes/geometry/boolean-node.d.ts +0 -28
  943. package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
  944. package/dist/nodes/geometry/boolean-node.js +0 -81
  945. package/dist/nodes/geometry/boolean-node.js.map +0 -1
  946. package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
  947. package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
  948. package/dist/nodes/geometry/bounds-shape-node.js +0 -181
  949. package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
  950. package/dist/nodes/geometry/box-path-node.d.ts +0 -89
  951. package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
  952. package/dist/nodes/geometry/box-path-node.js +0 -116
  953. package/dist/nodes/geometry/box-path-node.js.map +0 -1
  954. package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
  955. package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
  956. package/dist/nodes/geometry/ellipse-node.js +0 -45
  957. package/dist/nodes/geometry/ellipse-node.js.map +0 -1
  958. package/dist/nodes/geometry/group-bounds.d.ts +0 -56
  959. package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
  960. package/dist/nodes/geometry/group-bounds.js +0 -87
  961. package/dist/nodes/geometry/group-bounds.js.map +0 -1
  962. package/dist/nodes/geometry/mask-node.d.ts +0 -33
  963. package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
  964. package/dist/nodes/geometry/mask-node.js +0 -66
  965. package/dist/nodes/geometry/mask-node.js.map +0 -1
  966. package/dist/nodes/geometry/path-node.d.ts +0 -26
  967. package/dist/nodes/geometry/path-node.d.ts.map +0 -1
  968. package/dist/nodes/geometry/path-node.js +0 -58
  969. package/dist/nodes/geometry/path-node.js.map +0 -1
  970. package/dist/nodes/geometry/polygon-node.d.ts +0 -26
  971. package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
  972. package/dist/nodes/geometry/polygon-node.js +0 -47
  973. package/dist/nodes/geometry/polygon-node.js.map +0 -1
  974. package/dist/nodes/geometry/polygram-node.d.ts +0 -33
  975. package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
  976. package/dist/nodes/geometry/polygram-node.js +0 -52
  977. package/dist/nodes/geometry/polygram-node.js.map +0 -1
  978. package/dist/nodes/geometry/rect-node.d.ts +0 -38
  979. package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
  980. package/dist/nodes/geometry/rect-node.js +0 -56
  981. package/dist/nodes/geometry/rect-node.js.map +0 -1
  982. package/dist/nodes/geometry/shape-node.d.ts +0 -71
  983. package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
  984. package/dist/nodes/geometry/shape-node.js +0 -140
  985. package/dist/nodes/geometry/shape-node.js.map +0 -1
  986. package/dist/nodes/geometry/shape-outline.d.ts +0 -93
  987. package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
  988. package/dist/nodes/geometry/shape-outline.js +0 -470
  989. package/dist/nodes/geometry/shape-outline.js.map +0 -1
  990. package/dist/nodes/index.d.ts +0 -53
  991. package/dist/nodes/index.d.ts.map +0 -1
  992. package/dist/nodes/index.js +0 -35
  993. package/dist/nodes/index.js.map +0 -1
  994. package/dist/nodes/layout/camera-node.d.ts +0 -80
  995. package/dist/nodes/layout/camera-node.d.ts.map +0 -1
  996. package/dist/nodes/layout/camera-node.js +0 -153
  997. package/dist/nodes/layout/camera-node.js.map +0 -1
  998. package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
  999. package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
  1000. package/dist/nodes/layout/orbit-camera-node.js +0 -118
  1001. package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
  1002. package/dist/nodes/layout/rotated-box.d.ts +0 -20
  1003. package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
  1004. package/dist/nodes/layout/rotated-box.js +0 -76
  1005. package/dist/nodes/layout/rotated-box.js.map +0 -1
  1006. package/dist/nodes/media/video-node.d.ts +0 -229
  1007. package/dist/nodes/media/video-node.d.ts.map +0 -1
  1008. package/dist/nodes/media/video-node.js +0 -350
  1009. package/dist/nodes/media/video-node.js.map +0 -1
  1010. package/dist/nodes/node/declare-paints.d.ts +0 -19
  1011. package/dist/nodes/node/declare-paints.d.ts.map +0 -1
  1012. package/dist/nodes/node/declare-paints.js +0 -27
  1013. package/dist/nodes/node/declare-paints.js.map +0 -1
  1014. package/dist/nodes/node/node-editor-state.d.ts +0 -53
  1015. package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
  1016. package/dist/nodes/node/node-editor-state.js +0 -23
  1017. package/dist/nodes/node/node-editor-state.js.map +0 -1
  1018. package/dist/nodes/node/node-reactive.d.ts +0 -89
  1019. package/dist/nodes/node/node-reactive.d.ts.map +0 -1
  1020. package/dist/nodes/node/node-reactive.js +0 -135
  1021. package/dist/nodes/node/node-reactive.js.map +0 -1
  1022. package/dist/nodes/node/node-time.d.ts +0 -39
  1023. package/dist/nodes/node/node-time.d.ts.map +0 -1
  1024. package/dist/nodes/node/node-time.js +0 -14
  1025. package/dist/nodes/node/node-time.js.map +0 -1
  1026. package/dist/nodes/node/node-walk.d.ts +0 -46
  1027. package/dist/nodes/node/node-walk.d.ts.map +0 -1
  1028. package/dist/nodes/node/node-walk.js +0 -74
  1029. package/dist/nodes/node/node-walk.js.map +0 -1
  1030. package/dist/nodes/node/node.d.ts +0 -445
  1031. package/dist/nodes/node/node.d.ts.map +0 -1
  1032. package/dist/nodes/node/node.js +0 -745
  1033. package/dist/nodes/node/node.js.map +0 -1
  1034. package/dist/nodes/node/text-defaults.d.ts +0 -32
  1035. package/dist/nodes/node/text-defaults.d.ts.map +0 -1
  1036. package/dist/nodes/node/text-defaults.js +0 -37
  1037. package/dist/nodes/node/text-defaults.js.map +0 -1
  1038. package/dist/nodes/root/canvas2d-node.d.ts +0 -163
  1039. package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
  1040. package/dist/nodes/root/canvas2d-node.js +0 -264
  1041. package/dist/nodes/root/canvas2d-node.js.map +0 -1
  1042. package/dist/nodes/root/provider-node.d.ts +0 -47
  1043. package/dist/nodes/root/provider-node.d.ts.map +0 -1
  1044. package/dist/nodes/root/provider-node.js +0 -63
  1045. package/dist/nodes/root/provider-node.js.map +0 -1
  1046. package/dist/nodes/root/theme-provider-node.d.ts +0 -29
  1047. package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
  1048. package/dist/nodes/root/theme-provider-node.js +0 -43
  1049. package/dist/nodes/root/theme-provider-node.js.map +0 -1
  1050. package/dist/nodes/text/default-text-style-node.d.ts +0 -103
  1051. package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
  1052. package/dist/nodes/text/default-text-style-node.js +0 -146
  1053. package/dist/nodes/text/default-text-style-node.js.map +0 -1
  1054. package/dist/nodes/text/number-format.d.ts +0 -66
  1055. package/dist/nodes/text/number-format.d.ts.map +0 -1
  1056. package/dist/nodes/text/number-format.js +0 -227
  1057. package/dist/nodes/text/number-format.js.map +0 -1
  1058. package/dist/nodes/text/number-node.d.ts +0 -94
  1059. package/dist/nodes/text/number-node.d.ts.map +0 -1
  1060. package/dist/nodes/text/number-node.js +0 -86
  1061. package/dist/nodes/text/number-node.js.map +0 -1
  1062. package/dist/nodes/text/number-pattern.d.ts +0 -51
  1063. package/dist/nodes/text/number-pattern.d.ts.map +0 -1
  1064. package/dist/nodes/text/number-pattern.js +0 -77
  1065. package/dist/nodes/text/number-pattern.js.map +0 -1
  1066. package/dist/nodes/text/richtext-node.d.ts +0 -68
  1067. package/dist/nodes/text/richtext-node.d.ts.map +0 -1
  1068. package/dist/nodes/text/richtext-node.js +0 -78
  1069. package/dist/nodes/text/richtext-node.js.map +0 -1
  1070. package/dist/nodes/text/text-base.d.ts +0 -118
  1071. package/dist/nodes/text/text-base.d.ts.map +0 -1
  1072. package/dist/nodes/text/text-base.js +0 -153
  1073. package/dist/nodes/text/text-base.js.map +0 -1
  1074. package/dist/nodes/text/text-layout.d.ts +0 -87
  1075. package/dist/nodes/text/text-layout.d.ts.map +0 -1
  1076. package/dist/nodes/text/text-layout.js +0 -368
  1077. package/dist/nodes/text/text-layout.js.map +0 -1
  1078. package/dist/nodes/text/text-node.d.ts +0 -84
  1079. package/dist/nodes/text/text-node.d.ts.map +0 -1
  1080. package/dist/nodes/text/text-node.js +0 -188
  1081. package/dist/nodes/text/text-node.js.map +0 -1
  1082. package/dist/nodes/text/text-selection.d.ts +0 -125
  1083. package/dist/nodes/text/text-selection.d.ts.map +0 -1
  1084. package/dist/nodes/text/text-selection.js +0 -209
  1085. package/dist/nodes/text/text-selection.js.map +0 -1
  1086. package/dist/nodes/three/camera-nodes.d.ts +0 -109
  1087. package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
  1088. package/dist/nodes/three/camera-nodes.js +0 -112
  1089. package/dist/nodes/three/camera-nodes.js.map +0 -1
  1090. package/dist/nodes/three/canvas3d-node.d.ts +0 -295
  1091. package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
  1092. package/dist/nodes/three/canvas3d-node.js +0 -486
  1093. package/dist/nodes/three/canvas3d-node.js.map +0 -1
  1094. package/dist/nodes/three/drawable-nodes.d.ts +0 -173
  1095. package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
  1096. package/dist/nodes/three/drawable-nodes.js +0 -284
  1097. package/dist/nodes/three/drawable-nodes.js.map +0 -1
  1098. package/dist/nodes/three/environment-nodes.d.ts +0 -106
  1099. package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
  1100. package/dist/nodes/three/environment-nodes.js +0 -134
  1101. package/dist/nodes/three/environment-nodes.js.map +0 -1
  1102. package/dist/nodes/three/geometry-nodes.d.ts +0 -197
  1103. package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
  1104. package/dist/nodes/three/geometry-nodes.js +0 -322
  1105. package/dist/nodes/three/geometry-nodes.js.map +0 -1
  1106. package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
  1107. package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
  1108. package/dist/nodes/three/grid-geometry3d.js +0 -114
  1109. package/dist/nodes/three/grid-geometry3d.js.map +0 -1
  1110. package/dist/nodes/three/group3d.d.ts +0 -23
  1111. package/dist/nodes/three/group3d.d.ts.map +0 -1
  1112. package/dist/nodes/three/group3d.js +0 -21
  1113. package/dist/nodes/three/group3d.js.map +0 -1
  1114. package/dist/nodes/three/light-nodes.d.ts +0 -120
  1115. package/dist/nodes/three/light-nodes.d.ts.map +0 -1
  1116. package/dist/nodes/three/light-nodes.js +0 -173
  1117. package/dist/nodes/three/light-nodes.js.map +0 -1
  1118. package/dist/nodes/three/mesh3d.d.ts +0 -117
  1119. package/dist/nodes/three/mesh3d.d.ts.map +0 -1
  1120. package/dist/nodes/three/mesh3d.js +0 -147
  1121. package/dist/nodes/three/mesh3d.js.map +0 -1
  1122. package/dist/nodes/three/node3d.d.ts +0 -230
  1123. package/dist/nodes/three/node3d.d.ts.map +0 -1
  1124. package/dist/nodes/three/node3d.js +0 -337
  1125. package/dist/nodes/three/node3d.js.map +0 -1
  1126. package/dist/render/descriptors/latex.d.ts +0 -6
  1127. package/dist/render/descriptors/latex.d.ts.map +0 -1
  1128. package/dist/render/descriptors/latex.js +0 -2
  1129. package/dist/render/descriptors/latex.js.map +0 -1
  1130. package/dist/tween/seekable.d.ts +0 -81
  1131. package/dist/tween/seekable.d.ts.map +0 -1
  1132. package/dist/tween/seekable.js +0 -137
  1133. package/dist/tween/seekable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,CAAC,MAAM,aAAa,GAAyC,IAAI,GAAG,CAAC;IACvE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACxC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r\n * Pre-normalized CSS named color table.\r\n *\r\n * All 148 CSS Level 4 named colors stored as `[R, G, B, A]` float tuples in\r\n * the 0–1 range. Map lookup is O(1) and avoids per-call string parsing or\r\n * floating-point division at runtime — callers just copy the tuple out.\r\n *\r\n * Source values are rounded to three decimal places (≈ 0.4 ULP error for an\r\n * 8-bit channel), which is well within display precision.\r\n */\r\n\r\nimport type { NormalizedColor } from './parser';\r\n\r\nexport const CSS_COLOR_MAP: ReadonlyMap<string, NormalizedColor> = new Map([\r\n ['aliceblue', [0.941, 0.973, 1.000, 1]],\r\n ['antiquewhite', [0.980, 0.922, 0.843, 1]],\r\n ['aqua', [0.000, 1.000, 1.000, 1]],\r\n ['aquamarine', [0.498, 1.000, 0.831, 1]],\r\n ['azure', [0.941, 1.000, 1.000, 1]],\r\n ['beige', [0.961, 0.961, 0.863, 1]],\r\n ['bisque', [1.000, 0.894, 0.769, 1]],\r\n ['black', [0.000, 0.000, 0.000, 1]],\r\n ['blanchedalmond', [1.000, 0.922, 0.804, 1]],\r\n ['blue', [0.000, 0.000, 1.000, 1]],\r\n ['blueviolet', [0.541, 0.169, 0.886, 1]],\r\n ['brown', [0.647, 0.165, 0.165, 1]],\r\n ['burlywood', [0.871, 0.722, 0.529, 1]],\r\n ['cadetblue', [0.373, 0.620, 0.627, 1]],\r\n ['chartreuse', [0.498, 1.000, 0.000, 1]],\r\n ['chocolate', [0.824, 0.412, 0.118, 1]],\r\n ['coral', [1.000, 0.498, 0.314, 1]],\r\n ['cornflowerblue', [0.392, 0.584, 0.929, 1]],\r\n ['cornsilk', [1.000, 0.973, 0.863, 1]],\r\n ['crimson', [0.863, 0.078, 0.235, 1]],\r\n ['cyan', [0.000, 1.000, 1.000, 1]],\r\n ['darkblue', [0.000, 0.000, 0.545, 1]],\r\n ['darkcyan', [0.000, 0.545, 0.545, 1]],\r\n ['darkgoldenrod', [0.722, 0.525, 0.043, 1]],\r\n ['darkgray', [0.663, 0.663, 0.663, 1]],\r\n ['darkgreen', [0.000, 0.392, 0.000, 1]],\r\n ['darkgrey', [0.663, 0.663, 0.663, 1]],\r\n ['darkkhaki', [0.741, 0.718, 0.420, 1]],\r\n ['darkmagenta', [0.545, 0.000, 0.545, 1]],\r\n ['darkolivegreen', [0.333, 0.420, 0.184, 1]],\r\n ['darkorange', [1.000, 0.549, 0.000, 1]],\r\n ['darkorchid', [0.600, 0.196, 0.800, 1]],\r\n ['darkred', [0.545, 0.000, 0.000, 1]],\r\n ['darksalmon', [0.914, 0.588, 0.478, 1]],\r\n ['darkseagreen', [0.561, 0.737, 0.561, 1]],\r\n ['darkslateblue', [0.282, 0.239, 0.545, 1]],\r\n ['darkslategray', [0.184, 0.310, 0.310, 1]],\r\n ['darkslategrey', [0.184, 0.310, 0.310, 1]],\r\n ['darkturquoise', [0.000, 0.808, 0.820, 1]],\r\n ['darkviolet', [0.580, 0.000, 0.827, 1]],\r\n ['deeppink', [1.000, 0.078, 0.576, 1]],\r\n ['deepskyblue', [0.000, 0.749, 1.000, 1]],\r\n ['dimgray', [0.412, 0.412, 0.412, 1]],\r\n ['dimgrey', [0.412, 0.412, 0.412, 1]],\r\n ['dodgerblue', [0.118, 0.565, 1.000, 1]],\r\n ['firebrick', [0.698, 0.133, 0.133, 1]],\r\n ['floralwhite', [1.000, 0.980, 0.941, 1]],\r\n ['forestgreen', [0.133, 0.545, 0.133, 1]],\r\n ['fuchsia', [1.000, 0.000, 1.000, 1]],\r\n ['gainsboro', [0.863, 0.863, 0.863, 1]],\r\n ['ghostwhite', [0.973, 0.973, 1.000, 1]],\r\n ['gold', [1.000, 0.843, 0.000, 1]],\r\n ['goldenrod', [0.855, 0.647, 0.125, 1]],\r\n ['gray', [0.502, 0.502, 0.502, 1]],\r\n ['green', [0.000, 0.502, 0.000, 1]],\r\n ['greenyellow', [0.678, 1.000, 0.184, 1]],\r\n ['grey', [0.502, 0.502, 0.502, 1]],\r\n ['honeydew', [0.941, 1.000, 0.941, 1]],\r\n ['hotpink', [1.000, 0.412, 0.706, 1]],\r\n ['indianred', [0.804, 0.361, 0.361, 1]],\r\n ['indigo', [0.294, 0.000, 0.510, 1]],\r\n ['ivory', [1.000, 1.000, 0.941, 1]],\r\n ['khaki', [0.941, 0.902, 0.549, 1]],\r\n ['lavender', [0.902, 0.902, 0.980, 1]],\r\n ['lavenderblush', [1.000, 0.941, 0.961, 1]],\r\n ['lawngreen', [0.486, 0.988, 0.000, 1]],\r\n ['lemonchiffon', [1.000, 0.980, 0.804, 1]],\r\n ['lightblue', [0.678, 0.847, 0.902, 1]],\r\n ['lightcoral', [0.941, 0.502, 0.502, 1]],\r\n ['lightcyan', [0.878, 1.000, 1.000, 1]],\r\n ['lightgoldenrodyellow', [0.980, 0.980, 0.824, 1]],\r\n ['lightgray', [0.827, 0.827, 0.827, 1]],\r\n ['lightgreen', [0.565, 0.933, 0.565, 1]],\r\n ['lightgrey', [0.827, 0.827, 0.827, 1]],\r\n ['lightpink', [1.000, 0.714, 0.757, 1]],\r\n ['lightsalmon', [1.000, 0.627, 0.478, 1]],\r\n ['lightseagreen', [0.125, 0.698, 0.667, 1]],\r\n ['lightskyblue', [0.529, 0.808, 0.980, 1]],\r\n ['lightslategray', [0.467, 0.533, 0.600, 1]],\r\n ['lightslategrey', [0.467, 0.533, 0.600, 1]],\r\n ['lightsteelblue', [0.690, 0.769, 0.871, 1]],\r\n ['lightyellow', [1.000, 1.000, 0.878, 1]],\r\n ['lime', [0.000, 1.000, 0.000, 1]],\r\n ['limegreen', [0.196, 0.804, 0.196, 1]],\r\n ['linen', [0.980, 0.941, 0.902, 1]],\r\n ['magenta', [1.000, 0.000, 1.000, 1]],\r\n ['maroon', [0.502, 0.000, 0.000, 1]],\r\n ['mediumaquamarine', [0.400, 0.804, 0.667, 1]],\r\n ['mediumblue', [0.000, 0.000, 0.804, 1]],\r\n ['mediumorchid', [0.729, 0.333, 0.827, 1]],\r\n ['mediumpurple', [0.576, 0.439, 0.859, 1]],\r\n ['mediumseagreen', [0.235, 0.702, 0.443, 1]],\r\n ['mediumslateblue', [0.482, 0.408, 0.933, 1]],\r\n ['mediumspringgreen', [0.000, 0.980, 0.604, 1]],\r\n ['mediumturquoise', [0.282, 0.820, 0.800, 1]],\r\n ['mediumvioletred', [0.780, 0.082, 0.522, 1]],\r\n ['midnightblue', [0.098, 0.098, 0.439, 1]],\r\n ['mintcream', [0.961, 1.000, 0.980, 1]],\r\n ['mistyrose', [1.000, 0.894, 0.882, 1]],\r\n ['moccasin', [1.000, 0.894, 0.710, 1]],\r\n ['navajowhite', [1.000, 0.871, 0.678, 1]],\r\n ['navy', [0.000, 0.000, 0.502, 1]],\r\n ['oldlace', [0.992, 0.961, 0.902, 1]],\r\n ['olive', [0.502, 0.502, 0.000, 1]],\r\n ['olivedrab', [0.420, 0.557, 0.137, 1]],\r\n ['orange', [1.000, 0.647, 0.000, 1]],\r\n ['orangered', [1.000, 0.271, 0.000, 1]],\r\n ['orchid', [0.855, 0.439, 0.839, 1]],\r\n ['palegoldenrod', [0.933, 0.910, 0.667, 1]],\r\n ['palegreen', [0.596, 0.984, 0.596, 1]],\r\n ['paleturquoise', [0.686, 0.933, 0.933, 1]],\r\n ['palevioletred', [0.859, 0.439, 0.576, 1]],\r\n ['papayawhip', [1.000, 0.937, 0.835, 1]],\r\n ['peachpuff', [1.000, 0.855, 0.725, 1]],\r\n ['peru', [0.804, 0.522, 0.247, 1]],\r\n ['pink', [1.000, 0.753, 0.796, 1]],\r\n ['plum', [0.867, 0.627, 0.867, 1]],\r\n ['powderblue', [0.690, 0.878, 0.902, 1]],\r\n ['purple', [0.502, 0.000, 0.502, 1]],\r\n ['rebeccapurple', [0.400, 0.200, 0.600, 1]],\r\n ['red', [1.000, 0.000, 0.000, 1]],\r\n ['rosybrown', [0.737, 0.561, 0.561, 1]],\r\n ['royalblue', [0.255, 0.412, 0.882, 1]],\r\n ['saddlebrown', [0.545, 0.271, 0.075, 1]],\r\n ['salmon', [0.980, 0.502, 0.447, 1]],\r\n ['sandybrown', [0.957, 0.643, 0.376, 1]],\r\n ['seagreen', [0.180, 0.545, 0.341, 1]],\r\n ['seashell', [1.000, 0.961, 0.933, 1]],\r\n ['sienna', [0.627, 0.322, 0.176, 1]],\r\n ['silver', [0.753, 0.753, 0.753, 1]],\r\n ['skyblue', [0.529, 0.808, 0.922, 1]],\r\n ['slateblue', [0.416, 0.353, 0.804, 1]],\r\n ['slategray', [0.439, 0.502, 0.565, 1]],\r\n ['slategrey', [0.439, 0.502, 0.565, 1]],\r\n ['snow', [1.000, 0.980, 0.980, 1]],\r\n ['springgreen', [0.000, 1.000, 0.498, 1]],\r\n ['steelblue', [0.275, 0.510, 0.706, 1]],\r\n ['tan', [0.824, 0.706, 0.549, 1]],\r\n ['teal', [0.000, 0.502, 0.502, 1]],\r\n ['thistle', [0.847, 0.749, 0.847, 1]],\r\n ['tomato', [1.000, 0.388, 0.278, 1]],\r\n ['transparent', [0.000, 0.000, 0.000, 0]],\r\n ['turquoise', [0.251, 0.878, 0.816, 1]],\r\n ['violet', [0.933, 0.510, 0.933, 1]],\r\n ['wheat', [0.961, 0.871, 0.702, 1]],\r\n ['white', [1.000, 1.000, 1.000, 1]],\r\n ['whitesmoke', [0.961, 0.961, 0.961, 1]],\r\n ['yellow', [1.000, 1.000, 0.000, 1]],\r\n ['yellowgreen', [0.604, 0.804, 0.196, 1]],\r\n]);\r\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,CAAC,MAAM,aAAa,GAAyC,IAAI,GAAG,CAAC;IACvE,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,E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,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;CAC5C,CAAC,CAAC","sourcesContent":["/**\n * Pre-normalized CSS named color table.\n *\n * All 148 CSS Level 4 named colors stored as `[R, G, B, A]` float tuples in\n * the 0–1 range. Map lookup is O(1) and avoids per-call string parsing or\n * floating-point division at runtime — callers just copy the tuple out.\n *\n * Source values are rounded to three decimal places (≈ 0.4 ULP error for an\n * 8-bit channel), which is well within display precision.\n */\n\nimport type { NormalizedColor } from './parser';\n\nexport const CSS_COLOR_MAP: ReadonlyMap<string, NormalizedColor> = new Map([\n ['aliceblue', [0.941, 0.973, 1.000, 1]],\n ['antiquewhite', [0.980, 0.922, 0.843, 1]],\n ['aqua', [0.000, 1.000, 1.000, 1]],\n ['aquamarine', [0.498, 1.000, 0.831, 1]],\n ['azure', [0.941, 1.000, 1.000, 1]],\n ['beige', [0.961, 0.961, 0.863, 1]],\n ['bisque', [1.000, 0.894, 0.769, 1]],\n ['black', [0.000, 0.000, 0.000, 1]],\n ['blanchedalmond', [1.000, 0.922, 0.804, 1]],\n ['blue', [0.000, 0.000, 1.000, 1]],\n ['blueviolet', [0.541, 0.169, 0.886, 1]],\n ['brown', [0.647, 0.165, 0.165, 1]],\n ['burlywood', [0.871, 0.722, 0.529, 1]],\n ['cadetblue', [0.373, 0.620, 0.627, 1]],\n ['chartreuse', [0.498, 1.000, 0.000, 1]],\n ['chocolate', [0.824, 0.412, 0.118, 1]],\n ['coral', [1.000, 0.498, 0.314, 1]],\n ['cornflowerblue', [0.392, 0.584, 0.929, 1]],\n ['cornsilk', [1.000, 0.973, 0.863, 1]],\n ['crimson', [0.863, 0.078, 0.235, 1]],\n ['cyan', [0.000, 1.000, 1.000, 1]],\n ['darkblue', [0.000, 0.000, 0.545, 1]],\n ['darkcyan', [0.000, 0.545, 0.545, 1]],\n ['darkgoldenrod', [0.722, 0.525, 0.043, 1]],\n ['darkgray', [0.663, 0.663, 0.663, 1]],\n ['darkgreen', [0.000, 0.392, 0.000, 1]],\n ['darkgrey', [0.663, 0.663, 0.663, 1]],\n ['darkkhaki', [0.741, 0.718, 0.420, 1]],\n ['darkmagenta', [0.545, 0.000, 0.545, 1]],\n ['darkolivegreen', [0.333, 0.420, 0.184, 1]],\n ['darkorange', [1.000, 0.549, 0.000, 1]],\n ['darkorchid', [0.600, 0.196, 0.800, 1]],\n ['darkred', [0.545, 0.000, 0.000, 1]],\n ['darksalmon', [0.914, 0.588, 0.478, 1]],\n ['darkseagreen', [0.561, 0.737, 0.561, 1]],\n ['darkslateblue', [0.282, 0.239, 0.545, 1]],\n ['darkslategray', [0.184, 0.310, 0.310, 1]],\n ['darkslategrey', [0.184, 0.310, 0.310, 1]],\n ['darkturquoise', [0.000, 0.808, 0.820, 1]],\n ['darkviolet', [0.580, 0.000, 0.827, 1]],\n ['deeppink', [1.000, 0.078, 0.576, 1]],\n ['deepskyblue', [0.000, 0.749, 1.000, 1]],\n ['dimgray', [0.412, 0.412, 0.412, 1]],\n ['dimgrey', [0.412, 0.412, 0.412, 1]],\n ['dodgerblue', [0.118, 0.565, 1.000, 1]],\n ['firebrick', [0.698, 0.133, 0.133, 1]],\n ['floralwhite', [1.000, 0.980, 0.941, 1]],\n ['forestgreen', [0.133, 0.545, 0.133, 1]],\n ['fuchsia', [1.000, 0.000, 1.000, 1]],\n ['gainsboro', [0.863, 0.863, 0.863, 1]],\n ['ghostwhite', [0.973, 0.973, 1.000, 1]],\n ['gold', [1.000, 0.843, 0.000, 1]],\n ['goldenrod', [0.855, 0.647, 0.125, 1]],\n ['gray', [0.502, 0.502, 0.502, 1]],\n ['green', [0.000, 0.502, 0.000, 1]],\n ['greenyellow', [0.678, 1.000, 0.184, 1]],\n ['grey', [0.502, 0.502, 0.502, 1]],\n ['honeydew', [0.941, 1.000, 0.941, 1]],\n ['hotpink', [1.000, 0.412, 0.706, 1]],\n ['indianred', [0.804, 0.361, 0.361, 1]],\n ['indigo', [0.294, 0.000, 0.510, 1]],\n ['ivory', [1.000, 1.000, 0.941, 1]],\n ['khaki', [0.941, 0.902, 0.549, 1]],\n ['lavender', [0.902, 0.902, 0.980, 1]],\n ['lavenderblush', [1.000, 0.941, 0.961, 1]],\n ['lawngreen', [0.486, 0.988, 0.000, 1]],\n ['lemonchiffon', [1.000, 0.980, 0.804, 1]],\n ['lightblue', [0.678, 0.847, 0.902, 1]],\n ['lightcoral', [0.941, 0.502, 0.502, 1]],\n ['lightcyan', [0.878, 1.000, 1.000, 1]],\n ['lightgoldenrodyellow', [0.980, 0.980, 0.824, 1]],\n ['lightgray', [0.827, 0.827, 0.827, 1]],\n ['lightgreen', [0.565, 0.933, 0.565, 1]],\n ['lightgrey', [0.827, 0.827, 0.827, 1]],\n ['lightpink', [1.000, 0.714, 0.757, 1]],\n ['lightsalmon', [1.000, 0.627, 0.478, 1]],\n ['lightseagreen', [0.125, 0.698, 0.667, 1]],\n ['lightskyblue', [0.529, 0.808, 0.980, 1]],\n ['lightslategray', [0.467, 0.533, 0.600, 1]],\n ['lightslategrey', [0.467, 0.533, 0.600, 1]],\n ['lightsteelblue', [0.690, 0.769, 0.871, 1]],\n ['lightyellow', [1.000, 1.000, 0.878, 1]],\n ['lime', [0.000, 1.000, 0.000, 1]],\n ['limegreen', [0.196, 0.804, 0.196, 1]],\n ['linen', [0.980, 0.941, 0.902, 1]],\n ['magenta', [1.000, 0.000, 1.000, 1]],\n ['maroon', [0.502, 0.000, 0.000, 1]],\n ['mediumaquamarine', [0.400, 0.804, 0.667, 1]],\n ['mediumblue', [0.000, 0.000, 0.804, 1]],\n ['mediumorchid', [0.729, 0.333, 0.827, 1]],\n ['mediumpurple', [0.576, 0.439, 0.859, 1]],\n ['mediumseagreen', [0.235, 0.702, 0.443, 1]],\n ['mediumslateblue', [0.482, 0.408, 0.933, 1]],\n ['mediumspringgreen', [0.000, 0.980, 0.604, 1]],\n ['mediumturquoise', [0.282, 0.820, 0.800, 1]],\n ['mediumvioletred', [0.780, 0.082, 0.522, 1]],\n ['midnightblue', [0.098, 0.098, 0.439, 1]],\n ['mintcream', [0.961, 1.000, 0.980, 1]],\n ['mistyrose', [1.000, 0.894, 0.882, 1]],\n ['moccasin', [1.000, 0.894, 0.710, 1]],\n ['navajowhite', [1.000, 0.871, 0.678, 1]],\n ['navy', [0.000, 0.000, 0.502, 1]],\n ['oldlace', [0.992, 0.961, 0.902, 1]],\n ['olive', [0.502, 0.502, 0.000, 1]],\n ['olivedrab', [0.420, 0.557, 0.137, 1]],\n ['orange', [1.000, 0.647, 0.000, 1]],\n ['orangered', [1.000, 0.271, 0.000, 1]],\n ['orchid', [0.855, 0.439, 0.839, 1]],\n ['palegoldenrod', [0.933, 0.910, 0.667, 1]],\n ['palegreen', [0.596, 0.984, 0.596, 1]],\n ['paleturquoise', [0.686, 0.933, 0.933, 1]],\n ['palevioletred', [0.859, 0.439, 0.576, 1]],\n ['papayawhip', [1.000, 0.937, 0.835, 1]],\n ['peachpuff', [1.000, 0.855, 0.725, 1]],\n ['peru', [0.804, 0.522, 0.247, 1]],\n ['pink', [1.000, 0.753, 0.796, 1]],\n ['plum', [0.867, 0.627, 0.867, 1]],\n ['powderblue', [0.690, 0.878, 0.902, 1]],\n ['purple', [0.502, 0.000, 0.502, 1]],\n ['rebeccapurple', [0.400, 0.200, 0.600, 1]],\n ['red', [1.000, 0.000, 0.000, 1]],\n ['rosybrown', [0.737, 0.561, 0.561, 1]],\n ['royalblue', [0.255, 0.412, 0.882, 1]],\n ['saddlebrown', [0.545, 0.271, 0.075, 1]],\n ['salmon', [0.980, 0.502, 0.447, 1]],\n ['sandybrown', [0.957, 0.643, 0.376, 1]],\n ['seagreen', [0.180, 0.545, 0.341, 1]],\n ['seashell', [1.000, 0.961, 0.933, 1]],\n ['sienna', [0.627, 0.322, 0.176, 1]],\n ['silver', [0.753, 0.753, 0.753, 1]],\n ['skyblue', [0.529, 0.808, 0.922, 1]],\n ['slateblue', [0.416, 0.353, 0.804, 1]],\n ['slategray', [0.439, 0.502, 0.565, 1]],\n ['slategrey', [0.439, 0.502, 0.565, 1]],\n ['snow', [1.000, 0.980, 0.980, 1]],\n ['springgreen', [0.000, 1.000, 0.498, 1]],\n ['steelblue', [0.275, 0.510, 0.706, 1]],\n ['tan', [0.824, 0.706, 0.549, 1]],\n ['teal', [0.000, 0.502, 0.502, 1]],\n ['thistle', [0.847, 0.749, 0.847, 1]],\n ['tomato', [1.000, 0.388, 0.278, 1]],\n ['transparent', [0.000, 0.000, 0.000, 0]],\n ['turquoise', [0.251, 0.878, 0.816, 1]],\n ['violet', [0.933, 0.510, 0.933, 1]],\n ['wheat', [0.961, 0.871, 0.702, 1]],\n ['white', [1.000, 1.000, 1.000, 1]],\n ['whitesmoke', [0.961, 0.961, 0.961, 1]],\n ['yellow', [1.000, 1.000, 0.000, 1]],\n ['yellowgreen', [0.604, 0.804, 0.196, 1]],\n]);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,iFAAiF;AAEjF,qEAAqE;AACrE,SAAS,WAAW,CAAC,CAAS;IAC1B,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAC7E,CAAC;AAED,iEAAiE;AACjE,SAAS,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC5D,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW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MAAM,GACR,eAAe,CAAC,GAAG,CAAC;QACpB,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,UAAU,CAAC,GAAG,CAAC;QACf,UAAU,CAAC,GAAG,CAAC;QACf,CAAC,OAAO,CAAC,IAAI,CAAC,8CAA8C,MAAM,yBAAyB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAoB,CAAC,CAAC;IACnI,2EAA2E;IAC3E,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/**\r\n * CSS color string parser → normalized [R, G, B, A] float tuple.\r\n *\r\n * Supported formats:\r\n * - Named colors (CSS Level 4, 148 entries) and theme aliases via {@link setTheme}\r\n * - Hex: `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA`\r\n * - `rgb()` / `rgba()` — legacy comma and modern space/slash syntax\r\n * - `hsl()` / `hsla()`\r\n * - `lab()`, `lch()`\r\n * - `oklab()`, `oklch()`\r\n * - Tailwind-style opacity suffix: `\"white/10\"`, `\"primary/90\"` (percent 0–100)\r\n *\r\n * All output values are in the linear 0–1 range suitable for WebGL uniforms.\r\n * Named-color lookup is O(1); all other formats are parsed with lightweight\r\n * regex — no DOM, no `getComputedStyle`.\r\n */\r\n\r\nimport { CSS_COLOR_MAP } from './constants';\r\n\r\n/** Normalized RGBA color: `[red, green, blue, alpha]` each in the 0–1 range. */\r\nexport type NormalizedColor = [number, number, number, number];\r\n\r\n/** Loose color input accepted by prop interfaces — CSS string or pre-normalized tuple. */\r\nexport type Color = string | NormalizedColor;\r\n\r\n// ── Color space helpers ───────────────────────────────────────────────────────\r\n\r\n/** Applies the sRGB gamma curve to a single linear-light channel. */\r\nfunction gammaEncode(c: number): number {\r\n c = Math.max(0, Math.min(1, c));\r\n return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;\r\n}\r\n\r\n/** Converts a linear-light sRGB triple to gamma-encoded sRGB. */\r\nfunction linearToSrgb(r: number, g: number, b: number, a: number): NormalizedColor {\r\n return [gammaEncode(r), gammaEncode(g), gammaEncode(b), a];\r\n}\r\n\r\n/** Bradford-adapted XYZ D65 → linear-light sRGB matrix (IEC 61966-2-1). */\r\nfunction xyzD65ToLinearSrgb(X: number, Y: number, Z: number): [number, number, number] {\r\n return [\r\n 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,\r\n -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z,\r\n 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z,\r\n ];\r\n}\r\n\r\n// ── Argument parser ───────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Splits the inner content of a CSS color function into exactly three channel\r\n * tokens and an alpha value. Handles the slash-alpha syntax used by modern\r\n * `rgb()` / `hsl()` as well as the legacy comma-alpha form used by `rgba()` /\r\n * `hsla()`; both go through {@link readAlpha}, so a percentage alpha means the\r\n * same in either. Returns `null` for the wrong number of arguments or an alpha\r\n * that is not a number, which {@link parseColor} reports as an unsupported\r\n * format.\r\n */\r\nfunction parseArgs(inner: string): { tokens: string[]; alpha: number } | null {\r\n const slashIdx = inner.lastIndexOf('/');\r\n let alphaToken: string | undefined;\r\n let colorPart = inner;\r\n if (slashIdx !== -1) {\r\n alphaToken = inner.slice(slashIdx + 1).trim();\r\n colorPart = inner.slice(0, slashIdx);\r\n }\r\n const tokens = colorPart.trim().split(/[\\s,]+/).filter(Boolean);\r\n if (tokens.length === 4 && alphaToken === undefined) alphaToken = tokens.pop();\r\n if (tokens.length !== 3) return null;\r\n const alpha = alphaToken === undefined ? 1 : readAlpha(alphaToken);\r\n if (!Number.isFinite(alpha)) return null;\r\n return { tokens, alpha };\r\n}\r\n\r\n/** Reads an alpha token: a number, or a percentage (`50%` is 0.5). `NaN` if neither. */\r\nfunction readAlpha(token: string): number {\r\n return token.endsWith('%') ? Number(token.slice(0, -1)) / 100 : Number(token);\r\n}\r\n\r\n/** Reads a channel token as a number, scaling a percentage to `percentScale` and a bare number by `1 / numberScale`. `NaN` if it is not a number. */\r\nfunction readChannel(token: string, percentScale: number, numberScale = 1): number {\r\n return token.endsWith('%') ? (Number(token.slice(0, -1)) / 100) * percentScale : Number(token) / numberScale;\r\n}\r\n\r\n/** Degrees per CSS angle unit (`deg`, `grad`, `rad`, `turn`). */\r\nconst ANGLE_UNIT_DEGREES: Record<string, number> = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };\r\n\r\n/** Reads a CSS hue/angle token to degrees. A bare number is degrees; an unknown unit or a non-number is `NaN`. */\r\nfunction readHue(token: string): number {\r\n const m = token.match(/^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(deg|grad|rad|turn)?$/);\r\n if (!m) return NaN;\r\n return Number(m[1]) * ANGLE_UNIT_DEGREES[m[2] ?? 'deg'];\r\n}\r\n\r\n/** Returns `color` when every component is finite, otherwise `null` (unsupported format). */\r\nfunction finiteColor(color: NormalizedColor): NormalizedColor | null {\r\n return color.every(Number.isFinite) ? color : null;\r\n}\r\n\r\n// ── Per-format parsers ────────────────────────────────────────────────────────\r\n\r\n// Use a globalThis key so multiple bundled copies of this module (e.g. the\r\n// prebuilt player bundle and the Vite-compiled user code) share one map.\r\nconst _g = globalThis as Record<string, unknown>;\r\nif (!_g.__msThemeMap) _g.__msThemeMap = new Map<string, NormalizedColor>();\r\nconst THEME_COLOR_MAP = _g.__msThemeMap as Map<string, NormalizedColor>;\r\n\r\n// Typography presets ride the same shared-global pattern as the color map, so\r\n// the prebuilt player bundle and the user's Vite-compiled code read one registry\r\n// — `setTheme` (called once per build at the player/headless entry points)\r\n// populates both before any scene generator runs.\r\nif (!_g.__msTypographyMap) _g.__msTypographyMap = new Map<string, Record<string, unknown>>();\r\nconst TYPOGRAPHY_MAP = _g.__msTypographyMap as Map<string, Record<string, unknown>>;\r\n\r\n// Structural mirror of `@/project/config`'s `Theme` (and its color token shape),\r\n// declared locally so this module stays a leaf — `config.ts` imports `Color`\r\n// from here, so importing `Theme` back would be a cycle. The project's `Theme`\r\n// is structurally compatible, so `setTheme(config.theme)` just works.\r\n// `typography` presets are stored opaquely (the parser never reads their fields),\r\n// so the value type is the loose `object` — this stays assignable from `Theme`'s\r\n// `TypographyPreset` (a `TextStyle` interface, which lacks an implicit string\r\n// index signature and so is not a `Record<string, unknown>`).\r\ntype ColorTokenInput = Color | { [key: string]: ColorTokenInput };\r\ninterface ThemeInput {\r\n colors?: Record<string, ColorTokenInput>;\r\n typography?: Record<string, object>;\r\n}\r\n\r\n/**\r\n * Recursively flatten nested color groups into dash-joined, lowercased keys\r\n * (`{ brand: { 500: '#…' } }` → `brand-500`), parsing each leaf to a normalized\r\n * color. Arrays are leaves (a pre-normalized `[R,G,B,A]` tuple); strings are\r\n * leaves; only plain objects recurse.\r\n */\r\nfunction flattenColors(\r\n tokens: Record<string, ColorTokenInput> | undefined,\r\n prefix: string,\r\n out: Map<string, NormalizedColor>,\r\n): void {\r\n if (!tokens) return;\r\n for (const [name, token] of Object.entries(tokens)) {\r\n const key = prefix ? `${prefix}-${name}` : name;\r\n if (token != null && !Array.isArray(token) && typeof token === 'object') {\r\n flattenColors(token as Record<string, ColorTokenInput>, key, out);\r\n } else {\r\n const color = token as Color;\r\n out.set(key.toLowerCase(), Array.isArray(color) ? (color as NormalizedColor) : parseColor(color));\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Registers a project theme: named colors (referenceable by name in any color\r\n * string) and typography presets (selected via a `Text`/`RichText` `variant`).\r\n *\r\n * Color entries take precedence over CSS named colors; nested color groups are\r\n * flattened to dash-joined names (`{ brand: { 500: … } }` → `brand-500`). Call\r\n * with no argument, `null`, or an empty object to clear both registries — a\r\n * document's own `theme` is optional, and a host reading one out of storage\r\n * (a database column, a JSON file) typically gets that absence back as `null`\r\n * rather than `undefined`.\r\n *\r\n * The `default` typography key is reserved: it's read directly by\r\n * {@link applyTextDefaults} (not just via `variant`) and applied to every\r\n * `Text`/`RichText` as a project-wide base style.\r\n *\r\n * @example\r\n * setTheme({\r\n * colors: { brand: \"#ff6b35\", accent: { 500: \"oklch(70% 0.2 145)\" } },\r\n * typography: {\r\n * default: { fontFamily: \"Inter\", fontSize: 32 },\r\n * header: { fontSize: 96, fontWeight: 700 },\r\n * },\r\n * });\r\n * // Later: fill: \"brand\", fill: \"accent-500\", Text({ variant: \"header\" })\r\n */\r\nexport function setTheme(input: ThemeInput | null = {}): void {\r\n const theme = input ?? {};\r\n THEME_COLOR_MAP.clear();\r\n TYPOGRAPHY_MAP.clear();\r\n flattenColors(theme.colors, '', THEME_COLOR_MAP);\r\n if (theme.typography) {\r\n for (const [name, preset] of Object.entries(theme.typography)) {\r\n // Stored opaquely; `applyTextDefaults` reads fields by key. The `object`\r\n // preset is widened to the readable record shape at this boundary only.\r\n TYPOGRAPHY_MAP.set(name.toLowerCase(), preset as Record<string, unknown>);\r\n }\r\n }\r\n}\r\n\r\n/** Looks up a registered typography preset by variant name (case-insensitive);\r\n * `undefined` if none is registered. */\r\nexport function getTypographyPreset(name: string): Record<string, unknown> | undefined {\r\n return TYPOGRAPHY_MAP.get(name.toLowerCase());\r\n}\r\n\r\n/** Looks up a color name in the theme map first, then the CSS named-color table. */\r\nfunction parseNamedColor(str: string): NormalizedColor | null {\r\n return THEME_COLOR_MAP.get(str) ?? CSS_COLOR_MAP.get(str) ?? null;\r\n}\r\n\r\n/** Parses `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` hex strings. */\r\nfunction parseHex(str: string): NormalizedColor | null {\r\n if (!str.startsWith('#')) return null;\r\n let hex = str.slice(1);\r\n if (!/^[0-9a-f]+$/.test(hex)) return null;\r\n // Expand shorthand: #RGB → #RRGGBB, #RGBA → #RRGGBBAA\r\n if (hex.length === 3 || hex.length === 4)\r\n hex = hex.split('').map(c => c + c).join('');\r\n const int = parseInt(hex, 16);\r\n if (hex.length === 6)\r\n return [(int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255, 1];\r\n if (hex.length === 8)\r\n return [(int >>> 24) / 255, (int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255];\r\n return null;\r\n}\r\n\r\n/** Parses `rgb()` / `rgba()` — both percentage and 0-255 channel forms. */\r\nfunction parseRgb(str: string): NormalizedColor | null {\r\n const m = str.match(/^rgba?\\s*\\((.+)\\)/);\r\n if (!m) return null;\r\n const args = parseArgs(m[1]);\r\n if (!args) return null;\r\n const [r, g, b] = args.tokens.map(t => readChannel(t, 1, 255));\r\n return finiteColor([r, g, b, args.alpha]);\r\n}\r\n\r\n/** Parses `hsl()` / `hsla()`. The hue takes `deg`, `grad`, `rad` or `turn` (a bare number is degrees). */\r\nfunction parseHsl(str: string): NormalizedColor | null {\r\n const m = str.match(/^hsla?\\s*\\((.+)\\)/);\r\n if (!m) return null;\r\n const args = parseArgs(m[1]);\r\n if (!args) return null;\r\n const h = readHue(args.tokens[0]);\r\n const s = parseFloat(args.tokens[1]) / 100;\r\n const l = parseFloat(args.tokens[2]) / 100;\r\n const k = (n: number) => (((n + h / 30) % 12) + 12) % 12;\r\n const chroma = s * Math.min(l, 1 - l);\r\n const f = (n: number) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\r\n return finiteColor([f(0), f(8), f(4), args.alpha]);\r\n}\r\n\r\n/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */\r\nfunction parseLab(str: string): NormalizedColor | null {\r\n const m = str.match(/^lab\\s*\\((.+)\\)/);\r\n if (!m) return null;\r\n const args = parseArgs(m[1]);\r\n if (!args) return null;\r\n const L = parseFloat(args.tokens[0]);\r\n const a = parseFloat(args.tokens[1]);\r\n const b = parseFloat(args.tokens[2]);\r\n return finiteColor(labToNormalized(L, a, b, args.alpha));\r\n}\r\n\r\n/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */\r\nfunction parseLch(str: string): NormalizedColor | null {\r\n const m = str.match(/^lch\\s*\\((.+)\\)/);\r\n if (!m) return null;\r\n const args = parseArgs(m[1]);\r\n if (!args) return null;\r\n const L = parseFloat(args.tokens[0]);\r\n const C = parseFloat(args.tokens[1]);\r\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\r\n return finiteColor(labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\r\n}\r\n\r\n/** Parses `oklab(L a b)` (Oklab perceptually uniform color space). */\r\nfunction parseOklab(str: string): NormalizedColor | null {\r\n const m = str.match(/^oklab\\s*\\((.+)\\)/);\r\n if (!m) return null;\r\n const args = parseArgs(m[1]);\r\n if (!args) return null;\r\n // L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.\r\n const [L, a, b] = [readChannel(args.tokens[0], 1), readChannel(args.tokens[1], 0.4), readChannel(args.tokens[2], 0.4)];\r\n return finiteColor(oklabToNormalized(L, a, b, args.alpha));\r\n}\r\n\r\n/** Parses `oklch(L C H)` (polar form of Oklab). */\r\nfunction parseOklch(str: string): NormalizedColor | null {\r\n const m = str.match(/^oklch\\s*\\((.+)\\)/);\r\n if (!m) return null;\r\n const args = parseArgs(m[1]);\r\n if (!args) return null;\r\n // L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).\r\n const L = readChannel(args.tokens[0], 1);\r\n const C = readChannel(args.tokens[1], 0.4);\r\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\r\n return finiteColor(oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\r\n}\r\n\r\n// ── CIE conversion helpers ────────────────────────────────────────────────────\r\n\r\n/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */\r\nfunction labToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\r\n const e = 0.008856, k = 903.3;\r\n const fy = (L + 16) / 116;\r\n const fx = a / 500 + fy;\r\n const fz = fy - b / 200;\r\n const X = (fx ** 3 > e ? fx ** 3 : (116 * fx - 16) / k) * 0.95047;\r\n const Y = L > k * e ? ((L + 16) / 116) ** 3 : L / k;\r\n const Z = (fz ** 3 > e ? fz ** 3 : (116 * fz - 16) / k) * 1.08883;\r\n const [lr, lg, lb] = xyzD65ToLinearSrgb(X, Y, Z);\r\n return linearToSrgb(lr, lg, lb, alpha);\r\n}\r\n\r\n/** Converts Oklab to a normalized sRGB color using the standard Björn Ottosson matrix. */\r\nfunction oklabToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\r\n const l_ = L + 0.3963377774 * a + 0.2158037573 * b;\r\n const m_ = L - 0.1055613458 * a - 0.0638541728 * b;\r\n const s_ = L - 0.0894841775 * a - 1.2914855480 * b;\r\n const l = l_ ** 3, m = m_ ** 3, s = s_ ** 3;\r\n return linearToSrgb(\r\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\r\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\r\n -0.0041960863 * l - 0.7034186147 * m + 1.6956065236 * s,\r\n alpha,\r\n );\r\n}\r\n\r\n// ── Opacity suffix ─────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Splits a Tailwind-style opacity suffix (`\"white/10\"`, `\"primary/90\"`) off the\r\n * end of a color string. The suffix is a slash followed by a number (optionally\r\n * with a `%`) interpreted as a percentage 0–100.\r\n *\r\n * Only a trailing slash that sits *outside* any parentheses is treated as an\r\n * opacity modifier, so the internal slash-alpha syntax of `rgb()` / `hsl()`\r\n * (e.g. `rgb(0 0 255 / 0.25)`) is left untouched.\r\n *\r\n * @returns the bare color string and the opacity fraction (1 when absent).\r\n */\r\nfunction splitOpacitySuffix(str: string): { color: string; opacity: number } {\r\n if (str.includes('(')) return { color: str, opacity: 1 };\r\n const m = str.match(/^(.*[^/])\\/\\s*([\\d.]+)%?$/);\r\n if (!m) return { color: str, opacity: 1 };\r\n const pct = parseFloat(m[2]);\r\n if (!Number.isFinite(pct)) return { color: str, opacity: 1 };\r\n return { color: m[1].trim(), opacity: Math.max(0, Math.min(1, pct / 100)) };\r\n}\r\n\r\n// ── Main entry point ──────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Parses a CSS color string into a normalized `[R, G, B, A]` array (0.0–1.0).\r\n *\r\n * Supported formats: named colors (CSS + theme), hex, rgb/rgba, hsl/hsla,\r\n * lab, lch, oklab, oklch, plus a Tailwind-style opacity suffix (`\"white/10\"`).\r\n * Falls back to opaque black and logs a warning for unrecognised input.\r\n */\r\nexport function parseColor(cssStr: string): NormalizedColor {\r\n const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());\r\n const parsed =\r\n parseNamedColor(str) ??\r\n parseHex(str) ??\r\n parseRgb(str) ??\r\n parseHsl(str) ??\r\n parseLab(str) ??\r\n parseLch(str) ??\r\n parseOklab(str) ??\r\n parseOklch(str) ??\r\n (console.warn(`[Motion Engine] Unsupported color format: \"${cssStr}\". Defaulting to black.`), [0, 0, 0, 1] as NormalizedColor);\r\n // Clone before applying opacity: named/theme lookups return cached tuples.\r\n if (opacity !== 1) return [parsed[0], parsed[1], parsed[2], parsed[3] * opacity];\r\n return parsed;\r\n}\r\n"]}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,iFAAiF;AAEjF,qEAAqE;AACrE,SAAS,WAAW,CAAC,CAAS;IAC1B,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAA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,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;AAChF,CAAC;AAED,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IACrC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAChF,MAAM,MAAM,GACR,eAAe,CAAC,GAAG,CAAC;QACpB,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,UAAU,CAAC,GAAG,CAAC;QACf,UAAU,CAAC,GAAG,CAAC;QACf,CAAC,OAAO,CAAC,IAAI,CAAC,8CAA8C,MAAM,yBAAyB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAoB,CAAC,CAAC;IACnI,2EAA2E;IAC3E,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/**\n * CSS color string parser → normalized [R, G, B, A] float tuple.\n *\n * Supported formats:\n * - Named colors (CSS Level 4, 148 entries) and theme aliases via {@link setTheme}\n * - Hex: `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA`\n * - `rgb()` / `rgba()` — legacy comma and modern space/slash syntax\n * - `hsl()` / `hsla()`\n * - `lab()`, `lch()`\n * - `oklab()`, `oklch()`\n * - Tailwind-style opacity suffix: `\"white/10\"`, `\"primary/90\"` (percent 0–100)\n *\n * All output values are in the linear 0–1 range suitable for WebGL uniforms.\n * Named-color lookup is O(1); all other formats are parsed with lightweight\n * regex — no DOM, no `getComputedStyle`.\n */\n\nimport { CSS_COLOR_MAP } from './constants';\n\n/** Normalized RGBA color: `[red, green, blue, alpha]` each in the 0–1 range. */\nexport type NormalizedColor = [number, number, number, number];\n\n/** Loose color input accepted by prop interfaces — CSS string or pre-normalized tuple. */\nexport type Color = string | NormalizedColor;\n\n// ── Color space helpers ───────────────────────────────────────────────────────\n\n/** Applies the sRGB gamma curve to a single linear-light channel. */\nfunction gammaEncode(c: number): number {\n c = Math.max(0, Math.min(1, c));\n return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;\n}\n\n/** Converts a linear-light sRGB triple to gamma-encoded sRGB. */\nfunction linearToSrgb(r: number, g: number, b: number, a: number): NormalizedColor {\n return [gammaEncode(r), gammaEncode(g), gammaEncode(b), a];\n}\n\n/** Bradford-adapted XYZ D65 → linear-light sRGB matrix (IEC 61966-2-1). */\nfunction xyzD65ToLinearSrgb(X: number, Y: number, Z: number): [number, number, number] {\n return [\n 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,\n -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z,\n 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z,\n ];\n}\n\n// ── Argument parser ───────────────────────────────────────────────────────────\n\n/**\n * Splits the inner content of a CSS color function into exactly three channel\n * tokens and an alpha value. Handles the slash-alpha syntax used by modern\n * `rgb()` / `hsl()` as well as the legacy comma-alpha form used by `rgba()` /\n * `hsla()`; both go through {@link readAlpha}, so a percentage alpha means the\n * same in either. Returns `null` for the wrong number of arguments or an alpha\n * that is not a number, which {@link parseColor} reports as an unsupported\n * format.\n */\nfunction parseArgs(inner: string): { tokens: string[]; alpha: number } | null {\n const slashIdx = inner.lastIndexOf('/');\n let alphaToken: string | undefined;\n let colorPart = inner;\n if (slashIdx !== -1) {\n alphaToken = inner.slice(slashIdx + 1).trim();\n colorPart = inner.slice(0, slashIdx);\n }\n const tokens = colorPart.trim().split(/[\\s,]+/).filter(Boolean);\n if (tokens.length === 4 && alphaToken === undefined) alphaToken = tokens.pop();\n if (tokens.length !== 3) return null;\n const alpha = alphaToken === undefined ? 1 : readAlpha(alphaToken);\n if (!Number.isFinite(alpha)) return null;\n return { tokens, alpha };\n}\n\n/** Reads an alpha token: a number, or a percentage (`50%` is 0.5). `NaN` if neither. */\nfunction readAlpha(token: string): number {\n return token.endsWith('%') ? Number(token.slice(0, -1)) / 100 : Number(token);\n}\n\n/** Reads a channel token as a number, scaling a percentage to `percentScale` and a bare number by `1 / numberScale`. `NaN` if it is not a number. */\nfunction readChannel(token: string, percentScale: number, numberScale = 1): number {\n return token.endsWith('%') ? (Number(token.slice(0, -1)) / 100) * percentScale : Number(token) / numberScale;\n}\n\n/** Degrees per CSS angle unit (`deg`, `grad`, `rad`, `turn`). */\nconst ANGLE_UNIT_DEGREES: Record<string, number> = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };\n\n/** Reads a CSS hue/angle token to degrees. A bare number is degrees; an unknown unit or a non-number is `NaN`. */\nfunction readHue(token: string): number {\n const m = token.match(/^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(deg|grad|rad|turn)?$/);\n if (!m) return NaN;\n return Number(m[1]) * ANGLE_UNIT_DEGREES[m[2] ?? 'deg'];\n}\n\n/** Returns `color` when every component is finite, otherwise `null` (unsupported format). */\nfunction finiteColor(color: NormalizedColor): NormalizedColor | null {\n return color.every(Number.isFinite) ? color : null;\n}\n\n// ── Per-format parsers ────────────────────────────────────────────────────────\n\n// Use a globalThis key so multiple bundled copies of this module (e.g. the\n// prebuilt player bundle and the Vite-compiled user code) share one map.\nconst _g = globalThis as Record<string, unknown>;\nif (!_g.__msThemeMap) _g.__msThemeMap = new Map<string, NormalizedColor>();\nconst THEME_COLOR_MAP = _g.__msThemeMap as Map<string, NormalizedColor>;\n\n// Typography presets ride the same shared-global pattern as the color map, so\n// the prebuilt player bundle and the user's Vite-compiled code read one registry\n// — `setTheme` (called once per build at the player/headless entry points)\n// populates both before any scene generator runs.\nif (!_g.__msTypographyMap) _g.__msTypographyMap = new Map<string, Record<string, unknown>>();\nconst TYPOGRAPHY_MAP = _g.__msTypographyMap as Map<string, Record<string, unknown>>;\n\n// Structural mirror of `@/project/config`'s `Theme` (and its color token shape),\n// declared locally so this module stays a leaf — `config.ts` imports `Color`\n// from here, so importing `Theme` back would be a cycle. The project's `Theme`\n// is structurally compatible, so `setTheme(config.theme)` just works.\n// `typography` presets are stored opaquely (the parser never reads their fields),\n// so the value type is the loose `object` — this stays assignable from `Theme`'s\n// `TypographyPreset` (a `TextStyle` interface, which lacks an implicit string\n// index signature and so is not a `Record<string, unknown>`).\ntype ColorTokenInput = Color | { [key: string]: ColorTokenInput };\ninterface ThemeInput {\n colors?: Record<string, ColorTokenInput>;\n typography?: Record<string, object>;\n}\n\n/**\n * Recursively flatten nested color groups into dash-joined, lowercased keys\n * (`{ brand: { 500: '#…' } }` → `brand-500`), parsing each leaf to a normalized\n * color. Arrays are leaves (a pre-normalized `[R,G,B,A]` tuple); strings are\n * leaves; only plain objects recurse.\n */\nfunction flattenColors(\n tokens: Record<string, ColorTokenInput> | undefined,\n prefix: string,\n out: Map<string, NormalizedColor>,\n): void {\n if (!tokens) return;\n for (const [name, token] of Object.entries(tokens)) {\n const key = prefix ? `${prefix}-${name}` : name;\n if (token != null && !Array.isArray(token) && typeof token === 'object') {\n flattenColors(token as Record<string, ColorTokenInput>, key, out);\n } else {\n const color = token as Color;\n out.set(key.toLowerCase(), Array.isArray(color) ? (color as NormalizedColor) : parseColor(color));\n }\n }\n}\n\n/**\n * Registers a project theme: named colors (referenceable by name in any color\n * string) and typography presets (selected via a `Text`/`RichText` `variant`).\n *\n * Color entries take precedence over CSS named colors; nested color groups are\n * flattened to dash-joined names (`{ brand: { 500: … } }` → `brand-500`). Call\n * with no argument, `null`, or an empty object to clear both registries — a\n * document's own `theme` is optional, and a host reading one out of storage\n * (a database column, a JSON file) typically gets that absence back as `null`\n * rather than `undefined`.\n *\n * The `default` typography key is reserved: it's read directly by\n * {@link applyTextDefaults} (not just via `variant`) and applied to every\n * `Text`/`RichText` as a project-wide base style.\n *\n * @example\n * setTheme({\n * colors: { brand: \"#ff6b35\", accent: { 500: \"oklch(70% 0.2 145)\" } },\n * typography: {\n * default: { fontFamily: \"Inter\", fontSize: 32 },\n * header: { fontSize: 96, fontWeight: 700 },\n * },\n * });\n * // Later: fill: \"brand\", fill: \"accent-500\", Text({ variant: \"header\" })\n */\nexport function setTheme(input: ThemeInput | null = {}): void {\n const theme = input ?? {};\n THEME_COLOR_MAP.clear();\n TYPOGRAPHY_MAP.clear();\n flattenColors(theme.colors, '', THEME_COLOR_MAP);\n if (theme.typography) {\n for (const [name, preset] of Object.entries(theme.typography)) {\n // Stored opaquely; `applyTextDefaults` reads fields by key. The `object`\n // preset is widened to the readable record shape at this boundary only.\n TYPOGRAPHY_MAP.set(name.toLowerCase(), preset as Record<string, unknown>);\n }\n }\n}\n\n/** Looks up a registered typography preset by variant name (case-insensitive);\n * `undefined` if none is registered. */\nexport function getTypographyPreset(name: string): Record<string, unknown> | undefined {\n return TYPOGRAPHY_MAP.get(name.toLowerCase());\n}\n\n/** Looks up a color name in the theme map first, then the CSS named-color table. */\nfunction parseNamedColor(str: string): NormalizedColor | null {\n return THEME_COLOR_MAP.get(str) ?? CSS_COLOR_MAP.get(str) ?? null;\n}\n\n/** Parses `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` hex strings. */\nfunction parseHex(str: string): NormalizedColor | null {\n if (!str.startsWith('#')) return null;\n let hex = str.slice(1);\n if (!/^[0-9a-f]+$/.test(hex)) return null;\n // Expand shorthand: #RGB → #RRGGBB, #RGBA → #RRGGBBAA\n if (hex.length === 3 || hex.length === 4)\n hex = hex.split('').map(c => c + c).join('');\n const int = parseInt(hex, 16);\n if (hex.length === 6)\n return [(int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255, 1];\n if (hex.length === 8)\n return [(int >>> 24) / 255, (int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255];\n return null;\n}\n\n/** Parses `rgb()` / `rgba()` — both percentage and 0-255 channel forms. */\nfunction parseRgb(str: string): NormalizedColor | null {\n const m = str.match(/^rgba?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const [r, g, b] = args.tokens.map(t => readChannel(t, 1, 255));\n return finiteColor([r, g, b, args.alpha]);\n}\n\n/** Parses `hsl()` / `hsla()`. The hue takes `deg`, `grad`, `rad` or `turn` (a bare number is degrees). */\nfunction parseHsl(str: string): NormalizedColor | null {\n const m = str.match(/^hsla?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const h = readHue(args.tokens[0]);\n const s = parseFloat(args.tokens[1]) / 100;\n const l = parseFloat(args.tokens[2]) / 100;\n const k = (n: number) => (((n + h / 30) % 12) + 12) % 12;\n const chroma = s * Math.min(l, 1 - l);\n const f = (n: number) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\n return finiteColor([f(0), f(8), f(4), args.alpha]);\n}\n\n/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */\nfunction parseLab(str: string): NormalizedColor | null {\n const m = str.match(/^lab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const a = parseFloat(args.tokens[1]);\n const b = parseFloat(args.tokens[2]);\n return finiteColor(labToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */\nfunction parseLch(str: string): NormalizedColor | null {\n const m = str.match(/^lch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const C = parseFloat(args.tokens[1]);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n/** Parses `oklab(L a b)` (Oklab perceptually uniform color space). */\nfunction parseOklab(str: string): NormalizedColor | null {\n const m = str.match(/^oklab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.\n const [L, a, b] = [readChannel(args.tokens[0], 1), readChannel(args.tokens[1], 0.4), readChannel(args.tokens[2], 0.4)];\n return finiteColor(oklabToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `oklch(L C H)` (polar form of Oklab). */\nfunction parseOklch(str: string): NormalizedColor | null {\n const m = str.match(/^oklch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).\n const L = readChannel(args.tokens[0], 1);\n const C = readChannel(args.tokens[1], 0.4);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n// ── CIE conversion helpers ────────────────────────────────────────────────────\n\n/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */\nfunction labToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const e = 0.008856, k = 903.3;\n const fy = (L + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const X = (fx ** 3 > e ? fx ** 3 : (116 * fx - 16) / k) * 0.95047;\n const Y = L > k * e ? ((L + 16) / 116) ** 3 : L / k;\n const Z = (fz ** 3 > e ? fz ** 3 : (116 * fz - 16) / k) * 1.08883;\n const [lr, lg, lb] = xyzD65ToLinearSrgb(X, Y, Z);\n return linearToSrgb(lr, lg, lb, alpha);\n}\n\n/** Converts Oklab to a normalized sRGB color using the standard Björn Ottosson matrix. */\nfunction oklabToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const l_ = L + 0.3963377774 * a + 0.2158037573 * b;\n const m_ = L - 0.1055613458 * a - 0.0638541728 * b;\n const s_ = L - 0.0894841775 * a - 1.2914855480 * b;\n const l = l_ ** 3, m = m_ ** 3, s = s_ ** 3;\n return linearToSrgb(\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.6956065236 * s,\n alpha,\n );\n}\n\n// ── Opacity suffix ─────────────────────────────────────────────────────────────\n\n/**\n * Splits a Tailwind-style opacity suffix (`\"white/10\"`, `\"primary/90\"`) off the\n * end of a color string. The suffix is a slash followed by a number (optionally\n * with a `%`) interpreted as a percentage 0–100.\n *\n * Only a trailing slash that sits *outside* any parentheses is treated as an\n * opacity modifier, so the internal slash-alpha syntax of `rgb()` / `hsl()`\n * (e.g. `rgb(0 0 255 / 0.25)`) is left untouched.\n *\n * @returns the bare color string and the opacity fraction (1 when absent).\n */\nfunction splitOpacitySuffix(str: string): { color: string; opacity: number } {\n if (str.includes('(')) return { color: str, opacity: 1 };\n const m = str.match(/^(.*[^/])\\/\\s*([\\d.]+)%?$/);\n if (!m) return { color: str, opacity: 1 };\n const pct = parseFloat(m[2]);\n if (!Number.isFinite(pct)) return { color: str, opacity: 1 };\n return { color: m[1].trim(), opacity: Math.max(0, Math.min(1, pct / 100)) };\n}\n\n// ── Main entry point ──────────────────────────────────────────────────────────\n\n/**\n * Parses a CSS color string into a normalized `[R, G, B, A]` array (0.0–1.0).\n *\n * Supported formats: named colors (CSS + theme), hex, rgb/rgba, hsl/hsla,\n * lab, lch, oklab, oklch, plus a Tailwind-style opacity suffix (`\"white/10\"`).\n * Falls back to opaque black and logs a warning for unrecognised input.\n */\nexport function parseColor(cssStr: string): NormalizedColor {\n const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());\n const parsed =\n parseNamedColor(str) ??\n parseHex(str) ??\n parseRgb(str) ??\n parseHsl(str) ??\n parseLab(str) ??\n parseLch(str) ??\n parseOklab(str) ??\n parseOklch(str) ??\n (console.warn(`[Motion Engine] Unsupported color format: \"${cssStr}\". Defaulting to black.`), [0, 0, 0, 1] as NormalizedColor);\n // Clone before applying opacity: named/theme lookups return cached tuples.\n if (opacity !== 1) return [parsed[0], parsed[1], parsed[2], parsed[3] * opacity];\n return parsed;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"gradient-stops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/gradient-stops.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAQnC,yFAAyF;AACzF,SAAS,UAAU,CAAC,IAAe,EAAE,QAAgB;IACjD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/B,IAAI,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,QAAQ;QAAE,EAAE,EAAE,CAAC;IAClC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAClB,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,CAA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AAC;IACL,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import type { NormalizedColor } from './color/parser';\r\nimport { lerpColor } from './lerp';\r\n\r\n/** A colour ramp: `colors[i]` sits at `stops[i]` (ascending, 0 to 1). */\r\nexport interface ColorRamp {\r\n colors: NormalizedColor[];\r\n stops: number[];\r\n}\r\n\r\n/** The colour of `ramp` at `position`: clamped past either end, linear between stops. */\r\nfunction sampleRamp(ramp: ColorRamp, position: number): NormalizedColor {\r\n const { colors, stops } = ramp;\r\n const last = colors.length - 1;\r\n if (position <= stops[0]) return colors[0];\r\n if (position >= stops[last]) return colors[last];\r\n let hi = 1;\r\n while (stops[hi] < position) hi++;\r\n const lo = hi - 1;\r\n const span = stops[hi] - stops[lo];\r\n return lerpColor(colors[lo], colors[hi], span > 0 ? (position - stops[lo]) / span : 0);\r\n}\r\n\r\n/**\r\n * The colour of `ramp` for the `k`-th of several stops that share `position`: the\r\n * ramp's own stop there when it has one (a hard edge keeps both sides), else\r\n * the interpolated value.\r\n */\r\nfunction colorAt(ramp: ColorRamp, position: number, k: number): NormalizedColor {\r\n const first = ramp.stops.indexOf(position);\r\n if (first === -1) return sampleRamp(ramp, position);\r\n let count = 1;\r\n while (ramp.stops[first + count] === position) count++;\r\n return ramp.colors[first + Math.min(k, count - 1)];\r\n}\r\n\r\nconst sameStops = (a: number[], b: number[]) => a.length === b.length && a.every((s, i) => s === b[i]);\r\n\r\n/**\r\n * Interpolates two colour ramps. Two ramps with the same stop positions are\r\n * blended stop by stop. Otherwise both are resampled onto the union of their\r\n * positions first (a position either ramp doubles, as for a hard edge, is kept\r\n * doubled), so a tween between a 2-stop and a 3-stop gradient is the destination\r\n * ramp at `t = 1` rather than the source's stop count with the destination's\r\n * colours merged in.\r\n */\r\nexport function lerpColorRamp(a: ColorRamp, b: ColorRamp, t: number): ColorRamp {\r\n if (sameStops(a.stops, b.stops)) {\r\n return {\r\n colors: a.colors.map((c, i) => lerpColor(c, b.colors[i], t)),\r\n stops: a.stops.slice(),\r\n };\r\n }\r\n const count = new Map<number, number>();\r\n for (const ramp of [a, b]) {\r\n const own = new Map<number, number>();\r\n for (const s of ramp.stops) own.set(s, (own.get(s) ?? 0) + 1);\r\n for (const [s, n] of own) count.set(s, Math.max(count.get(s) ?? 0, n));\r\n }\r\n const colors: NormalizedColor[] = [];\r\n const stops: number[] = [];\r\n for (const position of [...count.keys()].sort((x, y) => x - y)) {\r\n for (let k = 0; k < count.get(position)!; k++) {\r\n colors.push(lerpColor(colorAt(a, position, k), colorAt(b, position, k), t));\r\n stops.push(position);\r\n }\r\n }\r\n return { colors, stops };\r\n}\r\n"]}
1
+ {"version":3,"file":"gradient-stops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/gradient-stops.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAQnC,yFAAyF;AACzF,SAAS,UAAU,CAAC,IAAe,EAAE,QAAgB;IACjD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/B,IAAI,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,QAAQ;QAAE,EAAE,EAAE,CAAC;IAClC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAClB,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAA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AC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import type { NormalizedColor } from './color/parser';\nimport { lerpColor } from './lerp';\n\n/** A colour ramp: `colors[i]` sits at `stops[i]` (ascending, 0 to 1). */\nexport interface ColorRamp {\n colors: NormalizedColor[];\n stops: number[];\n}\n\n/** The colour of `ramp` at `position`: clamped past either end, linear between stops. */\nfunction sampleRamp(ramp: ColorRamp, position: number): NormalizedColor {\n const { colors, stops } = ramp;\n const last = colors.length - 1;\n if (position <= stops[0]) return colors[0];\n if (position >= stops[last]) return colors[last];\n let hi = 1;\n while (stops[hi] < position) hi++;\n const lo = hi - 1;\n const span = stops[hi] - stops[lo];\n return lerpColor(colors[lo], colors[hi], span > 0 ? (position - stops[lo]) / span : 0);\n}\n\n/**\n * The colour of `ramp` for the `k`-th of several stops that share `position`: the\n * ramp's own stop there when it has one (a hard edge keeps both sides), else\n * the interpolated value.\n */\nfunction colorAt(ramp: ColorRamp, position: number, k: number): NormalizedColor {\n const first = ramp.stops.indexOf(position);\n if (first === -1) return sampleRamp(ramp, position);\n let count = 1;\n while (ramp.stops[first + count] === position) count++;\n return ramp.colors[first + Math.min(k, count - 1)];\n}\n\nconst sameStops = (a: number[], b: number[]) => a.length === b.length && a.every((s, i) => s === b[i]);\n\n/**\n * Interpolates two colour ramps. Two ramps with the same stop positions are\n * blended stop by stop. Otherwise both are resampled onto the union of their\n * positions first (a position either ramp doubles, as for a hard edge, is kept\n * doubled), so a tween between a 2-stop and a 3-stop gradient is the destination\n * ramp at `t = 1` rather than the source's stop count with the destination's\n * colours merged in.\n */\nexport function lerpColorRamp(a: ColorRamp, b: ColorRamp, t: number): ColorRamp {\n if (sameStops(a.stops, b.stops)) {\n return {\n colors: a.colors.map((c, i) => lerpColor(c, b.colors[i], t)),\n stops: a.stops.slice(),\n };\n }\n const count = new Map<number, number>();\n for (const ramp of [a, b]) {\n const own = new Map<number, number>();\n for (const s of ramp.stops) own.set(s, (own.get(s) ?? 0) + 1);\n for (const [s, n] of own) count.set(s, Math.max(count.get(s) ?? 0, n));\n }\n const colors: NormalizedColor[] = [];\n const stops: number[] = [];\n for (const position of [...count.keys()].sort((x, y) => x - y)) {\n for (let k = 0; k < count.get(position)!; k++) {\n colors.push(lerpColor(colorAt(a, position, k), colorAt(b, position, k), t));\n stops.push(position);\n }\n }\n return { colors, stops };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"canvas3d.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/canvas3d.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA6CzD,MAAM,CAAC,MAAM,YAAY,GAAmC;IACxD,8EAA8E;IAC9E,qEAAqE;IACrE,OAAO,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;IAElD,8EAA8E;IAC9E,8EAA8E;IAC9E,+EAA+E;IAC/E,+EAA+E;IAC/E,8EAA8E;IAC9E,2DAA2D;IAC3D,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChB,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;QAClC,aAAa,EAAE,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa;QACjD,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS;QACrC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;KACxE,CAAC;IAEF,2EAA2E;IAC3E,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;IAErC,2EAA2E;IAC3E,qCAAqC;IACrC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QACtB,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport type { Scene3D } from '@/render3d/scene3d';\r\nimport { declare3DResources } from '@/render3d/tracking';\r\n\r\n/**\r\n * A 3D scene, painted as a fill.\r\n *\r\n * 3D is paint, not structure: the renderer draws the scene to a texture and\r\n * shades the shape's own path with it. So it clips to whatever painted it — an\r\n * `Ellipse`, a `Path`, a run of `Text` — stacks with the other fills in the\r\n * array, and inherits the fill layer's `opacity`/`blend`/`space` like any other.\r\n *\r\n * Ellipse({ fill: Fills.canvas3D(scene) })\r\n * Rect({ fill: [\"#0b0d12\", scene, Fills.linearGradient([\"transparent\", \"#000/60\"])] })\r\n *\r\n * The payload is a **built** {@link Scene3D}, never a builder callback. Per-frame\r\n * freshness comes from where the value is produced — a `renderSelf` runs every\r\n * frame, and a `() => …` prop is an ordinary reactive binding — which is exactly\r\n * how every other fill behaves.\r\n */\r\nexport interface Canvas3DFillProp {\r\n type: 'canvas3D';\r\n /** The scene to draw. Rebuilt by its producer each frame; never a callback. */\r\n scene: Scene3D;\r\n /**\r\n * Ceiling on the 3D buffer's device-pixel ratio. Default 2.\r\n *\r\n * Exists so a high-scale export doesn't allocate a quadratically larger\r\n * render buffer than the scene needs — a 4× export of a 1080p shape would\r\n * otherwise ask for a 16× buffer.\r\n */\r\n maxPixelRatio?: number;\r\n /** Multisample the 3D pass. Default true. */\r\n antialias?: boolean;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface Canvas3DFillResolved {\r\n type: 'canvas3D';\r\n scene: Scene3D;\r\n maxPixelRatio?: number;\r\n antialias?: boolean;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport const canvas3DFill: FillData<Canvas3DFillResolved> = {\r\n // Nothing to normalise — the defaults for maxPixelRatio/antialias are applied\r\n // at render time so the resolved shape stays minimal and comparable.\r\n resolve: (prop: Canvas3DFillProp) => ({ ...prop }),\r\n\r\n // A scene is a command list: there is no meaningful value halfway between two\r\n // of them, so it snaps, exactly as an image fill's `src` does. Only `opacity`\r\n // interpolates. Deliberately returns neither `type` nor `blend` — `FillResult`\r\n // omits both and `lerpFill` reassembles via `{ ...a, ...lerp(...) }`, which is\r\n // also what makes the ragged-array self-pair (a fill fading against a copy of\r\n // itself, when the two fill arrays differ in length) work.\r\n lerp: (a, b, t) => ({\r\n scene: t < 0.5 ? a.scene : b.scene,\r\n maxPixelRatio: a.maxPixelRatio ?? b.maxPixelRatio,\r\n antialias: a.antialias ?? b.antialias,\r\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\r\n }),\r\n\r\n // Reference identity is the only comparison a Scene3D supports — it has no\r\n // structural hash and `ops()` returns its live array. Nothing in the codebase\r\n // calls this today; it exists to satisfy the interface.\r\n equals: (a, b) => a.scene === b.scene,\r\n\r\n // Runs off the same descriptors the renderer consumes, so what gets loaded\r\n // cannot drift from what gets drawn.\r\n declare: (fill, assets) => {\r\n declare3DResources(fill.scene, assets);\r\n },\r\n};\r\n"]}
1
+ {"version":3,"file":"canvas3d.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/canvas3d.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA6CzD,MAAM,CAAC,MAAM,YAAY,GAAmC;IACxD,8EAA8E;IAC9E,qEAAqE;IACrE,OAAO,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;IAElD,8EAA8E;IAC9E,8EAA8E;IAC9E,+EAA+E;IAC/E,+EAA+E;IAC/E,8EAA8E;IAC9E,2DAA2D;IAC3D,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChB,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;QAClC,aAAa,EAAE,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa;QACjD,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS;QACrC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;KACxE,CAAC;IAEF,2EAA2E;IAC3E,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;IAErC,2EAA2E;IAC3E,qCAAqC;IACrC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QACtB,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport type { Scene3D } from '@/render3d/scene3d';\nimport { declare3DResources } from '@/render3d/tracking';\n\n/**\n * A 3D scene, painted as a fill.\n *\n * 3D is paint, not structure: the renderer draws the scene to a texture and\n * shades the shape's own path with it. So it clips to whatever painted it — an\n * `Ellipse`, a `Path`, a run of `Text` — stacks with the other fills in the\n * array, and inherits the fill layer's `opacity`/`blend`/`space` like any other.\n *\n * Ellipse({ fill: Fills.canvas3D(scene) })\n * Rect({ fill: [\"#0b0d12\", scene, Fills.linearGradient([\"transparent\", \"#000/60\"])] })\n *\n * The payload is a **built** {@link Scene3D}, never a builder callback. Per-frame\n * freshness comes from where the value is produced — a `renderSelf` runs every\n * frame, and a `() => …` prop is an ordinary reactive binding — which is exactly\n * how every other fill behaves.\n */\nexport interface Canvas3DFillProp {\n type: 'canvas3D';\n /** The scene to draw. Rebuilt by its producer each frame; never a callback. */\n scene: Scene3D;\n /**\n * Ceiling on the 3D buffer's device-pixel ratio. Default 2.\n *\n * Exists so a high-scale export doesn't allocate a quadratically larger\n * render buffer than the scene needs — a 4× export of a 1080p shape would\n * otherwise ask for a 16× buffer.\n */\n maxPixelRatio?: number;\n /** Multisample the 3D pass. Default true. */\n antialias?: boolean;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface Canvas3DFillResolved {\n type: 'canvas3D';\n scene: Scene3D;\n maxPixelRatio?: number;\n antialias?: boolean;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport const canvas3DFill: FillData<Canvas3DFillResolved> = {\n // Nothing to normalise — the defaults for maxPixelRatio/antialias are applied\n // at render time so the resolved shape stays minimal and comparable.\n resolve: (prop: Canvas3DFillProp) => ({ ...prop }),\n\n // A scene is a command list: there is no meaningful value halfway between two\n // of them, so it snaps, exactly as an image fill's `src` does. Only `opacity`\n // interpolates. Deliberately returns neither `type` nor `blend` — `FillResult`\n // omits both and `lerpFill` reassembles via `{ ...a, ...lerp(...) }`, which is\n // also what makes the ragged-array self-pair (a fill fading against a copy of\n // itself, when the two fill arrays differ in length) work.\n lerp: (a, b, t) => ({\n scene: t < 0.5 ? a.scene : b.scene,\n maxPixelRatio: a.maxPixelRatio ?? b.maxPixelRatio,\n antialias: a.antialias ?? b.antialias,\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\n }),\n\n // Reference identity is the only comparison a Scene3D supports — it has no\n // structural hash and `ops()` returns its live array. Nothing in the codebase\n // calls this today; it exists to satisfy the interface.\n equals: (a, b) => a.scene === b.scene,\n\n // Runs off the same descriptors the renderer consumes, so what gets loaded\n // cannot drift from what gets drawn.\n declare: (fill, assets) => {\n declare3DResources(fill.scene, assets);\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"color.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAgB1C,MAAM,CAAC,MAAM,SAAS,GAAgC;IAClD,OAAO,EAAE,CAAC,IAAmB,EAAE,EAAE,CAAC,CAAC;QAC/B,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5B,CAAC,CAAE,IAAI,CAAC,KAAyB;YACjC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,KAAe,CAAC;QACtC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;KACpB,CAAC;IACF,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChB,KAAK,EAAE;YACH,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACxC;QACD,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;KACxE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;CACxC,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\r\nimport type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport { lerpNumber } from '@/tween/lerp';\r\n\r\nexport interface SolidFillProp {\r\n type: 'solid';\r\n color: Color;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface SolidFillResolved {\r\n type: 'solid';\r\n color: NormalizedColor;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport const colorFill: FillData<SolidFillResolved> = {\r\n resolve: (prop: SolidFillProp) => ({\r\n type: 'solid',\r\n color: Array.isArray(prop.color)\r\n ? (prop.color as NormalizedColor)\r\n : parseColor(prop.color as string),\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n }),\r\n lerp: (a, b, t) => ({\r\n color: [\r\n lerpNumber(a.color[0], b.color[0], t),\r\n lerpNumber(a.color[1], b.color[1], t),\r\n lerpNumber(a.color[2], b.color[2], t),\r\n lerpNumber(a.color[3], b.color[3], t),\r\n ],\r\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\r\n }),\r\n equals: (a, b) => a.color === b.color,\r\n};\r\n"]}
1
+ {"version":3,"file":"color.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,C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AC,KAAK,KAAK,CAAC,CAAC,KAAK;CACxC,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpNumber } from '@/tween/lerp';\n\nexport interface SolidFillProp {\n type: 'solid';\n color: Color;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface SolidFillResolved {\n type: 'solid';\n color: NormalizedColor;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport const colorFill: FillData<SolidFillResolved> = {\n resolve: (prop: SolidFillProp) => ({\n type: 'solid',\n color: Array.isArray(prop.color)\n ? (prop.color as NormalizedColor)\n : parseColor(prop.color as string),\n opacity: prop.opacity,\n blend: prop.blend,\n }),\n lerp: (a, b, t) => ({\n color: [\n lerpNumber(a.color[0], b.color[0], t),\n lerpNumber(a.color[1], b.color[1], t),\n lerpNumber(a.color[2], b.color[2], t),\n lerpNumber(a.color[3], b.color[3], t),\n ],\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\n }),\n equals: (a, b) => a.color === b.color,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"conic-gradient.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/conic-gradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAW,MAAM,6BAA6B,CAAC;AAsBnE,SAAS,YAAY,CAAC,CAAQ;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAW,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAwC;IAClE,OAAO,EAA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,CAAC;QACtD,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAClD,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\r\nimport type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport { lerpColorRamp } from '../gradient-stops';\r\nimport { lerpNumber } from '@/tween/lerp';\r\nimport { lerpVector2, Vector2 } from '@/attributes/layout/vector2';\r\n\r\nexport interface ConicGradientFillProp {\r\n type: 'conic-gradient';\r\n colors: Color[];\r\n stops?: number[];\r\n center?: Vector2;\r\n startAngle?: number;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface ConicGradientFillResolved {\r\n type: 'conic-gradient';\r\n colors: NormalizedColor[];\r\n stops: number[];\r\n center: Vector2;\r\n startAngle?: number;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nfunction toNormalized(c: Color): NormalizedColor {\r\n return Array.isArray(c) ? (c as NormalizedColor) : parseColor(c as string);\r\n}\r\n\r\nexport const conicGradientFill: FillData<ConicGradientFillResolved> = {\r\n resolve: (prop: ConicGradientFillProp) => ({\r\n type: 'conic-gradient',\r\n colors: prop.colors.map(toNormalized),\r\n stops: prop.stops ?? prop.colors.map((_, i) => i / Math.max(1, prop.colors.length - 1)),\r\n center: prop.center ?? { x: 0, y: 0 },\r\n startAngle: prop.startAngle,\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n }),\r\n lerp: (a, b, t) => ({\r\n ...lerpColorRamp(a, b, t),\r\n center: lerpVector2(a.center, b.center, t),\r\n startAngle: lerpNumber(a.startAngle ?? 0, b.startAngle ?? 0, t),\r\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\r\n }),\r\n equals: (a, b) =>\r\n a.center.x === b.center.x && a.center.y === b.center.y &&\r\n (a.startAngle ?? 0) === (b.startAngle ?? 0) &&\r\n a.colors.length === b.colors.length &&\r\n a.colors.every((c, i) => c === b.colors[i]),\r\n};\r\n"]}
1
+ {"version":3,"file":"conic-gradient.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/conic-gradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAW,MAAM,6BAA6B,CAAC;AAsBnE,SAAS,YAAY,CAAC,CAAQ;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAW,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAwC;IAClE,OAAO,EAAE,CAAC,IAA2B,EAAE,EAAE,CAAC,CAAC;QACvC,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;QACrC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvF,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QACrC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;KACpB,CAAC;IACF,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChB,GAAG,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/D,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;KACzD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAClD,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpColorRamp } from '../gradient-stops';\nimport { lerpNumber } from '@/tween/lerp';\nimport { lerpVector2, Vector2 } from '@/attributes/layout/vector2';\n\nexport interface ConicGradientFillProp {\n type: 'conic-gradient';\n colors: Color[];\n stops?: number[];\n center?: Vector2;\n startAngle?: number;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface ConicGradientFillResolved {\n type: 'conic-gradient';\n colors: NormalizedColor[];\n stops: number[];\n center: Vector2;\n startAngle?: number;\n opacity?: number;\n blend?: BlendMode;\n}\n\nfunction toNormalized(c: Color): NormalizedColor {\n return Array.isArray(c) ? (c as NormalizedColor) : parseColor(c as string);\n}\n\nexport const conicGradientFill: FillData<ConicGradientFillResolved> = {\n resolve: (prop: ConicGradientFillProp) => ({\n type: 'conic-gradient',\n colors: prop.colors.map(toNormalized),\n stops: prop.stops ?? prop.colors.map((_, i) => i / Math.max(1, prop.colors.length - 1)),\n center: prop.center ?? { x: 0, y: 0 },\n startAngle: prop.startAngle,\n opacity: prop.opacity,\n blend: prop.blend,\n }),\n lerp: (a, b, t) => ({\n ...lerpColorRamp(a, b, t),\n center: lerpVector2(a.center, b.center, t),\n startAngle: lerpNumber(a.startAngle ?? 0, b.startAngle ?? 0, t),\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\n }),\n equals: (a, b) =>\n a.center.x === b.center.x && a.center.y === b.center.y &&\n (a.startAngle ?? 0) === (b.startAngle ?? 0) &&\n a.colors.length === b.colors.length &&\n a.colors.every((c, i) => c === b.colors[i]),\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dot-grid.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/dot-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwC1C,gFAAgF;AAChF,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,CAAC,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AC,CAAC,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACxC;QACD,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;KACzD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC7D,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\r\nimport type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport { lerpNumber } from '@/tween/lerp';\r\nimport { Vector2 } from '@/attributes/layout/vector2';\r\n\r\n/**\r\n * A regular lattice of dots — the ground under a diagram, graph paper, the\r\n * printed-halftone look, the \"canvas\" backdrop every design tool draws.\r\n *\r\n * Measured in **pixels**, like {@link StripeFillProp} and unlike\r\n * {@link GridFillProp}: a dot field is a texture, so its pitch should not change\r\n * when the shape carrying it is resized. That is also what makes `offset` worth\r\n * having — sliding the lattice is how the field parallaxes, and it is the one\r\n * piece of geometry a px-space pattern cannot fake by moving the node.\r\n *\r\n * Rendered from a shader rather than a baked tile, so `radius` and `spacing`\r\n * stay exact at fractional values and animating any of them costs a uniform\r\n * write rather than a texture rebuild.\r\n */\r\nexport interface DotGridFillProp {\r\n type: 'dotGrid';\r\n /** Dot radius in px. Larger than half of {@link spacing} makes the dots merge. */\r\n radius?: number;\r\n /** Distance between one dot's centre and the next, in px, on both axes. */\r\n spacing?: number;\r\n /** Shifts the whole lattice, in px. Tween it to drift the field. */\r\n offset?: Vector2;\r\n color?: Color;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface DotGridFillResolved {\r\n type: 'dotGrid';\r\n radius: number;\r\n spacing: number;\r\n offset: Vector2;\r\n color: NormalizedColor;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\n/** A 2px dot every 16px: reads as graph paper at 100% without dominating it. */\r\nconst DEFAULT_RADIUS = 2;\r\nconst DEFAULT_SPACING = 16;\r\n\r\nexport const dotGridFill: FillData<DotGridFillResolved> = {\r\n resolve: (prop: DotGridFillProp) => {\r\n const raw = prop.color ?? ([0, 0, 0, 1] as NormalizedColor);\r\n return {\r\n type: 'dotGrid',\r\n radius: prop.radius ?? DEFAULT_RADIUS,\r\n spacing: prop.spacing ?? DEFAULT_SPACING,\r\n offset: prop.offset ?? { x: 0, y: 0 },\r\n color: Array.isArray(raw) ? (raw as NormalizedColor) : parseColor(raw as string),\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n };\r\n },\r\n lerp: (a, b, t) => ({\r\n radius: lerpNumber(a.radius, b.radius, t),\r\n spacing: lerpNumber(a.spacing, b.spacing, t),\r\n offset: {\r\n x: lerpNumber(a.offset.x, b.offset.x, t),\r\n y: lerpNumber(a.offset.y, b.offset.y, t),\r\n },\r\n color: [\r\n lerpNumber(a.color[0], b.color[0], t),\r\n lerpNumber(a.color[1], b.color[1], t),\r\n lerpNumber(a.color[2], b.color[2], t),\r\n lerpNumber(a.color[3], b.color[3], t),\r\n ],\r\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\r\n }),\r\n equals: (a, b) =>\r\n a.radius === b.radius &&\r\n a.spacing === b.spacing &&\r\n a.offset.x === b.offset.x && a.offset.y === b.offset.y &&\r\n a.color[0] === b.color[0] && a.color[1] === b.color[1] &&\r\n a.color[2] === b.color[2] && a.color[3] === b.color[3],\r\n};\r\n"]}
1
+ {"version":3,"file":"dot-grid.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/dot-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwC1C,gFAAgF;AAChF,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAkC;IACtD,OAAO,EAAE,CAAC,IAAqB,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,IAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAqB,CAAC;QAC5D,OAAO;YACH,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,cAAc;YACrC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,eAAe;YACxC,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE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,CAAC;SACxC;QACD,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;KACzD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC7D,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpNumber } from '@/tween/lerp';\nimport { Vector2 } from '@/attributes/layout/vector2';\n\n/**\n * A regular lattice of dots — the ground under a diagram, graph paper, the\n * printed-halftone look, the \"canvas\" backdrop every design tool draws.\n *\n * Measured in **pixels**, like {@link StripeFillProp} and unlike\n * {@link GridFillProp}: a dot field is a texture, so its pitch should not change\n * when the shape carrying it is resized. That is also what makes `offset` worth\n * having — sliding the lattice is how the field parallaxes, and it is the one\n * piece of geometry a px-space pattern cannot fake by moving the node.\n *\n * Rendered from a shader rather than a baked tile, so `radius` and `spacing`\n * stay exact at fractional values and animating any of them costs a uniform\n * write rather than a texture rebuild.\n */\nexport interface DotGridFillProp {\n type: 'dotGrid';\n /** Dot radius in px. Larger than half of {@link spacing} makes the dots merge. */\n radius?: number;\n /** Distance between one dot's centre and the next, in px, on both axes. */\n spacing?: number;\n /** Shifts the whole lattice, in px. Tween it to drift the field. */\n offset?: Vector2;\n color?: Color;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface DotGridFillResolved {\n type: 'dotGrid';\n radius: number;\n spacing: number;\n offset: Vector2;\n color: NormalizedColor;\n opacity?: number;\n blend?: BlendMode;\n}\n\n/** A 2px dot every 16px: reads as graph paper at 100% without dominating it. */\nconst DEFAULT_RADIUS = 2;\nconst DEFAULT_SPACING = 16;\n\nexport const dotGridFill: FillData<DotGridFillResolved> = {\n resolve: (prop: DotGridFillProp) => {\n const raw = prop.color ?? ([0, 0, 0, 1] as NormalizedColor);\n return {\n type: 'dotGrid',\n radius: prop.radius ?? DEFAULT_RADIUS,\n spacing: prop.spacing ?? DEFAULT_SPACING,\n offset: prop.offset ?? { x: 0, y: 0 },\n color: Array.isArray(raw) ? (raw as NormalizedColor) : parseColor(raw as string),\n opacity: prop.opacity,\n blend: prop.blend,\n };\n },\n lerp: (a, b, t) => ({\n radius: lerpNumber(a.radius, b.radius, t),\n spacing: lerpNumber(a.spacing, b.spacing, t),\n offset: {\n x: lerpNumber(a.offset.x, b.offset.x, t),\n y: lerpNumber(a.offset.y, b.offset.y, t),\n },\n color: [\n lerpNumber(a.color[0], b.color[0], t),\n lerpNumber(a.color[1], b.color[1], t),\n lerpNumber(a.color[2], b.color[2], t),\n lerpNumber(a.color[3], b.color[3], t),\n ],\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\n }),\n equals: (a, b) =>\n a.radius === b.radius &&\n a.spacing === b.spacing &&\n a.offset.x === b.offset.x && a.offset.y === b.offset.y &&\n a.color[0] === b.color[0] && a.color[1] === b.color[1] &&\n a.color[2] === b.color[2] && a.color[3] === b.color[3],\n};\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UAAU;QAC7B,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACpB,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzF,CAAC,CAAC;QACF,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM;QACjC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAChD,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\r\nimport type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport { lerpColorRamp } from '../gradient-stops';\r\nimport { lerpNumber } from '@/tween/lerp';\r\nimport { lerpVector2, Vector2 } from '@/attributes/layout/vector2';\r\n\r\n/**\r\n * Which noise function the octaves are summed from.\r\n *\r\n * - `'value'` — smoothed value noise. The cheapest, and the softest: clouds,\r\n * haze, paper fibre, subtle mottling.\r\n * - `'simplex'` — gradient noise. More even, fewer axis-aligned artefacts than\r\n * value noise, and the right default for anything organic seen up close.\r\n * - `'ridged'` — simplex folded about zero and inverted, so the *zero crossings*\r\n * become sharp crests. Mountains, lightning, veins, marble.\r\n * - `'worley'` — cellular (Voronoi) distance. Not a sum of smooth octaves but a\r\n * distance field, so it gives edges rather than blur: scales, cracked earth,\r\n * caustics, stained glass.\r\n */\r\nexport type FractalNoiseBasis = 'value' | 'simplex' | 'ridged' | 'worley';\r\n\r\n/**\r\n * Fractal (fBm) noise — the procedural material source.\r\n *\r\n * Where {@link NoiseFillProp} is sparse per-pixel speckle (dust, static), this\r\n * is a continuous *field*: several octaves of smooth noise summed at rising\r\n * frequency and falling amplitude, which is what produces cloud, smoke, marble,\r\n * wood, terrain and plasma rather than grain.\r\n *\r\n * It is a fill, so it paints inside the shape's path and stacks with the rest of\r\n * the fill array. It composes with the effect layer rather than duplicating it:\r\n * `duotone` over it is marble, `threshold` over it is an organic matte,\r\n * `posterize` over it is topographic banding, and `displace` pointed at the same\r\n * look is water.\r\n *\r\n * `seed` shifts the whole field, so tweening it drifts the pattern; tween\r\n * `offset` instead to *travel* through it, which is what reads as flowing.\r\n */\r\nexport interface FractalNoiseFillProp {\r\n type: 'fractalNoise';\r\n /** Which noise function the octaves come from (default `'simplex'`). */\r\n basis?: FractalNoiseBasis;\r\n /** How many octaves are summed, 1–8 (default 4). Each one doubles the cost. */\r\n octaves?: number;\r\n /** Cycles of the first octave across the shape — a number, or per-axis (default 3). */\r\n frequency?: number | Vector2;\r\n /** Frequency multiplier per octave (default 2). */\r\n lacunarity?: number;\r\n /** Amplitude multiplier per octave; below 1 the detail fades in (default 0.5). */\r\n gain?: number;\r\n /** Field offset — random-access into the noise. Animate to drift. */\r\n seed?: number;\r\n /** Pan through the field, in cycles. Animate to make the pattern flow. */\r\n offset?: Vector2;\r\n /** Rotation of the field in degrees (default 0). */\r\n angle?: number;\r\n /** Colours the 0–1 field maps onto, low to high (default black → white). */\r\n colors?: Color[];\r\n /** Positions of each colour in 0–1 (default evenly spaced). */\r\n stops?: number[];\r\n /** Steepen (>1) or flatten (<1) the field before the ramp (default 1). */\r\n contrast?: number;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface FractalNoiseFillResolved {\r\n type: 'fractalNoise';\r\n basis: FractalNoiseBasis;\r\n octaves: number;\r\n frequency: Vector2;\r\n lacunarity: number;\r\n gain: number;\r\n seed: number;\r\n offset: Vector2;\r\n angle: number;\r\n colors: NormalizedColor[];\r\n stops: number[];\r\n contrast: number;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nfunction toNormalized(c: Color): NormalizedColor {\r\n return Array.isArray(c) ? (c as NormalizedColor) : parseColor(c as string);\r\n}\r\n\r\nconst BLACK: NormalizedColor = [0, 0, 0, 1];\r\nconst WHITE: NormalizedColor = [1, 1, 1, 1];\r\n\r\n/** Normalise the `frequency` shorthand to a per-axis cycle count. */\r\nconst toFrequency = (f: number | Vector2 | undefined): Vector2 =>\r\n f === undefined ? { x: 3, y: 3 } : typeof f === 'number' ? { x: f, y: f } : f;\r\n\r\nexport const fractalNoiseFill: FillData<FractalNoiseFillResolved> = {\r\n resolve: (prop: FractalNoiseFillProp) => {\r\n const colors = prop.colors?.length ? prop.colors.map(toNormalized) : [BLACK, WHITE];\r\n return {\r\n type: 'fractalNoise',\r\n basis: prop.basis ?? 'simplex',\r\n // Clamped here rather than in the shader so `equals` and the cache\r\n // key see the same value the renderer loops over.\r\n octaves: Math.max(1, Math.min(8, Math.round(prop.octaves ?? 4))),\r\n frequency: toFrequency(prop.frequency),\r\n lacunarity: prop.lacunarity ?? 2,\r\n gain: prop.gain ?? 0.5,\r\n seed: prop.seed ?? 0,\r\n offset: prop.offset ?? { x: 0, y: 0 },\r\n angle: prop.angle ?? 0,\r\n colors,\r\n stops: prop.stops ?? colors.map((_, i) => i / Math.max(1, colors.length - 1)),\r\n contrast: prop.contrast ?? 1,\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n };\r\n },\r\n lerp: (a, b, t) => ({\r\n // The basis picks a different noise function entirely, so there is no\r\n // in-between field to cross to — snap, like every other enum-valued option.\r\n basis: t < 0.5 ? a.basis : b.basis,\r\n // Octave count bounds the shader's loop; a fractional one would round.\r\n octaves: t < 0.5 ? a.octaves : b.octaves,\r\n frequency: lerpVector2(a.frequency, b.frequency, t),\r\n lacunarity: lerpNumber(a.lacunarity, b.lacunarity, t),\r\n gain: lerpNumber(a.gain, b.gain, t),\r\n seed: lerpNumber(a.seed, b.seed, t),\r\n offset: lerpVector2(a.offset, b.offset, t),\r\n angle: lerpNumber(a.angle, b.angle, t),\r\n ...lerpColorRamp(a, b, t),\r\n contrast: lerpNumber(a.contrast, b.contrast, t),\r\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\r\n }),\r\n equals: (a, b) =>\r\n a.basis === b.basis &&\r\n a.octaves === b.octaves &&\r\n a.frequency.x === b.frequency.x && a.frequency.y === b.frequency.y &&\r\n a.lacunarity === b.lacunarity &&\r\n a.gain === b.gain &&\r\n a.seed === b.seed &&\r\n a.offset.x === b.offset.x && a.offset.y === b.offset.y &&\r\n a.angle === b.angle &&\r\n a.contrast === b.contrast &&\r\n a.colors.length === b.colors.length &&\r\n a.colors.every((c, i) => {\r\n const d = b.colors[i];\r\n return d != null && c[0] === d[0] && c[1] === d[1] && c[2] === d[2] && c[3] === d[3];\r\n }) &&\r\n a.stops.length === b.stops.length &&\r\n a.stops.every((s, i) => s === b.stops[i]),\r\n};\r\n"]}
1
+ {"version":3,"file":"fractal-noise.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/fractal-noise.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAA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C,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACpB,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzF,CAAC,CAAC;QACF,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM;QACjC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAChD,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpColorRamp } from '../gradient-stops';\nimport { lerpNumber } from '@/tween/lerp';\nimport { lerpVector2, Vector2 } from '@/attributes/layout/vector2';\n\n/**\n * Which noise function the octaves are summed from.\n *\n * - `'value'` — smoothed value noise. The cheapest, and the softest: clouds,\n * haze, paper fibre, subtle mottling.\n * - `'simplex'` — gradient noise. More even, fewer axis-aligned artefacts than\n * value noise, and the right default for anything organic seen up close.\n * - `'ridged'` — simplex folded about zero and inverted, so the *zero crossings*\n * become sharp crests. Mountains, lightning, veins, marble.\n * - `'worley'` — cellular (Voronoi) distance. Not a sum of smooth octaves but a\n * distance field, so it gives edges rather than blur: scales, cracked earth,\n * caustics, stained glass.\n */\nexport type FractalNoiseBasis = 'value' | 'simplex' | 'ridged' | 'worley';\n\n/**\n * Fractal (fBm) noise — the procedural material source.\n *\n * Where {@link NoiseFillProp} is sparse per-pixel speckle (dust, static), this\n * is a continuous *field*: several octaves of smooth noise summed at rising\n * frequency and falling amplitude, which is what produces cloud, smoke, marble,\n * wood, terrain and plasma rather than grain.\n *\n * It is a fill, so it paints inside the shape's path and stacks with the rest of\n * the fill array. It composes with the effect layer rather than duplicating it:\n * `duotone` over it is marble, `threshold` over it is an organic matte,\n * `posterize` over it is topographic banding, and `displace` pointed at the same\n * look is water.\n *\n * `seed` shifts the whole field, so tweening it drifts the pattern; tween\n * `offset` instead to *travel* through it, which is what reads as flowing.\n */\nexport interface FractalNoiseFillProp {\n type: 'fractalNoise';\n /** Which noise function the octaves come from (default `'simplex'`). */\n basis?: FractalNoiseBasis;\n /** How many octaves are summed, 1–8 (default 4). Each one doubles the cost. */\n octaves?: number;\n /** Cycles of the first octave across the shape — a number, or per-axis (default 3). */\n frequency?: number | Vector2;\n /** Frequency multiplier per octave (default 2). */\n lacunarity?: number;\n /** Amplitude multiplier per octave; below 1 the detail fades in (default 0.5). */\n gain?: number;\n /** Field offset — random-access into the noise. Animate to drift. */\n seed?: number;\n /** Pan through the field, in cycles. Animate to make the pattern flow. */\n offset?: Vector2;\n /** Rotation of the field in degrees (default 0). */\n angle?: number;\n /** Colours the 0–1 field maps onto, low to high (default black → white). */\n colors?: Color[];\n /** Positions of each colour in 0–1 (default evenly spaced). */\n stops?: number[];\n /** Steepen (>1) or flatten (<1) the field before the ramp (default 1). */\n contrast?: number;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface FractalNoiseFillResolved {\n type: 'fractalNoise';\n basis: FractalNoiseBasis;\n octaves: number;\n frequency: Vector2;\n lacunarity: number;\n gain: number;\n seed: number;\n offset: Vector2;\n angle: number;\n colors: NormalizedColor[];\n stops: number[];\n contrast: number;\n opacity?: number;\n blend?: BlendMode;\n}\n\nfunction toNormalized(c: Color): NormalizedColor {\n return Array.isArray(c) ? (c as NormalizedColor) : parseColor(c as string);\n}\n\nconst BLACK: NormalizedColor = [0, 0, 0, 1];\nconst WHITE: NormalizedColor = [1, 1, 1, 1];\n\n/** Normalise the `frequency` shorthand to a per-axis cycle count. */\nconst toFrequency = (f: number | Vector2 | undefined): Vector2 =>\n f === undefined ? { x: 3, y: 3 } : typeof f === 'number' ? { x: f, y: f } : f;\n\nexport const fractalNoiseFill: FillData<FractalNoiseFillResolved> = {\n resolve: (prop: FractalNoiseFillProp) => {\n const colors = prop.colors?.length ? prop.colors.map(toNormalized) : [BLACK, WHITE];\n return {\n type: 'fractalNoise',\n basis: prop.basis ?? 'simplex',\n // Clamped here rather than in the shader so `equals` and the cache\n // key see the same value the renderer loops over.\n octaves: Math.max(1, Math.min(8, Math.round(prop.octaves ?? 4))),\n frequency: toFrequency(prop.frequency),\n lacunarity: prop.lacunarity ?? 2,\n gain: prop.gain ?? 0.5,\n seed: prop.seed ?? 0,\n offset: prop.offset ?? { x: 0, y: 0 },\n angle: prop.angle ?? 0,\n colors,\n stops: prop.stops ?? colors.map((_, i) => i / Math.max(1, colors.length - 1)),\n contrast: prop.contrast ?? 1,\n opacity: prop.opacity,\n blend: prop.blend,\n };\n },\n lerp: (a, b, t) => ({\n // The basis picks a different noise function entirely, so there is no\n // in-between field to cross to — snap, like every other enum-valued option.\n basis: t < 0.5 ? a.basis : b.basis,\n // Octave count bounds the shader's loop; a fractional one would round.\n octaves: t < 0.5 ? a.octaves : b.octaves,\n frequency: lerpVector2(a.frequency, b.frequency, t),\n lacunarity: lerpNumber(a.lacunarity, b.lacunarity, t),\n gain: lerpNumber(a.gain, b.gain, t),\n seed: lerpNumber(a.seed, b.seed, t),\n offset: lerpVector2(a.offset, b.offset, t),\n angle: lerpNumber(a.angle, b.angle, t),\n ...lerpColorRamp(a, b, t),\n contrast: lerpNumber(a.contrast, b.contrast, t),\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\n }),\n equals: (a, b) =>\n a.basis === b.basis &&\n a.octaves === b.octaves &&\n a.frequency.x === b.frequency.x && a.frequency.y === b.frequency.y &&\n a.lacunarity === b.lacunarity &&\n a.gain === b.gain &&\n a.seed === b.seed &&\n a.offset.x === b.offset.x && a.offset.y === b.offset.y &&\n a.angle === b.angle &&\n a.contrast === b.contrast &&\n a.colors.length === b.colors.length &&\n a.colors.every((c, i) => {\n const d = b.colors[i];\n return d != null && c[0] === d[0] && c[1] === d[1] && c[2] === d[2] && c[3] === d[3];\n }) &&\n a.stops.length === b.stops.length &&\n a.stops.every((s, i) => s === b.stops[i]),\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuD1C,iFAAiF;AACjF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,MAAM,CAAC,MAAM,QAAQ,GAA+B;IAChD,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,IAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAqB,CAAC;QAC5D,MAAM,WAAW,GAAG,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AAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC7D,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\r\nimport type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport { lerpNumber } from '@/tween/lerp';\r\nimport { Vector2 } from '@/attributes/layout/vector2';\r\n\r\n/**\r\n * Ruled lines in both axes — graph paper, a chart's backing, a layout guide, the\r\n * floor plane of a diagram.\r\n *\r\n * Measured in **divisions of the shape**, not in pixels, which is the whole\r\n * difference between this and {@link DotGridFillProp}: a grid of 8 stays a grid\r\n * of 8 when the shape resizes, so it reads as structure the figure is built on\r\n * rather than as a texture laid over it. The cells follow the box — a 16:9 shape\r\n * divided 8 ways has 8 columns and 8 rows of 16:9 cells — because a grid that\r\n * kept its cells square would leave a ragged strip down one side of every shape\r\n * that isn't.\r\n *\r\n * {@link subdivisions} nests a finer grid inside each cell, drawn by default at\r\n * {@link MINOR_WIDTH_RATIO} of the division line's width. Thinner rather than\r\n * fainter: a half-width line antialiases to a lighter one at any zoom, so the two\r\n * orders stay distinguishable at every scale without a second colour to keep in\r\n * sync. {@link subdivisionWidth} overrides that when the default ratio isn't the\r\n * look wanted.\r\n */\r\nexport interface GridFillProp {\r\n type: 'grid';\r\n /** How many cells the shape is divided into, per axis. Tween it to zoom the grid. */\r\n divisions?: number;\r\n /** How many finer cells nest inside each division. `1` draws no minor lines. */\r\n subdivisions?: number;\r\n /** Shifts the whole ruling, in px. */\r\n offset?: Vector2;\r\n /** Thickness of a division line, in px. `0` leaves the coarse ruling undrawn. */\r\n strokeWidth?: number;\r\n /**\r\n * Thickness of a subdivision line, in px. Defaults to\r\n * {@link MINOR_WIDTH_RATIO} of {@link strokeWidth} — so a grid that only\r\n * states one width still gets two visibly different orders.\r\n */\r\n subdivisionWidth?: number;\r\n color?: Color;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface GridFillResolved {\r\n type: 'grid';\r\n divisions: number;\r\n subdivisions: number;\r\n offset: Vector2;\r\n strokeWidth: number;\r\n subdivisionWidth: number;\r\n color: NormalizedColor;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\n/** Quarters, hairline, no minor ruling — the plainest grid that is still one. */\r\nconst DEFAULT_DIVISIONS = 4;\r\nconst DEFAULT_SUBDIVISIONS = 1;\r\nconst DEFAULT_STROKE_WIDTH = 1;\r\n\r\n/** How thick a subdivision line is relative to a division one. */\r\nexport const MINOR_WIDTH_RATIO = 0.5;\r\n\r\nexport const gridFill: FillData<GridFillResolved> = {\r\n resolve: (prop: GridFillProp) => {\r\n const raw = prop.color ?? ([0, 0, 0, 1] as NormalizedColor);\r\n const strokeWidth = prop.strokeWidth ?? DEFAULT_STROKE_WIDTH;\r\n return {\r\n type: 'grid',\r\n divisions: prop.divisions ?? DEFAULT_DIVISIONS,\r\n subdivisions: prop.subdivisions ?? DEFAULT_SUBDIVISIONS,\r\n offset: prop.offset ?? { x: 0, y: 0 },\r\n strokeWidth,\r\n // Derived from the width actually in force rather than from the\r\n // default, so stating only `strokeWidth: 4` still yields a minor\r\n // ruling in proportion to it.\r\n subdivisionWidth: prop.subdivisionWidth ?? strokeWidth * MINOR_WIDTH_RATIO,\r\n color: Array.isArray(raw) ? (raw as NormalizedColor) : parseColor(raw as string),\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n };\r\n },\r\n // `divisions` interpolates continuously — a fractional count is a grid caught\r\n // mid-zoom, which is exactly what tweening one should look like. The renderer\r\n // rounds `subdivisions` instead, so the minor ruling always nests a whole\r\n // number of times inside a cell and a tween of it steps rather than sliding\r\n // the fine lines out of alignment with the coarse ones.\r\n lerp: (a, b, t) => ({\r\n divisions: lerpNumber(a.divisions, b.divisions, t),\r\n subdivisions: lerpNumber(a.subdivisions, b.subdivisions, t),\r\n offset: {\r\n x: lerpNumber(a.offset.x, b.offset.x, t),\r\n y: lerpNumber(a.offset.y, b.offset.y, t),\r\n },\r\n strokeWidth: lerpNumber(a.strokeWidth, b.strokeWidth, t),\r\n subdivisionWidth: lerpNumber(a.subdivisionWidth, b.subdivisionWidth, t),\r\n color: [\r\n lerpNumber(a.color[0], b.color[0], t),\r\n lerpNumber(a.color[1], b.color[1], t),\r\n lerpNumber(a.color[2], b.color[2], t),\r\n lerpNumber(a.color[3], b.color[3], t),\r\n ],\r\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\r\n }),\r\n equals: (a, b) =>\r\n a.divisions === b.divisions &&\r\n a.subdivisions === b.subdivisions &&\r\n a.offset.x === b.offset.x && a.offset.y === b.offset.y &&\r\n a.strokeWidth === b.strokeWidth &&\r\n a.subdivisionWidth === b.subdivisionWidth &&\r\n a.color[0] === b.color[0] && a.color[1] === b.color[1] &&\r\n a.color[2] === b.color[2] && a.color[3] === b.color[3],\r\n};\r\n"]}
1
+ {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuD1C,iFAAiF;AACjF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,MAAM,CAAC,MAAM,QAAQ,GAA+B;IAChD,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE;QAC5B,MAAM,GAAG,GA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CAAC,gBAAgB,KAAK,CAAC,CAAC,gBAAgB;QACzC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;CAC7D,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpNumber } from '@/tween/lerp';\nimport { Vector2 } from '@/attributes/layout/vector2';\n\n/**\n * Ruled lines in both axes — graph paper, a chart's backing, a layout guide, the\n * floor plane of a diagram.\n *\n * Measured in **divisions of the shape**, not in pixels, which is the whole\n * difference between this and {@link DotGridFillProp}: a grid of 8 stays a grid\n * of 8 when the shape resizes, so it reads as structure the figure is built on\n * rather than as a texture laid over it. The cells follow the box — a 16:9 shape\n * divided 8 ways has 8 columns and 8 rows of 16:9 cells — because a grid that\n * kept its cells square would leave a ragged strip down one side of every shape\n * that isn't.\n *\n * {@link subdivisions} nests a finer grid inside each cell, drawn by default at\n * {@link MINOR_WIDTH_RATIO} of the division line's width. Thinner rather than\n * fainter: a half-width line antialiases to a lighter one at any zoom, so the two\n * orders stay distinguishable at every scale without a second colour to keep in\n * sync. {@link subdivisionWidth} overrides that when the default ratio isn't the\n * look wanted.\n */\nexport interface GridFillProp {\n type: 'grid';\n /** How many cells the shape is divided into, per axis. Tween it to zoom the grid. */\n divisions?: number;\n /** How many finer cells nest inside each division. `1` draws no minor lines. */\n subdivisions?: number;\n /** Shifts the whole ruling, in px. */\n offset?: Vector2;\n /** Thickness of a division line, in px. `0` leaves the coarse ruling undrawn. */\n strokeWidth?: number;\n /**\n * Thickness of a subdivision line, in px. Defaults to\n * {@link MINOR_WIDTH_RATIO} of {@link strokeWidth} — so a grid that only\n * states one width still gets two visibly different orders.\n */\n subdivisionWidth?: number;\n color?: Color;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface GridFillResolved {\n type: 'grid';\n divisions: number;\n subdivisions: number;\n offset: Vector2;\n strokeWidth: number;\n subdivisionWidth: number;\n color: NormalizedColor;\n opacity?: number;\n blend?: BlendMode;\n}\n\n/** Quarters, hairline, no minor ruling — the plainest grid that is still one. */\nconst DEFAULT_DIVISIONS = 4;\nconst DEFAULT_SUBDIVISIONS = 1;\nconst DEFAULT_STROKE_WIDTH = 1;\n\n/** How thick a subdivision line is relative to a division one. */\nexport const MINOR_WIDTH_RATIO = 0.5;\n\nexport const gridFill: FillData<GridFillResolved> = {\n resolve: (prop: GridFillProp) => {\n const raw = prop.color ?? ([0, 0, 0, 1] as NormalizedColor);\n const strokeWidth = prop.strokeWidth ?? DEFAULT_STROKE_WIDTH;\n return {\n type: 'grid',\n divisions: prop.divisions ?? DEFAULT_DIVISIONS,\n subdivisions: prop.subdivisions ?? DEFAULT_SUBDIVISIONS,\n offset: prop.offset ?? { x: 0, y: 0 },\n strokeWidth,\n // Derived from the width actually in force rather than from the\n // default, so stating only `strokeWidth: 4` still yields a minor\n // ruling in proportion to it.\n subdivisionWidth: prop.subdivisionWidth ?? strokeWidth * MINOR_WIDTH_RATIO,\n color: Array.isArray(raw) ? (raw as NormalizedColor) : parseColor(raw as string),\n opacity: prop.opacity,\n blend: prop.blend,\n };\n },\n // `divisions` interpolates continuously — a fractional count is a grid caught\n // mid-zoom, which is exactly what tweening one should look like. The renderer\n // rounds `subdivisions` instead, so the minor ruling always nests a whole\n // number of times inside a cell and a tween of it steps rather than sliding\n // the fine lines out of alignment with the coarse ones.\n lerp: (a, b, t) => ({\n divisions: lerpNumber(a.divisions, b.divisions, t),\n subdivisions: lerpNumber(a.subdivisions, b.subdivisions, t),\n offset: {\n x: lerpNumber(a.offset.x, b.offset.x, t),\n y: lerpNumber(a.offset.y, b.offset.y, t),\n },\n strokeWidth: lerpNumber(a.strokeWidth, b.strokeWidth, t),\n subdivisionWidth: lerpNumber(a.subdivisionWidth, b.subdivisionWidth, t),\n color: [\n lerpNumber(a.color[0], b.color[0], t),\n lerpNumber(a.color[1], b.color[1], t),\n lerpNumber(a.color[2], b.color[2], t),\n lerpNumber(a.color[3], b.color[3], t),\n ],\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\n }),\n equals: (a, b) =>\n a.divisions === b.divisions &&\n a.subdivisions === b.subdivisions &&\n a.offset.x === b.offset.x && a.offset.y === b.offset.y &&\n a.strokeWidth === b.strokeWidth &&\n a.subdivisionWidth === b.subdivisionWidth &&\n a.color[0] === b.color[0] && a.color[1] === b.color[1] &&\n a.color[2] === b.color[2] && a.color[3] === b.color[3],\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/image.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GAGrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAa,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAA0B,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoH1C,iFAAiF;AACjF,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzE,oCAAoC;AACpC,MAAM,MAAM,GAAY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAEvC;;;;GAIG;AACH,gBAAgB;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MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\r\nimport type { MediaAdjustment } from '../../filters/union';\r\nimport type { ImageAdjustment } from '../../filters/chain';\r\nimport type { FillData } from '../registry';\r\nimport {\r\n declareMediaPreset,\r\n lerpMediaPreset,\r\n resolveMediaPreset,\r\n type MediaPresetProp,\r\n type MediaPresetResolved,\r\n} from '../media-preset';\r\nimport { Alignment, alignmentOps } from '@/attributes/layout/alignment';\r\nimport { Insets, InsetsResolved, insetsOps } from '@/attributes/layout/insets';\r\nimport { Vector2, lerpVector2 } from '@/attributes/layout/vector2';\r\nimport { lerpNumber } from '@/tween/lerp';\r\n\r\n/**\r\n * How an image (or video frame) is scaled into its node's bounds.\r\n *\r\n * - `'fill'` — scale uniformly to cover the bounds, cropping the overflow.\r\n * The Figma-style default; no distortion, no letterboxing.\r\n * - `'fit'` — scale uniformly to be fully contained, letterboxing as needed.\r\n * - `'tile'` — repeat the image at its native size (× `zoom`).\r\n * - `'stretch'`— scale each axis independently to fill the bounds exactly,\r\n * distorting the aspect ratio.\r\n */\r\nexport type ImageFit = 'fill' | 'fit' | 'tile' | 'stretch';\r\n\r\n/**\r\n * A raw image→shape matrix (3×3, row-major) as a 9-element `Float32Array` or a\r\n * 3×3 nested array. The escape hatch: see {@link ImageFillProp.matrix}.\r\n */\r\nexport type ImageMatrix = Float32Array | number[][];\r\n\r\n/**\r\n * A rectangular window onto the source, as **fractions of the source's own\r\n * size** (0–1) inset from each edge: `{ left: 0.25 }` discards the left quarter.\r\n *\r\n * Fractions rather than pixels so a crop is resolution-independent — the same\r\n * value reads identically at 1× and 4K, and survives swapping `src` for a\r\n * differently-sized asset. Everything downstream (`fit`, `zoom`, `anchor`) then\r\n * treats the cropped window *as if it were the whole image*, so a crop composes\r\n * with the fit modes instead of fighting them.\r\n *\r\n * Reuses the {@link Insets} shape, so the shorthands come free — and so do\r\n * `insetsOps.resolve`/`insetsOps.lerp`, which is what makes a crop tween:\r\n * `0.1` · `{ horizontal: 0.2 }` · `{ left: 0.1, top: 0.05 }`.\r\n */\r\nexport type ImageCrop = Insets;\r\n\r\nexport interface ImageFillProp {\r\n type: 'image';\r\n src: string;\r\n\r\n /** How the (cropped) image is scaled into the node's bounds. Defaults to `'fill'`. */\r\n fit?: ImageFit;\r\n\r\n /**\r\n * Window onto the source, applied **before** `fit` — see {@link ImageCrop}.\r\n *\r\n * Not honoured by `fit: 'tile'`: the shader repeats the whole texture, so\r\n * there is no way to tile a sub-rect of it.\r\n */\r\n crop?: ImageCrop;\r\n\r\n /**\r\n * Magnification applied **on top of** whatever `fit` resolved. `1` (the\r\n * default) is the fitted size, `2` twice that, `0.5` half.\r\n *\r\n * A multiplier rather than an absolute scale so it stays meaningful under\r\n * every mode and at any node size: `zoom: 2` means \"twice as big as it would\r\n * otherwise be\" whether the fit was cover, contain or native tiling. Under\r\n * `'tile'` the fitted scale is 1 (native size), so `zoom` there is the tile\r\n * size multiplier.\r\n */\r\n zoom?: number;\r\n\r\n /**\r\n * The point held fixed as `zoom` scales, and the alignment of the image\r\n * inside the bounds when it doesn't cover them. Defaults to `'center'`.\r\n *\r\n * The same `[-1, 1]` y-up space as `pivot`/`align` (so `'topLeft'`,\r\n * `'centerRight'` and `{ x, y }` all work, through the same `alignmentOps.resolve`).\r\n * The named point of the source lands on the same named point of the box:\r\n * `anchor: 'topLeft'` pins the source's top-left corner to the box's, so\r\n * zooming grows away from it. At the default centre this reproduces the\r\n * classic centred cover/contain placement exactly.\r\n *\r\n * Ignored by `'tile'` (a repeating texture has no corner to pin) and inert\r\n * under `'stretch'` at `zoom: 1` (the image already fills both axes).\r\n */\r\n anchor?: Alignment;\r\n\r\n /**\r\n * Raw image→shape matrix. The escape hatch: it wins outright, bypassing\r\n * `crop`/`fit`/`zoom`/`anchor` **and** the shape bounds, so it must carry the\r\n * translation itself. Named `matrix` rather than `transform` because a node's\r\n * `transform` is its x/y/scale/rotation; this is specifically the 3×3 that\r\n * maps image pixels into the shape's local space.\r\n */\r\n matrix?: ImageMatrix;\r\n\r\n /** The grade laid over this picture — see {@link MediaPresetProp}. */\r\n preset?: MediaPresetProp;\r\n /**\r\n * @deprecated Moved to `preset.adjustments`. Still read, and folded into the\r\n * preset on resolve, so a scene written against the old prop keeps grading\r\n * the way it did. Removed in the next major.\r\n */\r\n filters?: ImageAdjustment;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface ImageFillResolved {\r\n type: 'image';\r\n src: string;\r\n fit?: ImageFit;\r\n /** Fractional insets, all four sides present. */\r\n crop?: InsetsResolved;\r\n zoom?: number;\r\n /** Normalised `[-1, 1]` y-up point. */\r\n anchor?: Vector2;\r\n matrix?: ImageMatrix;\r\n /** Absent when the fill is ungraded — see {@link resolveMediaPreset}. */\r\n preset?: MediaPresetResolved<MediaAdjustment>;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\n/** Zero crop — the whole source. Shared by the lerp when only one side crops. */\r\nconst NO_CROP: InsetsResolved = { left: 0, right: 0, top: 0, bottom: 0 };\r\n/** The default anchor, resolved. */\r\nconst CENTER: Vector2 = { x: 0, y: 0 };\r\n\r\n/**\r\n * Normalise the loose author-facing shapes once, so the backend's matrix builder\r\n * reads plain resolved values (`crop` always four sides, `anchor` always a\r\n * vector) rather than re-deriving them per frame.\r\n */\r\n/** @internal */\r\nexport function resolveImagePlacement(\r\n prop: { crop?: ImageCrop; anchor?: Alignment },\r\n): { crop?: InsetsResolved; anchor?: Vector2 } {\r\n return {\r\n crop: prop.crop === undefined ? undefined : insetsOps.resolve(prop.crop),\r\n anchor: prop.anchor === undefined ? undefined : alignmentOps.resolve(prop.anchor),\r\n };\r\n}\r\n\r\n/**\r\n * Interpolate the placement props shared by the image and video fills. Kept in\r\n * one place so the two fills cannot drift — they describe the same geometry and\r\n * are consumed by the same `computeImageMatrix`.\r\n */\r\n/** @internal */\r\nexport function lerpImagePlacement(\r\n a: { crop?: InsetsResolved; zoom?: number; anchor?: Vector2; matrix?: ImageMatrix },\r\n b: { crop?: InsetsResolved; zoom?: number; anchor?: Vector2; matrix?: ImageMatrix },\r\n t: number,\r\n): { crop?: InsetsResolved; zoom: number; anchor: Vector2; matrix?: ImageMatrix } {\r\n return {\r\n // A raw matrix is not interpolable geometry — it snaps (at the midpoint,\r\n // like `fit`), and authors who want a moving matrix bind the prop to a\r\n // thunk instead.\r\n matrix: t < 0.5 ? a.matrix : b.matrix,\r\n // Stay `undefined` when neither side crops, so an uncropped fill keeps\r\n // taking the cheap path and reads back as it was authored.\r\n crop: a.crop || b.crop ? insetsOps.lerp(a.crop ?? NO_CROP, b.crop ?? NO_CROP, t) : undefined,\r\n zoom: lerpNumber(a.zoom ?? 1, b.zoom ?? 1, t),\r\n anchor: lerpVector2(a.anchor ?? CENTER, b.anchor ?? CENTER, t),\r\n };\r\n}\r\n\r\nexport const imageFill: FillData<ImageFillResolved> = {\r\n // `crop`/`anchor` are destructured out before the spread: an optional prop\r\n // re-added by a later spread widens to a *union* of both types, so leaving\r\n // them in would type the resolved crop as `ImageCrop | InsetsResolved`.\r\n // `filters` is destructured out alongside them: it is the deprecated spelling\r\n // of the grade, folded into `preset` here, and letting it through the spread\r\n // would leave a stale array on the resolved fill for the renderer to find.\r\n resolve: ({ crop, anchor, preset, filters, ...prop }: ImageFillProp): ImageFillResolved => ({\r\n ...prop,\r\n ...resolveImagePlacement({ crop, anchor }),\r\n preset: resolveMediaPreset(preset, filters) as\r\n | MediaPresetResolved<MediaAdjustment>\r\n | undefined,\r\n }),\r\n lerp: (a, b, t) => ({\r\n src: t < 0.5 ? a.src : b.src,\r\n fit: t < 0.5 ? a.fit : b.fit,\r\n ...lerpImagePlacement(a, b, t),\r\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\r\n // The grade animates with the fill. Leaving it out let `lerpFill`'s\r\n // `{...a, ...lerp()}` spread carry the *from* fill's grade for the whole\r\n // tween, so tweening a fill from `grayscale(0)` to `grayscale(1)` did\r\n // nothing until the prop snapped to the target at the end.\r\n preset: lerpMediaPreset(a.preset, b.preset, t),\r\n }),\r\n equals: (a, b) => a.src === b.src,\r\n declare: (fill, assets) => {\r\n assets.image(fill.src);\r\n declareMediaPreset(fill.preset, assets);\r\n },\r\n};\r\n"]}
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/image.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GAGrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAa,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAA0B,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoH1C,iFAAiF;AACjF,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzE,oCAAoC;AACpC,MAAM,MAAM,GAAY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAEvC;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,UAAU,qBAAqB,CACjC,IAA8C;IAE9C,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QACxE,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;KACpF,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,UAAU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CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAC5B,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAC5B,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9B,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACrE,oEAAoE;QACpE,yEAAyE;QACzE,sEAAsE;QACtE,2DAA2D;QAC3D,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QACtB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\nimport type { MediaAdjustment } from '../../filters/union';\nimport type { ImageAdjustment } from '../../filters/chain';\nimport type { FillData } from '../registry';\nimport {\n declareMediaPreset,\n lerpMediaPreset,\n resolveMediaPreset,\n type MediaPresetProp,\n type MediaPresetResolved,\n} from '../media-preset';\nimport { Alignment, alignmentOps } from '@/attributes/layout/alignment';\nimport { Insets, InsetsResolved, insetsOps } from '@/attributes/layout/insets';\nimport { Vector2, lerpVector2 } from '@/attributes/layout/vector2';\nimport { lerpNumber } from '@/tween/lerp';\n\n/**\n * How an image (or video frame) is scaled into its node's bounds.\n *\n * - `'fill'` — scale uniformly to cover the bounds, cropping the overflow.\n * The Figma-style default; no distortion, no letterboxing.\n * - `'fit'` — scale uniformly to be fully contained, letterboxing as needed.\n * - `'tile'` — repeat the image at its native size (× `zoom`).\n * - `'stretch'`— scale each axis independently to fill the bounds exactly,\n * distorting the aspect ratio.\n */\nexport type ImageFit = 'fill' | 'fit' | 'tile' | 'stretch';\n\n/**\n * A raw image→shape matrix (3×3, row-major) as a 9-element `Float32Array` or a\n * 3×3 nested array. The escape hatch: see {@link ImageFillProp.matrix}.\n */\nexport type ImageMatrix = Float32Array | number[][];\n\n/**\n * A rectangular window onto the source, as **fractions of the source's own\n * size** (0–1) inset from each edge: `{ left: 0.25 }` discards the left quarter.\n *\n * Fractions rather than pixels so a crop is resolution-independent — the same\n * value reads identically at 1× and 4K, and survives swapping `src` for a\n * differently-sized asset. Everything downstream (`fit`, `zoom`, `anchor`) then\n * treats the cropped window *as if it were the whole image*, so a crop composes\n * with the fit modes instead of fighting them.\n *\n * Reuses the {@link Insets} shape, so the shorthands come free — and so do\n * `insetsOps.resolve`/`insetsOps.lerp`, which is what makes a crop tween:\n * `0.1` · `{ horizontal: 0.2 }` · `{ left: 0.1, top: 0.05 }`.\n */\nexport type ImageCrop = Insets;\n\nexport interface ImageFillProp {\n type: 'image';\n src: string;\n\n /** How the (cropped) image is scaled into the node's bounds. Defaults to `'fill'`. */\n fit?: ImageFit;\n\n /**\n * Window onto the source, applied **before** `fit` — see {@link ImageCrop}.\n *\n * Not honoured by `fit: 'tile'`: the shader repeats the whole texture, so\n * there is no way to tile a sub-rect of it.\n */\n crop?: ImageCrop;\n\n /**\n * Magnification applied **on top of** whatever `fit` resolved. `1` (the\n * default) is the fitted size, `2` twice that, `0.5` half.\n *\n * A multiplier rather than an absolute scale so it stays meaningful under\n * every mode and at any node size: `zoom: 2` means \"twice as big as it would\n * otherwise be\" whether the fit was cover, contain or native tiling. Under\n * `'tile'` the fitted scale is 1 (native size), so `zoom` there is the tile\n * size multiplier.\n */\n zoom?: number;\n\n /**\n * The point held fixed as `zoom` scales, and the alignment of the image\n * inside the bounds when it doesn't cover them. Defaults to `'center'`.\n *\n * The same `[-1, 1]` y-up space as `pivot`/`align` (so `'topLeft'`,\n * `'centerRight'` and `{ x, y }` all work, through the same `alignmentOps.resolve`).\n * The named point of the source lands on the same named point of the box:\n * `anchor: 'topLeft'` pins the source's top-left corner to the box's, so\n * zooming grows away from it. At the default centre this reproduces the\n * classic centred cover/contain placement exactly.\n *\n * Ignored by `'tile'` (a repeating texture has no corner to pin) and inert\n * under `'stretch'` at `zoom: 1` (the image already fills both axes).\n */\n anchor?: Alignment;\n\n /**\n * Raw image→shape matrix. The escape hatch: it wins outright, bypassing\n * `crop`/`fit`/`zoom`/`anchor` **and** the shape bounds, so it must carry the\n * translation itself. Named `matrix` rather than `transform` because a node's\n * `transform` is its x/y/scale/rotation; this is specifically the 3×3 that\n * maps image pixels into the shape's local space.\n */\n matrix?: ImageMatrix;\n\n /** The grade laid over this picture — see {@link MediaPresetProp}. */\n preset?: MediaPresetProp;\n /**\n * @deprecated Moved to `preset.adjustments`. Still read, and folded into the\n * preset on resolve, so a scene written against the old prop keeps grading\n * the way it did. Removed in the next major.\n */\n filters?: ImageAdjustment;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface ImageFillResolved {\n type: 'image';\n src: string;\n fit?: ImageFit;\n /** Fractional insets, all four sides present. */\n crop?: InsetsResolved;\n zoom?: number;\n /** Normalised `[-1, 1]` y-up point. */\n anchor?: Vector2;\n matrix?: ImageMatrix;\n /** Absent when the fill is ungraded — see {@link resolveMediaPreset}. */\n preset?: MediaPresetResolved<MediaAdjustment>;\n opacity?: number;\n blend?: BlendMode;\n}\n\n/** Zero crop — the whole source. Shared by the lerp when only one side crops. */\nconst NO_CROP: InsetsResolved = { left: 0, right: 0, top: 0, bottom: 0 };\n/** The default anchor, resolved. */\nconst CENTER: Vector2 = { x: 0, y: 0 };\n\n/**\n * Normalise the loose author-facing shapes once, so the backend's matrix builder\n * reads plain resolved values (`crop` always four sides, `anchor` always a\n * vector) rather than re-deriving them per frame.\n */\n/** @internal */\nexport function resolveImagePlacement(\n prop: { crop?: ImageCrop; anchor?: Alignment },\n): { crop?: InsetsResolved; anchor?: Vector2 } {\n return {\n crop: prop.crop === undefined ? undefined : insetsOps.resolve(prop.crop),\n anchor: prop.anchor === undefined ? undefined : alignmentOps.resolve(prop.anchor),\n };\n}\n\n/**\n * Interpolate the placement props shared by the image and video fills. Kept in\n * one place so the two fills cannot drift — they describe the same geometry and\n * are consumed by the same `computeImageMatrix`.\n */\n/** @internal */\nexport function lerpImagePlacement(\n a: { crop?: InsetsResolved; zoom?: number; anchor?: Vector2; matrix?: ImageMatrix },\n b: { crop?: InsetsResolved; zoom?: number; anchor?: Vector2; matrix?: ImageMatrix },\n t: number,\n): { crop?: InsetsResolved; zoom: number; anchor: Vector2; matrix?: ImageMatrix } {\n return {\n // A raw matrix is not interpolable geometry — it snaps (at the midpoint,\n // like `fit`), and authors who want a moving matrix bind the prop to a\n // thunk instead.\n matrix: t < 0.5 ? a.matrix : b.matrix,\n // Stay `undefined` when neither side crops, so an uncropped fill keeps\n // taking the cheap path and reads back as it was authored.\n crop: a.crop || b.crop ? insetsOps.lerp(a.crop ?? NO_CROP, b.crop ?? NO_CROP, t) : undefined,\n zoom: lerpNumber(a.zoom ?? 1, b.zoom ?? 1, t),\n anchor: lerpVector2(a.anchor ?? CENTER, b.anchor ?? CENTER, t),\n };\n}\n\nexport const imageFill: FillData<ImageFillResolved> = {\n // `crop`/`anchor` are destructured out before the spread: an optional prop\n // re-added by a later spread widens to a *union* of both types, so leaving\n // them in would type the resolved crop as `ImageCrop | InsetsResolved`.\n // `filters` is destructured out alongside them: it is the deprecated spelling\n // of the grade, folded into `preset` here, and letting it through the spread\n // would leave a stale array on the resolved fill for the renderer to find.\n resolve: ({ crop, anchor, preset, filters, ...prop }: ImageFillProp): ImageFillResolved => ({\n ...prop,\n ...resolveImagePlacement({ crop, anchor }),\n preset: resolveMediaPreset(preset, filters) as\n | MediaPresetResolved<MediaAdjustment>\n | undefined,\n }),\n lerp: (a, b, t) => ({\n src: t < 0.5 ? a.src : b.src,\n fit: t < 0.5 ? a.fit : b.fit,\n ...lerpImagePlacement(a, b, t),\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\n // The grade animates with the fill. Leaving it out let `lerpFill`'s\n // `{...a, ...lerp()}` spread carry the *from* fill's grade for the whole\n // tween, so tweening a fill from `grayscale(0)` to `grayscale(1)` did\n // nothing until the prop snapped to the target at the end.\n preset: lerpMediaPreset(a.preset, b.preset, t),\n }),\n equals: (a, b) => a.src === b.src,\n declare: (fill, assets) => {\n assets.image(fill.src);\n declareMediaPreset(fill.preset, assets);\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"linear-gradient.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/linear-gradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAW,MAAM,6BAA6B,CAAC;AAsBnE,SAAS,YAAY,CAAC,CAAQ;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAW,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAyC;IACpE,OAAO,EAAE,CAAC,IAA4B,EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;QACrC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC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AAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAClD,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\r\nimport type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport { lerpColorRamp } from '../gradient-stops';\r\nimport { lerpVector2, Vector2 } from '@/attributes/layout/vector2';\r\n\r\nexport interface LinearGradientFillProp {\r\n type: 'linear-gradient';\r\n colors: Color[];\r\n stops?: number[];\r\n start?: Vector2;\r\n end?: Vector2;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface LinearGradientFillResolved {\r\n type: 'linear-gradient';\r\n colors: NormalizedColor[];\r\n stops: number[];\r\n start: Vector2;\r\n end: Vector2;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nfunction toNormalized(c: Color): NormalizedColor {\r\n return Array.isArray(c) ? (c as NormalizedColor) : parseColor(c as string);\r\n}\r\n\r\nexport const linearGradientFill: FillData<LinearGradientFillResolved> = {\r\n resolve: (prop: LinearGradientFillProp) => ({\r\n type: 'linear-gradient',\r\n colors: prop.colors.map(toNormalized),\r\n stops: prop.stops ?? prop.colors.map((_, i) => i / Math.max(1, prop.colors.length - 1)),\r\n start: prop.start ?? { x: -1, y: 1 },\r\n end: prop.end ?? { x: 1, y: -1 },\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n }),\r\n lerp: (a, b, t) => ({\r\n ...lerpColorRamp(a, b, t),\r\n start: lerpVector2(a.start, b.start, t),\r\n end: lerpVector2(a.end, b.end, t),\r\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\r\n }),\r\n equals: (a, b) =>\r\n a.start.x === b.start.x && a.start.y === b.start.y &&\r\n a.end.x === b.end.x && a.end.y === b.end.y &&\r\n a.colors.length === b.colors.length &&\r\n a.colors.every((c, i) => c === b.colors[i]),\r\n};\r\n"]}
1
+ {"version":3,"file":"linear-gradient.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/linear-gradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAW,MAAM,6BAA6B,CAAC;AAsBnE,SAAS,YAAY,CAAC,CAAQ;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAW,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAyC;IACpE,OAAO,EAAE,CAAC,IAA4B,EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;QACrC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvF,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QACpC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;QAChC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;KACpB,CAAC;IACF,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChB,GAAG,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzB,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QACvC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACjC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;KACxE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAClD,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpColorRamp } from '../gradient-stops';\nimport { lerpVector2, Vector2 } from '@/attributes/layout/vector2';\n\nexport interface LinearGradientFillProp {\n type: 'linear-gradient';\n colors: Color[];\n stops?: number[];\n start?: Vector2;\n end?: Vector2;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface LinearGradientFillResolved {\n type: 'linear-gradient';\n colors: NormalizedColor[];\n stops: number[];\n start: Vector2;\n end: Vector2;\n opacity?: number;\n blend?: BlendMode;\n}\n\nfunction toNormalized(c: Color): NormalizedColor {\n return Array.isArray(c) ? (c as NormalizedColor) : parseColor(c as string);\n}\n\nexport const linearGradientFill: FillData<LinearGradientFillResolved> = {\n resolve: (prop: LinearGradientFillProp) => ({\n type: 'linear-gradient',\n colors: prop.colors.map(toNormalized),\n stops: prop.stops ?? prop.colors.map((_, i) => i / Math.max(1, prop.colors.length - 1)),\n start: prop.start ?? { x: -1, y: 1 },\n end: prop.end ?? { x: 1, y: -1 },\n opacity: prop.opacity,\n blend: prop.blend,\n }),\n lerp: (a, b, t) => ({\n ...lerpColorRamp(a, b, t),\n start: lerpVector2(a.start, b.start, t),\n end: lerpVector2(a.end, b.end, t),\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\n }),\n equals: (a, b) =>\n a.start.x === b.start.x && a.start.y === b.start.y &&\n a.end.x === b.end.x && a.end.y === b.end.y &&\n a.colors.length === b.colors.length &&\n a.colors.every((c, i) => c === b.colors[i]),\n};\n"]}