@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +356 -0
- package/NOTICE +49 -0
- package/README.md +29 -10
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +7 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +99 -15
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +4 -4
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/echo.js +2 -2
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/gain.js +2 -2
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/highpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/lowpass.js +2 -2
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/{filters → effects}/implementations/tremolo.js +2 -2
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +52 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +10 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +26 -24
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +51 -30
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +18 -13
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +13 -11
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +8 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +7 -9
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +56 -12
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +59 -19
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +27 -141
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +24 -106
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +2 -3
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +117 -522
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +102 -364
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +98 -28
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +21 -7
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +82 -34
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +57 -34
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +6 -8
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +34 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +157 -112
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +102 -50
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +2 -2
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +9 -1
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +12 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +7 -17
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +3 -19
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +3 -3
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +6 -6
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +12 -13
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js +2 -0
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +2 -0
- package/dist/browser/experimental.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +5 -5
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -19
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -19
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +62 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +38 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.d.ts +5 -5
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/geometry/shape-outline.js +4 -15
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +143 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.d.ts +1 -1
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/text/number-format.js +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.d.ts +10 -12
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/{nodes/node → components/builtins/text}/text-defaults.js +10 -12
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +116 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.d.ts +2 -2
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/{nodes → components/builtins}/three/grid-geometry3d.js +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +543 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +107 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +66 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +347 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +453 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.d.ts +4 -4
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/{nodes/geometry → components/trees/2d}/group-bounds.js +3 -4
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.d.ts +2 -2
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-lifecycle.js +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.d.ts +3 -3
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-motion.js +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-render.js +10 -23
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.d.ts +3 -3
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-space.js +4 -4
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.d.ts +2 -2
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node-transform.js +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.d.ts +206 -185
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/2d/node2d.js +296 -324
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.d.ts +25 -15
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/audio/node-audio.js +30 -35
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.d.ts +9 -10
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-reactive.js +16 -13
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.d.ts +3 -3
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-time.js +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.d.ts +1 -1
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node-walk.js +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/{nodes → components/trees}/node/node.d.ts +46 -82
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/node/node.js +89 -114
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.d.ts +16 -15
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/{nodes/scene → components/trees/root}/canvas2d-node.js +40 -85
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.d.ts +65 -25
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/{nodes → components/trees}/three/node3d.js +78 -76
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/audio.d.ts +10 -2
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +45 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +18 -42
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +23 -5
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +72 -10
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +2 -2
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +10 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +6 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +32 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +71 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +4 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +71 -44
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +94 -35
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +57 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +264 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +145 -20
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +478 -80
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +30 -44
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +20 -8
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +195 -52
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +82 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +34 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +26 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +6 -1
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +29 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +84 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +19 -3
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +20 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -9
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +11 -5
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/render-context2d.d.ts +8 -8
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +21 -23
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +85 -34
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/resources.d.ts +2 -2
- package/dist/render3d/resources.js +2 -2
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +12 -1
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +40 -7
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +11 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +20 -3
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +29 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +3 -2
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +8 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -19
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +13 -6
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +34 -12
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +20 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +132 -27
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +13 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +6 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +45 -4
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +127 -13
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +14 -6
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +10 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +32 -3
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +78 -11
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +16 -10
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +23 -8
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +2 -2
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +6 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +70 -38
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +71 -46
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +21 -8
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +12 -23
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +13 -1
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +17 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +41 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/index.d.ts +3 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +2 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +8 -10
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -249
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
- package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
- package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
- package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -19
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -16
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -115
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -190
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -4
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -40
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -68
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -52
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -46
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -54
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -71
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -118
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -348
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts +0 -47
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js +0 -63
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts +0 -29
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js +0 -43
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -100
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -140
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -73
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -144
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -135
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -504
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -91
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -71
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -270
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -438
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -159
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -254
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -100
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -70
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -122
- package/dist/tween/seekable.js.map +0 -1
- /package/dist/{nodes → components/builtins}/text/number-pattern.d.ts +0 -0
- /package/dist/{nodes → components/builtins}/text/number-pattern.js +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.d.ts +0 -0
- /package/dist/{nodes → components/trees}/node/node-editor-state.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeUniforms } from "../
|
|
1
|
+
import { normalizeUniforms } from "../shaders/uniforms.js";
|
|
2
2
|
import { resolveShaderProperties } from "../shaders/resolve.js";
|
|
3
3
|
/** Strip `undefined` option keys so the produced props stay minimal/comparable. */
|
|
4
4
|
function withOptions(base, options = {}) {
|
|
@@ -104,23 +104,21 @@ export class FillChain {
|
|
|
104
104
|
}, common)]);
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
|
-
* Append a custom
|
|
107
|
+
* Append a custom shader fill — the escape hatch past {@link noise} and
|
|
108
108
|
* {@link fractalNoise}, where the author writes the fragment function.
|
|
109
109
|
*
|
|
110
|
-
* `source`
|
|
110
|
+
* The WGSL `source` defines `fn fill(in: FillIn) -> vec4f` and declares its
|
|
111
|
+
* uniforms as `struct Params`, read as `u.<name>`. It returns
|
|
111
112
|
* **premultiplied** rgba, without folding `opacity` in (the layer's opacity is
|
|
112
|
-
* already
|
|
113
|
-
*
|
|
114
|
-
* order is irrelevant; the renderer supplies `u_size`, `u_origin`,
|
|
115
|
-
* `u_resolution`, `u_aspect`, `u_time` and `u_scale` to whichever of them the
|
|
116
|
-
* source declares.
|
|
113
|
+
* already applied, so applying it twice squares it). Uniforms are keyed by
|
|
114
|
+
* their declared name, so order is irrelevant.
|
|
117
115
|
*
|
|
118
116
|
* Keep `source` constant — it is the compile-cache key, so it snaps at a
|
|
119
117
|
* tween's midpoint and rebuilding it per frame compiles a program per frame.
|
|
120
118
|
* Everything that changes belongs in a uniform, which is an in-place write.
|
|
121
119
|
*
|
|
122
120
|
* @example
|
|
123
|
-
* Fills.shader(GLOW, { uniforms: {
|
|
121
|
+
* Fills.shader(GLOW, { uniforms: { amount: 0.6 } })
|
|
124
122
|
*/
|
|
125
123
|
shader(source, options) {
|
|
126
124
|
const pack = typeof source === 'string' ? undefined : source;
|
|
@@ -129,7 +127,7 @@ export class FillChain {
|
|
|
129
127
|
`("${pack.name}"). An effect shader samples a backdrop a fill does not have; ` +
|
|
130
128
|
`use Effects.shader.`);
|
|
131
129
|
}
|
|
132
|
-
const { uniforms,
|
|
130
|
+
const { uniforms, textures, values, ...common } = options ?? {};
|
|
133
131
|
// A pack resolves to plain uniforms here; anything passed as `uniforms`
|
|
134
132
|
// still wins, matching how an author value overrides a built-in.
|
|
135
133
|
const resolved = pack
|
|
@@ -138,8 +136,8 @@ export class FillChain {
|
|
|
138
136
|
return new FillChain([...this.list, withOptions({
|
|
139
137
|
type: 'shader',
|
|
140
138
|
source: typeof source === 'string' ? source : source.source,
|
|
139
|
+
language: 'wgsl',
|
|
141
140
|
uniforms: resolved,
|
|
142
|
-
coords: coords ?? pack?.coords,
|
|
143
141
|
textures,
|
|
144
142
|
...(pack?.id !== undefined ? { shaderId: pack.id } : {}),
|
|
145
143
|
}, common)]);
|
|
@@ -1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tB,oEAAoE;QACpE,wEAAwE;QACxE,yEAAyE;QACzE,qBAAqB;QACrB,MAAM,GAAG,GAAe,EAAE,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,IAAI,IAAI,YAAY,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;iBACjD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAY,CAAC,CAAC,CAAC;;gBACrE,GAAG,CAAC,IAAI,CAAC,IAAgB,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IACD,OAAO,CAAC,IAAgB,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { Color } from \"./color/parser\";\nimport type { BlendMode } from \"./blend\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { ImageAdjustment, VideoAdjustment } from \"../filters/chain\";\nimport type { MediaPresetProp, VideoPresetProp } from \"./media-preset\";\nimport type { FillProp, FillResolved, FillSpace } from \"./union\";\nimport { normalizeUniforms } from \"../sksl-uniforms\";\nimport { resolveShaderProperties, type ShaderPropertyValues } from \"../shaders/resolve\";\nimport type { FillShader } from \"../shaders/pack\";\nimport type { ImageCrop, ImageFit, ImageMatrix } from \"./implementations/image\";\nimport type { Alignment } from \"@/attributes/layout/alignment\";\nimport type { FractalNoiseFillProp } from \"./implementations/fractal-noise\";\nimport type { DotGridFillProp } from \"./implementations/dot-grid\";\nimport type { GridFillProp } from \"./implementations/grid\";\nimport type { ShaderFillProp } from \"./implementations/shader\";\nimport type { Scene3D } from \"@/render3d/scene3d\";\n\n/** Placement options shared by the image and video fill builders. */\nexport interface MediaPlacementOptions {\n /** How the (cropped) source is scaled into the node's bounds. Default `'fill'`. */\n fit?: ImageFit;\n /** Window onto the source, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` 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 source→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n}\n\n/** Author-facing options for a {@link FillChain.video} layer. */\nexport interface VideoFillOptions extends FillOptions, MediaPlacementOptions {\n /** The grade laid over the footage — an adjustment chain plus a 0–1 mix. */\n preset?: VideoPresetProp;\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\n filters?: VideoAdjustment;\n /**\n * Explicit source time to paint, in seconds. Omit it and the clip plays by\n * itself, timed from the moment the node painting it appeared — set it only\n * to drive the playhead yourself (`null` hands the playhead back).\n */\n timestamp?: number | null;\n /** Whether playback advances with the node's clock. Defaults to `true`. */\n playing?: boolean;\n trimStart?: number;\n trimEnd?: number;\n /** Seconds after the painting node appears before playback begins. Default `0`. */\n playStart?: number;\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n duration?: number;\n}\n\n/**\n * Cross-cutting options shared by every fill layer. These map onto the\n * `opacity` / `blend` fields each fill prop already accepts, plus the\n * `space` directive carried generically by the registry.\n */\nexport interface FillOptions {\n opacity?: number;\n blend?: BlendMode;\n space?: FillSpace;\n}\n\n/** Strip `undefined` option keys so the produced props stay minimal/comparable. */\nfunction withOptions<T extends object>(base: T, options: FillOptions = {}): T & FillOptions {\n const out = { ...base } as T & FillOptions;\n if (options.opacity !== undefined) out.opacity = options.opacity;\n if (options.blend !== undefined) out.blend = options.blend;\n if (options.space !== undefined) out.space = options.space;\n return out;\n}\n\n/**\n * Immutable, chainable list of fill layers.\n *\n * Each builder method returns a new `FillChain` with the layer appended, so\n * chains are safe to share and branch — mirroring {@link EffectChain}.\n *\n * @example\n * const bg = Fills.image('./background.jpg', { blend: 'overlay', opacity: 0.2 })\n * .color('red', { opacity: 0.3 });\n * node.fill = bg; // assign directly\n * node.fill = [...bg, 'white']; // spread into an array\n */\nexport class FillChain {\n constructor(public list: FillProp[] = []) { }\n\n /** Append a solid color fill. A CSS string or normalized `[r,g,b,a]`. */\n color(color: Color, options?: FillOptions) {\n return new FillChain([...this.list, withOptions({ type: 'solid' as const, color }, options)]);\n }\n\n /**\n * Append an image fill from `src`.\n *\n * @example\n * Fills.image('./city.jpg', { zoom: 1.4, anchor: 'topCenter', crop: { bottom: 0.2 } })\n */\n image(\n src: string,\n options?: FillOptions & MediaPlacementOptions & {\n /** The grade laid over the picture — an adjustment chain plus a 0–1 mix. */\n preset?: MediaPresetProp;\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\n filters?: ImageAdjustment;\n },\n ) {\n const { fit, crop, zoom, anchor, matrix, preset, filters, ...common } = options ?? {};\n // Both are forwarded unresolved: `imageFill.resolve` is the one place\n // that flattens a chain and folds the deprecated prop into the preset,\n // so a fill built here and a fill written as a literal cannot disagree\n // about what a grade means.\n return new FillChain([...this.list, withOptions({\n type: 'image' as const,\n src,\n fit, crop, zoom, anchor, matrix,\n preset, filters,\n }, common)]);\n }\n\n /**\n * Append a video fill from `src`. Plays by default: its source timestamp is\n * derived as it paints, from how long the node carrying the fill has\n * existed — so the clip runs wherever the fill is used (fill, overlay,\n * stroke, shadow, a custom node's `Graphics2D`) with nothing to advance.\n */\n video(src: string, options?: VideoFillOptions) {\n const { fit, crop, zoom, anchor, matrix, preset, filters, timestamp, playing, trimStart, trimEnd, playStart, speed, loop, duration, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({\n type: 'video' as const,\n src,\n fit, crop, zoom, anchor, matrix, preset, filters,\n timestamp,\n playing: playing ?? true,\n trimStart, trimEnd, playStart, speed, loop, duration,\n }, common)]);\n }\n\n\n /** Append a linear gradient between `colors`. */\n linearGradient(colors: Color[], options?: FillOptions & { stops?: number[]; start?: Vector2; end?: Vector2 }) {\n const { stops, start, end, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'linear-gradient' as const, colors, stops, start, end }, common)]);\n }\n\n /** Append a radial gradient between `colors`. */\n radialGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; radius?: number }) {\n const { stops, center, radius, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'radial-gradient' as const, colors, stops, center, radius }, common)]);\n }\n\n /** Append a conic gradient between `colors`. */\n conicGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; startAngle?: number }) {\n const { stops, center, startAngle, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'conic-gradient' as const, colors, stops, center, startAngle }, common)]);\n }\n\n /** Append a noise (speckle) fill. Tween `seed` to make the static crawl. */\n noise(options?: FillOptions & { size?: Vector2; density?: number; color?: Color; seed?: number }) {\n const { size, density, color, seed, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'noise' as const, size, density, color, seed }, common)]);\n }\n\n /**\n * Append a fractal (fBm) noise fill — a continuous field rather than the\n * speckle {@link noise} paints. Cloud, marble, smoke, terrain, plasma.\n *\n * Tween `offset` to travel through the field (it flows); tween `seed` to\n * shift to a different field entirely (it churns).\n */\n fractalNoise(options?: FillOptions & Omit<FractalNoiseFillProp, 'type' | 'opacity' | 'blend'>) {\n const {\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\n colors, stops, contrast, ...common\n } = options ?? {};\n return new FillChain([...this.list, withOptions(\n {\n type: 'fractalNoise' as const,\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\n colors, stops, contrast,\n },\n common,\n )]);\n }\n\n /**\n * Append a custom SkSL shader fill — the escape hatch past {@link noise} and\n * {@link fractalNoise}, where the author writes the fragment function.\n *\n * `source` must declare `vec4 main(vec2 fragCoord)` and return\n * **premultiplied** rgba, without folding `opacity` in (the layer's opacity is\n * already on the paint, so applying it twice squares it). Uniforms are keyed\n * by their declared name and bound by reflecting the compiled program, so\n * order is irrelevant; the renderer supplies `u_size`, `u_origin`,\n * `u_resolution`, `u_aspect`, `u_time` and `u_scale` to whichever of them the\n * source declares.\n *\n * Keep `source` constant — it is the compile-cache key, so it snaps at a\n * tween's midpoint and rebuilding it per frame compiles a program per frame.\n * Everything that changes belongs in a uniform, which is an in-place write.\n *\n * @example\n * Fills.shader(GLOW, { uniforms: { u_amount: 0.6 }, coords: 'centered' })\n */\n shader(\n source: string | FillShader,\n options?: FillOptions\n & Omit<ShaderFillProp, 'type' | 'source' | 'opacity' | 'blend' | 'shaderId'>\n & { values?: ShaderPropertyValues },\n ) {\n const pack = typeof source === 'string' ? undefined : source;\n if (pack && pack.scope !== 'fill') {\n throw new Error(\n `Fills.shader was given a \"${(pack as { scope: string }).scope}\" shader ` +\n `(\"${pack.name}\"). An effect shader samples a backdrop a fill does not have; ` +\n `use Effects.shader.`,\n );\n }\n const { uniforms, coords, textures, values, ...common } = options ?? {};\n // A pack resolves to plain uniforms here; anything passed as `uniforms`\n // still wins, matching how an author value overrides a built-in.\n const resolved = pack\n ? { ...resolveShaderProperties(pack, values), ...normalizeUniforms(uniforms ?? {}) }\n : uniforms;\n return new FillChain([...this.list, withOptions(\n {\n type: 'shader' as const,\n source: typeof source === 'string' ? source : source.source,\n uniforms: resolved,\n coords: coords ?? pack?.coords,\n textures,\n ...(pack?.id !== undefined ? { shaderId: pack.id } : {}),\n },\n common,\n )]);\n }\n\n /** Append a stripe (hatch) fill. */\n stripe(options?: FillOptions & { gap?: number; strokeWidth?: number; angle?: number; color?: Color }) {\n const { gap, strokeWidth, angle, color, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'stripe' as const, gap, strokeWidth, angle, color }, common)]);\n }\n\n /**\n * Append a dot-grid fill — a lattice of dots at a pixel pitch.\n *\n * Tween `offset` to drift the field under a shape that isn't moving; tween\n * `spacing` or `radius` to breathe it.\n *\n * @example\n * Fills.dotGrid({ radius: 1.5, spacing: 24, color: 'muted' })\n */\n dotGrid(options?: FillOptions & Omit<DotGridFillProp, 'type' | 'opacity' | 'blend'>) {\n const { radius, spacing, offset, color, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions(\n { type: 'dotGrid' as const, radius, spacing, offset, color },\n common,\n )]);\n }\n\n /**\n * Append a grid fill — ruled lines dividing the shape into cells, with an\n * optional finer ruling nested inside each one.\n *\n * Sized in divisions of the shape rather than in px (unlike {@link dotGrid}),\n * so it holds its structure as the shape resizes.\n *\n * @example\n * Fills.grid({ divisions: 8, subdivisions: 4, color: 'border' })\n */\n grid(options?: FillOptions & Omit<GridFillProp, 'type' | 'opacity' | 'blend'>) {\n const {\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color, ...common\n } = options ?? {};\n return new FillChain([...this.list, withOptions(\n {\n type: 'grid' as const,\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color,\n },\n common,\n )]);\n }\n\n /**\n * Append a 3D scene, painted through the shape's own path.\n *\n * Takes a **built** {@link Scene3D}, never a builder — per-frame freshness\n * comes from where the value is produced (a `renderSelf`, or a `() => …`\n * reactive binding), like every other fill.\n *\n * Note two same-type 3D layers hard-cut rather than cross-fading, because a\n * command list has no meaningful in-between. To dissolve between two scenes,\n * stack them and tween their opacities in opposite directions.\n */\n canvas3D(scene: Scene3D, options?: FillOptions & { maxPixelRatio?: number; antialias?: boolean }) {\n const { maxPixelRatio, antialias, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'canvas3D' as const, scene, maxPixelRatio, antialias }, common)]);\n }\n\n /** Allows spreading the chain into an array: `[...Fills.color('red')]`. */\n *[Symbol.iterator]() {\n yield* this.list;\n }\n\n /** Serializes to the raw fill array so frameworks that call `toJSON` get a plain value. */\n toJSON() {\n return this.list;\n }\n}\n\n/**\n * Accepted shapes for a node's `fill` prop.\n *\n * Can be a single fill, a `FillChain` builder result, an already-resolved\n * {@link FillResolved}, or an array mixing any of these (each chain contributes\n * all its layers in place):\n *\n * 'red' // plain CSS color\n * Fills.image('bg.jpg') // chain\n * ['#e8c584', Fills.image('bg.jpg')]\n * ['#e8c584', ...Fills.image('bg.jpg')]\n * resolvedFills // FillResolved[] passes through\n */\nexport type Fill =\n | FillProp\n | FillResolved\n | FillChain\n | (FillProp | FillResolved | FillChain)[];\n\n/**\n * Entry point for building fill chains fluently.\n *\n * An empty {@link FillChain}, so `Fills.image(src)` *is* `new FillChain().image(src)`\n * — every builder's signature and documentation has one definition, on the\n * class, which is what an editor shows when you hover `Fills.image`. The chain\n * is immutable (each builder returns a new one), so sharing one empty instance\n * as the entry point is safe.\n *\n * @example\n * node.fill = Fills.image('./bg.jpg', { opacity: 0.2 }).color('red', { opacity: 0.3 });\n */\nexport const Fills = new FillChain();\n\n/**\n * Normalises any {@link Fill} value to a plain `FillProp[]`.\n * Used by `resolveFillArray` before resolving to the renderer shape.\n *\n * Already-resolved fills (`FillResolved`) structurally satisfy `FillProp`, so\n * they pass straight through and `resolveFill` re-normalises them idempotently.\n */\nexport function resolveChainFill(fill: Fill | undefined): FillProp[] {\n if (fill == null) return [];\n if (fill instanceof FillChain) return fill.list;\n if (Array.isArray(fill)) {\n // Flatten any chains used as array elements so each contributes its\n // layers in place: `['#e8c584', Fills.image('bg.jpg')]` — and the plain\n // array a chain serializes to, which is how that value reads back out of\n // a stored document.\n const out: FillProp[] = [];\n for (const item of fill) {\n if (item instanceof FillChain) out.push(...item.list);\n else if (Array.isArray(item)) out.push(...resolveChainFill(item as Fill));\n else out.push(item as FillProp);\n }\n return out;\n }\n return [fill as FillProp];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/chain.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAA6B,MAAM,oBAAoB,CAAC;AA0DxF,mFAAmF;AACnF,SAAS,WAAW,CAAmB,IAAO,EAAE,UAAuB,EAAE;IACrE,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,EAAqB,CAAC;IAC3C,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,G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ACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IACD,OAAO,CAAC,IAAgB,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { Color } from \"./color/parser\";\nimport type { BlendMode } from \"./blend\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { ImageAdjustment, VideoAdjustment } from \"../filters/chain\";\nimport type { MediaPresetProp, VideoPresetProp } from \"./media-preset\";\nimport type { FillProp, FillResolved, FillSpace } from \"./union\";\nimport { normalizeUniforms } from \"../shaders/uniforms\";\nimport { resolveShaderProperties, type ShaderPropertyValues } from \"../shaders/resolve\";\nimport type { FillShader } from \"../shaders/pack\";\nimport type { ImageCrop, ImageFit, ImageMatrix } from \"./implementations/image\";\nimport type { Alignment } from \"@/attributes/layout/alignment\";\nimport type { FractalNoiseFillProp } from \"./implementations/fractal-noise\";\nimport type { DotGridFillProp } from \"./implementations/dot-grid\";\nimport type { GridFillProp } from \"./implementations/grid\";\nimport type { ShaderFillProp } from \"./implementations/shader\";\nimport type { Scene3D } from \"@/render3d/scene3d\";\n\n/** Placement options shared by the image and video fill builders. */\nexport interface MediaPlacementOptions {\n /** How the (cropped) source is scaled into the node's bounds. Default `'fill'`. */\n fit?: ImageFit;\n /** Window onto the source, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` 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 source→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n}\n\n/** Author-facing options for a {@link FillChain.video} layer. */\nexport interface VideoFillOptions extends FillOptions, MediaPlacementOptions {\n /** The grade laid over the footage — an adjustment chain plus a 0–1 mix. */\n preset?: VideoPresetProp;\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\n filters?: VideoAdjustment;\n /**\n * Explicit source time to paint, in seconds. Omit it and the clip plays by\n * itself, timed from the moment the node painting it appeared — set it only\n * to drive the playhead yourself (`null` hands the playhead back).\n */\n timestamp?: number | null;\n /** Whether playback advances with the node's clock. Defaults to `true`. */\n playing?: boolean;\n trimStart?: number;\n trimEnd?: number;\n /** Seconds after the painting node appears before playback begins. Default `0`. */\n playStart?: number;\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n duration?: number;\n}\n\n/**\n * Cross-cutting options shared by every fill layer. These map onto the\n * `opacity` / `blend` fields each fill prop already accepts, plus the\n * `space` directive carried generically by the registry.\n */\nexport interface FillOptions {\n opacity?: number;\n blend?: BlendMode;\n space?: FillSpace;\n}\n\n/** Strip `undefined` option keys so the produced props stay minimal/comparable. */\nfunction withOptions<T extends object>(base: T, options: FillOptions = {}): T & FillOptions {\n const out = { ...base } as T & FillOptions;\n if (options.opacity !== undefined) out.opacity = options.opacity;\n if (options.blend !== undefined) out.blend = options.blend;\n if (options.space !== undefined) out.space = options.space;\n return out;\n}\n\n/**\n * Immutable, chainable list of fill layers.\n *\n * Each builder method returns a new `FillChain` with the layer appended, so\n * chains are safe to share and branch — mirroring {@link EffectChain}.\n *\n * @example\n * const bg = Fills.image('./background.jpg', { blend: 'overlay', opacity: 0.2 })\n * .color('red', { opacity: 0.3 });\n * node.fill = bg; // assign directly\n * node.fill = [...bg, 'white']; // spread into an array\n */\nexport class FillChain {\n constructor(public list: FillProp[] = []) { }\n\n /** Append a solid color fill. A CSS string or normalized `[r,g,b,a]`. */\n color(color: Color, options?: FillOptions) {\n return new FillChain([...this.list, withOptions({ type: 'solid' as const, color }, options)]);\n }\n\n /**\n * Append an image fill from `src`.\n *\n * @example\n * Fills.image('./city.jpg', { zoom: 1.4, anchor: 'topCenter', crop: { bottom: 0.2 } })\n */\n image(\n src: string,\n options?: FillOptions & MediaPlacementOptions & {\n /** The grade laid over the picture — an adjustment chain plus a 0–1 mix. */\n preset?: MediaPresetProp;\n /** @deprecated Moved to `preset.adjustments`. Removed in the next major. */\n filters?: ImageAdjustment;\n },\n ) {\n const { fit, crop, zoom, anchor, matrix, preset, filters, ...common } = options ?? {};\n // Both are forwarded unresolved: `imageFill.resolve` is the one place\n // that flattens a chain and folds the deprecated prop into the preset,\n // so a fill built here and a fill written as a literal cannot disagree\n // about what a grade means.\n return new FillChain([...this.list, withOptions({\n type: 'image' as const,\n src,\n fit, crop, zoom, anchor, matrix,\n preset, filters,\n }, common)]);\n }\n\n /**\n * Append a video fill from `src`. Plays by default: its source timestamp is\n * derived as it paints, from how long the node carrying the fill has\n * existed — so the clip runs wherever the fill is used (fill, overlay,\n * stroke, shadow, a custom node's `Graphics2D`) with nothing to advance.\n */\n video(src: string, options?: VideoFillOptions) {\n const { fit, crop, zoom, anchor, matrix, preset, filters, timestamp, playing, trimStart, trimEnd, playStart, speed, loop, duration, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({\n type: 'video' as const,\n src,\n fit, crop, zoom, anchor, matrix, preset, filters,\n timestamp,\n playing: playing ?? true,\n trimStart, trimEnd, playStart, speed, loop, duration,\n }, common)]);\n }\n\n\n /** Append a linear gradient between `colors`. */\n linearGradient(colors: Color[], options?: FillOptions & { stops?: number[]; start?: Vector2; end?: Vector2 }) {\n const { stops, start, end, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'linear-gradient' as const, colors, stops, start, end }, common)]);\n }\n\n /** Append a radial gradient between `colors`. */\n radialGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; radius?: number }) {\n const { stops, center, radius, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'radial-gradient' as const, colors, stops, center, radius }, common)]);\n }\n\n /** Append a conic gradient between `colors`. */\n conicGradient(colors: Color[], options?: FillOptions & { stops?: number[]; center?: Vector2; startAngle?: number }) {\n const { stops, center, startAngle, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'conic-gradient' as const, colors, stops, center, startAngle }, common)]);\n }\n\n /** Append a noise (speckle) fill. Tween `seed` to make the static crawl. */\n noise(options?: FillOptions & { size?: Vector2; density?: number; color?: Color; seed?: number }) {\n const { size, density, color, seed, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'noise' as const, size, density, color, seed }, common)]);\n }\n\n /**\n * Append a fractal (fBm) noise fill — a continuous field rather than the\n * speckle {@link noise} paints. Cloud, marble, smoke, terrain, plasma.\n *\n * Tween `offset` to travel through the field (it flows); tween `seed` to\n * shift to a different field entirely (it churns).\n */\n fractalNoise(options?: FillOptions & Omit<FractalNoiseFillProp, 'type' | 'opacity' | 'blend'>) {\n const {\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\n colors, stops, contrast, ...common\n } = options ?? {};\n return new FillChain([...this.list, withOptions(\n {\n type: 'fractalNoise' as const,\n basis, octaves, frequency, lacunarity, gain, seed, offset, angle,\n colors, stops, contrast,\n },\n common,\n )]);\n }\n\n /**\n * Append a custom shader fill — the escape hatch past {@link noise} and\n * {@link fractalNoise}, where the author writes the fragment function.\n *\n * The WGSL `source` defines `fn fill(in: FillIn) -> vec4f` and declares its\n * uniforms as `struct Params`, read as `u.<name>`. It returns\n * **premultiplied** rgba, without folding `opacity` in (the layer's opacity is\n * already applied, so applying it twice squares it). Uniforms are keyed by\n * their declared name, so order is irrelevant.\n *\n * Keep `source` constant — it is the compile-cache key, so it snaps at a\n * tween's midpoint and rebuilding it per frame compiles a program per frame.\n * Everything that changes belongs in a uniform, which is an in-place write.\n *\n * @example\n * Fills.shader(GLOW, { uniforms: { amount: 0.6 } })\n */\n shader(\n source: string | FillShader,\n options?: FillOptions\n & Omit<ShaderFillProp, 'type' | 'source' | 'language' | 'opacity' | 'blend' | 'shaderId'>\n & { values?: ShaderPropertyValues },\n ) {\n const pack = typeof source === 'string' ? undefined : source;\n if (pack && pack.scope !== 'fill') {\n throw new Error(\n `Fills.shader was given a \"${(pack as { scope: string }).scope}\" shader ` +\n `(\"${pack.name}\"). An effect shader samples a backdrop a fill does not have; ` +\n `use Effects.shader.`,\n );\n }\n const { uniforms, textures, values, ...common } = options ?? {};\n // A pack resolves to plain uniforms here; anything passed as `uniforms`\n // still wins, matching how an author value overrides a built-in.\n const resolved = pack\n ? { ...resolveShaderProperties(pack, values), ...normalizeUniforms(uniforms ?? {}) }\n : uniforms;\n return new FillChain([...this.list, withOptions(\n {\n type: 'shader' as const,\n source: typeof source === 'string' ? source : source.source,\n language: 'wgsl' as const,\n uniforms: resolved,\n textures,\n ...(pack?.id !== undefined ? { shaderId: pack.id } : {}),\n },\n common,\n )]);\n }\n\n /** Append a stripe (hatch) fill. */\n stripe(options?: FillOptions & { gap?: number; strokeWidth?: number; angle?: number; color?: Color }) {\n const { gap, strokeWidth, angle, color, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'stripe' as const, gap, strokeWidth, angle, color }, common)]);\n }\n\n /**\n * Append a dot-grid fill — a lattice of dots at a pixel pitch.\n *\n * Tween `offset` to drift the field under a shape that isn't moving; tween\n * `spacing` or `radius` to breathe it.\n *\n * @example\n * Fills.dotGrid({ radius: 1.5, spacing: 24, color: 'muted' })\n */\n dotGrid(options?: FillOptions & Omit<DotGridFillProp, 'type' | 'opacity' | 'blend'>) {\n const { radius, spacing, offset, color, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions(\n { type: 'dotGrid' as const, radius, spacing, offset, color },\n common,\n )]);\n }\n\n /**\n * Append a grid fill — ruled lines dividing the shape into cells, with an\n * optional finer ruling nested inside each one.\n *\n * Sized in divisions of the shape rather than in px (unlike {@link dotGrid}),\n * so it holds its structure as the shape resizes.\n *\n * @example\n * Fills.grid({ divisions: 8, subdivisions: 4, color: 'border' })\n */\n grid(options?: FillOptions & Omit<GridFillProp, 'type' | 'opacity' | 'blend'>) {\n const {\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color, ...common\n } = options ?? {};\n return new FillChain([...this.list, withOptions(\n {\n type: 'grid' as const,\n divisions, subdivisions, offset, strokeWidth, subdivisionWidth, color,\n },\n common,\n )]);\n }\n\n /**\n * Append a 3D scene, painted through the shape's own path.\n *\n * Takes a **built** {@link Scene3D}, never a builder — per-frame freshness\n * comes from where the value is produced (a `renderSelf`, or a `() => …`\n * reactive binding), like every other fill.\n *\n * Note two same-type 3D layers hard-cut rather than cross-fading, because a\n * command list has no meaningful in-between. To dissolve between two scenes,\n * stack them and tween their opacities in opposite directions.\n */\n canvas3D(scene: Scene3D, options?: FillOptions & { maxPixelRatio?: number; antialias?: boolean }) {\n const { maxPixelRatio, antialias, ...common } = options ?? {};\n return new FillChain([...this.list, withOptions({ type: 'canvas3D' as const, scene, maxPixelRatio, antialias }, common)]);\n }\n\n /** Allows spreading the chain into an array: `[...Fills.color('red')]`. */\n *[Symbol.iterator]() {\n yield* this.list;\n }\n\n /** Serializes to the raw fill array so frameworks that call `toJSON` get a plain value. */\n toJSON() {\n return this.list;\n }\n}\n\n/**\n * Accepted shapes for a node's `fill` prop.\n *\n * Can be a single fill, a `FillChain` builder result, an already-resolved\n * {@link FillResolved}, or an array mixing any of these (each chain contributes\n * all its layers in place):\n *\n * 'red' // plain CSS color\n * Fills.image('bg.jpg') // chain\n * ['#e8c584', Fills.image('bg.jpg')]\n * ['#e8c584', ...Fills.image('bg.jpg')]\n * resolvedFills // FillResolved[] passes through\n */\nexport type Fill =\n | FillProp\n | FillResolved\n | FillChain\n | (FillProp | FillResolved | FillChain)[];\n\n/**\n * Entry point for building fill chains fluently.\n *\n * An empty {@link FillChain}, so `Fills.image(src)` *is* `new FillChain().image(src)`\n * — every builder's signature and documentation has one definition, on the\n * class, which is what an editor shows when you hover `Fills.image`. The chain\n * is immutable (each builder returns a new one), so sharing one empty instance\n * as the entry point is safe.\n *\n * @example\n * node.fill = Fills.image('./bg.jpg', { opacity: 0.2 }).color('red', { opacity: 0.3 });\n */\nexport const Fills = new FillChain();\n\n/**\n * Normalises any {@link Fill} value to a plain `FillProp[]`.\n * Used by `resolveFillArray` before resolving to the renderer shape.\n *\n * Already-resolved fills (`FillResolved`) structurally satisfy `FillProp`, so\n * they pass straight through and `resolveFill` re-normalises them idempotently.\n */\nexport function resolveChainFill(fill: Fill | undefined): FillProp[] {\n if (fill == null) return [];\n if (fill instanceof FillChain) return fill.list;\n if (Array.isArray(fill)) {\n // Flatten any chains used as array elements so each contributes its\n // layers in place: `['#e8c584', Fills.image('bg.jpg')]` — and the plain\n // array a chain serializes to, which is how that value reads back out of\n // a stored document.\n const out: FillProp[] = [];\n for (const item of fill) {\n if (item instanceof FillChain) out.push(...item.list);\n else if (Array.isArray(item)) out.push(...resolveChainFill(item as Fill));\n else out.push(item as FillProp);\n }\n return out;\n }\n return [fill as FillProp];\n}\n"]}
|
|
@@ -48,7 +48,7 @@ interface ThemeInput {
|
|
|
48
48
|
* header: { fontSize: 96, fontWeight: 700 },
|
|
49
49
|
* },
|
|
50
50
|
* });
|
|
51
|
-
* // Later: fill
|
|
51
|
+
* // Later: fill: "brand", fill: "accent-500", Text({ variant: "header" })
|
|
52
52
|
*/
|
|
53
53
|
export declare function setTheme(input?: ThemeInput | null): void;
|
|
54
54
|
/** Looks up a registered typography preset by variant name (case-insensitive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/D,0FAA0F;AAC1F,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/D,0FAA0F;AAC1F,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC;AAwG7C,KAAK,eAAe,GAAG,KAAK,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAC;AAClE,UAAU,UAAU;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,GAAE,UAAU,GAAG,IAAS,GAAG,IAAI,CAa5D;AAED;yCACyC;AACzC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAErF;AAqJD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAsB1D"}
|
|
@@ -35,20 +35,52 @@ function xyzD65ToLinearSrgb(X, Y, Z) {
|
|
|
35
35
|
}
|
|
36
36
|
// ── Argument parser ───────────────────────────────────────────────────────────
|
|
37
37
|
/**
|
|
38
|
-
* Splits the inner content of a CSS color function into
|
|
39
|
-
* an alpha value. Handles the slash-alpha syntax used by modern
|
|
40
|
-
* `hsl()` as well as the legacy comma-alpha form used by `rgba()` /
|
|
38
|
+
* Splits the inner content of a CSS color function into exactly three channel
|
|
39
|
+
* tokens and an alpha value. Handles the slash-alpha syntax used by modern
|
|
40
|
+
* `rgb()` / `hsl()` as well as the legacy comma-alpha form used by `rgba()` /
|
|
41
|
+
* `hsla()`; both go through {@link readAlpha}, so a percentage alpha means the
|
|
42
|
+
* same in either. Returns `null` for the wrong number of arguments or an alpha
|
|
43
|
+
* that is not a number, which {@link parseColor} reports as an unsupported
|
|
44
|
+
* format.
|
|
41
45
|
*/
|
|
42
46
|
function parseArgs(inner) {
|
|
43
47
|
const slashIdx = inner.lastIndexOf('/');
|
|
44
|
-
let
|
|
48
|
+
let alphaToken;
|
|
45
49
|
let colorPart = inner;
|
|
46
50
|
if (slashIdx !== -1) {
|
|
47
|
-
|
|
48
|
-
alpha = alphaStr.endsWith('%') ? parseFloat(alphaStr) / 100 : parseFloat(alphaStr);
|
|
51
|
+
alphaToken = inner.slice(slashIdx + 1).trim();
|
|
49
52
|
colorPart = inner.slice(0, slashIdx);
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
const tokens = colorPart.trim().split(/[\s,]+/).filter(Boolean);
|
|
55
|
+
if (tokens.length === 4 && alphaToken === undefined)
|
|
56
|
+
alphaToken = tokens.pop();
|
|
57
|
+
if (tokens.length !== 3)
|
|
58
|
+
return null;
|
|
59
|
+
const alpha = alphaToken === undefined ? 1 : readAlpha(alphaToken);
|
|
60
|
+
if (!Number.isFinite(alpha))
|
|
61
|
+
return null;
|
|
62
|
+
return { tokens, alpha };
|
|
63
|
+
}
|
|
64
|
+
/** Reads an alpha token: a number, or a percentage (`50%` is 0.5). `NaN` if neither. */
|
|
65
|
+
function readAlpha(token) {
|
|
66
|
+
return token.endsWith('%') ? Number(token.slice(0, -1)) / 100 : Number(token);
|
|
67
|
+
}
|
|
68
|
+
/** Reads a channel token as a number, scaling a percentage to `percentScale` and a bare number by `1 / numberScale`. `NaN` if it is not a number. */
|
|
69
|
+
function readChannel(token, percentScale, numberScale = 1) {
|
|
70
|
+
return token.endsWith('%') ? (Number(token.slice(0, -1)) / 100) * percentScale : Number(token) / numberScale;
|
|
71
|
+
}
|
|
72
|
+
/** Degrees per CSS angle unit (`deg`, `grad`, `rad`, `turn`). */
|
|
73
|
+
const ANGLE_UNIT_DEGREES = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };
|
|
74
|
+
/** Reads a CSS hue/angle token to degrees. A bare number is degrees; an unknown unit or a non-number is `NaN`. */
|
|
75
|
+
function readHue(token) {
|
|
76
|
+
const m = token.match(/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|grad|rad|turn)?$/);
|
|
77
|
+
if (!m)
|
|
78
|
+
return NaN;
|
|
79
|
+
return Number(m[1]) * ANGLE_UNIT_DEGREES[m[2] ?? 'deg'];
|
|
80
|
+
}
|
|
81
|
+
/** Returns `color` when every component is finite, otherwise `null` (unsupported format). */
|
|
82
|
+
function finiteColor(color) {
|
|
83
|
+
return color.every(Number.isFinite) ? color : null;
|
|
52
84
|
}
|
|
53
85
|
// ── Per-format parsers ────────────────────────────────────────────────────────
|
|
54
86
|
// Use a globalThis key so multiple bundled copies of this module (e.g. the
|
|
@@ -57,6 +89,11 @@ const _g = globalThis;
|
|
|
57
89
|
if (!_g.__msThemeMap)
|
|
58
90
|
_g.__msThemeMap = new Map();
|
|
59
91
|
const THEME_COLOR_MAP = _g.__msThemeMap;
|
|
92
|
+
// Colours already parsed, by the string as given: a scene repeats its strings every
|
|
93
|
+
// frame. Shared like the theme, and cleared with it, since a name resolves through it.
|
|
94
|
+
if (!_g.__msParsedColors)
|
|
95
|
+
_g.__msParsedColors = new Map();
|
|
96
|
+
const PARSED = _g.__msParsedColors;
|
|
60
97
|
// Typography presets ride the same shared-global pattern as the color map, so
|
|
61
98
|
// the prebuilt player bundle and the user's Vite-compiled code read one registry
|
|
62
99
|
// — `setTheme` (called once per build at the player/headless entry points)
|
|
@@ -107,10 +144,11 @@ function flattenColors(tokens, prefix, out) {
|
|
|
107
144
|
* header: { fontSize: 96, fontWeight: 700 },
|
|
108
145
|
* },
|
|
109
146
|
* });
|
|
110
|
-
* // Later: fill
|
|
147
|
+
* // Later: fill: "brand", fill: "accent-500", Text({ variant: "header" })
|
|
111
148
|
*/
|
|
112
149
|
export function setTheme(input = {}) {
|
|
113
150
|
const theme = input ?? {};
|
|
151
|
+
PARSED.clear();
|
|
114
152
|
THEME_COLOR_MAP.clear();
|
|
115
153
|
TYPOGRAPHY_MAP.clear();
|
|
116
154
|
flattenColors(theme.colors, '', THEME_COLOR_MAP);
|
|
@@ -136,6 +174,8 @@ function parseHex(str) {
|
|
|
136
174
|
if (!str.startsWith('#'))
|
|
137
175
|
return null;
|
|
138
176
|
let hex = str.slice(1);
|
|
177
|
+
if (!/^[0-9a-f]+$/.test(hex))
|
|
178
|
+
return null;
|
|
139
179
|
// Expand shorthand: #RGB → #RRGGBB, #RGBA → #RRGGBBAA
|
|
140
180
|
if (hex.length === 3 || hex.length === 4)
|
|
141
181
|
hex = hex.split('').map(c => c + c).join('');
|
|
@@ -151,76 +191,79 @@ function parseRgb(str) {
|
|
|
151
191
|
const m = str.match(/^rgba?\s*\((.+)\)/);
|
|
152
192
|
if (!m)
|
|
153
193
|
return null;
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const b = tokens
|
|
158
|
-
|
|
159
|
-
const a = tokens.length > 3 ? parseFloat(tokens[3]) : alpha;
|
|
160
|
-
return [r, g, b, a];
|
|
194
|
+
const args = parseArgs(m[1]);
|
|
195
|
+
if (!args)
|
|
196
|
+
return null;
|
|
197
|
+
const [r, g, b] = args.tokens.map(t => readChannel(t, 1, 255));
|
|
198
|
+
return finiteColor([r, g, b, args.alpha]);
|
|
161
199
|
}
|
|
162
|
-
/** Parses `hsl()` / `hsla()`.
|
|
200
|
+
/** Parses `hsl()` / `hsla()`. The hue takes `deg`, `grad`, `rad` or `turn` (a bare number is degrees). */
|
|
163
201
|
function parseHsl(str) {
|
|
164
202
|
const m = str.match(/^hsla?\s*\((.+)\)/);
|
|
165
203
|
if (!m)
|
|
166
204
|
return null;
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
const
|
|
205
|
+
const args = parseArgs(m[1]);
|
|
206
|
+
if (!args)
|
|
207
|
+
return null;
|
|
208
|
+
const h = readHue(args.tokens[0]);
|
|
209
|
+
const s = parseFloat(args.tokens[1]) / 100;
|
|
210
|
+
const l = parseFloat(args.tokens[2]) / 100;
|
|
211
|
+
const k = (n) => (((n + h / 30) % 12) + 12) % 12;
|
|
173
212
|
const chroma = s * Math.min(l, 1 - l);
|
|
174
213
|
const f = (n) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
175
|
-
return [f(0), f(8), f(4),
|
|
214
|
+
return finiteColor([f(0), f(8), f(4), args.alpha]);
|
|
176
215
|
}
|
|
177
216
|
/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */
|
|
178
217
|
function parseLab(str) {
|
|
179
218
|
const m = str.match(/^lab\s*\((.+)\)/);
|
|
180
219
|
if (!m)
|
|
181
220
|
return null;
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
221
|
+
const args = parseArgs(m[1]);
|
|
222
|
+
if (!args)
|
|
223
|
+
return null;
|
|
224
|
+
const L = parseFloat(args.tokens[0]);
|
|
225
|
+
const a = parseFloat(args.tokens[1]);
|
|
226
|
+
const b = parseFloat(args.tokens[2]);
|
|
227
|
+
return finiteColor(labToNormalized(L, a, b, args.alpha));
|
|
187
228
|
}
|
|
188
229
|
/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */
|
|
189
230
|
function parseLch(str) {
|
|
190
231
|
const m = str.match(/^lch\s*\((.+)\)/);
|
|
191
232
|
if (!m)
|
|
192
233
|
return null;
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
|
|
234
|
+
const args = parseArgs(m[1]);
|
|
235
|
+
if (!args)
|
|
236
|
+
return null;
|
|
237
|
+
const L = parseFloat(args.tokens[0]);
|
|
238
|
+
const C = parseFloat(args.tokens[1]);
|
|
239
|
+
const rad = readHue(args.tokens[2]) * (Math.PI / 180);
|
|
240
|
+
return finiteColor(labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));
|
|
199
241
|
}
|
|
200
242
|
/** Parses `oklab(L a b)` (Oklab perceptually uniform color space). */
|
|
201
243
|
function parseOklab(str) {
|
|
202
244
|
const m = str.match(/^oklab\s*\((.+)\)/);
|
|
203
245
|
if (!m)
|
|
204
246
|
return null;
|
|
205
|
-
const
|
|
247
|
+
const args = parseArgs(m[1]);
|
|
248
|
+
if (!args)
|
|
249
|
+
return null;
|
|
206
250
|
// L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.
|
|
207
|
-
const L = tokens[0]
|
|
208
|
-
|
|
209
|
-
const b = tokens[2].endsWith('%') ? parseFloat(tokens[2]) / 100 * 0.4 : parseFloat(tokens[2]);
|
|
210
|
-
return oklabToNormalized(L, a, b, alpha);
|
|
251
|
+
const [L, a, b] = [readChannel(args.tokens[0], 1), readChannel(args.tokens[1], 0.4), readChannel(args.tokens[2], 0.4)];
|
|
252
|
+
return finiteColor(oklabToNormalized(L, a, b, args.alpha));
|
|
211
253
|
}
|
|
212
254
|
/** Parses `oklch(L C H)` (polar form of Oklab). */
|
|
213
255
|
function parseOklch(str) {
|
|
214
256
|
const m = str.match(/^oklch\s*\((.+)\)/);
|
|
215
257
|
if (!m)
|
|
216
258
|
return null;
|
|
217
|
-
const
|
|
259
|
+
const args = parseArgs(m[1]);
|
|
260
|
+
if (!args)
|
|
261
|
+
return null;
|
|
218
262
|
// L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).
|
|
219
|
-
const L =
|
|
220
|
-
const C =
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
return oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), alpha);
|
|
263
|
+
const L = readChannel(args.tokens[0], 1);
|
|
264
|
+
const C = readChannel(args.tokens[1], 0.4);
|
|
265
|
+
const rad = readHue(args.tokens[2]) * (Math.PI / 180);
|
|
266
|
+
return finiteColor(oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));
|
|
224
267
|
}
|
|
225
268
|
// ── CIE conversion helpers ────────────────────────────────────────────────────
|
|
226
269
|
/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */
|
|
@@ -275,6 +318,9 @@ function splitOpacitySuffix(str) {
|
|
|
275
318
|
* Falls back to opaque black and logs a warning for unrecognised input.
|
|
276
319
|
*/
|
|
277
320
|
export function parseColor(cssStr) {
|
|
321
|
+
const known = PARSED.get(cssStr);
|
|
322
|
+
if (known)
|
|
323
|
+
return known;
|
|
278
324
|
const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());
|
|
279
325
|
const parsed = parseNamedColor(str) ??
|
|
280
326
|
parseHex(str) ??
|
|
@@ -283,11 +329,17 @@ export function parseColor(cssStr) {
|
|
|
283
329
|
parseLab(str) ??
|
|
284
330
|
parseLch(str) ??
|
|
285
331
|
parseOklab(str) ??
|
|
286
|
-
parseOklch(str)
|
|
287
|
-
|
|
332
|
+
parseOklch(str);
|
|
333
|
+
if (!parsed) {
|
|
334
|
+
console.warn(`[Motion Engine] Unsupported color format: "${cssStr}". Defaulting to black.`);
|
|
335
|
+
return [0, 0, 0, 1];
|
|
336
|
+
}
|
|
288
337
|
// Clone before applying opacity: named/theme lookups return cached tuples.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
338
|
+
const color = opacity !== 1 ? [parsed[0], parsed[1], parsed[2], parsed[3] * opacity] : parsed;
|
|
339
|
+
if (PARSED.size >= PARSED_MAX)
|
|
340
|
+
PARSED.clear();
|
|
341
|
+
PARSED.set(cssStr, color);
|
|
342
|
+
return color;
|
|
292
343
|
}
|
|
344
|
+
const PARSED_MAX = 16384;
|
|
293
345
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,iFAAiF;AAEjF,qEAAqE;AACrE,SAAS,WAAW,CAAC,CAAS;IAC1B,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,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC;QACb,UAAU,CAAC,GAAG,CAAC;QACf,UAAU,CAAC,GAAG,CAAC;QACf,CAAC,OAAO,CAAC,IAAI,CAAC,8CAA8C,MAAM,yBAAyB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAoB,CAAC,CAAC;IACnI,2EAA2E;IAC3E,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/**\n * CSS color string parser → normalized [R, G, B, A] float tuple.\n *\n * Supported formats:\n * - Named colors (CSS Level 4, 148 entries) and theme aliases via {@link setTheme}\n * - Hex: `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA`\n * - `rgb()` / `rgba()` — legacy comma and modern space/slash syntax\n * - `hsl()` / `hsla()`\n * - `lab()`, `lch()`\n * - `oklab()`, `oklch()`\n * - Tailwind-style opacity suffix: `\"white/10\"`, `\"primary/90\"` (percent 0–100)\n *\n * All output values are in the linear 0–1 range suitable for WebGL uniforms.\n * Named-color lookup is O(1); all other formats are parsed with lightweight\n * regex — no DOM, no `getComputedStyle`.\n */\n\nimport { CSS_COLOR_MAP } from './constants';\n\n/** Normalized RGBA color: `[red, green, blue, alpha]` each in the 0–1 range. */\nexport type NormalizedColor = [number, number, number, number];\n\n/** Loose color input accepted by prop interfaces — CSS string or pre-normalized tuple. */\nexport type Color = string | NormalizedColor;\n\n// ── Color space helpers ───────────────────────────────────────────────────────\n\n/** Applies the sRGB gamma curve to a single linear-light channel. */\nfunction gammaEncode(c: number): number {\n c = Math.max(0, Math.min(1, c));\n return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;\n}\n\n/** Converts a linear-light sRGB triple to gamma-encoded sRGB. */\nfunction linearToSrgb(r: number, g: number, b: number, a: number): NormalizedColor {\n return [gammaEncode(r), gammaEncode(g), gammaEncode(b), a];\n}\n\n/** Bradford-adapted XYZ D65 → linear-light sRGB matrix (IEC 61966-2-1). */\nfunction xyzD65ToLinearSrgb(X: number, Y: number, Z: number): [number, number, number] {\n return [\n 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,\n -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z,\n 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z,\n ];\n}\n\n// ── Argument parser ───────────────────────────────────────────────────────────\n\n/**\n * Splits the inner content of a CSS color function into channel tokens and\n * an alpha value. Handles the slash-alpha syntax used by modern `rgb()` /\n * `hsl()` as well as the legacy comma-alpha form used by `rgba()` / `hsla()`.\n */\nfunction parseArgs(inner: string): { tokens: string[]; alpha: number } {\n const slashIdx = inner.lastIndexOf('/');\n let alpha = 1;\n let colorPart = inner;\n if (slashIdx !== -1) {\n const alphaStr = inner.slice(slashIdx + 1).trim();\n alpha = alphaStr.endsWith('%') ? parseFloat(alphaStr) / 100 : parseFloat(alphaStr);\n colorPart = inner.slice(0, slashIdx);\n }\n return { tokens: colorPart.trim().split(/[\\s,]+/).filter(Boolean), alpha };\n}\n\n// ── Per-format parsers ────────────────────────────────────────────────────────\n\n// Use a globalThis key so multiple bundled copies of this module (e.g. the\n// prebuilt player bundle and the Vite-compiled user code) share one map.\nconst _g = globalThis as Record<string, unknown>;\nif (!_g.__msThemeMap) _g.__msThemeMap = new Map<string, NormalizedColor>();\nconst THEME_COLOR_MAP = _g.__msThemeMap as Map<string, NormalizedColor>;\n\n// Typography presets ride the same shared-global pattern as the color map, so\n// the prebuilt player bundle and the user's Vite-compiled code read one registry\n// — `setTheme` (called once per build at the player/headless entry points)\n// populates both before any scene generator runs.\nif (!_g.__msTypographyMap) _g.__msTypographyMap = new Map<string, Record<string, unknown>>();\nconst TYPOGRAPHY_MAP = _g.__msTypographyMap as Map<string, Record<string, unknown>>;\n\n// Structural mirror of `@/project/config`'s `Theme` (and its color token shape),\n// declared locally so this module stays a leaf — `config.ts` imports `Color`\n// from here, so importing `Theme` back would be a cycle. The project's `Theme`\n// is structurally compatible, so `setTheme(config.theme)` just works.\n// `typography` presets are stored opaquely (the parser never reads their fields),\n// so the value type is the loose `object` — this stays assignable from `Theme`'s\n// `TypographyPreset` (a `TextStyle` interface, which lacks an implicit string\n// index signature and so is not a `Record<string, unknown>`).\ntype ColorTokenInput = Color | { [key: string]: ColorTokenInput };\ninterface ThemeInput {\n colors?: Record<string, ColorTokenInput>;\n typography?: Record<string, object>;\n}\n\n/**\n * Recursively flatten nested color groups into dash-joined, lowercased keys\n * (`{ brand: { 500: '#…' } }` → `brand-500`), parsing each leaf to a normalized\n * color. Arrays are leaves (a pre-normalized `[R,G,B,A]` tuple); strings are\n * leaves; only plain objects recurse.\n */\nfunction flattenColors(\n tokens: Record<string, ColorTokenInput> | undefined,\n prefix: string,\n out: Map<string, NormalizedColor>,\n): void {\n if (!tokens) return;\n for (const [name, token] of Object.entries(tokens)) {\n const key = prefix ? `${prefix}-${name}` : name;\n if (token != null && !Array.isArray(token) && typeof token === 'object') {\n flattenColors(token as Record<string, ColorTokenInput>, key, out);\n } else {\n const color = token as Color;\n out.set(key.toLowerCase(), Array.isArray(color) ? (color as NormalizedColor) : parseColor(color));\n }\n }\n}\n\n/**\n * Registers a project theme: named colors (referenceable by name in any color\n * string) and typography presets (selected via a `Text`/`RichText` `variant`).\n *\n * Color entries take precedence over CSS named colors; nested color groups are\n * flattened to dash-joined names (`{ brand: { 500: … } }` → `brand-500`). Call\n * with no argument, `null`, or an empty object to clear both registries — a\n * document's own `theme` is optional, and a host reading one out of storage\n * (a database column, a JSON file) typically gets that absence back as `null`\n * rather than `undefined`.\n *\n * The `default` typography key is reserved: it's read directly by\n * {@link applyTextDefaults} (not just via `variant`) and applied to every\n * `Text`/`RichText` as a project-wide base style.\n *\n * @example\n * setTheme({\n * colors: { brand: \"#ff6b35\", accent: { 500: \"oklch(70% 0.2 145)\" } },\n * typography: {\n * default: { fontFamily: \"Inter\", fontSize: 32 },\n * header: { fontSize: 96, fontWeight: 700 },\n * },\n * });\n * // Later: fill=\"brand\", fill=\"accent-500\", <Text variant=\"header\" />\n */\nexport function setTheme(input: ThemeInput | null = {}): void {\n const theme = input ?? {};\n THEME_COLOR_MAP.clear();\n TYPOGRAPHY_MAP.clear();\n flattenColors(theme.colors, '', THEME_COLOR_MAP);\n if (theme.typography) {\n for (const [name, preset] of Object.entries(theme.typography)) {\n // Stored opaquely; `applyTextDefaults` reads fields by key. The `object`\n // preset is widened to the readable record shape at this boundary only.\n TYPOGRAPHY_MAP.set(name.toLowerCase(), preset as Record<string, unknown>);\n }\n }\n}\n\n/** Looks up a registered typography preset by variant name (case-insensitive);\n * `undefined` if none is registered. */\nexport function getTypographyPreset(name: string): Record<string, unknown> | undefined {\n return TYPOGRAPHY_MAP.get(name.toLowerCase());\n}\n\n/** Looks up a color name in the theme map first, then the CSS named-color table. */\nfunction parseNamedColor(str: string): NormalizedColor | null {\n return THEME_COLOR_MAP.get(str) ?? CSS_COLOR_MAP.get(str) ?? null;\n}\n\n/** Parses `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` hex strings. */\nfunction parseHex(str: string): NormalizedColor | null {\n if (!str.startsWith('#')) return null;\n let hex = str.slice(1);\n // Expand shorthand: #RGB → #RRGGBB, #RGBA → #RRGGBBAA\n if (hex.length === 3 || hex.length === 4)\n hex = hex.split('').map(c => c + c).join('');\n const int = parseInt(hex, 16);\n if (hex.length === 6)\n return [(int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255, 1];\n if (hex.length === 8)\n return [(int >>> 24) / 255, (int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255];\n return null;\n}\n\n/** Parses `rgb()` / `rgba()` — both percentage and 0-255 channel forms. */\nfunction parseRgb(str: string): NormalizedColor | null {\n const m = str.match(/^rgba?\\s*\\((.+)\\)/);\n if (!m) return null;\n const { tokens, alpha } = parseArgs(m[1]);\n const r = tokens[0].endsWith('%') ? parseFloat(tokens[0]) / 100 : parseFloat(tokens[0]) / 255;\n const g = tokens[1].endsWith('%') ? parseFloat(tokens[1]) / 100 : parseFloat(tokens[1]) / 255;\n const b = tokens[2].endsWith('%') ? parseFloat(tokens[2]) / 100 : parseFloat(tokens[2]) / 255;\n // Legacy rgba() puts alpha as 4th comma arg; modern rgb() uses slash (handled by parseArgs).\n const a = tokens.length > 3 ? parseFloat(tokens[3]) : alpha;\n return [r, g, b, a];\n}\n\n/** Parses `hsl()` / `hsla()`. Hue unit suffixes (`deg`, `rad`, `turn`) are stripped by `parseFloat`. */\nfunction parseHsl(str: string): NormalizedColor | null {\n const m = str.match(/^hsla?\\s*\\((.+)\\)/);\n if (!m) return null;\n const { tokens, alpha } = parseArgs(m[1]);\n const h = parseFloat(tokens[0]);\n const s = parseFloat(tokens[1]) / 100;\n const l = parseFloat(tokens[2]) / 100;\n const a = tokens.length > 3 ? parseFloat(tokens[3]) : alpha;\n const k = (n: number) => (n + h / 30) % 12;\n const chroma = s * Math.min(l, 1 - l);\n const f = (n: number) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\n return [f(0), f(8), f(4), a];\n}\n\n/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */\nfunction parseLab(str: string): NormalizedColor | null {\n const m = str.match(/^lab\\s*\\((.+)\\)/);\n if (!m) return null;\n const { tokens, alpha } = parseArgs(m[1]);\n const L = parseFloat(tokens[0]);\n const a = parseFloat(tokens[1]);\n const b = parseFloat(tokens[2]);\n return labToNormalized(L, a, b, alpha);\n}\n\n/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */\nfunction parseLch(str: string): NormalizedColor | null {\n const m = str.match(/^lch\\s*\\((.+)\\)/);\n if (!m) return null;\n const { tokens, alpha } = parseArgs(m[1]);\n const L = parseFloat(tokens[0]);\n const C = parseFloat(tokens[1]);\n const H = parseFloat(tokens[2]);\n const rad = H * (Math.PI / 180);\n return labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), alpha);\n}\n\n/** Parses `oklab(L a b)` (Oklab perceptually uniform color space). */\nfunction parseOklab(str: string): NormalizedColor | null {\n const m = str.match(/^oklab\\s*\\((.+)\\)/);\n if (!m) return null;\n const { tokens, alpha } = parseArgs(m[1]);\n // L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.\n const L = tokens[0].endsWith('%') ? parseFloat(tokens[0]) / 100 : parseFloat(tokens[0]);\n const a = tokens[1].endsWith('%') ? parseFloat(tokens[1]) / 100 * 0.4 : parseFloat(tokens[1]);\n const b = tokens[2].endsWith('%') ? parseFloat(tokens[2]) / 100 * 0.4 : parseFloat(tokens[2]);\n return oklabToNormalized(L, a, b, alpha);\n}\n\n/** Parses `oklch(L C H)` (polar form of Oklab). */\nfunction parseOklch(str: string): NormalizedColor | null {\n const m = str.match(/^oklch\\s*\\((.+)\\)/);\n if (!m) return null;\n const { tokens, alpha } = parseArgs(m[1]);\n // L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).\n const L = tokens[0].endsWith('%') ? parseFloat(tokens[0]) / 100 : parseFloat(tokens[0]);\n const C = tokens[1].endsWith('%') ? parseFloat(tokens[1]) / 100 * 0.4 : parseFloat(tokens[1]);\n const H = parseFloat(tokens[2]);\n const rad = H * (Math.PI / 180);\n return oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), alpha);\n}\n\n// ── CIE conversion helpers ────────────────────────────────────────────────────\n\n/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */\nfunction labToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const e = 0.008856, k = 903.3;\n const fy = (L + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const X = (fx ** 3 > e ? fx ** 3 : (116 * fx - 16) / k) * 0.95047;\n const Y = L > k * e ? ((L + 16) / 116) ** 3 : L / k;\n const Z = (fz ** 3 > e ? fz ** 3 : (116 * fz - 16) / k) * 1.08883;\n const [lr, lg, lb] = xyzD65ToLinearSrgb(X, Y, Z);\n return linearToSrgb(lr, lg, lb, alpha);\n}\n\n/** Converts Oklab to a normalized sRGB color using the standard Björn Ottosson matrix. */\nfunction oklabToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const l_ = L + 0.3963377774 * a + 0.2158037573 * b;\n const m_ = L - 0.1055613458 * a - 0.0638541728 * b;\n const s_ = L - 0.0894841775 * a - 1.2914855480 * b;\n const l = l_ ** 3, m = m_ ** 3, s = s_ ** 3;\n return linearToSrgb(\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.6956065236 * s,\n alpha,\n );\n}\n\n// ── Opacity suffix ─────────────────────────────────────────────────────────────\n\n/**\n * Splits a Tailwind-style opacity suffix (`\"white/10\"`, `\"primary/90\"`) off the\n * end of a color string. The suffix is a slash followed by a number (optionally\n * with a `%`) interpreted as a percentage 0–100.\n *\n * Only a trailing slash that sits *outside* any parentheses is treated as an\n * opacity modifier, so the internal slash-alpha syntax of `rgb()` / `hsl()`\n * (e.g. `rgb(0 0 255 / 0.25)`) is left untouched.\n *\n * @returns the bare color string and the opacity fraction (1 when absent).\n */\nfunction splitOpacitySuffix(str: string): { color: string; opacity: number } {\n if (str.includes('(')) return { color: str, opacity: 1 };\n const m = str.match(/^(.*[^/])\\/\\s*([\\d.]+)%?$/);\n if (!m) return { color: str, opacity: 1 };\n const pct = parseFloat(m[2]);\n if (!Number.isFinite(pct)) return { color: str, opacity: 1 };\n return { color: m[1].trim(), opacity: Math.max(0, Math.min(1, pct / 100)) };\n}\n\n// ── Main entry point ──────────────────────────────────────────────────────────\n\n/**\n * Parses a CSS color string into a normalized `[R, G, B, A]` array (0.0–1.0).\n *\n * Supported formats: named colors (CSS + theme), hex, rgb/rgba, hsl/hsla,\n * lab, lch, oklab, oklch, plus a Tailwind-style opacity suffix (`\"white/10\"`).\n * Falls back to opaque black and logs a warning for unrecognised input.\n */\nexport function parseColor(cssStr: string): NormalizedColor {\n const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());\n const parsed =\n parseNamedColor(str) ??\n parseHex(str) ??\n parseRgb(str) ??\n parseHsl(str) ??\n parseLab(str) ??\n parseLch(str) ??\n parseOklab(str) ??\n parseOklch(str) ??\n (console.warn(`[Motion Engine] Unsupported color format: \"${cssStr}\". Defaulting to black.`), [0, 0, 0, 1] as NormalizedColor);\n // Clone before applying opacity: named/theme lookups return cached tuples.\n if (opacity !== 1) return [parsed[0], parsed[1], parsed[2], parsed[3] * opacity];\n return parsed;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/color/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ5C,iFAAiF;AAEjF,qEAAqE;AACrE,SAAS,WAAW,CAAC,CAAS;IAC1B,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAC7E,CAAC;AAED,iEAAiE;AACjE,SAAS,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC5D,OAAO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AAU,GAAG,KAAK,CAAC","sourcesContent":["/**\n * CSS color string parser → normalized [R, G, B, A] float tuple.\n *\n * Supported formats:\n * - Named colors (CSS Level 4, 148 entries) and theme aliases via {@link setTheme}\n * - Hex: `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA`\n * - `rgb()` / `rgba()` — legacy comma and modern space/slash syntax\n * - `hsl()` / `hsla()`\n * - `lab()`, `lch()`\n * - `oklab()`, `oklch()`\n * - Tailwind-style opacity suffix: `\"white/10\"`, `\"primary/90\"` (percent 0–100)\n *\n * All output values are in the linear 0–1 range suitable for WebGL uniforms.\n * Named-color lookup is O(1); all other formats are parsed with lightweight\n * regex — no DOM, no `getComputedStyle`.\n */\n\nimport { CSS_COLOR_MAP } from './constants';\n\n/** Normalized RGBA color: `[red, green, blue, alpha]` each in the 0–1 range. */\nexport type NormalizedColor = [number, number, number, number];\n\n/** Loose color input accepted by prop interfaces — CSS string or pre-normalized tuple. */\nexport type Color = string | NormalizedColor;\n\n// ── Color space helpers ───────────────────────────────────────────────────────\n\n/** Applies the sRGB gamma curve to a single linear-light channel. */\nfunction gammaEncode(c: number): number {\n c = Math.max(0, Math.min(1, c));\n return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;\n}\n\n/** Converts a linear-light sRGB triple to gamma-encoded sRGB. */\nfunction linearToSrgb(r: number, g: number, b: number, a: number): NormalizedColor {\n return [gammaEncode(r), gammaEncode(g), gammaEncode(b), a];\n}\n\n/** Bradford-adapted XYZ D65 → linear-light sRGB matrix (IEC 61966-2-1). */\nfunction xyzD65ToLinearSrgb(X: number, Y: number, Z: number): [number, number, number] {\n return [\n 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,\n -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z,\n 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z,\n ];\n}\n\n// ── Argument parser ───────────────────────────────────────────────────────────\n\n/**\n * Splits the inner content of a CSS color function into exactly three channel\n * tokens and an alpha value. Handles the slash-alpha syntax used by modern\n * `rgb()` / `hsl()` as well as the legacy comma-alpha form used by `rgba()` /\n * `hsla()`; both go through {@link readAlpha}, so a percentage alpha means the\n * same in either. Returns `null` for the wrong number of arguments or an alpha\n * that is not a number, which {@link parseColor} reports as an unsupported\n * format.\n */\nfunction parseArgs(inner: string): { tokens: string[]; alpha: number } | null {\n const slashIdx = inner.lastIndexOf('/');\n let alphaToken: string | undefined;\n let colorPart = inner;\n if (slashIdx !== -1) {\n alphaToken = inner.slice(slashIdx + 1).trim();\n colorPart = inner.slice(0, slashIdx);\n }\n const tokens = colorPart.trim().split(/[\\s,]+/).filter(Boolean);\n if (tokens.length === 4 && alphaToken === undefined) alphaToken = tokens.pop();\n if (tokens.length !== 3) return null;\n const alpha = alphaToken === undefined ? 1 : readAlpha(alphaToken);\n if (!Number.isFinite(alpha)) return null;\n return { tokens, alpha };\n}\n\n/** Reads an alpha token: a number, or a percentage (`50%` is 0.5). `NaN` if neither. */\nfunction readAlpha(token: string): number {\n return token.endsWith('%') ? Number(token.slice(0, -1)) / 100 : Number(token);\n}\n\n/** Reads a channel token as a number, scaling a percentage to `percentScale` and a bare number by `1 / numberScale`. `NaN` if it is not a number. */\nfunction readChannel(token: string, percentScale: number, numberScale = 1): number {\n return token.endsWith('%') ? (Number(token.slice(0, -1)) / 100) * percentScale : Number(token) / numberScale;\n}\n\n/** Degrees per CSS angle unit (`deg`, `grad`, `rad`, `turn`). */\nconst ANGLE_UNIT_DEGREES: Record<string, number> = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };\n\n/** Reads a CSS hue/angle token to degrees. A bare number is degrees; an unknown unit or a non-number is `NaN`. */\nfunction readHue(token: string): number {\n const m = token.match(/^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(deg|grad|rad|turn)?$/);\n if (!m) return NaN;\n return Number(m[1]) * ANGLE_UNIT_DEGREES[m[2] ?? 'deg'];\n}\n\n/** Returns `color` when every component is finite, otherwise `null` (unsupported format). */\nfunction finiteColor(color: NormalizedColor): NormalizedColor | null {\n return color.every(Number.isFinite) ? color : null;\n}\n\n// ── Per-format parsers ────────────────────────────────────────────────────────\n\n// Use a globalThis key so multiple bundled copies of this module (e.g. the\n// prebuilt player bundle and the Vite-compiled user code) share one map.\nconst _g = globalThis as Record<string, unknown>;\nif (!_g.__msThemeMap) _g.__msThemeMap = new Map<string, NormalizedColor>();\nconst THEME_COLOR_MAP = _g.__msThemeMap as Map<string, NormalizedColor>;\n\n// Colours already parsed, by the string as given: a scene repeats its strings every\n// frame. Shared like the theme, and cleared with it, since a name resolves through it.\nif (!_g.__msParsedColors) _g.__msParsedColors = new Map<string, NormalizedColor>();\nconst PARSED = _g.__msParsedColors as Map<string, NormalizedColor>;\n\n// Typography presets ride the same shared-global pattern as the color map, so\n// the prebuilt player bundle and the user's Vite-compiled code read one registry\n// — `setTheme` (called once per build at the player/headless entry points)\n// populates both before any scene generator runs.\nif (!_g.__msTypographyMap) _g.__msTypographyMap = new Map<string, Record<string, unknown>>();\nconst TYPOGRAPHY_MAP = _g.__msTypographyMap as Map<string, Record<string, unknown>>;\n\n// Structural mirror of `@/project/config`'s `Theme` (and its color token shape),\n// declared locally so this module stays a leaf — `config.ts` imports `Color`\n// from here, so importing `Theme` back would be a cycle. The project's `Theme`\n// is structurally compatible, so `setTheme(config.theme)` just works.\n// `typography` presets are stored opaquely (the parser never reads their fields),\n// so the value type is the loose `object` — this stays assignable from `Theme`'s\n// `TypographyPreset` (a `TextStyle` interface, which lacks an implicit string\n// index signature and so is not a `Record<string, unknown>`).\ntype ColorTokenInput = Color | { [key: string]: ColorTokenInput };\ninterface ThemeInput {\n colors?: Record<string, ColorTokenInput>;\n typography?: Record<string, object>;\n}\n\n/**\n * Recursively flatten nested color groups into dash-joined, lowercased keys\n * (`{ brand: { 500: '#…' } }` → `brand-500`), parsing each leaf to a normalized\n * color. Arrays are leaves (a pre-normalized `[R,G,B,A]` tuple); strings are\n * leaves; only plain objects recurse.\n */\nfunction flattenColors(\n tokens: Record<string, ColorTokenInput> | undefined,\n prefix: string,\n out: Map<string, NormalizedColor>,\n): void {\n if (!tokens) return;\n for (const [name, token] of Object.entries(tokens)) {\n const key = prefix ? `${prefix}-${name}` : name;\n if (token != null && !Array.isArray(token) && typeof token === 'object') {\n flattenColors(token as Record<string, ColorTokenInput>, key, out);\n } else {\n const color = token as Color;\n out.set(key.toLowerCase(), Array.isArray(color) ? (color as NormalizedColor) : parseColor(color));\n }\n }\n}\n\n/**\n * Registers a project theme: named colors (referenceable by name in any color\n * string) and typography presets (selected via a `Text`/`RichText` `variant`).\n *\n * Color entries take precedence over CSS named colors; nested color groups are\n * flattened to dash-joined names (`{ brand: { 500: … } }` → `brand-500`). Call\n * with no argument, `null`, or an empty object to clear both registries — a\n * document's own `theme` is optional, and a host reading one out of storage\n * (a database column, a JSON file) typically gets that absence back as `null`\n * rather than `undefined`.\n *\n * The `default` typography key is reserved: it's read directly by\n * {@link applyTextDefaults} (not just via `variant`) and applied to every\n * `Text`/`RichText` as a project-wide base style.\n *\n * @example\n * setTheme({\n * colors: { brand: \"#ff6b35\", accent: { 500: \"oklch(70% 0.2 145)\" } },\n * typography: {\n * default: { fontFamily: \"Inter\", fontSize: 32 },\n * header: { fontSize: 96, fontWeight: 700 },\n * },\n * });\n * // Later: fill: \"brand\", fill: \"accent-500\", Text({ variant: \"header\" })\n */\nexport function setTheme(input: ThemeInput | null = {}): void {\n const theme = input ?? {};\n PARSED.clear();\n THEME_COLOR_MAP.clear();\n TYPOGRAPHY_MAP.clear();\n flattenColors(theme.colors, '', THEME_COLOR_MAP);\n if (theme.typography) {\n for (const [name, preset] of Object.entries(theme.typography)) {\n // Stored opaquely; `applyTextDefaults` reads fields by key. The `object`\n // preset is widened to the readable record shape at this boundary only.\n TYPOGRAPHY_MAP.set(name.toLowerCase(), preset as Record<string, unknown>);\n }\n }\n}\n\n/** Looks up a registered typography preset by variant name (case-insensitive);\n * `undefined` if none is registered. */\nexport function getTypographyPreset(name: string): Record<string, unknown> | undefined {\n return TYPOGRAPHY_MAP.get(name.toLowerCase());\n}\n\n/** Looks up a color name in the theme map first, then the CSS named-color table. */\nfunction parseNamedColor(str: string): NormalizedColor | null {\n return THEME_COLOR_MAP.get(str) ?? CSS_COLOR_MAP.get(str) ?? null;\n}\n\n/** Parses `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` hex strings. */\nfunction parseHex(str: string): NormalizedColor | null {\n if (!str.startsWith('#')) return null;\n let hex = str.slice(1);\n if (!/^[0-9a-f]+$/.test(hex)) return null;\n // Expand shorthand: #RGB → #RRGGBB, #RGBA → #RRGGBBAA\n if (hex.length === 3 || hex.length === 4)\n hex = hex.split('').map(c => c + c).join('');\n const int = parseInt(hex, 16);\n if (hex.length === 6)\n return [(int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255, 1];\n if (hex.length === 8)\n return [(int >>> 24) / 255, (int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255];\n return null;\n}\n\n/** Parses `rgb()` / `rgba()` — both percentage and 0-255 channel forms. */\nfunction parseRgb(str: string): NormalizedColor | null {\n const m = str.match(/^rgba?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const [r, g, b] = args.tokens.map(t => readChannel(t, 1, 255));\n return finiteColor([r, g, b, args.alpha]);\n}\n\n/** Parses `hsl()` / `hsla()`. The hue takes `deg`, `grad`, `rad` or `turn` (a bare number is degrees). */\nfunction parseHsl(str: string): NormalizedColor | null {\n const m = str.match(/^hsla?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const h = readHue(args.tokens[0]);\n const s = parseFloat(args.tokens[1]) / 100;\n const l = parseFloat(args.tokens[2]) / 100;\n const k = (n: number) => (((n + h / 30) % 12) + 12) % 12;\n const chroma = s * Math.min(l, 1 - l);\n const f = (n: number) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\n return finiteColor([f(0), f(8), f(4), args.alpha]);\n}\n\n/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */\nfunction parseLab(str: string): NormalizedColor | null {\n const m = str.match(/^lab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const a = parseFloat(args.tokens[1]);\n const b = parseFloat(args.tokens[2]);\n return finiteColor(labToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */\nfunction parseLch(str: string): NormalizedColor | null {\n const m = str.match(/^lch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const C = parseFloat(args.tokens[1]);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n/** Parses `oklab(L a b)` (Oklab perceptually uniform color space). */\nfunction parseOklab(str: string): NormalizedColor | null {\n const m = str.match(/^oklab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.\n const [L, a, b] = [readChannel(args.tokens[0], 1), readChannel(args.tokens[1], 0.4), readChannel(args.tokens[2], 0.4)];\n return finiteColor(oklabToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `oklch(L C H)` (polar form of Oklab). */\nfunction parseOklch(str: string): NormalizedColor | null {\n const m = str.match(/^oklch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).\n const L = readChannel(args.tokens[0], 1);\n const C = readChannel(args.tokens[1], 0.4);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n// ── CIE conversion helpers ────────────────────────────────────────────────────\n\n/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */\nfunction labToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const e = 0.008856, k = 903.3;\n const fy = (L + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const X = (fx ** 3 > e ? fx ** 3 : (116 * fx - 16) / k) * 0.95047;\n const Y = L > k * e ? ((L + 16) / 116) ** 3 : L / k;\n const Z = (fz ** 3 > e ? fz ** 3 : (116 * fz - 16) / k) * 1.08883;\n const [lr, lg, lb] = xyzD65ToLinearSrgb(X, Y, Z);\n return linearToSrgb(lr, lg, lb, alpha);\n}\n\n/** Converts Oklab to a normalized sRGB color using the standard Björn Ottosson matrix. */\nfunction oklabToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const l_ = L + 0.3963377774 * a + 0.2158037573 * b;\n const m_ = L - 0.1055613458 * a - 0.0638541728 * b;\n const s_ = L - 0.0894841775 * a - 1.2914855480 * b;\n const l = l_ ** 3, m = m_ ** 3, s = s_ ** 3;\n return linearToSrgb(\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.6956065236 * s,\n alpha,\n );\n}\n\n// ── Opacity suffix ─────────────────────────────────────────────────────────────\n\n/**\n * Splits a Tailwind-style opacity suffix (`\"white/10\"`, `\"primary/90\"`) off the\n * end of a color string. The suffix is a slash followed by a number (optionally\n * with a `%`) interpreted as a percentage 0–100.\n *\n * Only a trailing slash that sits *outside* any parentheses is treated as an\n * opacity modifier, so the internal slash-alpha syntax of `rgb()` / `hsl()`\n * (e.g. `rgb(0 0 255 / 0.25)`) is left untouched.\n *\n * @returns the bare color string and the opacity fraction (1 when absent).\n */\nfunction splitOpacitySuffix(str: string): { color: string; opacity: number } {\n if (str.includes('(')) return { color: str, opacity: 1 };\n const m = str.match(/^(.*[^/])\\/\\s*([\\d.]+)%?$/);\n if (!m) return { color: str, opacity: 1 };\n const pct = parseFloat(m[2]);\n if (!Number.isFinite(pct)) return { color: str, opacity: 1 };\n return { color: m[1].trim(), opacity: Math.max(0, Math.min(1, pct / 100)) };\n}\n\n// ── Main entry point ──────────────────────────────────────────────────────────\n\n/**\n * Parses a CSS color string into a normalized `[R, G, B, A]` array (0.0–1.0).\n *\n * Supported formats: named colors (CSS + theme), hex, rgb/rgba, hsl/hsla,\n * lab, lch, oklab, oklch, plus a Tailwind-style opacity suffix (`\"white/10\"`).\n * Falls back to opaque black and logs a warning for unrecognised input.\n */\nexport function parseColor(cssStr: string): NormalizedColor {\n const known = PARSED.get(cssStr);\n if (known) return known;\n const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());\n const parsed =\n parseNamedColor(str) ??\n parseHex(str) ??\n parseRgb(str) ??\n parseHsl(str) ??\n parseLab(str) ??\n parseLch(str) ??\n parseOklab(str) ??\n parseOklch(str);\n if (!parsed) {\n console.warn(`[Motion Engine] Unsupported color format: \"${cssStr}\". Defaulting to black.`);\n return [0, 0, 0, 1];\n }\n // Clone before applying opacity: named/theme lookups return cached tuples.\n const color: NormalizedColor = opacity !== 1 ? [parsed[0], parsed[1], parsed[2], parsed[3] * opacity] : parsed;\n if (PARSED.size >= PARSED_MAX) PARSED.clear();\n PARSED.set(cssStr, color);\n return color;\n}\n\nconst PARSED_MAX = 16384;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NormalizedColor } from './color/parser.js';
|
|
2
|
+
/** A colour ramp: `colors[i]` sits at `stops[i]` (ascending, 0 to 1). */
|
|
3
|
+
export interface ColorRamp {
|
|
4
|
+
colors: NormalizedColor[];
|
|
5
|
+
stops: number[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Interpolates two colour ramps. Two ramps with the same stop positions are
|
|
9
|
+
* blended stop by stop. Otherwise both are resampled onto the union of their
|
|
10
|
+
* positions first (a position either ramp doubles, as for a hard edge, is kept
|
|
11
|
+
* doubled), so a tween between a 2-stop and a 3-stop gradient is the destination
|
|
12
|
+
* ramp at `t = 1` rather than the source's stop count with the destination's
|
|
13
|
+
* colours merged in.
|
|
14
|
+
*/
|
|
15
|
+
export declare function lerpColorRamp(a: ColorRamp, b: ColorRamp, t: number): ColorRamp;
|
|
16
|
+
//# sourceMappingURL=gradient-stops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradient-stops.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/gradient-stops.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,yEAAyE;AACzE,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AA8BD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAsB9E"}
|