@motionscript/core 0.1.0-alpha.0 → 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 (767) hide show
  1. package/CHANGELOG.md +282 -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 +93 -11
  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 +32 -4
  43. package/dist/attributes/audio/request.d.ts.map +1 -1
  44. package/dist/attributes/audio/request.js +9 -1
  45. package/dist/attributes/audio/request.js.map +1 -1
  46. package/dist/attributes/audio/schedule.d.ts +11 -2
  47. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  48. package/dist/attributes/audio/schedule.js +15 -8
  49. package/dist/attributes/audio/schedule.js.map +1 -1
  50. package/dist/attributes/audio/sound.d.ts +4 -2
  51. package/dist/attributes/audio/sound.d.ts.map +1 -1
  52. package/dist/attributes/audio/sound.js +8 -4
  53. package/dist/attributes/audio/sound.js.map +1 -1
  54. package/dist/attributes/index.d.ts +1 -0
  55. package/dist/attributes/index.d.ts.map +1 -1
  56. package/dist/attributes/index.js +1 -0
  57. package/dist/attributes/index.js.map +1 -1
  58. package/dist/attributes/layout/alignment.js +1 -1
  59. package/dist/attributes/layout/alignment.js.map +1 -1
  60. package/dist/attributes/layout/index.js.map +1 -1
  61. package/dist/attributes/layout/insets.js.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js.map +1 -1
  63. package/dist/attributes/layout/size.js.map +1 -1
  64. package/dist/attributes/layout/transform3d.js.map +1 -1
  65. package/dist/attributes/layout/vector2.js.map +1 -1
  66. package/dist/attributes/layout/world-transform.js.map +1 -1
  67. package/dist/attributes/mask/boolean.js.map +1 -1
  68. package/dist/attributes/mask/mask.js.map +1 -1
  69. package/dist/attributes/properties/decorator.d.ts +17 -6
  70. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  71. package/dist/attributes/properties/decorator.js +26 -14
  72. package/dist/attributes/properties/decorator.js.map +1 -1
  73. package/dist/attributes/properties/inputs.js.map +1 -1
  74. package/dist/attributes/properties/typed.d.ts +9 -2
  75. package/dist/attributes/properties/typed.d.ts.map +1 -1
  76. package/dist/attributes/properties/typed.js +15 -1
  77. package/dist/attributes/properties/typed.js.map +1 -1
  78. package/dist/attributes/render3d/orbit.d.ts +8 -8
  79. package/dist/attributes/render3d/orbit.js +7 -7
  80. package/dist/attributes/render3d/orbit.js.map +1 -1
  81. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  82. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  83. package/dist/attributes/shape/corners/corners.js.map +1 -1
  84. package/dist/attributes/shape/corners/index.js.map +1 -1
  85. package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
  86. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  87. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  88. package/dist/attributes/shape/effects/chain.d.ts +28 -120
  89. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  90. package/dist/attributes/shape/effects/chain.js +16 -88
  91. package/dist/attributes/shape/effects/chain.js.map +1 -1
  92. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  96. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  97. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  98. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  99. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  100. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
  101. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  102. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
  103. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  104. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  105. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  106. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  107. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  108. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  109. package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
  110. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  111. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  112. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  113. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  115. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  117. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
  119. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  121. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  123. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  125. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  127. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  129. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  131. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/shader.js +15 -8
  133. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  135. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  137. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  139. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  141. package/dist/attributes/shape/effects/index.d.ts +2 -6
  142. package/dist/attributes/shape/effects/index.d.ts.map +1 -1
  143. package/dist/attributes/shape/effects/index.js.map +1 -1
  144. package/dist/attributes/shape/effects/registry.d.ts +23 -6
  145. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  146. package/dist/attributes/shape/effects/registry.js +44 -10
  147. package/dist/attributes/shape/effects/registry.js.map +1 -1
  148. package/dist/attributes/shape/effects/union.d.ts +2 -6
  149. package/dist/attributes/shape/effects/union.d.ts.map +1 -1
  150. package/dist/attributes/shape/effects/union.js.map +1 -1
  151. package/dist/attributes/shape/fill/blend.js.map +1 -1
  152. package/dist/attributes/shape/fill/chain.js.map +1 -1
  153. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  154. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  155. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  156. package/dist/attributes/shape/fill/color/parser.js +81 -44
  157. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  158. package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
  159. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
  160. package/dist/attributes/shape/fill/gradient-stops.js +65 -0
  161. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
  162. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  163. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  164. package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
  165. package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
  166. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  167. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  168. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  169. package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
  170. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  171. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  172. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  173. package/dist/attributes/shape/fill/implementations/image.js +5 -4
  174. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  175. package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
  176. package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
  177. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  178. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  179. package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
  180. package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
  181. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  182. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  183. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  184. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  185. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  186. package/dist/attributes/shape/fill/index.js.map +1 -1
  187. package/dist/attributes/shape/fill/lerp.d.ts +9 -1
  188. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  189. package/dist/attributes/shape/fill/lerp.js +12 -1
  190. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  191. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  192. package/dist/attributes/shape/fill/registry.js.map +1 -1
  193. package/dist/attributes/shape/fill/union.js.map +1 -1
  194. package/dist/attributes/shape/filters/chain.d.ts +4 -10
  195. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  196. package/dist/attributes/shape/filters/chain.js +1 -13
  197. package/dist/attributes/shape/filters/chain.js.map +1 -1
  198. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  199. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  200. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  201. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  202. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  203. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  204. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  205. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  206. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  207. package/dist/attributes/shape/filters/index.d.ts +1 -1
  208. package/dist/attributes/shape/filters/index.js.map +1 -1
  209. package/dist/attributes/shape/filters/registry.d.ts +2 -2
  210. package/dist/attributes/shape/filters/registry.js +3 -3
  211. package/dist/attributes/shape/filters/registry.js.map +1 -1
  212. package/dist/attributes/shape/filters/union.d.ts +6 -7
  213. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  214. package/dist/attributes/shape/filters/union.js.map +1 -1
  215. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  216. package/dist/attributes/shape/path/anchors.js +12 -5
  217. package/dist/attributes/shape/path/anchors.js.map +1 -1
  218. package/dist/attributes/shape/path/bezier.js.map +1 -1
  219. package/dist/attributes/shape/path/index.js.map +1 -1
  220. package/dist/attributes/shape/path/measure.js.map +1 -1
  221. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  222. package/dist/attributes/shape/path/morph.js +16 -4
  223. package/dist/attributes/shape/path/morph.js.map +1 -1
  224. package/dist/attributes/shape/path/ops.js.map +1 -1
  225. package/dist/attributes/shape/path/types.js.map +1 -1
  226. package/dist/attributes/shape/path/walk.js.map +1 -1
  227. package/dist/attributes/shape/shaders/index.js.map +1 -1
  228. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  229. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  230. package/dist/attributes/shape/shadow/index.js.map +1 -1
  231. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  232. package/dist/attributes/shape/stroke/index.d.ts +2 -2
  233. package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
  234. package/dist/attributes/shape/stroke/index.js +1 -1
  235. package/dist/attributes/shape/stroke/index.js.map +1 -1
  236. package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
  237. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  238. package/dist/attributes/shape/stroke/stroke.js +22 -2
  239. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  240. package/dist/attributes/shared/operators.js.map +1 -1
  241. package/dist/attributes/text/index.js.map +1 -1
  242. package/dist/attributes/text/ops.d.ts +6 -0
  243. package/dist/attributes/text/ops.d.ts.map +1 -1
  244. package/dist/attributes/text/ops.js +1 -0
  245. package/dist/attributes/text/ops.js.map +1 -1
  246. package/dist/attributes/text/types.js.map +1 -1
  247. package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
  248. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
  249. package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
  250. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
  251. package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
  252. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
  253. package/dist/browser/component.js +1 -1
  254. package/dist/browser/component.js.map +3 -3
  255. package/dist/browser/index.js +1 -1
  256. package/dist/browser/index.js.map +4 -4
  257. package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
  258. package/dist/browser/jsx-jsx-runtime.js +1 -1
  259. package/dist/browser/manifest.json +3 -2
  260. package/dist/browser/sdk.js +1 -1
  261. package/dist/component.js.map +1 -1
  262. package/dist/document/audio.d.ts +1 -1
  263. package/dist/document/audio.js +4 -4
  264. package/dist/document/audio.js.map +1 -1
  265. package/dist/document/builtins.d.ts.map +1 -1
  266. package/dist/document/builtins.js +8 -14
  267. package/dist/document/builtins.js.map +1 -1
  268. package/dist/document/command-traits.d.ts +1 -1
  269. package/dist/document/command-traits.d.ts.map +1 -1
  270. package/dist/document/command-traits.js +17 -3
  271. package/dist/document/command-traits.js.map +1 -1
  272. package/dist/document/deny-globals.js.map +1 -1
  273. package/dist/document/diff.js.map +1 -1
  274. package/dist/document/doc-index.d.ts +2 -2
  275. package/dist/document/doc-index.d.ts.map +1 -1
  276. package/dist/document/doc-index.js.map +1 -1
  277. package/dist/document/expression/compile.d.ts.map +1 -1
  278. package/dist/document/expression/compile.js +8 -5
  279. package/dist/document/expression/compile.js.map +1 -1
  280. package/dist/document/expression/index.js.map +1 -1
  281. package/dist/document/expression/ops.js +1 -1
  282. package/dist/document/expression/ops.js.map +1 -1
  283. package/dist/document/expression/parse.d.ts.map +1 -1
  284. package/dist/document/expression/parse.js +15 -6
  285. package/dist/document/expression/parse.js.map +1 -1
  286. package/dist/document/expression/refs.d.ts +1 -1
  287. package/dist/document/expression/refs.js +1 -1
  288. package/dist/document/expression/refs.js.map +1 -1
  289. package/dist/document/expression/types.js.map +1 -1
  290. package/dist/document/expression/walk.d.ts.map +1 -1
  291. package/dist/document/expression/walk.js +2 -1
  292. package/dist/document/expression/walk.js.map +1 -1
  293. package/dist/document/index.d.ts +2 -0
  294. package/dist/document/index.d.ts.map +1 -1
  295. package/dist/document/index.js +2 -0
  296. package/dist/document/index.js.map +1 -1
  297. package/dist/document/node-decorator.js.map +1 -1
  298. package/dist/document/node-descriptor.d.ts +19 -0
  299. package/dist/document/node-descriptor.d.ts.map +1 -1
  300. package/dist/document/node-descriptor.js.map +1 -1
  301. package/dist/document/placement.d.ts +70 -0
  302. package/dist/document/placement.d.ts.map +1 -0
  303. package/dist/document/placement.js +83 -0
  304. package/dist/document/placement.js.map +1 -0
  305. package/dist/document/project.d.ts +2 -2
  306. package/dist/document/project.d.ts.map +1 -1
  307. package/dist/document/project.js.map +1 -1
  308. package/dist/document/registry.d.ts +34 -16
  309. package/dist/document/registry.d.ts.map +1 -1
  310. package/dist/document/registry.js +51 -12
  311. package/dist/document/registry.js.map +1 -1
  312. package/dist/document/timeline-patch.js.map +1 -1
  313. package/dist/document/timeline.d.ts +73 -18
  314. package/dist/document/timeline.d.ts.map +1 -1
  315. package/dist/document/timeline.js +192 -40
  316. package/dist/document/timeline.js.map +1 -1
  317. package/dist/document/types.d.ts +12 -12
  318. package/dist/document/types.d.ts.map +1 -1
  319. package/dist/document/types.js +2 -2
  320. package/dist/document/types.js.map +1 -1
  321. package/dist/document/validate.d.ts +2 -2
  322. package/dist/document/validate.d.ts.map +1 -1
  323. package/dist/document/validate.js +37 -31
  324. package/dist/document/validate.js.map +1 -1
  325. package/dist/document/withdraw.d.ts +28 -0
  326. package/dist/document/withdraw.d.ts.map +1 -0
  327. package/dist/document/withdraw.js +61 -0
  328. package/dist/document/withdraw.js.map +1 -0
  329. package/dist/index.d.ts +1 -0
  330. package/dist/index.d.ts.map +1 -1
  331. package/dist/index.js +1 -0
  332. package/dist/index.js.map +1 -1
  333. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  334. package/dist/jsx/jsx-runtime.d.ts +9 -1
  335. package/dist/jsx/jsx-runtime.d.ts.map +1 -1
  336. package/dist/jsx/jsx-runtime.js +13 -3
  337. package/dist/jsx/jsx-runtime.js.map +1 -1
  338. package/dist/layout/bounds.d.ts +0 -1
  339. package/dist/layout/bounds.d.ts.map +1 -1
  340. package/dist/layout/bounds.js.map +1 -1
  341. package/dist/layout/constraints.js.map +1 -1
  342. package/dist/layout/flex.d.ts +4 -2
  343. package/dist/layout/flex.d.ts.map +1 -1
  344. package/dist/layout/flex.js +27 -11
  345. package/dist/layout/flex.js.map +1 -1
  346. package/dist/layout/freeform.js.map +1 -1
  347. package/dist/layout/grid.js.map +1 -1
  348. package/dist/layout/index.js.map +1 -1
  349. package/dist/layout/item.js.map +1 -1
  350. package/dist/layout/ops.d.ts +6 -0
  351. package/dist/layout/ops.d.ts.map +1 -1
  352. package/dist/layout/ops.js +6 -0
  353. package/dist/layout/ops.js.map +1 -1
  354. package/dist/layout/types.js.map +1 -1
  355. package/dist/nodes/2d/node-lifecycle.js.map +1 -1
  356. package/dist/nodes/2d/node-motion.js.map +1 -1
  357. package/dist/nodes/2d/node-render.d.ts +3 -3
  358. package/dist/nodes/2d/node-render.d.ts.map +1 -1
  359. package/dist/nodes/2d/node-render.js.map +1 -1
  360. package/dist/nodes/2d/node-transform.js.map +1 -1
  361. package/dist/nodes/2d/node2d.d.ts +115 -3
  362. package/dist/nodes/2d/node2d.d.ts.map +1 -1
  363. package/dist/nodes/2d/node2d.js +188 -32
  364. package/dist/nodes/2d/node2d.js.map +1 -1
  365. package/dist/nodes/2d/paint-node.d.ts +27 -0
  366. package/dist/nodes/2d/paint-node.d.ts.map +1 -1
  367. package/dist/nodes/2d/paint-node.js +42 -0
  368. package/dist/nodes/2d/paint-node.js.map +1 -1
  369. package/dist/nodes/audio/audio-bus.js.map +1 -1
  370. package/dist/nodes/audio/index.js.map +1 -1
  371. package/dist/nodes/audio/node-audio.d.ts +3 -2
  372. package/dist/nodes/audio/node-audio.d.ts.map +1 -1
  373. package/dist/nodes/audio/node-audio.js +8 -5
  374. package/dist/nodes/audio/node-audio.js.map +1 -1
  375. package/dist/nodes/audio/sound-node.d.ts +2 -2
  376. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  377. package/dist/nodes/audio/sound-node.js +2 -2
  378. package/dist/nodes/audio/sound-node.js.map +1 -1
  379. package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
  380. package/dist/nodes/geometry/bounds-shape-node.js +2 -2
  381. package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
  382. package/dist/nodes/geometry/box-path-node.d.ts +3 -3
  383. package/dist/nodes/geometry/box-path-node.js +2 -2
  384. package/dist/nodes/geometry/box-path-node.js.map +1 -1
  385. package/dist/nodes/geometry/ellipse-node.js.map +1 -1
  386. package/dist/nodes/geometry/group-bounds.d.ts +2 -2
  387. package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
  388. package/dist/nodes/geometry/group-bounds.js +1 -2
  389. package/dist/nodes/geometry/group-bounds.js.map +1 -1
  390. package/dist/nodes/geometry/path-node.d.ts.map +1 -1
  391. package/dist/nodes/geometry/path-node.js +6 -0
  392. package/dist/nodes/geometry/path-node.js.map +1 -1
  393. package/dist/nodes/geometry/polygon-node.js.map +1 -1
  394. package/dist/nodes/geometry/polygram-node.js.map +1 -1
  395. package/dist/nodes/geometry/rect-node.js.map +1 -1
  396. package/dist/nodes/geometry/shape-node.js.map +1 -1
  397. package/dist/nodes/geometry/shape-outline.d.ts +2 -2
  398. package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
  399. package/dist/nodes/geometry/shape-outline.js +2 -13
  400. package/dist/nodes/geometry/shape-outline.js.map +1 -1
  401. package/dist/nodes/index.d.ts +3 -8
  402. package/dist/nodes/index.d.ts.map +1 -1
  403. package/dist/nodes/index.js +3 -8
  404. package/dist/nodes/index.js.map +1 -1
  405. package/dist/nodes/layout/camera-node.d.ts +9 -0
  406. package/dist/nodes/layout/camera-node.d.ts.map +1 -1
  407. package/dist/nodes/layout/camera-node.js +38 -3
  408. package/dist/nodes/layout/camera-node.js.map +1 -1
  409. package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
  410. package/dist/nodes/layout/orbit-camera-node.js +1 -1
  411. package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
  412. package/dist/nodes/layout/rotated-box.js.map +1 -1
  413. package/dist/nodes/media/video-node.d.ts.map +1 -1
  414. package/dist/nodes/media/video-node.js +5 -3
  415. package/dist/nodes/media/video-node.js.map +1 -1
  416. package/dist/nodes/node/declare-paints.js.map +1 -1
  417. package/dist/nodes/node/node-editor-state.js.map +1 -1
  418. package/dist/nodes/node/node-reactive.js.map +1 -1
  419. package/dist/nodes/node/node-time.d.ts +3 -3
  420. package/dist/nodes/node/node-time.d.ts.map +1 -1
  421. package/dist/nodes/node/node-time.js +1 -1
  422. package/dist/nodes/node/node-time.js.map +1 -1
  423. package/dist/nodes/node/node-walk.js.map +1 -1
  424. package/dist/nodes/node/node.d.ts +5 -3
  425. package/dist/nodes/node/node.d.ts.map +1 -1
  426. package/dist/nodes/node/node.js +44 -19
  427. package/dist/nodes/node/node.js.map +1 -1
  428. package/dist/nodes/node/text-defaults.d.ts +10 -12
  429. package/dist/nodes/node/text-defaults.d.ts.map +1 -1
  430. package/dist/nodes/node/text-defaults.js +10 -12
  431. package/dist/nodes/node/text-defaults.js.map +1 -1
  432. package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
  433. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
  434. package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
  435. package/dist/nodes/root/canvas2d-node.js.map +1 -0
  436. package/dist/nodes/root/provider-node.d.ts.map +1 -0
  437. package/dist/nodes/root/provider-node.js.map +1 -0
  438. package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
  439. package/dist/nodes/root/theme-provider-node.js.map +1 -0
  440. package/dist/nodes/text/default-text-style-node.d.ts +5 -2
  441. package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
  442. package/dist/nodes/text/default-text-style-node.js +10 -4
  443. package/dist/nodes/text/default-text-style-node.js.map +1 -1
  444. package/dist/nodes/text/number-format.d.ts +1 -1
  445. package/dist/nodes/text/number-format.js +1 -1
  446. package/dist/nodes/text/number-format.js.map +1 -1
  447. package/dist/nodes/text/number-node.js.map +1 -1
  448. package/dist/nodes/text/number-pattern.js.map +1 -1
  449. package/dist/nodes/text/richtext-node.js +1 -1
  450. package/dist/nodes/text/richtext-node.js.map +1 -1
  451. package/dist/nodes/text/text-base.d.ts.map +1 -1
  452. package/dist/nodes/text/text-base.js +1 -1
  453. package/dist/nodes/text/text-base.js.map +1 -1
  454. package/dist/nodes/text/text-node.js.map +1 -1
  455. package/dist/nodes/text/text-selection.js.map +1 -1
  456. package/dist/nodes/three/camera-nodes.d.ts +21 -3
  457. package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
  458. package/dist/nodes/three/camera-nodes.js +42 -1
  459. package/dist/nodes/three/camera-nodes.js.map +1 -1
  460. package/dist/nodes/three/canvas3d-node.d.ts +29 -6
  461. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  462. package/dist/nodes/three/canvas3d-node.js +44 -2
  463. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  464. package/dist/nodes/three/drawable-nodes.d.ts +25 -11
  465. package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
  466. package/dist/nodes/three/drawable-nodes.js +43 -13
  467. package/dist/nodes/three/drawable-nodes.js.map +1 -1
  468. package/dist/nodes/three/environment-nodes.d.ts +9 -3
  469. package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
  470. package/dist/nodes/three/environment-nodes.js.map +1 -1
  471. package/dist/nodes/three/geometry-nodes.d.ts +2 -2
  472. package/dist/nodes/three/geometry-nodes.js +2 -2
  473. package/dist/nodes/three/geometry-nodes.js.map +1 -1
  474. package/dist/nodes/three/grid-geometry3d.js.map +1 -1
  475. package/dist/nodes/three/group3d.js.map +1 -1
  476. package/dist/nodes/three/light-nodes.d.ts.map +1 -1
  477. package/dist/nodes/three/light-nodes.js +3 -3
  478. package/dist/nodes/three/light-nodes.js.map +1 -1
  479. package/dist/nodes/three/mesh3d.js.map +1 -1
  480. package/dist/nodes/three/node3d.d.ts +48 -0
  481. package/dist/nodes/three/node3d.d.ts.map +1 -1
  482. package/dist/nodes/three/node3d.js +53 -3
  483. package/dist/nodes/three/node3d.js.map +1 -1
  484. package/dist/platform/audio-sink.d.ts +2 -2
  485. package/dist/platform/audio-sink.d.ts.map +1 -1
  486. package/dist/platform/audio-sink.js.map +1 -1
  487. package/dist/platform/exporter.d.ts +13 -8
  488. package/dist/platform/exporter.d.ts.map +1 -1
  489. package/dist/platform/exporter.js.map +1 -1
  490. package/dist/platform/index.d.ts +1 -1
  491. package/dist/platform/index.d.ts.map +1 -1
  492. package/dist/platform/index.js.map +1 -1
  493. package/dist/platform/stepped-clock.js.map +1 -1
  494. package/dist/platform/storage-adapter.d.ts +12 -6
  495. package/dist/platform/storage-adapter.d.ts.map +1 -1
  496. package/dist/platform/storage-adapter.js +4 -0
  497. package/dist/platform/storage-adapter.js.map +1 -1
  498. package/dist/platform/ticker.d.ts +6 -0
  499. package/dist/platform/ticker.d.ts.map +1 -1
  500. package/dist/platform/ticker.js +6 -0
  501. package/dist/platform/ticker.js.map +1 -1
  502. package/dist/project/config.js.map +1 -1
  503. package/dist/project/index.js.map +1 -1
  504. package/dist/project/tree.d.ts +3 -3
  505. package/dist/project/tree.d.ts.map +1 -1
  506. package/dist/project/tree.js.map +1 -1
  507. package/dist/props/host.js.map +1 -1
  508. package/dist/props/index.js.map +1 -1
  509. package/dist/props/observer.js.map +1 -1
  510. package/dist/props/slot.js.map +1 -1
  511. package/dist/renamed-scene-names.d.ts +17 -0
  512. package/dist/renamed-scene-names.d.ts.map +1 -0
  513. package/dist/renamed-scene-names.js +9 -0
  514. package/dist/renamed-scene-names.js.map +1 -0
  515. package/dist/render/canvas-render-context2d.d.ts +10 -3
  516. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  517. package/dist/render/canvas-render-context2d.js +10 -0
  518. package/dist/render/canvas-render-context2d.js.map +1 -1
  519. package/dist/render/clip-contains.js.map +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/ellipse.js.map +1 -1
  522. package/dist/render/descriptors/latex.js.map +1 -1
  523. package/dist/render/descriptors/line.js.map +1 -1
  524. package/dist/render/descriptors/path-builder.js.map +1 -1
  525. package/dist/render/descriptors/path.js.map +1 -1
  526. package/dist/render/descriptors/polygon.js.map +1 -1
  527. package/dist/render/descriptors/polygram.js.map +1 -1
  528. package/dist/render/descriptors/rect.js.map +1 -1
  529. package/dist/render/descriptors/richtext.js.map +1 -1
  530. package/dist/render/descriptors/shape.d.ts +12 -0
  531. package/dist/render/descriptors/shape.d.ts.map +1 -1
  532. package/dist/render/descriptors/shape.js.map +1 -1
  533. package/dist/render/descriptors/text.d.ts +2 -2
  534. package/dist/render/descriptors/text.js +2 -2
  535. package/dist/render/descriptors/text.js.map +1 -1
  536. package/dist/render/descriptors/transform.d.ts +2 -2
  537. package/dist/render/descriptors/transform.d.ts.map +1 -1
  538. package/dist/render/descriptors/transform.js.map +1 -1
  539. package/dist/render/graphics2d.d.ts +3 -3
  540. package/dist/render/graphics2d.d.ts.map +1 -1
  541. package/dist/render/graphics2d.js +1 -1
  542. package/dist/render/graphics2d.js.map +1 -1
  543. package/dist/render/index.js.map +1 -1
  544. package/dist/render/measure-context.js.map +1 -1
  545. package/dist/render/null-render-context.js.map +1 -1
  546. package/dist/render/render-context2d.d.ts +5 -5
  547. package/dist/render/render-context2d.d.ts.map +1 -1
  548. package/dist/render/render-context2d.js.map +1 -1
  549. package/dist/render/surface.js.map +1 -1
  550. package/dist/render/text-defaults.js.map +1 -1
  551. package/dist/render/text-layout.js.map +1 -1
  552. package/dist/render3d/bounds3d.d.ts.map +1 -1
  553. package/dist/render3d/bounds3d.js +4 -2
  554. package/dist/render3d/bounds3d.js.map +1 -1
  555. package/dist/render3d/builders.js.map +1 -1
  556. package/dist/render3d/camera.d.ts +6 -0
  557. package/dist/render3d/camera.d.ts.map +1 -1
  558. package/dist/render3d/camera.js +5 -3
  559. package/dist/render3d/camera.js.map +1 -1
  560. package/dist/render3d/fill3d.d.ts +2 -9
  561. package/dist/render3d/fill3d.d.ts.map +1 -1
  562. package/dist/render3d/fill3d.js +2 -13
  563. package/dist/render3d/fill3d.js.map +1 -1
  564. package/dist/render3d/geometry.d.ts +8 -1
  565. package/dist/render3d/geometry.d.ts.map +1 -1
  566. package/dist/render3d/geometry.js.map +1 -1
  567. package/dist/render3d/graphics3d.d.ts +8 -4
  568. package/dist/render3d/graphics3d.d.ts.map +1 -1
  569. package/dist/render3d/graphics3d.js +18 -10
  570. package/dist/render3d/graphics3d.js.map +1 -1
  571. package/dist/render3d/index.d.ts +1 -1
  572. package/dist/render3d/index.js +1 -1
  573. package/dist/render3d/index.js.map +1 -1
  574. package/dist/render3d/inert.d.ts +14 -0
  575. package/dist/render3d/inert.d.ts.map +1 -0
  576. package/dist/render3d/inert.js +62 -0
  577. package/dist/render3d/inert.js.map +1 -0
  578. package/dist/render3d/light.js.map +1 -1
  579. package/dist/render3d/material.d.ts +10 -5
  580. package/dist/render3d/material.d.ts.map +1 -1
  581. package/dist/render3d/material.js.map +1 -1
  582. package/dist/render3d/matrix4.js.map +1 -1
  583. package/dist/render3d/render-context3d.js.map +1 -1
  584. package/dist/render3d/resources.d.ts +2 -2
  585. package/dist/render3d/resources.js +2 -2
  586. package/dist/render3d/resources.js.map +1 -1
  587. package/dist/render3d/rounded-box.js.map +1 -1
  588. package/dist/render3d/scene-settings.d.ts +23 -4
  589. package/dist/render3d/scene-settings.d.ts.map +1 -1
  590. package/dist/render3d/scene-settings.js.map +1 -1
  591. package/dist/render3d/scene3d.d.ts +11 -0
  592. package/dist/render3d/scene3d.d.ts.map +1 -1
  593. package/dist/render3d/scene3d.js +39 -6
  594. package/dist/render3d/scene3d.js.map +1 -1
  595. package/dist/render3d/segments.js.map +1 -1
  596. package/dist/render3d/texture.d.ts +9 -0
  597. package/dist/render3d/texture.d.ts.map +1 -1
  598. package/dist/render3d/texture.js +13 -0
  599. package/dist/render3d/texture.js.map +1 -1
  600. package/dist/render3d/tracking.js.map +1 -1
  601. package/dist/render3d/transform.d.ts +1 -1
  602. package/dist/render3d/transform.js.map +1 -1
  603. package/dist/render3d/vector3.d.ts +18 -1
  604. package/dist/render3d/vector3.d.ts.map +1 -1
  605. package/dist/render3d/vector3.js +27 -0
  606. package/dist/render3d/vector3.js.map +1 -1
  607. package/dist/render3d/walk.d.ts +1 -1
  608. package/dist/render3d/walk.d.ts.map +1 -1
  609. package/dist/render3d/walk.js +5 -1
  610. package/dist/render3d/walk.js.map +1 -1
  611. package/dist/runtime/asset-refine.js.map +1 -1
  612. package/dist/runtime/asset-timeline.js.map +1 -1
  613. package/dist/runtime/asset-update.js.map +1 -1
  614. package/dist/runtime/audio-index.d.ts +2 -2
  615. package/dist/runtime/audio-index.d.ts.map +1 -1
  616. package/dist/runtime/audio-index.js +8 -2
  617. package/dist/runtime/audio-index.js.map +1 -1
  618. package/dist/runtime/builtin-context.js.map +1 -1
  619. package/dist/runtime/clip-instance.d.ts +5 -3
  620. package/dist/runtime/clip-instance.d.ts.map +1 -1
  621. package/dist/runtime/clip-instance.js +10 -6
  622. package/dist/runtime/clip-instance.js.map +1 -1
  623. package/dist/runtime/clip-store.d.ts +9 -0
  624. package/dist/runtime/clip-store.d.ts.map +1 -1
  625. package/dist/runtime/clip-store.js +33 -3
  626. package/dist/runtime/clip-store.js.map +1 -1
  627. package/dist/runtime/engine.d.ts +5 -0
  628. package/dist/runtime/engine.d.ts.map +1 -1
  629. package/dist/runtime/engine.js +2 -0
  630. package/dist/runtime/engine.js.map +1 -1
  631. package/dist/runtime/frame-time.d.ts +31 -0
  632. package/dist/runtime/frame-time.d.ts.map +1 -0
  633. package/dist/runtime/frame-time.js +29 -0
  634. package/dist/runtime/frame-time.js.map +1 -0
  635. package/dist/runtime/index.d.ts +1 -0
  636. package/dist/runtime/index.d.ts.map +1 -1
  637. package/dist/runtime/index.js +1 -0
  638. package/dist/runtime/index.js.map +1 -1
  639. package/dist/runtime/node-picking.d.ts +44 -3
  640. package/dist/runtime/node-picking.d.ts.map +1 -1
  641. package/dist/runtime/node-picking.js +118 -3
  642. package/dist/runtime/node-picking.js.map +1 -1
  643. package/dist/runtime/node-picking3d.d.ts +2 -1
  644. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  645. package/dist/runtime/node-picking3d.js +5 -2
  646. package/dist/runtime/node-picking3d.js.map +1 -1
  647. package/dist/runtime/placement.d.ts.map +1 -1
  648. package/dist/runtime/placement.js +4 -5
  649. package/dist/runtime/placement.js.map +1 -1
  650. package/dist/runtime/playback-controller.d.ts +31 -2
  651. package/dist/runtime/playback-controller.d.ts.map +1 -1
  652. package/dist/runtime/playback-controller.js +63 -6
  653. package/dist/runtime/playback-controller.js.map +1 -1
  654. package/dist/runtime/playback.js.map +1 -1
  655. package/dist/runtime/precompisition.js.map +1 -1
  656. package/dist/runtime/project-assets.js.map +1 -1
  657. package/dist/runtime/session.d.ts +9 -7
  658. package/dist/runtime/session.d.ts.map +1 -1
  659. package/dist/runtime/session.js +12 -4
  660. package/dist/runtime/session.js.map +1 -1
  661. package/dist/runtime/settle.js.map +1 -1
  662. package/dist/runtime/state-evaluator.d.ts +1 -1
  663. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  664. package/dist/runtime/state-evaluator.js +4 -3
  665. package/dist/runtime/state-evaluator.js.map +1 -1
  666. package/dist/runtime/text-geometry.js.map +1 -1
  667. package/dist/sdk/index.d.ts +27 -22
  668. package/dist/sdk/index.d.ts.map +1 -1
  669. package/dist/sdk/index.js +23 -9
  670. package/dist/sdk/index.js.map +1 -1
  671. package/dist/tween/command-decorator.d.ts +12 -4
  672. package/dist/tween/command-decorator.d.ts.map +1 -1
  673. package/dist/tween/command-decorator.js +10 -22
  674. package/dist/tween/command-decorator.js.map +1 -1
  675. package/dist/tween/command.js.map +1 -1
  676. package/dist/tween/ease/constants.d.ts.map +1 -1
  677. package/dist/tween/ease/constants.js +8 -5
  678. package/dist/tween/ease/constants.js.map +1 -1
  679. package/dist/tween/ease/curve.d.ts.map +1 -1
  680. package/dist/tween/ease/curve.js +4 -3
  681. package/dist/tween/ease/curve.js.map +1 -1
  682. package/dist/tween/ease/describe.d.ts +15 -0
  683. package/dist/tween/ease/describe.d.ts.map +1 -0
  684. package/dist/tween/ease/describe.js +37 -0
  685. package/dist/tween/ease/describe.js.map +1 -0
  686. package/dist/tween/ease/type.js.map +1 -1
  687. package/dist/tween/index.js.map +1 -1
  688. package/dist/tween/inert.js.map +1 -1
  689. package/dist/tween/lerp.js.map +1 -1
  690. package/dist/tween/loop.js.map +1 -1
  691. package/dist/tween/prepare.d.ts +3 -3
  692. package/dist/tween/prepare.js +3 -3
  693. package/dist/tween/prepare.js.map +1 -1
  694. package/dist/tween/seekable.d.ts +12 -1
  695. package/dist/tween/seekable.d.ts.map +1 -1
  696. package/dist/tween/seekable.js +15 -0
  697. package/dist/tween/seekable.js.map +1 -1
  698. package/dist/tween/stepper.js.map +1 -1
  699. package/dist/tween/to-command.js.map +1 -1
  700. package/dist/util/clamp.js.map +1 -1
  701. package/dist/util/context.js.map +1 -1
  702. package/dist/util/csv.js.map +1 -1
  703. package/dist/util/generateList.js.map +1 -1
  704. package/dist/util/index.js.map +1 -1
  705. package/dist/util/metrics.d.ts +1 -1
  706. package/dist/util/metrics.js +1 -1
  707. package/dist/util/metrics.js.map +1 -1
  708. package/dist/util/random.js.map +1 -1
  709. package/dist/util/reference.js.map +1 -1
  710. package/dist/util/scheduler.js.map +1 -1
  711. package/package.json +2 -1
  712. package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
  713. package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
  714. package/dist/attributes/shape/effects/implementations/displace.js +0 -30
  715. package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
  716. package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
  717. package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
  718. package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
  719. package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
  720. package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
  721. package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
  722. package/dist/attributes/shape/effects/implementations/texture.js +0 -25
  723. package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
  724. package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
  725. package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
  726. package/dist/attributes/shape/effects/implementations/trails.js +0 -22
  727. package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
  728. package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
  729. package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
  730. package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
  731. package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
  732. package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
  733. package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
  734. package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
  735. package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
  736. package/dist/nodes/geometry/dot-grid-node.js +0 -142
  737. package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
  738. package/dist/nodes/geometry/grid-lines.d.ts +0 -101
  739. package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
  740. package/dist/nodes/geometry/grid-lines.js +0 -128
  741. package/dist/nodes/geometry/grid-lines.js.map +0 -1
  742. package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
  743. package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
  744. package/dist/nodes/geometry/grid-pattern-node.js +0 -172
  745. package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
  746. package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
  747. package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
  748. package/dist/nodes/geometry/line-grid-node.js +0 -127
  749. package/dist/nodes/geometry/line-grid-node.js.map +0 -1
  750. package/dist/nodes/geometry/line-node.d.ts +0 -58
  751. package/dist/nodes/geometry/line-node.d.ts.map +0 -1
  752. package/dist/nodes/geometry/line-node.js +0 -123
  753. package/dist/nodes/geometry/line-node.js.map +0 -1
  754. package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
  755. package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
  756. package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
  757. package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
  758. package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
  759. package/dist/nodes/scene/canvas2d-node.js.map +0 -1
  760. package/dist/nodes/scene/provider-node.d.ts.map +0 -1
  761. package/dist/nodes/scene/provider-node.js.map +0 -1
  762. package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
  763. package/dist/nodes/scene/theme-provider-node.js.map +0 -1
  764. /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
  765. /package/dist/nodes/{scene → root}/provider-node.js +0 -0
  766. /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
  767. /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"box-path-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/box-path-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAmB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAMrC,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAWtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,OAAO,SAAU,SAAQ,SAAyB;IAItD,YAAY,KAA4C;QACtD,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;IAED;;;OAGG;IACK,OAAO;QACb,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAA;QACjC,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAA;QAClC,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED;;;;;OAKG;IACK,OAAO;QACb,OAAO,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3E,CAAC;IAED;;;;;;;;OAQG;IACK,YAAY;QAClB,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC,CAAA;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAA;QACtC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACvB,CAAC;IAEkB,aAAa;QAC9B,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;YACpB,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACgB,QAAQ;QACzB,OAAO,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC;YACrB,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;SACjC,CAAC,CAAA;IACJ,CAAC;CACF;AAtES;IADP,YAAY,EAAE;uCACO","sourcesContent":["import { pathProperty } from \"@/attributes/properties/typed\";\nimport { ShapeNode, type ShapeProps } from \"./shape-node\";\nimport { type NodeConfig } from \"@/nodes/2d/node2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport {\n type PathBounds,\n type PathCommand,\n type PathData,\n} from \"@/render/descriptors/path\";\nimport { pathOps } from \"@/attributes/shape/path/ops\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\n\nexport interface PathShapeProps extends ShapeProps {\n /**\n * The geometry, as an SVG `d` string in the node's **unit box** — see\n * `model/vector-path`.\n */\n data: PathData\n}\n\n/**\n * The editable Path node: arbitrary vector geometry, drawn as a fraction of the\n * node's own box.\n *\n * ## Why not motion-script's `Path`\n *\n * That class draws its `data` at face value and hugs the result, which is\n * exactly right for a path somebody wrote in code and wrong for one somebody\n * drags the corner of. A node whose geometry is measured in absolute pixels has\n * no answer to a resize handle: writing `width` moves the box and leaves the\n * drawing where it was, and the alternative — rewriting every coordinate on\n * every pointer event — puts a path's entire geometry through the undo stack\n * sixty times a second.\n *\n * So the geometry here is stored as a fraction of the box (`x`, `y` running\n * −0.5…+0.5) and multiplied back by the laid-out size on the way to the\n * renderer. A resize is then an ordinary `width`/`height` write, which means\n * **no part of the canvas gizmo has to know a path from a rectangle** — the\n * snapping, the aspect lock, the anchor arithmetic and the mid-tween split all\n * work on it unchanged.\n *\n * The trade is that a non-uniform resize *stretches* the geometry rather than\n * repositioning it, which is what a vector shape does in every editor that has\n * one, and why nothing here ever emits an SVG arc (see `parseVectorPath`): an\n * arc under an unequal scale is a different curve, where a cubic is the same\n * curve scaled.\n *\n * ## What it means for animation\n *\n * `data` tweens through `pathOps.lerp`, which reconciles differing\n * command counts, point order and winding before interpolating — so a `to`\n * command from one path to another morphs, and morphs between shapes that were\n * never drawn as a pair. Because both ends are in unit space, that morph is also\n * independent of either node's size: two 4-point silhouettes interpolate the\n * same way whether they are 40px or 4000px across.\n */\nexport class PathShape extends ShapeNode<PathShapeProps> {\n @pathProperty()\n declare data: PathData\n\n constructor(props: NodeConfig<PathShape, PathShapeProps>) {\n super(props)\n }\n\n /**\n * The unit → pixel map, with the y flip that takes a stored path (y-down,\n * like SVG and like the editor) into the renderer's local space (y-up).\n */\n private toLocal(): (point: Vector2) => Vector2 {\n const w = this.layoutBounds.width\n const h = this.layoutBounds.height\n return (p) => ({ x: p.x * w, y: -p.y * h })\n }\n\n /**\n * `anchorsOf` takes {@link PathData}, which is what makes a `data` tween draw.\n * This used to narrow to a string first — `typeof data === \"string\" ? data : \"\"`\n * — and a morph hands over a `PathCommand[]` at every `t` strictly between 0\n * and 1, so the shape vanished for the whole tween and reappeared at the end.\n */\n private outline(): PathCommand[] {\n return pathOps.anchorCommands(pathOps.anchors(this.data), this.toLocal())\n }\n\n /**\n * The node's own box, not the geometry's.\n *\n * Path geometry may sit outside the unit box — a point dragged past an edge is\n * recorded where it was dropped, and only pulled back in when the edit ends\n * (see `normalizeVectorPath`). Letting the descriptor centre on the geometry's\n * own extent instead would slide the whole drawing sideways as that happened,\n * which is the one thing an edit must not do.\n */\n private centerBounds(): PathBounds {\n const w = this.layoutBounds.width / 2\n const h = this.layoutBounds.height / 2\n return [-w, -h, w, h]\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().path({\n data: this.outline(),\n centerBounds: this.centerBounds(),\n start: this.start,\n end: this.end,\n })\n }\n\n /**\n * The node's box, for the reasons spelled out on {@link BoundsShape.clipSelf}\n * — and here they are sharper still.\n *\n * A path is arbitrary: it can be a thin stroke, a scatter of subpaths, or\n * geometry that has been dragged clean outside its own frame. There is no\n * version of outline-precise picking that makes a shape like that reliably\n * clickable, and motion-script has no winding test for a `path` clip anyway,\n * so declaring one would leave the node unclickable rather than merely fussy.\n * The selection box is what says \"this node is here\", so it is what a click\n * lands on and what `clip: true` confines children to.\n */\n protected override clipSelf(): Clip {\n return new Clip().rect({\n x: 0,\n y: 0,\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n })\n }\n}\n"]}
1
+ {"version":3,"file":"box-path-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/box-path-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAA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OAAO,EAAE;YACpB,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACgB,QAAQ;QACzB,OAAO,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC;YACrB,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;SACjC,CAAC,CAAA;IACJ,CAAC;CACF;AAtES;IADP,YAAY,EAAE;uCACO","sourcesContent":["import { pathProperty } from \"@/attributes/properties/typed\";\r\nimport { ShapeNode, type ShapeProps } from \"./shape-node\";\r\nimport { type NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\nimport {\r\n type PathBounds,\r\n type PathCommand,\r\n type PathData,\r\n} from \"@/render/descriptors/path\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\n\r\nexport interface PathShapeProps extends ShapeProps {\r\n /**\r\n * The geometry, as an SVG `d` string in the node's **unit box** — see\r\n * {@link PathData}.\r\n */\r\n data: PathData\r\n}\r\n\r\n/**\r\n * The editable Path node: arbitrary vector geometry, drawn as a fraction of the\r\n * node's own box.\r\n *\r\n * ## Why not `Path`\r\n *\r\n * That class draws its `data` at face value and hugs the result, which is\r\n * exactly right for a path somebody wrote in code and wrong for one somebody\r\n * drags the corner of. A node whose geometry is measured in absolute pixels has\r\n * no answer to a resize handle: writing `width` moves the box and leaves the\r\n * drawing where it was, and the alternative — rewriting every coordinate on\r\n * every pointer event — puts a path's entire geometry through the undo stack\r\n * sixty times a second.\r\n *\r\n * So the geometry here is stored as a fraction of the box (`x`, `y` running\r\n * −0.5…+0.5) and multiplied back by the laid-out size on the way to the\r\n * renderer. A resize is then an ordinary `width`/`height` write, which means\r\n * **no part of the canvas gizmo has to know a path from a rectangle** — the\r\n * snapping, the aspect lock, the anchor arithmetic and the mid-tween split all\r\n * work on it unchanged.\r\n *\r\n * The trade is that a non-uniform resize *stretches* the geometry rather than\r\n * repositioning it, which is what a vector shape does in every editor that has\r\n * one, and why nothing here ever emits an SVG arc (see `parseVectorPath`): an\r\n * arc under an unequal scale is a different curve, where a cubic is the same\r\n * curve scaled.\r\n *\r\n * ## What it means for animation\r\n *\r\n * `data` tweens through `pathOps.lerp`, which reconciles differing\r\n * command counts, point order and winding before interpolating — so a `to`\r\n * command from one path to another morphs, and morphs between shapes that were\r\n * never drawn as a pair. Because both ends are in unit space, that morph is also\r\n * independent of either node's size: two 4-point silhouettes interpolate the\r\n * same way whether they are 40px or 4000px across.\r\n */\r\nexport class PathShape extends ShapeNode<PathShapeProps> {\r\n @pathProperty()\r\n declare data: PathData\r\n\r\n constructor(props: NodeConfig<PathShape, PathShapeProps>) {\r\n super(props)\r\n }\r\n\r\n /**\r\n * The unit → pixel map, with the y flip that takes a stored path (y-down,\r\n * like SVG and like the editor) into the renderer's local space (y-up).\r\n */\r\n private toLocal(): (point: Vector2) => Vector2 {\r\n const w = this.layoutBounds.width\r\n const h = this.layoutBounds.height\r\n return (p) => ({ x: p.x * w, y: -p.y * h })\r\n }\r\n\r\n /**\r\n * `anchorsOf` takes {@link PathData}, which is what makes a `data` tween draw.\r\n * This used to narrow to a string first — `typeof data === \"string\" ? data : \"\"`\r\n * — and a morph hands over a `PathCommand[]` at every `t` strictly between 0\r\n * and 1, so the shape vanished for the whole tween and reappeared at the end.\r\n */\r\n private outline(): PathCommand[] {\r\n return pathOps.anchorCommands(pathOps.anchors(this.data), this.toLocal())\r\n }\r\n\r\n /**\r\n * The node's own box, not the geometry's.\r\n *\r\n * Path geometry may sit outside the unit box — a point dragged past an edge is\r\n * recorded where it was dropped, and only pulled back in when the edit ends\r\n * (see `normalizeVectorPath`). Letting the descriptor centre on the geometry's\r\n * own extent instead would slide the whole drawing sideways as that happened,\r\n * which is the one thing an edit must not do.\r\n */\r\n private centerBounds(): PathBounds {\r\n const w = this.layoutBounds.width / 2\r\n const h = this.layoutBounds.height / 2\r\n return [-w, -h, w, h]\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n return new Graphics2D().path({\r\n data: this.outline(),\r\n centerBounds: this.centerBounds(),\r\n start: this.start,\r\n end: this.end,\r\n })\r\n }\r\n\r\n /**\r\n * The node's box, for the reasons spelled out on {@link BoundsShape.clipSelf}\r\n * — and here they are sharper still.\r\n *\r\n * A path is arbitrary: it can be a thin stroke, a scatter of subpaths, or\r\n * geometry that has been dragged clean outside its own frame. There is no\r\n * version of outline-precise picking that makes a shape like that reliably\r\n * clickable, and the engine has no winding test for a `path` clip anyway,\r\n * so declaring one would leave the node unclickable rather than merely fussy.\r\n * The selection box is what says \"this node is here\", so it is what a click\r\n * lands on and what `clip: true` confines children to.\r\n */\r\n protected override clipSelf(): Clip {\r\n return new Clip().rect({\r\n x: 0,\r\n y: 0,\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n })\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ellipse-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/ellipse-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQrC,MAAM,OAAO,OAAQ,SAAQ,SAAuB;IAMhD,YAAY,KAAwC;QAChD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC,CAAC;IACP,CAAC;CACJ;AA7BqC;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;2CAA4B;AACjB;IAAnC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;sCAAuB;AAChB;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;sCAAuB","sourcesContent":["import { property } from \"@/attributes/properties/decorator\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\n\nexport interface EllipseProps extends ShapeProps {\n ratio: number;\n sweep: number;\n startAngle: number;\n}\n\nexport class Ellipse extends ShapeNode<EllipseProps> {\n\n @property({ default: 0 }) declare startAngle: number;\n @property({ default: 360 }) declare sweep: number;\n @property({ default: 0 }) declare ratio: number;\n\n constructor(props: NodeConfig<Ellipse, EllipseProps>) {\n super(props);\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().ellipse({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n startAngle: this.startAngle,\n sweep: this.sweep,\n ratio: this.ratio,\n start: this.start,\n end: this.end,\n });\n }\n\n protected override clipSelf(): Clip {\n return new Clip().ellipse({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n startAngle: this.startAngle,\n sweep: this.sweep,\n ratio: this.ratio,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"ellipse-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/ellipse-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQrC,MAAM,OAAO,OAAQ,SAAQ,SAAuB;IAMhD,YAAY,KAAwC;QAChD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC,CAAC;IACP,CAAC;CACJ;AA7BqC;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;2CAA4B;AACjB;IAAnC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;sCAAuB;AAChB;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;sCAAuB","sourcesContent":["import { property } from \"@/attributes/properties/decorator\";\r\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\n\r\nexport interface EllipseProps extends ShapeProps {\r\n ratio: number;\r\n sweep: number;\r\n startAngle: number;\r\n}\r\n\r\nexport class Ellipse extends ShapeNode<EllipseProps> {\r\n\r\n @property({ default: 0 }) declare startAngle: number;\r\n @property({ default: 360 }) declare sweep: number;\r\n @property({ default: 0 }) declare ratio: number;\r\n\r\n constructor(props: NodeConfig<Ellipse, EllipseProps>) {\r\n super(props);\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n return new Graphics2D().ellipse({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n startAngle: this.startAngle,\r\n sweep: this.sweep,\r\n ratio: this.ratio,\r\n start: this.start,\r\n end: this.end,\r\n });\r\n }\r\n\r\n protected override clipSelf(): Clip {\r\n return new Clip().ellipse({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n startAngle: this.startAngle,\r\n sweep: this.sweep,\r\n ratio: this.ratio,\r\n });\r\n }\r\n}\r\n"]}
@@ -27,8 +27,8 @@ import { BoxBounds } from "../../layout/bounds.js";
27
27
  *
28
28
  * ## Why this composes with a resize that scales the children
29
29
  *
30
- * The studio resizes one of these nodes by scaling every child about the corner
31
- * the drag holds still (see `use-canvas-selection`), and that gesture is only
30
+ * An editor can resize one of these nodes by scaling every child about the
31
+ * corner the drag holds still, and that gesture is only
32
32
  * coherent if the box it is dragging follows the parts by the same factor. It
33
33
  * does, for all three modes: an axis-aligned scale about a point commutes with
34
34
  * union and intersection alike, so scaling every child by `k` scales the answer
@@ -1 +1 @@
1
- {"version":3,"file":"group-bounds.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/group-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,eAAe;AACvB,2DAA2D;AACzD,OAAO;AACT,6EAA6E;GAC3E,OAAO;AACT,sDAAsD;GACpD,WAAW,CAAC;AAmDlB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,GACtB,SAAS,GAAG,IAAI,CA+BlB"}
1
+ {"version":3,"file":"group-bounds.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/group-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,eAAe;AACvB,2DAA2D;AACzD,OAAO;AACT,6EAA6E;GAC3E,OAAO;AACT,sDAAsD;GACpD,WAAW,CAAC;AAkDlB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,GACtB,SAAS,GAAG,IAAI,CA+BlB"}
@@ -7,8 +7,7 @@ import { worldAnchors } from "../../nodes/2d/node-transform.js";
7
7
  * The same two-step `nodeBox` makes: shift the child's matrix onto the ink's own
8
8
  * centre (the matrix is canvas y-down and the bounds are y-up, hence the sign),
9
9
  * then read the corners off it. That is what makes this correct for a child that
10
- * is rotated, scaled, or whose ink is off-centre — a `Line`, most of all, whose
11
- * points are nowhere near its layout cell.
10
+ * is rotated, scaled, or whose ink is off-centre.
12
11
  */
13
12
  function inkCorners(child) {
14
13
  const b = child._localBounds();
@@ -1 +1 @@
1
- {"version":3,"file":"group-bounds.js","sourceRoot":"","sources":["../../../src/nodes/geometry/group-bounds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAoDzD;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,KAAa;IAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IACnC,MAAM,CAAC,GACH,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AAChE,CAAC;AAED,wEAAwE;AACxE,SAAS,MAAM,CAAC,MAAiB;IAC7B,IAAI,MAAM,CAAC,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,CAAC;IACpE,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC","sourcesContent":["import { Node2D } from \"@/nodes/2d/node2d\";\nimport { BoxBounds } from \"@/layout/bounds\";\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { multiply, translation } from \"@/attributes/layout/matrix2d\";\nimport { worldAnchors } from \"@/nodes/2d/node-transform\";\n\n/**\n * The ink extent of a node whose drawing is made **out of its children** rather\n * than out of a box of its own — a {@link BooleanGroup}, a {@link MaskGroup}.\n *\n * Both of those classes report their layout cell as their bounds by default,\n * and for both that cell is a fiction: nothing is drawn at its edges, nothing\n * is grabbable there, and it does not move when the parts inside it do. An\n * editor drawing a selection box around one is drawing a rectangle that has no\n * relationship to the pixels — which is exactly what {@link Node2D._localBounds}\n * exists to fix, and the reason it is a separate seam from `measure()`: the box\n * moves, the layout does not.\n *\n * ## Why an op decides the answer\n *\n * A bounding box is the one thing about a boolean result you *can* work out\n * without running the boolean. For a union it is even exact —\n * `bounds(A ∪ B) = bounds(A) ∪ bounds(B)` — and the same union is the honest\n * answer for `exclude`, whose result is a subset of it and whose parts are all\n * still there to be seen. The other two shrink instead: subtracting can only\n * ever cut into the first child, and an intersection lives inside every child\n * at once. So each mode below states which of those it is, and the result is a\n * *superset* of the true silhouette for `subtract`/`intersect` and exact for\n * the other two — never a box the drawing spills out of, which is the failure\n * that would matter.\n *\n * ## Why this composes with a resize that scales the children\n *\n * The studio resizes one of these nodes by scaling every child about the corner\n * the drag holds still (see `use-canvas-selection`), and that gesture is only\n * coherent if the box it is dragging follows the parts by the same factor. It\n * does, for all three modes: an axis-aligned scale about a point commutes with\n * union and intersection alike, so scaling every child by `k` scales the answer\n * here by exactly `k`. Neither half has to know about the other.\n */\nexport type ChildBoundsMode =\n /** Every child's ink, together — `union` and `exclude`. */\n | \"union\"\n /** The first child's ink alone — `subtract`'s base, and a mask's stencil. */\n | \"first\"\n /** Where every child's ink overlaps — `intersect`. */\n | \"intersect\";\n\n/** Min/max in the node's own local space, y-up, relative to its centre. */\ninterface Span {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\n/**\n * The four corners of `child`'s ink, in its **parent's** local space (y-up,\n * relative to the parent's centre).\n *\n * The same two-step `nodeBox` makes: shift the child's matrix onto the ink's own\n * centre (the matrix is canvas y-down and the bounds are y-up, hence the sign),\n * then read the corners off it. That is what makes this correct for a child that\n * is rotated, scaled, or whose ink is off-centre — a `Line`, most of all, whose\n * points are nowhere near its layout cell.\n */\nfunction inkCorners(child: Node2D): Vector2[] {\n const b = child._localBounds();\n const local = child._localMatrix();\n const m =\n b.x === 0 && b.y === 0 ? local : multiply(local, translation(b.x, -b.y));\n const a = worldAnchors(m, b.width / 2, b.height / 2);\n return [a.topLeft, a.topRight, a.bottomRight, a.bottomLeft];\n}\n\n/** The axis-aligned span of a point set, or `null` for an empty one. */\nfunction spanOf(points: Vector2[]): Span | null {\n if (points.length === 0) return null;\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n for (const p of points) {\n if (p.x < minX) minX = p.x;\n if (p.x > maxX) maxX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.y > maxY) maxY = p.y;\n }\n return { minX, minY, maxX, maxY };\n}\n\nfunction toBounds(span: Span): BoxBounds {\n return {\n x: (span.minX + span.maxX) / 2,\n y: (span.minY + span.maxY) / 2,\n width: span.maxX - span.minX,\n height: span.maxY - span.minY,\n };\n}\n\n/**\n * The extent of `node`'s children's ink in `node`'s own local space, or `null`\n * when there is nothing to measure — no children, or an `intersect` whose parts\n * don't overlap at all.\n *\n * `null` is the caller's cue to keep the layout cell: a node with no children\n * has nothing else to offer, and an empty intersection draws nothing anywhere,\n * so a box round the parts would be a box round a shape that isn't there. The\n * cell at least stays in one place and stays grabbable, which is what a node you\n * need to put another child into has to be.\n */\nexport function childInkBounds(\n node: Node2D,\n mode: ChildBoundsMode\n): BoxBounds | null {\n const children = node.children;\n if (children.length === 0) return null;\n\n if (mode === \"first\") {\n const span = spanOf(inkCorners(children[0]));\n return span ? toBounds(span) : null;\n }\n\n if (mode === \"union\") {\n const span = spanOf(children.flatMap(inkCorners));\n return span ? toBounds(span) : null;\n }\n\n let span: Span | null = null;\n for (const child of children) {\n const next = spanOf(inkCorners(child));\n if (!next) return null;\n span = span\n ? {\n minX: Math.max(span.minX, next.minX),\n minY: Math.max(span.minY, next.minY),\n maxX: Math.min(span.maxX, next.maxX),\n maxY: Math.min(span.maxY, next.maxY),\n }\n : next;\n // The parts have stopped overlapping — nothing is drawn, so there is no\n // box to draw. See the header.\n if (span.minX > span.maxX || span.minY > span.maxY) return null;\n }\n return span ? toBounds(span) : null;\n}\n"]}
1
+ {"version":3,"file":"group-bounds.js","sourceRoot":"","sources":["../../../src/nodes/geometry/group-bounds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAoDzD;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,KAAa;IAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IACnC,MAAM,CAAC,GACH,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,CAAC,CAAC,O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CAAC,CAAC,IAAI,CAAC;QACX,wEAAwE;QACxE,+BAA+B;QAC/B,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;IACpE,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC","sourcesContent":["import { Node2D } from \"@/nodes/2d/node2d\";\r\nimport { BoxBounds } from \"@/layout/bounds\";\r\nimport { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { multiply, translation } from \"@/attributes/layout/matrix2d\";\r\nimport { worldAnchors } from \"@/nodes/2d/node-transform\";\r\n\r\n/**\r\n * The ink extent of a node whose drawing is made **out of its children** rather\r\n * than out of a box of its own — a {@link BooleanGroup}, a {@link MaskGroup}.\r\n *\r\n * Both of those classes report their layout cell as their bounds by default,\r\n * and for both that cell is a fiction: nothing is drawn at its edges, nothing\r\n * is grabbable there, and it does not move when the parts inside it do. An\r\n * editor drawing a selection box around one is drawing a rectangle that has no\r\n * relationship to the pixels — which is exactly what {@link Node2D._localBounds}\r\n * exists to fix, and the reason it is a separate seam from `measure()`: the box\r\n * moves, the layout does not.\r\n *\r\n * ## Why an op decides the answer\r\n *\r\n * A bounding box is the one thing about a boolean result you *can* work out\r\n * without running the boolean. For a union it is even exact —\r\n * `bounds(A ∪ B) = bounds(A) ∪ bounds(B)` — and the same union is the honest\r\n * answer for `exclude`, whose result is a subset of it and whose parts are all\r\n * still there to be seen. The other two shrink instead: subtracting can only\r\n * ever cut into the first child, and an intersection lives inside every child\r\n * at once. So each mode below states which of those it is, and the result is a\r\n * *superset* of the true silhouette for `subtract`/`intersect` and exact for\r\n * the other two — never a box the drawing spills out of, which is the failure\r\n * that would matter.\r\n *\r\n * ## Why this composes with a resize that scales the children\r\n *\r\n * An editor can resize one of these nodes by scaling every child about the\r\n * corner the drag holds still, and that gesture is only\r\n * coherent if the box it is dragging follows the parts by the same factor. It\r\n * does, for all three modes: an axis-aligned scale about a point commutes with\r\n * union and intersection alike, so scaling every child by `k` scales the answer\r\n * here by exactly `k`. Neither half has to know about the other.\r\n */\r\nexport type ChildBoundsMode =\r\n /** Every child's ink, together — `union` and `exclude`. */\r\n | \"union\"\r\n /** The first child's ink alone — `subtract`'s base, and a mask's stencil. */\r\n | \"first\"\r\n /** Where every child's ink overlaps — `intersect`. */\r\n | \"intersect\";\r\n\r\n/** Min/max in the node's own local space, y-up, relative to its centre. */\r\ninterface Span {\r\n minX: number;\r\n minY: number;\r\n maxX: number;\r\n maxY: number;\r\n}\r\n\r\n/**\r\n * The four corners of `child`'s ink, in its **parent's** local space (y-up,\r\n * relative to the parent's centre).\r\n *\r\n * The same two-step `nodeBox` makes: shift the child's matrix onto the ink's own\r\n * centre (the matrix is canvas y-down and the bounds are y-up, hence the sign),\r\n * then read the corners off it. That is what makes this correct for a child that\r\n * is rotated, scaled, or whose ink is off-centre.\r\n */\r\nfunction inkCorners(child: Node2D): Vector2[] {\r\n const b = child._localBounds();\r\n const local = child._localMatrix();\r\n const m =\r\n b.x === 0 && b.y === 0 ? local : multiply(local, translation(b.x, -b.y));\r\n const a = worldAnchors(m, b.width / 2, b.height / 2);\r\n return [a.topLeft, a.topRight, a.bottomRight, a.bottomLeft];\r\n}\r\n\r\n/** The axis-aligned span of a point set, or `null` for an empty one. */\r\nfunction spanOf(points: Vector2[]): Span | null {\r\n if (points.length === 0) return null;\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n for (const p of points) {\r\n if (p.x < minX) minX = p.x;\r\n if (p.x > maxX) maxX = p.x;\r\n if (p.y < minY) minY = p.y;\r\n if (p.y > maxY) maxY = p.y;\r\n }\r\n return { minX, minY, maxX, maxY };\r\n}\r\n\r\nfunction toBounds(span: Span): BoxBounds {\r\n return {\r\n x: (span.minX + span.maxX) / 2,\r\n y: (span.minY + span.maxY) / 2,\r\n width: span.maxX - span.minX,\r\n height: span.maxY - span.minY,\r\n };\r\n}\r\n\r\n/**\r\n * The extent of `node`'s children's ink in `node`'s own local space, or `null`\r\n * when there is nothing to measure — no children, or an `intersect` whose parts\r\n * don't overlap at all.\r\n *\r\n * `null` is the caller's cue to keep the layout cell: a node with no children\r\n * has nothing else to offer, and an empty intersection draws nothing anywhere,\r\n * so a box round the parts would be a box round a shape that isn't there. The\r\n * cell at least stays in one place and stays grabbable, which is what a node you\r\n * need to put another child into has to be.\r\n */\r\nexport function childInkBounds(\r\n node: Node2D,\r\n mode: ChildBoundsMode\r\n): BoxBounds | null {\r\n const children = node.children;\r\n if (children.length === 0) return null;\r\n\r\n if (mode === \"first\") {\r\n const span = spanOf(inkCorners(children[0]));\r\n return span ? toBounds(span) : null;\r\n }\r\n\r\n if (mode === \"union\") {\r\n const span = spanOf(children.flatMap(inkCorners));\r\n return span ? toBounds(span) : null;\r\n }\r\n\r\n let span: Span | null = null;\r\n for (const child of children) {\r\n const next = spanOf(inkCorners(child));\r\n if (!next) return null;\r\n span = span\r\n ? {\r\n minX: Math.max(span.minX, next.minX),\r\n minY: Math.max(span.minY, next.minY),\r\n maxX: Math.min(span.maxX, next.maxX),\r\n maxY: Math.min(span.maxY, next.maxY),\r\n }\r\n : next;\r\n // The parts have stopped overlapping — nothing is drawn, so there is no\r\n // box to draw. See the header.\r\n if (span.minX > span.maxX || span.minY > span.maxY) return null;\r\n }\r\n return span ? toBounds(span) : null;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"path-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/path-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,M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;OAOG;IACH,SACiB,IAAI,EAAE,QAAQ,CAAC;gBAEpB,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC;cAM3B,gBAAgB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI;IAK9E,OAAO,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;cA0B5D,aAAa,IAAI,UAAU;CAoBjD"}
@@ -39,8 +39,14 @@ export class Path extends ShapeNode {
39
39
  return { width: resolvedW, height: resolvedH };
40
40
  }
41
41
  shapeGraphics() {
42
+ // Centre on the same tight box `measure` hugs. Left to itself the renderer
43
+ // centres on the bounds of the point array, control points included, which
44
+ // for a curve is not the ink: `M 0 0 C 0 100 100 100 100 0` hugs 100 x 75
45
+ // but would be centred on 100 x 100, drawing off-centre in its own box.
46
+ const box = pathOps.bounds(this.data);
42
47
  return new Graphics2D().path({
43
48
  data: this.data,
49
+ centerBounds: box ? [box.minX, box.minY, box.maxX, box.maxY] : undefined,
44
50
  start: this.start,
45
51
  end: this.end,
46
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"path-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/path-node.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAMtD,MAAM,OAAO,IAAK,SAAQ,SAAoB;IAa1C,YAAY,KAAkC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,wEAAwE;IACxE,+DAA+D;IAC5C,gBAAgB,CAAC,KAAmC;QACnE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EA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AAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;CAQJ;AArDoB;IADhB,YAAY,EAAE;kCACiB","sourcesContent":["\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport type { PathData } from \"@/render/descriptors/path\";\nimport { SizeConstraints } from \"@/layout/constraints\";\nimport { MeasureContext2D } from \"@/render/measure-context\";\nimport { Size2D } from \"@/attributes/layout/size\";\nimport { InsetsResolved } from \"@/attributes/layout/insets\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { pathProperty } from \"@/attributes/properties/typed\";\nimport { pathOps } from \"@/attributes/shape/path/ops\";\n\nexport interface PathProps extends ShapeProps {\n data: PathData;\n}\n\nexport class Path extends ShapeNode<PathProps> {\n\n /**\n * The path geometry, as an SVG `d` string or a {@link PathCommand} array.\n *\n * Animatable: `to({ data })` morphs smoothly between arbitrary shapes via\n * `pathOps.lerp`, which reconciles differing command/subpath counts, point\n * order, and winding before interpolating. Strings and command arrays may be\n * freely mixed as the source and target.\n */\n @pathProperty()\n declare readonly data: PathData;\n\n constructor(props: NodeConfig<Path, PathProps>) {\n super(props);\n }\n\n // A Path always sizes to its own geometry — it has no children to hug —\n // so it ignores the base has-children default and always hugs.\n protected override applyDefaultSize(props?: NodeConfig<Path, PathProps>): void {\n this.applyProp(\"width\", props?.width ?? \"hug\");\n this.applyProp(\"height\", props?.height ?? \"hug\");\n }\n\n measure(constraints: SizeConstraints, scope: MeasureContext2D): Partial<Size2D> {\n const wm = this.width;\n const hm = this.height;\n\n if (wm !== \"hug\" && hm !== \"hug\") {\n return super.measure(constraints, scope);\n }\n\n const intrinsic = pathOps.size(this.data);\n const pad = this.padding as InsetsResolved;\n\n const resolvedW = typeof wm === \"number\"\n ? wm\n : wm === \"hug\"\n ? intrinsic.width + pad.left + pad.right\n : constraints.maxWidth ?? 0;\n\n const resolvedH = typeof hm === \"number\"\n ? hm\n : hm === \"hug\"\n ? intrinsic.height + pad.top + pad.bottom\n : constraints.maxHeight ?? 0;\n\n return { width: resolvedW, height: resolvedH };\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().path({\n data: this.data,\n start: this.start,\n end: this.end,\n });\n }\n\n // No `renderSelf` of its own: `ShapeNode`'s draws shadow + fill of exactly\n // this silhouette and already defers the stroke to `renderStroke`, so the\n // override this class used to carry differed from the base in one thing —\n // it dropped the `.shadow()` op — and a Path was the one shape type that\n // could not cast a shadow at all, fill or no fill. It predates the base\n // implementation rather than disagreeing with it.\n}\n"]}
1
+ {"version":3,"file":"path-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/path-node.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAMtD,MAAM,OAAO,IAAK,SAAQ,SAAoB;IAa1C,YAAY,KAAkC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,wEAAwE;IACxE,+DAA+D;IAC5C,gBAAgB,CAAC,KAAmC;QACnE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,CAAC,WAA4B,EAAE,KAAuB;QACzD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAEvB,IAAI,EAAE,KAAK,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;YAC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YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;CAQJ;AA3DoB;IADhB,YAAY,EAAE;kCACiB","sourcesContent":["\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { PathData } from \"@/render/descriptors/path\";\r\nimport { SizeConstraints } from \"@/layout/constraints\";\r\nimport { MeasureContext2D } from \"@/render/measure-context\";\r\nimport { Size2D } from \"@/attributes/layout/size\";\r\nimport { InsetsResolved } from \"@/attributes/layout/insets\";\r\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { pathProperty } from \"@/attributes/properties/typed\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\n\r\nexport interface PathProps extends ShapeProps {\r\n data: PathData;\r\n}\r\n\r\nexport class Path extends ShapeNode<PathProps> {\r\n\r\n /**\r\n * The path geometry, as an SVG `d` string or a {@link PathCommand} array.\r\n *\r\n * Animatable: `to({ data })` morphs smoothly between arbitrary shapes via\r\n * `pathOps.lerp`, which reconciles differing command/subpath counts, point\r\n * order, and winding before interpolating. Strings and command arrays may be\r\n * freely mixed as the source and target.\r\n */\r\n @pathProperty()\r\n declare readonly data: PathData;\r\n\r\n constructor(props: NodeConfig<Path, PathProps>) {\r\n super(props);\r\n }\r\n\r\n // A Path always sizes to its own geometry — it has no children to hug —\r\n // so it ignores the base has-children default and always hugs.\r\n protected override applyDefaultSize(props?: NodeConfig<Path, PathProps>): void {\r\n this.applyProp(\"width\", props?.width ?? \"hug\");\r\n this.applyProp(\"height\", props?.height ?? \"hug\");\r\n }\r\n\r\n measure(constraints: SizeConstraints, scope: MeasureContext2D): Partial<Size2D> {\r\n const wm = this.width;\r\n const hm = this.height;\r\n\r\n if (wm !== \"hug\" && hm !== \"hug\") {\r\n return super.measure(constraints, scope);\r\n }\r\n\r\n const intrinsic = pathOps.size(this.data);\r\n const pad = this.padding as InsetsResolved;\r\n\r\n const resolvedW = typeof wm === \"number\"\r\n ? wm\r\n : wm === \"hug\"\r\n ? intrinsic.width + pad.left + pad.right\r\n : constraints.maxWidth ?? 0;\r\n\r\n const resolvedH = typeof hm === \"number\"\r\n ? hm\r\n : hm === \"hug\"\r\n ? intrinsic.height + pad.top + pad.bottom\r\n : constraints.maxHeight ?? 0;\r\n\r\n return { width: resolvedW, height: resolvedH };\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n // Centre on the same tight box `measure` hugs. Left to itself the renderer\r\n // centres on the bounds of the point array, control points included, which\r\n // for a curve is not the ink: `M 0 0 C 0 100 100 100 100 0` hugs 100 x 75\r\n // but would be centred on 100 x 100, drawing off-centre in its own box.\r\n const box = pathOps.bounds(this.data);\r\n return new Graphics2D().path({\r\n data: this.data,\r\n centerBounds: box ? [box.minX, box.minY, box.maxX, box.maxY] : undefined,\r\n start: this.start,\r\n end: this.end,\r\n });\r\n }\r\n\r\n // No `renderSelf` of its own: `ShapeNode`'s draws shadow + fill of exactly\r\n // this silhouette and already defers the stroke to `renderStroke`, so the\r\n // override this class used to carry differed from the base in one thing —\r\n // it dropped the `.shadow()` op — and a Path was the one shape type that\r\n // could not cast a shadow at all, fill or no fill. It predates the base\r\n // implementation rather than disagreeing with it.\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"polygon-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/polygon-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAe,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAW7F,0FAA0F;AAC1F,MAAM,OAAO,OAAQ,SAAQ,SAAuB;IAShD,YAAY,KAAwC;QAChD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AA/BqC;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;sCAAuB;AAEd;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;6CAA8B;AAEiB;IAAvE,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;4CAAkC","sourcesContent":["import { property } from \"@/attributes/properties/decorator\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport { CornerStyle, lerpCornerScalarStyle } from \"@/attributes/shape/corners/corner-style\";\n\nexport interface PolygonProps extends ShapeProps {\n /** Number of sides. Must be ≥ 3. */\n sides: number;\n /** Vertex rounding radius in pixels. */\n cornerRadius: number;\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\n cornerStyle: CornerStyle;\n}\n\n/** Regular polygon (equilateral, equiangular) inscribed within the node's layout rect. */\nexport class Polygon extends ShapeNode<PolygonProps> {\n\n /** Number of sides (default: 5). */\n @property({ default: 5 }) declare sides: number;\n /** Vertex rounding radius in pixels (default: 0). */\n @property({ default: 0 }) declare cornerRadius: number;\n /** Vertex shape (default: `'rounded'`). */\n @property({ default: \"rounded\", tween: lerpCornerScalarStyle }) declare cornerStyle: CornerStyle;\n\n constructor(props: NodeConfig<Polygon, PolygonProps>) {\n super(props);\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().polygon({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n sides: this.sides,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n start: this.start,\n end: this.end,\n });\n }\n\n protected override clipSelf(): Clip {\n return new Clip().polygon({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n sides: this.sides,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"polygon-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/polygon-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAe,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAW7F,0FAA0F;AAC1F,MAAM,OAAO,OAAQ,SAAQ,SAAuB;IAShD,YAAY,KAAwC;QAChD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AA/BqC;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;sCAAuB;AAEd;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;6CAA8B;AAEiB;IAAvE,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;4CAAkC","sourcesContent":["import { property } from \"@/attributes/properties/decorator\";\r\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\nimport { CornerStyle, lerpCornerScalarStyle } from \"@/attributes/shape/corners/corner-style\";\r\n\r\nexport interface PolygonProps extends ShapeProps {\r\n /** Number of sides. Must be ≥ 3. */\r\n sides: number;\r\n /** Vertex rounding radius in pixels. */\r\n cornerRadius: number;\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle;\r\n}\r\n\r\n/** Regular polygon (equilateral, equiangular) inscribed within the node's layout rect. */\r\nexport class Polygon extends ShapeNode<PolygonProps> {\r\n\r\n /** Number of sides (default: 5). */\r\n @property({ default: 5 }) declare sides: number;\r\n /** Vertex rounding radius in pixels (default: 0). */\r\n @property({ default: 0 }) declare cornerRadius: number;\r\n /** Vertex shape (default: `'rounded'`). */\r\n @property({ default: \"rounded\", tween: lerpCornerScalarStyle }) declare cornerStyle: CornerStyle;\r\n\r\n constructor(props: NodeConfig<Polygon, PolygonProps>) {\r\n super(props);\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n return new Graphics2D().polygon({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n sides: this.sides,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n start: this.start,\r\n end: this.end,\r\n });\r\n }\r\n\r\n protected override clipSelf(): Clip {\r\n return new Clip().polygon({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n sides: this.sides,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n });\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"polygram-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/polygram-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAe,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAgB7F,0FAA0F;AAC1F,MAAM,OAAO,QAAS,SAAQ,SAAwB;IAWlD,YAAY,KAA0C;QAClD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,QAAQ,CAAC;YAC7B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,QAAQ,CAAC;YACvB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AAnCqC;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;uCAAuB;AAEZ;IAAnC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;uCAAuB;AAEhB;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;8CAA8B;AAEiB;IAAvE,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;6CAAkC","sourcesContent":["import { property } from \"@/attributes/properties/decorator\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport { CornerStyle, lerpCornerScalarStyle } from \"@/attributes/shape/corners/corner-style\";\n\nexport interface PolygramProps extends ShapeProps {\n /** Number of outer points. Must be ≥ 3. */\n sides: number;\n /**\n * Inner-to-outer radius ratio (0–1). Controls how deeply the star points are cut.\n * At 1 the shape degenerates into a regular polygon; lower values produce sharper points.\n */\n ratio: number;\n /** Vertex rounding radius in pixels applied to both inner and outer vertices. */\n cornerRadius: number;\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\n cornerStyle: CornerStyle;\n}\n\n/** Star polygon (polygram) — alternates outer and inner vertices to form a star shape. */\nexport class Polygram extends ShapeNode<PolygramProps> {\n\n /** Number of outer points (default: 5). */\n @property({ default: 5 }) declare sides: number;\n /** Inner-to-outer radius ratio (default: 0.5). */\n @property({ default: 0.5 }) declare ratio: number;\n /** Vertex rounding radius in pixels (default: 0). */\n @property({ default: 0 }) declare cornerRadius: number;\n /** Vertex shape (default: `'rounded'`). */\n @property({ default: \"rounded\", tween: lerpCornerScalarStyle }) declare cornerStyle: CornerStyle;\n\n constructor(props: NodeConfig<Polygram, PolygramProps>) {\n super(props);\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().polygram({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n sides: this.sides,\n ratio: this.ratio,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n start: this.start,\n end: this.end,\n });\n }\n\n protected override clipSelf(): Clip {\n return new Clip().polygram({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n sides: this.sides,\n ratio: this.ratio,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"polygram-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/polygram-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EA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AO,EAAE,CAAC,EAAE,CAAC;8CAA8B;AAEiB;IAAvE,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;6CAAkC","sourcesContent":["import { property } from \"@/attributes/properties/decorator\";\r\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\nimport { CornerStyle, lerpCornerScalarStyle } from \"@/attributes/shape/corners/corner-style\";\r\n\r\nexport interface PolygramProps extends ShapeProps {\r\n /** Number of outer points. Must be ≥ 3. */\r\n sides: number;\r\n /**\r\n * Inner-to-outer radius ratio (0–1). Controls how deeply the star points are cut.\r\n * At 1 the shape degenerates into a regular polygon; lower values produce sharper points.\r\n */\r\n ratio: number;\r\n /** Vertex rounding radius in pixels applied to both inner and outer vertices. */\r\n cornerRadius: number;\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle;\r\n}\r\n\r\n/** Star polygon (polygram) — alternates outer and inner vertices to form a star shape. */\r\nexport class Polygram extends ShapeNode<PolygramProps> {\r\n\r\n /** Number of outer points (default: 5). */\r\n @property({ default: 5 }) declare sides: number;\r\n /** Inner-to-outer radius ratio (default: 0.5). */\r\n @property({ default: 0.5 }) declare ratio: number;\r\n /** Vertex rounding radius in pixels (default: 0). */\r\n @property({ default: 0 }) declare cornerRadius: number;\r\n /** Vertex shape (default: `'rounded'`). */\r\n @property({ default: \"rounded\", tween: lerpCornerScalarStyle }) declare cornerStyle: CornerStyle;\r\n\r\n constructor(props: NodeConfig<Polygram, PolygramProps>) {\r\n super(props);\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n return new Graphics2D().polygram({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n sides: this.sides,\r\n ratio: this.ratio,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n start: this.start,\r\n end: this.end,\r\n });\r\n }\r\n\r\n protected override clipSelf(): Clip {\r\n return new Clip().polygram({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n sides: this.sides,\r\n ratio: this.ratio,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n });\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rect-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/rect-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAc1F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,IAAsC,SAAQ,SAAY;IAOnE,YAAY,KAA6B;QACrC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC;YACnB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AA3BW;IADP,oBAAoB,EAAE;0CACgB;AAE/B;IADP,mBAAmB,EAAE;yCACe","sourcesContent":["import { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport { RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { cornerRadiusProperty, cornerStyleProperty } from \"@/attributes/properties/typed\";\n\n\nexport type { FlowMode, GapSize } from \"@/layout/types\";\n\nexport type FlexSize = number | \"fill\" | \"hug\";\n\nexport interface RectProps extends ShapeProps {\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\n cornerRadius: RectCornerRadius;\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\n cornerStyle: RectCornerStyle;\n}\n\n/**\n * A rounded rectangle drawn behind its children.\n *\n * It used to be the only node that laid its children out, and everything that\n * did so — `flow`, `gap`/`crossGap`, `wrap`, `columns`, `align`, the padding\n * that clears the stroke — now lives on {@link ShapeNode}, where every shape\n * can reach it. What is left here is the rectangle itself: its two corner props\n * and the silhouette they describe.\n *\n * There used to be four more classes here — `Row`, `Column`, `Grid` and `Image`\n * — each a Rect with one of its answers frozen. They were a convenience that\n * cost more than it saved: a row that needed to become a column had to become a\n * *different node*, losing its identity and every command bound to it, and the\n * frozen ones drifted (only `Rect` ever learned the cross-mode `flow` blend).\n * One class that can be asked is the whole point of the `flow` prop.\n */\nexport class Rect<P extends RectProps = RectProps> extends ShapeNode<P> {\n\n @cornerRadiusProperty()\n declare cornerRadius: RectCornerRadius;\n @cornerStyleProperty()\n declare cornerStyle: RectCornerStyle;\n\n constructor(props: NodeConfig<Rect<P>, P>) {\n super(props);\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().rect({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n start: this.start,\n end: this.end,\n });\n }\n\n protected override clipSelf(): Clip {\n return new Clip().rect({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"rect-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/rect-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAc1F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,IAAsC,SAAQ,SAAY;IAOnE,YAAY,KAA6B;QACrC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAEkB,QAAQ;QACvB,OAAO,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC;YACnB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AA3BW;IADP,oBAAoB,EAAE;0CACgB;AAE/B;IADP,mBAAmB,EAAE;yCACe","sourcesContent":["import { Graphics2D } from \"@/render/graphics2d\";\r\nimport { Clip } from \"@/render/clip\";\r\nimport { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport { RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { cornerRadiusProperty, cornerStyleProperty } from \"@/attributes/properties/typed\";\r\n\r\n\r\nexport type { FlowMode, GapSize } from \"@/layout/types\";\r\n\r\nexport type FlexSize = number | \"fill\" | \"hug\";\r\n\r\nexport interface RectProps extends ShapeProps {\r\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\r\n cornerRadius: RectCornerRadius;\r\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\r\n cornerStyle: RectCornerStyle;\r\n}\r\n\r\n/**\r\n * A rounded rectangle drawn behind its children.\r\n *\r\n * It used to be the only node that laid its children out, and everything that\r\n * did so — `flow`, `gap`/`crossGap`, `wrap`, `columns`, `align`, the padding\r\n * that clears the stroke — now lives on {@link ShapeNode}, where every shape\r\n * can reach it. What is left here is the rectangle itself: its two corner props\r\n * and the silhouette they describe.\r\n *\r\n * There used to be four more classes here — `Row`, `Column`, `Grid` and `Image`\r\n * — each a Rect with one of its answers frozen. They were a convenience that\r\n * cost more than it saved: a row that needed to become a column had to become a\r\n * *different node*, losing its identity and every command bound to it, and the\r\n * frozen ones drifted (only `Rect` ever learned the cross-mode `flow` blend).\r\n * One class that can be asked is the whole point of the `flow` prop.\r\n */\r\nexport class Rect<P extends RectProps = RectProps> extends ShapeNode<P> {\r\n\r\n @cornerRadiusProperty()\r\n declare cornerRadius: RectCornerRadius;\r\n @cornerStyleProperty()\r\n declare cornerStyle: RectCornerStyle;\r\n\r\n constructor(props: NodeConfig<Rect<P>, P>) {\r\n super(props);\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n return new Graphics2D().rect({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n start: this.start,\r\n end: this.end,\r\n });\r\n }\r\n\r\n protected override clipSelf(): Clip {\r\n return new Clip().rect({\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n });\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"shape-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/shape-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAO7D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAc,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAc,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAiBxD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAgB,SAA6C,SAAQ,SAAY;IAsBnF,SAAS,CAAC,IAA8D;QACpE,MAAM,IAAI,GAAG,IAAI,CAAC,OAAyB,CAAC;QAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAY,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAI,CAAC,CAAC,EAA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AAS,GAAG,KAAK;gBAAE,KAAK,GAAG,SAAS,CAAC;QAC7C,CAAC;QACD,IAAI,KAAK,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QAC1B,OAAO;YACH,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG,KAAK;YACpB,KAAK,EAAE,CAAC,CAAC,KAAK,GAAG,KAAK;YACtB,GAAG,EAAE,CAAC,CAAC,GAAG,GAAG,KAAK;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM,GAAG,KAAK;SAC3B,CAAC;IACN,CAAC;CACJ;AAtGW;IADP,YAAY,EAAE;0CACO;AAEE;IAAvB,YAAY,EAAE;uCAAwB;AACI;IAA1C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;sCAA+B;AACT;IAA9C,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;uCAAgC;AAIV;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;2CAA+C;AACrC;IAA1C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;0CAAkC;AAKnD;IADP,iBAAiB,EAAE;wCACK;AAGzB;IADC,OAAO,EAAE;0CAMT","sourcesContent":["import { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { AssetScope } from \"@/assets/scope\";\n\nimport { alignmentProperty, fillProperty, flowProperty } from \"@/attributes/properties/typed\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { Fill } from \"@/attributes/shape/fill/chain\";\nimport { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\n\nimport { RenderContext2D } from \"@/render/render-context2d\";\nimport { type Command, type CommandArgs } from \"@/tween/command\";\nimport { command } from \"@/tween/command-decorator\";\nimport { PaintNode, PaintProps } from \"@/nodes/2d/paint-node\";\nimport { Node2D, NodeConfig } from \"@/nodes/2d/node2d\";\n\nimport { sizeInputOps } from \"@/attributes/layout/size\";\nimport { InsetsResolved } from \"@/attributes/layout/insets\";\nimport { Alignment } from \"@/attributes/layout/alignment\";\nimport type { FlowMode, FlowProps, FlowSettings, GapSize } from \"@/layout/types\";\n\n\nexport interface ShapeProps extends PaintProps, FlowProps {\n /**\n * Overlay layer(s) — the same loose values as {@link PaintProps.fill}, but\n * painted *over* this node's fill **and** its children (clipped to the node's\n * silhouette) while still sitting **under** the stroke. Use for textures\n * laid across the whole subtree, e.g. a VHS-grain image or video.\n */\n overlay?: Fill;\n}\n\n\n/**\n * A {@link PaintNode} with a **silhouette and a subtree**: an overlay, and the\n * layout props that arrange children.\n *\n * Both are here for the same reason, and it is the reason the text nodes stop at\n * the base. An overlay is a wash over this node's fill *and everything nested\n * inside it*, clipped to the shape it draws; the layout pass measures children\n * against a rectangular content box. `Text` and `RichText` have no fillable\n * silhouette and no children — an overlay on one could only be a second fill of\n * the same glyphs, which the fill stack already says, and a flow mode on one\n * would arrange nothing while colliding with `wrap`, which for text means\n * something else entirely.\n *\n * The layout pass is *not* `Rect`'s alone, though: every shape here has a\n * rectangular content box, so \"put a title and an icon in a column\" is a\n * question about the layout you want rather than about which node you picked.\n */\nexport abstract class ShapeNode<P extends ShapeProps = ShapeProps> extends PaintNode<P> {\n\n // Same paint type/mapper/tween as `fill`; differs only in draw order —\n // painted over fill + children and under the stroke (see renderOverlay).\n @fillProperty()\n declare overlay: Fill;\n\n @flowProperty() declare flow: FlowMode;\n @property({ default: 0 }) declare readonly gap: GapSize;\n @property({ default: false }) declare readonly wrap: boolean;\n // `undefined` is a real value here, not a missing one: it means \"follow\n // `gap`\". A default of 0 would make an author who turned wrap on get lines\n // stacked flush, which is never what they meant — see FlowProps.crossGap.\n @property({ default: undefined }) declare readonly crossGap: number | undefined;\n @property({ default: 1 }) declare readonly columns: number;\n // Declared as the loose `Alignment` so one @property covers both assignment\n // (`this.align = 'center'`) and reads. At runtime the accessor stores the\n // resolved per-axis `Vector2` pivot; readers cast at the read site.\n @alignmentProperty()\n declare align: Alignment;\n\n @command()\n overlayTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<P> {\n const from = this.overlay as FillResolved[];\n const target = fillOps.resolve(args.data as Fill);\n const lerp = args.lerp ?? fillOps.lerp;\n return this.command<P>(t => ({ overlay: lerp(from, target, t) }) as Partial<P>, args.duration, args.easing);\n }\n\n // Overlay over fill + children, under stroke. Painted as a fill of the\n // node's silhouette, so it's clipped to the outline exactly like `fill`.\n protected override renderOverlay(ctx: RenderContext2D): void {\n const overlay = this.overlay as FillResolved[];\n if (overlay.length === 0) return;\n const base = this.shapeGraphics();\n if (base) ctx.draw(base.fill(overlay));\n }\n\n /** The fourth paint slot, on top of the three {@link PaintNode} declares. */\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets);\n assets.fill(this.overlay as FillResolved[]);\n }\n\n /**\n * Figma-style smart default (see base {@link Node2D.applyDefaultSize}), plus\n * one refinement for containers: hugging an axis that a direct child asks to\n * `\"fill\"` stacks the child against nothing — the child would either collapse\n * to 0 (freeform, or the container's cross axis) or measure unconstrained (a\n * run's main axis; see `measureRun`). Since JSX children are\n * already-constructed `Node2D`s by the time they reach this constructor, their\n * own resolved `width`/`height` can be inspected here — so a bare `fill` child\n * flips *this* default from `hug` to `fill` on that exact axis, matching what\n * the author almost certainly wants. An explicit `width`/`height` always wins;\n * this only adjusts the *default* used when neither is given.\n *\n * `\"horizontal\"`/`\"vertical\"` only promote their single main axis;\n * `\"freeform\"` (the default, and the mode with no distinct main axis) checks\n * both axes independently.\n */\n protected override applyDefaultSize(props?: NodeConfig<any, P>): void {\n const children = Node2D.flowChildrenProp(props);\n const hasChildren = children.length > 0;\n const flow: FlowMode = (props as any)?.flow ?? \"freeform\";\n\n // `grid` counts as width-main: its column tracks are cut from the box's\n // width, so a child asking to fill that axis is asking for a width the\n // container must have decided before the tracks exist.\n const widthIsMain = flow === \"horizontal\" || flow === \"freeform\" || flow === \"grid\";\n const heightIsMain = flow === \"vertical\" || flow === \"freeform\";\n\n const defaultWidth = hasChildren && widthIsMain && Node2D.hasFillChild(children, \"width\") ? \"fill\" : hasChildren ? \"hug\" : \"fill\";\n const defaultHeight = hasChildren && heightIsMain && Node2D.hasFillChild(children, \"height\") ? \"fill\" : hasChildren ? \"hug\" : \"fill\";\n\n if (!props || props.width === undefined) this.applyProp(\"width\", defaultWidth, { tween: sizeInputOps.lerp });\n if (!props || props.height === undefined) this.applyProp(\"height\", defaultHeight, { tween: sizeInputOps.lerp });\n }\n\n protected override flowArrangement(): FlowSettings {\n return this;\n }\n\n // Children must sit inside the stroke; the stroke is drawn at the layout-rect\n // edge and would otherwise visually cover them. Only the portion of the\n // stroke that intrudes into the content box needs clearing, which depends on\n // its alignment: inside strokes (align -1) intrude their full weight, centered\n // strokes (align 0) half, outside strokes (align +1) none. The intrusion is\n // weight·(1 - align)/2.\n override effectivePadding(): InsetsResolved {\n let extra = 0;\n const p = this.padding as InsetsResolved;\n const strokes = this.stroke as StrokeResolved[];\n if (!strokes || !(Symbol.iterator in Object(strokes))) {\n return p;\n }\n for (const s of strokes) {\n const intrusion = s.weight * (1 - s.align) / 2;\n if (intrusion > extra) extra = intrusion;\n }\n if (extra === 0) return p;\n return {\n left: p.left + extra,\n right: p.right + extra,\n top: p.top + extra,\n bottom: p.bottom + extra,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"shape-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/shape-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAO7D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAc,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAc,MAAM,mBAAmB,CAA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scope\";\r\n\r\nimport { alignmentProperty, fillProperty, flowProperty } from \"@/attributes/properties/typed\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\n\r\nimport { RenderContext2D } from \"@/render/render-context2d\";\r\nimport { type Command, type CommandArgs } from \"@/tween/command\";\r\nimport { command } from \"@/tween/command-decorator\";\r\nimport { PaintNode, PaintProps } from \"@/nodes/2d/paint-node\";\r\nimport { Node2D, NodeConfig } from \"@/nodes/2d/node2d\";\r\n\r\nimport { sizeInputOps } from \"@/attributes/layout/size\";\r\nimport { InsetsResolved } from \"@/attributes/layout/insets\";\r\nimport { Alignment } from \"@/attributes/layout/alignment\";\r\nimport type { FlowMode, FlowProps, FlowSettings, GapSize } from \"@/layout/types\";\r\n\r\n\r\nexport interface ShapeProps extends PaintProps, FlowProps {\r\n /**\r\n * Overlay layer(s) — the same loose values as {@link PaintProps.fill}, but\r\n * painted *over* this node's fill **and** its children (clipped to the node's\r\n * silhouette) while still sitting **under** the stroke. Use for textures\r\n * laid across the whole subtree, e.g. a VHS-grain image or video.\r\n */\r\n overlay?: Fill;\r\n}\r\n\r\n\r\n/**\r\n * A {@link PaintNode} with a **silhouette and a subtree**: an overlay, and the\r\n * layout props that arrange children.\r\n *\r\n * Both are here for the same reason, and it is the reason the text nodes stop at\r\n * the base. An overlay is a wash over this node's fill *and everything nested\r\n * inside it*, clipped to the shape it draws; the layout pass measures children\r\n * against a rectangular content box. `Text` and `RichText` have no fillable\r\n * silhouette and no children — an overlay on one could only be a second fill of\r\n * the same glyphs, which the fill stack already says, and a flow mode on one\r\n * would arrange nothing while colliding with `wrap`, which for text means\r\n * something else entirely.\r\n *\r\n * The layout pass is *not* `Rect`'s alone, though: every shape here has a\r\n * rectangular content box, so \"put a title and an icon in a column\" is a\r\n * question about the layout you want rather than about which node you picked.\r\n */\r\nexport abstract class ShapeNode<P extends ShapeProps = ShapeProps> extends PaintNode<P> {\r\n\r\n // Same paint type/mapper/tween as `fill`; differs only in draw order —\r\n // painted over fill + children and under the stroke (see renderOverlay).\r\n @fillProperty()\r\n declare overlay: Fill;\r\n\r\n @flowProperty() declare flow: FlowMode;\r\n @property({ default: 0 }) declare readonly gap: GapSize;\r\n @property({ default: false }) declare readonly wrap: boolean;\r\n // `undefined` is a real value here, not a missing one: it means \"follow\r\n // `gap`\". A default of 0 would make an author who turned wrap on get lines\r\n // stacked flush, which is never what they meant — see FlowProps.crossGap.\r\n @property({ default: undefined }) declare readonly crossGap: number | undefined;\r\n @property({ default: 1 }) declare readonly columns: number;\r\n // Declared as the loose `Alignment` so one @property covers both assignment\r\n // (`this.align = 'center'`) and reads. At runtime the accessor stores the\r\n // resolved per-axis `Vector2` pivot; readers cast at the read site.\r\n @alignmentProperty()\r\n declare align: Alignment;\r\n\r\n @command()\r\n overlayTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<P> {\r\n const from = this.overlay as FillResolved[];\r\n const target = fillOps.resolve(args.data as Fill);\r\n const lerp = args.lerp ?? fillOps.lerp;\r\n return this.command<P>(t => ({ overlay: lerp(from, target, t) }) as Partial<P>, args.duration, args.easing);\r\n }\r\n\r\n // Overlay over fill + children, under stroke. Painted as a fill of the\r\n // node's silhouette, so it's clipped to the outline exactly like `fill`.\r\n protected override renderOverlay(ctx: RenderContext2D): void {\r\n const overlay = this.overlay as FillResolved[];\r\n if (overlay.length === 0) return;\r\n const base = this.shapeGraphics();\r\n if (base) ctx.draw(base.fill(overlay));\r\n }\r\n\r\n /** The fourth paint slot, on top of the three {@link PaintNode} declares. */\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n assets.fill(this.overlay as FillResolved[]);\r\n }\r\n\r\n /**\r\n * Figma-style smart default (see base {@link Node2D.applyDefaultSize}), plus\r\n * one refinement for containers: hugging an axis that a direct child asks to\r\n * `\"fill\"` stacks the child against nothing — the child would either collapse\r\n * to 0 (freeform, or the container's cross axis) or measure unconstrained (a\r\n * run's main axis; see `measureRun`). Since JSX children are\r\n * already-constructed `Node2D`s by the time they reach this constructor, their\r\n * own resolved `width`/`height` can be inspected here — so a bare `fill` child\r\n * flips *this* default from `hug` to `fill` on that exact axis, matching what\r\n * the author almost certainly wants. An explicit `width`/`height` always wins;\r\n * this only adjusts the *default* used when neither is given.\r\n *\r\n * `\"horizontal\"`/`\"vertical\"` only promote their single main axis;\r\n * `\"freeform\"` (the default, and the mode with no distinct main axis) checks\r\n * both axes independently.\r\n */\r\n protected override applyDefaultSize(props?: NodeConfig<any, P>): void {\r\n const children = Node2D.flowChildrenProp(props);\r\n const hasChildren = children.length > 0;\r\n const flow: FlowMode = (props as any)?.flow ?? \"freeform\";\r\n\r\n // `grid` counts as width-main: its column tracks are cut from the box's\r\n // width, so a child asking to fill that axis is asking for a width the\r\n // container must have decided before the tracks exist.\r\n const widthIsMain = flow === \"horizontal\" || flow === \"freeform\" || flow === \"grid\";\r\n const heightIsMain = flow === \"vertical\" || flow === \"freeform\";\r\n\r\n const defaultWidth = hasChildren && widthIsMain && Node2D.hasFillChild(children, \"width\") ? \"fill\" : hasChildren ? \"hug\" : \"fill\";\r\n const defaultHeight = hasChildren && heightIsMain && Node2D.hasFillChild(children, \"height\") ? \"fill\" : hasChildren ? \"hug\" : \"fill\";\r\n\r\n if (!props || props.width === undefined) this.applyProp(\"width\", defaultWidth, { tween: sizeInputOps.lerp });\r\n if (!props || props.height === undefined) this.applyProp(\"height\", defaultHeight, { tween: sizeInputOps.lerp });\r\n }\r\n\r\n protected override flowArrangement(): FlowSettings {\r\n return this;\r\n }\r\n\r\n // Children must sit inside the stroke; the stroke is drawn at the layout-rect\r\n // edge and would otherwise visually cover them. Only the portion of the\r\n // stroke that intrudes into the content box needs clearing, which depends on\r\n // its alignment: inside strokes (align -1) intrude their full weight, centered\r\n // strokes (align 0) half, outside strokes (align +1) none. The intrusion is\r\n // weight·(1 - align)/2.\r\n override effectivePadding(): InsetsResolved {\r\n let extra = 0;\r\n const p = this.padding as InsetsResolved;\r\n const strokes = this.stroke as StrokeResolved[];\r\n if (!strokes || !(Symbol.iterator in Object(strokes))) {\r\n return p;\r\n }\r\n for (const s of strokes) {\r\n const intrusion = s.weight * (1 - s.align) / 2;\r\n if (intrusion > extra) extra = intrusion;\r\n }\r\n if (extra === 0) return p;\r\n return {\r\n left: p.left + extra,\r\n right: p.right + extra,\r\n top: p.top + extra,\r\n bottom: p.bottom + extra,\r\n };\r\n }\r\n}\r\n"]}
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * ## Why these shapes exist at all
17
17
  *
18
- * motion-script's `Polygon` inscribes its n-gon in the node's box — the vertices
18
+ * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices
19
19
  * sit on the box's inscribed ellipse — which is what makes a `sides` tween
20
20
  * smooth: every vertex count is the same circle sampled differently, so a
21
21
  * triangle morphing into a square doesn't lurch. The cost is that a triangle
@@ -37,7 +37,7 @@ import type { CornerRadiusResolved } from "../../attributes/shape/corners/corner
37
37
  import type { CornerStyle } from "../../attributes/shape/corners/corner-style.js";
38
38
  import type { VectorPath } from "../../attributes/shape/path/types.js";
39
39
  /** The shape types this module can draw an outline for. */
40
- export type ShapeOutlineKind = "rect" | "ellipse" | "polygon" | "polygram" | "triangle" | "rightTriangle" | "pentagon" | "hexagon" | "octagon" | "star" | "line";
40
+ export type ShapeOutlineKind = "rect" | "ellipse" | "polygon" | "polygram" | "triangle" | "rightTriangle" | "pentagon" | "hexagon" | "octagon" | "star";
41
41
  /** Everything an outline can depend on. Unstated fields take the schema's default. */
42
42
  export interface ShapeOutlineOptions {
43
43
  /** The node's box, in pixels. */
@@ -1 +1 @@
1
- {"version":3,"file":"shape-outline.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/shape-outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH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G,IAAI,IAAI,gBAAgB,CAEtE"}
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * ## Why these shapes exist at all
17
17
  *
18
- * motion-script's `Polygon` inscribes its n-gon in the node's box — the vertices
18
+ * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices
19
19
  * sit on the box's inscribed ellipse — which is what makes a `sides` tween
20
20
  * smooth: every vertex count is the same circle sampled differently, so a
21
21
  * triangle morphing into a square doesn't lurch. The cost is that a triangle
@@ -78,16 +78,6 @@ export function shapeOutlinePixels(kind, options) {
78
78
  return [rectOutline(width, height, options)];
79
79
  case "ellipse":
80
80
  return ellipseOutline(width, height, options);
81
- case "line":
82
- return [
83
- {
84
- anchors: [
85
- corner({ x: -width / 2, y: 0 }),
86
- corner({ x: width / 2, y: 0 }),
87
- ],
88
- closed: false,
89
- },
90
- ];
91
81
  case "triangle":
92
82
  return [
93
83
  polygonOutline([
@@ -159,7 +149,6 @@ const OUTLINE_KINDS = new Set([
159
149
  "hexagon",
160
150
  "octagon",
161
151
  "star",
162
- "line",
163
152
  ]);
164
153
  // ── Building blocks ────────────────────────────────────────────────────────
165
154
  function corner(point) {
@@ -174,7 +163,7 @@ function clamp01(value) {
174
163
  /**
175
164
  * The vertices of a regular n-gon on the ellipse `rx` × `ry`, starting at the
176
165
  * top and stepping clockwise — the same order and the same first vertex
177
- * motion-script's own `polygonVertices` uses, so a converted `polygon` keeps its
166
+ * The engine's own `polygonVertices` uses, so a converted `polygon` keeps its
178
167
  * points in the order the author has been looking at.
179
168
  *
180
169
  * `turn` rotates the whole figure; see {@link NAMED_POLYGONS}.