@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,45 +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
+ };
35
+ import { zBehavior, zUI } from '../../decorators';
1
36
  import { ActionBehavior } from '../../actionbehavior';
2
- import { registerBehaviorRunAtDesignTime } from '../../behavior';
3
37
  /**
4
38
  * Behavior to play a specified stream.
5
39
  * @zbehavior
6
40
  * @zicon play_circle
7
41
  * @zgroup Stream Actions
8
42
  */
9
- export class PlayStream extends ActionBehavior {
10
- /**
11
- * Creates an instance of PlayStream.
12
- * @param contextManager - The current ContextManager
13
- * @param instance - The instance of the component that this behavior is attached to
14
- * @param props - The constructor properties.
15
- */
16
- constructor(contextManager, instance, props) {
17
- super(contextManager, instance, props);
18
- this.zcomponent = this.getZComponentInstance();
43
+ let PlayStream = (() => {
44
+ let _classDecorators = [zBehavior({ icon: 'play_circle', group: 'Stream Actions', runAtDesignTime: true })];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ let _classSuper = ActionBehavior;
49
+ let _instanceExtraInitializers = [];
50
+ let _stream_decorators;
51
+ let _stream_initializers = [];
52
+ let _stream_extraInitializers = [];
53
+ let _loop_decorators;
54
+ let _loop_initializers = [];
55
+ let _loop_extraInitializers = [];
56
+ let _speed_decorators;
57
+ let _speed_initializers = [];
58
+ let _speed_extraInitializers = [];
59
+ let _fromStart_decorators;
60
+ let _fromStart_initializers = [];
61
+ let _fromStart_extraInitializers = [];
62
+ let _preview_decorators;
63
+ var PlayStream = class extends _classSuper {
64
+ static { _classThis = this; }
65
+ static {
66
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
67
+ _stream_decorators = [zUI({ values: 'streamids', priority: 20, group: 'Play Settings' })];
68
+ _loop_decorators = [zUI({ group: 'Play Settings', priority: 20 })];
69
+ _speed_decorators = [zUI({ group: 'Play Settings', priority: 20 })];
70
+ _fromStart_decorators = [zUI({ group: 'Play Settings', priority: 20 })];
71
+ _preview_decorators = [zUI()];
72
+ __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);
73
+ __esDecorate(null, null, _stream_decorators, { kind: "field", name: "stream", static: false, private: false, access: { has: obj => "stream" in obj, get: obj => obj.stream, set: (obj, value) => { obj.stream = value; } }, metadata: _metadata }, _stream_initializers, _stream_extraInitializers);
74
+ __esDecorate(null, null, _loop_decorators, { kind: "field", name: "loop", static: false, private: false, access: { has: obj => "loop" in obj, get: obj => obj.loop, set: (obj, value) => { obj.loop = value; } }, metadata: _metadata }, _loop_initializers, _loop_extraInitializers);
75
+ __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);
76
+ __esDecorate(null, null, _fromStart_decorators, { kind: "field", name: "fromStart", static: false, private: false, access: { has: obj => "fromStart" in obj, get: obj => obj.fromStart, set: (obj, value) => { obj.fromStart = value; } }, metadata: _metadata }, _fromStart_initializers, _fromStart_extraInitializers);
77
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
78
+ PlayStream = _classThis = _classDescriptor.value;
79
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
80
+ __runInitializers(_classThis, _classExtraInitializers);
81
+ }
82
+ zcomponent = (__runInitializers(this, _instanceExtraInitializers), this.getZComponentInstance());
83
+ /**
84
+ * The ID of the stream to be played.
85
+ * @zui
86
+ * @zgroup Play Settings
87
+ * @zvalues streamids
88
+ */
89
+ stream = __runInitializers(this, _stream_initializers, void 0);
90
+ /**
91
+ * Whether the stream should loop.
92
+ * @default false
93
+ * @zui
94
+ * @zgroup Play Settings
95
+ */
96
+ loop = (__runInitializers(this, _stream_extraInitializers), __runInitializers(this, _loop_initializers, false));
97
+ /**
98
+ * The playback speed of the stream.
99
+ * @default 1
100
+ * @zui
101
+ * @zgroup Play Settings
102
+ */
103
+ speed = (__runInitializers(this, _loop_extraInitializers), __runInitializers(this, _speed_initializers, 1));
19
104
  /**
20
105
  * Whether to seek the stream to the start before playing.
21
- *
22
- * @zprop
106
+ * @default false
107
+ * @zui
23
108
  * @zgroup Play Settings
24
- * @zgrouppriority 20
25
- * @zdefault false
26
109
  */
27
- this.fromStart = false;
28
- }
29
- /** @zprop */
30
- perform() {
31
- if (!this.stream)
32
- return;
33
- const stream = this.zcomponent.resolveStreamID(this.stream);
34
- if (!stream)
35
- return;
36
- if (this.fromStart ?? false)
37
- stream.seek(0);
38
- stream.play({ loop: this.loop, speed: this.speed });
39
- }
40
- /** @zui */
41
- preview() {
42
- this.perform();
43
- }
44
- }
45
- registerBehaviorRunAtDesignTime(PlayStream);
110
+ fromStart = (__runInitializers(this, _speed_extraInitializers), __runInitializers(this, _fromStart_initializers, false));
111
+ perform() {
112
+ if (!this.stream)
113
+ return;
114
+ const stream = this.zcomponent.resolveStreamID(this.stream);
115
+ if (!stream)
116
+ return;
117
+ if (this.fromStart ?? false)
118
+ stream.seek(0);
119
+ stream.play({ loop: this.loop, speed: this.speed });
120
+ }
121
+ /**
122
+ * @zui
123
+ */
124
+ preview() {
125
+ this.perform();
126
+ }
127
+ constructor() {
128
+ super(...arguments);
129
+ __runInitializers(this, _fromStart_extraInitializers);
130
+ }
131
+ };
132
+ return PlayStream = _classThis;
133
+ })();
134
+ export { PlayStream };
@@ -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 seek a specified stream to a specific time.
6
4
  * @zbehavior
@@ -8,33 +6,25 @@ import { ContextManager } from '../../context';
8
6
  * @zgroup Stream Actions
9
7
  */
10
8
  export declare class SeekStream extends ActionBehavior {
11
- private zcomponent;
9
+ private readonly zcomponent;
12
10
  /**
13
11
  * The ID of the stream to seek.
14
- * @zprop
12
+ * @zui
15
13
  * @zgroup Stop Settings
16
- * @zgrouppriority 20
17
14
  * @zvalues streamids
18
15
  */
19
- stream: string | undefined;
16
+ stream?: string;
20
17
  /**
21
18
  * The time in milliseconds to seek to in the stream.
22
- * @zprop
19
+ * @default 0
20
+ * @zui
23
21
  * @zgroup Stop Settings
24
- * @zgrouppriority 20
25
- * @zdefault 0
26
22
  * @ztype time-milliseconds
27
23
  */
28
24
  time: number;
25
+ perform(): void;
29
26
  /**
30
- * Creates an instance of SeekStream.
31
- * @param contextManager - The current ContextManager
32
- * @param instance - The instance of the component that this behavior is attached to
33
- * @param props - The constructor properties.
27
+ * @zui
34
28
  */
35
- constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
36
- /** @zprop */
37
- perform(): void;
38
- /** @zui */
39
29
  preview(): void;
40
30
  }
@@ -1,43 +1,109 @@
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 { zBehavior, zUI } from '../../decorators';
1
36
  import { ActionBehavior } from '../../actionbehavior';
2
- import { registerBehaviorRunAtDesignTime } from '../../behavior';
3
37
  /**
4
38
  * Behavior to seek a specified stream to a specific time.
5
39
  * @zbehavior
6
40
  * @zicon fast_forward
7
41
  * @zgroup Stream Actions
8
42
  */
9
- export class SeekStream extends ActionBehavior {
10
- /**
11
- * Creates an instance of SeekStream.
12
- * @param contextManager - The current ContextManager
13
- * @param instance - The instance of the component that this behavior is attached to
14
- * @param props - The constructor properties.
15
- */
16
- constructor(contextManager, instance, props) {
17
- super(contextManager, instance, props);
18
- this.zcomponent = this.getZComponentInstance();
43
+ let SeekStream = (() => {
44
+ let _classDecorators = [zBehavior({ icon: 'fast_forward', group: 'Stream Actions', runAtDesignTime: true })];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ let _classSuper = ActionBehavior;
49
+ let _instanceExtraInitializers = [];
50
+ let _stream_decorators;
51
+ let _stream_initializers = [];
52
+ let _stream_extraInitializers = [];
53
+ let _time_decorators;
54
+ let _time_initializers = [];
55
+ let _time_extraInitializers = [];
56
+ let _preview_decorators;
57
+ var SeekStream = class extends _classSuper {
58
+ static { _classThis = this; }
59
+ static {
60
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
61
+ _stream_decorators = [zUI({ group: 'Stop Settings', priority: 20, values: 'streamids' })];
62
+ _time_decorators = [zUI({ group: 'Stop Settings', priority: 20, type: 'time-milliseconds' })];
63
+ _preview_decorators = [zUI()];
64
+ __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);
65
+ __esDecorate(null, null, _stream_decorators, { kind: "field", name: "stream", static: false, private: false, access: { has: obj => "stream" in obj, get: obj => obj.stream, set: (obj, value) => { obj.stream = value; } }, metadata: _metadata }, _stream_initializers, _stream_extraInitializers);
66
+ __esDecorate(null, null, _time_decorators, { kind: "field", name: "time", static: false, private: false, access: { has: obj => "time" in obj, get: obj => obj.time, set: (obj, value) => { obj.time = value; } }, metadata: _metadata }, _time_initializers, _time_extraInitializers);
67
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68
+ SeekStream = _classThis = _classDescriptor.value;
69
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
70
+ __runInitializers(_classThis, _classExtraInitializers);
71
+ }
72
+ zcomponent = (__runInitializers(this, _instanceExtraInitializers), this.getZComponentInstance());
73
+ /**
74
+ * The ID of the stream to seek.
75
+ * @zui
76
+ * @zgroup Stop Settings
77
+ * @zvalues streamids
78
+ */
79
+ stream = __runInitializers(this, _stream_initializers, void 0);
19
80
  /**
20
81
  * The time in milliseconds to seek to in the stream.
21
- * @zprop
82
+ * @default 0
83
+ * @zui
22
84
  * @zgroup Stop Settings
23
- * @zgrouppriority 20
24
- * @zdefault 0
25
85
  * @ztype time-milliseconds
26
86
  */
27
- this.time = 0;
28
- }
29
- /** @zprop */
30
- perform() {
31
- if (!this.stream)
32
- return;
33
- const stream = this.zcomponent.resolveStreamID(this.stream);
34
- if (!stream)
35
- return;
36
- stream.seek(this.time ?? 0);
37
- }
38
- /** @zui */
39
- preview() {
40
- this.perform();
41
- }
42
- }
43
- registerBehaviorRunAtDesignTime(SeekStream);
87
+ time = (__runInitializers(this, _stream_extraInitializers), __runInitializers(this, _time_initializers, 0));
88
+ perform() {
89
+ if (!this.stream)
90
+ return;
91
+ const stream = this.zcomponent.resolveStreamID(this.stream);
92
+ if (!stream)
93
+ return;
94
+ stream.seek(this.time ?? 0);
95
+ }
96
+ /**
97
+ * @zui
98
+ */
99
+ preview() {
100
+ this.perform();
101
+ }
102
+ constructor() {
103
+ super(...arguments);
104
+ __runInitializers(this, _time_extraInitializers);
105
+ }
106
+ };
107
+ return SeekStream = _classThis;
108
+ })();
109
+ export { SeekStream };
@@ -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 stop a specified stream.
6
4
  * @zbehavior
@@ -8,24 +6,17 @@ import { ContextManager } from '../../context';
8
6
  * @zgroup Stream Actions
9
7
  */
10
8
  export declare class StopStream extends ActionBehavior {
11
- private zcomponent;
9
+ private readonly zcomponent;
12
10
  /**
13
11
  * The ID of the stream to be stopped.
14
- * @zprop
12
+ * @zui
15
13
  * @zgroup Stop Settings
16
- * @zgrouppriority 20
17
14
  * @zvalues streamids
18
15
  */
19
- stream: string | undefined;
16
+ stream?: string;
17
+ perform(): void;
20
18
  /**
21
- * Creates an instance of StopStream.
22
- * @param contextManager - The current ContextManager
23
- * @param instance - The instance of the component that this behavior is attached to
24
- * @param props - The constructor properties.
19
+ * @zui
25
20
  */
26
- constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
27
- /** @zprop */
28
- perform(): void;
29
- /** @zui */
30
21
  preview(): void;
31
22
  }
@@ -1,34 +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
+ };
35
+ import { zBehavior, zUI } from '../../decorators';
1
36
  import { ActionBehavior } from '../../actionbehavior';
2
- import { registerBehaviorRunAtDesignTime } from '../../behavior';
3
37
  /**
4
38
  * Behavior to stop a specified stream.
5
39
  * @zbehavior
6
40
  * @zicon stop_circle
7
41
  * @zgroup Stream Actions
8
42
  */
9
- export class StopStream extends ActionBehavior {
10
- /**
11
- * Creates an instance of StopStream.
12
- * @param contextManager - The current ContextManager
13
- * @param instance - The instance of the component that this behavior is attached to
14
- * @param props - The constructor properties.
15
- */
16
- constructor(contextManager, instance, props) {
17
- super(contextManager, instance, props);
18
- this.zcomponent = this.getZComponentInstance();
19
- }
20
- /** @zprop */
21
- perform() {
22
- if (!this.stream)
23
- return;
24
- const stream = this.zcomponent.resolveStreamID(this.stream);
25
- if (!stream)
26
- return;
27
- stream.stop();
28
- }
29
- /** @zui */
30
- preview() {
31
- this.perform();
32
- }
33
- }
34
- registerBehaviorRunAtDesignTime(StopStream);
43
+ let StopStream = (() => {
44
+ let _classDecorators = [zBehavior({ icon: 'stop_circle', group: 'Stream Actions', runAtDesignTime: true })];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ let _classSuper = ActionBehavior;
49
+ let _instanceExtraInitializers = [];
50
+ let _stream_decorators;
51
+ let _stream_initializers = [];
52
+ let _stream_extraInitializers = [];
53
+ let _preview_decorators;
54
+ var StopStream = 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
+ _stream_decorators = [zUI({ group: 'Stop Settings', priority: 20, values: 'streamids' })];
59
+ _preview_decorators = [zUI()];
60
+ __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);
61
+ __esDecorate(null, null, _stream_decorators, { kind: "field", name: "stream", static: false, private: false, access: { has: obj => "stream" in obj, get: obj => obj.stream, set: (obj, value) => { obj.stream = value; } }, metadata: _metadata }, _stream_initializers, _stream_extraInitializers);
62
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
63
+ StopStream = _classThis = _classDescriptor.value;
64
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
65
+ __runInitializers(_classThis, _classExtraInitializers);
66
+ }
67
+ zcomponent = (__runInitializers(this, _instanceExtraInitializers), this.getZComponentInstance());
68
+ /**
69
+ * The ID of the stream to be stopped.
70
+ * @zui
71
+ * @zgroup Stop Settings
72
+ * @zvalues streamids
73
+ */
74
+ stream = __runInitializers(this, _stream_initializers, void 0);
75
+ perform() {
76
+ if (!this.stream)
77
+ return;
78
+ const stream = this.zcomponent.resolveStreamID(this.stream);
79
+ if (!stream)
80
+ return;
81
+ stream.stop();
82
+ }
83
+ /**
84
+ * @zui
85
+ */
86
+ preview() {
87
+ this.perform();
88
+ }
89
+ constructor() {
90
+ super(...arguments);
91
+ __runInitializers(this, _stream_extraInitializers);
92
+ }
93
+ };
94
+ return StopStream = _classThis;
95
+ })();
96
+ export { StopStream };
@@ -1,7 +1,7 @@
1
+ import type { Behavior, BehaviorConstructor } from './behavior';
1
2
  import { ContextManager } from './context';
2
3
  import { Entity } from './entity';
3
- import { Observable } from './observable';
4
- import type { Behavior, BehaviorConstructor } from './behavior';
4
+ import type { Observable } from './observable';
5
5
  /**
6
6
  * Type representing the constructor properties of a given component type.
7
7
  *
@@ -30,7 +30,14 @@ export type ConstructorForComponent<ComponentType extends Component = Component>
30
30
  * It defines a tuple representing a child component, which includes its constructor, properties, and an optional observable reference.
31
31
  * @typeParam ComponentType - The type of the component which the child belongs to.
32
32
  */
33
- export type ComponentChild<ComponentType extends Component> = [ConstructorForComponent<ComponentType>, ComponentType extends Component<any, infer U> ? U : never] | [ConstructorForComponent<ComponentType>, ComponentType extends Component<any, infer U> ? U : never, Observable<ComponentType | undefined>];
33
+ export type ComponentChild<ComponentType extends Component> = [
34
+ ConstructorForComponent<ComponentType>,
35
+ ComponentType extends Component<any, infer U> ? U : never
36
+ ] | [
37
+ ConstructorForComponent<ComponentType>,
38
+ ComponentType extends Component<any, infer U> ? U : never,
39
+ Observable<ComponentType | undefined>
40
+ ];
34
41
  /**
35
42
  * Type representing an array of component children.
36
43
  *
@@ -59,24 +66,34 @@ export declare class Component<ElementType = any, ConstructorPropsType extends C
59
66
  protected constructorProps?: ConstructorPropsType | undefined;
60
67
  /**
61
68
  * The raw element(s) that this component exposes
69
+ * @zignore
62
70
  */
63
71
  element?: ElementType;
64
72
  /**
65
73
  * The children of this component.
74
+ *
75
+ * @zignore
76
+ * @default []
66
77
  */
67
78
  readonly children: Component[];
68
79
  /**
69
80
  * The behaviors attached to this component.
81
+ *
82
+ * @zignore
83
+ * @default []
70
84
  */
71
85
  readonly behaviors: Behavior[];
72
- /**
73
- * The parent of this component.
74
- */
75
- parent?: Component;
76
86
  /**
77
87
  * If true, this component can't be selected at design time in the 3D preview.
88
+ * @zignore
78
89
  */
79
90
  locked?: boolean;
91
+ private _parent?;
92
+ /**
93
+ * The parent of this component.
94
+ * @zignore
95
+ */
96
+ get parent(): Component | undefined;
80
97
  /**
81
98
  * Creates an instance of Component.
82
99
  * @param contextManager The current ContextManager
@@ -85,31 +102,38 @@ export declare class Component<ElementType = any, ConstructorPropsType extends C
85
102
  constructor(contextManager: ContextManager, constructorProps?: ConstructorPropsType | undefined);
86
103
  /**
87
104
  * Constructs the children of this component.
105
+ * @zignore
88
106
  */
89
107
  constructChildren(children: ComponentChildren, contextManager?: ContextManager): void;
90
108
  /**
91
109
  * Adds the supplied component instance as a child of this component, removing it from any existing parent.
92
110
  *
93
111
  * @param c The component instance to add
112
+ * @zignore
94
113
  */
95
114
  appendChild(c: Component): void;
115
+ connectElements(): void;
96
116
  /**
97
117
  * Removes the supplied component instance from the list of children.
98
118
  * @param c The component to remove
119
+ * @zignore
99
120
  */
100
121
  removeChild(c: Component): void;
101
122
  /**
102
123
  * Removes this component from its parent component.
124
+ * @zignore
103
125
  */
104
126
  remove(): void;
105
127
  /**
106
128
  * Adds a behavior to the component.
107
129
  * @param {Behavior} b - The behavior to add.
130
+ * @zignore
108
131
  */
109
132
  addBehavior(b: Behavior): void;
110
133
  /**
111
134
  * Removes a behavior from the component.
112
135
  * @param {Behavior} b - The behavior to remove.
136
+ * @zignore
113
137
  */
114
138
  removeBehavior(b: Behavior): void;
115
139
  /**
@@ -117,6 +141,7 @@ export declare class Component<ElementType = any, ConstructorPropsType extends C
117
141
  * @param {T} type - The type of behavior to get.
118
142
  * @returns {InstanceType<T> | undefined} The behavior of the specified type, or undefined if no such behavior exists.
119
143
  * @template T The behavior type.
144
+ * @zignore
120
145
  */
121
146
  getBehavior<T extends BehaviorConstructor>(type: T): InstanceType<T> | undefined;
122
147
  /**
@@ -124,6 +149,7 @@ export declare class Component<ElementType = any, ConstructorPropsType extends C
124
149
  * @param {T} type - The type of behaviors to get.
125
150
  * @returns {InstanceType<T>[]} An array of behaviors of the specified type.
126
151
  * @template T The behavior type.
152
+ * @zignore
127
153
  */
128
154
  getBehaviors<T extends BehaviorConstructor>(type: T): InstanceType<T>[];
129
155
  /**
@@ -144,15 +170,12 @@ export declare class Component<ElementType = any, ConstructorPropsType extends C
144
170
  *
145
171
  * By default, tags are scoped to the ZComponent instance that a component is constructed by.
146
172
  * Tags that begin with `global:` are scoped to the experience as a whole.
147
- *
148
- * @zprop
173
+ * @default []
174
+ * @zui
149
175
  * @zgroup Other
150
- * @group Other
151
- * @zgrouppriority 0
152
176
  */
153
- readonly tags: Observable<string[], never>;
177
+ tags: string[];
154
178
  private _updateEnabledResolved;
155
- private _updateTags;
156
179
  /**
157
180
  * Dispose of this component and all of its children.
158
181
  */