@ada-support/embed2 1.6.40 → 1.6.46

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.
@@ -14,13 +14,9 @@ export interface CurrentIntro {
14
14
  delay: number;
15
15
  }
16
16
  export interface Features {
17
- chat_ui_v2?: boolean;
18
- disable_embed_notification_status?: boolean;
19
17
  ui_customization?: boolean;
20
- developer_proactive?: boolean;
21
18
  afm_business_events?: boolean;
22
19
  afm_proactive_messaging?: boolean;
23
- embed_test_bot?: boolean;
24
20
  translations?: boolean;
25
21
  chat_session_auth?: boolean;
26
22
  }
@@ -13260,7 +13260,7 @@ const client = new error_tracker_BrowserClient({
13260
13260
  return event;
13261
13261
  },
13262
13262
  environment: "production",
13263
- release: "1.6.40-eca8973",
13263
+ release: "1.6.46-bcb7d2d",
13264
13264
  sampleRate: 0.25,
13265
13265
  autoSessionTracking: false,
13266
13266
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -13832,7 +13832,7 @@ function getEmbedURL(_ref) {
13832
13832
  } else {
13833
13833
  host = `http://${window.location.hostname}:9001`;
13834
13834
  }
13835
- return `${host}/embed/${frameName}/${"eca8973"}/index.html`;
13835
+ return `${host}/embed/${frameName}/${"bcb7d2d"}/index.html`;
13836
13836
  }
13837
13837
  function constructQueryString(query) {
13838
13838
  return Object.keys(query).map(key => {
@@ -15093,8 +15093,7 @@ const RTLLanguages = ["ar", "he"];
15093
15093
  const isRTLLanguage = language => Boolean(language && RTLLanguages.includes(language)) || false;
15094
15094
  const isRTL = (client, language) => {
15095
15095
  const rtlLanguageBool = isRTLLanguage(language) || isRTLLanguage(getBrowserLanguage());
15096
- const featureFlagsBool = (client === null || client === void 0 ? void 0 : client.features.chat_ui_v2) && client.features.translations;
15097
- return featureFlagsBool && rtlLanguageBool || false;
15096
+ return (client === null || client === void 0 ? void 0 : client.features.translations) && rtlLanguageBool || false;
15098
15097
  };
15099
15098
  ;// CONCATENATED MODULE: ./src/common/helpers/getAlignment.ts
15100
15099
 
@@ -15304,9 +15303,9 @@ async function log(message, extra, options) {
15304
15303
  service: "embed",
15305
15304
  env: "production",
15306
15305
  embedVersion: 2,
15307
- version: "1.6.40",
15306
+ version: "1.6.46",
15308
15307
  isNpm: true,
15309
- commitHash: "eca8973"
15308
+ commitHash: "bcb7d2d"
15310
15309
  }))
15311
15310
  });
15312
15311
  }
@@ -15617,7 +15616,7 @@ class ButtonFrame extends d {
15617
15616
  delayedIsShown
15618
15617
  } = this.state;
15619
15618
  // 48 = (SHADOW BLUR=40) + (2 * SPREAD=8)
15620
- const BOX_SHADOW_BUFFER = client.features.chat_ui_v2 ? 48 : 8;
15619
+ const BOX_SHADOW_BUFFER = 48;
15621
15620
  const POSITION_FROM_SCREEN_EDGE = 24;
15622
15621
  const buttonSizeWithBuffer = buttonSize + BOX_SHADOW_BUFFER;
15623
15622
  const buttonPosition = POSITION_FROM_SCREEN_EDGE - BOX_SHADOW_BUFFER / 2;
@@ -15639,27 +15638,23 @@ class ButtonFrame extends d {
15639
15638
  visibility: ${this.isShown ? "visible" : "hidden"};
15640
15639
  opacity: ${this.isShown ? "1" : "0"};
15641
15640
  transition: visibility 200ms ease, opacity 200ms ease;
15641
+ transform: translate(0, 10%);
15642
+ transition: visibility 250ms ease, opacity 250ms ease, transform 250ms ease;
15643
+ ${getAlignment(adaSettings)}: 0;
15644
+ bottom: 0;
15645
+
15646
+ ${this.isShown ? "transform: translate(0, 0);" : ""}
15642
15647
  `;
15643
- if (client.features.chat_ui_v2) {
15648
+ if (buttonStyle === "text") {
15644
15649
  styles += `
15645
- transform: translate(0, 10%);
15646
- transition: visibility 250ms ease, opacity 250ms ease, transform 250ms ease;
15647
- ${getAlignment(adaSettings)}: 0;
15648
- bottom: 0;
15649
-
15650
- ${this.isShown ? "transform: translate(0, 0);" : ""}
15651
- `;
15652
- if (buttonStyle === "text") {
15653
- styles += `
15654
- width: ${frameWidth}px;
15655
- height: ${textFrameHeight}px;
15650
+ width: ${frameWidth}px;
15651
+ height: ${textFrameHeight}px;
15652
+ `;
15653
+ } else {
15654
+ styles += `
15655
+ width: ${roundFrameHeight}px;
15656
+ height: ${roundFrameHeight}px;
15656
15657
  `;
15657
- } else {
15658
- styles += `
15659
- width: ${roundFrameHeight}px;
15660
- height: ${roundFrameHeight}px;
15661
- `;
15662
- }
15663
15658
  }
15664
15659
  if (!this.isShown && !delayedIsShown) {
15665
15660
  return styles + stylesForHiding;
@@ -15834,7 +15829,7 @@ class ChatFrame extends d {
15834
15829
  const hostPageUrlParams = new URL(window.location.href).searchParams;
15835
15830
  const smsToken = hostPageUrlParams.get("adaSMSToken");
15836
15831
  const queryParams = {
15837
- embedVersion: "eca8973".slice(0, 7),
15832
+ embedVersion: "bcb7d2d".slice(0, 7),
15838
15833
  greeting,
15839
15834
  language,
15840
15835
  skipGreeting,
@@ -15875,10 +15870,8 @@ class ChatFrame extends d {
15875
15870
  const borderRadius = ((_client$ui_settings2 = client.ui_settings) === null || _client$ui_settings2 === void 0 ? void 0 : (_client$ui_settings2$ = _client$ui_settings2.chat) === null || _client$ui_settings2$ === void 0 ? void 0 : _client$ui_settings2$.style) === "rectangular" ? "8px" : "16px";
15876
15871
  const WINDOW_HEIGHT = 725;
15877
15872
  const TEST_BOT_NAV_HEIGHT = 48;
15878
- const isTestBot = client.features.embed_test_bot && testMode;
15879
- const totalWindowHeight = isTestBot ? `${WINDOW_HEIGHT + TEST_BOT_NAV_HEIGHT}px` : `${WINDOW_HEIGHT}px`;
15880
- if (client.features.chat_ui_v2) {
15881
- return `
15873
+ const totalWindowHeight = testMode ? `${WINDOW_HEIGHT + TEST_BOT_NAV_HEIGHT}px` : `${WINDOW_HEIGHT}px`;
15874
+ return `
15882
15875
  position: fixed;
15883
15876
 
15884
15877
  ${isMobile ? `
@@ -15911,25 +15904,6 @@ class ChatFrame extends d {
15911
15904
  visibility: visible;
15912
15905
  `}
15913
15906
  `;
15914
- }
15915
- return `
15916
- position: fixed;
15917
- ${getAlignment(adaSettings)}: 0;
15918
- bottom: 0;
15919
- transform: translate(${isDrawerOpen && isMounted ? "0" : "375px"}, 0);
15920
- opacity: ${isDrawerOpen && isMounted ? "1" : "0"};
15921
- transition: transform 200ms ease, opacity 200ms ease;
15922
- z-index: 9999;
15923
- box-shadow: -1px 0 0 rgba(0, 0, 0, .1), -3px 0 9px rgba(0, 0, 0, .15);
15924
- background-color: #ffffff;
15925
- width: 100%;
15926
- max-width: ${isMobile ? "none" : "375px"};
15927
- height: ${isMobile ? "100%" : "100vh"};
15928
- min-height: ${isMobile ? "100%" : "initial"};
15929
- max-height: -webkit-fill-available;
15930
- max-height: -moz-available;
15931
- max-height: stretch;
15932
- `;
15933
15907
  }
15934
15908
  get hasVisibleProactiveMessages() {
15935
15909
  const {
@@ -15991,17 +15965,13 @@ class ChatFrame extends d {
15991
15965
  opacity: 0;
15992
15966
  transform: translate(375px, 0);
15993
15967
  visibility: hidden;
15968
+ transform: translate(0, 100px);
15994
15969
 
15995
15970
  ${isMobile ? `
15996
15971
  height: 0;
15997
15972
  ` : `
15998
15973
  height: 90%;
15999
15974
  `}
16000
-
16001
- ${client.features.chat_ui_v2 && `
16002
- transform: translate(0, 100px);
16003
- `}
16004
-
16005
15975
  ${!drawerHasBeenOpened && `
16006
15976
  transition: none;
16007
15977
  `}
@@ -16541,14 +16511,11 @@ class IntroFrame extends d {
16541
16511
  opacity: ${this.isShown ? "1" : "0"};
16542
16512
  height: ${introDimensions.height}px;
16543
16513
  width: ${introDimensions.width}px;
16544
-
16545
- ${Boolean(client.features.chat_ui_v2) && `
16546
- max-height: auto;
16547
- max-width: 350px;
16548
- z-index: 9999;
16549
- ${getAlignment(adaSettings)}: 0;
16550
- bottom: ${buttonSize - 20}px;
16551
- `}
16514
+ max-height: auto;
16515
+ max-width: 350px;
16516
+ z-index: 9999;
16517
+ ${getAlignment(adaSettings)}: 0;
16518
+ bottom: ${buttonSize - 20}px;
16552
16519
  `;
16553
16520
  if (!this.isShown) {
16554
16521
  return styles + stylesForHiding;
@@ -17299,9 +17266,6 @@ class Container extends d {
17299
17266
  duration
17300
17267
  } = payload;
17301
17268
  const EXTRA_PROACTIVE_DELAY = 1000;
17302
-
17303
- // Do not feature flag gate this behind the developer_proactive flag
17304
- // It's also used for free-tier campaigns, which are available to all clients
17305
17269
  this.setState({
17306
17270
  hideIntroOverride: true
17307
17271
  }, async () => {
@@ -17409,11 +17373,6 @@ class Container extends d {
17409
17373
  return;
17410
17374
  }
17411
17375
  const newClient = new Client(clientResponse.client);
17412
- if (!newClient.features.chat_ui_v2) {
17413
- log("Clients on old UI", {
17414
- clientHandle: newClient.handle
17415
- });
17416
- }
17417
17376
  const baseApiUrl = getURL({
17418
17377
  name: "api",
17419
17378
  handle,
@@ -17587,7 +17546,6 @@ class Container extends d {
17587
17546
  }
17588
17547
  renderBackdrop() {
17589
17548
  const {
17590
- client,
17591
17549
  adaSettings,
17592
17550
  chatDimensions,
17593
17551
  isDrawerOpen,
@@ -17599,7 +17557,7 @@ class Container extends d {
17599
17557
 
17600
17558
  // checking for a non-empty parentElement here to
17601
17559
  // hide the backdrop in the SDKs
17602
- if (!(client !== null && client !== void 0 && client.features.chat_ui_v2) || parentElement) {
17560
+ if (parentElement) {
17603
17561
  return null;
17604
17562
  }
17605
17563
  const hasProactiveMessagesShown = Boolean(chatDimensions === null || chatDimensions === void 0 ? void 0 : chatDimensions.height);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.6.40",
3
+ "version": "1.6.46",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",
@@ -108,7 +108,7 @@
108
108
  "preact": "10.4.5",
109
109
  "typescript": "^4.6.2",
110
110
  "uniqid": "^5.3.0",
111
- "webpack": "^5.74.0",
111
+ "webpack": "^5.76.0",
112
112
  "webpack-cli": "^4.9.2",
113
113
  "webpack-merge": "^5.8.0"
114
114
  },