@zcomponent/core 1.29.0 → 2.0.0-alpha.2

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.
Files changed (168) hide show
  1. package/README.md +1 -0
  2. package/css/zcomponent.css +121 -122
  3. package/index.js +0 -3
  4. package/lib/actionbehavior.d.ts +3 -3
  5. package/lib/actionbehavior.js +20 -19
  6. package/lib/animation/animation.d.ts +13 -6
  7. package/lib/animation/animation.js +56 -43
  8. package/lib/animation/bezier.d.ts +6 -0
  9. package/lib/animation/bezier.js +8 -2
  10. package/lib/animation/clips/clip.d.ts +13 -1
  11. package/lib/animation/clips/clip.js +34 -14
  12. package/lib/animation/index.d.ts +4 -4
  13. package/lib/animation/index.js +4 -4
  14. package/lib/animation/layer.d.ts +9 -0
  15. package/lib/animation/layer.js +28 -12
  16. package/lib/animation/layerclip.d.ts +21 -0
  17. package/lib/animation/layerclip.js +82 -45
  18. package/lib/animation/tracks/cliptrack.d.ts +18 -0
  19. package/lib/animation/tracks/cliptrack.js +27 -6
  20. package/lib/animation/tracks/functiontrack.d.ts +9 -0
  21. package/lib/animation/tracks/functiontrack.js +16 -3
  22. package/lib/animation/tracks/propertytrack.d.ts +20 -1
  23. package/lib/animation/tracks/propertytrack.js +48 -11
  24. package/lib/animation/tracks/streamtrack.d.ts +18 -0
  25. package/lib/animation/tracks/streamtrack.js +32 -6
  26. package/lib/animation/tracks/track.d.ts +8 -2
  27. package/lib/animation/tracks/track.js +3 -2
  28. package/lib/behavior.js +13 -10
  29. package/lib/behaviors/ActivateState.d.ts +22 -24
  30. package/lib/behaviors/ActivateState.js +145 -35
  31. package/lib/behaviors/CallFunction.d.ts +2 -4
  32. package/lib/behaviors/CallFunction.js +69 -11
  33. package/lib/behaviors/ChangeRootScene.d.ts +35 -0
  34. package/lib/behaviors/ChangeRootScene.js +123 -0
  35. package/lib/behaviors/ConsoleLog.d.ts +6 -5
  36. package/lib/behaviors/ConsoleLog.js +95 -12
  37. package/lib/behaviors/DownloadSnapshot.d.ts +7 -12
  38. package/lib/behaviors/DownloadSnapshot.js +70 -19
  39. package/lib/behaviors/EmitComponentPropEvent.d.ts +1 -3
  40. package/lib/behaviors/EmitComponentPropEvent.js +80 -12
  41. package/lib/behaviors/LaunchURL.d.ts +5 -5
  42. package/lib/behaviors/LaunchURL.js +92 -10
  43. package/lib/behaviors/LogAnalyticsEvent.d.ts +10 -4
  44. package/lib/behaviors/LogAnalyticsEvent.js +88 -7
  45. package/lib/behaviors/PauseLayerClip.d.ts +7 -9
  46. package/lib/behaviors/PauseLayerClip.js +89 -21
  47. package/lib/behaviors/PlayLayerClip.d.ts +35 -32
  48. package/lib/behaviors/PlayLayerClip.js +202 -48
  49. package/lib/behaviors/PlaySound.d.ts +19 -25
  50. package/lib/behaviors/PlaySound.js +122 -28
  51. package/lib/behaviors/SetLayerOff.d.ts +7 -9
  52. package/lib/behaviors/SetLayerOff.js +88 -21
  53. package/lib/behaviors/ShareSnapshot.d.ts +5 -9
  54. package/lib/behaviors/ShareSnapshot.js +70 -17
  55. package/lib/behaviors/ShowTextAlert.d.ts +16 -29
  56. package/lib/behaviors/ShowTextAlert.js +116 -48
  57. package/lib/behaviors/TakeSnapshot.d.ts +22 -26
  58. package/lib/behaviors/TakeSnapshot.js +131 -56
  59. package/lib/behaviors/ToggleLayerClips.d.ts +45 -62
  60. package/lib/behaviors/ToggleLayerClips.js +233 -64
  61. package/lib/behaviors/stream/PauseStream.d.ts +5 -16
  62. package/lib/behaviors/stream/PauseStream.js +94 -34
  63. package/lib/behaviors/stream/PlayStream.d.ts +14 -27
  64. package/lib/behaviors/stream/PlayStream.js +123 -34
  65. package/lib/behaviors/stream/SeekStream.d.ts +8 -18
  66. package/lib/behaviors/stream/SeekStream.js +97 -31
  67. package/lib/behaviors/stream/StopStream.d.ts +6 -15
  68. package/lib/behaviors/stream/StopStream.js +89 -27
  69. package/lib/component.d.ts +36 -13
  70. package/lib/component.js +237 -151
  71. package/lib/components/AnimatedLoader.d.ts +51 -0
  72. package/lib/components/AnimatedLoader.js +159 -0
  73. package/lib/components/Audio.d.ts +35 -37
  74. package/lib/components/Audio.js +264 -151
  75. package/lib/components/AudioLayerSettings.d.ts +13 -11
  76. package/lib/components/AudioLayerSettings.js +76 -18
  77. package/lib/components/Children.d.ts +2 -1
  78. package/lib/components/Children.js +66 -13
  79. package/lib/components/ConditionalConstruct.d.ts +44 -0
  80. package/lib/components/ConditionalConstruct.js +142 -0
  81. package/lib/components/DefaultCookieConsent.d.ts +53 -73
  82. package/lib/components/DefaultCookieConsent.js +382 -264
  83. package/lib/components/DefaultLoader.d.ts +40 -28
  84. package/lib/components/DefaultLoader.js +198 -46
  85. package/lib/components/Gamepad.d.ts +5 -26
  86. package/lib/components/Gamepad.js +201 -65
  87. package/lib/components/LoaderScope.d.ts +15 -0
  88. package/lib/components/LoaderScope.js +71 -0
  89. package/lib/components/LongLoad.d.ts +11 -15
  90. package/lib/components/LongLoad.js +89 -34
  91. package/lib/components/SnapshotUI.d.ts +19 -24
  92. package/lib/components/SnapshotUI.js +202 -105
  93. package/lib/context.d.ts +23 -5
  94. package/lib/context.js +12 -6
  95. package/lib/contexts/analyticscontext.d.ts +12 -2
  96. package/lib/contexts/analyticscontext.js +68 -10
  97. package/lib/contexts/audiocontextcontext.d.ts +1 -1
  98. package/lib/contexts/audiocontextcontext.js +9 -8
  99. package/lib/contexts/canvascontext.d.ts +32 -18
  100. package/lib/contexts/canvascontext.js +195 -120
  101. package/lib/contexts/cookieconsentcontext.d.ts +38 -28
  102. package/lib/contexts/cookieconsentcontext.js +35 -32
  103. package/lib/contexts/documentflagmanager.js +15 -11
  104. package/lib/contexts/environmentcontext.d.ts +22 -6
  105. package/lib/contexts/environmentcontext.js +135 -21
  106. package/lib/contexts/gamepadcontext.d.ts +29 -26
  107. package/lib/contexts/gamepadcontext.js +46 -46
  108. package/lib/contexts/gesturecontext.d.ts +31 -6
  109. package/lib/contexts/gesturecontext.js +110 -85
  110. package/lib/contexts/globaltagcontext.d.ts +1 -1
  111. package/lib/contexts/globaltagcontext.js +8 -11
  112. package/lib/contexts/loadcontext.d.ts +45 -8
  113. package/lib/contexts/loadcontext.js +232 -82
  114. package/lib/contexts/orientationcontext.d.ts +13 -15
  115. package/lib/contexts/orientationcontext.js +150 -67
  116. package/lib/contexts/rootcomponentscontext.d.ts +16 -0
  117. package/lib/contexts/rootcomponentscontext.js +65 -0
  118. package/lib/contexts/snapshotContext.d.ts +0 -3
  119. package/lib/contexts/snapshotContext.js +78 -23
  120. package/lib/contexts/tagcontext.d.ts +5 -5
  121. package/lib/contexts/tagcontext.js +16 -16
  122. package/lib/contexts/textalertcontext.d.ts +1 -5
  123. package/lib/contexts/textalertcontext.js +1 -5
  124. package/lib/contexts/usereventcontext.d.ts +1 -1
  125. package/lib/contexts/usereventcontext.js +12 -12
  126. package/lib/data/animation.d.ts +10 -2
  127. package/lib/data/change.d.ts +1 -1
  128. package/lib/data/change.js +7 -0
  129. package/lib/data/core.d.ts +9 -1
  130. package/lib/data/index.d.ts +1 -1
  131. package/lib/data/index.js +1 -1
  132. package/lib/decorators.d.ts +348 -0
  133. package/lib/decorators.js +239 -0
  134. package/lib/decoratorutils.d.ts +3 -0
  135. package/lib/decoratorutils.js +8 -0
  136. package/lib/emitter.d.ts +15 -2
  137. package/lib/emitter.js +15 -6
  138. package/lib/entity.d.ts +43 -25
  139. package/lib/entity.js +104 -71
  140. package/lib/event.d.ts +2 -1
  141. package/lib/event.js +1 -4
  142. package/lib/groups.d.ts +18 -0
  143. package/lib/groups.js +19 -0
  144. package/lib/icons.d.ts +3372 -0
  145. package/lib/icons.js +1 -0
  146. package/lib/index.d.ts +18 -13
  147. package/lib/index.js +17 -13
  148. package/lib/inflate.d.ts +7 -7
  149. package/lib/inflate.js +5 -5
  150. package/lib/observable.d.ts +9 -2
  151. package/lib/observable.js +5 -4
  152. package/lib/observe.d.ts +18 -0
  153. package/lib/observe.js +177 -0
  154. package/lib/profile.d.ts +9 -5
  155. package/lib/profile.js +27 -17
  156. package/lib/selectors.d.ts +1 -1
  157. package/lib/selectors.js +5 -4
  158. package/lib/types.d.ts +161 -19
  159. package/lib/types.js +22 -1
  160. package/lib/values/values.d.ts +7 -8
  161. package/lib/values/values.js +1 -2
  162. package/lib/values/valuesmutator.d.ts +4 -1
  163. package/lib/values/valuesmutator.js +10 -8
  164. package/lib/zcomponent.d.ts +21 -10
  165. package/lib/zcomponent.js +717 -540
  166. package/package.json +22 -5
  167. package/lib/behaviors/ChangeCursor.d.ts +0 -39
  168. package/lib/behaviors/ChangeCursor.js +0 -44
@@ -1,52 +1,46 @@
1
1
  import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
2
2
  import { Component } from '../component';
3
+ import { AudioConstructorProps } from '../components/Audio';
3
4
  import { ContextManager } from '../context';
4
- import { Observable } from '../observable';
5
- export interface PlaySoundProps extends ActionBehaviorConstructorProps {
6
- /** @zprop
7
- * @zvalues files *.+(mp3|wav)
8
- */
9
- source: string;
10
- /**
11
- * @zprop
12
- * @zdefault default
13
- */
14
- audioLayer?: string;
5
+ export interface PlaySoundProps extends Omit<AudioConstructorProps, 'autoplay'>, ActionBehaviorConstructorProps {
15
6
  }
16
7
  /**
17
8
  * Plays a sound
18
- *
19
9
  * @zbehavior
20
10
  * @zicon volume_up
21
11
  * @zgroup Actions
22
12
  */
23
13
  export declare class PlaySound extends ActionBehavior<PlaySoundProps> {
24
- /** @zprop
25
- * @zdefault false
14
+ private readonly _component;
15
+ /**
16
+ * Whether the sound should loop
17
+ * @default false
18
+ * @zui
26
19
  * @zgroup Audio
27
20
  * @zgrouppriority 20
28
21
  */
29
- muted: Observable<boolean>;
22
+ muted: boolean;
30
23
  /**
31
- * @zprop
32
- * @ztype proportion
24
+ * The audio layer to play the sound on
25
+ * @default 1
26
+ * @zui
33
27
  * @zgroup Audio
34
28
  * @zgrouppriority 20
35
- * @zdefault 1
36
29
  */
37
- volume: Observable<number>;
30
+ volume: number;
38
31
  /**
39
- * @zprop
32
+ * The speed of the sound
33
+ * @default 1
34
+ * @zui
40
35
  * @zgroup Audio
41
36
  * @zgrouppriority 20
42
- * @zdefault 1
43
37
  */
44
- speed: Observable<number, never>;
45
- private _component;
38
+ speed: number;
46
39
  constructor(contextManager: ContextManager, instance: Component, props: PlaySoundProps);
47
- /** @zprop */
48
40
  perform(): void;
49
- /** @zui */
41
+ /**
42
+ * @zui
43
+ */
50
44
  preview(): void;
51
45
  dispose(): never;
52
46
  }
@@ -1,40 +1,134 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
1
35
  import { ActionBehavior } from '../actionbehavior';
2
- import { registerBehaviorRunAtDesignTime } from '../behavior';
3
36
  import { Audio } from '../components/Audio';
4
- import { Observable } from '../observable';
37
+ import { zBehavior, zObserve, zUI } from '../decorators';
38
+ import { BehaviorGroups } from '../groups';
39
+ const audioGroup = {
40
+ name: 'Audio',
41
+ priority: 20,
42
+ };
5
43
  /**
6
44
  * Plays a sound
7
- *
8
45
  * @zbehavior
9
46
  * @zicon volume_up
10
47
  * @zgroup Actions
11
48
  */
12
- export class PlaySound extends ActionBehavior {
13
- constructor(contextManager, instance, props) {
14
- super(contextManager, instance, props);
49
+ let PlaySound = (() => {
50
+ let _classDecorators = [zBehavior({ icon: 'volume_up', group: BehaviorGroups.Actions, runAtDesignTime: true })];
51
+ let _classDescriptor;
52
+ let _classExtraInitializers = [];
53
+ let _classThis;
54
+ let _classSuper = ActionBehavior;
55
+ let _instanceExtraInitializers = [];
56
+ let _muted_decorators;
57
+ let _muted_initializers = [];
58
+ let _muted_extraInitializers = [];
59
+ let _volume_decorators;
60
+ let _volume_initializers = [];
61
+ let _volume_extraInitializers = [];
62
+ let _speed_decorators;
63
+ let _speed_initializers = [];
64
+ let _speed_extraInitializers = [];
65
+ let _preview_decorators;
66
+ var PlaySound = class extends _classSuper {
67
+ static { _classThis = this; }
68
+ static {
69
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
70
+ _muted_decorators = [zUI({ group: audioGroup }), zObserve((v, instance) => {
71
+ instance._component.muted = v;
72
+ })];
73
+ _volume_decorators = [zUI({ group: audioGroup }), zObserve((v, instance) => {
74
+ instance._component.volume = v;
75
+ })];
76
+ _speed_decorators = [zUI({ group: audioGroup })];
77
+ _preview_decorators = [zUI()];
78
+ __esDecorate(this, null, _preview_decorators, { kind: "method", name: "preview", static: false, private: false, access: { has: obj => "preview" in obj, get: obj => obj.preview }, metadata: _metadata }, null, _instanceExtraInitializers);
79
+ __esDecorate(null, null, _muted_decorators, { kind: "field", name: "muted", static: false, private: false, access: { has: obj => "muted" in obj, get: obj => obj.muted, set: (obj, value) => { obj.muted = value; } }, metadata: _metadata }, _muted_initializers, _muted_extraInitializers);
80
+ __esDecorate(null, null, _volume_decorators, { kind: "field", name: "volume", static: false, private: false, access: { has: obj => "volume" in obj, get: obj => obj.volume, set: (obj, value) => { obj.volume = value; } }, metadata: _metadata }, _volume_initializers, _volume_extraInitializers);
81
+ __esDecorate(null, null, _speed_decorators, { kind: "field", name: "speed", static: false, private: false, access: { has: obj => "speed" in obj, get: obj => obj.speed, set: (obj, value) => { obj.speed = value; } }, metadata: _metadata }, _speed_initializers, _speed_extraInitializers);
82
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
83
+ PlaySound = _classThis = _classDescriptor.value;
84
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
85
+ __runInitializers(_classThis, _classExtraInitializers);
86
+ }
87
+ _component = __runInitializers(this, _instanceExtraInitializers);
15
88
  /**
16
- * @zprop
89
+ * Whether the sound should loop
90
+ * @default false
91
+ * @zui
17
92
  * @zgroup Audio
18
93
  * @zgrouppriority 20
19
- * @zdefault 1
20
94
  */
21
- this.speed = new Observable(1);
22
- this._component = new Audio(contextManager, props);
23
- this.muted = this._component.muted;
24
- this.volume = this._component.volume;
25
- }
26
- /** @zprop */
27
- perform() {
28
- this._component.seek(0);
29
- this._component.play({ speed: this.speed.value });
30
- }
31
- /** @zui */
32
- preview() {
33
- this.perform();
34
- }
35
- dispose() {
36
- this._component.dispose();
37
- return super.dispose();
38
- }
39
- }
40
- registerBehaviorRunAtDesignTime(PlaySound);
95
+ muted = __runInitializers(this, _muted_initializers, false);
96
+ /**
97
+ * The audio layer to play the sound on
98
+ * @default 1
99
+ * @zui
100
+ * @zgroup Audio
101
+ * @zgrouppriority 20
102
+ */
103
+ volume = (__runInitializers(this, _muted_extraInitializers), __runInitializers(this, _volume_initializers, 1));
104
+ /**
105
+ * The speed of the sound
106
+ * @default 1
107
+ * @zui
108
+ * @zgroup Audio
109
+ * @zgrouppriority 20
110
+ */
111
+ speed = (__runInitializers(this, _volume_extraInitializers), __runInitializers(this, _speed_initializers, 1));
112
+ constructor(contextManager, instance, props) {
113
+ super(contextManager, instance, props);
114
+ __runInitializers(this, _speed_extraInitializers);
115
+ this._component = new Audio(contextManager, props);
116
+ }
117
+ perform() {
118
+ this._component.seek(0);
119
+ this._component.play({ speed: this.speed });
120
+ }
121
+ /**
122
+ * @zui
123
+ */
124
+ preview() {
125
+ this.perform();
126
+ }
127
+ dispose() {
128
+ this._component.dispose();
129
+ return super.dispose();
130
+ }
131
+ };
132
+ return PlaySound = _classThis;
133
+ })();
134
+ export { PlaySound };
@@ -1,6 +1,4 @@
1
- import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
2
- import { Component } from '../component';
3
- import { ContextManager } from '../context';
1
+ import { ActionBehavior } from '../actionbehavior';
4
2
  /**
5
3
  * Deactivates a layer
6
4
  * @zbehavior
@@ -8,15 +6,15 @@ import { ContextManager } from '../context';
8
6
  * @zgroup Animation Actions
9
7
  */
10
8
  export declare class SetLayerOff extends ActionBehavior {
11
- private zcomponent;
9
+ private readonly zcomponent;
12
10
  /**
13
- * @zprop
11
+ * @zui
14
12
  * @zvalues layerids
15
13
  */
16
- layer: string | undefined;
17
- constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
18
- /** @zprop */
14
+ layer?: string;
19
15
  perform(): void;
20
- /** @zui */
16
+ /**
17
+ * @zui
18
+ */
21
19
  preview(): void;
22
20
  }
@@ -1,28 +1,95 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
1
35
  import { ActionBehavior } from '../actionbehavior';
2
- import { registerBehaviorRunAtDesignTime } from '../behavior';
36
+ import { zBehavior, zUI } from '../decorators';
37
+ import { BehaviorGroups } from '../groups';
3
38
  /**
4
39
  * Deactivates a layer
5
40
  * @zbehavior
6
41
  * @zicon toggle_off
7
42
  * @zgroup Animation Actions
8
43
  */
9
- export class SetLayerOff extends ActionBehavior {
10
- constructor(contextManager, instance, props) {
11
- super(contextManager, instance, props);
12
- this.zcomponent = this.getZComponentInstance();
13
- }
14
- /** @zprop */
15
- perform() {
16
- if (!this.layer)
17
- return;
18
- const layer = this.zcomponent.animation.layerByID.get(this.layer);
19
- if (!layer)
20
- return;
21
- layer.active = null;
22
- }
23
- /** @zui */
24
- preview() {
25
- this.perform();
26
- }
27
- }
28
- registerBehaviorRunAtDesignTime(SetLayerOff);
44
+ let SetLayerOff = (() => {
45
+ let _classDecorators = [zBehavior({ icon: 'toggle_off', group: BehaviorGroups.AnimationActions, runAtDesignTime: true })];
46
+ let _classDescriptor;
47
+ let _classExtraInitializers = [];
48
+ let _classThis;
49
+ let _classSuper = ActionBehavior;
50
+ let _instanceExtraInitializers = [];
51
+ let _layer_decorators;
52
+ let _layer_initializers = [];
53
+ let _layer_extraInitializers = [];
54
+ let _preview_decorators;
55
+ var SetLayerOff = class extends _classSuper {
56
+ static { _classThis = this; }
57
+ static {
58
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
59
+ _layer_decorators = [zUI({ values: 'layerids' })];
60
+ _preview_decorators = [zUI()];
61
+ __esDecorate(this, null, _preview_decorators, { kind: "method", name: "preview", static: false, private: false, access: { has: obj => "preview" in obj, get: obj => obj.preview }, metadata: _metadata }, null, _instanceExtraInitializers);
62
+ __esDecorate(null, null, _layer_decorators, { kind: "field", name: "layer", static: false, private: false, access: { has: obj => "layer" in obj, get: obj => obj.layer, set: (obj, value) => { obj.layer = value; } }, metadata: _metadata }, _layer_initializers, _layer_extraInitializers);
63
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
64
+ SetLayerOff = _classThis = _classDescriptor.value;
65
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
66
+ __runInitializers(_classThis, _classExtraInitializers);
67
+ }
68
+ zcomponent = (__runInitializers(this, _instanceExtraInitializers), this.getZComponentInstance());
69
+ /**
70
+ * @zui
71
+ * @zvalues layerids
72
+ */
73
+ layer = __runInitializers(this, _layer_initializers, void 0);
74
+ perform() {
75
+ if (!this.layer)
76
+ return;
77
+ const layer = this.zcomponent.animation.layerByID.get(this.layer);
78
+ if (!layer)
79
+ return;
80
+ layer.active = null;
81
+ }
82
+ /**
83
+ * @zui
84
+ */
85
+ preview() {
86
+ this.perform();
87
+ }
88
+ constructor() {
89
+ super(...arguments);
90
+ __runInitializers(this, _layer_extraInitializers);
91
+ }
92
+ };
93
+ return SetLayerOff = _classThis;
94
+ })();
95
+ export { SetLayerOff };
@@ -1,22 +1,18 @@
1
- import { ActionBehaviorConstructorProps, ActionBehavior } from '../actionbehavior';
2
- import { Component } from '../component';
3
- import { ContextManager } from '../context';
1
+ import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
4
2
  import { Event } from '../event';
5
3
  export type ShareCanvasProps = ActionBehaviorConstructorProps;
6
4
  /**
7
5
  * Shares the captured canvas using the Web Share API.
8
- *
9
6
  * @zbehavior
10
7
  * @zicon share
11
8
  * @zgroup Actions
12
9
  */
13
10
  export declare class ShareSnapshot extends ActionBehavior<ShareCanvasProps> {
14
- /** @zui */
15
- onShare: Event<[]>;
16
- constructor(contextManager: ContextManager, instance: Component, props: ShareCanvasProps);
17
- /** @zprop */
11
+ readonly onShare: Event<[]>;
18
12
  perform(): void;
19
13
  private share;
20
- /** @zui */
14
+ /**
15
+ * @zui
16
+ */
21
17
  preview(): void;
22
18
  }
@@ -1,19 +1,72 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
1
35
  import { ActionBehavior } from '../actionbehavior';
2
36
  import { SnapshotContext } from '../contexts/snapshotContext';
37
+ import { zBehavior, zUI } from '../decorators';
3
38
  import { Event } from '../event';
39
+ import { BehaviorGroups } from '../groups';
4
40
  /**
5
41
  * Shares the captured canvas using the Web Share API.
6
- *
7
42
  * @zbehavior
8
43
  * @zicon share
9
44
  * @zgroup Actions
10
45
  */
11
- export class ShareSnapshot extends ActionBehavior {
12
- constructor(contextManager, instance, props) {
13
- super(contextManager, instance, props);
14
- /** @zui */
15
- this.onShare = new Event();
16
- this.share = async () => {
46
+ let ShareSnapshot = (() => {
47
+ let _classDecorators = [zBehavior({ icon: 'share', group: BehaviorGroups.Actions })];
48
+ let _classDescriptor;
49
+ let _classExtraInitializers = [];
50
+ let _classThis;
51
+ let _classSuper = ActionBehavior;
52
+ let _instanceExtraInitializers = [];
53
+ let _preview_decorators;
54
+ var ShareSnapshot = class extends _classSuper {
55
+ static { _classThis = this; }
56
+ static {
57
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
58
+ _preview_decorators = [zUI()];
59
+ __esDecorate(this, null, _preview_decorators, { kind: "method", name: "preview", static: false, private: false, access: { has: obj => "preview" in obj, get: obj => obj.preview }, metadata: _metadata }, null, _instanceExtraInitializers);
60
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
61
+ ShareSnapshot = _classThis = _classDescriptor.value;
62
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
63
+ __runInitializers(_classThis, _classExtraInitializers);
64
+ }
65
+ onShare = (__runInitializers(this, _instanceExtraInitializers), new Event());
66
+ perform() {
67
+ this.share();
68
+ }
69
+ share = async () => {
17
70
  const sctx = this.contextManager.get(SnapshotContext);
18
71
  const snapshotContext = this.contextManager.get(SnapshotContext);
19
72
  if (sctx.shareAPISupported.value === false) {
@@ -32,13 +85,13 @@ export class ShareSnapshot extends ActionBehavior {
32
85
  console.error('Error - Sharing', err);
33
86
  }
34
87
  };
35
- }
36
- /** @zprop */
37
- perform() {
38
- this.share();
39
- }
40
- /** @zui */
41
- preview() {
42
- this.perform();
43
- }
44
- }
88
+ /**
89
+ * @zui
90
+ */
91
+ preview() {
92
+ this.perform();
93
+ }
94
+ };
95
+ return ShareSnapshot = _classThis;
96
+ })();
97
+ export { ShareSnapshot };
@@ -1,8 +1,6 @@
1
1
  import { ActionBehavior } from '../actionbehavior';
2
- import { Observable } from '../observable';
3
2
  /**
4
3
  * Displays a pop-up text alert on screen.
5
- *
6
4
  * @zbehavior
7
5
  * @zicon sms
8
6
  * @zgroup Actions
@@ -10,56 +8,45 @@ import { Observable } from '../observable';
10
8
  export declare class ShowTextAlert extends ActionBehavior {
11
9
  /**
12
10
  * The text to show in the alert
13
- * @zprop
14
- * @zgroup ShowTextAlert
15
- * @zgrouppriority 20
11
+ * @default ""
16
12
  */
17
- text: Observable<string, never>;
13
+ text: string;
18
14
  /**
19
15
  * The time (in milliseconds) that the text alert should remain on screen
20
- *
21
- * @zprop
22
- * @zgroup Appearance
23
- * @zgrouppriority 10
24
- * @zdefault 3000
16
+ * @default 3000
17
+ * @zui
25
18
  * @ztype time-milliseconds
26
19
  */
27
- timeout: Observable<number, never>;
20
+ timeout: number;
28
21
  /**
29
22
  * The color of the background of the text alert
30
- *
31
- * @zprop
23
+ * @default "#000000"
24
+ * @zui
32
25
  * @zgroup Appearance
33
26
  * @zgrouppriority 10
34
- * @zdefault black
35
27
  * @ztype color-hex
36
28
  */
37
- backgroundColor: Observable<string, never>;
29
+ backgroundColor: string;
38
30
  /**
39
31
  * The color of the text of the text alert
40
- *
41
- * @zprop
32
+ * @default "#ffffff"
33
+ * @zui
42
34
  * @zgroup Appearance
43
35
  * @zgrouppriority 10
44
- * @zdefault #ffffff
45
36
  * @ztype color-hex
46
37
  */
47
- textColor: Observable<string, never>;
38
+ textColor: string;
48
39
  /**
49
40
  * Additional CSS class names to add to the alert DOM element
50
- *
51
- * @zprop
41
+ * @default []
42
+ * @zui
52
43
  * @zgroup Appearance
53
44
  * @zgrouppriority 10
54
- * @zdefault []
55
45
  */
56
- classNames: Observable<string[], never>;
46
+ classNames: string[];
47
+ perform(): void;
57
48
  /**
58
- * How long the alert will apear on the screen
59
- *
60
- * @zprop
49
+ * @zui
61
50
  */
62
- perform(): void;
63
- /** @zui */
64
51
  preview(): void;
65
52
  }