shopify-chatbot-widget 0.9.7 → 0.9.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.
- package/dist/jaweb-chatbot.css +1 -1
- package/dist/jaweb-chatbot.iife.js +380 -133
- package/package.json +1 -1
- package/src/Chatbot/Chatbot.css +82 -171
- package/src/Chatbot/components/ChatInput.css +426 -114
- package/src/Chatbot/components/ChatInput.tsx +313 -219
- package/src/Chatbot/components/Messages/ChatMessages.css +17 -1
- package/src/Chatbot/components/Messages/ChatMessages.tsx +161 -192
- package/src/Chatbot/components/Messages/Typing.css +114 -11
- package/src/Chatbot/components/Messages/Typing.tsx +22 -8
- package/src/Chatbot/components/Messenger/Messenger.tsx +26 -27
- package/src/Chatbot/components/Sessions/RenderList.tsx +445 -141
- package/src/hooks/useChatbotAPI.tsx +2 -16
package/package.json
CHANGED
package/src/Chatbot/Chatbot.css
CHANGED
|
@@ -16,40 +16,89 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
position: fixed;
|
|
21
|
-
bottom: 5%;
|
|
22
|
-
right: 10px;
|
|
23
|
-
width: 28%;
|
|
24
|
-
top: 2%;
|
|
25
|
-
z-index: 9999;
|
|
26
|
-
height: 86%;
|
|
27
|
-
background: #ffffff;
|
|
28
|
-
color: #000000;
|
|
29
|
-
border-radius: 12px;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
|
34
|
-
font-family: 'Inter', sans-serif;
|
|
35
|
-
}
|
|
19
|
+
|
|
36
20
|
|
|
21
|
+
.chatbot-box {
|
|
22
|
+
position: fixed;
|
|
23
|
+
bottom: 20px;
|
|
24
|
+
right: 20px;
|
|
25
|
+
width: 420px;
|
|
26
|
+
max-width: 28%;
|
|
27
|
+
height: 85vh; /* 85% of viewport height */
|
|
28
|
+
max-height: 800px; /* Even taller max height */
|
|
29
|
+
z-index: 9999;
|
|
30
|
+
background: #ffffff;
|
|
31
|
+
color: #000000;
|
|
32
|
+
border-radius: 12px;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
|
37
|
+
font-family: 'Inter', sans-serif;
|
|
38
|
+
}
|
|
37
39
|
|
|
40
|
+
.chatbot-header {
|
|
41
|
+
background: #f7f7f7;
|
|
42
|
+
padding: 16px;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 12px;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
border-bottom: 1px solid #e0e0e0;
|
|
49
|
+
flex-shrink: 0; /* Prevent header from shrinking */
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.chatbot-messages {
|
|
53
|
+
flex: 1; /* Take remaining space */
|
|
54
|
+
padding: 16px;
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 12px;
|
|
59
|
+
background-color: #fafafa;
|
|
60
|
+
min-height: 0; /* Important for flex overflow */
|
|
38
61
|
|
|
62
|
+
scrollbar-width: none;
|
|
63
|
+
-ms-overflow-style: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.chatbot-messages::-webkit-scrollbar {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.chatbot-input-area {
|
|
71
|
+
width: 100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
align-items: center;
|
|
75
|
+
background: #ffffff;
|
|
76
|
+
border-top: 1px solid #e0e0e0;
|
|
77
|
+
padding: 12px;
|
|
78
|
+
flex-shrink: 0; /* Prevent input area from shrinking */
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (max-width: 768px) {
|
|
82
|
+
.chatbot-box {
|
|
83
|
+
position: fixed;
|
|
84
|
+
width: 100%;
|
|
85
|
+
max-width: 100%;
|
|
86
|
+
height: 100%;
|
|
87
|
+
max-height: 100%;
|
|
88
|
+
right: 0;
|
|
89
|
+
bottom: 0;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
border-radius: 0;
|
|
93
|
+
}
|
|
39
94
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.chatbot-header {
|
|
43
|
-
background: #f7f7f7;
|
|
44
|
-
padding: 16px;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
height: 8%;
|
|
48
|
-
gap: 12px;
|
|
49
|
-
font-size: 16px;
|
|
50
|
-
font-weight: bold;
|
|
51
|
-
border-bottom: 1px solid #e0e0e0;
|
|
95
|
+
.chat-launcher.chatbot-open {
|
|
96
|
+
display: none;
|
|
52
97
|
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
53
102
|
|
|
54
103
|
.chatbot-title {
|
|
55
104
|
flex-grow: 1;
|
|
@@ -60,28 +109,7 @@
|
|
|
60
109
|
font-size: 16px;
|
|
61
110
|
color: #888;
|
|
62
111
|
}
|
|
63
|
-
|
|
64
|
-
.chatbot-messages {
|
|
65
|
-
flex: 1;
|
|
66
|
-
padding: 16px;
|
|
67
|
-
overflow-y: auto;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
height: 70%;
|
|
71
|
-
gap: 12px;
|
|
72
|
-
background-color: #fafafa;
|
|
73
|
-
min-height: 70%;
|
|
74
|
-
|
|
75
|
-
/* Hide scrollbar for all browsers */
|
|
76
|
-
scrollbar-width: none; /* Firefox */
|
|
77
|
-
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/* Hide scrollbar for WebKit-based browsers (Chrome, Safari) */
|
|
81
|
-
.chatbot-messages::-webkit-scrollbar {
|
|
82
|
-
display: none;
|
|
83
|
-
}
|
|
84
|
-
|
|
112
|
+
|
|
85
113
|
|
|
86
114
|
.chat-msg {
|
|
87
115
|
max-width: 85%;
|
|
@@ -104,16 +132,7 @@
|
|
|
104
132
|
color: white;
|
|
105
133
|
}
|
|
106
134
|
|
|
107
|
-
|
|
108
|
-
width: 100%;
|
|
109
|
-
display: flex;
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
height:22%;
|
|
112
|
-
align-items: center;
|
|
113
|
-
background: #ffffff;
|
|
114
|
-
border-top: 1px solid #e0e0e0;
|
|
115
|
-
|
|
116
|
-
}
|
|
135
|
+
|
|
117
136
|
|
|
118
137
|
.typing-animation span {
|
|
119
138
|
display: inline-block;
|
|
@@ -138,121 +157,13 @@
|
|
|
138
157
|
/* brand color hook (optional) */
|
|
139
158
|
.jaweb-chatbot-container { --jaweb-color: #7f28f8; }
|
|
140
159
|
|
|
141
|
-
/* ===== NUDGE BUBBLE ===== */
|
|
142
|
-
.jaweb-nudge-bubble{
|
|
143
|
-
position:absolute;
|
|
144
|
-
right:6px; /* nudge in from the edge */
|
|
145
|
-
bottom:84px;
|
|
146
|
-
width: 100px; /* sits above the 60px launcher */
|
|
147
|
-
max-width:210px;
|
|
148
|
-
background:#ffffff;
|
|
149
|
-
color:#111;
|
|
150
|
-
border-radius:18px;
|
|
151
|
-
padding:12px 14px;
|
|
152
|
-
box-shadow:
|
|
153
|
-
0 18px 50px rgba(0,0,0,.18),
|
|
154
|
-
0 6px 18px rgba(0,0,0,.08);
|
|
155
|
-
border:1px solid rgba(17,17,17,.06);
|
|
156
|
-
cursor:pointer;
|
|
157
|
-
/* entrance */
|
|
158
|
-
opacity:0;
|
|
159
|
-
transform:translateY(8px) scale(.98);
|
|
160
|
-
animation:jb-in .32s cubic-bezier(.22,1,.36,1) forwards,
|
|
161
|
-
jb-float 6s ease-in-out 1.2s infinite;
|
|
162
|
-
z-index:10001;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/* “tail” pointing to the launcher */
|
|
166
|
-
.jaweb-nudge-caret{
|
|
167
|
-
position:absolute;
|
|
168
|
-
left:50%;
|
|
169
|
-
transform:translateX(-50%) rotate(45deg);
|
|
170
|
-
bottom:-8px;
|
|
171
|
-
width:14px;height:14px;
|
|
172
|
-
background:#ffffff;
|
|
173
|
-
border-right:1px solid rgba(17,17,17,.06);
|
|
174
|
-
border-bottom:1px solid rgba(17,17,17,.06);
|
|
175
|
-
filter: drop-shadow(0 2px 3px rgba(0,0,0,.08));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* content: three dots on top + stacked text */
|
|
179
|
-
.jaweb-nudge-text{
|
|
180
|
-
display:block;
|
|
181
|
-
word-wrap:normal;
|
|
182
|
-
word-break:normal;
|
|
183
|
-
font-size:15.5px;
|
|
184
|
-
line-height:1.25;
|
|
185
|
-
font-weight:600;
|
|
186
|
-
letter-spacing:.2px;
|
|
187
|
-
}
|
|
188
160
|
|
|
189
|
-
/* typing dots row */
|
|
190
|
-
.jaweb-nudge-text .jaweb-typing-dot{
|
|
191
|
-
display:inline-block;
|
|
192
|
-
width:6px;height:6px;
|
|
193
|
-
margin-right:6px;
|
|
194
|
-
border-radius:9999px;
|
|
195
|
-
background:linear-gradient(180deg,#c8c8c8,#bdbdbd);
|
|
196
|
-
animation:jb-typing 1.2s infinite ease-in-out;
|
|
197
|
-
vertical-align:middle;
|
|
198
|
-
}
|
|
199
|
-
.jaweb-nudge-text .jaweb-typing-dot:nth-child(1){ animation-delay:0s; }
|
|
200
|
-
.jaweb-nudge-text .jaweb-typing-dot:nth-child(2){ animation-delay:.15s; }
|
|
201
|
-
.jaweb-nudge-text .jaweb-typing-dot:nth-child(3){ animation-delay:.3s; }
|
|
202
161
|
|
|
203
|
-
/* subtle gradient ring on bubble edges (premium vibe) */
|
|
204
|
-
.jaweb-nudge-bubble::before{
|
|
205
|
-
content:"";
|
|
206
|
-
position:absolute; inset:0;
|
|
207
|
-
border-radius:inherit;
|
|
208
|
-
pointer-events:none;
|
|
209
|
-
background:
|
|
210
|
-
radial-gradient(120% 120% at 50% -10%,
|
|
211
|
-
color-mix(in oklab, var(--jaweb-color, #7f28f8) 14%, transparent) 0%,
|
|
212
|
-
transparent 60%);
|
|
213
|
-
}
|
|
214
162
|
|
|
215
|
-
/* dark mode */
|
|
216
|
-
@media (prefers-color-scheme: dark){
|
|
217
|
-
.jaweb-nudge-bubble{
|
|
218
|
-
background: #1f1f21;
|
|
219
|
-
color:#f5f5f7;
|
|
220
|
-
border:1px solid rgba(255,255,255,.06);
|
|
221
|
-
box-shadow:
|
|
222
|
-
0 22px 60px rgba(0,0,0,.55),
|
|
223
|
-
0 0 0 1px rgba(255,255,255,.04) inset;
|
|
224
|
-
}
|
|
225
|
-
.jaweb-nudge-caret{
|
|
226
|
-
background:#1f1f21;
|
|
227
|
-
border-right:1px solid rgba(255,255,255,.06);
|
|
228
|
-
border-bottom:1px solid rgba(255,255,255,.06);
|
|
229
|
-
}
|
|
230
|
-
.jaweb-nudge-text .jaweb-typing-dot{
|
|
231
|
-
background:linear-gradient(180deg,#bfbfbf,#a8a8a8);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
163
|
|
|
235
|
-
/* reduced motion */
|
|
236
|
-
@media (prefers-reduced-motion: reduce){
|
|
237
|
-
.jaweb-nudge-bubble{ animation:none; }
|
|
238
|
-
.jaweb-nudge-text .jaweb-typing-dot{ animation:none; }
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/* keyframes */
|
|
242
|
-
@keyframes jb-in{
|
|
243
|
-
to{ opacity:1; transform:translateY(0) scale(1); }
|
|
244
|
-
}
|
|
245
|
-
@keyframes jb-typing{
|
|
246
|
-
0%, 60%, 100%{ transform:translateY(0); opacity:.55; }
|
|
247
|
-
30%{ transform:translateY(-3px); opacity:1; }
|
|
248
|
-
}
|
|
249
|
-
@keyframes jb-float{
|
|
250
|
-
0%,100%{ transform:translateY(0); }
|
|
251
|
-
50%{ transform:translateY(-2px); }
|
|
252
|
-
}
|
|
253
164
|
|
|
254
165
|
|
|
255
|
-
|
|
166
|
+
/*
|
|
256
167
|
@media (max-width: 600px) {
|
|
257
168
|
.chatbot-box {
|
|
258
169
|
position: fixed;
|
|
@@ -267,4 +178,4 @@
|
|
|
267
178
|
.chat-launcher.chatbot-open {
|
|
268
179
|
display: none;
|
|
269
180
|
}
|
|
270
|
-
}
|
|
181
|
+
} */
|