@meetelise/chat 1.20.81 → 1.20.82

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,8 +14,12 @@ import {
14
14
  fetchFeatureFlagShowMarketingSourceDropdown,
15
15
  fetchFeatureFlagUsePhoneNumberBySource,
16
16
  } from "../fetchFeatureFlag";
17
- import fetchWebchatPreferences from "../fetchWebchatPreferences";
18
- import fetchBuildingABTestType from "../fetchBuildingABTestType";
17
+ import fetchWebchatPreferences, {
18
+ DesignConcepts,
19
+ } from "../fetchWebchatPreferences";
20
+ import fetchBuildingABTestType, {
21
+ abTestTypes,
22
+ } from "../fetchBuildingABTestType";
19
23
  import fetchCurrentParsedLeadSource from "../fetchCurrentParsedLeadSource";
20
24
  import fetchPhoneNumberFromSource, {
21
25
  NumberForSelectedSource,
@@ -202,8 +206,17 @@ export class MEChat extends LitElement {
202
206
  if (this.brandColor === null) {
203
207
  this.brandColor = webchatPreferences.primaryColor ?? null;
204
208
  }
205
- if (this.buildingABTestType === null) {
206
- this.buildingABTestType = webchatPreferences.designConcept ?? null;
209
+ this.isMinimized = !!webchatPreferences.autoMinimize;
210
+ if (webchatPreferences.designConcept) {
211
+ if (webchatPreferences.designConcept === DesignConcepts.MINIMIZED) {
212
+ this.isMobile = true;
213
+ }
214
+ if (webchatPreferences.designConcept === DesignConcepts.PILLS) {
215
+ this.buildingABTestType = null; // default design concept is PILLS
216
+ }
217
+ if (webchatPreferences.designConcept === DesignConcepts.EMOJI) {
218
+ this.buildingABTestType = abTestTypes.ConceptEmoji;
219
+ }
207
220
  }
208
221
  }
209
222
 
@@ -2,8 +2,15 @@ import axios from "axios";
2
2
 
3
3
  export interface WebchatPreferences {
4
4
  primaryColor: string;
5
- designConcept: string;
5
+ designConcept: DesignConcepts;
6
6
  delayOpen: number;
7
+ autoMinimize: boolean;
8
+ }
9
+
10
+ export enum DesignConcepts {
11
+ EMOJI = "emoji",
12
+ PILLS = "pills",
13
+ MINIMIZED = "minimized", // this is also mobile
7
14
  }
8
15
 
9
16
  export default async function fetchWebchatPreferences(
@@ -19,6 +26,8 @@ export default async function fetchWebchatPreferences(
19
26
  primaryColor: webchatPreferencesResponse.data["primaryColor"],
20
27
  designConcept: webchatPreferencesResponse.data["designConcept"],
21
28
  delayOpen: +webchatPreferencesResponse.data["delayOpen"],
29
+ autoMinimize:
30
+ webchatPreferencesResponse.data["autoMinimize"] === "true",
22
31
  };
23
32
  }
24
33
  return null;