@meetelise/chat 1.12.12 → 1.12.15
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.
package/src/MEChat.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StyleInfo } from "lit/directives/style-map";
|
|
1
2
|
import { ThemeIdString } from "./themes";
|
|
2
3
|
import "./WebComponent/me-chat";
|
|
3
4
|
import { MEChat as MEChatLitElement } from "./WebComponent/me-chat";
|
|
@@ -32,6 +33,9 @@ export default class MEChat {
|
|
|
32
33
|
if (opts.mini !== undefined) {
|
|
33
34
|
meChat.useMiniWidget = opts.mini;
|
|
34
35
|
}
|
|
36
|
+
if (opts.launcherStyles) {
|
|
37
|
+
meChat.launcherStyles = opts.launcherStyles;
|
|
38
|
+
}
|
|
35
39
|
document.body.appendChild(meChat);
|
|
36
40
|
MEChat.meChat = meChat;
|
|
37
41
|
}
|
|
@@ -50,6 +54,7 @@ export interface Options {
|
|
|
50
54
|
themeId?: ThemeIdString;
|
|
51
55
|
avatarSrc?: string;
|
|
52
56
|
mini?: boolean;
|
|
57
|
+
launcherStyles?: StyleInfo;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
/** You can't install a font from CSS in a shadow DOM, so we use JS to do it here in the regular DOM. */
|
|
@@ -8,7 +8,7 @@ import { glowBarMp4, glowBarWebm } from "../assetUrls";
|
|
|
8
8
|
import { launcherStyles } from "./launcherStyles";
|
|
9
9
|
import { EmailUsWindow, installEmailUsWindow } from "./actions/email-us-window";
|
|
10
10
|
import { installTextUsWindow, TextUsWindow } from "./actions/text-us-window";
|
|
11
|
-
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
import { StyleInfo, styleMap } from "lit/directives/style-map.js";
|
|
12
12
|
import { classMap } from "lit/directives/class-map.js";
|
|
13
13
|
import { installCallUsWindow } from "./actions/call-us-window";
|
|
14
14
|
import { getRegisteredPhoneNumbers } from "../getRegisteredPhoneNumbers";
|
|
@@ -54,6 +54,8 @@ export class Launcher extends LitElement {
|
|
|
54
54
|
onChatTapped: () => void = () => {
|
|
55
55
|
return;
|
|
56
56
|
};
|
|
57
|
+
@property()
|
|
58
|
+
launcherStyles: StyleInfo = {};
|
|
57
59
|
|
|
58
60
|
@state()
|
|
59
61
|
isEmailWindowOpen = false;
|
|
@@ -244,7 +246,10 @@ export class Launcher extends LitElement {
|
|
|
244
246
|
|
|
245
247
|
renderMiniLauncher = (): TemplateResult => {
|
|
246
248
|
return html`
|
|
247
|
-
<div
|
|
249
|
+
<div
|
|
250
|
+
class="launcher__mini-launcher-wrapper"
|
|
251
|
+
style=${styleMap(this.launcherStyles)}
|
|
252
|
+
>
|
|
248
253
|
${this.isEmailWindowOpen
|
|
249
254
|
? html`<div class="launcher__window-wrapper">
|
|
250
255
|
<email-us-window
|
|
@@ -4,10 +4,9 @@ export const InputStyles = css`
|
|
|
4
4
|
.webchat-input {
|
|
5
5
|
border: 1px solid #83818e;
|
|
6
6
|
outline: none;
|
|
7
|
-
font-size: 14px;
|
|
8
7
|
color: #202020;
|
|
9
8
|
font-weight: 400;
|
|
10
|
-
font-size:
|
|
9
|
+
font-size: 16px;
|
|
11
10
|
line-height: 22px;
|
|
12
11
|
font-family: "Poppins";
|
|
13
12
|
padding-left: 12px;
|
|
@@ -25,6 +24,6 @@ export const InputStyles = css`
|
|
|
25
24
|
.webchat-input::placeholder {
|
|
26
25
|
color: #202020;
|
|
27
26
|
font-family: "Poppins";
|
|
28
|
-
font-size:
|
|
27
|
+
font-size: 16px;
|
|
29
28
|
}
|
|
30
29
|
`;
|
|
@@ -15,6 +15,7 @@ import { installLauncher } from "./Launcher";
|
|
|
15
15
|
|
|
16
16
|
import "./MEChat.css";
|
|
17
17
|
import { getRawAvailabilities } from "../getAvailabilities";
|
|
18
|
+
import { StyleInfo } from "lit/directives/style-map";
|
|
18
19
|
|
|
19
20
|
export interface Options {
|
|
20
21
|
building: string;
|
|
@@ -62,6 +63,8 @@ export class MEChat extends LitElement {
|
|
|
62
63
|
private avatarSrc?: string | null;
|
|
63
64
|
@property({ type: Boolean })
|
|
64
65
|
useMiniWidget = true;
|
|
66
|
+
@property()
|
|
67
|
+
launcherStyles: StyleInfo = {};
|
|
65
68
|
|
|
66
69
|
@state()
|
|
67
70
|
private popup: Talk.Popup | null = null;
|
|
@@ -100,6 +103,11 @@ export class MEChat extends LitElement {
|
|
|
100
103
|
this.chatId = getChatID(this.orgSlug, this.buildingSlug);
|
|
101
104
|
this.avatarSrc = this.avatarSrc || this.building.avatarSrc;
|
|
102
105
|
this.theme = getTheme(this.themeId ?? this.building.themeId);
|
|
106
|
+
this.analytics = new Analytics(
|
|
107
|
+
this.orgSlug,
|
|
108
|
+
this.buildingSlug,
|
|
109
|
+
this.chatId
|
|
110
|
+
);
|
|
103
111
|
};
|
|
104
112
|
|
|
105
113
|
private initializeLaunchJS = async () => {
|
|
@@ -150,7 +158,6 @@ export class MEChat extends LitElement {
|
|
|
150
158
|
!this.analytics ||
|
|
151
159
|
!this.analytics.chatId ||
|
|
152
160
|
!this.building ||
|
|
153
|
-
!this.theme ||
|
|
154
161
|
!this.popup ||
|
|
155
162
|
!MEChat.session
|
|
156
163
|
) {
|
|
@@ -277,6 +284,7 @@ export class MEChat extends LitElement {
|
|
|
277
284
|
.buildingId=${this.building?.id ?? 0}
|
|
278
285
|
.layoutOptions=${this.building?.layoutOptions ?? []}
|
|
279
286
|
.tourTypeOptions=${this.building?.tourTypeOptions ?? []}
|
|
287
|
+
.launcherStyles=${this.launcherStyles}
|
|
280
288
|
phoneNumber="${this.building?.phoneNumber ?? ""}"
|
|
281
289
|
textColor="${this.theme.chatHeader.textColor}"
|
|
282
290
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|