@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +356 -0
- package/NOTICE +49 -0
- package/README.md +29 -10
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +7 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +99 -15
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +4 -4
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +52 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +10 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +26 -24
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +51 -30
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +18 -13
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +13 -11
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +8 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +7 -9
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +56 -12
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +59 -19
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +27 -141
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +24 -106
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +2 -3
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +117 -522
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +102 -364
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +98 -28
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +21 -7
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +82 -34
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +57 -34
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +6 -8
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +34 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +157 -112
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +102 -50
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +2 -2
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +9 -1
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +12 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +7 -17
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +3 -19
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +3 -3
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +6 -6
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +12 -13
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js +2 -0
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +2 -0
- package/dist/browser/experimental.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +5 -5
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -19
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -19
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +62 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +38 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.d.ts +5 -5
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.js +4 -15
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +143 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.d.ts +1 -1
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.js +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.d.ts +10 -12
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.js +10 -12
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +116 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.d.ts +2 -2
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.js +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +543 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +107 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +66 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +347 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +453 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.d.ts +4 -4
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.js +3 -4
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.d.ts +2 -2
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.js +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.d.ts +3 -3
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.js +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-render.js +10 -23
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.d.ts +3 -3
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.js +4 -4
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.d.ts +2 -2
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.js +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.d.ts +206 -185
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.js +296 -324
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.d.ts +25 -15
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.js +30 -35
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.d.ts +9 -10
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.js +16 -13
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.d.ts +3 -3
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.js +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.d.ts +1 -1
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.js +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node.d.ts +46 -82
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node.js +89 -114
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.d.ts +16 -15
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.js +40 -85
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.d.ts +65 -25
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.js +78 -76
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/audio.d.ts +10 -2
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +45 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +18 -42
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +23 -5
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +72 -10
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +2 -2
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +10 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +6 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +32 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +71 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +4 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +71 -44
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +94 -35
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +57 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +264 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +145 -20
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +478 -80
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +30 -44
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +20 -8
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +195 -52
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +82 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +34 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +26 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +6 -1
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +29 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +84 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +19 -3
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +20 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -9
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +11 -5
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/render-context2d.d.ts +8 -8
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +21 -23
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +85 -34
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/resources.d.ts +2 -2
- package/dist/render3d/resources.js +2 -2
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +12 -1
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +40 -7
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +11 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +20 -3
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +29 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +3 -2
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +8 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -19
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +13 -6
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +34 -12
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +20 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +132 -27
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +13 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +6 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +45 -4
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +127 -13
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +14 -6
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +10 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +32 -3
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +78 -11
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +16 -10
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +23 -8
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +2 -2
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +6 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +70 -38
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +71 -46
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +21 -8
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +12 -23
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +13 -1
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +17 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +41 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/index.d.ts +3 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +2 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +8 -10
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -249
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
- package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
- package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
- package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -19
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -16
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -115
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -190
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -4
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -40
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -68
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -52
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -46
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -54
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -71
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -118
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -348
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts +0 -47
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js +0 -63
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts +0 -29
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js +0 -43
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -100
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -140
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -73
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -144
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -135
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -504
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -91
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -71
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -270
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -438
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -159
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -254
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -100
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -70
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -122
- package/dist/tween/seekable.js.map +0 -1
- /package/dist/{nodes → components/builtins}/text/number-pattern.d.ts +0 -0
- /package/dist/{nodes → components/builtins}/text/number-pattern.js +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.d.ts +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.js +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Registry } from "./registry.js";
|
|
2
|
+
import { type NodeSpec } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Where a node type may go, read off the registry without building anything:
|
|
5
|
+
* the answer a host needs before it offers a type under a parent, accepts a
|
|
6
|
+
* drop, or lets an assistant create a row.
|
|
7
|
+
*
|
|
8
|
+
* Four things decide it. A parent that takes no children takes none. The two
|
|
9
|
+
* trees do not mix: a `Node3D` lives under a Canvas 3D or another 3D node, and
|
|
10
|
+
* nothing else does. A type that names where it goes ({@link
|
|
11
|
+
* NodeTypeDescriptor.within}) goes only there, and a {@link
|
|
12
|
+
* NodeTypeDescriptor.closed} parent takes only the types that name it. Those
|
|
13
|
+
* are about the parent; {@link NodeTypeDescriptor.beside} is about the
|
|
14
|
+
* siblings, and is kept apart because a host can meet it by adding one.
|
|
15
|
+
*
|
|
16
|
+
* Only a leaf is enforced when a document is built: a component declaring
|
|
17
|
+
* `allowedChildren: []` throws on a child. A node in any other wrong place
|
|
18
|
+
* builds and, as a rule, draws nothing; this says why.
|
|
19
|
+
*/
|
|
20
|
+
/** Why a node of a type is not where it can work. */
|
|
21
|
+
export type PlacementIssue =
|
|
22
|
+
/** The parent takes no children. */
|
|
23
|
+
{
|
|
24
|
+
kind: "leaf";
|
|
25
|
+
parent: string;
|
|
26
|
+
}
|
|
27
|
+
/** A 3D node outside a 3D tree, or anything else inside one. */
|
|
28
|
+
| {
|
|
29
|
+
kind: "dimension";
|
|
30
|
+
parent: string | null;
|
|
31
|
+
}
|
|
32
|
+
/** It goes inside one of `within`, and the parent is none of them. */
|
|
33
|
+
| {
|
|
34
|
+
kind: "within";
|
|
35
|
+
within: readonly string[];
|
|
36
|
+
}
|
|
37
|
+
/** The parent takes only the types that name it. */
|
|
38
|
+
| {
|
|
39
|
+
kind: "closed";
|
|
40
|
+
parent: string;
|
|
41
|
+
}
|
|
42
|
+
/** It needs one of `beside` under the same parent, and there is none. */
|
|
43
|
+
| {
|
|
44
|
+
kind: "beside";
|
|
45
|
+
beside: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
export interface PlacementOptions {
|
|
48
|
+
/**
|
|
49
|
+
* A host's own sense of one type standing for another, beside the
|
|
50
|
+
* registry's: a copy of a component it made under a new key is still that
|
|
51
|
+
* component to whatever goes inside it.
|
|
52
|
+
*/
|
|
53
|
+
isA?: (type: string, name: string) => boolean;
|
|
54
|
+
}
|
|
55
|
+
/** Whether `type` is `name`, or is built on it through `parentKey`. */
|
|
56
|
+
export declare function nodeTypeIsA(registry: Registry, type: string, name: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Why a node of `child` cannot go directly inside one of `parent`, or `null`
|
|
59
|
+
* when it can. A `null` parent is the document's own root, which is 2D and
|
|
60
|
+
* names nothing.
|
|
61
|
+
*/
|
|
62
|
+
export declare function parentIssue(registry: Registry, child: string, parent: string | null, options?: PlacementOptions): PlacementIssue | null;
|
|
63
|
+
/** The sibling `child` needs that `siblings`, the types already under its parent, do not include; `null` when it needs none or has one. */
|
|
64
|
+
export declare function siblingIssue(registry: Registry, child: string, siblings: readonly string[], options?: PlacementOptions): PlacementIssue | null;
|
|
65
|
+
/**
|
|
66
|
+
* Every node of `nodes` that is not where its type says it goes, by id, with
|
|
67
|
+
* the first reason. A node of an unregistered type is left out: that is a build
|
|
68
|
+
* error, and says so itself.
|
|
69
|
+
*/
|
|
70
|
+
export declare function placementIssues(registry: Registry, nodes: readonly Pick<NodeSpec, "id" | "type" | "parentId">[], options?: PlacementOptions): Map<string, PlacementIssue>;
|
|
71
|
+
//# sourceMappingURL=placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../src/document/placement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;;;;;;;;;;GAgBG;AAEH,qDAAqD;AACrD,MAAM,MAAM,cAAc;AACtB,oCAAoC;AAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAClC,gEAAgE;GAC9D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;AAC9C,sEAAsE;GACpE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;AAC/C,oDAAoD;GAClD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACpC,yEAAyE;GACvE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC7B;;;;OAIG;IACH,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACjD;AAKD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOnF;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,GAAE,gBAAqB,GAC/B,cAAc,GAAG,IAAI,CAgBvB;AAED,2IAA2I;AAC3I,wBAAgB,YAAY,CACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,GAAE,gBAAqB,GAC/B,cAAc,GAAG,IAAI,CAIvB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC,EAAE,EAC5D,OAAO,GAAE,gBAAqB,GAC/B,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAsB7B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ROOT_NODE_ID } from "./types.js";
|
|
2
|
+
/** The one core type whose children are of the other dimension. */
|
|
3
|
+
const CANVAS_3D = "canvas3d";
|
|
4
|
+
/** Whether `type` is `name`, or is built on it through `parentKey`. */
|
|
5
|
+
export function nodeTypeIsA(registry, type, name) {
|
|
6
|
+
const seen = new Set();
|
|
7
|
+
for (let at = type; at !== undefined && !seen.has(at); at = registry.describe(at)?.parentKey) {
|
|
8
|
+
if (at === name)
|
|
9
|
+
return true;
|
|
10
|
+
seen.add(at);
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
function among(registry, type, names, options) {
|
|
15
|
+
return names.some((name) => nodeTypeIsA(registry, type, name) || options.isA?.(type, name) === true);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Why a node of `child` cannot go directly inside one of `parent`, or `null`
|
|
19
|
+
* when it can. A `null` parent is the document's own root, which is 2D and
|
|
20
|
+
* names nothing.
|
|
21
|
+
*/
|
|
22
|
+
export function parentIssue(registry, child, parent, options = {}) {
|
|
23
|
+
const own = registry.describe(child);
|
|
24
|
+
const holder = parent === null ? undefined : registry.describe(parent);
|
|
25
|
+
if (parent !== null && (holder?.layout?.acceptsChildren === false || holder?.holds?.length === 0))
|
|
26
|
+
return { kind: "leaf", parent };
|
|
27
|
+
const within = own?.within ?? [];
|
|
28
|
+
if (within.length > 0 && (parent === null || !among(registry, parent, within, options))) {
|
|
29
|
+
return { kind: "within", within };
|
|
30
|
+
}
|
|
31
|
+
if (parent !== null && holder?.closed === true && !among(registry, parent, within, options)) {
|
|
32
|
+
return { kind: "closed", parent };
|
|
33
|
+
}
|
|
34
|
+
const inThree = parent !== null && (holder?.dimension === "3d" || holder?.holds?.includes("3d") === true || among(registry, parent, [CANVAS_3D], options));
|
|
35
|
+
if ((own?.dimension === "3d") !== inThree)
|
|
36
|
+
return { kind: "dimension", parent };
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/** The sibling `child` needs that `siblings`, the types already under its parent, do not include; `null` when it needs none or has one. */
|
|
40
|
+
export function siblingIssue(registry, child, siblings, options = {}) {
|
|
41
|
+
const beside = registry.describe(child)?.beside ?? [];
|
|
42
|
+
if (beside.length === 0 || siblings.some((type) => among(registry, type, beside, options)))
|
|
43
|
+
return null;
|
|
44
|
+
return { kind: "beside", beside };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every node of `nodes` that is not where its type says it goes, by id, with
|
|
48
|
+
* the first reason. A node of an unregistered type is left out: that is a build
|
|
49
|
+
* error, and says so itself.
|
|
50
|
+
*/
|
|
51
|
+
export function placementIssues(registry, nodes, options = {}) {
|
|
52
|
+
// A document may write its stage as a row or leave it out: either way its children's parent is the root.
|
|
53
|
+
const parentOf = (node) => (node.parentId === ROOT_NODE_ID ? null : node.parentId);
|
|
54
|
+
const byId = new Map(nodes.map((node) => [node.id, node]));
|
|
55
|
+
const children = new Map();
|
|
56
|
+
for (const node of nodes) {
|
|
57
|
+
if (node.id === ROOT_NODE_ID)
|
|
58
|
+
continue;
|
|
59
|
+
const under = children.get(parentOf(node));
|
|
60
|
+
if (under)
|
|
61
|
+
under.push(node.type);
|
|
62
|
+
else
|
|
63
|
+
children.set(parentOf(node), [node.type]);
|
|
64
|
+
}
|
|
65
|
+
const issues = new Map();
|
|
66
|
+
for (const node of nodes) {
|
|
67
|
+
if (node.id === ROOT_NODE_ID || !registry.hasNode(node.type))
|
|
68
|
+
continue;
|
|
69
|
+
const parentId = parentOf(node);
|
|
70
|
+
const parentType = parentId === null ? null : (byId.get(parentId)?.type ?? null);
|
|
71
|
+
const issue = parentIssue(registry, node.type, parentType, options) ??
|
|
72
|
+
siblingIssue(registry, node.type, without(children.get(parentId) ?? [], node.type), options);
|
|
73
|
+
if (issue)
|
|
74
|
+
issues.set(node.id, issue);
|
|
75
|
+
}
|
|
76
|
+
return issues;
|
|
77
|
+
}
|
|
78
|
+
// The node's own type once: a second area is a sibling of the first, the first is not its own.
|
|
79
|
+
function without(types, own) {
|
|
80
|
+
const at = types.indexOf(own);
|
|
81
|
+
return at === -1 ? [...types] : [...types.slice(0, at), ...types.slice(at + 1)];
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.js","sourceRoot":"","sources":["../../src/document/placement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,MAAM,SAAS,CAAC;AA0CtD,mEAAmE;AACnE,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,uEAAuE;AACvE,MAAM,UAAU,WAAW,CAAC,QAAkB,EAAE,IAAY,EAAE,IAAY;IACtE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,IAAI,EAAE,GAAuB,IAAI,EAAE,EAAE,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC;QAC/G,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,KAAK,CAAC,QAAkB,EAAE,IAAY,EAAE,KAAwB,EAAE,OAAyB;IAChG,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;AACzG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CACvB,QAAkB,EAClB,KAAa,EACb,MAAqB,EACrB,UAA4B,EAAE;IAE9B,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvE,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,KAAK,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAEnI,MAAM,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,EAAE,CAAC;IACjC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;QACtF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACtC,CAAC;IACD,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAC1F,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,IAAI,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3J,IAAI,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC,KAAK,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IAChF,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,2IAA2I;AAC3I,MAAM,UAAU,YAAY,CACxB,QAAkB,EAClB,KAAa,EACb,QAA2B,EAC3B,UAA4B,EAAE;IAE9B,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC;IACtD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACxG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC3B,QAAkB,EAClB,KAA4D,EAC5D,UAA4B,EAAE;IAE9B,yGAAyG;IACzG,MAAM,QAAQ,GAAG,CAAC,IAAgC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/G,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA2B,CAAC;IACpD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,EAAE,KAAK,YAAY;YAAE,SAAS;QACvC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;YAC5B,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,EAAE,KAAK,YAAY,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,SAAS;QACvE,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC;QACjF,MAAM,KAAK,GACP,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;YACrD,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QACjG,IAAI,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,+FAA+F;AAC/F,SAAS,OAAO,CAAC,KAAwB,EAAE,GAAW;IAClD,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import type { Registry } from \"./registry\";\nimport { ROOT_NODE_ID, type NodeSpec } from \"./types\";\n\n/**\n * Where a node type may go, read off the registry without building anything:\n * the answer a host needs before it offers a type under a parent, accepts a\n * drop, or lets an assistant create a row.\n *\n * Four things decide it. A parent that takes no children takes none. The two\n * trees do not mix: a `Node3D` lives under a Canvas 3D or another 3D node, and\n * nothing else does. A type that names where it goes ({@link\n * NodeTypeDescriptor.within}) goes only there, and a {@link\n * NodeTypeDescriptor.closed} parent takes only the types that name it. Those\n * are about the parent; {@link NodeTypeDescriptor.beside} is about the\n * siblings, and is kept apart because a host can meet it by adding one.\n *\n * Only a leaf is enforced when a document is built: a component declaring\n * `allowedChildren: []` throws on a child. A node in any other wrong place\n * builds and, as a rule, draws nothing; this says why.\n */\n\n/** Why a node of a type is not where it can work. */\nexport type PlacementIssue =\n /** The parent takes no children. */\n | { kind: \"leaf\"; parent: string }\n /** A 3D node outside a 3D tree, or anything else inside one. */\n | { kind: \"dimension\"; parent: string | null }\n /** It goes inside one of `within`, and the parent is none of them. */\n | { kind: \"within\"; within: readonly string[] }\n /** The parent takes only the types that name it. */\n | { kind: \"closed\"; parent: string }\n /** It needs one of `beside` under the same parent, and there is none. */\n | { kind: \"beside\"; beside: readonly string[] };\n\nexport interface PlacementOptions {\n /**\n * A host's own sense of one type standing for another, beside the\n * registry's: a copy of a component it made under a new key is still that\n * component to whatever goes inside it.\n */\n isA?: (type: string, name: string) => boolean;\n}\n\n/** The one core type whose children are of the other dimension. */\nconst CANVAS_3D = \"canvas3d\";\n\n/** Whether `type` is `name`, or is built on it through `parentKey`. */\nexport function nodeTypeIsA(registry: Registry, type: string, name: string): boolean {\n const seen = new Set<string>();\n for (let at: string | undefined = type; at !== undefined && !seen.has(at); at = registry.describe(at)?.parentKey) {\n if (at === name) return true;\n seen.add(at);\n }\n return false;\n}\n\nfunction among(registry: Registry, type: string, names: readonly string[], options: PlacementOptions): boolean {\n return names.some((name) => nodeTypeIsA(registry, type, name) || options.isA?.(type, name) === true);\n}\n\n/**\n * Why a node of `child` cannot go directly inside one of `parent`, or `null`\n * when it can. A `null` parent is the document's own root, which is 2D and\n * names nothing.\n */\nexport function parentIssue(\n registry: Registry,\n child: string,\n parent: string | null,\n options: PlacementOptions = {},\n): PlacementIssue | null {\n const own = registry.describe(child);\n const holder = parent === null ? undefined : registry.describe(parent);\n if (parent !== null && (holder?.layout?.acceptsChildren === false || holder?.holds?.length === 0)) return { kind: \"leaf\", parent };\n\n const within = own?.within ?? [];\n if (within.length > 0 && (parent === null || !among(registry, parent, within, options))) {\n return { kind: \"within\", within };\n }\n if (parent !== null && holder?.closed === true && !among(registry, parent, within, options)) {\n return { kind: \"closed\", parent };\n }\n\n const inThree = parent !== null && (holder?.dimension === \"3d\" || holder?.holds?.includes(\"3d\") === true || among(registry, parent, [CANVAS_3D], options));\n if ((own?.dimension === \"3d\") !== inThree) return { kind: \"dimension\", parent };\n return null;\n}\n\n/** The sibling `child` needs that `siblings`, the types already under its parent, do not include; `null` when it needs none or has one. */\nexport function siblingIssue(\n registry: Registry,\n child: string,\n siblings: readonly string[],\n options: PlacementOptions = {},\n): PlacementIssue | null {\n const beside = registry.describe(child)?.beside ?? [];\n if (beside.length === 0 || siblings.some((type) => among(registry, type, beside, options))) return null;\n return { kind: \"beside\", beside };\n}\n\n/**\n * Every node of `nodes` that is not where its type says it goes, by id, with\n * the first reason. A node of an unregistered type is left out: that is a build\n * error, and says so itself.\n */\nexport function placementIssues(\n registry: Registry,\n nodes: readonly Pick<NodeSpec, \"id\" | \"type\" | \"parentId\">[],\n options: PlacementOptions = {},\n): Map<string, PlacementIssue> {\n // A document may write its stage as a row or leave it out: either way its children's parent is the root.\n const parentOf = (node: Pick<NodeSpec, \"parentId\">) => (node.parentId === ROOT_NODE_ID ? null : node.parentId);\n const byId = new Map(nodes.map((node) => [node.id, node]));\n const children = new Map<string | null, string[]>();\n for (const node of nodes) {\n if (node.id === ROOT_NODE_ID) continue;\n const under = children.get(parentOf(node));\n if (under) under.push(node.type);\n else children.set(parentOf(node), [node.type]);\n }\n const issues = new Map<string, PlacementIssue>();\n for (const node of nodes) {\n if (node.id === ROOT_NODE_ID || !registry.hasNode(node.type)) continue;\n const parentId = parentOf(node);\n const parentType = parentId === null ? null : (byId.get(parentId)?.type ?? null);\n const issue =\n parentIssue(registry, node.type, parentType, options) ??\n siblingIssue(registry, node.type, without(children.get(parentId) ?? [], node.type), options);\n if (issue) issues.set(node.id, issue);\n }\n return issues;\n}\n\n// The node's own type once: a second area is a sibling of the first, the first is not its own.\nfunction without(types: readonly string[], own: string): string[] {\n const at = types.indexOf(own);\n return at === -1 ? [...types] : [...types.slice(0, at), ...types.slice(at + 1)];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Size2D } from "../attributes/layout/size.js";
|
|
2
2
|
import type { Theme } from "../project/config.js";
|
|
3
|
-
import type { ClipDocument,
|
|
3
|
+
import type { ClipDocument, VisualDocument } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* The **project** as data: a whole video, not one clip — and the one thing the
|
|
6
6
|
* runtime plays.
|
|
@@ -23,6 +23,8 @@ import type { ClipDocument, SceneDocument } from "./types.js";
|
|
|
23
23
|
*/
|
|
24
24
|
export interface ProjectDocument {
|
|
25
25
|
kind: "project";
|
|
26
|
+
/** The format it was written in — see `migrate.ts`. Absent is format 0, every document written before the field existed. */
|
|
27
|
+
formatVersion?: number;
|
|
26
28
|
/** Human-readable project name. */
|
|
27
29
|
name: string;
|
|
28
30
|
/** Target frame rate. Defaults to 60. */
|
|
@@ -83,7 +85,7 @@ export declare function isProjectDocument(doc: unknown): doc is ProjectDocument;
|
|
|
83
85
|
* Viewport and fps describe the output rather than the clip, so they come from
|
|
84
86
|
* the caller.
|
|
85
87
|
*/
|
|
86
|
-
export declare function asProjectDocument(doc: ProjectDocument |
|
|
88
|
+
export declare function asProjectDocument(doc: ProjectDocument | VisualDocument, output?: {
|
|
87
89
|
name?: string;
|
|
88
90
|
viewport?: Size2D;
|
|
89
91
|
fps?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,4HAA4H;IAC5H,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IAClB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,eAAe,GAAG,cAAc,EACrC,MAAM,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAChE,eAAe,CAWjB"}
|
package/dist/document/project.js
CHANGED
|
@@ -15,6 +15,7 @@ export function asProjectDocument(doc, output = {}) {
|
|
|
15
15
|
return doc;
|
|
16
16
|
return {
|
|
17
17
|
kind: "project",
|
|
18
|
+
...(doc.formatVersion !== undefined && { formatVersion: doc.formatVersion }),
|
|
18
19
|
name: output.name ?? "Untitled",
|
|
19
20
|
fps: output.fps,
|
|
20
21
|
viewport: output.viewport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA+E3C,gDAAgD;AAChD,MAAM,UAAU,iBAAiB,CAAC,GAAY;IAC1C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAAuB,CAAC,IAAI,KAAK,SAAS,CAAC;AAClG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC7B,GAAqC,EACrC,SAA6D,EAAE;IAE/D,IAAI,iBAAiB,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,OAAO;QACH,IAAI,EAAE,SAAS;QACf,GAAG,CAAC,GAAG,CAAC,aAAa,KAAK,SAAS,IAAI,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa,EAAE,CAAC;QAC5E,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,UAAU;QAC/B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;KACvE,CAAC;AACN,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\nimport type { Theme } from \"@/project/config\";\n\nimport type { ClipDocument, VisualDocument } from \"./types\";\nimport { documentDuration } from \"./types\";\n\n/**\n * The **project** as data: a whole video, not one clip — and the one thing the\n * runtime plays.\n *\n * A clip document says what happens inside one composition. This says how those\n * compositions are laid against each other to make the finished thing — and it\n * is the same idea one level up, so it reads the same way: rows placed at times,\n * evaluated rather than played.\n *\n * ### One list of tracks\n *\n * A {@link ClipDocument} is a still, a composition *or* an audio document, and a\n * composition already carries both picture and sound — so there is one list for\n * all of it, not a second one for sound.\n *\n * **Array position is paint order**, first entry at the back, exactly as\n * position in a `fill` array is. A background is the first track; an overlay is\n * the last; a cross-dissolve is two tracks whose spans overlap and whose clips\n * fade themselves.\n */\nexport interface ProjectDocument {\n kind: \"project\";\n /** The format it was written in — see `migrate.ts`. Absent is format 0, every document written before the field existed. */\n formatVersion?: number;\n /** Human-readable project name. */\n name: string;\n /** Target frame rate. Defaults to 60. */\n fps?: number;\n /** Output canvas dimensions in pixels. Defaults to 1920×1080. */\n viewport?: Size2D;\n /** Visual design tokens (colors, typography) available to every clip. */\n theme?: Theme;\n /**\n * Every clip, placed. **Array position is paint order** — the first entry is\n * at the back.\n */\n tracks: Track[];\n}\n\n/**\n * One clip, placed on the project timeline.\n *\n * The clip document is **inline**, not referenced by id. A shared id would deduplicate JSON and\n * cost an id space, a resolution step and a dangling-reference failure mode — and\n * it would not buy what it looks like it buys, because the content that actually\n * repeats in an edit mostly has to *differ* per placement (a lower third with\n * different text, a chapter card with a different label).\n */\nexport interface Track {\n /**\n * Stable identity, so a host can address, reorder and diff one row — and so\n * the runtime can keep a track's built tree across an edit that leaves its\n * clip untouched.\n */\n id: string;\n /** Display label. */\n name?: string;\n /** What plays: a still, a composition, or sound. */\n clip: ClipDocument;\n /**\n * Second on the **project** timeline at which this clip's own clock reads 0.\n * Authored, never derived from the row above it, so a clip's start cannot\n * move because a neighbour changed. Defaults to 0.\n */\n startAt?: number;\n /**\n * Seconds this clip occupies. **Required.**\n *\n * So a project's length is arithmetic over its tracks rather than something\n * measured out of a media file or a timeline — a three-minute music bed\n * cannot silently make a thirty-second edit three minutes long. Longer than\n * the document holds its last frame; shorter cuts it off, which is also what\n * lets a **still**, a document with no length at all, be a backdrop.\n */\n duration: number;\n}\n\n/** Narrows an unknown document to a project. */\nexport function isProjectDocument(doc: unknown): doc is ProjectDocument {\n return typeof doc === \"object\" && doc !== null && (doc as ProjectDocument).kind === \"project\";\n}\n\n/**\n * The project a session plays, from either document it can open.\n *\n * A lone still or composition becomes the only track of a project around it.\n * Viewport and fps describe the output rather than the clip, so they come from\n * the caller.\n */\nexport function asProjectDocument(\n doc: ProjectDocument | VisualDocument,\n output: { name?: string; viewport?: Size2D; fps?: number } = {},\n): ProjectDocument {\n if (isProjectDocument(doc)) return doc;\n return {\n kind: \"project\",\n ...(doc.formatVersion !== undefined && { formatVersion: doc.formatVersion }),\n name: output.name ?? \"Untitled\",\n fps: output.fps,\n viewport: output.viewport,\n theme: doc.theme,\n tracks: [{ id: \"clip\", clip: doc, duration: documentDuration(doc) }],\n };\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Registry } from "./registry.js";
|
|
2
|
+
/**
|
|
3
|
+
* How a node type's props changed since documents first named it — declared by
|
|
4
|
+
* a component spec's `renamed`, `deprecated` and `migrate`, applied to a row's
|
|
5
|
+
* props whenever one is built, and callable by a host rewriting stored rows.
|
|
6
|
+
*
|
|
7
|
+
* Unlike a document migration this has no version to go by: a row stored a year
|
|
8
|
+
* ago and one stored today pass through the same rules, so every rule has to
|
|
9
|
+
* leave a current value alone.
|
|
10
|
+
*/
|
|
11
|
+
export interface PropEvolution {
|
|
12
|
+
/** Old key → the entry it became. A row setting both keeps the new one. */
|
|
13
|
+
readonly renamed: Readonly<Record<string, string>>;
|
|
14
|
+
/** Entry → why it is deprecated and what to use instead. It still works. */
|
|
15
|
+
readonly deprecated: Readonly<Record<string, string>>;
|
|
16
|
+
/**
|
|
17
|
+
* Key → a value hook. Keyed by an old key from {@link renamed}, it converts
|
|
18
|
+
* only what was stored under that key (a unit change rides on a rename);
|
|
19
|
+
* keyed by an entry, it runs on every stored value and must hand a current
|
|
20
|
+
* one back unchanged. `undefined` drops the prop back to its default.
|
|
21
|
+
*/
|
|
22
|
+
readonly migrate: Readonly<Record<string, (value: unknown) => unknown>>;
|
|
23
|
+
}
|
|
24
|
+
/** One prop a migration touched, or one a row still sets that is deprecated. */
|
|
25
|
+
export interface PropNote {
|
|
26
|
+
prop: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
export interface PropMigration {
|
|
30
|
+
/** The props given, when nothing changed; a new object otherwise. */
|
|
31
|
+
props: Record<string, unknown>;
|
|
32
|
+
changes: PropNote[];
|
|
33
|
+
deprecated: PropNote[];
|
|
34
|
+
}
|
|
35
|
+
/** @internal Record `evolution` on a node class; a component factory does this for its generated class. */
|
|
36
|
+
export declare function declarePropEvolution(ctor: abstract new (...args: never[]) => object, evolution: PropEvolution): void;
|
|
37
|
+
/** @internal What {@link declarePropEvolution} recorded on this exact class. */
|
|
38
|
+
export declare function propEvolutionOf(ctor: abstract new (...args: never[]) => object): PropEvolution | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Bring a stored row's props up to what `type` declares today: old keys
|
|
41
|
+
* renamed, values migrated, deprecated props reported. A type this registry
|
|
42
|
+
* does not know, or one that never changed, hands `props` back as it is.
|
|
43
|
+
*
|
|
44
|
+
* Applies equally to a `to`/`set` command's args, which are a props diff.
|
|
45
|
+
* An expression is moved by a rename but handed to no value hook: a formula's
|
|
46
|
+
* result cannot be converted by rewriting it, so it is noted and left as written.
|
|
47
|
+
*/
|
|
48
|
+
export declare function migrateNodeProps(registry: Registry, type: string, props: Record<string, unknown>): PropMigration;
|
|
49
|
+
/** @internal {@link migrateNodeProps} once the type's rules are in hand. */
|
|
50
|
+
export declare function applyPropEvolution(evolution: PropEvolution, props: Record<string, unknown>): PropMigration;
|
|
51
|
+
//# sourceMappingURL=prop-evolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-evolution.d.ts","sourceRoot":"","sources":["../../src/document/prop-evolution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC;CAC3E;AAED,gFAAgF;AAChF,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC1B,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,UAAU,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAID,2GAA2G;AAC3G,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,IAAI,CAEpH;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,GAAG,aAAa,GAAG,SAAS,CAI1G;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CAIhH;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CA+C1G"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { expressionOps } from "./expression/ops.js";
|
|
2
|
+
const PROP_EVOLUTION = Symbol("propEvolution");
|
|
3
|
+
/** @internal Record `evolution` on a node class; a component factory does this for its generated class. */
|
|
4
|
+
export function declarePropEvolution(ctor, evolution) {
|
|
5
|
+
ctor.prototype[PROP_EVOLUTION] = evolution;
|
|
6
|
+
}
|
|
7
|
+
/** @internal What {@link declarePropEvolution} recorded on this exact class. */
|
|
8
|
+
export function propEvolutionOf(ctor) {
|
|
9
|
+
const proto = ctor.prototype;
|
|
10
|
+
if (!proto || !Object.prototype.hasOwnProperty.call(proto, PROP_EVOLUTION))
|
|
11
|
+
return undefined;
|
|
12
|
+
return proto[PROP_EVOLUTION];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Bring a stored row's props up to what `type` declares today: old keys
|
|
16
|
+
* renamed, values migrated, deprecated props reported. A type this registry
|
|
17
|
+
* does not know, or one that never changed, hands `props` back as it is.
|
|
18
|
+
*
|
|
19
|
+
* Applies equally to a `to`/`set` command's args, which are a props diff.
|
|
20
|
+
* An expression is moved by a rename but handed to no value hook: a formula's
|
|
21
|
+
* result cannot be converted by rewriting it, so it is noted and left as written.
|
|
22
|
+
*/
|
|
23
|
+
export function migrateNodeProps(registry, type, props) {
|
|
24
|
+
const ctor = registry.node(type)?.ctor;
|
|
25
|
+
const evolution = ctor ? propEvolutionOf(ctor) : undefined;
|
|
26
|
+
return evolution ? applyPropEvolution(evolution, props) : { props, changes: [], deprecated: [] };
|
|
27
|
+
}
|
|
28
|
+
/** @internal {@link migrateNodeProps} once the type's rules are in hand. */
|
|
29
|
+
export function applyPropEvolution(evolution, props) {
|
|
30
|
+
const changes = [];
|
|
31
|
+
const deprecated = [];
|
|
32
|
+
let out = null;
|
|
33
|
+
const write = () => (out ??= { ...props });
|
|
34
|
+
const isExpression = (value) => expressionOps.collect(value, "").length > 0;
|
|
35
|
+
const convert = (key, value, at) => {
|
|
36
|
+
const hook = evolution.migrate[key];
|
|
37
|
+
if (!hook || value === undefined)
|
|
38
|
+
return value;
|
|
39
|
+
if (isExpression(value)) {
|
|
40
|
+
changes.push({ prop: at, message: `"${at}" is an expression, so its value was left as written.` });
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
return hook(value);
|
|
44
|
+
};
|
|
45
|
+
for (const [from, to] of Object.entries(evolution.renamed)) {
|
|
46
|
+
if (!Object.hasOwn(props, from))
|
|
47
|
+
continue;
|
|
48
|
+
const target = write();
|
|
49
|
+
const value = convert(from, props[from], from);
|
|
50
|
+
delete target[from];
|
|
51
|
+
if (props[to] !== undefined) {
|
|
52
|
+
changes.push({ prop: from, message: `"${from}" was renamed "${to}", which the row also sets; the old value was dropped.` });
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (value === undefined)
|
|
56
|
+
delete target[to];
|
|
57
|
+
else
|
|
58
|
+
target[to] = value;
|
|
59
|
+
changes.push({ prop: from, message: `"${from}" was renamed "${to}".` });
|
|
60
|
+
}
|
|
61
|
+
for (const key of Object.keys(evolution.migrate)) {
|
|
62
|
+
if (Object.hasOwn(evolution.renamed, key))
|
|
63
|
+
continue;
|
|
64
|
+
const current = (out ?? props)[key];
|
|
65
|
+
if (current === undefined)
|
|
66
|
+
continue;
|
|
67
|
+
const next = convert(key, current, key);
|
|
68
|
+
if (next === current)
|
|
69
|
+
continue;
|
|
70
|
+
const target = write();
|
|
71
|
+
if (next === undefined)
|
|
72
|
+
delete target[key];
|
|
73
|
+
else
|
|
74
|
+
target[key] = next;
|
|
75
|
+
changes.push({ prop: key, message: next === undefined ? `"${key}" was dropped back to its default.` : `"${key}" was migrated.` });
|
|
76
|
+
}
|
|
77
|
+
for (const [key, message] of Object.entries(evolution.deprecated)) {
|
|
78
|
+
if ((out ?? props)[key] !== undefined)
|
|
79
|
+
deprecated.push({ prop: key, message });
|
|
80
|
+
}
|
|
81
|
+
return { props: out ?? props, changes, deprecated };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=prop-evolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-evolution.js","sourceRoot":"","sources":["../../src/document/prop-evolution.ts"],"names":[],"mappings":"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","sourcesContent":["import { expressionOps } from \"./expression/ops\";\nimport type { Registry } from \"./registry\";\n\n/**\n * How a node type's props changed since documents first named it — declared by\n * a component spec's `renamed`, `deprecated` and `migrate`, applied to a row's\n * props whenever one is built, and callable by a host rewriting stored rows.\n *\n * Unlike a document migration this has no version to go by: a row stored a year\n * ago and one stored today pass through the same rules, so every rule has to\n * leave a current value alone.\n */\nexport interface PropEvolution {\n /** Old key → the entry it became. A row setting both keeps the new one. */\n readonly renamed: Readonly<Record<string, string>>;\n /** Entry → why it is deprecated and what to use instead. It still works. */\n readonly deprecated: Readonly<Record<string, string>>;\n /**\n * Key → a value hook. Keyed by an old key from {@link renamed}, it converts\n * only what was stored under that key (a unit change rides on a rename);\n * keyed by an entry, it runs on every stored value and must hand a current\n * one back unchanged. `undefined` drops the prop back to its default.\n */\n readonly migrate: Readonly<Record<string, (value: unknown) => unknown>>;\n}\n\n/** One prop a migration touched, or one a row still sets that is deprecated. */\nexport interface PropNote {\n prop: string;\n message: string;\n}\n\nexport interface PropMigration {\n /** The props given, when nothing changed; a new object otherwise. */\n props: Record<string, unknown>;\n changes: PropNote[];\n deprecated: PropNote[];\n}\n\nconst PROP_EVOLUTION = Symbol(\"propEvolution\");\n\n/** @internal Record `evolution` on a node class; a component factory does this for its generated class. */\nexport function declarePropEvolution(ctor: abstract new (...args: never[]) => object, evolution: PropEvolution): void {\n (ctor.prototype as Record<symbol, unknown>)[PROP_EVOLUTION] = evolution;\n}\n\n/** @internal What {@link declarePropEvolution} recorded on this exact class. */\nexport function propEvolutionOf(ctor: abstract new (...args: never[]) => object): PropEvolution | undefined {\n const proto = ctor.prototype as Record<symbol, unknown> | undefined;\n if (!proto || !Object.prototype.hasOwnProperty.call(proto, PROP_EVOLUTION)) return undefined;\n return proto[PROP_EVOLUTION] as PropEvolution;\n}\n\n/**\n * Bring a stored row's props up to what `type` declares today: old keys\n * renamed, values migrated, deprecated props reported. A type this registry\n * does not know, or one that never changed, hands `props` back as it is.\n *\n * Applies equally to a `to`/`set` command's args, which are a props diff.\n * An expression is moved by a rename but handed to no value hook: a formula's\n * result cannot be converted by rewriting it, so it is noted and left as written.\n */\nexport function migrateNodeProps(registry: Registry, type: string, props: Record<string, unknown>): PropMigration {\n const ctor = registry.node(type)?.ctor;\n const evolution = ctor ? propEvolutionOf(ctor) : undefined;\n return evolution ? applyPropEvolution(evolution, props) : { props, changes: [], deprecated: [] };\n}\n\n/** @internal {@link migrateNodeProps} once the type's rules are in hand. */\nexport function applyPropEvolution(evolution: PropEvolution, props: Record<string, unknown>): PropMigration {\n const changes: PropNote[] = [];\n const deprecated: PropNote[] = [];\n let out: Record<string, unknown> | null = null;\n const write = () => (out ??= { ...props });\n const isExpression = (value: unknown) => expressionOps.collect(value, \"\").length > 0;\n\n const convert = (key: string, value: unknown, at: string): unknown => {\n const hook = evolution.migrate[key];\n if (!hook || value === undefined) return value;\n if (isExpression(value)) {\n changes.push({ prop: at, message: `\"${at}\" is an expression, so its value was left as written.` });\n return value;\n }\n return hook(value);\n };\n\n for (const [from, to] of Object.entries(evolution.renamed)) {\n if (!Object.hasOwn(props, from)) continue;\n const target = write();\n const value = convert(from, props[from], from);\n delete target[from];\n if (props[to] !== undefined) {\n changes.push({ prop: from, message: `\"${from}\" was renamed \"${to}\", which the row also sets; the old value was dropped.` });\n continue;\n }\n if (value === undefined) delete target[to];\n else target[to] = value;\n changes.push({ prop: from, message: `\"${from}\" was renamed \"${to}\".` });\n }\n\n for (const key of Object.keys(evolution.migrate)) {\n if (Object.hasOwn(evolution.renamed, key)) continue;\n const current = (out ?? props)[key];\n if (current === undefined) continue;\n const next = convert(key, current, key);\n if (next === current) continue;\n const target = write();\n if (next === undefined) delete target[key];\n else target[key] = next;\n changes.push({ prop: key, message: next === undefined ? `\"${key}\" was dropped back to its default.` : `\"${key}\" was migrated.` });\n }\n\n for (const [key, message] of Object.entries(evolution.deprecated)) {\n if ((out ?? props)[key] !== undefined) deprecated.push({ prop: key, message });\n }\n return { props: out ?? props, changes, deprecated };\n}\n"]}
|