@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
@@ -0,0 +1,123 @@
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
+ };
35
+ import { ActionBehavior } from '../actionbehavior';
36
+ import { registerLoadable } from '../contexts/loadcontext';
37
+ import { RootComponentsContext } from '../contexts/rootcomponentscontext';
38
+ import { zBehavior, zUI } from '../decorators';
39
+ /**
40
+ * Changes the root scene of the experience to a different scene/zcomp.
41
+ * @zbehavior
42
+ * @zicon airline_stops
43
+ * @zgroup Actions
44
+ */
45
+ let ChangeRootScene = (() => {
46
+ let _classDecorators = [zBehavior({
47
+ icon: 'airline_stops',
48
+ group: 'Actions',
49
+ })];
50
+ let _classDescriptor;
51
+ let _classExtraInitializers = [];
52
+ let _classThis;
53
+ let _classSuper = ActionBehavior;
54
+ let _instanceExtraInitializers = [];
55
+ let _newScene_decorators;
56
+ let _newScene_initializers = [];
57
+ let _newScene_extraInitializers = [];
58
+ let _delayForLoader_decorators;
59
+ let _delayForLoader_initializers = [];
60
+ let _delayForLoader_extraInitializers = [];
61
+ let _perform_decorators;
62
+ var ChangeRootScene = class extends _classSuper {
63
+ static { _classThis = this; }
64
+ static {
65
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
66
+ _newScene_decorators = [zUI({ group: { name: 'ChangeRootScene', priority: 100 }, values: ['components', 'zcomponent'] })];
67
+ _delayForLoader_decorators = [zUI({ group: { name: 'ChangeRootScene', priority: 100 }, type: 'time-milliseconds' })];
68
+ _perform_decorators = [zUI()];
69
+ __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);
70
+ __esDecorate(null, null, _newScene_decorators, { kind: "field", name: "newScene", static: false, private: false, access: { has: obj => "newScene" in obj, get: obj => obj.newScene, set: (obj, value) => { obj.newScene = value; } }, metadata: _metadata }, _newScene_initializers, _newScene_extraInitializers);
71
+ __esDecorate(null, null, _delayForLoader_decorators, { kind: "field", name: "delayForLoader", static: false, private: false, access: { has: obj => "delayForLoader" in obj, get: obj => obj.delayForLoader, set: (obj, value) => { obj.delayForLoader = value; } }, metadata: _metadata }, _delayForLoader_initializers, _delayForLoader_extraInitializers);
72
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
73
+ ChangeRootScene = _classThis = _classDescriptor.value;
74
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
75
+ __runInitializers(_classThis, _classExtraInitializers);
76
+ }
77
+ /**
78
+ * @zui
79
+ * @zgroup ChangeRootScene
80
+ * @zgrouppriority 100
81
+ * @zvalues components zcomponent
82
+ */
83
+ newScene = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _newScene_initializers, void 0));
84
+ /**
85
+ * An amount of time to delay any changes to loading state. Use this to give time for a loader to appear before changing the content.
86
+ * @default 0
87
+ * @zui
88
+ * @zgroup ChangeRootScene
89
+ * @zgrouppriority 100
90
+ * @ztype time-milliseconds
91
+ */
92
+ delayForLoader = (__runInitializers(this, _newScene_extraInitializers), __runInitializers(this, _delayForLoader_initializers, 0));
93
+ /**
94
+ * @default false
95
+ */
96
+ _isDelaying = (__runInitializers(this, _delayForLoader_extraInitializers), false);
97
+ /**
98
+ * @zui
99
+ */
100
+ perform() {
101
+ if (this.delayForLoader === 0)
102
+ return this._changeRoot();
103
+ if (this._isDelaying)
104
+ return; // prevent multiple calls
105
+ this._isDelaying = true;
106
+ registerLoadable(this, (async () => {
107
+ await delay(this.delayForLoader);
108
+ this._isDelaying = false;
109
+ this._changeRoot();
110
+ })());
111
+ }
112
+ _changeRoot() {
113
+ if (!this.newScene)
114
+ return;
115
+ this.contextManager.get(RootComponentsContext).constructAndReplaceRootComponent(this.newScene, {});
116
+ }
117
+ };
118
+ return ChangeRootScene = _classThis;
119
+ })();
120
+ export { ChangeRootScene };
121
+ function delay(ms) {
122
+ return new Promise(resolve => setTimeout(resolve, ms));
123
+ }
@@ -1,7 +1,6 @@
1
1
  import { ActionBehavior } from '../actionbehavior';
2
2
  /**
3
3
  * Outputs a message to the console log.
4
- *
5
4
  * @zbehavior
6
5
  * @zicon terminal
7
6
  * @zgroup Actions
@@ -9,15 +8,17 @@ import { ActionBehavior } from '../actionbehavior';
9
8
  export declare class ConsoleLog extends ActionBehavior {
10
9
  /**
11
10
  * The text to log
12
- * @zprop
11
+ * @default ""
13
12
  */
14
13
  text: string;
15
14
  /**
16
15
  * If true, the event name will be logged in addition to the text
17
- * @zprop
18
- * @zdefault true
16
+ * @default true
19
17
  */
20
18
  includeEventName: boolean;
21
- /** @zprop */
22
19
  perform(): void;
20
+ /**
21
+ * @zui
22
+ */
23
+ preview(): void;
23
24
  }
@@ -1,19 +1,102 @@
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
  * Outputs a message to the console log.
5
- *
6
40
  * @zbehavior
7
41
  * @zicon terminal
8
42
  * @zgroup Actions
9
43
  */
10
- export class ConsoleLog extends ActionBehavior {
11
- /** @zprop */
12
- perform() {
13
- if (this.includeEventName ?? true)
14
- console.log(this.constructorProps.event, this.text);
15
- else
16
- console.log(this.text);
17
- }
18
- }
19
- registerBehaviorRunAtDesignTime(ConsoleLog);
44
+ let ConsoleLog = (() => {
45
+ let _classDecorators = [zBehavior({ icon: 'terminal', group: BehaviorGroups.Actions, runAtDesignTime: true })];
46
+ let _classDescriptor;
47
+ let _classExtraInitializers = [];
48
+ let _classThis;
49
+ let _classSuper = ActionBehavior;
50
+ let _instanceExtraInitializers = [];
51
+ let _text_decorators;
52
+ let _text_initializers = [];
53
+ let _text_extraInitializers = [];
54
+ let _includeEventName_decorators;
55
+ let _includeEventName_initializers = [];
56
+ let _includeEventName_extraInitializers = [];
57
+ let _preview_decorators;
58
+ var ConsoleLog = class extends _classSuper {
59
+ static { _classThis = this; }
60
+ static {
61
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
62
+ _text_decorators = [zUI()];
63
+ _includeEventName_decorators = [zUI()];
64
+ _preview_decorators = [zUI()];
65
+ __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);
66
+ __esDecorate(null, null, _text_decorators, { kind: "field", name: "text", static: false, private: false, access: { has: obj => "text" in obj, get: obj => obj.text, set: (obj, value) => { obj.text = value; } }, metadata: _metadata }, _text_initializers, _text_extraInitializers);
67
+ __esDecorate(null, null, _includeEventName_decorators, { kind: "field", name: "includeEventName", static: false, private: false, access: { has: obj => "includeEventName" in obj, get: obj => obj.includeEventName, set: (obj, value) => { obj.includeEventName = value; } }, metadata: _metadata }, _includeEventName_initializers, _includeEventName_extraInitializers);
68
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
69
+ ConsoleLog = _classThis = _classDescriptor.value;
70
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
71
+ __runInitializers(_classThis, _classExtraInitializers);
72
+ }
73
+ /**
74
+ * The text to log
75
+ * @default ""
76
+ */
77
+ text = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _text_initializers, ''));
78
+ /**
79
+ * If true, the event name will be logged in addition to the text
80
+ * @default true
81
+ */
82
+ includeEventName = (__runInitializers(this, _text_extraInitializers), __runInitializers(this, _includeEventName_initializers, true));
83
+ perform() {
84
+ if (this.includeEventName)
85
+ console.log(this.constructorProps.event, this.text);
86
+ else
87
+ console.log(this.text);
88
+ }
89
+ /**
90
+ * @zui
91
+ */
92
+ preview() {
93
+ this.perform();
94
+ }
95
+ constructor() {
96
+ super(...arguments);
97
+ __runInitializers(this, _includeEventName_extraInitializers);
98
+ }
99
+ };
100
+ return ConsoleLog = _classThis;
101
+ })();
102
+ export { ConsoleLog };
@@ -1,25 +1,20 @@
1
- import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
2
- import { Component } from '../component';
3
- import { ContextManager } from '../context';
1
+ import { ActionBehavior } from '../actionbehavior';
4
2
  import { Event } from '../event';
5
- export type DownloadSnapshotProps = ActionBehaviorConstructorProps;
6
3
  /**
7
4
  * Behavior for downloading a captured canvas snapshot as an image.
8
- *
9
5
  * @zbehavior
10
6
  * @zicon download
11
7
  * @zgroup Actions
12
8
  */
13
- export declare class DownloadSnapshot extends ActionBehavior<DownloadSnapshotProps> {
9
+ export declare class DownloadSnapshot extends ActionBehavior {
14
10
  /**
15
11
  * Event triggered when a snapshot is saved.
16
- * @zui
17
12
  */
18
- onSave: Event<[]>;
19
- constructor(contextManager: ContextManager, instance: Component, props: DownloadSnapshotProps);
20
- /** @zprop */
13
+ readonly onSave: Event<[]>;
21
14
  perform(): void;
22
- private download;
23
- /** @zui */
15
+ private _download;
16
+ /**
17
+ * @zui
18
+ */
24
19
  preview(): void;
25
20
  }
@@ -1,23 +1,75 @@
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 { SnapshotContext } from '../contexts/snapshotContext';
37
+ import { zBehavior, zUI } from '../decorators';
4
38
  import { Event } from '../event';
39
+ import { BehaviorGroups } from '../groups';
5
40
  /**
6
41
  * Behavior for downloading a captured canvas snapshot as an image.
7
- *
8
42
  * @zbehavior
9
43
  * @zicon download
10
44
  * @zgroup Actions
11
45
  */
12
- export class DownloadSnapshot extends ActionBehavior {
13
- constructor(contextManager, instance, props) {
14
- super(contextManager, instance, props);
46
+ let DownloadSnapshot = (() => {
47
+ let _classDecorators = [zBehavior({ icon: 'download', group: BehaviorGroups.Actions, runAtDesignTime: true })];
48
+ let _classDescriptor;
49
+ let _classExtraInitializers = [];
50
+ let _classThis;
51
+ let _classSuper = ActionBehavior;
52
+ let _instanceExtraInitializers = [];
53
+ let _preview_decorators;
54
+ var DownloadSnapshot = 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
+ DownloadSnapshot = _classThis = _classDescriptor.value;
62
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
63
+ __runInitializers(_classThis, _classExtraInitializers);
64
+ }
15
65
  /**
16
66
  * Event triggered when a snapshot is saved.
17
- * @zui
18
67
  */
19
- this.onSave = new Event();
20
- this.download = () => {
68
+ onSave = (__runInitializers(this, _instanceExtraInitializers), new Event());
69
+ perform() {
70
+ this._download();
71
+ }
72
+ _download = () => {
21
73
  const snapshotContext = this.contextManager.get(SnapshotContext);
22
74
  const dataUrl = snapshotContext.canvasImage.value;
23
75
  const link = document.createElement('a');
@@ -37,14 +89,13 @@ export class DownloadSnapshot extends ActionBehavior {
37
89
  document.body.removeChild(link);
38
90
  this.onSave.emit();
39
91
  };
40
- }
41
- /** @zprop */
42
- perform() {
43
- this.download();
44
- }
45
- /** @zui */
46
- preview() {
47
- this.perform();
48
- }
49
- }
50
- registerBehaviorRunAtDesignTime(DownloadSnapshot);
92
+ /**
93
+ * @zui
94
+ */
95
+ preview() {
96
+ this.perform();
97
+ }
98
+ };
99
+ return DownloadSnapshot = _classThis;
100
+ })();
101
+ export { DownloadSnapshot };
@@ -1,7 +1,6 @@
1
1
  import { ActionBehavior } from '../actionbehavior';
2
2
  /**
3
3
  * Calls emit on an event that's a prop of this ZComponent
4
- *
5
4
  * @zbehavior
6
5
  * @zicon function
7
6
  * @zgroup Actions
@@ -9,13 +8,12 @@ import { ActionBehavior } from '../actionbehavior';
9
8
  export declare class EmitComponentPropEvent extends ActionBehavior {
10
9
  /**
11
10
  * The event to emit
12
- * @zprop
11
+ * @zui
13
12
  * @ztype function-emit-component-prop-event
14
13
  */
15
14
  eventToEmit: () => any;
16
15
  /**
17
16
  * @zui
18
- * @zprop
19
17
  */
20
18
  perform(): void;
21
19
  }
@@ -1,19 +1,87 @@
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
  * Calls emit on an event that's a prop of this ZComponent
5
- *
6
40
  * @zbehavior
7
41
  * @zicon function
8
42
  * @zgroup Actions
9
43
  */
10
- export class EmitComponentPropEvent extends ActionBehavior {
11
- /**
12
- * @zui
13
- * @zprop
14
- */
15
- perform() {
16
- this.eventToEmit();
17
- }
18
- }
19
- registerBehaviorRunAtDesignTime(EmitComponentPropEvent);
44
+ let EmitComponentPropEvent = (() => {
45
+ let _classDecorators = [zBehavior({ icon: 'function', group: BehaviorGroups.Actions, runAtDesignTime: true })];
46
+ let _classDescriptor;
47
+ let _classExtraInitializers = [];
48
+ let _classThis;
49
+ let _classSuper = ActionBehavior;
50
+ let _instanceExtraInitializers = [];
51
+ let _eventToEmit_decorators;
52
+ let _eventToEmit_initializers = [];
53
+ let _eventToEmit_extraInitializers = [];
54
+ let _perform_decorators;
55
+ var EmitComponentPropEvent = 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
+ _eventToEmit_decorators = [zUI({ type: 'function-emit-component-prop-event' })];
60
+ _perform_decorators = [zUI()];
61
+ __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);
62
+ __esDecorate(null, null, _eventToEmit_decorators, { kind: "field", name: "eventToEmit", static: false, private: false, access: { has: obj => "eventToEmit" in obj, get: obj => obj.eventToEmit, set: (obj, value) => { obj.eventToEmit = value; } }, metadata: _metadata }, _eventToEmit_initializers, _eventToEmit_extraInitializers);
63
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
64
+ EmitComponentPropEvent = _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
+ /**
69
+ * The event to emit
70
+ * @zui
71
+ * @ztype function-emit-component-prop-event
72
+ */
73
+ eventToEmit = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _eventToEmit_initializers, void 0));
74
+ /**
75
+ * @zui
76
+ */
77
+ perform() {
78
+ this.eventToEmit();
79
+ }
80
+ constructor() {
81
+ super(...arguments);
82
+ __runInitializers(this, _eventToEmit_extraInitializers);
83
+ }
84
+ };
85
+ return EmitComponentPropEvent = _classThis;
86
+ })();
87
+ export { EmitComponentPropEvent };
@@ -3,7 +3,6 @@ import { ActionBehavior } from '../actionbehavior';
3
3
  * Navigates the user to the provided URL.
4
4
  *
5
5
  * **Important Note**: Safari on iOS will not open URLs in new tabs for pointer events except `onPointerUp`.
6
- *
7
6
  * @zbehavior
8
7
  * @zicon open_in_new
9
8
  * @zgroup Actions
@@ -11,15 +10,16 @@ import { ActionBehavior } from '../actionbehavior';
11
10
  export declare class LaunchURL extends ActionBehavior {
12
11
  /**
13
12
  * The URL to open
14
- * @zprop
13
+ * @default "https://www.example.com/"
15
14
  */
16
15
  url: string;
17
16
  /**
18
17
  * If true, the URL will be opened in a new tab (using target '_blank')
19
- * @zprop
20
- * @zdefault true
18
+ * @default true
21
19
  */
22
20
  openInNew: boolean;
23
- /** @zprop */
21
+ /**
22
+ * @zui
23
+ */
24
24
  perform(): void;
25
25
  }