@meetelise/chat 1.12.5 → 1.12.8
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/package.json +5 -5
- package/public/dist/index.js +84 -78
- package/src/MEChat.ts +1 -1
- package/src/WebComponent/{InHouseLauncher.ts → Launcher.ts} +38 -40
- package/src/WebComponent/MEChat.css +1 -1
- package/src/WebComponent/Scheduler/tour-scheduler.ts +12 -3
- package/src/WebComponent/actions/{ActionConfirmButton.ts → action-confirm-button.ts} +0 -0
- package/src/WebComponent/actions/{CallUsWindow.ts → call-us-window.ts} +0 -0
- package/src/WebComponent/actions/{DetailsWindow.ts → details-window.ts} +0 -0
- package/src/WebComponent/actions/{EmailUsWindow.ts → email-us-window.ts} +2 -2
- package/src/WebComponent/actions/{TextUsWindow.ts → text-us-window.ts} +2 -2
- package/src/WebComponent/index.ts +2 -2
- package/src/WebComponent/{inHouseLauncherStyles.ts → launcherStyles.ts} +41 -35
- package/src/WebComponent/{MEChat.ts → me-chat.ts} +19 -19
|
@@ -3,7 +3,7 @@ import { customElement, property, state } from "lit/decorators.js";
|
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
4
|
import { createRef, ref, Ref } from "lit/directives/ref.js";
|
|
5
5
|
import Talk from "talkjs";
|
|
6
|
-
import {
|
|
6
|
+
import { Launcher } from ".";
|
|
7
7
|
import "./Scheduler/tour-scheduler";
|
|
8
8
|
import Analytics from "../analytics";
|
|
9
9
|
import { getChatID } from "../chatID";
|
|
@@ -11,7 +11,7 @@ import createConversation from "../createConversation";
|
|
|
11
11
|
import fetchBuildingInfo, { Building } from "../fetchBuildingInfo";
|
|
12
12
|
import { getTheme, Theme, ThemeIdString } from "../themes";
|
|
13
13
|
import { isMobile } from "../utils";
|
|
14
|
-
import {
|
|
14
|
+
import { installLauncher } from "./Launcher";
|
|
15
15
|
|
|
16
16
|
import "./MEChat.css";
|
|
17
17
|
import { getRawAvailabilities } from "../getAvailabilities";
|
|
@@ -35,7 +35,7 @@ export class MEChat extends LitElement {
|
|
|
35
35
|
display: none;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
38
|
+
.launcherContainer.launcher__mobile {
|
|
39
39
|
width: 100%;
|
|
40
40
|
height: 100px;
|
|
41
41
|
}
|
|
@@ -83,12 +83,12 @@ export class MEChat extends LitElement {
|
|
|
83
83
|
private hideLauncher = false;
|
|
84
84
|
|
|
85
85
|
private yardiDNIScriptInterval: NodeJS.Timer | null = null;
|
|
86
|
-
|
|
86
|
+
launcherRef: Ref<Launcher> = createRef();
|
|
87
87
|
|
|
88
88
|
initializeInstanceVariables = async (): Promise<void> => {
|
|
89
89
|
await this.setBuildingDerivedInfo();
|
|
90
90
|
await this.initializeLaunchJS();
|
|
91
|
-
this.
|
|
91
|
+
this.attachOnClickToLauncher();
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
setBuildingDerivedInfo = async (): Promise<void> => {
|
|
@@ -146,10 +146,10 @@ export class MEChat extends LitElement {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
private configureLauncherElement = () => {
|
|
149
|
-
if (!this.popup || !this.
|
|
149
|
+
if (!this.popup || !this.launcherRef.value) {
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
this.launcher = this.
|
|
152
|
+
this.launcher = this.launcherRef.value;
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
private configureTalkJSPopup = async (
|
|
@@ -182,7 +182,7 @@ export class MEChat extends LitElement {
|
|
|
182
182
|
if (!talkjsPopupElement) throw new Error("Failed to find chat window");
|
|
183
183
|
talkjsPopupElement.classList.add("meetelise-chat", "pane");
|
|
184
184
|
if (!this.isMobile) {
|
|
185
|
-
talkjsPopupElement.classList.add("
|
|
185
|
+
talkjsPopupElement.classList.add("launcher__desktop");
|
|
186
186
|
}
|
|
187
187
|
(talkjsPopupElement as HTMLElement).style.zIndex = "99999999999";
|
|
188
188
|
this.popup = popup;
|
|
@@ -230,21 +230,21 @@ export class MEChat extends LitElement {
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
render(): TemplateResult {
|
|
233
|
-
|
|
233
|
+
installLauncher();
|
|
234
234
|
|
|
235
235
|
return html`
|
|
236
236
|
<div
|
|
237
237
|
class=${classMap({
|
|
238
|
-
|
|
239
|
-
["
|
|
240
|
-
["
|
|
238
|
+
launcherContainer: true,
|
|
239
|
+
["launcher__mobile"]: this.isMobile,
|
|
240
|
+
["launcher__desktop"]: !this.isMobile,
|
|
241
241
|
["meetelise-chat"]: true,
|
|
242
242
|
launcher: true,
|
|
243
243
|
shouldBeVisible: true,
|
|
244
244
|
})}
|
|
245
245
|
>
|
|
246
|
-
<
|
|
247
|
-
${ref(this.
|
|
246
|
+
<meetelise-launcher
|
|
247
|
+
${ref(this.launcherRef)}
|
|
248
248
|
.isMobile=${this.isMobile}
|
|
249
249
|
.isFirstMount=${!this.hasMounted}
|
|
250
250
|
.isMini=${this.useMiniWidget}
|
|
@@ -256,18 +256,18 @@ export class MEChat extends LitElement {
|
|
|
256
256
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
257
257
|
?hidden=${this.hideLauncher}
|
|
258
258
|
>
|
|
259
|
-
</
|
|
259
|
+
</meetelise-launcher>
|
|
260
260
|
</div>
|
|
261
261
|
`;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
private
|
|
265
|
-
const
|
|
266
|
-
if (!
|
|
264
|
+
private attachOnClickToLauncher = () => {
|
|
265
|
+
const launcher = this.launcherRef.value;
|
|
266
|
+
if (!launcher) {
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
launcher.onChatTapped = async () => {
|
|
271
271
|
if (!this.popup) {
|
|
272
272
|
return;
|
|
273
273
|
}
|