@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (746) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +79 -4
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +17 -2
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js.map +1 -1
  45. package/dist/attributes/audio/schedule.d.ts +4 -2
  46. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  47. package/dist/attributes/audio/schedule.js +15 -8
  48. package/dist/attributes/audio/schedule.js.map +1 -1
  49. package/dist/attributes/audio/sound.d.ts +4 -2
  50. package/dist/attributes/audio/sound.d.ts.map +1 -1
  51. package/dist/attributes/audio/sound.js +8 -4
  52. package/dist/attributes/audio/sound.js.map +1 -1
  53. package/dist/attributes/index.js.map +1 -1
  54. package/dist/attributes/layout/alignment.js +1 -1
  55. package/dist/attributes/layout/alignment.js.map +1 -1
  56. package/dist/attributes/layout/index.js.map +1 -1
  57. package/dist/attributes/layout/insets.js.map +1 -1
  58. package/dist/attributes/layout/matrix2d.js.map +1 -1
  59. package/dist/attributes/layout/size.js.map +1 -1
  60. package/dist/attributes/layout/transform3d.js.map +1 -1
  61. package/dist/attributes/layout/vector2.js.map +1 -1
  62. package/dist/attributes/layout/world-transform.js.map +1 -1
  63. package/dist/attributes/mask/boolean.js.map +1 -1
  64. package/dist/attributes/mask/mask.js.map +1 -1
  65. package/dist/attributes/properties/decorator.d.ts +3 -1
  66. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  67. package/dist/attributes/properties/decorator.js.map +1 -1
  68. package/dist/attributes/properties/inputs.js.map +1 -1
  69. package/dist/attributes/properties/typed.d.ts +9 -2
  70. package/dist/attributes/properties/typed.d.ts.map +1 -1
  71. package/dist/attributes/properties/typed.js +15 -1
  72. package/dist/attributes/properties/typed.js.map +1 -1
  73. package/dist/attributes/render3d/orbit.d.ts +8 -8
  74. package/dist/attributes/render3d/orbit.js +7 -7
  75. package/dist/attributes/render3d/orbit.js.map +1 -1
  76. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  77. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  78. package/dist/attributes/shape/corners/corners.js.map +1 -1
  79. package/dist/attributes/shape/corners/index.js.map +1 -1
  80. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  81. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  82. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  83. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  84. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  85. package/dist/attributes/shape/effects/chain.js +16 -88
  86. package/dist/attributes/shape/effects/chain.js.map +1 -1
  87. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  88. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  96. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  98. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  101. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  105. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  110. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  114. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  128. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  136. package/dist/attributes/shape/effects/index.d.ts +2 -6
  137. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  138. package/dist/attributes/shape/effects/index.js.map +1 -1
  139. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  140. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/registry.js +44 -10
  142. package/dist/attributes/shape/effects/registry.js.map +1 -1
  143. package/dist/attributes/shape/effects/union.d.ts +2 -6
  144. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/union.js.map +1 -1
  146. package/dist/attributes/shape/fill/blend.js.map +1 -1
  147. package/dist/attributes/shape/fill/chain.js.map +1 -1
  148. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  149. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  150. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  151. package/dist/attributes/shape/fill/color/parser.js +81 -44
  152. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  153. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  154. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  155. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  156. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  157. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  158. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  159. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  160. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  161. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  162. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  165. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  166. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  169. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  170. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  172. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  174. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  176. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  177. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  180. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  181. package/dist/attributes/shape/fill/index.js.map +1 -1
  182. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  183. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  184. package/dist/attributes/shape/fill/registry.js.map +1 -1
  185. package/dist/attributes/shape/fill/union.js.map +1 -1
  186. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  187. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  188. package/dist/attributes/shape/filters/chain.js +1 -13
  189. package/dist/attributes/shape/filters/chain.js.map +1 -1
  190. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  191. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  192. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  193. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  194. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  195. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  196. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  197. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  199. package/dist/attributes/shape/filters/index.d.ts +1 -1
  200. package/dist/attributes/shape/filters/index.js.map +1 -1
  201. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  202. package/dist/attributes/shape/filters/registry.js +3 -3
  203. package/dist/attributes/shape/filters/registry.js.map +1 -1
  204. package/dist/attributes/shape/filters/union.d.ts +6 -7
  205. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  206. package/dist/attributes/shape/filters/union.js.map +1 -1
  207. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  208. package/dist/attributes/shape/path/anchors.js +12 -5
  209. package/dist/attributes/shape/path/anchors.js.map +1 -1
  210. package/dist/attributes/shape/path/bezier.js.map +1 -1
  211. package/dist/attributes/shape/path/index.js.map +1 -1
  212. package/dist/attributes/shape/path/measure.js.map +1 -1
  213. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  214. package/dist/attributes/shape/path/morph.js +16 -4
  215. package/dist/attributes/shape/path/morph.js.map +1 -1
  216. package/dist/attributes/shape/path/ops.js.map +1 -1
  217. package/dist/attributes/shape/path/types.js.map +1 -1
  218. package/dist/attributes/shape/path/walk.js.map +1 -1
  219. package/dist/attributes/shape/shaders/index.js.map +1 -1
  220. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  221. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  222. package/dist/attributes/shape/shadow/index.js.map +1 -1
  223. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  224. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  225. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  226. package/dist/attributes/shape/stroke/index.js +1 -1
  227. package/dist/attributes/shape/stroke/index.js.map +1 -1
  228. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  229. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  230. package/dist/attributes/shape/stroke/stroke.js +22 -2
  231. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  232. package/dist/attributes/shared/operators.js.map +1 -1
  233. package/dist/attributes/text/index.js.map +1 -1
  234. package/dist/attributes/text/ops.d.ts +6 -0
  235. package/dist/attributes/text/ops.d.ts.map +1 -1
  236. package/dist/attributes/text/ops.js +1 -0
  237. package/dist/attributes/text/ops.js.map +1 -1
  238. package/dist/attributes/text/types.js.map +1 -1
  239. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  240. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  241. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  242. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  243. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  244. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  245. package/dist/browser/component.js +1 -1
  246. package/dist/browser/component.js.map +1 -1
  247. package/dist/browser/index.js +1 -1
  248. package/dist/browser/index.js.map +4 -4
  249. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  250. package/dist/browser/jsx-jsx-runtime.js +1 -1
  251. package/dist/browser/manifest.json +3 -2
  252. package/dist/browser/sdk.js +1 -1
  253. package/dist/component.js.map +1 -1
  254. package/dist/document/audio.d.ts +1 -1
  255. package/dist/document/audio.js +4 -4
  256. package/dist/document/audio.js.map +1 -1
  257. package/dist/document/builtins.d.ts.map +1 -1
  258. package/dist/document/builtins.js +8 -14
  259. package/dist/document/builtins.js.map +1 -1
  260. package/dist/document/command-traits.d.ts +1 -1
  261. package/dist/document/command-traits.js +13 -1
  262. package/dist/document/command-traits.js.map +1 -1
  263. package/dist/document/deny-globals.js.map +1 -1
  264. package/dist/document/diff.js.map +1 -1
  265. package/dist/document/doc-index.d.ts +2 -2
  266. package/dist/document/doc-index.d.ts.map +1 -1
  267. package/dist/document/doc-index.js.map +1 -1
  268. package/dist/document/expression/compile.d.ts.map +1 -1
  269. package/dist/document/expression/compile.js +8 -5
  270. package/dist/document/expression/compile.js.map +1 -1
  271. package/dist/document/expression/index.js.map +1 -1
  272. package/dist/document/expression/ops.js +1 -1
  273. package/dist/document/expression/ops.js.map +1 -1
  274. package/dist/document/expression/parse.d.ts.map +1 -1
  275. package/dist/document/expression/parse.js +15 -6
  276. package/dist/document/expression/parse.js.map +1 -1
  277. package/dist/document/expression/refs.d.ts +1 -1
  278. package/dist/document/expression/refs.js +1 -1
  279. package/dist/document/expression/refs.js.map +1 -1
  280. package/dist/document/expression/types.js.map +1 -1
  281. package/dist/document/expression/walk.d.ts.map +1 -1
  282. package/dist/document/expression/walk.js +2 -1
  283. package/dist/document/expression/walk.js.map +1 -1
  284. package/dist/document/index.d.ts +2 -0
  285. package/dist/document/index.d.ts.map +1 -1
  286. package/dist/document/index.js +2 -0
  287. package/dist/document/index.js.map +1 -1
  288. package/dist/document/node-decorator.js.map +1 -1
  289. package/dist/document/node-descriptor.d.ts +19 -0
  290. package/dist/document/node-descriptor.d.ts.map +1 -1
  291. package/dist/document/node-descriptor.js.map +1 -1
  292. package/dist/document/placement.d.ts +70 -0
  293. package/dist/document/placement.d.ts.map +1 -0
  294. package/dist/document/placement.js +83 -0
  295. package/dist/document/placement.js.map +1 -0
  296. package/dist/document/project.d.ts +2 -2
  297. package/dist/document/project.d.ts.map +1 -1
  298. package/dist/document/project.js.map +1 -1
  299. package/dist/document/registry.d.ts +17 -0
  300. package/dist/document/registry.d.ts.map +1 -1
  301. package/dist/document/registry.js +29 -2
  302. package/dist/document/registry.js.map +1 -1
  303. package/dist/document/timeline-patch.js.map +1 -1
  304. package/dist/document/timeline.d.ts +73 -18
  305. package/dist/document/timeline.d.ts.map +1 -1
  306. package/dist/document/timeline.js +192 -40
  307. package/dist/document/timeline.js.map +1 -1
  308. package/dist/document/types.d.ts +12 -12
  309. package/dist/document/types.d.ts.map +1 -1
  310. package/dist/document/types.js +2 -2
  311. package/dist/document/types.js.map +1 -1
  312. package/dist/document/validate.d.ts +2 -2
  313. package/dist/document/validate.d.ts.map +1 -1
  314. package/dist/document/validate.js +37 -31
  315. package/dist/document/validate.js.map +1 -1
  316. package/dist/document/withdraw.d.ts +28 -0
  317. package/dist/document/withdraw.d.ts.map +1 -0
  318. package/dist/document/withdraw.js +61 -0
  319. package/dist/document/withdraw.js.map +1 -0
  320. package/dist/index.d.ts +1 -0
  321. package/dist/index.d.ts.map +1 -1
  322. package/dist/index.js +1 -0
  323. package/dist/index.js.map +1 -1
  324. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  325. package/dist/jsx/jsx-runtime.d.ts +9 -1
  326. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  327. package/dist/jsx/jsx-runtime.js +13 -3
  328. package/dist/jsx/jsx-runtime.js.map +1 -1
  329. package/dist/layout/bounds.d.ts +0 -1
  330. package/dist/layout/bounds.d.ts.map +1 -1
  331. package/dist/layout/bounds.js.map +1 -1
  332. package/dist/layout/constraints.js.map +1 -1
  333. package/dist/layout/flex.d.ts +4 -2
  334. package/dist/layout/flex.d.ts.map +1 -1
  335. package/dist/layout/flex.js +27 -11
  336. package/dist/layout/flex.js.map +1 -1
  337. package/dist/layout/freeform.js.map +1 -1
  338. package/dist/layout/grid.js.map +1 -1
  339. package/dist/layout/index.js.map +1 -1
  340. package/dist/layout/item.js.map +1 -1
  341. package/dist/layout/ops.d.ts +6 -0
  342. package/dist/layout/ops.d.ts.map +1 -1
  343. package/dist/layout/ops.js +6 -0
  344. package/dist/layout/ops.js.map +1 -1
  345. package/dist/layout/types.js.map +1 -1
  346. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  347. package/dist/nodes/2d/node-motion.js.map +1 -1
  348. package/dist/nodes/2d/node-render.d.ts +3 -3
  349. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  350. package/dist/nodes/2d/node-render.js.map +1 -1
  351. package/dist/nodes/2d/node-transform.js.map +1 -1
  352. package/dist/nodes/2d/node2d.d.ts +115 -3
  353. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  354. package/dist/nodes/2d/node2d.js +180 -28
  355. package/dist/nodes/2d/node2d.js.map +1 -1
  356. package/dist/nodes/2d/paint-node.d.ts +27 -0
  357. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  358. package/dist/nodes/2d/paint-node.js +42 -0
  359. package/dist/nodes/2d/paint-node.js.map +1 -1
  360. package/dist/nodes/audio/audio-bus.js.map +1 -1
  361. package/dist/nodes/audio/index.js.map +1 -1
  362. package/dist/nodes/audio/node-audio.js.map +1 -1
  363. package/dist/nodes/audio/sound-node.d.ts +2 -2
  364. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  365. package/dist/nodes/audio/sound-node.js +1 -1
  366. package/dist/nodes/audio/sound-node.js.map +1 -1
  367. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  368. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  369. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  370. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  371. package/dist/nodes/geometry/box-path-node.js +2 -2
  372. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  373. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  374. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  375. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  376. package/dist/nodes/geometry/group-bounds.js +1 -2
  377. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  378. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  379. package/dist/nodes/geometry/path-node.js +6 -0
  380. package/dist/nodes/geometry/path-node.js.map +1 -1
  381. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  382. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  383. package/dist/nodes/geometry/rect-node.js.map +1 -1
  384. package/dist/nodes/geometry/shape-node.js.map +1 -1
  385. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  386. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  387. package/dist/nodes/geometry/shape-outline.js +2 -13
  388. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  389. package/dist/nodes/index.d.ts +3 -8
  390. package/dist/nodes/index.d.ts.map +1 -1
  391. package/dist/nodes/index.js +3 -8
  392. package/dist/nodes/index.js.map +1 -1
  393. package/dist/nodes/layout/camera-node.d.ts +9 -0
  394. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  395. package/dist/nodes/layout/camera-node.js +38 -3
  396. package/dist/nodes/layout/camera-node.js.map +1 -1
  397. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  398. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  399. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  400. package/dist/nodes/layout/rotated-box.js.map +1 -1
  401. package/dist/nodes/media/video-node.d.ts.map +1 -1
  402. package/dist/nodes/media/video-node.js +2 -0
  403. package/dist/nodes/media/video-node.js.map +1 -1
  404. package/dist/nodes/node/declare-paints.js.map +1 -1
  405. package/dist/nodes/node/node-editor-state.js.map +1 -1
  406. package/dist/nodes/node/node-reactive.js.map +1 -1
  407. package/dist/nodes/node/node-time.d.ts +3 -3
  408. package/dist/nodes/node/node-time.d.ts.map +1 -1
  409. package/dist/nodes/node/node-time.js +1 -1
  410. package/dist/nodes/node/node-time.js.map +1 -1
  411. package/dist/nodes/node/node-walk.js.map +1 -1
  412. package/dist/nodes/node/node.d.ts +5 -3
  413. package/dist/nodes/node/node.d.ts.map +1 -1
  414. package/dist/nodes/node/node.js +44 -19
  415. package/dist/nodes/node/node.js.map +1 -1
  416. package/dist/nodes/node/text-defaults.d.ts +10 -12
  417. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  418. package/dist/nodes/node/text-defaults.js +10 -12
  419. package/dist/nodes/node/text-defaults.js.map +1 -1
  420. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  421. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  422. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  423. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  424. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  425. package/dist/nodes/root/provider-node.js.map +1 -0
  426. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  427. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  428. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  429. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  430. package/dist/nodes/text/default-text-style-node.js +10 -4
  431. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  432. package/dist/nodes/text/number-format.d.ts +1 -1
  433. package/dist/nodes/text/number-format.js +1 -1
  434. package/dist/nodes/text/number-format.js.map +1 -1
  435. package/dist/nodes/text/number-node.js.map +1 -1
  436. package/dist/nodes/text/number-pattern.js.map +1 -1
  437. package/dist/nodes/text/richtext-node.js +1 -1
  438. package/dist/nodes/text/richtext-node.js.map +1 -1
  439. package/dist/nodes/text/text-base.d.ts.map +1 -1
  440. package/dist/nodes/text/text-base.js +1 -1
  441. package/dist/nodes/text/text-base.js.map +1 -1
  442. package/dist/nodes/text/text-node.js.map +1 -1
  443. package/dist/nodes/text/text-selection.js.map +1 -1
  444. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  445. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  446. package/dist/nodes/three/camera-nodes.js +42 -1
  447. package/dist/nodes/three/camera-nodes.js.map +1 -1
  448. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  449. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  450. package/dist/nodes/three/canvas3d-node.js +44 -2
  451. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  452. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  453. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  454. package/dist/nodes/three/drawable-nodes.js +43 -13
  455. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  456. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  457. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/environment-nodes.js.map +1 -1
  459. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  460. package/dist/nodes/three/geometry-nodes.js +2 -2
  461. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  462. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  463. package/dist/nodes/three/group3d.js.map +1 -1
  464. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  465. package/dist/nodes/three/light-nodes.js +3 -3
  466. package/dist/nodes/three/light-nodes.js.map +1 -1
  467. package/dist/nodes/three/mesh3d.js.map +1 -1
  468. package/dist/nodes/three/node3d.d.ts +48 -0
  469. package/dist/nodes/three/node3d.d.ts.map +1 -1
  470. package/dist/nodes/three/node3d.js +53 -3
  471. package/dist/nodes/three/node3d.js.map +1 -1
  472. package/dist/platform/audio-sink.d.ts +2 -2
  473. package/dist/platform/audio-sink.d.ts.map +1 -1
  474. package/dist/platform/audio-sink.js.map +1 -1
  475. package/dist/platform/exporter.d.ts +13 -8
  476. package/dist/platform/exporter.d.ts.map +1 -1
  477. package/dist/platform/exporter.js.map +1 -1
  478. package/dist/platform/index.d.ts +1 -1
  479. package/dist/platform/index.d.ts.map +1 -1
  480. package/dist/platform/index.js.map +1 -1
  481. package/dist/platform/stepped-clock.js.map +1 -1
  482. package/dist/platform/storage-adapter.d.ts +12 -6
  483. package/dist/platform/storage-adapter.d.ts.map +1 -1
  484. package/dist/platform/storage-adapter.js +4 -0
  485. package/dist/platform/storage-adapter.js.map +1 -1
  486. package/dist/platform/ticker.d.ts +6 -0
  487. package/dist/platform/ticker.d.ts.map +1 -1
  488. package/dist/platform/ticker.js +6 -0
  489. package/dist/platform/ticker.js.map +1 -1
  490. package/dist/project/config.js.map +1 -1
  491. package/dist/project/index.js.map +1 -1
  492. package/dist/project/tree.d.ts +3 -3
  493. package/dist/project/tree.d.ts.map +1 -1
  494. package/dist/project/tree.js.map +1 -1
  495. package/dist/props/host.js.map +1 -1
  496. package/dist/props/index.js.map +1 -1
  497. package/dist/props/observer.js.map +1 -1
  498. package/dist/props/slot.js.map +1 -1
  499. package/dist/renamed-scene-names.d.ts +17 -0
  500. package/dist/renamed-scene-names.d.ts.map +1 -0
  501. package/dist/renamed-scene-names.js +9 -0
  502. package/dist/renamed-scene-names.js.map +1 -0
  503. package/dist/render/canvas-render-context2d.d.ts +2 -2
  504. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  505. package/dist/render/canvas-render-context2d.js.map +1 -1
  506. package/dist/render/clip-contains.js.map +1 -1
  507. package/dist/render/clip.js.map +1 -1
  508. package/dist/render/descriptors/ellipse.js.map +1 -1
  509. package/dist/render/descriptors/latex.js.map +1 -1
  510. package/dist/render/descriptors/line.js.map +1 -1
  511. package/dist/render/descriptors/path-builder.js.map +1 -1
  512. package/dist/render/descriptors/path.js.map +1 -1
  513. package/dist/render/descriptors/polygon.js.map +1 -1
  514. package/dist/render/descriptors/polygram.js.map +1 -1
  515. package/dist/render/descriptors/rect.js.map +1 -1
  516. package/dist/render/descriptors/richtext.js.map +1 -1
  517. package/dist/render/descriptors/shape.d.ts +12 -0
  518. package/dist/render/descriptors/shape.d.ts.map +1 -1
  519. package/dist/render/descriptors/shape.js.map +1 -1
  520. package/dist/render/descriptors/text.d.ts +2 -2
  521. package/dist/render/descriptors/text.js +2 -2
  522. package/dist/render/descriptors/text.js.map +1 -1
  523. package/dist/render/descriptors/transform.d.ts +2 -2
  524. package/dist/render/descriptors/transform.d.ts.map +1 -1
  525. package/dist/render/descriptors/transform.js.map +1 -1
  526. package/dist/render/graphics2d.d.ts +3 -3
  527. package/dist/render/graphics2d.d.ts.map +1 -1
  528. package/dist/render/graphics2d.js +1 -1
  529. package/dist/render/graphics2d.js.map +1 -1
  530. package/dist/render/index.js.map +1 -1
  531. package/dist/render/measure-context.js.map +1 -1
  532. package/dist/render/null-render-context.js.map +1 -1
  533. package/dist/render/render-context2d.d.ts +2 -2
  534. package/dist/render/render-context2d.d.ts.map +1 -1
  535. package/dist/render/render-context2d.js.map +1 -1
  536. package/dist/render/surface.js.map +1 -1
  537. package/dist/render/text-defaults.js.map +1 -1
  538. package/dist/render/text-layout.js.map +1 -1
  539. package/dist/render3d/bounds3d.d.ts.map +1 -1
  540. package/dist/render3d/bounds3d.js +4 -2
  541. package/dist/render3d/bounds3d.js.map +1 -1
  542. package/dist/render3d/builders.js.map +1 -1
  543. package/dist/render3d/camera.d.ts +6 -0
  544. package/dist/render3d/camera.d.ts.map +1 -1
  545. package/dist/render3d/camera.js +5 -3
  546. package/dist/render3d/camera.js.map +1 -1
  547. package/dist/render3d/fill3d.d.ts +2 -9
  548. package/dist/render3d/fill3d.d.ts.map +1 -1
  549. package/dist/render3d/fill3d.js +2 -13
  550. package/dist/render3d/fill3d.js.map +1 -1
  551. package/dist/render3d/geometry.d.ts +8 -1
  552. package/dist/render3d/geometry.d.ts.map +1 -1
  553. package/dist/render3d/geometry.js.map +1 -1
  554. package/dist/render3d/graphics3d.d.ts +8 -4
  555. package/dist/render3d/graphics3d.d.ts.map +1 -1
  556. package/dist/render3d/graphics3d.js +18 -10
  557. package/dist/render3d/graphics3d.js.map +1 -1
  558. package/dist/render3d/index.d.ts +1 -1
  559. package/dist/render3d/index.js +1 -1
  560. package/dist/render3d/index.js.map +1 -1
  561. package/dist/render3d/inert.d.ts +14 -0
  562. package/dist/render3d/inert.d.ts.map +1 -0
  563. package/dist/render3d/inert.js +62 -0
  564. package/dist/render3d/inert.js.map +1 -0
  565. package/dist/render3d/light.js.map +1 -1
  566. package/dist/render3d/material.d.ts +10 -5
  567. package/dist/render3d/material.d.ts.map +1 -1
  568. package/dist/render3d/material.js.map +1 -1
  569. package/dist/render3d/matrix4.js.map +1 -1
  570. package/dist/render3d/render-context3d.js.map +1 -1
  571. package/dist/render3d/resources.js.map +1 -1
  572. package/dist/render3d/rounded-box.js.map +1 -1
  573. package/dist/render3d/scene-settings.d.ts +23 -4
  574. package/dist/render3d/scene-settings.d.ts.map +1 -1
  575. package/dist/render3d/scene-settings.js.map +1 -1
  576. package/dist/render3d/scene3d.d.ts +11 -0
  577. package/dist/render3d/scene3d.d.ts.map +1 -1
  578. package/dist/render3d/scene3d.js +39 -6
  579. package/dist/render3d/scene3d.js.map +1 -1
  580. package/dist/render3d/segments.js.map +1 -1
  581. package/dist/render3d/texture.d.ts +9 -0
  582. package/dist/render3d/texture.d.ts.map +1 -1
  583. package/dist/render3d/texture.js +13 -0
  584. package/dist/render3d/texture.js.map +1 -1
  585. package/dist/render3d/tracking.js.map +1 -1
  586. package/dist/render3d/transform.d.ts +1 -1
  587. package/dist/render3d/transform.js.map +1 -1
  588. package/dist/render3d/vector3.d.ts +18 -1
  589. package/dist/render3d/vector3.d.ts.map +1 -1
  590. package/dist/render3d/vector3.js +27 -0
  591. package/dist/render3d/vector3.js.map +1 -1
  592. package/dist/render3d/walk.d.ts +1 -1
  593. package/dist/render3d/walk.d.ts.map +1 -1
  594. package/dist/render3d/walk.js +5 -1
  595. package/dist/render3d/walk.js.map +1 -1
  596. package/dist/runtime/asset-refine.js.map +1 -1
  597. package/dist/runtime/asset-timeline.js.map +1 -1
  598. package/dist/runtime/asset-update.js.map +1 -1
  599. package/dist/runtime/audio-index.js.map +1 -1
  600. package/dist/runtime/builtin-context.js.map +1 -1
  601. package/dist/runtime/clip-instance.d.ts +5 -3
  602. package/dist/runtime/clip-instance.d.ts.map +1 -1
  603. package/dist/runtime/clip-instance.js +10 -6
  604. package/dist/runtime/clip-instance.js.map +1 -1
  605. package/dist/runtime/clip-store.d.ts +9 -0
  606. package/dist/runtime/clip-store.d.ts.map +1 -1
  607. package/dist/runtime/clip-store.js +19 -0
  608. package/dist/runtime/clip-store.js.map +1 -1
  609. package/dist/runtime/engine.d.ts +5 -0
  610. package/dist/runtime/engine.d.ts.map +1 -1
  611. package/dist/runtime/engine.js +2 -0
  612. package/dist/runtime/engine.js.map +1 -1
  613. package/dist/runtime/frame-time.d.ts +31 -0
  614. package/dist/runtime/frame-time.d.ts.map +1 -0
  615. package/dist/runtime/frame-time.js +29 -0
  616. package/dist/runtime/frame-time.js.map +1 -0
  617. package/dist/runtime/index.d.ts +1 -0
  618. package/dist/runtime/index.d.ts.map +1 -1
  619. package/dist/runtime/index.js +1 -0
  620. package/dist/runtime/index.js.map +1 -1
  621. package/dist/runtime/node-picking.d.ts +44 -3
  622. package/dist/runtime/node-picking.d.ts.map +1 -1
  623. package/dist/runtime/node-picking.js +118 -3
  624. package/dist/runtime/node-picking.js.map +1 -1
  625. package/dist/runtime/node-picking3d.d.ts +2 -1
  626. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  627. package/dist/runtime/node-picking3d.js +5 -2
  628. package/dist/runtime/node-picking3d.js.map +1 -1
  629. package/dist/runtime/placement.d.ts.map +1 -1
  630. package/dist/runtime/placement.js +4 -5
  631. package/dist/runtime/placement.js.map +1 -1
  632. package/dist/runtime/playback-controller.d.ts +31 -2
  633. package/dist/runtime/playback-controller.d.ts.map +1 -1
  634. package/dist/runtime/playback-controller.js +63 -6
  635. package/dist/runtime/playback-controller.js.map +1 -1
  636. package/dist/runtime/playback.js.map +1 -1
  637. package/dist/runtime/precompisition.js.map +1 -1
  638. package/dist/runtime/project-assets.js.map +1 -1
  639. package/dist/runtime/session.d.ts +9 -7
  640. package/dist/runtime/session.d.ts.map +1 -1
  641. package/dist/runtime/session.js +12 -4
  642. package/dist/runtime/session.js.map +1 -1
  643. package/dist/runtime/settle.js.map +1 -1
  644. package/dist/runtime/state-evaluator.d.ts +1 -1
  645. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  646. package/dist/runtime/state-evaluator.js +4 -3
  647. package/dist/runtime/state-evaluator.js.map +1 -1
  648. package/dist/runtime/text-geometry.js.map +1 -1
  649. package/dist/sdk/index.d.ts +19 -15
  650. package/dist/sdk/index.d.ts.map +1 -1
  651. package/dist/sdk/index.js +11 -6
  652. package/dist/sdk/index.js.map +1 -1
  653. package/dist/tween/command-decorator.d.ts +2 -0
  654. package/dist/tween/command-decorator.d.ts.map +1 -1
  655. package/dist/tween/command-decorator.js.map +1 -1
  656. package/dist/tween/command.js.map +1 -1
  657. package/dist/tween/ease/constants.d.ts.map +1 -1
  658. package/dist/tween/ease/constants.js +8 -5
  659. package/dist/tween/ease/constants.js.map +1 -1
  660. package/dist/tween/ease/curve.d.ts.map +1 -1
  661. package/dist/tween/ease/curve.js +4 -3
  662. package/dist/tween/ease/curve.js.map +1 -1
  663. package/dist/tween/ease/describe.d.ts +15 -0
  664. package/dist/tween/ease/describe.d.ts.map +1 -0
  665. package/dist/tween/ease/describe.js +37 -0
  666. package/dist/tween/ease/describe.js.map +1 -0
  667. package/dist/tween/ease/type.js.map +1 -1
  668. package/dist/tween/index.js.map +1 -1
  669. package/dist/tween/inert.js.map +1 -1
  670. package/dist/tween/lerp.js.map +1 -1
  671. package/dist/tween/loop.js.map +1 -1
  672. package/dist/tween/prepare.d.ts +3 -3
  673. package/dist/tween/prepare.js +3 -3
  674. package/dist/tween/prepare.js.map +1 -1
  675. package/dist/tween/seekable.d.ts +1 -1
  676. package/dist/tween/seekable.js.map +1 -1
  677. package/dist/tween/stepper.js.map +1 -1
  678. package/dist/tween/to-command.js.map +1 -1
  679. package/dist/util/clamp.js.map +1 -1
  680. package/dist/util/context.js.map +1 -1
  681. package/dist/util/csv.js.map +1 -1
  682. package/dist/util/generateList.js.map +1 -1
  683. package/dist/util/index.js.map +1 -1
  684. package/dist/util/metrics.d.ts +1 -1
  685. package/dist/util/metrics.js +1 -1
  686. package/dist/util/metrics.js.map +1 -1
  687. package/dist/util/random.js.map +1 -1
  688. package/dist/util/reference.js.map +1 -1
  689. package/dist/util/scheduler.js.map +1 -1
  690. package/package.json +2 -1
  691. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  692. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  693. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  694. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  695. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  696. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  697. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  698. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  699. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  700. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  701. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  702. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  703. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  704. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  705. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  706. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  707. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  708. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  709. package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
  710. package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
  711. package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
  712. package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
  713. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  714. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  715. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  716. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  717. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  718. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  719. package/dist/nodes/geometry/grid-lines.js +0 -128
  720. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  721. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  722. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  723. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  724. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  725. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  726. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  727. package/dist/nodes/geometry/line-grid-node.js +0 -127
  728. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  729. package/dist/nodes/geometry/line-node.d.ts +0 -58
  730. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  731. package/dist/nodes/geometry/line-node.js +0 -123
  732. package/dist/nodes/geometry/line-node.js.map +0 -1
  733. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  734. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  735. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  736. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  737. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  738. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  739. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  740. package/dist/nodes/scene/provider-node.js.map +0 -1
  741. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  742. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  743. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  744. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  745. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  746. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -34,15 +34,11 @@ export type { BitCrushEffect, BitCrushPalette } from "./implementations/bit-crus
34
34
  export type { AsciiEffect, AsciiCharset } from "./implementations/ascii.js";
35
35
  export type { StreakEffect } from "./implementations/streak.js";
36
36
  export type { GlowChannel, GlowEffect, GlowLoopStyle, GlowOriginal, GlowTint } from "./implementations/glow.js";
37
- export type { GodRaysEffect } from "./implementations/god-rays.js";
38
37
  export type { OilPaintEffect } from "./implementations/oil-paint.js";
39
- export type { TextureEffect } from "./implementations/texture.js";
40
- export type { DisplaceEffect, DisplaceChannel } from "./implementations/displace.js";
41
38
  export type { WaveEffect, WaveShape } from "./implementations/wave.js";
42
39
  export type { TwirlEffect } from "./implementations/twirl.js";
43
40
  export type { ProgressiveBlurEffect, ProgressiveBlurShape } from "./implementations/progressive-blur.js";
44
41
  export type { KaleidoscopeEffect } from "./implementations/kaleidoscope.js";
45
- export type { TrailsEffect } from "./implementations/trails.js";
46
42
  export type { GlassEffect } from "./implementations/glass.js";
47
43
  export type { LutEffect } from "./implementations/lut.js";
48
44
  export { ASCII_CHARSETS, resolveAsciiCharset } from "./implementations/ascii.js";
@@ -50,7 +46,7 @@ export { ASCII_CHARSETS, resolveAsciiCharset } from "./implementations/ascii.js"
50
46
  export { Effects, EffectChain, resolveChainEffects, effectsOps } from './chain.js';
51
47
  export type { Effect } from './chain.js';
52
48
  /** Per-effect builder options. Every builder takes exactly one of these. */
53
- export type { BlurOptions, DirectionalBlurOptions, GrayscaleOptions, PixelateOptions, BulgeOptions, MagnifyOptions, BloomOptions, VintageOptions, ChromaticAberrationOptions, InvertOptions, ScatterOptions, PosterizeOptions, MotionBlurOptions, ShaderEffectOptions, OutlineOptions, VignetteOptions, GrainOptions, SharpenOptions, EdgesOptions, ThresholdOptions, RadialBlurOptions, HalftoneOptions, DitherOptions, DuotoneOptions, CurvesOptions, ColorAdjustmentOptions, LutOptions, RgbShiftOptions, ScanlinesOptions, BlockDisplaceOptions, BitCrushOptions, AsciiOptions, StreakOptions, GlowOptions, GodRaysOptions, OilPaintOptions, TextureOptions, DisplaceOptions, WaveOptions, TwirlOptions, ProgressiveBlurOptions, KaleidoscopeOptions, TrailsOptions, GlassOptions, } from './chain.js';
49
+ export type { BlurOptions, DirectionalBlurOptions, GrayscaleOptions, PixelateOptions, BulgeOptions, MagnifyOptions, BloomOptions, VintageOptions, ChromaticAberrationOptions, InvertOptions, ScatterOptions, PosterizeOptions, MotionBlurOptions, ShaderEffectOptions, OutlineOptions, VignetteOptions, GrainOptions, SharpenOptions, EdgesOptions, ThresholdOptions, RadialBlurOptions, HalftoneOptions, DitherOptions, DuotoneOptions, CurvesOptions, ColorAdjustmentOptions, LutOptions, RgbShiftOptions, ScanlinesOptions, BlockDisplaceOptions, BitCrushOptions, AsciiOptions, StreakOptions, GlowOptions, OilPaintOptions, WaveOptions, TwirlOptions, ProgressiveBlurOptions, KaleidoscopeOptions, GlassOptions, } from './chain.js';
54
50
  export type { EffectData, EffectMode, EffectSurface, EffectAxis, EffectOptions, ModedEffect } from './effect-data.js';
55
51
  export { EFFECT_OPTION_KEYS, withEffectOptions, resolveEffectAxis, sameEffectAxis } from './effect-data.js';
56
52
  export { resolveEffectColor, sameEffectColor } from './effect-data.js';
@@ -58,5 +54,5 @@ export { lerpEffect, effectSurface } from './registry.js';
58
54
  /** Backdrop/foreground classification helpers. */
59
55
  export { isBackdropEffect, backdropEffects, foregroundShaderEffects } from './backdrop.js';
60
56
  /** Union of all concrete effect types accepted by scene nodes. */
61
- export { SceneEffect } from './union.js';
57
+ export { NodeEffect } from './union.js';
62
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;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,UAAU,EAAE,MAAM,SAAS,CAAC;AAChF,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,4EAA4E;AAC5E,YAAY,EACR,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,YAAY,GACf,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD,kDAAkD;AAClD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAExF,kEAAkE;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/index.ts"],"names":[],"mappings":"AAAA,k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","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAiC3E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,uEAAuE;AACvE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAoDhF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD,kDAAkD;AAClD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/** Effect data types for each built-in effect. */\nexport type { BlurEffect } from \"./implementations/blur\";\nexport type { DirectionalBlurEffect } from \"./implementations/directional-blur\";\nexport type { GrayscaleEffect } from \"./implementations/grayscale\";\nexport type { PixelateEffect } from \"./implementations/pixelate\";\nexport type { BulgeEffect } from \"./implementations/bulge\";\nexport type { MagnifyEffect } from \"./implementations/magnify\";\nexport type { BloomEffect } from \"./implementations/bloom\";\nexport type { VintageEffect } from \"./implementations/vintage\";\nexport type { ChromaticAberrationEffect } from \"./implementations/chromatic-aberration\";\nexport type { InvertEffect, InvertChannel } from \"./implementations/invert\";\nexport type { ScatterEffect } from \"./implementations/scatter\";\nexport type { PosterizeEffect } from \"./implementations/posterize\";\nexport type { MotionBlurEffect, MotionBlurAlignment } from \"./implementations/motion-blur\";\nexport { resolveMotionBlurAlignment } from \"./implementations/motion-blur\";\nexport type { ShaderEffect, SkSLEffect, SkSLUniform, SkSLUniformValue } from \"./implementations/shader\";\nexport type { OutlineEffect, OutlinePosition } from \"./implementations/outline\";\nexport type { DropShadowEffect } from \"./implementations/drop-shadow\";\nexport type { VignetteEffect } from \"./implementations/vignette\";\nexport type { GrainEffect } from \"./implementations/grain\";\nexport type { SharpenEffect } from \"./implementations/sharpen\";\nexport type { EdgesEffect, EdgeKernel } from \"./implementations/edges\";\nexport type { ThresholdEffect } from \"./implementations/threshold\";\nexport type { RadialBlurEffect, RadialBlurStyle } from \"./implementations/radial-blur\";\nexport type { HalftoneEffect, HalftoneShape, HalftoneSeparation } from \"./implementations/halftone\";\nexport type { DitherEffect, DitherMatrix, DitherNoise } from \"./implementations/dither\";\nexport type { DuotoneEffect } from \"./implementations/duotone\";\nexport type { CurvesEffect } from \"./implementations/curves\";\nexport type { ColorAdjustmentEffect } from \"./implementations/color-adjustment\";\nexport type { RgbShiftEffect } from \"./implementations/rgb-shift\";\nexport type { ScanlinesEffect } from \"./implementations/scanlines\";\nexport type { BlockDisplaceEffect } from \"./implementations/block-displace\";\nexport type { BitCrushEffect, BitCrushPalette } from \"./implementations/bit-crush\";\nexport type { AsciiEffect, AsciiCharset } from \"./implementations/ascii\";\nexport type { StreakEffect } from \"./implementations/streak\";\nexport type { GlowChannel, GlowEffect, GlowLoopStyle, GlowOriginal, GlowTint } from \"./implementations/glow\";\nexport type { GodRaysEffect } from \"./implementations/god-rays\";\nexport type { OilPaintEffect } from \"./implementations/oil-paint\";\nexport type { TextureEffect } from \"./implementations/texture\";\nexport type { DisplaceEffect, DisplaceChannel } from \"./implementations/displace\";\nexport type { WaveEffect, WaveShape } from \"./implementations/wave\";\nexport type { TwirlEffect } from \"./implementations/twirl\";\nexport type { ProgressiveBlurEffect, ProgressiveBlurShape } from \"./implementations/progressive-blur\";\nexport type { KaleidoscopeEffect } from \"./implementations/kaleidoscope\";\nexport type { TrailsEffect } from \"./implementations/trails\";\nexport type { GlassEffect } from \"./implementations/glass\";\nexport type { LutEffect } from \"./implementations/lut\";\nexport { ASCII_CHARSETS, resolveAsciiCharset } from \"./implementations/ascii\";\n\n/** Chainable effect builder API, chain class, and union input type. */\nexport { Effects, EffectChain, resolveChainEffects, effectsOps } from './chain';\nexport type { Effect } from './chain';\n\n/** Per-effect builder options. Every builder takes exactly one of these. */\nexport type {\n BlurOptions,\n DirectionalBlurOptions,\n GrayscaleOptions,\n PixelateOptions,\n BulgeOptions,\n MagnifyOptions,\n BloomOptions,\n VintageOptions,\n ChromaticAberrationOptions,\n InvertOptions,\n ScatterOptions,\n PosterizeOptions,\n MotionBlurOptions,\n ShaderEffectOptions,\n OutlineOptions,\n VignetteOptions,\n GrainOptions,\n SharpenOptions,\n EdgesOptions,\n ThresholdOptions,\n RadialBlurOptions,\n HalftoneOptions,\n DitherOptions,\n DuotoneOptions,\n CurvesOptions,\n ColorAdjustmentOptions,\n LutOptions,\n RgbShiftOptions,\n ScanlinesOptions,\n BlockDisplaceOptions,\n BitCrushOptions,\n AsciiOptions,\n StreakOptions,\n GlowOptions,\n GodRaysOptions,\n OilPaintOptions,\n TextureOptions,\n DisplaceOptions,\n WaveOptions,\n TwirlOptions,\n ProgressiveBlurOptions,\n KaleidoscopeOptions,\n TrailsOptions,\n GlassOptions,\n} from './chain';\n\nexport type { EffectData, EffectMode, EffectSurface, EffectAxis, EffectOptions, ModedEffect } from './effect-data';\nexport { EFFECT_OPTION_KEYS, withEffectOptions, resolveEffectAxis, sameEffectAxis } from './effect-data';\nexport { resolveEffectColor, sameEffectColor } from './effect-data';\nexport { lerpEffect, effectSurface } from './registry';\n\n/** Backdrop/foreground classification helpers. */\nexport { isBackdropEffect, backdropEffects, foregroundShaderEffects } from './backdrop';\n\n/** Union of all concrete effect types accepted by scene nodes. */\nexport { SceneEffect } from './union';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AA6B3E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,uEAAuE;AACvE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAgDhF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD,kDAAkD;AAClD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/** Effect data types for each built-in effect. */\r\nexport type { BlurEffect } from \"./implementations/blur\";\r\nexport type { DirectionalBlurEffect } from \"./implementations/directional-blur\";\r\nexport type { GrayscaleEffect } from \"./implementations/grayscale\";\r\nexport type { PixelateEffect } from \"./implementations/pixelate\";\r\nexport type { BulgeEffect } from \"./implementations/bulge\";\r\nexport type { MagnifyEffect } from \"./implementations/magnify\";\r\nexport type { BloomEffect } from \"./implementations/bloom\";\r\nexport type { VintageEffect } from \"./implementations/vintage\";\r\nexport type { ChromaticAberrationEffect } from \"./implementations/chromatic-aberration\";\r\nexport type { InvertEffect, InvertChannel } from \"./implementations/invert\";\r\nexport type { ScatterEffect } from \"./implementations/scatter\";\r\nexport type { PosterizeEffect } from \"./implementations/posterize\";\r\nexport type { MotionBlurEffect, MotionBlurAlignment } from \"./implementations/motion-blur\";\r\nexport { resolveMotionBlurAlignment } from \"./implementations/motion-blur\";\r\nexport type { ShaderEffect, SkSLEffect, SkSLUniform, SkSLUniformValue } from \"./implementations/shader\";\r\nexport type { OutlineEffect, OutlinePosition } from \"./implementations/outline\";\r\nexport type { DropShadowEffect } from \"./implementations/drop-shadow\";\r\nexport type { VignetteEffect } from \"./implementations/vignette\";\r\nexport type { GrainEffect } from \"./implementations/grain\";\r\nexport type { SharpenEffect } from \"./implementations/sharpen\";\r\nexport type { EdgesEffect, EdgeKernel } from \"./implementations/edges\";\r\nexport type { ThresholdEffect } from \"./implementations/threshold\";\r\nexport type { RadialBlurEffect, RadialBlurStyle } from \"./implementations/radial-blur\";\r\nexport type { HalftoneEffect, HalftoneShape, HalftoneSeparation } from \"./implementations/halftone\";\r\nexport type { DitherEffect, DitherMatrix, DitherNoise } from \"./implementations/dither\";\r\nexport type { DuotoneEffect } from \"./implementations/duotone\";\r\nexport type { CurvesEffect } from \"./implementations/curves\";\r\nexport type { ColorAdjustmentEffect } from \"./implementations/color-adjustment\";\r\nexport type { RgbShiftEffect } from \"./implementations/rgb-shift\";\r\nexport type { ScanlinesEffect } from \"./implementations/scanlines\";\r\nexport type { BlockDisplaceEffect } from \"./implementations/block-displace\";\r\nexport type { BitCrushEffect, BitCrushPalette } from \"./implementations/bit-crush\";\r\nexport type { AsciiEffect, AsciiCharset } from \"./implementations/ascii\";\r\nexport type { StreakEffect } from \"./implementations/streak\";\r\nexport type { GlowChannel, GlowEffect, GlowLoopStyle, GlowOriginal, GlowTint } from \"./implementations/glow\";\r\nexport type { OilPaintEffect } from \"./implementations/oil-paint\";\r\nexport type { WaveEffect, WaveShape } from \"./implementations/wave\";\r\nexport type { TwirlEffect } from \"./implementations/twirl\";\r\nexport type { ProgressiveBlurEffect, ProgressiveBlurShape } from \"./implementations/progressive-blur\";\r\nexport type { KaleidoscopeEffect } from \"./implementations/kaleidoscope\";\r\nexport type { GlassEffect } from \"./implementations/glass\";\r\nexport type { LutEffect } from \"./implementations/lut\";\r\nexport { ASCII_CHARSETS, resolveAsciiCharset } from \"./implementations/ascii\";\r\n\r\n/** Chainable effect builder API, chain class, and union input type. */\r\nexport { Effects, EffectChain, resolveChainEffects, effectsOps } from './chain';\r\nexport type { Effect } from './chain';\r\n\r\n/** Per-effect builder options. Every builder takes exactly one of these. */\r\nexport type {\r\n BlurOptions,\r\n DirectionalBlurOptions,\r\n GrayscaleOptions,\r\n PixelateOptions,\r\n BulgeOptions,\r\n MagnifyOptions,\r\n BloomOptions,\r\n VintageOptions,\r\n ChromaticAberrationOptions,\r\n InvertOptions,\r\n ScatterOptions,\r\n PosterizeOptions,\r\n MotionBlurOptions,\r\n ShaderEffectOptions,\r\n OutlineOptions,\r\n VignetteOptions,\r\n GrainOptions,\r\n SharpenOptions,\r\n EdgesOptions,\r\n ThresholdOptions,\r\n RadialBlurOptions,\r\n HalftoneOptions,\r\n DitherOptions,\r\n DuotoneOptions,\r\n CurvesOptions,\r\n ColorAdjustmentOptions,\r\n LutOptions,\r\n RgbShiftOptions,\r\n ScanlinesOptions,\r\n BlockDisplaceOptions,\r\n BitCrushOptions,\r\n AsciiOptions,\r\n StreakOptions,\r\n GlowOptions,\r\n OilPaintOptions,\r\n WaveOptions,\r\n TwirlOptions,\r\n ProgressiveBlurOptions,\r\n KaleidoscopeOptions,\r\n GlassOptions,\r\n} from './chain';\r\n\r\nexport type { EffectData, EffectMode, EffectSurface, EffectAxis, EffectOptions, ModedEffect } from './effect-data';\r\nexport { EFFECT_OPTION_KEYS, withEffectOptions, resolveEffectAxis, sameEffectAxis } from './effect-data';\r\nexport { resolveEffectColor, sameEffectColor } from './effect-data';\r\nexport { lerpEffect, effectSurface } from './registry';\r\n\r\n/** Backdrop/foreground classification helpers. */\r\nexport { isBackdropEffect, backdropEffects, foregroundShaderEffects } from './backdrop';\r\n\r\n/** Union of all concrete effect types accepted by scene nodes. */\r\nexport { NodeEffect } from './union';\r\n"]}
@@ -1,4 +1,4 @@
1
- import { SceneEffect } from "./union.js";
1
+ import { NodeEffect } from "./union.js";
2
2
  import { EffectSurface } from "./effect-data.js";
3
3
  import type { AssetScope } from "../../../assets/scope.js";
4
4
  /**
@@ -7,7 +7,7 @@ import type { AssetScope } from "../../../assets/scope.js";
7
7
  * Returns the effect untouched when its type registers no `resolve`, which is
8
8
  * every effect but one.
9
9
  */
10
- export declare function resolveEffect(effect: SceneEffect): SceneEffect;
10
+ export declare function resolveEffect(effect: NodeEffect): NodeEffect;
11
11
  /**
12
12
  * Every registered effect type, in registration order.
13
13
  *
@@ -21,8 +21,25 @@ export declare function hasEffect(type: string): boolean;
21
21
  * How a backend must realise `effect` — see {@link EffectSurface}. Unknown types
22
22
  * fall back to `"filter"`, the composable default.
23
23
  */
24
- export declare function effectSurface(effect: SceneEffect): EffectSurface;
25
- export declare function declareEffect(effect: SceneEffect, assets: AssetScope): void;
26
- /** @internal */
27
- export declare function lerpEffect(from: SceneEffect, to: SceneEffect, t: number): SceneEffect;
24
+ export declare function effectSurface(effect: NodeEffect): EffectSurface;
25
+ export declare function declareEffect(effect: NodeEffect, assets: AssetScope): void;
26
+ /**
27
+ * Interpolates two effects of the same type.
28
+ *
29
+ * The cross-cutting {@link EFFECT_OPTION_KEYS} (`mode`, `clip`) are carried here
30
+ * for every kind, switching at the midpoint like any non-interpolable value, so
31
+ * an effect's own `lerp` only has to describe its parameters and a new option
32
+ * cannot be dropped by one of 45 hand-written copies.
33
+ *
34
+ * @internal
35
+ */
36
+ export declare function lerpEffect(from: NodeEffect, to: NodeEffect, t: number): NodeEffect;
37
+ /**
38
+ * Do two effects describe the same look? The effect's own `equals` compares its
39
+ * parameters; the type and the cross-cutting {@link EFFECT_OPTION_KEYS} are
40
+ * compared here for every kind.
41
+ *
42
+ * @internal
43
+ */
44
+ export declare function equalsEffect(a: NodeEffect, b: NodeEffect): boolean;
28
45
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA+CtC,OAAO,EAAc,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA0EjD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAG9D;AAED;;;;;GAKG;AACH,eA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EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAKlE"}
@@ -32,17 +32,14 @@ import { bitCrushEffect } from "./implementations/bit-crush.js";
32
32
  import { asciiEffect } from "./implementations/ascii.js";
33
33
  import { streakEffect } from "./implementations/streak.js";
34
34
  import { glowEffect } from "./implementations/glow.js";
35
- import { godRaysEffect } from "./implementations/god-rays.js";
36
35
  import { oilPaintEffect } from "./implementations/oil-paint.js";
37
- import { textureEffect } from "./implementations/texture.js";
38
- import { displaceEffect } from "./implementations/displace.js";
39
36
  import { waveEffect } from "./implementations/wave.js";
40
37
  import { twirlEffect } from "./implementations/twirl.js";
41
38
  import { progressiveBlurEffect } from "./implementations/progressive-blur.js";
42
39
  import { kaleidoscopeEffect } from "./implementations/kaleidoscope.js";
43
- import { trailsEffect } from "./implementations/trails.js";
44
40
  import { glassEffect } from "./implementations/glass.js";
45
41
  import { lutEffect } from "./implementations/lut.js";
42
+ import { EFFECT_OPTION_KEYS } from "./effect-data.js";
46
43
  const EFFECTS = new Map([
47
44
  ["blur", blurEffect],
48
45
  ["directionalBlur", directionalBlurEffect],
@@ -78,15 +75,11 @@ const EFFECTS = new Map([
78
75
  ["ascii", asciiEffect],
79
76
  ["streak", streakEffect],
80
77
  ["glow", glowEffect],
81
- ["godRays", godRaysEffect],
82
78
  ["oilPaint", oilPaintEffect],
83
- ["texture", textureEffect],
84
- ["displace", displaceEffect],
85
79
  ["wave", waveEffect],
86
80
  ["twirl", twirlEffect],
87
81
  ["progressiveBlur", progressiveBlurEffect],
88
82
  ["kaleidoscope", kaleidoscopeEffect],
89
- ["trails", trailsEffect],
90
83
  ["glass", glassEffect],
91
84
  ["lut", lutEffect],
92
85
  ]);
@@ -146,11 +139,52 @@ export function effectSurface(effect) {
146
139
  export function declareEffect(effect, assets) {
147
140
  dataFor(effect.type)?.declare?.(effect, assets);
148
141
  }
149
- /** @internal */
142
+ /**
143
+ * Interpolates two effects of the same type.
144
+ *
145
+ * The cross-cutting {@link EFFECT_OPTION_KEYS} (`mode`, `clip`) are carried here
146
+ * for every kind, switching at the midpoint like any non-interpolable value, so
147
+ * an effect's own `lerp` only has to describe its parameters and a new option
148
+ * cannot be dropped by one of 45 hand-written copies.
149
+ *
150
+ * @internal
151
+ */
150
152
  export function lerpEffect(from, to, t) {
151
153
  if (from.type !== to.type)
152
154
  return t < 0.5 ? from : to;
153
155
  const data = dataFor(from.type);
154
- return data ? data.lerp(from, to, t) : (t < 0.5 ? from : to);
156
+ if (!data)
157
+ return t < 0.5 ? from : to;
158
+ const lerped = data.lerp(from, to, t);
159
+ const source = t < 0.5 ? from : to;
160
+ let out;
161
+ for (const key of EFFECT_OPTION_KEYS) {
162
+ if (lerped[key] === source[key])
163
+ continue;
164
+ // Copy lazily, and omit rather than write `undefined`: the equality
165
+ // checks compare these fields directly.
166
+ out ??= { ...lerped };
167
+ const target = out;
168
+ if (source[key] === undefined)
169
+ delete target[key];
170
+ else
171
+ target[key] = source[key];
172
+ }
173
+ return out ?? lerped;
174
+ }
175
+ /**
176
+ * Do two effects describe the same look? The effect's own `equals` compares its
177
+ * parameters; the type and the cross-cutting {@link EFFECT_OPTION_KEYS} are
178
+ * compared here for every kind.
179
+ *
180
+ * @internal
181
+ */
182
+ export function equalsEffect(a, b) {
183
+ if (a.type !== b.type)
184
+ return false;
185
+ if (EFFECT_OPTION_KEYS.some((key) => a[key] !== b[key]))
186
+ return false;
187
+ const data = dataFor(a.type);
188
+ return data ? data.equals(a, b) : a === b;
155
189
  }
156
190
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,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AAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAC9C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC3C,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAmB,EAAE,MAAkB;IACjE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,UAAU,CAAC,IAAiB,EAAE,EAAe,EAAE,CAAS;IACpE,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI;QAAE,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACtD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import { SceneEffect } from \"./union\";\n\nimport { blurEffect } from \"./implementations/blur\";\nimport { directionalBlurEffect } from \"./implementations/directional-blur\";\nimport { grayscaleEffect } from \"./implementations/grayscale\";\nimport { pixelateEffect } from \"./implementations/pixelate\";\nimport { bulgeEffect } from \"./implementations/bulge\";\nimport { magnifyEffect } from \"./implementations/magnify\";\nimport { bloomEffect } from \"./implementations/bloom\";\nimport { vintageEffect } from \"./implementations/vintage\";\nimport { chromaticAberrationEffect } from \"./implementations/chromatic-aberration\";\nimport { invertEffect } from \"./implementations/invert\";\nimport { scatterEffect } from \"./implementations/scatter\";\nimport { posterizeEffect } from \"./implementations/posterize\";\nimport { motionBlurEffect } from \"./implementations/motion-blur\";\nimport { shaderEffect } from \"./implementations/shader\";\nimport { outlineEffect } from \"./implementations/outline\";\nimport { dropShadowEffect } from \"./implementations/drop-shadow\";\nimport { vignetteEffect } from \"./implementations/vignette\";\nimport { grainEffect } from \"./implementations/grain\";\nimport { sharpenEffect } from \"./implementations/sharpen\";\nimport { edgesEffect } from \"./implementations/edges\";\nimport { thresholdEffect } from \"./implementations/threshold\";\nimport { radialBlurEffect } from \"./implementations/radial-blur\";\nimport { halftoneEffect } from \"./implementations/halftone\";\nimport { ditherEffect } from \"./implementations/dither\";\nimport { duotoneEffect } from \"./implementations/duotone\";\nimport { curvesEffect } from \"./implementations/curves\";\nimport { colorAdjustmentEffect } from \"./implementations/color-adjustment\";\nimport { rgbShiftEffect } from \"./implementations/rgb-shift\";\nimport { scanlinesEffect } from \"./implementations/scanlines\";\nimport { blockDisplaceEffect } from \"./implementations/block-displace\";\nimport { bitCrushEffect } from \"./implementations/bit-crush\";\nimport { asciiEffect } from \"./implementations/ascii\";\nimport { streakEffect } from \"./implementations/streak\";\nimport { glowEffect } from \"./implementations/glow\";\nimport { godRaysEffect } from \"./implementations/god-rays\";\nimport { oilPaintEffect } from \"./implementations/oil-paint\";\nimport { textureEffect } from \"./implementations/texture\";\nimport { displaceEffect } from \"./implementations/displace\";\nimport { waveEffect } from \"./implementations/wave\";\nimport { twirlEffect } from \"./implementations/twirl\";\nimport { progressiveBlurEffect } from \"./implementations/progressive-blur\";\nimport { kaleidoscopeEffect } from \"./implementations/kaleidoscope\";\nimport { trailsEffect } from \"./implementations/trails\";\nimport { glassEffect } from \"./implementations/glass\";\nimport { lutEffect } from \"./implementations/lut\";\nimport { EffectData, EffectSurface } from \"./effect-data\";\nimport type { AssetScope } from \"@/assets/scope\";\n\n\nconst EFFECTS = new Map<string, EffectData<SceneEffect>>([\n [\"blur\", blurEffect as EffectData<SceneEffect>],\n [\"directionalBlur\", directionalBlurEffect as EffectData<SceneEffect>],\n [\"grayscale\", grayscaleEffect as EffectData<SceneEffect>],\n [\"pixelate\", pixelateEffect as EffectData<SceneEffect>],\n [\"bulge\", bulgeEffect as EffectData<SceneEffect>],\n [\"magnify\", magnifyEffect as EffectData<SceneEffect>],\n [\"bloom\", bloomEffect as EffectData<SceneEffect>],\n [\"vintage\", vintageEffect as EffectData<SceneEffect>],\n [\"chromaticAberration\", chromaticAberrationEffect as EffectData<SceneEffect>],\n [\"invert\", invertEffect as EffectData<SceneEffect>],\n [\"scatter\", scatterEffect as EffectData<SceneEffect>],\n [\"posterize\", posterizeEffect as EffectData<SceneEffect>],\n [\"motionBlur\", motionBlurEffect as EffectData<SceneEffect>],\n [\"shader\", shaderEffect as EffectData<SceneEffect>],\n [\"outline\", outlineEffect as EffectData<SceneEffect>],\n [\"dropShadow\", dropShadowEffect as EffectData<SceneEffect>],\n [\"vignette\", vignetteEffect as EffectData<SceneEffect>],\n [\"grain\", grainEffect as EffectData<SceneEffect>],\n [\"sharpen\", sharpenEffect as EffectData<SceneEffect>],\n [\"edges\", edgesEffect as EffectData<SceneEffect>],\n [\"threshold\", thresholdEffect as EffectData<SceneEffect>],\n [\"radialBlur\", radialBlurEffect as EffectData<SceneEffect>],\n [\"halftone\", halftoneEffect as EffectData<SceneEffect>],\n [\"dither\", ditherEffect as EffectData<SceneEffect>],\n [\"duotone\", duotoneEffect as EffectData<SceneEffect>],\n [\"curves\", curvesEffect as EffectData<SceneEffect>],\n [\"colorAdjustment\", colorAdjustmentEffect as EffectData<SceneEffect>],\n [\"rgbShift\", rgbShiftEffect as EffectData<SceneEffect>],\n [\"scanlines\", scanlinesEffect as EffectData<SceneEffect>],\n [\"blockDisplace\", blockDisplaceEffect as EffectData<SceneEffect>],\n [\"bitCrush\", bitCrushEffect as EffectData<SceneEffect>],\n [\"ascii\", asciiEffect as EffectData<SceneEffect>],\n [\"streak\", streakEffect as EffectData<SceneEffect>],\n [\"glow\", glowEffect as EffectData<SceneEffect>],\n [\"godRays\", godRaysEffect as EffectData<SceneEffect>],\n [\"oilPaint\", oilPaintEffect as EffectData<SceneEffect>],\n [\"texture\", textureEffect as EffectData<SceneEffect>],\n [\"displace\", displaceEffect as EffectData<SceneEffect>],\n [\"wave\", waveEffect as EffectData<SceneEffect>],\n [\"twirl\", twirlEffect as EffectData<SceneEffect>],\n [\"progressiveBlur\", progressiveBlurEffect as EffectData<SceneEffect>],\n [\"kaleidoscope\", kaleidoscopeEffect as EffectData<SceneEffect>],\n [\"trails\", trailsEffect as EffectData<SceneEffect>],\n [\"glass\", glassEffect as EffectData<SceneEffect>],\n [\"lut\", lutEffect as EffectData<SceneEffect>],\n]);\n\n/**\n * Older spellings of a type key, and what they mean now.\n *\n * Deliberately a second map rather than extra rows in {@link EFFECTS}: an alias\n * is not a type, and putting it there would grow `effectTypes()` a phantom\n * entry that the roster sweeps in the contract tests would then demand a neutral\n * and a handler for. A document naming an alias is rewritten to the current key\n * by that type's `resolve`, so the alias only has to survive long enough for\n * that to happen.\n */\nconst EFFECT_ALIASES = new Map<string, string>([\n // `sksl` named the dialect; `shader` names the paint it is the sibling of.\n [\"sksl\", \"shader\"],\n]);\n\n/** The data for `type`, following an alias if that is what it is. */\nfunction dataFor(type: string): EffectData<SceneEffect> | undefined {\n const direct = EFFECTS.get(type);\n if (direct) return direct;\n const alias = EFFECT_ALIASES.get(type);\n return alias ? EFFECTS.get(alias) : undefined;\n}\n\n/**\n * Normalise one authored effect — see {@link EffectData.resolve}.\n *\n * Returns the effect untouched when its type registers no `resolve`, which is\n * every effect but one.\n */\nexport function resolveEffect(effect: SceneEffect): SceneEffect {\n const data = dataFor(effect.type);\n return data?.resolve ? data.resolve(effect) : effect;\n}\n\n/**\n * Every registered effect type, in registration order.\n *\n * The roster itself, so a contract test can sweep the whole set rather than a\n * hand-kept list that silently misses whatever was added last.\n */\nexport const effectTypes = (): string[] => [...EFFECTS.keys()];\n\n/** True when `type` has a registered `EffectData` handler. */\nexport function hasEffect(type: string): boolean {\n return dataFor(type) !== undefined;\n}\n\n/**\n * How a backend must realise `effect` — see {@link EffectSurface}. Unknown types\n * fall back to `\"filter\"`, the composable default.\n */\nexport function effectSurface(effect: SceneEffect): EffectSurface {\n const surface = dataFor(effect.type)?.surface;\n if (surface === undefined) return \"filter\";\n return typeof surface === \"function\" ? surface(effect) : surface;\n}\n\nexport function declareEffect(effect: SceneEffect, assets: AssetScope): void {\n dataFor(effect.type)?.declare?.(effect, assets);\n}\n\n/** @internal */\nexport function lerpEffect(from: SceneEffect, to: SceneEffect, t: number): SceneEffect {\n if (from.type !== to.type) return t < 0.5 ? from : to;\n const data = dataFor(from.type);\n return data ? data.lerp(from, to, t) : (t < 0.5 ? from : to);\n}\n\n"]}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAA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\r\n\r\nimport { blurEffect } from \"./implementations/blur\";\r\nimport { directionalBlurEffect } from \"./implementations/directional-blur\";\r\nimport { grayscaleEffect } from \"./implementations/grayscale\";\r\nimport { pixelateEffect } from \"./implementations/pixelate\";\r\nimport { bulgeEffect } from \"./implementations/bulge\";\r\nimport { magnifyEffect } from \"./implementations/magnify\";\r\nimport { bloomEffect } from \"./implementations/bloom\";\r\nimport { vintageEffect } from \"./implementations/vintage\";\r\nimport { chromaticAberrationEffect } from \"./implementations/chromatic-aberration\";\r\nimport { invertEffect } from \"./implementations/invert\";\r\nimport { scatterEffect } from \"./implementations/scatter\";\r\nimport { posterizeEffect } from \"./implementations/posterize\";\r\nimport { motionBlurEffect } from \"./implementations/motion-blur\";\r\nimport { shaderEffect } from \"./implementations/shader\";\r\nimport { outlineEffect } from \"./implementations/outline\";\r\nimport { dropShadowEffect } from \"./implementations/drop-shadow\";\r\nimport { vignetteEffect } from \"./implementations/vignette\";\r\nimport { grainEffect } from \"./implementations/grain\";\r\nimport { sharpenEffect } from \"./implementations/sharpen\";\r\nimport { edgesEffect } from \"./implementations/edges\";\r\nimport { thresholdEffect } from \"./implementations/threshold\";\r\nimport { radialBlurEffect } from \"./implementations/radial-blur\";\r\nimport { halftoneEffect } from \"./implementations/halftone\";\r\nimport { ditherEffect } from \"./implementations/dither\";\r\nimport { duotoneEffect } from \"./implementations/duotone\";\r\nimport { curvesEffect } from \"./implementations/curves\";\r\nimport { colorAdjustmentEffect } from \"./implementations/color-adjustment\";\r\nimport { rgbShiftEffect } from \"./implementations/rgb-shift\";\r\nimport { scanlinesEffect } from \"./implementations/scanlines\";\r\nimport { blockDisplaceEffect } from \"./implementations/block-displace\";\r\nimport { bitCrushEffect } from \"./implementations/bit-crush\";\r\nimport { asciiEffect } from \"./implementations/ascii\";\r\nimport { streakEffect } from \"./implementations/streak\";\r\nimport { glowEffect } from \"./implementations/glow\";\r\nimport { oilPaintEffect } from \"./implementations/oil-paint\";\r\nimport { waveEffect } from \"./implementations/wave\";\r\nimport { twirlEffect } from \"./implementations/twirl\";\r\nimport { progressiveBlurEffect } from \"./implementations/progressive-blur\";\r\nimport { kaleidoscopeEffect } from \"./implementations/kaleidoscope\";\r\nimport { glassEffect } from \"./implementations/glass\";\r\nimport { lutEffect } from \"./implementations/lut\";\r\nimport { EffectData, EffectSurface, EFFECT_OPTION_KEYS } from \"./effect-data\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\n\r\n\r\nconst EFFECTS = new Map<string, EffectData<NodeEffect>>([\r\n [\"blur\", blurEffect as EffectData<NodeEffect>],\r\n [\"directionalBlur\", directionalBlurEffect as EffectData<NodeEffect>],\r\n [\"grayscale\", grayscaleEffect as EffectData<NodeEffect>],\r\n [\"pixelate\", pixelateEffect as EffectData<NodeEffect>],\r\n [\"bulge\", bulgeEffect as EffectData<NodeEffect>],\r\n [\"magnify\", magnifyEffect as EffectData<NodeEffect>],\r\n [\"bloom\", bloomEffect as EffectData<NodeEffect>],\r\n [\"vintage\", vintageEffect as EffectData<NodeEffect>],\r\n [\"chromaticAberration\", chromaticAberrationEffect as EffectData<NodeEffect>],\r\n [\"invert\", invertEffect as EffectData<NodeEffect>],\r\n [\"scatter\", scatterEffect as EffectData<NodeEffect>],\r\n [\"posterize\", posterizeEffect as EffectData<NodeEffect>],\r\n [\"motionBlur\", motionBlurEffect as EffectData<NodeEffect>],\r\n [\"shader\", shaderEffect as EffectData<NodeEffect>],\r\n [\"outline\", outlineEffect as EffectData<NodeEffect>],\r\n [\"dropShadow\", dropShadowEffect as EffectData<NodeEffect>],\r\n [\"vignette\", vignetteEffect as EffectData<NodeEffect>],\r\n [\"grain\", grainEffect as EffectData<NodeEffect>],\r\n [\"sharpen\", sharpenEffect as EffectData<NodeEffect>],\r\n [\"edges\", edgesEffect as EffectData<NodeEffect>],\r\n [\"threshold\", thresholdEffect as EffectData<NodeEffect>],\r\n [\"radialBlur\", radialBlurEffect as EffectData<NodeEffect>],\r\n [\"halftone\", halftoneEffect as EffectData<NodeEffect>],\r\n [\"dither\", ditherEffect as EffectData<NodeEffect>],\r\n [\"duotone\", duotoneEffect as EffectData<NodeEffect>],\r\n [\"curves\", curvesEffect as EffectData<NodeEffect>],\r\n [\"colorAdjustment\", colorAdjustmentEffect as EffectData<NodeEffect>],\r\n [\"rgbShift\", rgbShiftEffect as EffectData<NodeEffect>],\r\n [\"scanlines\", scanlinesEffect as EffectData<NodeEffect>],\r\n [\"blockDisplace\", blockDisplaceEffect as EffectData<NodeEffect>],\r\n [\"bitCrush\", bitCrushEffect as EffectData<NodeEffect>],\r\n [\"ascii\", asciiEffect as EffectData<NodeEffect>],\r\n [\"streak\", streakEffect as EffectData<NodeEffect>],\r\n [\"glow\", glowEffect as EffectData<NodeEffect>],\r\n [\"oilPaint\", oilPaintEffect as EffectData<NodeEffect>],\r\n [\"wave\", waveEffect as EffectData<NodeEffect>],\r\n [\"twirl\", twirlEffect as EffectData<NodeEffect>],\r\n [\"progressiveBlur\", progressiveBlurEffect as EffectData<NodeEffect>],\r\n [\"kaleidoscope\", kaleidoscopeEffect as EffectData<NodeEffect>],\r\n [\"glass\", glassEffect as EffectData<NodeEffect>],\r\n [\"lut\", lutEffect as EffectData<NodeEffect>],\r\n]);\r\n\r\n/**\r\n * Older spellings of a type key, and what they mean now.\r\n *\r\n * Deliberately a second map rather than extra rows in {@link EFFECTS}: an alias\r\n * is not a type, and putting it there would grow `effectTypes()` a phantom\r\n * entry that the roster sweeps in the contract tests would then demand a neutral\r\n * and a handler for. A document naming an alias is rewritten to the current key\r\n * by that type's `resolve`, so the alias only has to survive long enough for\r\n * that to happen.\r\n */\r\nconst EFFECT_ALIASES = new Map<string, string>([\r\n // `sksl` named the dialect; `shader` names the paint it is the sibling of.\r\n [\"sksl\", \"shader\"],\r\n]);\r\n\r\n/** The data for `type`, following an alias if that is what it is. */\r\nfunction dataFor(type: string): EffectData<NodeEffect> | undefined {\r\n const direct = EFFECTS.get(type);\r\n if (direct) return direct;\r\n const alias = EFFECT_ALIASES.get(type);\r\n return alias ? EFFECTS.get(alias) : undefined;\r\n}\r\n\r\n/**\r\n * Normalise one authored effect — see {@link EffectData.resolve}.\r\n *\r\n * Returns the effect untouched when its type registers no `resolve`, which is\r\n * every effect but one.\r\n */\r\nexport function resolveEffect(effect: NodeEffect): NodeEffect {\r\n const data = dataFor(effect.type);\r\n return data?.resolve ? data.resolve(effect) : effect;\r\n}\r\n\r\n/**\r\n * Every registered effect type, in registration order.\r\n *\r\n * The roster itself, so a contract test can sweep the whole set rather than a\r\n * hand-kept list that silently misses whatever was added last.\r\n */\r\nexport const effectTypes = (): string[] => [...EFFECTS.keys()];\r\n\r\n/** True when `type` has a registered `EffectData` handler. */\r\nexport function hasEffect(type: string): boolean {\r\n return dataFor(type) !== undefined;\r\n}\r\n\r\n/**\r\n * How a backend must realise `effect` — see {@link EffectSurface}. Unknown types\r\n * fall back to `\"filter\"`, the composable default.\r\n */\r\nexport function effectSurface(effect: NodeEffect): EffectSurface {\r\n const surface = dataFor(effect.type)?.surface;\r\n if (surface === undefined) return \"filter\";\r\n return typeof surface === \"function\" ? surface(effect) : surface;\r\n}\r\n\r\nexport function declareEffect(effect: NodeEffect, assets: AssetScope): void {\r\n dataFor(effect.type)?.declare?.(effect, assets);\r\n}\r\n\r\n/**\r\n * Interpolates two effects of the same type.\r\n *\r\n * The cross-cutting {@link EFFECT_OPTION_KEYS} (`mode`, `clip`) are carried here\r\n * for every kind, switching at the midpoint like any non-interpolable value, so\r\n * an effect's own `lerp` only has to describe its parameters and a new option\r\n * cannot be dropped by one of 45 hand-written copies.\r\n *\r\n * @internal\r\n */\r\nexport function lerpEffect(from: NodeEffect, to: NodeEffect, t: number): NodeEffect {\r\n if (from.type !== to.type) return t < 0.5 ? from : to;\r\n const data = dataFor(from.type);\r\n if (!data) return t < 0.5 ? from : to;\r\n const lerped = data.lerp(from, to, t);\r\n const source = t < 0.5 ? from : to;\r\n let out: NodeEffect | undefined;\r\n for (const key of EFFECT_OPTION_KEYS) {\r\n if (lerped[key] === source[key]) continue;\r\n // Copy lazily, and omit rather than write `undefined`: the equality\r\n // checks compare these fields directly.\r\n out ??= { ...lerped } as NodeEffect;\r\n const target = out as unknown as Record<string, unknown>;\r\n if (source[key] === undefined) delete target[key];\r\n else target[key] = source[key];\r\n }\r\n return out ?? lerped;\r\n}\r\n\r\n/**\r\n * Do two effects describe the same look? The effect's own `equals` compares its\r\n * parameters; the type and the cross-cutting {@link EFFECT_OPTION_KEYS} are\r\n * compared here for every kind.\r\n *\r\n * @internal\r\n */\r\nexport function equalsEffect(a: NodeEffect, b: NodeEffect): boolean {\r\n if (a.type !== b.type) return false;\r\n if (EFFECT_OPTION_KEYS.some((key) => a[key] !== b[key])) return false;\r\n const data = dataFor(a.type);\r\n return data ? data.equals(a, b) : a === b;\r\n}\r\n"]}
@@ -32,17 +32,13 @@ import type { BitCrushEffect } from "./implementations/bit-crush.js";
32
32
  import type { AsciiEffect } from "./implementations/ascii.js";
33
33
  import type { StreakEffect } from "./implementations/streak.js";
34
34
  import type { GlowEffect } from "./implementations/glow.js";
35
- import type { GodRaysEffect } from "./implementations/god-rays.js";
36
35
  import type { OilPaintEffect } from "./implementations/oil-paint.js";
37
- import type { TextureEffect } from "./implementations/texture.js";
38
- import type { DisplaceEffect } from "./implementations/displace.js";
39
36
  import type { WaveEffect } from "./implementations/wave.js";
40
37
  import type { TwirlEffect } from "./implementations/twirl.js";
41
38
  import type { ProgressiveBlurEffect } from "./implementations/progressive-blur.js";
42
39
  import type { KaleidoscopeEffect } from "./implementations/kaleidoscope.js";
43
- import type { TrailsEffect } from "./implementations/trails.js";
44
40
  import type { GlassEffect } from "./implementations/glass.js";
45
41
  import type { LutEffect } from "./implementations/lut.js";
46
- /** Discriminated union of every effect type a scene node can carry. */
47
- export type SceneEffect = BlurEffect | DirectionalBlurEffect | GrayscaleEffect | PixelateEffect | BulgeEffect | MagnifyEffect | BloomEffect | VintageEffect | ChromaticAberrationEffect | InvertEffect | ScatterEffect | PosterizeEffect | MotionBlurEffect | ShaderEffect | OutlineEffect | DropShadowEffect | VignetteEffect | GrainEffect | SharpenEffect | EdgesEffect | ThresholdEffect | RadialBlurEffect | HalftoneEffect | DitherEffect | DuotoneEffect | CurvesEffect | ColorAdjustmentEffect | RgbShiftEffect | ScanlinesEffect | BlockDisplaceEffect | BitCrushEffect | AsciiEffect | StreakEffect | GlowEffect | GodRaysEffect | OilPaintEffect | TextureEffect | DisplaceEffect | WaveEffect | TwirlEffect | ProgressiveBlurEffect | KaleidoscopeEffect | TrailsEffect | GlassEffect | LutEffect;
42
+ /** Discriminated union of every effect type a node can carry. */
43
+ export type NodeEffect = BlurEffect | DirectionalBlurEffect | GrayscaleEffect | PixelateEffect | BulgeEffect | MagnifyEffect | BloomEffect | VintageEffect | ChromaticAberrationEffect | InvertEffect | ScatterEffect | PosterizeEffect | MotionBlurEffect | ShaderEffect | OutlineEffect | DropShadowEffect | VignetteEffect | GrainEffect | SharpenEffect | EdgesEffect | ThresholdEffect | RadialBlurEffect | HalftoneEffect | DitherEffect | DuotoneEffect | CurvesEffect | ColorAdjustmentEffect | RgbShiftEffect | ScanlinesEffect | BlockDisplaceEffect | BitCrushEffect | AsciiEffect | StreakEffect | GlowEffect | OilPaintEffect | WaveEffect | TwirlEffect | ProgressiveBlurEffect | KaleidoscopeEffect | GlassEffect | LutEffect;
48
44
  //# sourceMappingURL=union.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBA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zB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,WAAW,GACX,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,qBAAqB,GACrB,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,cAAc,GACd,WAAW,GACX,YAAY,GACZ,UAAU,GACV,aAAa,GACb,cAAc,GACd,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,qBAAqB,GACrB,kBAAkB,GAClB,YAAY,GACZ,WAAW,GACX,SAAS,CAAC"}
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB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CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAChB,UAAU,GACV,qBAAqB,GACrB,eAAe,GACf,cAAc,GACd,WAAW,GACX,aAAa,GACb,WAAW,GACX,aAAa,GACb,yBAAyB,GACzB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,WAAW,GACX,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,qBAAqB,GACrB,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,cAAc,GACd,WAAW,GACX,YAAY,GACZ,UAAU,GACV,cAAc,GACd,UAAU,GACV,WAAW,GACX,qBAAqB,GACrB,kBAAkB,GAClB,WAAW,GACX,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/union.ts"],"names":[],"mappings":"","sourcesContent":["import type { BlurEffect } from \"./implementations/blur\";\nimport type { DirectionalBlurEffect } from \"./implementations/directional-blur\";\nimport type { GrayscaleEffect } from \"./implementations/grayscale\";\nimport type { PixelateEffect } from \"./implementations/pixelate\";\nimport type { BulgeEffect } from \"./implementations/bulge\";\nimport type { MagnifyEffect } from \"./implementations/magnify\";\nimport type { BloomEffect } from \"./implementations/bloom\";\nimport type { VintageEffect } from \"./implementations/vintage\";\nimport type { ChromaticAberrationEffect } from \"./implementations/chromatic-aberration\";\nimport type { InvertEffect } from \"./implementations/invert\";\nimport type { ScatterEffect } from \"./implementations/scatter\";\nimport type { PosterizeEffect } from \"./implementations/posterize\";\nimport type { MotionBlurEffect } from \"./implementations/motion-blur\";\nimport type { ShaderEffect } from \"./implementations/shader\";\nimport type { OutlineEffect } from \"./implementations/outline\";\nimport type { DropShadowEffect } from \"./implementations/drop-shadow\";\nimport type { VignetteEffect } from \"./implementations/vignette\";\nimport type { GrainEffect } from \"./implementations/grain\";\nimport type { SharpenEffect } from \"./implementations/sharpen\";\nimport type { EdgesEffect } from \"./implementations/edges\";\nimport type { ThresholdEffect } from \"./implementations/threshold\";\nimport type { RadialBlurEffect } from \"./implementations/radial-blur\";\nimport type { HalftoneEffect } from \"./implementations/halftone\";\nimport type { DitherEffect } from \"./implementations/dither\";\nimport type { DuotoneEffect } from \"./implementations/duotone\";\nimport type { CurvesEffect } from \"./implementations/curves\";\nimport type { ColorAdjustmentEffect } from \"./implementations/color-adjustment\";\nimport type { RgbShiftEffect } from \"./implementations/rgb-shift\";\nimport type { ScanlinesEffect } from \"./implementations/scanlines\";\nimport type { BlockDisplaceEffect } from \"./implementations/block-displace\";\nimport type { BitCrushEffect } from \"./implementations/bit-crush\";\nimport type { AsciiEffect } from \"./implementations/ascii\";\nimport type { StreakEffect } from \"./implementations/streak\";\nimport type { GlowEffect } from \"./implementations/glow\";\nimport type { GodRaysEffect } from \"./implementations/god-rays\";\nimport type { OilPaintEffect } from \"./implementations/oil-paint\";\nimport type { TextureEffect } from \"./implementations/texture\";\nimport type { DisplaceEffect } from \"./implementations/displace\";\nimport type { WaveEffect } from \"./implementations/wave\";\nimport type { TwirlEffect } from \"./implementations/twirl\";\nimport type { ProgressiveBlurEffect } from \"./implementations/progressive-blur\";\nimport type { KaleidoscopeEffect } from \"./implementations/kaleidoscope\";\nimport type { TrailsEffect } from \"./implementations/trails\";\nimport type { GlassEffect } from \"./implementations/glass\";\nimport type { LutEffect } from \"./implementations/lut\";\n\n/** Discriminated union of every effect type a scene node can carry. */\nexport type SceneEffect =\n | BlurEffect\n | DirectionalBlurEffect\n | GrayscaleEffect\n | PixelateEffect\n | BulgeEffect\n | MagnifyEffect\n | BloomEffect\n | VintageEffect\n | ChromaticAberrationEffect\n | InvertEffect\n | ScatterEffect\n | PosterizeEffect\n | MotionBlurEffect\n | ShaderEffect\n | OutlineEffect\n | DropShadowEffect\n | VignetteEffect\n | GrainEffect\n | SharpenEffect\n | EdgesEffect\n | ThresholdEffect\n | RadialBlurEffect\n | HalftoneEffect\n | DitherEffect\n | DuotoneEffect\n | CurvesEffect\n | ColorAdjustmentEffect\n | RgbShiftEffect\n | ScanlinesEffect\n | BlockDisplaceEffect\n | BitCrushEffect\n | AsciiEffect\n | StreakEffect\n | GlowEffect\n | GodRaysEffect\n | OilPaintEffect\n | TextureEffect\n | DisplaceEffect\n | WaveEffect\n | TwirlEffect\n | ProgressiveBlurEffect\n | KaleidoscopeEffect\n | TrailsEffect\n | GlassEffect\n | LutEffect;\n"]}
1
+ {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/effects/union.ts"],"names":[],"mappings":"","sourcesContent":["import type { BlurEffect } from \"./implementations/blur\";\r\nimport type { DirectionalBlurEffect } from \"./implementations/directional-blur\";\r\nimport type { GrayscaleEffect } from \"./implementations/grayscale\";\r\nimport type { PixelateEffect } from \"./implementations/pixelate\";\r\nimport type { BulgeEffect } from \"./implementations/bulge\";\r\nimport type { MagnifyEffect } from \"./implementations/magnify\";\r\nimport type { BloomEffect } from \"./implementations/bloom\";\r\nimport type { VintageEffect } from \"./implementations/vintage\";\r\nimport type { ChromaticAberrationEffect } from \"./implementations/chromatic-aberration\";\r\nimport type { InvertEffect } from \"./implementations/invert\";\r\nimport type { ScatterEffect } from \"./implementations/scatter\";\r\nimport type { PosterizeEffect } from \"./implementations/posterize\";\r\nimport type { MotionBlurEffect } from \"./implementations/motion-blur\";\r\nimport type { ShaderEffect } from \"./implementations/shader\";\r\nimport type { OutlineEffect } from \"./implementations/outline\";\r\nimport type { DropShadowEffect } from \"./implementations/drop-shadow\";\r\nimport type { VignetteEffect } from \"./implementations/vignette\";\r\nimport type { GrainEffect } from \"./implementations/grain\";\r\nimport type { SharpenEffect } from \"./implementations/sharpen\";\r\nimport type { EdgesEffect } from \"./implementations/edges\";\r\nimport type { ThresholdEffect } from \"./implementations/threshold\";\r\nimport type { RadialBlurEffect } from \"./implementations/radial-blur\";\r\nimport type { HalftoneEffect } from \"./implementations/halftone\";\r\nimport type { DitherEffect } from \"./implementations/dither\";\r\nimport type { DuotoneEffect } from \"./implementations/duotone\";\r\nimport type { CurvesEffect } from \"./implementations/curves\";\r\nimport type { ColorAdjustmentEffect } from \"./implementations/color-adjustment\";\r\nimport type { RgbShiftEffect } from \"./implementations/rgb-shift\";\r\nimport type { ScanlinesEffect } from \"./implementations/scanlines\";\r\nimport type { BlockDisplaceEffect } from \"./implementations/block-displace\";\r\nimport type { BitCrushEffect } from \"./implementations/bit-crush\";\r\nimport type { AsciiEffect } from \"./implementations/ascii\";\r\nimport type { StreakEffect } from \"./implementations/streak\";\r\nimport type { GlowEffect } from \"./implementations/glow\";\r\nimport type { OilPaintEffect } from \"./implementations/oil-paint\";\r\nimport type { WaveEffect } from \"./implementations/wave\";\r\nimport type { TwirlEffect } from \"./implementations/twirl\";\r\nimport type { ProgressiveBlurEffect } from \"./implementations/progressive-blur\";\r\nimport type { KaleidoscopeEffect } from \"./implementations/kaleidoscope\";\r\nimport type { GlassEffect } from \"./implementations/glass\";\r\nimport type { LutEffect } from \"./implementations/lut\";\r\n\r\n/** Discriminated union of every effect type a node can carry. */\r\nexport type NodeEffect =\r\n | BlurEffect\r\n | DirectionalBlurEffect\r\n | GrayscaleEffect\r\n | PixelateEffect\r\n | BulgeEffect\r\n | MagnifyEffect\r\n | BloomEffect\r\n | VintageEffect\r\n | ChromaticAberrationEffect\r\n | InvertEffect\r\n | ScatterEffect\r\n | PosterizeEffect\r\n | MotionBlurEffect\r\n | ShaderEffect\r\n | OutlineEffect\r\n | DropShadowEffect\r\n | VignetteEffect\r\n | GrainEffect\r\n | SharpenEffect\r\n | EdgesEffect\r\n | ThresholdEffect\r\n | RadialBlurEffect\r\n | HalftoneEffect\r\n | DitherEffect\r\n | DuotoneEffect\r\n | CurvesEffect\r\n | ColorAdjustmentEffect\r\n | RgbShiftEffect\r\n | ScanlinesEffect\r\n | BlockDisplaceEffect\r\n | BitCrushEffect\r\n | AsciiEffect\r\n | StreakEffect\r\n | GlowEffect\r\n | OilPaintEffect\r\n | WaveEffect\r\n | TwirlEffect\r\n | ProgressiveBlurEffect\r\n | KaleidoscopeEffect\r\n | GlassEffect\r\n | LutEffect;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"blend.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/blend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,KAAK;IACL,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,QAAQ;CACF,CAAC;AAKX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,UAAU,EAAE,cAAc,CAAU,CAAC;AAKvE,wDAAwD;AACxD,MAAM,eAAe,GACjB,MAAM,CAAC,WAAW,CACd,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACZ,CAAC;AAEnC,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,KAAgB;IAC7C,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\n * Blend mode definitions.\n *\n * Mirrors the CSS `mix-blend-mode` keyword set. The renderer maps each string\n * to an integer hash for fast uniform uploads.\n */\n\n/** Every supported blend mode, in hash-index order. */\nexport const BlendModes = [\n \"multiply\",\n \"screen\",\n \"overlay\",\n \"darken\",\n \"lighten\",\n \"color-dodge\",\n \"color-burn\",\n \"hard-light\",\n \"soft-light\",\n \"difference\",\n \"exclusion\",\n \"hue\",\n \"saturation\",\n \"color\",\n \"luminosity\",\n \"normal\"\n] as const;\n\n/** CSS `mix-blend-mode` keyword — derived from {@link BlendModes}. */\nexport type BlendMode = typeof BlendModes[number];\n\n/**\n * Blend modes a node/layer can carry. Adds Figma's `pass-through` to the fill\n * {@link BlendMode} set. `pass-through` (the node default) means the layer is\n * *not* isolated: its opacity scales each child/fill's contribution while those\n * children still blend directly against the backdrop. Any other value isolates\n * the node — its children flatten into a group that then blends against the\n * backdrop with the chosen mode. Fills never accept `pass-through`.\n */\nexport const NodeBlendModes = [...BlendModes, \"pass-through\"] as const;\n\n/** Layer blend mode — {@link BlendMode} plus `pass-through`. Node2D-only. */\nexport type NodeBlendMode = typeof NodeBlendModes[number];\n\n// Pre-built reverse lookup so getBlendModeHash is O(1).\nconst BLEND_MODE_HASH: Record<BlendMode, number> =\n Object.fromEntries(\n BlendModes.map((mode, i) => [mode, i])\n ) as Record<BlendMode, number>;\n\n/** Returns the integer hash for a blend mode, used as a shader uniform. */\nexport function getBlendModeHash(blend: BlendMode): number {\n return BLEND_MODE_HASH[blend];\n}\n"]}
1
+ {"version":3,"file":"blend.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/blend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,KAAK;IACL,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,QAAQ;CACF,CAAC;AAKX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,UAAU,EAAE,cAAc,CAAU,CAAC;AAKvE,wDAAwD;AACxD,MAAM,eAAe,GACjB,MAAM,CAAC,WAAW,CACd,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACZ,CAAC;AAEnC,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,KAAgB;IAC7C,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\r\n * Blend mode definitions.\r\n *\r\n * Mirrors the CSS `mix-blend-mode` keyword set. The renderer maps each string\r\n * to an integer hash for fast uniform uploads.\r\n */\r\n\r\n/** Every supported blend mode, in hash-index order. */\r\nexport const BlendModes = [\r\n \"multiply\",\r\n \"screen\",\r\n \"overlay\",\r\n \"darken\",\r\n \"lighten\",\r\n \"color-dodge\",\r\n \"color-burn\",\r\n \"hard-light\",\r\n \"soft-light\",\r\n \"difference\",\r\n \"exclusion\",\r\n \"hue\",\r\n \"saturation\",\r\n \"color\",\r\n \"luminosity\",\r\n \"normal\"\r\n] as const;\r\n\r\n/** CSS `mix-blend-mode` keyword — derived from {@link BlendModes}. */\r\nexport type BlendMode = typeof BlendModes[number];\r\n\r\n/**\r\n * Blend modes a node/layer can carry. Adds Figma's `pass-through` to the fill\r\n * {@link BlendMode} set. `pass-through` (the node default) means the layer is\r\n * *not* isolated: its opacity scales each child/fill's contribution while those\r\n * children still blend directly against the backdrop. Any other value isolates\r\n * the node — its children flatten into a group that then blends against the\r\n * backdrop with the chosen mode. Fills never accept `pass-through`.\r\n */\r\nexport const NodeBlendModes = [...BlendModes, \"pass-through\"] as const;\r\n\r\n/** Layer blend mode — {@link BlendMode} plus `pass-through`. Node2D-only. */\r\nexport type NodeBlendMode = typeof NodeBlendModes[number];\r\n\r\n// Pre-built reverse lookup so getBlendModeHash is O(1).\r\nconst BLEND_MODE_HASH: Record<BlendMode, number> =\r\n Object.fromEntries(\r\n BlendModes.map((mode, i) => [mode, i])\r\n ) as Record<BlendMode, number>;\r\n\r\n/** Returns the integer hash for a blend mode, used as a shader uniform. */\r\nexport function getBlendModeHash(blend: BlendMode): number {\r\n return BLEND_MODE_HASH[blend];\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/chain.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAA6B,MAAM,oBAAoB,CAAC;AA0DxF,mFAAmF;AACnF,SAAS,WAAW,CAAmB,IAAO,EAAE,UAAuB,EAAE;IACrE,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,EAAqB,CAAC;IAC3C,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACjE,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC3D,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC3D,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,SAAS;IACC;IAAnB,YAAmB,OAAmB,EAAE;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAI,CAAC;IAE7C,yEAAyE;IACzE,KAAK,CAAC,KAAY,EAAE,OAAqB;QACrC,OAAO,IAAI,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC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CAAC;IACrB,CAAC;CACJ;AAqBD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,SAAS,EAAE,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAsB;IACnD,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC5B,IAAI,IAAI,YAAY,SAAS;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,oEAAoE;QACpE,wEAAwE;QACxE,yEAAyE;QACzE,qBAAqB;QACrB,MAAM,GAAG,GAAe,EAAE,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,IAAI,IAAI,YAAY,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;iBACjD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAY,CAAC,CAAC,CAAC;;gBACrE,GAAG,CAAC,IAAI,CAAC,IAAgB,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IACD,OAAO,CAAC,IAAgB,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { Color } from \"./color/parser\";\nimport type { BlendMode } from \"./blend\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { ImageAdjustment, VideoAdjustment } from \"../filters/chain\";\nimport type { MediaPresetProp, VideoPresetProp } from \"./media-preset\";\nimport type { FillProp, FillResolved, FillSpace } from \"./union\";\nimport { normalizeUniforms } from \"../sksl-uniforms\";\nimport { resolveShaderProperties, type ShaderPropertyValues } from \"../shaders/resolve\";\nimport type { FillShader } from \"../shaders/pack\";\nimport type { ImageCrop, ImageFit, ImageMatrix } from \"./implementations/image\";\nimport type { Alignment } from \"@/attributes/layout/alignment\";\nimport type { FractalNoiseFillProp } from \"./implementations/fractal-noise\";\nimport type { DotGridFillProp } from \"./implementations/dot-grid\";\nimport type { GridFillProp } from \"./implementations/grid\";\nimport type { ShaderFillProp } from \"./implementations/shader\";\nimport type { Scene3D } from \"@/render3d/scene3d\";\n\n/** Placement options shared by the image and video fill builders. */\nexport interface MediaPlacementOptions {\n /** How the (cropped) source is scaled into the node's bounds. Default `'fill'`. */\n fit?: ImageFit;\n /** Window onto the source, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` is the fitted size. */\n zoom?: number;\n /** The point held fixed as `zoom` scales; also the alignment when it doesn't cover. */\n anchor?: Alignment;\n /** Raw source→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n}\n\n/** Author-facing options for a {@link FillChain.video} layer. */\nexport interface VideoFillOptions extends FillOptions, MediaPlacementOptions {\n /** The grade laid over the footage — an adjustment chain plus a 0–1 mix. */\n preset?: VideoPresetProp;\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\n filters?: VideoAdjustment;\n /**\n * Explicit source time to paint, in seconds. Omit it and the clip plays by\n * itself, timed from the moment the node painting it appeared — set it only\n * to drive the playhead yourself (`null` hands the playhead back).\n */\n timestamp?: number | null;\n /** Whether playback advances with the node's clock. Defaults to `true`. */\n playing?: boolean;\n trimStart?: number;\n trimEnd?: number;\n /** Seconds after the painting node appears before playback begins. Default `0`. */\n playStart?: number;\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n duration?: number;\n}\n\n/**\n * Cross-cutting options shared by every fill layer. These map onto the\n * `opacity` / `blend` fields each fill prop already accepts, plus the\n * `space` directive carried generically by the registry.\n */\nexport interface FillOptions {\n opacity?: number;\n blend?: BlendMode;\n space?: FillSpace;\n}\n\n/** Strip `undefined` option keys so the produced props stay minimal/comparable. */\nfunction withOptions<T extends object>(base: T, options: FillOptions = {}): T & FillOptions {\n const out = { ...base } as T & FillOptions;\n if (options.opacity !== undefined) out.opacity = options.opacity;\n if (options.blend !== undefined) out.blend = options.blend;\n if (options.space !== undefined) out.space = options.space;\n return out;\n}\n\n/**\n * Immutable, chainable list of fill layers.\n *\n * Each builder method returns a new `FillChain` with the layer appended, so\n * chains are safe to share and branch — mirroring {@link EffectChain}.\n *\n * @example\n * const bg = Fills.image('./background.jpg', { blend: 'overlay', opacity: 0.2 })\n * .color('red', { opacity: 0.3 });\n * node.fill = bg; // assign directly\n * node.fill = [...bg, 'white']; // spread into an array\n */\nexport class FillChain {\n constructor(public list: FillProp[] = []) { }\n\n /** Append a solid color fill. A CSS string or normalized `[r,g,b,a]`. */\n color(color: Color, options?: FillOptions) {\n return new FillChain([...this.list, withOptions({ type: 'solid' as const, color }, options)]);\n }\n\n /**\n * Append an image fill from `src`.\n *\n * @example\n * Fills.image('./city.jpg', { zoom: 1.4, anchor: 'topCenter', crop: { bottom: 0.2 } })\n */\n image(\n src: string,\n options?: FillOptions & MediaPlacementOptions & {\n /** The grade laid over the picture — an adjustment chain plus a 0–1 mix. */\n preset?: MediaPresetProp;\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\n filters?: ImageAdjustment;\n },\n ) {\n const { fit, crop, zoom, anchor, matrix, preset, filters, ...common } = options ?? {};\n // Both are forwarded unresolved: `imageFill.resolve` is the one place\n // that flattens a chain and folds the deprecated prop into the preset,\n // so a fill built here and a fill written as a literal cannot disagree\n // about what a grade means.\n return new FillChain([...this.list, withOptions({\n type: 'image' as const,\n src,\n fit, crop, zoom, anchor, matrix,\n preset, filters,\n }, common)]);\n }\n\n /**\n * Append a video fill from `src`. Plays by default: its source timestamp is\n * derived as it paints, from how long the node carrying the fill has\n * existed — so the clip runs wherever the fill is used (fill, overlay,\n * stroke, shadow, a custom node's `Graphics2D`) with nothing to advance.\n */\n video(src: string, options?: VideoFillOptions) {\n const { fit, crop, zoom, anchor, matrix, preset, filters, timestamp, playing, trimStart, trimEnd, playStart, speed, loop, duration, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({\n type: 'video' as const,\n src,\n fit, crop, zoom, anchor, matrix, preset, filters,\n timestamp,\n playing: playing ?? true,\n trimStart, trimEnd, playStart, speed, loop, duration,\n }, common)]);\n }\n\n\n /** Append a linear gradient between `colors`. */\n linearGradient(colors: Color[], options?: FillOptions & { stops?: number[]; start?: Vector2; end?: Vector2 }) {\n const { stops, start, end, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'linear-gradient' as const, colors, stops, start, end }, common)]);\n }\n\n /** Append a radial gradient between `colors`. */\n radialGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; radius?: number }) {\n const { stops, center, radius, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'radial-gradient' as const, colors, stops, center, radius }, common)]);\n }\n\n /** Append a conic gradient between `colors`. */\n conicGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; startAngle?: number }) {\n const { stops, center, startAngle, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'conic-gradient' as const, colors, stops, center, startAngle }, common)]);\n }\n\n /** Append a noise (speckle) fill. Tween `seed` to make the static crawl. */\n noise(options?: FillOptions & { size?: Vector2; density?: number; color?: Color; seed?: number }) {\n const { size, density, color, seed, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'noise' as const, size, density, color, seed }, common)]);\n }\n\n /**\n * Append a fractal (fBm) noise fill — a continuous field rather than the\n * speckle {@link noise} paints. Cloud, marble, smoke, terrain, plasma.\n *\n * Tween `offset` to travel through the field (it flows); tween `seed` to\n * shift to a different field entirely (it churns).\n */\n fractalNoise(options?: FillOptions & Omit<FractalNoiseFillProp, 'type' | 'opacity' | 'blend'>) {\n const {\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\n colors, stops, contrast, ...common\n } = options ?? {};\n return new FillChain([...this.list, withOptions(\n {\n type: 'fractalNoise' as const,\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\n colors, stops, contrast,\n },\n common,\n )]);\n }\n\n /**\n * Append a custom SkSL shader fill — the escape hatch past {@link noise} and\n * {@link fractalNoise}, where the author writes the fragment function.\n *\n * `source` must declare `vec4 main(vec2 fragCoord)` and return\n * **premultiplied** rgba, without folding `opacity` in (the layer's opacity is\n * already on the paint, so applying it twice squares it). Uniforms are keyed\n * by their declared name and bound by reflecting the compiled program, so\n * order is irrelevant; the renderer supplies `u_size`, `u_origin`,\n * `u_resolution`, `u_aspect`, `u_time` and `u_scale` to whichever of them the\n * source declares.\n *\n * Keep `source` constant — it is the compile-cache key, so it snaps at a\n * tween's midpoint and rebuilding it per frame compiles a program per frame.\n * Everything that changes belongs in a uniform, which is an in-place write.\n *\n * @example\n * Fills.shader(GLOW, { uniforms: { u_amount: 0.6 }, coords: 'centered' })\n */\n shader(\n source: string | FillShader,\n options?: FillOptions\n & Omit<ShaderFillProp, 'type' | 'source' | 'opacity' | 'blend' | 'shaderId'>\n & { values?: ShaderPropertyValues },\n ) {\n const pack = typeof source === 'string' ? undefined : source;\n if (pack && pack.scope !== 'fill') {\n throw new Error(\n `Fills.shader was given a \"${(pack as { scope: string }).scope}\" shader ` +\n `(\"${pack.name}\"). An effect shader samples a backdrop a fill does not have; ` +\n `use Effects.shader.`,\n );\n }\n const { uniforms, coords, textures, values, ...common } = options ?? {};\n // A pack resolves to plain uniforms here; anything passed as `uniforms`\n // still wins, matching how an author value overrides a built-in.\n const resolved = pack\n ? { ...resolveShaderProperties(pack, values), ...normalizeUniforms(uniforms ?? {}) }\n : uniforms;\n return new FillChain([...this.list, withOptions(\n {\n type: 'shader' as const,\n source: typeof source === 'string' ? source : source.source,\n uniforms: resolved,\n coords: coords ?? pack?.coords,\n textures,\n ...(pack?.id !== undefined ? { shaderId: pack.id } : {}),\n },\n common,\n )]);\n }\n\n /** Append a stripe (hatch) fill. */\n stripe(options?: FillOptions & { gap?: number; strokeWidth?: number; angle?: number; color?: Color }) {\n const { gap, strokeWidth, angle, color, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'stripe' as const, gap, strokeWidth, angle, color }, common)]);\n }\n\n /**\n * Append a dot-grid fill — a lattice of dots at a pixel pitch.\n *\n * Tween `offset` to drift the field under a shape that isn't moving; tween\n * `spacing` or `radius` to breathe it.\n *\n * @example\n * Fills.dotGrid({ radius: 1.5, spacing: 24, color: 'muted' })\n */\n dotGrid(options?: FillOptions & Omit<DotGridFillProp, 'type' | 'opacity' | 'blend'>) {\n const { radius, spacing, offset, color, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions(\n { type: 'dotGrid' as const, radius, spacing, offset, color },\n common,\n )]);\n }\n\n /**\n * Append a grid fill — ruled lines dividing the shape into cells, with an\n * optional finer ruling nested inside each one.\n *\n * Sized in divisions of the shape rather than in px (unlike {@link dotGrid}),\n * so it holds its structure as the shape resizes.\n *\n * @example\n * Fills.grid({ divisions: 8, subdivisions: 4, color: 'border' })\n */\n grid(options?: FillOptions & Omit<GridFillProp, 'type' | 'opacity' | 'blend'>) {\n const {\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color, ...common\n } = options ?? {};\n return new FillChain([...this.list, withOptions(\n {\n type: 'grid' as const,\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color,\n },\n common,\n )]);\n }\n\n /**\n * Append a 3D scene, painted through the shape's own path.\n *\n * Takes a **built** {@link Scene3D}, never a builder — per-frame freshness\n * comes from where the value is produced (a `renderSelf`, or a `() => …`\n * reactive binding), like every other fill.\n *\n * Note two same-type 3D layers hard-cut rather than cross-fading, because a\n * command list has no meaningful in-between. To dissolve between two scenes,\n * stack them and tween their opacities in opposite directions.\n */\n canvas3D(scene: Scene3D, options?: FillOptions & { maxPixelRatio?: number; antialias?: boolean }) {\n const { maxPixelRatio, antialias, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'canvas3D' as const, scene, maxPixelRatio, antialias }, common)]);\n }\n\n /** Allows spreading the chain into an array: `[...Fills.color('red')]`. */\n *[Symbol.iterator]() {\n yield* this.list;\n }\n\n /** Serializes to the raw fill array so frameworks that call `toJSON` get a plain value. */\n toJSON() {\n return this.list;\n }\n}\n\n/**\n * Accepted shapes for a node's `fill` prop.\n *\n * Can be a single fill, a `FillChain` builder result, an already-resolved\n * {@link FillResolved}, or an array mixing any of these (each chain contributes\n * all its layers in place):\n *\n * 'red' // plain CSS color\n * Fills.image('bg.jpg') // chain\n * ['#e8c584', Fills.image('bg.jpg')]\n * ['#e8c584', ...Fills.image('bg.jpg')]\n * resolvedFills // FillResolved[] passes through\n */\nexport type Fill =\n | FillProp\n | FillResolved\n | FillChain\n | (FillProp | FillResolved | FillChain)[];\n\n/**\n * Entry point for building fill chains fluently.\n *\n * An empty {@link FillChain}, so `Fills.image(src)` *is* `new FillChain().image(src)`\n * — every builder's signature and documentation has one definition, on the\n * class, which is what an editor shows when you hover `Fills.image`. The chain\n * is immutable (each builder returns a new one), so sharing one empty instance\n * as the entry point is safe.\n *\n * @example\n * node.fill = Fills.image('./bg.jpg', { opacity: 0.2 }).color('red', { opacity: 0.3 });\n */\nexport const Fills = new FillChain();\n\n/**\n * Normalises any {@link Fill} value to a plain `FillProp[]`.\n * Used by `resolveFillArray` before resolving to the renderer shape.\n *\n * Already-resolved fills (`FillResolved`) structurally satisfy `FillProp`, so\n * they pass straight through and `resolveFill` re-normalises them idempotently.\n */\nexport function resolveChainFill(fill: Fill | undefined): FillProp[] {\n if (fill == null) return [];\n if (fill instanceof FillChain) return fill.list;\n if (Array.isArray(fill)) {\n // Flatten any chains used as array elements so each contributes its\n // layers in place: `['#e8c584', Fills.image('bg.jpg')]` — and the plain\n // array a chain serializes to, which is how that value reads back out of\n // a stored document.\n const out: FillProp[] = [];\n for (const item of fill) {\n if (item instanceof FillChain) out.push(...item.list);\n else if (Array.isArray(item)) out.push(...resolveChainFill(item as Fill));\n else out.push(item as FillProp);\n }\n return out;\n }\n return [fill as FillProp];\n}\n"]}
1
+ {"version":3,"file":"ch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AyE;QACzE,qBAAqB;QACrB,MAAM,GAAG,GAAe,EAAE,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,IAAI,IAAI,YAAY,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;iBACjD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAY,CAAC,CAAC,CAAC;;gBACrE,GAAG,CAAC,IAAI,CAAC,IAAgB,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IACD,OAAO,CAAC,IAAgB,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { Color } from \"./color/parser\";\r\nimport type { BlendMode } from \"./blend\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { ImageAdjustment, VideoAdjustment } from \"../filters/chain\";\r\nimport type { MediaPresetProp, VideoPresetProp } from \"./media-preset\";\r\nimport type { FillProp, FillResolved, FillSpace } from \"./union\";\r\nimport { normalizeUniforms } from \"../sksl-uniforms\";\r\nimport { resolveShaderProperties, type ShaderPropertyValues } from \"../shaders/resolve\";\r\nimport type { FillShader } from \"../shaders/pack\";\r\nimport type { ImageCrop, ImageFit, ImageMatrix } from \"./implementations/image\";\r\nimport type { Alignment } from \"@/attributes/layout/alignment\";\r\nimport type { FractalNoiseFillProp } from \"./implementations/fractal-noise\";\r\nimport type { DotGridFillProp } from \"./implementations/dot-grid\";\r\nimport type { GridFillProp } from \"./implementations/grid\";\r\nimport type { ShaderFillProp } from \"./implementations/shader\";\r\nimport type { Scene3D } from \"@/render3d/scene3d\";\r\n\r\n/** Placement options shared by the image and video fill builders. */\r\nexport interface MediaPlacementOptions {\r\n /** How the (cropped) source is scaled into the node's bounds. Default `'fill'`. */\r\n fit?: ImageFit;\r\n /** Window onto the source, in fractions of its own size, applied before `fit`. */\r\n crop?: ImageCrop;\r\n /** Magnification on top of the fitted scale. `1` is the fitted size. */\r\n zoom?: number;\r\n /** The point held fixed as `zoom` scales; also the alignment when it doesn't cover. */\r\n anchor?: Alignment;\r\n /** Raw source→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\r\n matrix?: ImageMatrix;\r\n}\r\n\r\n/** Author-facing options for a {@link FillChain.video} layer. */\r\nexport interface VideoFillOptions extends FillOptions, MediaPlacementOptions {\r\n /** The grade laid over the footage — an adjustment chain plus a 0–1 mix. */\r\n preset?: VideoPresetProp;\r\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\r\n filters?: VideoAdjustment;\r\n /**\r\n * Explicit source time to paint, in seconds. Omit it and the clip plays by\r\n * itself, timed from the moment the node painting it appeared — set it only\r\n * to drive the playhead yourself (`null` hands the playhead back).\r\n */\r\n timestamp?: number | null;\r\n /** Whether playback advances with the node's clock. Defaults to `true`. */\r\n playing?: boolean;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n /** Seconds after the painting node appears before playback begins. Default `0`. */\r\n playStart?: number;\r\n speed?: number;\r\n loop?: 'forward' | 'reverse' | 'none';\r\n duration?: number;\r\n}\r\n\r\n/**\r\n * Cross-cutting options shared by every fill layer. These map onto the\r\n * `opacity` / `blend` fields each fill prop already accepts, plus the\r\n * `space` directive carried generically by the registry.\r\n */\r\nexport interface FillOptions {\r\n opacity?: number;\r\n blend?: BlendMode;\r\n space?: FillSpace;\r\n}\r\n\r\n/** Strip `undefined` option keys so the produced props stay minimal/comparable. */\r\nfunction withOptions<T extends object>(base: T, options: FillOptions = {}): T & FillOptions {\r\n const out = { ...base } as T & FillOptions;\r\n if (options.opacity !== undefined) out.opacity = options.opacity;\r\n if (options.blend !== undefined) out.blend = options.blend;\r\n if (options.space !== undefined) out.space = options.space;\r\n return out;\r\n}\r\n\r\n/**\r\n * Immutable, chainable list of fill layers.\r\n *\r\n * Each builder method returns a new `FillChain` with the layer appended, so\r\n * chains are safe to share and branch — mirroring {@link EffectChain}.\r\n *\r\n * @example\r\n * const bg = Fills.image('./background.jpg', { blend: 'overlay', opacity: 0.2 })\r\n * .color('red', { opacity: 0.3 });\r\n * node.fill = bg; // assign directly\r\n * node.fill = [...bg, 'white']; // spread into an array\r\n */\r\nexport class FillChain {\r\n constructor(public list: FillProp[] = []) { }\r\n\r\n /** Append a solid color fill. A CSS string or normalized `[r,g,b,a]`. */\r\n color(color: Color, options?: FillOptions) {\r\n return new FillChain([...this.list, withOptions({ type: 'solid' as const, color }, options)]);\r\n }\r\n\r\n /**\r\n * Append an image fill from `src`.\r\n *\r\n * @example\r\n * Fills.image('./city.jpg', { zoom: 1.4, anchor: 'topCenter', crop: { bottom: 0.2 } })\r\n */\r\n image(\r\n src: string,\r\n options?: FillOptions & MediaPlacementOptions & {\r\n /** The grade laid over the picture — an adjustment chain plus a 0–1 mix. */\r\n preset?: MediaPresetProp;\r\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\r\n filters?: ImageAdjustment;\r\n },\r\n ) {\r\n const { fit, crop, zoom, anchor, matrix, preset, filters, ...common } = options ?? {};\r\n // Both are forwarded unresolved: `imageFill.resolve` is the one place\r\n // that flattens a chain and folds the deprecated prop into the preset,\r\n // so a fill built here and a fill written as a literal cannot disagree\r\n // about what a grade means.\r\n return new FillChain([...this.list, withOptions({\r\n type: 'image' as const,\r\n src,\r\n fit, crop, zoom, anchor, matrix,\r\n preset, filters,\r\n }, common)]);\r\n }\r\n\r\n /**\r\n * Append a video fill from `src`. Plays by default: its source timestamp is\r\n * derived as it paints, from how long the node carrying the fill has\r\n * existed — so the clip runs wherever the fill is used (fill, overlay,\r\n * stroke, shadow, a custom node's `Graphics2D`) with nothing to advance.\r\n */\r\n video(src: string, options?: VideoFillOptions) {\r\n const { fit, crop, zoom, anchor, matrix, preset, filters, timestamp, playing, trimStart, trimEnd, playStart, speed, loop, duration, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({\r\n type: 'video' as const,\r\n src,\r\n fit, crop, zoom, anchor, matrix, preset, filters,\r\n timestamp,\r\n playing: playing ?? true,\r\n trimStart, trimEnd, playStart, speed, loop, duration,\r\n }, common)]);\r\n }\r\n\r\n\r\n /** Append a linear gradient between `colors`. */\r\n linearGradient(colors: Color[], options?: FillOptions & { stops?: number[]; start?: Vector2; end?: Vector2 }) {\r\n const { stops, start, end, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({ type: 'linear-gradient' as const, colors, stops, start, end }, common)]);\r\n }\r\n\r\n /** Append a radial gradient between `colors`. */\r\n radialGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; radius?: number }) {\r\n const { stops, center, radius, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({ type: 'radial-gradient' as const, colors, stops, center, radius }, common)]);\r\n }\r\n\r\n /** Append a conic gradient between `colors`. */\r\n conicGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; startAngle?: number }) {\r\n const { stops, center, startAngle, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({ type: 'conic-gradient' as const, colors, stops, center, startAngle }, common)]);\r\n }\r\n\r\n /** Append a noise (speckle) fill. Tween `seed` to make the static crawl. */\r\n noise(options?: FillOptions & { size?: Vector2; density?: number; color?: Color; seed?: number }) {\r\n const { size, density, color, seed, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({ type: 'noise' as const, size, density, color, seed }, common)]);\r\n }\r\n\r\n /**\r\n * Append a fractal (fBm) noise fill — a continuous field rather than the\r\n * speckle {@link noise} paints. Cloud, marble, smoke, terrain, plasma.\r\n *\r\n * Tween `offset` to travel through the field (it flows); tween `seed` to\r\n * shift to a different field entirely (it churns).\r\n */\r\n fractalNoise(options?: FillOptions & Omit<FractalNoiseFillProp, 'type' | 'opacity' | 'blend'>) {\r\n const {\r\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\r\n colors, stops, contrast, ...common\r\n } = options ?? {};\r\n return new FillChain([...this.list, withOptions(\r\n {\r\n type: 'fractalNoise' as const,\r\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\r\n colors, stops, contrast,\r\n },\r\n common,\r\n )]);\r\n }\r\n\r\n /**\r\n * Append a custom SkSL shader fill — the escape hatch past {@link noise} and\r\n * {@link fractalNoise}, where the author writes the fragment function.\r\n *\r\n * `source` must declare `vec4 main(vec2 fragCoord)` and return\r\n * **premultiplied** rgba, without folding `opacity` in (the layer's opacity is\r\n * already on the paint, so applying it twice squares it). Uniforms are keyed\r\n * by their declared name and bound by reflecting the compiled program, so\r\n * order is irrelevant; the renderer supplies `u_size`, `u_origin`,\r\n * `u_resolution`, `u_aspect`, `u_time` and `u_scale` to whichever of them the\r\n * source declares.\r\n *\r\n * Keep `source` constant — it is the compile-cache key, so it snaps at a\r\n * tween's midpoint and rebuilding it per frame compiles a program per frame.\r\n * Everything that changes belongs in a uniform, which is an in-place write.\r\n *\r\n * @example\r\n * Fills.shader(GLOW, { uniforms: { u_amount: 0.6 }, coords: 'centered' })\r\n */\r\n shader(\r\n source: string | FillShader,\r\n options?: FillOptions\r\n & Omit<ShaderFillProp, 'type' | 'source' | 'opacity' | 'blend' | 'shaderId'>\r\n & { values?: ShaderPropertyValues },\r\n ) {\r\n const pack = typeof source === 'string' ? undefined : source;\r\n if (pack && pack.scope !== 'fill') {\r\n throw new Error(\r\n `Fills.shader was given a \"${(pack as { scope: string }).scope}\" shader ` +\r\n `(\"${pack.name}\"). An effect shader samples a backdrop a fill does not have; ` +\r\n `use Effects.shader.`,\r\n );\r\n }\r\n const { uniforms, coords, textures, values, ...common } = options ?? {};\r\n // A pack resolves to plain uniforms here; anything passed as `uniforms`\r\n // still wins, matching how an author value overrides a built-in.\r\n const resolved = pack\r\n ? { ...resolveShaderProperties(pack, values), ...normalizeUniforms(uniforms ?? {}) }\r\n : uniforms;\r\n return new FillChain([...this.list, withOptions(\r\n {\r\n type: 'shader' as const,\r\n source: typeof source === 'string' ? source : source.source,\r\n uniforms: resolved,\r\n coords: coords ?? pack?.coords,\r\n textures,\r\n ...(pack?.id !== undefined ? { shaderId: pack.id } : {}),\r\n },\r\n common,\r\n )]);\r\n }\r\n\r\n /** Append a stripe (hatch) fill. */\r\n stripe(options?: FillOptions & { gap?: number; strokeWidth?: number; angle?: number; color?: Color }) {\r\n const { gap, strokeWidth, angle, color, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({ type: 'stripe' as const, gap, strokeWidth, angle, color }, common)]);\r\n }\r\n\r\n /**\r\n * Append a dot-grid fill — a lattice of dots at a pixel pitch.\r\n *\r\n * Tween `offset` to drift the field under a shape that isn't moving; tween\r\n * `spacing` or `radius` to breathe it.\r\n *\r\n * @example\r\n * Fills.dotGrid({ radius: 1.5, spacing: 24, color: 'muted' })\r\n */\r\n dotGrid(options?: FillOptions & Omit<DotGridFillProp, 'type' | 'opacity' | 'blend'>) {\r\n const { radius, spacing, offset, color, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions(\r\n { type: 'dotGrid' as const, radius, spacing, offset, color },\r\n common,\r\n )]);\r\n }\r\n\r\n /**\r\n * Append a grid fill — ruled lines dividing the shape into cells, with an\r\n * optional finer ruling nested inside each one.\r\n *\r\n * Sized in divisions of the shape rather than in px (unlike {@link dotGrid}),\r\n * so it holds its structure as the shape resizes.\r\n *\r\n * @example\r\n * Fills.grid({ divisions: 8, subdivisions: 4, color: 'border' })\r\n */\r\n grid(options?: FillOptions & Omit<GridFillProp, 'type' | 'opacity' | 'blend'>) {\r\n const {\r\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color, ...common\r\n } = options ?? {};\r\n return new FillChain([...this.list, withOptions(\r\n {\r\n type: 'grid' as const,\r\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color,\r\n },\r\n common,\r\n )]);\r\n }\r\n\r\n /**\r\n * Append a 3D scene, painted through the shape's own path.\r\n *\r\n * Takes a **built** {@link Scene3D}, never a builder — per-frame freshness\r\n * comes from where the value is produced (a `renderSelf`, or a `() => …`\r\n * reactive binding), like every other fill.\r\n *\r\n * Note two same-type 3D layers hard-cut rather than cross-fading, because a\r\n * command list has no meaningful in-between. To dissolve between two scenes,\r\n * stack them and tween their opacities in opposite directions.\r\n */\r\n canvas3D(scene: Scene3D, options?: FillOptions & { maxPixelRatio?: number; antialias?: boolean }) {\r\n const { maxPixelRatio, antialias, ...common } = options ?? {};\r\n return new FillChain([...this.list, withOptions({ type: 'canvas3D' as const, scene, maxPixelRatio, antialias }, common)]);\r\n }\r\n\r\n /** Allows spreading the chain into an array: `[...Fills.color('red')]`. */\r\n *[Symbol.iterator]() {\r\n yield* this.list;\r\n }\r\n\r\n /** Serializes to the raw fill 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 `fill` prop.\r\n *\r\n * Can be a single fill, a `FillChain` builder result, an already-resolved\r\n * {@link FillResolved}, or an array mixing any of these (each chain contributes\r\n * all its layers in place):\r\n *\r\n * 'red' // plain CSS color\r\n * Fills.image('bg.jpg') // chain\r\n * ['#e8c584', Fills.image('bg.jpg')]\r\n * ['#e8c584', ...Fills.image('bg.jpg')]\r\n * resolvedFills // FillResolved[] passes through\r\n */\r\nexport type Fill =\r\n | FillProp\r\n | FillResolved\r\n | FillChain\r\n | (FillProp | FillResolved | FillChain)[];\r\n\r\n/**\r\n * Entry point for building fill chains fluently.\r\n *\r\n * An empty {@link FillChain}, so `Fills.image(src)` *is* `new FillChain().image(src)`\r\n * — every builder's signature and documentation has one definition, on the\r\n * class, which is what an editor shows when you hover `Fills.image`. The chain\r\n * is immutable (each builder returns a new one), so sharing one empty instance\r\n * as the entry point is safe.\r\n *\r\n * @example\r\n * node.fill = Fills.image('./bg.jpg', { opacity: 0.2 }).color('red', { opacity: 0.3 });\r\n */\r\nexport const Fills = new FillChain();\r\n\r\n/**\r\n * Normalises any {@link Fill} value to a plain `FillProp[]`.\r\n * Used by `resolveFillArray` before resolving to the renderer shape.\r\n *\r\n * Already-resolved fills (`FillResolved`) structurally satisfy `FillProp`, so\r\n * they pass straight through and `resolveFill` re-normalises them idempotently.\r\n */\r\nexport function resolveChainFill(fill: Fill | undefined): FillProp[] {\r\n if (fill == null) return [];\r\n if (fill instanceof FillChain) return fill.list;\r\n if (Array.isArray(fill)) {\r\n // Flatten any chains used as array elements so each contributes its\r\n // layers in place: `['#e8c584', Fills.image('bg.jpg')]` — and the plain\r\n // array a chain serializes to, which is how that value reads back out of\r\n // a stored document.\r\n const out: FillProp[] = [];\r\n for (const item of fill) {\r\n if (item instanceof FillChain) out.push(...item.list);\r\n else if (Array.isArray(item)) out.push(...resolveChainFill(item as Fill));\r\n else out.push(item as FillProp);\r\n }\r\n return out;\r\n }\r\n return [fill as FillProp];\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"coerce.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/coerce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAqBH,6EAA6E;AAC7E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAuB;IACjD,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;CACnB,CAAC,CAAC;AAEH,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,IAA0B;IACrD,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,CAAe,EAAE,CAAe;IACtD,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/D,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC3C,2EAA2E;IAC3E,OAAO,cAA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an in-between frame of a tween must\n * be a fully-formed fill of a single concrete type. When the two endpoints of a\n * tween have different types (e.g. a solid `color` animating into a\n * `linear-gradient`, or one gradient kind into another) we first promote both\n * endpoints to a common target type, then run that type's normal `lerp`.\n *\n * The rules, in order:\n *\n * - `color` is treated as a degenerate gradient — a single solid color. It is\n * the least \"rich\" fill, so when one side is a color and the other a\n * gradient, the gradient type wins and the color is expanded into a uniform\n * gradient (every stop set to that color). A uniform gradient renders\n * identically to the flat color, so frame 0 of a color→gradient tween looks\n * exactly like the color, then morphs into the gradient.\n *\n * - Two *different* gradient types share no geometry (a linear gradient's\n * start/end has no radial-gradient counterpart). There is no meaningful\n * in-between for that geometry, so we coerce toward the destination (`to`)\n * type: colors/stops/opacity interpolate while the geometry adopts the\n * destination's, snapped at frame 0.\n *\n * Coercion never mutates its input; it returns a fresh resolved fill.\n */\n\nimport type { NormalizedColor } from \"./color/parser\";\nimport type { FillResolved, FillCommon, FillSpace } from \"./union\";\nimport type { BlendMode } from \"./blend\";\nimport type { SolidFillResolved } from \"./implementations/color\";\nimport type { LinearGradientFillResolved } from \"./implementations/linear-gradient\";\nimport type { RadialGradientFillResolved } from \"./implementations/radial-gradient\";\nimport type { ConicGradientFillResolved } from \"./implementations/conic-gradient\";\n\n/**\n * Resolved fills that carry a `colors` array (every gradient variant), with the\n * cross-cutting {@link FillCommon} fields (`space`) mixed in — mirroring how the\n * registry's `FillResolved` union wraps each implementation in `WithCommon`.\n */\ntype GradientResolved = FillCommon & (\n | LinearGradientFillResolved\n | RadialGradientFillResolved\n | ConicGradientFillResolved\n);\n\n/** Fill types that can participate in cross-type color/gradient tweening. */\nconst GRADIENT_TYPES = new Set<FillResolved[\"type\"]>([\n \"linear-gradient\",\n \"radial-gradient\",\n \"conic-gradient\",\n]);\n\n/** True if `type` is a gradient (linear/radial/conic). */\nexport function isGradientType(type: FillResolved[\"type\"]): boolean {\n return GRADIENT_TYPES.has(type);\n}\n\n/**\n * True if `a` and `b` can be tweened across their differing types — i.e. each is\n * either a solid color or a gradient, and at least one is a gradient. (Same-type\n * pairs are handled by the registry directly and never reach coercion.)\n */\nexport function canCoerce(a: FillResolved, b: FillResolved): boolean {\n const aColorish = a.type === \"solid\" || isGradientType(a.type);\n const bColorish = b.type === \"solid\" || isGradientType(b.type);\n if (!aColorish || !bColorish) return false;\n // At least one gradient — color↔color is same-type and never reaches here.\n return isGradientType(a.type) || isGradientType(b.type);\n}\n\n/** Builds a stop list of `count` evenly spaced positions in [0, 1]. */\nfunction evenStops(count: number): number[] {\n return Array.from({ length: count }, (_, i) => i / Math.max(1, count - 1));\n}\n\n/**\n * Expands a solid color into a gradient of `targetType` whose every stop is that\n * color, matching `stopCount` colors so the resulting gradient lerps cleanly\n * against the real gradient on the other side. The geometry defaults match each\n * gradient's `resolve()` so a uniform gradient renders as a flat color.\n */\nfunction colorToGradient(\n color: NormalizedColor,\n opacity: number | undefined,\n blend: BlendMode | undefined,\n space: FillSpace | undefined,\n targetType: GradientResolved[\"type\"],\n stopCount: number,\n): GradientResolved {\n const n = Math.max(2, stopCount);\n const colors: NormalizedColor[] = Array.from({ length: n }, () => [...color] as NormalizedColor);\n const stops = evenStops(n);\n const common = { colors, stops, opacity, blend, space };\n\n switch (targetType) {\n case \"linear-gradient\":\n return { type: \"linear-gradient\", ...common, start: { x: -1, y: 1 }, end: { x: 1, y: -1 } };\n case \"radial-gradient\":\n return { type: \"radial-gradient\", ...common, center: { x: 0, y: 0 }, radius: 100 };\n case \"conic-gradient\":\n return { type: \"conic-gradient\", ...common, center: { x: 0, y: 0 }, startAngle: 0 };\n }\n}\n\n/**\n * Re-types a gradient as `targetType`, carrying its colors/stops/opacity and\n * adopting the target type's default geometry. Used when tweening between two\n * different gradient kinds, whose geometries are not interpolatable.\n */\nfunction retypeGradient(\n g: GradientResolved,\n targetType: GradientResolved[\"type\"],\n): GradientResolved {\n if (g.type === targetType) return g;\n const common = { colors: g.colors, stops: g.stops, opacity: g.opacity, blend: g.blend, space: g.space };\n switch (targetType) {\n case \"linear-gradient\":\n return { type: \"linear-gradient\", ...common, start: { x: -1, y: 1 }, end: { x: 1, y: -1 } };\n case \"radial-gradient\":\n return { type: \"radial-gradient\", ...common, center: { x: 0, y: 0 }, radius: 100 };\n case \"conic-gradient\":\n return { type: \"conic-gradient\", ...common, center: { x: 0, y: 0 }, startAngle: 0 };\n }\n}\n\n/**\n * Promotes two differing-type fills (color and/or gradient) to a single common\n * type so the registry can lerp them with that type's `lerp`. Returns the\n * coerced `[a, b]` pair, both guaranteed to share `result[0].type`.\n *\n * Caller must have checked {@link canCoerce} first.\n */\nexport function coercePair(a: FillResolved, b: FillResolved): [FillResolved, FillResolved] {\n const aIsColor = a.type === \"solid\";\n const bIsColor = b.type === \"solid\";\n\n // color → gradient: expand the color to match the gradient's type.\n if (aIsColor && !bIsColor) {\n const grad = b as GradientResolved;\n const expanded = colorToGradient(\n (a as SolidFillResolved).color, a.opacity, a.blend, a.space, grad.type, grad.colors.length,\n );\n return [expanded, grad];\n }\n // gradient → color: expand the color (b) to match the gradient's (a) type.\n if (bIsColor && !aIsColor) {\n const grad = a as GradientResolved;\n const expanded = colorToGradient(\n (b as SolidFillResolved).color, b.opacity, b.blend, b.space, grad.type, grad.colors.length,\n );\n return [grad, expanded];\n }\n\n // Two different gradient types: coerce toward the destination (b) type.\n const ga = a as GradientResolved;\n const gb = b as GradientResolved;\n return [retypeGradient(ga, gb.type), gb];\n}\n"]}
1
+ {"version":3,"file":"coerce.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/coerce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAqBH,6EAA6E;AAC7E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAuB;IACjD,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;CACnB,CAAC,CAAC;AAEH,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,IAA0B;IACrD,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAA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EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAC7F,CAAC;QACF,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,wEAAwE;IACxE,MAAM,EAAE,GAAG,CAAqB,CAAC;IACjC,MAAM,EAAE,GAAG,CAAqB,CAAC;IACjC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\r\n * Cross-type fill coercion for tweening.\r\n *\r\n * The renderer dispatches by `fill.type`, so an in-between frame of a tween must\r\n * be a fully-formed fill of a single concrete type. When the two endpoints of a\r\n * tween have different types (e.g. a solid `color` animating into a\r\n * `linear-gradient`, or one gradient kind into another) we first promote both\r\n * endpoints to a common target type, then run that type's normal `lerp`.\r\n *\r\n * The rules, in order:\r\n *\r\n * - `color` is treated as a degenerate gradient — a single solid color. It is\r\n * the least \"rich\" fill, so when one side is a color and the other a\r\n * gradient, the gradient type wins and the color is expanded into a uniform\r\n * gradient (every stop set to that color). A uniform gradient renders\r\n * identically to the flat color, so frame 0 of a color→gradient tween looks\r\n * exactly like the color, then morphs into the gradient.\r\n *\r\n * - Two *different* gradient types share no geometry (a linear gradient's\r\n * start/end has no radial-gradient counterpart). There is no meaningful\r\n * in-between for that geometry, so we coerce toward the destination (`to`)\r\n * type: colors/stops/opacity interpolate while the geometry adopts the\r\n * destination's, snapped at frame 0.\r\n *\r\n * Coercion never mutates its input; it returns a fresh resolved fill.\r\n */\r\n\r\nimport type { NormalizedColor } from \"./color/parser\";\r\nimport type { FillResolved, FillCommon, FillSpace } from \"./union\";\r\nimport type { BlendMode } from \"./blend\";\r\nimport type { SolidFillResolved } from \"./implementations/color\";\r\nimport type { LinearGradientFillResolved } from \"./implementations/linear-gradient\";\r\nimport type { RadialGradientFillResolved } from \"./implementations/radial-gradient\";\r\nimport type { ConicGradientFillResolved } from \"./implementations/conic-gradient\";\r\n\r\n/**\r\n * Resolved fills that carry a `colors` array (every gradient variant), with the\r\n * cross-cutting {@link FillCommon} fields (`space`) mixed in — mirroring how the\r\n * registry's `FillResolved` union wraps each implementation in `WithCommon`.\r\n */\r\ntype GradientResolved = FillCommon & (\r\n | LinearGradientFillResolved\r\n | RadialGradientFillResolved\r\n | ConicGradientFillResolved\r\n);\r\n\r\n/** Fill types that can participate in cross-type color/gradient tweening. */\r\nconst GRADIENT_TYPES = new Set<FillResolved[\"type\"]>([\r\n \"linear-gradient\",\r\n \"radial-gradient\",\r\n \"conic-gradient\",\r\n]);\r\n\r\n/** True if `type` is a gradient (linear/radial/conic). */\r\nexport function isGradientType(type: FillResolved[\"type\"]): boolean {\r\n return GRADIENT_TYPES.has(type);\r\n}\r\n\r\n/**\r\n * True if `a` and `b` can be tweened across their differing types — i.e. each is\r\n * either a solid color or a gradient, and at least one is a gradient. (Same-type\r\n * pairs are handled by the registry directly and never reach coercion.)\r\n */\r\nexport function canCoerce(a: FillResolved, b: FillResolved): boolean {\r\n const aColorish = a.type === \"solid\" || isGradientType(a.type);\r\n const bColorish = b.type === \"solid\" || isGradientType(b.type);\r\n if (!aColorish || !bColorish) return false;\r\n // At least one gradient — color↔color is same-type and never reaches here.\r\n return isGradientType(a.type) || isGradientType(b.type);\r\n}\r\n\r\n/** Builds a stop list of `count` evenly spaced positions in [0, 1]. */\r\nfunction evenStops(count: number): number[] {\r\n return Array.from({ length: count }, (_, i) => i / Math.max(1, count - 1));\r\n}\r\n\r\n/**\r\n * Expands a solid color into a gradient of `targetType` whose every stop is that\r\n * color, matching `stopCount` colors so the resulting gradient lerps cleanly\r\n * against the real gradient on the other side. The geometry defaults match each\r\n * gradient's `resolve()` so a uniform gradient renders as a flat color.\r\n */\r\nfunction colorToGradient(\r\n color: NormalizedColor,\r\n opacity: number | undefined,\r\n blend: BlendMode | undefined,\r\n space: FillSpace | undefined,\r\n targetType: GradientResolved[\"type\"],\r\n stopCount: number,\r\n): GradientResolved {\r\n const n = Math.max(2, stopCount);\r\n const colors: NormalizedColor[] = Array.from({ length: n }, () => [...color] as NormalizedColor);\r\n const stops = evenStops(n);\r\n const common = { colors, stops, opacity, blend, space };\r\n\r\n switch (targetType) {\r\n case \"linear-gradient\":\r\n return { type: \"linear-gradient\", ...common, start: { x: -1, y: 1 }, end: { x: 1, y: -1 } };\r\n case \"radial-gradient\":\r\n return { type: \"radial-gradient\", ...common, center: { x: 0, y: 0 }, radius: 100 };\r\n case \"conic-gradient\":\r\n return { type: \"conic-gradient\", ...common, center: { x: 0, y: 0 }, startAngle: 0 };\r\n }\r\n}\r\n\r\n/**\r\n * Re-types a gradient as `targetType`, carrying its colors/stops/opacity and\r\n * adopting the target type's default geometry. Used when tweening between two\r\n * different gradient kinds, whose geometries are not interpolatable.\r\n */\r\nfunction retypeGradient(\r\n g: GradientResolved,\r\n targetType: GradientResolved[\"type\"],\r\n): GradientResolved {\r\n if (g.type === targetType) return g;\r\n const common = { colors: g.colors, stops: g.stops, opacity: g.opacity, blend: g.blend, space: g.space };\r\n switch (targetType) {\r\n case \"linear-gradient\":\r\n return { type: \"linear-gradient\", ...common, start: { x: -1, y: 1 }, end: { x: 1, y: -1 } };\r\n case \"radial-gradient\":\r\n return { type: \"radial-gradient\", ...common, center: { x: 0, y: 0 }, radius: 100 };\r\n case \"conic-gradient\":\r\n return { type: \"conic-gradient\", ...common, center: { x: 0, y: 0 }, startAngle: 0 };\r\n }\r\n}\r\n\r\n/**\r\n * Promotes two differing-type fills (color and/or gradient) to a single common\r\n * type so the registry can lerp them with that type's `lerp`. Returns the\r\n * coerced `[a, b]` pair, both guaranteed to share `result[0].type`.\r\n *\r\n * Caller must have checked {@link canCoerce} first.\r\n */\r\nexport function coercePair(a: FillResolved, b: FillResolved): [FillResolved, FillResolved] {\r\n const aIsColor = a.type === \"solid\";\r\n const bIsColor = b.type === \"solid\";\r\n\r\n // color → gradient: expand the color to match the gradient's type.\r\n if (aIsColor && !bIsColor) {\r\n const grad = b as GradientResolved;\r\n const expanded = colorToGradient(\r\n (a as SolidFillResolved).color, a.opacity, a.blend, a.space, grad.type, grad.colors.length,\r\n );\r\n return [expanded, grad];\r\n }\r\n // gradient → color: expand the color (b) to match the gradient's (a) type.\r\n if (bIsColor && !aIsColor) {\r\n const grad = a as GradientResolved;\r\n const expanded = colorToGradient(\r\n (b as SolidFillResolved).color, b.opacity, b.blend, b.space, grad.type, grad.colors.length,\r\n );\r\n return [grad, expanded];\r\n }\r\n\r\n // Two different gradient types: coerce toward the destination (b) type.\r\n const ga = a as GradientResolved;\r\n const gb = b as GradientResolved;\r\n return [retypeGradient(ga, gb.type), gb];\r\n}\r\n"]}