@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +356 -0
- package/NOTICE +49 -0
- package/README.md +29 -10
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +7 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +99 -15
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +4 -4
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +52 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +10 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +26 -24
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +51 -30
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +18 -13
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +13 -11
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +8 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +7 -9
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +56 -12
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +59 -19
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +27 -141
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +24 -106
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +2 -3
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +117 -522
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +102 -364
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +98 -28
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +21 -7
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +82 -34
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +57 -34
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +6 -8
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +34 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +157 -112
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +102 -50
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +2 -2
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +9 -1
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +12 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +7 -17
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +3 -19
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +3 -3
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +6 -6
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +12 -13
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js +2 -0
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +2 -0
- package/dist/browser/experimental.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +5 -5
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -19
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -19
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +62 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +38 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.d.ts +5 -5
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.js +4 -15
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +143 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.d.ts +1 -1
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.js +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.d.ts +10 -12
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.js +10 -12
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +116 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.d.ts +2 -2
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.js +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +543 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +107 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +66 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +347 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +453 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.d.ts +4 -4
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.js +3 -4
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.d.ts +2 -2
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.js +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.d.ts +3 -3
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.js +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-render.js +10 -23
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.d.ts +3 -3
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.js +4 -4
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.d.ts +2 -2
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.js +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.d.ts +206 -185
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.js +296 -324
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.d.ts +25 -15
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.js +30 -35
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.d.ts +9 -10
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.js +16 -13
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.d.ts +3 -3
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.js +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.d.ts +1 -1
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.js +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node.d.ts +46 -82
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node.js +89 -114
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.d.ts +16 -15
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.js +40 -85
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.d.ts +65 -25
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.js +78 -76
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/audio.d.ts +10 -2
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +45 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +18 -42
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +23 -5
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +72 -10
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +2 -2
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +10 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +6 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +32 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +71 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +4 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +71 -44
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +94 -35
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +57 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +264 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +145 -20
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +478 -80
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +30 -44
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +20 -8
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +195 -52
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +82 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +34 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +26 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +6 -1
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +29 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +84 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +19 -3
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +20 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -9
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +11 -5
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/render-context2d.d.ts +8 -8
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +21 -23
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +85 -34
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/resources.d.ts +2 -2
- package/dist/render3d/resources.js +2 -2
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +12 -1
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +40 -7
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +11 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +20 -3
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +29 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +3 -2
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +8 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -19
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +13 -6
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +34 -12
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +20 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +132 -27
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +13 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +6 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +45 -4
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +127 -13
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +14 -6
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +10 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +32 -3
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +78 -11
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +16 -10
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +23 -8
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +2 -2
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +6 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +70 -38
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +71 -46
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +21 -8
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +12 -23
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +13 -1
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +17 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +41 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/index.d.ts +3 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +2 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +8 -10
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -249
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
- package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
- package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
- package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -19
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -16
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -115
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -190
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -4
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -40
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -68
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -52
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -46
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -54
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -71
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -118
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -348
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts +0 -47
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js +0 -63
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts +0 -29
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js +0 -43
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -100
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -140
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -73
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -144
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -135
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -504
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -91
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -71
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -270
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -438
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -159
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -254
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -100
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -70
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -122
- package/dist/tween/seekable.js.map +0 -1
- /package/dist/{nodes → components/builtins}/text/number-pattern.d.ts +0 -0
- /package/dist/{nodes → components/builtins}/text/number-pattern.js +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.d.ts +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.js +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { declareGlyphAssets, declareRichAssets, measureGlyphs, measureRich, richState, textState, } from "../../components/builtins/text/text-layout.js";
|
|
2
|
+
import { Graphics2D } from "../../render/graphics2d.js";
|
|
3
|
+
import { currentPass, internalsOf, markDecided } from "../../components/factory/views.js";
|
|
4
|
+
/** The block's own size, which a filling text still reports, so a hugging ancestor sees its content. */
|
|
5
|
+
export function measure(measurer, s, source) {
|
|
6
|
+
const { node, scope } = currentPass();
|
|
7
|
+
markDecided(node);
|
|
8
|
+
return measureGlyphs(s, source, { maxWidth: measurer.max.width, maxHeight: measurer.max.height }, scope);
|
|
9
|
+
}
|
|
10
|
+
const drawn = new WeakMap();
|
|
11
|
+
/** The glyphs, shadow and fill, then the children, then the stroke. A styled piece paints itself, so the node's own paint steps aside. */
|
|
12
|
+
export function draw(ctx, s, source) {
|
|
13
|
+
const c = internalsOf(ctx);
|
|
14
|
+
drawn.set(c.host, { s, source });
|
|
15
|
+
if (c.probing)
|
|
16
|
+
return;
|
|
17
|
+
const out = c.target();
|
|
18
|
+
const state = textState(s, source, c.host.layoutBounds);
|
|
19
|
+
const segmented = state.segments != null;
|
|
20
|
+
c.inFront(() => {
|
|
21
|
+
const g = new Graphics2D().text(state).shadow(s.shadow);
|
|
22
|
+
if (!segmented)
|
|
23
|
+
g.fill(s.fill);
|
|
24
|
+
out.draw(g);
|
|
25
|
+
});
|
|
26
|
+
ctx.children();
|
|
27
|
+
c.inFront(() => {
|
|
28
|
+
const stroke = s.stroke;
|
|
29
|
+
if (stroke.length === 0 || segmented)
|
|
30
|
+
return;
|
|
31
|
+
out.draw(new Graphics2D().text(state).stroke(stroke));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export function load(loader, s, source) {
|
|
35
|
+
declareGlyphAssets(s, source, loader);
|
|
36
|
+
}
|
|
37
|
+
/** What a node drew its glyphs as, for a host's caret geometry. `null` for a node that draws none. */
|
|
38
|
+
export function textStateOf(node) {
|
|
39
|
+
const last = drawn.get(node);
|
|
40
|
+
return last ? textState(last.s, last.source, node.layoutBounds) : null;
|
|
41
|
+
}
|
|
42
|
+
export function measureRichText(measurer, s) {
|
|
43
|
+
const { scope } = currentPass();
|
|
44
|
+
return measureRich(s, { maxWidth: measurer.max.width, maxHeight: measurer.max.height }, scope);
|
|
45
|
+
}
|
|
46
|
+
export function drawRichText(ctx, s) {
|
|
47
|
+
const c = internalsOf(ctx);
|
|
48
|
+
if (c.probing)
|
|
49
|
+
return;
|
|
50
|
+
const out = c.target();
|
|
51
|
+
c.inFront(() => out.draw(new Graphics2D().richText(richState(s, c.host.layoutBounds))));
|
|
52
|
+
ctx.children();
|
|
53
|
+
}
|
|
54
|
+
export function loadRichText(loader, s) {
|
|
55
|
+
declareRichAssets(s, loader);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMapp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AAC;IAChC,OAAO,WAAW,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAoB,EAAE,CAAa;IAC5D,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,OAAO;QAAE,OAAO;IACtB,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,GAAG,CAAC,QAAQ,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,CAAa;IACtD,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\nimport type { ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\nimport {\n declareGlyphAssets, declareRichAssets, measureGlyphs, measureRich, richState, textState,\n type RichValues, type TextSource, type TextValues,\n} from \"@/components/builtins/text/text-layout\";\nimport type { TextState } from \"@/render/descriptors/text\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport type { Loader, Measurer, RenderContext2D } from \"@/components/factory/api\";\nimport { currentPass, internalsOf, markDecided } from \"@/components/factory/views\";\n\n/**\n * Glyphs: measured, drawn and loaded by the shared functions in `components/builtins/text/text-layout.ts`.\n * `source` is where the string comes from: a `text` entry, a formatted number.\n */\n\nexport type { TextSource, TextValues, RichValues };\n\ntype Painted = { readonly shadow: unknown; readonly fill: unknown; readonly stroke: unknown };\n\n/** The block's own size, which a filling text still reports, so a hugging ancestor sees its content. */\nexport function measure(measurer: Measurer, s: TextValues, source: TextSource): Size2D {\n const { node, scope } = currentPass();\n markDecided(node);\n return measureGlyphs(s, source, { maxWidth: measurer.max.width, maxHeight: measurer.max.height }, scope);\n}\n\nconst drawn = new WeakMap<Node2D, { readonly s: TextValues; readonly source: TextSource }>();\n\n/** The glyphs, shadow and fill, then the children, then the stroke. A styled piece paints itself, so the node's own paint steps aside. */\nexport function draw(ctx: RenderContext2D, s: TextValues & Painted, source: TextSource): void {\n const c = internalsOf(ctx);\n drawn.set(c.host, { s, source });\n if (c.probing) return;\n const out = c.target();\n const state = textState(s, source, c.host.layoutBounds);\n const segmented = state.segments != null;\n c.inFront(() => {\n const g = new Graphics2D().text(state).shadow(s.shadow as ShadowResolved[]);\n if (!segmented) g.fill(s.fill as never);\n out.draw(g);\n });\n ctx.children();\n c.inFront(() => {\n const stroke = s.stroke as StrokeResolved[];\n if (stroke.length === 0 || segmented) return;\n out.draw(new Graphics2D().text(state).stroke(stroke));\n });\n}\n\nexport function load(loader: Loader, s: TextValues, source: TextSource): void {\n declareGlyphAssets(s, source, loader);\n}\n\n/** What a node drew its glyphs as, for a host's caret geometry. `null` for a node that draws none. */\nexport function textStateOf(node: Node2D): Partial<TextState> | null {\n const last = drawn.get(node);\n return last ? textState(last.s, last.source, node.layoutBounds) : null;\n}\n\nexport function measureRichText(measurer: Measurer, s: RichValues): Size2D {\n const { scope } = currentPass();\n return measureRich(s, { maxWidth: measurer.max.width, maxHeight: measurer.max.height }, scope);\n}\n\nexport function drawRichText(ctx: RenderContext2D, s: RichValues): void {\n const c = internalsOf(ctx);\n if (c.probing) return;\n const out = c.target();\n c.inFront(() => out.draw(new Graphics2D().richText(richState(s, c.host.layoutBounds))));\n ctx.children();\n}\n\nexport function loadRichText(loader: Loader, s: RichValues): void {\n declareRichAssets(s, loader);\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Fill } from "../../attributes/shape/fill/chain.js";
|
|
2
|
+
import type { Shadow } from "../../attributes/shape/shadow/shadow.js";
|
|
3
|
+
import type { Stroke } from "../../attributes/shape/stroke/stroke.js";
|
|
4
|
+
import type { FontStyle, TextAlign, TextStyle } from "../../attributes/text/types.js";
|
|
5
|
+
import { type Provided, type Values } from "../../components/factory/api.js";
|
|
6
|
+
import type { Inherit } from "../../components/factory/type-def.js";
|
|
7
|
+
/** What `key` inherits. `autofit: false` refuses an inherited `'autofit'` size, for a node that can't fit to its box. */
|
|
8
|
+
export declare function inherit(key: keyof TextStyle, options?: {
|
|
9
|
+
readonly autofit?: boolean;
|
|
10
|
+
}): Inherit;
|
|
11
|
+
export declare const state: {
|
|
12
|
+
fontFamily: import("../../components/factory/api.js").Type<string, string, false>;
|
|
13
|
+
fontSize: import("../../components/factory/api.js").Type<number | "autofit", number | "autofit", false>;
|
|
14
|
+
fontWeight: import("../../components/factory/api.js").Type<number, number, false>;
|
|
15
|
+
fontStyle: import("../../components/factory/api.js").Type<FontStyle, FontStyle, false>;
|
|
16
|
+
letterSpacing: import("../../components/factory/api.js").Type<number, number, false>;
|
|
17
|
+
lineHeight: import("../../components/factory/api.js").Type<number, number, false>;
|
|
18
|
+
textAlign: import("../../components/factory/api.js").Type<TextAlign, TextAlign, false>;
|
|
19
|
+
verticalAlign: import("../../components/factory/api.js").Type<"top" | "bottom" | "center", "top" | "bottom" | "center", false>;
|
|
20
|
+
textDecoration: import("../../components/factory/api.js").Type<"none" | "underline" | "line-through", "none" | "underline" | "line-through", false>;
|
|
21
|
+
textCase: import("../../components/factory/api.js").Type<"none" | "upper" | "lower" | "title", "none" | "upper" | "lower" | "title", false>;
|
|
22
|
+
minFontSize: import("../../components/factory/api.js").Type<number, number, false>;
|
|
23
|
+
variant: import("../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
|
|
24
|
+
fill: import("../../components/factory/api.js").Type<Fill, import("../../index.js").FillResolved[], false>;
|
|
25
|
+
stroke: import("../../components/factory/api.js").Type<Stroke, import("../../attributes/shape/stroke/stroke.js").StrokeResolved[], false>;
|
|
26
|
+
shadow: import("../../components/factory/api.js").Type<Shadow, import("../../attributes/shape/shadow/shadow.js").ShadowResolved[], false>;
|
|
27
|
+
};
|
|
28
|
+
/** The style a provider sets: each field left unset is inherited from above. */
|
|
29
|
+
export declare const provided: {
|
|
30
|
+
fontFamily: import("../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
|
|
31
|
+
fontSize: import("../../components/factory/api.js").Type<number | "autofit" | undefined, number | "autofit" | undefined, false>;
|
|
32
|
+
fontWeight: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
33
|
+
fontStyle: import("../../components/factory/api.js").Type<FontStyle | undefined, FontStyle | undefined, false>;
|
|
34
|
+
letterSpacing: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
35
|
+
lineHeight: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
36
|
+
textAlign: import("../../components/factory/api.js").Type<TextAlign | undefined, TextAlign | undefined, false>;
|
|
37
|
+
fill: import("../../components/factory/api.js").Type<Fill | undefined, Fill | undefined, false>;
|
|
38
|
+
stroke: import("../../components/factory/api.js").Type<Stroke | undefined, Stroke | undefined, false>;
|
|
39
|
+
shadow: import("../../components/factory/api.js").Type<Shadow | undefined, Shadow | undefined, false>;
|
|
40
|
+
};
|
|
41
|
+
/** The subtree's style: the inherited one with this provider's fields laid over it. */
|
|
42
|
+
export declare function provide(s: Values<typeof provided>, inherited: <T>(context: {
|
|
43
|
+
readonly id: symbol;
|
|
44
|
+
readonly defaultValue: T;
|
|
45
|
+
}) => T): readonly Provided[];
|
|
46
|
+
/** This provider's own fields, as the default for text drawn under it. */
|
|
47
|
+
export declare function current(s: Values<typeof provided>): TextStyle;
|
|
48
|
+
//# sourceMappingURL=text-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-style.d.ts","sourceRoot":"","sources":["../../../src/components/modules/text-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAiB7D,yHAAyH;AACzH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,SAAS,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAKnG;AAED,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAoBjB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,QAAQ;;;;;;;;;;;CAWpB,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAA;CAAE,KAAK,CAAC,GAAG,SAAS,QAAQ,EAAE,CAExJ;AAED,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { textOps } from "../../attributes/text/ops.js";
|
|
2
|
+
import { TextStyleToken } from "../../runtime/builtin-context.js";
|
|
3
|
+
import { provides } from "../../components/factory/api.js";
|
|
4
|
+
import { Types } from "../../components/factory/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* The face text is set in, each field taken, when the author leaves it unset,
|
|
7
|
+
* from the cascade: the theme's `default` typography, under the nearest
|
|
8
|
+
* provider's style, under the node's own `variant` preset.
|
|
9
|
+
*/
|
|
10
|
+
function cascade(use, given) {
|
|
11
|
+
const variant = given.variant;
|
|
12
|
+
return textOps.mergeStyle(textOps.mergeStyle(textOps.preset("default"), use(TextStyleToken)), variant ? textOps.preset(variant) : undefined);
|
|
13
|
+
}
|
|
14
|
+
/** What `key` inherits. `autofit: false` refuses an inherited `'autofit'` size, for a node that can't fit to its box. */
|
|
15
|
+
export function inherit(key, options = {}) {
|
|
16
|
+
return (use, given) => {
|
|
17
|
+
const value = cascade(use, given)[key];
|
|
18
|
+
return key === "fontSize" && value === "autofit" && options.autofit === false ? undefined : value;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export const state = {
|
|
22
|
+
// No default: a face nobody chose is one never declared and never loaded, so the renderer says so.
|
|
23
|
+
fontFamily: Types.custom(undefined, { inherit: inherit("fontFamily") }),
|
|
24
|
+
fontSize: Types.custom(48, {
|
|
25
|
+
lerp: (a, b, t) => textOps.lerpFontSize(a, b, t),
|
|
26
|
+
inherit: inherit("fontSize"),
|
|
27
|
+
}),
|
|
28
|
+
fontWeight: Types.number(400, { inherit: inherit("fontWeight") }),
|
|
29
|
+
fontStyle: Types.custom("normal", { inherit: inherit("fontStyle") }),
|
|
30
|
+
letterSpacing: Types.number(0, { inherit: inherit("letterSpacing") }),
|
|
31
|
+
lineHeight: Types.number(1.2, { inherit: inherit("lineHeight") }),
|
|
32
|
+
textAlign: Types.custom("center", { inherit: inherit("textAlign") }),
|
|
33
|
+
verticalAlign: Types.oneOf(["top", "center", "bottom"], { default: "center" }),
|
|
34
|
+
textDecoration: Types.oneOf(["none", "underline", "line-through"]),
|
|
35
|
+
textCase: Types.oneOf(["none", "upper", "lower", "title"]),
|
|
36
|
+
minFontSize: Types.number(12),
|
|
37
|
+
variant: Types.custom(undefined),
|
|
38
|
+
fill: Types.fill(undefined, { inherit: inherit("fill") }),
|
|
39
|
+
stroke: Types.stroke(undefined, { inherit: inherit("stroke") }),
|
|
40
|
+
shadow: Types.shadow(undefined, { inherit: inherit("shadow") }),
|
|
41
|
+
};
|
|
42
|
+
/** The style a provider sets: each field left unset is inherited from above. */
|
|
43
|
+
export const provided = {
|
|
44
|
+
fontFamily: Types.custom(undefined),
|
|
45
|
+
fontSize: Types.custom(undefined),
|
|
46
|
+
fontWeight: Types.custom(undefined),
|
|
47
|
+
fontStyle: Types.custom(undefined),
|
|
48
|
+
letterSpacing: Types.custom(undefined),
|
|
49
|
+
lineHeight: Types.custom(undefined),
|
|
50
|
+
textAlign: Types.custom(undefined),
|
|
51
|
+
fill: Types.custom(undefined),
|
|
52
|
+
stroke: Types.custom(undefined),
|
|
53
|
+
shadow: Types.custom(undefined),
|
|
54
|
+
};
|
|
55
|
+
/** The subtree's style: the inherited one with this provider's fields laid over it. */
|
|
56
|
+
export function provide(s, inherited) {
|
|
57
|
+
return [provides(TextStyleToken, textOps.mergeStyle(inherited(TextStyleToken), s))];
|
|
58
|
+
}
|
|
59
|
+
/** This provider's own fields, as the default for text drawn under it. */
|
|
60
|
+
export function current(s) {
|
|
61
|
+
return textOps.mergeStyle({}, s);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=text-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-style.js","sourceRoot":"","sources":["../../../src/components/modules/text-style.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAA8B,MAAM,0BAA0B,CAAC;AAEhF,OAAO,EAAE,K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C,EAAE,CAAC;CAClE,CAAC;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IACvD,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAiC,SAAS,CAAC;IACjE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IACvD,SAAS,EAAE,KAAK,CAAC,MAAM,CAAwB,SAAS,CAAC;IACzD,aAAa,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IAC1D,UAAU,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IACvD,SAAS,EAAE,KAAK,CAAC,MAAM,CAAwB,SAAS,CAAC;IACzD,IAAI,EAAE,KAAK,CAAC,MAAM,CAAmB,SAAS,CAAC;IAC/C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IACnD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;CACtD,CAAC;AAEF,uFAAuF;AACvF,MAAM,UAAU,OAAO,CAAC,CAA0B,EAAE,SAA+E;IAC/H,OAAO,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAc,CAAC,CAAC,CAAC,CAAC;AACrG,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,OAAO,CAAC,CAA0B;IAC9C,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,CAAc,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import type { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\nimport { textOps } from \"@/attributes/text/ops\";\nimport type { FontStyle, TextAlign, TextStyle } from \"@/attributes/text/types\";\nimport { TextStyleToken } from \"@/runtime/builtin-context\";\nimport { provides, type Provided, type Values } from \"@/components/factory/api\";\nimport type { Inherit } from \"@/components/factory/type-def\";\nimport { Types } from \"@/components/factory/types\";\n\n/**\n * The face text is set in, each field taken, when the author leaves it unset,\n * from the cascade: the theme's `default` typography, under the nearest\n * provider's style, under the node's own `variant` preset.\n */\n\nfunction cascade(use: Parameters<Inherit>[0], given: Readonly<Record<string, unknown>>): TextStyle {\n const variant = given.variant as string | undefined;\n return textOps.mergeStyle(\n textOps.mergeStyle(textOps.preset(\"default\"), use(TextStyleToken)),\n variant ? textOps.preset(variant) : undefined,\n );\n}\n\n/** What `key` inherits. `autofit: false` refuses an inherited `'autofit'` size, for a node that can't fit to its box. */\nexport function inherit(key: keyof TextStyle, options: { readonly autofit?: boolean } = {}): Inherit {\n return (use, given) => {\n const value = cascade(use, given)[key];\n return key === \"fontSize\" && value === \"autofit\" && options.autofit === false ? undefined : value;\n };\n}\n\nexport const state = {\n // No default: a face nobody chose is one never declared and never loaded, so the renderer says so.\n fontFamily: Types.custom<string>(undefined as unknown as string, { inherit: inherit(\"fontFamily\") }),\n fontSize: Types.custom<number | \"autofit\">(48, {\n lerp: (a, b, t) => textOps.lerpFontSize(a, b, t) as number | \"autofit\",\n inherit: inherit(\"fontSize\"),\n }),\n fontWeight: Types.number(400, { inherit: inherit(\"fontWeight\") }),\n fontStyle: Types.custom<FontStyle>(\"normal\", { inherit: inherit(\"fontStyle\") }),\n letterSpacing: Types.number(0, { inherit: inherit(\"letterSpacing\") }),\n lineHeight: Types.number(1.2, { inherit: inherit(\"lineHeight\") }),\n textAlign: Types.custom<TextAlign>(\"center\", { inherit: inherit(\"textAlign\") }),\n verticalAlign: Types.oneOf([\"top\", \"center\", \"bottom\"], { default: \"center\" }),\n textDecoration: Types.oneOf([\"none\", \"underline\", \"line-through\"]),\n textCase: Types.oneOf([\"none\", \"upper\", \"lower\", \"title\"]),\n minFontSize: Types.number(12),\n variant: Types.custom<string | undefined>(undefined),\n fill: Types.fill(undefined, { inherit: inherit(\"fill\") }),\n stroke: Types.stroke(undefined, { inherit: inherit(\"stroke\") }),\n shadow: Types.shadow(undefined, { inherit: inherit(\"shadow\") }),\n};\n\n/** The style a provider sets: each field left unset is inherited from above. */\nexport const provided = {\n fontFamily: Types.custom<string | undefined>(undefined),\n fontSize: Types.custom<number | \"autofit\" | undefined>(undefined),\n fontWeight: Types.custom<number | undefined>(undefined),\n fontStyle: Types.custom<FontStyle | undefined>(undefined),\n letterSpacing: Types.custom<number | undefined>(undefined),\n lineHeight: Types.custom<number | undefined>(undefined),\n textAlign: Types.custom<TextAlign | undefined>(undefined),\n fill: Types.custom<Fill | undefined>(undefined),\n stroke: Types.custom<Stroke | undefined>(undefined),\n shadow: Types.custom<Shadow | undefined>(undefined),\n};\n\n/** The subtree's style: the inherited one with this provider's fields laid over it. */\nexport function provide(s: Values<typeof provided>, inherited: <T>(context: { readonly id: symbol; readonly defaultValue: T }) => T): readonly Provided[] {\n return [provides(TextStyleToken, textOps.mergeStyle(inherited(TextStyleToken), s as TextStyle))];\n}\n\n/** This provider's own fields, as the default for text drawn under it. */\nexport function current(s: Values<typeof provided>): TextStyle {\n return textOps.mergeStyle({}, s as TextStyle);\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Color, NormalizedColor } from "../../attributes/shape/fill/color/parser.js";
|
|
2
|
+
import { type Vector3, type Vector3Input } from "../../render3d/vector3.js";
|
|
3
|
+
import type { Type } from "../../components/factory/api.js";
|
|
4
|
+
import { type EntryOptions } from "../../components/factory/types.js";
|
|
5
|
+
/** The 3D tree's entries that start unset: the renderer's own default applies until one is given. */
|
|
6
|
+
export declare function optional<T>(): Type<T | undefined>;
|
|
7
|
+
/** A number, unset until given, with a number's hints. */
|
|
8
|
+
export declare function optionalNumber<const H extends NumberHints>(hints: H): Type<number | undefined>;
|
|
9
|
+
interface NumberHints extends EntryOptions {
|
|
10
|
+
readonly min?: number;
|
|
11
|
+
readonly max?: number;
|
|
12
|
+
readonly step?: number;
|
|
13
|
+
readonly unit?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function optionalColor(): Type<Color | undefined, NormalizedColor | undefined>;
|
|
16
|
+
/** A point, unset until given: tweening from unset starts at the origin, or snaps. */
|
|
17
|
+
export declare function optionalVector3(unset: "origin" | "snap"): Type<Vector3Input | undefined, Vector3 | undefined>;
|
|
18
|
+
/** Each of `keys` the state has set: what a scene descriptor takes. */
|
|
19
|
+
export declare function defined<T>(s: object, keys: readonly string[]): T;
|
|
20
|
+
/** `{ type, ...defined(s, keys) }`. */
|
|
21
|
+
export declare function stated<T>(type: string, s: object, keys: readonly string[]): T;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=three-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-entries.d.ts","sourceRoot":"","sources":["../../../src/components/modules/three-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAA+C,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEtE,qGAAqG;AAErG,wBAAgB,QAAQ,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAEjD;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAE9F;AAED,UAAU,WAAY,SAAQ,YAAY;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,aAAa,IAAI,IAAI,CAAC,KAAK,GAAG,SAAS,EAAE,eAAe,GAAG,SAAS,CAAC,CAMpF;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,YAAY,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,CAM7G;AAED,uEAAuE;AACvE,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,CAOhE;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,CAE7E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { colorOps } from "../../attributes/shape/fill/lerp.js";
|
|
2
|
+
import { lerpOptionalVector3, resolveOptionalVector3 } from "../../render3d/vector3.js";
|
|
3
|
+
import { Types } from "../../components/factory/types.js";
|
|
4
|
+
/** The 3D tree's entries that start unset: the renderer's own default applies until one is given. */
|
|
5
|
+
export function optional() {
|
|
6
|
+
return Types.custom(undefined);
|
|
7
|
+
}
|
|
8
|
+
/** A number, unset until given, with a number's hints. */
|
|
9
|
+
export function optionalNumber(hints) {
|
|
10
|
+
return Types.custom(undefined, { kind: "number", ...hints });
|
|
11
|
+
}
|
|
12
|
+
export function optionalColor() {
|
|
13
|
+
return Types.custom(undefined, {
|
|
14
|
+
resolve: (v) => (v === undefined ? undefined : colorOps.resolve(v)),
|
|
15
|
+
lerp: colorOps.lerp,
|
|
16
|
+
kind: "color",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** A point, unset until given: tweening from unset starts at the origin, or snaps. */
|
|
20
|
+
export function optionalVector3(unset) {
|
|
21
|
+
return Types.custom(undefined, {
|
|
22
|
+
resolve: resolveOptionalVector3,
|
|
23
|
+
lerp: (from, to, t) => lerpOptionalVector3(from, to, t, unset),
|
|
24
|
+
kind: "vector3",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Each of `keys` the state has set: what a scene descriptor takes. */
|
|
28
|
+
export function defined(s, keys) {
|
|
29
|
+
const out = {};
|
|
30
|
+
for (const key of keys) {
|
|
31
|
+
const value = s[key];
|
|
32
|
+
if (value !== undefined)
|
|
33
|
+
out[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** `{ type, ...defined(s, keys) }`. */
|
|
38
|
+
export function stated(type, s, keys) {
|
|
39
|
+
return { type, ...defined(s, keys) };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=three-entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-entries.js","sourceRoot":"","sources":["../../../src/components/modules/three-entries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAmC,MAAM,oBAAoB,CAAC;AAElH,OAAO,EAAE,KAAK,EAAqB,MAAM,4BAA4B,CAAC;AAEtE,qGAAqG;AAErG,MAAM,UAAU,QAAQ;IACpB,OAAO,KAAK,CAAC,MAAM,CAAgB,SAAS,CAAC,CAAC;AAClD,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAA8B,KAAQ;IAChE,OAAO,KAAK,CAAC,MAAM,CAA4C,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,CAA6B,CAAC;AACxI,CAAC;AASD,MAAM,UAAU,aAAa;IACzB,OAAO,KAAK,CAAC,MAAM,CAAiD,SAAS,EAAE;QAC3E,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,EAAE,QAAQ,CAAC,IAAsH;QACrI,IAAI,EAAE,OAAO;KAChB,CAAC,CAAC;AACP,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,OAAO,KAAK,CAAC,MAAM,CAAgD,SAAS,EAAE;QAC1E,OAAO,EAAE,sBAAsB;QAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC;QAC9D,IAAI,EAAE,SAAS;KAClB,CAAC,CAAC;AACP,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,OAAO,CAAI,CAAS,EAAE,IAAuB;IACzD,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,KAAK,GAAI,CAA6B,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,KAAK,KAAK,SAAS;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC9C,CAAC;IACD,OAAO,GAAQ,CAAC;AACpB,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,MAAM,CAAI,IAAY,EAAE,CAAS,EAAE,IAAuB;IACtE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAS,CAAC,EAAE,IAAI,CAAC,EAAO,CAAC;AACtD,CAAC","sourcesContent":["import type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\nimport { lerpOptionalVector3, resolveOptionalVector3, type Vector3, type Vector3Input } from \"@/render3d/vector3\";\nimport type { Type } from \"@/components/factory/api\";\nimport { Types, type EntryOptions } from \"@/components/factory/types\";\n\n/** The 3D tree's entries that start unset: the renderer's own default applies until one is given. */\n\nexport function optional<T>(): Type<T | undefined> {\n return Types.custom<T | undefined>(undefined);\n}\n\n/** A number, unset until given, with a number's hints. */\nexport function optionalNumber<const H extends NumberHints>(hints: H): Type<number | undefined> {\n return Types.custom<number | undefined, number | undefined, H>(undefined, { kind: \"number\", ...hints }) as Type<number | undefined>;\n}\n\ninterface NumberHints extends EntryOptions {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly unit?: string;\n}\n\nexport function optionalColor(): Type<Color | undefined, NormalizedColor | undefined> {\n return Types.custom<Color | undefined, NormalizedColor | undefined>(undefined, {\n resolve: (v) => (v === undefined ? undefined : colorOps.resolve(v)),\n lerp: colorOps.lerp as (from: NormalizedColor | undefined, to: NormalizedColor | undefined, t: number) => NormalizedColor | undefined,\n kind: \"color\",\n });\n}\n\n/** A point, unset until given: tweening from unset starts at the origin, or snaps. */\nexport function optionalVector3(unset: \"origin\" | \"snap\"): Type<Vector3Input | undefined, Vector3 | undefined> {\n return Types.custom<Vector3Input | undefined, Vector3 | undefined>(undefined, {\n resolve: resolveOptionalVector3,\n lerp: (from, to, t) => lerpOptionalVector3(from, to, t, unset),\n kind: \"vector3\",\n });\n}\n\n/** Each of `keys` the state has set: what a scene descriptor takes. */\nexport function defined<T>(s: object, keys: readonly string[]): T {\n const out: Record<string, unknown> = {};\n for (const key of keys) {\n const value = (s as Record<string, unknown>)[key];\n if (value !== undefined) out[key] = value;\n }\n return out as T;\n}\n\n/** `{ type, ...defined(s, keys) }`. */\nexport function stated<T>(type: string, s: object, keys: readonly string[]): T {\n return { type, ...defined<object>(s, keys) } as T;\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Color, NormalizedColor } from "../../attributes/shape/fill/color/parser.js";
|
|
2
|
+
import type { FillResolved } from "../../attributes/shape/fill/union.js";
|
|
3
|
+
import { type PostEffect3D, type Shadows3D, type ToneMapping3D } from "../../render3d/scene-settings.js";
|
|
4
|
+
import { Scene3D } from "../../render3d/scene3d.js";
|
|
5
|
+
import type { Loader, RenderContext2D, Type, Values } from "../../components/factory/api.js";
|
|
6
|
+
import * as Corners from "../../components/modules/corners.js";
|
|
7
|
+
import * as Paint from "../../components/modules/paint.js";
|
|
8
|
+
export declare const state: {
|
|
9
|
+
orbit: Type<number, number, false>;
|
|
10
|
+
elevation: Type<number, number, false>;
|
|
11
|
+
zoom: Type<number, number, false>;
|
|
12
|
+
fov: Type<number, number, false>;
|
|
13
|
+
ambientIntensity: Type<number, number, false>;
|
|
14
|
+
ambientColor: Type<Color, NormalizedColor, false>;
|
|
15
|
+
keyIntensity: Type<number, number, false>;
|
|
16
|
+
keyColor: Type<Color, NormalizedColor, false>;
|
|
17
|
+
showGrid: Type<boolean, boolean, false>;
|
|
18
|
+
gridSize: Type<number, number, false>;
|
|
19
|
+
gridDivisions: Type<number, number, false>;
|
|
20
|
+
gridMajorEvery: Type<number, number, false>;
|
|
21
|
+
gridColor: Type<Color, NormalizedColor, false>;
|
|
22
|
+
gridMajorColor: Type<Color, NormalizedColor, false>;
|
|
23
|
+
showAxes: Type<boolean, boolean, false>;
|
|
24
|
+
axisXColor: Type<Color, NormalizedColor, false>;
|
|
25
|
+
axisZColor: Type<Color, NormalizedColor, false>;
|
|
26
|
+
gridFade: Type<number, number, false>;
|
|
27
|
+
gridFadeColor: Type<Color, NormalizedColor, false>;
|
|
28
|
+
maxPixelRatio: Type<number, number, false>;
|
|
29
|
+
antialias: Type<boolean, boolean, false>;
|
|
30
|
+
shadows: Type<Shadows3D, Shadows3D, false>;
|
|
31
|
+
tone: Type<ToneMapping3D | undefined, ToneMapping3D | undefined, false>;
|
|
32
|
+
exposure: Type<number | undefined, number | undefined, false>;
|
|
33
|
+
post: Type<PostEffect3D | readonly PostEffect3D[] | undefined, PostEffect3D | readonly PostEffect3D[] | undefined, false>;
|
|
34
|
+
};
|
|
35
|
+
export declare const commands: {
|
|
36
|
+
/** Swing the default camera: only the angles given move. */
|
|
37
|
+
orbitTo: {
|
|
38
|
+
args: readonly ["orbit", "elevation", "zoom"];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type ViewState = Values<typeof state> & {
|
|
42
|
+
readonly fill: FillResolved[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The 3D runtime, warmed before the first frame, and whatever `extend` draws:
|
|
46
|
+
* pass the `extend` your render hands {@link draw}, so its textures, models and
|
|
47
|
+
* surfaces load before a frame needs them, as a 3D child's own drawing does.
|
|
48
|
+
*/
|
|
49
|
+
export declare function load(loader: Loader, extend?: (scene: Scene3D) => void): void;
|
|
50
|
+
/**
|
|
51
|
+
* Your 3D children's scene with this view's settings, its grid, and the default
|
|
52
|
+
* camera and lights where the scene has none; `extend` draws more into it last.
|
|
53
|
+
* `null` when there is nothing to show.
|
|
54
|
+
*/
|
|
55
|
+
export declare function scene(ctx: RenderContext2D, s: ViewState, extend?: (scene: Scene3D) => void): Scene3D | null;
|
|
56
|
+
/** The box painted, with the scene as its top fill layer. */
|
|
57
|
+
export declare function draw(ctx: RenderContext2D, s: ViewState & Parameters<typeof Paint.draw>[1] & Values<typeof Corners.state>, extend?: (scene: Scene3D) => void): void;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=view3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view3d.d.ts","sourceRoot":"","sources":["../../../src/components/modules/view3d.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAKlE,OAAO,EAAoB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGtF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAYpD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BjB,CAAC;AAEF,eAAO,MAAM,QAAQ;IACjB,4DAA4D;;;;CAE/D,CAAC;AAEF,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC;AAM1E;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAO5E;AAID;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,IAAI,CA+B3G;AAED,6DAA6D;AAC7D,wBAAgB,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAelK"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { cameraOrbit, lerpColor3D, resolveColor3D } from "../../attributes/render3d/orbit.js";
|
|
2
|
+
import { Fills } from "../../attributes/shape/fill/chain.js";
|
|
3
|
+
import { gridGeometry3D } from "../../components/builtins/three/grid-geometry3d.js";
|
|
4
|
+
import { Graphics3D } from "../../render3d/graphics3d.js";
|
|
5
|
+
import { warmCanvas3D } from "../../render3d/resources.js";
|
|
6
|
+
import { resolveShadows3D } from "../../render3d/scene-settings.js";
|
|
7
|
+
import { Scene3D } from "../../render3d/scene3d.js";
|
|
8
|
+
import { isSurfaceTexture3D, resolveSurfaceSource } from "../../render3d/texture.js";
|
|
9
|
+
import { forEachTexture3D } from "../../render3d/walk.js";
|
|
10
|
+
import { Types } from "../../components/factory/types.js";
|
|
11
|
+
import { internalsOf } from "../../components/factory/views.js";
|
|
12
|
+
import * as Corners from "../../components/modules/corners.js";
|
|
13
|
+
import * as Paint from "../../components/modules/paint.js";
|
|
14
|
+
import { optional } from "../../components/modules/three-entries.js";
|
|
15
|
+
/**
|
|
16
|
+
* A viewport onto its 3D children: the default camera and light rig a scene
|
|
17
|
+
* gets when it has none of its own, the floor grid, and the render settings.
|
|
18
|
+
*/
|
|
19
|
+
function color3D(initial) {
|
|
20
|
+
return Types.custom(initial, { resolve: resolveColor3D, lerp: lerpColor3D });
|
|
21
|
+
}
|
|
22
|
+
export const state = {
|
|
23
|
+
orbit: Types.number(35, { step: 1, unit: "°" }),
|
|
24
|
+
elevation: Types.number(20, { min: -89, max: 89, step: 1, unit: "°" }),
|
|
25
|
+
zoom: Types.number(12, { min: 0.01, step: 0.1 }),
|
|
26
|
+
fov: Types.custom(45),
|
|
27
|
+
ambientIntensity: Types.custom(0.45),
|
|
28
|
+
ambientColor: color3D("#ffffff"),
|
|
29
|
+
keyIntensity: Types.custom(2.4),
|
|
30
|
+
keyColor: color3D("#ffffff"),
|
|
31
|
+
showGrid: Types.custom(false),
|
|
32
|
+
gridSize: Types.custom(40),
|
|
33
|
+
gridDivisions: Types.custom(40),
|
|
34
|
+
gridMajorEvery: Types.custom(5),
|
|
35
|
+
gridColor: color3D("#26292f"),
|
|
36
|
+
gridMajorColor: color3D("#363a42"),
|
|
37
|
+
showAxes: Types.custom(false),
|
|
38
|
+
axisXColor: color3D("#c8404f"),
|
|
39
|
+
axisZColor: color3D("#2f6fd0"),
|
|
40
|
+
gridFade: Types.custom(0.55),
|
|
41
|
+
gridFadeColor: color3D("#0b0d12"),
|
|
42
|
+
maxPixelRatio: Types.custom(2),
|
|
43
|
+
antialias: Types.custom(true),
|
|
44
|
+
shadows: Types.custom(false),
|
|
45
|
+
tone: optional(),
|
|
46
|
+
exposure: optional(),
|
|
47
|
+
post: optional(),
|
|
48
|
+
};
|
|
49
|
+
export const commands = {
|
|
50
|
+
/** Swing the default camera: only the angles given move. */
|
|
51
|
+
orbitTo: { args: ["orbit", "elevation", "zoom"] },
|
|
52
|
+
};
|
|
53
|
+
const loadThreeRuntime = async () => {
|
|
54
|
+
await warmCanvas3D();
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The 3D runtime, warmed before the first frame, and whatever `extend` draws:
|
|
58
|
+
* pass the `extend` your render hands {@link draw}, so its textures, models and
|
|
59
|
+
* surfaces load before a frame needs them, as a 3D child's own drawing does.
|
|
60
|
+
*/
|
|
61
|
+
export function load(loader, extend) {
|
|
62
|
+
loader.task("three:runtime", loadThreeRuntime);
|
|
63
|
+
if (!extend)
|
|
64
|
+
return;
|
|
65
|
+
const scene = new Scene3D();
|
|
66
|
+
extend(scene);
|
|
67
|
+
const fill = { type: "canvas3D", scene };
|
|
68
|
+
loader.fill(fill);
|
|
69
|
+
}
|
|
70
|
+
const grids = new WeakMap();
|
|
71
|
+
/**
|
|
72
|
+
* Your 3D children's scene with this view's settings, its grid, and the default
|
|
73
|
+
* camera and lights where the scene has none; `extend` draws more into it last.
|
|
74
|
+
* `null` when there is nothing to show.
|
|
75
|
+
*/
|
|
76
|
+
export function scene(ctx, s, extend) {
|
|
77
|
+
const scene = ctx.scene3D();
|
|
78
|
+
const hasChildren = scene.ops().length > 0;
|
|
79
|
+
const shadows = resolveShadows3D(s.shadows);
|
|
80
|
+
if (shadows)
|
|
81
|
+
scene.shadows(shadows);
|
|
82
|
+
if (s.tone !== undefined || s.exposure !== undefined)
|
|
83
|
+
scene.tone({ mapping: s.tone, exposure: s.exposure });
|
|
84
|
+
if (s.post !== undefined)
|
|
85
|
+
scene.post(s.post);
|
|
86
|
+
const fog = scene.fogDescriptor();
|
|
87
|
+
if (fog && fog.color === undefined) {
|
|
88
|
+
const base = baseColor(s.fill);
|
|
89
|
+
if (base !== undefined)
|
|
90
|
+
scene.fog({ ...fog, color: base });
|
|
91
|
+
}
|
|
92
|
+
if (s.showGrid) {
|
|
93
|
+
scene.draw(new Graphics3D().line({
|
|
94
|
+
geometry: gridOf(internalsOf(ctx).host, s),
|
|
95
|
+
segments: true,
|
|
96
|
+
material: { type: "lineBasic", vertexColors: true, toneMapped: false },
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
if (!extend && scene.isEmpty() && !hasChildren)
|
|
100
|
+
return null;
|
|
101
|
+
if (scene.cameraDescriptor() === null) {
|
|
102
|
+
scene.perspective({ fov: s.fov, orbit: cameraOrbit(s.orbit), elevation: s.elevation, distance: s.zoom });
|
|
103
|
+
}
|
|
104
|
+
if (!scene.ops().some((op) => op.kind === "light")) {
|
|
105
|
+
scene
|
|
106
|
+
.light({ type: "ambient", intensity: s.ambientIntensity, color: s.ambientColor })
|
|
107
|
+
.light({ type: "directional", intensity: s.keyIntensity, color: s.keyColor }, { position: [4, 6, 3] })
|
|
108
|
+
.light({ type: "directional", intensity: s.keyIntensity * 0.35, color: s.keyColor }, { position: [-5, -2, -4] });
|
|
109
|
+
}
|
|
110
|
+
extend?.(scene);
|
|
111
|
+
return scene.isEmpty() ? null : scene;
|
|
112
|
+
}
|
|
113
|
+
/** The box painted, with the scene as its top fill layer. */
|
|
114
|
+
export function draw(ctx, s, extend) {
|
|
115
|
+
const built = scene(ctx, s, extend);
|
|
116
|
+
const internals = internalsOf(ctx);
|
|
117
|
+
if (built && !internals.probing) {
|
|
118
|
+
built.assertBalanced();
|
|
119
|
+
// A surface texture draws a detached 2D node: it renders in this node's scope.
|
|
120
|
+
const host = internals.host;
|
|
121
|
+
forEachTexture3D(built, (texture) => {
|
|
122
|
+
if (!isSurfaceTexture3D(texture))
|
|
123
|
+
return;
|
|
124
|
+
const source = resolveSurfaceSource(texture.source);
|
|
125
|
+
if (source.kind === "node")
|
|
126
|
+
host.attachDetached(source.node);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const fill = built ? [...s.fill, ...Fills.canvas3D(built, { maxPixelRatio: s.maxPixelRatio, antialias: s.antialias })] : s.fill;
|
|
130
|
+
Paint.draw(ctx, s, Corners.rect(ctx.size, s), { fill: fill });
|
|
131
|
+
}
|
|
132
|
+
function gridOf(host, s) {
|
|
133
|
+
const options = {
|
|
134
|
+
size: s.gridSize,
|
|
135
|
+
divisions: Math.max(1, Math.round(s.gridDivisions)),
|
|
136
|
+
majorEvery: Math.max(1, Math.round(s.gridMajorEvery)),
|
|
137
|
+
minorColor: s.gridColor,
|
|
138
|
+
majorColor: s.gridMajorColor,
|
|
139
|
+
axisXColor: s.axisXColor,
|
|
140
|
+
axisZColor: s.axisZColor,
|
|
141
|
+
showAxes: s.showAxes,
|
|
142
|
+
fadeTo: fadeColor(s),
|
|
143
|
+
fade: s.gridFade,
|
|
144
|
+
};
|
|
145
|
+
const key = JSON.stringify(options);
|
|
146
|
+
let kept = grids.get(host);
|
|
147
|
+
if (kept?.key !== key)
|
|
148
|
+
grids.set(host, kept = { key, geometry: gridGeometry3D(options) });
|
|
149
|
+
return kept.geometry;
|
|
150
|
+
}
|
|
151
|
+
/** The grid fades into the first visible solid fill, so it melts into the background. */
|
|
152
|
+
function fadeColor(s) {
|
|
153
|
+
for (const layer of s.fill) {
|
|
154
|
+
if (layer?.type !== "solid")
|
|
155
|
+
continue;
|
|
156
|
+
const color = layer.color;
|
|
157
|
+
if (typeof color === "string")
|
|
158
|
+
return color;
|
|
159
|
+
if (Array.isArray(color) && (color[3] ?? 1) > 0)
|
|
160
|
+
return color;
|
|
161
|
+
}
|
|
162
|
+
return s.gridFadeColor;
|
|
163
|
+
}
|
|
164
|
+
function baseColor(fill) {
|
|
165
|
+
for (const layer of fill) {
|
|
166
|
+
if (layer && layer.type === "solid")
|
|
167
|
+
return layer.color;
|
|
168
|
+
}
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=view3d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view3d.js","sourceRoot":"","sources":["../../../src/components/modules/view3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAsB,MAAM,6CAA6C,CAAC;AAEjG,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAyD,MAAM,2BAA2B,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D;;;GAGG;AAEH,SAAS,OAAO,CAAC,OAAc;IAC3B,OAAO,KAAK,CAAC,MAAM,CAAyB,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AACzG,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC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AQ,KAAqC,CAAC,KAAK,CAAC;IACpH,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["import type { LoaderFn } from \"@/assets/record\";\nimport { cameraOrbit, lerpColor3D, resolveColor3D } from \"@/attributes/render3d/orbit\";\nimport type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport { Fills } from \"@/attributes/shape/fill/chain\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { gridGeometry3D, type Grid3DOptions } from \"@/components/builtins/three/grid-geometry3d\";\nimport type { BufferGeometry3D } from \"@/render3d/geometry\";\nimport { Graphics3D } from \"@/render3d/graphics3d\";\nimport { warmCanvas3D } from \"@/render3d/resources\";\nimport { resolveShadows3D, type PostEffect3D, type Shadows3D, type ToneMapping3D } from \"@/render3d/scene-settings\";\nimport { Scene3D } from \"@/render3d/scene3d\";\nimport type { Canvas3DFillResolved } from \"@/attributes/shape/fill/implementations/canvas3d\";\nimport { isSurfaceTexture3D, resolveSurfaceSource } from \"@/render3d/texture\";\nimport { forEachTexture3D } from \"@/render3d/walk\";\nimport type { Loader, RenderContext2D, Type, Values } from \"@/components/factory/api\";\nimport { Types } from \"@/components/factory/types\";\nimport { internalsOf } from \"@/components/factory/views\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Paint from \"@/components/modules/paint\";\nimport { optional } from \"@/components/modules/three-entries\";\n\n/**\n * A viewport onto its 3D children: the default camera and light rig a scene\n * gets when it has none of its own, the floor grid, and the render settings.\n */\n\nfunction color3D(initial: Color): Type<Color, NormalizedColor> {\n return Types.custom<Color, NormalizedColor>(initial, { resolve: resolveColor3D, lerp: lerpColor3D });\n}\n\nexport const state = {\n orbit: Types.number(35, { step: 1, unit: \"°\" }),\n elevation: Types.number(20, { min: -89, max: 89, step: 1, unit: \"°\" }),\n zoom: Types.number(12, { min: 0.01, step: 0.1 }),\n fov: Types.custom(45),\n ambientIntensity: Types.custom(0.45),\n ambientColor: color3D(\"#ffffff\"),\n keyIntensity: Types.custom(2.4),\n keyColor: color3D(\"#ffffff\"),\n showGrid: Types.custom(false),\n gridSize: Types.custom(40),\n gridDivisions: Types.custom(40),\n gridMajorEvery: Types.custom(5),\n gridColor: color3D(\"#26292f\"),\n gridMajorColor: color3D(\"#363a42\"),\n showAxes: Types.custom(false),\n axisXColor: color3D(\"#c8404f\"),\n axisZColor: color3D(\"#2f6fd0\"),\n gridFade: Types.custom(0.55),\n gridFadeColor: color3D(\"#0b0d12\"),\n maxPixelRatio: Types.custom(2),\n antialias: Types.custom(true),\n shadows: Types.custom<Shadows3D>(false),\n tone: optional<ToneMapping3D>(),\n exposure: optional<number>(),\n post: optional<PostEffect3D | readonly PostEffect3D[]>(),\n};\n\nexport const commands = {\n /** Swing the default camera: only the angles given move. */\n orbitTo: { args: [\"orbit\", \"elevation\", \"zoom\"] as const },\n};\n\ntype ViewState = Values<typeof state> & { readonly fill: FillResolved[] };\n\nconst loadThreeRuntime: LoaderFn = async () => {\n await warmCanvas3D();\n};\n\n/**\n * The 3D runtime, warmed before the first frame, and whatever `extend` draws:\n * pass the `extend` your render hands {@link draw}, so its textures, models and\n * surfaces load before a frame needs them, as a 3D child's own drawing does.\n */\nexport function load(loader: Loader, extend?: (scene: Scene3D) => void): void {\n loader.task(\"three:runtime\", loadThreeRuntime);\n if (!extend) return;\n const scene = new Scene3D();\n extend(scene);\n const fill: Canvas3DFillResolved = { type: \"canvas3D\", scene };\n loader.fill(fill);\n}\n\nconst grids = new WeakMap<object, { readonly key: string; readonly geometry: BufferGeometry3D }>();\n\n/**\n * Your 3D children's scene with this view's settings, its grid, and the default\n * camera and lights where the scene has none; `extend` draws more into it last.\n * `null` when there is nothing to show.\n */\nexport function scene(ctx: RenderContext2D, s: ViewState, extend?: (scene: Scene3D) => void): Scene3D | null {\n const scene = ctx.scene3D();\n const hasChildren = scene.ops().length > 0;\n const shadows = resolveShadows3D(s.shadows);\n if (shadows) scene.shadows(shadows);\n if (s.tone !== undefined || s.exposure !== undefined) scene.tone({ mapping: s.tone, exposure: s.exposure });\n if (s.post !== undefined) scene.post(s.post);\n const fog = scene.fogDescriptor();\n if (fog && fog.color === undefined) {\n const base = baseColor(s.fill);\n if (base !== undefined) scene.fog({ ...fog, color: base });\n }\n if (s.showGrid) {\n scene.draw(new Graphics3D().line({\n geometry: gridOf(internalsOf(ctx).host, s),\n segments: true,\n material: { type: \"lineBasic\", vertexColors: true, toneMapped: false },\n }));\n }\n if (!extend && scene.isEmpty() && !hasChildren) return null;\n if (scene.cameraDescriptor() === null) {\n scene.perspective({ fov: s.fov, orbit: cameraOrbit(s.orbit), elevation: s.elevation, distance: s.zoom });\n }\n if (!scene.ops().some((op) => op.kind === \"light\")) {\n scene\n .light({ type: \"ambient\", intensity: s.ambientIntensity, color: s.ambientColor })\n .light({ type: \"directional\", intensity: s.keyIntensity, color: s.keyColor }, { position: [4, 6, 3] })\n .light({ type: \"directional\", intensity: s.keyIntensity * 0.35, color: s.keyColor }, { position: [-5, -2, -4] });\n }\n extend?.(scene);\n return scene.isEmpty() ? null : scene;\n}\n\n/** The box painted, with the scene as its top fill layer. */\nexport function draw(ctx: RenderContext2D, s: ViewState & Parameters<typeof Paint.draw>[1] & Values<typeof Corners.state>, extend?: (scene: Scene3D) => void): void {\n const built = scene(ctx, s, extend);\n const internals = internalsOf(ctx);\n if (built && !internals.probing) {\n built.assertBalanced();\n // A surface texture draws a detached 2D node: it renders in this node's scope.\n const host = internals.host as unknown as { attachDetached(node: object): void };\n forEachTexture3D(built, (texture) => {\n if (!isSurfaceTexture3D(texture)) return;\n const source = resolveSurfaceSource(texture.source);\n if (source.kind === \"node\") host.attachDetached(source.node);\n });\n }\n const fill = built ? [...s.fill, ...Fills.canvas3D(built, { maxPixelRatio: s.maxPixelRatio, antialias: s.antialias })] : s.fill;\n Paint.draw(ctx, s, Corners.rect(ctx.size, s), { fill: fill as never });\n}\n\nfunction gridOf(host: object, s: ViewState): BufferGeometry3D {\n const options: Grid3DOptions = {\n size: s.gridSize,\n divisions: Math.max(1, Math.round(s.gridDivisions)),\n majorEvery: Math.max(1, Math.round(s.gridMajorEvery)),\n minorColor: s.gridColor,\n majorColor: s.gridMajorColor,\n axisXColor: s.axisXColor,\n axisZColor: s.axisZColor,\n showAxes: s.showAxes,\n fadeTo: fadeColor(s),\n fade: s.gridFade,\n };\n const key = JSON.stringify(options);\n let kept = grids.get(host);\n if (kept?.key !== key) grids.set(host, kept = { key, geometry: gridGeometry3D(options) });\n return kept.geometry;\n}\n\n/** The grid fades into the first visible solid fill, so it melts into the background. */\nfunction fadeColor(s: ViewState): Color {\n for (const layer of s.fill as unknown as readonly ({ type?: string; color?: unknown } | null)[]) {\n if (layer?.type !== \"solid\") continue;\n const color = layer.color;\n if (typeof color === \"string\") return color;\n if (Array.isArray(color) && (color[3] ?? 1) > 0) return color as Color;\n }\n return s.gridFadeColor;\n}\n\nfunction baseColor(fill: readonly FillResolved[]): Color | undefined {\n for (const layer of fill) {\n if (layer && (layer as { type?: string }).type === \"solid\") return (layer as unknown as { color: Color }).color;\n }\n return undefined;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node2D } from "
|
|
2
|
-
import { BoxBounds } from "
|
|
1
|
+
import { Node2D } from "../../../components/trees/2d/node2d.js";
|
|
2
|
+
import { BoxBounds } from "../../../layout/bounds.js";
|
|
3
3
|
/**
|
|
4
4
|
* The ink extent of a node whose drawing is made **out of its children** rather
|
|
5
5
|
* than out of a box of its own — a {@link BooleanGroup}, a {@link MaskGroup}.
|
|
@@ -27,8 +27,8 @@ import { BoxBounds } from "../../layout/bounds.js";
|
|
|
27
27
|
*
|
|
28
28
|
* ## Why this composes with a resize that scales the children
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
* the drag holds still
|
|
30
|
+
* An editor can resize one of these nodes by scaling every child about the
|
|
31
|
+
* corner the drag holds still, and that gesture is only
|
|
32
32
|
* coherent if the box it is dragging follows the parts by the same factor. It
|
|
33
33
|
* does, for all three modes: an axis-aligned scale about a point commutes with
|
|
34
34
|
* union and intersection alike, so scaling every child by `k` scales the answer
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-bounds.d.ts","sourceRoot":"","sources":["../../../../src/components/trees/2d/group-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,eAAe;AACvB,2DAA2D;AACzD,OAAO;AACT,6EAA6E;GAC3E,OAAO;AACT,sDAAsD;GACpD,WAAW,CAAC;AAkDlB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,GACtB,SAAS,GAAG,IAAI,CA+BlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { multiply, translation } from "
|
|
2
|
-
import { worldAnchors } from "
|
|
1
|
+
import { multiply, translation } from "../../../attributes/layout/matrix2d.js";
|
|
2
|
+
import { worldAnchors } from "../../../components/trees/2d/node-transform.js";
|
|
3
3
|
/**
|
|
4
4
|
* The four corners of `child`'s ink, in its **parent's** local space (y-up,
|
|
5
5
|
* relative to the parent's centre).
|
|
@@ -7,8 +7,7 @@ import { worldAnchors } from "../../nodes/2d/node-transform.js";
|
|
|
7
7
|
* The same two-step `nodeBox` makes: shift the child's matrix onto the ink's own
|
|
8
8
|
* centre (the matrix is canvas y-down and the bounds are y-up, hence the sign),
|
|
9
9
|
* then read the corners off it. That is what makes this correct for a child that
|
|
10
|
-
* is rotated, scaled, or whose ink is off-centre
|
|
11
|
-
* points are nowhere near its layout cell.
|
|
10
|
+
* is rotated, scaled, or whose ink is off-centre.
|
|
12
11
|
*/
|
|
13
12
|
function inkCorners(child) {
|
|
14
13
|
const b = child._localBounds();
|