@motion-script/core 0.1.0

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 (782) hide show
  1. package/README.md +69 -0
  2. package/dist/assets/catalog.d.ts +83 -0
  3. package/dist/assets/catalog.d.ts.map +1 -0
  4. package/dist/assets/catalog.js +110 -0
  5. package/dist/assets/catalog.js.map +1 -0
  6. package/dist/assets/index.d.ts +5 -0
  7. package/dist/assets/index.d.ts.map +1 -0
  8. package/dist/assets/index.js +4 -0
  9. package/dist/assets/index.js.map +1 -0
  10. package/dist/assets/manager.d.ts +32 -0
  11. package/dist/assets/manager.d.ts.map +1 -0
  12. package/dist/assets/manager.js +108 -0
  13. package/dist/assets/manager.js.map +1 -0
  14. package/dist/assets/manager.test.d.ts +2 -0
  15. package/dist/assets/manager.test.d.ts.map +1 -0
  16. package/dist/assets/manager.test.js +133 -0
  17. package/dist/assets/manager.test.js.map +1 -0
  18. package/dist/assets/manifest.d.ts +38 -0
  19. package/dist/assets/manifest.d.ts.map +1 -0
  20. package/dist/assets/manifest.js +2 -0
  21. package/dist/assets/manifest.js.map +1 -0
  22. package/dist/assets/record.d.ts +40 -0
  23. package/dist/assets/record.d.ts.map +1 -0
  24. package/dist/assets/record.js +2 -0
  25. package/dist/assets/record.js.map +1 -0
  26. package/dist/assets/tracker.d.ts +69 -0
  27. package/dist/assets/tracker.d.ts.map +1 -0
  28. package/dist/assets/tracker.js +178 -0
  29. package/dist/assets/tracker.js.map +1 -0
  30. package/dist/attributes/audio/request.d.ts +21 -0
  31. package/dist/attributes/audio/request.d.ts.map +1 -0
  32. package/dist/attributes/audio/request.js +2 -0
  33. package/dist/attributes/audio/request.js.map +1 -0
  34. package/dist/attributes/audio/sound.d.ts +83 -0
  35. package/dist/attributes/audio/sound.d.ts.map +1 -0
  36. package/dist/attributes/audio/sound.js +106 -0
  37. package/dist/attributes/audio/sound.js.map +1 -0
  38. package/dist/attributes/index.d.ts +18 -0
  39. package/dist/attributes/index.d.ts.map +1 -0
  40. package/dist/attributes/index.js +17 -0
  41. package/dist/attributes/index.js.map +1 -0
  42. package/dist/attributes/layout/bounds.d.ts +12 -0
  43. package/dist/attributes/layout/bounds.d.ts.map +1 -0
  44. package/dist/attributes/layout/bounds.js +2 -0
  45. package/dist/attributes/layout/bounds.js.map +1 -0
  46. package/dist/attributes/layout/constraints.d.ts +6 -0
  47. package/dist/attributes/layout/constraints.d.ts.map +1 -0
  48. package/dist/attributes/layout/constraints.js +2 -0
  49. package/dist/attributes/layout/constraints.js.map +1 -0
  50. package/dist/attributes/layout/index.d.ts +6 -0
  51. package/dist/attributes/layout/index.d.ts.map +1 -0
  52. package/dist/attributes/layout/index.js +2 -0
  53. package/dist/attributes/layout/index.js.map +1 -0
  54. package/dist/attributes/layout/padding.d.ts +26 -0
  55. package/dist/attributes/layout/padding.d.ts.map +1 -0
  56. package/dist/attributes/layout/padding.js +17 -0
  57. package/dist/attributes/layout/padding.js.map +1 -0
  58. package/dist/attributes/layout/padding.test.d.ts +2 -0
  59. package/dist/attributes/layout/padding.test.d.ts.map +1 -0
  60. package/dist/attributes/layout/padding.test.js +32 -0
  61. package/dist/attributes/layout/padding.test.js.map +1 -0
  62. package/dist/attributes/layout/size.d.ts +14 -0
  63. package/dist/attributes/layout/size.d.ts.map +1 -0
  64. package/dist/attributes/layout/size.js +2 -0
  65. package/dist/attributes/layout/size.js.map +1 -0
  66. package/dist/attributes/layout/vector2.d.ts +8 -0
  67. package/dist/attributes/layout/vector2.d.ts.map +1 -0
  68. package/dist/attributes/layout/vector2.js +8 -0
  69. package/dist/attributes/layout/vector2.js.map +1 -0
  70. package/dist/attributes/layout/vector2.test.d.ts +2 -0
  71. package/dist/attributes/layout/vector2.test.d.ts.map +1 -0
  72. package/dist/attributes/layout/vector2.test.js +23 -0
  73. package/dist/attributes/layout/vector2.test.js.map +1 -0
  74. package/dist/attributes/mask/boolean.d.ts +2 -0
  75. package/dist/attributes/mask/boolean.d.ts.map +1 -0
  76. package/dist/attributes/mask/boolean.js +2 -0
  77. package/dist/attributes/mask/boolean.js.map +1 -0
  78. package/dist/attributes/mask/mask.d.ts +9 -0
  79. package/dist/attributes/mask/mask.d.ts.map +1 -0
  80. package/dist/attributes/mask/mask.js +2 -0
  81. package/dist/attributes/mask/mask.js.map +1 -0
  82. package/dist/attributes/properties/decorator.d.ts +45 -0
  83. package/dist/attributes/properties/decorator.d.ts.map +1 -0
  84. package/dist/attributes/properties/decorator.js +72 -0
  85. package/dist/attributes/properties/decorator.js.map +1 -0
  86. package/dist/attributes/properties/decorator.test.d.ts +2 -0
  87. package/dist/attributes/properties/decorator.test.d.ts.map +1 -0
  88. package/dist/attributes/properties/decorator.test.js +52 -0
  89. package/dist/attributes/properties/decorator.test.js.map +1 -0
  90. package/dist/attributes/shape/corners/border-radius.d.ts +32 -0
  91. package/dist/attributes/shape/corners/border-radius.d.ts.map +1 -0
  92. package/dist/attributes/shape/corners/border-radius.js +50 -0
  93. package/dist/attributes/shape/corners/border-radius.js.map +1 -0
  94. package/dist/attributes/shape/corners/border-radius.test.d.ts +2 -0
  95. package/dist/attributes/shape/corners/border-radius.test.d.ts.map +1 -0
  96. package/dist/attributes/shape/corners/border-radius.test.js +52 -0
  97. package/dist/attributes/shape/corners/border-radius.test.js.map +1 -0
  98. package/dist/attributes/shape/corners/index.d.ts +2 -0
  99. package/dist/attributes/shape/corners/index.d.ts.map +1 -0
  100. package/dist/attributes/shape/corners/index.js +2 -0
  101. package/dist/attributes/shape/corners/index.js.map +1 -0
  102. package/dist/attributes/shape/effects/chain.d.ts +145 -0
  103. package/dist/attributes/shape/effects/chain.d.ts.map +1 -0
  104. package/dist/attributes/shape/effects/chain.js +163 -0
  105. package/dist/attributes/shape/effects/chain.js.map +1 -0
  106. package/dist/attributes/shape/effects/chain.test.d.ts +2 -0
  107. package/dist/attributes/shape/effects/chain.test.d.ts.map +1 -0
  108. package/dist/attributes/shape/effects/chain.test.js +63 -0
  109. package/dist/attributes/shape/effects/chain.test.js.map +1 -0
  110. package/dist/attributes/shape/effects/effect-data.d.ts +18 -0
  111. package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -0
  112. package/dist/attributes/shape/effects/effect-data.js +2 -0
  113. package/dist/attributes/shape/effects/effect-data.js.map +1 -0
  114. package/dist/attributes/shape/effects/implementations/background-blur.d.ts +13 -0
  115. package/dist/attributes/shape/effects/implementations/background-blur.d.ts.map +1 -0
  116. package/dist/attributes/shape/effects/implementations/background-blur.js +6 -0
  117. package/dist/attributes/shape/effects/implementations/background-blur.js.map +1 -0
  118. package/dist/attributes/shape/effects/implementations/bloom.d.ts +12 -0
  119. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -0
  120. package/dist/attributes/shape/effects/implementations/bloom.js +11 -0
  121. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -0
  122. package/dist/attributes/shape/effects/implementations/blur.d.ts +7 -0
  123. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -0
  124. package/dist/attributes/shape/effects/implementations/blur.js +6 -0
  125. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -0
  126. package/dist/attributes/shape/effects/implementations/bulge-pinch.d.ts +13 -0
  127. package/dist/attributes/shape/effects/implementations/bulge-pinch.d.ts.map +1 -0
  128. package/dist/attributes/shape/effects/implementations/bulge-pinch.js +15 -0
  129. package/dist/attributes/shape/effects/implementations/bulge-pinch.js.map +1 -0
  130. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +10 -0
  131. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -0
  132. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +10 -0
  133. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -0
  134. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +7 -0
  135. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -0
  136. package/dist/attributes/shape/effects/implementations/grayscale.js +6 -0
  137. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -0
  138. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +8 -0
  139. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -0
  140. package/dist/attributes/shape/effects/implementations/pixelate.js +10 -0
  141. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -0
  142. package/dist/attributes/shape/effects/implementations/sksl.d.ts +39 -0
  143. package/dist/attributes/shape/effects/implementations/sksl.d.ts.map +1 -0
  144. package/dist/attributes/shape/effects/implementations/sksl.js +48 -0
  145. package/dist/attributes/shape/effects/implementations/sksl.js.map +1 -0
  146. package/dist/attributes/shape/effects/implementations/texture.d.ts +9 -0
  147. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +1 -0
  148. package/dist/attributes/shape/effects/implementations/texture.js +11 -0
  149. package/dist/attributes/shape/effects/implementations/texture.js.map +1 -0
  150. package/dist/attributes/shape/effects/implementations/vintage.d.ts +10 -0
  151. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -0
  152. package/dist/attributes/shape/effects/implementations/vintage.js +10 -0
  153. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -0
  154. package/dist/attributes/shape/effects/implementations/zoom.d.ts +14 -0
  155. package/dist/attributes/shape/effects/implementations/zoom.d.ts.map +1 -0
  156. package/dist/attributes/shape/effects/implementations/zoom.js +13 -0
  157. package/dist/attributes/shape/effects/implementations/zoom.js.map +1 -0
  158. package/dist/attributes/shape/effects/index.d.ts +19 -0
  159. package/dist/attributes/shape/effects/index.d.ts.map +1 -0
  160. package/dist/attributes/shape/effects/index.js +4 -0
  161. package/dist/attributes/shape/effects/index.js.map +1 -0
  162. package/dist/attributes/shape/effects/registry.d.ts +4 -0
  163. package/dist/attributes/shape/effects/registry.d.ts.map +1 -0
  164. package/dist/attributes/shape/effects/registry.js +51 -0
  165. package/dist/attributes/shape/effects/registry.js.map +1 -0
  166. package/dist/attributes/shape/effects/union.d.ts +14 -0
  167. package/dist/attributes/shape/effects/union.d.ts.map +1 -0
  168. package/dist/attributes/shape/effects/union.js +2 -0
  169. package/dist/attributes/shape/effects/union.js.map +1 -0
  170. package/dist/attributes/shape/fill/blend.d.ts +13 -0
  171. package/dist/attributes/shape/fill/blend.d.ts.map +1 -0
  172. package/dist/attributes/shape/fill/blend.js +32 -0
  173. package/dist/attributes/shape/fill/blend.js.map +1 -0
  174. package/dist/attributes/shape/fill/blend.test.d.ts +2 -0
  175. package/dist/attributes/shape/fill/blend.test.d.ts.map +1 -0
  176. package/dist/attributes/shape/fill/blend.test.js +18 -0
  177. package/dist/attributes/shape/fill/blend.test.js.map +1 -0
  178. package/dist/attributes/shape/fill/chain.d.ts +127 -0
  179. package/dist/attributes/shape/fill/chain.d.ts.map +1 -0
  180. package/dist/attributes/shape/fill/chain.js +116 -0
  181. package/dist/attributes/shape/fill/chain.js.map +1 -0
  182. package/dist/attributes/shape/fill/chain.test.d.ts +2 -0
  183. package/dist/attributes/shape/fill/chain.test.d.ts.map +1 -0
  184. package/dist/attributes/shape/fill/chain.test.js +92 -0
  185. package/dist/attributes/shape/fill/chain.test.js.map +1 -0
  186. package/dist/attributes/shape/fill/color/constants.d.ts +13 -0
  187. package/dist/attributes/shape/fill/color/constants.d.ts.map +1 -0
  188. package/dist/attributes/shape/fill/color/constants.js +162 -0
  189. package/dist/attributes/shape/fill/color/constants.js.map +1 -0
  190. package/dist/attributes/shape/fill/color/parser.d.ts +39 -0
  191. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -0
  192. package/dist/attributes/shape/fill/color/parser.js +212 -0
  193. package/dist/attributes/shape/fill/color/parser.js.map +1 -0
  194. package/dist/attributes/shape/fill/color/parser.test.d.ts +2 -0
  195. package/dist/attributes/shape/fill/color/parser.test.d.ts.map +1 -0
  196. package/dist/attributes/shape/fill/color/parser.test.js +99 -0
  197. package/dist/attributes/shape/fill/color/parser.test.js.map +1 -0
  198. package/dist/attributes/shape/fill/implementations/color.d.ts +17 -0
  199. package/dist/attributes/shape/fill/implementations/color.d.ts.map +1 -0
  200. package/dist/attributes/shape/fill/implementations/color.js +24 -0
  201. package/dist/attributes/shape/fill/implementations/color.js.map +1 -0
  202. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts +24 -0
  203. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -0
  204. package/dist/attributes/shape/fill/implementations/conic-gradient.js +33 -0
  205. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -0
  206. package/dist/attributes/shape/fill/implementations/image.d.ts +27 -0
  207. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -0
  208. package/dist/attributes/shape/fill/implementations/image.js +16 -0
  209. package/dist/attributes/shape/fill/implementations/image.js.map +1 -0
  210. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts +24 -0
  211. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -0
  212. package/dist/attributes/shape/fill/implementations/linear-gradient.js +33 -0
  213. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -0
  214. package/dist/attributes/shape/fill/implementations/noise.d.ts +22 -0
  215. package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -0
  216. package/dist/attributes/shape/fill/implementations/noise.js +35 -0
  217. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -0
  218. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts +24 -0
  219. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -0
  220. package/dist/attributes/shape/fill/implementations/radial-gradient.js +33 -0
  221. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -0
  222. package/dist/attributes/shape/fill/implementations/stripe.d.ts +23 -0
  223. package/dist/attributes/shape/fill/implementations/stripe.d.ts.map +1 -0
  224. package/dist/attributes/shape/fill/implementations/stripe.js +36 -0
  225. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -0
  226. package/dist/attributes/shape/fill/implementations/video.d.ts +41 -0
  227. package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -0
  228. package/dist/attributes/shape/fill/implementations/video.js +51 -0
  229. package/dist/attributes/shape/fill/implementations/video.js.map +1 -0
  230. package/dist/attributes/shape/fill/index.d.ts +18 -0
  231. package/dist/attributes/shape/fill/index.d.ts.map +1 -0
  232. package/dist/attributes/shape/fill/index.js +5 -0
  233. package/dist/attributes/shape/fill/index.js.map +1 -0
  234. package/dist/attributes/shape/fill/lerp.d.ts +11 -0
  235. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -0
  236. package/dist/attributes/shape/fill/lerp.js +17 -0
  237. package/dist/attributes/shape/fill/lerp.js.map +1 -0
  238. package/dist/attributes/shape/fill/lerp.test.d.ts +2 -0
  239. package/dist/attributes/shape/fill/lerp.test.d.ts.map +1 -0
  240. package/dist/attributes/shape/fill/lerp.test.js +18 -0
  241. package/dist/attributes/shape/fill/lerp.test.js.map +1 -0
  242. package/dist/attributes/shape/fill/registry.d.ts +28 -0
  243. package/dist/attributes/shape/fill/registry.d.ts.map +1 -0
  244. package/dist/attributes/shape/fill/registry.js +83 -0
  245. package/dist/attributes/shape/fill/registry.js.map +1 -0
  246. package/dist/attributes/shape/fill/union.d.ts +50 -0
  247. package/dist/attributes/shape/fill/union.d.ts.map +1 -0
  248. package/dist/attributes/shape/fill/union.js +11 -0
  249. package/dist/attributes/shape/fill/union.js.map +1 -0
  250. package/dist/attributes/shape/filters/chain.d.ts +65 -0
  251. package/dist/attributes/shape/filters/chain.d.ts.map +1 -0
  252. package/dist/attributes/shape/filters/chain.js +83 -0
  253. package/dist/attributes/shape/filters/chain.js.map +1 -0
  254. package/dist/attributes/shape/filters/chain.test.d.ts +2 -0
  255. package/dist/attributes/shape/filters/chain.test.d.ts.map +1 -0
  256. package/dist/attributes/shape/filters/chain.test.js +49 -0
  257. package/dist/attributes/shape/filters/chain.test.js.map +1 -0
  258. package/dist/attributes/shape/filters/implementations/alpha.d.ts +7 -0
  259. package/dist/attributes/shape/filters/implementations/alpha.d.ts.map +1 -0
  260. package/dist/attributes/shape/filters/implementations/alpha.js +7 -0
  261. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -0
  262. package/dist/attributes/shape/filters/implementations/blur.d.ts +7 -0
  263. package/dist/attributes/shape/filters/implementations/blur.d.ts.map +1 -0
  264. package/dist/attributes/shape/filters/implementations/blur.js +7 -0
  265. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -0
  266. package/dist/attributes/shape/filters/implementations/color-adjustment.d.ts +26 -0
  267. package/dist/attributes/shape/filters/implementations/color-adjustment.d.ts.map +1 -0
  268. package/dist/attributes/shape/filters/implementations/color-adjustment.js +26 -0
  269. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -0
  270. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +13 -0
  271. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -0
  272. package/dist/attributes/shape/filters/implementations/color-matrix.js +12 -0
  273. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -0
  274. package/dist/attributes/shape/filters/implementations/curves.d.ts +17 -0
  275. package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -0
  276. package/dist/attributes/shape/filters/implementations/curves.js +18 -0
  277. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -0
  278. package/dist/attributes/shape/filters/implementations/exposure.d.ts +7 -0
  279. package/dist/attributes/shape/filters/implementations/exposure.d.ts.map +1 -0
  280. package/dist/attributes/shape/filters/implementations/exposure.js +7 -0
  281. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -0
  282. package/dist/attributes/shape/filters/implementations/grayscale.d.ts +7 -0
  283. package/dist/attributes/shape/filters/implementations/grayscale.d.ts.map +1 -0
  284. package/dist/attributes/shape/filters/implementations/grayscale.js +7 -0
  285. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -0
  286. package/dist/attributes/shape/filters/index.d.ts +16 -0
  287. package/dist/attributes/shape/filters/index.d.ts.map +1 -0
  288. package/dist/attributes/shape/filters/index.js +5 -0
  289. package/dist/attributes/shape/filters/index.js.map +1 -0
  290. package/dist/attributes/shape/filters/registry.d.ts +37 -0
  291. package/dist/attributes/shape/filters/registry.d.ts.map +1 -0
  292. package/dist/attributes/shape/filters/registry.js +60 -0
  293. package/dist/attributes/shape/filters/registry.js.map +1 -0
  294. package/dist/attributes/shape/filters/registry.test.d.ts +5 -0
  295. package/dist/attributes/shape/filters/registry.test.d.ts.map +1 -0
  296. package/dist/attributes/shape/filters/registry.test.js +75 -0
  297. package/dist/attributes/shape/filters/registry.test.js.map +1 -0
  298. package/dist/attributes/shape/filters/union.d.ts +10 -0
  299. package/dist/attributes/shape/filters/union.d.ts.map +1 -0
  300. package/dist/attributes/shape/filters/union.js +2 -0
  301. package/dist/attributes/shape/filters/union.js.map +1 -0
  302. package/dist/attributes/shape/path/bezier.d.ts +28 -0
  303. package/dist/attributes/shape/path/bezier.d.ts.map +1 -0
  304. package/dist/attributes/shape/path/bezier.js +76 -0
  305. package/dist/attributes/shape/path/bezier.js.map +1 -0
  306. package/dist/attributes/shape/path/bezier.test.d.ts +2 -0
  307. package/dist/attributes/shape/path/bezier.test.d.ts.map +1 -0
  308. package/dist/attributes/shape/path/bezier.test.js +85 -0
  309. package/dist/attributes/shape/path/bezier.test.js.map +1 -0
  310. package/dist/attributes/shape/path/dash.d.ts +15 -0
  311. package/dist/attributes/shape/path/dash.d.ts.map +1 -0
  312. package/dist/attributes/shape/path/dash.js +299 -0
  313. package/dist/attributes/shape/path/dash.js.map +1 -0
  314. package/dist/attributes/shape/path/dash.test.d.ts +2 -0
  315. package/dist/attributes/shape/path/dash.test.d.ts.map +1 -0
  316. package/dist/attributes/shape/path/dash.test.js +36 -0
  317. package/dist/attributes/shape/path/dash.test.js.map +1 -0
  318. package/dist/attributes/shape/path/index.d.ts +5 -0
  319. package/dist/attributes/shape/path/index.d.ts.map +1 -0
  320. package/dist/attributes/shape/path/index.js +5 -0
  321. package/dist/attributes/shape/path/index.js.map +1 -0
  322. package/dist/attributes/shape/path/length.d.ts +14 -0
  323. package/dist/attributes/shape/path/length.d.ts.map +1 -0
  324. package/dist/attributes/shape/path/length.js +169 -0
  325. package/dist/attributes/shape/path/length.js.map +1 -0
  326. package/dist/attributes/shape/path/length.test.d.ts +2 -0
  327. package/dist/attributes/shape/path/length.test.d.ts.map +1 -0
  328. package/dist/attributes/shape/path/length.test.js +56 -0
  329. package/dist/attributes/shape/path/length.test.js.map +1 -0
  330. package/dist/attributes/shape/path/subpath.d.ts +15 -0
  331. package/dist/attributes/shape/path/subpath.d.ts.map +1 -0
  332. package/dist/attributes/shape/path/subpath.js +486 -0
  333. package/dist/attributes/shape/path/subpath.js.map +1 -0
  334. package/dist/attributes/shape/path/subpath.test.d.ts +2 -0
  335. package/dist/attributes/shape/path/subpath.test.d.ts.map +1 -0
  336. package/dist/attributes/shape/path/subpath.test.js +54 -0
  337. package/dist/attributes/shape/path/subpath.test.js.map +1 -0
  338. package/dist/attributes/shape/shadow/index.d.ts +5 -0
  339. package/dist/attributes/shape/shadow/index.d.ts.map +1 -0
  340. package/dist/attributes/shape/shadow/index.js +3 -0
  341. package/dist/attributes/shape/shadow/index.js.map +1 -0
  342. package/dist/attributes/shape/shadow/lerp.d.ts +3 -0
  343. package/dist/attributes/shape/shadow/lerp.d.ts.map +1 -0
  344. package/dist/attributes/shape/shadow/lerp.js +30 -0
  345. package/dist/attributes/shape/shadow/lerp.js.map +1 -0
  346. package/dist/attributes/shape/shadow/resolver.d.ts +22 -0
  347. package/dist/attributes/shape/shadow/resolver.d.ts.map +1 -0
  348. package/dist/attributes/shape/shadow/resolver.js +17 -0
  349. package/dist/attributes/shape/shadow/resolver.js.map +1 -0
  350. package/dist/attributes/shape/stroke/index.d.ts +5 -0
  351. package/dist/attributes/shape/stroke/index.d.ts.map +1 -0
  352. package/dist/attributes/shape/stroke/index.js +3 -0
  353. package/dist/attributes/shape/stroke/index.js.map +1 -0
  354. package/dist/attributes/shape/stroke/lerp.d.ts +3 -0
  355. package/dist/attributes/shape/stroke/lerp.d.ts.map +1 -0
  356. package/dist/attributes/shape/stroke/lerp.js +30 -0
  357. package/dist/attributes/shape/stroke/lerp.js.map +1 -0
  358. package/dist/attributes/shape/stroke/mapper.d.ts +24 -0
  359. package/dist/attributes/shape/stroke/mapper.d.ts.map +1 -0
  360. package/dist/attributes/shape/stroke/mapper.js +25 -0
  361. package/dist/attributes/shape/stroke/mapper.js.map +1 -0
  362. package/dist/attributes/text/align.d.ts +2 -0
  363. package/dist/attributes/text/align.d.ts.map +1 -0
  364. package/dist/attributes/text/align.js +2 -0
  365. package/dist/attributes/text/align.js.map +1 -0
  366. package/dist/attributes/text/lerp.d.ts +8 -0
  367. package/dist/attributes/text/lerp.d.ts.map +1 -0
  368. package/dist/attributes/text/lerp.js +38 -0
  369. package/dist/attributes/text/lerp.js.map +1 -0
  370. package/dist/attributes/text/lerp.test.d.ts +2 -0
  371. package/dist/attributes/text/lerp.test.d.ts.map +1 -0
  372. package/dist/attributes/text/lerp.test.js +39 -0
  373. package/dist/attributes/text/lerp.test.js.map +1 -0
  374. package/dist/attributes/text/span.d.ts +37 -0
  375. package/dist/attributes/text/span.d.ts.map +1 -0
  376. package/dist/attributes/text/span.js +2 -0
  377. package/dist/attributes/text/span.js.map +1 -0
  378. package/dist/index.d.ts +14 -0
  379. package/dist/index.d.ts.map +1 -0
  380. package/dist/index.js +14 -0
  381. package/dist/index.js.map +1 -0
  382. package/dist/jsx/jsx-dev-runtime.d.ts +19 -0
  383. package/dist/jsx/jsx-dev-runtime.d.ts.map +1 -0
  384. package/dist/jsx/jsx-dev-runtime.js +16 -0
  385. package/dist/jsx/jsx-dev-runtime.js.map +1 -0
  386. package/dist/jsx/jsx-runtime.d.ts +19 -0
  387. package/dist/jsx/jsx-runtime.d.ts.map +1 -0
  388. package/dist/jsx/jsx-runtime.js +16 -0
  389. package/dist/jsx/jsx-runtime.js.map +1 -0
  390. package/dist/layout/flex.d.ts +66 -0
  391. package/dist/layout/flex.d.ts.map +1 -0
  392. package/dist/layout/flex.js +196 -0
  393. package/dist/layout/flex.js.map +1 -0
  394. package/dist/layout/flex.test.d.ts +2 -0
  395. package/dist/layout/flex.test.d.ts.map +1 -0
  396. package/dist/layout/flex.test.js +336 -0
  397. package/dist/layout/flex.test.js.map +1 -0
  398. package/dist/layout/grid.d.ts +38 -0
  399. package/dist/layout/grid.d.ts.map +1 -0
  400. package/dist/layout/grid.js +117 -0
  401. package/dist/layout/grid.js.map +1 -0
  402. package/dist/layout/index.d.ts +6 -0
  403. package/dist/layout/index.d.ts.map +1 -0
  404. package/dist/layout/index.js +6 -0
  405. package/dist/layout/index.js.map +1 -0
  406. package/dist/layout/padding.d.ts +19 -0
  407. package/dist/layout/padding.d.ts.map +1 -0
  408. package/dist/layout/padding.js +16 -0
  409. package/dist/layout/padding.js.map +1 -0
  410. package/dist/layout/padding.test.d.ts +2 -0
  411. package/dist/layout/padding.test.d.ts.map +1 -0
  412. package/dist/layout/padding.test.js +39 -0
  413. package/dist/layout/padding.test.js.map +1 -0
  414. package/dist/layout/size-resolver.d.ts +13 -0
  415. package/dist/layout/size-resolver.d.ts.map +1 -0
  416. package/dist/layout/size-resolver.js +22 -0
  417. package/dist/layout/size-resolver.js.map +1 -0
  418. package/dist/layout/size-resolver.test.d.ts +2 -0
  419. package/dist/layout/size-resolver.test.d.ts.map +1 -0
  420. package/dist/layout/size-resolver.test.js +24 -0
  421. package/dist/layout/size-resolver.test.js.map +1 -0
  422. package/dist/layout/tweens.d.ts +5 -0
  423. package/dist/layout/tweens.d.ts.map +1 -0
  424. package/dist/layout/tweens.js +16 -0
  425. package/dist/layout/tweens.js.map +1 -0
  426. package/dist/layout/tweens.test.d.ts +2 -0
  427. package/dist/layout/tweens.test.d.ts.map +1 -0
  428. package/dist/layout/tweens.test.js +26 -0
  429. package/dist/layout/tweens.test.js.map +1 -0
  430. package/dist/nodes/base/boolean-node.d.ts +14 -0
  431. package/dist/nodes/base/boolean-node.d.ts.map +1 -0
  432. package/dist/nodes/base/boolean-node.js +34 -0
  433. package/dist/nodes/base/boolean-node.js.map +1 -0
  434. package/dist/nodes/base/camera-node.d.ts +27 -0
  435. package/dist/nodes/base/camera-node.d.ts.map +1 -0
  436. package/dist/nodes/base/camera-node.js +31 -0
  437. package/dist/nodes/base/camera-node.js.map +1 -0
  438. package/dist/nodes/base/mask-node.d.ts +14 -0
  439. package/dist/nodes/base/mask-node.d.ts.map +1 -0
  440. package/dist/nodes/base/mask-node.js +37 -0
  441. package/dist/nodes/base/mask-node.js.map +1 -0
  442. package/dist/nodes/base/node.d.ts +284 -0
  443. package/dist/nodes/base/node.d.ts.map +1 -0
  444. package/dist/nodes/base/node.js +800 -0
  445. package/dist/nodes/base/node.js.map +1 -0
  446. package/dist/nodes/base/scene-node.d.ts +45 -0
  447. package/dist/nodes/base/scene-node.d.ts.map +1 -0
  448. package/dist/nodes/base/scene-node.js +122 -0
  449. package/dist/nodes/base/scene-node.js.map +1 -0
  450. package/dist/nodes/geometry/ellipse-node.d.ts +18 -0
  451. package/dist/nodes/geometry/ellipse-node.d.ts.map +1 -0
  452. package/dist/nodes/geometry/ellipse-node.js +55 -0
  453. package/dist/nodes/geometry/ellipse-node.js.map +1 -0
  454. package/dist/nodes/geometry/grid-node.d.ts +40 -0
  455. package/dist/nodes/geometry/grid-node.d.ts.map +1 -0
  456. package/dist/nodes/geometry/grid-node.js +138 -0
  457. package/dist/nodes/geometry/grid-node.js.map +1 -0
  458. package/dist/nodes/geometry/line-node.d.ts +17 -0
  459. package/dist/nodes/geometry/line-node.d.ts.map +1 -0
  460. package/dist/nodes/geometry/line-node.js +34 -0
  461. package/dist/nodes/geometry/line-node.js.map +1 -0
  462. package/dist/nodes/geometry/path-node.d.ts +17 -0
  463. package/dist/nodes/geometry/path-node.d.ts.map +1 -0
  464. package/dist/nodes/geometry/path-node.js +230 -0
  465. package/dist/nodes/geometry/path-node.js.map +1 -0
  466. package/dist/nodes/geometry/polygon-node.d.ts +20 -0
  467. package/dist/nodes/geometry/polygon-node.d.ts.map +1 -0
  468. package/dist/nodes/geometry/polygon-node.js +42 -0
  469. package/dist/nodes/geometry/polygon-node.js.map +1 -0
  470. package/dist/nodes/geometry/polygram-node.d.ts +27 -0
  471. package/dist/nodes/geometry/polygram-node.d.ts.map +1 -0
  472. package/dist/nodes/geometry/polygram-node.js +47 -0
  473. package/dist/nodes/geometry/polygram-node.js.map +1 -0
  474. package/dist/nodes/geometry/rect-node.d.ts +50 -0
  475. package/dist/nodes/geometry/rect-node.d.ts.map +1 -0
  476. package/dist/nodes/geometry/rect-node.js +275 -0
  477. package/dist/nodes/geometry/rect-node.js.map +1 -0
  478. package/dist/nodes/geometry/shape-node.d.ts +66 -0
  479. package/dist/nodes/geometry/shape-node.d.ts.map +1 -0
  480. package/dist/nodes/geometry/shape-node.js +127 -0
  481. package/dist/nodes/geometry/shape-node.js.map +1 -0
  482. package/dist/nodes/index.d.ts +17 -0
  483. package/dist/nodes/index.d.ts.map +1 -0
  484. package/dist/nodes/index.js +20 -0
  485. package/dist/nodes/index.js.map +1 -0
  486. package/dist/nodes/media/image-node.d.ts +28 -0
  487. package/dist/nodes/media/image-node.d.ts.map +1 -0
  488. package/dist/nodes/media/image-node.js +53 -0
  489. package/dist/nodes/media/image-node.js.map +1 -0
  490. package/dist/nodes/text/richtext-node.d.ts +46 -0
  491. package/dist/nodes/text/richtext-node.d.ts.map +1 -0
  492. package/dist/nodes/text/richtext-node.js +155 -0
  493. package/dist/nodes/text/richtext-node.js.map +1 -0
  494. package/dist/nodes/text/text-node.d.ts +42 -0
  495. package/dist/nodes/text/text-node.d.ts.map +1 -0
  496. package/dist/nodes/text/text-node.js +123 -0
  497. package/dist/nodes/text/text-node.js.map +1 -0
  498. package/dist/platform/audio-device.d.ts +40 -0
  499. package/dist/platform/audio-device.d.ts.map +1 -0
  500. package/dist/platform/audio-device.js +19 -0
  501. package/dist/platform/audio-device.js.map +1 -0
  502. package/dist/platform/index.d.ts +4 -0
  503. package/dist/platform/index.d.ts.map +1 -0
  504. package/dist/platform/index.js +4 -0
  505. package/dist/platform/index.js.map +1 -0
  506. package/dist/platform/master-clock.d.ts +54 -0
  507. package/dist/platform/master-clock.d.ts.map +1 -0
  508. package/dist/platform/master-clock.js +85 -0
  509. package/dist/platform/master-clock.js.map +1 -0
  510. package/dist/platform/storage-adapter.d.ts +29 -0
  511. package/dist/platform/storage-adapter.d.ts.map +1 -0
  512. package/dist/platform/storage-adapter.js +70 -0
  513. package/dist/platform/storage-adapter.js.map +1 -0
  514. package/dist/project/config.d.ts +24 -0
  515. package/dist/project/config.d.ts.map +1 -0
  516. package/dist/project/config.js +14 -0
  517. package/dist/project/config.js.map +1 -0
  518. package/dist/project/config.test.d.ts +2 -0
  519. package/dist/project/config.test.d.ts.map +1 -0
  520. package/dist/project/config.test.js +28 -0
  521. package/dist/project/config.test.js.map +1 -0
  522. package/dist/project/index.d.ts +3 -0
  523. package/dist/project/index.d.ts.map +1 -0
  524. package/dist/project/index.js +3 -0
  525. package/dist/project/index.js.map +1 -0
  526. package/dist/project/tree.d.ts +48 -0
  527. package/dist/project/tree.d.ts.map +1 -0
  528. package/dist/project/tree.js +11 -0
  529. package/dist/project/tree.js.map +1 -0
  530. package/dist/render/build-stage.d.ts +63 -0
  531. package/dist/render/build-stage.d.ts.map +1 -0
  532. package/dist/render/build-stage.js +91 -0
  533. package/dist/render/build-stage.js.map +1 -0
  534. package/dist/render/descriptors/ellipse.d.ts +10 -0
  535. package/dist/render/descriptors/ellipse.d.ts.map +1 -0
  536. package/dist/render/descriptors/ellipse.js +20 -0
  537. package/dist/render/descriptors/ellipse.js.map +1 -0
  538. package/dist/render/descriptors/image.d.ts +12 -0
  539. package/dist/render/descriptors/image.d.ts.map +1 -0
  540. package/dist/render/descriptors/image.js +12 -0
  541. package/dist/render/descriptors/image.js.map +1 -0
  542. package/dist/render/descriptors/latex.d.ts +6 -0
  543. package/dist/render/descriptors/latex.d.ts.map +1 -0
  544. package/dist/render/descriptors/latex.js +2 -0
  545. package/dist/render/descriptors/latex.js.map +1 -0
  546. package/dist/render/descriptors/line.d.ts +9 -0
  547. package/dist/render/descriptors/line.d.ts.map +1 -0
  548. package/dist/render/descriptors/line.js +19 -0
  549. package/dist/render/descriptors/line.js.map +1 -0
  550. package/dist/render/descriptors/path-builder.d.ts +14 -0
  551. package/dist/render/descriptors/path-builder.d.ts.map +1 -0
  552. package/dist/render/descriptors/path-builder.js +34 -0
  553. package/dist/render/descriptors/path-builder.js.map +1 -0
  554. package/dist/render/descriptors/path.d.ts +105 -0
  555. package/dist/render/descriptors/path.d.ts.map +1 -0
  556. package/dist/render/descriptors/path.js +45 -0
  557. package/dist/render/descriptors/path.js.map +1 -0
  558. package/dist/render/descriptors/path.test.d.ts +2 -0
  559. package/dist/render/descriptors/path.test.d.ts.map +1 -0
  560. package/dist/render/descriptors/path.test.js +40 -0
  561. package/dist/render/descriptors/path.test.js.map +1 -0
  562. package/dist/render/descriptors/polygon.d.ts +9 -0
  563. package/dist/render/descriptors/polygon.d.ts.map +1 -0
  564. package/dist/render/descriptors/polygon.js +19 -0
  565. package/dist/render/descriptors/polygon.js.map +1 -0
  566. package/dist/render/descriptors/polygram.d.ts +10 -0
  567. package/dist/render/descriptors/polygram.d.ts.map +1 -0
  568. package/dist/render/descriptors/polygram.js +20 -0
  569. package/dist/render/descriptors/polygram.js.map +1 -0
  570. package/dist/render/descriptors/rect.d.ts +9 -0
  571. package/dist/render/descriptors/rect.d.ts.map +1 -0
  572. package/dist/render/descriptors/rect.js +18 -0
  573. package/dist/render/descriptors/rect.js.map +1 -0
  574. package/dist/render/descriptors/richtext.d.ts +12 -0
  575. package/dist/render/descriptors/richtext.d.ts.map +1 -0
  576. package/dist/render/descriptors/richtext.js +20 -0
  577. package/dist/render/descriptors/richtext.js.map +1 -0
  578. package/dist/render/descriptors/shape.d.ts +6 -0
  579. package/dist/render/descriptors/shape.d.ts.map +1 -0
  580. package/dist/render/descriptors/shape.js +2 -0
  581. package/dist/render/descriptors/shape.js.map +1 -0
  582. package/dist/render/descriptors/text.d.ts +19 -0
  583. package/dist/render/descriptors/text.d.ts.map +1 -0
  584. package/dist/render/descriptors/text.js +27 -0
  585. package/dist/render/descriptors/text.js.map +1 -0
  586. package/dist/render/descriptors/transform.d.ts +16 -0
  587. package/dist/render/descriptors/transform.d.ts.map +1 -0
  588. package/dist/render/descriptors/transform.js +14 -0
  589. package/dist/render/descriptors/transform.js.map +1 -0
  590. package/dist/render/index.d.ts +17 -0
  591. package/dist/render/index.d.ts.map +1 -0
  592. package/dist/render/index.js +16 -0
  593. package/dist/render/index.js.map +1 -0
  594. package/dist/render/measure-scope.d.ts +25 -0
  595. package/dist/render/measure-scope.d.ts.map +1 -0
  596. package/dist/render/measure-scope.js +11 -0
  597. package/dist/render/measure-scope.js.map +1 -0
  598. package/dist/render/render-context.d.ts +258 -0
  599. package/dist/render/render-context.d.ts.map +1 -0
  600. package/dist/render/render-context.js +95 -0
  601. package/dist/render/render-context.js.map +1 -0
  602. package/dist/runtime/index.d.ts +4 -0
  603. package/dist/runtime/index.d.ts.map +1 -0
  604. package/dist/runtime/index.js +4 -0
  605. package/dist/runtime/index.js.map +1 -0
  606. package/dist/runtime/playback-controller.d.ts +105 -0
  607. package/dist/runtime/playback-controller.d.ts.map +1 -0
  608. package/dist/runtime/playback-controller.js +244 -0
  609. package/dist/runtime/playback-controller.js.map +1 -0
  610. package/dist/runtime/playback-controller.test.d.ts +2 -0
  611. package/dist/runtime/playback-controller.test.d.ts.map +1 -0
  612. package/dist/runtime/playback-controller.test.js +148 -0
  613. package/dist/runtime/playback-controller.test.js.map +1 -0
  614. package/dist/runtime/precompisition.d.ts +107 -0
  615. package/dist/runtime/precompisition.d.ts.map +1 -0
  616. package/dist/runtime/precompisition.js +202 -0
  617. package/dist/runtime/precompisition.js.map +1 -0
  618. package/dist/runtime/precompisition.test.d.ts +2 -0
  619. package/dist/runtime/precompisition.test.d.ts.map +1 -0
  620. package/dist/runtime/precompisition.test.js +138 -0
  621. package/dist/runtime/precompisition.test.js.map +1 -0
  622. package/dist/runtime/runtime.fixtures.d.ts +158 -0
  623. package/dist/runtime/runtime.fixtures.d.ts.map +1 -0
  624. package/dist/runtime/runtime.fixtures.js +264 -0
  625. package/dist/runtime/runtime.fixtures.js.map +1 -0
  626. package/dist/runtime/state-evaluator.d.ts +76 -0
  627. package/dist/runtime/state-evaluator.d.ts.map +1 -0
  628. package/dist/runtime/state-evaluator.js +162 -0
  629. package/dist/runtime/state-evaluator.js.map +1 -0
  630. package/dist/runtime/state-evaluator.test.d.ts +2 -0
  631. package/dist/runtime/state-evaluator.test.d.ts.map +1 -0
  632. package/dist/runtime/state-evaluator.test.js +122 -0
  633. package/dist/runtime/state-evaluator.test.js.map +1 -0
  634. package/dist/signals/create.d.ts +21 -0
  635. package/dist/signals/create.d.ts.map +1 -0
  636. package/dist/signals/create.js +74 -0
  637. package/dist/signals/create.js.map +1 -0
  638. package/dist/signals/create.test.d.ts +2 -0
  639. package/dist/signals/create.test.d.ts.map +1 -0
  640. package/dist/signals/create.test.js +81 -0
  641. package/dist/signals/create.test.js.map +1 -0
  642. package/dist/signals/host.d.ts +11 -0
  643. package/dist/signals/host.d.ts.map +1 -0
  644. package/dist/signals/host.js +10 -0
  645. package/dist/signals/host.js.map +1 -0
  646. package/dist/signals/index.d.ts +4 -0
  647. package/dist/signals/index.d.ts.map +1 -0
  648. package/dist/signals/index.js +3 -0
  649. package/dist/signals/index.js.map +1 -0
  650. package/dist/signals/signal-cell.test.d.ts +2 -0
  651. package/dist/signals/signal-cell.test.d.ts.map +1 -0
  652. package/dist/signals/signal-cell.test.js +202 -0
  653. package/dist/signals/signal-cell.test.js.map +1 -0
  654. package/dist/signals/signal.d.ts +46 -0
  655. package/dist/signals/signal.d.ts.map +1 -0
  656. package/dist/signals/signal.js +162 -0
  657. package/dist/signals/signal.js.map +1 -0
  658. package/dist/signals/signal.test.d.ts +2 -0
  659. package/dist/signals/signal.test.d.ts.map +1 -0
  660. package/dist/signals/signal.test.js +192 -0
  661. package/dist/signals/signal.test.js.map +1 -0
  662. package/dist/signals/subscriber.d.ts +5 -0
  663. package/dist/signals/subscriber.d.ts.map +1 -0
  664. package/dist/signals/subscriber.js +2 -0
  665. package/dist/signals/subscriber.js.map +1 -0
  666. package/dist/tween/animation-builder.d.ts +74 -0
  667. package/dist/tween/animation-builder.d.ts.map +1 -0
  668. package/dist/tween/animation-builder.js +99 -0
  669. package/dist/tween/animation-builder.js.map +1 -0
  670. package/dist/tween/ease/constants.d.ts +13 -0
  671. package/dist/tween/ease/constants.d.ts.map +1 -0
  672. package/dist/tween/ease/constants.js +71 -0
  673. package/dist/tween/ease/constants.js.map +1 -0
  674. package/dist/tween/ease/type.d.ts +2 -0
  675. package/dist/tween/ease/type.d.ts.map +1 -0
  676. package/dist/tween/ease/type.js +2 -0
  677. package/dist/tween/ease/type.js.map +1 -0
  678. package/dist/tween/eases.test.d.ts +2 -0
  679. package/dist/tween/eases.test.d.ts.map +1 -0
  680. package/dist/tween/eases.test.js +91 -0
  681. package/dist/tween/eases.test.js.map +1 -0
  682. package/dist/tween/generator.d.ts +22 -0
  683. package/dist/tween/generator.d.ts.map +1 -0
  684. package/dist/tween/generator.js +2 -0
  685. package/dist/tween/generator.js.map +1 -0
  686. package/dist/tween/index.d.ts +12 -0
  687. package/dist/tween/index.d.ts.map +1 -0
  688. package/dist/tween/index.js +12 -0
  689. package/dist/tween/index.js.map +1 -0
  690. package/dist/tween/lerp.d.ts +11 -0
  691. package/dist/tween/lerp.d.ts.map +1 -0
  692. package/dist/tween/lerp.js +13 -0
  693. package/dist/tween/lerp.js.map +1 -0
  694. package/dist/tween/lerp.test.d.ts +2 -0
  695. package/dist/tween/lerp.test.d.ts.map +1 -0
  696. package/dist/tween/lerp.test.js +22 -0
  697. package/dist/tween/lerp.test.js.map +1 -0
  698. package/dist/tween/parallel.d.ts +23 -0
  699. package/dist/tween/parallel.d.ts.map +1 -0
  700. package/dist/tween/parallel.js +79 -0
  701. package/dist/tween/parallel.js.map +1 -0
  702. package/dist/tween/prepare.d.ts +34 -0
  703. package/dist/tween/prepare.d.ts.map +1 -0
  704. package/dist/tween/prepare.js +52 -0
  705. package/dist/tween/prepare.js.map +1 -0
  706. package/dist/tween/prepare.test.d.ts +2 -0
  707. package/dist/tween/prepare.test.d.ts.map +1 -0
  708. package/dist/tween/prepare.test.js +44 -0
  709. package/dist/tween/prepare.test.js.map +1 -0
  710. package/dist/tween/sequence.d.ts +19 -0
  711. package/dist/tween/sequence.d.ts.map +1 -0
  712. package/dist/tween/sequence.js +22 -0
  713. package/dist/tween/sequence.js.map +1 -0
  714. package/dist/tween/sequence.test.d.ts +2 -0
  715. package/dist/tween/sequence.test.d.ts.map +1 -0
  716. package/dist/tween/sequence.test.js +68 -0
  717. package/dist/tween/sequence.test.js.map +1 -0
  718. package/dist/tween/stepper.d.ts +34 -0
  719. package/dist/tween/stepper.d.ts.map +1 -0
  720. package/dist/tween/stepper.js +4 -0
  721. package/dist/tween/stepper.js.map +1 -0
  722. package/dist/tween/tests/batched-parallel.test.d.ts +2 -0
  723. package/dist/tween/tests/batched-parallel.test.d.ts.map +1 -0
  724. package/dist/tween/tests/batched-parallel.test.js +76 -0
  725. package/dist/tween/tests/batched-parallel.test.js.map +1 -0
  726. package/dist/tween/tests/parallel.test.d.ts +2 -0
  727. package/dist/tween/tests/parallel.test.d.ts.map +1 -0
  728. package/dist/tween/tests/parallel.test.js +129 -0
  729. package/dist/tween/tests/parallel.test.js.map +1 -0
  730. package/dist/tween/tests/realtime.test.d.ts +2 -0
  731. package/dist/tween/tests/realtime.test.d.ts.map +1 -0
  732. package/dist/tween/tests/realtime.test.js +76 -0
  733. package/dist/tween/tests/realtime.test.js.map +1 -0
  734. package/dist/tween/tween.d.ts +18 -0
  735. package/dist/tween/tween.d.ts.map +1 -0
  736. package/dist/tween/tween.js +28 -0
  737. package/dist/tween/tween.js.map +1 -0
  738. package/dist/tween/tween.test.d.ts +2 -0
  739. package/dist/tween/tween.test.d.ts.map +1 -0
  740. package/dist/tween/tween.test.js +38 -0
  741. package/dist/tween/tween.test.js.map +1 -0
  742. package/dist/tween/wait.d.ts +19 -0
  743. package/dist/tween/wait.d.ts.map +1 -0
  744. package/dist/tween/wait.js +25 -0
  745. package/dist/tween/wait.js.map +1 -0
  746. package/dist/tween/wait.test.d.ts +2 -0
  747. package/dist/tween/wait.test.d.ts.map +1 -0
  748. package/dist/tween/wait.test.js +35 -0
  749. package/dist/tween/wait.test.js.map +1 -0
  750. package/dist/util/clamp.d.ts +12 -0
  751. package/dist/util/clamp.d.ts.map +1 -0
  752. package/dist/util/clamp.js +16 -0
  753. package/dist/util/clamp.js.map +1 -0
  754. package/dist/util/clamp.test.d.ts +2 -0
  755. package/dist/util/clamp.test.d.ts.map +1 -0
  756. package/dist/util/clamp.test.js +31 -0
  757. package/dist/util/clamp.test.js.map +1 -0
  758. package/dist/util/index.d.ts +4 -0
  759. package/dist/util/index.d.ts.map +1 -0
  760. package/dist/util/index.js +4 -0
  761. package/dist/util/index.js.map +1 -0
  762. package/dist/util/random.d.ts +16 -0
  763. package/dist/util/random.d.ts.map +1 -0
  764. package/dist/util/random.js +28 -0
  765. package/dist/util/random.js.map +1 -0
  766. package/dist/util/random.test.d.ts +2 -0
  767. package/dist/util/random.test.d.ts.map +1 -0
  768. package/dist/util/random.test.js +42 -0
  769. package/dist/util/random.test.js.map +1 -0
  770. package/dist/util/range.d.ts +12 -0
  771. package/dist/util/range.d.ts.map +1 -0
  772. package/dist/util/range.js +11 -0
  773. package/dist/util/range.js.map +1 -0
  774. package/dist/util/reference.d.ts +15 -0
  775. package/dist/util/reference.d.ts.map +1 -0
  776. package/dist/util/reference.js +20 -0
  777. package/dist/util/reference.js.map +1 -0
  778. package/dist/util/reference.test.d.ts +2 -0
  779. package/dist/util/reference.test.d.ts.map +1 -0
  780. package/dist/util/reference.test.js +32 -0
  781. package/dist/util/reference.test.js.map +1 -0
  782. package/package.json +54 -0
@@ -0,0 +1,800 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Signal } from "../../signals/signal";
8
+ import { AnimationBuilder } from "../../tween/animation-builder";
9
+ import { prepareNumericCellTween } from "../../tween/prepare";
10
+ import { getPropertyMeta, property } from "../../attributes/properties/decorator";
11
+ import { lerpVector2 } from "../../attributes/layout/vector2";
12
+ import { resolveChainEffects } from "../../attributes/shape/effects/chain";
13
+ import { resolvePadding } from "../../attributes/layout/padding";
14
+ import { lerpEdgeInset, lerpSizeInput } from "../../layout/tweens";
15
+ import { lerpEffectArray } from "../../attributes/shape/effects/registry";
16
+ import { isAutoSize, resolveSize } from "../../layout/size-resolver";
17
+ /**
18
+ * Fractional offsets (0–1) of each anchor within the node's bounding box.
19
+ * `wx` = fraction of width, `hy` = fraction of height.
20
+ */
21
+ const ANCHOR_OFFSETS = {
22
+ topLeft: { wx: 0, hy: 0 },
23
+ topCenter: { wx: 0.5, hy: 0 },
24
+ topRight: { wx: 1, hy: 0 },
25
+ leftCenter: { wx: 0, hy: 0.5 },
26
+ center: { wx: 0.5, hy: 0.5 },
27
+ rightCenter: { wx: 1, hy: 0.5 },
28
+ bottomLeft: { wx: 0, hy: 1 },
29
+ bottomCenter: { wx: 0.5, hy: 1 },
30
+ bottomRight: { wx: 1, hy: 1 },
31
+ };
32
+ const ANCHOR_KEYS = Object.keys(ANCHOR_OFFSETS);
33
+ /** Convert ANCHOR_OFFSETS fractions to a normalised pivot: wx=0→-1, wx=1→+1; hy=0→+1, hy=1→-1 */
34
+ function anchorToPivot(offset) {
35
+ return { x: (offset.wx - 0.5) * 2, y: -(offset.hy - 0.5) * 2 };
36
+ }
37
+ function validateAnchorProps(props) {
38
+ const presentAnchors = ANCHOR_KEYS.filter(k => props[k] !== undefined);
39
+ if (presentAnchors.length > 1) {
40
+ throw new Error(`Cannot set multiple anchor props at once: ${presentAnchors.join(', ')}`);
41
+ }
42
+ if (presentAnchors.length === 1 && props['pivot'] !== undefined) {
43
+ throw new Error(`Cannot set both anchor prop '${presentAnchors[0]}' and 'pivot' at the same time`);
44
+ }
45
+ }
46
+ /**
47
+ * Base class for all scene-graph nodes.
48
+ *
49
+ * Every visible or structural element in a scene extends `Node`. It wires
50
+ * together three orthogonal systems:
51
+ *
52
+ * **Reactive properties** — fields declared with `@property()` are backed by
53
+ * `Signal`s. Reading them inside a reactive context (e.g. a render pass)
54
+ * creates a subscription; writing them propagates the change automatically.
55
+ * Use {@link set} to update one or more props imperatively, or pass a callback
56
+ * `() => expr` to bind the prop to a derived value.
57
+ *
58
+ * **Tweening** — `*to(props, duration, ease?)` is a generator that animates
59
+ * one or more props to target values over the given duration (in seconds).
60
+ * Numeric props are interpolated; props that register a custom `tween` fn (via
61
+ * `@property({ tween })`) can animate any value type. The convenience helpers
62
+ * `moveTo`, `moveX`, `moveY`, `fadeTo`, `rotateTo`, and `scaleTo` wrap `to`
63
+ * for the most common single-property animations.
64
+ *
65
+ * **Layout** — `measure()` is called top-down to resolve sizes, then
66
+ * `layout()` places the node in its allocated `BoxBounds`. Children are
67
+ * measured and laid out by the parent; the base class just stores the rect.
68
+ *
69
+ * ### Built-in visual props
70
+ * | prop | default | unit / notes |
71
+ * |-----------|----------|---------------------------------------|
72
+ * | `x` | 0 | horizontal offset in scene pixels |
73
+ * | `y` | 0 | vertical offset (positive = up) |
74
+ * | `width` | `'fill'` | `SizeInput`: px, `'fill'`, `'auto'` |
75
+ * | `height` | `'fill'` | same |
76
+ * | `scale` | 1 | uniform scale factor |
77
+ * | `rotate` | 0 | degrees, clockwise |
78
+ * | `opacity` | 1 | 0–1 |
79
+ * | `effects` | [] | post-process / blend effects |
80
+ * | `padding` | 0 | inner spacing, all four edges |
81
+ */
82
+ export class Node {
83
+ _assets = null;
84
+ _parent = null;
85
+ get parent() {
86
+ return this._parent;
87
+ }
88
+ get assets() {
89
+ if (!this._assets)
90
+ throw new Error("AssetContext not bound — call bindAssets() before accessing assets");
91
+ return this._assets;
92
+ }
93
+ /** Returns the bound asset catalog, or null if this node hasn't been bound yet. */
94
+ tryAssets() {
95
+ return this._assets;
96
+ }
97
+ id = crypto.randomUUID();
98
+ __signals;
99
+ __upgraders;
100
+ __tweens;
101
+ /** Maps external prop value → internal cell value for fields that need it. */
102
+ __mappers;
103
+ _layoutRect = new Signal({ x: 0, y: 0, width: 0, height: 0 });
104
+ constraints;
105
+ /** The allocated bounding box from the last layout pass. Reactive — reads inside callbacks are tracked. */
106
+ get layoutRect() { return this._layoutRect.get(); }
107
+ _children = [];
108
+ constructor(props) {
109
+ if (props?.ref) {
110
+ props.ref(this);
111
+ }
112
+ // Apply all @property()-decorated fields, reading initial values from props.
113
+ for (const meta of getPropertyMeta(this)) {
114
+ const propsVal = props ? props[meta.key] : undefined;
115
+ const initial = propsVal !== undefined ? propsVal : meta.default;
116
+ this.applyProp(meta.key, initial, meta.options);
117
+ }
118
+ // Anchor-based positioning: validate, derive pivot, bind x/y.
119
+ if (props) {
120
+ validateAnchorProps(props);
121
+ const anchorKey = ANCHOR_KEYS.find(k => props[k] !== undefined);
122
+ if (anchorKey) {
123
+ const raw = props[anchorKey];
124
+ const getTarget = typeof raw === 'function' ? raw : () => raw;
125
+ const offset = ANCHOR_OFFSETS[anchorKey];
126
+ this._writeProp('pivot', anchorToPivot(offset));
127
+ this._writeProp('x', () => {
128
+ const r = this._layoutRect.get();
129
+ return getTarget().x + (0.5 - offset.wx) * r.width;
130
+ });
131
+ this._writeProp('y', () => {
132
+ const r = this._layoutRect.get();
133
+ return getTarget().y - (0.5 - offset.hy) * r.height;
134
+ });
135
+ }
136
+ }
137
+ if (props && props.children) {
138
+ const raw = Array.isArray(props.children) ? props.children : [props.children];
139
+ const flat = raw.flat(Infinity)
140
+ .filter((c) => c instanceof Node);
141
+ if (flat.length > 0)
142
+ this.addChildren(flat);
143
+ }
144
+ }
145
+ // ---- Reactive properties ----------------------------------------------
146
+ /**
147
+ * Declare a reactive prop on this node. Creates a Signal-backed
148
+ * accessor for `field`, applies an initial value (callback → reactive
149
+ * binding; otherwise constant), and registers optional tween/mapper
150
+ * metadata used by `set()` and `to()`.
151
+ *
152
+ * Subsequent calls for the same field reuse the existing cell and act as
153
+ * a value assignment, so subclasses can override a parent's default by
154
+ * calling applyProp again without losing the cell or its bindings.
155
+ */
156
+ applyProp(field, initial, options) {
157
+ const existing = this.__signals?.get(field);
158
+ if (!existing) {
159
+ this._registerProp(field, options);
160
+ }
161
+ else if (options) {
162
+ // Allow subclasses to refine tween/mapper on an inherited field.
163
+ if (options.tween) {
164
+ if (!this.__tweens)
165
+ this.__tweens = new Map();
166
+ this.__tweens.set(field, options.tween);
167
+ }
168
+ if (options.mapper) {
169
+ if (!this.__mappers)
170
+ this.__mappers = new Map();
171
+ this.__mappers.set(field, options.mapper);
172
+ }
173
+ }
174
+ this._writeProp(field, initial);
175
+ }
176
+ _registerProp(field, options) {
177
+ const cell = new Signal(undefined);
178
+ if (!this.__signals)
179
+ this.__signals = new Map();
180
+ this.__signals.set(field, cell);
181
+ if (!this.__upgraders)
182
+ this.__upgraders = new Map();
183
+ this.__upgraders.set(field, () => cell);
184
+ if (options?.tween) {
185
+ if (!this.__tweens)
186
+ this.__tweens = new Map();
187
+ this.__tweens.set(field, options.tween);
188
+ }
189
+ if (options?.mapper) {
190
+ if (!this.__mappers)
191
+ this.__mappers = new Map();
192
+ this.__mappers.set(field, options.mapper);
193
+ }
194
+ if (options?.layout) {
195
+ cell.subscribe(() => this._markLayoutDirty());
196
+ }
197
+ Object.defineProperty(this, field, {
198
+ get: () => cell.get(),
199
+ set: (value) => this._writeProp(field, value),
200
+ enumerable: true,
201
+ configurable: true,
202
+ });
203
+ }
204
+ _writeProp(field, value) {
205
+ if (value === undefined)
206
+ return;
207
+ const cell = this.__signals.get(field);
208
+ const mapper = this.__mappers?.get(field);
209
+ if (typeof value === "function") {
210
+ const extFn = value;
211
+ cell.bind(mapper ? () => mapper(extFn(), cell.get()) : extFn);
212
+ }
213
+ else {
214
+ cell.set(mapper ? mapper(value, cell.get()) : value);
215
+ }
216
+ }
217
+ get properties() {
218
+ const result = {};
219
+ if (this.__upgraders) {
220
+ for (const key of this.__upgraders.keys()) {
221
+ result[key] = this[key];
222
+ }
223
+ }
224
+ return result;
225
+ }
226
+ get name() {
227
+ return this.constructor.name;
228
+ }
229
+ set(props) {
230
+ const signals = this.__signals;
231
+ if (!signals)
232
+ return;
233
+ // Iterate the caller's keys (usually 1–3) rather than every registered
234
+ // signal (15+): set() runs in the per-frame hot path. Only keys backed
235
+ // by a signal are written; unknown keys are ignored as before.
236
+ for (const key in props) {
237
+ const val = props[key];
238
+ if (val !== undefined && signals.has(key))
239
+ this._writeProp(key, val);
240
+ }
241
+ }
242
+ to(to, duration, easing) {
243
+ return new AnimationBuilder(this, { to, duration, easing });
244
+ }
245
+ /**
246
+ * Resolve a single `to()` step into a flat {@link TweenStepper} — all the
247
+ * per-key setup (anchor handling, mapper, numeric-vs-custom routing) happens
248
+ * once here, then `advance(dt)` is allocation-free. Used by both the
249
+ * generator path (`_toGen`) and the batched `parallel` path.
250
+ */
251
+ _prepareStep(to, duration, easing) {
252
+ validateAnchorProps(to);
253
+ // If an anchor key is in the tween target, resolve it to x/y targets and set pivot.
254
+ const anchorKey = ANCHOR_KEYS.find(k => to[k] !== undefined);
255
+ if (anchorKey) {
256
+ const raw = to[anchorKey];
257
+ const offset = ANCHOR_OFFSETS[anchorKey];
258
+ const r = this._layoutRect.get();
259
+ this._writeProp('pivot', anchorToPivot(offset));
260
+ to.x = raw.x + (0.5 - offset.wx) * r.width;
261
+ to.y = raw.y - (0.5 - offset.hy) * r.height;
262
+ }
263
+ // Numeric, mapper-free props (x/y/scale/rotation/opacity) write straight
264
+ // to their cell — no property-setter / mapper indirection per step.
265
+ const numCells = [];
266
+ const numFrom = [];
267
+ const numEnd = [];
268
+ const customLerps = [];
269
+ const stringSnaps = [];
270
+ for (const key of Object.keys(to)) {
271
+ const cell = this.__signals?.get(key);
272
+ if (!cell)
273
+ continue;
274
+ const extVal = to[key];
275
+ // Map external → internal so the tween operates in stored space.
276
+ const mapper = this.__mappers?.get(key);
277
+ const targetVal = mapper ? mapper(extVal, this[key]) : extVal;
278
+ const tweenFn = this.__tweens?.get(key);
279
+ if (tweenFn) {
280
+ const from = this[key];
281
+ customLerps.push((t) => {
282
+ cell.set(tweenFn(from, targetVal, t));
283
+ });
284
+ }
285
+ else if (typeof targetVal === 'number') {
286
+ if (mapper) {
287
+ // Numeric but mapped: keep the setter path so the mapper runs.
288
+ const from = this[key];
289
+ customLerps.push((t) => { this[key] = from + (targetVal - from) * t; });
290
+ }
291
+ else {
292
+ numCells.push(cell);
293
+ numFrom.push(this[key]);
294
+ numEnd.push(targetVal);
295
+ }
296
+ }
297
+ else if (typeof targetVal === 'string') {
298
+ stringSnaps.push([key, targetVal]);
299
+ }
300
+ }
301
+ const lerp = prepareNumericCellTween(numCells, numFrom, numEnd);
302
+ const hasCustom = customLerps.length > 0;
303
+ const hasSnaps = stringSnaps.length > 0;
304
+ const apply = (t) => {
305
+ const easedT = easing ? easing(t) : t;
306
+ lerp(easedT);
307
+ if (hasCustom)
308
+ for (const fn of customLerps)
309
+ fn(easedT);
310
+ };
311
+ let elapsed = 0;
312
+ return {
313
+ seek: (e) => apply(duration > 0 ? Math.min(e / duration, 1) : 1),
314
+ advance: (dt) => {
315
+ elapsed += dt;
316
+ if (elapsed < duration) {
317
+ apply(elapsed / duration);
318
+ return false;
319
+ }
320
+ apply(1);
321
+ if (hasSnaps)
322
+ for (const [key, val] of stringSnaps)
323
+ this[key] = val;
324
+ return true;
325
+ },
326
+ };
327
+ }
328
+ *_toGen(to, duration, easing) {
329
+ const step = this._prepareStep(to, duration, easing);
330
+ step.seek(0);
331
+ let done = false;
332
+ while (!done) {
333
+ const dt = yield;
334
+ done = step.advance(dt);
335
+ }
336
+ }
337
+ // ---- Motion helpers ---------------------------------------------------
338
+ /**
339
+ * Animate both `x` and `y` to the given position.
340
+ *
341
+ * @example
342
+ * yield* node.moveTo(200, 100, 0.5, ease.outCubic);
343
+ */
344
+ *moveTo(x, y, duration, ease) {
345
+ return yield* this.to({ x, y }, duration, ease);
346
+ }
347
+ /**
348
+ * Animate only the horizontal position (`x`).
349
+ *
350
+ * @example
351
+ * yield* node.moveX(300, 0.4);
352
+ */
353
+ *moveX(x, duration, ease) {
354
+ return yield* this.to({ x }, duration, ease);
355
+ }
356
+ /**
357
+ * Animate only the vertical position (`y`).
358
+ *
359
+ * @example
360
+ * yield* node.moveY(-50, 0.4);
361
+ */
362
+ *moveY(y, duration, ease) {
363
+ return yield* this.to({ y }, duration, ease);
364
+ }
365
+ /**
366
+ * Animate `opacity` to the target value.
367
+ *
368
+ * @param opacity Target opacity in the range `[0, 1]`.
369
+ * @example
370
+ * yield* node.fadeTo(0, 0.3); // fade out
371
+ * yield* node.fadeTo(1, 0.3); // fade in
372
+ */
373
+ *fadeTo(opacity, duration, ease) {
374
+ return yield* this.to({ opacity }, duration, ease);
375
+ }
376
+ /**
377
+ * Animate `rotate` to the target angle (degrees, clockwise).
378
+ *
379
+ * @example
380
+ * yield* node.rotateTo(180, 0.6, ease.inOutQuad);
381
+ */
382
+ *rotateTo(rotation, duration, ease) {
383
+ return yield* this.to({ rotation }, duration, ease);
384
+ }
385
+ /**
386
+ * Animate `scale` to the target factor.
387
+ *
388
+ * @example
389
+ * yield* node.scaleTo(1.5, 0.4); // grow
390
+ * yield* node.scaleTo(0, 0.3); // shrink to nothing
391
+ */
392
+ *scaleTo(scale, duration, ease) {
393
+ return yield* this.to({ scale }, duration, ease);
394
+ }
395
+ // ---- Clock ------------------------------------------------------------
396
+ _clock = {
397
+ time: 0,
398
+ creation: 0,
399
+ elapsed: 0,
400
+ initialized: false,
401
+ };
402
+ tick(_globalTime) {
403
+ }
404
+ /** Internal timing state. */
405
+ get clock() {
406
+ return this._clock;
407
+ }
408
+ ellapse(totalTime) {
409
+ if (!this._clock.initialized) {
410
+ this._clock.creation = totalTime;
411
+ this._clock.initialized = true;
412
+ }
413
+ this._clock.time = totalTime;
414
+ this._clock.elapsed = totalTime - this._clock.creation;
415
+ this.tick(this._clock.time);
416
+ for (const child of this._children)
417
+ child.ellapse(totalTime);
418
+ }
419
+ // ---- Asset lifecycle --------------------------------------------------
420
+ bindAssets(context) {
421
+ this._assets = context;
422
+ for (const child of this._children)
423
+ child.bindAssets(context);
424
+ }
425
+ prepare(_storage) {
426
+ }
427
+ /**
428
+ * Audio clips this node owns, surfaced to the timeline as waveforms. The
429
+ * base node has no audio; nodes that do (e.g. {@link Scene}) override this.
430
+ * Returns undefined when there is nothing to show.
431
+ */
432
+ waveform() {
433
+ return undefined;
434
+ }
435
+ prepareAssets(storage) {
436
+ this.prepare(storage);
437
+ for (const child of this._children)
438
+ child.prepareAssets(storage);
439
+ }
440
+ // ---- Layout queries ---------------------------------------------------
441
+ get measuredWidth() {
442
+ return this.layoutRect.width;
443
+ }
444
+ get measuredHeight() {
445
+ return this.layoutRect.height;
446
+ }
447
+ // ---- Anchor points ----------------------------------------------------
448
+ // All getters read the reactive layoutRect signal AND the reactive x/y/rotation
449
+ // signals, so any callback that reads them will re-evaluate on any change.
450
+ /** Rotate offset (ox, oy) by this node's rotation (degrees clockwise) around the node center. */
451
+ _rotateOffset(ox, oy) {
452
+ const deg = this.rotation;
453
+ if (deg === 0)
454
+ return { x: this.x + ox, y: this.y + oy };
455
+ const rad = (deg * Math.PI) / 180;
456
+ const cos = Math.cos(rad);
457
+ const sin = Math.sin(rad);
458
+ // Canvas rotation is clockwise; in y-up space that means x'= cos*ox + sin*oy, y'= -sin*ox + cos*oy
459
+ return {
460
+ x: this.x + cos * ox + sin * oy,
461
+ y: this.y - sin * ox + cos * oy,
462
+ };
463
+ }
464
+ /** Center of the node — equivalent to its x/y position (0,0 is the center of the layout cell). */
465
+ get center() {
466
+ return { x: this.x, y: this.y };
467
+ }
468
+ get topLeft() {
469
+ const r = this.layoutRect;
470
+ return this._rotateOffset(-r.width / 2, r.height / 2);
471
+ }
472
+ get topRight() {
473
+ const r = this.layoutRect;
474
+ return this._rotateOffset(r.width / 2, r.height / 2);
475
+ }
476
+ get bottomLeft() {
477
+ const r = this.layoutRect;
478
+ return this._rotateOffset(-r.width / 2, -r.height / 2);
479
+ }
480
+ get bottomRight() {
481
+ const r = this.layoutRect;
482
+ return this._rotateOffset(r.width / 2, -r.height / 2);
483
+ }
484
+ get topCenter() {
485
+ const r = this.layoutRect;
486
+ return this._rotateOffset(0, r.height / 2);
487
+ }
488
+ get bottomCenter() {
489
+ const r = this.layoutRect;
490
+ return this._rotateOffset(0, -r.height / 2);
491
+ }
492
+ get leftCenter() {
493
+ const r = this.layoutRect;
494
+ return this._rotateOffset(-r.width / 2, 0);
495
+ }
496
+ get rightCenter() {
497
+ const r = this.layoutRect;
498
+ return this._rotateOffset(r.width / 2, 0);
499
+ }
500
+ isAutoSize(axis) {
501
+ return isAutoSize(axis === "width" ? this.width : this.height);
502
+ }
503
+ resolveSizeInput(sizeInput, availableSize, childrenSize) {
504
+ return resolveSize(sizeInput, availableSize, childrenSize);
505
+ }
506
+ // ---- Child management -------------------------------------------------
507
+ get children() {
508
+ return this._children;
509
+ }
510
+ addChild(child) {
511
+ this._children.push(child);
512
+ child._parent = this;
513
+ this._markLayoutDirty();
514
+ const assets = this.tryAssets();
515
+ if (assets)
516
+ child.bindAssets(assets);
517
+ }
518
+ removeChild(child) {
519
+ const i = this._children.indexOf(child);
520
+ if (i < 0)
521
+ return null;
522
+ const [removed] = this._children.splice(i, 1);
523
+ if (removed)
524
+ removed._parent = null;
525
+ this._markLayoutDirty();
526
+ return removed ?? null;
527
+ }
528
+ addChildren(children) {
529
+ this._children.push(...children);
530
+ for (const child of children)
531
+ child._parent = this;
532
+ this._markLayoutDirty();
533
+ const assets = this.tryAssets();
534
+ if (assets)
535
+ for (const child of children)
536
+ child.bindAssets(assets);
537
+ }
538
+ clearChildren() {
539
+ for (const child of this._children)
540
+ child._parent = null;
541
+ this._children.length = 0;
542
+ this._markLayoutDirty();
543
+ }
544
+ addChildAt(child, index, duration, easing) {
545
+ if (duration === undefined) {
546
+ this._children.splice(index, 0, child);
547
+ child._parent = this;
548
+ this._markLayoutDirty();
549
+ const assets = this.tryAssets();
550
+ if (assets)
551
+ child.bindAssets(assets);
552
+ return;
553
+ }
554
+ return this._addChildAtAnimated(child, index, duration, easing);
555
+ }
556
+ removeChildAt(index, duration, easing) {
557
+ if (duration === undefined) {
558
+ if (index < 0 || index >= this._children.length)
559
+ return null;
560
+ const [removed] = this._children.splice(index, 1);
561
+ if (removed)
562
+ removed._parent = null;
563
+ this._markLayoutDirty();
564
+ return removed ?? null;
565
+ }
566
+ return this._removeChildAtAnimated(index, duration, easing);
567
+ }
568
+ // ---- Rendering --------------------------------------------------------
569
+ // Reused each frame so applyTransform doesn't allocate a fresh descriptor
570
+ // per node per frame. ctx.transform reads it synchronously and never retains
571
+ // it, so a single mutated instance is safe.
572
+ _transformScratch = {
573
+ x: 0, y: 0, width: 0, height: 0,
574
+ scale: 1, rotation: 0, opacity: 1,
575
+ effects: [], pivot: { x: 0, y: 0 },
576
+ };
577
+ /** Push this node's transform (position, scale, rotate, opacity, effects). */
578
+ applyTransform(ctx) {
579
+ const r = this.layoutRect;
580
+ const s = this._transformScratch;
581
+ s.x = (r?.x ?? 0) + this.x;
582
+ s.y = (r?.y ?? 0) - this.y;
583
+ s.width = r?.width ?? 0;
584
+ s.height = r?.height ?? 0;
585
+ s.scale = this.scale;
586
+ s.rotation = this.rotation;
587
+ s.opacity = this.opacity;
588
+ s.effects = this.effects;
589
+ s.pivot = this.pivot;
590
+ ctx.transform(s);
591
+ }
592
+ onRender(ctx) {
593
+ this.applyTransform(ctx);
594
+ this.renderChildren(ctx);
595
+ }
596
+ renderChildren(ctx) {
597
+ for (const child of this._children)
598
+ child.render(ctx);
599
+ }
600
+ beforeRender(ctx) {
601
+ ctx.begin(this.id, this._spaceRects());
602
+ }
603
+ /**
604
+ * Reference rects for fills with `space:'parent'`, expressed in this node's
605
+ * local space (origin = this node's positioned centre, y-down to match the
606
+ * canvas). The viewport (`space:'view'`) is resolved by the renderer, which
607
+ * knows the surface size. Rotation/scale of this node are not folded in —
608
+ * the rect is the axis-aligned parent box, which is what gradients expect.
609
+ */
610
+ _spaceRects() {
611
+ const parent = this._parent;
612
+ if (!parent)
613
+ return {};
614
+ const p = parent.layoutRect;
615
+ const r = this.layoutRect;
616
+ // This node's local origin within the parent's space.
617
+ const ox = r.x + this.x;
618
+ const oy = r.y - this.y;
619
+ return {
620
+ parent: {
621
+ left: -p.width / 2 - ox,
622
+ top: -p.height / 2 - oy,
623
+ right: p.width / 2 - ox,
624
+ bottom: p.height / 2 - oy,
625
+ },
626
+ };
627
+ }
628
+ afterRender(ctx) {
629
+ ctx.end();
630
+ }
631
+ render(ctx) {
632
+ this.beforeRender(ctx);
633
+ this.onRender(ctx);
634
+ this.afterRender(ctx);
635
+ }
636
+ // ---- Layout -----------------------------------------------------------
637
+ _measuredSize = {};
638
+ _layoutDirty = true;
639
+ /**
640
+ * Mark this node's layout stale and bubble the flag to ancestors. A child's
641
+ * size change reflows its parent's layout, so the parent must re-run too.
642
+ * Subscribed to layout-affecting props (see @property `layout`) and invoked
643
+ * directly on child-list mutations. x/y are *not* layout props — they're
644
+ * applied at render time and never invalidate layout.
645
+ */
646
+ _markLayoutDirty() {
647
+ let node = this;
648
+ while (node && !node._layoutDirty) {
649
+ node._layoutDirty = true;
650
+ node = node._parent;
651
+ }
652
+ }
653
+ layout(rect, _scope) {
654
+ this._layoutRect.set(rect);
655
+ this._layoutDirty = false;
656
+ }
657
+ measure(constraints, _scope) {
658
+ this.constraints = constraints;
659
+ const maxW = constraints.maxWidth ?? 0;
660
+ const maxH = constraints.maxHeight ?? 0;
661
+ this._measuredSize.width = resolveSize(this.width, maxW, 0);
662
+ this._measuredSize.height = resolveSize(this.height, maxH, 0);
663
+ return this._measuredSize;
664
+ }
665
+ reparent(newParent, duration, easing) {
666
+ if (duration === undefined) {
667
+ const old = this.parent;
668
+ if (old)
669
+ old.removeChild(this);
670
+ newParent.addChild(this);
671
+ return;
672
+ }
673
+ return this._reparentAnimated(newParent, duration, easing);
674
+ }
675
+ *_reparentAnimated(newParent, duration, easing) {
676
+ const half = duration / 2;
677
+ const targetOpacity = this.opacity;
678
+ // Pin to current rendered size so exit shrink reflows the old parent.
679
+ const lw = this.layoutRect?.width;
680
+ const lh = this.layoutRect?.height;
681
+ const hasSizeAnim = lw !== undefined && lh !== undefined;
682
+ if (hasSizeAnim) {
683
+ this.set({ width: lw, height: lh });
684
+ }
685
+ const exitProps = { opacity: 0 };
686
+ if (hasSizeAnim) {
687
+ exitProps.width = 0;
688
+ exitProps.height = 0;
689
+ }
690
+ yield* this.to(exitProps, half, easing);
691
+ const old = this.parent;
692
+ if (old)
693
+ old.removeChild(this);
694
+ newParent.addChild(this);
695
+ const enterProps = { opacity: targetOpacity };
696
+ if (hasSizeAnim) {
697
+ enterProps.width = lw;
698
+ enterProps.height = lh;
699
+ }
700
+ yield* this.to(enterProps, half, easing);
701
+ }
702
+ *_addChildAtAnimated(child, index, duration, easing) {
703
+ const targetOpacity = child.opacity;
704
+ const isNumericW = typeof child.width === 'number';
705
+ const isNumericH = typeof child.height === 'number';
706
+ const targetW = isNumericW ? child.width : 0;
707
+ const targetH = isNumericH ? child.height : 0;
708
+ child.set({
709
+ opacity: 0,
710
+ width: isNumericW ? 0 : undefined,
711
+ height: isNumericH ? 0 : undefined,
712
+ });
713
+ this._children.splice(index, 0, child);
714
+ child._parent = this;
715
+ this._markLayoutDirty();
716
+ const assets = this.tryAssets();
717
+ if (assets)
718
+ child.bindAssets(assets);
719
+ const toProps = { opacity: targetOpacity };
720
+ if (isNumericW)
721
+ toProps.width = targetW;
722
+ if (isNumericH)
723
+ toProps.height = targetH;
724
+ yield* child.to(toProps, duration, easing);
725
+ }
726
+ *_removeChildAtAnimated(index, duration, easing) {
727
+ if (index < 0 || index >= this._children.length)
728
+ return;
729
+ const child = this._children[index];
730
+ // Pin to current rendered size so the shrink reflows siblings in the parent layout.
731
+ const lw = child.layoutRect?.width;
732
+ const lh = child.layoutRect?.height;
733
+ child.set({ width: lw, height: lh });
734
+ const toProps = { opacity: 0 };
735
+ if (lw !== undefined)
736
+ toProps.width = 0;
737
+ if (lh !== undefined)
738
+ toProps.height = 0;
739
+ yield* child.to(toProps, duration, easing);
740
+ this._children.splice(index, 1);
741
+ child._parent = null;
742
+ this._markLayoutDirty();
743
+ }
744
+ // ---- Teardown ---------------------------------------------------------
745
+ dispose() {
746
+ if (this.__signals) {
747
+ for (const cell of this.__signals.values()) {
748
+ cell.dispose();
749
+ }
750
+ }
751
+ this.__signals = undefined;
752
+ this.__upgraders = undefined;
753
+ this.__tweens = undefined;
754
+ this.__mappers = undefined;
755
+ this._assets = null;
756
+ }
757
+ }
758
+ __decorate([
759
+ property({ default: 0 })
760
+ ], Node.prototype, "x", void 0);
761
+ __decorate([
762
+ property({ default: 0 })
763
+ ], Node.prototype, "y", void 0);
764
+ __decorate([
765
+ property({ default: 'fill', tween: lerpSizeInput, layout: true })
766
+ ], Node.prototype, "width", void 0);
767
+ __decorate([
768
+ property({ default: 'fill', tween: lerpSizeInput, layout: true })
769
+ ], Node.prototype, "height", void 0);
770
+ __decorate([
771
+ property({ default: 1 })
772
+ ], Node.prototype, "scale", void 0);
773
+ __decorate([
774
+ property({ default: 0 })
775
+ ], Node.prototype, "rotation", void 0);
776
+ __decorate([
777
+ property({ default: 1 })
778
+ ], Node.prototype, "opacity", void 0);
779
+ __decorate([
780
+ property({ default: [], tween: lerpEffectArray, mapper: resolveChainEffects })
781
+ ], Node.prototype, "effects", void 0);
782
+ __decorate([
783
+ property({ default: 0, mapper: resolvePadding, tween: lerpEdgeInset, layout: true })
784
+ ], Node.prototype, "padding", void 0);
785
+ __decorate([
786
+ property({ default: { x: 0, y: 0 }, tween: lerpVector2 })
787
+ ], Node.prototype, "pivot", void 0);
788
+ __decorate([
789
+ property({ default: undefined })
790
+ ], Node.prototype, "column", void 0);
791
+ __decorate([
792
+ property({ default: undefined })
793
+ ], Node.prototype, "row", void 0);
794
+ __decorate([
795
+ property({ default: 1 })
796
+ ], Node.prototype, "colSpan", void 0);
797
+ __decorate([
798
+ property({ default: 1 })
799
+ ], Node.prototype, "rowSpan", void 0);
800
+ //# sourceMappingURL=node.js.map