@meetelise/chat 1.20.80 → 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.
|
@@ -34,15 +34,6 @@ object-assign
|
|
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* @license
|
|
39
|
-
* Lodash <https://lodash.com/>
|
|
40
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
41
|
-
* Released under MIT license <https://lodash.com/license>
|
|
42
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
43
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
37
|
/** @license React v17.0.2
|
|
47
38
|
* react.production.min.js
|
|
48
39
|
*
|
|
@@ -22,7 +22,9 @@ import { TimePicker } from "./time-picker";
|
|
|
22
22
|
import { LabeledOption, UnitV2 } from "../../fetchBuildingInfo";
|
|
23
23
|
import { isMobile } from "../../utils";
|
|
24
24
|
import axios from "axios";
|
|
25
|
-
import
|
|
25
|
+
import isNumber from "lodash/isNumber";
|
|
26
|
+
import mapValues from "lodash/mapValues";
|
|
27
|
+
import isString from "lodash/isString";
|
|
26
28
|
import classnames from "classnames";
|
|
27
29
|
import parseISO from "date-fns/parseISO";
|
|
28
30
|
import compareAsc from "date-fns/compareAsc";
|
|
@@ -14,8 +14,12 @@ import {
|
|
|
14
14
|
fetchFeatureFlagShowMarketingSourceDropdown,
|
|
15
15
|
fetchFeatureFlagUsePhoneNumberBySource,
|
|
16
16
|
} from "../fetchFeatureFlag";
|
|
17
|
-
import fetchWebchatPreferences
|
|
18
|
-
|
|
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
|
-
|
|
206
|
-
|
|
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:
|
|
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;
|