vox-ai-react 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/README.md +94 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.esm.js +230 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +235 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# @vox-ai/react
|
|
2
|
+
|
|
3
|
+
Official React component for VOX AI Chat Widget.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @vox-ai/react
|
|
9
|
+
# or
|
|
10
|
+
yarn add @vox-ai/react
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @vox-ai/react
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import { VoxChat } from '@vox-ai/react';
|
|
19
|
+
|
|
20
|
+
function App() {
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<h1>My Website</h1>
|
|
24
|
+
<VoxChat apiKey="vox_live_xxxxxxxx" />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Default | Description |
|
|
33
|
+
|------|------|---------|-------------|
|
|
34
|
+
| `apiKey` | `string` | Required | Your VOX API key |
|
|
35
|
+
| `agentName` | `string` | `'VOX-01'` | Display name for the agent |
|
|
36
|
+
| `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Widget position |
|
|
37
|
+
| `theme` | `'dark' \| 'light' \| 'auto'` | `'dark'` | Color theme |
|
|
38
|
+
| `buttonColor` | `string` | Theme default | Custom button background color |
|
|
39
|
+
| `buttonSize` | `number` | `48` | Button size in pixels |
|
|
40
|
+
| `borderRadius` | `number` | `0` | Button border radius in pixels |
|
|
41
|
+
| `iconColor` | `string` | Theme default | Custom icon color |
|
|
42
|
+
| `onOpen` | `() => void` | - | Callback when chat opens |
|
|
43
|
+
| `onClose` | `() => void` | - | Callback when chat closes |
|
|
44
|
+
| `onMessage` | `(message, role) => void` | - | Callback for each message |
|
|
45
|
+
|
|
46
|
+
## Customization Examples
|
|
47
|
+
|
|
48
|
+
### Custom Colors
|
|
49
|
+
|
|
50
|
+
```jsx
|
|
51
|
+
<VoxChat
|
|
52
|
+
apiKey="vox_live_xxxxxxxx"
|
|
53
|
+
buttonColor="#6366f1"
|
|
54
|
+
iconColor="#ffffff"
|
|
55
|
+
borderRadius={24}
|
|
56
|
+
/>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Light Theme
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<VoxChat
|
|
63
|
+
apiKey="vox_live_xxxxxxxx"
|
|
64
|
+
theme="light"
|
|
65
|
+
/>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Auto Theme (follows system preference)
|
|
69
|
+
|
|
70
|
+
```jsx
|
|
71
|
+
<VoxChat
|
|
72
|
+
apiKey="vox_live_xxxxxxxx"
|
|
73
|
+
theme="auto"
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### With Callbacks
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<VoxChat
|
|
81
|
+
apiKey="vox_live_xxxxxxxx"
|
|
82
|
+
onOpen={() => console.log('Chat opened')}
|
|
83
|
+
onClose={() => console.log('Chat closed')}
|
|
84
|
+
onMessage={(msg, role) => console.log(`${role}: ${msg}`)}
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Get Your API Key
|
|
89
|
+
|
|
90
|
+
Visit [vox.ai/dashboard](https://vox.ai/dashboard) to get your API key.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface VoxChatProps {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
agentName?: string;
|
|
5
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
6
|
+
theme?: 'dark' | 'light' | 'auto';
|
|
7
|
+
buttonColor?: string;
|
|
8
|
+
buttonSize?: number;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
iconColor?: string;
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
onMessage?: (message: string, role: 'user' | 'assistant') => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const VoxChat: React.FC<VoxChatProps>;
|
|
16
|
+
export default VoxChat;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const VoxChat = ({ apiKey, agentName = 'VOX-01', position = 'bottom-right', theme = 'dark', buttonColor, buttonSize = 48, borderRadius = 0, iconColor, onOpen, onClose, onMessage, }) => {
|
|
5
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
6
|
+
const [messages, setMessages] = useState([]);
|
|
7
|
+
const [input, setInput] = useState('');
|
|
8
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
9
|
+
const scrollRef = useRef(null);
|
|
10
|
+
// Determine actual theme
|
|
11
|
+
const actualTheme = theme === 'auto'
|
|
12
|
+
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
13
|
+
: theme;
|
|
14
|
+
// Default colors based on theme
|
|
15
|
+
const defaultButtonColor = actualTheme === 'dark' ? '#000000' : '#ffffff';
|
|
16
|
+
const defaultIconColor = actualTheme === 'dark' ? '#ffffff' : '#000000';
|
|
17
|
+
const finalButtonColor = buttonColor || defaultButtonColor;
|
|
18
|
+
const finalIconColor = iconColor || defaultIconColor;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (scrollRef.current) {
|
|
21
|
+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
22
|
+
}
|
|
23
|
+
}, [messages]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
// Add welcome message
|
|
26
|
+
setMessages([{
|
|
27
|
+
id: 'welcome',
|
|
28
|
+
role: 'assistant',
|
|
29
|
+
text: `Hello! I'm ${agentName}. How can I help you today?`,
|
|
30
|
+
timestamp: new Date()
|
|
31
|
+
}]);
|
|
32
|
+
}, [agentName]);
|
|
33
|
+
const handleOpen = () => {
|
|
34
|
+
setIsOpen(true);
|
|
35
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
36
|
+
};
|
|
37
|
+
const handleClose = () => {
|
|
38
|
+
setIsOpen(false);
|
|
39
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
40
|
+
};
|
|
41
|
+
const handleSend = async (e) => {
|
|
42
|
+
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
43
|
+
if (!input.trim() || isLoading)
|
|
44
|
+
return;
|
|
45
|
+
const userMessage = {
|
|
46
|
+
id: Date.now().toString(),
|
|
47
|
+
role: 'user',
|
|
48
|
+
text: input,
|
|
49
|
+
timestamp: new Date()
|
|
50
|
+
};
|
|
51
|
+
setMessages(prev => [...prev, userMessage]);
|
|
52
|
+
onMessage === null || onMessage === void 0 ? void 0 : onMessage(input, 'user');
|
|
53
|
+
setInput('');
|
|
54
|
+
setIsLoading(true);
|
|
55
|
+
try {
|
|
56
|
+
const response = await fetch('https://api.vox.ai/v1/chat', {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
headers: {
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
'Authorization': `Bearer ${apiKey}`
|
|
61
|
+
},
|
|
62
|
+
body: JSON.stringify({
|
|
63
|
+
message: userMessage.text,
|
|
64
|
+
history: messages.map(m => ({ role: m.role, content: m.text }))
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
const data = await response.json();
|
|
68
|
+
const assistantMessage = {
|
|
69
|
+
id: (Date.now() + 1).toString(),
|
|
70
|
+
role: 'assistant',
|
|
71
|
+
text: data.response || 'Sorry, I encountered an error.',
|
|
72
|
+
timestamp: new Date()
|
|
73
|
+
};
|
|
74
|
+
setMessages(prev => [...prev, assistantMessage]);
|
|
75
|
+
onMessage === null || onMessage === void 0 ? void 0 : onMessage(assistantMessage.text, 'assistant');
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
const errorMessage = {
|
|
79
|
+
id: (Date.now() + 1).toString(),
|
|
80
|
+
role: 'assistant',
|
|
81
|
+
text: 'Sorry, I encountered an error. Please try again.',
|
|
82
|
+
timestamp: new Date()
|
|
83
|
+
};
|
|
84
|
+
setMessages(prev => [...prev, errorMessage]);
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
setIsLoading(false);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const positionStyles = position === 'bottom-left'
|
|
91
|
+
? { left: '16px' }
|
|
92
|
+
: { right: '16px' };
|
|
93
|
+
const colors = actualTheme === 'dark' ? {
|
|
94
|
+
bg: '#000000',
|
|
95
|
+
bgSecondary: '#18181b',
|
|
96
|
+
border: '#27272a',
|
|
97
|
+
text: '#ffffff',
|
|
98
|
+
textSecondary: '#a1a1aa',
|
|
99
|
+
userBubble: '#27272a',
|
|
100
|
+
assistantBubble: '#000000',
|
|
101
|
+
} : {
|
|
102
|
+
bg: '#ffffff',
|
|
103
|
+
bgSecondary: '#f4f4f5',
|
|
104
|
+
border: '#e4e4e7',
|
|
105
|
+
text: '#000000',
|
|
106
|
+
textSecondary: '#71717a',
|
|
107
|
+
userBubble: '#f4f4f5',
|
|
108
|
+
assistantBubble: '#ffffff',
|
|
109
|
+
};
|
|
110
|
+
return (jsxs(Fragment, { children: [isOpen && (jsxs("div", { style: {
|
|
111
|
+
position: 'fixed',
|
|
112
|
+
bottom: '80px',
|
|
113
|
+
...positionStyles,
|
|
114
|
+
width: '380px',
|
|
115
|
+
maxWidth: 'calc(100vw - 32px)',
|
|
116
|
+
height: '500px',
|
|
117
|
+
maxHeight: 'calc(100vh - 120px)',
|
|
118
|
+
backgroundColor: colors.bg,
|
|
119
|
+
border: `1px solid ${colors.border}`,
|
|
120
|
+
boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
|
|
121
|
+
display: 'flex',
|
|
122
|
+
flexDirection: 'column',
|
|
123
|
+
zIndex: 9999,
|
|
124
|
+
fontFamily: 'system-ui, -apple-system, sans-serif',
|
|
125
|
+
}, children: [jsxs("div", { style: {
|
|
126
|
+
padding: '16px',
|
|
127
|
+
borderBottom: `1px solid ${colors.border}`,
|
|
128
|
+
display: 'flex',
|
|
129
|
+
justifyContent: 'space-between',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
}, children: [jsxs("div", { children: [jsx("div", { style: {
|
|
132
|
+
fontSize: '10px',
|
|
133
|
+
fontWeight: 900,
|
|
134
|
+
color: colors.text,
|
|
135
|
+
textTransform: 'uppercase',
|
|
136
|
+
letterSpacing: '0.1em'
|
|
137
|
+
}, children: agentName }), jsxs("div", { style: {
|
|
138
|
+
fontSize: '9px',
|
|
139
|
+
color: colors.textSecondary,
|
|
140
|
+
textTransform: 'uppercase',
|
|
141
|
+
letterSpacing: '0.1em',
|
|
142
|
+
display: 'flex',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
gap: '6px'
|
|
145
|
+
}, children: [jsx("span", { style: {
|
|
146
|
+
width: '6px',
|
|
147
|
+
height: '6px',
|
|
148
|
+
backgroundColor: '#22c55e',
|
|
149
|
+
borderRadius: '50%'
|
|
150
|
+
} }), "Online"] })] }), jsx("button", { onClick: handleClose, style: {
|
|
151
|
+
background: 'none',
|
|
152
|
+
border: 'none',
|
|
153
|
+
color: colors.textSecondary,
|
|
154
|
+
cursor: 'pointer',
|
|
155
|
+
padding: '4px',
|
|
156
|
+
}, children: jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("path", { d: "M18 6L6 18M6 6l12 12" }) }) })] }), jsxs("div", { ref: scrollRef, style: {
|
|
157
|
+
flex: 1,
|
|
158
|
+
overflowY: 'auto',
|
|
159
|
+
padding: '16px',
|
|
160
|
+
display: 'flex',
|
|
161
|
+
flexDirection: 'column',
|
|
162
|
+
gap: '12px',
|
|
163
|
+
}, children: [messages.map((msg) => (jsx("div", { style: {
|
|
164
|
+
display: 'flex',
|
|
165
|
+
justifyContent: msg.role === 'user' ? 'flex-end' : 'flex-start',
|
|
166
|
+
}, children: jsx("div", { style: {
|
|
167
|
+
maxWidth: '80%',
|
|
168
|
+
padding: '10px 14px',
|
|
169
|
+
backgroundColor: msg.role === 'user' ? colors.userBubble : colors.assistantBubble,
|
|
170
|
+
border: `1px solid ${colors.border}`,
|
|
171
|
+
color: colors.text,
|
|
172
|
+
fontSize: '13px',
|
|
173
|
+
lineHeight: 1.5,
|
|
174
|
+
}, children: msg.text }) }, msg.id))), isLoading && (jsx("div", { style: { display: 'flex', justifyContent: 'flex-start' }, children: jsx("div", { style: {
|
|
175
|
+
padding: '10px 14px',
|
|
176
|
+
backgroundColor: colors.assistantBubble,
|
|
177
|
+
border: `1px solid ${colors.border}`,
|
|
178
|
+
color: colors.textSecondary,
|
|
179
|
+
fontSize: '13px',
|
|
180
|
+
}, children: "Typing..." }) }))] }), jsxs("form", { onSubmit: handleSend, style: {
|
|
181
|
+
padding: '16px',
|
|
182
|
+
borderTop: `1px solid ${colors.border}`,
|
|
183
|
+
display: 'flex',
|
|
184
|
+
gap: '8px',
|
|
185
|
+
}, children: [jsx("input", { type: "text", value: input, onChange: (e) => setInput(e.target.value), placeholder: "Type a message...", style: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
padding: '10px 14px',
|
|
188
|
+
backgroundColor: colors.bgSecondary,
|
|
189
|
+
border: `1px solid ${colors.border}`,
|
|
190
|
+
color: colors.text,
|
|
191
|
+
fontSize: '13px',
|
|
192
|
+
outline: 'none',
|
|
193
|
+
} }), jsx("button", { type: "submit", disabled: !input.trim() || isLoading, style: {
|
|
194
|
+
padding: '10px 16px',
|
|
195
|
+
backgroundColor: colors.text,
|
|
196
|
+
color: colors.bg,
|
|
197
|
+
border: 'none',
|
|
198
|
+
fontSize: '11px',
|
|
199
|
+
fontWeight: 700,
|
|
200
|
+
textTransform: 'uppercase',
|
|
201
|
+
letterSpacing: '0.05em',
|
|
202
|
+
cursor: input.trim() && !isLoading ? 'pointer' : 'not-allowed',
|
|
203
|
+
opacity: input.trim() && !isLoading ? 1 : 0.5,
|
|
204
|
+
}, children: "Send" })] })] })), !isOpen && (jsx("button", { onClick: handleOpen, style: {
|
|
205
|
+
position: 'fixed',
|
|
206
|
+
bottom: '16px',
|
|
207
|
+
...positionStyles,
|
|
208
|
+
width: `${buttonSize}px`,
|
|
209
|
+
height: `${buttonSize}px`,
|
|
210
|
+
backgroundColor: finalButtonColor,
|
|
211
|
+
borderRadius: `${borderRadius}px`,
|
|
212
|
+
border: 'none',
|
|
213
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',
|
|
214
|
+
cursor: 'pointer',
|
|
215
|
+
display: 'flex',
|
|
216
|
+
alignItems: 'center',
|
|
217
|
+
justifyContent: 'center',
|
|
218
|
+
zIndex: 9999,
|
|
219
|
+
transition: 'transform 0.2s, box-shadow 0.2s',
|
|
220
|
+
}, onMouseEnter: (e) => {
|
|
221
|
+
e.currentTarget.style.transform = 'scale(1.05)';
|
|
222
|
+
e.currentTarget.style.boxShadow = '0 6px 20px rgba(0, 0, 0, 0.2)';
|
|
223
|
+
}, onMouseLeave: (e) => {
|
|
224
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
225
|
+
e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.15)';
|
|
226
|
+
}, children: jsx("svg", { width: buttonSize * 0.4, height: buttonSize * 0.4, viewBox: "0 0 24 24", fill: "none", stroke: finalIconColor, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: jsx("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }) }) }))] }));
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export { VoxChat, VoxChat as default };
|
|
230
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\n\r\nexport interface VoxChatProps {\r\n apiKey: string;\r\n agentName?: string;\r\n position?: 'bottom-right' | 'bottom-left';\r\n theme?: 'dark' | 'light' | 'auto';\r\n buttonColor?: string;\r\n buttonSize?: number;\r\n borderRadius?: number;\r\n iconColor?: string;\r\n onOpen?: () => void;\r\n onClose?: () => void;\r\n onMessage?: (message: string, role: 'user' | 'assistant') => void;\r\n}\r\n\r\ninterface Message {\r\n id: string;\r\n role: 'user' | 'assistant';\r\n text: string;\r\n timestamp: Date;\r\n}\r\n\r\nexport const VoxChat: React.FC<VoxChatProps> = ({\r\n apiKey,\r\n agentName = 'VOX-01',\r\n position = 'bottom-right',\r\n theme = 'dark',\r\n buttonColor,\r\n buttonSize = 48,\r\n borderRadius = 0,\r\n iconColor,\r\n onOpen,\r\n onClose,\r\n onMessage,\r\n}) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [messages, setMessages] = useState<Message[]>([]);\r\n const [input, setInput] = useState('');\r\n const [isLoading, setIsLoading] = useState(false);\r\n const scrollRef = useRef<HTMLDivElement>(null);\r\n\r\n // Determine actual theme\r\n const actualTheme = theme === 'auto' \r\n ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\r\n : theme;\r\n\r\n // Default colors based on theme\r\n const defaultButtonColor = actualTheme === 'dark' ? '#000000' : '#ffffff';\r\n const defaultIconColor = actualTheme === 'dark' ? '#ffffff' : '#000000';\r\n const finalButtonColor = buttonColor || defaultButtonColor;\r\n const finalIconColor = iconColor || defaultIconColor;\r\n\r\n useEffect(() => {\r\n if (scrollRef.current) {\r\n scrollRef.current.scrollTop = scrollRef.current.scrollHeight;\r\n }\r\n }, [messages]);\r\n\r\n useEffect(() => {\r\n // Add welcome message\r\n setMessages([{\r\n id: 'welcome',\r\n role: 'assistant',\r\n text: `Hello! I'm ${agentName}. How can I help you today?`,\r\n timestamp: new Date()\r\n }]);\r\n }, [agentName]);\r\n\r\n const handleOpen = () => {\r\n setIsOpen(true);\r\n onOpen?.();\r\n };\r\n\r\n const handleClose = () => {\r\n setIsOpen(false);\r\n onClose?.();\r\n };\r\n\r\n const handleSend = async (e?: React.FormEvent) => {\r\n e?.preventDefault();\r\n if (!input.trim() || isLoading) return;\r\n\r\n const userMessage: Message = {\r\n id: Date.now().toString(),\r\n role: 'user',\r\n text: input,\r\n timestamp: new Date()\r\n };\r\n\r\n setMessages(prev => [...prev, userMessage]);\r\n onMessage?.(input, 'user');\r\n setInput('');\r\n setIsLoading(true);\r\n\r\n try {\r\n const response = await fetch('https://api.vox.ai/v1/chat', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': `Bearer ${apiKey}`\r\n },\r\n body: JSON.stringify({\r\n message: userMessage.text,\r\n history: messages.map(m => ({ role: m.role, content: m.text }))\r\n })\r\n });\r\n\r\n const data = await response.json();\r\n \r\n const assistantMessage: Message = {\r\n id: (Date.now() + 1).toString(),\r\n role: 'assistant',\r\n text: data.response || 'Sorry, I encountered an error.',\r\n timestamp: new Date()\r\n };\r\n\r\n setMessages(prev => [...prev, assistantMessage]);\r\n onMessage?.(assistantMessage.text, 'assistant');\r\n } catch (error) {\r\n const errorMessage: Message = {\r\n id: (Date.now() + 1).toString(),\r\n role: 'assistant',\r\n text: 'Sorry, I encountered an error. Please try again.',\r\n timestamp: new Date()\r\n };\r\n setMessages(prev => [...prev, errorMessage]);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n const positionStyles = position === 'bottom-left' \r\n ? { left: '16px' } \r\n : { right: '16px' };\r\n\r\n const colors = actualTheme === 'dark' ? {\r\n bg: '#000000',\r\n bgSecondary: '#18181b',\r\n border: '#27272a',\r\n text: '#ffffff',\r\n textSecondary: '#a1a1aa',\r\n userBubble: '#27272a',\r\n assistantBubble: '#000000',\r\n } : {\r\n bg: '#ffffff',\r\n bgSecondary: '#f4f4f5',\r\n border: '#e4e4e7',\r\n text: '#000000',\r\n textSecondary: '#71717a',\r\n userBubble: '#f4f4f5',\r\n assistantBubble: '#ffffff',\r\n };\r\n\r\n return (\r\n <>\r\n {/* Chat Window */}\r\n {isOpen && (\r\n <div\r\n style={{\r\n position: 'fixed',\r\n bottom: '80px',\r\n ...positionStyles,\r\n width: '380px',\r\n maxWidth: 'calc(100vw - 32px)',\r\n height: '500px',\r\n maxHeight: 'calc(100vh - 120px)',\r\n backgroundColor: colors.bg,\r\n border: `1px solid ${colors.border}`,\r\n boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n zIndex: 9999,\r\n fontFamily: 'system-ui, -apple-system, sans-serif',\r\n }}\r\n >\r\n {/* Header */}\r\n <div\r\n style={{\r\n padding: '16px',\r\n borderBottom: `1px solid ${colors.border}`,\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n }}\r\n >\r\n <div>\r\n <div style={{ \r\n fontSize: '10px', \r\n fontWeight: 900, \r\n color: colors.text,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.1em'\r\n }}>\r\n {agentName}\r\n </div>\r\n <div style={{ \r\n fontSize: '9px', \r\n color: colors.textSecondary,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.1em',\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px'\r\n }}>\r\n <span style={{\r\n width: '6px',\r\n height: '6px',\r\n backgroundColor: '#22c55e',\r\n borderRadius: '50%'\r\n }}></span>\r\n Online\r\n </div>\r\n </div>\r\n <button\r\n onClick={handleClose}\r\n style={{\r\n background: 'none',\r\n border: 'none',\r\n color: colors.textSecondary,\r\n cursor: 'pointer',\r\n padding: '4px',\r\n }}\r\n >\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\r\n <path d=\"M18 6L6 18M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n {/* Messages */}\r\n <div\r\n ref={scrollRef}\r\n style={{\r\n flex: 1,\r\n overflowY: 'auto',\r\n padding: '16px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n }}\r\n >\r\n {messages.map((msg) => (\r\n <div\r\n key={msg.id}\r\n style={{\r\n display: 'flex',\r\n justifyContent: msg.role === 'user' ? 'flex-end' : 'flex-start',\r\n }}\r\n >\r\n <div\r\n style={{\r\n maxWidth: '80%',\r\n padding: '10px 14px',\r\n backgroundColor: msg.role === 'user' ? colors.userBubble : colors.assistantBubble,\r\n border: `1px solid ${colors.border}`,\r\n color: colors.text,\r\n fontSize: '13px',\r\n lineHeight: 1.5,\r\n }}\r\n >\r\n {msg.text}\r\n </div>\r\n </div>\r\n ))}\r\n {isLoading && (\r\n <div style={{ display: 'flex', justifyContent: 'flex-start' }}>\r\n <div\r\n style={{\r\n padding: '10px 14px',\r\n backgroundColor: colors.assistantBubble,\r\n border: `1px solid ${colors.border}`,\r\n color: colors.textSecondary,\r\n fontSize: '13px',\r\n }}\r\n >\r\n Typing...\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Input */}\r\n <form\r\n onSubmit={handleSend}\r\n style={{\r\n padding: '16px',\r\n borderTop: `1px solid ${colors.border}`,\r\n display: 'flex',\r\n gap: '8px',\r\n }}\r\n >\r\n <input\r\n type=\"text\"\r\n value={input}\r\n onChange={(e) => setInput(e.target.value)}\r\n placeholder=\"Type a message...\"\r\n style={{\r\n flex: 1,\r\n padding: '10px 14px',\r\n backgroundColor: colors.bgSecondary,\r\n border: `1px solid ${colors.border}`,\r\n color: colors.text,\r\n fontSize: '13px',\r\n outline: 'none',\r\n }}\r\n />\r\n <button\r\n type=\"submit\"\r\n disabled={!input.trim() || isLoading}\r\n style={{\r\n padding: '10px 16px',\r\n backgroundColor: colors.text,\r\n color: colors.bg,\r\n border: 'none',\r\n fontSize: '11px',\r\n fontWeight: 700,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.05em',\r\n cursor: input.trim() && !isLoading ? 'pointer' : 'not-allowed',\r\n opacity: input.trim() && !isLoading ? 1 : 0.5,\r\n }}\r\n >\r\n Send\r\n </button>\r\n </form>\r\n </div>\r\n )}\r\n\r\n {/* Launcher Button */}\r\n {!isOpen && (\r\n <button\r\n onClick={handleOpen}\r\n style={{\r\n position: 'fixed',\r\n bottom: '16px',\r\n ...positionStyles,\r\n width: `${buttonSize}px`,\r\n height: `${buttonSize}px`,\r\n backgroundColor: finalButtonColor,\r\n borderRadius: `${borderRadius}px`,\r\n border: 'none',\r\n boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n zIndex: 9999,\r\n transition: 'transform 0.2s, box-shadow 0.2s',\r\n }}\r\n onMouseEnter={(e) => {\r\n e.currentTarget.style.transform = 'scale(1.05)';\r\n e.currentTarget.style.boxShadow = '0 6px 20px rgba(0, 0, 0, 0.2)';\r\n }}\r\n onMouseLeave={(e) => {\r\n e.currentTarget.style.transform = 'scale(1)';\r\n e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.15)';\r\n }}\r\n >\r\n <svg\r\n width={buttonSize * 0.4}\r\n height={buttonSize * 0.4}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke={finalIconColor}\r\n strokeWidth=\"1.5\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n >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 -0,0 +1,235 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
|
|
8
|
+
const VoxChat = ({ apiKey, agentName = 'VOX-01', position = 'bottom-right', theme = 'dark', buttonColor, buttonSize = 48, borderRadius = 0, iconColor, onOpen, onClose, onMessage, }) => {
|
|
9
|
+
const [isOpen, setIsOpen] = react.useState(false);
|
|
10
|
+
const [messages, setMessages] = react.useState([]);
|
|
11
|
+
const [input, setInput] = react.useState('');
|
|
12
|
+
const [isLoading, setIsLoading] = react.useState(false);
|
|
13
|
+
const scrollRef = react.useRef(null);
|
|
14
|
+
// Determine actual theme
|
|
15
|
+
const actualTheme = theme === 'auto'
|
|
16
|
+
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
|
17
|
+
: theme;
|
|
18
|
+
// Default colors based on theme
|
|
19
|
+
const defaultButtonColor = actualTheme === 'dark' ? '#000000' : '#ffffff';
|
|
20
|
+
const defaultIconColor = actualTheme === 'dark' ? '#ffffff' : '#000000';
|
|
21
|
+
const finalButtonColor = buttonColor || defaultButtonColor;
|
|
22
|
+
const finalIconColor = iconColor || defaultIconColor;
|
|
23
|
+
react.useEffect(() => {
|
|
24
|
+
if (scrollRef.current) {
|
|
25
|
+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
26
|
+
}
|
|
27
|
+
}, [messages]);
|
|
28
|
+
react.useEffect(() => {
|
|
29
|
+
// Add welcome message
|
|
30
|
+
setMessages([{
|
|
31
|
+
id: 'welcome',
|
|
32
|
+
role: 'assistant',
|
|
33
|
+
text: `Hello! I'm ${agentName}. How can I help you today?`,
|
|
34
|
+
timestamp: new Date()
|
|
35
|
+
}]);
|
|
36
|
+
}, [agentName]);
|
|
37
|
+
const handleOpen = () => {
|
|
38
|
+
setIsOpen(true);
|
|
39
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
40
|
+
};
|
|
41
|
+
const handleClose = () => {
|
|
42
|
+
setIsOpen(false);
|
|
43
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
44
|
+
};
|
|
45
|
+
const handleSend = async (e) => {
|
|
46
|
+
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
47
|
+
if (!input.trim() || isLoading)
|
|
48
|
+
return;
|
|
49
|
+
const userMessage = {
|
|
50
|
+
id: Date.now().toString(),
|
|
51
|
+
role: 'user',
|
|
52
|
+
text: input,
|
|
53
|
+
timestamp: new Date()
|
|
54
|
+
};
|
|
55
|
+
setMessages(prev => [...prev, userMessage]);
|
|
56
|
+
onMessage === null || onMessage === void 0 ? void 0 : onMessage(input, 'user');
|
|
57
|
+
setInput('');
|
|
58
|
+
setIsLoading(true);
|
|
59
|
+
try {
|
|
60
|
+
const response = await fetch('https://api.vox.ai/v1/chat', {
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers: {
|
|
63
|
+
'Content-Type': 'application/json',
|
|
64
|
+
'Authorization': `Bearer ${apiKey}`
|
|
65
|
+
},
|
|
66
|
+
body: JSON.stringify({
|
|
67
|
+
message: userMessage.text,
|
|
68
|
+
history: messages.map(m => ({ role: m.role, content: m.text }))
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
const data = await response.json();
|
|
72
|
+
const assistantMessage = {
|
|
73
|
+
id: (Date.now() + 1).toString(),
|
|
74
|
+
role: 'assistant',
|
|
75
|
+
text: data.response || 'Sorry, I encountered an error.',
|
|
76
|
+
timestamp: new Date()
|
|
77
|
+
};
|
|
78
|
+
setMessages(prev => [...prev, assistantMessage]);
|
|
79
|
+
onMessage === null || onMessage === void 0 ? void 0 : onMessage(assistantMessage.text, 'assistant');
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const errorMessage = {
|
|
83
|
+
id: (Date.now() + 1).toString(),
|
|
84
|
+
role: 'assistant',
|
|
85
|
+
text: 'Sorry, I encountered an error. Please try again.',
|
|
86
|
+
timestamp: new Date()
|
|
87
|
+
};
|
|
88
|
+
setMessages(prev => [...prev, errorMessage]);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
setIsLoading(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const positionStyles = position === 'bottom-left'
|
|
95
|
+
? { left: '16px' }
|
|
96
|
+
: { right: '16px' };
|
|
97
|
+
const colors = actualTheme === 'dark' ? {
|
|
98
|
+
bg: '#000000',
|
|
99
|
+
bgSecondary: '#18181b',
|
|
100
|
+
border: '#27272a',
|
|
101
|
+
text: '#ffffff',
|
|
102
|
+
textSecondary: '#a1a1aa',
|
|
103
|
+
userBubble: '#27272a',
|
|
104
|
+
assistantBubble: '#000000',
|
|
105
|
+
} : {
|
|
106
|
+
bg: '#ffffff',
|
|
107
|
+
bgSecondary: '#f4f4f5',
|
|
108
|
+
border: '#e4e4e7',
|
|
109
|
+
text: '#000000',
|
|
110
|
+
textSecondary: '#71717a',
|
|
111
|
+
userBubble: '#f4f4f5',
|
|
112
|
+
assistantBubble: '#ffffff',
|
|
113
|
+
};
|
|
114
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isOpen && (jsxRuntime.jsxs("div", { style: {
|
|
115
|
+
position: 'fixed',
|
|
116
|
+
bottom: '80px',
|
|
117
|
+
...positionStyles,
|
|
118
|
+
width: '380px',
|
|
119
|
+
maxWidth: 'calc(100vw - 32px)',
|
|
120
|
+
height: '500px',
|
|
121
|
+
maxHeight: 'calc(100vh - 120px)',
|
|
122
|
+
backgroundColor: colors.bg,
|
|
123
|
+
border: `1px solid ${colors.border}`,
|
|
124
|
+
boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
|
|
125
|
+
display: 'flex',
|
|
126
|
+
flexDirection: 'column',
|
|
127
|
+
zIndex: 9999,
|
|
128
|
+
fontFamily: 'system-ui, -apple-system, sans-serif',
|
|
129
|
+
}, children: [jsxRuntime.jsxs("div", { style: {
|
|
130
|
+
padding: '16px',
|
|
131
|
+
borderBottom: `1px solid ${colors.border}`,
|
|
132
|
+
display: 'flex',
|
|
133
|
+
justifyContent: 'space-between',
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
}, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { style: {
|
|
136
|
+
fontSize: '10px',
|
|
137
|
+
fontWeight: 900,
|
|
138
|
+
color: colors.text,
|
|
139
|
+
textTransform: 'uppercase',
|
|
140
|
+
letterSpacing: '0.1em'
|
|
141
|
+
}, children: agentName }), jsxRuntime.jsxs("div", { style: {
|
|
142
|
+
fontSize: '9px',
|
|
143
|
+
color: colors.textSecondary,
|
|
144
|
+
textTransform: 'uppercase',
|
|
145
|
+
letterSpacing: '0.1em',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
gap: '6px'
|
|
149
|
+
}, children: [jsxRuntime.jsx("span", { style: {
|
|
150
|
+
width: '6px',
|
|
151
|
+
height: '6px',
|
|
152
|
+
backgroundColor: '#22c55e',
|
|
153
|
+
borderRadius: '50%'
|
|
154
|
+
} }), "Online"] })] }), jsxRuntime.jsx("button", { onClick: handleClose, style: {
|
|
155
|
+
background: 'none',
|
|
156
|
+
border: 'none',
|
|
157
|
+
color: colors.textSecondary,
|
|
158
|
+
cursor: 'pointer',
|
|
159
|
+
padding: '4px',
|
|
160
|
+
}, children: jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsxRuntime.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) }) })] }), jsxRuntime.jsxs("div", { ref: scrollRef, style: {
|
|
161
|
+
flex: 1,
|
|
162
|
+
overflowY: 'auto',
|
|
163
|
+
padding: '16px',
|
|
164
|
+
display: 'flex',
|
|
165
|
+
flexDirection: 'column',
|
|
166
|
+
gap: '12px',
|
|
167
|
+
}, children: [messages.map((msg) => (jsxRuntime.jsx("div", { style: {
|
|
168
|
+
display: 'flex',
|
|
169
|
+
justifyContent: msg.role === 'user' ? 'flex-end' : 'flex-start',
|
|
170
|
+
}, children: jsxRuntime.jsx("div", { style: {
|
|
171
|
+
maxWidth: '80%',
|
|
172
|
+
padding: '10px 14px',
|
|
173
|
+
backgroundColor: msg.role === 'user' ? colors.userBubble : colors.assistantBubble,
|
|
174
|
+
border: `1px solid ${colors.border}`,
|
|
175
|
+
color: colors.text,
|
|
176
|
+
fontSize: '13px',
|
|
177
|
+
lineHeight: 1.5,
|
|
178
|
+
}, children: msg.text }) }, msg.id))), isLoading && (jsxRuntime.jsx("div", { style: { display: 'flex', justifyContent: 'flex-start' }, children: jsxRuntime.jsx("div", { style: {
|
|
179
|
+
padding: '10px 14px',
|
|
180
|
+
backgroundColor: colors.assistantBubble,
|
|
181
|
+
border: `1px solid ${colors.border}`,
|
|
182
|
+
color: colors.textSecondary,
|
|
183
|
+
fontSize: '13px',
|
|
184
|
+
}, children: "Typing..." }) }))] }), jsxRuntime.jsxs("form", { onSubmit: handleSend, style: {
|
|
185
|
+
padding: '16px',
|
|
186
|
+
borderTop: `1px solid ${colors.border}`,
|
|
187
|
+
display: 'flex',
|
|
188
|
+
gap: '8px',
|
|
189
|
+
}, children: [jsxRuntime.jsx("input", { type: "text", value: input, onChange: (e) => setInput(e.target.value), placeholder: "Type a message...", style: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
padding: '10px 14px',
|
|
192
|
+
backgroundColor: colors.bgSecondary,
|
|
193
|
+
border: `1px solid ${colors.border}`,
|
|
194
|
+
color: colors.text,
|
|
195
|
+
fontSize: '13px',
|
|
196
|
+
outline: 'none',
|
|
197
|
+
} }), jsxRuntime.jsx("button", { type: "submit", disabled: !input.trim() || isLoading, style: {
|
|
198
|
+
padding: '10px 16px',
|
|
199
|
+
backgroundColor: colors.text,
|
|
200
|
+
color: colors.bg,
|
|
201
|
+
border: 'none',
|
|
202
|
+
fontSize: '11px',
|
|
203
|
+
fontWeight: 700,
|
|
204
|
+
textTransform: 'uppercase',
|
|
205
|
+
letterSpacing: '0.05em',
|
|
206
|
+
cursor: input.trim() && !isLoading ? 'pointer' : 'not-allowed',
|
|
207
|
+
opacity: input.trim() && !isLoading ? 1 : 0.5,
|
|
208
|
+
}, children: "Send" })] })] })), !isOpen && (jsxRuntime.jsx("button", { onClick: handleOpen, style: {
|
|
209
|
+
position: 'fixed',
|
|
210
|
+
bottom: '16px',
|
|
211
|
+
...positionStyles,
|
|
212
|
+
width: `${buttonSize}px`,
|
|
213
|
+
height: `${buttonSize}px`,
|
|
214
|
+
backgroundColor: finalButtonColor,
|
|
215
|
+
borderRadius: `${borderRadius}px`,
|
|
216
|
+
border: 'none',
|
|
217
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',
|
|
218
|
+
cursor: 'pointer',
|
|
219
|
+
display: 'flex',
|
|
220
|
+
alignItems: 'center',
|
|
221
|
+
justifyContent: 'center',
|
|
222
|
+
zIndex: 9999,
|
|
223
|
+
transition: 'transform 0.2s, box-shadow 0.2s',
|
|
224
|
+
}, onMouseEnter: (e) => {
|
|
225
|
+
e.currentTarget.style.transform = 'scale(1.05)';
|
|
226
|
+
e.currentTarget.style.boxShadow = '0 6px 20px rgba(0, 0, 0, 0.2)';
|
|
227
|
+
}, onMouseLeave: (e) => {
|
|
228
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
229
|
+
e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.15)';
|
|
230
|
+
}, children: jsxRuntime.jsx("svg", { width: buttonSize * 0.4, height: buttonSize * 0.4, viewBox: "0 0 24 24", fill: "none", stroke: finalIconColor, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: jsxRuntime.jsx("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }) }) }))] }));
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
exports.VoxChat = VoxChat;
|
|
234
|
+
exports.default = VoxChat;
|
|
235
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\n\r\nexport interface VoxChatProps {\r\n apiKey: string;\r\n agentName?: string;\r\n position?: 'bottom-right' | 'bottom-left';\r\n theme?: 'dark' | 'light' | 'auto';\r\n buttonColor?: string;\r\n buttonSize?: number;\r\n borderRadius?: number;\r\n iconColor?: string;\r\n onOpen?: () => void;\r\n onClose?: () => void;\r\n onMessage?: (message: string, role: 'user' | 'assistant') => void;\r\n}\r\n\r\ninterface Message {\r\n id: string;\r\n role: 'user' | 'assistant';\r\n text: string;\r\n timestamp: Date;\r\n}\r\n\r\nexport const VoxChat: React.FC<VoxChatProps> = ({\r\n apiKey,\r\n agentName = 'VOX-01',\r\n position = 'bottom-right',\r\n theme = 'dark',\r\n buttonColor,\r\n buttonSize = 48,\r\n borderRadius = 0,\r\n iconColor,\r\n onOpen,\r\n onClose,\r\n onMessage,\r\n}) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [messages, setMessages] = useState<Message[]>([]);\r\n const [input, setInput] = useState('');\r\n const [isLoading, setIsLoading] = useState(false);\r\n const scrollRef = useRef<HTMLDivElement>(null);\r\n\r\n // Determine actual theme\r\n const actualTheme = theme === 'auto' \r\n ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\r\n : theme;\r\n\r\n // Default colors based on theme\r\n const defaultButtonColor = actualTheme === 'dark' ? '#000000' : '#ffffff';\r\n const defaultIconColor = actualTheme === 'dark' ? '#ffffff' : '#000000';\r\n const finalButtonColor = buttonColor || defaultButtonColor;\r\n const finalIconColor = iconColor || defaultIconColor;\r\n\r\n useEffect(() => {\r\n if (scrollRef.current) {\r\n scrollRef.current.scrollTop = scrollRef.current.scrollHeight;\r\n }\r\n }, [messages]);\r\n\r\n useEffect(() => {\r\n // Add welcome message\r\n setMessages([{\r\n id: 'welcome',\r\n role: 'assistant',\r\n text: `Hello! I'm ${agentName}. How can I help you today?`,\r\n timestamp: new Date()\r\n }]);\r\n }, [agentName]);\r\n\r\n const handleOpen = () => {\r\n setIsOpen(true);\r\n onOpen?.();\r\n };\r\n\r\n const handleClose = () => {\r\n setIsOpen(false);\r\n onClose?.();\r\n };\r\n\r\n const handleSend = async (e?: React.FormEvent) => {\r\n e?.preventDefault();\r\n if (!input.trim() || isLoading) return;\r\n\r\n const userMessage: Message = {\r\n id: Date.now().toString(),\r\n role: 'user',\r\n text: input,\r\n timestamp: new Date()\r\n };\r\n\r\n setMessages(prev => [...prev, userMessage]);\r\n onMessage?.(input, 'user');\r\n setInput('');\r\n setIsLoading(true);\r\n\r\n try {\r\n const response = await fetch('https://api.vox.ai/v1/chat', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': `Bearer ${apiKey}`\r\n },\r\n body: JSON.stringify({\r\n message: userMessage.text,\r\n history: messages.map(m => ({ role: m.role, content: m.text }))\r\n })\r\n });\r\n\r\n const data = await response.json();\r\n \r\n const assistantMessage: Message = {\r\n id: (Date.now() + 1).toString(),\r\n role: 'assistant',\r\n text: data.response || 'Sorry, I encountered an error.',\r\n timestamp: new Date()\r\n };\r\n\r\n setMessages(prev => [...prev, assistantMessage]);\r\n onMessage?.(assistantMessage.text, 'assistant');\r\n } catch (error) {\r\n const errorMessage: Message = {\r\n id: (Date.now() + 1).toString(),\r\n role: 'assistant',\r\n text: 'Sorry, I encountered an error. Please try again.',\r\n timestamp: new Date()\r\n };\r\n setMessages(prev => [...prev, errorMessage]);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n const positionStyles = position === 'bottom-left' \r\n ? { left: '16px' } \r\n : { right: '16px' };\r\n\r\n const colors = actualTheme === 'dark' ? {\r\n bg: '#000000',\r\n bgSecondary: '#18181b',\r\n border: '#27272a',\r\n text: '#ffffff',\r\n textSecondary: '#a1a1aa',\r\n userBubble: '#27272a',\r\n assistantBubble: '#000000',\r\n } : {\r\n bg: '#ffffff',\r\n bgSecondary: '#f4f4f5',\r\n border: '#e4e4e7',\r\n text: '#000000',\r\n textSecondary: '#71717a',\r\n userBubble: '#f4f4f5',\r\n assistantBubble: '#ffffff',\r\n };\r\n\r\n return (\r\n <>\r\n {/* Chat Window */}\r\n {isOpen && (\r\n <div\r\n style={{\r\n position: 'fixed',\r\n bottom: '80px',\r\n ...positionStyles,\r\n width: '380px',\r\n maxWidth: 'calc(100vw - 32px)',\r\n height: '500px',\r\n maxHeight: 'calc(100vh - 120px)',\r\n backgroundColor: colors.bg,\r\n border: `1px solid ${colors.border}`,\r\n boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n zIndex: 9999,\r\n fontFamily: 'system-ui, -apple-system, sans-serif',\r\n }}\r\n >\r\n {/* Header */}\r\n <div\r\n style={{\r\n padding: '16px',\r\n borderBottom: `1px solid ${colors.border}`,\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n }}\r\n >\r\n <div>\r\n <div style={{ \r\n fontSize: '10px', \r\n fontWeight: 900, \r\n color: colors.text,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.1em'\r\n }}>\r\n {agentName}\r\n </div>\r\n <div style={{ \r\n fontSize: '9px', \r\n color: colors.textSecondary,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.1em',\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px'\r\n }}>\r\n <span style={{\r\n width: '6px',\r\n height: '6px',\r\n backgroundColor: '#22c55e',\r\n borderRadius: '50%'\r\n }}></span>\r\n Online\r\n </div>\r\n </div>\r\n <button\r\n onClick={handleClose}\r\n style={{\r\n background: 'none',\r\n border: 'none',\r\n color: colors.textSecondary,\r\n cursor: 'pointer',\r\n padding: '4px',\r\n }}\r\n >\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\r\n <path d=\"M18 6L6 18M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n {/* Messages */}\r\n <div\r\n ref={scrollRef}\r\n style={{\r\n flex: 1,\r\n overflowY: 'auto',\r\n padding: '16px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n }}\r\n >\r\n {messages.map((msg) => (\r\n <div\r\n key={msg.id}\r\n style={{\r\n display: 'flex',\r\n justifyContent: msg.role === 'user' ? 'flex-end' : 'flex-start',\r\n }}\r\n >\r\n <div\r\n style={{\r\n maxWidth: '80%',\r\n padding: '10px 14px',\r\n backgroundColor: msg.role === 'user' ? colors.userBubble : colors.assistantBubble,\r\n border: `1px solid ${colors.border}`,\r\n color: colors.text,\r\n fontSize: '13px',\r\n lineHeight: 1.5,\r\n }}\r\n >\r\n {msg.text}\r\n </div>\r\n </div>\r\n ))}\r\n {isLoading && (\r\n <div style={{ display: 'flex', justifyContent: 'flex-start' }}>\r\n <div\r\n style={{\r\n padding: '10px 14px',\r\n backgroundColor: colors.assistantBubble,\r\n border: `1px solid ${colors.border}`,\r\n color: colors.textSecondary,\r\n fontSize: '13px',\r\n }}\r\n >\r\n Typing...\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Input */}\r\n <form\r\n onSubmit={handleSend}\r\n style={{\r\n padding: '16px',\r\n borderTop: `1px solid ${colors.border}`,\r\n display: 'flex',\r\n gap: '8px',\r\n }}\r\n >\r\n <input\r\n type=\"text\"\r\n value={input}\r\n onChange={(e) => setInput(e.target.value)}\r\n placeholder=\"Type a message...\"\r\n style={{\r\n flex: 1,\r\n padding: '10px 14px',\r\n backgroundColor: colors.bgSecondary,\r\n border: `1px solid ${colors.border}`,\r\n color: colors.text,\r\n fontSize: '13px',\r\n outline: 'none',\r\n }}\r\n />\r\n <button\r\n type=\"submit\"\r\n disabled={!input.trim() || isLoading}\r\n style={{\r\n padding: '10px 16px',\r\n backgroundColor: colors.text,\r\n color: colors.bg,\r\n border: 'none',\r\n fontSize: '11px',\r\n fontWeight: 700,\r\n textTransform: 'uppercase',\r\n letterSpacing: '0.05em',\r\n cursor: input.trim() && !isLoading ? 'pointer' : 'not-allowed',\r\n opacity: input.trim() && !isLoading ? 1 : 0.5,\r\n }}\r\n >\r\n Send\r\n </button>\r\n </form>\r\n </div>\r\n )}\r\n\r\n {/* Launcher Button */}\r\n {!isOpen && (\r\n <button\r\n onClick={handleOpen}\r\n style={{\r\n position: 'fixed',\r\n bottom: '16px',\r\n ...positionStyles,\r\n width: `${buttonSize}px`,\r\n height: `${buttonSize}px`,\r\n backgroundColor: finalButtonColor,\r\n borderRadius: `${borderRadius}px`,\r\n border: 'none',\r\n boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n zIndex: 9999,\r\n transition: 'transform 0.2s, box-shadow 0.2s',\r\n }}\r\n onMouseEnter={(e) => {\r\n e.currentTarget.style.transform = 'scale(1.05)';\r\n e.currentTarget.style.boxShadow = '0 6px 20px rgba(0, 0, 0, 0.2)';\r\n }}\r\n onMouseLeave={(e) => {\r\n e.currentTarget.style.transform = 'scale(1)';\r\n e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.15)';\r\n }}\r\n >\r\n <svg\r\n width={buttonSize * 0.4}\r\n height={buttonSize * 0.4}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke={finalIconColor}\r\n strokeWidth=\"1.5\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n >\r\n <path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\" />\r\n </svg>\r\n </button>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default VoxChat;\r\n"],"names":["useState","useRef","useEffect","_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;AAuBO,MAA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EAAE,gBAAgB;oBACjC,YAAY,EAAE,CAAA,EAAG,YAAY,CAAA,EAAA,CAAI;AACjC,oBAAA,MAAM,EAAE,MAAM;AACd,oBAAA,SAAS,EAAE,gCAAgC;AAC3C,oBAAA,MAAM,EAAE,SAAS;AACjB,oBAAA,OAAO,EAAE,MAAM;AACf,oBAAA,UAAU,EAAE,QAAQ;AACpB,oBAAA,cAAc,EAAE,QAAQ;AACxB,oBAAA,MAAM,EAAE,IAAI;AACZ,oBAAA,UAAU,EAAE,iCAAiC;AAC9C,iBAAA,EACD,YAAY,EAAE,CAAC,CAAC,KAAI;oBAClB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,aAAa;oBAC/C,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,+BAA+B;AACnE,gBAAA,CAAC,EACD,YAAY,EAAE,CAAC,CAAC,KAAI;oBAClB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU;oBAC5C,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,gCAAgC;gBACpE,CAAC,EAAA,QAAA,EAEDA,wBACE,KAAK,EAAE,UAAU,GAAG,GAAG,EACvB,MAAM,EAAE,UAAU,GAAG,GAAG,EACxB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,YAEtBA,cAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,gCAAgC,EAAA,CAAG,GACvC,EAAA,CACC,CACV,CAAA,EAAA,CACA;AAEP;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vox-ai-react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "VOX AI Chat Widget for React applications",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rollup -c",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": ">=17.0.0",
|
|
17
|
+
"react-dom": ">=17.0.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
21
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
22
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
23
|
+
"@types/react": "^18.0.0",
|
|
24
|
+
"rollup": "^4.0.0",
|
|
25
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
26
|
+
"typescript": "^5.0.0"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"react",
|
|
30
|
+
"chat",
|
|
31
|
+
"widget",
|
|
32
|
+
"ai",
|
|
33
|
+
"voice",
|
|
34
|
+
"support",
|
|
35
|
+
"vox"
|
|
36
|
+
],
|
|
37
|
+
"author": "VOX AI",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/vox-ai/vox-react"
|
|
42
|
+
}
|
|
43
|
+
}
|