@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (746) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +48 -0
  4. package/README.md +93 -72
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +9 -0
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +11 -0
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts.map +1 -1
  11. package/dist/assets/errors.js +8 -3
  12. package/dist/assets/errors.js.map +1 -1
  13. package/dist/assets/index.js.map +1 -1
  14. package/dist/assets/manager.d.ts +26 -1
  15. package/dist/assets/manager.d.ts.map +1 -1
  16. package/dist/assets/manager.js +79 -4
  17. package/dist/assets/manager.js.map +1 -1
  18. package/dist/assets/manifest.js.map +1 -1
  19. package/dist/assets/record.js.map +1 -1
  20. package/dist/assets/scope.d.ts +3 -3
  21. package/dist/assets/scope.d.ts.map +1 -1
  22. package/dist/assets/scope.js.map +1 -1
  23. package/dist/attributes/audio/filters/chain.d.ts +1 -1
  24. package/dist/attributes/audio/filters/chain.js.map +1 -1
  25. package/dist/attributes/audio/filters/curve.d.ts +8 -8
  26. package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
  27. package/dist/attributes/audio/filters/curve.js +20 -19
  28. package/dist/attributes/audio/filters/curve.js.map +1 -1
  29. package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
  30. package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
  31. package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
  32. package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
  33. package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
  34. package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
  35. package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
  36. package/dist/attributes/audio/filters/index.d.ts +1 -1
  37. package/dist/attributes/audio/filters/index.d.ts.map +1 -1
  38. package/dist/attributes/audio/filters/index.js +1 -1
  39. package/dist/attributes/audio/filters/index.js.map +1 -1
  40. package/dist/attributes/audio/filters/registry.js.map +1 -1
  41. package/dist/attributes/audio/filters/union.js.map +1 -1
  42. package/dist/attributes/audio/request.d.ts +17 -2
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js.map +1 -1
  45. package/dist/attributes/audio/schedule.d.ts +4 -2
  46. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  47. package/dist/attributes/audio/schedule.js +15 -8
  48. package/dist/attributes/audio/schedule.js.map +1 -1
  49. package/dist/attributes/audio/sound.d.ts +4 -2
  50. package/dist/attributes/audio/sound.d.ts.map +1 -1
  51. package/dist/attributes/audio/sound.js +8 -4
  52. package/dist/attributes/audio/sound.js.map +1 -1
  53. package/dist/attributes/index.js.map +1 -1
  54. package/dist/attributes/layout/alignment.js +1 -1
  55. package/dist/attributes/layout/alignment.js.map +1 -1
  56. package/dist/attributes/layout/index.js.map +1 -1
  57. package/dist/attributes/layout/insets.js.map +1 -1
  58. package/dist/attributes/layout/matrix2d.js.map +1 -1
  59. package/dist/attributes/layout/size.js.map +1 -1
  60. package/dist/attributes/layout/transform3d.js.map +1 -1
  61. package/dist/attributes/layout/vector2.js.map +1 -1
  62. package/dist/attributes/layout/world-transform.js.map +1 -1
  63. package/dist/attributes/mask/boolean.js.map +1 -1
  64. package/dist/attributes/mask/mask.js.map +1 -1
  65. package/dist/attributes/properties/decorator.d.ts +3 -1
  66. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  67. package/dist/attributes/properties/decorator.js.map +1 -1
  68. package/dist/attributes/properties/inputs.js.map +1 -1
  69. package/dist/attributes/properties/typed.d.ts +9 -2
  70. package/dist/attributes/properties/typed.d.ts.map +1 -1
  71. package/dist/attributes/properties/typed.js +15 -1
  72. package/dist/attributes/properties/typed.js.map +1 -1
  73. package/dist/attributes/render3d/orbit.d.ts +8 -8
  74. package/dist/attributes/render3d/orbit.js +7 -7
  75. package/dist/attributes/render3d/orbit.js.map +1 -1
  76. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  77. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  78. package/dist/attributes/shape/corners/corners.js.map +1 -1
  79. package/dist/attributes/shape/corners/index.js.map +1 -1
  80. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  81. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  82. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  83. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  84. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  85. package/dist/attributes/shape/effects/chain.js +16 -88
  86. package/dist/attributes/shape/effects/chain.js.map +1 -1
  87. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  88. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  96. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  98. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  101. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  103. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  105. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  110. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  114. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  119. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  128. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  133. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  136. package/dist/attributes/shape/effects/index.d.ts +2 -6
  137. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  138. package/dist/attributes/shape/effects/index.js.map +1 -1
  139. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  140. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  141. package/dist/attributes/shape/effects/registry.js +44 -10
  142. package/dist/attributes/shape/effects/registry.js.map +1 -1
  143. package/dist/attributes/shape/effects/union.d.ts +2 -6
  144. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  145. package/dist/attributes/shape/effects/union.js.map +1 -1
  146. package/dist/attributes/shape/fill/blend.js.map +1 -1
  147. package/dist/attributes/shape/fill/chain.js.map +1 -1
  148. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  149. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  150. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  151. package/dist/attributes/shape/fill/color/parser.js +81 -44
  152. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  153. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  154. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  155. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  156. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  157. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  158. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  159. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  160. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  161. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  162. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  165. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  166. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  169. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  170. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  172. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  174. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  176. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  177. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  180. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  181. package/dist/attributes/shape/fill/index.js.map +1 -1
  182. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  183. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  184. package/dist/attributes/shape/fill/registry.js.map +1 -1
  185. package/dist/attributes/shape/fill/union.js.map +1 -1
  186. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  187. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  188. package/dist/attributes/shape/filters/chain.js +1 -13
  189. package/dist/attributes/shape/filters/chain.js.map +1 -1
  190. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  191. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  192. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  193. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  194. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  195. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  196. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  197. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  199. package/dist/attributes/shape/filters/index.d.ts +1 -1
  200. package/dist/attributes/shape/filters/index.js.map +1 -1
  201. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  202. package/dist/attributes/shape/filters/registry.js +3 -3
  203. package/dist/attributes/shape/filters/registry.js.map +1 -1
  204. package/dist/attributes/shape/filters/union.d.ts +6 -7
  205. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  206. package/dist/attributes/shape/filters/union.js.map +1 -1
  207. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  208. package/dist/attributes/shape/path/anchors.js +12 -5
  209. package/dist/attributes/shape/path/anchors.js.map +1 -1
  210. package/dist/attributes/shape/path/bezier.js.map +1 -1
  211. package/dist/attributes/shape/path/index.js.map +1 -1
  212. package/dist/attributes/shape/path/measure.js.map +1 -1
  213. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  214. package/dist/attributes/shape/path/morph.js +16 -4
  215. package/dist/attributes/shape/path/morph.js.map +1 -1
  216. package/dist/attributes/shape/path/ops.js.map +1 -1
  217. package/dist/attributes/shape/path/types.js.map +1 -1
  218. package/dist/attributes/shape/path/walk.js.map +1 -1
  219. package/dist/attributes/shape/shaders/index.js.map +1 -1
  220. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  221. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  222. package/dist/attributes/shape/shadow/index.js.map +1 -1
  223. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  224. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  225. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  226. package/dist/attributes/shape/stroke/index.js +1 -1
  227. package/dist/attributes/shape/stroke/index.js.map +1 -1
  228. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  229. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  230. package/dist/attributes/shape/stroke/stroke.js +22 -2
  231. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  232. package/dist/attributes/shared/operators.js.map +1 -1
  233. package/dist/attributes/text/index.js.map +1 -1
  234. package/dist/attributes/text/ops.d.ts +6 -0
  235. package/dist/attributes/text/ops.d.ts.map +1 -1
  236. package/dist/attributes/text/ops.js +1 -0
  237. package/dist/attributes/text/ops.js.map +1 -1
  238. package/dist/attributes/text/types.js.map +1 -1
  239. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  240. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  241. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  242. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  243. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  244. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  245. package/dist/browser/component.js +1 -1
  246. package/dist/browser/component.js.map +1 -1
  247. package/dist/browser/index.js +1 -1
  248. package/dist/browser/index.js.map +4 -4
  249. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  250. package/dist/browser/jsx-jsx-runtime.js +1 -1
  251. package/dist/browser/manifest.json +3 -2
  252. package/dist/browser/sdk.js +1 -1
  253. package/dist/component.js.map +1 -1
  254. package/dist/document/audio.d.ts +1 -1
  255. package/dist/document/audio.js +4 -4
  256. package/dist/document/audio.js.map +1 -1
  257. package/dist/document/builtins.d.ts.map +1 -1
  258. package/dist/document/builtins.js +8 -14
  259. package/dist/document/builtins.js.map +1 -1
  260. package/dist/document/command-traits.d.ts +1 -1
  261. package/dist/document/command-traits.js +13 -1
  262. package/dist/document/command-traits.js.map +1 -1
  263. package/dist/document/deny-globals.js.map +1 -1
  264. package/dist/document/diff.js.map +1 -1
  265. package/dist/document/doc-index.d.ts +2 -2
  266. package/dist/document/doc-index.d.ts.map +1 -1
  267. package/dist/document/doc-index.js.map +1 -1
  268. package/dist/document/expression/compile.d.ts.map +1 -1
  269. package/dist/document/expression/compile.js +8 -5
  270. package/dist/document/expression/compile.js.map +1 -1
  271. package/dist/document/expression/index.js.map +1 -1
  272. package/dist/document/expression/ops.js +1 -1
  273. package/dist/document/expression/ops.js.map +1 -1
  274. package/dist/document/expression/parse.d.ts.map +1 -1
  275. package/dist/document/expression/parse.js +15 -6
  276. package/dist/document/expression/parse.js.map +1 -1
  277. package/dist/document/expression/refs.d.ts +1 -1
  278. package/dist/document/expression/refs.js +1 -1
  279. package/dist/document/expression/refs.js.map +1 -1
  280. package/dist/document/expression/types.js.map +1 -1
  281. package/dist/document/expression/walk.d.ts.map +1 -1
  282. package/dist/document/expression/walk.js +2 -1
  283. package/dist/document/expression/walk.js.map +1 -1
  284. package/dist/document/index.d.ts +2 -0
  285. package/dist/document/index.d.ts.map +1 -1
  286. package/dist/document/index.js +2 -0
  287. package/dist/document/index.js.map +1 -1
  288. package/dist/document/node-decorator.js.map +1 -1
  289. package/dist/document/node-descriptor.d.ts +19 -0
  290. package/dist/document/node-descriptor.d.ts.map +1 -1
  291. package/dist/document/node-descriptor.js.map +1 -1
  292. package/dist/document/placement.d.ts +70 -0
  293. package/dist/document/placement.d.ts.map +1 -0
  294. package/dist/document/placement.js +83 -0
  295. package/dist/document/placement.js.map +1 -0
  296. package/dist/document/project.d.ts +2 -2
  297. package/dist/document/project.d.ts.map +1 -1
  298. package/dist/document/project.js.map +1 -1
  299. package/dist/document/registry.d.ts +17 -0
  300. package/dist/document/registry.d.ts.map +1 -1
  301. package/dist/document/registry.js +29 -2
  302. package/dist/document/registry.js.map +1 -1
  303. package/dist/document/timeline-patch.js.map +1 -1
  304. package/dist/document/timeline.d.ts +73 -18
  305. package/dist/document/timeline.d.ts.map +1 -1
  306. package/dist/document/timeline.js +192 -40
  307. package/dist/document/timeline.js.map +1 -1
  308. package/dist/document/types.d.ts +12 -12
  309. package/dist/document/types.d.ts.map +1 -1
  310. package/dist/document/types.js +2 -2
  311. package/dist/document/types.js.map +1 -1
  312. package/dist/document/validate.d.ts +2 -2
  313. package/dist/document/validate.d.ts.map +1 -1
  314. package/dist/document/validate.js +37 -31
  315. package/dist/document/validate.js.map +1 -1
  316. package/dist/document/withdraw.d.ts +28 -0
  317. package/dist/document/withdraw.d.ts.map +1 -0
  318. package/dist/document/withdraw.js +61 -0
  319. package/dist/document/withdraw.js.map +1 -0
  320. package/dist/index.d.ts +1 -0
  321. package/dist/index.d.ts.map +1 -1
  322. package/dist/index.js +1 -0
  323. package/dist/index.js.map +1 -1
  324. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  325. package/dist/jsx/jsx-runtime.d.ts +9 -1
  326. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  327. package/dist/jsx/jsx-runtime.js +13 -3
  328. package/dist/jsx/jsx-runtime.js.map +1 -1
  329. package/dist/layout/bounds.d.ts +0 -1
  330. package/dist/layout/bounds.d.ts.map +1 -1
  331. package/dist/layout/bounds.js.map +1 -1
  332. package/dist/layout/constraints.js.map +1 -1
  333. package/dist/layout/flex.d.ts +4 -2
  334. package/dist/layout/flex.d.ts.map +1 -1
  335. package/dist/layout/flex.js +27 -11
  336. package/dist/layout/flex.js.map +1 -1
  337. package/dist/layout/freeform.js.map +1 -1
  338. package/dist/layout/grid.js.map +1 -1
  339. package/dist/layout/index.js.map +1 -1
  340. package/dist/layout/item.js.map +1 -1
  341. package/dist/layout/ops.d.ts +6 -0
  342. package/dist/layout/ops.d.ts.map +1 -1
  343. package/dist/layout/ops.js +6 -0
  344. package/dist/layout/ops.js.map +1 -1
  345. package/dist/layout/types.js.map +1 -1
  346. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  347. package/dist/nodes/2d/node-motion.js.map +1 -1
  348. package/dist/nodes/2d/node-render.d.ts +3 -3
  349. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  350. package/dist/nodes/2d/node-render.js.map +1 -1
  351. package/dist/nodes/2d/node-transform.js.map +1 -1
  352. package/dist/nodes/2d/node2d.d.ts +115 -3
  353. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  354. package/dist/nodes/2d/node2d.js +180 -28
  355. package/dist/nodes/2d/node2d.js.map +1 -1
  356. package/dist/nodes/2d/paint-node.d.ts +27 -0
  357. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  358. package/dist/nodes/2d/paint-node.js +42 -0
  359. package/dist/nodes/2d/paint-node.js.map +1 -1
  360. package/dist/nodes/audio/audio-bus.js.map +1 -1
  361. package/dist/nodes/audio/index.js.map +1 -1
  362. package/dist/nodes/audio/node-audio.js.map +1 -1
  363. package/dist/nodes/audio/sound-node.d.ts +2 -2
  364. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  365. package/dist/nodes/audio/sound-node.js +1 -1
  366. package/dist/nodes/audio/sound-node.js.map +1 -1
  367. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  368. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  369. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  370. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  371. package/dist/nodes/geometry/box-path-node.js +2 -2
  372. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  373. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  374. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  375. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  376. package/dist/nodes/geometry/group-bounds.js +1 -2
  377. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  378. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  379. package/dist/nodes/geometry/path-node.js +6 -0
  380. package/dist/nodes/geometry/path-node.js.map +1 -1
  381. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  382. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  383. package/dist/nodes/geometry/rect-node.js.map +1 -1
  384. package/dist/nodes/geometry/shape-node.js.map +1 -1
  385. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  386. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  387. package/dist/nodes/geometry/shape-outline.js +2 -13
  388. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  389. package/dist/nodes/index.d.ts +3 -8
  390. package/dist/nodes/index.d.ts.map +1 -1
  391. package/dist/nodes/index.js +3 -8
  392. package/dist/nodes/index.js.map +1 -1
  393. package/dist/nodes/layout/camera-node.d.ts +9 -0
  394. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  395. package/dist/nodes/layout/camera-node.js +38 -3
  396. package/dist/nodes/layout/camera-node.js.map +1 -1
  397. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  398. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  399. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  400. package/dist/nodes/layout/rotated-box.js.map +1 -1
  401. package/dist/nodes/media/video-node.d.ts.map +1 -1
  402. package/dist/nodes/media/video-node.js +2 -0
  403. package/dist/nodes/media/video-node.js.map +1 -1
  404. package/dist/nodes/node/declare-paints.js.map +1 -1
  405. package/dist/nodes/node/node-editor-state.js.map +1 -1
  406. package/dist/nodes/node/node-reactive.js.map +1 -1
  407. package/dist/nodes/node/node-time.d.ts +3 -3
  408. package/dist/nodes/node/node-time.d.ts.map +1 -1
  409. package/dist/nodes/node/node-time.js +1 -1
  410. package/dist/nodes/node/node-time.js.map +1 -1
  411. package/dist/nodes/node/node-walk.js.map +1 -1
  412. package/dist/nodes/node/node.d.ts +5 -3
  413. package/dist/nodes/node/node.d.ts.map +1 -1
  414. package/dist/nodes/node/node.js +44 -19
  415. package/dist/nodes/node/node.js.map +1 -1
  416. package/dist/nodes/node/text-defaults.d.ts +10 -12
  417. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  418. package/dist/nodes/node/text-defaults.js +10 -12
  419. package/dist/nodes/node/text-defaults.js.map +1 -1
  420. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  421. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  422. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  423. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  424. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  425. package/dist/nodes/root/provider-node.js.map +1 -0
  426. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  427. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  428. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  429. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  430. package/dist/nodes/text/default-text-style-node.js +10 -4
  431. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  432. package/dist/nodes/text/number-format.d.ts +1 -1
  433. package/dist/nodes/text/number-format.js +1 -1
  434. package/dist/nodes/text/number-format.js.map +1 -1
  435. package/dist/nodes/text/number-node.js.map +1 -1
  436. package/dist/nodes/text/number-pattern.js.map +1 -1
  437. package/dist/nodes/text/richtext-node.js +1 -1
  438. package/dist/nodes/text/richtext-node.js.map +1 -1
  439. package/dist/nodes/text/text-base.d.ts.map +1 -1
  440. package/dist/nodes/text/text-base.js +1 -1
  441. package/dist/nodes/text/text-base.js.map +1 -1
  442. package/dist/nodes/text/text-node.js.map +1 -1
  443. package/dist/nodes/text/text-selection.js.map +1 -1
  444. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  445. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  446. package/dist/nodes/three/camera-nodes.js +42 -1
  447. package/dist/nodes/three/camera-nodes.js.map +1 -1
  448. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  449. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  450. package/dist/nodes/three/canvas3d-node.js +44 -2
  451. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  452. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  453. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  454. package/dist/nodes/three/drawable-nodes.js +43 -13
  455. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  456. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  457. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/environment-nodes.js.map +1 -1
  459. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  460. package/dist/nodes/three/geometry-nodes.js +2 -2
  461. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  462. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  463. package/dist/nodes/three/group3d.js.map +1 -1
  464. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  465. package/dist/nodes/three/light-nodes.js +3 -3
  466. package/dist/nodes/three/light-nodes.js.map +1 -1
  467. package/dist/nodes/three/mesh3d.js.map +1 -1
  468. package/dist/nodes/three/node3d.d.ts +48 -0
  469. package/dist/nodes/three/node3d.d.ts.map +1 -1
  470. package/dist/nodes/three/node3d.js +53 -3
  471. package/dist/nodes/three/node3d.js.map +1 -1
  472. package/dist/platform/audio-sink.d.ts +2 -2
  473. package/dist/platform/audio-sink.d.ts.map +1 -1
  474. package/dist/platform/audio-sink.js.map +1 -1
  475. package/dist/platform/exporter.d.ts +13 -8
  476. package/dist/platform/exporter.d.ts.map +1 -1
  477. package/dist/platform/exporter.js.map +1 -1
  478. package/dist/platform/index.d.ts +1 -1
  479. package/dist/platform/index.d.ts.map +1 -1
  480. package/dist/platform/index.js.map +1 -1
  481. package/dist/platform/stepped-clock.js.map +1 -1
  482. package/dist/platform/storage-adapter.d.ts +12 -6
  483. package/dist/platform/storage-adapter.d.ts.map +1 -1
  484. package/dist/platform/storage-adapter.js +4 -0
  485. package/dist/platform/storage-adapter.js.map +1 -1
  486. package/dist/platform/ticker.d.ts +6 -0
  487. package/dist/platform/ticker.d.ts.map +1 -1
  488. package/dist/platform/ticker.js +6 -0
  489. package/dist/platform/ticker.js.map +1 -1
  490. package/dist/project/config.js.map +1 -1
  491. package/dist/project/index.js.map +1 -1
  492. package/dist/project/tree.d.ts +3 -3
  493. package/dist/project/tree.d.ts.map +1 -1
  494. package/dist/project/tree.js.map +1 -1
  495. package/dist/props/host.js.map +1 -1
  496. package/dist/props/index.js.map +1 -1
  497. package/dist/props/observer.js.map +1 -1
  498. package/dist/props/slot.js.map +1 -1
  499. package/dist/renamed-scene-names.d.ts +17 -0
  500. package/dist/renamed-scene-names.d.ts.map +1 -0
  501. package/dist/renamed-scene-names.js +9 -0
  502. package/dist/renamed-scene-names.js.map +1 -0
  503. package/dist/render/canvas-render-context2d.d.ts +2 -2
  504. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  505. package/dist/render/canvas-render-context2d.js.map +1 -1
  506. package/dist/render/clip-contains.js.map +1 -1
  507. package/dist/render/clip.js.map +1 -1
  508. package/dist/render/descriptors/ellipse.js.map +1 -1
  509. package/dist/render/descriptors/latex.js.map +1 -1
  510. package/dist/render/descriptors/line.js.map +1 -1
  511. package/dist/render/descriptors/path-builder.js.map +1 -1
  512. package/dist/render/descriptors/path.js.map +1 -1
  513. package/dist/render/descriptors/polygon.js.map +1 -1
  514. package/dist/render/descriptors/polygram.js.map +1 -1
  515. package/dist/render/descriptors/rect.js.map +1 -1
  516. package/dist/render/descriptors/richtext.js.map +1 -1
  517. package/dist/render/descriptors/shape.d.ts +12 -0
  518. package/dist/render/descriptors/shape.d.ts.map +1 -1
  519. package/dist/render/descriptors/shape.js.map +1 -1
  520. package/dist/render/descriptors/text.d.ts +2 -2
  521. package/dist/render/descriptors/text.js +2 -2
  522. package/dist/render/descriptors/text.js.map +1 -1
  523. package/dist/render/descriptors/transform.d.ts +2 -2
  524. package/dist/render/descriptors/transform.d.ts.map +1 -1
  525. package/dist/render/descriptors/transform.js.map +1 -1
  526. package/dist/render/graphics2d.d.ts +3 -3
  527. package/dist/render/graphics2d.d.ts.map +1 -1
  528. package/dist/render/graphics2d.js +1 -1
  529. package/dist/render/graphics2d.js.map +1 -1
  530. package/dist/render/index.js.map +1 -1
  531. package/dist/render/measure-context.js.map +1 -1
  532. package/dist/render/null-render-context.js.map +1 -1
  533. package/dist/render/render-context2d.d.ts +2 -2
  534. package/dist/render/render-context2d.d.ts.map +1 -1
  535. package/dist/render/render-context2d.js.map +1 -1
  536. package/dist/render/surface.js.map +1 -1
  537. package/dist/render/text-defaults.js.map +1 -1
  538. package/dist/render/text-layout.js.map +1 -1
  539. package/dist/render3d/bounds3d.d.ts.map +1 -1
  540. package/dist/render3d/bounds3d.js +4 -2
  541. package/dist/render3d/bounds3d.js.map +1 -1
  542. package/dist/render3d/builders.js.map +1 -1
  543. package/dist/render3d/camera.d.ts +6 -0
  544. package/dist/render3d/camera.d.ts.map +1 -1
  545. package/dist/render3d/camera.js +5 -3
  546. package/dist/render3d/camera.js.map +1 -1
  547. package/dist/render3d/fill3d.d.ts +2 -9
  548. package/dist/render3d/fill3d.d.ts.map +1 -1
  549. package/dist/render3d/fill3d.js +2 -13
  550. package/dist/render3d/fill3d.js.map +1 -1
  551. package/dist/render3d/geometry.d.ts +8 -1
  552. package/dist/render3d/geometry.d.ts.map +1 -1
  553. package/dist/render3d/geometry.js.map +1 -1
  554. package/dist/render3d/graphics3d.d.ts +8 -4
  555. package/dist/render3d/graphics3d.d.ts.map +1 -1
  556. package/dist/render3d/graphics3d.js +18 -10
  557. package/dist/render3d/graphics3d.js.map +1 -1
  558. package/dist/render3d/index.d.ts +1 -1
  559. package/dist/render3d/index.js +1 -1
  560. package/dist/render3d/index.js.map +1 -1
  561. package/dist/render3d/inert.d.ts +14 -0
  562. package/dist/render3d/inert.d.ts.map +1 -0
  563. package/dist/render3d/inert.js +62 -0
  564. package/dist/render3d/inert.js.map +1 -0
  565. package/dist/render3d/light.js.map +1 -1
  566. package/dist/render3d/material.d.ts +10 -5
  567. package/dist/render3d/material.d.ts.map +1 -1
  568. package/dist/render3d/material.js.map +1 -1
  569. package/dist/render3d/matrix4.js.map +1 -1
  570. package/dist/render3d/render-context3d.js.map +1 -1
  571. package/dist/render3d/resources.js.map +1 -1
  572. package/dist/render3d/rounded-box.js.map +1 -1
  573. package/dist/render3d/scene-settings.d.ts +23 -4
  574. package/dist/render3d/scene-settings.d.ts.map +1 -1
  575. package/dist/render3d/scene-settings.js.map +1 -1
  576. package/dist/render3d/scene3d.d.ts +11 -0
  577. package/dist/render3d/scene3d.d.ts.map +1 -1
  578. package/dist/render3d/scene3d.js +39 -6
  579. package/dist/render3d/scene3d.js.map +1 -1
  580. package/dist/render3d/segments.js.map +1 -1
  581. package/dist/render3d/texture.d.ts +9 -0
  582. package/dist/render3d/texture.d.ts.map +1 -1
  583. package/dist/render3d/texture.js +13 -0
  584. package/dist/render3d/texture.js.map +1 -1
  585. package/dist/render3d/tracking.js.map +1 -1
  586. package/dist/render3d/transform.d.ts +1 -1
  587. package/dist/render3d/transform.js.map +1 -1
  588. package/dist/render3d/vector3.d.ts +18 -1
  589. package/dist/render3d/vector3.d.ts.map +1 -1
  590. package/dist/render3d/vector3.js +27 -0
  591. package/dist/render3d/vector3.js.map +1 -1
  592. package/dist/render3d/walk.d.ts +1 -1
  593. package/dist/render3d/walk.d.ts.map +1 -1
  594. package/dist/render3d/walk.js +5 -1
  595. package/dist/render3d/walk.js.map +1 -1
  596. package/dist/runtime/asset-refine.js.map +1 -1
  597. package/dist/runtime/asset-timeline.js.map +1 -1
  598. package/dist/runtime/asset-update.js.map +1 -1
  599. package/dist/runtime/audio-index.js.map +1 -1
  600. package/dist/runtime/builtin-context.js.map +1 -1
  601. package/dist/runtime/clip-instance.d.ts +5 -3
  602. package/dist/runtime/clip-instance.d.ts.map +1 -1
  603. package/dist/runtime/clip-instance.js +10 -6
  604. package/dist/runtime/clip-instance.js.map +1 -1
  605. package/dist/runtime/clip-store.d.ts +9 -0
  606. package/dist/runtime/clip-store.d.ts.map +1 -1
  607. package/dist/runtime/clip-store.js +19 -0
  608. package/dist/runtime/clip-store.js.map +1 -1
  609. package/dist/runtime/engine.d.ts +5 -0
  610. package/dist/runtime/engine.d.ts.map +1 -1
  611. package/dist/runtime/engine.js +2 -0
  612. package/dist/runtime/engine.js.map +1 -1
  613. package/dist/runtime/frame-time.d.ts +31 -0
  614. package/dist/runtime/frame-time.d.ts.map +1 -0
  615. package/dist/runtime/frame-time.js +29 -0
  616. package/dist/runtime/frame-time.js.map +1 -0
  617. package/dist/runtime/index.d.ts +1 -0
  618. package/dist/runtime/index.d.ts.map +1 -1
  619. package/dist/runtime/index.js +1 -0
  620. package/dist/runtime/index.js.map +1 -1
  621. package/dist/runtime/node-picking.d.ts +44 -3
  622. package/dist/runtime/node-picking.d.ts.map +1 -1
  623. package/dist/runtime/node-picking.js +118 -3
  624. package/dist/runtime/node-picking.js.map +1 -1
  625. package/dist/runtime/node-picking3d.d.ts +2 -1
  626. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  627. package/dist/runtime/node-picking3d.js +5 -2
  628. package/dist/runtime/node-picking3d.js.map +1 -1
  629. package/dist/runtime/placement.d.ts.map +1 -1
  630. package/dist/runtime/placement.js +4 -5
  631. package/dist/runtime/placement.js.map +1 -1
  632. package/dist/runtime/playback-controller.d.ts +31 -2
  633. package/dist/runtime/playback-controller.d.ts.map +1 -1
  634. package/dist/runtime/playback-controller.js +63 -6
  635. package/dist/runtime/playback-controller.js.map +1 -1
  636. package/dist/runtime/playback.js.map +1 -1
  637. package/dist/runtime/precompisition.js.map +1 -1
  638. package/dist/runtime/project-assets.js.map +1 -1
  639. package/dist/runtime/session.d.ts +9 -7
  640. package/dist/runtime/session.d.ts.map +1 -1
  641. package/dist/runtime/session.js +12 -4
  642. package/dist/runtime/session.js.map +1 -1
  643. package/dist/runtime/settle.js.map +1 -1
  644. package/dist/runtime/state-evaluator.d.ts +1 -1
  645. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  646. package/dist/runtime/state-evaluator.js +4 -3
  647. package/dist/runtime/state-evaluator.js.map +1 -1
  648. package/dist/runtime/text-geometry.js.map +1 -1
  649. package/dist/sdk/index.d.ts +19 -15
  650. package/dist/sdk/index.d.ts.map +1 -1
  651. package/dist/sdk/index.js +11 -6
  652. package/dist/sdk/index.js.map +1 -1
  653. package/dist/tween/command-decorator.d.ts +2 -0
  654. package/dist/tween/command-decorator.d.ts.map +1 -1
  655. package/dist/tween/command-decorator.js.map +1 -1
  656. package/dist/tween/command.js.map +1 -1
  657. package/dist/tween/ease/constants.d.ts.map +1 -1
  658. package/dist/tween/ease/constants.js +8 -5
  659. package/dist/tween/ease/constants.js.map +1 -1
  660. package/dist/tween/ease/curve.d.ts.map +1 -1
  661. package/dist/tween/ease/curve.js +4 -3
  662. package/dist/tween/ease/curve.js.map +1 -1
  663. package/dist/tween/ease/describe.d.ts +15 -0
  664. package/dist/tween/ease/describe.d.ts.map +1 -0
  665. package/dist/tween/ease/describe.js +37 -0
  666. package/dist/tween/ease/describe.js.map +1 -0
  667. package/dist/tween/ease/type.js.map +1 -1
  668. package/dist/tween/index.js.map +1 -1
  669. package/dist/tween/inert.js.map +1 -1
  670. package/dist/tween/lerp.js.map +1 -1
  671. package/dist/tween/loop.js.map +1 -1
  672. package/dist/tween/prepare.d.ts +3 -3
  673. package/dist/tween/prepare.js +3 -3
  674. package/dist/tween/prepare.js.map +1 -1
  675. package/dist/tween/seekable.d.ts +1 -1
  676. package/dist/tween/seekable.js.map +1 -1
  677. package/dist/tween/stepper.js.map +1 -1
  678. package/dist/tween/to-command.js.map +1 -1
  679. package/dist/util/clamp.js.map +1 -1
  680. package/dist/util/context.js.map +1 -1
  681. package/dist/util/csv.js.map +1 -1
  682. package/dist/util/generateList.js.map +1 -1
  683. package/dist/util/index.js.map +1 -1
  684. package/dist/util/metrics.d.ts +1 -1
  685. package/dist/util/metrics.js +1 -1
  686. package/dist/util/metrics.js.map +1 -1
  687. package/dist/util/random.js.map +1 -1
  688. package/dist/util/reference.js.map +1 -1
  689. package/dist/util/scheduler.js.map +1 -1
  690. package/package.json +2 -1
  691. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  692. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  693. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  694. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  695. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  696. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  697. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  698. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  699. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  700. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  701. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  702. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  703. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  704. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  705. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  706. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  707. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  708. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  709. package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
  710. package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
  711. package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
  712. package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
  713. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  714. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  715. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  716. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  717. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  718. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  719. package/dist/nodes/geometry/grid-lines.js +0 -128
  720. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  721. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  722. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  723. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  724. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  725. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  726. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  727. package/dist/nodes/geometry/line-grid-node.js +0 -127
  728. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  729. package/dist/nodes/geometry/line-node.d.ts +0 -58
  730. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  731. package/dist/nodes/geometry/line-node.js +0 -123
  732. package/dist/nodes/geometry/line-node.js.map +0 -1
  733. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  734. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  735. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  736. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  737. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  738. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  739. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  740. package/dist/nodes/scene/provider-node.js.map +0 -1
  741. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  742. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  743. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  744. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  745. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  746. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../../src/platform/ticker.ts"],"names":[],"mappings":"AAAA,0JAA0J;AAC1J,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,I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GAA+G;cAC/F,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,wDAAwD;IACxD,KAAK,IAAI,IAAI;IAKb,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAE9B,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAC7C,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAC7C,SAAS,CAAC,cAAc,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAM;IAC9C,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAE7C,6FAA6F;IAC7F,OAAO;IAOP,MAAM,CAAC,QAAQ,EAAE,YAAY;IAI7B,MAAM,CAAC,QAAQ,EAAE,YAAY;IAI7B,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI;IAI5B,MAAM,CAAC,QAAQ,EAAE,YAAY;CAGhC"}
@@ -12,6 +12,12 @@
12
12
  * 2. Register listeners via `onTick` / `onPlay` / `onPause` / `onTime`.
13
13
  * 3. Call `play`, `pause`, or `seek` to control playback.
14
14
  * 4. Call `dispose` when the clock is no longer needed to prevent leaks.
15
+ *
16
+ * `play`, `pause` and `seek` take effect before they return, so any order of them
17
+ * in one turn leaves the clock where the last one put it. A time listener or tick
18
+ * callback may `seek` (a host looping wraps to the start when it hears the end), and
19
+ * a subclass must read the end of a run again afterwards. At the end of a run it
20
+ * reports a final tick and pauses.
15
21
  */
16
22
  export class Ticker {
17
23
  _isPlaying = false;
@@ -1 +1 @@
1
- {"version":3,"file":"ticker.js","sourceRoot":"","sources":["../../src/platform/ticker.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAgB,MAAM;IAChB,UAAU,GAAY,KAAK,CAAC;IAC5B,YAAY,GAAW,CAAC,CAAC;IACvB,SAAS,GAAW,CAAC,CAAC;IAEhC,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3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AE,CAAC;IACnC,aAAa,GAAmB,EAAE,CAAC;IACnC,cAAc,GAAmB,EAAE,CAAC;IACpC,aAAa,GAAmB,EAAE,CAAC;IAE7C,6FAA6F;IAC7F,OAAO;QACH,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,QAAoB;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACJ","sourcesContent":["/** Called every animation frame with the current playhead time (seconds). Must return a Promise so the clock can await all renderers before advancing. */\nexport type TickCallback = (time: number) => Promise<void>;\n\n/** Fired when playback starts. Receives the time at which playback began, the playback speed multiplier, and whether playback is reversed. */\nexport type PlayCallback = (time: number, speed: number, reverse: boolean) => void;\n\n/**\n * Fired when the playhead reaches a new frame.\n *\n * Once per frame, not once per animation frame — see\n * {@link Ticker.setCurrentTime}. A subclass advancing its clock faster than\n * the project's frame rate (which every rAF-driven one does on a high-refresh\n * display) keeps the extra positions to itself.\n */\nexport type TimeCallback = (time: number) => void;\n\n/**\n * Platform-agnostic base class for driving animation playback.\n *\n * Subclasses implement the actual frame loop (e.g. requestAnimationFrame in the\n * browser, a setInterval loop in Node) and call `setCurrentTime` / `tick` each\n * frame. `Ticker` owns the subscriber lists and the shared playback state\n * so that renderers and UI controls can coordinate without knowing about each\n * other.\n *\n * Lifecycle:\n * 1. Set total duration with `setDuration`.\n * 2. Register listeners via `onTick` / `onPlay` / `onPause` / `onTime`.\n * 3. Call `play`, `pause`, or `seek` to control playback.\n * 4. Call `dispose` when the clock is no longer needed to prevent leaks.\n */\nexport abstract class Ticker {\n private _isPlaying: boolean = false;\n private _currentTime: number = 0;\n protected _duration: number = 0;\n\n get isPlaying(): boolean {\n return this._isPlaying;\n }\n\n /** Current playhead position in seconds. */\n get currentTime(): number {\n return this._currentTime;\n }\n\n /** Total animation duration in seconds. */\n get duration(): number {\n return this._duration;\n }\n\n setDuration(duration: number): void {\n this._duration = duration;\n }\n\n /**\n * Updates the playhead and notifies time listeners. No-ops if the time hasn't\n * changed.\n *\n * `notify` exists because the two halves of that sentence want different\n * rates. The playhead itself has to be exact — `pause` and `play` anchor\n * their elapsed-time maths on it, so it is advanced on every frame of the\n * subclass's loop — while a *listener* is a host drawing a timecode or\n * seeking a renderer, and neither can do anything with a position that has\n * not reached the next frame yet.\n *\n * Passing `false` therefore keeps the clock exact and the subscribers quiet.\n * A subclass that knows its frame rate uses it to fire {@link onTime} once\n * per frame rather than once per animation frame; on a 144Hz display those\n * are not the same number, and the difference was landing on hosts as a React\n * render per refresh to drive a 60fps render.\n */\n protected setCurrentTime(t: number, notify: boolean = true): void {\n if (this._currentTime === t) return;\n this._currentTime = t;\n if (!notify) return;\n for (const cb of this.timeCallbacks) cb(t);\n }\n\n protected setPlaying(playing: boolean): void {\n this._isPlaying = playing;\n }\n\n /** Starts playback at the given speed and direction, notifying all play listeners. */\n play(speed: number, reverse: boolean): void {\n this._isPlaying = true;\n for (const cb of this.playCallbacks) cb(this._currentTime, speed, reverse);\n }\n\n /** Awaits all tick callbacks in parallel. Subclasses call this once per frame after updating `currentTime`. */\n protected async tick(): Promise<void> {\n await Promise.all(this.tickCallbacks.map(c => c(this._currentTime)));\n }\n\n /** Pauses playback and notifies all pause listeners. */\n pause(): void {\n this._isPlaying = false;\n for (const cb of this.pauseCallbacks) cb();\n }\n\n /** Moves the playhead to `t` (seconds). Subclasses decide whether this also triggers a tick. */\n abstract seek(t: number): void;\n\n protected tickCallbacks: TickCallback[] = [];\n protected playCallbacks: PlayCallback[] = [];\n protected pauseCallbacks: (() => void)[] = [];\n protected timeCallbacks: TimeCallback[] = [];\n\n /** Clears all registered callbacks. Call when tearing down a scene to avoid memory leaks. */\n dispose() {\n this.tickCallbacks.length = 0;\n this.playCallbacks.length = 0;\n this.pauseCallbacks.length = 0;\n this.timeCallbacks.length = 0;\n }\n\n onTick(callback: TickCallback) {\n this.tickCallbacks.push(callback);\n }\n\n onPlay(callback: PlayCallback) {\n this.playCallbacks.push(callback);\n }\n\n onPause(callback: () => void) {\n this.pauseCallbacks.push(callback);\n }\n\n onTime(callback: TimeCallback) {\n this.timeCallbacks.push(callback);\n }\n}\n"]}
1
+ {"version":3,"file":"ticker.js","sourceRoot":"","sources":["../../src/platform/ticker.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAgB,MAAM;IAChB,UAAU,GAAY,KAAK,CAAC;IAC5B,YAAY,GAAW,CAAC,CAAC;IACvB,SAAS,GAAW,CAAC,CAAC;IAEhC,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,4CAA4C;IAC5C,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,2CAA2C;IAC3C,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,WAAW,CAAC,QAAgB;QACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACO,cAAc,CAAC,CAAS,EAAE,SAAkB,IAAI;QACtD,IAAI,IAAI,CAAC,YAAY,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ClC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,QAAoB;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACJ","sourcesContent":["/** Called every animation frame with the current playhead time (seconds). Must return a Promise so the clock can await all renderers before advancing. */\r\nexport type TickCallback = (time: number) => Promise<void>;\r\n\r\n/** Fired when playback starts. Receives the time at which playback began, the playback speed multiplier, and whether playback is reversed. */\r\nexport type PlayCallback = (time: number, speed: number, reverse: boolean) => void;\r\n\r\n/**\r\n * Fired when the playhead reaches a new frame.\r\n *\r\n * Once per frame, not once per animation frame — see\r\n * {@link Ticker.setCurrentTime}. A subclass advancing its clock faster than\r\n * the project's frame rate (which every rAF-driven one does on a high-refresh\r\n * display) keeps the extra positions to itself.\r\n */\r\nexport type TimeCallback = (time: number) => void;\r\n\r\n/**\r\n * Platform-agnostic base class for driving animation playback.\r\n *\r\n * Subclasses implement the actual frame loop (e.g. requestAnimationFrame in the\r\n * browser, a setInterval loop in Node) and call `setCurrentTime` / `tick` each\r\n * frame. `Ticker` owns the subscriber lists and the shared playback state\r\n * so that renderers and UI controls can coordinate without knowing about each\r\n * other.\r\n *\r\n * Lifecycle:\r\n * 1. Set total duration with `setDuration`.\r\n * 2. Register listeners via `onTick` / `onPlay` / `onPause` / `onTime`.\r\n * 3. Call `play`, `pause`, or `seek` to control playback.\r\n * 4. Call `dispose` when the clock is no longer needed to prevent leaks.\r\n *\r\n * `play`, `pause` and `seek` take effect before they return, so any order of them\r\n * in one turn leaves the clock where the last one put it. A time listener or tick\r\n * callback may `seek` (a host looping wraps to the start when it hears the end), and\r\n * a subclass must read the end of a run again afterwards. At the end of a run it\r\n * reports a final tick and pauses.\r\n */\r\nexport abstract class Ticker {\r\n private _isPlaying: boolean = false;\r\n private _currentTime: number = 0;\r\n protected _duration: number = 0;\r\n\r\n get isPlaying(): boolean {\r\n return this._isPlaying;\r\n }\r\n\r\n /** Current playhead position in seconds. */\r\n get currentTime(): number {\r\n return this._currentTime;\r\n }\r\n\r\n /** Total animation duration in seconds. */\r\n get duration(): number {\r\n return this._duration;\r\n }\r\n\r\n setDuration(duration: number): void {\r\n this._duration = duration;\r\n }\r\n\r\n /**\r\n * Updates the playhead and notifies time listeners. No-ops if the time hasn't\r\n * changed.\r\n *\r\n * `notify` exists because the two halves of that sentence want different\r\n * rates. The playhead itself has to be exact — `pause` and `play` anchor\r\n * their elapsed-time maths on it, so it is advanced on every frame of the\r\n * subclass's loop — while a *listener* is a host drawing a timecode or\r\n * seeking a renderer, and neither can do anything with a position that has\r\n * not reached the next frame yet.\r\n *\r\n * Passing `false` therefore keeps the clock exact and the subscribers quiet.\r\n * A subclass that knows its frame rate uses it to fire {@link onTime} once\r\n * per frame rather than once per animation frame; on a 144Hz display those\r\n * are not the same number, and the difference was landing on hosts as a React\r\n * render per refresh to drive a 60fps render.\r\n */\r\n protected setCurrentTime(t: number, notify: boolean = true): void {\r\n if (this._currentTime === t) return;\r\n this._currentTime = t;\r\n if (!notify) return;\r\n for (const cb of this.timeCallbacks) cb(t);\r\n }\r\n\r\n protected setPlaying(playing: boolean): void {\r\n this._isPlaying = playing;\r\n }\r\n\r\n /** Starts playback at the given speed and direction, notifying all play listeners. */\r\n play(speed: number, reverse: boolean): void {\r\n this._isPlaying = true;\r\n for (const cb of this.playCallbacks) cb(this._currentTime, speed, reverse);\r\n }\r\n\r\n /** Awaits all tick callbacks in parallel. Subclasses call this once per frame after updating `currentTime`. */\r\n protected async tick(): Promise<void> {\r\n await Promise.all(this.tickCallbacks.map(c => c(this._currentTime)));\r\n }\r\n\r\n /** Pauses playback and notifies all pause listeners. */\r\n pause(): void {\r\n this._isPlaying = false;\r\n for (const cb of this.pauseCallbacks) cb();\r\n }\r\n\r\n /** Moves the playhead to `t` (seconds). Subclasses decide whether this also triggers a tick. */\r\n abstract seek(t: number): void;\r\n\r\n protected tickCallbacks: TickCallback[] = [];\r\n protected playCallbacks: PlayCallback[] = [];\r\n protected pauseCallbacks: (() => void)[] = [];\r\n protected timeCallbacks: TimeCallback[] = [];\r\n\r\n /** Clears all registered callbacks. Call when tearing down a scene to avoid memory leaks. */\r\n dispose() {\r\n this.tickCallbacks.length = 0;\r\n this.playCallbacks.length = 0;\r\n this.pauseCallbacks.length = 0;\r\n this.timeCallbacks.length = 0;\r\n }\r\n\r\n onTick(callback: TickCallback) {\r\n this.tickCallbacks.push(callback);\r\n }\r\n\r\n onPlay(callback: PlayCallback) {\r\n this.playCallbacks.push(callback);\r\n }\r\n\r\n onPause(callback: () => void) {\r\n this.pauseCallbacks.push(callback);\r\n }\r\n\r\n onTime(callback: TimeCallback) {\r\n this.timeCallbacks.push(callback);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"","sourcesContent":["import { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type { TextStyle } from \"@/attributes/text/types\";\n\n/** A color token: a resolvable {@link Color}, or a nested group of them. Groups\n * flatten to dash-joined names — `{ brand: { 500: … } }` → `brand-500`. */\nexport type ColorToken = Color | ColorGroup;\nexport interface ColorGroup { [key: string]: ColorToken; }\n\n/** Named color tokens, possibly nested into groups. Referenced by their\n * (flattened) name in any `fill`/`stroke` string. */\nexport type ColorTokens = Record<string, ColorToken>;\n\n/** A named text-style preset referenced by a `Text`/`RichText` `variant` prop.\n * Each field it sets supplies that style key to a variant'd node (unless the\n * author set it explicitly). Same shape as the `<DefaultTextStyle>` defaults. */\nexport type TypographyPreset = TextStyle;\n\n/** Named typography presets, keyed by variant name (e.g. `header`, `body`).\n * The `default` key is reserved: if present, it's applied to every `Text`/\n * `RichText` as a project-wide base style — no `variant` prop or\n * `<DefaultTextStyle>` wrapper needed — for any style key a more specific\n * source (explicit prop, `variant`, inherited `<DefaultTextStyle>`) doesn't\n * set. Declared as an explicit property (rather than folded into the index\n * signature) so editors offer it in autocomplete. */\nexport type Typography = { default?: TypographyPreset } & Record<string, TypographyPreset>;\n\n/** The visual design tokens — color tokens and typography presets. */\nexport interface Theme {\n /** Named color tokens (possibly grouped) for `fill`/`stroke` strings. */\n colors?: ColorTokens;\n /** Named text-style presets selected via a `Text`/`RichText` `variant`. */\n typography?: Typography;\n}\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"","sourcesContent":["import { Color } from \"@/attributes/shape/fill/color/parser\";\r\nimport type { TextStyle } from \"@/attributes/text/types\";\r\n\r\n/** A color token: a resolvable {@link Color}, or a nested group of them. Groups\r\n * flatten to dash-joined names — `{ brand: { 500: … } }` → `brand-500`. */\r\nexport type ColorToken = Color | ColorGroup;\r\nexport interface ColorGroup { [key: string]: ColorToken; }\r\n\r\n/** Named color tokens, possibly nested into groups. Referenced by their\r\n * (flattened) name in any `fill`/`stroke` string. */\r\nexport type ColorTokens = Record<string, ColorToken>;\r\n\r\n/** A named text-style preset referenced by a `Text`/`RichText` `variant` prop.\r\n * Each field it sets supplies that style key to a variant'd node (unless the\r\n * author set it explicitly). Same shape as the `<DefaultTextStyle>` defaults. */\r\nexport type TypographyPreset = TextStyle;\r\n\r\n/** Named typography presets, keyed by variant name (e.g. `header`, `body`).\r\n * The `default` key is reserved: if present, it's applied to every `Text`/\r\n * `RichText` as a project-wide base style — no `variant` prop or\r\n * `<DefaultTextStyle>` wrapper needed — for any style key a more specific\r\n * source (explicit prop, `variant`, inherited `<DefaultTextStyle>`) doesn't\r\n * set. Declared as an explicit property (rather than folded into the index\r\n * signature) so editors offer it in autocomplete. */\r\nexport type Typography = { default?: TypographyPreset } & Record<string, TypographyPreset>;\r\n\r\n/** The visual design tokens — color tokens and typography presets. */\r\nexport interface Theme {\r\n /** Named color tokens (possibly grouped) for `fill`/`stroke` strings. */\r\n colors?: ColorTokens;\r\n /** Named text-style presets selected via a `Text`/`RichText` `variant`. */\r\n typography?: Typography;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC","sourcesContent":["export * from './config';\nexport * from './tree';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC","sourcesContent":["export * from './config';\r\nexport * from './tree';\r\n"]}
@@ -17,16 +17,16 @@ export interface NodeState {
17
17
  }
18
18
  /**
19
19
  * A single audio clip exposed by a node for timeline display. Times are in
20
- * scene seconds; `src` is the (fetchable) audio source path. Nodes that own
20
+ * clip seconds; `src` is the (fetchable) audio source path. Nodes that own
21
21
  * audio — e.g. a Scene with managed sounds — report one entry per play range.
22
22
  */
23
23
  /** @internal */
24
24
  export interface WaveformInfo {
25
25
  /** Fetchable audio source path / URL. */
26
26
  src: string;
27
- /** Scene timestamp (seconds) when the clip starts. */
27
+ /** Clip timestamp (seconds) when the clip starts. */
28
28
  startTime: number;
29
- /** Scene timestamp (seconds) when the clip ends, or null if open-ended. */
29
+ /** Clip timestamp (seconds) when the clip ends, or null if open-ended. */
30
30
  endTime: number | null;
31
31
  }
32
32
  export interface TreeState {
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE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M,WAAW,YAAY;IACzB,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACtB;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,UAAkB;IAC3D,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC;AAClF,CAAC","sourcesContent":["/**\n * Structural key for a node within its scene: the child-index path from the\n * scene root, joined with \".\". The root is \"\". Not every node has an authored id\n * — the children a composite node builds for itself get a UUID apiece — so\n * lifespan tracking keys on this instead, which every node has. The build is\n * deterministic, so the same structural slot maps to the same path in both the\n * precomp pass and playback.\n */\n/** @internal */\nexport function nodePath(parentPath: string, childIndex: number): string {\n return parentPath === \"\" ? String(childIndex) : `${parentPath}.${childIndex}`;\n}\n\n/** @internal */\nexport interface NodeState {\n id: string;\n type: string;\n /** Attribute overrides applied when this state is active. */\n properties: Record<string, any>;\n\n\n}\n\n/**\n * A single audio clip exposed by a node for timeline display. Times are in\n * scene seconds; `src` is the (fetchable) audio source path. Nodes that own\n * audio — e.g. a Scene with managed sounds — report one entry per play range.\n */\n/** @internal */\nexport interface WaveformInfo {\n /** Fetchable audio source path / URL. */\n src: string;\n /** Scene timestamp (seconds) when the clip starts. */\n startTime: number;\n /** Scene timestamp (seconds) when the clip ends, or null if open-ended. */\n endTime: number | null;\n}\n\nexport interface TreeState {\n /**\n * The node's `NodeSpec.id` when it came from a document row, otherwise a\n * per-instance UUID — so it survives a rebuild for an authored node and\n * changes for one a composite built for itself. {@link path} is the key that\n * is stable for both.\n */\n id: string;\n /**\n * Structural path from the scene root (`\"\"` for the root, `\"0.2\"` for the\n * third child of the first). Stable across rebuilds for every node, authored\n * or not, so a host can key selection, expansion, and overrides on it. It is\n * also what `getNodeBox` / `setNodeOverride` accept.\n */\n path: string;\n type: string;\n meta?: Record<string, unknown>;\n /** Audio clips owned by this node, for waveform rendering in the timeline. */\n waveform?: WaveformInfo[];\n /**\n * Absolute timeline frame (across the whole video) at which this node first\n * appears. Undefined when its lifespan is unknown (e.g. no precomp data).\n */\n startFrame?: number;\n /**\n * Absolute timeline frame at which this node was last present. Together with\n * startFrame this bounds the node's track bar to its true lifespan.\n */\n endFrame?: number;\n children: TreeState[];\n}"]}
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,UAAkB;IAC3D,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC;AAClF,CAAC","sourcesContent":["/**\r\n * Structural key for a node within its scene: the child-index path from the\r\n * scene root, joined with \".\". The root is \"\". Not every node has an authored id\r\n * — the children a composite node builds for itself get a UUID apiece — so\r\n * lifespan tracking keys on this instead, which every node has. The build is\r\n * deterministic, so the same structural slot maps to the same path in both the\r\n * precomp pass and playback.\r\n */\r\n/** @internal */\r\nexport function nodePath(parentPath: string, childIndex: number): string {\r\n return parentPath === \"\" ? String(childIndex) : `${parentPath}.${childIndex}`;\r\n}\r\n\r\n/** @internal */\r\nexport interface NodeState {\r\n id: string;\r\n type: string;\r\n /** Attribute overrides applied when this state is active. */\r\n properties: Record<string, any>;\r\n\r\n\r\n}\r\n\r\n/**\r\n * A single audio clip exposed by a node for timeline display. Times are in\r\n * clip seconds; `src` is the (fetchable) audio source path. Nodes that own\r\n * audio — e.g. a Scene with managed sounds — report one entry per play range.\r\n */\r\n/** @internal */\r\nexport interface WaveformInfo {\r\n /** Fetchable audio source path / URL. */\r\n src: string;\r\n /** Clip timestamp (seconds) when the clip starts. */\r\n startTime: number;\r\n /** Clip timestamp (seconds) when the clip ends, or null if open-ended. */\r\n endTime: number | null;\r\n}\r\n\r\nexport interface TreeState {\r\n /**\r\n * The node's `NodeSpec.id` when it came from a document row, otherwise a\r\n * per-instance UUID — so it survives a rebuild for an authored node and\r\n * changes for one a composite built for itself. {@link path} is the key that\r\n * is stable for both.\r\n */\r\n id: string;\r\n /**\r\n * Structural path from the scene root (`\"\"` for the root, `\"0.2\"` for the\r\n * third child of the first). Stable across rebuilds for every node, authored\r\n * or not, so a host can key selection, expansion, and overrides on it. It is\r\n * also what `getNodeBox` / `setNodeOverride` accept.\r\n */\r\n path: string;\r\n type: string;\r\n meta?: Record<string, unknown>;\r\n /** Audio clips owned by this node, for waveform rendering in the timeline. */\r\n waveform?: WaveformInfo[];\r\n /**\r\n * Absolute timeline frame (across the whole video) at which this node first\r\n * appears. Undefined when its lifespan is unknown (e.g. no precomp data).\r\n */\r\n startFrame?: number;\r\n /**\r\n * Absolute timeline frame at which this node was last present. Together with\r\n * startFrame this bounds the node's track bar to its true lifespan.\r\n */\r\n endFrame?: number;\r\n children: TreeState[];\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/props/host.ts"],"names":[],"mappings":"AAgCA,gBAAgB;AAChB,MAAM,UAAU,WAAW,CAAC,GAAa,EAAE,IAAY;IACnD,OAAO,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,WAAW,CAAC,GAAa;IACrC,OAAO,GAAG,CAAC,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import { PropSlot } from \"./slot\";\n\n/** @internal */\nexport type TweenFn<T> = (from: T, to: T, t: number) => T;\n\n/**\n * The slots behind an object's `@property`-declared fields, plus the per-field\n * metadata `set()` and `to()` route through.\n *\n * One object rather than three loose maps on the host, because the host is a\n * `Node` and every public field it carries is published API. Grouping them\n * means a node exposes one internal name instead of three, and gives the thing\n * a name a reader can look up.\n *\n * @internal\n */\nexport interface PropCells {\n /** Field → its live slot. Present for every registered prop. */\n slots: Map<string, PropSlot<any>>;\n /** Field → how it interpolates, for props a numeric lerp cannot cover. */\n tweens?: Map<string, TweenFn<any>>;\n /** Field → external prop value to internal slot value, for fields that need it. */\n mappers?: Map<string, (ext: any, prev?: any) => any>;\n}\n\n/** @internal */\nexport interface PropHost {\n /** See {@link PropCells}. Absent until the first prop is registered, and\n * cleared by `dispose()`. */\n __cells?: PropCells;\n}\n\n/** @internal */\nexport function getPropSlot(obj: PropHost, name: string): PropSlot<any> | undefined {\n return obj.__cells?.slots.get(name);\n}\n\n/** The host's slots, created on first use. @internal */\nexport function ensureCells(obj: PropHost): PropCells {\n return obj.__cells ??= { slots: new Map() };\n}\n"]}
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/props/host.ts"],"names":[],"mappings":"AAgCA,gBAAgB;AAChB,MAAM,UAAU,WAAW,CAAC,GAAa,EAAE,IAAY;IACnD,OAAO,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,WAAW,CAAC,GAAa;IACrC,OAAO,GAAG,CAAC,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import { PropSlot } from \"./slot\";\r\n\r\n/** @internal */\r\nexport type TweenFn<T> = (from: T, to: T, t: number) => T;\r\n\r\n/**\r\n * The slots behind an object's `@property`-declared fields, plus the per-field\r\n * metadata `set()` and `to()` route through.\r\n *\r\n * One object rather than three loose maps on the host, because the host is a\r\n * `Node` and every public field it carries is published API. Grouping them\r\n * means a node exposes one internal name instead of three, and gives the thing\r\n * a name a reader can look up.\r\n *\r\n * @internal\r\n */\r\nexport interface PropCells {\r\n /** Field → its live slot. Present for every registered prop. */\r\n slots: Map<string, PropSlot<any>>;\r\n /** Field → how it interpolates, for props a numeric lerp cannot cover. */\r\n tweens?: Map<string, TweenFn<any>>;\r\n /** Field → external prop value to internal slot value, for fields that need it. */\r\n mappers?: Map<string, (ext: any, prev?: any) => any>;\r\n}\r\n\r\n/** @internal */\r\nexport interface PropHost {\r\n /** See {@link PropCells}. Absent until the first prop is registered, and\r\n * cleared by `dispose()`. */\r\n __cells?: PropCells;\r\n}\r\n\r\n/** @internal */\r\nexport function getPropSlot(obj: PropHost, name: string): PropSlot<any> | undefined {\r\n return obj.__cells?.slots.get(name);\r\n}\r\n\r\n/** The host's slots, created on first use. @internal */\r\nexport function ensureCells(obj: PropHost): PropCells {\r\n return obj.__cells ??= { slots: new Map() };\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/props/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { PropSlot } from \"./slot\";\nexport type { PropSnapshot } from \"./slot\";\nexport type { TweenFn, PropCells, PropHost } from \"./host\";\nexport { getPropSlot } from \"./host\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/props/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { PropSlot } from \"./slot\";\r\nexport type { PropSnapshot } from \"./slot\";\r\nexport type { TweenFn, PropCells, PropHost } from \"./host\";\r\nexport { getPropSlot } from \"./host\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../src/props/observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,QAAQ,CAAC;AAgBrD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAI,QAAsB,EAAE,EAAW;IAC/D,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAI,EAAW;IACrC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACtE,CAAC","sourcesContent":["import { _setObserver, type PropSlot } from \"./slot\";\n\n/**\n * What the slots touched inside {@link observeSlots} are reported to.\n *\n * Reads and writes are recorded rather than declared: a dependency is whatever a\n * computation actually touched, bindings included, so nothing has to annotate a\n * prop as mattering to anyone.\n */\nexport interface SlotObserver {\n read(slot: PropSlot<unknown>): void;\n write(slot: PropSlot<unknown>): void;\n /** A node's clock was read — a result that depends on it is not a function of slots alone. */\n clock?(host: { readonly id: string }): void;\n}\n\n/** The {@link PropSlot._name} of `Node2D`'s laid-out box. */\nexport const LAYOUT_SLOT = \"layoutBounds\";\n/** A document variable's slot is named this plus the variable id. */\nexport const VAR_PREFIX = \"var:\";\n/** A timeline node's presence pseudo-slot is named this plus the node id. */\nexport const PRESENCE_PREFIX = \"presence:\";\n/** A node's child list and parent link, as a pseudo-slot on that node. */\nexport const STRUCTURE_SLOT = \"structure\";\n\n/** Run `fn` with every slot read and write reported to `observer`. An inner scope shadows an outer one. */\nexport function observeSlots<T>(observer: SlotObserver, fn: () => T): T {\n const previous = _setObserver(observer);\n try {\n return fn();\n } finally {\n _setObserver(previous);\n }\n}\n\n/** Run `fn` with nothing observing, inside a scope that is. */\nexport function unobserved<T>(fn: () => T): T {\n const previous = _setObserver(null);\n try {\n return fn();\n } finally {\n _setObserver(previous);\n }\n}\n\n/** `\"card.x\"` for a node's prop, the bare name for a hostless slot (`\"var:g\"`). */\nexport function slotLabel(slot: PropSlot<unknown>): string {\n return slot._host ? `${slot._host.id}.${slot._name}` : slot._name;\n}\n"]}
1
+ {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../src/props/observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,QAAQ,CAAC;AAgBrD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAI,QAAsB,EAAE,EAAW;IAC/D,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAI,EAAW;IACrC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACtE,CAAC","sourcesContent":["import { _setObserver, type PropSlot } from \"./slot\";\r\n\r\n/**\r\n * What the slots touched inside {@link observeSlots} are reported to.\r\n *\r\n * Reads and writes are recorded rather than declared: a dependency is whatever a\r\n * computation actually touched, bindings included, so nothing has to annotate a\r\n * prop as mattering to anyone.\r\n */\r\nexport interface SlotObserver {\r\n read(slot: PropSlot<unknown>): void;\r\n write(slot: PropSlot<unknown>): void;\r\n /** A node's clock was read — a result that depends on it is not a function of slots alone. */\r\n clock?(host: { readonly id: string }): void;\r\n}\r\n\r\n/** The {@link PropSlot._name} of `Node2D`'s laid-out box. */\r\nexport const LAYOUT_SLOT = \"layoutBounds\";\r\n/** A document variable's slot is named this plus the variable id. */\r\nexport const VAR_PREFIX = \"var:\";\r\n/** A timeline node's presence pseudo-slot is named this plus the node id. */\r\nexport const PRESENCE_PREFIX = \"presence:\";\r\n/** A node's child list and parent link, as a pseudo-slot on that node. */\r\nexport const STRUCTURE_SLOT = \"structure\";\r\n\r\n/** Run `fn` with every slot read and write reported to `observer`. An inner scope shadows an outer one. */\r\nexport function observeSlots<T>(observer: SlotObserver, fn: () => T): T {\r\n const previous = _setObserver(observer);\r\n try {\r\n return fn();\r\n } finally {\r\n _setObserver(previous);\r\n }\r\n}\r\n\r\n/** Run `fn` with nothing observing, inside a scope that is. */\r\nexport function unobserved<T>(fn: () => T): T {\r\n const previous = _setObserver(null);\r\n try {\r\n return fn();\r\n } finally {\r\n _setObserver(previous);\r\n }\r\n}\r\n\r\n/** `\"card.x\"` for a node's prop, the bare name for a hostless slot (`\"var:g\"`). */\r\nexport function slotLabel(slot: PropSlot<unknown>): string {\r\n return slot._host ? `${slot._host.id}.${slot._name}` : slot._name;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/props/slot.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,CAAC,IAAI,SAAS,GAAwB,IAAI,CAAC;AAEjD,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAA6B;IACtD,MAAM,QAAQ,GAAG,SAAS,CAAC;IAC3B,SAAS,GAAG,QAAQ,CAAC;IACrB,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,O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K,IAAI;YAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;IAC7B,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACnF,CAAC;IAED,WAAW,CAAC,IAAqB;QAC7B,IAAI,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;YAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,mFAAmF;IACnF,OAAO;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,SAAyB,CAAC;IAC5C,CAAC;CACJ","sourcesContent":["import type { SlotObserver } from \"./observer\";\n\n/**\n * A captured state of a {@link PropSlot}: the thunk it was bound to, or the\n * plain value it held. Produced by {@link PropSlot.snapshot} and consumed by\n * {@link PropSlot.restoreFrom}.\n */\n/** @internal */\nexport interface PropSnapshot<T> {\n value: T;\n /** Present only for a bound slot; restoring one re-binds rather than freezing it. */\n fn?: () => T;\n}\n\n/**\n * @internal The observer every slot reports to, or `null` — which is every frame of\n * playback, so the hot path pays one null check. Installed by `observeSlots`.\n */\nexport let _observer: SlotObserver | null = null;\n\n/** @internal Only this module can reassign the binding. Returns the observer it replaced. */\nexport function _setObserver(observer: SlotObserver | null): SlotObserver | null {\n const previous = _observer;\n _observer = observer;\n return previous;\n}\n\n/**\n * The storage behind one `@property`: a plain value, or a thunk evaluated on\n * every read.\n *\n * There is no dependency graph and nothing to invalidate. A bound slot\n * recomputes when it is asked, which is what makes a document expression\n * (`\"=4[g]+3\"`), an author's `width={() => …}` and an alignment binding reading\n * a box written mid-layout all correct without anything declaring an edge. The\n * cache-and-invalidate version of this could only get the last one right by\n * observing the write, and paid for it everywhere: a `peek()`/`get()` split at\n * every write path, so a read taken inside whatever computation happened to be\n * running did not register an edge with no business existing.\n *\n * The bet is that recomputing is cheaper than tracking. Bindings here are\n * arithmetic over a handful of reads, and a frame's draw dwarfs all of them.\n */\nexport class PropSlot<T> {\n private _value: T;\n private _fn: (() => T) | null = null;\n private _running = false;\n\n /** `_host` and `_name` only label the slot for an observer — see `slotLabel`. */\n constructor(\n initial: T,\n readonly _host: { readonly id: string } | null = null,\n readonly _name: string = \"\",\n ) {\n this._value = initial;\n }\n\n get(): T {\n // Before the re-entrancy check, so a binding's own reads are recorded\n // under whatever read it.\n if (_observer !== null) _observer.read(this);\n // A binding that reads its own slot re-enters here mid-evaluation —\n // `bind(() => mapper(ext(), slot.get()))` is how a mapper is handed the\n // previous value. It gets the last settled one instead of recursing.\n if (!this._fn || this._running) return this._value;\n this._running = true;\n try {\n return (this._value = this._fn());\n } finally {\n this._running = false;\n }\n }\n\n set(value: T): void {\n if (_observer !== null) _observer.write(this);\n this._fn = null;\n this._value = value;\n }\n\n bind(fn: () => T): void {\n if (_observer !== null) _observer.write(this);\n this._fn = fn;\n }\n\n /** Freeze a bound slot at what it currently computes. */\n unbind(): void {\n if (!this._fn) return;\n if (_observer !== null) _observer.write(this);\n this._value = this.get();\n this._fn = null;\n }\n\n isBound(): boolean {\n return this._fn !== null;\n }\n\n snapshot(): PropSnapshot<T> {\n return this._fn ? { value: this.get(), fn: this._fn } : { value: this._value };\n }\n\n restoreFrom(snap: PropSnapshot<T>): void {\n if (snap.fn) this.bind(snap.fn);\n else this.set(snap.value);\n }\n\n /** Releases the bound closure and the value slot. The slot is inert after this. */\n dispose(): void {\n this._fn = null;\n this._value = undefined as unknown as T;\n }\n}\n"]}
1
+ {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/props/slot.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,CAAC,IAAI,SAAS,GAAwB,IAAI,CAAC;AAEjD,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAA6B;IACtD,MAAM,QAAQ,GAAG,SAAS,CAAC;IAC3B,SAAS,GAAG,QAAQ,CAAC;IACrB,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,QAAQ;IAQJ;IACA;IARL,MAAM,CAAI;IACV,GAAG,GAAqB,IAAI,CAAC;IAC7B,QAAQ,GAAG,KAAK,CAAC;IAEzB,iFAAiF;IACjF,YACI,OAAU,EACD,QAAwC,IAAI,EAC5C,QAAgB,EAAE;QADlB,UAAK,GAAL,KAAK,CAAuC;QAC5C,UAAK,GAAL,KAAK,CAAa;QAE3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,GAAG;QACC,sEAAsE;QACtE,0BAA0B;QAC1B,IAAI,SAAS,KAAK,IAAI;YAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,oEAAoE;QACpE,wEAAwE;QACxE,qEAAqE;QACrE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC1B,CAAC;IACL,CAAC;IAED,GAAG,CAAC,KAAQ;QACR,IAAI,SAAS,KAAK,IAAI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A captured state of a {@link PropSlot}: the thunk it was bound to, or the\r\n * plain value it held. Produced by {@link PropSlot.snapshot} and consumed by\r\n * {@link PropSlot.restoreFrom}.\r\n */\r\n/** @internal */\r\nexport interface PropSnapshot<T> {\r\n value: T;\r\n /** Present only for a bound slot; restoring one re-binds rather than freezing it. */\r\n fn?: () => T;\r\n}\r\n\r\n/**\r\n * @internal The observer every slot reports to, or `null` — which is every frame of\r\n * playback, so the hot path pays one null check. Installed by `observeSlots`.\r\n */\r\nexport let _observer: SlotObserver | null = null;\r\n\r\n/** @internal Only this module can reassign the binding. Returns the observer it replaced. */\r\nexport function _setObserver(observer: SlotObserver | null): SlotObserver | null {\r\n const previous = _observer;\r\n _observer = observer;\r\n return previous;\r\n}\r\n\r\n/**\r\n * The storage behind one `@property`: a plain value, or a thunk evaluated on\r\n * every read.\r\n *\r\n * There is no dependency graph and nothing to invalidate. A bound slot\r\n * recomputes when it is asked, which is what makes a document expression\r\n * (`\"=4[g]+3\"`), an author's `width={() => …}` and an alignment binding reading\r\n * a box written mid-layout all correct without anything declaring an edge. The\r\n * cache-and-invalidate version of this could only get the last one right by\r\n * observing the write, and paid for it everywhere: a `peek()`/`get()` split at\r\n * every write path, so a read taken inside whatever computation happened to be\r\n * running did not register an edge with no business existing.\r\n *\r\n * The bet is that recomputing is cheaper than tracking. Bindings here are\r\n * arithmetic over a handful of reads, and a frame's draw dwarfs all of them.\r\n */\r\nexport class PropSlot<T> {\r\n private _value: T;\r\n private _fn: (() => T) | null = null;\r\n private _running = false;\r\n\r\n /** `_host` and `_name` only label the slot for an observer — see `slotLabel`. */\r\n constructor(\r\n initial: T,\r\n readonly _host: { readonly id: string } | null = null,\r\n readonly _name: string = \"\",\r\n ) {\r\n this._value = initial;\r\n }\r\n\r\n get(): T {\r\n // Before the re-entrancy check, so a binding's own reads are recorded\r\n // under whatever read it.\r\n if (_observer !== null) _observer.read(this);\r\n // A binding that reads its own slot re-enters here mid-evaluation —\r\n // `bind(() => mapper(ext(), slot.get()))` is how a mapper is handed the\r\n // previous value. It gets the last settled one instead of recursing.\r\n if (!this._fn || this._running) return this._value;\r\n this._running = true;\r\n try {\r\n return (this._value = this._fn());\r\n } finally {\r\n this._running = false;\r\n }\r\n }\r\n\r\n set(value: T): void {\r\n if (_observer !== null) _observer.write(this);\r\n this._fn = null;\r\n this._value = value;\r\n }\r\n\r\n bind(fn: () => T): void {\r\n if (_observer !== null) _observer.write(this);\r\n this._fn = fn;\r\n }\r\n\r\n /** Freeze a bound slot at what it currently computes. */\r\n unbind(): void {\r\n if (!this._fn) return;\r\n if (_observer !== null) _observer.write(this);\r\n this._value = this.get();\r\n this._fn = null;\r\n }\r\n\r\n isBound(): boolean {\r\n return this._fn !== null;\r\n }\r\n\r\n snapshot(): PropSnapshot<T> {\r\n return this._fn ? { value: this.get(), fn: this._fn } : { value: this._value };\r\n }\r\n\r\n restoreFrom(snap: PropSnapshot<T>): void {\r\n if (snap.fn) this.bind(snap.fn);\r\n else this.set(snap.value);\r\n }\r\n\r\n /** Releases the bound closure and the value slot. The slot is inert after this. */\r\n dispose(): void {\r\n this._fn = null;\r\n this._value = undefined as unknown as T;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,17 @@
1
+ import { integrateSpeedToClipTime, sourceTimeAtClipElapsed } from './attributes/audio/filters/curve.js';
2
+ import type { NodeEffect } from './attributes/shape/effects/union.js';
3
+ import { ClipTimeline } from './document/timeline.js';
4
+ import type { VisualDocument } from './document/types.js';
5
+ /** @deprecated Renamed to {@link VisualDocument}. */
6
+ export type SceneDocument = VisualDocument;
7
+ /** @deprecated Renamed to {@link ClipTimeline}. */
8
+ export declare const SceneTimeline: typeof ClipTimeline;
9
+ /** @deprecated Renamed to {@link ClipTimeline}. */
10
+ export type SceneTimeline = ClipTimeline;
11
+ /** @deprecated Renamed to {@link NodeEffect}. */
12
+ export type SceneEffect = NodeEffect;
13
+ /** @deprecated Renamed to {@link integrateSpeedToClipTime}. */
14
+ export declare const integrateSpeedToSceneTime: typeof integrateSpeedToClipTime;
15
+ /** @deprecated Renamed to {@link sourceTimeAtClipElapsed}. */
16
+ export declare const sourceTimeAtSceneElapsed: typeof sourceTimeAtClipElapsed;
17
+ //# sourceMappingURL=renamed-scene-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renamed-scene-names.d.ts","sourceRoot":"","sources":["../src/renamed-scene-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAC3C,mDAAmD;AACnD,eAAO,MAAM,aAAa,qBAAe,CAAC;AAC1C,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AACzC,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC;AACrC,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,iCAA2B,CAAC;AAClE,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,gCAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { integrateSpeedToClipTime, sourceTimeAtClipElapsed } from './attributes/audio/filters/curve.js';
2
+ import { ClipTimeline } from './document/timeline.js';
3
+ /** @deprecated Renamed to {@link ClipTimeline}. */
4
+ export const SceneTimeline = ClipTimeline;
5
+ /** @deprecated Renamed to {@link integrateSpeedToClipTime}. */
6
+ export const integrateSpeedToSceneTime = integrateSpeedToClipTime;
7
+ /** @deprecated Renamed to {@link sourceTimeAtClipElapsed}. */
8
+ export const sourceTimeAtSceneElapsed = sourceTimeAtClipElapsed;
9
+ //# sourceMappingURL=renamed-scene-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renamed-scene-names.js","sourceRoot":"","sources":["../src/renamed-scene-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAK1C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAClE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC","sourcesContent":["import { integrateSpeedToClipTime, sourceTimeAtClipElapsed } from './attributes/audio/filters/curve';\r\nimport type { NodeEffect } from './attributes/shape/effects/union';\r\nimport { ClipTimeline } from './document/timeline';\r\nimport type { VisualDocument } from './document/types';\r\n\r\n// The names the document API had before \"scene\" became \"clip\", kept until 1.0.\r\n\r\n/** @deprecated Renamed to {@link VisualDocument}. */\r\nexport type SceneDocument = VisualDocument;\r\n/** @deprecated Renamed to {@link ClipTimeline}. */\r\nexport const SceneTimeline = ClipTimeline;\r\n/** @deprecated Renamed to {@link ClipTimeline}. */\r\nexport type SceneTimeline = ClipTimeline;\r\n/** @deprecated Renamed to {@link NodeEffect}. */\r\nexport type SceneEffect = NodeEffect;\r\n/** @deprecated Renamed to {@link integrateSpeedToClipTime}. */\r\nexport const integrateSpeedToSceneTime = integrateSpeedToClipTime;\r\n/** @deprecated Renamed to {@link sourceTimeAtClipElapsed}. */\r\nexport const sourceTimeAtSceneElapsed = sourceTimeAtClipElapsed;\r\n"]}
@@ -9,7 +9,7 @@ import type { BooleanOperation } from "../attributes/mask/boolean.js";
9
9
  import { TextState } from "./descriptors/text.js";
10
10
  import { TextBlockLayout } from "./text-layout.js";
11
11
  import type { NodeRenderState, RasterizedSurface, RenderContext2D, RenderPass2D, SpaceRects, EffectTarget } from "./render-context2d.js";
12
- import type { SceneEffect } from "../attributes/shape/effects/union.js";
12
+ import type { NodeEffect } from "../attributes/shape/effects/union.js";
13
13
  /**
14
14
  * The base every {@link RenderContext2D} backend extends.
15
15
  *
@@ -88,7 +88,7 @@ export declare abstract class CanvasRenderContext2D implements RenderPass2D {
88
88
  abstract beginClip(clip: Clip): void;
89
89
  abstract endClip(): void;
90
90
  /** See {@link RenderContext2D.beginEffects}. No-op by default. */
91
- beginEffects(effects: SceneEffect[], target: EffectTarget, width: number, height: number): void;
91
+ beginEffects(effects: NodeEffect[], target: EffectTarget, width: number, height: number): void;
92
92
  endEffects(): void;
93
93
  /** See {@link RenderContext2D.rasterize}. Returns `null` by default. */
94
94
  rasterize(width: number, height: number, draw: () => void, pixelRatio?: number): RasterizedSurface | null;
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-render-context2d.d.ts","sourceRoot":"","sources":["../../src/render/canvas-render-context2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB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AAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;IAChF,CAAC;IAED,qFAAqF;IAC3E,kBAAkB;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACO,YAAY;QAClB,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,CAAC;CACJ","sourcesContent":["import { Graphics2D } from \"./graphics2d\";\nimport type { Clip } from \"./clip\";\nimport type { TransformState } from \"./descriptors/transform\";\nimport type { FontStyle, TextStyle } from \"@/attributes/text/types\";\nimport type { Size2D } from \"@/attributes/layout/size\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\nimport { TextState } from \"./descriptors/text\";\nimport { TextBlockLayout } from \"./text-layout\";\nimport { EMPTY_TEXT_STYLE, textOps } from \"@/attributes/text/ops\";\nimport { applyGraphicsTextDefaults } from \"./text-defaults\";\nimport type { NodeRenderState, RasterizedSurface, RenderContext2D, RenderPass2D, SpaceRects, EffectTarget } from \"./render-context2d\";\nimport type { SceneEffect } from \"@/attributes/shape/effects/union\";\n\n/**\n * The base every {@link RenderContext2D} backend extends.\n *\n * It owns the parts of a render context that are the *same* whatever is being\n * rasterized — the text-default stack, the node scope stack, disposal — plus\n * the host-facing half of the surface (`execute`, `screenshot`, `unmount`),\n * which the {@link RenderContext2D} interface deliberately leaves out because a\n * node has no business driving a render pass from inside one.\n *\n * **`draw` is final by convention.** It resolves the ambient text defaults onto\n * the op list and hands the result to {@link drawGraphics}, which is where a\n * backend does its actual drawing. Owning that step here rather than in each\n * backend is what keeps the real renderer and the precomp asset walk agreeing\n * on which font an under-specified `text` op shapes with: a family that one\n * resolves and the other does not is a font that never loads and glyphs that\n * never paint.\n */\nexport abstract class CanvasRenderContext2D implements RenderPass2D {\n abstract measureText(text: string, fontSize: number, fontFamily: string, fontWeight?: number, letterSpacing?: number, fontStyle?: FontStyle): Size2D;\n\n // ---- Inherited text-style defaults ------------------------------------\n // `<DefaultTextStyle>` reaches a `Text`/`RichText` node through the context\n // map, applied once when the node binds. A raw `Graphics2D` has no node to\n // bind, so it inherits the same defaults here instead — pushed around a\n // subtree's draw scope, and folded into each `text`/`richText` op by\n // `draw()`. Same vocabulary (`TextStyle`), same precedence, two channels.\n\n /**\n * Defaults in effect for the current draw scope, innermost last. Each entry\n * is **already merged** onto the one below it (see {@link pushTextStyle}), so\n * the top of the stack is the effective style and reading it costs nothing.\n */\n private readonly textStyleStack: TextStyle[] = [];\n\n /** See {@link RenderContext2D.pushTextStyle}. */\n pushTextStyle(style: TextStyle | null): void {\n this.textStyleStack.push(style === null ? EMPTY_TEXT_STYLE : textOps.mergeStyle(this.defaultTextStyle, style));\n }\n\n /** Close the innermost scope opened by {@link pushTextStyle}. */\n popTextStyle(): void {\n this.textStyleStack.pop();\n }\n\n /**\n * The text-style defaults in effect right now — the innermost\n * {@link pushTextStyle} scope, or the project's `theme.typography.default`\n * when no scope is open.\n *\n * Carries all ten {@link TEXT_STYLE_KEYS}, but only the shaping ones reach a\n * `Graphics2D` op; see `TEXT_SHAPING_KEYS` for why `fill`/`stroke`/`shadow`\n * stay a node-level concern.\n */\n get defaultTextStyle(): TextStyle {\n return this.textStyleStack[this.textStyleStack.length - 1] ?? textOps.preset(\"default\");\n }\n\n /** See {@link RenderContext2D.draw}. Final by convention — override {@link drawGraphics}. */\n draw(graphics: Graphics2D): void {\n this.drawGraphics(applyGraphicsTextDefaults(graphics, this.defaultTextStyle));\n }\n\n /** Paint a `Graphics2D` whose text ops have already been resolved against the\n * ambient defaults. Backends implement this instead of {@link draw}. */\n protected abstract drawGraphics(graphics: Graphics2D): void;\n\n /**\n * See {@link RenderContext2D.layoutTextBlock}. Concrete rather than abstract,\n * and `null` by default, so a backend that has no need to report glyph\n * positions is unaffected — the only thing it gives up is on-canvas text\n * editing in a host built on it.\n */\n layoutTextBlock(state: Partial<TextState>): TextBlockLayout | null {\n return null;\n }\n\n /** Stack of node ids currently being drawn, innermost last. */\n protected currentNodeStack: string[] = [];\n\n /** Returns the id of the innermost node currently being drawn. */\n protected currentNodeId(): string {\n if (this.currentNodeStack.length === 0) {\n throw new Error(\"No current node in context\");\n }\n\n return this.currentNodeStack[this.currentNodeStack.length - 1];\n }\n\n /** Remove all renderer-side resources for the current node (called on unmount). */\n abstract unmount(): void;\n\n private _disposed = false;\n /** `true` after `dispose()` — the context must not be used after this point. */\n isDisposed(): boolean {\n return this._disposed;\n }\n dispose(): void {\n this._disposed = true;\n }\n\n /**\n * Execute `callback`, which issues shape/paint calls, and flush the result\n * to the underlying render target (canvas, SVG document, etc.). A callback\n * that throws still throws, and the next pass starts from a clean context.\n */\n abstract execute(callback: () => void): void;\n /** Capture the current frame as a base-64 PNG data URL, or `undefined` if unsupported. */\n abstract screenshot(): string | undefined;\n\n abstract transform(state: Partial<TransformState>): RenderContext2D;\n\n abstract beginBoolean(op: BooleanOperation): void;\n abstract endBoolean(): void;\n\n abstract beginMask(options?: MaskOptions): void;\n abstract applyMask(): void;\n abstract endMask(): void;\n\n abstract beginClip(clip: Clip): void;\n abstract endClip(): void;\n\n /** See {@link RenderContext2D.beginEffects}. No-op by default. */\n beginEffects(effects: SceneEffect[], target: EffectTarget, width: number, height: number): void { }\n endEffects(): void { }\n\n /** See {@link RenderContext2D.rasterize}. Returns `null` by default. */\n rasterize(\n width: number,\n height: number,\n draw: () => void,\n pixelRatio?: number,\n ): RasterizedSurface | null {\n return null;\n }\n\n abstract beginCamera(viewport: { x: number; y: number; width: number; height: number }, lookAt: Vector2, zoom: number, heading: number): void;\n abstract endCamera(): void;\n\n /**\n * Per-node render state for each node on the draw stack, in push order\n * (innermost last). Kept parallel to `currentNodeStack` so fills with\n * `space: 'parent'` can resolve their reference rect and so\n * motion-driven effects can read the current node's velocity.\n */\n protected renderStateStack: NodeRenderState[] = [];\n\n /** See {@link RenderContext2D.readsSpaceRects}. */\n readonly readsSpaceRects: boolean = true;\n\n /** See {@link RenderContext2D.drawsVisibleOnly}. */\n readonly drawsVisibleOnly: boolean = true;\n\n /** See {@link RenderPass2D.begin}. */\n begin(state: NodeRenderState): void {\n this.currentNodeStack.push(state.id);\n this.renderStateStack.push(state);\n }\n\n /** Close the innermost node draw scope opened by `begin()`. */\n end(): void {\n this.currentNodeStack.pop();\n this.renderStateStack.pop();\n }\n\n /** Reference rects for the node currently being drawn (parent / viewport). */\n protected currentSpaceRects(): SpaceRects {\n return this.renderStateStack[this.renderStateStack.length - 1]?.rects ?? {};\n }\n\n /** Full render state (incl. velocity) for the node currently being drawn, if any. */\n protected currentRenderState(): NodeRenderState | undefined {\n return this.renderStateStack[this.renderStateStack.length - 1];\n }\n\n /**\n * Close every node and text-style scope still open. A backend calls this\n * when a pass ends, so a pass that threw cannot leave the next one inside\n * its scopes.\n */\n protected _resetScopes(): void {\n this.textStyleStack.length = 0;\n this.currentNodeStack.length = 0;\n this.renderStateStack.length = 0;\n }\n}\n"]}
1
+ {"version":3,"file":"canvas-render-context2d.js","sourceRoot":"","sources":["../../src/render/canvas-render-context2d.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAI5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAgB,qBAAqB;IAGvC,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,wEAAwE;IACxE,qEAAqE;IACrE,0EAA0E;IAE1E;;;;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graphics2D } from \"./graphics2d\";\r\nimport type { Clip } from \"./clip\";\r\nimport type { TransformState } from \"./descriptors/transform\";\r\nimport type { FontStyle, TextStyle } from \"@/attributes/text/types\";\r\nimport type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\r\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\r\nimport { TextState } from \"./descriptors/text\";\r\nimport { TextBlockLayout } from \"./text-layout\";\r\nimport { EMPTY_TEXT_STYLE, textOps } from \"@/attributes/text/ops\";\r\nimport { applyGraphicsTextDefaults } from \"./text-defaults\";\r\nimport type { NodeRenderState, RasterizedSurface, RenderContext2D, RenderPass2D, SpaceRects, EffectTarget } from \"./render-context2d\";\r\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\r\n\r\n/**\r\n * The base every {@link RenderContext2D} backend extends.\r\n *\r\n * It owns the parts of a render context that are the *same* whatever is being\r\n * rasterized — the text-default stack, the node scope stack, disposal — plus\r\n * the host-facing half of the surface (`execute`, `screenshot`, `unmount`),\r\n * which the {@link RenderContext2D} interface deliberately leaves out because a\r\n * node has no business driving a render pass from inside one.\r\n *\r\n * **`draw` is final by convention.** It resolves the ambient text defaults onto\r\n * the op list and hands the result to {@link drawGraphics}, which is where a\r\n * backend does its actual drawing. Owning that step here rather than in each\r\n * backend is what keeps the real renderer and the precomp asset walk agreeing\r\n * on which font an under-specified `text` op shapes with: a family that one\r\n * resolves and the other does not is a font that never loads and glyphs that\r\n * never paint.\r\n */\r\nexport abstract class CanvasRenderContext2D implements RenderPass2D {\r\n abstract measureText(text: string, fontSize: number, fontFamily: string, fontWeight?: number, letterSpacing?: number, fontStyle?: FontStyle): Size2D;\r\n\r\n // ---- Inherited text-style defaults ------------------------------------\r\n // `<DefaultTextStyle>` reaches a `Text`/`RichText` node through the context\r\n // map, applied once when the node binds. A raw `Graphics2D` has no node to\r\n // bind, so it inherits the same defaults here instead — pushed around a\r\n // subtree's draw scope, and folded into each `text`/`richText` op by\r\n // `draw()`. Same vocabulary (`TextStyle`), same precedence, two channels.\r\n\r\n /**\r\n * Defaults in effect for the current draw scope, innermost last. Each entry\r\n * is **already merged** onto the one below it (see {@link pushTextStyle}), so\r\n * the top of the stack is the effective style and reading it costs nothing.\r\n */\r\n private readonly textStyleStack: TextStyle[] = [];\r\n\r\n /** See {@link RenderContext2D.pushTextStyle}. */\r\n pushTextStyle(style: TextStyle | null): void {\r\n this.textStyleStack.push(style === null ? EMPTY_TEXT_STYLE : textOps.mergeStyle(this.defaultTextStyle, style));\r\n }\r\n\r\n /** Close the innermost scope opened by {@link pushTextStyle}. */\r\n popTextStyle(): void {\r\n this.textStyleStack.pop();\r\n }\r\n\r\n /**\r\n * The text-style defaults in effect right now — the innermost\r\n * {@link pushTextStyle} scope, or the project's `theme.typography.default`\r\n * when no scope is open.\r\n *\r\n * Carries all ten {@link TEXT_STYLE_KEYS}, but only the shaping ones reach a\r\n * `Graphics2D` op; see `TEXT_SHAPING_KEYS` for why `fill`/`stroke`/`shadow`\r\n * stay a node-level concern.\r\n */\r\n get defaultTextStyle(): TextStyle {\r\n return this.textStyleStack[this.textStyleStack.length - 1] ?? textOps.preset(\"default\");\r\n }\r\n\r\n /** See {@link RenderContext2D.draw}. Final by convention — override {@link drawGraphics}. */\r\n draw(graphics: Graphics2D): void {\r\n this.drawGraphics(applyGraphicsTextDefaults(graphics, this.defaultTextStyle));\r\n }\r\n\r\n /** Paint a `Graphics2D` whose text ops have already been resolved against the\r\n * ambient defaults. Backends implement this instead of {@link draw}. */\r\n protected abstract drawGraphics(graphics: Graphics2D): void;\r\n\r\n /**\r\n * See {@link RenderContext2D.layoutTextBlock}. Concrete rather than abstract,\r\n * and `null` by default, so a backend that has no need to report glyph\r\n * positions is unaffected — the only thing it gives up is on-canvas text\r\n * editing in a host built on it.\r\n */\r\n layoutTextBlock(state: Partial<TextState>): TextBlockLayout | null {\r\n return null;\r\n }\r\n\r\n /** Stack of node ids currently being drawn, innermost last. */\r\n protected currentNodeStack: string[] = [];\r\n\r\n /** Returns the id of the innermost node currently being drawn. */\r\n protected currentNodeId(): string {\r\n if (this.currentNodeStack.length === 0) {\r\n throw new Error(\"No current node in context\");\r\n }\r\n\r\n return this.currentNodeStack[this.currentNodeStack.length - 1];\r\n }\r\n\r\n /** Remove all renderer-side resources for the current node (called on unmount). */\r\n abstract unmount(): void;\r\n\r\n private _disposed = false;\r\n /** `true` after `dispose()` — the context must not be used after this point. */\r\n isDisposed(): boolean {\r\n return this._disposed;\r\n }\r\n dispose(): void {\r\n this._disposed = true;\r\n }\r\n\r\n /**\r\n * Execute `callback`, which issues shape/paint calls, and flush the result\r\n * to the underlying render target (canvas, SVG document, etc.). A callback\r\n * that throws still throws, and the next pass starts from a clean context.\r\n */\r\n abstract execute(callback: () => void): void;\r\n /** Capture the current frame as a base-64 PNG data URL, or `undefined` if unsupported. */\r\n abstract screenshot(): string | undefined;\r\n\r\n abstract transform(state: Partial<TransformState>): RenderContext2D;\r\n\r\n abstract beginBoolean(op: BooleanOperation): void;\r\n abstract endBoolean(): void;\r\n\r\n abstract beginMask(options?: MaskOptions): void;\r\n abstract applyMask(): void;\r\n abstract endMask(): void;\r\n\r\n abstract beginClip(clip: Clip): void;\r\n abstract endClip(): void;\r\n\r\n /** See {@link RenderContext2D.beginEffects}. No-op by default. */\r\n beginEffects(effects: NodeEffect[], target: EffectTarget, width: number, height: number): void { }\r\n endEffects(): void { }\r\n\r\n /** See {@link RenderContext2D.rasterize}. Returns `null` by default. */\r\n rasterize(\r\n width: number,\r\n height: number,\r\n draw: () => void,\r\n pixelRatio?: number,\r\n ): RasterizedSurface | null {\r\n return null;\r\n }\r\n\r\n abstract beginCamera(viewport: { x: number; y: number; width: number; height: number }, lookAt: Vector2, zoom: number, heading: number): void;\r\n abstract endCamera(): void;\r\n\r\n /**\r\n * Per-node render state for each node on the draw stack, in push order\r\n * (innermost last). Kept parallel to `currentNodeStack` so fills with\r\n * `space: 'parent'` can resolve their reference rect and so\r\n * motion-driven effects can read the current node's velocity.\r\n */\r\n protected renderStateStack: NodeRenderState[] = [];\r\n\r\n /** See {@link RenderContext2D.readsSpaceRects}. */\r\n readonly readsSpaceRects: boolean = true;\r\n\r\n /** See {@link RenderContext2D.drawsVisibleOnly}. */\r\n readonly drawsVisibleOnly: boolean = true;\r\n\r\n /** See {@link RenderPass2D.begin}. */\r\n begin(state: NodeRenderState): void {\r\n this.currentNodeStack.push(state.id);\r\n this.renderStateStack.push(state);\r\n }\r\n\r\n /** Close the innermost node draw scope opened by `begin()`. */\r\n end(): void {\r\n this.currentNodeStack.pop();\r\n this.renderStateStack.pop();\r\n }\r\n\r\n /** Reference rects for the node currently being drawn (parent / viewport). */\r\n protected currentSpaceRects(): SpaceRects {\r\n return this.renderStateStack[this.renderStateStack.length - 1]?.rects ?? {};\r\n }\r\n\r\n /** Full render state (incl. velocity) for the node currently being drawn, if any. */\r\n protected currentRenderState(): NodeRenderState | undefined {\r\n return this.renderStateStack[this.renderStateStack.length - 1];\r\n }\r\n\r\n /**\r\n * Close every node and text-style scope still open. A backend calls this\r\n * when a pass ends, so a pass that threw cannot leave the next one inside\r\n * its scopes.\r\n */\r\n protected _resetScopes(): void {\r\n this.textStyleStack.length = 0;\r\n this.currentNodeStack.length = 0;\r\n this.renderStateStack.length = 0;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"clip-contains.js","sourceRoot":"","sources":["../../src/render/clip-contains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,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AC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IACtD,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { Vector2 } from \"@/attributes/layout/vector2\";\nimport { Clip, ClipOp, ClipShapeOp } from \"./clip\";\nimport { withRectDescriptor } from \"./descriptors/rect\";\nimport { withEllipseDescriptor } from \"./descriptors/ellipse\";\nimport { withPolygonDescriptor } from \"./descriptors/polygon\";\nimport { withPolygramDescriptor } from \"./descriptors/polygram\";\nimport { withLineDescriptor } from \"./descriptors/line\";\nimport { cornerRadiusOps } from \"@/attributes/shape/corners/corner-radius\";\n\n/**\n * Point-in-region tests for {@link Clip}, used by node hit testing so a click\n * follows a shape's silhouette rather than its bounding box.\n *\n * Geometry only — no renderer, no CanvasKit — because a `Clip` is a declarative\n * record of primitives rather than a built path. That is what lets hit testing\n * live in `core` and share one outline definition with clipping and backdrop\n * effects: a shape declares its outline once, in `clipSelf()`, and both the\n * pixels and the grab region derive from it.\n *\n * Every point and every descriptor coordinate here is in **y-up author space**\n * (the space `Graphics2D`/`Clip` descriptors are written in; the renderer flips to\n * canvas y-down at draw time — see `flipPositionY`). Angles follow from that:\n * `startAngle`/`sweep` measure counter-clockwise from +x.\n */\n\n/** Guard against divide-by-zero on collapsed geometry. */\nconst EPS = 1e-9;\n\n/**\n * Whether `point` falls inside the region a {@link Clip} describes, within\n * `tolerance` scene units of its edge.\n *\n * Shape ops union; a `cut` subtracts the immediately preceding shape from\n * everything declared before it, mirroring how the renderer replays the op list.\n * `tolerance` widens each shape outward — including a cutter, which therefore\n * takes a slightly larger bite, keeping the test forgiving in both directions\n * rather than making a hole's rim unpickable.\n */\nexport function containsClip(clip: Clip, point: Vector2, tolerance = 0): boolean {\n return containsOps(clip.ops(), point, tolerance);\n}\n\n/** {@link containsClip} over a raw op list. */\nexport function containsOps(ops: readonly ClipOp[], point: Vector2, tolerance = 0): boolean {\n let inside = false;\n // The shape immediately preceding the current position, held back so a\n // following `cut` can subtract it instead of unioning it.\n let pending: ClipShapeOp | null = null;\n\n const flush = (): void => {\n if (pending && containsShape(pending, point, tolerance)) inside = true;\n pending = null;\n };\n\n for (const op of ops) {\n if (op.kind === \"cut\") {\n // The pending shape is the cutter: it never joins the union, and it\n // punches whatever was accumulated before it.\n if (pending && containsShape(pending, point, tolerance)) inside = false;\n pending = null;\n continue;\n }\n flush();\n pending = op;\n }\n flush();\n return inside;\n}\n\n/**\n * Dispatch one shape op to its own containment test, after undoing the shape's\n * local rotation/scale about its pivot — mirroring `BaseShape.applyShapeTransform`,\n * which bakes that same transform into the drawn path.\n */\nfunction containsShape(op: ClipShapeOp, point: Vector2, tolerance: number): boolean {\n switch (op.kind) {\n case \"rect\": {\n const s = withRectDescriptor(op.state);\n const p = toShapeLocal(point, s, s.width, s.height);\n return p !== null && containsRect(p, s.width, s.height, cornerRadiusOps.resolve(s.cornerRadius), tolerance);\n }\n case \"ellipse\": {\n const s = withEllipseDescriptor(op.state);\n const p = toShapeLocal(point, s, s.width, s.height);\n return p !== null && containsEllipse(p, s.width, s.height, s.ratio, s.sweep, s.startAngle, tolerance);\n }\n case \"polygon\": {\n const s = withPolygonDescriptor(op.state);\n const p = toShapeLocal(point, s, s.width, s.height);\n return p !== null && containsPolyline(p, polygonVertices(s.width, s.height, s.sides), true, tolerance);\n }\n case \"polygram\": {\n const s = withPolygramDescriptor(op.state);\n const p = toShapeLocal(point, s, s.width, s.height);\n return p !== null && containsPolyline(p, polygramVertices(s.width, s.height, s.sides, s.ratio), true, tolerance);\n }\n case \"line\": {\n const s = withLineDescriptor(op.state);\n const p = toShapeLocal(point, s, s.width, s.height);\n if (p === null || s.points.length === 0) return false;\n // As a clip region a polyline is filled with its contour implicitly\n // closed, whether or not `closed` was set — so test the enclosed area\n // first, then fall back to the band around the stroke itself.\n if (s.points.length >= 3 && containsPolyline(p, s.points, true, tolerance)) return true;\n return nearPolyline(p, s.points, s.closed, tolerance);\n }\n case \"path\": {\n // An arbitrary Bézier winding test is not worth carrying, and no\n // built-in shape emits a `path` clip — only a hand-built `Clip` can.\n // Fall back to the declared box.\n const s = op.state;\n const local = { x: point.x - (s.x ?? 0), y: point.y - (s.y ?? 0) };\n return containsRect(local, s.width ?? 0, s.height ?? 0, cornerRadiusOps.resolve(0), tolerance);\n }\n }\n}\n\n/** The positioning fields every shape descriptor resolves to. */\ninterface ShapePlacement {\n x: number;\n y: number;\n rotation: number;\n scale: number;\n pivot: unknown;\n}\n\n/**\n * Map `point` out of the shape's own `x`/`y`/`rotation`/`scale` (about its\n * pivot) and into the shape's un-transformed, centred frame. Returns `null` when\n * the scale is zero — the shape has collapsed and encloses nothing.\n */\nfunction toShapeLocal(point: Vector2, s: ShapePlacement, width: number, height: number): Vector2 | null {\n if (s.scale === 0) return null;\n const pivot = s.pivot as Vector2;\n // Pivot is normalised [-1, 1] about the shape centre, y-up here (the\n // renderer negates its y because it works in canvas space).\n const px = pivot.x * (width / 2);\n const py = pivot.y * (height / 2);\n // Relative to the pivot, in the parent's (unrotated) frame.\n const dx = point.x - (s.x + px);\n const dy = point.y - (s.y + py);\n // Undo the clockwise rotation: in y-up space the forward map is\n // (cos·x + sin·y, -sin·x + cos·y), so the inverse swaps the sine signs.\n const rad = (s.rotation * Math.PI) / 180;\n const cos = Math.cos(rad);\n const sin = Math.sin(rad);\n const rx = (cos * dx - sin * dy) / s.scale;\n const ry = (sin * dx + cos * dy) / s.scale;\n // Back to centre-relative: the pivot sits (px, py) from the centre.\n return { x: rx + px, y: ry + py };\n}\n\n// ─── Primitives ──────────────────────────────────────────────────────────────\n\ninterface Corners4 { topLeft: number; topRight: number; bottomRight: number; bottomLeft: number }\n\n/**\n * Axis-aligned box centred on the origin, with per-corner rounding. A corner is\n * only excluded when the point sits beyond that corner's quarter-circle, so a\n * plain rect (all radii 0) reduces to the box test exactly. `cornerStyle` is not\n * consulted: an `'angled'` chamfer cuts strictly inside the arc, so testing the\n * arc over-estimates by a sliver — the forgiving direction for a grab test.\n */\nfunction containsRect(p: Vector2, width: number, height: number, radius: Corners4, tolerance: number): boolean {\n const halfW = width / 2 + tolerance;\n const halfH = height / 2 + tolerance;\n if (Math.abs(p.x) > halfW || Math.abs(p.y) > halfH) return false;\n\n // Pick the corner the point is nearest and test its arc. Radii are clamped\n // the way any rounded-rect rasteriser clamps them: never past half the side.\n const maxR = Math.min(width, height) / 2;\n const r = Math.min(\n maxR,\n p.x <= 0\n ? (p.y >= 0 ? radius.topLeft : radius.bottomLeft)\n : (p.y >= 0 ? radius.topRight : radius.bottomRight),\n );\n if (r <= 0) return true;\n\n // Centre of that corner's arc, then the usual \"outside the quarter-circle\"\n // check — which only bites inside the corner square itself.\n const sx = Math.sign(p.x || 1);\n const sy = Math.sign(p.y || 1);\n const dx = p.x - sx * (width / 2 - r);\n const dy = p.y - sy * (height / 2 - r);\n if (Math.sign(dx || 1) !== sx || Math.sign(dy || 1) !== sy) return true;\n return dx * dx + dy * dy <= (r + tolerance) * (r + tolerance);\n}\n\n/**\n * Ellipse, honouring the same `ratio`/`sweep`/`startAngle` family the renderer\n * draws (see `EllipseShape.buildSVGPath`), so the grab region is the region that\n * was actually painted:\n *\n * - `ratio` ≤ 0 → solid disk, or a wedge for a partial sweep\n * - 0 < `ratio` < 1 → annulus / annular sector (the hole is not hittable)\n * - `ratio` ≥ 1 → the band has collapsed to the bare outer curve, so only\n * points near that curve hit\n */\nfunction containsEllipse(\n p: Vector2, width: number, height: number,\n ratio: number, sweep: number, startAngle: number,\n tolerance: number,\n): boolean {\n const rx = width / 2;\n const ry = height / 2;\n if (rx <= 0 || ry <= 0) return false;\n\n const clamped = Math.max(0, Math.min(1, ratio));\n const full = Math.abs(sweep) >= 360;\n\n // Outside the outer curve (grown by tolerance) can never hit.\n if (norm(p, rx + tolerance, ry + tolerance) > 1) return false;\n\n if (clamped > 0) {\n const inner = norm(p, Math.max(EPS, rx * clamped - tolerance), Math.max(EPS, ry * clamped - tolerance));\n if (inner < 1) return false;\n }\n\n if (full) return true;\n return withinSweep(Math.atan2(p.y / ry, p.x / rx) * (180 / Math.PI), startAngle, sweep, p, tolerance);\n}\n\n/** Normalised radius of `p` on an ellipse of half-axes `rx`/`ry` (1 = on the curve). */\nfunction norm(p: Vector2, rx: number, ry: number): number {\n return Math.hypot(p.x / rx, p.y / ry);\n}\n\n/**\n * Whether `angleDeg` lies within the arc `[startAngle, startAngle + sweep]`,\n * with `tolerance` converted to angular slack at the point's own radius so\n * grab-slop widens the wedge's straight edges too. Handles negative sweeps.\n */\nfunction withinSweep(\n angleDeg: number, startAngle: number, sweep: number,\n p: Vector2, tolerance: number,\n): boolean {\n const lo = sweep >= 0 ? startAngle : startAngle + sweep;\n const span = Math.abs(sweep);\n // Near the centre every angle is within tolerance of the wedge.\n const radius = Math.hypot(p.x, p.y);\n if (radius <= tolerance) return true;\n const slack = tolerance > 0 ? (tolerance / Math.max(radius, EPS)) * (180 / Math.PI) : 0;\n let delta = (angleDeg - lo) % 360;\n if (delta < 0) delta += 360;\n // Accept the wrap-around side within slack as well.\n return delta <= span + slack || delta >= 360 - slack;\n}\n\n/**\n * Vertices of a regular polygon inscribed in `width`×`height`, y-up author\n * space. The renderer starts at the top vertex and steps clockwise in canvas\n * space; in y-up that is `+π/2` stepping negative.\n */\nexport function polygonVertices(width: number, height: number, sides: number): Vector2[] {\n const n = Math.max(3, Math.round(sides));\n const rx = width / 2;\n const ry = height / 2;\n const step = (2 * Math.PI) / n;\n const out: Vector2[] = [];\n for (let i = 0; i < n; i++) {\n const a = Math.PI / 2 - i * step;\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) });\n }\n return out;\n}\n\n/** Vertices of a star polygon: outer radius 1 alternating with inner radius `ratio`. */\nexport function polygramVertices(width: number, height: number, sides: number, ratio: number): Vector2[] {\n const n = Math.max(3, Math.round(sides));\n const r = Math.max(0, Math.min(1, ratio));\n const rx = width / 2;\n const ry = height / 2;\n const step = Math.PI / n;\n const out: Vector2[] = [];\n for (let i = 0; i < n * 2; i++) {\n const a = Math.PI / 2 - i * step;\n const k = i % 2 === 0 ? 1 : r;\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) });\n }\n return out;\n}\n\n/**\n * Even-odd crossing test against a polygon, widened by `tolerance`: a point just\n * outside an edge still counts. `closed` also closes the last→first segment for\n * the tolerance band.\n */\nfunction containsPolyline(p: Vector2, verts: readonly Vector2[], closed: boolean, tolerance: number): boolean {\n if (verts.length >= 3 && pointInPolygon(p, verts)) return true;\n return tolerance > 0 && nearPolyline(p, verts, closed, tolerance);\n}\n\n/** Even-odd crossing test against a closed polygon. No tolerance band. */\nexport function pointInPolygon(p: Vector2, verts: readonly Vector2[]): boolean {\n if (verts.length < 3) return false;\n let inside = false;\n for (let i = 0, j = verts.length - 1; i < verts.length; j = i++) {\n const a = verts[i];\n const b = verts[j];\n if ((a.y > p.y) !== (b.y > p.y) && p.x < ((b.x - a.x) * (p.y - a.y)) / (b.y - a.y) + a.x) {\n inside = !inside;\n }\n }\n return inside;\n}\n\n/** Whether `p` is within `tolerance` of any segment of the polyline. */\nexport function nearPolyline(p: Vector2, pts: readonly Vector2[], closed: boolean, tolerance: number): boolean {\n if (pts.length === 0) return false;\n if (pts.length === 1) return Math.hypot(p.x - pts[0].x, p.y - pts[0].y) <= tolerance;\n const last = closed ? pts.length : pts.length - 1;\n for (let i = 0; i < last; i++) {\n if (distanceToSegment(p, pts[i], pts[(i + 1) % pts.length]) <= tolerance) return true;\n }\n return false;\n}\n\n/** Shortest distance from `p` to the segment `a`–`b`. */\nexport function distanceToSegment(p: Vector2, a: Vector2, b: Vector2): number {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const lenSq = dx * dx + dy * dy;\n if (lenSq <= EPS) return Math.hypot(p.x - a.x, p.y - a.y);\n let t = ((p.x - a.x) * dx + (p.y - a.y) * dy) / lenSq;\n t = t < 0 ? 0 : t > 1 ? 1 : t;\n return Math.hypot(p.x - (a.x + t * dx), p.y - (a.y + t * dy));\n}\n"]}
1
+ {"version":3,"file":"clip-contains.js","sourceRoot":"","sources":["../../src/render/clip-contains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AAEH,0DAA0D;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,KAAc,EAAE,SAAS,GAAG,CAAC;IAClE,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC;AAED,+CAA+C;AAC/C,MA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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { Clip, ClipOp, ClipShapeOp } from \"./clip\";\r\nimport { withRectDescriptor } from \"./descriptors/rect\";\r\nimport { withEllipseDescriptor } from \"./descriptors/ellipse\";\r\nimport { withPolygonDescriptor } from \"./descriptors/polygon\";\r\nimport { withPolygramDescriptor } from \"./descriptors/polygram\";\r\nimport { withLineDescriptor } from \"./descriptors/line\";\r\nimport { cornerRadiusOps } from \"@/attributes/shape/corners/corner-radius\";\r\n\r\n/**\r\n * Point-in-region tests for {@link Clip}, used by node hit testing so a click\r\n * follows a shape's silhouette rather than its bounding box.\r\n *\r\n * Geometry only — no renderer, no CanvasKit — because a `Clip` is a declarative\r\n * record of primitives rather than a built path. That is what lets hit testing\r\n * live in `core` and share one outline definition with clipping and backdrop\r\n * effects: a shape declares its outline once, in `clipSelf()`, and both the\r\n * pixels and the grab region derive from it.\r\n *\r\n * Every point and every descriptor coordinate here is in **y-up author space**\r\n * (the space `Graphics2D`/`Clip` descriptors are written in; the renderer flips to\r\n * canvas y-down at draw time — see `flipPositionY`). Angles follow from that:\r\n * `startAngle`/`sweep` measure counter-clockwise from +x.\r\n */\r\n\r\n/** Guard against divide-by-zero on collapsed geometry. */\r\nconst EPS = 1e-9;\r\n\r\n/**\r\n * Whether `point` falls inside the region a {@link Clip} describes, within\r\n * `tolerance` scene units of its edge.\r\n *\r\n * Shape ops union; a `cut` subtracts the immediately preceding shape from\r\n * everything declared before it, mirroring how the renderer replays the op list.\r\n * `tolerance` widens each shape outward — including a cutter, which therefore\r\n * takes a slightly larger bite, keeping the test forgiving in both directions\r\n * rather than making a hole's rim unpickable.\r\n */\r\nexport function containsClip(clip: Clip, point: Vector2, tolerance = 0): boolean {\r\n return containsOps(clip.ops(), point, tolerance);\r\n}\r\n\r\n/** {@link containsClip} over a raw op list. */\r\nexport function containsOps(ops: readonly ClipOp[], point: Vector2, tolerance = 0): boolean {\r\n let inside = false;\r\n // The shape immediately preceding the current position, held back so a\r\n // following `cut` can subtract it instead of unioning it.\r\n let pending: ClipShapeOp | null = null;\r\n\r\n const flush = (): void => {\r\n if (pending && containsShape(pending, point, tolerance)) inside = true;\r\n pending = null;\r\n };\r\n\r\n for (const op of ops) {\r\n if (op.kind === \"cut\") {\r\n // The pending shape is the cutter: it never joins the union, and it\r\n // punches whatever was accumulated before it.\r\n if (pending && containsShape(pending, point, tolerance)) inside = false;\r\n pending = null;\r\n continue;\r\n }\r\n flush();\r\n pending = op;\r\n }\r\n flush();\r\n return inside;\r\n}\r\n\r\n/**\r\n * Dispatch one shape op to its own containment test, after undoing the shape's\r\n * local rotation/scale about its pivot — mirroring `BaseShape.applyShapeTransform`,\r\n * which bakes that same transform into the drawn path.\r\n */\r\nfunction containsShape(op: ClipShapeOp, point: Vector2, tolerance: number): boolean {\r\n switch (op.kind) {\r\n case \"rect\": {\r\n const s = withRectDescriptor(op.state);\r\n const p = toShapeLocal(point, s, s.width, s.height);\r\n return p !== null && containsRect(p, s.width, s.height, cornerRadiusOps.resolve(s.cornerRadius), tolerance);\r\n }\r\n case \"ellipse\": {\r\n const s = withEllipseDescriptor(op.state);\r\n const p = toShapeLocal(point, s, s.width, s.height);\r\n return p !== null && containsEllipse(p, s.width, s.height, s.ratio, s.sweep, s.startAngle, tolerance);\r\n }\r\n case \"polygon\": {\r\n const s = withPolygonDescriptor(op.state);\r\n const p = toShapeLocal(point, s, s.width, s.height);\r\n return p !== null && containsPolyline(p, polygonVertices(s.width, s.height, s.sides), true, tolerance);\r\n }\r\n case \"polygram\": {\r\n const s = withPolygramDescriptor(op.state);\r\n const p = toShapeLocal(point, s, s.width, s.height);\r\n return p !== null && containsPolyline(p, polygramVertices(s.width, s.height, s.sides, s.ratio), true, tolerance);\r\n }\r\n case \"line\": {\r\n const s = withLineDescriptor(op.state);\r\n const p = toShapeLocal(point, s, s.width, s.height);\r\n if (p === null || s.points.length === 0) return false;\r\n // As a clip region a polyline is filled with its contour implicitly\r\n // closed, whether or not `closed` was set — so test the enclosed area\r\n // first, then fall back to the band around the stroke itself.\r\n if (s.points.length >= 3 && containsPolyline(p, s.points, true, tolerance)) return true;\r\n return nearPolyline(p, s.points, s.closed, tolerance);\r\n }\r\n case \"path\": {\r\n // An arbitrary Bézier winding test is not worth carrying, and no\r\n // built-in shape emits a `path` clip — only a hand-built `Clip` can.\r\n // Fall back to the declared box.\r\n const s = op.state;\r\n const local = { x: point.x - (s.x ?? 0), y: point.y - (s.y ?? 0) };\r\n return containsRect(local, s.width ?? 0, s.height ?? 0, cornerRadiusOps.resolve(0), tolerance);\r\n }\r\n }\r\n}\r\n\r\n/** The positioning fields every shape descriptor resolves to. */\r\ninterface ShapePlacement {\r\n x: number;\r\n y: number;\r\n rotation: number;\r\n scale: number;\r\n pivot: unknown;\r\n}\r\n\r\n/**\r\n * Map `point` out of the shape's own `x`/`y`/`rotation`/`scale` (about its\r\n * pivot) and into the shape's un-transformed, centred frame. Returns `null` when\r\n * the scale is zero — the shape has collapsed and encloses nothing.\r\n */\r\nfunction toShapeLocal(point: Vector2, s: ShapePlacement, width: number, height: number): Vector2 | null {\r\n if (s.scale === 0) return null;\r\n const pivot = s.pivot as Vector2;\r\n // Pivot is normalised [-1, 1] about the shape centre, y-up here (the\r\n // renderer negates its y because it works in canvas space).\r\n const px = pivot.x * (width / 2);\r\n const py = pivot.y * (height / 2);\r\n // Relative to the pivot, in the parent's (unrotated) frame.\r\n const dx = point.x - (s.x + px);\r\n const dy = point.y - (s.y + py);\r\n // Undo the clockwise rotation: in y-up space the forward map is\r\n // (cos·x + sin·y, -sin·x + cos·y), so the inverse swaps the sine signs.\r\n const rad = (s.rotation * Math.PI) / 180;\r\n const cos = Math.cos(rad);\r\n const sin = Math.sin(rad);\r\n const rx = (cos * dx - sin * dy) / s.scale;\r\n const ry = (sin * dx + cos * dy) / s.scale;\r\n // Back to centre-relative: the pivot sits (px, py) from the centre.\r\n return { x: rx + px, y: ry + py };\r\n}\r\n\r\n// ─── Primitives ──────────────────────────────────────────────────────────────\r\n\r\ninterface Corners4 { topLeft: number; topRight: number; bottomRight: number; bottomLeft: number }\r\n\r\n/**\r\n * Axis-aligned box centred on the origin, with per-corner rounding. A corner is\r\n * only excluded when the point sits beyond that corner's quarter-circle, so a\r\n * plain rect (all radii 0) reduces to the box test exactly. `cornerStyle` is not\r\n * consulted: an `'angled'` chamfer cuts strictly inside the arc, so testing the\r\n * arc over-estimates by a sliver — the forgiving direction for a grab test.\r\n */\r\nfunction containsRect(p: Vector2, width: number, height: number, radius: Corners4, tolerance: number): boolean {\r\n const halfW = width / 2 + tolerance;\r\n const halfH = height / 2 + tolerance;\r\n if (Math.abs(p.x) > halfW || Math.abs(p.y) > halfH) return false;\r\n\r\n // Pick the corner the point is nearest and test its arc. Radii are clamped\r\n // the way any rounded-rect rasteriser clamps them: never past half the side.\r\n const maxR = Math.min(width, height) / 2;\r\n const r = Math.min(\r\n maxR,\r\n p.x <= 0\r\n ? (p.y >= 0 ? radius.topLeft : radius.bottomLeft)\r\n : (p.y >= 0 ? radius.topRight : radius.bottomRight),\r\n );\r\n if (r <= 0) return true;\r\n\r\n // Centre of that corner's arc, then the usual \"outside the quarter-circle\"\r\n // check — which only bites inside the corner square itself.\r\n const sx = Math.sign(p.x || 1);\r\n const sy = Math.sign(p.y || 1);\r\n const dx = p.x - sx * (width / 2 - r);\r\n const dy = p.y - sy * (height / 2 - r);\r\n if (Math.sign(dx || 1) !== sx || Math.sign(dy || 1) !== sy) return true;\r\n return dx * dx + dy * dy <= (r + tolerance) * (r + tolerance);\r\n}\r\n\r\n/**\r\n * Ellipse, honouring the same `ratio`/`sweep`/`startAngle` family the renderer\r\n * draws (see `EllipseShape.buildSVGPath`), so the grab region is the region that\r\n * was actually painted:\r\n *\r\n * - `ratio` ≤ 0 → solid disk, or a wedge for a partial sweep\r\n * - 0 < `ratio` < 1 → annulus / annular sector (the hole is not hittable)\r\n * - `ratio` ≥ 1 → the band has collapsed to the bare outer curve, so only\r\n * points near that curve hit\r\n */\r\nfunction containsEllipse(\r\n p: Vector2, width: number, height: number,\r\n ratio: number, sweep: number, startAngle: number,\r\n tolerance: number,\r\n): boolean {\r\n const rx = width / 2;\r\n const ry = height / 2;\r\n if (rx <= 0 || ry <= 0) return false;\r\n\r\n const clamped = Math.max(0, Math.min(1, ratio));\r\n const full = Math.abs(sweep) >= 360;\r\n\r\n // Outside the outer curve (grown by tolerance) can never hit.\r\n if (norm(p, rx + tolerance, ry + tolerance) > 1) return false;\r\n\r\n if (clamped > 0) {\r\n const inner = norm(p, Math.max(EPS, rx * clamped - tolerance), Math.max(EPS, ry * clamped - tolerance));\r\n if (inner < 1) return false;\r\n }\r\n\r\n if (full) return true;\r\n return withinSweep(Math.atan2(p.y / ry, p.x / rx) * (180 / Math.PI), startAngle, sweep, p, tolerance);\r\n}\r\n\r\n/** Normalised radius of `p` on an ellipse of half-axes `rx`/`ry` (1 = on the curve). */\r\nfunction norm(p: Vector2, rx: number, ry: number): number {\r\n return Math.hypot(p.x / rx, p.y / ry);\r\n}\r\n\r\n/**\r\n * Whether `angleDeg` lies within the arc `[startAngle, startAngle + sweep]`,\r\n * with `tolerance` converted to angular slack at the point's own radius so\r\n * grab-slop widens the wedge's straight edges too. Handles negative sweeps.\r\n */\r\nfunction withinSweep(\r\n angleDeg: number, startAngle: number, sweep: number,\r\n p: Vector2, tolerance: number,\r\n): boolean {\r\n const lo = sweep >= 0 ? startAngle : startAngle + sweep;\r\n const span = Math.abs(sweep);\r\n // Near the centre every angle is within tolerance of the wedge.\r\n const radius = Math.hypot(p.x, p.y);\r\n if (radius <= tolerance) return true;\r\n const slack = tolerance > 0 ? (tolerance / Math.max(radius, EPS)) * (180 / Math.PI) : 0;\r\n let delta = (angleDeg - lo) % 360;\r\n if (delta < 0) delta += 360;\r\n // Accept the wrap-around side within slack as well.\r\n return delta <= span + slack || delta >= 360 - slack;\r\n}\r\n\r\n/**\r\n * Vertices of a regular polygon inscribed in `width`×`height`, y-up author\r\n * space. The renderer starts at the top vertex and steps clockwise in canvas\r\n * space; in y-up that is `+π/2` stepping negative.\r\n */\r\nexport function polygonVertices(width: number, height: number, sides: number): Vector2[] {\r\n const n = Math.max(3, Math.round(sides));\r\n const rx = width / 2;\r\n const ry = height / 2;\r\n const step = (2 * Math.PI) / n;\r\n const out: Vector2[] = [];\r\n for (let i = 0; i < n; i++) {\r\n const a = Math.PI / 2 - i * step;\r\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) });\r\n }\r\n return out;\r\n}\r\n\r\n/** Vertices of a star polygon: outer radius 1 alternating with inner radius `ratio`. */\r\nexport function polygramVertices(width: number, height: number, sides: number, ratio: number): Vector2[] {\r\n const n = Math.max(3, Math.round(sides));\r\n const r = Math.max(0, Math.min(1, ratio));\r\n const rx = width / 2;\r\n const ry = height / 2;\r\n const step = Math.PI / n;\r\n const out: Vector2[] = [];\r\n for (let i = 0; i < n * 2; i++) {\r\n const a = Math.PI / 2 - i * step;\r\n const k = i % 2 === 0 ? 1 : r;\r\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) });\r\n }\r\n return out;\r\n}\r\n\r\n/**\r\n * Even-odd crossing test against a polygon, widened by `tolerance`: a point just\r\n * outside an edge still counts. `closed` also closes the last→first segment for\r\n * the tolerance band.\r\n */\r\nfunction containsPolyline(p: Vector2, verts: readonly Vector2[], closed: boolean, tolerance: number): boolean {\r\n if (verts.length >= 3 && pointInPolygon(p, verts)) return true;\r\n return tolerance > 0 && nearPolyline(p, verts, closed, tolerance);\r\n}\r\n\r\n/** Even-odd crossing test against a closed polygon. No tolerance band. */\r\nexport function pointInPolygon(p: Vector2, verts: readonly Vector2[]): boolean {\r\n if (verts.length < 3) return false;\r\n let inside = false;\r\n for (let i = 0, j = verts.length - 1; i < verts.length; j = i++) {\r\n const a = verts[i];\r\n const b = verts[j];\r\n if ((a.y > p.y) !== (b.y > p.y) && p.x < ((b.x - a.x) * (p.y - a.y)) / (b.y - a.y) + a.x) {\r\n inside = !inside;\r\n }\r\n }\r\n return inside;\r\n}\r\n\r\n/** Whether `p` is within `tolerance` of any segment of the polyline. */\r\nexport function nearPolyline(p: Vector2, pts: readonly Vector2[], closed: boolean, tolerance: number): boolean {\r\n if (pts.length === 0) return false;\r\n if (pts.length === 1) return Math.hypot(p.x - pts[0].x, p.y - pts[0].y) <= tolerance;\r\n const last = closed ? pts.length : pts.length - 1;\r\n for (let i = 0; i < last; i++) {\r\n if (distanceToSegment(p, pts[i], pts[(i + 1) % pts.length]) <= tolerance) return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Shortest distance from `p` to the segment `a`–`b`. */\r\nexport function distanceToSegment(p: Vector2, a: Vector2, b: Vector2): number {\r\n const dx = b.x - a.x;\r\n const dy = b.y - a.y;\r\n const lenSq = dx * dx + dy * dy;\r\n if (lenSq <= EPS) return Math.hypot(p.x - a.x, p.y - a.y);\r\n let t = ((p.x - a.x) * dx + (p.y - a.y) * dy) / lenSq;\r\n t = t < 0 ? 0 : t > 1 ? 1 : t;\r\n return Math.hypot(p.x - (a.x + t * dx), p.y - (a.y + t * dy));\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"clip.js","sourceRoot":"","sources":["../../src/render/clip.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAuBzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,IAAI;IACL,IAAI,GAAa,EAAE,CAAC;IAE5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OAAO,IAAI,CAAC;IAChB,CAAC;IAED,4EAA4E;IAE5E,6EAA6E;IAC7E,GAAG;QACC,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,0EAA0E;IAC1E,OAAO;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IACtD,CAAC;CACJ","sourcesContent":["import type { RectState } from \"./descriptors/rect\";\nimport type { EllipseState } from \"./descriptors/ellipse\";\nimport type { PathState } from \"./descriptors/path\";\nimport type { LineState } from \"./descriptors/line\";\nimport type { PolygonState } from \"./descriptors/polygon\";\nimport type { PolygramState } from \"./descriptors/polygram\";\nimport type { ShapeAlignmentInput } from \"./descriptors/shape\";\nimport { PathBuilder } from \"./descriptors/path-builder\";\n\n/**\n * The shape ops a {@link Clip} can record — the same geometry primitives a\n * {@link Graphics2D} can draw, minus text/image (which have no clippable outline).\n * Each carries the partial descriptor state for that shape.\n */\nexport type ClipShapeOp =\n | { kind: \"rect\"; state: Partial<RectState> & ShapeAlignmentInput }\n | { kind: \"ellipse\"; state: Partial<EllipseState> & ShapeAlignmentInput }\n | { kind: \"path\"; state: Partial<PathState> }\n | { kind: \"line\"; state: Partial<LineState> }\n | { kind: \"polygon\"; state: Partial<PolygonState> & ShapeAlignmentInput }\n | { kind: \"polygram\"; state: Partial<PolygramState> & ShapeAlignmentInput };\n\n/**\n * A single recorded op in a {@link Clip}. Shape ops add geometry to the clip\n * region; `cut` subtracts the last-declared shape from the ones before it. The\n * renderer replays this list into a single clip path via\n * `RenderContext2D.beginClip()`.\n */\nexport type ClipOp = ClipShapeOp | { kind: \"cut\" };\n\n/**\n * A renderer-agnostic, chainable clip-region builder — `Graphics2D` for clipping.\n *\n * `Clip` records a sequence of shape declarations (and optional `cut()`s) that\n * the renderer unions into a single clip path. Multiple shapes combine, so a\n * clip can be any compound silhouette, not just a single rect or ellipse:\n *\n * const c = new Clip()\n * .rect({ width: 200, height: 120, cornerRadius: 16 })\n * .ellipse({ x: 80, width: 60, height: 60 }) // unions with the rect\n * .ellipse({ x: -80, width: 40, height: 40 })\n * .cut(); // punches the last hole\n * ctx.beginClip(c);\n * ...draw clipped content...\n * ctx.endClip();\n *\n * A `Clip` carries no paint — it's purely the outline. It's what a `ShapeNode`\n * returns from `clipSelf()` to describe both its `clip` boundary and the\n * silhouette its backdrop effects (blur, magnify, …) are confined to, so a\n * single definition drives every clip the node needs.\n */\nexport class Clip {\n private _ops: ClipOp[] = [];\n\n // ─── Shapes ──────────────────────────────────────────────────────────────\n\n rect(state: Partial<RectState> & ShapeAlignmentInput): this {\n this._ops.push({ kind: \"rect\", state });\n return this;\n }\n\n ellipse(state: Partial<EllipseState> & ShapeAlignmentInput): this {\n this._ops.push({ kind: \"ellipse\", state });\n return this;\n }\n\n /** Add a vector path to the clip region, from a `PathState` or a `PathBuilder`. */\n path(state: Partial<PathState> | PathBuilder): this {\n const resolved = state instanceof PathBuilder ? state.toPathState() : state;\n this._ops.push({ kind: \"path\", state: resolved });\n return this;\n }\n\n line(state: Partial<LineState>): this {\n this._ops.push({ kind: \"line\", state });\n return this;\n }\n\n polygon(state: Partial<PolygonState> & ShapeAlignmentInput): this {\n this._ops.push({ kind: \"polygon\", state });\n return this;\n }\n\n polygram(state: Partial<PolygramState> & ShapeAlignmentInput): this {\n this._ops.push({ kind: \"polygram\", state });\n return this;\n }\n\n // ─── Compositing ─────────────────────────────────────────────────────────\n\n /**\n * Use the last-declared shape as a cutter: union the shapes before it and\n * subtract that last shape, punching a hole in the clip region. Mirrors\n * {@link Graphics2D.cut}.\n */\n cut(): this {\n this._ops.push({ kind: \"cut\" });\n return this;\n }\n\n // ─── Consumption ─────────────────────────────────────────────────────────\n\n /** The recorded ops, in order. Consumed by `RenderContext2D.beginClip()`. */\n ops(): readonly ClipOp[] {\n return this._ops;\n }\n\n /** True when no shape op has been recorded — the clip region is empty. */\n isEmpty(): boolean {\n return !this._ops.some((op) => op.kind !== \"cut\");\n }\n}\n"]}
1
+ {"version":3,"file":"clip.js","sourceRoot":"","sources":["../../src/render/clip.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAuBzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,IAAI;IACL,IAAI,GAAa,EAAE,CAAC;IAE5B,4EAA4E;IAE5E,IAAI,CAAC,KAA+C;QAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,KAAkD;QACtD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,mFAAmF;IACnF,IAAI,CAAC,KAAuC;QACxC,MAAM,QAAQ,GAAG,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5E,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,KAAyB;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,KAAkD;QACtD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,KAAmD;QACxD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,4EAA4E;IAE5E;;;;OAIG;IACH,GAAG;QACC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,4EAA4E;IAE5E,6EAA6E;IAC7E,GAAG;QACC,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,0EAA0E;IAC1E,OAAO;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IACtD,CAAC;CACJ","sourcesContent":["import type { RectState } from \"./descriptors/rect\";\r\nimport type { EllipseState } from \"./descriptors/ellipse\";\r\nimport type { PathState } from \"./descriptors/path\";\r\nimport type { LineState } from \"./descriptors/line\";\r\nimport type { PolygonState } from \"./descriptors/polygon\";\r\nimport type { PolygramState } from \"./descriptors/polygram\";\r\nimport type { ShapeAlignmentInput } from \"./descriptors/shape\";\r\nimport { PathBuilder } from \"./descriptors/path-builder\";\r\n\r\n/**\r\n * The shape ops a {@link Clip} can record — the same geometry primitives a\r\n * {@link Graphics2D} can draw, minus text/image (which have no clippable outline).\r\n * Each carries the partial descriptor state for that shape.\r\n */\r\nexport type ClipShapeOp =\r\n | { kind: \"rect\"; state: Partial<RectState> & ShapeAlignmentInput }\r\n | { kind: \"ellipse\"; state: Partial<EllipseState> & ShapeAlignmentInput }\r\n | { kind: \"path\"; state: Partial<PathState> }\r\n | { kind: \"line\"; state: Partial<LineState> }\r\n | { kind: \"polygon\"; state: Partial<PolygonState> & ShapeAlignmentInput }\r\n | { kind: \"polygram\"; state: Partial<PolygramState> & ShapeAlignmentInput };\r\n\r\n/**\r\n * A single recorded op in a {@link Clip}. Shape ops add geometry to the clip\r\n * region; `cut` subtracts the last-declared shape from the ones before it. The\r\n * renderer replays this list into a single clip path via\r\n * `RenderContext2D.beginClip()`.\r\n */\r\nexport type ClipOp = ClipShapeOp | { kind: \"cut\" };\r\n\r\n/**\r\n * A renderer-agnostic, chainable clip-region builder — `Graphics2D` for clipping.\r\n *\r\n * `Clip` records a sequence of shape declarations (and optional `cut()`s) that\r\n * the renderer unions into a single clip path. Multiple shapes combine, so a\r\n * clip can be any compound silhouette, not just a single rect or ellipse:\r\n *\r\n * const c = new Clip()\r\n * .rect({ width: 200, height: 120, cornerRadius: 16 })\r\n * .ellipse({ x: 80, width: 60, height: 60 }) // unions with the rect\r\n * .ellipse({ x: -80, width: 40, height: 40 })\r\n * .cut(); // punches the last hole\r\n * ctx.beginClip(c);\r\n * ...draw clipped content...\r\n * ctx.endClip();\r\n *\r\n * A `Clip` carries no paint — it's purely the outline. It's what a `ShapeNode`\r\n * returns from `clipSelf()` to describe both its `clip` boundary and the\r\n * silhouette its backdrop effects (blur, magnify, …) are confined to, so a\r\n * single definition drives every clip the node needs.\r\n */\r\nexport class Clip {\r\n private _ops: ClipOp[] = [];\r\n\r\n // ─── Shapes ──────────────────────────────────────────────────────────────\r\n\r\n rect(state: Partial<RectState> & ShapeAlignmentInput): this {\r\n this._ops.push({ kind: \"rect\", state });\r\n return this;\r\n }\r\n\r\n ellipse(state: Partial<EllipseState> & ShapeAlignmentInput): this {\r\n this._ops.push({ kind: \"ellipse\", state });\r\n return this;\r\n }\r\n\r\n /** Add a vector path to the clip region, from a `PathState` or a `PathBuilder`. */\r\n path(state: Partial<PathState> | PathBuilder): this {\r\n const resolved = state instanceof PathBuilder ? state.toPathState() : state;\r\n this._ops.push({ kind: \"path\", state: resolved });\r\n return this;\r\n }\r\n\r\n line(state: Partial<LineState>): this {\r\n this._ops.push({ kind: \"line\", state });\r\n return this;\r\n }\r\n\r\n polygon(state: Partial<PolygonState> & ShapeAlignmentInput): this {\r\n this._ops.push({ kind: \"polygon\", state });\r\n return this;\r\n }\r\n\r\n polygram(state: Partial<PolygramState> & ShapeAlignmentInput): this {\r\n this._ops.push({ kind: \"polygram\", state });\r\n return this;\r\n }\r\n\r\n // ─── Compositing ─────────────────────────────────────────────────────────\r\n\r\n /**\r\n * Use the last-declared shape as a cutter: union the shapes before it and\r\n * subtract that last shape, punching a hole in the clip region. Mirrors\r\n * {@link Graphics2D.cut}.\r\n */\r\n cut(): this {\r\n this._ops.push({ kind: \"cut\" });\r\n return this;\r\n }\r\n\r\n // ─── Consumption ─────────────────────────────────────────────────────────\r\n\r\n /** The recorded ops, in order. Consumed by `RenderContext2D.beginClip()`. */\r\n ops(): readonly ClipOp[] {\r\n return this._ops;\r\n }\r\n\r\n /** True when no shape op has been recorded — the clip region is empty. */\r\n isEmpty(): boolean {\r\n return !this._ops.some((op) => op.kind !== \"cut\");\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ellipse.js","sourceRoot":"","sources":["../../../src/render/descriptors/ellipse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAS7H,MAAM,UAAU,qBAAqB,CAAC,UAAuD;IACzF,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC;IACtC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO;QACH,GAAG,uBAAuB,CAAC,UAAU,CAAC;QACtC,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC;QAChC,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,CAAC;QAClC,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,CAAC;QACD,CAAC;QACD,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,GAAG,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;QACxB,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC;QAE/B,KAAK;QACL,MAAM;QACN,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,GAAG;QAC9B,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,CAAC;KACzC,CAAC;AACN,CAAC","sourcesContent":["import { ShapeAlignmentInput, ShapeState, resolveShapeAlignment, resolveShapePivot, stripShapeAlignmentKeys } from \"./shape\";\nexport interface EllipseState extends ShapeState {\n width: number;\n height: number;\n ratio: number;\n sweep: number;\n startAngle: number;\n}\n\nexport function withEllipseDescriptor(descriptor: Partial<EllipseState> & ShapeAlignmentInput): EllipseState {\n const width = descriptor.width ?? 0;\n const height = descriptor.height ?? 0;\n const { x, y, pivot } = resolveShapeAlignment(descriptor, width, height);\n return {\n ...stripShapeAlignmentKeys(descriptor),\n opacity: descriptor.opacity ?? 1,\n rotation: descriptor.rotation ?? 0,\n scale: descriptor.scale ?? 1,\n x,\n y,\n start: descriptor.start ?? 0,\n end: descriptor.end ?? 1,\n pivot: resolveShapePivot(pivot),\n\n width,\n height,\n ratio: descriptor.ratio ?? 0,\n sweep: descriptor.sweep ?? 360,\n startAngle: descriptor.startAngle ?? 0,\n };\n}"]}
1
+ {"version":3,"file":"ellipse.js","sourceRoot":"","sources":["../../../src/render/descriptors/ellipse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAS7H,MAAM,UAAU,qBAAqB,CAAC,UAAuD;IACzF,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC;IACtC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO;QACH,GAAG,uBAAuB,CAAC,UAAU,CAAC;QACtC,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC;QAChC,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,CAAC;QAClC,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,CAAC;QACD,CAAC;QACD,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,GAAG,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;QACxB,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC;QAE/B,KAAK;QACL,MAAM;QACN,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,GAAG;QAC9B,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,CAAC;KACzC,CAAC;AACN,CAAC","sourcesContent":["import { ShapeAlignmentInput, ShapeState, resolveShapeAlignment, resolveShapePivot, stripShapeAlignmentKeys } from \"./shape\";\r\nexport interface EllipseState extends ShapeState {\r\n width: number;\r\n height: number;\r\n ratio: number;\r\n sweep: number;\r\n startAngle: number;\r\n}\r\n\r\nexport function withEllipseDescriptor(descriptor: Partial<EllipseState> & ShapeAlignmentInput): EllipseState {\r\n const width = descriptor.width ?? 0;\r\n const height = descriptor.height ?? 0;\r\n const { x, y, pivot } = resolveShapeAlignment(descriptor, width, height);\r\n return {\r\n ...stripShapeAlignmentKeys(descriptor),\r\n opacity: descriptor.opacity ?? 1,\r\n rotation: descriptor.rotation ?? 0,\r\n scale: descriptor.scale ?? 1,\r\n x,\r\n y,\r\n start: descriptor.start ?? 0,\r\n end: descriptor.end ?? 1,\r\n pivot: resolveShapePivot(pivot),\r\n\r\n width,\r\n height,\r\n ratio: descriptor.ratio ?? 0,\r\n sweep: descriptor.sweep ?? 360,\r\n startAngle: descriptor.startAngle ?? 0,\r\n };\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/render/descriptors/latex.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeState } from \"./shape\";\n\nexport interface LatexState extends ShapeState {\n latex: string;\n fontSize: number;\n}\n\n"]}
1
+ {"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/render/descriptors/latex.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeState } from \"./shape\";\r\n\r\nexport interface LatexState extends ShapeState {\r\n latex: string;\r\n fontSize: number;\r\n}\r\n\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/render/descriptors/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQxD,MAAM,UAAU,kBAAkB,CAAC,UAA8B;IAC7D,OAAO;QACH,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC;QAChC,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,CAAC;QAClC,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;QACpB,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;QACpB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,GAAG,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;QACxB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC;QAC9B,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC;QAE1C,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,EAAE;QAC/B,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC;QAC9B,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,KAAK;KACrC,CAAC;AACN,CAAC","sourcesContent":["import { Vector2 } from \"@/attributes/layout/vector2\";\nimport { ShapeState, resolveShapePivot } from \"./shape\";\n\nexport interface LineState extends ShapeState {\n points: Vector2[];\n radius: number;\n closed: boolean;\n}\n\nexport function withLineDescriptor(descriptor: Partial<LineState>): LineState {\n return {\n opacity: descriptor.opacity ?? 1,\n rotation: descriptor.rotation ?? 0,\n scale: descriptor.scale ?? 1,\n x: descriptor.x ?? 0,\n y: descriptor.y ?? 0,\n start: descriptor.start ?? 0,\n end: descriptor.end ?? 1,\n width: descriptor.width ?? 0,\n height: descriptor.height ?? 0,\n pivot: resolveShapePivot(descriptor.pivot),\n\n points: descriptor.points ?? [],\n radius: descriptor.radius ?? 0,\n closed: descriptor.closed ?? false,\n };\n}\n"]}
1
+ {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/render/descriptors/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQxD,MAAM,UAAU,kBAAkB,CAAC,UAA8B;IAC7D,OAAO;QACH,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC;QAChC,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,CAAC;QAClC,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;QACpB,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;QACpB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,GAAG,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;QACxB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;QAC5B,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC;QAC9B,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC;QAE1C,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,EAAE;QAC/B,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC;QAC9B,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,KAAK;KACrC,CAAC;AACN,CAAC","sourcesContent":["import { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { ShapeState, resolveShapePivot } from \"./shape\";\r\n\r\nexport interface LineState extends ShapeState {\r\n points: Vector2[];\r\n radius: number;\r\n closed: boolean;\r\n}\r\n\r\nexport function withLineDescriptor(descriptor: Partial<LineState>): LineState {\r\n return {\r\n opacity: descriptor.opacity ?? 1,\r\n rotation: descriptor.rotation ?? 0,\r\n scale: descriptor.scale ?? 1,\r\n x: descriptor.x ?? 0,\r\n y: descriptor.y ?? 0,\r\n start: descriptor.start ?? 0,\r\n end: descriptor.end ?? 1,\r\n width: descriptor.width ?? 0,\r\n height: descriptor.height ?? 0,\r\n pivot: resolveShapePivot(descriptor.pivot),\r\n\r\n points: descriptor.points ?? [],\r\n radius: descriptor.radius ?? 0,\r\n closed: descriptor.closed ?? false,\r\n };\r\n}\r\n"]}