@ada-support/embed2 1.4.2 → 1.4.5

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.
@@ -4,7 +4,7 @@ import type { MessagePayload } from "common/types/events";
4
4
  import type { DirectDispatch } from "common/types/store";
5
5
  import type { StoreState } from "common/types/store-state";
6
6
  export declare const actions: {
7
- [key in ActionCreators]: ({ currentState, payload, dispatch }: {
7
+ [key in ActionCreators]: ({ currentState, payload, dispatch, }: {
8
8
  payload?: MessagePayload;
9
9
  currentState: StoreState;
10
10
  dispatch: DirectDispatch;
@@ -63,8 +63,8 @@ export interface EmbedResponsePayloadByEvent {
63
63
  SET_DEVICE_TOKEN_RESPONSE: unknown;
64
64
  }
65
65
  export declare type EmbedResponseEvent = keyof EmbedResponsePayloadByEvent;
66
- export declare type EmbedEvent = (EmbedRequestEvent | EmbedResponseEvent);
67
- export declare type PayloadByEvent = (EmbedRequestPayloadByEvent & EmbedResponsePayloadByEvent);
66
+ export declare type EmbedEvent = EmbedRequestEvent | EmbedResponseEvent;
67
+ export declare type PayloadByEvent = EmbedRequestPayloadByEvent & EmbedResponsePayloadByEvent;
68
68
  export declare abstract class Channel {
69
69
  protected abstract trackedListeners: Set<Refhandler>;
70
70
  protected abstract trackedTimeouts: Set<number>;
@@ -18,10 +18,10 @@ export interface PublishEventPayload<K extends AdaEventKey> {
18
18
  eventKey: K;
19
19
  data: AdaEventDataKeyedByEvent[K];
20
20
  }
21
- export interface AdaCustomEvent<E extends (EmbedEvent | string) = string> {
21
+ export interface AdaCustomEvent<E extends EmbedEvent | string = string> {
22
22
  type: E;
23
23
  payload?: E extends keyof PayloadByEvent ? PayloadByEvent[E] : unknown;
24
24
  id?: string;
25
25
  status?: FetchEventStatusType;
26
26
  }
27
- export declare type Refhandler<E extends (EmbedRequestEvent | string) = string> = (handleEvent: MessageEvent | CustomEventInit<AdaCustomEvent<E>>) => void;
27
+ export declare type Refhandler<E extends EmbedRequestEvent | string = string> = (handleEvent: MessageEvent | CustomEventInit<AdaCustomEvent<E>>) => void;
@@ -5,4 +5,4 @@ export declare const INTRO_IFRAME = "intro";
5
5
  export declare const BUTTON_IFRAME = "button";
6
6
  export declare const MASK_IFRAME = "drawer-mask";
7
7
  export declare const XSTORAGE_IFRAME = "x-storage";
8
- export declare type Module = (typeof CHAT_IFRAME | typeof ENTRY_SCRIPT | typeof EMBED_SCRIPT | typeof INTRO_IFRAME | typeof BUTTON_IFRAME | typeof MASK_IFRAME | typeof XSTORAGE_IFRAME);
8
+ export declare type Module = typeof CHAT_IFRAME | typeof ENTRY_SCRIPT | typeof EMBED_SCRIPT | typeof INTRO_IFRAME | typeof BUTTON_IFRAME | typeof MASK_IFRAME | typeof XSTORAGE_IFRAME;
@@ -14,10 +14,10 @@ export interface StorageValueByKey {
14
14
  [ZD_PREVIOUS_TAGS_STORAGE_KEY]: string;
15
15
  [ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY]: string;
16
16
  [ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY]: string;
17
- "liveChatPending": boolean;
17
+ liveChatPending: boolean;
18
18
  "ada-embed_is-drawer-open": boolean;
19
19
  "[handle]_marketing_campaigns_shown": string;
20
- "test": string;
20
+ test: string;
21
21
  }
22
22
  export declare type StorageKey = keyof StorageValueByKey;
23
23
  /**
@@ -196,8 +196,8 @@ function loadModule(moduleName) {
196
196
 
197
197
  "use strict";
198
198
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
199
- /* harmony export */ "yW": function() { return /* binding */ dateTimestampInSeconds; },
200
- /* harmony export */ "ph": function() { return /* binding */ timestampInSeconds; }
199
+ /* harmony export */ "ph": function() { return /* binding */ timestampInSeconds; },
200
+ /* harmony export */ "yW": function() { return /* binding */ dateTimestampInSeconds; }
201
201
  /* harmony export */ });
202
202
  /* unused harmony exports timestampWithMs, usingPerformanceAPI, _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin */
203
203
  /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2991);
@@ -14551,29 +14551,6 @@ var BrowserClient = /** @class */ (function (_super) {
14551
14551
  }(BaseClient));
14552
14552
 
14553
14553
  //# sourceMappingURL=client.js.map
14554
- ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/sdk.js
14555
-
14556
-
14557
- /**
14558
- * Internal function to create a new SDK client instance. The client is
14559
- * installed and then bound to the current scope.
14560
- *
14561
- * @param clientClass The client class to instantiate.
14562
- * @param options Options to pass to the client.
14563
- */
14564
- function initAndBind(clientClass, options) {
14565
- if (options.debug === true) {
14566
- logger_logger.enable();
14567
- }
14568
- var hub = getCurrentHub();
14569
- var scope = hub.getScope();
14570
- if (scope) {
14571
- scope.update(options.initialScope);
14572
- }
14573
- var client = new clientClass(options);
14574
- hub.bindClient(client);
14575
- }
14576
- //# sourceMappingURL=sdk.js.map
14577
14554
  ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/integrations/inboundfilters.js
14578
14555
 
14579
14556
 
@@ -14795,6 +14772,29 @@ var FunctionToString = /** @class */ (function () {
14795
14772
  }());
14796
14773
 
14797
14774
  //# sourceMappingURL=functiontostring.js.map
14775
+ ;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/sdk.js
14776
+
14777
+
14778
+ /**
14779
+ * Internal function to create a new SDK client instance. The client is
14780
+ * installed and then bound to the current scope.
14781
+ *
14782
+ * @param clientClass The client class to instantiate.
14783
+ * @param options Options to pass to the client.
14784
+ */
14785
+ function initAndBind(clientClass, options) {
14786
+ if (options.debug === true) {
14787
+ logger_logger.enable();
14788
+ }
14789
+ var hub = getCurrentHub();
14790
+ var scope = hub.getScope();
14791
+ if (scope) {
14792
+ scope.update(options.initialScope);
14793
+ }
14794
+ var client = new clientClass(options);
14795
+ hub.bindClient(client);
14796
+ }
14797
+ //# sourceMappingURL=sdk.js.map
14798
14798
  ;// CONCATENATED MODULE: ./node_modules/@sentry/browser/esm/integrations/trycatch.js
14799
14799
 
14800
14800
 
@@ -15811,7 +15811,7 @@ const client = new error_tracker_BrowserClient({
15811
15811
  },
15812
15812
 
15813
15813
  environment: "production",
15814
- release: "1.4.2-7dfe147",
15814
+ release: "1.4.5-be55d58",
15815
15815
  sampleRate: 0.25,
15816
15816
  autoSessionTracking: false,
15817
15817
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16384,15 +16384,15 @@ function httpRequest(obj) {
16384
16384
  const isProduction = "production" === "production";
16385
16385
  ;// CONCATENATED MODULE: ./src/common/helpers/url/constants.ts
16386
16386
  const ports = {
16387
- "localhost": {
16388
- "api": 8000,
16389
- "chat": 8002,
16390
- "default": 9001
16387
+ localhost: {
16388
+ api: 8000,
16389
+ chat: 8002,
16390
+ default: 9001
16391
16391
  },
16392
- "e2ereference": {
16393
- "api": 8000,
16394
- "chat": 8002,
16395
- "default": 9001
16392
+ e2ereference: {
16393
+ api: 8000,
16394
+ chat: 8002,
16395
+ default: 9001
16396
16396
  }
16397
16397
  };
16398
16398
  ;// CONCATENATED MODULE: ./src/common/helpers/url/index.ts
@@ -16432,7 +16432,7 @@ function getEmbedURL(_ref) {
16432
16432
  host = "http://".concat(window.location.hostname, ":9001");
16433
16433
  }
16434
16434
 
16435
- return "".concat(host, "/embed/").concat(frameName, "/").concat("7dfe147", "/index.html");
16435
+ return "".concat(host, "/embed/").concat(frameName, "/").concat("be55d58", "/index.html");
16436
16436
  }
16437
16437
 
16438
16438
  function constructQueryString(query) {
@@ -17613,8 +17613,8 @@ const popStateListener = dispatchEvent.bind(undefined, "locationchange");
17613
17613
  */
17614
17614
 
17615
17615
  function bindLocationChangeOverrides() {
17616
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17617
- window.history.pushState = (f => function pushState() {
17616
+ window.history.pushState = (f => // eslint-disable-next-line @typescript-eslint/no-explicit-any
17617
+ function pushState() {
17618
17618
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17619
17619
  args[_key] = arguments[_key];
17620
17620
  }
@@ -17623,10 +17623,10 @@ function bindLocationChangeOverrides() {
17623
17623
  dispatchEvent("pushstate");
17624
17624
  dispatchEvent("locationchange");
17625
17625
  return ret;
17626
- })(window.history.pushState); // eslint-disable-next-line @typescript-eslint/no-explicit-any
17627
-
17626
+ })(window.history.pushState);
17628
17627
 
17629
- window.history.replaceState = (f => function replaceState() {
17628
+ window.history.replaceState = (f => // eslint-disable-next-line @typescript-eslint/no-explicit-any
17629
+ function replaceState() {
17630
17630
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
17631
17631
  args[_key2] = arguments[_key2];
17632
17632
  }
@@ -18299,9 +18299,9 @@ async function log(message, extra, options) {
18299
18299
  service: "embed",
18300
18300
  env: "production",
18301
18301
  embedVersion: 2,
18302
- version: "1.4.2",
18302
+ version: "1.4.5",
18303
18303
  isNpm: true,
18304
- commitHash: "7dfe147"
18304
+ commitHash: "be55d58"
18305
18305
  }))
18306
18306
  });
18307
18307
  }
@@ -18529,7 +18529,7 @@ class ButtonFrame extends d {
18529
18529
  let styles = "\n position: fixed;\n bottom: ".concat(buttonPosition, "px;\n ").concat(getAlignment(adaSettings), ": ").concat(buttonPosition, "px;\n z-index: 10000;\n height: ").concat(buttonSizeWithBuffer, "px;\n width: ").concat(buttonSizeWithBuffer, "px;\n overflow: hidden;\n visibility: ").concat(this.isShown ? "visible" : "hidden", ";\n opacity: ").concat(this.isShown ? "1" : "0", ";\n transition: visibility 200ms ease, opacity 200ms ease;\n ");
18530
18530
 
18531
18531
  if (client.features.chat_ui_v2) {
18532
- styles += "\n transform: translate(0, 10%);\n transition: visibility 250ms ease, opacity 250ms ease, transform 250ms ease;\n ".concat(getAlignment(adaSettings), ": 0;\n bottom: 0;\n \n ").concat(this.isShown ? "transform: translate(0, 0);" : "", "\n ");
18532
+ styles += "\n transform: translate(0, 10%);\n transition: visibility 250ms ease, opacity 250ms ease, transform 250ms ease;\n ".concat(getAlignment(adaSettings), ": 0;\n bottom: 0;\n\n ").concat(this.isShown ? "transform: translate(0, 0);" : "", "\n ");
18533
18533
 
18534
18534
  if (buttonStyle === "text") {
18535
18535
  styles += "\n width: ".concat(frameWidth, "px;\n height: ").concat(textFrameHeight, "px;\n ");
@@ -18743,7 +18743,7 @@ class ChatFrame extends d {
18743
18743
  const hostPageUrlParams = new (url_default())(window.location.href).searchParams;
18744
18744
  const smsToken = hostPageUrlParams.get("adaSMSToken");
18745
18745
  const queryParams = {
18746
- embedVersion: "7dfe147".slice(0, 7),
18746
+ embedVersion: "be55d58".slice(0, 7),
18747
18747
  greeting,
18748
18748
  language,
18749
18749
  skipGreeting,
@@ -19001,7 +19001,7 @@ class ChatFrame extends d {
19001
19001
  clearTimeout(this.chatRenderTimeout);
19002
19002
  this.channel.isConnected = true;
19003
19003
  setConnectionState({
19004
- "chat": ConnectionState.Done
19004
+ chat: ConnectionState.Done
19005
19005
  });
19006
19006
  break;
19007
19007
  }
@@ -20924,7 +20924,7 @@ class Embed {
20924
20924
 
20925
20925
  }
20926
20926
 
20927
- _defineProperty(Embed, "embed2Version", "7dfe147");
20927
+ _defineProperty(Embed, "embed2Version", "be55d58");
20928
20928
  ;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
20929
20929
 
20930
20930
 
@@ -1,4 +1,4 @@
1
- declare type PersistenceKey = ("ada-embed_chat-manifest-cache" | "ada-embed_chat-assigned-version");
1
+ declare type PersistenceKey = "ada-embed_chat-manifest-cache" | "ada-embed_chat-assigned-version";
2
2
  export declare const persistence: {
3
3
  get: (item: PersistenceKey) => string;
4
4
  set: (item: PersistenceKey, value: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.4.2",
3
+ "version": "1.4.5",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",
@@ -107,13 +107,14 @@
107
107
  "preact": "10.4.5",
108
108
  "typescript": "^4.6.2",
109
109
  "uniqid": "^5.3.0",
110
- "webpack": "^5.67.0",
110
+ "webpack": "^5.74.0",
111
111
  "webpack-cli": "^4.9.2",
112
112
  "webpack-merge": "^5.8.0"
113
113
  },
114
114
  "resolutions": {
115
115
  "@lambdatest/node-tunnel": ">=3.0.2",
116
- "minimist": ">=1.2.6"
116
+ "minimist": ">=1.2.6",
117
+ "terser": ">=5.14.2"
117
118
  },
118
119
  "files": [
119
120
  "dist/npm-entry"