@ada-support/embed2 1.11.1 → 1.11.3

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.
@@ -46,6 +46,7 @@ export declare class ChatFrame extends Component<ChatFrameProps, ChatFrameState>
46
46
  documentBodyOverflow: string;
47
47
  channel?: FrameChannel;
48
48
  chatRenderTimeout?: number;
49
+ chatRenderTimeoutLater?: number;
49
50
  url: string;
50
51
  state: ChatFrameState;
51
52
  componentDidMount(): void;
@@ -15919,7 +15919,7 @@ const client = new BrowserClient({
15919
15919
  return event;
15920
15920
  },
15921
15921
  environment: "production",
15922
- release: "1.11.1-c291df9",
15922
+ release: "1.11.3-8cc0a0d",
15923
15923
  sampleRate: 0.25,
15924
15924
  autoSessionTracking: false,
15925
15925
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16464,9 +16464,9 @@ async function log(message, extra, options) {
16464
16464
  service: "embed",
16465
16465
  env: "production",
16466
16466
  embedVersion: 2,
16467
- version: "1.11.1",
16467
+ version: "1.11.3",
16468
16468
  isNpm: true,
16469
- commitHash: "c291df9"
16469
+ commitHash: "8cc0a0d"
16470
16470
  }))
16471
16471
  });
16472
16472
  }
@@ -16489,10 +16489,11 @@ function subscribeEvent(eventKey, callback) {
16489
16489
 
16490
16490
  // Log chat_frame_timeout event subscriptions
16491
16491
  if (eventKey === "ada:chat_frame_timeout") {
16492
+ var _document$getElementB;
16493
+ const domHandle = (_document$getElementB = document.getElementById("__ada")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.getAttribute("data-handle");
16492
16494
  log("Client subscribed to chat_frame_timeout event", {
16493
- handle: isStartOptions(window.adaSettings) ? window.adaSettings.handle : undefined,
16494
- hostPage: window.location.href,
16495
- timestamp: new Date().toISOString()
16495
+ handle: domHandle || (isStartOptions(window.adaSettings) ? window.adaSettings.handle : undefined),
16496
+ hostPage: window.location.href
16496
16497
  }, {
16497
16498
  sampleRate: 0.1,
16498
16499
  level: "info"
@@ -16568,7 +16569,7 @@ function getEmbedURL(_ref) {
16568
16569
  } else {
16569
16570
  host = `http://${handle}.localhost:9001`;
16570
16571
  }
16571
- return `${host}/embed/${frameName}/${"c291df9"}/index.html`;
16572
+ return `${host}/embed/${frameName}/${"8cc0a0d"}/index.html`;
16572
16573
  }
16573
16574
  function constructQueryString(query) {
16574
16575
  return Object.keys(query).map(key => {
@@ -18927,6 +18928,7 @@ class ChatFrame extends d {
18927
18928
  _defineProperty(this, "documentBodyOverflow", "");
18928
18929
  _defineProperty(this, "channel", void 0);
18929
18930
  _defineProperty(this, "chatRenderTimeout", void 0);
18931
+ _defineProperty(this, "chatRenderTimeoutLater", void 0);
18930
18932
  _defineProperty(this, "url", this.getIframeSrc());
18931
18933
  _defineProperty(this, "state", {
18932
18934
  isMounted: false,
@@ -18959,7 +18961,7 @@ class ChatFrame extends d {
18959
18961
  log("Chat frame mount", {
18960
18962
  handle,
18961
18963
  chatUrl: this.url,
18962
- embedVersion: "c291df9".slice(0, 7),
18964
+ embedVersion: "8cc0a0d".slice(0, 7),
18963
18965
  embedSettings: adaSettings
18964
18966
  });
18965
18967
 
@@ -19009,6 +19011,10 @@ class ChatFrame extends d {
19009
19011
  clearTimeout(this.chatRenderTimeout);
19010
19012
  this.chatRenderTimeout = undefined;
19011
19013
  }
19014
+ if (this.chatRenderTimeoutLater) {
19015
+ clearTimeout(this.chatRenderTimeoutLater);
19016
+ this.chatRenderTimeoutLater = undefined;
19017
+ }
19012
19018
  }
19013
19019
  get darkMode() {
19014
19020
  var _client$ui_settings, _client$ui_settings$c;
@@ -19043,7 +19049,7 @@ class ChatFrame extends d {
19043
19049
  const hostPageUrlParams = new URL(window.location.href).searchParams;
19044
19050
  const smsToken = hostPageUrlParams.get("adaSMSToken");
19045
19051
  const queryParams = {
19046
- embedVersion: "c291df9".slice(0, 7),
19052
+ embedVersion: "8cc0a0d".slice(0, 7),
19047
19053
  greeting,
19048
19054
  language,
19049
19055
  skipGreeting,
@@ -19645,15 +19651,6 @@ class ChatFrame extends d {
19645
19651
  this.clearFallbackTimeout();
19646
19652
  this.chatRenderTimeout = window.setTimeout(() => {
19647
19653
  var _this$channel;
19648
- log(`Chat frame took over ${CHAT_FALLBACK_DELAY_MS / 1000} seconds to respond`, {
19649
- handle,
19650
- chatUrl: this.url,
19651
- embedVersion: "c291df9".slice(0, 7),
19652
- embedSettings: adaSettings
19653
- }, {
19654
- level: "error",
19655
- sampleRate: 1.0
19656
- });
19657
19654
  const {
19658
19655
  isDrawerOpen: drawerIsOpen
19659
19656
  } = this.props;
@@ -19661,8 +19658,10 @@ class ChatFrame extends d {
19661
19658
  // Only show fallback if drawer is STILL open and chat hasn't connected
19662
19659
  if (!((_this$channel = this.channel) !== null && _this$channel !== void 0 && _this$channel.isConnected) && drawerIsOpen) {
19663
19660
  log("Chat frame took over 5 seconds to respond", {
19664
- handle,
19665
- embedSettings: adaSettings
19661
+ handle
19662
+ }, {
19663
+ level: "error",
19664
+ sampleRate: 1.0
19666
19665
  });
19667
19666
 
19668
19667
  // SUP-1141- TODO: Remove chatFrameTimeoutCallback
@@ -19677,6 +19676,23 @@ class ChatFrame extends d {
19677
19676
  }
19678
19677
  }
19679
19678
  }, CHAT_FALLBACK_DELAY_MS);
19679
+ this.chatRenderTimeoutLater = window.setTimeout(() => {
19680
+ var _this$channel2;
19681
+ const {
19682
+ isDrawerOpen: drawerIsOpen
19683
+ } = this.props;
19684
+
19685
+ // REMOVE: ONLY FOR LOGGING PURPOSES
19686
+ // Only show fallback if drawer is STILL open and chat hasn't connected - 10 second check
19687
+ if (!((_this$channel2 = this.channel) !== null && _this$channel2 !== void 0 && _this$channel2.isConnected) && drawerIsOpen) {
19688
+ log("Chat frame took over 10 seconds to respond", {
19689
+ handle
19690
+ }, {
19691
+ level: "error",
19692
+ sampleRate: 1.0
19693
+ });
19694
+ }
19695
+ }, CHAT_FALLBACK_DELAY_MS + 5000);
19680
19696
  }
19681
19697
  render() {
19682
19698
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",