@meetelise/chat 1.21.0 → 1.21.2

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.
Files changed (76) hide show
  1. package/.github/pull_request_template.md +61 -0
  2. package/.idea/codeStyles/Project.xml +57 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.idea/workspace.xml +67 -0
  7. package/README.md +29 -14
  8. package/declarations.d.ts +12 -0
  9. package/package.json +5 -1
  10. package/public/demo/index.html +62 -4
  11. package/public/demo/secret.html +63 -0
  12. package/public/dist/index.js +3184 -1105
  13. package/public/dist/index.js.LICENSE.txt +19 -9
  14. package/public/index.html +6 -4
  15. package/src/MEChat.ts +207 -52
  16. package/src/MyPubnub.ts +657 -0
  17. package/src/WebComponent/LeadSourceClient.ts +300 -0
  18. package/src/WebComponent/Scheduler/date-picker.ts +1 -1
  19. package/src/WebComponent/Scheduler/time-picker.ts +86 -76
  20. package/src/WebComponent/Scheduler/tour-scheduler.ts +694 -764
  21. package/src/WebComponent/Scheduler/tour-type-option.ts +17 -3
  22. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
  23. package/src/WebComponent/actions/InputStyles.ts +32 -10
  24. package/src/WebComponent/actions/action-confirm-button.ts +16 -11
  25. package/src/WebComponent/actions/call-us-window.ts +341 -58
  26. package/src/WebComponent/actions/details-window.ts +30 -16
  27. package/src/WebComponent/actions/email-us-window.ts +89 -58
  28. package/src/WebComponent/actions/formatPhoneNumber.ts +15 -1
  29. package/src/WebComponent/actions/minimize-expand-button.ts +92 -0
  30. package/src/WebComponent/health-chat.ts +267 -0
  31. package/src/WebComponent/healthcare/healthcare-launcher-styles.ts +34 -0
  32. package/src/WebComponent/healthcare/healthcare-launcher.ts +100 -0
  33. package/src/WebComponent/healthchat-styles.ts +119 -0
  34. package/src/WebComponent/index.ts +1 -1
  35. package/src/WebComponent/launcher/Launcher.ts +919 -0
  36. package/src/WebComponent/{launcherStyles.ts → launcher/launcherStyles.ts} +172 -29
  37. package/src/WebComponent/launcher/mobile-launcher.ts +127 -0
  38. package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
  39. package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
  40. package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
  41. package/src/WebComponent/leasing-chat-styles.ts +114 -0
  42. package/src/WebComponent/me-chat.ts +964 -351
  43. package/src/WebComponent/me-select.ts +48 -21
  44. package/src/WebComponent/mini-loader.ts +28 -0
  45. package/src/WebComponent/pubnub-chat-styles.ts +192 -0
  46. package/src/WebComponent/pubnub-chat.ts +707 -0
  47. package/src/WebComponent/pubnub-media.ts +208 -0
  48. package/src/WebComponent/pubnub-message-styles.ts +54 -0
  49. package/src/WebComponent/pubnub-message.ts +421 -0
  50. package/src/analytics.ts +114 -14
  51. package/src/assetUrls.ts +2 -0
  52. package/src/disclaimers.ts +56 -0
  53. package/src/fetchBuildingABTestType.ts +4 -0
  54. package/src/fetchBuildingInfo.ts +25 -17
  55. package/src/fetchFeatureFlag.ts +147 -0
  56. package/src/fetchLeadSources.ts +67 -1
  57. package/src/fetchPhoneNumberFromSource.ts +31 -0
  58. package/src/fetchWebchatPreferences.ts +55 -0
  59. package/src/getAvailabilities.ts +7 -3
  60. package/src/getBuildingPhoneNumber.ts +26 -0
  61. package/src/getShouldAllowScheduling.ts +16 -0
  62. package/src/getTimezoneString.ts +39 -0
  63. package/src/gtm.ts +17 -0
  64. package/src/handleChatId.ts +101 -0
  65. package/src/insertDNIIntoWebsite.ts +136 -0
  66. package/src/insertLeadSourceIntoSchedulerLinks.ts +50 -0
  67. package/src/postLeadSources.ts +39 -35
  68. package/src/svgIcons.ts +62 -53
  69. package/src/themes.ts +47 -121
  70. package/src/utils.ts +88 -1
  71. package/src/WebComponent/Launcher.ts +0 -559
  72. package/src/WebComponent/actions/text-us-window.ts +0 -279
  73. package/src/chatID.ts +0 -64
  74. package/src/createConversation.ts +0 -57
  75. package/src/fetchCurrentParsedLeadSource.ts +0 -24
  76. package/src/getRegisteredPhoneNumbers.ts +0 -56
@@ -1,6 +1,7 @@
1
1
  import { LitElement, html, TemplateResult, css } from "lit";
2
2
  import { property, state, query, customElement } from "lit/decorators.js";
3
3
  import { classMap } from "lit/directives/class-map.js";
4
+ import { isMobile } from "../utils";
4
5
  import { InputStyles } from "./actions/InputStyles";
5
6
 
6
7
  type MeSelectOption = {
@@ -25,9 +26,16 @@ export class MESelect extends LitElement {
25
26
  @state()
26
27
  private isOpen?: boolean = false;
27
28
 
29
+ @state()
30
+ private activeOptionIndex: number | null = null;
31
+
28
32
  @query("#select", true)
29
33
  meSelect!: HTMLDivElement;
30
34
 
35
+ focus = (): void => {
36
+ this.meSelect.focus();
37
+ };
38
+
31
39
  toggleSelect = (): void => {
32
40
  if (this.isOpen) {
33
41
  this.activeOption = null;
@@ -68,6 +76,16 @@ export class MESelect extends LitElement {
68
76
  };
69
77
  };
70
78
 
79
+ private adjustScrollToActiveOption(): void {
80
+ if (this.activeOptionIndex != null) {
81
+ const optionElements = this.renderRoot.querySelectorAll(".option");
82
+ const activeOptionElement = optionElements[this.activeOptionIndex];
83
+ if (activeOptionElement) {
84
+ activeOptionElement.scrollIntoView({ block: "nearest" });
85
+ }
86
+ }
87
+ }
88
+
71
89
  constructor() {
72
90
  super();
73
91
  // TODO: the current thing works, but want to investigate more. why doesn't it work with `this`?
@@ -93,7 +111,7 @@ export class MESelect extends LitElement {
93
111
  ul {
94
112
  padding-left: 0;
95
113
  margin-bottom: 0;
96
- max-height: 200px;
114
+ max-height: 140px;
97
115
  overflow-y: scroll;
98
116
  position: absolute;
99
117
  min-height: 40px;
@@ -110,16 +128,23 @@ export class MESelect extends LitElement {
110
128
 
111
129
  font-size: 14px;
112
130
  line-height: 14px;
113
- font-family: "Poppins";
131
+ font-family: "Helvetica Neue", Arial;
132
+ }
133
+
134
+ #outer-select-container {
135
+ position: relative;
114
136
  }
115
137
 
116
138
  #select {
117
139
  width: -webkit-fill-available;
118
- height: 49px;
119
140
  display: flex;
120
141
  align-items: center;
121
142
  justify-content: space-between;
122
143
  color: rgba(32, 32, 32, 0.5);
144
+
145
+ white-space: nowrap;
146
+ overflow: hidden;
147
+ text-overflow: ellipsis;
123
148
  }
124
149
 
125
150
  ::-webkit-scrollbar {
@@ -167,10 +192,14 @@ export class MESelect extends LitElement {
167
192
  };
168
193
  render(): TemplateResult {
169
194
  return html`
170
- <div>
195
+ <div id="outer-select-container">
171
196
  <div
172
197
  id="select"
173
- class="webchat-input"
198
+ class=${classMap({
199
+ ["webchat-input"]: true,
200
+ ["webchat-font__desktop"]: !isMobile(),
201
+ ["webchat-font__mobile"]: isMobile(),
202
+ })}
174
203
  tabindex="0"
175
204
  @click=${() => (this.isOpen = !this.isOpen)}
176
205
  @keydown="${(e: KeyboardEvent) => {
@@ -195,28 +224,26 @@ export class MESelect extends LitElement {
195
224
  break;
196
225
  case "ArrowUp":
197
226
  e.preventDefault();
198
- if (this.isOpen && this.activeOption) {
199
- if (this.options.indexOf(this.activeOption) > 0) {
200
- this.activeOption =
201
- this.options[this.options.indexOf(this.activeOption) - 1];
202
- } else {
203
- this.activeOption = null;
204
- }
227
+ if (this.isOpen && this.activeOptionIndex != null) {
228
+ this.activeOptionIndex = Math.max(
229
+ 0,
230
+ this.activeOptionIndex - 1
231
+ );
232
+ this.activeOption = this.options[this.activeOptionIndex];
233
+ this.adjustScrollToActiveOption();
205
234
  }
206
235
  break;
236
+
207
237
  case "ArrowDown":
208
238
  e.preventDefault();
209
239
  if (this.isOpen) {
210
- if (!this.activeOption) {
211
- this.activeOption = this.options[0];
212
- } else if (
213
- this.activeOption &&
214
- this.options.indexOf(this.activeOption) <
215
- this.options.length - 1
216
- ) {
217
- this.activeOption =
218
- this.options[this.options.indexOf(this.activeOption) + 1];
240
+ if (this.activeOptionIndex == null) {
241
+ this.activeOptionIndex = 0;
242
+ } else if (this.activeOptionIndex < this.options.length - 1) {
243
+ this.activeOptionIndex++;
219
244
  }
245
+ this.activeOption = this.options[this.activeOptionIndex];
246
+ this.adjustScrollToActiveOption();
220
247
  }
221
248
  break;
222
249
  }
@@ -0,0 +1,28 @@
1
+ import { css, html, LitElement, TemplateResult } from "lit";
2
+ import { customElement } from "lit/decorators.js";
3
+ @customElement("mini-loader")
4
+ export class MiniLoader extends LitElement {
5
+ static styles = css`
6
+ .spinner {
7
+ border: 2px solid rgba(0, 0, 0, 0.2);
8
+ border-top: 2px solid #c057ff;
9
+ border-radius: 50%;
10
+ width: 6px;
11
+ height: 6px;
12
+ animation: spin 0.4s linear infinite;
13
+ }
14
+
15
+ @keyframes spin {
16
+ 0% {
17
+ transform: rotate(0deg);
18
+ }
19
+ 100% {
20
+ transform: rotate(360deg);
21
+ }
22
+ }
23
+ `;
24
+
25
+ render(): TemplateResult {
26
+ return html`<div class="spinner"></div>`;
27
+ }
28
+ }
@@ -0,0 +1,192 @@
1
+ import { css } from "lit";
2
+
3
+ export const pubnubChatStyles = css`
4
+ #header-text {
5
+ font-size: 12px;
6
+ font-weight: 700;
7
+ line-height: 18px;
8
+ letter-spacing: 0em;
9
+ text-align: left;
10
+ }
11
+ #header-subtext {
12
+ font-size: 12px;
13
+ font-weight: light;
14
+ line-height: 18px;
15
+ letter-spacing: 0em;
16
+ text-align: left;
17
+ color: #737373;
18
+ }
19
+ #exit-chat-bttn {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ background: none;
24
+ border: none;
25
+ cursor: pointer;
26
+ }
27
+ #conversation-body {
28
+ flex: 1;
29
+ width: 100%;
30
+ height: 100%;
31
+ overflow-y: scroll;
32
+ }
33
+
34
+ #message-thread-list {
35
+ display: flex;
36
+ flex-direction: column;
37
+ position: relative;
38
+ padding: 0px 16px;
39
+ gap: 12px;
40
+ list-style: none;
41
+ }
42
+ .lead-message {
43
+ background: black;
44
+ border-radius: 8px 8px 0px 8px;
45
+
46
+ align-self: flex-end;
47
+ color: white;
48
+
49
+ box-shadow: 0px 18.048254013061523px 75.2010498046875px 0px #d9d9d91a;
50
+ box-shadow: 0px 1.7331933975219727px 2.599790096282959px 0px #0000000a;
51
+ }
52
+ .message-container {
53
+ display: flex;
54
+ padding: 6px;
55
+ width: fit-content;
56
+ max-width: calc(100% - 60px);
57
+ box-sizing: border-box;
58
+ }
59
+ .ai-message {
60
+ background: white;
61
+ border-radius: 10px 10px 10px 0px;
62
+ color: black;
63
+ box-shadow: 0px 18.048254013061523px 75.2010498046875px 0px #d9d9d91a;
64
+ box-shadow: 0px 1.7331933975219727px 2.599790096282959px 0px #0000000a;
65
+ }
66
+
67
+ .with-box-shadow {
68
+ box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.05);
69
+ }
70
+ .message-text {
71
+ word-break: break-word;
72
+ margin: 0;
73
+ padding: 6px 12px;
74
+ line-height: 130%;
75
+
76
+ font-size: 12px;
77
+ font-weight: 400;
78
+ line-height: 17px;
79
+ letter-spacing: 0em;
80
+ text-align: left;
81
+ }
82
+ .displayed-message-image {
83
+ max-width: 100%;
84
+ max-height: 300px;
85
+ width: auto;
86
+ height: auto;
87
+ }
88
+ .displayed-message-image-error {
89
+ display: none;
90
+ }
91
+ .redirect-link {
92
+ color: inherit;
93
+ }
94
+
95
+ #loading-message {
96
+ padding: 12px;
97
+ }
98
+ .loading-dot {
99
+ width: 4px;
100
+ height: 4px;
101
+ border-radius: 50%;
102
+ margin: 5px;
103
+ animation: pulse 4s linear infinite;
104
+ }
105
+
106
+ .dot-1 {
107
+ background-color: #7d7d7d;
108
+ animation-delay: 0s;
109
+ }
110
+
111
+ .dot-2 {
112
+ background-color: #7d7d7d;
113
+ animation-delay: 1s;
114
+ }
115
+
116
+ .dot-3 {
117
+ background-color: #7d7d7d;
118
+ animation-delay: 2s;
119
+ }
120
+
121
+ @keyframes pulse {
122
+ 0% {
123
+ background-color: #7d7d7d;
124
+ transform: scale(1);
125
+ }
126
+ 50% {
127
+ background-color: #c7c7c7;
128
+ transform: scale(2);
129
+ }
130
+ 100% {
131
+ background-color: #7d7d7d;
132
+ transform: scale(1);
133
+ }
134
+ }
135
+
136
+ .hidden {
137
+ display: none !important;
138
+ }
139
+
140
+ .legal-confirmation-container {
141
+ display: flex;
142
+ flex-direction: column;
143
+ gap: 16px;
144
+ font-size: 14px;
145
+ line-height: 22px;
146
+ flex: 1;
147
+ width: 100%;
148
+ height: 100%;
149
+ background: #f5f5f5;
150
+ overflow-y: scroll;
151
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
152
+ border-bottom: 6px solid black;
153
+
154
+ padding: 12px;
155
+ box-sizing: border-box;
156
+ }
157
+
158
+ .legal-confirmation-inner-container {
159
+ margin: 0 16px;
160
+ }
161
+
162
+ .privacy-policy-link {
163
+ color: blue;
164
+ }
165
+
166
+ .agreeButton {
167
+ background: #000;
168
+ border-radius: 20px;
169
+ color: #fff;
170
+ padding: 8px 16px;
171
+ border: none;
172
+ cursor: pointer;
173
+ width: fit-content;
174
+ }
175
+
176
+ .confirmation-with-checkbox {
177
+ display: flex;
178
+ align: center;
179
+ justify-content: center;
180
+ gap: 12px;
181
+ }
182
+
183
+ .checkbox {
184
+ display: flex;
185
+ align-items: center;
186
+ justify-content: center;
187
+ cursor: pointer;
188
+ }
189
+ .checkbox:hover {
190
+ opacity: 0.5;
191
+ }
192
+ `;