@meetelise/chat 1.43.30 → 1.43.31
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/dist/src/WebComponent/actions/details-window.d.ts +3 -1
- package/dist/src/WebComponent/launcher/Launcher.d.ts +4 -0
- package/dist/src/WebComponent/me-chat.d.ts +2 -0
- package/dist/src/WebComponent/pubnub-chat.d.ts +4 -0
- package/dist/src/utils.d.ts +1 -0
- package/package.json +1 -1
- package/public/dist/index.js +346 -292
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +1 -1
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +1 -1
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +1 -1
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +2 -1
- package/src/WebComponent/MEChat.css +1 -1
- package/src/WebComponent/Scheduler/date-picker.ts +6 -0
- package/src/WebComponent/Scheduler/time-picker.ts +17 -0
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +22 -3
- package/src/WebComponent/actions/details-window.ts +16 -8
- package/src/WebComponent/actions/email-us-window.ts +2 -0
- package/src/WebComponent/healthchat-styles.ts +3 -1
- package/src/WebComponent/launcher/Launcher.ts +41 -22
- package/src/WebComponent/launcher/launcherStyles.ts +1 -1
- package/src/WebComponent/leasing-chat-styles.ts +3 -1
- package/src/WebComponent/loaders/skeleton-loader-styles.ts +2 -2
- package/src/WebComponent/me-chat.ts +16 -9
- package/src/WebComponent/pubnub-chat.ts +40 -23
- package/src/WebComponent/utilities-styles.ts +4 -2
- package/src/utils.ts +19 -2
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
defaultBackgroundColor,
|
|
15
15
|
shouldUsePrimaryColorForChatFooter,
|
|
16
16
|
} from "../themes";
|
|
17
|
-
import { isMobile } from "../utils";
|
|
17
|
+
import { isMobile, onMobileChange } from "../utils";
|
|
18
18
|
import { InputStyles } from "./actions/InputStyles";
|
|
19
19
|
import { healthChatStyles } from "./healthchat-styles";
|
|
20
20
|
import { leasingChatStyles } from "./leasing-chat-styles";
|
|
@@ -103,6 +103,11 @@ export class PubnubChat extends LitElement {
|
|
|
103
103
|
@query("#conversation-body", true)
|
|
104
104
|
messageBody!: HTMLDivElement;
|
|
105
105
|
|
|
106
|
+
@state()
|
|
107
|
+
_isMobile = isMobile();
|
|
108
|
+
|
|
109
|
+
private _cleanupMobileListener?: () => void;
|
|
110
|
+
|
|
106
111
|
@state()
|
|
107
112
|
messages: SimpleChatMessage[] = [];
|
|
108
113
|
|
|
@@ -130,6 +135,18 @@ export class PubnubChat extends LitElement {
|
|
|
130
135
|
return `${this.orgSlug}Consent`;
|
|
131
136
|
}
|
|
132
137
|
|
|
138
|
+
connectedCallback(): void {
|
|
139
|
+
super.connectedCallback();
|
|
140
|
+
this._cleanupMobileListener = onMobileChange((m) => {
|
|
141
|
+
this._isMobile = m;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
disconnectedCallback(): void {
|
|
146
|
+
this._cleanupMobileListener?.();
|
|
147
|
+
super.disconnectedCallback();
|
|
148
|
+
}
|
|
149
|
+
|
|
133
150
|
sendMessage = async (message: string): Promise<void> => {
|
|
134
151
|
if (message.length === 0) {
|
|
135
152
|
return;
|
|
@@ -216,7 +233,7 @@ export class PubnubChat extends LitElement {
|
|
|
216
233
|
|
|
217
234
|
const buildingId = this.building?.id;
|
|
218
235
|
let styles = {};
|
|
219
|
-
if (
|
|
236
|
+
if (this._isMobile) {
|
|
220
237
|
styles = {
|
|
221
238
|
top: undefined,
|
|
222
239
|
bottom: 0,
|
|
@@ -260,8 +277,8 @@ export class PubnubChat extends LitElement {
|
|
|
260
277
|
<div
|
|
261
278
|
id="utilities-container"
|
|
262
279
|
class=${classMap({
|
|
263
|
-
["pubnub-container__mobile"]:
|
|
264
|
-
["utilities-container__desktop"]: !
|
|
280
|
+
["pubnub-container__mobile"]: this._isMobile,
|
|
281
|
+
["utilities-container__desktop"]: !this._isMobile,
|
|
265
282
|
})}
|
|
266
283
|
style=${styleMap(styles)}
|
|
267
284
|
>
|
|
@@ -323,8 +340,8 @@ export class PubnubChat extends LitElement {
|
|
|
323
340
|
<p
|
|
324
341
|
class=${classMap({
|
|
325
342
|
["message-text-large"]: true,
|
|
326
|
-
["webchat-font__desktop"]: !
|
|
327
|
-
["webchat-font__mobile"]:
|
|
343
|
+
["webchat-font__desktop"]: !this._isMobile,
|
|
344
|
+
["webchat-font__mobile"]: this._isMobile,
|
|
328
345
|
})}
|
|
329
346
|
>
|
|
330
347
|
Hi I'm Elise. How can I assist you today?
|
|
@@ -392,8 +409,8 @@ export class PubnubChat extends LitElement {
|
|
|
392
409
|
<textarea
|
|
393
410
|
id="message-input"
|
|
394
411
|
class=${classMap({
|
|
395
|
-
["webchat-font__desktop"]: !
|
|
396
|
-
["webchat-font__mobile"]:
|
|
412
|
+
["webchat-font__desktop"]: !this._isMobile,
|
|
413
|
+
["webchat-font__mobile"]: this._isMobile,
|
|
397
414
|
})}
|
|
398
415
|
placeholder="Ask a Question..."
|
|
399
416
|
@keydown=${(e: KeyboardEvent) => {
|
|
@@ -409,7 +426,7 @@ export class PubnubChat extends LitElement {
|
|
|
409
426
|
<button
|
|
410
427
|
id="utilities-send-message-bttn"
|
|
411
428
|
class=${classMap({
|
|
412
|
-
["health-bttn-allow-access"]:
|
|
429
|
+
["health-bttn-allow-access"]: this._isMobile,
|
|
413
430
|
})}
|
|
414
431
|
@click=${() => this.sendMessage(this.messageInput.value)}
|
|
415
432
|
>
|
|
@@ -426,8 +443,8 @@ export class PubnubChat extends LitElement {
|
|
|
426
443
|
<div
|
|
427
444
|
id="healthchat-container"
|
|
428
445
|
class=${classMap({
|
|
429
|
-
["pubnub-container__mobile"]:
|
|
430
|
-
["healthchat-container__desktop"]: !
|
|
446
|
+
["pubnub-container__mobile"]: this._isMobile,
|
|
447
|
+
["healthchat-container__desktop"]: !this._isMobile,
|
|
431
448
|
})}
|
|
432
449
|
style=${styleMap(styles)}
|
|
433
450
|
>
|
|
@@ -495,8 +512,8 @@ export class PubnubChat extends LitElement {
|
|
|
495
512
|
<p
|
|
496
513
|
class=${classMap({
|
|
497
514
|
["message-text"]: true,
|
|
498
|
-
["webchat-font__desktop"]: !
|
|
499
|
-
["webchat-font__mobile"]:
|
|
515
|
+
["webchat-font__desktop"]: !this._isMobile,
|
|
516
|
+
["webchat-font__mobile"]: this._isMobile,
|
|
500
517
|
})}
|
|
501
518
|
>
|
|
502
519
|
Hi I'm Elise. If this is a medical emergency, please call 911.
|
|
@@ -565,8 +582,8 @@ export class PubnubChat extends LitElement {
|
|
|
565
582
|
<textarea
|
|
566
583
|
id="message-input"
|
|
567
584
|
class=${classMap({
|
|
568
|
-
["webchat-font__desktop"]: !
|
|
569
|
-
["webchat-font__mobile"]:
|
|
585
|
+
["webchat-font__desktop"]: !this._isMobile,
|
|
586
|
+
["webchat-font__mobile"]: this._isMobile,
|
|
570
587
|
})}
|
|
571
588
|
placeholder="Ask a Question..."
|
|
572
589
|
@keydown=${(e: KeyboardEvent) => {
|
|
@@ -582,11 +599,11 @@ export class PubnubChat extends LitElement {
|
|
|
582
599
|
<button
|
|
583
600
|
id="healthcare-send-message-bttn"
|
|
584
601
|
class=${classMap({
|
|
585
|
-
["health-bttn-allow-access"]:
|
|
602
|
+
["health-bttn-allow-access"]: this._isMobile,
|
|
586
603
|
})}
|
|
587
604
|
@click=${() => this.sendMessage(this.messageInput.value)}
|
|
588
605
|
>
|
|
589
|
-
${
|
|
606
|
+
${this._isMobile
|
|
590
607
|
? SendMessageLargeIcon("black")
|
|
591
608
|
: SendMessageMediumIcon("black")}
|
|
592
609
|
</button>
|
|
@@ -605,8 +622,8 @@ export class PubnubChat extends LitElement {
|
|
|
605
622
|
<div
|
|
606
623
|
id="pubnub-chat-container"
|
|
607
624
|
class=${classMap({
|
|
608
|
-
["pubnub-container__mobile"]:
|
|
609
|
-
["pubnub-container__desktop"]: !
|
|
625
|
+
["pubnub-container__mobile"]: this._isMobile,
|
|
626
|
+
["pubnub-container__desktop"]: !this._isMobile,
|
|
610
627
|
})}
|
|
611
628
|
style=${styleMap(styles)}
|
|
612
629
|
@keydown=${(e: KeyboardEvent) => e.stopPropagation()}
|
|
@@ -687,8 +704,8 @@ export class PubnubChat extends LitElement {
|
|
|
687
704
|
<p
|
|
688
705
|
class=${classMap({
|
|
689
706
|
["message-text"]: true,
|
|
690
|
-
["webchat-font__desktop"]: !
|
|
691
|
-
["webchat-font__mobile"]:
|
|
707
|
+
["webchat-font__desktop"]: !this._isMobile,
|
|
708
|
+
["webchat-font__mobile"]: this._isMobile,
|
|
692
709
|
})}
|
|
693
710
|
>
|
|
694
711
|
${this.building.welcomeMessage
|
|
@@ -765,8 +782,8 @@ export class PubnubChat extends LitElement {
|
|
|
765
782
|
<textarea
|
|
766
783
|
id="message-input"
|
|
767
784
|
class=${classMap({
|
|
768
|
-
["webchat-font__desktop"]: !
|
|
769
|
-
["webchat-font__mobile"]:
|
|
785
|
+
["webchat-font__desktop"]: !this._isMobile,
|
|
786
|
+
["webchat-font__mobile"]: this._isMobile,
|
|
770
787
|
})}
|
|
771
788
|
style=${styleMap({
|
|
772
789
|
color:
|
|
@@ -19,7 +19,9 @@ export const utiltiesChatStyles = css`
|
|
|
19
19
|
}
|
|
20
20
|
.utilities-container__desktop {
|
|
21
21
|
width: 500px;
|
|
22
|
-
height:
|
|
22
|
+
height: 700px;
|
|
23
|
+
max-height: calc(100vh - 230px);
|
|
24
|
+
max-height: calc(100svh - 230px);
|
|
23
25
|
border-radius: 10px;
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -91,7 +93,7 @@ export const utiltiesChatStyles = css`
|
|
|
91
93
|
|
|
92
94
|
padding-right: 6px; /* width of the scrollbar */
|
|
93
95
|
box-sizing: border-box;
|
|
94
|
-
z-index:
|
|
96
|
+
z-index: 10;
|
|
95
97
|
font-size: 14px;
|
|
96
98
|
}
|
|
97
99
|
#utilities-inner-footer > #message-input:focus {
|
package/src/utils.ts
CHANGED
|
@@ -45,9 +45,26 @@ export const snakify = <T>(
|
|
|
45
45
|
}
|
|
46
46
|
) as T;
|
|
47
47
|
|
|
48
|
+
const MOBILE_QUERY = "(max-width: 767px)";
|
|
49
|
+
const SHORT_QUERY = "(max-height: 400px)";
|
|
50
|
+
|
|
48
51
|
export const isMobile = (): boolean =>
|
|
49
|
-
window.matchMedia(
|
|
50
|
-
window.matchMedia(
|
|
52
|
+
window.matchMedia(MOBILE_QUERY).matches ||
|
|
53
|
+
window.matchMedia(SHORT_QUERY).matches;
|
|
54
|
+
|
|
55
|
+
export const onMobileChange = (
|
|
56
|
+
callback: (isMobile: boolean) => void
|
|
57
|
+
): (() => void) => {
|
|
58
|
+
const mqWidth = window.matchMedia(MOBILE_QUERY);
|
|
59
|
+
const mqHeight = window.matchMedia(SHORT_QUERY);
|
|
60
|
+
const handler = () => callback(mqWidth.matches || mqHeight.matches);
|
|
61
|
+
mqWidth.addEventListener("change", handler);
|
|
62
|
+
mqHeight.addEventListener("change", handler);
|
|
63
|
+
return () => {
|
|
64
|
+
mqWidth.removeEventListener("change", handler);
|
|
65
|
+
mqHeight.removeEventListener("change", handler);
|
|
66
|
+
};
|
|
67
|
+
};
|
|
51
68
|
|
|
52
69
|
export const isTimestampExpired = (
|
|
53
70
|
timestamp: Date,
|