shopify-chatbot-widget 0.9.7 → 1.0.0
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 +393 -146
- 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 +264 -216
- 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 +17 -16
- package/src/Chatbot/components/Sessions/RenderList.tsx +445 -141
- package/src/hooks/config.tsx +4 -4
- package/src/hooks/useChatbotAPI.tsx +2 -16
- package/src/Chatbot/components/Suggestions.css +0 -35
- package/src/Chatbot/components/Suggestions.tsx +0 -57
|
@@ -1,31 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* ===== BASE TYPING INDICATOR ===== */
|
|
2
|
+
.typing-indicator {
|
|
3
|
+
display: inline-flex;
|
|
3
4
|
gap: 6px;
|
|
4
5
|
align-items: center;
|
|
5
6
|
justify-content: flex-start;
|
|
7
|
+
padding: 8px 12px;
|
|
8
|
+
background: #eff0f1;
|
|
9
|
+
border-color: black;
|
|
10
|
+
border-radius: 18px;
|
|
11
|
+
width: fit-content;
|
|
6
12
|
}
|
|
7
13
|
|
|
8
|
-
.typing-
|
|
9
|
-
border-radius:
|
|
14
|
+
.typing-dot {
|
|
15
|
+
border-radius: 50%;
|
|
10
16
|
display: inline-block;
|
|
11
|
-
animation: pulseBox 0.8s infinite alternate;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
/* ===== DOTS VARIANT (Default - Smooth bounce) ===== */
|
|
20
|
+
.typing-dots .typing-dot {
|
|
21
|
+
animation: bounceDot 1.4s infinite ease-in-out both;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.typing-dots .typing-dot:nth-child(1) {
|
|
25
|
+
animation-delay: -0.32s;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.typing-dots .typing-dot:nth-child(2) {
|
|
29
|
+
animation-delay: -0.16s;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes bounceDot {
|
|
33
|
+
0%, 80%, 100% {
|
|
34
|
+
transform: translateY(0) scale(1);
|
|
35
|
+
opacity: 0.7;
|
|
36
|
+
}
|
|
37
|
+
40% {
|
|
38
|
+
transform: translateY(-10px) scale(1.1);
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ===== BOXES VARIANT (Pulsing squares) ===== */
|
|
44
|
+
.typing-boxes .typing-dot {
|
|
45
|
+
border-radius: 3px;
|
|
46
|
+
animation: pulseBox 1s infinite ease-in-out both;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.typing-boxes .typing-dot:nth-child(1) {
|
|
50
|
+
animation-delay: 0s;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.typing-boxes .typing-dot:nth-child(2) {
|
|
15
54
|
animation-delay: 0.2s;
|
|
16
55
|
}
|
|
17
56
|
|
|
18
|
-
.typing-boxes
|
|
57
|
+
.typing-boxes .typing-dot:nth-child(3) {
|
|
19
58
|
animation-delay: 0.4s;
|
|
20
59
|
}
|
|
21
60
|
|
|
22
61
|
@keyframes pulseBox {
|
|
23
|
-
|
|
24
|
-
transform: scale(
|
|
62
|
+
0%, 100% {
|
|
63
|
+
transform: scale(0.8);
|
|
25
64
|
opacity: 0.5;
|
|
26
65
|
}
|
|
27
|
-
|
|
28
|
-
transform: scale(1.
|
|
66
|
+
50% {
|
|
67
|
+
transform: scale(1.2);
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ===== WAVE VARIANT (Wave motion) ===== */
|
|
73
|
+
.typing-wave .typing-dot {
|
|
74
|
+
animation: wave 1.2s infinite ease-in-out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.typing-wave .typing-dot:nth-child(1) {
|
|
78
|
+
animation-delay: 0s;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.typing-wave .typing-dot:nth-child(2) {
|
|
82
|
+
animation-delay: 0.15s;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.typing-wave .typing-dot:nth-child(3) {
|
|
86
|
+
animation-delay: 0.3s;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes wave {
|
|
90
|
+
0%, 60%, 100% {
|
|
91
|
+
transform: translateY(0);
|
|
92
|
+
opacity: 0.6;
|
|
93
|
+
}
|
|
94
|
+
30% {
|
|
95
|
+
transform: translateY(-12px);
|
|
29
96
|
opacity: 1;
|
|
30
97
|
}
|
|
31
98
|
}
|
|
99
|
+
|
|
100
|
+
/* ===== MINIMAL VARIANT (No background bubble) ===== */
|
|
101
|
+
.typing-indicator.minimal {
|
|
102
|
+
background: transparent;
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ===== DARK MODE SUPPORT ===== */
|
|
107
|
+
.typing-indicator.dark {
|
|
108
|
+
background: #374151;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ===== SIZE VARIANTS ===== */
|
|
112
|
+
.typing-indicator.small {
|
|
113
|
+
padding: 6px 10px;
|
|
114
|
+
gap: 4px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.typing-indicator.large {
|
|
118
|
+
padding: 10px 16px;
|
|
119
|
+
gap: 8px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* ===== RESPONSIVE ===== */
|
|
123
|
+
@media (max-width: 600px) {
|
|
124
|
+
.typing-indicator {
|
|
125
|
+
padding: 6px 10px;
|
|
126
|
+
gap: 5px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* ===== SMOOTH PERFORMANCE ===== */
|
|
131
|
+
.typing-dot {
|
|
132
|
+
will-change: transform, opacity;
|
|
133
|
+
backface-visibility: hidden;
|
|
134
|
+
}
|
|
@@ -2,18 +2,32 @@ import React from 'react';
|
|
|
2
2
|
import './Typing.css';
|
|
3
3
|
|
|
4
4
|
interface TypingProps {
|
|
5
|
-
color?: string;
|
|
6
|
-
size?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
variant?: 'dots' | 'boxes' | 'wave'; // Different animation styles
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
const Typing: React.FC<TypingProps> = ({
|
|
10
|
+
const Typing: React.FC<TypingProps> = ({
|
|
11
|
+
color = '#6b7280',
|
|
12
|
+
size = 8,
|
|
13
|
+
variant = 'dots'
|
|
14
|
+
}) => {
|
|
10
15
|
return (
|
|
11
|
-
<div className=
|
|
12
|
-
<span
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
<div className={`typing-indicator typing-${variant}`}>
|
|
17
|
+
<span
|
|
18
|
+
className="typing-dot"
|
|
19
|
+
style={{ backgroundColor: color, width: size, height: size }}
|
|
20
|
+
/>
|
|
21
|
+
<span
|
|
22
|
+
className="typing-dot"
|
|
23
|
+
style={{ backgroundColor: color, width: size, height: size }}
|
|
24
|
+
/>
|
|
25
|
+
<span
|
|
26
|
+
className="typing-dot"
|
|
27
|
+
style={{ backgroundColor: color, width: size, height: size }}
|
|
28
|
+
/>
|
|
15
29
|
</div>
|
|
16
30
|
);
|
|
17
31
|
};
|
|
18
32
|
|
|
19
|
-
export default Typing;
|
|
33
|
+
export default Typing;
|
|
@@ -5,7 +5,6 @@ import '../../Chatbot.css';
|
|
|
5
5
|
import { useChatbotMessage } from '../../../hooks/useSessionMessages';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
import ChatInput from '../../components/ChatInput';
|
|
8
|
-
import Suggestions from '../../components/Suggestions';
|
|
9
8
|
import Powered from '../../components/Powered';
|
|
10
9
|
import ChatMessages from '../../components/Messages/ChatMessages';
|
|
11
10
|
import config from '../../../hooks/config';
|
|
@@ -537,25 +536,26 @@ const socket = useChatSocket(sessionId, handleSocketData);
|
|
|
537
536
|
|
|
538
537
|
|
|
539
538
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
539
|
+
<ChatMessages
|
|
540
|
+
messages={messages}
|
|
541
|
+
colorCode={colorCode}
|
|
542
|
+
isLoading={false}
|
|
543
|
+
handleAddToCart={handleToCart}
|
|
544
|
+
agentStatus={agentStatus}
|
|
545
|
+
sessionId={sessionId}
|
|
546
|
+
handleRemoveFromCart={handleRemoveFromCart}
|
|
547
|
+
userType={userType}
|
|
548
|
+
calendly={calendly}
|
|
549
|
+
disableCheckout={disbleCheckout}
|
|
550
|
+
isfetchingMessage={isFetchingMessages}
|
|
551
|
+
messagesSuggestions={messagesSuggestions}
|
|
552
|
+
sendMessageSuggestion={sendMessageSuggestion}
|
|
553
|
+
/>
|
|
554
554
|
|
|
555
555
|
|
|
556
556
|
|
|
557
557
|
<div className="chatbot-input-area">
|
|
558
|
-
<Suggestions sendMessageSuggestion={sendMessageSuggestion} colorCode={colorCode} suggestions={messagesSuggestions} />
|
|
558
|
+
{/* <Suggestions sendMessageSuggestion={sendMessageSuggestion} colorCode={colorCode} suggestions={messagesSuggestions} /> */}
|
|
559
559
|
|
|
560
560
|
<ChatInput
|
|
561
561
|
userMessage={input}
|
|
@@ -568,6 +568,7 @@ const socket = useChatSocket(sessionId, handleSocketData);
|
|
|
568
568
|
audioBlob={audioBlob}
|
|
569
569
|
setAudioBlob={setAudioBlob}
|
|
570
570
|
isSending={isSending}
|
|
571
|
+
colorCode={colorCode}
|
|
571
572
|
|
|
572
573
|
/>
|
|
573
574
|
|