@zcomponent/core 2.0.0-alpha.1 → 2.0.0-alpha.3

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 (167) hide show
  1. package/css/zcomponent.css +121 -122
  2. package/index.js +0 -3
  3. package/lib/actionbehavior.d.ts +3 -3
  4. package/lib/actionbehavior.js +20 -19
  5. package/lib/animation/animation.d.ts +13 -6
  6. package/lib/animation/animation.js +56 -43
  7. package/lib/animation/bezier.d.ts +6 -0
  8. package/lib/animation/bezier.js +8 -2
  9. package/lib/animation/clips/clip.d.ts +13 -1
  10. package/lib/animation/clips/clip.js +34 -14
  11. package/lib/animation/index.d.ts +4 -4
  12. package/lib/animation/index.js +4 -4
  13. package/lib/animation/layer.d.ts +9 -0
  14. package/lib/animation/layer.js +33 -12
  15. package/lib/animation/layerclip.d.ts +21 -0
  16. package/lib/animation/layerclip.js +82 -45
  17. package/lib/animation/tracks/cliptrack.d.ts +18 -0
  18. package/lib/animation/tracks/cliptrack.js +27 -6
  19. package/lib/animation/tracks/functiontrack.d.ts +9 -0
  20. package/lib/animation/tracks/functiontrack.js +16 -3
  21. package/lib/animation/tracks/propertytrack.d.ts +20 -1
  22. package/lib/animation/tracks/propertytrack.js +48 -11
  23. package/lib/animation/tracks/streamtrack.d.ts +18 -0
  24. package/lib/animation/tracks/streamtrack.js +44 -7
  25. package/lib/animation/tracks/track.d.ts +8 -2
  26. package/lib/animation/tracks/track.js +3 -2
  27. package/lib/behavior.js +13 -10
  28. package/lib/behaviors/ActivateState.d.ts +22 -24
  29. package/lib/behaviors/ActivateState.js +145 -35
  30. package/lib/behaviors/CallFunction.d.ts +2 -4
  31. package/lib/behaviors/CallFunction.js +69 -11
  32. package/lib/behaviors/ChangeRootScene.d.ts +35 -0
  33. package/lib/behaviors/ChangeRootScene.js +123 -0
  34. package/lib/behaviors/ConsoleLog.d.ts +6 -5
  35. package/lib/behaviors/ConsoleLog.js +95 -12
  36. package/lib/behaviors/DownloadSnapshot.d.ts +7 -12
  37. package/lib/behaviors/DownloadSnapshot.js +70 -19
  38. package/lib/behaviors/EmitComponentPropEvent.d.ts +1 -3
  39. package/lib/behaviors/EmitComponentPropEvent.js +80 -12
  40. package/lib/behaviors/LaunchURL.d.ts +5 -5
  41. package/lib/behaviors/LaunchURL.js +92 -10
  42. package/lib/behaviors/LogAnalyticsEvent.d.ts +10 -4
  43. package/lib/behaviors/LogAnalyticsEvent.js +88 -7
  44. package/lib/behaviors/PauseLayerClip.d.ts +7 -9
  45. package/lib/behaviors/PauseLayerClip.js +89 -21
  46. package/lib/behaviors/PlayLayerClip.d.ts +35 -32
  47. package/lib/behaviors/PlayLayerClip.js +202 -48
  48. package/lib/behaviors/PlaySound.d.ts +19 -25
  49. package/lib/behaviors/PlaySound.js +122 -28
  50. package/lib/behaviors/SetLayerOff.d.ts +7 -9
  51. package/lib/behaviors/SetLayerOff.js +88 -21
  52. package/lib/behaviors/ShareSnapshot.d.ts +5 -9
  53. package/lib/behaviors/ShareSnapshot.js +70 -17
  54. package/lib/behaviors/ShowTextAlert.d.ts +16 -29
  55. package/lib/behaviors/ShowTextAlert.js +116 -48
  56. package/lib/behaviors/TakeSnapshot.d.ts +22 -26
  57. package/lib/behaviors/TakeSnapshot.js +131 -56
  58. package/lib/behaviors/ToggleLayerClips.d.ts +45 -62
  59. package/lib/behaviors/ToggleLayerClips.js +233 -64
  60. package/lib/behaviors/stream/PauseStream.d.ts +5 -16
  61. package/lib/behaviors/stream/PauseStream.js +94 -34
  62. package/lib/behaviors/stream/PlayStream.d.ts +14 -27
  63. package/lib/behaviors/stream/PlayStream.js +123 -34
  64. package/lib/behaviors/stream/SeekStream.d.ts +8 -18
  65. package/lib/behaviors/stream/SeekStream.js +97 -31
  66. package/lib/behaviors/stream/StopStream.d.ts +6 -15
  67. package/lib/behaviors/stream/StopStream.js +89 -27
  68. package/lib/component.d.ts +36 -13
  69. package/lib/component.js +237 -151
  70. package/lib/components/AnimatedLoader.d.ts +51 -0
  71. package/lib/components/AnimatedLoader.js +159 -0
  72. package/lib/components/Audio.d.ts +35 -37
  73. package/lib/components/Audio.js +264 -151
  74. package/lib/components/AudioLayerSettings.d.ts +13 -11
  75. package/lib/components/AudioLayerSettings.js +76 -18
  76. package/lib/components/Children.d.ts +2 -1
  77. package/lib/components/Children.js +66 -13
  78. package/lib/components/ConditionalConstruct.d.ts +44 -0
  79. package/lib/components/ConditionalConstruct.js +142 -0
  80. package/lib/components/DefaultCookieConsent.d.ts +53 -73
  81. package/lib/components/DefaultCookieConsent.js +382 -264
  82. package/lib/components/DefaultLoader.d.ts +40 -28
  83. package/lib/components/DefaultLoader.js +198 -46
  84. package/lib/components/Gamepad.d.ts +5 -26
  85. package/lib/components/Gamepad.js +201 -65
  86. package/lib/components/LoaderScope.d.ts +15 -0
  87. package/lib/components/LoaderScope.js +71 -0
  88. package/lib/components/LongLoad.d.ts +11 -15
  89. package/lib/components/LongLoad.js +89 -34
  90. package/lib/components/SnapshotUI.d.ts +19 -24
  91. package/lib/components/SnapshotUI.js +202 -105
  92. package/lib/context.d.ts +23 -5
  93. package/lib/context.js +12 -6
  94. package/lib/contexts/analyticscontext.d.ts +12 -2
  95. package/lib/contexts/analyticscontext.js +68 -10
  96. package/lib/contexts/audiocontextcontext.d.ts +1 -1
  97. package/lib/contexts/audiocontextcontext.js +9 -8
  98. package/lib/contexts/canvascontext.d.ts +32 -18
  99. package/lib/contexts/canvascontext.js +195 -120
  100. package/lib/contexts/cookieconsentcontext.d.ts +38 -28
  101. package/lib/contexts/cookieconsentcontext.js +35 -32
  102. package/lib/contexts/documentflagmanager.js +15 -11
  103. package/lib/contexts/environmentcontext.d.ts +22 -6
  104. package/lib/contexts/environmentcontext.js +135 -21
  105. package/lib/contexts/gamepadcontext.d.ts +29 -26
  106. package/lib/contexts/gamepadcontext.js +46 -46
  107. package/lib/contexts/gesturecontext.d.ts +31 -6
  108. package/lib/contexts/gesturecontext.js +110 -85
  109. package/lib/contexts/globaltagcontext.d.ts +1 -1
  110. package/lib/contexts/globaltagcontext.js +8 -11
  111. package/lib/contexts/loadcontext.d.ts +45 -8
  112. package/lib/contexts/loadcontext.js +232 -82
  113. package/lib/contexts/orientationcontext.d.ts +13 -15
  114. package/lib/contexts/orientationcontext.js +150 -67
  115. package/lib/contexts/rootcomponentscontext.d.ts +16 -0
  116. package/lib/contexts/rootcomponentscontext.js +65 -0
  117. package/lib/contexts/snapshotContext.d.ts +0 -3
  118. package/lib/contexts/snapshotContext.js +78 -23
  119. package/lib/contexts/tagcontext.d.ts +5 -5
  120. package/lib/contexts/tagcontext.js +16 -16
  121. package/lib/contexts/textalertcontext.d.ts +1 -5
  122. package/lib/contexts/textalertcontext.js +1 -5
  123. package/lib/contexts/usereventcontext.d.ts +1 -1
  124. package/lib/contexts/usereventcontext.js +12 -12
  125. package/lib/data/animation.d.ts +10 -2
  126. package/lib/data/change.d.ts +1 -1
  127. package/lib/data/change.js +7 -0
  128. package/lib/data/core.d.ts +9 -1
  129. package/lib/data/index.d.ts +1 -1
  130. package/lib/data/index.js +1 -1
  131. package/lib/decorators.d.ts +348 -0
  132. package/lib/decorators.js +239 -0
  133. package/lib/decoratorutils.d.ts +3 -0
  134. package/lib/decoratorutils.js +8 -0
  135. package/lib/emitter.d.ts +15 -2
  136. package/lib/emitter.js +15 -6
  137. package/lib/entity.d.ts +43 -25
  138. package/lib/entity.js +104 -71
  139. package/lib/event.d.ts +2 -1
  140. package/lib/event.js +1 -4
  141. package/lib/groups.d.ts +18 -0
  142. package/lib/groups.js +19 -0
  143. package/lib/icons.d.ts +3372 -0
  144. package/lib/icons.js +1 -0
  145. package/lib/index.d.ts +18 -13
  146. package/lib/index.js +17 -13
  147. package/lib/inflate.d.ts +7 -7
  148. package/lib/inflate.js +5 -5
  149. package/lib/observable.d.ts +9 -2
  150. package/lib/observable.js +5 -4
  151. package/lib/observe.d.ts +18 -0
  152. package/lib/observe.js +177 -0
  153. package/lib/profile.d.ts +9 -5
  154. package/lib/profile.js +27 -17
  155. package/lib/selectors.d.ts +1 -1
  156. package/lib/selectors.js +5 -4
  157. package/lib/types.d.ts +161 -19
  158. package/lib/types.js +22 -1
  159. package/lib/values/values.d.ts +7 -8
  160. package/lib/values/values.js +1 -2
  161. package/lib/values/valuesmutator.d.ts +4 -1
  162. package/lib/values/valuesmutator.js +10 -8
  163. package/lib/zcomponent.d.ts +21 -10
  164. package/lib/zcomponent.js +717 -540
  165. package/package.json +84 -67
  166. package/lib/behaviors/ChangeCursor.d.ts +0 -39
  167. package/lib/behaviors/ChangeCursor.js +0 -44
@@ -1,19 +1,101 @@
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';
36
+ import { zBehavior, zUI } from '../decorators';
37
+ import { BehaviorGroups } from '../groups';
2
38
  /**
3
39
  * Navigates the user to the provided URL.
4
40
  *
5
41
  * **Important Note**: Safari on iOS will not open URLs in new tabs for pointer events except `onPointerUp`.
6
- *
7
42
  * @zbehavior
8
43
  * @zicon open_in_new
9
44
  * @zgroup Actions
10
45
  */
11
- export class LaunchURL extends ActionBehavior {
12
- /** @zprop */
13
- perform() {
14
- if (this.openInNew ?? true)
15
- window.open(this.url, '_blank', 'noopener noreferrer');
16
- else
17
- window.location.href = this.url;
18
- }
19
- }
46
+ let LaunchURL = (() => {
47
+ let _classDecorators = [zBehavior({ icon: 'open_in_new', group: BehaviorGroups.Actions, runAtDesignTime: true })];
48
+ let _classDescriptor;
49
+ let _classExtraInitializers = [];
50
+ let _classThis;
51
+ let _classSuper = ActionBehavior;
52
+ let _instanceExtraInitializers = [];
53
+ let _url_decorators;
54
+ let _url_initializers = [];
55
+ let _url_extraInitializers = [];
56
+ let _openInNew_decorators;
57
+ let _openInNew_initializers = [];
58
+ let _openInNew_extraInitializers = [];
59
+ let _perform_decorators;
60
+ var LaunchURL = class extends _classSuper {
61
+ static { _classThis = this; }
62
+ static {
63
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
64
+ _url_decorators = [zUI()];
65
+ _openInNew_decorators = [zUI()];
66
+ _perform_decorators = [zUI()];
67
+ __esDecorate(this, null, _perform_decorators, { kind: "method", name: "perform", static: false, private: false, access: { has: obj => "perform" in obj, get: obj => obj.perform }, metadata: _metadata }, null, _instanceExtraInitializers);
68
+ __esDecorate(null, null, _url_decorators, { kind: "field", name: "url", static: false, private: false, access: { has: obj => "url" in obj, get: obj => obj.url, set: (obj, value) => { obj.url = value; } }, metadata: _metadata }, _url_initializers, _url_extraInitializers);
69
+ __esDecorate(null, null, _openInNew_decorators, { kind: "field", name: "openInNew", static: false, private: false, access: { has: obj => "openInNew" in obj, get: obj => obj.openInNew, set: (obj, value) => { obj.openInNew = value; } }, metadata: _metadata }, _openInNew_initializers, _openInNew_extraInitializers);
70
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
71
+ LaunchURL = _classThis = _classDescriptor.value;
72
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
73
+ __runInitializers(_classThis, _classExtraInitializers);
74
+ }
75
+ /**
76
+ * The URL to open
77
+ * @default "https://www.example.com/"
78
+ */
79
+ url = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _url_initializers, 'https://www.example.com/'));
80
+ /**
81
+ * If true, the URL will be opened in a new tab (using target '_blank')
82
+ * @default true
83
+ */
84
+ openInNew = (__runInitializers(this, _url_extraInitializers), __runInitializers(this, _openInNew_initializers, true));
85
+ /**
86
+ * @zui
87
+ */
88
+ perform() {
89
+ if (this.openInNew ?? true)
90
+ window.open(this.url, '_blank', 'noopener noreferrer');
91
+ else
92
+ window.location.href = this.url;
93
+ }
94
+ constructor() {
95
+ super(...arguments);
96
+ __runInitializers(this, _openInNew_extraInitializers);
97
+ }
98
+ };
99
+ return LaunchURL = _classThis;
100
+ })();
101
+ export { LaunchURL };
@@ -3,16 +3,22 @@ import { ActionBehavior } from '../actionbehavior';
3
3
  * Logs an event through the currently configured analytics provider(s).
4
4
  *
5
5
  * Note: you must have added an analytics provider to the Hierarchy in one of your components for this behavior to have any effect.
6
- *
7
6
  * @zbehavior
8
7
  * @zicon analytics
9
8
  * @zgroup Actions
10
9
  */
11
10
  export declare class LogAnalyticsEvent extends ActionBehavior {
12
- /** @zprop */
11
+ /**
12
+ * The name of the event to log
13
+ * @default ""
14
+ */
13
15
  name: string;
14
- /** @zprop */
16
+ /**
17
+ * The parameters to log with the event
18
+ */
15
19
  params: any;
16
- /** @zprop */
20
+ /**
21
+ * @zui
22
+ */
17
23
  perform(): void;
18
24
  }
@@ -1,17 +1,98 @@
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 { logEvent } from '../contexts/analyticscontext';
37
+ import { zBehavior, zUI } from '../decorators';
38
+ import { BehaviorGroups } from '../groups';
3
39
  /**
4
40
  * Logs an event through the currently configured analytics provider(s).
5
41
  *
6
42
  * Note: you must have added an analytics provider to the Hierarchy in one of your components for this behavior to have any effect.
7
- *
8
43
  * @zbehavior
9
44
  * @zicon analytics
10
45
  * @zgroup Actions
11
46
  */
12
- export class LogAnalyticsEvent extends ActionBehavior {
13
- /** @zprop */
14
- perform() {
15
- logEvent(this.contextManager, this.name, this.params);
16
- }
17
- }
47
+ let LogAnalyticsEvent = (() => {
48
+ let _classDecorators = [zBehavior({ icon: 'analytics', group: BehaviorGroups.Actions })];
49
+ let _classDescriptor;
50
+ let _classExtraInitializers = [];
51
+ let _classThis;
52
+ let _classSuper = ActionBehavior;
53
+ let _instanceExtraInitializers = [];
54
+ let _name_decorators;
55
+ let _name_initializers = [];
56
+ let _name_extraInitializers = [];
57
+ let _params_decorators;
58
+ let _params_initializers = [];
59
+ let _params_extraInitializers = [];
60
+ let _perform_decorators;
61
+ var LogAnalyticsEvent = class extends _classSuper {
62
+ static { _classThis = this; }
63
+ static {
64
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
65
+ _name_decorators = [zUI()];
66
+ _params_decorators = [zUI()];
67
+ _perform_decorators = [zUI()];
68
+ __esDecorate(this, null, _perform_decorators, { kind: "method", name: "perform", static: false, private: false, access: { has: obj => "perform" in obj, get: obj => obj.perform }, metadata: _metadata }, null, _instanceExtraInitializers);
69
+ __esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
70
+ __esDecorate(null, null, _params_decorators, { kind: "field", name: "params", static: false, private: false, access: { has: obj => "params" in obj, get: obj => obj.params, set: (obj, value) => { obj.params = value; } }, metadata: _metadata }, _params_initializers, _params_extraInitializers);
71
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
72
+ LogAnalyticsEvent = _classThis = _classDescriptor.value;
73
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
74
+ __runInitializers(_classThis, _classExtraInitializers);
75
+ }
76
+ /**
77
+ * The name of the event to log
78
+ * @default ""
79
+ */
80
+ name = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _name_initializers, ''));
81
+ /**
82
+ * The parameters to log with the event
83
+ */
84
+ params = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _params_initializers, void 0));
85
+ /**
86
+ * @zui
87
+ */
88
+ perform() {
89
+ logEvent(this.contextManager, this.name, this.params);
90
+ }
91
+ constructor() {
92
+ super(...arguments);
93
+ __runInitializers(this, _params_extraInitializers);
94
+ }
95
+ };
96
+ return LogAnalyticsEvent = _classThis;
97
+ })();
98
+ export { LogAnalyticsEvent };
@@ -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
  * Behavior to pause a specific layer clip animation.
6
4
  * @zbehavior
@@ -8,16 +6,16 @@ import { ContextManager } from '../context';
8
6
  * @zgroup Animation Actions
9
7
  */
10
8
  export declare class PauseLayerClip extends ActionBehavior {
11
- private zcomponent;
9
+ private readonly zcomponent;
12
10
  /**
13
11
  * The ID of the layer clip to be paused.
14
- * @zprop
12
+ * @zui
15
13
  * @zvalues layerclipids
16
14
  */
17
- layerClip: string | undefined;
18
- constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
19
- /** @zprop */
15
+ layerClip?: string;
20
16
  perform(): void;
21
- /** @zui */
17
+ /**
18
+ * @zui
19
+ */
22
20
  preview(): void;
23
21
  }
@@ -1,28 +1,96 @@
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
  * Behavior to pause a specific layer clip animation.
5
40
  * @zbehavior
6
41
  * @zicon pause_circle
7
42
  * @zgroup Animation Actions
8
43
  */
9
- export class PauseLayerClip 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.layerClip)
17
- return;
18
- const layerclip = this.zcomponent.animation.layerClipByID.get(this.layerClip);
19
- if (!layerclip)
20
- return;
21
- layerclip.pause();
22
- }
23
- /** @zui */
24
- preview() {
25
- this.perform();
26
- }
27
- }
28
- registerBehaviorRunAtDesignTime(PauseLayerClip);
44
+ let PauseLayerClip = (() => {
45
+ let _classDecorators = [zBehavior({ runAtDesignTime: true, icon: 'pause_circle', group: BehaviorGroups.AnimationActions })];
46
+ let _classDescriptor;
47
+ let _classExtraInitializers = [];
48
+ let _classThis;
49
+ let _classSuper = ActionBehavior;
50
+ let _instanceExtraInitializers = [];
51
+ let _layerClip_decorators;
52
+ let _layerClip_initializers = [];
53
+ let _layerClip_extraInitializers = [];
54
+ let _preview_decorators;
55
+ var PauseLayerClip = 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
+ _layerClip_decorators = [zUI({ values: 'layerclipids' })];
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, _layerClip_decorators, { kind: "field", name: "layerClip", static: false, private: false, access: { has: obj => "layerClip" in obj, get: obj => obj.layerClip, set: (obj, value) => { obj.layerClip = value; } }, metadata: _metadata }, _layerClip_initializers, _layerClip_extraInitializers);
63
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
64
+ PauseLayerClip = _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
+ * The ID of the layer clip to be paused.
71
+ * @zui
72
+ * @zvalues layerclipids
73
+ */
74
+ layerClip = __runInitializers(this, _layerClip_initializers, void 0);
75
+ perform() {
76
+ if (!this.layerClip)
77
+ return;
78
+ const layerclip = this.zcomponent.animation.layerClipByID.get(this.layerClip);
79
+ if (!layerclip)
80
+ return;
81
+ layerclip.pause();
82
+ }
83
+ /**
84
+ * @zui
85
+ */
86
+ preview() {
87
+ this.perform();
88
+ }
89
+ constructor() {
90
+ super(...arguments);
91
+ __runInitializers(this, _layerClip_extraInitializers);
92
+ }
93
+ };
94
+ return PauseLayerClip = _classThis;
95
+ })();
96
+ export { PauseLayerClip };
@@ -1,6 +1,6 @@
1
- import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
2
- import { Component } from '../component';
3
- import { ContextManager } from '../context';
1
+ import { ActionBehavior } from '../actionbehavior';
2
+ import { Easing } from '../data';
3
+ import { ValueOf } from '../types';
4
4
  /**
5
5
  * Behavior to play a specified layer clip animation.
6
6
  * @zbehavior
@@ -8,10 +8,10 @@ import { ContextManager } from '../context';
8
8
  * @zgroup Animation Actions
9
9
  */
10
10
  export declare class PlayLayerClip extends ActionBehavior {
11
- private zcomponent;
11
+ private readonly zcomponent;
12
12
  /**
13
13
  * The ID of the layer clip to be played.
14
- * @zprop
14
+ * @zui
15
15
  * @zgroup Play Settings
16
16
  * @zgrouppriority 20
17
17
  * @zvalues layerclipids
@@ -19,68 +19,71 @@ export declare class PlayLayerClip extends ActionBehavior {
19
19
  layerClip: string | undefined;
20
20
  /**
21
21
  * Whether the layer clip should loop.
22
- * @zprop
22
+ *
23
+ * @default false
24
+ * @default false
25
+ * @zui
23
26
  * @zgroup Play Settings
24
27
  * @zgrouppriority 20
25
- * @zdefault false
26
28
  */
27
- loop?: boolean;
29
+ loop: boolean;
28
30
  /**
29
31
  * The playback speed of the layer clip.
30
- * @zprop
32
+ *
33
+ * @default 1
34
+ * @default 1
35
+ * @zui
31
36
  * @zgroup Play Settings
32
37
  * @zgrouppriority 20
33
- * @zdefault 1
34
38
  */
35
- speed?: number;
39
+ speed: number;
36
40
  /**
37
41
  * Whether to queue the layer clip in the animation sequence.
38
- * @zprop
42
+ * @default false
43
+ * @zui
39
44
  * @zgroup Play Settings
40
45
  * @zgrouppriority 20
41
- * @zdefault false
42
46
  */
43
47
  queue: boolean;
44
48
  /**
45
49
  * Whether to seek the layer clip to the start before playing.
46
- *
47
- * @zprop
50
+ * @default false
51
+ * @zui
48
52
  * @zgroup Play Settings
49
53
  * @zgrouppriority 20
50
- * @zdefault false
51
54
  */
52
55
  fromStart: boolean;
53
56
  /**
54
- * Override time for the fade transition.
55
- * @zprop
57
+ * Override time for the fade transition.
58
+ * @zui
56
59
  * @zgroup Override Fade
57
60
  * @zgrouppriority 10
58
61
  * @ztype time-milliseconds
59
62
  */
60
63
  fadeTime?: number;
61
64
  /**
62
- * @zprop
65
+ * @zui
63
66
  * @zgroup Override Fade
64
67
  * @zgrouppriority 10
65
- * @zdefault 0
66
68
  */
67
- pin?: Pin | number;
69
+ pin?: PinValue | number;
68
70
  /**
69
- * @zprop
71
+ * @default "linear"
72
+ * @zui
70
73
  * @zgroup Override Fade
71
74
  * @zgrouppriority 10
72
- * @zdefault 0
73
75
  * @zvalues easings
74
76
  */
75
- easing?: string;
76
- constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
77
- /** @zprop */
77
+ easing: Easing;
78
78
  perform(): void;
79
- /** @zui */
79
+ /**
80
+ * @zui
81
+ */
80
82
  preview(): void;
81
83
  }
82
- export declare enum Pin {
83
- Start = 0,
84
- Middle = 0.5,
85
- End = 1
86
- }
84
+ export declare const Pin: {
85
+ readonly Start: 0;
86
+ readonly Middle: 0.5;
87
+ readonly End: 1;
88
+ };
89
+ export type PinValue = ValueOf<typeof Pin>;