@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.8

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 (804) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/NOTICE +15 -14
  3. package/README.md +5 -7
  4. package/dist/assets/errors.js +4 -5
  5. package/dist/assets/errors.js.map +1 -1
  6. package/dist/assets/manager.d.ts.map +1 -1
  7. package/dist/assets/manager.js +7 -5
  8. package/dist/assets/manager.js.map +1 -1
  9. package/dist/assets/scope.d.ts +1 -1
  10. package/dist/assets/scope.d.ts.map +1 -1
  11. package/dist/assets/scope.js +1 -1
  12. package/dist/assets/scope.js.map +1 -1
  13. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  14. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  15. package/dist/attributes/audio/effects/chain.js +67 -0
  16. package/dist/attributes/audio/effects/chain.js.map +1 -0
  17. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  18. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/echo.js +11 -0
  20. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  21. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  22. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/gain.js +6 -0
  24. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  25. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  26. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/highpass.js +10 -0
  28. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  29. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  30. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  31. package/dist/attributes/audio/effects/implementations/lowpass.js +10 -0
  32. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  33. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  34. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  35. package/dist/attributes/audio/effects/implementations/tremolo.js +10 -0
  36. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  37. package/dist/attributes/audio/effects/index.d.ts +12 -0
  38. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  39. package/dist/attributes/audio/effects/index.js +4 -0
  40. package/dist/attributes/audio/effects/index.js.map +1 -0
  41. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  42. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  43. package/dist/attributes/audio/effects/registry.js +80 -0
  44. package/dist/attributes/audio/effects/registry.js.map +1 -0
  45. package/dist/attributes/audio/effects/union.d.ts +14 -0
  46. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  47. package/dist/attributes/audio/effects/union.js +24 -0
  48. package/dist/attributes/audio/effects/union.js.map +1 -0
  49. package/dist/attributes/audio/ramp.d.ts +103 -0
  50. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  51. package/dist/attributes/audio/ramp.js +246 -0
  52. package/dist/attributes/audio/ramp.js.map +1 -0
  53. package/dist/attributes/audio/request.d.ts +24 -13
  54. package/dist/attributes/audio/request.d.ts.map +1 -1
  55. package/dist/attributes/audio/request.js +4 -3
  56. package/dist/attributes/audio/request.js.map +1 -1
  57. package/dist/attributes/audio/schedule.d.ts +24 -31
  58. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  59. package/dist/attributes/audio/schedule.js +42 -28
  60. package/dist/attributes/audio/schedule.js.map +1 -1
  61. package/dist/attributes/audio/sound.d.ts +15 -12
  62. package/dist/attributes/audio/sound.d.ts.map +1 -1
  63. package/dist/attributes/audio/sound.js +8 -10
  64. package/dist/attributes/audio/sound.js.map +1 -1
  65. package/dist/attributes/audio/transition.d.ts +33 -0
  66. package/dist/attributes/audio/transition.d.ts.map +1 -0
  67. package/dist/attributes/audio/transition.js +48 -0
  68. package/dist/attributes/audio/transition.js.map +1 -0
  69. package/dist/attributes/index.d.ts +7 -8
  70. package/dist/attributes/index.d.ts.map +1 -1
  71. package/dist/attributes/index.js +6 -9
  72. package/dist/attributes/index.js.map +1 -1
  73. package/dist/attributes/layout/insets.d.ts +1 -1
  74. package/dist/attributes/layout/insets.js.map +1 -1
  75. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  76. package/dist/attributes/layout/matrix2d.js.map +1 -1
  77. package/dist/attributes/layout/size.d.ts +1 -1
  78. package/dist/attributes/layout/size.js +1 -1
  79. package/dist/attributes/layout/size.js.map +1 -1
  80. package/dist/attributes/layout/space3d.js +1 -1
  81. package/dist/attributes/layout/space3d.js.map +1 -1
  82. package/dist/attributes/properties/decorator.d.ts +44 -11
  83. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  84. package/dist/attributes/properties/decorator.js +37 -9
  85. package/dist/attributes/properties/decorator.js.map +1 -1
  86. package/dist/attributes/properties/inputs.d.ts +1 -1
  87. package/dist/attributes/properties/inputs.js +1 -1
  88. package/dist/attributes/properties/inputs.js.map +1 -1
  89. package/dist/attributes/properties/typed.d.ts +24 -145
  90. package/dist/attributes/properties/typed.d.ts.map +1 -1
  91. package/dist/attributes/properties/typed.js +16 -112
  92. package/dist/attributes/properties/typed.js.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
  94. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  95. package/dist/attributes/shape/corners/corner-radius.js +2 -3
  96. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  97. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  98. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  99. package/dist/attributes/shape/effects/chain.js +93 -283
  100. package/dist/attributes/shape/effects/chain.js.map +1 -1
  101. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  102. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  104. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  106. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  108. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  110. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  112. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  114. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  116. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  118. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  120. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  122. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  124. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  126. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  128. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  130. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  132. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  134. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  136. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  138. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  140. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  142. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  144. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  146. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
  148. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  150. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  152. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  154. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  156. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  158. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  160. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  162. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  164. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  166. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  168. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  170. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  172. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  174. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  176. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  178. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  180. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  182. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  184. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  186. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  188. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  190. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  192. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  194. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  196. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  198. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  200. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  202. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  204. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  206. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  208. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  210. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  212. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  214. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  216. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  218. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  220. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  222. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  224. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  226. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  228. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  230. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  232. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  234. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  236. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  238. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  240. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  242. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  244. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  246. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  248. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  249. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  250. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  251. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  252. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  253. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  254. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  255. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  256. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  257. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  258. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  259. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  260. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  261. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  262. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  263. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  264. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  265. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  266. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  267. package/dist/attributes/shape/effects/index.d.ts +4 -2
  268. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  269. package/dist/attributes/shape/effects/index.js +1 -1
  270. package/dist/attributes/shape/effects/index.js.map +1 -1
  271. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  272. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  273. package/dist/attributes/shape/effects/registry.js +113 -102
  274. package/dist/attributes/shape/effects/registry.js.map +1 -1
  275. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  276. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  277. package/dist/attributes/shape/effects/spec.js +178 -0
  278. package/dist/attributes/shape/effects/spec.js.map +1 -0
  279. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  280. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  281. package/dist/attributes/shape/fill/chain.js +9 -11
  282. package/dist/attributes/shape/fill/chain.js.map +1 -1
  283. package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
  284. package/dist/attributes/shape/fill/color/parser.js +1 -1
  285. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  286. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
  287. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  288. package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
  289. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  290. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  291. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  292. package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
  293. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  294. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  295. package/dist/attributes/shape/fill/index.d.ts +1 -1
  296. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  297. package/dist/attributes/shape/fill/index.js.map +1 -1
  298. package/dist/attributes/shape/fill/lerp.d.ts +1 -1
  299. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  300. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  301. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  302. package/dist/attributes/shape/fill/registry.js +1 -2
  303. package/dist/attributes/shape/fill/registry.js.map +1 -1
  304. package/dist/attributes/shape/filters/chain.d.ts +3 -7
  305. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  306. package/dist/attributes/shape/filters/chain.js +2 -6
  307. package/dist/attributes/shape/filters/chain.js.map +1 -1
  308. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  309. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  310. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  311. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  312. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  313. package/dist/attributes/shape/filters/registry.js +3 -3
  314. package/dist/attributes/shape/filters/registry.js.map +1 -1
  315. package/dist/attributes/shape/filters/union.d.ts +6 -6
  316. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  317. package/dist/attributes/shape/filters/union.js.map +1 -1
  318. package/dist/attributes/shape/path/ops.d.ts +1 -2
  319. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  320. package/dist/attributes/shape/path/ops.js.map +1 -1
  321. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  322. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  323. package/dist/attributes/shape/shaders/index.js +2 -0
  324. package/dist/attributes/shape/shaders/index.js.map +1 -1
  325. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  326. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  327. package/dist/attributes/shape/shaders/language.js +20 -0
  328. package/dist/attributes/shape/shaders/language.js.map +1 -0
  329. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  330. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  331. package/dist/attributes/shape/shaders/pack.js +9 -4
  332. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  333. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  334. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  335. package/dist/attributes/shape/shaders/resolve.js +3 -6
  336. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  337. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  338. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  339. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  340. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  341. package/dist/attributes/shared/operators.d.ts +2 -2
  342. package/dist/attributes/shared/operators.js.map +1 -1
  343. package/dist/attributes/text/types.d.ts +2 -3
  344. package/dist/attributes/text/types.d.ts.map +1 -1
  345. package/dist/attributes/text/types.js.map +1 -1
  346. package/dist/browser/chunks/chunk-AOT33LMS.js +13 -0
  347. package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
  348. package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
  349. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
  350. package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
  351. package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
  352. package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
  353. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
  354. package/dist/browser/component.js +1 -1
  355. package/dist/browser/component.js.map +4 -4
  356. package/dist/browser/experimental.js +1 -1
  357. package/dist/browser/experimental.js.map +4 -4
  358. package/dist/browser/index.js +1 -1
  359. package/dist/browser/index.js.map +4 -4
  360. package/dist/browser/manifest.json +2 -4
  361. package/dist/browser/sdk.js +1 -1
  362. package/dist/component.d.ts +10 -18
  363. package/dist/component.d.ts.map +1 -1
  364. package/dist/component.js +10 -17
  365. package/dist/component.js.map +1 -1
  366. package/dist/components/builtins/audio/audio.d.ts +62 -0
  367. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  368. package/dist/components/builtins/audio/audio.js +38 -0
  369. package/dist/components/builtins/audio/audio.js.map +1 -0
  370. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  371. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  372. package/dist/components/builtins/geometry/composite.js +25 -0
  373. package/dist/components/builtins/geometry/composite.js.map +1 -0
  374. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  375. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  376. package/dist/components/builtins/geometry/geometry.js +107 -0
  377. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  378. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  379. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  380. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  381. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  382. package/dist/components/builtins/layout/layout.d.ts +186 -0
  383. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  384. package/dist/components/builtins/layout/layout.js +84 -0
  385. package/dist/components/builtins/layout/layout.js.map +1 -0
  386. package/dist/components/builtins/media/media.d.ts +240 -0
  387. package/dist/components/builtins/media/media.d.ts.map +1 -0
  388. package/dist/components/builtins/media/media.js +143 -0
  389. package/dist/components/builtins/media/media.js.map +1 -0
  390. package/dist/components/builtins/providers/providers.d.ts +47 -0
  391. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  392. package/dist/components/builtins/providers/providers.js +30 -0
  393. package/dist/components/builtins/providers/providers.js.map +1 -0
  394. package/dist/components/builtins/text/number-format.d.ts +66 -0
  395. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  396. package/dist/components/builtins/text/number-format.js +227 -0
  397. package/dist/components/builtins/text/number-format.js.map +1 -0
  398. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  399. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  400. package/dist/components/builtins/text/number-pattern.js +77 -0
  401. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  402. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  403. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  404. package/dist/components/builtins/text/text-defaults.js +37 -0
  405. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  406. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  407. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  408. package/dist/components/builtins/text/text-layout.js +331 -0
  409. package/dist/components/builtins/text/text-layout.js.map +1 -0
  410. package/dist/components/builtins/text/text.d.ts +409 -0
  411. package/dist/components/builtins/text/text.d.ts.map +1 -0
  412. package/dist/components/builtins/text/text.js +116 -0
  413. package/dist/components/builtins/text/text.js.map +1 -0
  414. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  415. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  416. package/dist/components/builtins/three/canvas3d.js +21 -0
  417. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  418. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  419. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  420. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  421. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  422. package/dist/components/builtins/three/three.d.ts +1889 -0
  423. package/dist/components/builtins/three/three.d.ts.map +1 -0
  424. package/dist/components/builtins/three/three.js +305 -0
  425. package/dist/components/builtins/three/three.js.map +1 -0
  426. package/dist/components/factory/api.d.ts +543 -0
  427. package/dist/components/factory/api.d.ts.map +1 -0
  428. package/dist/components/factory/api.js +4 -0
  429. package/dist/components/factory/api.js.map +1 -0
  430. package/dist/components/factory/clip-of.d.ts +5 -0
  431. package/dist/components/factory/clip-of.d.ts.map +1 -0
  432. package/dist/components/factory/clip-of.js +33 -0
  433. package/dist/components/factory/clip-of.js.map +1 -0
  434. package/dist/components/factory/commands-for.d.ts +19 -0
  435. package/dist/components/factory/commands-for.d.ts.map +1 -0
  436. package/dist/components/factory/commands-for.js +5 -0
  437. package/dist/components/factory/commands-for.js.map +1 -0
  438. package/dist/components/factory/component-audio.d.ts +9 -0
  439. package/dist/components/factory/component-audio.d.ts.map +1 -0
  440. package/dist/components/factory/component-audio.js +18 -0
  441. package/dist/components/factory/component-audio.js.map +1 -0
  442. package/dist/components/factory/component2d.d.ts +8 -0
  443. package/dist/components/factory/component2d.d.ts.map +1 -0
  444. package/dist/components/factory/component2d.js +240 -0
  445. package/dist/components/factory/component2d.js.map +1 -0
  446. package/dist/components/factory/component3d.d.ts +9 -0
  447. package/dist/components/factory/component3d.d.ts.map +1 -0
  448. package/dist/components/factory/component3d.js +107 -0
  449. package/dist/components/factory/component3d.js.map +1 -0
  450. package/dist/components/factory/factory.d.ts +66 -0
  451. package/dist/components/factory/factory.d.ts.map +1 -0
  452. package/dist/components/factory/factory.js +347 -0
  453. package/dist/components/factory/factory.js.map +1 -0
  454. package/dist/components/factory/timeline.d.ts +22 -0
  455. package/dist/components/factory/timeline.d.ts.map +1 -0
  456. package/dist/components/factory/timeline.js +128 -0
  457. package/dist/components/factory/timeline.js.map +1 -0
  458. package/dist/components/factory/type-def.d.ts +26 -0
  459. package/dist/components/factory/type-def.d.ts.map +1 -0
  460. package/dist/components/factory/type-def.js +16 -0
  461. package/dist/components/factory/type-def.js.map +1 -0
  462. package/dist/components/factory/types.d.ts +91 -0
  463. package/dist/components/factory/types.d.ts.map +1 -0
  464. package/dist/components/factory/types.js +88 -0
  465. package/dist/components/factory/types.js.map +1 -0
  466. package/dist/components/factory/views.d.ts +121 -0
  467. package/dist/components/factory/views.d.ts.map +1 -0
  468. package/dist/components/factory/views.js +413 -0
  469. package/dist/components/factory/views.js.map +1 -0
  470. package/dist/components/modules/aim.d.ts +30 -0
  471. package/dist/components/modules/aim.d.ts.map +1 -0
  472. package/dist/components/modules/aim.js +39 -0
  473. package/dist/components/modules/aim.js.map +1 -0
  474. package/dist/components/modules/corners.d.ts +13 -0
  475. package/dist/components/modules/corners.d.ts.map +1 -0
  476. package/dist/components/modules/corners.js +12 -0
  477. package/dist/components/modules/corners.js.map +1 -0
  478. package/dist/components/modules/flow.d.ts +26 -0
  479. package/dist/components/modules/flow.d.ts.map +1 -0
  480. package/dist/components/modules/flow.js +57 -0
  481. package/dist/components/modules/flow.js.map +1 -0
  482. package/dist/components/modules/material.d.ts +40 -0
  483. package/dist/components/modules/material.d.ts.map +1 -0
  484. package/dist/components/modules/material.js +75 -0
  485. package/dist/components/modules/material.js.map +1 -0
  486. package/dist/components/modules/paint.d.ts +71 -0
  487. package/dist/components/modules/paint.d.ts.map +1 -0
  488. package/dist/components/modules/paint.js +106 -0
  489. package/dist/components/modules/paint.js.map +1 -0
  490. package/dist/components/modules/shapes.d.ts +31 -0
  491. package/dist/components/modules/shapes.d.ts.map +1 -0
  492. package/dist/components/modules/shapes.js +43 -0
  493. package/dist/components/modules/shapes.js.map +1 -0
  494. package/dist/components/modules/text-layout.d.ts +26 -0
  495. package/dist/components/modules/text-layout.d.ts.map +1 -0
  496. package/dist/components/modules/text-layout.js +57 -0
  497. package/dist/components/modules/text-layout.js.map +1 -0
  498. package/dist/components/modules/text-style.d.ts +48 -0
  499. package/dist/components/modules/text-style.d.ts.map +1 -0
  500. package/dist/components/modules/text-style.js +63 -0
  501. package/dist/components/modules/text-style.js.map +1 -0
  502. package/dist/components/modules/three-entries.d.ts +23 -0
  503. package/dist/components/modules/three-entries.d.ts.map +1 -0
  504. package/dist/components/modules/three-entries.js +41 -0
  505. package/dist/components/modules/three-entries.js.map +1 -0
  506. package/dist/components/modules/view3d.d.ts +59 -0
  507. package/dist/components/modules/view3d.d.ts.map +1 -0
  508. package/dist/components/modules/view3d.js +171 -0
  509. package/dist/components/modules/view3d.js.map +1 -0
  510. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  511. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  512. package/dist/components/trees/2d/group-bounds.js +87 -0
  513. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  514. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  515. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  516. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  517. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  518. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  519. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  520. package/dist/components/trees/2d/node-motion.js +86 -0
  521. package/dist/components/trees/2d/node-motion.js.map +1 -0
  522. package/dist/components/trees/2d/node-render.d.ts +36 -0
  523. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  524. package/dist/components/trees/2d/node-render.js +67 -0
  525. package/dist/components/trees/2d/node-render.js.map +1 -0
  526. package/dist/components/trees/2d/node-space.d.ts +63 -0
  527. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  528. package/dist/components/trees/2d/node-space.js +131 -0
  529. package/dist/components/trees/2d/node-space.js.map +1 -0
  530. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  531. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  532. package/dist/components/trees/2d/node-transform.js +73 -0
  533. package/dist/components/trees/2d/node-transform.js.map +1 -0
  534. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  535. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  536. package/dist/components/trees/2d/node2d.js +1481 -0
  537. package/dist/components/trees/2d/node2d.js.map +1 -0
  538. package/dist/components/trees/audio/index.d.ts +2 -0
  539. package/dist/components/trees/audio/index.d.ts.map +1 -0
  540. package/dist/components/trees/audio/index.js +2 -0
  541. package/dist/components/trees/audio/index.js.map +1 -0
  542. package/dist/components/trees/audio/node-audio.d.ts +116 -0
  543. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  544. package/dist/components/trees/audio/node-audio.js +171 -0
  545. package/dist/components/trees/audio/node-audio.js.map +1 -0
  546. package/dist/components/trees/index.d.ts +10 -0
  547. package/dist/components/trees/index.d.ts.map +1 -0
  548. package/dist/components/trees/index.js +14 -0
  549. package/dist/components/trees/index.js.map +1 -0
  550. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  551. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  552. package/dist/components/trees/node/node-editor-state.js +23 -0
  553. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  554. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  555. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  556. package/dist/components/trees/node/node-reactive.js +135 -0
  557. package/dist/components/trees/node/node-reactive.js.map +1 -0
  558. package/dist/components/trees/node/node-time.d.ts +39 -0
  559. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  560. package/dist/components/trees/node/node-time.js +14 -0
  561. package/dist/components/trees/node/node-time.js.map +1 -0
  562. package/dist/components/trees/node/node-walk.d.ts +46 -0
  563. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  564. package/dist/components/trees/node/node-walk.js +74 -0
  565. package/dist/components/trees/node/node-walk.js.map +1 -0
  566. package/dist/components/trees/node/node.d.ts +401 -0
  567. package/dist/components/trees/node/node.d.ts.map +1 -0
  568. package/dist/components/trees/node/node.js +680 -0
  569. package/dist/components/trees/node/node.js.map +1 -0
  570. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  571. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  572. package/dist/components/trees/root/canvas2d-node.js +216 -0
  573. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  574. package/dist/components/trees/three/node3d.d.ts +222 -0
  575. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  576. package/dist/components/trees/three/node3d.js +289 -0
  577. package/dist/components/trees/three/node3d.js.map +1 -0
  578. package/dist/document/builtins.js +13 -13
  579. package/dist/document/builtins.js.map +1 -1
  580. package/dist/document/command-traits.d.ts +14 -4
  581. package/dist/document/command-traits.d.ts.map +1 -1
  582. package/dist/document/command-traits.js +35 -7
  583. package/dist/document/command-traits.js.map +1 -1
  584. package/dist/document/deny-globals.d.ts +2 -2
  585. package/dist/document/deny-globals.js +2 -2
  586. package/dist/document/deny-globals.js.map +1 -1
  587. package/dist/document/expression/index.d.ts +1 -1
  588. package/dist/document/expression/index.js +1 -1
  589. package/dist/document/expression/index.js.map +1 -1
  590. package/dist/document/expression/ops.js +1 -1
  591. package/dist/document/expression/ops.js.map +1 -1
  592. package/dist/document/index.d.ts +9 -2
  593. package/dist/document/index.d.ts.map +1 -1
  594. package/dist/document/index.js +5 -2
  595. package/dist/document/index.js.map +1 -1
  596. package/dist/document/migrate.d.ts +70 -0
  597. package/dist/document/migrate.d.ts.map +1 -0
  598. package/dist/document/migrate.js +202 -0
  599. package/dist/document/migrate.js.map +1 -0
  600. package/dist/document/missing-node.d.ts +27 -0
  601. package/dist/document/missing-node.d.ts.map +1 -0
  602. package/dist/document/missing-node.js +48 -0
  603. package/dist/document/missing-node.js.map +1 -0
  604. package/dist/document/node-decorator.d.ts +14 -10
  605. package/dist/document/node-decorator.d.ts.map +1 -1
  606. package/dist/document/node-decorator.js +14 -10
  607. package/dist/document/node-decorator.js.map +1 -1
  608. package/dist/document/node-descriptor.d.ts +7 -3
  609. package/dist/document/node-descriptor.d.ts.map +1 -1
  610. package/dist/document/node-descriptor.js.map +1 -1
  611. package/dist/document/placement.d.ts +2 -1
  612. package/dist/document/placement.d.ts.map +1 -1
  613. package/dist/document/placement.js.map +1 -1
  614. package/dist/document/project.d.ts +2 -0
  615. package/dist/document/project.d.ts.map +1 -1
  616. package/dist/document/project.js +1 -0
  617. package/dist/document/project.js.map +1 -1
  618. package/dist/document/prop-evolution.d.ts +51 -0
  619. package/dist/document/prop-evolution.d.ts.map +1 -0
  620. package/dist/document/prop-evolution.js +83 -0
  621. package/dist/document/prop-evolution.js.map +1 -0
  622. package/dist/document/registry.d.ts +39 -25
  623. package/dist/document/registry.d.ts.map +1 -1
  624. package/dist/document/registry.js +41 -21
  625. package/dist/document/registry.js.map +1 -1
  626. package/dist/document/settled-index.d.ts +2 -0
  627. package/dist/document/settled-index.d.ts.map +1 -1
  628. package/dist/document/settled-index.js +5 -5
  629. package/dist/document/settled-index.js.map +1 -1
  630. package/dist/document/timeline-patch.d.ts +4 -0
  631. package/dist/document/timeline-patch.d.ts.map +1 -1
  632. package/dist/document/timeline-patch.js +28 -3
  633. package/dist/document/timeline-patch.js.map +1 -1
  634. package/dist/document/timeline.d.ts +48 -4
  635. package/dist/document/timeline.d.ts.map +1 -1
  636. package/dist/document/timeline.js +174 -44
  637. package/dist/document/timeline.js.map +1 -1
  638. package/dist/document/types.d.ts +18 -32
  639. package/dist/document/types.d.ts.map +1 -1
  640. package/dist/document/types.js.map +1 -1
  641. package/dist/document/validate.d.ts +18 -6
  642. package/dist/document/validate.d.ts.map +1 -1
  643. package/dist/document/validate.js +158 -21
  644. package/dist/document/validate.js.map +1 -1
  645. package/dist/document/vocabulary.d.ts +28 -0
  646. package/dist/document/vocabulary.d.ts.map +1 -0
  647. package/dist/document/vocabulary.js +42 -0
  648. package/dist/document/vocabulary.js.map +1 -0
  649. package/dist/experimental.d.ts +79 -19
  650. package/dist/experimental.d.ts.map +1 -1
  651. package/dist/experimental.js +31 -17
  652. package/dist/experimental.js.map +1 -1
  653. package/dist/index.d.ts +10 -11
  654. package/dist/index.d.ts.map +1 -1
  655. package/dist/index.js +10 -11
  656. package/dist/index.js.map +1 -1
  657. package/dist/layout/types.d.ts +1 -1
  658. package/dist/layout/types.js.map +1 -1
  659. package/dist/platform/exporter.d.ts +13 -0
  660. package/dist/platform/exporter.d.ts.map +1 -1
  661. package/dist/platform/exporter.js.map +1 -1
  662. package/dist/props/host.d.ts +1 -1
  663. package/dist/props/host.js.map +1 -1
  664. package/dist/props/slot.d.ts +1 -1
  665. package/dist/props/slot.js +1 -1
  666. package/dist/props/slot.js.map +1 -1
  667. package/dist/renamed-scene-names.d.ts +1 -1
  668. package/dist/renamed-scene-names.d.ts.map +1 -1
  669. package/dist/renamed-scene-names.js +1 -1
  670. package/dist/renamed-scene-names.js.map +1 -1
  671. package/dist/render/canvas-render-context2d.d.ts +9 -0
  672. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  673. package/dist/render/canvas-render-context2d.js +10 -0
  674. package/dist/render/canvas-render-context2d.js.map +1 -1
  675. package/dist/render/clip-contains.js +1 -1
  676. package/dist/render/clip-contains.js.map +1 -1
  677. package/dist/render/clip.d.ts +1 -1
  678. package/dist/render/clip.js +1 -1
  679. package/dist/render/clip.js.map +1 -1
  680. package/dist/render/descriptors/rect.js.map +1 -1
  681. package/dist/render/descriptors/text.d.ts +13 -7
  682. package/dist/render/descriptors/text.d.ts.map +1 -1
  683. package/dist/render/descriptors/text.js +9 -3
  684. package/dist/render/descriptors/text.js.map +1 -1
  685. package/dist/render/index.d.ts +2 -0
  686. package/dist/render/index.d.ts.map +1 -1
  687. package/dist/render/index.js +1 -0
  688. package/dist/render/index.js.map +1 -1
  689. package/dist/render/render-context2d.d.ts +3 -3
  690. package/dist/render/render-context2d.js.map +1 -1
  691. package/dist/render/render-issue.d.ts +39 -0
  692. package/dist/render/render-issue.d.ts.map +1 -0
  693. package/dist/render/render-issue.js +29 -0
  694. package/dist/render/render-issue.js.map +1 -0
  695. package/dist/render/surface.d.ts +2 -2
  696. package/dist/render/surface.js.map +1 -1
  697. package/dist/render3d/builders.d.ts +1 -1
  698. package/dist/render3d/builders.js +1 -1
  699. package/dist/render3d/builders.js.map +1 -1
  700. package/dist/render3d/graphics3d.d.ts +13 -19
  701. package/dist/render3d/graphics3d.d.ts.map +1 -1
  702. package/dist/render3d/graphics3d.js +67 -24
  703. package/dist/render3d/graphics3d.js.map +1 -1
  704. package/dist/render3d/scene3d.d.ts +1 -1
  705. package/dist/render3d/scene3d.js +1 -1
  706. package/dist/render3d/scene3d.js.map +1 -1
  707. package/dist/render3d/texture.d.ts +2 -2
  708. package/dist/render3d/texture.d.ts.map +1 -1
  709. package/dist/render3d/texture.js.map +1 -1
  710. package/dist/render3d/vector3.d.ts +2 -2
  711. package/dist/render3d/vector3.js +2 -2
  712. package/dist/render3d/vector3.js.map +1 -1
  713. package/dist/runtime/asset-refine.d.ts +1 -1
  714. package/dist/runtime/asset-refine.d.ts.map +1 -1
  715. package/dist/runtime/asset-refine.js +3 -2
  716. package/dist/runtime/asset-refine.js.map +1 -1
  717. package/dist/runtime/asset-timeline.d.ts +10 -0
  718. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  719. package/dist/runtime/asset-timeline.js.map +1 -1
  720. package/dist/runtime/asset-update.d.ts.map +1 -1
  721. package/dist/runtime/asset-update.js +8 -1
  722. package/dist/runtime/asset-update.js.map +1 -1
  723. package/dist/runtime/audio-index.d.ts +0 -11
  724. package/dist/runtime/audio-index.d.ts.map +1 -1
  725. package/dist/runtime/audio-index.js +0 -25
  726. package/dist/runtime/audio-index.js.map +1 -1
  727. package/dist/runtime/clip-instance.d.ts +6 -4
  728. package/dist/runtime/clip-instance.d.ts.map +1 -1
  729. package/dist/runtime/clip-instance.js +8 -4
  730. package/dist/runtime/clip-instance.js.map +1 -1
  731. package/dist/runtime/clip-store.d.ts +2 -3
  732. package/dist/runtime/clip-store.d.ts.map +1 -1
  733. package/dist/runtime/clip-store.js +34 -37
  734. package/dist/runtime/clip-store.js.map +1 -1
  735. package/dist/runtime/engine.d.ts +8 -6
  736. package/dist/runtime/engine.d.ts.map +1 -1
  737. package/dist/runtime/engine.js +4 -3
  738. package/dist/runtime/engine.js.map +1 -1
  739. package/dist/runtime/node-picking.d.ts +2 -2
  740. package/dist/runtime/node-picking.d.ts.map +1 -1
  741. package/dist/runtime/node-picking.js +3 -3
  742. package/dist/runtime/node-picking.js.map +1 -1
  743. package/dist/runtime/node-picking3d.d.ts +2 -2
  744. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  745. package/dist/runtime/node-picking3d.js +1 -1
  746. package/dist/runtime/node-picking3d.js.map +1 -1
  747. package/dist/runtime/playback-controller.d.ts +2 -2
  748. package/dist/runtime/playback-controller.d.ts.map +1 -1
  749. package/dist/runtime/playback-controller.js +15 -5
  750. package/dist/runtime/playback-controller.js.map +1 -1
  751. package/dist/runtime/session.d.ts +7 -3
  752. package/dist/runtime/session.d.ts.map +1 -1
  753. package/dist/runtime/session.js +11 -4
  754. package/dist/runtime/session.js.map +1 -1
  755. package/dist/runtime/state-evaluator.d.ts +2 -2
  756. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  757. package/dist/runtime/state-evaluator.js.map +1 -1
  758. package/dist/runtime/text-geometry.d.ts +2 -2
  759. package/dist/runtime/text-geometry.d.ts.map +1 -1
  760. package/dist/runtime/text-geometry.js +4 -5
  761. package/dist/runtime/text-geometry.js.map +1 -1
  762. package/dist/sdk/index.d.ts +50 -44
  763. package/dist/sdk/index.d.ts.map +1 -1
  764. package/dist/sdk/index.js +35 -29
  765. package/dist/sdk/index.js.map +1 -1
  766. package/dist/tween/command-decorator.d.ts +14 -9
  767. package/dist/tween/command-decorator.d.ts.map +1 -1
  768. package/dist/tween/command-decorator.js +3 -2
  769. package/dist/tween/command-decorator.js.map +1 -1
  770. package/dist/tween/command.d.ts +1 -1
  771. package/dist/tween/command.js.map +1 -1
  772. package/dist/tween/ease/describe.d.ts +2 -0
  773. package/dist/tween/ease/describe.d.ts.map +1 -1
  774. package/dist/tween/ease/describe.js +4 -0
  775. package/dist/tween/ease/describe.js.map +1 -1
  776. package/dist/tween/ease/spec.d.ts +31 -0
  777. package/dist/tween/ease/spec.d.ts.map +1 -0
  778. package/dist/tween/ease/spec.js +51 -0
  779. package/dist/tween/ease/spec.js.map +1 -0
  780. package/dist/tween/index.d.ts +3 -1
  781. package/dist/tween/index.d.ts.map +1 -1
  782. package/dist/tween/index.js +2 -1
  783. package/dist/tween/index.js.map +1 -1
  784. package/dist/tween/loop.d.ts +1 -1
  785. package/dist/tween/loop.js +1 -1
  786. package/dist/tween/loop.js.map +1 -1
  787. package/dist/util/reference.d.ts +6 -6
  788. package/dist/util/reference.js.map +1 -1
  789. package/package.json +3 -11
  790. package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
  791. package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
  792. package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
  793. package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
  794. package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
  795. package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
  796. package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
  797. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  798. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  799. package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
  800. package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
  801. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  802. package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
  803. package/dist/browser/jsx-jsx-runtime.js +0 -2
  804. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
@@ -1,25 +1,31 @@
1
- import { lerpNumber } from "../../../../tween/lerp.js";
2
- export const glassEffect = {
3
- lerp: (from, to, t) => ({
4
- type: "glass",
5
- lightAngle: lerpNumber(from.lightAngle, to.lightAngle, t),
6
- lightIntensity: lerpNumber(from.lightIntensity, to.lightIntensity, t),
7
- refraction: lerpNumber(from.refraction, to.refraction, t),
8
- depth: lerpNumber(from.depth, to.depth, t),
9
- dispersion: lerpNumber(from.dispersion, to.dispersion, t),
10
- frost: lerpNumber(from.frost, to.frost, t),
11
- splay: lerpNumber(from.splay, to.splay, t),
12
- mode: t < 0.5 ? from.mode : to.mode,
13
- }),
14
- equals: (a, b) => a.lightAngle === b.lightAngle &&
15
- a.lightIntensity === b.lightIntensity &&
16
- a.refraction === b.refraction &&
17
- a.depth === b.depth &&
18
- a.dispersion === b.dispersion &&
19
- a.frost === b.frost &&
20
- a.splay === b.splay &&
21
- a.mode === b.mode,
1
+ import { defineEffect, effectDataOf, param } from "../spec.js";
2
+ /** The {@link GlassEffect} spec: its parameters, defaults and ranges. */
3
+ export const glassSpec = defineEffect({
4
+ type: "glass",
5
+ group: "light",
22
6
  // Resamples the backdrop through a bevel, three times per fragment.
23
7
  surface: "shader",
24
- };
8
+ scalar: "refraction",
9
+ defaultMode: "backdrop",
10
+ onlyOn: "backdrop",
11
+ // No curved edge means nothing to refract or light along.
12
+ neutral: { depth: 0 },
13
+ params: {
14
+ /** Where the light comes from, in degrees clockwise from the top. */
15
+ lightAngle: param.number({ default: -45, unit: "deg", control: "angle", zero: "top" }),
16
+ /** 0–100 brightness of the light. */
17
+ lightIntensity: param.number({ default: 80, min: 0, max: 100, unit: "percent" }),
18
+ /** 0–100 how strongly the curved edge bends the backdrop. */
19
+ refraction: param.number({ default: 80, min: 0, max: 100, step: 1, control: "slider", inline: true }),
20
+ /** How far the curved edge reaches in from the outline, px. */
21
+ depth: param.number({ default: 20, min: 0, max: 100, step: 1, unit: "px", control: "slider" }),
22
+ /** 0–100 spectral split along the curved edge. */
23
+ dispersion: param.number({ default: 50, min: 0, max: 100, step: 1, control: "slider" }),
24
+ /** Backdrop blur radius, px. */
25
+ frost: param.number({ default: 4, min: 0, max: 100, step: 1, unit: "px", control: "slider" }),
26
+ /** 0–100 how far the projected light spreads in from the rim. */
27
+ splay: param.number({ default: 0, min: 0, max: 100, step: 1, control: "slider" }),
28
+ },
29
+ });
30
+ export const glassEffect = effectDataOf(glassSpec);
25
31
  //# sourceMappingURL=glass.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glass.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/glass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsC1C,MAAM,CAAC,MAAM,WAAW,GAA4B;IAChD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QACzD,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;QACrE,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QACzD,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1C,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QACzD,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1C,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1C,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI;KACtC,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,cAAc,KAAK,CAAC,CAAC,cAAc;QACrC,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;IACrB,oEAAoE;IACpE,OAAO,EAAE,QAAQ;CACpB,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport type { ModedEffect, EffectData } from \"../effect-data\";\r\n\r\n/**\r\n * Figma's Glass: the backdrop seen through a slab of glass whose edge curves\r\n * down to the node's outline — refracted, split into a spectrum at the curve,\r\n * optionally frosted, with a rim of light.\r\n *\r\n * The fields are Figma's own, in Figma's units, so values copied from a Figma\r\n * file render the same: `depth` and `frost` are px, `lightAngle` is degrees\r\n * clockwise from the top, and the rest are 0–100 amounts.\r\n *\r\n * Glass only has meaning on the **backdrop** — there is nothing to refract in a\r\n * node's own paint — so `Effects.glass()` defaults `mode` to `'backdrop'` and the\r\n * renderer's handler serves that target only.\r\n */\r\nexport interface GlassEffect extends ModedEffect {\r\n type: \"glass\";\r\n /**\r\n * Where the light comes from, in degrees clockwise from the top — Figma's\r\n * convention rather than the right-hand zero the other effects use, so\r\n * Figma's `-45°` (top left) means the same here.\r\n */\r\n lightAngle: number;\r\n /** 0–100 brightness of the rim light and of the light projected through the bevel. */\r\n lightIntensity: number;\r\n /** 0–100 how strongly the curved edge bends what is behind it. */\r\n refraction: number;\r\n /** How far the curved edge reaches in from the outline, px; past half the node's short side it is a dome. 0 is no glass. */\r\n depth: number;\r\n /** 0–100 how far the curved edge splits what it bends into a spectrum. */\r\n dispersion: number;\r\n /** Blur of what is behind the glass, as a Figma blur radius in px (twice the Gaussian sigma). */\r\n frost: number;\r\n /** 0–100 how far the light projected through the bevel spreads in from the rim. */\r\n splay: number;\r\n}\r\n\r\nexport const glassEffect: EffectData<GlassEffect> = {\r\n lerp: (from, to, t) => ({\r\n type: \"glass\",\r\n lightAngle: lerpNumber(from.lightAngle, to.lightAngle, t),\r\n lightIntensity: lerpNumber(from.lightIntensity, to.lightIntensity, t),\r\n refraction: lerpNumber(from.refraction, to.refraction, t),\r\n depth: lerpNumber(from.depth, to.depth, t),\r\n dispersion: lerpNumber(from.dispersion, to.dispersion, t),\r\n frost: lerpNumber(from.frost, to.frost, t),\r\n splay: lerpNumber(from.splay, to.splay, t),\r\n mode: t < 0.5 ? from.mode : to.mode,\r\n }),\r\n equals: (a, b) =>\r\n a.lightAngle === b.lightAngle &&\r\n a.lightIntensity === b.lightIntensity &&\r\n a.refraction === b.refraction &&\r\n a.depth === b.depth &&\r\n a.dispersion === b.dispersion &&\r\n a.frost === b.frost &&\r\n a.splay === b.splay &&\r\n a.mode === b.mode,\r\n // Resamples the backdrop through a bevel, three times per fragment.\r\n surface: \"shader\",\r\n};\r\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C;QAC9F,kDAAkD;QAClD,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QACvF,gCAAgC;QAChC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QAC7F,iEAAiE;QACjE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;KACpF;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAA4B,YAAY,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import type { ModedEffect, EffectData } from \"../effect-data\";\r\nimport { defineEffect, effectDataOf, param, type EffectFields } from \"../spec\";\r\n\r\n/**\r\n * Figma's Glass: the backdrop seen through a slab of glass whose edge curves\r\n * down to the node's outline — refracted, split into a spectrum at the curve,\r\n * optionally frosted, with a rim of light.\r\n *\r\n * The fields are Figma's own, in Figma's units, so values copied from a Figma\r\n * file render the same: `depth` and `frost` are px, `lightAngle` is degrees\r\n * clockwise from the top, and the rest are 0–100 amounts.\r\n *\r\n * Glass only has meaning on the **backdrop** — there is nothing to refract in a\r\n * node's own paint — so `Effects.glass()` defaults `mode` to `'backdrop'` and the\r\n * renderer's handler serves that target only.\r\n */\r\nexport interface GlassEffect extends ModedEffect, EffectFields<typeof glassSpec.params> {\r\n type: \"glass\";\r\n}\r\n\r\n/** The {@link GlassEffect} spec: its parameters, defaults and ranges. */\r\nexport const glassSpec = defineEffect({\r\n type: \"glass\",\r\n group: \"light\",\r\n // Resamples the backdrop through a bevel, three times per fragment.\r\n surface: \"shader\",\r\n scalar: \"refraction\",\r\n defaultMode: \"backdrop\",\r\n onlyOn: \"backdrop\",\r\n // No curved edge means nothing to refract or light along.\r\n neutral: { depth: 0 },\r\n params: {\r\n /** Where the light comes from, in degrees clockwise from the top. */\r\n lightAngle: param.number({ default: -45, unit: \"deg\", control: \"angle\", zero: \"top\" }),\r\n /** 0–100 brightness of the light. */\r\n lightIntensity: param.number({ default: 80, min: 0, max: 100, unit: \"percent\" }),\r\n /** 0–100 how strongly the curved edge bends the backdrop. */\r\n refraction: param.number({ default: 80, min: 0, max: 100, step: 1, control: \"slider\", inline: true }),\r\n /** How far the curved edge reaches in from the outline, px. */\r\n depth: param.number({ default: 20, min: 0, max: 100, step: 1, unit: \"px\", control: \"slider\" }),\r\n /** 0–100 spectral split along the curved edge. */\r\n dispersion: param.number({ default: 50, min: 0, max: 100, step: 1, control: \"slider\" }),\r\n /** Backdrop blur radius, px. */\r\n frost: param.number({ default: 4, min: 0, max: 100, step: 1, unit: \"px\", control: \"slider\" }),\r\n /** 0–100 how far the projected light spreads in from the rim. */\r\n splay: param.number({ default: 0, min: 0, max: 100, step: 1, control: \"slider\" }),\r\n },\r\n});\r\n\r\nexport const glassEffect: EffectData<GlassEffect> = effectDataOf(glassSpec);\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { BlendMode } from "../../../../attributes/shape/fill/blend.js";
2
1
  import type { Color } from "../../../../attributes/shape/fill/color/parser.js";
3
- import type { EffectAxis, ModedEffect, EffectData } from "../effect-data.js";
2
+ import type { ModedEffect, EffectData } from "../effect-data.js";
3
+ import { type EffectFields } from "../spec.js";
4
4
  /**
5
5
  * What the glow reads to decide how much a pixel glows.
6
6
  *
@@ -24,7 +24,7 @@ export type GlowTint = "none" | "solid" | "ramp";
24
24
  /**
25
25
  * How the ramp repeats once {@link GlowEffect.cycles} takes it past one pass.
26
26
  *
27
- * The two names are Skia's own tile modes, and mean here what they mean there:
27
+ * The two names are the usual gradient tile modes, and mean what they mean there:
28
28
  * `"repeat"` restarts at the first stop (a hard seam between last and first),
29
29
  * `"mirror"` walks back down through the stops (seamless, at the cost of
30
30
  * halving the apparent frequency).
@@ -42,52 +42,159 @@ export type GlowOriginal = "behind" | "front" | "hidden";
42
42
  * can only screen its bright-pass back. This spreads past the box, chooses its
43
43
  * compositing, and can be coloured. See {@link EffectData.surface} below.
44
44
  */
45
- export interface GlowEffect extends ModedEffect {
45
+ export interface GlowEffect extends ModedEffect, EffectFields<typeof glowSpec.params> {
46
46
  type: "glow";
47
+ }
48
+ /** The {@link GlowEffect} spec: its parameters, defaults and ranges. */
49
+ export declare const glowSpec: import("../spec.js").EffectSpec<"glow", {
47
50
  /** What decides a pixel's glow strength. */
48
- channel: GlowChannel;
49
- /**
50
- * Luminance below which a pixel does not glow, 0–1.
51
- *
52
- * Read only when {@link channel} is `"luminance"` — an alpha-driven glow has
53
- * no brightness to cut at.
54
- */
55
- threshold: number;
56
- /** How far the glow spreads, in px. 0 = off. */
57
- radius: number;
58
- /**
59
- * How far the source is dilated *before* blurring, in px.
60
- *
61
- * The same knob a drop shadow has, and it does the same job: `radius` alone
62
- * gives a glow that fades from the edge, while `spread` gives it a solid
63
- * core to fade from.
64
- */
65
- spread: number;
66
- /** Brightness of the glow. 1 is unscaled; 0 is off. */
67
- intensity: number;
68
- /** Which way the glow spreads. `"x"`/`"y"` give anamorphic streaks. */
69
- axis: EffectAxis;
51
+ readonly channel: import("../spec.js").EffectParamDef<"alpha" | "luminance", "alpha" | "luminance"> & NoInfer<{
52
+ readonly default: "luminance";
53
+ readonly control: "segmented";
54
+ readonly optionsLabel: "glowChannel";
55
+ readonly order: 9;
56
+ }> & {
57
+ kind: "enum";
58
+ options: readonly ("alpha" | "luminance")[];
59
+ };
60
+ /** 0-1 luminance cutoff; read only when `channel` is `'luminance'`. */
61
+ readonly threshold: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
62
+ readonly default: 0.5;
63
+ readonly min: 0;
64
+ readonly max: 1;
65
+ readonly control: "slider";
66
+ readonly order: 0;
67
+ }> & {
68
+ kind: "number";
69
+ };
70
+ /** Spread distance in pixels. */
71
+ readonly radius: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
72
+ readonly default: 25;
73
+ readonly min: 0;
74
+ readonly unit: "px";
75
+ readonly order: 1;
76
+ }> & {
77
+ kind: "number";
78
+ };
79
+ /** Dilation applied before the blur, in pixels — gives the glow a solid core. */
80
+ readonly spread: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
81
+ readonly default: 0;
82
+ readonly min: 0;
83
+ readonly unit: "px";
84
+ readonly order: 2;
85
+ }> & {
86
+ kind: "number";
87
+ };
88
+ /** Additive multiplier for the glow pass. */
89
+ readonly intensity: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
90
+ readonly default: 1;
91
+ readonly min: 0;
92
+ readonly max: 3;
93
+ readonly control: "slider";
94
+ readonly inline: true;
95
+ readonly order: 3;
96
+ }> & {
97
+ kind: "number";
98
+ };
99
+ /** Which way the glow spreads; `'x'`/`'y'` give anamorphic streaks. */
100
+ readonly axis: import("../spec.js").EffectParamDef<import("../index.js").EffectAxis, import("../index.js").EffectAxis> & NoInfer<{
101
+ readonly default: "both";
102
+ readonly control: "segmented";
103
+ readonly optionsLabel: "effectAxis";
104
+ readonly order: 10;
105
+ }> & {
106
+ kind: "axis";
107
+ };
70
108
  /** Where the source layer sits relative to the glow. */
71
- original: GlowOriginal;
109
+ readonly original: import("../spec.js").EffectParamDef<"hidden" | "behind" | "front", "hidden" | "behind" | "front"> & NoInfer<{
110
+ readonly default: "behind";
111
+ readonly control: "segmented";
112
+ readonly optionsLabel: "glowOriginal";
113
+ readonly order: 11;
114
+ }> & {
115
+ kind: "enum";
116
+ options: readonly ("hidden" | "behind" | "front")[];
117
+ };
72
118
  /** How the glow merges with the layer. */
73
- blend: BlendMode;
119
+ readonly blend: import("../spec.js").EffectParamDef<"color" | "hue" | "saturation" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "luminosity" | "normal", "color" | "hue" | "saturation" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "luminosity" | "normal"> & NoInfer<{
120
+ readonly default: "screen";
121
+ readonly optionsLabel: "blendMode";
122
+ readonly order: 12;
123
+ }> & {
124
+ kind: "enum";
125
+ options: readonly ("color" | "hue" | "saturation" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "luminosity" | "normal")[];
126
+ };
74
127
  /** What the glow is coloured with. */
75
- tint: GlowTint;
76
- /** The glow's colour when {@link tint} is `"solid"`. */
77
- color: Color;
128
+ readonly tint: import("../spec.js").EffectParamDef<"none" | "solid" | "ramp", "none" | "solid" | "ramp"> & NoInfer<{
129
+ readonly default: "none";
130
+ readonly control: "segmented";
131
+ readonly optionsLabel: "glowTint";
132
+ readonly order: 4;
133
+ }> & {
134
+ kind: "enum";
135
+ options: readonly ("none" | "solid" | "ramp")[];
136
+ };
137
+ /** The glow's colour when `tint` is `'solid'`. */
138
+ readonly color: import("../spec.js").EffectParamDef<Color, Color> & NoInfer<{
139
+ readonly default: "white";
140
+ readonly order: 5;
141
+ }> & {
142
+ kind: "color";
143
+ };
78
144
  /**
79
- * The ramp's colours, when {@link tint} is `"ramp"` — parallel to
80
- * {@link stops}, and read only then.
145
+ * Ramp colours when `tint` is `'ramp'`, parallel to `stops`.
146
+ *
147
+ * Componentwise when both ramps have the same number of stops. When the
148
+ * counts differ there is no correspondence to interpolate along (stop 2
149
+ * of 3 and stop 2 of 5 are not the same place), so it snaps at the
150
+ * midpoint: a ramp that silently gained stops mid-tween reads as a bug.
81
151
  */
82
- colors: Color[];
83
- /** Each colour's position along the ramp, 0–1 ascending. */
84
- stops: number[];
152
+ readonly colors: import("../spec.js").EffectParamDef<Color[], Color[]> & NoInfer<{
153
+ readonly kind: "colors";
154
+ readonly default: Color[];
155
+ readonly hidden: true;
156
+ readonly order: 13;
157
+ readonly lerp: (a: Color[], b: Color[], t: number) => Color[];
158
+ readonly equals: (a: Color[], b: Color[]) => boolean;
159
+ }>;
160
+ /** Each ramp colour's position, 0-1 ascending (evenly spaced when absent). */
161
+ readonly stops: import("../spec.js").EffectParamDef<number[], number[]> & NoInfer<{
162
+ readonly kind: "numbers";
163
+ readonly default: number[];
164
+ readonly hidden: true;
165
+ readonly order: 14;
166
+ readonly lerp: (a: number[], b: number[], t: number, from: Record<string, unknown>, to: Record<string, unknown>) => number[];
167
+ readonly equals: (a: number[], b: number[]) => boolean;
168
+ }>;
85
169
  /** How the ramp repeats past one pass. */
86
- loopStyle: GlowLoopStyle;
87
- /** How many times the ramp is traversed across the glow's strength range. */
88
- cycles: number;
89
- /** Offset along the ramp, in degrees of one cycle. Animate this to move colour through the glow. */
90
- phase: number;
91
- }
170
+ readonly loopStyle: import("../spec.js").EffectParamDef<"mirror" | "repeat", "mirror" | "repeat"> & NoInfer<{
171
+ readonly default: "mirror";
172
+ readonly control: "segmented";
173
+ readonly optionsLabel: "glowLoopStyle";
174
+ readonly order: 6;
175
+ }> & {
176
+ kind: "enum";
177
+ options: readonly ("mirror" | "repeat")[];
178
+ };
179
+ /** Ramp traversals across the glow's strength range. */
180
+ readonly cycles: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
181
+ readonly default: 1;
182
+ readonly min: 1;
183
+ readonly max: 10;
184
+ readonly step: 0.1;
185
+ readonly order: 7;
186
+ }> & {
187
+ kind: "number";
188
+ };
189
+ /** Offset along the ramp in degrees of one cycle; animate to move colour. */
190
+ readonly phase: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
191
+ readonly default: 0;
192
+ readonly unit: "deg";
193
+ readonly control: "angle";
194
+ readonly order: 8;
195
+ }> & {
196
+ kind: "number";
197
+ };
198
+ }>;
92
199
  export declare const glowEffect: EffectData<GlowEffect>;
93
200
  //# sourceMappingURL=glow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/glow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG1E;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhD,oEAAoE;AACpE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,EAAE,WAAW,CAAC;IACrB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,IAAI,EAAE,UAAU,CAAC;IACjB,wDAAwD;IACxD,QAAQ,EAAE,YAAY,CAAC;IACvB,0CAA0C;IAC1C,KAAK,EAAE,SAAS,CAAC;IACjB,sCAAsC;IACtC,IAAI,EAAE,QAAQ,CAAC;IACf,wDAAwD;IACxD,KAA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IAE7C,uEAAuE;;;;;;;;;IAEvE,wDAAwD;;;;;;;;;;IAExD,0CAA0C;;;;;;;;;IAE1C,sCAAsC;;;;;;;;;;IAEtC,kDAAkD;;;;;;;IAElD;;;;;;;OAOG;;;;;;;;;IASH,8EAA8E;;;;;;;;;IAW9E,0CAA0C;;;;;;;;;;IAE1C,wDAAwD;;;;;;;;;;IAExD,6EAA6E;;;;;;;;;EAGnF,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,UAAU,CAAC,UAAU,CAA0B,CAAC"}
@@ -1,76 +1,78 @@
1
1
  import { lerpNumber } from "../../../../tween/lerp.js";
2
2
  import { lerpColor } from "../../../../attributes/shape/fill/lerp.js";
3
- import { resolveEffectColor, sameEffectAxis, sameEffectColor } from "../effect-data.js";
4
- /**
5
- * Interpolate two ramps.
6
- *
7
- * Componentwise when the two have the same number of stops, which is the case
8
- * every tween authored by moving colours around produces. When the counts
9
- * differ there is no correspondence to interpolate *along* — stop 2 of 3 and
10
- * stop 2 of 5 are not the same place on the ramp — so this snaps at the midpoint
11
- * like an enum rather than resampling. Resampling would be defensible and is
12
- * deliberately not done: a ramp that silently gained stops mid-tween reads as a
13
- * renderer bug, and the honest snap is at least legible.
14
- */
15
- function lerpRamp(from, to, t) {
16
- if (from.colors.length !== to.colors.length)
17
- return t < 0.5 ? from : to;
18
- return {
19
- colors: from.colors.map((color, i) => lerpColor(resolveEffectColor(color), resolveEffectColor(to.colors[i]), t)),
20
- stops: from.stops.map((stop, i) => lerpNumber(stop, to.stops[i] ?? stop, t)),
21
- };
22
- }
23
- function sameRamp(a, b) {
24
- if (a.colors.length !== b.colors.length || a.stops.length !== b.stops.length)
25
- return false;
26
- return (a.colors.every((color, i) => sameEffectColor(color, b.colors[i])) &&
27
- a.stops.every((stop, i) => stop === b.stops[i]));
28
- }
29
- export const glowEffect = {
30
- lerp: (from, to, t) => ({
31
- type: "glow",
32
- threshold: lerpNumber(from.threshold, to.threshold, t),
33
- radius: lerpNumber(from.radius, to.radius, t),
34
- spread: lerpNumber(from.spread, to.spread, t),
35
- intensity: lerpNumber(from.intensity, to.intensity, t),
36
- cycles: lerpNumber(from.cycles, to.cycles, t),
37
- phase: lerpNumber(from.phase, to.phase, t),
38
- color: lerpColor(resolveEffectColor(from.color), resolveEffectColor(to.color), t),
39
- ...lerpRamp(from, to, t),
40
- // Discrete — snapped at the midpoint like every other enum-valued field.
41
- channel: t < 0.5 ? from.channel : to.channel,
42
- axis: t < 0.5 ? from.axis : to.axis,
43
- original: t < 0.5 ? from.original : to.original,
44
- blend: t < 0.5 ? from.blend : to.blend,
45
- tint: t < 0.5 ? from.tint : to.tint,
46
- loopStyle: t < 0.5 ? from.loopStyle : to.loopStyle,
47
- mode: t < 0.5 ? from.mode : to.mode,
48
- }),
49
- equals: (a, b) => a.channel === b.channel &&
50
- a.threshold === b.threshold &&
51
- a.radius === b.radius &&
52
- a.spread === b.spread &&
53
- a.intensity === b.intensity &&
54
- sameEffectAxis(a.axis, b.axis) &&
55
- a.original === b.original &&
56
- a.blend === b.blend &&
57
- a.tint === b.tint &&
58
- sameEffectColor(a.color, b.color) &&
59
- sameRamp(a, b) &&
60
- a.loopStyle === b.loopStyle &&
61
- a.cycles === b.cycles &&
62
- a.phase === b.phase &&
63
- a.mode === b.mode,
64
- /**
65
- * A shader, for the reason `dropShadow` gives: the ImageFilter path's layer
66
- * is bounded to the node's rect, and a glow's whole job is to fall *outside*
67
- * it, so on that path the spread would be sliced off at the edge of the box.
68
- *
69
- * The colouring needs it independently. A two-colour luminance ramp is
70
- * affine and would fit a colour matrix (that is exactly what `duotone` is),
71
- * but a ramp with {@link GlowEffect.cycles} and {@link GlowEffect.loopStyle}
72
- * over it is not, and there is no runtime-effect colour filter to reach for.
73
- */
3
+ import { BlendModes } from "../../../../attributes/shape/fill/blend.js";
4
+ import { resolveEffectColor, sameEffectColor } from "../effect-data.js";
5
+ import { defineEffect, effectDataOf, param } from "../spec.js";
6
+ // White at the core falling to a warm amber.
7
+ const GLOW_RAMP_COLORS = ["white", "#ffa640"];
8
+ const GLOW_RAMP_STOPS = [0, 1];
9
+ /** The {@link GlowEffect} spec: its parameters, defaults and ranges. */
10
+ export const glowSpec = defineEffect({
11
+ type: "glow",
12
+ group: "light",
74
13
  surface: "shader",
75
- };
14
+ scalar: "intensity",
15
+ // `intensity: 0` alone is not enough: `original: 'hidden'` would carry over
16
+ // from the effect being faded and erase the node.
17
+ neutral: { intensity: 0, original: "behind" },
18
+ // Kept from the hand-written lerp: ramps of different lengths snap the whole
19
+ // glow, not only the ramp, at the midpoint.
20
+ lerp: (from, to, t, derived) => from.colors.length !== to.colors.length ? { ...(t < 0.5 ? from : to) } : derived(from, to, t),
21
+ params: {
22
+ /** What decides a pixel's glow strength. */
23
+ channel: param.choice(["luminance", "alpha"], { default: "luminance", control: "segmented", optionsLabel: "glowChannel", order: 9 }),
24
+ /** 0-1 luminance cutoff; read only when `channel` is `'luminance'`. */
25
+ threshold: param.number({ default: 0.5, min: 0, max: 1, control: "slider", order: 0 }),
26
+ /** Spread distance in pixels. */
27
+ radius: param.number({ default: 25, min: 0, unit: "px", order: 1 }),
28
+ /** Dilation applied before the blur, in pixels — gives the glow a solid core. */
29
+ spread: param.number({ default: 0, min: 0, unit: "px", order: 2 }),
30
+ /** Additive multiplier for the glow pass. */
31
+ intensity: param.number({ default: 1, min: 0, max: 3, control: "slider", inline: true, order: 3 }),
32
+ /** Which way the glow spreads; `'x'`/`'y'` give anamorphic streaks. */
33
+ axis: param.axis({ default: "both", control: "segmented", optionsLabel: "effectAxis", order: 10 }),
34
+ /** Where the source layer sits relative to the glow. */
35
+ original: param.choice(["behind", "front", "hidden"], { default: "behind", control: "segmented", optionsLabel: "glowOriginal", order: 11 }),
36
+ /** How the glow merges with the layer. */
37
+ blend: param.choice(BlendModes, { default: "screen", optionsLabel: "blendMode", order: 12 }),
38
+ /** What the glow is coloured with. */
39
+ tint: param.choice(["none", "solid", "ramp"], { default: "none", control: "segmented", optionsLabel: "glowTint", order: 4 }),
40
+ /** The glow's colour when `tint` is `'solid'`. */
41
+ color: param.color({ default: "white", order: 5 }),
42
+ /**
43
+ * Ramp colours when `tint` is `'ramp'`, parallel to `stops`.
44
+ *
45
+ * Componentwise when both ramps have the same number of stops. When the
46
+ * counts differ there is no correspondence to interpolate along (stop 2
47
+ * of 3 and stop 2 of 5 are not the same place), so it snaps at the
48
+ * midpoint: a ramp that silently gained stops mid-tween reads as a bug.
49
+ */
50
+ colors: param.of()({
51
+ kind: "colors",
52
+ default: GLOW_RAMP_COLORS,
53
+ hidden: true,
54
+ order: 13,
55
+ lerp: (a, b, t) => (a.length !== b.length ? (t < 0.5 ? a : b) : a.map((c, i) => lerpColor(resolveEffectColor(c), resolveEffectColor(b[i]), t))),
56
+ equals: (a, b) => a.length === b.length && a.every((c, i) => sameEffectColor(c, b[i])),
57
+ }),
58
+ /** Each ramp colour's position, 0-1 ascending (evenly spaced when absent). */
59
+ stops: param.of()({
60
+ kind: "numbers",
61
+ default: GLOW_RAMP_STOPS,
62
+ hidden: true,
63
+ order: 14,
64
+ lerp: (a, b, t, from, to) => (from.colors.length !== to.colors.length
65
+ ? (t < 0.5 ? a : b)
66
+ : a.map((s, i) => lerpNumber(s, b[i] ?? s, t))),
67
+ equals: (a, b) => a.length === b.length && a.every((s, i) => s === b[i]),
68
+ }),
69
+ /** How the ramp repeats past one pass. */
70
+ loopStyle: param.choice(["mirror", "repeat"], { default: "mirror", control: "segmented", optionsLabel: "glowLoopStyle", order: 6 }),
71
+ /** Ramp traversals across the glow's strength range. */
72
+ cycles: param.number({ default: 1, min: 1, max: 10, step: 0.1, order: 7 }),
73
+ /** Offset along the ramp in degrees of one cycle; animate to move colour. */
74
+ phase: param.number({ default: 0, unit: "deg", control: "angle", order: 8 }),
75
+ },
76
+ });
77
+ export const glowEffect = effectDataOf(glowSpec);
76
78
  //# sourceMappingURL=glow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glow.js","sourceRoot":"","sources":["../../../../../src/attributes/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;QACjC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;QACd,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS;QAC3B,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;IACrB;;;;;;;;;OASG;IACH,OAAO,EAAE,QAAQ;CACpB,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\r\nimport type { BlendMode } from \"@/attributes/shape/fill/blend\";\r\nimport type { Color } from \"@/attributes/shape/fill/color/parser\";\r\nimport type { EffectAxis, ModedEffect, EffectData } from \"../effect-data\";\r\nimport { resolveEffectColor, sameEffectAxis, sameEffectColor } from \"../effect-data\";\r\n\r\n/**\r\n * What the glow reads to decide how much a pixel glows.\r\n *\r\n * `\"luminance\"` is the photographic reading — bright pixels bleed, dark ones\r\n * don't, and {@link GlowEffect.threshold} sets where the cut falls.\r\n * `\"alpha\"` ignores colour entirely and glows every opaque pixel equally, which\r\n * is what you want when the glow is a halo around a shape rather than light\r\n * escaping an image.\r\n */\r\nexport type GlowChannel = \"luminance\" | \"alpha\";\r\n\r\n/**\r\n * What the glow is coloured with.\r\n *\r\n * - `\"none\"` keeps the source's own colours, scaled by intensity.\r\n * - `\"solid\"` paints the whole glow one {@link GlowEffect.color}.\r\n * - `\"ramp\"` maps glow strength through {@link GlowEffect.colors} /\r\n * {@link GlowEffect.stops}, which is what makes a glow read as heat, neon or\r\n * an aurora rather than as a brighter copy of the layer.\r\n */\r\nexport type GlowTint = \"none\" | \"solid\" | \"ramp\";\r\n\r\n/**\r\n * How the ramp repeats once {@link GlowEffect.cycles} takes it past one pass.\r\n *\r\n * The two names are Skia's own tile modes, and mean here what they mean there:\r\n * `\"repeat\"` restarts at the first stop (a hard seam between last and first),\r\n * `\"mirror\"` walks back down through the stops (seamless, at the cost of\r\n * halving the apparent frequency).\r\n */\r\nexport type GlowLoopStyle = \"mirror\" | \"repeat\";\r\n\r\n/** Where the source layer sits relative to the glow it produced. */\r\nexport type GlowOriginal = \"behind\" | \"front\" | \"hidden\";\r\n\r\n/**\r\n * A glow: the bright (or opaque) parts of a layer, spread outward and composited\r\n * back — optionally recoloured through a ramp keyed on how strongly each pixel\r\n * glows.\r\n *\r\n * The difference from `bloom`, which is otherwise the same three numbers: bloom\r\n * is a `\"filter\"` effect and is therefore bounded by the node's own rect, and it\r\n * can only screen its bright-pass back. This spreads past the box, chooses its\r\n * compositing, and can be coloured. See {@link EffectData.surface} below.\r\n */\r\nexport interface GlowEffect extends ModedEffect {\r\n type: \"glow\";\r\n /** What decides a pixel's glow strength. */\r\n channel: GlowChannel;\r\n /**\r\n * Luminance below which a pixel does not glow, 0–1.\r\n *\r\n * Read only when {@link channel} is `\"luminance\"` — an alpha-driven glow has\r\n * no brightness to cut at.\r\n */\r\n threshold: number;\r\n /** How far the glow spreads, in px. 0 = off. */\r\n radius: number;\r\n /**\r\n * How far the source is dilated *before* blurring, in px.\r\n *\r\n * The same knob a drop shadow has, and it does the same job: `radius` alone\r\n * gives a glow that fades from the edge, while `spread` gives it a solid\r\n * core to fade from.\r\n */\r\n spread: number;\r\n /** Brightness of the glow. 1 is unscaled; 0 is off. */\r\n intensity: number;\r\n /** Which way the glow spreads. `\"x\"`/`\"y\"` give anamorphic streaks. */\r\n axis: EffectAxis;\r\n /** Where the source layer sits relative to the glow. */\r\n original: GlowOriginal;\r\n /** How the glow merges with the layer. */\r\n blend: BlendMode;\r\n /** What the glow is coloured with. */\r\n tint: GlowTint;\r\n /** The glow's colour when {@link tint} is `\"solid\"`. */\r\n color: Color;\r\n /**\r\n * The ramp's colours, when {@link tint} is `\"ramp\"` — parallel to\r\n * {@link stops}, and read only then.\r\n */\r\n colors: Color[];\r\n /** Each colour's position along the ramp, 0–1 ascending. */\r\n stops: number[];\r\n /** How the ramp repeats past one pass. */\r\n loopStyle: GlowLoopStyle;\r\n /** How many times the ramp is traversed across the glow's strength range. */\r\n cycles: number;\r\n /** Offset along the ramp, in degrees of one cycle. Animate this to move colour through the glow. */\r\n phase: number;\r\n}\r\n\r\n/**\r\n * Interpolate two ramps.\r\n *\r\n * Componentwise when the two have the same number of stops, which is the case\r\n * every tween authored by moving colours around produces. When the counts\r\n * differ there is no correspondence to interpolate *along* — stop 2 of 3 and\r\n * stop 2 of 5 are not the same place on the ramp — so this snaps at the midpoint\r\n * like an enum rather than resampling. Resampling would be defensible and is\r\n * deliberately not done: a ramp that silently gained stops mid-tween reads as a\r\n * renderer bug, and the honest snap is at least legible.\r\n */\r\nfunction lerpRamp(\r\n from: Pick<GlowEffect, \"colors\" | \"stops\">,\r\n to: Pick<GlowEffect, \"colors\" | \"stops\">,\r\n t: number,\r\n): Pick<GlowEffect, \"colors\" | \"stops\"> {\r\n if (from.colors.length !== to.colors.length) return t < 0.5 ? from : to;\r\n return {\r\n colors: from.colors.map((color, i) =>\r\n lerpColor(resolveEffectColor(color), resolveEffectColor(to.colors[i]), t),\r\n ),\r\n stops: from.stops.map((stop, i) => lerpNumber(stop, to.stops[i] ?? stop, t)),\r\n };\r\n}\r\n\r\nfunction sameRamp(a: Pick<GlowEffect, \"colors\" | \"stops\">, b: Pick<GlowEffect, \"colors\" | \"stops\">): boolean {\r\n if (a.colors.length !== b.colors.length || a.stops.length !== b.stops.length) return false;\r\n return (\r\n a.colors.every((color, i) => sameEffectColor(color, b.colors[i])) &&\r\n a.stops.every((stop, i) => stop === b.stops[i])\r\n );\r\n}\r\n\r\nexport const glowEffect: EffectData<GlowEffect> = {\r\n lerp: (from, to, t) => ({\r\n type: \"glow\",\r\n threshold: lerpNumber(from.threshold, to.threshold, t),\r\n radius: lerpNumber(from.radius, to.radius, t),\r\n spread: lerpNumber(from.spread, to.spread, t),\r\n intensity: lerpNumber(from.intensity, to.intensity, t),\r\n cycles: lerpNumber(from.cycles, to.cycles, t),\r\n phase: lerpNumber(from.phase, to.phase, t),\r\n color: lerpColor(resolveEffectColor(from.color), resolveEffectColor(to.color), t),\r\n ...lerpRamp(from, to, t),\r\n // Discrete — snapped at the midpoint like every other enum-valued field.\r\n channel: t < 0.5 ? from.channel : to.channel,\r\n axis: t < 0.5 ? from.axis : to.axis,\r\n original: t < 0.5 ? from.original : to.original,\r\n blend: t < 0.5 ? from.blend : to.blend,\r\n tint: t < 0.5 ? from.tint : to.tint,\r\n loopStyle: t < 0.5 ? from.loopStyle : to.loopStyle,\r\n mode: t < 0.5 ? from.mode : to.mode,\r\n }),\r\n equals: (a, b) =>\r\n a.channel === b.channel &&\r\n a.threshold === b.threshold &&\r\n a.radius === b.radius &&\r\n a.spread === b.spread &&\r\n a.intensity === b.intensity &&\r\n sameEffectAxis(a.axis, b.axis) &&\r\n a.original === b.original &&\r\n a.blend === b.blend &&\r\n a.tint === b.tint &&\r\n sameEffectColor(a.color, b.color) &&\r\n sameRamp(a, b) &&\r\n a.loopStyle === b.loopStyle &&\r\n a.cycles === b.cycles &&\r\n a.phase === b.phase &&\r\n a.mode === b.mode,\r\n /**\r\n * A shader, for the reason `dropShadow` gives: the ImageFilter path's layer\r\n * is bounded to the node's rect, and a glow's whole job is to fall *outside*\r\n * it, so on that path the spread would be sliced off at the edge of the box.\r\n *\r\n * The colouring needs it independently. A two-colour luminance ramp is\r\n * affine and would fit a colour matrix (that is exactly what `duotone` is),\r\n * but a ramp with {@link GlowEffect.cycles} and {@link GlowEffect.loopStyle}\r\n * over it is not, and there is no runtime-effect colour filter to reach for.\r\n */\r\n surface: \"shader\",\r\n};\r\n"]}
1
+ {"version":3,"file":"glow.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/glow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+B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AO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC/E;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAA2B,YAAY,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\r\nimport { BlendModes } from \"@/attributes/shape/fill/blend\";\r\nimport type { Color } from \"@/attributes/shape/fill/color/parser\";\r\nimport type { ModedEffect, EffectData } from \"../effect-data\";\r\nimport { resolveEffectColor, sameEffectColor } from \"../effect-data\";\r\nimport { defineEffect, effectDataOf, param, type EffectFields } from \"../spec\";\r\n\r\n/**\r\n * What the glow reads to decide how much a pixel glows.\r\n *\r\n * `\"luminance\"` is the photographic reading — bright pixels bleed, dark ones\r\n * don't, and {@link GlowEffect.threshold} sets where the cut falls.\r\n * `\"alpha\"` ignores colour entirely and glows every opaque pixel equally, which\r\n * is what you want when the glow is a halo around a shape rather than light\r\n * escaping an image.\r\n */\r\nexport type GlowChannel = \"luminance\" | \"alpha\";\r\n\r\n/**\r\n * What the glow is coloured with.\r\n *\r\n * - `\"none\"` keeps the source's own colours, scaled by intensity.\r\n * - `\"solid\"` paints the whole glow one {@link GlowEffect.color}.\r\n * - `\"ramp\"` maps glow strength through {@link GlowEffect.colors} /\r\n * {@link GlowEffect.stops}, which is what makes a glow read as heat, neon or\r\n * an aurora rather than as a brighter copy of the layer.\r\n */\r\nexport type GlowTint = \"none\" | \"solid\" | \"ramp\";\r\n\r\n/**\r\n * How the ramp repeats once {@link GlowEffect.cycles} takes it past one pass.\r\n *\r\n * The two names are the usual gradient tile modes, and mean what they mean there:\r\n * `\"repeat\"` restarts at the first stop (a hard seam between last and first),\r\n * `\"mirror\"` walks back down through the stops (seamless, at the cost of\r\n * halving the apparent frequency).\r\n */\r\nexport type GlowLoopStyle = \"mirror\" | \"repeat\";\r\n\r\n/** Where the source layer sits relative to the glow it produced. */\r\nexport type GlowOriginal = \"behind\" | \"front\" | \"hidden\";\r\n\r\n/**\r\n * A glow: the bright (or opaque) parts of a layer, spread outward and composited\r\n * back — optionally recoloured through a ramp keyed on how strongly each pixel\r\n * glows.\r\n *\r\n * The difference from `bloom`, which is otherwise the same three numbers: bloom\r\n * is a `\"filter\"` effect and is therefore bounded by the node's own rect, and it\r\n * can only screen its bright-pass back. This spreads past the box, chooses its\r\n * compositing, and can be coloured. See {@link EffectData.surface} below.\r\n */\r\nexport interface GlowEffect extends ModedEffect, EffectFields<typeof glowSpec.params> {\r\n type: \"glow\";\r\n}\r\n\r\n// White at the core falling to a warm amber.\r\nconst GLOW_RAMP_COLORS: Color[] = [\"white\", \"#ffa640\"];\r\nconst GLOW_RAMP_STOPS: number[] = [0, 1];\r\n\r\n/** The {@link GlowEffect} spec: its parameters, defaults and ranges. */\r\nexport const glowSpec = defineEffect({\r\n type: \"glow\",\r\n group: \"light\",\r\n surface: \"shader\",\r\n scalar: \"intensity\",\r\n // `intensity: 0` alone is not enough: `original: 'hidden'` would carry over\r\n // from the effect being faded and erase the node.\r\n neutral: { intensity: 0, original: \"behind\" },\r\n // Kept from the hand-written lerp: ramps of different lengths snap the whole\r\n // glow, not only the ramp, at the midpoint.\r\n lerp: <G extends { colors: Color[] }>(from: G, to: G, t: number, derived: (a: G, b: G, t: number) => G) =>\r\n from.colors.length !== to.colors.length ? { ...(t < 0.5 ? from : to) } : derived(from, to, t),\r\n params: {\r\n /** What decides a pixel's glow strength. */\r\n channel: param.choice([\"luminance\", \"alpha\"] satisfies GlowChannel[], { default: \"luminance\", control: \"segmented\", optionsLabel: \"glowChannel\", order: 9 }),\r\n /** 0-1 luminance cutoff; read only when `channel` is `'luminance'`. */\r\n threshold: param.number({ default: 0.5, min: 0, max: 1, control: \"slider\", order: 0 }),\r\n /** Spread distance in pixels. */\r\n radius: param.number({ default: 25, min: 0, unit: \"px\", order: 1 }),\r\n /** Dilation applied before the blur, in pixels — gives the glow a solid core. */\r\n spread: param.number({ default: 0, min: 0, unit: \"px\", order: 2 }),\r\n /** Additive multiplier for the glow pass. */\r\n intensity: param.number({ default: 1, min: 0, max: 3, control: \"slider\", inline: true, order: 3 }),\r\n /** Which way the glow spreads; `'x'`/`'y'` give anamorphic streaks. */\r\n axis: param.axis({ default: \"both\", control: \"segmented\", optionsLabel: \"effectAxis\", order: 10 }),\r\n /** Where the source layer sits relative to the glow. */\r\n original: param.choice([\"behind\", \"front\", \"hidden\"] satisfies GlowOriginal[], { default: \"behind\", control: \"segmented\", optionsLabel: \"glowOriginal\", order: 11 }),\r\n /** How the glow merges with the layer. */\r\n blend: param.choice(BlendModes, { default: \"screen\", optionsLabel: \"blendMode\", order: 12 }),\r\n /** What the glow is coloured with. */\r\n tint: param.choice([\"none\", \"solid\", \"ramp\"] satisfies GlowTint[], { default: \"none\", control: \"segmented\", optionsLabel: \"glowTint\", order: 4 }),\r\n /** The glow's colour when `tint` is `'solid'`. */\r\n color: param.color({ default: \"white\", order: 5 }),\r\n /**\r\n * Ramp colours when `tint` is `'ramp'`, parallel to `stops`.\r\n *\r\n * Componentwise when both ramps have the same number of stops. When the\r\n * counts differ there is no correspondence to interpolate along (stop 2\r\n * of 3 and stop 2 of 5 are not the same place), so it snaps at the\r\n * midpoint: a ramp that silently gained stops mid-tween reads as a bug.\r\n */\r\n colors: param.of<Color[]>()({\r\n kind: \"colors\",\r\n default: GLOW_RAMP_COLORS,\r\n hidden: true,\r\n order: 13,\r\n lerp: (a, b, t) => (a.length !== b.length ? (t < 0.5 ? a : b) : a.map((c, i) => lerpColor(resolveEffectColor(c), resolveEffectColor(b[i]), t))),\r\n equals: (a, b) => a.length === b.length && a.every((c, i) => sameEffectColor(c, b[i])),\r\n }),\r\n /** Each ramp colour's position, 0-1 ascending (evenly spaced when absent). */\r\n stops: param.of<number[]>()({\r\n kind: \"numbers\",\r\n default: GLOW_RAMP_STOPS,\r\n hidden: true,\r\n order: 14,\r\n lerp: (a, b, t, from, to) => ((from.colors as Color[]).length !== (to.colors as Color[]).length\r\n ? (t < 0.5 ? a : b)\r\n : a.map((s, i) => lerpNumber(s, b[i] ?? s, t))),\r\n equals: (a, b) => a.length === b.length && a.every((s, i) => s === b[i]),\r\n }),\r\n /** How the ramp repeats past one pass. */\r\n loopStyle: param.choice([\"mirror\", \"repeat\"] satisfies GlowLoopStyle[], { default: \"mirror\", control: \"segmented\", optionsLabel: \"glowLoopStyle\", order: 6 }),\r\n /** Ramp traversals across the glow's strength range. */\r\n cycles: param.number({ default: 1, min: 1, max: 10, step: 0.1, order: 7 }),\r\n /** Offset along the ramp in degrees of one cycle; animate to move colour. */\r\n phase: param.number({ default: 0, unit: \"deg\", control: \"angle\", order: 8 }),\r\n },\r\n});\r\n\r\nexport const glowEffect: EffectData<GlowEffect> = effectDataOf(glowSpec);\r\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { ModedEffect, EffectData } from "../effect-data.js";
2
+ import { type EffectFields } from "../spec.js";
2
3
  /**
3
4
  * Film grain — per-pixel noise blended into the node's own content.
4
5
  *
@@ -12,18 +13,49 @@ import type { ModedEffect, EffectData } from "../effect-data.js";
12
13
  * {@link seed} instead — a tween over `seed` gives the same shimmer frame-locked
13
14
  * to the timeline.
14
15
  */
15
- export interface GrainEffect extends ModedEffect {
16
+ export interface GrainEffect extends ModedEffect, EffectFields<typeof grainSpec.params> {
16
17
  type: "grain";
17
- /** 0–1 noise amplitude. 0 = off. */
18
- amount: number;
19
- /** Grain cell size in px — 1 is per-pixel, higher is chunkier. */
20
- size: number;
21
- /** Random field offset. Animate it (or set `animated`) to make the grain crawl. */
22
- seed: number;
23
- /** Re-seed every frame from the node's elapsed time. */
24
- animated: boolean;
25
- /** Per-channel noise (colour speckle) instead of one luminance value. */
26
- colored: boolean;
27
18
  }
19
+ /** The {@link GrainEffect} spec: its parameters, defaults and ranges. */
20
+ export declare const grainSpec: import("../spec.js").EffectSpec<"grain", {
21
+ /** 0–1 noise amplitude. */
22
+ readonly amount: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
23
+ readonly default: 0.25;
24
+ readonly min: 0;
25
+ readonly max: 1;
26
+ readonly control: "slider";
27
+ readonly inline: true;
28
+ }> & {
29
+ kind: "number";
30
+ };
31
+ /** Grain cell size in pixels. */
32
+ readonly size: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
33
+ readonly default: 1;
34
+ readonly min: 1;
35
+ readonly unit: "px";
36
+ readonly label: "grainSize";
37
+ }> & {
38
+ kind: "number";
39
+ };
40
+ /** Random field offset — animate it for frame-locked shimmer. */
41
+ readonly seed: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
42
+ readonly default: 0;
43
+ readonly step: 1;
44
+ }> & {
45
+ kind: "number";
46
+ };
47
+ /** Re-seed every frame from elapsed time. */
48
+ readonly animated: import("../spec.js").EffectParamDef<boolean, boolean> & NoInfer<{
49
+ readonly default: false;
50
+ }> & {
51
+ kind: "boolean";
52
+ };
53
+ /** Per-channel colour speckle instead of luminance noise. */
54
+ readonly colored: import("../spec.js").EffectParamDef<boolean, boolean> & NoInfer<{
55
+ readonly default: false;
56
+ }> & {
57
+ kind: "boolean";
58
+ };
59
+ }>;
28
60
  export declare const grainEffect: EffectData<GrainEffect>;
29
61
  //# sourceMappingURL=grain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grain.d.ts","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/grain.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC5C,IAAI,EAAE,OAAO,CAAC;IACd,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,WAAW,CAmB/C,CAAC"}
1
+ {"version":3,"file":"grain.d.ts","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/grain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAqC,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW,EAAE,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC;IACnF,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,yEAAyE;AACzE,eAAO,MAAM,SAAS;IAQd,2BAA2B;;;;;;;;;;IAE3B,iCAAiC;;;;;;;;;IAEjC,iEAAiE;;;;;;;IAEjE,6CAA6C;;;;;;IAE7C,6DAA6D;;;;;;EAGnE,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,WAAW,CAA2B,CAAC"}