@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.8
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 +34 -0
- package/NOTICE +15 -14
- package/README.md +5 -7
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +7 -5
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- 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/effects/implementations/echo.js +11 -0
- 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/effects/implementations/gain.js +6 -0
- 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/effects/implementations/highpass.js +10 -0
- 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/effects/implementations/lowpass.js +10 -0
- 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/effects/implementations/tremolo.js +10 -0
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +24 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +4 -3
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +24 -31
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +42 -28
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +15 -12
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -10
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +7 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +6 -9
- package/dist/attributes/index.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 +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- 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 +24 -145
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +16 -112
- package/dist/attributes/properties/typed.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/chain.d.ts +96 -409
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +93 -283
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +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 +76 -19
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +42 -26
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +4 -2
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +11 -0
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +113 -102
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/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.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- 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/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 +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -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 +3 -7
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +2 -6
- 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/registry.d.ts +1 -1
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -6
- 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/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/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.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-AOT33LMS.js +13 -0
- package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
- package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
- package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +4 -4
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- 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/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- 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/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- 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/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- 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 +413 -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/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- 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/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- 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/components/trees/audio/node-audio.d.ts +116 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +171 -0
- 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 +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -4
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +35 -7
- 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/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 +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +9 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +5 -2
- 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 +7 -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 +2 -1
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +2 -0
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +39 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +41 -21
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +2 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +5 -5
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +48 -4
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +174 -44
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +18 -32
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +18 -6
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +158 -21
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +79 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +31 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -0
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- 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 +1 -1
- package/dist/renamed-scene-names.d.ts.map +1 -1
- package/dist/renamed-scene-names.js +1 -1
- package/dist/renamed-scene-names.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +9 -0
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.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/text.d.ts +13 -7
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +9 -3
- package/dist/render/descriptors/text.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 +3 -3
- 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/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +67 -24
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.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 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +6 -4
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +8 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +34 -37
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +8 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +4 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +15 -5
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +7 -3
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +11 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- 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 +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +50 -44
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +35 -29
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +14 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +3 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +2 -0
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +4 -0
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/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/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +3 -11
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.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
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { NullRenderContext } from "../../render/null-render-context.js";
|
|
2
|
+
import { Graphics2D as GraphicsClass } from "../../render/graphics2d.js";
|
|
3
|
+
import { frameIn, Node2D as Node2DClass } from "../../components/trees/2d/node2d.js";
|
|
4
|
+
import { Node3D } from "../../components/trees/three/node3d.js";
|
|
5
|
+
import { Scene3D } from "../../render3d/scene3d.js";
|
|
6
|
+
import { clipOf } from "../../components/factory/clip-of.js";
|
|
7
|
+
/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */
|
|
8
|
+
export const NODE = Symbol("componentNode");
|
|
9
|
+
let pass = null;
|
|
10
|
+
export function withPass(node, scope, room, run) {
|
|
11
|
+
const outer = pass;
|
|
12
|
+
pass = { node, scope, room, sizes: new Map() };
|
|
13
|
+
try {
|
|
14
|
+
return run();
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
pass = outer;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const decided = new WeakSet();
|
|
21
|
+
/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */
|
|
22
|
+
export function markDecided(node) {
|
|
23
|
+
decided.add(node);
|
|
24
|
+
}
|
|
25
|
+
export function takeDecided(node) {
|
|
26
|
+
return decided.delete(node);
|
|
27
|
+
}
|
|
28
|
+
export function currentPass() {
|
|
29
|
+
if (!pass)
|
|
30
|
+
throw new Error("A component's measure or layout helper ran outside a measure or layout pass.");
|
|
31
|
+
return pass;
|
|
32
|
+
}
|
|
33
|
+
function measureChild(node, max) {
|
|
34
|
+
const p = currentPass();
|
|
35
|
+
const constraints = { maxWidth: max.width, maxHeight: max.height };
|
|
36
|
+
const measured = node.measure(constraints, p.scope);
|
|
37
|
+
const size = { width: measured.width ?? 0, height: measured.height ?? 0 };
|
|
38
|
+
p.sizes.set(node, size);
|
|
39
|
+
return size;
|
|
40
|
+
}
|
|
41
|
+
// ---- child views ------------------------------------------------------------
|
|
42
|
+
const childViews = new WeakMap();
|
|
43
|
+
/** A child as its parent's fields see it. One per child node, reused every frame. */
|
|
44
|
+
class ChildViewImpl {
|
|
45
|
+
[NODE];
|
|
46
|
+
state;
|
|
47
|
+
constructor(node) {
|
|
48
|
+
this[NODE] = node;
|
|
49
|
+
// The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.
|
|
50
|
+
this.state = new Proxy(node, {
|
|
51
|
+
set: () => { throw new TypeError("A child's state is read-only to its parent; animate it with a command."); },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
get id() { return this[NODE].id; }
|
|
55
|
+
get key() { return (keyOf(this[NODE]) ?? this[NODE].className); }
|
|
56
|
+
get size() {
|
|
57
|
+
// Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.
|
|
58
|
+
if (!pass) {
|
|
59
|
+
const box = this[NODE].layoutBounds;
|
|
60
|
+
return { width: box?.width ?? 0, height: box?.height ?? 0 };
|
|
61
|
+
}
|
|
62
|
+
return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);
|
|
63
|
+
}
|
|
64
|
+
get children() {
|
|
65
|
+
const node = this[NODE];
|
|
66
|
+
return node._commandChildren ? node._commandChildren() : node.children.map(childView);
|
|
67
|
+
}
|
|
68
|
+
measure(max) {
|
|
69
|
+
return measureChild(this[NODE], max);
|
|
70
|
+
}
|
|
71
|
+
to(targets) {
|
|
72
|
+
return { _piece: { kind: "child", node: this[NODE], targets: targets } };
|
|
73
|
+
}
|
|
74
|
+
run(name, args) {
|
|
75
|
+
return { _piece: { kind: "run", node: this[NODE], name, args } };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export function childView(node) {
|
|
79
|
+
let view = childViews.get(node);
|
|
80
|
+
if (!view)
|
|
81
|
+
childViews.set(node, view = new ChildViewImpl(node));
|
|
82
|
+
return view;
|
|
83
|
+
}
|
|
84
|
+
export function nodeOfView(view) {
|
|
85
|
+
return view[NODE];
|
|
86
|
+
}
|
|
87
|
+
const nodeViews = new WeakMap();
|
|
88
|
+
const NO_FRAME = { x: 0, y: 0, rotation: 0, scale: 1 };
|
|
89
|
+
/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */
|
|
90
|
+
class NodeViewImpl {
|
|
91
|
+
reader;
|
|
92
|
+
[NODE];
|
|
93
|
+
state;
|
|
94
|
+
constructor(node, reader) {
|
|
95
|
+
this.reader = reader;
|
|
96
|
+
this[NODE] = node;
|
|
97
|
+
// A component's state as its own fields read it: a reference of its own is a view from where it stands.
|
|
98
|
+
// Anything else it has (a 2D node's cardinal points) reads off the node.
|
|
99
|
+
const fields = node._view ?? node;
|
|
100
|
+
this.state = new Proxy(fields, {
|
|
101
|
+
get: (target, key) => {
|
|
102
|
+
// Its constructor is the node's: what a host asks to tell what kind of node it reads.
|
|
103
|
+
if (key === "constructor")
|
|
104
|
+
return node.constructor;
|
|
105
|
+
if (key in target)
|
|
106
|
+
return Reflect.get(target, key);
|
|
107
|
+
const value = Reflect.get(node, key);
|
|
108
|
+
// A method of the node runs on the node, not on this read-only view.
|
|
109
|
+
return typeof value === "function" ? value.bind(node) : value;
|
|
110
|
+
},
|
|
111
|
+
set: () => { throw new TypeError("Another node's state is read-only to a component; animate it with a command."); },
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
get id() { return this[NODE].id; }
|
|
115
|
+
get key() { return (keyOf(this[NODE]) ?? this[NODE].className); }
|
|
116
|
+
get size() {
|
|
117
|
+
const node = this[NODE];
|
|
118
|
+
const box = node instanceof Node2DClass ? node.layoutBounds : undefined;
|
|
119
|
+
return { width: box?.width ?? 0, height: box?.height ?? 0 };
|
|
120
|
+
}
|
|
121
|
+
get frame() {
|
|
122
|
+
const node = this[NODE];
|
|
123
|
+
return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** `node` as `reader` sees it. One view per pair. */
|
|
127
|
+
export function nodeView(node, reader) {
|
|
128
|
+
let byReader = nodeViews.get(node);
|
|
129
|
+
if (!byReader)
|
|
130
|
+
nodeViews.set(node, byReader = new WeakMap());
|
|
131
|
+
let view = byReader.get(reader);
|
|
132
|
+
if (!view)
|
|
133
|
+
byReader.set(reader, view = new NodeViewImpl(node, reader));
|
|
134
|
+
return view;
|
|
135
|
+
}
|
|
136
|
+
export function nodeOfNodeView(view) {
|
|
137
|
+
return view[NODE];
|
|
138
|
+
}
|
|
139
|
+
const found = new WeakMap();
|
|
140
|
+
/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */
|
|
141
|
+
export function referenced(reader, id) {
|
|
142
|
+
if (typeof id !== "string" || id === "")
|
|
143
|
+
return null;
|
|
144
|
+
let known = found.get(reader);
|
|
145
|
+
let node = known?.get(id);
|
|
146
|
+
if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {
|
|
147
|
+
node = findIn(rootOf(reader), id) ?? undefined;
|
|
148
|
+
if (!node) {
|
|
149
|
+
known?.delete(id);
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
if (!known)
|
|
153
|
+
found.set(reader, known = new Map());
|
|
154
|
+
known.set(id, node);
|
|
155
|
+
}
|
|
156
|
+
return nodeView(node, reader);
|
|
157
|
+
}
|
|
158
|
+
function rootOf(node) {
|
|
159
|
+
let at = node;
|
|
160
|
+
while (at.parent)
|
|
161
|
+
at = at.parent;
|
|
162
|
+
return at;
|
|
163
|
+
}
|
|
164
|
+
function findIn(at, id) {
|
|
165
|
+
if (at.id === id)
|
|
166
|
+
return at;
|
|
167
|
+
for (const child of at._allChildren) {
|
|
168
|
+
const hit = findIn(child, id);
|
|
169
|
+
if (hit)
|
|
170
|
+
return hit;
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
let keyOf = () => undefined;
|
|
175
|
+
/** Set by the factory module, which owns the node descriptors. */
|
|
176
|
+
export function setKeyLookup(lookup) {
|
|
177
|
+
keyOf = lookup;
|
|
178
|
+
}
|
|
179
|
+
export function stateViewPrototype(keys, references = new Set()) {
|
|
180
|
+
const entries = {};
|
|
181
|
+
for (const key of keys) {
|
|
182
|
+
entries[key] = references.has(key)
|
|
183
|
+
? { get() { return referenced(this[NODE], this[NODE][key]); }, enumerable: true }
|
|
184
|
+
: { get() { return this[NODE][key]; }, enumerable: true };
|
|
185
|
+
}
|
|
186
|
+
const proto = {};
|
|
187
|
+
// The children of the node's own tree, as its commands see them too.
|
|
188
|
+
Object.defineProperty(proto, "children", {
|
|
189
|
+
get() { return this[NODE]._commandChildren(); },
|
|
190
|
+
enumerable: false,
|
|
191
|
+
});
|
|
192
|
+
return { proto, entries };
|
|
193
|
+
}
|
|
194
|
+
export function stateView(shape, node) {
|
|
195
|
+
const view = Object.create(shape.proto);
|
|
196
|
+
Object.defineProperties(view, shape.entries);
|
|
197
|
+
view[NODE] = node;
|
|
198
|
+
return view;
|
|
199
|
+
}
|
|
200
|
+
/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */
|
|
201
|
+
export function snapshot(view) {
|
|
202
|
+
const out = {};
|
|
203
|
+
for (const key in view)
|
|
204
|
+
out[key] = view[key];
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
// ---- measurer and render context --------------------------------------------
|
|
208
|
+
export class MeasurerImpl {
|
|
209
|
+
host;
|
|
210
|
+
max = {};
|
|
211
|
+
scope = null;
|
|
212
|
+
constructor(host) {
|
|
213
|
+
this.host = host;
|
|
214
|
+
}
|
|
215
|
+
get time() {
|
|
216
|
+
return this.host.time;
|
|
217
|
+
}
|
|
218
|
+
text(text, font) {
|
|
219
|
+
if (!this.scope)
|
|
220
|
+
throw new Error("measurer.text was called outside measure.");
|
|
221
|
+
return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/** Reused every frame: `pass` and `cut` are rewritten before each render. */
|
|
225
|
+
export class RenderContextImpl {
|
|
226
|
+
host;
|
|
227
|
+
probing;
|
|
228
|
+
pass = null;
|
|
229
|
+
/** The near-plane cut a 2.5D space puts in front of this node's own paint. */
|
|
230
|
+
cut = null;
|
|
231
|
+
/**
|
|
232
|
+
* `probing`: `render` runs only to find the shape it paints (for clip and
|
|
233
|
+
* picking outside a frame), so nothing is drawn and no child is visited.
|
|
234
|
+
*/
|
|
235
|
+
constructor(host, probing = false) {
|
|
236
|
+
this.host = host;
|
|
237
|
+
this.probing = probing;
|
|
238
|
+
}
|
|
239
|
+
get size() {
|
|
240
|
+
const box = this.host.layoutBounds;
|
|
241
|
+
return { width: box?.width ?? 0, height: box?.height ?? 0 };
|
|
242
|
+
}
|
|
243
|
+
get time() {
|
|
244
|
+
return this.host.time;
|
|
245
|
+
}
|
|
246
|
+
draw(graphics) {
|
|
247
|
+
if (!graphics || this.probing)
|
|
248
|
+
return;
|
|
249
|
+
const out = this.target();
|
|
250
|
+
if (Array.isArray(graphics))
|
|
251
|
+
for (const g of graphics)
|
|
252
|
+
out.draw(g);
|
|
253
|
+
else
|
|
254
|
+
out.draw(graphics);
|
|
255
|
+
}
|
|
256
|
+
children() {
|
|
257
|
+
if (this.probing)
|
|
258
|
+
return;
|
|
259
|
+
// Drawn plainly, so a space or composite the last frame declared no longer holds for them.
|
|
260
|
+
if (!this.composite)
|
|
261
|
+
this.host._record = null;
|
|
262
|
+
this.host._renderOwnChildren(this.target());
|
|
263
|
+
}
|
|
264
|
+
/** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */
|
|
265
|
+
composite = null;
|
|
266
|
+
_declare(composite) {
|
|
267
|
+
this.composite = { ...this.composite, ...composite };
|
|
268
|
+
if (!this.probing)
|
|
269
|
+
this.host._record = this.composite;
|
|
270
|
+
}
|
|
271
|
+
mask(options) {
|
|
272
|
+
this._declare({ bounds: "first" });
|
|
273
|
+
if (this.probing)
|
|
274
|
+
return;
|
|
275
|
+
const out = this.target();
|
|
276
|
+
const [stencil, ...content] = this.host.children;
|
|
277
|
+
if (!stencil)
|
|
278
|
+
return;
|
|
279
|
+
if (content.length === 0) {
|
|
280
|
+
stencil.render(out);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
out.beginMask({ mode: options.mode, inverted: options.inverted });
|
|
284
|
+
stencil.render(out);
|
|
285
|
+
out.applyMask();
|
|
286
|
+
for (const child of content)
|
|
287
|
+
child.render(out);
|
|
288
|
+
out.endMask();
|
|
289
|
+
}
|
|
290
|
+
merge(op, paint) {
|
|
291
|
+
this._declare({ bounds: op === "subtract" ? "first" : op === "intersect" ? "intersect" : "union" });
|
|
292
|
+
if (this.probing)
|
|
293
|
+
return;
|
|
294
|
+
const out = this.target();
|
|
295
|
+
out.beginBoolean(op);
|
|
296
|
+
for (const child of this.host._allChildren)
|
|
297
|
+
if (child instanceof Node2DClass)
|
|
298
|
+
child.render(out);
|
|
299
|
+
out.endBoolean();
|
|
300
|
+
// A drawing with no shape of its own paints the merged outline.
|
|
301
|
+
out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));
|
|
302
|
+
if (paint.overlay && paint.overlay.length > 0)
|
|
303
|
+
out.draw(new GraphicsClass().fill(paint.overlay));
|
|
304
|
+
out.draw(new GraphicsClass().stroke(paint.stroke));
|
|
305
|
+
}
|
|
306
|
+
/** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */
|
|
307
|
+
camera(scope) {
|
|
308
|
+
this._declare({ camera: scope });
|
|
309
|
+
if (this.probing)
|
|
310
|
+
return;
|
|
311
|
+
const out = this.target();
|
|
312
|
+
const rect = this.host.layoutBounds;
|
|
313
|
+
out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);
|
|
314
|
+
for (const child of this.host._allChildren)
|
|
315
|
+
if (child instanceof Node2DClass)
|
|
316
|
+
child.render(out);
|
|
317
|
+
out.endCamera();
|
|
318
|
+
}
|
|
319
|
+
/** Your 3D children, rendered in order into a new scene. */
|
|
320
|
+
scene3D() {
|
|
321
|
+
const scene = new Scene3D();
|
|
322
|
+
for (const child of this.host._allChildren)
|
|
323
|
+
if (child instanceof Node3D)
|
|
324
|
+
child.render(scene);
|
|
325
|
+
this._declare({ scene });
|
|
326
|
+
return scene;
|
|
327
|
+
}
|
|
328
|
+
/** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */
|
|
329
|
+
space(camera) {
|
|
330
|
+
this._declare({ space: camera });
|
|
331
|
+
if (!this.probing)
|
|
332
|
+
this.host._renderOwnChildren(this.target());
|
|
333
|
+
}
|
|
334
|
+
textStyle(style, body) {
|
|
335
|
+
if (this.probing)
|
|
336
|
+
return body();
|
|
337
|
+
const out = this.target();
|
|
338
|
+
out.pushTextStyle(style);
|
|
339
|
+
try {
|
|
340
|
+
body();
|
|
341
|
+
}
|
|
342
|
+
finally {
|
|
343
|
+
out.popTextStyle();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
clip(shape, body) {
|
|
347
|
+
if (this.probing)
|
|
348
|
+
return body();
|
|
349
|
+
const outline = clipOf(shape);
|
|
350
|
+
// No outline is no clip, as a node with no `clipSelf` confines nothing.
|
|
351
|
+
if (outline.isEmpty())
|
|
352
|
+
return body();
|
|
353
|
+
const out = this.target();
|
|
354
|
+
out.beginClip(outline);
|
|
355
|
+
try {
|
|
356
|
+
body();
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
out.endClip();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
/** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */
|
|
363
|
+
get inSpace() {
|
|
364
|
+
for (let at = this.host.parent; at; at = at.parent) {
|
|
365
|
+
if (!(at instanceof Node2DClass))
|
|
366
|
+
return false;
|
|
367
|
+
if (at._spaceCamera())
|
|
368
|
+
return true;
|
|
369
|
+
if (!at._rendersChildrenInSpace())
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
ancestor(component) {
|
|
375
|
+
for (let at = this.host.parent; at; at = at.parent) {
|
|
376
|
+
if (at instanceof component.node)
|
|
377
|
+
return nodeView(at, this.host);
|
|
378
|
+
}
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
/** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */
|
|
382
|
+
inFront(body) {
|
|
383
|
+
if (this.probing)
|
|
384
|
+
return;
|
|
385
|
+
const out = this.target();
|
|
386
|
+
if (!this.cut) {
|
|
387
|
+
body();
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
out.beginClip(this.cut);
|
|
391
|
+
try {
|
|
392
|
+
body();
|
|
393
|
+
}
|
|
394
|
+
finally {
|
|
395
|
+
out.endClip();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
target() {
|
|
399
|
+
if (this.probing)
|
|
400
|
+
return PROBE_PASS;
|
|
401
|
+
if (!this.pass)
|
|
402
|
+
throw new Error("A component's render context was used outside render.");
|
|
403
|
+
return this.pass;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */
|
|
407
|
+
const PROBE_PASS = new NullRenderContext();
|
|
408
|
+
export function internalsOf(ctx) {
|
|
409
|
+
if (!(ctx instanceof RenderContextImpl))
|
|
410
|
+
throw new TypeError("Paint.draw takes the render context its render field was given.");
|
|
411
|
+
return ctx;
|
|
412
|
+
}
|
|
413
|
+
//# sourceMappingURL=views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../../src/components/factory/views.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAetD,gHAAgH;AAChH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAwB5C,IAAI,IAAI,GAAgB,IAAI,CAAC;AAE7B,MAAM,UAAU,QAAQ,CAAI,IAAY,EAAE,KAAuB,EAAE,IAAS,EAAE,GAAY;I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AU,GAAiB,IAAI,iBAAiB,EAAE,CAAC;AAEzD,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC5C,IAAI,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IAChI,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { SizeConstraints } from \"@/layout/constraints\";\r\nimport type { Node2D, CameraScope } from \"@/components/trees/2d/node2d\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport type { Clip } from \"@/render/clip\";\r\nimport { NullRenderContext } from \"@/render/null-render-context\";\r\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\r\nimport { frameIn, Node2D as Node2DClass } from \"@/components/trees/2d/node2d\";\r\nimport { Node3D } from \"@/components/trees/three/node3d\";\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\r\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\r\nimport type { ChildBoundsMode } from \"@/components/trees/2d/group-bounds\";\r\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\r\nimport type { TextStyle } from \"@/attributes/text/types\";\r\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/components/factory/api\";\r\nimport { clipOf } from \"@/components/factory/clip-of\";\r\n\r\n/**\r\n * What a render did with its children beyond drawing them: composited them\r\n * (the ink bounds that leaves), looked at them through a camera, or stood them\r\n * in a 2.5D space. Picking and the space machinery read it between frames.\r\n */\r\nexport interface Composite {\r\n readonly bounds?: ChildBoundsMode;\r\n readonly camera?: CameraScope;\r\n readonly space?: SpaceCamera;\r\n /** The scene its 3D children were rendered into: what picking projects through. */\r\n readonly scene?: Scene3D;\r\n}\r\n\r\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\r\nexport const NODE = Symbol(\"componentNode\");\r\n\r\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\r\nexport interface ComponentHost extends Node2D {\r\n _renderOwnChildren(pass: RenderPass2D): void;\r\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\r\n _lastShape: Graphics2D | null;\r\n /** The composite its last render or probe declared; `undefined` before either. */\r\n _record: Composite | null | undefined;\r\n}\r\n\r\n// ---- the pass in progress -------------------------------------------------\r\n\r\n/**\r\n * Measure and layout run synchronously, one node at a time, so the node being\r\n * laid out and its measurer are a single slot rather than state on every view.\r\n */\r\ninterface Pass {\r\n readonly node: Node2D;\r\n readonly scope: MeasureContext2D;\r\n readonly room: Max;\r\n readonly sizes: Map<Node2D, Size2D>;\r\n}\r\n\r\nlet pass: Pass | null = null;\r\n\r\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\r\n const outer = pass;\r\n pass = { node, scope, room, sizes: new Map() };\r\n try {\r\n return run();\r\n } finally {\r\n pass = outer;\r\n }\r\n}\r\n\r\nconst decided = new WeakSet<Node2D>();\r\n\r\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\r\nexport function markDecided(node: Node2D): void {\r\n decided.add(node);\r\n}\r\n\r\nexport function takeDecided(node: Node2D): boolean {\r\n return decided.delete(node);\r\n}\r\n\r\nexport function currentPass(): Pass {\r\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\r\n return pass;\r\n}\r\n\r\nfunction measureChild(node: Node2D, max: Max): Size2D {\r\n const p = currentPass();\r\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\r\n const measured = node.measure(constraints, p.scope);\r\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\r\n p.sizes.set(node, size);\r\n return size;\r\n}\r\n\r\n// ---- child views ------------------------------------------------------------\r\n\r\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\r\n\r\n/** A child as its parent's fields see it. One per child node, reused every frame. */\r\nclass ChildViewImpl implements ChildView {\r\n readonly [NODE]: Node2D;\r\n readonly state: never;\r\n\r\n constructor(node: Node2D) {\r\n this[NODE] = node;\r\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\r\n this.state = new Proxy(node, {\r\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\r\n if (!pass) {\r\n const box = this[NODE].layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\r\n }\r\n\r\n get children(): readonly ChildView[] {\r\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\r\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\r\n }\r\n\r\n measure(max: Max): Size2D {\r\n return measureChild(this[NODE], max);\r\n }\r\n\r\n to(targets: object): Piece {\r\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\r\n }\r\n\r\n run(name: string, args?: object): Piece {\r\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\r\n }\r\n}\r\n\r\nexport function childView(node: Node2D | Node): ChildView {\r\n let view = childViews.get(node as Node2D);\r\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\r\n return view as unknown as ChildView;\r\n}\r\n\r\nexport function nodeOfView(view: ChildView<any>): Node2D {\r\n return (view as unknown as ChildViewImpl)[NODE];\r\n}\r\n\r\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\r\n\r\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\r\n\r\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\r\nclass NodeViewImpl implements NodeView {\r\n readonly [NODE]: Node;\r\n readonly state: never;\r\n\r\n constructor(node: Node, readonly reader: Node) {\r\n this[NODE] = node;\r\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\r\n // Anything else it has (a 2D node's cardinal points) reads off the node.\r\n const fields = (node as { _view?: object })._view ?? node;\r\n this.state = new Proxy(fields, {\r\n get: (target, key) => {\r\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\r\n if (key === \"constructor\") return node.constructor;\r\n if (key in target) return Reflect.get(target, key);\r\n const value = Reflect.get(node, key) as unknown;\r\n // A method of the node runs on the node, not on this read-only view.\r\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\r\n },\r\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n const node = this[NODE];\r\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get frame(): NodeFrame {\r\n const node = this[NODE];\r\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\r\n }\r\n}\r\n\r\n/** `node` as `reader` sees it. One view per pair. */\r\nexport function nodeView(node: Node, reader: Node): NodeView {\r\n let byReader = nodeViews.get(node);\r\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\r\n let view = byReader.get(reader);\r\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\r\n return view;\r\n}\r\n\r\nexport function nodeOfNodeView(view: NodeView): Node {\r\n return (view as unknown as NodeViewImpl)[NODE];\r\n}\r\n\r\nconst found = new WeakMap<Node, Map<string, Node>>();\r\n\r\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\r\nexport function referenced(reader: Node, id: unknown): NodeView | null {\r\n if (typeof id !== \"string\" || id === \"\") return null;\r\n let known = found.get(reader);\r\n let node = known?.get(id);\r\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\r\n node = findIn(rootOf(reader), id) ?? undefined;\r\n if (!node) {\r\n known?.delete(id);\r\n return null;\r\n }\r\n if (!known) found.set(reader, known = new Map());\r\n known.set(id, node);\r\n }\r\n return nodeView(node, reader);\r\n}\r\n\r\nfunction rootOf(node: Node): Node {\r\n let at = node;\r\n while (at.parent) at = at.parent;\r\n return at;\r\n}\r\n\r\nfunction findIn(at: Node, id: string): Node | null {\r\n if (at.id === id) return at;\r\n for (const child of at._allChildren) {\r\n const hit = findIn(child, id);\r\n if (hit) return hit;\r\n }\r\n return null;\r\n}\r\n\r\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\r\n/** Set by the factory module, which owns the node descriptors. */\r\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\r\n keyOf = lookup;\r\n}\r\n\r\n// ---- state views ------------------------------------------------------------\r\n\r\n/**\r\n * One prototype of getters per component, so a node's `state` is a single\r\n * object made once: every read goes straight to the node's own slot, and a\r\n * frame allocates nothing to hand its fields their values.\r\n */\r\nexport interface ViewShape {\r\n readonly proto: object;\r\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\r\n readonly entries: PropertyDescriptorMap;\r\n}\r\n\r\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\r\n const entries: PropertyDescriptorMap = {};\r\n for (const key of keys) {\r\n entries[key] = references.has(key)\r\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\r\n : { get(this: { [NODE]: object }) { return (this[NODE] as Record<string, unknown>)[key]; }, enumerable: true };\r\n }\r\n const proto = {};\r\n // The children of the node's own tree, as its commands see them too.\r\n Object.defineProperty(proto, \"children\", {\r\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\r\n enumerable: false,\r\n });\r\n return { proto, entries };\r\n}\r\n\r\nexport function stateView(shape: ViewShape, node: object): object {\r\n const view = Object.create(shape.proto) as { [NODE]: object };\r\n Object.defineProperties(view, shape.entries);\r\n view[NODE] = node;\r\n return view;\r\n}\r\n\r\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\r\nexport function snapshot(view: object): Record<string, unknown> {\r\n const out: Record<string, unknown> = {};\r\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\r\n return out;\r\n}\r\n\r\n// ---- measurer and render context --------------------------------------------\r\n\r\nexport class MeasurerImpl implements Measurer {\r\n max: Max = {};\r\n scope: MeasureContext2D | null = null;\r\n\r\n constructor(readonly host: Node) { }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n text(text: string, font: FontSpec): Size2D {\r\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\r\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\r\n }\r\n}\r\n\r\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\r\nexport class RenderContextImpl implements RenderContext2D {\r\n pass: RenderPass2D | null = null;\r\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\r\n cut: Clip | null = null;\r\n\r\n /**\r\n * `probing`: `render` runs only to find the shape it paints (for clip and\r\n * picking outside a frame), so nothing is drawn and no child is visited.\r\n */\r\n constructor(readonly host: ComponentHost, readonly probing = false) { }\r\n\r\n get size(): Size2D {\r\n const box = this.host.layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\r\n if (!graphics || this.probing) return;\r\n const out = this.target();\r\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\r\n else out.draw(graphics as Graphics2D);\r\n }\r\n\r\n children(): void {\r\n if (this.probing) return;\r\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\r\n if (!this.composite) this.host._record = null;\r\n this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\r\n composite: Composite | null = null;\r\n\r\n private _declare(composite: Composite): void {\r\n this.composite = { ...this.composite, ...composite };\r\n if (!this.probing) this.host._record = this.composite;\r\n }\r\n\r\n mask(options: MaskOptions): void {\r\n this._declare({ bounds: \"first\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const [stencil, ...content] = this.host.children;\r\n if (!stencil) return;\r\n if (content.length === 0) {\r\n stencil.render(out);\r\n return;\r\n }\r\n out.beginMask({ mode: options.mode, inverted: options.inverted });\r\n stencil.render(out);\r\n out.applyMask();\r\n for (const child of content) child.render(out);\r\n out.endMask();\r\n }\r\n\r\n merge(op: BooleanOperation, paint: MergePaint): void {\r\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n out.beginBoolean(op);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endBoolean();\r\n // A drawing with no shape of its own paints the merged outline.\r\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\r\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\r\n out.draw(new GraphicsClass().stroke(paint.stroke));\r\n }\r\n\r\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\r\n camera(scope: CameraScope): void {\r\n this._declare({ camera: scope });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const rect = this.host.layoutBounds;\r\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endCamera();\r\n }\r\n\r\n /** Your 3D children, rendered in order into a new scene. */\r\n scene3D(): Scene3D {\r\n const scene = new Scene3D();\r\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\r\n this._declare({ scene });\r\n return scene;\r\n }\r\n\r\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\r\n space(camera: SpaceCamera): void {\r\n this._declare({ space: camera });\r\n if (!this.probing) this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n textStyle(style: TextStyle | null, body: () => void): void {\r\n if (this.probing) return body();\r\n const out = this.target();\r\n out.pushTextStyle(style);\r\n try {\r\n body();\r\n } finally {\r\n out.popTextStyle();\r\n }\r\n }\r\n\r\n clip(shape: Graphics2D, body: () => void): void {\r\n if (this.probing) return body();\r\n const outline = clipOf(shape);\r\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\r\n if (outline.isEmpty()) return body();\r\n const out = this.target();\r\n out.beginClip(outline);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\r\n get inSpace(): boolean {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (!(at instanceof Node2DClass)) return false;\r\n if (at._spaceCamera()) return true;\r\n if (!at._rendersChildrenInSpace()) return false;\r\n }\r\n return false;\r\n }\r\n\r\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\r\n }\r\n return null;\r\n }\r\n\r\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\r\n inFront(body: () => void): void {\r\n if (this.probing) return;\r\n const out = this.target();\r\n if (!this.cut) {\r\n body();\r\n return;\r\n }\r\n out.beginClip(this.cut);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n target(): RenderPass2D {\r\n if (this.probing) return PROBE_PASS;\r\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\r\n return this.pass;\r\n }\r\n}\r\n\r\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\r\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\r\n\r\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\r\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\r\n return ctx;\r\n}\r\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Vector2 } from "../../attributes/layout/vector2.js";
|
|
2
|
+
import type { RenderContext2D, Values } from "../../components/factory/api.js";
|
|
3
|
+
/** Where a 2D camera looks: a point, a zoom and a heading, or a node below it to follow. */
|
|
4
|
+
export declare const state: {
|
|
5
|
+
zoom: import("../../components/factory/api.js").Type<number, number, false>;
|
|
6
|
+
lookAt: import("../../components/factory/api.js").Type<Vector2, Vector2, false>;
|
|
7
|
+
heading: import("../../components/factory/api.js").Type<number, number, false>;
|
|
8
|
+
follow: import("../../components/factory/api.js").Type<string, import("../../components/factory/api.js").NodeView<import("../../components/factory/api.js").Element<string, unknown, unknown>> | null, false>;
|
|
9
|
+
};
|
|
10
|
+
export declare const commands: {
|
|
11
|
+
readonly zoomTo: {
|
|
12
|
+
readonly args: readonly ["zoom"];
|
|
13
|
+
readonly run?: undefined;
|
|
14
|
+
};
|
|
15
|
+
readonly panTo: {
|
|
16
|
+
readonly args: readonly ["lookAt"];
|
|
17
|
+
readonly run?: undefined;
|
|
18
|
+
};
|
|
19
|
+
readonly headingTo: {
|
|
20
|
+
readonly args: readonly ["heading"];
|
|
21
|
+
readonly run?: undefined;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type AimState = Values<typeof state>;
|
|
25
|
+
/** The point the camera centres on: `lookAt`, offset from the followed node when there is one below it. */
|
|
26
|
+
export declare function aim(ctx: RenderContext2D, s: AimState): Vector2;
|
|
27
|
+
/** The children, through this camera. */
|
|
28
|
+
export declare function camera(ctx: RenderContext2D, s: AimState): void;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=aim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aim.d.ts","sourceRoot":"","sources":["../../../src/components/modules/aim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKxE,4FAA4F;AAC5F,eAAO,MAAM,KAAK;;;;;CAKjB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;CAInB,CAAC;AAEH,KAAK,QAAQ,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC;AAErC,2GAA2G;AAC3G,wBAAgB,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAO9D;AAED,yCAAyC;AACzC,wBAAgB,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAE9D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { lerpVector2 } from "../../attributes/layout/vector2.js";
|
|
2
|
+
import { Node2D } from "../../components/trees/2d/node2d.js";
|
|
3
|
+
import { commandsFor } from "../../components/factory/commands-for.js";
|
|
4
|
+
import { Types } from "../../components/factory/types.js";
|
|
5
|
+
import { internalsOf, nodeOfNodeView } from "../../components/factory/views.js";
|
|
6
|
+
/** Where a 2D camera looks: a point, a zoom and a heading, or a node below it to follow. */
|
|
7
|
+
export const state = {
|
|
8
|
+
zoom: Types.number(1, { min: 0.01, step: 0.1, unit: "×" }),
|
|
9
|
+
lookAt: Types.custom({ x: 0, y: 0 }, { lerp: lerpVector2, kind: "vector2", properties: { x: { kind: "number" }, y: { kind: "number" } } }),
|
|
10
|
+
heading: Types.number(0, { step: 1, unit: "°" }),
|
|
11
|
+
follow: Types.nodeRef(),
|
|
12
|
+
};
|
|
13
|
+
export const commands = commandsFor(state, {
|
|
14
|
+
zoomTo: { args: ["zoom"] },
|
|
15
|
+
panTo: { args: ["lookAt"] },
|
|
16
|
+
headingTo: { args: ["heading"] },
|
|
17
|
+
});
|
|
18
|
+
/** The point the camera centres on: `lookAt`, offset from the followed node when there is one below it. */
|
|
19
|
+
export function aim(ctx, s) {
|
|
20
|
+
const target = s.follow;
|
|
21
|
+
if (!target)
|
|
22
|
+
return s.lookAt;
|
|
23
|
+
const node = nodeOfNodeView(target);
|
|
24
|
+
if (!(node instanceof Node2D) || !within(node, internalsOf(ctx).host))
|
|
25
|
+
return s.lookAt;
|
|
26
|
+
const at = target.frame;
|
|
27
|
+
return { x: at.x + s.lookAt.x, y: at.y + s.lookAt.y };
|
|
28
|
+
}
|
|
29
|
+
/** The children, through this camera. */
|
|
30
|
+
export function camera(ctx, s) {
|
|
31
|
+
ctx.camera({ lookAt: aim(ctx, s), zoom: s.zoom, heading: s.heading });
|
|
32
|
+
}
|
|
33
|
+
function within(node, ancestor) {
|
|
34
|
+
for (let at = node.parent; at; at = at.parent)
|
|
35
|
+
if (at === ancestor)
|
|
36
|
+
return true;
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=aim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aim.js","sourceRoot":"","sources":["../../../src/components/modules/aim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,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AC,CAAC;IACpC,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC,MAAM,CAAC;IACvF,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;IACxB,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AAC1D,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,MAAM,CAAC,GAAoB,EAAE,CAAW;IACpD,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,MAAM,CAAC,IAAU,EAAE,QAAc;IACtC,KAAK,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM;QAAE,IAAI,EAAE,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;IAChF,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { lerpVector2, type Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { Node2D } from \"@/components/trees/2d/node2d\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport type { RenderContext2D, Values } from \"@/components/factory/api\";\r\nimport { commandsFor } from \"@/components/factory/commands-for\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport { internalsOf, nodeOfNodeView } from \"@/components/factory/views\";\r\n\r\n/** Where a 2D camera looks: a point, a zoom and a heading, or a node below it to follow. */\r\nexport const state = {\r\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\r\n lookAt: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" } } }),\r\n heading: Types.number(0, { step: 1, unit: \"°\" }),\r\n follow: Types.nodeRef(),\r\n};\r\n\r\nexport const commands = commandsFor(state, {\r\n zoomTo: { args: [\"zoom\"] },\r\n panTo: { args: [\"lookAt\"] },\r\n headingTo: { args: [\"heading\"] },\r\n});\r\n\r\ntype AimState = Values<typeof state>;\r\n\r\n/** The point the camera centres on: `lookAt`, offset from the followed node when there is one below it. */\r\nexport function aim(ctx: RenderContext2D, s: AimState): Vector2 {\r\n const target = s.follow;\r\n if (!target) return s.lookAt;\r\n const node = nodeOfNodeView(target);\r\n if (!(node instanceof Node2D) || !within(node, internalsOf(ctx).host)) return s.lookAt;\r\n const at = target.frame;\r\n return { x: at.x + s.lookAt.x, y: at.y + s.lookAt.y };\r\n}\r\n\r\n/** The children, through this camera. */\r\nexport function camera(ctx: RenderContext2D, s: AimState): void {\r\n ctx.camera({ lookAt: aim(ctx, s), zoom: s.zoom, heading: s.heading });\r\n}\r\n\r\nfunction within(node: Node, ancestor: Node): boolean {\r\n for (let at = node.parent; at; at = at.parent) if (at === ancestor) return true;\r\n return false;\r\n}\r\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Size2D } from "../../attributes/layout/size.js";
|
|
2
|
+
import type { CornerRadiusResolved, RectCornerRadius } from "../../attributes/shape/corners/corner-radius.js";
|
|
3
|
+
import type { CornerStyleResolved, RectCornerStyle } from "../../attributes/shape/corners/corner-style.js";
|
|
4
|
+
import { Graphics2D } from "../../render/graphics2d.js";
|
|
5
|
+
import type { Values } from "../../components/factory/api.js";
|
|
6
|
+
import { type Attribute } from "../../components/factory/types.js";
|
|
7
|
+
export declare const state: {
|
|
8
|
+
cornerRadius: Attribute<RectCornerRadius, CornerRadiusResolved>;
|
|
9
|
+
cornerStyle: Attribute<RectCornerStyle, CornerStyleResolved>;
|
|
10
|
+
};
|
|
11
|
+
/** A rectangle the size of the box, with these corners. */
|
|
12
|
+
export declare function rect(size: Size2D, s: Values<typeof state>): Graphics2D;
|
|
13
|
+
//# sourceMappingURL=corners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corners.d.ts","sourceRoot":"","sources":["../../../src/components/modules/corners.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACvG,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGnE,eAAO,MAAM,KAAK,EAAE;IAAE,YAAY,EAAE,SAAS,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IAAC,WAAW,EAAE,SAAS,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAA;CAGlJ,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,KAAK,CAAC,GAAG,UAAU,CAEtE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Graphics2D } from "../../render/graphics2d.js";
|
|
2
|
+
import { Types } from "../../components/factory/types.js";
|
|
3
|
+
// Typed out so the declarations name what the corners take by their own modules: a kit's emit reaches those through the sdk.
|
|
4
|
+
export const state = {
|
|
5
|
+
cornerRadius: Types.cornerRadius,
|
|
6
|
+
cornerStyle: Types.cornerStyle,
|
|
7
|
+
};
|
|
8
|
+
/** A rectangle the size of the box, with these corners. */
|
|
9
|
+
export function rect(size, s) {
|
|
10
|
+
return new Graphics2D().rect({ width: size.width, height: size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle });
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=corners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corners.js","sourceRoot":"","sources":["../../../src/components/modules/corners.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAkB,MAAM,4BAA4B,CAAC;AAEnE,6HAA6H;AAC7H,MAAM,CAAC,MAAM,KAAK,GAAsI;IACpJ,YAAY,EAAE,KAAK,CAAC,YAAY;IAChC,WAAW,EAAE,KAAK,CAAC,WAAW;CACjC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,CAAuB;IACtD,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvI,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { CornerRadiusResolved, RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport type { CornerStyleResolved, RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { Values } from \"@/components/factory/api\";\r\nimport { Types, type Attribute } from \"@/components/factory/types\";\r\n\r\n// Typed out so the declarations name what the corners take by their own modules: a kit's emit reaches those through the sdk.\r\nexport const state: { cornerRadius: Attribute<RectCornerRadius, CornerRadiusResolved>; cornerStyle: Attribute<RectCornerStyle, CornerStyleResolved> } = {\r\n cornerRadius: Types.cornerRadius,\r\n cornerStyle: Types.cornerStyle,\r\n};\r\n\r\n/** A rectangle the size of the box, with these corners. */\r\nexport function rect(size: Size2D, s: Values<typeof state>): Graphics2D {\r\n return new Graphics2D().rect({ width: size.width, height: size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle });\r\n}\r\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Alignment } from "../../attributes/layout/alignment.js";
|
|
2
|
+
import type { InsetsResolved } from "../../attributes/layout/insets.js";
|
|
3
|
+
import type { Size2D } from "../../attributes/layout/size.js";
|
|
4
|
+
import type { Vector2 } from "../../attributes/layout/vector2.js";
|
|
5
|
+
import type { BoxBounds } from "../../layout/bounds.js";
|
|
6
|
+
import type { FlowMode, FlowResolved, GapSize } from "../../layout/types.js";
|
|
7
|
+
import type { ChildView, Measurer, Placement2D, Values } from "../../components/factory/api.js";
|
|
8
|
+
import { type Attribute } from "../../components/factory/types.js";
|
|
9
|
+
/** The Rect layout engine: freeform, runs, wrapped runs and grids. */
|
|
10
|
+
export declare const state: {
|
|
11
|
+
flow: import("../../components/factory/api.js").Type<FlowMode, FlowResolved, false>;
|
|
12
|
+
gap: import("../../components/factory/api.js").Type<GapSize, GapSize, false>;
|
|
13
|
+
wrap: boolean;
|
|
14
|
+
crossGap: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
15
|
+
columns: import("../../components/factory/api.js").Type<number, number, false>;
|
|
16
|
+
align: Attribute<Alignment, Vector2>;
|
|
17
|
+
};
|
|
18
|
+
export type FlowState = Values<typeof state> & {
|
|
19
|
+
readonly padding: InsetsResolved;
|
|
20
|
+
readonly width: import("../../attributes/layout/size.js").SizeInput;
|
|
21
|
+
readonly height: import("../../attributes/layout/size.js").SizeInput;
|
|
22
|
+
};
|
|
23
|
+
/** `inset` is room the children must clear beyond `padding`: a stroke, say. */
|
|
24
|
+
export declare function measure(measurer: Measurer, s: FlowState, children: readonly ChildView<any>[], inset?: InsetsResolved): Size2D;
|
|
25
|
+
export declare function layout(box: BoxBounds, s: FlowState, children: readonly ChildView<any>[], inset?: InsetsResolved): readonly Placement2D[];
|
|
26
|
+
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/components/modules/flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAe,QAAQ,EAAE,YAAY,EAAgB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEjG,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGnE,sEAAsE;AACtE,eAAO,MAAM,KAAK;;;;;;WAOY,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,GAAG;IAC3C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,OAAO,0BAA0B,EAAE,SAAS,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,OAAO,0BAA0B,EAAE,SAAS,CAAC;CACjE,CAAC;AAaF,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,SAAS,CAAC,GAAG,CAAC,EAAE,EA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