@botuyo/chat-widget-standalone 1.0.2 → 1.0.5
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 +158 -226
- package/dist/ChatWidget-3m1RqH_c.js +33 -0
- package/dist/ChatWidget-3m1RqH_c.js.map +1 -0
- package/dist/botuyo-chat.css +1 -1
- package/dist/botuyo-chat.es.js +2 -0
- package/dist/botuyo-chat.es.js.map +1 -0
- package/dist/botuyo-chat.umd.css +1 -0
- package/dist/botuyo-chat.umd.js +2 -0
- package/dist/botuyo-chat.umd.js.map +1 -0
- package/dist/chunk-audio-C4Q6VB-1.js +13 -0
- package/dist/chunk-audio-C4Q6VB-1.js.map +1 -0
- package/dist/chunk-chat-ui-DmqgsaBa.js +104 -0
- package/dist/chunk-chat-ui-DmqgsaBa.js.map +1 -0
- package/dist/{chunk-gallery-CHMxgXlB.js → chunk-gallery-Ca7lW3V4.js} +2 -2
- package/dist/{chunk-gallery-CHMxgXlB.js.map → chunk-gallery-Ca7lW3V4.js.map} +1 -1
- package/dist/src/chat-widget/ChatWidget.d.ts +1 -0
- package/dist/src/chat-widget/ChatWidget.d.ts.map +1 -1
- package/dist/src/chat-widget/components/AudioPlayer.d.ts.map +1 -1
- package/dist/src/chat-widget/components/ChatWindow.d.ts +2 -1
- package/dist/src/chat-widget/components/ChatWindow.d.ts.map +1 -1
- package/dist/src/chat-widget/components/Icons.d.ts +4 -1
- package/dist/src/chat-widget/components/Icons.d.ts.map +1 -1
- package/dist/src/chat-widget/components/InputArea.d.ts +2 -1
- package/dist/src/chat-widget/components/InputArea.d.ts.map +1 -1
- package/dist/src/chat-widget/components/InputArea.stories.d.ts +1 -0
- package/dist/src/chat-widget/components/InputArea.stories.d.ts.map +1 -1
- package/dist/src/chat-widget/components/Launcher.d.ts.map +1 -1
- package/dist/src/chat-widget/components/MessageBubble.d.ts +1 -0
- package/dist/src/chat-widget/components/MessageBubble.d.ts.map +1 -1
- package/dist/src/chat-widget/components/MessageBubble.stories.d.ts +1 -0
- package/dist/src/chat-widget/components/MessageBubble.stories.d.ts.map +1 -1
- package/dist/src/chat-widget/components/VoiceCallDemo.d.ts +15 -0
- package/dist/src/chat-widget/components/VoiceCallDemo.d.ts.map +1 -0
- package/dist/src/chat-widget/contexts/AnimationContext.d.ts +69 -0
- package/dist/src/chat-widget/contexts/AnimationContext.d.ts.map +1 -0
- package/dist/src/chat-widget/hooks/useChatSocket.d.ts.map +1 -1
- package/dist/src/chat-widget/hooks/useChatWidget.d.ts.map +1 -1
- package/dist/src/chat-widget/hooks/useWidgetTheme.d.ts +1 -1
- package/dist/src/chat-widget/types/index.d.ts +54 -0
- package/dist/src/chat-widget/types/index.d.ts.map +1 -1
- package/dist/src/chat-widget/utils/theme.d.ts +2 -2
- package/dist/src/chat-widget/utils/theme.d.ts.map +1 -1
- package/dist/src/chat-widget/utils/theme.examples.d.ts +2 -2
- package/dist/src/chat-widget/utils/theme.examples.d.ts.map +1 -1
- package/dist/standalone.d.ts.map +1 -1
- package/dist/stats-umd.html +4949 -0
- package/dist/stats.html +1 -1
- package/package.json +147 -143
- package/dist/ChatWidget-BCHSZnMy.js +0 -33
- package/dist/ChatWidget-BCHSZnMy.js.map +0 -1
- package/dist/botuyo-chat.js +0 -2
- package/dist/botuyo-chat.js.map +0 -1
- package/dist/chunk-audio-BT2WWPfS.js +0 -10
- package/dist/chunk-audio-BT2WWPfS.js.map +0 -1
- package/dist/chunk-chat-ui-BHfnFN_3.js +0 -89
- package/dist/chunk-chat-ui-BHfnFN_3.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,14 +11,15 @@ Widget de chat AI embebible enterprise-ready. Disponible via **NPM** y **CDN** p
|
|
|
11
11
|
|
|
12
12
|
### Opción 1: CDN (JavaScript Vanilla)
|
|
13
13
|
|
|
14
|
-
Agrega este código antes del cierre de `</body>`:
|
|
15
|
-
|
|
16
14
|
```html
|
|
17
|
-
<!--
|
|
18
|
-
<
|
|
19
|
-
|
|
15
|
+
<!-- CSS (REQUERIDO) -->
|
|
16
|
+
<link rel="stylesheet" href="https://cdn-chatbot.botuyo.com/latest/botuyo-chat.css">
|
|
17
|
+
|
|
18
|
+
<!-- JavaScript -->
|
|
19
|
+
<script src="https://cdn-chatbot.botuyo.com/latest/botuyo-chat.js"></script>
|
|
20
|
+
<script>
|
|
20
21
|
BotUyoChat.init({
|
|
21
|
-
apiKey: 'tu-api-key
|
|
22
|
+
apiKey: 'tu-api-key',
|
|
22
23
|
apiBaseUrl: 'https://api.botuyo.com',
|
|
23
24
|
theme: {
|
|
24
25
|
primaryColor: '#10b981',
|
|
@@ -29,24 +30,24 @@ Agrega este código antes del cierre de `</body>`:
|
|
|
29
30
|
</script>
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
**CDN Alternativo (unpkg):**
|
|
33
|
+
**CDN Alternativo (jsDelivr/unpkg):**
|
|
33
34
|
```html
|
|
34
|
-
<
|
|
35
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@botuyo/chat-widget-standalone@1.0.4/dist/botuyo-chat.umd.css">
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@botuyo/chat-widget-standalone@1.0.4/dist/botuyo-chat.umd.js"></script>
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
### Opción 2: NPM Package (React/Next.js)
|
|
38
40
|
|
|
39
41
|
```bash
|
|
40
|
-
npm install @botuyo/chat-widget-standalone
|
|
42
|
+
npm install @botuyo/chat-widget-standalone@1.0.4
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
**Uso directo:**
|
|
44
45
|
```tsx
|
|
45
46
|
import BotUyoChat from '@botuyo/chat-widget-standalone';
|
|
46
47
|
|
|
47
|
-
// En
|
|
48
|
+
// En useEffect o al cargar
|
|
48
49
|
BotUyoChat.init({
|
|
49
|
-
apiKey: 'tu-api-key
|
|
50
|
+
apiKey: 'tu-api-key',
|
|
50
51
|
apiBaseUrl: 'https://api.botuyo.com',
|
|
51
52
|
theme: {
|
|
52
53
|
primaryColor: '#10b981',
|
|
@@ -65,7 +66,7 @@ interface StandaloneConfig {
|
|
|
65
66
|
// REQUERIDO
|
|
66
67
|
// ═══════════════════════════════════════════
|
|
67
68
|
apiKey: string; // Tu API key de BotUyo
|
|
68
|
-
apiBaseUrl: string; // URL del backend
|
|
69
|
+
apiBaseUrl: string; // URL del backend WebSocket
|
|
69
70
|
|
|
70
71
|
// ═══════════════════════════════════════════
|
|
71
72
|
// TEMA (opcional)
|
|
@@ -74,262 +75,199 @@ interface StandaloneConfig {
|
|
|
74
75
|
primaryColor?: string; // Color principal (default: '#10b981')
|
|
75
76
|
botName?: string; // Nombre del bot (default: 'Asistente Virtual')
|
|
76
77
|
logoUrl?: string; // URL del avatar del bot
|
|
77
|
-
position?: 'bottom-right' | 'bottom-left'
|
|
78
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
78
79
|
welcomeMessage?: string; // Mensaje de bienvenida inicial
|
|
79
|
-
inputPlaceholder?: string; // Placeholder del input
|
|
80
|
-
borderRadius?: string; // Border radius ventana (default: '
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
avatarScale?: number; // Escala del avatar (default: 1)
|
|
80
|
+
inputPlaceholder?: string; // Placeholder del input
|
|
81
|
+
borderRadius?: string; // Border radius ventana (default: '1.5rem')
|
|
82
|
+
height?: string; // Altura del chat (default: '600px')
|
|
83
|
+
bottom?: string; // Distancia desde abajo (default: '24px')
|
|
84
84
|
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
primaryForeground?: string; // Texto sobre primario
|
|
93
|
-
muted?: string; // Color muted
|
|
94
|
-
mutedForeground?: string; // Texto muted
|
|
95
|
-
border?: string; // Color de bordes
|
|
96
|
-
destructive?: string; // Color de errores
|
|
97
|
-
radius?: string; // Border radius global
|
|
85
|
+
// Animaciones
|
|
86
|
+
animations?: {
|
|
87
|
+
enabled?: boolean; // Toggle maestro (default: true)
|
|
88
|
+
messageEntry?: 'spring' | 'slide' | 'fade' | 'scale' | 'none';
|
|
89
|
+
typingIndicator?: 'wave' | 'dots' | 'pulse' | 'none';
|
|
90
|
+
launcherPulse?: boolean; // Pulso del botón launcher
|
|
91
|
+
windowTransitions?: boolean; // Animación apertura/cierre
|
|
98
92
|
};
|
|
99
93
|
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
bot?: {
|
|
109
|
-
bg?: string;
|
|
110
|
-
text?: string;
|
|
111
|
-
border?: string;
|
|
112
|
-
};
|
|
113
|
-
user?: {
|
|
114
|
-
text?: string;
|
|
115
|
-
};
|
|
116
|
-
launcher?: {
|
|
117
|
-
bg?: string;
|
|
118
|
-
pulse?: boolean;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// ═══════════════════════════════════════════
|
|
124
|
-
// CONTEXTO DEL USUARIO (opcional)
|
|
125
|
-
// ═══════════════════════════════════════════
|
|
126
|
-
userContext?: {
|
|
127
|
-
token?: string; // Token de autenticación del usuario
|
|
128
|
-
metadata?: { // Metadata adicional del usuario
|
|
129
|
-
userId?: string;
|
|
130
|
-
email?: string;
|
|
131
|
-
name?: string;
|
|
132
|
-
[key: string]: any;
|
|
94
|
+
// Efectos visuales
|
|
95
|
+
effects?: {
|
|
96
|
+
glassmorphism?: boolean; // Blur en headers
|
|
97
|
+
gradients?: boolean; // Fondos degradados
|
|
98
|
+
softShadows?: boolean; // Sombras suaves
|
|
99
|
+
glowEffects?: boolean; // Glow en focus/hover
|
|
100
|
+
shimmerLoading?: boolean; // Shimmer en carga
|
|
101
|
+
hoverLift?: boolean; // Elevación en hover
|
|
133
102
|
};
|
|
134
103
|
};
|
|
135
104
|
|
|
136
105
|
// ═══════════════════════════════════════════
|
|
137
|
-
//
|
|
106
|
+
// MEDIA CONFIG (opcional)
|
|
138
107
|
// ═══════════════════════════════════════════
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
title?: string; // Título de la página
|
|
144
|
-
path?: string; // Path de la URL
|
|
145
|
-
referrer?: string; // Página de origen
|
|
146
|
-
[key: string]: any; // Metadata adicional
|
|
108
|
+
mediaConfig?: {
|
|
109
|
+
enableVoice?: boolean; // Habilitar notas de voz (default: true)
|
|
110
|
+
enableAttachments?: boolean; // Habilitar adjuntos (default: true)
|
|
111
|
+
enableLocation?: boolean; // Habilitar ubicación (default: true)
|
|
147
112
|
};
|
|
148
113
|
|
|
149
|
-
// ═══════════════════════════════════════════
|
|
150
|
-
// SEO (opcional)
|
|
151
|
-
// ═══════════════════════════════════════════
|
|
152
|
-
includeSEOMetadata?: boolean; // Incluir metadata SEO (default: false)
|
|
153
|
-
|
|
154
114
|
// ═══════════════════════════════════════════
|
|
155
115
|
// CALLBACKS (opcional)
|
|
156
116
|
// ═══════════════════════════════════════════
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
117
|
+
onVoiceCall?: () => void; // Cuando se presiona el botón de llamada
|
|
118
|
+
onNavigate?: (url: string) => void;
|
|
119
|
+
onStateChange?: (isOpen: boolean) => void;
|
|
120
|
+
onEvent?: (eventName: string, data: any) => void;
|
|
161
121
|
}
|
|
162
122
|
```
|
|
163
123
|
|
|
164
124
|
---
|
|
165
125
|
|
|
166
|
-
##
|
|
126
|
+
## 📞 Llamada de Voz (Demo)
|
|
167
127
|
|
|
168
|
-
|
|
128
|
+
El widget incluye un **demo interactivo de llamada de voz** que:
|
|
129
|
+
- Accede al micrófono real del usuario
|
|
130
|
+
- Muestra waveform animado según el nivel de audio
|
|
131
|
+
- Simula respuestas del bot después de 1 segundo de silencio
|
|
169
132
|
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@botuyo/chat-widget-standalone@1.0.0/dist/botuyo-chat.js"></script>
|
|
180
|
-
<script type="module">
|
|
181
|
-
BotUyoChat.init({
|
|
182
|
-
apiKey: 'demo-key-12345',
|
|
183
|
-
apiBaseUrl: 'https://api.botuyo.com'
|
|
184
|
-
});
|
|
185
|
-
</script>
|
|
186
|
-
</body>
|
|
187
|
-
</html>
|
|
133
|
+
```javascript
|
|
134
|
+
BotUyoChat.init({
|
|
135
|
+
apiKey: 'tu-api-key',
|
|
136
|
+
apiBaseUrl: 'https://api.botuyo.com',
|
|
137
|
+
onVoiceCall: () => {
|
|
138
|
+
console.log('Llamada de voz iniciada');
|
|
139
|
+
// El demo se abre automáticamente dentro del widget
|
|
140
|
+
}
|
|
141
|
+
});
|
|
188
142
|
```
|
|
189
143
|
|
|
190
|
-
|
|
144
|
+
> **Nota:** Este es un demo visual. Para integrar llamadas de voz reales, conecta con tu servicio de voz preferido (OpenAI Realtime, LiveKit, Twilio, etc.)
|
|
191
145
|
|
|
192
|
-
|
|
193
|
-
<script type="module">
|
|
194
|
-
BotUyoChat.init({
|
|
195
|
-
apiKey: 'mi-api-key',
|
|
196
|
-
apiBaseUrl: 'https://api.botuyo.com',
|
|
197
|
-
|
|
198
|
-
theme: {
|
|
199
|
-
primaryColor: '#6366f1',
|
|
200
|
-
botName: 'Asistente de Mi Empresa',
|
|
201
|
-
logoUrl: 'https://mi-sitio.com/logo.png',
|
|
202
|
-
position: 'bottom-left',
|
|
203
|
-
welcomeMessage: '¡Hola! 👋 ¿En qué puedo ayudarte hoy?',
|
|
204
|
-
inputPlaceholder: 'Pregúntame lo que quieras...',
|
|
205
|
-
cssVariables: {
|
|
206
|
-
background: '0 0% 100%',
|
|
207
|
-
foreground: '240 10% 3.9%',
|
|
208
|
-
primary: '239 84% 67%',
|
|
209
|
-
card: '0 0% 100%',
|
|
210
|
-
border: '240 6% 90%'
|
|
211
|
-
}
|
|
212
|
-
},
|
|
146
|
+
---
|
|
213
147
|
|
|
214
|
-
|
|
215
|
-
token: 'user-auth-token-jwt',
|
|
216
|
-
metadata: {
|
|
217
|
-
userId: '12345',
|
|
218
|
-
email: 'usuario@ejemplo.com',
|
|
219
|
-
plan: 'premium'
|
|
220
|
-
}
|
|
221
|
-
},
|
|
148
|
+
## 🎨 Theme Builder
|
|
222
149
|
|
|
223
|
-
|
|
224
|
-
page: 'producto',
|
|
225
|
-
id: 'SKU-12345',
|
|
226
|
-
url: window.location.href,
|
|
227
|
-
title: document.title
|
|
228
|
-
},
|
|
150
|
+
Usa el **Theme Builder** para personalizar visualmente el widget:
|
|
229
151
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
},
|
|
152
|
+
```
|
|
153
|
+
https://tu-dominio.com/builder.html
|
|
154
|
+
```
|
|
234
155
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
// Enviar a tu CRM
|
|
240
|
-
sendToCRM(data);
|
|
241
|
-
}
|
|
242
|
-
},
|
|
156
|
+
El builder permite:
|
|
157
|
+
- Cambiar colores en tiempo real
|
|
158
|
+
- Presets: Default, Dark, Ocean, Sunset, Forest
|
|
159
|
+
- Copiar código de integración listo para usar
|
|
243
160
|
|
|
244
|
-
|
|
245
|
-
console.log('Chat:', isOpen ? 'abierto' : 'cerrado');
|
|
246
|
-
// Analytics
|
|
247
|
-
gtag('event', isOpen ? 'chat_opened' : 'chat_closed');
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
</script>
|
|
251
|
-
```
|
|
161
|
+
---
|
|
252
162
|
|
|
253
|
-
|
|
163
|
+
## 🛠️ API Pública
|
|
254
164
|
|
|
255
165
|
```javascript
|
|
256
166
|
// Inicializar
|
|
257
|
-
BotUyoChat.init(
|
|
258
|
-
apiKey: 'mi-api-key',
|
|
259
|
-
apiBaseUrl: 'https://api.botuyo.com'
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
// Abrir el chat
|
|
263
|
-
document.getElementById('btn-ayuda').onclick = () => {
|
|
264
|
-
BotUyoChat.open();
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
// Cerrar el chat
|
|
268
|
-
BotUyoChat.close();
|
|
167
|
+
BotUyoChat.init(config);
|
|
269
168
|
|
|
270
|
-
//
|
|
271
|
-
BotUyoChat.
|
|
169
|
+
// Controles
|
|
170
|
+
BotUyoChat.open(); // Abrir chat
|
|
171
|
+
BotUyoChat.close(); // Cerrar chat
|
|
172
|
+
BotUyoChat.toggle(); // Toggle abierto/cerrado
|
|
173
|
+
BotUyoChat.destroy(); // Destruir widget
|
|
272
174
|
|
|
273
|
-
// Actualizar configuración en
|
|
175
|
+
// Actualizar configuración en vivo
|
|
274
176
|
BotUyoChat.update({
|
|
275
|
-
theme: {
|
|
276
|
-
primaryColor: '#ef4444',
|
|
277
|
-
botName: 'Soporte Urgente'
|
|
278
|
-
}
|
|
177
|
+
theme: { primaryColor: '#ef4444' }
|
|
279
178
|
});
|
|
280
|
-
|
|
281
|
-
// Destruir el widget
|
|
282
|
-
BotUyoChat.destroy();
|
|
283
179
|
```
|
|
284
180
|
|
|
285
181
|
---
|
|
286
182
|
|
|
287
|
-
##
|
|
183
|
+
## 📚 Ejemplos
|
|
184
|
+
|
|
185
|
+
### Ejemplo Mínimo
|
|
186
|
+
```html
|
|
187
|
+
<link rel="stylesheet" href="https://cdn-chatbot.botuyo.com/latest/botuyo-chat.css">
|
|
188
|
+
<script src="https://cdn-chatbot.botuyo.com/latest/botuyo-chat.js"></script>
|
|
189
|
+
<script>
|
|
190
|
+
BotUyoChat.init({
|
|
191
|
+
apiKey: 'demo-key',
|
|
192
|
+
apiBaseUrl: 'https://api.botuyo.com'
|
|
193
|
+
});
|
|
194
|
+
</script>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Ejemplo Completo
|
|
198
|
+
```html
|
|
199
|
+
<script>
|
|
200
|
+
BotUyoChat.init({
|
|
201
|
+
apiKey: 'mi-api-key',
|
|
202
|
+
apiBaseUrl: 'https://api.botuyo.com',
|
|
203
|
+
|
|
204
|
+
theme: {
|
|
205
|
+
primaryColor: '#6366f1',
|
|
206
|
+
botName: 'Asistente Mi Empresa',
|
|
207
|
+
logoUrl: 'https://mi-sitio.com/logo.png',
|
|
208
|
+
position: 'bottom-right',
|
|
209
|
+
welcomeMessage: '¡Hola! 👋 ¿En qué puedo ayudarte?',
|
|
210
|
+
borderRadius: '1.5rem',
|
|
211
|
+
height: '550px',
|
|
212
|
+
|
|
213
|
+
animations: {
|
|
214
|
+
enabled: true,
|
|
215
|
+
messageEntry: 'spring',
|
|
216
|
+
launcherPulse: true,
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
effects: {
|
|
220
|
+
glassmorphism: true,
|
|
221
|
+
softShadows: true,
|
|
222
|
+
glowEffects: true,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
mediaConfig: {
|
|
227
|
+
enableVoice: true,
|
|
228
|
+
enableAttachments: true,
|
|
229
|
+
enableLocation: false,
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
onStateChange: (isOpen) => {
|
|
233
|
+
console.log('Chat:', isOpen ? 'abierto' : 'cerrado');
|
|
234
|
+
},
|
|
288
235
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
| `BotUyoChat.update(config)` | Actualiza la configuración sin reiniciar |
|
|
296
|
-
| `BotUyoChat.destroy()` | Destruye el widget y limpia recursos |
|
|
236
|
+
onVoiceCall: () => {
|
|
237
|
+
console.log('Llamada de voz iniciada');
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
</script>
|
|
241
|
+
```
|
|
297
242
|
|
|
298
243
|
---
|
|
299
244
|
|
|
300
|
-
##
|
|
245
|
+
## 🎭 Temas Predefinidos
|
|
301
246
|
|
|
302
247
|
### Tema Claro (Default)
|
|
303
248
|
```javascript
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
foreground: '240 10% 3.9%',
|
|
307
|
-
primary: '160 84% 39%',
|
|
308
|
-
card: '0 0% 100%',
|
|
309
|
-
border: '240 6% 90%'
|
|
249
|
+
theme: {
|
|
250
|
+
primaryColor: '#10b981'
|
|
310
251
|
}
|
|
311
252
|
```
|
|
312
253
|
|
|
313
254
|
### Tema Oscuro
|
|
314
255
|
```javascript
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
256
|
+
theme: {
|
|
257
|
+
primaryColor: '#8b5cf6',
|
|
258
|
+
cssVariables: {
|
|
259
|
+
background: '240 10% 3.9%',
|
|
260
|
+
foreground: '0 0% 98%',
|
|
261
|
+
card: '240 4% 16%',
|
|
262
|
+
border: '240 4% 20%'
|
|
263
|
+
}
|
|
321
264
|
}
|
|
322
265
|
```
|
|
323
266
|
|
|
324
267
|
### Tema Ocean
|
|
325
268
|
```javascript
|
|
326
269
|
theme: {
|
|
327
|
-
primaryColor: '#0ea5e9'
|
|
328
|
-
cssVariables: {
|
|
329
|
-
background: '200 50% 98%',
|
|
330
|
-
foreground: '200 50% 10%',
|
|
331
|
-
primary: '199 89% 48%'
|
|
332
|
-
}
|
|
270
|
+
primaryColor: '#0ea5e9'
|
|
333
271
|
}
|
|
334
272
|
```
|
|
335
273
|
|
|
@@ -351,11 +289,9 @@ theme: {
|
|
|
351
289
|
## 📦 Build Local
|
|
352
290
|
|
|
353
291
|
```bash
|
|
354
|
-
# Clonar repositorio
|
|
355
292
|
git clone https://github.com/botuyo/chat-widget.git
|
|
356
293
|
cd chat-widget
|
|
357
294
|
|
|
358
|
-
# Instalar dependencias
|
|
359
295
|
npm install
|
|
360
296
|
|
|
361
297
|
# Desarrollo
|
|
@@ -364,28 +300,24 @@ npm run dev
|
|
|
364
300
|
# Build producción
|
|
365
301
|
npm run build
|
|
366
302
|
|
|
303
|
+
# Solo UMD bundle
|
|
304
|
+
npm run build:umd
|
|
305
|
+
|
|
367
306
|
# Tests
|
|
368
307
|
npm test
|
|
369
308
|
```
|
|
370
309
|
|
|
371
|
-
**Archivos generados:**
|
|
372
|
-
- `dist/botuyo-chat.js` - Bundle principal (~3KB, carga chunks lazy)
|
|
373
|
-
- `dist/botuyo-chat.css` - Estilos (~25KB)
|
|
374
|
-
- `dist/vendor-react-*.js` - React (~194KB, lazy)
|
|
375
|
-
- `dist/chunk-chat-ui-*.js` - UI del chat (~89KB, lazy)
|
|
376
|
-
|
|
377
310
|
---
|
|
378
311
|
|
|
379
|
-
##
|
|
312
|
+
## 🔗 Links
|
|
380
313
|
|
|
381
|
-
|
|
314
|
+
- **NPM**: [npmjs.com/package/@botuyo/chat-widget-standalone](https://www.npmjs.com/package/@botuyo/chat-widget-standalone)
|
|
315
|
+
- **CDN BotUyo**: `https://cdn-chatbot.botuyo.com/latest/`
|
|
316
|
+
- **CDN jsDelivr**: `https://cdn.jsdelivr.net/npm/@botuyo/chat-widget-standalone@1.0.4/dist/`
|
|
317
|
+
- **Documentación**: [docs.botuyo.com](https://docs.botuyo.com)
|
|
382
318
|
|
|
383
319
|
---
|
|
384
320
|
|
|
385
|
-
##
|
|
321
|
+
## 📄 Licencia
|
|
386
322
|
|
|
387
|
-
-
|
|
388
|
-
- **CDN jsDelivr**: `https://cdn.jsdelivr.net/npm/@botuyo/chat-widget-standalone@1.0.0/dist/botuyo-chat.js`
|
|
389
|
-
- **CDN unpkg**: `https://unpkg.com/@botuyo/chat-widget-standalone@1.0.0/dist/botuyo-chat.js`
|
|
390
|
-
- **Documentación**: [docs.botuyo.com](https://docs.botuyo.com)
|
|
391
|
-
- **Soporte**: soporte@botuyo.com
|
|
323
|
+
MIT License - © 2026 BotUyo
|