@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":"factory.js","sourceRoot":"","sources":["../../../src/components/factory/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAqB,MAAM,mCAAmC,CAAC;AAIjG,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAkC,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAmB,MAAM,2BAA2B,CAAC;AAIrE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAgB,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,E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AAC;IAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,IAAI,GAAG,KAAK,IAAI,EAAE;YACd,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5B,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAE,MAAmB,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3E,CAAC,CAAC;QACF,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,MAAkB;IAChC,OAAO;QACH,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;QACrD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;QACjC,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;QAC7C,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5H,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;KACtC,CAAC;AACN,CAAC","sourcesContent":["import type { Disposer } from \"@/assets/record\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport { getPropertyMeta, property, type PropertyMeta } from \"@/attributes/properties/decorator\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport type { ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\nimport { node } from \"@/document/node-decorator\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport { settling, type Command, type CommandArgs } from \"@/tween/command\";\r\nimport { command, type CommandArg } from \"@/tween/command-decorator\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\nimport type { ContextMap } from \"@/util/context\";\r\nimport type { ChildView, Loader, Provided, StateSpec } from \"@/components/factory/api\";\r\nimport { commandOf, makeTimeline } from \"@/components/factory/timeline\";\r\nimport { defOf, isTypeLike, type TypeDef } from \"@/components/factory/type-def\";\r\nimport { nodeOfView, nodeView, snapshot, stateView, stateViewPrototype, type ViewShape } from \"@/components/factory/views\";\r\n\r\n/**\r\n * What every factory does, whatever tree it builds for: declare the state on a\r\n * generated subclass of the tree's base, publish the commands, run the\r\n * `children` builder, provide and inherit context, and declare assets. Each\r\n * factory adds only its own tree's hooks on top.\r\n */\r\n\r\n/** The fields every factory takes. */\r\nexport interface CoreSpec {\r\n readonly key: string;\r\n readonly state?: StateSpec;\r\n readonly defaults?: Record<string, unknown>;\r\n readonly commands?: Record<string, unknown>;\r\n readonly children?: (state: never) => unknown;\r\n readonly provide?: (state: never, inherited: <T>(context: { readonly id: symbol; readonly defaultValue: T }) => T) => readonly Provided[];\r\n readonly load?: (loader: Loader, state: never) => void;\r\n /** `[]` takes none; `null` (the default) anything of its tree; components, or `\"2d\"`/`\"3d\"`/`\"audio\"`, only those. */\r\n readonly allowedChildren?: readonly unknown[] | null;\r\n /** The components it goes only inside; unsaid, wherever its tree allows. */\r\n readonly allowedParents?: readonly unknown[];\r\n}\r\n\r\n/** A spec, resolved against the base it lowers onto. */\r\nexport interface Lowering {\r\n readonly spec: CoreSpec;\r\n readonly entries: Map<string, TypeDef>;\r\n readonly defaults: Record<string, unknown>;\r\n readonly builtIn: ReadonlyMap<string, PropertyMeta>;\r\n readonly view: ViewShape;\r\n /** Built-in entries whose default a factory applies itself (a 2D size), not by redeclaring the property. */\r\n readonly ownsDefault: ReadonlySet<string>;\r\n}\r\n\r\ntype NodeBase = abstract new (...args: any[]) => Node;\r\n\r\nexport function lowering(spec: CoreSpec, Base: NodeBase, ownsDefault: ReadonlySet<string> = new Set()): Lowering {\r\n const builtIn = new Map(getPropertyMeta(Object.create(Base.prototype as object)).map((m) => [m.key, m]));\r\n const entries = new Map<string, TypeDef>(Object.entries(spec.state ?? {}).map(([k, e]) => [k, defOf(e)]));\r\n const defaults = (spec.defaults ?? {}) as Record<string, unknown>;\r\n // A default for an own entry is that entry's default; for a built-in one, a redeclaration.\r\n for (const [key, value] of Object.entries(defaults)) {\r\n if (typeof value === \"function\") continue;\r\n const own = entries.get(key);\r\n if (own) entries.set(key, { ...own, default: value });\r\n else if (!builtIn.has(key)) throw new TypeError(`${spec.key}: \"defaults.${key}\" names no entry.`);\r\n }\r\n // A reference entry holds an id; its fields read a view of the node it names.\r\n const references = new Set([...entries].filter(([, def]) => def.editor.kind === \"nodeRef\").map(([key]) => key));\r\n return { spec, entries, defaults, builtIn, view: stateViewPrototype([...builtIn.keys(), ...entries.keys()], references), ownsDefault };\r\n}\r\n\r\nexport function factoryDefault(def: TypeDef): unknown {\r\n return typeof def.default === \"function\" ? (def.default as () => unknown)() : def.default;\r\n}\r\n\r\n/** The members every generated node has, whatever its tree. */\r\nexport interface ComponentNode extends Node {\r\n _view: object;\r\n /** How many nodes the `children` builder made. */\r\n _built: number;\r\n _commandChildren(): readonly ChildView[];\r\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\r\n}\r\n\r\n/** The base every tree's generated class extends: `Base` with the spec's state, context, assets and children. */\r\nexport function componentBase<T extends NodeBase>(Base: T, l: Lowering): T & (abstract new (...args: any[]) => ComponentNode) {\r\n const { spec: s, entries, defaults } = l;\r\n\r\n abstract class Componentized extends (Base as unknown as abstract new (...args: any[]) => Node) implements Partial<ComponentNode> {\r\n declare _view: object;\r\n declare _built: number;\r\n declare _provided: { parent: ContextMap; values: readonly Provided[]; map: ContextMap } | undefined;\r\n\r\n constructor(...args: any[]) {\r\n const props = args[0] as Record<string, unknown> | undefined;\r\n const given = s.children ? props?.children : undefined;\r\n super(s.children && props ? { ...props, children: undefined } : props);\r\n this._view = stateView(l.view, this);\r\n this._built = 0;\r\n\r\n for (const [key, def] of entries) {\r\n if (def.private) this.applyProp(key, factoryDefault(def), { mapper: def.mapper, tween: def.tween });\r\n else if (typeof def.default === \"function\" && props?.[key] === undefined) this._writeProp(key, factoryDefault(def));\r\n }\r\n let built: Readonly<Record<string, unknown>> | undefined;\r\n for (const [key, value] of Object.entries(defaults)) {\r\n if (typeof value === \"function\" && props?.[key] === undefined) {\r\n const asBuilt = (built ??= Object.freeze({ ...props }));\r\n this._writeProp(key, () => (value as (state: object, given: object) => unknown)(this._view, asBuilt));\r\n }\r\n }\r\n\r\n if (s.children) {\r\n // Live, like the field state, so a binding the builder writes reads the node as it changes.\r\n const builderState = stateView(l.view, this);\r\n Object.defineProperty(builderState, \"children\", { value: [given ?? []].flat(Infinity).filter(Boolean) });\r\n const built = [s.children(builderState as never)].flat(Infinity).filter(Boolean) as Node[];\r\n for (const part of built) this.add(part);\r\n this._built = built.length;\r\n }\r\n }\r\n\r\n /** Each entry the author left unset that inherits takes what its ancestors provide, once, on first attach. */\r\n protected override resolveContext(ctx: ContextMap): void {\r\n super.resolveContext(ctx);\r\n const given = (this._props ?? {}) as Record<string, unknown>;\r\n const self = this as unknown as Record<string, unknown>;\r\n for (const [key, def] of entries) {\r\n if (!def.inherit || given[key] !== undefined) continue;\r\n const value = def.inherit((context) => ctx.get(context), given);\r\n if (value !== undefined) self[key] = value;\r\n }\r\n }\r\n\r\n protected override provideContext(parent: ContextMap): ContextMap {\r\n if (!s.provide) return super.provideContext(parent);\r\n const provided = s.provide(this._view as never, (context) => parent.get(context as never));\r\n // The same map while nothing changed, so the subtree isn't re-bound every attach.\r\n const memo = this._provided;\r\n if (memo && memo.parent === parent && memo.values.length === provided.length\r\n && memo.values.every((p, i) => p.context === provided[i].context && p.value === provided[i].value)) return memo.map;\r\n let map = parent;\r\n for (const { context, value } of provided) if (map.get(context) !== value) map = map.with(context, value);\r\n this._provided = { parent, values: provided, map };\r\n return map;\r\n }\r\n\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n const self = this as unknown as Record<string, unknown>;\r\n for (const [key, def] of entries) declareEntry(assets, def.editor.kind ?? \"\", self[key]);\r\n if (s.load) s.load(loaderOf(assets), this._view as never);\r\n }\r\n\r\n protected override acceptsChild(child: Node): boolean {\r\n const allowed = s.allowedChildren;\r\n if (allowed === undefined || allowed === null) return super.acceptsChild(child);\r\n return allowed.some((rule) => matches(child, rule));\r\n }\r\n\r\n protected override _childRule(): string {\r\n const allowed = s.allowedChildren;\r\n if (!allowed) return super._childRule();\r\n return allowed.length === 0 ? \"It takes no children.\" : `It takes only ${namesOf(allowed)}.`;\r\n }\r\n\r\n override _parentRefusal(parent: Node): string | null {\r\n const allowed = s.allowedParents;\r\n if (!allowed || allowed.some((rule) => matches(parent, rule))) return null;\r\n return `${this.className} goes only inside ${namesOf(allowed)}, not ${parent.className}.`;\r\n }\r\n\r\n /** The children a command's builders see: none, unless the tree says which. */\r\n _commandChildren(): readonly ChildView[] {\r\n return [];\r\n }\r\n\r\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown) {\r\n return this.command(frame, duration, easing as EasingFunction | undefined);\r\n }\r\n }\r\n return Componentized as unknown as T & (abstract new (...args: any[]) => ComponentNode);\r\n}\r\n\r\ntype CommandFn = (timeline: unknown, state: unknown, children: unknown) => never;\r\n\r\n/**\r\n * Declare the state and commands on the generated class, register its key, and\r\n * hand back the component value.\r\n */\r\nexport function finishComponent(Generated: abstract new (...args: any[]) => Node, l: Lowering): object {\r\n const { spec: s, entries, defaults, builtIn } = l;\r\n Object.defineProperty(Generated, \"name\", { value: pascal(s.key) });\r\n const proto = Generated.prototype as unknown as Record<string, unknown>;\r\n // A node is a context provider by overriding these: only one that provides, or inherits, keeps them.\r\n if (!s.provide) deleteUpTo(proto, \"provideContext\");\r\n if (![...entries.values()].some((def) => def.inherit)) deleteUpTo(proto, \"resolveContext\");\r\n if (s.allowedChildren === undefined || s.allowedChildren === null) {\r\n deleteUpTo(proto, \"acceptsChild\");\r\n deleteUpTo(proto, \"_childRule\");\r\n }\r\n if (!s.allowedParents) deleteUpTo(proto, \"_parentRefusal\");\r\n const allowed = s.allowedChildren;\r\n if (allowed) {\r\n const trees = [...new Set(allowed.map((rule) => (typeof rule === \"string\"\r\n ? rule\r\n : (Object.create((rule as { node: { prototype: object } }).node.prototype) as Node).dimension)))];\r\n Object.defineProperty(proto, \"_childTrees\", { get: () => trees, configurable: true });\r\n }\r\n\r\n for (const [key, def] of entries) {\r\n if (def.private) continue;\r\n property({ default: typeof def.default === \"function\" ? undefined : def.default, mapper: def.mapper, tween: def.tween, ...def.editor })(proto, key);\r\n }\r\n for (const [key, value] of Object.entries(defaults)) {\r\n if (entries.has(key) || l.ownsDefault.has(key) || typeof value === \"function\") continue;\r\n const inherited = builtIn.get(key)!;\r\n property({ default: value, mapper: inherited.options?.mapper, tween: inherited.options?.tween, ...inherited.editor })(proto, key);\r\n }\r\n\r\n const base = Object.getPrototypeOf(Object.getPrototypeOf(proto)) as object;\r\n for (const [key, entry] of Object.entries(s.commands ?? {})) {\r\n // Commands have their own namespace: a key a node already uses (`remove`, `to`) publishes through another method name.\r\n const method = key in base ? `_command_${key}` : key;\r\n let args: CommandArg[] | undefined;\r\n if (typeof entry === \"function\") {\r\n proto[method] = function (this: ComponentNode, cmd: CommandArgs & { duration?: number } = {}): Command<Record<string, unknown>> {\r\n const duration = cmd.duration ?? 0;\r\n const timeline = makeTimeline({}, duration, cmd.easing, nodeView(this, this));\r\n const piece = (entry as CommandFn)(timeline, snapshot(this._view), this._commandChildren());\r\n return commandOf(this as never, piece, duration, cmd.easing);\r\n };\r\n } else {\r\n const { args: declared, run, easing: ownEasing } = entry as { args: readonly string[] | StateSpec; run?: CommandFn; easing?: EasingFunction };\r\n if (Array.isArray(declared)) {\r\n const names = declared as readonly string[];\r\n for (const name of names) {\r\n if (!entries.has(name) && !builtIn.has(name)) throw new TypeError(`${s.key}.${key}: args names \"${name}\", which is no entry.`);\r\n }\r\n // Each arg is its entry: what a host shows for it is what the entry means.\r\n args = names.map((name) => ({ key: name, ...(entries.get(name)?.editor ?? builtIn.get(name)?.editor ?? {}) }));\r\n proto[method] = function (this: Node, cmd: CommandArgs & { duration?: number } = {}) {\r\n const data = argsRecord(cmd.data, names);\r\n const stated: Record<string, unknown> = {};\r\n for (const name of names) if (data[name] !== undefined) stated[name] = data[name];\r\n return settling(this.to({ data: stated as never, duration: cmd.duration ?? 0, easing: cmd.easing ?? ownEasing }));\r\n };\r\n } else {\r\n const own = declared as StateSpec;\r\n args = Object.entries(own).map(([k, e]) => {\r\n const def = defOf(e);\r\n return { key: k, default: isTypeLike(e) ? factoryDefault(def) : e, ...def.editor };\r\n });\r\n proto[method] = function (this: ComponentNode, cmd: CommandArgs & { duration?: number } = {}) {\r\n const duration = cmd.duration ?? 0;\r\n const easing = cmd.easing ?? ownEasing;\r\n const timeline = makeTimeline(resolveArgs(own, cmd.data), duration, easing, nodeView(this, this));\r\n const piece = run!(timeline, snapshot(this._view), this._commandChildren());\r\n return commandOf(this as never, piece, duration, easing);\r\n };\r\n }\r\n }\r\n command({ key, ...(args ? { args } : {}) })(proto, method);\r\n }\r\n\r\n node({ key: s.key })(Generated as never);\r\n return componentValue(s.key, Generated as unknown as new (props?: Record<string, unknown>) => object);\r\n}\r\n\r\n/** Remove the generated override of `name`, wherever between the class and its base it sits. */\r\nfunction deleteUpTo(proto: Record<string, unknown>, name: string): void {\r\n for (let at: Record<string, unknown> | null = proto; at; at = Object.getPrototypeOf(at) as Record<string, unknown> | null) {\r\n if (Object.prototype.hasOwnProperty.call(at, name)) {\r\n delete at[name];\r\n return;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * What a factory hands back: call it (`Rect({...})`) or `new` it, either way a\r\n * node of the generated class, which is also what `instanceof` tests.\r\n */\r\nexport function componentValue(key: string, Generated: new (props?: Record<string, unknown>) => object): object {\r\n const make = function (props?: object) {\r\n return new Generated(props as Record<string, unknown>);\r\n };\r\n make.prototype = Generated.prototype;\r\n Object.defineProperty(make, \"name\", { value: Generated.name });\r\n return Object.assign(make, {\r\n key,\r\n node: Generated,\r\n is: (child: unknown) => nodeOfView(child as never) instanceof Generated,\r\n });\r\n}\r\n\r\nfunction pascal(key: string): string {\r\n return key.replace(/(^|[-_ ])(\\w)/g, (_, _sep, c: string) => c.toUpperCase());\r\n}\r\n\r\n/** Whether `node` is of `rule`: a component, or a whole tree by name. */\r\nfunction matches(node: Node, rule: unknown): boolean {\r\n return typeof rule === \"string\"\r\n ? node.dimension === rule\r\n : node instanceof (rule as { node: abstract new (...args: never[]) => unknown }).node;\r\n}\r\n\r\nfunction namesOf(rules: readonly unknown[]): string {\r\n const names = rules.map((rule) => (typeof rule === \"string\" ? `any ${rule.toUpperCase()} node` : (rule as { node: { name: string } }).node.name));\r\n return names.length === 1 ? names[0] : `${names.slice(0, -1).join(\", \")} or ${names.at(-1)}`;\r\n}\r\n\r\n/** One document arg: the bare value from a paint command, or the args record from the registry. */\r\nfunction argsRecord(data: unknown, names: readonly string[]): Record<string, unknown> {\r\n if (names.length === 1) {\r\n const plain = typeof data === \"object\" && data !== null && !Array.isArray(data) && Object.getPrototypeOf(data) === Object.prototype;\r\n if (!(plain && names[0] in (data as object))) return { [names[0]]: data };\r\n }\r\n return (data ?? {}) as Record<string, unknown>;\r\n}\r\n\r\nfunction resolveArgs(spec: StateSpec, data: unknown): Record<string, unknown> {\r\n const given = (data ?? {}) as Record<string, unknown>;\r\n const out: Record<string, unknown> = {};\r\n for (const key in spec) {\r\n const def = defOf(spec[key]);\r\n const value = given[key] === undefined ? factoryDefault(def) : given[key];\r\n out[key] = def.mapper ? def.mapper(value) : value;\r\n }\r\n return out;\r\n}\r\n\r\nfunction declareEntry(assets: AssetScope, kind: string, value: unknown): void {\r\n if (value === undefined || value === null || value === \"\") return;\r\n switch (kind) {\r\n case \"fills\": return assets.fill(value as FillResolved[]);\r\n case \"strokes\": for (const stroke of value as StrokeResolved[]) assets.fill(stroke.fill); return;\r\n case \"shadows\": for (const shadow of value as ShadowResolved[]) assets.fill(shadow.fill); return;\r\n case \"image\": return assets.image(value as string);\r\n case \"video\": return assets.video(value as string);\r\n case \"font\": return assets.font(value as string);\r\n }\r\n}\r\n\r\n/** One wrapper per load function: the scope warns when a key's second declaration hands it a different one. */\r\nconst tasks = new WeakMap<() => Promise<unknown>, () => Promise<void | Disposer>>();\r\n\r\nfunction taskOf(load: () => Promise<unknown>): () => Promise<void | Disposer> {\r\n let task = tasks.get(load);\r\n if (!task) {\r\n task = async () => {\r\n const loaded = await load();\r\n return typeof loaded === \"function\" ? (loaded as Disposer) : undefined;\r\n };\r\n tasks.set(load, task);\r\n }\r\n return task;\r\n}\r\n\r\nfunction loaderOf(assets: AssetScope): Loader {\r\n return {\r\n font: (family, weight) => assets.font(family, weight),\r\n image: (src) => assets.image(src),\r\n video: (src, trim) => assets.video(src, trim),\r\n task: (key, load, options) => assets.loader(key, taskOf(load), { gate: options?.before === \"layout\" ? \"layout\" : \"render\" }),\r\n fill: (fills) => assets.fill(fills),\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/components/factory/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAqB,MAAM,mCAAmC,CAAC;AAIjG,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAkC,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAmB,MAAM,2BAA2B,CAAC;AAIrE,OAAO,EAAE,SAAS,EAA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AAC,CAAC,SAAS,CAAC;QAC3E,CAAC,CAAC;QACF,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,MAAkB;IAChC,OAAO;QACH,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;QACrD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;QACjC,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;QAC7C,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5H,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;KACtC,CAAC;AACN,CAAC","sourcesContent":["import type { Disposer } from \"@/assets/record\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport { getPropertyMeta, property, type PropertyMeta } from \"@/attributes/properties/decorator\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { node } from \"@/document/node-decorator\";\nimport { declarePropEvolution } from \"@/document/prop-evolution\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport { settling, type Command, type CommandArgs } from \"@/tween/command\";\nimport { command, type CommandArg } from \"@/tween/command-decorator\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\nimport type { ContextMap } from \"@/util/context\";\nimport type { ChildView, Loader, Provided, StateSpec } from \"@/components/factory/api\";\nimport { commandOf, makeTimeline } from \"@/components/factory/timeline\";\nimport { defOf, isTypeLike, type TypeDef } from \"@/components/factory/type-def\";\nimport { nodeOfView, nodeView, snapshot, stateView, stateViewPrototype, type ViewShape } from \"@/components/factory/views\";\n\n/**\n * What every factory does, whatever tree it builds for: declare the state on a\n * generated subclass of the tree's base, publish the commands, run the\n * `children` builder, provide and inherit context, and declare assets. Each\n * factory adds only its own tree's hooks on top.\n */\n\n/** The fields every factory takes. */\nexport interface CoreSpec {\n readonly key: string;\n readonly state?: StateSpec;\n readonly defaults?: Record<string, unknown>;\n readonly renamed?: Readonly<Record<string, string>>;\n readonly deprecated?: Readonly<Record<string, string>>;\n readonly migrate?: Readonly<Record<string, (value: unknown) => unknown>>;\n readonly commands?: Record<string, unknown>;\n readonly children?: (state: never) => unknown;\n readonly provide?: (state: never, inherited: <T>(context: { readonly id: symbol; readonly defaultValue: T }) => T) => readonly Provided[];\n readonly load?: (loader: Loader, state: never) => void;\n /** `[]` takes none; `null` (the default) anything of its tree; components, or `\"2d\"`/`\"3d\"`/`\"audio\"`, only those. */\n readonly allowedChildren?: readonly unknown[] | null;\n /** The components it goes only inside; unsaid, wherever its tree allows. */\n readonly allowedParents?: readonly unknown[];\n}\n\n/** A spec, resolved against the base it lowers onto. */\nexport interface Lowering {\n readonly spec: CoreSpec;\n readonly entries: Map<string, TypeDef>;\n readonly defaults: Record<string, unknown>;\n readonly builtIn: ReadonlyMap<string, PropertyMeta>;\n readonly view: ViewShape;\n /** Built-in entries whose default a factory applies itself (a 2D size), not by redeclaring the property. */\n readonly ownsDefault: ReadonlySet<string>;\n}\n\ntype NodeBase = abstract new (...args: any[]) => Node;\n\nexport function lowering(spec: CoreSpec, Base: NodeBase, ownsDefault: ReadonlySet<string> = new Set()): Lowering {\n const builtIn = new Map(getPropertyMeta(Object.create(Base.prototype as object)).map((m) => [m.key, m]));\n const entries = new Map<string, TypeDef>(Object.entries(spec.state ?? {}).map(([k, e]) => [k, defOf(e)]));\n const defaults = (spec.defaults ?? {}) as Record<string, unknown>;\n // A default for an own entry is that entry's default; for a built-in one, a redeclaration.\n for (const [key, value] of Object.entries(defaults)) {\n if (typeof value === \"function\") continue;\n const own = entries.get(key);\n if (own) entries.set(key, { ...own, default: value });\n else if (!builtIn.has(key)) throw new TypeError(`${spec.key}: \"defaults.${key}\" names no entry.`);\n }\n checkEvolution(spec, (key) => entries.has(key) || builtIn.has(key));\n // A reference entry holds an id; its fields read a view of the node it names.\n const references = new Set([...entries].filter(([, def]) => def.editor.kind === \"nodeRef\").map(([key]) => key));\n return { spec, entries, defaults, builtIn, view: stateViewPrototype([...builtIn.keys(), ...entries.keys()], references), ownsDefault };\n}\n\nexport function factoryDefault(def: TypeDef): unknown {\n return typeof def.default === \"function\" ? (def.default as () => unknown)() : def.default;\n}\n\n/** The members every generated node has, whatever its tree. */\nexport interface ComponentNode extends Node {\n _view: object;\n /** How many nodes the `children` builder made. */\n _built: number;\n _commandChildren(): readonly ChildView[];\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\n}\n\n/** The base every tree's generated class extends: `Base` with the spec's state, context, assets and children. */\nexport function componentBase<T extends NodeBase>(Base: T, l: Lowering): T & (abstract new (...args: any[]) => ComponentNode) {\n const { spec: s, entries, defaults } = l;\n\n abstract class Componentized extends (Base as unknown as abstract new (...args: any[]) => Node) implements Partial<ComponentNode> {\n declare _view: object;\n declare _built: number;\n declare _assembling: boolean;\n declare _provided: { parent: ContextMap; values: readonly Provided[]; map: ContextMap } | undefined;\n\n constructor(...args: any[]) {\n const props = args[0] as Record<string, unknown> | undefined;\n const given = s.children ? props?.children : undefined;\n super(s.children && props ? { ...props, children: undefined } : props);\n this._view = stateView(l.view, this);\n this._built = 0;\n\n for (const [key, def] of entries) {\n if (def.private) this.applyProp(key, factoryDefault(def), { mapper: def.mapper, tween: def.tween });\n else if (typeof def.default === \"function\" && props?.[key] === undefined) this._writeProp(key, factoryDefault(def));\n }\n let built: Readonly<Record<string, unknown>> | undefined;\n for (const [key, value] of Object.entries(defaults)) {\n if (typeof value === \"function\" && props?.[key] === undefined) {\n const asBuilt = (built ??= Object.freeze({ ...props }));\n this._writeProp(key, () => (value as (state: object, given: object) => unknown)(this._view, asBuilt));\n }\n }\n\n if (s.children) {\n // Live, like the field state, so a binding the builder writes reads the node as it changes.\n const builderState = stateView(l.view, this);\n const authored = [given ?? []].flat(Infinity).filter(Boolean);\n if (s.allowedChildren != null) for (const child of authored) this.assertAcceptsChild(child as Node);\n Object.defineProperty(builderState, \"children\", { value: authored });\n const built = [s.children(builderState as never)].flat(Infinity).filter(Boolean) as Node[];\n this._assembling = true;\n try {\n for (const part of built) this.add(part);\n } finally {\n this._assembling = false;\n }\n this._built = built.length;\n }\n }\n\n /** Each entry the author left unset that inherits takes what its ancestors provide, once, on first attach. */\n protected override resolveContext(ctx: ContextMap): void {\n super.resolveContext(ctx);\n const given = (this._props ?? {}) as Record<string, unknown>;\n const self = this as unknown as Record<string, unknown>;\n for (const [key, def] of entries) {\n if (!def.inherit || given[key] !== undefined) continue;\n const value = def.inherit((context) => ctx.get(context), given);\n if (value !== undefined) self[key] = value;\n }\n }\n\n protected override provideContext(parent: ContextMap): ContextMap {\n if (!s.provide) return super.provideContext(parent);\n const provided = s.provide(this._view as never, (context) => parent.get(context as never));\n // The same map while nothing changed, so the subtree isn't re-bound every attach.\n const memo = this._provided;\n if (memo && memo.parent === parent && memo.values.length === provided.length\n && memo.values.every((p, i) => p.context === provided[i].context && p.value === provided[i].value)) return memo.map;\n let map = parent;\n for (const { context, value } of provided) if (map.get(context) !== value) map = map.with(context, value);\n this._provided = { parent, values: provided, map };\n return map;\n }\n\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets);\n const self = this as unknown as Record<string, unknown>;\n for (const [key, def] of entries) declareEntry(assets, def.editor.kind ?? \"\", self[key]);\n if (s.load) s.load(loaderOf(assets), this._view as never);\n }\n\n protected override acceptsChild(child: Node): boolean {\n const allowed = s.allowedChildren;\n if (allowed === undefined || allowed === null || (this._assembling && allowed.length === 0)) return super.acceptsChild(child);\n return allowed.some((rule) => matches(child, rule));\n }\n\n protected override _childRule(): string {\n const allowed = s.allowedChildren;\n if (!allowed) return super._childRule();\n return allowed.length === 0 ? \"It takes no children.\" : `It takes only ${namesOf(allowed)}.`;\n }\n\n override _parentRefusal(parent: Node): string | null {\n const allowed = s.allowedParents;\n if (!allowed || allowed.some((rule) => matches(parent, rule))) return null;\n return `${this.className} goes only inside ${namesOf(allowed)}, not ${parent.className}.`;\n }\n\n /** The children a command's builders see: none, unless the tree says which. */\n _commandChildren(): readonly ChildView[] {\n return [];\n }\n\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown) {\n return this.command(frame, duration, easing as EasingFunction | undefined);\n }\n }\n return Componentized as unknown as T & (abstract new (...args: any[]) => ComponentNode);\n}\n\ntype CommandFn = (timeline: unknown, state: unknown, children: unknown) => never;\n\n/**\n * Declare the state and commands on the generated class, register its key, and\n * hand back the component value.\n */\nexport function finishComponent(Generated: abstract new (...args: any[]) => Node, l: Lowering): object {\n const { spec: s, entries, defaults, builtIn } = l;\n Object.defineProperty(Generated, \"name\", { value: pascal(s.key) });\n const proto = Generated.prototype as unknown as Record<string, unknown>;\n // A node is a context provider by overriding these: only one that provides, or inherits, keeps them.\n if (!s.provide) deleteUpTo(proto, \"provideContext\");\n if (![...entries.values()].some((def) => def.inherit)) deleteUpTo(proto, \"resolveContext\");\n if (s.allowedChildren === undefined || s.allowedChildren === null) {\n deleteUpTo(proto, \"acceptsChild\");\n deleteUpTo(proto, \"_childRule\");\n }\n if (!s.allowedParents) deleteUpTo(proto, \"_parentRefusal\");\n const allowed = s.allowedChildren;\n if (allowed) {\n const trees = [...new Set(allowed.map((rule) => (typeof rule === \"string\"\n ? rule\n : (Object.create((rule as { node: { prototype: object } }).node.prototype) as Node).dimension)))];\n Object.defineProperty(proto, \"_childTrees\", { get: () => trees, configurable: true });\n }\n\n for (const [key, def] of entries) {\n if (def.private) continue;\n property({ default: typeof def.default === \"function\" ? undefined : def.default, mapper: def.mapper, tween: def.tween, ...def.editor })(proto, key);\n }\n for (const [key, value] of Object.entries(defaults)) {\n if (entries.has(key) || l.ownsDefault.has(key) || typeof value === \"function\") continue;\n const inherited = builtIn.get(key)!;\n property({ default: value, mapper: inherited.options?.mapper, tween: inherited.options?.tween, ...inherited.editor })(proto, key);\n }\n\n const base = Object.getPrototypeOf(Object.getPrototypeOf(proto)) as object;\n for (const [key, entry] of Object.entries(s.commands ?? {})) {\n // Commands have their own namespace: a key a node already uses (`remove`, `to`) publishes through another method name.\n const method = key in base ? `_command_${key}` : key;\n let args: CommandArg[] | undefined;\n const entrance = typeof entry === \"object\" && (entry as { entrance?: boolean }).entrance === true;\n if (typeof entry === \"function\") {\n proto[method] = function (this: ComponentNode, cmd: CommandArgs & { duration?: number } = {}): Command<Record<string, unknown>> {\n const duration = cmd.duration ?? 0;\n const timeline = makeTimeline({}, duration, cmd.easing, nodeView(this, this));\n const piece = (entry as CommandFn)(timeline, snapshot(this._view), this._commandChildren());\n return commandOf(this as never, piece, duration, cmd.easing);\n };\n } else {\n const { args: declared, run, easing: ownEasing } = entry as { args: readonly string[] | StateSpec; run?: CommandFn; easing?: EasingFunction };\n if (Array.isArray(declared)) {\n const names = declared as readonly string[];\n for (const name of names) {\n if (!entries.has(name) && !builtIn.has(name)) throw new TypeError(`${s.key}.${key}: args names \"${name}\", which is no entry.`);\n }\n // Each arg is its entry: what a host shows for it is what the entry means.\n args = names.map((name) => ({ key: name, ...(entries.get(name)?.editor ?? builtIn.get(name)?.editor ?? {}) }));\n proto[method] = function (this: Node, cmd: CommandArgs & { duration?: number } = {}) {\n const data = argsRecord(cmd.data, names);\n const stated: Record<string, unknown> = {};\n for (const name of names) if (data[name] !== undefined) stated[name] = data[name];\n return settling(this.to({ data: stated as never, duration: cmd.duration ?? 0, easing: cmd.easing ?? ownEasing }));\n };\n } else {\n const own = declared as StateSpec;\n args = Object.entries(own).map(([k, e]) => {\n const def = defOf(e);\n return { key: k, default: isTypeLike(e) ? factoryDefault(def) : e, ...def.editor };\n });\n proto[method] = function (this: ComponentNode, cmd: CommandArgs & { duration?: number } = {}) {\n const duration = cmd.duration ?? 0;\n const easing = cmd.easing ?? ownEasing;\n const timeline = makeTimeline(resolveArgs(own, cmd.data), duration, easing, nodeView(this, this));\n const piece = run!(timeline, snapshot(this._view), this._commandChildren());\n return commandOf(this as never, piece, duration, easing);\n };\n }\n }\n command({ key, ...(args ? { args } : {}), ...(entrance ? { entrance } : {}) })(proto, method);\n }\n\n if (s.renamed || s.deprecated || s.migrate) {\n declarePropEvolution(Generated, { renamed: s.renamed ?? {}, deprecated: s.deprecated ?? {}, migrate: s.migrate ?? {} });\n }\n node({ key: s.key })(Generated as never);\n return componentValue(s.key, Generated as unknown as new (props?: Record<string, unknown>) => object);\n}\n\n/** A rename lands on an entry from a key that is none; a deprecation and a hook name what is there to evolve. */\nfunction checkEvolution(spec: CoreSpec, isEntry: (key: string) => boolean): void {\n for (const [from, to] of Object.entries(spec.renamed ?? {})) {\n if (isEntry(from)) throw new TypeError(`${spec.key}: \"renamed.${from}\" is still an entry; a renamed key must be gone.`);\n if (!isEntry(to)) throw new TypeError(`${spec.key}: \"renamed.${from}\" names \"${to}\", which is no entry.`);\n }\n for (const key of Object.keys(spec.deprecated ?? {})) {\n if (!isEntry(key)) throw new TypeError(`${spec.key}: \"deprecated.${key}\" names no entry.`);\n }\n for (const key of Object.keys(spec.migrate ?? {})) {\n if (!isEntry(key) && !Object.hasOwn(spec.renamed ?? {}, key)) {\n throw new TypeError(`${spec.key}: \"migrate.${key}\" names neither an entry nor a renamed key.`);\n }\n }\n}\n\n/** Remove the generated override of `name`, wherever between the class and its base it sits. */\nfunction deleteUpTo(proto: Record<string, unknown>, name: string): void {\n for (let at: Record<string, unknown> | null = proto; at; at = Object.getPrototypeOf(at) as Record<string, unknown> | null) {\n if (Object.prototype.hasOwnProperty.call(at, name)) {\n delete at[name];\n return;\n }\n }\n}\n\n/**\n * What a factory hands back: call it (`Rect({...})`) or `new` it, either way a\n * node of the generated class, which is also what `instanceof` tests.\n */\nexport function componentValue(key: string, Generated: new (props?: Record<string, unknown>) => object): object {\n const make = function (props?: object) {\n return new Generated(props as Record<string, unknown>);\n };\n make.prototype = Generated.prototype;\n Object.defineProperty(make, \"name\", { value: Generated.name });\n return Object.assign(make, {\n key,\n node: Generated,\n is: (child: unknown) => nodeOfView(child as never) instanceof Generated,\n });\n}\n\nfunction pascal(key: string): string {\n return key.replace(/(^|[-_ ])(\\w)/g, (_, _sep, c: string) => c.toUpperCase());\n}\n\n/** Whether `node` is of `rule`: a component, or a whole tree by name. */\nfunction matches(node: Node, rule: unknown): boolean {\n return typeof rule === \"string\"\n ? node.dimension === rule\n : node instanceof (rule as { node: abstract new (...args: never[]) => unknown }).node;\n}\n\nfunction namesOf(rules: readonly unknown[]): string {\n const names = rules.map((rule) => (typeof rule === \"string\" ? `any ${rule.toUpperCase()} node` : (rule as { node: { name: string } }).node.name));\n return names.length === 1 ? names[0] : `${names.slice(0, -1).join(\", \")} or ${names.at(-1)}`;\n}\n\n/** One document arg: the bare value from a paint command, or the args record from the registry. */\nfunction argsRecord(data: unknown, names: readonly string[]): Record<string, unknown> {\n if (names.length === 1) {\n const plain = typeof data === \"object\" && data !== null && !Array.isArray(data) && Object.getPrototypeOf(data) === Object.prototype;\n if (!(plain && names[0] in (data as object))) return { [names[0]]: data };\n }\n return (data ?? {}) as Record<string, unknown>;\n}\n\nfunction resolveArgs(spec: StateSpec, data: unknown): Record<string, unknown> {\n const given = (data ?? {}) as Record<string, unknown>;\n const out: Record<string, unknown> = {};\n for (const key in spec) {\n const def = defOf(spec[key]);\n const value = given[key] === undefined ? factoryDefault(def) : given[key];\n out[key] = def.mapper ? def.mapper(value) : value;\n }\n return out;\n}\n\nfunction declareEntry(assets: AssetScope, kind: string, value: unknown): void {\n if (value === undefined || value === null || value === \"\") return;\n switch (kind) {\n case \"fills\": return assets.fill(value as FillResolved[]);\n case \"strokes\": for (const stroke of value as StrokeResolved[]) assets.fill(stroke.fill); return;\n case \"shadows\": for (const shadow of value as ShadowResolved[]) assets.fill(shadow.fill); return;\n case \"image\": return assets.image(value as string);\n case \"video\": return assets.video(value as string);\n case \"font\": return assets.font(value as string);\n }\n}\n\n/** One wrapper per load function: the scope warns when a key's second declaration hands it a different one. */\nconst tasks = new WeakMap<() => Promise<unknown>, () => Promise<void | Disposer>>();\n\nfunction taskOf(load: () => Promise<unknown>): () => Promise<void | Disposer> {\n let task = tasks.get(load);\n if (!task) {\n task = async () => {\n const loaded = await load();\n return typeof loaded === \"function\" ? (loaded as Disposer) : undefined;\n };\n tasks.set(load, task);\n }\n return task;\n}\n\nfunction loaderOf(assets: AssetScope): Loader {\n return {\n font: (family, weight) => assets.font(family, weight),\n image: (src) => assets.image(src),\n video: (src, trim) => assets.video(src, trim),\n task: (key, load, options) => assets.loader(key, taskOf(load), { gate: options?.before === \"layout\" ? \"layout\" : \"render\" }),\n fill: (fills) => assets.fill(fills),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/components/factory/timeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAkC,MAAM,iBAAiB,CAAC;AAKlG,MAAM,KAAK,GAAG,CAAC,IAAe,EAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAE7D,wGAAwG;AACxG,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,QAAgB,EAAE,MAAkC,EAAE,IAAc;IAC3G,OAAO;QACH,IAAI;QACJ,QAAQ;QACR,MAAM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AAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACvD,CAAC","sourcesContent":["import type { Node } from \"@/components/trees/node/node\";\r\nimport { getCommandMeta } from \"@/tween/command-decorator\";\r\nimport { driveCommand, settles, settling, type Command, type CommandArgs } from \"@/tween/command\";\r\nimport type { EasingFunction } from \"@/tween/ease/type\";\r\nimport type { NodeView, Piece, PieceData, SoundOptions, Timeline } from \"@/components/factory/api\";\r\nimport type { ComponentHost } from \"@/components/factory/views\";\r\n\r\nconst piece = (data: PieceData): Piece => ({ _piece: data });\r\n\r\n/** What a command is handed for one placement: its args and timing, and the builders for its pieces. */\r\nexport function makeTimeline(args: object, duration: number, easing: EasingFunction | undefined, node: NodeView): Timeline<any, any> {\r\n return {\r\n args,\r\n duration,\r\n easing,\r\n node,\r\n tween: (targets) => piece({ kind: \"tween\", targets: targets as Record<string, unknown> }),\r\n animate: (frame, options) => piece({ kind: \"animate\", frame: frame as (t: number) => Record<string, unknown>, eased: options?.eased !== false }),\r\n ease: (t) => (easing ? easing(t) : t),\r\n sound: (src, options) => piece({ kind: \"sound\", src, options: options ?? {} }),\r\n wait: (seconds) => piece({ kind: \"wait\", seconds }),\r\n together: (pieces) => piece({ kind: \"together\", pieces }),\r\n sequence: (pieces) => piece({ kind: \"sequence\", pieces }),\r\n stagger: (pieces, options) => piece({ kind: \"stagger\", pieces, overlap: options?.overlap ?? 0 }),\r\n };\r\n}\r\n\r\n/** A sound a command plays, in seconds from the command's start; `until` absent plays to its own end. */\r\nexport interface CommandSound {\r\n readonly at: number;\r\n readonly until: number | undefined;\r\n readonly src: string;\r\n readonly options: SoundOptions;\r\n}\r\n\r\n/** A built piece: how long it lasts, the frame it writes `elapsed` seconds in, whether that only tweens slots, and its sounds. */\r\ninterface Timed {\r\n readonly duration: number;\r\n readonly settles: boolean;\r\n readonly sounds: readonly CommandSound[];\r\n apply(elapsed: number): void;\r\n}\r\n\r\nconst SILENT: readonly CommandSound[] = [];\r\n\r\n/**\r\n * A leaf, built and run to its end at once, so the piece after it reads where\r\n * it finished — the rule the timeline already keeps between whole commands.\r\n */\r\nfunction leaf(command: Command<Record<string, unknown>>, duration: number, pure = true): Timed {\r\n command.at(1);\r\n return { duration, settles: pure, sounds: SILENT, apply: (elapsed) => command.at(duration > 0 ? elapsed / duration : 1) };\r\n}\r\n\r\nfunction placed(parts: readonly Timed[], offsets: readonly number[]): Timed {\r\n const duration = parts.reduce((max, part, i) => Math.max(max, offsets[i] + part.duration), 0);\r\n return {\r\n duration,\r\n settles: parts.every((part) => part.settles),\r\n sounds: parts.flatMap((part, i) => part.sounds.map((s) => ({\r\n ...s, at: s.at + offsets[i], until: s.until === undefined ? undefined : s.until + offsets[i],\r\n }))),\r\n apply(elapsed) {\r\n // A part that hasn't started writes nothing: what came before it stands.\r\n for (let i = 0; i < parts.length; i++) {\r\n if (elapsed < offsets[i]) continue;\r\n parts[i].apply(Math.min(elapsed - offsets[i], parts[i].duration));\r\n }\r\n },\r\n };\r\n}\r\n\r\n/** A piece built against the tree as the pieces before it left it, spread over `duration`. */\r\nfunction timedOf(host: ComponentHost, p: Piece, duration: number, easing: EasingFunction | undefined): Timed {\r\n const data = p._piece;\r\n switch (data.kind) {\r\n case \"tween\":\r\n return leaf(host.to({ data: data.targets, duration, easing }) as Command<Record<string, unknown>>, duration);\r\n case \"animate\":\r\n return leaf(host._animate(data.frame, duration, data.eased ? easing : undefined) as Command<Record<string, unknown>>, duration);\r\n case \"child\":\r\n return leaf((data.node as Node).to({ data: data.targets, duration, easing }) as Command<Record<string, unknown>>, duration);\r\n case \"run\": {\r\n // Any command of the child's, so it settles only if that one does.\r\n const run = runCommand(data.node as Node, data.name, data.args, duration, easing);\r\n return leaf(run, duration, settles(run));\r\n }\r\n case \"wait\":\r\n return { duration: data.seconds, settles: true, sounds: SILENT, apply: () => { } };\r\n case \"sound\":\r\n // Scheduled ahead of time, not written per frame: the clip's audio reads it off the built command.\r\n return { duration: 0, settles: true, sounds: data.src ? [{ at: 0, until: undefined, src: data.src, options: data.options }] : SILENT, apply: () => { } };\r\n case \"together\": {\r\n const parts = data.pieces.map((part) => timedOf(host, part, duration, easing));\r\n return placed(parts, parts.map(() => 0));\r\n }\r\n case \"sequence\": {\r\n // Untimed pieces share what fixed `wait`s leave of the span.\r\n const fixed = data.pieces.reduce((sum, part) => sum + (part._piece.kind === \"wait\" ? part._piece.seconds : 0), 0);\r\n const flexible = data.pieces.filter((part) => part._piece.kind !== \"wait\").length;\r\n const each = flexible > 0 ? Math.max(0, duration - fixed) / flexible : 0;\r\n const parts: Timed[] = [];\r\n const offsets: number[] = [];\r\n let cursor = 0;\r\n for (const part of data.pieces) {\r\n const timed = timedOf(host, part, each, easing);\r\n parts.push(timed);\r\n offsets.push(cursor);\r\n cursor += timed.duration;\r\n }\r\n return placed(parts, offsets);\r\n }\r\n case \"stagger\": {\r\n const n = data.pieces.length;\r\n if (n === 0) return { duration, settles: true, sounds: SILENT, apply: () => { } };\r\n const step = 1 - Math.min(1, Math.max(0, data.overlap));\r\n // n pieces, each `each` long, started `each * step` apart, span the command exactly.\r\n const each = duration / (1 + (n - 1) * step);\r\n const parts = data.pieces.map((part) => timedOf(host, part, each, easing));\r\n return placed(parts, parts.map((_, i) => i * each * step));\r\n }\r\n }\r\n}\r\n\r\nfunction runCommand(node: Node, name: string, args: object | undefined, duration: number, easing: EasingFunction | undefined): Command<Record<string, unknown>> {\r\n const meta = getCommandMeta(node).find((m) => m.key === name);\r\n const method = meta ? (node as unknown as Record<string, unknown>)[meta.method] : undefined;\r\n if (typeof method !== \"function\") throw new Error(`${node.className} has no command \"${name}\".`);\r\n const built = (method as (args: CommandArgs) => unknown).call(node, { data: (args ?? {}) as Record<string, unknown>, duration, easing });\r\n if (!built || typeof built !== \"object\" || !(\"at\" in built)) throw new Error(`${node.className}.${name} did not return a command.`);\r\n return built as Command<Record<string, unknown>>;\r\n}\r\n\r\nconst SOUNDS = new WeakMap<object, { readonly host: Node; readonly sounds: readonly CommandSound[] }>();\r\n\r\n/** The sounds a built command plays, and the node playing them. */\r\nexport function commandSoundsOf(command: object): { readonly host: Node; readonly sounds: readonly CommandSound[] } | undefined {\r\n return SOUNDS.get(command);\r\n}\r\n\r\n/** The command a component's function returned, as the timeline places it. */\r\nexport function commandOf(host: ComponentHost, p: Piece, duration: number, easing: EasingFunction | undefined): Command<Record<string, unknown>> {\r\n // A lone tween is the engine's own `to`, exactly as a class's command would return it.\r\n if (p._piece.kind === \"tween\") return settling(host.to({ data: p._piece.targets, duration, easing }) as Command<Record<string, unknown>>);\r\n const timed = timedOf(host, p, duration, easing);\r\n const command = driveCommand(duration, (t) => timed.apply(t * duration)) as unknown as Command<Record<string, unknown>>;\r\n // A sound is cut when its command ends; a command with no length lets it play out.\r\n const sounds = timed.sounds.map((s) => (s.until === undefined && duration > 0 ? { ...s, until: duration } : s));\r\n if (sounds.length > 0) SOUNDS.set(command, { host, sounds });\r\n return timed.settles ? settling(command) : command;\r\n}\r\n"]}
1
+ {"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/components/factory/timeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAkC,MAAM,iBAAiB,CAAC;AAKlG,MAAM,KAAK,GAAG,CAAC,IAAe,EAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAE7D,wGAAwG;AACxG,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,QAAgB,EAAE,MAAkC,EAAE,IAAc;IAC3G,OAAO;QACH,IAAI;QACJ,QAAQ;QACR,MAAM;QACN,IAAI;QACJ,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAkC,EAAE,CAAC;QACzF,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,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AAC;AAC/B,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,SAAS,CAAC,IAAmB,EAAE,CAAQ,EAAE,QAAgB,EAAE,MAAkC;IACzG,uFAAuF;IACvF,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAqC,CAAC,CAAC;IAC1I,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAgD,CAAC;IACxH,mFAAmF;IACnF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChH,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACvD,CAAC","sourcesContent":["import type { Node } from \"@/components/trees/node/node\";\nimport { getCommandMeta } from \"@/tween/command-decorator\";\nimport { driveCommand, settles, settling, type Command, type CommandArgs } from \"@/tween/command\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\nimport type { NodeView, Piece, PieceData, SoundOptions, Timeline } from \"@/components/factory/api\";\nimport type { ComponentHost } from \"@/components/factory/views\";\n\nconst piece = (data: PieceData): Piece => ({ _piece: data });\n\n/** What a command is handed for one placement: its args and timing, and the builders for its pieces. */\nexport function makeTimeline(args: object, duration: number, easing: EasingFunction | undefined, node: NodeView): Timeline<any, any> {\n return {\n args,\n duration,\n easing,\n node,\n tween: (targets) => piece({ kind: \"tween\", targets: targets as Record<string, unknown> }),\n animate: (frame, options) => piece({ kind: \"animate\", frame: frame as (t: number) => Record<string, unknown>, eased: options?.eased !== false }),\n ease: (t) => (easing ? easing(t) : t),\n sound: (src, options) => piece({ kind: \"sound\", src, options: options ?? {} }),\n wait: (seconds) => piece({ kind: \"wait\", seconds }),\n together: (pieces) => piece({ kind: \"together\", pieces }),\n sequence: (pieces) => piece({ kind: \"sequence\", pieces }),\n stagger: (pieces, options) => piece({ kind: \"stagger\", pieces, overlap: options?.overlap ?? 0 }),\n };\n}\n\n/** A sound a command plays, in seconds from the command's start; `until` absent plays to its own end. */\nexport interface CommandSound {\n readonly at: number;\n readonly until: number | undefined;\n readonly src: string;\n readonly options: SoundOptions;\n}\n\n/** A built piece: how long it lasts, the frame it writes `elapsed` seconds in, whether that only tweens slots, and its sounds. */\ninterface Timed {\n readonly duration: number;\n readonly settles: boolean;\n readonly sounds: readonly CommandSound[];\n apply(elapsed: number): void;\n}\n\nconst SILENT: readonly CommandSound[] = [];\n\n/**\n * A leaf, built and run to its end at once, so the piece after it reads where\n * it finished — the rule the timeline already keeps between whole commands.\n */\nfunction leaf(command: Command<Record<string, unknown>>, duration: number, pure = true): Timed {\n command.at(1);\n return { duration, settles: pure, sounds: SILENT, apply: (elapsed) => command.at(duration > 0 ? elapsed / duration : 1) };\n}\n\nfunction placed(parts: readonly Timed[], offsets: readonly number[]): Timed {\n const duration = parts.reduce((max, part, i) => Math.max(max, offsets[i] + part.duration), 0);\n return {\n duration,\n settles: parts.every((part) => part.settles),\n sounds: parts.flatMap((part, i) => part.sounds.map((s) => ({\n ...s, at: s.at + offsets[i], until: s.until === undefined ? undefined : s.until + offsets[i],\n }))),\n apply(elapsed) {\n // A part that hasn't started writes nothing: what came before it stands.\n for (let i = 0; i < parts.length; i++) {\n if (elapsed < offsets[i]) continue;\n parts[i].apply(Math.min(elapsed - offsets[i], parts[i].duration));\n }\n },\n };\n}\n\n/** A piece built against the tree as the pieces before it left it, spread over `duration`. */\nfunction timedOf(host: ComponentHost, p: Piece, duration: number, easing: EasingFunction | undefined): Timed {\n const data = p._piece;\n switch (data.kind) {\n case \"tween\":\n return leaf(host.to({ data: data.targets, duration, easing }) as Command<Record<string, unknown>>, duration);\n case \"animate\":\n return leaf(host._animate(data.frame, duration, data.eased ? easing : undefined) as Command<Record<string, unknown>>, duration);\n case \"child\":\n return leaf((data.node as Node).to({ data: data.targets, duration, easing }) as Command<Record<string, unknown>>, duration);\n case \"run\": {\n // Any command of the child's, so it settles only if that one does.\n const run = runCommand(data.node as Node, data.name, data.args, duration, easing);\n return leaf(run, duration, settles(run));\n }\n case \"wait\":\n return { duration: data.seconds, settles: true, sounds: SILENT, apply: () => { } };\n case \"sound\":\n // Scheduled ahead of time, not written per frame: the clip's audio reads it off the built command.\n return { duration: 0, settles: true, sounds: data.src ? [{ at: 0, until: undefined, src: data.src, options: data.options }] : SILENT, apply: () => { } };\n case \"together\": {\n const parts = data.pieces.map((part) => timedOf(host, part, duration, easing));\n return placed(parts, parts.map(() => 0));\n }\n case \"sequence\": {\n // Untimed pieces share what fixed `wait`s leave of the span.\n const fixed = data.pieces.reduce((sum, part) => sum + (part._piece.kind === \"wait\" ? part._piece.seconds : 0), 0);\n const flexible = data.pieces.filter((part) => part._piece.kind !== \"wait\").length;\n const each = flexible > 0 ? Math.max(0, duration - fixed) / flexible : 0;\n const parts: Timed[] = [];\n const offsets: number[] = [];\n let cursor = 0;\n for (const part of data.pieces) {\n const timed = timedOf(host, part, each, easing);\n parts.push(timed);\n offsets.push(cursor);\n cursor += timed.duration;\n }\n return placed(parts, offsets);\n }\n case \"stagger\": {\n const n = data.pieces.length;\n if (n === 0) return { duration, settles: true, sounds: SILENT, apply: () => { } };\n const step = 1 - Math.min(1, Math.max(0, data.overlap));\n // n pieces, each `each` long, started `each * step` apart, span the command exactly.\n const each = duration / (1 + (n - 1) * step);\n const parts = data.pieces.map((part) => timedOf(host, part, each, easing));\n return placed(parts, parts.map((_, i) => i * each * step));\n }\n }\n}\n\nfunction runCommand(node: Node, name: string, args: object | undefined, duration: number, easing: EasingFunction | undefined): Command<Record<string, unknown>> {\n const meta = getCommandMeta(node).find((m) => m.key === name);\n const method = meta ? (node as unknown as Record<string, unknown>)[meta.method] : undefined;\n if (typeof method !== \"function\") throw new Error(`${node.className} has no command \"${name}\".`);\n const built = (method as (args: CommandArgs) => unknown).call(node, { data: (args ?? {}) as Record<string, unknown>, duration, easing });\n if (!built || typeof built !== \"object\" || !(\"at\" in built)) throw new Error(`${node.className}.${name} did not return a command.`);\n return built as Command<Record<string, unknown>>;\n}\n\nconst SOUNDS = new WeakMap<object, { readonly host: Node; readonly sounds: readonly CommandSound[] }>();\n\n/** The sounds a built command plays, and the node playing them. */\nexport function commandSoundsOf(command: object): { readonly host: Node; readonly sounds: readonly CommandSound[] } | undefined {\n return SOUNDS.get(command);\n}\n\n/** The command a component's function returned, as the timeline places it. */\nexport function commandOf(host: ComponentHost, p: Piece, duration: number, easing: EasingFunction | undefined): Command<Record<string, unknown>> {\n // A lone tween is the engine's own `to`, exactly as a class's command would return it.\n if (p._piece.kind === \"tween\") return settling(host.to({ data: p._piece.targets, duration, easing }) as Command<Record<string, unknown>>);\n const timed = timedOf(host, p, duration, easing);\n const command = driveCommand(duration, (t) => timed.apply(t * duration)) as unknown as Command<Record<string, unknown>>;\n // A sound is cut when its command ends; a command with no length lets it play out.\n const sounds = timed.sounds.map((s) => (s.until === undefined && duration > 0 ? { ...s, until: duration } : s));\n if (sounds.length > 0) SOUNDS.set(command, { host, sounds });\n return timed.settles ? settling(command) : command;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"type-def.js","sourceRoot":"","sources":["../../../src/components/factory/type-def.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,KAAc;IACrC,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK,CAAC;AAC7G,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,KAAK,CAAC,KAAc;IAChC,IAAI,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IACzC,QAAQ,OAAO,KAAK,EAAE,CAAC;QACnB,KAAK,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACrF,KAAK,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACnF,KAAK,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACvF,OAAO,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,0EAA0E,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7H,CAAC;AACL,CAAC","sourcesContent":["import type { PropertyEditor } from \"@/attributes/properties/decorator\";\r\nimport type { TweenFn } from \"@/props/host\";\r\nimport type { Context } from \"@/util/context\";\r\n\r\n/**\r\n * Where an entry takes its value when the author left it unset: from the\r\n * context its ancestors provide (`use`), given what was set (`given`). Read on\r\n * the node's first attach. `undefined` keeps the default.\r\n */\r\nexport type Inherit = (use: <T>(context: Context<T>) => T, given: Readonly<Record<string, unknown>>) => unknown;\r\n\r\n/** What a state entry is at runtime: the `property` options it lowers onto, plus whether it is private. */\r\nexport interface TypeDef {\r\n /** Loose author form; mapped on construction. A function here is a factory, called once per node. */\r\n readonly default: unknown;\r\n readonly mapper?: (ext: any, prev?: any) => unknown;\r\n readonly tween?: TweenFn<any>;\r\n readonly editor: PropertyEditor;\r\n readonly private: boolean;\r\n readonly inherit?: Inherit;\r\n}\r\n\r\nexport const TYPE_DEF = \"_def\";\r\n\r\nexport function isTypeLike(value: unknown): value is { readonly _def: TypeDef } {\r\n return (typeof value === \"object\" || typeof value === \"function\") && value !== null && TYPE_DEF in value;\r\n}\r\n\r\n/** A literal state entry (`value: 0`, `label: 'Hi'`, `on: true`) as the Type it stands for. */\r\nexport function defOf(entry: unknown): TypeDef {\r\n if (isTypeLike(entry)) return entry._def;\r\n switch (typeof entry) {\r\n case \"number\": return { default: entry, editor: { kind: \"number\" }, private: false };\r\n case \"string\": return { default: entry, editor: { kind: \"text\" }, private: false };\r\n case \"boolean\": return { default: entry, editor: { kind: \"boolean\" }, private: false };\r\n default: throw new TypeError(`A state entry is a Types.* value, a number, a string or a boolean; got ${String(entry)}.`);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"type-def.js","sourceRoot":"","sources":["../../../src/components/factory/type-def.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,KAAc;IACrC,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK,CAAC;AAC7G,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,KAAK,CAAC,KAAc;IAChC,IAAI,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IACzC,QAAQ,OAAO,KAAK,EAAE,CAAC;QACnB,KAAK,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACrF,KAAK,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACnF,KAAK,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACvF,OAAO,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,0EAA0E,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7H,CAAC;AACL,CAAC","sourcesContent":["import type { PropertyEditor } from \"@/attributes/properties/decorator\";\nimport type { TweenFn } from \"@/props/host\";\nimport type { Context } from \"@/util/context\";\n\n/**\n * Where an entry takes its value when the author left it unset: from the\n * context its ancestors provide (`use`), given what was set (`given`). Read on\n * the node's first attach. `undefined` keeps the default.\n */\nexport type Inherit = (use: <T>(context: Context<T>) => T, given: Readonly<Record<string, unknown>>) => unknown;\n\n/** What a state entry is at runtime: the `property` options it lowers onto, plus whether it is private. */\nexport interface TypeDef {\n /** Loose author form; mapped on construction. A function here is a factory, called once per node. */\n readonly default: unknown;\n readonly mapper?: (ext: any, prev?: any) => unknown;\n readonly tween?: TweenFn<any>;\n readonly editor: PropertyEditor;\n readonly private: boolean;\n readonly inherit?: Inherit;\n}\n\nexport const TYPE_DEF = \"_def\";\n\nexport function isTypeLike(value: unknown): value is { readonly _def: TypeDef } {\n return (typeof value === \"object\" || typeof value === \"function\") && value !== null && TYPE_DEF in value;\n}\n\n/** A literal state entry (`value: 0`, `label: 'Hi'`, `on: true`) as the Type it stands for. */\nexport function defOf(entry: unknown): TypeDef {\n if (isTypeLike(entry)) return entry._def;\n switch (typeof entry) {\n case \"number\": return { default: entry, editor: { kind: \"number\" }, private: false };\n case \"string\": return { default: entry, editor: { kind: \"text\" }, private: false };\n case \"boolean\": return { default: entry, editor: { kind: \"boolean\" }, private: false };\n default: throw new TypeError(`A state entry is a Types.* value, a number, a string or a boolean; got ${String(entry)}.`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/factory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkB,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAyC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAkB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAgB,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAoD,MAAM,0CAA0C,CAAC;AAC7H,OAAO,EAAE,cAAc,EAAkD,MAAM,yCAAyC,CAAC;AACzH,OAAO,EAAE,UAAU,EAAe,MAAM,kCAAkC,CAAC;AAI3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAoC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAoC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIhD,OAAO,EAAE,KAAK,EAA8B,MAAM,+BAA+B,CAAC;AAkClF,SAAS,IAAI,CAA6B,GAAY;IAClD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAsB,CAAC;AAC7C,CAAC;AAED,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,GAAG,CAAC,EAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CAC5G,CAAC","sourcesContent":["import { alignmentOps, type Alignment } from \"@/attributes/layout/alignment\";\r\nimport { insetsOps, type InsetsProps, type InsetsResolved } from \"@/attributes/layout/insets\";\r\nimport { sizeInputOps, type SizeInput } from \"@/attributes/layout/size\";\r\nimport { vector2Ops, type Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { PropertyEditor } from \"@/attributes/properties/decorator\";\r\nimport { cornerRadiusOps, type CornerRadiusResolved, type RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport { cornerStyleOps, type CornerStyleResolved, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport { effectsOps, type Effect } from \"@/attributes/shape/effects/chain\";\r\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\r\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\r\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\nimport { shadowOps, type Shadow, type ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\r\nimport { strokeOps, type Stroke, type StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\nimport { textOps } from \"@/attributes/text/ops\";\r\nimport type { TweenFn } from \"@/props/host\";\r\nimport type { PathData } from \"@/render/descriptors/path\";\r\nimport type { AnyType, InOf, Inputs, NodeView, OutOf, StateSpec, Type, Values } from \"@/components/factory/api\";\r\nimport { defOf, type Inherit, type TypeDef } from \"@/components/factory/type-def\";\r\n\r\nexport interface EntryOptions {\r\n /** Not in documents or calls; only commands write it. A seek restores it like any entry. */\r\n readonly private?: boolean;\r\n /** `false`: `to` switches it rather than moving it. */\r\n readonly animatable?: boolean;\r\n /** Where it comes from when the author leaves it unset: what an ancestor provides. */\r\n readonly inherit?: Inherit;\r\n}\r\n\r\nexport interface NumberOptions extends EntryOptions {\r\n readonly min?: number;\r\n readonly max?: number;\r\n readonly step?: number;\r\n readonly unit?: string;\r\n /** Shown multiplied by this: `100` with `unit: \"%\"` for a 0–1 fraction. */\r\n readonly scale?: number;\r\n}\r\n\r\nexport interface TextOptions extends EntryOptions {\r\n /** `to` types the text out instead of switching at the end. */\r\n readonly typing?: boolean;\r\n /** It holds lines, not a label. */\r\n readonly multiline?: boolean;\r\n}\r\n\r\ntype PrivateOf<O> = O extends { readonly private: true } ? true : false;\r\n\r\n/** An attribute type: usable bare (`Types.fill`) or called with a default (`Types.fill('red')`). */\r\nexport interface Attribute<In, Out> extends Type<In, Out, false> {\r\n <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>>;\r\n}\r\n\r\nfunction make<In, Out, P extends boolean>(def: TypeDef): Type<In, Out, P> {\r\n return { _def: def } as Type<In, Out, P>;\r\n}\r\n\r\n/** The editor half of an options object: what the value means, never how an app shows it. */\r\nfunction meaning(kind: string, options: object | undefined, extra?: PropertyEditor): PropertyEditor {\r\n const { private: _private, typing: _typing, inherit: _inherit, ...rest } = (options ?? {}) as Record<string, unknown>;\r\n return { kind, ...extra, ...rest };\r\n}\r\n\r\nfunction attribute<In, Out>(\r\n kind: string, fallback: In, mapper?: (ext: any, prev?: any) => Out, tween?: TweenFn<Out>,\r\n): Attribute<In, Out> {\r\n const base: TypeDef = { default: fallback, mapper, tween, editor: { kind }, private: false };\r\n const call = <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>> =>\r\n make({ ...base, default: initial === undefined ? base.default : initial, editor: meaning(kind, options), private: options?.private === true, inherit: options?.inherit });\r\n return Object.assign(call, { _def: base }) as unknown as Attribute<In, Out>;\r\n}\r\n\r\nfunction defaultsOf(shape: StateSpec): Record<string, unknown> {\r\n const out: Record<string, unknown> = {};\r\n for (const key in shape) out[key] = defOf(shape[key]).default;\r\n return out;\r\n}\r\n\r\n/**\r\n * What a state entry can be. Each lowers onto the `property` options of the\r\n * attribute it names, so a Type and a typed property are the same pair.\r\n */\r\nexport const Types = {\r\n number<const O extends NumberOptions = {}>(initial = 0, options?: NumberOptions & O): Type<number, number, PrivateOf<O>> {\r\n return make({ default: initial, editor: meaning(\"number\", options), private: options?.private === true, inherit: options?.inherit });\r\n },\r\n text<const O extends TextOptions = {}>(initial = \"\", options?: TextOptions & O): Type<string, string, PrivateOf<O>> {\r\n return make({ default: initial, tween: options?.typing ? textOps.lerp : undefined, editor: meaning(\"text\", options), private: options?.private === true, inherit: options?.inherit });\r\n },\r\n boolean<const O extends EntryOptions = {}>(initial = false, options?: EntryOptions & O): Type<boolean, boolean, PrivateOf<O>> {\r\n return make({ default: initial, editor: meaning(\"boolean\", options), private: options?.private === true, inherit: options?.inherit });\r\n },\r\n oneOf<const V extends readonly string[], const O extends EntryOptions = {}>(\r\n values: V, options?: EntryOptions & O & { readonly default?: V[number] },\r\n ): Type<V[number], V[number], PrivateOf<O>> {\r\n const { default: initial, ...rest } = options ?? ({} as O & { default?: V[number] });\r\n return make({ default: initial ?? values[0], editor: meaning(\"enum\", rest, { options: values }), private: options?.private === true, inherit: options?.inherit });\r\n },\r\n\r\n fill: attribute<Fill, FillResolved[]>(\"fills\", [], fillOps.resolve, fillOps.lerp),\r\n stroke: attribute<Stroke, StrokeResolved[]>(\"strokes\", [], strokeOps.resolve, strokeOps.lerp),\r\n shadow: attribute<Shadow, ShadowResolved[]>(\"shadows\", [], shadowOps.resolve, shadowOps.lerp),\r\n effects: attribute<Effect, NodeEffect[]>(\"effects\", [], effectsOps.resolve, effectsOps.lerp),\r\n color: attribute<Color, NormalizedColor>(\"color\", \"black\", colorOps.resolve, colorOps.lerp),\r\n cornerRadius: attribute<RectCornerRadius, CornerRadiusResolved>(\"cornerRadius\", 0, cornerRadiusOps.resolve, cornerRadiusOps.lerp),\r\n cornerStyle: attribute<RectCornerStyle, CornerStyleResolved>(\"cornerStyle\", \"rounded\", cornerStyleOps.resolve, cornerStyleOps.lerp),\r\n path: attribute<PathData, PathData>(\"path\", \"\", undefined, pathOps.lerp),\r\n insets: attribute<InsetsProps, InsetsResolved>(\"insets\", 0, insetsOps.resolve, insetsOps.lerp),\r\n alignment: attribute<Alignment, Vector2>(\"alignment\", \"center\", alignmentOps.resolve, alignmentOps.lerp),\r\n vector2: attribute<Vector2, Vector2>(\"vector2\", { x: 0, y: 0 }, undefined, vector2Ops.lerp),\r\n size: attribute<SizeInput, SizeInput>(\"size\", \"fill\", undefined, sizeInputOps.lerp),\r\n\r\n /** A point in the component's own frame: an editor can drag it. */\r\n point<const O extends EntryOptions = {}>(initial: Vector2 = { x: 0, y: 0 }, options?: EntryOptions & O): Type<Vector2, Vector2, PrivateOf<O>> {\r\n return make({ default: initial, tween: vector2Ops.lerp, editor: meaning(\"point\", options), private: options?.private === true, inherit: options?.inherit });\r\n },\r\n list<const T extends AnyType, const O extends EntryOptions = {}>(item: T, options?: EntryOptions & O): Type<InOf<T>[], OutOf<T>[], PrivateOf<O>> {\r\n return make({ default: () => [], editor: meaning(\"list\", options, { item: item._def.editor }), private: options?.private === true, inherit: options?.inherit });\r\n },\r\n object<const S extends StateSpec>(shape: S): Type<Inputs<S>, Values<S>> {\r\n return make({ default: () => defaultsOf(shape), editor: { kind: \"object\" }, private: false });\r\n },\r\n custom<In, Out = In, const O extends EntryOptions = {}>(initial: In, options?: EntryOptions & O & {\r\n readonly resolve?: (value: In) => Out;\r\n readonly lerp?: (from: Out, to: Out, t: number) => Out;\r\n /** What the value is, when a host can't tell from the default (`\"vector2\"`), and its parts. */\r\n readonly kind?: string;\r\n readonly properties?: PropertyEditor[\"properties\"];\r\n }): Type<In, Out, PrivateOf<O>> {\r\n const { resolve, lerp, private: _private, inherit: _inherit, ...rest } = options ?? ({} as NonNullable<typeof options>);\r\n // No kind of its own: a host reads one off the default, as for a bare `property`.\r\n return make({ default: initial, mapper: resolve, tween: lerp, editor: rest as PropertyEditor, private: options?.private === true, inherit: options?.inherit });\r\n },\r\n image: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"image\" }, private: false }),\r\n video: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"video\" }, private: false }),\r\n audio: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"audio\" }, private: false }),\r\n font: (family = \"\"): Type<string> => make({ default: family, editor: { kind: \"font\" }, private: false }),\r\n /** Another node, by id: a document holds the id, and a field reads a view of that node (or `null`). */\r\n nodeRef: (initial = \"\"): Type<string, NodeView | null> => make({ default: initial, editor: { kind: \"nodeRef\", animatable: false }, private: false }),\r\n /** A seed for deterministic randomness: procedural motion stays a function of time. */\r\n seed: (initial = 1): Type<number> => make({ default: initial, editor: { kind: \"seed\" }, private: false }),\r\n};\r\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/factory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkB,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAyC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAkB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAgB,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAoD,MAAM,0CAA0C,CAAC;AAC7H,OAAO,EAAE,cAAc,EAAkD,MAAM,yCAAyC,CAAC;AACzH,OAAO,EAAE,UAAU,EAAe,MAAM,kCAAkC,CAAC;AAI3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC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EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACxG,uGAAuG;IACvG,OAAO,EAAE,CAAC,OAAO,GAAG,EAAE,EAAiC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACpJ,uFAAuF;IACvF,IAAI,EAAE,CAAC,OAAO,GAAG,CAAC,EAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CAC5G,CAAC","sourcesContent":["import { alignmentOps, type Alignment } from \"@/attributes/layout/alignment\";\nimport { insetsOps, type InsetsProps, type InsetsResolved } from \"@/attributes/layout/insets\";\nimport { sizeInputOps, type SizeInput } from \"@/attributes/layout/size\";\nimport { vector2Ops, type Vector2 } from \"@/attributes/layout/vector2\";\nimport type { PropertyEditor } from \"@/attributes/properties/decorator\";\nimport { cornerRadiusOps, type CornerRadiusResolved, type RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport { cornerStyleOps, type CornerStyleResolved, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport { effectsOps, type Effect } from \"@/attributes/shape/effects/chain\";\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { pathOps } from \"@/attributes/shape/path/ops\";\nimport { shadowOps, type Shadow, type ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport { strokeOps, type Stroke, type StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { textOps } from \"@/attributes/text/ops\";\nimport type { TweenFn } from \"@/props/host\";\nimport type { PathData } from \"@/render/descriptors/path\";\nimport type { AnyType, InOf, Inputs, NodeView, OutOf, StateSpec, Type, Values } from \"@/components/factory/api\";\nimport { defOf, type Inherit, type TypeDef } from \"@/components/factory/type-def\";\n\nexport interface EntryOptions {\n /** Not in documents or calls; only commands write it. A seek restores it like any entry. */\n readonly private?: boolean;\n /** `false`: `to` switches it rather than moving it. */\n readonly animatable?: boolean;\n /** Where it comes from when the author leaves it unset: what an ancestor provides. */\n readonly inherit?: Inherit;\n}\n\nexport interface NumberOptions extends EntryOptions {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly unit?: string;\n /** Shown multiplied by this: `100` with `unit: \"%\"` for a 0–1 fraction. */\n readonly scale?: number;\n}\n\nexport interface TextOptions extends EntryOptions {\n /** `to` types the text out instead of switching at the end. */\n readonly typing?: boolean;\n /** It holds lines, not a label. */\n readonly multiline?: boolean;\n}\n\ntype PrivateOf<O> = O extends { readonly private: true } ? true : false;\n\n/** An attribute type: usable bare (`Types.fill`) or called with a default (`Types.fill('red')`). */\nexport interface Attribute<In, Out> extends Type<In, Out, false> {\n <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>>;\n}\n\nfunction make<In, Out, P extends boolean>(def: TypeDef): Type<In, Out, P> {\n return { _def: def } as Type<In, Out, P>;\n}\n\n/** The editor half of an options object: what the value means, never how an app shows it. */\nfunction meaning(kind: string, options: object | undefined, extra?: PropertyEditor): PropertyEditor {\n const { private: _private, typing: _typing, inherit: _inherit, ...rest } = (options ?? {}) as Record<string, unknown>;\n return { kind, ...extra, ...rest };\n}\n\nfunction attribute<In, Out>(\n kind: string, fallback: In, mapper?: (ext: any, prev?: any) => Out, tween?: TweenFn<Out>,\n): Attribute<In, Out> {\n const base: TypeDef = { default: fallback, mapper, tween, editor: { kind }, private: false };\n const call = <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>> =>\n make({ ...base, default: initial === undefined ? base.default : initial, editor: meaning(kind, options), private: options?.private === true, inherit: options?.inherit });\n return Object.assign(call, { _def: base }) as unknown as Attribute<In, Out>;\n}\n\nfunction defaultsOf(shape: StateSpec): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key in shape) out[key] = defOf(shape[key]).default;\n return out;\n}\n\n/**\n * What a state entry can be. Each lowers onto the `property` options of the\n * attribute it names, so a Type and a typed property are the same pair.\n */\nexport const Types = {\n number<const O extends NumberOptions = {}>(initial = 0, options?: NumberOptions & O): Type<number, number, PrivateOf<O>> {\n return make({ default: initial, editor: meaning(\"number\", options), private: options?.private === true, inherit: options?.inherit });\n },\n text<const O extends TextOptions = {}>(initial = \"\", options?: TextOptions & O): Type<string, string, PrivateOf<O>> {\n return make({ default: initial, tween: options?.typing ? textOps.lerp : undefined, editor: meaning(\"text\", options), private: options?.private === true, inherit: options?.inherit });\n },\n boolean<const O extends EntryOptions = {}>(initial = false, options?: EntryOptions & O): Type<boolean, boolean, PrivateOf<O>> {\n return make({ default: initial, editor: meaning(\"boolean\", options), private: options?.private === true, inherit: options?.inherit });\n },\n oneOf<const V extends readonly string[], const O extends EntryOptions = {}>(\n values: V, options?: EntryOptions & O & { readonly default?: V[number] },\n ): Type<V[number], V[number], PrivateOf<O>> {\n const { default: initial, ...rest } = options ?? ({} as O & { default?: V[number] });\n return make({ default: initial ?? values[0], editor: meaning(\"enum\", rest, { options: values }), private: options?.private === true, inherit: options?.inherit });\n },\n\n fill: attribute<Fill, FillResolved[]>(\"fills\", [], fillOps.resolve, fillOps.lerp),\n stroke: attribute<Stroke, StrokeResolved[]>(\"strokes\", [], strokeOps.resolve, strokeOps.lerp),\n shadow: attribute<Shadow, ShadowResolved[]>(\"shadows\", [], shadowOps.resolve, shadowOps.lerp),\n effects: attribute<Effect, NodeEffect[]>(\"effects\", [], effectsOps.resolve, effectsOps.lerp),\n color: attribute<Color, NormalizedColor>(\"color\", \"black\", colorOps.resolve, colorOps.lerp),\n cornerRadius: attribute<RectCornerRadius, CornerRadiusResolved>(\"cornerRadius\", 0, cornerRadiusOps.resolve, cornerRadiusOps.lerp),\n cornerStyle: attribute<RectCornerStyle, CornerStyleResolved>(\"cornerStyle\", \"rounded\", cornerStyleOps.resolve, cornerStyleOps.lerp),\n path: attribute<PathData, PathData>(\"path\", \"\", undefined, pathOps.lerp),\n insets: attribute<InsetsProps, InsetsResolved>(\"insets\", 0, insetsOps.resolve, insetsOps.lerp),\n alignment: attribute<Alignment, Vector2>(\"alignment\", \"center\", alignmentOps.resolve, alignmentOps.lerp),\n vector2: attribute<Vector2, Vector2>(\"vector2\", { x: 0, y: 0 }, undefined, vector2Ops.lerp),\n size: attribute<SizeInput, SizeInput>(\"size\", \"fill\", undefined, sizeInputOps.lerp),\n\n /** A point in the component's own frame: an editor can drag it. */\n point<const O extends EntryOptions = {}>(initial: Vector2 = { x: 0, y: 0 }, options?: EntryOptions & O): Type<Vector2, Vector2, PrivateOf<O>> {\n return make({ default: initial, tween: vector2Ops.lerp, editor: meaning(\"point\", options), private: options?.private === true, inherit: options?.inherit });\n },\n list<const T extends AnyType, const O extends EntryOptions = {}>(item: T, options?: EntryOptions & O): Type<InOf<T>[], OutOf<T>[], PrivateOf<O>> {\n return make({ default: () => [], editor: meaning(\"list\", options, { item: item._def.editor }), private: options?.private === true, inherit: options?.inherit });\n },\n object<const S extends StateSpec>(shape: S): Type<Inputs<S>, Values<S>> {\n return make({ default: () => defaultsOf(shape), editor: { kind: \"object\" }, private: false });\n },\n custom<In, Out = In, const O extends EntryOptions = {}>(initial: In, options?: EntryOptions & O & {\n readonly resolve?: (value: In) => Out;\n readonly lerp?: (from: Out, to: Out, t: number) => Out;\n /** What the value is, when a host can't tell from the default (`\"vector2\"`), and its parts. */\n readonly kind?: string;\n readonly properties?: PropertyEditor[\"properties\"];\n }): Type<In, Out, PrivateOf<O>> {\n const { resolve, lerp, private: _private, inherit: _inherit, ...rest } = options ?? ({} as NonNullable<typeof options>);\n // No kind of its own: a host reads one off the default, as for a bare `property`.\n return make({ default: initial, mapper: resolve, tween: lerp, editor: rest as PropertyEditor, private: options?.private === true, inherit: options?.inherit });\n },\n image: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"image\" }, private: false }),\n video: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"video\" }, private: false }),\n audio: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"audio\" }, private: false }),\n font: (family = \"\"): Type<string> => make({ default: family, editor: { kind: \"font\" }, private: false }),\n /** Another node, by id: a document holds the id, and a field reads a view of that node (or `null`). */\n nodeRef: (initial = \"\"): Type<string, NodeView | null> => make({ default: initial, editor: { kind: \"nodeRef\", animatable: false }, private: false }),\n /** A seed for deterministic randomness: procedural motion stays a function of time. */\n seed: (initial = 1): Type<number> => make({ default: initial, editor: { kind: \"seed\" }, private: false }),\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"views.js","sourceRoot":"","sources":["../../../src/components/factory/views.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAetD,gHAAgH;AAChH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAwB5C,IAAI,IAAI,GAAgB,IAAI,CAAC;AAE7B,MAAM,UAAU,QAAQ,CAAI,IAAY,EAAE,KAAuB,EAAE,IAAS,EAAE,GAAY;IACtF,MAA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B,IAAI,iBAAiB,EAAE,CAAC;AAEzD,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC5C,IAAI,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IAChI,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { SizeConstraints } from \"@/layout/constraints\";\r\nimport type { Node2D, CameraScope } from \"@/components/trees/2d/node2d\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport type { Clip } from \"@/render/clip\";\r\nimport { NullRenderContext } from \"@/render/null-render-context\";\r\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\r\nimport { frameIn, Node2D as Node2DClass } from \"@/components/trees/2d/node2d\";\r\nimport { Node3D } from \"@/components/trees/three/node3d\";\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\r\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\r\nimport type { ChildBoundsMode } from \"@/components/trees/2d/group-bounds\";\r\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\r\nimport type { TextStyle } from \"@/attributes/text/types\";\r\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/components/factory/api\";\r\nimport { clipOf } from \"@/components/factory/clip-of\";\r\n\r\n/**\r\n * What a render did with its children beyond drawing them: composited them\r\n * (the ink bounds that leaves), looked at them through a camera, or stood them\r\n * in a 2.5D space. Picking and the space machinery read it between frames.\r\n */\r\nexport interface Composite {\r\n readonly bounds?: ChildBoundsMode;\r\n readonly camera?: CameraScope;\r\n readonly space?: SpaceCamera;\r\n /** The scene its 3D children were rendered into: what picking projects through. */\r\n readonly scene?: Scene3D;\r\n}\r\n\r\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\r\nexport const NODE = Symbol(\"componentNode\");\r\n\r\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\r\nexport interface ComponentHost extends Node2D {\r\n _renderOwnChildren(pass: RenderPass2D): void;\r\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\r\n _lastShape: Graphics2D | null;\r\n /** The composite its last render or probe declared; `undefined` before either. */\r\n _record: Composite | null | undefined;\r\n}\r\n\r\n// ---- the pass in progress -------------------------------------------------\r\n\r\n/**\r\n * Measure and layout run synchronously, one node at a time, so the node being\r\n * laid out and its measurer are a single slot rather than state on every view.\r\n */\r\ninterface Pass {\r\n readonly node: Node2D;\r\n readonly scope: MeasureContext2D;\r\n readonly room: Max;\r\n readonly sizes: Map<Node2D, Size2D>;\r\n}\r\n\r\nlet pass: Pass | null = null;\r\n\r\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\r\n const outer = pass;\r\n pass = { node, scope, room, sizes: new Map() };\r\n try {\r\n return run();\r\n } finally {\r\n pass = outer;\r\n }\r\n}\r\n\r\nconst decided = new WeakSet<Node2D>();\r\n\r\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\r\nexport function markDecided(node: Node2D): void {\r\n decided.add(node);\r\n}\r\n\r\nexport function takeDecided(node: Node2D): boolean {\r\n return decided.delete(node);\r\n}\r\n\r\nexport function currentPass(): Pass {\r\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\r\n return pass;\r\n}\r\n\r\nfunction measureChild(node: Node2D, max: Max): Size2D {\r\n const p = currentPass();\r\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\r\n const measured = node.measure(constraints, p.scope);\r\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\r\n p.sizes.set(node, size);\r\n return size;\r\n}\r\n\r\n// ---- child views ------------------------------------------------------------\r\n\r\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\r\n\r\n/** A child as its parent's fields see it. One per child node, reused every frame. */\r\nclass ChildViewImpl implements ChildView {\r\n readonly [NODE]: Node2D;\r\n readonly state: never;\r\n\r\n constructor(node: Node2D) {\r\n this[NODE] = node;\r\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\r\n this.state = new Proxy(node, {\r\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\r\n if (!pass) {\r\n const box = this[NODE].layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\r\n }\r\n\r\n get children(): readonly ChildView[] {\r\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\r\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\r\n }\r\n\r\n measure(max: Max): Size2D {\r\n return measureChild(this[NODE], max);\r\n }\r\n\r\n to(targets: object): Piece {\r\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\r\n }\r\n\r\n run(name: string, args?: object): Piece {\r\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\r\n }\r\n}\r\n\r\nexport function childView(node: Node2D | Node): ChildView {\r\n let view = childViews.get(node as Node2D);\r\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\r\n return view as unknown as ChildView;\r\n}\r\n\r\nexport function nodeOfView(view: ChildView<any>): Node2D {\r\n return (view as unknown as ChildViewImpl)[NODE];\r\n}\r\n\r\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\r\n\r\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\r\n\r\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\r\nclass NodeViewImpl implements NodeView {\r\n readonly [NODE]: Node;\r\n readonly state: never;\r\n\r\n constructor(node: Node, readonly reader: Node) {\r\n this[NODE] = node;\r\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\r\n // Anything else it has (a 2D node's cardinal points) reads off the node.\r\n const fields = (node as { _view?: object })._view ?? node;\r\n this.state = new Proxy(fields, {\r\n get: (target, key) => {\r\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\r\n if (key === \"constructor\") return node.constructor;\r\n if (key in target) return Reflect.get(target, key);\r\n const value = Reflect.get(node, key) as unknown;\r\n // A method of the node runs on the node, not on this read-only view.\r\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\r\n },\r\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n const node = this[NODE];\r\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get frame(): NodeFrame {\r\n const node = this[NODE];\r\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\r\n }\r\n}\r\n\r\n/** `node` as `reader` sees it. One view per pair. */\r\nexport function nodeView(node: Node, reader: Node): NodeView {\r\n let byReader = nodeViews.get(node);\r\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\r\n let view = byReader.get(reader);\r\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\r\n return view;\r\n}\r\n\r\nexport function nodeOfNodeView(view: NodeView): Node {\r\n return (view as unknown as NodeViewImpl)[NODE];\r\n}\r\n\r\nconst found = new WeakMap<Node, Map<string, Node>>();\r\n\r\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\r\nexport function referenced(reader: Node, id: unknown): NodeView | null {\r\n if (typeof id !== \"string\" || id === \"\") return null;\r\n let known = found.get(reader);\r\n let node = known?.get(id);\r\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\r\n node = findIn(rootOf(reader), id) ?? undefined;\r\n if (!node) {\r\n known?.delete(id);\r\n return null;\r\n }\r\n if (!known) found.set(reader, known = new Map());\r\n known.set(id, node);\r\n }\r\n return nodeView(node, reader);\r\n}\r\n\r\nfunction rootOf(node: Node): Node {\r\n let at = node;\r\n while (at.parent) at = at.parent;\r\n return at;\r\n}\r\n\r\nfunction findIn(at: Node, id: string): Node | null {\r\n if (at.id === id) return at;\r\n for (const child of at._allChildren) {\r\n const hit = findIn(child, id);\r\n if (hit) return hit;\r\n }\r\n return null;\r\n}\r\n\r\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\r\n/** Set by the factory module, which owns the node descriptors. */\r\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\r\n keyOf = lookup;\r\n}\r\n\r\n// ---- state views ------------------------------------------------------------\r\n\r\n/**\r\n * One prototype of getters per component, so a node's `state` is a single\r\n * object made once: every read goes straight to the node's own slot, and a\r\n * frame allocates nothing to hand its fields their values.\r\n */\r\nexport interface ViewShape {\r\n readonly proto: object;\r\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\r\n readonly entries: PropertyDescriptorMap;\r\n}\r\n\r\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\r\n const entries: PropertyDescriptorMap = {};\r\n for (const key of keys) {\r\n entries[key] = references.has(key)\r\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\r\n : { get(this: { [NODE]: object }) { return (this[NODE] as Record<string, unknown>)[key]; }, enumerable: true };\r\n }\r\n const proto = {};\r\n // The children of the node's own tree, as its commands see them too.\r\n Object.defineProperty(proto, \"children\", {\r\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\r\n enumerable: false,\r\n });\r\n return { proto, entries };\r\n}\r\n\r\nexport function stateView(shape: ViewShape, node: object): object {\r\n const view = Object.create(shape.proto) as { [NODE]: object };\r\n Object.defineProperties(view, shape.entries);\r\n view[NODE] = node;\r\n return view;\r\n}\r\n\r\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\r\nexport function snapshot(view: object): Record<string, unknown> {\r\n const out: Record<string, unknown> = {};\r\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\r\n return out;\r\n}\r\n\r\n// ---- measurer and render context --------------------------------------------\r\n\r\nexport class MeasurerImpl implements Measurer {\r\n max: Max = {};\r\n scope: MeasureContext2D | null = null;\r\n\r\n constructor(readonly host: Node) { }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n text(text: string, font: FontSpec): Size2D {\r\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\r\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\r\n }\r\n}\r\n\r\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\r\nexport class RenderContextImpl implements RenderContext2D {\r\n pass: RenderPass2D | null = null;\r\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\r\n cut: Clip | null = null;\r\n\r\n /**\r\n * `probing`: `render` runs only to find the shape it paints (for clip and\r\n * picking outside a frame), so nothing is drawn and no child is visited.\r\n */\r\n constructor(readonly host: ComponentHost, readonly probing = false) { }\r\n\r\n get size(): Size2D {\r\n const box = this.host.layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\r\n if (!graphics || this.probing) return;\r\n const out = this.target();\r\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\r\n else out.draw(graphics as Graphics2D);\r\n }\r\n\r\n children(): void {\r\n if (this.probing) return;\r\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\r\n if (!this.composite) this.host._record = null;\r\n this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\r\n composite: Composite | null = null;\r\n\r\n private _declare(composite: Composite): void {\r\n this.composite = { ...this.composite, ...composite };\r\n if (!this.probing) this.host._record = this.composite;\r\n }\r\n\r\n mask(options: MaskOptions): void {\r\n this._declare({ bounds: \"first\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const [stencil, ...content] = this.host.children;\r\n if (!stencil) return;\r\n if (content.length === 0) {\r\n stencil.render(out);\r\n return;\r\n }\r\n out.beginMask({ mode: options.mode, inverted: options.inverted });\r\n stencil.render(out);\r\n out.applyMask();\r\n for (const child of content) child.render(out);\r\n out.endMask();\r\n }\r\n\r\n merge(op: BooleanOperation, paint: MergePaint): void {\r\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n out.beginBoolean(op);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endBoolean();\r\n // A drawing with no shape of its own paints the merged outline.\r\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\r\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\r\n out.draw(new GraphicsClass().stroke(paint.stroke));\r\n }\r\n\r\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\r\n camera(scope: CameraScope): void {\r\n this._declare({ camera: scope });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const rect = this.host.layoutBounds;\r\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endCamera();\r\n }\r\n\r\n /** Your 3D children, rendered in order into a new scene. */\r\n scene3D(): Scene3D {\r\n const scene = new Scene3D();\r\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\r\n this._declare({ scene });\r\n return scene;\r\n }\r\n\r\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\r\n space(camera: SpaceCamera): void {\r\n this._declare({ space: camera });\r\n if (!this.probing) this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n textStyle(style: TextStyle | null, body: () => void): void {\r\n if (this.probing) return body();\r\n const out = this.target();\r\n out.pushTextStyle(style);\r\n try {\r\n body();\r\n } finally {\r\n out.popTextStyle();\r\n }\r\n }\r\n\r\n clip(shape: Graphics2D, body: () => void): void {\r\n if (this.probing) return body();\r\n const outline = clipOf(shape);\r\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\r\n if (outline.isEmpty()) return body();\r\n const out = this.target();\r\n out.beginClip(outline);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\r\n get inSpace(): boolean {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (!(at instanceof Node2DClass)) return false;\r\n if (at._spaceCamera()) return true;\r\n if (!at._rendersChildrenInSpace()) return false;\r\n }\r\n return false;\r\n }\r\n\r\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\r\n }\r\n return null;\r\n }\r\n\r\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\r\n inFront(body: () => void): void {\r\n if (this.probing) return;\r\n const out = this.target();\r\n if (!this.cut) {\r\n body();\r\n return;\r\n }\r\n out.beginClip(this.cut);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n target(): RenderPass2D {\r\n if (this.probing) return PROBE_PASS;\r\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\r\n return this.pass;\r\n }\r\n}\r\n\r\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\r\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\r\n\r\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\r\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\r\n return ctx;\r\n}\r\n"]}
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../../../src/components/factory/views.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAetD,gHAAgH;AAChH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAwB5C,IAAI,IAAI,GAAgB,IAAI,CAAC;AAE7B,MAAM,UAAU,QAAQ,CAAI,IAAY,EAAE,KAAuB,EAAE,IAAS,EAAE,GAAY;IACtF,MAAM,KAAK,GAAG,IAAI,CAAC;IACnB,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAC/C,IAAI,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;IACj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,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\nimport type { SizeConstraints } from \"@/layout/constraints\";\nimport type { Node2D, CameraScope } from \"@/components/trees/2d/node2d\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport type { Graphics2D } from \"@/render/graphics2d\";\nimport type { MeasureContext2D } from \"@/render/measure-context\";\nimport type { RenderPass2D } from \"@/render/render-context2d\";\nimport type { Clip } from \"@/render/clip\";\nimport { NullRenderContext } from \"@/render/null-render-context\";\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\nimport { frameIn, Node2D as Node2DClass } from \"@/components/trees/2d/node2d\";\nimport { Node3D } from \"@/components/trees/three/node3d\";\nimport { Scene3D } from \"@/render3d/scene3d\";\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\nimport type { ChildBoundsMode } from \"@/components/trees/2d/group-bounds\";\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\nimport type { TextStyle } from \"@/attributes/text/types\";\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/components/factory/api\";\nimport { clipOf } from \"@/components/factory/clip-of\";\n\n/**\n * What a render did with its children beyond drawing them: composited them\n * (the ink bounds that leaves), looked at them through a camera, or stood them\n * in a 2.5D space. Picking and the space machinery read it between frames.\n */\nexport interface Composite {\n readonly bounds?: ChildBoundsMode;\n readonly camera?: CameraScope;\n readonly space?: SpaceCamera;\n /** The scene its 3D children were rendered into: what picking projects through. */\n readonly scene?: Scene3D;\n}\n\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\nexport const NODE = Symbol(\"componentNode\");\n\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\nexport interface ComponentHost extends Node2D {\n _renderOwnChildren(pass: RenderPass2D): void;\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\n _lastShape: Graphics2D | null;\n /** The composite its last render or probe declared; `undefined` before either. */\n _record: Composite | null | undefined;\n}\n\n// ---- the pass in progress -------------------------------------------------\n\n/**\n * Measure and layout run synchronously, one node at a time, so the node being\n * laid out and its measurer are a single slot rather than state on every view.\n */\ninterface Pass {\n readonly node: Node2D;\n readonly scope: MeasureContext2D;\n readonly room: Max;\n readonly sizes: Map<Node2D, Size2D>;\n}\n\nlet pass: Pass | null = null;\n\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\n const outer = pass;\n pass = { node, scope, room, sizes: new Map() };\n try {\n return run();\n } finally {\n pass = outer;\n }\n}\n\nconst decided = new WeakSet<Node2D>();\n\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\nexport function markDecided(node: Node2D): void {\n decided.add(node);\n}\n\nexport function takeDecided(node: Node2D): boolean {\n return decided.delete(node);\n}\n\nexport function currentPass(): Pass {\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\n return pass;\n}\n\nfunction measureChild(node: Node2D, max: Max): Size2D {\n const p = currentPass();\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\n const measured = node.measure(constraints, p.scope);\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\n p.sizes.set(node, size);\n return size;\n}\n\n// ---- child views ------------------------------------------------------------\n\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\n\n/** A child as its parent's fields see it. One per child node, reused every frame. */\nclass ChildViewImpl implements ChildView {\n readonly [NODE]: Node2D;\n readonly state: never;\n\n constructor(node: Node2D) {\n this[NODE] = node;\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\n this.state = new Proxy(node, {\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\n }) as never;\n }\n\n get id(): string { return this[NODE].id; }\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\n\n get size(): Size2D {\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\n if (!pass) {\n const box = this[NODE].layoutBounds;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\n }\n\n get children(): readonly ChildView[] {\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\n }\n\n measure(max: Max): Size2D {\n return measureChild(this[NODE], max);\n }\n\n to(targets: object): Piece {\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\n }\n\n run(name: string, args?: object): Piece {\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\n }\n}\n\nexport function childView(node: Node2D | Node): ChildView {\n let view = childViews.get(node as Node2D);\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\n return view as unknown as ChildView;\n}\n\nexport function nodeOfView(view: ChildView<any>): Node2D {\n return (view as unknown as ChildViewImpl)[NODE];\n}\n\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\n\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\n\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\nclass NodeViewImpl implements NodeView {\n readonly [NODE]: Node;\n readonly state: never;\n\n constructor(node: Node, readonly reader: Node) {\n this[NODE] = node;\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\n // Anything else it has (a 2D node's cardinal points) reads off the node.\n const fields = (node as { _view?: object })._view ?? node;\n this.state = new Proxy(fields, {\n get: (target, key) => {\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\n if (key === \"constructor\") return node.constructor;\n if (key in target) return Reflect.get(target, key);\n const value = Reflect.get(node, key) as unknown;\n // A method of the node runs on the node, not on this read-only view.\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\n },\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\n }) as never;\n }\n\n get id(): string { return this[NODE].id; }\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\n\n get size(): Size2D {\n const node = this[NODE];\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n\n get frame(): NodeFrame {\n const node = this[NODE];\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\n }\n}\n\n/** `node` as `reader` sees it. One view per pair. */\nexport function nodeView(node: Node, reader: Node): NodeView {\n let byReader = nodeViews.get(node);\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\n let view = byReader.get(reader);\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\n return view;\n}\n\nexport function nodeOfNodeView(view: NodeView): Node {\n return (view as unknown as NodeViewImpl)[NODE];\n}\n\nconst found = new WeakMap<Node, Map<string, Node>>();\n\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\nexport function referenced(reader: Node, id: unknown): NodeView | null {\n if (typeof id !== \"string\" || id === \"\") return null;\n let known = found.get(reader);\n let node = known?.get(id);\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\n node = findIn(rootOf(reader), id) ?? undefined;\n if (!node) {\n known?.delete(id);\n return null;\n }\n if (!known) found.set(reader, known = new Map());\n known.set(id, node);\n }\n return nodeView(node, reader);\n}\n\nfunction rootOf(node: Node): Node {\n let at = node;\n while (at.parent) at = at.parent;\n return at;\n}\n\nfunction findIn(at: Node, id: string): Node | null {\n if (at.id === id) return at;\n for (const child of at._allChildren) {\n const hit = findIn(child, id);\n if (hit) return hit;\n }\n return null;\n}\n\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\n/** Set by the factory module, which owns the node descriptors. */\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\n keyOf = lookup;\n}\n\n// ---- state views ------------------------------------------------------------\n\n/**\n * One prototype of getters per component, so a node's `state` is a single\n * object made once: every read goes straight to the node's own slot, and a\n * frame allocates nothing to hand its fields their values.\n */\nexport interface ViewShape {\n readonly proto: object;\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\n readonly entries: PropertyDescriptorMap;\n}\n\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\n const entries: PropertyDescriptorMap = {};\n for (const key of keys) {\n entries[key] = references.has(key)\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\n : { get(this: { [NODE]: object }) { return (this[NODE] as Record<string, unknown>)[key]; }, enumerable: true };\n }\n const proto = {};\n // The children of the node's own tree, as its commands see them too.\n Object.defineProperty(proto, \"children\", {\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\n enumerable: false,\n });\n return { proto, entries };\n}\n\nexport function stateView(shape: ViewShape, node: object): object {\n const view = Object.create(shape.proto) as { [NODE]: object };\n Object.defineProperties(view, shape.entries);\n view[NODE] = node;\n return view;\n}\n\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\nexport function snapshot(view: object): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\n return out;\n}\n\n// ---- measurer and render context --------------------------------------------\n\nexport class MeasurerImpl implements Measurer {\n max: Max = {};\n scope: MeasureContext2D | null = null;\n\n constructor(readonly host: Node) { }\n\n get time(): Clock {\n return this.host.time;\n }\n\n text(text: string, font: FontSpec): Size2D {\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\n }\n}\n\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\nexport class RenderContextImpl implements RenderContext2D {\n pass: RenderPass2D | null = null;\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\n cut: Clip | null = null;\n\n /**\n * `probing`: `render` runs only to find the shape it paints (for clip and\n * picking outside a frame), so nothing is drawn and no child is visited.\n */\n constructor(readonly host: ComponentHost, readonly probing = false) { }\n\n get size(): Size2D {\n const box = this.host.layoutBounds;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n\n get time(): Clock {\n return this.host.time;\n }\n\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\n if (!graphics || this.probing) return;\n const out = this.target();\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\n else out.draw(graphics as Graphics2D);\n }\n\n children(): void {\n if (this.probing) return;\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\n if (!this.composite) this.host._record = null;\n this.host._renderOwnChildren(this.target());\n }\n\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\n composite: Composite | null = null;\n\n private _declare(composite: Composite): void {\n this.composite = { ...this.composite, ...composite };\n if (!this.probing) this.host._record = this.composite;\n }\n\n mask(options: MaskOptions): void {\n this._declare({ bounds: \"first\" });\n if (this.probing) return;\n const out = this.target();\n const [stencil, ...content] = this.host.children;\n if (!stencil) return;\n if (content.length === 0) {\n stencil.render(out);\n return;\n }\n out.beginMask({ mode: options.mode, inverted: options.inverted });\n stencil.render(out);\n out.applyMask();\n for (const child of content) child.render(out);\n out.endMask();\n }\n\n merge(op: BooleanOperation, paint: MergePaint): void {\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\n if (this.probing) return;\n const out = this.target();\n out.beginBoolean(op);\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\n out.endBoolean();\n // A drawing with no shape of its own paints the merged outline.\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\n out.draw(new GraphicsClass().stroke(paint.stroke));\n }\n\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\n camera(scope: CameraScope): void {\n this._declare({ camera: scope });\n if (this.probing) return;\n const out = this.target();\n const rect = this.host.layoutBounds;\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\n out.endCamera();\n }\n\n /** Your 3D children, rendered in order into a new scene. */\n scene3D(): Scene3D {\n const scene = new Scene3D();\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\n this._declare({ scene });\n return scene;\n }\n\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\n space(camera: SpaceCamera): void {\n this._declare({ space: camera });\n if (!this.probing) this.host._renderOwnChildren(this.target());\n }\n\n textStyle(style: TextStyle | null, body: () => void): void {\n if (this.probing) return body();\n const out = this.target();\n out.pushTextStyle(style);\n try {\n body();\n } finally {\n out.popTextStyle();\n }\n }\n\n clip(shape: Graphics2D, body: () => void): void {\n if (this.probing) return body();\n const outline = clipOf(shape);\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\n if (outline.isEmpty()) return body();\n const out = this.target();\n out.beginClip(outline);\n try {\n body();\n } finally {\n out.endClip();\n }\n }\n\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\n get inSpace(): boolean {\n for (let at = this.host.parent; at; at = at.parent) {\n if (!(at instanceof Node2DClass)) return false;\n if (at._spaceCamera()) return true;\n if (!at._rendersChildrenInSpace()) return false;\n }\n return false;\n }\n\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\n for (let at = this.host.parent; at; at = at.parent) {\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\n }\n return null;\n }\n\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\n inFront(body: () => void): void {\n if (this.probing) return;\n const out = this.target();\n if (!this.cut) {\n body();\n return;\n }\n out.beginClip(this.cut);\n try {\n body();\n } finally {\n out.endClip();\n }\n }\n\n target(): RenderPass2D {\n if (this.probing) return PROBE_PASS;\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\n return this.pass;\n }\n}\n\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\n\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\n return ctx;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"aim.js","sourceRoot":"","sources":["../../../src/components/modules/aim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEzE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC1D,MAAM,EAAE,KAAK,CAAC,MAAM,CAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IACnJ,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAA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C;AAED,SAAS,MAAM,CAAC,IAAU,EAAE,QAAc;IACtC,KAAK,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM;QAAE,IAAI,EAAE,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;IAChF,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { lerpVector2, type Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { Node2D } from \"@/components/trees/2d/node2d\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { RenderContext2D, Values } from \"@/components/factory/api\";\r\nimport { commandsFor } from \"@/components/factory/commands-for\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport { internalsOf, nodeOfNodeView } from \"@/components/factory/views\";\r\n\r\n/** Where a 2D camera looks: a point, a zoom and a heading, or a node below it to follow. */\r\nexport const state = {\r\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\r\n lookAt: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" } } }),\r\n heading: Types.number(0, { step: 1, unit: \"°\" }),\r\n follow: Types.nodeRef(),\r\n};\r\n\r\nexport const commands = commandsFor(state, {\r\n zoomTo: { args: [\"zoom\"] },\r\n panTo: { args: [\"lookAt\"] },\r\n headingTo: { args: [\"heading\"] },\r\n});\r\n\r\ntype AimState = Values<typeof state>;\r\n\r\n/** The point the camera centres on: `lookAt`, offset from the followed node when there is one below it. */\r\nexport function aim(ctx: RenderContext2D, s: AimState): Vector2 {\r\n const target = s.follow;\r\n if (!target) return s.lookAt;\r\n const node = nodeOfNodeView(target);\r\n if (!(node instanceof Node2D) || !within(node, internalsOf(ctx).host)) return s.lookAt;\r\n const at = target.frame;\r\n return { x: at.x + s.lookAt.x, y: at.y + s.lookAt.y };\r\n}\r\n\r\n/** The children, through this camera. */\r\nexport function camera(ctx: RenderContext2D, s: AimState): void {\r\n ctx.camera({ lookAt: aim(ctx, s), zoom: s.zoom, heading: s.heading });\r\n}\r\n\r\nfunction within(node: Node, ancestor: Node): boolean {\r\n for (let at = node.parent; at; at = at.parent) if (at === ancestor) return true;\r\n return false;\r\n}\r\n"]}
1
+ {"version":3,"file":"aim.js","sourceRoot":"","sources":["../../../src/components/modules/aim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEzE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC1D,MAAM,EAAE,KAAK,CAAC,MAAM,CAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IACnJ,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAChD,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE;IACvC,MAAM,EAA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OAAO,IAAI,CAAC;IAChF,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { lerpVector2, type Vector2 } from \"@/attributes/layout/vector2\";\nimport { Node2D } from \"@/components/trees/2d/node2d\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport type { RenderContext2D, Values } from \"@/components/factory/api\";\nimport { commandsFor } from \"@/components/factory/commands-for\";\nimport { Types } from \"@/components/factory/types\";\nimport { internalsOf, nodeOfNodeView } from \"@/components/factory/views\";\n\n/** Where a 2D camera looks: a point, a zoom and a heading, or a node below it to follow. */\nexport const state = {\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\n lookAt: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" } } }),\n heading: Types.number(0, { step: 1, unit: \"°\" }),\n follow: Types.nodeRef(),\n};\n\nexport const commands = commandsFor(state, {\n zoomTo: { args: [\"zoom\"] },\n panTo: { args: [\"lookAt\"] },\n headingTo: { args: [\"heading\"] },\n});\n\ntype AimState = Values<typeof state>;\n\n/** The point the camera centres on: `lookAt`, offset from the followed node when there is one below it. */\nexport function aim(ctx: RenderContext2D, s: AimState): Vector2 {\n const target = s.follow;\n if (!target) return s.lookAt;\n const node = nodeOfNodeView(target);\n if (!(node instanceof Node2D) || !within(node, internalsOf(ctx).host)) return s.lookAt;\n const at = target.frame;\n return { x: at.x + s.lookAt.x, y: at.y + s.lookAt.y };\n}\n\n/** The children, through this camera. */\nexport function camera(ctx: RenderContext2D, s: AimState): void {\n ctx.camera({ lookAt: aim(ctx, s), zoom: s.zoom, heading: s.heading });\n}\n\nfunction within(node: Node, ancestor: Node): boolean {\n for (let at = node.parent; at; at = at.parent) if (at === ancestor) return true;\n return false;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"corners.js","sourceRoot":"","sources":["../../../src/components/modules/corners.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAkB,MAAM,4BAA4B,CAAC;AAEnE,6HAA6H;AAC7H,MAAM,CAAC,MAAM,KAAK,GAAsI;IACpJ,YAAY,EAAE,KAAK,CAAC,YAAY;IAChC,WAAW,EAAE,KAAK,CAAC,WAAW;CACjC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,CAAuB;IACtD,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvI,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { CornerRadiusResolved, RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport type { CornerStyleResolved, RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { Values } from \"@/components/factory/api\";\r\nimport { Types, type Attribute } from \"@/components/factory/types\";\r\n\r\n// Typed out so the declarations name what the corners take by their own modules: a kit's emit reaches those through the sdk.\r\nexport const state: { cornerRadius: Attribute<RectCornerRadius, CornerRadiusResolved>; cornerStyle: Attribute<RectCornerStyle, CornerStyleResolved> } = {\r\n cornerRadius: Types.cornerRadius,\r\n cornerStyle: Types.cornerStyle,\r\n};\r\n\r\n/** A rectangle the size of the box, with these corners. */\r\nexport function rect(size: Size2D, s: Values<typeof state>): Graphics2D {\r\n return new Graphics2D().rect({ width: size.width, height: size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle });\r\n}\r\n"]}
1
+ {"version":3,"file":"corners.js","sourceRoot":"","sources":["../../../src/components/modules/corners.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAkB,MAAM,4BAA4B,CAAC;AAEnE,6HAA6H;AAC7H,MAAM,CAAC,MAAM,KAAK,GAAsI;IACpJ,YAAY,EAAE,KAAK,CAAC,YAAY;IAChC,WAAW,EAAE,KAAK,CAAC,WAAW;CACjC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,CAAuB;IACtD,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvI,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\nimport type { CornerRadiusResolved, RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport type { CornerStyleResolved, RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport type { Values } from \"@/components/factory/api\";\nimport { Types, type Attribute } from \"@/components/factory/types\";\n\n// Typed out so the declarations name what the corners take by their own modules: a kit's emit reaches those through the sdk.\nexport const state: { cornerRadius: Attribute<RectCornerRadius, CornerRadiusResolved>; cornerStyle: Attribute<RectCornerStyle, CornerStyleResolved> } = {\n cornerRadius: Types.cornerRadius,\n cornerStyle: Types.cornerStyle,\n};\n\n/** A rectangle the size of the box, with these corners. */\nexport function rect(size: Size2D, s: Values<typeof state>): Graphics2D {\n return new Graphics2D().rect({ width: size.width, height: size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle });\n}\n"]}