@motionscript/core 0.1.0 → 0.1.1-alpha.1
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 +16 -0
- package/dist/assets/asset-index.d.ts +1 -8
- package/dist/assets/asset-index.d.ts.map +1 -1
- package/dist/assets/asset-index.js +1 -8
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +10 -72
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +3 -29
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts +8 -20
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -20
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +9 -51
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +13 -78
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/record.d.ts +2 -18
- package/dist/assets/record.d.ts.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -18
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +2 -11
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +2 -12
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
- package/dist/attributes/audio/effects/chain.js +1 -7
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/registry.d.ts +3 -18
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
- package/dist/attributes/audio/effects/registry.js +4 -23
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/ramp.d.ts +5 -38
- package/dist/attributes/audio/ramp.d.ts.map +1 -1
- package/dist/attributes/audio/ramp.js +3 -28
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +10 -80
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +1 -4
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +2 -12
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +2 -11
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +2 -26
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +1 -9
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +1 -8
- package/dist/attributes/audio/transition.d.ts.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/layout/alignment.d.ts +6 -38
- package/dist/attributes/layout/alignment.d.ts.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +2 -27
- package/dist/attributes/layout/insets.d.ts.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +29 -114
- package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
- package/dist/attributes/layout/matrix2d.js +26 -110
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +3 -25
- package/dist/attributes/layout/size.d.ts.map +1 -1
- package/dist/attributes/layout/size.js +2 -18
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.d.ts +16 -79
- package/dist/attributes/layout/space3d.d.ts.map +1 -1
- package/dist/attributes/layout/space3d.js +17 -81
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.d.ts +2 -23
- package/dist/attributes/layout/transform3d.d.ts.map +1 -1
- package/dist/attributes/layout/transform3d.js +1 -7
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/world-transform.d.ts +2 -16
- package/dist/attributes/layout/world-transform.d.ts.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +13 -73
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +9 -40
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +6 -45
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -37
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +11 -83
- package/dist/attributes/render3d/orbit.d.ts.map +1 -1
- package/dist/attributes/render3d/orbit.js +10 -73
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
- package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js +2 -12
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.d.ts +2 -21
- package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corners.js +2 -12
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js +3 -26
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +36 -328
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +24 -242
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js +6 -33
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +1 -6
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +1 -7
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +0 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +0 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +1 -9
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +0 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +0 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +2 -8
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +0 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +2 -9
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +0 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +1 -5
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +6 -41
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +7 -45
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +6 -30
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
- package/dist/attributes/shape/effects/spec.js +3 -9
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/fill/blend.d.ts +1 -17
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
- package/dist/attributes/shape/fill/blend.js +2 -15
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +17 -125
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +22 -109
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.d.ts +10 -35
- package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
- package/dist/attributes/shape/fill/coerce.js +12 -47
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +15 -91
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js +2 -13
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
- package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js +2 -8
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +6 -23
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +5 -17
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +12 -50
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +2 -13
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +2 -9
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
- package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js +8 -35
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +2 -26
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +5 -40
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.d.ts +6 -30
- package/dist/attributes/shape/fill/union.d.ts.map +1 -1
- package/dist/attributes/shape/fill/union.js +1 -9
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +15 -168
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +8 -132
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
- package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -6
- package/dist/attributes/shape/filters/index.d.ts.map +1 -1
- package/dist/attributes/shape/filters/index.js +0 -2
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +5 -35
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +7 -50
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +10 -51
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts +18 -106
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +15 -124
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.d.ts +6 -54
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
- package/dist/attributes/shape/path/bezier.js +10 -98
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.d.ts +1 -11
- package/dist/attributes/shape/path/index.d.ts.map +1 -1
- package/dist/attributes/shape/path/index.js +1 -11
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.d.ts +5 -41
- package/dist/attributes/shape/path/measure.d.ts.map +1 -1
- package/dist/attributes/shape/path/measure.js +8 -57
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts +4 -41
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +17 -117
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +5 -19
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.d.ts +10 -67
- package/dist/attributes/shape/path/types.d.ts.map +1 -1
- package/dist/attributes/shape/path/types.js +0 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.d.ts +9 -63
- package/dist/attributes/shape/path/walk.d.ts.map +1 -1
- package/dist/attributes/shape/path/walk.js +21 -100
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +2 -14
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/language.js +1 -8
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.d.ts +13 -78
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +1 -10
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -28
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
- package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js +0 -3
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +0 -6
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +1 -8
- package/dist/attributes/shared/operators.d.ts.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.d.ts +1 -11
- package/dist/attributes/text/index.d.ts.map +1 -1
- package/dist/attributes/text/index.js +1 -11
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +4 -30
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +7 -23
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +5 -28
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-5GLXFSCC.js +13 -0
- package/dist/browser/chunks/chunk-5GLXFSCC.js.map +7 -0
- package/dist/browser/chunks/{chunk-CCGVIR4F.js → chunk-5TDMGUXQ.js} +3 -3
- package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
- package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
- package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js +6 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +3 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -10
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.d.ts +15 -62
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js +29 -168
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.d.ts +1 -14
- package/dist/components/builtins/layout/layout.d.ts.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +11 -51
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +3 -7
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/text/number-format.d.ts +14 -47
- package/dist/components/builtins/text/number-format.d.ts.map +1 -1
- package/dist/components/builtins/text/number-format.js +19 -69
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.d.ts +3 -37
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
- package/dist/components/builtins/text/number-pattern.js +6 -48
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.d.ts +7 -25
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
- package/dist/components/builtins/text/text-defaults.js +7 -25
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.d.ts +2 -11
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
- package/dist/components/builtins/text/text-layout.js +7 -22
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +8 -46
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.d.ts +6 -51
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js +8 -46
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.d.ts +22 -117
- package/dist/components/builtins/three/three.d.ts.map +1 -1
- package/dist/components/builtins/three/three.js +5 -17
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/style.d.ts +38 -0
- package/dist/components/factory/style.d.ts.map +1 -0
- package/dist/components/factory/style.js +104 -0
- package/dist/components/factory/style.js.map +1 -0
- package/dist/components/factory/types.d.ts +9 -0
- package/dist/components/factory/types.d.ts.map +1 -1
- package/dist/components/factory/types.js +11 -0
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +0 -2
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.d.ts +12 -41
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
- package/dist/components/trees/2d/group-bounds.js +3 -22
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js +35 -127
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.d.ts +4 -36
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
- package/dist/components/trees/2d/node-motion.js +3 -31
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +3 -20
- package/dist/components/trees/2d/node-render.d.ts.map +1 -1
- package/dist/components/trees/2d/node-render.js +4 -23
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.d.ts +4 -23
- package/dist/components/trees/2d/node-space.d.ts.map +1 -1
- package/dist/components/trees/2d/node-space.js +3 -17
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.d.ts +4 -33
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
- package/dist/components/trees/2d/node-transform.js +4 -33
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +112 -622
- package/dist/components/trees/2d/node2d.d.ts.map +1 -1
- package/dist/components/trees/2d/node2d.js +131 -605
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +17 -65
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +18 -68
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.d.ts +5 -45
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
- package/dist/components/trees/node/node-editor-state.js +1 -13
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +6 -53
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +4 -33
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.d.ts +2 -15
- package/dist/components/trees/node/node-time.d.ts.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.d.ts +7 -32
- package/dist/components/trees/node/node-walk.d.ts.map +1 -1
- package/dist/components/trees/node/node-walk.js +7 -32
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.d.ts +43 -248
- package/dist/components/trees/node/node.d.ts.map +1 -1
- package/dist/components/trees/node/node.js +51 -229
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js +7 -47
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.d.ts +24 -112
- package/dist/components/trees/three/node3d.d.ts.map +1 -1
- package/dist/components/trees/three/node3d.js +22 -104
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.d.ts +9 -21
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +13 -28
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts +3 -9
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +43 -89
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -37
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +22 -39
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +9 -43
- package/dist/document/deny-globals.d.ts.map +1 -1
- package/dist/document/deny-globals.js +18 -58
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts +6 -16
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +5 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +5 -13
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +0 -2
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts +2 -2
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -18
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +11 -41
- package/dist/document/expression/index.d.ts.map +1 -1
- package/dist/document/expression/index.js +11 -41
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.d.ts +3 -12
- package/dist/document/expression/ops.d.ts.map +1 -1
- package/dist/document/expression/ops.js +4 -20
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts +4 -14
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +34 -55
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +2 -8
- package/dist/document/expression/refs.d.ts.map +1 -1
- package/dist/document/expression/refs.js +2 -6
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.d.ts +18 -63
- package/dist/document/expression/types.d.ts.map +1 -1
- package/dist/document/expression/types.js +4 -15
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts +6 -20
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +18 -44
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js +2 -3
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +7 -22
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +44 -15
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.d.ts +4 -11
- package/dist/document/missing-node.d.ts.map +1 -1
- package/dist/document/missing-node.js +2 -5
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.d.ts +12 -53
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +16 -57
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -62
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +18 -41
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js +4 -11
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +19 -52
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +2 -6
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +10 -20
- package/dist/document/prop-evolution.d.ts.map +1 -1
- package/dist/document/prop-evolution.js +3 -7
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.d.ts +80 -318
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +43 -147
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +11 -23
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +15 -34
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +6 -15
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +12 -21
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +56 -263
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +71 -275
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +90 -264
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +13 -30
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +10 -40
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +72 -137
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +4 -7
- package/dist/document/vocabulary.d.ts.map +1 -1
- package/dist/document/vocabulary.js +0 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +1 -11
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +6 -20
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +7 -28
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +2 -11
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +2 -22
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +11 -55
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +7 -43
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js +4 -29
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +5 -31
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/stepped-clock.d.ts +1 -16
- package/dist/platform/stepped-clock.d.ts.map +1 -1
- package/dist/platform/stepped-clock.js +1 -16
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +8 -68
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +8 -60
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +11 -45
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +10 -37
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.d.ts +4 -14
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/tree.d.ts +6 -35
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js +1 -8
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +2 -13
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +1 -12
- package/dist/props/layout.d.ts.map +1 -1
- package/dist/props/layout.js +1 -12
- package/dist/props/layout.js.map +1 -1
- package/dist/props/observer.d.ts +1 -7
- package/dist/props/observer.d.ts.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.d.ts +6 -19
- package/dist/props/slot.d.ts.map +1 -1
- package/dist/props/slot.js +5 -14
- package/dist/props/slot.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +8 -68
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +8 -69
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.d.ts +2 -16
- package/dist/render/clip-contains.d.ts.map +1 -1
- package/dist/render/clip-contains.js +21 -82
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +7 -25
- package/dist/render/clip.d.ts.map +1 -1
- package/dist/render/clip.js +5 -17
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.d.ts.map +1 -1
- package/dist/render/descriptors/ellipse.js +0 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.d.ts.map +1 -1
- package/dist/render/descriptors/line.js +0 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.d.ts +4 -32
- package/dist/render/descriptors/path-builder.d.ts.map +1 -1
- package/dist/render/descriptors/path-builder.js +3 -25
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.d.ts +1 -11
- package/dist/render/descriptors/path.d.ts.map +1 -1
- package/dist/render/descriptors/path.js +0 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.d.ts.map +1 -1
- package/dist/render/descriptors/polygon.js +0 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.d.ts.map +1 -1
- package/dist/render/descriptors/polygram.js +0 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.d.ts.map +1 -1
- package/dist/render/descriptors/rect.js +0 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.d.ts.map +1 -1
- package/dist/render/descriptors/richtext.js +0 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +17 -77
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js +13 -47
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -94
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +8 -50
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +5 -16
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js +1 -17
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +24 -116
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +23 -108
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/measure-context.d.ts +5 -29
- package/dist/render/measure-context.d.ts.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.d.ts +2 -20
- package/dist/render/null-render-context.d.ts.map +1 -1
- package/dist/render/null-render-context.js +2 -20
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +52 -208
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.d.ts +2 -19
- package/dist/render/surface.d.ts.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.d.ts +1 -17
- package/dist/render/text-defaults.d.ts.map +1 -1
- package/dist/render/text-defaults.js +6 -40
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.d.ts +12 -55
- package/dist/render/text-layout.d.ts.map +1 -1
- package/dist/render/text-layout.js +2 -16
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts +10 -32
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +2 -12
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +8 -35
- package/dist/render3d/builders.d.ts.map +1 -1
- package/dist/render3d/builders.js +8 -35
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +10 -57
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +4 -26
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +7 -45
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +15 -85
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +18 -106
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js +2 -20
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +29 -133
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +23 -110
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -16
- package/dist/render3d/index.d.ts.map +1 -1
- package/dist/render3d/index.js +1 -16
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts.map +1 -1
- package/dist/render3d/inert.js +1 -14
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.d.ts +3 -26
- package/dist/render3d/light.d.ts.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +13 -87
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js +2 -16
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.d.ts +14 -68
- package/dist/render3d/matrix4.d.ts.map +1 -1
- package/dist/render3d/matrix4.js +11 -60
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.d.ts +13 -51
- package/dist/render3d/render-context3d.d.ts.map +1 -1
- package/dist/render3d/render-context3d.js +9 -21
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +9 -53
- package/dist/render3d/resources.d.ts.map +1 -1
- package/dist/render3d/resources.js +8 -48
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.d.ts +7 -21
- package/dist/render3d/rounded-box.d.ts.map +1 -1
- package/dist/render3d/rounded-box.js +7 -46
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +20 -78
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -53
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +12 -59
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.d.ts +2 -25
- package/dist/render3d/segments.d.ts.map +1 -1
- package/dist/render3d/segments.js +1 -11
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +25 -112
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +3 -27
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.d.ts +2 -19
- package/dist/render3d/tracking.d.ts.map +1 -1
- package/dist/render3d/tracking.js +2 -19
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +14 -60
- package/dist/render3d/transform.d.ts.map +1 -1
- package/dist/render3d/transform.js +0 -2
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +6 -48
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +4 -38
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +3 -27
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -33
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +34 -20
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +127 -31
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +14 -53
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js +6 -27
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts +7 -26
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +6 -18
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.d.ts +3 -9
- package/dist/runtime/builtin-context.d.ts.map +1 -1
- package/dist/runtime/builtin-context.js +3 -9
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +12 -39
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -45
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +26 -68
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +47 -81
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +31 -85
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +16 -49
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +4 -15
- package/dist/runtime/frame-time.d.ts.map +1 -1
- package/dist/runtime/frame-time.js +5 -12
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +59 -139
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +87 -157
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +39 -96
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +98 -141
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts +8 -17
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +7 -16
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +78 -207
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +111 -226
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.d.ts +6 -14
- package/dist/runtime/playback.d.ts.map +1 -1
- package/dist/runtime/playback.js +6 -14
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/project-assets.d.ts +6 -14
- package/dist/runtime/project-assets.d.ts.map +1 -1
- package/dist/runtime/project-assets.js +7 -16
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +22 -45
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +26 -46
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.d.ts +4 -10
- package/dist/runtime/settle.d.ts.map +1 -1
- package/dist/runtime/settle.js +4 -10
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +15 -37
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +27 -44
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +18 -47
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +13 -27
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -7
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -138
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +6 -26
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -6
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +6 -53
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +5 -40
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/curve.d.ts +2 -17
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +1 -6
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +0 -11
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +0 -23
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +2 -18
- package/dist/tween/ease/spec.d.ts.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/inert.d.ts +1 -14
- package/dist/tween/inert.d.ts.map +1 -1
- package/dist/tween/inert.js +1 -14
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.d.ts +2 -26
- package/dist/tween/lerp.d.ts.map +1 -1
- package/dist/tween/lerp.js +2 -26
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.d.ts +9 -50
- package/dist/tween/loop.d.ts.map +1 -1
- package/dist/tween/loop.js +6 -31
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +2 -30
- package/dist/tween/prepare.d.ts.map +1 -1
- package/dist/tween/prepare.js +2 -30
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.d.ts +4 -25
- package/dist/tween/stepper.d.ts.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.d.ts +1 -8
- package/dist/tween/to-command.d.ts.map +1 -1
- package/dist/tween/to-command.js +2 -25
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/context.d.ts +4 -29
- package/dist/util/context.d.ts.map +1 -1
- package/dist/util/context.js +3 -15
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.d.ts +4 -29
- package/dist/util/csv.d.ts.map +1 -1
- package/dist/util/csv.js +3 -22
- package/dist/util/csv.js.map +1 -1
- package/dist/util/metrics.d.ts +2 -26
- package/dist/util/metrics.d.ts.map +1 -1
- package/dist/util/metrics.js +2 -26
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.d.ts +20 -87
- package/dist/util/random.d.ts.map +1 -1
- package/dist/util/random.js +20 -87
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.d.ts +6 -35
- package/dist/util/reference.d.ts.map +1 -1
- package/dist/util/reference.js +1 -4
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.d.ts +6 -27
- package/dist/util/scheduler.d.ts.map +1 -1
- package/dist/util/scheduler.js +8 -35
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +0 -7
- package/dist/browser/chunks/chunk-N4WSN5WY.js +0 -13
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +0 -7
- package/dist/browser/chunks/chunk-WZSI3GSK.js +0 -6
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +0 -7
- package/dist/renamed-scene-names.d.ts +0 -17
- package/dist/renamed-scene-names.d.ts.map +0 -1
- package/dist/renamed-scene-names.js +0 -9
- package/dist/renamed-scene-names.js.map +0 -1
- package/dist/runtime/precompisition.d.ts +0 -24
- package/dist/runtime/precompisition.d.ts.map +0 -1
- package/dist/runtime/precompisition.js +0 -7
- package/dist/runtime/precompisition.js.map +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { fillOps } from "../../attributes/shape/fill/registry.js";
|
|
2
|
+
import { defOf } from "../../components/factory/type-def.js";
|
|
3
|
+
function fieldsOf(groups) {
|
|
4
|
+
const fields = [];
|
|
5
|
+
const seen = new Set();
|
|
6
|
+
for (const group in groups) {
|
|
7
|
+
for (const key in groups[group]) {
|
|
8
|
+
if (seen.has(key))
|
|
9
|
+
throw new Error(`Style field "${key}" is declared in two groups; a style's field keys are flat.`);
|
|
10
|
+
seen.add(key);
|
|
11
|
+
fields.push({ key, group, def: defOf(groups[group][key]) });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return fields;
|
|
15
|
+
}
|
|
16
|
+
/** A field default as an author would write it: a factory is called, so every node gets its own array. */
|
|
17
|
+
function inputDefault(def) {
|
|
18
|
+
return typeof def.default === "function" ? def.default() : def.default;
|
|
19
|
+
}
|
|
20
|
+
function resolveField(def, value, previous) {
|
|
21
|
+
return def.mapper ? def.mapper(value, previous) : value;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Lays `input` over `previous` (else the defaults), resolving each field it
|
|
25
|
+
* names. A key no field declares is dropped, so a preset written for a richer
|
|
26
|
+
* member of the family (a pie's `innerRadius` on a line chart) is harmless.
|
|
27
|
+
*/
|
|
28
|
+
function resolveStyle(fields, input, previous) {
|
|
29
|
+
const out = {};
|
|
30
|
+
for (const { key, def } of fields) {
|
|
31
|
+
const given = input?.[key];
|
|
32
|
+
if (given !== undefined && given !== null)
|
|
33
|
+
out[key] = resolveField(def, given, previous?.[key]);
|
|
34
|
+
else if (previous && key in previous)
|
|
35
|
+
out[key] = previous[key];
|
|
36
|
+
else
|
|
37
|
+
out[key] = resolveField(def, inputDefault(def));
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
/** Field by field: a field's own tween, else numbers lerp, else it steps at the midpoint (a font, a curve, a toggle). */
|
|
42
|
+
function lerpStyle(fields, from, to, t) {
|
|
43
|
+
const out = {};
|
|
44
|
+
for (const { key, def } of fields) {
|
|
45
|
+
const a = from[key];
|
|
46
|
+
const b = to[key];
|
|
47
|
+
if (a === b)
|
|
48
|
+
out[key] = b;
|
|
49
|
+
else if (def.editor.animatable === false || a === undefined || b === undefined)
|
|
50
|
+
out[key] = t < 0.5 ? a : b;
|
|
51
|
+
else if (def.tween)
|
|
52
|
+
out[key] = def.tween(a, b, t);
|
|
53
|
+
else if (typeof a === "number" && typeof b === "number")
|
|
54
|
+
out[key] = a + (b - a) * t;
|
|
55
|
+
else
|
|
56
|
+
out[key] = t < 0.5 ? a : b;
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The definition behind `Types.style`: an object entry whose fields a host can
|
|
62
|
+
* edit one by one, group by group, and whose whole value can be saved and laid
|
|
63
|
+
* onto any component of the same `family`.
|
|
64
|
+
*/
|
|
65
|
+
export function styleDef(family, groups, options) {
|
|
66
|
+
const fields = fieldsOf(groups);
|
|
67
|
+
const defaults = {};
|
|
68
|
+
const properties = {};
|
|
69
|
+
for (const { key, group, def } of fields) {
|
|
70
|
+
const initial = inputDefault(def);
|
|
71
|
+
defaults[key] = initial;
|
|
72
|
+
properties[key] = { ...def.editor, group, ...(initial !== undefined ? { default: initial } : {}) };
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
// Called once per node, so no two nodes share a palette array.
|
|
76
|
+
default: () => structuredClone(defaults),
|
|
77
|
+
mapper: (input, previous) => resolveStyle(fields, input, previous),
|
|
78
|
+
tween: (from, to, t) => lerpStyle(fields, from, to, t),
|
|
79
|
+
editor: {
|
|
80
|
+
kind: "style",
|
|
81
|
+
family,
|
|
82
|
+
properties,
|
|
83
|
+
...(options?.presets ? { presets: options.presets } : {}),
|
|
84
|
+
},
|
|
85
|
+
private: false,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** A colour for each series or item, cycled by index; tweened pairwise, the longer side's tail held. */
|
|
89
|
+
export function paletteDef(initial) {
|
|
90
|
+
return {
|
|
91
|
+
default: () => [...initial],
|
|
92
|
+
mapper: (value) => (value ?? []).map((fill) => fillOps.resolve(fill)),
|
|
93
|
+
tween: (from, to, t) => {
|
|
94
|
+
const n = Math.max(from.length, to.length);
|
|
95
|
+
const out = [];
|
|
96
|
+
for (let i = 0; i < n; i++)
|
|
97
|
+
out.push(fillOps.lerp(from[i] ?? to[i], to[i] ?? from[i], t));
|
|
98
|
+
return out;
|
|
99
|
+
},
|
|
100
|
+
editor: { kind: "palette" },
|
|
101
|
+
private: false,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/components/factory/style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAgB,MAAM,+BAA+B,CAAC;AA6BpE,SAAS,QAAQ,CAAC,MAAmB;IACjC,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,6DAA6D,CAAC,CAAC;YACrH,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,CAAC,IAAI,C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CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzG,KAAK,EAAE,CAAC,IAAsB,EAAE,EAAoB,EAAE,CAAS,EAAE,EAAE;YAC/D,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;YAC3C,MAAM,GAAG,GAAqB,EAAE,CAAC;YACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1F,OAAO,GAAG,CAAC;QACf,CAAC;QACD,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,OAAO,EAAE,KAAK;KACjB,CAAC;AACN,CAAC","sourcesContent":["import type { PropertyEditor } from \"@/attributes/properties/decorator\";\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { InOf, OutOf, StateSpec } from \"@/components/factory/api\";\nimport { defOf, type TypeDef } from \"@/components/factory/type-def\";\n\n/**\n * A style's fields, written in groups: `{ colors: { palette, foreground }, text: { fontSize } }`.\n * The group says what part of the component a field paints; the value is flat\n * (`style.palette`, `style.fontSize`), so field keys are unique across groups.\n */\nexport type StyleGroups = { readonly [group: string]: StateSpec };\n\ntype Flatten<G> = { [K in keyof G]: (x: G[K]) => void }[keyof G] extends (x: infer I) => void ? I : never;\n/** Every group's fields in one spec. */\nexport type StyleShape<G extends StyleGroups> = Flatten<G> extends StateSpec ? Flatten<G> : StateSpec;\n\n/** What a document, call or preset sets: any subset of the fields, each in its loose form. */\nexport type StyleInput<S> = { [K in keyof S]?: InOf<S[K]> };\n/** Every field resolved. */\nexport type StyleValues<S> = { readonly [K in keyof S]: OutOf<S[K]> };\n\nexport interface StyleOptions<S> {\n /** Ready-made looks by name, each a partial style laid over the defaults when applied. */\n readonly presets?: Readonly<Record<string, StyleInput<S>>>;\n}\n\ninterface Field {\n readonly key: string;\n readonly group: string;\n readonly def: TypeDef;\n}\n\nfunction fieldsOf(groups: StyleGroups): Field[] {\n const fields: Field[] = [];\n const seen = new Set<string>();\n for (const group in groups) {\n for (const key in groups[group]) {\n if (seen.has(key)) throw new Error(`Style field \"${key}\" is declared in two groups; a style's field keys are flat.`);\n seen.add(key);\n fields.push({ key, group, def: defOf(groups[group][key]) });\n }\n }\n return fields;\n}\n\n/** A field default as an author would write it: a factory is called, so every node gets its own array. */\nfunction inputDefault(def: TypeDef): unknown {\n return typeof def.default === \"function\" ? (def.default as () => unknown)() : def.default;\n}\n\nfunction resolveField(def: TypeDef, value: unknown, previous?: unknown): unknown {\n return def.mapper ? def.mapper(value, previous) : value;\n}\n\n/**\n * Lays `input` over `previous` (else the defaults), resolving each field it\n * names. A key no field declares is dropped, so a preset written for a richer\n * member of the family (a pie's `innerRadius` on a line chart) is harmless.\n */\nfunction resolveStyle(fields: readonly Field[], input: Record<string, unknown> | null | undefined, previous?: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const { key, def } of fields) {\n const given = input?.[key];\n if (given !== undefined && given !== null) out[key] = resolveField(def, given, previous?.[key]);\n else if (previous && key in previous) out[key] = previous[key];\n else out[key] = resolveField(def, inputDefault(def));\n }\n return out;\n}\n\n/** Field by field: a field's own tween, else numbers lerp, else it steps at the midpoint (a font, a curve, a toggle). */\nfunction lerpStyle(fields: readonly Field[], from: Record<string, unknown>, to: Record<string, unknown>, t: number): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const { key, def } of fields) {\n const a = from[key];\n const b = to[key];\n if (a === b) out[key] = b;\n else if (def.editor.animatable === false || a === undefined || b === undefined) out[key] = t < 0.5 ? a : b;\n else if (def.tween) out[key] = def.tween(a, b, t);\n else if (typeof a === \"number\" && typeof b === \"number\") out[key] = a + (b - a) * t;\n else out[key] = t < 0.5 ? a : b;\n }\n return out;\n}\n\n/**\n * The definition behind `Types.style`: an object entry whose fields a host can\n * edit one by one, group by group, and whose whole value can be saved and laid\n * onto any component of the same `family`.\n */\nexport function styleDef(family: string, groups: StyleGroups, options?: StyleOptions<unknown>): TypeDef {\n const fields = fieldsOf(groups);\n const defaults: Record<string, unknown> = {};\n const properties: Record<string, PropertyEditor> = {};\n for (const { key, group, def } of fields) {\n const initial = inputDefault(def);\n defaults[key] = initial;\n properties[key] = { ...def.editor, group, ...(initial !== undefined ? { default: initial } : {}) };\n }\n return {\n // Called once per node, so no two nodes share a palette array.\n default: () => structuredClone(defaults),\n mapper: (input: Record<string, unknown> | null | undefined, previous?: Record<string, unknown>) => resolveStyle(fields, input, previous),\n tween: (from: Record<string, unknown>, to: Record<string, unknown>, t: number) => lerpStyle(fields, from, to, t),\n editor: {\n kind: \"style\",\n family,\n properties,\n ...(options?.presets ? { presets: options.presets } : {}),\n },\n private: false,\n };\n}\n\n\n/** A colour for each series or item, cycled by index; tweened pairwise, the longer side's tail held. */\nexport function paletteDef(initial: readonly Fill[]): TypeDef {\n return {\n default: () => [...initial],\n mapper: (value: readonly Fill[] | null | undefined) => (value ?? []).map((fill) => fillOps.resolve(fill)),\n tween: (from: FillResolved[][], to: FillResolved[][], t: number) => {\n const n = Math.max(from.length, to.length);\n const out: FillResolved[][] = [];\n for (let i = 0; i < n; i++) out.push(fillOps.lerp(from[i] ?? to[i], to[i] ?? from[i], t));\n return out;\n },\n editor: { kind: \"palette\" },\n private: false,\n };\n}\n"]}
|
|
@@ -15,6 +15,7 @@ import { type Stroke, type StrokeResolved } from "../../attributes/shape/stroke/
|
|
|
15
15
|
import type { PathData } from "../../render/descriptors/path.js";
|
|
16
16
|
import type { AnyType, InOf, Inputs, NodeView, OutOf, StateSpec, Type, Values } from "../../components/factory/api.js";
|
|
17
17
|
import { type Inherit } from "../../components/factory/type-def.js";
|
|
18
|
+
import { type StyleGroups, type StyleInput, type StyleOptions, type StyleShape, type StyleValues } from "../../components/factory/style.js";
|
|
18
19
|
export interface EntryOptions {
|
|
19
20
|
/** Not in documents or calls; only commands write it. A seek restores it like any entry. */
|
|
20
21
|
readonly private?: boolean;
|
|
@@ -78,6 +79,14 @@ export declare const Types: {
|
|
|
78
79
|
readonly kind?: string;
|
|
79
80
|
readonly properties?: PropertyEditor["properties"];
|
|
80
81
|
}): Type<In, Out, PrivateOf<O>>;
|
|
82
|
+
/** A colour per series or item, cycled by index. */
|
|
83
|
+
palette: (initial?: readonly Fill[]) => Type<Fill[], FillResolved[][]>;
|
|
84
|
+
/**
|
|
85
|
+
* A component's look as one entry: fields written in groups (`colors`, `text`, …), read flat
|
|
86
|
+
* (`style.palette`). A host edits it field by field, saves it, and lays a saved one onto any
|
|
87
|
+
* component of the same `family`; `to({ style })` tweens it field by field.
|
|
88
|
+
*/
|
|
89
|
+
style<const G extends StyleGroups>(family: string, groups: G, options?: StyleOptions<StyleShape<G>>): Type<StyleInput<StyleShape<G>>, StyleValues<StyleShape<G>>>;
|
|
81
90
|
image: (src?: string) => Type<string>;
|
|
82
91
|
video: (src?: string) => Type<string>;
|
|
83
92
|
audio: (src?: string) => Type<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/factory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAa,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAc,KAAK,OAAO,EAAE,M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AAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;QACvD,+FAA+F;QAC/F,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;KACtD,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAK/B,oDAAoD;wBACjC,SAAS,IAAI,EAAE,KAAQ,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC;IACxE;;;;OAIG;gBACS,CAAC,SAAS,WAAW,UAAU,MAAM,UAAU,CAAC,YAAY,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;6BAG9I,IAAI,CAAC,MAAM,CAAC;6BACZ,IAAI,CAAC,MAAM,CAAC;6BACZ,IAAI,CAAC,MAAM,CAAC;+BACV,IAAI,CAAC,MAAM,CAAC;IACjC,uGAAuG;mCAC9E,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtD,uFAAuF;gCAClE,IAAI,CAAC,MAAM,CAAC;CACpC,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { shadowOps } from "../../attributes/shape/shadow/shadow.js";
|
|
|
12
12
|
import { strokeOps } from "../../attributes/shape/stroke/stroke.js";
|
|
13
13
|
import { textOps } from "../../attributes/text/ops.js";
|
|
14
14
|
import { defOf } from "../../components/factory/type-def.js";
|
|
15
|
+
import { paletteDef, styleDef } from "../../components/factory/style.js";
|
|
15
16
|
function make(def) {
|
|
16
17
|
return { _def: def };
|
|
17
18
|
}
|
|
@@ -76,6 +77,16 @@ export const Types = {
|
|
|
76
77
|
// No kind of its own: a host reads one off the default, as for a bare `property`.
|
|
77
78
|
return make({ default: initial, mapper: resolve, tween: lerp, editor: rest, private: options?.private === true, inherit: options?.inherit });
|
|
78
79
|
},
|
|
80
|
+
/** A colour per series or item, cycled by index. */
|
|
81
|
+
palette: (initial = []) => make(paletteDef(initial)),
|
|
82
|
+
/**
|
|
83
|
+
* A component's look as one entry: fields written in groups (`colors`, `text`, …), read flat
|
|
84
|
+
* (`style.palette`). A host edits it field by field, saves it, and lays a saved one onto any
|
|
85
|
+
* component of the same `family`; `to({ style })` tweens it field by field.
|
|
86
|
+
*/
|
|
87
|
+
style(family, groups, options) {
|
|
88
|
+
return make(styleDef(family, groups, options));
|
|
89
|
+
},
|
|
79
90
|
image: (src = "") => make({ default: src, editor: { kind: "image" }, private: false }),
|
|
80
91
|
video: (src = "") => make({ default: src, editor: { kind: "video" }, private: false }),
|
|
81
92
|
audio: (src = "") => make({ default: src, editor: { kind: "audio" }, private: false }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/factory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkB,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAyC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAkB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAgB,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAoD,MAAM,0CAA0C,CAAC;AAC7H,OAAO,EAAE,cAAc,EAAkD,MAAM,yCAAyC,CAAC;AACzH,OAAO,EAAE,UAAU,EAAe,MAAM,kCAAkC,CAAC;AAI3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAoC,MAAM,kCAAkC,CAA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,uGAAuG;IACvG,OAAO,EAAE,CAAC,OAAO,GAAG,EAAE,EAAiC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACpJ,uFAAuF;IACvF,IAAI,EAAE,CAAC,OAAO,GAAG,CAAC,EAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CAC5G,CAAC","sourcesContent":["import { alignmentOps, type Alignment } from \"@/attributes/layout/alignment\";\nimport { insetsOps, type InsetsProps, type InsetsResolved } from \"@/attributes/layout/insets\";\nimport { sizeInputOps, type SizeInput } from \"@/attributes/layout/size\";\nimport { vector2Ops, type Vector2 } from \"@/attributes/layout/vector2\";\nimport type { PropertyEditor } from \"@/attributes/properties/decorator\";\nimport { cornerRadiusOps, type CornerRadiusResolved, type RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport { cornerStyleOps, type CornerStyleResolved, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport { effectsOps, type Effect } from \"@/attributes/shape/effects/chain\";\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { pathOps } from \"@/attributes/shape/path/ops\";\nimport { shadowOps, type Shadow, type ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport { strokeOps, type Stroke, type StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { textOps } from \"@/attributes/text/ops\";\nimport type { TweenFn } from \"@/props/host\";\nimport type { PathData } from \"@/render/descriptors/path\";\nimport type { AnyType, InOf, Inputs, NodeView, OutOf, StateSpec, Type, Values } from \"@/components/factory/api\";\nimport { defOf, type Inherit, type TypeDef } from \"@/components/factory/type-def\";\n\nexport interface EntryOptions {\n /** Not in documents or calls; only commands write it. A seek restores it like any entry. */\n readonly private?: boolean;\n /** `false`: `to` switches it rather than moving it. */\n readonly animatable?: boolean;\n /** Where it comes from when the author leaves it unset: what an ancestor provides. */\n readonly inherit?: Inherit;\n}\n\nexport interface NumberOptions extends EntryOptions {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly unit?: string;\n /** Shown multiplied by this: `100` with `unit: \"%\"` for a 0–1 fraction. */\n readonly scale?: number;\n}\n\nexport interface TextOptions extends EntryOptions {\n /** `to` types the text out instead of switching at the end. */\n readonly typing?: boolean;\n /** It holds lines, not a label. */\n readonly multiline?: boolean;\n}\n\ntype PrivateOf<O> = O extends { readonly private: true } ? true : false;\n\n/** An attribute type: usable bare (`Types.fill`) or called with a default (`Types.fill('red')`). */\nexport interface Attribute<In, Out> extends Type<In, Out, false> {\n <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>>;\n}\n\nfunction make<In, Out, P extends boolean>(def: TypeDef): Type<In, Out, P> {\n return { _def: def } as Type<In, Out, P>;\n}\n\n/** The editor half of an options object: what the value means, never how an app shows it. */\nfunction meaning(kind: string, options: object | undefined, extra?: PropertyEditor): PropertyEditor {\n const { private: _private, typing: _typing, inherit: _inherit, ...rest } = (options ?? {}) as Record<string, unknown>;\n return { kind, ...extra, ...rest };\n}\n\nfunction attribute<In, Out>(\n kind: string, fallback: In, mapper?: (ext: any, prev?: any) => Out, tween?: TweenFn<Out>,\n): Attribute<In, Out> {\n const base: TypeDef = { default: fallback, mapper, tween, editor: { kind }, private: false };\n const call = <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>> =>\n make({ ...base, default: initial === undefined ? base.default : initial, editor: meaning(kind, options), private: options?.private === true, inherit: options?.inherit });\n return Object.assign(call, { _def: base }) as unknown as Attribute<In, Out>;\n}\n\nfunction defaultsOf(shape: StateSpec): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key in shape) out[key] = defOf(shape[key]).default;\n return out;\n}\n\n/**\n * What a state entry can be. Each lowers onto the `property` options of the\n * attribute it names, so a Type and a typed property are the same pair.\n */\nexport const Types = {\n number<const O extends NumberOptions = {}>(initial = 0, options?: NumberOptions & O): Type<number, number, PrivateOf<O>> {\n return make({ default: initial, editor: meaning(\"number\", options), private: options?.private === true, inherit: options?.inherit });\n },\n text<const O extends TextOptions = {}>(initial = \"\", options?: TextOptions & O): Type<string, string, PrivateOf<O>> {\n return make({ default: initial, tween: options?.typing ? textOps.lerp : undefined, editor: meaning(\"text\", options), private: options?.private === true, inherit: options?.inherit });\n },\n boolean<const O extends EntryOptions = {}>(initial = false, options?: EntryOptions & O): Type<boolean, boolean, PrivateOf<O>> {\n return make({ default: initial, editor: meaning(\"boolean\", options), private: options?.private === true, inherit: options?.inherit });\n },\n oneOf<const V extends readonly string[], const O extends EntryOptions = {}>(\n values: V, options?: EntryOptions & O & { readonly default?: V[number] },\n ): Type<V[number], V[number], PrivateOf<O>> {\n const { default: initial, ...rest } = options ?? ({} as O & { default?: V[number] });\n return make({ default: initial ?? values[0], editor: meaning(\"enum\", rest, { options: values }), private: options?.private === true, inherit: options?.inherit });\n },\n\n fill: attribute<Fill, FillResolved[]>(\"fills\", [], fillOps.resolve, fillOps.lerp),\n stroke: attribute<Stroke, StrokeResolved[]>(\"strokes\", [], strokeOps.resolve, strokeOps.lerp),\n shadow: attribute<Shadow, ShadowResolved[]>(\"shadows\", [], shadowOps.resolve, shadowOps.lerp),\n effects: attribute<Effect, NodeEffect[]>(\"effects\", [], effectsOps.resolve, effectsOps.lerp),\n color: attribute<Color, NormalizedColor>(\"color\", \"black\", colorOps.resolve, colorOps.lerp),\n cornerRadius: attribute<RectCornerRadius, CornerRadiusResolved>(\"cornerRadius\", 0, cornerRadiusOps.resolve, cornerRadiusOps.lerp),\n cornerStyle: attribute<RectCornerStyle, CornerStyleResolved>(\"cornerStyle\", \"rounded\", cornerStyleOps.resolve, cornerStyleOps.lerp),\n path: attribute<PathData, PathData>(\"path\", \"\", undefined, pathOps.lerp),\n insets: attribute<InsetsProps, InsetsResolved>(\"insets\", 0, insetsOps.resolve, insetsOps.lerp),\n alignment: attribute<Alignment, Vector2>(\"alignment\", \"center\", alignmentOps.resolve, alignmentOps.lerp),\n vector2: attribute<Vector2, Vector2>(\"vector2\", { x: 0, y: 0 }, undefined, vector2Ops.lerp),\n size: attribute<SizeInput, SizeInput>(\"size\", \"fill\", undefined, sizeInputOps.lerp),\n\n /** A point in the component's own frame: an editor can drag it. */\n point<const O extends EntryOptions = {}>(initial: Vector2 = { x: 0, y: 0 }, options?: EntryOptions & O): Type<Vector2, Vector2, PrivateOf<O>> {\n return make({ default: initial, tween: vector2Ops.lerp, editor: meaning(\"point\", options), private: options?.private === true, inherit: options?.inherit });\n },\n list<const T extends AnyType, const O extends EntryOptions = {}>(item: T, options?: EntryOptions & O): Type<InOf<T>[], OutOf<T>[], PrivateOf<O>> {\n return make({ default: () => [], editor: meaning(\"list\", options, { item: item._def.editor }), private: options?.private === true, inherit: options?.inherit });\n },\n object<const S extends StateSpec>(shape: S): Type<Inputs<S>, Values<S>> {\n return make({ default: () => defaultsOf(shape), editor: { kind: \"object\" }, private: false });\n },\n custom<In, Out = In, const O extends EntryOptions = {}>(initial: In, options?: EntryOptions & O & {\n readonly resolve?: (value: In) => Out;\n readonly lerp?: (from: Out, to: Out, t: number) => Out;\n /** What the value is, when a host can't tell from the default (`\"vector2\"`), and its parts. */\n readonly kind?: string;\n readonly properties?: PropertyEditor[\"properties\"];\n }): Type<In, Out, PrivateOf<O>> {\n const { resolve, lerp, private: _private, inherit: _inherit, ...rest } = options ?? ({} as NonNullable<typeof options>);\n // No kind of its own: a host reads one off the default, as for a bare `property`.\n return make({ default: initial, mapper: resolve, tween: lerp, editor: rest as PropertyEditor, private: options?.private === true, inherit: options?.inherit });\n },\n image: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"image\" }, private: false }),\n video: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"video\" }, private: false }),\n audio: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"audio\" }, private: false }),\n font: (family = \"\"): Type<string> => make({ default: family, editor: { kind: \"font\" }, private: false }),\n /** Another node, by id: a document holds the id, and a field reads a view of that node (or `null`). */\n nodeRef: (initial = \"\"): Type<string, NodeView | null> => make({ default: initial, editor: { kind: \"nodeRef\", animatable: false }, private: false }),\n /** A seed for deterministic randomness: procedural motion stays a function of time. */\n seed: (initial = 1): Type<number> => make({ default: initial, editor: { kind: \"seed\" }, private: false }),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/factory/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkB,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAyC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAkB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAgB,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAoD,MAAM,0CAA0C,CAAC;AAC7H,OAAO,EAAE,cAAc,EAAkD,MAAM,yCAAyC,CAAC;AACzH,OAAO,EAAE,UAAU,EAAe,MAAM,kCAAkC,CAAC;AAI3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAoC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAo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AAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACpG,IAAI,EAAE,CAAC,MAAM,GAAG,EAAE,EAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACxG,uGAAuG;IACvG,OAAO,EAAE,CAAC,OAAO,GAAG,EAAE,EAAiC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACpJ,uFAAuF;IACvF,IAAI,EAAE,CAAC,OAAO,GAAG,CAAC,EAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CAC5G,CAAC","sourcesContent":["import { alignmentOps, type Alignment } from \"@/attributes/layout/alignment\";\nimport { insetsOps, type InsetsProps, type InsetsResolved } from \"@/attributes/layout/insets\";\nimport { sizeInputOps, type SizeInput } from \"@/attributes/layout/size\";\nimport { vector2Ops, type Vector2 } from \"@/attributes/layout/vector2\";\nimport type { PropertyEditor } from \"@/attributes/properties/decorator\";\nimport { cornerRadiusOps, type CornerRadiusResolved, type RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport { cornerStyleOps, type CornerStyleResolved, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport { effectsOps, type Effect } from \"@/attributes/shape/effects/chain\";\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { pathOps } from \"@/attributes/shape/path/ops\";\nimport { shadowOps, type Shadow, type ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport { strokeOps, type Stroke, type StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { textOps } from \"@/attributes/text/ops\";\nimport type { TweenFn } from \"@/props/host\";\nimport type { PathData } from \"@/render/descriptors/path\";\nimport type { AnyType, InOf, Inputs, NodeView, OutOf, StateSpec, Type, Values } from \"@/components/factory/api\";\nimport { defOf, type Inherit, type TypeDef } from \"@/components/factory/type-def\";\nimport { paletteDef, styleDef, type StyleGroups, type StyleInput, type StyleOptions, type StyleShape, type StyleValues } from \"@/components/factory/style\";\n\nexport interface EntryOptions {\n /** Not in documents or calls; only commands write it. A seek restores it like any entry. */\n readonly private?: boolean;\n /** `false`: `to` switches it rather than moving it. */\n readonly animatable?: boolean;\n /** Where it comes from when the author leaves it unset: what an ancestor provides. */\n readonly inherit?: Inherit;\n}\n\nexport interface NumberOptions extends EntryOptions {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly unit?: string;\n /** Shown multiplied by this: `100` with `unit: \"%\"` for a 0–1 fraction. */\n readonly scale?: number;\n}\n\nexport interface TextOptions extends EntryOptions {\n /** `to` types the text out instead of switching at the end. */\n readonly typing?: boolean;\n /** It holds lines, not a label. */\n readonly multiline?: boolean;\n}\n\ntype PrivateOf<O> = O extends { readonly private: true } ? true : false;\n\n/** An attribute type: usable bare (`Types.fill`) or called with a default (`Types.fill('red')`). */\nexport interface Attribute<In, Out> extends Type<In, Out, false> {\n <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>>;\n}\n\nfunction make<In, Out, P extends boolean>(def: TypeDef): Type<In, Out, P> {\n return { _def: def } as Type<In, Out, P>;\n}\n\n/** The editor half of an options object: what the value means, never how an app shows it. */\nfunction meaning(kind: string, options: object | undefined, extra?: PropertyEditor): PropertyEditor {\n const { private: _private, typing: _typing, inherit: _inherit, ...rest } = (options ?? {}) as Record<string, unknown>;\n return { kind, ...extra, ...rest };\n}\n\nfunction attribute<In, Out>(\n kind: string, fallback: In, mapper?: (ext: any, prev?: any) => Out, tween?: TweenFn<Out>,\n): Attribute<In, Out> {\n const base: TypeDef = { default: fallback, mapper, tween, editor: { kind }, private: false };\n const call = <const O extends EntryOptions = {}>(initial?: In, options?: EntryOptions & O): Type<In, Out, PrivateOf<O>> =>\n make({ ...base, default: initial === undefined ? base.default : initial, editor: meaning(kind, options), private: options?.private === true, inherit: options?.inherit });\n return Object.assign(call, { _def: base }) as unknown as Attribute<In, Out>;\n}\n\nfunction defaultsOf(shape: StateSpec): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key in shape) out[key] = defOf(shape[key]).default;\n return out;\n}\n\n/**\n * What a state entry can be. Each lowers onto the `property` options of the\n * attribute it names, so a Type and a typed property are the same pair.\n */\nexport const Types = {\n number<const O extends NumberOptions = {}>(initial = 0, options?: NumberOptions & O): Type<number, number, PrivateOf<O>> {\n return make({ default: initial, editor: meaning(\"number\", options), private: options?.private === true, inherit: options?.inherit });\n },\n text<const O extends TextOptions = {}>(initial = \"\", options?: TextOptions & O): Type<string, string, PrivateOf<O>> {\n return make({ default: initial, tween: options?.typing ? textOps.lerp : undefined, editor: meaning(\"text\", options), private: options?.private === true, inherit: options?.inherit });\n },\n boolean<const O extends EntryOptions = {}>(initial = false, options?: EntryOptions & O): Type<boolean, boolean, PrivateOf<O>> {\n return make({ default: initial, editor: meaning(\"boolean\", options), private: options?.private === true, inherit: options?.inherit });\n },\n oneOf<const V extends readonly string[], const O extends EntryOptions = {}>(\n values: V, options?: EntryOptions & O & { readonly default?: V[number] },\n ): Type<V[number], V[number], PrivateOf<O>> {\n const { default: initial, ...rest } = options ?? ({} as O & { default?: V[number] });\n return make({ default: initial ?? values[0], editor: meaning(\"enum\", rest, { options: values }), private: options?.private === true, inherit: options?.inherit });\n },\n\n fill: attribute<Fill, FillResolved[]>(\"fills\", [], fillOps.resolve, fillOps.lerp),\n stroke: attribute<Stroke, StrokeResolved[]>(\"strokes\", [], strokeOps.resolve, strokeOps.lerp),\n shadow: attribute<Shadow, ShadowResolved[]>(\"shadows\", [], shadowOps.resolve, shadowOps.lerp),\n effects: attribute<Effect, NodeEffect[]>(\"effects\", [], effectsOps.resolve, effectsOps.lerp),\n color: attribute<Color, NormalizedColor>(\"color\", \"black\", colorOps.resolve, colorOps.lerp),\n cornerRadius: attribute<RectCornerRadius, CornerRadiusResolved>(\"cornerRadius\", 0, cornerRadiusOps.resolve, cornerRadiusOps.lerp),\n cornerStyle: attribute<RectCornerStyle, CornerStyleResolved>(\"cornerStyle\", \"rounded\", cornerStyleOps.resolve, cornerStyleOps.lerp),\n path: attribute<PathData, PathData>(\"path\", \"\", undefined, pathOps.lerp),\n insets: attribute<InsetsProps, InsetsResolved>(\"insets\", 0, insetsOps.resolve, insetsOps.lerp),\n alignment: attribute<Alignment, Vector2>(\"alignment\", \"center\", alignmentOps.resolve, alignmentOps.lerp),\n vector2: attribute<Vector2, Vector2>(\"vector2\", { x: 0, y: 0 }, undefined, vector2Ops.lerp),\n size: attribute<SizeInput, SizeInput>(\"size\", \"fill\", undefined, sizeInputOps.lerp),\n\n /** A point in the component's own frame: an editor can drag it. */\n point<const O extends EntryOptions = {}>(initial: Vector2 = { x: 0, y: 0 }, options?: EntryOptions & O): Type<Vector2, Vector2, PrivateOf<O>> {\n return make({ default: initial, tween: vector2Ops.lerp, editor: meaning(\"point\", options), private: options?.private === true, inherit: options?.inherit });\n },\n list<const T extends AnyType, const O extends EntryOptions = {}>(item: T, options?: EntryOptions & O): Type<InOf<T>[], OutOf<T>[], PrivateOf<O>> {\n return make({ default: () => [], editor: meaning(\"list\", options, { item: item._def.editor }), private: options?.private === true, inherit: options?.inherit });\n },\n object<const S extends StateSpec>(shape: S): Type<Inputs<S>, Values<S>> {\n return make({ default: () => defaultsOf(shape), editor: { kind: \"object\" }, private: false });\n },\n custom<In, Out = In, const O extends EntryOptions = {}>(initial: In, options?: EntryOptions & O & {\n readonly resolve?: (value: In) => Out;\n readonly lerp?: (from: Out, to: Out, t: number) => Out;\n /** What the value is, when a host can't tell from the default (`\"vector2\"`), and its parts. */\n readonly kind?: string;\n readonly properties?: PropertyEditor[\"properties\"];\n }): Type<In, Out, PrivateOf<O>> {\n const { resolve, lerp, private: _private, inherit: _inherit, ...rest } = options ?? ({} as NonNullable<typeof options>);\n // No kind of its own: a host reads one off the default, as for a bare `property`.\n return make({ default: initial, mapper: resolve, tween: lerp, editor: rest as PropertyEditor, private: options?.private === true, inherit: options?.inherit });\n },\n /** A colour per series or item, cycled by index. */\n palette: (initial: readonly Fill[] = []): Type<Fill[], FillResolved[][]> => make(paletteDef(initial)),\n /**\n * A component's look as one entry: fields written in groups (`colors`, `text`, …), read flat\n * (`style.palette`). A host edits it field by field, saves it, and lays a saved one onto any\n * component of the same `family`; `to({ style })` tweens it field by field.\n */\n style<const G extends StyleGroups>(family: string, groups: G, options?: StyleOptions<StyleShape<G>>): Type<StyleInput<StyleShape<G>>, StyleValues<StyleShape<G>>> {\n return make(styleDef(family, groups, options as StyleOptions<unknown>));\n },\n image: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"image\" }, private: false }),\n video: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"video\" }, private: false }),\n audio: (src = \"\"): Type<string> => make({ default: src, editor: { kind: \"audio\" }, private: false }),\n font: (family = \"\"): Type<string> => make({ default: family, editor: { kind: \"font\" }, private: false }),\n /** Another node, by id: a document holds the id, and a field reads a view of that node (or `null`). */\n nodeRef: (initial = \"\"): Type<string, NodeView | null> => make({ default: initial, editor: { kind: \"nodeRef\", animatable: false }, private: false }),\n /** A seed for deterministic randomness: procedural motion stays a function of time. */\n seed: (initial = 1): Type<number> => make({ default: initial, editor: { kind: \"seed\" }, private: false }),\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/components/factory/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAa,QAAQ,EAAS,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAKvK;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,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AO;IAOlB,qFAAqF;IACrF,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAKhC,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;IAW1D,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;IAc/C,gGAAgG;IAChG,IAAI,OAAO,IAAI,OAAO,CAOrB;IAED,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI;IAOjH,2FAA2F;IAC3F,OAAO,CAAC,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;IAe/B,MAAM,IAAI,YAAY;CAKzB;AAKD,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,iBAAiB,CAGnE"}
|
|
@@ -38,7 +38,6 @@ function measureChild(node, max) {
|
|
|
38
38
|
p.sizes.set(node, size);
|
|
39
39
|
return size;
|
|
40
40
|
}
|
|
41
|
-
// ---- child views ------------------------------------------------------------
|
|
42
41
|
const childViews = new WeakMap();
|
|
43
42
|
/** A child as its parent's fields see it. One per child node, reused every frame. */
|
|
44
43
|
class ChildViewImpl {
|
|
@@ -244,7 +243,6 @@ export function snapshot(view) {
|
|
|
244
243
|
out[key] = view[key];
|
|
245
244
|
return out;
|
|
246
245
|
}
|
|
247
|
-
// ---- measurer and render context --------------------------------------------
|
|
248
246
|
export class MeasurerImpl {
|
|
249
247
|
host;
|
|
250
248
|
max = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../../src/components/factory/views.ts"],"names":[],"mappings":"A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AAEzD,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC5C,IAAI,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IAChI,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\nimport type { SizeConstraints } from \"@/layout/constraints\";\nimport type { Node2D, CameraScope } from \"@/components/trees/2d/node2d\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport type { Graphics2D } from \"@/render/graphics2d\";\nimport type { MeasureContext2D } from \"@/render/measure-context\";\nimport type { RenderPass2D } from \"@/render/render-context2d\";\nimport type { Clip } from \"@/render/clip\";\nimport { NullRenderContext } from \"@/render/null-render-context\";\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\nimport { frameIn, Node2D as Node2DClass } from \"@/components/trees/2d/node2d\";\nimport { Node3D } from \"@/components/trees/three/node3d\";\nimport { Scene3D } from \"@/render3d/scene3d\";\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\nimport type { ChildBoundsMode } from \"@/components/trees/2d/group-bounds\";\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\nimport type { TextStyle } from \"@/attributes/text/types\";\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/components/factory/api\";\nimport { clipOf } from \"@/components/factory/clip-of\";\nimport type { PropHost } from \"@/props/host\";\nimport type { PropLayout } from \"@/props/layout\";\n\n/**\n * What a render did with its children beyond drawing them: composited them\n * (the ink bounds that leaves), looked at them through a camera, or stood them\n * in a 2.5D space. Picking and the space machinery read it between frames.\n */\nexport interface Composite {\n readonly bounds?: ChildBoundsMode;\n readonly camera?: CameraScope;\n readonly space?: SpaceCamera;\n /** The scene its 3D children were rendered into: what picking projects through. */\n readonly scene?: Scene3D;\n}\n\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\nexport const NODE = Symbol(\"componentNode\");\n\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\nexport interface ComponentHost extends Node2D {\n _renderOwnChildren(pass: RenderPass2D): void;\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\n _lastShape: Graphics2D | null;\n /** The composite its last render or probe declared; `undefined` before either. */\n _record: Composite | null | undefined;\n}\n\n// ---- the pass in progress -------------------------------------------------\n\n/**\n * Measure and layout run synchronously, one node at a time, so the node being\n * laid out and its measurer are a single slot rather than state on every view.\n */\ninterface Pass {\n readonly node: Node2D;\n readonly scope: MeasureContext2D;\n readonly room: Max;\n readonly sizes: Map<Node2D, Size2D>;\n}\n\nlet pass: Pass | null = null;\n\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\n const outer = pass;\n pass = { node, scope, room, sizes: new Map() };\n try {\n return run();\n } finally {\n pass = outer;\n }\n}\n\nconst decided = new WeakSet<Node2D>();\n\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\nexport function markDecided(node: Node2D): void {\n decided.add(node);\n}\n\nexport function takeDecided(node: Node2D): boolean {\n return decided.delete(node);\n}\n\nexport function currentPass(): Pass {\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\n return pass;\n}\n\nfunction measureChild(node: Node2D, max: Max): Size2D {\n const p = currentPass();\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\n const measured = node.measure(constraints, p.scope);\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\n p.sizes.set(node, size);\n return size;\n}\n\n// ---- child views ------------------------------------------------------------\n\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\n\n/** A child as its parent's fields see it. One per child node, reused every frame. */\nclass ChildViewImpl implements ChildView {\n readonly [NODE]: Node2D;\n readonly state: never;\n\n constructor(node: Node2D) {\n this[NODE] = node;\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\n // Its props live on the prototype, so the proxy lists them as its own, as a spread or `Object.keys` expects.\n this.state = new Proxy(node, {\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\n ownKeys: (target) => {\n const keys = Reflect.ownKeys(target);\n const own = new Set(keys);\n for (const key of propsOf(target)) if (!own.has(key)) keys.push(key);\n return keys;\n },\n getOwnPropertyDescriptor: (target, key) => {\n const own = Reflect.getOwnPropertyDescriptor(target, key);\n if (own || typeof key !== \"string\" || !propsOf(target).has(key)) return own;\n return { value: Reflect.get(target, key), writable: false, enumerable: true, configurable: true };\n },\n }) as never;\n }\n\n get id(): string { return this[NODE].id; }\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\n\n get size(): Size2D {\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\n if (!pass) {\n const box = this[NODE].layoutBounds;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\n }\n\n get children(): readonly ChildView[] {\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\n }\n\n measure(max: Max): Size2D {\n return measureChild(this[NODE], max);\n }\n\n to(targets: object): Piece {\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\n }\n\n run(name: string, args?: object): Piece {\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\n }\n}\n\nconst NO_PROPS: ReadonlySet<string> = new Set();\n\nfunction propsOf(node: object): ReadonlySet<string> {\n const slots = (node as PropHost).__cells?.slots;\n return slots ? new Set(slots.keys()) : NO_PROPS;\n}\n\nexport function childView(node: Node2D | Node): ChildView {\n let view = childViews.get(node as Node2D);\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\n return view as unknown as ChildView;\n}\n\nexport function nodeOfView(view: ChildView<any>): Node2D {\n return (view as unknown as ChildViewImpl)[NODE];\n}\n\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\n\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\n\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\nclass NodeViewImpl implements NodeView {\n readonly [NODE]: Node;\n readonly state: never;\n\n constructor(node: Node, readonly reader: Node) {\n this[NODE] = node;\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\n // Anything else it has (a 2D node's cardinal points) reads off the node.\n const fields = (node as { _view?: object })._view ?? node;\n this.state = new Proxy(fields, {\n get: (target, key) => {\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\n if (key === \"constructor\") return node.constructor;\n if (key in target) return Reflect.get(target, key);\n const value = Reflect.get(node, key) as unknown;\n // A method of the node runs on the node, not on this read-only view.\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\n },\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\n }) as never;\n }\n\n get id(): string { return this[NODE].id; }\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\n\n get size(): Size2D {\n const node = this[NODE];\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n\n get frame(): NodeFrame {\n const node = this[NODE];\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\n }\n}\n\n/** `node` as `reader` sees it. One view per pair. */\nexport function nodeView(node: Node, reader: Node): NodeView {\n let byReader = nodeViews.get(node);\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\n let view = byReader.get(reader);\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\n return view;\n}\n\nexport function nodeOfNodeView(view: NodeView): Node {\n return (view as unknown as NodeViewImpl)[NODE];\n}\n\nconst found = new WeakMap<Node, Map<string, Node>>();\n\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\nexport function referenced(reader: Node, id: unknown): NodeView | null {\n if (typeof id !== \"string\" || id === \"\") return null;\n let known = found.get(reader);\n let node = known?.get(id);\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\n node = findIn(rootOf(reader), id) ?? undefined;\n if (!node) {\n known?.delete(id);\n return null;\n }\n if (!known) found.set(reader, known = new Map());\n known.set(id, node);\n }\n return nodeView(node, reader);\n}\n\nfunction rootOf(node: Node): Node {\n let at = node;\n while (at.parent) at = at.parent;\n return at;\n}\n\nfunction findIn(at: Node, id: string): Node | null {\n if (at.id === id) return at;\n for (const child of at._allChildren) {\n const hit = findIn(child, id);\n if (hit) return hit;\n }\n return null;\n}\n\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\n/** Set by the factory module, which owns the node descriptors. */\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\n keyOf = lookup;\n}\n\n// ---- state views ------------------------------------------------------------\n\n/**\n * One prototype of getters per component, so a node's `state` is a single\n * object made once: every read goes straight to the node's own slot, and a\n * frame allocates nothing to hand its fields their values.\n */\nexport interface ViewShape {\n readonly proto: object;\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\n readonly entries: PropertyDescriptorMap;\n}\n\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\n const entries: PropertyDescriptorMap = {};\n for (const key of keys) {\n entries[key] = references.has(key)\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\n : { get: entryGetter(key), enumerable: true };\n }\n const proto = {};\n // The children of the node's own tree, as its commands see them too.\n Object.defineProperty(proto, \"children\", {\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\n enumerable: false,\n });\n return { proto, entries };\n}\n\n/** Reads the entry's slot by its index in the node's layout, found once per layout: no lookup by name per read. */\nfunction entryGetter(key: string): (this: { [NODE]: object }) => unknown {\n let layout: PropLayout | undefined;\n let i = -1;\n return function () {\n const node = this[NODE];\n const cells = (node as PropHost).__cells;\n if (cells !== undefined) {\n if (cells.layout !== layout) {\n i = cells.layout.indexOf(key);\n // An entry not registered yet is looked for again next time.\n layout = i < 0 ? undefined : cells.layout;\n }\n const slot = i < 0 ? undefined : cells.list[i];\n if (slot !== undefined) return slot.get();\n }\n return (node as Record<string, unknown>)[key];\n };\n}\n\nexport function stateView(shape: ViewShape, node: object): object {\n const view = Object.create(shape.proto) as { [NODE]: object };\n Object.defineProperties(view, shape.entries);\n view[NODE] = node;\n return view;\n}\n\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\nexport function snapshot(view: object): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\n return out;\n}\n\n// ---- measurer and render context --------------------------------------------\n\nexport class MeasurerImpl implements Measurer {\n max: Max = {};\n scope: MeasureContext2D | null = null;\n\n constructor(readonly host: Node) { }\n\n get time(): Clock {\n return this.host.time;\n }\n\n text(text: string, font: FontSpec): Size2D {\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\n }\n}\n\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\nexport class RenderContextImpl implements RenderContext2D {\n pass: RenderPass2D | null = null;\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\n cut: Clip | null = null;\n\n /**\n * `probing`: `render` runs only to find the shape it paints (for clip and\n * picking outside a frame), so nothing is drawn and no child is visited.\n */\n constructor(readonly host: ComponentHost, readonly probing = false) { }\n\n get size(): Size2D {\n const box = this.host.layoutBounds;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n\n get time(): Clock {\n return this.host.time;\n }\n\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\n if (!graphics || this.probing) return;\n const out = this.target();\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\n else out.draw(graphics as Graphics2D);\n }\n\n children(): void {\n if (this.probing) return;\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\n if (!this.composite) this.host._record = null;\n this.host._renderOwnChildren(this.target());\n }\n\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\n composite: Composite | null = null;\n\n private _declare(composite: Composite): void {\n this.composite = { ...this.composite, ...composite };\n if (!this.probing) this.host._record = this.composite;\n }\n\n mask(options: MaskOptions): void {\n this._declare({ bounds: \"first\" });\n if (this.probing) return;\n const out = this.target();\n const [stencil, ...content] = this.host.children;\n if (!stencil) return;\n if (content.length === 0) {\n stencil.render(out);\n return;\n }\n out.beginMask({ mode: options.mode, inverted: options.inverted });\n stencil.render(out);\n out.applyMask();\n for (const child of content) child.render(out);\n out.endMask();\n }\n\n merge(op: BooleanOperation, paint: MergePaint): void {\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\n if (this.probing) return;\n const out = this.target();\n out.beginBoolean(op);\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\n out.endBoolean();\n // A drawing with no shape of its own paints the merged outline.\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\n out.draw(new GraphicsClass().stroke(paint.stroke));\n }\n\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\n camera(scope: CameraScope): void {\n this._declare({ camera: scope });\n if (this.probing) return;\n const out = this.target();\n const rect = this.host.layoutBounds;\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\n out.endCamera();\n }\n\n /** Your 3D children, rendered in order into a new scene. */\n scene3D(): Scene3D {\n const scene = new Scene3D();\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\n this._declare({ scene });\n return scene;\n }\n\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\n space(camera: SpaceCamera): void {\n this._declare({ space: camera });\n if (!this.probing) this.host._renderOwnChildren(this.target());\n }\n\n textStyle(style: TextStyle | null, body: () => void): void {\n if (this.probing) return body();\n const out = this.target();\n out.pushTextStyle(style);\n try {\n body();\n } finally {\n out.popTextStyle();\n }\n }\n\n clip(shape: Graphics2D, body: () => void): void {\n if (this.probing) return body();\n const outline = clipOf(shape);\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\n if (outline.isEmpty()) return body();\n const out = this.target();\n out.beginClip(outline);\n try {\n body();\n } finally {\n out.endClip();\n }\n }\n\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\n get inSpace(): boolean {\n for (let at = this.host.parent; at; at = at.parent) {\n if (!(at instanceof Node2DClass)) return false;\n if (at._spaceCamera()) return true;\n if (!at._rendersChildrenInSpace()) return false;\n }\n return false;\n }\n\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\n for (let at = this.host.parent; at; at = at.parent) {\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\n }\n return null;\n }\n\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\n inFront(body: () => void): void {\n if (this.probing) return;\n const out = this.target();\n if (!this.cut) {\n body();\n return;\n }\n out.beginClip(this.cut);\n try {\n body();\n } finally {\n out.endClip();\n }\n }\n\n target(): RenderPass2D {\n if (this.probing) return PROBE_PASS;\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\n return this.pass;\n }\n}\n\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\n\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\n return ctx;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../../src/components/factory/views.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAO7C,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAiBtD,gHAAgH;AAChH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAsB5C,IAAI,IAAI,GAAgB,IAAI,CAAC;AAE7B,MAAM,UAAU,QAAQ,CAAI,IAAY,EAAE,KAAuB,EAAE,IAAS,EAAE,GAAY;IACtF,MAAM,KAAK,GAAG,IAAI,CAAC;IACnB,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAC/C,IAAI,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;IACjB,CAAC;YAAS,CAAC;QACP,IAAI,GAAG,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAU,CAAC;AAEtC,0GAA0G;AAC1G,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,WAAW;IACvB,IAAI,CAAC,I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AAI,CAAC;IACrB,CAAC;CACJ;AAED,uFAAuF;AACvF,MAAM,UAAU,GAAiB,IAAI,iBAAiB,EAAE,CAAC;AAEzD,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC5C,IAAI,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IAChI,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\nimport type { SizeConstraints } from \"@/layout/constraints\";\nimport type { Node2D, CameraScope } from \"@/components/trees/2d/node2d\";\nimport type { Node } from \"@/components/trees/node/node\";\nimport type { Graphics2D } from \"@/render/graphics2d\";\nimport type { MeasureContext2D } from \"@/render/measure-context\";\nimport type { RenderPass2D } from \"@/render/render-context2d\";\nimport type { Clip } from \"@/render/clip\";\nimport { NullRenderContext } from \"@/render/null-render-context\";\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\nimport { frameIn, Node2D as Node2DClass } from \"@/components/trees/2d/node2d\";\nimport { Node3D } from \"@/components/trees/three/node3d\";\nimport { Scene3D } from \"@/render3d/scene3d\";\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\nimport type { ChildBoundsMode } from \"@/components/trees/2d/group-bounds\";\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\nimport type { TextStyle } from \"@/attributes/text/types\";\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/components/factory/api\";\nimport { clipOf } from \"@/components/factory/clip-of\";\nimport type { PropHost } from \"@/props/host\";\nimport type { PropLayout } from \"@/props/layout\";\n\n/**\n * What a render did with its children beyond drawing them: composited them\n * (the ink bounds that leaves), looked at them through a camera, or stood them\n * in a 2.5D space. Picking and the space machinery read it between frames.\n */\nexport interface Composite {\n readonly bounds?: ChildBoundsMode;\n readonly camera?: CameraScope;\n readonly space?: SpaceCamera;\n /** The scene its 3D children were rendered into: what picking projects through. */\n readonly scene?: Scene3D;\n}\n\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\nexport const NODE = Symbol(\"componentNode\");\n\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\nexport interface ComponentHost extends Node2D {\n _renderOwnChildren(pass: RenderPass2D): void;\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\n _lastShape: Graphics2D | null;\n /** The composite its last render or probe declared; `undefined` before either. */\n _record: Composite | null | undefined;\n}\n\n/**\n * Measure and layout run synchronously, one node at a time, so the node being\n * laid out and its measurer are a single slot rather than state on every view.\n */\ninterface Pass {\n readonly node: Node2D;\n readonly scope: MeasureContext2D;\n readonly room: Max;\n readonly sizes: Map<Node2D, Size2D>;\n}\n\nlet pass: Pass | null = null;\n\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\n const outer = pass;\n pass = { node, scope, room, sizes: new Map() };\n try {\n return run();\n } finally {\n pass = outer;\n }\n}\n\nconst decided = new WeakSet<Node2D>();\n\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\nexport function markDecided(node: Node2D): void {\n decided.add(node);\n}\n\nexport function takeDecided(node: Node2D): boolean {\n return decided.delete(node);\n}\n\nexport function currentPass(): Pass {\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\n return pass;\n}\n\nfunction measureChild(node: Node2D, max: Max): Size2D {\n const p = currentPass();\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\n const measured = node.measure(constraints, p.scope);\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\n p.sizes.set(node, size);\n return size;\n}\n\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\n\n/** A child as its parent's fields see it. One per child node, reused every frame. */\nclass ChildViewImpl implements ChildView {\n readonly [NODE]: Node2D;\n readonly state: never;\n\n constructor(node: Node2D) {\n this[NODE] = node;\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\n // Its props live on the prototype, so the proxy lists them as its own, as a spread or `Object.keys` expects.\n this.state = new Proxy(node, {\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\n ownKeys: (target) => {\n const keys = Reflect.ownKeys(target);\n const own = new Set(keys);\n for (const key of propsOf(target)) if (!own.has(key)) keys.push(key);\n return keys;\n },\n getOwnPropertyDescriptor: (target, key) => {\n const own = Reflect.getOwnPropertyDescriptor(target, key);\n if (own || typeof key !== \"string\" || !propsOf(target).has(key)) return own;\n return { value: Reflect.get(target, key), writable: false, enumerable: true, configurable: true };\n },\n }) as never;\n }\n\n get id(): string { return this[NODE].id; }\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\n\n get size(): Size2D {\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\n if (!pass) {\n const box = this[NODE].layoutBounds;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\n }\n\n get children(): readonly ChildView[] {\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\n }\n\n measure(max: Max): Size2D {\n return measureChild(this[NODE], max);\n }\n\n to(targets: object): Piece {\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\n }\n\n run(name: string, args?: object): Piece {\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\n }\n}\n\nconst NO_PROPS: ReadonlySet<string> = new Set();\n\nfunction propsOf(node: object): ReadonlySet<string> {\n const slots = (node as PropHost).__cells?.slots;\n return slots ? new Set(slots.keys()) : NO_PROPS;\n}\n\nexport function childView(node: Node2D | Node): ChildView {\n let view = childViews.get(node as Node2D);\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\n return view as unknown as ChildView;\n}\n\nexport function nodeOfView(view: ChildView<any>): Node2D {\n return (view as unknown as ChildViewImpl)[NODE];\n}\n\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\n\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\n\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\nclass NodeViewImpl implements NodeView {\n readonly [NODE]: Node;\n readonly state: never;\n\n constructor(node: Node, readonly reader: Node) {\n this[NODE] = node;\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\n // Anything else it has (a 2D node's cardinal points) reads off the node.\n const fields = (node as { _view?: object })._view ?? node;\n this.state = new Proxy(fields, {\n get: (target, key) => {\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\n if (key === \"constructor\") return node.constructor;\n if (key in target) return Reflect.get(target, key);\n const value = Reflect.get(node, key) as unknown;\n // A method of the node runs on the node, not on this read-only view.\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\n },\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\n }) as never;\n }\n\n get id(): string { return this[NODE].id; }\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\n\n get size(): Size2D {\n const node = this[NODE];\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n\n get frame(): NodeFrame {\n const node = this[NODE];\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\n }\n}\n\n/** `node` as `reader` sees it. One view per pair. */\nexport function nodeView(node: Node, reader: Node): NodeView {\n let byReader = nodeViews.get(node);\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\n let view = byReader.get(reader);\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\n return view;\n}\n\nexport function nodeOfNodeView(view: NodeView): Node {\n return (view as unknown as NodeViewImpl)[NODE];\n}\n\nconst found = new WeakMap<Node, Map<string, Node>>();\n\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\nexport function referenced(reader: Node, id: unknown): NodeView | null {\n if (typeof id !== \"string\" || id === \"\") return null;\n let known = found.get(reader);\n let node = known?.get(id);\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\n node = findIn(rootOf(reader), id) ?? undefined;\n if (!node) {\n known?.delete(id);\n return null;\n }\n if (!known) found.set(reader, known = new Map());\n known.set(id, node);\n }\n return nodeView(node, reader);\n}\n\nfunction rootOf(node: Node): Node {\n let at = node;\n while (at.parent) at = at.parent;\n return at;\n}\n\nfunction findIn(at: Node, id: string): Node | null {\n if (at.id === id) return at;\n for (const child of at._allChildren) {\n const hit = findIn(child, id);\n if (hit) return hit;\n }\n return null;\n}\n\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\n/** Set by the factory module, which owns the node descriptors. */\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\n keyOf = lookup;\n}\n\n/**\n * One prototype of getters per component, so a node's `state` is a single\n * object made once: every read goes straight to the node's own slot, and a\n * frame allocates nothing to hand its fields their values.\n */\nexport interface ViewShape {\n readonly proto: object;\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\n readonly entries: PropertyDescriptorMap;\n}\n\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\n const entries: PropertyDescriptorMap = {};\n for (const key of keys) {\n entries[key] = references.has(key)\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\n : { get: entryGetter(key), enumerable: true };\n }\n const proto = {};\n // The children of the node's own tree, as its commands see them too.\n Object.defineProperty(proto, \"children\", {\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\n enumerable: false,\n });\n return { proto, entries };\n}\n\n/** Reads the entry's slot by its index in the node's layout, found once per layout: no lookup by name per read. */\nfunction entryGetter(key: string): (this: { [NODE]: object }) => unknown {\n let layout: PropLayout | undefined;\n let i = -1;\n return function () {\n const node = this[NODE];\n const cells = (node as PropHost).__cells;\n if (cells !== undefined) {\n if (cells.layout !== layout) {\n i = cells.layout.indexOf(key);\n // An entry not registered yet is looked for again next time.\n layout = i < 0 ? undefined : cells.layout;\n }\n const slot = i < 0 ? undefined : cells.list[i];\n if (slot !== undefined) return slot.get();\n }\n return (node as Record<string, unknown>)[key];\n };\n}\n\nexport function stateView(shape: ViewShape, node: object): object {\n const view = Object.create(shape.proto) as { [NODE]: object };\n Object.defineProperties(view, shape.entries);\n view[NODE] = node;\n return view;\n}\n\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\nexport function snapshot(view: object): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\n return out;\n}\n\nexport class MeasurerImpl implements Measurer {\n max: Max = {};\n scope: MeasureContext2D | null = null;\n\n constructor(readonly host: Node) { }\n\n get time(): Clock {\n return this.host.time;\n }\n\n text(text: string, font: FontSpec): Size2D {\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\n }\n}\n\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\nexport class RenderContextImpl implements RenderContext2D {\n pass: RenderPass2D | null = null;\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\n cut: Clip | null = null;\n\n /**\n * `probing`: `render` runs only to find the shape it paints (for clip and\n * picking outside a frame), so nothing is drawn and no child is visited.\n */\n constructor(readonly host: ComponentHost, readonly probing = false) { }\n\n get size(): Size2D {\n const box = this.host.layoutBounds;\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\n }\n\n get time(): Clock {\n return this.host.time;\n }\n\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\n if (!graphics || this.probing) return;\n const out = this.target();\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\n else out.draw(graphics as Graphics2D);\n }\n\n children(): void {\n if (this.probing) return;\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\n if (!this.composite) this.host._record = null;\n this.host._renderOwnChildren(this.target());\n }\n\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\n composite: Composite | null = null;\n\n private _declare(composite: Composite): void {\n this.composite = { ...this.composite, ...composite };\n if (!this.probing) this.host._record = this.composite;\n }\n\n mask(options: MaskOptions): void {\n this._declare({ bounds: \"first\" });\n if (this.probing) return;\n const out = this.target();\n const [stencil, ...content] = this.host.children;\n if (!stencil) return;\n if (content.length === 0) {\n stencil.render(out);\n return;\n }\n out.beginMask({ mode: options.mode, inverted: options.inverted });\n stencil.render(out);\n out.applyMask();\n for (const child of content) child.render(out);\n out.endMask();\n }\n\n merge(op: BooleanOperation, paint: MergePaint): void {\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\n if (this.probing) return;\n const out = this.target();\n out.beginBoolean(op);\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\n out.endBoolean();\n // A drawing with no shape of its own paints the merged outline.\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\n out.draw(new GraphicsClass().stroke(paint.stroke));\n }\n\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\n camera(scope: CameraScope): void {\n this._declare({ camera: scope });\n if (this.probing) return;\n const out = this.target();\n const rect = this.host.layoutBounds;\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\n out.endCamera();\n }\n\n /** Your 3D children, rendered in order into a new scene. */\n scene3D(): Scene3D {\n const scene = new Scene3D();\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\n this._declare({ scene });\n return scene;\n }\n\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\n space(camera: SpaceCamera): void {\n this._declare({ space: camera });\n if (!this.probing) this.host._renderOwnChildren(this.target());\n }\n\n textStyle(style: TextStyle | null, body: () => void): void {\n if (this.probing) return body();\n const out = this.target();\n out.pushTextStyle(style);\n try {\n body();\n } finally {\n out.popTextStyle();\n }\n }\n\n clip(shape: Graphics2D, body: () => void): void {\n if (this.probing) return body();\n const outline = clipOf(shape);\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\n if (outline.isEmpty()) return body();\n const out = this.target();\n out.beginClip(outline);\n try {\n body();\n } finally {\n out.endClip();\n }\n }\n\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\n get inSpace(): boolean {\n for (let at = this.host.parent; at; at = at.parent) {\n if (!(at instanceof Node2DClass)) return false;\n if (at._spaceCamera()) return true;\n if (!at._rendersChildrenInSpace()) return false;\n }\n return false;\n }\n\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\n for (let at = this.host.parent; at; at = at.parent) {\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\n }\n return null;\n }\n\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\n inFront(body: () => void): void {\n if (this.probing) return;\n const out = this.target();\n if (!this.cut) {\n body();\n return;\n }\n out.beginClip(this.cut);\n try {\n body();\n } finally {\n out.endClip();\n }\n }\n\n target(): RenderPass2D {\n if (this.probing) return PROBE_PASS;\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\n return this.pass;\n }\n}\n\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\n\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\n return ctx;\n}\n"]}
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
import { Node2D } from "../../../components/trees/2d/node2d.js";
|
|
2
2
|
import { BoxBounds } from "../../../layout/bounds.js";
|
|
3
3
|
/**
|
|
4
|
-
* The ink extent of a node whose drawing is made **out of its children**
|
|
5
|
-
*
|
|
4
|
+
* The ink extent of a node whose drawing is made **out of its children** (a {@link BooleanGroup}, a
|
|
5
|
+
* {@link MaskGroup}), whose layout cell is otherwise a fiction: nothing is drawn or grabbable at its edges and it
|
|
6
|
+
* doesn't move with the parts. This is what {@link Node2D._localBounds} exists to fix, a separate seam from
|
|
7
|
+
* `measure()` (the box moves, the layout does not).
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* exists to fix, and the reason it is a separate seam from `measure()`: the box
|
|
13
|
-
* moves, the layout does not.
|
|
9
|
+
* A bounding box is what you *can* work out without running the boolean. A union is exact
|
|
10
|
+
* (`bounds(A ∪ B) = bounds(A) ∪ bounds(B)`) and also the honest answer for `exclude` (a subset, parts still visible).
|
|
11
|
+
* `subtract` can only cut into the first child and `intersect` lives inside every child. Each mode states which it
|
|
12
|
+
* is; the result is a *superset* of the true silhouette for `subtract`/`intersect` and exact for the others, never a
|
|
13
|
+
* box the drawing spills out of.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* A bounding box is the one thing about a boolean result you *can* work out
|
|
18
|
-
* without running the boolean. For a union it is even exact —
|
|
19
|
-
* `bounds(A ∪ B) = bounds(A) ∪ bounds(B)` — and the same union is the honest
|
|
20
|
-
* answer for `exclude`, whose result is a subset of it and whose parts are all
|
|
21
|
-
* still there to be seen. The other two shrink instead: subtracting can only
|
|
22
|
-
* ever cut into the first child, and an intersection lives inside every child
|
|
23
|
-
* at once. So each mode below states which of those it is, and the result is a
|
|
24
|
-
* *superset* of the true silhouette for `subtract`/`intersect` and exact for
|
|
25
|
-
* the other two — never a box the drawing spills out of, which is the failure
|
|
26
|
-
* that would matter.
|
|
27
|
-
*
|
|
28
|
-
* ## Why this composes with a resize that scales the children
|
|
29
|
-
*
|
|
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
|
-
* coherent if the box it is dragging follows the parts by the same factor. It
|
|
33
|
-
* does, for all three modes: an axis-aligned scale about a point commutes with
|
|
34
|
-
* union and intersection alike, so scaling every child by `k` scales the answer
|
|
35
|
-
* here by exactly `k`. Neither half has to know about the other.
|
|
15
|
+
* This composes with a resize that scales the children about the corner the drag holds still: an axis-aligned scale
|
|
16
|
+
* about a point commutes with union and intersection, so scaling every child by `k` scales the answer by exactly `k`.
|
|
36
17
|
*/
|
|
37
18
|
export type ChildBoundsMode =
|
|
38
19
|
/** Every child's ink, together — `union` and `exclude`. */
|
|
@@ -41,16 +22,6 @@ export type ChildBoundsMode =
|
|
|
41
22
|
| "first"
|
|
42
23
|
/** Where every child's ink overlaps — `intersect`. */
|
|
43
24
|
| "intersect";
|
|
44
|
-
/**
|
|
45
|
-
* The extent of `node`'s children's ink in `node`'s own local space, or `null`
|
|
46
|
-
* when there is nothing to measure — no children, or an `intersect` whose parts
|
|
47
|
-
* don't overlap at all.
|
|
48
|
-
*
|
|
49
|
-
* `null` is the caller's cue to keep the layout cell: a node with no children
|
|
50
|
-
* has nothing else to offer, and an empty intersection draws nothing anywhere,
|
|
51
|
-
* so a box round the parts would be a box round a shape that isn't there. The
|
|
52
|
-
* cell at least stays in one place and stays grabbable, which is what a node you
|
|
53
|
-
* need to put another child into has to be.
|
|
54
|
-
*/
|
|
25
|
+
/** The extent of `node`'s children's ink in its own local space, or `null` with nothing to measure (no children, or an `intersect` whose parts don't overlap). `null` is the caller's cue to keep the layout cell: it stays put and grabbable, which a node you need to drop another child into must be. */
|
|
55
26
|
export declare function childInkBounds(node: Node2D, mode: ChildBoundsMode): BoxBounds | null;
|
|
56
27
|
//# sourceMappingURL=group-bounds.d.ts.map
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe;AACvB,2DAA2D;AACzD,OAAO;AACT,6EAA6E;GAC3E,OAAO;AACT,sDAAsD;GACpD,WAAW,CAAC;AA0ClB,4SAA4S;AAC5S,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,GACtB,SAAS,GAAG,IAAI,CA8BlB"}
|