@zcomponent/core 1.14.3 → 1.16.0-beta
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 +0 -6
- package/lib/actionbehavior.d.ts +12 -3
- package/lib/actionbehavior.js +12 -3
- package/lib/animation/animation.d.ts +96 -4
- package/lib/animation/animation.js +93 -0
- package/lib/animation/animationstate.d.ts +52 -2
- package/lib/animation/bezier.d.ts +12 -1
- package/lib/animation/bezier.js +15 -12
- package/lib/animation/clips/clip.d.ts +71 -0
- package/lib/animation/clips/clip.js +68 -0
- package/lib/animation/interpolate.d.ts +17 -0
- package/lib/animation/interpolate.js +71 -0
- package/lib/animation/keyframe.d.ts +24 -1
- package/lib/animation/layer.d.ts +73 -1
- package/lib/animation/layer.js +69 -0
- package/lib/animation/layerclip.d.ts +75 -0
- package/lib/animation/layerclip.js +69 -0
- package/lib/animation/stream.d.ts +49 -7
- package/lib/animation/stream.js +3 -0
- package/lib/animation/tracks/cliptrack.d.ts +64 -0
- package/lib/animation/tracks/cliptrack.js +65 -1
- package/lib/animation/tracks/functiontrack.d.ts +60 -0
- package/lib/animation/tracks/functiontrack.js +62 -3
- package/lib/animation/tracks/propertytrack.d.ts +84 -0
- package/lib/animation/tracks/propertytrack.js +75 -0
- package/lib/animation/tracks/streamtrack.d.ts +51 -0
- package/lib/animation/tracks/streamtrack.js +54 -3
- package/lib/animation/tracks/track.d.ts +56 -0
- package/lib/animation/tracks/track.js +40 -0
- package/lib/behavior.d.ts +37 -0
- package/lib/behavior.js +21 -0
- package/lib/behaviors/ActivateState.d.ts +10 -3
- package/lib/behaviors/ActivateState.js +8 -4
- package/lib/behaviors/CallFunction.d.ts +1 -1
- package/lib/behaviors/CallFunction.js +2 -2
- package/lib/behaviors/ConsoleLog.d.ts +1 -1
- package/lib/behaviors/ConsoleLog.js +2 -2
- package/lib/behaviors/DownloadSnapshot.d.ts +5 -2
- package/lib/behaviors/DownloadSnapshot.js +5 -2
- package/lib/behaviors/LaunchURL.d.ts +1 -1
- package/lib/behaviors/LaunchURL.js +1 -1
- package/lib/behaviors/LogAnalyticsEvent.d.ts +1 -1
- package/lib/behaviors/LogAnalyticsEvent.js +2 -2
- package/lib/behaviors/PauseLayerClip.d.ts +5 -3
- package/lib/behaviors/PauseLayerClip.js +3 -2
- package/lib/behaviors/PlayLayerClip.d.ts +10 -4
- package/lib/behaviors/PlayLayerClip.js +7 -5
- package/lib/behaviors/PlaySound.d.ts +4 -4
- package/lib/behaviors/PlaySound.js +4 -4
- package/lib/behaviors/SetLayerOff.d.ts +4 -3
- package/lib/behaviors/SetLayerOff.js +3 -2
- package/lib/behaviors/ShowTextAlert.d.ts +2 -2
- package/lib/behaviors/ShowTextAlert.js +5 -5
- package/lib/behaviors/ToggleLayerClips.d.ts +4 -3
- package/lib/behaviors/ToggleLayerClips.js +5 -4
- package/lib/behaviors/stream/PauseStream.d.ts +15 -3
- package/lib/behaviors/stream/PauseStream.js +13 -2
- package/lib/behaviors/stream/PlayStream.d.ts +14 -4
- package/lib/behaviors/stream/PlayStream.js +10 -3
- package/lib/behaviors/stream/SeekStream.d.ts +12 -3
- package/lib/behaviors/stream/SeekStream.js +10 -2
- package/lib/behaviors/stream/StopStream.d.ts +11 -3
- package/lib/behaviors/stream/StopStream.js +9 -2
- package/lib/component.d.ts +85 -5
- package/lib/component.js +49 -1
- package/lib/components/Audio.d.ts +14 -5
- package/lib/components/Audio.js +19 -10
- package/lib/components/AudioLayerSettings.d.ts +9 -3
- package/lib/components/AudioLayerSettings.js +9 -3
- package/lib/components/Children.d.ts +7 -2
- package/lib/components/Children.js +6 -1
- package/lib/components/DefaultCookieConsent.d.ts +13 -3
- package/lib/components/DefaultCookieConsent.js +62 -38
- package/lib/components/DefaultLoader.d.ts +14 -9
- package/lib/components/DefaultLoader.js +25 -20
- package/lib/components/Gamepad.d.ts +12 -4
- package/lib/components/Gamepad.js +16 -8
- package/lib/components/LongLoad.d.ts +7 -1
- package/lib/components/LongLoad.js +7 -1
- package/lib/components/SnapshotUI.d.ts +10 -0
- package/lib/components/SnapshotUI.js +24 -0
- package/lib/context.d.ts +117 -0
- package/lib/context.js +50 -71
- package/lib/contexts/analyticscontext.d.ts +6 -0
- package/lib/contexts/analyticscontext.js +6 -0
- package/lib/contexts/audiocontextcontext.d.ts +26 -1
- package/lib/contexts/audiocontextcontext.js +26 -1
- package/lib/contexts/canvascontext.d.ts +59 -1
- package/lib/contexts/canvascontext.js +54 -1
- package/lib/contexts/cookieconsentcontext.d.ts +84 -10
- package/lib/contexts/cookieconsentcontext.js +71 -0
- package/lib/contexts/environmentcontext.d.ts +40 -5
- package/lib/contexts/environmentcontext.js +40 -5
- package/lib/contexts/gamepadcontext.d.ts +38 -0
- package/lib/contexts/gamepadcontext.js +38 -0
- package/lib/contexts/gesturecontext.d.ts +31 -4
- package/lib/contexts/gesturecontext.js +28 -4
- package/lib/contexts/globaltagcontext.d.ts +14 -2
- package/lib/contexts/globaltagcontext.js +13 -1
- package/lib/contexts/loadcontext.d.ts +92 -5
- package/lib/contexts/loadcontext.js +98 -11
- package/lib/contexts/orientationcontext.d.ts +58 -1
- package/lib/contexts/orientationcontext.js +51 -1
- package/lib/contexts/snapshotContext.d.ts +97 -4
- package/lib/contexts/snapshotContext.js +115 -4
- package/lib/contexts/tagcontext.d.ts +56 -2
- package/lib/contexts/tagcontext.js +77 -7
- package/lib/contexts/textalertcontext.d.ts +35 -2
- package/lib/contexts/textalertcontext.js +20 -2
- package/lib/contexts/usereventcontext.d.ts +29 -0
- package/lib/contexts/usereventcontext.js +30 -1
- package/lib/data/animation.d.ts +163 -0
- package/lib/data/animation.js +9 -0
- package/lib/data/change.d.ts +199 -0
- package/lib/data/change.js +190 -0
- package/lib/emitter.d.ts +8 -1
- package/lib/emitter.js +7 -0
- package/lib/entity.d.ts +30 -5
- package/lib/entity.js +23 -7
- package/lib/event.d.ts +19 -2
- package/lib/event.js +19 -2
- package/lib/fractionalindexing.js +38 -42
- package/lib/inflate.d.ts +68 -0
- package/lib/inflate.js +76 -0
- package/lib/observable.d.ts +3 -3
- package/lib/observable.js +4 -4
- package/lib/profile.d.ts +27 -0
- package/lib/profile.js +26 -0
- package/lib/selectors.d.ts +114 -0
- package/lib/selectors.js +159 -7
- package/lib/types.d.ts +215 -0
- package/lib/types.js +110 -1
- package/lib/validators.d.ts +27 -0
- package/lib/validators.js +27 -0
- package/lib/values/values.d.ts +5 -0
- package/lib/values/values.js +5 -0
- package/lib/zcomponent.d.ts +72 -0
- package/lib/zcomponent.js +81 -0
- package/lib/zcomponentconstruction.d.ts +11 -1
- package/lib/zcomponentconstruction.js +10 -0
- package/package.json +7 -2
package/lib/behavior.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { Entity } from './entity';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all behaviors.
|
|
4
|
+
*
|
|
5
|
+
* Behaviors are a versatile way to add interactivity to your experience. They’re often used to:
|
|
6
|
+
* - Listen to the events emitted by a node and then perform an action, such as playing an animation or calling a function in a context.
|
|
7
|
+
* - Change the behavior or properties of the node they're attached to.
|
|
8
|
+
*
|
|
9
|
+
* @link [custom-behaviors](https://docs.zap.works/mattercraft/scripting/custom-behaviors/)
|
|
10
|
+
*/
|
|
2
11
|
export class Behavior extends Entity {
|
|
3
12
|
/**
|
|
4
13
|
* Constructs this behavior
|
|
@@ -27,9 +36,21 @@ export class Behavior extends Entity {
|
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
const behaviorsToRunAtDesignTime = new Set();
|
|
39
|
+
/**
|
|
40
|
+
* Checks if a specified Behavior should run at design time.
|
|
41
|
+
*
|
|
42
|
+
* @param b - The BehaviorConstructor to check.
|
|
43
|
+
* @returns A boolean indicating whether the behavior should run at design time.
|
|
44
|
+
*/
|
|
30
45
|
export function shouldBehaviorRunAtDesignTime(b) {
|
|
31
46
|
return behaviorsToRunAtDesignTime.has(b);
|
|
32
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Registers a Behavior to run at design time.
|
|
50
|
+
*
|
|
51
|
+
* @param b - The BehaviorConstructor to register.
|
|
52
|
+
* @returns The updated Set containing all registered BehaviorConstructors.
|
|
53
|
+
*/
|
|
33
54
|
export function registerBehaviorRunAtDesignTime(b) {
|
|
34
55
|
return behaviorsToRunAtDesignTime.add(b);
|
|
35
56
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
import { ContextManager } from '../context';
|
|
4
4
|
/**
|
|
5
|
+
* Behavior to activate a specific animation state.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon play_circle
|
|
7
8
|
* @zgroup Animation Actions
|
|
@@ -9,6 +10,7 @@ import { ContextManager } from "../context";
|
|
|
9
10
|
export declare class ActivateState extends ActionBehavior {
|
|
10
11
|
private zcomponent;
|
|
11
12
|
/**
|
|
13
|
+
* The ID of the animation state to be activated.
|
|
12
14
|
* @zprop
|
|
13
15
|
* @zgroup Activate State Settings
|
|
14
16
|
* @zgrouppriority 20
|
|
@@ -16,6 +18,7 @@ export declare class ActivateState extends ActionBehavior {
|
|
|
16
18
|
*/
|
|
17
19
|
state: string | undefined;
|
|
18
20
|
/**
|
|
21
|
+
* Override time for the fade transition.
|
|
19
22
|
* @zprop
|
|
20
23
|
* @zgroup Override Fade
|
|
21
24
|
* @zgrouppriority 10
|
|
@@ -30,6 +33,7 @@ export declare class ActivateState extends ActionBehavior {
|
|
|
30
33
|
*/
|
|
31
34
|
pin?: Pin | number;
|
|
32
35
|
/**
|
|
36
|
+
* Easing function for the fade transition.
|
|
33
37
|
* @zprop
|
|
34
38
|
* @zgroup Override Fade
|
|
35
39
|
* @zgrouppriority 10
|
|
@@ -43,6 +47,9 @@ export declare class ActivateState extends ActionBehavior {
|
|
|
43
47
|
/** @zui */
|
|
44
48
|
preview(): void;
|
|
45
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Enum for specifying the pin point of the animation.
|
|
52
|
+
*/
|
|
46
53
|
export declare enum Pin {
|
|
47
54
|
Start = 0,
|
|
48
55
|
Middle = 0.5,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Behavior to activate a specific animation state.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon play_circle
|
|
6
7
|
* @zgroup Animation Actions
|
|
@@ -21,8 +22,8 @@ export class ActivateState extends ActionBehavior {
|
|
|
21
22
|
fade: {
|
|
22
23
|
time: this.fadeTime,
|
|
23
24
|
pin: this.pin,
|
|
24
|
-
easing: this.easing
|
|
25
|
-
}
|
|
25
|
+
easing: this.easing,
|
|
26
|
+
},
|
|
26
27
|
};
|
|
27
28
|
layerclip.play(opts);
|
|
28
29
|
}
|
|
@@ -31,6 +32,9 @@ export class ActivateState extends ActionBehavior {
|
|
|
31
32
|
this.perform();
|
|
32
33
|
}
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Enum for specifying the pin point of the animation.
|
|
37
|
+
*/
|
|
34
38
|
export var Pin;
|
|
35
39
|
(function (Pin) {
|
|
36
40
|
Pin[Pin["Start"] = 0] = "Start";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionBehavior } from
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
4
|
* Calls an exposed function on a context
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionBehavior } from
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
4
|
* Outputs a message to the console log.
|
|
5
5
|
*
|
|
@@ -4,14 +4,17 @@ import { ContextManager } from '../context';
|
|
|
4
4
|
import { Event } from '../event';
|
|
5
5
|
export type DownloadSnapshotProps = ActionBehaviorConstructorProps;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Behavior for downloading a captured canvas snapshot as an image.
|
|
8
8
|
*
|
|
9
9
|
* @zbehavior
|
|
10
10
|
* @zicon download
|
|
11
11
|
* @zgroup Actions
|
|
12
12
|
*/
|
|
13
13
|
export declare class DownloadSnapshot extends ActionBehavior<DownloadSnapshotProps> {
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Event triggered when a snapshot is saved.
|
|
16
|
+
* @zui
|
|
17
|
+
*/
|
|
15
18
|
onSave: Event<[]>;
|
|
16
19
|
constructor(contextManager: ContextManager, instance: Component, props: DownloadSnapshotProps);
|
|
17
20
|
/** @zprop */
|
|
@@ -3,7 +3,7 @@ import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
|
3
3
|
import { SnapshotContext } from '../contexts/snapshotContext';
|
|
4
4
|
import { Event } from '../event';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Behavior for downloading a captured canvas snapshot as an image.
|
|
7
7
|
*
|
|
8
8
|
* @zbehavior
|
|
9
9
|
* @zicon download
|
|
@@ -12,7 +12,10 @@ import { Event } from '../event';
|
|
|
12
12
|
export class DownloadSnapshot extends ActionBehavior {
|
|
13
13
|
constructor(contextManager, instance, props) {
|
|
14
14
|
super(contextManager, instance, props);
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Event triggered when a snapshot is saved.
|
|
17
|
+
* @zui
|
|
18
|
+
*/
|
|
16
19
|
this.onSave = new Event();
|
|
17
20
|
this.download = () => {
|
|
18
21
|
const snapshotContext = this.contextManager.get(SnapshotContext);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionBehavior } from
|
|
2
|
-
import { logEvent } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { logEvent } from '../contexts/analyticscontext';
|
|
3
3
|
/**
|
|
4
4
|
* Logs an event through the currently configured analytics provider(s).
|
|
5
5
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
import { ContextManager } from '../context';
|
|
4
4
|
/**
|
|
5
|
+
* Behavior to pause a specific layer clip animation.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon pause_circle
|
|
7
8
|
* @zgroup Animation Actions
|
|
@@ -9,6 +10,7 @@ import { ContextManager } from "../context";
|
|
|
9
10
|
export declare class PauseLayerClip extends ActionBehavior {
|
|
10
11
|
private zcomponent;
|
|
11
12
|
/**
|
|
13
|
+
* The ID of the layer clip to be paused.
|
|
12
14
|
* @zprop
|
|
13
15
|
* @zvalues layerclipids
|
|
14
16
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Behavior to pause a specific layer clip animation.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon pause_circle
|
|
6
7
|
* @zgroup Animation Actions
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
import { ContextManager } from '../context';
|
|
4
4
|
/**
|
|
5
|
+
* Behavior to play a specified layer clip animation.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon play_circle
|
|
7
8
|
* @zgroup Animation Actions
|
|
@@ -9,6 +10,7 @@ import { ContextManager } from "../context";
|
|
|
9
10
|
export declare class PlayLayerClip extends ActionBehavior {
|
|
10
11
|
private zcomponent;
|
|
11
12
|
/**
|
|
13
|
+
* The ID of the layer clip to be played.
|
|
12
14
|
* @zprop
|
|
13
15
|
* @zgroup Play Settings
|
|
14
16
|
* @zgrouppriority 20
|
|
@@ -16,6 +18,7 @@ export declare class PlayLayerClip extends ActionBehavior {
|
|
|
16
18
|
*/
|
|
17
19
|
layerClip: string | undefined;
|
|
18
20
|
/**
|
|
21
|
+
* Whether the layer clip should loop.
|
|
19
22
|
* @zprop
|
|
20
23
|
* @zgroup Play Settings
|
|
21
24
|
* @zgrouppriority 20
|
|
@@ -23,6 +26,7 @@ export declare class PlayLayerClip extends ActionBehavior {
|
|
|
23
26
|
*/
|
|
24
27
|
loop?: boolean;
|
|
25
28
|
/**
|
|
29
|
+
* The playback speed of the layer clip.
|
|
26
30
|
* @zprop
|
|
27
31
|
* @zgroup Play Settings
|
|
28
32
|
* @zgrouppriority 20
|
|
@@ -30,6 +34,7 @@ export declare class PlayLayerClip extends ActionBehavior {
|
|
|
30
34
|
*/
|
|
31
35
|
speed?: number;
|
|
32
36
|
/**
|
|
37
|
+
* Whether to queue the layer clip in the animation sequence.
|
|
33
38
|
* @zprop
|
|
34
39
|
* @zgroup Play Settings
|
|
35
40
|
* @zgrouppriority 20
|
|
@@ -37,7 +42,7 @@ export declare class PlayLayerClip extends ActionBehavior {
|
|
|
37
42
|
*/
|
|
38
43
|
queue: boolean;
|
|
39
44
|
/**
|
|
40
|
-
*
|
|
45
|
+
* Whether to seek the layer clip to the start before playing.
|
|
41
46
|
*
|
|
42
47
|
* @zprop
|
|
43
48
|
* @zgroup Play Settings
|
|
@@ -46,6 +51,7 @@ export declare class PlayLayerClip extends ActionBehavior {
|
|
|
46
51
|
*/
|
|
47
52
|
fromStart: boolean;
|
|
48
53
|
/**
|
|
54
|
+
* Override time for the fade transition.
|
|
49
55
|
* @zprop
|
|
50
56
|
* @zgroup Override Fade
|
|
51
57
|
* @zgrouppriority 10
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Behavior to play a specified layer clip animation.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon play_circle
|
|
6
7
|
* @zgroup Animation Actions
|
|
@@ -10,6 +11,7 @@ export class PlayLayerClip extends ActionBehavior {
|
|
|
10
11
|
super(contextManager, instance, props);
|
|
11
12
|
this.zcomponent = this.getZComponentInstance();
|
|
12
13
|
/**
|
|
14
|
+
* Whether to queue the layer clip in the animation sequence.
|
|
13
15
|
* @zprop
|
|
14
16
|
* @zgroup Play Settings
|
|
15
17
|
* @zgrouppriority 20
|
|
@@ -17,7 +19,7 @@ export class PlayLayerClip extends ActionBehavior {
|
|
|
17
19
|
*/
|
|
18
20
|
this.queue = false;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Whether to seek the layer clip to the start before playing.
|
|
21
23
|
*
|
|
22
24
|
* @zprop
|
|
23
25
|
* @zgroup Play Settings
|
|
@@ -39,8 +41,8 @@ export class PlayLayerClip extends ActionBehavior {
|
|
|
39
41
|
fade: {
|
|
40
42
|
time: this.fadeTime,
|
|
41
43
|
pin: this.pin,
|
|
42
|
-
easing: this.easing
|
|
43
|
-
}
|
|
44
|
+
easing: this.easing,
|
|
45
|
+
},
|
|
44
46
|
};
|
|
45
47
|
if (this.fromStart ?? false)
|
|
46
48
|
layerclip.seek(0, { dontActivateLayer: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
4
|
-
import { Observable } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
import { ContextManager } from '../context';
|
|
4
|
+
import { Observable } from '../observable';
|
|
5
5
|
export interface PlaySoundProps extends ActionBehaviorConstructorProps {
|
|
6
6
|
/** @zprop
|
|
7
7
|
* @zvalues files *.+(mp3|wav)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
3
|
-
import { Audio } from
|
|
4
|
-
import { Observable } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
|
+
import { Audio } from '../components/Audio';
|
|
4
|
+
import { Observable } from '../observable';
|
|
5
5
|
/**
|
|
6
6
|
* Plays a sound
|
|
7
7
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
import { ContextManager } from '../context';
|
|
4
4
|
/**
|
|
5
|
+
* Sets a leye clip to be inactive.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon toggle_off
|
|
7
8
|
* @zgroup Animation Actions
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Sets a leye clip to be inactive.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon toggle_off
|
|
6
7
|
* @zgroup Animation Actions
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior } from
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
3
|
-
import { showTextAlert } from
|
|
4
|
-
import { Observable } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
|
+
import { showTextAlert } from '../contexts/textalertcontext';
|
|
4
|
+
import { Observable } from '../observable';
|
|
5
5
|
/**
|
|
6
6
|
* Displays a pop-up text alert on screen.
|
|
7
7
|
*
|
|
@@ -69,7 +69,7 @@ export class ShowTextAlert extends ActionBehavior {
|
|
|
69
69
|
backgroundColor: this.backgroundColor.value,
|
|
70
70
|
textColor: this.textColor.value,
|
|
71
71
|
classNames: this.classNames.value,
|
|
72
|
-
timeout: this.timeout.value
|
|
72
|
+
timeout: this.timeout.value,
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
/** @zui */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
import { ContextManager } from '../context';
|
|
4
4
|
/**
|
|
5
|
+
* Toggles between two layer clips.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon play_circle
|
|
7
8
|
* @zgroup Animation Actions
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Toggles between two layer clips.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon play_circle
|
|
6
7
|
* @zgroup Animation Actions
|
|
@@ -36,8 +37,8 @@ export class ToggleLayerClips extends ActionBehavior {
|
|
|
36
37
|
fade: {
|
|
37
38
|
time: this.fadeTime,
|
|
38
39
|
pin: this.pin,
|
|
39
|
-
easing: this.easing
|
|
40
|
-
}
|
|
40
|
+
easing: this.easing,
|
|
41
|
+
},
|
|
41
42
|
};
|
|
42
43
|
const layerID = this.isA ? this.layerOffA : this.layerOffB;
|
|
43
44
|
const layerClipID = this.isA ? this.layerClipA : this.layerClipB;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../../actionbehavior';
|
|
2
|
+
import { Component } from '../../component';
|
|
3
|
+
import { ContextManager } from '../../context';
|
|
4
4
|
/**
|
|
5
|
+
* Behavior to pause a specific stream.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon pause_circle
|
|
7
8
|
* @zgroup Stream Actions
|
|
@@ -9,15 +10,26 @@ import { ContextManager } from "../../context";
|
|
|
9
10
|
export declare class PauseStream extends ActionBehavior {
|
|
10
11
|
private zcomponent;
|
|
11
12
|
/**
|
|
13
|
+
* The ID of the stream to be paused.
|
|
12
14
|
* @zprop
|
|
13
15
|
* @zgroup Pause Settings
|
|
14
16
|
* @zgrouppriority 20
|
|
15
17
|
* @zvalues streamids
|
|
16
18
|
*/
|
|
17
19
|
stream: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of PauseStream.
|
|
22
|
+
* @param contextManager
|
|
23
|
+
* @param instance
|
|
24
|
+
* @param props
|
|
25
|
+
*/
|
|
18
26
|
constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
|
|
27
|
+
/**
|
|
28
|
+
* Executes the action to pause the stream.
|
|
29
|
+
*/
|
|
19
30
|
perform(): void;
|
|
20
31
|
/**
|
|
32
|
+
* Provides a preview of the pause action within the UI.
|
|
21
33
|
* @zprop
|
|
22
34
|
* @zui
|
|
23
35
|
*/
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Behavior to pause a specific stream.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon pause_circle
|
|
6
7
|
* @zgroup Stream Actions
|
|
7
8
|
*/
|
|
8
9
|
export class PauseStream extends ActionBehavior {
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of PauseStream.
|
|
12
|
+
* @param contextManager
|
|
13
|
+
* @param instance
|
|
14
|
+
* @param props
|
|
15
|
+
*/
|
|
9
16
|
constructor(contextManager, instance, props) {
|
|
10
17
|
super(contextManager, instance, props);
|
|
11
18
|
this.zcomponent = this.getZComponentInstance();
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Executes the action to pause the stream.
|
|
22
|
+
*/
|
|
13
23
|
perform() {
|
|
14
24
|
if (!this.stream)
|
|
15
25
|
return;
|
|
@@ -19,6 +29,7 @@ export class PauseStream extends ActionBehavior {
|
|
|
19
29
|
stream.pause();
|
|
20
30
|
}
|
|
21
31
|
/**
|
|
32
|
+
* Provides a preview of the pause action within the UI.
|
|
22
33
|
* @zprop
|
|
23
34
|
* @zui
|
|
24
35
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ActionBehavior, ActionBehaviorConstructorProps } from
|
|
2
|
-
import { Component } from
|
|
3
|
-
import { ContextManager } from
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../../actionbehavior';
|
|
2
|
+
import { Component } from '../../component';
|
|
3
|
+
import { ContextManager } from '../../context';
|
|
4
4
|
/**
|
|
5
|
+
* Behavior to play a specified stream.
|
|
5
6
|
* @zbehavior
|
|
6
7
|
* @zicon play_circle
|
|
7
8
|
* @zgroup Stream Actions
|
|
@@ -9,6 +10,7 @@ import { ContextManager } from "../../context";
|
|
|
9
10
|
export declare class PlayStream extends ActionBehavior {
|
|
10
11
|
private zcomponent;
|
|
11
12
|
/**
|
|
13
|
+
* The ID of the stream to be played.
|
|
12
14
|
* @zprop
|
|
13
15
|
* @zgroup Play Settings
|
|
14
16
|
* @zgrouppriority 20
|
|
@@ -16,6 +18,7 @@ export declare class PlayStream extends ActionBehavior {
|
|
|
16
18
|
*/
|
|
17
19
|
stream: string | undefined;
|
|
18
20
|
/**
|
|
21
|
+
* Whether the stream should loop.
|
|
19
22
|
* @zprop
|
|
20
23
|
* @zgroup Play Settings
|
|
21
24
|
* @zgrouppriority 20
|
|
@@ -23,6 +26,7 @@ export declare class PlayStream extends ActionBehavior {
|
|
|
23
26
|
*/
|
|
24
27
|
loop?: boolean;
|
|
25
28
|
/**
|
|
29
|
+
* The playback speed of the stream.
|
|
26
30
|
* @zprop
|
|
27
31
|
* @zgroup Play Settings
|
|
28
32
|
* @zgrouppriority 20
|
|
@@ -30,7 +34,7 @@ export declare class PlayStream extends ActionBehavior {
|
|
|
30
34
|
*/
|
|
31
35
|
speed?: number;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* Whether to seek the stream to the start before playing.
|
|
34
38
|
*
|
|
35
39
|
* @zprop
|
|
36
40
|
* @zgroup Play Settings
|
|
@@ -38,6 +42,12 @@ export declare class PlayStream extends ActionBehavior {
|
|
|
38
42
|
* @zdefault false
|
|
39
43
|
*/
|
|
40
44
|
fromStart: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Creates an instance of PlayStream.
|
|
47
|
+
* @param contextManager - The current ContextManager
|
|
48
|
+
* @param instance - The instance of the component that this behavior is attached to
|
|
49
|
+
* @param props - The constructor properties.
|
|
50
|
+
*/
|
|
41
51
|
constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
|
|
42
52
|
/** @zprop */
|
|
43
53
|
perform(): void;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from
|
|
1
|
+
import { ActionBehavior } from '../../actionbehavior';
|
|
2
|
+
import { registerBehaviorRunAtDesignTime } from '../../behavior';
|
|
3
3
|
/**
|
|
4
|
+
* Behavior to play a specified stream.
|
|
4
5
|
* @zbehavior
|
|
5
6
|
* @zicon play_circle
|
|
6
7
|
* @zgroup Stream Actions
|
|
7
8
|
*/
|
|
8
9
|
export class PlayStream extends ActionBehavior {
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of PlayStream.
|
|
12
|
+
* @param contextManager - The current ContextManager
|
|
13
|
+
* @param instance - The instance of the component that this behavior is attached to
|
|
14
|
+
* @param props - The constructor properties.
|
|
15
|
+
*/
|
|
9
16
|
constructor(contextManager, instance, props) {
|
|
10
17
|
super(contextManager, instance, props);
|
|
11
18
|
this.zcomponent = this.getZComponentInstance();
|
|
12
19
|
/**
|
|
13
|
-
*
|
|
20
|
+
* Whether to seek the stream to the start before playing.
|
|
14
21
|
*
|
|
15
22
|
* @zprop
|
|
16
23
|
* @zgroup Play Settings
|