@meetelise/chat 1.9.0 → 1.9.1
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/CONTRIBUTING.md +2 -0
- package/README.md +13 -0
- package/package.json +1 -1
- package/public/dist/index.js +1 -1
- package/public/dist/src/ChatButton.d.ts +9 -0
- package/public/dist/src/ChatIcon.d.ts +6 -0
- package/public/dist/src/InHouseLauncher.d.ts +1 -0
- package/public/dist/src/MEChat.d.ts +2 -0
- package/public/index.html +37 -37
- package/src/ChatButton.module.scss +52 -0
- package/src/ChatButton.tsx +26 -0
- package/src/ChatIcon.tsx +26 -0
- package/src/DemoApp.tsx +1 -0
- package/src/InHouseLauncher.module.scss +75 -75
- package/src/InHouseLauncher.tsx +23 -17
- package/src/MEChat.tsx +11 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ChatButtonProps {
|
|
3
|
+
text: string;
|
|
4
|
+
onClick?: React.MouseEventHandler;
|
|
5
|
+
className?: string;
|
|
6
|
+
useGlowingBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const ChatButton: React.FunctionComponent<ChatButtonProps>;
|
|
9
|
+
export default ChatButton;
|
|
@@ -60,6 +60,7 @@ export default class MEChat {
|
|
|
60
60
|
private chatId;
|
|
61
61
|
private analytics;
|
|
62
62
|
private useInHouseLauncher;
|
|
63
|
+
private useMiniWidget;
|
|
63
64
|
private isMobile;
|
|
64
65
|
private constructor();
|
|
65
66
|
}
|
|
@@ -68,4 +69,5 @@ export interface Options {
|
|
|
68
69
|
organization: string;
|
|
69
70
|
themeId?: ThemeIdString;
|
|
70
71
|
avatarSrc?: string;
|
|
72
|
+
mini?: boolean;
|
|
71
73
|
}
|
package/public/index.html
CHANGED
|
@@ -50,10 +50,6 @@
|
|
|
50
50
|
font-family: monospace;
|
|
51
51
|
font-size: 1.5em;
|
|
52
52
|
}
|
|
53
|
-
.meetelise-chat.launcher {
|
|
54
|
-
bottom: -12px;
|
|
55
|
-
right: 100px;
|
|
56
|
-
}
|
|
57
53
|
.meetelise-chat.pane {
|
|
58
54
|
bottom: 48px;
|
|
59
55
|
right: 75px;
|
|
@@ -92,43 +88,47 @@
|
|
|
92
88
|
organization: "test-company",
|
|
93
89
|
building: "e2e-test-yardi-building",
|
|
94
90
|
});
|
|
95
|
-
|
|
96
|
-
// The above code is all a client would need.
|
|
97
|
-
// Below is some code to make local dev easier.
|
|
98
|
-
|
|
91
|
+
//////////////////////////////////////////////////////////////////
|
|
92
|
+
// The above code is all a client would need. //
|
|
93
|
+
// Below is some code to make local dev easier. //
|
|
94
|
+
// Comment out `localDevHelper();` if you don't want to use it. //
|
|
95
|
+
//////////////////////////////////////////////////////////////////
|
|
99
96
|
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
const localDevHelper = () => {
|
|
98
|
+
// Put the chat instance on window so it's available in the console.
|
|
99
|
+
window.chat = chat;
|
|
102
100
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
// Reset on button click
|
|
102
|
+
document.getElementById("reset").addEventListener("click", () => {
|
|
103
|
+
chat.restartConversation();
|
|
104
|
+
});
|
|
105
|
+
const onChange = debounce((e) => {
|
|
106
|
+
chat.setTheme({ [e.target.name]: e.target.value });
|
|
107
|
+
}, 300);
|
|
108
|
+
document.querySelectorAll("#theme input").forEach((input) => {
|
|
109
|
+
input.addEventListener("input", onChange);
|
|
110
|
+
});
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
// Open the chat window shortly after the page loads/refreshes.
|
|
113
|
+
setTimeout(() => chat.open(), 1000);
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
115
|
+
// Every x seconds, cycle through ui states. Close the window and
|
|
116
|
+
// remove the button from the screen, then show it and open the
|
|
117
|
+
// window. Set the DEBUG_cycle_ui_states boolean to false to disable.
|
|
118
|
+
let DEBUG_cycle_ui_states = false;
|
|
119
|
+
const period_seconds = 30;
|
|
120
|
+
if (DEBUG_cycle_ui_states) {
|
|
121
|
+
let seconds = 0;
|
|
122
|
+
setInterval(() => {
|
|
123
|
+
seconds = (seconds + 1) % period_seconds;
|
|
124
|
+
if (seconds === period_seconds - 4) chat.close();
|
|
125
|
+
if (seconds === period_seconds - 3) chat.hide();
|
|
126
|
+
if (seconds === period_seconds - 2) chat.show();
|
|
127
|
+
if (seconds === period_seconds - 1) chat.open();
|
|
128
|
+
}, 1000);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// localDevHelper();
|
|
132
132
|
</script>
|
|
133
133
|
</body>
|
|
134
134
|
</html>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap");
|
|
2
|
+
|
|
3
|
+
$borderRadius: 40px;
|
|
4
|
+
$glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar-Shadow.gif");
|
|
5
|
+
|
|
6
|
+
.chatButton {
|
|
7
|
+
// CSS reset
|
|
8
|
+
all: unset;
|
|
9
|
+
/* `all:revert` does stuff to SVG properties that is maybe explained here (https://stackoverflow.com/a/46760690).
|
|
10
|
+
In our case it prevents the chat icon from being white. */
|
|
11
|
+
*:not(svg, svg *) {
|
|
12
|
+
all: revert;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
font-family: Poppins;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
background-color: #202020;
|
|
19
|
+
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
|
|
20
|
+
border: 2px solid white;
|
|
21
|
+
border-radius: $borderRadius;
|
|
22
|
+
color: white;
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
font-size: 20px;
|
|
25
|
+
padding: 2px 15px;
|
|
26
|
+
margin-right: 7px;
|
|
27
|
+
user-select: none;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// TODO: the CSS reset undoes these styles. Figure out a better solution than !important on everything
|
|
32
|
+
// Possibly a specificity issue: things were working before commit 03f8503 split ChatButton out from InHouseLauncher
|
|
33
|
+
.chatButtonGlowingBorder {
|
|
34
|
+
position: absolute !important;
|
|
35
|
+
top: 50% !important;
|
|
36
|
+
left: 50% !important;
|
|
37
|
+
transform: translate(-50%, -50%) !important;
|
|
38
|
+
z-index: -1 !important;
|
|
39
|
+
background-image: $glowBarGif !important;
|
|
40
|
+
border-radius: $borderRadius !important;
|
|
41
|
+
height: 125% !important;
|
|
42
|
+
width: 108% !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.chatButtonWord {
|
|
46
|
+
margin-left: 7px !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.headerText {
|
|
50
|
+
font-weight: 600 !important;
|
|
51
|
+
font-size: 20px !important;
|
|
52
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ChatIcon from "./ChatIcon";
|
|
3
|
+
import styles from "./ChatButton.module.scss";
|
|
4
|
+
import classnames from "classnames";
|
|
5
|
+
|
|
6
|
+
interface ChatButtonProps {
|
|
7
|
+
text: string;
|
|
8
|
+
onClick?: React.MouseEventHandler;
|
|
9
|
+
className?: string;
|
|
10
|
+
useGlowingBorder?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ChatButton: React.FunctionComponent<ChatButtonProps> = ({
|
|
14
|
+
text,
|
|
15
|
+
onClick,
|
|
16
|
+
className,
|
|
17
|
+
useGlowingBorder = false,
|
|
18
|
+
}: ChatButtonProps) => (
|
|
19
|
+
<div className={classnames(styles.chatButton, className)} onClick={onClick}>
|
|
20
|
+
{useGlowingBorder && <div className={styles.chatButtonGlowingBorder}></div>}
|
|
21
|
+
<ChatIcon />
|
|
22
|
+
<span className={styles.chatButtonWord}>{text}</span>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default ChatButton;
|
package/src/ChatIcon.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
interface ChatIconProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const ChatIcon: React.FunctionComponent<ChatIconProps> = ({
|
|
8
|
+
className,
|
|
9
|
+
}: ChatIconProps) => (
|
|
10
|
+
<svg
|
|
11
|
+
className={className}
|
|
12
|
+
style={{ height: "14px" }}
|
|
13
|
+
width="24"
|
|
14
|
+
height="24"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
>
|
|
19
|
+
<path
|
|
20
|
+
d="M13.2 10.8H6C5.68174 10.8 5.37652 10.9264 5.15147 11.1515C4.92643 11.3765 4.8 11.6817 4.8 12C4.8 12.3183 4.92643 12.6235 5.15147 12.8485C5.37652 13.0736 5.68174 13.2 6 13.2H13.2C13.5183 13.2 13.8235 13.0736 14.0485 12.8485C14.2736 12.6235 14.4 12.3183 14.4 12C14.4 11.6817 14.2736 11.3765 14.0485 11.1515C13.8235 10.9264 13.5183 10.8 13.2 10.8ZM18 6H6C5.68174 6 5.37652 6.12643 5.15147 6.35147C4.92643 6.57652 4.8 6.88174 4.8 7.2C4.8 7.51826 4.92643 7.82348 5.15147 8.04853C5.37652 8.27357 5.68174 8.4 6 8.4H18C18.3183 8.4 18.6235 8.27357 18.8485 8.04853C19.0736 7.82348 19.2 7.51826 19.2 7.2C19.2 6.88174 19.0736 6.57652 18.8485 6.35147C18.6235 6.12643 18.3183 6 18 6ZM20.4 0H3.6C2.64522 0 1.72955 0.379285 1.05442 1.05442C0.379285 1.72955 0 2.64522 0 3.6V15.6C0 16.5548 0.379285 17.4705 1.05442 18.1456C1.72955 18.8207 2.64522 19.2 3.6 19.2H17.508L21.948 23.652C22.0601 23.7632 22.1931 23.8512 22.3393 23.9109C22.4855 23.9706 22.6421 24.0009 22.8 24C22.9574 24.0041 23.1136 23.9712 23.256 23.904C23.4751 23.814 23.6627 23.6611 23.7951 23.4646C23.9275 23.2682 23.9988 23.0369 24 22.8V3.6C24 2.64522 23.6207 1.72955 22.9456 1.05442C22.2705 0.379285 21.3548 0 20.4 0ZM21.6 19.908L18.852 17.148C18.7399 17.0368 18.6069 16.9488 18.4607 16.8891C18.3145 16.8294 18.1579 16.7991 18 16.8H3.6C3.28174 16.8 2.97652 16.6736 2.75147 16.4485C2.52643 16.2235 2.4 15.9183 2.4 15.6V3.6C2.4 3.28174 2.52643 2.97652 2.75147 2.75147C2.97652 2.52643 3.28174 2.4 3.6 2.4H20.4C20.7183 2.4 21.0235 2.52643 21.2485 2.75147C21.4736 2.97652 21.6 3.28174 21.6 3.6V19.908Z"
|
|
21
|
+
fill="white"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default ChatIcon;
|
package/src/DemoApp.tsx
CHANGED
|
@@ -3,25 +3,49 @@
|
|
|
3
3
|
$glowBarHeight: 11.2px;
|
|
4
4
|
$enterAnimationDuration: 0.5s;
|
|
5
5
|
$glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar-Shadow.gif");
|
|
6
|
+
$desktopZIndex: 100000; // on desktop, since the widget is small, it's ok to appear above a cookie banner
|
|
7
|
+
|
|
8
|
+
@keyframes slideInFromRight {
|
|
9
|
+
from {
|
|
10
|
+
transform: translateX(100%);
|
|
11
|
+
}
|
|
12
|
+
to {
|
|
13
|
+
transform: translateX(0);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
6
16
|
|
|
7
17
|
.launcher {
|
|
8
18
|
// CSS reset
|
|
9
19
|
all: initial;
|
|
10
|
-
//
|
|
11
|
-
*:not(.
|
|
20
|
+
// we want to isolate the app from the host page's styles, but not undo our own subcomponents' styles
|
|
21
|
+
*:not(svg, svg *, :global(.excludeFromReset)) {
|
|
12
22
|
all: revert;
|
|
13
23
|
}
|
|
14
24
|
|
|
25
|
+
&:not(.miniLauncher) {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-evenly;
|
|
28
|
+
align-items: center;
|
|
29
|
+
background-color: rgba(white, 0.8);
|
|
30
|
+
color: #202020;
|
|
31
|
+
backdrop-filter: blur(10px);
|
|
32
|
+
box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
|
|
33
|
+
|
|
34
|
+
&.mobile {
|
|
35
|
+
width: 100%;
|
|
36
|
+
bottom: 0px;
|
|
37
|
+
padding: 5px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.desktop {
|
|
41
|
+
width: 272px;
|
|
42
|
+
height: 112px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
font-family: Poppins;
|
|
15
47
|
user-select: none;
|
|
16
48
|
position: fixed;
|
|
17
|
-
display: flex;
|
|
18
|
-
justify-content: space-evenly;
|
|
19
|
-
align-items: center;
|
|
20
|
-
color: #202020;
|
|
21
|
-
background-color: rgba(white, 0.8);
|
|
22
|
-
backdrop-filter: blur(10px);
|
|
23
|
-
box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
|
|
24
|
-
font-family: Poppins;
|
|
25
49
|
|
|
26
50
|
&:hover {
|
|
27
51
|
background: radial-gradient(
|
|
@@ -31,40 +55,15 @@ $glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar
|
|
|
31
55
|
);
|
|
32
56
|
}
|
|
33
57
|
|
|
34
|
-
&.mobile {
|
|
35
|
-
width: 100%;
|
|
36
|
-
bottom: 0px;
|
|
37
|
-
padding: 5px;
|
|
38
|
-
|
|
39
|
-
.content {
|
|
40
|
-
margin-top: calc($glowBarHeight + 8px);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
58
|
&.desktop {
|
|
45
|
-
width: 272px;
|
|
46
|
-
height: 112px;
|
|
47
59
|
right: 0px;
|
|
48
60
|
overflow: hidden;
|
|
49
61
|
border-radius: 10px 0px 0px 10px;
|
|
50
62
|
bottom: 40px;
|
|
51
|
-
z-index:
|
|
52
|
-
|
|
53
|
-
.content {
|
|
54
|
-
margin-top: calc($glowBarHeight);
|
|
55
|
-
}
|
|
63
|
+
z-index: $desktopZIndex;
|
|
56
64
|
|
|
57
65
|
&.firstMount {
|
|
58
|
-
animation:
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@keyframes slideIn {
|
|
62
|
-
from {
|
|
63
|
-
transform: translateX(100%);
|
|
64
|
-
}
|
|
65
|
-
to {
|
|
66
|
-
transform: translateX(0);
|
|
67
|
-
}
|
|
66
|
+
animation: slideInFromRight $enterAnimationDuration;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
|
|
@@ -77,55 +76,23 @@ $glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar
|
|
|
77
76
|
left: 0;
|
|
78
77
|
height: $glowBarHeight;
|
|
79
78
|
width: 100%;
|
|
79
|
+
|
|
80
|
+
& + * {
|
|
81
|
+
margin-top: calc($glowBarHeight + 8px);
|
|
82
|
+
}
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
.content {
|
|
83
86
|
display: flex;
|
|
84
87
|
flex-direction: column;
|
|
85
88
|
align-items: center;
|
|
89
|
+
gap: 10px;
|
|
86
90
|
margin-bottom: 6px;
|
|
87
91
|
|
|
88
92
|
.header {
|
|
89
93
|
display: flex;
|
|
90
94
|
align-items: center;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
$borderRadius: 40px;
|
|
94
|
-
|
|
95
|
-
.chatButton {
|
|
96
|
-
position: relative;
|
|
97
|
-
display: flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
background-color: #202020;
|
|
100
|
-
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
|
|
101
|
-
border: 2px solid white;
|
|
102
|
-
border-radius: $borderRadius;
|
|
103
|
-
color: white;
|
|
104
|
-
font-weight: 700;
|
|
105
|
-
font-size: 20px;
|
|
106
|
-
padding: 2px 15px;
|
|
107
|
-
margin-right: 7px;
|
|
108
|
-
|
|
109
|
-
.chatButtonGlowingBorder {
|
|
110
|
-
position: absolute;
|
|
111
|
-
top: 50%;
|
|
112
|
-
left: 50%;
|
|
113
|
-
transform: translate(-50%, -50%);
|
|
114
|
-
z-index: -1;
|
|
115
|
-
background-image: $glowBarGif;
|
|
116
|
-
border-radius: $borderRadius;
|
|
117
|
-
height: 125%;
|
|
118
|
-
width: 108%;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.chatIcon {
|
|
122
|
-
height: 14px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.chatButtonWord {
|
|
126
|
-
margin-left: 7px;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
95
|
+
|
|
129
96
|
.headerText {
|
|
130
97
|
font-weight: 600;
|
|
131
98
|
font-size: 20px;
|
|
@@ -138,3 +105,36 @@ $glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar
|
|
|
138
105
|
}
|
|
139
106
|
}
|
|
140
107
|
}
|
|
108
|
+
|
|
109
|
+
.miniLauncher {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
background-color: #202020;
|
|
113
|
+
position: fixed;
|
|
114
|
+
height: 35px;
|
|
115
|
+
|
|
116
|
+
&:hover {
|
|
117
|
+
background: radial-gradient(
|
|
118
|
+
36.85% 65.32% at 50% 106.31%,
|
|
119
|
+
#03ecc4 0%,
|
|
120
|
+
rgba(131, 129, 142, 1) 100%
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.firstMount {
|
|
125
|
+
animation: slideInFromRight $enterAnimationDuration;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&.desktop {
|
|
129
|
+
padding-right: 20px;
|
|
130
|
+
right: 0px;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
bottom: 40px;
|
|
133
|
+
z-index: $desktopZIndex;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&.mobile {
|
|
137
|
+
right: 10px;
|
|
138
|
+
bottom: 20px;
|
|
139
|
+
}
|
|
140
|
+
}
|
package/src/InHouseLauncher.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
+
import ChatButton from "./ChatButton";
|
|
3
4
|
import styles from "./InHouseLauncher.module.scss";
|
|
4
5
|
|
|
5
6
|
interface InHouseLauncherProps {
|
|
@@ -8,6 +9,7 @@ interface InHouseLauncherProps {
|
|
|
8
9
|
firstMount: boolean;
|
|
9
10
|
backgroundColor: string;
|
|
10
11
|
textColor: string;
|
|
12
|
+
mini: boolean;
|
|
11
13
|
}
|
|
12
14
|
const InHouseLauncher: React.FunctionComponent<InHouseLauncherProps> = ({
|
|
13
15
|
onChatTapped,
|
|
@@ -15,7 +17,23 @@ const InHouseLauncher: React.FunctionComponent<InHouseLauncherProps> = ({
|
|
|
15
17
|
firstMount,
|
|
16
18
|
backgroundColor,
|
|
17
19
|
textColor,
|
|
20
|
+
mini,
|
|
18
21
|
}) => {
|
|
22
|
+
if (mini) {
|
|
23
|
+
return (
|
|
24
|
+
<ChatButton
|
|
25
|
+
className={classnames(
|
|
26
|
+
styles.miniLauncher,
|
|
27
|
+
"excludeFromReset",
|
|
28
|
+
mobile ? styles.mobile : styles.desktop,
|
|
29
|
+
{ [styles.firstMount]: firstMount }
|
|
30
|
+
)}
|
|
31
|
+
text="Ask a question"
|
|
32
|
+
onClick={onChatTapped}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
19
37
|
return (
|
|
20
38
|
<div
|
|
21
39
|
className={classnames(
|
|
@@ -29,23 +47,11 @@ const InHouseLauncher: React.FunctionComponent<InHouseLauncherProps> = ({
|
|
|
29
47
|
<div className={styles.glowBar}></div>
|
|
30
48
|
<div className={styles.content}>
|
|
31
49
|
<div className={styles.header}>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
height="24"
|
|
38
|
-
viewBox="0 0 24 24"
|
|
39
|
-
fill="none"
|
|
40
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
-
>
|
|
42
|
-
<path
|
|
43
|
-
d="M13.2 10.8H6C5.68174 10.8 5.37652 10.9264 5.15147 11.1515C4.92643 11.3765 4.8 11.6817 4.8 12C4.8 12.3183 4.92643 12.6235 5.15147 12.8485C5.37652 13.0736 5.68174 13.2 6 13.2H13.2C13.5183 13.2 13.8235 13.0736 14.0485 12.8485C14.2736 12.6235 14.4 12.3183 14.4 12C14.4 11.6817 14.2736 11.3765 14.0485 11.1515C13.8235 10.9264 13.5183 10.8 13.2 10.8ZM18 6H6C5.68174 6 5.37652 6.12643 5.15147 6.35147C4.92643 6.57652 4.8 6.88174 4.8 7.2C4.8 7.51826 4.92643 7.82348 5.15147 8.04853C5.37652 8.27357 5.68174 8.4 6 8.4H18C18.3183 8.4 18.6235 8.27357 18.8485 8.04853C19.0736 7.82348 19.2 7.51826 19.2 7.2C19.2 6.88174 19.0736 6.57652 18.8485 6.35147C18.6235 6.12643 18.3183 6 18 6ZM20.4 0H3.6C2.64522 0 1.72955 0.379285 1.05442 1.05442C0.379285 1.72955 0 2.64522 0 3.6V15.6C0 16.5548 0.379285 17.4705 1.05442 18.1456C1.72955 18.8207 2.64522 19.2 3.6 19.2H17.508L21.948 23.652C22.0601 23.7632 22.1931 23.8512 22.3393 23.9109C22.4855 23.9706 22.6421 24.0009 22.8 24C22.9574 24.0041 23.1136 23.9712 23.256 23.904C23.4751 23.814 23.6627 23.6611 23.7951 23.4646C23.9275 23.2682 23.9988 23.0369 24 22.8V3.6C24 2.64522 23.6207 1.72955 22.9456 1.05442C22.2705 0.379285 21.3548 0 20.4 0ZM21.6 19.908L18.852 17.148C18.7399 17.0368 18.6069 16.9488 18.4607 16.8891C18.3145 16.8294 18.1579 16.7991 18 16.8H3.6C3.28174 16.8 2.97652 16.6736 2.75147 16.4485C2.52643 16.2235 2.4 15.9183 2.4 15.6V3.6C2.4 3.28174 2.52643 2.97652 2.75147 2.75147C2.97652 2.52643 3.28174 2.4 3.6 2.4H20.4C20.7183 2.4 21.0235 2.52643 21.2485 2.75147C21.4736 2.97652 21.6 3.28174 21.6 3.6V19.908Z"
|
|
44
|
-
fill="white"
|
|
45
|
-
/>
|
|
46
|
-
</svg>
|
|
47
|
-
<span className={styles.chatButtonWord}>Ask</span>
|
|
48
|
-
</div>
|
|
50
|
+
<ChatButton
|
|
51
|
+
text="Ask"
|
|
52
|
+
useGlowingBorder
|
|
53
|
+
className={"excludeFromReset"}
|
|
54
|
+
/>
|
|
49
55
|
<span className={styles.headerText}>a question</span>
|
|
50
56
|
</div>
|
|
51
57
|
<span className={styles.subtitle}>
|
package/src/MEChat.tsx
CHANGED
|
@@ -159,6 +159,7 @@ export default class MEChat {
|
|
|
159
159
|
firstMount={firstMount}
|
|
160
160
|
backgroundColor={(await this.theme).chatPaneBackgroundColor}
|
|
161
161
|
textColor={(await this.theme).chatHeader.textColor}
|
|
162
|
+
mini={this.useMiniWidget}
|
|
162
163
|
/>,
|
|
163
164
|
targetElement
|
|
164
165
|
);
|
|
@@ -191,9 +192,16 @@ export default class MEChat {
|
|
|
191
192
|
private chatId: string;
|
|
192
193
|
private analytics: Analytics;
|
|
193
194
|
private useInHouseLauncher: boolean;
|
|
195
|
+
private useMiniWidget: boolean;
|
|
194
196
|
private isMobile: boolean;
|
|
195
197
|
|
|
196
|
-
private constructor({
|
|
198
|
+
private constructor({
|
|
199
|
+
organization,
|
|
200
|
+
building,
|
|
201
|
+
themeId,
|
|
202
|
+
avatarSrc,
|
|
203
|
+
mini = false,
|
|
204
|
+
}: Options) {
|
|
197
205
|
this.orgSlug = organization;
|
|
198
206
|
this.buildingSlug = building;
|
|
199
207
|
this.chatId = getChatID(organization, building);
|
|
@@ -208,6 +216,7 @@ export default class MEChat {
|
|
|
208
216
|
(building) => avatarSrc || building.avatarSrc
|
|
209
217
|
);
|
|
210
218
|
this.useInHouseLauncher = true;
|
|
219
|
+
this.useMiniWidget = mini;
|
|
211
220
|
this.isMobile = isMobile();
|
|
212
221
|
|
|
213
222
|
this.popup = Promise.all([
|
|
@@ -280,4 +289,5 @@ export interface Options {
|
|
|
280
289
|
organization: string;
|
|
281
290
|
themeId?: ThemeIdString;
|
|
282
291
|
avatarSrc?: string;
|
|
292
|
+
mini?: boolean;
|
|
283
293
|
}
|