@ada-support/embed2 1.6.37 → 1.6.44

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,7 +14,6 @@ export interface CurrentIntro {
14
14
  delay: number;
15
15
  }
16
16
  export interface Features {
17
- chat_ui_v2?: boolean;
18
17
  disable_embed_notification_status?: boolean;
19
18
  ui_customization?: boolean;
20
19
  developer_proactive?: boolean;
@@ -13260,7 +13260,7 @@ const client = new error_tracker_BrowserClient({
13260
13260
  return event;
13261
13261
  },
13262
13262
  environment: "production",
13263
- release: "1.6.37-7120077",
13263
+ release: "1.6.44-47c4d77",
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}/${"7120077"}/index.html`;
13835
+ return `${host}/embed/${frameName}/${"47c4d77"}/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.37",
15306
+ version: "1.6.44",
15308
15307
  isNpm: true,
15309
- commitHash: "7120077"
15308
+ commitHash: "47c4d77"
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;
@@ -15675,17 +15670,16 @@ class ButtonFrame extends d {
15675
15670
  const {
15676
15671
  client
15677
15672
  } = this.props;
15678
- const roleDescription = () => {
15673
+ const getTitle = () => {
15679
15674
  if (!(client !== null && client !== void 0 && client.handle)) {
15680
- return "Chat Button";
15675
+ return "Chat Button Frame";
15681
15676
  }
15682
- return `${client.handle.charAt(0).toUpperCase() + client.handle.slice(1)} Chat Button`;
15677
+ return `${client.handle.charAt(0).toUpperCase() + client.handle.slice(1)} Chat Button Frame`;
15683
15678
  };
15684
15679
  return v(StoreContext.Consumer, null, store => v(MessageServiceContext.Consumer, null, messageService => v(components_IFrame, {
15685
- title: "Chat with bot",
15680
+ title: getTitle(),
15686
15681
  styles: this.styles,
15687
15682
  name: BUTTON_IFRAME,
15688
- roleDescription: roleDescription(),
15689
15683
  store: store,
15690
15684
  messageService: messageService,
15691
15685
  onTransitionEnd: this.handleOnTransitionEndBound
@@ -15835,7 +15829,7 @@ class ChatFrame extends d {
15835
15829
  const hostPageUrlParams = new URL(window.location.href).searchParams;
15836
15830
  const smsToken = hostPageUrlParams.get("adaSMSToken");
15837
15831
  const queryParams = {
15838
- embedVersion: "7120077".slice(0, 7),
15832
+ embedVersion: "47c4d77".slice(0, 7),
15839
15833
  greeting,
15840
15834
  language,
15841
15835
  skipGreeting,
@@ -15878,8 +15872,7 @@ class ChatFrame extends d {
15878
15872
  const TEST_BOT_NAV_HEIGHT = 48;
15879
15873
  const isTestBot = client.features.embed_test_bot && testMode;
15880
15874
  const totalWindowHeight = isTestBot ? `${WINDOW_HEIGHT + TEST_BOT_NAV_HEIGHT}px` : `${WINDOW_HEIGHT}px`;
15881
- if (client.features.chat_ui_v2) {
15882
- return `
15875
+ return `
15883
15876
  position: fixed;
15884
15877
 
15885
15878
  ${isMobile ? `
@@ -15912,25 +15905,6 @@ class ChatFrame extends d {
15912
15905
  visibility: visible;
15913
15906
  `}
15914
15907
  `;
15915
- }
15916
- return `
15917
- position: fixed;
15918
- ${getAlignment(adaSettings)}: 0;
15919
- bottom: 0;
15920
- transform: translate(${isDrawerOpen && isMounted ? "0" : "375px"}, 0);
15921
- opacity: ${isDrawerOpen && isMounted ? "1" : "0"};
15922
- transition: transform 200ms ease, opacity 200ms ease;
15923
- z-index: 9999;
15924
- box-shadow: -1px 0 0 rgba(0, 0, 0, .1), -3px 0 9px rgba(0, 0, 0, .15);
15925
- background-color: #ffffff;
15926
- width: 100%;
15927
- max-width: ${isMobile ? "none" : "375px"};
15928
- height: ${isMobile ? "100%" : "100vh"};
15929
- min-height: ${isMobile ? "100%" : "initial"};
15930
- max-height: -webkit-fill-available;
15931
- max-height: -moz-available;
15932
- max-height: stretch;
15933
- `;
15934
15908
  }
15935
15909
  get hasVisibleProactiveMessages() {
15936
15910
  const {
@@ -15992,17 +15966,13 @@ class ChatFrame extends d {
15992
15966
  opacity: 0;
15993
15967
  transform: translate(375px, 0);
15994
15968
  visibility: hidden;
15969
+ transform: translate(0, 100px);
15995
15970
 
15996
15971
  ${isMobile ? `
15997
15972
  height: 0;
15998
15973
  ` : `
15999
15974
  height: 90%;
16000
15975
  `}
16001
-
16002
- ${client.features.chat_ui_v2 && `
16003
- transform: translate(0, 100px);
16004
- `}
16005
-
16006
15976
  ${!drawerHasBeenOpened && `
16007
15977
  transition: none;
16008
15978
  `}
@@ -16542,14 +16512,11 @@ class IntroFrame extends d {
16542
16512
  opacity: ${this.isShown ? "1" : "0"};
16543
16513
  height: ${introDimensions.height}px;
16544
16514
  width: ${introDimensions.width}px;
16545
-
16546
- ${Boolean(client.features.chat_ui_v2) && `
16547
- max-height: auto;
16548
- max-width: 350px;
16549
- z-index: 9999;
16550
- ${getAlignment(adaSettings)}: 0;
16551
- bottom: ${buttonSize - 20}px;
16552
- `}
16515
+ max-height: auto;
16516
+ max-width: 350px;
16517
+ z-index: 9999;
16518
+ ${getAlignment(adaSettings)}: 0;
16519
+ bottom: ${buttonSize - 20}px;
16553
16520
  `;
16554
16521
  if (!this.isShown) {
16555
16522
  return styles + stylesForHiding;
@@ -17410,11 +17377,6 @@ class Container extends d {
17410
17377
  return;
17411
17378
  }
17412
17379
  const newClient = new Client(clientResponse.client);
17413
- if (!newClient.features.chat_ui_v2) {
17414
- log("Clients on old UI", {
17415
- clientHandle: newClient.handle
17416
- });
17417
- }
17418
17380
  const baseApiUrl = getURL({
17419
17381
  name: "api",
17420
17382
  handle,
@@ -17588,7 +17550,6 @@ class Container extends d {
17588
17550
  }
17589
17551
  renderBackdrop() {
17590
17552
  const {
17591
- client,
17592
17553
  adaSettings,
17593
17554
  chatDimensions,
17594
17555
  isDrawerOpen,
@@ -17600,7 +17561,7 @@ class Container extends d {
17600
17561
 
17601
17562
  // checking for a non-empty parentElement here to
17602
17563
  // hide the backdrop in the SDKs
17603
- if (!(client !== null && client !== void 0 && client.features.chat_ui_v2) || parentElement) {
17564
+ if (parentElement) {
17604
17565
  return null;
17605
17566
  }
17606
17567
  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.37",
3
+ "version": "1.6.44",
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
  },