@meetelise/chat 1.12.6 → 1.12.9
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 +72 -74
- package/src/MEChat.ts +1 -1
- package/src/WebComponent/{InHouseLauncher.ts → Launcher.ts} +32 -36
- package/src/WebComponent/MEChat.css +1 -1
- 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} +36 -36
- package/src/WebComponent/{MEChat.ts → me-chat.ts} +19 -19
- package/src/getAvailabilities.ts +1 -1
package/src/MEChat.ts
CHANGED
|
@@ -3,19 +3,19 @@ import { html, LitElement, TemplateResult } from "lit";
|
|
|
3
3
|
import { customElement, property, state } from "lit/decorators.js";
|
|
4
4
|
import { createRef, ref, Ref } from "lit/directives/ref.js";
|
|
5
5
|
import { glowBarMp4, glowBarWebm } from "../assetUrls";
|
|
6
|
-
import {
|
|
7
|
-
import { EmailUsWindow, installEmailUsWindow } from "./actions/
|
|
8
|
-
import { installTextUsWindow, TextUsWindow } from "./actions/
|
|
6
|
+
import { launcherStyles } from "./launcherStyles";
|
|
7
|
+
import { EmailUsWindow, installEmailUsWindow } from "./actions/email-us-window";
|
|
8
|
+
import { installTextUsWindow, TextUsWindow } from "./actions/text-us-window";
|
|
9
9
|
import { styleMap } from "lit/directives/style-map.js";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
-
import { installCallUsWindow } from "./actions/
|
|
11
|
+
import { installCallUsWindow } from "./actions/call-us-window";
|
|
12
12
|
import { getRegisteredPhoneNumbers } from "../getRegisteredPhoneNumbers";
|
|
13
13
|
import { TourScheduler } from "./Scheduler/tour-scheduler";
|
|
14
14
|
import { LabeledOption } from "../fetchBuildingInfo";
|
|
15
15
|
|
|
16
|
-
@customElement("
|
|
17
|
-
export class
|
|
18
|
-
static styles =
|
|
16
|
+
@customElement("meetelise-launcher")
|
|
17
|
+
export class Launcher extends LitElement {
|
|
18
|
+
static styles = launcherStyles;
|
|
19
19
|
|
|
20
20
|
@property({ type: Boolean })
|
|
21
21
|
isMobile = false;
|
|
@@ -125,7 +125,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
125
125
|
return html`
|
|
126
126
|
<div
|
|
127
127
|
@click=${this.onClickEmailOption}
|
|
128
|
-
class="
|
|
128
|
+
class="launcher__call-to-action-option"
|
|
129
129
|
>
|
|
130
130
|
${text}
|
|
131
131
|
</div>
|
|
@@ -144,9 +144,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
144
144
|
|
|
145
145
|
renderCallUsOption = (): TemplateResult => {
|
|
146
146
|
const text = this.getNumCallToActions() > 2 ? "Phone" : "Hours/Phone";
|
|
147
|
-
return html`
|
|
148
|
-
<div class="in-house-launcher__call-to-action-option">${text}</div>
|
|
149
|
-
`;
|
|
147
|
+
return html` <div class="launcher__call-to-action-option">${text}</div> `;
|
|
150
148
|
};
|
|
151
149
|
|
|
152
150
|
onClickSSTOption = (e: MouseEvent): void => {
|
|
@@ -163,7 +161,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
163
161
|
const text = this.getNumCallToActions() > 2 ? "Book" : "Book a tour";
|
|
164
162
|
return html`
|
|
165
163
|
<div
|
|
166
|
-
class="
|
|
164
|
+
class="launcher__call-to-action-option"
|
|
167
165
|
@click=${this.onClickSSTOption}
|
|
168
166
|
>
|
|
169
167
|
${text}
|
|
@@ -185,7 +183,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
185
183
|
return html`
|
|
186
184
|
<div
|
|
187
185
|
@click=${this.onClickTextUsOption}
|
|
188
|
-
class="
|
|
186
|
+
class="launcher__call-to-action-option"
|
|
189
187
|
>
|
|
190
188
|
Text us
|
|
191
189
|
</div>
|
|
@@ -198,7 +196,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
return html`
|
|
201
|
-
<div class="
|
|
199
|
+
<div class="launcher__call-to-actions-wrapper">
|
|
202
200
|
${this.hasEmailEnabled ? this.renderEmailOption() : ""}
|
|
203
201
|
${this.phoneNumber ? this.renderCallUsOption() : ""}
|
|
204
202
|
${this.hasTextUsEnabled ? this.renderTextUsOption() : ""}
|
|
@@ -224,12 +222,12 @@ export class InHouseLauncher extends LitElement {
|
|
|
224
222
|
isSecondaryAction?: boolean
|
|
225
223
|
): TemplateResult => {
|
|
226
224
|
return html`
|
|
227
|
-
<div class="
|
|
225
|
+
<div class="launcher__mini-option-wrapper">
|
|
228
226
|
<div
|
|
229
227
|
@click=${onClick}
|
|
230
228
|
class=${classMap({
|
|
231
|
-
["
|
|
232
|
-
["
|
|
229
|
+
["launcher__mini-option"]: true,
|
|
230
|
+
["launcher__secondary-option"]: !!isSecondaryAction,
|
|
233
231
|
})}
|
|
234
232
|
>
|
|
235
233
|
${content}
|
|
@@ -240,9 +238,9 @@ export class InHouseLauncher extends LitElement {
|
|
|
240
238
|
|
|
241
239
|
renderMiniLauncher = (): TemplateResult => {
|
|
242
240
|
return html`
|
|
243
|
-
<div class="
|
|
241
|
+
<div class="launcher__mini-launcher-wrapper">
|
|
244
242
|
${this.isEmailWindowOpen
|
|
245
|
-
? html`<div class="
|
|
243
|
+
? html`<div class="launcher__window-wrapper">
|
|
246
244
|
<email-us-window
|
|
247
245
|
${ref(this.emailUsWindowRef)}
|
|
248
246
|
.buildingId=${this.buildingId}
|
|
@@ -251,7 +249,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
251
249
|
</div>`
|
|
252
250
|
: ""}
|
|
253
251
|
${this.isTextUsWindowOpen
|
|
254
|
-
? html`<div class="
|
|
252
|
+
? html`<div class="launcher__window-wrapper">
|
|
255
253
|
<text-us-window
|
|
256
254
|
${ref(this.textUsWindowRef)}
|
|
257
255
|
.buildingId=${this.buildingId}
|
|
@@ -259,7 +257,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
259
257
|
</div>`
|
|
260
258
|
: ""}
|
|
261
259
|
${this.isSSTWindowOpen
|
|
262
|
-
? html`<div class="
|
|
260
|
+
? html`<div class="launcher__window-wrapper">
|
|
263
261
|
<tour-scheduler
|
|
264
262
|
.layoutOptions=${this.layoutOptions}
|
|
265
263
|
.tourTypeOptions=${this.tourTypeOptions}
|
|
@@ -270,7 +268,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
270
268
|
: ""}
|
|
271
269
|
${this.isCallUsWindowOpen
|
|
272
270
|
? html`
|
|
273
|
-
<div class="
|
|
271
|
+
<div class="launcher__window-wrapper">
|
|
274
272
|
<call-us-window
|
|
275
273
|
.onCloseClicked=${this.onClosePhoneWindow}
|
|
276
274
|
phoneNumber="${this.phoneNumber}"
|
|
@@ -393,7 +391,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
393
391
|
return html`
|
|
394
392
|
<div>
|
|
395
393
|
${this.isEmailWindowOpen
|
|
396
|
-
? html`<div class="
|
|
394
|
+
? html`<div class="launcher__window-wrapper">
|
|
397
395
|
<email-us-window
|
|
398
396
|
${ref(this.emailUsWindowRef)}
|
|
399
397
|
.buildingId=${this.buildingId}
|
|
@@ -402,7 +400,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
402
400
|
</div>`
|
|
403
401
|
: ""}
|
|
404
402
|
${this.isTextUsWindowOpen
|
|
405
|
-
? html`<div class="
|
|
403
|
+
? html`<div class="launcher__window-wrapper">
|
|
406
404
|
<text-us-window
|
|
407
405
|
${ref(this.textUsWindowRef)}
|
|
408
406
|
.buildingId=${this.buildingId}
|
|
@@ -410,7 +408,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
410
408
|
</div>`
|
|
411
409
|
: ""}
|
|
412
410
|
${this.isSSTWindowOpen
|
|
413
|
-
? html`<div class="
|
|
411
|
+
? html`<div class="launcher__window-wrapper">
|
|
414
412
|
<tour-scheduler
|
|
415
413
|
.layoutOptions=${this.layoutOptions}
|
|
416
414
|
.tourTypeOptions=${this.tourTypeOptions}
|
|
@@ -421,7 +419,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
421
419
|
: ""}
|
|
422
420
|
${this.isCallUsWindowOpen && this.phoneNumber
|
|
423
421
|
? html`
|
|
424
|
-
<div class="
|
|
422
|
+
<div class="launcher__window-wrapper">
|
|
425
423
|
<call-us-window
|
|
426
424
|
.onCloseClicked=${this.onClosePhoneWindow}
|
|
427
425
|
phoneNumber="${this.phoneNumber}"
|
|
@@ -436,9 +434,7 @@ export class InHouseLauncher extends LitElement {
|
|
|
436
434
|
@click=${this.onChatTapped}
|
|
437
435
|
class="${classnames(
|
|
438
436
|
"launcher",
|
|
439
|
-
this.isMobile
|
|
440
|
-
? "in-house-launcher__mobile"
|
|
441
|
-
: "in-house-launcher__desktop",
|
|
437
|
+
this.isMobile ? "launcher__mobile" : "launcher__desktop",
|
|
442
438
|
{
|
|
443
439
|
firstMount: this.isFirstMount,
|
|
444
440
|
}
|
|
@@ -456,8 +452,8 @@ export class InHouseLauncher extends LitElement {
|
|
|
456
452
|
<source src="${glowBarMp4}" type="video/mp4" />
|
|
457
453
|
</video>
|
|
458
454
|
<div class="content">
|
|
459
|
-
<div class="
|
|
460
|
-
<div class="
|
|
455
|
+
<div class="launcher__primary-action">
|
|
456
|
+
<div class="launcher__primary-action-text">
|
|
461
457
|
Ask a question
|
|
462
458
|
<svg
|
|
463
459
|
width="21"
|
|
@@ -472,11 +468,11 @@ export class InHouseLauncher extends LitElement {
|
|
|
472
468
|
/>
|
|
473
469
|
</svg>
|
|
474
470
|
</div>
|
|
475
|
-
<div class="
|
|
471
|
+
<div class="launcher__ask-underline"></div>
|
|
476
472
|
</div>
|
|
477
473
|
${this.getNumCallToActions() === 0
|
|
478
474
|
? html`
|
|
479
|
-
<div class="
|
|
475
|
+
<div class="launcher__filler-text">
|
|
480
476
|
I can also help you schedule a tour
|
|
481
477
|
</div>
|
|
482
478
|
`
|
|
@@ -490,8 +486,8 @@ export class InHouseLauncher extends LitElement {
|
|
|
490
486
|
}
|
|
491
487
|
}
|
|
492
488
|
|
|
493
|
-
export const
|
|
494
|
-
if (!window.customElements.get("
|
|
495
|
-
window.customElements.define("
|
|
489
|
+
export const installLauncher = (): void => {
|
|
490
|
+
if (!window.customElements.get("meetelise-launcher")) {
|
|
491
|
+
window.customElements.define("meetelise-launcher", Launcher);
|
|
496
492
|
}
|
|
497
493
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,8 @@ import { css, html, LitElement, TemplateResult } from "lit";
|
|
|
2
2
|
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
|
-
import { installActionConfirmButton } from "./
|
|
6
|
-
import { installDetailsWindow } from "./
|
|
5
|
+
import { installActionConfirmButton } from "./action-confirm-button";
|
|
6
|
+
import { installDetailsWindow } from "./details-window";
|
|
7
7
|
import {
|
|
8
8
|
formatToPhone,
|
|
9
9
|
isModifierKey,
|
|
@@ -2,8 +2,8 @@ import { css, html, LitElement, TemplateResult } from "lit";
|
|
|
2
2
|
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
|
-
import { installActionConfirmButton } from "./
|
|
6
|
-
import { installDetailsWindow } from "./
|
|
5
|
+
import { installActionConfirmButton } from "./action-confirm-button";
|
|
6
|
+
import { installDetailsWindow } from "./details-window";
|
|
7
7
|
import {
|
|
8
8
|
formatToPhone,
|
|
9
9
|
isModifierKey,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import "./
|
|
1
|
+
export { Launcher } from "./Launcher";
|
|
2
|
+
import "./me-chat";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const launcherStyles = css`
|
|
4
4
|
:host {
|
|
5
5
|
--glowBarHeight: 11.2px;
|
|
6
6
|
--enterAnimationDuration: 0.5s;
|
|
@@ -29,25 +29,25 @@ export const inHouseLauncherStyles = css`
|
|
|
29
29
|
backdrop-filter: blur(10px);
|
|
30
30
|
box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
|
|
31
31
|
}
|
|
32
|
-
.launcher:not(.miniLauncher).
|
|
32
|
+
.launcher:not(.miniLauncher).launcher__mobile {
|
|
33
33
|
width: 100%;
|
|
34
34
|
bottom: 0px;
|
|
35
35
|
left: 0px;
|
|
36
36
|
padding: 5px;
|
|
37
37
|
}
|
|
38
|
-
.launcher:not(.miniLauncher).
|
|
38
|
+
.launcher:not(.miniLauncher).launcher__desktop {
|
|
39
39
|
width: 245px;
|
|
40
40
|
height: 112px;
|
|
41
41
|
padding-left: 10px;
|
|
42
42
|
}
|
|
43
|
-
.launcher.
|
|
43
|
+
.launcher.launcher__desktop {
|
|
44
44
|
right: 0px;
|
|
45
45
|
overflow: hidden;
|
|
46
46
|
border-radius: 10px 0px 0px 10px;
|
|
47
47
|
bottom: 40px;
|
|
48
48
|
z-index: 100000;
|
|
49
49
|
}
|
|
50
|
-
.launcher.
|
|
50
|
+
.launcher.launcher__desktop.firstMount {
|
|
51
51
|
animation: slideInFromRight var(--enterAnimationDuration);
|
|
52
52
|
}
|
|
53
53
|
.launcher .glowBar {
|
|
@@ -100,19 +100,19 @@ export const inHouseLauncherStyles = css`
|
|
|
100
100
|
.miniLauncher.firstMount {
|
|
101
101
|
animation: slideInFromRight 0.5s;
|
|
102
102
|
}
|
|
103
|
-
.miniLauncher.
|
|
103
|
+
.miniLauncher.launcher__desktop {
|
|
104
104
|
padding-right: 20px;
|
|
105
105
|
right: 0px;
|
|
106
106
|
overflow: hidden;
|
|
107
107
|
bottom: 40px;
|
|
108
108
|
z-index: var(--desktopZIndex);
|
|
109
109
|
}
|
|
110
|
-
.miniLauncher.
|
|
110
|
+
.miniLauncher.launcher__mobile {
|
|
111
111
|
right: 10px;
|
|
112
112
|
bottom: 20px;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.
|
|
115
|
+
.launcher__primary-action-text {
|
|
116
116
|
font-family: "Poppins";
|
|
117
117
|
font-weight: 700;
|
|
118
118
|
font-size: 24px;
|
|
@@ -120,44 +120,44 @@ export const inHouseLauncherStyles = css`
|
|
|
120
120
|
cursor: pointer;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.
|
|
123
|
+
.launcher__primary-action:hover {
|
|
124
124
|
color: #350da6;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.
|
|
127
|
+
.launcher__primary-action {
|
|
128
128
|
transition: color 0.5s cubic-bezier(0.2, 0.19, 0.27, 0.98),
|
|
129
129
|
fill 0.5s cubic-bezier(0.2, 0.19, 0.27, 0.98);
|
|
130
130
|
cursor: pointer;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.launcher__primary-action:hover path {
|
|
134
134
|
fill: #350da6;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
.
|
|
137
|
+
.launcher__primary-action:hover .launcher__ask-underline {
|
|
138
138
|
background: #350da6;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
.
|
|
141
|
+
.launcher__primary-action svg {
|
|
142
142
|
height: 28px;
|
|
143
143
|
width: 28px;
|
|
144
144
|
transform: translateX(2px);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.
|
|
147
|
+
.launcher__ask-underline {
|
|
148
148
|
width: 47px;
|
|
149
149
|
height: 3px;
|
|
150
150
|
background: #1e1e1e;
|
|
151
151
|
transition: background 0.5s cubic-bezier(0.2, 0.19, 0.27, 0.98);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.
|
|
154
|
+
.launcher__filler-text {
|
|
155
155
|
font-size: 10px;
|
|
156
156
|
line-height: 22px;
|
|
157
157
|
color: #1e1e1e;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
.
|
|
160
|
+
.launcher__call-to-action-option {
|
|
161
161
|
font-weight: 700;
|
|
162
162
|
font-size: 12px;
|
|
163
163
|
line-height: 22px;
|
|
@@ -170,28 +170,28 @@ export const inHouseLauncherStyles = css`
|
|
|
170
170
|
transition: color 0.2s cubic-bezier(0.2, 0.19, 0.27, 0.98);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
.
|
|
173
|
+
.launcher__call-to-action-option:hover {
|
|
174
174
|
color: #350da6;
|
|
175
175
|
border-bottom: 2px solid #350da6;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
.
|
|
178
|
+
.launcher__call-to-actions-wrapper {
|
|
179
179
|
width: 100%;
|
|
180
180
|
display: flex;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
.
|
|
184
|
-
> .
|
|
183
|
+
.launcher__call-to-actions-wrapper
|
|
184
|
+
> .launcher__call-to-action-option:not(:last-child) {
|
|
185
185
|
margin-right: 15px;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
.
|
|
188
|
+
.launcher__window-wrapper {
|
|
189
189
|
position: fixed;
|
|
190
190
|
right: 0;
|
|
191
191
|
bottom: 172px;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
.
|
|
194
|
+
.launcher__mini-launcher-wrapper {
|
|
195
195
|
position: fixed;
|
|
196
196
|
right: 0px;
|
|
197
197
|
bottom: 40px;
|
|
@@ -200,7 +200,7 @@ export const inHouseLauncherStyles = css`
|
|
|
200
200
|
align-items: center;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.
|
|
203
|
+
.launcher__mini-option {
|
|
204
204
|
position: relative;
|
|
205
205
|
// This is so that the pseudo elements we created will be visible despite being beneath the element it is a pseudo element for
|
|
206
206
|
border: 4px solid transparent;
|
|
@@ -217,11 +217,11 @@ export const inHouseLauncherStyles = css`
|
|
|
217
217
|
cursor: pointer;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
.
|
|
220
|
+
.launcher__mini-option-wrapper {
|
|
221
221
|
margin-right: 12px;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
.
|
|
224
|
+
.launcher__mini-option:not(:hover)::before {
|
|
225
225
|
position: absolute;
|
|
226
226
|
top: -4px;
|
|
227
227
|
bottom: -4px;
|
|
@@ -233,20 +233,20 @@ export const inHouseLauncherStyles = css`
|
|
|
233
233
|
border-radius: 50%;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
.
|
|
236
|
+
.launcher__secondary-option {
|
|
237
237
|
width: 30px;
|
|
238
238
|
height: 30px;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
.
|
|
241
|
+
.launcher__mini-option-wrapper {
|
|
242
242
|
background-clip: padding-box;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
.
|
|
245
|
+
.launcher__mini-option:hover {
|
|
246
246
|
border: none;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
.
|
|
249
|
+
.launcher__mini-option:hover::before {
|
|
250
250
|
position: absolute;
|
|
251
251
|
top: -4px;
|
|
252
252
|
bottom: -4px;
|
|
@@ -260,15 +260,15 @@ export const inHouseLauncherStyles = css`
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
@media screen and (max-width: 767px) {
|
|
263
|
-
.launcher:not(.miniLauncher).
|
|
263
|
+
.launcher:not(.miniLauncher).launcher__desktop {
|
|
264
264
|
width: 100%;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
.launcher.
|
|
267
|
+
.launcher.launcher__desktop {
|
|
268
268
|
bottom: 0px;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
.launcher.
|
|
271
|
+
.launcher.launcher__desktop {
|
|
272
272
|
border-radius: 0px;
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -284,20 +284,20 @@ export const inHouseLauncherStyles = css`
|
|
|
284
284
|
padding-bottom: 15px;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
.
|
|
287
|
+
.launcher__primary-action-text {
|
|
288
288
|
font-size: 18px;
|
|
289
289
|
flex-grow: 1;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
.
|
|
292
|
+
.launcher__call-to-actions-wrapper {
|
|
293
293
|
width: fit-content;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
.
|
|
296
|
+
.launcher__ask-underline {
|
|
297
297
|
width: 35px;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
.
|
|
300
|
+
.launcher__window-wrapper {
|
|
301
301
|
left: 0;
|
|
302
302
|
bottom: 0;
|
|
303
303
|
}
|
|
@@ -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
|
}
|
package/src/getAvailabilities.ts
CHANGED
|
@@ -74,7 +74,7 @@ export const getAvailabilitiesGroupedByDay = async (
|
|
|
74
74
|
// TODO: alternative to this: cache the building id when getRawAvailabilities is called. Then I can call the normal methods.
|
|
75
75
|
export const getAvailabilitiesGroupedByDayCached = async (
|
|
76
76
|
tourType: TourAvailabilityResponseRankOrderedSupportedTourTypesEnum
|
|
77
|
-
):
|
|
77
|
+
): Promise<{ [day: string]: Date[] }> =>
|
|
78
78
|
getAvailabilitiesGroupedByDay(
|
|
79
79
|
Object.keys(availabilitiesCache).map(Number)[0],
|
|
80
80
|
tourType
|