@meetelise/chat 1.20.63 → 1.20.65
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 +1 -1
- package/public/demo/index.html +1 -0
- package/public/dist/index.js +620 -714
- package/public/dist/index.js.LICENSE.txt +0 -6
- package/src/MEChat.ts +11 -1
- package/src/WebComponent/Scheduler/tour-scheduler.ts +22 -20
- package/src/WebComponent/actions/minimize-expand-button.ts +92 -0
- package/src/WebComponent/index.ts +1 -1
- package/src/WebComponent/launcher/Launcher.ts +586 -0
- package/src/WebComponent/{launcherStyles.ts → launcher/launcherStyles.ts} +4 -329
- package/src/WebComponent/launcher/mobile-launcher.ts +95 -0
- package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
- package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
- package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
- package/src/WebComponent/me-chat.ts +99 -93
- package/src/WebComponent/me-select.ts +4 -0
- package/src/fetchBuildingABTestType.ts +2 -2
- package/src/fetchWebchatPreferences.ts +28 -0
- package/src/svgIcons.ts +26 -146
- package/src/themes.ts +24 -7
- package/src/utils.ts +53 -0
- package/src/WebComponent/Launcher.ts +0 -641
package/src/MEChat.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { StyleInfo } from "lit/directives/style-map";
|
|
3
3
|
import { ThemeIdString } from "./themes";
|
|
4
|
+
import { tintColor } from "./utils";
|
|
4
5
|
import "./WebComponent/me-chat";
|
|
5
6
|
import { MEChat as MEChatLitElement } from "./WebComponent/me-chat";
|
|
6
7
|
|
|
@@ -22,6 +23,7 @@ export default class MEChat {
|
|
|
22
23
|
static mutationObserver: MutationObserver | null = null;
|
|
23
24
|
static previousUrl = "";
|
|
24
25
|
static hasBuildingSlug: boolean | null = null;
|
|
26
|
+
static brandColor = "";
|
|
25
27
|
|
|
26
28
|
static start(opts: Options, isInitialStart = true): void {
|
|
27
29
|
// If clients are Yardi and have a resident portal with rentcafe,
|
|
@@ -58,6 +60,12 @@ export default class MEChat {
|
|
|
58
60
|
if (opts.launcherStyles) {
|
|
59
61
|
meChat.launcherStyles = opts.launcherStyles;
|
|
60
62
|
}
|
|
63
|
+
if (opts.brandColor) {
|
|
64
|
+
this.brandColor = opts.brandColor;
|
|
65
|
+
|
|
66
|
+
// we must tint the brand color, to ensure it is visible
|
|
67
|
+
meChat.setAttribute("brandColor", tintColor(opts.brandColor, 0.3));
|
|
68
|
+
}
|
|
61
69
|
document.body.appendChild(meChat);
|
|
62
70
|
MEChat.meChat = meChat;
|
|
63
71
|
}
|
|
@@ -118,7 +126,7 @@ export default class MEChat {
|
|
|
118
126
|
}
|
|
119
127
|
this.remove();
|
|
120
128
|
const url = window.location.href;
|
|
121
|
-
const requestUrl = `https://app.meetelise.com/
|
|
129
|
+
const requestUrl = `https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(
|
|
122
130
|
url
|
|
123
131
|
)}`;
|
|
124
132
|
const buildingSlug = await axios.get<string | null>(requestUrl, {
|
|
@@ -130,6 +138,7 @@ export default class MEChat {
|
|
|
130
138
|
const opts = {
|
|
131
139
|
organization: this.orgSlug,
|
|
132
140
|
building: buildingSlug.data,
|
|
141
|
+
brandColor: this.brandColor,
|
|
133
142
|
};
|
|
134
143
|
this.start(opts, false);
|
|
135
144
|
}
|
|
@@ -142,6 +151,7 @@ export interface Options {
|
|
|
142
151
|
avatarSrc?: string;
|
|
143
152
|
mini?: boolean;
|
|
144
153
|
launcherStyles?: StyleInfo;
|
|
154
|
+
brandColor?: string;
|
|
145
155
|
}
|
|
146
156
|
|
|
147
157
|
/** You can't install a font from CSS in a shadow DOM, so we use JS to do it here in the regular DOM. */
|
|
@@ -1193,26 +1193,28 @@ export class TourScheduler extends LitElement {
|
|
|
1193
1193
|
i.layout === this.layoutTypeSelect.value
|
|
1194
1194
|
).length > 0
|
|
1195
1195
|
? html`
|
|
1196
|
-
<
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
.
|
|
1201
|
-
(
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1196
|
+
<div class="unitLayoutChoice">
|
|
1197
|
+
<me-select
|
|
1198
|
+
id="unitType"
|
|
1199
|
+
placeholder="Select unit"
|
|
1200
|
+
.options="${this.unitOptions
|
|
1201
|
+
.filter(
|
|
1202
|
+
(i) =>
|
|
1203
|
+
!this.layoutTypeSelect ||
|
|
1204
|
+
i.layout === this.layoutTypeSelect.value
|
|
1205
|
+
)
|
|
1206
|
+
.map((i) => ({
|
|
1207
|
+
label: i.name,
|
|
1208
|
+
value: i.name,
|
|
1209
|
+
}))}"
|
|
1210
|
+
defaultOption="Studio"
|
|
1211
|
+
@change=${() => {
|
|
1212
|
+
// to revalidate the form
|
|
1213
|
+
this.requestUpdate();
|
|
1214
|
+
}}
|
|
1215
|
+
>Studio
|
|
1216
|
+
</me-select>
|
|
1217
|
+
</div>
|
|
1216
1218
|
`
|
|
1217
1219
|
: ""
|
|
1218
1220
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
4
|
+
import { XWhiteOutlineIcon, ChevronIconWhite } from "../../svgIcons";
|
|
5
|
+
import { defaultBrandColor } from "../../themes";
|
|
6
|
+
|
|
7
|
+
@customElement("minimize-expand-button")
|
|
8
|
+
export class MinimizeExpandButton extends LitElement {
|
|
9
|
+
static styles = [
|
|
10
|
+
css`
|
|
11
|
+
.button-container {
|
|
12
|
+
width: 56px;
|
|
13
|
+
height: 56px;
|
|
14
|
+
|
|
15
|
+
background: #ffffff;
|
|
16
|
+
border: 1px solid rgba(95, 95, 95, 0.2);
|
|
17
|
+
border-radius: 1000px;
|
|
18
|
+
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
.mini {
|
|
24
|
+
width: 36px;
|
|
25
|
+
height: 36px;
|
|
26
|
+
}
|
|
27
|
+
.inner-container {
|
|
28
|
+
width: 46px;
|
|
29
|
+
height: 46px;
|
|
30
|
+
|
|
31
|
+
border-radius: 1000px;
|
|
32
|
+
border: 1px solid rgba(255, 255, 255, 0.7);
|
|
33
|
+
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
.mini > .inner-container {
|
|
40
|
+
width: 30px;
|
|
41
|
+
height: 30px;
|
|
42
|
+
}
|
|
43
|
+
.x-icon,
|
|
44
|
+
.chevron-up {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
border-radius: 1000px;
|
|
51
|
+
}
|
|
52
|
+
.chevron-up {
|
|
53
|
+
transform: rotate(-90deg);
|
|
54
|
+
}
|
|
55
|
+
.button-container:hover {
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
filter: brightness(90%);
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
@property({ attribute: true })
|
|
63
|
+
onClick: () => void = () => {
|
|
64
|
+
return;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
@property({ attribute: true })
|
|
68
|
+
brandColor: string = defaultBrandColor;
|
|
69
|
+
|
|
70
|
+
@property({ attribute: true })
|
|
71
|
+
toExpand = false;
|
|
72
|
+
|
|
73
|
+
render(): TemplateResult {
|
|
74
|
+
return html`
|
|
75
|
+
<div
|
|
76
|
+
class=${this.toExpand ? "button-container mini" : "button-container"}
|
|
77
|
+
@click=${this.onClick}
|
|
78
|
+
>
|
|
79
|
+
<div
|
|
80
|
+
class="inner-container"
|
|
81
|
+
style=${styleMap({
|
|
82
|
+
background: this.brandColor,
|
|
83
|
+
})}
|
|
84
|
+
>
|
|
85
|
+
${this.toExpand
|
|
86
|
+
? html`<div class="chevron-up">${ChevronIconWhite}</div>`
|
|
87
|
+
: html` <div class="x-icon">${XWhiteOutlineIcon}</div>`}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Launcher } from "./Launcher";
|
|
1
|
+
export { Launcher } from "./launcher/Launcher";
|
|
2
2
|
import "./me-chat";
|