@motionscript/core 0.1.0-alpha.9 → 0.1.1-alpha.0
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 +29 -0
- package/dist/assets/asset-index.d.ts +1 -8
- package/dist/assets/asset-index.d.ts.map +1 -1
- package/dist/assets/asset-index.js +1 -8
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +10 -72
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +3 -29
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts +8 -20
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -20
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +9 -51
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +13 -78
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/record.d.ts +2 -18
- package/dist/assets/record.d.ts.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -18
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +2 -11
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +2 -12
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
- package/dist/attributes/audio/effects/chain.js +1 -7
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/registry.d.ts +3 -18
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
- package/dist/attributes/audio/effects/registry.js +4 -23
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/ramp.d.ts +5 -38
- package/dist/attributes/audio/ramp.d.ts.map +1 -1
- package/dist/attributes/audio/ramp.js +3 -28
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +10 -80
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +1 -4
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +2 -12
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +2 -11
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +2 -26
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +1 -9
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +1 -8
- package/dist/attributes/audio/transition.d.ts.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/layout/alignment.d.ts +6 -38
- package/dist/attributes/layout/alignment.d.ts.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +2 -27
- package/dist/attributes/layout/insets.d.ts.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +29 -114
- package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
- package/dist/attributes/layout/matrix2d.js +26 -110
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +3 -25
- package/dist/attributes/layout/size.d.ts.map +1 -1
- package/dist/attributes/layout/size.js +2 -18
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.d.ts +16 -79
- package/dist/attributes/layout/space3d.d.ts.map +1 -1
- package/dist/attributes/layout/space3d.js +17 -81
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.d.ts +2 -23
- package/dist/attributes/layout/transform3d.d.ts.map +1 -1
- package/dist/attributes/layout/transform3d.js +1 -7
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/world-transform.d.ts +2 -16
- package/dist/attributes/layout/world-transform.d.ts.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +13 -73
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +9 -40
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +6 -45
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -37
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +11 -83
- package/dist/attributes/render3d/orbit.d.ts.map +1 -1
- package/dist/attributes/render3d/orbit.js +10 -73
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
- package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js +2 -12
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.d.ts +2 -21
- package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corners.js +2 -12
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js +3 -26
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +36 -328
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +24 -242
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js +6 -33
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +1 -6
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +1 -7
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +0 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +0 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +1 -9
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +0 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +0 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +2 -8
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +0 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +2 -9
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +0 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +1 -5
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +6 -41
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +7 -45
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +6 -30
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
- package/dist/attributes/shape/effects/spec.js +3 -9
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/fill/blend.d.ts +1 -17
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
- package/dist/attributes/shape/fill/blend.js +2 -15
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +17 -125
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +22 -109
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.d.ts +10 -35
- package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
- package/dist/attributes/shape/fill/coerce.js +12 -47
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +35 -96
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js +2 -13
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
- package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js +2 -8
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +6 -23
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +5 -17
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +12 -50
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +2 -13
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +2 -9
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
- package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js +8 -35
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +2 -26
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +5 -40
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.d.ts +6 -30
- package/dist/attributes/shape/fill/union.d.ts.map +1 -1
- package/dist/attributes/shape/fill/union.js +1 -9
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +15 -168
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +8 -132
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
- package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -6
- package/dist/attributes/shape/filters/index.d.ts.map +1 -1
- package/dist/attributes/shape/filters/index.js +0 -2
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +5 -35
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +7 -50
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +10 -51
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts +18 -106
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +15 -124
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.d.ts +6 -54
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
- package/dist/attributes/shape/path/bezier.js +10 -98
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.d.ts +1 -11
- package/dist/attributes/shape/path/index.d.ts.map +1 -1
- package/dist/attributes/shape/path/index.js +1 -11
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.d.ts +5 -41
- package/dist/attributes/shape/path/measure.d.ts.map +1 -1
- package/dist/attributes/shape/path/measure.js +8 -57
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts +4 -41
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +17 -117
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +5 -19
- 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/path/types.d.ts +10 -67
- package/dist/attributes/shape/path/types.d.ts.map +1 -1
- package/dist/attributes/shape/path/types.js +0 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.d.ts +9 -63
- package/dist/attributes/shape/path/walk.d.ts.map +1 -1
- package/dist/attributes/shape/path/walk.js +21 -100
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +2 -14
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/language.js +1 -8
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.d.ts +13 -78
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +1 -10
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -28
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
- package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js +0 -3
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +0 -6
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +1 -8
- package/dist/attributes/shared/operators.d.ts.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.d.ts +1 -11
- package/dist/attributes/text/index.d.ts.map +1 -1
- package/dist/attributes/text/index.js +1 -11
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +4 -30
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +7 -23
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +5 -28
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-3ZIUZZC7.js +13 -0
- package/dist/browser/chunks/chunk-3ZIUZZC7.js.map +7 -0
- package/dist/browser/chunks/chunk-5TDMGUXQ.js +3 -0
- package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
- package/dist/browser/chunks/chunk-7YOYMMXK.js +6 -0
- package/dist/browser/chunks/chunk-7YOYMMXK.js.map +7 -0
- package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
- package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +3 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -10
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.d.ts +15 -62
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js +29 -168
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.d.ts +1 -14
- package/dist/components/builtins/layout/layout.d.ts.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +11 -51
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +3 -7
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/text/number-format.d.ts +14 -47
- package/dist/components/builtins/text/number-format.d.ts.map +1 -1
- package/dist/components/builtins/text/number-format.js +19 -69
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.d.ts +3 -37
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
- package/dist/components/builtins/text/number-pattern.js +6 -48
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.d.ts +7 -25
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
- package/dist/components/builtins/text/text-defaults.js +7 -25
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.d.ts +2 -11
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
- package/dist/components/builtins/text/text-layout.js +7 -22
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +8 -46
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.d.ts +6 -51
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js +8 -46
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.d.ts +22 -117
- package/dist/components/builtins/three/three.d.ts.map +1 -1
- package/dist/components/builtins/three/three.js +5 -17
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +41 -3
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.d.ts +12 -41
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
- package/dist/components/trees/2d/group-bounds.js +3 -22
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js +35 -127
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.d.ts +4 -36
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
- package/dist/components/trees/2d/node-motion.js +3 -31
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +3 -20
- package/dist/components/trees/2d/node-render.d.ts.map +1 -1
- package/dist/components/trees/2d/node-render.js +4 -23
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.d.ts +4 -23
- package/dist/components/trees/2d/node-space.d.ts.map +1 -1
- package/dist/components/trees/2d/node-space.js +3 -17
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.d.ts +4 -33
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
- package/dist/components/trees/2d/node-transform.js +4 -33
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +112 -622
- package/dist/components/trees/2d/node2d.d.ts.map +1 -1
- package/dist/components/trees/2d/node2d.js +131 -605
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +17 -65
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +18 -68
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.d.ts +5 -45
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
- package/dist/components/trees/node/node-editor-state.js +1 -13
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +6 -54
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +13 -39
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.d.ts +2 -15
- package/dist/components/trees/node/node-time.d.ts.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.d.ts +7 -32
- package/dist/components/trees/node/node-walk.d.ts.map +1 -1
- package/dist/components/trees/node/node-walk.js +7 -32
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.d.ts +43 -248
- package/dist/components/trees/node/node.d.ts.map +1 -1
- package/dist/components/trees/node/node.js +51 -229
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js +7 -47
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.d.ts +24 -112
- package/dist/components/trees/three/node3d.d.ts.map +1 -1
- package/dist/components/trees/three/node3d.js +22 -104
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.d.ts +9 -21
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +13 -28
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts +3 -9
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +43 -89
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +15 -30
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +31 -31
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +9 -43
- package/dist/document/deny-globals.d.ts.map +1 -1
- package/dist/document/deny-globals.js +18 -58
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts +6 -16
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +5 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +5 -13
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +0 -2
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts +2 -2
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -18
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +11 -41
- package/dist/document/expression/index.d.ts.map +1 -1
- package/dist/document/expression/index.js +11 -41
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.d.ts +3 -12
- package/dist/document/expression/ops.d.ts.map +1 -1
- package/dist/document/expression/ops.js +4 -20
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts +4 -14
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +34 -55
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +2 -8
- package/dist/document/expression/refs.d.ts.map +1 -1
- package/dist/document/expression/refs.js +2 -6
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.d.ts +18 -63
- package/dist/document/expression/types.d.ts.map +1 -1
- package/dist/document/expression/types.js +4 -15
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts +6 -20
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +18 -44
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js +2 -3
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +7 -22
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +44 -15
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.d.ts +4 -11
- package/dist/document/missing-node.d.ts.map +1 -1
- package/dist/document/missing-node.js +2 -5
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.d.ts +12 -53
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +16 -57
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -62
- 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 +18 -41
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js +4 -11
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +19 -52
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +2 -6
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +10 -20
- package/dist/document/prop-evolution.d.ts.map +1 -1
- package/dist/document/prop-evolution.js +3 -7
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.d.ts +80 -318
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +43 -147
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +12 -18
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +29 -31
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +6 -15
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +12 -21
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +56 -263
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +97 -281
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +90 -264
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +13 -30
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +10 -40
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +72 -137
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +4 -7
- package/dist/document/vocabulary.d.ts.map +1 -1
- package/dist/document/vocabulary.js +0 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +1 -11
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +6 -20
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +7 -28
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +2 -11
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +2 -22
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +11 -55
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +7 -43
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js +4 -29
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +5 -31
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/stepped-clock.d.ts +1 -16
- package/dist/platform/stepped-clock.d.ts.map +1 -1
- package/dist/platform/stepped-clock.js +1 -16
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +8 -68
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +8 -60
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +11 -45
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +10 -37
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.d.ts +4 -14
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/tree.d.ts +6 -35
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js +1 -8
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +7 -13
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +18 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +73 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/observer.d.ts +1 -7
- package/dist/props/observer.d.ts.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.d.ts +6 -19
- package/dist/props/slot.d.ts.map +1 -1
- package/dist/props/slot.js +5 -14
- package/dist/props/slot.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +8 -68
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +8 -69
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.d.ts +2 -16
- package/dist/render/clip-contains.d.ts.map +1 -1
- package/dist/render/clip-contains.js +21 -82
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +7 -25
- package/dist/render/clip.d.ts.map +1 -1
- package/dist/render/clip.js +5 -17
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.d.ts.map +1 -1
- package/dist/render/descriptors/ellipse.js +0 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.d.ts.map +1 -1
- package/dist/render/descriptors/line.js +0 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.d.ts +4 -32
- package/dist/render/descriptors/path-builder.d.ts.map +1 -1
- package/dist/render/descriptors/path-builder.js +3 -25
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.d.ts +1 -11
- package/dist/render/descriptors/path.d.ts.map +1 -1
- package/dist/render/descriptors/path.js +0 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.d.ts.map +1 -1
- package/dist/render/descriptors/polygon.js +0 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.d.ts.map +1 -1
- package/dist/render/descriptors/polygram.js +0 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.d.ts.map +1 -1
- package/dist/render/descriptors/rect.js +0 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.d.ts.map +1 -1
- package/dist/render/descriptors/richtext.js +0 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +17 -77
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js +13 -47
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -94
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +8 -50
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +5 -16
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js +1 -17
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +24 -116
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +23 -108
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/measure-context.d.ts +5 -29
- package/dist/render/measure-context.d.ts.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.d.ts +2 -20
- package/dist/render/null-render-context.d.ts.map +1 -1
- package/dist/render/null-render-context.js +2 -20
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +52 -208
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.d.ts +2 -19
- package/dist/render/surface.d.ts.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.d.ts +1 -17
- package/dist/render/text-defaults.d.ts.map +1 -1
- package/dist/render/text-defaults.js +6 -40
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.d.ts +12 -55
- package/dist/render/text-layout.d.ts.map +1 -1
- package/dist/render/text-layout.js +2 -16
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts +10 -32
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +2 -12
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +8 -35
- package/dist/render3d/builders.d.ts.map +1 -1
- package/dist/render3d/builders.js +8 -35
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +10 -57
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +4 -26
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +7 -45
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +15 -85
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +18 -106
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js +2 -20
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +29 -133
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +23 -110
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -16
- package/dist/render3d/index.d.ts.map +1 -1
- package/dist/render3d/index.js +1 -16
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts.map +1 -1
- package/dist/render3d/inert.js +1 -14
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.d.ts +3 -26
- package/dist/render3d/light.d.ts.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +13 -87
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js +2 -16
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.d.ts +14 -68
- package/dist/render3d/matrix4.d.ts.map +1 -1
- package/dist/render3d/matrix4.js +11 -60
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.d.ts +13 -51
- package/dist/render3d/render-context3d.d.ts.map +1 -1
- package/dist/render3d/render-context3d.js +9 -21
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +9 -53
- package/dist/render3d/resources.d.ts.map +1 -1
- package/dist/render3d/resources.js +8 -48
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.d.ts +7 -21
- package/dist/render3d/rounded-box.d.ts.map +1 -1
- package/dist/render3d/rounded-box.js +7 -46
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +20 -78
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -53
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +12 -59
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.d.ts +2 -25
- package/dist/render3d/segments.d.ts.map +1 -1
- package/dist/render3d/segments.js +1 -11
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +25 -112
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +3 -27
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.d.ts +2 -19
- package/dist/render3d/tracking.d.ts.map +1 -1
- package/dist/render3d/tracking.js +2 -19
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +14 -60
- package/dist/render3d/transform.d.ts.map +1 -1
- package/dist/render3d/transform.js +0 -2
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +6 -48
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +4 -38
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +3 -27
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -33
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +34 -20
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +127 -31
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +14 -53
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js +6 -27
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts +7 -26
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +6 -18
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.d.ts +3 -9
- package/dist/runtime/builtin-context.d.ts.map +1 -1
- package/dist/runtime/builtin-context.js +3 -9
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +12 -39
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -45
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +26 -68
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +47 -81
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +31 -85
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +16 -49
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +4 -15
- package/dist/runtime/frame-time.d.ts.map +1 -1
- package/dist/runtime/frame-time.js +5 -12
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +59 -139
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +87 -157
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +39 -96
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +98 -141
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts +8 -17
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +7 -16
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +78 -207
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +111 -226
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.d.ts +6 -14
- package/dist/runtime/playback.d.ts.map +1 -1
- package/dist/runtime/playback.js +6 -14
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/project-assets.d.ts +6 -14
- package/dist/runtime/project-assets.d.ts.map +1 -1
- package/dist/runtime/project-assets.js +7 -16
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +22 -45
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +26 -46
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.d.ts +4 -10
- package/dist/runtime/settle.d.ts.map +1 -1
- package/dist/runtime/settle.js +4 -10
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +15 -37
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +27 -44
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +18 -47
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +13 -27
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -7
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -138
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +6 -26
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -6
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +6 -53
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +5 -40
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/curve.d.ts +2 -17
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +1 -6
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +0 -11
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +0 -23
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +2 -18
- package/dist/tween/ease/spec.d.ts.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/inert.d.ts +1 -14
- package/dist/tween/inert.d.ts.map +1 -1
- package/dist/tween/inert.js +1 -14
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.d.ts +2 -26
- package/dist/tween/lerp.d.ts.map +1 -1
- package/dist/tween/lerp.js +2 -26
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.d.ts +9 -50
- package/dist/tween/loop.d.ts.map +1 -1
- package/dist/tween/loop.js +6 -31
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +2 -30
- package/dist/tween/prepare.d.ts.map +1 -1
- package/dist/tween/prepare.js +2 -30
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.d.ts +4 -25
- package/dist/tween/stepper.d.ts.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.d.ts +1 -8
- package/dist/tween/to-command.d.ts.map +1 -1
- package/dist/tween/to-command.js +2 -25
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/context.d.ts +4 -29
- package/dist/util/context.d.ts.map +1 -1
- package/dist/util/context.js +3 -15
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.d.ts +4 -29
- package/dist/util/csv.d.ts.map +1 -1
- package/dist/util/csv.js +3 -22
- package/dist/util/csv.js.map +1 -1
- package/dist/util/metrics.d.ts +2 -26
- package/dist/util/metrics.d.ts.map +1 -1
- package/dist/util/metrics.js +2 -26
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.d.ts +20 -87
- package/dist/util/random.d.ts.map +1 -1
- package/dist/util/random.js +20 -87
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.d.ts +6 -35
- package/dist/util/reference.d.ts.map +1 -1
- package/dist/util/reference.js +1 -4
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.d.ts +6 -27
- package/dist/util/scheduler.d.ts.map +1 -1
- package/dist/util/scheduler.js +8 -35
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
- package/dist/browser/chunks/chunk-7DB6BI27.js +0 -6
- package/dist/browser/chunks/chunk-7DB6BI27.js.map +0 -7
- package/dist/browser/chunks/chunk-IX53IFBD.js +0 -13
- package/dist/browser/chunks/chunk-IX53IFBD.js.map +0 -7
- package/dist/browser/chunks/chunk-Q55UPA3E.js +0 -3
- package/dist/browser/chunks/chunk-Q55UPA3E.js.map +0 -7
- package/dist/renamed-scene-names.d.ts +0 -17
- package/dist/renamed-scene-names.d.ts.map +0 -1
- package/dist/renamed-scene-names.js +0 -9
- package/dist/renamed-scene-names.js.map +0 -1
- package/dist/runtime/precompisition.d.ts +0 -24
- package/dist/runtime/precompisition.d.ts.map +0 -1
- package/dist/runtime/precompisition.js +0 -7
- package/dist/runtime/precompisition.js.map +0 -1
|
@@ -20,11 +20,7 @@ import { size2DOps, sizeInputOps } from "../../../attributes/layout/size.js";
|
|
|
20
20
|
import { insetsOps } from "../../../attributes/layout/insets.js";
|
|
21
21
|
import { lerpPerspective } from "../../../tween/lerp.js";
|
|
22
22
|
import { flowOps } from "../../../layout/ops.js";
|
|
23
|
-
/**
|
|
24
|
-
* Stand-in for a node's reference rects when the context never reads them.
|
|
25
|
-
* Shared and empty — `computeSpaceRects` returns the same shape for a node with
|
|
26
|
-
* no parent, so consumers already handle it.
|
|
27
|
-
*/
|
|
23
|
+
/** Shared empty stand-in when the context never reads reference rects; the shape `computeSpaceRects` returns for a parentless node. */
|
|
28
24
|
const NO_SPACE_RECTS = {};
|
|
29
25
|
/** The node centre in the normalised `[-1, 1]` alignment space — `pivot`'s own default. */
|
|
30
26
|
const ORIGIN_2D = { x: 0, y: 0 };
|
|
@@ -43,75 +39,26 @@ function slotProjection(placement) {
|
|
|
43
39
|
/** No settings: centred freeform, which is how a plain node arranges its children. */
|
|
44
40
|
const DEFAULT_FLOW = Object.freeze({});
|
|
45
41
|
const NO_CONTENT = { width: 0, height: 0 };
|
|
46
|
-
// WorldTransform, PropInput, and PropInputs now live in dedicated
|
|
47
|
-
// modules (see imports above) and are re-exported below so existing
|
|
48
|
-
// `from ".../node2d"` imports keep resolving.
|
|
49
42
|
export { Node } from "../../../components/trees/node/node.js";
|
|
50
43
|
/**
|
|
51
|
-
* The 2D tree's base: what every `component2d` lowers onto, and the scene root
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* **Properties** — each declared prop is backed by a {@link PropSlot}, which
|
|
55
|
-
* holds either a value or a thunk. {@link set} updates props imperatively, and
|
|
56
|
-
* a callback `() => expr` binds one to a derived value.
|
|
57
|
-
*
|
|
58
|
-
* **Tweening** — `to({ data, duration, easing })` returns a {@link Command}
|
|
59
|
-
* that animates props to target values, evaluable at a time via `at(t)`.
|
|
60
|
-
* `moveTo`, `fadeTo`, `rotateTo`, `scaleTo` and the rest wrap it.
|
|
61
|
-
*
|
|
62
|
-
* **Layout** — `measure()` is called top-down to resolve sizes, then
|
|
63
|
-
* `layout()` places the node in its allocated `BoxBounds` and its children in
|
|
64
|
-
* its content box.
|
|
65
|
-
*
|
|
66
|
-
* ### Built-in visual props
|
|
67
|
-
* | prop | default | unit / notes |
|
|
68
|
-
* |-----------|----------|---------------------------------------|
|
|
69
|
-
* | `x` | 0 | horizontal offset in scene pixels |
|
|
70
|
-
* | `y` | 0 | vertical offset (positive = up) |
|
|
71
|
-
* | `width` | `'fill'` | `SizeInput`: px, `'fill'`, `'auto'` |
|
|
72
|
-
* | `height` | `'fill'` | same |
|
|
73
|
-
* | `size` | — | sugar: sets `width` and `height` together |
|
|
74
|
-
* | `scale` | 1 | uniform scale factor |
|
|
75
|
-
* | `rotate` | 0 | degrees, clockwise |
|
|
76
|
-
* | `opacity` | 1 | 0–1 |
|
|
77
|
-
* | `blend` | `'pass-through'` | layer blend mode (`NodeBlendMode`) |
|
|
78
|
-
* | `effects` | [] | post-process / blend effects |
|
|
79
|
-
* | `padding` | 0 | inner spacing, all four edges |
|
|
44
|
+
* The 2D tree's base: what every `component2d` lowers onto, and the scene root ({@link Canvas2D}).
|
|
45
|
+
* Props are {@link PropSlot}-backed (a value or a thunk); `to()` returns a {@link Command}; `measure()`
|
|
46
|
+
* runs top-down, then `layout()` places the node and its children.
|
|
80
47
|
*/
|
|
81
48
|
export class Node2D extends Node {
|
|
82
49
|
get dimension() { return "2d"; }
|
|
83
|
-
/**
|
|
84
|
-
* This node's parent, when that parent is itself 2D.
|
|
85
|
-
*
|
|
86
|
-
* A `Node2D` can only ever be adopted by another `Node2D` (see
|
|
87
|
-
* {@link Node.acceptsChild}), so this is `null` only for a detached node or
|
|
88
|
-
* the root — but it is typed honestly rather than cast, because the base
|
|
89
|
-
* tree holds both dimensions.
|
|
90
|
-
*/
|
|
50
|
+
/** Null only for a detached node or the root; the base tree holds both dimensions, so this is typed rather than cast. */
|
|
91
51
|
get parent2D() {
|
|
92
52
|
const parent = this._parent;
|
|
93
53
|
return parent instanceof Node2D ? parent : null;
|
|
94
54
|
}
|
|
95
|
-
/**
|
|
96
|
-
* This node's parent, narrowed to the 2D tree.
|
|
97
|
-
*
|
|
98
|
-
* Only a `Node2D` can adopt a `Node2D` (see {@link Node.acceptsChild}), so
|
|
99
|
-
* this never hides a real parent — it just spares every 2D caller a cast.
|
|
100
|
-
*/
|
|
55
|
+
/** Narrowed to the 2D tree: only a `Node2D` can adopt a `Node2D` (see {@link Node.acceptsChild}). */
|
|
101
56
|
get parent() {
|
|
102
57
|
if (_observer !== null)
|
|
103
58
|
_observer.read(this._structureSlot());
|
|
104
59
|
return this.parent2D;
|
|
105
60
|
}
|
|
106
|
-
/**
|
|
107
|
-
* This node's children **in the 2D tree**.
|
|
108
|
-
*
|
|
109
|
-
* `Canvas3D` is the one node that holds both dimensions, and its `Node3D`
|
|
110
|
-
* children are not part of the 2D tree — they describe a scene it paints,
|
|
111
|
-
* not boxes it lays out — so they are reached through its own accessor
|
|
112
|
-
* instead. Every other node's list is already 2D, and this returns the live
|
|
113
|
-
* array untouched in that case rather than allocating a copy per read.
|
|
114
|
-
*/
|
|
61
|
+
/** Children in the 2D tree. `Canvas3D` also holds `Node3D` children outside it (reached through its own accessor); otherwise the live array is returned uncopied. */
|
|
115
62
|
get children() {
|
|
116
63
|
if (_observer !== null)
|
|
117
64
|
_observer.read(this._structureSlot());
|
|
@@ -125,21 +72,14 @@ export class Node2D extends Node {
|
|
|
125
72
|
}
|
|
126
73
|
constructor(props) {
|
|
127
74
|
super(props);
|
|
128
|
-
// Expand the `size`
|
|
129
|
-
// before anything reads either — in place, so the single object `super()`
|
|
130
|
-
// retained as `_props` already carries the expanded values.
|
|
75
|
+
// Expand the `size`/`transform3D` sugar in place, so the `_props` object `super()` kept carries the expanded values.
|
|
131
76
|
if (props) {
|
|
132
77
|
size2DOps.expand(props);
|
|
133
78
|
expandTransform3D(props);
|
|
134
79
|
}
|
|
135
|
-
//
|
|
136
|
-
// Deferred to here rather than run by `super()` because the cells those
|
|
137
|
-
// props write into are this class's own fields, and a subclass's field
|
|
138
|
-
// initializers only run once `super()` has returned.
|
|
80
|
+
// Deferred from `super()`: the cells these props write into are this class's own fields, which only initialize after `super()` returns.
|
|
139
81
|
this.initProps(props);
|
|
140
|
-
//
|
|
141
|
-
// unspecified width/height defaults to 'fill' (flex is a no-op on a
|
|
142
|
-
// fixed/hug axis) and skips the has-children default below.
|
|
82
|
+
// `flex` signals intent to fill the main axis, so an unset width/height defaults to 'fill' and skips the has-children default.
|
|
143
83
|
if (props && props.flex !== undefined) {
|
|
144
84
|
if (props.width === undefined)
|
|
145
85
|
this.applyProp("width", "fill", { tween: sizeInputOps.lerp });
|
|
@@ -149,9 +89,7 @@ export class Node2D extends Node {
|
|
|
149
89
|
else {
|
|
150
90
|
this.applyDefaultSize(props);
|
|
151
91
|
}
|
|
152
|
-
// Alignment
|
|
153
|
-
// and centre offset math lives in alignmentOps (shared with the
|
|
154
|
-
// `to()` path); here we use its reactive binding form.
|
|
92
|
+
// Alignment positioning: validate, derive pivot, bind x/y reactively (the `to()` path uses the one-shot form).
|
|
155
93
|
if (props) {
|
|
156
94
|
alignmentOps.validateProps(props);
|
|
157
95
|
const alignmentKey = alignmentOps.findKey(props);
|
|
@@ -166,19 +104,10 @@ export class Node2D extends Node {
|
|
|
166
104
|
}
|
|
167
105
|
this.adoptChildrenProp(props);
|
|
168
106
|
}
|
|
169
|
-
/**
|
|
170
|
-
* The 2D half of `set()`: `size` and `transform3D` are sugar with no slot of
|
|
171
|
-
* their own, so they are distributed into the props that do have one before
|
|
172
|
-
* the generic write loop runs.
|
|
173
|
-
*/
|
|
174
107
|
set(props) {
|
|
175
|
-
// `size` has no slot
|
|
176
|
-
// width/height (explicit width/height in the same call still wins).
|
|
108
|
+
// `size` has no slot; write it to width/height (explicit width/height in the same call wins).
|
|
177
109
|
const sizeVal = props.size;
|
|
178
|
-
//
|
|
179
|
-
// loop: its fields are real props, so distributing them into `props`
|
|
180
|
-
// first means the generic loop writes them like any other key. Only the
|
|
181
|
-
// present-and-an-object case allocates, which is the rare one.
|
|
110
|
+
// `transform3D` is expanded up front so the generic loop writes its fields; only the rare object case allocates.
|
|
182
111
|
if (props.transform3D !== undefined) {
|
|
183
112
|
props = { ...props };
|
|
184
113
|
expandTransform3D(props);
|
|
@@ -191,51 +120,24 @@ export class Node2D extends Node {
|
|
|
191
120
|
this._writeProp('height', sizeVal);
|
|
192
121
|
}
|
|
193
122
|
}
|
|
194
|
-
/**
|
|
195
|
-
* The 2D half of `_prepareStep`: expand the positional sugar into the props
|
|
196
|
-
* that actually have cells, then let the base resolve the step.
|
|
197
|
-
*
|
|
198
|
-
* `to` is mutated in place, so the base sees the expanded target — which is
|
|
199
|
-
* why this can run entirely before `super`.
|
|
200
|
-
*/
|
|
201
123
|
_prepareStep(to, duration, easing) {
|
|
202
|
-
//
|
|
203
|
-
// before anchor validation and the per-key tween setup below see it.
|
|
204
|
-
// `transform3D` is sugar in the same way, so it expands here too and its
|
|
205
|
-
// fields tween individually, exactly as if they had been named directly.
|
|
124
|
+
// Expand the sugar before anchor validation and per-key tween setup see it.
|
|
206
125
|
size2DOps.expand(to);
|
|
207
126
|
expandTransform3D(to);
|
|
208
|
-
// `pivot
|
|
209
|
-
//
|
|
210
|
-
// overloads below), or just as well a bare key on a `to()` target. Not a
|
|
211
|
-
// real prop — nothing on the node holds a value named `pivot` that a tween
|
|
212
|
-
// interpolates — so it's read and stripped before anything else here (the
|
|
213
|
-
// alignment validation included) ever sees it.
|
|
127
|
+
// `pivot` is a transient origin for this step's rotation and scale (the object-form option of
|
|
128
|
+
// moveTo/rotateTo/scaleTo, or a bare `to()` key). Not a prop, so strip it before anything else sees it.
|
|
214
129
|
const explicitPivot = to.pivot;
|
|
215
130
|
if (explicitPivot !== undefined)
|
|
216
131
|
delete to.pivot;
|
|
217
132
|
alignmentOps.validateProps(to);
|
|
218
|
-
//
|
|
219
|
-
// set the transform origin (one-shot form of the shared alignment math in
|
|
220
|
-
// alignmentOps).
|
|
133
|
+
// An alignment key in the target resolves to x/y targets plus a transform origin (one-shot alignmentOps math).
|
|
221
134
|
const alignmentKey = alignmentOps.findKey(to);
|
|
222
135
|
if (alignmentKey) {
|
|
223
136
|
const raw = to[alignmentKey];
|
|
224
137
|
const { pivot, x, y } = alignmentOps.resolveTargetOnce(alignmentKey, this._layoutBounds.get(), raw);
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
// positions it there. A *tween's* target used to overwrite that
|
|
229
|
-
// permanent value with its own alignment every time one was used to
|
|
230
|
-
// state a position, which means a `moveTo` aligned differently from
|
|
231
|
-
// the node quietly re-pointed every rotation that ran after it.
|
|
232
|
-
// `transformOrigin` (see its own doc) is the right prop for this
|
|
233
|
-
// instead: it wins for the whole transform without being the node's
|
|
234
|
-
// one true pivot. An explicit `pivot` given on this same step (via
|
|
235
|
-
// `moveTo`/`rotateTo`/`scaleTo`'s object form) overrides the
|
|
236
|
-
// alignment-derived value in turn — the point a position is stated
|
|
237
|
-
// against and the point a rotation turns about are two different
|
|
238
|
-
// questions once a step can state them separately.
|
|
138
|
+
// Written to `transformOrigin`, not `pivot`: `pivot` is the node's permanent origin, set at construction,
|
|
139
|
+
// and a tween's alignment must not re-point later rotations. An explicit step `pivot` overrides the
|
|
140
|
+
// alignment-derived value: where a position is stated against and where a rotation turns are separate questions.
|
|
239
141
|
this._writeProp('transformOrigin', explicitPivot !== undefined ? alignmentOps.resolve(explicitPivot) : pivot);
|
|
240
142
|
to.x = x;
|
|
241
143
|
to.y = y;
|
|
@@ -245,21 +147,13 @@ export class Node2D extends Node {
|
|
|
245
147
|
}
|
|
246
148
|
return super._prepareStep(to, duration, easing);
|
|
247
149
|
}
|
|
248
|
-
/**
|
|
249
|
-
* A component's paint entries declare themselves, so only a node painting
|
|
250
|
-
* something its attributes do not describe has anything to add.
|
|
251
|
-
*/
|
|
150
|
+
/** Effects are the only assets a bare node declares; component paint entries declare their own. */
|
|
252
151
|
declareAssets(assets) {
|
|
253
152
|
assets.effects(this.effects);
|
|
254
153
|
}
|
|
255
|
-
/** Sample this node's own derived render state for the current frame. */
|
|
256
154
|
_sample() {
|
|
257
155
|
this._sampleMotion();
|
|
258
156
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Record this node's current position as the motion history's previous
|
|
261
|
-
* frame, stamped `at`, deriving no velocity — see the base's note.
|
|
262
|
-
*/
|
|
263
157
|
_primeMotion(at) {
|
|
264
158
|
const r = this.layoutBounds;
|
|
265
159
|
const o = this._offset();
|
|
@@ -267,60 +161,23 @@ export class Node2D extends Node {
|
|
|
267
161
|
}
|
|
268
162
|
_layoutBounds = new PropSlot({ x: 0, y: 0, width: 0, height: 0 }, this, LAYOUT_SLOT);
|
|
269
163
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* Retained so off-tree work can measure a not-yet-attached child *in
|
|
274
|
-
* isolation* — the animated child-insert in `node-lifecycle.ts` needs a hug
|
|
275
|
-
* child's natural size without putting it in this node's flow first, or the
|
|
276
|
-
* siblings shift for a frame. Undefined until this node is first measured.
|
|
277
|
-
*
|
|
278
|
-
* One object rather than two loose fields, because the two are only ever
|
|
279
|
-
* useful together and were previously reached through a
|
|
280
|
-
* `{ constraints?; _lastScope? }` structural cast from two other modules —
|
|
281
|
-
* a cast that would have gone on compiling through any rename.
|
|
164
|
+
* Limits and measurer from the last {@link measure} pass, so off-tree work (the animated child-insert in
|
|
165
|
+
* `node-lifecycle.ts`) can size a detached hug child without shifting siblings. Undefined until measured.
|
|
282
166
|
*
|
|
283
167
|
* @internal
|
|
284
168
|
*/
|
|
285
169
|
lastMeasure;
|
|
286
|
-
/**
|
|
287
|
-
* The box the last layout pass allocated this node: its size, and where it
|
|
288
|
-
* sits in its parent's space (canvas y-down).
|
|
289
|
-
*
|
|
290
|
-
* Reactive — a read inside a binding is tracked, so a prop bound to another
|
|
291
|
-
* node's box re-evaluates when that box moves.
|
|
292
|
-
*
|
|
293
|
-
* **Public, and a single member.** It used to be a `protected layoutRect`
|
|
294
|
-
* plus a public `measuredRect` alias that existed only so the picking walk
|
|
295
|
-
* could reach it — and, in practice, a `(node as any).layoutRect` cast in
|
|
296
|
-
* every test that needed a box. Two names for one value, one of them
|
|
297
|
-
* reachable only by lying to the compiler, is worse than the thing
|
|
298
|
-
* `protected` was buying. Writing it is still {@link setLayoutBounds}, which
|
|
299
|
-
* is where the layout engine's invariants live.
|
|
300
|
-
*/
|
|
170
|
+
/** The box the last layout pass allocated: size, and position in the parent's space (canvas y-down). Reactive. Written only via {@link setLayoutBounds}, where the layout invariants live. */
|
|
301
171
|
get layoutBounds() { return this._layoutBounds.get(); }
|
|
302
|
-
/**
|
|
303
|
-
* {@link flattenChildrenProp}, narrowed to the children this node will
|
|
304
|
-
* actually lay out — a 3D or audio child sits in the same `children` prop but
|
|
305
|
-
* takes no part in 2D layout, so it can't inform the size defaults either.
|
|
306
|
-
*/
|
|
172
|
+
/** {@link flattenChildrenProp} narrowed to children that take part in 2D layout (not 3D or audio). */
|
|
307
173
|
static flowChildrenProp(props) {
|
|
308
174
|
return Node2D.flattenChildrenProp(props).filter((c) => c instanceof Node2D);
|
|
309
175
|
}
|
|
310
|
-
/**
|
|
311
|
-
* True if any of `children` requests `"fill"` on `axis` — the signal a
|
|
312
|
-
* component's size default reads to decide whether hugging on that axis
|
|
313
|
-
* would strand the child with no space to fill into.
|
|
314
|
-
*/
|
|
176
|
+
/** True if any child requests `"fill"` on `axis`, so a size default can avoid hugging a child that would have nothing to fill. */
|
|
315
177
|
static hasFillChild(children, axis) {
|
|
316
178
|
return children.some((c) => (axis === "width" ? c.width : c.height) === "fill");
|
|
317
179
|
}
|
|
318
|
-
/**
|
|
319
|
-
* Default for `width`/`height`: hug-to-content when the node is given
|
|
320
|
-
* children, fill-the-parent when it's empty. Called once from the
|
|
321
|
-
* constructor (skipped when `flex` is set, since that already implies
|
|
322
|
-
* 'fill'); `component2d` replaces it with the component rule.
|
|
323
|
-
*/
|
|
180
|
+
/** Hug when given children, fill when empty. Skipped when `flex` is set (implies `'fill'`); `component2d` replaces it with the component rule. */
|
|
324
181
|
applyDefaultSize(props) {
|
|
325
182
|
const hasChildren = Node2D.flowChildrenProp(props).length > 0;
|
|
326
183
|
const defaultSize = hasChildren ? "hug" : "fill";
|
|
@@ -329,34 +186,15 @@ export class Node2D extends Node {
|
|
|
329
186
|
if (!props || props.height === undefined)
|
|
330
187
|
this.applyProp("height", defaultSize, { tween: sizeInputOps.lerp });
|
|
331
188
|
}
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
// Each returns the `Command` it delegates to rather than wrapping it in
|
|
335
|
-
// anything, because the wrapper would discard the thing worth having: a
|
|
336
|
-
// `Command` can be *evaluated* at a time, and anything that merely advances
|
|
337
|
-
// can only be run to one.
|
|
189
|
+
// Each helper returns its `Command` unwrapped: a `Command` can be evaluated at a time, anything that only advances can't.
|
|
338
190
|
/**
|
|
339
|
-
* Animate `x`/`y` to
|
|
340
|
-
*
|
|
341
|
-
* later rotate/scale turn about — independent of the node's own permanent
|
|
342
|
-
* {@link pivot}, and it carries forward like any other prop until something
|
|
343
|
-
* restates it.
|
|
344
|
-
*
|
|
345
|
-
* `path` replaces the destination rather than qualifying it — stating both is
|
|
346
|
-
* an error, since the path's own end is where the move ends — and the node
|
|
347
|
-
* walks it by **arc length**, so easing shapes the travel rather than the
|
|
348
|
-
* curve's parameter. Its coordinates *are* `x`/`y` values, in the same y-up
|
|
349
|
-
* space a `PathCommand[]` is authored in library-wide: the path says where
|
|
350
|
-
* the node is at `t`, not how far it has come from wherever the previous
|
|
351
|
-
* command left it.
|
|
191
|
+
* Animate `x`/`y` to a position, along `path`, or onto another node. `pivot` sets
|
|
192
|
+
* {@link Node2DProps.transformOrigin} (carried forward until restated), not the permanent {@link pivot}.
|
|
352
193
|
*
|
|
353
|
-
* `
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* Given a `path` as well, the path is turned and scaled about its own start
|
|
358
|
-
* until its end lands on the target, which is exact where the two already
|
|
359
|
-
* agree and keeps the curve's shape where the target has since moved.
|
|
194
|
+
* `path` or `target` replaces the `x`/`y` destination (stating both is an error). A path is walked by arc
|
|
195
|
+
* length and its coordinates are `x`/`y` values in the library-wide y-up space. `target` is a node id and
|
|
196
|
+
* `targetAnchor` the point of its box (centre when absent), resolved when the command is built; an absent
|
|
197
|
+
* target leaves the node in place. With both, the path is turned and scaled about its start until its end lands on the target.
|
|
360
198
|
*
|
|
361
199
|
* @example
|
|
362
200
|
* node.moveTo({ data: { x: 200, y: 100, pivot: 'topRight' }, duration: 0.5 });
|
|
@@ -396,79 +234,45 @@ export class Node2D extends Node {
|
|
|
396
234
|
return at;
|
|
397
235
|
}, args.duration, args.easing);
|
|
398
236
|
}
|
|
399
|
-
/** Animate `opacity` to the target value, in `[0, 1]`. */
|
|
400
237
|
fadeTo(args) {
|
|
401
238
|
return this.to({ data: args.data, duration: args.duration, easing: args.easing });
|
|
402
239
|
}
|
|
403
|
-
/**
|
|
404
|
-
* Animate `rotation` to the target angle (degrees, clockwise). `pivot`
|
|
405
|
-
* (optional) behaves as in {@link moveTo}.
|
|
406
|
-
*
|
|
407
|
-
* @example
|
|
408
|
-
* node.rotateTo({ data: { rotation: 180, pivot: 'topRight' }, duration: 0.6 });
|
|
409
|
-
*/
|
|
240
|
+
/** Animate `rotation` (degrees, clockwise); `pivot` behaves as in {@link moveTo}. */
|
|
410
241
|
rotateTo(args) {
|
|
411
242
|
return this.to({ data: args.data, duration: args.duration, easing: args.easing });
|
|
412
243
|
}
|
|
413
|
-
/**
|
|
414
|
-
* Animate `scale` to the target factor. `pivot` (optional) behaves as in
|
|
415
|
-
* {@link moveTo}.
|
|
416
|
-
*
|
|
417
|
-
* @example
|
|
418
|
-
* node.scaleTo({ data: { scale: 2, pivot: 'topRight' }, duration: 0.4 });
|
|
419
|
-
*/
|
|
244
|
+
/** Animate `scale`; `pivot` behaves as in {@link moveTo}. */
|
|
420
245
|
scaleTo(args) {
|
|
421
246
|
return this.to({ data: args.data, duration: args.duration, easing: args.easing });
|
|
422
247
|
}
|
|
423
|
-
/**
|
|
424
|
-
* Animate the box: `width`, `height` and `padding`, whichever are given.
|
|
425
|
-
* A size keyword (`'fill'`, `'hug'`) snaps; a number interpolates.
|
|
426
|
-
*
|
|
427
|
-
* @example
|
|
428
|
-
* node.layoutTo({ data: { width: 640, height: 360 }, duration: 0.5 });
|
|
429
|
-
*/
|
|
248
|
+
/** Animate `width`, `height` and `padding`, whichever are given. A size keyword (`'fill'`, `'hug'`) snaps; a number interpolates. */
|
|
430
249
|
layoutTo(args) {
|
|
431
250
|
return this.to({ data: _stated(args.data), duration: args.duration, easing: args.easing });
|
|
432
251
|
}
|
|
433
|
-
/**
|
|
434
|
-
* Swell to `factor` times the node's size and settle back: a nudge of the
|
|
435
|
-
* eye toward it. It ends as it began, so nothing after it needs restating.
|
|
436
|
-
*
|
|
437
|
-
* @example
|
|
438
|
-
* node.pulse({ data: { factor: 1.3 }, duration: 0.6 });
|
|
439
|
-
*/
|
|
252
|
+
/** Swell to `factor` times the size and settle back; ends as it began. */
|
|
440
253
|
pulse(args) {
|
|
441
254
|
const rest = this.scale;
|
|
442
255
|
const factor = args.data?.factor ?? 1.2;
|
|
443
256
|
return this.command((t) => ({ scale: rest * (1 + (factor - 1) * Math.sin(Math.PI * t)) }), args.duration, args.easing);
|
|
444
257
|
}
|
|
445
|
-
/**
|
|
446
|
-
* Rock about the node's own turn, `angle` degrees each way for `turns`
|
|
447
|
-
* swings, building up and dying away. It ends as it began.
|
|
448
|
-
*
|
|
449
|
-
* @example
|
|
450
|
-
* node.wiggle({ data: { angle: 10, turns: 4 }, duration: 0.8 });
|
|
451
|
-
*/
|
|
258
|
+
/** Rock about the node's own turn, `angle` degrees each way for `turns` swings, building up and dying away; ends as it began. */
|
|
452
259
|
wiggle(args) {
|
|
453
260
|
const rest = this.rotation;
|
|
454
261
|
const angle = args.data?.angle ?? 8;
|
|
455
262
|
const turns = args.data?.turns ?? 3;
|
|
456
263
|
return this.command((t) => ({ rotation: rest + angle * Math.sin(2 * Math.PI * turns * t) * Math.sin(Math.PI * t) }), args.duration, args.easing);
|
|
457
264
|
}
|
|
458
|
-
/** Animate the `effects` stack to another one. */
|
|
459
265
|
effectTo(args) {
|
|
460
266
|
return this.to({ data: _stated(args.data), duration: args.duration, easing: args.easing });
|
|
461
267
|
}
|
|
462
|
-
// ---- Layout queries ---------------------------------------------------
|
|
463
268
|
get measuredWidth() {
|
|
464
269
|
return this.layoutBounds.width;
|
|
465
270
|
}
|
|
466
271
|
get measuredHeight() {
|
|
467
272
|
return this.layoutBounds.height;
|
|
468
273
|
}
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
// recomputes on every read — so a callback built from them is always current.
|
|
274
|
+
// Alignment points: getters read `layoutBounds` and x/y/rotation, and a bound prop recomputes on every read,
|
|
275
|
+
// so a callback built from them stays current.
|
|
472
276
|
/** Rotate offset (ox, oy) by this node's rotation (degrees clockwise) around the node center. */
|
|
473
277
|
_rotateOffset(ox, oy) {
|
|
474
278
|
const o = this._offset();
|
|
@@ -511,35 +315,15 @@ export class Node2D extends Node {
|
|
|
511
315
|
const r = this.layoutBounds;
|
|
512
316
|
return this._rotateOffset(r.width / 2, 0);
|
|
513
317
|
}
|
|
514
|
-
//
|
|
515
|
-
//
|
|
516
|
-
// global counterparts below fold in the full ancestor chain so a node can be
|
|
517
|
-
// aligned to another regardless of where each sits in the tree:
|
|
518
|
-
// new Rect({ x: () => other().global.x, y: () => other().global.y })
|
|
519
|
-
// Each read walks this node's and every ancestor's live
|
|
520
|
-
// layout/x/y/rotation/scale/pivot props, so a binding over them stays current.
|
|
318
|
+
// Global (world-space) transform: unlike the parent-relative alignment getters above, these fold in the full
|
|
319
|
+
// ancestor chain. Each read walks live props, so a binding over them stays current.
|
|
521
320
|
/**
|
|
522
|
-
* This node's local transform in canvas (y-down) space
|
|
523
|
-
*
|
|
524
|
-
* {@link worldMatrix}, and the matrix every world-space *reading* of the node
|
|
525
|
-
* comes from: {@link global}, `runtime/node-picking.ts`, and so any editor
|
|
526
|
-
* overlay drawn on top of a scene.
|
|
321
|
+
* This node's local transform in canvas (y-down) space; {@link worldMatrix} composes it up the chain, and
|
|
322
|
+
* every world-space reading comes from it ({@link global}, `runtime/node-picking.ts`, editor overlays).
|
|
527
323
|
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
531
|
-
* matrix, but goes on measuring, reporting and hit-testing as the upright
|
|
532
|
-
* rectangle it was — see {@link applyTransform}.
|
|
533
|
-
*
|
|
534
|
-
* That is a choice, not an oversight. Everything that reads a node's box
|
|
535
|
-
* reads it to put a handle on: a selection outline, a resize grip, a rotation
|
|
536
|
-
* dial, `other.global.topRight` as an alignment target. Those all mean
|
|
537
|
-
* something on a rectangle and stop meaning it on a trapezoid — a "width"
|
|
538
|
-
* handle on a foreshortened edge does not correspond to any number, and a
|
|
539
|
-
* corner that has swung behind the viewer has no screen position at all.
|
|
540
|
-
* Letting the projection through would make the tilt a thing that quietly
|
|
541
|
-
* breaks every other tool in the editor; keeping the geometry flat makes it
|
|
542
|
-
* exactly what it looks like, a way of drawing the node.
|
|
324
|
+
* Deliberately flat: a node that mirrors or tilts is painted through a projected matrix (see
|
|
325
|
+
* {@link applyTransform}) but measures and hit-tests as its upright rectangle, because handles, outlines and
|
|
326
|
+
* alignment targets mean nothing on a trapezoid (a foreshortened "width" edge, a corner behind the viewer).
|
|
543
327
|
*/
|
|
544
328
|
/** @internal Composed with the camera scopes in between by `runtime/node-picking.ts`. */
|
|
545
329
|
_localMatrix() {
|
|
@@ -551,38 +335,26 @@ export class Node2D extends Node {
|
|
|
551
335
|
}
|
|
552
336
|
const cx = (r?.x ?? 0) + ox;
|
|
553
337
|
const cy = (r?.y ?? 0) - oy;
|
|
554
|
-
//
|
|
555
|
-
// No projection: see the note above for why a node's *geometry* stays
|
|
556
|
-
// flat while its paint does not.
|
|
338
|
+
// No projection: geometry stays flat while paint does not (see above).
|
|
557
339
|
return localMatrix(cx, cy, this.rotation, this.scale, this._transformOrigin(), r?.width ?? 0, r?.height ?? 0);
|
|
558
340
|
}
|
|
559
341
|
/** @internal The slot {@link _placementOf} puts this node in, from its parent. */
|
|
560
342
|
_placement() {
|
|
561
343
|
return this.parent2D?._placementOf(this) ?? null;
|
|
562
344
|
}
|
|
563
|
-
/**
|
|
564
|
-
* The slot this node places `child` in beyond its layout box, or `null` —
|
|
565
|
-
* the default — when the box says it all. A layout that turns, scales or
|
|
566
|
-
* fades each of its children answers here, and the renderer, picking and
|
|
567
|
-
* `global` all follow. See {@link ChildPlacement}.
|
|
568
|
-
*/
|
|
345
|
+
/** The slot this node places `child` in beyond its layout box, or `null` when the box says it all. The renderer, picking and `global` follow it. See {@link ChildPlacement}. */
|
|
569
346
|
/** @internal */
|
|
570
347
|
_placementOf(_child) {
|
|
571
348
|
return null;
|
|
572
349
|
}
|
|
573
|
-
/**
|
|
574
|
-
* The coordinates `child`'s `x`/`y` are in, or `null` — the default — when
|
|
575
|
-
* they are pixels. A `null` child asks for one that is not here yet: where
|
|
576
|
-
* a host would drop or paste it. See {@link ChildPlane}.
|
|
577
|
-
*/
|
|
350
|
+
/** The coordinates `child`'s `x`/`y` are in, or `null` for pixels. A `null` child asks for a not-yet-added one (where a host would drop or paste it). See {@link ChildPlane}. */
|
|
578
351
|
/** @internal */
|
|
579
352
|
_planeOf(_child) {
|
|
580
353
|
return null;
|
|
581
354
|
}
|
|
582
355
|
/**
|
|
583
|
-
* Where its own layout would centre a child of `size
|
|
584
|
-
*
|
|
585
|
-
* or a grid (the run decides) or has not laid any out.
|
|
356
|
+
* Where its own layout would centre a not-yet-added child of `size`, y-down from its centre; `null` when it
|
|
357
|
+
* arranges children in a run or grid (the run decides) or has laid none out.
|
|
586
358
|
*/
|
|
587
359
|
/** @internal */
|
|
588
360
|
_slotFor(size) {
|
|
@@ -590,11 +362,7 @@ export class Node2D extends Node {
|
|
|
590
362
|
const box = space ? flowOps.freeSlot(space.settings, space.inner, size) : null;
|
|
591
363
|
return space && box ? { x: space.inner.x + box.x, y: space.inner.y - box.y } : null;
|
|
592
364
|
}
|
|
593
|
-
/**
|
|
594
|
-
* Where its centre sits from the point its `x`/`y` place, in its parent's
|
|
595
|
-
* frame, y-down, at `rotation` and `scale`: what turning or scaling about an
|
|
596
|
-
* off-centre pivot adds.
|
|
597
|
-
*/
|
|
365
|
+
/** Where its centre sits from the point `x`/`y` place, in the parent's frame (y-down), at `rotation` and `scale`: what turning about an off-centre pivot adds. */
|
|
598
366
|
/** @internal */
|
|
599
367
|
_centreShift(rotation = this.rotation, scale = this.scale) {
|
|
600
368
|
const r = this.layoutBounds;
|
|
@@ -612,11 +380,7 @@ export class Node2D extends Node {
|
|
|
612
380
|
return null;
|
|
613
381
|
}
|
|
614
382
|
_offsetScratch = { x: 0, y: 0 };
|
|
615
|
-
/**
|
|
616
|
-
* This node's `x`/`y` as the pixel offset its parent sees. Every position
|
|
617
|
-
* read goes through here, which is what keeps paint, picking and `global`
|
|
618
|
-
* agreeing under a {@link ChildPlane}. The result is reused: read it at once.
|
|
619
|
-
*/
|
|
383
|
+
/** `x`/`y` as the pixel offset the parent sees; every position read goes through here so paint, picking and `global` agree under a {@link ChildPlane}. The result is reused: read it at once. */
|
|
620
384
|
/** @internal */
|
|
621
385
|
_offset() {
|
|
622
386
|
const plane = this.parent2D?._planeOf(this);
|
|
@@ -628,9 +392,8 @@ export class Node2D extends Node {
|
|
|
628
392
|
return o;
|
|
629
393
|
}
|
|
630
394
|
/**
|
|
631
|
-
* The flat part of this node's slot
|
|
632
|
-
*
|
|
633
|
-
* no slot. With `paint`, the slot's tilt as well, which only paint sees.
|
|
395
|
+
* The flat part of this node's slot: the layout box's centre turned and scaled by the slot, or `null` with
|
|
396
|
+
* no slot. With `paint`, also the slot's tilt, which only paint sees.
|
|
634
397
|
*/
|
|
635
398
|
/** @internal Also the plane `runtime/node-picking.ts` drags a placed node across. */
|
|
636
399
|
_slotMatrix(paint = false) {
|
|
@@ -648,26 +411,17 @@ export class Node2D extends Node {
|
|
|
648
411
|
const r = this.layoutBounds;
|
|
649
412
|
return nodeSpaceMatrix(r?.x ?? 0, r?.y ?? 0, slot.rotation, slot.scale, 0, 0, slotProjection(slot));
|
|
650
413
|
}
|
|
651
|
-
/**
|
|
652
|
-
* The point this node's transform turns about, normalised: `transformOrigin`
|
|
653
|
-
* where one is set, the alignment-derived `pivot` otherwise. One resolution,
|
|
654
|
-
* read by {@link _localMatrix} and {@link applyTransform} alike.
|
|
655
|
-
*/
|
|
414
|
+
/** `transformOrigin` where set, else the alignment-derived `pivot`; read by {@link _localMatrix} and {@link applyTransform} alike. */
|
|
656
415
|
_transformOrigin() {
|
|
657
416
|
return this.transformOrigin ?? this.pivot;
|
|
658
417
|
}
|
|
659
|
-
// Reused
|
|
660
|
-
//
|
|
661
|
-
// Projection3D read it synchronously and never retain it.
|
|
418
|
+
// Reused like `_transformScratch`: `_localMatrix` runs per ancestor per `global` read, and the Projection3D
|
|
419
|
+
// consumers read it synchronously without retaining it.
|
|
662
420
|
_projectionScratch = {
|
|
663
421
|
rotationX: 0, rotationY: 0, rotationZ: 0, depth: 0, perspective: 0,
|
|
664
422
|
flipHorizontal: false, flipVertical: false,
|
|
665
423
|
};
|
|
666
|
-
/**
|
|
667
|
-
* This node's out-of-plane fields, gathered for the matrix builders — and for
|
|
668
|
-
* the backface test. A space root overrides it, because its 3D props aim the
|
|
669
|
-
* camera rather than turn the root.
|
|
670
|
-
*/
|
|
424
|
+
/** Out-of-plane fields for the matrix builders and the backface test. A space root overrides it: its 3D props aim the camera rather than turn the root. */
|
|
671
425
|
_projection() {
|
|
672
426
|
const p = this._projectionScratch;
|
|
673
427
|
p.rotationX = this.rotationX;
|
|
@@ -692,49 +446,23 @@ export class Node2D extends Node {
|
|
|
692
446
|
}
|
|
693
447
|
return nodeSpaceMatrix((r?.x ?? 0) + ox, (r?.y ?? 0) - oy, this.rotation, this.scale, origin.x * (width / 2), -origin.y * (height / 2), this._projection());
|
|
694
448
|
}
|
|
695
|
-
/**
|
|
696
|
-
* This node's full transform in canvas (y-down) world space — the product of
|
|
697
|
-
* every ancestor's local matrix from the root down to this node. Walks the
|
|
698
|
-
* live parent chain on every call, reading each node's transform props.
|
|
699
|
-
*/
|
|
449
|
+
/** Product of every ancestor's local matrix, root down; walks the live parent chain per call. */
|
|
700
450
|
worldMatrix() {
|
|
701
451
|
const local = this._localMatrix();
|
|
702
452
|
const parent = this.parent2D;
|
|
703
453
|
return parent ? multiply(parent.worldMatrix(), local) : local;
|
|
704
454
|
}
|
|
705
455
|
/**
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* full ancestor chain, so values are absolute scene coordinates rather than
|
|
709
|
-
* parent-relative ones. See {@link WorldTransform}. Every field is reactive.
|
|
710
|
-
*
|
|
711
|
-
* @example
|
|
712
|
-
* // Read another node's absolute corner, regardless of its parent:
|
|
713
|
-
* const p = other.global.topRight; // world-space {x, y}
|
|
714
|
-
*
|
|
715
|
-
* ### Reading vs. placing
|
|
716
|
-
* `global` is for *reading* world coordinates. `x`/`y` (and the alignment props)
|
|
717
|
-
* are **parent-relative**, so assigning a world value to them does not by
|
|
718
|
-
* itself place this node in world space — it offsets it from this node's own
|
|
719
|
-
* parent. To land exactly on another node regardless of either parent,
|
|
720
|
-
* subtract this node's parent's world contribution:
|
|
721
|
-
*
|
|
722
|
-
* @example
|
|
723
|
-
* // Place this node's origin exactly on `other`, any parent:
|
|
724
|
-
* new Rect({
|
|
725
|
-
* x: () => other.global.x - (myParent.global.x),
|
|
726
|
-
* y: () => other.global.y - (myParent.global.y),
|
|
727
|
-
* });
|
|
456
|
+
* Absolute scene coordinates for the alignment points and metrics, folded through the ancestor chain; every
|
|
457
|
+
* field is reactive. See {@link WorldTransform}.
|
|
728
458
|
*
|
|
729
|
-
*
|
|
730
|
-
* `x: () => other.global.x`
|
|
459
|
+
* For reading only: `x`/`y` are parent-relative, so landing on `other` under a different parent needs
|
|
460
|
+
* `x: () => other.global.x - myParent.global.x` (a shared parent origin needs no compensation).
|
|
731
461
|
*/
|
|
732
462
|
get global() {
|
|
733
463
|
const r = this.layoutBounds;
|
|
734
464
|
const anchors = worldAnchors(this.worldMatrix(), (r?.width ?? 0) / 2, (r?.height ?? 0) / 2);
|
|
735
|
-
//
|
|
736
|
-
// scale and opacity multiply — all match the renderer's nested transforms
|
|
737
|
-
// and its pass-through alpha fold).
|
|
465
|
+
// Rotation sums; scale and opacity multiply, matching the renderer's nested transforms and pass-through alpha fold.
|
|
738
466
|
let rotation = 0;
|
|
739
467
|
let scale = 1;
|
|
740
468
|
let opacity = 1;
|
|
@@ -753,10 +481,7 @@ export class Node2D extends Node {
|
|
|
753
481
|
opacity,
|
|
754
482
|
};
|
|
755
483
|
}
|
|
756
|
-
/**
|
|
757
|
-
* The `x`/`y` that put this node on `anchor` of the node `id` names, in this
|
|
758
|
-
* tree — or `null` when there is no such 2D node here right now.
|
|
759
|
-
*/
|
|
484
|
+
/** The `x`/`y` that put this node on `anchor` of node `id`, or `null` if no such 2D node is here right now. */
|
|
760
485
|
_pointOnNode(id, anchor) {
|
|
761
486
|
const target = findNode2D(this, id);
|
|
762
487
|
if (!target)
|
|
@@ -784,8 +509,7 @@ export class Node2D extends Node {
|
|
|
784
509
|
this._insertChildAt(child, index);
|
|
785
510
|
return;
|
|
786
511
|
}
|
|
787
|
-
// Past the guard
|
|
788
|
-
// off-tree, which only a laid-out node can do.
|
|
512
|
+
// Past the guard this is a 2D child; the animated insert measures it off-tree, which only a laid-out node can do.
|
|
789
513
|
return addChildAtAnimated(this, child, index, args.duration, args.easing);
|
|
790
514
|
}
|
|
791
515
|
removeChildAt(args) {
|
|
@@ -804,28 +528,18 @@ export class Node2D extends Node {
|
|
|
804
528
|
}
|
|
805
529
|
return removeChildAtAnimated(this, index, args.duration, args.easing);
|
|
806
530
|
}
|
|
807
|
-
//
|
|
808
|
-
// Reused each frame so applyTransform doesn't allocate a fresh descriptor
|
|
809
|
-
// per node per frame. ctx.transform reads it synchronously and never retains
|
|
810
|
-
// it, so a single mutated instance is safe.
|
|
531
|
+
// Reused per frame so applyTransform doesn't allocate a descriptor per node per frame; ctx.transform reads it synchronously and never retains it.
|
|
811
532
|
_transformScratch = {
|
|
812
533
|
x: 0, y: 0, width: 0, height: 0,
|
|
813
534
|
scale: 1, rotation: 0, opacity: 1, blend: 'pass-through',
|
|
814
535
|
effects: [], pivot: { x: 0, y: 0 },
|
|
815
536
|
};
|
|
816
|
-
//
|
|
817
|
-
//
|
|
818
|
-
//
|
|
819
|
-
//
|
|
820
|
-
//
|
|
821
|
-
|
|
822
|
-
// runs before the frame's generator.next(), x/y here hold the *previous*
|
|
823
|
-
// frame's value, so the velocity trails the rendered position by one frame;
|
|
824
|
-
// the lag is constant and identical forward vs. scrub. Layout-dependent
|
|
825
|
-
// fields (rects) can't be resolved here — layout hasn't run for advanced-
|
|
826
|
-
// but-unrendered frames — so renderState() fills those in at draw time,
|
|
827
|
-
// leaving the motion fields untouched.
|
|
828
|
-
/** Rolling history for the backward-difference velocity estimate. Allocated once (not per frame); mutated in place by {@link _sampleMotion}. */
|
|
537
|
+
// Motion (velocity/direction/speed/angular/scale) is sampled once per frame from ellapse() as a backward
|
|
538
|
+
// difference, on every advanced frame (not just rendered ones) so velocity stays right through a scrub.
|
|
539
|
+
// ellapse() runs before the frame's generator.next(), so x/y hold the previous frame's value: velocity trails
|
|
540
|
+
// the rendered position by one constant frame. Layout-dependent fields (rects) can't resolve here, since layout
|
|
541
|
+
// hasn't run for advanced-but-unrendered frames; renderState() fills them at draw time.
|
|
542
|
+
/** Allocated once; mutated in place by {@link _sampleMotion}. */
|
|
829
543
|
_motionHistory = createMotionHistory();
|
|
830
544
|
/** Reused per-node state handed to `ctx.begin()` (mirrors `_transformScratch`). */
|
|
831
545
|
_renderState = {
|
|
@@ -840,19 +554,13 @@ export class Node2D extends Node {
|
|
|
840
554
|
scaleVelocity: 0,
|
|
841
555
|
};
|
|
842
556
|
/**
|
|
843
|
-
*
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
* `0 < dt <= MAX` is trusted, so a scrub that resets the clock reads as
|
|
848
|
-
* "unknown" rather than a spurious huge velocity). The world position
|
|
849
|
-
* matches {@link applyTransform} (`layoutBounds + x`, `layoutBounds - y`,
|
|
850
|
-
* y-down). Called via {@link _sample} every frame; layout-dependent fields
|
|
851
|
-
* (`rects`/`elapsed`) are filled in by {@link renderState} at draw time.
|
|
557
|
+
* Computes motion into {@link _renderState} as a backward difference against the previous frame, then rolls the
|
|
558
|
+
* history. Velocity is zero when no trustworthy delta exists (first frame, or a non-monotonic time jump: only
|
|
559
|
+
* `0 < dt <= MAX` is trusted, so a scrub doesn't read as a huge velocity). World position matches
|
|
560
|
+
* {@link applyTransform} (y-down).
|
|
852
561
|
*/
|
|
853
562
|
_sampleMotion() {
|
|
854
|
-
//
|
|
855
|
-
// the backward-difference math lives in sampleMotion (no per-frame alloc).
|
|
563
|
+
// Reactive world position (y-down, as applyTransform); the math lives in sampleMotion (no per-frame alloc).
|
|
856
564
|
const r = this.layoutBounds;
|
|
857
565
|
const o = this._offset();
|
|
858
566
|
const x = (r?.x ?? 0) + o.x;
|
|
@@ -860,18 +568,9 @@ export class Node2D extends Node {
|
|
|
860
568
|
sampleMotion(this._renderState, this._motionHistory, x, y, this.rotation, this.scale, this._time.total);
|
|
861
569
|
}
|
|
862
570
|
/**
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
866
|
-
* that path is untouched: the backend translates, rotates and scales exactly
|
|
867
|
-
* as it always has. A node that mirrors or tilts hands over a precomposed
|
|
868
|
-
* {@link TransformState.matrix} instead, built by the same `localMatrix`
|
|
869
|
-
* {@link _localMatrix} calls — with the out-of-plane half switched on.
|
|
870
|
-
*
|
|
871
|
-
* **This is the one place that half is applied.** The mirrors and the tilt
|
|
872
|
-
* are paint, not geometry: the node goes on measuring and hit-testing as the
|
|
873
|
-
* upright rectangle it was, and only what is drawn is projected. See
|
|
874
|
-
* {@link _localMatrix} for why.
|
|
571
|
+
* Pushes this node's transform. A node in its own plane passes the decomposed fields; one that mirrors or tilts
|
|
572
|
+
* passes a precomposed {@link TransformState.matrix}. This is the one place the out-of-plane half is applied:
|
|
573
|
+
* mirrors and tilt are paint, not geometry (see {@link _localMatrix}).
|
|
875
574
|
*/
|
|
876
575
|
applyTransform(ctx) {
|
|
877
576
|
const r = this.layoutBounds;
|
|
@@ -910,54 +609,24 @@ export class Node2D extends Node {
|
|
|
910
609
|
renderSelf(ctx) { }
|
|
911
610
|
/** What the node paints over its children, clipped to its silhouette: the root's overlay. */
|
|
912
611
|
renderOverlay(ctx) { }
|
|
913
|
-
/**
|
|
914
|
-
* This node's outline as a {@link Clip}: the boundary `clip` confines its
|
|
915
|
-
* children to, and the silhouette its backdrop effects are confined to.
|
|
916
|
-
* `null` (the default) is no outline, so its children render unclipped and
|
|
917
|
-
* it gets no backdrop effects. A component answers with the shape its
|
|
918
|
-
* `render` paints.
|
|
919
|
-
*/
|
|
612
|
+
/** Outline as a {@link Clip}: confines children when `clip` is set and bounds backdrop effects. `null` (default) is no outline. A component answers with the shape its `render` paints. */
|
|
920
613
|
clipSelf() { return null; }
|
|
921
614
|
/**
|
|
922
|
-
* The camera scope this node
|
|
923
|
-
*
|
|
924
|
-
* `
|
|
925
|
-
* opens one — so a consumer can reproduce the renderer's transform *and* its
|
|
926
|
-
* viewport clip without knowing which types have a camera.
|
|
927
|
-
*
|
|
928
|
-
* Read by `runtime/node-picking.ts`: a camera is applied at render time only,
|
|
929
|
-
* so it is not part of {@link worldMatrix}, and a node's on-screen box would
|
|
930
|
-
* be offset without it. `@internal`.
|
|
615
|
+
* The camera scope pushed around this node's children (`beginCamera`), or `null`; non-null exactly when the node
|
|
616
|
+
* opens one, so a consumer can reproduce the renderer's transform and viewport clip. Read by
|
|
617
|
+
* `runtime/node-picking.ts`: a camera applies at render time only, so it isn't part of {@link worldMatrix}.
|
|
931
618
|
*/
|
|
932
619
|
/** @internal */
|
|
933
620
|
_cameraScope() { return null; }
|
|
934
|
-
/**
|
|
935
|
-
* The camera this node opens a 2.5D space with, or `null` when it opens none.
|
|
936
|
-
* Only a space root overrides it: its children, and theirs, are then placed
|
|
937
|
-
* in one 3D frame and seen through this camera. See `node-space.ts`.
|
|
938
|
-
*/
|
|
621
|
+
/** The camera this node opens a 2.5D space with, or `null`; only a space root overrides it. See `node-space.ts`. */
|
|
939
622
|
/** @internal */
|
|
940
623
|
_spaceCamera() { return null; }
|
|
941
|
-
/**
|
|
942
|
-
* Whether this node hands its children on into the space it sits in. False
|
|
943
|
-
* for a node that composites its children itself — a mask, a boolean, a
|
|
944
|
-
* nested camera — which flattens its subtree into its own plane, where the
|
|
945
|
-
* per-node 3D rules apply again. Picking reads it; the renderer gets the same
|
|
946
|
-
* answer because such a node never reaches the base {@link renderChildren}.
|
|
947
|
-
*/
|
|
624
|
+
/** Whether children pass on into the space this node sits in. False for a node that composites its children itself (mask, boolean, nested camera), flattening them into its own plane. Picking reads it; the renderer agrees because such a node never reaches the base {@link renderChildren}. */
|
|
948
625
|
/** @internal */
|
|
949
626
|
_rendersChildrenInSpace() { return true; }
|
|
950
627
|
/** @internal Set by the parent for the length of this node's render while it is inside a space. */
|
|
951
628
|
_spaceFrame = null;
|
|
952
|
-
/**
|
|
953
|
-
* Whether the renderer confines this node's children to its own box — either
|
|
954
|
-
* because `clip` is set *and* the node has an outline to clip to (a bare
|
|
955
|
-
* `clip` with no {@link clipSelf} is a no-op, see {@link applyClip}), or
|
|
956
|
-
* because it opens a camera scope, which clips to the viewport rect.
|
|
957
|
-
*
|
|
958
|
-
* Read by `runtime/node-picking.ts`: a point outside a confining node cannot
|
|
959
|
-
* hit anything inside it, so the whole subtree is skipped. `@internal`.
|
|
960
|
-
*/
|
|
629
|
+
/** Whether the renderer confines children to this node's box: `clip` set with an outline to clip to (a bare `clip` without {@link clipSelf} is a no-op, see {@link applyClip}), or a camera scope clipping to the viewport. Picking skips a whole subtree outside a confining node. */
|
|
961
630
|
/** @internal */
|
|
962
631
|
_confinesChildren() {
|
|
963
632
|
if (this._cameraScope() !== null)
|
|
@@ -968,17 +637,9 @@ export class Node2D extends Node {
|
|
|
968
637
|
return clip !== null && !clip.isEmpty();
|
|
969
638
|
}
|
|
970
639
|
/**
|
|
971
|
-
* Whether `local`
|
|
972
|
-
*
|
|
973
|
-
*
|
|
974
|
-
*
|
|
975
|
-
* The default is the layout box, which is the right answer for containers,
|
|
976
|
-
* text, and media: their box *is* their extent. A component narrows it to
|
|
977
|
-
* the outline its `render` paints.
|
|
978
|
-
*
|
|
979
|
-
* `tolerance` is grab-slop, applied outward. An editor passes its
|
|
980
|
-
* zoom-corrected pixel slop so the grab area stays constant on screen
|
|
981
|
-
* regardless of preview zoom.
|
|
640
|
+
* Whether `local` (node-centred, y-up, rotation and scale removed) is inside the node within `tolerance` scene
|
|
641
|
+
* units of its edge, applied outward as grab-slop (an editor passes a zoom-corrected value). Defaults to the
|
|
642
|
+
* layout box; a component narrows it to the outline its `render` paints.
|
|
982
643
|
*/
|
|
983
644
|
hitTestSelf(local, tolerance) {
|
|
984
645
|
const b = this._localBounds();
|
|
@@ -986,22 +647,10 @@ export class Node2D extends Node {
|
|
|
986
647
|
&& Math.abs(local.y - b.y) <= b.height / 2 + tolerance;
|
|
987
648
|
}
|
|
988
649
|
/**
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
* The returned {@link BoxBounds} is **y-up and relative to the node's own
|
|
994
|
-
* centre**: `x`/`y` are where the ink's centre sits relative to the node,
|
|
995
|
-
* normally `(0, 0)`. That is a different space from `layoutBounds`, which is
|
|
996
|
-
* the same type but canvas y-down and relative to the parent — see
|
|
997
|
-
* `BoxBounds`, which deliberately does not encode a space.
|
|
998
|
-
*
|
|
999
|
-
* Defaults to the layout box, centred on the node, which is right for every
|
|
1000
|
-
* node whose drawing fills its cell. It is a separate seam from the layout
|
|
1001
|
-
* rect because for some nodes the two genuinely differ: a boolean group or
|
|
1002
|
-
* a mask is drawn where its children's ink is, which can be both a different
|
|
1003
|
-
* size *and* off-centre from its own cell. A component's `bounds` answers
|
|
1004
|
-
* here, fixing the box and the grab region together without perturbing layout.
|
|
650
|
+
* Extent of the node's ink in its own space, **y-up and relative to the node's centre** (unlike `layoutBounds`,
|
|
651
|
+
* canvas y-down relative to the parent): what an editor boxes and the default {@link hitTestSelf} grabs.
|
|
652
|
+
* Defaults to the layout box. Separate from the layout rect because a boolean group or mask draws where its
|
|
653
|
+
* children's ink is, possibly off-centre; a component's `bounds` answers here without perturbing layout.
|
|
1005
654
|
*/
|
|
1006
655
|
/** @internal */
|
|
1007
656
|
_localBounds() {
|
|
@@ -1011,12 +660,7 @@ export class Node2D extends Node {
|
|
|
1011
660
|
_hitTestSelf(local, tolerance) {
|
|
1012
661
|
return this.hitTestSelf(local, tolerance);
|
|
1013
662
|
}
|
|
1014
|
-
/**
|
|
1015
|
-
* Open `clipSelf()`'s outline as a clip scope, confining whatever is drawn
|
|
1016
|
-
* until the matching `ctx.endClip()` to the shape. Returns `true` when a
|
|
1017
|
-
* clip was actually opened (so the caller knows to close it) and `false`
|
|
1018
|
-
* when the node has no outline (the default).
|
|
1019
|
-
*/
|
|
663
|
+
/** Opens `clipSelf()`'s outline as a clip scope; returns whether one was opened (so the caller closes it). */
|
|
1020
664
|
applyClip(ctx) {
|
|
1021
665
|
const clip = this.clipSelf();
|
|
1022
666
|
if (!clip || clip.isEmpty())
|
|
@@ -1024,42 +668,21 @@ export class Node2D extends Node {
|
|
|
1024
668
|
ctx.beginClip(clip);
|
|
1025
669
|
return true;
|
|
1026
670
|
}
|
|
1027
|
-
/**
|
|
1028
|
-
* Apply backdrop effects (any `mode: "backdrop"` effect — blur, grayscale, …;
|
|
1029
|
-
* plus magnify and backdrop shader) beneath this node, clipped to its
|
|
1030
|
-
* silhouette, before the node's own content is drawn — so the content
|
|
1031
|
-
* underneath is filtered/warped while the node's own edges stay sharp. One
|
|
1032
|
-
* backdrop effect scope, confined to the silhouette clip, runs the lot; the
|
|
1033
|
-
* renderer routes each effect to a filter or shader pass. A no-op for nodes
|
|
1034
|
-
* without a {@link clipSelf} outline (there's no silhouette to confine to).
|
|
1035
|
-
*/
|
|
671
|
+
/** Backdrop effects (blur, magnify, backdrop shader, ...) beneath the node, confined to its silhouette, so content underneath is filtered while the node's own edges stay sharp. One scope runs them all; no-op without a {@link clipSelf} outline. */
|
|
1036
672
|
applyBackdropEffects(ctx) {
|
|
1037
673
|
const effects = this.effects;
|
|
1038
|
-
// Bail before building the silhouette
|
|
1039
|
-
// immediately when there are no backdrop effects, but by then `clipSelf()`
|
|
1040
|
-
// has already allocated a Clip and its op list for a node that will never
|
|
1041
|
-
// use it — and a node with no effects at all is the overwhelmingly common
|
|
1042
|
-
// case, so that allocation was pure waste on nearly every node, every frame.
|
|
674
|
+
// Bail before building the silhouette: `clipSelf()` allocates a Clip and op list, and a node with no effects is the overwhelmingly common case.
|
|
1043
675
|
if (effects.length === 0)
|
|
1044
676
|
return;
|
|
1045
677
|
applyBackdropEffectsImpl(ctx, effects, this.clipSelf(), this.layoutBounds?.width ?? 0, this.layoutBounds?.height ?? 0);
|
|
1046
678
|
}
|
|
1047
|
-
/**
|
|
1048
|
-
* Run `body` (this node's own painting + children) inside the node's effect
|
|
1049
|
-
* scopes, so effects behave identically however a node draws. The caller
|
|
1050
|
-
* has already pushed the node's transform ({@link applyTransform}).
|
|
1051
|
-
* Outermost-first: {@link applyBackdropEffects} beneath the node, confined
|
|
1052
|
-
* to its {@link clipSelf} silhouette, then a `foreground` effect scope
|
|
1053
|
-
* capturing everything `body` paints.
|
|
1054
|
-
*/
|
|
679
|
+
/** Runs `body` (own painting + children) inside the effect scopes, outermost first: {@link applyBackdropEffects} beneath the node, then a `foreground` scope capturing everything `body` paints. The caller has already pushed {@link applyTransform}. */
|
|
1055
680
|
renderContentWithEffects(ctx, body) {
|
|
1056
681
|
this.applyBackdropEffects(ctx);
|
|
1057
682
|
applyContentEffectScope(ctx, this.effects, this.layoutBounds?.width ?? 0, this.layoutBounds?.height ?? 0, body);
|
|
1058
683
|
}
|
|
1059
684
|
renderChildren(ctx) {
|
|
1060
|
-
// A node opening
|
|
1061
|
-
// plane, whatever space it sits in — the same answer picking's
|
|
1062
|
-
// `spaceFrameOf` gives, which asks for a camera before anything else.
|
|
685
|
+
// A node opening its own space flattens its subtree into its own plane, whatever space it sits in (as picking's `spaceFrameOf` does, checking for a camera first).
|
|
1063
686
|
const camera = this._spaceCamera();
|
|
1064
687
|
if (camera) {
|
|
1065
688
|
this._renderInSpace(ctx, spaceRootFrame(this, camera));
|
|
@@ -1074,12 +697,7 @@ export class Node2D extends Node {
|
|
|
1074
697
|
if (child instanceof Node2D)
|
|
1075
698
|
child.render(ctx);
|
|
1076
699
|
}
|
|
1077
|
-
/**
|
|
1078
|
-
* Paint the children placed in `frame`, far to near rather than in authored
|
|
1079
|
-
* order — each with its frame set for exactly the length of its own render,
|
|
1080
|
-
* so a node reached any other way (a mask's children, a `Tex.surface`
|
|
1081
|
-
* source) draws flat.
|
|
1082
|
-
*/
|
|
700
|
+
/** Paints children placed in `frame` far to near, each with its frame set only for its own render, so a node reached any other way (a mask's children, a `Tex.surface` source) draws flat. */
|
|
1083
701
|
/** @internal A space root opens its space through this. */
|
|
1084
702
|
_renderInSpace(ctx, frame) {
|
|
1085
703
|
const children = [];
|
|
@@ -1114,66 +732,33 @@ export class Node2D extends Node {
|
|
|
1114
732
|
ctx.endClip();
|
|
1115
733
|
}
|
|
1116
734
|
}
|
|
1117
|
-
/**
|
|
1118
|
-
* This node's per-frame render state, resolved for the scope {@link render}
|
|
1119
|
-
* is about to open.
|
|
1120
|
-
*
|
|
1121
|
-
* Motion was already sampled when the clock advanced; only the
|
|
1122
|
-
* layout-dependent fields are filled in here, where layout is current.
|
|
1123
|
-
*/
|
|
735
|
+
/** Per-frame render state for the scope {@link render} opens. Motion was sampled when the clock advanced; only layout-dependent fields are filled here. */
|
|
1124
736
|
renderState(ctx) {
|
|
1125
737
|
const s = this._renderState;
|
|
1126
|
-
// Skipped
|
|
1127
|
-
// precomp pass walks every node's render every frame purely to discover
|
|
1128
|
-
// assets, and this is an object allocation per node per frame that nothing
|
|
1129
|
-
// there would ever read.
|
|
738
|
+
// Skipped when the context never resolves `space:'parent'` fills: the precomp pass walks every node purely to discover assets, so this would be a per-node per-frame allocation nothing reads.
|
|
1130
739
|
s.rects = ctx.readsSpaceRects ? this._spaceRects() : NO_SPACE_RECTS;
|
|
1131
740
|
s.elapsed = this._time.elapsed;
|
|
1132
741
|
return s;
|
|
1133
742
|
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Reference rects for fills with `space:'parent'`, expressed in this node's
|
|
1136
|
-
* local space (origin = this node's positioned centre, y-down to match the
|
|
1137
|
-
* canvas). The viewport (`space:'global'`) is resolved by the renderer, which
|
|
1138
|
-
* knows the surface size. Rotation/scale of this node are not folded in —
|
|
1139
|
-
* the rect is the axis-aligned parent box, which is what gradients expect.
|
|
1140
|
-
*/
|
|
743
|
+
/** Reference rects for `space:'parent'` fills, in this node's local space (origin at its positioned centre, y-down). The viewport (`space:'global'`) is the renderer's job. This node's rotation/scale aren't folded in: the rect is the axis-aligned parent box, which gradients expect. */
|
|
1141
744
|
_spaceRects() {
|
|
1142
745
|
const o = this._offset();
|
|
1143
746
|
return computeSpaceRects(this.parent2D?.layoutBounds, this.layoutBounds, o.x, o.y);
|
|
1144
747
|
}
|
|
1145
|
-
/**
|
|
1146
|
-
* Draw this node and its subtree: the skip checks, then this node's draw
|
|
1147
|
-
* scope around {@link renderContent}.
|
|
1148
|
-
*
|
|
1149
|
-
* Takes a {@link RenderPass2D} rather than a bare {@link RenderContext2D}
|
|
1150
|
-
* because opening this node's draw scope is *this* method's job; what it
|
|
1151
|
-
* calls is handed the narrower surface, so nothing below can open one.
|
|
1152
|
-
*/
|
|
748
|
+
/** Draws this node and its subtree: skip checks, then this node's draw scope around {@link renderContent}. Takes a {@link RenderPass2D} because opening the scope is this method's job; callees get the narrower surface so nothing below can open one. */
|
|
1153
749
|
render(ctx) {
|
|
1154
|
-
// Not in the tree ⇒ no box, no surface, nothing to draw.
|
|
1155
750
|
if (!this.mounted)
|
|
1156
751
|
return;
|
|
1157
|
-
// A
|
|
1158
|
-
//
|
|
1159
|
-
//
|
|
1160
|
-
// gutter, and every cross-fade spends its first and last frames here.
|
|
1161
|
-
//
|
|
1162
|
-
// `drawsVisibleOnly` is false on the tracking walk, which must still
|
|
1163
|
-
// descend — an invisible node's font and images have to be discovered or
|
|
1164
|
-
// they will not have loaded by the time it fades in. See the flag's doc.
|
|
752
|
+
// A zero-opacity subtree paints nothing, so a visible-only context needn't walk it (a chart's reserved-gutter axis,
|
|
753
|
+
// cross-fades). `drawsVisibleOnly` is false on the tracking walk, which must still descend so an invisible
|
|
754
|
+
// node's fonts and images are discovered before it fades in.
|
|
1165
755
|
if (ctx.drawsVisibleOnly && this.opacity * (this._placement()?.opacity ?? 1) <= 0)
|
|
1166
756
|
return;
|
|
1167
|
-
// Hidden by the editor
|
|
1168
|
-
// tracking walk still descends, or a node hidden and shown again would
|
|
1169
|
-
// come back before its fonts and images had been discovered.
|
|
757
|
+
// Hidden by the editor; same tracking-walk exemption, so a node hidden then shown has its assets discovered.
|
|
1170
758
|
if (ctx.drawsVisibleOnly && this.hidden)
|
|
1171
759
|
return;
|
|
1172
|
-
//
|
|
1173
|
-
//
|
|
1174
|
-
// exemption for the tracking pass, which still has to discover the assets
|
|
1175
|
-
// of a card that is currently face-down and will be face-up in a moment.
|
|
1176
|
-
// In a space the camera decides which way a node faces, not its own tilt.
|
|
760
|
+
// Past edge-on and declining to show its back paints nothing either (same tracking-walk exemption: a face-down
|
|
761
|
+
// card's assets must still be discovered). In a space the camera decides facing, not the node's own tilt.
|
|
1177
762
|
const frame = this._spaceFrame;
|
|
1178
763
|
if (ctx.drawsVisibleOnly && !this.backfaceVisible && this._facesAway(frame))
|
|
1179
764
|
return;
|
|
@@ -1197,16 +782,11 @@ export class Node2D extends Node {
|
|
|
1197
782
|
throw error;
|
|
1198
783
|
}
|
|
1199
784
|
}
|
|
1200
|
-
/**
|
|
1201
|
-
* Everything this node paints: its transform, its effect envelope, its own
|
|
1202
|
-
* drawing, its children and its overlay. A component's `render` replaces it,
|
|
1203
|
-
* keeping every guard {@link render} performs above it.
|
|
1204
|
-
*/
|
|
785
|
+
/** Everything this node paints: transform, effect envelope, own drawing, children, overlay. A component's `render` replaces it, keeping every guard {@link render} performs above it. */
|
|
1205
786
|
renderContent(ctx) {
|
|
1206
787
|
this.applyTransform(ctx);
|
|
1207
788
|
const frame = this._spaceFrame;
|
|
1208
|
-
// Edge-on or behind the lens:
|
|
1209
|
-
// draw it on, but its children are placed by frames of their own.
|
|
789
|
+
// Edge-on or behind the lens: no plane of its own, but its children are placed by frames of their own.
|
|
1210
790
|
if (frame && !frame.paints) {
|
|
1211
791
|
this.renderChildren(ctx);
|
|
1212
792
|
return;
|
|
@@ -1214,9 +794,7 @@ export class Node2D extends Node {
|
|
|
1214
794
|
const cut = frame?.nearCut ?? null;
|
|
1215
795
|
this.renderContentWithEffects(ctx, () => {
|
|
1216
796
|
this._paintInFront(ctx, cut, () => this.renderSelf(ctx));
|
|
1217
|
-
//
|
|
1218
|
-
// skipped when the node has no outline (clipped === false) so the
|
|
1219
|
-
// endClip() below stays balanced.
|
|
797
|
+
// Built once from clipSelf(); `clipped` is false with no outline, keeping endClip() balanced.
|
|
1220
798
|
const clipped = this.clip && this.applyClip(ctx);
|
|
1221
799
|
this.renderChildren(ctx);
|
|
1222
800
|
if (clipped)
|
|
@@ -1231,25 +809,13 @@ export class Node2D extends Node {
|
|
|
1231
809
|
const p = this._projection();
|
|
1232
810
|
return facesAway(p.rotationX, p.rotationY);
|
|
1233
811
|
}
|
|
1234
|
-
// ---- Layout -----------------------------------------------------------
|
|
1235
812
|
/** What {@link measure} hands {@link layoutChildren} within a pass; consumed there. */
|
|
1236
813
|
_flowMeasure = null;
|
|
1237
|
-
/**
|
|
1238
|
-
* The content box its children were last placed in, y-down from this
|
|
1239
|
-
* node's centre, and the flow that placed them: what {@link _slotFor}
|
|
1240
|
-
* answers from. A component's flow layout records it too (`Flow.layout`).
|
|
1241
|
-
*/
|
|
814
|
+
/** The content box children were last placed in (y-down from this node's centre) and the flow that placed them; what {@link _slotFor} answers from. A component's flow layout records it too (`Flow.layout`). */
|
|
1242
815
|
/** @internal */
|
|
1243
816
|
_childSpace = null;
|
|
1244
817
|
_flowWarned = false;
|
|
1245
|
-
/**
|
|
1246
|
-
* Record this node's allocated bounds without touching children.
|
|
1247
|
-
*
|
|
1248
|
-
* Compared field by field, because every caller builds a fresh object literal,
|
|
1249
|
-
* so identity always differs — including on every frame of a node that is
|
|
1250
|
-
* simply sitting still. Skipping the write keeps the object stable for the
|
|
1251
|
-
* aliasing reason below.
|
|
1252
|
-
*/
|
|
818
|
+
/** Records the allocated bounds without touching children. Compared field by field (callers build fresh literals, so identity always differs, even for a node sitting still) to keep the object stable for the aliasing reason below. */
|
|
1253
819
|
setLayoutBounds(rect) {
|
|
1254
820
|
const current = this._layoutBounds.get();
|
|
1255
821
|
if (current.x === rect.x
|
|
@@ -1257,25 +823,14 @@ export class Node2D extends Node {
|
|
|
1257
823
|
&& current.width === rect.width
|
|
1258
824
|
&& current.height === rect.height)
|
|
1259
825
|
return;
|
|
1260
|
-
// Stores the
|
|
1261
|
-
//
|
|
1262
|
-
// `computeSpaceRects` and to bound anchor computations, and mutating it
|
|
1263
|
-
// under them would be an aliasing change none of them could see coming.
|
|
826
|
+
// Stores the new object rather than mutating: `layoutBounds` is handed to its public reader, `computeSpaceRects`
|
|
827
|
+
// and bound anchors, and mutating it would alias under all of them.
|
|
1264
828
|
this._layoutBounds.set(rect);
|
|
1265
829
|
}
|
|
1266
|
-
/**
|
|
1267
|
-
* The children this node lays out itself — its 2D children, minus the hidden
|
|
1268
|
-
* ones. Every measure and layout pass in a container iterates *this*, not
|
|
1269
|
-
* `children`.
|
|
1270
|
-
*
|
|
1271
|
-
* Returns the live array untouched in the common case, so an ordinary tree
|
|
1272
|
-
* allocates nothing per pass.
|
|
1273
|
-
*/
|
|
830
|
+
/** Children this node lays out itself: its 2D children minus hidden ones. Measure and layout iterate this, not `children`. Returns the live array when nothing is filtered, so an ordinary tree allocates nothing per pass. */
|
|
1274
831
|
flowChildren() {
|
|
1275
832
|
const children = this._children;
|
|
1276
|
-
// Only a hidden child
|
|
1277
|
-
// flow, and both are rare enough to be worth checking for before
|
|
1278
|
-
// allocating.
|
|
833
|
+
// Only a hidden child, or a 3D child under a `Canvas3D`, leaves the flow; both rare enough to check before allocating.
|
|
1279
834
|
let i = 0;
|
|
1280
835
|
for (; i < children.length; i++) {
|
|
1281
836
|
const child = children[i];
|
|
@@ -1284,38 +839,22 @@ export class Node2D extends Node {
|
|
|
1284
839
|
}
|
|
1285
840
|
if (i === children.length)
|
|
1286
841
|
return children;
|
|
1287
|
-
// A hidden child gives up its cell
|
|
1288
|
-
// `visibility: hidden`. Leaving the slot would put a hole in a row
|
|
1289
|
-
// wherever someone folded a layer away.
|
|
842
|
+
// A hidden child gives up its cell and its gap (`display: none`, not `visibility: hidden`).
|
|
1290
843
|
return children.filter((c) => c instanceof Node2D && !c.hidden);
|
|
1291
844
|
}
|
|
1292
|
-
/**
|
|
1293
|
-
* The inset children are laid out within. A node with a stroke to clear adds
|
|
1294
|
-
* the part of it that intrudes (see `Paint.inset`).
|
|
1295
|
-
*/
|
|
845
|
+
/** The inset children are laid out within; a node with a stroke to clear adds the part that intrudes (see `Paint.inset`). */
|
|
1296
846
|
effectivePadding() {
|
|
1297
847
|
return this.padding;
|
|
1298
848
|
}
|
|
1299
|
-
/**
|
|
1300
|
-
* How this node arranges its children: centred freeform. The root answers
|
|
1301
|
-
* with its own layout props; a component lays its children out with `Flow`.
|
|
1302
|
-
*/
|
|
849
|
+
/** Centred freeform by default. The root answers with its layout props; a component lays children out with `Flow`. */
|
|
1303
850
|
flowArrangement() {
|
|
1304
851
|
return DEFAULT_FLOW;
|
|
1305
852
|
}
|
|
1306
|
-
/** Record `rect`, then place the flow children in it — see {@link layoutChildren}. */
|
|
1307
853
|
layout(rect, scope) {
|
|
1308
854
|
this.setLayoutBounds(rect);
|
|
1309
855
|
this.layoutChildren(rect, scope);
|
|
1310
856
|
}
|
|
1311
|
-
/**
|
|
1312
|
-
* Place the flow children in `rect`'s content box by {@link flowArrangement}.
|
|
1313
|
-
*
|
|
1314
|
-
* Reuses what {@link measure} found when the box is the one it measured in —
|
|
1315
|
-
* or, on an axis that hugs, exactly what it hugged — and measures again
|
|
1316
|
-
* otherwise: a parent laying this node out at a size it did not measure it
|
|
1317
|
-
* for would leave the children arranged for the wrong box.
|
|
1318
|
-
*/
|
|
857
|
+
/** Places flow children in `rect`'s content box by {@link flowArrangement}. Reuses {@link measure}'s result when the box is the one it measured in (or exactly what an axis hugged), else re-measures: a box the node wasn't measured for would leave the children arranged wrong. */
|
|
1319
858
|
layoutChildren(rect, scope) {
|
|
1320
859
|
const pending = this._flowMeasure;
|
|
1321
860
|
this._flowMeasure = null;
|
|
@@ -1333,8 +872,7 @@ export class Node2D extends Node {
|
|
|
1333
872
|
hugWidth: this.width === "hug",
|
|
1334
873
|
hugHeight: this.height === "hug",
|
|
1335
874
|
}, scope);
|
|
1336
|
-
//
|
|
1337
|
-
// from this node's.
|
|
875
|
+
// Boxes are y-up from the content box's centre; a layout rect is y-down from this node's.
|
|
1338
876
|
const boxes = flowOps.place(measured, settings, inner);
|
|
1339
877
|
for (let i = 0; i < boxes.length; i++) {
|
|
1340
878
|
const box = boxes[i];
|
|
@@ -1348,14 +886,7 @@ export class Node2D extends Node {
|
|
|
1348
886
|
this._flowWarned = true;
|
|
1349
887
|
console.warn(`[motionscript] "${this.className}" ${warning}`);
|
|
1350
888
|
}
|
|
1351
|
-
/**
|
|
1352
|
-
* Resolve `width`/`height`, measuring the flow children by
|
|
1353
|
-
* {@link flowArrangement}: a `'hug'` axis wraps what they come to, plus this
|
|
1354
|
-
* node's padding. What it finds is kept for {@link layoutChildren}.
|
|
1355
|
-
*
|
|
1356
|
-
* Only flow children are measured: a canvas-pinned child is sized against the
|
|
1357
|
-
* canvas, so hugging it would shrink-wrap a box this node never contains.
|
|
1358
|
-
*/
|
|
889
|
+
/** Resolves `width`/`height`: a `'hug'` axis wraps the flow children (by {@link flowArrangement}) plus padding; the result is kept for {@link layoutChildren}. Only flow children are measured: a canvas-pinned child is sized against the canvas, so hugging it would wrap a box this node never contains. */
|
|
1359
890
|
measure(constraints, scope) {
|
|
1360
891
|
this.lastMeasure = { constraints, measurer: scope };
|
|
1361
892
|
const padding = this.effectivePadding();
|
|
@@ -1405,9 +936,7 @@ declareMembers(Node2D, {
|
|
|
1405
936
|
default: undefined,
|
|
1406
937
|
// `null` is unset too: a document read back from JSON has no `undefined`.
|
|
1407
938
|
mapper: (v) => (v == null ? undefined : alignmentOps.resolve(v)),
|
|
1408
|
-
// Tweening
|
|
1409
|
-
// there is no point to travel from, and snapping to the target's own
|
|
1410
|
-
// start is the one reading that isn't an invented one.
|
|
939
|
+
// Tweening into an origin from "none" starts where it ends: there is no point to travel from.
|
|
1411
940
|
tween: (from, to, t) => alignmentOps.lerp(from ?? to ?? ORIGIN_2D, to ?? ORIGIN_2D, t),
|
|
1412
941
|
}),
|
|
1413
942
|
clip: property({ default: false }),
|
|
@@ -1467,10 +996,7 @@ function findUnder(at, id) {
|
|
|
1467
996
|
}
|
|
1468
997
|
return null;
|
|
1469
998
|
}
|
|
1470
|
-
/**
|
|
1471
|
-
* Where `node`'s frame sits in `host`'s, wherever each is in the tree: its
|
|
1472
|
-
* centre as an offset (y-up) from `host`'s, and its turn and scale relative to it.
|
|
1473
|
-
*/
|
|
999
|
+
/** Where `node`'s frame sits in `host`'s: its centre as a y-up offset, and its turn and scale relative to it. */
|
|
1474
1000
|
export function frameIn(host, node) {
|
|
1475
1001
|
const there = node.global;
|
|
1476
1002
|
const here = host.global;
|