@motion-script/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/assets/catalog.d.ts +83 -0
- package/dist/assets/catalog.d.ts.map +1 -0
- package/dist/assets/catalog.js +110 -0
- package/dist/assets/catalog.js.map +1 -0
- package/dist/assets/index.d.ts +5 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +4 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/manager.d.ts +32 -0
- package/dist/assets/manager.d.ts.map +1 -0
- package/dist/assets/manager.js +108 -0
- package/dist/assets/manager.js.map +1 -0
- package/dist/assets/manager.test.d.ts +2 -0
- package/dist/assets/manager.test.d.ts.map +1 -0
- package/dist/assets/manager.test.js +133 -0
- package/dist/assets/manager.test.js.map +1 -0
- package/dist/assets/manifest.d.ts +38 -0
- package/dist/assets/manifest.d.ts.map +1 -0
- package/dist/assets/manifest.js +2 -0
- package/dist/assets/manifest.js.map +1 -0
- package/dist/assets/record.d.ts +40 -0
- package/dist/assets/record.d.ts.map +1 -0
- package/dist/assets/record.js +2 -0
- package/dist/assets/record.js.map +1 -0
- package/dist/assets/tracker.d.ts +69 -0
- package/dist/assets/tracker.d.ts.map +1 -0
- package/dist/assets/tracker.js +178 -0
- package/dist/assets/tracker.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +21 -0
- package/dist/attributes/audio/request.d.ts.map +1 -0
- package/dist/attributes/audio/request.js +2 -0
- package/dist/attributes/audio/request.js.map +1 -0
- package/dist/attributes/audio/sound.d.ts +83 -0
- package/dist/attributes/audio/sound.d.ts.map +1 -0
- package/dist/attributes/audio/sound.js +106 -0
- package/dist/attributes/audio/sound.js.map +1 -0
- package/dist/attributes/index.d.ts +18 -0
- package/dist/attributes/index.d.ts.map +1 -0
- package/dist/attributes/index.js +17 -0
- package/dist/attributes/index.js.map +1 -0
- package/dist/attributes/layout/bounds.d.ts +12 -0
- package/dist/attributes/layout/bounds.d.ts.map +1 -0
- package/dist/attributes/layout/bounds.js +2 -0
- package/dist/attributes/layout/bounds.js.map +1 -0
- package/dist/attributes/layout/constraints.d.ts +6 -0
- package/dist/attributes/layout/constraints.d.ts.map +1 -0
- package/dist/attributes/layout/constraints.js +2 -0
- package/dist/attributes/layout/constraints.js.map +1 -0
- package/dist/attributes/layout/index.d.ts +6 -0
- package/dist/attributes/layout/index.d.ts.map +1 -0
- package/dist/attributes/layout/index.js +2 -0
- package/dist/attributes/layout/index.js.map +1 -0
- package/dist/attributes/layout/padding.d.ts +26 -0
- package/dist/attributes/layout/padding.d.ts.map +1 -0
- package/dist/attributes/layout/padding.js +17 -0
- package/dist/attributes/layout/padding.js.map +1 -0
- package/dist/attributes/layout/padding.test.d.ts +2 -0
- package/dist/attributes/layout/padding.test.d.ts.map +1 -0
- package/dist/attributes/layout/padding.test.js +32 -0
- package/dist/attributes/layout/padding.test.js.map +1 -0
- package/dist/attributes/layout/size.d.ts +14 -0
- package/dist/attributes/layout/size.d.ts.map +1 -0
- package/dist/attributes/layout/size.js +2 -0
- package/dist/attributes/layout/size.js.map +1 -0
- package/dist/attributes/layout/vector2.d.ts +8 -0
- package/dist/attributes/layout/vector2.d.ts.map +1 -0
- package/dist/attributes/layout/vector2.js +8 -0
- package/dist/attributes/layout/vector2.js.map +1 -0
- package/dist/attributes/layout/vector2.test.d.ts +2 -0
- package/dist/attributes/layout/vector2.test.d.ts.map +1 -0
- package/dist/attributes/layout/vector2.test.js +23 -0
- package/dist/attributes/layout/vector2.test.js.map +1 -0
- package/dist/attributes/mask/boolean.d.ts +2 -0
- package/dist/attributes/mask/boolean.d.ts.map +1 -0
- package/dist/attributes/mask/boolean.js +2 -0
- package/dist/attributes/mask/boolean.js.map +1 -0
- package/dist/attributes/mask/mask.d.ts +9 -0
- package/dist/attributes/mask/mask.d.ts.map +1 -0
- package/dist/attributes/mask/mask.js +2 -0
- package/dist/attributes/mask/mask.js.map +1 -0
- package/dist/attributes/properties/decorator.d.ts +45 -0
- package/dist/attributes/properties/decorator.d.ts.map +1 -0
- package/dist/attributes/properties/decorator.js +72 -0
- package/dist/attributes/properties/decorator.js.map +1 -0
- package/dist/attributes/properties/decorator.test.d.ts +2 -0
- package/dist/attributes/properties/decorator.test.d.ts.map +1 -0
- package/dist/attributes/properties/decorator.test.js +52 -0
- package/dist/attributes/properties/decorator.test.js.map +1 -0
- package/dist/attributes/shape/corners/border-radius.d.ts +32 -0
- package/dist/attributes/shape/corners/border-radius.d.ts.map +1 -0
- package/dist/attributes/shape/corners/border-radius.js +50 -0
- package/dist/attributes/shape/corners/border-radius.js.map +1 -0
- package/dist/attributes/shape/corners/border-radius.test.d.ts +2 -0
- package/dist/attributes/shape/corners/border-radius.test.d.ts.map +1 -0
- package/dist/attributes/shape/corners/border-radius.test.js +52 -0
- package/dist/attributes/shape/corners/border-radius.test.js.map +1 -0
- package/dist/attributes/shape/corners/index.d.ts +2 -0
- package/dist/attributes/shape/corners/index.d.ts.map +1 -0
- package/dist/attributes/shape/corners/index.js +2 -0
- package/dist/attributes/shape/corners/index.js.map +1 -0
- package/dist/attributes/shape/effects/chain.d.ts +145 -0
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -0
- package/dist/attributes/shape/effects/chain.js +163 -0
- package/dist/attributes/shape/effects/chain.js.map +1 -0
- package/dist/attributes/shape/effects/chain.test.d.ts +2 -0
- package/dist/attributes/shape/effects/chain.test.d.ts.map +1 -0
- package/dist/attributes/shape/effects/chain.test.js +63 -0
- package/dist/attributes/shape/effects/chain.test.js.map +1 -0
- package/dist/attributes/shape/effects/effect-data.d.ts +18 -0
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -0
- package/dist/attributes/shape/effects/effect-data.js +2 -0
- package/dist/attributes/shape/effects/effect-data.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/background-blur.d.ts +13 -0
- package/dist/attributes/shape/effects/implementations/background-blur.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/background-blur.js +6 -0
- package/dist/attributes/shape/effects/implementations/background-blur.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +12 -0
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/bloom.js +11 -0
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/blur.d.ts +7 -0
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/blur.js +6 -0
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/bulge-pinch.d.ts +13 -0
- package/dist/attributes/shape/effects/implementations/bulge-pinch.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/bulge-pinch.js +15 -0
- package/dist/attributes/shape/effects/implementations/bulge-pinch.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +10 -0
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +10 -0
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +7 -0
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/grayscale.js +6 -0
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +8 -0
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/pixelate.js +10 -0
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/sksl.d.ts +39 -0
- package/dist/attributes/shape/effects/implementations/sksl.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/sksl.js +48 -0
- package/dist/attributes/shape/effects/implementations/sksl.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/texture.d.ts +9 -0
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/texture.js +11 -0
- package/dist/attributes/shape/effects/implementations/texture.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +10 -0
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/vintage.js +10 -0
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -0
- package/dist/attributes/shape/effects/implementations/zoom.d.ts +14 -0
- package/dist/attributes/shape/effects/implementations/zoom.d.ts.map +1 -0
- package/dist/attributes/shape/effects/implementations/zoom.js +13 -0
- package/dist/attributes/shape/effects/implementations/zoom.js.map +1 -0
- package/dist/attributes/shape/effects/index.d.ts +19 -0
- package/dist/attributes/shape/effects/index.d.ts.map +1 -0
- package/dist/attributes/shape/effects/index.js +4 -0
- package/dist/attributes/shape/effects/index.js.map +1 -0
- package/dist/attributes/shape/effects/registry.d.ts +4 -0
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -0
- package/dist/attributes/shape/effects/registry.js +51 -0
- package/dist/attributes/shape/effects/registry.js.map +1 -0
- package/dist/attributes/shape/effects/union.d.ts +14 -0
- package/dist/attributes/shape/effects/union.d.ts.map +1 -0
- package/dist/attributes/shape/effects/union.js +2 -0
- package/dist/attributes/shape/effects/union.js.map +1 -0
- package/dist/attributes/shape/fill/blend.d.ts +13 -0
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -0
- package/dist/attributes/shape/fill/blend.js +32 -0
- package/dist/attributes/shape/fill/blend.js.map +1 -0
- package/dist/attributes/shape/fill/blend.test.d.ts +2 -0
- package/dist/attributes/shape/fill/blend.test.d.ts.map +1 -0
- package/dist/attributes/shape/fill/blend.test.js +18 -0
- package/dist/attributes/shape/fill/blend.test.js.map +1 -0
- package/dist/attributes/shape/fill/chain.d.ts +127 -0
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -0
- package/dist/attributes/shape/fill/chain.js +116 -0
- package/dist/attributes/shape/fill/chain.js.map +1 -0
- package/dist/attributes/shape/fill/chain.test.d.ts +2 -0
- package/dist/attributes/shape/fill/chain.test.d.ts.map +1 -0
- package/dist/attributes/shape/fill/chain.test.js +92 -0
- package/dist/attributes/shape/fill/chain.test.js.map +1 -0
- package/dist/attributes/shape/fill/color/constants.d.ts +13 -0
- package/dist/attributes/shape/fill/color/constants.d.ts.map +1 -0
- package/dist/attributes/shape/fill/color/constants.js +162 -0
- package/dist/attributes/shape/fill/color/constants.js.map +1 -0
- package/dist/attributes/shape/fill/color/parser.d.ts +39 -0
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -0
- package/dist/attributes/shape/fill/color/parser.js +212 -0
- package/dist/attributes/shape/fill/color/parser.js.map +1 -0
- package/dist/attributes/shape/fill/color/parser.test.d.ts +2 -0
- package/dist/attributes/shape/fill/color/parser.test.d.ts.map +1 -0
- package/dist/attributes/shape/fill/color/parser.test.js +99 -0
- package/dist/attributes/shape/fill/color/parser.test.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/color.d.ts +17 -0
- package/dist/attributes/shape/fill/implementations/color.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/color.js +24 -0
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts +24 -0
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +33 -0
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/image.d.ts +27 -0
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/image.js +16 -0
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts +24 -0
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +33 -0
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/noise.d.ts +22 -0
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/noise.js +35 -0
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts +24 -0
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +33 -0
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/stripe.d.ts +23 -0
- package/dist/attributes/shape/fill/implementations/stripe.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/stripe.js +36 -0
- package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/video.d.ts +41 -0
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -0
- package/dist/attributes/shape/fill/implementations/video.js +51 -0
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -0
- package/dist/attributes/shape/fill/index.d.ts +18 -0
- package/dist/attributes/shape/fill/index.d.ts.map +1 -0
- package/dist/attributes/shape/fill/index.js +5 -0
- package/dist/attributes/shape/fill/index.js.map +1 -0
- package/dist/attributes/shape/fill/lerp.d.ts +11 -0
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -0
- package/dist/attributes/shape/fill/lerp.js +17 -0
- package/dist/attributes/shape/fill/lerp.js.map +1 -0
- package/dist/attributes/shape/fill/lerp.test.d.ts +2 -0
- package/dist/attributes/shape/fill/lerp.test.d.ts.map +1 -0
- package/dist/attributes/shape/fill/lerp.test.js +18 -0
- package/dist/attributes/shape/fill/lerp.test.js.map +1 -0
- package/dist/attributes/shape/fill/registry.d.ts +28 -0
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -0
- package/dist/attributes/shape/fill/registry.js +83 -0
- package/dist/attributes/shape/fill/registry.js.map +1 -0
- package/dist/attributes/shape/fill/union.d.ts +50 -0
- package/dist/attributes/shape/fill/union.d.ts.map +1 -0
- package/dist/attributes/shape/fill/union.js +11 -0
- package/dist/attributes/shape/fill/union.js.map +1 -0
- package/dist/attributes/shape/filters/chain.d.ts +65 -0
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -0
- package/dist/attributes/shape/filters/chain.js +83 -0
- package/dist/attributes/shape/filters/chain.js.map +1 -0
- package/dist/attributes/shape/filters/chain.test.d.ts +2 -0
- package/dist/attributes/shape/filters/chain.test.d.ts.map +1 -0
- package/dist/attributes/shape/filters/chain.test.js +49 -0
- package/dist/attributes/shape/filters/chain.test.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/alpha.d.ts +7 -0
- package/dist/attributes/shape/filters/implementations/alpha.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/alpha.js +7 -0
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/blur.d.ts +7 -0
- package/dist/attributes/shape/filters/implementations/blur.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/blur.js +7 -0
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/color-adjustment.d.ts +26 -0
- package/dist/attributes/shape/filters/implementations/color-adjustment.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/color-adjustment.js +26 -0
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +13 -0
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/color-matrix.js +12 -0
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/curves.d.ts +17 -0
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/curves.js +18 -0
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/exposure.d.ts +7 -0
- package/dist/attributes/shape/filters/implementations/exposure.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/exposure.js +7 -0
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -0
- package/dist/attributes/shape/filters/implementations/grayscale.d.ts +7 -0
- package/dist/attributes/shape/filters/implementations/grayscale.d.ts.map +1 -0
- package/dist/attributes/shape/filters/implementations/grayscale.js +7 -0
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -0
- package/dist/attributes/shape/filters/index.d.ts +16 -0
- package/dist/attributes/shape/filters/index.d.ts.map +1 -0
- package/dist/attributes/shape/filters/index.js +5 -0
- package/dist/attributes/shape/filters/index.js.map +1 -0
- package/dist/attributes/shape/filters/registry.d.ts +37 -0
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -0
- package/dist/attributes/shape/filters/registry.js +60 -0
- package/dist/attributes/shape/filters/registry.js.map +1 -0
- package/dist/attributes/shape/filters/registry.test.d.ts +5 -0
- package/dist/attributes/shape/filters/registry.test.d.ts.map +1 -0
- package/dist/attributes/shape/filters/registry.test.js +75 -0
- package/dist/attributes/shape/filters/registry.test.js.map +1 -0
- package/dist/attributes/shape/filters/union.d.ts +10 -0
- package/dist/attributes/shape/filters/union.d.ts.map +1 -0
- package/dist/attributes/shape/filters/union.js +2 -0
- package/dist/attributes/shape/filters/union.js.map +1 -0
- package/dist/attributes/shape/path/bezier.d.ts +28 -0
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -0
- package/dist/attributes/shape/path/bezier.js +76 -0
- package/dist/attributes/shape/path/bezier.js.map +1 -0
- package/dist/attributes/shape/path/bezier.test.d.ts +2 -0
- package/dist/attributes/shape/path/bezier.test.d.ts.map +1 -0
- package/dist/attributes/shape/path/bezier.test.js +85 -0
- package/dist/attributes/shape/path/bezier.test.js.map +1 -0
- package/dist/attributes/shape/path/dash.d.ts +15 -0
- package/dist/attributes/shape/path/dash.d.ts.map +1 -0
- package/dist/attributes/shape/path/dash.js +299 -0
- package/dist/attributes/shape/path/dash.js.map +1 -0
- package/dist/attributes/shape/path/dash.test.d.ts +2 -0
- package/dist/attributes/shape/path/dash.test.d.ts.map +1 -0
- package/dist/attributes/shape/path/dash.test.js +36 -0
- package/dist/attributes/shape/path/dash.test.js.map +1 -0
- package/dist/attributes/shape/path/index.d.ts +5 -0
- package/dist/attributes/shape/path/index.d.ts.map +1 -0
- package/dist/attributes/shape/path/index.js +5 -0
- package/dist/attributes/shape/path/index.js.map +1 -0
- package/dist/attributes/shape/path/length.d.ts +14 -0
- package/dist/attributes/shape/path/length.d.ts.map +1 -0
- package/dist/attributes/shape/path/length.js +169 -0
- package/dist/attributes/shape/path/length.js.map +1 -0
- package/dist/attributes/shape/path/length.test.d.ts +2 -0
- package/dist/attributes/shape/path/length.test.d.ts.map +1 -0
- package/dist/attributes/shape/path/length.test.js +56 -0
- package/dist/attributes/shape/path/length.test.js.map +1 -0
- package/dist/attributes/shape/path/subpath.d.ts +15 -0
- package/dist/attributes/shape/path/subpath.d.ts.map +1 -0
- package/dist/attributes/shape/path/subpath.js +486 -0
- package/dist/attributes/shape/path/subpath.js.map +1 -0
- package/dist/attributes/shape/path/subpath.test.d.ts +2 -0
- package/dist/attributes/shape/path/subpath.test.d.ts.map +1 -0
- package/dist/attributes/shape/path/subpath.test.js +54 -0
- package/dist/attributes/shape/path/subpath.test.js.map +1 -0
- package/dist/attributes/shape/shadow/index.d.ts +5 -0
- package/dist/attributes/shape/shadow/index.d.ts.map +1 -0
- package/dist/attributes/shape/shadow/index.js +3 -0
- package/dist/attributes/shape/shadow/index.js.map +1 -0
- package/dist/attributes/shape/shadow/lerp.d.ts +3 -0
- package/dist/attributes/shape/shadow/lerp.d.ts.map +1 -0
- package/dist/attributes/shape/shadow/lerp.js +30 -0
- package/dist/attributes/shape/shadow/lerp.js.map +1 -0
- package/dist/attributes/shape/shadow/resolver.d.ts +22 -0
- package/dist/attributes/shape/shadow/resolver.d.ts.map +1 -0
- package/dist/attributes/shape/shadow/resolver.js +17 -0
- package/dist/attributes/shape/shadow/resolver.js.map +1 -0
- package/dist/attributes/shape/stroke/index.d.ts +5 -0
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -0
- package/dist/attributes/shape/stroke/index.js +3 -0
- package/dist/attributes/shape/stroke/index.js.map +1 -0
- package/dist/attributes/shape/stroke/lerp.d.ts +3 -0
- package/dist/attributes/shape/stroke/lerp.d.ts.map +1 -0
- package/dist/attributes/shape/stroke/lerp.js +30 -0
- package/dist/attributes/shape/stroke/lerp.js.map +1 -0
- package/dist/attributes/shape/stroke/mapper.d.ts +24 -0
- package/dist/attributes/shape/stroke/mapper.d.ts.map +1 -0
- package/dist/attributes/shape/stroke/mapper.js +25 -0
- package/dist/attributes/shape/stroke/mapper.js.map +1 -0
- package/dist/attributes/text/align.d.ts +2 -0
- package/dist/attributes/text/align.d.ts.map +1 -0
- package/dist/attributes/text/align.js +2 -0
- package/dist/attributes/text/align.js.map +1 -0
- package/dist/attributes/text/lerp.d.ts +8 -0
- package/dist/attributes/text/lerp.d.ts.map +1 -0
- package/dist/attributes/text/lerp.js +38 -0
- package/dist/attributes/text/lerp.js.map +1 -0
- package/dist/attributes/text/lerp.test.d.ts +2 -0
- package/dist/attributes/text/lerp.test.d.ts.map +1 -0
- package/dist/attributes/text/lerp.test.js +39 -0
- package/dist/attributes/text/lerp.test.js.map +1 -0
- package/dist/attributes/text/span.d.ts +37 -0
- package/dist/attributes/text/span.d.ts.map +1 -0
- package/dist/attributes/text/span.js +2 -0
- package/dist/attributes/text/span.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx/jsx-dev-runtime.d.ts +19 -0
- package/dist/jsx/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx/jsx-dev-runtime.js +16 -0
- package/dist/jsx/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx/jsx-runtime.d.ts +19 -0
- package/dist/jsx/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx/jsx-runtime.js +16 -0
- package/dist/jsx/jsx-runtime.js.map +1 -0
- package/dist/layout/flex.d.ts +66 -0
- package/dist/layout/flex.d.ts.map +1 -0
- package/dist/layout/flex.js +196 -0
- package/dist/layout/flex.js.map +1 -0
- package/dist/layout/flex.test.d.ts +2 -0
- package/dist/layout/flex.test.d.ts.map +1 -0
- package/dist/layout/flex.test.js +336 -0
- package/dist/layout/flex.test.js.map +1 -0
- package/dist/layout/grid.d.ts +38 -0
- package/dist/layout/grid.d.ts.map +1 -0
- package/dist/layout/grid.js +117 -0
- package/dist/layout/grid.js.map +1 -0
- package/dist/layout/index.d.ts +6 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +6 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/padding.d.ts +19 -0
- package/dist/layout/padding.d.ts.map +1 -0
- package/dist/layout/padding.js +16 -0
- package/dist/layout/padding.js.map +1 -0
- package/dist/layout/padding.test.d.ts +2 -0
- package/dist/layout/padding.test.d.ts.map +1 -0
- package/dist/layout/padding.test.js +39 -0
- package/dist/layout/padding.test.js.map +1 -0
- package/dist/layout/size-resolver.d.ts +13 -0
- package/dist/layout/size-resolver.d.ts.map +1 -0
- package/dist/layout/size-resolver.js +22 -0
- package/dist/layout/size-resolver.js.map +1 -0
- package/dist/layout/size-resolver.test.d.ts +2 -0
- package/dist/layout/size-resolver.test.d.ts.map +1 -0
- package/dist/layout/size-resolver.test.js +24 -0
- package/dist/layout/size-resolver.test.js.map +1 -0
- package/dist/layout/tweens.d.ts +5 -0
- package/dist/layout/tweens.d.ts.map +1 -0
- package/dist/layout/tweens.js +16 -0
- package/dist/layout/tweens.js.map +1 -0
- package/dist/layout/tweens.test.d.ts +2 -0
- package/dist/layout/tweens.test.d.ts.map +1 -0
- package/dist/layout/tweens.test.js +26 -0
- package/dist/layout/tweens.test.js.map +1 -0
- package/dist/nodes/base/boolean-node.d.ts +14 -0
- package/dist/nodes/base/boolean-node.d.ts.map +1 -0
- package/dist/nodes/base/boolean-node.js +34 -0
- package/dist/nodes/base/boolean-node.js.map +1 -0
- package/dist/nodes/base/camera-node.d.ts +27 -0
- package/dist/nodes/base/camera-node.d.ts.map +1 -0
- package/dist/nodes/base/camera-node.js +31 -0
- package/dist/nodes/base/camera-node.js.map +1 -0
- package/dist/nodes/base/mask-node.d.ts +14 -0
- package/dist/nodes/base/mask-node.d.ts.map +1 -0
- package/dist/nodes/base/mask-node.js +37 -0
- package/dist/nodes/base/mask-node.js.map +1 -0
- package/dist/nodes/base/node.d.ts +284 -0
- package/dist/nodes/base/node.d.ts.map +1 -0
- package/dist/nodes/base/node.js +800 -0
- package/dist/nodes/base/node.js.map +1 -0
- package/dist/nodes/base/scene-node.d.ts +45 -0
- package/dist/nodes/base/scene-node.d.ts.map +1 -0
- package/dist/nodes/base/scene-node.js +122 -0
- package/dist/nodes/base/scene-node.js.map +1 -0
- package/dist/nodes/geometry/ellipse-node.d.ts +18 -0
- package/dist/nodes/geometry/ellipse-node.d.ts.map +1 -0
- package/dist/nodes/geometry/ellipse-node.js +55 -0
- package/dist/nodes/geometry/ellipse-node.js.map +1 -0
- package/dist/nodes/geometry/grid-node.d.ts +40 -0
- package/dist/nodes/geometry/grid-node.d.ts.map +1 -0
- package/dist/nodes/geometry/grid-node.js +138 -0
- package/dist/nodes/geometry/grid-node.js.map +1 -0
- package/dist/nodes/geometry/line-node.d.ts +17 -0
- package/dist/nodes/geometry/line-node.d.ts.map +1 -0
- package/dist/nodes/geometry/line-node.js +34 -0
- package/dist/nodes/geometry/line-node.js.map +1 -0
- package/dist/nodes/geometry/path-node.d.ts +17 -0
- package/dist/nodes/geometry/path-node.d.ts.map +1 -0
- package/dist/nodes/geometry/path-node.js +230 -0
- package/dist/nodes/geometry/path-node.js.map +1 -0
- package/dist/nodes/geometry/polygon-node.d.ts +20 -0
- package/dist/nodes/geometry/polygon-node.d.ts.map +1 -0
- package/dist/nodes/geometry/polygon-node.js +42 -0
- package/dist/nodes/geometry/polygon-node.js.map +1 -0
- package/dist/nodes/geometry/polygram-node.d.ts +27 -0
- package/dist/nodes/geometry/polygram-node.d.ts.map +1 -0
- package/dist/nodes/geometry/polygram-node.js +47 -0
- package/dist/nodes/geometry/polygram-node.js.map +1 -0
- package/dist/nodes/geometry/rect-node.d.ts +50 -0
- package/dist/nodes/geometry/rect-node.d.ts.map +1 -0
- package/dist/nodes/geometry/rect-node.js +275 -0
- package/dist/nodes/geometry/rect-node.js.map +1 -0
- package/dist/nodes/geometry/shape-node.d.ts +66 -0
- package/dist/nodes/geometry/shape-node.d.ts.map +1 -0
- package/dist/nodes/geometry/shape-node.js +127 -0
- package/dist/nodes/geometry/shape-node.js.map +1 -0
- package/dist/nodes/index.d.ts +17 -0
- package/dist/nodes/index.d.ts.map +1 -0
- package/dist/nodes/index.js +20 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/nodes/media/image-node.d.ts +28 -0
- package/dist/nodes/media/image-node.d.ts.map +1 -0
- package/dist/nodes/media/image-node.js +53 -0
- package/dist/nodes/media/image-node.js.map +1 -0
- package/dist/nodes/text/richtext-node.d.ts +46 -0
- package/dist/nodes/text/richtext-node.d.ts.map +1 -0
- package/dist/nodes/text/richtext-node.js +155 -0
- package/dist/nodes/text/richtext-node.js.map +1 -0
- package/dist/nodes/text/text-node.d.ts +42 -0
- package/dist/nodes/text/text-node.d.ts.map +1 -0
- package/dist/nodes/text/text-node.js +123 -0
- package/dist/nodes/text/text-node.js.map +1 -0
- package/dist/platform/audio-device.d.ts +40 -0
- package/dist/platform/audio-device.d.ts.map +1 -0
- package/dist/platform/audio-device.js +19 -0
- package/dist/platform/audio-device.js.map +1 -0
- package/dist/platform/index.d.ts +4 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +4 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/master-clock.d.ts +54 -0
- package/dist/platform/master-clock.d.ts.map +1 -0
- package/dist/platform/master-clock.js +85 -0
- package/dist/platform/master-clock.js.map +1 -0
- package/dist/platform/storage-adapter.d.ts +29 -0
- package/dist/platform/storage-adapter.d.ts.map +1 -0
- package/dist/platform/storage-adapter.js +70 -0
- package/dist/platform/storage-adapter.js.map +1 -0
- package/dist/project/config.d.ts +24 -0
- package/dist/project/config.d.ts.map +1 -0
- package/dist/project/config.js +14 -0
- package/dist/project/config.js.map +1 -0
- package/dist/project/config.test.d.ts +2 -0
- package/dist/project/config.test.d.ts.map +1 -0
- package/dist/project/config.test.js +28 -0
- package/dist/project/config.test.js.map +1 -0
- package/dist/project/index.d.ts +3 -0
- package/dist/project/index.d.ts.map +1 -0
- package/dist/project/index.js +3 -0
- package/dist/project/index.js.map +1 -0
- package/dist/project/tree.d.ts +48 -0
- package/dist/project/tree.d.ts.map +1 -0
- package/dist/project/tree.js +11 -0
- package/dist/project/tree.js.map +1 -0
- package/dist/render/build-stage.d.ts +63 -0
- package/dist/render/build-stage.d.ts.map +1 -0
- package/dist/render/build-stage.js +91 -0
- package/dist/render/build-stage.js.map +1 -0
- package/dist/render/descriptors/ellipse.d.ts +10 -0
- package/dist/render/descriptors/ellipse.d.ts.map +1 -0
- package/dist/render/descriptors/ellipse.js +20 -0
- package/dist/render/descriptors/ellipse.js.map +1 -0
- package/dist/render/descriptors/image.d.ts +12 -0
- package/dist/render/descriptors/image.d.ts.map +1 -0
- package/dist/render/descriptors/image.js +12 -0
- package/dist/render/descriptors/image.js.map +1 -0
- package/dist/render/descriptors/latex.d.ts +6 -0
- package/dist/render/descriptors/latex.d.ts.map +1 -0
- package/dist/render/descriptors/latex.js +2 -0
- package/dist/render/descriptors/latex.js.map +1 -0
- package/dist/render/descriptors/line.d.ts +9 -0
- package/dist/render/descriptors/line.d.ts.map +1 -0
- package/dist/render/descriptors/line.js +19 -0
- package/dist/render/descriptors/line.js.map +1 -0
- package/dist/render/descriptors/path-builder.d.ts +14 -0
- package/dist/render/descriptors/path-builder.d.ts.map +1 -0
- package/dist/render/descriptors/path-builder.js +34 -0
- package/dist/render/descriptors/path-builder.js.map +1 -0
- package/dist/render/descriptors/path.d.ts +105 -0
- package/dist/render/descriptors/path.d.ts.map +1 -0
- package/dist/render/descriptors/path.js +45 -0
- package/dist/render/descriptors/path.js.map +1 -0
- package/dist/render/descriptors/path.test.d.ts +2 -0
- package/dist/render/descriptors/path.test.d.ts.map +1 -0
- package/dist/render/descriptors/path.test.js +40 -0
- package/dist/render/descriptors/path.test.js.map +1 -0
- package/dist/render/descriptors/polygon.d.ts +9 -0
- package/dist/render/descriptors/polygon.d.ts.map +1 -0
- package/dist/render/descriptors/polygon.js +19 -0
- package/dist/render/descriptors/polygon.js.map +1 -0
- package/dist/render/descriptors/polygram.d.ts +10 -0
- package/dist/render/descriptors/polygram.d.ts.map +1 -0
- package/dist/render/descriptors/polygram.js +20 -0
- package/dist/render/descriptors/polygram.js.map +1 -0
- package/dist/render/descriptors/rect.d.ts +9 -0
- package/dist/render/descriptors/rect.d.ts.map +1 -0
- package/dist/render/descriptors/rect.js +18 -0
- package/dist/render/descriptors/rect.js.map +1 -0
- package/dist/render/descriptors/richtext.d.ts +12 -0
- package/dist/render/descriptors/richtext.d.ts.map +1 -0
- package/dist/render/descriptors/richtext.js +20 -0
- package/dist/render/descriptors/richtext.js.map +1 -0
- package/dist/render/descriptors/shape.d.ts +6 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -0
- package/dist/render/descriptors/shape.js +2 -0
- package/dist/render/descriptors/shape.js.map +1 -0
- package/dist/render/descriptors/text.d.ts +19 -0
- package/dist/render/descriptors/text.d.ts.map +1 -0
- package/dist/render/descriptors/text.js +27 -0
- package/dist/render/descriptors/text.js.map +1 -0
- package/dist/render/descriptors/transform.d.ts +16 -0
- package/dist/render/descriptors/transform.d.ts.map +1 -0
- package/dist/render/descriptors/transform.js +14 -0
- package/dist/render/descriptors/transform.js.map +1 -0
- package/dist/render/index.d.ts +17 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +16 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/measure-scope.d.ts +25 -0
- package/dist/render/measure-scope.d.ts.map +1 -0
- package/dist/render/measure-scope.js +11 -0
- package/dist/render/measure-scope.js.map +1 -0
- package/dist/render/render-context.d.ts +258 -0
- package/dist/render/render-context.d.ts.map +1 -0
- package/dist/render/render-context.js +95 -0
- package/dist/render/render-context.js.map +1 -0
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/playback-controller.d.ts +105 -0
- package/dist/runtime/playback-controller.d.ts.map +1 -0
- package/dist/runtime/playback-controller.js +244 -0
- package/dist/runtime/playback-controller.js.map +1 -0
- package/dist/runtime/playback-controller.test.d.ts +2 -0
- package/dist/runtime/playback-controller.test.d.ts.map +1 -0
- package/dist/runtime/playback-controller.test.js +148 -0
- package/dist/runtime/playback-controller.test.js.map +1 -0
- package/dist/runtime/precompisition.d.ts +107 -0
- package/dist/runtime/precompisition.d.ts.map +1 -0
- package/dist/runtime/precompisition.js +202 -0
- package/dist/runtime/precompisition.js.map +1 -0
- package/dist/runtime/precompisition.test.d.ts +2 -0
- package/dist/runtime/precompisition.test.d.ts.map +1 -0
- package/dist/runtime/precompisition.test.js +138 -0
- package/dist/runtime/precompisition.test.js.map +1 -0
- package/dist/runtime/runtime.fixtures.d.ts +158 -0
- package/dist/runtime/runtime.fixtures.d.ts.map +1 -0
- package/dist/runtime/runtime.fixtures.js +264 -0
- package/dist/runtime/runtime.fixtures.js.map +1 -0
- package/dist/runtime/state-evaluator.d.ts +76 -0
- package/dist/runtime/state-evaluator.d.ts.map +1 -0
- package/dist/runtime/state-evaluator.js +162 -0
- package/dist/runtime/state-evaluator.js.map +1 -0
- package/dist/runtime/state-evaluator.test.d.ts +2 -0
- package/dist/runtime/state-evaluator.test.d.ts.map +1 -0
- package/dist/runtime/state-evaluator.test.js +122 -0
- package/dist/runtime/state-evaluator.test.js.map +1 -0
- package/dist/signals/create.d.ts +21 -0
- package/dist/signals/create.d.ts.map +1 -0
- package/dist/signals/create.js +74 -0
- package/dist/signals/create.js.map +1 -0
- package/dist/signals/create.test.d.ts +2 -0
- package/dist/signals/create.test.d.ts.map +1 -0
- package/dist/signals/create.test.js +81 -0
- package/dist/signals/create.test.js.map +1 -0
- package/dist/signals/host.d.ts +11 -0
- package/dist/signals/host.d.ts.map +1 -0
- package/dist/signals/host.js +10 -0
- package/dist/signals/host.js.map +1 -0
- package/dist/signals/index.d.ts +4 -0
- package/dist/signals/index.d.ts.map +1 -0
- package/dist/signals/index.js +3 -0
- package/dist/signals/index.js.map +1 -0
- package/dist/signals/signal-cell.test.d.ts +2 -0
- package/dist/signals/signal-cell.test.d.ts.map +1 -0
- package/dist/signals/signal-cell.test.js +202 -0
- package/dist/signals/signal-cell.test.js.map +1 -0
- package/dist/signals/signal.d.ts +46 -0
- package/dist/signals/signal.d.ts.map +1 -0
- package/dist/signals/signal.js +162 -0
- package/dist/signals/signal.js.map +1 -0
- package/dist/signals/signal.test.d.ts +2 -0
- package/dist/signals/signal.test.d.ts.map +1 -0
- package/dist/signals/signal.test.js +192 -0
- package/dist/signals/signal.test.js.map +1 -0
- package/dist/signals/subscriber.d.ts +5 -0
- package/dist/signals/subscriber.d.ts.map +1 -0
- package/dist/signals/subscriber.js +2 -0
- package/dist/signals/subscriber.js.map +1 -0
- package/dist/tween/animation-builder.d.ts +74 -0
- package/dist/tween/animation-builder.d.ts.map +1 -0
- package/dist/tween/animation-builder.js +99 -0
- package/dist/tween/animation-builder.js.map +1 -0
- package/dist/tween/ease/constants.d.ts +13 -0
- package/dist/tween/ease/constants.d.ts.map +1 -0
- package/dist/tween/ease/constants.js +71 -0
- package/dist/tween/ease/constants.js.map +1 -0
- package/dist/tween/ease/type.d.ts +2 -0
- package/dist/tween/ease/type.d.ts.map +1 -0
- package/dist/tween/ease/type.js +2 -0
- package/dist/tween/ease/type.js.map +1 -0
- package/dist/tween/eases.test.d.ts +2 -0
- package/dist/tween/eases.test.d.ts.map +1 -0
- package/dist/tween/eases.test.js +91 -0
- package/dist/tween/eases.test.js.map +1 -0
- package/dist/tween/generator.d.ts +22 -0
- package/dist/tween/generator.d.ts.map +1 -0
- package/dist/tween/generator.js +2 -0
- package/dist/tween/generator.js.map +1 -0
- package/dist/tween/index.d.ts +12 -0
- package/dist/tween/index.d.ts.map +1 -0
- package/dist/tween/index.js +12 -0
- package/dist/tween/index.js.map +1 -0
- package/dist/tween/lerp.d.ts +11 -0
- package/dist/tween/lerp.d.ts.map +1 -0
- package/dist/tween/lerp.js +13 -0
- package/dist/tween/lerp.js.map +1 -0
- package/dist/tween/lerp.test.d.ts +2 -0
- package/dist/tween/lerp.test.d.ts.map +1 -0
- package/dist/tween/lerp.test.js +22 -0
- package/dist/tween/lerp.test.js.map +1 -0
- package/dist/tween/parallel.d.ts +23 -0
- package/dist/tween/parallel.d.ts.map +1 -0
- package/dist/tween/parallel.js +79 -0
- package/dist/tween/parallel.js.map +1 -0
- package/dist/tween/prepare.d.ts +34 -0
- package/dist/tween/prepare.d.ts.map +1 -0
- package/dist/tween/prepare.js +52 -0
- package/dist/tween/prepare.js.map +1 -0
- package/dist/tween/prepare.test.d.ts +2 -0
- package/dist/tween/prepare.test.d.ts.map +1 -0
- package/dist/tween/prepare.test.js +44 -0
- package/dist/tween/prepare.test.js.map +1 -0
- package/dist/tween/sequence.d.ts +19 -0
- package/dist/tween/sequence.d.ts.map +1 -0
- package/dist/tween/sequence.js +22 -0
- package/dist/tween/sequence.js.map +1 -0
- package/dist/tween/sequence.test.d.ts +2 -0
- package/dist/tween/sequence.test.d.ts.map +1 -0
- package/dist/tween/sequence.test.js +68 -0
- package/dist/tween/sequence.test.js.map +1 -0
- package/dist/tween/stepper.d.ts +34 -0
- package/dist/tween/stepper.d.ts.map +1 -0
- package/dist/tween/stepper.js +4 -0
- package/dist/tween/stepper.js.map +1 -0
- package/dist/tween/tests/batched-parallel.test.d.ts +2 -0
- package/dist/tween/tests/batched-parallel.test.d.ts.map +1 -0
- package/dist/tween/tests/batched-parallel.test.js +76 -0
- package/dist/tween/tests/batched-parallel.test.js.map +1 -0
- package/dist/tween/tests/parallel.test.d.ts +2 -0
- package/dist/tween/tests/parallel.test.d.ts.map +1 -0
- package/dist/tween/tests/parallel.test.js +129 -0
- package/dist/tween/tests/parallel.test.js.map +1 -0
- package/dist/tween/tests/realtime.test.d.ts +2 -0
- package/dist/tween/tests/realtime.test.d.ts.map +1 -0
- package/dist/tween/tests/realtime.test.js +76 -0
- package/dist/tween/tests/realtime.test.js.map +1 -0
- package/dist/tween/tween.d.ts +18 -0
- package/dist/tween/tween.d.ts.map +1 -0
- package/dist/tween/tween.js +28 -0
- package/dist/tween/tween.js.map +1 -0
- package/dist/tween/tween.test.d.ts +2 -0
- package/dist/tween/tween.test.d.ts.map +1 -0
- package/dist/tween/tween.test.js +38 -0
- package/dist/tween/tween.test.js.map +1 -0
- package/dist/tween/wait.d.ts +19 -0
- package/dist/tween/wait.d.ts.map +1 -0
- package/dist/tween/wait.js +25 -0
- package/dist/tween/wait.js.map +1 -0
- package/dist/tween/wait.test.d.ts +2 -0
- package/dist/tween/wait.test.d.ts.map +1 -0
- package/dist/tween/wait.test.js +35 -0
- package/dist/tween/wait.test.js.map +1 -0
- package/dist/util/clamp.d.ts +12 -0
- package/dist/util/clamp.d.ts.map +1 -0
- package/dist/util/clamp.js +16 -0
- package/dist/util/clamp.js.map +1 -0
- package/dist/util/clamp.test.d.ts +2 -0
- package/dist/util/clamp.test.d.ts.map +1 -0
- package/dist/util/clamp.test.js +31 -0
- package/dist/util/clamp.test.js.map +1 -0
- package/dist/util/index.d.ts +4 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +4 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/random.d.ts +16 -0
- package/dist/util/random.d.ts.map +1 -0
- package/dist/util/random.js +28 -0
- package/dist/util/random.js.map +1 -0
- package/dist/util/random.test.d.ts +2 -0
- package/dist/util/random.test.d.ts.map +1 -0
- package/dist/util/random.test.js +42 -0
- package/dist/util/random.test.js.map +1 -0
- package/dist/util/range.d.ts +12 -0
- package/dist/util/range.d.ts.map +1 -0
- package/dist/util/range.js +11 -0
- package/dist/util/range.js.map +1 -0
- package/dist/util/reference.d.ts +15 -0
- package/dist/util/reference.d.ts.map +1 -0
- package/dist/util/reference.js +20 -0
- package/dist/util/reference.js.map +1 -0
- package/dist/util/reference.test.d.ts +2 -0
- package/dist/util/reference.test.d.ts.map +1 -0
- package/dist/util/reference.test.js +32 -0
- package/dist/util/reference.test.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Signal } from "../../signals/signal";
|
|
8
|
+
import { AnimationBuilder } from "../../tween/animation-builder";
|
|
9
|
+
import { prepareNumericCellTween } from "../../tween/prepare";
|
|
10
|
+
import { getPropertyMeta, property } from "../../attributes/properties/decorator";
|
|
11
|
+
import { lerpVector2 } from "../../attributes/layout/vector2";
|
|
12
|
+
import { resolveChainEffects } from "../../attributes/shape/effects/chain";
|
|
13
|
+
import { resolvePadding } from "../../attributes/layout/padding";
|
|
14
|
+
import { lerpEdgeInset, lerpSizeInput } from "../../layout/tweens";
|
|
15
|
+
import { lerpEffectArray } from "../../attributes/shape/effects/registry";
|
|
16
|
+
import { isAutoSize, resolveSize } from "../../layout/size-resolver";
|
|
17
|
+
/**
|
|
18
|
+
* Fractional offsets (0–1) of each anchor within the node's bounding box.
|
|
19
|
+
* `wx` = fraction of width, `hy` = fraction of height.
|
|
20
|
+
*/
|
|
21
|
+
const ANCHOR_OFFSETS = {
|
|
22
|
+
topLeft: { wx: 0, hy: 0 },
|
|
23
|
+
topCenter: { wx: 0.5, hy: 0 },
|
|
24
|
+
topRight: { wx: 1, hy: 0 },
|
|
25
|
+
leftCenter: { wx: 0, hy: 0.5 },
|
|
26
|
+
center: { wx: 0.5, hy: 0.5 },
|
|
27
|
+
rightCenter: { wx: 1, hy: 0.5 },
|
|
28
|
+
bottomLeft: { wx: 0, hy: 1 },
|
|
29
|
+
bottomCenter: { wx: 0.5, hy: 1 },
|
|
30
|
+
bottomRight: { wx: 1, hy: 1 },
|
|
31
|
+
};
|
|
32
|
+
const ANCHOR_KEYS = Object.keys(ANCHOR_OFFSETS);
|
|
33
|
+
/** Convert ANCHOR_OFFSETS fractions to a normalised pivot: wx=0→-1, wx=1→+1; hy=0→+1, hy=1→-1 */
|
|
34
|
+
function anchorToPivot(offset) {
|
|
35
|
+
return { x: (offset.wx - 0.5) * 2, y: -(offset.hy - 0.5) * 2 };
|
|
36
|
+
}
|
|
37
|
+
function validateAnchorProps(props) {
|
|
38
|
+
const presentAnchors = ANCHOR_KEYS.filter(k => props[k] !== undefined);
|
|
39
|
+
if (presentAnchors.length > 1) {
|
|
40
|
+
throw new Error(`Cannot set multiple anchor props at once: ${presentAnchors.join(', ')}`);
|
|
41
|
+
}
|
|
42
|
+
if (presentAnchors.length === 1 && props['pivot'] !== undefined) {
|
|
43
|
+
throw new Error(`Cannot set both anchor prop '${presentAnchors[0]}' and 'pivot' at the same time`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Base class for all scene-graph nodes.
|
|
48
|
+
*
|
|
49
|
+
* Every visible or structural element in a scene extends `Node`. It wires
|
|
50
|
+
* together three orthogonal systems:
|
|
51
|
+
*
|
|
52
|
+
* **Reactive properties** — fields declared with `@property()` are backed by
|
|
53
|
+
* `Signal`s. Reading them inside a reactive context (e.g. a render pass)
|
|
54
|
+
* creates a subscription; writing them propagates the change automatically.
|
|
55
|
+
* Use {@link set} to update one or more props imperatively, or pass a callback
|
|
56
|
+
* `() => expr` to bind the prop to a derived value.
|
|
57
|
+
*
|
|
58
|
+
* **Tweening** — `*to(props, duration, ease?)` is a generator that animates
|
|
59
|
+
* one or more props to target values over the given duration (in seconds).
|
|
60
|
+
* Numeric props are interpolated; props that register a custom `tween` fn (via
|
|
61
|
+
* `@property({ tween })`) can animate any value type. The convenience helpers
|
|
62
|
+
* `moveTo`, `moveX`, `moveY`, `fadeTo`, `rotateTo`, and `scaleTo` wrap `to`
|
|
63
|
+
* for the most common single-property animations.
|
|
64
|
+
*
|
|
65
|
+
* **Layout** — `measure()` is called top-down to resolve sizes, then
|
|
66
|
+
* `layout()` places the node in its allocated `BoxBounds`. Children are
|
|
67
|
+
* measured and laid out by the parent; the base class just stores the rect.
|
|
68
|
+
*
|
|
69
|
+
* ### Built-in visual props
|
|
70
|
+
* | prop | default | unit / notes |
|
|
71
|
+
* |-----------|----------|---------------------------------------|
|
|
72
|
+
* | `x` | 0 | horizontal offset in scene pixels |
|
|
73
|
+
* | `y` | 0 | vertical offset (positive = up) |
|
|
74
|
+
* | `width` | `'fill'` | `SizeInput`: px, `'fill'`, `'auto'` |
|
|
75
|
+
* | `height` | `'fill'` | same |
|
|
76
|
+
* | `scale` | 1 | uniform scale factor |
|
|
77
|
+
* | `rotate` | 0 | degrees, clockwise |
|
|
78
|
+
* | `opacity` | 1 | 0–1 |
|
|
79
|
+
* | `effects` | [] | post-process / blend effects |
|
|
80
|
+
* | `padding` | 0 | inner spacing, all four edges |
|
|
81
|
+
*/
|
|
82
|
+
export class Node {
|
|
83
|
+
_assets = null;
|
|
84
|
+
_parent = null;
|
|
85
|
+
get parent() {
|
|
86
|
+
return this._parent;
|
|
87
|
+
}
|
|
88
|
+
get assets() {
|
|
89
|
+
if (!this._assets)
|
|
90
|
+
throw new Error("AssetContext not bound — call bindAssets() before accessing assets");
|
|
91
|
+
return this._assets;
|
|
92
|
+
}
|
|
93
|
+
/** Returns the bound asset catalog, or null if this node hasn't been bound yet. */
|
|
94
|
+
tryAssets() {
|
|
95
|
+
return this._assets;
|
|
96
|
+
}
|
|
97
|
+
id = crypto.randomUUID();
|
|
98
|
+
__signals;
|
|
99
|
+
__upgraders;
|
|
100
|
+
__tweens;
|
|
101
|
+
/** Maps external prop value → internal cell value for fields that need it. */
|
|
102
|
+
__mappers;
|
|
103
|
+
_layoutRect = new Signal({ x: 0, y: 0, width: 0, height: 0 });
|
|
104
|
+
constraints;
|
|
105
|
+
/** The allocated bounding box from the last layout pass. Reactive — reads inside callbacks are tracked. */
|
|
106
|
+
get layoutRect() { return this._layoutRect.get(); }
|
|
107
|
+
_children = [];
|
|
108
|
+
constructor(props) {
|
|
109
|
+
if (props?.ref) {
|
|
110
|
+
props.ref(this);
|
|
111
|
+
}
|
|
112
|
+
// Apply all @property()-decorated fields, reading initial values from props.
|
|
113
|
+
for (const meta of getPropertyMeta(this)) {
|
|
114
|
+
const propsVal = props ? props[meta.key] : undefined;
|
|
115
|
+
const initial = propsVal !== undefined ? propsVal : meta.default;
|
|
116
|
+
this.applyProp(meta.key, initial, meta.options);
|
|
117
|
+
}
|
|
118
|
+
// Anchor-based positioning: validate, derive pivot, bind x/y.
|
|
119
|
+
if (props) {
|
|
120
|
+
validateAnchorProps(props);
|
|
121
|
+
const anchorKey = ANCHOR_KEYS.find(k => props[k] !== undefined);
|
|
122
|
+
if (anchorKey) {
|
|
123
|
+
const raw = props[anchorKey];
|
|
124
|
+
const getTarget = typeof raw === 'function' ? raw : () => raw;
|
|
125
|
+
const offset = ANCHOR_OFFSETS[anchorKey];
|
|
126
|
+
this._writeProp('pivot', anchorToPivot(offset));
|
|
127
|
+
this._writeProp('x', () => {
|
|
128
|
+
const r = this._layoutRect.get();
|
|
129
|
+
return getTarget().x + (0.5 - offset.wx) * r.width;
|
|
130
|
+
});
|
|
131
|
+
this._writeProp('y', () => {
|
|
132
|
+
const r = this._layoutRect.get();
|
|
133
|
+
return getTarget().y - (0.5 - offset.hy) * r.height;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (props && props.children) {
|
|
138
|
+
const raw = Array.isArray(props.children) ? props.children : [props.children];
|
|
139
|
+
const flat = raw.flat(Infinity)
|
|
140
|
+
.filter((c) => c instanceof Node);
|
|
141
|
+
if (flat.length > 0)
|
|
142
|
+
this.addChildren(flat);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// ---- Reactive properties ----------------------------------------------
|
|
146
|
+
/**
|
|
147
|
+
* Declare a reactive prop on this node. Creates a Signal-backed
|
|
148
|
+
* accessor for `field`, applies an initial value (callback → reactive
|
|
149
|
+
* binding; otherwise constant), and registers optional tween/mapper
|
|
150
|
+
* metadata used by `set()` and `to()`.
|
|
151
|
+
*
|
|
152
|
+
* Subsequent calls for the same field reuse the existing cell and act as
|
|
153
|
+
* a value assignment, so subclasses can override a parent's default by
|
|
154
|
+
* calling applyProp again without losing the cell or its bindings.
|
|
155
|
+
*/
|
|
156
|
+
applyProp(field, initial, options) {
|
|
157
|
+
const existing = this.__signals?.get(field);
|
|
158
|
+
if (!existing) {
|
|
159
|
+
this._registerProp(field, options);
|
|
160
|
+
}
|
|
161
|
+
else if (options) {
|
|
162
|
+
// Allow subclasses to refine tween/mapper on an inherited field.
|
|
163
|
+
if (options.tween) {
|
|
164
|
+
if (!this.__tweens)
|
|
165
|
+
this.__tweens = new Map();
|
|
166
|
+
this.__tweens.set(field, options.tween);
|
|
167
|
+
}
|
|
168
|
+
if (options.mapper) {
|
|
169
|
+
if (!this.__mappers)
|
|
170
|
+
this.__mappers = new Map();
|
|
171
|
+
this.__mappers.set(field, options.mapper);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
this._writeProp(field, initial);
|
|
175
|
+
}
|
|
176
|
+
_registerProp(field, options) {
|
|
177
|
+
const cell = new Signal(undefined);
|
|
178
|
+
if (!this.__signals)
|
|
179
|
+
this.__signals = new Map();
|
|
180
|
+
this.__signals.set(field, cell);
|
|
181
|
+
if (!this.__upgraders)
|
|
182
|
+
this.__upgraders = new Map();
|
|
183
|
+
this.__upgraders.set(field, () => cell);
|
|
184
|
+
if (options?.tween) {
|
|
185
|
+
if (!this.__tweens)
|
|
186
|
+
this.__tweens = new Map();
|
|
187
|
+
this.__tweens.set(field, options.tween);
|
|
188
|
+
}
|
|
189
|
+
if (options?.mapper) {
|
|
190
|
+
if (!this.__mappers)
|
|
191
|
+
this.__mappers = new Map();
|
|
192
|
+
this.__mappers.set(field, options.mapper);
|
|
193
|
+
}
|
|
194
|
+
if (options?.layout) {
|
|
195
|
+
cell.subscribe(() => this._markLayoutDirty());
|
|
196
|
+
}
|
|
197
|
+
Object.defineProperty(this, field, {
|
|
198
|
+
get: () => cell.get(),
|
|
199
|
+
set: (value) => this._writeProp(field, value),
|
|
200
|
+
enumerable: true,
|
|
201
|
+
configurable: true,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
_writeProp(field, value) {
|
|
205
|
+
if (value === undefined)
|
|
206
|
+
return;
|
|
207
|
+
const cell = this.__signals.get(field);
|
|
208
|
+
const mapper = this.__mappers?.get(field);
|
|
209
|
+
if (typeof value === "function") {
|
|
210
|
+
const extFn = value;
|
|
211
|
+
cell.bind(mapper ? () => mapper(extFn(), cell.get()) : extFn);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
cell.set(mapper ? mapper(value, cell.get()) : value);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
get properties() {
|
|
218
|
+
const result = {};
|
|
219
|
+
if (this.__upgraders) {
|
|
220
|
+
for (const key of this.__upgraders.keys()) {
|
|
221
|
+
result[key] = this[key];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
get name() {
|
|
227
|
+
return this.constructor.name;
|
|
228
|
+
}
|
|
229
|
+
set(props) {
|
|
230
|
+
const signals = this.__signals;
|
|
231
|
+
if (!signals)
|
|
232
|
+
return;
|
|
233
|
+
// Iterate the caller's keys (usually 1–3) rather than every registered
|
|
234
|
+
// signal (15+): set() runs in the per-frame hot path. Only keys backed
|
|
235
|
+
// by a signal are written; unknown keys are ignored as before.
|
|
236
|
+
for (const key in props) {
|
|
237
|
+
const val = props[key];
|
|
238
|
+
if (val !== undefined && signals.has(key))
|
|
239
|
+
this._writeProp(key, val);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
to(to, duration, easing) {
|
|
243
|
+
return new AnimationBuilder(this, { to, duration, easing });
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Resolve a single `to()` step into a flat {@link TweenStepper} — all the
|
|
247
|
+
* per-key setup (anchor handling, mapper, numeric-vs-custom routing) happens
|
|
248
|
+
* once here, then `advance(dt)` is allocation-free. Used by both the
|
|
249
|
+
* generator path (`_toGen`) and the batched `parallel` path.
|
|
250
|
+
*/
|
|
251
|
+
_prepareStep(to, duration, easing) {
|
|
252
|
+
validateAnchorProps(to);
|
|
253
|
+
// If an anchor key is in the tween target, resolve it to x/y targets and set pivot.
|
|
254
|
+
const anchorKey = ANCHOR_KEYS.find(k => to[k] !== undefined);
|
|
255
|
+
if (anchorKey) {
|
|
256
|
+
const raw = to[anchorKey];
|
|
257
|
+
const offset = ANCHOR_OFFSETS[anchorKey];
|
|
258
|
+
const r = this._layoutRect.get();
|
|
259
|
+
this._writeProp('pivot', anchorToPivot(offset));
|
|
260
|
+
to.x = raw.x + (0.5 - offset.wx) * r.width;
|
|
261
|
+
to.y = raw.y - (0.5 - offset.hy) * r.height;
|
|
262
|
+
}
|
|
263
|
+
// Numeric, mapper-free props (x/y/scale/rotation/opacity) write straight
|
|
264
|
+
// to their cell — no property-setter / mapper indirection per step.
|
|
265
|
+
const numCells = [];
|
|
266
|
+
const numFrom = [];
|
|
267
|
+
const numEnd = [];
|
|
268
|
+
const customLerps = [];
|
|
269
|
+
const stringSnaps = [];
|
|
270
|
+
for (const key of Object.keys(to)) {
|
|
271
|
+
const cell = this.__signals?.get(key);
|
|
272
|
+
if (!cell)
|
|
273
|
+
continue;
|
|
274
|
+
const extVal = to[key];
|
|
275
|
+
// Map external → internal so the tween operates in stored space.
|
|
276
|
+
const mapper = this.__mappers?.get(key);
|
|
277
|
+
const targetVal = mapper ? mapper(extVal, this[key]) : extVal;
|
|
278
|
+
const tweenFn = this.__tweens?.get(key);
|
|
279
|
+
if (tweenFn) {
|
|
280
|
+
const from = this[key];
|
|
281
|
+
customLerps.push((t) => {
|
|
282
|
+
cell.set(tweenFn(from, targetVal, t));
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
else if (typeof targetVal === 'number') {
|
|
286
|
+
if (mapper) {
|
|
287
|
+
// Numeric but mapped: keep the setter path so the mapper runs.
|
|
288
|
+
const from = this[key];
|
|
289
|
+
customLerps.push((t) => { this[key] = from + (targetVal - from) * t; });
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
numCells.push(cell);
|
|
293
|
+
numFrom.push(this[key]);
|
|
294
|
+
numEnd.push(targetVal);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else if (typeof targetVal === 'string') {
|
|
298
|
+
stringSnaps.push([key, targetVal]);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const lerp = prepareNumericCellTween(numCells, numFrom, numEnd);
|
|
302
|
+
const hasCustom = customLerps.length > 0;
|
|
303
|
+
const hasSnaps = stringSnaps.length > 0;
|
|
304
|
+
const apply = (t) => {
|
|
305
|
+
const easedT = easing ? easing(t) : t;
|
|
306
|
+
lerp(easedT);
|
|
307
|
+
if (hasCustom)
|
|
308
|
+
for (const fn of customLerps)
|
|
309
|
+
fn(easedT);
|
|
310
|
+
};
|
|
311
|
+
let elapsed = 0;
|
|
312
|
+
return {
|
|
313
|
+
seek: (e) => apply(duration > 0 ? Math.min(e / duration, 1) : 1),
|
|
314
|
+
advance: (dt) => {
|
|
315
|
+
elapsed += dt;
|
|
316
|
+
if (elapsed < duration) {
|
|
317
|
+
apply(elapsed / duration);
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
apply(1);
|
|
321
|
+
if (hasSnaps)
|
|
322
|
+
for (const [key, val] of stringSnaps)
|
|
323
|
+
this[key] = val;
|
|
324
|
+
return true;
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
*_toGen(to, duration, easing) {
|
|
329
|
+
const step = this._prepareStep(to, duration, easing);
|
|
330
|
+
step.seek(0);
|
|
331
|
+
let done = false;
|
|
332
|
+
while (!done) {
|
|
333
|
+
const dt = yield;
|
|
334
|
+
done = step.advance(dt);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// ---- Motion helpers ---------------------------------------------------
|
|
338
|
+
/**
|
|
339
|
+
* Animate both `x` and `y` to the given position.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* yield* node.moveTo(200, 100, 0.5, ease.outCubic);
|
|
343
|
+
*/
|
|
344
|
+
*moveTo(x, y, duration, ease) {
|
|
345
|
+
return yield* this.to({ x, y }, duration, ease);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Animate only the horizontal position (`x`).
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* yield* node.moveX(300, 0.4);
|
|
352
|
+
*/
|
|
353
|
+
*moveX(x, duration, ease) {
|
|
354
|
+
return yield* this.to({ x }, duration, ease);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Animate only the vertical position (`y`).
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* yield* node.moveY(-50, 0.4);
|
|
361
|
+
*/
|
|
362
|
+
*moveY(y, duration, ease) {
|
|
363
|
+
return yield* this.to({ y }, duration, ease);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Animate `opacity` to the target value.
|
|
367
|
+
*
|
|
368
|
+
* @param opacity Target opacity in the range `[0, 1]`.
|
|
369
|
+
* @example
|
|
370
|
+
* yield* node.fadeTo(0, 0.3); // fade out
|
|
371
|
+
* yield* node.fadeTo(1, 0.3); // fade in
|
|
372
|
+
*/
|
|
373
|
+
*fadeTo(opacity, duration, ease) {
|
|
374
|
+
return yield* this.to({ opacity }, duration, ease);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Animate `rotate` to the target angle (degrees, clockwise).
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* yield* node.rotateTo(180, 0.6, ease.inOutQuad);
|
|
381
|
+
*/
|
|
382
|
+
*rotateTo(rotation, duration, ease) {
|
|
383
|
+
return yield* this.to({ rotation }, duration, ease);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Animate `scale` to the target factor.
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* yield* node.scaleTo(1.5, 0.4); // grow
|
|
390
|
+
* yield* node.scaleTo(0, 0.3); // shrink to nothing
|
|
391
|
+
*/
|
|
392
|
+
*scaleTo(scale, duration, ease) {
|
|
393
|
+
return yield* this.to({ scale }, duration, ease);
|
|
394
|
+
}
|
|
395
|
+
// ---- Clock ------------------------------------------------------------
|
|
396
|
+
_clock = {
|
|
397
|
+
time: 0,
|
|
398
|
+
creation: 0,
|
|
399
|
+
elapsed: 0,
|
|
400
|
+
initialized: false,
|
|
401
|
+
};
|
|
402
|
+
tick(_globalTime) {
|
|
403
|
+
}
|
|
404
|
+
/** Internal timing state. */
|
|
405
|
+
get clock() {
|
|
406
|
+
return this._clock;
|
|
407
|
+
}
|
|
408
|
+
ellapse(totalTime) {
|
|
409
|
+
if (!this._clock.initialized) {
|
|
410
|
+
this._clock.creation = totalTime;
|
|
411
|
+
this._clock.initialized = true;
|
|
412
|
+
}
|
|
413
|
+
this._clock.time = totalTime;
|
|
414
|
+
this._clock.elapsed = totalTime - this._clock.creation;
|
|
415
|
+
this.tick(this._clock.time);
|
|
416
|
+
for (const child of this._children)
|
|
417
|
+
child.ellapse(totalTime);
|
|
418
|
+
}
|
|
419
|
+
// ---- Asset lifecycle --------------------------------------------------
|
|
420
|
+
bindAssets(context) {
|
|
421
|
+
this._assets = context;
|
|
422
|
+
for (const child of this._children)
|
|
423
|
+
child.bindAssets(context);
|
|
424
|
+
}
|
|
425
|
+
prepare(_storage) {
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Audio clips this node owns, surfaced to the timeline as waveforms. The
|
|
429
|
+
* base node has no audio; nodes that do (e.g. {@link Scene}) override this.
|
|
430
|
+
* Returns undefined when there is nothing to show.
|
|
431
|
+
*/
|
|
432
|
+
waveform() {
|
|
433
|
+
return undefined;
|
|
434
|
+
}
|
|
435
|
+
prepareAssets(storage) {
|
|
436
|
+
this.prepare(storage);
|
|
437
|
+
for (const child of this._children)
|
|
438
|
+
child.prepareAssets(storage);
|
|
439
|
+
}
|
|
440
|
+
// ---- Layout queries ---------------------------------------------------
|
|
441
|
+
get measuredWidth() {
|
|
442
|
+
return this.layoutRect.width;
|
|
443
|
+
}
|
|
444
|
+
get measuredHeight() {
|
|
445
|
+
return this.layoutRect.height;
|
|
446
|
+
}
|
|
447
|
+
// ---- Anchor points ----------------------------------------------------
|
|
448
|
+
// All getters read the reactive layoutRect signal AND the reactive x/y/rotation
|
|
449
|
+
// signals, so any callback that reads them will re-evaluate on any change.
|
|
450
|
+
/** Rotate offset (ox, oy) by this node's rotation (degrees clockwise) around the node center. */
|
|
451
|
+
_rotateOffset(ox, oy) {
|
|
452
|
+
const deg = this.rotation;
|
|
453
|
+
if (deg === 0)
|
|
454
|
+
return { x: this.x + ox, y: this.y + oy };
|
|
455
|
+
const rad = (deg * Math.PI) / 180;
|
|
456
|
+
const cos = Math.cos(rad);
|
|
457
|
+
const sin = Math.sin(rad);
|
|
458
|
+
// Canvas rotation is clockwise; in y-up space that means x'= cos*ox + sin*oy, y'= -sin*ox + cos*oy
|
|
459
|
+
return {
|
|
460
|
+
x: this.x + cos * ox + sin * oy,
|
|
461
|
+
y: this.y - sin * ox + cos * oy,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/** Center of the node — equivalent to its x/y position (0,0 is the center of the layout cell). */
|
|
465
|
+
get center() {
|
|
466
|
+
return { x: this.x, y: this.y };
|
|
467
|
+
}
|
|
468
|
+
get topLeft() {
|
|
469
|
+
const r = this.layoutRect;
|
|
470
|
+
return this._rotateOffset(-r.width / 2, r.height / 2);
|
|
471
|
+
}
|
|
472
|
+
get topRight() {
|
|
473
|
+
const r = this.layoutRect;
|
|
474
|
+
return this._rotateOffset(r.width / 2, r.height / 2);
|
|
475
|
+
}
|
|
476
|
+
get bottomLeft() {
|
|
477
|
+
const r = this.layoutRect;
|
|
478
|
+
return this._rotateOffset(-r.width / 2, -r.height / 2);
|
|
479
|
+
}
|
|
480
|
+
get bottomRight() {
|
|
481
|
+
const r = this.layoutRect;
|
|
482
|
+
return this._rotateOffset(r.width / 2, -r.height / 2);
|
|
483
|
+
}
|
|
484
|
+
get topCenter() {
|
|
485
|
+
const r = this.layoutRect;
|
|
486
|
+
return this._rotateOffset(0, r.height / 2);
|
|
487
|
+
}
|
|
488
|
+
get bottomCenter() {
|
|
489
|
+
const r = this.layoutRect;
|
|
490
|
+
return this._rotateOffset(0, -r.height / 2);
|
|
491
|
+
}
|
|
492
|
+
get leftCenter() {
|
|
493
|
+
const r = this.layoutRect;
|
|
494
|
+
return this._rotateOffset(-r.width / 2, 0);
|
|
495
|
+
}
|
|
496
|
+
get rightCenter() {
|
|
497
|
+
const r = this.layoutRect;
|
|
498
|
+
return this._rotateOffset(r.width / 2, 0);
|
|
499
|
+
}
|
|
500
|
+
isAutoSize(axis) {
|
|
501
|
+
return isAutoSize(axis === "width" ? this.width : this.height);
|
|
502
|
+
}
|
|
503
|
+
resolveSizeInput(sizeInput, availableSize, childrenSize) {
|
|
504
|
+
return resolveSize(sizeInput, availableSize, childrenSize);
|
|
505
|
+
}
|
|
506
|
+
// ---- Child management -------------------------------------------------
|
|
507
|
+
get children() {
|
|
508
|
+
return this._children;
|
|
509
|
+
}
|
|
510
|
+
addChild(child) {
|
|
511
|
+
this._children.push(child);
|
|
512
|
+
child._parent = this;
|
|
513
|
+
this._markLayoutDirty();
|
|
514
|
+
const assets = this.tryAssets();
|
|
515
|
+
if (assets)
|
|
516
|
+
child.bindAssets(assets);
|
|
517
|
+
}
|
|
518
|
+
removeChild(child) {
|
|
519
|
+
const i = this._children.indexOf(child);
|
|
520
|
+
if (i < 0)
|
|
521
|
+
return null;
|
|
522
|
+
const [removed] = this._children.splice(i, 1);
|
|
523
|
+
if (removed)
|
|
524
|
+
removed._parent = null;
|
|
525
|
+
this._markLayoutDirty();
|
|
526
|
+
return removed ?? null;
|
|
527
|
+
}
|
|
528
|
+
addChildren(children) {
|
|
529
|
+
this._children.push(...children);
|
|
530
|
+
for (const child of children)
|
|
531
|
+
child._parent = this;
|
|
532
|
+
this._markLayoutDirty();
|
|
533
|
+
const assets = this.tryAssets();
|
|
534
|
+
if (assets)
|
|
535
|
+
for (const child of children)
|
|
536
|
+
child.bindAssets(assets);
|
|
537
|
+
}
|
|
538
|
+
clearChildren() {
|
|
539
|
+
for (const child of this._children)
|
|
540
|
+
child._parent = null;
|
|
541
|
+
this._children.length = 0;
|
|
542
|
+
this._markLayoutDirty();
|
|
543
|
+
}
|
|
544
|
+
addChildAt(child, index, duration, easing) {
|
|
545
|
+
if (duration === undefined) {
|
|
546
|
+
this._children.splice(index, 0, child);
|
|
547
|
+
child._parent = this;
|
|
548
|
+
this._markLayoutDirty();
|
|
549
|
+
const assets = this.tryAssets();
|
|
550
|
+
if (assets)
|
|
551
|
+
child.bindAssets(assets);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
return this._addChildAtAnimated(child, index, duration, easing);
|
|
555
|
+
}
|
|
556
|
+
removeChildAt(index, duration, easing) {
|
|
557
|
+
if (duration === undefined) {
|
|
558
|
+
if (index < 0 || index >= this._children.length)
|
|
559
|
+
return null;
|
|
560
|
+
const [removed] = this._children.splice(index, 1);
|
|
561
|
+
if (removed)
|
|
562
|
+
removed._parent = null;
|
|
563
|
+
this._markLayoutDirty();
|
|
564
|
+
return removed ?? null;
|
|
565
|
+
}
|
|
566
|
+
return this._removeChildAtAnimated(index, duration, easing);
|
|
567
|
+
}
|
|
568
|
+
// ---- Rendering --------------------------------------------------------
|
|
569
|
+
// Reused each frame so applyTransform doesn't allocate a fresh descriptor
|
|
570
|
+
// per node per frame. ctx.transform reads it synchronously and never retains
|
|
571
|
+
// it, so a single mutated instance is safe.
|
|
572
|
+
_transformScratch = {
|
|
573
|
+
x: 0, y: 0, width: 0, height: 0,
|
|
574
|
+
scale: 1, rotation: 0, opacity: 1,
|
|
575
|
+
effects: [], pivot: { x: 0, y: 0 },
|
|
576
|
+
};
|
|
577
|
+
/** Push this node's transform (position, scale, rotate, opacity, effects). */
|
|
578
|
+
applyTransform(ctx) {
|
|
579
|
+
const r = this.layoutRect;
|
|
580
|
+
const s = this._transformScratch;
|
|
581
|
+
s.x = (r?.x ?? 0) + this.x;
|
|
582
|
+
s.y = (r?.y ?? 0) - this.y;
|
|
583
|
+
s.width = r?.width ?? 0;
|
|
584
|
+
s.height = r?.height ?? 0;
|
|
585
|
+
s.scale = this.scale;
|
|
586
|
+
s.rotation = this.rotation;
|
|
587
|
+
s.opacity = this.opacity;
|
|
588
|
+
s.effects = this.effects;
|
|
589
|
+
s.pivot = this.pivot;
|
|
590
|
+
ctx.transform(s);
|
|
591
|
+
}
|
|
592
|
+
onRender(ctx) {
|
|
593
|
+
this.applyTransform(ctx);
|
|
594
|
+
this.renderChildren(ctx);
|
|
595
|
+
}
|
|
596
|
+
renderChildren(ctx) {
|
|
597
|
+
for (const child of this._children)
|
|
598
|
+
child.render(ctx);
|
|
599
|
+
}
|
|
600
|
+
beforeRender(ctx) {
|
|
601
|
+
ctx.begin(this.id, this._spaceRects());
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Reference rects for fills with `space:'parent'`, expressed in this node's
|
|
605
|
+
* local space (origin = this node's positioned centre, y-down to match the
|
|
606
|
+
* canvas). The viewport (`space:'view'`) is resolved by the renderer, which
|
|
607
|
+
* knows the surface size. Rotation/scale of this node are not folded in —
|
|
608
|
+
* the rect is the axis-aligned parent box, which is what gradients expect.
|
|
609
|
+
*/
|
|
610
|
+
_spaceRects() {
|
|
611
|
+
const parent = this._parent;
|
|
612
|
+
if (!parent)
|
|
613
|
+
return {};
|
|
614
|
+
const p = parent.layoutRect;
|
|
615
|
+
const r = this.layoutRect;
|
|
616
|
+
// This node's local origin within the parent's space.
|
|
617
|
+
const ox = r.x + this.x;
|
|
618
|
+
const oy = r.y - this.y;
|
|
619
|
+
return {
|
|
620
|
+
parent: {
|
|
621
|
+
left: -p.width / 2 - ox,
|
|
622
|
+
top: -p.height / 2 - oy,
|
|
623
|
+
right: p.width / 2 - ox,
|
|
624
|
+
bottom: p.height / 2 - oy,
|
|
625
|
+
},
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
afterRender(ctx) {
|
|
629
|
+
ctx.end();
|
|
630
|
+
}
|
|
631
|
+
render(ctx) {
|
|
632
|
+
this.beforeRender(ctx);
|
|
633
|
+
this.onRender(ctx);
|
|
634
|
+
this.afterRender(ctx);
|
|
635
|
+
}
|
|
636
|
+
// ---- Layout -----------------------------------------------------------
|
|
637
|
+
_measuredSize = {};
|
|
638
|
+
_layoutDirty = true;
|
|
639
|
+
/**
|
|
640
|
+
* Mark this node's layout stale and bubble the flag to ancestors. A child's
|
|
641
|
+
* size change reflows its parent's layout, so the parent must re-run too.
|
|
642
|
+
* Subscribed to layout-affecting props (see @property `layout`) and invoked
|
|
643
|
+
* directly on child-list mutations. x/y are *not* layout props — they're
|
|
644
|
+
* applied at render time and never invalidate layout.
|
|
645
|
+
*/
|
|
646
|
+
_markLayoutDirty() {
|
|
647
|
+
let node = this;
|
|
648
|
+
while (node && !node._layoutDirty) {
|
|
649
|
+
node._layoutDirty = true;
|
|
650
|
+
node = node._parent;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
layout(rect, _scope) {
|
|
654
|
+
this._layoutRect.set(rect);
|
|
655
|
+
this._layoutDirty = false;
|
|
656
|
+
}
|
|
657
|
+
measure(constraints, _scope) {
|
|
658
|
+
this.constraints = constraints;
|
|
659
|
+
const maxW = constraints.maxWidth ?? 0;
|
|
660
|
+
const maxH = constraints.maxHeight ?? 0;
|
|
661
|
+
this._measuredSize.width = resolveSize(this.width, maxW, 0);
|
|
662
|
+
this._measuredSize.height = resolveSize(this.height, maxH, 0);
|
|
663
|
+
return this._measuredSize;
|
|
664
|
+
}
|
|
665
|
+
reparent(newParent, duration, easing) {
|
|
666
|
+
if (duration === undefined) {
|
|
667
|
+
const old = this.parent;
|
|
668
|
+
if (old)
|
|
669
|
+
old.removeChild(this);
|
|
670
|
+
newParent.addChild(this);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
return this._reparentAnimated(newParent, duration, easing);
|
|
674
|
+
}
|
|
675
|
+
*_reparentAnimated(newParent, duration, easing) {
|
|
676
|
+
const half = duration / 2;
|
|
677
|
+
const targetOpacity = this.opacity;
|
|
678
|
+
// Pin to current rendered size so exit shrink reflows the old parent.
|
|
679
|
+
const lw = this.layoutRect?.width;
|
|
680
|
+
const lh = this.layoutRect?.height;
|
|
681
|
+
const hasSizeAnim = lw !== undefined && lh !== undefined;
|
|
682
|
+
if (hasSizeAnim) {
|
|
683
|
+
this.set({ width: lw, height: lh });
|
|
684
|
+
}
|
|
685
|
+
const exitProps = { opacity: 0 };
|
|
686
|
+
if (hasSizeAnim) {
|
|
687
|
+
exitProps.width = 0;
|
|
688
|
+
exitProps.height = 0;
|
|
689
|
+
}
|
|
690
|
+
yield* this.to(exitProps, half, easing);
|
|
691
|
+
const old = this.parent;
|
|
692
|
+
if (old)
|
|
693
|
+
old.removeChild(this);
|
|
694
|
+
newParent.addChild(this);
|
|
695
|
+
const enterProps = { opacity: targetOpacity };
|
|
696
|
+
if (hasSizeAnim) {
|
|
697
|
+
enterProps.width = lw;
|
|
698
|
+
enterProps.height = lh;
|
|
699
|
+
}
|
|
700
|
+
yield* this.to(enterProps, half, easing);
|
|
701
|
+
}
|
|
702
|
+
*_addChildAtAnimated(child, index, duration, easing) {
|
|
703
|
+
const targetOpacity = child.opacity;
|
|
704
|
+
const isNumericW = typeof child.width === 'number';
|
|
705
|
+
const isNumericH = typeof child.height === 'number';
|
|
706
|
+
const targetW = isNumericW ? child.width : 0;
|
|
707
|
+
const targetH = isNumericH ? child.height : 0;
|
|
708
|
+
child.set({
|
|
709
|
+
opacity: 0,
|
|
710
|
+
width: isNumericW ? 0 : undefined,
|
|
711
|
+
height: isNumericH ? 0 : undefined,
|
|
712
|
+
});
|
|
713
|
+
this._children.splice(index, 0, child);
|
|
714
|
+
child._parent = this;
|
|
715
|
+
this._markLayoutDirty();
|
|
716
|
+
const assets = this.tryAssets();
|
|
717
|
+
if (assets)
|
|
718
|
+
child.bindAssets(assets);
|
|
719
|
+
const toProps = { opacity: targetOpacity };
|
|
720
|
+
if (isNumericW)
|
|
721
|
+
toProps.width = targetW;
|
|
722
|
+
if (isNumericH)
|
|
723
|
+
toProps.height = targetH;
|
|
724
|
+
yield* child.to(toProps, duration, easing);
|
|
725
|
+
}
|
|
726
|
+
*_removeChildAtAnimated(index, duration, easing) {
|
|
727
|
+
if (index < 0 || index >= this._children.length)
|
|
728
|
+
return;
|
|
729
|
+
const child = this._children[index];
|
|
730
|
+
// Pin to current rendered size so the shrink reflows siblings in the parent layout.
|
|
731
|
+
const lw = child.layoutRect?.width;
|
|
732
|
+
const lh = child.layoutRect?.height;
|
|
733
|
+
child.set({ width: lw, height: lh });
|
|
734
|
+
const toProps = { opacity: 0 };
|
|
735
|
+
if (lw !== undefined)
|
|
736
|
+
toProps.width = 0;
|
|
737
|
+
if (lh !== undefined)
|
|
738
|
+
toProps.height = 0;
|
|
739
|
+
yield* child.to(toProps, duration, easing);
|
|
740
|
+
this._children.splice(index, 1);
|
|
741
|
+
child._parent = null;
|
|
742
|
+
this._markLayoutDirty();
|
|
743
|
+
}
|
|
744
|
+
// ---- Teardown ---------------------------------------------------------
|
|
745
|
+
dispose() {
|
|
746
|
+
if (this.__signals) {
|
|
747
|
+
for (const cell of this.__signals.values()) {
|
|
748
|
+
cell.dispose();
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
this.__signals = undefined;
|
|
752
|
+
this.__upgraders = undefined;
|
|
753
|
+
this.__tweens = undefined;
|
|
754
|
+
this.__mappers = undefined;
|
|
755
|
+
this._assets = null;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
__decorate([
|
|
759
|
+
property({ default: 0 })
|
|
760
|
+
], Node.prototype, "x", void 0);
|
|
761
|
+
__decorate([
|
|
762
|
+
property({ default: 0 })
|
|
763
|
+
], Node.prototype, "y", void 0);
|
|
764
|
+
__decorate([
|
|
765
|
+
property({ default: 'fill', tween: lerpSizeInput, layout: true })
|
|
766
|
+
], Node.prototype, "width", void 0);
|
|
767
|
+
__decorate([
|
|
768
|
+
property({ default: 'fill', tween: lerpSizeInput, layout: true })
|
|
769
|
+
], Node.prototype, "height", void 0);
|
|
770
|
+
__decorate([
|
|
771
|
+
property({ default: 1 })
|
|
772
|
+
], Node.prototype, "scale", void 0);
|
|
773
|
+
__decorate([
|
|
774
|
+
property({ default: 0 })
|
|
775
|
+
], Node.prototype, "rotation", void 0);
|
|
776
|
+
__decorate([
|
|
777
|
+
property({ default: 1 })
|
|
778
|
+
], Node.prototype, "opacity", void 0);
|
|
779
|
+
__decorate([
|
|
780
|
+
property({ default: [], tween: lerpEffectArray, mapper: resolveChainEffects })
|
|
781
|
+
], Node.prototype, "effects", void 0);
|
|
782
|
+
__decorate([
|
|
783
|
+
property({ default: 0, mapper: resolvePadding, tween: lerpEdgeInset, layout: true })
|
|
784
|
+
], Node.prototype, "padding", void 0);
|
|
785
|
+
__decorate([
|
|
786
|
+
property({ default: { x: 0, y: 0 }, tween: lerpVector2 })
|
|
787
|
+
], Node.prototype, "pivot", void 0);
|
|
788
|
+
__decorate([
|
|
789
|
+
property({ default: undefined })
|
|
790
|
+
], Node.prototype, "column", void 0);
|
|
791
|
+
__decorate([
|
|
792
|
+
property({ default: undefined })
|
|
793
|
+
], Node.prototype, "row", void 0);
|
|
794
|
+
__decorate([
|
|
795
|
+
property({ default: 1 })
|
|
796
|
+
], Node.prototype, "colSpan", void 0);
|
|
797
|
+
__decorate([
|
|
798
|
+
property({ default: 1 })
|
|
799
|
+
], Node.prototype, "rowSpan", void 0);
|
|
800
|
+
//# sourceMappingURL=node.js.map
|