@wildix/xbees-connect 1.2.41 → 1.3.1

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/README.md CHANGED
@@ -13,6 +13,26 @@ yarn add @wildix/xbees-connect
13
13
  npm install @wildix/xbees-connect
14
14
  ```
15
15
 
16
+ ## Work Variants
17
+
18
+ The integration can be launched in different modes via the `v` URL parameter:
19
+
20
+ - `ui` - Standard UI mode (default)
21
+ - `no-ui` - Data-only mode, no UI shown
22
+ - `d` - Dialog/setup mode
23
+ - `f` - Fullsize mode, integration takes full viewport dimensions
24
+
25
+ You can check the current mode using:
26
+
27
+ ```ts
28
+ const client = Client.getInstance();
29
+
30
+ client.showsUi(); // Returns true for UI modes (ui, d, f)
31
+ client.isDataOnly(); // Returns true for no-ui mode
32
+ client.isSetupDialog(); // Returns true for dialog mode (d)
33
+ client.isFullsize(); // Returns true for fullsize mode (f)
34
+ ```
35
+
16
36
  ## Usage
17
37
 
18
38
  ```ts
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.40",
3
+ "version": "1.2.43",
4
4
  "description": "This library provides easy communication between x-bees and integrated web applications",
5
5
  "author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
6
6
  "homepage": "",
@@ -213,6 +213,9 @@ class Client {
213
213
  showsUi() {
214
214
  return !this.isDataOnly();
215
215
  }
216
+ isFullsize() {
217
+ return this.variant === 'f';
218
+ }
216
219
  isActivationOnly() {
217
220
  return this.needAuthorize;
218
221
  }
@@ -475,5 +478,8 @@ class Client {
475
478
  onContactRefresh(callback) {
476
479
  return this.addEventListener(enums_1.EventType.CONTACT_REFRESH, callback);
477
480
  }
481
+ onStorageUpdated(callback) {
482
+ return this.addEventListener(enums_1.EventType.STORAGE_IS_UPDATED, callback);
483
+ }
478
484
  }
479
485
  exports.Client = Client;
@@ -15,6 +15,7 @@ var EventType;
15
15
  EventType["VISIBILITY"] = "xBeesVisibility";
16
16
  EventType["CONTACT_WEIGHT_UPDATE"] = "xBeesContactWeightUpdate";
17
17
  EventType["CONTACT_REFRESH"] = "xBeesContactRefresh";
18
+ EventType["STORAGE_IS_UPDATED"] = "xBeesStorageIsUpdated";
18
19
  })(EventType || (exports.EventType = EventType = {}));
19
20
  var ClientEventType;
20
21
  (function (ClientEventType) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.40",
3
+ "version": "1.2.43",
4
4
  "description": "This library provides easy communication between x-bees and integrated web applications",
5
5
  "author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
6
6
  "homepage": "",
@@ -207,6 +207,9 @@ export class Client {
207
207
  showsUi() {
208
208
  return !this.isDataOnly();
209
209
  }
210
+ isFullsize() {
211
+ return this.variant === 'f';
212
+ }
210
213
  isActivationOnly() {
211
214
  return this.needAuthorize;
212
215
  }
@@ -469,4 +472,7 @@ export class Client {
469
472
  onContactRefresh(callback) {
470
473
  return this.addEventListener(EventType.CONTACT_REFRESH, callback);
471
474
  }
475
+ onStorageUpdated(callback) {
476
+ return this.addEventListener(EventType.STORAGE_IS_UPDATED, callback);
477
+ }
472
478
  }
@@ -12,6 +12,7 @@ export var EventType;
12
12
  EventType["VISIBILITY"] = "xBeesVisibility";
13
13
  EventType["CONTACT_WEIGHT_UPDATE"] = "xBeesContactWeightUpdate";
14
14
  EventType["CONTACT_REFRESH"] = "xBeesContactRefresh";
15
+ EventType["STORAGE_IS_UPDATED"] = "xBeesStorageIsUpdated";
15
16
  })(EventType || (EventType = {}));
16
17
  export var ClientEventType;
17
18
  (function (ClientEventType) {
@@ -61,6 +61,7 @@ export declare class Client implements ConnectClient {
61
61
  isDataOnly(): boolean;
62
62
  isSetupDialog(): boolean;
63
63
  showsUi(): boolean;
64
+ isFullsize(): boolean;
64
65
  isActivationOnly(): boolean;
65
66
  getContext(): Promise<Message<ClientEventType.CONTEXT>>;
66
67
  getCurrentContact(): Promise<Message<ClientEventType.CURRENT_CONTACT>>;
@@ -111,4 +112,5 @@ export declare class Client implements ConnectClient {
111
112
  }): void;
112
113
  onContactWeightUpdate(callback: Callback<EventType.CONTACT_WEIGHT_UPDATE>): RemoveEventListener;
113
114
  onContactRefresh(callback: Callback<EventType.CONTACT_REFRESH>): RemoveEventListener;
115
+ onStorageUpdated(callback: Callback<EventType.STORAGE_IS_UPDATED>): RemoveEventListener;
114
116
  }
@@ -10,7 +10,8 @@ export declare enum EventType {
10
10
  LOGOUT = "xBeesLogout",
11
11
  VISIBILITY = "xBeesVisibility",
12
12
  CONTACT_WEIGHT_UPDATE = "xBeesContactWeightUpdate",
13
- CONTACT_REFRESH = "xBeesContactRefresh"
13
+ CONTACT_REFRESH = "xBeesContactRefresh",
14
+ STORAGE_IS_UPDATED = "xBeesStorageIsUpdated"
14
15
  }
15
16
  export declare enum ClientEventType {
16
17
  READY = "xBeesReady",
@@ -65,6 +65,9 @@ export interface ConnectClient {
65
65
  * Determines x-bees is using this connect for representation on UI and this integration will be shown on UI
66
66
  * this opposite to {@link isDataOnly} */
67
67
  showsUi: () => boolean;
68
+ /**
69
+ * Determines x-bees is using this connect in fullsize mode */
70
+ isFullsize: () => boolean;
68
71
  /**
69
72
  * Determines x-bees is using this connect for activation/authorization on UI and this call of integration UI should show
70
73
  * dialog which leads to integration be activated
@@ -212,4 +215,8 @@ export interface ConnectClient {
212
215
  * Starts listen for the events when contact was updated in the daemon and the opened integration should be refreshed
213
216
  */
214
217
  onContactRefresh: (callback: Callback<EventType.CONTACT_REFRESH>) => RemoveEventListener;
218
+ /**
219
+ * Starts listen for the events when xbees updates the local storage and callback can consider the new data
220
+ */
221
+ onStorageUpdated: (callback: Callback<EventType.STORAGE_IS_UPDATED>) => RemoveEventListener;
215
222
  }
@@ -29,6 +29,7 @@ export type EventCallbackMap = {
29
29
  [EventType.REDIRECT_QUERY]: (query: EventPayloadMap[EventType.REDIRECT_QUERY]) => void;
30
30
  [EventType.CONTACT_WEIGHT_UPDATE]: (params: EventPayloadMap[EventType.CONTACT_WEIGHT_UPDATE]) => void;
31
31
  [EventType.CONTACT_REFRESH]: (id: EventPayloadMap[EventType.CONTACT_REFRESH]) => void;
32
+ [EventType.STORAGE_IS_UPDATED]: () => void;
32
33
  };
33
34
  export type RawMessageEvent = MessageEvent<string | Message>;
34
35
  export type ReadyExtendedProps = {
@@ -1,3 +1,3 @@
1
1
  type DeprecatedWorkVariants = 'info-frame' | 'daemon' | 'dialog';
2
- export type WorkVariants = 'ui' | 'no-ui' | 'd' | DeprecatedWorkVariants;
2
+ export type WorkVariants = 'ui' | 'no-ui' | 'd' | 'f' | DeprecatedWorkVariants;
3
3
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.41",
3
+ "version": "1.3.1",
4
4
  "description": "This library provides easy communication between x-bees and integrated web applications",
5
5
  "author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
6
6
  "homepage": "",
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=16"
47
47
  },
48
- "gitHead": "c3844d328b18adb3e05d341ffb73165c8d20a8c5"
48
+ "gitHead": "b58ddc9d72dff85386033eda257f8c870da0579f"
49
49
  }