@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
package/README.md
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
# @motionscript/core
|
|
2
|
-
|
|
3
|
-
The engine-agnostic animation library at the heart of [Motion Script](https://motionscript.dev).
|
|
4
|
-
It defines what a scene is — a JSON document of nodes and commands — and how a
|
|
5
|
-
project of them evolves over time: the scene graph, props and tweens, flow
|
|
6
|
-
layout and the runtime that plays it, independent of any rendering backend and
|
|
7
|
-
with zero dependencies.
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import type { CompositionDocument } from '@motionscript/core';
|
|
11
|
-
|
|
12
|
-
// A scene is data: a tree of nodes, then commands placed at times.
|
|
13
|
-
const doc: CompositionDocument = {
|
|
14
|
-
kind: 'composition',
|
|
15
|
-
nodes: [
|
|
16
|
-
{ id: 'card', type: 'rect', parentId: null, layerOrder: 0,
|
|
17
|
-
props: { width: 400, height: 400, fill: 'white', cornerRadius: 20 } },
|
|
18
|
-
{ id: 'lens', type: 'ellipse', parentId: 'card', layerOrder: 0,
|
|
19
|
-
props: { width: 350, height: 350, fill: 'black' } },
|
|
20
|
-
],
|
|
21
|
-
commands: [
|
|
22
|
-
// Slide the lens 300px over 3 seconds.
|
|
23
|
-
{ id: 'slide', type: 'to', targetId: 'lens', at: 0, duration: 3, args: { x: 300 } },
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
A host plays it with `engine.open({ document: doc })`. A frame is a pure
|
|
29
|
-
function of its time, so a seek costs the same in either direction.
|
|
30
|
-
|
|
31
|
-
## What's in here
|
|
32
|
-
|
|
33
|
-
- **Documents**: `StillDocument`, `CompositionDocument` and `AudioDocument`, the
|
|
34
|
-
`ProjectDocument` that lays them on tracks, the validator, the expression
|
|
35
|
-
language, and the per-engine `Registry` that turns a node key into a class.
|
|
36
|
-
- **Runtime**: `Engine` and `Session`, which open a document on a platform and
|
|
37
|
-
play, seek and export it.
|
|
38
|
-
- **Nodes**: the scene graph (`Rect`, `Ellipse`, `Text`, `RichText`, `Video`,
|
|
39
|
-
paths, 3D, audio, and more) with attributes for fills, gradients, filters, and
|
|
40
|
-
|
|
41
|
-
and any document it opens can name it.
|
|
42
|
-
- **Tweens**: interpolation and easing for animating attributes over time.
|
|
43
|
-
- **Layout**: `flowOps`, the flow layout every 2D node runs on its children:
|
|
44
|
-
freeform, runs (wrapped or not) and grid.
|
|
45
|
-
- **Project / render / platform / assets**: the abstractions a renderer and a
|
|
46
|
-
platform implement to turn a scene graph into pixels, audio, and exported
|
|
47
|
-
video: `RenderContext2D`/`RenderContext3D` (implemented by
|
|
48
|
-
[`@motionscript/
|
|
49
|
-
in by [`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser)).
|
|
50
|
-
|
|
51
|
-
This package has no rendering backend of its own. Pair it with
|
|
52
|
-
[`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser) (
|
|
53
|
-
against the `platform`/`render` abstractions.
|
|
54
|
-
|
|
55
|
-
## Docs
|
|
56
|
-
|
|
57
|
-
Contributor documentation for this package lives in [`docs/`](https://github.com/motionscript-dev/motionscript/tree/main/packages/core/docs):
|
|
58
|
-
|
|
59
|
-
- [Module tour](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/overview.md): what each directory of `src` holds, what may
|
|
60
|
-
import what, validation, and what each barrel exports.
|
|
61
|
-
- [Registry](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/registry.md): the per-engine vocabulary and the built-in keys.
|
|
62
|
-
- [Variables and expressions](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/expressions.md): the expression grammar,
|
|
63
|
-
its closed function library, node references and cycles.
|
|
64
|
-
- [Timeline](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/timeline.md): compile, seek, presence, incremental patching
|
|
65
|
-
and the time conventions.
|
|
66
|
-
- [Commands, tweens and easing](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/commands.md): command shapes, `args`,
|
|
67
|
-
easing, loops and command traits.
|
|
68
|
-
- Also: [scene graph](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/scene-graph.md), [attributes](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/attributes.md),
|
|
69
|
-
[layout and text](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/layout-and-text.md), [assets](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/assets.md) and the
|
|
70
|
-
[project document](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/project-document.md).
|
|
71
|
-
|
|
72
|
-
## Usage
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
npm install @motionscript/core
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
See the [docs](https://motionscript.dev/docs) for the full feature set and API
|
|
79
|
-
reference.
|
|
80
|
-
|
|
81
|
-
## Development
|
|
82
|
-
|
|
83
|
-
From the monorepo root:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
pnpm --filter @motionscript/core build # eslint, then tsc, then the browser bundle
|
|
87
|
-
pnpm --filter @motionscript/core test # vitest
|
|
88
|
-
pnpm --filter @motionscript/core lint
|
|
89
|
-
pnpm --filter @motionscript/core typecheck
|
|
90
|
-
```
|
|
91
|
-
|
|
1
|
+
# @motionscript/core
|
|
2
|
+
|
|
3
|
+
The engine-agnostic animation library at the heart of [Motion Script](https://motionscript.dev).
|
|
4
|
+
It defines what a scene is — a JSON document of nodes and commands — and how a
|
|
5
|
+
project of them evolves over time: the scene graph, props and tweens, flow
|
|
6
|
+
layout and the runtime that plays it, independent of any rendering backend and
|
|
7
|
+
with zero dependencies.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import type { CompositionDocument } from '@motionscript/core';
|
|
11
|
+
|
|
12
|
+
// A scene is data: a tree of nodes, then commands placed at times.
|
|
13
|
+
const doc: CompositionDocument = {
|
|
14
|
+
kind: 'composition',
|
|
15
|
+
nodes: [
|
|
16
|
+
{ id: 'card', type: 'rect', parentId: null, layerOrder: 0,
|
|
17
|
+
props: { width: 400, height: 400, fill: 'white', cornerRadius: 20 } },
|
|
18
|
+
{ id: 'lens', type: 'ellipse', parentId: 'card', layerOrder: 0,
|
|
19
|
+
props: { width: 350, height: 350, fill: 'black' } },
|
|
20
|
+
],
|
|
21
|
+
commands: [
|
|
22
|
+
// Slide the lens 300px over 3 seconds.
|
|
23
|
+
{ id: 'slide', type: 'to', targetId: 'lens', at: 0, duration: 3, args: { x: 300 } },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
A host plays it with `engine.open({ document: doc })`. A frame is a pure
|
|
29
|
+
function of its time, so a seek costs the same in either direction.
|
|
30
|
+
|
|
31
|
+
## What's in here
|
|
32
|
+
|
|
33
|
+
- **Documents**: `StillDocument`, `CompositionDocument` and `AudioDocument`, the
|
|
34
|
+
`ProjectDocument` that lays them on tracks, the validator, the expression
|
|
35
|
+
language, and the per-engine `Registry` that turns a node key into a class.
|
|
36
|
+
- **Runtime**: `Engine` and `Session`, which open a document on a platform and
|
|
37
|
+
play, seek and export it.
|
|
38
|
+
- **Nodes**: the scene graph (`Rect`, `Ellipse`, `Text`, `RichText`, `Video`,
|
|
39
|
+
paths, 3D, audio, and more) with attributes for fills, gradients, filters, and
|
|
40
|
+
WGSL shader effects. A custom node is a component registered with the engine,
|
|
41
|
+
and any document it opens can name it.
|
|
42
|
+
- **Tweens**: interpolation and easing for animating attributes over time.
|
|
43
|
+
- **Layout**: `flowOps`, the flow layout every 2D node runs on its children:
|
|
44
|
+
freeform, runs (wrapped or not) and grid.
|
|
45
|
+
- **Project / render / platform / assets**: the abstractions a renderer and a
|
|
46
|
+
platform implement to turn a scene graph into pixels, audio, and exported
|
|
47
|
+
video: `RenderContext2D`/`RenderContext3D` (implemented by the WebGPU renderer
|
|
48
|
+
[`@motionscript/renderer`](https://github.com/motionscript-dev/motionscript/tree/main/packages/renderer)) and the `platform` seams (filled
|
|
49
|
+
in by [`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser)).
|
|
50
|
+
|
|
51
|
+
This package has no rendering backend of its own. Pair it with
|
|
52
|
+
[`@motionscript/browser`](https://github.com/motionscript-dev/motionscript/tree/main/packages/browser) (WebGPU) or build your own backend
|
|
53
|
+
against the `platform`/`render` abstractions.
|
|
54
|
+
|
|
55
|
+
## Docs
|
|
56
|
+
|
|
57
|
+
Contributor documentation for this package lives in [`docs/`](https://github.com/motionscript-dev/motionscript/tree/main/packages/core/docs):
|
|
58
|
+
|
|
59
|
+
- [Module tour](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/overview.md): what each directory of `src` holds, what may
|
|
60
|
+
import what, validation, and what each barrel exports.
|
|
61
|
+
- [Registry](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/registry.md): the per-engine vocabulary and the built-in keys.
|
|
62
|
+
- [Variables and expressions](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/expressions.md): the expression grammar,
|
|
63
|
+
its closed function library, node references and cycles.
|
|
64
|
+
- [Timeline](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/timeline.md): compile, seek, presence, incremental patching
|
|
65
|
+
and the time conventions.
|
|
66
|
+
- [Commands, tweens and easing](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/commands.md): command shapes, `args`,
|
|
67
|
+
easing, loops and command traits.
|
|
68
|
+
- Also: [scene graph](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/scene-graph.md), [attributes](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/attributes.md),
|
|
69
|
+
[layout and text](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/layout-and-text.md), [assets](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/assets.md) and the
|
|
70
|
+
[project document](https://github.com/motionscript-dev/motionscript/blob/main/packages/core/docs/project-document.md).
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install @motionscript/core
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
See the [docs](https://motionscript.dev/docs) for the full feature set and API
|
|
79
|
+
reference.
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
|
|
83
|
+
From the monorepo root:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pnpm --filter @motionscript/core build # eslint, then tsc, then the browser bundle
|
|
87
|
+
pnpm --filter @motionscript/core test # vitest
|
|
88
|
+
pnpm --filter @motionscript/core lint
|
|
89
|
+
pnpm --filter @motionscript/core typecheck
|
|
90
|
+
```
|
|
91
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-index.js","sourceRoot":"","sources":["../../src/assets/asset-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAkB,MAAM,SAAS,CAAC;AA0BnD,MAAM,SAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,OAAO,UAAU;IACnB,YAAY,UAAkB;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ,CAAC,QAAgB,EAAE,QAAiC;QACxD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,QAAQ;YAAE,IAAI,CAAC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9C,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IACrH,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,OAAO,CAAC,CAAC,CAAC;YACX,MAAM,CAAC,GAAG,CAAa,CAAC;YACxB,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC;QAClE,CAAC;QACD,KAAK,MAAM;YACP,OAAO,CAAC,CAAC,UAAU,KAAM,CAAc,CAAC,UAAU,CAAC;QACvD,KAAK,QAAQ;YACT,OAAO,CAAC,CAAC,IAAI,KAAM,CAAc,CAAC,IAAI,CAAC;QAC3C;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC","sourcesContent":["import type { AssetRecord } from \"./record\";\r\nimport { assetKey, type AssetDecl } from \"./scope\";\r\n\r\nexport interface AssetSegment {\r\n key: string;\r\n decl: AssetDecl;\r\n startFrame: number;\r\n /** Inclusive. `Infinity` runs to the clip's end. */\r\n endFrame: number;\r\n}\r\n\r\nexport interface AssetDelta {\r\n /** Keys whose record appeared, disappeared, or changed window or content. */\r\n readonly keys: ReadonlySet<string>;\r\n}\r\n\r\ninterface OwnerSegments {\r\n declared: Map<string, AssetSegment[]>;\r\n /** Found missing at draw time rather than declared; cleared by the owner's next `setOwner`. */\r\n learned: Map<string, AssetSegment[]>;\r\n}\r\n\r\ninterface KeyEntry {\r\n record: AssetRecord;\r\n layout: boolean;\r\n}\r\n\r\nconst NO_OWNERS: ReadonlySet<string> = new Set();\r\n\r\n/**\r\n * One clip's asset windows, per owner, in clip-local frames.\r\n *\r\n * Owners replace their segments wholesale, and a key's record — the union window\r\n * over every owner that needs it — is recomputed only for the keys an update\r\n * touched. The records keep today's {@link AssetRecord} shape so the manager,\r\n * exporter and mixer read them unchanged.\r\n */\r\nexport class AssetIndex {\r\n constructor(frameCount: number) {\r\n this._frameCount = Math.max(0, frameCount);\r\n }\r\n\r\n setOwner(ownerKey: string, segments: readonly AssetSegment[]): AssetDelta {\r\n const touched = new Set<string>();\r\n const previous = this._owners.get(ownerKey);\r\n if (previous) this._unlink(ownerKey, previous, touched);\r\n\r\n const next: OwnerSegments = { declared: new Map(), learned: new Map() };\r\n for (const segment of segments) {\r\n if (!(segment.endFrame >= segment.startFrame)) continue;\r\n appendSegment(next.declared, { ...segment });\r\n }\r\n if (next.declared.size > 0) {\r\n this._owners.set(ownerKey, next);\r\n this._link(ownerKey, next, touched);\r\n } else {\r\n this._owners.delete(ownerKey);\r\n }\r\n return this._refresh(touched);\r\n }\r\n\r\n removeOwner(ownerKey: string): AssetDelta {\r\n const previous = this._owners.get(ownerKey);\r\n if (!previous) return { keys: new Set() };\r\n const touched = new Set<string>();\r\n this._unlink(ownerKey, previous, touched);\r\n this._owners.delete(ownerKey);\r\n return this._refresh(touched);\r\n }\r\n\r\n learn(ownerKey: string, decl: AssetDecl, frame: number): AssetDelta {\r\n const key = assetKey(decl);\r\n let owner = this._owners.get(ownerKey);\r\n if (!owner) {\r\n owner = { declared: new Map(), learned: new Map() };\r\n this._owners.set(ownerKey, owner);\r\n }\r\n const list = owner.learned.get(key) ?? [];\r\n const at = list.findIndex((s) => frame >= s.startFrame - 1 && frame <= s.endFrame + 1);\r\n if (at < 0) {\r\n list.push({ key, decl, startFrame: frame, endFrame: frame });\r\n } else {\r\n // Replaced rather than widened in place: `segmentsOf` hands these out.\r\n const hit = list[at];\r\n list[at] = {\r\n ...hit,\r\n startFrame: Math.min(hit.startFrame, frame),\r\n endFrame: Math.max(hit.endFrame, frame),\r\n };\r\n }\r\n owner.learned.set(key, list);\r\n let owners = this._byKey.get(key);\r\n if (!owners) this._byKey.set(key, (owners = new Set()));\r\n owners.add(ownerKey);\r\n return this._refresh(new Set([key]));\r\n }\r\n\r\n setFrameCount(frameCount: number): AssetDelta {\r\n const next = Math.max(0, frameCount);\r\n if (next === this._frameCount) return { keys: new Set() };\r\n this._frameCount = next;\r\n return this._refresh(new Set(this._byKey.keys()));\r\n }\r\n\r\n owners(key: string): ReadonlySet<string> {\r\n return this._byKey.get(key) ?? NO_OWNERS;\r\n }\r\n\r\n /** Declared segments, then learned ones. */\r\n segmentsOf(ownerKey: string): readonly AssetSegment[] {\r\n const owner = this._owners.get(ownerKey);\r\n if (!owner) return [];\r\n const out: AssetSegment[] = [];\r\n for (const list of owner.declared.values()) out.push(...list);\r\n for (const list of owner.learned.values()) out.push(...list);\r\n return out;\r\n }\r\n\r\n /** Declared segments only — what a partial re-declaration keeps the front of. */\r\n declaredSegmentsOf(ownerKey: string): readonly AssetSegment[] {\r\n const owner = this._owners.get(ownerKey);\r\n if (!owner) return [];\r\n const out: AssetSegment[] = [];\r\n for (const list of owner.declared.values()) out.push(...list);\r\n return out;\r\n }\r\n\r\n ownerKeys(): IterableIterator<string> {\r\n return this._owners.keys();\r\n }\r\n\r\n records(): ReadonlyMap<string, AssetRecord> {\r\n return this._records;\r\n }\r\n\r\n /** Fonts, and loaders any owner declared with `gate: \"layout\"`. */\r\n layoutGates(): readonly AssetRecord[] {\r\n if (this._layoutGates === null) {\r\n const gates: AssetRecord[] = [];\r\n for (const entry of this._entries.values()) {\r\n if (entry.layout) gates.push(entry.record);\r\n }\r\n this._layoutGates = gates;\r\n }\r\n return this._layoutGates;\r\n }\r\n\r\n private _frameCount: number;\r\n private readonly _owners = new Map<string, OwnerSegments>();\r\n private readonly _byKey = new Map<string, Set<string>>();\r\n private readonly _entries = new Map<string, KeyEntry>();\r\n private readonly _records = new Map<string, AssetRecord>();\r\n private _layoutGates: AssetRecord[] | null = null;\r\n\r\n private _link(ownerKey: string, owner: OwnerSegments, touched: Set<string>): void {\r\n for (const key of owner.declared.keys()) {\r\n let owners = this._byKey.get(key);\r\n if (!owners) this._byKey.set(key, (owners = new Set()));\r\n owners.add(ownerKey);\r\n touched.add(key);\r\n }\r\n }\r\n\r\n private _unlink(ownerKey: string, owner: OwnerSegments, touched: Set<string>): void {\r\n for (const map of [owner.declared, owner.learned]) {\r\n for (const key of map.keys()) {\r\n const owners = this._byKey.get(key);\r\n if (owners) {\r\n owners.delete(ownerKey);\r\n if (owners.size === 0) this._byKey.delete(key);\r\n }\r\n touched.add(key);\r\n }\r\n }\r\n }\r\n\r\n private _refresh(keys: ReadonlySet<string>): AssetDelta {\r\n const changed = new Set<string>();\r\n for (const key of keys) {\r\n const previous = this._entries.get(key);\r\n const next = this._compute(key);\r\n if (next === undefined) {\r\n if (previous === undefined) continue;\r\n this._entries.delete(key);\r\n this._records.delete(key);\r\n } else if (previous !== undefined && previous.layout === next.layout && sameRecord(previous.record, next.record)) {\r\n continue;\r\n } else {\r\n this._entries.set(key, next);\r\n this._records.set(key, next.record);\r\n }\r\n changed.add(key);\r\n }\r\n if (changed.size > 0) this._layoutGates = null;\r\n return { keys: changed };\r\n }\r\n\r\n private _compute(key: string): KeyEntry | undefined {\r\n const owners = this._byKey.get(key);\r\n if (!owners) return undefined;\r\n const last = this._frameCount - 1;\r\n let first: AssetSegment | undefined;\r\n let start = Infinity;\r\n let end = -Infinity;\r\n let layoutLoader = false;\r\n\r\n const visit = (list: AssetSegment[] | undefined): void => {\r\n if (!list) return;\r\n for (const segment of list) {\r\n const from = Math.max(0, segment.startFrame);\r\n const to = Math.min(last, segment.endFrame);\r\n if (to < from) continue;\r\n // The earliest segment speaks for the key.\r\n if (from < start) {\r\n start = from;\r\n first = segment;\r\n }\r\n if (to > end) end = to;\r\n if (segment.decl.type === \"loader\" && segment.decl.gate === \"layout\") layoutLoader = true;\r\n }\r\n };\r\n for (const ownerKey of owners) {\r\n const owner = this._owners.get(ownerKey);\r\n if (!owner) continue;\r\n visit(owner.declared.get(key));\r\n visit(owner.learned.get(key));\r\n }\r\n\r\n if (first === undefined) return undefined;\r\n return {\r\n record: recordOf(first.decl, start, end),\r\n layout: first.decl.type === \"font\" || layoutLoader,\r\n };\r\n }\r\n}\r\n\r\nfunction appendSegment(map: Map<string, AssetSegment[]>, segment: AssetSegment): void {\r\n const list = map.get(segment.key);\r\n if (list) list.push(segment);\r\n else map.set(segment.key, [segment]);\r\n}\r\n\r\nfunction recordOf(decl: AssetDecl, startFrame: number, endFrame: number): AssetRecord {\r\n switch (decl.type) {\r\n case \"image\":\r\n return { type: \"image\", startFrame, endFrame, src: decl.src };\r\n case \"video\":\r\n return {\r\n type: \"video\", startFrame, endFrame, src: decl.src,\r\n trimStart: decl.trimStart, trimEnd: decl.trimEnd,\r\n };\r\n case \"font\":\r\n return { type: \"font\", startFrame, endFrame, fontWeight: decl.weight, fontFamily: decl.family, src: decl.family };\r\n case \"loader\":\r\n return { type: \"loader\", src: decl.key, startFrame, endFrame, load: decl.load };\r\n }\r\n}\r\n\r\nfunction sameRecord(a: AssetRecord, b: AssetRecord): boolean {\r\n if (a.type !== b.type || a.src !== b.src || a.startFrame !== b.startFrame || a.endFrame !== b.endFrame) return false;\r\n switch (a.type) {\r\n case \"video\": {\r\n const v = b as typeof a;\r\n return a.trimStart === v.trimStart && a.trimEnd === v.trimEnd;\r\n }\r\n case \"font\":\r\n return a.fontWeight === (b as typeof a).fontWeight;\r\n case \"loader\":\r\n return a.load === (b as typeof a).load;\r\n default:\r\n return true;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"asset-index.js","sourceRoot":"","sources":["../../src/assets/asset-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAkB,MAAM,SAAS,CAAC;AA0BnD,MAAM,SAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,OAAO,UAAU;IACnB,YAAY,UAAkB;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAA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EAAE,CAAC;QACtH,KAAK,QAAQ;YACT,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACxF,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,CAAc,EAAE,CAAc;IAC9C,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IACrH,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,OAAO,CAAC,CAAC,CAAC;YACX,MAAM,CAAC,GAAG,CAAa,CAAC;YACxB,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC;QAClE,CAAC;QACD,KAAK,MAAM;YACP,OAAO,CAAC,CAAC,UAAU,KAAM,CAAc,CAAC,UAAU,CAAC;QACvD,KAAK,QAAQ;YACT,OAAO,CAAC,CAAC,IAAI,KAAM,CAAc,CAAC,IAAI,CAAC;QAC3C;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC","sourcesContent":["import type { AssetRecord } from \"./record\";\nimport { assetKey, type AssetDecl } from \"./scope\";\n\nexport interface AssetSegment {\n key: string;\n decl: AssetDecl;\n startFrame: number;\n /** Inclusive. `Infinity` runs to the clip's end. */\n endFrame: number;\n}\n\nexport interface AssetDelta {\n /** Keys whose record appeared, disappeared, or changed window or content. */\n readonly keys: ReadonlySet<string>;\n}\n\ninterface OwnerSegments {\n declared: Map<string, AssetSegment[]>;\n /** Found missing at draw time rather than declared; cleared by the owner's next `setOwner`. */\n learned: Map<string, AssetSegment[]>;\n}\n\ninterface KeyEntry {\n record: AssetRecord;\n layout: boolean;\n}\n\nconst NO_OWNERS: ReadonlySet<string> = new Set();\n\n/**\n * One clip's asset windows, per owner, in clip-local frames.\n *\n * Owners replace their segments wholesale, and a key's record — the union window\n * over every owner that needs it — is recomputed only for the keys an update\n * touched. The records keep today's {@link AssetRecord} shape so the manager,\n * exporter and mixer read them unchanged.\n */\nexport class AssetIndex {\n constructor(frameCount: number) {\n this._frameCount = Math.max(0, frameCount);\n }\n\n setOwner(ownerKey: string, segments: readonly AssetSegment[]): AssetDelta {\n const touched = new Set<string>();\n const previous = this._owners.get(ownerKey);\n if (previous) this._unlink(ownerKey, previous, touched);\n\n const next: OwnerSegments = { declared: new Map(), learned: new Map() };\n for (const segment of segments) {\n if (!(segment.endFrame >= segment.startFrame)) continue;\n appendSegment(next.declared, { ...segment });\n }\n if (next.declared.size > 0) {\n this._owners.set(ownerKey, next);\n this._link(ownerKey, next, touched);\n } else {\n this._owners.delete(ownerKey);\n }\n return this._refresh(touched);\n }\n\n removeOwner(ownerKey: string): AssetDelta {\n const previous = this._owners.get(ownerKey);\n if (!previous) return { keys: new Set() };\n const touched = new Set<string>();\n this._unlink(ownerKey, previous, touched);\n this._owners.delete(ownerKey);\n return this._refresh(touched);\n }\n\n learn(ownerKey: string, decl: AssetDecl, frame: number): AssetDelta {\n const key = assetKey(decl);\n let owner = this._owners.get(ownerKey);\n if (!owner) {\n owner = { declared: new Map(), learned: new Map() };\n this._owners.set(ownerKey, owner);\n }\n const list = owner.learned.get(key) ?? [];\n const at = list.findIndex((s) => frame >= s.startFrame - 1 && frame <= s.endFrame + 1);\n if (at < 0) {\n list.push({ key, decl, startFrame: frame, endFrame: frame });\n } else {\n // Replaced rather than widened in place: `segmentsOf` hands these out.\n const hit = list[at];\n list[at] = {\n ...hit,\n startFrame: Math.min(hit.startFrame, frame),\n endFrame: Math.max(hit.endFrame, frame),\n };\n }\n owner.learned.set(key, list);\n let owners = this._byKey.get(key);\n if (!owners) this._byKey.set(key, (owners = new Set()));\n owners.add(ownerKey);\n return this._refresh(new Set([key]));\n }\n\n setFrameCount(frameCount: number): AssetDelta {\n const next = Math.max(0, frameCount);\n if (next === this._frameCount) return { keys: new Set() };\n this._frameCount = next;\n return this._refresh(new Set(this._byKey.keys()));\n }\n\n owners(key: string): ReadonlySet<string> {\n return this._byKey.get(key) ?? NO_OWNERS;\n }\n\n /** Declared segments, then learned ones. */\n segmentsOf(ownerKey: string): readonly AssetSegment[] {\n const owner = this._owners.get(ownerKey);\n if (!owner) return [];\n const out: AssetSegment[] = [];\n for (const list of owner.declared.values()) out.push(...list);\n for (const list of owner.learned.values()) out.push(...list);\n return out;\n }\n\n /** Declared segments only — what a partial re-declaration keeps the front of. */\n declaredSegmentsOf(ownerKey: string): readonly AssetSegment[] {\n const owner = this._owners.get(ownerKey);\n if (!owner) return [];\n const out: AssetSegment[] = [];\n for (const list of owner.declared.values()) out.push(...list);\n return out;\n }\n\n ownerKeys(): IterableIterator<string> {\n return this._owners.keys();\n }\n\n records(): ReadonlyMap<string, AssetRecord> {\n return this._records;\n }\n\n /** Fonts, and loaders any owner declared with `gate: \"layout\"`. */\n layoutGates(): readonly AssetRecord[] {\n if (this._layoutGates === null) {\n const gates: AssetRecord[] = [];\n for (const entry of this._entries.values()) {\n if (entry.layout) gates.push(entry.record);\n }\n this._layoutGates = gates;\n }\n return this._layoutGates;\n }\n\n private _frameCount: number;\n private readonly _owners = new Map<string, OwnerSegments>();\n private readonly _byKey = new Map<string, Set<string>>();\n private readonly _entries = new Map<string, KeyEntry>();\n private readonly _records = new Map<string, AssetRecord>();\n private _layoutGates: AssetRecord[] | null = null;\n\n private _link(ownerKey: string, owner: OwnerSegments, touched: Set<string>): void {\n for (const key of owner.declared.keys()) {\n let owners = this._byKey.get(key);\n if (!owners) this._byKey.set(key, (owners = new Set()));\n owners.add(ownerKey);\n touched.add(key);\n }\n }\n\n private _unlink(ownerKey: string, owner: OwnerSegments, touched: Set<string>): void {\n for (const map of [owner.declared, owner.learned]) {\n for (const key of map.keys()) {\n const owners = this._byKey.get(key);\n if (owners) {\n owners.delete(ownerKey);\n if (owners.size === 0) this._byKey.delete(key);\n }\n touched.add(key);\n }\n }\n }\n\n private _refresh(keys: ReadonlySet<string>): AssetDelta {\n const changed = new Set<string>();\n for (const key of keys) {\n const previous = this._entries.get(key);\n const next = this._compute(key);\n if (next === undefined) {\n if (previous === undefined) continue;\n this._entries.delete(key);\n this._records.delete(key);\n } else if (previous !== undefined && previous.layout === next.layout && sameRecord(previous.record, next.record)) {\n continue;\n } else {\n this._entries.set(key, next);\n this._records.set(key, next.record);\n }\n changed.add(key);\n }\n if (changed.size > 0) this._layoutGates = null;\n return { keys: changed };\n }\n\n private _compute(key: string): KeyEntry | undefined {\n const owners = this._byKey.get(key);\n if (!owners) return undefined;\n const last = this._frameCount - 1;\n let first: AssetSegment | undefined;\n let start = Infinity;\n let end = -Infinity;\n let layoutLoader = false;\n\n const visit = (list: AssetSegment[] | undefined): void => {\n if (!list) return;\n for (const segment of list) {\n const from = Math.max(0, segment.startFrame);\n const to = Math.min(last, segment.endFrame);\n if (to < from) continue;\n // The earliest segment speaks for the key.\n if (from < start) {\n start = from;\n first = segment;\n }\n if (to > end) end = to;\n if (segment.decl.type === \"loader\" && segment.decl.gate === \"layout\") layoutLoader = true;\n }\n };\n for (const ownerKey of owners) {\n const owner = this._owners.get(ownerKey);\n if (!owner) continue;\n visit(owner.declared.get(key));\n visit(owner.learned.get(key));\n }\n\n if (first === undefined) return undefined;\n return {\n record: recordOf(first.decl, start, end),\n layout: first.decl.type === \"font\" || layoutLoader,\n };\n }\n}\n\nfunction appendSegment(map: Map<string, AssetSegment[]>, segment: AssetSegment): void {\n const list = map.get(segment.key);\n if (list) list.push(segment);\n else map.set(segment.key, [segment]);\n}\n\nfunction recordOf(decl: AssetDecl, startFrame: number, endFrame: number): AssetRecord {\n switch (decl.type) {\n case \"image\":\n return { type: \"image\", startFrame, endFrame, src: decl.src };\n case \"video\":\n return {\n type: \"video\", startFrame, endFrame, src: decl.src,\n trimStart: decl.trimStart, trimEnd: decl.trimEnd,\n };\n case \"font\":\n return { type: \"font\", startFrame, endFrame, fontWeight: decl.weight, fontFamily: decl.family, src: decl.family };\n case \"loader\":\n return { type: \"loader\", src: decl.key, startFrame, endFrame, load: decl.load };\n }\n}\n\nfunction sameRecord(a: AssetRecord, b: AssetRecord): boolean {\n if (a.type !== b.type || a.src !== b.src || a.startFrame !== b.startFrame || a.endFrame !== b.endFrame) return false;\n switch (a.type) {\n case \"video\": {\n const v = b as typeof a;\n return a.trimStart === v.trimStart && a.trimEnd === v.trimEnd;\n }\n case \"font\":\n return a.fontWeight === (b as typeof a).fontWeight;\n case \"loader\":\n return a.load === (b as typeof a).load;\n default:\n return true;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/assets/catalog.ts"],"names":[],"mappings":"AAuEA;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IACT;IAApB,YAAoB,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;IAAI,CAAC;IAEhD;;;;;;;OAOG;IACH,SAAS,CAAC,QAAuB;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;OAUG;IACK,YAAY,CAAC,GAAW;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,YAAY,CAAC,GAAW;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC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gB,CAAC,GAAW;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,kFAAkF,CAAC,CAAC;IACtI,CAAC;IAED,YAAY,CAAC,GAAW;QACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACjD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["import { type AudioMeta, type FontMeta, type ImageMeta, AssetManifest, type VideoMeta } from \"./manifest\";\
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/assets/catalog.ts"],"names":[],"mappings":"AAuEA;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IACT;IAApB,YAAoB,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;IAAI,CAAC;IAEhD;;;;;;;OAOG;IACH,SAAS,CAAC,QAAuB;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;OAUG;IACK,YAAY,CAAC,GAAW;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,YAAY,CAAC,GAAW;QACpB,MAAM,IAAI,GA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QAAQ,CAAC;IAC3C,CAAC;IAED,gBAAgB,CAAC,GAAW;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;IAC3C,CAAC;IAED,gBAAgB,CAAC,GAAW;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,kFAAkF,CAAC,CAAC;IACtI,CAAC;IAED,YAAY,CAAC,GAAW;QACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACjD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["import { type AudioMeta, type FontMeta, type ImageMeta, AssetManifest, type VideoMeta } from \"./manifest\";\n\n/**\n * What a scene can ask about the assets available to it.\n *\n * Strictly read-only, and strictly about *metadata*: dimensions, durations, and\n * the font faces a family resolves to. Nothing here loads anything — that is\n * the {@link AssetManager}'s job, driven by what nodes declare into an\n * {@link AssetScope}. Reachable from any node as `node.assets` and from a\n * scene generator as `stage.assets`.\n *\n * **Every lookup throws on a miss rather than returning `undefined`.** A missing\n * asset is a typo or a deleted file, and it is worth finding out during the\n * precomp pass (where it surfaces as a `BuildError` in the errors panel) rather\n * than at playback as a shape that silently fails to paint.\n *\n * An interface so a host can supply its own — a test double, or a catalog\n * backed by something other than a static manifest. {@link ManifestAssetCatalog}\n * is the implementation the runtime builds from the project's asset manifest.\n */\nexport interface AssetCatalog {\n /**\n * Metadata for an image.\n * @throws If the image is not in the manifest.\n */\n getImageMeta(src: string): ImageMeta;\n\n /**\n * Metadata for a video.\n * @throws If the video is not in the manifest.\n */\n getVideoMeta(src: string): VideoMeta;\n\n /**\n * Metadata for an audio track.\n * @throws If the audio file is not in the manifest.\n */\n getAudioMeta(src: string): AudioMeta;\n\n /**\n * Metadata for a single font face, by its `family@weight` lookup key.\n * @throws If the key is not in the manifest.\n */\n getFontMeta(key: string): FontMeta;\n\n /**\n * Every face registered for a family, across all weights and slants — what\n * the renderer registers so its font matcher can resolve any requested\n * weight to the nearest available file. Empty if the family is unknown.\n */\n getFontFamilyMetas(fontFamily: string): FontMeta[];\n\n /** Playback duration of a video, in seconds. */\n getVideoDuration(src: string): number;\n\n /** Playback duration of an audio file, in seconds. */\n getAudioDuration(src: string): number;\n\n /**\n * Duration of any *playable* source — an audio file, or a video whose audio\n * track is being played. Resolves against audio first and falls back to\n * video, so a video `src` can drive a `Sound` without a duplicate audio-only\n * manifest entry.\n * @throws If `src` is in neither manifest.\n */\n getMediaDuration(src: string): number;\n\n /** An image's intrinsic pixel dimensions. */\n getImageSize(src: string): { width: number; height: number };\n}\n\n/**\n * The {@link AssetCatalog} the runtime builds: a query engine over a static\n * {@link AssetManifest}.\n *\n * @example\n * ```ts\n * const catalog = new ManifestAssetCatalog(manifest);\n * catalog.getImageSize(\"hero-banner.png\"); // { width: 1920, height: 1080 }\n * ```\n */\nexport class ManifestAssetCatalog implements AssetCatalog {\n constructor(private manifest: AssetManifest) { }\n\n /**\n * Point this catalog at `manifest`, in place.\n *\n * A session hands one catalog to the controller, the clip store and every\n * node's `assets`, so replacing the catalog object would leave all of them on\n * the old one. Reconciling the manifest it reads keeps a manifest change\n * visible to everything already built.\n */\n reconcile(manifest: AssetManifest): void {\n this.manifest = manifest;\n }\n\n /**\n * Normalize a caller-supplied asset `src` into the manifest's lookup key.\n * The manifest stores image/video/audio keys as the file's path relative\n * to the scanned public folder, using forward slashes with no leading\n * `./` or `/`.\n * Scene authors write `src` in whichever equivalent form is natural — a\n * bare filename, `\"./sub/file.png\"`, `\"/sub/file.png\"`, or a\n * Windows-authored backslash path — so normalize all of them to the same\n * key. Font lookups are keyed by `family@weight`, not a path, so they\n * don't go through this.\n */\n private normalizeKey(src: string): string {\n return src.replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/^\\/+/, '');\n }\n\n getImageMeta(src: string): ImageMeta {\n const meta = this.manifest.image[this.normalizeKey(src)];\n if (!meta) throw new Error(`Image asset not found: \"${src}\". Check the file exists in your public folder and the src matches its filename.`);\n return meta;\n }\n\n getVideoMeta(src: string): VideoMeta {\n const meta = this.manifest.video[this.normalizeKey(src)];\n if (!meta) throw new Error(`Video asset not found: \"${src}\". Check the file exists in your public folder and the src matches its filename.`);\n return meta;\n }\n\n getAudioMeta(src: string): AudioMeta {\n const meta = this.manifest.audio[this.normalizeKey(src)];\n if (!meta) throw new Error(`No audio metadata for src: ${src}`);\n return meta;\n }\n\n getFontMeta(key: string): FontMeta {\n const meta = this.manifest.font[key];\n if (!meta) throw new Error(`No font metadata for key: ${key}`);\n return meta;\n }\n\n getFontFamilyMetas(fontFamily: string): FontMeta[] {\n return Object.values(this.manifest.font).filter(meta => meta.fontFamily === fontFamily);\n }\n\n getVideoDuration(src: string): number {\n return this.getVideoMeta(src).duration;\n }\n\n getAudioDuration(src: string): number {\n return this.getAudioMeta(src).duration;\n }\n\n getMediaDuration(src: string): number {\n const key = this.normalizeKey(src);\n const audio = this.manifest.audio[key];\n if (audio) return audio.duration;\n const video = this.manifest.video[key];\n if (video) return video.duration;\n throw new Error(`Audio asset not found: \"${src}\". Check the file exists in your public folder and the src matches its filename.`);\n }\n\n getImageSize(src: string): { width: number; height: number } {\n const { width, height } = this.getImageMeta(src);\n return { width, height };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/assets/errors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACjC,SAAS,CAAY;IACrB,GAAG,CAAS;IACrB,6EAA6E;IAC7E,MAAM,CAAU;IAEhB,YAAY,SAAoB,EAAE,GAAW,EAAE,IAAa;QACxD,KAAK,CAAC,GAAG,SAAS,WAAW,GAAG,mBAAmB,GAAG,CAAC,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;CACJ;AAED,sFAAsF;AACtF,SAAS,WAAW,CAAC,SAAoB;IACrC,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,yGAAyG,CAAC;IAC5I,OAAO,2DAA2D,SAAS,iEAAiE,CAAC;AACjJ,CAAC","sourcesContent":["import type { AssetType } from \"./record\";\
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/assets/errors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACjC,SAAS,CAAY;IACrB,GAAG,CAAS;IACrB,6EAA6E;IAC7E,MAAM,CAAU;IAEhB,YAAY,SAAoB,EAAE,GAAW,EAAE,IAAa;QACxD,KAAK,CAAC,GAAG,SAAS,WAAW,GAAG,mBAAmB,GAAG,CAAC,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;CACJ;AAED,sFAAsF;AACtF,SAAS,WAAW,CAAC,SAAoB;IACrC,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,yGAAyG,CAAC;IAC5I,OAAO,2DAA2D,SAAS,iEAAiE,CAAC;AACjJ,CAAC","sourcesContent":["import type { AssetType } from \"./record\";\n\n/**\n * A frame reached for an asset that was never loaded.\n *\n * This is the counterweight to declared asset tracking. A node states what it\n * needs from `Node.declareAssets`; if it\n * misses something, the renderer finds nothing when it goes to paint. The old\n * inference pass could not really get this wrong — it discovered assets *from*\n * the draw calls, so anything drawn was by construction requested — and the\n * fills were written to match: a missing decode returned `false` and the layer\n * was quietly skipped.\n *\n * Under declarations that leniency is the wrong default. A skipped layer is a\n * frame that renders *almost* right, with a photo missing or a heading in the\n * fallback face, on a node that may only appear seconds in and only on a cold\n * load. Throwing turns a silent visual gap into a located failure: during precomp\n * it is caught per scene and surfaces as a `BuildError` in the errors panel, and\n * at playback it stops the frame rather than shipping a wrong one.\n *\n * It means \"declared but not loaded, or never declared\". It deliberately does\n * **not** cover a *time-varying* miss — a video frame the decode window has not\n * reached yet is an asset that loaded fine, and `warmPendingVideo` already exists\n * to settle those; those paths still paint the nearest decoded frame.\n */\nexport class AssetNotLoadedError extends Error {\n readonly assetType: AssetType;\n readonly src: string;\n /** The innermost drawing node, stamped by `Node2D.render` on the way out. */\n nodeId?: string;\n\n constructor(assetType: AssetType, src: string, hint?: string) {\n super(`${assetType} asset \"${src}\" is not loaded. ` + (hint ?? declareHint(assetType)));\n this.name = \"AssetNotLoadedError\";\n this.assetType = assetType;\n this.src = src;\n }\n}\n\n/** How to declare an asset of `assetType`: the scope method, or a command's sound. */\nfunction declareHint(assetType: AssetType): string {\n if (assetType === \"audio\") return \"Play it from a command (`timeline.sound(...)`), so the asset timeline loads it before this frame draws.\";\n return `Declare it from the node's declareAssets() (e.g. assets.${assetType}(...)), so the asset timeline loads it before this frame draws.`;\n}\n"]}
|
package/dist/assets/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AACA,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAGlE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAK5D,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAChE,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC","sourcesContent":["/** @internal */ export type { AssetCatalog } from \"./catalog\";\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AACA,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAGlE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAK5D,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAChE,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC","sourcesContent":["/** @internal */ export type { AssetCatalog } from \"./catalog\";\n/** @internal */ export { ManifestAssetCatalog } from \"./catalog\";\n/** @internal */ export type { ImageMeta, VideoMeta, AudioMeta, FontMeta, AssetMeta, AssetManifest } from \"./manifest\";\nexport type { AssetScope, AssetDecl, AssetGate } from \"./scope\";\n/** @internal */ export { AssetDeclaration } from \"./scope\";\n// `AssetRecord` joins these because `StorageAdapter.loadAsset` takes one on an\n// exported abstract class — a subclass outside this package could not otherwise\n// name the parameter type it is obliged to accept.\n/** @internal */ export type { LoaderFn, Disposer, AssetRecord } from \"./record\";\n/** @internal */ export { AssetNotLoadedError } from \"./errors\";\n/** @internal */ export { AssetManager } from \"./manager\";"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/assets/manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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G,EAAE,MAAM,GAAG,OAAO;IAI7B;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjE;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAgB7B;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAqBlB,6DAA6D;IAC7D,OAAO,CAAC,SAAS;IAqBjB,oEAAoE;IACpE,OAAO,IAAI,IAAI;IAOf;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAwE9B,0FAA0F;IAC1F,OAAO,CAAC,SAAS;IAMjB,2EAA2E;IAC3E,OAAO,CAAC,WAAW;CAMtB"}
|
package/dist/assets/manager.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { busStopKey } from "../attributes/audio/request.js";
|
|
2
|
-
import {
|
|
2
|
+
import { effectsKey } from "../attributes/audio/effects/union.js";
|
|
3
|
+
import { paramKey } from "../attributes/audio/ramp.js";
|
|
4
|
+
import { transitionKey } from "../attributes/audio/transition.js";
|
|
3
5
|
/**
|
|
4
6
|
* Coordinates asset loading and audio synchronization during playback.
|
|
5
7
|
* Wraps a {@link AssetTimelineResult} and delegates storage/audio work to platform adapters.
|
|
@@ -275,16 +277,16 @@ function layoutGatesOf(precomp) {
|
|
|
275
277
|
const NO_DISPOSE = () => { };
|
|
276
278
|
/**
|
|
277
279
|
* Produce a deterministic string key that uniquely identifies an audio request's
|
|
278
|
-
* playback identity. Includes the
|
|
279
|
-
*
|
|
280
|
-
* rebuilds the graph
|
|
280
|
+
* playback identity. Includes the effect chain, the ramps and the transitions so
|
|
281
|
+
* editing any of them changes the id — the device then stops the stale source and
|
|
282
|
+
* rebuilds the graph instead of reusing the old one.
|
|
281
283
|
*
|
|
282
284
|
* The bus chain is in for the same reason: re-routing a clip to a different bus,
|
|
283
285
|
* or changing a bus's level or its span, changes what it sounds like without
|
|
284
286
|
* changing anything else here — so leaving it out would keep the stale graph.
|
|
285
287
|
*/
|
|
286
288
|
function stableKey(req, clipOffsetSecs) {
|
|
287
|
-
return `${req.src}|${clipOffsetSecs + req.startAt}|${clipOffsetSecs + req.endAt}|${req.trimStart}|${req.trimEnd ?? "_"}|${req.loop ? 1 : 0}|${req.volume}|${
|
|
289
|
+
return `${req.src}|${clipOffsetSecs + req.startAt}|${clipOffsetSecs + req.endAt}|${req.trimStart}|${req.trimEnd ?? "_"}|${req.loop ? 1 : 0}|${paramKey(req.volume)}|${paramKey(req.speed)}|${req.sourceLength ?? "_"}|${effectsKey(req.effects)}|${transitionKey(req.transitionIn)}|${transitionKey(req.transitionOut)}|${busKey(req.bus)}`;
|
|
288
290
|
}
|
|
289
291
|
/** The bus chain's contribution to {@link stableKey}. */
|
|
290
292
|
function busKey(bus) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/assets/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAM9D;;;GAGG;AACH,MAAM,OAAO,YAAY;IAuCA;IAtCb,OAAO,CAAsB;IACpB,cAAc,CAAiB;IAC/B,WAAW,CAAY;IAExC,sFAAsF;IAC9E,mBAAmB,GAAkB,EAAE,CAAC;IACxC,aAAa,GAA+B,IAAI,GAAG,EAAE,CAAC;IACtD,aAAa,GAAG,IAAI,GAAG,EAAyB,CAAC;IACzD;;;;;;;OAOG;IACK,WAAW,GAAG,IAAI,GAAG,EAAmB,CAAC;IACjD,8DAA8D;IACtD,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1C,4FAA4F;IACpF,aAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;IACvD,+EAA+E;IACvE,cAAc,CAAsB;IACpC,QAAQ,GAAG,KAAK,CAAC;IAEzB,0EAA0E;IAClE,eAAe,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AC,GAAwB;IACpC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,OAAO,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAED,0FAA0F;AAC1F,SAAS,cAAc,CAAC,IAA6B;IACjD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAED,sEAAsE;AACtE,SAAS,SAAS,CAAC,CAAsB,EAAE,CAAsB;IAC7D,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAC/C,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { AudioRequest, busStopKey } from \"@/attributes/audio/request\";\r\nimport { filtersKey } from \"@/attributes/audio/filters/union\";\r\nimport { AssetRecord, Disposer, LoaderFn } from \"@/assets/record\";\r\nimport { AudioSink } from \"@/platform/audio-sink\";\r\nimport { StorageAdapter } from \"@/platform/storage-adapter\";\r\nimport { AssetTrack, AssetTimelineResult } from \"@/runtime/asset-timeline\";\r\n\r\n/**\r\n * Coordinates asset loading and audio synchronization during playback.\r\n * Wraps a {@link AssetTimelineResult} and delegates storage/audio work to platform adapters.\r\n */\r\nexport class AssetManager {\r\n private precomp: AssetTimelineResult;\r\n private readonly storageAdapter: StorageAdapter;\r\n private readonly audioDevice: AudioSink;\r\n\r\n /** `null` after a swap: whatever the device holds belongs to the previous precomp. */\r\n private lastAudioRequestKey: string | null = \"\";\r\n private lastAudioSrcs: ReadonlySet<string> | null = new Set();\r\n private audioFetching = new Map<string, Promise<void>>();\r\n /**\r\n * Sources whose fetch or decode failed, with why, so they are not fetched\r\n * again every sync. A source leaves when no request in the window names it\r\n * any more — and, once it has been reported, when a new precomp arrives —\r\n * so the next time it is wanted it is tried afresh. One that failed quietly\r\n * (see {@link AudioRequest.optional}) is kept across a precomp: a video with\r\n * no audio track would otherwise be fetched whole on every edit.\r\n */\r\n private audioFailed = new Map<string, unknown>();\r\n /** The failed sources already reported to {@link onError}. */\r\n private audioReported = new Set<string>();\r\n /** Sources a request in the last window asked for by name, not as a picture's own sound. */\r\n private audioRequired: ReadonlySet<string> = new Set();\r\n /** Keys of the loaders a track measures against, which no window may evict. */\r\n private layoutGateKeys: ReadonlySet<string>;\r\n private disposed = false;\r\n\r\n /** Disposers for loaders whose load has resolved, keyed by loader key. */\r\n private loaderDisposers = new Map<string, Disposer>();\r\n /** In-flight loader runs, keyed by loader key, to dedupe concurrent calls. */\r\n private loaderInFlight = new Map<string, Promise<void>>();\r\n\r\n /**\r\n * @param onError Told once per source when audio a request asked for cannot\r\n * be fetched or decoded. Defaults to `console.error`.\r\n */\r\n constructor(\r\n precomp: AssetTimelineResult,\r\n storageAdapter: StorageAdapter,\r\n audioDevice: AudioSink,\r\n private readonly onError: (error: Error) => void = (error) => console.error(`[AssetManager] ${error.message}`),\r\n ) {\r\n this.precomp = precomp;\r\n this.layoutGateKeys = layoutGatesOf(precomp);\r\n this.storageAdapter = storageAdapter;\r\n this.audioDevice = audioDevice;\r\n }\r\n\r\n // ─── Public surface ───────────────────────────────────────────────────────\r\n\r\n /**\r\n * Swap in a new precomp result (a document swap). The manager keeps its\r\n * warm loader disposers and in-flight audio fetches so a single-track edit\r\n * doesn't re-fetch unchanged assets; the next loadAt/syncAudio picks up the\r\n * new asset windows. Resetting the audio signature forces a reschedule so a\r\n * changed track's audio is re-evaluated against the new timeline — including\r\n * into an empty window, which is how removed audio stops.\r\n */\r\n setPrecomp(precomp: AssetTimelineResult): void {\r\n this.precomp = precomp;\r\n this.layoutGateKeys = layoutGatesOf(precomp);\r\n for (const src of this.audioReported) this.audioFailed.delete(src);\r\n this.audioReported.clear();\r\n this.lastAudioRequestKey = null;\r\n this.lastAudioSrcs = null;\r\n }\r\n\r\n /**\r\n * Blocking load for seek and initial render. Waits for every asset whose\r\n * cacheAt <= frame and endFrame >= frame to be ready, then schedules audio.\r\n */\r\n async loadAt(frame: number): Promise<void> {\r\n const jobs: Promise<void>[] = [];\r\n\r\n for (const [key, track] of this.precomp.assets) {\r\n if (track.record.type === 'loader') {\r\n const job = this.syncLoader(key, track, frame);\r\n if (job) jobs.push(job);\r\n continue;\r\n }\r\n if (track.cacheAt <= frame && track.record.endFrame >= frame) {\r\n jobs.push(this.storageAdapter.loadAsset(key, track.record));\r\n }\r\n }\r\n\r\n await Promise.all(jobs);\r\n if (this.audioDevice.schedulesAudio) this.syncAudio(frame);\r\n }\r\n\r\n /** Whether `key` — a loader key or a stored asset's — is resident now. */\r\n isReady(key: string): boolean {\r\n return this.loaderDisposers.has(key) || this.storageAdapter.isLoaded(key);\r\n }\r\n\r\n /**\r\n * Load `records` whatever their windows say — for layout gates, which must be\r\n * resident before a track measures regardless of the frame being drawn.\r\n */\r\n async loadRecords(records: readonly AssetRecord[]): Promise<void> {\r\n await Promise.all(records.map((record) => record.type === 'loader'\r\n ? this.runLoader(record.src, record.load)\r\n : this.storageAdapter.loadAsset(record.src, record)));\r\n }\r\n\r\n /**\r\n * Non-blocking incremental prefetch called after each render tick. Fires\r\n * loads for assets whose cacheAt window has been reached without blocking.\r\n */\r\n prefetch(frame: number): void {\r\n for (const [key, track] of this.precomp.assets) {\r\n if (track.record.type === 'loader') {\r\n this.syncLoader(key, track, frame)?.catch(err => {\r\n console.error(`[AssetManager] loader failed for ${key}:`, err);\r\n });\r\n continue;\r\n }\r\n if (track.cacheAt <= frame && track.record.endFrame >= frame) {\r\n this.storageAdapter.loadAsset(key, track.record).catch(err => {\r\n console.error(`[AssetManager] prefetch failed for ${key}:`, err);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Drive a single loader track toward the state `frame` requires. If `frame`\r\n * is inside the loader's `[cacheAt, discardAt]` window, run its callback\r\n * (deduped — at most one in-flight run, skipped once loaded) and return the\r\n * pending job, if any. If `frame` is outside the window and the loader was\r\n * loaded, dispose it. Returns the in-flight load promise so a blocking\r\n * caller can await it; `undefined` when there's nothing to wait for.\r\n */\r\n private syncLoader(key: string, track: AssetTrack, frame: number): Promise<void> | undefined {\r\n if (track.record.type !== 'loader') return undefined;\r\n const discardAt = track.discardAt ?? Infinity;\r\n const inWindow = track.cacheAt <= frame && frame <= discardAt;\r\n\r\n if (!inWindow) {\r\n // A layout gate is loaded by `loadRecords` whatever frame is drawn, so\r\n // its window says nothing about when it may go: disposing it here made\r\n // `isReady` false and the next frame load it again.\r\n if (this.layoutGateKeys.has(key)) return undefined;\r\n const dispose = this.loaderDisposers.get(key);\r\n if (dispose) {\r\n this.loaderDisposers.delete(key);\r\n dispose();\r\n }\r\n return undefined;\r\n }\r\n\r\n return this.runLoader(key, track.record.load);\r\n }\r\n\r\n /** Run a loader unless it is resident or already running. */\r\n private runLoader(key: string, load: LoaderFn): Promise<void> | undefined {\r\n // Already loaded for this window, or a run is already in flight.\r\n if (this.loaderDisposers.has(key)) return undefined;\r\n const existing = this.loaderInFlight.get(key);\r\n if (existing) return existing;\r\n\r\n const job = load()\r\n .then(disposer => {\r\n // A loader that resolves nothing is keeping its result resident on\r\n // purpose (see `LoaderFn`). Recording a no-op disposer rather than\r\n // skipping the entry is what keeps `loaderDisposers.has(key)` the\r\n // single \"already loaded\" test for both kinds.\r\n this.loaderDisposers.set(key, disposer ?? NO_DISPOSE);\r\n })\r\n .finally(() => {\r\n this.loaderInFlight.delete(key);\r\n });\r\n this.loaderInFlight.set(key, job);\r\n return job;\r\n }\r\n\r\n /** Run every outstanding loader disposer and clear loader state. */\r\n dispose(): void {\r\n for (const dispose of this.loaderDisposers.values()) dispose();\r\n this.loaderDisposers.clear();\r\n this.loaderInFlight.clear();\r\n this.disposed = true;\r\n }\r\n\r\n /**\r\n * Push the current audio working set to the AudioSink. Called after each\r\n * render tick so the device stays in sync with the tracks' audio requests.\r\n */\r\n syncAudio(frame: number): void {\r\n const currentTime = frame / this.precomp.fps;\r\n\r\n const inWindow: AudioRequest[] = [];\r\n const srcs = new Set<string>();\r\n const required = new Set<string>();\r\n const seen = new Set<string>();\r\n\r\n /** Admit `req` if it overlaps the scheduling window, shifted by its owner's offset. */\r\n const consider = (req: AudioRequest, offsetSecs: number): void => {\r\n const globalStart = offsetSecs + req.startAt;\r\n const globalEnd = offsetSecs + req.endAt;\r\n\r\n if (globalEnd < currentTime || globalStart > currentTime + 10) return;\r\n // Ahead of the dedupe: the flag is not part of a request's identity.\r\n if (!req.optional) required.add(req.src);\r\n\r\n const stableId = stableKey(req, offsetSecs);\r\n if (seen.has(stableId)) return;\r\n seen.add(stableId);\r\n\r\n inWindow.push({\r\n ...req,\r\n id: stableId,\r\n startAt: globalStart,\r\n endAt: globalEnd,\r\n // A bus's span is in its request's seconds, so it moves with it.\r\n ...(req.bus && {\r\n bus: req.bus.map((s) => ({ ...s, startAt: offsetSecs + s.startAt, endAt: offsetSecs + s.endAt })),\r\n }),\r\n });\r\n srcs.add(req.src);\r\n };\r\n\r\n for (const track of this.precomp.tracks) {\r\n const offsetSecs = track.startFrame / this.precomp.fps;\r\n for (const req of track.audioRequests) consider(req, offsetSecs);\r\n }\r\n\r\n this.audioRequired = required;\r\n for (const src of srcs) {\r\n if (!this.audioDevice.has(src) && !this.audioFetching.has(src) && !this.audioFailed.has(src)) {\r\n const job = this.storageAdapter.fetchAudioData(src)\r\n .then(data => this.audioDevice.append(src, data))\r\n .catch(cause => this.failAudio(src, cause))\r\n .finally(() => this.audioFetching.delete(src));\r\n this.audioFetching.set(src, job);\r\n }\r\n }\r\n // A failed source nothing asks for any more is forgotten, so wanting it\r\n // again later tries it afresh; one that failed quietly is reported when\r\n // a request that asks for its sound arrives.\r\n for (const [src, cause] of this.audioFailed) {\r\n if (!srcs.has(src)) {\r\n this.audioFailed.delete(src);\r\n this.audioReported.delete(src);\r\n } else if (required.has(src)) {\r\n this.reportAudio(src, cause);\r\n }\r\n }\r\n\r\n const requestKey = audioSignature(inWindow);\r\n if (requestKey !== this.lastAudioRequestKey) {\r\n this.audioDevice.schedule(inWindow);\r\n this.lastAudioRequestKey = requestKey;\r\n }\r\n if (this.lastAudioSrcs === null || !setsEqual(this.lastAudioSrcs, srcs)) {\r\n this.audioDevice.retain(srcs);\r\n this.lastAudioSrcs = srcs;\r\n }\r\n }\r\n\r\n /** Record that `src` could not be loaded, and say so if a request asked for its sound. */\r\n private failAudio(src: string, cause: unknown): void {\r\n if (this.disposed) return;\r\n this.audioFailed.set(src, cause);\r\n if (this.audioRequired.has(src)) this.reportAudio(src, cause);\r\n }\r\n\r\n /** Say that `src` could not be loaded, once, until it is wanted afresh. */\r\n private reportAudio(src: string, cause: unknown): void {\r\n if (this.audioReported.has(src)) return;\r\n this.audioReported.add(src);\r\n const message = cause instanceof Error ? cause.message : String(cause);\r\n this.onError(new Error(`audio \"${src}\" could not be loaded: ${message}`, { cause }));\r\n }\r\n}\r\n\r\n// ─── Helpers ──────────────────────────────────────────────────────────────────\r\n\r\n/** Every layout-gate key any track of `precomp` declares. */\r\nfunction layoutGatesOf(precomp: AssetTimelineResult): ReadonlySet<string> {\r\n const keys = new Set<string>();\r\n for (const track of precomp.tracks) for (const key of track.layoutGates ?? []) keys.add(key);\r\n return keys;\r\n}\r\n\r\n/** Stand-in for a loader that resolved nothing — see the note in {@link AssetManager.syncLoader}. */\r\nconst NO_DISPOSE: Disposer = () => { };\r\n\r\n/**\r\n * Produce a deterministic string key that uniquely identifies an audio request's\r\n * playback identity. Includes the filter chain (via {@link filtersKey}) so editing a\r\n * filter/volume curve changes the id — the device then stops the stale source and\r\n * rebuilds the graph with the new filters instead of reusing the old one.\r\n *\r\n * The bus chain is in for the same reason: re-routing a clip to a different bus,\r\n * or changing a bus's level or its span, changes what it sounds like without\r\n * changing anything else here — so leaving it out would keep the stale graph.\r\n */\r\nfunction stableKey(req: AudioRequest, clipOffsetSecs: number): string {\r\n return `${req.src}|${clipOffsetSecs + req.startAt}|${clipOffsetSecs + req.endAt}|${req.trimStart}|${req.trimEnd ?? \"_\"}|${req.loop ? 1 : 0}|${req.volume}|${filtersKey(req.filters)}|${busKey(req.bus)}`;\r\n}\r\n\r\n/** The bus chain's contribution to {@link stableKey}. */\r\nfunction busKey(bus: AudioRequest[\"bus\"]): string {\r\n if (!bus || bus.length === 0) return \"\";\r\n return bus.map(busStopKey).join(\">\");\r\n}\r\n\r\n/** Produce a stable hash of the active audio request set to detect scheduling changes. */\r\nfunction audioSignature(reqs: readonly AudioRequest[]): string {\r\n if (reqs.length === 0) return \"\";\r\n return reqs.map(r => r.id).sort().join(\"\\n\");\r\n}\r\n\r\n/** Shallow equality check for two string sets (order-independent). */\r\nfunction setsEqual(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\r\n if (a.size !== b.size) return false;\r\n for (const v of a) if (!b.has(v)) return false;\r\n return true;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/assets/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAM9D;;;GAGG;AACH,MAAM,OAAO,YAAY;IAuCA;IAtCb,OAAO,CAAsB;IACpB,cAAc,CAAiB;IAC/B,WAAW,CAAY;IAExC,sFAAsF;IAC9E,mBAAmB,GAAkB,EAAE,CAAC;IACxC,aAAa,GAA+B,IAAI,GAAG,E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AC;AAChB,CAAC","sourcesContent":["import { AudioRequest, busStopKey } from \"@/attributes/audio/request\";\nimport { effectsKey } from \"@/attributes/audio/effects/union\";\nimport { paramKey } from \"@/attributes/audio/ramp\";\nimport { transitionKey } from \"@/attributes/audio/transition\";\nimport { AssetRecord, Disposer, LoaderFn } from \"@/assets/record\";\nimport { AudioSink } from \"@/platform/audio-sink\";\nimport { StorageAdapter } from \"@/platform/storage-adapter\";\nimport { AssetTrack, AssetTimelineResult } from \"@/runtime/asset-timeline\";\n\n/**\n * Coordinates asset loading and audio synchronization during playback.\n * Wraps a {@link AssetTimelineResult} and delegates storage/audio work to platform adapters.\n */\nexport class AssetManager {\n private precomp: AssetTimelineResult;\n private readonly storageAdapter: StorageAdapter;\n private readonly audioDevice: AudioSink;\n\n /** `null` after a swap: whatever the device holds belongs to the previous precomp. */\n private lastAudioRequestKey: string | null = \"\";\n private lastAudioSrcs: ReadonlySet<string> | null = new Set();\n private audioFetching = new Map<string, Promise<void>>();\n /**\n * Sources whose fetch or decode failed, with why, so they are not fetched\n * again every sync. A source leaves when no request in the window names it\n * any more — and, once it has been reported, when a new precomp arrives —\n * so the next time it is wanted it is tried afresh. One that failed quietly\n * (see {@link AudioRequest.optional}) is kept across a precomp: a video with\n * no audio track would otherwise be fetched whole on every edit.\n */\n private audioFailed = new Map<string, unknown>();\n /** The failed sources already reported to {@link onError}. */\n private audioReported = new Set<string>();\n /** Sources a request in the last window asked for by name, not as a picture's own sound. */\n private audioRequired: ReadonlySet<string> = new Set();\n /** Keys of the loaders a track measures against, which no window may evict. */\n private layoutGateKeys: ReadonlySet<string>;\n private disposed = false;\n\n /** Disposers for loaders whose load has resolved, keyed by loader key. */\n private loaderDisposers = new Map<string, Disposer>();\n /** In-flight loader runs, keyed by loader key, to dedupe concurrent calls. */\n private loaderInFlight = new Map<string, Promise<void>>();\n\n /**\n * @param onError Told once per source when audio a request asked for cannot\n * be fetched or decoded. Defaults to `console.error`.\n */\n constructor(\n precomp: AssetTimelineResult,\n storageAdapter: StorageAdapter,\n audioDevice: AudioSink,\n private readonly onError: (error: Error) => void = (error) => console.error(`[AssetManager] ${error.message}`),\n ) {\n this.precomp = precomp;\n this.layoutGateKeys = layoutGatesOf(precomp);\n this.storageAdapter = storageAdapter;\n this.audioDevice = audioDevice;\n }\n\n // ─── Public surface ───────────────────────────────────────────────────────\n\n /**\n * Swap in a new precomp result (a document swap). The manager keeps its\n * warm loader disposers and in-flight audio fetches so a single-track edit\n * doesn't re-fetch unchanged assets; the next loadAt/syncAudio picks up the\n * new asset windows. Resetting the audio signature forces a reschedule so a\n * changed track's audio is re-evaluated against the new timeline — including\n * into an empty window, which is how removed audio stops.\n */\n setPrecomp(precomp: AssetTimelineResult): void {\n this.precomp = precomp;\n this.layoutGateKeys = layoutGatesOf(precomp);\n for (const src of this.audioReported) this.audioFailed.delete(src);\n this.audioReported.clear();\n this.lastAudioRequestKey = null;\n this.lastAudioSrcs = null;\n }\n\n /**\n * Blocking load for seek and initial render. Waits for every asset whose\n * cacheAt <= frame and endFrame >= frame to be ready, then schedules audio.\n */\n async loadAt(frame: number): Promise<void> {\n const jobs: Promise<void>[] = [];\n\n for (const [key, track] of this.precomp.assets) {\n if (track.record.type === 'loader') {\n const job = this.syncLoader(key, track, frame);\n if (job) jobs.push(job);\n continue;\n }\n if (track.cacheAt <= frame && track.record.endFrame >= frame) {\n jobs.push(this.storageAdapter.loadAsset(key, track.record));\n }\n }\n\n await Promise.all(jobs);\n if (this.audioDevice.schedulesAudio) this.syncAudio(frame);\n }\n\n /** Whether `key` — a loader key or a stored asset's — is resident now. */\n isReady(key: string): boolean {\n return this.loaderDisposers.has(key) || this.storageAdapter.isLoaded(key);\n }\n\n /**\n * Load `records` whatever their windows say — for layout gates, which must be\n * resident before a track measures regardless of the frame being drawn.\n */\n async loadRecords(records: readonly AssetRecord[]): Promise<void> {\n await Promise.all(records.map((record) => record.type === 'loader'\n ? this.runLoader(record.src, record.load)\n : this.storageAdapter.loadAsset(record.src, record)));\n }\n\n /**\n * Non-blocking incremental prefetch called after each render tick. Fires\n * loads for assets whose cacheAt window has been reached without blocking.\n */\n prefetch(frame: number): void {\n for (const [key, track] of this.precomp.assets) {\n if (track.record.type === 'loader') {\n this.syncLoader(key, track, frame)?.catch(err => {\n console.error(`[AssetManager] loader failed for ${key}:`, err);\n });\n continue;\n }\n if (track.cacheAt <= frame && track.record.endFrame >= frame) {\n this.storageAdapter.loadAsset(key, track.record).catch(err => {\n console.error(`[AssetManager] prefetch failed for ${key}:`, err);\n });\n }\n }\n }\n\n /**\n * Drive a single loader track toward the state `frame` requires. If `frame`\n * is inside the loader's `[cacheAt, discardAt]` window, run its callback\n * (deduped — at most one in-flight run, skipped once loaded) and return the\n * pending job, if any. If `frame` is outside the window and the loader was\n * loaded, dispose it. Returns the in-flight load promise so a blocking\n * caller can await it; `undefined` when there's nothing to wait for.\n */\n private syncLoader(key: string, track: AssetTrack, frame: number): Promise<void> | undefined {\n if (track.record.type !== 'loader') return undefined;\n const discardAt = track.discardAt ?? Infinity;\n const inWindow = track.cacheAt <= frame && frame <= discardAt;\n\n if (!inWindow) {\n // A layout gate is loaded by `loadRecords` whatever frame is drawn, so\n // its window says nothing about when it may go: disposing it here made\n // `isReady` false and the next frame load it again.\n if (this.layoutGateKeys.has(key)) return undefined;\n const dispose = this.loaderDisposers.get(key);\n if (dispose) {\n this.loaderDisposers.delete(key);\n dispose();\n }\n return undefined;\n }\n\n return this.runLoader(key, track.record.load);\n }\n\n /** Run a loader unless it is resident or already running. */\n private runLoader(key: string, load: LoaderFn): Promise<void> | undefined {\n // Already loaded for this window, or a run is already in flight.\n if (this.loaderDisposers.has(key)) return undefined;\n const existing = this.loaderInFlight.get(key);\n if (existing) return existing;\n\n const job = load()\n .then(disposer => {\n // A loader that resolves nothing is keeping its result resident on\n // purpose (see `LoaderFn`). Recording a no-op disposer rather than\n // skipping the entry is what keeps `loaderDisposers.has(key)` the\n // single \"already loaded\" test for both kinds.\n this.loaderDisposers.set(key, disposer ?? NO_DISPOSE);\n })\n .finally(() => {\n this.loaderInFlight.delete(key);\n });\n this.loaderInFlight.set(key, job);\n return job;\n }\n\n /** Run every outstanding loader disposer and clear loader state. */\n dispose(): void {\n for (const dispose of this.loaderDisposers.values()) dispose();\n this.loaderDisposers.clear();\n this.loaderInFlight.clear();\n this.disposed = true;\n }\n\n /**\n * Push the current audio working set to the AudioSink. Called after each\n * render tick so the device stays in sync with the tracks' audio requests.\n */\n syncAudio(frame: number): void {\n const currentTime = frame / this.precomp.fps;\n\n const inWindow: AudioRequest[] = [];\n const srcs = new Set<string>();\n const required = new Set<string>();\n const seen = new Set<string>();\n\n /** Admit `req` if it overlaps the scheduling window, shifted by its owner's offset. */\n const consider = (req: AudioRequest, offsetSecs: number): void => {\n const globalStart = offsetSecs + req.startAt;\n const globalEnd = offsetSecs + req.endAt;\n\n if (globalEnd < currentTime || globalStart > currentTime + 10) return;\n // Ahead of the dedupe: the flag is not part of a request's identity.\n if (!req.optional) required.add(req.src);\n\n const stableId = stableKey(req, offsetSecs);\n if (seen.has(stableId)) return;\n seen.add(stableId);\n\n inWindow.push({\n ...req,\n id: stableId,\n startAt: globalStart,\n endAt: globalEnd,\n // A bus's span is in its request's seconds, so it moves with it.\n ...(req.bus && {\n bus: req.bus.map((s) => ({ ...s, startAt: offsetSecs + s.startAt, endAt: offsetSecs + s.endAt })),\n }),\n });\n srcs.add(req.src);\n };\n\n for (const track of this.precomp.tracks) {\n const offsetSecs = track.startFrame / this.precomp.fps;\n for (const req of track.audioRequests) consider(req, offsetSecs);\n }\n\n this.audioRequired = required;\n for (const src of srcs) {\n if (!this.audioDevice.has(src) && !this.audioFetching.has(src) && !this.audioFailed.has(src)) {\n const job = this.storageAdapter.fetchAudioData(src)\n .then(data => this.audioDevice.append(src, data))\n .catch(cause => this.failAudio(src, cause))\n .finally(() => this.audioFetching.delete(src));\n this.audioFetching.set(src, job);\n }\n }\n // A failed source nothing asks for any more is forgotten, so wanting it\n // again later tries it afresh; one that failed quietly is reported when\n // a request that asks for its sound arrives.\n for (const [src, cause] of this.audioFailed) {\n if (!srcs.has(src)) {\n this.audioFailed.delete(src);\n this.audioReported.delete(src);\n } else if (required.has(src)) {\n this.reportAudio(src, cause);\n }\n }\n\n const requestKey = audioSignature(inWindow);\n if (requestKey !== this.lastAudioRequestKey) {\n this.audioDevice.schedule(inWindow);\n this.lastAudioRequestKey = requestKey;\n }\n if (this.lastAudioSrcs === null || !setsEqual(this.lastAudioSrcs, srcs)) {\n this.audioDevice.retain(srcs);\n this.lastAudioSrcs = srcs;\n }\n }\n\n /** Record that `src` could not be loaded, and say so if a request asked for its sound. */\n private failAudio(src: string, cause: unknown): void {\n if (this.disposed) return;\n this.audioFailed.set(src, cause);\n if (this.audioRequired.has(src)) this.reportAudio(src, cause);\n }\n\n /** Say that `src` could not be loaded, once, until it is wanted afresh. */\n private reportAudio(src: string, cause: unknown): void {\n if (this.audioReported.has(src)) return;\n this.audioReported.add(src);\n const message = cause instanceof Error ? cause.message : String(cause);\n this.onError(new Error(`audio \"${src}\" could not be loaded: ${message}`, { cause }));\n }\n}\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\n/** Every layout-gate key any track of `precomp` declares. */\nfunction layoutGatesOf(precomp: AssetTimelineResult): ReadonlySet<string> {\n const keys = new Set<string>();\n for (const track of precomp.tracks) for (const key of track.layoutGates ?? []) keys.add(key);\n return keys;\n}\n\n/** Stand-in for a loader that resolved nothing — see the note in {@link AssetManager.syncLoader}. */\nconst NO_DISPOSE: Disposer = () => { };\n\n/**\n * Produce a deterministic string key that uniquely identifies an audio request's\n * playback identity. Includes the effect chain, the ramps and the transitions so\n * editing any of them changes the id — the device then stops the stale source and\n * rebuilds the graph instead of reusing the old one.\n *\n * The bus chain is in for the same reason: re-routing a clip to a different bus,\n * or changing a bus's level or its span, changes what it sounds like without\n * changing anything else here — so leaving it out would keep the stale graph.\n */\nfunction stableKey(req: AudioRequest, clipOffsetSecs: number): string {\n return `${req.src}|${clipOffsetSecs + req.startAt}|${clipOffsetSecs + req.endAt}|${req.trimStart}|${req.trimEnd ?? \"_\"}|${req.loop ? 1 : 0}|${paramKey(req.volume)}|${paramKey(req.speed)}|${req.sourceLength ?? \"_\"}|${effectsKey(req.effects)}|${transitionKey(req.transitionIn)}|${transitionKey(req.transitionOut)}|${busKey(req.bus)}`;\n}\n\n/** The bus chain's contribution to {@link stableKey}. */\nfunction busKey(bus: AudioRequest[\"bus\"]): string {\n if (!bus || bus.length === 0) return \"\";\n return bus.map(busStopKey).join(\">\");\n}\n\n/** Produce a stable hash of the active audio request set to detect scheduling changes. */\nfunction audioSignature(reqs: readonly AudioRequest[]): string {\n if (reqs.length === 0) return \"\";\n return reqs.map(r => r.id).sort().join(\"\\n\");\n}\n\n/** Shallow equality check for two string sets (order-independent). */\nfunction setsEqual(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\n if (a.size !== b.size) return false;\n for (const v of a) if (!b.has(v)) return false;\n return true;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/assets/manifest.ts"],"names":[],"mappings":"","sourcesContent":["/** Static metadata for an image asset, captured at build time. */\
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/assets/manifest.ts"],"names":[],"mappings":"","sourcesContent":["/** Static metadata for an image asset, captured at build time. */\nexport interface ImageMeta {\n width: number;\n height: number;\n sizeBytes: number;\n src: string;\n}\n\n/** Static metadata for a video asset, captured at build time. */\nexport interface VideoMeta {\n width: number;\n height: number;\n duration: number; // in seconds\n sizeBytes: number;\n src: string;\n}\n\n/** Static metadata for an audio asset, captured at build time. */\nexport interface AudioMeta {\n duration: number; // in seconds\n sizeBytes: number;\n src: string;\n}\n\n/** Static metadata for a font face, captured at build time. */\nexport interface FontMeta {\n fontFamily: string;\n fontWeight: number;\n src: string;\n sizeBytes: number;\n}\n\n/** Discriminated union of all asset metadata shapes. */\nexport type AssetMeta = ImageMeta | VideoMeta | AudioMeta | FontMeta;\n\n/** Build-time asset manifest keyed by source path (images/videos/audio) or family@weight (fonts). */\nexport interface AssetManifest {\n image: Record<string, ImageMeta>;\n video: Record<string, VideoMeta>;\n audio: Record<string, AudioMeta>;\n font: Record<string, FontMeta>;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/assets/record.ts"],"names":[],"mappings":"","sourcesContent":["export type AssetType = 'image' | 'font' | 'video' | 'audio' | 'loader';\
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/assets/record.ts"],"names":[],"mappings":"","sourcesContent":["export type AssetType = 'image' | 'font' | 'video' | 'audio' | 'loader';\n\n/** Frees whatever a {@link LoaderFn} loaded. Called when its window is evicted. */\nexport type Disposer = () => void;\n\n/**\n * An opaque async load owned by the declaring package. Runs the load and\n * optionally resolves a {@link Disposer} that frees it. The core never inspects\n * what was loaded — this is how a component package (e.g. the code component's\n * Shiki highlighter) loads its own resources without core depending on it.\n *\n * Resolving nothing means \"keep it resident\": a syntax grammar or a 3D runtime is\n * cheap to hold and expensive to re-fetch, so most loaders have nothing to free.\n * Resolving a `Disposer` opts into eviction when the frame window closes.\n */\nexport type LoaderFn = () => Promise<void | Disposer>;\n\n// ─── Cached entry types ───────────────────────────────────────────────────────\n\n/** The frame window one asset is needed over. */\ninterface BaseAssetRecord {\n type: AssetType;\n /** First frame at which this asset is needed. */\n startFrame: number;\n /** Last frame at which this asset is needed. */\n endFrame: number;\n src: string;\n}\n\nexport interface ImageRecord extends BaseAssetRecord {\n type: 'image';\n}\n\nexport interface FontRecord extends BaseAssetRecord {\n type: 'font';\n fontWeight: number;\n fontFamily: string;\n}\n\nexport interface VideoRecord extends BaseAssetRecord {\n type: 'video';\n trimStart: number; // seconds; default 0\n trimEnd: number; // seconds; default is end of video (manifest duration)\n}\n\nexport interface AudioRecord extends BaseAssetRecord {\n type: 'audio';\n trimStart: number; // seconds; default 0\n trimEnd: number; // seconds; default is end of audio (manifest duration)\n}\n\n/**\n * A generic, opaque async load tracked on the timeline like any other asset.\n * Unlike images/fonts/etc. it isn't dispatched by {@link StorageAdapter}; the\n * {@link AssetManager} runs {@link load} directly when the frame window opens\n * and calls the returned {@link Disposer} when it evicts. `src` is the dedupe\n * key (e.g. `lang:java|github-dark`).\n */\nexport interface LoaderRecord extends BaseAssetRecord {\n type: 'loader';\n load: LoaderFn;\n}\n\n/** Union of all per-type cached entry shapes. */\nexport type AssetRecord = ImageRecord | FontRecord | VideoRecord | AudioRecord | LoaderRecord;"]}
|