@motionscript/core 0.1.0-alpha.5 → 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 (615) hide show
  1. package/CHANGELOG.md +55 -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-LKUYVFU3.js.map +7 -0
  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 +2 -0
  74. package/dist/browser/index.js +1 -1
  75. package/dist/browser/index.js.map +4 -4
  76. package/dist/browser/manifest.json +3 -4
  77. package/dist/browser/sdk.js +1 -1
  78. package/dist/component/api.d.ts +508 -0
  79. package/dist/component/api.d.ts.map +1 -0
  80. package/dist/component/api.js +4 -0
  81. package/dist/component/api.js.map +1 -0
  82. package/dist/component/builtins/audio.d.ts +26 -0
  83. package/dist/component/builtins/audio.d.ts.map +1 -0
  84. package/dist/component/builtins/audio.js +41 -0
  85. package/dist/component/builtins/audio.js.map +1 -0
  86. package/dist/component/builtins/canvas3d.d.ts +98 -0
  87. package/dist/component/builtins/canvas3d.d.ts.map +1 -0
  88. package/dist/component/builtins/canvas3d.js +21 -0
  89. package/dist/component/builtins/canvas3d.js.map +1 -0
  90. package/dist/component/builtins/composite.d.ts +56 -0
  91. package/dist/component/builtins/composite.d.ts.map +1 -0
  92. package/dist/component/builtins/composite.js +25 -0
  93. package/dist/component/builtins/composite.js.map +1 -0
  94. package/dist/component/builtins/geometry.d.ts +505 -0
  95. package/dist/component/builtins/geometry.d.ts.map +1 -0
  96. package/dist/component/builtins/geometry.js +107 -0
  97. package/dist/component/builtins/geometry.js.map +1 -0
  98. package/dist/component/builtins/layout.d.ts +88 -0
  99. package/dist/component/builtins/layout.d.ts.map +1 -0
  100. package/dist/component/builtins/layout.js +84 -0
  101. package/dist/component/builtins/layout.js.map +1 -0
  102. package/dist/component/builtins/media.d.ts +95 -0
  103. package/dist/component/builtins/media.d.ts.map +1 -0
  104. package/dist/component/builtins/media.js +149 -0
  105. package/dist/component/builtins/media.js.map +1 -0
  106. package/dist/component/builtins/providers.d.ts +23 -0
  107. package/dist/component/builtins/providers.d.ts.map +1 -0
  108. package/dist/component/builtins/providers.js +30 -0
  109. package/dist/component/builtins/providers.js.map +1 -0
  110. package/dist/component/builtins/text.d.ts +193 -0
  111. package/dist/component/builtins/text.d.ts.map +1 -0
  112. package/dist/component/builtins/text.js +113 -0
  113. package/dist/component/builtins/text.js.map +1 -0
  114. package/dist/component/builtins/three.d.ts +1085 -0
  115. package/dist/component/builtins/three.d.ts.map +1 -0
  116. package/dist/component/builtins/three.js +265 -0
  117. package/dist/component/builtins/three.js.map +1 -0
  118. package/dist/component/clip-of.d.ts +5 -0
  119. package/dist/component/clip-of.d.ts.map +1 -0
  120. package/dist/component/clip-of.js +33 -0
  121. package/dist/component/clip-of.js.map +1 -0
  122. package/dist/component/commands-for.d.ts +19 -0
  123. package/dist/component/commands-for.d.ts.map +1 -0
  124. package/dist/component/commands-for.js +5 -0
  125. package/dist/component/commands-for.js.map +1 -0
  126. package/dist/component/component-audio.d.ts +9 -0
  127. package/dist/component/component-audio.d.ts.map +1 -0
  128. package/dist/component/component-audio.js +18 -0
  129. package/dist/component/component-audio.js.map +1 -0
  130. package/dist/component/component2d.d.ts +9 -0
  131. package/dist/component/component2d.d.ts.map +1 -0
  132. package/dist/component/component2d.js +239 -0
  133. package/dist/component/component2d.js.map +1 -0
  134. package/dist/component/component3d.d.ts +9 -0
  135. package/dist/component/component3d.d.ts.map +1 -0
  136. package/dist/component/component3d.js +99 -0
  137. package/dist/component/component3d.js.map +1 -0
  138. package/dist/component/factory.d.ts +63 -0
  139. package/dist/component/factory.d.ts.map +1 -0
  140. package/dist/component/factory.js +313 -0
  141. package/dist/component/factory.js.map +1 -0
  142. package/dist/component/modules/aim.d.ts +30 -0
  143. package/dist/component/modules/aim.d.ts.map +1 -0
  144. package/dist/component/modules/aim.js +39 -0
  145. package/dist/component/modules/aim.js.map +1 -0
  146. package/dist/component/modules/corners.d.ts +13 -0
  147. package/dist/component/modules/corners.d.ts.map +1 -0
  148. package/dist/component/modules/corners.js +12 -0
  149. package/dist/component/modules/corners.js.map +1 -0
  150. package/dist/component/modules/flow.d.ts +26 -0
  151. package/dist/component/modules/flow.d.ts.map +1 -0
  152. package/dist/component/modules/flow.js +55 -0
  153. package/dist/component/modules/flow.js.map +1 -0
  154. package/dist/component/modules/material.d.ts +40 -0
  155. package/dist/component/modules/material.d.ts.map +1 -0
  156. package/dist/component/modules/material.js +75 -0
  157. package/dist/component/modules/material.js.map +1 -0
  158. package/dist/component/modules/paint.d.ts +71 -0
  159. package/dist/component/modules/paint.d.ts.map +1 -0
  160. package/dist/component/modules/paint.js +106 -0
  161. package/dist/component/modules/paint.js.map +1 -0
  162. package/dist/component/modules/shapes.d.ts +31 -0
  163. package/dist/component/modules/shapes.d.ts.map +1 -0
  164. package/dist/component/modules/shapes.js +43 -0
  165. package/dist/component/modules/shapes.js.map +1 -0
  166. package/dist/component/modules/text-layout.d.ts +26 -0
  167. package/dist/component/modules/text-layout.d.ts.map +1 -0
  168. package/dist/component/modules/text-layout.js +57 -0
  169. package/dist/component/modules/text-layout.js.map +1 -0
  170. package/dist/component/modules/text-style.d.ts +48 -0
  171. package/dist/component/modules/text-style.d.ts.map +1 -0
  172. package/dist/component/modules/text-style.js +63 -0
  173. package/dist/component/modules/text-style.js.map +1 -0
  174. package/dist/component/modules/three-entries.d.ts +23 -0
  175. package/dist/component/modules/three-entries.d.ts.map +1 -0
  176. package/dist/component/modules/three-entries.js +41 -0
  177. package/dist/component/modules/three-entries.js.map +1 -0
  178. package/dist/component/modules/view3d.d.ts +55 -0
  179. package/dist/component/modules/view3d.d.ts.map +1 -0
  180. package/dist/component/modules/view3d.js +160 -0
  181. package/dist/component/modules/view3d.js.map +1 -0
  182. package/dist/component/timeline.d.ts +22 -0
  183. package/dist/component/timeline.d.ts.map +1 -0
  184. package/dist/component/timeline.js +128 -0
  185. package/dist/component/timeline.js.map +1 -0
  186. package/dist/component/type-def.d.ts +26 -0
  187. package/dist/component/type-def.d.ts.map +1 -0
  188. package/dist/component/type-def.js +16 -0
  189. package/dist/component/type-def.js.map +1 -0
  190. package/dist/component/types.d.ts +91 -0
  191. package/dist/component/types.d.ts.map +1 -0
  192. package/dist/component/types.js +88 -0
  193. package/dist/component/types.js.map +1 -0
  194. package/dist/component/views.d.ts +121 -0
  195. package/dist/component/views.d.ts.map +1 -0
  196. package/dist/component/views.js +413 -0
  197. package/dist/component/views.js.map +1 -0
  198. package/dist/component.d.ts +10 -19
  199. package/dist/component.d.ts.map +1 -1
  200. package/dist/component.js +10 -19
  201. package/dist/component.js.map +1 -1
  202. package/dist/components/builtins/audio/audio.d.ts +53 -0
  203. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  204. package/dist/components/builtins/audio/audio.js +41 -0
  205. package/dist/components/builtins/audio/audio.js.map +1 -0
  206. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  207. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  208. package/dist/components/builtins/geometry/composite.js +25 -0
  209. package/dist/components/builtins/geometry/composite.js.map +1 -0
  210. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  211. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  212. package/dist/components/builtins/geometry/geometry.js +107 -0
  213. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  214. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  215. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  216. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  217. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  218. package/dist/components/builtins/layout/layout.d.ts +186 -0
  219. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  220. package/dist/components/builtins/layout/layout.js +84 -0
  221. package/dist/components/builtins/layout/layout.js.map +1 -0
  222. package/dist/components/builtins/media/media.d.ts +240 -0
  223. package/dist/components/builtins/media/media.d.ts.map +1 -0
  224. package/dist/components/builtins/media/media.js +149 -0
  225. package/dist/components/builtins/media/media.js.map +1 -0
  226. package/dist/components/builtins/providers/providers.d.ts +47 -0
  227. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  228. package/dist/components/builtins/providers/providers.js +30 -0
  229. package/dist/components/builtins/providers/providers.js.map +1 -0
  230. package/dist/components/builtins/text/number-format.d.ts +66 -0
  231. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  232. package/dist/components/builtins/text/number-format.js +227 -0
  233. package/dist/components/builtins/text/number-format.js.map +1 -0
  234. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  235. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  236. package/dist/components/builtins/text/number-pattern.js +77 -0
  237. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  238. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  239. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  240. package/dist/components/builtins/text/text-defaults.js +37 -0
  241. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  242. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  243. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  244. package/dist/components/builtins/text/text-layout.js +331 -0
  245. package/dist/components/builtins/text/text-layout.js.map +1 -0
  246. package/dist/components/builtins/text/text.d.ts +409 -0
  247. package/dist/components/builtins/text/text.d.ts.map +1 -0
  248. package/dist/components/builtins/text/text.js +113 -0
  249. package/dist/components/builtins/text/text.js.map +1 -0
  250. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  251. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  252. package/dist/components/builtins/three/canvas3d.js +21 -0
  253. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  254. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  255. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  256. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  257. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  258. package/dist/components/builtins/three/three.d.ts +1889 -0
  259. package/dist/components/builtins/three/three.d.ts.map +1 -0
  260. package/dist/components/builtins/three/three.js +305 -0
  261. package/dist/components/builtins/three/three.js.map +1 -0
  262. package/dist/components/factory/api.d.ts +516 -0
  263. package/dist/components/factory/api.d.ts.map +1 -0
  264. package/dist/components/factory/api.js +4 -0
  265. package/dist/components/factory/api.js.map +1 -0
  266. package/dist/components/factory/clip-of.d.ts +5 -0
  267. package/dist/components/factory/clip-of.d.ts.map +1 -0
  268. package/dist/components/factory/clip-of.js +33 -0
  269. package/dist/components/factory/clip-of.js.map +1 -0
  270. package/dist/components/factory/commands-for.d.ts +19 -0
  271. package/dist/components/factory/commands-for.d.ts.map +1 -0
  272. package/dist/components/factory/commands-for.js +5 -0
  273. package/dist/components/factory/commands-for.js.map +1 -0
  274. package/dist/components/factory/component-audio.d.ts +9 -0
  275. package/dist/components/factory/component-audio.d.ts.map +1 -0
  276. package/dist/components/factory/component-audio.js +18 -0
  277. package/dist/components/factory/component-audio.js.map +1 -0
  278. package/dist/components/factory/component2d.d.ts +8 -0
  279. package/dist/components/factory/component2d.d.ts.map +1 -0
  280. package/dist/components/factory/component2d.js +240 -0
  281. package/dist/components/factory/component2d.js.map +1 -0
  282. package/dist/components/factory/component3d.d.ts +9 -0
  283. package/dist/components/factory/component3d.d.ts.map +1 -0
  284. package/dist/components/factory/component3d.js +99 -0
  285. package/dist/components/factory/component3d.js.map +1 -0
  286. package/dist/components/factory/factory.d.ts +63 -0
  287. package/dist/components/factory/factory.d.ts.map +1 -0
  288. package/dist/components/factory/factory.js +313 -0
  289. package/dist/components/factory/factory.js.map +1 -0
  290. package/dist/components/factory/timeline.d.ts +22 -0
  291. package/dist/components/factory/timeline.d.ts.map +1 -0
  292. package/dist/components/factory/timeline.js +128 -0
  293. package/dist/components/factory/timeline.js.map +1 -0
  294. package/dist/components/factory/type-def.d.ts +26 -0
  295. package/dist/components/factory/type-def.d.ts.map +1 -0
  296. package/dist/components/factory/type-def.js +16 -0
  297. package/dist/components/factory/type-def.js.map +1 -0
  298. package/dist/components/factory/types.d.ts +91 -0
  299. package/dist/components/factory/types.d.ts.map +1 -0
  300. package/dist/components/factory/types.js +88 -0
  301. package/dist/components/factory/types.js.map +1 -0
  302. package/dist/components/factory/views.d.ts +121 -0
  303. package/dist/components/factory/views.d.ts.map +1 -0
  304. package/dist/components/factory/views.js +413 -0
  305. package/dist/components/factory/views.js.map +1 -0
  306. package/dist/components/modules/aim.d.ts +30 -0
  307. package/dist/components/modules/aim.d.ts.map +1 -0
  308. package/dist/components/modules/aim.js +39 -0
  309. package/dist/components/modules/aim.js.map +1 -0
  310. package/dist/components/modules/corners.d.ts +13 -0
  311. package/dist/components/modules/corners.d.ts.map +1 -0
  312. package/dist/components/modules/corners.js +12 -0
  313. package/dist/components/modules/corners.js.map +1 -0
  314. package/dist/components/modules/flow.d.ts +26 -0
  315. package/dist/components/modules/flow.d.ts.map +1 -0
  316. package/dist/components/modules/flow.js +57 -0
  317. package/dist/components/modules/flow.js.map +1 -0
  318. package/dist/components/modules/material.d.ts +40 -0
  319. package/dist/components/modules/material.d.ts.map +1 -0
  320. package/dist/components/modules/material.js +75 -0
  321. package/dist/components/modules/material.js.map +1 -0
  322. package/dist/components/modules/paint.d.ts +71 -0
  323. package/dist/components/modules/paint.d.ts.map +1 -0
  324. package/dist/components/modules/paint.js +106 -0
  325. package/dist/components/modules/paint.js.map +1 -0
  326. package/dist/components/modules/shapes.d.ts +31 -0
  327. package/dist/components/modules/shapes.d.ts.map +1 -0
  328. package/dist/components/modules/shapes.js +43 -0
  329. package/dist/components/modules/shapes.js.map +1 -0
  330. package/dist/components/modules/text-layout.d.ts +26 -0
  331. package/dist/components/modules/text-layout.d.ts.map +1 -0
  332. package/dist/components/modules/text-layout.js +57 -0
  333. package/dist/components/modules/text-layout.js.map +1 -0
  334. package/dist/components/modules/text-style.d.ts +48 -0
  335. package/dist/components/modules/text-style.d.ts.map +1 -0
  336. package/dist/components/modules/text-style.js +63 -0
  337. package/dist/components/modules/text-style.js.map +1 -0
  338. package/dist/components/modules/three-entries.d.ts +23 -0
  339. package/dist/components/modules/three-entries.d.ts.map +1 -0
  340. package/dist/components/modules/three-entries.js +41 -0
  341. package/dist/components/modules/three-entries.js.map +1 -0
  342. package/dist/components/modules/view3d.d.ts +59 -0
  343. package/dist/components/modules/view3d.d.ts.map +1 -0
  344. package/dist/components/modules/view3d.js +171 -0
  345. package/dist/components/modules/view3d.js.map +1 -0
  346. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  347. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  348. package/dist/components/trees/2d/group-bounds.js +87 -0
  349. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  350. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  351. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  352. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  353. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  354. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  355. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  356. package/dist/components/trees/2d/node-motion.js +86 -0
  357. package/dist/components/trees/2d/node-motion.js.map +1 -0
  358. package/dist/components/trees/2d/node-render.d.ts +36 -0
  359. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  360. package/dist/components/trees/2d/node-render.js +67 -0
  361. package/dist/components/trees/2d/node-render.js.map +1 -0
  362. package/dist/components/trees/2d/node-space.d.ts +63 -0
  363. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  364. package/dist/components/trees/2d/node-space.js +131 -0
  365. package/dist/components/trees/2d/node-space.js.map +1 -0
  366. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  367. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  368. package/dist/components/trees/2d/node-transform.js +73 -0
  369. package/dist/components/trees/2d/node-transform.js.map +1 -0
  370. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  371. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  372. package/dist/components/trees/2d/node2d.js +1481 -0
  373. package/dist/components/trees/2d/node2d.js.map +1 -0
  374. package/dist/components/trees/audio/index.d.ts +2 -0
  375. package/dist/components/trees/audio/index.d.ts.map +1 -0
  376. package/dist/components/trees/audio/index.js +2 -0
  377. package/dist/components/trees/audio/index.js.map +1 -0
  378. package/dist/components/trees/audio/node-audio.d.ts +109 -0
  379. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  380. package/dist/components/trees/audio/node-audio.js +167 -0
  381. package/dist/components/trees/audio/node-audio.js.map +1 -0
  382. package/dist/components/trees/index.d.ts +10 -0
  383. package/dist/components/trees/index.d.ts.map +1 -0
  384. package/dist/components/trees/index.js +14 -0
  385. package/dist/components/trees/index.js.map +1 -0
  386. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  387. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  388. package/dist/components/trees/node/node-editor-state.js +23 -0
  389. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  390. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  391. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  392. package/dist/components/trees/node/node-reactive.js +135 -0
  393. package/dist/components/trees/node/node-reactive.js.map +1 -0
  394. package/dist/components/trees/node/node-time.d.ts +39 -0
  395. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  396. package/dist/components/trees/node/node-time.js +14 -0
  397. package/dist/components/trees/node/node-time.js.map +1 -0
  398. package/dist/components/trees/node/node-walk.d.ts +46 -0
  399. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  400. package/dist/components/trees/node/node-walk.js +74 -0
  401. package/dist/components/trees/node/node-walk.js.map +1 -0
  402. package/dist/components/trees/node/node.d.ts +401 -0
  403. package/dist/components/trees/node/node.d.ts.map +1 -0
  404. package/dist/components/trees/node/node.js +680 -0
  405. package/dist/components/trees/node/node.js.map +1 -0
  406. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  407. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  408. package/dist/components/trees/root/canvas2d-node.js +216 -0
  409. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  410. package/dist/components/trees/three/node3d.d.ts +222 -0
  411. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  412. package/dist/components/trees/three/node3d.js +289 -0
  413. package/dist/components/trees/three/node3d.js.map +1 -0
  414. package/dist/document/audio.d.ts +9 -1
  415. package/dist/document/audio.d.ts.map +1 -1
  416. package/dist/document/audio.js +41 -0
  417. package/dist/document/audio.js.map +1 -1
  418. package/dist/document/builtins.d.ts.map +1 -1
  419. package/dist/document/builtins.js +13 -31
  420. package/dist/document/builtins.js.map +1 -1
  421. package/dist/document/command-traits.d.ts +2 -2
  422. package/dist/document/command-traits.js +4 -1
  423. package/dist/document/command-traits.js.map +1 -1
  424. package/dist/document/deny-globals.d.ts +2 -2
  425. package/dist/document/deny-globals.js +2 -2
  426. package/dist/document/deny-globals.js.map +1 -1
  427. package/dist/document/diff.d.ts.map +1 -1
  428. package/dist/document/diff.js +3 -3
  429. package/dist/document/diff.js.map +1 -1
  430. package/dist/document/doc-index.d.ts.map +1 -1
  431. package/dist/document/doc-index.js +3 -3
  432. package/dist/document/doc-index.js.map +1 -1
  433. package/dist/document/expression/index.d.ts +1 -1
  434. package/dist/document/expression/index.js +1 -1
  435. package/dist/document/expression/index.js.map +1 -1
  436. package/dist/document/expression/ops.js +1 -1
  437. package/dist/document/expression/ops.js.map +1 -1
  438. package/dist/document/index.d.ts +1 -2
  439. package/dist/document/index.d.ts.map +1 -1
  440. package/dist/document/index.js +1 -2
  441. package/dist/document/index.js.map +1 -1
  442. package/dist/document/node-decorator.d.ts +14 -10
  443. package/dist/document/node-decorator.d.ts.map +1 -1
  444. package/dist/document/node-decorator.js +14 -10
  445. package/dist/document/node-decorator.js.map +1 -1
  446. package/dist/document/node-descriptor.d.ts +9 -3
  447. package/dist/document/node-descriptor.d.ts.map +1 -1
  448. package/dist/document/node-descriptor.js.map +1 -1
  449. package/dist/document/placement.js +2 -2
  450. package/dist/document/placement.js.map +1 -1
  451. package/dist/document/registry.d.ts +29 -36
  452. package/dist/document/registry.d.ts.map +1 -1
  453. package/dist/document/registry.js +29 -35
  454. package/dist/document/registry.js.map +1 -1
  455. package/dist/document/settled-index.d.ts +49 -0
  456. package/dist/document/settled-index.d.ts.map +1 -0
  457. package/dist/document/settled-index.js +247 -0
  458. package/dist/document/settled-index.js.map +1 -0
  459. package/dist/document/timeline.d.ts +29 -3
  460. package/dist/document/timeline.d.ts.map +1 -1
  461. package/dist/document/timeline.js +99 -3
  462. package/dist/document/timeline.js.map +1 -1
  463. package/dist/document/types.d.ts +4 -4
  464. package/dist/document/types.js.map +1 -1
  465. package/dist/document/validate.d.ts +1 -1
  466. package/dist/document/validate.js.map +1 -1
  467. package/dist/experimental.d.ts +22 -0
  468. package/dist/experimental.d.ts.map +1 -0
  469. package/dist/experimental.js +20 -0
  470. package/dist/experimental.js.map +1 -0
  471. package/dist/index.d.ts +10 -2
  472. package/dist/index.d.ts.map +1 -1
  473. package/dist/index.js +10 -2
  474. package/dist/index.js.map +1 -1
  475. package/dist/layout/types.d.ts +1 -1
  476. package/dist/layout/types.js.map +1 -1
  477. package/dist/nodes/audio/index.d.ts +2 -2
  478. package/dist/nodes/audio/index.d.ts.map +1 -1
  479. package/dist/nodes/audio/index.js +0 -2
  480. package/dist/nodes/audio/index.js.map +1 -1
  481. package/dist/nodes/audio/sound-node.d.ts +2 -1
  482. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  483. package/dist/nodes/audio/sound-node.js +3 -0
  484. package/dist/nodes/audio/sound-node.js.map +1 -1
  485. package/dist/nodes/index.d.ts +39 -27
  486. package/dist/nodes/index.d.ts.map +1 -1
  487. package/dist/nodes/index.js +16 -30
  488. package/dist/nodes/index.js.map +1 -1
  489. package/dist/nodes/node/node.d.ts +7 -1
  490. package/dist/nodes/node/node.d.ts.map +1 -1
  491. package/dist/nodes/node/node.js +23 -8
  492. package/dist/nodes/node/node.js.map +1 -1
  493. package/dist/nodes/root/canvas2d-node.d.ts +2 -1
  494. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -1
  495. package/dist/nodes/root/canvas2d-node.js +3 -0
  496. package/dist/nodes/root/canvas2d-node.js.map +1 -1
  497. package/dist/nodes/text/richtext-node.d.ts +0 -5
  498. package/dist/nodes/text/richtext-node.d.ts.map +1 -1
  499. package/dist/nodes/text/richtext-node.js +5 -71
  500. package/dist/nodes/text/richtext-node.js.map +1 -1
  501. package/dist/nodes/text/text-base.d.ts +5 -22
  502. package/dist/nodes/text/text-base.d.ts.map +1 -1
  503. package/dist/nodes/text/text-base.js +12 -363
  504. package/dist/nodes/text/text-base.js.map +1 -1
  505. package/dist/nodes/text/text-layout.d.ts +87 -0
  506. package/dist/nodes/text/text-layout.d.ts.map +1 -0
  507. package/dist/nodes/text/text-layout.js +368 -0
  508. package/dist/nodes/text/text-layout.js.map +1 -0
  509. package/dist/nodes/three/canvas3d-node.d.ts +3 -1
  510. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  511. package/dist/nodes/three/canvas3d-node.js +6 -0
  512. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  513. package/dist/props/host.d.ts +1 -1
  514. package/dist/props/host.js.map +1 -1
  515. package/dist/props/slot.d.ts +1 -1
  516. package/dist/props/slot.js +1 -1
  517. package/dist/props/slot.js.map +1 -1
  518. package/dist/render/clip.d.ts +1 -1
  519. package/dist/render/clip.js +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/rect.js.map +1 -1
  522. package/dist/render/descriptors/text.d.ts +11 -5
  523. package/dist/render/descriptors/text.d.ts.map +1 -1
  524. package/dist/render/descriptors/text.js +7 -1
  525. package/dist/render/descriptors/text.js.map +1 -1
  526. package/dist/render/render-context2d.d.ts +2 -2
  527. package/dist/render/render-context2d.js.map +1 -1
  528. package/dist/render3d/builders.d.ts +1 -1
  529. package/dist/render3d/builders.js +1 -1
  530. package/dist/render3d/builders.js.map +1 -1
  531. package/dist/render3d/graphics3d.d.ts +13 -19
  532. package/dist/render3d/graphics3d.d.ts.map +1 -1
  533. package/dist/render3d/graphics3d.js +13 -19
  534. package/dist/render3d/graphics3d.js.map +1 -1
  535. package/dist/render3d/scene3d.d.ts +1 -1
  536. package/dist/render3d/scene3d.js +1 -1
  537. package/dist/render3d/scene3d.js.map +1 -1
  538. package/dist/render3d/texture.d.ts +2 -2
  539. package/dist/render3d/texture.d.ts.map +1 -1
  540. package/dist/render3d/texture.js.map +1 -1
  541. package/dist/render3d/vector3.d.ts +2 -2
  542. package/dist/render3d/vector3.js +2 -2
  543. package/dist/render3d/vector3.js.map +1 -1
  544. package/dist/runtime/asset-refine.d.ts +1 -1
  545. package/dist/runtime/asset-refine.d.ts.map +1 -1
  546. package/dist/runtime/asset-refine.js +1 -1
  547. package/dist/runtime/asset-refine.js.map +1 -1
  548. package/dist/runtime/asset-update.js +1 -1
  549. package/dist/runtime/asset-update.js.map +1 -1
  550. package/dist/runtime/audio-index.d.ts +0 -11
  551. package/dist/runtime/audio-index.d.ts.map +1 -1
  552. package/dist/runtime/audio-index.js +0 -25
  553. package/dist/runtime/audio-index.js.map +1 -1
  554. package/dist/runtime/clip-instance.d.ts +7 -4
  555. package/dist/runtime/clip-instance.d.ts.map +1 -1
  556. package/dist/runtime/clip-instance.js +21 -7
  557. package/dist/runtime/clip-instance.js.map +1 -1
  558. package/dist/runtime/clip-store.d.ts +11 -3
  559. package/dist/runtime/clip-store.d.ts.map +1 -1
  560. package/dist/runtime/clip-store.js +83 -23
  561. package/dist/runtime/clip-store.js.map +1 -1
  562. package/dist/runtime/engine.d.ts +3 -3
  563. package/dist/runtime/engine.js +2 -2
  564. package/dist/runtime/engine.js.map +1 -1
  565. package/dist/runtime/node-picking.d.ts +2 -2
  566. package/dist/runtime/node-picking.d.ts.map +1 -1
  567. package/dist/runtime/node-picking.js +9 -10
  568. package/dist/runtime/node-picking.js.map +1 -1
  569. package/dist/runtime/node-picking3d.d.ts +12 -5
  570. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  571. package/dist/runtime/node-picking3d.js +6 -1
  572. package/dist/runtime/node-picking3d.js.map +1 -1
  573. package/dist/runtime/playback-controller.d.ts +2 -2
  574. package/dist/runtime/playback-controller.d.ts.map +1 -1
  575. package/dist/runtime/playback-controller.js +1 -1
  576. package/dist/runtime/playback-controller.js.map +1 -1
  577. package/dist/runtime/state-evaluator.d.ts +2 -2
  578. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  579. package/dist/runtime/state-evaluator.js.map +1 -1
  580. package/dist/runtime/text-geometry.d.ts +1 -1
  581. package/dist/runtime/text-geometry.d.ts.map +1 -1
  582. package/dist/runtime/text-geometry.js +6 -3
  583. package/dist/runtime/text-geometry.js.map +1 -1
  584. package/dist/sdk/index.d.ts +46 -21
  585. package/dist/sdk/index.d.ts.map +1 -1
  586. package/dist/sdk/index.js +47 -43
  587. package/dist/sdk/index.js.map +1 -1
  588. package/dist/tween/command-decorator.d.ts +7 -9
  589. package/dist/tween/command-decorator.d.ts.map +1 -1
  590. package/dist/tween/command-decorator.js +2 -2
  591. package/dist/tween/command-decorator.js.map +1 -1
  592. package/dist/tween/command.d.ts +13 -1
  593. package/dist/tween/command.d.ts.map +1 -1
  594. package/dist/tween/command.js +14 -0
  595. package/dist/tween/command.js.map +1 -1
  596. package/dist/tween/index.d.ts +2 -1
  597. package/dist/tween/index.d.ts.map +1 -1
  598. package/dist/tween/index.js +1 -1
  599. package/dist/tween/index.js.map +1 -1
  600. package/dist/tween/loop.d.ts +1 -1
  601. package/dist/tween/loop.js +1 -1
  602. package/dist/tween/loop.js.map +1 -1
  603. package/dist/util/reference.d.ts +6 -6
  604. package/dist/util/reference.js.map +1 -1
  605. package/package.json +7 -10
  606. package/dist/browser/chunks/chunk-FUZVFT3W.js +0 -18
  607. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +0 -7
  608. package/dist/browser/chunks/chunk-QG6C23IJ.js +0 -3
  609. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +0 -7
  610. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  611. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  612. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  613. package/dist/browser/jsx-jsx-runtime.js +0 -2
  614. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
  615. /package/dist/browser/{jsx-jsx-dev-runtime.js.map → experimental.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/document/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,YAAY,GAOf,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,CAAU,EAAE,CAAU;IAC5C,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7E,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBAAE,OA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AE,CAAC;QACtC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAChD,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { loweredAudioDocument } from \"./audio\";\r\nimport {\r\n documentDuration,\r\n isAudioDocument,\r\n nodeSpan,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type CommandSpec,\r\n type NodeSpec,\r\n type VisualDocument,\r\n type TimedNodeSpec,\r\n type VariableSpec,\r\n} from \"./types\";\r\n\r\n/**\r\n * Deep equality over JSON values: key order is irrelevant, an `undefined`-valued\r\n * key equals an absent one (neither survives serialization), arrays are ordered.\r\n */\r\nexport function jsonEqual(a: unknown, b: unknown): boolean {\r\n if (a === b) return true;\r\n if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null) {\r\n return a !== a && b !== b;\r\n }\r\n if (Array.isArray(a)) {\r\n if (!Array.isArray(b) || a.length !== b.length) return false;\r\n for (let i = 0; i < a.length; i++) {\r\n if (!jsonEqual(a[i], b[i])) return false;\r\n }\r\n return true;\r\n }\r\n if (Array.isArray(b)) return false;\r\n const ao = a as Record<string, unknown>;\r\n const bo = b as Record<string, unknown>;\r\n let defined = 0;\r\n for (const key of Object.keys(ao)) {\r\n const value = ao[key];\r\n if (value === undefined) continue;\r\n defined++;\r\n if (!jsonEqual(value, bo[key])) return false;\r\n }\r\n for (const key of Object.keys(bo)) {\r\n if (bo[key] !== undefined) defined--;\r\n }\r\n return defined === 0;\r\n}\r\n\r\nexport interface RowChanges {\r\n added: Set<string>;\r\n removed: Set<string>;\r\n /** Present on both sides with any semantic field different. */\r\n changed: Set<string>;\r\n}\r\n\r\nexport interface ClipDiff {\r\n /** Nothing semantic differs — the two documents build the same clip. */\r\n identical: boolean;\r\n kindChanged: boolean;\r\n themeChanged: boolean;\r\n rootChanged: boolean;\r\n duration: boolean;\r\n nodes: RowChanges & {\r\n /** `type`, `key` or `props` differ. */\r\n respec: Set<string>;\r\n /** `parentId` differs. */\r\n moved: Set<string>;\r\n /** `startAt` or `endAt` differ, as spans. */\r\n span: Set<string>;\r\n /** Parents (`\"\"` for top level) whose kept children sit in a different sibling order. */\r\n reorderedParents: Set<string>;\r\n };\r\n commands: RowChanges & {\r\n /** `at` values whose kept commands appear in a different relative array order. */\r\n reorderedAts: Set<number>;\r\n };\r\n /** `changed` is `value` or `lerp`; a `name` is a label and never counts. */\r\n variables: RowChanges;\r\n /** Keys present on both sides that name a different node id. */\r\n remappedKeys: Set<string>;\r\n}\r\n\r\nfunction emptyDiff(): ClipDiff {\r\n return {\r\n identical: true,\r\n kindChanged: false,\r\n themeChanged: false,\r\n rootChanged: false,\r\n duration: false,\r\n nodes: {\r\n added: new Set(), removed: new Set(), changed: new Set(),\r\n respec: new Set(), moved: new Set(), span: new Set(), reorderedParents: new Set(),\r\n },\r\n commands: { added: new Set(), removed: new Set(), changed: new Set(), reorderedAts: new Set() },\r\n variables: { added: new Set(), removed: new Set(), changed: new Set() },\r\n remappedKeys: new Set(),\r\n };\r\n}\r\n\r\n/**\r\n * What differs between two versions of one clip, by row id.\r\n *\r\n * Only semantic fields are compared, so an edit that cannot change what the\r\n * clip builds (a variable's `name`, key order inside `props`, `startAt: 0`\r\n * against an absent one) is not a change. Audio documents are compared as the\r\n * compositions they lower to, which is what the timeline builds.\r\n */\r\nexport function diffClip(prev: ClipDocument, next: ClipDocument): ClipDiff {\r\n const diff = emptyDiff();\r\n if (prev === next) return diff;\r\n\r\n if (prev.kind !== next.kind) {\r\n diff.kindChanged = true;\r\n diff.identical = false;\r\n return diff;\r\n }\r\n\r\n const p = lowered(prev);\r\n const n = lowered(next);\r\n\r\n diff.themeChanged = !jsonEqual((prev as { theme?: unknown }).theme, (next as { theme?: unknown }).theme);\r\n diff.duration = documentDuration(p) !== documentDuration(n);\r\n\r\n if (prev.nodes !== next.nodes) diffNodes(p.nodes, n.nodes, diff);\r\n if (prev.variables !== next.variables) diffVariables(p.variables ?? [], n.variables ?? [], diff);\r\n const prevCommands = p.kind === \"composition\" ? p.commands : [];\r\n const nextCommands = n.kind === \"composition\" ? n.commands : [];\r\n if ((prev as { commands?: unknown }).commands !== (next as { commands?: unknown }).commands) {\r\n diffCommands(prevCommands, nextCommands, diff);\r\n }\r\n\r\n diff.identical = !diff.themeChanged && !diff.rootChanged && !diff.duration\r\n && diff.remappedKeys.size === 0\r\n && rowsEmpty(diff.nodes) && diff.nodes.reorderedParents.size === 0\r\n && rowsEmpty(diff.commands) && diff.commands.reorderedAts.size === 0\r\n && rowsEmpty(diff.variables);\r\n return diff;\r\n}\r\n\r\nfunction lowered(doc: ClipDocument): VisualDocument {\r\n return isAudioDocument(doc) ? loweredAudioDocument(doc) : doc;\r\n}\r\n\r\nfunction rowsEmpty(rows: RowChanges): boolean {\r\n return rows.added.size === 0 && rows.removed.size === 0 && rows.changed.size === 0;\r\n}\r\n\r\nconst DEFAULT_ROOT: NodeSpec = { id: ROOT_NODE_ID, type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} };\r\n\r\nfunction diffNodes(prevRows: readonly TimedNodeSpec[], nextRows: readonly TimedNodeSpec[], diff: ClipDiff): void {\r\n const prev = byId(prevRows);\r\n const next = byId(nextRows);\r\n const changes = diff.nodes;\r\n\r\n const prevRoot = prev.get(ROOT_NODE_ID) ?? DEFAULT_ROOT;\r\n const nextRoot = next.get(ROOT_NODE_ID) ?? DEFAULT_ROOT;\r\n diff.rootChanged = prevRoot !== nextRoot && !sameNode(prevRoot, nextRoot);\r\n\r\n for (const [id, a] of prev) {\r\n if (id === ROOT_NODE_ID) continue;\r\n const b = next.get(id);\r\n if (!b) {\r\n changes.removed.add(id);\r\n continue;\r\n }\r\n if (a === b) continue;\r\n let changed = false;\r\n if (a.type !== b.type || a.key !== b.key || !jsonEqual(a.props, b.props)) {\r\n changes.respec.add(id);\r\n changed = true;\r\n }\r\n if (a.parentId !== b.parentId) {\r\n changes.moved.add(id);\r\n changed = true;\r\n }\r\n if (!sameSpan(a, b)) {\r\n changes.span.add(id);\r\n changed = true;\r\n }\r\n if (changed || a.layerOrder !== b.layerOrder) changes.changed.add(id);\r\n }\r\n for (const id of next.keys()) {\r\n if (id !== ROOT_NODE_ID && !prev.has(id)) changes.added.add(id);\r\n }\r\n\r\n const prevKeys = keyed(prevRows);\r\n for (const [key, id] of keyed(nextRows)) {\r\n const was = prevKeys.get(key);\r\n if (was !== undefined && was !== id) diff.remappedKeys.add(key);\r\n }\r\n\r\n const prevOrder = siblingOrder(prevRows);\r\n const nextOrder = siblingOrder(nextRows);\r\n for (const [parent, before] of prevOrder) {\r\n const after = nextOrder.get(parent);\r\n if (after && !sameRelativeOrder(before, after)) changes.reorderedParents.add(parent);\r\n }\r\n}\r\n\r\nfunction sameNode(a: NodeSpec, b: NodeSpec): boolean {\r\n return a.type === b.type\r\n && a.key === b.key\r\n && a.parentId === b.parentId\r\n && a.layerOrder === b.layerOrder\r\n && jsonEqual(a.props, b.props)\r\n && sameSpan(a, b);\r\n}\r\n\r\nfunction sameSpan(a: NodeSpec, b: NodeSpec): boolean {\r\n const sa = nodeSpan(a);\r\n const sb = nodeSpan(b);\r\n return sa.start === sb.start && sa.end === sb.end;\r\n}\r\n\r\nfunction diffCommands(prevRows: readonly CommandSpec[], nextRows: readonly CommandSpec[], diff: ClipDiff): void {\r\n const prev = byId(prevRows);\r\n const next = byId(nextRows);\r\n const changes = diff.commands;\r\n\r\n for (const [id, a] of prev) {\r\n const b = next.get(id);\r\n if (!b) {\r\n changes.removed.add(id);\r\n continue;\r\n }\r\n if (a === b) continue;\r\n if (\r\n a.type !== b.type\r\n || a.targetId !== b.targetId\r\n || a.at !== b.at\r\n || (a.duration ?? 0) !== (b.duration ?? 0)\r\n || !jsonEqual(a.easing, b.easing)\r\n || !jsonEqual(a.loop, b.loop)\r\n || !jsonEqual(a.args, b.args)\r\n ) {\r\n changes.changed.add(id);\r\n }\r\n }\r\n for (const id of next.keys()) {\r\n if (!prev.has(id)) changes.added.add(id);\r\n }\r\n\r\n const prevAts = groupByAt(prevRows);\r\n const nextAts = groupByAt(nextRows);\r\n for (const [at, before] of prevAts) {\r\n const after = nextAts.get(at);\r\n if (after && !sameRelativeOrder(before, after)) changes.reorderedAts.add(at);\r\n }\r\n}\r\n\r\nfunction diffVariables(prevRows: readonly VariableSpec[], nextRows: readonly VariableSpec[], diff: ClipDiff): void {\r\n const prev = byId(prevRows);\r\n const next = byId(nextRows);\r\n const changes = diff.variables;\r\n for (const [id, a] of prev) {\r\n const b = next.get(id);\r\n if (!b) {\r\n changes.removed.add(id);\r\n continue;\r\n }\r\n if (a !== b && (a.lerp !== b.lerp || !jsonEqual(a.value, b.value))) changes.changed.add(id);\r\n }\r\n for (const id of next.keys()) {\r\n if (!prev.has(id)) changes.added.add(id);\r\n }\r\n}\r\n\r\nfunction byId<T extends { id: string }>(rows: readonly T[]): Map<string, T> {\r\n const out = new Map<string, T>();\r\n for (const row of rows) out.set(row.id, row);\r\n return out;\r\n}\r\n\r\nfunction keyed(rows: readonly NodeSpec[]): Map<string, string> {\r\n const out = new Map<string, string>();\r\n for (const row of rows) if (row.key) out.set(row.key, row.id);\r\n return out;\r\n}\r\n\r\n/** Child ids per parent, in the order `syncPresence` inserts them: `layerOrder`, ties by array index. */\r\nfunction siblingOrder(rows: readonly NodeSpec[]): Map<string, string[]> {\r\n const groups = new Map<string, Array<{ id: string; order: number; index: number }>>();\r\n rows.forEach((row, index) => {\r\n if (row.id === ROOT_NODE_ID) return;\r\n const parent = row.parentId ?? ROOT_NODE_ID;\r\n let list = groups.get(parent);\r\n if (!list) groups.set(parent, list = []);\r\n list.push({ id: row.id, order: row.layerOrder, index });\r\n });\r\n const out = new Map<string, string[]>();\r\n for (const [parent, list] of groups) {\r\n list.sort((a, b) => (a.order - b.order) || (a.index - b.index));\r\n out.set(parent, list.map((e) => e.id));\r\n }\r\n return out;\r\n}\r\n\r\n/** Command ids per exact `at`, in array order — the tiebreak `inTimelineOrder` uses. */\r\nfunction groupByAt(rows: readonly CommandSpec[]): Map<number, string[]> {\r\n const out = new Map<number, string[]>();\r\n for (const row of rows) {\r\n let list = out.get(row.at);\r\n if (!list) out.set(row.at, list = []);\r\n list.push(row.id);\r\n }\r\n return out;\r\n}\r\n\r\n/** Whether the ids both lists hold appear in the same relative order in each. */\r\nfunction sameRelativeOrder(a: readonly string[], b: readonly string[]): boolean {\r\n const inB = new Set(b);\r\n const inA = new Set(a);\r\n const sharedA = a.filter((id) => inB.has(id));\r\n const sharedB = b.filter((id) => inA.has(id));\r\n if (sharedA.length !== sharedB.length) return false;\r\n for (let i = 0; i < sharedA.length; i++) {\r\n if (sharedA[i] !== sharedB[i]) return false;\r\n }\r\n return true;\r\n}\r\n"]}
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/document/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACH,gBAAgB,EAChB,QAAQ,EACR,YAAY,GAOf,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,CAAU,EAAE,CAAU;IAC5C,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7E,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EA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AC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAChD,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { clipDocument } from \"./audio\";\r\nimport {\r\n documentDuration,\r\n nodeSpan,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type CommandSpec,\r\n type NodeSpec,\r\n type VisualDocument,\r\n type TimedNodeSpec,\r\n type VariableSpec,\r\n} from \"./types\";\r\n\r\n/**\r\n * Deep equality over JSON values: key order is irrelevant, an `undefined`-valued\r\n * key equals an absent one (neither survives serialization), arrays are ordered.\r\n */\r\nexport function jsonEqual(a: unknown, b: unknown): boolean {\r\n if (a === b) return true;\r\n if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null) {\r\n return a !== a && b !== b;\r\n }\r\n if (Array.isArray(a)) {\r\n if (!Array.isArray(b) || a.length !== b.length) return false;\r\n for (let i = 0; i < a.length; i++) {\r\n if (!jsonEqual(a[i], b[i])) return false;\r\n }\r\n return true;\r\n }\r\n if (Array.isArray(b)) return false;\r\n const ao = a as Record<string, unknown>;\r\n const bo = b as Record<string, unknown>;\r\n let defined = 0;\r\n for (const key of Object.keys(ao)) {\r\n const value = ao[key];\r\n if (value === undefined) continue;\r\n defined++;\r\n if (!jsonEqual(value, bo[key])) return false;\r\n }\r\n for (const key of Object.keys(bo)) {\r\n if (bo[key] !== undefined) defined--;\r\n }\r\n return defined === 0;\r\n}\r\n\r\nexport interface RowChanges {\r\n added: Set<string>;\r\n removed: Set<string>;\r\n /** Present on both sides with any semantic field different. */\r\n changed: Set<string>;\r\n}\r\n\r\nexport interface ClipDiff {\r\n /** Nothing semantic differs — the two documents build the same clip. */\r\n identical: boolean;\r\n kindChanged: boolean;\r\n themeChanged: boolean;\r\n rootChanged: boolean;\r\n duration: boolean;\r\n nodes: RowChanges & {\r\n /** `type`, `key` or `props` differ. */\r\n respec: Set<string>;\r\n /** `parentId` differs. */\r\n moved: Set<string>;\r\n /** `startAt` or `endAt` differ, as spans. */\r\n span: Set<string>;\r\n /** Parents (`\"\"` for top level) whose kept children sit in a different sibling order. */\r\n reorderedParents: Set<string>;\r\n };\r\n commands: RowChanges & {\r\n /** `at` values whose kept commands appear in a different relative array order. */\r\n reorderedAts: Set<number>;\r\n };\r\n /** `changed` is `value` or `lerp`; a `name` is a label and never counts. */\r\n variables: RowChanges;\r\n /** Keys present on both sides that name a different node id. */\r\n remappedKeys: Set<string>;\r\n}\r\n\r\nfunction emptyDiff(): ClipDiff {\r\n return {\r\n identical: true,\r\n kindChanged: false,\r\n themeChanged: false,\r\n rootChanged: false,\r\n duration: false,\r\n nodes: {\r\n added: new Set(), removed: new Set(), changed: new Set(),\r\n respec: new Set(), moved: new Set(), span: new Set(), reorderedParents: new Set(),\r\n },\r\n commands: { added: new Set(), removed: new Set(), changed: new Set(), reorderedAts: new Set() },\r\n variables: { added: new Set(), removed: new Set(), changed: new Set() },\r\n remappedKeys: new Set(),\r\n };\r\n}\r\n\r\n/**\r\n * What differs between two versions of one clip, by row id.\r\n *\r\n * Only semantic fields are compared, so an edit that cannot change what the\r\n * clip builds (a variable's `name`, key order inside `props`, `startAt: 0`\r\n * against an absent one) is not a change. Audio documents are compared as the\r\n * compositions they lower to, which is what the timeline builds.\r\n */\r\nexport function diffClip(prev: ClipDocument, next: ClipDocument): ClipDiff {\r\n const diff = emptyDiff();\r\n if (prev === next) return diff;\r\n\r\n if (prev.kind !== next.kind) {\r\n diff.kindChanged = true;\r\n diff.identical = false;\r\n return diff;\r\n }\r\n\r\n const p = lowered(prev);\r\n const n = lowered(next);\r\n\r\n diff.themeChanged = !jsonEqual((prev as { theme?: unknown }).theme, (next as { theme?: unknown }).theme);\r\n diff.duration = documentDuration(p) !== documentDuration(n);\r\n\r\n if (prev.nodes !== next.nodes) diffNodes(p.nodes, n.nodes, diff);\r\n if (prev.variables !== next.variables) diffVariables(p.variables ?? [], n.variables ?? [], diff);\r\n const prevCommands = p.kind === \"composition\" ? p.commands : [];\r\n const nextCommands = n.kind === \"composition\" ? n.commands : [];\r\n if ((prev as { commands?: unknown }).commands !== (next as { commands?: unknown }).commands) {\r\n diffCommands(prevCommands, nextCommands, diff);\r\n }\r\n\r\n diff.identical = !diff.themeChanged && !diff.rootChanged && !diff.duration\r\n && diff.remappedKeys.size === 0\r\n && rowsEmpty(diff.nodes) && diff.nodes.reorderedParents.size === 0\r\n && rowsEmpty(diff.commands) && diff.commands.reorderedAts.size === 0\r\n && rowsEmpty(diff.variables);\r\n return diff;\r\n}\r\n\r\nfunction lowered(doc: ClipDocument): VisualDocument {\r\n return clipDocument(doc);\r\n}\r\n\r\nfunction rowsEmpty(rows: RowChanges): boolean {\r\n return rows.added.size === 0 && rows.removed.size === 0 && rows.changed.size === 0;\r\n}\r\n\r\nconst DEFAULT_ROOT: NodeSpec = { id: ROOT_NODE_ID, type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} };\r\n\r\nfunction diffNodes(prevRows: readonly TimedNodeSpec[], nextRows: readonly TimedNodeSpec[], diff: ClipDiff): void {\r\n const prev = byId(prevRows);\r\n const next = byId(nextRows);\r\n const changes = diff.nodes;\r\n\r\n const prevRoot = prev.get(ROOT_NODE_ID) ?? DEFAULT_ROOT;\r\n const nextRoot = next.get(ROOT_NODE_ID) ?? DEFAULT_ROOT;\r\n diff.rootChanged = prevRoot !== nextRoot && !sameNode(prevRoot, nextRoot);\r\n\r\n for (const [id, a] of prev) {\r\n if (id === ROOT_NODE_ID) continue;\r\n const b = next.get(id);\r\n if (!b) {\r\n changes.removed.add(id);\r\n continue;\r\n }\r\n if (a === b) continue;\r\n let changed = false;\r\n if (a.type !== b.type || a.key !== b.key || !jsonEqual(a.props, b.props)) {\r\n changes.respec.add(id);\r\n changed = true;\r\n }\r\n if (a.parentId !== b.parentId) {\r\n changes.moved.add(id);\r\n changed = true;\r\n }\r\n if (!sameSpan(a, b)) {\r\n changes.span.add(id);\r\n changed = true;\r\n }\r\n if (changed || a.layerOrder !== b.layerOrder) changes.changed.add(id);\r\n }\r\n for (const id of next.keys()) {\r\n if (id !== ROOT_NODE_ID && !prev.has(id)) changes.added.add(id);\r\n }\r\n\r\n const prevKeys = keyed(prevRows);\r\n for (const [key, id] of keyed(nextRows)) {\r\n const was = prevKeys.get(key);\r\n if (was !== undefined && was !== id) diff.remappedKeys.add(key);\r\n }\r\n\r\n const prevOrder = siblingOrder(prevRows);\r\n const nextOrder = siblingOrder(nextRows);\r\n for (const [parent, before] of prevOrder) {\r\n const after = nextOrder.get(parent);\r\n if (after && !sameRelativeOrder(before, after)) changes.reorderedParents.add(parent);\r\n }\r\n}\r\n\r\nfunction sameNode(a: NodeSpec, b: NodeSpec): boolean {\r\n return a.type === b.type\r\n && a.key === b.key\r\n && a.parentId === b.parentId\r\n && a.layerOrder === b.layerOrder\r\n && jsonEqual(a.props, b.props)\r\n && sameSpan(a, b);\r\n}\r\n\r\nfunction sameSpan(a: NodeSpec, b: NodeSpec): boolean {\r\n const sa = nodeSpan(a);\r\n const sb = nodeSpan(b);\r\n return sa.start === sb.start && sa.end === sb.end;\r\n}\r\n\r\nfunction diffCommands(prevRows: readonly CommandSpec[], nextRows: readonly CommandSpec[], diff: ClipDiff): void {\r\n const prev = byId(prevRows);\r\n const next = byId(nextRows);\r\n const changes = diff.commands;\r\n\r\n for (const [id, a] of prev) {\r\n const b = next.get(id);\r\n if (!b) {\r\n changes.removed.add(id);\r\n continue;\r\n }\r\n if (a === b) continue;\r\n if (\r\n a.type !== b.type\r\n || a.targetId !== b.targetId\r\n || a.at !== b.at\r\n || (a.duration ?? 0) !== (b.duration ?? 0)\r\n || !jsonEqual(a.easing, b.easing)\r\n || !jsonEqual(a.loop, b.loop)\r\n || !jsonEqual(a.args, b.args)\r\n ) {\r\n changes.changed.add(id);\r\n }\r\n }\r\n for (const id of next.keys()) {\r\n if (!prev.has(id)) changes.added.add(id);\r\n }\r\n\r\n const prevAts = groupByAt(prevRows);\r\n const nextAts = groupByAt(nextRows);\r\n for (const [at, before] of prevAts) {\r\n const after = nextAts.get(at);\r\n if (after && !sameRelativeOrder(before, after)) changes.reorderedAts.add(at);\r\n }\r\n}\r\n\r\nfunction diffVariables(prevRows: readonly VariableSpec[], nextRows: readonly VariableSpec[], diff: ClipDiff): void {\r\n const prev = byId(prevRows);\r\n const next = byId(nextRows);\r\n const changes = diff.variables;\r\n for (const [id, a] of prev) {\r\n const b = next.get(id);\r\n if (!b) {\r\n changes.removed.add(id);\r\n continue;\r\n }\r\n if (a !== b && (a.lerp !== b.lerp || !jsonEqual(a.value, b.value))) changes.changed.add(id);\r\n }\r\n for (const id of next.keys()) {\r\n if (!prev.has(id)) changes.added.add(id);\r\n }\r\n}\r\n\r\nfunction byId<T extends { id: string }>(rows: readonly T[]): Map<string, T> {\r\n const out = new Map<string, T>();\r\n for (const row of rows) out.set(row.id, row);\r\n return out;\r\n}\r\n\r\nfunction keyed(rows: readonly NodeSpec[]): Map<string, string> {\r\n const out = new Map<string, string>();\r\n for (const row of rows) if (row.key) out.set(row.key, row.id);\r\n return out;\r\n}\r\n\r\n/** Child ids per parent, in the order `syncPresence` inserts them: `layerOrder`, ties by array index. */\r\nfunction siblingOrder(rows: readonly NodeSpec[]): Map<string, string[]> {\r\n const groups = new Map<string, Array<{ id: string; order: number; index: number }>>();\r\n rows.forEach((row, index) => {\r\n if (row.id === ROOT_NODE_ID) return;\r\n const parent = row.parentId ?? ROOT_NODE_ID;\r\n let list = groups.get(parent);\r\n if (!list) groups.set(parent, list = []);\r\n list.push({ id: row.id, order: row.layerOrder, index });\r\n });\r\n const out = new Map<string, string[]>();\r\n for (const [parent, list] of groups) {\r\n list.sort((a, b) => (a.order - b.order) || (a.index - b.index));\r\n out.set(parent, list.map((e) => e.id));\r\n }\r\n return out;\r\n}\r\n\r\n/** Command ids per exact `at`, in array order — the tiebreak `inTimelineOrder` uses. */\r\nfunction groupByAt(rows: readonly CommandSpec[]): Map<number, string[]> {\r\n const out = new Map<number, string[]>();\r\n for (const row of rows) {\r\n let list = out.get(row.at);\r\n if (!list) out.set(row.at, list = []);\r\n list.push(row.id);\r\n }\r\n return out;\r\n}\r\n\r\n/** Whether the ids both lists hold appear in the same relative order in each. */\r\nfunction sameRelativeOrder(a: readonly string[], b: readonly string[]): boolean {\r\n const inB = new Set(b);\r\n const inA = new Set(a);\r\n const sharedA = a.filter((id) => inB.has(id));\r\n const sharedB = b.filter((id) => inA.has(id));\r\n if (sharedA.length !== sharedB.length) return false;\r\n for (let i = 0; i < sharedA.length; i++) {\r\n if (sharedA[i] !== sharedB[i]) return false;\r\n }\r\n return true;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"doc-index.d.ts","sourceRoot":"","sources":["../../src/document/doc-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAKH,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACpB,MAAM,SAAS,CAAC;AAEjB,mFAAmF;AACnF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE5D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAE1E,0FAA0F;AAC1F,MAAM,WAAW,cAAc;IAC3B,yFAAyF;IACzF,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,+DAA+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,cAAc,EAAE,OAAO,CAA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C;IAC1C,wFAAwF;IACxF,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC1C,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IACpC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,CAAC;IAC/C,wFAAwF;IACxF,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CAAC;IACjC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC;IACnC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC;IACnC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,QAAQ,CAEzD"}
@@ -1,8 +1,8 @@
1
- import { loweredAudioDocument } from "./audio.js";
1
+ import { clipDocument } from "./audio.js";
2
2
  import { expressionRefs } from "./expression/refs.js";
3
- import { documentDuration, isAudioDocument, nodeSpan, ROOT_NODE_ID, } from "./types.js";
3
+ import { documentDuration, nodeSpan, ROOT_NODE_ID, } from "./types.js";
4
4
  export function indexDocument(doc) {
5
- return new DocumentIndex(isAudioDocument(doc) ? loweredAudioDocument(doc) : doc);
5
+ return new DocumentIndex(clipDocument(doc));
6
6
  }
7
7
  const NO_REFS = Object.freeze({ vars: [], keys: [], unparsable: 0 });
8
8
  const NO_BINDINGS = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"doc-index.js","sourceRoot":"","sources":["../../src/document/doc-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAuB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EACH,gBA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AE,EAAE,CAAC,CAAU,CAAC,CAAC,CAAC;YACpG,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QACvH,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { loweredAudioDocument } from \"./audio\";\r\nimport { expressionRefs, type ExpressionRefs } from \"./expression/refs\";\r\nimport {\r\n documentDuration,\r\n isAudioDocument,\r\n nodeSpan,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type CommandSpec,\r\n type NodeSpan,\r\n type VisualDocument,\r\n type TimedNodeSpec,\r\n type VariableSpec,\r\n} from \"./types\";\r\n\r\n/** Whether a node is in the tree at t=0, and if so whether it is mounted there. */\r\nexport type InitialKey = \"mounted\" | \"unmounted\" | \"absent\";\r\n\r\n/**\r\n * When compile baselines a node that is not present at t=0: at the first command\r\n * `at` inside its own span, mounted or not at that moment.\r\n */\r\nexport type CaptureKey = \"none\" | \"arrival-mounted\" | \"arrival-unmounted\";\r\n\r\n/** Structural faults an incremental update cannot reason about; any one means rebuild. */\r\nexport interface DocIndexIssues {\r\n /** A node, command or variable id claimed twice, or a node id a variable also claims. */\r\n duplicateIds: boolean;\r\n duplicateKeys: boolean;\r\n unresolvedParent: boolean;\r\n cycle: boolean;\r\n /** A row with id `\"\"` that is not an unparented `canvas2d`. */\r\n invalidRoot: boolean;\r\n unparsable: boolean;\r\n /** An expression naming a variable or node key the document does not declare. */\r\n unresolvedRefs: boolean;\r\n}\r\n\r\nexport interface DocIndex {\r\n /** Audio documents are indexed as the composition they lower to. */\r\n readonly doc: VisualDocument;\r\n /** Every node by id, the root under `\"\"` (synthesized when the document omits it). */\r\n readonly nodes: ReadonlyMap<string, TimedNodeSpec>;\r\n /** Nodes other than the root. */\r\n readonly nodeCount: number;\r\n readonly variables: ReadonlyMap<string, VariableSpec>;\r\n readonly commands: ReadonlyMap<string, CommandSpec>;\r\n /** Commands in timeline order: `at`, ties by array index. */\r\n readonly ordered: readonly CommandSpec[];\r\n /** Command ids per target in timeline order; the root's under `\"\"`. */\r\n readonly byTarget: ReadonlyMap<string, readonly string[]>;\r\n readonly keyed: ReadonlyMap<string, string>;\r\n /** Nodes whose props (or `set` args) read a variable, or a keyed node's prop. */\r\n readonly dependents: {\r\n byVar: ReadonlyMap<string, ReadonlySet<string>>;\r\n byKey: ReadonlyMap<string, ReadonlySet<string>>;\r\n };\r\n readonly duration: number;\r\n readonly issues: DocIndexIssues;\r\n\r\n /** Child ids in sibling order: `layerOrder`, ties by array index. */\r\n children(parentId: string): readonly string[];\r\n /** Every document descendant of `id`, not including it. */\r\n descendants(id: string): string[];\r\n ownSpan(id: string): NodeSpan | undefined;\r\n /** Own span intersected with every ancestor's — when the node is mounted. Half-open. */\r\n effSpan(id: string): NodeSpan | undefined;\r\n /** The id a command acts on: its `targetId`, or `\"\"` for the root. */\r\n targetOf(spec: CommandSpec): string;\r\n commandsAt(at: number): readonly CommandSpec[];\r\n /** References per top-level prop, from the row's props and every `set` targeting it. */\r\n bindings(id: string): ReadonlyMap<string, ExpressionRefs>;\r\n refs(id: string): ExpressionRefs;\r\n initialKey(id: string): InitialKey;\r\n captureKey(id: string): CaptureKey;\r\n captureTime(id: string): number | undefined;\r\n}\r\n\r\nexport function indexDocument(doc: ClipDocument): DocIndex {\r\n return new DocumentIndex(isAudioDocument(doc) ? loweredAudioDocument(doc) : doc);\r\n}\r\n\r\nconst NO_REFS: ExpressionRefs = Object.freeze({ vars: [], keys: [], unparsable: 0 }) as ExpressionRefs;\r\nconst NO_BINDINGS: ReadonlyMap<string, ExpressionRefs> = new Map();\r\nconst EMPTY: readonly never[] = [];\r\n\r\nfunction contains(span: NodeSpan | undefined, t: number): boolean {\r\n return span !== undefined && t >= span.start && t < span.end;\r\n}\r\n\r\nclass DocumentIndex implements DocIndex {\r\n readonly nodes = new Map<string, TimedNodeSpec>();\r\n readonly nodeCount: number;\r\n readonly variables = new Map<string, VariableSpec>();\r\n readonly commands = new Map<string, CommandSpec>();\r\n readonly ordered: readonly CommandSpec[];\r\n readonly byTarget = new Map<string, string[]>();\r\n readonly keyed = new Map<string, string>();\r\n readonly dependents = { byVar: new Map<string, Set<string>>(), byKey: new Map<string, Set<string>>() };\r\n readonly duration: number;\r\n readonly issues: DocIndexIssues = {\r\n duplicateIds: false,\r\n duplicateKeys: false,\r\n unresolvedParent: false,\r\n cycle: false,\r\n invalidRoot: false,\r\n unparsable: false,\r\n unresolvedRefs: false,\r\n };\r\n\r\n constructor(readonly doc: VisualDocument) {\r\n this.duration = documentDuration(doc);\r\n const commandRows = doc.kind === \"composition\" ? doc.commands : [];\r\n\r\n this._indexNodes(doc.nodes);\r\n this.nodeCount = this.nodes.size - 1;\r\n for (const spec of doc.variables ?? []) {\r\n if (this.variables.has(spec.id) || this.nodes.has(spec.id)) this.issues.duplicateIds = true;\r\n this.variables.set(spec.id, spec);\r\n }\r\n\r\n this.ordered = commandRows\r\n .map((spec, index) => ({ spec, index }))\r\n .sort((a, b) => (a.spec.at - b.spec.at) || (a.index - b.index))\r\n .map((e) => e.spec);\r\n for (const spec of this.ordered) {\r\n if (this.commands.has(spec.id)) this.issues.duplicateIds = true;\r\n this.commands.set(spec.id, spec);\r\n const target = this.targetOf(spec);\r\n let list = this.byTarget.get(target);\r\n if (!list) this.byTarget.set(target, list = []);\r\n list.push(spec.id);\r\n let atList = this._byAt.get(spec.at);\r\n if (!atList) this._byAt.set(spec.at, atList = []);\r\n atList.push(spec);\r\n }\r\n this._ats = [...this._byAt.keys()];\r\n\r\n this._indexRefs(commandRows);\r\n }\r\n\r\n children(parentId: string): readonly string[] {\r\n return this._children.get(parentId) ?? EMPTY;\r\n }\r\n\r\n descendants(id: string): string[] {\r\n const out: string[] = [];\r\n const seen = new Set<string>([id]);\r\n const stack = [...this.children(id)].reverse();\r\n while (stack.length > 0) {\r\n const child = stack.pop()!;\r\n if (seen.has(child)) continue;\r\n seen.add(child);\r\n out.push(child);\r\n const grand = this.children(child);\r\n for (let i = grand.length - 1; i >= 0; i--) stack.push(grand[i]);\r\n }\r\n return out;\r\n }\r\n\r\n ownSpan(id: string): NodeSpan | undefined {\r\n const spec = this.nodes.get(id);\r\n return spec ? nodeSpan(spec) : undefined;\r\n }\r\n\r\n effSpan(id: string): NodeSpan | undefined {\r\n const memo = this._eff.get(id);\r\n if (memo) return memo;\r\n if (!this.nodes.has(id)) return undefined;\r\n\r\n const chain: TimedNodeSpec[] = [];\r\n const seen = new Set<string>();\r\n let base: NodeSpan = { start: 0, end: Infinity };\r\n let cursor = this.nodes.get(id);\r\n while (cursor) {\r\n const known = this._eff.get(cursor.id);\r\n if (known) {\r\n base = known;\r\n break;\r\n }\r\n if (seen.has(cursor.id)) break;\r\n seen.add(cursor.id);\r\n chain.push(cursor);\r\n if (cursor.id === ROOT_NODE_ID || cursor.parentId === null) break;\r\n cursor = this.nodes.get(cursor.parentId);\r\n }\r\n for (let i = chain.length - 1; i >= 0; i--) {\r\n const own = nodeSpan(chain[i]);\r\n base = { start: Math.max(base.start, own.start), end: Math.min(base.end, own.end) };\r\n this._eff.set(chain[i].id, base);\r\n }\r\n return this._eff.get(id);\r\n }\r\n\r\n targetOf(spec: CommandSpec): string {\r\n return spec.targetId ?? ROOT_NODE_ID;\r\n }\r\n\r\n commandsAt(at: number): readonly CommandSpec[] {\r\n return this._byAt.get(at) ?? EMPTY;\r\n }\r\n\r\n bindings(id: string): ReadonlyMap<string, ExpressionRefs> {\r\n return this._bindings.get(id) ?? NO_BINDINGS;\r\n }\r\n\r\n refs(id: string): ExpressionRefs {\r\n return this._refs.get(id) ?? NO_REFS;\r\n }\r\n\r\n initialKey(id: string): InitialKey {\r\n if (!contains(this.ownSpan(id), 0)) return \"absent\";\r\n return contains(this.effSpan(id), 0) ? \"mounted\" : \"unmounted\";\r\n }\r\n\r\n captureKey(id: string): CaptureKey {\r\n const at = this.captureTime(id);\r\n if (at === undefined) return \"none\";\r\n return contains(this.effSpan(id), at) ? \"arrival-mounted\" : \"arrival-unmounted\";\r\n }\r\n\r\n captureTime(id: string): number | undefined {\r\n const own = this.ownSpan(id);\r\n if (!own || contains(own, 0)) return undefined;\r\n let lo = 0;\r\n let hi = this._ats.length;\r\n while (lo < hi) {\r\n const mid = (lo + hi) >> 1;\r\n if (this._ats[mid] < own.start) lo = mid + 1;\r\n else hi = mid;\r\n }\r\n const at = this._ats[lo];\r\n return at !== undefined && at < own.end ? at : undefined;\r\n }\r\n\r\n private readonly _children = new Map<string, string[]>();\r\n private readonly _eff = new Map<string, NodeSpan>();\r\n private readonly _byAt = new Map<number, CommandSpec[]>();\r\n /** Distinct command `at`s, ascending (inherited from {@link ordered}). */\r\n private _ats: number[] = [];\r\n private readonly _bindings = new Map<string, Map<string, ExpressionRefs>>();\r\n private readonly _refs = new Map<string, ExpressionRefs>();\r\n\r\n private _indexNodes(rows: readonly TimedNodeSpec[]): void {\r\n const siblings = new Map<string, Array<{ id: string; order: number; index: number }>>();\r\n rows.forEach((spec, index) => {\r\n if (this.nodes.has(spec.id)) this.issues.duplicateIds = true;\r\n this.nodes.set(spec.id, spec);\r\n if (spec.key) {\r\n if (this.keyed.has(spec.key)) this.issues.duplicateKeys = true;\r\n this.keyed.set(spec.key, spec.id);\r\n }\r\n if (spec.id === ROOT_NODE_ID) {\r\n if (spec.type !== \"canvas2d\" || spec.parentId !== null) this.issues.invalidRoot = true;\r\n return;\r\n }\r\n const parent = spec.parentId ?? ROOT_NODE_ID;\r\n let list = siblings.get(parent);\r\n if (!list) siblings.set(parent, list = []);\r\n list.push({ id: spec.id, order: spec.layerOrder, index });\r\n });\r\n if (!this.nodes.has(ROOT_NODE_ID)) {\r\n this.nodes.set(ROOT_NODE_ID, { id: ROOT_NODE_ID, type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} });\r\n }\r\n for (const [parent, list] of siblings) {\r\n list.sort((a, b) => (a.order - b.order) || (a.index - b.index));\r\n this._children.set(parent, list.map((e) => e.id));\r\n }\r\n\r\n const settled = new Set<string>([ROOT_NODE_ID]);\r\n for (const spec of this.nodes.values()) {\r\n if (spec.parentId !== null && !this.nodes.has(spec.parentId)) this.issues.unresolvedParent = true;\r\n const seen = new Set<string>();\r\n let cursor: TimedNodeSpec | undefined = spec;\r\n while (cursor && !settled.has(cursor.id)) {\r\n if (seen.has(cursor.id)) {\r\n this.issues.cycle = true;\r\n break;\r\n }\r\n seen.add(cursor.id);\r\n cursor = cursor.parentId === null ? undefined : this.nodes.get(cursor.parentId);\r\n }\r\n for (const id of seen) settled.add(id);\r\n }\r\n }\r\n\r\n private _indexRefs(commandRows: readonly CommandSpec[]): void {\r\n for (const spec of this.nodes.values()) this._bind(spec.id, spec.props);\r\n for (const command of commandRows) {\r\n if (command.type === \"set\") {\r\n const target = this.targetOf(command);\r\n if (this.nodes.has(target)) {\r\n this._bind(target, command.args);\r\n continue;\r\n }\r\n }\r\n if (expressionRefs(command.args).unparsable > 0) this.issues.unparsable = true;\r\n }\r\n\r\n for (const [id, props] of this._bindings) {\r\n const vars = new Set<string>();\r\n const keys = new Map<string, [string, string]>();\r\n let unparsable = 0;\r\n for (const refs of props.values()) {\r\n for (const v of refs.vars) vars.add(v);\r\n for (const pair of refs.keys) keys.set(`${pair[0]}.${pair[1]}`, pair);\r\n unparsable += refs.unparsable;\r\n }\r\n this._refs.set(id, { vars: [...vars], keys: [...keys.values()], unparsable });\r\n\r\n for (const v of vars) {\r\n if (!this.variables.has(v)) this.issues.unresolvedRefs = true;\r\n let readers = this.dependents.byVar.get(v);\r\n if (!readers) this.dependents.byVar.set(v, readers = new Set());\r\n readers.add(id);\r\n }\r\n for (const [key] of keys.values()) {\r\n if (!this.keyed.has(key)) this.issues.unresolvedRefs = true;\r\n let readers = this.dependents.byKey.get(key);\r\n if (!readers) this.dependents.byKey.set(key, readers = new Set());\r\n readers.add(id);\r\n }\r\n }\r\n }\r\n\r\n /** Merge one props bag's references into a node's per-prop table. */\r\n private _bind(id: string, props: Record<string, unknown> | undefined): void {\r\n if (!props) return;\r\n for (const prop of Object.keys(props)) {\r\n const found = expressionRefs(props[prop]);\r\n if (found.unparsable > 0) this.issues.unparsable = true;\r\n if (found.vars.length === 0 && found.keys.length === 0) continue;\r\n let table = this._bindings.get(id);\r\n if (!table) this._bindings.set(id, table = new Map());\r\n const existing = table.get(prop);\r\n if (!existing) {\r\n table.set(prop, found);\r\n continue;\r\n }\r\n const vars = new Set([...existing.vars, ...found.vars]);\r\n const keys = new Map([...existing.keys, ...found.keys].map((p) => [`${p[0]}.${p[1]}`, p] as const));\r\n table.set(prop, { vars: [...vars], keys: [...keys.values()], unparsable: existing.unparsable + found.unparsable });\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"doc-index.js","sourceRoot":"","sources":["../../src/document/doc-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAuB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EACH,gBAAgB,EAChB,QAAQ,EACR,YAAY,GAOf,MAAM,SAAS,CAAC;AAiEjB,MAAM,UAAU,aAAa,CAAC,GAAiB;IAC3C,OAAO,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,OAAO,GAAmB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAmB,CAAC;AACvG,MAAM,WAAW,GAAwC,IAAI,GAAG,EAAE,CAAC;AACnE,MAAM,KAAK,GAAqB,EAAE,CAAC;AAEnC,SAAS,QAAQ,CAAC,IAA0B,EAAE,CAAS;IACnD,OAAO,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,IAAI,CAAC,K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,CAAC,KAAK;gBAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;YACtD,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACZ,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACvB,SAAS;YACb,CAAC;YACD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YACxD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAU,CAAC,CAAC,CAAC;YACpG,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QACvH,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { clipDocument } from \"./audio\";\r\nimport { expressionRefs, type ExpressionRefs } from \"./expression/refs\";\r\nimport {\r\n documentDuration,\r\n nodeSpan,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type CommandSpec,\r\n type NodeSpan,\r\n type VisualDocument,\r\n type TimedNodeSpec,\r\n type VariableSpec,\r\n} from \"./types\";\r\n\r\n/** Whether a node is in the tree at t=0, and if so whether it is mounted there. */\r\nexport type InitialKey = \"mounted\" | \"unmounted\" | \"absent\";\r\n\r\n/**\r\n * When compile baselines a node that is not present at t=0: at the first command\r\n * `at` inside its own span, mounted or not at that moment.\r\n */\r\nexport type CaptureKey = \"none\" | \"arrival-mounted\" | \"arrival-unmounted\";\r\n\r\n/** Structural faults an incremental update cannot reason about; any one means rebuild. */\r\nexport interface DocIndexIssues {\r\n /** A node, command or variable id claimed twice, or a node id a variable also claims. */\r\n duplicateIds: boolean;\r\n duplicateKeys: boolean;\r\n unresolvedParent: boolean;\r\n cycle: boolean;\r\n /** A row with id `\"\"` that is not an unparented `canvas2d`. */\r\n invalidRoot: boolean;\r\n unparsable: boolean;\r\n /** An expression naming a variable or node key the document does not declare. */\r\n unresolvedRefs: boolean;\r\n}\r\n\r\nexport interface DocIndex {\r\n /** Audio documents are indexed as the composition they lower to. */\r\n readonly doc: VisualDocument;\r\n /** Every node by id, the root under `\"\"` (synthesized when the document omits it). */\r\n readonly nodes: ReadonlyMap<string, TimedNodeSpec>;\r\n /** Nodes other than the root. */\r\n readonly nodeCount: number;\r\n readonly variables: ReadonlyMap<string, VariableSpec>;\r\n readonly commands: ReadonlyMap<string, CommandSpec>;\r\n /** Commands in timeline order: `at`, ties by array index. */\r\n readonly ordered: readonly CommandSpec[];\r\n /** Command ids per target in timeline order; the root's under `\"\"`. */\r\n readonly byTarget: ReadonlyMap<string, readonly string[]>;\r\n readonly keyed: ReadonlyMap<string, string>;\r\n /** Nodes whose props (or `set` args) read a variable, or a keyed node's prop. */\r\n readonly dependents: {\r\n byVar: ReadonlyMap<string, ReadonlySet<string>>;\r\n byKey: ReadonlyMap<string, ReadonlySet<string>>;\r\n };\r\n readonly duration: number;\r\n readonly issues: DocIndexIssues;\r\n\r\n /** Child ids in sibling order: `layerOrder`, ties by array index. */\r\n children(parentId: string): readonly string[];\r\n /** Every document descendant of `id`, not including it. */\r\n descendants(id: string): string[];\r\n ownSpan(id: string): NodeSpan | undefined;\r\n /** Own span intersected with every ancestor's — when the node is mounted. Half-open. */\r\n effSpan(id: string): NodeSpan | undefined;\r\n /** The id a command acts on: its `targetId`, or `\"\"` for the root. */\r\n targetOf(spec: CommandSpec): string;\r\n commandsAt(at: number): readonly CommandSpec[];\r\n /** References per top-level prop, from the row's props and every `set` targeting it. */\r\n bindings(id: string): ReadonlyMap<string, ExpressionRefs>;\r\n refs(id: string): ExpressionRefs;\r\n initialKey(id: string): InitialKey;\r\n captureKey(id: string): CaptureKey;\r\n captureTime(id: string): number | undefined;\r\n}\r\n\r\nexport function indexDocument(doc: ClipDocument): DocIndex {\r\n return new DocumentIndex(clipDocument(doc));\r\n}\r\n\r\nconst NO_REFS: ExpressionRefs = Object.freeze({ vars: [], keys: [], unparsable: 0 }) as ExpressionRefs;\r\nconst NO_BINDINGS: ReadonlyMap<string, ExpressionRefs> = new Map();\r\nconst EMPTY: readonly never[] = [];\r\n\r\nfunction contains(span: NodeSpan | undefined, t: number): boolean {\r\n return span !== undefined && t >= span.start && t < span.end;\r\n}\r\n\r\nclass DocumentIndex implements DocIndex {\r\n readonly nodes = new Map<string, TimedNodeSpec>();\r\n readonly nodeCount: number;\r\n readonly variables = new Map<string, VariableSpec>();\r\n readonly commands = new Map<string, CommandSpec>();\r\n readonly ordered: readonly CommandSpec[];\r\n readonly byTarget = new Map<string, string[]>();\r\n readonly keyed = new Map<string, string>();\r\n readonly dependents = { byVar: new Map<string, Set<string>>(), byKey: new Map<string, Set<string>>() };\r\n readonly duration: number;\r\n readonly issues: DocIndexIssues = {\r\n duplicateIds: false,\r\n duplicateKeys: false,\r\n unresolvedParent: false,\r\n cycle: false,\r\n invalidRoot: false,\r\n unparsable: false,\r\n unresolvedRefs: false,\r\n };\r\n\r\n constructor(readonly doc: VisualDocument) {\r\n this.duration = documentDuration(doc);\r\n const commandRows = doc.kind === \"composition\" ? doc.commands : [];\r\n\r\n this._indexNodes(doc.nodes);\r\n this.nodeCount = this.nodes.size - 1;\r\n for (const spec of doc.variables ?? []) {\r\n if (this.variables.has(spec.id) || this.nodes.has(spec.id)) this.issues.duplicateIds = true;\r\n this.variables.set(spec.id, spec);\r\n }\r\n\r\n this.ordered = commandRows\r\n .map((spec, index) => ({ spec, index }))\r\n .sort((a, b) => (a.spec.at - b.spec.at) || (a.index - b.index))\r\n .map((e) => e.spec);\r\n for (const spec of this.ordered) {\r\n if (this.commands.has(spec.id)) this.issues.duplicateIds = true;\r\n this.commands.set(spec.id, spec);\r\n const target = this.targetOf(spec);\r\n let list = this.byTarget.get(target);\r\n if (!list) this.byTarget.set(target, list = []);\r\n list.push(spec.id);\r\n let atList = this._byAt.get(spec.at);\r\n if (!atList) this._byAt.set(spec.at, atList = []);\r\n atList.push(spec);\r\n }\r\n this._ats = [...this._byAt.keys()];\r\n\r\n this._indexRefs(commandRows);\r\n }\r\n\r\n children(parentId: string): readonly string[] {\r\n return this._children.get(parentId) ?? EMPTY;\r\n }\r\n\r\n descendants(id: string): string[] {\r\n const out: string[] = [];\r\n const seen = new Set<string>([id]);\r\n const stack = [...this.children(id)].reverse();\r\n while (stack.length > 0) {\r\n const child = stack.pop()!;\r\n if (seen.has(child)) continue;\r\n seen.add(child);\r\n out.push(child);\r\n const grand = this.children(child);\r\n for (let i = grand.length - 1; i >= 0; i--) stack.push(grand[i]);\r\n }\r\n return out;\r\n }\r\n\r\n ownSpan(id: string): NodeSpan | undefined {\r\n const spec = this.nodes.get(id);\r\n return spec ? nodeSpan(spec) : undefined;\r\n }\r\n\r\n effSpan(id: string): NodeSpan | undefined {\r\n const memo = this._eff.get(id);\r\n if (memo) return memo;\r\n if (!this.nodes.has(id)) return undefined;\r\n\r\n const chain: TimedNodeSpec[] = [];\r\n const seen = new Set<string>();\r\n let base: NodeSpan = { start: 0, end: Infinity };\r\n let cursor = this.nodes.get(id);\r\n while (cursor) {\r\n const known = this._eff.get(cursor.id);\r\n if (known) {\r\n base = known;\r\n break;\r\n }\r\n if (seen.has(cursor.id)) break;\r\n seen.add(cursor.id);\r\n chain.push(cursor);\r\n if (cursor.id === ROOT_NODE_ID || cursor.parentId === null) break;\r\n cursor = this.nodes.get(cursor.parentId);\r\n }\r\n for (let i = chain.length - 1; i >= 0; i--) {\r\n const own = nodeSpan(chain[i]);\r\n base = { start: Math.max(base.start, own.start), end: Math.min(base.end, own.end) };\r\n this._eff.set(chain[i].id, base);\r\n }\r\n return this._eff.get(id);\r\n }\r\n\r\n targetOf(spec: CommandSpec): string {\r\n return spec.targetId ?? ROOT_NODE_ID;\r\n }\r\n\r\n commandsAt(at: number): readonly CommandSpec[] {\r\n return this._byAt.get(at) ?? EMPTY;\r\n }\r\n\r\n bindings(id: string): ReadonlyMap<string, ExpressionRefs> {\r\n return this._bindings.get(id) ?? NO_BINDINGS;\r\n }\r\n\r\n refs(id: string): ExpressionRefs {\r\n return this._refs.get(id) ?? NO_REFS;\r\n }\r\n\r\n initialKey(id: string): InitialKey {\r\n if (!contains(this.ownSpan(id), 0)) return \"absent\";\r\n return contains(this.effSpan(id), 0) ? \"mounted\" : \"unmounted\";\r\n }\r\n\r\n captureKey(id: string): CaptureKey {\r\n const at = this.captureTime(id);\r\n if (at === undefined) return \"none\";\r\n return contains(this.effSpan(id), at) ? \"arrival-mounted\" : \"arrival-unmounted\";\r\n }\r\n\r\n captureTime(id: string): number | undefined {\r\n const own = this.ownSpan(id);\r\n if (!own || contains(own, 0)) return undefined;\r\n let lo = 0;\r\n let hi = this._ats.length;\r\n while (lo < hi) {\r\n const mid = (lo + hi) >> 1;\r\n if (this._ats[mid] < own.start) lo = mid + 1;\r\n else hi = mid;\r\n }\r\n const at = this._ats[lo];\r\n return at !== undefined && at < own.end ? at : undefined;\r\n }\r\n\r\n private readonly _children = new Map<string, string[]>();\r\n private readonly _eff = new Map<string, NodeSpan>();\r\n private readonly _byAt = new Map<number, CommandSpec[]>();\r\n /** Distinct command `at`s, ascending (inherited from {@link ordered}). */\r\n private _ats: number[] = [];\r\n private readonly _bindings = new Map<string, Map<string, ExpressionRefs>>();\r\n private readonly _refs = new Map<string, ExpressionRefs>();\r\n\r\n private _indexNodes(rows: readonly TimedNodeSpec[]): void {\r\n const siblings = new Map<string, Array<{ id: string; order: number; index: number }>>();\r\n rows.forEach((spec, index) => {\r\n if (this.nodes.has(spec.id)) this.issues.duplicateIds = true;\r\n this.nodes.set(spec.id, spec);\r\n if (spec.key) {\r\n if (this.keyed.has(spec.key)) this.issues.duplicateKeys = true;\r\n this.keyed.set(spec.key, spec.id);\r\n }\r\n if (spec.id === ROOT_NODE_ID) {\r\n if (spec.type !== \"canvas2d\" || spec.parentId !== null) this.issues.invalidRoot = true;\r\n return;\r\n }\r\n const parent = spec.parentId ?? ROOT_NODE_ID;\r\n let list = siblings.get(parent);\r\n if (!list) siblings.set(parent, list = []);\r\n list.push({ id: spec.id, order: spec.layerOrder, index });\r\n });\r\n if (!this.nodes.has(ROOT_NODE_ID)) {\r\n this.nodes.set(ROOT_NODE_ID, { id: ROOT_NODE_ID, type: \"canvas2d\", parentId: null, layerOrder: 0, props: {} });\r\n }\r\n for (const [parent, list] of siblings) {\r\n list.sort((a, b) => (a.order - b.order) || (a.index - b.index));\r\n this._children.set(parent, list.map((e) => e.id));\r\n }\r\n\r\n const settled = new Set<string>([ROOT_NODE_ID]);\r\n for (const spec of this.nodes.values()) {\r\n if (spec.parentId !== null && !this.nodes.has(spec.parentId)) this.issues.unresolvedParent = true;\r\n const seen = new Set<string>();\r\n let cursor: TimedNodeSpec | undefined = spec;\r\n while (cursor && !settled.has(cursor.id)) {\r\n if (seen.has(cursor.id)) {\r\n this.issues.cycle = true;\r\n break;\r\n }\r\n seen.add(cursor.id);\r\n cursor = cursor.parentId === null ? undefined : this.nodes.get(cursor.parentId);\r\n }\r\n for (const id of seen) settled.add(id);\r\n }\r\n }\r\n\r\n private _indexRefs(commandRows: readonly CommandSpec[]): void {\r\n for (const spec of this.nodes.values()) this._bind(spec.id, spec.props);\r\n for (const command of commandRows) {\r\n if (command.type === \"set\") {\r\n const target = this.targetOf(command);\r\n if (this.nodes.has(target)) {\r\n this._bind(target, command.args);\r\n continue;\r\n }\r\n }\r\n if (expressionRefs(command.args).unparsable > 0) this.issues.unparsable = true;\r\n }\r\n\r\n for (const [id, props] of this._bindings) {\r\n const vars = new Set<string>();\r\n const keys = new Map<string, [string, string]>();\r\n let unparsable = 0;\r\n for (const refs of props.values()) {\r\n for (const v of refs.vars) vars.add(v);\r\n for (const pair of refs.keys) keys.set(`${pair[0]}.${pair[1]}`, pair);\r\n unparsable += refs.unparsable;\r\n }\r\n this._refs.set(id, { vars: [...vars], keys: [...keys.values()], unparsable });\r\n\r\n for (const v of vars) {\r\n if (!this.variables.has(v)) this.issues.unresolvedRefs = true;\r\n let readers = this.dependents.byVar.get(v);\r\n if (!readers) this.dependents.byVar.set(v, readers = new Set());\r\n readers.add(id);\r\n }\r\n for (const [key] of keys.values()) {\r\n if (!this.keyed.has(key)) this.issues.unresolvedRefs = true;\r\n let readers = this.dependents.byKey.get(key);\r\n if (!readers) this.dependents.byKey.set(key, readers = new Set());\r\n readers.add(id);\r\n }\r\n }\r\n }\r\n\r\n /** Merge one props bag's references into a node's per-prop table. */\r\n private _bind(id: string, props: Record<string, unknown> | undefined): void {\r\n if (!props) return;\r\n for (const prop of Object.keys(props)) {\r\n const found = expressionRefs(props[prop]);\r\n if (found.unparsable > 0) this.issues.unparsable = true;\r\n if (found.vars.length === 0 && found.keys.length === 0) continue;\r\n let table = this._bindings.get(id);\r\n if (!table) this._bindings.set(id, table = new Map());\r\n const existing = table.get(prop);\r\n if (!existing) {\r\n table.set(prop, found);\r\n continue;\r\n }\r\n const vars = new Set([...existing.vars, ...found.vars]);\r\n const keys = new Map([...existing.keys, ...found.keys].map((p) => [`${p[0]}.${p[1]}`, p] as const));\r\n table.set(prop, { vars: [...vars], keys: [...keys.values()], unparsable: existing.unparsable + found.unparsable });\r\n }\r\n }\r\n}\r\n"]}
@@ -2,7 +2,7 @@
2
2
  * **Expressions**: a prop that follows a variable instead of holding a value.
3
3
  *
4
4
  * A document is data, so it cannot carry a function — which is exactly what a
5
- * derived prop is (`packages/core/src/props/`: a `@property`'s slot either holds
5
+ * derived prop is (`packages/core/src/props/`: a `property`'s slot either holds
6
6
  * a value or is *bound* to a thunk). An expression is that function written as
7
7
  * a string a document can store:
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * **Expressions**: a prop that follows a variable instead of holding a value.
3
3
  *
4
4
  * A document is data, so it cannot carry a function — which is exactly what a
5
- * derived prop is (`packages/core/src/props/`: a `@property`'s slot either holds
5
+ * derived prop is (`packages/core/src/props/`: a `property`'s slot either holds
6
6
  * a value or is *bound* to a thunk). An expression is that function written as
7
7
  * a string a document can store:
8
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/document/expression/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["/**\r\n * **Expressions**: a prop that follows a variable instead of holding a value.\r\n *\r\n * A document is data, so it cannot carry a function — which is exactly what a\r\n * derived prop is (`packages/core/src/props/`: a `@property`'s slot either holds\r\n * a value or is *bound* to a thunk). An expression is that function written as\r\n * a string a document can store:\r\n *\r\n * ```json\r\n * { \"id\": \"card\", \"type\": \"rect\", \"props\": { \"x\": \"=4[g]+3\", \"opacity\": \"=[g]\" } }\r\n * ```\r\n *\r\n * A leading `=` marks the string as a formula rather than a value, and `[name]`\r\n * reads the `VariableSpec` with that id. What it compiles to is an ordinary\r\n * prop binding, so nothing underneath it changes: a command writes the\r\n * variable's slot, and a bound prop recomputes on every read, so each of them\r\n * sees the new value without anything being invalidated. That is what makes one\r\n * variable able to drive twenty nodes without twenty copies of the same tween.\r\n *\r\n * Three rules the syntax turns on, each of which removes a question a reader\r\n * would otherwise have to ask:\r\n *\r\n * - **`=` marks the whole string, not part of it.** There is no `${…}` hole in\r\n * surrounding text. A prop is either a value or a formula, so nothing has to\r\n * define what a half-interpolated `cornerRadius` means. A literal string that\r\n * really does start with `=` is written `\"==\"`.\r\n * - **A lone `[x]` passes the value through, unconverted.** `\"=[c]\"` on a `fill`\r\n * yields whatever `c` holds — a colour string, a `Vector2`, an object — while\r\n * anything with arithmetic in it is numeric. Without that rule a variable\r\n * could only ever be a number, and driving four nodes' `fill` from one place\r\n * is half the reason variables exist.\r\n * - **Angles are degrees**, matching every angle in the library (`rotation`,\r\n * `startAngle`, 3D Euler rotations). `sin(30)` is `0.5`.\r\n *\r\n * Expressions **bind**; they are not tween destinations. See\r\n * `document/timeline.ts` for where that is enforced and why.\r\n *\r\n * One value — {@link expressionOps} — carries every operation: recognition,\r\n * parsing, compiling, the authored-value walk, and the name lists a host's\r\n * completion needs. The free functions this used to export\r\n * (`isExpressionSource`, `unescapeExpression`, `parseExpression`,\r\n * `tryParseExpression`, `compileExpression`, `compileValue`, `compileProps`,\r\n * `collectExpressions`, `expressionFunctionNames`, `expressionConstantNames`)\r\n * are those methods now.\r\n */\r\nexport { expressionOps } from \"./ops\";\r\nexport { ExpressionError } from \"./types\";\r\nexport type * from \"./types\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/document/expression/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["/**\r\n * **Expressions**: a prop that follows a variable instead of holding a value.\r\n *\r\n * A document is data, so it cannot carry a function — which is exactly what a\r\n * derived prop is (`packages/core/src/props/`: a `property`'s slot either holds\r\n * a value or is *bound* to a thunk). An expression is that function written as\r\n * a string a document can store:\r\n *\r\n * ```json\r\n * { \"id\": \"card\", \"type\": \"rect\", \"props\": { \"x\": \"=4[g]+3\", \"opacity\": \"=[g]\" } }\r\n * ```\r\n *\r\n * A leading `=` marks the string as a formula rather than a value, and `[name]`\r\n * reads the `VariableSpec` with that id. What it compiles to is an ordinary\r\n * prop binding, so nothing underneath it changes: a command writes the\r\n * variable's slot, and a bound prop recomputes on every read, so each of them\r\n * sees the new value without anything being invalidated. That is what makes one\r\n * variable able to drive twenty nodes without twenty copies of the same tween.\r\n *\r\n * Three rules the syntax turns on, each of which removes a question a reader\r\n * would otherwise have to ask:\r\n *\r\n * - **`=` marks the whole string, not part of it.** There is no `${…}` hole in\r\n * surrounding text. A prop is either a value or a formula, so nothing has to\r\n * define what a half-interpolated `cornerRadius` means. A literal string that\r\n * really does start with `=` is written `\"==\"`.\r\n * - **A lone `[x]` passes the value through, unconverted.** `\"=[c]\"` on a `fill`\r\n * yields whatever `c` holds — a colour string, a `Vector2`, an object — while\r\n * anything with arithmetic in it is numeric. Without that rule a variable\r\n * could only ever be a number, and driving four nodes' `fill` from one place\r\n * is half the reason variables exist.\r\n * - **Angles are degrees**, matching every angle in the library (`rotation`,\r\n * `startAngle`, 3D Euler rotations). `sin(30)` is `0.5`.\r\n *\r\n * Expressions **bind**; they are not tween destinations. See\r\n * `document/timeline.ts` for where that is enforced and why.\r\n *\r\n * One value — {@link expressionOps} — carries every operation: recognition,\r\n * parsing, compiling, the authored-value walk, and the name lists a host's\r\n * completion needs. The free functions this used to export\r\n * (`isExpressionSource`, `unescapeExpression`, `parseExpression`,\r\n * `tryParseExpression`, `compileExpression`, `compileValue`, `compileProps`,\r\n * `collectExpressions`, `expressionFunctionNames`, `expressionConstantNames`)\r\n * are those methods now.\r\n */\r\nexport { expressionOps } from \"./ops\";\r\nexport { ExpressionError } from \"./types\";\r\nexport type * from \"./types\";\r\n"]}
@@ -5,7 +5,7 @@
5
5
  * call site one grep from its implementation. Unlike `pathOps`, `insetsOps` and
6
6
  * the rest, this is **not** an `AttributeOps`: an expression is not an attribute,
7
7
  * has no `resolve`/`lerp` pair, and nothing in `attributes/properties/typed.ts`
8
- * builds a decorator from it. Only the naming convention transfers.
8
+ * builds a property from it. Only the naming convention transfers.
9
9
  *
10
10
  * Behind it is one grammar. There were two — this one and the function-plot
11
11
  * language in `@motionscript/math` — agreeing on every rule they documented and
@@ -1 +1 @@
1
- {"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../src/document/expression/ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAMlF,wEAAwE;AACxE,SAAS,WAAW,CAAC,MAAc,EAAE,UAA6B,gBAAgB;IAC9E,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AAoCD,MAAM,CAAC,MAAM,aAAa,GAAkB;IACxC,QAAQ;IACR,QAAQ;IAER,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QAC1B,IAAI,CAAC;YACD,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACxD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,CAAC;IACL,CAAC;IAED,OAAO;IACP,IAAI;IACJ,SAAS;IAET,OAAO;IACP,UAAU;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC;IACvD,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC;IACvD,OAAO,EAAE,gBAAgB;CAC5B,CAAC","sourcesContent":["/**\r\n * Every expression operation, on one object.\r\n *\r\n * The same shape `pathOps` has, for the same reason — one value to import, and a\r\n * call site one grep from its implementation. Unlike `pathOps`, `insetsOps` and\r\n * the rest, this is **not** an `AttributeOps`: an expression is not an attribute,\r\n * has no `resolve`/`lerp` pair, and nothing in `attributes/properties/typed.ts`\r\n * builds a decorator from it. Only the naming convention transfers.\r\n *\r\n * Behind it is one grammar. There were two — this one and the function-plot\r\n * language in `@motionscript/math` — agreeing on every rule they documented and\r\n * disagreeing everywhere they hadn't. The pipeline is now:\r\n *\r\n * a prop value ── bind/collect ──▶ \"=4[g]+3\" ── parse ──▶ ExpressionNode\r\n * (one walk) the marker │\r\n * stripped here ▼\r\n * compile ──▶ () => unknown\r\n *\r\n * A dialect chooses the function library and how a reference is spelled, so\r\n * `sin` can be degrees here and radians in a plot without a second parser.\r\n */\r\nimport { DOCUMENT_DIALECT, parse, sortedKeys } from \"./parse\";\r\nimport { compile } from \"./compile\";\r\nimport { bind, bindProps, collect, isSource, renameRefs, unescape } from \"./walk\";\r\nimport type {\r\n CompiledProps, CompiledValue, ExpressionDialect, ExpressionSite,\r\n ParsedExpression, VariableResolver,\r\n} from \"./types\";\r\n\r\n/** {@link parse}, tolerating the `=` a raw prop value still carries. */\r\nfunction parseSource(source: string, dialect: ExpressionDialect = DOCUMENT_DIALECT): ParsedExpression {\r\n return parse(isSource(source) ? source.slice(1) : source, dialect);\r\n}\r\n\r\nexport interface ExpressionOps {\r\n // ── Recognition ────────────────────────────────────────────────────────\r\n /** True for a formula. `\"==\"` escapes a literal string starting with `=`. */\r\n isSource(value: unknown): value is string;\r\n /** Strip that escape: `\"==x\"` → `\"=x\"`. Everything else passes through. */\r\n unescape(value: string): string;\r\n\r\n // ── Reading ────────────────────────────────────────────────────────────\r\n /** Parse a formula, with or without its leading `=`. Throws `ExpressionError`. */\r\n parse(source: string, dialect?: ExpressionDialect): ParsedExpression;\r\n /** {@link ExpressionOps.parse} without throwing — the shape a validator wants. */\r\n tryParse(source: string, dialect?: ExpressionDialect): { expression: ParsedExpression } | { error: string };\r\n\r\n // ── Binding ────────────────────────────────────────────────────────────\r\n /** A parsed formula into the binding a `PropSlot` takes. */\r\n compile(parsed: ParsedExpression, resolve: VariableResolver, path?: string): () => unknown;\r\n /** One authored prop value: a plain value, or the binding an expression inside it produced. */\r\n bind(value: unknown, resolve: VariableResolver, path?: string): CompiledValue;\r\n /** A whole props bag, split into what a constructor can take and what has to be bound. */\r\n bindProps(props: Record<string, unknown> | undefined, resolve: VariableResolver, path?: string): CompiledProps;\r\n\r\n // ── Inspecting ─────────────────────────────────────────────────────────\r\n /** Every expression inside an authored value, with a JSON-Pointer-style path. */\r\n collect(value: unknown, path: string): ExpressionSite[];\r\n /** Rewrite the `[ref]`s inside every expression in a value; `undefined` keeps one. */\r\n renameRefs<T>(value: T, rename: (ref: string) => string | undefined): T;\r\n /** Every function name, for a host offering completion. Sorted. */\r\n functions(): string[];\r\n /** Every constant name, for a host offering completion. Sorted. */\r\n constants(): string[];\r\n /** The language a document's props are written in. */\r\n readonly dialect: ExpressionDialect;\r\n}\r\n\r\nexport const expressionOps: ExpressionOps = {\r\n isSource,\r\n unescape,\r\n\r\n parse: parseSource,\r\n tryParse: (source, dialect) => {\r\n try {\r\n return { expression: parseSource(source, dialect) };\r\n } catch (e) {\r\n return { error: e instanceof Error ? e.message : String(e) };\r\n }\r\n },\r\n\r\n compile,\r\n bind,\r\n bindProps,\r\n\r\n collect,\r\n renameRefs,\r\n functions: () => sortedKeys(DOCUMENT_DIALECT.functions),\r\n constants: () => sortedKeys(DOCUMENT_DIALECT.constants),\r\n dialect: DOCUMENT_DIALECT,\r\n};\r\n"]}
1
+ {"version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AgB;CAC5B,CAAC","sourcesContent":["/**\r\n * Every expression operation, on one object.\r\n *\r\n * The same shape `pathOps` has, for the same reason — one value to import, and a\r\n * call site one grep from its implementation. Unlike `pathOps`, `insetsOps` and\r\n * the rest, this is **not** an `AttributeOps`: an expression is not an attribute,\r\n * has no `resolve`/`lerp` pair, and nothing in `attributes/properties/typed.ts`\r\n * builds a property from it. Only the naming convention transfers.\r\n *\r\n * Behind it is one grammar. There were two — this one and the function-plot\r\n * language in `@motionscript/math` — agreeing on every rule they documented and\r\n * disagreeing everywhere they hadn't. The pipeline is now:\r\n *\r\n * a prop value ── bind/collect ──▶ \"=4[g]+3\" ── parse ──▶ ExpressionNode\r\n * (one walk) the marker │\r\n * stripped here ▼\r\n * compile ──▶ () => unknown\r\n *\r\n * A dialect chooses the function library and how a reference is spelled, so\r\n * `sin` can be degrees here and radians in a plot without a second parser.\r\n */\r\nimport { DOCUMENT_DIALECT, parse, sortedKeys } from \"./parse\";\r\nimport { compile } from \"./compile\";\r\nimport { bind, bindProps, collect, isSource, renameRefs, unescape } from \"./walk\";\r\nimport type {\r\n CompiledProps, CompiledValue, ExpressionDialect, ExpressionSite,\r\n ParsedExpression, VariableResolver,\r\n} from \"./types\";\r\n\r\n/** {@link parse}, tolerating the `=` a raw prop value still carries. */\r\nfunction parseSource(source: string, dialect: ExpressionDialect = DOCUMENT_DIALECT): ParsedExpression {\r\n return parse(isSource(source) ? source.slice(1) : source, dialect);\r\n}\r\n\r\nexport interface ExpressionOps {\r\n // ── Recognition ────────────────────────────────────────────────────────\r\n /** True for a formula. `\"==\"` escapes a literal string starting with `=`. */\r\n isSource(value: unknown): value is string;\r\n /** Strip that escape: `\"==x\"` → `\"=x\"`. Everything else passes through. */\r\n unescape(value: string): string;\r\n\r\n // ── Reading ────────────────────────────────────────────────────────────\r\n /** Parse a formula, with or without its leading `=`. Throws `ExpressionError`. */\r\n parse(source: string, dialect?: ExpressionDialect): ParsedExpression;\r\n /** {@link ExpressionOps.parse} without throwing — the shape a validator wants. */\r\n tryParse(source: string, dialect?: ExpressionDialect): { expression: ParsedExpression } | { error: string };\r\n\r\n // ── Binding ────────────────────────────────────────────────────────────\r\n /** A parsed formula into the binding a `PropSlot` takes. */\r\n compile(parsed: ParsedExpression, resolve: VariableResolver, path?: string): () => unknown;\r\n /** One authored prop value: a plain value, or the binding an expression inside it produced. */\r\n bind(value: unknown, resolve: VariableResolver, path?: string): CompiledValue;\r\n /** A whole props bag, split into what a constructor can take and what has to be bound. */\r\n bindProps(props: Record<string, unknown> | undefined, resolve: VariableResolver, path?: string): CompiledProps;\r\n\r\n // ── Inspecting ─────────────────────────────────────────────────────────\r\n /** Every expression inside an authored value, with a JSON-Pointer-style path. */\r\n collect(value: unknown, path: string): ExpressionSite[];\r\n /** Rewrite the `[ref]`s inside every expression in a value; `undefined` keeps one. */\r\n renameRefs<T>(value: T, rename: (ref: string) => string | undefined): T;\r\n /** Every function name, for a host offering completion. Sorted. */\r\n functions(): string[];\r\n /** Every constant name, for a host offering completion. Sorted. */\r\n constants(): string[];\r\n /** The language a document's props are written in. */\r\n readonly dialect: ExpressionDialect;\r\n}\r\n\r\nexport const expressionOps: ExpressionOps = {\r\n isSource,\r\n unescape,\r\n\r\n parse: parseSource,\r\n tryParse: (source, dialect) => {\r\n try {\r\n return { expression: parseSource(source, dialect) };\r\n } catch (e) {\r\n return { error: e instanceof Error ? e.message : String(e) };\r\n }\r\n },\r\n\r\n compile,\r\n bind,\r\n bindProps,\r\n\r\n collect,\r\n renameRefs,\r\n functions: () => sortedKeys(DOCUMENT_DIALECT.functions),\r\n constants: () => sortedKeys(DOCUMENT_DIALECT.constants),\r\n dialect: DOCUMENT_DIALECT,\r\n};\r\n"]}
@@ -4,8 +4,7 @@ export * from "./expression/index.js";
4
4
  export * from "./validate.js";
5
5
  export * from "./registry.js";
6
6
  export * from "./node-descriptor.js";
7
- export * from "./node-decorator.js";
8
- export * from "./withdraw.js";
7
+ export { NODE_META, getNodeDescriptor } from "./node-decorator.js";
9
8
  export * from "./placement.js";
10
9
  export * from "./timeline.js";
11
10
  export * from "./audio.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChE,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -4,8 +4,7 @@ export * from "./expression/index.js";
4
4
  export * from "./validate.js";
5
5
  export * from "./registry.js";
6
6
  export * from "./node-descriptor.js";
7
- export * from "./node-decorator.js";
8
- export * from "./withdraw.js";
7
+ export { NODE_META, getNodeDescriptor } from "./node-decorator.js";
9
8
  export * from "./placement.js";
10
9
  export * from "./timeline.js";
11
10
  export * from "./audio.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,iFAAiF;AACjF,2EAA2E;AAC3E,mBAAmB","sourcesContent":["export * from \"./types\";\r\nexport * from \"./project\";\r\nexport * from \"./expression\";\r\nexport * from \"./validate\";\r\nexport * from \"./registry\";\r\nexport * from \"./node-descriptor\";\r\nexport * from \"./node-decorator\";\r\nexport * from \"./withdraw\";\r\nexport * from \"./placement\";\r\nexport * from \"./timeline\";\r\nexport * from \"./audio\";\r\n// `installBuiltins` is deliberately NOT exported: a `Registry` seeds itself from\r\n// its own constructor, so a host has no module-scope call for a bundler to\r\n// tree-shake away.\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChE,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,iFAAiF;AACjF,2EAA2E;AAC3E,mBAAmB","sourcesContent":["export * from \"./types\";\r\nexport * from \"./project\";\r\nexport * from \"./expression\";\r\nexport * from \"./validate\";\r\nexport * from \"./registry\";\r\nexport * from \"./node-descriptor\";\r\nexport { NODE_META, getNodeDescriptor } from \"./node-decorator\";\r\nexport * from \"./placement\";\r\nexport * from \"./timeline\";\r\nexport * from \"./audio\";\r\n// `installBuiltins` is deliberately NOT exported: a `Registry` seeds itself from\r\n// its own constructor, so a host has no module-scope call for a bundler to\r\n// tree-shake away.\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { NodeTypeDescriptor } from "./node-descriptor.js";
2
- /** Symbol under which `@node` metadata is stored on a class prototype. */
2
+ /** Symbol under which `node` metadata is stored on a class prototype. */
3
3
  export declare const NODE_META: unique symbol;
4
4
  /**
5
5
  * Declare a node class's document key — and nothing else.
@@ -7,22 +7,26 @@ export declare const NODE_META: unique symbol;
7
7
  * **It does not register.** Registration happens when the class is handed to a
8
8
  * `Registry` (`new Engine(platform, { nodes: [Blob] })`), because a registry is
9
9
  * a value an engine owns rather than a table the module graph writes into. A
10
- * decorator that registered made the *order modules happened to be imported in*
10
+ * declaration that registered made the *order modules happened to be imported in*
11
11
  * part of the engine's state: whichever host loaded first won the key, a second
12
12
  * engine in the same process inherited a vocabulary it never asked for, and a
13
13
  * class that was merely imported was already registered whether or not anything
14
14
  * meant to offer it.
15
15
  *
16
- * What is left is a declaration, read back by {@link getNodeDescriptor}:
16
+ * What is left is a declaration, read back by {@link getNodeDescriptor}. A
17
+ * component factory makes it for the class it generates (`component2d({ key })`);
18
+ * a hand-written class makes it itself:
17
19
  *
18
20
  * ```ts
19
- * @node("blob")
20
21
  * class Blob extends Node2D<BlobProps> {
21
- * @property({ default: 0.4 }) declare readonly wobble: number;
22
- *
23
- * @command({ args: ["wobble"] })
22
+ * declare readonly wobble: number;
24
23
  * wobbleTo(args: CommandArgs<{ wobble: number }>) { … }
25
24
  * }
25
+ * declareMembers(Blob, {
26
+ * wobble: property({ default: 0.4 }),
27
+ * wobbleTo: command({ args: ["wobble"] }),
28
+ * });
29
+ * node("blob")(Blob);
26
30
  *
27
31
  * const registry = new Registry({ nodes: [Blob] });
28
32
  * // { "type": "blob", "props": { "wobble": 0.4 } }
@@ -34,12 +38,12 @@ export declare const NODE_META: unique symbol;
34
38
  * `manifest.json` beside a class nothing checked it against:
35
39
  *
36
40
  * ```ts
37
- * @node({
41
+ * node({
38
42
  * key: "lineChart",
39
43
  * forkable: true,
40
44
  * layout: { children: "freeform", acceptsChildren: true },
41
45
  * seed: { width: 760, height: 460 },
42
- * })
46
+ * })(LineChart);
43
47
  * ```
44
48
  *
45
49
  * None of it is read while rendering — see {@link NodeTypeDescriptor}.
@@ -51,7 +55,7 @@ export declare const NODE_META: unique symbol;
51
55
  */
52
56
  export declare function node(type: string | NodeTypeDescriptor): <T extends new (...args: never[]) => object>(ctor: T) => T;
53
57
  /**
54
- * What `@node` declared on this exact class, or `undefined`.
58
+ * What `node` declared on this exact class, or `undefined`.
55
59
  *
56
60
  * Own prototype only, deliberately: a subclass inherits its parent's methods but
57
61
  * not its identity, and a `Card extends Rect` that answered to `"rect"` would
@@ -1 +1 @@
1
- {"version":3,"file":"node-decorator.d.ts","sourceRoot":"","sources":["../../src/document/node-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,0EAA0E;AAC1E,eAAO,MAAM,SAAS,eAAqB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,IAKjC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,CAAC,KAAG,CAAC,CAK3E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAIxG"}
1
+ {"version":3,"file":"node-decorator.d.ts","sourceRoot":"","sources":["../../src/document/node-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,yEAAyE;AACzE,eAAO,MAAM,SAAS,eAAqB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,IAKjC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,CAAC,KAAG,CAAC,CAK3E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAIxG"}
@@ -1,4 +1,4 @@
1
- /** Symbol under which `@node` metadata is stored on a class prototype. */
1
+ /** Symbol under which `node` metadata is stored on a class prototype. */
2
2
  export const NODE_META = Symbol("nodeMeta");
3
3
  /**
4
4
  * Declare a node class's document key — and nothing else.
@@ -6,22 +6,26 @@ export const NODE_META = Symbol("nodeMeta");
6
6
  * **It does not register.** Registration happens when the class is handed to a
7
7
  * `Registry` (`new Engine(platform, { nodes: [Blob] })`), because a registry is
8
8
  * a value an engine owns rather than a table the module graph writes into. A
9
- * decorator that registered made the *order modules happened to be imported in*
9
+ * declaration that registered made the *order modules happened to be imported in*
10
10
  * part of the engine's state: whichever host loaded first won the key, a second
11
11
  * engine in the same process inherited a vocabulary it never asked for, and a
12
12
  * class that was merely imported was already registered whether or not anything
13
13
  * meant to offer it.
14
14
  *
15
- * What is left is a declaration, read back by {@link getNodeDescriptor}:
15
+ * What is left is a declaration, read back by {@link getNodeDescriptor}. A
16
+ * component factory makes it for the class it generates (`component2d({ key })`);
17
+ * a hand-written class makes it itself:
16
18
  *
17
19
  * ```ts
18
- * @node("blob")
19
20
  * class Blob extends Node2D<BlobProps> {
20
- * @property({ default: 0.4 }) declare readonly wobble: number;
21
- *
22
- * @command({ args: ["wobble"] })
21
+ * declare readonly wobble: number;
23
22
  * wobbleTo(args: CommandArgs<{ wobble: number }>) { … }
24
23
  * }
24
+ * declareMembers(Blob, {
25
+ * wobble: property({ default: 0.4 }),
26
+ * wobbleTo: command({ args: ["wobble"] }),
27
+ * });
28
+ * node("blob")(Blob);
25
29
  *
26
30
  * const registry = new Registry({ nodes: [Blob] });
27
31
  * // { "type": "blob", "props": { "wobble": 0.4 } }
@@ -33,12 +37,12 @@ export const NODE_META = Symbol("nodeMeta");
33
37
  * `manifest.json` beside a class nothing checked it against:
34
38
  *
35
39
  * ```ts
36
- * @node({
40
+ * node({
37
41
  * key: "lineChart",
38
42
  * forkable: true,
39
43
  * layout: { children: "freeform", acceptsChildren: true },
40
44
  * seed: { width: 760, height: 460 },
41
- * })
45
+ * })(LineChart);
42
46
  * ```
43
47
  *
44
48
  * None of it is read while rendering — see {@link NodeTypeDescriptor}.
@@ -60,7 +64,7 @@ export function node(type) {
60
64
  };
61
65
  }
62
66
  /**
63
- * What `@node` declared on this exact class, or `undefined`.
67
+ * What `node` declared on this exact class, or `undefined`.
64
68
  *
65
69
  * Own prototype only, deliberately: a subclass inherits its parent's methods but
66
70
  * not its identity, and a `Card extends Rect` that answered to `"rect"` would
@@ -1 +1 @@
1
- {"version":3,"file":"node-decorator.js","sourceRoot":"","sources":["../../src/document/node-decorator.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,UAAU,IAAI,CAAC,IAAiC;IAClD,iEAAiE;IACjE,4EAA4E;IAC5E,2EAA2E;IAC3E,OAAO;IACP,OAAO,UAAsD,IAAO;QAChE,MAAM,UAAU,GAAuB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtF,IAAI,CAAC,SAAqC,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAsC;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,SAAgD,CAAC;IACpE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxF,OAAO,KAAK,CAAC,SAAS,CAAuB,CAAC;AAClD,CAAC","sourcesContent":["import type { NodeTypeDescriptor } from \"./node-descriptor\";\r\n\r\n/** Symbol under which `@node` metadata is stored on a class prototype. */\r\nexport const NODE_META = Symbol(\"nodeMeta\");\r\n\r\n/**\r\n * Declare a node class's document key — and nothing else.\r\n *\r\n * **It does not register.** Registration happens when the class is handed to a\r\n * `Registry` (`new Engine(platform, { nodes: [Blob] })`), because a registry is\r\n * a value an engine owns rather than a table the module graph writes into. A\r\n * decorator that registered made the *order modules happened to be imported in*\r\n * part of the engine's state: whichever host loaded first won the key, a second\r\n * engine in the same process inherited a vocabulary it never asked for, and a\r\n * class that was merely imported was already registered whether or not anything\r\n * meant to offer it.\r\n *\r\n * What is left is a declaration, read back by {@link getNodeDescriptor}:\r\n *\r\n * ```ts\r\n * @node(\"blob\")\r\n * class Blob extends Node2D<BlobProps> {\r\n * @property({ default: 0.4 }) declare readonly wobble: number;\r\n *\r\n * @command({ args: [\"wobble\"] })\r\n * wobbleTo(args: CommandArgs<{ wobble: number }>) { … }\r\n * }\r\n *\r\n * const registry = new Registry({ nodes: [Blob] });\r\n * // { \"type\": \"blob\", \"props\": { \"wobble\": 0.4 } }\r\n * ```\r\n *\r\n * The full form declares everything a host needs to *offer* the type — the\r\n * shelves it sits on, how it lays children out, what a freshly placed one is\r\n * seeded with — which is what a component package used to restate in a\r\n * `manifest.json` beside a class nothing checked it against:\r\n *\r\n * ```ts\r\n * @node({\r\n * key: \"lineChart\",\r\n * forkable: true,\r\n * layout: { children: \"freeform\", acceptsChildren: true },\r\n * seed: { width: 760, height: 460 },\r\n * })\r\n * ```\r\n *\r\n * None of it is read while rendering — see {@link NodeTypeDescriptor}.\r\n *\r\n * **The key is written out, not taken from the class name.** A minifier is free\r\n * to rename `Blob` to `o`, and the key is what stored documents contain — so a\r\n * derived one would work in development and silently rewrite every document's\r\n * vocabulary in a production bundle. It is public API, and spelled like it.\r\n */\r\nexport function node(type: string | NodeTypeDescriptor) {\r\n // Deliberately looser than `NodeConstructor`, which takes a bare\r\n // `Record<string, unknown>`: a real node class declares its own props type,\r\n // and requiring assignability would reject exactly the classes this exists\r\n // for.\r\n return function <T extends new (...args: never[]) => object>(ctor: T): T {\r\n const descriptor: NodeTypeDescriptor = typeof type === \"string\" ? { key: type } : type;\r\n (ctor.prototype as Record<symbol, unknown>)[NODE_META] = descriptor;\r\n return ctor;\r\n };\r\n}\r\n\r\n/**\r\n * What `@node` declared on this exact class, or `undefined`.\r\n *\r\n * Own prototype only, deliberately: a subclass inherits its parent's methods but\r\n * not its identity, and a `Card extends Rect` that answered to `\"rect\"` would\r\n * collide with the real one the moment both were registered.\r\n */\r\nexport function getNodeDescriptor(ctor: new (...args: never[]) => object): NodeTypeDescriptor | undefined {\r\n const proto = ctor.prototype as Record<symbol, unknown> | undefined;\r\n if (!proto || !Object.prototype.hasOwnProperty.call(proto, NODE_META)) return undefined;\r\n return proto[NODE_META] as NodeTypeDescriptor;\r\n}\r\n"]}
1
+ {"version":3,"file":"node-decorator.js","sourceRoot":"","sources":["../../src/document/node-decorator.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,UAAU,IAAI,CAAC,IAAiC;IAClD,iEAAiE;IACjE,4EAA4E;IAC5E,2EAA2E;IAC3E,OAAO;IACP,OAAO,UAAsD,IAAO;QAChE,MAAM,UAAU,GAAuB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtF,IAAI,CAAC,SAAqC,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAsC;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,SAAgD,CAAC;IACpE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxF,OAAO,KAAK,CAAC,SAAS,CAAuB,CAAC;AAClD,CAAC","sourcesContent":["import type { NodeTypeDescriptor } from \"./node-descriptor\";\r\n\r\n/** Symbol under which `node` metadata is stored on a class prototype. */\r\nexport const NODE_META = Symbol(\"nodeMeta\");\r\n\r\n/**\r\n * Declare a node class's document key — and nothing else.\r\n *\r\n * **It does not register.** Registration happens when the class is handed to a\r\n * `Registry` (`new Engine(platform, { nodes: [Blob] })`), because a registry is\r\n * a value an engine owns rather than a table the module graph writes into. A\r\n * declaration that registered made the *order modules happened to be imported in*\r\n * part of the engine's state: whichever host loaded first won the key, a second\r\n * engine in the same process inherited a vocabulary it never asked for, and a\r\n * class that was merely imported was already registered whether or not anything\r\n * meant to offer it.\r\n *\r\n * What is left is a declaration, read back by {@link getNodeDescriptor}. A\r\n * component factory makes it for the class it generates (`component2d({ key })`);\r\n * a hand-written class makes it itself:\r\n *\r\n * ```ts\r\n * class Blob extends Node2D<BlobProps> {\r\n * declare readonly wobble: number;\r\n * wobbleTo(args: CommandArgs<{ wobble: number }>) { … }\r\n * }\r\n * declareMembers(Blob, {\r\n * wobble: property({ default: 0.4 }),\r\n * wobbleTo: command({ args: [\"wobble\"] }),\r\n * });\r\n * node(\"blob\")(Blob);\r\n *\r\n * const registry = new Registry({ nodes: [Blob] });\r\n * // { \"type\": \"blob\", \"props\": { \"wobble\": 0.4 } }\r\n * ```\r\n *\r\n * The full form declares everything a host needs to *offer* the type — the\r\n * shelves it sits on, how it lays children out, what a freshly placed one is\r\n * seeded with — which is what a component package used to restate in a\r\n * `manifest.json` beside a class nothing checked it against:\r\n *\r\n * ```ts\r\n * node({\r\n * key: \"lineChart\",\r\n * forkable: true,\r\n * layout: { children: \"freeform\", acceptsChildren: true },\r\n * seed: { width: 760, height: 460 },\r\n * })(LineChart);\r\n * ```\r\n *\r\n * None of it is read while rendering — see {@link NodeTypeDescriptor}.\r\n *\r\n * **The key is written out, not taken from the class name.** A minifier is free\r\n * to rename `Blob` to `o`, and the key is what stored documents contain — so a\r\n * derived one would work in development and silently rewrite every document's\r\n * vocabulary in a production bundle. It is public API, and spelled like it.\r\n */\r\nexport function node(type: string | NodeTypeDescriptor) {\r\n // Deliberately looser than `NodeConstructor`, which takes a bare\r\n // `Record<string, unknown>`: a real node class declares its own props type,\r\n // and requiring assignability would reject exactly the classes this exists\r\n // for.\r\n return function <T extends new (...args: never[]) => object>(ctor: T): T {\r\n const descriptor: NodeTypeDescriptor = typeof type === \"string\" ? { key: type } : type;\r\n (ctor.prototype as Record<symbol, unknown>)[NODE_META] = descriptor;\r\n return ctor;\r\n };\r\n}\r\n\r\n/**\r\n * What `node` declared on this exact class, or `undefined`.\r\n *\r\n * Own prototype only, deliberately: a subclass inherits its parent's methods but\r\n * not its identity, and a `Card extends Rect` that answered to `\"rect\"` would\r\n * collide with the real one the moment both were registered.\r\n */\r\nexport function getNodeDescriptor(ctor: new (...args: never[]) => object): NodeTypeDescriptor | undefined {\r\n const proto = ctor.prototype as Record<symbol, unknown> | undefined;\r\n if (!proto || !Object.prototype.hasOwnProperty.call(proto, NODE_META)) return undefined;\r\n return proto[NODE_META] as NodeTypeDescriptor;\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { PropertyEditor } from "../attributes/properties/decorator.js";
2
- import type { NodeDimension } from "../nodes/node/node.js";
2
+ import type { NodeDimension } from "../components/trees/node/node.js";
3
3
  /**
4
4
  * What a node type declares about itself beyond its key.
5
5
  *
@@ -36,6 +36,12 @@ export interface NodeTypeDescriptor {
36
36
  * catching the throw.
37
37
  */
38
38
  dimension?: NodeDimension;
39
+ /**
40
+ * The trees it takes children from: its own, or a viewport's two (a Canvas
41
+ * 3D takes 2D and 3D); empty for a type that takes none. **Derived** from
42
+ * the class, as {@link dimension} is.
43
+ */
44
+ holds?: readonly NodeDimension[];
39
45
  /**
40
46
  * Whether a host may copy this component's source.
41
47
  *
@@ -66,13 +72,13 @@ export interface NodeTypeDescriptor {
66
72
  /** Takes only the children that name it in their {@link within}: a plot holds its marks, not a photograph. */
67
73
  closed?: boolean;
68
74
  /**
69
- * The editable properties, by key — **derived from `@property`**, never
75
+ * The editable properties, by key — **derived from `property`**, never
70
76
  * written here.
71
77
  *
72
78
  * A hand-written list of a class's properties, beside a class of
73
79
  * properties, is exactly the restatement this whole descriptor exists to
74
80
  * remove. What a host needs beyond the key — a range, an enum's choices, the
75
- * controls inside an object-valued prop — is declared on the `@property`
81
+ * controls inside an object-valued prop — is declared on the `property`
76
82
  * itself, which is the thing being edited.
77
83
  */
78
84
  properties?: Record<string, NodePropertyDescriptor>;
@@ -1 +1 @@
1
- {"version":3,"file":"node-descriptor.d.ts","sourceRoot":"","sources":["../../src/document/node-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE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