@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.10
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.
- package/CHANGELOG.md +356 -0
- package/NOTICE +49 -0
- package/README.md +29 -10
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +7 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +99 -15
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +4 -4
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +52 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +10 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +26 -24
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +51 -30
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +18 -13
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +13 -11
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +8 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +7 -9
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +56 -12
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +59 -19
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +27 -141
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +24 -106
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +2 -3
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +117 -522
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +102 -364
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +98 -28
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +21 -7
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +82 -34
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +57 -34
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +6 -8
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +34 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +157 -112
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +102 -50
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +2 -2
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +9 -1
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +12 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +7 -17
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +3 -19
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +3 -3
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +6 -6
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +12 -13
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js +2 -0
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +2 -0
- package/dist/browser/experimental.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +5 -5
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -19
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -19
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +62 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +38 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.d.ts +5 -5
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.js +4 -15
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +143 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.d.ts +1 -1
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.js +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.d.ts +10 -12
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.js +10 -12
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +116 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.d.ts +2 -2
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.js +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +543 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +107 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +66 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +347 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +453 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.d.ts +4 -4
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.js +3 -4
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.d.ts +2 -2
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.js +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.d.ts +3 -3
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.js +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-render.js +10 -23
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.d.ts +3 -3
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.js +4 -4
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.d.ts +2 -2
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.js +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.d.ts +206 -185
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.js +296 -324
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.d.ts +25 -15
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.js +30 -35
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.d.ts +9 -10
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.js +16 -13
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.d.ts +3 -3
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.js +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.d.ts +1 -1
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.js +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node.d.ts +46 -82
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node.js +89 -114
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.d.ts +16 -15
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.js +40 -85
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.d.ts +65 -25
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.js +78 -76
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/audio.d.ts +10 -2
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +45 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +18 -42
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +23 -5
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +72 -10
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +2 -2
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +10 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +6 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +32 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +71 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +4 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +71 -44
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +94 -35
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +57 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +264 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +145 -20
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +478 -80
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +30 -44
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +20 -8
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +195 -52
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +82 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +34 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +26 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +6 -1
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +29 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +84 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +19 -3
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +20 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -9
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +11 -5
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/render-context2d.d.ts +8 -8
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +21 -23
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +85 -34
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/resources.d.ts +2 -2
- package/dist/render3d/resources.js +2 -2
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +12 -1
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +40 -7
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +11 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +20 -3
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +29 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +3 -2
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +8 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -19
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +13 -6
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +34 -12
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +20 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +132 -27
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +13 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +6 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +45 -4
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +127 -13
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +14 -6
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +10 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +32 -3
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +78 -11
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +16 -10
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +23 -8
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +2 -2
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +6 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +70 -38
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +71 -46
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +21 -8
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +12 -23
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +13 -1
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +17 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +41 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/index.d.ts +3 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +2 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +8 -10
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -249
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
- package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
- package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
- package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -19
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -16
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -115
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -190
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -4
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -40
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -68
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -52
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -46
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -54
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -71
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -118
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -348
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts +0 -47
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js +0 -63
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts +0 -29
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js +0 -43
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -100
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -140
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -73
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -144
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -135
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -504
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -91
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -71
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -270
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -438
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -159
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -254
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -100
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -70
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -122
- package/dist/tween/seekable.js.map +0 -1
- /package/dist/{nodes → components/builtins}/text/number-pattern.d.ts +0 -0
- /package/dist/{nodes → components/builtins}/text/number-pattern.js +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.d.ts +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.js +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/tween/lerp.ts", "../../../src/attributes/layout/vector2.ts", "../../../src/attributes/shape/fill/color/constants.ts", "../../../src/attributes/shape/fill/color/parser.ts", "../../../src/attributes/shape/path/bezier.ts", "../../../src/attributes/shape/path/walk.ts", "../../../src/attributes/shape/path/anchors.ts", "../../../src/attributes/shape/path/measure.ts", "../../../src/attributes/shape/path/morph.ts", "../../../src/attributes/shape/path/ops.ts", "../../../src/components/builtins/geometry/shape-outline.ts", "../../../src/components/builtins/text/text-defaults.ts", "../../../src/attributes/render3d/orbit.ts"],
|
|
4
|
+
"sourcesContent": ["import { EasingFunction } from \"./ease/type\";\n\n/**\n * Linearly interpolates between two numbers.\n *\n * @param from - Start value at `t = 0`.\n * @param to - End value at `t = 1`.\n * @param t - Normalized progress in [0, 1]. Values outside this range\n * extrapolate beyond the endpoints.\n * @returns The interpolated value: `from + (to - from) * t`.\n */\nexport function lerpNumber(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n\n/**\n * Interpolates a CSS-style perspective distance (viewer-to-plane, in px, where\n * `0` means \"no perspective\" — a parallel projection).\n *\n * Perspective enters the projection matrix as its reciprocal — a point at depth\n * `z` lands at `x / (1 - z/perspective)` — so `1/perspective` (not the raw\n * distance) is the quantity that varies smoothly with the visual strength of\n * the effect. Lerping the raw px value linearly sweeps through the small\n * positive numbers next to `0` on the way between \"off\" and any finite\n * distance, and `1/perspective` diverges there: a `0 → 800` tween would flash\n * through a wildly exaggerated, near-degenerate projection right at the start\n * before settling down to the mild depth `800` actually asks for. Lerping the\n * reciprocal instead — with `0` standing in for a reciprocal of `0`, matching\n * the renderer's own convention (see `isProjective`/`invP` in `matrix2d.ts`) —\n * keeps that quantity monotonic and bounded between the two endpoints, so the\n * effect builds or settles smoothly instead of spiking.\n */\nexport function lerpPerspective(from: number, to: number, t: number): number {\n const invFrom = from !== 0 ? 1 / from : 0;\n const invTo = to !== 0 ? 1 / to : 0;\n const inv = invFrom + (invTo - invFrom) * t;\n return inv !== 0 ? 1 / inv : 0;\n}\n\nexport type LerpFunction<T> = (from: T, to: T, t: number) => T;\nexport type TweenOptions<T> = { ease?: EasingFunction, lerp?: LerpFunction<T> };", "import { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\n/** A 2D point or offset in pixel space. */\nexport interface Vector2 {\n x: number;\n y: number;\n}\n\n/** Linear interpolation between two Vector2 positions. t=0 returns `from`, t=1 returns `to`. */\nexport function lerpVector2(from: Vector2, to: Vector2, t: number): Vector2 {\n return { x: lerpNumber(from.x, to.x, t), y: lerpNumber(from.y, to.y, t) };\n}\n\n/** The `Vector2` attribute's op set: resolve is the identity (already a loose number pair). */\nexport const vector2Ops: AttributeOps<Vector2, Vector2> = {\n resolve: (value) => value,\n lerp: lerpVector2,\n};\n", "/**\n * Pre-normalized CSS named color table.\n *\n * All 148 CSS Level 4 named colors stored as `[R, G, B, A]` float tuples in\n * the 0–1 range. Map lookup is O(1) and avoids per-call string parsing or\n * floating-point division at runtime — callers just copy the tuple out.\n *\n * Source values are rounded to three decimal places (≈ 0.4 ULP error for an\n * 8-bit channel), which is well within display precision.\n */\n\nimport type { NormalizedColor } from './parser';\n\nexport const CSS_COLOR_MAP: ReadonlyMap<string, NormalizedColor> = new Map([\n ['aliceblue', [0.941, 0.973, 1.000, 1]],\n ['antiquewhite', [0.980, 0.922, 0.843, 1]],\n ['aqua', [0.000, 1.000, 1.000, 1]],\n ['aquamarine', [0.498, 1.000, 0.831, 1]],\n ['azure', [0.941, 1.000, 1.000, 1]],\n ['beige', [0.961, 0.961, 0.863, 1]],\n ['bisque', [1.000, 0.894, 0.769, 1]],\n ['black', [0.000, 0.000, 0.000, 1]],\n ['blanchedalmond', [1.000, 0.922, 0.804, 1]],\n ['blue', [0.000, 0.000, 1.000, 1]],\n ['blueviolet', [0.541, 0.169, 0.886, 1]],\n ['brown', [0.647, 0.165, 0.165, 1]],\n ['burlywood', [0.871, 0.722, 0.529, 1]],\n ['cadetblue', [0.373, 0.620, 0.627, 1]],\n ['chartreuse', [0.498, 1.000, 0.000, 1]],\n ['chocolate', [0.824, 0.412, 0.118, 1]],\n ['coral', [1.000, 0.498, 0.314, 1]],\n ['cornflowerblue', [0.392, 0.584, 0.929, 1]],\n ['cornsilk', [1.000, 0.973, 0.863, 1]],\n ['crimson', [0.863, 0.078, 0.235, 1]],\n ['cyan', [0.000, 1.000, 1.000, 1]],\n ['darkblue', [0.000, 0.000, 0.545, 1]],\n ['darkcyan', [0.000, 0.545, 0.545, 1]],\n ['darkgoldenrod', [0.722, 0.525, 0.043, 1]],\n ['darkgray', [0.663, 0.663, 0.663, 1]],\n ['darkgreen', [0.000, 0.392, 0.000, 1]],\n ['darkgrey', [0.663, 0.663, 0.663, 1]],\n ['darkkhaki', [0.741, 0.718, 0.420, 1]],\n ['darkmagenta', [0.545, 0.000, 0.545, 1]],\n ['darkolivegreen', [0.333, 0.420, 0.184, 1]],\n ['darkorange', [1.000, 0.549, 0.000, 1]],\n ['darkorchid', [0.600, 0.196, 0.800, 1]],\n ['darkred', [0.545, 0.000, 0.000, 1]],\n ['darksalmon', [0.914, 0.588, 0.478, 1]],\n ['darkseagreen', [0.561, 0.737, 0.561, 1]],\n ['darkslateblue', [0.282, 0.239, 0.545, 1]],\n ['darkslategray', [0.184, 0.310, 0.310, 1]],\n ['darkslategrey', [0.184, 0.310, 0.310, 1]],\n ['darkturquoise', [0.000, 0.808, 0.820, 1]],\n ['darkviolet', [0.580, 0.000, 0.827, 1]],\n ['deeppink', [1.000, 0.078, 0.576, 1]],\n ['deepskyblue', [0.000, 0.749, 1.000, 1]],\n ['dimgray', [0.412, 0.412, 0.412, 1]],\n ['dimgrey', [0.412, 0.412, 0.412, 1]],\n ['dodgerblue', [0.118, 0.565, 1.000, 1]],\n ['firebrick', [0.698, 0.133, 0.133, 1]],\n ['floralwhite', [1.000, 0.980, 0.941, 1]],\n ['forestgreen', [0.133, 0.545, 0.133, 1]],\n ['fuchsia', [1.000, 0.000, 1.000, 1]],\n ['gainsboro', [0.863, 0.863, 0.863, 1]],\n ['ghostwhite', [0.973, 0.973, 1.000, 1]],\n ['gold', [1.000, 0.843, 0.000, 1]],\n ['goldenrod', [0.855, 0.647, 0.125, 1]],\n ['gray', [0.502, 0.502, 0.502, 1]],\n ['green', [0.000, 0.502, 0.000, 1]],\n ['greenyellow', [0.678, 1.000, 0.184, 1]],\n ['grey', [0.502, 0.502, 0.502, 1]],\n ['honeydew', [0.941, 1.000, 0.941, 1]],\n ['hotpink', [1.000, 0.412, 0.706, 1]],\n ['indianred', [0.804, 0.361, 0.361, 1]],\n ['indigo', [0.294, 0.000, 0.510, 1]],\n ['ivory', [1.000, 1.000, 0.941, 1]],\n ['khaki', [0.941, 0.902, 0.549, 1]],\n ['lavender', [0.902, 0.902, 0.980, 1]],\n ['lavenderblush', [1.000, 0.941, 0.961, 1]],\n ['lawngreen', [0.486, 0.988, 0.000, 1]],\n ['lemonchiffon', [1.000, 0.980, 0.804, 1]],\n ['lightblue', [0.678, 0.847, 0.902, 1]],\n ['lightcoral', [0.941, 0.502, 0.502, 1]],\n ['lightcyan', [0.878, 1.000, 1.000, 1]],\n ['lightgoldenrodyellow', [0.980, 0.980, 0.824, 1]],\n ['lightgray', [0.827, 0.827, 0.827, 1]],\n ['lightgreen', [0.565, 0.933, 0.565, 1]],\n ['lightgrey', [0.827, 0.827, 0.827, 1]],\n ['lightpink', [1.000, 0.714, 0.757, 1]],\n ['lightsalmon', [1.000, 0.627, 0.478, 1]],\n ['lightseagreen', [0.125, 0.698, 0.667, 1]],\n ['lightskyblue', [0.529, 0.808, 0.980, 1]],\n ['lightslategray', [0.467, 0.533, 0.600, 1]],\n ['lightslategrey', [0.467, 0.533, 0.600, 1]],\n ['lightsteelblue', [0.690, 0.769, 0.871, 1]],\n ['lightyellow', [1.000, 1.000, 0.878, 1]],\n ['lime', [0.000, 1.000, 0.000, 1]],\n ['limegreen', [0.196, 0.804, 0.196, 1]],\n ['linen', [0.980, 0.941, 0.902, 1]],\n ['magenta', [1.000, 0.000, 1.000, 1]],\n ['maroon', [0.502, 0.000, 0.000, 1]],\n ['mediumaquamarine', [0.400, 0.804, 0.667, 1]],\n ['mediumblue', [0.000, 0.000, 0.804, 1]],\n ['mediumorchid', [0.729, 0.333, 0.827, 1]],\n ['mediumpurple', [0.576, 0.439, 0.859, 1]],\n ['mediumseagreen', [0.235, 0.702, 0.443, 1]],\n ['mediumslateblue', [0.482, 0.408, 0.933, 1]],\n ['mediumspringgreen', [0.000, 0.980, 0.604, 1]],\n ['mediumturquoise', [0.282, 0.820, 0.800, 1]],\n ['mediumvioletred', [0.780, 0.082, 0.522, 1]],\n ['midnightblue', [0.098, 0.098, 0.439, 1]],\n ['mintcream', [0.961, 1.000, 0.980, 1]],\n ['mistyrose', [1.000, 0.894, 0.882, 1]],\n ['moccasin', [1.000, 0.894, 0.710, 1]],\n ['navajowhite', [1.000, 0.871, 0.678, 1]],\n ['navy', [0.000, 0.000, 0.502, 1]],\n ['oldlace', [0.992, 0.961, 0.902, 1]],\n ['olive', [0.502, 0.502, 0.000, 1]],\n ['olivedrab', [0.420, 0.557, 0.137, 1]],\n ['orange', [1.000, 0.647, 0.000, 1]],\n ['orangered', [1.000, 0.271, 0.000, 1]],\n ['orchid', [0.855, 0.439, 0.839, 1]],\n ['palegoldenrod', [0.933, 0.910, 0.667, 1]],\n ['palegreen', [0.596, 0.984, 0.596, 1]],\n ['paleturquoise', [0.686, 0.933, 0.933, 1]],\n ['palevioletred', [0.859, 0.439, 0.576, 1]],\n ['papayawhip', [1.000, 0.937, 0.835, 1]],\n ['peachpuff', [1.000, 0.855, 0.725, 1]],\n ['peru', [0.804, 0.522, 0.247, 1]],\n ['pink', [1.000, 0.753, 0.796, 1]],\n ['plum', [0.867, 0.627, 0.867, 1]],\n ['powderblue', [0.690, 0.878, 0.902, 1]],\n ['purple', [0.502, 0.000, 0.502, 1]],\n ['rebeccapurple', [0.400, 0.200, 0.600, 1]],\n ['red', [1.000, 0.000, 0.000, 1]],\n ['rosybrown', [0.737, 0.561, 0.561, 1]],\n ['royalblue', [0.255, 0.412, 0.882, 1]],\n ['saddlebrown', [0.545, 0.271, 0.075, 1]],\n ['salmon', [0.980, 0.502, 0.447, 1]],\n ['sandybrown', [0.957, 0.643, 0.376, 1]],\n ['seagreen', [0.180, 0.545, 0.341, 1]],\n ['seashell', [1.000, 0.961, 0.933, 1]],\n ['sienna', [0.627, 0.322, 0.176, 1]],\n ['silver', [0.753, 0.753, 0.753, 1]],\n ['skyblue', [0.529, 0.808, 0.922, 1]],\n ['slateblue', [0.416, 0.353, 0.804, 1]],\n ['slategray', [0.439, 0.502, 0.565, 1]],\n ['slategrey', [0.439, 0.502, 0.565, 1]],\n ['snow', [1.000, 0.980, 0.980, 1]],\n ['springgreen', [0.000, 1.000, 0.498, 1]],\n ['steelblue', [0.275, 0.510, 0.706, 1]],\n ['tan', [0.824, 0.706, 0.549, 1]],\n ['teal', [0.000, 0.502, 0.502, 1]],\n ['thistle', [0.847, 0.749, 0.847, 1]],\n ['tomato', [1.000, 0.388, 0.278, 1]],\n ['transparent', [0.000, 0.000, 0.000, 0]],\n ['turquoise', [0.251, 0.878, 0.816, 1]],\n ['violet', [0.933, 0.510, 0.933, 1]],\n ['wheat', [0.961, 0.871, 0.702, 1]],\n ['white', [1.000, 1.000, 1.000, 1]],\n ['whitesmoke', [0.961, 0.961, 0.961, 1]],\n ['yellow', [1.000, 1.000, 0.000, 1]],\n ['yellowgreen', [0.604, 0.804, 0.196, 1]],\n]);\n", "/**\n * CSS color string parser → normalized [R, G, B, A] float tuple.\n *\n * Supported formats:\n * - Named colors (CSS Level 4, 148 entries) and theme aliases via {@link setTheme}\n * - Hex: `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA`\n * - `rgb()` / `rgba()` — legacy comma and modern space/slash syntax\n * - `hsl()` / `hsla()`\n * - `lab()`, `lch()`\n * - `oklab()`, `oklch()`\n * - Tailwind-style opacity suffix: `\"white/10\"`, `\"primary/90\"` (percent 0–100)\n *\n * All output values are in the linear 0–1 range suitable for WebGL uniforms.\n * Named-color lookup is O(1); all other formats are parsed with lightweight\n * regex — no DOM, no `getComputedStyle`.\n */\n\nimport { CSS_COLOR_MAP } from './constants';\n\n/** Normalized RGBA color: `[red, green, blue, alpha]` each in the 0–1 range. */\nexport type NormalizedColor = [number, number, number, number];\n\n/** Loose color input accepted by prop interfaces — CSS string or pre-normalized tuple. */\nexport type Color = string | NormalizedColor;\n\n// ── Color space helpers ───────────────────────────────────────────────────────\n\n/** Applies the sRGB gamma curve to a single linear-light channel. */\nfunction gammaEncode(c: number): number {\n c = Math.max(0, Math.min(1, c));\n return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;\n}\n\n/** Converts a linear-light sRGB triple to gamma-encoded sRGB. */\nfunction linearToSrgb(r: number, g: number, b: number, a: number): NormalizedColor {\n return [gammaEncode(r), gammaEncode(g), gammaEncode(b), a];\n}\n\n/** Bradford-adapted XYZ D65 → linear-light sRGB matrix (IEC 61966-2-1). */\nfunction xyzD65ToLinearSrgb(X: number, Y: number, Z: number): [number, number, number] {\n return [\n 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,\n -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z,\n 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z,\n ];\n}\n\n// ── Argument parser ───────────────────────────────────────────────────────────\n\n/**\n * Splits the inner content of a CSS color function into exactly three channel\n * tokens and an alpha value. Handles the slash-alpha syntax used by modern\n * `rgb()` / `hsl()` as well as the legacy comma-alpha form used by `rgba()` /\n * `hsla()`; both go through {@link readAlpha}, so a percentage alpha means the\n * same in either. Returns `null` for the wrong number of arguments or an alpha\n * that is not a number, which {@link parseColor} reports as an unsupported\n * format.\n */\nfunction parseArgs(inner: string): { tokens: string[]; alpha: number } | null {\n const slashIdx = inner.lastIndexOf('/');\n let alphaToken: string | undefined;\n let colorPart = inner;\n if (slashIdx !== -1) {\n alphaToken = inner.slice(slashIdx + 1).trim();\n colorPart = inner.slice(0, slashIdx);\n }\n const tokens = colorPart.trim().split(/[\\s,]+/).filter(Boolean);\n if (tokens.length === 4 && alphaToken === undefined) alphaToken = tokens.pop();\n if (tokens.length !== 3) return null;\n const alpha = alphaToken === undefined ? 1 : readAlpha(alphaToken);\n if (!Number.isFinite(alpha)) return null;\n return { tokens, alpha };\n}\n\n/** Reads an alpha token: a number, or a percentage (`50%` is 0.5). `NaN` if neither. */\nfunction readAlpha(token: string): number {\n return token.endsWith('%') ? Number(token.slice(0, -1)) / 100 : Number(token);\n}\n\n/** Reads a channel token as a number, scaling a percentage to `percentScale` and a bare number by `1 / numberScale`. `NaN` if it is not a number. */\nfunction readChannel(token: string, percentScale: number, numberScale = 1): number {\n return token.endsWith('%') ? (Number(token.slice(0, -1)) / 100) * percentScale : Number(token) / numberScale;\n}\n\n/** Degrees per CSS angle unit (`deg`, `grad`, `rad`, `turn`). */\nconst ANGLE_UNIT_DEGREES: Record<string, number> = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };\n\n/** Reads a CSS hue/angle token to degrees. A bare number is degrees; an unknown unit or a non-number is `NaN`. */\nfunction readHue(token: string): number {\n const m = token.match(/^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(deg|grad|rad|turn)?$/);\n if (!m) return NaN;\n return Number(m[1]) * ANGLE_UNIT_DEGREES[m[2] ?? 'deg'];\n}\n\n/** Returns `color` when every component is finite, otherwise `null` (unsupported format). */\nfunction finiteColor(color: NormalizedColor): NormalizedColor | null {\n return color.every(Number.isFinite) ? color : null;\n}\n\n// ── Per-format parsers ────────────────────────────────────────────────────────\n\n// Use a globalThis key so multiple bundled copies of this module (e.g. the\n// prebuilt player bundle and the Vite-compiled user code) share one map.\nconst _g = globalThis as Record<string, unknown>;\nif (!_g.__msThemeMap) _g.__msThemeMap = new Map<string, NormalizedColor>();\nconst THEME_COLOR_MAP = _g.__msThemeMap as Map<string, NormalizedColor>;\n\n// Colours already parsed, by the string as given: a scene repeats its strings every\n// frame. Shared like the theme, and cleared with it, since a name resolves through it.\nif (!_g.__msParsedColors) _g.__msParsedColors = new Map<string, NormalizedColor>();\nconst PARSED = _g.__msParsedColors as Map<string, NormalizedColor>;\n\n// Typography presets ride the same shared-global pattern as the color map, so\n// the prebuilt player bundle and the user's Vite-compiled code read one registry\n// — `setTheme` (called once per build at the player/headless entry points)\n// populates both before any scene generator runs.\nif (!_g.__msTypographyMap) _g.__msTypographyMap = new Map<string, Record<string, unknown>>();\nconst TYPOGRAPHY_MAP = _g.__msTypographyMap as Map<string, Record<string, unknown>>;\n\n// Structural mirror of `@/project/config`'s `Theme` (and its color token shape),\n// declared locally so this module stays a leaf — `config.ts` imports `Color`\n// from here, so importing `Theme` back would be a cycle. The project's `Theme`\n// is structurally compatible, so `setTheme(config.theme)` just works.\n// `typography` presets are stored opaquely (the parser never reads their fields),\n// so the value type is the loose `object` — this stays assignable from `Theme`'s\n// `TypographyPreset` (a `TextStyle` interface, which lacks an implicit string\n// index signature and so is not a `Record<string, unknown>`).\ntype ColorTokenInput = Color | { [key: string]: ColorTokenInput };\ninterface ThemeInput {\n colors?: Record<string, ColorTokenInput>;\n typography?: Record<string, object>;\n}\n\n/**\n * Recursively flatten nested color groups into dash-joined, lowercased keys\n * (`{ brand: { 500: '#…' } }` → `brand-500`), parsing each leaf to a normalized\n * color. Arrays are leaves (a pre-normalized `[R,G,B,A]` tuple); strings are\n * leaves; only plain objects recurse.\n */\nfunction flattenColors(\n tokens: Record<string, ColorTokenInput> | undefined,\n prefix: string,\n out: Map<string, NormalizedColor>,\n): void {\n if (!tokens) return;\n for (const [name, token] of Object.entries(tokens)) {\n const key = prefix ? `${prefix}-${name}` : name;\n if (token != null && !Array.isArray(token) && typeof token === 'object') {\n flattenColors(token as Record<string, ColorTokenInput>, key, out);\n } else {\n const color = token as Color;\n out.set(key.toLowerCase(), Array.isArray(color) ? (color as NormalizedColor) : parseColor(color));\n }\n }\n}\n\n/**\n * Registers a project theme: named colors (referenceable by name in any color\n * string) and typography presets (selected via a `Text`/`RichText` `variant`).\n *\n * Color entries take precedence over CSS named colors; nested color groups are\n * flattened to dash-joined names (`{ brand: { 500: … } }` → `brand-500`). Call\n * with no argument, `null`, or an empty object to clear both registries — a\n * document's own `theme` is optional, and a host reading one out of storage\n * (a database column, a JSON file) typically gets that absence back as `null`\n * rather than `undefined`.\n *\n * The `default` typography key is reserved: it's read directly by\n * {@link applyTextDefaults} (not just via `variant`) and applied to every\n * `Text`/`RichText` as a project-wide base style.\n *\n * @example\n * setTheme({\n * colors: { brand: \"#ff6b35\", accent: { 500: \"oklch(70% 0.2 145)\" } },\n * typography: {\n * default: { fontFamily: \"Inter\", fontSize: 32 },\n * header: { fontSize: 96, fontWeight: 700 },\n * },\n * });\n * // Later: fill: \"brand\", fill: \"accent-500\", Text({ variant: \"header\" })\n */\nexport function setTheme(input: ThemeInput | null = {}): void {\n const theme = input ?? {};\n PARSED.clear();\n THEME_COLOR_MAP.clear();\n TYPOGRAPHY_MAP.clear();\n flattenColors(theme.colors, '', THEME_COLOR_MAP);\n if (theme.typography) {\n for (const [name, preset] of Object.entries(theme.typography)) {\n // Stored opaquely; `applyTextDefaults` reads fields by key. The `object`\n // preset is widened to the readable record shape at this boundary only.\n TYPOGRAPHY_MAP.set(name.toLowerCase(), preset as Record<string, unknown>);\n }\n }\n}\n\n/** Looks up a registered typography preset by variant name (case-insensitive);\n * `undefined` if none is registered. */\nexport function getTypographyPreset(name: string): Record<string, unknown> | undefined {\n return TYPOGRAPHY_MAP.get(name.toLowerCase());\n}\n\n/** Looks up a color name in the theme map first, then the CSS named-color table. */\nfunction parseNamedColor(str: string): NormalizedColor | null {\n return THEME_COLOR_MAP.get(str) ?? CSS_COLOR_MAP.get(str) ?? null;\n}\n\n/** Parses `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` hex strings. */\nfunction parseHex(str: string): NormalizedColor | null {\n if (!str.startsWith('#')) return null;\n let hex = str.slice(1);\n if (!/^[0-9a-f]+$/.test(hex)) return null;\n // Expand shorthand: #RGB → #RRGGBB, #RGBA → #RRGGBBAA\n if (hex.length === 3 || hex.length === 4)\n hex = hex.split('').map(c => c + c).join('');\n const int = parseInt(hex, 16);\n if (hex.length === 6)\n return [(int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255, 1];\n if (hex.length === 8)\n return [(int >>> 24) / 255, (int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255];\n return null;\n}\n\n/** Parses `rgb()` / `rgba()` — both percentage and 0-255 channel forms. */\nfunction parseRgb(str: string): NormalizedColor | null {\n const m = str.match(/^rgba?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const [r, g, b] = args.tokens.map(t => readChannel(t, 1, 255));\n return finiteColor([r, g, b, args.alpha]);\n}\n\n/** Parses `hsl()` / `hsla()`. The hue takes `deg`, `grad`, `rad` or `turn` (a bare number is degrees). */\nfunction parseHsl(str: string): NormalizedColor | null {\n const m = str.match(/^hsla?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const h = readHue(args.tokens[0]);\n const s = parseFloat(args.tokens[1]) / 100;\n const l = parseFloat(args.tokens[2]) / 100;\n const k = (n: number) => (((n + h / 30) % 12) + 12) % 12;\n const chroma = s * Math.min(l, 1 - l);\n const f = (n: number) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\n return finiteColor([f(0), f(8), f(4), args.alpha]);\n}\n\n/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */\nfunction parseLab(str: string): NormalizedColor | null {\n const m = str.match(/^lab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const a = parseFloat(args.tokens[1]);\n const b = parseFloat(args.tokens[2]);\n return finiteColor(labToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */\nfunction parseLch(str: string): NormalizedColor | null {\n const m = str.match(/^lch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const C = parseFloat(args.tokens[1]);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n/** Parses `oklab(L a b)` (Oklab perceptually uniform color space). */\nfunction parseOklab(str: string): NormalizedColor | null {\n const m = str.match(/^oklab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.\n const [L, a, b] = [readChannel(args.tokens[0], 1), readChannel(args.tokens[1], 0.4), readChannel(args.tokens[2], 0.4)];\n return finiteColor(oklabToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `oklch(L C H)` (polar form of Oklab). */\nfunction parseOklch(str: string): NormalizedColor | null {\n const m = str.match(/^oklch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).\n const L = readChannel(args.tokens[0], 1);\n const C = readChannel(args.tokens[1], 0.4);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n// ── CIE conversion helpers ────────────────────────────────────────────────────\n\n/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */\nfunction labToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const e = 0.008856, k = 903.3;\n const fy = (L + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const X = (fx ** 3 > e ? fx ** 3 : (116 * fx - 16) / k) * 0.95047;\n const Y = L > k * e ? ((L + 16) / 116) ** 3 : L / k;\n const Z = (fz ** 3 > e ? fz ** 3 : (116 * fz - 16) / k) * 1.08883;\n const [lr, lg, lb] = xyzD65ToLinearSrgb(X, Y, Z);\n return linearToSrgb(lr, lg, lb, alpha);\n}\n\n/** Converts Oklab to a normalized sRGB color using the standard Björn Ottosson matrix. */\nfunction oklabToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const l_ = L + 0.3963377774 * a + 0.2158037573 * b;\n const m_ = L - 0.1055613458 * a - 0.0638541728 * b;\n const s_ = L - 0.0894841775 * a - 1.2914855480 * b;\n const l = l_ ** 3, m = m_ ** 3, s = s_ ** 3;\n return linearToSrgb(\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.6956065236 * s,\n alpha,\n );\n}\n\n// ── Opacity suffix ─────────────────────────────────────────────────────────────\n\n/**\n * Splits a Tailwind-style opacity suffix (`\"white/10\"`, `\"primary/90\"`) off the\n * end of a color string. The suffix is a slash followed by a number (optionally\n * with a `%`) interpreted as a percentage 0–100.\n *\n * Only a trailing slash that sits *outside* any parentheses is treated as an\n * opacity modifier, so the internal slash-alpha syntax of `rgb()` / `hsl()`\n * (e.g. `rgb(0 0 255 / 0.25)`) is left untouched.\n *\n * @returns the bare color string and the opacity fraction (1 when absent).\n */\nfunction splitOpacitySuffix(str: string): { color: string; opacity: number } {\n if (str.includes('(')) return { color: str, opacity: 1 };\n const m = str.match(/^(.*[^/])\\/\\s*([\\d.]+)%?$/);\n if (!m) return { color: str, opacity: 1 };\n const pct = parseFloat(m[2]);\n if (!Number.isFinite(pct)) return { color: str, opacity: 1 };\n return { color: m[1].trim(), opacity: Math.max(0, Math.min(1, pct / 100)) };\n}\n\n// ── Main entry point ──────────────────────────────────────────────────────────\n\n/**\n * Parses a CSS color string into a normalized `[R, G, B, A]` array (0.0–1.0).\n *\n * Supported formats: named colors (CSS + theme), hex, rgb/rgba, hsl/hsla,\n * lab, lch, oklab, oklch, plus a Tailwind-style opacity suffix (`\"white/10\"`).\n * Falls back to opaque black and logs a warning for unrecognised input.\n */\nexport function parseColor(cssStr: string): NormalizedColor {\n const known = PARSED.get(cssStr);\n if (known) return known;\n const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());\n const parsed =\n parseNamedColor(str) ??\n parseHex(str) ??\n parseRgb(str) ??\n parseHsl(str) ??\n parseLab(str) ??\n parseLch(str) ??\n parseOklab(str) ??\n parseOklch(str);\n if (!parsed) {\n console.warn(`[Motion Engine] Unsupported color format: \"${cssStr}\". Defaulting to black.`);\n return [0, 0, 0, 1];\n }\n // Clone before applying opacity: named/theme lookups return cached tuples.\n const color: NormalizedColor = opacity !== 1 ? [parsed[0], parsed[1], parsed[2], parsed[3] * opacity] : parsed;\n if (PARSED.size >= PARSED_MAX) PARSED.clear();\n PARSED.set(cssStr, color);\n return color;\n}\n\nconst PARSED_MAX = 16384;\n", "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", "/**\n * From a `d` string to the normal form: the scanner, the parser, the one pen\n * walk, and everything that reads a {@link PathSegment} once it exists.\n *\n * There were **seven** pen walks — one each in `bounds`, `length`, `dash`,\n * `sampler`, `subpath`, `morph` and the editor's vector model — and they\n * disagreed. Four forgot that `Z` returns the cursor to the contour's start, so\n * a relative command after a close resolved against the wrong point. Three kept\n * a single slot for the control point an `S`/`T` reflects, so a `T` following a\n * `C` reflected a cubic's control as if it were a quadratic's. One handled arcs\n * exactly, one as a subdivided chord, one as a single chord, one by dropping\n * them, and one by aborting the parse.\n *\n * Everything downstream takes {@link PathContour}s from here.\n */\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport {\n arcAxisAngles, arcContainsAngle, arcParams, arcPointAtAngle, arcSweepToCubics,\n cubicExtrema, cubicPoint, distance, extractCubicRange, extractQuadRange,\n lerpVector2, lineToCubic, quadExtrema, quadPoint, quadToCubic,\n} from \"./bezier\";\nimport type { Extents } from \"@/layout/bounds\";\nimport type { ArcParams, Cubic, PathContour, PathSegment } from \"./types\";\n\n/** The incremental scanner {@link parseCommands} drives. */\ninterface PathScanner {\n atEnd(): boolean;\n /** The next command letter, consumed, or `null` if a number comes first. */\n takeLetter(): string | null;\n /** Whether a number follows — i.e. whether a coordinate run continues. */\n hasNumber(): boolean;\n takeNumber(): number | null;\n /** A single-character `0`/`1` arc flag, consumed, or `null`. */\n takeFlag(): 0 | 1 | null;\n}\n\n/**\n * The one `d`-string scanner.\n *\n * There were two: a regex split (`/([MmLlHhVvCcSsQqTtAaZz])|(-?[\\d.]+(?:e[-+]?\\d+)?)/`)\n * and a hand-rolled one in the editor model. They accepted different languages —\n * the regex reads `.5.5` as a single token and `parseFloat` then silently keeps\n * only the first half, so `M .5.5` parsed as a move to an undefined y.\n *\n * **It scans on demand rather than tokenizing up front**, because SVG's grammar\n * is not context-free: an arc's `largeArc` and `sweep` are single *characters*,\n * and the spec lets them run together with what follows. A real icon writes\n * `A9.564 9.564 0 0112 6.844`, where `0112` is the flag `0`, the flag `1`, and\n * the coordinate `12` — a number scanner with no idea what it is reading takes\n * it for one number and puts the arc's endpoint 100 units away. Both parsers\n * this replaces had that bug.\n *\n * Deliberately forgiving otherwise. This value comes out of a database column\n * that a previous version of an app — or an author pasting a path in — may have\n * written, and a strict scanner's answer to a malformed tail is to throw away\n * geometry that was rendering fine a moment ago. So a token it can't read ends\n * the scan and keeps everything before it, which degrades to \"the shape is\n * missing its last curve\" instead of \"the node is empty\".\n */\n\n/**\n * Every command letter, including the arcs.\n *\n * `A`/`a` were absent from the editor model's copy of this list, which made its\n * scanner stop dead at the first arc — so a pasted icon (arcs are how every icon\n * set draws a rounded join) lost everything from that point on. The arc is\n * dropped at the *model* boundary now, where it is a deliberate conversion to\n * cubics, rather than here where it was a silent truncation.\n */\nconst COMMAND_LETTERS = \"MmLlHhVvCcSsQqTtAaZz\";\n\nfunction isSeparator(ch: string): boolean {\n return ch === \" \" || ch === \",\" || ch === \"\\t\" || ch === \"\\n\" || ch === \"\\r\";\n}\n\nfunction isDigit(ch: string): boolean {\n return ch >= \"0\" && ch <= \"9\";\n}\n\nfunction createPathScanner(data: string): PathScanner {\n let i = 0;\n\n const skip = () => {\n while (i < data.length && isSeparator(data[i])) i++;\n };\n\n const scanNumber = (): number | null => {\n skip();\n const start = i;\n if (data[i] === \"+\" || data[i] === \"-\") i++;\n while (i < data.length && isDigit(data[i])) i++;\n if (data[i] === \".\") {\n i++;\n while (i < data.length && isDigit(data[i])) i++;\n }\n if (data[i] === \"e\" || data[i] === \"E\") {\n const mark = i;\n i++;\n if (data[i] === \"+\" || data[i] === \"-\") i++;\n if (i < data.length && isDigit(data[i])) {\n while (i < data.length && isDigit(data[i])) i++;\n } else {\n i = mark;\n }\n }\n if (i === start) return null;\n const value = Number(data.slice(start, i));\n if (!Number.isFinite(value)) {\n i = start;\n return null;\n }\n return value;\n };\n\n return {\n atEnd: () => {\n skip();\n return i >= data.length;\n },\n takeLetter: () => {\n skip();\n if (i < data.length && COMMAND_LETTERS.includes(data[i])) return data[i++];\n return null;\n },\n hasNumber: () => {\n skip();\n if (i >= data.length) return false;\n const ch = data[i];\n return isDigit(ch) || ch === \".\" || ch === \"+\" || ch === \"-\";\n },\n takeNumber: scanNumber,\n takeFlag: () => {\n skip();\n // One character, no sign and no decimal point — that is the whole\n // grammar for a flag, and reading it as a number is the bug.\n if (data[i] === \"0\") { i++; return 0; }\n if (data[i] === \"1\") { i++; return 1; }\n return null;\n },\n };\n}\n\nexport function lineSegment(from: Vector2, to: Vector2): PathSegment {\n return { kind: \"line\", from, to };\n}\n\nexport function quadSegment(from: Vector2, c: Vector2, to: Vector2): PathSegment {\n return { kind: \"quad\", from, c, to };\n}\n\nexport function cubicSegment(from: Vector2, c1: Vector2, c2: Vector2, to: Vector2): PathSegment {\n return { kind: \"cubic\", from, c1, c2, to };\n}\n\n/**\n * An arc, or the line it degenerates to.\n *\n * A zero radius or coincident endpoints make the endpoint→center conversion\n * divide by zero, and the SVG spec says both draw as a straight line — so the\n * substitution happens here rather than in each of the four places that would\n * otherwise have to guard.\n */\nexport function arcSegment(\n from: Vector2, to: Vector2,\n rx: number, ry: number, rotation: number, largeArc: 0 | 1, sweep: 0 | 1,\n): PathSegment {\n if (rx === 0 || ry === 0 || (from.x === to.x && from.y === to.y)) {\n return lineSegment(from, to);\n }\n return { kind: \"arc\", from, to, rx, ry, rotation, largeArc, sweep };\n}\n\n/** The ellipse an arc segment names. Cheap, but not free — hoist it in a loop. */\nexport function segmentArc(segment: PathSegment & { kind: \"arc\" }): ArcParams {\n return arcParams(\n segment.from, segment.to,\n segment.rx, segment.ry, segment.rotation, segment.largeArc, segment.sweep,\n );\n}\n\n/** The point at parameter `t` (0..1). */\nexport function segmentPointAt(segment: PathSegment, t: number): Vector2 {\n switch (segment.kind) {\n case \"line\": return lerpVector2(segment.from, segment.to, t);\n case \"quad\": return quadPoint(segment.from, segment.c, segment.to, t);\n case \"cubic\": return cubicPoint(segment.from, segment.c1, segment.c2, segment.to, t);\n case \"arc\": {\n const arc = segmentArc(segment);\n return arcPointAtAngle(arc, arc.theta1 + t * arc.dtheta);\n }\n }\n}\n\nfunction boxOf(points: Vector2[]): Extents {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n for (const p of points) {\n if (p.x < minX) minX = p.x;\n if (p.x > maxX) maxX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.y > maxY) maxY = p.y;\n }\n return { minX, minY, maxX, maxY };\n}\n\n/**\n * The segment's tight box — its own extrema, solved, not its control hull.\n *\n * Closed form on every kind, so this stays cheap enough for `measure()`. The\n * control hull can sit a long way outside the curve: `size` used it\n * and a hugging `Path` was correspondingly too big, while an arc — whose hull it\n * had no way to compute at all — was measured across its chord and came back\n * flat on one axis.\n */\nexport function segmentBounds(segment: PathSegment): Extents {\n switch (segment.kind) {\n case \"line\":\n return boxOf([segment.from, segment.to]);\n case \"quad\": {\n const at = (t: number) => quadPoint(segment.from, segment.c, segment.to, t);\n return boxOf([\n segment.from, segment.to,\n ...quadExtrema(segment.from.x, segment.c.x, segment.to.x).map(at),\n ...quadExtrema(segment.from.y, segment.c.y, segment.to.y).map(at),\n ]);\n }\n case \"cubic\": {\n const at = (t: number) => cubicPoint(segment.from, segment.c1, segment.c2, segment.to, t);\n return boxOf([\n segment.from, segment.to,\n ...cubicExtrema(segment.from.x, segment.c1.x, segment.c2.x, segment.to.x).map(at),\n ...cubicExtrema(segment.from.y, segment.c1.y, segment.c2.y, segment.to.y).map(at),\n ]);\n }\n case \"arc\": {\n const arc = segmentArc(segment);\n const points: Vector2[] = [segment.from, segment.to];\n const angles = arcAxisAngles(arc);\n for (const theta of [...angles.x, ...angles.y]) {\n if (arcContainsAngle(arc, theta)) points.push(arcPointAtAngle(arc, theta));\n }\n return boxOf(points);\n }\n }\n}\n\n/** The segment as cubics. Exact for every kind but `arc`. */\nexport function segmentCubics(segment: PathSegment): Cubic[] {\n switch (segment.kind) {\n case \"line\": return [lineToCubic(segment.from, segment.to)];\n case \"quad\": return [quadToCubic(segment.from, segment.c, segment.to)];\n case \"cubic\": return [{ p0: segment.from, c1: segment.c1, c2: segment.c2, p1: segment.to }];\n case \"arc\": {\n const arc = segmentArc(segment);\n const cubics = arcSweepToCubics(arc, arc.theta1, arc.theta1 + arc.dtheta);\n return cubics.length > 0 ? cubics : [lineToCubic(segment.from, segment.to)];\n }\n }\n}\n\n/**\n * The sub-range `t0..t1` as commands, with no leading move.\n *\n * A sub-range of an arc is still an arc, so it stays one rather than being\n * refitted — the old trim approximated it with cubics through sampled points\n * using a *tangent* formula, which was wrong on top of being lossy.\n */\nexport function segmentSplit(segment: PathSegment, t0: number, t1: number): PathCommand[] {\n switch (segment.kind) {\n case \"line\": {\n const p = lerpVector2(segment.from, segment.to, t1);\n return [{ type: \"L\", x: p.x, y: p.y }];\n }\n case \"quad\": {\n const sub = extractQuadRange(segment.from, segment.c, segment.to, t0, t1);\n return [{ type: \"Q\", x1: sub.cp.x, y1: sub.cp.y, x: sub.to.x, y: sub.to.y }];\n }\n case \"cubic\": {\n const sub = extractCubicRange(segment.from, segment.c1, segment.c2, segment.to, t0, t1);\n return [{ type: \"C\", x1: sub.cp1.x, y1: sub.cp1.y, x2: sub.cp2.x, y2: sub.cp2.y, x: sub.to.x, y: sub.to.y }];\n }\n case \"arc\": {\n const arc = segmentArc(segment);\n const a0 = arc.theta1 + t0 * arc.dtheta;\n const a1 = arc.theta1 + t1 * arc.dtheta;\n const to = arcPointAtAngle(arc, a1);\n return [{\n type: \"A\",\n rx: arc.rx, ry: arc.ry, rotation: segment.rotation,\n largeArc: (Math.abs(a1 - a0) > Math.PI ? 1 : 0) as 0 | 1,\n sweep: segment.sweep,\n x: to.x, y: to.y,\n }];\n }\n }\n}\n\n/**\n * The closing line of a closed contour, when it has any length.\n *\n * Every walk this replaced synthesized this the same way, so one synthesis\n * reproduces all of them.\n */\nexport function closingSegment(contour: PathContour): PathSegment | null {\n if (!contour.closed || contour.segments.length === 0) return null;\n const end = contour.segments[contour.segments.length - 1].to;\n if (Math.abs(end.x - contour.start.x) < 1e-9 && Math.abs(end.y - contour.start.y) < 1e-9) return null;\n return lineSegment(end, contour.start);\n}\n\n/** Every segment of a contour, the implied closing line included. */\nexport function contourSegments(contour: PathContour): PathSegment[] {\n const closing = closingSegment(contour);\n return closing ? [...contour.segments, closing] : contour.segments;\n}\n\n/** The union of every segment's box, or `null` when there is no geometry at all. */\nexport function contourBounds(contours: PathContour[]): Extents | null {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n let seen = false;\n const include = (box: Extents) => {\n seen = true;\n if (box.minX < minX) minX = box.minX;\n if (box.minY < minY) minY = box.minY;\n if (box.maxX > maxX) maxX = box.maxX;\n if (box.maxY > maxY) maxY = box.maxY;\n };\n for (const contour of contours) {\n // A lone `M` still occupies a point. The closing line joins two points\n // already counted, so it never widens the box.\n if (contour.segments.length === 0) {\n include({ minX: contour.start.x, minY: contour.start.y, maxX: contour.start.x, maxY: contour.start.y });\n continue;\n }\n for (const segment of contour.segments) include(segmentBounds(segment));\n }\n return seen ? { minX, minY, maxX, maxY } : null;\n}\n\n/** Straight-line distance between a segment's endpoints — its chord. */\nexport function segmentChord(segment: PathSegment): number {\n return distance(segment.from, segment.to);\n}\n\n/**\n * Parses a `d` string into commands, **as written** — relative stays relative,\n * shorthands stay short, arcs stay arcs.\n *\n * Normalizing here would throw away the one thing a caller might still want the\n * original for (round-tripping a stored string), and {@link contours} resolves\n * all of it one step later anyway.\n */\nexport function parseCommands(d: string): PathCommand[] {\n const scan = createPathScanner(d);\n const commands: PathCommand[] = [];\n let letter: string | null = null;\n\n while (!scan.atEnd()) {\n const next = scan.takeLetter();\n if (next !== null) {\n letter = next;\n } else if (letter === null) {\n // Numbers before any command: nothing says what they mean.\n return commands;\n } else if (letter === \"M\") {\n // The pair after an `M` is an implicit `L` — the one case where a\n // coordinate run continues as a *different* command than its letter.\n letter = \"L\";\n } else if (letter === \"m\") {\n letter = \"l\";\n } else if (letter === \"Z\" || letter === \"z\") {\n // `Z` takes no arguments, so a number after one is a malformed\n // string rather than a repeat.\n return commands;\n }\n\n const upper = letter.toUpperCase();\n const rel = letter !== upper;\n\n if (upper === \"Z\") {\n commands.push({ type: \"Z\" });\n continue;\n }\n\n // `null` anywhere below means the string ran out or turned to garbage\n // mid-command; the partial command is dropped and the rest kept.\n const n = (count: number): number[] | null => {\n const out: number[] = [];\n for (let i = 0; i < count; i++) {\n const value = scan.takeNumber();\n if (value === null) return null;\n out.push(value);\n }\n return out;\n };\n\n switch (upper) {\n case \"M\": case \"L\": case \"T\": {\n const a = n(2);\n if (!a) return commands;\n const type = upper === \"M\" ? \"M\" : upper === \"L\" ? \"L\" : \"T\";\n commands.push({ type: (rel ? type.toLowerCase() : type) as never, x: a[0], y: a[1] });\n break;\n }\n case \"H\": {\n const a = n(1);\n if (!a) return commands;\n commands.push({ type: rel ? \"h\" : \"H\", x: a[0] });\n break;\n }\n case \"V\": {\n const a = n(1);\n if (!a) return commands;\n commands.push({ type: rel ? \"v\" : \"V\", y: a[0] });\n break;\n }\n case \"C\": {\n const a = n(6);\n if (!a) return commands;\n commands.push({ type: rel ? \"c\" : \"C\", x1: a[0], y1: a[1], x2: a[2], y2: a[3], x: a[4], y: a[5] });\n break;\n }\n case \"S\": case \"Q\": {\n const a = n(4);\n if (!a) return commands;\n commands.push(upper === \"S\"\n ? { type: rel ? \"s\" : \"S\", x2: a[0], y2: a[1], x: a[2], y: a[3] }\n : { type: rel ? \"q\" : \"Q\", x1: a[0], y1: a[1], x: a[2], y: a[3] });\n break;\n }\n case \"A\": {\n // The flags are read as single characters, not numbers — see\n // `createPathScanner`.\n const radii = n(3);\n if (!radii) return commands;\n const largeArc = scan.takeFlag();\n const sweep = scan.takeFlag();\n if (largeArc === null || sweep === null) return commands;\n const end = n(2);\n if (!end) return commands;\n commands.push({\n type: rel ? \"a\" : \"A\",\n rx: radii[0], ry: radii[1], rotation: radii[2],\n largeArc, sweep,\n x: end[0], y: end[1],\n });\n break;\n }\n default:\n // An unknown letter: stop rather than guess how many numbers it eats.\n return commands;\n }\n\n if (!scan.hasNumber() && scan.atEnd()) break;\n }\n return commands;\n}\n\n/** Coerce loose {@link PathData} into commands. Nullish is an empty path, not a throw. */\nexport function commands(d: PathData | null | undefined): PathCommand[] {\n if (d == null) return [];\n return typeof d === \"string\" ? parseCommands(d) : d;\n}\n\n/**\n * Contours already walked, keyed by the value they were walked from.\n *\n * `Path.measure` and `Text.measure` re-walk the same `d` every layout pass, and\n * a string key hits by value while an authored `PathCommand[]` hits by\n * reference — so a static path is walked once and a tweened one, whose array is\n * fresh each frame, misses exactly as `morph.ts`'s plan cache does. Bounded and\n * insertion-ordered, so those fresh arrays age out instead of accumulating.\n *\n * The cached list is shared, so treat what comes back as read-only.\n */\nconst CONTOUR_CACHE = new Map<PathData, PathContour[]>();\nconst CONTOUR_CACHE_MAX = 32;\n\n/**\n * Resolves commands into absolute contours of typed segments.\n *\n * The three things every previous walk had to get right, in one place: relative\n * commands resolve against the pen, `Z` returns the pen to the contour's start,\n * and `S`/`T` reflect from **separate** cubic and quadratic slots, each cleared\n * by a command of the other kind.\n */\nexport function contours(d: PathData | null | undefined): PathContour[] {\n if (d == null) return [];\n const cached = CONTOUR_CACHE.get(d);\n if (cached) return cached;\n const walked = walkCommands(commands(d));\n if (CONTOUR_CACHE.size >= CONTOUR_CACHE_MAX) {\n CONTOUR_CACHE.delete(CONTOUR_CACHE.keys().next().value!);\n }\n CONTOUR_CACHE.set(d, walked);\n return walked;\n}\n\n/** {@link contours} without the memo — the walk itself. */\nexport function walkCommands(list: PathCommand[]): PathContour[] {\n const out: PathContour[] = [];\n\n let current: PathContour | null = null;\n let cursor: Vector2 = { x: 0, y: 0 };\n let contourStart: Vector2 = { x: 0, y: 0 };\n let prevCubicCp: Vector2 | null = null;\n let prevQuadCp: Vector2 | null = null;\n\n // Returns rather than assigning, so the compiler can still see that `current`\n // is non-null after a call — a closure that assigned it would defeat that.\n const open = (at: Vector2): PathContour => {\n const contour: PathContour = { start: at, segments: [], closed: false };\n out.push(contour);\n contourStart = at;\n return contour;\n };\n const push = (segment: PathSegment) => {\n // A drawing command before any `M` starts a contour where the pen is,\n // which is the origin. Malformed, but recoverable, and every previous\n // walk did the same.\n if (!current) current = open(cursor);\n current.segments.push(segment);\n };\n\n for (const cmd of list) {\n const rel = cmd.type !== cmd.type.toUpperCase();\n const abs = (x: number, y: number): Vector2 =>\n rel ? { x: cursor.x + x, y: cursor.y + y } : { x, y };\n\n let cubicCp: Vector2 | null = null;\n let quadCp: Vector2 | null = null;\n\n switch (cmd.type) {\n case \"M\": case \"m\": {\n const to = abs(cmd.x, cmd.y);\n current = open(to);\n cursor = to;\n break;\n }\n case \"L\": case \"l\": {\n const to = abs(cmd.x, cmd.y);\n push(lineSegment(cursor, to));\n cursor = to;\n break;\n }\n case \"H\": case \"h\": {\n const to = { x: rel ? cursor.x + cmd.x : cmd.x, y: cursor.y };\n push(lineSegment(cursor, to));\n cursor = to;\n break;\n }\n case \"V\": case \"v\": {\n const to = { x: cursor.x, y: rel ? cursor.y + cmd.y : cmd.y };\n push(lineSegment(cursor, to));\n cursor = to;\n break;\n }\n case \"C\": case \"c\": {\n const c1 = abs(cmd.x1, cmd.y1);\n const c2 = abs(cmd.x2, cmd.y2);\n const to = abs(cmd.x, cmd.y);\n push(cubicSegment(cursor, c1, c2, to));\n cursor = to;\n cubicCp = c2;\n break;\n }\n case \"S\": case \"s\": {\n const c1 = prevCubicCp\n ? { x: 2 * cursor.x - prevCubicCp.x, y: 2 * cursor.y - prevCubicCp.y }\n : cursor;\n const c2 = abs(cmd.x2, cmd.y2);\n const to = abs(cmd.x, cmd.y);\n push(cubicSegment(cursor, c1, c2, to));\n cursor = to;\n cubicCp = c2;\n break;\n }\n case \"Q\": case \"q\": {\n const cp = abs(cmd.x1, cmd.y1);\n const to = abs(cmd.x, cmd.y);\n push(quadSegment(cursor, cp, to));\n cursor = to;\n quadCp = cp;\n break;\n }\n case \"T\": case \"t\": {\n // Annotated because `quadCp` feeds `prevQuadCp` feeds this — a\n // real cycle for inference, unlike `S`, whose slot takes `c2`.\n const cp: Vector2 = prevQuadCp\n ? { x: 2 * cursor.x - prevQuadCp.x, y: 2 * cursor.y - prevQuadCp.y }\n : cursor;\n const to = abs(cmd.x, cmd.y);\n push(quadSegment(cursor, cp, to));\n cursor = to;\n quadCp = cp;\n break;\n }\n case \"A\": case \"a\": {\n const to = abs(cmd.x, cmd.y);\n push(arcSegment(cursor, to, cmd.rx, cmd.ry, cmd.rotation, cmd.largeArc, cmd.sweep));\n cursor = to;\n break;\n }\n case \"Z\": case \"z\": {\n if (current) {\n current.closed = true;\n // The closing line is implied by `closed`, not stored — a\n // stored one would be a zero-length segment whenever the\n // contour already ends where it started, which is most of\n // the time.\n current = null;\n }\n cursor = contourStart;\n break;\n }\n }\n\n // Only a curve leaves a control point behind. Anything else clears both,\n // which is what makes an `S` after a line start from the cursor rather\n // than from a curve three commands back.\n prevCubicCp = cubicCp;\n prevQuadCp = quadCp;\n }\n\n return out;\n}\n\n/** The tight box, or `null` for a path with no geometry at all. */\nexport function bounds(d: PathData | null | undefined): Extents | null {\n return contourBounds(contours(d));\n}\n\n/** {@link bounds} as a size. An empty path is `0 x 0` rather than `null`. */\nexport function size(d: PathData | null | undefined): { width: number; height: number } {\n const box = bounds(d);\n if (!box) return { width: 0, height: 0 };\n return { width: box.maxX - box.minX, height: box.maxY - box.minY };\n}\n", "/**\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", "/**\n * Arc length, and everything measured in it: total length, the sampler, dashing\n * and trimming.\n *\n * Separate from the normal form because it is the expensive half of path\n * geometry and most callers never need it — bounding a path solves extrema in\n * closed form, and `Path.measure` / `Text.measure` run on every layout pass. So\n * flattening happens here, on demand.\n *\n * **One resolution.** There used to be three — 20 steps for\n * `length`, 32 for the trim segments, 50 for the sampler and the\n * dash walker — and `dash` combined two of them, scaling its dash\n * cycle against a length measured at 20 while walking the path at 50. Sharing\n * one number makes `length(d) === sampler(d).length` an invariant rather than a\n * coincidence.\n */\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport { distance } from \"./bezier\";\nimport { contourSegments, contours, segmentPointAt, segmentSplit } from \"./walk\";\nimport type {\n ContourMetric, PathContour, PathFrame, PathMetric, PathSampler, PathSegment, SegmentMetric,\n} from \"./types\";\n\n/** Line segments each curve is flattened into. */\nexport const SAMPLE_STEPS = 50;\n\nfunction flatten(segment: PathSegment): Vector2[] {\n // A line is already a polyline. Skipping the loop matters: a polygon path is\n // all lines, and 50 collinear samples per edge is pure waste.\n if (segment.kind === \"line\") return [segment.from, segment.to];\n const points: Vector2[] = [segment.from];\n for (let i = 1; i < SAMPLE_STEPS; i++) points.push(segmentPointAt(segment, i / SAMPLE_STEPS));\n points.push(segment.to);\n return points;\n}\n\nexport function measureSegment(segment: PathSegment): SegmentMetric {\n const points = flatten(segment);\n const cumulative: number[] = [0];\n let total = 0;\n for (let i = 1; i < points.length; i++) {\n total += distance(points[i - 1], points[i]);\n cumulative.push(total);\n }\n return { segment, points, cumulative, length: total };\n}\n\nexport function measureContours(contours: PathContour[]): PathMetric {\n let total = 0;\n const measured = contours.map((contour) => {\n const metrics = contourSegments(contour).map(measureSegment);\n const length = metrics.reduce((sum, m) => sum + m.length, 0);\n total += length;\n return { contour, metrics, length };\n });\n return { contours: measured, length: total };\n}\n\n/**\n * The parameter `t` at arc-length distance `d` into a segment.\n *\n * Read off the flattened table rather than binary-searched: the table is already\n * built, and a search that re-samples the curve on every probe cost 320 point\n * evaluations per query to answer the same question less consistently — its\n * answer disagreed with the sampler's, which read the same curve off a polyline.\n */\nexport function paramAtDist(metric: SegmentMetric, d: number): number {\n const { cumulative, length } = metric;\n if (length <= 0) return 0;\n if (d <= 0) return 0;\n if (d >= length) return 1;\n\n let lo = 0;\n let hi = cumulative.length - 1;\n while (lo < hi - 1) {\n const mid = (lo + hi) >> 1;\n if (cumulative[mid] <= d) lo = mid;\n else hi = mid;\n }\n const span = cumulative[hi] - cumulative[lo];\n const within = span > 0 ? (d - cumulative[lo]) / span : 0;\n const steps = cumulative.length - 1;\n return (lo + within) / steps;\n}\n\nexport function length(d: PathData | null | undefined): number {\n return measureContours(contours(d)).length;\n}\n\n/**\n * Build a {@link PathSampler} from any {@link PathData}.\n *\n * The tangent is the chord of the flattened segment the distance lands in, not\n * the curve's analytic derivative. Less exact, and deliberately kept: every\n * glyph on every text-on-path is placed with it, so changing it is a visual\n * change that deserves its own commit rather than a side effect of this one.\n */\nexport function sampler(d: PathData): PathSampler {\n const metric = measureContours(contours(d));\n\n // One point list across every contour. The jump from one contour's end to the\n // next one's start carries no length — text does not flow across it, matching\n // SVG `textPath` — so it is recorded as a zero-length step rather than a gap\n // in the table.\n const points: Vector2[] = [];\n const cumulative: number[] = [];\n let total = 0;\n for (const contourMetric of metric.contours) {\n const first = contourMetric.metrics[0]?.segment.from ?? contourMetric.contour.start;\n points.push(first);\n cumulative.push(total);\n for (const segmentMetric of contourMetric.metrics) {\n for (let i = 1; i < segmentMetric.points.length; i++) {\n total += distance(segmentMetric.points[i - 1], segmentMetric.points[i]);\n points.push(segmentMetric.points[i]);\n cumulative.push(total);\n }\n }\n }\n\n let cursor = 0; // last segment index used, for the monotonic fast path.\n\n const frameAt = (d: number): PathFrame | null => {\n if (total <= 0 || points.length < 2) return null;\n const target = Math.max(0, Math.min(total, d));\n\n // Reset the cursor if the caller stepped backwards.\n if (cumulative[cursor] > target) cursor = 0;\n // Advance to the step containing `target`, skipping the zero-length steps\n // that bridge contours so we land on real geometry.\n while (\n cursor < points.length - 2 &&\n (cumulative[cursor + 1] < target || cumulative[cursor + 1] === cumulative[cursor])\n ) {\n cursor++;\n }\n\n const a = points[cursor];\n const b = points[cursor + 1];\n const segStart = cumulative[cursor];\n const segLen = cumulative[cursor + 1] - segStart;\n const t = segLen > 0 ? (target - segStart) / segLen : 0;\n\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const segDist = Math.hypot(dx, dy);\n // Degenerate step: fall back to the point with no meaningful tangent.\n const tx = segDist > 0 ? dx / segDist : 1;\n const ty = segDist > 0 ? dy / segDist : 0;\n\n return { x: a.x + dx * t, y: a.y + dy * t, tx, ty };\n };\n\n return { length: total, frameAt };\n}\n\n/** A contour's flattened polyline. */\nfunction contourPoints(metric: ContourMetric): Vector2[] {\n const first = metric.metrics[0]?.segment.from ?? metric.contour.start;\n const points: Vector2[] = [first];\n for (const segment of metric.metrics) {\n for (let i = 1; i < segment.points.length; i++) points.push(segment.points[i]);\n }\n return points;\n}\n\n/**\n * Walks a flattened subpath at constant speed, emitting `M`/`L` commands for the\n * \"on\" runs of the dash pattern. `scaledDash` alternates on/off lengths starting\n * with \"on\"; the index wraps so the pattern repeats along the whole subpath, and\n * `offset` is how far into it the subpath starts. A zero-length dash is a dot:\n * a run a sliver long along the path, so the cap drawn on it has a direction —\n * including the dots an open subpath is fit to start and end on.\n */\nfunction dashSubpath(points: Vector2[], scaledDash: number[], offset: number, closed: boolean): string {\n if (points.length < 2) return '';\n\n const cycle = scaledDash.reduce((a, b) => a + b, 0);\n const sliver = cycle * 1e-4;\n const tolerance = cycle * 1e-9;\n const into = ((offset % cycle) + cycle) % cycle;\n let dashIndex = 0;\n let passed = 0;\n while (passed + scaledDash[dashIndex] <= into) {\n if (scaledDash[dashIndex] === 0 && into - passed <= tolerance) break;\n passed += scaledDash[dashIndex];\n dashIndex = (dashIndex + 1) % scaledDash.length;\n if (dashIndex === 0) break;\n }\n\n const parts: string[] = [];\n let remaining = scaledDash[dashIndex] - (into - passed); // Distance left in the current dash segment.\n let isOn = dashIndex % 2 === 0; // Whether we're currently drawing (on) or skipping (off).\n let needMove = true; // Whether the next \"on\" run still needs an opening M.\n let last: { point: Vector2; x: number; y: number } | null = null;\n\n for (let i = 1; i < points.length; i++) {\n const p0 = points[i - 1];\n const p1 = points[i];\n const dx = p1.x - p0.x;\n const dy = p1.y - p0.y;\n const segLen = distance(p0, p1);\n\n if (segLen === 0) continue;\n last = { point: p1, x: dx / segLen, y: dy / segLen };\n\n let walked = 0;\n\n while (walked < segLen) {\n const available = segLen - walked;\n\n if (remaining >= available) {\n if (isOn) {\n if (needMove) {\n const t = walked / segLen;\n parts.push(`M ${p0.x + t * dx} ${p0.y + t * dy}`);\n needMove = false;\n }\n parts.push(`L ${p1.x} ${p1.y}`);\n }\n remaining -= available;\n walked = segLen;\n\n if (remaining <= tolerance) {\n dashIndex = (dashIndex + 1) % scaledDash.length;\n isOn = !isOn;\n remaining = scaledDash[dashIndex];\n if (isOn) needMove = true;\n }\n } else {\n const endT = (walked + remaining) / segLen;\n const endX = p0.x + endT * dx;\n const endY = p0.y + endT * dy;\n\n if (isOn) {\n if (needMove) {\n const startT = walked / segLen;\n parts.push(`M ${p0.x + startT * dx} ${p0.y + startT * dy}`);\n needMove = false;\n }\n const reach = remaining > 0 ? 0 : sliver / segLen;\n parts.push(`L ${endX + reach * dx} ${endY + reach * dy}`);\n }\n\n walked += remaining;\n dashIndex = (dashIndex + 1) % scaledDash.length;\n isOn = !isOn;\n remaining = scaledDash[dashIndex];\n if (isOn) needMove = true;\n }\n }\n }\n\n if (!closed && isOn && remaining <= tolerance && last) {\n const { point, x, y } = last;\n parts.push(`M ${point.x} ${point.y} L ${point.x - x * sliver} ${point.y - y * sliver}`);\n }\n\n return parts.join(' ');\n}\n\n/**\n * How far `pattern` is stretched to fit one contour of a path `total` long —\n * the renderer's rule as well as {@link dash}'s. A closed contour is fit with\n * the rest of the path, to whole cycles of `total`; an open one is fit alone to\n * whole cycles less the final gap, so it starts and ends on a dash. An odd\n * pattern alternates across cycles, has no final gap to drop, and fits as\n * closed. `null` when there is nothing to fit.\n */\nexport function dashScale(\n pattern: number[],\n contour: { length: number; closed: boolean },\n total: number,\n): number | null {\n const cycle = pattern.reduce((a, b) => a + b, 0);\n if (cycle <= 0 || total <= 0) return null;\n if (!contour.closed && contour.length > 0 && pattern.length % 2 === 0) {\n const lastGap = pattern[pattern.length - 1];\n const span = Math.max(1, Math.round((contour.length + lastGap) / cycle)) * cycle - lastGap;\n if (span > 0) return contour.length / span;\n }\n return total / (Math.max(1, Math.round(total / cycle)) * cycle);\n}\n\n/**\n * Converts path geometry into a dashed SVG path string, each contour fit by\n * {@link dashScale} and starting `offset` into the pattern, as the renderer\n * dashes a stroke.\n *\n * @param d The path to dash.\n * @param dash Alternating on/off lengths (e.g. `[4, 2]` = 4 on, 2 off).\n * @returns An SVG path `d` string containing only the visible dash segments,\n * or `''` when there is nothing to draw.\n */\nexport function dash(d: PathData | null | undefined, dash: number[], offset = 0): string {\n if (!dash || dash.length === 0) return '';\n\n const metric = measureContours(contours(d));\n const runs: string[] = [];\n for (const contour of metric.contours) {\n const scale = dashScale(dash, { length: contour.length, closed: contour.contour.closed }, metric.length);\n if (scale === null) return '';\n const run = dashSubpath(\n contourPoints(contour), dash.map(value => value * scale), offset * scale, contour.contour.closed,\n );\n if (run) runs.push(run);\n }\n return runs.join(' ');\n}\n\n/**\n * The portion of `d` between the normalized arc-length fractions `start` and\n * `end` (both 0..1), as a fresh command list.\n *\n * A full `0..1` range or an empty path is returned unchanged; an empty or\n * inverted range returns `[]`.\n */\nexport function trim(d: PathData, start: number, end: number): PathData {\n if (start === 0 && end === 1) return d;\n\n const s = Math.max(0, Math.min(1, start));\n const e = Math.max(s, Math.min(1, end));\n if (s === 0 && e === 1) return d;\n if (s >= e) return [];\n\n const metric = measureContours(contours(d));\n if (metric.length === 0) return d;\n\n const startDist = s * metric.length;\n const endDist = e * metric.length;\n\n const result: PathCommand[] = [];\n let accumulated = 0;\n\n for (const contour of metric.contours) {\n // Each contour opens its own `M`. Sharing one across all of them — which\n // is what a single flat segment list did — draws a line across the gap\n // between two contours that the source never had.\n let needsMove = true;\n\n for (const metricEntry of contour.metrics) {\n const { segment, length } = metricEntry;\n const segEnd = accumulated + length;\n if (length === 0 || segEnd <= startDist || accumulated >= endDist) {\n accumulated = segEnd;\n continue;\n }\n\n const t0 = accumulated < startDist ? paramAtDist(metricEntry, startDist - accumulated) : 0;\n const t1 = segEnd > endDist ? paramAtDist(metricEntry, endDist - accumulated) : 1;\n\n if (needsMove) {\n const p = segmentPointAt(segment, t0);\n result.push({ type: \"M\", x: p.x, y: p.y });\n needsMove = false;\n }\n result.push(...segmentSplit(segment, t0, t1));\n accumulated = segEnd;\n }\n }\n\n return result;\n}\n", "/**\n * Path morphing — smooth interpolation between two arbitrary path shapes.\n *\n * Lerping two SVG paths command-by-command only works when they happen to share\n * the same command structure; in general one path is a triangle and the other a\n * star with a different number of points, different command types, a different\n * start point, and the opposite winding. Naively pairing commands produces\n * kinks, self-intersections, and points that fly across the canvas.\n *\n * This module reshapes both paths into a common, directly-interpolatable form —\n * the same approach GSAP's MorphSVGPlugin uses:\n *\n * 1. {@link cubics} converts each path into a list of {@link CubicSubpath}s.\n * Every drawing command (L/H/V/Q/A/Z-close) is rewritten as a cubic Bézier, so\n * a subpath becomes a uniform chain of cubics described purely by anchor and\n * control points.\n * 2. {@link plan} pairs the two paths' subpaths (padding the shorter side\n * with degenerate, collapsed subpaths so every subpath has a partner),\n * equalizes the number of cubics in each pair by subdividing the coarser\n * subpath along its perimeter, and — for closed rings — rotates and optionally\n * reverses one ring so the two start at the same place and wind the same way.\n * 3. {@link lerpPathData} samples that aligned correspondence at a given `t`,\n * interpolating every control point with {@link lerpVector2}.\n *\n * The result is a {@link PathCommand} list (one `M` + N `C`s per subpath) that the\n * existing renderer draws unchanged.\n */\nimport { Vector2, lerpVector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport { distance, cubicPoint } from \"./bezier\";\nimport { commands, contourSegments, contours, segmentCubics } from \"./walk\";\nimport type { Cubic, CubicSubpath, MorphPlan } from \"./types\";\n\n/**\n * A path as cubic subpaths — one of the two boundaries where geometry is\n * deliberately flattened to a single curve type.\n *\n * A morph has to pair segments up and interpolate them, which needs both sides\n * speaking one language, so an arc becomes cubics here (and only here, and in\n * the anchor model). This used to carry the sixth copy of the pen walk; the one\n * thing it got wrong that the shared walk does not is `Z`, which it marked\n * without closing the run — so `M0 0 L10 0 Z L20 0` came back as one subpath\n * where SVG says two.\n */\nexport function cubics(d: PathData | null | undefined): CubicSubpath[] {\n const out: CubicSubpath[] = [];\n for (const contour of contours(d)) {\n // A lone `M` has nothing to interpolate: it draws nothing and has no\n // first anchor to seed a partner from, so it is not a subpath here. It\n // stays in `contours`, where it still occupies a point of the bounds.\n const chain = contourSegments(contour).flatMap(segmentCubics);\n if (chain.length === 0) continue;\n // `contours` is memoized and shared, so hand out copies of its points: a\n // caller moving an anchor of the result must not move the cached path.\n out.push({\n cubics: chain.map((c) => ({ p0: { ...c.p0 }, c1: { ...c.c1 }, c2: { ...c.c2 }, p1: { ...c.p1 } })),\n closed: contour.closed,\n });\n }\n return out;\n}\n\n/** First anchor of a subpath (the implicit `M` target). */\nfunction startPoint(cubics: Cubic[]): Vector2 {\n return cubics[0].p0;\n}\n\n/** Approximate length of a cubic by flattening — cheap, used only for weighting. */\nfunction cubicLength(c: Cubic, steps = 8): number {\n let len = 0;\n let prev = c.p0;\n for (let i = 1; i <= steps; i++) {\n const p = cubicPoint(c.p0, c.c1, c.c2, c.p1, i / steps);\n len += distance(prev, p);\n prev = p;\n }\n return len;\n}\n\n/** Centroid of a subpath's anchor points — used to pair subpaths by proximity. */\nfunction centroid(cubics: Cubic[]): Vector2 {\n let x = 0, y = 0;\n for (const c of cubics) { x += c.p0.x; y += c.p0.y; }\n return { x: x / cubics.length, y: y / cubics.length };\n}\n\n// --- Subdivision: grow a subpath to a target number of cubics ---------------\n\n/** Split one cubic at parameter `t` into two cubics tracing the same curve (De Casteljau). */\nfunction splitCubic(c: Cubic, t: number): [Cubic, Cubic] {\n const a = lerpVector2(c.p0, c.c1, t);\n const b = lerpVector2(c.c1, c.c2, t);\n const d = lerpVector2(c.c2, c.p1, t);\n const e = lerpVector2(a, b, t);\n const f = lerpVector2(b, d, t);\n const g = lerpVector2(e, f, t);\n return [\n { p0: c.p0, c1: a, c2: e, p1: g },\n { p0: g, c1: f, c2: d, p1: c.p1 },\n ];\n}\n\n/**\n * Subdivide `cubics` until it has exactly `target` cubics (target ≥ current).\n * Splits are spread across the longest segments first so the added anchor points\n * land roughly evenly along the perimeter — the key to a smooth morph, since each\n * added point becomes a correspondence point with the other shape.\n */\nfunction subdivideTo(cubics: Cubic[], target: number): Cubic[] {\n let work = cubics.slice();\n while (work.length < target) {\n // Find the longest cubic and split it in half.\n let longest = 0;\n let maxLen = -1;\n for (let i = 0; i < work.length; i++) {\n const len = cubicLength(work[i]);\n if (len > maxLen) { maxLen = len; longest = i; }\n }\n const [left, right] = splitCubic(work[longest], 0.5);\n work.splice(longest, 1, left, right);\n }\n return work;\n}\n\n// --- Ring alignment: rotate + reverse a closed subpath ----------------------\n\n/** Reverse a chain of cubics so it traces the same shape in the opposite direction. */\nfunction reverseCubics(cubics: Cubic[]): Cubic[] {\n const out: Cubic[] = [];\n for (let i = cubics.length - 1; i >= 0; i--) {\n const c = cubics[i];\n out.push({ p0: c.p1, c1: c.c2, c2: c.c1, p1: c.p0 });\n }\n return out;\n}\n\n/** Rotate a closed ring so it begins at cubic index `offset` (wraps around). */\nfunction rotateCubics(cubics: Cubic[], offset: number): Cubic[] {\n if (offset === 0) return cubics.slice();\n return cubics.slice(offset).concat(cubics.slice(0, offset));\n}\n\n/** Sum of squared distances between paired anchor points — the alignment cost. */\nfunction anchorCost(a: Cubic[], b: Cubic[]): number {\n let cost = 0;\n for (let i = 0; i < a.length; i++) {\n const dx = a[i].p0.x - b[i].p0.x;\n const dy = a[i].p0.y - b[i].p0.y;\n cost += dx * dx + dy * dy;\n }\n return cost;\n}\n\n/**\n * Align a closed `to` ring against a fixed `from` ring (same cubic count). Tries\n * every rotation offset, in both winding directions, and keeps whichever pairs the\n * anchor points with the least total travel. This is what lets two shapes whose\n * points are listed in any order — or that wind in opposite directions — morph\n * without spinning or folding through themselves.\n */\nfunction alignClosedRing(from: Cubic[], to: Cubic[]): Cubic[] {\n const n = from.length;\n let best = to;\n let bestCost = Infinity;\n\n for (const candidate of [to, reverseCubics(to)]) {\n for (let offset = 0; offset < n; offset++) {\n const rotated = rotateCubics(candidate, offset);\n const cost = anchorCost(from, rotated);\n if (cost < bestCost) {\n bestCost = cost;\n best = rotated;\n }\n }\n }\n return best;\n}\n\n/**\n * For an open subpath, only the winding can be flipped (rotation would change the\n * shape). Pick the direction whose endpoints best match the `from` subpath.\n */\nfunction alignOpenSubpath(from: Cubic[], to: Cubic[]): Cubic[] {\n const reversed = reverseCubics(to);\n return anchorCost(from, to) <= anchorCost(from, reversed) ? to : reversed;\n}\n\n// --- Degenerate subpaths (for count mismatches) -----------------------------\n\n/**\n * A subpath collapsed onto a single point `at`, with `count` zero-length cubics.\n * Pairing a real subpath with one of these makes it grow out of / shrink into a\n * point, which is how added or removed subpaths animate.\n */\nfunction degenerateSubpath(at: Vector2, count: number): Cubic[] {\n const cubics: Cubic[] = [];\n for (let i = 0; i < count; i++) {\n cubics.push({ p0: { ...at }, c1: { ...at }, c2: { ...at }, p1: { ...at } });\n }\n return cubics;\n}\n\n// --- Subpath pairing --------------------------------------------------------\n\n/**\n * Greedily pair `from` subpaths with the nearest unused `to` subpath (by centroid),\n * so morphing maps each shape onto its closest counterpart rather than by list\n * order. Leftover subpaths on either side are paired with a degenerate partner\n * collapsed at their own centroid, so they grow/shrink in place.\n */\nfunction pairSubpaths(\n fromSubs: CubicSubpath[],\n toSubs: CubicSubpath[],\n): Array<{ from: CubicSubpath; to: CubicSubpath }> {\n const pairs: Array<{ from: CubicSubpath; to: CubicSubpath }> = [];\n const toUsed = new Array(toSubs.length).fill(false);\n\n for (const f of fromSubs) {\n const fc = centroid(f.cubics);\n let bestIdx = -1;\n let bestDist = Infinity;\n for (let j = 0; j < toSubs.length; j++) {\n if (toUsed[j]) continue;\n const d = distance(fc, centroid(toSubs[j].cubics));\n if (d < bestDist) { bestDist = d; bestIdx = j; }\n }\n if (bestIdx >= 0) {\n toUsed[bestIdx] = true;\n pairs.push({ from: f, to: toSubs[bestIdx] });\n } else {\n // No `to` subpath left → collapse to this subpath's own centroid.\n pairs.push({\n from: f,\n to: { cubics: degenerateSubpath(fc, f.cubics.length), closed: f.closed },\n });\n }\n }\n\n // Any unused `to` subpaths grow out of their own centroid.\n for (let j = 0; j < toSubs.length; j++) {\n if (toUsed[j]) continue;\n const t = toSubs[j];\n const tc = centroid(t.cubics);\n pairs.push({\n from: { cubics: degenerateSubpath(tc, t.cubics.length), closed: t.closed },\n to: t,\n });\n }\n\n return pairs;\n}\n\n// --- Building the morph plan ------------------------------------------------\n\n/**\n * Build a reusable {@link MorphPlan} aligning `from` to `to`. All the expensive\n * work — converting to cubics, pairing subpaths, equalizing counts, and rotating\n * rings — happens here once; {@link sample} then samples it cheaply per frame.\n */\nexport function plan(from: PathCommand[], to: PathCommand[]): MorphPlan {\n const fromSubs = cubics(from);\n const toSubs = cubics(to);\n\n // Both empty → nothing to morph.\n if (fromSubs.length === 0 && toSubs.length === 0) {\n return { pairs: [] };\n }\n\n // One side empty → collapse/grow the other against a point at its start.\n if (fromSubs.length === 0) {\n const seed = startPoint(toSubs[0].cubics);\n fromSubs.push({ cubics: degenerateSubpath(seed, 1), closed: toSubs[0].closed });\n }\n if (toSubs.length === 0) {\n const seed = startPoint(fromSubs[0].cubics);\n toSubs.push({ cubics: degenerateSubpath(seed, 1), closed: fromSubs[0].closed });\n }\n\n const subPairs = pairSubpaths(fromSubs, toSubs);\n\n const pairs = subPairs.map(({ from: f, to: t }) => {\n // Equalize cubic counts by subdividing the coarser side.\n const count = Math.max(f.cubics.length, t.cubics.length);\n const fromCubics = subdivideTo(f.cubics, count);\n let toCubics = subdivideTo(t.cubics, count);\n\n // Align the `to` side to the `from` side so points correspond and travel\n // the shortest path. Closed rings can rotate + reverse; open paths only\n // reverse (rotating an open path would tear it).\n const bothClosed = f.closed && t.closed;\n toCubics = bothClosed\n ? alignClosedRing(fromCubics, toCubics)\n : alignOpenSubpath(fromCubics, toCubics);\n\n return { from: fromCubics, to: toCubics, closed: bothClosed };\n });\n\n return { pairs };\n}\n\n// --- Sampling ---------------------------------------------------------------\n\n/** Interpolate a single cubic's four points. */\nfunction lerpCubic(from: Cubic, to: Cubic, t: number): Cubic {\n return {\n p0: lerpVector2(from.p0, to.p0, t),\n c1: lerpVector2(from.c1, to.c1, t),\n c2: lerpVector2(from.c2, to.c2, t),\n p1: lerpVector2(from.p1, to.p1, t),\n };\n}\n\n/**\n * Sample a {@link MorphPlan} at progress `t` (0 → `from`, 1 → `to`), producing a\n * fresh {@link PathCommand} list: one `M`, one `C` per cubic, and a trailing `Z`\n * for closed subpaths.\n *\n * Closed subpaths emit `Z` rather than a final line back to the start. The ring's\n * last cubic already lands on its first anchor, so `Z` adds no length; what it does\n * is tell the renderer the contour is closed, which is what makes the stroke join\n * cleanly at the seam instead of drawing two unjoined end caps there.\n */\nexport function sample(plan: MorphPlan, t: number): PathCommand[] {\n const out: PathCommand[] = [];\n for (const pair of plan.pairs) {\n const n = pair.from.length;\n if (n === 0) continue;\n const first = lerpCubic(pair.from[0], pair.to[0], t);\n out.push({ type: \"M\", x: first.p0.x, y: first.p0.y });\n out.push({ type: \"C\", x1: first.c1.x, y1: first.c1.y, x2: first.c2.x, y2: first.c2.y, x: first.p1.x, y: first.p1.y });\n for (let i = 1; i < n; i++) {\n const c = lerpCubic(pair.from[i], pair.to[i], t);\n out.push({ type: \"C\", x1: c.c1.x, y1: c.c1.y, x2: c.c2.x, y2: c.c2.y, x: c.p1.x, y: c.p1.y });\n }\n if (pair.closed) out.push({ type: \"Z\" });\n }\n return out;\n}\n\n// --- Public tween entry point ----------------------------------------------\n\n/**\n * The morph plan is built from a `(from, to)` pair, which is constant for the\n * duration of one tween while `t` sweeps 0→1. {@link lerp} is invoked once\n * per frame with that same pair, so we cache the most recent plan to avoid\n * rebuilding it (subdivision + ring alignment is the costly part) every frame.\n * A one-entry cache is enough: tweens run one at a time per property and call us\n * with monotonically advancing `t` against fixed endpoints.\n */\nlet cachedPlan: { from: PathData; to: PathData; plan: MorphPlan } | null = null;\n\nfunction planFor(from: PathData, to: PathData): MorphPlan {\n if (cachedPlan && cachedPlan.from === from && cachedPlan.to === to) {\n return cachedPlan.plan;\n }\n const built = plan(commands(from), commands(to));\n cachedPlan = { from, to, plan: built };\n return built;\n}\n\n/**\n * Smoothly interpolate between two path shapes — the {@link PathData} tween used\n * by `Path`'s animatable `d` property and usable directly as a `LerpFunction`.\n *\n * `from`/`to` may be SVG `d` strings or {@link PathCommand} arrays and need not\n * share structure, command count, subpath count, point order, or winding — the\n * shapes are reconciled into a common cubic correspondence first (see the module\n * overview). At `t = 0` and `t = 1` the endpoints are returned verbatim so the\n * start and end frames are pixel-exact; in between, a morphed command list is\n * produced.\n *\n * @param from Source path (the shape at `t = 0`).\n * @param to Target path (the shape at `t = 1`).\n * @param t Progress in `[0, 1]`.\n */\nexport function lerp(from: PathData, to: PathData, t: number): PathData {\n if (t <= 0) return from;\n if (t >= 1) return to;\n return sample(planFor(from, to), t);\n}\n", "/**\n * Every path-geometry operation, on one object.\n *\n * `pathOps` was already the path attribute's `resolve`/`lerp` pair; it now\n * carries the rest, which is the repo's existing shape for an attribute whose\n * operations go past interpolation — `insetsOps` is `AttributeOps & InsetsOps`,\n * `alignmentOps` is `AttributeOps & AlignmentOps`, `cornerRadiusOps` the same.\n * Every `Types.path` entry is untouched by the addition.\n *\n * Behind it is **one** pen walk. There were seven — one each in `bounds`,\n * `length`, `dash`, `sampler`, `subpath`, `morph` and the editor's vector model\n * — and they disagreed about where `Z` leaves the cursor, which control point an\n * `S`/`T` reflects, and what an arc is. The pipeline is now:\n *\n * PathData ── commands ──▶ PathCommand[] ── contours ──▶ PathContour[]\n * │\n * bounds · size · length · sampler · dash · trim ◀─────┤\n * cubics ── morph ◀──────────┤\n * anchors ── editing ◀────────┘\n *\n * `cubics` and `anchors` are the only two places geometry is flattened to a\n * single curve type, because a morph needs one segment kind to pair up and\n * nobody can drag an arc's handles. Everything that measures keeps the arc.\n *\n * Each method is the module function of the same name, so a call site and its\n * implementation are one grep apart.\n */\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\nimport { bounds, commands, contours, size } from \"./walk\";\nimport { dash, dashScale, length, sampler, trim } from \"./measure\";\nimport { cubics, lerp, plan, sample } from \"./morph\";\nimport {\n anchorBounds, anchorCommands, anchors, endFit, fitToBox, fromAnchors,\n isEmpty, map, normalize, pointOn, split, translate,\n} from \"./anchors\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { Extents } from \"@/layout/bounds\";\nimport { PathContour, CubicSubpath, VectorPath, PathSampler, MorphPlan, PathNormalization, PathAnchor } from \"./types\";\n\n\n/** The path attribute's operations beyond `resolve`/`lerp`. */\nexport interface PathOps {\n // ── Reading ────────────────────────────────────────────────────────────\n /** Parse. A `PathCommand[]` passes through by reference; nullish gives `[]`. */\n commands(d: PathData | null | undefined): PathCommand[];\n /** The normal form: absolute, shorthands expanded, grouped into contours. */\n contours(d: PathData | null | undefined): PathContour[];\n /** All-cubic form. Lossy for arcs — one of the two flattening boundaries. */\n cubics(d: PathData | null | undefined): CubicSubpath[];\n /** The editable anchor model. Lossy for arcs — the other boundary. */\n anchors(d: PathData | null | undefined): VectorPath;\n\n // ── Measuring ──────────────────────────────────────────────────────────\n /** Tight box: each segment's own extrema, not its control hull. */\n bounds(d: PathData | null | undefined): Extents | null;\n /** {@link bounds} as a size; `0 x 0` for an empty path. */\n size(d: PathData | null | undefined): { width: number; height: number };\n /** Total arc length. An arc is measured along the arc, not across its chord. */\n length(d: PathData | null | undefined): number;\n /** Point and unit tangent at a distance along the path. */\n sampler(d: PathData): PathSampler;\n\n // ── Rewriting ──────────────────────────────────────────────────────────\n /** The portion between two arc-length fractions. Works on strings. */\n trim(d: PathData, start: number, end: number): PathData;\n /** Only the \"on\" runs of a dash pattern, fit as the renderer fits it, as a `d` string. */\n dash(d: PathData | null | undefined, pattern: number[], offset?: number): string;\n /** How far a pattern is stretched to fit one contour of a path — see `dash`. */\n dashScale(pattern: number[], contour: { length: number; closed: boolean }, total: number): number | null;\n\n // ── Morphing ───────────────────────────────────────────────────────────\n /** A reusable correspondence between two paths. Expensive; `lerp` caches one. */\n plan(from: PathCommand[], to: PathCommand[]): MorphPlan;\n /** Sample a plan at `t`. Cheap. */\n sample(plan: MorphPlan, t: number): PathCommand[];\n\n // ── The anchor model ───────────────────────────────────────────────────\n /** Anchors back to a `d` string. Emits only `M`/`L`/`C`/`Z`. */\n fromAnchors(path: VectorPath): string;\n /** Anchors to commands, with a transform folded into the same pass. */\n anchorCommands(path: VectorPath, transform?: (p: Vector2) => Vector2): PathCommand[];\n /** Tight box of an anchor path. */\n anchorBounds(path: VectorPath): Extents | null;\n /** Every point and handle mapped. */\n map(path: VectorPath, fn: (p: Vector2) => Vector2): VectorPath;\n translate(path: VectorPath, delta: Vector2): VectorPath;\n /** The turn-and-scale about `start` carrying `end` onto `to` — a `map` fn. */\n endFit(start: Vector2, end: Vector2, to: Vector2): (p: Vector2) => Vector2;\n isEmpty(path: VectorPath): boolean;\n\n // ── The unit box ───────────────────────────────────────────────────────\n /** Re-quote against the geometry's own bounds. */\n normalize(path: VectorPath): PathNormalization;\n /** Re-quote against a stated box — the general form of {@link PathOps.normalize}. */\n fitToBox(path: VectorPath, box: Extents): PathNormalization;\n /** A point on the segment between two anchors, for hit-testing an insert. */\n pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2;\n /** De Casteljau split, so inserting an anchor does not move the curve. */\n split(from: PathAnchor, to: PathAnchor, t: number): { from: PathAnchor; middle: PathAnchor; to: PathAnchor };\n}\n\n\nexport const pathOps: AttributeOps<PathData, PathData> & PathOps = {\n // An SVG path string or command list needs no normalization.\n resolve: (value) => value,\n lerp,\n\n commands,\n contours,\n cubics,\n anchors,\n\n bounds,\n size,\n length,\n sampler,\n\n trim,\n dash,\n dashScale,\n\n plan,\n sample,\n\n fromAnchors,\n anchorCommands,\n anchorBounds,\n map,\n translate,\n endFit,\n isEmpty,\n\n normalize,\n fitToBox,\n pointOn,\n split,\n};\n", "/**\n * The silhouette of every shape type, as a {@link VectorPath}.\n *\n * One module, two callers with the same question asked at different scales:\n *\n * - The **shape node classes** (`nodes/shapes`) draw their outline every frame\n * from their laid-out box, so they ask in pixels.\n * - The **path editor** converts a shape into an editable Path node the moment\n * somebody moves one of its points, so it asks in the unit box the Path node\n * stores its geometry in (see `./vector-path`).\n *\n * Sharing the definition is what makes that conversion invisible: a triangle\n * that becomes a path is the *same* triangle, down to the rounding on its\n * corners, rather than a fresh approximation of one.\n *\n * ## Why these shapes exist at all\n *\n * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices\n * sit on the box's inscribed ellipse — which is what makes a `sides` tween\n * smooth: every vertex count is the same circle sampled differently, so a\n * triangle morphing into a square doesn't lurch. The cost is that a triangle\n * *doesn't touch the bottom of its own bounds*, because the two base vertices\n * sit at 30° below the horizontal rather than on the ellipse's lowest point.\n * Figma's polygon does exactly the same thing for exactly the same reason.\n *\n * That is right for a shape you intend to animate and wrong for a shape you\n * intend to *be a triangle*. So the parametric `polygon`/`polygram` keep the\n * inscribed geometry, and the named shapes here are stretched to fill their box\n * — the vertices are computed on the circle exactly as before, then their\n * bounding box is mapped onto the node's. Same silhouette, no gap.\n *\n * Everything here works in **y-down** coordinates, the convention the stored\n * `d` string uses. The node classes flip once on the way to the renderer, whose\n * local space is y-up.\n */\n\nimport type { CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\nimport type { CornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { distance } from \"@/attributes/shape/path/bezier\"\nimport { pathOps } from \"@/attributes/shape/path/ops\"\nimport type { PathAnchor, PathSubpath, VectorPath } from \"@/attributes/shape/path/types\";\n\n/** The shape types this module can draw an outline for. */\nexport type ShapeOutlineKind =\n | \"rect\"\n | \"ellipse\"\n | \"polygon\"\n | \"polygram\"\n | \"triangle\"\n | \"rightTriangle\"\n | \"pentagon\"\n | \"hexagon\"\n | \"octagon\"\n | \"star\"\n\n/** Everything an outline can depend on. Unstated fields take the schema's default. */\nexport interface ShapeOutlineOptions {\n /** The node's box, in pixels. */\n width: number\n height: number\n /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */\n cornerRadius?: number | CornerRadiusResolved\n cornerStyle?: CornerStyle\n /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */\n sides?: number\n /**\n * The inner radius as a fraction of the outer one: a polygram's or star's\n * point depth, and an ellipse's donut hole.\n */\n ratio?: number\n /** The ellipse's arc, in degrees. */\n startAngle?: number\n sweep?: number\n}\n\n/**\n * The named shapes' vertex counts and how far they're turned from \"a vertex at\n * the top\".\n *\n * Pointy-top is the regular polygon's natural orientation and the one every icon\n * set draws a pentagon and a hexagon in. The octagon is the exception, and it is\n * not a matter of taste: an octagon with a vertex at the top reads as a rotated\n * stop sign, because a stop sign is the only octagon most people have ever\n * looked at and it has a flat top. Half a step turns it into that one.\n */\nconst NAMED_POLYGONS: Record<string, { sides: number; turn: number }> = {\n pentagon: { sides: 5, turn: 0 },\n hexagon: { sides: 6, turn: 0 },\n octagon: { sides: 8, turn: Math.PI / 8 },\n}\n\n/**\n * A star's default point depth: the classic five-pointed star, where the inner\n * vertices sit where the extended edges of a pentagram cross.\n *\n * Not the polygram node's 50%, and deliberately so. The parametric polygram\n * opens at a round number because it is a *control* you are expected to move;\n * this node exists for the person who wanted a star and got a geometry lesson,\n * so it opens on the star they were picturing.\n */\nexport const STAR_DEFAULT_RATIO = 0.382\n\n/** The default number of points on a Star node. */\nexport const STAR_DEFAULT_POINTS = 5\n\n/**\n * The shape's outline in **pixel** space: centred on the origin, spanning\n * `width` × `height`, y-down.\n *\n * Returns an empty path for a degenerate box, which draws nothing rather than\n * producing NaN coordinates the renderer would have to cope with.\n */\nexport function shapeOutlinePixels(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n if (!(width > 0) || !(height > 0)) return []\n\n switch (kind) {\n case \"rect\":\n return [rectOutline(width, height, options)]\n case \"ellipse\":\n return ellipseOutline(width, height, options)\n case \"triangle\":\n return [\n polygonOutline(\n [\n { x: 0, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"rightTriangle\":\n return [\n polygonOutline(\n [\n { x: -width / 2, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"polygon\":\n // The parametric one: inscribed, *not* stretched — see the module note.\n return [\n polygonOutline(\n regularVertices(sidesOf(options, 5), 0, width / 2, height / 2),\n options\n ),\n ]\n case \"polygram\":\n return [\n polygonOutline(\n starVertices(\n sidesOf(options, 5),\n clamp01(options.ratio ?? 0.5),\n width / 2,\n height / 2\n ),\n options\n ),\n ]\n case \"star\":\n return [\n polygonOutline(\n fillBox(\n starVertices(\n sidesOf(options, STAR_DEFAULT_POINTS),\n clamp01(options.ratio ?? STAR_DEFAULT_RATIO),\n 1,\n 1\n ),\n width,\n height\n ),\n options\n ),\n ]\n default: {\n const named = NAMED_POLYGONS[kind]\n if (!named) return []\n return [\n polygonOutline(\n fillBox(regularVertices(named.sides, named.turn, 1, 1), width, height),\n options\n ),\n ]\n }\n }\n}\n\n/**\n * The same outline in the **unit box** a Path node stores — pixels divided by\n * the node's own size, so the geometry is a fraction of the box rather than a\n * count of pixels inside it.\n *\n * This is what a shape→path conversion writes. Dividing at the end rather than\n * computing in unit space throughout is what keeps a corner radius circular: a\n * 20px corner on a 400×200 node is 0.05 × 0.1 of the box, and only comes back\n * out round because the renderer multiplies by the same two numbers.\n */\nexport function shapeOutline(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n const pixels = shapeOutlinePixels(kind, options)\n if (!(width > 0) || !(height > 0)) return pixels\n return pathOps.map(pixels, (p) => ({ x: p.x / width, y: p.y / height }))\n}\n\n/** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */\nexport function hasShapeOutline(kind: string): kind is ShapeOutlineKind {\n return OUTLINE_KINDS.has(kind)\n}\n\nconst OUTLINE_KINDS: ReadonlySet<string> = new Set<ShapeOutlineKind>([\n \"rect\",\n \"ellipse\",\n \"polygon\",\n \"polygram\",\n \"triangle\",\n \"rightTriangle\",\n \"pentagon\",\n \"hexagon\",\n \"octagon\",\n \"star\",\n])\n\n// ── Building blocks ────────────────────────────────────────────────────────\n\nfunction corner(point: Vector2): PathAnchor {\n return { point, inHandle: null, outHandle: null }\n}\n\nfunction sidesOf(options: ShapeOutlineOptions, fallback: number): number {\n return Math.max(3, Math.round(options.sides ?? fallback))\n}\n\nfunction clamp01(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\n\n/**\n * The vertices of a regular n-gon on the ellipse `rx` × `ry`, starting at the\n * top and stepping clockwise — the same order and the same first vertex\n * The engine's own `polygonVertices` uses, so a converted `polygon` keeps its\n * points in the order the author has been looking at.\n *\n * `turn` rotates the whole figure; see {@link NAMED_POLYGONS}.\n */\nfunction regularVertices(\n sides: number,\n turn: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = (2 * Math.PI) / sides\n const out: Vector2[] = []\n for (let i = 0; i < sides; i++) {\n // −π/2 is straight up in y-down coordinates.\n const a = -Math.PI / 2 + turn + i * step\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) })\n }\n return out\n}\n\n/** Outer and inner vertices alternating — a star with `points` points. */\nfunction starVertices(\n points: number,\n ratio: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = Math.PI / points\n const out: Vector2[] = []\n for (let i = 0; i < points * 2; i++) {\n const a = -Math.PI / 2 + i * step\n const k = i % 2 === 0 ? 1 : ratio\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) })\n }\n return out\n}\n\n/**\n * Stretches a vertex ring so its bounding box *is* the node's box.\n *\n * The one line that separates a shape from its parametric sibling. Everything\n * before it is the inscribed figure; this maps that figure's own extent onto the\n * box, so the flat base of a triangle lands on the bottom edge and a pentagon's\n * two lower vertices land on the left and right ones.\n *\n * A ring with no extent on an axis (which no shape here produces, but a\n * `sides: 3` star with ratio 0 comes close) keeps that axis rather than dividing\n * by zero.\n */\nfunction fillBox(points: Vector2[], width: number, height: number): Vector2[] {\n if (points.length === 0) return points\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n for (const p of points) {\n if (p.x < minX) minX = p.x\n if (p.x > maxX) maxX = p.x\n if (p.y < minY) minY = p.y\n if (p.y > maxY) maxY = p.y\n }\n const spanX = maxX - minX\n const spanY = maxY - minY\n const kx = spanX > 1e-9 ? width / spanX : 1\n const ky = spanY > 1e-9 ? height / spanY : 1\n const cx = (minX + maxX) / 2\n const cy = (minY + maxY) / 2\n return points.map((p) => ({ x: (p.x - cx) * kx, y: (p.y - cy) * ky }))\n}\n\n// ── Corners ────────────────────────────────────────────────────────────────\n\n/**\n * The cubic control-point offset that approximates a circular arc, as a\n * fraction of the distance from the tangent point to the corner.\n *\n * `k = (4/3)·tan(φ/4) / tan(φ/2)`, where φ is the arc's central angle. The\n * familiar 0.5523 is this at φ = 90°; a shallow corner needs less and a sharp\n * one needs more, which is why the constant can't simply be hard-coded — a\n * five-pointed star's inner vertices turn through nearly 180°, where 0.5523\n * would visibly flatten the curve.\n */\nfunction arcHandleRatio(sweep: number): number {\n const half = sweep / 2\n if (Math.abs(half) < 1e-6) return 0\n return ((4 / 3) * Math.tan(sweep / 4)) / Math.tan(half)\n}\n\n/**\n * A closed ring of vertices as a subpath, with each corner rounded or chamfered\n * by `cornerRadius`.\n *\n * The radius is clamped per corner to half of each adjacent edge, so a large\n * radius on a small shape rounds it as far as it can go instead of turning the\n * outline inside out. A radius of zero (or a `cornerStyle` of neither kind)\n * returns the plain polygon, which is the common case and costs nothing.\n */\nfunction polygonOutline(\n points: Vector2[],\n options: ShapeOutlineOptions\n): PathSubpath {\n const radius = uniformRadius(options.cornerRadius)\n if (points.length < 3 || radius <= 0) {\n return { anchors: points.map(corner), closed: true }\n }\n const style = options.cornerStyle ?? \"rounded\"\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i < points.length; i++) {\n const c = points[i]\n const prev = points[(i - 1 + points.length) % points.length]\n const next = points[(i + 1) % points.length]\n\n const toPrev = direction(c, prev)\n const toNext = direction(c, next)\n if (!toPrev || !toNext) {\n anchors.push(corner(c))\n continue\n }\n\n // The interior angle at this vertex, and the arc that replaces it.\n const cosine = Math.max(-1, Math.min(1, toPrev.x * toNext.x + toPrev.y * toNext.y))\n const interior = Math.acos(cosine)\n // A vertex where the two edges double back on themselves has no corner to\n // round; leaving it sharp is the only honest answer.\n if (interior < 1e-6 || Math.PI - interior < 1e-6) {\n anchors.push(corner(c))\n continue\n }\n\n // How far back along each edge the arc starts. Never more than half the\n // edge, so two adjacent corners can't overlap.\n const tangent = Math.min(\n radius / Math.tan(interior / 2),\n distance(c, prev) / 2,\n distance(c, next) / 2\n )\n const a = { x: c.x + toPrev.x * tangent, y: c.y + toPrev.y * tangent }\n const b = { x: c.x + toNext.x * tangent, y: c.y + toNext.y * tangent }\n\n if (style === \"angled\") {\n // A chamfer: the same two tangent points, joined by a straight line.\n anchors.push(corner(a), corner(b))\n continue\n }\n\n const k = arcHandleRatio(Math.PI - interior)\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (c.x - a.x) * k, y: a.y + (c.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (c.x - b.x) * k, y: b.y + (c.y - b.y) * k }, outHandle: null }\n )\n }\n return { anchors, closed: true }\n}\n\n/** The unit vector from `from` towards `to`, or null when they coincide. */\nfunction direction(from: Vector2, to: Vector2): Vector2 | null {\n const dx = to.x - from.x\n const dy = to.y - from.y\n const len = Math.hypot(dx, dy)\n if (len < 1e-9) return null\n return { x: dx / len, y: dy / len }\n}\n\n\n/**\n * A single radius from whichever shape the value arrived in.\n *\n * A per-corner value only means anything on a rect, which builds its outline\n * corner by corner below; every other shape takes the smallest of the four, so\n * converting a rect with mixed corners into a polygon can't silently invent a\n * radius bigger than any the author set.\n */\nfunction uniformRadius(value: number | CornerRadiusResolved | undefined): number {\n if (value === undefined) return 0\n if (typeof value === \"number\") return Math.max(0, value)\n return Math.max(\n 0,\n Math.min(value.topLeft, value.topRight, value.bottomLeft, value.bottomRight)\n )\n}\n\n// ── Rect ───────────────────────────────────────────────────────────────────\n\n/**\n * A rectangle, with each corner carrying its own radius.\n *\n * Written out rather than routed through {@link polygonOutline} because a rect\n * is the one shape whose corners are *individually* set, and because its right\n * angles make the arc exact: the tangent length equals the radius and the handle\n * ratio is the familiar 0.5523, with no trigonometry involved.\n */\nfunction rectOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): PathSubpath {\n const radii = perCornerRadii(options.cornerRadius, width, height)\n const style = options.cornerStyle ?? \"rounded\"\n const x = width / 2\n const y = height / 2\n const k = arcHandleRatio(Math.PI / 2)\n\n const anchors: PathAnchor[] = []\n /**\n * One corner, walking clockwise from the top-left: `at` is the sharp corner,\n * `from`/`to` the directions the outline arrives and leaves along.\n */\n const push = (\n at: Vector2,\n incoming: Vector2,\n outgoing: Vector2,\n r: number\n ) => {\n if (r <= 0) {\n anchors.push(corner(at))\n return\n }\n const a = { x: at.x - incoming.x * r, y: at.y - incoming.y * r }\n const b = { x: at.x + outgoing.x * r, y: at.y + outgoing.y * r }\n if (style === \"angled\") {\n anchors.push(corner(a), corner(b))\n return\n }\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (at.x - a.x) * k, y: a.y + (at.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (at.x - b.x) * k, y: b.y + (at.y - b.y) * k }, outHandle: null }\n )\n }\n\n const right = { x: 1, y: 0 }\n const down = { x: 0, y: 1 }\n const left = { x: -1, y: 0 }\n const up = { x: 0, y: -1 }\n // Clockwise, and the *incoming* direction is the one the walk is travelling\n // when it reaches the corner — not the edge it is about to leave along. The\n // loop closes back into the top-left from the bottom-left, so it arrives there\n // heading **up**; `down` put that corner's first anchor a radius *above* the\n // rectangle and drew the arc back into the box, which is the reversed top-left\n // corner you get on any rounded rect converted to a path.\n push({ x: -x, y: -y }, up, right, radii.topLeft)\n push({ x, y: -y }, right, down, radii.topRight)\n push({ x, y }, down, left, radii.bottomRight)\n push({ x: -x, y }, left, up, radii.bottomLeft)\n return { anchors, closed: true }\n}\n\n/** The four radii, clamped so opposite corners on an edge can't overlap. */\nfunction perCornerRadii(\n value: number | CornerRadiusResolved | undefined,\n width: number,\n height: number\n): CornerRadiusResolved {\n const raw: CornerRadiusResolved =\n value === undefined\n ? { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }\n : typeof value === \"number\"\n ? {\n topLeft: value,\n topRight: value,\n bottomLeft: value,\n bottomRight: value,\n }\n : value\n const cap = Math.min(width, height) / 2\n return {\n topLeft: Math.max(0, Math.min(raw.topLeft, cap)),\n topRight: Math.max(0, Math.min(raw.topRight, cap)),\n bottomLeft: Math.max(0, Math.min(raw.bottomLeft, cap)),\n bottomRight: Math.max(0, Math.min(raw.bottomRight, cap)),\n }\n}\n\n// ── Ellipse ────────────────────────────────────────────────────────────────\n\n/**\n * The ellipse family: a full oval, an arc (`sweep` under 360°), a ring\n * (`ratio` above 0), and the wedge the two make together.\n *\n * The arc is emitted as cubics rather than as an SVG `A` command, and that is\n * the whole reason this is worth writing out. A Path node's geometry is stored\n * as a fraction of its box and multiplied back by the box's *two* dimensions —\n * so an arc, whose parameters describe a circle rather than a set of points,\n * would come out of a non-uniform resize as a different curve rather than a\n * stretched one. Cubics survive that transform exactly.\n */\nfunction ellipseOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): VectorPath {\n const rx = width / 2\n const ry = height / 2\n const inner = clamp01(options.ratio ?? 0)\n const sweep = Math.max(0, Math.min(360, options.sweep ?? 360))\n if (sweep <= 0) return []\n\n // A full oval with no hole is the common case: one closed ring.\n const full = sweep >= 360\n // Degrees clockwise from twelve o'clock, matching the appearance schema's\n // `startAngle` — which is measured the way a clock face is, not the way\n // `Math.atan2` is.\n const from = ((options.startAngle ?? 0) - 90) * (Math.PI / 180)\n const to = from + sweep * (Math.PI / 180)\n\n if (full && inner <= 0) {\n return [{ anchors: arcAnchors(rx, ry, from, to, true), closed: true }]\n }\n if (full) {\n // A ring: two closed rings, the inner one wound the other way so the\n // even-odd fill leaves a hole.\n return [\n { anchors: arcAnchors(rx, ry, from, to, true), closed: true },\n { anchors: arcAnchors(rx * inner, ry * inner, to, from, true), closed: true },\n ]\n }\n\n // An arc, closed back on itself: out along the outer edge, back along the\n // inner one (or through the centre, when there is no hole).\n const outer = arcAnchors(rx, ry, from, to, false)\n const back =\n inner > 0\n ? arcAnchors(rx * inner, ry * inner, to, from, false)\n : [corner({ x: 0, y: 0 })]\n return [{ anchors: [...outer, ...back], closed: true }]\n}\n\n/**\n * An elliptical arc as a run of anchors, split into segments of at most 90° —\n * the span a single cubic approximates to within a fraction of a pixel.\n *\n * `whole` drops the duplicated final anchor, for the case where the arc closes\n * back on its own start.\n */\nfunction arcAnchors(\n rx: number,\n ry: number,\n from: number,\n to: number,\n whole: boolean\n): PathAnchor[] {\n const total = to - from\n const steps = Math.max(1, Math.ceil(Math.abs(total) / (Math.PI / 2)))\n const step = total / steps\n // The classic elliptical-arc approximation: each control point sits α along\n // the curve's own tangent, with α = (4/3)·tan(Δ/4) for a segment spanning Δ.\n // Signed with the step, so a clockwise arc bulges the right way.\n const alpha = (4 / 3) * Math.tan(step / 4)\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i <= steps; i++) {\n const a = from + step * i\n const point = { x: rx * Math.cos(a), y: ry * Math.sin(a) }\n // d/da of the point — the arc's tangent at this angle.\n const tangent = { x: -rx * Math.sin(a), y: ry * Math.cos(a) }\n const offset = { x: tangent.x * alpha, y: tangent.y * alpha }\n anchors.push({\n point,\n inHandle:\n i === 0 ? null : { x: point.x - offset.x, y: point.y - offset.y },\n outHandle:\n i === steps ? null : { x: point.x + offset.x, y: point.y + offset.y },\n })\n }\n\n if (whole && anchors.length > 1) {\n // The arc came back to where it started; fold the duplicate into the first\n // anchor so the ring has one anchor per corner rather than two stacked.\n const last = anchors.pop()!\n anchors[0].inHandle = last.inHandle\n }\n return anchors\n}\n", "/**\n * The family a component's text falls back to when the document names none.\n *\n * A node that draws a caption of its own — a button's label, a window's title —\n * has to put *some* family on it, because the renderer's font provider holds\n * only what the manifest registered and a family called `\"\"` shapes against\n * nothing and paints no glyphs. Which family that is, though, is a fact about\n * the application: which fonts it vendored, which it licensed, what its UI is\n * set in. A component shipped as its own package cannot know it, and the engine\n * has no built-in family to offer in its place.\n *\n * So the answer is *supplied*, once, by the host application's composition\n * root, through {@link setHostTextFamily}. Until a host does, the answer is\n * `\"\"`, and a host that ships a typeface says so instead of every node learning\n * its name.\n *\n * This is deliberately **not** a prop. The prop is the node's own `fontFamily`,\n * which a host's props mapping can fill in from here when the author has left\n * it empty. What lives here is only the answer to \"empty means what?\", which is\n * one answer for the whole application rather than one per node.\n */\n\nlet fallbackFamily = \"\"\n\n/**\n * Declares the family this application's components fall back to.\n *\n * Called by the composition root before the first build. Left unset, components\n * fall back to `\"\"`, which paints no glyphs — a legible blank rather than a\n * silently wrong typeface, and the same bargain an unregistered node type makes.\n */\nexport function setHostTextFamily(family: string): void {\n fallbackFamily = family\n}\n\n/** The family to use where the document names none. */\nexport function hostTextFamily(): string {\n return fallbackFamily\n}\n", "/**\n * The vocabulary of an orbit camera, and the lerps a 3D component tweens with.\n *\n * Unrelated node types are flown by one — a globe, a surface plot — and they\n * are unrelated on purpose: what they share is a camera, not a subject. So this\n * belongs to none of them, and a package per subject would either duplicate it\n * or make one depend on another.\n */\nimport {\n parseColor,\n type Color,\n type NormalizedColor,\n} from \"@/attributes/shape/fill/color/parser\"\nimport type { Vector3 } from \"@/render3d/vector3\"\n\n// --- Colour ----------------------------------------------------------------\n\n/**\n * Mapper: any {@link Color} → a normalized RGBA tuple.\n *\n * Resolving at *write* time rather than at draw time is the point. A tuple can\n * be interpolated channel by channel; `\"#3B82F6\"` cannot, and re-parsing a\n * string per frame would be wasted work besides. The tuple is still a valid\n * `Color`, so it goes straight back to `Graphics3D` with no conversion.\n */\nexport function resolveColor3D(value: Color): NormalizedColor {\n return typeof value === \"string\" ? parseColor(value) : value\n}\n\n/** Tween: per-channel interpolation of two resolved colours. */\nexport function lerpColor3D(\n from: NormalizedColor,\n to: NormalizedColor,\n t: number\n): NormalizedColor {\n return [\n from[0] + (to[0] - from[0]) * t,\n from[1] + (to[1] - from[1]) * t,\n from[2] + (to[2] - from[2]) * t,\n from[3] + (to[3] - from[3]) * t,\n ]\n}\n\n// --- Numbers ---------------------------------------------------------------\n\n/**\n * Interpolates two numbers, tolerating non-finite endpoints.\n *\n * A resolved options bag can legitimately hold `Infinity` (an unset `maxZoom`\n * means \"no ceiling\"), and the plain form would produce `NaN` from\n * `Infinity + (Infinity - Infinity) * t`. Non-finite endpoints hold `from` and\n * switch at the end instead.\n */\nexport function lerpFinite(from: number, to: number, t: number): number {\n if (!Number.isFinite(from) || !Number.isFinite(to)) return t < 1 ? from : to\n return from + (to - from) * t\n}\n\n/**\n * Interpolates a value that indexes geometry — a segment or division count.\n * Rounded, because a fractional count is meaningless to the loops that consume\n * it.\n */\nexport function lerpCount(from: number, to: number, t: number): number {\n return Math.round(from + (to - from) * t)\n}\n\n/**\n * Tweens a value that has no in-between — a flag, a representation, a colour\n * scheme — by holding `from` until the tween lands.\n *\n * There is no halfway point between a wireframe and a solid surface, and a\n * mid-tween flip reads as a glitch rather than a transition, so the switch\n * happens once at the end. Snapping at the *midpoint* would be worse still: the\n * change would land while the command was still running, so a `to` would appear\n * to finish early.\n */\nexport function snapValue<T>(from: T, to: T, t: number): T {\n return t < 1 ? from : to\n}\n\n/** {@link snapValue}, narrowed to a boolean where that is all a caller has. */\nexport const snapFlag: (from: boolean, to: boolean, t: number) => boolean =\n snapValue\n\n// --- Camera ----------------------------------------------------------------\n\n/** A camera placement in spherical terms — what `orbit`/`elevation`/`zoom` hold. */\nexport interface Orbit {\n /** Angle about the vertical axis, in **degrees**. */\n orbit: number\n /** Angle above the ground plane, in **degrees**. 0 is edge-on, 90 straight down. */\n elevation: number\n /** Distance from the target. */\n distance: number\n}\n\n/**\n * A stored `orbit` in the camera's own terms.\n *\n * The engine's camera takes `orbit`/`elevation`/`distance` directly now,\n * which is what these nodes always wanted — but the two conventions disagree\n * about zero: a stored `orbit` here is measured from **+X**, and the camera\n * measures from **+Z** (head-on). A quarter turn separates them.\n *\n * Converting at this one seam is what keeps every document that already holds an\n * `orbit` value framed exactly as it was. Redefining the stored field instead\n * would silently rotate every saved 3D scene by ninety degrees, which is not a\n * change a scene can notice or a reader can debug.\n */\nexport function cameraOrbit(orbit: number): number {\n return 90 - orbit\n}\n\n/**\n * The Cartesian position for a spherical camera placement.\n *\n * Spherical is the useful parameterisation for a timeline: each of the three\n * numbers is independently tweenable and means something an author can reason\n * about, whereas tweening a raw `[x, y, z]` couples \"spin\" and \"pull back\"\n * together and cuts a chord through the sphere on the way.\n *\n * The **camera** no longer goes through this: it takes the three numbers itself\n * (see {@link cameraOrbit}), so converting to a position and back was one more\n * place for the two conventions to drift. What is left is placing something\n * *else* spherically — a light on an arc, a marker ring.\n */\nexport function orbitPosition({ orbit, elevation, distance }: Orbit): Vector3 {\n const orbitRad = orbit * (Math.PI / 180)\n const elevationRad = elevation * (Math.PI / 180)\n const horizontal = Math.cos(elevationRad) * distance\n return {\n x: Math.cos(orbitRad) * horizontal,\n y: Math.sin(elevationRad) * distance,\n z: Math.sin(orbitRad) * horizontal,\n }\n}\n\n/**\n * A camera placement to move *to*, with every axis optional.\n *\n * The argument `orbitTo` takes, shared by every node that frames a 3D scene\n * spherically — a globe, a surface plot. One object rather than\n * three positional numbers because the common edit is one axis: \"pull back\" and\n * \"spin round\" are separate intentions, and a positional form would make each\n * of them restate the two it does not mean.\n *\n * `zoom` rather than {@link Orbit}'s `distance`, because that is what these\n * nodes call the prop.\n */\nexport interface OrbitTarget {\n /** Angle about the vertical axis, in degrees. */\n orbit?: number\n /** Angle above the ground plane, in degrees. */\n elevation?: number\n /** Distance from the target. */\n zoom?: number\n}\n\n/**\n * `target` as props to write, with the axes it does not name left out.\n *\n * Omitted rather than passed as `undefined`: a tween reads its `from` off the\n * node when the command is built, and handing it an explicit `undefined`\n * destination would interpolate towards `NaN` rather than leaving the axis\n * alone.\n */\nexport function orbitProps(target: OrbitTarget): Record<string, number> {\n const props: Record<string, number> = {}\n if (target.orbit !== undefined) props.orbit = target.orbit\n if (target.elevation !== undefined) props.elevation = target.elevation\n if (target.zoom !== undefined) props.zoom = target.zoom\n return props\n}\n"],
|
|
5
|
+
"mappings": "6FAWM,SAAUA,GAAWC,EAAcC,EAAYC,EAAS,CAC1D,OAAOF,GAAQC,EAAKD,GAAQE,CAChC,CAmBM,SAAUC,GAAgBH,EAAcC,EAAYC,EAAS,CAC/D,IAAME,EAAUJ,IAAS,EAAI,EAAIA,EAAO,EAClCK,EAAQJ,IAAO,EAAI,EAAIA,EAAK,EAC5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+BM,SAAUC,GAAWC,EAAmB,CAC1C,IAAMC,EAAgC,CAAA,EACtC,OAAID,EAAO,QAAU,SAAWC,EAAM,MAAQD,EAAO,OACjDA,EAAO,YAAc,SAAWC,EAAM,UAAYD,EAAO,WACzDA,EAAO,OAAS,SAAWC,EAAM,KAAOD,EAAO,MAC5CC,CACX",
|
|
6
|
+
"names": ["lerpNumber", "from", "to", "t", "lerpPerspective", "invFrom", "invTo", "inv", "lerpVector2", "from", "to", "t", "lerpNumber", "vector2Ops", "value", "CSS_COLOR_MAP", "gammaEncode", "c", "linearToSrgb", "r", "g", "b", "a", "xyzD65ToLinearSrgb", "X", "Y", "Z", "parseArgs", "inner", "slashIdx", "alphaToken", "colorPart", "tokens", "alpha", "readAlpha", "token", "readChannel", "percentScale", "numberScale", "ANGLE_UNIT_DEGREES", "readHue", "m", "finiteColor", "color", "_g", "THEME_COLOR_MAP", "PARSED", "TYPOGRAPHY_MAP", "flattenColors", "prefix", "out", "name", "key", "parseColor", "setTheme", "input", "theme", "preset", "getTypographyPreset", "parseNamedColor", "str", "CSS_COLOR_MAP", "parseHex", "hex", "int", "parseRgb", "args", "t", "parseHsl", "h", "s", "l", "k", "n", "chroma", "f", "parseLab", "L", "labToNormalized", "parseLch", "C", "rad", "parseOklab", "oklabToNormalized", "parseOklch", "fy", "fx", "fz", "lr", "lg", "lb", "l_", "m_", "s_", "splitOpacitySuffix", "pct", "cssStr", "known", "opacity", "parsed", "PARSED_MAX", "distance", "a", "b", "dx", "dy", "cubicAxis", "p0", "p1", "p2", "p3", "u", "quadAxis", "cubicPoint", "t", "quadPoint", "lineToCubic", "from", "to", "lerpVector2", "quadToCubic", "cp", "splitCubicAt", "p0", "p1", "p2", "p3", "t", "a", "b", "c", "d", "e", "f", "extractCubicRange", "t0", "t1", "right", "adj", "splitQuadAt", "extractQuadRange", "cubicExtrema", "roots", "push", "disc", "root", "quadExtrema", "denominator", "angleBetween", "ux", "uy", "vx", "vy", "dot", "len", "angle", "arcParams", "rxRaw", "ryRaw", "rotation", "largeArc", "sweep", "phi", "cosPhi", "sinPhi", "dx", "dy", "x1p", "y1p", "rx", "ry", "lambda", "s", "rx2", "ry2", "x1p2", "y1p2", "sq", "sign", "cxp", "cyp", "cx", "cy", "theta1", "dtheta", "arcPointAtAngle", "arc", "theta", "cosT", "sinT", "arcDerivativeAtAngle", "arc", "theta", "cosPhi", "sinPhi", "cosT", "sinT", "arcSweepToCubics", "theta0", "theta1", "sweep", "pieces", "step", "alpha", "cubics", "a0", "a1", "p0", "arcPointAtAngle", "p1", "d0", "d1", "arcAxisAngles", "tx", "ty", "arcContainsAngle", "TAU", "COMMAND_LETTERS", "isSeparator", "ch", "isDigit", "createPathScanner", "data", "i", "skip", "start", "mark", "value", "lineSegment", "from", "to", "quadSegment", "c", "cubicSegment", "c1", "c2", "arcSegment", "rx", "ry", "rotation", "largeArc", "sweep", "segmentArc", "segment", "arcParams", "segmentPointAt", "t", "lerpVector2", "quadPoint", "cubicPoint", "arc", "arcPointAtAngle", "boxOf", "points", "minX", "minY", "maxX", "maxY", "p", "segmentBounds", "at", "quadExtrema", "cubicExtrema", "angles", "arcAxisAngles", "theta", "arcContainsAngle", "segmentCubics", "lineToCubic", "quadToCubic", "cubics", "arcSweepToCubics", "segmentSplit", "t0", "t1", "sub", "extractQuadRange", "extractCubicRange", "a0", "a1", "closingSegment", "contour", "end", "contourSegments", "closing", "contourBounds", "contours", "seen", "include", "box", "parseCommands", "d", "scan", "createPathScanner", "commands", "letter", "next", "upper", "rel", "n", "count", "out", "i", "value", "a", "type", "radii", "largeArc", "sweep", "end", "CONTOUR_CACHE", "CONTOUR_CACHE_MAX", "contours", "cached", "walked", "walkCommands", "list", "current", "cursor", "contourStart", "prevCubicCp", "prevQuadCp", "open", "at", "contour", "push", "segment", "cmd", "abs", "x", "y", "cubicCp", "quadCp", "to", "lineSegment", "c1", "c2", "cubicSegment", "cp", "quadSegment", "arcSegment", "bounds", "contourBounds", "size", "box", "EMPTY_PATH_DATA", "samePoint", "a", "b", "closeSubpath", "subpath", "anchors", "first", "last", "copy", "v", "contourToSubpath", "contour", "curve", "cubic", "segment", "quadToCubic", "arc", "segmentArc", "arcSweepToCubics", "d", "contours", "COORD_PRECISION", "fmt", "value", "rounded", "segmentBetween", "from", "to", "fromAnchors", "path", "parts", "closed", "i", "join", "identity", "point", "anchorCommands", "transform", "out", "emit", "end", "c1", "c2", "start", "anchorBounds", "minX", "minY", "maxX", "maxY", "seen", "includeX", "x", "includeY", "y", "anchor", "t", "cubicExtrema", "cubicAxis", "map", "fn", "endFit", "cx", "cy", "chord", "dx", "dy", "p", "tx", "ty", "re", "im", "ux", "uy", "isEmpty", "PATH_UNIT_EXTENT", "PATH_UNIT_HALF", "UNIT_PATH_BOX", "normalize", "bounds", "fitToBox", "box", "width", "height", "centerX", "centerY", "scaleX", "scaleY", "translate", "delta", "pointOn", "split", "left", "right", "splitCubicAt", "SAMPLE_STEPS", "flatten", "segment", "points", "i", "segmentPointAt", "measureSegment", "cumulative", "total", "distance", "measureContours", "contours", "contour", "metrics", "contourSegments", "length", "sum", "m", "paramAtDist", "metric", "d", "lo", "hi", "mid", "span", "within", "steps", "sampler", "contourMetric", "first", "segmentMetric", "cursor", "target", "b", "segStart", "segLen", "t", "dx", "dy", "segDist", "tx", "ty", "contourPoints", "dashSubpath", "scaledDash", "offset", "closed", "cycle", "a", "sliver", "tolerance", "into", "dashIndex", "passed", "parts", "remaining", "isOn", "needMove", "last", "p0", "p1", "walked", "available", "endT", "endX", "endY", "startT", "reach", "point", "x", "y", "dashScale", "pattern", "lastGap", "dash", "runs", "scale", "run", "value", "trim", "start", "end", "s", "e", "startDist", "endDist", "result", "accumulated", "needsMove", "metricEntry", "segEnd", "t0", "t1", "p", "segmentSplit", "cubics", "d", "out", "contour", "contours", "chain", "contourSegments", "segmentCubics", "c", "startPoint", "cubicLength", "steps", "len", "prev", "i", "p", "cubicPoint", "distance", "centroid", "x", "y", "splitCubic", "t", "a", "lerpVector2", "b", "e", "f", "g", "subdivideTo", "target", "work", "longest", "maxLen", "left", "right", "reverseCubics", "rotateCubics", "offset", "anchorCost", "cost", "dx", "dy", "alignClosedRing", "from", "to", "n", "best", "bestCost", "candidate", "rotated", "alignOpenSubpath", "reversed", "degenerateSubpath", "at", "count", "pairSubpaths", "fromSubs", "toSubs", "pairs", "toUsed", "fc", "bestIdx", "bestDist", "j", "tc", "plan", "seed", "fromCubics", "toCubics", "bothClosed", "lerpCubic", "sample", "pair", "first", "cachedPlan", "planFor", "built", "commands", "lerp", "pathOps", "value", "lerp", "commands", "contours", "cubics", "anchors", "bounds", "size", "length", "sampler", "trim", "dash", "dashScale", "plan", "sample", "fromAnchors", "anchorCommands", "anchorBounds", "map", "translate", "endFit", "isEmpty", "normalize", "fitToBox", "pointOn", "split", "NAMED_POLYGONS", "STAR_DEFAULT_RATIO", "STAR_DEFAULT_POINTS", "shapeOutlinePixels", "kind", "options", "width", "height", "rectOutline", "ellipseOutline", "polygonOutline", "regularVertices", "sidesOf", "starVertices", "clamp01", "fillBox", "named", "shapeOutline", "pixels", "pathOps", "p", "hasShapeOutline", "OUTLINE_KINDS", "corner", "point", "fallback", "value", "sides", "turn", "rx", "ry", "step", "out", "i", "a", "points", "ratio", "k", "minX", "minY", "maxX", "maxY", "spanX", "spanY", "kx", "ky", "cx", "cy", "arcHandleRatio", "sweep", "half", "radius", "uniformRadius", "style", "anchors", "c", "prev", "next", "toPrev", "direction", "toNext", "cosine", "interior", "tangent", "distance", "b", "from", "to", "dx", "dy", "len", "radii", "perCornerRadii", "x", "y", "push", "at", "incoming", "outgoing", "r", "right", "down", "left", "up", "raw", "cap", "inner", "full", "arcAnchors", "outer", "back", "whole", "total", "steps", "alpha", "offset", "last", "fallbackFamily", "setHostTextFamily", "family", "hostTextFamily", "resolveColor3D", "value", "parseColor", "lerpColor3D", "from", "to", "t", "lerpFinite", "lerpCount", "snapValue", "snapFlag", "cameraOrbit", "orbit", "orbitPosition", "elevation", "distance", "orbitRad", "elevationRad", "horizontal", "orbitProps", "target", "props"]
|
|
7
|
+
}
|