@configura/babylon-view 2.0.0-alpha.7 → 2.0.0-alpha.8
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/dist/io/CfgHistoryToCameraConfConnector.js +1 -1
- package/dist/io/CfgIOCameraConfConnector.d.ts +4 -4
- package/dist/io/CfgIOCameraConfConnector.js +8 -10
- package/dist/io/CfgObservableStateToCameraConfConnector.js +1 -1
- package/dist/io/CfgWindowMessageToCameraConfConnector.js +1 -1
- package/package.json +5 -5
|
@@ -72,7 +72,7 @@ export class CfgHistoryToCameraConfConnector extends CfgIOCameraConfConnector {
|
|
|
72
72
|
addToMapAndRound(qsKeyValues, this._qsKeyDistance, cameraConf.distanceWasAutoSet ? undefined : cameraConf.distance, this.defaults.distance);
|
|
73
73
|
}
|
|
74
74
|
return {
|
|
75
|
-
message:
|
|
75
|
+
message: CfgIOCameraConfConnector.makeMessage(cameraConf, initial),
|
|
76
76
|
qsKeyValues,
|
|
77
77
|
useHistoryPush: false,
|
|
78
78
|
};
|
|
@@ -23,14 +23,14 @@ export declare abstract class CfgIOCameraConfConnector<S> {
|
|
|
23
23
|
private _delayId;
|
|
24
24
|
private _send;
|
|
25
25
|
protected abstract makeSendData(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): S;
|
|
26
|
-
makeMessage(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): CfgCameraConfMessage;
|
|
27
|
-
makeMessageListener(callback: CameraConfMessageCallback): (message: unknown) => Promise<void>;
|
|
26
|
+
static makeMessage(cameraConf: CfgOrbitalCameraControlProps, initial: boolean): CfgCameraConfMessage;
|
|
27
|
+
static makeMessageListener(callback: CameraConfMessageCallback): (message: unknown) => Promise<void>;
|
|
28
28
|
/**
|
|
29
29
|
* Register the callback to listen for Product Configuration messages
|
|
30
30
|
* @returns A function which when called will cancel listening
|
|
31
31
|
*/
|
|
32
|
-
listenForMessage(callback: CameraConfMessageCallback): () => void;
|
|
33
|
-
listenForCamera(callback: CameraConfCallback): () => void;
|
|
32
|
+
static listenForMessage<S>(callback: CameraConfMessageCallback, ioManager: CfgIOManager<S>): () => void;
|
|
33
|
+
static listenForCamera(callback: CameraConfCallback, cameraControl: Observable<CfgOrbitalCameraControlProps>): () => void;
|
|
34
34
|
}
|
|
35
35
|
export {};
|
|
36
36
|
//# sourceMappingURL=CfgIOCameraConfConnector.d.ts.map
|
|
@@ -28,28 +28,28 @@ export class CfgIOCameraConfConnector {
|
|
|
28
28
|
};
|
|
29
29
|
this._send = (data) => this._ioManager.send(STAGE_CAMERA_CONF_MESSAGE_KEY, data);
|
|
30
30
|
this._send(this.makeSendData(initial, true));
|
|
31
|
-
this._stopListenToMessage =
|
|
31
|
+
this._stopListenToMessage = CfgIOCameraConfConnector.listenForMessage((message) => __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
if (this._delayId !== undefined) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
_cameraControl.notifyAll(message.cameraConf, this);
|
|
36
|
-
}));
|
|
37
|
-
this._stopListenToProdConf =
|
|
36
|
+
}), _ioManager);
|
|
37
|
+
this._stopListenToProdConf = CfgIOCameraConfConnector.listenForCamera((cameraConf) => __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
window.clearTimeout(this._delayId);
|
|
39
39
|
this._delayId = window.setTimeout(() => {
|
|
40
40
|
this._send(this.makeSendData(cameraConf, false));
|
|
41
41
|
this._delayId = undefined;
|
|
42
42
|
}, THROTTLING_DELAY);
|
|
43
|
-
}));
|
|
43
|
+
}), _cameraControl);
|
|
44
44
|
}
|
|
45
|
-
makeMessage(cameraConf, initial) {
|
|
45
|
+
static makeMessage(cameraConf, initial) {
|
|
46
46
|
return {
|
|
47
47
|
version: STAGE_CAMERA_MESSAGE_VERSION,
|
|
48
48
|
initial,
|
|
49
49
|
cameraConf,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
makeMessageListener(callback) {
|
|
52
|
+
static makeMessageListener(callback) {
|
|
53
53
|
return (message) => __awaiter(this, void 0, void 0, function* () {
|
|
54
54
|
const cameraConfMessage = message;
|
|
55
55
|
const version = cameraConfMessage.version;
|
|
@@ -64,16 +64,14 @@ export class CfgIOCameraConfConnector {
|
|
|
64
64
|
* Register the callback to listen for Product Configuration messages
|
|
65
65
|
* @returns A function which when called will cancel listening
|
|
66
66
|
*/
|
|
67
|
-
listenForMessage(callback) {
|
|
68
|
-
const ioManager = this._ioManager;
|
|
67
|
+
static listenForMessage(callback, ioManager) {
|
|
69
68
|
const listener = this.makeMessageListener(callback);
|
|
70
69
|
ioManager.listenForMessage(listener, STAGE_CAMERA_CONF_MESSAGE_KEY);
|
|
71
70
|
return () => {
|
|
72
71
|
ioManager.stopListenForMessage(listener);
|
|
73
72
|
};
|
|
74
73
|
}
|
|
75
|
-
listenForCamera(callback) {
|
|
76
|
-
const cameraControl = this._cameraControl;
|
|
74
|
+
static listenForCamera(callback, cameraControl) {
|
|
77
75
|
cameraControl.listen(callback, this);
|
|
78
76
|
return () => {
|
|
79
77
|
cameraControl.stopListen(callback);
|
|
@@ -6,6 +6,6 @@ import { CfgIOCameraConfConnector } from "./CfgIOCameraConfConnector.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export class CfgObservableStateToCameraConfConnector extends CfgIOCameraConfConnector {
|
|
8
8
|
makeSendData(cameraConf, initial) {
|
|
9
|
-
return
|
|
9
|
+
return CfgIOCameraConfConnector.makeMessage(cameraConf, initial);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@ import { CfgIOCameraConfConnector } from "./CfgIOCameraConfConnector.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export class CfgWindowMessageToCameraConfConnector extends CfgIOCameraConfConnector {
|
|
8
8
|
makeSendData(cameraConf, initial) {
|
|
9
|
-
return
|
|
9
|
+
return CfgIOCameraConfConnector.makeMessage(cameraConf, initial);
|
|
10
10
|
}
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configura/babylon-view",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.8",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babylonjs/core": "4.2.0",
|
|
19
|
-
"@configura/web-core": "2.0.0-alpha.
|
|
20
|
-
"@configura/web-utilities": "2.0.0-alpha.
|
|
19
|
+
"@configura/web-core": "2.0.0-alpha.8",
|
|
20
|
+
"@configura/web-utilities": "2.0.0-alpha.8"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@configura/web-api": "2.0.0-alpha.
|
|
23
|
+
"@configura/web-api": "2.0.0-alpha.8",
|
|
24
24
|
"del-cli": "^3.0.0",
|
|
25
25
|
"typescript": "4.2"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "7b649675de680b81a1ba8b63e9ebdf1a61f90469"
|
|
31
31
|
}
|