@meetelise/chat 1.22.6 → 1.22.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.
|
@@ -79,6 +79,18 @@ export const pubnubChatStyles = css`
|
|
|
79
79
|
letter-spacing: 0em;
|
|
80
80
|
text-align: left;
|
|
81
81
|
}
|
|
82
|
+
.message-text-large {
|
|
83
|
+
word-break: break-word;
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 4px 8px;
|
|
86
|
+
line-height: 130%;
|
|
87
|
+
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
font-weight: 400;
|
|
90
|
+
line-height: 18px;
|
|
91
|
+
letter-spacing: 0em;
|
|
92
|
+
text-align: left;
|
|
93
|
+
}
|
|
82
94
|
.displayed-message-image {
|
|
83
95
|
max-width: 100%;
|
|
84
96
|
max-height: 300px;
|
|
@@ -33,6 +33,7 @@ import "./pubnub-media";
|
|
|
33
33
|
import classNames from "classnames";
|
|
34
34
|
import { differenceInDays } from "date-fns";
|
|
35
35
|
import { WidgetType } from "../main/MEChat";
|
|
36
|
+
import { utiltiesChatStyles } from "./utilities-styles";
|
|
36
37
|
|
|
37
38
|
@customElement("pubnub-chat")
|
|
38
39
|
export class PubnubChat extends LitElement {
|
|
@@ -41,6 +42,7 @@ export class PubnubChat extends LitElement {
|
|
|
41
42
|
pubnubChatStyles,
|
|
42
43
|
leasingChatStyles,
|
|
43
44
|
healthChatStyles,
|
|
45
|
+
utiltiesChatStyles,
|
|
44
46
|
];
|
|
45
47
|
|
|
46
48
|
@property({ type: Number })
|
|
@@ -250,14 +252,14 @@ export class PubnubChat extends LitElement {
|
|
|
250
252
|
if (this.widgetType === WidgetType.Utilities) {
|
|
251
253
|
return html`
|
|
252
254
|
<div
|
|
253
|
-
id="
|
|
255
|
+
id="utilities-container"
|
|
254
256
|
class=${classMap({
|
|
255
257
|
["pubnub-container__mobile"]: isMobile(),
|
|
256
|
-
["
|
|
258
|
+
["utilities-container__desktop"]: !isMobile(),
|
|
257
259
|
})}
|
|
258
260
|
style=${styleMap(styles)}
|
|
259
261
|
>
|
|
260
|
-
<div id="
|
|
262
|
+
<div id="utilities-header">
|
|
261
263
|
<div>
|
|
262
264
|
<div id="header-text">Talk with our AI</div>
|
|
263
265
|
</div>
|
|
@@ -285,7 +287,7 @@ export class PubnubChat extends LitElement {
|
|
|
285
287
|
id="conversation-body"
|
|
286
288
|
class=${classMap({
|
|
287
289
|
["hidden"]: this.needsConsent(),
|
|
288
|
-
["
|
|
290
|
+
["utilities-conversation-body-backdrop"]: true,
|
|
289
291
|
})}
|
|
290
292
|
>
|
|
291
293
|
<ul
|
|
@@ -294,8 +296,8 @@ export class PubnubChat extends LitElement {
|
|
|
294
296
|
["hidden"]: this.needsConsent(),
|
|
295
297
|
})}
|
|
296
298
|
>
|
|
297
|
-
<li class="
|
|
298
|
-
<p class="
|
|
299
|
+
<li class="utilities-disclaimer-message">
|
|
300
|
+
<p class="utilities-disclaimer-inner">
|
|
299
301
|
This conversation may be monitored and recorded. By replying,
|
|
300
302
|
you consent to
|
|
301
303
|
<a
|
|
@@ -311,7 +313,7 @@ export class PubnubChat extends LitElement {
|
|
|
311
313
|
<li class="message-container ai-message">
|
|
312
314
|
<p
|
|
313
315
|
class=${classMap({
|
|
314
|
-
["message-text"]: true,
|
|
316
|
+
["message-text-large"]: true,
|
|
315
317
|
["webchat-font__desktop"]: !isMobile(),
|
|
316
318
|
["webchat-font__mobile"]: isMobile(),
|
|
317
319
|
})}
|
|
@@ -342,6 +344,7 @@ export class PubnubChat extends LitElement {
|
|
|
342
344
|
.onMount=${() => this.scrollToChatBottom()}
|
|
343
345
|
.isLeadMessage=${message.isLeadMessage}
|
|
344
346
|
.buildingSlug=${this.buildingSlug}
|
|
347
|
+
.widgetType=${this.widgetType}
|
|
345
348
|
>
|
|
346
349
|
</pubnub-message>`
|
|
347
350
|
: ""}
|
|
@@ -364,12 +367,12 @@ export class PubnubChat extends LitElement {
|
|
|
364
367
|
</div>
|
|
365
368
|
|
|
366
369
|
<div
|
|
367
|
-
id="
|
|
370
|
+
id="utilities-footer"
|
|
368
371
|
class=${classMap({
|
|
369
372
|
["hidden"]: this.needsConsent(),
|
|
370
373
|
})}
|
|
371
374
|
>
|
|
372
|
-
<div id="
|
|
375
|
+
<div id="utilities-inner-footer">
|
|
373
376
|
<textarea
|
|
374
377
|
id="message-input"
|
|
375
378
|
class=${classMap({
|
|
@@ -388,13 +391,13 @@ export class PubnubChat extends LitElement {
|
|
|
388
391
|
tabindex="0"
|
|
389
392
|
></textarea>
|
|
390
393
|
<button
|
|
391
|
-
id="
|
|
394
|
+
id="utilities-send-message-bttn"
|
|
392
395
|
class=${classMap({
|
|
393
396
|
["health-bttn-allow-access"]: isMobile(),
|
|
394
397
|
})}
|
|
395
398
|
@click=${() => this.sendMessage(this.messageInput.value)}
|
|
396
399
|
>
|
|
397
|
-
${
|
|
400
|
+
${SendMessageIconBlackLarge}
|
|
398
401
|
</button>
|
|
399
402
|
</div>
|
|
400
403
|
</div>
|
|
@@ -504,6 +507,7 @@ export class PubnubChat extends LitElement {
|
|
|
504
507
|
.onMount=${() => this.scrollToChatBottom()}
|
|
505
508
|
.isLeadMessage=${message.isLeadMessage}
|
|
506
509
|
.buildingSlug=${this.buildingSlug}
|
|
510
|
+
.widgetType=${this.widgetType}
|
|
507
511
|
>
|
|
508
512
|
</pubnub-message>`
|
|
509
513
|
: ""}
|
|
@@ -671,6 +675,7 @@ export class PubnubChat extends LitElement {
|
|
|
671
675
|
.onMount=${() => this.scrollToChatBottom()}
|
|
672
676
|
.isLeadMessage=${message.isLeadMessage}
|
|
673
677
|
.buildingSlug=${this.buildingSlug}
|
|
678
|
+
.widgetType=${this.widgetType}
|
|
674
679
|
>
|
|
675
680
|
</pubnub-message>`
|
|
676
681
|
: ""}
|
|
@@ -11,6 +11,7 @@ import { isMobile } from "../utils";
|
|
|
11
11
|
import { LogType, sendLoggingEvent } from "../analytics";
|
|
12
12
|
import { pubnubChatStyles } from "./pubnub-chat-styles";
|
|
13
13
|
import "./mini-loader";
|
|
14
|
+
import { WidgetType } from "../main/MEChat";
|
|
14
15
|
|
|
15
16
|
interface WebsitePreview {
|
|
16
17
|
title: string | null;
|
|
@@ -73,6 +74,9 @@ export class PubnubMessage extends LitElement {
|
|
|
73
74
|
@property({ type: Boolean })
|
|
74
75
|
isLeadMessage = false;
|
|
75
76
|
|
|
77
|
+
@property({ attribute: true })
|
|
78
|
+
widgetType: WidgetType = WidgetType.Default;
|
|
79
|
+
|
|
76
80
|
isMessageStillStreamingChunks(): boolean {
|
|
77
81
|
if (!this.message) return false;
|
|
78
82
|
const messageChunkMarkedAsDone = this.message.chunks.find(
|
|
@@ -340,7 +344,8 @@ export class PubnubMessage extends LitElement {
|
|
|
340
344
|
: ""}
|
|
341
345
|
<p
|
|
342
346
|
class=${classMap({
|
|
343
|
-
["message-text"]:
|
|
347
|
+
["message-text"]: this.widgetType !== WidgetType.Utilities,
|
|
348
|
+
["message-text-large"]: this.widgetType === WidgetType.Utilities,
|
|
344
349
|
["webchat-font__desktop"]: !isMobile(),
|
|
345
350
|
["webchat-font__mobile"]: isMobile(),
|
|
346
351
|
})}
|
|
@@ -393,7 +398,9 @@ export class PubnubMessage extends LitElement {
|
|
|
393
398
|
|
|
394
399
|
<div class="website-preview-body">
|
|
395
400
|
<p class=${classMap({
|
|
396
|
-
["message-text"]:
|
|
401
|
+
["message-text"]: this.widgetType !== WidgetType.Utilities,
|
|
402
|
+
["message-text-large"]:
|
|
403
|
+
this.widgetType === WidgetType.Utilities,
|
|
397
404
|
["website-preview-title"]: true,
|
|
398
405
|
["webchat-font__desktop"]: !isMobile(),
|
|
399
406
|
["webchat-font__mobile"]: isMobile(),
|
|
@@ -402,7 +409,10 @@ export class PubnubMessage extends LitElement {
|
|
|
402
409
|
preview.description
|
|
403
410
|
? html`<p
|
|
404
411
|
class=${classMap({
|
|
405
|
-
["message-text"]:
|
|
412
|
+
["message-text"]:
|
|
413
|
+
this.widgetType !== WidgetType.Utilities,
|
|
414
|
+
["message-text-large"]:
|
|
415
|
+
this.widgetType === WidgetType.Utilities,
|
|
406
416
|
["website-preview-description"]: true,
|
|
407
417
|
["webchat-font__desktop"]: !isMobile(),
|
|
408
418
|
["webchat-font__mobile"]: isMobile(),
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export const utiltiesChatStyles = css`
|
|
4
|
+
#utilities-container {
|
|
5
|
+
position: fixed;
|
|
6
|
+
|
|
7
|
+
z-index: 100001;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
box-shadow: -10px 60px 60px 0px #bfbfbf4d;
|
|
15
|
+
|
|
16
|
+
box-shadow: 0px 1px 24px 0px #0000001a;
|
|
17
|
+
|
|
18
|
+
font-family: Poppins, "Open Sans", "Helvetica", sans-serif;
|
|
19
|
+
}
|
|
20
|
+
.utilities-container__desktop {
|
|
21
|
+
width: 500px;
|
|
22
|
+
height: min(700px, calc(100vh - 200px));
|
|
23
|
+
border-radius: 10px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#utilities-header {
|
|
27
|
+
height: 60px;
|
|
28
|
+
width: 100%;
|
|
29
|
+
background: white;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
padding: 24px 16px;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.utilities-conversation-body-backdrop {
|
|
41
|
+
background: #f1f2f4;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media screen and (max-width: 767px) {
|
|
45
|
+
#conversation-body {
|
|
46
|
+
background: #efefef;
|
|
47
|
+
backdrop-filter: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.utilities-disclaimer-inner {
|
|
52
|
+
margin: 0 auto;
|
|
53
|
+
}
|
|
54
|
+
.utilities-disclaimer-message {
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
color: #737373;
|
|
57
|
+
line-height: 12px;
|
|
58
|
+
font-weight: 400;
|
|
59
|
+
text-align: left;
|
|
60
|
+
align-self: flex-start;
|
|
61
|
+
}
|
|
62
|
+
.utilities-disclaimer-inner > a {
|
|
63
|
+
color: #737373;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#utilities-footer {
|
|
67
|
+
min-height: 60px;
|
|
68
|
+
width: 100%;
|
|
69
|
+
background: white;
|
|
70
|
+
z-index: 100001;
|
|
71
|
+
}
|
|
72
|
+
#utilities-inner-footer {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
padding: 16px;
|
|
78
|
+
gap: 0px;
|
|
79
|
+
}
|
|
80
|
+
#utilities-inner-footer > #message-input {
|
|
81
|
+
width: 100%;
|
|
82
|
+
max-height: 100px;
|
|
83
|
+
overflowy: auto;
|
|
84
|
+
|
|
85
|
+
font-family: inherit;
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
font-weight: light;
|
|
88
|
+
border: none;
|
|
89
|
+
color: black;
|
|
90
|
+
background: none;
|
|
91
|
+
|
|
92
|
+
padding-right: 6px; /* width of the scrollbar */
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
z-index: 1000000000000000000000000001;
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
}
|
|
97
|
+
#utilities-inner-footer > #message-input:focus {
|
|
98
|
+
outline: none;
|
|
99
|
+
-webkit-box-shadow: none;
|
|
100
|
+
box-shadow: none;
|
|
101
|
+
}
|
|
102
|
+
#utilities-send-message-bttn {
|
|
103
|
+
background: none;
|
|
104
|
+
border: none;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
}
|
|
107
|
+
.health-bttn-allow-access {
|
|
108
|
+
padding-right: 28px;
|
|
109
|
+
}
|
|
110
|
+
`;
|