@motionscript/core 0.1.0-alpha.7 → 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 (498) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/NOTICE +15 -14
  3. package/README.md +4 -4
  4. package/dist/assets/manager.d.ts.map +1 -1
  5. package/dist/assets/manager.js +7 -5
  6. package/dist/assets/manager.js.map +1 -1
  7. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  8. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  9. package/dist/attributes/audio/effects/chain.js +67 -0
  10. package/dist/attributes/audio/effects/chain.js.map +1 -0
  11. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  12. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  13. package/dist/attributes/audio/effects/implementations/echo.js +11 -0
  14. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  15. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  16. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  17. package/dist/attributes/audio/effects/implementations/gain.js +6 -0
  18. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  20. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  21. package/dist/attributes/audio/effects/implementations/highpass.js +10 -0
  22. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  24. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  25. package/dist/attributes/audio/effects/implementations/lowpass.js +10 -0
  26. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  28. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  29. package/dist/attributes/audio/effects/implementations/tremolo.js +10 -0
  30. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  31. package/dist/attributes/audio/effects/index.d.ts +12 -0
  32. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  33. package/dist/attributes/audio/effects/index.js +4 -0
  34. package/dist/attributes/audio/effects/index.js.map +1 -0
  35. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  36. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  37. package/dist/attributes/audio/effects/registry.js +80 -0
  38. package/dist/attributes/audio/effects/registry.js.map +1 -0
  39. package/dist/attributes/audio/effects/union.d.ts +14 -0
  40. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  41. package/dist/attributes/audio/effects/union.js +24 -0
  42. package/dist/attributes/audio/effects/union.js.map +1 -0
  43. package/dist/attributes/audio/ramp.d.ts +103 -0
  44. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  45. package/dist/attributes/audio/ramp.js +246 -0
  46. package/dist/attributes/audio/ramp.js.map +1 -0
  47. package/dist/attributes/audio/request.d.ts +24 -13
  48. package/dist/attributes/audio/request.d.ts.map +1 -1
  49. package/dist/attributes/audio/request.js +4 -3
  50. package/dist/attributes/audio/request.js.map +1 -1
  51. package/dist/attributes/audio/schedule.d.ts +21 -13
  52. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  53. package/dist/attributes/audio/schedule.js +42 -28
  54. package/dist/attributes/audio/schedule.js.map +1 -1
  55. package/dist/attributes/audio/sound.d.ts +15 -12
  56. package/dist/attributes/audio/sound.d.ts.map +1 -1
  57. package/dist/attributes/audio/sound.js +8 -10
  58. package/dist/attributes/audio/sound.js.map +1 -1
  59. package/dist/attributes/audio/transition.d.ts +33 -0
  60. package/dist/attributes/audio/transition.d.ts.map +1 -0
  61. package/dist/attributes/audio/transition.js +48 -0
  62. package/dist/attributes/audio/transition.js.map +1 -0
  63. package/dist/attributes/index.d.ts +4 -3
  64. package/dist/attributes/index.d.ts.map +1 -1
  65. package/dist/attributes/index.js +4 -7
  66. package/dist/attributes/index.js.map +1 -1
  67. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  68. package/dist/attributes/layout/matrix2d.js.map +1 -1
  69. package/dist/attributes/layout/space3d.js +1 -1
  70. package/dist/attributes/layout/space3d.js.map +1 -1
  71. package/dist/attributes/properties/typed.d.ts +7 -7
  72. package/dist/attributes/properties/typed.d.ts.map +1 -1
  73. package/dist/attributes/properties/typed.js +6 -6
  74. package/dist/attributes/properties/typed.js.map +1 -1
  75. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -2
  76. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  77. package/dist/attributes/shape/corners/corner-radius.js +1 -2
  78. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  79. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  80. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  81. package/dist/attributes/shape/effects/chain.js +93 -283
  82. package/dist/attributes/shape/effects/chain.js.map +1 -1
  83. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  84. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  85. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  86. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  87. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  88. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  90. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  92. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  94. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  96. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  98. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  100. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  101. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  102. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  104. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  106. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  108. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  110. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  112. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  114. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  116. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  118. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  120. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  122. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  124. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  126. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  128. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +46 -14
  130. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  132. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  134. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  136. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  138. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  140. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  142. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  144. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  146. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  148. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  150. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  152. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  154. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  156. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  158. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  160. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  162. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  164. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  166. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  168. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  170. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  172. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  174. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  176. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  178. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  180. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  182. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  184. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  186. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  188. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  190. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  192. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  194. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  196. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  198. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  200. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  202. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  204. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  206. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  208. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  210. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  212. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  214. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  216. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  218. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  220. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  222. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  224. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  226. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  228. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  230. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  232. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  234. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  236. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  238. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  240. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  242. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  244. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  246. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  248. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  249. package/dist/attributes/shape/effects/index.d.ts +4 -2
  250. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  251. package/dist/attributes/shape/effects/index.js +1 -1
  252. package/dist/attributes/shape/effects/index.js.map +1 -1
  253. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  254. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  255. package/dist/attributes/shape/effects/registry.js +113 -102
  256. package/dist/attributes/shape/effects/registry.js.map +1 -1
  257. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  258. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  259. package/dist/attributes/shape/effects/spec.js +178 -0
  260. package/dist/attributes/shape/effects/spec.js.map +1 -0
  261. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  262. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  263. package/dist/attributes/shape/fill/chain.js +9 -11
  264. package/dist/attributes/shape/fill/chain.js.map +1 -1
  265. package/dist/attributes/shape/fill/implementations/shader.d.ts +27 -26
  266. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  267. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  268. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  269. package/dist/attributes/shape/fill/index.d.ts +1 -1
  270. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  271. package/dist/attributes/shape/fill/index.js.map +1 -1
  272. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  273. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  274. package/dist/attributes/shape/fill/registry.js +1 -2
  275. package/dist/attributes/shape/fill/registry.js.map +1 -1
  276. package/dist/attributes/shape/filters/chain.d.ts +2 -6
  277. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  278. package/dist/attributes/shape/filters/chain.js +1 -5
  279. package/dist/attributes/shape/filters/chain.js.map +1 -1
  280. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  281. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  282. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  283. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  284. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  285. package/dist/attributes/shape/filters/registry.js +3 -3
  286. package/dist/attributes/shape/filters/registry.js.map +1 -1
  287. package/dist/attributes/shape/filters/union.d.ts +2 -3
  288. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  289. package/dist/attributes/shape/filters/union.js.map +1 -1
  290. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  291. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  292. package/dist/attributes/shape/shaders/index.js +2 -0
  293. package/dist/attributes/shape/shaders/index.js.map +1 -1
  294. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  295. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  296. package/dist/attributes/shape/shaders/language.js +20 -0
  297. package/dist/attributes/shape/shaders/language.js.map +1 -0
  298. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  299. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  300. package/dist/attributes/shape/shaders/pack.js +9 -4
  301. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  302. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  303. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  304. package/dist/attributes/shape/shaders/resolve.js +3 -6
  305. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  306. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  307. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  308. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  309. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  310. package/dist/browser/chunks/chunk-AOT33LMS.js +13 -0
  311. package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
  312. package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
  313. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
  314. package/dist/browser/experimental.js +1 -1
  315. package/dist/browser/experimental.js.map +4 -4
  316. package/dist/browser/index.js +1 -1
  317. package/dist/browser/index.js.map +2 -2
  318. package/dist/browser/manifest.json +1 -1
  319. package/dist/browser/sdk.js +1 -1
  320. package/dist/components/builtins/audio/audio.d.ts +14 -5
  321. package/dist/components/builtins/audio/audio.d.ts.map +1 -1
  322. package/dist/components/builtins/audio/audio.js +10 -13
  323. package/dist/components/builtins/audio/audio.js.map +1 -1
  324. package/dist/components/builtins/geometry/composite.d.ts +3 -3
  325. package/dist/components/builtins/media/media.d.ts +7 -7
  326. package/dist/components/builtins/media/media.d.ts.map +1 -1
  327. package/dist/components/builtins/media/media.js +4 -10
  328. package/dist/components/builtins/media/media.js.map +1 -1
  329. package/dist/components/builtins/text/text.d.ts +12 -12
  330. package/dist/components/builtins/text/text.d.ts.map +1 -1
  331. package/dist/components/builtins/text/text.js +3 -0
  332. package/dist/components/builtins/text/text.js.map +1 -1
  333. package/dist/components/factory/api.d.ts +38 -11
  334. package/dist/components/factory/api.d.ts.map +1 -1
  335. package/dist/components/factory/api.js.map +1 -1
  336. package/dist/components/factory/component3d.d.ts.map +1 -1
  337. package/dist/components/factory/component3d.js +11 -3
  338. package/dist/components/factory/component3d.js.map +1 -1
  339. package/dist/components/factory/factory.d.ts +3 -0
  340. package/dist/components/factory/factory.d.ts.map +1 -1
  341. package/dist/components/factory/factory.js +39 -5
  342. package/dist/components/factory/factory.js.map +1 -1
  343. package/dist/components/modules/text-style.d.ts +1 -1
  344. package/dist/components/trees/2d/node-render.d.ts +1 -1
  345. package/dist/components/trees/2d/node-render.js +1 -1
  346. package/dist/components/trees/2d/node-render.js.map +1 -1
  347. package/dist/components/trees/2d/node2d.d.ts +1 -1
  348. package/dist/components/trees/2d/node2d.js +1 -1
  349. package/dist/components/trees/2d/node2d.js.map +1 -1
  350. package/dist/components/trees/audio/node-audio.d.ts +16 -9
  351. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  352. package/dist/components/trees/audio/node-audio.js +15 -11
  353. package/dist/components/trees/audio/node-audio.js.map +1 -1
  354. package/dist/document/command-traits.d.ts +12 -2
  355. package/dist/document/command-traits.d.ts.map +1 -1
  356. package/dist/document/command-traits.js +34 -6
  357. package/dist/document/command-traits.js.map +1 -1
  358. package/dist/document/index.d.ts +8 -0
  359. package/dist/document/index.d.ts.map +1 -1
  360. package/dist/document/index.js +4 -0
  361. package/dist/document/index.js.map +1 -1
  362. package/dist/document/migrate.d.ts +70 -0
  363. package/dist/document/migrate.d.ts.map +1 -0
  364. package/dist/document/migrate.js +202 -0
  365. package/dist/document/migrate.js.map +1 -0
  366. package/dist/document/missing-node.d.ts +27 -0
  367. package/dist/document/missing-node.d.ts.map +1 -0
  368. package/dist/document/missing-node.js +48 -0
  369. package/dist/document/missing-node.js.map +1 -0
  370. package/dist/document/node-descriptor.d.ts +4 -0
  371. package/dist/document/node-descriptor.d.ts.map +1 -1
  372. package/dist/document/node-descriptor.js.map +1 -1
  373. package/dist/document/placement.d.ts +2 -1
  374. package/dist/document/placement.d.ts.map +1 -1
  375. package/dist/document/placement.js.map +1 -1
  376. package/dist/document/project.d.ts +2 -0
  377. package/dist/document/project.d.ts.map +1 -1
  378. package/dist/document/project.js +1 -0
  379. package/dist/document/project.js.map +1 -1
  380. package/dist/document/prop-evolution.d.ts +51 -0
  381. package/dist/document/prop-evolution.d.ts.map +1 -0
  382. package/dist/document/prop-evolution.js +83 -0
  383. package/dist/document/prop-evolution.js.map +1 -0
  384. package/dist/document/registry.d.ts +16 -0
  385. package/dist/document/registry.d.ts.map +1 -1
  386. package/dist/document/registry.js +30 -4
  387. package/dist/document/registry.js.map +1 -1
  388. package/dist/document/settled-index.d.ts +2 -0
  389. package/dist/document/settled-index.d.ts.map +1 -1
  390. package/dist/document/settled-index.js +5 -5
  391. package/dist/document/settled-index.js.map +1 -1
  392. package/dist/document/timeline-patch.d.ts +4 -0
  393. package/dist/document/timeline-patch.d.ts.map +1 -1
  394. package/dist/document/timeline-patch.js +28 -3
  395. package/dist/document/timeline-patch.js.map +1 -1
  396. package/dist/document/timeline.d.ts +45 -1
  397. package/dist/document/timeline.d.ts.map +1 -1
  398. package/dist/document/timeline.js +172 -42
  399. package/dist/document/timeline.js.map +1 -1
  400. package/dist/document/types.d.ts +14 -28
  401. package/dist/document/types.d.ts.map +1 -1
  402. package/dist/document/types.js.map +1 -1
  403. package/dist/document/validate.d.ts +17 -5
  404. package/dist/document/validate.d.ts.map +1 -1
  405. package/dist/document/validate.js +158 -21
  406. package/dist/document/validate.js.map +1 -1
  407. package/dist/document/vocabulary.d.ts +28 -0
  408. package/dist/document/vocabulary.d.ts.map +1 -0
  409. package/dist/document/vocabulary.js +42 -0
  410. package/dist/document/vocabulary.js.map +1 -0
  411. package/dist/experimental.d.ts +68 -8
  412. package/dist/experimental.d.ts.map +1 -1
  413. package/dist/experimental.js +22 -8
  414. package/dist/experimental.js.map +1 -1
  415. package/dist/platform/exporter.d.ts +13 -0
  416. package/dist/platform/exporter.d.ts.map +1 -1
  417. package/dist/platform/exporter.js.map +1 -1
  418. package/dist/renamed-scene-names.d.ts +1 -1
  419. package/dist/renamed-scene-names.d.ts.map +1 -1
  420. package/dist/renamed-scene-names.js +1 -1
  421. package/dist/renamed-scene-names.js.map +1 -1
  422. package/dist/render/canvas-render-context2d.d.ts +9 -0
  423. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  424. package/dist/render/canvas-render-context2d.js +10 -0
  425. package/dist/render/canvas-render-context2d.js.map +1 -1
  426. package/dist/render/clip-contains.js +1 -1
  427. package/dist/render/clip-contains.js.map +1 -1
  428. package/dist/render/descriptors/text.d.ts +2 -2
  429. package/dist/render/descriptors/text.js +2 -2
  430. package/dist/render/descriptors/text.js.map +1 -1
  431. package/dist/render/index.d.ts +2 -0
  432. package/dist/render/index.d.ts.map +1 -1
  433. package/dist/render/index.js +1 -0
  434. package/dist/render/index.js.map +1 -1
  435. package/dist/render/render-context2d.d.ts +1 -1
  436. package/dist/render/render-context2d.js.map +1 -1
  437. package/dist/render/render-issue.d.ts +39 -0
  438. package/dist/render/render-issue.d.ts.map +1 -0
  439. package/dist/render/render-issue.js +29 -0
  440. package/dist/render/render-issue.js.map +1 -0
  441. package/dist/render/surface.d.ts +2 -2
  442. package/dist/render/surface.js.map +1 -1
  443. package/dist/render3d/graphics3d.d.ts.map +1 -1
  444. package/dist/render3d/graphics3d.js +54 -5
  445. package/dist/render3d/graphics3d.js.map +1 -1
  446. package/dist/runtime/asset-refine.js +2 -1
  447. package/dist/runtime/asset-refine.js.map +1 -1
  448. package/dist/runtime/asset-timeline.d.ts +10 -0
  449. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  450. package/dist/runtime/asset-timeline.js.map +1 -1
  451. package/dist/runtime/asset-update.d.ts.map +1 -1
  452. package/dist/runtime/asset-update.js +7 -0
  453. package/dist/runtime/asset-update.js.map +1 -1
  454. package/dist/runtime/clip-instance.d.ts +3 -1
  455. package/dist/runtime/clip-instance.d.ts.map +1 -1
  456. package/dist/runtime/clip-instance.js +4 -0
  457. package/dist/runtime/clip-instance.js.map +1 -1
  458. package/dist/runtime/clip-store.d.ts.map +1 -1
  459. package/dist/runtime/clip-store.js +17 -2
  460. package/dist/runtime/clip-store.js.map +1 -1
  461. package/dist/runtime/engine.d.ts +5 -3
  462. package/dist/runtime/engine.d.ts.map +1 -1
  463. package/dist/runtime/engine.js +2 -1
  464. package/dist/runtime/engine.js.map +1 -1
  465. package/dist/runtime/playback-controller.d.ts.map +1 -1
  466. package/dist/runtime/playback-controller.js +14 -4
  467. package/dist/runtime/playback-controller.js.map +1 -1
  468. package/dist/runtime/session.d.ts +7 -3
  469. package/dist/runtime/session.d.ts.map +1 -1
  470. package/dist/runtime/session.js +11 -4
  471. package/dist/runtime/session.js.map +1 -1
  472. package/dist/runtime/text-geometry.d.ts +1 -1
  473. package/dist/runtime/text-geometry.js.map +1 -1
  474. package/dist/sdk/index.d.ts +8 -6
  475. package/dist/sdk/index.d.ts.map +1 -1
  476. package/dist/sdk/index.js +10 -3
  477. package/dist/sdk/index.js.map +1 -1
  478. package/dist/tween/command-decorator.d.ts +7 -0
  479. package/dist/tween/command-decorator.d.ts.map +1 -1
  480. package/dist/tween/command-decorator.js +1 -0
  481. package/dist/tween/command-decorator.js.map +1 -1
  482. package/dist/tween/ease/describe.d.ts +2 -0
  483. package/dist/tween/ease/describe.d.ts.map +1 -1
  484. package/dist/tween/ease/describe.js +4 -0
  485. package/dist/tween/ease/describe.js.map +1 -1
  486. package/dist/tween/ease/spec.d.ts +31 -0
  487. package/dist/tween/ease/spec.d.ts.map +1 -0
  488. package/dist/tween/ease/spec.js +51 -0
  489. package/dist/tween/ease/spec.js.map +1 -0
  490. package/dist/tween/index.d.ts +1 -0
  491. package/dist/tween/index.d.ts.map +1 -1
  492. package/dist/tween/index.js +1 -0
  493. package/dist/tween/index.js.map +1 -1
  494. package/package.json +2 -2
  495. package/dist/browser/chunks/chunk-D4FSTPML.js +0 -14
  496. package/dist/browser/chunks/chunk-D4FSTPML.js.map +0 -7
  497. package/dist/browser/chunks/chunk-RTNATFWX.js +0 -5
  498. package/dist/browser/chunks/chunk-RTNATFWX.js.map +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/shape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E,CAAC,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC;IAClD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QAClB,IAAI,IAAI,KAAK,EAAE;YAAE,OAAO,IAAI,CAAC;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAiB,EAAE,CAAC;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACrC,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import { NodeEffect } from \"./union\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { BlendMode } from \"../fill/blend\";\r\nimport type { Color } from \"../fill/color/parser\";\r\nimport type { EffectAxis, EffectOptions } from \"./effect-data\";\r\nimport { scalarOptions, withEffectOptions } from \"./effect-data\";\r\nimport { resolveEffect, lerpEffect } from \"./registry\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\nimport { normalizeUniforms } from \"../sksl-uniforms\";\r\nimport { resolveShaderProperties, type ShaderPropertyValues } from \"../shaders/resolve\";\r\nimport type { EffectShader } from \"../shaders/pack\";\r\nimport type { InvertChannel } from \"./implementations/invert\";\r\nimport type { MotionBlurAlignment } from \"./implementations/motion-blur\";\r\nimport type { SkSLUniform, SkSLUniformRecord } from \"./implementations/shader\";\r\nimport type { OutlinePosition } from \"./implementations/outline\";\r\nimport type { EdgeKernel } from \"./implementations/edges\";\r\nimport type { GlowChannel, GlowLoopStyle, GlowOriginal, GlowTint } from \"./implementations/glow\";\r\nimport type { RadialBlurStyle } from \"./implementations/radial-blur\";\r\nimport type { HalftoneShape, HalftoneSeparation } from \"./implementations/halftone\";\r\nimport type { DitherMatrix, DitherNoise } from \"./implementations/dither\";\r\nimport type { ColorAdjustmentEffect } from \"./implementations/color-adjustment\";\r\nimport type { CurvesChannel } from \"../filters/implementations/curves\";\r\nimport type { BitCrushPalette } from \"./implementations/bit-crush\";\r\nimport type { AsciiCharset } from \"./implementations/ascii\";\r\nimport type { WaveShape } from \"./implementations/wave\";\r\nimport type { ProgressiveBlurShape } from \"./implementations/progressive-blur\";\r\n\r\n/**\r\n * Every effect builder takes **exactly one argument**: an options object\r\n * carrying all of that effect's data. Builders with one dominant animated\r\n * scalar also accept that scalar directly, so the common case stays terse:\r\n *\r\n * Effects.blur(8)\r\n * Effects.blur({ radius: 8, mode: 'backdrop' })\r\n *\r\n * Field names are shared vocabulary across every effect — `radius` is always a\r\n * pixel distance, `amount` always a 0–1 intensity, `angle` always degrees,\r\n * `center` always a 0–1 normalised point, `axis` always an {@link EffectAxis}.\r\n */\r\n\r\n/** Gaussian blur. Scalar shorthand sets `radius`. */\r\nexport interface BlurOptions extends EffectOptions {\r\n /** Blur spread in pixels. */\r\n radius: number;\r\n}\r\n\r\n/** Directional (linear) blur. Scalar shorthand sets `radius`. */\r\nexport interface DirectionalBlurOptions extends EffectOptions {\r\n /** Smear length in pixels along `angle`. */\r\n radius: number;\r\n /** Smear axis in degrees — 0 = horizontal, 90 = vertical (default 0). */\r\n angle?: number;\r\n}\r\n\r\n/** Desaturation. Scalar shorthand sets `amount`. */\r\nexport interface GrayscaleOptions extends EffectOptions {\r\n /** 0–1: 0 = original, 1 = fully desaturated. */\r\n amount: number;\r\n}\r\n\r\n/**\r\n * After Effects-style Mosaic. Scalar shorthand sets `blocks` on both axes.\r\n *\r\n * `blocks` is the *number of blocks* across the node, so a count equal to the\r\n * node's pixel size on that axis is pristine and lower counts are coarser.\r\n */\r\nexport interface PixelateOptions extends EffectOptions {\r\n /** Block count — a number for both axes, or per-axis via `{ x, y }`. */\r\n blocks: number | Vector2;\r\n /** AE \"Sharp Colors\": solid blocks (true, the default) vs. smoothly blended. */\r\n sharpColors?: boolean;\r\n}\r\n\r\n/** Bulge / pinch lens over the node's content, or the backdrop. Scalar shorthand sets `strength`. */\r\nexport interface BulgeOptions extends EffectOptions {\r\n /** Positive bulges (barrel), negative pinches (pincushion). Range ≈ −1…1. */\r\n strength: number;\r\n /** Lens centre in 0–1 layer coords (default middle). */\r\n center?: Vector2;\r\n}\r\n\r\n/** Magnifier lens over the backdrop. Scalar shorthand sets `scale`. */\r\nexport interface MagnifyOptions extends EffectOptions {\r\n /** Magnification factor — 1 = none, 2 = 2×, 0.5 = zoomed out (default 2). */\r\n scale?: number;\r\n /** Magnify centre in 0–1 layer coords (default middle). */\r\n center?: Vector2;\r\n}\r\n\r\n/** Bloom (glow). Scalar shorthand sets `intensity`. */\r\nexport interface BloomOptions extends EffectOptions {\r\n /** Additive multiplier for the bloom pass (default 1). */\r\n intensity?: number;\r\n /** 0–1 luminance cutoff — only pixels brighter than this bloom (default 0.7). */\r\n threshold?: number;\r\n /** Spread in pixels (default 12). */\r\n radius?: number;\r\n}\r\n\r\n/** Vintage / film-look colour grading. Scalar shorthand sets `amount`. */\r\nexport interface VintageOptions extends EffectOptions {\r\n /** 0–1: 0 = original, 1 = full sepia + desaturate (default 1). */\r\n amount?: number;\r\n /** −1…1: negative = cool/cyan tint, positive = warm/amber (default 0.2). */\r\n warmth?: number;\r\n}\r\n\r\n/** Lens-dispersion colour fringing. Scalar shorthand sets `amount`. */\r\nexport interface ChromaticAberrationOptions extends EffectOptions {\r\n /** Pixel offset distance for the R/B fringe (default 4). */\r\n amount?: number;\r\n /** Fringe axis in degrees — 0 = horizontal, R right / B left (default 0). */\r\n angle?: number;\r\n}\r\n\r\n/** Colour invert. Scalar shorthand sets `strength`. */\r\nexport interface InvertOptions extends EffectOptions {\r\n /** 0–1: blend from original (0) to fully inverted (1) (default 1). */\r\n strength?: number;\r\n /** Which channel / colour component to invert (default `'rgba'`). */\r\n channel?: InvertChannel;\r\n}\r\n\r\n/** Per-pixel random jitter. Scalar shorthand sets `strength`. */\r\nexport interface ScatterOptions extends EffectOptions {\r\n /** Maximum random pixel displacement (default 10). */\r\n strength?: number;\r\n /** Axis pixels are scattered along (default `'both'`). */\r\n axis?: EffectAxis;\r\n}\r\n\r\n/** Colour banding. Scalar shorthand sets `levels`. */\r\nexport interface PosterizeOptions extends EffectOptions {\r\n /** Number of brightness levels per channel (≥ 2, default 4). */\r\n levels?: number;\r\n}\r\n\r\n/** Velocity-driven motion blur. Scalar shorthand sets `length`. */\r\nexport interface MotionBlurOptions extends EffectOptions {\r\n /** Shutter \"openness\" as a percent; 100 ≈ 360° (default 50). */\r\n length?: number;\r\n /** Shutter phase: `'behind'` | `'centered'` | `'ahead'` | −1…1 (default `'centered'`). */\r\n alignment?: MotionBlurAlignment;\r\n /** Renderer quality hint; higher switches to multi-tap accumulation (default 16). */\r\n samples?: number;\r\n /** Blur-length multiplier (default 1). */\r\n strength?: number;\r\n /** Per-axis velocity scale (default `'both'`). */\r\n axis?: EffectAxis;\r\n}\r\n\r\n/**\r\n * A custom shader. `mode` selects the path:\r\n *\r\n * - `'foreground'` (the default) — the shader generates colour and is composited\r\n * onto the node's layer with `blendMode`.\r\n * - `'backdrop'` — the shader receives `uniform shader u_backdrop` (a snapshot of\r\n * what is painted beneath the node) and resamples it. `blendMode` is unused.\r\n */\r\nexport interface ShaderEffectOptions extends EffectOptions {\r\n /**\r\n * SkSL source, or a registered **shader pack** — a program plus the editable\r\n * values it publishes.\r\n *\r\n * A pack resolves to plain uniforms here, so nothing below this builder\r\n * knows one exists; what survives into the document is the resolved record\r\n * plus a `shaderId` naming the pack, which is what lets a host reopen its\r\n * property panel from a saved scene.\r\n */\r\n source: string | EffectShader;\r\n /**\r\n * Property overrides, by property id, when {@link source} is a pack.\r\n *\r\n * Anything not named here takes the pack's own default. Ignored — with a\r\n * warning — for a bare source string, which has no properties to override.\r\n */\r\n values?: ShaderPropertyValues;\r\n /**\r\n * Uniform values by name — lerped between animation frames (default `{}`).\r\n *\r\n * The positional `[{ name, value }]` array still works; both are bound by\r\n * name now, so the array's order no longer means anything.\r\n */\r\n uniforms?: SkSLUniformRecord | SkSLUniform[];\r\n /** How a foreground shader composites onto the layer (default `'screen'`). */\r\n blendMode?: BlendMode;\r\n}\r\n\r\n/** Coloured band around the node's silhouette. Scalar shorthand sets `width`. */\r\nexport interface OutlineOptions extends EffectOptions {\r\n /** Band thickness in pixels (default 4). */\r\n width?: number;\r\n /** Band colour (default `'black'`). */\r\n color?: Color;\r\n /** Which side of the edge the band grows from (default `'outside'`). */\r\n position?: OutlinePosition;\r\n}\r\n\r\n/**\r\n * A shadow cast from the node's silhouette. Scalar shorthand sets `blur`, since\r\n * softness is the knob a shadow is usually reached for by.\r\n */\r\nexport interface DropShadowOptions extends EffectOptions {\r\n /** Horizontal displacement in pixels (default 0). */\r\n offsetX?: number;\r\n /** Vertical displacement in pixels, positive being upward (default -8). */\r\n offsetY?: number;\r\n /** Softness in pixels, on a `blur` effect's scale (default 16). */\r\n blur?: number;\r\n /** Grows the silhouette before blurring, in pixels (default 0). */\r\n spread?: number;\r\n /** Shadow colour (default `'black'`). */\r\n color?: Color;\r\n}\r\n\r\n/** Darkened edges / lens falloff. Scalar shorthand sets `amount`. */\r\nexport interface VignetteOptions extends EffectOptions {\r\n /** 0–1 tint strength at the edge (default 0.5). */\r\n amount?: number;\r\n /** 0–1 normalised radius where the falloff starts (default 0.75). */\r\n radius?: number;\r\n /** 0–1 ramp width; 0 is a hard ring (default 0.5). */\r\n softness?: number;\r\n /** Tint colour (default `'black'`). */\r\n color?: Color;\r\n}\r\n\r\n/** Film grain. Scalar shorthand sets `amount`. */\r\n/**\r\n * A 3D colour lookup table — see {@link LutEffect} for the table's layout and\r\n * why it is compared by reference.\r\n *\r\n * No scalar shorthand: the dominant argument is a whole cube, and a builder that\r\n * took `Effects.lut(table)` would still need the size beside it to read it.\r\n */\r\nexport interface LutOptions extends EffectOptions {\r\n /** The cube, flat RGB triples, red-fastest. */\r\n table: Float32Array;\r\n /** Entries per axis. */\r\n size: number;\r\n /** 0–1 mix against the ungraded colour (default 1 — the full look). */\r\n amount?: number;\r\n}\r\n\r\nexport interface GrainOptions extends EffectOptions {\r\n /** 0–1 noise amplitude (default 0.25). */\r\n amount?: number;\r\n /** Grain cell size in pixels (default 1). */\r\n size?: number;\r\n /** Random field offset — animate it for frame-locked shimmer (default 0). */\r\n seed?: number;\r\n /** Re-seed every frame from elapsed time (default false). */\r\n animated?: boolean;\r\n /** Per-channel colour speckle instead of luminance noise (default false). */\r\n colored?: boolean;\r\n}\r\n\r\n/** Unsharp-mask sharpen. Scalar shorthand sets `amount`. */\r\nexport interface SharpenOptions extends EffectOptions {\r\n /** Edge-contrast boost (default 1). */\r\n amount?: number;\r\n /** Radius of the blurred reference, in pixels (default 1). */\r\n radius?: number;\r\n}\r\n\r\n/** Edge detection. Scalar shorthand sets `strength`. */\r\nexport interface EdgesOptions extends EffectOptions {\r\n /** Multiplier on the detected gradient (default 1). */\r\n strength?: number;\r\n /** Which operator measures the gradient (default `'sobel'`). */\r\n kernel?: EdgeKernel;\r\n /** Detect per RGB channel instead of on luminance (default false). */\r\n colored?: boolean;\r\n}\r\n\r\n/** Two-tone luminance cut. Scalar shorthand sets `level`. */\r\nexport interface ThresholdOptions extends EffectOptions {\r\n /** 0–1 cut point (default 0.5). */\r\n level?: number;\r\n /** 0–1 ramp width around the cut (default 0.05 — just enough to anti-alias). */\r\n smoothness?: number;\r\n}\r\n\r\n/** Zoom / spin blur about a point. Scalar shorthand sets `amount`. */\r\nexport interface RadialBlurOptions extends EffectOptions {\r\n /** Smear length, 0–1 (default 0.5). */\r\n amount?: number;\r\n /** Radial rush (`'zoom'`) or rotational streak (`'spin'`) (default `'zoom'`). */\r\n style?: RadialBlurStyle;\r\n /** Blur centre in 0–1 layer coords (default middle). */\r\n center?: Vector2;\r\n /** Taps averaged per pixel (default 16, max 32). */\r\n samples?: number;\r\n}\r\n\r\n/** Halftone print screen. Scalar shorthand sets `size`. */\r\nexport interface HalftoneOptions extends EffectOptions {\r\n /** Cell pitch in pixels (default 8). */\r\n size?: number;\r\n /** Screen rotation in degrees (default 45). */\r\n angle?: number;\r\n /** Mark drawn per cell (default `'dot'`). */\r\n shape?: HalftoneShape;\r\n /** Plates to screen into (default `'mono'`). */\r\n separation?: HalftoneSeparation;\r\n}\r\n\r\n/** Ordered (Bayer) dithering. Scalar shorthand sets `levels`. */\r\nexport interface DitherOptions extends EffectOptions {\r\n /** Output tones per channel, ≥ 2 (default 2). */\r\n levels?: number;\r\n /**\r\n * Threshold pattern (default `'bayer'`).\r\n *\r\n * `'bayer'` is the classic ordered matrix — a visible crosshatch, which is\r\n * the retro look and also what can beat against the pixel grid at some\r\n * `scale`s. `'blue'` is a void-and-cluster blue-noise field: same tone\r\n * reproduction, no lattice, no moiré. Reach for `'blue'` when the dither\r\n * should read as texture rather than as pattern.\r\n */\r\n noise?: DitherNoise;\r\n /** Bayer matrix size (default 4). Ignored when `noise` is `'blue'`. */\r\n matrix?: DitherMatrix;\r\n /** Pattern cell size in pixels (default 1). */\r\n scale?: number;\r\n /** Dither luminance to black and white (default false). */\r\n monochrome?: boolean;\r\n}\r\n\r\n/** Two-colour luminance ramp. Scalar shorthand sets `amount`. */\r\nexport interface DuotoneOptions extends EffectOptions {\r\n /** 0–1 blend from the original colours to the full ramp (default 1). */\r\n amount?: number;\r\n /** Colour the darkest tones map to (default `'black'`). */\r\n shadows?: Color;\r\n /** Colour the brightest tones map to (default `'white'`). */\r\n highlights?: Color;\r\n}\r\n\r\n/** Tone curve through control points. */\r\nexport interface CurvesOptions extends EffectOptions {\r\n /** Curve control points as `[input, output]` pairs in 0–1. */\r\n points: [number, number][];\r\n /** Channel(s) the curve applies to (default `'rgb'`). */\r\n channel?: CurvesChannel;\r\n}\r\n\r\n/** Photographic grading. Every field is optional and defaults to neutral. */\r\nexport type ColorAdjustmentOptions = Omit<ColorAdjustmentEffect, 'type'> & EffectOptions;\r\n\r\n/**\r\n * Per-channel RGB offset. Scalar shorthand sets `amount`, which spreads red and\r\n * blue apart horizontally by that many pixels and leaves green put — the\r\n * everyday case. Name `red`/`green`/`blue` for full control.\r\n */\r\nexport interface RgbShiftOptions extends EffectOptions {\r\n /** Shorthand: ±px horizontal spread of red vs. blue (default 4). */\r\n amount?: number;\r\n /** Red plane offset in px. Overrides `amount` for this channel. */\r\n red?: Vector2;\r\n /** Green plane offset in px. */\r\n green?: Vector2;\r\n /** Blue plane offset in px. Overrides `amount` for this channel. */\r\n blue?: Vector2;\r\n}\r\n\r\n/** CRT scanlines. Scalar shorthand sets `darkness`. */\r\nexport interface ScanlinesOptions extends EffectOptions {\r\n /** 0–1 how far the bands darken (default 0.5). */\r\n darkness?: number;\r\n /** Distance between band centres in px (default 4). */\r\n spacing?: number;\r\n /** 0–1 share of each period the dark band covers (default 0.5). */\r\n thickness?: number;\r\n /** Band offset in px — animate to roll the pattern (default 0). */\r\n offset?: number;\r\n /** Band angle in degrees; 0 = horizontal (default 0). */\r\n angle?: number;\r\n}\r\n\r\n/** Datamosh-style band tearing. Scalar shorthand sets `amount`. */\r\nexport interface BlockDisplaceOptions extends EffectOptions {\r\n /** Maximum displacement in px (default 20). */\r\n amount?: number;\r\n /** Band thickness in px (default 16). */\r\n size?: number;\r\n /** 0–1 fraction of bands that move at all (default 0.3). */\r\n density?: number;\r\n /** Random field offset — step it to jump between glitch states (default 0). */\r\n seed?: number;\r\n /** Which way bands slide (default `'x'`). */\r\n axis?: EffectAxis;\r\n}\r\n\r\n/** ASCII art from a glyph grid. Scalar shorthand sets `size`. */\r\nexport interface AsciiOptions extends EffectOptions {\r\n /** Cell size in pixels — the width of one character (default 12). */\r\n size?: number;\r\n /** A named ramp, or a custom string ordered most-ink-first (default `'standard'`). */\r\n charset?: AsciiCharset | string;\r\n /** Family the glyphs are baked in; a monospace face reads best (default `'monospace'`). */\r\n fontFamily?: string;\r\n /** Glyph colour when `colored` is false (default `'white'`). */\r\n ink?: Color;\r\n /** Colour behind the glyphs (default `'black'`; use `'transparent'` to overlay). */\r\n background?: Color;\r\n /** Tint each glyph with its own cell's colour instead of using `ink` (default false). */\r\n colored?: boolean;\r\n}\r\n\r\n/** Anamorphic glare — a bright pass smeared along one axis. Scalar shorthand sets `intensity`. */\r\nexport interface StreakOptions extends EffectOptions {\r\n /** Additive multiplier for the streak pass (default 1). */\r\n intensity?: number;\r\n /** 0–1 luminance cutoff (default 0.7). */\r\n threshold?: number;\r\n /** Smear length in pixels (default 120). */\r\n length?: number;\r\n /** Smear axis in degrees; 0 = horizontal (default 0). */\r\n angle?: number;\r\n}\r\n\r\n/**\r\n * A glow — bright (or opaque) areas spread outward and composited back, with\r\n * optional recolouring. Scalar shorthand sets `intensity`.\r\n *\r\n * Unlike `bloom`, this spreads past the node's own box, chooses how the source\r\n * composites against it, and can be coloured through a ramp.\r\n */\r\nexport interface GlowOptions extends EffectOptions {\r\n /** Additive multiplier for the glow pass (default 1). */\r\n intensity?: number;\r\n /** What decides a pixel's glow strength (default `'luminance'`). */\r\n channel?: GlowChannel;\r\n /** 0-1 luminance cutoff; read only when `channel` is `'luminance'` (default 0.5). */\r\n threshold?: number;\r\n /** Spread distance in pixels (default 25). */\r\n radius?: number;\r\n /** Dilation applied before the blur, in pixels — gives the glow a solid core (default 0). */\r\n spread?: number;\r\n /** Which way the glow spreads; `'x'`/`'y'` give anamorphic streaks (default `'both'`). */\r\n axis?: EffectAxis;\r\n /** Where the source layer sits relative to the glow (default `'behind'`). */\r\n original?: GlowOriginal;\r\n /** How the glow merges with the layer (default `'screen'`). */\r\n blend?: BlendMode;\r\n /** What the glow is coloured with (default `'none'`). */\r\n tint?: GlowTint;\r\n /** The glow's colour when `tint` is `'solid'` (default `'white'`). */\r\n color?: Color;\r\n /** Ramp colours when `tint` is `'ramp'`, parallel to `stops`. */\r\n colors?: Color[];\r\n /** Each ramp colour's position, 0-1 ascending (default evenly spaced). */\r\n stops?: number[];\r\n /** How the ramp repeats past one pass (default `'mirror'`). */\r\n loopStyle?: GlowLoopStyle;\r\n /** Ramp traversals across the glow's strength range (default 1). */\r\n cycles?: number;\r\n /** Offset along the ramp in degrees of one cycle; animate to move colour (default 0). */\r\n phase?: number;\r\n}\r\n\r\n/** Kuwahara brushwork. Scalar shorthand sets `radius`. */\r\nexport interface OilPaintOptions extends EffectOptions {\r\n /** Window radius in pixels — brush size, capped at 6 (default 3). */\r\n radius?: number;\r\n}\r\n\r\n/** Sine warp. Scalar shorthand sets `amplitude` on the Y axis — the everyday ripple. */\r\nexport interface WaveOptions extends EffectOptions {\r\n /** Peak displacement in px — a number (Y only), or per-axis via `{ x, y }` (default 20). */\r\n amplitude?: number | Vector2;\r\n /** Distance between crests in px (default 120). */\r\n wavelength?: number;\r\n /** Phase in degrees; tween over 360 for one seamless loop (default 0). */\r\n phase?: number;\r\n /** Parallel bands or concentric rings (default `'linear'`). */\r\n shape?: WaveShape;\r\n /** Direction the crests advance along, in degrees (default 0). `'linear'` only. */\r\n angle?: number;\r\n /** Ring origin in 0–1 layer coords (default middle). `'radial'` only. */\r\n center?: Vector2;\r\n}\r\n\r\n/** Twirl / swirl vortex. Scalar shorthand sets `angle`. */\r\nexport interface TwirlOptions extends EffectOptions {\r\n /** Rotation at the centre in degrees (default 180). */\r\n angle?: number;\r\n /** 0–1 radius of influence (default 1 — the whole node). */\r\n radius?: number;\r\n /** Vortex centre in 0–1 layer coords (default middle). */\r\n center?: Vector2;\r\n}\r\n\r\n/**\r\n * Blur that ramps across the node. Scalar shorthand sets `radius`.\r\n *\r\n * `mode: 'backdrop'` gives the frosted panel whose blur fades out rather than\r\n * ending at a hard edge.\r\n */\r\nexport interface ProgressiveBlurOptions extends EffectOptions {\r\n /** Blur spread in px at the far end of the ramp (default 24). */\r\n radius?: number;\r\n /** Blur spread in px at the near end of the ramp (default 0, i.e. sharp). */\r\n startRadius?: number;\r\n /** Ramp layout (default `'linear'`). */\r\n shape?: ProgressiveBlurShape;\r\n /** 0–1 where the blur starts building (default 0). */\r\n start?: number;\r\n /** 0–1 where it reaches `radius` (default 1). */\r\n end?: number;\r\n /** Ramp direction in degrees; 0 = left-to-right (default 90, i.e. downward). */\r\n angle?: number;\r\n /** Ramp origin in 0–1 layer coords (default middle). `'radial'` only. */\r\n center?: Vector2;\r\n /** Taps averaged at full radius, 2–32 (default 20). */\r\n samples?: number;\r\n}\r\n\r\n/** Mirrored wedges around a point. Scalar shorthand sets `segments`. */\r\nexport interface KaleidoscopeOptions extends EffectOptions {\r\n /** Number of mirrored wedges; below 2 is a no-op (default 6). */\r\n segments?: number;\r\n /** Rotation of the pattern in degrees — animate to sweep the source (default 0). */\r\n angle?: number;\r\n /** Fold origin in 0–1 layer coords (default middle). */\r\n center?: Vector2;\r\n /** Radial offset of the sampled wedge (default 0). */\r\n offset?: number;\r\n /** 0–1 blend from the original to the folded pattern — the handle to ramp it on (default 1). */\r\n amount?: number;\r\n}\r\n\r\n/**\r\n * Figma's Glass over the backdrop. Scalar shorthand sets `refraction`.\r\n *\r\n * Figma's fields, units and defaults (light `-45°` at 80, refraction 80, depth\r\n * 20 px, dispersion 50, frost 4, splay 0), so a bare `Effects.glass()` is the\r\n * glass Figma adds and values copied from a Figma file render the same.\r\n *\r\n * Defaults to `{ mode: 'backdrop' }`; there is nothing to refract in a node's\r\n * own paint, so the foreground is a no-op.\r\n */\r\nexport interface GlassOptions extends EffectOptions {\r\n /** Where the light comes from, in degrees clockwise from the top (default -45, top left). */\r\n lightAngle?: number;\r\n /** 0–100 brightness of the light (default 80). */\r\n lightIntensity?: number;\r\n /** 0–100 how strongly the curved edge bends the backdrop (default 80). */\r\n refraction?: number;\r\n /** How far the curved edge reaches in from the outline, px (default 20). */\r\n depth?: number;\r\n /** 0–100 spectral split along the curved edge (default 50). */\r\n dispersion?: number;\r\n /** Backdrop blur radius, px (default 4). */\r\n frost?: number;\r\n /** 0–100 how far the projected light spreads in from the rim (default 0). */\r\n splay?: number;\r\n}\r\n\r\n/** Colour-depth reduction. Scalar shorthand sets `bits`. */\r\nexport interface BitCrushOptions extends EffectOptions {\r\n /** Bits per channel when `palette` is `'none'`, 1–8 (default 3). */\r\n bits?: number;\r\n /** Fixed hardware palette to snap to (default `'none'`). */\r\n palette?: BitCrushPalette;\r\n /** 0–1 blend between original and crushed (default 1). */\r\n amount?: number;\r\n}\r\n\r\nconst CENTER: Vector2 = { x: 0.5, y: 0.5 };\r\n\r\n/**\r\n * The ramp a glow starts with: white at the core falling to a warm amber.\r\n *\r\n * Copied rather than handed out, because unlike {@link CENTER} these are arrays\r\n * — sharing one would let editing a single glow's ramp reach into every other\r\n * glow ever built from the defaults.\r\n */\r\nconst GLOW_RAMP_COLORS: readonly Color[] = [\"white\", \"#ffa640\"];\r\nconst GLOW_RAMP_STOPS: readonly number[] = [0, 1];\r\nconst ZERO: Vector2 = { x: 0, y: 0 };\r\n\r\n/** Normalise {@link PixelateOptions.blocks} to a per-axis count. */\r\nconst toBlocks = (blocks: number | Vector2): Vector2 =>\r\n typeof blocks === \"number\" ? { x: blocks, y: blocks } : blocks;\r\n\r\n/**\r\n * Normalise {@link WaveOptions.amplitude}. A bare number means the Y axis only —\r\n * a wave that displaces along its own direction of travel just smears, so the\r\n * transverse case is the one worth spelling `20` for.\r\n */\r\nconst toAmplitude = (value: number | Vector2): Vector2 =>\r\n typeof value === \"number\" ? { x: 0, y: value } : value;\r\n\r\n/**\r\n * Immutable, chainable list of node effects.\r\n *\r\n * Each builder method returns a new `EffectChain` with the effect appended,\r\n * so chains are safe to share and branch.\r\n *\r\n * @example\r\n * const fx = Effects.blur(4).grayscale(0.5);\r\n * node.effects = fx; // assign directly\r\n * node.effects = [...fx, { type: 'pixelate', ... }]; // spread into array\r\n */\r\nexport class EffectChain {\r\n constructor(public list: NodeEffect[] = []) { }\r\n\r\n private append(effect: NodeEffect): EffectChain {\r\n return new EffectChain([...this.list, effect]);\r\n }\r\n\r\n /**\r\n * Append a Gaussian blur. Pass `{ mode: \"backdrop\" }` to blur the content\r\n * beneath the node (clipped to its silhouette, Figma-style) instead of the\r\n * node's own content.\r\n */\r\n blur(options: number | BlurOptions) {\r\n const o = scalarOptions(options, \"radius\");\r\n return this.append(withEffectOptions({ type: \"blur\" as const, radius: o.radius ?? 0 }, o));\r\n }\r\n\r\n /**\r\n * Append a motion-blur-style directional (linear) blur, smearing the node's\r\n * own content along a single axis (or the backdrop, with `{ mode: \"backdrop\" }`).\r\n */\r\n directionalBlur(options: number | DirectionalBlurOptions) {\r\n const o = scalarOptions(options, \"radius\");\r\n return this.append(withEffectOptions(\r\n { type: \"directionalBlur\" as const, radius: o.radius ?? 0, angle: o.angle ?? 0 },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append an After Effects-style Mosaic / pixelate. `blocks` is the *number of\r\n * blocks* across the node (a count equal to the node's pixel size on that\r\n * axis is pristine; lower is coarser), not a pixel block size.\r\n */\r\n pixelate(options: number | PixelateOptions) {\r\n const o = scalarOptions(options, \"blocks\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"pixelate\" as const,\r\n blocks: toBlocks(o.blocks ?? 1),\r\n sharpColors: o.sharpColors ?? true,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /** Append a grayscale effect. `{ mode: \"backdrop\" }` desaturates the backdrop. */\r\n grayscale(options: number | GrayscaleOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions({ type: \"grayscale\" as const, amount: o.amount ?? 0 }, o));\r\n }\r\n\r\n /**\r\n * Append a bulge/pinch lens. A barrel distortion magnifies the centre and\r\n * pins the edges; a negative strength pinches the centre inward instead.\r\n * `mode: \"backdrop\"` points the same lens at what is painted beneath the\r\n * node, giving a glass dome over the layers below rather than a warp of the\r\n * node's own paint.\r\n */\r\n bulge(options: number | BulgeOptions) {\r\n const o = scalarOptions(options, \"strength\");\r\n return this.append(withEffectOptions(\r\n { type: \"bulge\" as const, strength: o.strength ?? 0, center: o.center ?? CENTER },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a magnify lens that magnifies the backdrop beneath the node. The lens\r\n * fills the node's bounding box and is clipped to its silhouette, so whatever\r\n * is painted underneath shows through scaled about `center` — like a\r\n * magnifying glass shaped to the node.\r\n *\r\n * Defaults to `{ mode: 'backdrop' }`; pass `mode` explicitly to override.\r\n */\r\n magnify(options?: number | MagnifyOptions) {\r\n const o = scalarOptions(options, \"scale\");\r\n return this.append(withEffectOptions(\r\n { type: \"magnify\" as const, scale: o.scale ?? 2, center: o.center ?? CENTER },\r\n { ...o, mode: o.mode ?? \"backdrop\" },\r\n ));\r\n }\r\n\r\n /**\r\n * Append a bloom (glow) effect. Bright areas bleed soft light outward via a\r\n * screen-blend of the blurred bright-pass onto the layer.\r\n */\r\n bloom(options?: number | BloomOptions) {\r\n const o = scalarOptions(options, \"intensity\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"bloom\" as const,\r\n threshold: o.threshold ?? 0.7,\r\n radius: o.radius ?? 12,\r\n intensity: o.intensity ?? 1,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /** Append a vintage / film-look colour grading effect. */\r\n vintage(options?: number | VintageOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n { type: \"vintage\" as const, amount: o.amount ?? 1, warmth: o.warmth ?? 0.2 },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a chromatic aberration effect — red/blue colour fringing that mimics\r\n * lens dispersion.\r\n */\r\n chromaticAberration(options?: number | ChromaticAberrationOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n { type: \"chromaticAberration\" as const, amount: o.amount ?? 4, angle: o.angle ?? 0 },\r\n o,\r\n ));\r\n }\r\n\r\n /** Append a colour-invert effect. */\r\n invert(options?: number | InvertOptions) {\r\n const o = scalarOptions(options, \"strength\");\r\n return this.append(withEffectOptions(\r\n { type: \"invert\" as const, channel: o.channel ?? \"rgba\", strength: o.strength ?? 1 },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a scatter effect — randomly jitters the node's own pixels, smearing\r\n * its content like After Effects' Scatter.\r\n */\r\n scatter(options?: number | ScatterOptions) {\r\n const o = scalarOptions(options, \"strength\");\r\n return this.append(withEffectOptions(\r\n { type: \"scatter\" as const, strength: o.strength ?? 10, axis: o.axis ?? \"both\" },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append an After Effects-style posterize effect — quantizes each colour\r\n * channel into `levels` evenly-spaced bands, flattening gradients into steps.\r\n */\r\n posterize(options?: number | PosterizeOptions) {\r\n const o = scalarOptions(options, \"levels\");\r\n return this.append(withEffectOptions({ type: \"posterize\" as const, levels: o.levels ?? 4 }, o));\r\n }\r\n\r\n /**\r\n * Append velocity-driven motion blur — smears the node's own content along its\r\n * actual per-frame motion (a static node stays sharp). Modelled on After\r\n * Effects' shutter angle (`length`) and shutter phase (`alignment`).\r\n */\r\n motionBlur(options?: number | MotionBlurOptions) {\r\n const o = scalarOptions(options, \"length\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"motionBlur\" as const,\r\n length: o.length ?? 50,\r\n alignment: o.alignment ?? \"centered\",\r\n samples: o.samples ?? 16,\r\n strength: o.strength ?? 1,\r\n axis: o.axis ?? \"both\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append an outline — a coloured band traced around the node's silhouette,\r\n * including alpha silhouettes (text, an image's cutout, a whole subtree) that\r\n * a geometry `stroke` can't follow.\r\n */\r\n outline(options?: number | OutlineOptions) {\r\n const o = scalarOptions(options, \"width\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"outline\" as const,\r\n width: o.width ?? 4,\r\n color: o.color ?? \"black\",\r\n position: o.position ?? \"outside\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a drop shadow cast from the node's **silhouette** — including alpha\r\n * silhouettes (text, an image's cutout, a whole subtree) that a geometry\r\n * `shadow` can't follow, since that one fills the node's path.\r\n */\r\n dropShadow(options?: number | DropShadowOptions) {\r\n const o = scalarOptions(options, \"blur\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"dropShadow\" as const,\r\n offsetX: o.offsetX ?? 0,\r\n offsetY: o.offsetY ?? -8,\r\n blur: o.blur ?? 16,\r\n spread: o.spread ?? 0,\r\n color: o.color ?? \"black\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a vignette — a soft tint ramping in toward the node's corners. The\r\n * falloff follows the node's aspect ratio, so a wide node darkens along its\r\n * short edges the way a lens would.\r\n */\r\n vignette(options?: number | VignetteOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"vignette\" as const,\r\n amount: o.amount ?? 0.5,\r\n radius: o.radius ?? 0.75,\r\n softness: o.softness ?? 0.5,\r\n color: o.color ?? \"black\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append film grain. Static grain reads as texture rather than film, so pass\r\n * `{ animated: true }` to re-seed it each frame — or tween `seed` when the\r\n * render has to stay deterministic.\r\n */\r\n /**\r\n * Apply a 3D colour lookup table.\r\n *\r\n * The whole point of a LUT is that it is *someone else's* colour science, so\r\n * there is nothing to default beyond how much of it to use: `amount` is the\r\n * mix and everything else is the file.\r\n *\r\n * @example\r\n * Effects.lut({ table, size: 33 }) // the full look\r\n * Effects.lut({ table, size: 33, amount: 0.6 })\r\n */\r\n lut(options: LutOptions) {\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"lut\" as const,\r\n table: options.table,\r\n size: options.size,\r\n amount: options.amount ?? 1,\r\n },\r\n options,\r\n ));\r\n }\r\n\r\n grain(options?: number | GrainOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"grain\" as const,\r\n amount: o.amount ?? 0.25,\r\n size: o.size ?? 1,\r\n seed: o.seed ?? 0,\r\n animated: o.animated ?? false,\r\n colored: o.colored ?? false,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /** Append an unsharp-mask sharpen — local contrast boosted at `radius` scale. */\r\n sharpen(options?: number | SharpenOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n { type: \"sharpen\" as const, amount: o.amount ?? 1, radius: o.radius ?? 1 },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append edge detection — flat areas go black and boundaries light up with\r\n * the magnitude of the local gradient.\r\n */\r\n edges(options?: number | EdgesOptions) {\r\n const o = scalarOptions(options, \"strength\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"edges\" as const,\r\n strength: o.strength ?? 1,\r\n kernel: o.kernel ?? \"sobel\",\r\n colored: o.colored ?? false,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a luminance threshold — a two-tone stencil cut at `level`, with\r\n * `smoothness` widening the cut into a ramp.\r\n */\r\n threshold(options?: number | ThresholdOptions) {\r\n const o = scalarOptions(options, \"level\");\r\n return this.append(withEffectOptions(\r\n { type: \"threshold\" as const, level: o.level ?? 0.5, smoothness: o.smoothness ?? 0.05 },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a radial blur — samples smeared along the radius (`'zoom'`, the\r\n * default) or the tangent (`'spin'`) about `center`, leaving the centre sharp.\r\n */\r\n radialBlur(options?: number | RadialBlurOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"radialBlur\" as const,\r\n amount: o.amount ?? 0.5,\r\n style: o.style ?? \"zoom\",\r\n center: o.center ?? CENTER,\r\n samples: o.samples ?? 16,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a halftone screen — the newsprint look, where tone becomes the size\r\n * of a mark on a rotated grid.\r\n */\r\n halftone(options?: number | HalftoneOptions) {\r\n const o = scalarOptions(options, \"size\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"halftone\" as const,\r\n size: o.size ?? 8,\r\n angle: o.angle ?? 45,\r\n shape: o.shape ?? \"dot\",\r\n separation: o.separation ?? \"mono\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append ordered (Bayer) dithering — quantization to `levels` tones per\r\n * channel with the error traded for a retro crosshatch pattern.\r\n */\r\n dither(options?: number | DitherOptions) {\r\n const o = scalarOptions(options, \"levels\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"dither\" as const,\r\n levels: o.levels ?? 2,\r\n matrix: o.matrix ?? 4,\r\n scale: o.scale ?? 1,\r\n monochrome: o.monochrome ?? false,\r\n noise: o.noise ?? \"bayer\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a duotone / gradient map — the content's luminance remapped onto a\r\n * `shadows` → `highlights` ramp, discarding its original chroma.\r\n */\r\n duotone(options?: number | DuotoneOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"duotone\" as const,\r\n amount: o.amount ?? 1,\r\n shadows: o.shadows ?? \"black\",\r\n highlights: o.highlights ?? \"white\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a tone curve — the same adjustment `Adjustments.curves` applies to a\r\n * photo, on any node.\r\n */\r\n curves(options: CurvesOptions) {\r\n return this.append(withEffectOptions(\r\n { type: \"curves\" as const, points: options.points, channel: options.channel ?? \"rgb\" },\r\n options,\r\n ));\r\n }\r\n\r\n /**\r\n * Append photographic grading (brightness / contrast / saturation / vibrance /\r\n * shadows / highlights / temperature / tint) — `Adjustments.colorAdjustment`\r\n * on any node. For darkened edges use {@link EffectChain.vignette}.\r\n */\r\n colorAdjustment(options: ColorAdjustmentOptions) {\r\n // Destructure `mode` out rather than spreading it through: a caller who\r\n // writes `{ mode: undefined }` would otherwise plant the key on the\r\n // effect, and `equals()` compares `mode` directly. `withEffectOptions`\r\n // skips undefined, so handing it back there is safe.\r\n const { mode, ...fields } = options;\r\n return this.append(withEffectOptions({ type: \"colorAdjustment\" as const, ...fields }, { mode }));\r\n }\r\n\r\n /**\r\n * Append a per-channel RGB offset — the digital cousin of\r\n * {@link EffectChain.chromaticAberration}, where each plane goes where you\r\n * point it instead of following a lens model.\r\n */\r\n rgbShift(options?: number | RgbShiftOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n const spread = o.amount ?? 4;\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"rgbShift\" as const,\r\n red: o.red ?? { x: spread, y: 0 },\r\n green: o.green ?? ZERO,\r\n blue: o.blue ?? { x: -spread, y: 0 },\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append CRT scanlines. Animate `offset` past `spacing` to roll the bands;\r\n * the pattern wraps, so a linear tween loops seamlessly.\r\n */\r\n scanlines(options?: number | ScanlinesOptions) {\r\n const o = scalarOptions(options, \"darkness\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"scanlines\" as const,\r\n spacing: o.spacing ?? 4,\r\n thickness: o.thickness ?? 0.5,\r\n darkness: o.darkness ?? 0.5,\r\n offset: o.offset ?? 0,\r\n angle: o.angle ?? 0,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append datamosh-style band tearing. Step `seed` in whole numbers to jump\r\n * between distinct glitch states rather than sliding between them.\r\n */\r\n blockDisplace(options?: number | BlockDisplaceOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"blockDisplace\" as const,\r\n amount: o.amount ?? 20,\r\n size: o.size ?? 16,\r\n density: o.density ?? 0.3,\r\n seed: o.seed ?? 0,\r\n axis: o.axis ?? \"x\",\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append colour-depth reduction — `bits` per channel, or a fixed hardware\r\n * palette. Pair with {@link EffectChain.dither} so gradients survive the cut.\r\n */\r\n bitCrush(options?: number | BitCrushOptions) {\r\n const o = scalarOptions(options, \"bits\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"bitCrush\" as const,\r\n bits: o.bits ?? 3,\r\n palette: o.palette ?? \"none\",\r\n amount: o.amount ?? 1,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append ASCII art — the content divided into a grid of cells, each cell's\r\n * tone replaced by the glyph that carries a matching amount of ink.\r\n *\r\n * Set `background: 'transparent'` to lay the glyphs over whatever is behind\r\n * the node instead of over a solid field.\r\n */\r\n ascii(options?: number | AsciiOptions) {\r\n const o = scalarOptions(options, \"size\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"ascii\" as const,\r\n size: o.size ?? 12,\r\n charset: o.charset ?? \"standard\",\r\n fontFamily: o.fontFamily ?? \"monospace\",\r\n ink: o.ink ?? \"white\",\r\n background: o.background ?? \"black\",\r\n colored: o.colored ?? false,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append Kuwahara brushwork — averages within a region but never across an\r\n * edge, so flat areas smooth into strokes while boundaries stay crisp.\r\n * By some margin the most expensive effect in the set; keep `radius` small.\r\n */\r\n oilPaint(options?: number | OilPaintOptions) {\r\n const o = scalarOptions(options, \"radius\");\r\n return this.append(withEffectOptions({ type: \"oilPaint\" as const, radius: o.radius ?? 3 }, o));\r\n }\r\n\r\n /**\r\n * Append an anamorphic streak — a bright pass smeared along one axis and\r\n * screened back on. {@link EffectChain.bloom} spreads light in every\r\n * direction; this spreads it in one.\r\n */\r\n streak(options?: number | StreakOptions) {\r\n const o = scalarOptions(options, \"intensity\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"streak\" as const,\r\n intensity: o.intensity ?? 1,\r\n threshold: o.threshold ?? 0.7,\r\n length: o.length ?? 120,\r\n angle: o.angle ?? 0,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a glow — the bright (or opaque) parts of the layer spread outward\r\n * and composited back, optionally recoloured through a ramp.\r\n *\r\n * `bloom` is the cheaper relative: it screens a blurred bright-pass back\r\n * within the node's own box. This one spreads past that box, lets the source\r\n * sit behind, in front of, or nowhere at all, and can map glow strength onto\r\n * `colors`/`stops` — which is what a heat, neon or aurora look needs.\r\n */\r\n glow(options?: number | GlowOptions) {\r\n const o = scalarOptions(options, \"intensity\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"glow\" as const,\r\n channel: o.channel ?? \"luminance\",\r\n threshold: o.threshold ?? 0.5,\r\n radius: o.radius ?? 25,\r\n spread: o.spread ?? 0,\r\n intensity: o.intensity ?? 1,\r\n axis: o.axis ?? \"both\",\r\n original: o.original ?? \"behind\",\r\n blend: o.blend ?? \"screen\",\r\n tint: o.tint ?? \"none\",\r\n color: o.color ?? \"white\",\r\n colors: o.colors ?? [...GLOW_RAMP_COLORS],\r\n stops: o.stops ?? [...GLOW_RAMP_STOPS],\r\n loopStyle: o.loopStyle ?? \"mirror\",\r\n cycles: o.cycles ?? 1,\r\n phase: o.phase ?? 0,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a custom SkSL shader. `mode` picks the layer it runs on — a\r\n * foreground overlay blended with `blendMode`, or a backdrop shader that\r\n * resamples `uniform shader u_backdrop`.\r\n */\r\n shader(options: ShaderEffectOptions) {\r\n const pack = typeof options.source === \"string\" ? undefined : options.source;\r\n if (pack && pack.scope !== \"effect\") {\r\n throw new Error(\r\n `Effects.shader was given a \"${(pack as { scope: string }).scope}\" shader ` +\r\n `(\"${pack.name}\"). A fill shader has no backdrop to sample and is bound to a ` +\r\n `shape's box; use Fills.shader.`,\r\n );\r\n }\r\n // A pack that declares `u_backdrop` has to run on the backdrop path, so\r\n // it supplies the default — a caller may still say otherwise.\r\n const mode = options.mode ?? (pack?.backdrop ? \"backdrop\" : \"foreground\");\r\n const source = pack ? pack.source : (options.source as string);\r\n const uniforms = pack\r\n ? { ...resolveShaderProperties(pack, options.values), ...normalizeUniforms(options.uniforms ?? {}) }\r\n : (options.uniforms ?? {});\r\n const base = {\r\n type: \"shader\" as const,\r\n source,\r\n uniforms,\r\n ...(pack?.id !== undefined ? { shaderId: pack.id } : {}),\r\n };\r\n // blendMode only applies to the foreground overlay; leaving it undefined\r\n // for a backdrop shader keeps `equals()` comparing like with like.\r\n const effect: NodeEffect = mode === \"foreground\"\r\n ? { ...base, blendMode: options.blendMode ?? \"screen\" }\r\n : base;\r\n return this.append(withEffectOptions(effect, { mode }));\r\n }\r\n\r\n /**\r\n * @deprecated Use {@link EffectChain.shader}. `sksl` named the dialect; the\r\n * effect is named for the paint it is the sibling of. Takes the source in\r\n * `shader` rather than `source`, as it always did.\r\n */\r\n sksl(options: Omit<ShaderEffectOptions, \"source\"> & { shader: string }) {\r\n const { shader, ...rest } = options;\r\n return this.shader({ ...rest, source: shader });\r\n }\r\n\r\n /**\r\n * Append a sine warp. Tween `phase` over 360 to make the wave travel — it\r\n * wraps, so a linear tween loops seamlessly.\r\n */\r\n wave(options?: number | WaveOptions) {\r\n const o = scalarOptions(options, \"amplitude\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"wave\" as const,\r\n amplitude: toAmplitude(o.amplitude ?? 20),\r\n wavelength: o.wavelength ?? 120,\r\n phase: o.phase ?? 0,\r\n shape: o.shape ?? \"linear\",\r\n angle: o.angle ?? 0,\r\n center: o.center ?? CENTER,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a twirl / swirl vortex — a rotation about `center` that falls off\r\n * with distance, so the middle spins while the rim stays pinned.\r\n */\r\n twirl(options?: number | TwirlOptions) {\r\n const o = scalarOptions(options, \"angle\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"twirl\" as const,\r\n angle: o.angle ?? 180,\r\n radius: o.radius ?? 1,\r\n center: o.center ?? CENTER,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a blur whose radius ramps across the node rather than being\r\n * uniform. With `{ mode: 'backdrop' }` this is the frosted panel whose blur\r\n * fades out instead of ending at a hard edge.\r\n */\r\n progressiveBlur(options?: number | ProgressiveBlurOptions) {\r\n const o = scalarOptions(options, \"radius\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"progressiveBlur\" as const,\r\n radius: o.radius ?? 24,\r\n // Sharp at the near end unless asked otherwise — what this\r\n // effect did before the field existed.\r\n startRadius: o.startRadius ?? 0,\r\n shape: o.shape ?? \"linear\",\r\n start: o.start ?? 0,\r\n end: o.end ?? 1,\r\n angle: o.angle ?? 90,\r\n center: o.center ?? CENTER,\r\n samples: o.samples ?? 20,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append a kaleidoscope fold. Animating `angle` sweeps fresh source material\r\n * through the sampled wedge while the pattern itself stays locked — which is\r\n * not what rotating the node does.\r\n */\r\n kaleidoscope(options?: number | KaleidoscopeOptions) {\r\n const o = scalarOptions(options, \"segments\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"kaleidoscope\" as const,\r\n segments: Math.round(o.segments ?? 6),\r\n angle: o.angle ?? 0,\r\n center: o.center ?? CENTER,\r\n offset: o.offset ?? 0,\r\n amount: o.amount ?? 1,\r\n },\r\n o,\r\n ));\r\n }\r\n\r\n /**\r\n * Append Figma's Glass — the backdrop refracted, dispersed and frosted\r\n * through a curved edge on the node's outline, with a rim of light.\r\n *\r\n * Like `magnify`, this reads what is painted *beneath* the node and is\r\n * clipped to its outline, so the shape's own edges stay sharp. It needs no\r\n * map: the curve is derived from the outline itself, so it follows a\r\n * rounded rect, an ellipse, a hand-drawn path or text equally.\r\n *\r\n * Defaults to `{ mode: 'backdrop' }`; pass `mode` explicitly to override.\r\n */\r\n glass(options?: number | GlassOptions) {\r\n const o = scalarOptions(options, \"refraction\");\r\n return this.append(withEffectOptions(\r\n {\r\n type: \"glass\" as const,\r\n lightAngle: o.lightAngle ?? -45,\r\n lightIntensity: o.lightIntensity ?? 80,\r\n refraction: o.refraction ?? 80,\r\n depth: o.depth ?? 20,\r\n dispersion: o.dispersion ?? 50,\r\n frost: o.frost ?? 4,\r\n splay: o.splay ?? 0,\r\n },\r\n { ...o, mode: o.mode ?? \"backdrop\" },\r\n ));\r\n }\r\n\r\n /** Allows spreading the chain into an array: `[...Effects.blur(5)]`. */\r\n *[Symbol.iterator]() {\r\n yield* this.list;\r\n }\r\n\r\n /** Serializes to the raw effect array so frameworks that call `toJSON` get a plain value. */\r\n toJSON() {\r\n return this.list;\r\n }\r\n}\r\n\r\n/**\r\n * Accepted shapes for a node's `effects` prop.\r\n *\r\n * Mirrors {@link Fill}: a single {@link NodeEffect}, an `EffectChain` builder\r\n * result, or an array mixing effects and chains (each chain contributes all its\r\n * effects in place). Already-resolved effects are themselves `NodeEffect`s, so\r\n * a node's read-back `effects` can be assigned straight back.\r\n *\r\n * Effects.blur(8) // chain\r\n * { type: 'blur', radius: 8 } // single effect\r\n * [Effects.blur(8), { type: 'invert' }] // mixed array\r\n * [...Effects.blur(8), grayscaleEffect]\r\n */\r\nexport type Effect =\r\n | NodeEffect\r\n | EffectChain\r\n | (NodeEffect | EffectChain)[];\r\n\r\n/**\r\n * Entry point for building effect chains fluently.\r\n *\r\n * An empty {@link EffectChain}, so `Effects.blur(8)` *is* `new EffectChain().blur(8)`\r\n * — every builder's signature and documentation has exactly one definition, on\r\n * the class, which is also what an editor shows when you hover `Effects.blur`.\r\n * (A parallel object of arrow functions would need its own copy of all 41 docs,\r\n * and hovering it showed none of them.)\r\n *\r\n * The chain is immutable — every builder returns a *new* chain — so sharing one\r\n * empty instance as the entry point is safe.\r\n *\r\n * @example\r\n * node.effects = Effects.blur(8).grayscale(1);\r\n */\r\nexport const Effects = new EffectChain();\r\n\r\n/**\r\n * Normalises any {@link Effect} value to a plain `NodeEffect[]`.\r\n * Used internally when reading props before rendering or interpolation.\r\n *\r\n * Chains used as array elements are flattened so each contributes its effects\r\n * in place: `[Effects.blur(8), grayscaleEffect]` — as is the plain array a chain\r\n * serializes to, which is how that value reads back out of a stored document.\r\n */\r\nexport function resolveChainEffects(effects: Effect | undefined): NodeEffect[] {\r\n if (effects === undefined) return [];\r\n if (effects instanceof EffectChain) return resolveAll(effects.list);\r\n if (Array.isArray(effects)) {\r\n const out: NodeEffect[] = [];\r\n for (const item of effects) {\r\n if (item instanceof EffectChain) out.push(...resolveAll(item.list));\r\n else if (Array.isArray(item)) out.push(...resolveChainEffects(item as Effect));\r\n else out.push(resolveEffect(item));\r\n }\r\n return out;\r\n }\r\n return [resolveEffect(effects)];\r\n}\r\n\r\n/**\r\n * Resolve every effect in `list`, returning **the same array** when none of them\r\n * needed it — which is the overwhelming majority, since one effect type\r\n * registers a `resolve` at all.\r\n *\r\n * The identity is load-bearing, not a micro-optimisation: this runs on every\r\n * write of an `effects` prop, and `lerpEffectArray` short-circuits on\r\n * `from === to`. Copying unconditionally would defeat that for every node in\r\n * every scene to migrate one effect type.\r\n */\r\nfunction resolveAll(list: NodeEffect[]): NodeEffect[] {\r\n let out: NodeEffect[] | undefined;\r\n for (let i = 0; i < list.length; i++) {\r\n const resolved = resolveEffect(list[i]);\r\n if (!out && resolved !== list[i]) out = list.slice(0, i);\r\n out?.push(resolved);\r\n }\r\n return out ?? list;\r\n}\r\n\r\n/** The effect-chain attribute's op set — the `effects` prop's resolve/lerp pair. */\r\nexport const effectsOps: AttributeOps<Effect, NodeEffect[]> = {\r\n resolve: (effects) => resolveChainEffects(effects),\r\n lerp: (from, to, t) => {\r\n if (from === to) return from;\r\n const maxLen = Math.max(from.length, to.length);\r\n const result: NodeEffect[] = [];\r\n for (let i = 0; i < maxLen; i++) {\r\n const a = from[i];\r\n const b = to[i];\r\n if (a && b) {\r\n result.push(lerpEffect(a, b, t));\r\n } else if (a) {\r\n result.push(a);\r\n } else if (b) {\r\n result.push(b);\r\n }\r\n }\r\n return result;\r\n },\r\n};\r\n"]}
1
+ {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/chain.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,WAAW,EAAwB,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAA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,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACrC,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import { NodeEffect } from \"./union\";\r\nimport type { BlendMode } from \"../fill/blend\";\r\nimport type { EffectOptions } from \"./effect-data\";\r\nimport { scalarOptions, withEffectOptions } from \"./effect-data\";\r\nimport { resolveEffect, lerpEffect } from \"./registry\";\r\nimport { buildEffect, type EffectOptionsOf } from \"./spec\";\r\nimport { blurSpec } from \"./implementations/blur\";\r\nimport { directionalBlurSpec } from \"./implementations/directional-blur\";\r\nimport { grayscaleSpec } from \"./implementations/grayscale\";\r\nimport { pixelateSpec } from \"./implementations/pixelate\";\r\nimport { bulgeSpec } from \"./implementations/bulge\";\r\nimport { magnifySpec } from \"./implementations/magnify\";\r\nimport { bloomSpec } from \"./implementations/bloom\";\r\nimport { vintageSpec } from \"./implementations/vintage\";\r\nimport { chromaticAberrationSpec } from \"./implementations/chromatic-aberration\";\r\nimport { invertSpec } from \"./implementations/invert\";\r\nimport { scatterSpec } from \"./implementations/scatter\";\r\nimport { posterizeSpec } from \"./implementations/posterize\";\r\nimport { motionBlurSpec } from \"./implementations/motion-blur\";\r\nimport { outlineSpec } from \"./implementations/outline\";\r\nimport { dropShadowSpec } from \"./implementations/drop-shadow\";\r\nimport { vignetteSpec } from \"./implementations/vignette\";\r\nimport { lutSpec } from \"./implementations/lut\";\r\nimport { grainSpec } from \"./implementations/grain\";\r\nimport { sharpenSpec } from \"./implementations/sharpen\";\r\nimport { edgesSpec } from \"./implementations/edges\";\r\nimport { thresholdSpec } from \"./implementations/threshold\";\r\nimport { radialBlurSpec } from \"./implementations/radial-blur\";\r\nimport { halftoneSpec } from \"./implementations/halftone\";\r\nimport { ditherSpec } from \"./implementations/dither\";\r\nimport { duotoneSpec } from \"./implementations/duotone\";\r\nimport { curvesSpec } from \"./implementations/curves\";\r\nimport { rgbShiftSpec } from \"./implementations/rgb-shift\";\r\nimport { scanlinesSpec } from \"./implementations/scanlines\";\r\nimport { blockDisplaceSpec } from \"./implementations/block-displace\";\r\nimport { bitCrushSpec } from \"./implementations/bit-crush\";\r\nimport { asciiSpec } from \"./implementations/ascii\";\r\nimport { oilPaintSpec } from \"./implementations/oil-paint\";\r\nimport { streakSpec } from \"./implementations/streak\";\r\nimport { glowSpec } from \"./implementations/glow\";\r\nimport { waveSpec } from \"./implementations/wave\";\r\nimport { twirlSpec } from \"./implementations/twirl\";\r\nimport { progressiveBlurSpec } from \"./implementations/progressive-blur\";\r\nimport { kaleidoscopeSpec } from \"./implementations/kaleidoscope\";\r\nimport { glassSpec } from \"./implementations/glass\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\nimport { normalizeUniforms, type ShaderUniform, type ShaderUniformRecord } from \"../shaders/uniforms\";\r\nimport { resolveShaderProperties, type ShaderPropertyValues } from \"../shaders/resolve\";\r\nimport type { EffectShader } from \"../shaders/pack\";\r\nimport type { ColorAdjustmentEffect } from \"./implementations/color-adjustment\";\r\n\r\n/**\r\n * Every effect builder takes **exactly one argument**: an options object\r\n * carrying all of that effect's data. Builders with one dominant animated\r\n * scalar also accept that scalar directly, so the common case stays terse:\r\n *\r\n * Effects.blur(8)\r\n * Effects.blur({ radius: 8, mode: 'backdrop' })\r\n *\r\n * Field names are shared vocabulary across every effect — `radius` is always a\r\n * pixel distance, `amount` always a 0–1 intensity, `angle` always degrees,\r\n * `center` always a 0–1 normalised point, `axis` always an {@link EffectAxis}.\r\n */\r\n\r\n/** Gaussian blur. Scalar shorthand sets `radius`. */\r\nexport type BlurOptions = EffectOptionsOf<typeof blurSpec.params>;\r\n\r\n/** Directional (linear) blur. Scalar shorthand sets `radius`. */\r\nexport type DirectionalBlurOptions = EffectOptionsOf<typeof directionalBlurSpec.params>;\r\n\r\n/** Desaturation. Scalar shorthand sets `amount`. */\r\nexport type GrayscaleOptions = EffectOptionsOf<typeof grayscaleSpec.params>;\r\n\r\n/**\r\n * After Effects-style Mosaic. Scalar shorthand sets `blocks` on both axes.\r\n *\r\n * `blocks` is the *number of blocks* across the node, so a count equal to the\r\n * node's pixel size on that axis is pristine and lower counts are coarser.\r\n */\r\nexport type PixelateOptions = EffectOptionsOf<typeof pixelateSpec.params>;\r\n\r\n/** Bulge / pinch lens over the node's content, or the backdrop. Scalar shorthand sets `strength`. */\r\nexport type BulgeOptions = EffectOptionsOf<typeof bulgeSpec.params>;\r\n\r\n/** Magnifier lens over the backdrop. Scalar shorthand sets `scale`. */\r\nexport type MagnifyOptions = EffectOptionsOf<typeof magnifySpec.params>;\r\n\r\n/** Bloom (glow). Scalar shorthand sets `intensity`. */\r\nexport type BloomOptions = EffectOptionsOf<typeof bloomSpec.params>;\r\n\r\n/** Vintage / film-look colour grading. Scalar shorthand sets `amount`. */\r\nexport type VintageOptions = EffectOptionsOf<typeof vintageSpec.params>;\r\n\r\n/** Lens-dispersion colour fringing. Scalar shorthand sets `amount`. */\r\nexport type ChromaticAberrationOptions = EffectOptionsOf<typeof chromaticAberrationSpec.params>;\r\n\r\n/** Colour invert. Scalar shorthand sets `strength`. */\r\nexport type InvertOptions = EffectOptionsOf<typeof invertSpec.params>;\r\n\r\n/** Per-pixel random jitter. Scalar shorthand sets `strength`. */\r\nexport type ScatterOptions = EffectOptionsOf<typeof scatterSpec.params>;\r\n\r\n/** Colour banding. Scalar shorthand sets `levels`. */\r\nexport type PosterizeOptions = EffectOptionsOf<typeof posterizeSpec.params>;\r\n\r\n/** Velocity-driven motion blur. Scalar shorthand sets `length`. */\r\nexport type MotionBlurOptions = EffectOptionsOf<typeof motionBlurSpec.params>;\r\n\r\n/**\r\n * A custom shader. `mode` selects the path:\r\n *\r\n * - `'foreground'` (the default) — `sample_src` reads the node's layer; the output\r\n * replaces it, or composites onto it with `blendMode`.\r\n * - `'backdrop'` — `sample_src` reads a snapshot of what is painted beneath the\r\n * node. `blendMode` is unused.\r\n */\r\nexport interface ShaderEffectOptions extends EffectOptions {\r\n /**\r\n * The WGSL program, or a registered\r\n * **shader pack** — a program plus the editable values it publishes.\r\n *\r\n * A pack resolves to plain uniforms here, so nothing below this builder\r\n * knows one exists; what survives into the document is the resolved record\r\n * plus a `shaderId` naming the pack, which is what lets a host reopen its\r\n * property panel from a saved scene.\r\n */\r\n source: string | EffectShader;\r\n /**\r\n * Property overrides, by property id, when {@link source} is a pack.\r\n *\r\n * Anything not named here takes the pack's own default. Ignored — with a\r\n * warning — for a bare source string, which has no properties to override.\r\n */\r\n values?: ShaderPropertyValues;\r\n /**\r\n * Uniform values by name — lerped between animation frames (default `{}`).\r\n *\r\n * The positional `[{ name, value }]` array still works; both are bound by\r\n * name now, so the array's order no longer means anything.\r\n */\r\n uniforms?: ShaderUniformRecord | ShaderUniform[];\r\n /** How a foreground shader composites onto the layer; its output replaces the layer when absent. */\r\n blendMode?: BlendMode;\r\n /** How far past the node's box (logical px) a WGSL effect may draw. Default 0. */\r\n reach?: number;\r\n}\r\n\r\n/** Coloured band around the node's silhouette. Scalar shorthand sets `width`. */\r\nexport type OutlineOptions = EffectOptionsOf<typeof outlineSpec.params>;\r\n\r\n/**\r\n * A shadow cast from the node's silhouette. Scalar shorthand sets `blur`, since\r\n * softness is the knob a shadow is usually reached for by.\r\n */\r\nexport type DropShadowOptions = EffectOptionsOf<typeof dropShadowSpec.params>;\r\n\r\n/** Darkened edges / lens falloff. Scalar shorthand sets `amount`. */\r\nexport type VignetteOptions = EffectOptionsOf<typeof vignetteSpec.params>;\r\n\r\n/** Film grain. Scalar shorthand sets `amount`. */\r\n/**\r\n * A 3D colour lookup table — see {@link LutEffect} for the table's layout and\r\n * why it is compared by reference.\r\n *\r\n * No scalar shorthand: the dominant argument is a whole cube, and a builder that\r\n * took `Effects.lut(table)` would still need the size beside it to read it.\r\n */\r\nexport type LutOptions = EffectOptionsOf<typeof lutSpec.params>;\r\n\r\nexport type GrainOptions = EffectOptionsOf<typeof grainSpec.params>;\r\n\r\n/** Unsharp-mask sharpen. Scalar shorthand sets `amount`. */\r\nexport type SharpenOptions = EffectOptionsOf<typeof sharpenSpec.params>;\r\n\r\n/** Edge detection. Scalar shorthand sets `strength`. */\r\nexport type EdgesOptions = EffectOptionsOf<typeof edgesSpec.params>;\r\n\r\n/** Two-tone luminance cut. Scalar shorthand sets `level`. */\r\nexport type ThresholdOptions = EffectOptionsOf<typeof thresholdSpec.params>;\r\n\r\n/** Zoom / spin blur about a point. Scalar shorthand sets `amount`. */\r\nexport type RadialBlurOptions = EffectOptionsOf<typeof radialBlurSpec.params>;\r\n\r\n/** Halftone print screen. Scalar shorthand sets `size`. */\r\nexport type HalftoneOptions = EffectOptionsOf<typeof halftoneSpec.params>;\r\n\r\n/** Ordered (Bayer) dithering. Scalar shorthand sets `levels`. */\r\nexport type DitherOptions = EffectOptionsOf<typeof ditherSpec.params>;\r\n\r\n/** Two-colour luminance ramp. Scalar shorthand sets `amount`. */\r\nexport type DuotoneOptions = EffectOptionsOf<typeof duotoneSpec.params>;\r\n\r\n/** Tone curve through control points. */\r\nexport type CurvesOptions = EffectOptionsOf<typeof curvesSpec.params>;\r\n\r\n/** Photographic grading. Every field is optional and defaults to neutral. */\r\nexport type ColorAdjustmentOptions = Omit<ColorAdjustmentEffect, 'type'> & EffectOptions;\r\n\r\n/**\r\n * Per-channel RGB offset. Scalar shorthand sets `amount`, which spreads red and\r\n * blue apart horizontally by that many pixels and leaves green put — the\r\n * everyday case. Name `red`/`green`/`blue` for full control.\r\n */\r\nexport type RgbShiftOptions = EffectOptionsOf<typeof rgbShiftSpec.params> & {\r\n /** Shorthand: ±px horizontal spread of red vs. blue (default 4); `red`/`blue` override it. */\r\n amount?: number;\r\n};\r\n\r\n/** CRT scanlines. Scalar shorthand sets `darkness`. */\r\nexport type ScanlinesOptions = EffectOptionsOf<typeof scanlinesSpec.params>;\r\n\r\n/** Datamosh-style band tearing. Scalar shorthand sets `amount`. */\r\nexport type BlockDisplaceOptions = EffectOptionsOf<typeof blockDisplaceSpec.params>;\r\n\r\n/** ASCII art from a glyph grid. Scalar shorthand sets `size`. */\r\nexport type AsciiOptions = EffectOptionsOf<typeof asciiSpec.params>;\r\n\r\n/** Anamorphic glare — a bright pass smeared along one axis. Scalar shorthand sets `intensity`. */\r\nexport type StreakOptions = EffectOptionsOf<typeof streakSpec.params>;\r\n\r\n/**\r\n * A glow — bright (or opaque) areas spread outward and composited back, with\r\n * optional recolouring. Scalar shorthand sets `intensity`.\r\n *\r\n * Unlike `bloom`, this spreads past the node's own box, chooses how the source\r\n * composites against it, and can be coloured through a ramp.\r\n */\r\nexport type GlowOptions = EffectOptionsOf<typeof glowSpec.params>;\r\n\r\n/** Kuwahara brushwork. Scalar shorthand sets `radius`. */\r\nexport type OilPaintOptions = EffectOptionsOf<typeof oilPaintSpec.params>;\r\n\r\n/** Sine warp. Scalar shorthand sets `amplitude` on the Y axis — the everyday ripple. */\r\nexport type WaveOptions = EffectOptionsOf<typeof waveSpec.params>;\r\n\r\n/** Twirl / swirl vortex. Scalar shorthand sets `angle`. */\r\nexport type TwirlOptions = EffectOptionsOf<typeof twirlSpec.params>;\r\n\r\n/**\r\n * Blur that ramps across the node. Scalar shorthand sets `radius`.\r\n *\r\n * `mode: 'backdrop'` gives the frosted panel whose blur fades out rather than\r\n * ending at a hard edge.\r\n */\r\nexport type ProgressiveBlurOptions = EffectOptionsOf<typeof progressiveBlurSpec.params>;\r\n\r\n/** Mirrored wedges around a point. Scalar shorthand sets `segments`. */\r\nexport type KaleidoscopeOptions = EffectOptionsOf<typeof kaleidoscopeSpec.params>;\r\n\r\n/**\r\n * Figma's Glass over the backdrop. Scalar shorthand sets `refraction`.\r\n *\r\n * Figma's fields, units and defaults (light `-45°` at 80, refraction 80, depth\r\n * 20 px, dispersion 50, frost 4, splay 0), so a bare `Effects.glass()` is the\r\n * glass Figma adds and values copied from a Figma file render the same.\r\n *\r\n * Defaults to `{ mode: 'backdrop' }`; there is nothing to refract in a node's\r\n * own paint, so the foreground is a no-op.\r\n */\r\nexport type GlassOptions = EffectOptionsOf<typeof glassSpec.params>;\r\n\r\n/** Colour-depth reduction. Scalar shorthand sets `bits`. */\r\nexport type BitCrushOptions = EffectOptionsOf<typeof bitCrushSpec.params>;\r\n\r\n/**\r\n * Immutable, chainable list of node effects.\r\n *\r\n * Each builder method returns a new `EffectChain` with the effect appended,\r\n * so chains are safe to share and branch.\r\n *\r\n * @example\r\n * const fx = Effects.blur(4).grayscale(0.5);\r\n * node.effects = fx; // assign directly\r\n * node.effects = [...fx, { type: 'pixelate', ... }]; // spread into array\r\n */\r\nexport class EffectChain {\r\n constructor(public list: NodeEffect[] = []) { }\r\n\r\n private append(effect: NodeEffect): EffectChain {\r\n return new EffectChain([...this.list, effect]);\r\n }\r\n\r\n /**\r\n * Append a Gaussian blur. Pass `{ mode: \"backdrop\" }` to blur the content\r\n * beneath the node (clipped to its silhouette, Figma-style) instead of the\r\n * node's own content.\r\n */\r\n blur(options: number | BlurOptions) {\r\n return this.append(buildEffect(blurSpec, options));\r\n }\r\n\r\n /**\r\n * Append a motion-blur-style directional (linear) blur, smearing the node's\r\n * own content along a single axis (or the backdrop, with `{ mode: \"backdrop\" }`).\r\n */\r\n directionalBlur(options: number | DirectionalBlurOptions) {\r\n return this.append(buildEffect(directionalBlurSpec, options));\r\n }\r\n\r\n /**\r\n * Append an After Effects-style Mosaic / pixelate. `blocks` is the *number of\r\n * blocks* across the node (a count equal to the node's pixel size on that\r\n * axis is pristine; lower is coarser), not a pixel block size.\r\n */\r\n pixelate(options: number | PixelateOptions) {\r\n return this.append(buildEffect(pixelateSpec, options));\r\n }\r\n\r\n /** Append a grayscale effect. `{ mode: \"backdrop\" }` desaturates the backdrop. */\r\n grayscale(options: number | GrayscaleOptions) {\r\n return this.append(buildEffect(grayscaleSpec, options));\r\n }\r\n\r\n /**\r\n * Append a bulge/pinch lens. A barrel distortion magnifies the centre and\r\n * pins the edges; a negative strength pinches the centre inward instead.\r\n * `mode: \"backdrop\"` points the same lens at what is painted beneath the\r\n * node, giving a glass dome over the layers below rather than a warp of the\r\n * node's own paint.\r\n */\r\n bulge(options: number | BulgeOptions) {\r\n return this.append(buildEffect(bulgeSpec, options));\r\n }\r\n\r\n /**\r\n * Append a magnify lens that magnifies the backdrop beneath the node. The lens\r\n * fills the node's bounding box and is clipped to its silhouette, so whatever\r\n * is painted underneath shows through scaled about `center` — like a\r\n * magnifying glass shaped to the node.\r\n *\r\n * Defaults to `{ mode: 'backdrop' }`; pass `mode` explicitly to override.\r\n */\r\n magnify(options?: number | MagnifyOptions) {\r\n return this.append(buildEffect(magnifySpec, options));\r\n }\r\n\r\n /**\r\n * Append a bloom (glow) effect. Bright areas bleed soft light outward via a\r\n * screen-blend of the blurred bright-pass onto the layer.\r\n */\r\n bloom(options?: number | BloomOptions) {\r\n return this.append(buildEffect(bloomSpec, options));\r\n }\r\n\r\n /** Append a vintage / film-look colour grading effect. */\r\n vintage(options?: number | VintageOptions) {\r\n return this.append(buildEffect(vintageSpec, options));\r\n }\r\n\r\n /**\r\n * Append a chromatic aberration effect — red/blue colour fringing that mimics\r\n * lens dispersion.\r\n */\r\n chromaticAberration(options?: number | ChromaticAberrationOptions) {\r\n return this.append(buildEffect(chromaticAberrationSpec, options));\r\n }\r\n\r\n /** Append a colour-invert effect. */\r\n invert(options?: number | InvertOptions) {\r\n return this.append(buildEffect(invertSpec, options));\r\n }\r\n\r\n /**\r\n * Append a scatter effect — randomly jitters the node's own pixels, smearing\r\n * its content like After Effects' Scatter.\r\n */\r\n scatter(options?: number | ScatterOptions) {\r\n return this.append(buildEffect(scatterSpec, options));\r\n }\r\n\r\n /**\r\n * Append an After Effects-style posterize effect — quantizes each colour\r\n * channel into `levels` evenly-spaced bands, flattening gradients into steps.\r\n */\r\n posterize(options?: number | PosterizeOptions) {\r\n return this.append(buildEffect(posterizeSpec, options));\r\n }\r\n\r\n /**\r\n * Append velocity-driven motion blur — smears the node's own content along its\r\n * actual per-frame motion (a static node stays sharp). Modelled on After\r\n * Effects' shutter angle (`length`) and shutter phase (`alignment`).\r\n */\r\n motionBlur(options?: number | MotionBlurOptions) {\r\n return this.append(buildEffect(motionBlurSpec, options));\r\n }\r\n\r\n /**\r\n * Append an outline — a coloured band traced around the node's silhouette,\r\n * including alpha silhouettes (text, an image's cutout, a whole subtree) that\r\n * a geometry `stroke` can't follow.\r\n */\r\n outline(options?: number | OutlineOptions) {\r\n return this.append(buildEffect(outlineSpec, options));\r\n }\r\n\r\n /**\r\n * Append a drop shadow cast from the node's **silhouette** — including alpha\r\n * silhouettes (text, an image's cutout, a whole subtree) that a geometry\r\n * `shadow` can't follow, since that one fills the node's path.\r\n */\r\n dropShadow(options?: number | DropShadowOptions) {\r\n return this.append(buildEffect(dropShadowSpec, options));\r\n }\r\n\r\n /**\r\n * Append a vignette — a soft tint ramping in toward the node's corners. The\r\n * falloff follows the node's aspect ratio, so a wide node darkens along its\r\n * short edges the way a lens would.\r\n */\r\n vignette(options?: number | VignetteOptions) {\r\n return this.append(buildEffect(vignetteSpec, options));\r\n }\r\n\r\n /**\r\n * Append film grain. Static grain reads as texture rather than film, so pass\r\n * `{ animated: true }` to re-seed it each frame — or tween `seed` when the\r\n * render has to stay deterministic.\r\n */\r\n /**\r\n * Apply a 3D colour lookup table.\r\n *\r\n * The whole point of a LUT is that it is *someone else's* colour science, so\r\n * there is nothing to default beyond how much of it to use: `amount` is the\r\n * mix and everything else is the file.\r\n *\r\n * @example\r\n * Effects.lut({ table, size: 33 }) // the full look\r\n * Effects.lut({ table, size: 33, amount: 0.6 })\r\n */\r\n lut(options: LutOptions) {\r\n return this.append(buildEffect(lutSpec, options));\r\n }\r\n\r\n grain(options?: number | GrainOptions) {\r\n return this.append(buildEffect(grainSpec, options));\r\n }\r\n\r\n /** Append an unsharp-mask sharpen — local contrast boosted at `radius` scale. */\r\n sharpen(options?: number | SharpenOptions) {\r\n return this.append(buildEffect(sharpenSpec, options));\r\n }\r\n\r\n /**\r\n * Append edge detection — flat areas go black and boundaries light up with\r\n * the magnitude of the local gradient.\r\n */\r\n edges(options?: number | EdgesOptions) {\r\n return this.append(buildEffect(edgesSpec, options));\r\n }\r\n\r\n /**\r\n * Append a luminance threshold — a two-tone stencil cut at `level`, with\r\n * `smoothness` widening the cut into a ramp.\r\n */\r\n threshold(options?: number | ThresholdOptions) {\r\n return this.append(buildEffect(thresholdSpec, options));\r\n }\r\n\r\n /**\r\n * Append a radial blur — samples smeared along the radius (`'zoom'`, the\r\n * default) or the tangent (`'spin'`) about `center`, leaving the centre sharp.\r\n */\r\n radialBlur(options?: number | RadialBlurOptions) {\r\n return this.append(buildEffect(radialBlurSpec, options));\r\n }\r\n\r\n /**\r\n * Append a halftone screen — the newsprint look, where tone becomes the size\r\n * of a mark on a rotated grid.\r\n */\r\n halftone(options?: number | HalftoneOptions) {\r\n return this.append(buildEffect(halftoneSpec, options));\r\n }\r\n\r\n /**\r\n * Append ordered (Bayer) dithering — quantization to `levels` tones per\r\n * channel with the error traded for a retro crosshatch pattern.\r\n */\r\n dither(options?: number | DitherOptions) {\r\n return this.append(buildEffect(ditherSpec, options));\r\n }\r\n\r\n /**\r\n * Append a duotone / gradient map — the content's luminance remapped onto a\r\n * `shadows` → `highlights` ramp, discarding its original chroma.\r\n */\r\n duotone(options?: number | DuotoneOptions) {\r\n return this.append(buildEffect(duotoneSpec, options));\r\n }\r\n\r\n /**\r\n * Append a tone curve — the same adjustment `Adjustments.curves` applies to a\r\n * photo, on any node.\r\n */\r\n curves(options: CurvesOptions) {\r\n return this.append(buildEffect(curvesSpec, options));\r\n }\r\n\r\n /**\r\n * Append photographic grading (brightness / contrast / saturation / vibrance /\r\n * shadows / highlights / temperature / tint) — `Adjustments.colorAdjustment`\r\n * on any node. For darkened edges use {@link EffectChain.vignette}.\r\n */\r\n colorAdjustment(options: ColorAdjustmentOptions) {\r\n // Destructure `mode` out rather than spreading it through: a caller who\r\n // writes `{ mode: undefined }` would otherwise plant the key on the\r\n // effect, and `equals()` compares `mode` directly. `withEffectOptions`\r\n // skips undefined, so handing it back there is safe.\r\n const { mode, ...fields } = options;\r\n return this.append(withEffectOptions({ type: \"colorAdjustment\" as const, ...fields }, { mode }));\r\n }\r\n\r\n /**\r\n * Append a per-channel RGB offset — the digital cousin of\r\n * {@link EffectChain.chromaticAberration}, where each plane goes where you\r\n * point it instead of following a lens model.\r\n */\r\n rgbShift(options?: number | RgbShiftOptions) {\r\n const o = scalarOptions(options, \"amount\");\r\n const spread = o.amount;\r\n return this.append(buildEffect(rgbShiftSpec, spread === undefined ? o : {\r\n ...o,\r\n red: o.red ?? { x: spread, y: 0 },\r\n blue: o.blue ?? { x: -spread, y: 0 },\r\n }));\r\n }\r\n\r\n /**\r\n * Append CRT scanlines. Animate `offset` past `spacing` to roll the bands;\r\n * the pattern wraps, so a linear tween loops seamlessly.\r\n */\r\n scanlines(options?: number | ScanlinesOptions) {\r\n return this.append(buildEffect(scanlinesSpec, options));\r\n }\r\n\r\n /**\r\n * Append datamosh-style band tearing. Step `seed` in whole numbers to jump\r\n * between distinct glitch states rather than sliding between them.\r\n */\r\n blockDisplace(options?: number | BlockDisplaceOptions) {\r\n return this.append(buildEffect(blockDisplaceSpec, options));\r\n }\r\n\r\n /**\r\n * Append colour-depth reduction — `bits` per channel, or a fixed hardware\r\n * palette. Pair with {@link EffectChain.dither} so gradients survive the cut.\r\n */\r\n bitCrush(options?: number | BitCrushOptions) {\r\n return this.append(buildEffect(bitCrushSpec, options));\r\n }\r\n\r\n /**\r\n * Append ASCII art — the content divided into a grid of cells, each cell's\r\n * tone replaced by the glyph that carries a matching amount of ink.\r\n *\r\n * Set `background: 'transparent'` to lay the glyphs over whatever is behind\r\n * the node instead of over a solid field.\r\n */\r\n ascii(options?: number | AsciiOptions) {\r\n return this.append(buildEffect(asciiSpec, options));\r\n }\r\n\r\n /**\r\n * Append Kuwahara brushwork — averages within a region but never across an\r\n * edge, so flat areas smooth into strokes while boundaries stay crisp.\r\n * By some margin the most expensive effect in the set; keep `radius` small.\r\n */\r\n oilPaint(options?: number | OilPaintOptions) {\r\n return this.append(buildEffect(oilPaintSpec, options));\r\n }\r\n\r\n /**\r\n * Append an anamorphic streak — a bright pass smeared along one axis and\r\n * screened back on. {@link EffectChain.bloom} spreads light in every\r\n * direction; this spreads it in one.\r\n */\r\n streak(options?: number | StreakOptions) {\r\n return this.append(buildEffect(streakSpec, options));\r\n }\r\n\r\n /**\r\n * Append a glow — the bright (or opaque) parts of the layer spread outward\r\n * and composited back, optionally recoloured through a ramp.\r\n *\r\n * `bloom` is the cheaper relative: it screens a blurred bright-pass back\r\n * within the node's own box. This one spreads past that box, lets the source\r\n * sit behind, in front of, or nowhere at all, and can map glow strength onto\r\n * `colors`/`stops` — which is what a heat, neon or aurora look needs.\r\n */\r\n glow(options?: number | GlowOptions) {\r\n return this.append(buildEffect(glowSpec, options));\r\n }\r\n\r\n /**\r\n * Append a custom WGSL shader. `mode` picks the layer it runs on, which\r\n * `sample_src` reads: the node's own layer, or what is painted beneath it\r\n * (`'backdrop'`).\r\n */\r\n shader(options: ShaderEffectOptions) {\r\n const pack = typeof options.source === \"string\" ? undefined : options.source;\r\n if (pack && pack.scope !== \"effect\") {\r\n throw new Error(\r\n `Effects.shader was given a \"${(pack as { scope: string }).scope}\" shader ` +\r\n `(\"${pack.name}\"). A fill shader has no backdrop to sample and is bound to a ` +\r\n `shape's box; use Fills.shader.`,\r\n );\r\n }\r\n // A backdrop pack supplies the default; a caller may still say otherwise.\r\n const mode = options.mode ?? (pack?.backdrop ? \"backdrop\" : \"foreground\");\r\n const source = pack ? pack.source : (options.source as string);\r\n const uniforms = pack\r\n ? { ...resolveShaderProperties(pack, options.values), ...normalizeUniforms(options.uniforms ?? {}) }\r\n : (options.uniforms ?? {});\r\n const base = {\r\n type: \"shader\" as const,\r\n source,\r\n language: \"wgsl\" as const,\r\n ...(options.reach ? { reach: options.reach } : {}),\r\n uniforms,\r\n ...(pack?.id !== undefined ? { shaderId: pack.id } : {}),\r\n };\r\n // blendMode only applies to the foreground overlay; leaving it undefined\r\n // for a backdrop shader keeps `equals()` comparing like with like.\r\n const effect: NodeEffect = mode === \"foreground\" && options.blendMode\r\n ? { ...base, blendMode: options.blendMode }\r\n : base;\r\n return this.append(withEffectOptions(effect, { mode }));\r\n }\r\n\r\n /**\r\n * Append a sine warp. Tween `phase` over 360 to make the wave travel — it\r\n * wraps, so a linear tween loops seamlessly.\r\n */\r\n wave(options?: number | WaveOptions) {\r\n return this.append(buildEffect(waveSpec, options));\r\n }\r\n\r\n /**\r\n * Append a twirl / swirl vortex — a rotation about `center` that falls off\r\n * with distance, so the middle spins while the rim stays pinned.\r\n */\r\n twirl(options?: number | TwirlOptions) {\r\n return this.append(buildEffect(twirlSpec, options));\r\n }\r\n\r\n /**\r\n * Append a blur whose radius ramps across the node rather than being\r\n * uniform. With `{ mode: 'backdrop' }` this is the frosted panel whose blur\r\n * fades out instead of ending at a hard edge.\r\n */\r\n progressiveBlur(options?: number | ProgressiveBlurOptions) {\r\n return this.append(buildEffect(progressiveBlurSpec, options));\r\n }\r\n\r\n /**\r\n * Append a kaleidoscope fold. Animating `angle` sweeps fresh source material\r\n * through the sampled wedge while the pattern itself stays locked — which is\r\n * not what rotating the node does.\r\n */\r\n kaleidoscope(options?: number | KaleidoscopeOptions) {\r\n return this.append(buildEffect(kaleidoscopeSpec, options));\r\n }\r\n\r\n /**\r\n * Append Figma's Glass — the backdrop refracted, dispersed and frosted\r\n * through a curved edge on the node's outline, with a rim of light.\r\n *\r\n * Like `magnify`, this reads what is painted *beneath* the node and is\r\n * clipped to its outline, so the shape's own edges stay sharp. It needs no\r\n * map: the curve is derived from the outline itself, so it follows a\r\n * rounded rect, an ellipse, a hand-drawn path or text equally.\r\n *\r\n * Defaults to `{ mode: 'backdrop' }`; pass `mode` explicitly to override.\r\n */\r\n glass(options?: number | GlassOptions) {\r\n return this.append(buildEffect(glassSpec, options));\r\n }\r\n\r\n /** Allows spreading the chain into an array: `[...Effects.blur(5)]`. */\r\n *[Symbol.iterator]() {\r\n yield* this.list;\r\n }\r\n\r\n /** Serializes to the raw effect array so frameworks that call `toJSON` get a plain value. */\r\n toJSON() {\r\n return this.list;\r\n }\r\n}\r\n\r\n/**\r\n * Accepted shapes for a node's `effects` prop.\r\n *\r\n * Mirrors {@link Fill}: a single {@link NodeEffect}, an `EffectChain` builder\r\n * result, or an array mixing effects and chains (each chain contributes all its\r\n * effects in place). Already-resolved effects are themselves `NodeEffect`s, so\r\n * a node's read-back `effects` can be assigned straight back.\r\n *\r\n * Effects.blur(8) // chain\r\n * { type: 'blur', radius: 8 } // single effect\r\n * [Effects.blur(8), { type: 'invert' }] // mixed array\r\n * [...Effects.blur(8), grayscaleEffect]\r\n */\r\nexport type Effect =\r\n | NodeEffect\r\n | EffectChain\r\n | (NodeEffect | EffectChain)[];\r\n\r\n/**\r\n * Entry point for building effect chains fluently.\r\n *\r\n * An empty {@link EffectChain}, so `Effects.blur(8)` *is* `new EffectChain().blur(8)`\r\n * — every builder's signature and documentation has exactly one definition, on\r\n * the class, which is also what an editor shows when you hover `Effects.blur`.\r\n * (A parallel object of arrow functions would need its own copy of all 41 docs,\r\n * and hovering it showed none of them.)\r\n *\r\n * The chain is immutable — every builder returns a *new* chain — so sharing one\r\n * empty instance as the entry point is safe.\r\n *\r\n * @example\r\n * node.effects = Effects.blur(8).grayscale(1);\r\n */\r\nexport const Effects = new EffectChain();\r\n\r\n/**\r\n * Normalises any {@link Effect} value to a plain `NodeEffect[]`.\r\n * Used internally when reading props before rendering or interpolation.\r\n *\r\n * Chains used as array elements are flattened so each contributes its effects\r\n * in place: `[Effects.blur(8), grayscaleEffect]` — as is the plain array a chain\r\n * serializes to, which is how that value reads back out of a stored document.\r\n */\r\nexport function resolveChainEffects(effects: Effect | undefined): NodeEffect[] {\r\n if (effects === undefined) return [];\r\n if (effects instanceof EffectChain) return resolveAll(effects.list);\r\n if (Array.isArray(effects)) {\r\n const out: NodeEffect[] = [];\r\n for (const item of effects) {\r\n if (item instanceof EffectChain) out.push(...resolveAll(item.list));\r\n else if (Array.isArray(item)) out.push(...resolveChainEffects(item as Effect));\r\n else out.push(resolveEffect(item));\r\n }\r\n return out;\r\n }\r\n return [resolveEffect(effects)];\r\n}\r\n\r\n/**\r\n * Resolve every effect in `list`, returning **the same array** when none of them\r\n * needed it — which is the overwhelming majority, since one effect type\r\n * registers a `resolve` at all.\r\n *\r\n * The identity is load-bearing, not a micro-optimisation: this runs on every\r\n * write of an `effects` prop, and `lerpEffectArray` short-circuits on\r\n * `from === to`. Copying unconditionally would defeat that for every node in\r\n * every scene to migrate one effect type.\r\n */\r\nfunction resolveAll(list: NodeEffect[]): NodeEffect[] {\r\n let out: NodeEffect[] | undefined;\r\n for (let i = 0; i < list.length; i++) {\r\n const resolved = resolveEffect(list[i]);\r\n if (!out && resolved !== list[i]) out = list.slice(0, i);\r\n out?.push(resolved);\r\n }\r\n return out ?? list;\r\n}\r\n\r\n/** The effect-chain attribute's op set — the `effects` prop's resolve/lerp pair. */\r\nexport const effectsOps: AttributeOps<Effect, NodeEffect[]> = {\r\n resolve: (effects) => resolveChainEffects(effects),\r\n lerp: (from, to, t) => {\r\n if (from === to) return from;\r\n const maxLen = Math.max(from.length, to.length);\r\n const result: NodeEffect[] = [];\r\n for (let i = 0; i < maxLen; i++) {\r\n const a = from[i];\r\n const b = to[i];\r\n if (a && b) {\r\n result.push(lerpEffect(a, b, t));\r\n } else if (a) {\r\n result.push(a);\r\n } else if (b) {\r\n result.push(b);\r\n }\r\n }\r\n return result;\r\n },\r\n};\r\n"]}
@@ -132,7 +132,7 @@ export interface EffectData<T> {
132
132
  * the effect takes — see {@link EffectSurface}.
133
133
  *
134
134
  * A predicate handles effects whose surface depends on their own fields —
135
- * a foreground `sksl` overlay composes as a filter, while the same effect in
135
+ * a foreground shader composes as a filter, while the same effect in
136
136
  * backdrop mode resamples what is beneath it.
137
137
  */
138
138
  surface?: EffectSurface | ((effect: T) => EffectSurface);
@@ -1 +1 @@
1
- {"version":3,"file":"effect-data.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/effect-data.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAmClD,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAC9C,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAChC,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAChC,KAAK,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;IAC7C,CAAC;AACL,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,CAAa,EAAE,CAAa;IACvD,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,OAA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AAK,KAAK,SAAS;YAAG,GAA+B,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC3E,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CACzB,GAA2B,EAC3B,GAAY;IAEZ,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACjC,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAgC,CAAC;IACjF,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport type { Color, NormalizedColor } from \"../fill/color/parser\";\r\nimport { parseColor } from \"../fill/color/parser\";\r\n\r\n/**\r\n * Which layer an effect runs on: the node's own content (`\"foreground\"`, the\r\n * default) or the **backdrop** — the content already painted beneath the node.\r\n * A backdrop effect is applied to whatever lies underneath the node and clipped\r\n * to the node's silhouette, so the node's own edges stay sharp (Figma-style).\r\n */\r\nexport type EffectMode = \"foreground\" | \"backdrop\";\r\n\r\n/**\r\n * How a backend must realise an effect.\r\n *\r\n * - `\"filter\"` (the default) — the effect transforms colours in place, so it\r\n * composes as a plain image filter alongside its neighbours in the chain.\r\n * - `\"shader\"` — the effect *resamples pixel positions* (warps, bands, or\r\n * otherwise reads neighbouring texels), so it needs the content snapshotted\r\n * into a texture and redrawn through a lens rather than composed.\r\n *\r\n * This is a statement about the effect, not about any particular backend: it\r\n * says the effect needs random access to its source, which is why it belongs\r\n * here next to `lerp`/`equals` rather than in the renderer.\r\n */\r\nexport type EffectSurface = \"filter\" | \"shader\";\r\n\r\n/**\r\n * Axis (or axes) an effect acts along.\r\n *\r\n * `\"both\"` (= `{ x: 1, y: 1 }`) uses the full 2D vector; `\"x\"`/`\"y\"` isolate a\r\n * single axis; a {@link Vector2} gives fractional control per axis. Shared by\r\n * every axis-selecting effect so `scatter` and `motionBlur` speak the same\r\n * vocabulary.\r\n */\r\nexport type EffectAxis = \"x\" | \"y\" | \"both\" | Vector2;\r\n\r\n/** Resolve an {@link EffectAxis} to its per-axis scale vector. */\r\nexport function resolveEffectAxis(axis: EffectAxis): Vector2 {\r\n switch (axis) {\r\n case \"x\": return { x: 1, y: 0 };\r\n case \"y\": return { x: 0, y: 1 };\r\n case \"both\": return { x: 1, y: 1 };\r\n default: return { x: axis.x, y: axis.y };\r\n }\r\n}\r\n\r\n/** Do two {@link EffectAxis} values resolve to the same scale vector? */\r\nexport function sameEffectAxis(a: EffectAxis, b: EffectAxis): boolean {\r\n const av = resolveEffectAxis(a);\r\n const bv = resolveEffectAxis(b);\r\n return av.x === bv.x && av.y === bv.y;\r\n}\r\n\r\n/**\r\n * Resolve a colour-valued effect option to its RGBA tuple.\r\n *\r\n * Colour options are stored **as authored** (a CSS string, a theme alias, or an\r\n * already-normalised tuple) rather than parsed at build time, so a raw effect\r\n * literal — `{ type: 'outline', color: 'primary', … }` — behaves exactly like the\r\n * builder form, and a theme alias still resolves against whatever `setTheme`\r\n * installed. Backends call this to get numbers; `lerp` calls it on both ends.\r\n */\r\nexport function resolveEffectColor(color: Color): NormalizedColor {\r\n return Array.isArray(color) ? color : parseColor(color);\r\n}\r\n\r\n/** Do two colour options resolve to the same RGBA? (`'red'` === `'#ff0000'`.) */\r\nexport function sameEffectColor(a: Color, b: Color): boolean {\r\n if (a === b) return true;\r\n const av = resolveEffectColor(a);\r\n const bv = resolveEffectColor(b);\r\n return av[0] === bv[0] && av[1] === bv[1] && av[2] === bv[2] && av[3] === bv[3];\r\n}\r\n\r\n/**\r\n * Mixin: every effect declares the layer it targets via {@link EffectMode}.\r\n * Omitted is treated as `\"foreground\"`. A single uniform field across all effects\r\n * means the backdrop/foreground classifier never has to branch on `type`.\r\n */\r\nexport interface ModedEffect {\r\n mode?: EffectMode;\r\n /**\r\n * Confine the effect's output to the alpha it was handed — the node's own\r\n * silhouette, rather than the rectangle its bleed would otherwise fill.\r\n *\r\n * Off (the default) a blur, bloom, outline or streak spreads *past* the\r\n * content that produced it, which is usually the point. On, the effect is\r\n * clipped back into the shape: a bloom that lights the node without\r\n * haloing the page around it, a blur that softens a fill without fraying its\r\n * edge — Figma's \"clip content\" applied to the effect rather than the layer.\r\n *\r\n * Honoured on both render paths — `EffectRegistry.compose` clips an\r\n * ImageFilter chain per effect, and `resolveForegroundCapture` blends a\r\n * shader effect's lens into the content it was given — so the flag means the\r\n * same thing whichever way an effect happens to be realised.\r\n *\r\n * Redundant in `mode: 'backdrop'`, where the effect is already confined to\r\n * the node's silhouette by definition.\r\n */\r\n clip?: boolean;\r\n}\r\n\r\n/**\r\n * Cross-cutting options accepted by every effect builder — the builder-side view\r\n * of {@link ModedEffect}. Each builder's own options type intersects this, so\r\n * `mode` is spelled the same way everywhere:\r\n *\r\n * Effects.blur({ radius: 8, mode: 'backdrop' })\r\n *\r\n * This is the extension point for future chain-wide options (e.g. a wet/dry\r\n * `mix`): add the field here and to {@link EFFECT_OPTION_KEYS} and every builder\r\n * picks it up.\r\n */\r\nexport type EffectOptions = ModedEffect;\r\n\r\n/**\r\n * The {@link EffectOptions} keys {@link withEffectOptions} copies onto a built\r\n * effect. `satisfies` keeps this in lockstep with the interface (mirroring\r\n * `TEXT_STYLE_KEYS`), and `withEffectOptions` iterates it rather than naming\r\n * fields, so adding an option here is the only edit needed.\r\n */\r\nexport const EFFECT_OPTION_KEYS = [\"mode\", \"clip\"] as const satisfies readonly (keyof EffectOptions)[];\r\n\r\n/**\r\n * Merge cross-cutting options onto a built effect, **skipping undefined keys**.\r\n *\r\n * Omitting rather than writing `undefined` matters: the per-effect `equals()`\r\n * implementations compare `mode` directly, so a spread that sets `mode:\r\n * undefined` is not equal to an effect that never set it at all.\r\n */\r\nexport function withEffectOptions<T extends object>(base: T, options?: EffectOptions): T & EffectOptions {\r\n const out = { ...base } as T & EffectOptions;\r\n if (!options) return out;\r\n for (const key of EFFECT_OPTION_KEYS) {\r\n const value = options[key];\r\n // Indexed write through a widened view: the keys no longer share one\r\n // value type (`mode` is an EffectMode, `clip` a boolean), so `out[key]`\r\n // narrows to their intersection — `never` — under a union key.\r\n if (value !== undefined) (out as Record<string, unknown>)[key] = value;\r\n }\r\n return out;\r\n}\r\n\r\n/**\r\n * Normalise a builder's single argument to its options object.\r\n *\r\n * Every effect builder takes exactly one parameter; those with a dominant\r\n * animated scalar also accept that scalar directly, so `blur(8)` and\r\n * `blur({ radius: 8 })` produce the same effect. `key` names the field a bare\r\n * number maps onto.\r\n */\r\nexport function scalarOptions<O extends object>(\r\n arg: number | O | undefined,\r\n key: keyof O,\r\n): Partial<O> & EffectOptions {\r\n if (arg === undefined) return {};\r\n if (typeof arg === \"number\") return { [key]: arg } as Partial<O> & EffectOptions;\r\n return arg;\r\n}\r\n\r\nexport interface EffectData<T> {\r\n /**\r\n * Linearly interpolates between two effect states.\r\n * @param from The starting state of the effect.\r\n * @param to The target state of the effect.\r\n * @param t The interpolation factor (usually a normalized value between 0 and 1).\r\n * @returns A new effect state representing the blended value.\r\n */\r\n lerp: (from: T, to: T, t: number) => T;\r\n\r\n /**\r\n * Compares two effect states for deep equality.\r\n * @param a The first effect state.\r\n * @param b The second effect state.\r\n * @returns True if the effects are structurally identical, otherwise false.\r\n */\r\n equals: (a: T, b: T) => boolean;\r\n\r\n /**\r\n * How a backend must realise this effect. Defaults to `\"filter\"`; effects\r\n * that resample pixel positions declare `\"shader\"`. Drives which render path\r\n * the effect takes — see {@link EffectSurface}.\r\n *\r\n * A predicate handles effects whose surface depends on their own fields —\r\n * a foreground `sksl` overlay composes as a filter, while the same effect in\r\n * backdrop mode resamples what is beneath it.\r\n */\r\n surface?: EffectSurface | ((effect: T) => EffectSurface);\r\n\r\n /**\r\n * Normalise an authored effect into the shape the rest of the pipeline\r\n * expects — the mirror of `FillData.resolve`, which a fill has and an effect\r\n * did not.\r\n *\r\n * Called once per property write, through `resolveChainEffects`, which is\r\n * the single funnel every effect reaches a node by (the `effects` prop's\r\n * mapper and `Graphics2D.effects`). That makes it the one place a stored\r\n * document can be migrated forward — an older spelling of a type or a field\r\n * is rewritten here rather than being understood separately by `lerp`,\r\n * `equals`, the surface predicate and the backend.\r\n *\r\n * **Return the effect unchanged when nothing needs rewriting.** It runs on\r\n * every write, so allocating a copy per call would churn for the\r\n * overwhelming majority of effects, which need no normalisation at all.\r\n */\r\n resolve?(effect: T): T;\r\n\r\n /**\r\n * An effect that samples a texture declares it here, as an image fill does:\r\n * an undeclared asset is a lookup the effect can only read as \"no texture\".\r\n */\r\n declare?(effect: T, assets: AssetScope): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"effect-data.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/effect-data.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAmClD,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAC9C,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAChC,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAChC,KAAK,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;IAC7C,CAAC;AACL,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,CAAa,EAAE,CAAa;IACvD,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,OAAO,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K,KAAK,SAAS;YAAG,GAA+B,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC3E,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CACzB,GAA2B,EAC3B,GAAY;IAEZ,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACjC,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAgC,CAAC;IACjF,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport type { Color, NormalizedColor } from \"../fill/color/parser\";\r\nimport { parseColor } from \"../fill/color/parser\";\r\n\r\n/**\r\n * Which layer an effect runs on: the node's own content (`\"foreground\"`, the\r\n * default) or the **backdrop** — the content already painted beneath the node.\r\n * A backdrop effect is applied to whatever lies underneath the node and clipped\r\n * to the node's silhouette, so the node's own edges stay sharp (Figma-style).\r\n */\r\nexport type EffectMode = \"foreground\" | \"backdrop\";\r\n\r\n/**\r\n * How a backend must realise an effect.\r\n *\r\n * - `\"filter\"` (the default) — the effect transforms colours in place, so it\r\n * composes as a plain image filter alongside its neighbours in the chain.\r\n * - `\"shader\"` — the effect *resamples pixel positions* (warps, bands, or\r\n * otherwise reads neighbouring texels), so it needs the content snapshotted\r\n * into a texture and redrawn through a lens rather than composed.\r\n *\r\n * This is a statement about the effect, not about any particular backend: it\r\n * says the effect needs random access to its source, which is why it belongs\r\n * here next to `lerp`/`equals` rather than in the renderer.\r\n */\r\nexport type EffectSurface = \"filter\" | \"shader\";\r\n\r\n/**\r\n * Axis (or axes) an effect acts along.\r\n *\r\n * `\"both\"` (= `{ x: 1, y: 1 }`) uses the full 2D vector; `\"x\"`/`\"y\"` isolate a\r\n * single axis; a {@link Vector2} gives fractional control per axis. Shared by\r\n * every axis-selecting effect so `scatter` and `motionBlur` speak the same\r\n * vocabulary.\r\n */\r\nexport type EffectAxis = \"x\" | \"y\" | \"both\" | Vector2;\r\n\r\n/** Resolve an {@link EffectAxis} to its per-axis scale vector. */\r\nexport function resolveEffectAxis(axis: EffectAxis): Vector2 {\r\n switch (axis) {\r\n case \"x\": return { x: 1, y: 0 };\r\n case \"y\": return { x: 0, y: 1 };\r\n case \"both\": return { x: 1, y: 1 };\r\n default: return { x: axis.x, y: axis.y };\r\n }\r\n}\r\n\r\n/** Do two {@link EffectAxis} values resolve to the same scale vector? */\r\nexport function sameEffectAxis(a: EffectAxis, b: EffectAxis): boolean {\r\n const av = resolveEffectAxis(a);\r\n const bv = resolveEffectAxis(b);\r\n return av.x === bv.x && av.y === bv.y;\r\n}\r\n\r\n/**\r\n * Resolve a colour-valued effect option to its RGBA tuple.\r\n *\r\n * Colour options are stored **as authored** (a CSS string, a theme alias, or an\r\n * already-normalised tuple) rather than parsed at build time, so a raw effect\r\n * literal — `{ type: 'outline', color: 'primary', … }` — behaves exactly like the\r\n * builder form, and a theme alias still resolves against whatever `setTheme`\r\n * installed. Backends call this to get numbers; `lerp` calls it on both ends.\r\n */\r\nexport function resolveEffectColor(color: Color): NormalizedColor {\r\n return Array.isArray(color) ? color : parseColor(color);\r\n}\r\n\r\n/** Do two colour options resolve to the same RGBA? (`'red'` === `'#ff0000'`.) */\r\nexport function sameEffectColor(a: Color, b: Color): boolean {\r\n if (a === b) return true;\r\n const av = resolveEffectColor(a);\r\n const bv = resolveEffectColor(b);\r\n return av[0] === bv[0] && av[1] === bv[1] && av[2] === bv[2] && av[3] === bv[3];\r\n}\r\n\r\n/**\r\n * Mixin: every effect declares the layer it targets via {@link EffectMode}.\r\n * Omitted is treated as `\"foreground\"`. A single uniform field across all effects\r\n * means the backdrop/foreground classifier never has to branch on `type`.\r\n */\r\nexport interface ModedEffect {\r\n mode?: EffectMode;\r\n /**\r\n * Confine the effect's output to the alpha it was handed — the node's own\r\n * silhouette, rather than the rectangle its bleed would otherwise fill.\r\n *\r\n * Off (the default) a blur, bloom, outline or streak spreads *past* the\r\n * content that produced it, which is usually the point. On, the effect is\r\n * clipped back into the shape: a bloom that lights the node without\r\n * haloing the page around it, a blur that softens a fill without fraying its\r\n * edge — Figma's \"clip content\" applied to the effect rather than the layer.\r\n *\r\n * Honoured on both render paths — `EffectRegistry.compose` clips an\r\n * ImageFilter chain per effect, and `resolveForegroundCapture` blends a\r\n * shader effect's lens into the content it was given — so the flag means the\r\n * same thing whichever way an effect happens to be realised.\r\n *\r\n * Redundant in `mode: 'backdrop'`, where the effect is already confined to\r\n * the node's silhouette by definition.\r\n */\r\n clip?: boolean;\r\n}\r\n\r\n/**\r\n * Cross-cutting options accepted by every effect builder — the builder-side view\r\n * of {@link ModedEffect}. Each builder's own options type intersects this, so\r\n * `mode` is spelled the same way everywhere:\r\n *\r\n * Effects.blur({ radius: 8, mode: 'backdrop' })\r\n *\r\n * This is the extension point for future chain-wide options (e.g. a wet/dry\r\n * `mix`): add the field here and to {@link EFFECT_OPTION_KEYS} and every builder\r\n * picks it up.\r\n */\r\nexport type EffectOptions = ModedEffect;\r\n\r\n/**\r\n * The {@link EffectOptions} keys {@link withEffectOptions} copies onto a built\r\n * effect. `satisfies` keeps this in lockstep with the interface (mirroring\r\n * `TEXT_STYLE_KEYS`), and `withEffectOptions` iterates it rather than naming\r\n * fields, so adding an option here is the only edit needed.\r\n */\r\nexport const EFFECT_OPTION_KEYS = [\"mode\", \"clip\"] as const satisfies readonly (keyof EffectOptions)[];\r\n\r\n/**\r\n * Merge cross-cutting options onto a built effect, **skipping undefined keys**.\r\n *\r\n * Omitting rather than writing `undefined` matters: the per-effect `equals()`\r\n * implementations compare `mode` directly, so a spread that sets `mode:\r\n * undefined` is not equal to an effect that never set it at all.\r\n */\r\nexport function withEffectOptions<T extends object>(base: T, options?: EffectOptions): T & EffectOptions {\r\n const out = { ...base } as T & EffectOptions;\r\n if (!options) return out;\r\n for (const key of EFFECT_OPTION_KEYS) {\r\n const value = options[key];\r\n // Indexed write through a widened view: the keys no longer share one\r\n // value type (`mode` is an EffectMode, `clip` a boolean), so `out[key]`\r\n // narrows to their intersection — `never` — under a union key.\r\n if (value !== undefined) (out as Record<string, unknown>)[key] = value;\r\n }\r\n return out;\r\n}\r\n\r\n/**\r\n * Normalise a builder's single argument to its options object.\r\n *\r\n * Every effect builder takes exactly one parameter; those with a dominant\r\n * animated scalar also accept that scalar directly, so `blur(8)` and\r\n * `blur({ radius: 8 })` produce the same effect. `key` names the field a bare\r\n * number maps onto.\r\n */\r\nexport function scalarOptions<O extends object>(\r\n arg: number | O | undefined,\r\n key: keyof O,\r\n): Partial<O> & EffectOptions {\r\n if (arg === undefined) return {};\r\n if (typeof arg === \"number\") return { [key]: arg } as Partial<O> & EffectOptions;\r\n return arg;\r\n}\r\n\r\nexport interface EffectData<T> {\r\n /**\r\n * Linearly interpolates between two effect states.\r\n * @param from The starting state of the effect.\r\n * @param to The target state of the effect.\r\n * @param t The interpolation factor (usually a normalized value between 0 and 1).\r\n * @returns A new effect state representing the blended value.\r\n */\r\n lerp: (from: T, to: T, t: number) => T;\r\n\r\n /**\r\n * Compares two effect states for deep equality.\r\n * @param a The first effect state.\r\n * @param b The second effect state.\r\n * @returns True if the effects are structurally identical, otherwise false.\r\n */\r\n equals: (a: T, b: T) => boolean;\r\n\r\n /**\r\n * How a backend must realise this effect. Defaults to `\"filter\"`; effects\r\n * that resample pixel positions declare `\"shader\"`. Drives which render path\r\n * the effect takes — see {@link EffectSurface}.\r\n *\r\n * A predicate handles effects whose surface depends on their own fields —\r\n * a foreground shader composes as a filter, while the same effect in\r\n * backdrop mode resamples what is beneath it.\r\n */\r\n surface?: EffectSurface | ((effect: T) => EffectSurface);\r\n\r\n /**\r\n * Normalise an authored effect into the shape the rest of the pipeline\r\n * expects — the mirror of `FillData.resolve`, which a fill has and an effect\r\n * did not.\r\n *\r\n * Called once per property write, through `resolveChainEffects`, which is\r\n * the single funnel every effect reaches a node by (the `effects` prop's\r\n * mapper and `Graphics2D.effects`). That makes it the one place a stored\r\n * document can be migrated forward — an older spelling of a type or a field\r\n * is rewritten here rather than being understood separately by `lerp`,\r\n * `equals`, the surface predicate and the backend.\r\n *\r\n * **Return the effect unchanged when nothing needs rewriting.** It runs on\r\n * every write, so allocating a copy per call would churn for the\r\n * overwhelming majority of effects, which need no normalisation at all.\r\n */\r\n resolve?(effect: T): T;\r\n\r\n /**\r\n * An effect that samples a texture declares it here, as an image fill does:\r\n * an undeclared asset is a lookup the effect can only read as \"no texture\".\r\n */\r\n declare?(effect: T, assets: AssetScope): void;\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
- import type { Color } from "../../../../attributes/shape/fill/color/parser.js";
2
1
  import type { ModedEffect, EffectData } from "../effect-data.js";
2
+ import { type EffectFields } from "../spec.js";
3
3
  /**
4
4
  * Built-in glyph ramps, each ordered **least ink first**: `charset[0]` stands in
5
5
  * for the darkest cells and the last entry for the lightest.
@@ -30,20 +30,52 @@ export declare function resolveAsciiCharset(charset: AsciiCharset | string): str
30
30
  * The glyphs come from a texture baked once per charset/font/size — the first
31
31
  * effect to use the renderer's resource hook.
32
32
  */
33
- export interface AsciiEffect extends ModedEffect {
33
+ export interface AsciiEffect extends ModedEffect, EffectFields<typeof asciiSpec.params> {
34
34
  type: "ascii";
35
- /** Cell size in px — the width of one character. */
36
- size: number;
35
+ }
36
+ /** The {@link AsciiEffect} spec: its parameters, defaults and ranges. */
37
+ export declare const asciiSpec: import("../spec.js").EffectSpec<"ascii", {
38
+ /** Cell size in pixels — the width of one character. */
39
+ readonly size: import("../spec.js").EffectParamDef<number, number> & NoInfer<{
40
+ readonly default: 12;
41
+ readonly min: 2;
42
+ readonly unit: "px";
43
+ readonly label: "cellSize";
44
+ readonly inline: true;
45
+ }> & {
46
+ kind: "number";
47
+ };
37
48
  /** A named ramp, or a custom string ordered least-ink-first. */
38
- charset: AsciiCharset | string;
39
- /** Family the glyphs are baked in. Best results from a monospace face. */
40
- fontFamily: string;
41
- /** Colour of the glyphs when `colored` is false. */
42
- ink: Color;
43
- /** Colour behind the glyphs. Fully transparent leaves the backdrop showing. */
44
- background: Color;
49
+ readonly charset: import("../spec.js").EffectParamDef<string, string> & NoInfer<{
50
+ readonly kind: "enum";
51
+ readonly default: "standard";
52
+ readonly options: string[];
53
+ readonly optionsLabel: "asciiCharset";
54
+ }>;
55
+ /** Family the glyphs are baked in; a monospace face reads best. */
56
+ readonly fontFamily: import("../spec.js").EffectParamDef<any, any> & NoInfer<{
57
+ readonly default: "monospace";
58
+ }> & {
59
+ kind: "text";
60
+ };
61
+ /** Glyph colour when `colored` is false. */
62
+ readonly ink: import("../spec.js").EffectParamDef<import("../../fill/index.js").Color, import("../../fill/index.js").Color> & NoInfer<{
63
+ readonly default: "white";
64
+ }> & {
65
+ kind: "color";
66
+ };
67
+ /** Colour behind the glyphs (`'transparent'` to overlay). */
68
+ readonly background: import("../spec.js").EffectParamDef<import("../../fill/index.js").Color, import("../../fill/index.js").Color> & NoInfer<{
69
+ readonly default: "black";
70
+ }> & {
71
+ kind: "color";
72
+ };
45
73
  /** Tint each glyph with its own cell's colour instead of using `ink`. */
46
- colored: boolean;
47
- }
74
+ readonly colored: import("../spec.js").EffectParamDef<boolean, boolean> & NoInfer<{
75
+ readonly default: false;
76
+ }> & {
77
+ kind: "boolean";
78
+ };
79
+ }>;
48
80
  export declare const asciiEffect: EffectData<AsciiEffect>;
49
81
  //# sourceMappingURL=ascii.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ascii.d.ts","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/ascii.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG9D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,GAA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,EAAE,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC;IACnF,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,yEAAyE;AACzE,eAAO,MAAM,SAAS;IASd,wDAAwD;;;;;;;;;;IAExD,gEAAgE;;;;;;;IAOhE,mEAAmE;;;;;;IAEnE,4CAA4C;;;;;;IAE5C,6DAA6D;;;;;;IAE7D,yEAAyE;;;;;;EAG/E,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,WAAW,CAA2B,CAAC"}
@@ -1,6 +1,4 @@
1
- import { lerpNumber } from "../../../../tween/lerp.js";
2
- import { lerpColor } from "../../../../attributes/shape/fill/lerp.js";
3
- import { resolveEffectColor, sameEffectColor } from "../effect-data.js";
1
+ import { defineEffect, effectDataOf, param } from "../spec.js";
4
2
  /** The ramp each named charset expands to. Exported so a backend needn't guess. */
5
3
  export const ASCII_CHARSETS = {
6
4
  standard: " .:-=+*#%@",
@@ -13,26 +11,34 @@ export const ASCII_CHARSETS = {
13
11
  export function resolveAsciiCharset(charset) {
14
12
  return ASCII_CHARSETS[charset] ?? charset;
15
13
  }
16
- export const asciiEffect = {
17
- lerp: (from, to, t) => ({
18
- type: "ascii",
19
- size: lerpNumber(from.size, to.size, t),
20
- // A charset, a family and the colour mode are all discrete — snap.
21
- charset: t < 0.5 ? from.charset : to.charset,
22
- fontFamily: t < 0.5 ? from.fontFamily : to.fontFamily,
23
- ink: lerpColor(resolveEffectColor(from.ink), resolveEffectColor(to.ink), t),
24
- background: lerpColor(resolveEffectColor(from.background), resolveEffectColor(to.background), t),
25
- colored: t < 0.5 ? from.colored : to.colored,
26
- mode: t < 0.5 ? from.mode : to.mode,
27
- }),
28
- equals: (a, b) => a.size === b.size &&
29
- a.charset === b.charset &&
30
- a.fontFamily === b.fontFamily &&
31
- sameEffectColor(a.ink, b.ink) &&
32
- sameEffectColor(a.background, b.background) &&
33
- a.colored === b.colored &&
34
- a.mode === b.mode,
14
+ /** The {@link AsciiEffect} spec: its parameters, defaults and ranges. */
15
+ export const asciiSpec = defineEffect({
16
+ type: "ascii",
17
+ group: "stylize",
35
18
  // Reads one texel per cell and a glyph texture alongside it.
36
19
  surface: "shader",
37
- };
20
+ scalar: "size",
21
+ // Replaces the image with glyphs at every size.
22
+ neutral: null,
23
+ params: {
24
+ /** Cell size in pixels — the width of one character. */
25
+ size: param.number({ default: 12, min: 2, unit: "px", label: "cellSize", inline: true }),
26
+ /** A named ramp, or a custom string ordered least-ink-first. */
27
+ charset: param.of()({
28
+ kind: "enum",
29
+ default: "standard",
30
+ options: Object.keys(ASCII_CHARSETS),
31
+ optionsLabel: "asciiCharset",
32
+ }),
33
+ /** Family the glyphs are baked in; a monospace face reads best. */
34
+ fontFamily: param.text({ default: "monospace" }),
35
+ /** Glyph colour when `colored` is false. */
36
+ ink: param.color({ default: "white" }),
37
+ /** Colour behind the glyphs (`'transparent'` to overlay). */
38
+ background: param.color({ default: "black" }),
39
+ /** Tint each glyph with its own cell's colour instead of using `ink`. */
40
+ colored: param.boolean({ default: false }),
41
+ },
42
+ });
43
+ export const asciiEffect = effectDataOf(asciiSpec);
38
44
  //# sourceMappingURL=ascii.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ascii.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/ascii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAsBrE,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAiC;IACxD,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE,kBAAkB;CAC1B,CAAC;AAEF,6FAA6F;AAC7F,MAAM,UAAU,mBAAmB,CA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QAC7B,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;QAC7B,eAAe,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;QAC3C,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;IACrB,6DAA6D;IAC7D,OAAO,EAAE,QAAQ;CACpB,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport { lerpColor } from \"@/attributes/shape/fill/lerp\";\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\n\r\n/**\r\n * Built-in glyph ramps, each ordered **least ink first**: `charset[0]` stands in\r\n * for the darkest cells and the last entry for the lightest.\r\n *\r\n * That ordering is about the *result*, not the glyph. On the default white ink\r\n * over black, an empty cell is the darkest thing the effect can draw and a solid\r\n * one the brightest, so least-ink-first is exactly dark-to-light. Invert the ink\r\n * and background — black on white, the paper look — and the same ramp is used\r\n * back to front automatically, so a custom ramp only ever has to be written once.\r\n *\r\n * - `'standard'` — the classic ten-step ASCII ramp.\r\n * - `'blocks'` — Unicode shading blocks; the most legible at small cell sizes,\r\n * because each step really is a fixed fraction of coverage.\r\n * - `'braille'` — braille dot patterns, the finest ramp of the set.\r\n * - `'binary'` — just `0` and `1`: a two-tone cut rather than a ramp.\r\n * - `'hex'` — `0`–`F`, the hex-dump look. Its \"ramp\" is nominal, since a glyph's\r\n * ink doesn't track its digit, so expect texture rather than tone.\r\n */\r\nexport type AsciiCharset = \"standard\" | \"blocks\" | \"braille\" | \"binary\" | \"hex\";\r\n\r\n/** The ramp each named charset expands to. Exported so a backend needn't guess. */\r\nexport const ASCII_CHARSETS: Record<AsciiCharset, string> = {\r\n standard: \" .:-=+*#%@\",\r\n blocks: \" ░▒▓█\",\r\n braille: \" ⠄⣀⣄⣤⣶⣷⣿\",\r\n binary: \"01\",\r\n hex: \"0123456789ABCDEF\",\r\n};\r\n\r\n/** Resolve a charset option to its literal ramp; unknown names fall back to `'standard'`. */\r\nexport function resolveAsciiCharset(charset: AsciiCharset | string): string {\r\n return ASCII_CHARSETS[charset as AsciiCharset] ?? charset;\r\n}\r\n\r\n/**\r\n * ASCII art: the content is divided into a grid of cells, each cell's tone is\r\n * matched to a glyph, and that glyph is drawn in its place.\r\n *\r\n * The glyphs come from a texture baked once per charset/font/size — the first\r\n * effect to use the renderer's resource hook.\r\n */\r\nexport interface AsciiEffect extends ModedEffect {\r\n type: \"ascii\";\r\n /** Cell size in px — the width of one character. */\r\n size: number;\r\n /** A named ramp, or a custom string ordered least-ink-first. */\r\n charset: AsciiCharset | string;\r\n /** Family the glyphs are baked in. Best results from a monospace face. */\r\n fontFamily: string;\r\n /** Colour of the glyphs when `colored` is false. */\r\n ink: Color;\r\n /** Colour behind the glyphs. Fully transparent leaves the backdrop showing. */\r\n background: Color;\r\n /** Tint each glyph with its own cell's colour instead of using `ink`. */\r\n colored: boolean;\r\n}\r\n\r\nexport const asciiEffect: EffectData<AsciiEffect> = {\r\n lerp: (from, to, t) => ({\r\n type: \"ascii\",\r\n size: lerpNumber(from.size, to.size, t),\r\n // A charset, a family and the colour mode are all discrete — snap.\r\n charset: t < 0.5 ? from.charset : to.charset,\r\n fontFamily: t < 0.5 ? from.fontFamily : to.fontFamily,\r\n ink: lerpColor(resolveEffectColor(from.ink), resolveEffectColor(to.ink), t),\r\n background: lerpColor(resolveEffectColor(from.background), resolveEffectColor(to.background), t),\r\n colored: t < 0.5 ? from.colored : to.colored,\r\n mode: t < 0.5 ? from.mode : to.mode,\r\n }),\r\n equals: (a, b) =>\r\n a.size === b.size &&\r\n a.charset === b.charset &&\r\n a.fontFamily === b.fontFamily &&\r\n sameEffectColor(a.ink, b.ink) &&\r\n sameEffectColor(a.background, b.background) &&\r\n a.colored === b.colored &&\r\n a.mode === b.mode,\r\n // Reads one texel per cell and a glyph texture alongside it.\r\n surface: \"shader\",\r\n};\r\n"]}
1
+ {"version":3,"file":"ascii.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/effects/implementations/ascii.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAqB,MAAM,SAAS,CAAC;AAsB/E,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAiC;IACxD,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE,kBAAkB;CAC1B,CAAC;AAEF,6FAA6F;AAC7F,MAAM,UAAU,mBAAmB,CAAC,OAA8B;IAC9D,OAAO,cAAc,CAAC,OAAuB,CAAC,IAAI,OAAO,CAAC;AAC9D,CAAC;AAaD,yEAAyE;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;IAClC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,SAAS;IAChB,6DAA6D;IAC7D,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,MAAM;IACd,gDAAgD;IAChD,OAAO,EAAE,IAAI;IACb,MAAM,EAAE;QACJ,wDAAwD;QACxD,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACxF,gEAAgE;QAChE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAyB,CAAC;YACvC,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;YACpC,YAAY,EAAE,cAAc;SAC/B,CAAC;QACF,mEAAmE;QACnE,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QAChD,4CAA4C;QAC5C,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACtC,6DAA6D;QAC7D,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAC7C,yEAAyE;QACzE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;KAC7C;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 * Built-in glyph ramps, each ordered **least ink first**: `charset[0]` stands in\r\n * for the darkest cells and the last entry for the lightest.\r\n *\r\n * That ordering is about the *result*, not the glyph. On the default white ink\r\n * over black, an empty cell is the darkest thing the effect can draw and a solid\r\n * one the brightest, so least-ink-first is exactly dark-to-light. Invert the ink\r\n * and background — black on white, the paper look — and the same ramp is used\r\n * back to front automatically, so a custom ramp only ever has to be written once.\r\n *\r\n * - `'standard'` — the classic ten-step ASCII ramp.\r\n * - `'blocks'` — Unicode shading blocks; the most legible at small cell sizes,\r\n * because each step really is a fixed fraction of coverage.\r\n * - `'braille'` — braille dot patterns, the finest ramp of the set.\r\n * - `'binary'` — just `0` and `1`: a two-tone cut rather than a ramp.\r\n * - `'hex'` — `0`–`F`, the hex-dump look. Its \"ramp\" is nominal, since a glyph's\r\n * ink doesn't track its digit, so expect texture rather than tone.\r\n */\r\nexport type AsciiCharset = \"standard\" | \"blocks\" | \"braille\" | \"binary\" | \"hex\";\r\n\r\n/** The ramp each named charset expands to. Exported so a backend needn't guess. */\r\nexport const ASCII_CHARSETS: Record<AsciiCharset, string> = {\r\n standard: \" .:-=+*#%@\",\r\n blocks: \" ░▒▓█\",\r\n braille: \" ⠄⣀⣄⣤⣶⣷⣿\",\r\n binary: \"01\",\r\n hex: \"0123456789ABCDEF\",\r\n};\r\n\r\n/** Resolve a charset option to its literal ramp; unknown names fall back to `'standard'`. */\r\nexport function resolveAsciiCharset(charset: AsciiCharset | string): string {\r\n return ASCII_CHARSETS[charset as AsciiCharset] ?? charset;\r\n}\r\n\r\n/**\r\n * ASCII art: the content is divided into a grid of cells, each cell's tone is\r\n * matched to a glyph, and that glyph is drawn in its place.\r\n *\r\n * The glyphs come from a texture baked once per charset/font/size — the first\r\n * effect to use the renderer's resource hook.\r\n */\r\nexport interface AsciiEffect extends ModedEffect, EffectFields<typeof asciiSpec.params> {\r\n type: \"ascii\";\r\n}\r\n\r\n/** The {@link AsciiEffect} spec: its parameters, defaults and ranges. */\r\nexport const asciiSpec = defineEffect({\r\n type: \"ascii\",\r\n group: \"stylize\",\r\n // Reads one texel per cell and a glyph texture alongside it.\r\n surface: \"shader\",\r\n scalar: \"size\",\r\n // Replaces the image with glyphs at every size.\r\n neutral: null,\r\n params: {\r\n /** Cell size in pixels — the width of one character. */\r\n size: param.number({ default: 12, min: 2, unit: \"px\", label: \"cellSize\", inline: true }),\r\n /** A named ramp, or a custom string ordered least-ink-first. */\r\n charset: param.of<AsciiCharset | string>()({\r\n kind: \"enum\",\r\n default: \"standard\",\r\n options: Object.keys(ASCII_CHARSETS),\r\n optionsLabel: \"asciiCharset\",\r\n }),\r\n /** Family the glyphs are baked in; a monospace face reads best. */\r\n fontFamily: param.text({ default: \"monospace\" }),\r\n /** Glyph colour when `colored` is false. */\r\n ink: param.color({ default: \"white\" }),\r\n /** Colour behind the glyphs (`'transparent'` to overlay). */\r\n background: param.color({ default: \"black\" }),\r\n /** Tint each glyph with its own cell's colour instead of using `ink`. */\r\n colored: param.boolean({ default: false }),\r\n },\r\n});\r\n\r\nexport const asciiEffect: EffectData<AsciiEffect> = effectDataOf(asciiSpec);\r\n"]}