@zcomponent/core 2.0.0-alpha.3 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/behavior.d.ts +7 -1
- package/lib/behavior.js +6 -1
- package/lib/behaviors/ConsoleLog.d.ts +2 -0
- package/lib/behaviors/ConsoleLog.js +2 -0
- package/lib/behaviors/LaunchURL.d.ts +2 -0
- package/lib/behaviors/LaunchURL.js +2 -0
- package/lib/behaviors/LogAnalyticsEvent.d.ts +2 -0
- package/lib/behaviors/LogAnalyticsEvent.js +2 -0
- package/lib/behaviors/PlaySound.d.ts +3 -0
- package/lib/behaviors/PlaySound.js +7 -1
- package/lib/behaviors/ShowTextAlert.d.ts +1 -0
- package/lib/behaviors/ShowTextAlert.js +1 -0
- package/lib/behaviors/ToggleLayerClips.d.ts +1 -0
- package/lib/behaviors/ToggleLayerClips.js +9 -3
- package/lib/component.d.ts +7 -0
- package/lib/component.js +6 -0
- package/lib/components/AnimatedLoader.d.ts +6 -0
- package/lib/components/AnimatedLoader.js +6 -0
- package/lib/components/Audio.d.ts +28 -2
- package/lib/components/Audio.js +55 -8
- package/lib/components/DefaultCookieConsent.d.ts +11 -0
- package/lib/components/DefaultCookieConsent.js +33 -9
- package/lib/components/DefaultLoader.d.ts +3 -0
- package/lib/components/DefaultLoader.js +15 -8
- package/lib/components/Gamepad.d.ts +61 -0
- package/lib/components/Gamepad.js +61 -0
- package/lib/components/LongLoad.d.ts +3 -0
- package/lib/components/LongLoad.js +3 -0
- package/lib/components/SnapshotUI.d.ts +14 -0
- package/lib/components/SnapshotUI.js +27 -9
- package/lib/context.d.ts +11 -1
- package/lib/context.js +9 -1
- package/lib/contexts/analyticscontext.d.ts +3 -0
- package/lib/contexts/analyticscontext.js +14 -2
- package/lib/contexts/audiocontextcontext.d.ts +12 -0
- package/lib/contexts/audiocontextcontext.js +131 -56
- package/lib/contexts/canvascontext.d.ts +25 -0
- package/lib/contexts/canvascontext.js +75 -15
- package/lib/contexts/cookieconsentcontext.d.ts +19 -0
- package/lib/contexts/cookieconsentcontext.js +135 -27
- package/lib/contexts/environmentcontext.d.ts +13 -5
- package/lib/contexts/environmentcontext.js +26 -14
- package/lib/contexts/gamepadcontext.d.ts +17 -0
- package/lib/contexts/gamepadcontext.js +160 -74
- package/lib/contexts/gesturecontext.d.ts +11 -0
- package/lib/contexts/gesturecontext.js +266 -169
- package/lib/contexts/globaltagcontext.d.ts +2 -0
- package/lib/contexts/globaltagcontext.js +69 -10
- package/lib/contexts/loadcontext.d.ts +19 -0
- package/lib/contexts/loadcontext.js +68 -18
- package/lib/contexts/orientationcontext.d.ts +13 -0
- package/lib/contexts/orientationcontext.js +60 -11
- package/lib/contexts/snapshotContext.d.ts +10 -0
- package/lib/contexts/snapshotContext.js +55 -9
- package/lib/contexts/tagcontext.d.ts +14 -0
- package/lib/contexts/tagcontext.js +186 -98
- package/lib/entity.d.ts +5 -1
- package/lib/entity.js +4 -1
- package/lib/zcomponent.d.ts +20 -0
- package/lib/zcomponent.js +81 -12
- package/package.json +1 -1
|
@@ -5,8 +5,14 @@ import { Context, ContextManager } from '../context';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class AudioContextContext extends Context {
|
|
7
7
|
constructorProps: {};
|
|
8
|
+
/**
|
|
9
|
+
* @zignore
|
|
10
|
+
*/
|
|
8
11
|
readonly audioContext: AudioContext;
|
|
9
12
|
private _layers;
|
|
13
|
+
/**
|
|
14
|
+
* @zignore
|
|
15
|
+
*/
|
|
10
16
|
readonly layers: Map<string, AudioNode>;
|
|
11
17
|
/**
|
|
12
18
|
* Creates an instance of AudioContextContext.
|
|
@@ -17,19 +23,25 @@ export declare class AudioContextContext extends Context {
|
|
|
17
23
|
private _getLayer;
|
|
18
24
|
/**
|
|
19
25
|
* Retrieves an audio layer by its name.
|
|
26
|
+
*
|
|
20
27
|
* @param {string} [name] - The name of the audio layer.
|
|
21
28
|
* @returns {AudioNode} The audio layer.
|
|
29
|
+
* @zignore
|
|
22
30
|
*/
|
|
23
31
|
getLayer(name?: string): AudioNode;
|
|
24
32
|
/**
|
|
25
33
|
* Sets the volume for a specific audio layer.
|
|
34
|
+
*
|
|
26
35
|
* @param {string} [name] - The name of the audio layer.
|
|
27
36
|
* @param {number} v - The new volume level.
|
|
37
|
+
* @zignore
|
|
28
38
|
*/
|
|
29
39
|
setVolumeForLayer(name: string | undefined, v: number): void;
|
|
30
40
|
/**
|
|
31
41
|
* Disposes of the audio context and calls the parent dispose method.
|
|
42
|
+
*
|
|
32
43
|
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the disposal was successful.
|
|
44
|
+
* @zignore
|
|
33
45
|
*/
|
|
34
46
|
dispose(): never;
|
|
35
47
|
private _resumeAudioContext;
|
|
@@ -1,68 +1,143 @@
|
|
|
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 { Context } from '../context';
|
|
36
|
+
import { zIgnore } from '../decorators';
|
|
2
37
|
import { nextUserEvent } from './usereventcontext';
|
|
3
38
|
/**
|
|
4
39
|
* A context dedicated to audio management.
|
|
5
40
|
* @zcontext
|
|
6
41
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
let AudioContextContext = (() => {
|
|
43
|
+
let _classSuper = Context;
|
|
44
|
+
let _instanceExtraInitializers = [];
|
|
45
|
+
let _audioContext_decorators;
|
|
46
|
+
let _audioContext_initializers = [];
|
|
47
|
+
let _audioContext_extraInitializers = [];
|
|
48
|
+
let _layers_decorators;
|
|
49
|
+
let _layers_initializers = [];
|
|
50
|
+
let _layers_extraInitializers = [];
|
|
51
|
+
let _getLayer_decorators;
|
|
52
|
+
let _setVolumeForLayer_decorators;
|
|
53
|
+
let _dispose_decorators;
|
|
54
|
+
return class AudioContextContext extends _classSuper {
|
|
55
|
+
static {
|
|
56
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
57
|
+
_audioContext_decorators = [zIgnore()];
|
|
58
|
+
_layers_decorators = [zIgnore()];
|
|
59
|
+
_getLayer_decorators = [zIgnore()];
|
|
60
|
+
_setVolumeForLayer_decorators = [zIgnore()];
|
|
61
|
+
_dispose_decorators = [zIgnore()];
|
|
62
|
+
__esDecorate(this, null, _getLayer_decorators, { kind: "method", name: "getLayer", static: false, private: false, access: { has: obj => "getLayer" in obj, get: obj => obj.getLayer }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
63
|
+
__esDecorate(this, null, _setVolumeForLayer_decorators, { kind: "method", name: "setVolumeForLayer", static: false, private: false, access: { has: obj => "setVolumeForLayer" in obj, get: obj => obj.setVolumeForLayer }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
64
|
+
__esDecorate(this, null, _dispose_decorators, { kind: "method", name: "dispose", static: false, private: false, access: { has: obj => "dispose" in obj, get: obj => obj.dispose }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
65
|
+
__esDecorate(null, null, _audioContext_decorators, { kind: "field", name: "audioContext", static: false, private: false, access: { has: obj => "audioContext" in obj, get: obj => obj.audioContext, set: (obj, value) => { obj.audioContext = value; } }, metadata: _metadata }, _audioContext_initializers, _audioContext_extraInitializers);
|
|
66
|
+
__esDecorate(null, null, _layers_decorators, { kind: "field", name: "layers", static: false, private: false, access: { has: obj => "layers" in obj, get: obj => obj.layers, set: (obj, value) => { obj.layers = value; } }, metadata: _metadata }, _layers_initializers, _layers_extraInitializers);
|
|
67
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
31
68
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
constructorProps = __runInitializers(this, _instanceExtraInitializers);
|
|
70
|
+
/**
|
|
71
|
+
* @zignore
|
|
72
|
+
*/
|
|
73
|
+
audioContext = __runInitializers(this, _audioContext_initializers, new AudioContext());
|
|
74
|
+
_layers = (__runInitializers(this, _audioContext_extraInitializers), new Map());
|
|
75
|
+
/**
|
|
76
|
+
* @zignore
|
|
77
|
+
*/
|
|
78
|
+
layers = __runInitializers(this, _layers_initializers, this._layers);
|
|
79
|
+
/**
|
|
80
|
+
* Creates an instance of AudioContextContext.
|
|
81
|
+
* @param contextManager - The current ContextManager
|
|
82
|
+
* @param constructorProps - The constructor properties.
|
|
83
|
+
*/
|
|
84
|
+
constructor(contextManager, constructorProps) {
|
|
85
|
+
super(contextManager, constructorProps);
|
|
86
|
+
this.constructorProps = constructorProps;
|
|
87
|
+
nextUserEvent(contextManager).then(() => {
|
|
88
|
+
this.audioContext.resume();
|
|
89
|
+
document.addEventListener('visibilitychange', this._resumeAudioContext);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
_getLayer(name) {
|
|
93
|
+
let existing = this._layers.get(name ?? 'default');
|
|
94
|
+
if (!existing) {
|
|
95
|
+
existing = new GainNode(this.audioContext);
|
|
96
|
+
existing.connect(this.audioContext.destination);
|
|
97
|
+
this._layers.set(name ?? 'default', existing);
|
|
98
|
+
}
|
|
99
|
+
return existing;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Retrieves an audio layer by its name.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} [name] - The name of the audio layer.
|
|
105
|
+
* @returns {AudioNode} The audio layer.
|
|
106
|
+
* @zignore
|
|
107
|
+
*/
|
|
108
|
+
getLayer(name) {
|
|
109
|
+
return this._getLayer(name);
|
|
63
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Sets the volume for a specific audio layer.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} [name] - The name of the audio layer.
|
|
115
|
+
* @param {number} v - The new volume level.
|
|
116
|
+
* @zignore
|
|
117
|
+
*/
|
|
118
|
+
setVolumeForLayer(name, v) {
|
|
119
|
+
const layer = this._getLayer(name);
|
|
120
|
+
layer.gain.value = v;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Disposes of the audio context and calls the parent dispose method.
|
|
124
|
+
*
|
|
125
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the disposal was successful.
|
|
126
|
+
* @zignore
|
|
127
|
+
*/
|
|
128
|
+
dispose() {
|
|
129
|
+
document.removeEventListener('visibilitychange', this._resumeAudioContext);
|
|
130
|
+
this.audioContext.close();
|
|
131
|
+
return super.dispose();
|
|
132
|
+
}
|
|
133
|
+
_resumeAudioContext = (__runInitializers(this, _layers_extraInitializers), () => {
|
|
134
|
+
if (this.audioContext.state === 'suspended' && document.visibilityState === 'visible') {
|
|
135
|
+
this.audioContext.resume();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
64
138
|
};
|
|
65
|
-
}
|
|
139
|
+
})();
|
|
140
|
+
export { AudioContextContext };
|
|
66
141
|
/**
|
|
67
142
|
* Returns the audio context.
|
|
68
143
|
*/
|
|
@@ -24,11 +24,29 @@ export interface CanvasContextOptions {
|
|
|
24
24
|
* */
|
|
25
25
|
export declare class CanvasContext extends Context {
|
|
26
26
|
constructorProps: CanvasContextOptions;
|
|
27
|
+
/**
|
|
28
|
+
* @zignore
|
|
29
|
+
*/
|
|
27
30
|
readonly onBeforeRender: Event<[number]>;
|
|
31
|
+
/**
|
|
32
|
+
* @zignore
|
|
33
|
+
*/
|
|
28
34
|
readonly onAfterRender: Event<[number]>;
|
|
35
|
+
/**
|
|
36
|
+
* @zignore
|
|
37
|
+
*/
|
|
29
38
|
readonly canvas: HTMLCanvasElement;
|
|
39
|
+
/**
|
|
40
|
+
* @zignore
|
|
41
|
+
*/
|
|
30
42
|
readonly overlayDefault: HTMLDivElement;
|
|
43
|
+
/**
|
|
44
|
+
* @zignore
|
|
45
|
+
*/
|
|
31
46
|
readonly overlay: Observable<HTMLDivElement>;
|
|
47
|
+
/**
|
|
48
|
+
* @zui
|
|
49
|
+
*/
|
|
32
50
|
readonly size: Observable<[
|
|
33
51
|
number,
|
|
34
52
|
number
|
|
@@ -42,18 +60,25 @@ export declare class CanvasContext extends Context {
|
|
|
42
60
|
constructor(contextManager: ContextManager, constructorProps: CanvasContextOptions);
|
|
43
61
|
/**
|
|
44
62
|
* Captures the canvas content and returns it as a Data URL after the current frame has rendered.
|
|
63
|
+
*
|
|
45
64
|
* @param type The MIME image format type.
|
|
46
65
|
* @param quality Between 0 and 1 indicating image quality. Defaults to 1.
|
|
66
|
+
* @zignore
|
|
47
67
|
*/
|
|
48
68
|
captureToDataURL(type?: 'image/png' | 'image/jpeg', quality?: number): Promise<string>;
|
|
49
69
|
/**
|
|
50
70
|
* Captures the canvas content and returns it as an ArrayBuffer after the current frame has rendered.
|
|
71
|
+
*
|
|
51
72
|
* @param type The MIME image format type.
|
|
52
73
|
* @param quality Between 0 and 1 indicating image quality. Defaults to 1.
|
|
74
|
+
* @zignore
|
|
53
75
|
*/
|
|
54
76
|
captureToArrayBuffer(type?: 'image/png' | 'image/jpeg', quality?: number): Promise<ArrayBuffer>;
|
|
55
77
|
private canvasToBlob;
|
|
56
78
|
private blobToArrayBuffer;
|
|
79
|
+
/**
|
|
80
|
+
* @zignore
|
|
81
|
+
*/
|
|
57
82
|
dispose(): never;
|
|
58
83
|
}
|
|
59
84
|
/**
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
};
|
|
1
8
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
9
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
10
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -25,15 +32,8 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
25
32
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
33
|
done = true;
|
|
27
34
|
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
35
|
import { Context } from '../context';
|
|
36
|
-
import { zUI } from '../decorators';
|
|
36
|
+
import { zIgnore, zUI } from '../decorators';
|
|
37
37
|
import { Event } from '../event';
|
|
38
38
|
import { Observable } from '../observable';
|
|
39
39
|
/**
|
|
@@ -48,23 +48,76 @@ import { Observable } from '../observable';
|
|
|
48
48
|
* */
|
|
49
49
|
let CanvasContext = (() => {
|
|
50
50
|
let _classSuper = Context;
|
|
51
|
+
let _instanceExtraInitializers = [];
|
|
52
|
+
let _onBeforeRender_decorators;
|
|
53
|
+
let _onBeforeRender_initializers = [];
|
|
54
|
+
let _onBeforeRender_extraInitializers = [];
|
|
55
|
+
let _onAfterRender_decorators;
|
|
56
|
+
let _onAfterRender_initializers = [];
|
|
57
|
+
let _onAfterRender_extraInitializers = [];
|
|
58
|
+
let _canvas_decorators;
|
|
59
|
+
let _canvas_initializers = [];
|
|
60
|
+
let _canvas_extraInitializers = [];
|
|
61
|
+
let _overlayDefault_decorators;
|
|
62
|
+
let _overlayDefault_initializers = [];
|
|
63
|
+
let _overlayDefault_extraInitializers = [];
|
|
64
|
+
let _overlay_decorators;
|
|
65
|
+
let _overlay_initializers = [];
|
|
66
|
+
let _overlay_extraInitializers = [];
|
|
51
67
|
let _size_decorators;
|
|
52
68
|
let _size_initializers = [];
|
|
53
69
|
let _size_extraInitializers = [];
|
|
70
|
+
let _captureToDataURL_decorators;
|
|
71
|
+
let _captureToArrayBuffer_decorators;
|
|
72
|
+
let _dispose_decorators;
|
|
54
73
|
return class CanvasContext extends _classSuper {
|
|
55
74
|
static {
|
|
56
75
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
76
|
+
_onBeforeRender_decorators = [zIgnore()];
|
|
77
|
+
_onAfterRender_decorators = [zIgnore()];
|
|
78
|
+
_canvas_decorators = [zIgnore()];
|
|
79
|
+
_overlayDefault_decorators = [zIgnore()];
|
|
80
|
+
_overlay_decorators = [zIgnore()];
|
|
57
81
|
_size_decorators = [zUI()];
|
|
82
|
+
_captureToDataURL_decorators = [zIgnore()];
|
|
83
|
+
_captureToArrayBuffer_decorators = [zIgnore()];
|
|
84
|
+
_dispose_decorators = [zIgnore()];
|
|
85
|
+
__esDecorate(this, null, _captureToDataURL_decorators, { kind: "method", name: "captureToDataURL", static: false, private: false, access: { has: obj => "captureToDataURL" in obj, get: obj => obj.captureToDataURL }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
86
|
+
__esDecorate(this, null, _captureToArrayBuffer_decorators, { kind: "method", name: "captureToArrayBuffer", static: false, private: false, access: { has: obj => "captureToArrayBuffer" in obj, get: obj => obj.captureToArrayBuffer }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
87
|
+
__esDecorate(this, null, _dispose_decorators, { kind: "method", name: "dispose", static: false, private: false, access: { has: obj => "dispose" in obj, get: obj => obj.dispose }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
88
|
+
__esDecorate(null, null, _onBeforeRender_decorators, { kind: "field", name: "onBeforeRender", static: false, private: false, access: { has: obj => "onBeforeRender" in obj, get: obj => obj.onBeforeRender, set: (obj, value) => { obj.onBeforeRender = value; } }, metadata: _metadata }, _onBeforeRender_initializers, _onBeforeRender_extraInitializers);
|
|
89
|
+
__esDecorate(null, null, _onAfterRender_decorators, { kind: "field", name: "onAfterRender", static: false, private: false, access: { has: obj => "onAfterRender" in obj, get: obj => obj.onAfterRender, set: (obj, value) => { obj.onAfterRender = value; } }, metadata: _metadata }, _onAfterRender_initializers, _onAfterRender_extraInitializers);
|
|
90
|
+
__esDecorate(null, null, _canvas_decorators, { kind: "field", name: "canvas", static: false, private: false, access: { has: obj => "canvas" in obj, get: obj => obj.canvas, set: (obj, value) => { obj.canvas = value; } }, metadata: _metadata }, _canvas_initializers, _canvas_extraInitializers);
|
|
91
|
+
__esDecorate(null, null, _overlayDefault_decorators, { kind: "field", name: "overlayDefault", static: false, private: false, access: { has: obj => "overlayDefault" in obj, get: obj => obj.overlayDefault, set: (obj, value) => { obj.overlayDefault = value; } }, metadata: _metadata }, _overlayDefault_initializers, _overlayDefault_extraInitializers);
|
|
92
|
+
__esDecorate(null, null, _overlay_decorators, { kind: "field", name: "overlay", static: false, private: false, access: { has: obj => "overlay" in obj, get: obj => obj.overlay, set: (obj, value) => { obj.overlay = value; } }, metadata: _metadata }, _overlay_initializers, _overlay_extraInitializers);
|
|
58
93
|
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
59
94
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
60
95
|
}
|
|
61
|
-
constructorProps;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
96
|
+
constructorProps = __runInitializers(this, _instanceExtraInitializers);
|
|
97
|
+
/**
|
|
98
|
+
* @zignore
|
|
99
|
+
*/
|
|
100
|
+
onBeforeRender = __runInitializers(this, _onBeforeRender_initializers, new Event());
|
|
101
|
+
/**
|
|
102
|
+
* @zignore
|
|
103
|
+
*/
|
|
104
|
+
onAfterRender = (__runInitializers(this, _onBeforeRender_extraInitializers), __runInitializers(this, _onAfterRender_initializers, new Event()));
|
|
105
|
+
/**
|
|
106
|
+
* @zignore
|
|
107
|
+
*/
|
|
108
|
+
canvas = (__runInitializers(this, _onAfterRender_extraInitializers), __runInitializers(this, _canvas_initializers, void 0));
|
|
109
|
+
/**
|
|
110
|
+
* @zignore
|
|
111
|
+
*/
|
|
112
|
+
overlayDefault = (__runInitializers(this, _canvas_extraInitializers), __runInitializers(this, _overlayDefault_initializers, void 0));
|
|
113
|
+
/**
|
|
114
|
+
* @zignore
|
|
115
|
+
*/
|
|
116
|
+
overlay = (__runInitializers(this, _overlayDefault_extraInitializers), __runInitializers(this, _overlay_initializers, void 0));
|
|
117
|
+
/**
|
|
118
|
+
* @zui
|
|
119
|
+
*/
|
|
120
|
+
size = (__runInitializers(this, _overlay_extraInitializers), __runInitializers(this, _size_initializers, void 0));
|
|
68
121
|
_resizeObserver = (__runInitializers(this, _size_extraInitializers), new ResizeObserver(entries => {
|
|
69
122
|
for (const entry of entries) {
|
|
70
123
|
if (entry.target !== this.canvas)
|
|
@@ -117,8 +170,10 @@ let CanvasContext = (() => {
|
|
|
117
170
|
}
|
|
118
171
|
/**
|
|
119
172
|
* Captures the canvas content and returns it as a Data URL after the current frame has rendered.
|
|
173
|
+
*
|
|
120
174
|
* @param type The MIME image format type.
|
|
121
175
|
* @param quality Between 0 and 1 indicating image quality. Defaults to 1.
|
|
176
|
+
* @zignore
|
|
122
177
|
*/
|
|
123
178
|
async captureToDataURL(type = 'image/jpeg', quality = 1) {
|
|
124
179
|
await useOnAfterRender(this.contextManager).next;
|
|
@@ -126,8 +181,10 @@ let CanvasContext = (() => {
|
|
|
126
181
|
}
|
|
127
182
|
/**
|
|
128
183
|
* Captures the canvas content and returns it as an ArrayBuffer after the current frame has rendered.
|
|
184
|
+
*
|
|
129
185
|
* @param type The MIME image format type.
|
|
130
186
|
* @param quality Between 0 and 1 indicating image quality. Defaults to 1.
|
|
187
|
+
* @zignore
|
|
131
188
|
*/
|
|
132
189
|
async captureToArrayBuffer(type = 'image/jpeg', quality = 1) {
|
|
133
190
|
await useOnAfterRender(this.contextManager).next;
|
|
@@ -163,6 +220,9 @@ let CanvasContext = (() => {
|
|
|
163
220
|
reader.readAsArrayBuffer(blob);
|
|
164
221
|
});
|
|
165
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* @zignore
|
|
225
|
+
*/
|
|
166
226
|
dispose() {
|
|
167
227
|
this.onBeforeRender.clearListeners();
|
|
168
228
|
this.onAfterRender.clearListeners();
|
|
@@ -49,25 +49,44 @@ export interface Vendor {
|
|
|
49
49
|
* @zcontext
|
|
50
50
|
*/
|
|
51
51
|
export declare class CookieConsentContext extends Context {
|
|
52
|
+
/**
|
|
53
|
+
* @zignore
|
|
54
|
+
*/
|
|
52
55
|
readonly status: Observable<StatusValue, never>;
|
|
56
|
+
/**
|
|
57
|
+
* @zignore
|
|
58
|
+
*/
|
|
53
59
|
readonly functionalCookies: Observable<ConsentStatusValue, never>;
|
|
60
|
+
/**
|
|
61
|
+
* @zignore
|
|
62
|
+
*/
|
|
54
63
|
readonly performanceCookies: Observable<ConsentStatusValue, never>;
|
|
64
|
+
/**
|
|
65
|
+
* @zignore
|
|
66
|
+
*/
|
|
55
67
|
readonly marketingCookies: Observable<ConsentStatusValue, never>;
|
|
68
|
+
/**
|
|
69
|
+
* @zignore
|
|
70
|
+
*/
|
|
56
71
|
readonly showSettings: Observable<(() => void) | undefined, never>;
|
|
57
72
|
/**
|
|
58
73
|
* @default []
|
|
74
|
+
* @zignore
|
|
59
75
|
*/
|
|
60
76
|
readonly performanceVendors: Vendor[];
|
|
61
77
|
/**
|
|
62
78
|
* @default []
|
|
79
|
+
* @zignore
|
|
63
80
|
*/
|
|
64
81
|
readonly marketingVendors: Vendor[];
|
|
65
82
|
/**
|
|
66
83
|
* Registers a performance vendor.
|
|
84
|
+
* @zignore
|
|
67
85
|
*/
|
|
68
86
|
registerPerformanceVendor(v: Vendor): void;
|
|
69
87
|
/**
|
|
70
88
|
* Registers a marketing vendor.
|
|
89
|
+
* @zignore
|
|
71
90
|
*/
|
|
72
91
|
registerMarketingVendor(v: Vendor): void;
|
|
73
92
|
}
|