@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/NOTICE +15 -14
- package/README.md +5 -7
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +7 -5
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.js +11 -0
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.js +6 -0
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.js +10 -0
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.js +10 -0
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.js +10 -0
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +24 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +4 -3
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +24 -31
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +42 -28
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +15 -12
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -10
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +7 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +6 -9
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +24 -145
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +16 -112
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +2 -3
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +96 -409
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +93 -283
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +42 -26
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +4 -2
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +11 -0
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +113 -102
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +3 -7
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +2 -6
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +1 -1
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -6
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-AOT33LMS.js +13 -0
- package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
- package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
- package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +4 -4
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +62 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +38 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +143 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +116 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +543 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +107 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +66 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +347 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +413 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/components/trees/audio/node-audio.d.ts +116 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +171 -0
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -4
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +35 -7
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +9 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +5 -2
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +7 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +2 -1
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +2 -0
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +39 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +41 -21
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +2 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +5 -5
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +48 -4
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +174 -44
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +18 -32
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +18 -6
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +158 -21
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +79 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +31 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -0
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +1 -1
- package/dist/renamed-scene-names.d.ts.map +1 -1
- package/dist/renamed-scene-names.js +1 -1
- package/dist/renamed-scene-names.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +9 -0
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +13 -7
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +9 -3
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/render-context2d.d.ts +3 -3
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +67 -24
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +3 -2
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +8 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +6 -4
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +8 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +34 -37
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +8 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +4 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +15 -5
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +7 -3
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +11 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +2 -2
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +50 -44
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +35 -29
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +14 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +3 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +2 -0
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +4 -0
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/index.d.ts +3 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +2 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +3 -11
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-picking3d.js","sourceRoot":"","sources":["../../src/runtime/node-picking3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,EAAiB,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAqB,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACH,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,GACrE,MA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E,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QAClC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACrC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACpC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC5B,MAAM,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC7B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ;QAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK;QACtB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO;QAC1B,0EAA0E;QAC1E,4EAA4E;QAC5E,MAAM,EAAE,IAAI,CAAC,MAAM;KACtB,CAAC;AACN,CAAC","sourcesContent":["import { Node } from \"@/nodes/node/node\";\r\nimport { Node3D, parentSpaceOf } from \"@/nodes/three/node3d\";\r\nimport type { Node2D } from \"@/nodes/2d/node2d\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { applyToPoint, invert, type Matrix2D } from \"@/attributes/layout/matrix2d\";\r\nimport { resolveCameraPlacement, type CameraData3D } from \"@/render3d/camera\";\r\nimport type { Scene3D, Scene3DOp } from \"@/render3d/scene3d\";\r\nimport type { Transform3D } from \"@/render3d/transform\";\r\nimport {\r\n geometryBounds3D, transformBox3, unionBox3, centeredBox3, corners3, type Box3,\r\n} from \"@/render3d/bounds3d\";\r\nimport {\r\n applyMatrix4, identity4, invert4, lookAtRotation4, multiply4, orthographic4,\r\n perspective4, transformMatrix4, translation4, type Matrix4,\r\n} from \"@/render3d/matrix4\";\r\nimport type { Vector3 } from \"@/render3d/vector3\";\r\nimport { nodePath } from \"@/project/tree\";\r\nimport type { NodeBox } from \"./node-picking\";\r\n\r\n/**\r\n * Where a `Node3D`'s pixels landed — the 3D half of `node-picking.ts`, and the\r\n * reason an editor can put a selection box round a cube at all.\r\n *\r\n * **The answer is a 2D box, deliberately.** A mesh has no rectangle in it: what\r\n * it has is an extent in three dimensions, seen through a camera. So this\r\n * projects the node's world-space AABB into the `Canvas3D`'s own plane and takes\r\n * the **screen-space AABB of the result** — the box that encloses the shape as\r\n * drawn, from wherever the camera happens to be. That is the same box every 3D\r\n * editor draws for the same reason: an oriented box in 3D read as a hexagon on\r\n * screen, and nothing you could grab on it would mean anything in two\r\n * dimensions.\r\n *\r\n * Because it is a 2D box in the canvas's plane, it composes with everything the\r\n * 2D side already does — the canvas's own rotation, its ancestors', a camera\r\n * scope above it — by being handed the canvas's `renderMatrix` and mapped\r\n * through it exactly as {@link nodeBox} maps a node's corners. Nothing here has\r\n * to know what is above the canvas.\r\n *\r\n * **Two walks, joined on the node id.** Bounds come from the recorded\r\n * {@link Scene3D} rather than from the node tree, because the scene is the seam\r\n * everything else goes through (the render and the asset pass both build it) and\r\n * a node that draws through a custom `renderSelf` is measured correctly for\r\n * free. Paths come from the tree, because a path is a child *index* and ops\r\n * don't carry one. The two meet on `Node3D.id`, which the scene records as the\r\n * `key` on every `push`.\r\n *\r\n * **Nothing here imports `node-picking.ts` at runtime.** The canvas's own box\r\n * and CTM arrive as a {@link Canvas3DFrame} parameter instead, so the dependency\r\n * runs one way — the 2D walk reaches into this file and never the reverse. The\r\n * `NodeBox` import is type-only and erased.\r\n *\r\n * Two things a caller should know about what it gets back. A box is **not\r\n * clipped to the viewport**: a mesh that has drifted off the side of its canvas\r\n * reports where it went, even though the 3D pass is confined to the rect and no\r\n * pixels of it are drawn. That is the honest answer for an overlay saying where\r\n * a node is, and it costs the picker nothing — {@link pickIn} only consults this\r\n * file for a point already inside the rect.\r\n *\r\n * And the cost: every entry point here records the scene afresh, so a pick or a\r\n * box walk pays one `buildScene3D()` per viewport it touches. That is the same\r\n * pass the render and the asset declaration each make every frame, and 3D scene\r\n * trees are small, so it is fine at pointer rate — but a host calling\r\n * {@link collectBoxes} on every pointer move over a document full of viewports\r\n * is paying it per viewport per move.\r\n */\r\n\r\n/** What the 2D walk already knows about the canvas, handed down. */\r\n/** @internal */\r\n/** A 2D node over a 3D scene (a `Canvas3D`): its 3D children are picked through the scene it builds. */\r\nexport interface Viewport3D extends Node2D {\r\n _isViewport3D(): boolean;\r\n _scene3D(): Scene3D | null;\r\n}\r\n\r\nexport function isViewport3D(node: unknown): node is Viewport3D {\r\n return typeof (node as Partial<Viewport3D> | null)?._isViewport3D === \"function\" && (node as Viewport3D)._isViewport3D();\r\n}\r\n\r\nexport interface Canvas3DFrame {\r\n /**\r\n * The canvas's own box. Its folded `rotation`/`scale`/`opacity` carry to\r\n * every 3D node inside it — a mesh has none of its own, and what an editor\r\n * needs those for (cursor angles, pixels-per-unit) is a question about the\r\n * plane the box is drawn in.\r\n */\r\n box: NodeBox;\r\n /** `renderMatrix(canvas)` — the canvas's CTM, canvas y-down. */\r\n matrix: Matrix2D;\r\n}\r\n\r\n/**\r\n * Every 3D node's box inside `canvas`, **nearest camera first**.\r\n *\r\n * Depth order rather than draw order, which is the one place this diverges from\r\n * {@link collectBoxes}: a 3D scene has no draw order to speak of (the renderer\r\n * sorts by depth and the depth buffer settles the rest), so \"topmost\" means\r\n * \"nearest\", and a picker walking this list front-to-back gets the node you can\r\n * actually see.\r\n *\r\n * Empty when the scene has no camera that resolves, when the canvas has no size,\r\n * or when nothing in it can be measured — see {@link geometryBounds3D} for the\r\n * last of those.\r\n */\r\n/** @internal */\r\nexport function collectBoxes3D(canvas: Viewport3D, frame: Canvas3DFrame, path: string): NodeBox[] {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return [];\r\n\r\n const out: { box: NodeBox; depth: number }[] = [];\r\n for (const entry of nodes3DOf(canvas, path)) {\r\n const world = projection.boxes.get(entry.node.id);\r\n if (!world) continue;\r\n const projected = projectBox3(world, projection);\r\n if (!projected) continue;\r\n out.push({\r\n box: toNodeBox(entry.node, entry.path, projected.rect, frame),\r\n depth: projected.depth,\r\n });\r\n }\r\n // View space looks down −Z, so a nearer node has the larger (less negative)\r\n // z — descending puts the front of the scene first.\r\n out.sort((a, b) => b.depth - a.depth);\r\n return out.map((entry) => entry.box);\r\n}\r\n\r\n/**\r\n * Where a handful of arbitrary points around one `Node3D` land on screen — the\r\n * ingredient a box can't supply for a gizmo.\r\n *\r\n * `origin`, `parentPoints` and `localPoints` all come back in the **same\r\n * viewport space** {@link NodeBox} does, so a caller drawing both together\r\n * (a box for the outline, this for the handles) never has two coordinate\r\n * systems to reconcile. A `null` entry means that point sits behind the\r\n * camera — mirrors {@link projectBox3}'s own eye-plane guard, just per point\r\n * instead of per clipped edge, since there's no box to keep in shape here.\r\n *\r\n * Not `@internal`, unlike {@link projectNode3D} itself: this is what a host\r\n * gets back from `projectNode3DAt`/`PlaybackController.projectNode3D`, the\r\n * same public tier as {@link NodeBox}.\r\n */\r\nexport interface Node3DFrame {\r\n /** The node's own position, projected — a gizmo's pivot. */\r\n origin: Vector2 | null;\r\n /**\r\n * `parentPoints` transformed by the node's **parent's** world matrix, then\r\n * projected, through the parent's own coordinates where it places its\r\n * children by them. The frame `Node3DProps.position` is itself expressed in, so\r\n * this is the space a move or scale handle belongs in: a point named\r\n * `{ ...position, x: position.x + 1 }` projects to where nudging `x` by\r\n * one unit would actually land, with no need to know whether \"one unit\"\r\n * means local or world space at the point of asking.\r\n */\r\n parentPoints: (Vector2 | null)[];\r\n /**\r\n * `localPoints` transformed by the node's **own** world matrix, then\r\n * projected. For geometry that has to track the node's current\r\n * orientation — a rotation ring wrapping the mesh as it's actually\r\n * turned, not as it started.\r\n */\r\n localPoints: (Vector2 | null)[];\r\n}\r\n\r\nconst ORIGIN_3D: Vector3 = { x: 0, y: 0, z: 0 };\r\n\r\n/**\r\n * Project `parentPoints`/`localPoints` for the `Node3D` at `targetPath`\r\n * inside `canvas`, or `null` when the canvas has no projection (see\r\n * {@link canvas3DProjection}) or the path doesn't resolve to a node in it.\r\n *\r\n * `canvasPath` is the canvas's own structural path — the same root\r\n * {@link collectBoxes3D} and {@link pickNode3D} are handed — and `targetPath`\r\n * the node being projected, found the same way {@link nodeBoxAt} finds one\r\n * (`node-picking.ts`, one level up).\r\n */\r\n/** @internal */\r\nexport function projectNode3D(\r\n canvas: Viewport3D,\r\n frame: Canvas3DFrame,\r\n canvasPath: string,\r\n targetPath: string,\r\n parentPoints: readonly Vector3[],\r\n localPoints: readonly Vector3[],\r\n): Node3DFrame | null {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return null;\r\n\r\n const entry = nodes3DOf(canvas, canvasPath).find((e) => e.path === targetPath);\r\n if (!entry) return null;\r\n\r\n const own = projection.matrices.get(entry.node.id);\r\n const parent = projection.parentMatrices.get(entry.node.id);\r\n if (!own || !parent) return null;\r\n\r\n const project = (matrix: Matrix4, points: readonly Vector3[]): (Vector2 | null)[] =>\r\n points.map((point) => projectPoint3(matrix, point, projection, frame));\r\n\r\n // A parent with coordinates of its own places the node by them, so that is the frame its position is in.\r\n const space = parentSpaceOf(entry.node);\r\n const placed = space ? parentPoints.map((point) => space.toLocal(point.x, point.y, point.z)) : parentPoints;\r\n\r\n return {\r\n origin: projectPoint3(own, ORIGIN_3D, projection, frame),\r\n parentPoints: project(parent, placed),\r\n localPoints: project(own, localPoints),\r\n };\r\n}\r\n\r\n/**\r\n * `point` (in whatever space `matrix` maps to world space) projected into\r\n * `frame`'s viewport space, or `null` when it lands behind the camera.\r\n *\r\n * The single-point sibling of {@link projectBox3}: no edges to clip, so a\r\n * point either has a clip-space `w` in front of the eye or it doesn't.\r\n */\r\nfunction projectPoint3(\r\n matrix: Matrix4,\r\n point: Vector3,\r\n projection: Canvas3DProjection,\r\n frame: Canvas3DFrame,\r\n): Vector2 | null {\r\n const world = applyMatrix4(matrix, point);\r\n const clip = applyMatrix4(projection.clip, { x: world.x, y: world.y, z: world.z });\r\n if (clip.w <= MIN_CLIP_W) return null;\r\n\r\n const ndcX = clip.x / clip.w;\r\n const ndcY = clip.y / clip.w;\r\n const rectX = projection.centerX + ndcX * (projection.width / 2);\r\n const rectY = projection.centerY + ndcY * (projection.height / 2);\r\n\r\n const p = applyToPoint(frame.matrix, { x: rectX, y: -rectY });\r\n return { x: p.x, y: -p.y };\r\n}\r\n\r\n/**\r\n * The nearest 3D node in `canvas` whose box contains `point` (viewport space,\r\n * y-up), or `null`.\r\n *\r\n * The box, not the mesh — the module note says why there is no mesh-accurate\r\n * answer to give. `tolerance` is grab-slop in scene units, applied in the\r\n * canvas's own plane so it stays the constant on-screen distance the caller\r\n * quoted it as.\r\n */\r\n/** @internal */\r\nexport function pickNode3D(\r\n canvas: Viewport3D,\r\n frame: Canvas3DFrame,\r\n point: Vector2,\r\n tolerance: number,\r\n path: string,\r\n): NodeBox | null {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return null;\r\n\r\n // Into the canvas's own plane, undoing everything above it in one step —\r\n // the same inverse `containsPoint` takes, with the same y-flips in and out.\r\n const inverse = invert(frame.matrix);\r\n if (!inverse) return null;\r\n const mapped = applyToPoint(inverse, { x: point.x, y: -point.y });\r\n const local = { x: mapped.x, y: -mapped.y };\r\n\r\n let best: { node: Node3D; path: string; rect: Rect2D } | null = null;\r\n let bestDepth = -Infinity;\r\n for (const entry of nodes3DOf(canvas, path)) {\r\n const world = projection.boxes.get(entry.node.id);\r\n if (!world) continue;\r\n const projected = projectBox3(world, projection);\r\n if (!projected) continue;\r\n if (!rectContains(projected.rect, local, tolerance)) continue;\r\n if (projected.depth <= bestDepth) continue;\r\n bestDepth = projected.depth;\r\n best = { node: entry.node, path: entry.path, rect: projected.rect };\r\n }\r\n return best ? toNodeBox(best.node, best.path, best.rect, frame) : null;\r\n}\r\n\r\n// ─── The tree walk: which node is at which path ──────────────────────────────\r\n\r\ninterface Node3DEntry {\r\n node: Node3D;\r\n path: string;\r\n}\r\n\r\n/**\r\n * Every `Node3D` under `canvas`, with the structural path it sits at.\r\n *\r\n * Indexed against {@link Node._allChildren} rather than `children`, so a mesh\r\n * and a HUD label under the same viewport are numbered the way the author wrote\r\n * them — see the accessor's own note for what goes wrong otherwise.\r\n */\r\nfunction nodes3DOf(canvas: Viewport3D, path: string): Node3DEntry[] {\r\n const out: Node3DEntry[] = [];\r\n walk3D(canvas._allChildren, path, out);\r\n return out;\r\n}\r\n\r\nfunction walk3D(children: readonly Node[], parentPath: string, out: Node3DEntry[]): void {\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (!(child instanceof Node3D)) continue;\r\n const path = nodePath(parentPath, i);\r\n out.push({ node: child, path });\r\n walk3D(child._allChildren, path, out);\r\n }\r\n}\r\n\r\n// ─── The op walk: how big each node is, and where it is looked at from ───────\r\n\r\n/** Everything the projection needs, resolved once per call. */\r\ninterface Canvas3DProjection {\r\n /** World-space bounds per `Node3D.id`, each including its subtree. */\r\n boxes: Map<string, Box3>;\r\n /** Each node's own world matrix, per `Node3D.id` — see {@link Node3DFrame}. */\r\n matrices: Map<string, Matrix4>;\r\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\r\n parentMatrices: Map<string, Matrix4>;\r\n /** `projection · view` — world space straight to clip space. */\r\n clip: Matrix4;\r\n /** The view matrix alone, for the depth sort. */\r\n view: Matrix4;\r\n /** The canvas's local rect, which the 3D buffer is stretched onto. */\r\n width: number;\r\n height: number;\r\n centerX: number;\r\n centerY: number;\r\n}\r\n\r\nfunction canvas3DProjection(canvas: Viewport3D): Canvas3DProjection | null {\r\n const bounds = canvas._localBounds();\r\n if (!(bounds.width > 0) || !(bounds.height > 0)) return null;\r\n\r\n const scene = canvas._scene3D();\r\n if (!scene) return null;\r\n const walked = walkScene3D(scene);\r\n if (walked.boxes.size === 0) return null;\r\n\r\n const view = invert4(walked.camera);\r\n if (!view) return null;\r\n\r\n const aspect = bounds.width / bounds.height;\r\n return {\r\n boxes: walked.boxes,\r\n matrices: walked.matrices,\r\n parentMatrices: walked.parentMatrices,\r\n clip: multiply4(projectionMatrix(walked.descriptor, aspect), view),\r\n view,\r\n width: bounds.width,\r\n height: bounds.height,\r\n centerX: bounds.x,\r\n centerY: bounds.y,\r\n };\r\n}\r\n\r\n/** One open `push` scope: where it is, whether it draws, and what it has drawn. */\r\ninterface Scope3D {\r\n key: string | undefined;\r\n matrix: Matrix4;\r\n visible: boolean;\r\n box: Box3 | null;\r\n}\r\n\r\ninterface WalkedScene3D {\r\n boxes: Map<string, Box3>;\r\n /** Each node's own world matrix, per `Node3D.id` — captured at `push`,\r\n * unlike `boxes`, which needs children merged in first at `pop`. */\r\n matrices: Map<string, Matrix4>;\r\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\r\n parentMatrices: Map<string, Matrix4>;\r\n /** The camera's world matrix, or the renderer's own framing when none was set. */\r\n camera: Matrix4;\r\n descriptor: CameraData3D | null;\r\n}\r\n\r\n/**\r\n * Replay the recorded scene, accumulating a world-space box per node.\r\n *\r\n * A node's box is the union of everything it drew and everything its children\r\n * drew, which is what makes a `Group3D` — which draws nothing itself — still\r\n * selectable as the thing it contains.\r\n *\r\n * An invisible scope contributes nothing and is recorded for nobody: `visible:\r\n * false` is a live object the renderer skips, so there are no pixels to put a\r\n * box round, and letting one inflate its parent's box would put that parent's\r\n * box round empty space. The 2D walk skips `opacity: 0` nodes on the same\r\n * grounds.\r\n */\r\nfunction walkScene3D(scene: Scene3D): WalkedScene3D {\r\n const boxes = new Map<string, Box3>();\r\n const matrices = new Map<string, Matrix4>();\r\n const parentMatrices = new Map<string, Matrix4>();\r\n const root: Scope3D = { key: undefined, matrix: identity4(), visible: true, box: null };\r\n const stack: Scope3D[] = [root];\r\n let camera: Matrix4 | null = null;\r\n let descriptor: CameraData3D | null = null;\r\n\r\n const top = (): Scope3D => stack[stack.length - 1];\r\n\r\n for (const op of scene.ops()) {\r\n const scope = top();\r\n switch (op.kind) {\r\n case \"push\": {\r\n const matrix = scopeMatrix(scope.matrix, op.transform);\r\n if (op.transform?.key !== undefined) {\r\n matrices.set(op.transform.key, matrix);\r\n parentMatrices.set(op.transform.key, scope.matrix);\r\n }\r\n stack.push({\r\n key: op.transform?.key,\r\n matrix,\r\n visible: scope.visible && op.transform?.visible !== false,\r\n box: null,\r\n });\r\n break;\r\n }\r\n case \"pop\": {\r\n // The root frame is never popped: `Node3D.render` brackets its own\r\n // begin/end, and `Scene3D.assertBalanced` catches a hand-built\r\n // scene that doesn't. Guarding anyway keeps a malformed op list\r\n // from reading past the bottom of the stack.\r\n if (stack.length === 1) break;\r\n const closed = stack.pop() as Scope3D;\r\n if (!closed.visible || !closed.box) break;\r\n if (closed.key !== undefined) boxes.set(closed.key, closed.box);\r\n const parent = top();\r\n parent.box = unionBox3(parent.box, closed.box);\r\n break;\r\n }\r\n case \"camera\": {\r\n descriptor = op.camera;\r\n camera = cameraMatrix4(op.camera, scope.matrix);\r\n break;\r\n }\r\n case \"light\":\r\n // A light has no extent. A node that is only a light therefore\r\n // gets no box and cannot be picked on the canvas, which is the\r\n // honest answer — there is nothing on screen at its position.\r\n break;\r\n default: {\r\n if (!scope.visible) break;\r\n const drawn = drawableBox3(op, scope.matrix);\r\n if (drawn) scope.box = unionBox3(scope.box, drawn);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n boxes,\r\n matrices,\r\n parentMatrices,\r\n camera: camera ?? DEFAULT_CAMERA_MATRIX,\r\n descriptor,\r\n };\r\n}\r\n\r\n/** A scope's world matrix: the parent's, composed with the node's own placement. */\r\nfunction scopeMatrix(parent: Matrix4, transform: Transform3D | undefined): Matrix4 {\r\n return multiply4(parent, transformMatrix4(transform, parent));\r\n}\r\n\r\n/** The world box a single drawable op contributes, or `null` when it has none. */\r\nfunction drawableBox3(op: Scene3DOp, parent: Matrix4): Box3 | null {\r\n if (op.kind === \"model\") return null; // its extent arrives with the file\r\n if (!(\"transform\" in op)) return null;\r\n\r\n const matrix = scopeMatrix(parent, op.transform);\r\n\r\n if (op.kind === \"sprite\") {\r\n // A sprite is a camera-facing unit quad scaled by its transform — three's\r\n // `Sprite` has no geometry to ask, so this is the one place the extent is\r\n // assumed rather than read.\r\n return transformBox3(centeredBox3(0.5, 0.5, 0), matrix);\r\n }\r\n\r\n if (!(\"geometry\" in op)) return null;\r\n const local = geometryBounds3D(op.geometry);\r\n if (!local) return null;\r\n\r\n if (op.kind === \"instances\") {\r\n // Every instance is placed inside the op's own transform, so the union is\r\n // taken in that space and mapped out once.\r\n let box: Box3 | null = null;\r\n for (const instance of op.instances) {\r\n box = unionBox3(box, transformBox3(local, transformMatrix4(instance, null)));\r\n }\r\n return box ? transformBox3(box, matrix) : null;\r\n }\r\n\r\n return transformBox3(local, matrix);\r\n}\r\n\r\n// ─── The camera ──────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The camera's world matrix.\r\n *\r\n * `lookAt` takes the camera branch of three's `Object3D.lookAt` — **−Z** at the\r\n * target, where every other node aims its +Z — and is resolved against the\r\n * camera's *world* position, so a camera riding inside an animated rig points\r\n * where the author said rather than where its group happens to face. See\r\n * {@link lookAtRotation4}, which the two branches share.\r\n *\r\n * The polar placement (`target`/`orbit`/`elevation`/`distance`) is resolved by\r\n * core's own {@link resolveCameraPlacement} — the same call the renderer makes.\r\n * Two places deriving \"where is the camera\" from one descriptor is two chances to\r\n * disagree about what the author is looking at, and a gizmo drawn against a\r\n * camera nobody renders is worse than no gizmo at all.\r\n */\r\nfunction cameraMatrix4(descriptor: CameraData3D, parent: Matrix4): Matrix4 {\r\n const placement = resolveCameraPlacement(descriptor);\r\n\r\n if (placement.lookAt === undefined) {\r\n return multiply4(parent, transformMatrix4({ ...descriptor, position: placement.position }, parent));\r\n }\r\n const placed = applyMatrix4(parent, placement.position);\r\n const origin: Vector3 = { x: placed.x, y: placed.y, z: placed.z };\r\n return multiply4(translation4(origin), lookAtRotation4(origin, placement.lookAt));\r\n}\r\n\r\n/**\r\n * Where the renderer looks from when a scene declares no camera: pulled back\r\n * along +Z, aimed at the origin. Mirrors `applyCamera`'s own fallback, which is\r\n * what makes a bare `g.box()` render something rather than a black frame — and\r\n * therefore what makes it pickable here.\r\n */\r\nconst DEFAULT_CAMERA_MATRIX: Matrix4 = multiply4(\r\n translation4({ x: 0, y: 0, z: 5 }),\r\n lookAtRotation4({ x: 0, y: 0, z: 5 }, { x: 0, y: 0, z: 0 }),\r\n);\r\n\r\n/** three's default fov when a perspective descriptor omits one. */\r\nconst DEFAULT_FOV = 50;\r\nconst DEFAULT_NEAR = 0.1;\r\nconst DEFAULT_FAR = 1000;\r\n\r\n/** The projection a descriptor asks for, framed to the canvas's aspect. */\r\nfunction projectionMatrix(descriptor: CameraData3D | null, aspect: number): Matrix4 {\r\n if (descriptor === null) {\r\n return perspective4(DEFAULT_FOV, aspect, DEFAULT_NEAR, DEFAULT_FAR, 1);\r\n }\r\n if (descriptor.type === \"perspective\") {\r\n return perspective4(\r\n descriptor.fov ?? DEFAULT_FOV,\r\n // Always the node's own aspect. There is no override any more: it was\r\n // a field whose documentation said not to set it, and setting it\r\n // stretched the render — so a gizmo can only ever have been wrong by\r\n // agreeing with one.\r\n aspect,\r\n descriptor.near ?? DEFAULT_NEAR,\r\n descriptor.far ?? DEFAULT_FAR,\r\n descriptor.zoom ?? 1,\r\n );\r\n }\r\n // `frustumHeight` sets the visible world height and the width follows the\r\n // node's aspect — the same rule `applyCamera` applies, restated rather than\r\n // shared because that one lives in the renderer, which core cannot import.\r\n const halfHeight = (descriptor.frustumHeight ?? 10) / 2;\r\n return orthographic4(\r\n -halfHeight * aspect,\r\n halfHeight * aspect,\r\n halfHeight,\r\n -halfHeight,\r\n descriptor.near ?? DEFAULT_NEAR,\r\n descriptor.far ?? DEFAULT_FAR,\r\n descriptor.zoom ?? 1,\r\n );\r\n}\r\n\r\n// ─── Projection ──────────────────────────────────────────────────────────────\r\n\r\n/** An axis-aligned rect in the canvas's own plane, y-up. */\r\ninterface Rect2D {\r\n minX: number;\r\n minY: number;\r\n maxX: number;\r\n maxY: number;\r\n}\r\n\r\n/** The twelve edges of {@link corners3}'s eight corners, as index pairs. */\r\nconst BOX_EDGES: readonly (readonly [number, number])[] = [\r\n [0, 1], [2, 3], [4, 5], [6, 7],\r\n [0, 2], [1, 3], [4, 6], [5, 7],\r\n [0, 4], [1, 5], [2, 6], [3, 7],\r\n];\r\n\r\n/**\r\n * Smallest `w` a projected point may have before it counts as behind the camera.\r\n * A point at `w = 0` is on the plane through the eye and projects to infinity.\r\n */\r\nconst MIN_CLIP_W = 1e-4;\r\n\r\n/**\r\n * How far outside the canvas a projected box is allowed to reach, as a multiple\r\n * of the canvas's own size.\r\n *\r\n * A box straddling the eye plane genuinely does extend to the horizon, and the\r\n * arithmetic says so — a corner a millimetre in front of the camera projects\r\n * thousands of units out. That is the right answer and a useless one: the host\r\n * draws this, and an overlay rectangle a million pixels wide is a rendering\r\n * problem rather than a selection. Clamping keeps the box pointing the right way\r\n * while it is mostly off-screen, and it is only ever reached in the case where\r\n * the box is already unusable as a target.\r\n */\r\nconst OFFSCREEN_LIMIT = 8;\r\n\r\n/**\r\n * The world box projected into the canvas's plane, plus its view-space depth.\r\n *\r\n * The **edges** are clipped rather than the corners being clamped: a box with\r\n * one corner behind the eye has that corner's projection reflected through the\r\n * origin, so bounding the raw eight would produce a box on the wrong side of the\r\n * screen. Clipping each edge where it crosses the eye plane gives the visible\r\n * span and nothing else. Entirely-behind boxes drop out with no edges surviving,\r\n * which is how a node behind the camera stops being selectable.\r\n */\r\nfunction projectBox3(\r\n world: Box3,\r\n projection: Canvas3DProjection,\r\n): { rect: Rect2D; depth: number } | null {\r\n const corners = corners3(world);\r\n const clip = corners.map((corner) => applyMatrix4(projection.clip, corner));\r\n\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n let any = false;\r\n\r\n const include = (x: number, y: number, w: number) => {\r\n const ndcX = x / w;\r\n const ndcY = y / w;\r\n if (ndcX < minX) minX = ndcX;\r\n if (ndcY < minY) minY = ndcY;\r\n if (ndcX > maxX) maxX = ndcX;\r\n if (ndcY > maxY) maxY = ndcY;\r\n any = true;\r\n };\r\n\r\n for (const [a, b] of BOX_EDGES) {\r\n const p = clip[a];\r\n const q = clip[b];\r\n const pIn = p.w > MIN_CLIP_W;\r\n const qIn = q.w > MIN_CLIP_W;\r\n if (!pIn && !qIn) continue;\r\n if (pIn) include(p.x, p.y, p.w);\r\n if (qIn) include(q.x, q.y, q.w);\r\n if (pIn === qIn) continue;\r\n // Exactly one end is in front: cut the edge where `w` reaches the plane.\r\n const t = (MIN_CLIP_W - p.w) / (q.w - p.w);\r\n include(p.x + (q.x - p.x) * t, p.y + (q.y - p.y) * t, MIN_CLIP_W);\r\n }\r\n\r\n if (!any) return null;\r\n\r\n const halfWidth = projection.width / 2;\r\n const halfHeight = projection.height / 2;\r\n const limitX = halfWidth * OFFSCREEN_LIMIT;\r\n const limitY = halfHeight * OFFSCREEN_LIMIT;\r\n\r\n const rect: Rect2D = {\r\n minX: clamp(projection.centerX + minX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\r\n maxX: clamp(projection.centerX + maxX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\r\n minY: clamp(projection.centerY + minY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\r\n maxY: clamp(projection.centerY + maxY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\r\n };\r\n\r\n // Depth is taken at the box centre in view space, where the camera looks down\r\n // −Z: a nearer node has the larger value. One point rather than eight,\r\n // because what this orders is \"which of two overlapping nodes did you mean\",\r\n // and their centres answer that as well as their nearest corners would.\r\n const centre: Vector3 = {\r\n x: (world.min.x + world.max.x) / 2,\r\n y: (world.min.y + world.max.y) / 2,\r\n z: (world.min.z + world.max.z) / 2,\r\n };\r\n const viewed = applyMatrix4(projection.view, centre);\r\n\r\n return { rect, depth: viewed.z };\r\n}\r\n\r\nfunction clamp(value: number, low: number, high: number): number {\r\n return value < low ? low : value > high ? high : value;\r\n}\r\n\r\n/** Whether `point` (canvas-local, y-up) lands in `rect`, widened by `slop`. */\r\nfunction rectContains(rect: Rect2D, point: Vector2, slop: number): boolean {\r\n return point.x >= rect.minX - slop\r\n && point.x <= rect.maxX + slop\r\n && point.y >= rect.minY - slop\r\n && point.y <= rect.maxY + slop;\r\n}\r\n\r\n/**\r\n * The projected rect as a {@link NodeBox}, in viewport space.\r\n *\r\n * The corner mapping is {@link worldAnchors}' — y flipped on the way in and back\r\n * out, because the CTM is canvas y-down while everything either side of it is\r\n * y-up. Doing it here rather than reusing `worldAnchors` is what lets the rect\r\n * keep its own centre: the box is axis-aligned in the canvas's plane but not\r\n * centred on the canvas's origin, and `worldAnchors` maps offsets from wherever\r\n * the matrix already is.\r\n *\r\n * `rotation`, `scale` and `opacity` are the **canvas's**. A mesh has none of its\r\n * own that mean anything in two dimensions — its `rotation` is three angles and\r\n * its opacity is its material's — and what a host reads these for is the plane\r\n * the box was drawn in, which is exactly what the canvas describes.\r\n */\r\nfunction toNodeBox(node: Node3D, path: string, rect: Rect2D, frame: Canvas3DFrame): NodeBox {\r\n const at = (x: number, y: number): Vector2 => {\r\n const p = applyToPoint(frame.matrix, { x, y: -y });\r\n return { x: p.x, y: -p.y };\r\n };\r\n return {\r\n id: node.id,\r\n path,\r\n type: node.className,\r\n topLeft: at(rect.minX, rect.maxY),\r\n topRight: at(rect.maxX, rect.maxY),\r\n bottomRight: at(rect.maxX, rect.minY),\r\n bottomLeft: at(rect.minX, rect.minY),\r\n center: at((rect.minX + rect.maxX) / 2, (rect.minY + rect.maxY) / 2),\r\n width: rect.maxX - rect.minX,\r\n height: rect.maxY - rect.minY,\r\n rotation: frame.box.rotation,\r\n scale: frame.box.scale,\r\n opacity: frame.box.opacity,\r\n // A mesh locks on its own account, not the viewport's — a locked Canvas3D\r\n // is already unpickable above, so reaching here means the viewport is free.\r\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M,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACnD,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,CAAC,CAAC;IACF,OAAO;QACH,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,SAAS;QACpB,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACjC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QAClC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACrC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QACpC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC5B,MAAM,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QAC7B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ;QAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK;QACtB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO;QAC1B,0EAA0E;QAC1E,4EAA4E;QAC5E,MAAM,EAAE,IAAI,CAAC,MAAM;KACtB,CAAC;AACN,CAAC","sourcesContent":["import { Node } from \"@/components/trees/node/node\";\r\nimport { Node3D, parentSpaceOf } from \"@/components/trees/three/node3d\";\r\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { applyToPoint, invert, type Matrix2D } from \"@/attributes/layout/matrix2d\";\r\nimport { resolveCameraPlacement, type CameraData3D } from \"@/render3d/camera\";\r\nimport type { Scene3D, Scene3DOp } from \"@/render3d/scene3d\";\r\nimport type { Transform3D } from \"@/render3d/transform\";\r\nimport {\r\n geometryBounds3D, transformBox3, unionBox3, centeredBox3, corners3, type Box3,\r\n} from \"@/render3d/bounds3d\";\r\nimport {\r\n applyMatrix4, identity4, invert4, lookAtRotation4, multiply4, orthographic4,\r\n perspective4, transformMatrix4, translation4, type Matrix4,\r\n} from \"@/render3d/matrix4\";\r\nimport type { Vector3 } from \"@/render3d/vector3\";\r\nimport { nodePath } from \"@/project/tree\";\r\nimport type { NodeBox } from \"./node-picking\";\r\n\r\n/**\r\n * Where a `Node3D`'s pixels landed — the 3D half of `node-picking.ts`, and the\r\n * reason an editor can put a selection box round a cube at all.\r\n *\r\n * **The answer is a 2D box, deliberately.** A mesh has no rectangle in it: what\r\n * it has is an extent in three dimensions, seen through a camera. So this\r\n * projects the node's world-space AABB into the `Canvas3D`'s own plane and takes\r\n * the **screen-space AABB of the result** — the box that encloses the shape as\r\n * drawn, from wherever the camera happens to be. That is the same box every 3D\r\n * editor draws for the same reason: an oriented box in 3D read as a hexagon on\r\n * screen, and nothing you could grab on it would mean anything in two\r\n * dimensions.\r\n *\r\n * Because it is a 2D box in the canvas's plane, it composes with everything the\r\n * 2D side already does — the canvas's own rotation, its ancestors', a camera\r\n * scope above it — by being handed the canvas's `renderMatrix` and mapped\r\n * through it exactly as {@link nodeBox} maps a node's corners. Nothing here has\r\n * to know what is above the canvas.\r\n *\r\n * **Two walks, joined on the node id.** Bounds come from the recorded\r\n * {@link Scene3D} rather than from the node tree, because the scene is the seam\r\n * everything else goes through (the render and the asset pass both build it) and\r\n * a node that draws through a custom `renderSelf` is measured correctly for\r\n * free. Paths come from the tree, because a path is a child *index* and ops\r\n * don't carry one. The two meet on `Node3D.id`, which the scene records as the\r\n * `key` on every `push`.\r\n *\r\n * **Nothing here imports `node-picking.ts` at runtime.** The canvas's own box\r\n * and CTM arrive as a {@link Canvas3DFrame} parameter instead, so the dependency\r\n * runs one way — the 2D walk reaches into this file and never the reverse. The\r\n * `NodeBox` import is type-only and erased.\r\n *\r\n * Two things a caller should know about what it gets back. A box is **not\r\n * clipped to the viewport**: a mesh that has drifted off the side of its canvas\r\n * reports where it went, even though the 3D pass is confined to the rect and no\r\n * pixels of it are drawn. That is the honest answer for an overlay saying where\r\n * a node is, and it costs the picker nothing — {@link pickIn} only consults this\r\n * file for a point already inside the rect.\r\n *\r\n * And the cost: every entry point here records the scene afresh, so a pick or a\r\n * box walk pays one scene build per viewport it touches. That is the same\r\n * pass the render and the asset declaration each make every frame, and 3D scene\r\n * trees are small, so it is fine at pointer rate — but a host calling\r\n * {@link collectBoxes} on every pointer move over a document full of viewports\r\n * is paying it per viewport per move.\r\n */\r\n\r\n/** What the 2D walk already knows about the canvas, handed down. */\r\n/** @internal */\r\n/** A 2D node over a 3D scene (a `Canvas3D`): its 3D children are picked through the scene it builds. */\r\nexport interface Viewport3D extends Node2D {\r\n _isViewport3D(): boolean;\r\n _scene3D(): Scene3D | null;\r\n}\r\n\r\nexport function isViewport3D(node: unknown): node is Viewport3D {\r\n return typeof (node as Partial<Viewport3D> | null)?._isViewport3D === \"function\" && (node as Viewport3D)._isViewport3D();\r\n}\r\n\r\nexport interface Canvas3DFrame {\r\n /**\r\n * The canvas's own box. Its folded `rotation`/`scale`/`opacity` carry to\r\n * every 3D node inside it — a mesh has none of its own, and what an editor\r\n * needs those for (cursor angles, pixels-per-unit) is a question about the\r\n * plane the box is drawn in.\r\n */\r\n box: NodeBox;\r\n /** `renderMatrix(canvas)` — the canvas's CTM, canvas y-down. */\r\n matrix: Matrix2D;\r\n}\r\n\r\n/**\r\n * Every 3D node's box inside `canvas`, **nearest camera first**.\r\n *\r\n * Depth order rather than draw order, which is the one place this diverges from\r\n * {@link collectBoxes}: a 3D scene has no draw order to speak of (the renderer\r\n * sorts by depth and the depth buffer settles the rest), so \"topmost\" means\r\n * \"nearest\", and a picker walking this list front-to-back gets the node you can\r\n * actually see.\r\n *\r\n * Empty when the scene has no camera that resolves, when the canvas has no size,\r\n * or when nothing in it can be measured — see {@link geometryBounds3D} for the\r\n * last of those.\r\n */\r\n/** @internal */\r\nexport function collectBoxes3D(canvas: Viewport3D, frame: Canvas3DFrame, path: string): NodeBox[] {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return [];\r\n\r\n const out: { box: NodeBox; depth: number }[] = [];\r\n for (const entry of nodes3DOf(canvas, path)) {\r\n const world = projection.boxes.get(entry.node.id);\r\n if (!world) continue;\r\n const projected = projectBox3(world, projection);\r\n if (!projected) continue;\r\n out.push({\r\n box: toNodeBox(entry.node, entry.path, projected.rect, frame),\r\n depth: projected.depth,\r\n });\r\n }\r\n // View space looks down −Z, so a nearer node has the larger (less negative)\r\n // z — descending puts the front of the scene first.\r\n out.sort((a, b) => b.depth - a.depth);\r\n return out.map((entry) => entry.box);\r\n}\r\n\r\n/**\r\n * Where a handful of arbitrary points around one `Node3D` land on screen — the\r\n * ingredient a box can't supply for a gizmo.\r\n *\r\n * `origin`, `parentPoints` and `localPoints` all come back in the **same\r\n * viewport space** {@link NodeBox} does, so a caller drawing both together\r\n * (a box for the outline, this for the handles) never has two coordinate\r\n * systems to reconcile. A `null` entry means that point sits behind the\r\n * camera — mirrors {@link projectBox3}'s own eye-plane guard, just per point\r\n * instead of per clipped edge, since there's no box to keep in shape here.\r\n *\r\n * Not `@internal`, unlike {@link projectNode3D} itself: this is what a host\r\n * gets back from `projectNode3DAt`/`PlaybackController.projectNode3D`, the\r\n * same public tier as {@link NodeBox}.\r\n */\r\nexport interface Node3DFrame {\r\n /** The node's own position, projected — a gizmo's pivot. */\r\n origin: Vector2 | null;\r\n /**\r\n * `parentPoints` transformed by the node's **parent's** world matrix, then\r\n * projected, through the parent's own coordinates where it places its\r\n * children by them. The frame `Node3DProps.position` is itself expressed in, so\r\n * this is the space a move or scale handle belongs in: a point named\r\n * `{ ...position, x: position.x + 1 }` projects to where nudging `x` by\r\n * one unit would actually land, with no need to know whether \"one unit\"\r\n * means local or world space at the point of asking.\r\n */\r\n parentPoints: (Vector2 | null)[];\r\n /**\r\n * `localPoints` transformed by the node's **own** world matrix, then\r\n * projected. For geometry that has to track the node's current\r\n * orientation — a rotation ring wrapping the mesh as it's actually\r\n * turned, not as it started.\r\n */\r\n localPoints: (Vector2 | null)[];\r\n}\r\n\r\nconst ORIGIN_3D: Vector3 = { x: 0, y: 0, z: 0 };\r\n\r\n/**\r\n * Project `parentPoints`/`localPoints` for the `Node3D` at `targetPath`\r\n * inside `canvas`, or `null` when the canvas has no projection (see\r\n * {@link canvas3DProjection}) or the path doesn't resolve to a node in it.\r\n *\r\n * `canvasPath` is the canvas's own structural path — the same root\r\n * {@link collectBoxes3D} and {@link pickNode3D} are handed — and `targetPath`\r\n * the node being projected, found the same way {@link nodeBoxAt} finds one\r\n * (`node-picking.ts`, one level up).\r\n */\r\n/** @internal */\r\nexport function projectNode3D(\r\n canvas: Viewport3D,\r\n frame: Canvas3DFrame,\r\n canvasPath: string,\r\n targetPath: string,\r\n parentPoints: readonly Vector3[],\r\n localPoints: readonly Vector3[],\r\n): Node3DFrame | null {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return null;\r\n\r\n const entry = nodes3DOf(canvas, canvasPath).find((e) => e.path === targetPath);\r\n if (!entry) return null;\r\n\r\n const own = projection.matrices.get(entry.node.id);\r\n const parent = projection.parentMatrices.get(entry.node.id);\r\n if (!own || !parent) return null;\r\n\r\n const project = (matrix: Matrix4, points: readonly Vector3[]): (Vector2 | null)[] =>\r\n points.map((point) => projectPoint3(matrix, point, projection, frame));\r\n\r\n // A parent with coordinates of its own places the node by them, so that is the frame its position is in.\r\n const space = parentSpaceOf(entry.node);\r\n const placed = space ? parentPoints.map((point) => space.toLocal(point.x, point.y, point.z)) : parentPoints;\r\n\r\n return {\r\n origin: projectPoint3(own, ORIGIN_3D, projection, frame),\r\n parentPoints: project(parent, placed),\r\n localPoints: project(own, localPoints),\r\n };\r\n}\r\n\r\n/**\r\n * `point` (in whatever space `matrix` maps to world space) projected into\r\n * `frame`'s viewport space, or `null` when it lands behind the camera.\r\n *\r\n * The single-point sibling of {@link projectBox3}: no edges to clip, so a\r\n * point either has a clip-space `w` in front of the eye or it doesn't.\r\n */\r\nfunction projectPoint3(\r\n matrix: Matrix4,\r\n point: Vector3,\r\n projection: Canvas3DProjection,\r\n frame: Canvas3DFrame,\r\n): Vector2 | null {\r\n const world = applyMatrix4(matrix, point);\r\n const clip = applyMatrix4(projection.clip, { x: world.x, y: world.y, z: world.z });\r\n if (clip.w <= MIN_CLIP_W) return null;\r\n\r\n const ndcX = clip.x / clip.w;\r\n const ndcY = clip.y / clip.w;\r\n const rectX = projection.centerX + ndcX * (projection.width / 2);\r\n const rectY = projection.centerY + ndcY * (projection.height / 2);\r\n\r\n const p = applyToPoint(frame.matrix, { x: rectX, y: -rectY });\r\n return { x: p.x, y: -p.y };\r\n}\r\n\r\n/**\r\n * The nearest 3D node in `canvas` whose box contains `point` (viewport space,\r\n * y-up), or `null`.\r\n *\r\n * The box, not the mesh — the module note says why there is no mesh-accurate\r\n * answer to give. `tolerance` is grab-slop in scene units, applied in the\r\n * canvas's own plane so it stays the constant on-screen distance the caller\r\n * quoted it as.\r\n */\r\n/** @internal */\r\nexport function pickNode3D(\r\n canvas: Viewport3D,\r\n frame: Canvas3DFrame,\r\n point: Vector2,\r\n tolerance: number,\r\n path: string,\r\n): NodeBox | null {\r\n const projection = canvas3DProjection(canvas);\r\n if (!projection) return null;\r\n\r\n // Into the canvas's own plane, undoing everything above it in one step —\r\n // the same inverse `containsPoint` takes, with the same y-flips in and out.\r\n const inverse = invert(frame.matrix);\r\n if (!inverse) return null;\r\n const mapped = applyToPoint(inverse, { x: point.x, y: -point.y });\r\n const local = { x: mapped.x, y: -mapped.y };\r\n\r\n let best: { node: Node3D; path: string; rect: Rect2D } | null = null;\r\n let bestDepth = -Infinity;\r\n for (const entry of nodes3DOf(canvas, path)) {\r\n const world = projection.boxes.get(entry.node.id);\r\n if (!world) continue;\r\n const projected = projectBox3(world, projection);\r\n if (!projected) continue;\r\n if (!rectContains(projected.rect, local, tolerance)) continue;\r\n if (projected.depth <= bestDepth) continue;\r\n bestDepth = projected.depth;\r\n best = { node: entry.node, path: entry.path, rect: projected.rect };\r\n }\r\n return best ? toNodeBox(best.node, best.path, best.rect, frame) : null;\r\n}\r\n\r\n// ─── The tree walk: which node is at which path ──────────────────────────────\r\n\r\ninterface Node3DEntry {\r\n node: Node3D;\r\n path: string;\r\n}\r\n\r\n/**\r\n * Every `Node3D` under `canvas`, with the structural path it sits at.\r\n *\r\n * Indexed against {@link Node._allChildren} rather than `children`, so a mesh\r\n * and a HUD label under the same viewport are numbered the way the author wrote\r\n * them — see the accessor's own note for what goes wrong otherwise.\r\n */\r\nfunction nodes3DOf(canvas: Viewport3D, path: string): Node3DEntry[] {\r\n const out: Node3DEntry[] = [];\r\n walk3D(canvas._allChildren, path, out);\r\n return out;\r\n}\r\n\r\nfunction walk3D(children: readonly Node[], parentPath: string, out: Node3DEntry[]): void {\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (!(child instanceof Node3D)) continue;\r\n const path = nodePath(parentPath, i);\r\n out.push({ node: child, path });\r\n walk3D(child._allChildren, path, out);\r\n }\r\n}\r\n\r\n// ─── The op walk: how big each node is, and where it is looked at from ───────\r\n\r\n/** Everything the projection needs, resolved once per call. */\r\ninterface Canvas3DProjection {\r\n /** World-space bounds per `Node3D.id`, each including its subtree. */\r\n boxes: Map<string, Box3>;\r\n /** Each node's own world matrix, per `Node3D.id` — see {@link Node3DFrame}. */\r\n matrices: Map<string, Matrix4>;\r\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\r\n parentMatrices: Map<string, Matrix4>;\r\n /** `projection · view` — world space straight to clip space. */\r\n clip: Matrix4;\r\n /** The view matrix alone, for the depth sort. */\r\n view: Matrix4;\r\n /** The canvas's local rect, which the 3D buffer is stretched onto. */\r\n width: number;\r\n height: number;\r\n centerX: number;\r\n centerY: number;\r\n}\r\n\r\nfunction canvas3DProjection(canvas: Viewport3D): Canvas3DProjection | null {\r\n const bounds = canvas._localBounds();\r\n if (!(bounds.width > 0) || !(bounds.height > 0)) return null;\r\n\r\n const scene = canvas._scene3D();\r\n if (!scene) return null;\r\n const walked = walkScene3D(scene);\r\n if (walked.boxes.size === 0) return null;\r\n\r\n const view = invert4(walked.camera);\r\n if (!view) return null;\r\n\r\n const aspect = bounds.width / bounds.height;\r\n return {\r\n boxes: walked.boxes,\r\n matrices: walked.matrices,\r\n parentMatrices: walked.parentMatrices,\r\n clip: multiply4(projectionMatrix(walked.descriptor, aspect), view),\r\n view,\r\n width: bounds.width,\r\n height: bounds.height,\r\n centerX: bounds.x,\r\n centerY: bounds.y,\r\n };\r\n}\r\n\r\n/** One open `push` scope: where it is, whether it draws, and what it has drawn. */\r\ninterface Scope3D {\r\n key: string | undefined;\r\n matrix: Matrix4;\r\n visible: boolean;\r\n box: Box3 | null;\r\n}\r\n\r\ninterface WalkedScene3D {\r\n boxes: Map<string, Box3>;\r\n /** Each node's own world matrix, per `Node3D.id` — captured at `push`,\r\n * unlike `boxes`, which needs children merged in first at `pop`. */\r\n matrices: Map<string, Matrix4>;\r\n /** Each node's *parent's* world matrix, keyed by the node's own id. */\r\n parentMatrices: Map<string, Matrix4>;\r\n /** The camera's world matrix, or the renderer's own framing when none was set. */\r\n camera: Matrix4;\r\n descriptor: CameraData3D | null;\r\n}\r\n\r\n/**\r\n * Replay the recorded scene, accumulating a world-space box per node.\r\n *\r\n * A node's box is the union of everything it drew and everything its children\r\n * drew, which is what makes a `Group3D` — which draws nothing itself — still\r\n * selectable as the thing it contains.\r\n *\r\n * An invisible scope contributes nothing and is recorded for nobody: `visible:\r\n * false` is a live object the renderer skips, so there are no pixels to put a\r\n * box round, and letting one inflate its parent's box would put that parent's\r\n * box round empty space. The 2D walk skips `opacity: 0` nodes on the same\r\n * grounds.\r\n */\r\nfunction walkScene3D(scene: Scene3D): WalkedScene3D {\r\n const boxes = new Map<string, Box3>();\r\n const matrices = new Map<string, Matrix4>();\r\n const parentMatrices = new Map<string, Matrix4>();\r\n const root: Scope3D = { key: undefined, matrix: identity4(), visible: true, box: null };\r\n const stack: Scope3D[] = [root];\r\n let camera: Matrix4 | null = null;\r\n let descriptor: CameraData3D | null = null;\r\n\r\n const top = (): Scope3D => stack[stack.length - 1];\r\n\r\n for (const op of scene.ops()) {\r\n const scope = top();\r\n switch (op.kind) {\r\n case \"push\": {\r\n const matrix = scopeMatrix(scope.matrix, op.transform);\r\n if (op.transform?.key !== undefined) {\r\n matrices.set(op.transform.key, matrix);\r\n parentMatrices.set(op.transform.key, scope.matrix);\r\n }\r\n stack.push({\r\n key: op.transform?.key,\r\n matrix,\r\n visible: scope.visible && op.transform?.visible !== false,\r\n box: null,\r\n });\r\n break;\r\n }\r\n case \"pop\": {\r\n // The root frame is never popped: `Node3D.render` brackets its own\r\n // begin/end, and `Scene3D.assertBalanced` catches a hand-built\r\n // scene that doesn't. Guarding anyway keeps a malformed op list\r\n // from reading past the bottom of the stack.\r\n if (stack.length === 1) break;\r\n const closed = stack.pop() as Scope3D;\r\n if (!closed.visible || !closed.box) break;\r\n if (closed.key !== undefined) boxes.set(closed.key, closed.box);\r\n const parent = top();\r\n parent.box = unionBox3(parent.box, closed.box);\r\n break;\r\n }\r\n case \"camera\": {\r\n descriptor = op.camera;\r\n camera = cameraMatrix4(op.camera, scope.matrix);\r\n break;\r\n }\r\n case \"light\":\r\n // A light has no extent. A node that is only a light therefore\r\n // gets no box and cannot be picked on the canvas, which is the\r\n // honest answer — there is nothing on screen at its position.\r\n break;\r\n default: {\r\n if (!scope.visible) break;\r\n const drawn = drawableBox3(op, scope.matrix);\r\n if (drawn) scope.box = unionBox3(scope.box, drawn);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n boxes,\r\n matrices,\r\n parentMatrices,\r\n camera: camera ?? DEFAULT_CAMERA_MATRIX,\r\n descriptor,\r\n };\r\n}\r\n\r\n/** A scope's world matrix: the parent's, composed with the node's own placement. */\r\nfunction scopeMatrix(parent: Matrix4, transform: Transform3D | undefined): Matrix4 {\r\n return multiply4(parent, transformMatrix4(transform, parent));\r\n}\r\n\r\n/** The world box a single drawable op contributes, or `null` when it has none. */\r\nfunction drawableBox3(op: Scene3DOp, parent: Matrix4): Box3 | null {\r\n if (op.kind === \"model\") return null; // its extent arrives with the file\r\n if (!(\"transform\" in op)) return null;\r\n\r\n const matrix = scopeMatrix(parent, op.transform);\r\n\r\n if (op.kind === \"sprite\") {\r\n // A sprite is a camera-facing unit quad scaled by its transform — three's\r\n // `Sprite` has no geometry to ask, so this is the one place the extent is\r\n // assumed rather than read.\r\n return transformBox3(centeredBox3(0.5, 0.5, 0), matrix);\r\n }\r\n\r\n if (!(\"geometry\" in op)) return null;\r\n const local = geometryBounds3D(op.geometry);\r\n if (!local) return null;\r\n\r\n if (op.kind === \"instances\") {\r\n // Every instance is placed inside the op's own transform, so the union is\r\n // taken in that space and mapped out once.\r\n let box: Box3 | null = null;\r\n for (const instance of op.instances) {\r\n box = unionBox3(box, transformBox3(local, transformMatrix4(instance, null)));\r\n }\r\n return box ? transformBox3(box, matrix) : null;\r\n }\r\n\r\n return transformBox3(local, matrix);\r\n}\r\n\r\n// ─── The camera ──────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The camera's world matrix.\r\n *\r\n * `lookAt` takes the camera branch of three's `Object3D.lookAt` — **−Z** at the\r\n * target, where every other node aims its +Z — and is resolved against the\r\n * camera's *world* position, so a camera riding inside an animated rig points\r\n * where the author said rather than where its group happens to face. See\r\n * {@link lookAtRotation4}, which the two branches share.\r\n *\r\n * The polar placement (`target`/`orbit`/`elevation`/`distance`) is resolved by\r\n * core's own {@link resolveCameraPlacement} — the same call the renderer makes.\r\n * Two places deriving \"where is the camera\" from one descriptor is two chances to\r\n * disagree about what the author is looking at, and a gizmo drawn against a\r\n * camera nobody renders is worse than no gizmo at all.\r\n */\r\nfunction cameraMatrix4(descriptor: CameraData3D, parent: Matrix4): Matrix4 {\r\n const placement = resolveCameraPlacement(descriptor);\r\n\r\n if (placement.lookAt === undefined) {\r\n return multiply4(parent, transformMatrix4({ ...descriptor, position: placement.position }, parent));\r\n }\r\n const placed = applyMatrix4(parent, placement.position);\r\n const origin: Vector3 = { x: placed.x, y: placed.y, z: placed.z };\r\n return multiply4(translation4(origin), lookAtRotation4(origin, placement.lookAt));\r\n}\r\n\r\n/**\r\n * Where the renderer looks from when a scene declares no camera: pulled back\r\n * along +Z, aimed at the origin. Mirrors `applyCamera`'s own fallback, which is\r\n * what makes a bare `g.box()` render something rather than a black frame — and\r\n * therefore what makes it pickable here.\r\n */\r\nconst DEFAULT_CAMERA_MATRIX: Matrix4 = multiply4(\r\n translation4({ x: 0, y: 0, z: 5 }),\r\n lookAtRotation4({ x: 0, y: 0, z: 5 }, { x: 0, y: 0, z: 0 }),\r\n);\r\n\r\n/** three's default fov when a perspective descriptor omits one. */\r\nconst DEFAULT_FOV = 50;\r\nconst DEFAULT_NEAR = 0.1;\r\nconst DEFAULT_FAR = 1000;\r\n\r\n/** The projection a descriptor asks for, framed to the canvas's aspect. */\r\nfunction projectionMatrix(descriptor: CameraData3D | null, aspect: number): Matrix4 {\r\n if (descriptor === null) {\r\n return perspective4(DEFAULT_FOV, aspect, DEFAULT_NEAR, DEFAULT_FAR, 1);\r\n }\r\n if (descriptor.type === \"perspective\") {\r\n return perspective4(\r\n descriptor.fov ?? DEFAULT_FOV,\r\n // Always the node's own aspect. There is no override any more: it was\r\n // a field whose documentation said not to set it, and setting it\r\n // stretched the render — so a gizmo can only ever have been wrong by\r\n // agreeing with one.\r\n aspect,\r\n descriptor.near ?? DEFAULT_NEAR,\r\n descriptor.far ?? DEFAULT_FAR,\r\n descriptor.zoom ?? 1,\r\n );\r\n }\r\n // `frustumHeight` sets the visible world height and the width follows the\r\n // node's aspect — the same rule `applyCamera` applies, restated rather than\r\n // shared because that one lives in the renderer, which core cannot import.\r\n const halfHeight = (descriptor.frustumHeight ?? 10) / 2;\r\n return orthographic4(\r\n -halfHeight * aspect,\r\n halfHeight * aspect,\r\n halfHeight,\r\n -halfHeight,\r\n descriptor.near ?? DEFAULT_NEAR,\r\n descriptor.far ?? DEFAULT_FAR,\r\n descriptor.zoom ?? 1,\r\n );\r\n}\r\n\r\n// ─── Projection ──────────────────────────────────────────────────────────────\r\n\r\n/** An axis-aligned rect in the canvas's own plane, y-up. */\r\ninterface Rect2D {\r\n minX: number;\r\n minY: number;\r\n maxX: number;\r\n maxY: number;\r\n}\r\n\r\n/** The twelve edges of {@link corners3}'s eight corners, as index pairs. */\r\nconst BOX_EDGES: readonly (readonly [number, number])[] = [\r\n [0, 1], [2, 3], [4, 5], [6, 7],\r\n [0, 2], [1, 3], [4, 6], [5, 7],\r\n [0, 4], [1, 5], [2, 6], [3, 7],\r\n];\r\n\r\n/**\r\n * Smallest `w` a projected point may have before it counts as behind the camera.\r\n * A point at `w = 0` is on the plane through the eye and projects to infinity.\r\n */\r\nconst MIN_CLIP_W = 1e-4;\r\n\r\n/**\r\n * How far outside the canvas a projected box is allowed to reach, as a multiple\r\n * of the canvas's own size.\r\n *\r\n * A box straddling the eye plane genuinely does extend to the horizon, and the\r\n * arithmetic says so — a corner a millimetre in front of the camera projects\r\n * thousands of units out. That is the right answer and a useless one: the host\r\n * draws this, and an overlay rectangle a million pixels wide is a rendering\r\n * problem rather than a selection. Clamping keeps the box pointing the right way\r\n * while it is mostly off-screen, and it is only ever reached in the case where\r\n * the box is already unusable as a target.\r\n */\r\nconst OFFSCREEN_LIMIT = 8;\r\n\r\n/**\r\n * The world box projected into the canvas's plane, plus its view-space depth.\r\n *\r\n * The **edges** are clipped rather than the corners being clamped: a box with\r\n * one corner behind the eye has that corner's projection reflected through the\r\n * origin, so bounding the raw eight would produce a box on the wrong side of the\r\n * screen. Clipping each edge where it crosses the eye plane gives the visible\r\n * span and nothing else. Entirely-behind boxes drop out with no edges surviving,\r\n * which is how a node behind the camera stops being selectable.\r\n */\r\nfunction projectBox3(\r\n world: Box3,\r\n projection: Canvas3DProjection,\r\n): { rect: Rect2D; depth: number } | null {\r\n const corners = corners3(world);\r\n const clip = corners.map((corner) => applyMatrix4(projection.clip, corner));\r\n\r\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\r\n let any = false;\r\n\r\n const include = (x: number, y: number, w: number) => {\r\n const ndcX = x / w;\r\n const ndcY = y / w;\r\n if (ndcX < minX) minX = ndcX;\r\n if (ndcY < minY) minY = ndcY;\r\n if (ndcX > maxX) maxX = ndcX;\r\n if (ndcY > maxY) maxY = ndcY;\r\n any = true;\r\n };\r\n\r\n for (const [a, b] of BOX_EDGES) {\r\n const p = clip[a];\r\n const q = clip[b];\r\n const pIn = p.w > MIN_CLIP_W;\r\n const qIn = q.w > MIN_CLIP_W;\r\n if (!pIn && !qIn) continue;\r\n if (pIn) include(p.x, p.y, p.w);\r\n if (qIn) include(q.x, q.y, q.w);\r\n if (pIn === qIn) continue;\r\n // Exactly one end is in front: cut the edge where `w` reaches the plane.\r\n const t = (MIN_CLIP_W - p.w) / (q.w - p.w);\r\n include(p.x + (q.x - p.x) * t, p.y + (q.y - p.y) * t, MIN_CLIP_W);\r\n }\r\n\r\n if (!any) return null;\r\n\r\n const halfWidth = projection.width / 2;\r\n const halfHeight = projection.height / 2;\r\n const limitX = halfWidth * OFFSCREEN_LIMIT;\r\n const limitY = halfHeight * OFFSCREEN_LIMIT;\r\n\r\n const rect: Rect2D = {\r\n minX: clamp(projection.centerX + minX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\r\n maxX: clamp(projection.centerX + maxX * halfWidth, projection.centerX - limitX, projection.centerX + limitX),\r\n minY: clamp(projection.centerY + minY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\r\n maxY: clamp(projection.centerY + maxY * halfHeight, projection.centerY - limitY, projection.centerY + limitY),\r\n };\r\n\r\n // Depth is taken at the box centre in view space, where the camera looks down\r\n // −Z: a nearer node has the larger value. One point rather than eight,\r\n // because what this orders is \"which of two overlapping nodes did you mean\",\r\n // and their centres answer that as well as their nearest corners would.\r\n const centre: Vector3 = {\r\n x: (world.min.x + world.max.x) / 2,\r\n y: (world.min.y + world.max.y) / 2,\r\n z: (world.min.z + world.max.z) / 2,\r\n };\r\n const viewed = applyMatrix4(projection.view, centre);\r\n\r\n return { rect, depth: viewed.z };\r\n}\r\n\r\nfunction clamp(value: number, low: number, high: number): number {\r\n return value < low ? low : value > high ? high : value;\r\n}\r\n\r\n/** Whether `point` (canvas-local, y-up) lands in `rect`, widened by `slop`. */\r\nfunction rectContains(rect: Rect2D, point: Vector2, slop: number): boolean {\r\n return point.x >= rect.minX - slop\r\n && point.x <= rect.maxX + slop\r\n && point.y >= rect.minY - slop\r\n && point.y <= rect.maxY + slop;\r\n}\r\n\r\n/**\r\n * The projected rect as a {@link NodeBox}, in viewport space.\r\n *\r\n * The corner mapping is {@link worldAnchors}' — y flipped on the way in and back\r\n * out, because the CTM is canvas y-down while everything either side of it is\r\n * y-up. Doing it here rather than reusing `worldAnchors` is what lets the rect\r\n * keep its own centre: the box is axis-aligned in the canvas's plane but not\r\n * centred on the canvas's origin, and `worldAnchors` maps offsets from wherever\r\n * the matrix already is.\r\n *\r\n * `rotation`, `scale` and `opacity` are the **canvas's**. A mesh has none of its\r\n * own that mean anything in two dimensions — its `rotation` is three angles and\r\n * its opacity is its material's — and what a host reads these for is the plane\r\n * the box was drawn in, which is exactly what the canvas describes.\r\n */\r\nfunction toNodeBox(node: Node3D, path: string, rect: Rect2D, frame: Canvas3DFrame): NodeBox {\r\n const at = (x: number, y: number): Vector2 => {\r\n const p = applyToPoint(frame.matrix, { x, y: -y });\r\n return { x: p.x, y: -p.y };\r\n };\r\n return {\r\n id: node.id,\r\n path,\r\n type: node.className,\r\n topLeft: at(rect.minX, rect.maxY),\r\n topRight: at(rect.maxX, rect.maxY),\r\n bottomRight: at(rect.maxX, rect.minY),\r\n bottomLeft: at(rect.minX, rect.minY),\r\n center: at((rect.minX + rect.maxX) / 2, (rect.minY + rect.maxY) / 2),\r\n width: rect.maxX - rect.minX,\r\n height: rect.maxY - rect.minY,\r\n rotation: frame.box.rotation,\r\n scale: frame.box.scale,\r\n opacity: frame.box.opacity,\r\n // A mesh locks on its own account, not the viewport's — a locked Canvas3D\r\n // is already unpickable above, so reaching here means the viewport is free.\r\n locked: node.locked,\r\n };\r\n}\r\n"]}
|
|
@@ -7,8 +7,8 @@ import { Ticker, TimeCallback } from "../platform/ticker.js";
|
|
|
7
7
|
import { AudioSink } from "../platform/audio-sink.js";
|
|
8
8
|
import { AssetCatalog } from "../assets/catalog.js";
|
|
9
9
|
import { Size2D } from "../attributes/layout/size.js";
|
|
10
|
-
import { Node2D, type NodeHandle } from "../
|
|
11
|
-
import type { NodeEditorStates } from "../
|
|
10
|
+
import { Node2D, type NodeHandle } from "../components/trees/2d/node2d.js";
|
|
11
|
+
import type { NodeEditorStates } from "../components/trees/node/node-editor-state.js";
|
|
12
12
|
import type { ProjectDocument } from "../document/project.js";
|
|
13
13
|
import type { Registry } from "../document/registry.js";
|
|
14
14
|
import { Vector2 } from "../attributes/layout/vector2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playback-controller.d.ts","sourceRoot":"","sources":["../../src/runtime/playback-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"playback-controller.d.ts","sourceRoot":"","sources":["../../src/runtime/playback-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7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AAK,EAAE,YAAY,GAAG,IAAI;IAMxD;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAUvC,gGAAgG;IAChG,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI;IAK5E;;;;;;;;OAQG;IACH,OAAO,IAAI,IAAI;IAOf;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,oBAAoB;YAId,oBAAoB;IAsBlC,wEAAwE;IACxE,OAAO,CAAC,cAAc;IAStB,IAAI,CAAC,KAAK,GAAE,MAAU,EAAE,OAAO,GAAE,OAAe,GAAG,IAAI;IAQvD,KAAK,IAAI,IAAI;IAIb,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAI9B,OAAO,IAAI,IAAI;CAQlB;AAmCD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AssetManager } from "../assets/manager.js";
|
|
2
2
|
import { asTextBlockSource } from "../render/text-layout.js";
|
|
3
|
+
import { renderIssueKey, toRenderIssue } from "../render/render-issue.js";
|
|
3
4
|
import { StateEvaluator } from "./state-evaluator.js";
|
|
4
5
|
import { renderSettled, SETTLE_PASSES } from "./settle.js";
|
|
5
6
|
import { nodePath } from "../project/tree.js";
|
|
@@ -7,7 +8,7 @@ import { AssetTimeline } from "./asset-timeline.js";
|
|
|
7
8
|
import { ClipStore, DEFAULT_PRECOMP_BUDGET_MS } from "./clip-store.js";
|
|
8
9
|
import { yieldToScheduler } from "../util/scheduler.js";
|
|
9
10
|
import { AssetNotLoadedError } from "../assets/errors.js";
|
|
10
|
-
import { Node2D } from "../
|
|
11
|
+
import { Node2D } from "../components/trees/2d/node2d.js";
|
|
11
12
|
import { childPlanePointAt, collectBoxes, handleValueAt, nodeAt, nodeBoxAt, nodeHandlesAt, parentPlanePointAt, pickNode, projectNode3DAt, reparentPlacementAt } from "./node-picking.js";
|
|
12
13
|
import { nodeTextLayout } from "./text-geometry.js";
|
|
13
14
|
import { spanFrames, spansCovering, trackFrameCount } from "./placement.js";
|
|
@@ -117,19 +118,24 @@ export class PlaybackController {
|
|
|
117
118
|
* Record a draw-time failure and tell the host, once per distinct message.
|
|
118
119
|
* Swallowing it is the point: one bad frame must not take down the clock loop.
|
|
119
120
|
*/
|
|
120
|
-
captureRenderError(error, frame) {
|
|
121
|
+
captureRenderError(error, frame, issue) {
|
|
121
122
|
const e = error instanceof Error ? error : new Error(String(error));
|
|
122
123
|
// A frame can reach for an asset no pass declared — an override previewing
|
|
123
124
|
// an edit puts a picture on a node the rebuild that would declare it has
|
|
124
125
|
// not run yet. The error names the source, so load it and paint again.
|
|
125
126
|
if (frame !== undefined && this.recoverMissingAsset(e, frame))
|
|
126
127
|
return;
|
|
127
|
-
if (
|
|
128
|
+
if (issue) {
|
|
129
|
+
const key = renderIssueKey(issue);
|
|
130
|
+
if (this.renderErrors.some((prior) => prior.issue && renderIssueKey(prior.issue) === key))
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
else if (this.renderErrors.some((prior) => !prior.issue && prior.message === e.message))
|
|
128
134
|
return;
|
|
129
135
|
this.renderErrors.push({
|
|
130
136
|
trackId: this.stateEvaluator.currentTrackId ?? "",
|
|
131
137
|
message: e.message,
|
|
132
|
-
stack: e.stack,
|
|
138
|
+
...(issue ? { issue, ...(issue.nodeId !== undefined && { nodeId: issue.nodeId }) } : { stack: e.stack }),
|
|
133
139
|
});
|
|
134
140
|
this.onRenderError?.(this.buildErrors);
|
|
135
141
|
}
|
|
@@ -408,7 +414,7 @@ export class PlaybackController {
|
|
|
408
414
|
}
|
|
409
415
|
/** Evaluate the tracks on screen, lay them out, and render `frame`. */
|
|
410
416
|
renderAt(frame) {
|
|
411
|
-
// A disposed controller's
|
|
417
|
+
// A disposed controller's surface is freed; an in-flight seek
|
|
412
418
|
// (StrictMode double-mount, HMR) can resolve after dispose().
|
|
413
419
|
if (this.disposed)
|
|
414
420
|
return;
|
|
@@ -427,6 +433,10 @@ export class PlaybackController {
|
|
|
427
433
|
this.renderContext.execute(() => {
|
|
428
434
|
this.stateEvaluator.render(this.renderContext);
|
|
429
435
|
});
|
|
436
|
+
for (const raw of this.renderContext.takeRenderIssues()) {
|
|
437
|
+
const issue = toRenderIssue(raw);
|
|
438
|
+
this.captureRenderError(new Error(issue.message), undefined, issue);
|
|
439
|
+
}
|
|
430
440
|
}
|
|
431
441
|
catch (error) {
|
|
432
442
|
this.captureRenderError(error, frame);
|