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

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 (445) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +2 -4
  3. package/dist/assets/errors.js +4 -5
  4. package/dist/assets/errors.js.map +1 -1
  5. package/dist/assets/scope.d.ts +1 -1
  6. package/dist/assets/scope.d.ts.map +1 -1
  7. package/dist/assets/scope.js +1 -1
  8. package/dist/assets/scope.js.map +1 -1
  9. package/dist/attributes/audio/schedule.d.ts +3 -18
  10. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  11. package/dist/attributes/audio/schedule.js.map +1 -1
  12. package/dist/attributes/index.d.ts +3 -5
  13. package/dist/attributes/index.d.ts.map +1 -1
  14. package/dist/attributes/index.js +2 -2
  15. package/dist/attributes/index.js.map +1 -1
  16. package/dist/attributes/layout/insets.d.ts +1 -1
  17. package/dist/attributes/layout/insets.js.map +1 -1
  18. package/dist/attributes/layout/size.d.ts +1 -1
  19. package/dist/attributes/layout/size.js +1 -1
  20. package/dist/attributes/layout/size.js.map +1 -1
  21. package/dist/attributes/properties/decorator.d.ts +44 -11
  22. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  23. package/dist/attributes/properties/decorator.js +37 -9
  24. package/dist/attributes/properties/decorator.js.map +1 -1
  25. package/dist/attributes/properties/inputs.d.ts +1 -1
  26. package/dist/attributes/properties/inputs.js +1 -1
  27. package/dist/attributes/properties/inputs.js.map +1 -1
  28. package/dist/attributes/properties/typed.d.ts +19 -140
  29. package/dist/attributes/properties/typed.d.ts.map +1 -1
  30. package/dist/attributes/properties/typed.js +12 -108
  31. package/dist/attributes/properties/typed.js.map +1 -1
  32. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
  33. package/dist/attributes/shape/corners/corner-radius.js +1 -1
  34. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  35. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
  36. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  37. package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
  38. package/dist/attributes/shape/fill/color/parser.js +1 -1
  39. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  40. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
  41. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  42. package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
  43. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  44. package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
  45. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  46. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  47. package/dist/attributes/shape/fill/lerp.d.ts +1 -1
  48. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  49. package/dist/attributes/shape/filters/chain.d.ts +1 -1
  50. package/dist/attributes/shape/filters/chain.js +1 -1
  51. package/dist/attributes/shape/filters/chain.js.map +1 -1
  52. package/dist/attributes/shape/filters/union.d.ts +4 -3
  53. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  54. package/dist/attributes/shape/filters/union.js.map +1 -1
  55. package/dist/attributes/shape/path/ops.d.ts +1 -2
  56. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  57. package/dist/attributes/shape/path/ops.js.map +1 -1
  58. package/dist/attributes/shared/operators.d.ts +2 -2
  59. package/dist/attributes/shared/operators.js.map +1 -1
  60. package/dist/attributes/text/types.d.ts +2 -3
  61. package/dist/attributes/text/types.d.ts.map +1 -1
  62. package/dist/attributes/text/types.js.map +1 -1
  63. package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
  64. package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
  65. package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
  66. package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
  67. package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
  68. package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
  69. package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
  70. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
  71. package/dist/browser/component.js +1 -1
  72. package/dist/browser/component.js.map +4 -4
  73. package/dist/browser/experimental.js +1 -1
  74. package/dist/browser/index.js +1 -1
  75. package/dist/browser/index.js.map +4 -4
  76. package/dist/browser/manifest.json +2 -4
  77. package/dist/browser/sdk.js +1 -1
  78. package/dist/component.d.ts +10 -18
  79. package/dist/component.d.ts.map +1 -1
  80. package/dist/component.js +10 -17
  81. package/dist/component.js.map +1 -1
  82. package/dist/components/builtins/audio/audio.d.ts +53 -0
  83. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  84. package/dist/components/builtins/audio/audio.js +41 -0
  85. package/dist/components/builtins/audio/audio.js.map +1 -0
  86. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  87. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  88. package/dist/components/builtins/geometry/composite.js +25 -0
  89. package/dist/components/builtins/geometry/composite.js.map +1 -0
  90. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  91. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  92. package/dist/components/builtins/geometry/geometry.js +107 -0
  93. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  94. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  95. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  96. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  97. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  98. package/dist/components/builtins/layout/layout.d.ts +186 -0
  99. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  100. package/dist/components/builtins/layout/layout.js +84 -0
  101. package/dist/components/builtins/layout/layout.js.map +1 -0
  102. package/dist/components/builtins/media/media.d.ts +240 -0
  103. package/dist/components/builtins/media/media.d.ts.map +1 -0
  104. package/dist/components/builtins/media/media.js +149 -0
  105. package/dist/components/builtins/media/media.js.map +1 -0
  106. package/dist/components/builtins/providers/providers.d.ts +47 -0
  107. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  108. package/dist/components/builtins/providers/providers.js +30 -0
  109. package/dist/components/builtins/providers/providers.js.map +1 -0
  110. package/dist/components/builtins/text/number-format.d.ts +66 -0
  111. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  112. package/dist/components/builtins/text/number-format.js +227 -0
  113. package/dist/components/builtins/text/number-format.js.map +1 -0
  114. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  115. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  116. package/dist/components/builtins/text/number-pattern.js +77 -0
  117. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  118. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  119. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  120. package/dist/components/builtins/text/text-defaults.js +37 -0
  121. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  122. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  123. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  124. package/dist/components/builtins/text/text-layout.js +331 -0
  125. package/dist/components/builtins/text/text-layout.js.map +1 -0
  126. package/dist/components/builtins/text/text.d.ts +409 -0
  127. package/dist/components/builtins/text/text.d.ts.map +1 -0
  128. package/dist/components/builtins/text/text.js +113 -0
  129. package/dist/components/builtins/text/text.js.map +1 -0
  130. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  131. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  132. package/dist/components/builtins/three/canvas3d.js +21 -0
  133. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  134. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  135. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  136. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  137. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  138. package/dist/components/builtins/three/three.d.ts +1889 -0
  139. package/dist/components/builtins/three/three.d.ts.map +1 -0
  140. package/dist/components/builtins/three/three.js +305 -0
  141. package/dist/components/builtins/three/three.js.map +1 -0
  142. package/dist/components/factory/api.d.ts +516 -0
  143. package/dist/components/factory/api.d.ts.map +1 -0
  144. package/dist/components/factory/api.js +4 -0
  145. package/dist/components/factory/api.js.map +1 -0
  146. package/dist/components/factory/clip-of.d.ts +5 -0
  147. package/dist/components/factory/clip-of.d.ts.map +1 -0
  148. package/dist/components/factory/clip-of.js +33 -0
  149. package/dist/components/factory/clip-of.js.map +1 -0
  150. package/dist/components/factory/commands-for.d.ts +19 -0
  151. package/dist/components/factory/commands-for.d.ts.map +1 -0
  152. package/dist/components/factory/commands-for.js +5 -0
  153. package/dist/components/factory/commands-for.js.map +1 -0
  154. package/dist/components/factory/component-audio.d.ts +9 -0
  155. package/dist/components/factory/component-audio.d.ts.map +1 -0
  156. package/dist/components/factory/component-audio.js +18 -0
  157. package/dist/components/factory/component-audio.js.map +1 -0
  158. package/dist/components/factory/component2d.d.ts +8 -0
  159. package/dist/components/factory/component2d.d.ts.map +1 -0
  160. package/dist/components/factory/component2d.js +240 -0
  161. package/dist/components/factory/component2d.js.map +1 -0
  162. package/dist/components/factory/component3d.d.ts +9 -0
  163. package/dist/components/factory/component3d.d.ts.map +1 -0
  164. package/dist/components/factory/component3d.js +99 -0
  165. package/dist/components/factory/component3d.js.map +1 -0
  166. package/dist/components/factory/factory.d.ts +63 -0
  167. package/dist/components/factory/factory.d.ts.map +1 -0
  168. package/dist/components/factory/factory.js +313 -0
  169. package/dist/components/factory/factory.js.map +1 -0
  170. package/dist/components/factory/timeline.d.ts +22 -0
  171. package/dist/components/factory/timeline.d.ts.map +1 -0
  172. package/dist/components/factory/timeline.js +128 -0
  173. package/dist/components/factory/timeline.js.map +1 -0
  174. package/dist/components/factory/type-def.d.ts +26 -0
  175. package/dist/components/factory/type-def.d.ts.map +1 -0
  176. package/dist/components/factory/type-def.js +16 -0
  177. package/dist/components/factory/type-def.js.map +1 -0
  178. package/dist/components/factory/types.d.ts +91 -0
  179. package/dist/components/factory/types.d.ts.map +1 -0
  180. package/dist/components/factory/types.js +88 -0
  181. package/dist/components/factory/types.js.map +1 -0
  182. package/dist/components/factory/views.d.ts +121 -0
  183. package/dist/components/factory/views.d.ts.map +1 -0
  184. package/dist/components/factory/views.js +413 -0
  185. package/dist/components/factory/views.js.map +1 -0
  186. package/dist/components/modules/aim.d.ts +30 -0
  187. package/dist/components/modules/aim.d.ts.map +1 -0
  188. package/dist/components/modules/aim.js +39 -0
  189. package/dist/components/modules/aim.js.map +1 -0
  190. package/dist/components/modules/corners.d.ts +13 -0
  191. package/dist/components/modules/corners.d.ts.map +1 -0
  192. package/dist/components/modules/corners.js +12 -0
  193. package/dist/components/modules/corners.js.map +1 -0
  194. package/dist/components/modules/flow.d.ts +26 -0
  195. package/dist/components/modules/flow.d.ts.map +1 -0
  196. package/dist/components/modules/flow.js +57 -0
  197. package/dist/components/modules/flow.js.map +1 -0
  198. package/dist/components/modules/material.d.ts +40 -0
  199. package/dist/components/modules/material.d.ts.map +1 -0
  200. package/dist/components/modules/material.js +75 -0
  201. package/dist/components/modules/material.js.map +1 -0
  202. package/dist/components/modules/paint.d.ts +71 -0
  203. package/dist/components/modules/paint.d.ts.map +1 -0
  204. package/dist/components/modules/paint.js +106 -0
  205. package/dist/components/modules/paint.js.map +1 -0
  206. package/dist/components/modules/shapes.d.ts +31 -0
  207. package/dist/components/modules/shapes.d.ts.map +1 -0
  208. package/dist/components/modules/shapes.js +43 -0
  209. package/dist/components/modules/shapes.js.map +1 -0
  210. package/dist/components/modules/text-layout.d.ts +26 -0
  211. package/dist/components/modules/text-layout.d.ts.map +1 -0
  212. package/dist/components/modules/text-layout.js +57 -0
  213. package/dist/components/modules/text-layout.js.map +1 -0
  214. package/dist/components/modules/text-style.d.ts +48 -0
  215. package/dist/components/modules/text-style.d.ts.map +1 -0
  216. package/dist/components/modules/text-style.js +63 -0
  217. package/dist/components/modules/text-style.js.map +1 -0
  218. package/dist/components/modules/three-entries.d.ts +23 -0
  219. package/dist/components/modules/three-entries.d.ts.map +1 -0
  220. package/dist/components/modules/three-entries.js +41 -0
  221. package/dist/components/modules/three-entries.js.map +1 -0
  222. package/dist/components/modules/view3d.d.ts +59 -0
  223. package/dist/components/modules/view3d.d.ts.map +1 -0
  224. package/dist/components/modules/view3d.js +171 -0
  225. package/dist/components/modules/view3d.js.map +1 -0
  226. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  227. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  228. package/dist/components/trees/2d/group-bounds.js +87 -0
  229. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  230. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  231. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  232. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  233. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  234. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  235. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  236. package/dist/components/trees/2d/node-motion.js +86 -0
  237. package/dist/components/trees/2d/node-motion.js.map +1 -0
  238. package/dist/components/trees/2d/node-render.d.ts +36 -0
  239. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  240. package/dist/components/trees/2d/node-render.js +67 -0
  241. package/dist/components/trees/2d/node-render.js.map +1 -0
  242. package/dist/components/trees/2d/node-space.d.ts +63 -0
  243. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  244. package/dist/components/trees/2d/node-space.js +131 -0
  245. package/dist/components/trees/2d/node-space.js.map +1 -0
  246. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  247. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  248. package/dist/components/trees/2d/node-transform.js +73 -0
  249. package/dist/components/trees/2d/node-transform.js.map +1 -0
  250. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  251. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  252. package/dist/components/trees/2d/node2d.js +1481 -0
  253. package/dist/components/trees/2d/node2d.js.map +1 -0
  254. package/dist/components/trees/audio/index.d.ts +2 -0
  255. package/dist/components/trees/audio/index.d.ts.map +1 -0
  256. package/dist/components/trees/audio/index.js +2 -0
  257. package/dist/components/trees/audio/index.js.map +1 -0
  258. package/dist/components/trees/audio/node-audio.d.ts +109 -0
  259. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  260. package/dist/components/trees/audio/node-audio.js +167 -0
  261. package/dist/components/trees/audio/node-audio.js.map +1 -0
  262. package/dist/components/trees/index.d.ts +10 -0
  263. package/dist/components/trees/index.d.ts.map +1 -0
  264. package/dist/components/trees/index.js +14 -0
  265. package/dist/components/trees/index.js.map +1 -0
  266. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  267. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  268. package/dist/components/trees/node/node-editor-state.js +23 -0
  269. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  270. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  271. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  272. package/dist/components/trees/node/node-reactive.js +135 -0
  273. package/dist/components/trees/node/node-reactive.js.map +1 -0
  274. package/dist/components/trees/node/node-time.d.ts +39 -0
  275. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  276. package/dist/components/trees/node/node-time.js +14 -0
  277. package/dist/components/trees/node/node-time.js.map +1 -0
  278. package/dist/components/trees/node/node-walk.d.ts +46 -0
  279. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  280. package/dist/components/trees/node/node-walk.js +74 -0
  281. package/dist/components/trees/node/node-walk.js.map +1 -0
  282. package/dist/components/trees/node/node.d.ts +401 -0
  283. package/dist/components/trees/node/node.d.ts.map +1 -0
  284. package/dist/components/trees/node/node.js +680 -0
  285. package/dist/components/trees/node/node.js.map +1 -0
  286. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  287. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  288. package/dist/components/trees/root/canvas2d-node.js +216 -0
  289. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  290. package/dist/components/trees/three/node3d.d.ts +222 -0
  291. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  292. package/dist/components/trees/three/node3d.js +289 -0
  293. package/dist/components/trees/three/node3d.js.map +1 -0
  294. package/dist/document/builtins.js +13 -13
  295. package/dist/document/builtins.js.map +1 -1
  296. package/dist/document/command-traits.d.ts +2 -2
  297. package/dist/document/command-traits.js +1 -1
  298. package/dist/document/command-traits.js.map +1 -1
  299. package/dist/document/deny-globals.d.ts +2 -2
  300. package/dist/document/deny-globals.js +2 -2
  301. package/dist/document/deny-globals.js.map +1 -1
  302. package/dist/document/expression/index.d.ts +1 -1
  303. package/dist/document/expression/index.js +1 -1
  304. package/dist/document/expression/index.js.map +1 -1
  305. package/dist/document/expression/ops.js +1 -1
  306. package/dist/document/expression/ops.js.map +1 -1
  307. package/dist/document/index.d.ts +1 -2
  308. package/dist/document/index.d.ts.map +1 -1
  309. package/dist/document/index.js +1 -2
  310. package/dist/document/index.js.map +1 -1
  311. package/dist/document/node-decorator.d.ts +14 -10
  312. package/dist/document/node-decorator.d.ts.map +1 -1
  313. package/dist/document/node-decorator.js +14 -10
  314. package/dist/document/node-decorator.js.map +1 -1
  315. package/dist/document/node-descriptor.d.ts +3 -3
  316. package/dist/document/node-descriptor.d.ts.map +1 -1
  317. package/dist/document/node-descriptor.js.map +1 -1
  318. package/dist/document/registry.d.ts +23 -25
  319. package/dist/document/registry.d.ts.map +1 -1
  320. package/dist/document/registry.js +12 -18
  321. package/dist/document/registry.js.map +1 -1
  322. package/dist/document/timeline.d.ts +3 -3
  323. package/dist/document/timeline.d.ts.map +1 -1
  324. package/dist/document/timeline.js +2 -2
  325. package/dist/document/timeline.js.map +1 -1
  326. package/dist/document/types.d.ts +4 -4
  327. package/dist/document/types.js.map +1 -1
  328. package/dist/document/validate.d.ts +1 -1
  329. package/dist/document/validate.js.map +1 -1
  330. package/dist/experimental.d.ts +19 -19
  331. package/dist/experimental.d.ts.map +1 -1
  332. package/dist/experimental.js +17 -17
  333. package/dist/experimental.js.map +1 -1
  334. package/dist/index.d.ts +10 -11
  335. package/dist/index.d.ts.map +1 -1
  336. package/dist/index.js +10 -11
  337. package/dist/index.js.map +1 -1
  338. package/dist/layout/types.d.ts +1 -1
  339. package/dist/layout/types.js.map +1 -1
  340. package/dist/props/host.d.ts +1 -1
  341. package/dist/props/host.js.map +1 -1
  342. package/dist/props/slot.d.ts +1 -1
  343. package/dist/props/slot.js +1 -1
  344. package/dist/props/slot.js.map +1 -1
  345. package/dist/render/clip.d.ts +1 -1
  346. package/dist/render/clip.js +1 -1
  347. package/dist/render/clip.js.map +1 -1
  348. package/dist/render/descriptors/rect.js.map +1 -1
  349. package/dist/render/descriptors/text.d.ts +11 -5
  350. package/dist/render/descriptors/text.d.ts.map +1 -1
  351. package/dist/render/descriptors/text.js +7 -1
  352. package/dist/render/descriptors/text.js.map +1 -1
  353. package/dist/render/render-context2d.d.ts +2 -2
  354. package/dist/render/render-context2d.js.map +1 -1
  355. package/dist/render3d/builders.d.ts +1 -1
  356. package/dist/render3d/builders.js +1 -1
  357. package/dist/render3d/builders.js.map +1 -1
  358. package/dist/render3d/graphics3d.d.ts +13 -19
  359. package/dist/render3d/graphics3d.d.ts.map +1 -1
  360. package/dist/render3d/graphics3d.js +13 -19
  361. package/dist/render3d/graphics3d.js.map +1 -1
  362. package/dist/render3d/scene3d.d.ts +1 -1
  363. package/dist/render3d/scene3d.js +1 -1
  364. package/dist/render3d/scene3d.js.map +1 -1
  365. package/dist/render3d/texture.d.ts +2 -2
  366. package/dist/render3d/texture.d.ts.map +1 -1
  367. package/dist/render3d/texture.js.map +1 -1
  368. package/dist/render3d/vector3.d.ts +2 -2
  369. package/dist/render3d/vector3.js +2 -2
  370. package/dist/render3d/vector3.js.map +1 -1
  371. package/dist/runtime/asset-refine.d.ts +1 -1
  372. package/dist/runtime/asset-refine.d.ts.map +1 -1
  373. package/dist/runtime/asset-refine.js +1 -1
  374. package/dist/runtime/asset-refine.js.map +1 -1
  375. package/dist/runtime/asset-update.js +1 -1
  376. package/dist/runtime/asset-update.js.map +1 -1
  377. package/dist/runtime/audio-index.d.ts +0 -11
  378. package/dist/runtime/audio-index.d.ts.map +1 -1
  379. package/dist/runtime/audio-index.js +0 -25
  380. package/dist/runtime/audio-index.js.map +1 -1
  381. package/dist/runtime/clip-instance.d.ts +3 -3
  382. package/dist/runtime/clip-instance.d.ts.map +1 -1
  383. package/dist/runtime/clip-instance.js +4 -4
  384. package/dist/runtime/clip-instance.js.map +1 -1
  385. package/dist/runtime/clip-store.d.ts +2 -3
  386. package/dist/runtime/clip-store.d.ts.map +1 -1
  387. package/dist/runtime/clip-store.js +17 -35
  388. package/dist/runtime/clip-store.js.map +1 -1
  389. package/dist/runtime/engine.d.ts +3 -3
  390. package/dist/runtime/engine.js +2 -2
  391. package/dist/runtime/engine.js.map +1 -1
  392. package/dist/runtime/node-picking.d.ts +2 -2
  393. package/dist/runtime/node-picking.d.ts.map +1 -1
  394. package/dist/runtime/node-picking.js +3 -3
  395. package/dist/runtime/node-picking.js.map +1 -1
  396. package/dist/runtime/node-picking3d.d.ts +2 -2
  397. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  398. package/dist/runtime/node-picking3d.js +1 -1
  399. package/dist/runtime/node-picking3d.js.map +1 -1
  400. package/dist/runtime/playback-controller.d.ts +2 -2
  401. package/dist/runtime/playback-controller.d.ts.map +1 -1
  402. package/dist/runtime/playback-controller.js +1 -1
  403. package/dist/runtime/playback-controller.js.map +1 -1
  404. package/dist/runtime/state-evaluator.d.ts +2 -2
  405. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  406. package/dist/runtime/state-evaluator.js.map +1 -1
  407. package/dist/runtime/text-geometry.d.ts +1 -1
  408. package/dist/runtime/text-geometry.d.ts.map +1 -1
  409. package/dist/runtime/text-geometry.js +4 -5
  410. package/dist/runtime/text-geometry.js.map +1 -1
  411. package/dist/sdk/index.d.ts +43 -39
  412. package/dist/sdk/index.d.ts.map +1 -1
  413. package/dist/sdk/index.js +24 -25
  414. package/dist/sdk/index.js.map +1 -1
  415. package/dist/tween/command-decorator.d.ts +7 -9
  416. package/dist/tween/command-decorator.d.ts.map +1 -1
  417. package/dist/tween/command-decorator.js +2 -2
  418. package/dist/tween/command-decorator.js.map +1 -1
  419. package/dist/tween/command.d.ts +1 -1
  420. package/dist/tween/command.js.map +1 -1
  421. package/dist/tween/index.d.ts +2 -1
  422. package/dist/tween/index.d.ts.map +1 -1
  423. package/dist/tween/index.js +1 -1
  424. package/dist/tween/index.js.map +1 -1
  425. package/dist/tween/loop.d.ts +1 -1
  426. package/dist/tween/loop.js +1 -1
  427. package/dist/tween/loop.js.map +1 -1
  428. package/dist/util/reference.d.ts +6 -6
  429. package/dist/util/reference.js.map +1 -1
  430. package/package.json +2 -10
  431. package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
  432. package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
  433. package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
  434. package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
  435. package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
  436. package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
  437. package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
  438. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  439. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  440. package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
  441. package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
  442. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  443. package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
  444. package/dist/browser/jsx-jsx-runtime.js +0 -2
  445. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/attributes/properties/decorator.ts"],"names":[],"mappings":"AA8DA,mEAAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC5C,OAAO,WAAW,CAAe,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAA4B,QAAgB,EAAE,MAAc;IACnF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;QACzC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACrB,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,MAAM,EAAE,GAAG,IAAI,GAAG,EAAkB,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC;YAAE,SAAS;QAC/D,KAAK,MAAM,CAAC,IAAK,CAAyB,CAAC,MAAM,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBAClB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC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,GAAG,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { TweenFn } from \"@/props/host\";\r\n\r\nexport interface PropOptions<Ext, Int> {\r\n /** Lerp the *internal* (post-mapper) value during `to()`. Each step is stored as it returns, not mapped again, so a prop that must hold a range under an overshooting ease clamps here too. */\r\n tween?: TweenFn<Int>;\r\n /** Converts the external input into the internal stored value. Receives the previous internal value as the second arg when available. */\r\n mapper?: (ext: Ext, prev?: Int) => Int;\r\n}\r\n\r\n\r\nexport interface PropertyMeta {\r\n key: string;\r\n default?: unknown;\r\n options?: PropOptions<any, any>;\r\n /** How a host edits this prop — see {@link PropertyEditor}. */\r\n editor?: PropertyEditor;\r\n /** Withdrawn by a subclass: undescribed, and held at its default. See `withdraw`. */\r\n withdrawn?: boolean;\r\n}\r\n\r\n/**\r\n * What a host needs to draw a control for a property.\r\n *\r\n * Declared **on the property**, because that is the thing it edits. A node type\r\n * used to describe its controls in a separate list — a `fields` array beside the\r\n * class, or a manifest beside the package — and a list of props next to a class\r\n * of props is the shape that drifts: rename one and nothing says the other is\r\n * now describing something that no longer exists.\r\n *\r\n * Nothing here is read while rendering. A frame is identical whether a prop\r\n * declares a range or not; this exists so an editor has one place to ask.\r\n */\r\nexport interface PropertyEditor {\r\n /**\r\n * The control to draw. Inferred when absent — a typed decorator knows its\r\n * own (`@colorProperty` is a colour), and a plain `@property` reads it off\r\n * the default's type.\r\n */\r\n kind?: string;\r\n /** Bounds and granularity for a numeric control. */\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n /** What the number means, for a host that labels it — `\"°\"`, `\"s\"`, `\"×\"`. */\r\n unit?: string;\r\n /** The choices, for an enum. */\r\n options?: readonly string[];\r\n /** Whether a document may tween it. Defaults to true. */\r\n animatable?: boolean;\r\n /**\r\n * The controls *inside* an object-valued prop.\r\n *\r\n * An axis config or a theme is one property holding several editable values,\r\n * and a host draws them as a group. Declaring them here keeps them attached\r\n * to the prop they belong to rather than flattened into a list that has to\r\n * name its own parent.\r\n */\r\n properties?: Record<string, PropertyEditor>;\r\n /** Whatever a control needs that this vocabulary does not name. */\r\n [option: string]: unknown;\r\n}\r\n\r\n/** Symbol used to store @property metadata on class prototypes. */\r\nexport const PROPERTY_META = Symbol(\"propertyMeta\");\r\n\r\n/**\r\n * Every `@property` on an instance's class, inherited included, ordered base →\r\n * subclass so `initProps` applies them in declaration order. A subclass that\r\n * redeclares a key replaces the inherited declaration whole — default, mapper,\r\n * tween and editor — at the position the base gave it.\r\n */\r\nexport function getPropertyMeta(instance: object): PropertyMeta[] {\r\n return mostDerived<PropertyMeta>(instance, PROPERTY_META);\r\n}\r\n\r\n/**\r\n * The per-key declarations stored under `symbol` along `instance`'s prototype\r\n * chain: base first, one entry per key, the most-derived declaration of each.\r\n */\r\nexport function mostDerived<M extends { key: string }>(instance: object, symbol: symbol): M[] {\r\n const chain: object[] = [];\r\n let proto = Object.getPrototypeOf(instance);\r\n while (proto && proto !== Object.prototype) {\r\n chain.unshift(proto);\r\n proto = Object.getPrototypeOf(proto);\r\n }\r\n const result: M[] = [];\r\n const at = new Map<string, number>();\r\n for (const p of chain) {\r\n if (!Object.prototype.hasOwnProperty.call(p, symbol)) continue;\r\n for (const m of (p as Record<symbol, M[]>)[symbol]) {\r\n const i = at.get(m.key);\r\n if (i === undefined) {\r\n at.set(m.key, result.length);\r\n result.push(m);\r\n } else {\r\n result[i] = m;\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Legacy property decorator (`experimentalDecorators: true`) that declares a\r\n * property on a `Node` subclass. Redeclaring an inherited key overrides it; see\r\n * {@link getPropertyMeta}.\r\n *\r\n * @example\r\n * ```ts\r\n * @property({ default: 0 }) declare x: number;\r\n *\r\n * @property({ mapper: fillOps.resolve, tween: fillOps.lerp })\r\n * declare fill: FillResolved[];\r\n * ```\r\n *\r\n * The `default` value is used when the corresponding key is absent from the\r\n * constructor `props` object. The `mapper` / `tween` options are forwarded\r\n * directly to `applyProp()`.\r\n */\r\nexport function property<Ext = any, Int = Ext>(opts?: {\r\n default?: Ext;\r\n mapper?: (ext: Ext, prev?: Int) => Int;\r\n tween?: TweenFn<Int>;\r\n} & PropertyEditor) {\r\n // Legacy decorator: (target: object, propertyKey: string | symbol) => void\r\n return function (target: object, propertyKey: string | symbol): void {\r\n const key = propertyKey as string;\r\n // `default`, `mapper` and `tween` drive the prop slot; everything else is\r\n // the editor's, and is carried rather than interpreted.\r\n const { default: fallback, mapper, tween, ...editor } = opts ?? {};\r\n const meta: PropertyMeta = {\r\n key,\r\n default: fallback,\r\n options: (mapper != null || tween != null)\r\n ? { mapper: mapper as ((ext: any) => any) | undefined, tween: tween as TweenFn<any> | undefined }\r\n : undefined,\r\n ...(Object.keys(editor).length > 0 ? { editor: editor as PropertyEditor } : {}),\r\n };\r\n\r\n // Store metadata on the class prototype (own property so getPropertyMeta\r\n // can distinguish each class's own entries from inherited ones).\r\n if (!Object.prototype.hasOwnProperty.call(target, PROPERTY_META)) {\r\n (target as any)[PROPERTY_META] = [];\r\n }\r\n const list: PropertyMeta[] = (target as any)[PROPERTY_META];\r\n if (!list.some(m => m.key === key)) {\r\n list.push(meta);\r\n }\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/attributes/properties/decorator.ts"],"names":[],"mappings":"AA8DA,kEAAkE;AAClE,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC5C,OAAO,WAAW,CAAe,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAA4B,QAAgB,EAAE,MAAc;IACnF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,GAAG,MAAM,CAAC,c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ACH,MAAM,UAAU,QAAQ,CAAuB,IAI7B;IACd,OAAO,UAAU,MAAc,EAAE,WAA4B;QACzD,MAAM,GAAG,GAAG,WAAqB,CAAC;QAClC,0EAA0E;QAC1E,wDAAwD;QACxD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;QACnE,MAAM,IAAI,GAAiB;YACvB,GAAG;YACH,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,CAAC,MAAM,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC;gBACtC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAyC,EAAE,KAAK,EAAE,KAAiC,EAAE;gBACjG,CAAC,CAAC,SAAS;YACf,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAwB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClF,CAAC;QAEF,yEAAyE;QACzE,iEAAiE;QACjE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;YAC9D,MAAc,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QACxC,CAAC;QACD,MAAM,IAAI,GAAoB,MAAc,CAAC,aAAa,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { TweenFn } from \"@/props/host\";\r\n\r\nexport interface PropOptions<Ext, Int> {\r\n /** Lerp the *internal* (post-mapper) value during `to()`. Each step is stored as it returns, not mapped again, so a prop that must hold a range under an overshooting ease clamps here too. */\r\n tween?: TweenFn<Int>;\r\n /** Converts the external input into the internal stored value. Receives the previous internal value as the second arg when available. */\r\n mapper?: (ext: Ext, prev?: Int) => Int;\r\n}\r\n\r\n\r\nexport interface PropertyMeta {\r\n key: string;\r\n default?: unknown;\r\n options?: PropOptions<any, any>;\r\n /** How a host edits this prop — see {@link PropertyEditor}. */\r\n editor?: PropertyEditor;\r\n /** @deprecated Nothing sets it: the engine withdraws no property. Kept so a host that tests it still compiles. */\r\n withdrawn?: boolean;\r\n}\r\n\r\n/**\r\n * What a host needs to draw a control for a property.\r\n *\r\n * Declared **on the property**, because that is the thing it edits. A node type\r\n * used to describe its controls in a separate list — a `fields` array beside the\r\n * class, or a manifest beside the package — and a list of props next to a class\r\n * of props is the shape that drifts: rename one and nothing says the other is\r\n * now describing something that no longer exists.\r\n *\r\n * Nothing here is read while rendering. A frame is identical whether a prop\r\n * declares a range or not; this exists so an editor has one place to ask.\r\n */\r\nexport interface PropertyEditor {\r\n /**\r\n * The control to draw. Inferred when absent — a typed entry knows its\r\n * own (`Types.color` is a colour), and a plain `property` reads it off\r\n * the default's type.\r\n */\r\n kind?: string;\r\n /** Bounds and granularity for a numeric control. */\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n /** What the number means, for a host that labels it — `\"°\"`, `\"s\"`, `\"×\"`. */\r\n unit?: string;\r\n /** The choices, for an enum. */\r\n options?: readonly string[];\r\n /** Whether a document may tween it. Defaults to true. */\r\n animatable?: boolean;\r\n /**\r\n * The controls *inside* an object-valued prop.\r\n *\r\n * An axis config or a theme is one property holding several editable values,\r\n * and a host draws them as a group. Declaring them here keeps them attached\r\n * to the prop they belong to rather than flattened into a list that has to\r\n * name its own parent.\r\n */\r\n properties?: Record<string, PropertyEditor>;\r\n /** Whatever a control needs that this vocabulary does not name. */\r\n [option: string]: unknown;\r\n}\r\n\r\n/** Symbol used to store property metadata on class prototypes. */\r\nexport const PROPERTY_META = Symbol(\"propertyMeta\");\r\n\r\n/**\r\n * Every `property` on an instance's class, inherited included, ordered base →\r\n * subclass so `initProps` applies them in declaration order. A subclass that\r\n * redeclares a key replaces the inherited declaration whole — default, mapper,\r\n * tween and editor — at the position the base gave it.\r\n */\r\nexport function getPropertyMeta(instance: object): PropertyMeta[] {\r\n return mostDerived<PropertyMeta>(instance, PROPERTY_META);\r\n}\r\n\r\n/**\r\n * The per-key declarations stored under `symbol` along `instance`'s prototype\r\n * chain: base first, one entry per key, the most-derived declaration of each.\r\n */\r\nexport function mostDerived<M extends { key: string }>(instance: object, symbol: symbol): M[] {\r\n const chain: object[] = [];\r\n let proto = Object.getPrototypeOf(instance);\r\n while (proto && proto !== Object.prototype) {\r\n chain.unshift(proto);\r\n proto = Object.getPrototypeOf(proto);\r\n }\r\n const result: M[] = [];\r\n const at = new Map<string, number>();\r\n for (const p of chain) {\r\n if (!Object.prototype.hasOwnProperty.call(p, symbol)) continue;\r\n for (const m of (p as Record<symbol, M[]>)[symbol]) {\r\n const i = at.get(m.key);\r\n if (i === undefined) {\r\n at.set(m.key, result.length);\r\n result.push(m);\r\n } else {\r\n result[i] = m;\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * A registration for one member of a node class: what `property(...)` and\r\n * `command(...)` return, applied to the class's prototype under the member's\r\n * key by {@link declareMembers}.\r\n */\r\nexport type MemberRegistration = (target: object, key: string) => void;\r\n\r\n/**\r\n * Registers properties and commands on a node class, in the order given.\r\n *\r\n * Core's own base classes (`Node`, `Node2D`, `Node3D`, …) declare their props\r\n * as `declare` fields and register them here, right after the class body.\r\n * Order is meaningful: {@link getPropertyMeta} lists properties in\r\n * registration order, which is the order `Registry.describe` hands a host's\r\n * inspector, so a new entry goes where it should appear.\r\n *\r\n * @example\r\n * ```ts\r\n * class Dial extends Node2D<DialProps> {\r\n * declare level: number;\r\n * turn(args: CommandArgs<{ by: number }>) { … }\r\n * }\r\n * declareMembers(Dial, {\r\n * level: property({ default: 0 }),\r\n * turn: command({ args: [\"by\"] }),\r\n * });\r\n * ```\r\n *\r\n * Node types outside core are components (`component2d`), which do this for\r\n * their `props` and `commands` themselves.\r\n */\r\nexport function declareMembers<C extends abstract new (...args: never[]) => object>(\r\n ctor: C,\r\n members: { [K in keyof InstanceType<C> & string]?: MemberRegistration },\r\n): void {\r\n for (const [key, register] of Object.entries(members) as [string, MemberRegistration][]) {\r\n register(ctor.prototype as object, key);\r\n }\r\n}\r\n\r\n/**\r\n * Declares a property on a `Node` subclass: applied to the prototype under the\r\n * property's key, directly or through {@link declareMembers}. Redeclaring an\r\n * inherited key overrides it; see {@link getPropertyMeta}.\r\n *\r\n * @example\r\n * ```ts\r\n * declareMembers(Glow, {\r\n * radius: property({ default: 0 }),\r\n * fill: property({ mapper: fillOps.resolve, tween: fillOps.lerp }),\r\n * });\r\n * ```\r\n *\r\n * The `default` value is used when the corresponding key is absent from the\r\n * constructor `props` object. The `mapper` / `tween` options are forwarded\r\n * directly to `applyProp()`.\r\n */\r\nexport function property<Ext = any, Int = Ext>(opts?: {\r\n default?: Ext;\r\n mapper?: (ext: Ext, prev?: Int) => Int;\r\n tween?: TweenFn<Int>;\r\n} & PropertyEditor) {\r\n return function (target: object, propertyKey: string | symbol): void {\r\n const key = propertyKey as string;\r\n // `default`, `mapper` and `tween` drive the prop slot; everything else is\r\n // the editor's, and is carried rather than interpreted.\r\n const { default: fallback, mapper, tween, ...editor } = opts ?? {};\r\n const meta: PropertyMeta = {\r\n key,\r\n default: fallback,\r\n options: (mapper != null || tween != null)\r\n ? { mapper: mapper as ((ext: any) => any) | undefined, tween: tween as TweenFn<any> | undefined }\r\n : undefined,\r\n ...(Object.keys(editor).length > 0 ? { editor: editor as PropertyEditor } : {}),\r\n };\r\n\r\n // Store metadata on the class prototype (own property so getPropertyMeta\r\n // can distinguish each class's own entries from inherited ones).\r\n if (!Object.prototype.hasOwnProperty.call(target, PROPERTY_META)) {\r\n (target as any)[PROPERTY_META] = [];\r\n }\r\n const list: PropertyMeta[] = (target as any)[PROPERTY_META];\r\n if (!list.some(m => m.key === key)) {\r\n list.push(meta);\r\n }\r\n };\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Reactive-prop input shapes. A `@property`-backed field accepts either a plain
2
+ * Reactive-prop input shapes. A `property`-backed field accepts either a plain
3
3
  * value or a `() => value` callback that binds the prop to a derived value
4
4
  * (re-evaluated whenever its dependencies change).
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Reactive-prop input shapes. A `@property`-backed field accepts either a plain
2
+ * Reactive-prop input shapes. A `property`-backed field accepts either a plain
3
3
  * value or a `() => value` callback that binds the prop to a derived value
4
4
  * (re-evaluated whenever its dependencies change).
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../../src/attributes/properties/inputs.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\r\n * Reactive-prop input shapes. A `@property`-backed field accepts either a plain\r\n * value or a `() => value` callback that binds the prop to a derived value\r\n * (re-evaluated whenever its dependencies change).\r\n */\r\n\r\n/** @internal A single prop input: a constant value or a reactive callback producing it. */\r\nexport type PropInput<T> = T | (() => T);\r\n\r\n/** @internal Maps every key of a props object to its {@link PropInput} form. */\r\nexport type PropInputs<P> = {\r\n [K in keyof P]?: P[K] | (() => P[K]);\r\n};\r\n"]}
1
+ {"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../../src/attributes/properties/inputs.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\r\n * Reactive-prop input shapes. A `property`-backed field accepts either a plain\r\n * value or a `() => value` callback that binds the prop to a derived value\r\n * (re-evaluated whenever its dependencies change).\r\n */\r\n\r\n/** @internal A single prop input: a constant value or a reactive callback producing it. */\r\nexport type PropInput<T> = T | (() => T);\r\n\r\n/** @internal Maps every key of a props object to its {@link PropInput} form. */\r\nexport type PropInputs<P> = {\r\n [K in keyof P]?: P[K] | (() => P[K]);\r\n};\r\n"]}
@@ -1,57 +1,29 @@
1
1
  import { TweenFn } from "../../props/host.js";
2
2
  import { type Fill } from "../../attributes/shape/fill/chain.js";
3
3
  import { FillResolved } from "../../attributes/shape/fill/union.js";
4
- import { Color, NormalizedColor } from "../../attributes/shape/fill/color/parser.js";
5
- import { type Stroke, StrokeResolved } from "../../attributes/shape/stroke/stroke.js";
6
- import { type Shadow, ShadowResolved } from "../../attributes/shape/shadow/shadow.js";
7
4
  import { type Effect } from "../../attributes/shape/effects/chain.js";
8
5
  import { NodeEffect } from "../../attributes/shape/effects/union.js";
9
- import { RectCornerRadius, CornerRadiusResolved } from "../../attributes/shape/corners/corner-radius.js";
10
- import { RectCornerStyle, CornerStyleResolved } from "../../attributes/shape/corners/corner-style.js";
11
6
  import { Insets, InsetsResolved } from "../../attributes/layout/insets.js";
12
7
  import { Alignment } from "../../attributes/layout/alignment.js";
13
8
  import { Vector2 } from "../../attributes/layout/vector2.js";
14
- import { SizeInput } from "../../attributes/layout/size.js";
15
9
  import type { FlowMode, FlowResolved } from "../../layout/types.js";
16
10
  import { type AudioFilter } from "../../attributes/audio/filters/chain.js";
17
11
  import { AudioFilterItem } from "../../attributes/audio/filters/union.js";
18
12
  import { type Param } from "../../attributes/audio/filters/curve.js";
19
- import { type Euler3, type Quaternion, type Vector3, type Vector3Input } from "../../render3d/vector3.js";
20
- import { PathData } from "../../render/descriptors/path.js";
13
+ import { type Quaternion } from "../../render3d/vector3.js";
21
14
  /**
22
- * Attribute-typed variants of `@property`.
15
+ * Attribute-typed variants of `property`, for the props the tree bases declare
16
+ * themselves (`Node2D`, `Node3D`, `NodeAudio`, the root `Canvas2D`).
23
17
  *
24
- * A rich attribute (a fill, a stroke, a corner radius) is only declarative and
25
- * tweenable because its `@property` carries the matching *mapper* (loose author
18
+ * A rich attribute (a fill, an effect chain, an inset) is only declarative and
19
+ * tweenable because its `property` carries the matching *mapper* (loose author
26
20
  * input → resolved value) and *tween* (how the resolved value interpolates) —
27
- * together, an `AttributeOps` (`attributes/shared/operators.ts`). Getting that
28
- * pair right means knowing which `resolve`/`lerp` belong together — several are
29
- * `@internal` — so a custom node that wants a second fill has to copy an
30
- * incantation out of `ShapeNode`.
31
- *
32
- * These decorators pre-bake each attribute's `AttributeOps`. `@fillProperty()` is
33
- * exactly `@property({ default: [], mapper: fillOps.resolve, tween: fillOps.lerp })`,
34
- * so everything downstream — `set()`, `to()`, `save()`/`restore()`, `() => …`
35
- * bindings — behaves identically; only the declaration gets shorter.
36
- *
37
- * ```ts
38
- * class Card extends Rect {
39
- * @fillProperty({ default: "white/10" }) declare glow: Fill;
40
- * @strokeProperty() declare edge: Stroke;
41
- * @cornerRadiusProperty({ default: 12 }) declare notch: RectCornerRadius;
42
- * }
43
- *
44
- * // <Card glow="red" /> · card().to({ data: { glow: Fills.linearGradient([...]) }, duration: 0.6 })
45
- * ```
46
- *
47
- * Each takes the same options as `@property` — `default`, plus `mapper`/`tween`
48
- * to override the built-in pair for a one-off case.
49
- *
50
- * As with `@property`, the field is declared with the **loose author-facing**
51
- * type (`Fill`, not `FillResolved[]`) so assignment and reads share one type;
52
- * the accessor stores the resolved value and consumers cast at the read site.
21
+ * together, an `AttributeOps` (`attributes/shared/operators.ts`). These pre-bake
22
+ * each pair: `fillProperty()` is exactly
23
+ * `property({ default: [], mapper: fillOps.resolve, tween: fillOps.lerp, kind: "fills" })`.
24
+ * A component declares the same pairs as state entries (`Types.fill`, …).
53
25
  */
54
- export interface AttributePropOptions<Ext, Int> {
26
+ interface AttributePropOptions<Ext, Int> {
55
27
  /** Initial value, used when the constructor `props` object omits the key. */
56
28
  default?: Ext;
57
29
  /** Override the attribute's built-in external → internal mapper. */
@@ -59,73 +31,22 @@ export interface AttributePropOptions<Ext, Int> {
59
31
  /** Override the attribute's built-in lerp for `to()`. */
60
32
  tween?: TweenFn<Int>;
61
33
  }
62
- /**
63
- * A fill-layer property: accepts everything the built-in `fill` prop does (a CSS
64
- * string, a fill prop object, a `Fills` chain, or an array of them) and lerps
65
- * layer-by-layer.
66
- *
67
- * Note this only makes the *property* behave like `fill`; the node still has to
68
- * paint it (`ctx.draw(g.fill(this.glow as FillResolved[]))`). Assets referenced
69
- * by the fill (images, videos, 3D surfaces) are discovered from that draw, so
70
- * nothing extra is needed to make them load.
71
- */
34
+ /** A fill-layer property: a CSS string, a fill prop object, a `Fills` chain, or an array of them, lerped layer by layer. */
72
35
  export declare const fillProperty: (opts?: (AttributePropOptions<Fill, FillResolved[]> & {
73
36
  kind?: string;
74
37
  }) | undefined) => (target: object, propertyKey: string | symbol) => void;
75
- /** A stroke-layer property — the `stroke` prop's op set. */
76
- export declare const strokeProperty: (opts?: (AttributePropOptions<Stroke, StrokeResolved[]> & {
77
- kind?: string;
78
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
79
- /** A shadow-layer property — the `shadow` prop's op set. */
80
- export declare const shadowProperty: (opts?: (AttributePropOptions<Shadow, ShadowResolved[]> & {
81
- kind?: string;
82
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
83
38
  /** An effect-chain property — the `effects` prop's op set. */
84
39
  export declare const effectsProperty: (opts?: (AttributePropOptions<Effect, NodeEffect[]> & {
85
40
  kind?: string;
86
41
  }) | undefined) => (target: object, propertyKey: string | symbol) => void;
87
- /**
88
- * A tweenable colour property: parses CSS strings, `oklch()`, theme tokens and
89
- * `"white/10"` alpha suffixes, and interpolates in normalized space.
90
- *
91
- * The stored value is a {@link NormalizedColor} (a `[r, g, b, a]` tuple), which
92
- * is *not* a `FillProp` on its own — hand it to a fill rather than painting it
93
- * directly: `g.fill(Fills.color(this.tint))` or `g.fill({ type: 'solid', color:
94
- * this.tint })`. For a property that is itself a paint layer, use
95
- * {@link fillProperty}.
96
- */
97
- export declare const colorProperty: (opts?: (AttributePropOptions<Color, NormalizedColor> & {
98
- kind?: string;
99
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
100
- /** A corner-radius property: uniform, per-corner or per-axis, tweened per corner. */
101
- export declare const cornerRadiusProperty: (opts?: (AttributePropOptions<RectCornerRadius, CornerRadiusResolved> & {
102
- kind?: string;
103
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
104
- /** A corner-style property (`'rounded'` / `'angled'`), per corner. */
105
- export declare const cornerStyleProperty: (opts?: (AttributePropOptions<RectCornerStyle, CornerStyleResolved> & {
106
- kind?: string;
107
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
108
- /**
109
- * A path-geometry property: an SVG path string or command list, morphed between
110
- * arbitrary shapes by `to()`.
111
- */
112
- export declare const pathProperty: (opts?: (AttributePropOptions<PathData, PathData> & {
113
- kind?: string;
114
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
115
42
  /** An edge-inset property: scalar, symmetric or per-edge, tweened per edge. */
116
43
  export declare const insetsProperty: (opts?: (AttributePropOptions<Insets, InsetsResolved> & {
117
44
  kind?: string;
118
45
  }) | undefined) => (target: object, propertyKey: string | symbol) => void;
119
46
  /**
120
47
  * An alignment property: a named position (`'center'`, `'topLeft'`, …) resolved
121
- * to a per-axis {@link Vector2} in `[-1, 1]` (x: -1 left … +1 right, y: -1 bottom …
122
- * +1 top), tweened as a vector so `'centerLeft' → 'centerRight'` slides.
123
- *
124
- * One decorator for every "which point of this box" prop — `Node2D.pivot`, a
125
- * container's `align`, an image fill's `anchor`. They previously had two
126
- * decorators (`alignProperty`/`pivotProperty`) that differed only in whether the
127
- * default was spelled `'center'` or `{ x: 0, y: 0 }` — the same value either side
128
- * of `resolveAlignment`.
48
+ * to a per-axis {@link Vector2} in `[-1, 1]`, tweened as a vector so
49
+ * `'centerLeft' → 'centerRight'` slides.
129
50
  */
130
51
  export declare const alignmentProperty: (opts?: (AttributePropOptions<Alignment, Vector2> & {
131
52
  kind?: string;
@@ -137,52 +58,12 @@ export declare const alignmentProperty: (opts?: (AttributePropOptions<Alignment,
137
58
  export declare const flowProperty: (opts?: (AttributePropOptions<FlowMode, FlowResolved> & {
138
59
  kind?: string;
139
60
  }) | undefined) => (target: object, propertyKey: string | symbol) => void;
140
- /** A plain 2D point property, tweened component-wise. */
141
- export declare const vector2Property: (opts?: (AttributePropOptions<Vector2, Vector2> & {
142
- kind?: string;
143
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
144
- /**
145
- * A size property: a pixel number or the `'fill'` / `'hug'` layout keywords,
146
- * tweened the way `width`/`height` are (keywords snap; numbers interpolate).
147
- */
148
- export declare const sizeProperty: (opts?: (AttributePropOptions<SizeInput, SizeInput> & {
149
- kind?: string;
150
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
151
61
  /**
152
- * A text property tweened with the same character-level interpolation as
153
- * `Text.text`, so `to({ label })` types/untypes rather than snapping.
154
- */
155
- export declare const textProperty: (opts?: (AttributePropOptions<string, string> & {
156
- kind?: string;
157
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
158
- /**
159
- * A 3D position or scale, from the loose {@link Vector3Input} an author writes
160
- * (`[1, 2, 3]`, `{ x, y, z }`, or a scalar for "all three") to the resolved
161
- * {@link Vector3} the renderer reads.
162
- *
163
- * The mapper is what makes `position={2}` and `position={[0, 1, 0]}` the same
164
- * kind of thing, and the tween is what makes `to({ position: [0, 3, 0] })`
165
- * interpolate rather than snap.
166
- */
167
- export declare const vector3Property: (opts?: (AttributePropOptions<Vector3Input, Vector3> & {
168
- kind?: string;
169
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
170
- /**
171
- * A {@link vector3Property} that may be unset: a node's `lookAt`, a camera's or
172
- * light's `target`. It defaults to unset (not to the origin), stays unset when a
173
- * binding returns `undefined`, and tweens with `to()` — from `unset`'s reading of
174
- * an unset start (see {@link lerpOptionalVector3}).
62
+ * A 3D point that may be unset: a node's `lookAt`. It defaults to unset (not to
63
+ * the origin), stays unset when a binding returns `undefined`, and tweens with
64
+ * `to()` — from `unset`'s reading of an unset start (see {@link lerpOptionalVector3}).
175
65
  */
176
66
  export declare function optionalVector3Property(unset: "origin" | "snap"): (target: object, propertyKey: string | symbol) => void;
177
- /**
178
- * A Euler rotation in **degrees**, matching 2D `rotation`.
179
- *
180
- * Interpolated per axis. For a tumble where that would gimbal, declare the prop
181
- * with {@link quaternionProperty} instead and tween the quaternion.
182
- */
183
- export declare const euler3Property: (opts?: (AttributePropOptions<Vector3Input | Euler3, Euler3> & {
184
- kind?: string;
185
- }) | undefined) => (target: object, propertyKey: string | symbol) => void;
186
67
  /** A rotation as a unit quaternion, interpolated with shortest-arc slerp. */
187
68
  export declare const quaternionProperty: (opts?: (AttributePropOptions<Quaternion, Quaternion> & {
188
69
  kind?: string;
@@ -192,11 +73,8 @@ export declare const quaternionProperty: (opts?: (AttributePropOptions<Quaternio
192
73
  *
193
74
  * `Param`, not `number`, because an `AudioRequest` is a schedule record built
194
75
  * once during precomp: a per-frame prop write would be read on whichever frame
195
- * happened to create the request and then never again, so a `to()` on a level
196
- * renders flat. A `Curve` *is* the automation lane — it reaches the Web Audio
197
- * graph as `setValueCurveAtTime` and the offline mixer identically — which is
198
- * why the tween here interpolates between whole curves rather than between two
199
- * numbers a frame apart.
76
+ * happened to create the request and then never again. A `Curve` *is* the
77
+ * automation lane, which is why the tween interpolates between whole curves.
200
78
  */
201
79
  export declare const audioParamProperty: (opts?: (AttributePropOptions<Param, Param> & {
202
80
  kind?: string;
@@ -210,4 +88,5 @@ export declare const audioParamProperty: (opts?: (AttributePropOptions<Param, Pa
210
88
  export declare const audioFiltersProperty: (opts?: (AttributePropOptions<AudioFilter, AudioFilterItem[]> & {
211
89
  kind?: string;
212
90
  }) | undefined) => (target: object, propertyKey: string | symbol) => void;
91
+ export {};
213
92
  //# sourceMappingURL=typed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../../src/attributes/properties/typed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;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AU,oBAAoB,CAAC,GAAG,EAAE,GAAG;IACnC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;IACvC,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACxB;AAyBD,4HAA4H;AAC5H,eAAO,MAAM,YAAY;WAVoC,MAAM;yEAUkD,CAAC;AAEtH,8DAA8D;AAC9D,eAAO,MAAM,eAAe;WAbiC,MAAM;yEAa6D,CAAC;AAEjI,+EAA+E;AAC/E,eAAO,MAAM,cAAc;WAhBkC,MAAM;yEAgB0D,CAAC;AAE9H;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;WAvB+B,MAAM;yEAuByE,CAAC;AAE7I;;;GAGG;AACH,eAAO,MAAM,YAAY;WA7BoC,MAAM;yEA6B6C,CAAC;AAEjH;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,0DAO/D;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB;WA9C8B,MAAM;yEAgDlE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;WA1D8B,MAAM;yEA0DoD,CAAC;AAExH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;WAlE4B,MAAM;yEAoElE,CAAC"}
@@ -1,33 +1,18 @@
1
1
  import { property } from "./decorator.js";
2
2
  import { fillOps } from "../../attributes/shape/fill/registry.js";
3
- import { colorOps } from "../../attributes/shape/fill/lerp.js";
4
- import { strokeOps } from "../../attributes/shape/stroke/stroke.js";
5
- import { shadowOps } from "../../attributes/shape/shadow/shadow.js";
6
3
  import { effectsOps } from "../../attributes/shape/effects/chain.js";
7
- import { cornerRadiusOps } from "../../attributes/shape/corners/corner-radius.js";
8
- import { cornerStyleOps } from "../../attributes/shape/corners/corner-style.js";
9
- import { pathOps } from "../../attributes/shape/path/ops.js";
10
4
  import { insetsOps } from "../../attributes/layout/insets.js";
11
5
  import { alignmentOps } from "../../attributes/layout/alignment.js";
12
- import { vector2Ops } from "../../attributes/layout/vector2.js";
13
- import { sizeInputOps } from "../../attributes/layout/size.js";
14
6
  import { flowOps } from "../../layout/ops.js";
15
7
  import { audioFiltersOps } from "../../attributes/audio/filters/registry.js";
16
8
  import { audioParamOps } from "../../attributes/audio/filters/curve.js";
17
- import { textOps } from "../../attributes/text/ops.js";
18
- import { vector3Ops, euler3Ops, quaternionOps, lerpOptionalVector3, resolveOptionalVector3, } from "../../render3d/vector3.js";
9
+ import { quaternionOps, lerpOptionalVector3, resolveOptionalVector3, } from "../../render3d/vector3.js";
19
10
  /**
20
- * Build one attribute-typed decorator from its canonical {@link AttributeOps}.
11
+ * Build one attribute-typed `property` from its canonical {@link AttributeOps}.
21
12
  *
22
13
  * `fallback` is a factory rather than a value so array/object defaults aren't a
23
- * single instance shared by every property declared through the decorator.
24
- *
25
- * An **explicit** `default: undefined` means "this prop has no default" and is
26
- * honoured as such — the key's presence is what's tested, not its value. That
27
- * distinction matters for an optional attribute whose absence is meaningful: a
28
- * light with no `color` must stay absent from the descriptor so the renderer's own
29
- * default applies, where folding it onto the fallback would silently paint every
30
- * light black.
14
+ * single instance shared by every property declared through it. An **explicit**
15
+ * `default: undefined` means "this prop has no default" and is honoured as such.
31
16
  */
32
17
  function attributeProperty(fallback, mapper, tween,
33
18
  /** The control a host draws for this attribute, when it is not the default. */
@@ -36,65 +21,19 @@ kind) {
36
21
  default: opts && "default" in opts ? opts.default : fallback(),
37
22
  mapper: opts?.mapper ?? mapper,
38
23
  tween: opts?.tween ?? tween,
39
- // A typed decorator knows what it edits, so a caller never has to
40
- // say — but may, for an attribute a host draws specially.
41
24
  ...(opts?.kind ?? kind ? { kind: opts?.kind ?? kind } : {}),
42
25
  });
43
26
  }
44
- // ---- Paint ----------------------------------------------------------------
45
- /**
46
- * A fill-layer property: accepts everything the built-in `fill` prop does (a CSS
47
- * string, a fill prop object, a `Fills` chain, or an array of them) and lerps
48
- * layer-by-layer.
49
- *
50
- * Note this only makes the *property* behave like `fill`; the node still has to
51
- * paint it (`ctx.draw(g.fill(this.glow as FillResolved[]))`). Assets referenced
52
- * by the fill (images, videos, 3D surfaces) are discovered from that draw, so
53
- * nothing extra is needed to make them load.
54
- */
27
+ /** A fill-layer property: a CSS string, a fill prop object, a `Fills` chain, or an array of them, lerped layer by layer. */
55
28
  export const fillProperty = attributeProperty(() => [], fillOps.resolve, fillOps.lerp, "fills");
56
- /** A stroke-layer property — the `stroke` prop's op set. */
57
- export const strokeProperty = attributeProperty(() => [], strokeOps.resolve, strokeOps.lerp, "strokes");
58
- /** A shadow-layer property — the `shadow` prop's op set. */
59
- export const shadowProperty = attributeProperty(() => [], shadowOps.resolve, shadowOps.lerp, "shadows");
60
29
  /** An effect-chain property — the `effects` prop's op set. */
61
30
  export const effectsProperty = attributeProperty(() => [], effectsOps.resolve, effectsOps.lerp, "effects");
62
- /**
63
- * A tweenable colour property: parses CSS strings, `oklch()`, theme tokens and
64
- * `"white/10"` alpha suffixes, and interpolates in normalized space.
65
- *
66
- * The stored value is a {@link NormalizedColor} (a `[r, g, b, a]` tuple), which
67
- * is *not* a `FillProp` on its own — hand it to a fill rather than painting it
68
- * directly: `g.fill(Fills.color(this.tint))` or `g.fill({ type: 'solid', color:
69
- * this.tint })`. For a property that is itself a paint layer, use
70
- * {@link fillProperty}.
71
- */
72
- export const colorProperty = attributeProperty(() => "black", colorOps.resolve, colorOps.lerp, "color");
73
- // ---- Geometry -------------------------------------------------------------
74
- /** A corner-radius property: uniform, per-corner or per-axis, tweened per corner. */
75
- export const cornerRadiusProperty = attributeProperty(() => 0, cornerRadiusOps.resolve, cornerRadiusOps.lerp, "cornerRadius");
76
- /** A corner-style property (`'rounded'` / `'angled'`), per corner. */
77
- export const cornerStyleProperty = attributeProperty(() => "rounded", cornerStyleOps.resolve, cornerStyleOps.lerp, "cornerStyle");
78
- /**
79
- * A path-geometry property: an SVG path string or command list, morphed between
80
- * arbitrary shapes by `to()`.
81
- */
82
- // `resolve` is identity for these (no mapper is passed) so a write skips the
83
- // mapper-cell indirection entirely — see `applyProp` in `node-reactive.ts`.
84
- export const pathProperty = attributeProperty(() => "", undefined, pathOps.lerp, "path");
85
- // ---- Layout ---------------------------------------------------------------
86
31
  /** An edge-inset property: scalar, symmetric or per-edge, tweened per edge. */
87
32
  export const insetsProperty = attributeProperty(() => 0, insetsOps.resolve, insetsOps.lerp, "insets");
88
33
  /**
89
34
  * An alignment property: a named position (`'center'`, `'topLeft'`, …) resolved
90
- * to a per-axis {@link Vector2} in `[-1, 1]` (x: -1 left … +1 right, y: -1 bottom …
91
- * +1 top), tweened as a vector so `'centerLeft' → 'centerRight'` slides.
92
- *
93
- * One decorator for every "which point of this box" prop — `Node2D.pivot`, a
94
- * container's `align`, an image fill's `anchor`. They previously had two
95
- * decorators (`alignProperty`/`pivotProperty`) that differed only in whether the
96
- * default was spelled `'center'` or `{ x: 0, y: 0 }` — the same value either side
97
- * of `resolveAlignment`.
35
+ * to a per-axis {@link Vector2} in `[-1, 1]`, tweened as a vector so
36
+ * `'centerLeft' → 'centerRight'` slides.
98
37
  */
99
38
  export const alignmentProperty = attributeProperty(() => "center", alignmentOps.resolve, alignmentOps.lerp, "alignment");
100
39
  /**
@@ -102,34 +41,10 @@ export const alignmentProperty = attributeProperty(() => "center", alignmentOps.
102
41
  * restoring the prop — which is what a seek does — restores the blend with it.
103
42
  */
104
43
  export const flowProperty = attributeProperty(() => "freeform", undefined, flowOps.lerp);
105
- /** A plain 2D point property, tweened component-wise. */
106
- export const vector2Property = attributeProperty(() => ({ x: 0, y: 0 }), undefined, vector2Ops.lerp, "vector2");
107
44
  /**
108
- * A size property: a pixel number or the `'fill'` / `'hug'` layout keywords,
109
- * tweened the way `width`/`height` are (keywords snap; numbers interpolate).
110
- */
111
- export const sizeProperty = attributeProperty(() => "fill", undefined, sizeInputOps.lerp, "size");
112
- // ---- Text -----------------------------------------------------------------
113
- /**
114
- * A text property tweened with the same character-level interpolation as
115
- * `Text.text`, so `to({ label })` types/untypes rather than snapping.
116
- */
117
- export const textProperty = attributeProperty(() => "", undefined, textOps.lerp, "text");
118
- /**
119
- * A 3D position or scale, from the loose {@link Vector3Input} an author writes
120
- * (`[1, 2, 3]`, `{ x, y, z }`, or a scalar for "all three") to the resolved
121
- * {@link Vector3} the renderer reads.
122
- *
123
- * The mapper is what makes `position={2}` and `position={[0, 1, 0]}` the same
124
- * kind of thing, and the tween is what makes `to({ position: [0, 3, 0] })`
125
- * interpolate rather than snap.
126
- */
127
- export const vector3Property = attributeProperty(() => ({ x: 0, y: 0, z: 0 }), vector3Ops.resolve, vector3Ops.lerp, "vector3");
128
- /**
129
- * A {@link vector3Property} that may be unset: a node's `lookAt`, a camera's or
130
- * light's `target`. It defaults to unset (not to the origin), stays unset when a
131
- * binding returns `undefined`, and tweens with `to()` — from `unset`'s reading of
132
- * an unset start (see {@link lerpOptionalVector3}).
45
+ * A 3D point that may be unset: a node's `lookAt`. It defaults to unset (not to
46
+ * the origin), stays unset when a binding returns `undefined`, and tweens with
47
+ * `to()` — from `unset`'s reading of an unset start (see {@link lerpOptionalVector3}).
133
48
  */
134
49
  export function optionalVector3Property(unset) {
135
50
  return property({
@@ -139,26 +54,15 @@ export function optionalVector3Property(unset) {
139
54
  kind: "vector3",
140
55
  });
141
56
  }
142
- /**
143
- * A Euler rotation in **degrees**, matching 2D `rotation`.
144
- *
145
- * Interpolated per axis. For a tumble where that would gimbal, declare the prop
146
- * with {@link quaternionProperty} instead and tween the quaternion.
147
- */
148
- export const euler3Property = attributeProperty(() => ({ x: 0, y: 0, z: 0 }), euler3Ops.resolve, euler3Ops.lerp, "euler3");
149
57
  /** A rotation as a unit quaternion, interpolated with shortest-arc slerp. */
150
58
  export const quaternionProperty = attributeProperty(() => ({ x: 0, y: 0, z: 0, w: 1 }), undefined, quaternionOps.lerp, "quaternion");
151
- // ---- Audio ----------------------------------------------------------------
152
59
  /**
153
60
  * An audio level — a gain, a pan position, anything a clip or a bus schedules.
154
61
  *
155
62
  * `Param`, not `number`, because an `AudioRequest` is a schedule record built
156
63
  * once during precomp: a per-frame prop write would be read on whichever frame
157
- * happened to create the request and then never again, so a `to()` on a level
158
- * renders flat. A `Curve` *is* the automation lane — it reaches the Web Audio
159
- * graph as `setValueCurveAtTime` and the offline mixer identically — which is
160
- * why the tween here interpolates between whole curves rather than between two
161
- * numbers a frame apart.
64
+ * happened to create the request and then never again. A `Curve` *is* the
65
+ * automation lane, which is why the tween interpolates between whole curves.
162
66
  */
163
67
  export const audioParamProperty = attributeProperty(() => 0, undefined, audioParamOps.lerp, "audioParam");
164
68
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"typed.js","sourceRoot":"","sources":["../../../src/attributes/properties/typed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAA+B,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAA+B,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE1F,OAAO,EAAe,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAA0C,eAAe,EAAE,MAAM,0CAA0C,CAAC;AACnH,OAAO,EAAwC,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAC/G,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAA0B,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAa,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAW,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAa,YAAY,EAAE,MAAM,0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AC9B,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC;QAC/D,IAAI,EAAE,SAAS;KAClB,CAAC,CAAC;AACP,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAC3C,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,CAC5E,CAAC;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAC/C,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,EAAE,YAAY,CAClF,CAAC;AAEF,8EAA8E;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAe,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAExH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CACjD,GAAG,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,cAAc,CAC1E,CAAC","sourcesContent":["import { TweenFn } from \"@/props/host\";\r\nimport { property } from \"./decorator\";\r\n\r\nimport { type Fill } from \"@/attributes/shape/fill/chain\";\r\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\r\nimport { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\r\n\r\nimport { type Stroke, StrokeResolved, strokeOps } from \"@/attributes/shape/stroke/stroke\";\r\nimport { type Shadow, ShadowResolved, shadowOps } from \"@/attributes/shape/shadow/shadow\";\r\n\r\nimport { type Effect, effectsOps } from \"@/attributes/shape/effects/chain\";\r\nimport { NodeEffect } from \"@/attributes/shape/effects/union\";\r\n\r\nimport { RectCornerRadius, CornerRadiusResolved, cornerRadiusOps } from \"@/attributes/shape/corners/corner-radius\";\r\nimport { RectCornerStyle, CornerStyleResolved, cornerStyleOps } from \"@/attributes/shape/corners/corner-style\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\n\r\nimport { Insets, InsetsResolved, insetsOps } from \"@/attributes/layout/insets\";\r\nimport { Alignment, alignmentOps } from \"@/attributes/layout/alignment\";\r\nimport { Vector2, vector2Ops } from \"@/attributes/layout/vector2\";\r\nimport { SizeInput, sizeInputOps } from \"@/attributes/layout/size\";\r\nimport { flowOps } from \"@/layout/ops\";\r\nimport type { FlowMode, FlowResolved } from \"@/layout/types\";\r\n\r\nimport { type AudioFilter } from \"@/attributes/audio/filters/chain\";\r\nimport { audioFiltersOps } from \"@/attributes/audio/filters/registry\";\r\nimport { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { type Param, audioParamOps } from \"@/attributes/audio/filters/curve\";\r\n\r\nimport { textOps } from \"@/attributes/text/ops\";\r\nimport {\r\n vector3Ops, euler3Ops, quaternionOps, lerpOptionalVector3, resolveOptionalVector3,\r\n type Euler3, type Quaternion, type Vector3, type Vector3Input,\r\n} from \"@/render3d/vector3\";\r\nimport { PathData } from \"@/render/descriptors/path\";\r\n\r\n/**\r\n * Attribute-typed variants of `@property`.\r\n *\r\n * A rich attribute (a fill, a stroke, a corner radius) is only declarative and\r\n * tweenable because its `@property` carries the matching *mapper* (loose author\r\n * input → resolved value) and *tween* (how the resolved value interpolates) —\r\n * together, an `AttributeOps` (`attributes/shared/operators.ts`). Getting that\r\n * pair right means knowing which `resolve`/`lerp` belong together — several are\r\n * `@internal` — so a custom node that wants a second fill has to copy an\r\n * incantation out of `ShapeNode`.\r\n *\r\n * These decorators pre-bake each attribute's `AttributeOps`. `@fillProperty()` is\r\n * exactly `@property({ default: [], mapper: fillOps.resolve, tween: fillOps.lerp })`,\r\n * so everything downstream — `set()`, `to()`, `save()`/`restore()`, `() => …`\r\n * bindings — behaves identically; only the declaration gets shorter.\r\n *\r\n * ```ts\r\n * class Card extends Rect {\r\n * @fillProperty({ default: \"white/10\" }) declare glow: Fill;\r\n * @strokeProperty() declare edge: Stroke;\r\n * @cornerRadiusProperty({ default: 12 }) declare notch: RectCornerRadius;\r\n * }\r\n *\r\n * // <Card glow=\"red\" /> · card().to({ data: { glow: Fills.linearGradient([...]) }, duration: 0.6 })\r\n * ```\r\n *\r\n * Each takes the same options as `@property` — `default`, plus `mapper`/`tween`\r\n * to override the built-in pair for a one-off case.\r\n *\r\n * As with `@property`, the field is declared with the **loose author-facing**\r\n * type (`Fill`, not `FillResolved[]`) so assignment and reads share one type;\r\n * the accessor stores the resolved value and consumers cast at the read site.\r\n */\r\nexport interface AttributePropOptions<Ext, Int> {\r\n /** Initial value, used when the constructor `props` object omits the key. */\r\n default?: Ext;\r\n /** Override the attribute's built-in external → internal mapper. */\r\n mapper?: (ext: Ext, prev?: Int) => Int;\r\n /** Override the attribute's built-in lerp for `to()`. */\r\n tween?: TweenFn<Int>;\r\n}\r\n\r\n/**\r\n * Build one attribute-typed decorator from its canonical {@link AttributeOps}.\r\n *\r\n * `fallback` is a factory rather than a value so array/object defaults aren't a\r\n * single instance shared by every property declared through the decorator.\r\n *\r\n * An **explicit** `default: undefined` means \"this prop has no default\" and is\r\n * honoured as such — the key's presence is what's tested, not its value. That\r\n * distinction matters for an optional attribute whose absence is meaningful: a\r\n * light with no `color` must stay absent from the descriptor so the renderer's own\r\n * default applies, where folding it onto the fallback would silently paint every\r\n * light black.\r\n */\r\nfunction attributeProperty<Ext, Int>(\r\n fallback: () => Ext,\r\n mapper?: (ext: Ext, prev?: Int) => Int,\r\n tween?: TweenFn<Int>,\r\n /** The control a host draws for this attribute, when it is not the default. */\r\n kind?: string,\r\n) {\r\n return (opts?: AttributePropOptions<Ext, Int> & { kind?: string }) =>\r\n property<Ext, Int>({\r\n default: opts && \"default\" in opts ? opts.default : fallback(),\r\n mapper: opts?.mapper ?? mapper,\r\n tween: opts?.tween ?? tween,\r\n // A typed decorator knows what it edits, so a caller never has to\r\n // say — but may, for an attribute a host draws specially.\r\n ...(opts?.kind ?? kind ? { kind: opts?.kind ?? kind } : {}),\r\n });\r\n}\r\n\r\n// ---- Paint ----------------------------------------------------------------\r\n\r\n/**\r\n * A fill-layer property: accepts everything the built-in `fill` prop does (a CSS\r\n * string, a fill prop object, a `Fills` chain, or an array of them) and lerps\r\n * layer-by-layer.\r\n *\r\n * Note this only makes the *property* behave like `fill`; the node still has to\r\n * paint it (`ctx.draw(g.fill(this.glow as FillResolved[]))`). Assets referenced\r\n * by the fill (images, videos, 3D surfaces) are discovered from that draw, so\r\n * nothing extra is needed to make them load.\r\n */\r\nexport const fillProperty = attributeProperty<Fill, FillResolved[]>(() => [], fillOps.resolve, fillOps.lerp, \"fills\");\r\n\r\n/** A stroke-layer property — the `stroke` prop's op set. */\r\nexport const strokeProperty = attributeProperty<Stroke, StrokeResolved[]>(() => [], strokeOps.resolve, strokeOps.lerp, \"strokes\");\r\n\r\n/** A shadow-layer property — the `shadow` prop's op set. */\r\nexport const shadowProperty = attributeProperty<Shadow, ShadowResolved[]>(() => [], shadowOps.resolve, shadowOps.lerp, \"shadows\");\r\n\r\n/** An effect-chain property — the `effects` prop's op set. */\r\nexport const effectsProperty = attributeProperty<Effect, NodeEffect[]>(() => [], effectsOps.resolve, effectsOps.lerp, \"effects\");\r\n\r\n/**\r\n * A tweenable colour property: parses CSS strings, `oklch()`, theme tokens and\r\n * `\"white/10\"` alpha suffixes, and interpolates in normalized space.\r\n *\r\n * The stored value is a {@link NormalizedColor} (a `[r, g, b, a]` tuple), which\r\n * is *not* a `FillProp` on its own — hand it to a fill rather than painting it\r\n * directly: `g.fill(Fills.color(this.tint))` or `g.fill({ type: 'solid', color:\r\n * this.tint })`. For a property that is itself a paint layer, use\r\n * {@link fillProperty}.\r\n */\r\nexport const colorProperty = attributeProperty<Color, NormalizedColor>(() => \"black\", colorOps.resolve, colorOps.lerp, \"color\");\r\n\r\n// ---- Geometry -------------------------------------------------------------\r\n\r\n/** A corner-radius property: uniform, per-corner or per-axis, tweened per corner. */\r\nexport const cornerRadiusProperty = attributeProperty<RectCornerRadius, CornerRadiusResolved>(\r\n () => 0, cornerRadiusOps.resolve, cornerRadiusOps.lerp, \"cornerRadius\",\r\n);\r\n\r\n/** A corner-style property (`'rounded'` / `'angled'`), per corner. */\r\nexport const cornerStyleProperty = attributeProperty<RectCornerStyle, CornerStyleResolved>(\r\n () => \"rounded\", cornerStyleOps.resolve, cornerStyleOps.lerp, \"cornerStyle\",\r\n);\r\n\r\n/**\r\n * A path-geometry property: an SVG path string or command list, morphed between\r\n * arbitrary shapes by `to()`.\r\n */\r\n// `resolve` is identity for these (no mapper is passed) so a write skips the\r\n// mapper-cell indirection entirely — see `applyProp` in `node-reactive.ts`.\r\nexport const pathProperty = attributeProperty<PathData, PathData>(() => \"\", undefined, pathOps.lerp, \"path\");\r\n\r\n// ---- Layout ---------------------------------------------------------------\r\n\r\n/** An edge-inset property: scalar, symmetric or per-edge, tweened per edge. */\r\nexport const insetsProperty = attributeProperty<Insets, InsetsResolved>(() => 0, insetsOps.resolve, insetsOps.lerp, \"insets\");\r\n\r\n/**\r\n * An alignment property: a named position (`'center'`, `'topLeft'`, …) resolved\r\n * to a per-axis {@link Vector2} in `[-1, 1]` (x: -1 left … +1 right, y: -1 bottom …\r\n * +1 top), tweened as a vector so `'centerLeft' → 'centerRight'` slides.\r\n *\r\n * One decorator for every \"which point of this box\" prop — `Node2D.pivot`, a\r\n * container's `align`, an image fill's `anchor`. They previously had two\r\n * decorators (`alignProperty`/`pivotProperty`) that differed only in whether the\r\n * default was spelled `'center'` or `{ x: 0, y: 0 }` — the same value either side\r\n * of `resolveAlignment`.\r\n */\r\nexport const alignmentProperty = attributeProperty<Alignment, Vector2>(() => \"center\", alignmentOps.resolve, alignmentOps.lerp, \"alignment\");\r\n\r\n/**\r\n * A layout-mode property. Mid-tween it holds both modes and how far along, so\r\n * restoring the prop — which is what a seek does — restores the blend with it.\r\n */\r\nexport const flowProperty = attributeProperty<FlowMode, FlowResolved>(() => \"freeform\", undefined, flowOps.lerp);\r\n\r\n/** A plain 2D point property, tweened component-wise. */\r\nexport const vector2Property = attributeProperty<Vector2, Vector2>(() => ({ x: 0, y: 0 }), undefined, vector2Ops.lerp, \"vector2\");\r\n\r\n/**\r\n * A size property: a pixel number or the `'fill'` / `'hug'` layout keywords,\r\n * tweened the way `width`/`height` are (keywords snap; numbers interpolate).\r\n */\r\nexport const sizeProperty = attributeProperty<SizeInput, SizeInput>(() => \"fill\", undefined, sizeInputOps.lerp, \"size\");\r\n\r\n// ---- Text -----------------------------------------------------------------\r\n\r\n/**\r\n * A text property tweened with the same character-level interpolation as\r\n * `Text.text`, so `to({ label })` types/untypes rather than snapping.\r\n */\r\nexport const textProperty = attributeProperty<string, string>(() => \"\", undefined, textOps.lerp, \"text\");\r\n\r\n/**\r\n * A 3D position or scale, from the loose {@link Vector3Input} an author writes\r\n * (`[1, 2, 3]`, `{ x, y, z }`, or a scalar for \"all three\") to the resolved\r\n * {@link Vector3} the renderer reads.\r\n *\r\n * The mapper is what makes `position={2}` and `position={[0, 1, 0]}` the same\r\n * kind of thing, and the tween is what makes `to({ position: [0, 3, 0] })`\r\n * interpolate rather than snap.\r\n */\r\nexport const vector3Property = attributeProperty<Vector3Input, Vector3>(\r\n () => ({ x: 0, y: 0, z: 0 }), vector3Ops.resolve, vector3Ops.lerp, \"vector3\",\r\n);\r\n\r\n/**\r\n * A {@link vector3Property} that may be unset: a node's `lookAt`, a camera's or\r\n * light's `target`. It defaults to unset (not to the origin), stays unset when a\r\n * binding returns `undefined`, and tweens with `to()` — from `unset`'s reading of\r\n * an unset start (see {@link lerpOptionalVector3}).\r\n */\r\nexport function optionalVector3Property(unset: \"origin\" | \"snap\") {\r\n return property<Vector3Input | undefined, Vector3 | undefined>({\r\n default: undefined,\r\n mapper: resolveOptionalVector3,\r\n tween: (from, to, t) => lerpOptionalVector3(from, to, t, unset),\r\n kind: \"vector3\",\r\n });\r\n}\r\n\r\n/**\r\n * A Euler rotation in **degrees**, matching 2D `rotation`.\r\n *\r\n * Interpolated per axis. For a tumble where that would gimbal, declare the prop\r\n * with {@link quaternionProperty} instead and tween the quaternion.\r\n */\r\nexport const euler3Property = attributeProperty<Vector3Input | Euler3, Euler3>(\r\n () => ({ x: 0, y: 0, z: 0 }), euler3Ops.resolve, euler3Ops.lerp, \"euler3\",\r\n);\r\n\r\n/** A rotation as a unit quaternion, interpolated with shortest-arc slerp. */\r\nexport const quaternionProperty = attributeProperty<Quaternion, Quaternion>(\r\n () => ({ x: 0, y: 0, z: 0, w: 1 }), undefined, quaternionOps.lerp, \"quaternion\",\r\n);\r\n\r\n// ---- Audio ----------------------------------------------------------------\r\n\r\n/**\r\n * An audio level — a gain, a pan position, anything a clip or a bus schedules.\r\n *\r\n * `Param`, not `number`, because an `AudioRequest` is a schedule record built\r\n * once during precomp: a per-frame prop write would be read on whichever frame\r\n * happened to create the request and then never again, so a `to()` on a level\r\n * renders flat. A `Curve` *is* the automation lane — it reaches the Web Audio\r\n * graph as `setValueCurveAtTime` and the offline mixer identically — which is\r\n * why the tween here interpolates between whole curves rather than between two\r\n * numbers a frame apart.\r\n */\r\nexport const audioParamProperty = attributeProperty<Param, Param>(() => 0, undefined, audioParamOps.lerp, \"audioParam\");\r\n\r\n/**\r\n * An audio filter chain — the `filters` prop's op set.\r\n *\r\n * Without it a chain is an object-valued prop, and `Node._prepareStep` drops\r\n * those silently: the tween would run its duration and write nothing.\r\n */\r\nexport const audioFiltersProperty = attributeProperty<AudioFilter, AudioFilterItem[]>(\r\n () => [], audioFiltersOps.resolve, audioFiltersOps.lerp, \"audioFilters\",\r\n);\r\n"]}
1
+ {"version":3,"file":"typed.js","sourceRoot":"","sources":["../../../src/attributes/properties/typed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAe,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAA0B,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAa,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAc,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EACH,aAAa,EAAE,mBAAmB,EAAE,sBAAsB,GAE7D,MAAM,oBAAoB,CAAC;AAuB5B;;;;;;GAMG;AACH,SAAS,iBAAiB,CACtB,QAAmB,EACnB,MAAsC,EACtC,KAAoB;AACpB,+EAA+E;AAC/E,IAAa;IAEb,OAAO,CAAC,IAAyD,EAAE,EAAE,CACjE,QAAQ,CAAW;QACf,OAAO,EAAE,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;QAC9D,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,MAAM;QAC9B,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK;QAC3B,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9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AC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,EAAE,YAAY,CAClF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAe,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAExH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CACjD,GAAG,EAAE,CAAC,EAAE,EAAE,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,cAAc,CAC1E,CAAC","sourcesContent":["import { TweenFn } from \"@/props/host\";\r\nimport { property } from \"./decorator\";\r\n\r\nimport { type Fill } from \"@/attributes/shape/fill/chain\";\r\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\r\n\r\nimport { type Effect, effectsOps } from \"@/attributes/shape/effects/chain\";\r\nimport { NodeEffect } from \"@/attributes/shape/effects/union\";\r\n\r\nimport { Insets, InsetsResolved, insetsOps } from \"@/attributes/layout/insets\";\r\nimport { Alignment, alignmentOps } from \"@/attributes/layout/alignment\";\r\nimport { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { flowOps } from \"@/layout/ops\";\r\nimport type { FlowMode, FlowResolved } from \"@/layout/types\";\r\n\r\nimport { type AudioFilter } from \"@/attributes/audio/filters/chain\";\r\nimport { audioFiltersOps } from \"@/attributes/audio/filters/registry\";\r\nimport { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { type Param, audioParamOps } from \"@/attributes/audio/filters/curve\";\r\n\r\nimport {\r\n quaternionOps, lerpOptionalVector3, resolveOptionalVector3,\r\n type Quaternion, type Vector3, type Vector3Input,\r\n} from \"@/render3d/vector3\";\r\n\r\n/**\r\n * Attribute-typed variants of `property`, for the props the tree bases declare\r\n * themselves (`Node2D`, `Node3D`, `NodeAudio`, the root `Canvas2D`).\r\n *\r\n * A rich attribute (a fill, an effect chain, an inset) is only declarative and\r\n * tweenable because its `property` carries the matching *mapper* (loose author\r\n * input → resolved value) and *tween* (how the resolved value interpolates) —\r\n * together, an `AttributeOps` (`attributes/shared/operators.ts`). These pre-bake\r\n * each pair: `fillProperty()` is exactly\r\n * `property({ default: [], mapper: fillOps.resolve, tween: fillOps.lerp, kind: \"fills\" })`.\r\n * A component declares the same pairs as state entries (`Types.fill`, …).\r\n */\r\ninterface AttributePropOptions<Ext, Int> {\r\n /** Initial value, used when the constructor `props` object omits the key. */\r\n default?: Ext;\r\n /** Override the attribute's built-in external → internal mapper. */\r\n mapper?: (ext: Ext, prev?: Int) => Int;\r\n /** Override the attribute's built-in lerp for `to()`. */\r\n tween?: TweenFn<Int>;\r\n}\r\n\r\n/**\r\n * Build one attribute-typed `property` from its canonical {@link AttributeOps}.\r\n *\r\n * `fallback` is a factory rather than a value so array/object defaults aren't a\r\n * single instance shared by every property declared through it. An **explicit**\r\n * `default: undefined` means \"this prop has no default\" and is honoured as such.\r\n */\r\nfunction attributeProperty<Ext, Int>(\r\n fallback: () => Ext,\r\n mapper?: (ext: Ext, prev?: Int) => Int,\r\n tween?: TweenFn<Int>,\r\n /** The control a host draws for this attribute, when it is not the default. */\r\n kind?: string,\r\n) {\r\n return (opts?: AttributePropOptions<Ext, Int> & { kind?: string }) =>\r\n property<Ext, Int>({\r\n default: opts && \"default\" in opts ? opts.default : fallback(),\r\n mapper: opts?.mapper ?? mapper,\r\n tween: opts?.tween ?? tween,\r\n ...(opts?.kind ?? kind ? { kind: opts?.kind ?? kind } : {}),\r\n });\r\n}\r\n\r\n/** A fill-layer property: a CSS string, a fill prop object, a `Fills` chain, or an array of them, lerped layer by layer. */\r\nexport const fillProperty = attributeProperty<Fill, FillResolved[]>(() => [], fillOps.resolve, fillOps.lerp, \"fills\");\r\n\r\n/** An effect-chain property — the `effects` prop's op set. */\r\nexport const effectsProperty = attributeProperty<Effect, NodeEffect[]>(() => [], effectsOps.resolve, effectsOps.lerp, \"effects\");\r\n\r\n/** An edge-inset property: scalar, symmetric or per-edge, tweened per edge. */\r\nexport const insetsProperty = attributeProperty<Insets, InsetsResolved>(() => 0, insetsOps.resolve, insetsOps.lerp, \"insets\");\r\n\r\n/**\r\n * An alignment property: a named position (`'center'`, `'topLeft'`, …) resolved\r\n * to a per-axis {@link Vector2} in `[-1, 1]`, tweened as a vector so\r\n * `'centerLeft' → 'centerRight'` slides.\r\n */\r\nexport const alignmentProperty = attributeProperty<Alignment, Vector2>(() => \"center\", alignmentOps.resolve, alignmentOps.lerp, \"alignment\");\r\n\r\n/**\r\n * A layout-mode property. Mid-tween it holds both modes and how far along, so\r\n * restoring the prop — which is what a seek does — restores the blend with it.\r\n */\r\nexport const flowProperty = attributeProperty<FlowMode, FlowResolved>(() => \"freeform\", undefined, flowOps.lerp);\r\n\r\n/**\r\n * A 3D point that may be unset: a node's `lookAt`. It defaults to unset (not to\r\n * the origin), stays unset when a binding returns `undefined`, and tweens with\r\n * `to()` — from `unset`'s reading of an unset start (see {@link lerpOptionalVector3}).\r\n */\r\nexport function optionalVector3Property(unset: \"origin\" | \"snap\") {\r\n return property<Vector3Input | undefined, Vector3 | undefined>({\r\n default: undefined,\r\n mapper: resolveOptionalVector3,\r\n tween: (from, to, t) => lerpOptionalVector3(from, to, t, unset),\r\n kind: \"vector3\",\r\n });\r\n}\r\n\r\n/** A rotation as a unit quaternion, interpolated with shortest-arc slerp. */\r\nexport const quaternionProperty = attributeProperty<Quaternion, Quaternion>(\r\n () => ({ x: 0, y: 0, z: 0, w: 1 }), undefined, quaternionOps.lerp, \"quaternion\",\r\n);\r\n\r\n/**\r\n * An audio level — a gain, a pan position, anything a clip or a bus schedules.\r\n *\r\n * `Param`, not `number`, because an `AudioRequest` is a schedule record built\r\n * once during precomp: a per-frame prop write would be read on whichever frame\r\n * happened to create the request and then never again. A `Curve` *is* the\r\n * automation lane, which is why the tween interpolates between whole curves.\r\n */\r\nexport const audioParamProperty = attributeProperty<Param, Param>(() => 0, undefined, audioParamOps.lerp, \"audioParam\");\r\n\r\n/**\r\n * An audio filter chain — the `filters` prop's op set.\r\n *\r\n * Without it a chain is an object-valued prop, and `Node._prepareStep` drops\r\n * those silently: the tween would run its duration and write nothing.\r\n */\r\nexport const audioFiltersProperty = attributeProperty<AudioFilter, AudioFilterItem[]>(\r\n () => [], audioFiltersOps.resolve, audioFiltersOps.lerp, \"audioFilters\",\r\n);\r\n"]}
@@ -10,7 +10,7 @@ export type CornerRadiusResolved = Corners<number>;
10
10
  */
11
11
  export type RectCornerRadius = CornersInput<number> | CornerRadiusResolved;
12
12
  /**
13
- * The corner-radius attribute's op set: `resolve`/`lerp` for `@cornerRadiusProperty`,
13
+ * The corner-radius attribute's op set: `resolve`/`lerp` for `Shapes.corners`,
14
14
  * plus the uniform/zero checks a renderer needs to pick a cheap draw path (see
15
15
  * `RectShape.computeGeometry` in `@motionscript/skia-render`).
16
16
  */
@@ -1,7 +1,7 @@
1
1
  import { lerpNumber } from "../../../tween/lerp.js";
2
2
  import { resolveCorners, lerpCorners, isUniformCorners } from "./corners.js";
3
3
  /**
4
- * The corner-radius attribute's op set: `resolve`/`lerp` for `@cornerRadiusProperty`,
4
+ * The corner-radius attribute's op set: `resolve`/`lerp` for `Shapes.corners`,
5
5
  * plus the uniform/zero checks a renderer needs to pick a cheap draw path (see
6
6
  * `RectShape.computeGeometry` in `@motionscript/skia-render`).
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"corner-radius.js","sourceRoot":"","sources":["../../../../src/attributes/shape/corners/corner-radius.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAyB,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAajG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC5C,6EAA6E;IAC7E,qEAAqE;IACrE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,KAA6B,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;IACnI,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,UAAU,CAAC;IAC3D,cAAc,EAAE,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ;IACrE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;IAC7C,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,WAAW,KAAK,CAAC;CACtH,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport type { CornerRadiusOps } from \"@/attributes/shared/operators\";\r\nimport { Corners, CornersInput, resolveCorners, lerpCorners, isUniformCorners } from \"./corners\";\r\n\r\n/** Per-corner border radius values, all fully resolved to numbers. */\r\nexport type CornerRadiusResolved = Corners<number>;\r\n\r\n/**\r\n * Accepted corner radius input for a Rect: a single number applies uniformly to\r\n * all corners; an object overrides corners individually (`{ topLeft, … }`) or by\r\n * axis (`{ top, bottom }` / `{ left, right }`). An already-resolved value passes\r\n * through. Unspecified corners fall back to a previous value or 0 when resolved.\r\n */\r\nexport type RectCornerRadius = CornersInput<number> | CornerRadiusResolved;\r\n\r\n/**\r\n * The corner-radius attribute's op set: `resolve`/`lerp` for `@cornerRadiusProperty`,\r\n * plus the uniform/zero checks a renderer needs to pick a cheap draw path (see\r\n * `RectShape.computeGeometry` in `@motionscript/skia-render`).\r\n */\r\nexport const cornerRadiusOps: CornerRadiusOps = {\r\n // A resolved value is structurally a full per-corner `CornersInput<number>`,\r\n // so pin T=number and let resolveCorners re-resolve it idempotently.\r\n resolve: (value, previous) => resolveCorners(value as CornersInput<number>, 0, previous, (v): v is number => typeof v === \"number\"),\r\n lerp: (from, to, t) => lerpCorners(from, to, t, lerpNumber),\r\n isUniformInput: (value): value is number => typeof value === \"number\",\r\n isUniform: (value) => isUniformCorners(value),\r\n isZero: (value) => value.topLeft === 0 && value.topRight === 0 && value.bottomLeft === 0 && value.bottomRight === 0,\r\n};\r\n"]}
1
+ {"version":3,"file":"corner-radius.js","sourceRoot":"","sources":["../../../../src/attributes/shape/corners/corner-radius.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAyB,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAajG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC5C,6EAA6E;IAC7E,qEAAqE;IACrE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,KAA6B,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;IACnI,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,UAAU,CAAC;IAC3D,cAAc,EAAE,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ;IACrE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;IAC7C,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,WAAW,KAAK,CAAC;CACtH,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport type { CornerRadiusOps } from \"@/attributes/shared/operators\";\r\nimport { Corners, CornersInput, resolveCorners, lerpCorners, isUniformCorners } from \"./corners\";\r\n\r\n/** Per-corner border radius values, all fully resolved to numbers. */\r\nexport type CornerRadiusResolved = Corners<number>;\r\n\r\n/**\r\n * Accepted corner radius input for a Rect: a single number applies uniformly to\r\n * all corners; an object overrides corners individually (`{ topLeft, … }`) or by\r\n * axis (`{ top, bottom }` / `{ left, right }`). An already-resolved value passes\r\n * through. Unspecified corners fall back to a previous value or 0 when resolved.\r\n */\r\nexport type RectCornerRadius = CornersInput<number> | CornerRadiusResolved;\r\n\r\n/**\r\n * The corner-radius attribute's op set: `resolve`/`lerp` for `Shapes.corners`,\r\n * plus the uniform/zero checks a renderer needs to pick a cheap draw path (see\r\n * `RectShape.computeGeometry` in `@motionscript/skia-render`).\r\n */\r\nexport const cornerRadiusOps: CornerRadiusOps = {\r\n // A resolved value is structurally a full per-corner `CornersInput<number>`,\r\n // so pin T=number and let resolveCorners re-resolve it idempotently.\r\n resolve: (value, previous) => resolveCorners(value as CornersInput<number>, 0, previous, (v): v is number => typeof v === \"number\"),\r\n lerp: (from, to, t) => lerpCorners(from, to, t, lerpNumber),\r\n isUniformInput: (value): value is number => typeof value === \"number\",\r\n isUniform: (value) => isUniformCorners(value),\r\n isZero: (value) => value.topLeft === 0 && value.topRight === 0 && value.bottomLeft === 0 && value.bottomRight === 0,\r\n};\r\n"]}
@@ -5,7 +5,7 @@ import type { ModedEffect, EffectData } from "../effect-data.js";
5
5
  * geometry — the drop shadow that a `shadow` prop can't give you when the shape
6
6
  * on screen isn't the shape of the path.
7
7
  *
8
- * `ShapeNode.shadow` fills the node's own outline with the shadow colour and
8
+ * A shape's `shadow` fills the node's own outline with the shadow colour and
9
9
  * blurs it, which is exactly right for a rect, an ellipse or a star. It is
10
10
  * exactly wrong for anything whose visible form comes from *pixels*: a cut-out
11
11
  * PNG, a video with an alpha channel, a line of text, a whole subtree. All of