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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +49 -48
  4. package/README.md +91 -91
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.js.map +1 -1
  7. package/dist/assets/errors.js.map +1 -1
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/assets/manager.d.ts.map +1 -1
  10. package/dist/assets/manager.js +7 -5
  11. package/dist/assets/manager.js.map +1 -1
  12. package/dist/assets/manifest.js.map +1 -1
  13. package/dist/assets/record.js.map +1 -1
  14. package/dist/assets/scope.js.map +1 -1
  15. package/dist/attributes/audio/effects/chain.d.ts +73 -0
  16. package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
  17. package/dist/attributes/audio/effects/chain.js +67 -0
  18. package/dist/attributes/audio/effects/chain.js.map +1 -0
  19. package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
  20. package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
  21. package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
  22. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
  23. package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
  24. package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
  25. package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
  26. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
  27. package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
  28. package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
  29. package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
  30. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
  31. package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
  32. package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
  33. package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
  34. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
  35. package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
  36. package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
  37. package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
  38. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
  39. package/dist/attributes/audio/effects/index.d.ts +12 -0
  40. package/dist/attributes/audio/effects/index.d.ts.map +1 -0
  41. package/dist/attributes/audio/effects/index.js +4 -0
  42. package/dist/attributes/audio/effects/index.js.map +1 -0
  43. package/dist/attributes/audio/effects/registry.d.ts +36 -0
  44. package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
  45. package/dist/attributes/audio/effects/registry.js +80 -0
  46. package/dist/attributes/audio/effects/registry.js.map +1 -0
  47. package/dist/attributes/audio/effects/union.d.ts +14 -0
  48. package/dist/attributes/audio/effects/union.d.ts.map +1 -0
  49. package/dist/attributes/audio/effects/union.js +24 -0
  50. package/dist/attributes/audio/effects/union.js.map +1 -0
  51. package/dist/attributes/audio/ramp.d.ts +103 -0
  52. package/dist/attributes/audio/ramp.d.ts.map +1 -0
  53. package/dist/attributes/audio/ramp.js +246 -0
  54. package/dist/attributes/audio/ramp.js.map +1 -0
  55. package/dist/attributes/audio/request.d.ts +24 -13
  56. package/dist/attributes/audio/request.d.ts.map +1 -1
  57. package/dist/attributes/audio/request.js +4 -3
  58. package/dist/attributes/audio/request.js.map +1 -1
  59. package/dist/attributes/audio/schedule.d.ts +21 -13
  60. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  61. package/dist/attributes/audio/schedule.js +42 -28
  62. package/dist/attributes/audio/schedule.js.map +1 -1
  63. package/dist/attributes/audio/sound.d.ts +15 -12
  64. package/dist/attributes/audio/sound.d.ts.map +1 -1
  65. package/dist/attributes/audio/sound.js +8 -10
  66. package/dist/attributes/audio/sound.js.map +1 -1
  67. package/dist/attributes/audio/transition.d.ts +33 -0
  68. package/dist/attributes/audio/transition.d.ts.map +1 -0
  69. package/dist/attributes/audio/transition.js +48 -0
  70. package/dist/attributes/audio/transition.js.map +1 -0
  71. package/dist/attributes/index.d.ts +4 -3
  72. package/dist/attributes/index.d.ts.map +1 -1
  73. package/dist/attributes/index.js +4 -7
  74. package/dist/attributes/index.js.map +1 -1
  75. package/dist/attributes/layout/alignment.js.map +1 -1
  76. package/dist/attributes/layout/index.js.map +1 -1
  77. package/dist/attributes/layout/insets.js.map +1 -1
  78. package/dist/attributes/layout/matrix2d.d.ts +2 -2
  79. package/dist/attributes/layout/matrix2d.js.map +1 -1
  80. package/dist/attributes/layout/size.js.map +1 -1
  81. package/dist/attributes/layout/space3d.js +1 -1
  82. package/dist/attributes/layout/space3d.js.map +1 -1
  83. package/dist/attributes/layout/transform3d.js.map +1 -1
  84. package/dist/attributes/layout/vector2.js.map +1 -1
  85. package/dist/attributes/layout/world-transform.js.map +1 -1
  86. package/dist/attributes/mask/boolean.js.map +1 -1
  87. package/dist/attributes/mask/mask.js.map +1 -1
  88. package/dist/attributes/properties/decorator.js.map +1 -1
  89. package/dist/attributes/properties/inputs.js.map +1 -1
  90. package/dist/attributes/properties/typed.d.ts +7 -7
  91. package/dist/attributes/properties/typed.d.ts.map +1 -1
  92. package/dist/attributes/properties/typed.js +6 -6
  93. package/dist/attributes/properties/typed.js.map +1 -1
  94. package/dist/attributes/render3d/orbit.js.map +1 -1
  95. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -2
  96. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  97. package/dist/attributes/shape/corners/corner-radius.js +1 -2
  98. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  99. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js.map +1 -1
  101. package/dist/attributes/shape/corners/index.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  103. package/dist/attributes/shape/effects/chain.d.ts +96 -409
  104. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  105. package/dist/attributes/shape/effects/chain.js +93 -283
  106. package/dist/attributes/shape/effects/chain.js.map +1 -1
  107. package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
  108. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
  110. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
  112. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
  114. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
  116. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
  118. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
  120. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
  122. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
  124. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
  126. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/blur.js +13 -5
  128. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
  130. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
  132. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
  134. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
  136. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
  138. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
  140. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  141. package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
  142. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/implementations/curves.js +26 -23
  144. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  145. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
  146. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  147. package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
  148. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  149. package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
  150. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  151. package/dist/attributes/shape/effects/implementations/dither.js +26 -20
  152. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  153. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +46 -14
  154. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  155. package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
  156. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  157. package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
  158. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  159. package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
  160. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  161. package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
  162. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  163. package/dist/attributes/shape/effects/implementations/edges.js +17 -14
  164. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  165. package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
  166. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  167. package/dist/attributes/shape/effects/implementations/glass.js +28 -22
  168. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  169. package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
  170. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  171. package/dist/attributes/shape/effects/implementations/glow.js +74 -72
  172. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  173. package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
  174. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  175. package/dist/attributes/shape/effects/implementations/grain.js +21 -18
  176. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  177. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
  178. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  179. package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
  180. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  181. package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
  182. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  183. package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
  184. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  185. package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
  186. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  187. package/dist/attributes/shape/effects/implementations/invert.js +15 -10
  188. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  189. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
  190. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  191. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
  192. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  193. package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
  194. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  195. package/dist/attributes/shape/effects/implementations/lut.js +20 -16
  196. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  197. package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
  198. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  199. package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
  200. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  201. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
  202. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  203. package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
  204. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  205. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
  206. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  207. package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
  208. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  209. package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
  210. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  211. package/dist/attributes/shape/effects/implementations/outline.js +18 -17
  212. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  213. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
  214. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  215. package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
  216. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  217. package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
  218. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  219. package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
  220. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  221. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
  222. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  223. package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
  224. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  225. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
  226. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  227. package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
  228. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  229. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
  230. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  231. package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
  232. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  233. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
  234. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  235. package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
  236. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  237. package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
  238. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  239. package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
  240. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  241. package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
  242. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  243. package/dist/attributes/shape/effects/implementations/shader.js +42 -26
  244. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  245. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
  246. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  247. package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
  248. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  249. package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
  250. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  251. package/dist/attributes/shape/effects/implementations/streak.js +19 -16
  252. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  253. package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
  254. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  255. package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
  256. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  257. package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
  258. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  259. package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
  260. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  261. package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
  262. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  263. package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
  264. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  265. package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
  266. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  267. package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
  268. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  269. package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
  270. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  271. package/dist/attributes/shape/effects/implementations/wave.js +26 -23
  272. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  273. package/dist/attributes/shape/effects/index.d.ts +4 -2
  274. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  275. package/dist/attributes/shape/effects/index.js +1 -1
  276. package/dist/attributes/shape/effects/index.js.map +1 -1
  277. package/dist/attributes/shape/effects/registry.d.ts +11 -0
  278. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  279. package/dist/attributes/shape/effects/registry.js +113 -102
  280. package/dist/attributes/shape/effects/registry.js.map +1 -1
  281. package/dist/attributes/shape/effects/spec.d.ts +229 -0
  282. package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
  283. package/dist/attributes/shape/effects/spec.js +178 -0
  284. package/dist/attributes/shape/effects/spec.js.map +1 -0
  285. package/dist/attributes/shape/effects/union.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.js.map +1 -1
  287. package/dist/attributes/shape/fill/chain.d.ts +7 -9
  288. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  289. package/dist/attributes/shape/fill/chain.js +9 -11
  290. package/dist/attributes/shape/fill/chain.js.map +1 -1
  291. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  292. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  293. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  294. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  295. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  296. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  297. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  298. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  299. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  300. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  301. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  302. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  303. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  304. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  305. package/dist/attributes/shape/fill/implementations/shader.d.ts +27 -26
  306. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  307. package/dist/attributes/shape/fill/implementations/shader.js +20 -14
  308. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  309. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  311. package/dist/attributes/shape/fill/index.d.ts +1 -1
  312. package/dist/attributes/shape/fill/index.d.ts.map +1 -1
  313. package/dist/attributes/shape/fill/index.js.map +1 -1
  314. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  315. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  316. package/dist/attributes/shape/fill/registry.d.ts +1 -2
  317. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  318. package/dist/attributes/shape/fill/registry.js +1 -2
  319. package/dist/attributes/shape/fill/registry.js.map +1 -1
  320. package/dist/attributes/shape/fill/union.js.map +1 -1
  321. package/dist/attributes/shape/filters/chain.d.ts +2 -6
  322. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  323. package/dist/attributes/shape/filters/chain.js +1 -5
  324. package/dist/attributes/shape/filters/chain.js.map +1 -1
  325. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  326. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  327. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  328. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
  329. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  330. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  331. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  332. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  333. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  334. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  335. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  336. package/dist/attributes/shape/filters/index.js.map +1 -1
  337. package/dist/attributes/shape/filters/registry.d.ts +1 -1
  338. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  339. package/dist/attributes/shape/filters/registry.js +3 -3
  340. package/dist/attributes/shape/filters/registry.js.map +1 -1
  341. package/dist/attributes/shape/filters/union.d.ts +2 -3
  342. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  343. package/dist/attributes/shape/filters/union.js.map +1 -1
  344. package/dist/attributes/shape/path/anchors.js.map +1 -1
  345. package/dist/attributes/shape/path/bezier.js.map +1 -1
  346. package/dist/attributes/shape/path/index.js.map +1 -1
  347. package/dist/attributes/shape/path/measure.js.map +1 -1
  348. package/dist/attributes/shape/path/morph.js.map +1 -1
  349. package/dist/attributes/shape/path/ops.js.map +1 -1
  350. package/dist/attributes/shape/path/types.js.map +1 -1
  351. package/dist/attributes/shape/path/walk.js.map +1 -1
  352. package/dist/attributes/shape/shaders/index.d.ts +2 -0
  353. package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
  354. package/dist/attributes/shape/shaders/index.js +2 -0
  355. package/dist/attributes/shape/shaders/index.js.map +1 -1
  356. package/dist/attributes/shape/shaders/language.d.ts +26 -0
  357. package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
  358. package/dist/attributes/shape/shaders/language.js +20 -0
  359. package/dist/attributes/shape/shaders/language.js.map +1 -0
  360. package/dist/attributes/shape/shaders/pack.d.ts +25 -11
  361. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  362. package/dist/attributes/shape/shaders/pack.js +9 -4
  363. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  364. package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
  365. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  366. package/dist/attributes/shape/shaders/resolve.js +3 -6
  367. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  368. package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
  369. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
  370. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  371. package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
  372. package/dist/attributes/shape/shadow/index.js.map +1 -1
  373. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  374. package/dist/attributes/shape/stroke/index.js.map +1 -1
  375. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  376. package/dist/attributes/shared/operators.js.map +1 -1
  377. package/dist/attributes/text/index.js.map +1 -1
  378. package/dist/attributes/text/ops.js.map +1 -1
  379. package/dist/attributes/text/types.js.map +1 -1
  380. package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
  381. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
  382. package/dist/browser/chunks/chunk-7DB6BI27.js +6 -0
  383. package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
  384. package/dist/browser/chunks/chunk-IX53IFBD.js +13 -0
  385. package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
  386. package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
  387. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
  388. package/dist/browser/component.js +1 -1
  389. package/dist/browser/experimental.js +1 -1
  390. package/dist/browser/experimental.js.map +4 -4
  391. package/dist/browser/index.js +1 -1
  392. package/dist/browser/index.js.map +2 -2
  393. package/dist/browser/manifest.json +1 -1
  394. package/dist/browser/sdk.js +1 -1
  395. package/dist/component.js.map +1 -1
  396. package/dist/components/builtins/audio/audio.d.ts +14 -5
  397. package/dist/components/builtins/audio/audio.d.ts.map +1 -1
  398. package/dist/components/builtins/audio/audio.js +10 -13
  399. package/dist/components/builtins/audio/audio.js.map +1 -1
  400. package/dist/components/builtins/geometry/composite.d.ts +3 -3
  401. package/dist/components/builtins/geometry/composite.js.map +1 -1
  402. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  403. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  404. package/dist/components/builtins/layout/layout.js.map +1 -1
  405. package/dist/components/builtins/media/media.d.ts +7 -7
  406. package/dist/components/builtins/media/media.d.ts.map +1 -1
  407. package/dist/components/builtins/media/media.js +4 -10
  408. package/dist/components/builtins/media/media.js.map +1 -1
  409. package/dist/components/builtins/providers/providers.js.map +1 -1
  410. package/dist/components/builtins/text/number-format.js.map +1 -1
  411. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  412. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  413. package/dist/components/builtins/text/text-layout.js.map +1 -1
  414. package/dist/components/builtins/text/text.d.ts +9 -9
  415. package/dist/components/builtins/text/text.d.ts.map +1 -1
  416. package/dist/components/builtins/text/text.js +3 -0
  417. package/dist/components/builtins/text/text.js.map +1 -1
  418. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  419. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  420. package/dist/components/builtins/three/three.js.map +1 -1
  421. package/dist/components/factory/api.d.ts +38 -11
  422. package/dist/components/factory/api.d.ts.map +1 -1
  423. package/dist/components/factory/api.js.map +1 -1
  424. package/dist/components/factory/clip-of.js.map +1 -1
  425. package/dist/components/factory/commands-for.js.map +1 -1
  426. package/dist/components/factory/component-audio.js.map +1 -1
  427. package/dist/components/factory/component2d.js.map +1 -1
  428. package/dist/components/factory/component3d.d.ts.map +1 -1
  429. package/dist/components/factory/component3d.js +11 -3
  430. package/dist/components/factory/component3d.js.map +1 -1
  431. package/dist/components/factory/factory.d.ts +3 -0
  432. package/dist/components/factory/factory.d.ts.map +1 -1
  433. package/dist/components/factory/factory.js +39 -5
  434. package/dist/components/factory/factory.js.map +1 -1
  435. package/dist/components/factory/timeline.js.map +1 -1
  436. package/dist/components/factory/type-def.js.map +1 -1
  437. package/dist/components/factory/types.js.map +1 -1
  438. package/dist/components/factory/views.js.map +1 -1
  439. package/dist/components/modules/aim.js.map +1 -1
  440. package/dist/components/modules/corners.js.map +1 -1
  441. package/dist/components/modules/flow.js.map +1 -1
  442. package/dist/components/modules/material.js.map +1 -1
  443. package/dist/components/modules/paint.js.map +1 -1
  444. package/dist/components/modules/shapes.js.map +1 -1
  445. package/dist/components/modules/text-layout.js.map +1 -1
  446. package/dist/components/modules/text-style.js.map +1 -1
  447. package/dist/components/modules/three-entries.js.map +1 -1
  448. package/dist/components/modules/view3d.js.map +1 -1
  449. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  450. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  451. package/dist/components/trees/2d/node-motion.js.map +1 -1
  452. package/dist/components/trees/2d/node-render.d.ts +1 -1
  453. package/dist/components/trees/2d/node-render.js +1 -1
  454. package/dist/components/trees/2d/node-render.js.map +1 -1
  455. package/dist/components/trees/2d/node-space.js.map +1 -1
  456. package/dist/components/trees/2d/node-transform.js.map +1 -1
  457. package/dist/components/trees/2d/node2d.d.ts +1 -1
  458. package/dist/components/trees/2d/node2d.js +1 -1
  459. package/dist/components/trees/2d/node2d.js.map +1 -1
  460. package/dist/components/trees/audio/index.js.map +1 -1
  461. package/dist/components/trees/audio/node-audio.d.ts +16 -9
  462. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  463. package/dist/components/trees/audio/node-audio.js +15 -11
  464. package/dist/components/trees/audio/node-audio.js.map +1 -1
  465. package/dist/components/trees/index.js.map +1 -1
  466. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  467. package/dist/components/trees/node/node-reactive.js.map +1 -1
  468. package/dist/components/trees/node/node-time.js.map +1 -1
  469. package/dist/components/trees/node/node-walk.js.map +1 -1
  470. package/dist/components/trees/node/node.js.map +1 -1
  471. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  472. package/dist/components/trees/three/node3d.js.map +1 -1
  473. package/dist/document/audio.js.map +1 -1
  474. package/dist/document/builtins.js.map +1 -1
  475. package/dist/document/command-traits.d.ts +12 -2
  476. package/dist/document/command-traits.d.ts.map +1 -1
  477. package/dist/document/command-traits.js +34 -6
  478. package/dist/document/command-traits.js.map +1 -1
  479. package/dist/document/deny-globals.js.map +1 -1
  480. package/dist/document/diff.js.map +1 -1
  481. package/dist/document/doc-index.js.map +1 -1
  482. package/dist/document/expression/compile.js.map +1 -1
  483. package/dist/document/expression/index.js.map +1 -1
  484. package/dist/document/expression/ops.js.map +1 -1
  485. package/dist/document/expression/parse.js.map +1 -1
  486. package/dist/document/expression/refs.js.map +1 -1
  487. package/dist/document/expression/types.js.map +1 -1
  488. package/dist/document/expression/walk.js.map +1 -1
  489. package/dist/document/index.d.ts +8 -0
  490. package/dist/document/index.d.ts.map +1 -1
  491. package/dist/document/index.js +4 -0
  492. package/dist/document/index.js.map +1 -1
  493. package/dist/document/migrate.d.ts +70 -0
  494. package/dist/document/migrate.d.ts.map +1 -0
  495. package/dist/document/migrate.js +202 -0
  496. package/dist/document/migrate.js.map +1 -0
  497. package/dist/document/missing-node.d.ts +27 -0
  498. package/dist/document/missing-node.d.ts.map +1 -0
  499. package/dist/document/missing-node.js +48 -0
  500. package/dist/document/missing-node.js.map +1 -0
  501. package/dist/document/node-decorator.js.map +1 -1
  502. package/dist/document/node-descriptor.d.ts +4 -0
  503. package/dist/document/node-descriptor.d.ts.map +1 -1
  504. package/dist/document/node-descriptor.js.map +1 -1
  505. package/dist/document/placement.d.ts +2 -1
  506. package/dist/document/placement.d.ts.map +1 -1
  507. package/dist/document/placement.js.map +1 -1
  508. package/dist/document/project.d.ts +2 -0
  509. package/dist/document/project.d.ts.map +1 -1
  510. package/dist/document/project.js +1 -0
  511. package/dist/document/project.js.map +1 -1
  512. package/dist/document/prop-evolution.d.ts +51 -0
  513. package/dist/document/prop-evolution.d.ts.map +1 -0
  514. package/dist/document/prop-evolution.js +83 -0
  515. package/dist/document/prop-evolution.js.map +1 -0
  516. package/dist/document/registry.d.ts +16 -0
  517. package/dist/document/registry.d.ts.map +1 -1
  518. package/dist/document/registry.js +30 -4
  519. package/dist/document/registry.js.map +1 -1
  520. package/dist/document/settled-index.d.ts +2 -0
  521. package/dist/document/settled-index.d.ts.map +1 -1
  522. package/dist/document/settled-index.js +5 -5
  523. package/dist/document/settled-index.js.map +1 -1
  524. package/dist/document/timeline-patch.d.ts +4 -0
  525. package/dist/document/timeline-patch.d.ts.map +1 -1
  526. package/dist/document/timeline-patch.js +28 -3
  527. package/dist/document/timeline-patch.js.map +1 -1
  528. package/dist/document/timeline.d.ts +45 -1
  529. package/dist/document/timeline.d.ts.map +1 -1
  530. package/dist/document/timeline.js +172 -42
  531. package/dist/document/timeline.js.map +1 -1
  532. package/dist/document/types.d.ts +14 -28
  533. package/dist/document/types.d.ts.map +1 -1
  534. package/dist/document/types.js.map +1 -1
  535. package/dist/document/validate.d.ts +17 -5
  536. package/dist/document/validate.d.ts.map +1 -1
  537. package/dist/document/validate.js +158 -21
  538. package/dist/document/validate.js.map +1 -1
  539. package/dist/document/vocabulary.d.ts +28 -0
  540. package/dist/document/vocabulary.d.ts.map +1 -0
  541. package/dist/document/vocabulary.js +42 -0
  542. package/dist/document/vocabulary.js.map +1 -0
  543. package/dist/experimental.d.ts +68 -8
  544. package/dist/experimental.d.ts.map +1 -1
  545. package/dist/experimental.js +22 -8
  546. package/dist/experimental.js.map +1 -1
  547. package/dist/index.js.map +1 -1
  548. package/dist/layout/bounds.js.map +1 -1
  549. package/dist/layout/constraints.js.map +1 -1
  550. package/dist/layout/flex.js.map +1 -1
  551. package/dist/layout/freeform.js.map +1 -1
  552. package/dist/layout/grid.js.map +1 -1
  553. package/dist/layout/index.js.map +1 -1
  554. package/dist/layout/item.js.map +1 -1
  555. package/dist/layout/ops.js.map +1 -1
  556. package/dist/layout/types.js.map +1 -1
  557. package/dist/platform/audio-sink.js.map +1 -1
  558. package/dist/platform/exporter.d.ts +13 -0
  559. package/dist/platform/exporter.d.ts.map +1 -1
  560. package/dist/platform/exporter.js.map +1 -1
  561. package/dist/platform/index.js.map +1 -1
  562. package/dist/platform/stepped-clock.js.map +1 -1
  563. package/dist/platform/storage-adapter.js.map +1 -1
  564. package/dist/platform/ticker.js.map +1 -1
  565. package/dist/project/config.js.map +1 -1
  566. package/dist/project/index.js.map +1 -1
  567. package/dist/project/tree.js.map +1 -1
  568. package/dist/props/host.js.map +1 -1
  569. package/dist/props/index.js.map +1 -1
  570. package/dist/props/observer.js.map +1 -1
  571. package/dist/props/slot.js.map +1 -1
  572. package/dist/renamed-scene-names.d.ts +1 -1
  573. package/dist/renamed-scene-names.d.ts.map +1 -1
  574. package/dist/renamed-scene-names.js +1 -1
  575. package/dist/renamed-scene-names.js.map +1 -1
  576. package/dist/render/canvas-render-context2d.d.ts +9 -0
  577. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  578. package/dist/render/canvas-render-context2d.js +10 -0
  579. package/dist/render/canvas-render-context2d.js.map +1 -1
  580. package/dist/render/clip-contains.js +1 -1
  581. package/dist/render/clip-contains.js.map +1 -1
  582. package/dist/render/clip.js.map +1 -1
  583. package/dist/render/descriptors/ellipse.js.map +1 -1
  584. package/dist/render/descriptors/line.js.map +1 -1
  585. package/dist/render/descriptors/path-builder.js.map +1 -1
  586. package/dist/render/descriptors/path.js.map +1 -1
  587. package/dist/render/descriptors/polygon.js.map +1 -1
  588. package/dist/render/descriptors/polygram.js.map +1 -1
  589. package/dist/render/descriptors/rect.js.map +1 -1
  590. package/dist/render/descriptors/richtext.js.map +1 -1
  591. package/dist/render/descriptors/shape.js.map +1 -1
  592. package/dist/render/descriptors/text.d.ts +2 -2
  593. package/dist/render/descriptors/text.js +2 -2
  594. package/dist/render/descriptors/text.js.map +1 -1
  595. package/dist/render/descriptors/transform.js.map +1 -1
  596. package/dist/render/graphics2d.js.map +1 -1
  597. package/dist/render/index.d.ts +2 -0
  598. package/dist/render/index.d.ts.map +1 -1
  599. package/dist/render/index.js +1 -0
  600. package/dist/render/index.js.map +1 -1
  601. package/dist/render/measure-context.js.map +1 -1
  602. package/dist/render/null-render-context.js.map +1 -1
  603. package/dist/render/render-context2d.d.ts +1 -1
  604. package/dist/render/render-context2d.js.map +1 -1
  605. package/dist/render/render-issue.d.ts +39 -0
  606. package/dist/render/render-issue.d.ts.map +1 -0
  607. package/dist/render/render-issue.js +29 -0
  608. package/dist/render/render-issue.js.map +1 -0
  609. package/dist/render/surface.d.ts +2 -2
  610. package/dist/render/surface.js.map +1 -1
  611. package/dist/render/text-defaults.js.map +1 -1
  612. package/dist/render/text-layout.js.map +1 -1
  613. package/dist/render3d/bounds3d.js.map +1 -1
  614. package/dist/render3d/builders.js.map +1 -1
  615. package/dist/render3d/camera.js.map +1 -1
  616. package/dist/render3d/fill3d.js.map +1 -1
  617. package/dist/render3d/geometry.js.map +1 -1
  618. package/dist/render3d/graphics3d.d.ts.map +1 -1
  619. package/dist/render3d/graphics3d.js +54 -5
  620. package/dist/render3d/graphics3d.js.map +1 -1
  621. package/dist/render3d/index.js.map +1 -1
  622. package/dist/render3d/inert.js.map +1 -1
  623. package/dist/render3d/light.js.map +1 -1
  624. package/dist/render3d/material.js.map +1 -1
  625. package/dist/render3d/matrix4.js.map +1 -1
  626. package/dist/render3d/render-context3d.js.map +1 -1
  627. package/dist/render3d/resources.js.map +1 -1
  628. package/dist/render3d/rounded-box.js.map +1 -1
  629. package/dist/render3d/scene-settings.js.map +1 -1
  630. package/dist/render3d/scene3d.js.map +1 -1
  631. package/dist/render3d/segments.js.map +1 -1
  632. package/dist/render3d/texture.js.map +1 -1
  633. package/dist/render3d/tracking.js.map +1 -1
  634. package/dist/render3d/transform.js.map +1 -1
  635. package/dist/render3d/vector3.js.map +1 -1
  636. package/dist/render3d/walk.js.map +1 -1
  637. package/dist/runtime/asset-refine.js +2 -1
  638. package/dist/runtime/asset-refine.js.map +1 -1
  639. package/dist/runtime/asset-timeline.d.ts +10 -0
  640. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  641. package/dist/runtime/asset-timeline.js.map +1 -1
  642. package/dist/runtime/asset-update.d.ts.map +1 -1
  643. package/dist/runtime/asset-update.js +7 -0
  644. package/dist/runtime/asset-update.js.map +1 -1
  645. package/dist/runtime/audio-index.js.map +1 -1
  646. package/dist/runtime/builtin-context.js.map +1 -1
  647. package/dist/runtime/clip-instance.d.ts +3 -1
  648. package/dist/runtime/clip-instance.d.ts.map +1 -1
  649. package/dist/runtime/clip-instance.js +4 -0
  650. package/dist/runtime/clip-instance.js.map +1 -1
  651. package/dist/runtime/clip-store.d.ts.map +1 -1
  652. package/dist/runtime/clip-store.js +17 -2
  653. package/dist/runtime/clip-store.js.map +1 -1
  654. package/dist/runtime/engine.d.ts +5 -3
  655. package/dist/runtime/engine.d.ts.map +1 -1
  656. package/dist/runtime/engine.js +2 -1
  657. package/dist/runtime/engine.js.map +1 -1
  658. package/dist/runtime/frame-time.js.map +1 -1
  659. package/dist/runtime/index.js.map +1 -1
  660. package/dist/runtime/node-picking.js.map +1 -1
  661. package/dist/runtime/node-picking3d.js.map +1 -1
  662. package/dist/runtime/placement.js.map +1 -1
  663. package/dist/runtime/playback-controller.d.ts.map +1 -1
  664. package/dist/runtime/playback-controller.js +14 -4
  665. package/dist/runtime/playback-controller.js.map +1 -1
  666. package/dist/runtime/playback.js.map +1 -1
  667. package/dist/runtime/precompisition.js.map +1 -1
  668. package/dist/runtime/project-assets.js.map +1 -1
  669. package/dist/runtime/session.d.ts +7 -3
  670. package/dist/runtime/session.d.ts.map +1 -1
  671. package/dist/runtime/session.js +11 -4
  672. package/dist/runtime/session.js.map +1 -1
  673. package/dist/runtime/settle.js.map +1 -1
  674. package/dist/runtime/state-evaluator.js.map +1 -1
  675. package/dist/runtime/text-geometry.d.ts +1 -1
  676. package/dist/runtime/text-geometry.js.map +1 -1
  677. package/dist/sdk/index.d.ts +8 -6
  678. package/dist/sdk/index.d.ts.map +1 -1
  679. package/dist/sdk/index.js +10 -3
  680. package/dist/sdk/index.js.map +1 -1
  681. package/dist/tween/command-decorator.d.ts +7 -0
  682. package/dist/tween/command-decorator.d.ts.map +1 -1
  683. package/dist/tween/command-decorator.js +1 -0
  684. package/dist/tween/command-decorator.js.map +1 -1
  685. package/dist/tween/command.js.map +1 -1
  686. package/dist/tween/ease/constants.js.map +1 -1
  687. package/dist/tween/ease/curve.js.map +1 -1
  688. package/dist/tween/ease/describe.d.ts +2 -0
  689. package/dist/tween/ease/describe.d.ts.map +1 -1
  690. package/dist/tween/ease/describe.js +4 -0
  691. package/dist/tween/ease/describe.js.map +1 -1
  692. package/dist/tween/ease/spec.d.ts +31 -0
  693. package/dist/tween/ease/spec.d.ts.map +1 -0
  694. package/dist/tween/ease/spec.js +51 -0
  695. package/dist/tween/ease/spec.js.map +1 -0
  696. package/dist/tween/ease/type.js.map +1 -1
  697. package/dist/tween/index.d.ts +1 -0
  698. package/dist/tween/index.d.ts.map +1 -1
  699. package/dist/tween/index.js +1 -0
  700. package/dist/tween/index.js.map +1 -1
  701. package/dist/tween/inert.js.map +1 -1
  702. package/dist/tween/lerp.js.map +1 -1
  703. package/dist/tween/loop.js.map +1 -1
  704. package/dist/tween/prepare.js.map +1 -1
  705. package/dist/tween/stepper.js.map +1 -1
  706. package/dist/tween/to-command.js.map +1 -1
  707. package/dist/util/clamp.js.map +1 -1
  708. package/dist/util/context.js.map +1 -1
  709. package/dist/util/csv.js.map +1 -1
  710. package/dist/util/generateList.js.map +1 -1
  711. package/dist/util/index.js.map +1 -1
  712. package/dist/util/metrics.js.map +1 -1
  713. package/dist/util/random.js.map +1 -1
  714. package/dist/util/reference.js.map +1 -1
  715. package/dist/util/scheduler.js.map +1 -1
  716. package/package.json +2 -2
  717. package/dist/attributes/audio/filters/chain.d.ts +0 -113
  718. package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
  719. package/dist/attributes/audio/filters/chain.js +0 -104
  720. package/dist/attributes/audio/filters/chain.js.map +0 -1
  721. package/dist/attributes/audio/filters/curve.d.ts +0 -152
  722. package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
  723. package/dist/attributes/audio/filters/curve.js +0 -250
  724. package/dist/attributes/audio/filters/curve.js.map +0 -1
  725. package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
  726. package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
  727. package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
  728. package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
  729. package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
  730. package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
  731. package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
  732. package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
  733. package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
  734. package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
  735. package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
  736. package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
  737. package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
  738. package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
  739. package/dist/attributes/audio/filters/implementations/speed.js +0 -6
  740. package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
  741. package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
  742. package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
  743. package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
  744. package/dist/attributes/audio/filters/index.d.ts +0 -22
  745. package/dist/attributes/audio/filters/index.d.ts.map +0 -1
  746. package/dist/attributes/audio/filters/index.js +0 -8
  747. package/dist/attributes/audio/filters/index.js.map +0 -1
  748. package/dist/attributes/audio/filters/registry.d.ts +0 -36
  749. package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
  750. package/dist/attributes/audio/filters/registry.js +0 -82
  751. package/dist/attributes/audio/filters/registry.js.map +0 -1
  752. package/dist/attributes/audio/filters/union.d.ts +0 -18
  753. package/dist/attributes/audio/filters/union.d.ts.map +0 -1
  754. package/dist/attributes/audio/filters/union.js +0 -28
  755. package/dist/attributes/audio/filters/union.js.map +0 -1
  756. package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
  757. package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
  758. package/dist/attributes/shape/sksl-uniforms.js +0 -0
  759. package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
  760. package/dist/browser/chunks/chunk-D4FSTPML.js +0 -14
  761. package/dist/browser/chunks/chunk-D4FSTPML.js.map +0 -7
  762. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
  763. package/dist/browser/chunks/chunk-RTNATFWX.js +0 -5
  764. package/dist/browser/chunks/chunk-RTNATFWX.js.map +0 -7
  765. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
  766. package/dist/component/api.d.ts +0 -508
  767. package/dist/component/api.d.ts.map +0 -1
  768. package/dist/component/api.js +0 -4
  769. package/dist/component/api.js.map +0 -1
  770. package/dist/component/builtins/audio.d.ts +0 -26
  771. package/dist/component/builtins/audio.d.ts.map +0 -1
  772. package/dist/component/builtins/audio.js +0 -41
  773. package/dist/component/builtins/audio.js.map +0 -1
  774. package/dist/component/builtins/canvas3d.d.ts +0 -98
  775. package/dist/component/builtins/canvas3d.d.ts.map +0 -1
  776. package/dist/component/builtins/canvas3d.js +0 -21
  777. package/dist/component/builtins/canvas3d.js.map +0 -1
  778. package/dist/component/builtins/composite.d.ts +0 -56
  779. package/dist/component/builtins/composite.d.ts.map +0 -1
  780. package/dist/component/builtins/composite.js +0 -25
  781. package/dist/component/builtins/composite.js.map +0 -1
  782. package/dist/component/builtins/geometry.d.ts +0 -505
  783. package/dist/component/builtins/geometry.d.ts.map +0 -1
  784. package/dist/component/builtins/geometry.js +0 -107
  785. package/dist/component/builtins/geometry.js.map +0 -1
  786. package/dist/component/builtins/layout.d.ts +0 -88
  787. package/dist/component/builtins/layout.d.ts.map +0 -1
  788. package/dist/component/builtins/layout.js +0 -84
  789. package/dist/component/builtins/layout.js.map +0 -1
  790. package/dist/component/builtins/media.d.ts +0 -95
  791. package/dist/component/builtins/media.d.ts.map +0 -1
  792. package/dist/component/builtins/media.js +0 -149
  793. package/dist/component/builtins/media.js.map +0 -1
  794. package/dist/component/builtins/providers.d.ts +0 -23
  795. package/dist/component/builtins/providers.d.ts.map +0 -1
  796. package/dist/component/builtins/providers.js +0 -30
  797. package/dist/component/builtins/providers.js.map +0 -1
  798. package/dist/component/builtins/text.d.ts +0 -193
  799. package/dist/component/builtins/text.d.ts.map +0 -1
  800. package/dist/component/builtins/text.js +0 -113
  801. package/dist/component/builtins/text.js.map +0 -1
  802. package/dist/component/builtins/three.d.ts +0 -1085
  803. package/dist/component/builtins/three.d.ts.map +0 -1
  804. package/dist/component/builtins/three.js +0 -265
  805. package/dist/component/builtins/three.js.map +0 -1
  806. package/dist/component/clip-of.d.ts +0 -5
  807. package/dist/component/clip-of.d.ts.map +0 -1
  808. package/dist/component/clip-of.js +0 -33
  809. package/dist/component/clip-of.js.map +0 -1
  810. package/dist/component/commands-for.d.ts +0 -19
  811. package/dist/component/commands-for.d.ts.map +0 -1
  812. package/dist/component/commands-for.js +0 -5
  813. package/dist/component/commands-for.js.map +0 -1
  814. package/dist/component/component-audio.d.ts +0 -9
  815. package/dist/component/component-audio.d.ts.map +0 -1
  816. package/dist/component/component-audio.js +0 -18
  817. package/dist/component/component-audio.js.map +0 -1
  818. package/dist/component/component2d.d.ts +0 -9
  819. package/dist/component/component2d.d.ts.map +0 -1
  820. package/dist/component/component2d.js +0 -239
  821. package/dist/component/component2d.js.map +0 -1
  822. package/dist/component/component3d.d.ts +0 -9
  823. package/dist/component/component3d.d.ts.map +0 -1
  824. package/dist/component/component3d.js +0 -99
  825. package/dist/component/component3d.js.map +0 -1
  826. package/dist/component/factory.d.ts +0 -63
  827. package/dist/component/factory.d.ts.map +0 -1
  828. package/dist/component/factory.js +0 -313
  829. package/dist/component/factory.js.map +0 -1
  830. package/dist/component/modules/aim.d.ts +0 -30
  831. package/dist/component/modules/aim.d.ts.map +0 -1
  832. package/dist/component/modules/aim.js +0 -39
  833. package/dist/component/modules/aim.js.map +0 -1
  834. package/dist/component/modules/corners.d.ts +0 -13
  835. package/dist/component/modules/corners.d.ts.map +0 -1
  836. package/dist/component/modules/corners.js +0 -12
  837. package/dist/component/modules/corners.js.map +0 -1
  838. package/dist/component/modules/flow.d.ts +0 -26
  839. package/dist/component/modules/flow.d.ts.map +0 -1
  840. package/dist/component/modules/flow.js +0 -55
  841. package/dist/component/modules/flow.js.map +0 -1
  842. package/dist/component/modules/material.d.ts +0 -40
  843. package/dist/component/modules/material.d.ts.map +0 -1
  844. package/dist/component/modules/material.js +0 -75
  845. package/dist/component/modules/material.js.map +0 -1
  846. package/dist/component/modules/paint.d.ts +0 -71
  847. package/dist/component/modules/paint.d.ts.map +0 -1
  848. package/dist/component/modules/paint.js +0 -106
  849. package/dist/component/modules/paint.js.map +0 -1
  850. package/dist/component/modules/shapes.d.ts +0 -31
  851. package/dist/component/modules/shapes.d.ts.map +0 -1
  852. package/dist/component/modules/shapes.js +0 -43
  853. package/dist/component/modules/shapes.js.map +0 -1
  854. package/dist/component/modules/text-layout.d.ts +0 -26
  855. package/dist/component/modules/text-layout.d.ts.map +0 -1
  856. package/dist/component/modules/text-layout.js +0 -57
  857. package/dist/component/modules/text-layout.js.map +0 -1
  858. package/dist/component/modules/text-style.d.ts +0 -48
  859. package/dist/component/modules/text-style.d.ts.map +0 -1
  860. package/dist/component/modules/text-style.js +0 -63
  861. package/dist/component/modules/text-style.js.map +0 -1
  862. package/dist/component/modules/three-entries.d.ts +0 -23
  863. package/dist/component/modules/three-entries.d.ts.map +0 -1
  864. package/dist/component/modules/three-entries.js +0 -41
  865. package/dist/component/modules/three-entries.js.map +0 -1
  866. package/dist/component/modules/view3d.d.ts +0 -55
  867. package/dist/component/modules/view3d.d.ts.map +0 -1
  868. package/dist/component/modules/view3d.js +0 -160
  869. package/dist/component/modules/view3d.js.map +0 -1
  870. package/dist/component/timeline.d.ts +0 -22
  871. package/dist/component/timeline.d.ts.map +0 -1
  872. package/dist/component/timeline.js +0 -128
  873. package/dist/component/timeline.js.map +0 -1
  874. package/dist/component/type-def.d.ts +0 -26
  875. package/dist/component/type-def.d.ts.map +0 -1
  876. package/dist/component/type-def.js +0 -16
  877. package/dist/component/type-def.js.map +0 -1
  878. package/dist/component/types.d.ts +0 -91
  879. package/dist/component/types.d.ts.map +0 -1
  880. package/dist/component/types.js +0 -88
  881. package/dist/component/types.js.map +0 -1
  882. package/dist/component/views.d.ts +0 -121
  883. package/dist/component/views.d.ts.map +0 -1
  884. package/dist/component/views.js +0 -413
  885. package/dist/component/views.js.map +0 -1
  886. package/dist/document/withdraw.d.ts +0 -28
  887. package/dist/document/withdraw.d.ts.map +0 -1
  888. package/dist/document/withdraw.js +0 -61
  889. package/dist/document/withdraw.js.map +0 -1
  890. package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
  891. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  892. package/dist/jsx/jsx-dev-runtime.js +0 -3
  893. package/dist/jsx/jsx-dev-runtime.js.map +0 -1
  894. package/dist/jsx/jsx-runtime.d.ts +0 -27
  895. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  896. package/dist/jsx/jsx-runtime.js +0 -26
  897. package/dist/jsx/jsx-runtime.js.map +0 -1
  898. package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
  899. package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
  900. package/dist/nodes/2d/node-lifecycle.js +0 -264
  901. package/dist/nodes/2d/node-lifecycle.js.map +0 -1
  902. package/dist/nodes/2d/node-motion.d.ts +0 -56
  903. package/dist/nodes/2d/node-motion.d.ts.map +0 -1
  904. package/dist/nodes/2d/node-motion.js +0 -86
  905. package/dist/nodes/2d/node-motion.js.map +0 -1
  906. package/dist/nodes/2d/node-render.d.ts +0 -44
  907. package/dist/nodes/2d/node-render.d.ts.map +0 -1
  908. package/dist/nodes/2d/node-render.js +0 -80
  909. package/dist/nodes/2d/node-render.js.map +0 -1
  910. package/dist/nodes/2d/node-space.d.ts +0 -63
  911. package/dist/nodes/2d/node-space.d.ts.map +0 -1
  912. package/dist/nodes/2d/node-space.js +0 -131
  913. package/dist/nodes/2d/node-space.js.map +0 -1
  914. package/dist/nodes/2d/node-transform.d.ts +0 -55
  915. package/dist/nodes/2d/node-transform.d.ts.map +0 -1
  916. package/dist/nodes/2d/node-transform.js +0 -73
  917. package/dist/nodes/2d/node-transform.js.map +0 -1
  918. package/dist/nodes/2d/node2d.d.ts +0 -1111
  919. package/dist/nodes/2d/node2d.d.ts.map +0 -1
  920. package/dist/nodes/2d/node2d.js +0 -1665
  921. package/dist/nodes/2d/node2d.js.map +0 -1
  922. package/dist/nodes/2d/paint-node.d.ts +0 -142
  923. package/dist/nodes/2d/paint-node.d.ts.map +0 -1
  924. package/dist/nodes/2d/paint-node.js +0 -232
  925. package/dist/nodes/2d/paint-node.js.map +0 -1
  926. package/dist/nodes/audio/audio-bus.d.ts +0 -28
  927. package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
  928. package/dist/nodes/audio/audio-bus.js +0 -33
  929. package/dist/nodes/audio/audio-bus.js.map +0 -1
  930. package/dist/nodes/audio/index.d.ts +0 -4
  931. package/dist/nodes/audio/index.d.ts.map +0 -1
  932. package/dist/nodes/audio/index.js +0 -2
  933. package/dist/nodes/audio/index.js.map +0 -1
  934. package/dist/nodes/audio/node-audio.d.ts +0 -107
  935. package/dist/nodes/audio/node-audio.d.ts.map +0 -1
  936. package/dist/nodes/audio/node-audio.js +0 -179
  937. package/dist/nodes/audio/node-audio.js.map +0 -1
  938. package/dist/nodes/audio/sound-node.d.ts +0 -41
  939. package/dist/nodes/audio/sound-node.d.ts.map +0 -1
  940. package/dist/nodes/audio/sound-node.js +0 -71
  941. package/dist/nodes/audio/sound-node.js.map +0 -1
  942. package/dist/nodes/geometry/boolean-node.d.ts +0 -28
  943. package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
  944. package/dist/nodes/geometry/boolean-node.js +0 -81
  945. package/dist/nodes/geometry/boolean-node.js.map +0 -1
  946. package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
  947. package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
  948. package/dist/nodes/geometry/bounds-shape-node.js +0 -181
  949. package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
  950. package/dist/nodes/geometry/box-path-node.d.ts +0 -89
  951. package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
  952. package/dist/nodes/geometry/box-path-node.js +0 -116
  953. package/dist/nodes/geometry/box-path-node.js.map +0 -1
  954. package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
  955. package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
  956. package/dist/nodes/geometry/ellipse-node.js +0 -45
  957. package/dist/nodes/geometry/ellipse-node.js.map +0 -1
  958. package/dist/nodes/geometry/group-bounds.d.ts +0 -56
  959. package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
  960. package/dist/nodes/geometry/group-bounds.js +0 -87
  961. package/dist/nodes/geometry/group-bounds.js.map +0 -1
  962. package/dist/nodes/geometry/mask-node.d.ts +0 -33
  963. package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
  964. package/dist/nodes/geometry/mask-node.js +0 -66
  965. package/dist/nodes/geometry/mask-node.js.map +0 -1
  966. package/dist/nodes/geometry/path-node.d.ts +0 -26
  967. package/dist/nodes/geometry/path-node.d.ts.map +0 -1
  968. package/dist/nodes/geometry/path-node.js +0 -58
  969. package/dist/nodes/geometry/path-node.js.map +0 -1
  970. package/dist/nodes/geometry/polygon-node.d.ts +0 -26
  971. package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
  972. package/dist/nodes/geometry/polygon-node.js +0 -47
  973. package/dist/nodes/geometry/polygon-node.js.map +0 -1
  974. package/dist/nodes/geometry/polygram-node.d.ts +0 -33
  975. package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
  976. package/dist/nodes/geometry/polygram-node.js +0 -52
  977. package/dist/nodes/geometry/polygram-node.js.map +0 -1
  978. package/dist/nodes/geometry/rect-node.d.ts +0 -38
  979. package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
  980. package/dist/nodes/geometry/rect-node.js +0 -56
  981. package/dist/nodes/geometry/rect-node.js.map +0 -1
  982. package/dist/nodes/geometry/shape-node.d.ts +0 -71
  983. package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
  984. package/dist/nodes/geometry/shape-node.js +0 -140
  985. package/dist/nodes/geometry/shape-node.js.map +0 -1
  986. package/dist/nodes/geometry/shape-outline.d.ts +0 -93
  987. package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
  988. package/dist/nodes/geometry/shape-outline.js +0 -470
  989. package/dist/nodes/geometry/shape-outline.js.map +0 -1
  990. package/dist/nodes/index.d.ts +0 -53
  991. package/dist/nodes/index.d.ts.map +0 -1
  992. package/dist/nodes/index.js +0 -35
  993. package/dist/nodes/index.js.map +0 -1
  994. package/dist/nodes/layout/camera-node.d.ts +0 -80
  995. package/dist/nodes/layout/camera-node.d.ts.map +0 -1
  996. package/dist/nodes/layout/camera-node.js +0 -153
  997. package/dist/nodes/layout/camera-node.js.map +0 -1
  998. package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
  999. package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
  1000. package/dist/nodes/layout/orbit-camera-node.js +0 -118
  1001. package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
  1002. package/dist/nodes/layout/rotated-box.d.ts +0 -20
  1003. package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
  1004. package/dist/nodes/layout/rotated-box.js +0 -76
  1005. package/dist/nodes/layout/rotated-box.js.map +0 -1
  1006. package/dist/nodes/media/video-node.d.ts +0 -229
  1007. package/dist/nodes/media/video-node.d.ts.map +0 -1
  1008. package/dist/nodes/media/video-node.js +0 -350
  1009. package/dist/nodes/media/video-node.js.map +0 -1
  1010. package/dist/nodes/node/declare-paints.d.ts +0 -19
  1011. package/dist/nodes/node/declare-paints.d.ts.map +0 -1
  1012. package/dist/nodes/node/declare-paints.js +0 -27
  1013. package/dist/nodes/node/declare-paints.js.map +0 -1
  1014. package/dist/nodes/node/node-editor-state.d.ts +0 -53
  1015. package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
  1016. package/dist/nodes/node/node-editor-state.js +0 -23
  1017. package/dist/nodes/node/node-editor-state.js.map +0 -1
  1018. package/dist/nodes/node/node-reactive.d.ts +0 -89
  1019. package/dist/nodes/node/node-reactive.d.ts.map +0 -1
  1020. package/dist/nodes/node/node-reactive.js +0 -135
  1021. package/dist/nodes/node/node-reactive.js.map +0 -1
  1022. package/dist/nodes/node/node-time.d.ts +0 -39
  1023. package/dist/nodes/node/node-time.d.ts.map +0 -1
  1024. package/dist/nodes/node/node-time.js +0 -14
  1025. package/dist/nodes/node/node-time.js.map +0 -1
  1026. package/dist/nodes/node/node-walk.d.ts +0 -46
  1027. package/dist/nodes/node/node-walk.d.ts.map +0 -1
  1028. package/dist/nodes/node/node-walk.js +0 -74
  1029. package/dist/nodes/node/node-walk.js.map +0 -1
  1030. package/dist/nodes/node/node.d.ts +0 -445
  1031. package/dist/nodes/node/node.d.ts.map +0 -1
  1032. package/dist/nodes/node/node.js +0 -745
  1033. package/dist/nodes/node/node.js.map +0 -1
  1034. package/dist/nodes/node/text-defaults.d.ts +0 -32
  1035. package/dist/nodes/node/text-defaults.d.ts.map +0 -1
  1036. package/dist/nodes/node/text-defaults.js +0 -37
  1037. package/dist/nodes/node/text-defaults.js.map +0 -1
  1038. package/dist/nodes/root/canvas2d-node.d.ts +0 -163
  1039. package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
  1040. package/dist/nodes/root/canvas2d-node.js +0 -264
  1041. package/dist/nodes/root/canvas2d-node.js.map +0 -1
  1042. package/dist/nodes/root/provider-node.d.ts +0 -47
  1043. package/dist/nodes/root/provider-node.d.ts.map +0 -1
  1044. package/dist/nodes/root/provider-node.js +0 -63
  1045. package/dist/nodes/root/provider-node.js.map +0 -1
  1046. package/dist/nodes/root/theme-provider-node.d.ts +0 -29
  1047. package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
  1048. package/dist/nodes/root/theme-provider-node.js +0 -43
  1049. package/dist/nodes/root/theme-provider-node.js.map +0 -1
  1050. package/dist/nodes/text/default-text-style-node.d.ts +0 -103
  1051. package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
  1052. package/dist/nodes/text/default-text-style-node.js +0 -146
  1053. package/dist/nodes/text/default-text-style-node.js.map +0 -1
  1054. package/dist/nodes/text/number-format.d.ts +0 -66
  1055. package/dist/nodes/text/number-format.d.ts.map +0 -1
  1056. package/dist/nodes/text/number-format.js +0 -227
  1057. package/dist/nodes/text/number-format.js.map +0 -1
  1058. package/dist/nodes/text/number-node.d.ts +0 -94
  1059. package/dist/nodes/text/number-node.d.ts.map +0 -1
  1060. package/dist/nodes/text/number-node.js +0 -86
  1061. package/dist/nodes/text/number-node.js.map +0 -1
  1062. package/dist/nodes/text/number-pattern.d.ts +0 -51
  1063. package/dist/nodes/text/number-pattern.d.ts.map +0 -1
  1064. package/dist/nodes/text/number-pattern.js +0 -77
  1065. package/dist/nodes/text/number-pattern.js.map +0 -1
  1066. package/dist/nodes/text/richtext-node.d.ts +0 -68
  1067. package/dist/nodes/text/richtext-node.d.ts.map +0 -1
  1068. package/dist/nodes/text/richtext-node.js +0 -78
  1069. package/dist/nodes/text/richtext-node.js.map +0 -1
  1070. package/dist/nodes/text/text-base.d.ts +0 -118
  1071. package/dist/nodes/text/text-base.d.ts.map +0 -1
  1072. package/dist/nodes/text/text-base.js +0 -153
  1073. package/dist/nodes/text/text-base.js.map +0 -1
  1074. package/dist/nodes/text/text-layout.d.ts +0 -87
  1075. package/dist/nodes/text/text-layout.d.ts.map +0 -1
  1076. package/dist/nodes/text/text-layout.js +0 -368
  1077. package/dist/nodes/text/text-layout.js.map +0 -1
  1078. package/dist/nodes/text/text-node.d.ts +0 -84
  1079. package/dist/nodes/text/text-node.d.ts.map +0 -1
  1080. package/dist/nodes/text/text-node.js +0 -188
  1081. package/dist/nodes/text/text-node.js.map +0 -1
  1082. package/dist/nodes/text/text-selection.d.ts +0 -125
  1083. package/dist/nodes/text/text-selection.d.ts.map +0 -1
  1084. package/dist/nodes/text/text-selection.js +0 -209
  1085. package/dist/nodes/text/text-selection.js.map +0 -1
  1086. package/dist/nodes/three/camera-nodes.d.ts +0 -109
  1087. package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
  1088. package/dist/nodes/three/camera-nodes.js +0 -112
  1089. package/dist/nodes/three/camera-nodes.js.map +0 -1
  1090. package/dist/nodes/three/canvas3d-node.d.ts +0 -295
  1091. package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
  1092. package/dist/nodes/three/canvas3d-node.js +0 -486
  1093. package/dist/nodes/three/canvas3d-node.js.map +0 -1
  1094. package/dist/nodes/three/drawable-nodes.d.ts +0 -173
  1095. package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
  1096. package/dist/nodes/three/drawable-nodes.js +0 -284
  1097. package/dist/nodes/three/drawable-nodes.js.map +0 -1
  1098. package/dist/nodes/three/environment-nodes.d.ts +0 -106
  1099. package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
  1100. package/dist/nodes/three/environment-nodes.js +0 -134
  1101. package/dist/nodes/three/environment-nodes.js.map +0 -1
  1102. package/dist/nodes/three/geometry-nodes.d.ts +0 -197
  1103. package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
  1104. package/dist/nodes/three/geometry-nodes.js +0 -322
  1105. package/dist/nodes/three/geometry-nodes.js.map +0 -1
  1106. package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
  1107. package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
  1108. package/dist/nodes/three/grid-geometry3d.js +0 -114
  1109. package/dist/nodes/three/grid-geometry3d.js.map +0 -1
  1110. package/dist/nodes/three/group3d.d.ts +0 -23
  1111. package/dist/nodes/three/group3d.d.ts.map +0 -1
  1112. package/dist/nodes/three/group3d.js +0 -21
  1113. package/dist/nodes/three/group3d.js.map +0 -1
  1114. package/dist/nodes/three/light-nodes.d.ts +0 -120
  1115. package/dist/nodes/three/light-nodes.d.ts.map +0 -1
  1116. package/dist/nodes/three/light-nodes.js +0 -173
  1117. package/dist/nodes/three/light-nodes.js.map +0 -1
  1118. package/dist/nodes/three/mesh3d.d.ts +0 -117
  1119. package/dist/nodes/three/mesh3d.d.ts.map +0 -1
  1120. package/dist/nodes/three/mesh3d.js +0 -147
  1121. package/dist/nodes/three/mesh3d.js.map +0 -1
  1122. package/dist/nodes/three/node3d.d.ts +0 -230
  1123. package/dist/nodes/three/node3d.d.ts.map +0 -1
  1124. package/dist/nodes/three/node3d.js +0 -337
  1125. package/dist/nodes/three/node3d.js.map +0 -1
  1126. package/dist/render/descriptors/latex.d.ts +0 -6
  1127. package/dist/render/descriptors/latex.d.ts.map +0 -1
  1128. package/dist/render/descriptors/latex.js +0 -2
  1129. package/dist/render/descriptors/latex.js.map +0 -1
  1130. package/dist/tween/seekable.d.ts +0 -81
  1131. package/dist/tween/seekable.d.ts.map +0 -1
  1132. package/dist/tween/seekable.js +0 -137
  1133. package/dist/tween/seekable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA0C,MAAM,yCAAyC,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAyB,MAAM,8CAA8C,CAAC;AAE9H,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAA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QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnG,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvF,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE;QAC5E,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK;KACrI,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;CAC3C,CAAC,CAAC","sourcesContent":["import { lerpCornerScalarStyle, type CornerStyle, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\nimport { STAR_DEFAULT_POINTS, STAR_DEFAULT_RATIO, type ShapeOutlineKind } from \"@/components/builtins/geometry/shape-outline\";\r\nimport type { NodeOf } from \"@/components/factory/api\";\r\nimport { component2d } from \"@/components/factory/component2d\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport * as Corners from \"@/components/modules/corners\";\r\nimport * as Flow from \"@/components/modules/flow\";\r\nimport * as Paint from \"@/components/modules/paint\";\r\nimport * as Shapes from \"@/components/modules/shapes\";\r\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\r\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { FlowProps } from \"@/layout/types\";\r\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport type { PathData } from \"@/render/descriptors/path\";\r\n\r\n/**\r\n * The geometry built-ins: paint, the flow engine for children (clear of the\r\n * stroke), and each one's outline.\r\n */\r\n\r\nconst scalarCorners = {\r\n cornerRadius: Types.number(0),\r\n cornerStyle: Types.custom<CornerStyle>(\"rounded\", { lerp: lerpCornerScalarStyle }),\r\n};\r\n\r\nexport const Rect = component2d({\r\n key: \"rect\",\r\n state: { ...Paint.state, ...Flow.state, ...Corners.state },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state)),\r\n});\r\n\r\nexport const Ellipse = component2d({\r\n key: \"ellipse\",\r\n state: {\r\n ...Paint.state, ...Flow.state,\r\n startAngle: Types.number(0),\r\n sweep: Types.number(360),\r\n ratio: Types.number(0),\r\n },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.ellipse(ctx.size, state)),\r\n});\r\n\r\nexport const Polygon = component2d({\r\n key: \"polygon\",\r\n state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ...scalarCorners },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygon(ctx.size, state)),\r\n});\r\n\r\nexport const Polygram = component2d({\r\n key: \"polygram\",\r\n state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ratio: Types.number(0.5), ...scalarCorners },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygram(ctx.size, state)),\r\n});\r\n\r\n/** The document's `path`: `data` in the unit space of its own box, so a resize is a width/height write. */\r\nexport const PathShape = component2d({\r\n key: \"path\",\r\n state: { ...Paint.state, ...Flow.state, data: Types.path },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.unitPath(ctx.size, state.data), { clipShape: Shapes.box(ctx.size) }),\r\n});\r\n\r\n/** Path data drawn at face value, hugging it: geometry written in code. */\r\nexport const Path = component2d({\r\n key: \"facePath\",\r\n state: { ...Paint.state, ...Flow.state, data: Types.path },\r\n defaults: { width: \"hug\", height: \"hug\" },\r\n commands: { ...Paint.commands },\r\n measure: (_measurer, state) => {\r\n const intrinsic = pathOps.size(state.data);\r\n const pad = state.padding;\r\n return { width: intrinsic.width + pad.left + pad.right, height: intrinsic.height + pad.top + pad.bottom };\r\n },\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.facePath(state.data), { clipShape: null }),\r\n});\r\n\r\nfunction boundsShape<const K extends string>(key: K, kind: ShapeOutlineKind) {\r\n return component2d({\r\n key,\r\n state: { ...Paint.state, ...Flow.state, ...scalarCorners },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(kind, ctx.size, state), { clipShape: Shapes.box(ctx.size) }),\r\n });\r\n}\r\n\r\nexport const Triangle = boundsShape(\"triangle\", \"triangle\");\r\nexport const RightTriangle = boundsShape(\"rightTriangle\", \"rightTriangle\");\r\nexport const Pentagon = boundsShape(\"pentagon\", \"pentagon\");\r\nexport const Hexagon = boundsShape(\"hexagon\", \"hexagon\");\r\nexport const Octagon = boundsShape(\"octagon\", \"octagon\");\r\n\r\nexport const Star = component2d({\r\n key: \"star\",\r\n state: {\r\n ...Paint.state, ...Flow.state, ...scalarCorners,\r\n points: Types.number(STAR_DEFAULT_POINTS),\r\n ratio: Types.number(STAR_DEFAULT_RATIO),\r\n },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(\"star\", ctx.size, {\r\n cornerRadius: state.cornerRadius, cornerStyle: state.cornerStyle, sides: Math.max(3, Math.round(state.points)), ratio: state.ratio,\r\n }), { clipShape: Shapes.box(ctx.size) }),\r\n});\r\n\r\nexport type Rect = NodeOf<typeof Rect>;\r\nexport type Ellipse = NodeOf<typeof Ellipse>;\r\nexport type Polygon = NodeOf<typeof Polygon>;\r\nexport type Polygram = NodeOf<typeof Polygram>;\r\nexport type PathShape = NodeOf<typeof PathShape>;\r\nexport type Path = NodeOf<typeof Path>;\r\nexport type Triangle = NodeOf<typeof Triangle>;\r\nexport type RightTriangle = NodeOf<typeof RightTriangle>;\r\nexport type Pentagon = NodeOf<typeof Pentagon>;\r\nexport type Hexagon = NodeOf<typeof Hexagon>;\r\nexport type Octagon = NodeOf<typeof Octagon>;\r\nexport type Star = NodeOf<typeof Star>;\r\n\r\n// What code building a shape names its props as. A call's own type is `CallProps<typeof Rect>`.\r\n\r\nexport interface PaintProps extends Node2DProps {\r\n /**\r\n * Fill layer(s). Each item can be:\r\n * - A plain CSS color string → treated as a solid fill\r\n * - A fill prop object (SolidFillProp, LinearGradientFillProp, …)\r\n * - An already-resolved fill object\r\n * - A {@link FillChain} from the `Fills` builder (e.g. `Fills.color('red')`)\r\n */\r\n fill?: Fill;\r\n /**\r\n * Stroke layer(s): a single {@link StrokeProp}, an array of them, or an\r\n * already-resolved stroke. `fill` inside each stroke accepts the same loose\r\n * values as the top-level fill prop.\r\n */\r\n stroke?: Stroke;\r\n /**\r\n * Shadow layer(s): a single {@link ShadowProp}, an array of them, or an\r\n * already-resolved shadow. `fill` inside each shadow accepts the same loose\r\n * values as the top-level fill prop.\r\n */\r\n shadow?: Shadow;\r\n start?: number;\r\n end?: number;\r\n}\r\n\r\nexport interface ShapeProps extends PaintProps, FlowProps {\r\n /**\r\n * Overlay layer(s) — the same loose values as {@link PaintProps.fill}, but\r\n * painted *over* this node's fill **and** its children (clipped to the node's\r\n * silhouette) while still sitting **under** the stroke. Use for textures\r\n * laid across the whole subtree, e.g. a VHS-grain image or video.\r\n */\r\n overlay?: Fill;\r\n}\r\n\r\nexport type FlexSize = number | \"fill\" | \"hug\";\r\n\r\nexport interface RectProps extends ShapeProps {\r\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\r\n cornerRadius: RectCornerRadius;\r\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\r\n cornerStyle: RectCornerStyle;\r\n}\r\n\r\nexport interface EllipseProps extends ShapeProps {\r\n ratio: number;\r\n sweep: number;\r\n startAngle: number;\r\n}\r\n\r\nexport interface PolygonProps extends ShapeProps {\r\n /** Number of sides. Must be ≥ 3. */\r\n sides: number;\r\n /** Vertex rounding radius in pixels. */\r\n cornerRadius: number;\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle;\r\n}\r\n\r\nexport interface PolygramProps extends ShapeProps {\r\n /** Number of outer points. Must be ≥ 3. */\r\n sides: number;\r\n /**\r\n * Inner-to-outer radius ratio (0–1). Controls how deeply the star points are cut.\r\n * At 1 the shape degenerates into a regular polygon; lower values produce sharper points.\r\n */\r\n ratio: number;\r\n /** Vertex rounding radius in pixels applied to both inner and outer vertices. */\r\n cornerRadius: number;\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle;\r\n}\r\n\r\nexport interface PathShapeProps extends ShapeProps {\r\n /**\r\n * The geometry, as an SVG `d` string in the node's **unit box** — see\r\n * {@link PathData}.\r\n */\r\n data: PathData\r\n}\r\n\r\nexport interface PathProps extends ShapeProps {\r\n data: PathData;\r\n}\r\n\r\n/**\r\n * The named shapes — a triangle, a right triangle, a pentagon, a hexagon, an\r\n * octagon, a star — as engine nodes.\r\n *\r\n * ## Why they aren't just a Polygon with `sides` set\r\n *\r\n * A `Polygon` inscribes its n-gon in the node's box, so a three-sided one leaves\r\n * a visible gap under its base (see `./shape-outline` for the full reason,\r\n * which is a good one: it's what makes a `sides` tween smooth). These fill the\r\n * box instead. The two behaviours can't be one node with a switch, because\r\n * \"which shape is this\" is the sort of thing a scene's author picks once and a\r\n * reader of the layers panel needs to see at a glance — so each is a type of its\r\n * own, named for what it draws.\r\n *\r\n * ## Why they're paths rather than polygons\r\n *\r\n * The silhouette is handed to the renderer as a `path` op rather than a\r\n * `polygon` one, which is what lets corner rounding be *ours*: the engine's\r\n * polygon geometry rounds the inscribed figure, and rounding a stretched one is\r\n * a different arc at every vertex. Drawing the outline ourselves also means the\r\n * shape a user is looking at and the shape they get when they start editing its\r\n * points are built by the same function, so converting to a Path node changes\r\n * nothing on screen.\r\n *\r\n * The outline is rebuilt per draw rather than cached against the box. It is a\r\n * handful of trig per vertex on a shape with at most ten of them, and the\r\n * alternative — a cache keyed on width, height, radius, style and the two\r\n * parametric fields — costs more to keep honest than it saves.\r\n */\r\nexport interface BoundsShapeProps extends ShapeProps {\r\n /** Vertex rounding radius in pixels. */\r\n cornerRadius: number\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle\r\n}\r\n\r\nexport interface StarProps extends BoundsShapeProps {\r\n /** How many points the star has. */\r\n points: number\r\n /** Inner radius as a fraction of the outer one — how deep the points cut. */\r\n ratio: number\r\n}\r\n"]}
1
+ {"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA0C,MAAM,yCAAyC,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAyB,MAAM,8CAA8C,CAAC;AAE9H,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAStD;;;GAGG;AAEH,MAAM,aAAa,GAAG;IAClB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAc,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;CACrF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;IAC5B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE;IAC1D,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,QAAQ,EAA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AAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK;KACrI,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;CAC3C,CAAC,CAAC","sourcesContent":["import { lerpCornerScalarStyle, type CornerStyle, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport { pathOps } from \"@/attributes/shape/path/ops\";\nimport { STAR_DEFAULT_POINTS, STAR_DEFAULT_RATIO, type ShapeOutlineKind } from \"@/components/builtins/geometry/shape-outline\";\nimport type { NodeOf } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport * as Shapes from \"@/components/modules/shapes\";\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\nimport type { FlowProps } from \"@/layout/types\";\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport type { PathData } from \"@/render/descriptors/path\";\n\n/**\n * The geometry built-ins: paint, the flow engine for children (clear of the\n * stroke), and each one's outline.\n */\n\nconst scalarCorners = {\n cornerRadius: Types.number(0),\n cornerStyle: Types.custom<CornerStyle>(\"rounded\", { lerp: lerpCornerScalarStyle }),\n};\n\nexport const Rect = component2d({\n key: \"rect\",\n state: { ...Paint.state, ...Flow.state, ...Corners.state },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state)),\n});\n\nexport const Ellipse = component2d({\n key: \"ellipse\",\n state: {\n ...Paint.state, ...Flow.state,\n startAngle: Types.number(0),\n sweep: Types.number(360),\n ratio: Types.number(0),\n },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.ellipse(ctx.size, state)),\n});\n\nexport const Polygon = component2d({\n key: \"polygon\",\n state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ...scalarCorners },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygon(ctx.size, state)),\n});\n\nexport const Polygram = component2d({\n key: \"polygram\",\n state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ratio: Types.number(0.5), ...scalarCorners },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygram(ctx.size, state)),\n});\n\n/** The document's `path`: `data` in the unit space of its own box, so a resize is a width/height write. */\nexport const PathShape = component2d({\n key: \"path\",\n state: { ...Paint.state, ...Flow.state, data: Types.path },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.unitPath(ctx.size, state.data), { clipShape: Shapes.box(ctx.size) }),\n});\n\n/** Path data drawn at face value, hugging it: geometry written in code. */\nexport const Path = component2d({\n key: \"facePath\",\n state: { ...Paint.state, ...Flow.state, data: Types.path },\n defaults: { width: \"hug\", height: \"hug\" },\n commands: { ...Paint.commands },\n measure: (_measurer, state) => {\n const intrinsic = pathOps.size(state.data);\n const pad = state.padding;\n return { width: intrinsic.width + pad.left + pad.right, height: intrinsic.height + pad.top + pad.bottom };\n },\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.facePath(state.data), { clipShape: null }),\n});\n\nfunction boundsShape<const K extends string>(key: K, kind: ShapeOutlineKind) {\n return component2d({\n key,\n state: { ...Paint.state, ...Flow.state, ...scalarCorners },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(kind, ctx.size, state), { clipShape: Shapes.box(ctx.size) }),\n });\n}\n\nexport const Triangle = boundsShape(\"triangle\", \"triangle\");\nexport const RightTriangle = boundsShape(\"rightTriangle\", \"rightTriangle\");\nexport const Pentagon = boundsShape(\"pentagon\", \"pentagon\");\nexport const Hexagon = boundsShape(\"hexagon\", \"hexagon\");\nexport const Octagon = boundsShape(\"octagon\", \"octagon\");\n\nexport const Star = component2d({\n key: \"star\",\n state: {\n ...Paint.state, ...Flow.state, ...scalarCorners,\n points: Types.number(STAR_DEFAULT_POINTS),\n ratio: Types.number(STAR_DEFAULT_RATIO),\n },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(\"star\", ctx.size, {\n cornerRadius: state.cornerRadius, cornerStyle: state.cornerStyle, sides: Math.max(3, Math.round(state.points)), ratio: state.ratio,\n }), { clipShape: Shapes.box(ctx.size) }),\n});\n\nexport type Rect = NodeOf<typeof Rect>;\nexport type Ellipse = NodeOf<typeof Ellipse>;\nexport type Polygon = NodeOf<typeof Polygon>;\nexport type Polygram = NodeOf<typeof Polygram>;\nexport type PathShape = NodeOf<typeof PathShape>;\nexport type Path = NodeOf<typeof Path>;\nexport type Triangle = NodeOf<typeof Triangle>;\nexport type RightTriangle = NodeOf<typeof RightTriangle>;\nexport type Pentagon = NodeOf<typeof Pentagon>;\nexport type Hexagon = NodeOf<typeof Hexagon>;\nexport type Octagon = NodeOf<typeof Octagon>;\nexport type Star = NodeOf<typeof Star>;\n\n// What code building a shape names its props as. A call's own type is `CallProps<typeof Rect>`.\n\nexport interface PaintProps extends Node2DProps {\n /**\n * Fill layer(s). Each item can be:\n * - A plain CSS color string → treated as a solid fill\n * - A fill prop object (SolidFillProp, LinearGradientFillProp, …)\n * - An already-resolved fill object\n * - A {@link FillChain} from the `Fills` builder (e.g. `Fills.color('red')`)\n */\n fill?: Fill;\n /**\n * Stroke layer(s): a single {@link StrokeProp}, an array of them, or an\n * already-resolved stroke. `fill` inside each stroke accepts the same loose\n * values as the top-level fill prop.\n */\n stroke?: Stroke;\n /**\n * Shadow layer(s): a single {@link ShadowProp}, an array of them, or an\n * already-resolved shadow. `fill` inside each shadow accepts the same loose\n * values as the top-level fill prop.\n */\n shadow?: Shadow;\n start?: number;\n end?: number;\n}\n\nexport interface ShapeProps extends PaintProps, FlowProps {\n /**\n * Overlay layer(s) — the same loose values as {@link PaintProps.fill}, but\n * painted *over* this node's fill **and** its children (clipped to the node's\n * silhouette) while still sitting **under** the stroke. Use for textures\n * laid across the whole subtree, e.g. a VHS-grain image or video.\n */\n overlay?: Fill;\n}\n\nexport type FlexSize = number | \"fill\" | \"hug\";\n\nexport interface RectProps extends ShapeProps {\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\n cornerRadius: RectCornerRadius;\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\n cornerStyle: RectCornerStyle;\n}\n\nexport interface EllipseProps extends ShapeProps {\n ratio: number;\n sweep: number;\n startAngle: number;\n}\n\nexport interface PolygonProps extends ShapeProps {\n /** Number of sides. Must be ≥ 3. */\n sides: number;\n /** Vertex rounding radius in pixels. */\n cornerRadius: number;\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\n cornerStyle: CornerStyle;\n}\n\nexport interface PolygramProps extends ShapeProps {\n /** Number of outer points. Must be ≥ 3. */\n sides: number;\n /**\n * Inner-to-outer radius ratio (0–1). Controls how deeply the star points are cut.\n * At 1 the shape degenerates into a regular polygon; lower values produce sharper points.\n */\n ratio: number;\n /** Vertex rounding radius in pixels applied to both inner and outer vertices. */\n cornerRadius: number;\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\n cornerStyle: CornerStyle;\n}\n\nexport interface PathShapeProps extends ShapeProps {\n /**\n * The geometry, as an SVG `d` string in the node's **unit box** — see\n * {@link PathData}.\n */\n data: PathData\n}\n\nexport interface PathProps extends ShapeProps {\n data: PathData;\n}\n\n/**\n * The named shapes — a triangle, a right triangle, a pentagon, a hexagon, an\n * octagon, a star — as engine nodes.\n *\n * ## Why they aren't just a Polygon with `sides` set\n *\n * A `Polygon` inscribes its n-gon in the node's box, so a three-sided one leaves\n * a visible gap under its base (see `./shape-outline` for the full reason,\n * which is a good one: it's what makes a `sides` tween smooth). These fill the\n * box instead. The two behaviours can't be one node with a switch, because\n * \"which shape is this\" is the sort of thing a scene's author picks once and a\n * reader of the layers panel needs to see at a glance — so each is a type of its\n * own, named for what it draws.\n *\n * ## Why they're paths rather than polygons\n *\n * The silhouette is handed to the renderer as a `path` op rather than a\n * `polygon` one, which is what lets corner rounding be *ours*: the engine's\n * polygon geometry rounds the inscribed figure, and rounding a stretched one is\n * a different arc at every vertex. Drawing the outline ourselves also means the\n * shape a user is looking at and the shape they get when they start editing its\n * points are built by the same function, so converting to a Path node changes\n * nothing on screen.\n *\n * The outline is rebuilt per draw rather than cached against the box. It is a\n * handful of trig per vertex on a shape with at most ten of them, and the\n * alternative — a cache keyed on width, height, radius, style and the two\n * parametric fields — costs more to keep honest than it saves.\n */\nexport interface BoundsShapeProps extends ShapeProps {\n /** Vertex rounding radius in pixels. */\n cornerRadius: number\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\n cornerStyle: CornerStyle\n}\n\nexport interface StarProps extends BoundsShapeProps {\n /** How many points the star has. */\n points: number\n /** Inner radius as a fraction of the outer one — how deep the points cut. */\n ratio: number\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"shape-outline.js","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/shape-outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAoCrD;;;;;;;;;GASG;AACH,MAAM,cAAc,GAAoD;IACtE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC/B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE;CACzC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAEvC,mDAAmD;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAsB,EACtB,OAA4B;IAE5B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IACjC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IA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C,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC7D,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,EAAE,CAAA;QAC7D,OAAO,CAAC,IAAI,CAAC;YACX,KAAK;YACL,QAAQ,EACN,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;YACnE,SAAS,EACP,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;SACxE,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,2EAA2E;QAC3E,wEAAwE;QACxE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAG,CAAA;QAC3B,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IACrC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["/**\r\n * The silhouette of every shape type, as a {@link VectorPath}.\r\n *\r\n * One module, two callers with the same question asked at different scales:\r\n *\r\n * - The **shape node classes** (`nodes/shapes`) draw their outline every frame\r\n * from their laid-out box, so they ask in pixels.\r\n * - The **path editor** converts a shape into an editable Path node the moment\r\n * somebody moves one of its points, so it asks in the unit box the Path node\r\n * stores its geometry in (see `./vector-path`).\r\n *\r\n * Sharing the definition is what makes that conversion invisible: a triangle\r\n * that becomes a path is the *same* triangle, down to the rounding on its\r\n * corners, rather than a fresh approximation of one.\r\n *\r\n * ## Why these shapes exist at all\r\n *\r\n * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices\r\n * sit on the box's inscribed ellipse — which is what makes a `sides` tween\r\n * smooth: every vertex count is the same circle sampled differently, so a\r\n * triangle morphing into a square doesn't lurch. The cost is that a triangle\r\n * *doesn't touch the bottom of its own bounds*, because the two base vertices\r\n * sit at 30° below the horizontal rather than on the ellipse's lowest point.\r\n * Figma's polygon does exactly the same thing for exactly the same reason.\r\n *\r\n * That is right for a shape you intend to animate and wrong for a shape you\r\n * intend to *be a triangle*. So the parametric `polygon`/`polygram` keep the\r\n * inscribed geometry, and the named shapes here are stretched to fill their box\r\n * — the vertices are computed on the circle exactly as before, then their\r\n * bounding box is mapped onto the node's. Same silhouette, no gap.\r\n *\r\n * Everything here works in **y-down** coordinates, the convention the stored\r\n * `d` string uses. The node classes flip once on the way to the renderer, whose\r\n * local space is y-up.\r\n */\r\n\r\nimport type { CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\r\nimport type { CornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { distance } from \"@/attributes/shape/path/bezier\"\r\nimport { pathOps } from \"@/attributes/shape/path/ops\"\r\nimport type { PathAnchor, PathSubpath, VectorPath } from \"@/attributes/shape/path/types\";\r\n\r\n/** The shape types this module can draw an outline for. */\r\nexport type ShapeOutlineKind =\r\n | \"rect\"\r\n | \"ellipse\"\r\n | \"polygon\"\r\n | \"polygram\"\r\n | \"triangle\"\r\n | \"rightTriangle\"\r\n | \"pentagon\"\r\n | \"hexagon\"\r\n | \"octagon\"\r\n | \"star\"\r\n\r\n/** Everything an outline can depend on. Unstated fields take the schema's default. */\r\nexport interface ShapeOutlineOptions {\r\n /** The node's box, in pixels. */\r\n width: number\r\n height: number\r\n /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */\r\n cornerRadius?: number | CornerRadiusResolved\r\n cornerStyle?: CornerStyle\r\n /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */\r\n sides?: number\r\n /**\r\n * The inner radius as a fraction of the outer one: a polygram's or star's\r\n * point depth, and an ellipse's donut hole.\r\n */\r\n ratio?: number\r\n /** The ellipse's arc, in degrees. */\r\n startAngle?: number\r\n sweep?: number\r\n}\r\n\r\n/**\r\n * The named shapes' vertex counts and how far they're turned from \"a vertex at\r\n * the top\".\r\n *\r\n * Pointy-top is the regular polygon's natural orientation and the one every icon\r\n * set draws a pentagon and a hexagon in. The octagon is the exception, and it is\r\n * not a matter of taste: an octagon with a vertex at the top reads as a rotated\r\n * stop sign, because a stop sign is the only octagon most people have ever\r\n * looked at and it has a flat top. Half a step turns it into that one.\r\n */\r\nconst NAMED_POLYGONS: Record<string, { sides: number; turn: number }> = {\r\n pentagon: { sides: 5, turn: 0 },\r\n hexagon: { sides: 6, turn: 0 },\r\n octagon: { sides: 8, turn: Math.PI / 8 },\r\n}\r\n\r\n/**\r\n * A star's default point depth: the classic five-pointed star, where the inner\r\n * vertices sit where the extended edges of a pentagram cross.\r\n *\r\n * Not the polygram node's 50%, and deliberately so. The parametric polygram\r\n * opens at a round number because it is a *control* you are expected to move;\r\n * this node exists for the person who wanted a star and got a geometry lesson,\r\n * so it opens on the star they were picturing.\r\n */\r\nexport const STAR_DEFAULT_RATIO = 0.382\r\n\r\n/** The default number of points on a Star node. */\r\nexport const STAR_DEFAULT_POINTS = 5\r\n\r\n/**\r\n * The shape's outline in **pixel** space: centred on the origin, spanning\r\n * `width` × `height`, y-down.\r\n *\r\n * Returns an empty path for a degenerate box, which draws nothing rather than\r\n * producing NaN coordinates the renderer would have to cope with.\r\n */\r\nexport function shapeOutlinePixels(\r\n kind: ShapeOutlineKind,\r\n options: ShapeOutlineOptions\r\n): VectorPath {\r\n const { width, height } = options\r\n if (!(width > 0) || !(height > 0)) return []\r\n\r\n switch (kind) {\r\n case \"rect\":\r\n return [rectOutline(width, height, options)]\r\n case \"ellipse\":\r\n return ellipseOutline(width, height, options)\r\n case \"triangle\":\r\n return [\r\n polygonOutline(\r\n [\r\n { x: 0, y: -height / 2 },\r\n { x: width / 2, y: height / 2 },\r\n { x: -width / 2, y: height / 2 },\r\n ],\r\n options\r\n ),\r\n ]\r\n case \"rightTriangle\":\r\n return [\r\n polygonOutline(\r\n [\r\n { x: -width / 2, y: -height / 2 },\r\n { x: width / 2, y: height / 2 },\r\n { x: -width / 2, y: height / 2 },\r\n ],\r\n options\r\n ),\r\n ]\r\n case \"polygon\":\r\n // The parametric one: inscribed, *not* stretched — see the module note.\r\n return [\r\n polygonOutline(\r\n regularVertices(sidesOf(options, 5), 0, width / 2, height / 2),\r\n options\r\n ),\r\n ]\r\n case \"polygram\":\r\n return [\r\n polygonOutline(\r\n starVertices(\r\n sidesOf(options, 5),\r\n clamp01(options.ratio ?? 0.5),\r\n width / 2,\r\n height / 2\r\n ),\r\n options\r\n ),\r\n ]\r\n case \"star\":\r\n return [\r\n polygonOutline(\r\n fillBox(\r\n starVertices(\r\n sidesOf(options, STAR_DEFAULT_POINTS),\r\n clamp01(options.ratio ?? STAR_DEFAULT_RATIO),\r\n 1,\r\n 1\r\n ),\r\n width,\r\n height\r\n ),\r\n options\r\n ),\r\n ]\r\n default: {\r\n const named = NAMED_POLYGONS[kind]\r\n if (!named) return []\r\n return [\r\n polygonOutline(\r\n fillBox(regularVertices(named.sides, named.turn, 1, 1), width, height),\r\n options\r\n ),\r\n ]\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The same outline in the **unit box** a Path node stores — pixels divided by\r\n * the node's own size, so the geometry is a fraction of the box rather than a\r\n * count of pixels inside it.\r\n *\r\n * This is what a shape→path conversion writes. Dividing at the end rather than\r\n * computing in unit space throughout is what keeps a corner radius circular: a\r\n * 20px corner on a 400×200 node is 0.05 × 0.1 of the box, and only comes back\r\n * out round because the renderer multiplies by the same two numbers.\r\n */\r\nexport function shapeOutline(\r\n kind: ShapeOutlineKind,\r\n options: ShapeOutlineOptions\r\n): VectorPath {\r\n const { width, height } = options\r\n const pixels = shapeOutlinePixels(kind, options)\r\n if (!(width > 0) || !(height > 0)) return pixels\r\n return pathOps.map(pixels, (p) => ({ x: p.x / width, y: p.y / height }))\r\n}\r\n\r\n/** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */\r\nexport function hasShapeOutline(kind: string): kind is ShapeOutlineKind {\r\n return OUTLINE_KINDS.has(kind)\r\n}\r\n\r\nconst OUTLINE_KINDS: ReadonlySet<string> = new Set<ShapeOutlineKind>([\r\n \"rect\",\r\n \"ellipse\",\r\n \"polygon\",\r\n \"polygram\",\r\n \"triangle\",\r\n \"rightTriangle\",\r\n \"pentagon\",\r\n \"hexagon\",\r\n \"octagon\",\r\n \"star\",\r\n])\r\n\r\n// ── Building blocks ────────────────────────────────────────────────────────\r\n\r\nfunction corner(point: Vector2): PathAnchor {\r\n return { point, inHandle: null, outHandle: null }\r\n}\r\n\r\nfunction sidesOf(options: ShapeOutlineOptions, fallback: number): number {\r\n return Math.max(3, Math.round(options.sides ?? fallback))\r\n}\r\n\r\nfunction clamp01(value: number): number {\r\n return Math.max(0, Math.min(1, value))\r\n}\r\n\r\n\r\n/**\r\n * The vertices of a regular n-gon on the ellipse `rx` × `ry`, starting at the\r\n * top and stepping clockwise — the same order and the same first vertex\r\n * The engine's own `polygonVertices` uses, so a converted `polygon` keeps its\r\n * points in the order the author has been looking at.\r\n *\r\n * `turn` rotates the whole figure; see {@link NAMED_POLYGONS}.\r\n */\r\nfunction regularVertices(\r\n sides: number,\r\n turn: number,\r\n rx: number,\r\n ry: number\r\n): Vector2[] {\r\n const step = (2 * Math.PI) / sides\r\n const out: Vector2[] = []\r\n for (let i = 0; i < sides; i++) {\r\n // −π/2 is straight up in y-down coordinates.\r\n const a = -Math.PI / 2 + turn + i * step\r\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) })\r\n }\r\n return out\r\n}\r\n\r\n/** Outer and inner vertices alternating — a star with `points` points. */\r\nfunction starVertices(\r\n points: number,\r\n ratio: number,\r\n rx: number,\r\n ry: number\r\n): Vector2[] {\r\n const step = Math.PI / points\r\n const out: Vector2[] = []\r\n for (let i = 0; i < points * 2; i++) {\r\n const a = -Math.PI / 2 + i * step\r\n const k = i % 2 === 0 ? 1 : ratio\r\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) })\r\n }\r\n return out\r\n}\r\n\r\n/**\r\n * Stretches a vertex ring so its bounding box *is* the node's box.\r\n *\r\n * The one line that separates a shape from its parametric sibling. Everything\r\n * before it is the inscribed figure; this maps that figure's own extent onto the\r\n * box, so the flat base of a triangle lands on the bottom edge and a pentagon's\r\n * two lower vertices land on the left and right ones.\r\n *\r\n * A ring with no extent on an axis (which no shape here produces, but a\r\n * `sides: 3` star with ratio 0 comes close) keeps that axis rather than dividing\r\n * by zero.\r\n */\r\nfunction fillBox(points: Vector2[], width: number, height: number): Vector2[] {\r\n if (points.length === 0) return points\r\n let minX = Infinity\r\n let minY = Infinity\r\n let maxX = -Infinity\r\n let maxY = -Infinity\r\n for (const p of points) {\r\n if (p.x < minX) minX = p.x\r\n if (p.x > maxX) maxX = p.x\r\n if (p.y < minY) minY = p.y\r\n if (p.y > maxY) maxY = p.y\r\n }\r\n const spanX = maxX - minX\r\n const spanY = maxY - minY\r\n const kx = spanX > 1e-9 ? width / spanX : 1\r\n const ky = spanY > 1e-9 ? height / spanY : 1\r\n const cx = (minX + maxX) / 2\r\n const cy = (minY + maxY) / 2\r\n return points.map((p) => ({ x: (p.x - cx) * kx, y: (p.y - cy) * ky }))\r\n}\r\n\r\n// ── Corners ────────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The cubic control-point offset that approximates a circular arc, as a\r\n * fraction of the distance from the tangent point to the corner.\r\n *\r\n * `k = (4/3)·tan(φ/4) / tan(φ/2)`, where φ is the arc's central angle. The\r\n * familiar 0.5523 is this at φ = 90°; a shallow corner needs less and a sharp\r\n * one needs more, which is why the constant can't simply be hard-coded — a\r\n * five-pointed star's inner vertices turn through nearly 180°, where 0.5523\r\n * would visibly flatten the curve.\r\n */\r\nfunction arcHandleRatio(sweep: number): number {\r\n const half = sweep / 2\r\n if (Math.abs(half) < 1e-6) return 0\r\n return ((4 / 3) * Math.tan(sweep / 4)) / Math.tan(half)\r\n}\r\n\r\n/**\r\n * A closed ring of vertices as a subpath, with each corner rounded or chamfered\r\n * by `cornerRadius`.\r\n *\r\n * The radius is clamped per corner to half of each adjacent edge, so a large\r\n * radius on a small shape rounds it as far as it can go instead of turning the\r\n * outline inside out. A radius of zero (or a `cornerStyle` of neither kind)\r\n * returns the plain polygon, which is the common case and costs nothing.\r\n */\r\nfunction polygonOutline(\r\n points: Vector2[],\r\n options: ShapeOutlineOptions\r\n): PathSubpath {\r\n const radius = uniformRadius(options.cornerRadius)\r\n if (points.length < 3 || radius <= 0) {\r\n return { anchors: points.map(corner), closed: true }\r\n }\r\n const style = options.cornerStyle ?? \"rounded\"\r\n\r\n const anchors: PathAnchor[] = []\r\n for (let i = 0; i < points.length; i++) {\r\n const c = points[i]\r\n const prev = points[(i - 1 + points.length) % points.length]\r\n const next = points[(i + 1) % points.length]\r\n\r\n const toPrev = direction(c, prev)\r\n const toNext = direction(c, next)\r\n if (!toPrev || !toNext) {\r\n anchors.push(corner(c))\r\n continue\r\n }\r\n\r\n // The interior angle at this vertex, and the arc that replaces it.\r\n const cosine = Math.max(-1, Math.min(1, toPrev.x * toNext.x + toPrev.y * toNext.y))\r\n const interior = Math.acos(cosine)\r\n // A vertex where the two edges double back on themselves has no corner to\r\n // round; leaving it sharp is the only honest answer.\r\n if (interior < 1e-6 || Math.PI - interior < 1e-6) {\r\n anchors.push(corner(c))\r\n continue\r\n }\r\n\r\n // How far back along each edge the arc starts. Never more than half the\r\n // edge, so two adjacent corners can't overlap.\r\n const tangent = Math.min(\r\n radius / Math.tan(interior / 2),\r\n distance(c, prev) / 2,\r\n distance(c, next) / 2\r\n )\r\n const a = { x: c.x + toPrev.x * tangent, y: c.y + toPrev.y * tangent }\r\n const b = { x: c.x + toNext.x * tangent, y: c.y + toNext.y * tangent }\r\n\r\n if (style === \"angled\") {\r\n // A chamfer: the same two tangent points, joined by a straight line.\r\n anchors.push(corner(a), corner(b))\r\n continue\r\n }\r\n\r\n const k = arcHandleRatio(Math.PI - interior)\r\n anchors.push(\r\n { point: a, inHandle: null, outHandle: { x: a.x + (c.x - a.x) * k, y: a.y + (c.y - a.y) * k } },\r\n { point: b, inHandle: { x: b.x + (c.x - b.x) * k, y: b.y + (c.y - b.y) * k }, outHandle: null }\r\n )\r\n }\r\n return { anchors, closed: true }\r\n}\r\n\r\n/** The unit vector from `from` towards `to`, or null when they coincide. */\r\nfunction direction(from: Vector2, to: Vector2): Vector2 | null {\r\n const dx = to.x - from.x\r\n const dy = to.y - from.y\r\n const len = Math.hypot(dx, dy)\r\n if (len < 1e-9) return null\r\n return { x: dx / len, y: dy / len }\r\n}\r\n\r\n\r\n/**\r\n * A single radius from whichever shape the value arrived in.\r\n *\r\n * A per-corner value only means anything on a rect, which builds its outline\r\n * corner by corner below; every other shape takes the smallest of the four, so\r\n * converting a rect with mixed corners into a polygon can't silently invent a\r\n * radius bigger than any the author set.\r\n */\r\nfunction uniformRadius(value: number | CornerRadiusResolved | undefined): number {\r\n if (value === undefined) return 0\r\n if (typeof value === \"number\") return Math.max(0, value)\r\n return Math.max(\r\n 0,\r\n Math.min(value.topLeft, value.topRight, value.bottomLeft, value.bottomRight)\r\n )\r\n}\r\n\r\n// ── Rect ───────────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * A rectangle, with each corner carrying its own radius.\r\n *\r\n * Written out rather than routed through {@link polygonOutline} because a rect\r\n * is the one shape whose corners are *individually* set, and because its right\r\n * angles make the arc exact: the tangent length equals the radius and the handle\r\n * ratio is the familiar 0.5523, with no trigonometry involved.\r\n */\r\nfunction rectOutline(\r\n width: number,\r\n height: number,\r\n options: ShapeOutlineOptions\r\n): PathSubpath {\r\n const radii = perCornerRadii(options.cornerRadius, width, height)\r\n const style = options.cornerStyle ?? \"rounded\"\r\n const x = width / 2\r\n const y = height / 2\r\n const k = arcHandleRatio(Math.PI / 2)\r\n\r\n const anchors: PathAnchor[] = []\r\n /**\r\n * One corner, walking clockwise from the top-left: `at` is the sharp corner,\r\n * `from`/`to` the directions the outline arrives and leaves along.\r\n */\r\n const push = (\r\n at: Vector2,\r\n incoming: Vector2,\r\n outgoing: Vector2,\r\n r: number\r\n ) => {\r\n if (r <= 0) {\r\n anchors.push(corner(at))\r\n return\r\n }\r\n const a = { x: at.x - incoming.x * r, y: at.y - incoming.y * r }\r\n const b = { x: at.x + outgoing.x * r, y: at.y + outgoing.y * r }\r\n if (style === \"angled\") {\r\n anchors.push(corner(a), corner(b))\r\n return\r\n }\r\n anchors.push(\r\n { point: a, inHandle: null, outHandle: { x: a.x + (at.x - a.x) * k, y: a.y + (at.y - a.y) * k } },\r\n { point: b, inHandle: { x: b.x + (at.x - b.x) * k, y: b.y + (at.y - b.y) * k }, outHandle: null }\r\n )\r\n }\r\n\r\n const right = { x: 1, y: 0 }\r\n const down = { x: 0, y: 1 }\r\n const left = { x: -1, y: 0 }\r\n const up = { x: 0, y: -1 }\r\n // Clockwise, and the *incoming* direction is the one the walk is travelling\r\n // when it reaches the corner — not the edge it is about to leave along. The\r\n // loop closes back into the top-left from the bottom-left, so it arrives there\r\n // heading **up**; `down` put that corner's first anchor a radius *above* the\r\n // rectangle and drew the arc back into the box, which is the reversed top-left\r\n // corner you get on any rounded rect converted to a path.\r\n push({ x: -x, y: -y }, up, right, radii.topLeft)\r\n push({ x, y: -y }, right, down, radii.topRight)\r\n push({ x, y }, down, left, radii.bottomRight)\r\n push({ x: -x, y }, left, up, radii.bottomLeft)\r\n return { anchors, closed: true }\r\n}\r\n\r\n/** The four radii, clamped so opposite corners on an edge can't overlap. */\r\nfunction perCornerRadii(\r\n value: number | CornerRadiusResolved | undefined,\r\n width: number,\r\n height: number\r\n): CornerRadiusResolved {\r\n const raw: CornerRadiusResolved =\r\n value === undefined\r\n ? { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }\r\n : typeof value === \"number\"\r\n ? {\r\n topLeft: value,\r\n topRight: value,\r\n bottomLeft: value,\r\n bottomRight: value,\r\n }\r\n : value\r\n const cap = Math.min(width, height) / 2\r\n return {\r\n topLeft: Math.max(0, Math.min(raw.topLeft, cap)),\r\n topRight: Math.max(0, Math.min(raw.topRight, cap)),\r\n bottomLeft: Math.max(0, Math.min(raw.bottomLeft, cap)),\r\n bottomRight: Math.max(0, Math.min(raw.bottomRight, cap)),\r\n }\r\n}\r\n\r\n// ── Ellipse ────────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The ellipse family: a full oval, an arc (`sweep` under 360°), a ring\r\n * (`ratio` above 0), and the wedge the two make together.\r\n *\r\n * The arc is emitted as cubics rather than as an SVG `A` command, and that is\r\n * the whole reason this is worth writing out. A Path node's geometry is stored\r\n * as a fraction of its box and multiplied back by the box's *two* dimensions —\r\n * so an arc, whose parameters describe a circle rather than a set of points,\r\n * would come out of a non-uniform resize as a different curve rather than a\r\n * stretched one. Cubics survive that transform exactly.\r\n */\r\nfunction ellipseOutline(\r\n width: number,\r\n height: number,\r\n options: ShapeOutlineOptions\r\n): VectorPath {\r\n const rx = width / 2\r\n const ry = height / 2\r\n const inner = clamp01(options.ratio ?? 0)\r\n const sweep = Math.max(0, Math.min(360, options.sweep ?? 360))\r\n if (sweep <= 0) return []\r\n\r\n // A full oval with no hole is the common case: one closed ring.\r\n const full = sweep >= 360\r\n // Degrees clockwise from twelve o'clock, matching the appearance schema's\r\n // `startAngle` — which is measured the way a clock face is, not the way\r\n // `Math.atan2` is.\r\n const from = ((options.startAngle ?? 0) - 90) * (Math.PI / 180)\r\n const to = from + sweep * (Math.PI / 180)\r\n\r\n if (full && inner <= 0) {\r\n return [{ anchors: arcAnchors(rx, ry, from, to, true), closed: true }]\r\n }\r\n if (full) {\r\n // A ring: two closed rings, the inner one wound the other way so the\r\n // even-odd fill leaves a hole.\r\n return [\r\n { anchors: arcAnchors(rx, ry, from, to, true), closed: true },\r\n { anchors: arcAnchors(rx * inner, ry * inner, to, from, true), closed: true },\r\n ]\r\n }\r\n\r\n // An arc, closed back on itself: out along the outer edge, back along the\r\n // inner one (or through the centre, when there is no hole).\r\n const outer = arcAnchors(rx, ry, from, to, false)\r\n const back =\r\n inner > 0\r\n ? arcAnchors(rx * inner, ry * inner, to, from, false)\r\n : [corner({ x: 0, y: 0 })]\r\n return [{ anchors: [...outer, ...back], closed: true }]\r\n}\r\n\r\n/**\r\n * An elliptical arc as a run of anchors, split into segments of at most 90° —\r\n * the span a single cubic approximates to within a fraction of a pixel.\r\n *\r\n * `whole` drops the duplicated final anchor, for the case where the arc closes\r\n * back on its own start.\r\n */\r\nfunction arcAnchors(\r\n rx: number,\r\n ry: number,\r\n from: number,\r\n to: number,\r\n whole: boolean\r\n): PathAnchor[] {\r\n const total = to - from\r\n const steps = Math.max(1, Math.ceil(Math.abs(total) / (Math.PI / 2)))\r\n const step = total / steps\r\n // The classic elliptical-arc approximation: each control point sits α along\r\n // the curve's own tangent, with α = (4/3)·tan(Δ/4) for a segment spanning Δ.\r\n // Signed with the step, so a clockwise arc bulges the right way.\r\n const alpha = (4 / 3) * Math.tan(step / 4)\r\n\r\n const anchors: PathAnchor[] = []\r\n for (let i = 0; i <= steps; i++) {\r\n const a = from + step * i\r\n const point = { x: rx * Math.cos(a), y: ry * Math.sin(a) }\r\n // d/da of the point — the arc's tangent at this angle.\r\n const tangent = { x: -rx * Math.sin(a), y: ry * Math.cos(a) }\r\n const offset = { x: tangent.x * alpha, y: tangent.y * alpha }\r\n anchors.push({\r\n point,\r\n inHandle:\r\n i === 0 ? null : { x: point.x - offset.x, y: point.y - offset.y },\r\n outHandle:\r\n i === steps ? null : { x: point.x + offset.x, y: point.y + offset.y },\r\n })\r\n }\r\n\r\n if (whole && anchors.length > 1) {\r\n // The arc came back to where it started; fold the duplicate into the first\r\n // anchor so the ring has one anchor per corner rather than two stacked.\r\n const last = anchors.pop()!\r\n anchors[0].inHandle = last.inHandle\r\n }\r\n return anchors\r\n}\r\n"]}
1
+ {"version":3,"file":"shape-outline.js","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/shape-outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAoCrD;;;;;;;;;GASG;AACH,MAAM,cAAc,GAAoD;IACtE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC/B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE;CACzC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAEvC,mDAAmD;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAsB,EACtB,OAA4B;IAE5B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IACjC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IAE5C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;QAC9C,KAAK,SAAS;YACZ,O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AG,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,EAAE,CAAA;QAC7D,OAAO,CAAC,IAAI,CAAC;YACX,KAAK;YACL,QAAQ,EACN,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;YACnE,SAAS,EACP,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;SACxE,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,2EAA2E;QAC3E,wEAAwE;QACxE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAG,CAAA;QAC3B,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IACrC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["/**\n * The silhouette of every shape type, as a {@link VectorPath}.\n *\n * One module, two callers with the same question asked at different scales:\n *\n * - The **shape node classes** (`nodes/shapes`) draw their outline every frame\n * from their laid-out box, so they ask in pixels.\n * - The **path editor** converts a shape into an editable Path node the moment\n * somebody moves one of its points, so it asks in the unit box the Path node\n * stores its geometry in (see `./vector-path`).\n *\n * Sharing the definition is what makes that conversion invisible: a triangle\n * that becomes a path is the *same* triangle, down to the rounding on its\n * corners, rather than a fresh approximation of one.\n *\n * ## Why these shapes exist at all\n *\n * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices\n * sit on the box's inscribed ellipse — which is what makes a `sides` tween\n * smooth: every vertex count is the same circle sampled differently, so a\n * triangle morphing into a square doesn't lurch. The cost is that a triangle\n * *doesn't touch the bottom of its own bounds*, because the two base vertices\n * sit at 30° below the horizontal rather than on the ellipse's lowest point.\n * Figma's polygon does exactly the same thing for exactly the same reason.\n *\n * That is right for a shape you intend to animate and wrong for a shape you\n * intend to *be a triangle*. So the parametric `polygon`/`polygram` keep the\n * inscribed geometry, and the named shapes here are stretched to fill their box\n * — the vertices are computed on the circle exactly as before, then their\n * bounding box is mapped onto the node's. Same silhouette, no gap.\n *\n * Everything here works in **y-down** coordinates, the convention the stored\n * `d` string uses. The node classes flip once on the way to the renderer, whose\n * local space is y-up.\n */\n\nimport type { CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\nimport type { CornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { distance } from \"@/attributes/shape/path/bezier\"\nimport { pathOps } from \"@/attributes/shape/path/ops\"\nimport type { PathAnchor, PathSubpath, VectorPath } from \"@/attributes/shape/path/types\";\n\n/** The shape types this module can draw an outline for. */\nexport type ShapeOutlineKind =\n | \"rect\"\n | \"ellipse\"\n | \"polygon\"\n | \"polygram\"\n | \"triangle\"\n | \"rightTriangle\"\n | \"pentagon\"\n | \"hexagon\"\n | \"octagon\"\n | \"star\"\n\n/** Everything an outline can depend on. Unstated fields take the schema's default. */\nexport interface ShapeOutlineOptions {\n /** The node's box, in pixels. */\n width: number\n height: number\n /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */\n cornerRadius?: number | CornerRadiusResolved\n cornerStyle?: CornerStyle\n /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */\n sides?: number\n /**\n * The inner radius as a fraction of the outer one: a polygram's or star's\n * point depth, and an ellipse's donut hole.\n */\n ratio?: number\n /** The ellipse's arc, in degrees. */\n startAngle?: number\n sweep?: number\n}\n\n/**\n * The named shapes' vertex counts and how far they're turned from \"a vertex at\n * the top\".\n *\n * Pointy-top is the regular polygon's natural orientation and the one every icon\n * set draws a pentagon and a hexagon in. The octagon is the exception, and it is\n * not a matter of taste: an octagon with a vertex at the top reads as a rotated\n * stop sign, because a stop sign is the only octagon most people have ever\n * looked at and it has a flat top. Half a step turns it into that one.\n */\nconst NAMED_POLYGONS: Record<string, { sides: number; turn: number }> = {\n pentagon: { sides: 5, turn: 0 },\n hexagon: { sides: 6, turn: 0 },\n octagon: { sides: 8, turn: Math.PI / 8 },\n}\n\n/**\n * A star's default point depth: the classic five-pointed star, where the inner\n * vertices sit where the extended edges of a pentagram cross.\n *\n * Not the polygram node's 50%, and deliberately so. The parametric polygram\n * opens at a round number because it is a *control* you are expected to move;\n * this node exists for the person who wanted a star and got a geometry lesson,\n * so it opens on the star they were picturing.\n */\nexport const STAR_DEFAULT_RATIO = 0.382\n\n/** The default number of points on a Star node. */\nexport const STAR_DEFAULT_POINTS = 5\n\n/**\n * The shape's outline in **pixel** space: centred on the origin, spanning\n * `width` × `height`, y-down.\n *\n * Returns an empty path for a degenerate box, which draws nothing rather than\n * producing NaN coordinates the renderer would have to cope with.\n */\nexport function shapeOutlinePixels(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n if (!(width > 0) || !(height > 0)) return []\n\n switch (kind) {\n case \"rect\":\n return [rectOutline(width, height, options)]\n case \"ellipse\":\n return ellipseOutline(width, height, options)\n case \"triangle\":\n return [\n polygonOutline(\n [\n { x: 0, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"rightTriangle\":\n return [\n polygonOutline(\n [\n { x: -width / 2, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"polygon\":\n // The parametric one: inscribed, *not* stretched — see the module note.\n return [\n polygonOutline(\n regularVertices(sidesOf(options, 5), 0, width / 2, height / 2),\n options\n ),\n ]\n case \"polygram\":\n return [\n polygonOutline(\n starVertices(\n sidesOf(options, 5),\n clamp01(options.ratio ?? 0.5),\n width / 2,\n height / 2\n ),\n options\n ),\n ]\n case \"star\":\n return [\n polygonOutline(\n fillBox(\n starVertices(\n sidesOf(options, STAR_DEFAULT_POINTS),\n clamp01(options.ratio ?? STAR_DEFAULT_RATIO),\n 1,\n 1\n ),\n width,\n height\n ),\n options\n ),\n ]\n default: {\n const named = NAMED_POLYGONS[kind]\n if (!named) return []\n return [\n polygonOutline(\n fillBox(regularVertices(named.sides, named.turn, 1, 1), width, height),\n options\n ),\n ]\n }\n }\n}\n\n/**\n * The same outline in the **unit box** a Path node stores — pixels divided by\n * the node's own size, so the geometry is a fraction of the box rather than a\n * count of pixels inside it.\n *\n * This is what a shape→path conversion writes. Dividing at the end rather than\n * computing in unit space throughout is what keeps a corner radius circular: a\n * 20px corner on a 400×200 node is 0.05 × 0.1 of the box, and only comes back\n * out round because the renderer multiplies by the same two numbers.\n */\nexport function shapeOutline(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n const pixels = shapeOutlinePixels(kind, options)\n if (!(width > 0) || !(height > 0)) return pixels\n return pathOps.map(pixels, (p) => ({ x: p.x / width, y: p.y / height }))\n}\n\n/** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */\nexport function hasShapeOutline(kind: string): kind is ShapeOutlineKind {\n return OUTLINE_KINDS.has(kind)\n}\n\nconst OUTLINE_KINDS: ReadonlySet<string> = new Set<ShapeOutlineKind>([\n \"rect\",\n \"ellipse\",\n \"polygon\",\n \"polygram\",\n \"triangle\",\n \"rightTriangle\",\n \"pentagon\",\n \"hexagon\",\n \"octagon\",\n \"star\",\n])\n\n// ── Building blocks ────────────────────────────────────────────────────────\n\nfunction corner(point: Vector2): PathAnchor {\n return { point, inHandle: null, outHandle: null }\n}\n\nfunction sidesOf(options: ShapeOutlineOptions, fallback: number): number {\n return Math.max(3, Math.round(options.sides ?? fallback))\n}\n\nfunction clamp01(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\n\n/**\n * The vertices of a regular n-gon on the ellipse `rx` × `ry`, starting at the\n * top and stepping clockwise — the same order and the same first vertex\n * The engine's own `polygonVertices` uses, so a converted `polygon` keeps its\n * points in the order the author has been looking at.\n *\n * `turn` rotates the whole figure; see {@link NAMED_POLYGONS}.\n */\nfunction regularVertices(\n sides: number,\n turn: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = (2 * Math.PI) / sides\n const out: Vector2[] = []\n for (let i = 0; i < sides; i++) {\n // −π/2 is straight up in y-down coordinates.\n const a = -Math.PI / 2 + turn + i * step\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) })\n }\n return out\n}\n\n/** Outer and inner vertices alternating — a star with `points` points. */\nfunction starVertices(\n points: number,\n ratio: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = Math.PI / points\n const out: Vector2[] = []\n for (let i = 0; i < points * 2; i++) {\n const a = -Math.PI / 2 + i * step\n const k = i % 2 === 0 ? 1 : ratio\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) })\n }\n return out\n}\n\n/**\n * Stretches a vertex ring so its bounding box *is* the node's box.\n *\n * The one line that separates a shape from its parametric sibling. Everything\n * before it is the inscribed figure; this maps that figure's own extent onto the\n * box, so the flat base of a triangle lands on the bottom edge and a pentagon's\n * two lower vertices land on the left and right ones.\n *\n * A ring with no extent on an axis (which no shape here produces, but a\n * `sides: 3` star with ratio 0 comes close) keeps that axis rather than dividing\n * by zero.\n */\nfunction fillBox(points: Vector2[], width: number, height: number): Vector2[] {\n if (points.length === 0) return points\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n for (const p of points) {\n if (p.x < minX) minX = p.x\n if (p.x > maxX) maxX = p.x\n if (p.y < minY) minY = p.y\n if (p.y > maxY) maxY = p.y\n }\n const spanX = maxX - minX\n const spanY = maxY - minY\n const kx = spanX > 1e-9 ? width / spanX : 1\n const ky = spanY > 1e-9 ? height / spanY : 1\n const cx = (minX + maxX) / 2\n const cy = (minY + maxY) / 2\n return points.map((p) => ({ x: (p.x - cx) * kx, y: (p.y - cy) * ky }))\n}\n\n// ── Corners ────────────────────────────────────────────────────────────────\n\n/**\n * The cubic control-point offset that approximates a circular arc, as a\n * fraction of the distance from the tangent point to the corner.\n *\n * `k = (4/3)·tan(φ/4) / tan(φ/2)`, where φ is the arc's central angle. The\n * familiar 0.5523 is this at φ = 90°; a shallow corner needs less and a sharp\n * one needs more, which is why the constant can't simply be hard-coded — a\n * five-pointed star's inner vertices turn through nearly 180°, where 0.5523\n * would visibly flatten the curve.\n */\nfunction arcHandleRatio(sweep: number): number {\n const half = sweep / 2\n if (Math.abs(half) < 1e-6) return 0\n return ((4 / 3) * Math.tan(sweep / 4)) / Math.tan(half)\n}\n\n/**\n * A closed ring of vertices as a subpath, with each corner rounded or chamfered\n * by `cornerRadius`.\n *\n * The radius is clamped per corner to half of each adjacent edge, so a large\n * radius on a small shape rounds it as far as it can go instead of turning the\n * outline inside out. A radius of zero (or a `cornerStyle` of neither kind)\n * returns the plain polygon, which is the common case and costs nothing.\n */\nfunction polygonOutline(\n points: Vector2[],\n options: ShapeOutlineOptions\n): PathSubpath {\n const radius = uniformRadius(options.cornerRadius)\n if (points.length < 3 || radius <= 0) {\n return { anchors: points.map(corner), closed: true }\n }\n const style = options.cornerStyle ?? \"rounded\"\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i < points.length; i++) {\n const c = points[i]\n const prev = points[(i - 1 + points.length) % points.length]\n const next = points[(i + 1) % points.length]\n\n const toPrev = direction(c, prev)\n const toNext = direction(c, next)\n if (!toPrev || !toNext) {\n anchors.push(corner(c))\n continue\n }\n\n // The interior angle at this vertex, and the arc that replaces it.\n const cosine = Math.max(-1, Math.min(1, toPrev.x * toNext.x + toPrev.y * toNext.y))\n const interior = Math.acos(cosine)\n // A vertex where the two edges double back on themselves has no corner to\n // round; leaving it sharp is the only honest answer.\n if (interior < 1e-6 || Math.PI - interior < 1e-6) {\n anchors.push(corner(c))\n continue\n }\n\n // How far back along each edge the arc starts. Never more than half the\n // edge, so two adjacent corners can't overlap.\n const tangent = Math.min(\n radius / Math.tan(interior / 2),\n distance(c, prev) / 2,\n distance(c, next) / 2\n )\n const a = { x: c.x + toPrev.x * tangent, y: c.y + toPrev.y * tangent }\n const b = { x: c.x + toNext.x * tangent, y: c.y + toNext.y * tangent }\n\n if (style === \"angled\") {\n // A chamfer: the same two tangent points, joined by a straight line.\n anchors.push(corner(a), corner(b))\n continue\n }\n\n const k = arcHandleRatio(Math.PI - interior)\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (c.x - a.x) * k, y: a.y + (c.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (c.x - b.x) * k, y: b.y + (c.y - b.y) * k }, outHandle: null }\n )\n }\n return { anchors, closed: true }\n}\n\n/** The unit vector from `from` towards `to`, or null when they coincide. */\nfunction direction(from: Vector2, to: Vector2): Vector2 | null {\n const dx = to.x - from.x\n const dy = to.y - from.y\n const len = Math.hypot(dx, dy)\n if (len < 1e-9) return null\n return { x: dx / len, y: dy / len }\n}\n\n\n/**\n * A single radius from whichever shape the value arrived in.\n *\n * A per-corner value only means anything on a rect, which builds its outline\n * corner by corner below; every other shape takes the smallest of the four, so\n * converting a rect with mixed corners into a polygon can't silently invent a\n * radius bigger than any the author set.\n */\nfunction uniformRadius(value: number | CornerRadiusResolved | undefined): number {\n if (value === undefined) return 0\n if (typeof value === \"number\") return Math.max(0, value)\n return Math.max(\n 0,\n Math.min(value.topLeft, value.topRight, value.bottomLeft, value.bottomRight)\n )\n}\n\n// ── Rect ───────────────────────────────────────────────────────────────────\n\n/**\n * A rectangle, with each corner carrying its own radius.\n *\n * Written out rather than routed through {@link polygonOutline} because a rect\n * is the one shape whose corners are *individually* set, and because its right\n * angles make the arc exact: the tangent length equals the radius and the handle\n * ratio is the familiar 0.5523, with no trigonometry involved.\n */\nfunction rectOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): PathSubpath {\n const radii = perCornerRadii(options.cornerRadius, width, height)\n const style = options.cornerStyle ?? \"rounded\"\n const x = width / 2\n const y = height / 2\n const k = arcHandleRatio(Math.PI / 2)\n\n const anchors: PathAnchor[] = []\n /**\n * One corner, walking clockwise from the top-left: `at` is the sharp corner,\n * `from`/`to` the directions the outline arrives and leaves along.\n */\n const push = (\n at: Vector2,\n incoming: Vector2,\n outgoing: Vector2,\n r: number\n ) => {\n if (r <= 0) {\n anchors.push(corner(at))\n return\n }\n const a = { x: at.x - incoming.x * r, y: at.y - incoming.y * r }\n const b = { x: at.x + outgoing.x * r, y: at.y + outgoing.y * r }\n if (style === \"angled\") {\n anchors.push(corner(a), corner(b))\n return\n }\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (at.x - a.x) * k, y: a.y + (at.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (at.x - b.x) * k, y: b.y + (at.y - b.y) * k }, outHandle: null }\n )\n }\n\n const right = { x: 1, y: 0 }\n const down = { x: 0, y: 1 }\n const left = { x: -1, y: 0 }\n const up = { x: 0, y: -1 }\n // Clockwise, and the *incoming* direction is the one the walk is travelling\n // when it reaches the corner — not the edge it is about to leave along. The\n // loop closes back into the top-left from the bottom-left, so it arrives there\n // heading **up**; `down` put that corner's first anchor a radius *above* the\n // rectangle and drew the arc back into the box, which is the reversed top-left\n // corner you get on any rounded rect converted to a path.\n push({ x: -x, y: -y }, up, right, radii.topLeft)\n push({ x, y: -y }, right, down, radii.topRight)\n push({ x, y }, down, left, radii.bottomRight)\n push({ x: -x, y }, left, up, radii.bottomLeft)\n return { anchors, closed: true }\n}\n\n/** The four radii, clamped so opposite corners on an edge can't overlap. */\nfunction perCornerRadii(\n value: number | CornerRadiusResolved | undefined,\n width: number,\n height: number\n): CornerRadiusResolved {\n const raw: CornerRadiusResolved =\n value === undefined\n ? { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }\n : typeof value === \"number\"\n ? {\n topLeft: value,\n topRight: value,\n bottomLeft: value,\n bottomRight: value,\n }\n : value\n const cap = Math.min(width, height) / 2\n return {\n topLeft: Math.max(0, Math.min(raw.topLeft, cap)),\n topRight: Math.max(0, Math.min(raw.topRight, cap)),\n bottomLeft: Math.max(0, Math.min(raw.bottomLeft, cap)),\n bottomRight: Math.max(0, Math.min(raw.bottomRight, cap)),\n }\n}\n\n// ── Ellipse ────────────────────────────────────────────────────────────────\n\n/**\n * The ellipse family: a full oval, an arc (`sweep` under 360°), a ring\n * (`ratio` above 0), and the wedge the two make together.\n *\n * The arc is emitted as cubics rather than as an SVG `A` command, and that is\n * the whole reason this is worth writing out. A Path node's geometry is stored\n * as a fraction of its box and multiplied back by the box's *two* dimensions —\n * so an arc, whose parameters describe a circle rather than a set of points,\n * would come out of a non-uniform resize as a different curve rather than a\n * stretched one. Cubics survive that transform exactly.\n */\nfunction ellipseOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): VectorPath {\n const rx = width / 2\n const ry = height / 2\n const inner = clamp01(options.ratio ?? 0)\n const sweep = Math.max(0, Math.min(360, options.sweep ?? 360))\n if (sweep <= 0) return []\n\n // A full oval with no hole is the common case: one closed ring.\n const full = sweep >= 360\n // Degrees clockwise from twelve o'clock, matching the appearance schema's\n // `startAngle` — which is measured the way a clock face is, not the way\n // `Math.atan2` is.\n const from = ((options.startAngle ?? 0) - 90) * (Math.PI / 180)\n const to = from + sweep * (Math.PI / 180)\n\n if (full && inner <= 0) {\n return [{ anchors: arcAnchors(rx, ry, from, to, true), closed: true }]\n }\n if (full) {\n // A ring: two closed rings, the inner one wound the other way so the\n // even-odd fill leaves a hole.\n return [\n { anchors: arcAnchors(rx, ry, from, to, true), closed: true },\n { anchors: arcAnchors(rx * inner, ry * inner, to, from, true), closed: true },\n ]\n }\n\n // An arc, closed back on itself: out along the outer edge, back along the\n // inner one (or through the centre, when there is no hole).\n const outer = arcAnchors(rx, ry, from, to, false)\n const back =\n inner > 0\n ? arcAnchors(rx * inner, ry * inner, to, from, false)\n : [corner({ x: 0, y: 0 })]\n return [{ anchors: [...outer, ...back], closed: true }]\n}\n\n/**\n * An elliptical arc as a run of anchors, split into segments of at most 90° —\n * the span a single cubic approximates to within a fraction of a pixel.\n *\n * `whole` drops the duplicated final anchor, for the case where the arc closes\n * back on its own start.\n */\nfunction arcAnchors(\n rx: number,\n ry: number,\n from: number,\n to: number,\n whole: boolean\n): PathAnchor[] {\n const total = to - from\n const steps = Math.max(1, Math.ceil(Math.abs(total) / (Math.PI / 2)))\n const step = total / steps\n // The classic elliptical-arc approximation: each control point sits α along\n // the curve's own tangent, with α = (4/3)·tan(Δ/4) for a segment spanning Δ.\n // Signed with the step, so a clockwise arc bulges the right way.\n const alpha = (4 / 3) * Math.tan(step / 4)\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i <= steps; i++) {\n const a = from + step * i\n const point = { x: rx * Math.cos(a), y: ry * Math.sin(a) }\n // d/da of the point — the arc's tangent at this angle.\n const tangent = { x: -rx * Math.sin(a), y: ry * Math.cos(a) }\n const offset = { x: tangent.x * alpha, y: tangent.y * alpha }\n anchors.push({\n point,\n inHandle:\n i === 0 ? null : { x: point.x - offset.x, y: point.y - offset.y },\n outHandle:\n i === steps ? null : { x: point.x + offset.x, y: point.y + offset.y },\n })\n }\n\n if (whole && anchors.length > 1) {\n // The arc came back to where it started; fold the duplicate into the first\n // anchor so the ring has one anchor per corner rather than two stacked.\n const last = anchors.pop()!\n anchors[0].inHandle = last.inHandle\n }\n return anchors\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/components/builtins/layout/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAe,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,KAAK,EA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M,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACrH,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAkC,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;CACJ,CAAC,CAAC;AAEH,SAAS,IAAI,CAAC,KAAa;IACvB,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["import { lerpLookAt, type LookAt } from \"@/attributes/layout/space3d\";\r\nimport type { NodeOf } from \"@/components/factory/api\";\r\nimport { component2d } from \"@/components/factory/component2d\";\r\nimport { commandsFor } from \"@/components/factory/commands-for\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport * as Aim from \"@/components/modules/aim\";\r\nimport * as Corners from \"@/components/modules/corners\";\r\nimport * as Flow from \"@/components/modules/flow\";\r\nimport * as Paint from \"@/components/modules/paint\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport type { RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport type { ShapeProps } from \"@/components/builtins/geometry/geometry\";\r\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\r\n\r\n/** A framed viewport: painted like a rect, its children seen through a camera aimed inside it. */\r\nexport const Camera = component2d({\r\n key: \"camera\",\r\n state: { ...Paint.state, ...Flow.state, ...Aim.state, ...Corners.state },\r\n commands: { ...Paint.commands, ...Aim.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state), { children: () => Aim.camera(ctx, state) }),\r\n});\r\n\r\nconst orbit = {\r\n lookAt: Types.custom<LookAt>({ x: 0, y: 0 }, {\r\n lerp: lerpLookAt, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } },\r\n }),\r\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\r\n heading: Types.number(0, { step: 1, unit: \"°\" }),\r\n orbit: Types.number(0, { step: 1, unit: \"°\" }),\r\n elevation: Types.number(0, { step: 1, unit: \"°\" }),\r\n dolly: Types.number(0, { step: 10 }),\r\n orbitSpeed: Types.number(0),\r\n};\r\n\r\n/** The stage's 2.5D camera for one subtree: its children stand in one space, orbited in depth. */\r\nexport const OrbitCamera = component2d({\r\n key: \"orbitCamera\",\r\n state: orbit,\r\n defaults: { width: \"hug\", height: \"hug\", perspective: 1000 },\r\n commands: commandsFor(orbit, {\r\n orbitTo: { args: [\"orbit\", \"elevation\"] },\r\n dollyTo: { args: [\"dolly\"] },\r\n zoomTo: { args: [\"zoom\"] },\r\n panTo: { args: [\"lookAt\"] },\r\n headingTo: { args: [\"heading\"] },\r\n }),\r\n render: (ctx, state) => ctx.space({\r\n perspective: state.perspective,\r\n orbit: state.orbit + state.orbitSpeed * ctx.time.total,\r\n elevation: state.elevation,\r\n dolly: state.dolly,\r\n lookAt: state.lookAt,\r\n zoom: state.zoom,\r\n heading: state.heading,\r\n viewportX: 0,\r\n viewportY: 0,\r\n }),\r\n});\r\n\r\n/** Its children laid out in a box turned by `angle`, and turned with it: the box it reports is the turned one's bounds. */\r\nexport const RotatedBox = component2d({\r\n key: \"rotated-box\",\r\n state: { angle: Types.number(-90) },\r\n defaults: { rotation: (state) => state.angle },\r\n measure: (measurer, state, children) => {\r\n const { cos, sin } = turn(state.angle);\r\n const { width: w, height: h } = measurer.max;\r\n const ortho = Math.abs(state.angle % 180) === 90;\r\n const room = w !== undefined && h !== undefined\r\n ? { width: w * cos + h * sin, height: w * sin + h * cos }\r\n : { width: ortho ? h : w, height: ortho ? w : h };\r\n let width = 0;\r\n let height = 0;\r\n for (const child of children) {\r\n const size = child.measure(room);\r\n width = Math.max(width, size.width);\r\n height = Math.max(height, size.height);\r\n }\r\n return { width: width * cos + height * sin, height: width * sin + height * cos };\r\n },\r\n layout: (box, state, children) => {\r\n const { cos, sin } = turn(state.angle);\r\n const turned = { x: 0, y: 0, width: box.width * cos + box.height * sin, height: box.width * sin + box.height * cos };\r\n return Flow.layout(turned, state as unknown as Flow.FlowState, children);\r\n },\r\n});\r\n\r\nfunction turn(angle: number): { cos: number; sin: number } {\r\n const rad = angle * (Math.PI / 180);\r\n return { cos: Math.abs(Math.cos(rad)), sin: Math.abs(Math.sin(rad)) };\r\n}\r\n\r\nexport type Camera = NodeOf<typeof Camera>;\r\nexport type OrbitCamera = NodeOf<typeof OrbitCamera>;\r\nexport type RotatedBox = NodeOf<typeof RotatedBox>;\r\n\r\n// What code building a camera or a rotated box names its props as.\r\n\r\nexport interface CameraProps extends ShapeProps {\r\n /** Magnification factor. Values > 1 zoom in; < 1 zoom out. */\r\n zoom: number;\r\n /**\r\n * World-space point that maps to the centre of the camera viewport — what\r\n * the camera is pointed at. Same name and meaning as\r\n * `Graphics3D.perspective({ lookAt })`, so a 2D and a 3D camera are aimed\r\n * with the same word.\r\n */\r\n lookAt: Vector2;\r\n /** Rotation of the camera view in degrees (clockwise). */\r\n heading: number;\r\n /**\r\n * A node of the camera's world to keep in view, by id: the camera is aimed\r\n * at its centre each frame, and {@link lookAt} becomes an offset from it.\r\n */\r\n follow: string;\r\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\r\n cornerRadius: RectCornerRadius;\r\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\r\n cornerStyle: RectCornerStyle;\r\n}\r\n\r\nexport interface OrbitCameraProps extends Node2DProps {\r\n /** The point the camera orbits and looks at; `z` puts it in depth, as a node's `depth` does. */\r\n lookAt: LookAt;\r\n /** Lens zoom, applied after the projection. Values > 1 zoom in. */\r\n zoom: number;\r\n /** Roll of the view in degrees, clockwise. */\r\n heading: number;\r\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera right. */\r\n orbit: number;\r\n /** Degrees above the layers. Positive looks down on them. */\r\n elevation: number;\r\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective. */\r\n dolly: number;\r\n /** Degrees per second the camera orbits on its own — a turntable. */\r\n orbitSpeed: number;\r\n}\r\n\r\n// Adjust this import path if needed\r\n\r\nexport interface RotatedBoxProps extends Node2DProps {\r\n /** \r\n * Visual rotation angle in degrees. Unlike standard `rotation`, \r\n * animating this ALSO dynamically calculates a new bounding box \r\n * for the flex/layout engine. \r\n */\r\n angle: number;\r\n}\r\n"]}
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/components/builtins/layout/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAe,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAOpD,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAA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rH,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAkC,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;CACJ,CAAC,CAAC;AAEH,SAAS,IAAI,CAAC,KAAa;IACvB,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["import { lerpLookAt, type LookAt } from \"@/attributes/layout/space3d\";\nimport type { NodeOf } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { commandsFor } from \"@/components/factory/commands-for\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Aim from \"@/components/modules/aim\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport type { RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { ShapeProps } from \"@/components/builtins/geometry/geometry\";\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\n\n/** A framed viewport: painted like a rect, its children seen through a camera aimed inside it. */\nexport const Camera = component2d({\n key: \"camera\",\n state: { ...Paint.state, ...Flow.state, ...Aim.state, ...Corners.state },\n commands: { ...Paint.commands, ...Aim.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state), { children: () => Aim.camera(ctx, state) }),\n});\n\nconst orbit = {\n lookAt: Types.custom<LookAt>({ x: 0, y: 0 }, {\n lerp: lerpLookAt, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } },\n }),\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\n heading: Types.number(0, { step: 1, unit: \"°\" }),\n orbit: Types.number(0, { step: 1, unit: \"°\" }),\n elevation: Types.number(0, { step: 1, unit: \"°\" }),\n dolly: Types.number(0, { step: 10 }),\n orbitSpeed: Types.number(0),\n};\n\n/** The stage's 2.5D camera for one subtree: its children stand in one space, orbited in depth. */\nexport const OrbitCamera = component2d({\n key: \"orbitCamera\",\n state: orbit,\n defaults: { width: \"hug\", height: \"hug\", perspective: 1000 },\n commands: commandsFor(orbit, {\n orbitTo: { args: [\"orbit\", \"elevation\"] },\n dollyTo: { args: [\"dolly\"] },\n zoomTo: { args: [\"zoom\"] },\n panTo: { args: [\"lookAt\"] },\n headingTo: { args: [\"heading\"] },\n }),\n render: (ctx, state) => ctx.space({\n perspective: state.perspective,\n orbit: state.orbit + state.orbitSpeed * ctx.time.total,\n elevation: state.elevation,\n dolly: state.dolly,\n lookAt: state.lookAt,\n zoom: state.zoom,\n heading: state.heading,\n viewportX: 0,\n viewportY: 0,\n }),\n});\n\n/** Its children laid out in a box turned by `angle`, and turned with it: the box it reports is the turned one's bounds. */\nexport const RotatedBox = component2d({\n key: \"rotated-box\",\n state: { angle: Types.number(-90) },\n defaults: { rotation: (state) => state.angle },\n measure: (measurer, state, children) => {\n const { cos, sin } = turn(state.angle);\n const { width: w, height: h } = measurer.max;\n const ortho = Math.abs(state.angle % 180) === 90;\n const room = w !== undefined && h !== undefined\n ? { width: w * cos + h * sin, height: w * sin + h * cos }\n : { width: ortho ? h : w, height: ortho ? w : h };\n let width = 0;\n let height = 0;\n for (const child of children) {\n const size = child.measure(room);\n width = Math.max(width, size.width);\n height = Math.max(height, size.height);\n }\n return { width: width * cos + height * sin, height: width * sin + height * cos };\n },\n layout: (box, state, children) => {\n const { cos, sin } = turn(state.angle);\n const turned = { x: 0, y: 0, width: box.width * cos + box.height * sin, height: box.width * sin + box.height * cos };\n return Flow.layout(turned, state as unknown as Flow.FlowState, children);\n },\n});\n\nfunction turn(angle: number): { cos: number; sin: number } {\n const rad = angle * (Math.PI / 180);\n return { cos: Math.abs(Math.cos(rad)), sin: Math.abs(Math.sin(rad)) };\n}\n\nexport type Camera = NodeOf<typeof Camera>;\nexport type OrbitCamera = NodeOf<typeof OrbitCamera>;\nexport type RotatedBox = NodeOf<typeof RotatedBox>;\n\n// What code building a camera or a rotated box names its props as.\n\nexport interface CameraProps extends ShapeProps {\n /** Magnification factor. Values > 1 zoom in; < 1 zoom out. */\n zoom: number;\n /**\n * World-space point that maps to the centre of the camera viewport — what\n * the camera is pointed at. Same name and meaning as\n * `Graphics3D.perspective({ lookAt })`, so a 2D and a 3D camera are aimed\n * with the same word.\n */\n lookAt: Vector2;\n /** Rotation of the camera view in degrees (clockwise). */\n heading: number;\n /**\n * A node of the camera's world to keep in view, by id: the camera is aimed\n * at its centre each frame, and {@link lookAt} becomes an offset from it.\n */\n follow: string;\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\n cornerRadius: RectCornerRadius;\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\n cornerStyle: RectCornerStyle;\n}\n\nexport interface OrbitCameraProps extends Node2DProps {\n /** The point the camera orbits and looks at; `z` puts it in depth, as a node's `depth` does. */\n lookAt: LookAt;\n /** Lens zoom, applied after the projection. Values > 1 zoom in. */\n zoom: number;\n /** Roll of the view in degrees, clockwise. */\n heading: number;\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera right. */\n orbit: number;\n /** Degrees above the layers. Positive looks down on them. */\n elevation: number;\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective. */\n dolly: number;\n /** Degrees per second the camera orbits on its own — a turntable. */\n orbitSpeed: number;\n}\n\n// Adjust this import path if needed\n\nexport interface RotatedBoxProps extends Node2DProps {\n /** \n * Visual rotation angle in degrees. Unlike standard `rotation`, \n * animating this ALSO dynamically calculates a new bounding box \n * for the flex/layout engine. \n */\n angle: number;\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import type { Alignment } from "../../../attributes/layout/alignment.js";
2
2
  import type { InsetsResolved } from "../../../attributes/layout/insets.js";
3
3
  import type { Vector2 } from "../../../attributes/layout/vector2.js";
4
- import { type AudioFilter } from "../../../attributes/audio/filters/chain.js";
5
- import type { AudioFilterItem } from "../../../attributes/audio/filters/union.js";
4
+ import { type AudioEffectsInput } from "../../../attributes/audio/effects/chain.js";
5
+ import type { AudioEffect } from "../../../attributes/audio/effects/union.js";
6
6
  import type { ImageFit, ImageMatrix, ImageCrop } from "../../../attributes/shape/fill/implementations/image.js";
7
7
  import { type VideoAdjustment } from "../../../attributes/shape/filters/chain.js";
8
8
  import { type AnyFilter } from "../../../attributes/shape/filters/registry.js";
@@ -25,7 +25,7 @@ export declare const Video: import("../../../components/factory/api.js").Compone
25
25
  readonly duration: import("../../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
26
26
  readonly volume: number;
27
27
  readonly muted: boolean;
28
- readonly audioFilters: import("../../../components/factory/api.js").Type<AudioFilter, AudioFilterItem[], false>;
28
+ readonly audioEffects: import("../../../components/factory/api.js").Type<AudioEffectsInput, AudioEffect[], false>;
29
29
  readonly bus: import("../../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
30
30
  readonly segments: import("../../../components/factory/api.js").Type<readonly VideoSegment[], readonly VideoSegment[], false>;
31
31
  readonly cornerRadius: import("../../../components/factory/types.js").Attribute<import("../../../index.js").RectCornerRadius, import("../../../index.js").CornerRadiusResolved>;
@@ -73,7 +73,7 @@ export declare const Video: import("../../../components/factory/api.js").Compone
73
73
  readonly duration: import("../../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
74
74
  readonly volume: number;
75
75
  readonly muted: boolean;
76
- readonly audioFilters: import("../../../components/factory/api.js").Type<AudioFilter, AudioFilterItem[], false>;
76
+ readonly audioEffects: import("../../../components/factory/api.js").Type<AudioEffectsInput, AudioEffect[], false>;
77
77
  readonly bus: import("../../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
78
78
  readonly segments: import("../../../components/factory/api.js").Type<readonly VideoSegment[], readonly VideoSegment[], false>;
79
79
  readonly cornerRadius: import("../../../components/factory/types.js").Attribute<import("../../../index.js").RectCornerRadius, import("../../../index.js").CornerRadiusResolved>;
@@ -107,7 +107,7 @@ export declare const Video: import("../../../components/factory/api.js").Compone
107
107
  readonly duration: import("../../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
108
108
  readonly volume: number;
109
109
  readonly muted: boolean;
110
- readonly audioFilters: import("../../../components/factory/api.js").Type<AudioFilter, AudioFilterItem[], false>;
110
+ readonly audioEffects: import("../../../components/factory/api.js").Type<AudioEffectsInput, AudioEffect[], false>;
111
111
  readonly bus: import("../../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
112
112
  readonly segments: import("../../../components/factory/api.js").Type<readonly VideoSegment[], readonly VideoSegment[], false>;
113
113
  readonly cornerRadius: import("../../../components/factory/types.js").Attribute<import("../../../index.js").RectCornerRadius, import("../../../index.js").CornerRadiusResolved>;
@@ -174,8 +174,8 @@ export interface VideoProps extends RectProps {
174
174
  volume?: number;
175
175
  /** Silence the video's audio track without affecting the picture. Default false. */
176
176
  muted?: boolean;
177
- /** Audio filters applied to the video's sound track (gain, eq, echo, …). */
178
- audioFilters?: AudioFilter;
177
+ /** Audio effects applied to the video's sound track (gain, eq, echo, …). */
178
+ audioEffects?: AudioEffectsInput;
179
179
  /**
180
180
  * The node id of an `AudioBus` in this clip to route the video's sound into.
181
181
  *
@@ -1 +1 @@
1
- {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAA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AC;IACtC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;;;;;;;;OAUG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAEtC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IACzB,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1,4 +1,4 @@
1
- import { AudioFilters, resolveAudioFilters } from "../../../attributes/audio/filters/chain.js";
1
+ import { resolveAudioEffects } from "../../../attributes/audio/effects/chain.js";
2
2
  import { sourceTimeFor } from "../../../attributes/shape/fill/implementations/video.js";
3
3
  import { resolveFill, UNSET_MEDIA_FILL } from "../../../attributes/shape/fill/registry.js";
4
4
  import { resolveChainAdjustments } from "../../../attributes/shape/filters/chain.js";
@@ -35,7 +35,7 @@ const video = {
35
35
  duration: Types.custom(undefined),
36
36
  volume: 1,
37
37
  muted: false,
38
- audioFilters: Types.custom([], { resolve: (v) => resolveAudioFilters(v) }),
38
+ audioEffects: Types.custom([], { resolve: (v) => resolveAudioEffects(v) }),
39
39
  bus: Types.custom(undefined),
40
40
  segments: Types.custom([]),
41
41
  };
@@ -85,13 +85,6 @@ function pictureOf(host, s, elapsed) {
85
85
  pictures.set(host, { key, fill });
86
86
  return fill;
87
87
  }
88
- function soundFilters(s, speed) {
89
- const filters = [];
90
- if (speed !== 1)
91
- filters.push(...resolveAudioFilters(AudioFilters.speed(speed)));
92
- filters.push(...s.audioFilters);
93
- return filters;
94
- }
95
88
  export const Video = component2d({
96
89
  key: "video",
97
90
  state: { ...Paint.state, ...Flow.state, ...Corners.state, ...video },
@@ -116,7 +109,8 @@ export const Video = component2d({
116
109
  loop,
117
110
  trimStart: segment ? timeline.args.from : s.trimStart,
118
111
  trimEnd: s.trimEnd,
119
- filters: soundFilters(s, speed),
112
+ speed,
113
+ effects: s.audioEffects,
120
114
  bus: s.bus,
121
115
  optional: true,
122
116
  closed: !loop,
@@ -1 +1 @@
1
- {"version":3,"file":"media.js","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAoB,MAAM,kCAAkC,CAAC;AAGvG,OAAO,EAAE,aAAa,EAA8C,MAAM,+CAA+C,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAwB,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAE,eAAe,EAAkB,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD;;;;GAIG;AAEH,MAAM,KAAK,GAAG;IACV,GAAG,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IAChD,GAAG,EAAE,KAAK,C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AAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAU,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;gBACxH,CAAC,CAAC,IAAI,CAAC;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import type { Alignment } from \"@/attributes/layout/alignment\";\r\nimport type { InsetsResolved } from \"@/attributes/layout/insets\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { AudioFilters, resolveAudioFilters, type AudioFilter } from \"@/attributes/audio/filters/chain\";\r\nimport type { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport type { ImageFit, ImageMatrix, ImageCrop } from \"@/attributes/shape/fill/implementations/image\";\r\nimport { sourceTimeFor, type VideoFillProp, type VideoFillResolved } from \"@/attributes/shape/fill/implementations/video\";\r\nimport { resolveFill, UNSET_MEDIA_FILL } from \"@/attributes/shape/fill/registry\";\r\nimport type { FillProp } from \"@/attributes/shape/fill/union\";\r\nimport { resolveChainAdjustments, type VideoAdjustment } from \"@/attributes/shape/filters/chain\";\r\nimport { lerpFilterArray, type AnyFilter } from \"@/attributes/shape/filters/registry\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { NodeOf, Values } from \"@/components/factory/api\";\r\nimport { component2d } from \"@/components/factory/component2d\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport * as Corners from \"@/components/modules/corners\";\r\nimport * as Flow from \"@/components/modules/flow\";\r\nimport * as Paint from \"@/components/modules/paint\";\r\nimport { internalsOf } from \"@/components/factory/views\";\r\nimport type { RectProps } from \"@/components/builtins/geometry/geometry\";\r\n\r\n/**\r\n * Video: a rect painted with a playing picture under its fill, and the\r\n * picture's sound. Its sound plays from `play`; a `video` row with no `play`\r\n * of its own gets one per segment, or one over its span while it plays.\r\n */\r\n\r\nconst video = {\r\n src: Types.custom<string | undefined>(undefined),\r\n fit: Types.custom<ImageFit | undefined>(undefined),\r\n crop: Types.insets,\r\n zoom: 1,\r\n anchor: Types.alignment,\r\n matrix: Types.custom<ImageMatrix | undefined>(undefined),\r\n filters: Types.custom<VideoAdjustment, AnyFilter[]>([] as never, {\r\n resolve: (v) => resolveChainAdjustments(v),\r\n lerp: lerpFilterArray,\r\n }),\r\n playing: true,\r\n timestamp: Types.custom<number | null | undefined>(undefined),\r\n trimStart: Types.custom<number | undefined>(undefined),\r\n trimEnd: Types.custom<number | undefined>(undefined),\r\n speed: Types.custom<number | undefined>(undefined),\r\n loop: Types.custom<\"forward\" | \"reverse\" | \"none\" | undefined>(undefined),\r\n duration: Types.custom<number | undefined>(undefined),\r\n volume: 1,\r\n muted: false,\r\n audioFilters: Types.custom<AudioFilter, AudioFilterItem[]>([] as never, { resolve: (v) => resolveAudioFilters(v) }),\r\n bus: Types.custom<string | undefined>(undefined),\r\n segments: Types.custom<readonly VideoSegment[]>([]),\r\n};\r\n\r\ntype VideoState = Values<typeof video> & { readonly crop: InsetsResolved; readonly anchor: Alignment };\r\n\r\n/** Source seconds played by `elapsed` clip seconds into the segments, or `null` without any. */\r\nfunction playedAt(s: VideoState, elapsed: number): number | null {\r\n if (s.segments.length === 0) return null;\r\n let played = 0;\r\n for (const segment of s.segments) {\r\n if (elapsed <= segment.at) break;\r\n played += Math.min(elapsed - segment.at, segment.duration) * (segment.speed ?? s.speed ?? 1);\r\n }\r\n return played;\r\n}\r\n\r\nfunction scheduledTimestamp(s: VideoState, elapsed: number): number | undefined {\r\n const played = playedAt(s, elapsed);\r\n if (played === null) return undefined;\r\n const start = s.trimStart ?? 0;\r\n const first = s.segments[0];\r\n return sourceTimeFor(played + (first ? first.from - start : 0), start, s.trimEnd ?? Infinity, s.loop, s.duration);\r\n}\r\n\r\nconst pictures = new WeakMap<object, { readonly key: string; readonly fill: VideoFillResolved }>();\r\n\r\n/** The frame to paint, resolved once per change of what it depends on. */\r\nfunction pictureOf(host: object, s: VideoState, elapsed: number): VideoFillResolved | null {\r\n if (!s.src) {\r\n pictures.delete(host);\r\n return null;\r\n }\r\n const scheduled = scheduledTimestamp(s, elapsed);\r\n const crop = s.crop;\r\n const anchor = s.anchor as unknown as Vector2;\r\n const key = [\r\n s.src, s.fit ?? \"\", s.zoom, s.playing ? 1 : 0, crop.left, crop.right, crop.top, crop.bottom, anchor.x, anchor.y,\r\n s.timestamp ?? \"\", s.trimStart ?? \"\", s.trimEnd ?? \"\", s.speed ?? \"\", s.loop ?? \"\", s.duration ?? \"\", scheduled ?? \"\",\r\n ].join(\"|\");\r\n const kept = pictures.get(host);\r\n if (kept && kept.key === key) return kept.fill;\r\n const prop: VideoFillProp = {\r\n type: \"video\", src: s.src, fit: s.fit, crop: s.crop, zoom: s.zoom, anchor: s.anchor, matrix: s.matrix,\r\n filters: s.filters as never, playing: s.playing, timestamp: s.timestamp ?? scheduled,\r\n trimStart: s.trimStart, trimEnd: s.trimEnd, speed: s.speed, loop: s.loop, duration: s.duration,\r\n };\r\n const fill = resolveFill(prop as FillProp) as VideoFillResolved;\r\n pictures.set(host, { key, fill });\r\n return fill;\r\n}\r\n\r\nfunction soundFilters(s: VideoState, speed: number): AudioFilterItem[] {\r\n const filters: AudioFilterItem[] = [];\r\n if (speed !== 1) filters.push(...resolveAudioFilters(AudioFilters.speed(speed)));\r\n filters.push(...s.audioFilters);\r\n return filters;\r\n}\r\n\r\nexport const Video = component2d({\r\n key: \"video\",\r\n state: { ...Paint.state, ...Flow.state, ...Corners.state, ...video },\r\n commands: {\r\n ...Paint.commands,\r\n /** Its sound: from `from` in the source for a segment, or as it plays. Cut when the command ends. */\r\n play: {\r\n args: {\r\n from: Types.custom<number | undefined>(undefined),\r\n volume: Types.custom<number | undefined>(undefined),\r\n speed: Types.custom<number | undefined>(undefined),\r\n },\r\n run: (timeline, state) => {\r\n const s = state as unknown as VideoState;\r\n const segment = timeline.args.from !== undefined;\r\n if (!s.src || s.muted || (!segment && !s.playing)) return timeline.together([]);\r\n const speed = timeline.args.speed ?? s.speed ?? 1;\r\n const loop = !segment && (s.loop ?? \"none\") !== \"none\";\r\n return timeline.sound(s.src, {\r\n volume: timeline.args.volume ?? s.volume,\r\n loop,\r\n trimStart: segment ? timeline.args.from : s.trimStart,\r\n trimEnd: s.trimEnd,\r\n filters: soundFilters(s, speed),\r\n bus: s.bus,\r\n optional: true,\r\n closed: !loop,\r\n });\r\n },\r\n },\r\n },\r\n load: (loader, state) => {\r\n if (!state.src) return;\r\n loader.fill(resolveFill({\r\n type: \"video\", src: state.src, filters: state.filters, trimStart: state.trimStart, trimEnd: state.trimEnd,\r\n } as unknown as FillProp));\r\n },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => {\r\n const s = state as unknown as VideoState & Values<typeof Paint.state> & Values<typeof Corners.state>;\r\n const picture = pictureOf(internalsOf(ctx).host, s, ctx.time.elapsed);\r\n const outline = { width: ctx.size.width, height: ctx.size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle, start: s.start, end: s.end };\r\n Paint.draw(ctx, state, Corners.rect(ctx.size, state), {\r\n fill: [(picture ?? UNSET_MEDIA_FILL), ...state.fill] as never,\r\n // The overlay lies on the picture only, masked by it.\r\n overlay: () => (picture\r\n ? new Graphics2D().mask().rect(outline).fill([picture] as never).applyMask().rect(outline).fill(state.overlay).endMask()\r\n : null),\r\n });\r\n },\r\n});\r\n\r\nexport type Video = NodeOf<typeof Video>;\r\n\r\n// What code building a video names its props as, and the segments it plays.\r\n\r\nexport interface VideoProps extends RectProps {\r\n src?: string;\r\n /** How the (cropped) frame is scaled into the node's bounds. Default 'fill'. */\r\n fit?: ImageFit;\r\n /** Window onto the source frame, in fractions of its own size, applied before `fit`. */\r\n crop?: ImageCrop;\r\n /** Magnification on top of the fitted scale. `1` (default) 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 frame→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\r\n matrix?: ImageMatrix;\r\n /** Visual filters applied to the rendered frame (blur, color, posterizeTime, echo, …). */\r\n filters?: VideoAdjustment;\r\n /** Whether playback advances with the node's clock (drives both picture and sound). Default true. */\r\n playing?: boolean;\r\n /**\r\n * Explicit source time to show, in seconds. Omit it (the default) and the\r\n * picture is timed from the moment this node appeared; set it to drive the\r\n * playhead yourself, and set it to `null` to hand the playhead back to the\r\n * clock (`set()` merges a partial, so `undefined` won't clear it).\r\n */\r\n timestamp?: number | null;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n /** Playback-rate multiplier for both picture and audio. Default 1. */\r\n speed?: number;\r\n loop?: 'forward' | 'reverse' | 'none';\r\n /** Length of one loop cycle, in seconds. Defaults to the trimmed clip length. */\r\n duration?: number;\r\n /** Audio volume in [0, 1]. Default 1. */\r\n volume?: number;\r\n /** Silence the video's audio track without affecting the picture. Default false. */\r\n muted?: boolean;\r\n /** Audio filters applied to the video's sound track (gain, eq, echo, …). */\r\n audioFilters?: AudioFilter;\r\n /**\r\n * The node id of an `AudioBus` in this clip to route the video's sound into.\r\n *\r\n * A `Video` is a `Node2D`, so it cannot be parented under a bus the way a\r\n * `SoundNode` is — its audio is welded to its picture, which has to stay in\r\n * the visual tree. Naming one instead is what lets a video's dialogue sit on\r\n * the same bus as everything else, so ducking the whole group is still one\r\n * edit — and it is the *same* id a `SoundNode` under that bus writes as its\r\n * `parentId`, rather than a second vocabulary for \"which bus\". An id matching\r\n * no bus routes straight to the master, the same as no bus at all.\r\n */\r\n bus?: string;\r\n /**\r\n * An explicit **playback schedule**: the stretches of this node's own clock\r\n * during which the clip advances, and where in the source each one starts.\r\n *\r\n * Omit it (the default) and playback is what it has always been — the clip\r\n * runs from the moment the node appears, at `speed`, until it or the node\r\n * runs out. Give it, and `playing`/`timestamp` are both superseded: the\r\n * picture takes its source time from whichever segment covers the current\r\n * `elapsed`, and the sound is scheduled one clip per segment.\r\n *\r\n * It exists because a **pause** cannot be expressed any other way. `playing:\r\n * false` holds the clip's *first* frame, because with playback derived\r\n * linearly from the clock there is nothing else it could hold; and the sound\r\n * runs on the node's own clock regardless, so a picture frozen by any means\r\n * would drift away from it. A schedule states the one thing both halves need\r\n * and neither could infer — that a paused stretch consumes no source — so\r\n * they cannot come apart.\r\n *\r\n * Still a pure function of the clock, which is the property everything else\r\n * here is built on: frame *N* is identical however the playhead reached it,\r\n * so a scrub, a playthrough and an export agree.\r\n */\r\n segments?: readonly VideoSegment[];\r\n\r\n}\r\n\r\n/**\r\n * One stretch of a {@link Video}'s own clock during which its source advances —\r\n * see {@link VideoProps.segments}.\r\n *\r\n * Trim and loop are applied *on top* of this, by the same code that applies them\r\n * to unscheduled playback, so a schedule says when the clip is running and the\r\n * clip's own props go on saying which part of the file it is running through.\r\n */\r\nexport interface VideoSegment {\r\n /** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */\r\n at: number;\r\n /** Source in-point for it, in seconds. */\r\n from: number;\r\n /**\r\n * How long it runs, in seconds of the node's clock.\r\n *\r\n * `Infinity` for a clip left running — the same open sentinel\r\n * `AudioRequest.endAt` uses — which resolves against the clip's length.\r\n */\r\n duration: number;\r\n /** Playback rate through it. Defaults to the node's own `speed`. */\r\n speed?: number;\r\n /** Linear gain for its sound. Defaults to the node's own `volume`. */\r\n volume?: number;\r\n}\r\n"]}
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,kCAAkC,CAAC;AAG/F,OAAO,EAAE,aAAa,EAA8C,MAAM,+CAA+C,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAwB,MAAM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,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,gBAAgB,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAU;YAC7D,sDAAsD;YACtD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO;gBACnB,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAU,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;gBACxH,CAAC,CAAC,IAAI,CAAC;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import type { Alignment } from \"@/attributes/layout/alignment\";\nimport type { InsetsResolved } from \"@/attributes/layout/insets\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { resolveAudioEffects, type AudioEffectsInput } from \"@/attributes/audio/effects/chain\";\nimport type { AudioEffect } from \"@/attributes/audio/effects/union\";\nimport type { ImageFit, ImageMatrix, ImageCrop } from \"@/attributes/shape/fill/implementations/image\";\nimport { sourceTimeFor, type VideoFillProp, type VideoFillResolved } from \"@/attributes/shape/fill/implementations/video\";\nimport { resolveFill, UNSET_MEDIA_FILL } from \"@/attributes/shape/fill/registry\";\nimport type { FillProp } from \"@/attributes/shape/fill/union\";\nimport { resolveChainAdjustments, type VideoAdjustment } from \"@/attributes/shape/filters/chain\";\nimport { lerpFilterArray, type AnyFilter } from \"@/attributes/shape/filters/registry\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport type { NodeOf, Values } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport { internalsOf } from \"@/components/factory/views\";\nimport type { RectProps } from \"@/components/builtins/geometry/geometry\";\n\n/**\n * Video: a rect painted with a playing picture under its fill, and the\n * picture's sound. Its sound plays from `play`; a `video` row with no `play`\n * of its own gets one per segment, or one over its span while it plays.\n */\n\nconst video = {\n src: Types.custom<string | undefined>(undefined),\n fit: Types.custom<ImageFit | undefined>(undefined),\n crop: Types.insets,\n zoom: 1,\n anchor: Types.alignment,\n matrix: Types.custom<ImageMatrix | undefined>(undefined),\n filters: Types.custom<VideoAdjustment, AnyFilter[]>([] as never, {\n resolve: (v) => resolveChainAdjustments(v),\n lerp: lerpFilterArray,\n }),\n playing: true,\n timestamp: Types.custom<number | null | undefined>(undefined),\n trimStart: Types.custom<number | undefined>(undefined),\n trimEnd: Types.custom<number | undefined>(undefined),\n speed: Types.custom<number | undefined>(undefined),\n loop: Types.custom<\"forward\" | \"reverse\" | \"none\" | undefined>(undefined),\n duration: Types.custom<number | undefined>(undefined),\n volume: 1,\n muted: false,\n audioEffects: Types.custom<AudioEffectsInput, AudioEffect[]>([] as never, { resolve: (v) => resolveAudioEffects(v) }),\n bus: Types.custom<string | undefined>(undefined),\n segments: Types.custom<readonly VideoSegment[]>([]),\n};\n\ntype VideoState = Values<typeof video> & { readonly crop: InsetsResolved; readonly anchor: Alignment };\n\n/** Source seconds played by `elapsed` clip seconds into the segments, or `null` without any. */\nfunction playedAt(s: VideoState, elapsed: number): number | null {\n if (s.segments.length === 0) return null;\n let played = 0;\n for (const segment of s.segments) {\n if (elapsed <= segment.at) break;\n played += Math.min(elapsed - segment.at, segment.duration) * (segment.speed ?? s.speed ?? 1);\n }\n return played;\n}\n\nfunction scheduledTimestamp(s: VideoState, elapsed: number): number | undefined {\n const played = playedAt(s, elapsed);\n if (played === null) return undefined;\n const start = s.trimStart ?? 0;\n const first = s.segments[0];\n return sourceTimeFor(played + (first ? first.from - start : 0), start, s.trimEnd ?? Infinity, s.loop, s.duration);\n}\n\nconst pictures = new WeakMap<object, { readonly key: string; readonly fill: VideoFillResolved }>();\n\n/** The frame to paint, resolved once per change of what it depends on. */\nfunction pictureOf(host: object, s: VideoState, elapsed: number): VideoFillResolved | null {\n if (!s.src) {\n pictures.delete(host);\n return null;\n }\n const scheduled = scheduledTimestamp(s, elapsed);\n const crop = s.crop;\n const anchor = s.anchor as unknown as Vector2;\n const key = [\n s.src, s.fit ?? \"\", s.zoom, s.playing ? 1 : 0, crop.left, crop.right, crop.top, crop.bottom, anchor.x, anchor.y,\n s.timestamp ?? \"\", s.trimStart ?? \"\", s.trimEnd ?? \"\", s.speed ?? \"\", s.loop ?? \"\", s.duration ?? \"\", scheduled ?? \"\",\n ].join(\"|\");\n const kept = pictures.get(host);\n if (kept && kept.key === key) return kept.fill;\n const prop: VideoFillProp = {\n type: \"video\", src: s.src, fit: s.fit, crop: s.crop, zoom: s.zoom, anchor: s.anchor, matrix: s.matrix,\n filters: s.filters as never, playing: s.playing, timestamp: s.timestamp ?? scheduled,\n trimStart: s.trimStart, trimEnd: s.trimEnd, speed: s.speed, loop: s.loop, duration: s.duration,\n };\n const fill = resolveFill(prop as FillProp) as VideoFillResolved;\n pictures.set(host, { key, fill });\n return fill;\n}\n\nexport const Video = component2d({\n key: \"video\",\n state: { ...Paint.state, ...Flow.state, ...Corners.state, ...video },\n commands: {\n ...Paint.commands,\n /** Its sound: from `from` in the source for a segment, or as it plays. Cut when the command ends. */\n play: {\n args: {\n from: Types.custom<number | undefined>(undefined),\n volume: Types.custom<number | undefined>(undefined),\n speed: Types.custom<number | undefined>(undefined),\n },\n run: (timeline, state) => {\n const s = state as unknown as VideoState;\n const segment = timeline.args.from !== undefined;\n if (!s.src || s.muted || (!segment && !s.playing)) return timeline.together([]);\n const speed = timeline.args.speed ?? s.speed ?? 1;\n const loop = !segment && (s.loop ?? \"none\") !== \"none\";\n return timeline.sound(s.src, {\n volume: timeline.args.volume ?? s.volume,\n loop,\n trimStart: segment ? timeline.args.from : s.trimStart,\n trimEnd: s.trimEnd,\n speed,\n effects: s.audioEffects,\n bus: s.bus,\n optional: true,\n closed: !loop,\n });\n },\n },\n },\n load: (loader, state) => {\n if (!state.src) return;\n loader.fill(resolveFill({\n type: \"video\", src: state.src, filters: state.filters, trimStart: state.trimStart, trimEnd: state.trimEnd,\n } as unknown as FillProp));\n },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const s = state as unknown as VideoState & Values<typeof Paint.state> & Values<typeof Corners.state>;\n const picture = pictureOf(internalsOf(ctx).host, s, ctx.time.elapsed);\n const outline = { width: ctx.size.width, height: ctx.size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle, start: s.start, end: s.end };\n Paint.draw(ctx, state, Corners.rect(ctx.size, state), {\n fill: [(picture ?? UNSET_MEDIA_FILL), ...state.fill] as never,\n // The overlay lies on the picture only, masked by it.\n overlay: () => (picture\n ? new Graphics2D().mask().rect(outline).fill([picture] as never).applyMask().rect(outline).fill(state.overlay).endMask()\n : null),\n });\n },\n});\n\nexport type Video = NodeOf<typeof Video>;\n\n// What code building a video names its props as, and the segments it plays.\n\nexport interface VideoProps extends RectProps {\n src?: string;\n /** How the (cropped) frame is scaled into the node's bounds. Default 'fill'. */\n fit?: ImageFit;\n /** Window onto the source frame, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` (default) 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 frame→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n /** Visual filters applied to the rendered frame (blur, color, posterizeTime, echo, …). */\n filters?: VideoAdjustment;\n /** Whether playback advances with the node's clock (drives both picture and sound). Default true. */\n playing?: boolean;\n /**\n * Explicit source time to show, in seconds. Omit it (the default) and the\n * picture is timed from the moment this node appeared; set it to drive the\n * playhead yourself, and set it to `null` to hand the playhead back to the\n * clock (`set()` merges a partial, so `undefined` won't clear it).\n */\n timestamp?: number | null;\n trimStart?: number;\n trimEnd?: number;\n /** Playback-rate multiplier for both picture and audio. Default 1. */\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n /** Length of one loop cycle, in seconds. Defaults to the trimmed clip length. */\n duration?: number;\n /** Audio volume in [0, 1]. Default 1. */\n volume?: number;\n /** Silence the video's audio track without affecting the picture. Default false. */\n muted?: boolean;\n /** Audio effects applied to the video's sound track (gain, eq, echo, …). */\n audioEffects?: AudioEffectsInput;\n /**\n * The node id of an `AudioBus` in this clip to route the video's sound into.\n *\n * A `Video` is a `Node2D`, so it cannot be parented under a bus the way a\n * `SoundNode` is — its audio is welded to its picture, which has to stay in\n * the visual tree. Naming one instead is what lets a video's dialogue sit on\n * the same bus as everything else, so ducking the whole group is still one\n * edit — and it is the *same* id a `SoundNode` under that bus writes as its\n * `parentId`, rather than a second vocabulary for \"which bus\". An id matching\n * no bus routes straight to the master, the same as no bus at all.\n */\n bus?: string;\n /**\n * An explicit **playback schedule**: the stretches of this node's own clock\n * during which the clip advances, and where in the source each one starts.\n *\n * Omit it (the default) and playback is what it has always been — the clip\n * runs from the moment the node appears, at `speed`, until it or the node\n * runs out. Give it, and `playing`/`timestamp` are both superseded: the\n * picture takes its source time from whichever segment covers the current\n * `elapsed`, and the sound is scheduled one clip per segment.\n *\n * It exists because a **pause** cannot be expressed any other way. `playing:\n * false` holds the clip's *first* frame, because with playback derived\n * linearly from the clock there is nothing else it could hold; and the sound\n * runs on the node's own clock regardless, so a picture frozen by any means\n * would drift away from it. A schedule states the one thing both halves need\n * and neither could infer — that a paused stretch consumes no source — so\n * they cannot come apart.\n *\n * Still a pure function of the clock, which is the property everything else\n * here is built on: frame *N* is identical however the playhead reached it,\n * so a scrub, a playthrough and an export agree.\n */\n segments?: readonly VideoSegment[];\n\n}\n\n/**\n * One stretch of a {@link Video}'s own clock during which its source advances —\n * see {@link VideoProps.segments}.\n *\n * Trim and loop are applied *on top* of this, by the same code that applies them\n * to unscheduled playback, so a schedule says when the clip is running and the\n * clip's own props go on saying which part of the file it is running through.\n */\nexport interface VideoSegment {\n /** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */\n at: number;\n /** Source in-point for it, in seconds. */\n from: number;\n /**\n * How long it runs, in seconds of the node's clock.\n *\n * `Infinity` for a clip left running — the same open sentinel\n * `AudioRequest.endAt` uses — which resolves against the clip's length.\n */\n duration: number;\n /** Playback rate through it. Defaults to the node's own `speed`. */\n speed?: number;\n /** Linear gain for its sound. Defaults to the node's own `volume`. */\n volume?: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../../src/components/builtins/providers/providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAA8B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGnD,gGAAgG;AAChG,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;IAChC,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAA+B,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAU,SAAS,CAAC,EAAE;IAClH,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;CAC7I,CAAC,CAAC;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACrC,GAAG,EAAE,gBAAgB;IACrB,KAAK,EAAE;QACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAsC,SAAS,CAAC;QACnE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAsC,SAAS,CAAC;QAClE,IAAI,EAAE,KAAK,CAAC,MAAM,CAA8B,SAAS,CAAC;KAC7D;IACD,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;QAC1B,MAAM,GAAG,GAAe,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,KAAK;YAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9F,IAAI,KAAK,CAAC,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1F,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,OAAO,GAAG,CAAC;IACf,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import { DataToken, SeedToken, ThemeToken } from \"@/runtime/builtin-context\";\r\nimport type { Context } from \"@/util/context\";\r\nimport { provides, type NodeOf, type Provided } from \"@/components/factory/api\";\r\nimport { component2d } from \"@/components/factory/component2d\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\r\n\r\n/** Hands its subtree `value` under `context`, or the context's default when it has no value. */\r\nexport const Provider = component2d({\r\n key: \"provider\",\r\n state: { context: Types.custom<Context<unknown> | undefined>(undefined), value: Types.custom<unknown>(undefined) },\r\n provide: (state) => (state.context ? [provides(state.context, state.value !== undefined ? state.value : state.context.defaultValue)] : []),\r\n});\r\n\r\n/** Lays its theme and data over what it inherits, and seeds the randomness below it. */\r\nexport const ThemeProvider = component2d({\r\n key: \"theme-provider\",\r\n state: {\r\n theme: Types.custom<Record<string, unknown> | undefined>(undefined),\r\n data: Types.custom<Record<string, unknown> | undefined>(undefined),\r\n seed: Types.custom<string | number | undefined>(undefined),\r\n },\r\n provide: (state, inherited) => {\r\n const out: Provided[] = [];\r\n if (state.theme) out.push(provides(ThemeToken, { ...inherited(ThemeToken), ...state.theme }));\r\n if (state.data) out.push(provides(DataToken, { ...inherited(DataToken), ...state.data }));\r\n if (state.seed !== undefined) out.push(provides(SeedToken, state.seed));\r\n return out;\r\n },\r\n});\r\n\r\nexport type Provider = NodeOf<typeof Provider>;\r\nexport type ThemeProvider = NodeOf<typeof ThemeProvider>;\r\n\r\n// What code building a provider names its props as.\r\n\r\nexport interface ProviderProps<T> extends Node2DProps {\r\n /** The context token this provider supplies to its descendants. */\r\n context: Context<T>;\r\n /** The value to provide. Omitted → the token's default value. */\r\n value: T;\r\n}\r\n\r\nexport interface ThemeProviderProps extends Node2DProps {\r\n /** Named values (e.g. colors) merged onto any ancestor theme, read via\r\n * `node.useContext(ThemeToken)`. */\r\n theme: Record<string, unknown>;\r\n /** Arbitrary data merged onto any ancestor data bag, read via\r\n * `node.useContext(DataToken)`. */\r\n data: Record<string, unknown>;\r\n /** A default seed passed down the tree, read via `node.useContext(SeedToken)`. */\r\n seed: string | number;\r\n}\r\n"]}
1
+ {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../../src/components/builtins/providers/providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAA8B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,M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E,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1F,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,OAAO,GAAG,CAAC;IACf,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import { DataToken, SeedToken, ThemeToken } from \"@/runtime/builtin-context\";\nimport type { Context } from \"@/util/context\";\nimport { provides, type NodeOf, type Provided } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { Types } from \"@/components/factory/types\";\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\n\n/** Hands its subtree `value` under `context`, or the context's default when it has no value. */\nexport const Provider = component2d({\n key: \"provider\",\n state: { context: Types.custom<Context<unknown> | undefined>(undefined), value: Types.custom<unknown>(undefined) },\n provide: (state) => (state.context ? [provides(state.context, state.value !== undefined ? state.value : state.context.defaultValue)] : []),\n});\n\n/** Lays its theme and data over what it inherits, and seeds the randomness below it. */\nexport const ThemeProvider = component2d({\n key: \"theme-provider\",\n state: {\n theme: Types.custom<Record<string, unknown> | undefined>(undefined),\n data: Types.custom<Record<string, unknown> | undefined>(undefined),\n seed: Types.custom<string | number | undefined>(undefined),\n },\n provide: (state, inherited) => {\n const out: Provided[] = [];\n if (state.theme) out.push(provides(ThemeToken, { ...inherited(ThemeToken), ...state.theme }));\n if (state.data) out.push(provides(DataToken, { ...inherited(DataToken), ...state.data }));\n if (state.seed !== undefined) out.push(provides(SeedToken, state.seed));\n return out;\n },\n});\n\nexport type Provider = NodeOf<typeof Provider>;\nexport type ThemeProvider = NodeOf<typeof ThemeProvider>;\n\n// What code building a provider names its props as.\n\nexport interface ProviderProps<T> extends Node2DProps {\n /** The context token this provider supplies to its descendants. */\n context: Context<T>;\n /** The value to provide. Omitted → the token's default value. */\n value: T;\n}\n\nexport interface ThemeProviderProps extends Node2DProps {\n /** Named values (e.g. colors) merged onto any ancestor theme, read via\n * `node.useContext(ThemeToken)`. */\n theme: Record<string, unknown>;\n /** Arbitrary data merged onto any ancestor data bag, read via\n * `node.useContext(DataToken)`. */\n data: Record<string, unknown>;\n /** A default seed passed down the tree, read via `node.useContext(SeedToken)`. */\n seed: string | number;\n}\n"]}