@motionscript/core 0.1.0-alpha.7 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -48
- package/README.md +91 -91
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +7 -5
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +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 +24 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +4 -3
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +21 -13
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +42 -28
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +15 -12
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -10
- 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 +4 -3
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +4 -7
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +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.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +7 -7
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -6
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -2
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +1 -2
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +96 -409
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +93 -283
- 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 +96 -26
- 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 +20 -6
- 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 +46 -14
- 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 +76 -19
- 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 +34 -7
- 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 +42 -26
- 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 +4 -2
- 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 +11 -0
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +113 -102
- 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.js.map +1 -1
- package/dist/attributes/shape/fill/blend.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/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +27 -26
- 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/stripe.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.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/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +2 -6
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -5
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.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/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +1 -1
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +2 -3
- 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.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.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/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-7DB6BI27.js +6 -0
- package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
- package/dist/browser/chunks/chunk-IX53IFBD.js +13 -0
- package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
- package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
- package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +4 -4
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +14 -5
- package/dist/components/builtins/audio/audio.d.ts.map +1 -1
- package/dist/components/builtins/audio/audio.js +10 -13
- package/dist/components/builtins/audio/audio.js.map +1 -1
- package/dist/components/builtins/geometry/composite.d.ts +3 -3
- package/dist/components/builtins/geometry/composite.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +7 -7
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +4 -10
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/providers/providers.js.map +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +9 -9
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js +3 -0
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts +38 -11
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/clip-of.js.map +1 -1
- package/dist/components/factory/commands-for.js.map +1 -1
- package/dist/components/factory/component-audio.js.map +1 -1
- package/dist/components/factory/component2d.js.map +1 -1
- package/dist/components/factory/component3d.d.ts.map +1 -1
- package/dist/components/factory/component3d.js +11 -3
- package/dist/components/factory/component3d.js.map +1 -1
- package/dist/components/factory/factory.d.ts +3 -0
- package/dist/components/factory/factory.d.ts.map +1 -1
- package/dist/components/factory/factory.js +39 -5
- package/dist/components/factory/factory.js.map +1 -1
- package/dist/components/factory/timeline.js.map +1 -1
- package/dist/components/factory/type-def.js.map +1 -1
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/modules/aim.js.map +1 -1
- package/dist/components/modules/corners.js.map +1 -1
- package/dist/components/modules/flow.js.map +1 -1
- package/dist/components/modules/material.js.map +1 -1
- package/dist/components/modules/paint.js.map +1 -1
- package/dist/components/modules/shapes.js.map +1 -1
- package/dist/components/modules/text-layout.js.map +1 -1
- package/dist/components/modules/text-style.js.map +1 -1
- package/dist/components/modules/three-entries.js.map +1 -1
- package/dist/components/modules/view3d.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +1 -1
- package/dist/components/trees/2d/node-render.js +1 -1
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +1 -1
- package/dist/components/trees/2d/node2d.js +1 -1
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/index.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +16 -9
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +15 -11
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/index.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +12 -2
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +34 -6
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +8 -0
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +4 -0
- 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.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +4 -0
- 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 +2 -1
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +2 -0
- 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 +16 -0
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +30 -4
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +2 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +5 -5
- package/dist/document/settled-index.js.map +1 -1
- 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 +45 -1
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +172 -42
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +14 -28
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +17 -5
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +158 -21
- 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 +68 -8
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +22 -8
- package/dist/experimental.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -0
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +1 -1
- package/dist/renamed-scene-names.d.ts.map +1 -1
- package/dist/renamed-scene-names.js +1 -1
- package/dist/renamed-scene-names.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +9 -0
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -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.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +2 -2
- package/dist/render/descriptors/text.js +2 -2
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.js.map +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/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +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/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +54 -5
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js +2 -1
- 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 +7 -0
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +3 -1
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +4 -0
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +17 -2
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +5 -3
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +2 -1
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +14 -4
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +7 -3
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +11 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +8 -6
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +10 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +7 -0
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -0
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +2 -0
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +4 -0
- package/dist/tween/ease/describe.js.map +1 -1
- 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/ease/type.js.map +1 -1
- package/dist/tween/index.d.ts +1 -0
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +1 -0
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +2 -2
- 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 -250
- 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/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-D4FSTPML.js +0 -14
- package/dist/browser/chunks/chunk-D4FSTPML.js.map +0 -7
- package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
- package/dist/browser/chunks/chunk-RTNATFWX.js +0 -5
- package/dist/browser/chunks/chunk-RTNATFWX.js.map +0 -7
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
- package/dist/component/api.d.ts +0 -508
- package/dist/component/api.d.ts.map +0 -1
- package/dist/component/api.js +0 -4
- package/dist/component/api.js.map +0 -1
- package/dist/component/builtins/audio.d.ts +0 -26
- package/dist/component/builtins/audio.d.ts.map +0 -1
- package/dist/component/builtins/audio.js +0 -41
- package/dist/component/builtins/audio.js.map +0 -1
- package/dist/component/builtins/canvas3d.d.ts +0 -98
- package/dist/component/builtins/canvas3d.d.ts.map +0 -1
- package/dist/component/builtins/canvas3d.js +0 -21
- package/dist/component/builtins/canvas3d.js.map +0 -1
- package/dist/component/builtins/composite.d.ts +0 -56
- package/dist/component/builtins/composite.d.ts.map +0 -1
- package/dist/component/builtins/composite.js +0 -25
- package/dist/component/builtins/composite.js.map +0 -1
- package/dist/component/builtins/geometry.d.ts +0 -505
- package/dist/component/builtins/geometry.d.ts.map +0 -1
- package/dist/component/builtins/geometry.js +0 -107
- package/dist/component/builtins/geometry.js.map +0 -1
- package/dist/component/builtins/layout.d.ts +0 -88
- package/dist/component/builtins/layout.d.ts.map +0 -1
- package/dist/component/builtins/layout.js +0 -84
- package/dist/component/builtins/layout.js.map +0 -1
- package/dist/component/builtins/media.d.ts +0 -95
- package/dist/component/builtins/media.d.ts.map +0 -1
- package/dist/component/builtins/media.js +0 -149
- package/dist/component/builtins/media.js.map +0 -1
- package/dist/component/builtins/providers.d.ts +0 -23
- package/dist/component/builtins/providers.d.ts.map +0 -1
- package/dist/component/builtins/providers.js +0 -30
- package/dist/component/builtins/providers.js.map +0 -1
- package/dist/component/builtins/text.d.ts +0 -193
- package/dist/component/builtins/text.d.ts.map +0 -1
- package/dist/component/builtins/text.js +0 -113
- package/dist/component/builtins/text.js.map +0 -1
- package/dist/component/builtins/three.d.ts +0 -1085
- package/dist/component/builtins/three.d.ts.map +0 -1
- package/dist/component/builtins/three.js +0 -265
- package/dist/component/builtins/three.js.map +0 -1
- package/dist/component/clip-of.d.ts +0 -5
- package/dist/component/clip-of.d.ts.map +0 -1
- package/dist/component/clip-of.js +0 -33
- package/dist/component/clip-of.js.map +0 -1
- package/dist/component/commands-for.d.ts +0 -19
- package/dist/component/commands-for.d.ts.map +0 -1
- package/dist/component/commands-for.js +0 -5
- package/dist/component/commands-for.js.map +0 -1
- package/dist/component/component-audio.d.ts +0 -9
- package/dist/component/component-audio.d.ts.map +0 -1
- package/dist/component/component-audio.js +0 -18
- package/dist/component/component-audio.js.map +0 -1
- package/dist/component/component2d.d.ts +0 -9
- package/dist/component/component2d.d.ts.map +0 -1
- package/dist/component/component2d.js +0 -239
- package/dist/component/component2d.js.map +0 -1
- package/dist/component/component3d.d.ts +0 -9
- package/dist/component/component3d.d.ts.map +0 -1
- package/dist/component/component3d.js +0 -99
- package/dist/component/component3d.js.map +0 -1
- package/dist/component/factory.d.ts +0 -63
- package/dist/component/factory.d.ts.map +0 -1
- package/dist/component/factory.js +0 -313
- package/dist/component/factory.js.map +0 -1
- package/dist/component/modules/aim.d.ts +0 -30
- package/dist/component/modules/aim.d.ts.map +0 -1
- package/dist/component/modules/aim.js +0 -39
- package/dist/component/modules/aim.js.map +0 -1
- package/dist/component/modules/corners.d.ts +0 -13
- package/dist/component/modules/corners.d.ts.map +0 -1
- package/dist/component/modules/corners.js +0 -12
- package/dist/component/modules/corners.js.map +0 -1
- package/dist/component/modules/flow.d.ts +0 -26
- package/dist/component/modules/flow.d.ts.map +0 -1
- package/dist/component/modules/flow.js +0 -55
- package/dist/component/modules/flow.js.map +0 -1
- package/dist/component/modules/material.d.ts +0 -40
- package/dist/component/modules/material.d.ts.map +0 -1
- package/dist/component/modules/material.js +0 -75
- package/dist/component/modules/material.js.map +0 -1
- package/dist/component/modules/paint.d.ts +0 -71
- package/dist/component/modules/paint.d.ts.map +0 -1
- package/dist/component/modules/paint.js +0 -106
- package/dist/component/modules/paint.js.map +0 -1
- package/dist/component/modules/shapes.d.ts +0 -31
- package/dist/component/modules/shapes.d.ts.map +0 -1
- package/dist/component/modules/shapes.js +0 -43
- package/dist/component/modules/shapes.js.map +0 -1
- package/dist/component/modules/text-layout.d.ts +0 -26
- package/dist/component/modules/text-layout.d.ts.map +0 -1
- package/dist/component/modules/text-layout.js +0 -57
- package/dist/component/modules/text-layout.js.map +0 -1
- package/dist/component/modules/text-style.d.ts +0 -48
- package/dist/component/modules/text-style.d.ts.map +0 -1
- package/dist/component/modules/text-style.js +0 -63
- package/dist/component/modules/text-style.js.map +0 -1
- package/dist/component/modules/three-entries.d.ts +0 -23
- package/dist/component/modules/three-entries.d.ts.map +0 -1
- package/dist/component/modules/three-entries.js +0 -41
- package/dist/component/modules/three-entries.js.map +0 -1
- package/dist/component/modules/view3d.d.ts +0 -55
- package/dist/component/modules/view3d.d.ts.map +0 -1
- package/dist/component/modules/view3d.js +0 -160
- package/dist/component/modules/view3d.js.map +0 -1
- package/dist/component/timeline.d.ts +0 -22
- package/dist/component/timeline.d.ts.map +0 -1
- package/dist/component/timeline.js +0 -128
- package/dist/component/timeline.js.map +0 -1
- package/dist/component/type-def.d.ts +0 -26
- package/dist/component/type-def.d.ts.map +0 -1
- package/dist/component/type-def.js +0 -16
- package/dist/component/type-def.js.map +0 -1
- package/dist/component/types.d.ts +0 -91
- package/dist/component/types.d.ts.map +0 -1
- package/dist/component/types.js +0 -88
- package/dist/component/types.js.map +0 -1
- package/dist/component/views.d.ts +0 -121
- package/dist/component/views.d.ts.map +0 -1
- package/dist/component/views.js +0 -413
- package/dist/component/views.js.map +0 -1
- package/dist/document/withdraw.d.ts +0 -28
- package/dist/document/withdraw.d.ts.map +0 -1
- package/dist/document/withdraw.js +0 -61
- package/dist/document/withdraw.js.map +0 -1
- 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 -27
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -26
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js +0 -264
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts +0 -56
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js +0 -86
- 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 +0 -80
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts +0 -63
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js +0 -131
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts +0 -55
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js +0 -73
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts +0 -1111
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js +0 -1665
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -142
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -232
- 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 -2
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts +0 -107
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js +0 -179
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -41
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -71
- 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/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/group-bounds.d.ts +0 -56
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js +0 -87
- package/dist/nodes/geometry/group-bounds.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 -58
- 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 +0 -93
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js +0 -470
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -53
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -35
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -80
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -153
- 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 -350
- 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 +0 -53
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js +0 -23
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts +0 -89
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js +0 -135
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts +0 -39
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js +0 -14
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts +0 -46
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js +0 -74
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts +0 -445
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js +0 -745
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts +0 -32
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js +0 -37
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/root/canvas2d-node.d.ts +0 -163
- package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/root/canvas2d-node.js +0 -264
- package/dist/nodes/root/canvas2d-node.js.map +0 -1
- package/dist/nodes/root/provider-node.d.ts +0 -47
- package/dist/nodes/root/provider-node.d.ts.map +0 -1
- package/dist/nodes/root/provider-node.js +0 -63
- package/dist/nodes/root/provider-node.js.map +0 -1
- package/dist/nodes/root/theme-provider-node.d.ts +0 -29
- package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/root/theme-provider-node.js +0 -43
- package/dist/nodes/root/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -103
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -146
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts +0 -66
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js +0 -227
- 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 +0 -51
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js +0 -77
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -68
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -78
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -118
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -153
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-layout.d.ts +0 -87
- package/dist/nodes/text/text-layout.d.ts.map +0 -1
- package/dist/nodes/text/text-layout.js +0 -368
- package/dist/nodes/text/text-layout.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 -109
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -112
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -295
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -486
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -173
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -284
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -106
- 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 +0 -62
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js +0 -114
- 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 +0 -230
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js +0 -337
- 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 -81
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -137
- package/dist/tween/seekable.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morph.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,MAAM,CAAC,CAA8B;IACjD,MAAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,qEAAqE;QACrE,uEAAuE;QACvE,sEAAsE;QACtE,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACjC,yEAAyE;QACzE,uEAAuE;QACvE,GAAG,CAAC,IAAI,CAAC;YACL,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,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OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/**\r\n * Path morphing — smooth interpolation between two arbitrary path shapes.\r\n *\r\n * Lerping two SVG paths command-by-command only works when they happen to share\r\n * the same command structure; in general one path is a triangle and the other a\r\n * star with a different number of points, different command types, a different\r\n * start point, and the opposite winding. Naively pairing commands produces\r\n * kinks, self-intersections, and points that fly across the canvas.\r\n *\r\n * This module reshapes both paths into a common, directly-interpolatable form —\r\n * the same approach GSAP's MorphSVGPlugin uses:\r\n *\r\n * 1. {@link cubics} converts each path into a list of {@link CubicSubpath}s.\r\n * Every drawing command (L/H/V/Q/A/Z-close) is rewritten as a cubic Bézier, so\r\n * a subpath becomes a uniform chain of cubics described purely by anchor and\r\n * control points.\r\n * 2. {@link plan} pairs the two paths' subpaths (padding the shorter side\r\n * with degenerate, collapsed subpaths so every subpath has a partner),\r\n * equalizes the number of cubics in each pair by subdividing the coarser\r\n * subpath along its perimeter, and — for closed rings — rotates and optionally\r\n * reverses one ring so the two start at the same place and wind the same way.\r\n * 3. {@link lerpPathData} samples that aligned correspondence at a given `t`,\r\n * interpolating every control point with {@link lerpVector2}.\r\n *\r\n * The result is a {@link PathCommand} list (one `M` + N `C`s per subpath) that the\r\n * existing renderer draws unchanged.\r\n */\r\nimport { Vector2, lerpVector2 } from \"@/attributes/layout/vector2\";\r\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\r\nimport { distance, cubicPoint } from \"./bezier\";\r\nimport { commands, contourSegments, contours, segmentCubics } from \"./walk\";\r\nimport type { Cubic, CubicSubpath, MorphPlan } from \"./types\";\r\n\r\n/**\r\n * A path as cubic subpaths — one of the two boundaries where geometry is\r\n * deliberately flattened to a single curve type.\r\n *\r\n * A morph has to pair segments up and interpolate them, which needs both sides\r\n * speaking one language, so an arc becomes cubics here (and only here, and in\r\n * the anchor model). This used to carry the sixth copy of the pen walk; the one\r\n * thing it got wrong that the shared walk does not is `Z`, which it marked\r\n * without closing the run — so `M0 0 L10 0 Z L20 0` came back as one subpath\r\n * where SVG says two.\r\n */\r\nexport function cubics(d: PathData | null | undefined): CubicSubpath[] {\r\n const out: CubicSubpath[] = [];\r\n for (const contour of contours(d)) {\r\n // A lone `M` has nothing to interpolate: it draws nothing and has no\r\n // first anchor to seed a partner from, so it is not a subpath here. It\r\n // stays in `contours`, where it still occupies a point of the bounds.\r\n const chain = contourSegments(contour).flatMap(segmentCubics);\r\n if (chain.length === 0) continue;\r\n // `contours` is memoized and shared, so hand out copies of its points: a\r\n // caller moving an anchor of the result must not move the cached path.\r\n out.push({\r\n cubics: chain.map((c) => ({ p0: { ...c.p0 }, c1: { ...c.c1 }, c2: { ...c.c2 }, p1: { ...c.p1 } })),\r\n closed: contour.closed,\r\n });\r\n }\r\n return out;\r\n}\r\n\r\n/** First anchor of a subpath (the implicit `M` target). */\r\nfunction startPoint(cubics: Cubic[]): Vector2 {\r\n return cubics[0].p0;\r\n}\r\n\r\n/** Approximate length of a cubic by flattening — cheap, used only for weighting. */\r\nfunction cubicLength(c: Cubic, steps = 8): number {\r\n let len = 0;\r\n let prev = c.p0;\r\n for (let i = 1; i <= steps; i++) {\r\n const p = cubicPoint(c.p0, c.c1, c.c2, c.p1, i / steps);\r\n len += distance(prev, p);\r\n prev = p;\r\n }\r\n return len;\r\n}\r\n\r\n/** Centroid of a subpath's anchor points — used to pair subpaths by proximity. */\r\nfunction centroid(cubics: Cubic[]): Vector2 {\r\n let x = 0, y = 0;\r\n for (const c of cubics) { x += c.p0.x; y += c.p0.y; }\r\n return { x: x / cubics.length, y: y / cubics.length };\r\n}\r\n\r\n// --- Subdivision: grow a subpath to a target number of cubics ---------------\r\n\r\n/** Split one cubic at parameter `t` into two cubics tracing the same curve (De Casteljau). */\r\nfunction splitCubic(c: Cubic, t: number): [Cubic, Cubic] {\r\n const a = lerpVector2(c.p0, c.c1, t);\r\n const b = lerpVector2(c.c1, c.c2, t);\r\n const d = lerpVector2(c.c2, c.p1, t);\r\n const e = lerpVector2(a, b, t);\r\n const f = lerpVector2(b, d, t);\r\n const g = lerpVector2(e, f, t);\r\n return [\r\n { p0: c.p0, c1: a, c2: e, p1: g },\r\n { p0: g, c1: f, c2: d, p1: c.p1 },\r\n ];\r\n}\r\n\r\n/**\r\n * Subdivide `cubics` until it has exactly `target` cubics (target ≥ current).\r\n * Splits are spread across the longest segments first so the added anchor points\r\n * land roughly evenly along the perimeter — the key to a smooth morph, since each\r\n * added point becomes a correspondence point with the other shape.\r\n */\r\nfunction subdivideTo(cubics: Cubic[], target: number): Cubic[] {\r\n let work = cubics.slice();\r\n while (work.length < target) {\r\n // Find the longest cubic and split it in half.\r\n let longest = 0;\r\n let maxLen = -1;\r\n for (let i = 0; i < work.length; i++) {\r\n const len = cubicLength(work[i]);\r\n if (len > maxLen) { maxLen = len; longest = i; }\r\n }\r\n const [left, right] = splitCubic(work[longest], 0.5);\r\n work.splice(longest, 1, left, right);\r\n }\r\n return work;\r\n}\r\n\r\n// --- Ring alignment: rotate + reverse a closed subpath ----------------------\r\n\r\n/** Reverse a chain of cubics so it traces the same shape in the opposite direction. */\r\nfunction reverseCubics(cubics: Cubic[]): Cubic[] {\r\n const out: Cubic[] = [];\r\n for (let i = cubics.length - 1; i >= 0; i--) {\r\n const c = cubics[i];\r\n out.push({ p0: c.p1, c1: c.c2, c2: c.c1, p1: c.p0 });\r\n }\r\n return out;\r\n}\r\n\r\n/** Rotate a closed ring so it begins at cubic index `offset` (wraps around). */\r\nfunction rotateCubics(cubics: Cubic[], offset: number): Cubic[] {\r\n if (offset === 0) return cubics.slice();\r\n return cubics.slice(offset).concat(cubics.slice(0, offset));\r\n}\r\n\r\n/** Sum of squared distances between paired anchor points — the alignment cost. */\r\nfunction anchorCost(a: Cubic[], b: Cubic[]): number {\r\n let cost = 0;\r\n for (let i = 0; i < a.length; i++) {\r\n const dx = a[i].p0.x - b[i].p0.x;\r\n const dy = a[i].p0.y - b[i].p0.y;\r\n cost += dx * dx + dy * dy;\r\n }\r\n return cost;\r\n}\r\n\r\n/**\r\n * Align a closed `to` ring against a fixed `from` ring (same cubic count). Tries\r\n * every rotation offset, in both winding directions, and keeps whichever pairs the\r\n * anchor points with the least total travel. This is what lets two shapes whose\r\n * points are listed in any order — or that wind in opposite directions — morph\r\n * without spinning or folding through themselves.\r\n */\r\nfunction alignClosedRing(from: Cubic[], to: Cubic[]): Cubic[] {\r\n const n = from.length;\r\n let best = to;\r\n let bestCost = Infinity;\r\n\r\n for (const candidate of [to, reverseCubics(to)]) {\r\n for (let offset = 0; offset < n; offset++) {\r\n const rotated = rotateCubics(candidate, offset);\r\n const cost = anchorCost(from, rotated);\r\n if (cost < bestCost) {\r\n bestCost = cost;\r\n best = rotated;\r\n }\r\n }\r\n }\r\n return best;\r\n}\r\n\r\n/**\r\n * For an open subpath, only the winding can be flipped (rotation would change the\r\n * shape). Pick the direction whose endpoints best match the `from` subpath.\r\n */\r\nfunction alignOpenSubpath(from: Cubic[], to: Cubic[]): Cubic[] {\r\n const reversed = reverseCubics(to);\r\n return anchorCost(from, to) <= anchorCost(from, reversed) ? to : reversed;\r\n}\r\n\r\n// --- Degenerate subpaths (for count mismatches) -----------------------------\r\n\r\n/**\r\n * A subpath collapsed onto a single point `at`, with `count` zero-length cubics.\r\n * Pairing a real subpath with one of these makes it grow out of / shrink into a\r\n * point, which is how added or removed subpaths animate.\r\n */\r\nfunction degenerateSubpath(at: Vector2, count: number): Cubic[] {\r\n const cubics: Cubic[] = [];\r\n for (let i = 0; i < count; i++) {\r\n cubics.push({ p0: { ...at }, c1: { ...at }, c2: { ...at }, p1: { ...at } });\r\n }\r\n return cubics;\r\n}\r\n\r\n// --- Subpath pairing --------------------------------------------------------\r\n\r\n/**\r\n * Greedily pair `from` subpaths with the nearest unused `to` subpath (by centroid),\r\n * so morphing maps each shape onto its closest counterpart rather than by list\r\n * order. Leftover subpaths on either side are paired with a degenerate partner\r\n * collapsed at their own centroid, so they grow/shrink in place.\r\n */\r\nfunction pairSubpaths(\r\n fromSubs: CubicSubpath[],\r\n toSubs: CubicSubpath[],\r\n): Array<{ from: CubicSubpath; to: CubicSubpath }> {\r\n const pairs: Array<{ from: CubicSubpath; to: CubicSubpath }> = [];\r\n const toUsed = new Array(toSubs.length).fill(false);\r\n\r\n for (const f of fromSubs) {\r\n const fc = centroid(f.cubics);\r\n let bestIdx = -1;\r\n let bestDist = Infinity;\r\n for (let j = 0; j < toSubs.length; j++) {\r\n if (toUsed[j]) continue;\r\n const d = distance(fc, centroid(toSubs[j].cubics));\r\n if (d < bestDist) { bestDist = d; bestIdx = j; }\r\n }\r\n if (bestIdx >= 0) {\r\n toUsed[bestIdx] = true;\r\n pairs.push({ from: f, to: toSubs[bestIdx] });\r\n } else {\r\n // No `to` subpath left → collapse to this subpath's own centroid.\r\n pairs.push({\r\n from: f,\r\n to: { cubics: degenerateSubpath(fc, f.cubics.length), closed: f.closed },\r\n });\r\n }\r\n }\r\n\r\n // Any unused `to` subpaths grow out of their own centroid.\r\n for (let j = 0; j < toSubs.length; j++) {\r\n if (toUsed[j]) continue;\r\n const t = toSubs[j];\r\n const tc = centroid(t.cubics);\r\n pairs.push({\r\n from: { cubics: degenerateSubpath(tc, t.cubics.length), closed: t.closed },\r\n to: t,\r\n });\r\n }\r\n\r\n return pairs;\r\n}\r\n\r\n// --- Building the morph plan ------------------------------------------------\r\n\r\n/**\r\n * Build a reusable {@link MorphPlan} aligning `from` to `to`. All the expensive\r\n * work — converting to cubics, pairing subpaths, equalizing counts, and rotating\r\n * rings — happens here once; {@link sample} then samples it cheaply per frame.\r\n */\r\nexport function plan(from: PathCommand[], to: PathCommand[]): MorphPlan {\r\n const fromSubs = cubics(from);\r\n const toSubs = cubics(to);\r\n\r\n // Both empty → nothing to morph.\r\n if (fromSubs.length === 0 && toSubs.length === 0) {\r\n return { pairs: [] };\r\n }\r\n\r\n // One side empty → collapse/grow the other against a point at its start.\r\n if (fromSubs.length === 0) {\r\n const seed = startPoint(toSubs[0].cubics);\r\n fromSubs.push({ cubics: degenerateSubpath(seed, 1), closed: toSubs[0].closed });\r\n }\r\n if (toSubs.length === 0) {\r\n const seed = startPoint(fromSubs[0].cubics);\r\n toSubs.push({ cubics: degenerateSubpath(seed, 1), closed: fromSubs[0].closed });\r\n }\r\n\r\n const subPairs = pairSubpaths(fromSubs, toSubs);\r\n\r\n const pairs = subPairs.map(({ from: f, to: t }) => {\r\n // Equalize cubic counts by subdividing the coarser side.\r\n const count = Math.max(f.cubics.length, t.cubics.length);\r\n const fromCubics = subdivideTo(f.cubics, count);\r\n let toCubics = subdivideTo(t.cubics, count);\r\n\r\n // Align the `to` side to the `from` side so points correspond and travel\r\n // the shortest path. Closed rings can rotate + reverse; open paths only\r\n // reverse (rotating an open path would tear it).\r\n const bothClosed = f.closed && t.closed;\r\n toCubics = bothClosed\r\n ? alignClosedRing(fromCubics, toCubics)\r\n : alignOpenSubpath(fromCubics, toCubics);\r\n\r\n return { from: fromCubics, to: toCubics, closed: bothClosed };\r\n });\r\n\r\n return { pairs };\r\n}\r\n\r\n// --- Sampling ---------------------------------------------------------------\r\n\r\n/** Interpolate a single cubic's four points. */\r\nfunction lerpCubic(from: Cubic, to: Cubic, t: number): Cubic {\r\n return {\r\n p0: lerpVector2(from.p0, to.p0, t),\r\n c1: lerpVector2(from.c1, to.c1, t),\r\n c2: lerpVector2(from.c2, to.c2, t),\r\n p1: lerpVector2(from.p1, to.p1, t),\r\n };\r\n}\r\n\r\n/**\r\n * Sample a {@link MorphPlan} at progress `t` (0 → `from`, 1 → `to`), producing a\r\n * fresh {@link PathCommand} list: one `M`, one `C` per cubic, and a trailing `Z`\r\n * for closed subpaths.\r\n *\r\n * Closed subpaths emit `Z` rather than a final line back to the start. The ring's\r\n * last cubic already lands on its first anchor, so `Z` adds no length; what it does\r\n * is tell the renderer the contour is closed, which is what makes the stroke join\r\n * cleanly at the seam instead of drawing two unjoined end caps there.\r\n */\r\nexport function sample(plan: MorphPlan, t: number): PathCommand[] {\r\n const out: PathCommand[] = [];\r\n for (const pair of plan.pairs) {\r\n const n = pair.from.length;\r\n if (n === 0) continue;\r\n const first = lerpCubic(pair.from[0], pair.to[0], t);\r\n out.push({ type: \"M\", x: first.p0.x, y: first.p0.y });\r\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 });\r\n for (let i = 1; i < n; i++) {\r\n const c = lerpCubic(pair.from[i], pair.to[i], t);\r\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 });\r\n }\r\n if (pair.closed) out.push({ type: \"Z\" });\r\n }\r\n return out;\r\n}\r\n\r\n// --- Public tween entry point ----------------------------------------------\r\n\r\n/**\r\n * The morph plan is built from a `(from, to)` pair, which is constant for the\r\n * duration of one tween while `t` sweeps 0→1. {@link lerp} is invoked once\r\n * per frame with that same pair, so we cache the most recent plan to avoid\r\n * rebuilding it (subdivision + ring alignment is the costly part) every frame.\r\n * A one-entry cache is enough: tweens run one at a time per property and call us\r\n * with monotonically advancing `t` against fixed endpoints.\r\n */\r\nlet cachedPlan: { from: PathData; to: PathData; plan: MorphPlan } | null = null;\r\n\r\nfunction planFor(from: PathData, to: PathData): MorphPlan {\r\n if (cachedPlan && cachedPlan.from === from && cachedPlan.to === to) {\r\n return cachedPlan.plan;\r\n }\r\n const built = plan(commands(from), commands(to));\r\n cachedPlan = { from, to, plan: built };\r\n return built;\r\n}\r\n\r\n/**\r\n * Smoothly interpolate between two path shapes — the {@link PathData} tween used\r\n * by `Path`'s animatable `d` property and usable directly as a `LerpFunction`.\r\n *\r\n * `from`/`to` may be SVG `d` strings or {@link PathCommand} arrays and need not\r\n * share structure, command count, subpath count, point order, or winding — the\r\n * shapes are reconciled into a common cubic correspondence first (see the module\r\n * overview). At `t = 0` and `t = 1` the endpoints are returned verbatim so the\r\n * start and end frames are pixel-exact; in between, a morphed command list is\r\n * produced.\r\n *\r\n * @param from Source path (the shape at `t = 0`).\r\n * @param to Target path (the shape at `t = 1`).\r\n * @param t Progress in `[0, 1]`.\r\n */\r\nexport function lerp(from: PathData, to: PathData, t: number): PathData {\r\n if (t <= 0) return from;\r\n if (t >= 1) return to;\r\n return sample(planFor(from, to), t);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"morph.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,MAAM,CAAC,CAA8B;IACjD,MAAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,qEAAqE;QACrE,uEAAuE;QACvE,sEAAsE;QACtE,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC9D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACjC,yEAAyE;QACzE,uEAAuE;QACvE,GAAG,CAAC,IAAI,CAAC;YACL,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC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,CAAC","sourcesContent":["/**\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EACpE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GACrD,MAAM,WAAW,CAAC;AAoEnB,MAAM,CAAC,MAAM,OAAO,GAA+C;IAC/D,6DAA6D;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IACzB,IAAI;IAEJ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IAEP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,OAAO;IAEP,IAAI;IACJ,IAAI;IACJ,SAAS;IAET,IAAI;IACJ,MAAM;IAEN,WAAW;IACX,cAAc;IACd,YAAY;IACZ,GAAG;IACH,SAAS;IACT,MAAM;IACN,OAAO;IAEP,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;CACR,CAAC","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EACpE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GACrD,MAAM,WAAW,CAAC;AAoEnB,MAAM,CAAC,MAAM,OAAO,GAA+C;IAC/D,6DAA6D;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IACzB,IAAI;IAEJ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IAEP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,OAAO;IAEP,IAAI;IACJ,IAAI;IACJ,SAAS;IAET,IAAI;IACJ,MAAM;IAEN,WAAW;IACX,cAAc;IACd,YAAY;IACZ,GAAG;IACH,SAAS;IACT,MAAM;IACN,OAAO;IAEP,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;CACR,CAAC","sourcesContent":["/**\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/types.ts"],"names":[],"mappings":";AA0MA,8EAA8E","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/types.ts"],"names":[],"mappings":";AA0MA,8EAA8E","sourcesContent":["/**\n * Every type the path module names, in one place.\n *\n * The vocabulary is small and it is worth seeing all of it at once, because the\n * whole module is four representations and the conversions between them:\n *\n * PathData ─▶ PathCommand[] ─▶ PathContour[] ─┬─▶ CubicSubpath[] (morph)\n * a string as written the normal └─▶ VectorPath (editing)\n * or commands form\n */\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\n\n// ── Geometry ───────────────────────────────────────────────────────────────\n\n// `Extents` — the `{ minX, minY, maxX, maxY }` box — is `@/layout/bounds`'s,\n// not a second copy. A path's bounding box and a node's are the same idea, and\n// the two were already the same four fields under two names.\n\n/**\n * A single cubic Bézier: start anchor `p0`, controls `c1`/`c2`, end anchor `p1`.\n * The end anchor of one cubic is the start of the next within a subpath.\n */\nexport interface Cubic {\n p0: Vector2;\n c1: Vector2;\n c2: Vector2;\n p1: Vector2;\n}\n\n/** An SVG `A` command re-expressed as the ellipse arc it names. */\nexport interface ArcParams {\n cx: number;\n cy: number;\n /** Radii after the spec's \"scale up until the endpoints are reachable\" correction. */\n rx: number;\n ry: number;\n /** x-axis rotation, in **radians** (the command carries degrees). */\n phi: number;\n /** Start angle, and the signed sweep from it — `sweep`/`largeArc` already folded in. */\n theta1: number;\n dtheta: number;\n}\n\n// ── The normal form ────────────────────────────────────────────────────────\n\n/**\n * One piece of a contour, keeping its own kind.\n *\n * Normalizing everything to cubics would be simpler by one dimension and wrong\n * in a way that shows on screen: an arc is not a cubic, so `length`, `sampler`,\n * `dash` and `trim` would all inherit an approximation only *morph* and the\n * anchor model actually need.\n *\n * Plain data, not a bundle of closures: `contours` runs inside `measure()` on\n * every layout pass, and arc-length parameterization is the expensive part of\n * path geometry. Nothing here samples a curve — `Extents` come from\n * closed-form extrema, and arc length is a separate, lazy table.\n */\nexport type PathSegment =\n | { kind: \"line\"; from: Vector2; to: Vector2 }\n | { kind: \"quad\"; from: Vector2; c: Vector2; to: Vector2 }\n | { kind: \"cubic\"; from: Vector2; c1: Vector2; c2: Vector2; to: Vector2 }\n | {\n kind: \"arc\"; from: Vector2; to: Vector2;\n rx: number; ry: number; rotation: number; largeArc: 0 | 1; sweep: 0 | 1;\n };\n\n/**\n * One connected run — everything between an `M` and the next one.\n *\n * `start` is carried separately because a contour can legitimately have no\n * segments: a lone `M` is a real thing to write, it occupies a point that bounds\n * must account for, and the anchor model round-trips it as a single anchor.\n *\n * The closing edge of a `closed` contour is **not** in `segments` — `closed`\n * carries it. Storing it would mean a zero-length segment whenever the geometry\n * already ends where it started, which is most of the time.\n */\nexport interface PathContour {\n start: Vector2;\n segments: PathSegment[];\n /** Whether the run ended with a `Z`. */\n closed: boolean;\n}\n\n// ── Arc-length measurement ─────────────────────────────────────────────────\n\nexport interface SegmentMetric {\n segment: PathSegment;\n /** The flattened polyline, `from` first and `to` last. */\n points: Vector2[];\n /** Length along the polyline at each point; the last entry is `length`. */\n cumulative: number[];\n length: number;\n}\n\nexport interface ContourMetric {\n contour: PathContour;\n /** Every segment, the closed contour's implied join included. */\n metrics: SegmentMetric[];\n length: number;\n}\n\nexport interface PathMetric {\n contours: ContourMetric[];\n length: number;\n}\n\n/** A point on the path with the unit tangent direction there. */\nexport interface PathFrame {\n x: number;\n y: number;\n /** Unit tangent (direction of travel along the path). */\n tx: number;\n ty: number;\n}\n\nexport interface PathSampler {\n /** Total arc length across all contours. */\n readonly length: number;\n /**\n * Point and unit tangent at arc-length distance `d` from the path start.\n * `d` is clamped to `[0, length]`. Returns `null` only for a degenerate\n * (zero-length) path. Keeps an internal cursor so repeated calls with\n * non-decreasing `d` are amortized O(1).\n */\n frameAt(d: number): PathFrame | null;\n}\n\n// ── Morphing ───────────────────────────────────────────────────────────────\n\n/** A connected run of cubics (one `M` followed by curves), optionally closed. */\nexport interface CubicSubpath {\n cubics: Cubic[];\n /** True for subpaths that ended with a `Z` — eligible for rotation/reversal. */\n closed: boolean;\n}\n\n/** A correspondence between two paths, pre-aligned so it can be sampled at any `t`. */\nexport interface MorphPlan {\n /** Subpath pairs; each pair has the same number of cubics on both sides. */\n pairs: Array<{\n from: Cubic[];\n to: Cubic[];\n /**\n * Whether the sampled subpath should be closed with a `Z`. A pair is\n * closed when both sides were closed rings — a closed shape morphing to\n * another closed shape stays closed, so the stroke forms a proper join\n * at the seam instead of leaving two unconnected free ends.\n */\n closed: boolean;\n }>;\n}\n\n// ── The editable anchor model ──────────────────────────────────────────────\n\n/**\n * One anchor on a subpath, with the two control points that shape the segments\n * meeting at it.\n *\n * Handles are **absolute** points in the same space as {@link PathAnchor.point},\n * not offsets from it. That is what an SVG cubic stores, so serializing is a\n * copy rather than an addition, and it is the space a canvas editor drags them\n * in — an offset model would convert twice per pointer event for no gain.\n *\n * `null` means \"no handle on this side\", which draws as a straight segment. A\n * corner point has both null; a smooth point has both, mirrored through the\n * anchor; an asymmetric point has both, pointing opposite ways at different\n * lengths. The model does not record which of the three a point *is* — that is\n * derived from the handles, so a file cannot claim to be smooth while holding\n * handles that aren't.\n */\nexport interface PathAnchor {\n point: Vector2;\n /** Control point for the segment **arriving** at this anchor. */\n inHandle: Vector2 | null;\n /** Control point for the segment **leaving** it. */\n outHandle: Vector2 | null;\n}\n\n/** A single contiguous run of anchors — one `M …` in the `d` string. */\nexport interface PathSubpath {\n anchors: PathAnchor[];\n /** Whether the last anchor joins back to the first (`Z`). */\n closed: boolean;\n}\n\n/** A whole path: zero or more subpaths. */\nexport type VectorPath = PathSubpath[];\n\n/** Scale and offset applied on each axis, as `pathOps.normalize` reports it. */\nexport interface PathNormalization {\n /** The path, remapped so its bounds are exactly the unit box. */\n path: VectorPath;\n /** How much wider the geometry became, as a multiple of the old box. */\n scaleX: number;\n scaleY: number;\n /** Where the old geometry's centre sat, in the *old* unit space. */\n centerX: number;\n centerY: number;\n}\n\n// ── The operation surface ──────────────────────────────────────────────────\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/walk.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAC7E,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EACvE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,GAChE,MAAM,UAAU,CAAC;AAgBlB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;GAQG;AACH,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAE/C,SAAS,WAAW,CAAC,EAAU;IAC3B,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,EAA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G,IAAI,CAAC;gBACnB,CAAC;gBACD,MAAM,GAAG,YAAY,CAAC;gBACtB,MAAM;YACV,CAAC;QACL,CAAC;QAED,yEAAyE;QACzE,uEAAuE;QACvE,yCAAyC;QACzC,WAAW,GAAG,OAAO,CAAC;QACtB,UAAU,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,MAAM,CAAC,CAA8B;IACjD,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,IAAI,CAAC,CAA8B;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACtB,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACzC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AACvE,CAAC","sourcesContent":["/**\r\n * From a `d` string to the normal form: the scanner, the parser, the one pen\r\n * walk, and everything that reads a {@link PathSegment} once it exists.\r\n *\r\n * There were **seven** pen walks — one each in `bounds`, `length`, `dash`,\r\n * `sampler`, `subpath`, `morph` and the editor's vector model — and they\r\n * disagreed. Four forgot that `Z` returns the cursor to the contour's start, so\r\n * a relative command after a close resolved against the wrong point. Three kept\r\n * a single slot for the control point an `S`/`T` reflects, so a `T` following a\r\n * `C` reflected a cubic's control as if it were a quadratic's. One handled arcs\r\n * exactly, one as a subdivided chord, one as a single chord, one by dropping\r\n * them, and one by aborting the parse.\r\n *\r\n * Everything downstream takes {@link PathContour}s from here.\r\n */\r\nimport { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\r\nimport {\r\n arcAxisAngles, arcContainsAngle, arcParams, arcPointAtAngle, arcSweepToCubics,\r\n cubicExtrema, cubicPoint, distance, extractCubicRange, extractQuadRange,\r\n lerpVector2, lineToCubic, quadExtrema, quadPoint, quadToCubic,\r\n} from \"./bezier\";\r\nimport type { Extents } from \"@/layout/bounds\";\r\nimport type { ArcParams, Cubic, PathContour, PathSegment } from \"./types\";\r\n\r\n/** The incremental scanner {@link parseCommands} drives. */\r\ninterface PathScanner {\r\n atEnd(): boolean;\r\n /** The next command letter, consumed, or `null` if a number comes first. */\r\n takeLetter(): string | null;\r\n /** Whether a number follows — i.e. whether a coordinate run continues. */\r\n hasNumber(): boolean;\r\n takeNumber(): number | null;\r\n /** A single-character `0`/`1` arc flag, consumed, or `null`. */\r\n takeFlag(): 0 | 1 | null;\r\n}\r\n\r\n/**\r\n * The one `d`-string scanner.\r\n *\r\n * There were two: a regex split (`/([MmLlHhVvCcSsQqTtAaZz])|(-?[\\d.]+(?:e[-+]?\\d+)?)/`)\r\n * and a hand-rolled one in the editor model. They accepted different languages —\r\n * the regex reads `.5.5` as a single token and `parseFloat` then silently keeps\r\n * only the first half, so `M .5.5` parsed as a move to an undefined y.\r\n *\r\n * **It scans on demand rather than tokenizing up front**, because SVG's grammar\r\n * is not context-free: an arc's `largeArc` and `sweep` are single *characters*,\r\n * and the spec lets them run together with what follows. A real icon writes\r\n * `A9.564 9.564 0 0112 6.844`, where `0112` is the flag `0`, the flag `1`, and\r\n * the coordinate `12` — a number scanner with no idea what it is reading takes\r\n * it for one number and puts the arc's endpoint 100 units away. Both parsers\r\n * this replaces had that bug.\r\n *\r\n * Deliberately forgiving otherwise. This value comes out of a database column\r\n * that a previous version of an app — or an author pasting a path in — may have\r\n * written, and a strict scanner's answer to a malformed tail is to throw away\r\n * geometry that was rendering fine a moment ago. So a token it can't read ends\r\n * the scan and keeps everything before it, which degrades to \"the shape is\r\n * missing its last curve\" instead of \"the node is empty\".\r\n */\r\n\r\n/**\r\n * Every command letter, including the arcs.\r\n *\r\n * `A`/`a` were absent from the editor model's copy of this list, which made its\r\n * scanner stop dead at the first arc — so a pasted icon (arcs are how every icon\r\n * set draws a rounded join) lost everything from that point on. The arc is\r\n * dropped at the *model* boundary now, where it is a deliberate conversion to\r\n * cubics, rather than here where it was a silent truncation.\r\n */\r\nconst COMMAND_LETTERS = \"MmLlHhVvCcSsQqTtAaZz\";\r\n\r\nfunction isSeparator(ch: string): boolean {\r\n return ch === \" \" || ch === \",\" || ch === \"\\t\" || ch === \"\\n\" || ch === \"\\r\";\r\n}\r\n\r\nfunction isDigit(ch: string): boolean {\r\n return ch >= \"0\" && ch <= \"9\";\r\n}\r\n\r\nfunction createPathScanner(data: string): PathScanner {\r\n let i = 0;\r\n\r\n const skip = () => {\r\n while (i < data.length && isSeparator(data[i])) i++;\r\n };\r\n\r\n const scanNumber = (): number | null => {\r\n skip();\r\n const start = i;\r\n if (data[i] === \"+\" || data[i] === \"-\") i++;\r\n while (i < data.length && isDigit(data[i])) i++;\r\n if (data[i] === \".\") {\r\n i++;\r\n while (i < data.length && isDigit(data[i])) i++;\r\n }\r\n if (data[i] === \"e\" || data[i] === \"E\") {\r\n const mark = i;\r\n i++;\r\n if (data[i] === \"+\" || data[i] === \"-\") i++;\r\n if (i < data.length && isDigit(data[i])) {\r\n while (i < data.length && isDigit(data[i])) i++;\r\n } else {\r\n i = mark;\r\n }\r\n }\r\n if (i === start) return null;\r\n const value = Number(data.slice(start, i));\r\n if (!Number.isFinite(value)) {\r\n i = start;\r\n return null;\r\n }\r\n return value;\r\n };\r\n\r\n return {\r\n atEnd: () => {\r\n skip();\r\n return i >= data.length;\r\n },\r\n takeLetter: () => {\r\n skip();\r\n if (i < data.length && COMMAND_LETTERS.includes(data[i])) return data[i++];\r\n return null;\r\n },\r\n hasNumber: () => {\r\n skip();\r\n if (i >= data.length) return false;\r\n const ch = data[i];\r\n return isDigit(ch) || ch === \".\" || ch === \"+\" || ch === \"-\";\r\n },\r\n takeNumber: scanNumber,\r\n takeFlag: () => {\r\n skip();\r\n // One character, no sign and no decimal point — that is the whole\r\n // grammar for a flag, and reading it as a number is the bug.\r\n if (data[i] === \"0\") { i++; return 0; }\r\n if (data[i] === \"1\") { i++; return 1; }\r\n return null;\r\n },\r\n };\r\n}\r\n\r\nexport function lineSegment(from: Vector2, to: Vector2): PathSegment {\r\n return { kind: \"line\", from, to };\r\n}\r\n\r\nexport function quadSegment(from: Vector2, c: Vector2, to: Vector2): PathSegment {\r\n return { kind: \"quad\", from, c, to };\r\n}\r\n\r\nexport function cubicSegment(from: Vector2, c1: Vector2, c2: Vector2, to: Vector2): PathSegment {\r\n return { kind: \"cubic\", from, c1, c2, to };\r\n}\r\n\r\n/**\r\n * An arc, or the line it degenerates to.\r\n *\r\n * A zero radius or coincident endpoints make the endpoint→center conversion\r\n * divide by zero, and the SVG spec says both draw as a straight line — so the\r\n * substitution happens here rather than in each of the four places that would\r\n * otherwise have to guard.\r\n */\r\nexport function arcSegment(\r\n from: Vector2, to: Vector2,\r\n rx: number, ry: number, rotation: number, largeArc: 0 | 1, sweep: 0 | 1,\r\n): PathSegment {\r\n if (rx === 0 || ry === 0 || (from.x === to.x && from.y === to.y)) {\r\n return lineSegment(from, to);\r\n }\r\n return { kind: \"arc\", from, to, rx, ry, rotation, largeArc, sweep };\r\n}\r\n\r\n/** The ellipse an arc segment names. Cheap, but not free — hoist it in a loop. */\r\nexport function segmentArc(segment: PathSegment & { kind: \"arc\" }): ArcParams {\r\n return arcParams(\r\n segment.from, segment.to,\r\n segment.rx, segment.ry, segment.rotation, segment.largeArc, segment.sweep,\r\n );\r\n}\r\n\r\n/** The point at parameter `t` (0..1). */\r\nexport function segmentPointAt(segment: PathSegment, t: number): Vector2 {\r\n switch (segment.kind) {\r\n case \"line\": return lerpVector2(segment.from, segment.to, t);\r\n case \"quad\": return quadPoint(segment.from, segment.c, segment.to, t);\r\n case \"cubic\": return cubicPoint(segment.from, segment.c1, segment.c2, segment.to, t);\r\n case \"arc\": {\r\n const arc = segmentArc(segment);\r\n return arcPointAtAngle(arc, arc.theta1 + t * arc.dtheta);\r\n }\r\n }\r\n}\r\n\r\nfunction boxOf(points: Vector2[]): Extents {\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n for (const p of points) {\r\n if (p.x < minX) minX = p.x;\r\n if (p.x > maxX) maxX = p.x;\r\n if (p.y < minY) minY = p.y;\r\n if (p.y > maxY) maxY = p.y;\r\n }\r\n return { minX, minY, maxX, maxY };\r\n}\r\n\r\n/**\r\n * The segment's tight box — its own extrema, solved, not its control hull.\r\n *\r\n * Closed form on every kind, so this stays cheap enough for `measure()`. The\r\n * control hull can sit a long way outside the curve: `size` used it\r\n * and a hugging `Path` was correspondingly too big, while an arc — whose hull it\r\n * had no way to compute at all — was measured across its chord and came back\r\n * flat on one axis.\r\n */\r\nexport function segmentBounds(segment: PathSegment): Extents {\r\n switch (segment.kind) {\r\n case \"line\":\r\n return boxOf([segment.from, segment.to]);\r\n case \"quad\": {\r\n const at = (t: number) => quadPoint(segment.from, segment.c, segment.to, t);\r\n return boxOf([\r\n segment.from, segment.to,\r\n ...quadExtrema(segment.from.x, segment.c.x, segment.to.x).map(at),\r\n ...quadExtrema(segment.from.y, segment.c.y, segment.to.y).map(at),\r\n ]);\r\n }\r\n case \"cubic\": {\r\n const at = (t: number) => cubicPoint(segment.from, segment.c1, segment.c2, segment.to, t);\r\n return boxOf([\r\n segment.from, segment.to,\r\n ...cubicExtrema(segment.from.x, segment.c1.x, segment.c2.x, segment.to.x).map(at),\r\n ...cubicExtrema(segment.from.y, segment.c1.y, segment.c2.y, segment.to.y).map(at),\r\n ]);\r\n }\r\n case \"arc\": {\r\n const arc = segmentArc(segment);\r\n const points: Vector2[] = [segment.from, segment.to];\r\n const angles = arcAxisAngles(arc);\r\n for (const theta of [...angles.x, ...angles.y]) {\r\n if (arcContainsAngle(arc, theta)) points.push(arcPointAtAngle(arc, theta));\r\n }\r\n return boxOf(points);\r\n }\r\n }\r\n}\r\n\r\n/** The segment as cubics. Exact for every kind but `arc`. */\r\nexport function segmentCubics(segment: PathSegment): Cubic[] {\r\n switch (segment.kind) {\r\n case \"line\": return [lineToCubic(segment.from, segment.to)];\r\n case \"quad\": return [quadToCubic(segment.from, segment.c, segment.to)];\r\n case \"cubic\": return [{ p0: segment.from, c1: segment.c1, c2: segment.c2, p1: segment.to }];\r\n case \"arc\": {\r\n const arc = segmentArc(segment);\r\n const cubics = arcSweepToCubics(arc, arc.theta1, arc.theta1 + arc.dtheta);\r\n return cubics.length > 0 ? cubics : [lineToCubic(segment.from, segment.to)];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The sub-range `t0..t1` as commands, with no leading move.\r\n *\r\n * A sub-range of an arc is still an arc, so it stays one rather than being\r\n * refitted — the old trim approximated it with cubics through sampled points\r\n * using a *tangent* formula, which was wrong on top of being lossy.\r\n */\r\nexport function segmentSplit(segment: PathSegment, t0: number, t1: number): PathCommand[] {\r\n switch (segment.kind) {\r\n case \"line\": {\r\n const p = lerpVector2(segment.from, segment.to, t1);\r\n return [{ type: \"L\", x: p.x, y: p.y }];\r\n }\r\n case \"quad\": {\r\n const sub = extractQuadRange(segment.from, segment.c, segment.to, t0, t1);\r\n return [{ type: \"Q\", x1: sub.cp.x, y1: sub.cp.y, x: sub.to.x, y: sub.to.y }];\r\n }\r\n case \"cubic\": {\r\n const sub = extractCubicRange(segment.from, segment.c1, segment.c2, segment.to, t0, t1);\r\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 }];\r\n }\r\n case \"arc\": {\r\n const arc = segmentArc(segment);\r\n const a0 = arc.theta1 + t0 * arc.dtheta;\r\n const a1 = arc.theta1 + t1 * arc.dtheta;\r\n const to = arcPointAtAngle(arc, a1);\r\n return [{\r\n type: \"A\",\r\n rx: arc.rx, ry: arc.ry, rotation: segment.rotation,\r\n largeArc: (Math.abs(a1 - a0) > Math.PI ? 1 : 0) as 0 | 1,\r\n sweep: segment.sweep,\r\n x: to.x, y: to.y,\r\n }];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The closing line of a closed contour, when it has any length.\r\n *\r\n * Every walk this replaced synthesized this the same way, so one synthesis\r\n * reproduces all of them.\r\n */\r\nexport function closingSegment(contour: PathContour): PathSegment | null {\r\n if (!contour.closed || contour.segments.length === 0) return null;\r\n const end = contour.segments[contour.segments.length - 1].to;\r\n if (Math.abs(end.x - contour.start.x) < 1e-9 && Math.abs(end.y - contour.start.y) < 1e-9) return null;\r\n return lineSegment(end, contour.start);\r\n}\r\n\r\n/** Every segment of a contour, the implied closing line included. */\r\nexport function contourSegments(contour: PathContour): PathSegment[] {\r\n const closing = closingSegment(contour);\r\n return closing ? [...contour.segments, closing] : contour.segments;\r\n}\r\n\r\n/** The union of every segment's box, or `null` when there is no geometry at all. */\r\nexport function contourBounds(contours: PathContour[]): Extents | null {\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n let seen = false;\r\n const include = (box: Extents) => {\r\n seen = true;\r\n if (box.minX < minX) minX = box.minX;\r\n if (box.minY < minY) minY = box.minY;\r\n if (box.maxX > maxX) maxX = box.maxX;\r\n if (box.maxY > maxY) maxY = box.maxY;\r\n };\r\n for (const contour of contours) {\r\n // A lone `M` still occupies a point. The closing line joins two points\r\n // already counted, so it never widens the box.\r\n if (contour.segments.length === 0) {\r\n include({ minX: contour.start.x, minY: contour.start.y, maxX: contour.start.x, maxY: contour.start.y });\r\n continue;\r\n }\r\n for (const segment of contour.segments) include(segmentBounds(segment));\r\n }\r\n return seen ? { minX, minY, maxX, maxY } : null;\r\n}\r\n\r\n/** Straight-line distance between a segment's endpoints — its chord. */\r\nexport function segmentChord(segment: PathSegment): number {\r\n return distance(segment.from, segment.to);\r\n}\r\n\r\n/**\r\n * Parses a `d` string into commands, **as written** — relative stays relative,\r\n * shorthands stay short, arcs stay arcs.\r\n *\r\n * Normalizing here would throw away the one thing a caller might still want the\r\n * original for (round-tripping a stored string), and {@link contours} resolves\r\n * all of it one step later anyway.\r\n */\r\nexport function parseCommands(d: string): PathCommand[] {\r\n const scan = createPathScanner(d);\r\n const commands: PathCommand[] = [];\r\n let letter: string | null = null;\r\n\r\n while (!scan.atEnd()) {\r\n const next = scan.takeLetter();\r\n if (next !== null) {\r\n letter = next;\r\n } else if (letter === null) {\r\n // Numbers before any command: nothing says what they mean.\r\n return commands;\r\n } else if (letter === \"M\") {\r\n // The pair after an `M` is an implicit `L` — the one case where a\r\n // coordinate run continues as a *different* command than its letter.\r\n letter = \"L\";\r\n } else if (letter === \"m\") {\r\n letter = \"l\";\r\n } else if (letter === \"Z\" || letter === \"z\") {\r\n // `Z` takes no arguments, so a number after one is a malformed\r\n // string rather than a repeat.\r\n return commands;\r\n }\r\n\r\n const upper = letter.toUpperCase();\r\n const rel = letter !== upper;\r\n\r\n if (upper === \"Z\") {\r\n commands.push({ type: \"Z\" });\r\n continue;\r\n }\r\n\r\n // `null` anywhere below means the string ran out or turned to garbage\r\n // mid-command; the partial command is dropped and the rest kept.\r\n const n = (count: number): number[] | null => {\r\n const out: number[] = [];\r\n for (let i = 0; i < count; i++) {\r\n const value = scan.takeNumber();\r\n if (value === null) return null;\r\n out.push(value);\r\n }\r\n return out;\r\n };\r\n\r\n switch (upper) {\r\n case \"M\": case \"L\": case \"T\": {\r\n const a = n(2);\r\n if (!a) return commands;\r\n const type = upper === \"M\" ? \"M\" : upper === \"L\" ? \"L\" : \"T\";\r\n commands.push({ type: (rel ? type.toLowerCase() : type) as never, x: a[0], y: a[1] });\r\n break;\r\n }\r\n case \"H\": {\r\n const a = n(1);\r\n if (!a) return commands;\r\n commands.push({ type: rel ? \"h\" : \"H\", x: a[0] });\r\n break;\r\n }\r\n case \"V\": {\r\n const a = n(1);\r\n if (!a) return commands;\r\n commands.push({ type: rel ? \"v\" : \"V\", y: a[0] });\r\n break;\r\n }\r\n case \"C\": {\r\n const a = n(6);\r\n if (!a) return commands;\r\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] });\r\n break;\r\n }\r\n case \"S\": case \"Q\": {\r\n const a = n(4);\r\n if (!a) return commands;\r\n commands.push(upper === \"S\"\r\n ? { type: rel ? \"s\" : \"S\", x2: a[0], y2: a[1], x: a[2], y: a[3] }\r\n : { type: rel ? \"q\" : \"Q\", x1: a[0], y1: a[1], x: a[2], y: a[3] });\r\n break;\r\n }\r\n case \"A\": {\r\n // The flags are read as single characters, not numbers — see\r\n // `createPathScanner`.\r\n const radii = n(3);\r\n if (!radii) return commands;\r\n const largeArc = scan.takeFlag();\r\n const sweep = scan.takeFlag();\r\n if (largeArc === null || sweep === null) return commands;\r\n const end = n(2);\r\n if (!end) return commands;\r\n commands.push({\r\n type: rel ? \"a\" : \"A\",\r\n rx: radii[0], ry: radii[1], rotation: radii[2],\r\n largeArc, sweep,\r\n x: end[0], y: end[1],\r\n });\r\n break;\r\n }\r\n default:\r\n // An unknown letter: stop rather than guess how many numbers it eats.\r\n return commands;\r\n }\r\n\r\n if (!scan.hasNumber() && scan.atEnd()) break;\r\n }\r\n return commands;\r\n}\r\n\r\n/** Coerce loose {@link PathData} into commands. Nullish is an empty path, not a throw. */\r\nexport function commands(d: PathData | null | undefined): PathCommand[] {\r\n if (d == null) return [];\r\n return typeof d === \"string\" ? parseCommands(d) : d;\r\n}\r\n\r\n/**\r\n * Contours already walked, keyed by the value they were walked from.\r\n *\r\n * `Path.measure` and `Text.measure` re-walk the same `d` every layout pass, and\r\n * a string key hits by value while an authored `PathCommand[]` hits by\r\n * reference — so a static path is walked once and a tweened one, whose array is\r\n * fresh each frame, misses exactly as `morph.ts`'s plan cache does. Bounded and\r\n * insertion-ordered, so those fresh arrays age out instead of accumulating.\r\n *\r\n * The cached list is shared, so treat what comes back as read-only.\r\n */\r\nconst CONTOUR_CACHE = new Map<PathData, PathContour[]>();\r\nconst CONTOUR_CACHE_MAX = 32;\r\n\r\n/**\r\n * Resolves commands into absolute contours of typed segments.\r\n *\r\n * The three things every previous walk had to get right, in one place: relative\r\n * commands resolve against the pen, `Z` returns the pen to the contour's start,\r\n * and `S`/`T` reflect from **separate** cubic and quadratic slots, each cleared\r\n * by a command of the other kind.\r\n */\r\nexport function contours(d: PathData | null | undefined): PathContour[] {\r\n if (d == null) return [];\r\n const cached = CONTOUR_CACHE.get(d);\r\n if (cached) return cached;\r\n const walked = walkCommands(commands(d));\r\n if (CONTOUR_CACHE.size >= CONTOUR_CACHE_MAX) {\r\n CONTOUR_CACHE.delete(CONTOUR_CACHE.keys().next().value!);\r\n }\r\n CONTOUR_CACHE.set(d, walked);\r\n return walked;\r\n}\r\n\r\n/** {@link contours} without the memo — the walk itself. */\r\nexport function walkCommands(list: PathCommand[]): PathContour[] {\r\n const out: PathContour[] = [];\r\n\r\n let current: PathContour | null = null;\r\n let cursor: Vector2 = { x: 0, y: 0 };\r\n let contourStart: Vector2 = { x: 0, y: 0 };\r\n let prevCubicCp: Vector2 | null = null;\r\n let prevQuadCp: Vector2 | null = null;\r\n\r\n // Returns rather than assigning, so the compiler can still see that `current`\r\n // is non-null after a call — a closure that assigned it would defeat that.\r\n const open = (at: Vector2): PathContour => {\r\n const contour: PathContour = { start: at, segments: [], closed: false };\r\n out.push(contour);\r\n contourStart = at;\r\n return contour;\r\n };\r\n const push = (segment: PathSegment) => {\r\n // A drawing command before any `M` starts a contour where the pen is,\r\n // which is the origin. Malformed, but recoverable, and every previous\r\n // walk did the same.\r\n if (!current) current = open(cursor);\r\n current.segments.push(segment);\r\n };\r\n\r\n for (const cmd of list) {\r\n const rel = cmd.type !== cmd.type.toUpperCase();\r\n const abs = (x: number, y: number): Vector2 =>\r\n rel ? { x: cursor.x + x, y: cursor.y + y } : { x, y };\r\n\r\n let cubicCp: Vector2 | null = null;\r\n let quadCp: Vector2 | null = null;\r\n\r\n switch (cmd.type) {\r\n case \"M\": case \"m\": {\r\n const to = abs(cmd.x, cmd.y);\r\n current = open(to);\r\n cursor = to;\r\n break;\r\n }\r\n case \"L\": case \"l\": {\r\n const to = abs(cmd.x, cmd.y);\r\n push(lineSegment(cursor, to));\r\n cursor = to;\r\n break;\r\n }\r\n case \"H\": case \"h\": {\r\n const to = { x: rel ? cursor.x + cmd.x : cmd.x, y: cursor.y };\r\n push(lineSegment(cursor, to));\r\n cursor = to;\r\n break;\r\n }\r\n case \"V\": case \"v\": {\r\n const to = { x: cursor.x, y: rel ? cursor.y + cmd.y : cmd.y };\r\n push(lineSegment(cursor, to));\r\n cursor = to;\r\n break;\r\n }\r\n case \"C\": case \"c\": {\r\n const c1 = abs(cmd.x1, cmd.y1);\r\n const c2 = abs(cmd.x2, cmd.y2);\r\n const to = abs(cmd.x, cmd.y);\r\n push(cubicSegment(cursor, c1, c2, to));\r\n cursor = to;\r\n cubicCp = c2;\r\n break;\r\n }\r\n case \"S\": case \"s\": {\r\n const c1 = prevCubicCp\r\n ? { x: 2 * cursor.x - prevCubicCp.x, y: 2 * cursor.y - prevCubicCp.y }\r\n : cursor;\r\n const c2 = abs(cmd.x2, cmd.y2);\r\n const to = abs(cmd.x, cmd.y);\r\n push(cubicSegment(cursor, c1, c2, to));\r\n cursor = to;\r\n cubicCp = c2;\r\n break;\r\n }\r\n case \"Q\": case \"q\": {\r\n const cp = abs(cmd.x1, cmd.y1);\r\n const to = abs(cmd.x, cmd.y);\r\n push(quadSegment(cursor, cp, to));\r\n cursor = to;\r\n quadCp = cp;\r\n break;\r\n }\r\n case \"T\": case \"t\": {\r\n // Annotated because `quadCp` feeds `prevQuadCp` feeds this — a\r\n // real cycle for inference, unlike `S`, whose slot takes `c2`.\r\n const cp: Vector2 = prevQuadCp\r\n ? { x: 2 * cursor.x - prevQuadCp.x, y: 2 * cursor.y - prevQuadCp.y }\r\n : cursor;\r\n const to = abs(cmd.x, cmd.y);\r\n push(quadSegment(cursor, cp, to));\r\n cursor = to;\r\n quadCp = cp;\r\n break;\r\n }\r\n case \"A\": case \"a\": {\r\n const to = abs(cmd.x, cmd.y);\r\n push(arcSegment(cursor, to, cmd.rx, cmd.ry, cmd.rotation, cmd.largeArc, cmd.sweep));\r\n cursor = to;\r\n break;\r\n }\r\n case \"Z\": case \"z\": {\r\n if (current) {\r\n current.closed = true;\r\n // The closing line is implied by `closed`, not stored — a\r\n // stored one would be a zero-length segment whenever the\r\n // contour already ends where it started, which is most of\r\n // the time.\r\n current = null;\r\n }\r\n cursor = contourStart;\r\n break;\r\n }\r\n }\r\n\r\n // Only a curve leaves a control point behind. Anything else clears both,\r\n // which is what makes an `S` after a line start from the cursor rather\r\n // than from a curve three commands back.\r\n prevCubicCp = cubicCp;\r\n prevQuadCp = quadCp;\r\n }\r\n\r\n return out;\r\n}\r\n\r\n/** The tight box, or `null` for a path with no geometry at all. */\r\nexport function bounds(d: PathData | null | undefined): Extents | null {\r\n return contourBounds(contours(d));\r\n}\r\n\r\n/** {@link bounds} as a size. An empty path is `0 x 0` rather than `null`. */\r\nexport function size(d: PathData | null | undefined): { width: number; height: number } {\r\n const box = bounds(d);\r\n if (!box) return { width: 0, height: 0 };\r\n return { width: box.maxX - box.minX, height: box.maxY - box.minY };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/walk.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAC7E,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EACvE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,GAChE,MAAM,UAAU,CAAC;AAgBlB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;GAQG;AACH,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAE/C,SAAS,WAAW,CAAC,EAAU;IAC3B,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,KA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Y;oBACZ,OAAO,GAAG,IAAI,CAAC;gBACnB,CAAC;gBACD,MAAM,GAAG,YAAY,CAAC;gBACtB,MAAM;YACV,CAAC;QACL,CAAC;QAED,yEAAyE;QACzE,uEAAuE;QACvE,yCAAyC;QACzC,WAAW,GAAG,OAAO,CAAC;QACtB,UAAU,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,MAAM,CAAC,CAA8B;IACjD,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,IAAI,CAAC,CAA8B;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACtB,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACzC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AACvE,CAAC","sourcesContent":["/**\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC","sourcesContent":["export * from \"./pack\";\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC","sourcesContent":["export * from \"./language\";\nexport * from \"./pack\";\nexport * from \"./resolve\";\nexport * from \"./uniforms\";\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The language a custom shader is written in: WGSL, the only one the renderer
|
|
3
|
+
* runs. A fill defines `fn fill(in: FillIn) -> vec4f`, an effect
|
|
4
|
+
* `fn effect(in: EffectIn) -> vec4f`; uniforms are the members of
|
|
5
|
+
* `struct Params`, read as `u.<name>`.
|
|
6
|
+
*/
|
|
7
|
+
export type ShaderLanguage = "wgsl";
|
|
8
|
+
/** Whether a shader fill, shader effect or shader pack is WGSL: its `language` is absent or `"wgsl"`. */
|
|
9
|
+
export declare function isWgslShader(shader: {
|
|
10
|
+
language?: string;
|
|
11
|
+
}): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The version of the WGSL contract a shader is written against: `FillIn` /
|
|
14
|
+
* `EffectIn`, the helpers, and uniforms bound to `struct Params` by name
|
|
15
|
+
* (packages/renderer/DESIGN.md §6.3). Bumped only by a change that would draw
|
|
16
|
+
* an existing shader differently. A WGSL fill or effect resolves with
|
|
17
|
+
* `contract` set (stamped with this when absent), so a stored document says
|
|
18
|
+
* what it was written for and a renderer can tell a newer one apart.
|
|
19
|
+
*/
|
|
20
|
+
export declare const WGSL_CONTRACT = 1;
|
|
21
|
+
/** The contract a shader states, or the current one for a WGSL shader that states none; `undefined` for any other language. */
|
|
22
|
+
export declare function shaderContractOf(shader: {
|
|
23
|
+
language?: string;
|
|
24
|
+
contract?: number;
|
|
25
|
+
}): number | undefined;
|
|
26
|
+
//# sourceMappingURL=language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/language.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,yGAAyG;AACzG,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,+HAA+H;AAC/H,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAGrG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Whether a shader fill, shader effect or shader pack is WGSL: its `language` is absent or `"wgsl"`. */
|
|
2
|
+
export function isWgslShader(shader) {
|
|
3
|
+
return shader.language === undefined || shader.language === "wgsl";
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The version of the WGSL contract a shader is written against: `FillIn` /
|
|
7
|
+
* `EffectIn`, the helpers, and uniforms bound to `struct Params` by name
|
|
8
|
+
* (packages/renderer/DESIGN.md §6.3). Bumped only by a change that would draw
|
|
9
|
+
* an existing shader differently. A WGSL fill or effect resolves with
|
|
10
|
+
* `contract` set (stamped with this when absent), so a stored document says
|
|
11
|
+
* what it was written for and a renderer can tell a newer one apart.
|
|
12
|
+
*/
|
|
13
|
+
export const WGSL_CONTRACT = 1;
|
|
14
|
+
/** The contract a shader states, or the current one for a WGSL shader that states none; `undefined` for any other language. */
|
|
15
|
+
export function shaderContractOf(shader) {
|
|
16
|
+
if (!isWgslShader(shader))
|
|
17
|
+
return undefined;
|
|
18
|
+
return shader.contract ?? WGSL_CONTRACT;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=language.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/language.ts"],"names":[],"mappings":"AAQA,yGAAyG;AACzG,MAAM,UAAU,YAAY,CAAC,MAA6B;IACtD,OAAO,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC;AACvE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,+HAA+H;AAC/H,MAAM,UAAU,gBAAgB,CAAC,MAAgD;IAC7E,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO,MAAM,CAAC,QAAQ,IAAI,aAAa,CAAC;AAC5C,CAAC","sourcesContent":["/**\n * The language a custom shader is written in: WGSL, the only one the renderer\n * runs. A fill defines `fn fill(in: FillIn) -> vec4f`, an effect\n * `fn effect(in: EffectIn) -> vec4f`; uniforms are the members of\n * `struct Params`, read as `u.<name>`.\n */\nexport type ShaderLanguage = \"wgsl\";\n\n/** Whether a shader fill, shader effect or shader pack is WGSL: its `language` is absent or `\"wgsl\"`. */\nexport function isWgslShader(shader: { language?: string }): boolean {\n return shader.language === undefined || shader.language === \"wgsl\";\n}\n\n/**\n * The version of the WGSL contract a shader is written against: `FillIn` /\n * `EffectIn`, the helpers, and uniforms bound to `struct Params` by name\n * (packages/renderer/DESIGN.md §6.3). Bumped only by a change that would draw\n * an existing shader differently. A WGSL fill or effect resolves with\n * `contract` set (stamped with this when absent), so a stored document says\n * what it was written for and a renderer can tell a newer one apart.\n */\nexport const WGSL_CONTRACT = 1;\n\n/** The contract a shader states, or the current one for a WGSL shader that states none; `undefined` for any other language. */\nexport function shaderContractOf(shader: { language?: string; contract?: number }): number | undefined {\n if (!isWgslShader(shader)) return undefined;\n return shader.contract ?? WGSL_CONTRACT;\n}\n"]}
|