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
|
@@ -1,127 +1,439 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
/* ===== CHAT INPUT WRAPPER ===== */
|
|
2
|
+
.chat-input-wrapper {
|
|
3
|
+
width: 100%;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 12px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* ===== IMAGE PREVIEW ===== */
|
|
11
|
+
.image-preview-container {
|
|
12
|
+
padding: 0 4px;
|
|
13
|
+
animation: slideDown 0.2s ease-out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.image-preview-content {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 12px;
|
|
20
|
+
background: #f9fafb;
|
|
21
|
+
border: 1px solid #e5e7eb;
|
|
22
|
+
border-radius: 12px;
|
|
23
|
+
padding: 8px 12px;
|
|
24
|
+
transition: all 0.2s ease;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.image-preview-content:hover {
|
|
28
|
+
background: #f3f4f6;
|
|
29
|
+
border-color: #d1d5db;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.image-preview {
|
|
33
|
+
width: 48px;
|
|
34
|
+
height: 48px;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
object-fit: cover;
|
|
37
|
+
border: 1px solid #e5e7eb;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.image-preview-info {
|
|
41
|
+
flex: 1;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
gap: 2px;
|
|
45
|
+
min-width: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.image-preview-name {
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
color: #374151;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.image-preview-size {
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
color: #9ca3af;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.image-preview-remove {
|
|
63
|
+
background: none;
|
|
64
|
+
border: none;
|
|
65
|
+
color: #ef4444;
|
|
66
|
+
font-size: 18px;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
padding: 4px;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
transition: all 0.2s ease;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.image-preview-remove:hover {
|
|
77
|
+
background: #fee2e2;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ===== MAIN INPUT CONTAINER ===== */
|
|
81
|
+
.chat-input-container {
|
|
82
|
+
position: relative;
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
background: #ffffff;
|
|
86
|
+
border-radius: 26px;
|
|
87
|
+
padding: 12px 16px;
|
|
88
|
+
gap: 8px;
|
|
89
|
+
transition: all 0.2s ease;
|
|
90
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
91
|
+
border: 1px solid #e5e7eb;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.chat-input-container:focus-within {
|
|
95
|
+
border-color: #d1d5db;
|
|
96
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.chat-input-container.disabled {
|
|
100
|
+
opacity: 0.6;
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.chat-input-container.dragging {
|
|
105
|
+
border-color: var(--primary-color);
|
|
106
|
+
background: #f9fafb;
|
|
107
|
+
border-style: dashed;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* ===== INPUT CONTENT AREA ===== */
|
|
111
|
+
.input-content {
|
|
112
|
+
flex: 1;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: flex-start;
|
|
116
|
+
padding: 4px 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.text-input {
|
|
120
|
+
width: 100%;
|
|
121
|
+
border: none !important;
|
|
122
|
+
background: transparent !important;
|
|
123
|
+
font-size: 15px;
|
|
124
|
+
color: #111827;
|
|
125
|
+
padding: 0 !important;
|
|
126
|
+
box-shadow: none !important;
|
|
127
|
+
outline: none !important;
|
|
128
|
+
resize: none;
|
|
129
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
130
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
131
|
+
sans-serif;
|
|
132
|
+
line-height: 1.5;
|
|
133
|
+
max-height: 67.5px; /* Approximately 3 lines (1.5 line-height * 15px font-size * 3 lines) */
|
|
134
|
+
overflow-y: auto;
|
|
135
|
+
transition: height 0.1s ease;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.text-input::placeholder {
|
|
139
|
+
color: #9ca3af;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.text-input:focus {
|
|
143
|
+
box-shadow: none !important;
|
|
144
|
+
border: none !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Custom scrollbar */
|
|
148
|
+
.text-input::-webkit-scrollbar {
|
|
149
|
+
width: 6px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.text-input::-webkit-scrollbar-track {
|
|
153
|
+
background: transparent;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.text-input::-webkit-scrollbar-thumb {
|
|
157
|
+
background: #d1d5db;
|
|
158
|
+
border-radius: 3px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.text-input::-webkit-scrollbar-thumb:hover {
|
|
162
|
+
background: #9ca3af;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* ===== AUDIO PLAYBACK UI ===== */
|
|
166
|
+
.audio-playback-container {
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
width: 100%;
|
|
170
|
+
background: #f9fafb;
|
|
171
|
+
padding: 8px 12px;
|
|
172
|
+
border-radius: 16px;
|
|
173
|
+
gap: 12px;
|
|
174
|
+
border: 1px solid #e5e7eb;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.audio-play-button {
|
|
178
|
+
background: none;
|
|
179
|
+
border: none;
|
|
180
|
+
color: var(--primary-color);
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
padding: 0;
|
|
183
|
+
transition: all 0.2s ease;
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.audio-play-button:hover {
|
|
190
|
+
transform: scale(1.1);
|
|
191
|
+
opacity: 0.8;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.audio-play-button .play-icon {
|
|
195
|
+
font-size: 28px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.waveform {
|
|
199
|
+
flex: 1;
|
|
200
|
+
min-width: 0;
|
|
201
|
+
height: 32px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.audio-cancel-button {
|
|
205
|
+
background: none;
|
|
206
|
+
border: none;
|
|
207
|
+
color: #ef4444;
|
|
208
|
+
font-size: 18px;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
padding: 4px;
|
|
211
|
+
border-radius: 50%;
|
|
212
|
+
transition: all 0.2s ease;
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
justify-content: center;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.audio-cancel-button:hover {
|
|
219
|
+
background: #fee2e2;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* ===== RECORDING UI ===== */
|
|
223
|
+
.recording-container {
|
|
224
|
+
display: flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: space-between;
|
|
227
|
+
width: 100%;
|
|
228
|
+
background: #fef2f2;
|
|
229
|
+
padding: 12px 16px;
|
|
230
|
+
border-radius: 16px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.recording-indicator {
|
|
234
|
+
display: flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
gap: 8px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.recording-dot {
|
|
240
|
+
width: 8px;
|
|
241
|
+
height: 8px;
|
|
242
|
+
background: #ef4444;
|
|
243
|
+
border-radius: 50%;
|
|
244
|
+
animation: blink 1.5s infinite;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.recording-text {
|
|
248
|
+
font-size: 14px;
|
|
249
|
+
font-weight: 500;
|
|
250
|
+
color: #ef4444;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.recording-duration {
|
|
254
|
+
font-size: 13px;
|
|
255
|
+
font-weight: 600;
|
|
256
|
+
color: #374151;
|
|
257
|
+
font-family: 'Courier New', monospace;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* ===== ACTION BAR ===== */
|
|
261
|
+
.action-bar {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
justify-content: space-between;
|
|
265
|
+
gap: 8px;
|
|
266
|
+
padding-top: 4px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.action-icons-left {
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 4px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.action-icon-button {
|
|
276
|
+
background: none;
|
|
277
|
+
border: none;
|
|
278
|
+
color: #6b7280;
|
|
279
|
+
cursor: pointer;
|
|
280
|
+
padding: 6px;
|
|
281
|
+
border-radius: 50%;
|
|
282
|
+
transition: all 0.2s ease;
|
|
283
|
+
display: flex;
|
|
284
|
+
align-items: center;
|
|
285
|
+
justify-content: center;
|
|
286
|
+
font-size: 18px;
|
|
287
|
+
width: 32px;
|
|
288
|
+
height: 32px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.action-icon-button:hover:not(:disabled) {
|
|
292
|
+
background: #f3f4f6;
|
|
293
|
+
color: #374151;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.action-icon-button:active:not(:disabled) {
|
|
297
|
+
transform: scale(0.95);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.action-icon-button:disabled {
|
|
301
|
+
opacity: 0.4;
|
|
302
|
+
cursor: not-allowed;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.action-icon-button.recording {
|
|
306
|
+
color: #ef4444;
|
|
307
|
+
background: #fee2e2;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* ===== SEND BUTTON ===== */
|
|
311
|
+
.send-button {
|
|
312
|
+
background: #e5e7eb;
|
|
313
|
+
border: none;
|
|
314
|
+
color: #9ca3af;
|
|
315
|
+
cursor: not-allowed;
|
|
316
|
+
padding: 0;
|
|
317
|
+
border-radius: 50%;
|
|
318
|
+
transition: all 0.2s ease;
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
width: 32px;
|
|
323
|
+
height: 32px;
|
|
324
|
+
flex-shrink: 0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.send-icon {
|
|
328
|
+
font-size: 16px;
|
|
329
|
+
font-weight: bold;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.send-button.active {
|
|
333
|
+
background: var(--primary-color);
|
|
334
|
+
color: white;
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
box-shadow: 0 2px 8px var(--primary-shadow);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.send-button.active:hover {
|
|
340
|
+
background: var(--primary-hover);
|
|
341
|
+
transform: scale(1.05);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.send-button.active:active {
|
|
345
|
+
transform: scale(0.95);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.send-button:disabled {
|
|
349
|
+
opacity: 0.6;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* ===== DRAG OVERLAY ===== */
|
|
353
|
+
.drag-overlay {
|
|
354
|
+
position: absolute;
|
|
355
|
+
inset: 0;
|
|
356
|
+
background: rgba(255, 255, 255, 0.95);
|
|
357
|
+
border-radius: 26px;
|
|
358
|
+
display: flex;
|
|
359
|
+
flex-direction: column;
|
|
360
|
+
align-items: center;
|
|
361
|
+
justify-content: center;
|
|
362
|
+
gap: 8px;
|
|
363
|
+
pointer-events: none;
|
|
364
|
+
backdrop-filter: blur(4px);
|
|
365
|
+
border: 2px dashed var(--primary-color);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.drag-icon {
|
|
369
|
+
font-size: 48px;
|
|
370
|
+
color: var(--primary-color);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.drag-overlay span {
|
|
374
|
+
font-size: 16px;
|
|
375
|
+
font-weight: 600;
|
|
376
|
+
color: var(--primary-color);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/* ===== ANIMATIONS ===== */
|
|
380
|
+
@keyframes slideDown {
|
|
381
|
+
from {
|
|
382
|
+
opacity: 0;
|
|
383
|
+
transform: translateY(-10px);
|
|
23
384
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
385
|
+
to {
|
|
386
|
+
opacity: 1;
|
|
387
|
+
transform: translateY(0);
|
|
27
388
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
@keyframes blink {
|
|
392
|
+
0%,
|
|
393
|
+
100% {
|
|
394
|
+
opacity: 1;
|
|
31
395
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
position: relative;
|
|
396
|
+
50% {
|
|
397
|
+
opacity: 0.3;
|
|
35
398
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.spin {
|
|
402
|
+
animation: spin 1s linear infinite;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
@keyframes spin {
|
|
406
|
+
from {
|
|
407
|
+
transform: rotate(0deg);
|
|
42
408
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: -0.5rem;
|
|
47
|
-
right: -0.5rem;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
color: #ef4444;
|
|
50
|
-
background: white;
|
|
51
|
-
border-radius: 9999px;
|
|
52
|
-
cursor: pointer;
|
|
409
|
+
to {
|
|
410
|
+
transform: rotate(360deg);
|
|
53
411
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/* ===== RESPONSIVE ===== */
|
|
415
|
+
@media (max-width: 600px) {
|
|
416
|
+
.chat-input-container {
|
|
417
|
+
padding: 10px 14px;
|
|
62
418
|
}
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
width:
|
|
66
|
-
|
|
419
|
+
|
|
420
|
+
.action-icon-button {
|
|
421
|
+
width: 30px;
|
|
422
|
+
height: 30px;
|
|
67
423
|
font-size: 16px;
|
|
68
|
-
line-height: 1.5;
|
|
69
|
-
color: #374151;
|
|
70
424
|
}
|
|
71
|
-
|
|
72
|
-
.jawebcss-text-input:focus {
|
|
73
|
-
outline: none;
|
|
74
|
-
box-shadow: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
425
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
display: flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
width: 100%;
|
|
84
|
-
background-color: #f3f4f6;
|
|
85
|
-
padding: 0.5rem 1rem;
|
|
86
|
-
border-radius: 0.5rem;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.jawebcss-audio-play-button {
|
|
90
|
-
background: none;
|
|
91
|
-
border: none;
|
|
92
|
-
margin-right: 0.75rem;
|
|
93
|
-
color: #7f28f8;
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.jawebcss-remove-audio-icon {
|
|
98
|
-
font-size: 18px;
|
|
99
|
-
color: #ef4444;
|
|
100
|
-
margin-left: 0.75rem;
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.jawebcss-waveform {
|
|
105
|
-
width: 100%;
|
|
106
|
-
height: 2rem;
|
|
426
|
+
.send-button {
|
|
427
|
+
width: 30px;
|
|
428
|
+
height: 30px;
|
|
107
429
|
}
|
|
108
|
-
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: center;
|
|
113
|
-
background-color: #f3f4f6;
|
|
114
|
-
padding: 0.5rem 1rem;
|
|
115
|
-
border-radius: 0.5rem;
|
|
116
|
-
animation: pulse 2s infinite;
|
|
430
|
+
|
|
431
|
+
.send-icon {
|
|
432
|
+
font-size: 14px;
|
|
117
433
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
50% {
|
|
124
|
-
opacity: 0.5;
|
|
125
|
-
}
|
|
434
|
+
|
|
435
|
+
.text-input {
|
|
436
|
+
font-size: 14px;
|
|
437
|
+
max-height: 63px; /* Adjusted for smaller font size (1.5 * 14px * 3) */
|
|
126
438
|
}
|
|
127
|
-
|
|
439
|
+
}
|