@motionscript/core 0.1.0-alpha.9 → 0.1.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/assets/asset-index.d.ts +1 -8
- package/dist/assets/asset-index.d.ts.map +1 -1
- package/dist/assets/asset-index.js +1 -8
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +10 -72
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +3 -29
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts +8 -20
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -20
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +9 -51
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +13 -78
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/record.d.ts +2 -18
- package/dist/assets/record.d.ts.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -18
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +2 -11
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +2 -12
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
- package/dist/attributes/audio/effects/chain.js +1 -7
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/registry.d.ts +3 -18
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
- package/dist/attributes/audio/effects/registry.js +4 -23
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/ramp.d.ts +5 -38
- package/dist/attributes/audio/ramp.d.ts.map +1 -1
- package/dist/attributes/audio/ramp.js +3 -28
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +10 -80
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +1 -4
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +2 -12
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +2 -11
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +2 -26
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +1 -9
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +1 -8
- package/dist/attributes/audio/transition.d.ts.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/layout/alignment.d.ts +6 -38
- package/dist/attributes/layout/alignment.d.ts.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +2 -27
- package/dist/attributes/layout/insets.d.ts.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +29 -114
- package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
- package/dist/attributes/layout/matrix2d.js +26 -110
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +3 -25
- package/dist/attributes/layout/size.d.ts.map +1 -1
- package/dist/attributes/layout/size.js +2 -18
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.d.ts +16 -79
- package/dist/attributes/layout/space3d.d.ts.map +1 -1
- package/dist/attributes/layout/space3d.js +17 -81
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.d.ts +2 -23
- package/dist/attributes/layout/transform3d.d.ts.map +1 -1
- package/dist/attributes/layout/transform3d.js +1 -7
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/world-transform.d.ts +2 -16
- package/dist/attributes/layout/world-transform.d.ts.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +13 -73
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +9 -40
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +6 -45
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -37
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +11 -83
- package/dist/attributes/render3d/orbit.d.ts.map +1 -1
- package/dist/attributes/render3d/orbit.js +10 -73
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
- package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js +2 -12
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.d.ts +2 -21
- package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corners.js +2 -12
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js +3 -26
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +36 -328
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +24 -242
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js +6 -33
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +1 -6
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +1 -7
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +0 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +0 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +1 -9
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +0 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +0 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +2 -8
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +0 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +2 -9
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +0 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +1 -5
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +6 -41
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +7 -45
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +6 -30
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
- package/dist/attributes/shape/effects/spec.js +3 -9
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/fill/blend.d.ts +1 -17
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
- package/dist/attributes/shape/fill/blend.js +2 -15
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +17 -125
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +22 -109
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.d.ts +10 -35
- package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
- package/dist/attributes/shape/fill/coerce.js +12 -47
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +35 -96
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js +2 -13
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
- package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js +2 -8
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +6 -23
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +5 -17
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +12 -50
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +2 -13
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +2 -9
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
- package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js +8 -35
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +2 -26
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +5 -40
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.d.ts +6 -30
- package/dist/attributes/shape/fill/union.d.ts.map +1 -1
- package/dist/attributes/shape/fill/union.js +1 -9
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +15 -168
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +8 -132
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
- package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -6
- package/dist/attributes/shape/filters/index.d.ts.map +1 -1
- package/dist/attributes/shape/filters/index.js +0 -2
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +5 -35
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +7 -50
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +10 -51
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts +18 -106
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +15 -124
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.d.ts +6 -54
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
- package/dist/attributes/shape/path/bezier.js +10 -98
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.d.ts +1 -11
- package/dist/attributes/shape/path/index.d.ts.map +1 -1
- package/dist/attributes/shape/path/index.js +1 -11
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.d.ts +5 -41
- package/dist/attributes/shape/path/measure.d.ts.map +1 -1
- package/dist/attributes/shape/path/measure.js +8 -57
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts +4 -41
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +17 -117
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +5 -19
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.d.ts +10 -67
- package/dist/attributes/shape/path/types.d.ts.map +1 -1
- package/dist/attributes/shape/path/types.js +0 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.d.ts +9 -63
- package/dist/attributes/shape/path/walk.d.ts.map +1 -1
- package/dist/attributes/shape/path/walk.js +21 -100
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +2 -14
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/language.js +1 -8
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.d.ts +13 -78
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +1 -10
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -28
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
- package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js +0 -3
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +0 -6
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +1 -8
- package/dist/attributes/shared/operators.d.ts.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.d.ts +1 -11
- package/dist/attributes/text/index.d.ts.map +1 -1
- package/dist/attributes/text/index.js +1 -11
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +4 -30
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +7 -23
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +5 -28
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-3ZIUZZC7.js +13 -0
- package/dist/browser/chunks/chunk-3ZIUZZC7.js.map +7 -0
- package/dist/browser/chunks/chunk-5TDMGUXQ.js +3 -0
- package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
- package/dist/browser/chunks/chunk-7YOYMMXK.js +6 -0
- package/dist/browser/chunks/chunk-7YOYMMXK.js.map +7 -0
- package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
- package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +3 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -10
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.d.ts +15 -62
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js +29 -168
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.d.ts +1 -14
- package/dist/components/builtins/layout/layout.d.ts.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +11 -51
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +3 -7
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/text/number-format.d.ts +14 -47
- package/dist/components/builtins/text/number-format.d.ts.map +1 -1
- package/dist/components/builtins/text/number-format.js +19 -69
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.d.ts +3 -37
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
- package/dist/components/builtins/text/number-pattern.js +6 -48
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.d.ts +7 -25
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
- package/dist/components/builtins/text/text-defaults.js +7 -25
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.d.ts +2 -11
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
- package/dist/components/builtins/text/text-layout.js +7 -22
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +8 -46
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.d.ts +6 -51
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js +8 -46
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.d.ts +22 -117
- package/dist/components/builtins/three/three.d.ts.map +1 -1
- package/dist/components/builtins/three/three.js +5 -17
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +41 -3
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.d.ts +12 -41
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
- package/dist/components/trees/2d/group-bounds.js +3 -22
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js +35 -127
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.d.ts +4 -36
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
- package/dist/components/trees/2d/node-motion.js +3 -31
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +3 -20
- package/dist/components/trees/2d/node-render.d.ts.map +1 -1
- package/dist/components/trees/2d/node-render.js +4 -23
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.d.ts +4 -23
- package/dist/components/trees/2d/node-space.d.ts.map +1 -1
- package/dist/components/trees/2d/node-space.js +3 -17
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.d.ts +4 -33
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
- package/dist/components/trees/2d/node-transform.js +4 -33
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +112 -622
- package/dist/components/trees/2d/node2d.d.ts.map +1 -1
- package/dist/components/trees/2d/node2d.js +131 -605
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +17 -65
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +18 -68
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.d.ts +5 -45
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
- package/dist/components/trees/node/node-editor-state.js +1 -13
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +6 -54
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +13 -39
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.d.ts +2 -15
- package/dist/components/trees/node/node-time.d.ts.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.d.ts +7 -32
- package/dist/components/trees/node/node-walk.d.ts.map +1 -1
- package/dist/components/trees/node/node-walk.js +7 -32
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.d.ts +43 -248
- package/dist/components/trees/node/node.d.ts.map +1 -1
- package/dist/components/trees/node/node.js +51 -229
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js +7 -47
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.d.ts +24 -112
- package/dist/components/trees/three/node3d.d.ts.map +1 -1
- package/dist/components/trees/three/node3d.js +22 -104
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.d.ts +9 -21
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +13 -28
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts +3 -9
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +43 -89
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +15 -30
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +31 -31
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +9 -43
- package/dist/document/deny-globals.d.ts.map +1 -1
- package/dist/document/deny-globals.js +18 -58
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts +6 -16
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +5 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +5 -13
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +0 -2
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts +2 -2
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -18
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +11 -41
- package/dist/document/expression/index.d.ts.map +1 -1
- package/dist/document/expression/index.js +11 -41
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.d.ts +3 -12
- package/dist/document/expression/ops.d.ts.map +1 -1
- package/dist/document/expression/ops.js +4 -20
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts +4 -14
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +34 -55
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +2 -8
- package/dist/document/expression/refs.d.ts.map +1 -1
- package/dist/document/expression/refs.js +2 -6
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.d.ts +18 -63
- package/dist/document/expression/types.d.ts.map +1 -1
- package/dist/document/expression/types.js +4 -15
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts +6 -20
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +18 -44
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js +2 -3
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +7 -22
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +44 -15
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.d.ts +4 -11
- package/dist/document/missing-node.d.ts.map +1 -1
- package/dist/document/missing-node.js +2 -5
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.d.ts +12 -53
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +16 -57
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -62
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +18 -41
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js +4 -11
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +19 -52
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +2 -6
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +10 -20
- package/dist/document/prop-evolution.d.ts.map +1 -1
- package/dist/document/prop-evolution.js +3 -7
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.d.ts +80 -318
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +43 -147
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +12 -18
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +29 -31
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +6 -15
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +12 -21
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +56 -263
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +97 -281
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +90 -264
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +13 -30
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +10 -40
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +72 -137
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +4 -7
- package/dist/document/vocabulary.d.ts.map +1 -1
- package/dist/document/vocabulary.js +0 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +1 -11
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +6 -20
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +7 -28
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +2 -11
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +2 -22
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +11 -55
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +7 -43
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js +4 -29
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +5 -31
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/stepped-clock.d.ts +1 -16
- package/dist/platform/stepped-clock.d.ts.map +1 -1
- package/dist/platform/stepped-clock.js +1 -16
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +8 -68
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +8 -60
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +11 -45
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +10 -37
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.d.ts +4 -14
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/tree.d.ts +6 -35
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js +1 -8
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +7 -13
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +18 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +73 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/observer.d.ts +1 -7
- package/dist/props/observer.d.ts.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.d.ts +6 -19
- package/dist/props/slot.d.ts.map +1 -1
- package/dist/props/slot.js +5 -14
- package/dist/props/slot.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +8 -68
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +8 -69
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.d.ts +2 -16
- package/dist/render/clip-contains.d.ts.map +1 -1
- package/dist/render/clip-contains.js +21 -82
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +7 -25
- package/dist/render/clip.d.ts.map +1 -1
- package/dist/render/clip.js +5 -17
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.d.ts.map +1 -1
- package/dist/render/descriptors/ellipse.js +0 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.d.ts.map +1 -1
- package/dist/render/descriptors/line.js +0 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.d.ts +4 -32
- package/dist/render/descriptors/path-builder.d.ts.map +1 -1
- package/dist/render/descriptors/path-builder.js +3 -25
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.d.ts +1 -11
- package/dist/render/descriptors/path.d.ts.map +1 -1
- package/dist/render/descriptors/path.js +0 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.d.ts.map +1 -1
- package/dist/render/descriptors/polygon.js +0 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.d.ts.map +1 -1
- package/dist/render/descriptors/polygram.js +0 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.d.ts.map +1 -1
- package/dist/render/descriptors/rect.js +0 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.d.ts.map +1 -1
- package/dist/render/descriptors/richtext.js +0 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +17 -77
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js +13 -47
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -94
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +8 -50
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +5 -16
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js +1 -17
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +24 -116
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +23 -108
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/measure-context.d.ts +5 -29
- package/dist/render/measure-context.d.ts.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.d.ts +2 -20
- package/dist/render/null-render-context.d.ts.map +1 -1
- package/dist/render/null-render-context.js +2 -20
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +52 -208
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.d.ts +2 -19
- package/dist/render/surface.d.ts.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.d.ts +1 -17
- package/dist/render/text-defaults.d.ts.map +1 -1
- package/dist/render/text-defaults.js +6 -40
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.d.ts +12 -55
- package/dist/render/text-layout.d.ts.map +1 -1
- package/dist/render/text-layout.js +2 -16
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts +10 -32
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +2 -12
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +8 -35
- package/dist/render3d/builders.d.ts.map +1 -1
- package/dist/render3d/builders.js +8 -35
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +10 -57
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +4 -26
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +7 -45
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +15 -85
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +18 -106
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js +2 -20
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +29 -133
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +23 -110
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -16
- package/dist/render3d/index.d.ts.map +1 -1
- package/dist/render3d/index.js +1 -16
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts.map +1 -1
- package/dist/render3d/inert.js +1 -14
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.d.ts +3 -26
- package/dist/render3d/light.d.ts.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +13 -87
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js +2 -16
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.d.ts +14 -68
- package/dist/render3d/matrix4.d.ts.map +1 -1
- package/dist/render3d/matrix4.js +11 -60
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.d.ts +13 -51
- package/dist/render3d/render-context3d.d.ts.map +1 -1
- package/dist/render3d/render-context3d.js +9 -21
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +9 -53
- package/dist/render3d/resources.d.ts.map +1 -1
- package/dist/render3d/resources.js +8 -48
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.d.ts +7 -21
- package/dist/render3d/rounded-box.d.ts.map +1 -1
- package/dist/render3d/rounded-box.js +7 -46
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +20 -78
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -53
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +12 -59
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.d.ts +2 -25
- package/dist/render3d/segments.d.ts.map +1 -1
- package/dist/render3d/segments.js +1 -11
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +25 -112
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +3 -27
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.d.ts +2 -19
- package/dist/render3d/tracking.d.ts.map +1 -1
- package/dist/render3d/tracking.js +2 -19
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +14 -60
- package/dist/render3d/transform.d.ts.map +1 -1
- package/dist/render3d/transform.js +0 -2
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +6 -48
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +4 -38
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +3 -27
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -33
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +34 -20
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +127 -31
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +14 -53
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js +6 -27
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts +7 -26
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +6 -18
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.d.ts +3 -9
- package/dist/runtime/builtin-context.d.ts.map +1 -1
- package/dist/runtime/builtin-context.js +3 -9
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +12 -39
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -45
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +26 -68
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +47 -81
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +31 -85
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +16 -49
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +4 -15
- package/dist/runtime/frame-time.d.ts.map +1 -1
- package/dist/runtime/frame-time.js +5 -12
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +59 -139
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +87 -157
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +39 -96
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +98 -141
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts +8 -17
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +7 -16
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +78 -207
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +111 -226
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.d.ts +6 -14
- package/dist/runtime/playback.d.ts.map +1 -1
- package/dist/runtime/playback.js +6 -14
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/project-assets.d.ts +6 -14
- package/dist/runtime/project-assets.d.ts.map +1 -1
- package/dist/runtime/project-assets.js +7 -16
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +22 -45
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +26 -46
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.d.ts +4 -10
- package/dist/runtime/settle.d.ts.map +1 -1
- package/dist/runtime/settle.js +4 -10
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +15 -37
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +27 -44
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +18 -47
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +13 -27
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -7
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -138
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +6 -26
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -6
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +6 -53
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +5 -40
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/curve.d.ts +2 -17
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +1 -6
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +0 -11
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +0 -23
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +2 -18
- package/dist/tween/ease/spec.d.ts.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/inert.d.ts +1 -14
- package/dist/tween/inert.d.ts.map +1 -1
- package/dist/tween/inert.js +1 -14
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.d.ts +2 -26
- package/dist/tween/lerp.d.ts.map +1 -1
- package/dist/tween/lerp.js +2 -26
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.d.ts +9 -50
- package/dist/tween/loop.d.ts.map +1 -1
- package/dist/tween/loop.js +6 -31
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +2 -30
- package/dist/tween/prepare.d.ts.map +1 -1
- package/dist/tween/prepare.js +2 -30
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.d.ts +4 -25
- package/dist/tween/stepper.d.ts.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.d.ts +1 -8
- package/dist/tween/to-command.d.ts.map +1 -1
- package/dist/tween/to-command.js +2 -25
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/context.d.ts +4 -29
- package/dist/util/context.d.ts.map +1 -1
- package/dist/util/context.js +3 -15
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.d.ts +4 -29
- package/dist/util/csv.d.ts.map +1 -1
- package/dist/util/csv.js +3 -22
- package/dist/util/csv.js.map +1 -1
- package/dist/util/metrics.d.ts +2 -26
- package/dist/util/metrics.d.ts.map +1 -1
- package/dist/util/metrics.js +2 -26
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.d.ts +20 -87
- package/dist/util/random.d.ts.map +1 -1
- package/dist/util/random.js +20 -87
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.d.ts +6 -35
- package/dist/util/reference.d.ts.map +1 -1
- package/dist/util/reference.js +1 -4
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.d.ts +6 -27
- package/dist/util/scheduler.d.ts.map +1 -1
- package/dist/util/scheduler.js +8 -35
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
- package/dist/browser/chunks/chunk-7DB6BI27.js +0 -6
- package/dist/browser/chunks/chunk-7DB6BI27.js.map +0 -7
- package/dist/browser/chunks/chunk-IX53IFBD.js +0 -13
- package/dist/browser/chunks/chunk-IX53IFBD.js.map +0 -7
- package/dist/browser/chunks/chunk-Q55UPA3E.js +0 -3
- package/dist/browser/chunks/chunk-Q55UPA3E.js.map +0 -7
- package/dist/renamed-scene-names.d.ts +0 -17
- package/dist/renamed-scene-names.d.ts.map +0 -1
- package/dist/renamed-scene-names.js +0 -9
- package/dist/renamed-scene-names.js.map +0 -1
- package/dist/runtime/precompisition.d.ts +0 -24
- package/dist/runtime/precompisition.d.ts.map +0 -1
- package/dist/runtime/precompisition.js +0 -7
- package/dist/runtime/precompisition.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape-outline.js","source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CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;YACnE,SAAS,EACP,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;SACxE,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,2EAA2E;QAC3E,wEAAwE;QACxE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAG,CAAA;QAC3B,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IACrC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["/**\n * The silhouette of every shape type, as a {@link VectorPath}.\n *\n * One module, two callers with the same question asked at different scales:\n *\n * - The **shape node classes** (`nodes/shapes`) draw their outline every frame\n * from their laid-out box, so they ask in pixels.\n * - The **path editor** converts a shape into an editable Path node the moment\n * somebody moves one of its points, so it asks in the unit box the Path node\n * stores its geometry in (see `./vector-path`).\n *\n * Sharing the definition is what makes that conversion invisible: a triangle\n * that becomes a path is the *same* triangle, down to the rounding on its\n * corners, rather than a fresh approximation of one.\n *\n * ## Why these shapes exist at all\n *\n * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices\n * sit on the box's inscribed ellipse — which is what makes a `sides` tween\n * smooth: every vertex count is the same circle sampled differently, so a\n * triangle morphing into a square doesn't lurch. The cost is that a triangle\n * *doesn't touch the bottom of its own bounds*, because the two base vertices\n * sit at 30° below the horizontal rather than on the ellipse's lowest point.\n * Figma's polygon does exactly the same thing for exactly the same reason.\n *\n * That is right for a shape you intend to animate and wrong for a shape you\n * intend to *be a triangle*. So the parametric `polygon`/`polygram` keep the\n * inscribed geometry, and the named shapes here are stretched to fill their box\n * — the vertices are computed on the circle exactly as before, then their\n * bounding box is mapped onto the node's. Same silhouette, no gap.\n *\n * Everything here works in **y-down** coordinates, the convention the stored\n * `d` string uses. The node classes flip once on the way to the renderer, whose\n * local space is y-up.\n */\n\nimport type { CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\nimport type { CornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { distance } from \"@/attributes/shape/path/bezier\"\nimport { pathOps } from \"@/attributes/shape/path/ops\"\nimport type { PathAnchor, PathSubpath, VectorPath } from \"@/attributes/shape/path/types\";\n\n/** The shape types this module can draw an outline for. */\nexport type ShapeOutlineKind =\n | \"rect\"\n | \"ellipse\"\n | \"polygon\"\n | \"polygram\"\n | \"triangle\"\n | \"rightTriangle\"\n | \"pentagon\"\n | \"hexagon\"\n | \"octagon\"\n | \"star\"\n\n/** Everything an outline can depend on. Unstated fields take the schema's default. */\nexport interface ShapeOutlineOptions {\n /** The node's box, in pixels. */\n width: number\n height: number\n /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */\n cornerRadius?: number | CornerRadiusResolved\n cornerStyle?: CornerStyle\n /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */\n sides?: number\n /**\n * The inner radius as a fraction of the outer one: a polygram's or star's\n * point depth, and an ellipse's donut hole.\n */\n ratio?: number\n /** The ellipse's arc, in degrees. */\n startAngle?: number\n sweep?: number\n}\n\n/**\n * The named shapes' vertex counts and how far they're turned from \"a vertex at\n * the top\".\n *\n * Pointy-top is the regular polygon's natural orientation and the one every icon\n * set draws a pentagon and a hexagon in. The octagon is the exception, and it is\n * not a matter of taste: an octagon with a vertex at the top reads as a rotated\n * stop sign, because a stop sign is the only octagon most people have ever\n * looked at and it has a flat top. Half a step turns it into that one.\n */\nconst NAMED_POLYGONS: Record<string, { sides: number; turn: number }> = {\n pentagon: { sides: 5, turn: 0 },\n hexagon: { sides: 6, turn: 0 },\n octagon: { sides: 8, turn: Math.PI / 8 },\n}\n\n/**\n * A star's default point depth: the classic five-pointed star, where the inner\n * vertices sit where the extended edges of a pentagram cross.\n *\n * Not the polygram node's 50%, and deliberately so. The parametric polygram\n * opens at a round number because it is a *control* you are expected to move;\n * this node exists for the person who wanted a star and got a geometry lesson,\n * so it opens on the star they were picturing.\n */\nexport const STAR_DEFAULT_RATIO = 0.382\n\n/** The default number of points on a Star node. */\nexport const STAR_DEFAULT_POINTS = 5\n\n/**\n * The shape's outline in **pixel** space: centred on the origin, spanning\n * `width` × `height`, y-down.\n *\n * Returns an empty path for a degenerate box, which draws nothing rather than\n * producing NaN coordinates the renderer would have to cope with.\n */\nexport function shapeOutlinePixels(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n if (!(width > 0) || !(height > 0)) return []\n\n switch (kind) {\n case \"rect\":\n return [rectOutline(width, height, options)]\n case \"ellipse\":\n return ellipseOutline(width, height, options)\n case \"triangle\":\n return [\n polygonOutline(\n [\n { x: 0, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"rightTriangle\":\n return [\n polygonOutline(\n [\n { x: -width / 2, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"polygon\":\n // The parametric one: inscribed, *not* stretched — see the module note.\n return [\n polygonOutline(\n regularVertices(sidesOf(options, 5), 0, width / 2, height / 2),\n options\n ),\n ]\n case \"polygram\":\n return [\n polygonOutline(\n starVertices(\n sidesOf(options, 5),\n clamp01(options.ratio ?? 0.5),\n width / 2,\n height / 2\n ),\n options\n ),\n ]\n case \"star\":\n return [\n polygonOutline(\n fillBox(\n starVertices(\n sidesOf(options, STAR_DEFAULT_POINTS),\n clamp01(options.ratio ?? STAR_DEFAULT_RATIO),\n 1,\n 1\n ),\n width,\n height\n ),\n options\n ),\n ]\n default: {\n const named = NAMED_POLYGONS[kind]\n if (!named) return []\n return [\n polygonOutline(\n fillBox(regularVertices(named.sides, named.turn, 1, 1), width, height),\n options\n ),\n ]\n }\n }\n}\n\n/**\n * The same outline in the **unit box** a Path node stores — pixels divided by\n * the node's own size, so the geometry is a fraction of the box rather than a\n * count of pixels inside it.\n *\n * This is what a shape→path conversion writes. Dividing at the end rather than\n * computing in unit space throughout is what keeps a corner radius circular: a\n * 20px corner on a 400×200 node is 0.05 × 0.1 of the box, and only comes back\n * out round because the renderer multiplies by the same two numbers.\n */\nexport function shapeOutline(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n const pixels = shapeOutlinePixels(kind, options)\n if (!(width > 0) || !(height > 0)) return pixels\n return pathOps.map(pixels, (p) => ({ x: p.x / width, y: p.y / height }))\n}\n\n/** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */\nexport function hasShapeOutline(kind: string): kind is ShapeOutlineKind {\n return OUTLINE_KINDS.has(kind)\n}\n\nconst OUTLINE_KINDS: ReadonlySet<string> = new Set<ShapeOutlineKind>([\n \"rect\",\n \"ellipse\",\n \"polygon\",\n \"polygram\",\n \"triangle\",\n \"rightTriangle\",\n \"pentagon\",\n \"hexagon\",\n \"octagon\",\n \"star\",\n])\n\n// ── Building blocks ────────────────────────────────────────────────────────\n\nfunction corner(point: Vector2): PathAnchor {\n return { point, inHandle: null, outHandle: null }\n}\n\nfunction sidesOf(options: ShapeOutlineOptions, fallback: number): number {\n return Math.max(3, Math.round(options.sides ?? fallback))\n}\n\nfunction clamp01(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\n\n/**\n * The vertices of a regular n-gon on the ellipse `rx` × `ry`, starting at the\n * top and stepping clockwise — the same order and the same first vertex\n * The engine's own `polygonVertices` uses, so a converted `polygon` keeps its\n * points in the order the author has been looking at.\n *\n * `turn` rotates the whole figure; see {@link NAMED_POLYGONS}.\n */\nfunction regularVertices(\n sides: number,\n turn: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = (2 * Math.PI) / sides\n const out: Vector2[] = []\n for (let i = 0; i < sides; i++) {\n // −π/2 is straight up in y-down coordinates.\n const a = -Math.PI / 2 + turn + i * step\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) })\n }\n return out\n}\n\n/** Outer and inner vertices alternating — a star with `points` points. */\nfunction starVertices(\n points: number,\n ratio: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = Math.PI / points\n const out: Vector2[] = []\n for (let i = 0; i < points * 2; i++) {\n const a = -Math.PI / 2 + i * step\n const k = i % 2 === 0 ? 1 : ratio\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) })\n }\n return out\n}\n\n/**\n * Stretches a vertex ring so its bounding box *is* the node's box.\n *\n * The one line that separates a shape from its parametric sibling. Everything\n * before it is the inscribed figure; this maps that figure's own extent onto the\n * box, so the flat base of a triangle lands on the bottom edge and a pentagon's\n * two lower vertices land on the left and right ones.\n *\n * A ring with no extent on an axis (which no shape here produces, but a\n * `sides: 3` star with ratio 0 comes close) keeps that axis rather than dividing\n * by zero.\n */\nfunction fillBox(points: Vector2[], width: number, height: number): Vector2[] {\n if (points.length === 0) return points\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n for (const p of points) {\n if (p.x < minX) minX = p.x\n if (p.x > maxX) maxX = p.x\n if (p.y < minY) minY = p.y\n if (p.y > maxY) maxY = p.y\n }\n const spanX = maxX - minX\n const spanY = maxY - minY\n const kx = spanX > 1e-9 ? width / spanX : 1\n const ky = spanY > 1e-9 ? height / spanY : 1\n const cx = (minX + maxX) / 2\n const cy = (minY + maxY) / 2\n return points.map((p) => ({ x: (p.x - cx) * kx, y: (p.y - cy) * ky }))\n}\n\n// ── Corners ────────────────────────────────────────────────────────────────\n\n/**\n * The cubic control-point offset that approximates a circular arc, as a\n * fraction of the distance from the tangent point to the corner.\n *\n * `k = (4/3)·tan(φ/4) / tan(φ/2)`, where φ is the arc's central angle. The\n * familiar 0.5523 is this at φ = 90°; a shallow corner needs less and a sharp\n * one needs more, which is why the constant can't simply be hard-coded — a\n * five-pointed star's inner vertices turn through nearly 180°, where 0.5523\n * would visibly flatten the curve.\n */\nfunction arcHandleRatio(sweep: number): number {\n const half = sweep / 2\n if (Math.abs(half) < 1e-6) return 0\n return ((4 / 3) * Math.tan(sweep / 4)) / Math.tan(half)\n}\n\n/**\n * A closed ring of vertices as a subpath, with each corner rounded or chamfered\n * by `cornerRadius`.\n *\n * The radius is clamped per corner to half of each adjacent edge, so a large\n * radius on a small shape rounds it as far as it can go instead of turning the\n * outline inside out. A radius of zero (or a `cornerStyle` of neither kind)\n * returns the plain polygon, which is the common case and costs nothing.\n */\nfunction polygonOutline(\n points: Vector2[],\n options: ShapeOutlineOptions\n): PathSubpath {\n const radius = uniformRadius(options.cornerRadius)\n if (points.length < 3 || radius <= 0) {\n return { anchors: points.map(corner), closed: true }\n }\n const style = options.cornerStyle ?? \"rounded\"\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i < points.length; i++) {\n const c = points[i]\n const prev = points[(i - 1 + points.length) % points.length]\n const next = points[(i + 1) % points.length]\n\n const toPrev = direction(c, prev)\n const toNext = direction(c, next)\n if (!toPrev || !toNext) {\n anchors.push(corner(c))\n continue\n }\n\n // The interior angle at this vertex, and the arc that replaces it.\n const cosine = Math.max(-1, Math.min(1, toPrev.x * toNext.x + toPrev.y * toNext.y))\n const interior = Math.acos(cosine)\n // A vertex where the two edges double back on themselves has no corner to\n // round; leaving it sharp is the only honest answer.\n if (interior < 1e-6 || Math.PI - interior < 1e-6) {\n anchors.push(corner(c))\n continue\n }\n\n // How far back along each edge the arc starts. Never more than half the\n // edge, so two adjacent corners can't overlap.\n const tangent = Math.min(\n radius / Math.tan(interior / 2),\n distance(c, prev) / 2,\n distance(c, next) / 2\n )\n const a = { x: c.x + toPrev.x * tangent, y: c.y + toPrev.y * tangent }\n const b = { x: c.x + toNext.x * tangent, y: c.y + toNext.y * tangent }\n\n if (style === \"angled\") {\n // A chamfer: the same two tangent points, joined by a straight line.\n anchors.push(corner(a), corner(b))\n continue\n }\n\n const k = arcHandleRatio(Math.PI - interior)\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (c.x - a.x) * k, y: a.y + (c.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (c.x - b.x) * k, y: b.y + (c.y - b.y) * k }, outHandle: null }\n )\n }\n return { anchors, closed: true }\n}\n\n/** The unit vector from `from` towards `to`, or null when they coincide. */\nfunction direction(from: Vector2, to: Vector2): Vector2 | null {\n const dx = to.x - from.x\n const dy = to.y - from.y\n const len = Math.hypot(dx, dy)\n if (len < 1e-9) return null\n return { x: dx / len, y: dy / len }\n}\n\n\n/**\n * A single radius from whichever shape the value arrived in.\n *\n * A per-corner value only means anything on a rect, which builds its outline\n * corner by corner below; every other shape takes the smallest of the four, so\n * converting a rect with mixed corners into a polygon can't silently invent a\n * radius bigger than any the author set.\n */\nfunction uniformRadius(value: number | CornerRadiusResolved | undefined): number {\n if (value === undefined) return 0\n if (typeof value === \"number\") return Math.max(0, value)\n return Math.max(\n 0,\n Math.min(value.topLeft, value.topRight, value.bottomLeft, value.bottomRight)\n )\n}\n\n// ── Rect ───────────────────────────────────────────────────────────────────\n\n/**\n * A rectangle, with each corner carrying its own radius.\n *\n * Written out rather than routed through {@link polygonOutline} because a rect\n * is the one shape whose corners are *individually* set, and because its right\n * angles make the arc exact: the tangent length equals the radius and the handle\n * ratio is the familiar 0.5523, with no trigonometry involved.\n */\nfunction rectOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): PathSubpath {\n const radii = perCornerRadii(options.cornerRadius, width, height)\n const style = options.cornerStyle ?? \"rounded\"\n const x = width / 2\n const y = height / 2\n const k = arcHandleRatio(Math.PI / 2)\n\n const anchors: PathAnchor[] = []\n /**\n * One corner, walking clockwise from the top-left: `at` is the sharp corner,\n * `from`/`to` the directions the outline arrives and leaves along.\n */\n const push = (\n at: Vector2,\n incoming: Vector2,\n outgoing: Vector2,\n r: number\n ) => {\n if (r <= 0) {\n anchors.push(corner(at))\n return\n }\n const a = { x: at.x - incoming.x * r, y: at.y - incoming.y * r }\n const b = { x: at.x + outgoing.x * r, y: at.y + outgoing.y * r }\n if (style === \"angled\") {\n anchors.push(corner(a), corner(b))\n return\n }\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (at.x - a.x) * k, y: a.y + (at.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (at.x - b.x) * k, y: b.y + (at.y - b.y) * k }, outHandle: null }\n )\n }\n\n const right = { x: 1, y: 0 }\n const down = { x: 0, y: 1 }\n const left = { x: -1, y: 0 }\n const up = { x: 0, y: -1 }\n // Clockwise, and the *incoming* direction is the one the walk is travelling\n // when it reaches the corner — not the edge it is about to leave along. The\n // loop closes back into the top-left from the bottom-left, so it arrives there\n // heading **up**; `down` put that corner's first anchor a radius *above* the\n // rectangle and drew the arc back into the box, which is the reversed top-left\n // corner you get on any rounded rect converted to a path.\n push({ x: -x, y: -y }, up, right, radii.topLeft)\n push({ x, y: -y }, right, down, radii.topRight)\n push({ x, y }, down, left, radii.bottomRight)\n push({ x: -x, y }, left, up, radii.bottomLeft)\n return { anchors, closed: true }\n}\n\n/** The four radii, clamped so opposite corners on an edge can't overlap. */\nfunction perCornerRadii(\n value: number | CornerRadiusResolved | undefined,\n width: number,\n height: number\n): CornerRadiusResolved {\n const raw: CornerRadiusResolved =\n value === undefined\n ? { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }\n : typeof value === \"number\"\n ? {\n topLeft: value,\n topRight: value,\n bottomLeft: value,\n bottomRight: value,\n }\n : value\n const cap = Math.min(width, height) / 2\n return {\n topLeft: Math.max(0, Math.min(raw.topLeft, cap)),\n topRight: Math.max(0, Math.min(raw.topRight, cap)),\n bottomLeft: Math.max(0, Math.min(raw.bottomLeft, cap)),\n bottomRight: Math.max(0, Math.min(raw.bottomRight, cap)),\n }\n}\n\n// ── Ellipse ────────────────────────────────────────────────────────────────\n\n/**\n * The ellipse family: a full oval, an arc (`sweep` under 360°), a ring\n * (`ratio` above 0), and the wedge the two make together.\n *\n * The arc is emitted as cubics rather than as an SVG `A` command, and that is\n * the whole reason this is worth writing out. A Path node's geometry is stored\n * as a fraction of its box and multiplied back by the box's *two* dimensions —\n * so an arc, whose parameters describe a circle rather than a set of points,\n * would come out of a non-uniform resize as a different curve rather than a\n * stretched one. Cubics survive that transform exactly.\n */\nfunction ellipseOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): VectorPath {\n const rx = width / 2\n const ry = height / 2\n const inner = clamp01(options.ratio ?? 0)\n const sweep = Math.max(0, Math.min(360, options.sweep ?? 360))\n if (sweep <= 0) return []\n\n // A full oval with no hole is the common case: one closed ring.\n const full = sweep >= 360\n // Degrees clockwise from twelve o'clock, matching the appearance schema's\n // `startAngle` — which is measured the way a clock face is, not the way\n // `Math.atan2` is.\n const from = ((options.startAngle ?? 0) - 90) * (Math.PI / 180)\n const to = from + sweep * (Math.PI / 180)\n\n if (full && inner <= 0) {\n return [{ anchors: arcAnchors(rx, ry, from, to, true), closed: true }]\n }\n if (full) {\n // A ring: two closed rings, the inner one wound the other way so the\n // even-odd fill leaves a hole.\n return [\n { anchors: arcAnchors(rx, ry, from, to, true), closed: true },\n { anchors: arcAnchors(rx * inner, ry * inner, to, from, true), closed: true },\n ]\n }\n\n // An arc, closed back on itself: out along the outer edge, back along the\n // inner one (or through the centre, when there is no hole).\n const outer = arcAnchors(rx, ry, from, to, false)\n const back =\n inner > 0\n ? arcAnchors(rx * inner, ry * inner, to, from, false)\n : [corner({ x: 0, y: 0 })]\n return [{ anchors: [...outer, ...back], closed: true }]\n}\n\n/**\n * An elliptical arc as a run of anchors, split into segments of at most 90° —\n * the span a single cubic approximates to within a fraction of a pixel.\n *\n * `whole` drops the duplicated final anchor, for the case where the arc closes\n * back on its own start.\n */\nfunction arcAnchors(\n rx: number,\n ry: number,\n from: number,\n to: number,\n whole: boolean\n): PathAnchor[] {\n const total = to - from\n const steps = Math.max(1, Math.ceil(Math.abs(total) / (Math.PI / 2)))\n const step = total / steps\n // The classic elliptical-arc approximation: each control point sits α along\n // the curve's own tangent, with α = (4/3)·tan(Δ/4) for a segment spanning Δ.\n // Signed with the step, so a clockwise arc bulges the right way.\n const alpha = (4 / 3) * Math.tan(step / 4)\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i <= steps; i++) {\n const a = from + step * i\n const point = { x: rx * Math.cos(a), y: ry * Math.sin(a) }\n // d/da of the point — the arc's tangent at this angle.\n const tangent = { x: -rx * Math.sin(a), y: ry * Math.cos(a) }\n const offset = { x: tangent.x * alpha, y: tangent.y * alpha }\n anchors.push({\n point,\n inHandle:\n i === 0 ? null : { x: point.x - offset.x, y: point.y - offset.y },\n outHandle:\n i === steps ? null : { x: point.x + offset.x, y: point.y + offset.y },\n })\n }\n\n if (whole && anchors.length > 1) {\n // The arc came back to where it started; fold the duplicate into the first\n // anchor so the ring has one anchor per corner rather than two stacked.\n const last = anchors.pop()!\n anchors[0].inHandle = last.inHandle\n }\n return anchors\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shape-outline.js","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/shape-outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAiCrD,uLAAuL;AACvL,MAAM,cAAc,GAAoD;IACtE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC/B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EA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AE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1D,uDAAuD;QACvD,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC7D,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,EAAE,CAAA;QAC7D,OAAO,CAAC,IAAI,CAAC;YACX,KAAK;YACL,QAAQ,EACN,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;YACnE,SAAS,EACP,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE;SACxE,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,2EAA2E;QAC3E,wEAAwE;QACxE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAG,CAAA;QAC3B,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IACrC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["/**\n * The silhouette of every shape type as a {@link VectorPath}, asked at two scales: the shape node classes draw it\n * every frame in pixels, and the path editor converts a shape to an editable Path node (in the unit box that node\n * stores) the moment a point moves. One definition keeps a converted triangle the same triangle, rounding included.\n *\n * Named shapes (triangle, pentagon, ...) are stretched to fill their box, whereas the parametric `polygon`/`polygram`\n * stay inscribed in the box's ellipse: that is what keeps a `sides` tween smooth, but a triangle then doesn't touch\n * the bottom of its bounds (its base vertices sit 30° below horizontal). Figma's polygon does the same.\n *\n * Everything works in **y-down** coordinates, as the stored `d` string does; the node classes flip once on the way\n * to the (y-up) renderer.\n */\n\nimport type { CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\nimport type { CornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { distance } from \"@/attributes/shape/path/bezier\"\nimport { pathOps } from \"@/attributes/shape/path/ops\"\nimport type { PathAnchor, PathSubpath, VectorPath } from \"@/attributes/shape/path/types\";\n\n/** The shape types this module can draw an outline for. */\nexport type ShapeOutlineKind =\n | \"rect\"\n | \"ellipse\"\n | \"polygon\"\n | \"polygram\"\n | \"triangle\"\n | \"rightTriangle\"\n | \"pentagon\"\n | \"hexagon\"\n | \"octagon\"\n | \"star\"\n\n/** Everything an outline can depend on. Unstated fields take the schema's default. */\nexport interface ShapeOutlineOptions {\n /** The node's box, in pixels. */\n width: number\n height: number\n /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */\n cornerRadius?: number | CornerRadiusResolved\n cornerStyle?: CornerStyle\n /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */\n sides?: number\n /** Inner radius as a fraction of the outer: a polygram's or star's point depth, an ellipse's donut hole. */\n ratio?: number\n /** The ellipse's arc, in degrees. */\n startAngle?: number\n sweep?: number\n}\n\n/** The named shapes' vertex counts and turn from \"a vertex at the top\". The octagon is half a step off: with a vertex on top it reads as a rotated stop sign, which has a flat top. */\nconst NAMED_POLYGONS: Record<string, { sides: number; turn: number }> = {\n pentagon: { sides: 5, turn: 0 },\n hexagon: { sides: 6, turn: 0 },\n octagon: { sides: 8, turn: Math.PI / 8 },\n}\n\n/** A star's default point depth: the classic five-pointed star, inner vertices where a pentagram's extended edges cross. Not the polygram's round 50%, which is a control you move; this opens on the star people picture. */\nexport const STAR_DEFAULT_RATIO = 0.382\n\n/** The default number of points on a Star node. */\nexport const STAR_DEFAULT_POINTS = 5\n\n/** The outline in **pixel** space: centred on the origin, `width` x `height`, y-down. Empty for a degenerate box, which draws nothing rather than NaN coordinates. */\nexport function shapeOutlinePixels(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n if (!(width > 0) || !(height > 0)) return []\n\n switch (kind) {\n case \"rect\":\n return [rectOutline(width, height, options)]\n case \"ellipse\":\n return ellipseOutline(width, height, options)\n case \"triangle\":\n return [\n polygonOutline(\n [\n { x: 0, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"rightTriangle\":\n return [\n polygonOutline(\n [\n { x: -width / 2, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"polygon\":\n // The parametric one: inscribed, *not* stretched — see the module note.\n return [\n polygonOutline(\n regularVertices(sidesOf(options, 5), 0, width / 2, height / 2),\n options\n ),\n ]\n case \"polygram\":\n return [\n polygonOutline(\n starVertices(\n sidesOf(options, 5),\n clamp01(options.ratio ?? 0.5),\n width / 2,\n height / 2\n ),\n options\n ),\n ]\n case \"star\":\n return [\n polygonOutline(\n fillBox(\n starVertices(\n sidesOf(options, STAR_DEFAULT_POINTS),\n clamp01(options.ratio ?? STAR_DEFAULT_RATIO),\n 1,\n 1\n ),\n width,\n height\n ),\n options\n ),\n ]\n default: {\n const named = NAMED_POLYGONS[kind]\n if (!named) return []\n return [\n polygonOutline(\n fillBox(regularVertices(named.sides, named.turn, 1, 1), width, height),\n options\n ),\n ]\n }\n }\n}\n\n/** The same outline in the **unit box** a Path node stores (pixels divided by the node's size); what a shape-to-path conversion writes. Divided at the end rather than computed in unit space so a corner radius stays circular: 20px on 400x200 is 0.05 x 0.1 of the box and comes back round because the renderer multiplies by the same two numbers. */\nexport function shapeOutline(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n const pixels = shapeOutlinePixels(kind, options)\n if (!(width > 0) || !(height > 0)) return pixels\n return pathOps.map(pixels, (p) => ({ x: p.x / width, y: p.y / height }))\n}\n\n/** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */\nexport function hasShapeOutline(kind: string): kind is ShapeOutlineKind {\n return OUTLINE_KINDS.has(kind)\n}\n\nconst OUTLINE_KINDS: ReadonlySet<string> = new Set<ShapeOutlineKind>([\n \"rect\",\n \"ellipse\",\n \"polygon\",\n \"polygram\",\n \"triangle\",\n \"rightTriangle\",\n \"pentagon\",\n \"hexagon\",\n \"octagon\",\n \"star\",\n])\n\nfunction corner(point: Vector2): PathAnchor {\n return { point, inHandle: null, outHandle: null }\n}\n\nfunction sidesOf(options: ShapeOutlineOptions, fallback: number): number {\n return Math.max(3, Math.round(options.sides ?? fallback))\n}\n\nfunction clamp01(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\n\n/** Vertices of a regular n-gon on the ellipse `rx` x `ry`, starting at the top and stepping clockwise as the engine's `polygonVertices` does, so a converted `polygon` keeps its point order. `turn` rotates the figure; see {@link NAMED_POLYGONS}. */\nfunction regularVertices(\n sides: number,\n turn: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = (2 * Math.PI) / sides\n const out: Vector2[] = []\n for (let i = 0; i < sides; i++) {\n // −π/2 is straight up in y-down coordinates.\n const a = -Math.PI / 2 + turn + i * step\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) })\n }\n return out\n}\n\n/** Outer and inner vertices alternating — a star with `points` points. */\nfunction starVertices(\n points: number,\n ratio: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = Math.PI / points\n const out: Vector2[] = []\n for (let i = 0; i < points * 2; i++) {\n const a = -Math.PI / 2 + i * step\n const k = i % 2 === 0 ? 1 : ratio\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) })\n }\n return out\n}\n\n/** Stretches a vertex ring so its bounding box is the node's box: the one step separating a shape from its parametric sibling (a triangle's base lands on the bottom edge). A ring with no extent on an axis keeps that axis rather than dividing by zero. */\nfunction fillBox(points: Vector2[], width: number, height: number): Vector2[] {\n if (points.length === 0) return points\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n for (const p of points) {\n if (p.x < minX) minX = p.x\n if (p.x > maxX) maxX = p.x\n if (p.y < minY) minY = p.y\n if (p.y > maxY) maxY = p.y\n }\n const spanX = maxX - minX\n const spanY = maxY - minY\n const kx = spanX > 1e-9 ? width / spanX : 1\n const ky = spanY > 1e-9 ? height / spanY : 1\n const cx = (minX + maxX) / 2\n const cy = (minY + maxY) / 2\n return points.map((p) => ({ x: (p.x - cx) * kx, y: (p.y - cy) * ky }))\n}\n\n/** The cubic control-point offset approximating a circular arc, as a fraction of the tangent-point-to-corner distance: `k = (4/3)·tan(φ/4) / tan(φ/2)` for central angle φ. The familiar 0.5523 holds only at φ = 90°; a star's inner vertices turn nearly 180°, where it would visibly flatten the curve. */\nfunction arcHandleRatio(sweep: number): number {\n const half = sweep / 2\n if (Math.abs(half) < 1e-6) return 0\n return ((4 / 3) * Math.tan(sweep / 4)) / Math.tan(half)\n}\n\n/** A closed vertex ring as a subpath with each corner rounded or chamfered by `cornerRadius`, clamped per corner to half of each adjacent edge so a large radius can't turn the outline inside out. Zero radius returns the plain polygon. */\nfunction polygonOutline(\n points: Vector2[],\n options: ShapeOutlineOptions\n): PathSubpath {\n const radius = uniformRadius(options.cornerRadius)\n if (points.length < 3 || radius <= 0) {\n return { anchors: points.map(corner), closed: true }\n }\n const style = options.cornerStyle ?? \"rounded\"\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i < points.length; i++) {\n const c = points[i]\n const prev = points[(i - 1 + points.length) % points.length]\n const next = points[(i + 1) % points.length]\n\n const toPrev = direction(c, prev)\n const toNext = direction(c, next)\n if (!toPrev || !toNext) {\n anchors.push(corner(c))\n continue\n }\n\n const cosine = Math.max(-1, Math.min(1, toPrev.x * toNext.x + toPrev.y * toNext.y))\n const interior = Math.acos(cosine)\n // Edges that double back have no corner to round; leave it sharp.\n if (interior < 1e-6 || Math.PI - interior < 1e-6) {\n anchors.push(corner(c))\n continue\n }\n\n // Never more than half the edge, so adjacent corners can't overlap.\n const tangent = Math.min(\n radius / Math.tan(interior / 2),\n distance(c, prev) / 2,\n distance(c, next) / 2\n )\n const a = { x: c.x + toPrev.x * tangent, y: c.y + toPrev.y * tangent }\n const b = { x: c.x + toNext.x * tangent, y: c.y + toNext.y * tangent }\n\n if (style === \"angled\") {\n // A chamfer: the same two tangent points, joined by a straight line.\n anchors.push(corner(a), corner(b))\n continue\n }\n\n const k = arcHandleRatio(Math.PI - interior)\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (c.x - a.x) * k, y: a.y + (c.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (c.x - b.x) * k, y: b.y + (c.y - b.y) * k }, outHandle: null }\n )\n }\n return { anchors, closed: true }\n}\n\n/** The unit vector from `from` towards `to`, or null when they coincide. */\nfunction direction(from: Vector2, to: Vector2): Vector2 | null {\n const dx = to.x - from.x\n const dy = to.y - from.y\n const len = Math.hypot(dx, dy)\n if (len < 1e-9) return null\n return { x: dx / len, y: dy / len }\n}\n\n\n/** A single radius from whichever shape the value arrived in. Per-corner values only mean something on a rect, so other shapes take the smallest of the four: converting a mixed-corner rect can't invent a radius bigger than any the author set. */\nfunction uniformRadius(value: number | CornerRadiusResolved | undefined): number {\n if (value === undefined) return 0\n if (typeof value === \"number\") return Math.max(0, value)\n return Math.max(\n 0,\n Math.min(value.topLeft, value.topRight, value.bottomLeft, value.bottomRight)\n )\n}\n\n/** A rectangle with per-corner radii. Written out rather than via {@link polygonOutline} because its corners are set individually and its right angles make the arc exact (tangent length equals the radius, handle ratio 0.5523). */\nfunction rectOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): PathSubpath {\n const radii = perCornerRadii(options.cornerRadius, width, height)\n const style = options.cornerStyle ?? \"rounded\"\n const x = width / 2\n const y = height / 2\n const k = arcHandleRatio(Math.PI / 2)\n\n const anchors: PathAnchor[] = []\n /** One corner, walking clockwise from the top-left: `at` is the sharp corner, `from`/`to` the directions the outline arrives and leaves along. */\n const push = (\n at: Vector2,\n incoming: Vector2,\n outgoing: Vector2,\n r: number\n ) => {\n if (r <= 0) {\n anchors.push(corner(at))\n return\n }\n const a = { x: at.x - incoming.x * r, y: at.y - incoming.y * r }\n const b = { x: at.x + outgoing.x * r, y: at.y + outgoing.y * r }\n if (style === \"angled\") {\n anchors.push(corner(a), corner(b))\n return\n }\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (at.x - a.x) * k, y: a.y + (at.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (at.x - b.x) * k, y: b.y + (at.y - b.y) * k }, outHandle: null }\n )\n }\n\n const right = { x: 1, y: 0 }\n const down = { x: 0, y: 1 }\n const left = { x: -1, y: 0 }\n const up = { x: 0, y: -1 }\n // The incoming direction is the one the walk travels when it reaches the corner, not the edge it leaves along:\n // the loop closes into the top-left heading **up**, and `down` would reverse that corner.\n push({ x: -x, y: -y }, up, right, radii.topLeft)\n push({ x, y: -y }, right, down, radii.topRight)\n push({ x, y }, down, left, radii.bottomRight)\n push({ x: -x, y }, left, up, radii.bottomLeft)\n return { anchors, closed: true }\n}\n\n/** The four radii, clamped so opposite corners on an edge can't overlap. */\nfunction perCornerRadii(\n value: number | CornerRadiusResolved | undefined,\n width: number,\n height: number\n): CornerRadiusResolved {\n const raw: CornerRadiusResolved =\n value === undefined\n ? { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }\n : typeof value === \"number\"\n ? {\n topLeft: value,\n topRight: value,\n bottomLeft: value,\n bottomRight: value,\n }\n : value\n const cap = Math.min(width, height) / 2\n return {\n topLeft: Math.max(0, Math.min(raw.topLeft, cap)),\n topRight: Math.max(0, Math.min(raw.topRight, cap)),\n bottomLeft: Math.max(0, Math.min(raw.bottomLeft, cap)),\n bottomRight: Math.max(0, Math.min(raw.bottomRight, cap)),\n }\n}\n\n/** The ellipse family: oval, arc (`sweep` under 360°), ring (`ratio` above 0) and wedge. The arc is emitted as cubics, not an SVG `A`: a Path node's geometry is a fraction of its box, so an `A` (whose parameters describe a circle) would come out of a non-uniform resize as a different curve, where cubics stretch exactly. */\nfunction ellipseOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): VectorPath {\n const rx = width / 2\n const ry = height / 2\n const inner = clamp01(options.ratio ?? 0)\n const sweep = Math.max(0, Math.min(360, options.sweep ?? 360))\n if (sweep <= 0) return []\n\n const full = sweep >= 360\n // Degrees clockwise from twelve o'clock, matching the appearance schema's `startAngle` (a clock face, not `Math.atan2`).\n const from = ((options.startAngle ?? 0) - 90) * (Math.PI / 180)\n const to = from + sweep * (Math.PI / 180)\n\n if (full && inner <= 0) {\n return [{ anchors: arcAnchors(rx, ry, from, to, true), closed: true }]\n }\n if (full) {\n // A ring: two closed rings, the inner wound the other way so even-odd fill leaves a hole.\n return [\n { anchors: arcAnchors(rx, ry, from, to, true), closed: true },\n { anchors: arcAnchors(rx * inner, ry * inner, to, from, true), closed: true },\n ]\n }\n\n // An arc, closed back on itself: out along the outer edge, back along the\n // inner one (or through the centre, when there is no hole).\n const outer = arcAnchors(rx, ry, from, to, false)\n const back =\n inner > 0\n ? arcAnchors(rx * inner, ry * inner, to, from, false)\n : [corner({ x: 0, y: 0 })]\n return [{ anchors: [...outer, ...back], closed: true }]\n}\n\n/** An elliptical arc as anchors, split into segments of at most 90° (the span one cubic approximates to within a fraction of a pixel). `whole` drops the duplicated final anchor when the arc closes on its own start. */\nfunction arcAnchors(\n rx: number,\n ry: number,\n from: number,\n to: number,\n whole: boolean\n): PathAnchor[] {\n const total = to - from\n const steps = Math.max(1, Math.ceil(Math.abs(total) / (Math.PI / 2)))\n const step = total / steps\n // Each control point sits α along the curve's tangent, α = (4/3)·tan(Δ/4) for a segment spanning Δ; signed with\n // the step so a clockwise arc bulges the right way.\n const alpha = (4 / 3) * Math.tan(step / 4)\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i <= steps; i++) {\n const a = from + step * i\n const point = { x: rx * Math.cos(a), y: ry * Math.sin(a) }\n // d/da of the point — the arc's tangent at this angle.\n const tangent = { x: -rx * Math.sin(a), y: ry * Math.cos(a) }\n const offset = { x: tangent.x * alpha, y: tangent.y * alpha }\n anchors.push({\n point,\n inHandle:\n i === 0 ? null : { x: point.x - offset.x, y: point.y - offset.y },\n outHandle:\n i === steps ? null : { x: point.x + offset.x, y: point.y + offset.y },\n })\n }\n\n if (whole && anchors.length > 1) {\n // The arc came back to where it started; fold the duplicate into the first\n // anchor so the ring has one anchor per corner rather than two stacked.\n const last = anchors.pop()!\n anchors[0].inHandle = last.inHandle\n }\n return anchors\n}\n"]}
|
|
@@ -140,12 +140,7 @@ export type RotatedBox = NodeOf<typeof RotatedBox>;
|
|
|
140
140
|
export interface CameraProps extends ShapeProps {
|
|
141
141
|
/** Magnification factor. Values > 1 zoom in; < 1 zoom out. */
|
|
142
142
|
zoom: number;
|
|
143
|
-
/**
|
|
144
|
-
* World-space point that maps to the centre of the camera viewport — what
|
|
145
|
-
* the camera is pointed at. Same name and meaning as
|
|
146
|
-
* `Graphics3D.perspective({ lookAt })`, so a 2D and a 3D camera are aimed
|
|
147
|
-
* with the same word.
|
|
148
|
-
*/
|
|
143
|
+
/** World-space point mapped to the camera viewport's centre (what it is pointed at); same name and meaning as `Graphics3D.perspective({ lookAt })`. */
|
|
149
144
|
lookAt: Vector2;
|
|
150
145
|
/** Rotation of the camera view in degrees (clockwise). */
|
|
151
146
|
heading: number;
|
|
@@ -175,12 +170,4 @@ export interface OrbitCameraProps extends Node2DProps {
|
|
|
175
170
|
/** Degrees per second the camera orbits on its own — a turntable. */
|
|
176
171
|
orbitSpeed: number;
|
|
177
172
|
}
|
|
178
|
-
export interface RotatedBoxProps extends Node2DProps {
|
|
179
|
-
/**
|
|
180
|
-
* Visual rotation angle in degrees. Unlike standard `rotation`,
|
|
181
|
-
* animating this ALSO dynamically calculates a new bounding box
|
|
182
|
-
* for the flex/layout engine.
|
|
183
|
-
*/
|
|
184
|
-
angle: number;
|
|
185
|
-
}
|
|
186
173
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/layout/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAQvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,kGAAkG;AAClG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAOjB,CAAC;AAcH,kGAAkG;AAClG,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAsBtB,CAAC;AAEH,2HAA2H;AAC3H,eAAO,MAAM,UAAU;;;;;;qEAyBrB,CAAC;AAOH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,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CAAC;IAC7E,CAAC;CACJ,CAAC,CAAC;AAEH,SAAS,IAAI,CAAC,KAAa;IACvB,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["import { lerpLookAt, type LookAt } from \"@/attributes/layout/space3d\";\nimport type { NodeOf } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { commandsFor } from \"@/components/factory/commands-for\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Aim from \"@/components/modules/aim\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport type { RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { ShapeProps } from \"@/components/builtins/geometry/geometry\";\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\n\n/** A framed viewport: painted like a rect, its children seen through a camera aimed inside it. */\nexport const Camera = component2d({\n key: \"camera\",\n state: { ...Paint.state, ...Flow.state, ...Aim.state, ...Corners.state },\n commands: { ...Paint.commands, ...Aim.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state), { children: () => Aim.camera(ctx, state) }),\n});\n\nconst orbit = {\n lookAt: Types.custom<LookAt>({ x: 0, y: 0 }, {\n lerp: lerpLookAt, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } },\n }),\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\n heading: Types.number(0, { step: 1, unit: \"°\" }),\n orbit: Types.number(0, { step: 1, unit: \"°\" }),\n elevation: Types.number(0, { step: 1, unit: \"°\" }),\n dolly: Types.number(0, { step: 10 }),\n orbitSpeed: Types.number(0),\n};\n\n/** The stage's 2.5D camera for one subtree: its children stand in one space, orbited in depth. */\nexport const OrbitCamera = component2d({\n key: \"orbitCamera\",\n state: orbit,\n defaults: { width: \"hug\", height: \"hug\", perspective: 1000 },\n commands: commandsFor(orbit, {\n orbitTo: { args: [\"orbit\", \"elevation\"] },\n dollyTo: { args: [\"dolly\"] },\n zoomTo: { args: [\"zoom\"] },\n panTo: { args: [\"lookAt\"] },\n headingTo: { args: [\"heading\"] },\n }),\n render: (ctx, state) => ctx.space({\n perspective: state.perspective,\n orbit: state.orbit + state.orbitSpeed * ctx.time.total,\n elevation: state.elevation,\n dolly: state.dolly,\n lookAt: state.lookAt,\n zoom: state.zoom,\n heading: state.heading,\n viewportX: 0,\n viewportY: 0,\n }),\n});\n\n/** Its children laid out in a box turned by `angle`, and turned with it: the box it reports is the turned one's bounds. */\nexport const RotatedBox = component2d({\n key: \"rotated-box\",\n state: { angle: Types.number(-90) },\n defaults: { rotation: (state) => state.angle },\n measure: (measurer, state, children) => {\n const { cos, sin } = turn(state.angle);\n const { width: w, height: h } = measurer.max;\n const ortho = Math.abs(state.angle % 180) === 90;\n const room = w !== undefined && h !== undefined\n ? { width: w * cos + h * sin, height: w * sin + h * cos }\n : { width: ortho ? h : w, height: ortho ? w : h };\n let width = 0;\n let height = 0;\n for (const child of children) {\n const size = child.measure(room);\n width = Math.max(width, size.width);\n height = Math.max(height, size.height);\n }\n return { width: width * cos + height * sin, height: width * sin + height * cos };\n },\n layout: (box, state, children) => {\n const { cos, sin } = turn(state.angle);\n const turned = { x: 0, y: 0, width: box.width * cos + box.height * sin, height: box.width * sin + box.height * cos };\n return Flow.layout(turned, state as unknown as Flow.FlowState, children);\n },\n});\n\nfunction turn(angle: number): { cos: number; sin: number } {\n const rad = angle * (Math.PI / 180);\n return { cos: Math.abs(Math.cos(rad)), sin: Math.abs(Math.sin(rad)) };\n}\n\nexport type Camera = NodeOf<typeof Camera>;\nexport type OrbitCamera = NodeOf<typeof OrbitCamera>;\nexport type RotatedBox = NodeOf<typeof RotatedBox>;\n\n// What code building a camera or a rotated box names its props as.\n\nexport interface CameraProps extends ShapeProps {\n /** Magnification factor. Values > 1 zoom in; < 1 zoom out. */\n zoom: number;\n /**\n * World-space point that maps to the centre of the camera viewport — what\n * the camera is pointed at. Same name and meaning as\n * `Graphics3D.perspective({ lookAt })`, so a 2D and a 3D camera are aimed\n * with the same word.\n */\n lookAt: Vector2;\n /** Rotation of the camera view in degrees (clockwise). */\n heading: number;\n /**\n * A node of the camera's world to keep in view, by id: the camera is aimed\n * at its centre each frame, and {@link lookAt} becomes an offset from it.\n */\n follow: string;\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\n cornerRadius: RectCornerRadius;\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\n cornerStyle: RectCornerStyle;\n}\n\nexport interface OrbitCameraProps extends Node2DProps {\n /** The point the camera orbits and looks at; `z` puts it in depth, as a node's `depth` does. */\n lookAt: LookAt;\n /** Lens zoom, applied after the projection. Values > 1 zoom in. */\n zoom: number;\n /** Roll of the view in degrees, clockwise. */\n heading: number;\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera right. */\n orbit: number;\n /** Degrees above the layers. Positive looks down on them. */\n elevation: number;\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective. */\n dolly: number;\n /** Degrees per second the camera orbits on its own — a turntable. */\n orbitSpeed: number;\n}\n\n// Adjust this import path if needed\n\nexport interface RotatedBoxProps extends Node2DProps {\n /** \n * Visual rotation angle in degrees. Unlike standard `rotation`, \n * animating this ALSO dynamically calculates a new bounding box \n * for the flex/layout engine. \n */\n angle: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/components/builtins/layout/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAe,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAOpD,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC;IAC9B,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE;IACxE,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC,QAAQ,EAAE;IAChD,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnG,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvF,MAAM,EAAE,CAAC,GAAG,EAAE,KAA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,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC;IACrF,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC7B,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACrH,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAkC,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;CACJ,CAAC,CAAC;AAEH,SAAS,IAAI,CAAC,KAAa;IACvB,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["import { lerpLookAt, type LookAt } from \"@/attributes/layout/space3d\";\nimport type { NodeOf } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { commandsFor } from \"@/components/factory/commands-for\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Aim from \"@/components/modules/aim\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\nimport type { RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { ShapeProps } from \"@/components/builtins/geometry/geometry\";\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\n\n/** A framed viewport: painted like a rect, its children seen through a camera aimed inside it. */\nexport const Camera = component2d({\n key: \"camera\",\n state: { ...Paint.state, ...Flow.state, ...Aim.state, ...Corners.state },\n commands: { ...Paint.commands, ...Aim.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state), { children: () => Aim.camera(ctx, state) }),\n});\n\nconst orbit = {\n lookAt: Types.custom<LookAt>({ x: 0, y: 0 }, {\n lerp: lerpLookAt, kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } },\n }),\n zoom: Types.number(1, { min: 0.01, step: 0.1, unit: \"×\" }),\n heading: Types.number(0, { step: 1, unit: \"°\" }),\n orbit: Types.number(0, { step: 1, unit: \"°\" }),\n elevation: Types.number(0, { step: 1, unit: \"°\" }),\n dolly: Types.number(0, { step: 10 }),\n orbitSpeed: Types.number(0),\n};\n\n/** The stage's 2.5D camera for one subtree: its children stand in one space, orbited in depth. */\nexport const OrbitCamera = component2d({\n key: \"orbitCamera\",\n state: orbit,\n defaults: { width: \"hug\", height: \"hug\", perspective: 1000 },\n commands: commandsFor(orbit, {\n orbitTo: { args: [\"orbit\", \"elevation\"] },\n dollyTo: { args: [\"dolly\"] },\n zoomTo: { args: [\"zoom\"] },\n panTo: { args: [\"lookAt\"] },\n headingTo: { args: [\"heading\"] },\n }),\n render: (ctx, state) => ctx.space({\n perspective: state.perspective,\n orbit: state.orbit + state.orbitSpeed * ctx.time.total,\n elevation: state.elevation,\n dolly: state.dolly,\n lookAt: state.lookAt,\n zoom: state.zoom,\n heading: state.heading,\n viewportX: 0,\n viewportY: 0,\n }),\n});\n\n/** Its children laid out in a box turned by `angle`, and turned with it: the box it reports is the turned one's bounds. */\nexport const RotatedBox = component2d({\n key: \"rotated-box\",\n state: { angle: Types.number(-90) },\n defaults: { rotation: (state) => state.angle },\n measure: (measurer, state, children) => {\n const { cos, sin } = turn(state.angle);\n const { width: w, height: h } = measurer.max;\n const ortho = Math.abs(state.angle % 180) === 90;\n const room = w !== undefined && h !== undefined\n ? { width: w * cos + h * sin, height: w * sin + h * cos }\n : { width: ortho ? h : w, height: ortho ? w : h };\n let width = 0;\n let height = 0;\n for (const child of children) {\n const size = child.measure(room);\n width = Math.max(width, size.width);\n height = Math.max(height, size.height);\n }\n return { width: width * cos + height * sin, height: width * sin + height * cos };\n },\n layout: (box, state, children) => {\n const { cos, sin } = turn(state.angle);\n const turned = { x: 0, y: 0, width: box.width * cos + box.height * sin, height: box.width * sin + box.height * cos };\n return Flow.layout(turned, state as unknown as Flow.FlowState, children);\n },\n});\n\nfunction turn(angle: number): { cos: number; sin: number } {\n const rad = angle * (Math.PI / 180);\n return { cos: Math.abs(Math.cos(rad)), sin: Math.abs(Math.sin(rad)) };\n}\n\nexport type Camera = NodeOf<typeof Camera>;\nexport type OrbitCamera = NodeOf<typeof OrbitCamera>;\nexport type RotatedBox = NodeOf<typeof RotatedBox>;\n\n// What code building a camera or a rotated box names its props as.\n\nexport interface CameraProps extends ShapeProps {\n /** Magnification factor. Values > 1 zoom in; < 1 zoom out. */\n zoom: number;\n /** World-space point mapped to the camera viewport's centre (what it is pointed at); same name and meaning as `Graphics3D.perspective({ lookAt })`. */\n lookAt: Vector2;\n /** Rotation of the camera view in degrees (clockwise). */\n heading: number;\n /**\n * A node of the camera's world to keep in view, by id: the camera is aimed\n * at its centre each frame, and {@link lookAt} becomes an offset from it.\n */\n follow: string;\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\n cornerRadius: RectCornerRadius;\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\n cornerStyle: RectCornerStyle;\n}\n\nexport interface OrbitCameraProps extends Node2DProps {\n /** The point the camera orbits and looks at; `z` puts it in depth, as a node's `depth` does. */\n lookAt: LookAt;\n /** Lens zoom, applied after the projection. Values > 1 zoom in. */\n zoom: number;\n /** Roll of the view in degrees, clockwise. */\n heading: number;\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera right. */\n orbit: number;\n /** Degrees above the layers. Positive looks down on them. */\n elevation: number;\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective. */\n dolly: number;\n /** Degrees per second the camera orbits on its own — a turntable. */\n orbitSpeed: number;\n}\n"]}
|
|
@@ -156,12 +156,7 @@ export interface VideoProps extends RectProps {
|
|
|
156
156
|
filters?: VideoAdjustment;
|
|
157
157
|
/** Whether playback advances with the node's clock (drives both picture and sound). Default true. */
|
|
158
158
|
playing?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Explicit source time to show, in seconds. Omit it (the default) and the
|
|
161
|
-
* picture is timed from the moment this node appeared; set it to drive the
|
|
162
|
-
* playhead yourself, and set it to `null` to hand the playhead back to the
|
|
163
|
-
* clock (`set()` merges a partial, so `undefined` won't clear it).
|
|
164
|
-
*/
|
|
159
|
+
/** Explicit source time to show, in seconds. Omitted, the picture is timed from the moment this node appeared; set it to drive the playhead, or `null` to hand it back to the clock (`set()` merges a partial, so `undefined` won't clear it). */
|
|
165
160
|
timestamp?: number | null;
|
|
166
161
|
trimStart?: number;
|
|
167
162
|
trimEnd?: number;
|
|
@@ -176,61 +171,26 @@ export interface VideoProps extends RectProps {
|
|
|
176
171
|
muted?: boolean;
|
|
177
172
|
/** Audio effects applied to the video's sound track (gain, eq, echo, …). */
|
|
178
173
|
audioEffects?: AudioEffectsInput;
|
|
179
|
-
/**
|
|
180
|
-
* The node id of an `AudioBus` in this clip to route the video's sound into.
|
|
181
|
-
*
|
|
182
|
-
* A `Video` is a `Node2D`, so it cannot be parented under a bus the way a
|
|
183
|
-
* `SoundNode` is — its audio is welded to its picture, which has to stay in
|
|
184
|
-
* the visual tree. Naming one instead is what lets a video's dialogue sit on
|
|
185
|
-
* the same bus as everything else, so ducking the whole group is still one
|
|
186
|
-
* edit — and it is the *same* id a `SoundNode` under that bus writes as its
|
|
187
|
-
* `parentId`, rather than a second vocabulary for "which bus". An id matching
|
|
188
|
-
* no bus routes straight to the master, the same as no bus at all.
|
|
189
|
-
*/
|
|
174
|
+
/** The node id of an `AudioBus` in this clip to route the video's sound into. A `Video` is a `Node2D` so can't sit under a bus, its audio being welded to its picture; naming one (the same id a `SoundNode` under that bus writes as `parentId`) lets dialogue share a bus, so ducking the group is one edit. An id matching no bus routes to the master. */
|
|
190
175
|
bus?: string;
|
|
191
176
|
/**
|
|
192
|
-
* An explicit **playback schedule**:
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* `elapsed`, and the sound is scheduled one clip per segment.
|
|
200
|
-
*
|
|
201
|
-
* It exists because a **pause** cannot be expressed any other way. `playing:
|
|
202
|
-
* false` holds the clip's *first* frame, because with playback derived
|
|
203
|
-
* linearly from the clock there is nothing else it could hold; and the sound
|
|
204
|
-
* runs on the node's own clock regardless, so a picture frozen by any means
|
|
205
|
-
* would drift away from it. A schedule states the one thing both halves need
|
|
206
|
-
* and neither could infer — that a paused stretch consumes no source — so
|
|
207
|
-
* they cannot come apart.
|
|
208
|
-
*
|
|
209
|
-
* Still a pure function of the clock, which is the property everything else
|
|
210
|
-
* here is built on: frame *N* is identical however the playhead reached it,
|
|
211
|
-
* so a scrub, a playthrough and an export agree.
|
|
177
|
+
* An explicit **playback schedule**: stretches of this node's own clock during which the clip advances, and where in
|
|
178
|
+
* the source each starts. Omitted, the clip runs from the moment the node appears, at `speed`. Given, `playing` and
|
|
179
|
+
* `timestamp` are superseded: the picture takes its source time from the segment covering the current `elapsed`, and
|
|
180
|
+
* sound is scheduled one clip per segment. It exists because a **pause** can't be expressed otherwise: `playing: false`
|
|
181
|
+
* holds the first frame and the sound runs on the node's clock regardless, so a frozen picture would drift from it. A
|
|
182
|
+
* schedule states that a paused stretch consumes no source, so they can't come apart. Still a pure function of the
|
|
183
|
+
* clock: scrub, playthrough and export agree.
|
|
212
184
|
*/
|
|
213
185
|
segments?: readonly VideoSegment[];
|
|
214
186
|
}
|
|
215
|
-
/**
|
|
216
|
-
* One stretch of a {@link Video}'s own clock during which its source advances —
|
|
217
|
-
* see {@link VideoProps.segments}.
|
|
218
|
-
*
|
|
219
|
-
* Trim and loop are applied *on top* of this, by the same code that applies them
|
|
220
|
-
* to unscheduled playback, so a schedule says when the clip is running and the
|
|
221
|
-
* clip's own props go on saying which part of the file it is running through.
|
|
222
|
-
*/
|
|
187
|
+
/** One stretch of a {@link Video}'s own clock during which its source advances (see {@link VideoProps.segments}). Trim and loop apply on top, so a schedule says when the clip runs and the clip's props say which part of the file it runs through. */
|
|
223
188
|
export interface VideoSegment {
|
|
224
189
|
/** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */
|
|
225
190
|
at: number;
|
|
226
191
|
/** Source in-point for it, in seconds. */
|
|
227
192
|
from: number;
|
|
228
|
-
/**
|
|
229
|
-
* How long it runs, in seconds of the node's clock.
|
|
230
|
-
*
|
|
231
|
-
* `Infinity` for a clip left running — the same open sentinel
|
|
232
|
-
* `AudioRequest.endAt` uses — which resolves against the clip's length.
|
|
233
|
-
*/
|
|
193
|
+
/** How long it runs, in seconds of the node's clock; `Infinity` for a clip left running (the open sentinel `AudioRequest.endAt` uses), resolved against the clip's length. */
|
|
234
194
|
duration: number;
|
|
235
195
|
/** Playback rate through it. Defaults to the node's own `speed`. */
|
|
236
196
|
speed?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAItG,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEtF,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,0BAA0B,CAAC;AAO/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAItG,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEtF,OAAO,KAAK,EAAE,MAAM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jC,8VAA8V;IAC9V,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAEtC;AAED,wPAAwP;AACxP,MAAM,WAAW,YAAY;IACzB,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,8KAA8K;IAC9K,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -10,11 +10,7 @@ import * as Corners from "../../../components/modules/corners.js";
|
|
|
10
10
|
import * as Flow from "../../../components/modules/flow.js";
|
|
11
11
|
import * as Paint from "../../../components/modules/paint.js";
|
|
12
12
|
import { internalsOf } from "../../../components/factory/views.js";
|
|
13
|
-
/**
|
|
14
|
-
* Video: a rect painted with a playing picture under its fill, and the
|
|
15
|
-
* picture's sound. Its sound plays from `play`; a `video` row with no `play`
|
|
16
|
-
* of its own gets one per segment, or one over its span while it plays.
|
|
17
|
-
*/
|
|
13
|
+
/** Video: a rect painted with a playing picture under its fill, plus the picture's sound. Sound plays from `play`; a `video` row with no `play` gets one per segment, or one over its span while it plays. */
|
|
18
14
|
const video = {
|
|
19
15
|
src: Types.custom(undefined),
|
|
20
16
|
fit: Types.custom(undefined),
|
|
@@ -78,7 +74,7 @@ function pictureOf(host, s, elapsed) {
|
|
|
78
74
|
return kept.fill;
|
|
79
75
|
const prop = {
|
|
80
76
|
type: "video", src: s.src, fit: s.fit, crop: s.crop, zoom: s.zoom, anchor: s.anchor, matrix: s.matrix,
|
|
81
|
-
|
|
77
|
+
preset: { adjustments: s.filters }, playing: s.playing, timestamp: s.timestamp ?? scheduled,
|
|
82
78
|
trimStart: s.trimStart, trimEnd: s.trimEnd, speed: s.speed, loop: s.loop, duration: s.duration,
|
|
83
79
|
};
|
|
84
80
|
const fill = resolveFill(prop);
|
|
@@ -122,7 +118,7 @@ export const Video = component2d({
|
|
|
122
118
|
if (!state.src)
|
|
123
119
|
return;
|
|
124
120
|
loader.fill(resolveFill({
|
|
125
|
-
type: "video", src: state.src,
|
|
121
|
+
type: "video", src: state.src, preset: { adjustments: state.filters }, trimStart: state.trimStart, trimEnd: state.trimEnd,
|
|
126
122
|
}));
|
|
127
123
|
},
|
|
128
124
|
measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,kCAAkC,CAAC;AAG/F,OAAO,EAAE,aAAa,EAA8C,MAAM,+CAA+C,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAwB,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAE,eAAe,EAAkB,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD;;;;GAIG;AAEH,MAAM,KAAK,GAAG;IACV,GAAG,EAAE,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC;IAChD,GAAG,EAAE,KAAK,CAAC,MAAM,CAAuB,SAAS,CAAC;IAClD,IAAI,EAAE,KAAK,CAAC,MA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AAK,CAAC,CAAC;IACvF,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACnB,MAAM,CAAC,GAAG,KAA0F,CAAC;QACrG,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;QACzJ,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YAClD,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,gBAAgB,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAU;YAC7D,sDAAsD;YACtD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO;gBACnB,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAU,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;gBACxH,CAAC,CAAC,IAAI,CAAC;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import type { Alignment } from \"@/attributes/layout/alignment\";\nimport type { InsetsResolved } from \"@/attributes/layout/insets\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { resolveAudioEffects, type AudioEffectsInput } from \"@/attributes/audio/effects/chain\";\nimport type { AudioEffect } from \"@/attributes/audio/effects/union\";\nimport type { ImageFit, ImageMatrix, ImageCrop } from \"@/attributes/shape/fill/implementations/image\";\nimport { sourceTimeFor, type VideoFillProp, type VideoFillResolved } from \"@/attributes/shape/fill/implementations/video\";\nimport { resolveFill, UNSET_MEDIA_FILL } from \"@/attributes/shape/fill/registry\";\nimport type { FillProp } from \"@/attributes/shape/fill/union\";\nimport { resolveChainAdjustments, type VideoAdjustment } from \"@/attributes/shape/filters/chain\";\nimport { lerpFilterArray, type AnyFilter } from \"@/attributes/shape/filters/registry\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport type { NodeOf, Values } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport { internalsOf } from \"@/components/factory/views\";\nimport type { RectProps } from \"@/components/builtins/geometry/geometry\";\n\n/**\n * Video: a rect painted with a playing picture under its fill, and the\n * picture's sound. Its sound plays from `play`; a `video` row with no `play`\n * of its own gets one per segment, or one over its span while it plays.\n */\n\nconst video = {\n src: Types.custom<string | undefined>(undefined),\n fit: Types.custom<ImageFit | undefined>(undefined),\n crop: Types.insets,\n zoom: 1,\n anchor: Types.alignment,\n matrix: Types.custom<ImageMatrix | undefined>(undefined),\n filters: Types.custom<VideoAdjustment, AnyFilter[]>([] as never, {\n resolve: (v) => resolveChainAdjustments(v),\n lerp: lerpFilterArray,\n }),\n playing: true,\n timestamp: Types.custom<number | null | undefined>(undefined),\n trimStart: Types.custom<number | undefined>(undefined),\n trimEnd: Types.custom<number | undefined>(undefined),\n speed: Types.custom<number | undefined>(undefined),\n loop: Types.custom<\"forward\" | \"reverse\" | \"none\" | undefined>(undefined),\n duration: Types.custom<number | undefined>(undefined),\n volume: 1,\n muted: false,\n audioEffects: Types.custom<AudioEffectsInput, AudioEffect[]>([] as never, { resolve: (v) => resolveAudioEffects(v) }),\n bus: Types.custom<string | undefined>(undefined),\n segments: Types.custom<readonly VideoSegment[]>([]),\n};\n\ntype VideoState = Values<typeof video> & { readonly crop: InsetsResolved; readonly anchor: Alignment };\n\n/** Source seconds played by `elapsed` clip seconds into the segments, or `null` without any. */\nfunction playedAt(s: VideoState, elapsed: number): number | null {\n if (s.segments.length === 0) return null;\n let played = 0;\n for (const segment of s.segments) {\n if (elapsed <= segment.at) break;\n played += Math.min(elapsed - segment.at, segment.duration) * (segment.speed ?? s.speed ?? 1);\n }\n return played;\n}\n\nfunction scheduledTimestamp(s: VideoState, elapsed: number): number | undefined {\n const played = playedAt(s, elapsed);\n if (played === null) return undefined;\n const start = s.trimStart ?? 0;\n const first = s.segments[0];\n return sourceTimeFor(played + (first ? first.from - start : 0), start, s.trimEnd ?? Infinity, s.loop, s.duration);\n}\n\nconst pictures = new WeakMap<object, { readonly key: string; readonly fill: VideoFillResolved }>();\n\n/** The frame to paint, resolved once per change of what it depends on. */\nfunction pictureOf(host: object, s: VideoState, elapsed: number): VideoFillResolved | null {\n if (!s.src) {\n pictures.delete(host);\n return null;\n }\n const scheduled = scheduledTimestamp(s, elapsed);\n const crop = s.crop;\n const anchor = s.anchor as unknown as Vector2;\n const key = [\n s.src, s.fit ?? \"\", s.zoom, s.playing ? 1 : 0, crop.left, crop.right, crop.top, crop.bottom, anchor.x, anchor.y,\n s.timestamp ?? \"\", s.trimStart ?? \"\", s.trimEnd ?? \"\", s.speed ?? \"\", s.loop ?? \"\", s.duration ?? \"\", scheduled ?? \"\",\n ].join(\"|\");\n const kept = pictures.get(host);\n if (kept && kept.key === key) return kept.fill;\n const prop: VideoFillProp = {\n type: \"video\", src: s.src, fit: s.fit, crop: s.crop, zoom: s.zoom, anchor: s.anchor, matrix: s.matrix,\n filters: s.filters as never, playing: s.playing, timestamp: s.timestamp ?? scheduled,\n trimStart: s.trimStart, trimEnd: s.trimEnd, speed: s.speed, loop: s.loop, duration: s.duration,\n };\n const fill = resolveFill(prop as FillProp) as VideoFillResolved;\n pictures.set(host, { key, fill });\n return fill;\n}\n\nexport const Video = component2d({\n key: \"video\",\n state: { ...Paint.state, ...Flow.state, ...Corners.state, ...video },\n commands: {\n ...Paint.commands,\n /** Its sound: from `from` in the source for a segment, or as it plays. Cut when the command ends. */\n play: {\n args: {\n from: Types.custom<number | undefined>(undefined),\n volume: Types.custom<number | undefined>(undefined),\n speed: Types.custom<number | undefined>(undefined),\n },\n run: (timeline, state) => {\n const s = state as unknown as VideoState;\n const segment = timeline.args.from !== undefined;\n if (!s.src || s.muted || (!segment && !s.playing)) return timeline.together([]);\n const speed = timeline.args.speed ?? s.speed ?? 1;\n const loop = !segment && (s.loop ?? \"none\") !== \"none\";\n return timeline.sound(s.src, {\n volume: timeline.args.volume ?? s.volume,\n loop,\n trimStart: segment ? timeline.args.from : s.trimStart,\n trimEnd: s.trimEnd,\n speed,\n effects: s.audioEffects,\n bus: s.bus,\n optional: true,\n closed: !loop,\n });\n },\n },\n },\n load: (loader, state) => {\n if (!state.src) return;\n loader.fill(resolveFill({\n type: \"video\", src: state.src, filters: state.filters, trimStart: state.trimStart, trimEnd: state.trimEnd,\n } as unknown as FillProp));\n },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const s = state as unknown as VideoState & Values<typeof Paint.state> & Values<typeof Corners.state>;\n const picture = pictureOf(internalsOf(ctx).host, s, ctx.time.elapsed);\n const outline = { width: ctx.size.width, height: ctx.size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle, start: s.start, end: s.end };\n Paint.draw(ctx, state, Corners.rect(ctx.size, state), {\n fill: [(picture ?? UNSET_MEDIA_FILL), ...state.fill] as never,\n // The overlay lies on the picture only, masked by it.\n overlay: () => (picture\n ? new Graphics2D().mask().rect(outline).fill([picture] as never).applyMask().rect(outline).fill(state.overlay).endMask()\n : null),\n });\n },\n});\n\nexport type Video = NodeOf<typeof Video>;\n\n// What code building a video names its props as, and the segments it plays.\n\nexport interface VideoProps extends RectProps {\n src?: string;\n /** How the (cropped) frame is scaled into the node's bounds. Default 'fill'. */\n fit?: ImageFit;\n /** Window onto the source frame, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` (default) is the fitted size. */\n zoom?: number;\n /** The point held fixed as `zoom` scales; also the alignment when it doesn't cover. */\n anchor?: Alignment;\n /** Raw frame→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n /** Visual filters applied to the rendered frame (blur, color, posterizeTime, echo, …). */\n filters?: VideoAdjustment;\n /** Whether playback advances with the node's clock (drives both picture and sound). Default true. */\n playing?: boolean;\n /**\n * Explicit source time to show, in seconds. Omit it (the default) and the\n * picture is timed from the moment this node appeared; set it to drive the\n * playhead yourself, and set it to `null` to hand the playhead back to the\n * clock (`set()` merges a partial, so `undefined` won't clear it).\n */\n timestamp?: number | null;\n trimStart?: number;\n trimEnd?: number;\n /** Playback-rate multiplier for both picture and audio. Default 1. */\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n /** Length of one loop cycle, in seconds. Defaults to the trimmed clip length. */\n duration?: number;\n /** Audio volume in [0, 1]. Default 1. */\n volume?: number;\n /** Silence the video's audio track without affecting the picture. Default false. */\n muted?: boolean;\n /** Audio effects applied to the video's sound track (gain, eq, echo, …). */\n audioEffects?: AudioEffectsInput;\n /**\n * The node id of an `AudioBus` in this clip to route the video's sound into.\n *\n * A `Video` is a `Node2D`, so it cannot be parented under a bus the way a\n * `SoundNode` is — its audio is welded to its picture, which has to stay in\n * the visual tree. Naming one instead is what lets a video's dialogue sit on\n * the same bus as everything else, so ducking the whole group is still one\n * edit — and it is the *same* id a `SoundNode` under that bus writes as its\n * `parentId`, rather than a second vocabulary for \"which bus\". An id matching\n * no bus routes straight to the master, the same as no bus at all.\n */\n bus?: string;\n /**\n * An explicit **playback schedule**: the stretches of this node's own clock\n * during which the clip advances, and where in the source each one starts.\n *\n * Omit it (the default) and playback is what it has always been — the clip\n * runs from the moment the node appears, at `speed`, until it or the node\n * runs out. Give it, and `playing`/`timestamp` are both superseded: the\n * picture takes its source time from whichever segment covers the current\n * `elapsed`, and the sound is scheduled one clip per segment.\n *\n * It exists because a **pause** cannot be expressed any other way. `playing:\n * false` holds the clip's *first* frame, because with playback derived\n * linearly from the clock there is nothing else it could hold; and the sound\n * runs on the node's own clock regardless, so a picture frozen by any means\n * would drift away from it. A schedule states the one thing both halves need\n * and neither could infer — that a paused stretch consumes no source — so\n * they cannot come apart.\n *\n * Still a pure function of the clock, which is the property everything else\n * here is built on: frame *N* is identical however the playhead reached it,\n * so a scrub, a playthrough and an export agree.\n */\n segments?: readonly VideoSegment[];\n\n}\n\n/**\n * One stretch of a {@link Video}'s own clock during which its source advances —\n * see {@link VideoProps.segments}.\n *\n * Trim and loop are applied *on top* of this, by the same code that applies them\n * to unscheduled playback, so a schedule says when the clip is running and the\n * clip's own props go on saying which part of the file it is running through.\n */\nexport interface VideoSegment {\n /** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */\n at: number;\n /** Source in-point for it, in seconds. */\n from: number;\n /**\n * How long it runs, in seconds of the node's clock.\n *\n * `Infinity` for a clip left running — the same open sentinel\n * `AudioRequest.endAt` uses — which resolves against the clip's length.\n */\n duration: number;\n /** Playback rate through it. Defaults to the node's own `speed`. */\n speed?: number;\n /** Linear gain for its sound. Defaults to the node's own `volume`. */\n volume?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../../src/components/builtins/media/media.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,kCAAkC,CAAC;AAG/F,OAAO,EAAE,aAAa,EAA8C,MAAM,+CAA+C,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,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J,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YAClD,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,gBAAgB,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAU;YAC7D,sDAAsD;YACtD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO;gBACnB,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAU,CAAC,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;gBACxH,CAAC,CAAC,IAAI,CAAC;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import type { Alignment } from \"@/attributes/layout/alignment\";\nimport type { InsetsResolved } from \"@/attributes/layout/insets\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { resolveAudioEffects, type AudioEffectsInput } from \"@/attributes/audio/effects/chain\";\nimport type { AudioEffect } from \"@/attributes/audio/effects/union\";\nimport type { ImageFit, ImageMatrix, ImageCrop } from \"@/attributes/shape/fill/implementations/image\";\nimport { sourceTimeFor, type VideoFillProp, type VideoFillResolved } from \"@/attributes/shape/fill/implementations/video\";\nimport { resolveFill, UNSET_MEDIA_FILL } from \"@/attributes/shape/fill/registry\";\nimport type { FillProp } from \"@/attributes/shape/fill/union\";\nimport { resolveChainAdjustments, type VideoAdjustment } from \"@/attributes/shape/filters/chain\";\nimport { lerpFilterArray, type AnyFilter } from \"@/attributes/shape/filters/registry\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport type { NodeOf, Values } from \"@/components/factory/api\";\nimport { component2d } from \"@/components/factory/component2d\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Corners from \"@/components/modules/corners\";\nimport * as Flow from \"@/components/modules/flow\";\nimport * as Paint from \"@/components/modules/paint\";\nimport { internalsOf } from \"@/components/factory/views\";\nimport type { RectProps } from \"@/components/builtins/geometry/geometry\";\n\n/** Video: a rect painted with a playing picture under its fill, plus the picture's sound. Sound plays from `play`; a `video` row with no `play` gets one per segment, or one over its span while it plays. */\n\nconst video = {\n src: Types.custom<string | undefined>(undefined),\n fit: Types.custom<ImageFit | undefined>(undefined),\n crop: Types.insets,\n zoom: 1,\n anchor: Types.alignment,\n matrix: Types.custom<ImageMatrix | undefined>(undefined),\n filters: Types.custom<VideoAdjustment, AnyFilter[]>([] as never, {\n resolve: (v) => resolveChainAdjustments(v),\n lerp: lerpFilterArray,\n }),\n playing: true,\n timestamp: Types.custom<number | null | undefined>(undefined),\n trimStart: Types.custom<number | undefined>(undefined),\n trimEnd: Types.custom<number | undefined>(undefined),\n speed: Types.custom<number | undefined>(undefined),\n loop: Types.custom<\"forward\" | \"reverse\" | \"none\" | undefined>(undefined),\n duration: Types.custom<number | undefined>(undefined),\n volume: 1,\n muted: false,\n audioEffects: Types.custom<AudioEffectsInput, AudioEffect[]>([] as never, { resolve: (v) => resolveAudioEffects(v) }),\n bus: Types.custom<string | undefined>(undefined),\n segments: Types.custom<readonly VideoSegment[]>([]),\n};\n\ntype VideoState = Values<typeof video> & { readonly crop: InsetsResolved; readonly anchor: Alignment };\n\n/** Source seconds played by `elapsed` clip seconds into the segments, or `null` without any. */\nfunction playedAt(s: VideoState, elapsed: number): number | null {\n if (s.segments.length === 0) return null;\n let played = 0;\n for (const segment of s.segments) {\n if (elapsed <= segment.at) break;\n played += Math.min(elapsed - segment.at, segment.duration) * (segment.speed ?? s.speed ?? 1);\n }\n return played;\n}\n\nfunction scheduledTimestamp(s: VideoState, elapsed: number): number | undefined {\n const played = playedAt(s, elapsed);\n if (played === null) return undefined;\n const start = s.trimStart ?? 0;\n const first = s.segments[0];\n return sourceTimeFor(played + (first ? first.from - start : 0), start, s.trimEnd ?? Infinity, s.loop, s.duration);\n}\n\nconst pictures = new WeakMap<object, { readonly key: string; readonly fill: VideoFillResolved }>();\n\n/** The frame to paint, resolved once per change of what it depends on. */\nfunction pictureOf(host: object, s: VideoState, elapsed: number): VideoFillResolved | null {\n if (!s.src) {\n pictures.delete(host);\n return null;\n }\n const scheduled = scheduledTimestamp(s, elapsed);\n const crop = s.crop;\n const anchor = s.anchor as unknown as Vector2;\n const key = [\n s.src, s.fit ?? \"\", s.zoom, s.playing ? 1 : 0, crop.left, crop.right, crop.top, crop.bottom, anchor.x, anchor.y,\n s.timestamp ?? \"\", s.trimStart ?? \"\", s.trimEnd ?? \"\", s.speed ?? \"\", s.loop ?? \"\", s.duration ?? \"\", scheduled ?? \"\",\n ].join(\"|\");\n const kept = pictures.get(host);\n if (kept && kept.key === key) return kept.fill;\n const prop: VideoFillProp = {\n type: \"video\", src: s.src, fit: s.fit, crop: s.crop, zoom: s.zoom, anchor: s.anchor, matrix: s.matrix,\n preset: { adjustments: s.filters }, playing: s.playing, timestamp: s.timestamp ?? scheduled,\n trimStart: s.trimStart, trimEnd: s.trimEnd, speed: s.speed, loop: s.loop, duration: s.duration,\n };\n const fill = resolveFill(prop as FillProp) as VideoFillResolved;\n pictures.set(host, { key, fill });\n return fill;\n}\n\nexport const Video = component2d({\n key: \"video\",\n state: { ...Paint.state, ...Flow.state, ...Corners.state, ...video },\n commands: {\n ...Paint.commands,\n /** Its sound: from `from` in the source for a segment, or as it plays. Cut when the command ends. */\n play: {\n args: {\n from: Types.custom<number | undefined>(undefined),\n volume: Types.custom<number | undefined>(undefined),\n speed: Types.custom<number | undefined>(undefined),\n },\n run: (timeline, state) => {\n const s = state as unknown as VideoState;\n const segment = timeline.args.from !== undefined;\n if (!s.src || s.muted || (!segment && !s.playing)) return timeline.together([]);\n const speed = timeline.args.speed ?? s.speed ?? 1;\n const loop = !segment && (s.loop ?? \"none\") !== \"none\";\n return timeline.sound(s.src, {\n volume: timeline.args.volume ?? s.volume,\n loop,\n trimStart: segment ? timeline.args.from : s.trimStart,\n trimEnd: s.trimEnd,\n speed,\n effects: s.audioEffects,\n bus: s.bus,\n optional: true,\n closed: !loop,\n });\n },\n },\n },\n load: (loader, state) => {\n if (!state.src) return;\n loader.fill(resolveFill({\n type: \"video\", src: state.src, preset: { adjustments: state.filters }, trimStart: state.trimStart, trimEnd: state.trimEnd,\n } as unknown as FillProp));\n },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const s = state as unknown as VideoState & Values<typeof Paint.state> & Values<typeof Corners.state>;\n const picture = pictureOf(internalsOf(ctx).host, s, ctx.time.elapsed);\n const outline = { width: ctx.size.width, height: ctx.size.height, cornerRadius: s.cornerRadius, cornerStyle: s.cornerStyle, start: s.start, end: s.end };\n Paint.draw(ctx, state, Corners.rect(ctx.size, state), {\n fill: [(picture ?? UNSET_MEDIA_FILL), ...state.fill] as never,\n // The overlay lies on the picture only, masked by it.\n overlay: () => (picture\n ? new Graphics2D().mask().rect(outline).fill([picture] as never).applyMask().rect(outline).fill(state.overlay).endMask()\n : null),\n });\n },\n});\n\nexport type Video = NodeOf<typeof Video>;\n\n// What code building a video names its props as, and the segments it plays.\n\nexport interface VideoProps extends RectProps {\n src?: string;\n /** How the (cropped) frame is scaled into the node's bounds. Default 'fill'. */\n fit?: ImageFit;\n /** Window onto the source frame, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` (default) is the fitted size. */\n zoom?: number;\n /** The point held fixed as `zoom` scales; also the alignment when it doesn't cover. */\n anchor?: Alignment;\n /** Raw frame→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n /** Visual filters applied to the rendered frame (blur, color, posterizeTime, echo, …). */\n filters?: VideoAdjustment;\n /** Whether playback advances with the node's clock (drives both picture and sound). Default true. */\n playing?: boolean;\n /** Explicit source time to show, in seconds. Omitted, the picture is timed from the moment this node appeared; set it to drive the playhead, or `null` to hand it back to the clock (`set()` merges a partial, so `undefined` won't clear it). */\n timestamp?: number | null;\n trimStart?: number;\n trimEnd?: number;\n /** Playback-rate multiplier for both picture and audio. Default 1. */\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n /** Length of one loop cycle, in seconds. Defaults to the trimmed clip length. */\n duration?: number;\n /** Audio volume in [0, 1]. Default 1. */\n volume?: number;\n /** Silence the video's audio track without affecting the picture. Default false. */\n muted?: boolean;\n /** Audio effects applied to the video's sound track (gain, eq, echo, …). */\n audioEffects?: AudioEffectsInput;\n /** The node id of an `AudioBus` in this clip to route the video's sound into. A `Video` is a `Node2D` so can't sit under a bus, its audio being welded to its picture; naming one (the same id a `SoundNode` under that bus writes as `parentId`) lets dialogue share a bus, so ducking the group is one edit. An id matching no bus routes to the master. */\n bus?: string;\n /**\n * An explicit **playback schedule**: stretches of this node's own clock during which the clip advances, and where in\n * the source each starts. Omitted, the clip runs from the moment the node appears, at `speed`. Given, `playing` and\n * `timestamp` are superseded: the picture takes its source time from the segment covering the current `elapsed`, and\n * sound is scheduled one clip per segment. It exists because a **pause** can't be expressed otherwise: `playing: false`\n * holds the first frame and the sound runs on the node's clock regardless, so a frozen picture would drift from it. A\n * schedule states that a paused stretch consumes no source, so they can't come apart. Still a pure function of the\n * clock: scrub, playthrough and export agree.\n */\n segments?: readonly VideoSegment[];\n\n}\n\n/** One stretch of a {@link Video}'s own clock during which its source advances (see {@link VideoProps.segments}). Trim and loop apply on top, so a schedule says when the clip runs and the clip's props say which part of the file it runs through. */\nexport interface VideoSegment {\n /** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */\n at: number;\n /** Source in-point for it, in seconds. */\n from: number;\n /** How long it runs, in seconds of the node's clock; `Infinity` for a clip left running (the open sentinel `AudioRequest.endAt` uses), resolved against the clip's length. */\n duration: number;\n /** Playback rate through it. Defaults to the node's own `speed`. */\n speed?: number;\n /** Linear gain for its sound. Defaults to the node's own `volume`. */\n volume?: number;\n}\n"]}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How a chart writes a number down
|
|
2
|
+
* How a chart writes a number down: one formatter driven by a **pattern**, with the named formats being patterns
|
|
3
|
+
* too (`currency` is `$#,##0.00`), so a preset and a free-text pattern can't drift apart.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* too — `currency` is `$#,##0.00` and nothing more. That is the whole design:
|
|
6
|
-
* a dropdown of four presets and a free-text pattern are otherwise two features
|
|
7
|
-
* that drift, one of them gaining a thousands separator or a negative sign the
|
|
8
|
-
* other never hears about. Here the preset *is* the custom case with the
|
|
9
|
-
* pattern filled in, so there is one set of rules to get right.
|
|
10
|
-
*
|
|
11
|
-
* The grammar is the spreadsheet one, because that is where the numbers come
|
|
12
|
-
* from and what an author already knows:
|
|
5
|
+
* The grammar is the spreadsheet one:
|
|
13
6
|
*
|
|
14
7
|
* | Pattern | 1234.5 | 0.07 |
|
|
15
8
|
* | ------------ | --------- | ------ |
|
|
@@ -19,48 +12,22 @@
|
|
|
19
12
|
* | `0.#%` | `123450%` | `7%` |
|
|
20
13
|
* | `#,##0 kg` | `1,235 kg` | `0 kg` |
|
|
21
14
|
*
|
|
22
|
-
* - `0` is a digit
|
|
23
|
-
*
|
|
24
|
-
* -
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* - `%` scales by 100 as well as printing — that is what makes it a percent
|
|
28
|
-
* rather than a suffix, and it is why `0.07` under `0.#%` is `7%`. A column
|
|
29
|
-
* that is *already* in percent points wants `#,##0'%'`: quoted, so the sign
|
|
30
|
-
* is printed and nothing is scaled.
|
|
31
|
-
* - Anything else is literal, before the digits or after them. Quote it to be
|
|
32
|
-
* sure — `'#'#,##0` prints a leading hash.
|
|
15
|
+
* - `0` is a digit always written, `#` one written only when needed (`0.00` pads, `0.##` trims).
|
|
16
|
+
* - A `,` anywhere in the integer run turns grouping on; where it sits doesn't matter.
|
|
17
|
+
* - `%` scales by 100 as well as printing (`0.07` under `0.#%` is `7%`). A column already in percent points wants
|
|
18
|
+
* `#,##0'%'`: quoted, so the sign prints and nothing scales.
|
|
19
|
+
* - Anything else is literal, before or after the digits. Quote it to be sure: `'#'#,##0` prints a leading hash.
|
|
33
20
|
*
|
|
34
|
-
* Deliberately **not** `Intl.NumberFormat
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* silently different image, and the wider string can reflow an axis. What an
|
|
38
|
-
* author wants here is the format they *typed*.
|
|
21
|
+
* Deliberately **not** `Intl.NumberFormat`: its output is locale-dependent, and a chart is a picture with a fixed
|
|
22
|
+
* layout (`1,234.50` on the author's machine and `1.234,50` on the export box is a silently different image that
|
|
23
|
+
* can reflow an axis).
|
|
39
24
|
*/
|
|
40
25
|
/** The named formats the inspector offers, plus the escape hatch. */
|
|
41
26
|
export type NumberFormatName = "plain" | "number" | "currency" | "percent" | "custom";
|
|
42
|
-
/**
|
|
43
|
-
* The pattern behind each named format.
|
|
44
|
-
*
|
|
45
|
-
* `plain` is the historic behaviour — integers bare, everything else to one
|
|
46
|
-
* decimal — kept as the default so no existing chart re-labels itself. The rest
|
|
47
|
-
* are the three formats a chart of money, counts or shares actually needs.
|
|
48
|
-
*/
|
|
27
|
+
/** The pattern behind each named format. `plain` is the historic behaviour (integers bare, else one decimal), the default so no existing chart re-labels itself. */
|
|
49
28
|
export declare const NUMBER_PATTERNS: Record<Exclude<NumberFormatName, "custom">, string>;
|
|
50
|
-
/**
|
|
51
|
-
* `value` written the way `pattern` says.
|
|
52
|
-
*
|
|
53
|
-
* A non-finite value prints empty rather than `NaN`: a tick with no number
|
|
54
|
-
* behind it is a tick that shouldn't caption itself, and `NaN` on an axis reads
|
|
55
|
-
* as a broken chart rather than as missing data.
|
|
56
|
-
*/
|
|
29
|
+
/** `value` written as `pattern` says. A non-finite value prints empty: `NaN` on an axis reads as a broken chart rather than missing data. */
|
|
57
30
|
export declare function formatNumber(value: number, pattern: string): string;
|
|
58
|
-
/**
|
|
59
|
-
* The pattern a `(format, custom)` pair names.
|
|
60
|
-
*
|
|
61
|
-
* A blank custom pattern falls back to the plain one rather than to the empty
|
|
62
|
-
* string, so an axis switched to Custom is readable while it is being typed
|
|
63
|
-
* into rather than a column of nothing.
|
|
64
|
-
*/
|
|
31
|
+
/** The pattern a `(format, custom)` pair names. A blank custom pattern falls back to the plain one, so an axis switched to Custom is readable while being typed into. */
|
|
65
32
|
export declare function patternFor(format: NumberFormatName | undefined, custom: string | undefined): string;
|
|
66
33
|
//# sourceMappingURL=number-format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/text/number-format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/text/number-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;AAErF,oKAAoK;AACpK,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,MAAM,CAM/E,CAAA;AA+ID,6IAA6I;AAC7I,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAoBnE;AAED,yKAAyK;AACzK,wBAAgB,UAAU,CACxB,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,CAMR"}
|