@ada-support/embed2 1.6.20 → 1.6.22

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.
@@ -31,7 +31,7 @@ interface OwnProps {
31
31
  }
32
32
  interface PropsFromDispatch {
33
33
  setConnectionState: (payload: MessagePayload) => Promise<StoreState>;
34
- setState: (payload: Partial<StoreState>) => Promise<StoreState>;
34
+ setGlobalState: (payload: Partial<StoreState>) => Promise<StoreState>;
35
35
  toggleChat: () => Promise<StoreState>;
36
36
  }
37
37
  declare type ChatFrameProps = PropsFromState & OwnProps & PropsFromDispatch;
@@ -1,3 +1,3 @@
1
1
  import { h } from "preact";
2
- declare const _default: (ownProps: unknown) => h.JSX.Element;
2
+ declare const _default: (ownProps: {}) => h.JSX.Element;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import { h } from "preact";
2
- declare const _default: (ownProps: unknown) => h.JSX.Element;
2
+ declare const _default: (ownProps: {}) => h.JSX.Element;
3
3
  export default _default;
@@ -15917,7 +15917,7 @@ const client = new error_tracker_BrowserClient({
15917
15917
  },
15918
15918
 
15919
15919
  environment: "production",
15920
- release: "1.6.20-d3b11fe",
15920
+ release: "1.6.22-b080dd7",
15921
15921
  sampleRate: 0.25,
15922
15922
  autoSessionTracking: false,
15923
15923
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16547,7 +16547,7 @@ function getEmbedURL(_ref) {
16547
16547
  host = "http://".concat(window.location.hostname, ":9001");
16548
16548
  }
16549
16549
 
16550
- return "".concat(host, "/embed/").concat(frameName, "/").concat("d3b11fe", "/index.html");
16550
+ return "".concat(host, "/embed/").concat(frameName, "/").concat("b080dd7", "/index.html");
16551
16551
  }
16552
16552
 
16553
16553
  function constructQueryString(query) {
@@ -18199,9 +18199,9 @@ async function log(message, extra, options) {
18199
18199
  service: "embed",
18200
18200
  env: "production",
18201
18201
  embedVersion: 2,
18202
- version: "1.6.20",
18202
+ version: "1.6.22",
18203
18203
  isNpm: true,
18204
- commitHash: "d3b11fe"
18204
+ commitHash: "b080dd7"
18205
18205
  }))
18206
18206
  });
18207
18207
  }
@@ -18416,7 +18416,7 @@ class IFrame extends d {
18416
18416
  async connectFrame() {
18417
18417
  const {
18418
18418
  name,
18419
- setState,
18419
+ setGlobalState,
18420
18420
  setConnectionState
18421
18421
  } = this.props;
18422
18422
  this.channel = this.getChannel();
@@ -18438,7 +18438,7 @@ class IFrame extends d {
18438
18438
  */
18439
18439
 
18440
18440
  if (payload) {
18441
- await setState(payload);
18441
+ await setGlobalState(payload);
18442
18442
  }
18443
18443
 
18444
18444
  await setConnectionState({
@@ -18501,7 +18501,7 @@ function mapStateToProps(storeState) {
18501
18501
 
18502
18502
  function mapDispatchToProps(dispatch) {
18503
18503
  return {
18504
- setState: bindActionCreators(ActionCreators.SET_STATE_ACTION, dispatch),
18504
+ setGlobalState: bindActionCreators(ActionCreators.SET_STATE_ACTION, dispatch),
18505
18505
  setConnectionState: bindActionCreators(ActionCreators.SET_CONNECTION_STATE, dispatch)
18506
18506
  };
18507
18507
  }
@@ -18771,7 +18771,7 @@ class ChatFrame extends d {
18771
18771
  const hostPageUrlParams = new (url_default())(window.location.href).searchParams;
18772
18772
  const smsToken = hostPageUrlParams.get("adaSMSToken");
18773
18773
  const queryParams = {
18774
- embedVersion: "d3b11fe".slice(0, 7),
18774
+ embedVersion: "b080dd7".slice(0, 7),
18775
18775
  greeting,
18776
18776
  language,
18777
18777
  skipGreeting,
@@ -19005,7 +19005,7 @@ class ChatFrame extends d {
19005
19005
  async handleChatEvent(type, payload, id) {
19006
19006
  const {
19007
19007
  adaSettings,
19008
- setState,
19008
+ setGlobalState,
19009
19009
  setConnectionState
19010
19010
  } = this.props;
19011
19011
 
@@ -19036,7 +19036,7 @@ class ChatFrame extends d {
19036
19036
 
19037
19037
  case CHAT_WEBSOCKET_CONNECTED:
19038
19038
  {
19039
- setState({
19039
+ setGlobalState({
19040
19040
  isChatWebsocketConnected: true
19041
19041
  });
19042
19042
  break;
@@ -19092,7 +19092,7 @@ class ChatFrame extends d {
19092
19092
  chatterTokenCallback(chatter);
19093
19093
  }
19094
19094
 
19095
- await setState({
19095
+ await setGlobalState({
19096
19096
  chatterToken: chatter,
19097
19097
  chatterCreated: created,
19098
19098
  sessionToken
@@ -19114,7 +19114,7 @@ class ChatFrame extends d {
19114
19114
  throw new AdaEmbedError("`client` is undefined");
19115
19115
  }
19116
19116
 
19117
- await setState({
19117
+ await setGlobalState({
19118
19118
  zdSessionId
19119
19119
  });
19120
19120
 
@@ -19161,7 +19161,7 @@ class ChatFrame extends d {
19161
19161
  throw new AdaEmbedError("`client` is undefined");
19162
19162
  }
19163
19163
 
19164
- await setState({
19164
+ await setGlobalState({
19165
19165
  zdMessagingExternalUserId,
19166
19166
  zdMessagingChatterCreated
19167
19167
  });
@@ -19189,7 +19189,7 @@ class ChatFrame extends d {
19189
19189
  const {
19190
19190
  inLiveChat
19191
19191
  } = payload;
19192
- await setState({
19192
+ await setGlobalState({
19193
19193
  chatterInLiveChat: inLiveChat
19194
19194
  });
19195
19195
 
@@ -19439,7 +19439,7 @@ function ChatFrame_mapStateToProps(storeState) {
19439
19439
  function ChatFrame_mapDispatchToProps(dispatch) {
19440
19440
  return {
19441
19441
  setConnectionState: bindActionCreators(ActionCreators.SET_CONNECTION_STATE, dispatch),
19442
- setState: bindActionCreators(ActionCreators.SET_STATE_ACTION, dispatch),
19442
+ setGlobalState: bindActionCreators(ActionCreators.SET_STATE_ACTION, dispatch),
19443
19443
  toggleChat: bindActionCreators(ActionCreators.TOGGLE_CHAT_ACTION, dispatch)
19444
19444
  };
19445
19445
  }
@@ -19512,7 +19512,8 @@ function IntroFrame_mapStateToProps(storeState) {
19512
19512
  isDrawerOpen,
19513
19513
  adaSettings
19514
19514
  };
19515
- }
19515
+ } // eslint-disable-next-line @typescript-eslint/ban-types
19516
+
19516
19517
 
19517
19518
  /* harmony default export */ var components_IntroFrame = (connect(IntroFrame_mapStateToProps)(IntroFrame));
19518
19519
  ;// CONCATENATED MODULE: ./src/client/components/MaskFrame/index.tsx
@@ -19580,7 +19581,8 @@ function MaskFrame_mapStateToProps(storeState) {
19580
19581
  return {
19581
19582
  isDrawerOpen
19582
19583
  };
19583
- }
19584
+ } // eslint-disable-next-line @typescript-eslint/ban-types
19585
+
19584
19586
 
19585
19587
  /* harmony default export */ var components_MaskFrame = (connect(MaskFrame_mapStateToProps)(MaskFrame));
19586
19588
  ;// CONCATENATED MODULE: ./src/client/components/XStorageFrame/index.tsx
@@ -19685,12 +19687,12 @@ class Container extends d {
19685
19687
  async componentDidMount() {
19686
19688
  const {
19687
19689
  adaSettings,
19688
- setState
19690
+ setGlobalState
19689
19691
  } = this.props;
19690
19692
  const {
19691
19693
  onAdaEmbedLoaded
19692
19694
  } = adaSettings;
19693
- setState({
19695
+ setGlobalState({
19694
19696
  adaSettings
19695
19697
  }); // We want to make sure this happens before any publishEvent calls
19696
19698
  // This is why it happens even before calling initialize
@@ -19985,7 +19987,7 @@ class Container extends d {
19985
19987
  const {
19986
19988
  client,
19987
19989
  isDrawerOpen,
19988
- setState
19990
+ setGlobalState
19989
19991
  } = this.props;
19990
19992
  const {
19991
19993
  chatHasBeenRendered
@@ -20009,7 +20011,7 @@ class Container extends d {
20009
20011
 
20010
20012
 
20011
20013
  const followUpResponseId = campaign.follow_up_response_id ? campaign.follow_up_response_id : campaign.response_id;
20012
- setState({
20014
+ setGlobalState({
20013
20015
  latestCampaignKey: campaignKey,
20014
20016
  hasChatOpenedAfterProactiveMessagesShown: false,
20015
20017
  wasCampaignShownButNowClosed: false,
@@ -20057,7 +20059,7 @@ class Container extends d {
20057
20059
 
20058
20060
  async handleSettingDeviceToken(localChannel, payload, id) {
20059
20061
  const {
20060
- setState,
20062
+ setGlobalState,
20061
20063
  sensitiveMetaFields,
20062
20064
  metaFields
20063
20065
  } = this.props;
@@ -20067,7 +20069,7 @@ class Container extends d {
20067
20069
  const {
20068
20070
  token
20069
20071
  } = payload;
20070
- await setState({
20072
+ await setGlobalState({
20071
20073
  deviceToken: token,
20072
20074
  sensitiveMetaFields: Container_objectSpread(Container_objectSpread({}, sensitiveMetaFields), {}, {
20073
20075
  device_token: token,
@@ -20173,13 +20175,13 @@ class Container extends d {
20173
20175
  {
20174
20176
  const {
20175
20177
  metaFields,
20176
- setState
20178
+ setGlobalState
20177
20179
  } = this.props;
20178
20180
  const metaData = payload;
20179
20181
 
20180
20182
  const newMetaFields = Container_objectSpread(Container_objectSpread({}, metaFields), metaData);
20181
20183
 
20182
- await setState({
20184
+ await setGlobalState({
20183
20185
  metaFields: newMetaFields
20184
20186
  });
20185
20187
  localChannel.postMessage(SET_META_FIELDS_RESPONSE, null, id);
@@ -20190,9 +20192,9 @@ class Container extends d {
20190
20192
  {
20191
20193
  const {
20192
20194
  sensitiveMetaFields,
20193
- setState
20195
+ setGlobalState
20194
20196
  } = this.props;
20195
- await setState({
20197
+ await setGlobalState({
20196
20198
  sensitiveMetaFields: Container_objectSpread(Container_objectSpread({}, sensitiveMetaFields), payload)
20197
20199
  });
20198
20200
  localChannel.postMessage("SET_SENSITIVE_META_FIELDS_RESPONSE", null, id);
@@ -20216,7 +20218,7 @@ class Container extends d {
20216
20218
  resetChatHistory = true
20217
20219
  } = payload;
20218
20220
  const {
20219
- setState
20221
+ setGlobalState
20220
20222
  } = this.props;
20221
20223
  const {
20222
20224
  handle
@@ -20258,7 +20260,7 @@ class Container extends d {
20258
20260
  });
20259
20261
  }
20260
20262
 
20261
- await setState(newState);
20263
+ await setGlobalState(newState);
20262
20264
 
20263
20265
  if (chatHasBeenRendered) {
20264
20266
  this.setState({
@@ -20277,7 +20279,7 @@ class Container extends d {
20277
20279
  case DELETE_HISTORY:
20278
20280
  {
20279
20281
  const {
20280
- setState
20282
+ setGlobalState
20281
20283
  } = this.props;
20282
20284
 
20283
20285
  if (!xStorageChannel) {
@@ -20290,7 +20292,7 @@ class Container extends d {
20290
20292
  dist/* adaLocalStorage.removeItem */.wG.removeItem(CHATTER_CREATED_STORAGE_KEY);
20291
20293
  dist/* adaSessionStorage.removeItem */.Dp.removeItem(CHATTER_CREATED_STORAGE_KEY); // And from state
20292
20294
 
20293
- await setState({
20295
+ await setGlobalState({
20294
20296
  chatterToken: undefined,
20295
20297
  chatterCreated: undefined
20296
20298
  });
@@ -20316,7 +20318,7 @@ class Container extends d {
20316
20318
  hideIntroOverride: true
20317
20319
  }, async () => {
20318
20320
  const {
20319
- setState
20321
+ setGlobalState
20320
20322
  } = this.props;
20321
20323
  const newClient = new Client(Container_objectSpread(Container_objectSpread({}, client), {}, {
20322
20324
  intro: {
@@ -20328,7 +20330,7 @@ class Container extends d {
20328
20330
  response_id: ""
20329
20331
  }
20330
20332
  }));
20331
- await setState({
20333
+ await setGlobalState({
20332
20334
  client: newClient,
20333
20335
  isIntroShown: false
20334
20336
  });
@@ -20404,7 +20406,7 @@ class Container extends d {
20404
20406
  async initialize() {
20405
20407
  const {
20406
20408
  adaSettings,
20407
- setState
20409
+ setGlobalState
20408
20410
  } = this.props;
20409
20411
  const {
20410
20412
  handle,
@@ -20511,7 +20513,7 @@ class Container extends d {
20511
20513
  const chatterInLiveChat = retrieveStorage(IN_LIVE_CHAT_STORAGE_KEY, newClient, privateMode);
20512
20514
 
20513
20515
  try {
20514
- await setState(Container_objectSpread(Container_objectSpread({
20516
+ await setGlobalState(Container_objectSpread(Container_objectSpread({
20515
20517
  client: newClient,
20516
20518
  enabledLanguages: newClient.features.translations ? ["en"].concat(newClient.translated_languages) : ["en"],
20517
20519
  initialURL: window.location.href,
@@ -20558,10 +20560,10 @@ class Container extends d {
20558
20560
 
20559
20561
  notificationPermHandler() {
20560
20562
  const {
20561
- setState
20563
+ setGlobalState
20562
20564
  } = this.props;
20563
20565
  notificationPermListener(notificationStatus => {
20564
- setState({
20566
+ setGlobalState({
20565
20567
  notificationsPermission: notificationStatus
20566
20568
  });
20567
20569
  });
@@ -20752,7 +20754,7 @@ function Container_mapStateToProps(storeState) {
20752
20754
 
20753
20755
  function Container_mapDispatchToProps(dispatch) {
20754
20756
  return {
20755
- setState: bindActionCreators(ActionCreators.SET_STATE_ACTION, dispatch),
20757
+ setGlobalState: bindActionCreators(ActionCreators.SET_STATE_ACTION, dispatch),
20756
20758
  toggleChat: bindActionCreators(ActionCreators.TOGGLE_CHAT_ACTION, dispatch)
20757
20759
  };
20758
20760
  }
@@ -20987,8 +20989,8 @@ class Embed {
20987
20989
 
20988
20990
  }
20989
20991
 
20990
- _defineProperty(Embed, "embed2Version", "d3b11fe");
20991
- ;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
20992
+ _defineProperty(Embed, "embed2Version", "b080dd7");
20993
+ ;// CONCATENATED MODULE: ./src/interface.ts
20992
20994
 
20993
20995
 
20994
20996
 
@@ -20996,7 +20998,7 @@ _defineProperty(Embed, "embed2Version", "d3b11fe");
20996
20998
  * Returns the public Embed methods to be bound to the window object.
20997
20999
  */
20998
21000
 
20999
- function createEmbedObject() {
21001
+ function createEmbedInterface() {
21000
21002
  let embed = null;
21001
21003
  let startEmbedResolve;
21002
21004
  let startEmbed = null;
@@ -21185,7 +21187,7 @@ function createEmbedObject() {
21185
21187
  // We need "export default" for NPM module to be used as `import adaEmbed from "@ada-support/embed2";`
21186
21188
  // eslint-disable-next-line import/no-default-export
21187
21189
 
21188
- /* harmony default export */ var index_npm = (createEmbedObject());
21190
+ /* harmony default export */ var index_npm = (createEmbedInterface());
21189
21191
  }();
21190
21192
  module.exports = __webpack_exports__;
21191
21193
  /******/ })()
@@ -2,4 +2,4 @@ import type { AdaEmbedAPI } from "@ada-support/embed-types";
2
2
  /**
3
3
  * Returns the public Embed methods to be bound to the window object.
4
4
  */
5
- export declare function createEmbedObject(): AdaEmbedAPI;
5
+ export declare function createEmbedInterface(): AdaEmbedAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.6.20",
3
+ "version": "1.6.22",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",
@@ -45,7 +45,7 @@
45
45
  "author": "",
46
46
  "license": "ISC",
47
47
  "devDependencies": {
48
- "@ada-support/eslint-config-ada": "^1.2.1",
48
+ "@ada-support/eslint-config-ada": "^1.2.5",
49
49
  "@testing-library/preact": "^2.0.1",
50
50
  "@types/enzyme": "^3.10.11",
51
51
  "@types/jest": "^27.0.2",
@@ -96,7 +96,7 @@
96
96
  "@babel/preset-typescript": "^7.16.7",
97
97
  "@babel/runtime-corejs3": "^7.15.4",
98
98
  "@sentry/browser": "^6.17.1",
99
- "babel-loader": "^8.2.3",
99
+ "babel-loader": "8.3.0",
100
100
  "babel-preset-preact": "^2.0.0",
101
101
  "dotenv": "^8.2.0",
102
102
  "eslint-config-prettier": "^8.5.0",