@motionscript/core 0.1.0-alpha.8 → 0.1.0-alpha.9

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 (791) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +49 -49
  4. package/README.md +91 -91
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.js.map +1 -1
  7. package/dist/assets/errors.js.map +1 -1
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/assets/manager.js.map +1 -1
  10. package/dist/assets/manifest.js.map +1 -1
  11. package/dist/assets/record.js.map +1 -1
  12. package/dist/assets/scope.js.map +1 -1
  13. package/dist/attributes/audio/effects/chain.js.map +1 -1
  14. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -1
  15. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -1
  16. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -1
  17. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -1
  18. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -1
  19. package/dist/attributes/audio/effects/index.js.map +1 -1
  20. package/dist/attributes/audio/effects/registry.js.map +1 -1
  21. package/dist/attributes/audio/effects/union.js.map +1 -1
  22. package/dist/attributes/audio/ramp.js.map +1 -1
  23. package/dist/attributes/audio/request.js.map +1 -1
  24. package/dist/attributes/audio/schedule.js.map +1 -1
  25. package/dist/attributes/audio/sound.js.map +1 -1
  26. package/dist/attributes/audio/transition.js.map +1 -1
  27. package/dist/attributes/index.js.map +1 -1
  28. package/dist/attributes/layout/alignment.js.map +1 -1
  29. package/dist/attributes/layout/index.js.map +1 -1
  30. package/dist/attributes/layout/insets.js.map +1 -1
  31. package/dist/attributes/layout/matrix2d.js.map +1 -1
  32. package/dist/attributes/layout/size.js.map +1 -1
  33. package/dist/attributes/layout/space3d.js.map +1 -1
  34. package/dist/attributes/layout/transform3d.js.map +1 -1
  35. package/dist/attributes/layout/vector2.js.map +1 -1
  36. package/dist/attributes/layout/world-transform.js.map +1 -1
  37. package/dist/attributes/mask/boolean.js.map +1 -1
  38. package/dist/attributes/mask/mask.js.map +1 -1
  39. package/dist/attributes/properties/decorator.js.map +1 -1
  40. package/dist/attributes/properties/inputs.js.map +1 -1
  41. package/dist/attributes/properties/typed.js.map +1 -1
  42. package/dist/attributes/render3d/orbit.js.map +1 -1
  43. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  44. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  45. package/dist/attributes/shape/corners/corners.js.map +1 -1
  46. package/dist/attributes/shape/corners/index.js.map +1 -1
  47. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  48. package/dist/attributes/shape/effects/chain.js.map +1 -1
  49. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  50. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  51. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  52. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  53. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  54. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  55. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  56. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  57. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  58. package/dist/attributes/shape/effects/implementations/curves.d.ts +2 -2
  59. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  60. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  61. package/dist/attributes/shape/effects/implementations/dither.d.ts +2 -2
  62. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  63. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  64. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  65. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  66. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  67. package/dist/attributes/shape/effects/implementations/glow.d.ts +4 -4
  68. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  69. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  70. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  71. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  72. package/dist/attributes/shape/effects/implementations/invert.d.ts +2 -2
  73. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  74. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  75. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  76. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  77. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  78. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  79. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  80. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  81. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  82. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  83. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  84. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  85. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  86. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  87. package/dist/attributes/shape/effects/implementations/shader.d.ts +2 -2
  88. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  96. package/dist/attributes/shape/effects/index.js.map +1 -1
  97. package/dist/attributes/shape/effects/registry.js.map +1 -1
  98. package/dist/attributes/shape/effects/spec.js.map +1 -1
  99. package/dist/attributes/shape/effects/union.js.map +1 -1
  100. package/dist/attributes/shape/fill/blend.js.map +1 -1
  101. package/dist/attributes/shape/fill/chain.js.map +1 -1
  102. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  103. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  104. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  105. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  106. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  107. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  108. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  109. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  110. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  111. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  112. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  113. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  114. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  115. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  116. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  117. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  118. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  119. package/dist/attributes/shape/fill/index.js.map +1 -1
  120. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  121. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  122. package/dist/attributes/shape/fill/registry.js.map +1 -1
  123. package/dist/attributes/shape/fill/union.js.map +1 -1
  124. package/dist/attributes/shape/filters/chain.js.map +1 -1
  125. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  126. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  127. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  128. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  129. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  130. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  131. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  132. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  133. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  134. package/dist/attributes/shape/filters/index.js.map +1 -1
  135. package/dist/attributes/shape/filters/registry.js.map +1 -1
  136. package/dist/attributes/shape/filters/union.js.map +1 -1
  137. package/dist/attributes/shape/path/anchors.js.map +1 -1
  138. package/dist/attributes/shape/path/bezier.js.map +1 -1
  139. package/dist/attributes/shape/path/index.js.map +1 -1
  140. package/dist/attributes/shape/path/measure.js.map +1 -1
  141. package/dist/attributes/shape/path/morph.js.map +1 -1
  142. package/dist/attributes/shape/path/ops.js.map +1 -1
  143. package/dist/attributes/shape/path/types.js.map +1 -1
  144. package/dist/attributes/shape/path/walk.js.map +1 -1
  145. package/dist/attributes/shape/shaders/index.js.map +1 -1
  146. package/dist/attributes/shape/shaders/language.js.map +1 -1
  147. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  148. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  149. package/dist/attributes/shape/shadow/index.js.map +1 -1
  150. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  151. package/dist/attributes/shape/stroke/index.js.map +1 -1
  152. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  153. package/dist/attributes/shared/operators.js.map +1 -1
  154. package/dist/attributes/text/index.js.map +1 -1
  155. package/dist/attributes/text/ops.js.map +1 -1
  156. package/dist/attributes/text/types.js.map +1 -1
  157. package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
  158. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
  159. package/dist/browser/chunks/{chunk-GKM6UZJR.js → chunk-7DB6BI27.js} +2 -2
  160. package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
  161. package/dist/browser/chunks/{chunk-AOT33LMS.js → chunk-IX53IFBD.js} +2 -2
  162. package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
  163. package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
  164. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
  165. package/dist/browser/component.js +1 -1
  166. package/dist/browser/experimental.js +1 -1
  167. package/dist/browser/experimental.js.map +1 -1
  168. package/dist/browser/index.js +1 -1
  169. package/dist/browser/index.js.map +1 -1
  170. package/dist/browser/sdk.js +1 -1
  171. package/dist/component.js.map +1 -1
  172. package/dist/components/builtins/audio/audio.js.map +1 -1
  173. package/dist/components/builtins/geometry/composite.js.map +1 -1
  174. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  175. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  176. package/dist/components/builtins/layout/layout.js.map +1 -1
  177. package/dist/components/builtins/media/media.js.map +1 -1
  178. package/dist/components/builtins/providers/providers.js.map +1 -1
  179. package/dist/components/builtins/text/number-format.js.map +1 -1
  180. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  181. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  182. package/dist/components/builtins/text/text-layout.js.map +1 -1
  183. package/dist/components/builtins/text/text.d.ts +9 -9
  184. package/dist/components/builtins/text/text.js.map +1 -1
  185. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  186. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  187. package/dist/components/builtins/three/three.js.map +1 -1
  188. package/dist/components/factory/api.js.map +1 -1
  189. package/dist/components/factory/clip-of.js.map +1 -1
  190. package/dist/components/factory/commands-for.js.map +1 -1
  191. package/dist/components/factory/component-audio.js.map +1 -1
  192. package/dist/components/factory/component2d.js.map +1 -1
  193. package/dist/components/factory/component3d.js.map +1 -1
  194. package/dist/components/factory/factory.js.map +1 -1
  195. package/dist/components/factory/timeline.js.map +1 -1
  196. package/dist/components/factory/type-def.js.map +1 -1
  197. package/dist/components/factory/types.js.map +1 -1
  198. package/dist/components/factory/views.js.map +1 -1
  199. package/dist/components/modules/aim.js.map +1 -1
  200. package/dist/components/modules/corners.js.map +1 -1
  201. package/dist/components/modules/flow.js.map +1 -1
  202. package/dist/components/modules/material.js.map +1 -1
  203. package/dist/components/modules/paint.js.map +1 -1
  204. package/dist/components/modules/shapes.js.map +1 -1
  205. package/dist/components/modules/text-layout.js.map +1 -1
  206. package/dist/components/modules/text-style.d.ts +1 -1
  207. package/dist/components/modules/text-style.js.map +1 -1
  208. package/dist/components/modules/three-entries.js.map +1 -1
  209. package/dist/components/modules/view3d.js.map +1 -1
  210. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  211. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  212. package/dist/components/trees/2d/node-motion.js.map +1 -1
  213. package/dist/components/trees/2d/node-render.js.map +1 -1
  214. package/dist/components/trees/2d/node-space.js.map +1 -1
  215. package/dist/components/trees/2d/node-transform.js.map +1 -1
  216. package/dist/components/trees/2d/node2d.js.map +1 -1
  217. package/dist/components/trees/audio/index.js.map +1 -1
  218. package/dist/components/trees/audio/node-audio.js.map +1 -1
  219. package/dist/components/trees/index.js.map +1 -1
  220. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  221. package/dist/components/trees/node/node-reactive.js.map +1 -1
  222. package/dist/components/trees/node/node-time.js.map +1 -1
  223. package/dist/components/trees/node/node-walk.js.map +1 -1
  224. package/dist/components/trees/node/node.js.map +1 -1
  225. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  226. package/dist/components/trees/three/node3d.js.map +1 -1
  227. package/dist/document/audio.js.map +1 -1
  228. package/dist/document/builtins.js.map +1 -1
  229. package/dist/document/command-traits.js.map +1 -1
  230. package/dist/document/deny-globals.js.map +1 -1
  231. package/dist/document/diff.js.map +1 -1
  232. package/dist/document/doc-index.js.map +1 -1
  233. package/dist/document/expression/compile.js.map +1 -1
  234. package/dist/document/expression/index.js.map +1 -1
  235. package/dist/document/expression/ops.js.map +1 -1
  236. package/dist/document/expression/parse.js.map +1 -1
  237. package/dist/document/expression/refs.js.map +1 -1
  238. package/dist/document/expression/types.js.map +1 -1
  239. package/dist/document/expression/walk.js.map +1 -1
  240. package/dist/document/index.js.map +1 -1
  241. package/dist/document/migrate.js.map +1 -1
  242. package/dist/document/missing-node.js.map +1 -1
  243. package/dist/document/node-decorator.js.map +1 -1
  244. package/dist/document/node-descriptor.js.map +1 -1
  245. package/dist/document/placement.js.map +1 -1
  246. package/dist/document/project.js.map +1 -1
  247. package/dist/document/prop-evolution.js.map +1 -1
  248. package/dist/document/registry.js.map +1 -1
  249. package/dist/document/settled-index.js.map +1 -1
  250. package/dist/document/timeline-patch.js.map +1 -1
  251. package/dist/document/timeline.js.map +1 -1
  252. package/dist/document/types.js.map +1 -1
  253. package/dist/document/validate.js.map +1 -1
  254. package/dist/document/vocabulary.js.map +1 -1
  255. package/dist/experimental.d.ts.map +1 -1
  256. package/dist/experimental.js.map +1 -1
  257. package/dist/index.js.map +1 -1
  258. package/dist/layout/bounds.js.map +1 -1
  259. package/dist/layout/constraints.js.map +1 -1
  260. package/dist/layout/flex.js.map +1 -1
  261. package/dist/layout/freeform.js.map +1 -1
  262. package/dist/layout/grid.js.map +1 -1
  263. package/dist/layout/index.js.map +1 -1
  264. package/dist/layout/item.js.map +1 -1
  265. package/dist/layout/ops.js.map +1 -1
  266. package/dist/layout/types.js.map +1 -1
  267. package/dist/platform/audio-sink.js.map +1 -1
  268. package/dist/platform/exporter.js.map +1 -1
  269. package/dist/platform/index.js.map +1 -1
  270. package/dist/platform/stepped-clock.js.map +1 -1
  271. package/dist/platform/storage-adapter.js.map +1 -1
  272. package/dist/platform/ticker.js.map +1 -1
  273. package/dist/project/config.js.map +1 -1
  274. package/dist/project/index.js.map +1 -1
  275. package/dist/project/tree.js.map +1 -1
  276. package/dist/props/host.js.map +1 -1
  277. package/dist/props/index.js.map +1 -1
  278. package/dist/props/observer.js.map +1 -1
  279. package/dist/props/slot.js.map +1 -1
  280. package/dist/renamed-scene-names.js.map +1 -1
  281. package/dist/render/canvas-render-context2d.js.map +1 -1
  282. package/dist/render/clip-contains.js.map +1 -1
  283. package/dist/render/clip.js.map +1 -1
  284. package/dist/render/descriptors/ellipse.js.map +1 -1
  285. package/dist/render/descriptors/line.js.map +1 -1
  286. package/dist/render/descriptors/path-builder.js.map +1 -1
  287. package/dist/render/descriptors/path.js.map +1 -1
  288. package/dist/render/descriptors/polygon.js.map +1 -1
  289. package/dist/render/descriptors/polygram.js.map +1 -1
  290. package/dist/render/descriptors/rect.js.map +1 -1
  291. package/dist/render/descriptors/richtext.js.map +1 -1
  292. package/dist/render/descriptors/shape.js.map +1 -1
  293. package/dist/render/descriptors/text.js.map +1 -1
  294. package/dist/render/descriptors/transform.js.map +1 -1
  295. package/dist/render/graphics2d.js.map +1 -1
  296. package/dist/render/index.js.map +1 -1
  297. package/dist/render/measure-context.js.map +1 -1
  298. package/dist/render/null-render-context.js.map +1 -1
  299. package/dist/render/render-context2d.js.map +1 -1
  300. package/dist/render/render-issue.js.map +1 -1
  301. package/dist/render/surface.js.map +1 -1
  302. package/dist/render/text-defaults.js.map +1 -1
  303. package/dist/render/text-layout.js.map +1 -1
  304. package/dist/render3d/bounds3d.js.map +1 -1
  305. package/dist/render3d/builders.js.map +1 -1
  306. package/dist/render3d/camera.js.map +1 -1
  307. package/dist/render3d/fill3d.js.map +1 -1
  308. package/dist/render3d/geometry.js.map +1 -1
  309. package/dist/render3d/graphics3d.js.map +1 -1
  310. package/dist/render3d/index.js.map +1 -1
  311. package/dist/render3d/inert.js.map +1 -1
  312. package/dist/render3d/light.js.map +1 -1
  313. package/dist/render3d/material.js.map +1 -1
  314. package/dist/render3d/matrix4.js.map +1 -1
  315. package/dist/render3d/render-context3d.js.map +1 -1
  316. package/dist/render3d/resources.js.map +1 -1
  317. package/dist/render3d/rounded-box.js.map +1 -1
  318. package/dist/render3d/scene-settings.js.map +1 -1
  319. package/dist/render3d/scene3d.js.map +1 -1
  320. package/dist/render3d/segments.js.map +1 -1
  321. package/dist/render3d/texture.js.map +1 -1
  322. package/dist/render3d/tracking.js.map +1 -1
  323. package/dist/render3d/transform.js.map +1 -1
  324. package/dist/render3d/vector3.js.map +1 -1
  325. package/dist/render3d/walk.js.map +1 -1
  326. package/dist/runtime/asset-refine.js.map +1 -1
  327. package/dist/runtime/asset-timeline.js.map +1 -1
  328. package/dist/runtime/asset-update.js.map +1 -1
  329. package/dist/runtime/audio-index.js.map +1 -1
  330. package/dist/runtime/builtin-context.js.map +1 -1
  331. package/dist/runtime/clip-instance.js.map +1 -1
  332. package/dist/runtime/clip-store.js.map +1 -1
  333. package/dist/runtime/engine.js.map +1 -1
  334. package/dist/runtime/frame-time.js.map +1 -1
  335. package/dist/runtime/index.js.map +1 -1
  336. package/dist/runtime/node-picking.js.map +1 -1
  337. package/dist/runtime/node-picking3d.js.map +1 -1
  338. package/dist/runtime/placement.js.map +1 -1
  339. package/dist/runtime/playback-controller.js.map +1 -1
  340. package/dist/runtime/playback.js.map +1 -1
  341. package/dist/runtime/precompisition.js.map +1 -1
  342. package/dist/runtime/project-assets.js.map +1 -1
  343. package/dist/runtime/session.js.map +1 -1
  344. package/dist/runtime/settle.js.map +1 -1
  345. package/dist/runtime/state-evaluator.js.map +1 -1
  346. package/dist/runtime/text-geometry.js.map +1 -1
  347. package/dist/sdk/index.js.map +1 -1
  348. package/dist/tween/command-decorator.js.map +1 -1
  349. package/dist/tween/command.js.map +1 -1
  350. package/dist/tween/ease/constants.js.map +1 -1
  351. package/dist/tween/ease/curve.js.map +1 -1
  352. package/dist/tween/ease/describe.js.map +1 -1
  353. package/dist/tween/ease/spec.js.map +1 -1
  354. package/dist/tween/ease/type.js.map +1 -1
  355. package/dist/tween/index.js.map +1 -1
  356. package/dist/tween/inert.js.map +1 -1
  357. package/dist/tween/lerp.js.map +1 -1
  358. package/dist/tween/loop.js.map +1 -1
  359. package/dist/tween/prepare.js.map +1 -1
  360. package/dist/tween/stepper.js.map +1 -1
  361. package/dist/tween/to-command.js.map +1 -1
  362. package/dist/util/clamp.js.map +1 -1
  363. package/dist/util/context.js.map +1 -1
  364. package/dist/util/csv.js.map +1 -1
  365. package/dist/util/generateList.js.map +1 -1
  366. package/dist/util/index.js.map +1 -1
  367. package/dist/util/metrics.js.map +1 -1
  368. package/dist/util/random.js.map +1 -1
  369. package/dist/util/reference.js.map +1 -1
  370. package/dist/util/scheduler.js.map +1 -1
  371. package/package.json +1 -1
  372. package/dist/attributes/audio/filters/chain.d.ts +0 -113
  373. package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
  374. package/dist/attributes/audio/filters/chain.js +0 -104
  375. package/dist/attributes/audio/filters/chain.js.map +0 -1
  376. package/dist/attributes/audio/filters/curve.d.ts +0 -152
  377. package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
  378. package/dist/attributes/audio/filters/curve.js +0 -250
  379. package/dist/attributes/audio/filters/curve.js.map +0 -1
  380. package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
  381. package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
  382. package/dist/attributes/audio/filters/implementations/echo.js +0 -11
  383. package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
  384. package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
  385. package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
  386. package/dist/attributes/audio/filters/implementations/gain.js +0 -6
  387. package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
  388. package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
  389. package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
  390. package/dist/attributes/audio/filters/implementations/highpass.js +0 -10
  391. package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
  392. package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
  393. package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
  394. package/dist/attributes/audio/filters/implementations/lowpass.js +0 -10
  395. package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
  396. package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
  397. package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
  398. package/dist/attributes/audio/filters/implementations/speed.js +0 -6
  399. package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
  400. package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
  401. package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
  402. package/dist/attributes/audio/filters/implementations/tremolo.js +0 -10
  403. package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
  404. package/dist/attributes/audio/filters/index.d.ts +0 -22
  405. package/dist/attributes/audio/filters/index.d.ts.map +0 -1
  406. package/dist/attributes/audio/filters/index.js +0 -8
  407. package/dist/attributes/audio/filters/index.js.map +0 -1
  408. package/dist/attributes/audio/filters/registry.d.ts +0 -36
  409. package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
  410. package/dist/attributes/audio/filters/registry.js +0 -82
  411. package/dist/attributes/audio/filters/registry.js.map +0 -1
  412. package/dist/attributes/audio/filters/union.d.ts +0 -18
  413. package/dist/attributes/audio/filters/union.d.ts.map +0 -1
  414. package/dist/attributes/audio/filters/union.js +0 -28
  415. package/dist/attributes/audio/filters/union.js.map +0 -1
  416. package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
  417. package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
  418. package/dist/attributes/shape/sksl-uniforms.js +0 -0
  419. package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
  420. package/dist/browser/chunks/chunk-AOT33LMS.js.map +0 -7
  421. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +0 -7
  422. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
  423. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
  424. package/dist/component/api.d.ts +0 -508
  425. package/dist/component/api.d.ts.map +0 -1
  426. package/dist/component/api.js +0 -4
  427. package/dist/component/api.js.map +0 -1
  428. package/dist/component/builtins/audio.d.ts +0 -26
  429. package/dist/component/builtins/audio.d.ts.map +0 -1
  430. package/dist/component/builtins/audio.js +0 -41
  431. package/dist/component/builtins/audio.js.map +0 -1
  432. package/dist/component/builtins/canvas3d.d.ts +0 -98
  433. package/dist/component/builtins/canvas3d.d.ts.map +0 -1
  434. package/dist/component/builtins/canvas3d.js +0 -21
  435. package/dist/component/builtins/canvas3d.js.map +0 -1
  436. package/dist/component/builtins/composite.d.ts +0 -56
  437. package/dist/component/builtins/composite.d.ts.map +0 -1
  438. package/dist/component/builtins/composite.js +0 -25
  439. package/dist/component/builtins/composite.js.map +0 -1
  440. package/dist/component/builtins/geometry.d.ts +0 -505
  441. package/dist/component/builtins/geometry.d.ts.map +0 -1
  442. package/dist/component/builtins/geometry.js +0 -107
  443. package/dist/component/builtins/geometry.js.map +0 -1
  444. package/dist/component/builtins/layout.d.ts +0 -88
  445. package/dist/component/builtins/layout.d.ts.map +0 -1
  446. package/dist/component/builtins/layout.js +0 -84
  447. package/dist/component/builtins/layout.js.map +0 -1
  448. package/dist/component/builtins/media.d.ts +0 -95
  449. package/dist/component/builtins/media.d.ts.map +0 -1
  450. package/dist/component/builtins/media.js +0 -149
  451. package/dist/component/builtins/media.js.map +0 -1
  452. package/dist/component/builtins/providers.d.ts +0 -23
  453. package/dist/component/builtins/providers.d.ts.map +0 -1
  454. package/dist/component/builtins/providers.js +0 -30
  455. package/dist/component/builtins/providers.js.map +0 -1
  456. package/dist/component/builtins/text.d.ts +0 -193
  457. package/dist/component/builtins/text.d.ts.map +0 -1
  458. package/dist/component/builtins/text.js +0 -113
  459. package/dist/component/builtins/text.js.map +0 -1
  460. package/dist/component/builtins/three.d.ts +0 -1085
  461. package/dist/component/builtins/three.d.ts.map +0 -1
  462. package/dist/component/builtins/three.js +0 -265
  463. package/dist/component/builtins/three.js.map +0 -1
  464. package/dist/component/clip-of.d.ts +0 -5
  465. package/dist/component/clip-of.d.ts.map +0 -1
  466. package/dist/component/clip-of.js +0 -33
  467. package/dist/component/clip-of.js.map +0 -1
  468. package/dist/component/commands-for.d.ts +0 -19
  469. package/dist/component/commands-for.d.ts.map +0 -1
  470. package/dist/component/commands-for.js +0 -5
  471. package/dist/component/commands-for.js.map +0 -1
  472. package/dist/component/component-audio.d.ts +0 -9
  473. package/dist/component/component-audio.d.ts.map +0 -1
  474. package/dist/component/component-audio.js +0 -18
  475. package/dist/component/component-audio.js.map +0 -1
  476. package/dist/component/component2d.d.ts +0 -9
  477. package/dist/component/component2d.d.ts.map +0 -1
  478. package/dist/component/component2d.js +0 -239
  479. package/dist/component/component2d.js.map +0 -1
  480. package/dist/component/component3d.d.ts +0 -9
  481. package/dist/component/component3d.d.ts.map +0 -1
  482. package/dist/component/component3d.js +0 -99
  483. package/dist/component/component3d.js.map +0 -1
  484. package/dist/component/factory.d.ts +0 -63
  485. package/dist/component/factory.d.ts.map +0 -1
  486. package/dist/component/factory.js +0 -313
  487. package/dist/component/factory.js.map +0 -1
  488. package/dist/component/modules/aim.d.ts +0 -30
  489. package/dist/component/modules/aim.d.ts.map +0 -1
  490. package/dist/component/modules/aim.js +0 -39
  491. package/dist/component/modules/aim.js.map +0 -1
  492. package/dist/component/modules/corners.d.ts +0 -13
  493. package/dist/component/modules/corners.d.ts.map +0 -1
  494. package/dist/component/modules/corners.js +0 -12
  495. package/dist/component/modules/corners.js.map +0 -1
  496. package/dist/component/modules/flow.d.ts +0 -26
  497. package/dist/component/modules/flow.d.ts.map +0 -1
  498. package/dist/component/modules/flow.js +0 -55
  499. package/dist/component/modules/flow.js.map +0 -1
  500. package/dist/component/modules/material.d.ts +0 -40
  501. package/dist/component/modules/material.d.ts.map +0 -1
  502. package/dist/component/modules/material.js +0 -75
  503. package/dist/component/modules/material.js.map +0 -1
  504. package/dist/component/modules/paint.d.ts +0 -71
  505. package/dist/component/modules/paint.d.ts.map +0 -1
  506. package/dist/component/modules/paint.js +0 -106
  507. package/dist/component/modules/paint.js.map +0 -1
  508. package/dist/component/modules/shapes.d.ts +0 -31
  509. package/dist/component/modules/shapes.d.ts.map +0 -1
  510. package/dist/component/modules/shapes.js +0 -43
  511. package/dist/component/modules/shapes.js.map +0 -1
  512. package/dist/component/modules/text-layout.d.ts +0 -26
  513. package/dist/component/modules/text-layout.d.ts.map +0 -1
  514. package/dist/component/modules/text-layout.js +0 -57
  515. package/dist/component/modules/text-layout.js.map +0 -1
  516. package/dist/component/modules/text-style.d.ts +0 -48
  517. package/dist/component/modules/text-style.d.ts.map +0 -1
  518. package/dist/component/modules/text-style.js +0 -63
  519. package/dist/component/modules/text-style.js.map +0 -1
  520. package/dist/component/modules/three-entries.d.ts +0 -23
  521. package/dist/component/modules/three-entries.d.ts.map +0 -1
  522. package/dist/component/modules/three-entries.js +0 -41
  523. package/dist/component/modules/three-entries.js.map +0 -1
  524. package/dist/component/modules/view3d.d.ts +0 -55
  525. package/dist/component/modules/view3d.d.ts.map +0 -1
  526. package/dist/component/modules/view3d.js +0 -160
  527. package/dist/component/modules/view3d.js.map +0 -1
  528. package/dist/component/timeline.d.ts +0 -22
  529. package/dist/component/timeline.d.ts.map +0 -1
  530. package/dist/component/timeline.js +0 -128
  531. package/dist/component/timeline.js.map +0 -1
  532. package/dist/component/type-def.d.ts +0 -26
  533. package/dist/component/type-def.d.ts.map +0 -1
  534. package/dist/component/type-def.js +0 -16
  535. package/dist/component/type-def.js.map +0 -1
  536. package/dist/component/types.d.ts +0 -91
  537. package/dist/component/types.d.ts.map +0 -1
  538. package/dist/component/types.js +0 -88
  539. package/dist/component/types.js.map +0 -1
  540. package/dist/component/views.d.ts +0 -121
  541. package/dist/component/views.d.ts.map +0 -1
  542. package/dist/component/views.js +0 -413
  543. package/dist/component/views.js.map +0 -1
  544. package/dist/document/withdraw.d.ts +0 -28
  545. package/dist/document/withdraw.d.ts.map +0 -1
  546. package/dist/document/withdraw.js +0 -61
  547. package/dist/document/withdraw.js.map +0 -1
  548. package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
  549. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  550. package/dist/jsx/jsx-dev-runtime.js +0 -3
  551. package/dist/jsx/jsx-dev-runtime.js.map +0 -1
  552. package/dist/jsx/jsx-runtime.d.ts +0 -27
  553. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  554. package/dist/jsx/jsx-runtime.js +0 -26
  555. package/dist/jsx/jsx-runtime.js.map +0 -1
  556. package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
  557. package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
  558. package/dist/nodes/2d/node-lifecycle.js +0 -264
  559. package/dist/nodes/2d/node-lifecycle.js.map +0 -1
  560. package/dist/nodes/2d/node-motion.d.ts +0 -56
  561. package/dist/nodes/2d/node-motion.d.ts.map +0 -1
  562. package/dist/nodes/2d/node-motion.js +0 -86
  563. package/dist/nodes/2d/node-motion.js.map +0 -1
  564. package/dist/nodes/2d/node-render.d.ts +0 -44
  565. package/dist/nodes/2d/node-render.d.ts.map +0 -1
  566. package/dist/nodes/2d/node-render.js +0 -80
  567. package/dist/nodes/2d/node-render.js.map +0 -1
  568. package/dist/nodes/2d/node-space.d.ts +0 -63
  569. package/dist/nodes/2d/node-space.d.ts.map +0 -1
  570. package/dist/nodes/2d/node-space.js +0 -131
  571. package/dist/nodes/2d/node-space.js.map +0 -1
  572. package/dist/nodes/2d/node-transform.d.ts +0 -55
  573. package/dist/nodes/2d/node-transform.d.ts.map +0 -1
  574. package/dist/nodes/2d/node-transform.js +0 -73
  575. package/dist/nodes/2d/node-transform.js.map +0 -1
  576. package/dist/nodes/2d/node2d.d.ts +0 -1111
  577. package/dist/nodes/2d/node2d.d.ts.map +0 -1
  578. package/dist/nodes/2d/node2d.js +0 -1665
  579. package/dist/nodes/2d/node2d.js.map +0 -1
  580. package/dist/nodes/2d/paint-node.d.ts +0 -142
  581. package/dist/nodes/2d/paint-node.d.ts.map +0 -1
  582. package/dist/nodes/2d/paint-node.js +0 -232
  583. package/dist/nodes/2d/paint-node.js.map +0 -1
  584. package/dist/nodes/audio/audio-bus.d.ts +0 -28
  585. package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
  586. package/dist/nodes/audio/audio-bus.js +0 -33
  587. package/dist/nodes/audio/audio-bus.js.map +0 -1
  588. package/dist/nodes/audio/index.d.ts +0 -4
  589. package/dist/nodes/audio/index.d.ts.map +0 -1
  590. package/dist/nodes/audio/index.js +0 -2
  591. package/dist/nodes/audio/index.js.map +0 -1
  592. package/dist/nodes/audio/node-audio.d.ts +0 -107
  593. package/dist/nodes/audio/node-audio.d.ts.map +0 -1
  594. package/dist/nodes/audio/node-audio.js +0 -179
  595. package/dist/nodes/audio/node-audio.js.map +0 -1
  596. package/dist/nodes/audio/sound-node.d.ts +0 -41
  597. package/dist/nodes/audio/sound-node.d.ts.map +0 -1
  598. package/dist/nodes/audio/sound-node.js +0 -71
  599. package/dist/nodes/audio/sound-node.js.map +0 -1
  600. package/dist/nodes/geometry/boolean-node.d.ts +0 -28
  601. package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
  602. package/dist/nodes/geometry/boolean-node.js +0 -81
  603. package/dist/nodes/geometry/boolean-node.js.map +0 -1
  604. package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
  605. package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
  606. package/dist/nodes/geometry/bounds-shape-node.js +0 -181
  607. package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
  608. package/dist/nodes/geometry/box-path-node.d.ts +0 -89
  609. package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
  610. package/dist/nodes/geometry/box-path-node.js +0 -116
  611. package/dist/nodes/geometry/box-path-node.js.map +0 -1
  612. package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
  613. package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
  614. package/dist/nodes/geometry/ellipse-node.js +0 -45
  615. package/dist/nodes/geometry/ellipse-node.js.map +0 -1
  616. package/dist/nodes/geometry/group-bounds.d.ts +0 -56
  617. package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
  618. package/dist/nodes/geometry/group-bounds.js +0 -87
  619. package/dist/nodes/geometry/group-bounds.js.map +0 -1
  620. package/dist/nodes/geometry/mask-node.d.ts +0 -33
  621. package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
  622. package/dist/nodes/geometry/mask-node.js +0 -66
  623. package/dist/nodes/geometry/mask-node.js.map +0 -1
  624. package/dist/nodes/geometry/path-node.d.ts +0 -26
  625. package/dist/nodes/geometry/path-node.d.ts.map +0 -1
  626. package/dist/nodes/geometry/path-node.js +0 -58
  627. package/dist/nodes/geometry/path-node.js.map +0 -1
  628. package/dist/nodes/geometry/polygon-node.d.ts +0 -26
  629. package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
  630. package/dist/nodes/geometry/polygon-node.js +0 -47
  631. package/dist/nodes/geometry/polygon-node.js.map +0 -1
  632. package/dist/nodes/geometry/polygram-node.d.ts +0 -33
  633. package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
  634. package/dist/nodes/geometry/polygram-node.js +0 -52
  635. package/dist/nodes/geometry/polygram-node.js.map +0 -1
  636. package/dist/nodes/geometry/rect-node.d.ts +0 -38
  637. package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
  638. package/dist/nodes/geometry/rect-node.js +0 -56
  639. package/dist/nodes/geometry/rect-node.js.map +0 -1
  640. package/dist/nodes/geometry/shape-node.d.ts +0 -71
  641. package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
  642. package/dist/nodes/geometry/shape-node.js +0 -140
  643. package/dist/nodes/geometry/shape-node.js.map +0 -1
  644. package/dist/nodes/geometry/shape-outline.d.ts +0 -93
  645. package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
  646. package/dist/nodes/geometry/shape-outline.js +0 -470
  647. package/dist/nodes/geometry/shape-outline.js.map +0 -1
  648. package/dist/nodes/index.d.ts +0 -53
  649. package/dist/nodes/index.d.ts.map +0 -1
  650. package/dist/nodes/index.js +0 -35
  651. package/dist/nodes/index.js.map +0 -1
  652. package/dist/nodes/layout/camera-node.d.ts +0 -80
  653. package/dist/nodes/layout/camera-node.d.ts.map +0 -1
  654. package/dist/nodes/layout/camera-node.js +0 -153
  655. package/dist/nodes/layout/camera-node.js.map +0 -1
  656. package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
  657. package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
  658. package/dist/nodes/layout/orbit-camera-node.js +0 -118
  659. package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
  660. package/dist/nodes/layout/rotated-box.d.ts +0 -20
  661. package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
  662. package/dist/nodes/layout/rotated-box.js +0 -76
  663. package/dist/nodes/layout/rotated-box.js.map +0 -1
  664. package/dist/nodes/media/video-node.d.ts +0 -229
  665. package/dist/nodes/media/video-node.d.ts.map +0 -1
  666. package/dist/nodes/media/video-node.js +0 -350
  667. package/dist/nodes/media/video-node.js.map +0 -1
  668. package/dist/nodes/node/declare-paints.d.ts +0 -19
  669. package/dist/nodes/node/declare-paints.d.ts.map +0 -1
  670. package/dist/nodes/node/declare-paints.js +0 -27
  671. package/dist/nodes/node/declare-paints.js.map +0 -1
  672. package/dist/nodes/node/node-editor-state.d.ts +0 -53
  673. package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
  674. package/dist/nodes/node/node-editor-state.js +0 -23
  675. package/dist/nodes/node/node-editor-state.js.map +0 -1
  676. package/dist/nodes/node/node-reactive.d.ts +0 -89
  677. package/dist/nodes/node/node-reactive.d.ts.map +0 -1
  678. package/dist/nodes/node/node-reactive.js +0 -135
  679. package/dist/nodes/node/node-reactive.js.map +0 -1
  680. package/dist/nodes/node/node-time.d.ts +0 -39
  681. package/dist/nodes/node/node-time.d.ts.map +0 -1
  682. package/dist/nodes/node/node-time.js +0 -14
  683. package/dist/nodes/node/node-time.js.map +0 -1
  684. package/dist/nodes/node/node-walk.d.ts +0 -46
  685. package/dist/nodes/node/node-walk.d.ts.map +0 -1
  686. package/dist/nodes/node/node-walk.js +0 -74
  687. package/dist/nodes/node/node-walk.js.map +0 -1
  688. package/dist/nodes/node/node.d.ts +0 -445
  689. package/dist/nodes/node/node.d.ts.map +0 -1
  690. package/dist/nodes/node/node.js +0 -745
  691. package/dist/nodes/node/node.js.map +0 -1
  692. package/dist/nodes/node/text-defaults.d.ts +0 -32
  693. package/dist/nodes/node/text-defaults.d.ts.map +0 -1
  694. package/dist/nodes/node/text-defaults.js +0 -37
  695. package/dist/nodes/node/text-defaults.js.map +0 -1
  696. package/dist/nodes/root/canvas2d-node.d.ts +0 -163
  697. package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
  698. package/dist/nodes/root/canvas2d-node.js +0 -264
  699. package/dist/nodes/root/canvas2d-node.js.map +0 -1
  700. package/dist/nodes/root/provider-node.d.ts +0 -47
  701. package/dist/nodes/root/provider-node.d.ts.map +0 -1
  702. package/dist/nodes/root/provider-node.js +0 -63
  703. package/dist/nodes/root/provider-node.js.map +0 -1
  704. package/dist/nodes/root/theme-provider-node.d.ts +0 -29
  705. package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
  706. package/dist/nodes/root/theme-provider-node.js +0 -43
  707. package/dist/nodes/root/theme-provider-node.js.map +0 -1
  708. package/dist/nodes/text/default-text-style-node.d.ts +0 -103
  709. package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
  710. package/dist/nodes/text/default-text-style-node.js +0 -146
  711. package/dist/nodes/text/default-text-style-node.js.map +0 -1
  712. package/dist/nodes/text/number-format.d.ts +0 -66
  713. package/dist/nodes/text/number-format.d.ts.map +0 -1
  714. package/dist/nodes/text/number-format.js +0 -227
  715. package/dist/nodes/text/number-format.js.map +0 -1
  716. package/dist/nodes/text/number-node.d.ts +0 -94
  717. package/dist/nodes/text/number-node.d.ts.map +0 -1
  718. package/dist/nodes/text/number-node.js +0 -86
  719. package/dist/nodes/text/number-node.js.map +0 -1
  720. package/dist/nodes/text/number-pattern.d.ts +0 -51
  721. package/dist/nodes/text/number-pattern.d.ts.map +0 -1
  722. package/dist/nodes/text/number-pattern.js +0 -77
  723. package/dist/nodes/text/number-pattern.js.map +0 -1
  724. package/dist/nodes/text/richtext-node.d.ts +0 -68
  725. package/dist/nodes/text/richtext-node.d.ts.map +0 -1
  726. package/dist/nodes/text/richtext-node.js +0 -78
  727. package/dist/nodes/text/richtext-node.js.map +0 -1
  728. package/dist/nodes/text/text-base.d.ts +0 -118
  729. package/dist/nodes/text/text-base.d.ts.map +0 -1
  730. package/dist/nodes/text/text-base.js +0 -153
  731. package/dist/nodes/text/text-base.js.map +0 -1
  732. package/dist/nodes/text/text-layout.d.ts +0 -87
  733. package/dist/nodes/text/text-layout.d.ts.map +0 -1
  734. package/dist/nodes/text/text-layout.js +0 -368
  735. package/dist/nodes/text/text-layout.js.map +0 -1
  736. package/dist/nodes/text/text-node.d.ts +0 -84
  737. package/dist/nodes/text/text-node.d.ts.map +0 -1
  738. package/dist/nodes/text/text-node.js +0 -188
  739. package/dist/nodes/text/text-node.js.map +0 -1
  740. package/dist/nodes/text/text-selection.d.ts +0 -125
  741. package/dist/nodes/text/text-selection.d.ts.map +0 -1
  742. package/dist/nodes/text/text-selection.js +0 -209
  743. package/dist/nodes/text/text-selection.js.map +0 -1
  744. package/dist/nodes/three/camera-nodes.d.ts +0 -109
  745. package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
  746. package/dist/nodes/three/camera-nodes.js +0 -112
  747. package/dist/nodes/three/camera-nodes.js.map +0 -1
  748. package/dist/nodes/three/canvas3d-node.d.ts +0 -295
  749. package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
  750. package/dist/nodes/three/canvas3d-node.js +0 -486
  751. package/dist/nodes/three/canvas3d-node.js.map +0 -1
  752. package/dist/nodes/three/drawable-nodes.d.ts +0 -173
  753. package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
  754. package/dist/nodes/three/drawable-nodes.js +0 -284
  755. package/dist/nodes/three/drawable-nodes.js.map +0 -1
  756. package/dist/nodes/three/environment-nodes.d.ts +0 -106
  757. package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
  758. package/dist/nodes/three/environment-nodes.js +0 -134
  759. package/dist/nodes/three/environment-nodes.js.map +0 -1
  760. package/dist/nodes/three/geometry-nodes.d.ts +0 -197
  761. package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
  762. package/dist/nodes/three/geometry-nodes.js +0 -322
  763. package/dist/nodes/three/geometry-nodes.js.map +0 -1
  764. package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
  765. package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
  766. package/dist/nodes/three/grid-geometry3d.js +0 -114
  767. package/dist/nodes/three/grid-geometry3d.js.map +0 -1
  768. package/dist/nodes/three/group3d.d.ts +0 -23
  769. package/dist/nodes/three/group3d.d.ts.map +0 -1
  770. package/dist/nodes/three/group3d.js +0 -21
  771. package/dist/nodes/three/group3d.js.map +0 -1
  772. package/dist/nodes/three/light-nodes.d.ts +0 -120
  773. package/dist/nodes/three/light-nodes.d.ts.map +0 -1
  774. package/dist/nodes/three/light-nodes.js +0 -173
  775. package/dist/nodes/three/light-nodes.js.map +0 -1
  776. package/dist/nodes/three/mesh3d.d.ts +0 -117
  777. package/dist/nodes/three/mesh3d.d.ts.map +0 -1
  778. package/dist/nodes/three/mesh3d.js +0 -147
  779. package/dist/nodes/three/mesh3d.js.map +0 -1
  780. package/dist/nodes/three/node3d.d.ts +0 -230
  781. package/dist/nodes/three/node3d.d.ts.map +0 -1
  782. package/dist/nodes/three/node3d.js +0 -337
  783. package/dist/nodes/three/node3d.js.map +0 -1
  784. package/dist/render/descriptors/latex.d.ts +0 -6
  785. package/dist/render/descriptors/latex.d.ts.map +0 -1
  786. package/dist/render/descriptors/latex.js +0 -2
  787. package/dist/render/descriptors/latex.js.map +0 -1
  788. package/dist/tween/seekable.d.ts +0 -81
  789. package/dist/tween/seekable.d.ts.map +0 -1
  790. package/dist/tween/seekable.js +0 -137
  791. package/dist/tween/seekable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"echo.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/echo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAyB1C,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACzD,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1C,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,EAAE,EAAE,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC;QACxD,6DAA6D;QAC7D,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK;KACzC,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC;QACrC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;CAC1B,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\r\nimport type { BlendMode } from \"../../fill/blend\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\n/**\r\n * Composites the current video frame with a trail of past frames (After Effects'\r\n * Echo), each delayed by `delay` seconds and faded by a `decay` factor. Needs\r\n * several decoded frames at once, so — unlike the pixel filters — it is rendered\r\n * by a dedicated multi-pass path in the video fill renderer rather than the\r\n * `setImageFilter` chain. Video-only; a no-op on image fills.\r\n *\r\n * The trail reaches back `echoes * delay` source seconds; frames outside the\r\n * adapter's decoded back-window are simply skipped (the trail fills in over the\r\n * first second of playback after a cold seek).\r\n */\r\nexport interface VideoEchoFilter {\r\n type: 'echo';\r\n /** Number of past-frame taps drawn behind the current frame. */\r\n echoes: number;\r\n /** Delay between successive taps, in source seconds. */\r\n delay: number;\r\n /** Per-tap alpha multiplier; tap `n` is drawn at `decay ** n`. Default 0.5. */\r\n decay?: number;\r\n /** Blend mode used to composite the echo taps. Default `'screen'`. */\r\n blend?: BlendMode;\r\n}\r\n\r\nexport const echoFilter: FilterData<VideoEchoFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"echo\",\r\n echoes: Math.round(lerpNumber(from.echoes, to.echoes, t)),\r\n delay: lerpNumber(from.delay, to.delay, t),\r\n decay: lerpNumber(from.decay ?? 0.5, to.decay ?? 0.5, t),\r\n // Blend is a discrete enum, so it hard-cuts at the midpoint.\r\n blend: t < 0.5 ? from.blend : to.blend,\r\n }),\r\n equals: (a, b) =>\r\n a.echoes === b.echoes &&\r\n a.delay === b.delay &&\r\n (a.decay ?? 0.5) === (b.decay ?? 0.5) &&\r\n a.blend === b.blend,\r\n};\r\n"]}
1
+ {"version":3,"file":"echo.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/echo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAyB1C,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACzD,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1C,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,EAAE,EAAE,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC;QACxD,6DAA6D;QAC7D,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK;KACzC,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC;QACrC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;CAC1B,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport type { BlendMode } from \"../../fill/blend\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/**\n * Composites the current video frame with a trail of past frames (After Effects'\n * Echo), each delayed by `delay` seconds and faded by a `decay` factor. Needs\n * several decoded frames at once, so — unlike the pixel filters — it is rendered\n * by a dedicated multi-pass path in the video fill renderer rather than the\n * `setImageFilter` chain. Video-only; a no-op on image fills.\n *\n * The trail reaches back `echoes * delay` source seconds; frames outside the\n * adapter's decoded back-window are simply skipped (the trail fills in over the\n * first second of playback after a cold seek).\n */\nexport interface VideoEchoFilter {\n type: 'echo';\n /** Number of past-frame taps drawn behind the current frame. */\n echoes: number;\n /** Delay between successive taps, in source seconds. */\n delay: number;\n /** Per-tap alpha multiplier; tap `n` is drawn at `decay ** n`. Default 0.5. */\n decay?: number;\n /** Blend mode used to composite the echo taps. Default `'screen'`. */\n blend?: BlendMode;\n}\n\nexport const echoFilter: FilterData<VideoEchoFilter> = {\n lerp: (from, to, t) => ({\n type: \"echo\",\n echoes: Math.round(lerpNumber(from.echoes, to.echoes, t)),\n delay: lerpNumber(from.delay, to.delay, t),\n decay: lerpNumber(from.decay ?? 0.5, to.decay ?? 0.5, t),\n // Blend is a discrete enum, so it hard-cuts at the midpoint.\n blend: t < 0.5 ? from.blend : to.blend,\n }),\n equals: (a, b) =>\n a.echoes === b.echoes &&\n a.delay === b.delay &&\n (a.decay ?? 0.5) === (b.decay ?? 0.5) &&\n a.blend === b.blend,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"exposure.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/exposure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,cAAc,GAA+B;IACtD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\n/** Scales the overall luminance of the media layer. */\r\nexport interface ExposureFilter {\r\n type: 'exposure';\r\n /** Exposure multiplier. 1 = unchanged, >1 brighter, <1 darker. */\r\n amount: number;\r\n}\r\n\r\nexport const exposureFilter: FilterData<ExposureFilter> = {\r\n lerp: (from, to, t) => ({ type: \"exposure\", amount: lerpNumber(from.amount, to.amount, t) }),\r\n equals: (a, b) => a.amount === b.amount,\r\n};\r\n"]}
1
+ {"version":3,"file":"exposure.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/exposure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,cAAc,GAA+B;IACtD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/** Scales the overall luminance of the media layer. */\nexport interface ExposureFilter {\n type: 'exposure';\n /** Exposure multiplier. 1 = unchanged, >1 brighter, <1 darker. */\n amount: number;\n}\n\nexport const exposureFilter: FilterData<ExposureFilter> = {\n lerp: (from, to, t) => ({ type: \"exposure\", amount: lerpNumber(from.amount, to.amount, t) }),\n equals: (a, b) => a.amount === b.amount,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"grayscale.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/grayscale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,eAAe,GAAgC;IACxD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7F,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\n/** Desaturates the media layer toward black and white. */\r\nexport interface GrayscaleFilter {\r\n type: 'grayscale';\r\n /** 0 = original, 1 = fully grayscale. */\r\n amount: number;\r\n}\r\n\r\nexport const grayscaleFilter: FilterData<GrayscaleFilter> = {\r\n lerp: (from, to, t) => ({ type: \"grayscale\", amount: lerpNumber(from.amount, to.amount, t) }),\r\n equals: (a, b) => a.amount === b.amount,\r\n};\r\n"]}
1
+ {"version":3,"file":"grayscale.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/grayscale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,eAAe,GAAgC;IACxD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7F,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/** Desaturates the media layer toward black and white. */\nexport interface GrayscaleFilter {\n type: 'grayscale';\n /** 0 = original, 1 = fully grayscale. */\n amount: number;\n}\n\nexport const grayscaleFilter: FilterData<GrayscaleFilter> = {\n lerp: (from, to, t) => ({ type: \"grayscale\", amount: lerpNumber(from.amount, to.amount, t) }),\n equals: (a, b) => a.amount === b.amount,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"posterize-time.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/posterize-time.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C,MAAM,CAAC,MAAM,mBAAmB,GAAoC;IAChE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;CACpC,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\n\r\n/**\r\n * Resamples a video fill to a lower frame rate, holding each source frame for a\r\n * `1 / fps` interval — the \"stop-motion\" / stutter look (After Effects' Posterize\r\n * Time). Purely temporal: it changes *which* source timestamp is shown, not the\r\n * pixels, so it is consumed in the video fill's per-frame `update()` (it never\r\n * reaches the pixel-filter / `setImageFilter` path). No-op on image fills.\r\n */\r\nexport interface PosterizeTimeFilter {\r\n type: 'posterizeTime';\r\n /** Target frame rate the source playhead snaps to, in frames per second. */\r\n fps: number;\r\n}\r\n\r\nexport const posterizeTimeFilter: FilterData<PosterizeTimeFilter> = {\r\n lerp: (from, to, t) => ({ type: \"posterizeTime\", fps: lerpNumber(from.fps, to.fps, t) }),\r\n equals: (a, b) => a.fps === b.fps,\r\n};\r\n"]}
1
+ {"version":3,"file":"posterize-time.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/posterize-time.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C,MAAM,CAAC,MAAM,mBAAmB,GAAoC;IAChE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;CACpC,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/**\n * Resamples a video fill to a lower frame rate, holding each source frame for a\n * `1 / fps` interval — the \"stop-motion\" / stutter look (After Effects' Posterize\n * Time). Purely temporal: it changes *which* source timestamp is shown, not the\n * pixels, so it is consumed in the video fill's per-frame `update()` (it never\n * reaches the pixel-filter / `setImageFilter` path). No-op on image fills.\n */\nexport interface PosterizeTimeFilter {\n type: 'posterizeTime';\n /** Target frame rate the source playhead snaps to, in frames per second. */\n fps: number;\n}\n\nexport const posterizeTimeFilter: FilterData<PosterizeTimeFilter> = {\n lerp: (from, to, t) => ({ type: \"posterizeTime\", fps: lerpNumber(from.fps, to.fps, t) }),\n equals: (a, b) => a.fps === b.fps,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/index.ts"],"names":[],"mappings":"AAWA,iGAAiG;AACjG,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACzI,yEAAyE;AACzE,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAsBtE,sFAAsF;AACtF,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/** @internal Media-filter data types for each built-in filter. */\r\n/** @internal */ export type { ExposureFilter } from './implementations/exposure';\r\n/** @internal */ export type { BlurFilter } from './implementations/blur';\r\n/** @internal */ export type { GrayscaleFilter } from './implementations/grayscale';\r\n/** @internal */ export type { AlphaFilter } from './implementations/alpha';\r\n/** @internal */ export type { ColorMatrixFilter } from './implementations/color-matrix';\r\n/** @internal */ export type { CurvesChannel, CurvesFilter } from './implementations/curves';\r\n/** @internal */ export type { ColorAdjustmentFilter } from './implementations/color-adjustment';\r\n/** @internal */ export type { PosterizeTimeFilter } from './implementations/posterize-time';\r\n/** @internal */ export type { VideoEchoFilter } from './implementations/echo';\r\n\r\n/** @internal Chainable filter builder API, chain classes, and the loose author-facing unions. */\r\n/** @internal */ export { Adjustments, VideoAdjustments, AdjustmentChain, VideoAdjustmentChain, resolveChainAdjustments } from './chain';\r\n/** @internal @deprecated Renamed to `Adjustments`/`VideoAdjustments`. */\r\n/** @internal */ export { ImageFilters, VideoFilters } from './chain';\r\n/** @internal */ export type { ImageAdjustment, VideoAdjustment } from './chain';\r\n\r\n/** @internal Per-builder options. Each builder takes one of these, or its dominant scalar. */\r\n/** @internal */ export type {\r\n BlurFilterOptions,\r\n GrayscaleFilterOptions,\r\n AlphaFilterOptions,\r\n ExposureFilterOptions,\r\n ColorMatrixFilterOptions,\r\n CurvesFilterOptions,\r\n ColorAdjustmentFilterOptions,\r\n PosterizeTimeFilterOptions,\r\n EchoFilterOptions as VideoEchoFilterOptions,\r\n} from './chain';\r\n\r\n/**\r\n * @internal Unions of concrete filter types: pixel (`MediaAdjustment`), video-only,\r\n * and the node effects that double as filters.\r\n */\r\n/** @internal */ export type { MediaAdjustment, VideoOnlyAdjustment, EffectAdjustment } from './union';\r\n\r\n/** @internal Interpolation/equality registry: constants map plus the lerp helpers. */\r\n/** @internal */ export { lerpFilter, lerpFilterArray, isPixelFilter, hasFilter, filterSurface } from './registry';\r\n/** @internal */ export type { FilterData, AnyFilter } from './registry';\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/index.ts"],"names":[],"mappings":"AAWA,iGAAiG;AACjG,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACzI,yEAAyE;AACzE,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAsBtE,sFAAsF;AACtF,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/** @internal Media-filter data types for each built-in filter. */\n/** @internal */ export type { ExposureFilter } from './implementations/exposure';\n/** @internal */ export type { BlurFilter } from './implementations/blur';\n/** @internal */ export type { GrayscaleFilter } from './implementations/grayscale';\n/** @internal */ export type { AlphaFilter } from './implementations/alpha';\n/** @internal */ export type { ColorMatrixFilter } from './implementations/color-matrix';\n/** @internal */ export type { CurvesChannel, CurvesFilter } from './implementations/curves';\n/** @internal */ export type { ColorAdjustmentFilter } from './implementations/color-adjustment';\n/** @internal */ export type { PosterizeTimeFilter } from './implementations/posterize-time';\n/** @internal */ export type { VideoEchoFilter } from './implementations/echo';\n\n/** @internal Chainable filter builder API, chain classes, and the loose author-facing unions. */\n/** @internal */ export { Adjustments, VideoAdjustments, AdjustmentChain, VideoAdjustmentChain, resolveChainAdjustments } from './chain';\n/** @internal @deprecated Renamed to `Adjustments`/`VideoAdjustments`. */\n/** @internal */ export { ImageFilters, VideoFilters } from './chain';\n/** @internal */ export type { ImageAdjustment, VideoAdjustment } from './chain';\n\n/** @internal Per-builder options. Each builder takes one of these, or its dominant scalar. */\n/** @internal */ export type {\n BlurFilterOptions,\n GrayscaleFilterOptions,\n AlphaFilterOptions,\n ExposureFilterOptions,\n ColorMatrixFilterOptions,\n CurvesFilterOptions,\n ColorAdjustmentFilterOptions,\n PosterizeTimeFilterOptions,\n EchoFilterOptions as VideoEchoFilterOptions,\n} from './chain';\n\n/**\n * @internal Unions of concrete filter types: pixel (`MediaAdjustment`), video-only,\n * and the node effects that double as filters.\n */\n/** @internal */ export type { MediaAdjustment, VideoOnlyAdjustment, EffectAdjustment } from './union';\n\n/** @internal Interpolation/equality registry: constants map plus the lerp helpers. */\n/** @internal */ export { lerpFilter, lerpFilterArray, isPixelFilter, hasFilter, filterSurface } from './registry';\n/** @internal */ export type { FilterData, AnyFilter } from './registry';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAI1F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAapD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAgC;IACnD,CAAC,UAAU,EAAE,cAAuC,CAAC;I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CAAC;aAAM,IAAI,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;aAAM,IAAI,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { MediaAdjustment, VideoOnlyAdjustment } from \"./union\";\r\nimport { declareEffect, effectSurface, hasEffect, lerpEffect } from \"../effects/registry\";\r\nimport type { NodeEffect } from \"../effects/union\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\n\r\nimport { exposureFilter } from \"./implementations/exposure\";\r\nimport { blurFilter } from \"./implementations/blur\";\r\nimport { grayscaleFilter } from \"./implementations/grayscale\";\r\nimport { alphaFilter } from \"./implementations/alpha\";\r\nimport { colorMatrixFilter } from \"./implementations/color-matrix\";\r\nimport { curvesFilter } from \"./implementations/curves\";\r\nimport { colorAdjustmentFilter } from \"./implementations/color-adjustment\";\r\nimport { posterizeTimeFilter } from \"./implementations/posterize-time\";\r\nimport { echoFilter } from \"./implementations/echo\";\r\n\r\n/** Any concrete filter object accepted on a media fill — pixel or video-only. */\r\nexport type AnyFilter = MediaAdjustment | VideoOnlyAdjustment;\r\n\r\n/** Interpolation and equality contract every filter implementation must implement. */\r\nexport interface FilterData<T extends AnyFilter> {\r\n /** Return a new filter linearly interpolated between `from` and `to` at progress `t` (0–1). */\r\n lerp(from: T, to: T, t: number): T;\r\n /** Return true when both filters are visually identical (used to skip redundant redraws). */\r\n equals(a: T, b: T): boolean;\r\n}\r\n\r\n/**\r\n * Maps each filter `type` to its `FilterData` handler. Statically imported\r\n * constants (no runtime registration step), mirroring the `FILLS` map in the\r\n * fill registry — so the table is always populated and there is no side-effect\r\n * import to forget.\r\n *\r\n * It holds only the filters that exist *solely* as filters. Most of the roster\r\n * is {@link EffectAdjustment} — a node effect applied to a fill's own pixels — and\r\n * those are looked up in the effects registry rather than duplicated here, so\r\n * `dither` interpolates the same way whether it is on a node or on an image.\r\n */\r\nconst FILTERS = new Map<string, FilterData<AnyFilter>>([\r\n [\"exposure\", exposureFilter as FilterData<AnyFilter>],\r\n [\"blur\", blurFilter as FilterData<AnyFilter>],\r\n [\"grayscale\", grayscaleFilter as FilterData<AnyFilter>],\r\n [\"alpha\", alphaFilter as FilterData<AnyFilter>],\r\n [\"colorMatrix\", colorMatrixFilter as FilterData<AnyFilter>],\r\n [\"curves\", curvesFilter as FilterData<AnyFilter>],\r\n [\"colorAdjustment\", colorAdjustmentFilter as FilterData<AnyFilter>],\r\n [\"posterizeTime\", posterizeTimeFilter as FilterData<AnyFilter>],\r\n [\"echo\", echoFilter as FilterData<AnyFilter>],\r\n]);\r\n\r\n/**\r\n * Video-only filter types. These are consumed by the video fill's per-frame\r\n * `update()` (`posterizeTime`) or a dedicated multi-pass renderer (`echo`),\r\n * not the pixel filter chain. `isPixelFilter` lets a renderer skip them when\r\n * composing that chain.\r\n */\r\nconst VIDEO_ONLY = new Set<string>([\"posterizeTime\", \"echo\"]);\r\n\r\n/** True when `type` is a pixel filter that composes into a media fill's filter chain. */\r\nexport function isPixelFilter(type: string): boolean {\r\n return !VIDEO_ONLY.has(type);\r\n}\r\n\r\n/** True when `type` has a registered `FilterData` handler, here or in the effects registry. */\r\nexport function hasFilter(type: string): boolean {\r\n return FILTERS.has(type) || hasEffect(type);\r\n}\r\n\r\n/**\r\n * Interpolate between two individual filters at progress `t`.\r\n * Falls back to a hard cut at t = 0.5 when the types differ or are unregistered.\r\n *\r\n * A type with no dedicated `FilterData` is an {@link EffectAdjustment}, so it is\r\n * handed to `lerpEffect` — one interpolation per effect, whether it is animated\r\n * on a node or inside a fill.\r\n */\r\nexport function lerpFilter(from: AnyFilter, to: AnyFilter, t: number): AnyFilter {\r\n if (from.type !== to.type) return t < 0.5 ? from : to;\r\n const data = FILTERS.get(from.type);\r\n if (data) return data.lerp(from, to, t);\r\n return lerpEffect(from as NodeEffect, to as NodeEffect, t) as AnyFilter;\r\n}\r\n\r\n/**\r\n * The filters defined here reference nothing, but an {@link EffectAdjustment} can —\r\n * `lut` samples an image — and an undeclared one is a lookup the effect can only\r\n * read as \"no lookup table\".\r\n */\r\nexport function declareFilter(filter: AnyFilter, assets: AssetScope): void {\r\n if (FILTERS.has(filter.type)) return;\r\n declareEffect(filter as NodeEffect, assets);\r\n}\r\n\r\n/**\r\n * How a backend must realise `filter` — `\"shader\"` when it resamples pixel\r\n * positions and therefore has to wrap the fill's shader rather than compose\r\n * into its `ImageFilter` chain. The filters defined here are all `\"filter\"`;\r\n * an {@link EffectAdjustment} answers with its effect's own declaration.\r\n */\r\nexport function filterSurface(filter: AnyFilter): \"filter\" | \"shader\" {\r\n if (FILTERS.has(filter.type)) return \"filter\";\r\n // A filter is applied to the fill's own pixels, so it is never a backdrop\r\n // effect however the underlying effect's `mode` predicate reads.\r\n return effectSurface({ ...filter, mode: \"foreground\" } as NodeEffect);\r\n}\r\n\r\n/**\r\n * {@link lerpFilterArray} over two *optional* arrays, answering `undefined`\r\n * when neither side has a filter.\r\n *\r\n * A media fill's `lerp` is spread over the whole fill (`{...a, ...lerp(a,b,t)}`),\r\n * so returning `[]` for the overwhelmingly common no-filter case would allocate\r\n * a fresh array per fill per frame and turn an absent field into a present one.\r\n */\r\nexport function lerpOptionalFilters<T extends AnyFilter>(\r\n from: T[] | undefined,\r\n to: T[] | undefined,\r\n t: number,\r\n): T[] | undefined {\r\n if (!from?.length && !to?.length) return undefined;\r\n return lerpFilterArray(from ?? [], to ?? [], t) as T[];\r\n}\r\n\r\n/**\r\n * Interpolate between two filter arrays of potentially different lengths.\r\n * Indices present in only one array are kept as-is; matched indices are lerped pairwise.\r\n */\r\nexport function lerpFilterArray(from: AnyFilter[], to: AnyFilter[], t: number): AnyFilter[] {\r\n const maxLen = Math.max(from.length, to.length);\r\n const result: AnyFilter[] = [];\r\n for (let i = 0; i < maxLen; i++) {\r\n const a = from[i];\r\n const b = to[i];\r\n if (a && b) {\r\n result.push(lerpFilter(a, b, t));\r\n } else if (a) {\r\n result.push(a);\r\n } else if (b) {\r\n result.push(b);\r\n }\r\n }\r\n return result;\r\n}\r\n"]}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAI1F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAapD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAgC;IACnD,CAAC,UAAU,EAAE,cAAuC,CAAC;IACrD,CAAC,MAAM,EAAE,UAAmC,CAAC;IAC7C,CAAC,WAAW,EAAE,eAAwC,CAAC;IACvD,CAAC,OAAO,EAAE,WAAoC,CAAC;IAC/C,CAAC,aAAa,EAAE,iBAA0C,CAAC;IAC3D,CAAC,QAAQ,EAAE,YAAqC,CAAC;IACjD,CAAC,iBAAiB,EAAE,qBAA8C,CAAC;IACnE,CAAC,eAAe,EAAE,mBAA4C,CAAC;IAC/D,CAAC,MAAM,EAAE,UAAmC,CAAC;CAChD,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,IAAI,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AAgB,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAC/B,IAAqB,EACrB,EAAmB,EACnB,CAAS;IAET,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,EAAE,EAAE,MAAM;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,eAAe,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAQ,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAiB,EAAE,EAAe,EAAE,CAAS;IACzE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACT,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC;aAAM,IAAI,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;aAAM,IAAI,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { MediaAdjustment, VideoOnlyAdjustment } from \"./union\";\nimport { declareEffect, effectSurface, hasEffect, lerpEffect } from \"../effects/registry\";\nimport type { NodeEffect } from \"../effects/union\";\nimport type { AssetScope } from \"@/assets/scope\";\n\nimport { exposureFilter } from \"./implementations/exposure\";\nimport { blurFilter } from \"./implementations/blur\";\nimport { grayscaleFilter } from \"./implementations/grayscale\";\nimport { alphaFilter } from \"./implementations/alpha\";\nimport { colorMatrixFilter } from \"./implementations/color-matrix\";\nimport { curvesFilter } from \"./implementations/curves\";\nimport { colorAdjustmentFilter } from \"./implementations/color-adjustment\";\nimport { posterizeTimeFilter } from \"./implementations/posterize-time\";\nimport { echoFilter } from \"./implementations/echo\";\n\n/** Any concrete filter object accepted on a media fill — pixel or video-only. */\nexport type AnyFilter = MediaAdjustment | VideoOnlyAdjustment;\n\n/** Interpolation and equality contract every filter implementation must implement. */\nexport interface FilterData<T extends AnyFilter> {\n /** Return a new filter linearly interpolated between `from` and `to` at progress `t` (0–1). */\n lerp(from: T, to: T, t: number): T;\n /** Return true when both filters are visually identical (used to skip redundant redraws). */\n equals(a: T, b: T): boolean;\n}\n\n/**\n * Maps each filter `type` to its `FilterData` handler. Statically imported\n * constants (no runtime registration step), mirroring the `FILLS` map in the\n * fill registry — so the table is always populated and there is no side-effect\n * import to forget.\n *\n * It holds only the filters that exist *solely* as filters. Most of the roster\n * is {@link EffectAdjustment} — a node effect applied to a fill's own pixels — and\n * those are looked up in the effects registry rather than duplicated here, so\n * `dither` interpolates the same way whether it is on a node or on an image.\n */\nconst FILTERS = new Map<string, FilterData<AnyFilter>>([\n [\"exposure\", exposureFilter as FilterData<AnyFilter>],\n [\"blur\", blurFilter as FilterData<AnyFilter>],\n [\"grayscale\", grayscaleFilter as FilterData<AnyFilter>],\n [\"alpha\", alphaFilter as FilterData<AnyFilter>],\n [\"colorMatrix\", colorMatrixFilter as FilterData<AnyFilter>],\n [\"curves\", curvesFilter as FilterData<AnyFilter>],\n [\"colorAdjustment\", colorAdjustmentFilter as FilterData<AnyFilter>],\n [\"posterizeTime\", posterizeTimeFilter as FilterData<AnyFilter>],\n [\"echo\", echoFilter as FilterData<AnyFilter>],\n]);\n\n/**\n * Video-only filter types. These are consumed by the video fill's per-frame\n * `update()` (`posterizeTime`) or a dedicated multi-pass renderer (`echo`),\n * not the pixel filter chain. `isPixelFilter` lets a renderer skip them when\n * composing that chain.\n */\nconst VIDEO_ONLY = new Set<string>([\"posterizeTime\", \"echo\"]);\n\n/** True when `type` is a pixel filter that composes into a media fill's filter chain. */\nexport function isPixelFilter(type: string): boolean {\n return !VIDEO_ONLY.has(type);\n}\n\n/** True when `type` has a registered `FilterData` handler, here or in the effects registry. */\nexport function hasFilter(type: string): boolean {\n return FILTERS.has(type) || hasEffect(type);\n}\n\n/**\n * Interpolate between two individual filters at progress `t`.\n * Falls back to a hard cut at t = 0.5 when the types differ or are unregistered.\n *\n * A type with no dedicated `FilterData` is an {@link EffectAdjustment}, so it is\n * handed to `lerpEffect` — one interpolation per effect, whether it is animated\n * on a node or inside a fill.\n */\nexport function lerpFilter(from: AnyFilter, to: AnyFilter, t: number): AnyFilter {\n if (from.type !== to.type) return t < 0.5 ? from : to;\n const data = FILTERS.get(from.type);\n if (data) return data.lerp(from, to, t);\n return lerpEffect(from as NodeEffect, to as NodeEffect, t) as AnyFilter;\n}\n\n/**\n * The filters defined here reference nothing, but an {@link EffectAdjustment} can —\n * `lut` samples an image — and an undeclared one is a lookup the effect can only\n * read as \"no lookup table\".\n */\nexport function declareFilter(filter: AnyFilter, assets: AssetScope): void {\n if (FILTERS.has(filter.type)) return;\n declareEffect(filter as NodeEffect, assets);\n}\n\n/**\n * How a backend must realise `filter` — `\"shader\"` when it resamples pixel\n * positions and therefore has to wrap the fill's shader rather than compose\n * into its `ImageFilter` chain. The filters defined here are all `\"filter\"`;\n * an {@link EffectAdjustment} answers with its effect's own declaration.\n */\nexport function filterSurface(filter: AnyFilter): \"filter\" | \"shader\" {\n if (FILTERS.has(filter.type)) return \"filter\";\n // A filter is applied to the fill's own pixels, so it is never a backdrop\n // effect however the underlying effect's `mode` predicate reads.\n return effectSurface({ ...filter, mode: \"foreground\" } as NodeEffect);\n}\n\n/**\n * {@link lerpFilterArray} over two *optional* arrays, answering `undefined`\n * when neither side has a filter.\n *\n * A media fill's `lerp` is spread over the whole fill (`{...a, ...lerp(a,b,t)}`),\n * so returning `[]` for the overwhelmingly common no-filter case would allocate\n * a fresh array per fill per frame and turn an absent field into a present one.\n */\nexport function lerpOptionalFilters<T extends AnyFilter>(\n from: T[] | undefined,\n to: T[] | undefined,\n t: number,\n): T[] | undefined {\n if (!from?.length && !to?.length) return undefined;\n return lerpFilterArray(from ?? [], to ?? [], t) as T[];\n}\n\n/**\n * Interpolate between two filter arrays of potentially different lengths.\n * Indices present in only one array are kept as-is; matched indices are lerped pairwise.\n */\nexport function lerpFilterArray(from: AnyFilter[], to: AnyFilter[], t: number): AnyFilter[] {\n const maxLen = Math.max(from.length, to.length);\n const result: AnyFilter[] = [];\n for (let i = 0; i < maxLen; i++) {\n const a = from[i];\n const b = to[i];\n if (a && b) {\n result.push(lerpFilter(a, b, t));\n } else if (a) {\n result.push(a);\n } else if (b) {\n result.push(b);\n }\n }\n return result;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/union.ts"],"names":[],"mappings":"","sourcesContent":["import type { AlphaFilter } from \"./implementations/alpha\";\r\nimport type { BlurFilter } from \"./implementations/blur\";\r\nimport type { ColorAdjustmentFilter } from \"./implementations/color-adjustment\";\r\nimport type { ColorMatrixFilter } from \"./implementations/color-matrix\";\r\nimport type { CurvesFilter } from \"./implementations/curves\";\r\nimport type { ExposureFilter } from \"./implementations/exposure\";\r\nimport type { GrayscaleFilter } from \"./implementations/grayscale\";\r\nimport type { PosterizeTimeFilter } from \"./implementations/posterize-time\";\r\nimport type { VideoEchoFilter } from \"./implementations/echo\";\r\n\r\nimport type { NodeEffect } from \"../effects/union\";\r\nimport type { BlurEffect } from \"../effects/implementations/blur\";\r\nimport type { GrayscaleEffect } from \"../effects/implementations/grayscale\";\r\nimport type { CurvesEffect } from \"../effects/implementations/curves\";\r\nimport type { ColorAdjustmentEffect } from \"../effects/implementations/color-adjustment\";\r\nimport type { MagnifyEffect } from \"../effects/implementations/magnify\";\r\nimport type { MotionBlurEffect } from \"../effects/implementations/motion-blur\";\r\nimport type { OutlineEffect } from \"../effects/implementations/outline\";\r\nimport type { DropShadowEffect } from \"@/attributes/shape/effects/implementations/drop-shadow\";\r\nimport type { GlowEffect } from \"../effects/implementations/glow\";\r\nimport type { GlassEffect } from \"../effects/implementations/glass\";\r\n\r\n/**\r\n * The node effects that are **not** media filters, and why.\r\n *\r\n * Everything else in {@link NodeEffect} is a function of the pixels it is\r\n * given, so it means exactly the same thing applied to a node's rendered\r\n * content or to one fill layer's own pixels — and the renderer already runs\r\n * both through a single handler registry. This is the exception list, so a new\r\n * effect becomes a filter by default rather than by remembering to add it.\r\n *\r\n * Two reasons land here:\r\n *\r\n * - **Needs something a fill layer doesn't have.** `magnify` and `glass` sample\r\n * the backdrop beneath the node — glass is a slab you see *through*, and a\r\n * node's own paint is not something there is anything behind; `motionBlur` and\r\n * `trails` are derived from the node's sampled velocity. A fill has no\r\n * backdrop and no motion of its own.\r\n * - **Draws outside the silhouette.** `outline` paints a ring around the\r\n * content, which the shape path a fill is clipped to would cut away, and\r\n * `glow` bleeds past it in every direction — a glow clipped to the thing that\r\n * cast it is not a dimmer glow, it is no glow at all. (`bloom` stays: it is\r\n * the contained version of the same idea, which is what makes it the right\r\n * one to reach for on a fill.)\r\n *\r\n * `blur`, `grayscale`, `curves` and `colorAdjustment` are excluded for a third,\r\n * bookkeeping reason: they already have a dedicated filter type below, sharing\r\n * the same fields and the same renderer handler.\r\n */\r\ntype NonFilterEffect =\r\n | MagnifyEffect\r\n | GlassEffect\r\n | MotionBlurEffect\r\n | OutlineEffect\r\n | DropShadowEffect\r\n | GlowEffect\r\n | BlurEffect\r\n | GrayscaleEffect\r\n | CurvesEffect\r\n | ColorAdjustmentEffect;\r\n\r\n/**\r\n * Node effects usable as a media filter — i.e. applied to one image/video\r\n * fill's own pixels rather than to a node and everything under it.\r\n *\r\n * This is what lets a background image be oil-painted, dithered or posterized\r\n * without wrapping it in a node whose effect would also hit its children:\r\n *\r\n * Rect({\r\n * fill: Fills.image('bg.jpg', { filters: Adjustments.oilPaint(4) }),\r\n * children: [Text({ text: \"still sharp\" })],\r\n * })\r\n *\r\n * The effects carry a `mode` field that means nothing here (a fill has no\r\n * backdrop); the {@link VideoAdjustmentChain} builders drop it, and the renderer ignores\r\n * it on this path.\r\n */\r\nexport type EffectAdjustment = Exclude<NodeEffect, NonFilterEffect>;\r\n\r\n/**\r\n * Discriminated union of pixel filters — the filters valid on both image and\r\n * video fills. Each is realised either as a per-pixel colour filter, or — for\r\n * the ones that resample pixel *positions* — as a lens pass over the fill.\r\n */\r\nexport type MediaAdjustment =\r\n | ExposureFilter\r\n | BlurFilter\r\n | GrayscaleFilter\r\n | AlphaFilter\r\n | ColorMatrixFilter\r\n | CurvesFilter\r\n | ColorAdjustmentFilter\r\n | EffectAdjustment;\r\n\r\n/**\r\n * Discriminated union of video-only filters — temporal/multi-frame effects that\r\n * are meaningless on a still image (a single frame has no time axis and no\r\n * previous frames). Consumed outside the pixel `setImageFilter` path.\r\n */\r\nexport type VideoOnlyAdjustment =\r\n | PosterizeTimeFilter\r\n | VideoEchoFilter;\r\n"]}
1
+ {"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/union.ts"],"names":[],"mappings":"","sourcesContent":["import type { AlphaFilter } from \"./implementations/alpha\";\nimport type { BlurFilter } from \"./implementations/blur\";\nimport type { ColorAdjustmentFilter } from \"./implementations/color-adjustment\";\nimport type { ColorMatrixFilter } from \"./implementations/color-matrix\";\nimport type { CurvesFilter } from \"./implementations/curves\";\nimport type { ExposureFilter } from \"./implementations/exposure\";\nimport type { GrayscaleFilter } from \"./implementations/grayscale\";\nimport type { PosterizeTimeFilter } from \"./implementations/posterize-time\";\nimport type { VideoEchoFilter } from \"./implementations/echo\";\n\nimport type { NodeEffect } from \"../effects/union\";\nimport type { BlurEffect } from \"../effects/implementations/blur\";\nimport type { GrayscaleEffect } from \"../effects/implementations/grayscale\";\nimport type { CurvesEffect } from \"../effects/implementations/curves\";\nimport type { ColorAdjustmentEffect } from \"../effects/implementations/color-adjustment\";\nimport type { MagnifyEffect } from \"../effects/implementations/magnify\";\nimport type { MotionBlurEffect } from \"../effects/implementations/motion-blur\";\nimport type { OutlineEffect } from \"../effects/implementations/outline\";\nimport type { DropShadowEffect } from \"@/attributes/shape/effects/implementations/drop-shadow\";\nimport type { GlowEffect } from \"../effects/implementations/glow\";\nimport type { GlassEffect } from \"../effects/implementations/glass\";\n\n/**\n * The node effects that are **not** media filters, and why.\n *\n * Everything else in {@link NodeEffect} is a function of the pixels it is\n * given, so it means exactly the same thing applied to a node's rendered\n * content or to one fill layer's own pixels — and the renderer already runs\n * both through a single handler registry. This is the exception list, so a new\n * effect becomes a filter by default rather than by remembering to add it.\n *\n * Two reasons land here:\n *\n * - **Needs something a fill layer doesn't have.** `magnify` and `glass` sample\n * the backdrop beneath the node — glass is a slab you see *through*, and a\n * node's own paint is not something there is anything behind; `motionBlur` and\n * `trails` are derived from the node's sampled velocity. A fill has no\n * backdrop and no motion of its own.\n * - **Draws outside the silhouette.** `outline` paints a ring around the\n * content, which the shape path a fill is clipped to would cut away, and\n * `glow` bleeds past it in every direction — a glow clipped to the thing that\n * cast it is not a dimmer glow, it is no glow at all. (`bloom` stays: it is\n * the contained version of the same idea, which is what makes it the right\n * one to reach for on a fill.)\n *\n * `blur`, `grayscale`, `curves` and `colorAdjustment` are excluded for a third,\n * bookkeeping reason: they already have a dedicated filter type below, sharing\n * the same fields and the same renderer handler.\n */\ntype NonFilterEffect =\n | MagnifyEffect\n | GlassEffect\n | MotionBlurEffect\n | OutlineEffect\n | DropShadowEffect\n | GlowEffect\n | BlurEffect\n | GrayscaleEffect\n | CurvesEffect\n | ColorAdjustmentEffect;\n\n/**\n * Node effects usable as a media filter — i.e. applied to one image/video\n * fill's own pixels rather than to a node and everything under it.\n *\n * This is what lets a background image be oil-painted, dithered or posterized\n * without wrapping it in a node whose effect would also hit its children:\n *\n * Rect({\n * fill: Fills.image('bg.jpg', { filters: Adjustments.oilPaint(4) }),\n * children: [Text({ text: \"still sharp\" })],\n * })\n *\n * The effects carry a `mode` field that means nothing here (a fill has no\n * backdrop); the {@link VideoAdjustmentChain} builders drop it, and the renderer ignores\n * it on this path.\n */\nexport type EffectAdjustment = Exclude<NodeEffect, NonFilterEffect>;\n\n/**\n * Discriminated union of pixel filters — the filters valid on both image and\n * video fills. Each is realised either as a per-pixel colour filter, or — for\n * the ones that resample pixel *positions* — as a lens pass over the fill.\n */\nexport type MediaAdjustment =\n | ExposureFilter\n | BlurFilter\n | GrayscaleFilter\n | AlphaFilter\n | ColorMatrixFilter\n | CurvesFilter\n | ColorAdjustmentFilter\n | EffectAdjustment;\n\n/**\n * Discriminated union of video-only filters — temporal/multi-frame effects that\n * are meaningless on a still image (a single frame has no time axis and no\n * previous frames). Consumed outside the pixel `setImageFilter` path.\n */\nexport type VideoOnlyAdjustment =\n | PosterizeTimeFilter\n | VideoEchoFilter;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"anchors.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/anchors.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAI9C,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,8EAA8E;AAE9E,qEAAqE;AACrE,SAAS,SAAS,CAAC,CAAU,EAAE,CAAU;IACrC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,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QACtC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,EAAE;QACpE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,EAAE;KACrC,CAAC;AACN,CAAC","sourcesContent":["/**\r\n * The editable vector model — subpaths of anchors, each carrying the two bezier\r\n * handles that govern the segments either side of it — and the unit box it is\r\n * quoted against. Figma's vector model, and what a person actually drags.\r\n *\r\n * The **second** of the two boundaries where geometry is deliberately flattened\r\n * to one curve type. An arc has no handles to drag, so it becomes cubics on the\r\n * way in — a conversion, where it used to be a truncation: `A` was missing from\r\n * the old parser's letter list, so it stopped dead at the first arc and\r\n * everything after it disappeared. Real-world icons draw their rounded joins\r\n * with arcs, so pasting one in lost most of the shape.\r\n *\r\n * **The coordinate space is the node's own box**: `x` and `y` run -0.5 to +0.5\r\n * across its width and height, y pointing *down* the way SVG's does. Resizing is\r\n * then an ordinary width/height drag, because the geometry is a fraction of the\r\n * box rather than a pixel count inside it — no gizmo code has to know a path\r\n * from a rect. Points *may* sit outside it: a point dragged past an edge is\r\n * honest about where it was dropped, and {@link normalize} pulls the\r\n * box back around the geometry once, on the way out of an edit.\r\n */\r\nimport { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\r\nimport { arcSweepToCubics, cubicAxis, cubicExtrema, quadToCubic, splitCubicAt } from \"./bezier\";\r\nimport { contours, segmentArc } from \"./walk\";\r\nimport type { Extents } from \"@/layout/bounds\";\r\nimport type { Cubic, PathAnchor, PathContour, PathNormalization, PathSubpath, VectorPath } from \"./types\";\r\n\r\n/** An empty path, as the value an unset `data` field resolves to. */\r\nexport const EMPTY_PATH_DATA = \"\";\r\n\r\n// ── Reading ────────────────────────────────────────────────────────────────\r\n\r\n/** Whether two points are the same to within serialization noise. */\r\nfunction samePoint(a: Vector2, b: Vector2): boolean {\r\n return Math.abs(a.x - b.x) < 1e-6 && Math.abs(a.y - b.y) < 1e-6;\r\n}\r\n\r\n/**\r\n * Marks a subpath closed, folding a duplicated last anchor into the first.\r\n *\r\n * A `d` string that ends `… L 0 0 Z` — which every serializer that closes\r\n * explicitly produces, ours included when a closing segment carries handles —\r\n * names the start point twice: once as the last `L`/`C` target and once\r\n * implicitly by `Z`. Left alone, the round trip would grow an anchor on every\r\n * load, which is the kind of drift that only shows up after a file has been\r\n * opened a hundred times.\r\n */\r\nfunction closeSubpath(subpath: PathSubpath): void {\r\n subpath.closed = true;\r\n const { anchors } = subpath;\r\n if (anchors.length < 2) return;\r\n const first = anchors[0];\r\n const last = anchors[anchors.length - 1];\r\n if (!samePoint(first.point, last.point)) return;\r\n // The closing segment's own curvature belongs to the join, so the duplicate's\r\n // in-handle becomes the first anchor's.\r\n first.inHandle = last.inHandle;\r\n anchors.pop();\r\n}\r\n\r\n/** A copy of a point of the memoized contour — the model is edited in place. */\r\nconst copy = (v: Vector2): Vector2 => ({ x: v.x, y: v.y });\r\n\r\nfunction contourToSubpath(contour: PathContour): PathSubpath {\r\n // Every point and handle is copied out of the memoized contour: `contours`\r\n // shares its result between callers, and an editor moves these in place.\r\n const anchors: PathAnchor[] = [\r\n { point: copy(contour.start), inHandle: null, outHandle: null },\r\n ];\r\n const curve = (cubic: Cubic) => {\r\n anchors[anchors.length - 1].outHandle = copy(cubic.c1);\r\n anchors.push({ point: copy(cubic.p1), inHandle: copy(cubic.c2), outHandle: null });\r\n };\r\n\r\n for (const segment of contour.segments) {\r\n switch (segment.kind) {\r\n case \"line\":\r\n // Both handles stay null, which is what draws a straight segment.\r\n anchors.push({ point: copy(segment.to), inHandle: null, outHandle: null });\r\n break;\r\n case \"cubic\":\r\n curve({ p0: segment.from, c1: segment.c1, c2: segment.c2, p1: segment.to });\r\n break;\r\n case \"quad\":\r\n curve(quadToCubic(segment.from, segment.c, segment.to));\r\n break;\r\n case \"arc\": {\r\n const arc = segmentArc(segment);\r\n for (const cubic of arcSweepToCubics(arc, arc.theta1, arc.theta1 + arc.dtheta)) {\r\n curve(cubic);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const subpath: PathSubpath = { anchors, closed: false };\r\n if (contour.closed) closeSubpath(subpath);\r\n return subpath;\r\n}\r\n\r\n/**\r\n * Any {@link PathData} as the editable model.\r\n *\r\n * Takes `PathData`, not a string. The old entry point took only a string and\r\n * every caller had to guard — `typeof data === \"string\" ? data : \"\"` — which\r\n * meant a node animating its `data` drew *nothing* for the whole tween, because\r\n * a morph hands over a `PathCommand[]` at every `t` strictly between 0 and 1.\r\n */\r\nexport function anchors(d: PathData | null | undefined): VectorPath {\r\n return contours(d)\r\n .map(contourToSubpath)\r\n .filter((subpath) => subpath.anchors.length > 0);\r\n}\r\n\r\n// ── Writing ────────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * How many decimals a stored coordinate keeps.\r\n *\r\n * The space is the unit box, so a coordinate is a fraction of the node's size:\r\n * five decimals is sub-pixel on a 10,000px node and keeps the string short\r\n * enough that a path is a sane thing to hold in a JSON column. It also makes the\r\n * round trip *stable* — a drag that lands where it started re-serializes to the\r\n * identical string, which is what lets an editor tell \"nothing changed\" from\r\n * \"changed by a rounding error\".\r\n */\r\nconst COORD_PRECISION = 5;\r\n\r\nfunction fmt(value: number): string {\r\n if (!Number.isFinite(value)) return \"0\";\r\n const rounded = Number(value.toFixed(COORD_PRECISION));\r\n // `-0` serializes as \"0\": the two are the same point, and a sign that flips\r\n // with the wind would make the \"did anything change\" comparison lie.\r\n return String(rounded === 0 ? 0 : rounded);\r\n}\r\n\r\n/**\r\n * What one segment between two anchors *is* — a line, or a cubic and its\r\n * controls.\r\n *\r\n * The decision lived twice, once per output format: `segmentData` wrote it as a\r\n * `d` string and `pushSegment` as a `PathCommand`, with the same rule about a\r\n * missing handle standing in as its own anchor written out both times.\r\n */\r\nfunction segmentBetween(from: PathAnchor, to: PathAnchor):\r\n | { line: true; to: Vector2 }\r\n | { line: false; c1: Vector2; c2: Vector2; to: Vector2 } {\r\n if (from.outHandle === null && to.inHandle === null) {\r\n return { line: true, to: to.point };\r\n }\r\n // A missing handle stands in as its own anchor, which is the degenerate cubic\r\n // that draws as a straight pull towards the other end — the same thing every\r\n // vector editor means by \"one side of this segment is a curve\".\r\n return {\r\n line: false,\r\n c1: from.outHandle ?? from.point,\r\n c2: to.inHandle ?? to.point,\r\n to: to.point,\r\n };\r\n}\r\n\r\n/**\r\n * Serializes the model back to a `d` string.\r\n *\r\n * Only `M`, `L`, `C` and `Z` are emitted — the four commands the editor can\r\n * round-trip — so what is stored is always what can be edited.\r\n */\r\nexport function fromAnchors(path: VectorPath): string {\r\n const parts: string[] = [];\r\n for (const { anchors, closed } of path) {\r\n if (anchors.length === 0) continue;\r\n parts.push(`M ${fmt(anchors[0].point.x)} ${fmt(anchors[0].point.y)}`);\r\n for (let i = 1; i < anchors.length; i++) {\r\n const segment = segmentBetween(anchors[i - 1], anchors[i]);\r\n parts.push(segment.line\r\n ? `L ${fmt(segment.to.x)} ${fmt(segment.to.y)}`\r\n : `C ${fmt(segment.c1.x)} ${fmt(segment.c1.y)} ${fmt(segment.c2.x)} ${fmt(segment.c2.y)} ${fmt(segment.to.x)} ${fmt(segment.to.y)}`);\r\n }\r\n if (closed) {\r\n if (anchors.length > 1) {\r\n const join = segmentBetween(anchors[anchors.length - 1], anchors[0]);\r\n // A straight closing segment is what `Z` already draws, so emitting\r\n // it as well would add the duplicate anchor `closeSubpath` undoes.\r\n if (!join.line) {\r\n parts.push(`C ${fmt(join.c1.x)} ${fmt(join.c1.y)} ${fmt(join.c2.x)} ${fmt(join.c2.y)} ${fmt(join.to.x)} ${fmt(join.to.y)}`);\r\n }\r\n }\r\n parts.push(\"Z\");\r\n }\r\n }\r\n return parts.join(\" \");\r\n}\r\n\r\nconst identity = (point: Vector2): Vector2 => point;\r\n\r\n/**\r\n * The model as drawable commands, with a transform folded into the same pass.\r\n *\r\n * Every caller needs one — unit box → the node's laid-out pixels, and y-down →\r\n * the renderer's y-up — and doing it here means one allocation per frame instead\r\n * of two, on a list rebuilt every time the node repaints.\r\n */\r\nexport function anchorCommands(\r\n path: VectorPath,\r\n transform: (point: Vector2) => Vector2 = identity,\r\n): PathCommand[] {\r\n const out: PathCommand[] = [];\r\n const emit = (from: PathAnchor, to: PathAnchor) => {\r\n const segment = segmentBetween(from, to);\r\n const end = transform(segment.to);\r\n if (segment.line) {\r\n out.push({ type: \"L\", x: end.x, y: end.y });\r\n return;\r\n }\r\n const c1 = transform(segment.c1);\r\n const c2 = transform(segment.c2);\r\n out.push({ type: \"C\", x1: c1.x, y1: c1.y, x2: c2.x, y2: c2.y, x: end.x, y: end.y });\r\n };\r\n\r\n for (const { anchors, closed } of path) {\r\n if (anchors.length === 0) continue;\r\n const start = transform(anchors[0].point);\r\n out.push({ type: \"M\", x: start.x, y: start.y });\r\n for (let i = 1; i < anchors.length; i++) emit(anchors[i - 1], anchors[i]);\r\n if (closed) {\r\n if (anchors.length > 1) {\r\n const from = anchors[anchors.length - 1];\r\n const to = anchors[0];\r\n if (from.outHandle !== null || to.inHandle !== null) emit(from, to);\r\n }\r\n out.push({ type: \"Z\" });\r\n }\r\n }\r\n return out;\r\n}\r\n\r\n// ── Measuring ──────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The path's tight bounding box, or `null` when it has no points.\r\n *\r\n * Tight, not the handle polygon's hull: a cubic's own extrema are solved for,\r\n * because the handles can sit a long way outside the curve and a box derived\r\n * from them would leave a visible gap between a normalized shape and the edge of\r\n * its node.\r\n */\r\nexport function anchorBounds(path: VectorPath): Extents | null {\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n let seen = false;\r\n\r\n const includeX = (x: number) => { seen = true; if (x < minX) minX = x; if (x > maxX) maxX = x; };\r\n const includeY = (y: number) => { seen = true; if (y < minY) minY = y; if (y > maxY) maxY = y; };\r\n\r\n for (const { anchors, closed } of path) {\r\n for (const anchor of anchors) {\r\n includeX(anchor.point.x);\r\n includeY(anchor.point.y);\r\n }\r\n // The closing join exists only with a second anchor to join: the writers\r\n // emit none for a lone one (`M x y Z` draws nothing), so its self-loop\r\n // must not widen the box either.\r\n const last = closed && anchors.length > 1 ? anchors.length : anchors.length - 1;\r\n for (let i = 0; i < last; i++) {\r\n const from = anchors[i];\r\n const to = anchors[(i + 1) % anchors.length];\r\n if (from.outHandle === null && to.inHandle === null) continue;\r\n const c1 = from.outHandle ?? from.point;\r\n const c2 = to.inHandle ?? to.point;\r\n for (const t of cubicExtrema(from.point.x, c1.x, c2.x, to.point.x)) {\r\n includeX(cubicAxis(t, from.point.x, c1.x, c2.x, to.point.x));\r\n }\r\n for (const t of cubicExtrema(from.point.y, c1.y, c2.y, to.point.y)) {\r\n includeY(cubicAxis(t, from.point.y, c1.y, c2.y, to.point.y));\r\n }\r\n }\r\n }\r\n\r\n return seen ? { minX, minY, maxX, maxY } : null;\r\n}\r\n\r\n// ── Transforming ───────────────────────────────────────────────────────────\r\n\r\n/** Applies `fn` to every point and handle, returning a new path. */\r\nexport function map(path: VectorPath, fn: (point: Vector2) => Vector2): VectorPath {\r\n return path.map((subpath) => ({\r\n closed: subpath.closed,\r\n anchors: subpath.anchors.map((anchor) => ({\r\n point: fn(anchor.point),\r\n inHandle: anchor.inHandle ? fn(anchor.inHandle) : null,\r\n outHandle: anchor.outHandle ? fn(anchor.outHandle) : null,\r\n })),\r\n }));\r\n}\r\n\r\n/**\r\n * The turn-and-scale about `start` that carries `end` onto `to` — how `moveTo`\r\n * fits a path aimed at another node. Where `start` and `end` coincide there is\r\n * no chord to turn, so it translates instead.\r\n */\r\nexport function endFit(start: Vector2, end: Vector2, to: Vector2): (point: Vector2) => Vector2 {\r\n const cx = end.x - start.x;\r\n const cy = end.y - start.y;\r\n const chord = cx * cx + cy * cy;\r\n if (chord < 1e-12) {\r\n const dx = to.x - end.x;\r\n const dy = to.y - end.y;\r\n return (p) => ({ x: p.x + dx, y: p.y + dy });\r\n }\r\n // (to - start) / (end - start) as complex numbers: a rotation and a uniform scale.\r\n const tx = to.x - start.x;\r\n const ty = to.y - start.y;\r\n const re = (tx * cx + ty * cy) / chord;\r\n const im = (ty * cx - tx * cy) / chord;\r\n return (p) => {\r\n const ux = p.x - start.x;\r\n const uy = p.y - start.y;\r\n return { x: start.x + re * ux - im * uy, y: start.y + im * ux + re * uy };\r\n };\r\n}\r\n\r\n/** Whether a path would draw anything at all. */\r\nexport function isEmpty(path: VectorPath): boolean {\r\n return path.every((subpath) => subpath.anchors.length < 2);\r\n}\r\n\r\n/**\r\n * The unit box's extent — the node's own layout rect, as a fraction of itself.\r\n *\r\n * Exported because two very different callers need the same half: a renderer\r\n * scales by the extent (1 unit = the node's full width), and an editor projects\r\n * a screen point into it.\r\n */\r\nexport const PATH_UNIT_EXTENT = 1;\r\n\r\n/** Half of {@link PATH_UNIT_EXTENT} — the distance from the centre to an edge. */\r\nexport const PATH_UNIT_HALF = PATH_UNIT_EXTENT / 2;\r\n\r\n/**\r\n * The box a path's coordinates are already quoted against — the node's own\r\n * frame, as {@link PATH_UNIT_HALF} either side of centre.\r\n */\r\nexport const UNIT_PATH_BOX: Extents = {\r\n minX: -PATH_UNIT_HALF,\r\n minY: -PATH_UNIT_HALF,\r\n maxX: PATH_UNIT_HALF,\r\n maxY: PATH_UNIT_HALF,\r\n};\r\n\r\n/**\r\n * Pulls the unit box back around the geometry.\r\n *\r\n * What an editor runs on the way *out* of a path edit, and the reason a node\r\n * whose points were dragged all over the canvas still ends up with a selection\r\n * box that hugs it. The caller pairs it with the node's own size and position:\r\n * the box grows by `scaleX`/`scaleY` and moves by `centerX`/`centerY` scaled\r\n * into the node's parent, so the drawing doesn't shift on screen while its frame\r\n * changes underneath it.\r\n */\r\nexport function normalize(path: VectorPath): PathNormalization {\r\n const bounds = anchorBounds(path);\r\n if (!bounds) return { path, scaleX: 1, scaleY: 1, centerX: 0, centerY: 0 };\r\n return fitToBox(path, bounds);\r\n}\r\n\r\n/**\r\n * Re-quotes a path against `box` — the general form of\r\n * {@link normalize}, which is this with the geometry's own bounds.\r\n *\r\n * The two callers want the same arithmetic for opposite reasons. A canvas editor\r\n * fits the box to the drawing on the way out, so a node drawn in a corner of its\r\n * frame ends up with a frame that hugs it. An appearance dialog lets the frame\r\n * be **stated** instead — dragged wider than the drawing to leave a margin, or\r\n * slid so the drawing sits off-centre — and then fits to that.\r\n *\r\n * A degenerate axis — every point on one line, which is a perfectly reasonable\r\n * thing to draw — keeps its scale at 1 rather than dividing by zero, so a flat\r\n * path stays where it is instead of becoming NaN.\r\n */\r\nexport function fitToBox(path: VectorPath, box: Extents): PathNormalization {\r\n const width = box.maxX - box.minX;\r\n const height = box.maxY - box.minY;\r\n const centerX = (box.minX + box.maxX) / 2;\r\n const centerY = (box.minY + box.maxY) / 2;\r\n const scaleX = width > 1e-9 ? width / PATH_UNIT_EXTENT : 1;\r\n const scaleY = height > 1e-9 ? height / PATH_UNIT_EXTENT : 1;\r\n\r\n return {\r\n path: map(path, (p) => ({\r\n x: (p.x - centerX) / scaleX,\r\n y: (p.y - centerY) / scaleY,\r\n })),\r\n scaleX,\r\n scaleY,\r\n centerX,\r\n centerY,\r\n };\r\n}\r\n\r\n/** Moves every point and handle by the same delta. */\r\nexport function translate(path: VectorPath, delta: Vector2): VectorPath {\r\n return map(path, (p) => ({ x: p.x + delta.x, y: p.y + delta.y }));\r\n}\r\n\r\n/**\r\n * A point on the segment between two anchors, at parameter `t`.\r\n *\r\n * An editor needs it twice over: to find where on a segment a click landed (so a\r\n * double-click can insert an anchor there), and to draw the preview of the\r\n * anchor that insertion would create.\r\n */\r\nexport function pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2 {\r\n if (from.outHandle === null && to.inHandle === null) {\r\n return {\r\n x: from.point.x + (to.point.x - from.point.x) * t,\r\n y: from.point.y + (to.point.y - from.point.y) * t,\r\n };\r\n }\r\n const c1 = from.outHandle ?? from.point;\r\n const c2 = to.inHandle ?? to.point;\r\n return {\r\n x: cubicAxis(t, from.point.x, c1.x, c2.x, to.point.x),\r\n y: cubicAxis(t, from.point.y, c1.y, c2.y, to.point.y),\r\n };\r\n}\r\n\r\n/**\r\n * Splits the segment between two anchors at `t`, returning the three anchors\r\n * that replace them — the two ends with their outer handles shortened, and the\r\n * new anchor in the middle carrying both halves of the split tangent.\r\n *\r\n * De Casteljau, which is what makes the insertion *invisible*: the curve through\r\n * the new point is the same curve, so double-clicking a segment adds somewhere\r\n * to grab rather than changing the shape under the pointer.\r\n */\r\nexport function split(\r\n from: PathAnchor, to: PathAnchor, t: number,\r\n): { from: PathAnchor; middle: PathAnchor; to: PathAnchor } {\r\n if (from.outHandle === null && to.inHandle === null) {\r\n return {\r\n from,\r\n middle: { point: pointOn(from, to, t), inHandle: null, outHandle: null },\r\n to,\r\n };\r\n }\r\n\r\n const { left, right } = splitCubicAt(\r\n from.point,\r\n from.outHandle ?? from.point,\r\n to.inHandle ?? to.point,\r\n to.point,\r\n t,\r\n );\r\n return {\r\n from: { ...from, outHandle: left.cp1 },\r\n middle: { point: left.to, inHandle: left.cp2, outHandle: right.cp1 },\r\n to: { ...to, inHandle: right.cp2 },\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"anchors.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/anchors.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAI9C,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,8EAA8E;AAE9E,qEAAqE;AACrE,SAAS,SAAS,CAAC,CAAU,EAAE,CAAU;IACrC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IA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AG,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACtC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,EAAE;QACpE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,EAAE;KACrC,CAAC;AACN,CAAC","sourcesContent":["/**\n * The editable vector model — subpaths of anchors, each carrying the two bezier\n * handles that govern the segments either side of it — and the unit box it is\n * quoted against. Figma's vector model, and what a person actually drags.\n *\n * The **second** of the two boundaries where geometry is deliberately flattened\n * to one curve type. An arc has no handles to drag, so it becomes cubics on the\n * way in — a conversion, where it used to be a truncation: `A` was missing from\n * the old parser's letter list, so it stopped dead at the first arc and\n * everything after it disappeared. Real-world icons draw their rounded joins\n * with arcs, so pasting one in lost most of the shape.\n *\n * **The coordinate space is the node's own box**: `x` and `y` run -0.5 to +0.5\n * across its width and height, y pointing *down* the way SVG's does. Resizing is\n * then an ordinary width/height drag, because the geometry is a fraction of the\n * box rather than a pixel count inside it — no gizmo code has to know a path\n * from a rect. Points *may* sit outside it: a point dragged past an edge is\n * honest about where it was dropped, and {@link normalize} pulls the\n * box back around the geometry once, on the way out of an edit.\n */\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport { arcSweepToCubics, cubicAxis, cubicExtrema, quadToCubic, splitCubicAt } from \"./bezier\";\nimport { contours, segmentArc } from \"./walk\";\nimport type { Extents } from \"@/layout/bounds\";\nimport type { Cubic, PathAnchor, PathContour, PathNormalization, PathSubpath, VectorPath } from \"./types\";\n\n/** An empty path, as the value an unset `data` field resolves to. */\nexport const EMPTY_PATH_DATA = \"\";\n\n// ── Reading ────────────────────────────────────────────────────────────────\n\n/** Whether two points are the same to within serialization noise. */\nfunction samePoint(a: Vector2, b: Vector2): boolean {\n return Math.abs(a.x - b.x) < 1e-6 && Math.abs(a.y - b.y) < 1e-6;\n}\n\n/**\n * Marks a subpath closed, folding a duplicated last anchor into the first.\n *\n * A `d` string that ends `… L 0 0 Z` — which every serializer that closes\n * explicitly produces, ours included when a closing segment carries handles —\n * names the start point twice: once as the last `L`/`C` target and once\n * implicitly by `Z`. Left alone, the round trip would grow an anchor on every\n * load, which is the kind of drift that only shows up after a file has been\n * opened a hundred times.\n */\nfunction closeSubpath(subpath: PathSubpath): void {\n subpath.closed = true;\n const { anchors } = subpath;\n if (anchors.length < 2) return;\n const first = anchors[0];\n const last = anchors[anchors.length - 1];\n if (!samePoint(first.point, last.point)) return;\n // The closing segment's own curvature belongs to the join, so the duplicate's\n // in-handle becomes the first anchor's.\n first.inHandle = last.inHandle;\n anchors.pop();\n}\n\n/** A copy of a point of the memoized contour — the model is edited in place. */\nconst copy = (v: Vector2): Vector2 => ({ x: v.x, y: v.y });\n\nfunction contourToSubpath(contour: PathContour): PathSubpath {\n // Every point and handle is copied out of the memoized contour: `contours`\n // shares its result between callers, and an editor moves these in place.\n const anchors: PathAnchor[] = [\n { point: copy(contour.start), inHandle: null, outHandle: null },\n ];\n const curve = (cubic: Cubic) => {\n anchors[anchors.length - 1].outHandle = copy(cubic.c1);\n anchors.push({ point: copy(cubic.p1), inHandle: copy(cubic.c2), outHandle: null });\n };\n\n for (const segment of contour.segments) {\n switch (segment.kind) {\n case \"line\":\n // Both handles stay null, which is what draws a straight segment.\n anchors.push({ point: copy(segment.to), inHandle: null, outHandle: null });\n break;\n case \"cubic\":\n curve({ p0: segment.from, c1: segment.c1, c2: segment.c2, p1: segment.to });\n break;\n case \"quad\":\n curve(quadToCubic(segment.from, segment.c, segment.to));\n break;\n case \"arc\": {\n const arc = segmentArc(segment);\n for (const cubic of arcSweepToCubics(arc, arc.theta1, arc.theta1 + arc.dtheta)) {\n curve(cubic);\n }\n break;\n }\n }\n }\n\n const subpath: PathSubpath = { anchors, closed: false };\n if (contour.closed) closeSubpath(subpath);\n return subpath;\n}\n\n/**\n * Any {@link PathData} as the editable model.\n *\n * Takes `PathData`, not a string. The old entry point took only a string and\n * every caller had to guard — `typeof data === \"string\" ? data : \"\"` — which\n * meant a node animating its `data` drew *nothing* for the whole tween, because\n * a morph hands over a `PathCommand[]` at every `t` strictly between 0 and 1.\n */\nexport function anchors(d: PathData | null | undefined): VectorPath {\n return contours(d)\n .map(contourToSubpath)\n .filter((subpath) => subpath.anchors.length > 0);\n}\n\n// ── Writing ────────────────────────────────────────────────────────────────\n\n/**\n * How many decimals a stored coordinate keeps.\n *\n * The space is the unit box, so a coordinate is a fraction of the node's size:\n * five decimals is sub-pixel on a 10,000px node and keeps the string short\n * enough that a path is a sane thing to hold in a JSON column. It also makes the\n * round trip *stable* — a drag that lands where it started re-serializes to the\n * identical string, which is what lets an editor tell \"nothing changed\" from\n * \"changed by a rounding error\".\n */\nconst COORD_PRECISION = 5;\n\nfunction fmt(value: number): string {\n if (!Number.isFinite(value)) return \"0\";\n const rounded = Number(value.toFixed(COORD_PRECISION));\n // `-0` serializes as \"0\": the two are the same point, and a sign that flips\n // with the wind would make the \"did anything change\" comparison lie.\n return String(rounded === 0 ? 0 : rounded);\n}\n\n/**\n * What one segment between two anchors *is* — a line, or a cubic and its\n * controls.\n *\n * The decision lived twice, once per output format: `segmentData` wrote it as a\n * `d` string and `pushSegment` as a `PathCommand`, with the same rule about a\n * missing handle standing in as its own anchor written out both times.\n */\nfunction segmentBetween(from: PathAnchor, to: PathAnchor):\n | { line: true; to: Vector2 }\n | { line: false; c1: Vector2; c2: Vector2; to: Vector2 } {\n if (from.outHandle === null && to.inHandle === null) {\n return { line: true, to: to.point };\n }\n // A missing handle stands in as its own anchor, which is the degenerate cubic\n // that draws as a straight pull towards the other end — the same thing every\n // vector editor means by \"one side of this segment is a curve\".\n return {\n line: false,\n c1: from.outHandle ?? from.point,\n c2: to.inHandle ?? to.point,\n to: to.point,\n };\n}\n\n/**\n * Serializes the model back to a `d` string.\n *\n * Only `M`, `L`, `C` and `Z` are emitted — the four commands the editor can\n * round-trip — so what is stored is always what can be edited.\n */\nexport function fromAnchors(path: VectorPath): string {\n const parts: string[] = [];\n for (const { anchors, closed } of path) {\n if (anchors.length === 0) continue;\n parts.push(`M ${fmt(anchors[0].point.x)} ${fmt(anchors[0].point.y)}`);\n for (let i = 1; i < anchors.length; i++) {\n const segment = segmentBetween(anchors[i - 1], anchors[i]);\n parts.push(segment.line\n ? `L ${fmt(segment.to.x)} ${fmt(segment.to.y)}`\n : `C ${fmt(segment.c1.x)} ${fmt(segment.c1.y)} ${fmt(segment.c2.x)} ${fmt(segment.c2.y)} ${fmt(segment.to.x)} ${fmt(segment.to.y)}`);\n }\n if (closed) {\n if (anchors.length > 1) {\n const join = segmentBetween(anchors[anchors.length - 1], anchors[0]);\n // A straight closing segment is what `Z` already draws, so emitting\n // it as well would add the duplicate anchor `closeSubpath` undoes.\n if (!join.line) {\n parts.push(`C ${fmt(join.c1.x)} ${fmt(join.c1.y)} ${fmt(join.c2.x)} ${fmt(join.c2.y)} ${fmt(join.to.x)} ${fmt(join.to.y)}`);\n }\n }\n parts.push(\"Z\");\n }\n }\n return parts.join(\" \");\n}\n\nconst identity = (point: Vector2): Vector2 => point;\n\n/**\n * The model as drawable commands, with a transform folded into the same pass.\n *\n * Every caller needs one — unit box → the node's laid-out pixels, and y-down →\n * the renderer's y-up — and doing it here means one allocation per frame instead\n * of two, on a list rebuilt every time the node repaints.\n */\nexport function anchorCommands(\n path: VectorPath,\n transform: (point: Vector2) => Vector2 = identity,\n): PathCommand[] {\n const out: PathCommand[] = [];\n const emit = (from: PathAnchor, to: PathAnchor) => {\n const segment = segmentBetween(from, to);\n const end = transform(segment.to);\n if (segment.line) {\n out.push({ type: \"L\", x: end.x, y: end.y });\n return;\n }\n const c1 = transform(segment.c1);\n const c2 = transform(segment.c2);\n out.push({ type: \"C\", x1: c1.x, y1: c1.y, x2: c2.x, y2: c2.y, x: end.x, y: end.y });\n };\n\n for (const { anchors, closed } of path) {\n if (anchors.length === 0) continue;\n const start = transform(anchors[0].point);\n out.push({ type: \"M\", x: start.x, y: start.y });\n for (let i = 1; i < anchors.length; i++) emit(anchors[i - 1], anchors[i]);\n if (closed) {\n if (anchors.length > 1) {\n const from = anchors[anchors.length - 1];\n const to = anchors[0];\n if (from.outHandle !== null || to.inHandle !== null) emit(from, to);\n }\n out.push({ type: \"Z\" });\n }\n }\n return out;\n}\n\n// ── Measuring ──────────────────────────────────────────────────────────────\n\n/**\n * The path's tight bounding box, or `null` when it has no points.\n *\n * Tight, not the handle polygon's hull: a cubic's own extrema are solved for,\n * because the handles can sit a long way outside the curve and a box derived\n * from them would leave a visible gap between a normalized shape and the edge of\n * its node.\n */\nexport function anchorBounds(path: VectorPath): Extents | null {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n let seen = false;\n\n const includeX = (x: number) => { seen = true; if (x < minX) minX = x; if (x > maxX) maxX = x; };\n const includeY = (y: number) => { seen = true; if (y < minY) minY = y; if (y > maxY) maxY = y; };\n\n for (const { anchors, closed } of path) {\n for (const anchor of anchors) {\n includeX(anchor.point.x);\n includeY(anchor.point.y);\n }\n // The closing join exists only with a second anchor to join: the writers\n // emit none for a lone one (`M x y Z` draws nothing), so its self-loop\n // must not widen the box either.\n const last = closed && anchors.length > 1 ? anchors.length : anchors.length - 1;\n for (let i = 0; i < last; i++) {\n const from = anchors[i];\n const to = anchors[(i + 1) % anchors.length];\n if (from.outHandle === null && to.inHandle === null) continue;\n const c1 = from.outHandle ?? from.point;\n const c2 = to.inHandle ?? to.point;\n for (const t of cubicExtrema(from.point.x, c1.x, c2.x, to.point.x)) {\n includeX(cubicAxis(t, from.point.x, c1.x, c2.x, to.point.x));\n }\n for (const t of cubicExtrema(from.point.y, c1.y, c2.y, to.point.y)) {\n includeY(cubicAxis(t, from.point.y, c1.y, c2.y, to.point.y));\n }\n }\n }\n\n return seen ? { minX, minY, maxX, maxY } : null;\n}\n\n// ── Transforming ───────────────────────────────────────────────────────────\n\n/** Applies `fn` to every point and handle, returning a new path. */\nexport function map(path: VectorPath, fn: (point: Vector2) => Vector2): VectorPath {\n return path.map((subpath) => ({\n closed: subpath.closed,\n anchors: subpath.anchors.map((anchor) => ({\n point: fn(anchor.point),\n inHandle: anchor.inHandle ? fn(anchor.inHandle) : null,\n outHandle: anchor.outHandle ? fn(anchor.outHandle) : null,\n })),\n }));\n}\n\n/**\n * The turn-and-scale about `start` that carries `end` onto `to` — how `moveTo`\n * fits a path aimed at another node. Where `start` and `end` coincide there is\n * no chord to turn, so it translates instead.\n */\nexport function endFit(start: Vector2, end: Vector2, to: Vector2): (point: Vector2) => Vector2 {\n const cx = end.x - start.x;\n const cy = end.y - start.y;\n const chord = cx * cx + cy * cy;\n if (chord < 1e-12) {\n const dx = to.x - end.x;\n const dy = to.y - end.y;\n return (p) => ({ x: p.x + dx, y: p.y + dy });\n }\n // (to - start) / (end - start) as complex numbers: a rotation and a uniform scale.\n const tx = to.x - start.x;\n const ty = to.y - start.y;\n const re = (tx * cx + ty * cy) / chord;\n const im = (ty * cx - tx * cy) / chord;\n return (p) => {\n const ux = p.x - start.x;\n const uy = p.y - start.y;\n return { x: start.x + re * ux - im * uy, y: start.y + im * ux + re * uy };\n };\n}\n\n/** Whether a path would draw anything at all. */\nexport function isEmpty(path: VectorPath): boolean {\n return path.every((subpath) => subpath.anchors.length < 2);\n}\n\n/**\n * The unit box's extent — the node's own layout rect, as a fraction of itself.\n *\n * Exported because two very different callers need the same half: a renderer\n * scales by the extent (1 unit = the node's full width), and an editor projects\n * a screen point into it.\n */\nexport const PATH_UNIT_EXTENT = 1;\n\n/** Half of {@link PATH_UNIT_EXTENT} — the distance from the centre to an edge. */\nexport const PATH_UNIT_HALF = PATH_UNIT_EXTENT / 2;\n\n/**\n * The box a path's coordinates are already quoted against — the node's own\n * frame, as {@link PATH_UNIT_HALF} either side of centre.\n */\nexport const UNIT_PATH_BOX: Extents = {\n minX: -PATH_UNIT_HALF,\n minY: -PATH_UNIT_HALF,\n maxX: PATH_UNIT_HALF,\n maxY: PATH_UNIT_HALF,\n};\n\n/**\n * Pulls the unit box back around the geometry.\n *\n * What an editor runs on the way *out* of a path edit, and the reason a node\n * whose points were dragged all over the canvas still ends up with a selection\n * box that hugs it. The caller pairs it with the node's own size and position:\n * the box grows by `scaleX`/`scaleY` and moves by `centerX`/`centerY` scaled\n * into the node's parent, so the drawing doesn't shift on screen while its frame\n * changes underneath it.\n */\nexport function normalize(path: VectorPath): PathNormalization {\n const bounds = anchorBounds(path);\n if (!bounds) return { path, scaleX: 1, scaleY: 1, centerX: 0, centerY: 0 };\n return fitToBox(path, bounds);\n}\n\n/**\n * Re-quotes a path against `box` — the general form of\n * {@link normalize}, which is this with the geometry's own bounds.\n *\n * The two callers want the same arithmetic for opposite reasons. A canvas editor\n * fits the box to the drawing on the way out, so a node drawn in a corner of its\n * frame ends up with a frame that hugs it. An appearance dialog lets the frame\n * be **stated** instead — dragged wider than the drawing to leave a margin, or\n * slid so the drawing sits off-centre — and then fits to that.\n *\n * A degenerate axis — every point on one line, which is a perfectly reasonable\n * thing to draw — keeps its scale at 1 rather than dividing by zero, so a flat\n * path stays where it is instead of becoming NaN.\n */\nexport function fitToBox(path: VectorPath, box: Extents): PathNormalization {\n const width = box.maxX - box.minX;\n const height = box.maxY - box.minY;\n const centerX = (box.minX + box.maxX) / 2;\n const centerY = (box.minY + box.maxY) / 2;\n const scaleX = width > 1e-9 ? width / PATH_UNIT_EXTENT : 1;\n const scaleY = height > 1e-9 ? height / PATH_UNIT_EXTENT : 1;\n\n return {\n path: map(path, (p) => ({\n x: (p.x - centerX) / scaleX,\n y: (p.y - centerY) / scaleY,\n })),\n scaleX,\n scaleY,\n centerX,\n centerY,\n };\n}\n\n/** Moves every point and handle by the same delta. */\nexport function translate(path: VectorPath, delta: Vector2): VectorPath {\n return map(path, (p) => ({ x: p.x + delta.x, y: p.y + delta.y }));\n}\n\n/**\n * A point on the segment between two anchors, at parameter `t`.\n *\n * An editor needs it twice over: to find where on a segment a click landed (so a\n * double-click can insert an anchor there), and to draw the preview of the\n * anchor that insertion would create.\n */\nexport function pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2 {\n if (from.outHandle === null && to.inHandle === null) {\n return {\n x: from.point.x + (to.point.x - from.point.x) * t,\n y: from.point.y + (to.point.y - from.point.y) * t,\n };\n }\n const c1 = from.outHandle ?? from.point;\n const c2 = to.inHandle ?? to.point;\n return {\n x: cubicAxis(t, from.point.x, c1.x, c2.x, to.point.x),\n y: cubicAxis(t, from.point.y, c1.y, c2.y, to.point.y),\n };\n}\n\n/**\n * Splits the segment between two anchors at `t`, returning the three anchors\n * that replace them — the two ends with their outer handles shortened, and the\n * new anchor in the middle carrying both halves of the split tangent.\n *\n * De Casteljau, which is what makes the insertion *invisible*: the curve through\n * the new point is the same curve, so double-clicking a segment adds somewhere\n * to grab rather than changing the shape under the pointer.\n */\nexport function split(\n from: PathAnchor, to: PathAnchor, t: number,\n): { from: PathAnchor; middle: PathAnchor; to: PathAnchor } {\n if (from.outHandle === null && to.inHandle === null) {\n return {\n from,\n middle: { point: pointOn(from, to, t), inHandle: null, outHandle: null },\n to,\n };\n }\n\n const { left, right } = splitCubicAt(\n from.point,\n from.outHandle ?? from.point,\n to.inHandle ?? to.point,\n to.point,\n t,\n );\n return {\n from: { ...from, outHandle: left.cp1 },\n middle: { point: left.to, inHandle: left.cp2, outHandle: right.cp1 },\n to: { ...to, inHandle: right.cp2 },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bezier.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/bezier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAInE;;;;;;;;;;;;;;GAcG;AAEH,iGAAiG;AACjG,MAAM,kBAAkB,GAAqC,IAAI,GAAG,CAAC;IACjE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,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G;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAc,EAAE,KAAa;IAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACxB,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;IAChE,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IAC9C,OAAO,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AACpD,CAAC;AAED,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { Vector2, lerpVector2 } from \"@/attributes/layout/vector2\";\r\nimport { PathCommand } from \"@/render/descriptors/path\";\r\nimport type { ArcParams, Cubic } from \"./types\";\r\n\r\n/**\r\n * Shared Bézier, arc and path-geometry primitives.\r\n *\r\n * Everything under `shape/path/` that evaluates, splits, measures or bounds a\r\n * curve reaches for these rather than carrying its own copy. That used to be an\r\n * aspiration this file's header stated and only three of seven callers honoured:\r\n * De Casteljau existed three times, quad→cubic and cubic evaluation twice each,\r\n * and the arc's endpoint→center conversion twice — once returning a sampler and\r\n * once returning cubics, differing in nothing else.\r\n *\r\n * Two evaluation styles are provided:\r\n * - Scalar (`cubicAxis` / `quadAxis`) — evaluate a single axis. Cheaper when you\r\n * already have loose x/y numbers and want to avoid allocating a {@link Vector2}.\r\n * - Vector (`cubicPoint` / `quadPoint`) — evaluate both axes into a {@link Vector2}.\r\n */\r\n\r\n/** SVG curve commands whose tangent feeds the reflected control point of a following S/s/T/t. */\r\nconst SMOOTH_CURVE_TYPES: ReadonlySet<PathCommand[\"type\"]> = new Set([\r\n \"C\", \"c\", \"S\", \"s\", \"Q\", \"q\", \"T\", \"t\",\r\n]);\r\n\r\n\r\n\r\n/**\r\n * True when a command's trailing control point should be remembered so the next\r\n * smooth command (S/s/T/t) can reflect it. Per the SVG spec, if the previous\r\n * command was not one of these, the implied control point is the current point.\r\n */\r\nexport function isSmoothCurveType(type: PathCommand[\"type\"]): boolean {\r\n return SMOOTH_CURVE_TYPES.has(type);\r\n}\r\n\r\n/** Reflect a control point through the current point: `2 * current - control`. */\r\nexport function reflectControlPoint(current: number, control: number): number {\r\n return 2 * current - control;\r\n}\r\n\r\n/** Euclidean distance between two points. */\r\nexport function distance(a: Vector2, b: Vector2): number {\r\n const dx = b.x - a.x;\r\n const dy = b.y - a.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n}\r\n\r\n/** Evaluate one axis of a cubic Bézier at parameter `t` (0..1). */\r\nexport function cubicAxis(t: number, p0: number, p1: number, p2: number, p3: number): number {\r\n const u = 1 - t;\r\n return u * u * u * p0 + 3 * u * u * t * p1 + 3 * u * t * t * p2 + t * t * t * p3;\r\n}\r\n\r\n/** Evaluate one axis of a quadratic Bézier at parameter `t` (0..1). */\r\nexport function quadAxis(t: number, p0: number, p1: number, p2: number): number {\r\n const u = 1 - t;\r\n return u * u * p0 + 2 * u * t * p1 + t * t * p2;\r\n}\r\n\r\n/** Evaluate a cubic Bézier at parameter `t` (0..1) into a {@link Vector2}. */\r\nexport function cubicPoint(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: number): Vector2 {\r\n return {\r\n x: cubicAxis(t, p0.x, p1.x, p2.x, p3.x),\r\n y: cubicAxis(t, p0.y, p1.y, p2.y, p3.y),\r\n };\r\n}\r\n\r\n/** Evaluate a quadratic Bézier at parameter `t` (0..1) into a {@link Vector2}. */\r\nexport function quadPoint(p0: Vector2, p1: Vector2, p2: Vector2, t: number): Vector2 {\r\n return {\r\n x: quadAxis(t, p0.x, p1.x, p2.x),\r\n y: quadAxis(t, p0.y, p1.y, p2.y),\r\n };\r\n}\r\n\r\n/**\r\n * Approximate the arc length of a parametric curve by sampling it into a polyline\r\n * and summing the segment distances. More `steps` trade speed for accuracy.\r\n */\r\nexport function sampleCurveLength(pointAt: (t: number) => Vector2, steps = 32): number {\r\n let length = 0;\r\n let prev = pointAt(0);\r\n for (let i = 1; i <= steps; i++) {\r\n const next = pointAt(i / steps);\r\n length += distance(prev, next);\r\n prev = next;\r\n }\r\n return length;\r\n}\r\n\r\n/**\r\n * Binary-search the curve parameter `t` whose arc length from the start equals\r\n * `targetDist`. Used to find exactly where a curve should be cut. The curve is\r\n * re-sampled on each probe, so this is intentionally simple rather than fast;\r\n * 20 iterations give sub-pixel precision for typical path lengths.\r\n */\r\nexport function paramAtDistance(\r\n pointAt: (t: number) => Vector2,\r\n targetDist: number,\r\n totalLen: number,\r\n): number {\r\n if (totalLen === 0 || targetDist <= 0) return 0;\r\n if (targetDist >= totalLen) return 1;\r\n\r\n let lo = 0, hi = 1;\r\n for (let i = 0; i < 20; i++) {\r\n const mid = (lo + hi) / 2;\r\n let len = 0;\r\n let prev = pointAt(0);\r\n const steps = 16;\r\n for (let j = 1; j <= steps; j++) {\r\n const p = pointAt(mid * j / steps);\r\n len += distance(prev, p);\r\n prev = p;\r\n }\r\n if (len < targetDist) lo = mid;\r\n else hi = mid;\r\n }\r\n return (lo + hi) / 2;\r\n}\r\n\r\n// --- Degree conversion -----------------------------------------------------\r\n\r\n/** A straight line as a cubic: controls sit on the line at 1/3 and 2/3. */\r\nexport function lineToCubic(from: Vector2, to: Vector2): Cubic {\r\n return {\r\n p0: from,\r\n c1: lerpVector2(from, to, 1 / 3),\r\n c2: lerpVector2(from, to, 2 / 3),\r\n p1: to,\r\n };\r\n}\r\n\r\n/** Elevate a quadratic Bézier to the equivalent cubic (exact, not an approximation). */\r\nexport function quadToCubic(from: Vector2, cp: Vector2, to: Vector2): Cubic {\r\n return {\r\n p0: from,\r\n c1: { x: from.x + (2 / 3) * (cp.x - from.x), y: from.y + (2 / 3) * (cp.y - from.y) },\r\n c2: { x: to.x + (2 / 3) * (cp.x - to.x), y: to.y + (2 / 3) * (cp.y - to.y) },\r\n p1: to,\r\n };\r\n}\r\n\r\n// --- De Casteljau splitting ---\r\n// Splitting a Bézier at parameter `t` yields two sub-curves that together trace\r\n// the exact same shape, so trimming preserves curvature instead of polylining it.\r\n\r\nexport function splitCubicAt(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: number) {\r\n const a = lerpVector2(p0, p1, t);\r\n const b = lerpVector2(p1, p2, t);\r\n const c = lerpVector2(p2, p3, t);\r\n const d = lerpVector2(a, b, t);\r\n const e = lerpVector2(b, c, t);\r\n const f = lerpVector2(d, e, t);\r\n return {\r\n left: { from: p0, cp1: a, cp2: d, to: f },\r\n right: { from: f, cp1: e, cp2: c, to: p3 },\r\n };\r\n}\r\n\r\n/** The sub-cubic spanning parameters `t0..t1` of the original cubic. */\r\nexport function extractCubicRange(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t0: number, t1: number) {\r\n if (t0 === 0) return splitCubicAt(p0, p1, p2, p3, t1).left;\r\n const { right } = splitCubicAt(p0, p1, p2, p3, t0);\r\n const adj = (t1 - t0) / (1 - t0);\r\n return splitCubicAt(right.from, right.cp1, right.cp2, right.to, adj).left;\r\n}\r\n\r\nexport function splitQuadAt(p0: Vector2, p1: Vector2, p2: Vector2, t: number) {\r\n const a = lerpVector2(p0, p1, t);\r\n const b = lerpVector2(p1, p2, t);\r\n const c = lerpVector2(a, b, t);\r\n return {\r\n left: { from: p0, cp: a, to: c },\r\n right: { from: c, cp: b, to: p2 },\r\n };\r\n}\r\n\r\n/** The sub-quadratic spanning parameters `t0..t1` of the original quadratic. */\r\nexport function extractQuadRange(p0: Vector2, p1: Vector2, p2: Vector2, t0: number, t1: number) {\r\n if (t0 === 0) return splitQuadAt(p0, p1, p2, t1).left;\r\n const { right } = splitQuadAt(p0, p1, p2, t0);\r\n const adj = (t1 - t0) / (1 - t0);\r\n return splitQuadAt(right.from, right.cp, right.to, adj).left;\r\n}\r\n\r\n// --- Extrema ---------------------------------------------------------------\r\n\r\n/** The `t` values in (0, 1) where a cubic's one-dimensional derivative is zero. */\r\nexport function cubicExtrema(p0: number, p1: number, p2: number, p3: number): number[] {\r\n // B'(t) = 3[(p1−p0)(1−t)² + 2(p2−p1)t(1−t) + (p3−p2)t²], written as at² + bt + c.\r\n const a = -p0 + 3 * p1 - 3 * p2 + p3;\r\n const b = 2 * (p0 - 2 * p1 + p2);\r\n const c = p1 - p0;\r\n const roots: number[] = [];\r\n const push = (t: number) => {\r\n if (t > 0 && t < 1) roots.push(t);\r\n };\r\n if (Math.abs(a) < 1e-12) {\r\n if (Math.abs(b) > 1e-12) push(-c / b);\r\n return roots;\r\n }\r\n const disc = b * b - 4 * a * c;\r\n if (disc < 0) return roots;\r\n const root = Math.sqrt(disc);\r\n push((-b + root) / (2 * a));\r\n push((-b - root) / (2 * a));\r\n return roots;\r\n}\r\n\r\n/** The `t` value in (0, 1) where a quadratic's one-dimensional derivative is zero. */\r\nexport function quadExtrema(p0: number, p1: number, p2: number): number[] {\r\n // B'(t) = 2[(p1−p0)(1−t) + (p2−p1)t] = 0.\r\n const denominator = p0 - 2 * p1 + p2;\r\n if (Math.abs(denominator) < 1e-12) return [];\r\n const t = (p0 - p1) / denominator;\r\n return t > 0 && t < 1 ? [t] : [];\r\n}\r\n\r\n// --- Arc endpoint-to-center conversion -------------------------------------\r\n\r\nfunction angleBetween(ux: number, uy: number, vx: number, vy: number): number {\r\n const dot = ux * vx + uy * vy;\r\n const len = Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);\r\n let angle = Math.acos(Math.max(-1, Math.min(1, dot / len)));\r\n if (ux * vy - uy * vx < 0) angle = -angle;\r\n return angle;\r\n}\r\n\r\n\r\n/**\r\n * The endpoint→center conversion of an SVG `A` command.\r\n *\r\n * Returned as the ellipse's own parameters rather than as a sampler, because the\r\n * two things that need an arc want different halves of it: flattening wants\r\n * points, and bounding wants the angles where each axis turns around. A sampler\r\n * alone forces the second to guess.\r\n */\r\nexport function arcParams(\r\n from: Vector2, to: Vector2,\r\n rxRaw: number, ryRaw: number, rotation: number, largeArc: 0 | 1, sweep: 0 | 1,\r\n): ArcParams {\r\n const phi = rotation * Math.PI / 180;\r\n const cosPhi = Math.cos(phi), sinPhi = Math.sin(phi);\r\n\r\n const dx = (from.x - to.x) / 2;\r\n const dy = (from.y - to.y) / 2;\r\n const x1p = cosPhi * dx + sinPhi * dy;\r\n const y1p = -sinPhi * dx + cosPhi * dy;\r\n\r\n let rx = Math.abs(rxRaw), ry = Math.abs(ryRaw);\r\n const lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry);\r\n if (lambda > 1) {\r\n const s = Math.sqrt(lambda);\r\n rx *= s;\r\n ry *= s;\r\n }\r\n\r\n const rx2 = rx * rx, ry2 = ry * ry;\r\n const x1p2 = x1p * x1p, y1p2 = y1p * y1p;\r\n const sq = Math.max(0, (rx2 * ry2 - rx2 * y1p2 - ry2 * x1p2) / (rx2 * y1p2 + ry2 * x1p2));\r\n const sign = (largeArc === sweep) ? -1 : 1;\r\n const cxp = sign * Math.sqrt(sq) * (rx * y1p / ry);\r\n const cyp = sign * Math.sqrt(sq) * -(ry * x1p / rx);\r\n\r\n const cx = cosPhi * cxp - sinPhi * cyp + (from.x + to.x) / 2;\r\n const cy = sinPhi * cxp + cosPhi * cyp + (from.y + to.y) / 2;\r\n\r\n const theta1 = angleBetween(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);\r\n let dtheta = angleBetween((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry);\r\n if (sweep === 0 && dtheta > 0) dtheta -= 2 * Math.PI;\r\n if (sweep === 1 && dtheta < 0) dtheta += 2 * Math.PI;\r\n\r\n return { cx, cy, rx, ry, phi, theta1, dtheta };\r\n}\r\n\r\n/** The point on an arc at ellipse angle `theta`. */\r\nexport function arcPointAtAngle(arc: ArcParams, theta: number): Vector2 {\r\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\r\n const cosT = Math.cos(theta), sinT = Math.sin(theta);\r\n return {\r\n x: cosPhi * arc.rx * cosT - sinPhi * arc.ry * sinT + arc.cx,\r\n y: sinPhi * arc.rx * cosT + cosPhi * arc.ry * sinT + arc.cy,\r\n };\r\n}\r\n\r\n/** A parametric function tracing the arc from its start (`t=0`) to its end (`t=1`). */\r\nexport function arcPointFunction(arc: ArcParams): (t: number) => Vector2 {\r\n return (t: number) => arcPointAtAngle(arc, arc.theta1 + t * arc.dtheta);\r\n}\r\n\r\n/** The derivative of {@link arcPointAtAngle} with respect to `theta`. */\r\nfunction arcDerivativeAtAngle(arc: ArcParams, theta: number): Vector2 {\r\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\r\n const cosT = Math.cos(theta), sinT = Math.sin(theta);\r\n return {\r\n x: -arc.rx * cosPhi * sinT - arc.ry * sinPhi * cosT,\r\n y: -arc.rx * sinPhi * sinT + arc.ry * cosPhi * cosT,\r\n };\r\n}\r\n\r\n/**\r\n * The arc's `theta0..theta1` span as cubics — the one place an arc is\r\n * approximated.\r\n *\r\n * Split so no piece spans more than 90°, which is the standard bound: the\r\n * `(4/3)·tan(Δ/4)` construction is exact at both endpoints and at the midpoint,\r\n * and its worst-case radial error over a quarter turn is about 2.7e-4 of the\r\n * radius. There were two implementations of this before — one splitting by\r\n * angle, one fitting sampled points with a \"catmull-rom-like\" guess — and only\r\n * the first was worth keeping.\r\n */\r\nexport function arcSweepToCubics(arc: ArcParams, theta0: number, theta1: number): Cubic[] {\r\n const sweep = theta1 - theta0;\r\n if (Math.abs(sweep) < 1e-12) return [];\r\n const pieces = Math.max(1, Math.ceil(Math.abs(sweep) / (Math.PI / 2)));\r\n const step = sweep / pieces;\r\n const alpha = (4 / 3) * Math.tan(step / 4);\r\n\r\n const cubics: Cubic[] = [];\r\n for (let i = 0; i < pieces; i++) {\r\n const a0 = theta0 + step * i;\r\n const a1 = a0 + step;\r\n const p0 = arcPointAtAngle(arc, a0);\r\n const p1 = arcPointAtAngle(arc, a1);\r\n const d0 = arcDerivativeAtAngle(arc, a0);\r\n const d1 = arcDerivativeAtAngle(arc, a1);\r\n cubics.push({\r\n p0,\r\n c1: { x: p0.x + alpha * d0.x, y: p0.y + alpha * d0.y },\r\n c2: { x: p1.x - alpha * d1.x, y: p1.y - alpha * d1.y },\r\n p1,\r\n });\r\n }\r\n return cubics;\r\n}\r\n\r\n/**\r\n * The ellipse angles at which each axis turns around — the candidates an exact\r\n * bounding box tests against the swept range.\r\n */\r\nexport function arcAxisAngles(arc: ArcParams): { x: number[]; y: number[] } {\r\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\r\n // dx/dθ = 0 and dy/dθ = 0, each giving one angle and its antipode.\r\n const tx = Math.atan2(-arc.ry * sinPhi, arc.rx * cosPhi);\r\n const ty = Math.atan2(arc.ry * cosPhi, arc.rx * sinPhi);\r\n return {\r\n x: [tx, tx + Math.PI],\r\n y: [ty, ty + Math.PI],\r\n };\r\n}\r\n\r\n/**\r\n * Whether ellipse angle `theta` lies within the arc's swept range.\r\n *\r\n * Compared as a distance travelled in the sweep's own direction rather than as\r\n * an interval, because `theta1 + dtheta` routinely leaves `[-π, π]` and an\r\n * interval test would then reject the very angles that are inside it.\r\n */\r\nexport function arcContainsAngle(arc: ArcParams, theta: number): boolean {\r\n const TAU = Math.PI * 2;\r\n const forward = arc.dtheta >= 0;\r\n const delta = forward ? theta - arc.theta1 : arc.theta1 - theta;\r\n const travelled = ((delta % TAU) + TAU) % TAU;\r\n return travelled <= Math.abs(arc.dtheta) + 1e-9;\r\n}\r\n\r\n/** Re-exported so curve math and point lerping live behind a single import. */\r\nexport { lerpVector2 };\r\n"]}
1
+ {"version":3,"file":"bezier.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/bezier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,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AAC,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACrB,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;KACxB,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAc,EAAE,KAAa;IAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACxB,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;IAChE,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IAC9C,OAAO,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AACpD,CAAC;AAED,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { Vector2, lerpVector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand } from \"@/render/descriptors/path\";\nimport type { ArcParams, Cubic } from \"./types\";\n\n/**\n * Shared Bézier, arc and path-geometry primitives.\n *\n * Everything under `shape/path/` that evaluates, splits, measures or bounds a\n * curve reaches for these rather than carrying its own copy. That used to be an\n * aspiration this file's header stated and only three of seven callers honoured:\n * De Casteljau existed three times, quad→cubic and cubic evaluation twice each,\n * and the arc's endpoint→center conversion twice — once returning a sampler and\n * once returning cubics, differing in nothing else.\n *\n * Two evaluation styles are provided:\n * - Scalar (`cubicAxis` / `quadAxis`) — evaluate a single axis. Cheaper when you\n * already have loose x/y numbers and want to avoid allocating a {@link Vector2}.\n * - Vector (`cubicPoint` / `quadPoint`) — evaluate both axes into a {@link Vector2}.\n */\n\n/** SVG curve commands whose tangent feeds the reflected control point of a following S/s/T/t. */\nconst SMOOTH_CURVE_TYPES: ReadonlySet<PathCommand[\"type\"]> = new Set([\n \"C\", \"c\", \"S\", \"s\", \"Q\", \"q\", \"T\", \"t\",\n]);\n\n\n\n/**\n * True when a command's trailing control point should be remembered so the next\n * smooth command (S/s/T/t) can reflect it. Per the SVG spec, if the previous\n * command was not one of these, the implied control point is the current point.\n */\nexport function isSmoothCurveType(type: PathCommand[\"type\"]): boolean {\n return SMOOTH_CURVE_TYPES.has(type);\n}\n\n/** Reflect a control point through the current point: `2 * current - control`. */\nexport function reflectControlPoint(current: number, control: number): number {\n return 2 * current - control;\n}\n\n/** Euclidean distance between two points. */\nexport function distance(a: Vector2, b: Vector2): number {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n return Math.sqrt(dx * dx + dy * dy);\n}\n\n/** Evaluate one axis of a cubic Bézier at parameter `t` (0..1). */\nexport function cubicAxis(t: number, p0: number, p1: number, p2: number, p3: number): number {\n const u = 1 - t;\n return u * u * u * p0 + 3 * u * u * t * p1 + 3 * u * t * t * p2 + t * t * t * p3;\n}\n\n/** Evaluate one axis of a quadratic Bézier at parameter `t` (0..1). */\nexport function quadAxis(t: number, p0: number, p1: number, p2: number): number {\n const u = 1 - t;\n return u * u * p0 + 2 * u * t * p1 + t * t * p2;\n}\n\n/** Evaluate a cubic Bézier at parameter `t` (0..1) into a {@link Vector2}. */\nexport function cubicPoint(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: number): Vector2 {\n return {\n x: cubicAxis(t, p0.x, p1.x, p2.x, p3.x),\n y: cubicAxis(t, p0.y, p1.y, p2.y, p3.y),\n };\n}\n\n/** Evaluate a quadratic Bézier at parameter `t` (0..1) into a {@link Vector2}. */\nexport function quadPoint(p0: Vector2, p1: Vector2, p2: Vector2, t: number): Vector2 {\n return {\n x: quadAxis(t, p0.x, p1.x, p2.x),\n y: quadAxis(t, p0.y, p1.y, p2.y),\n };\n}\n\n/**\n * Approximate the arc length of a parametric curve by sampling it into a polyline\n * and summing the segment distances. More `steps` trade speed for accuracy.\n */\nexport function sampleCurveLength(pointAt: (t: number) => Vector2, steps = 32): number {\n let length = 0;\n let prev = pointAt(0);\n for (let i = 1; i <= steps; i++) {\n const next = pointAt(i / steps);\n length += distance(prev, next);\n prev = next;\n }\n return length;\n}\n\n/**\n * Binary-search the curve parameter `t` whose arc length from the start equals\n * `targetDist`. Used to find exactly where a curve should be cut. The curve is\n * re-sampled on each probe, so this is intentionally simple rather than fast;\n * 20 iterations give sub-pixel precision for typical path lengths.\n */\nexport function paramAtDistance(\n pointAt: (t: number) => Vector2,\n targetDist: number,\n totalLen: number,\n): number {\n if (totalLen === 0 || targetDist <= 0) return 0;\n if (targetDist >= totalLen) return 1;\n\n let lo = 0, hi = 1;\n for (let i = 0; i < 20; i++) {\n const mid = (lo + hi) / 2;\n let len = 0;\n let prev = pointAt(0);\n const steps = 16;\n for (let j = 1; j <= steps; j++) {\n const p = pointAt(mid * j / steps);\n len += distance(prev, p);\n prev = p;\n }\n if (len < targetDist) lo = mid;\n else hi = mid;\n }\n return (lo + hi) / 2;\n}\n\n// --- Degree conversion -----------------------------------------------------\n\n/** A straight line as a cubic: controls sit on the line at 1/3 and 2/3. */\nexport function lineToCubic(from: Vector2, to: Vector2): Cubic {\n return {\n p0: from,\n c1: lerpVector2(from, to, 1 / 3),\n c2: lerpVector2(from, to, 2 / 3),\n p1: to,\n };\n}\n\n/** Elevate a quadratic Bézier to the equivalent cubic (exact, not an approximation). */\nexport function quadToCubic(from: Vector2, cp: Vector2, to: Vector2): Cubic {\n return {\n p0: from,\n c1: { x: from.x + (2 / 3) * (cp.x - from.x), y: from.y + (2 / 3) * (cp.y - from.y) },\n c2: { x: to.x + (2 / 3) * (cp.x - to.x), y: to.y + (2 / 3) * (cp.y - to.y) },\n p1: to,\n };\n}\n\n// --- De Casteljau splitting ---\n// Splitting a Bézier at parameter `t` yields two sub-curves that together trace\n// the exact same shape, so trimming preserves curvature instead of polylining it.\n\nexport function splitCubicAt(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: number) {\n const a = lerpVector2(p0, p1, t);\n const b = lerpVector2(p1, p2, t);\n const c = lerpVector2(p2, p3, t);\n const d = lerpVector2(a, b, t);\n const e = lerpVector2(b, c, t);\n const f = lerpVector2(d, e, t);\n return {\n left: { from: p0, cp1: a, cp2: d, to: f },\n right: { from: f, cp1: e, cp2: c, to: p3 },\n };\n}\n\n/** The sub-cubic spanning parameters `t0..t1` of the original cubic. */\nexport function extractCubicRange(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t0: number, t1: number) {\n if (t0 === 0) return splitCubicAt(p0, p1, p2, p3, t1).left;\n const { right } = splitCubicAt(p0, p1, p2, p3, t0);\n const adj = (t1 - t0) / (1 - t0);\n return splitCubicAt(right.from, right.cp1, right.cp2, right.to, adj).left;\n}\n\nexport function splitQuadAt(p0: Vector2, p1: Vector2, p2: Vector2, t: number) {\n const a = lerpVector2(p0, p1, t);\n const b = lerpVector2(p1, p2, t);\n const c = lerpVector2(a, b, t);\n return {\n left: { from: p0, cp: a, to: c },\n right: { from: c, cp: b, to: p2 },\n };\n}\n\n/** The sub-quadratic spanning parameters `t0..t1` of the original quadratic. */\nexport function extractQuadRange(p0: Vector2, p1: Vector2, p2: Vector2, t0: number, t1: number) {\n if (t0 === 0) return splitQuadAt(p0, p1, p2, t1).left;\n const { right } = splitQuadAt(p0, p1, p2, t0);\n const adj = (t1 - t0) / (1 - t0);\n return splitQuadAt(right.from, right.cp, right.to, adj).left;\n}\n\n// --- Extrema ---------------------------------------------------------------\n\n/** The `t` values in (0, 1) where a cubic's one-dimensional derivative is zero. */\nexport function cubicExtrema(p0: number, p1: number, p2: number, p3: number): number[] {\n // B'(t) = 3[(p1−p0)(1−t)² + 2(p2−p1)t(1−t) + (p3−p2)t²], written as at² + bt + c.\n const a = -p0 + 3 * p1 - 3 * p2 + p3;\n const b = 2 * (p0 - 2 * p1 + p2);\n const c = p1 - p0;\n const roots: number[] = [];\n const push = (t: number) => {\n if (t > 0 && t < 1) roots.push(t);\n };\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) > 1e-12) push(-c / b);\n return roots;\n }\n const disc = b * b - 4 * a * c;\n if (disc < 0) return roots;\n const root = Math.sqrt(disc);\n push((-b + root) / (2 * a));\n push((-b - root) / (2 * a));\n return roots;\n}\n\n/** The `t` value in (0, 1) where a quadratic's one-dimensional derivative is zero. */\nexport function quadExtrema(p0: number, p1: number, p2: number): number[] {\n // B'(t) = 2[(p1−p0)(1−t) + (p2−p1)t] = 0.\n const denominator = p0 - 2 * p1 + p2;\n if (Math.abs(denominator) < 1e-12) return [];\n const t = (p0 - p1) / denominator;\n return t > 0 && t < 1 ? [t] : [];\n}\n\n// --- Arc endpoint-to-center conversion -------------------------------------\n\nfunction angleBetween(ux: number, uy: number, vx: number, vy: number): number {\n const dot = ux * vx + uy * vy;\n const len = Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);\n let angle = Math.acos(Math.max(-1, Math.min(1, dot / len)));\n if (ux * vy - uy * vx < 0) angle = -angle;\n return angle;\n}\n\n\n/**\n * The endpoint→center conversion of an SVG `A` command.\n *\n * Returned as the ellipse's own parameters rather than as a sampler, because the\n * two things that need an arc want different halves of it: flattening wants\n * points, and bounding wants the angles where each axis turns around. A sampler\n * alone forces the second to guess.\n */\nexport function arcParams(\n from: Vector2, to: Vector2,\n rxRaw: number, ryRaw: number, rotation: number, largeArc: 0 | 1, sweep: 0 | 1,\n): ArcParams {\n const phi = rotation * Math.PI / 180;\n const cosPhi = Math.cos(phi), sinPhi = Math.sin(phi);\n\n const dx = (from.x - to.x) / 2;\n const dy = (from.y - to.y) / 2;\n const x1p = cosPhi * dx + sinPhi * dy;\n const y1p = -sinPhi * dx + cosPhi * dy;\n\n let rx = Math.abs(rxRaw), ry = Math.abs(ryRaw);\n const lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry);\n if (lambda > 1) {\n const s = Math.sqrt(lambda);\n rx *= s;\n ry *= s;\n }\n\n const rx2 = rx * rx, ry2 = ry * ry;\n const x1p2 = x1p * x1p, y1p2 = y1p * y1p;\n const sq = Math.max(0, (rx2 * ry2 - rx2 * y1p2 - ry2 * x1p2) / (rx2 * y1p2 + ry2 * x1p2));\n const sign = (largeArc === sweep) ? -1 : 1;\n const cxp = sign * Math.sqrt(sq) * (rx * y1p / ry);\n const cyp = sign * Math.sqrt(sq) * -(ry * x1p / rx);\n\n const cx = cosPhi * cxp - sinPhi * cyp + (from.x + to.x) / 2;\n const cy = sinPhi * cxp + cosPhi * cyp + (from.y + to.y) / 2;\n\n const theta1 = angleBetween(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);\n let dtheta = angleBetween((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry);\n if (sweep === 0 && dtheta > 0) dtheta -= 2 * Math.PI;\n if (sweep === 1 && dtheta < 0) dtheta += 2 * Math.PI;\n\n return { cx, cy, rx, ry, phi, theta1, dtheta };\n}\n\n/** The point on an arc at ellipse angle `theta`. */\nexport function arcPointAtAngle(arc: ArcParams, theta: number): Vector2 {\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\n const cosT = Math.cos(theta), sinT = Math.sin(theta);\n return {\n x: cosPhi * arc.rx * cosT - sinPhi * arc.ry * sinT + arc.cx,\n y: sinPhi * arc.rx * cosT + cosPhi * arc.ry * sinT + arc.cy,\n };\n}\n\n/** A parametric function tracing the arc from its start (`t=0`) to its end (`t=1`). */\nexport function arcPointFunction(arc: ArcParams): (t: number) => Vector2 {\n return (t: number) => arcPointAtAngle(arc, arc.theta1 + t * arc.dtheta);\n}\n\n/** The derivative of {@link arcPointAtAngle} with respect to `theta`. */\nfunction arcDerivativeAtAngle(arc: ArcParams, theta: number): Vector2 {\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\n const cosT = Math.cos(theta), sinT = Math.sin(theta);\n return {\n x: -arc.rx * cosPhi * sinT - arc.ry * sinPhi * cosT,\n y: -arc.rx * sinPhi * sinT + arc.ry * cosPhi * cosT,\n };\n}\n\n/**\n * The arc's `theta0..theta1` span as cubics — the one place an arc is\n * approximated.\n *\n * Split so no piece spans more than 90°, which is the standard bound: the\n * `(4/3)·tan(Δ/4)` construction is exact at both endpoints and at the midpoint,\n * and its worst-case radial error over a quarter turn is about 2.7e-4 of the\n * radius. There were two implementations of this before — one splitting by\n * angle, one fitting sampled points with a \"catmull-rom-like\" guess — and only\n * the first was worth keeping.\n */\nexport function arcSweepToCubics(arc: ArcParams, theta0: number, theta1: number): Cubic[] {\n const sweep = theta1 - theta0;\n if (Math.abs(sweep) < 1e-12) return [];\n const pieces = Math.max(1, Math.ceil(Math.abs(sweep) / (Math.PI / 2)));\n const step = sweep / pieces;\n const alpha = (4 / 3) * Math.tan(step / 4);\n\n const cubics: Cubic[] = [];\n for (let i = 0; i < pieces; i++) {\n const a0 = theta0 + step * i;\n const a1 = a0 + step;\n const p0 = arcPointAtAngle(arc, a0);\n const p1 = arcPointAtAngle(arc, a1);\n const d0 = arcDerivativeAtAngle(arc, a0);\n const d1 = arcDerivativeAtAngle(arc, a1);\n cubics.push({\n p0,\n c1: { x: p0.x + alpha * d0.x, y: p0.y + alpha * d0.y },\n c2: { x: p1.x - alpha * d1.x, y: p1.y - alpha * d1.y },\n p1,\n });\n }\n return cubics;\n}\n\n/**\n * The ellipse angles at which each axis turns around — the candidates an exact\n * bounding box tests against the swept range.\n */\nexport function arcAxisAngles(arc: ArcParams): { x: number[]; y: number[] } {\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\n // dx/dθ = 0 and dy/dθ = 0, each giving one angle and its antipode.\n const tx = Math.atan2(-arc.ry * sinPhi, arc.rx * cosPhi);\n const ty = Math.atan2(arc.ry * cosPhi, arc.rx * sinPhi);\n return {\n x: [tx, tx + Math.PI],\n y: [ty, ty + Math.PI],\n };\n}\n\n/**\n * Whether ellipse angle `theta` lies within the arc's swept range.\n *\n * Compared as a distance travelled in the sweep's own direction rather than as\n * an interval, because `theta1 + dtheta` routinely leaves `[-π, π]` and an\n * interval test would then reject the very angles that are inside it.\n */\nexport function arcContainsAngle(arc: ArcParams, theta: number): boolean {\n const TAU = Math.PI * 2;\n const forward = arc.dtheta >= 0;\n const delta = forward ? theta - arc.theta1 : arc.theta1 - theta;\n const travelled = ((delta % TAU) + TAU) % TAU;\n return travelled <= Math.abs(arc.dtheta) + 1e-9;\n}\n\n/** Re-exported so curve math and point lerping live behind a single import. */\nexport { lerpVector2 };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC","sourcesContent":["/**\r\n * Path geometry.\r\n *\r\n * One value — {@link pathOps} — carries every operation: parsing, the contour\r\n * normal form, bounds, length, sampling, dashing, trimming, morphing, and the\r\n * editable anchor model with its unit box. The free functions this used to\r\n * export (`calculatePathLength`, `applyDashPattern`, `extractSubpath`,\r\n * `createPathSampler`, `measurePathData`, `parsePathString`, `toPathCommands`,\r\n * `lerpPath`, `buildMorph`, `sampleMorph`, `toCubicSubpaths`) are those methods\r\n * now; each carried its own copy of the SVG pen walk, and the copies disagreed.\r\n */\r\nexport { pathOps } from \"./ops\";\r\nexport { EMPTY_PATH_DATA, PATH_UNIT_EXTENT, PATH_UNIT_HALF, UNIT_PATH_BOX } from \"./anchors\";\r\nexport type * from \"./types\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC","sourcesContent":["/**\n * Path geometry.\n *\n * One value — {@link pathOps} — carries every operation: parsing, the contour\n * normal form, bounds, length, sampling, dashing, trimming, morphing, and the\n * editable anchor model with its unit box. The free functions this used to\n * export (`calculatePathLength`, `applyDashPattern`, `extractSubpath`,\n * `createPathSampler`, `measurePathData`, `parsePathString`, `toPathCommands`,\n * `lerpPath`, `buildMorph`, `sampleMorph`, `toCubicSubpaths`) are those methods\n * now; each carried its own copy of the SVG pen walk, and the copies disagreed.\n */\nexport { pathOps } from \"./ops\";\nexport { EMPTY_PATH_DATA, PATH_UNIT_EXTENT, PATH_UNIT_HALF, UNIT_PATH_BOX } from \"./anchors\";\nexport type * from \"./types\";\n"]}