@configura/web-api 1.6.0-iotest.3 → 1.6.0-iotest.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.
@@ -3,7 +3,6 @@ import { CfgIOManager } from "./CfgIOManager.js";
3
3
  export declare type CfgCameraConf = {
4
4
  yaw?: number;
5
5
  pitch?: number;
6
- distance?: number;
7
6
  };
8
7
  export declare type CfgCameraConfMessage = {
9
8
  version: string;
@@ -16,7 +15,7 @@ declare type CameraConfCallback = (conf: CfgCameraConf) => Promise<void>;
16
15
  export declare abstract class CfgIOCameraConfConnector<K extends keyof WindowEventMap, S, M extends CfgIOManager<K, S>> {
17
16
  private readonly _ioManager;
18
17
  private readonly _cameraControl;
19
- constructor(_ioManager: M, initial: CfgCameraConf, _cameraControl: Observable<CfgCameraConf>);
18
+ constructor(_ioManager: M, initialCameraConf: CfgCameraConf, _cameraControl: Observable<CfgCameraConf>);
20
19
  private _delayId;
21
20
  protected abstract makeSendData(cameraConf: CfgCameraConf, initial: boolean): S;
22
21
  makeMessage(cameraConf: CfgCameraConf, initial: boolean): CfgCameraConfMessage;
@@ -13,10 +13,10 @@ const THROTTLING_DELAY = 100;
13
13
  export const STAGE_CAMERA_CONF_MESSAGE_KEY = "stagecameraconf";
14
14
  export const STAGE_CAMERA_MESSAGE_VERSION = "1.0";
15
15
  export class CfgIOCameraConfConnector {
16
- constructor(_ioManager, initial, _cameraControl) {
16
+ constructor(_ioManager, initialCameraConf, _cameraControl) {
17
17
  this._ioManager = _ioManager;
18
18
  this._cameraControl = _cameraControl;
19
- _ioManager.send(STAGE_CAMERA_CONF_MESSAGE_KEY, this.makeSendData(initial, true));
19
+ _ioManager.send(STAGE_CAMERA_CONF_MESSAGE_KEY, this.makeSendData(initialCameraConf, true));
20
20
  this.listenForMessage((message) => __awaiter(this, void 0, void 0, function* () {
21
21
  if (this._delayId !== undefined) {
22
22
  return;
@@ -32,7 +32,12 @@ export class CfgIOCameraConfConnector {
32
32
  }));
33
33
  }
34
34
  makeMessage(cameraConf, initial) {
35
- return Object.assign({ version: STAGE_CAMERA_MESSAGE_VERSION, initial }, cameraConf);
35
+ return {
36
+ version: STAGE_CAMERA_MESSAGE_VERSION,
37
+ initial,
38
+ yaw: cameraConf.yaw,
39
+ pitch: cameraConf.pitch,
40
+ };
36
41
  }
37
42
  makeMessageListener(callback) {
38
43
  return (message) => __awaiter(this, void 0, void 0, function* () {
@@ -6,6 +6,11 @@ export class CfgWindowMessageManager extends CfgIOManager {
6
6
  this._targetOrigin = _targetOrigin;
7
7
  this._acceptableMessageOrigin = _acceptableMessageOrigin;
8
8
  this.eventType = "message";
9
+ for (const remote of _remoteEnds) {
10
+ if (remote === window) {
11
+ console.warn("You are providing your own window as a remote end.");
12
+ }
13
+ }
9
14
  }
10
15
  doSend(messageKey, data) {
11
16
  const container = CfgIOManager.makeContainer({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/web-api",
3
- "version": "1.6.0-iotest.3",
3
+ "version": "1.6.0-iotest.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "@configura/web-utilities": "1.6.0-iotest.3"
26
+ "@configura/web-utilities": "1.6.0-iotest.4"
27
27
  },
28
- "gitHead": "7f913509770f510cef840f5821fc0068887900ca"
28
+ "gitHead": "d6eb7775e09c974d24dc5f44c97a26d4d42c3c68"
29
29
  }