@ada-support/embed2 1.0.51 → 1.0.52

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.
@@ -8514,7 +8514,7 @@ var client = new error_tracker_BrowserClient({
8514
8514
  return event;
8515
8515
  },
8516
8516
  environment: "production",
8517
- release: "1.0.51-8d041f3",
8517
+ release: "1.0.52-921d431",
8518
8518
  sampleRate: 0.25,
8519
8519
  autoSessionTracking: false,
8520
8520
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -9213,7 +9213,7 @@ function getEmbedURL(_ref) {
9213
9213
  polyfillVersionString = "legacy";
9214
9214
  }
9215
9215
 
9216
- return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "8d041f3", "/index.html");
9216
+ return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "921d431", "/index.html");
9217
9217
  }
9218
9218
  /**
9219
9219
  * Generate the Chat / API URL
@@ -11391,6 +11391,7 @@ function ChatFrame_isNativeReflectConstruct() { if (typeof Reflect === "undefine
11391
11391
 
11392
11392
 
11393
11393
 
11394
+ var documentBodyStyle = window.document.body.style;
11394
11395
 
11395
11396
  var ChatFrame = /*#__PURE__*/function (_Component) {
11396
11397
  (0,inherits/* default */.Z)(ChatFrame, _Component);
@@ -11412,19 +11413,19 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11412
11413
 
11413
11414
  (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "iframeRef", y());
11414
11415
 
11415
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "pageYOffset", 0);
11416
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "pageYOffset", window.pageYOffset);
11416
11417
 
11417
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyOverflow", "");
11418
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyOverflow", documentBodyStyle.overflow);
11418
11419
 
11419
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyPosition", "");
11420
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyPosition", documentBodyStyle.position);
11420
11421
 
11421
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyTop", "");
11422
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyTop", documentBodyStyle.top);
11422
11423
 
11423
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyBottom", "");
11424
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyBottom", documentBodyStyle.bottom);
11424
11425
 
11425
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyLeft", "");
11426
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyLeft", documentBodyStyle.left);
11426
11427
 
11427
- (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyRight", "");
11428
+ (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "documentBodyRight", documentBodyStyle.right);
11428
11429
 
11429
11430
  (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "url", _this.getURL);
11430
11431
 
@@ -11638,11 +11639,18 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11638
11639
  value: function handleScrollLock() {
11639
11640
  var _this3 = this;
11640
11641
 
11641
- var isDrawerOpen = this.props.isDrawerOpen;
11642
- var closeTransitionTime = this.state.closeTransitionTime;
11642
+ var _this$props7 = this.props,
11643
+ isDrawerOpen = _this$props7.isDrawerOpen,
11644
+ parentElement = _this$props7.parentElement;
11645
+ var closeTransitionTime = this.state.closeTransitionTime; // Lock scroll only on mobile
11643
11646
 
11644
11647
  if (!isMobile) {
11645
11648
  return;
11649
+ } // And if parentElement is not used
11650
+
11651
+
11652
+ if (parentElement) {
11653
+ return;
11646
11654
  }
11647
11655
 
11648
11656
  if (isDrawerOpen) {
@@ -11675,7 +11683,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11675
11683
  }, {
11676
11684
  key: "lockDocumentBodyFromScrolling",
11677
11685
  value: function lockDocumentBodyFromScrolling() {
11678
- // save current page position so we can scroll back there
11686
+ // Save current page position so we can scroll back there
11679
11687
  this.pageYOffset = window.pageYOffset;
11680
11688
  this.documentBodyOverflow = window.document.body.style.overflow;
11681
11689
  this.documentBodyPosition = window.document.body.style.position;
@@ -11723,9 +11731,9 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11723
11731
  var title = payload.title,
11724
11732
  body = payload.body,
11725
11733
  icon = payload.icon;
11726
- var _this$props7 = this.props,
11727
- isDrawerOpen = _this$props7.isDrawerOpen,
11728
- parentElement = _this$props7.parentElement;
11734
+ var _this$props8 = this.props,
11735
+ isDrawerOpen = _this$props8.isDrawerOpen,
11736
+ parentElement = _this$props8.parentElement;
11729
11737
  var isChatOpen = isDrawerOpen || Boolean(parentElement);
11730
11738
  var onClickHandler = this.notificationOnClickHandler.bind(this, isChatOpen);
11731
11739
  createNotification(title, isChatOpen, onClickHandler, {
@@ -11739,13 +11747,13 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11739
11747
  var _handleChatEvent = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee(type, payload, id) {
11740
11748
  var _this4 = this;
11741
11749
 
11742
- var _this$props8, adaSettings, setState, setConnectionState, _ref, eventKey, data, _ref2, analytics, analyticsCallback, client, _ref3, chatter, created, chatterTokenCallback, _client, _ref4, zdSessionId, zdPreviousTags, storage, _client2, _ref5, inLiveChat, eventCallbacks, customJavascriptEvent, specificCallback, genericCallback, resetChat, zdChatterAuthCallback, conversationEndCallback;
11750
+ var _this$props9, adaSettings, setState, setConnectionState, _ref, eventKey, data, _ref2, analytics, analyticsCallback, client, _ref3, chatter, created, chatterTokenCallback, _client, _ref4, zdSessionId, zdPreviousTags, storage, _client2, _ref5, inLiveChat, eventCallbacks, customJavascriptEvent, specificCallback, genericCallback, resetChat, zdChatterAuthCallback, conversationEndCallback;
11743
11751
 
11744
11752
  return regenerator_default().wrap(function _callee$(_context22) {
11745
11753
  while (1) {
11746
11754
  switch (_context22.prev = _context22.next) {
11747
11755
  case 0:
11748
- _this$props8 = this.props, adaSettings = _this$props8.adaSettings, setState = _this$props8.setState, setConnectionState = _this$props8.setConnectionState;
11756
+ _this$props9 = this.props, adaSettings = _this$props9.adaSettings, setState = _this$props9.setState, setConnectionState = _this$props9.setConnectionState;
11749
11757
  _context22.t0 = type;
11750
11758
  _context22.next = _context22.t0 === GET_WINDOW_ORIGIN ? 4 : _context22.t0 === CHAT_STARTED ? 8 : _context22.t0 === CHAT_WEBSOCKET_CONNECTED ? 13 : _context22.t0 === PUBLISH_EVENT ? 15 : _context22.t0 === ANALYTICS_EVENT ? 18 : _context22.t0 === CHATTER_EVENT ? 22 : _context22.t0 === "ZD_SESSION" ? 32 : _context22.t0 === CHATTER_LIVECHAT_EVENT ? 41 : _context22.t0 === CUSTOM_JAVASCRIPT_EVENT ? 49 : _context22.t0 === RESET_FROM_CHAT_EVENT ? 58 : _context22.t0 === ZD_JWT_AUTH_EVENT ? 61 : _context22.t0 === CREATE_NOTIFICATION_EVENT ? 79 : _context22.t0 === BROWSER_HAS_NOTIFICATIONS_EVENT ? 81 : _context22.t0 === REQUEST_NOTIFICATIONS_EVENT ? 85 : _context22.t0 === END_CONVERSATION_EVENT ? 87 : 90;
11751
11759
  break;
@@ -12048,9 +12056,9 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
12048
12056
  value: function bindChatEventHandlers() {
12049
12057
  var _this5 = this;
12050
12058
 
12051
- var _this$props9 = this.props,
12052
- name = _this$props9.name,
12053
- messageService = _this$props9.messageService;
12059
+ var _this$props10 = this.props,
12060
+ name = _this$props10.name,
12061
+ messageService = _this$props10.messageService;
12054
12062
  var channel = messageService.getChannel(name);
12055
12063
 
12056
12064
  if (!channel) {
@@ -12064,9 +12072,9 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
12064
12072
  }, {
12065
12073
  key: "render",
12066
12074
  value: function render() {
12067
- var _this$props10 = this.props,
12068
- name = _this$props10.name,
12069
- isDrawerOpen = _this$props10.isDrawerOpen;
12075
+ var _this$props11 = this.props,
12076
+ name = _this$props11.name,
12077
+ isDrawerOpen = _this$props11.isDrawerOpen;
12070
12078
  var iFrameName = "ada-".concat(name, "-frame");
12071
12079
  return v("iframe", {
12072
12080
  src: this.url,
@@ -14078,7 +14086,7 @@ window.__AdaEmbedConstructor = Embed;
14078
14086
  /* harmony export */ });
14079
14087
  var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(14|(1[5-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(92|(9[3-9]|\\d{3,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(14|(1[5-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(91|(9[2-9]|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(91|(9[2-9]|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
14080
14088
  var isProduction = "production" === "production";
14081
- var embed2Version = "8d041f3";
14089
+ var embed2Version = "921d431";
14082
14090
 
14083
14091
  /***/ }),
14084
14092
 
@@ -14411,9 +14419,9 @@ function _log() {
14411
14419
  service: "embed",
14412
14420
  env: "production",
14413
14421
  embedVersion: 2,
14414
- version: "1.0.51",
14422
+ version: "1.0.52",
14415
14423
  isNpm: true,
14416
- commitHash: "8d041f3"
14424
+ commitHash: "921d431"
14417
14425
  }))
14418
14426
  });
14419
14427
 
@@ -23888,7 +23896,7 @@ function _loadEmbed() {
23888
23896
  polyfillVersionString = "legacy";
23889
23897
  }
23890
23898
 
23891
- embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "8d041f3", "/index.js");
23899
+ embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "921d431", "/index.js");
23892
23900
  }
23893
23901
 
23894
23902
  clientScriptExists = Boolean( true || // The client script is bundled with npm module
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index.d.ts",