@ada-support/embed2 1.0.15 → 1.0.16

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.
@@ -9144,7 +9144,7 @@ function getEmbedURL(_ref) {
9144
9144
  polyfillVersionString = "legacy";
9145
9145
  }
9146
9146
 
9147
- return "".concat(host, "/embed/").concat(polyfillVersionString, "/").concat(frameName, "/").concat("fa2520f", "/index.html");
9147
+ return "".concat(host, "/embed/").concat(polyfillVersionString, "/").concat(frameName, "/").concat("dcb5407", "/index.html");
9148
9148
  }
9149
9149
  /**
9150
9150
  * Generate the Chat / API URL
@@ -11203,7 +11203,8 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11203
11203
  (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "channel", void 0);
11204
11204
 
11205
11205
  (0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "state", {
11206
- isMounted: false
11206
+ isMounted: false,
11207
+ closeTransitionTime: 200
11207
11208
  });
11208
11209
 
11209
11210
  return _this;
@@ -11311,7 +11312,9 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11311
11312
  return "";
11312
11313
  }
11313
11314
 
11314
- var isMounted = this.state.isMounted;
11315
+ var _this$state = this.state,
11316
+ isMounted = _this$state.isMounted,
11317
+ closeTransitionTime = _this$state.closeTransitionTime;
11315
11318
  var isShown = isDrawerOpen && isMounted;
11316
11319
  var backgroundColor = this.darkMode ? "#121212" : "#fff";
11317
11320
  var borderRadius = (client === null || client === void 0 ? void 0 : (_client$ui_settings2 = client.ui_settings) === null || _client$ui_settings2 === void 0 ? void 0 : _client$ui_settings2.chat.style) === "rectangular" ? "8px" : "16px";
@@ -11321,7 +11324,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11321
11324
  var totalWindowHeight = isTestBot ? "".concat(WINDOW_HEIGHT + TEST_BOT_NAV_HEIGHT, "px") : "".concat(WINDOW_HEIGHT, "px");
11322
11325
 
11323
11326
  if (client.features.chat_ui_v2) {
11324
- return "\n position: fixed;\n\n ".concat(isMobile ? "\n right: 0;\n bottom: 0;\n height: 100%;\n " : "\n height: 90%;\n right: 24px;\n bottom: 24px;\n max-width: 375px;\n max-height: ".concat(totalWindowHeight, ";\n border-radius: ").concat(borderRadius, ";\n "), "\n\n width: 100%;\n pointer-events: none; \n opacity: 0;\n transform: translate(0, 100px);\n transition: transform 200ms ease, opacity 200ms ease, visibility 0ms linear 200ms;\n box-shadow: 0px 12px 48px 4px rgba(0, 0, 0, 0.12);\n background-color: ").concat(backgroundColor, ";\n visibility: hidden;\n z-index: 10010;\n\n ").concat(isShown && "\n pointer-events: auto; \n opacity: 1;\n transform: translate(0, 0);\n transition: transform 300ms ease, opacity 300ms ease;\n visibility: visible;\n ", "\n ");
11327
+ return "\n position: fixed;\n\n ".concat(isMobile ? "\n right: 0;\n bottom: 0;\n height: 100%;\n " : "\n height: 90%;\n right: 24px;\n bottom: 24px;\n max-width: 375px;\n max-height: ".concat(totalWindowHeight, ";\n border-radius: ").concat(borderRadius, ";\n "), "\n\n width: 100%;\n pointer-events: none; \n opacity: 0;\n transform: translate(0, 100px);\n transition: transform ").concat(closeTransitionTime, "ms ease, opacity ").concat(closeTransitionTime, "ms ease, visibility 0ms linear ").concat(closeTransitionTime, "ms;\n box-shadow: 0px 12px 48px 4px rgba(0, 0, 0, 0.12);\n background-color: ").concat(backgroundColor, ";\n visibility: hidden;\n z-index: 10010;\n\n ").concat(isShown && "\n pointer-events: auto; \n opacity: 1;\n transform: translate(0, 0);\n transition: transform 300ms ease, opacity 300ms ease;\n visibility: visible;\n ", "\n ");
11325
11328
  }
11326
11329
 
11327
11330
  return "\n position: fixed;\n right: 0;\n bottom: 0;\n transform: translate(".concat(isDrawerOpen && isMounted ? "0" : "375px", ", 0);\n opacity: ").concat(isDrawerOpen && isMounted ? "1" : "0", ";\n transition: transform 200ms ease, opacity 200ms ease;\n z-index: 9999;\n box-shadow: -1px 0 0 rgba(0, 0, 0, .1), -3px 0 9px rgba(0, 0, 0, .15);\n background-color: #ffffff;\n width: 100%;\n max-width: ").concat(isMobile ? "none" : "375px", ";\n height: ").concat(isMobile ? "100%" : "100vh", ";\n min-height: ").concat(isMobile ? "100%" : "initial", ";\n max-height: -webkit-fill-available;\n max-height: -moz-available;\n max-height: stretch;\n ");
@@ -11377,6 +11380,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11377
11380
  var _this3 = this;
11378
11381
 
11379
11382
  var isDrawerOpen = this.props.isDrawerOpen;
11383
+ var closeTransitionTime = this.state.closeTransitionTime;
11380
11384
 
11381
11385
  if (!isMobile) {
11382
11386
  return;
@@ -11390,7 +11394,18 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11390
11394
  };
11391
11395
  } else {
11392
11396
  this.unlockDocumentBodyFromScrolling();
11393
- this.iframeRef.current.ontransitionend = null;
11397
+
11398
+ this.iframeRef.current.ontransitionend = function () {
11399
+ /**
11400
+ * After the frame is done animating to close - hide the frame so it doesn't
11401
+ * overlap the parent sites content (especially important for iOS as it breaks)
11402
+ * scrolling
11403
+ */
11404
+ setTimeout(function () {
11405
+ _this3.iframeRef.current.style.width = 0;
11406
+ _this3.iframeRef.current.style.height = 0;
11407
+ }, closeTransitionTime);
11408
+ };
11394
11409
  }
11395
11410
  }
11396
11411
  /**
@@ -13562,7 +13577,7 @@ window.__AdaEmbedConstructor = Embed;
13562
13577
 
13563
13578
  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);
13564
13579
  var isProduction = "production" === "production";
13565
- var embed2Version = "fa2520f";
13580
+ var embed2Version = "dcb5407";
13566
13581
 
13567
13582
  /***/ }),
13568
13583
 
@@ -21171,7 +21186,7 @@ function _loadEmbed() {
21171
21186
  polyfillVersionString = "legacy";
21172
21187
  }
21173
21188
 
21174
- embedScriptSource = "".concat(host, "/embed/").concat(polyfillVersionString, "/client/").concat("fa2520f", "/index.js");
21189
+ embedScriptSource = "".concat(host, "/embed/").concat(polyfillVersionString, "/client/").concat("dcb5407", "/index.js");
21175
21190
  }
21176
21191
 
21177
21192
  clientScriptExists = Boolean( true || // The client script is bundled with npm module
@@ -21298,10 +21313,10 @@ function createEmbedObject() {
21298
21313
  handle: adaSettings.handle,
21299
21314
  embedVersion: 2,
21300
21315
  embedSettings: adaSettings,
21301
- version: "1.0.15",
21316
+ version: "1.0.16",
21302
21317
  isNpm: true,
21303
21318
  hostPage: window.location.href,
21304
- commitHash: "fa2520f"
21319
+ commitHash: "dcb5407"
21305
21320
  }, {
21306
21321
  sampleRate: 0.01 // 1% of logs will go through
21307
21322
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index.d.ts",