bard-legends-framework 0.11.0 → 0.12.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/dist/actions-performance.test.d.ts +1 -0
- package/dist/actions-performance.test.js +83 -0
- package/dist/game-entities/controller/controller.d.ts +2 -2
- package/dist/game-entities/controller/controller.js +8 -8
- package/dist/game-entities/controller/controller.test.js +2 -2
- package/dist/game-entities/entity/entity.d.ts +7 -7
- package/dist/game-entities/entity/entity.js +18 -12
- package/dist/game-entities/entity/entity.test.js +93 -30
- package/dist/game-entities/entity/helpers/entity-store.helper.d.ts +3 -3
- package/dist/game-entities/entity/helpers/entity-store.helper.js +12 -12
- package/dist/game-entities/entity/helpers/entity-store.helper.test.js +11 -11
- package/dist/game-entities/entity/helpers/entity-views.helper.d.ts +6 -6
- package/dist/game-entities/entity/helpers/entity-views.helper.js +25 -22
- package/dist/game-entities/entity/singleton-entity.test.js +9 -4
- package/dist/game-entities/hard-reset.d.ts +5 -0
- package/dist/game-entities/hard-reset.js +14 -0
- package/dist/game-entities/index.d.ts +1 -1
- package/dist/game-entities/index.js +3 -3
- package/dist/game-entities/scene/scene.d.ts +13 -13
- package/dist/game-entities/scene/scene.js +41 -46
- package/dist/game-entities/scene/scene.test.js +95 -37
- package/dist/game-entities/service/service.d.ts +1 -4
- package/dist/game-entities/service/service.js +12 -13
- package/dist/game-entities/service/service.test.js +33 -12
- package/dist/game-entities/unit-test.helper.js +1 -1
- package/dist/game-entities/update-cycle.d.ts +7 -17
- package/dist/game-entities/update-cycle.js +25 -19
- package/dist/game-entities/view/view.d.ts +6 -6
- package/dist/game-entities/view/view.js +15 -21
- package/dist/game-entities/view/view.test.js +40 -9
- package/dist/physics/entity-types/immovable-physics-entity.d.ts +1 -1
- package/dist/physics/entity-types/immovable-physics-entity.js +4 -4
- package/dist/physics/entity-types/movable-entity.d.ts +1 -1
- package/dist/physics/entity-types/movable-entity.js +2 -2
- package/dist/physics/entity-types/movable-physics-entity.d.ts +8 -8
- package/dist/physics/entity-types/movable-physics-entity.js +27 -27
- package/dist/physics/entity-types/physics-entity.d.ts +10 -14
- package/dist/physics/entity-types/physics-entity.js +27 -26
- package/dist/physics/interfaces.d.ts +6 -6
- package/dist/physics/interfaces.js +4 -4
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.d.ts +16 -16
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.js +22 -22
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.d.ts +19 -19
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.js +30 -30
- package/dist/physics/module//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +3 -3
- package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.d.ts +10 -10
- package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.js +16 -16
- package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.d.ts +10 -10
- package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.js +18 -18
- package/dist/physics/module//360/237/223/220services/collision/collisions.service.d.ts +5 -5
- package/dist/physics/module//360/237/223/220services/collision/collisions.service.js +17 -17
- package/dist/physics/module//360/237/223/220services/collision/hit-test.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/collision/hit-test.service.js +11 -11
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +4 -4
- package/dist/physics/module//360/237/223/220services/creation/border.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/creation/border.service.js +9 -9
- package/dist/physics/module//360/237/223/220services/creation/materials.service.d.ts +7 -7
- package/dist/physics/module//360/237/223/220services/creation/materials.service.js +17 -17
- package/dist/physics/module//360/237/223/220services/creation/physics-world.service.d.ts +11 -11
- package/dist/physics/module//360/237/223/220services/creation/physics-world.service.js +27 -26
- package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +19 -19
- package/dist/physics/module//360/237/223/220services/impact/explosion.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/impact/explosion.service.js +20 -20
- package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.d.ts +1 -1
- package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.js +4 -4
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.js +3 -3
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.d.ts +5 -5
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.js +12 -12
- package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.js +12 -12
- package/dist/physics/module//360/237/223/220services/query/physics-query.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/query/physics-query.service.js +4 -4
- package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.d.ts +1 -4
- package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.js +7 -15
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +43 -42
- package/dist/physics/module//360/237/247/212entities/border.entity.d.ts +1 -1
- package/dist/physics/module//360/237/247/212entities/border.entity.js +3 -3
- package/dist/pixi/components/display-object-array.d.ts +5 -5
- package/dist/pixi/components/display-object-array.js +14 -14
- package/dist/pixi/components/helpers/smooth-scroller.d.ts +7 -7
- package/dist/pixi/components/helpers/smooth-scroller.js +23 -23
- package/dist/pixi/components/helpers/smooth-scroller.test.js +14 -14
- package/dist/pixi/components/menu/menu-entity.d.ts +14 -0
- package/dist/pixi/components/menu/menu-entity.js +48 -0
- package/dist/pixi/components/menu/menu.ui.d.ts +23 -0
- package/dist/pixi/components/menu/menu.ui.js +97 -0
- package/dist/pixi/components/mouse-wheel-listener.ui.d.ts +2 -2
- package/dist/pixi/components/mouse-wheel-listener.ui.js +11 -11
- package/dist/pixi/components/scroll-area.ui.d.ts +1 -1
- package/dist/pixi/components/scroll-area.ui.js +9 -9
- package/dist/pixi/components/scroll-mask.ui.d.ts +9 -8
- package/dist/pixi/components/scroll-mask.ui.js +25 -24
- package/dist/pixi/display-object/container-attributes.d.ts +24 -25
- package/dist/pixi/display-object/container-attributes.js +26 -26
- package/dist/pixi/display-object/container.d.ts +3 -3
- package/dist/pixi/display-object/container.js +2 -2
- package/dist/pixi/display-object/filters/base-filters/blur.filter.d.ts +9 -9
- package/dist/pixi/display-object/filters/base-filters/blur.filter.js +25 -25
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.d.ts +7 -7
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +17 -17
- package/dist/pixi/display-object/filters/composite-filters/glow-filter.d.ts +6 -6
- package/dist/pixi/display-object/filters/composite-filters/glow-filter.js +10 -11
- package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.d.ts +2 -2
- package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.js +5 -5
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.d.ts +5 -5
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +8 -8
- package/dist/pixi/display-object/filters/templates/plane.template.d.ts +5 -5
- package/dist/pixi/display-object/filters/templates/plane.template.js +7 -7
- package/dist/pixi/display-object/filters.d.ts +7 -7
- package/dist/pixi/display-object/filters.js +34 -34
- package/dist/pixi/display-object/index.d.ts +1 -1
- package/dist/pixi/display-object/objects/graphics/graphics.d.ts +9 -9
- package/dist/pixi/display-object/objects/graphics/graphics.js +25 -25
- package/dist/pixi/display-object/objects/placeholder.d.ts +1 -1
- package/dist/pixi/display-object/objects/placeholder.js +7 -7
- package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.d.ts +9 -9
- package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.js +26 -25
- package/dist/pixi/display-object/objects/sprite/sprite.d.ts +10 -9
- package/dist/pixi/display-object/objects/sprite/sprite.js +62 -53
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/pixi-text-style-converter.d.ts +4 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.d.ts +6 -6
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +16 -16
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +28 -28
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.d.ts +1 -1
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.js +3 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.d.ts +17 -17
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.js +62 -62
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.test.js +2 -2
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.d.ts +3 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.js +6 -6
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.test.js +12 -12
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +2 -2
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.test.js +5 -5
- package/dist/pixi/display-object/objects/text/rich-text.d.ts +0 -1
- package/dist/pixi/display-object/objects/text/rich-text.js +0 -1
- package/dist/pixi/display-object/objects/text/text.d.ts +9 -10
- package/dist/pixi/display-object/objects/text/text.js +34 -35
- package/dist/pixi/game.d.ts +20 -15
- package/dist/pixi/game.js +40 -35
- package/dist/pixi/helpers/game-assets.d.ts +5 -5
- package/dist/pixi/helpers/game-assets.js +14 -11
- package/dist/pixi/helpers/position-conversion.helper.d.ts +4 -4
- package/dist/pixi/helpers/position-conversion.helper.js +3 -3
- package/dist/pixi/index.d.ts +3 -37
- package/dist/pixi/index.js +6 -22
- package/dist/pixi/modules/CAMERA/camera.d.ts +5 -4
- package/dist/pixi/modules/CAMERA/camera.js +9 -9
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.d.ts +3 -2
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.js +1 -1
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.d.ts +3 -2
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.js +5 -5
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts +3 -3
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js +7 -7
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +8 -8
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.js +8 -8
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.d.ts +2 -2
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.js +12 -12
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.d.ts +17 -16
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js +49 -48
- package/dist/pixi/pixi-definitions.d.ts +38 -0
- package/dist/pixi/pixi-definitions.js +37 -0
- package/dist/pixi/services/keyboard/keyboard.d.ts +2 -2
- package/dist/pixi/services/keyboard/keyboard.js +9 -9
- package/dist/pixi/services/mouse/mouse-target-focus.service.d.ts +10 -10
- package/dist/pixi/services/mouse/mouse-target-focus.service.js +28 -28
- package/dist/pixi/services/mouse/mouse.service.d.ts +1 -1
- package/dist/pixi/services/mouse/mouse.service.js +5 -5
- package/dist/utilities/animator/animating-content/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/animating-content/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/animating-content/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/animating-content/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/animations.d.ts +14 -6
- package/dist/utilities/animator/animations.js +15 -11
- package/dist/utilities/animator/animator/animator.d.ts +44 -0
- package/dist/utilities/animator/animator/animator.js +234 -0
- package/dist/utilities/animator/animator/animator.memory-leak.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.memory-leak.test.js +73 -0
- package/dist/utilities/animator/animator/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.performance.test.js +116 -0
- package/dist/utilities/animator/animator/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.test.js +1046 -0
- package/dist/utilities/animator/animator.d.ts +2 -3
- package/dist/utilities/animator/animator.js +66 -59
- package/dist/utilities/animator/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator.performance.test.js +46 -0
- package/dist/utilities/animator/animator.test.js +89 -28
- package/dist/utilities/animator/animator2/animator.d.ts +42 -0
- package/dist/utilities/animator/animator2/animator.js +222 -0
- package/dist/utilities/animator/animator2/animator.memory-leak.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.memory-leak.test.js +73 -0
- package/dist/utilities/animator/animator2/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.performance.test.js +65 -0
- package/dist/utilities/animator/animator2/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.test.js +1007 -0
- package/dist/utilities/animator/animator_old/animator.d.ts +60 -0
- package/dist/utilities/animator/animator_old/animator.js +337 -0
- package/dist/utilities/animator/animator_old/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator_old/animator.performance.test.js +121 -0
- package/dist/utilities/animator/animator_old/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator_old/animator.test.js +996 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.js +37 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.d.ts +38 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.js +208 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.js +439 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.d.ts +41 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.js +107 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.js +138 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.js +307 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.d.ts +37 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.js +170 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.test.js +340 -0
- package/dist/utilities/animator/index.d.ts +6 -6
- package/dist/utilities/animator/index.js +6 -6
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.js +37 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.d.ts +32 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.js +168 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.js +431 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.d.ts +37 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.js +100 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.js +130 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.js +301 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.test.js +30 -30
- package/dist/utilities/animator/state-animation/state-animation.js +7 -7
- package/dist/utilities/animator/state-animation/state-animation.test.js +24 -24
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.js +30 -30
- package/dist/utilities/data-structures/vector-set/vector-set.d.ts +1 -1
- package/dist/utilities/data-structures/vector-set/vector-set.js +5 -5
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.d.ts +1 -1
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.js +5 -5
- package/dist/utilities/grid-algorithms/path-finder/path-finder.js +21 -21
- package/dist/utilities/grid-algorithms/path-finder/path-finder.test.js +9 -9
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.d.ts +14 -14
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.js +43 -43
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.js +21 -21
- package/package.json +7 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Container } from '../../../../pixi';
|
|
2
|
+
import { AnimatorAnimation } from '../../animations';
|
|
3
|
+
export interface FadeInContentOptions {
|
|
4
|
+
duration: number;
|
|
5
|
+
animation: AnimatorAnimation;
|
|
6
|
+
}
|
|
7
|
+
export declare class FadeInContent<T> extends Container {
|
|
8
|
+
private _createFunction;
|
|
9
|
+
private _stateAnimation;
|
|
10
|
+
private _content;
|
|
11
|
+
constructor(_createFunction: (value: {
|
|
12
|
+
state: T;
|
|
13
|
+
container: Container;
|
|
14
|
+
}) => void, partialOptions?: Partial<FadeInContentOptions>);
|
|
15
|
+
setState(state: T | undefined, options?: {
|
|
16
|
+
instant?: boolean;
|
|
17
|
+
}): this;
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FadeInContent = void 0;
|
|
4
|
+
const pixi_1 = require("../../../../pixi");
|
|
5
|
+
const animations_1 = require("../../animations");
|
|
6
|
+
const fade_in_state_animation_1 = require("./fade-in-state-animation");
|
|
7
|
+
class FadeInContent extends pixi_1.Container {
|
|
8
|
+
constructor(_createFunction, partialOptions) {
|
|
9
|
+
super();
|
|
10
|
+
this._createFunction = _createFunction;
|
|
11
|
+
let options = {
|
|
12
|
+
duration: 200,
|
|
13
|
+
animation: animations_1.Animations.easeInOut,
|
|
14
|
+
...partialOptions
|
|
15
|
+
};
|
|
16
|
+
this.alpha = 0;
|
|
17
|
+
this._stateAnimation = new fade_in_state_animation_1.FadeInStateAnimation(options)
|
|
18
|
+
.onStateChange(state => {
|
|
19
|
+
this._content?.destroy();
|
|
20
|
+
this._content = undefined;
|
|
21
|
+
if (state !== undefined) {
|
|
22
|
+
this._content = new pixi_1.Container().displayParent(this).attach(this);
|
|
23
|
+
this._createFunction({ state, container: this._content });
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
.onValueChange(value => {
|
|
27
|
+
this.alpha = value;
|
|
28
|
+
})
|
|
29
|
+
.attach(this);
|
|
30
|
+
}
|
|
31
|
+
setState(state, options) {
|
|
32
|
+
this._stateAnimation.setState(state, options);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.FadeInContent = FadeInContent;
|
|
37
|
+
//# sourceMappingURL=fade-in-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const fade_in_content_1 = require("./fade-in-content");
|
|
5
|
+
(0, vitest_1.describe)('Fade In Content', () => {
|
|
6
|
+
(0, vitest_1.test)('should exist', () => {
|
|
7
|
+
(0, vitest_1.expect)(fade_in_content_1.FadeInContent).toBeDefined();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=fade-in-content.test.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Attachable } from 'actions-lib';
|
|
2
|
+
import { StateAnimationOptions } from '../slide/state-animation';
|
|
3
|
+
declare enum AnimationState {
|
|
4
|
+
Hidden = 1,
|
|
5
|
+
Visible = 2,
|
|
6
|
+
Appearing = 3,
|
|
7
|
+
Disappearing = 4,
|
|
8
|
+
DisappearToChange = 5
|
|
9
|
+
}
|
|
10
|
+
export declare class FadeInStateAnimation<T> extends Attachable {
|
|
11
|
+
private _animator;
|
|
12
|
+
private _options;
|
|
13
|
+
private _animatedObject;
|
|
14
|
+
private _state;
|
|
15
|
+
private _queuedState;
|
|
16
|
+
private _animationState;
|
|
17
|
+
get currentState(): {
|
|
18
|
+
value: number;
|
|
19
|
+
state: T | undefined;
|
|
20
|
+
queuedState: T | undefined;
|
|
21
|
+
animationState: AnimationState;
|
|
22
|
+
};
|
|
23
|
+
constructor(partialOptions?: Partial<StateAnimationOptions>);
|
|
24
|
+
/**
|
|
25
|
+
* @param state - The new state to set. Keep in mind falsy values are also considered as a new state. To set the state to "disappear" use undefined.
|
|
26
|
+
* @param options - Optional options.
|
|
27
|
+
* @param options.instant - If true, the state will be set immediately.
|
|
28
|
+
*/
|
|
29
|
+
setState(state: T | undefined, options?: {
|
|
30
|
+
instant?: boolean;
|
|
31
|
+
}): void;
|
|
32
|
+
private _onComplete;
|
|
33
|
+
private _onStateChangeAction;
|
|
34
|
+
private _onValueChangeAction;
|
|
35
|
+
onStateChange(callback: (state: T | undefined) => void): this;
|
|
36
|
+
onValueChange(callback: (value: number) => void): this;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FadeInStateAnimation = void 0;
|
|
4
|
+
const actions_lib_1 = require("actions-lib");
|
|
5
|
+
const animations_1 = require("../../animations");
|
|
6
|
+
const animator_1 = require("../../animator/animator");
|
|
7
|
+
var AnimationState;
|
|
8
|
+
(function (AnimationState) {
|
|
9
|
+
AnimationState[AnimationState["Hidden"] = 1] = "Hidden";
|
|
10
|
+
AnimationState[AnimationState["Visible"] = 2] = "Visible";
|
|
11
|
+
AnimationState[AnimationState["Appearing"] = 3] = "Appearing";
|
|
12
|
+
AnimationState[AnimationState["Disappearing"] = 4] = "Disappearing";
|
|
13
|
+
AnimationState[AnimationState["DisappearToChange"] = 5] = "DisappearToChange";
|
|
14
|
+
})(AnimationState || (AnimationState = {}));
|
|
15
|
+
class FadeInStateAnimation extends actions_lib_1.Attachable {
|
|
16
|
+
get currentState() {
|
|
17
|
+
return {
|
|
18
|
+
value: this._animatedObject.value,
|
|
19
|
+
state: this._state,
|
|
20
|
+
queuedState: this._queuedState,
|
|
21
|
+
animationState: this._animationState
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
constructor(partialOptions) {
|
|
25
|
+
super();
|
|
26
|
+
this._animatedObject = { value: 0 };
|
|
27
|
+
this._animationState = AnimationState.Hidden;
|
|
28
|
+
this._onStateChangeAction = new actions_lib_1.Action();
|
|
29
|
+
this._onValueChangeAction = new actions_lib_1.Action();
|
|
30
|
+
this._options = { duration: 500, animation: animations_1.Animations.lineer, ...partialOptions };
|
|
31
|
+
this._animatedObject.value = 0;
|
|
32
|
+
this._animator = new animator_1.Animator(this._animatedObject, 'value', {
|
|
33
|
+
duration: this._options.duration,
|
|
34
|
+
animation: this._options.animation,
|
|
35
|
+
reAnimateHandling: animator_1.ReAnimateHandlingType.CompletePrevious,
|
|
36
|
+
completionHandling: animator_1.AnimationsCompletionHandlingType.StayInCurrentState
|
|
37
|
+
});
|
|
38
|
+
this._animator.value
|
|
39
|
+
.subscribe(() => {
|
|
40
|
+
if (this._animatedObject.value !== 1 && this._animatedObject.value !== 0) {
|
|
41
|
+
this._onValueChangeAction.trigger(this._animatedObject.value);
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.attach(this);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @param state - The new state to set. Keep in mind falsy values are also considered as a new state. To set the state to "disappear" use undefined.
|
|
48
|
+
* @param options - Optional options.
|
|
49
|
+
* @param options.instant - If true, the state will be set immediately.
|
|
50
|
+
*/
|
|
51
|
+
setState(state, options) {
|
|
52
|
+
if (options?.instant) {
|
|
53
|
+
this._animator.completeAnimation();
|
|
54
|
+
this._animationState = state !== undefined ? AnimationState.Visible : AnimationState.Hidden;
|
|
55
|
+
this._queuedState = undefined;
|
|
56
|
+
let value = state !== undefined ? 1 : 0;
|
|
57
|
+
let differentState = this._state !== state;
|
|
58
|
+
if (differentState) {
|
|
59
|
+
this._state = state;
|
|
60
|
+
this._onStateChangeAction.trigger(this._state);
|
|
61
|
+
}
|
|
62
|
+
if (differentState || this._animatedObject.value !== value) {
|
|
63
|
+
this._animatedObject.value = value;
|
|
64
|
+
this._onValueChangeAction.trigger(this._animatedObject.value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
switch (this._animationState) {
|
|
69
|
+
case AnimationState.Hidden:
|
|
70
|
+
if (state !== undefined) {
|
|
71
|
+
this._animationState = AnimationState.Appearing;
|
|
72
|
+
this._queuedState = undefined;
|
|
73
|
+
this._state = state;
|
|
74
|
+
this._onStateChangeAction.trigger(this._state);
|
|
75
|
+
this._animator
|
|
76
|
+
.animate({ value: 1 })
|
|
77
|
+
.tap(() => this._onComplete())
|
|
78
|
+
.attach(this);
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case AnimationState.Visible:
|
|
82
|
+
if (state === undefined) {
|
|
83
|
+
this._animationState = AnimationState.Disappearing;
|
|
84
|
+
this._queuedState = undefined;
|
|
85
|
+
this._animator
|
|
86
|
+
.animate({ value: 0 })
|
|
87
|
+
.tap(() => this._onComplete())
|
|
88
|
+
.attach(this);
|
|
89
|
+
}
|
|
90
|
+
else if (state !== this._state) {
|
|
91
|
+
this._animationState = AnimationState.DisappearToChange;
|
|
92
|
+
this._queuedState = state;
|
|
93
|
+
this._animator
|
|
94
|
+
.animate({ value: 0 })
|
|
95
|
+
.tap(() => this._onComplete())
|
|
96
|
+
.attach(this);
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
case AnimationState.Appearing:
|
|
100
|
+
if (state === undefined) {
|
|
101
|
+
this._animationState = AnimationState.Disappearing;
|
|
102
|
+
this._queuedState = undefined;
|
|
103
|
+
this._animator
|
|
104
|
+
.animate({ value: 0 }, { duration: this._animatedObject.value * this._options.duration })
|
|
105
|
+
.tap(() => this._onComplete())
|
|
106
|
+
.attach(this);
|
|
107
|
+
}
|
|
108
|
+
else if (state !== this._state) {
|
|
109
|
+
if (this._animatedObject.value > 0) {
|
|
110
|
+
this._animationState = AnimationState.DisappearToChange;
|
|
111
|
+
this._queuedState = state;
|
|
112
|
+
this._animator
|
|
113
|
+
.animate({ value: 0 }, { duration: this._animatedObject.value * this._options.duration })
|
|
114
|
+
.tap(() => this._onComplete())
|
|
115
|
+
.attach(this);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this._queuedState = undefined;
|
|
119
|
+
this._state = state;
|
|
120
|
+
this._onStateChangeAction.trigger(this._state);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
case AnimationState.Disappearing:
|
|
125
|
+
if (state === this._state) {
|
|
126
|
+
this._animationState = AnimationState.Appearing;
|
|
127
|
+
this._animator
|
|
128
|
+
.animate({ value: 1 }, { duration: (1 - this._animatedObject.value) * this._options.duration })
|
|
129
|
+
.tap(() => this._onComplete())
|
|
130
|
+
.attach(this);
|
|
131
|
+
}
|
|
132
|
+
else if (state !== undefined) {
|
|
133
|
+
this._animationState = AnimationState.DisappearToChange;
|
|
134
|
+
this._queuedState = state;
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
case AnimationState.DisappearToChange:
|
|
138
|
+
if (state === undefined) {
|
|
139
|
+
this._animationState = AnimationState.Disappearing;
|
|
140
|
+
this._queuedState = undefined;
|
|
141
|
+
}
|
|
142
|
+
else if (state === this._state) {
|
|
143
|
+
this._animationState = AnimationState.Appearing;
|
|
144
|
+
this._queuedState = undefined;
|
|
145
|
+
this._animator
|
|
146
|
+
.animate({ value: 1 }, { duration: (1 - this._animatedObject.value) * this._options.duration })
|
|
147
|
+
.tap(() => this._onComplete())
|
|
148
|
+
.attach(this);
|
|
149
|
+
}
|
|
150
|
+
else if (state !== this._queuedState) {
|
|
151
|
+
this._queuedState = state;
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
_onComplete() {
|
|
158
|
+
switch (this._animationState) {
|
|
159
|
+
case AnimationState.Appearing:
|
|
160
|
+
if (this._animatedObject.value === 1) {
|
|
161
|
+
this._animationState = AnimationState.Visible;
|
|
162
|
+
this._onValueChangeAction.trigger(this._animatedObject.value);
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
case AnimationState.Disappearing:
|
|
166
|
+
if (this._queuedState !== undefined) {
|
|
167
|
+
throw new Error('FadeInStateAnimation: Unexpected state, disappearing should not have a queued value');
|
|
168
|
+
}
|
|
169
|
+
if (this._animatedObject.value === 0) {
|
|
170
|
+
this._animationState = AnimationState.Hidden;
|
|
171
|
+
this._state = undefined;
|
|
172
|
+
this._onStateChangeAction.trigger(this._state);
|
|
173
|
+
this._onValueChangeAction.trigger(this._animatedObject.value);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case AnimationState.DisappearToChange:
|
|
177
|
+
if (this._queuedState === undefined) {
|
|
178
|
+
throw new Error('FadeInStateAnimation: Unexpected state, disappearToChange should always have a queued value');
|
|
179
|
+
}
|
|
180
|
+
if (this._animatedObject.value === 0) {
|
|
181
|
+
this._animationState = AnimationState.Appearing;
|
|
182
|
+
this._state = this._queuedState;
|
|
183
|
+
this._queuedState = undefined;
|
|
184
|
+
this._onStateChangeAction.trigger(this._state);
|
|
185
|
+
this._onValueChangeAction.trigger(this._animatedObject.value);
|
|
186
|
+
this._animator
|
|
187
|
+
.animate({ value: 1 })
|
|
188
|
+
.tap(() => this._onComplete())
|
|
189
|
+
.attach(this);
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
case AnimationState.Hidden:
|
|
193
|
+
case AnimationState.Visible:
|
|
194
|
+
// Do nothing
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
onStateChange(callback) {
|
|
199
|
+
this._onStateChangeAction.subscribe(value => callback(value)).attach(this);
|
|
200
|
+
return this;
|
|
201
|
+
}
|
|
202
|
+
onValueChange(callback) {
|
|
203
|
+
this._onValueChangeAction.subscribe(value => callback(value)).attach(this);
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.FadeInStateAnimation = FadeInStateAnimation;
|
|
208
|
+
//# sourceMappingURL=fade-in-state-animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|