@ihoomanai/chat-widget 4.0.1 → 4.0.2
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/index.cjs.js +165 -219
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +165 -219
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.umd.js +165 -219
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/widget.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/widget.ts +167 -223
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @ihoomanai/chat-widget v4.0.
|
|
3
|
-
*
|
|
2
|
+
* @ihoomanai/chat-widget v4.0.2
|
|
3
|
+
* Universal chat support widget for any website - secure Widget ID based initialization
|
|
4
4
|
*
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @copyright Ihooman AI
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
* Enhanced with professional features
|
|
17
17
|
* @version 3.0.0
|
|
18
18
|
*/
|
|
19
|
-
const VERSION = '4.0.
|
|
19
|
+
const VERSION = '4.0.2';
|
|
20
20
|
const STORAGE_PREFIX = 'ihooman_chat_';
|
|
21
21
|
const DEFAULT_SERVER_URL = 'https://api.ihooman.ai';
|
|
22
22
|
const defaultConfig = {
|
|
23
23
|
serverUrl: DEFAULT_SERVER_URL,
|
|
24
|
-
theme: '
|
|
24
|
+
theme: 'light',
|
|
25
25
|
position: 'bottom-right',
|
|
26
|
-
title: '
|
|
27
|
-
subtitle: '
|
|
28
|
-
welcomeMessage: '
|
|
29
|
-
placeholder: '
|
|
30
|
-
primaryColor: '#
|
|
31
|
-
gradientFrom: '#
|
|
32
|
-
gradientTo: '#
|
|
26
|
+
title: 'Chat Support',
|
|
27
|
+
subtitle: 'We typically reply within minutes',
|
|
28
|
+
welcomeMessage: 'Hi there! 👋 How can we help you today?',
|
|
29
|
+
placeholder: 'Type a message...',
|
|
30
|
+
primaryColor: '#00aeff',
|
|
31
|
+
gradientFrom: '#00aeff',
|
|
32
|
+
gradientTo: '#0066ff',
|
|
33
33
|
showTimestamps: true,
|
|
34
34
|
showTypingIndicator: true,
|
|
35
35
|
enableSounds: true,
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
startOpen: false,
|
|
38
38
|
persistSession: true,
|
|
39
39
|
zIndex: 9999,
|
|
40
|
-
width:
|
|
41
|
-
height:
|
|
42
|
-
buttonSize:
|
|
40
|
+
width: 380,
|
|
41
|
+
height: 560,
|
|
42
|
+
buttonSize: 60,
|
|
43
43
|
borderRadius: 16,
|
|
44
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
44
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
45
45
|
avatarUrl: '',
|
|
46
46
|
poweredBy: true,
|
|
47
47
|
presetQuestions: [],
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
allowLocalhost: true,
|
|
52
52
|
};
|
|
53
53
|
const icons = {
|
|
54
|
-
chat: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
55
|
-
close: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
56
|
-
send: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
57
|
-
attach: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
58
|
-
minimize: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
59
|
-
|
|
60
|
-
agent: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
61
|
-
ticket: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
62
|
-
history: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
63
|
-
plus: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
64
|
-
star: `<svg viewBox="0 0 24 24" fill="currentColor"
|
|
65
|
-
starEmpty: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="
|
|
54
|
+
chat: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>`,
|
|
55
|
+
close: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`,
|
|
56
|
+
send: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>`,
|
|
57
|
+
attach: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"></path></svg>`,
|
|
58
|
+
minimize: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>`,
|
|
59
|
+
bot: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="10" rx="2"></rect><circle cx="12" cy="5" r="2"></circle><path d="M12 7v4"></path></svg>`,
|
|
60
|
+
agent: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>`,
|
|
61
|
+
ticket: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>`,
|
|
62
|
+
history: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>`,
|
|
63
|
+
plus: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>`,
|
|
64
|
+
star: `<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"></path></svg>`,
|
|
65
|
+
starEmpty: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"></path></svg>`};
|
|
66
66
|
let config = { widgetId: '', ...defaultConfig };
|
|
67
67
|
let state = {
|
|
68
68
|
isOpen: false,
|
|
@@ -208,32 +208,21 @@
|
|
|
208
208
|
// STYLES
|
|
209
209
|
// ============================================================================
|
|
210
210
|
function generateStyles() {
|
|
211
|
-
const { fontFamily, borderRadius, zIndex, width, height, buttonSize } = config;
|
|
212
|
-
const isDark = config.theme === 'dark'
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
const
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
const borderColor = isDark ? '#27272a' : '#e4e4e7';
|
|
221
|
-
const borderSubtle = isDark ? '#1f1f23' : '#f4f4f5';
|
|
222
|
-
const inputBg = isDark ? '#141414' : '#fafafa';
|
|
223
|
-
const hoverBg = isDark ? '#1c1c1c' : '#f4f4f5';
|
|
224
|
-
const accentColor = isDark ? '#ededed' : '#18181b';
|
|
225
|
-
const accentBg = isDark ? '#ededed' : '#18181b';
|
|
226
|
-
const accentText = isDark ? '#09090b' : '#fafafa';
|
|
227
|
-
const userMsgBg = isDark ? '#27272a' : '#18181b';
|
|
228
|
-
const userMsgText = isDark ? '#ededed' : '#fafafa';
|
|
229
|
-
const botMsgBg = 'transparent';
|
|
211
|
+
const { primaryColor, gradientFrom, gradientTo, fontFamily, borderRadius, zIndex, width, height, buttonSize } = config;
|
|
212
|
+
const isDark = config.theme === 'dark';
|
|
213
|
+
const bgColor = isDark ? '#1a1a2e' : '#ffffff';
|
|
214
|
+
const textColor = isDark ? '#e4e4e7' : '#1f2937';
|
|
215
|
+
const mutedColor = isDark ? '#71717a' : '#6b7280';
|
|
216
|
+
const borderColor = isDark ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.08)';
|
|
217
|
+
const inputBg = isDark ? '#16162a' : '#f9fafb';
|
|
218
|
+
const messageBgUser = `linear-gradient(135deg, ${gradientFrom}, ${gradientTo})`;
|
|
219
|
+
const messageBgBot = isDark ? '#252542' : '#f1f5f9';
|
|
230
220
|
const positionRight = config.position?.includes('right') ?? true;
|
|
231
221
|
const positionBottom = config.position?.includes('bottom') ?? true;
|
|
232
|
-
const shadowLg = isDark ? '0 24px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05)' : '0 24px 48px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05)';
|
|
233
222
|
return `
|
|
234
223
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
235
224
|
:host { all: initial; }
|
|
236
|
-
.ihooman-widget { font-family: ${fontFamily}; font-size: 14px; line-height: 1.
|
|
225
|
+
.ihooman-widget { font-family: ${fontFamily}; font-size: 14px; line-height: 1.5; color: ${textColor}; -webkit-font-smoothing: antialiased; }
|
|
237
226
|
button {
|
|
238
227
|
font-family: inherit;
|
|
239
228
|
font-size: 100%;
|
|
@@ -246,188 +235,144 @@
|
|
|
246
235
|
cursor: pointer;
|
|
247
236
|
outline: none;
|
|
248
237
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
.ihooman-toggle {
|
|
253
|
-
.ihooman-toggle
|
|
254
|
-
.ihooman-toggle
|
|
255
|
-
.ihooman-toggle
|
|
256
|
-
.ihooman-toggle .chat-icon { display: flex; align-items: center; justify-content: center; transition: transform 0.25s ease-out, opacity 0.15s ease; }
|
|
257
|
-
.ihooman-toggle .close-icon { position: absolute; display: flex; align-items: center; justify-content: center; transform: rotate(-90deg) scale(0); opacity: 0; transition: transform 0.25s ease-out, opacity 0.15s ease; }
|
|
238
|
+
.ihooman-toggle { position: fixed !important; ${positionRight ? 'right: 20px' : 'left: 20px'}; ${positionBottom ? 'bottom: 20px' : 'top: 20px'}; width: ${buttonSize}px !important; height: ${buttonSize}px !important; border-radius: 50% !important; background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}) !important; border: none !important; cursor: pointer; z-index: ${zIndex}; display: flex !important; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0, 174, 255, 0.35); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; }
|
|
239
|
+
.ihooman-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0, 174, 255, 0.45); }
|
|
240
|
+
.ihooman-toggle:active { transform: scale(0.95); }
|
|
241
|
+
.ihooman-toggle::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent); border-radius: 50%; }
|
|
242
|
+
.ihooman-toggle svg { width: 26px; height: 26px; color: white; transition: transform 0.3s ease, opacity 0.2s ease; position: relative; z-index: 1; }
|
|
243
|
+
.ihooman-toggle .chat-icon { display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease, opacity 0.2s ease; }
|
|
244
|
+
.ihooman-toggle .close-icon { position: absolute; display: flex; align-items: center; justify-content: center; transform: rotate(-90deg) scale(0); opacity: 0; transition: transform 0.3s ease, opacity 0.2s ease; }
|
|
258
245
|
.ihooman-toggle.open .chat-icon { transform: rotate(90deg) scale(0); opacity: 0; }
|
|
259
246
|
.ihooman-toggle.open .close-icon { transform: rotate(0) scale(1); opacity: 1; }
|
|
260
|
-
.ihooman-pulse {
|
|
261
|
-
|
|
247
|
+
.ihooman-pulse { position: absolute; inset: 0; border-radius: 50%; background: ${primaryColor}; animation: ihooman-pulse 2s ease-out infinite; }
|
|
248
|
+
@keyframes ihooman-pulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.6); opacity: 0; } }
|
|
249
|
+
.ihooman-toggle.open .ihooman-pulse { display: none; }
|
|
250
|
+
.ihooman-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; background: #ef4444; color: white; font-size: 11px; font-weight: 600; border-radius: 10px; display: flex; align-items: center; justify-content: center; z-index: 2; }
|
|
262
251
|
.ihooman-badge:empty { display: none; }
|
|
263
|
-
|
|
264
|
-
/* ── Window ── */
|
|
265
|
-
.ihooman-window { position: fixed; ${positionRight ? 'right: 20px' : 'left: 20px'}; ${positionBottom ? 'bottom: 84px' : 'top: 84px'}; width: ${width}px; height: ${height}px; min-height: ${height}px; max-height: ${height}px; z-index: ${(zIndex ?? 9999) - 1}; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.97); transition: opacity 0.2s ease-out, visibility 0.2s ease-out, transform 0.2s ease-out; overscroll-behavior: contain; }
|
|
252
|
+
.ihooman-window { position: fixed; ${positionRight ? 'right: 20px' : 'left: 20px'}; ${positionBottom ? 'bottom: 90px' : 'top: 90px'}; width: ${width}px; height: ${height}px; min-height: ${height}px; max-height: ${height}px; z-index: ${(zIndex ?? 9999) - 1}; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.95); transition: opacity 0.3s, visibility 0.3s, transform 0.3s; overscroll-behavior: contain; }
|
|
266
253
|
.ihooman-window.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
.ihooman-container { position: relative;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
.ihooman-header
|
|
273
|
-
.ihooman-header-avatar { width:
|
|
274
|
-
.ihooman-header-avatar img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
|
|
275
|
-
.ihooman-header-avatar svg { width: 18px; height: 18px; color: ${textSecondary}; }
|
|
254
|
+
.ihooman-container { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: ${borderRadius}px; overflow: hidden; flex-shrink: 0; }
|
|
255
|
+
.ihooman-container::before { content: ''; position: absolute; inset: 0; background: ${bgColor}; opacity: 0.97; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: ${borderRadius}px; border: 1px solid ${borderColor}; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
|
|
256
|
+
.ihooman-container > * { position: relative; z-index: 1; }
|
|
257
|
+
.ihooman-header { padding: 16px 20px; background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}); color: white; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
|
|
258
|
+
.ihooman-header-avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
|
259
|
+
.ihooman-header-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
|
|
260
|
+
.ihooman-header-avatar svg { width: 22px; height: 22px; }
|
|
276
261
|
.ihooman-header-info { flex: 1; min-width: 0; }
|
|
277
|
-
.ihooman-header-title { font-size:
|
|
278
|
-
.ihooman-header-status { display: flex; align-items: center; gap:
|
|
279
|
-
.ihooman-status-dot { width:
|
|
280
|
-
.ihooman-status-dot.offline { background: #
|
|
281
|
-
.ihooman-header-actions { display: flex; gap:
|
|
282
|
-
.ihooman-header-btn { width:
|
|
283
|
-
.ihooman-header-btn:hover { background:
|
|
284
|
-
.ihooman-header-btn svg { width:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
.ihooman-messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; background: ${bgColor}; overscroll-behavior: contain; min-height: 0; }
|
|
288
|
-
.ihooman-messages::-webkit-scrollbar { width: 4px; }
|
|
262
|
+
.ihooman-header-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
|
|
263
|
+
.ihooman-header-status { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.9; }
|
|
264
|
+
.ihooman-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
|
|
265
|
+
.ihooman-status-dot.offline { background: #f59e0b; }
|
|
266
|
+
.ihooman-header-actions { display: flex; gap: 8px; }
|
|
267
|
+
.ihooman-header-btn { width: 28px; height: 28px; border-radius: 6px; background: rgba(255,255,255,0.15); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: white; transition: background 0.2s; }
|
|
268
|
+
.ihooman-header-btn:hover { background: rgba(255,255,255,0.25); }
|
|
269
|
+
.ihooman-header-btn svg { width: 14px; height: 14px; }
|
|
270
|
+
.ihooman-messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: ${bgColor}; overscroll-behavior: contain; min-height: 0; }
|
|
271
|
+
.ihooman-messages::-webkit-scrollbar { width: 6px; }
|
|
289
272
|
.ihooman-messages::-webkit-scrollbar-track { background: transparent; }
|
|
290
|
-
.ihooman-messages::-webkit-scrollbar-thumb { background: ${
|
|
291
|
-
.ihooman-message { display: flex; flex-direction: column; max-width:
|
|
292
|
-
@keyframes ihooman-fadeIn { from { opacity: 0; transform: translateY(
|
|
273
|
+
.ihooman-messages::-webkit-scrollbar-thumb { background: ${borderColor}; border-radius: 3px; }
|
|
274
|
+
.ihooman-message { display: flex; flex-direction: column; max-width: 85%; animation: ihooman-fadeIn 0.3s ease; }
|
|
275
|
+
@keyframes ihooman-fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
|
293
276
|
.ihooman-message.user { align-self: flex-end; align-items: flex-end; }
|
|
294
|
-
.ihooman-message.bot { align-self: flex-start; align-items: flex-start;
|
|
295
|
-
.ihooman-message-content { padding:
|
|
296
|
-
.ihooman-message.user .ihooman-message-content { background: ${
|
|
297
|
-
.ihooman-message.bot .ihooman-message-content { background: ${
|
|
298
|
-
.ihooman-message-content
|
|
299
|
-
.ihooman-message-
|
|
300
|
-
.ihooman-
|
|
301
|
-
.ihooman-
|
|
302
|
-
.ihooman-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
.ihooman-typing-shimmer { font-size: 13px; color: ${mutedColor}; background: linear-gradient(90deg, ${mutedColor} 25%, ${textSecondary} 50%, ${mutedColor} 75%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: ihooman-shimmer 1.5s ease-in-out infinite; }
|
|
307
|
-
@keyframes ihooman-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
|
|
308
|
-
.ihooman-typing-dots { display: flex; gap: 3px; align-items: center; }
|
|
309
|
-
.ihooman-typing-dot { width: 5px; height: 5px; background: ${mutedColor}; border-radius: 50%; animation: ihooman-typing 1.2s ease-in-out infinite; }
|
|
310
|
-
.ihooman-typing-dot:nth-child(2) { animation-delay: 0.15s; }
|
|
311
|
-
.ihooman-typing-dot:nth-child(3) { animation-delay: 0.3s; }
|
|
312
|
-
@keyframes ihooman-typing { 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1); } }
|
|
313
|
-
|
|
314
|
-
/* ── Input Area ── */
|
|
277
|
+
.ihooman-message.bot { align-self: flex-start; align-items: flex-start; }
|
|
278
|
+
.ihooman-message-content { padding: 12px 16px; border-radius: 16px; word-wrap: break-word; }
|
|
279
|
+
.ihooman-message.user .ihooman-message-content { background: ${messageBgUser}; color: white; border-bottom-right-radius: 4px; }
|
|
280
|
+
.ihooman-message.bot .ihooman-message-content { background: ${messageBgBot}; color: ${textColor}; border-bottom-left-radius: 4px; }
|
|
281
|
+
.ihooman-message-content code { background: rgba(0,0,0,0.1); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 13px; }
|
|
282
|
+
.ihooman-message-time { font-size: 11px; color: ${mutedColor}; margin-top: 4px; padding: 0 4px; }
|
|
283
|
+
.ihooman-typing { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: ${messageBgBot}; border-radius: 16px; border-bottom-left-radius: 4px; max-width: 80px; align-self: flex-start; }
|
|
284
|
+
.ihooman-typing-dots { display: flex; gap: 4px; }
|
|
285
|
+
.ihooman-typing-dot { width: 8px; height: 8px; background: ${mutedColor}; border-radius: 50%; animation: ihooman-typing 1.4s infinite; }
|
|
286
|
+
.ihooman-typing-dot:nth-child(2) { animation-delay: 0.2s; }
|
|
287
|
+
.ihooman-typing-dot:nth-child(3) { animation-delay: 0.4s; }
|
|
288
|
+
@keyframes ihooman-typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
|
|
315
289
|
.ihooman-input-area { padding: 12px 16px; background: ${bgColor}; border-top: 1px solid ${borderColor}; flex-shrink: 0; }
|
|
316
|
-
.ihooman-input-wrapper { display: flex; align-items: flex-end; gap: 8px; background: ${inputBg}; border: 1px solid ${borderColor}; border-radius: 12px; padding: 8px 12px; transition: border-color 0.
|
|
317
|
-
.ihooman-input-wrapper:focus-within { border-color: ${
|
|
318
|
-
.ihooman-input { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 14px; color: ${textColor}; resize: none; max-height: 100px; outline: none; line-height: 1.
|
|
290
|
+
.ihooman-input-wrapper { display: flex; align-items: flex-end; gap: 8px; background: ${inputBg}; border: 1px solid ${borderColor}; border-radius: 12px; padding: 8px 12px; transition: border-color 0.2s, box-shadow 0.2s; }
|
|
291
|
+
.ihooman-input-wrapper:focus-within { border-color: ${primaryColor}; box-shadow: 0 0 0 3px rgba(0, 174, 255, 0.1); }
|
|
292
|
+
.ihooman-input { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 14px; color: ${textColor}; resize: none; max-height: 100px; outline: none; line-height: 1.4; }
|
|
319
293
|
.ihooman-input::placeholder { color: ${mutedColor}; }
|
|
320
|
-
.ihooman-input-btn { width:
|
|
321
|
-
.ihooman-input-btn:hover {
|
|
322
|
-
.ihooman-input-btn.send { background: ${
|
|
323
|
-
.ihooman-input-btn.send:hover { opacity: 0.
|
|
324
|
-
.ihooman-input-btn.send:disabled { opacity: 0.
|
|
294
|
+
.ihooman-input-btn { width: 32px; height: 32px; border-radius: 8px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; background: transparent; color: ${mutedColor}; }
|
|
295
|
+
.ihooman-input-btn:hover { background: ${borderColor}; color: ${textColor}; }
|
|
296
|
+
.ihooman-input-btn.send { background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}); color: white; }
|
|
297
|
+
.ihooman-input-btn.send:hover { opacity: 0.9; }
|
|
298
|
+
.ihooman-input-btn.send:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
325
299
|
.ihooman-input-btn svg { width: 16px; height: 16px; }
|
|
326
|
-
.ihooman-input:disabled { opacity: 0.
|
|
327
|
-
.ihooman-input-btn.attach:disabled { opacity: 0.
|
|
300
|
+
.ihooman-input:disabled { opacity: 0.6; cursor: not-allowed; }
|
|
301
|
+
.ihooman-input-btn.attach:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
328
302
|
.ihooman-file-input { display: none; }
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
.ihooman-powered { text-align: center; padding: 8px; font-size: 11px; color: ${mutedColor}; background: ${bgColor}; border-top: 1px solid ${borderSubtle}; }
|
|
332
|
-
.ihooman-powered a { color: ${textSecondary}; text-decoration: none; font-weight: 500; }
|
|
333
|
-
.ihooman-powered a:hover { color: ${textColor}; }
|
|
334
|
-
|
|
335
|
-
/* ── Escalation ── */
|
|
303
|
+
.ihooman-powered { text-align: center; padding: 8px; font-size: 11px; color: ${mutedColor}; background: ${bgColor}; }
|
|
304
|
+
.ihooman-powered a { color: ${primaryColor}; text-decoration: none; }
|
|
336
305
|
.ihooman-escalation-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
|
|
337
306
|
.ihooman-escalation-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
338
|
-
|
|
339
|
-
/* ── Status Bar ── */
|
|
340
|
-
.ihooman-status-bar { padding: 8px 16px; text-align: center; font-size: 12px; display: none; font-weight: 500; }
|
|
307
|
+
.ihooman-status-bar { padding: 10px 16px; text-align: center; font-size: 13px; display: none; }
|
|
341
308
|
.ihooman-status-bar.show { display: block; }
|
|
342
|
-
.ihooman-status-bar.waiting { background:
|
|
343
|
-
.ihooman-status-bar.connected { background:
|
|
344
|
-
|
|
345
|
-
/* ── Chat View ── */
|
|
309
|
+
.ihooman-status-bar.waiting { background: #fef3c7; color: #92400e; }
|
|
310
|
+
.ihooman-status-bar.connected { background: #dcfce7; color: #166534; }
|
|
346
311
|
.ihooman-chat-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }
|
|
347
312
|
.ihooman-chat-view.hidden { display: none; }
|
|
348
|
-
|
|
349
|
-
/* ── Ticket View ── */
|
|
350
|
-
.ihooman-ticket-view { display: none; flex-direction: column; padding: 20px; gap: 14px; background: ${bgColor}; flex: 1; overflow-y: auto; min-height: 0; }
|
|
313
|
+
.ihooman-ticket-view { display: none; flex-direction: column; padding: 20px; gap: 16px; background: ${bgColor}; flex: 1; overflow-y: auto; min-height: 0; }
|
|
351
314
|
.ihooman-ticket-view.show { display: flex; }
|
|
352
|
-
.ihooman-ticket-title { font-size:
|
|
353
|
-
.ihooman-ticket-subtitle { font-size: 13px; color: ${
|
|
354
|
-
.ihooman-ticket-input { padding:
|
|
355
|
-
.ihooman-ticket-input:focus { border-color: ${
|
|
315
|
+
.ihooman-ticket-title { font-size: 18px; font-weight: 600; color: ${textColor}; margin: 0; }
|
|
316
|
+
.ihooman-ticket-subtitle { font-size: 13px; color: ${mutedColor}; margin: 0; }
|
|
317
|
+
.ihooman-ticket-input { padding: 12px 14px; border: 1px solid ${borderColor}; border-radius: 10px; font-size: 14px; font-family: inherit; background: ${inputBg}; color: ${textColor}; outline: none; transition: border-color 0.2s; }
|
|
318
|
+
.ihooman-ticket-input:focus { border-color: ${primaryColor}; }
|
|
356
319
|
.ihooman-ticket-input::placeholder { color: ${mutedColor}; }
|
|
357
320
|
.ihooman-ticket-textarea { min-height: 100px; resize: vertical; }
|
|
358
|
-
.ihooman-ticket-submit { display: flex; align-items: center; justify-content: center; padding:
|
|
359
|
-
.ihooman-ticket-submit:hover { opacity: 0.
|
|
360
|
-
.ihooman-ticket-submit:disabled { opacity: 0.
|
|
361
|
-
.ihooman-ticket-back { display: flex; align-items: center; justify-content: center; padding: 10px; background: transparent; color: ${
|
|
362
|
-
.ihooman-ticket-back:hover { background: ${
|
|
363
|
-
|
|
364
|
-
/* ── History View ── */
|
|
321
|
+
.ihooman-ticket-submit { display: flex; align-items: center; justify-content: center; padding: 12px; background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; line-height: 1.4; }
|
|
322
|
+
.ihooman-ticket-submit:hover { opacity: 0.9; }
|
|
323
|
+
.ihooman-ticket-submit:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
324
|
+
.ihooman-ticket-back { display: flex; align-items: center; justify-content: center; padding: 10px; background: transparent; color: ${mutedColor}; border: 1px solid ${borderColor}; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.2s; line-height: 1.4; }
|
|
325
|
+
.ihooman-ticket-back:hover { background: ${isDark ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.03)'}; }
|
|
365
326
|
.ihooman-history-view { display: none; flex-direction: column; flex: 1; overflow: hidden; background: ${bgColor}; }
|
|
366
327
|
.ihooman-history-view.show { display: flex; }
|
|
367
328
|
.ihooman-history-header { padding: 12px 16px; border-bottom: 1px solid ${borderColor}; display: flex; justify-content: space-between; align-items: center; }
|
|
368
|
-
.ihooman-history-title { font-size:
|
|
369
|
-
.ihooman-history-new { display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: ${
|
|
370
|
-
.ihooman-history-new:hover { opacity: 0.
|
|
329
|
+
.ihooman-history-title { font-size: 14px; font-weight: 600; color: ${textColor}; margin: 0; }
|
|
330
|
+
.ihooman-history-new { display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}); color: white; border: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; line-height: 1.4; }
|
|
331
|
+
.ihooman-history-new:hover { opacity: 0.9; }
|
|
371
332
|
.ihooman-history-new svg { width: 12px; height: 12px; flex-shrink: 0; }
|
|
372
333
|
.ihooman-history-list { flex: 1; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
|
|
373
|
-
.ihooman-history-item { padding: 12px; border: 1px solid ${borderColor}; border-radius:
|
|
374
|
-
.ihooman-history-item:hover { background: ${
|
|
375
|
-
.ihooman-history-item.active { background: ${
|
|
334
|
+
.ihooman-history-item { padding: 12px; border: 1px solid ${borderColor}; border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: all 0.2s; background: ${bgColor}; }
|
|
335
|
+
.ihooman-history-item:hover { background: ${isDark ? 'rgba(255,255,255,0.05)' : '#f8fafc'}; }
|
|
336
|
+
.ihooman-history-item.active { background: ${isDark ? 'rgba(0, 174, 255, 0.1)' : '#eff6ff'}; border-color: ${primaryColor}; }
|
|
376
337
|
.ihooman-history-preview { font-size: 13px; color: ${textColor}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
377
338
|
.ihooman-history-meta { font-size: 11px; color: ${mutedColor}; margin-top: 4px; display: flex; justify-content: space-between; }
|
|
378
|
-
.ihooman-history-empty { padding: 40px; text-align: center; color: ${mutedColor}; font-size:
|
|
379
|
-
|
|
380
|
-
/* ── Preset Questions ── */
|
|
381
|
-
.ihooman-preset-questions { padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 6px; background: ${bgColor}; border-top: 1px solid ${borderSubtle}; }
|
|
339
|
+
.ihooman-history-empty { padding: 40px; text-align: center; color: ${mutedColor}; font-size: 14px; }
|
|
340
|
+
.ihooman-preset-questions { padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 6px; background: ${bgColor}; border-top: 1px solid ${borderColor}; }
|
|
382
341
|
.ihooman-preset-questions:empty { display: none; }
|
|
383
342
|
.ihooman-preset-questions.hidden { display: none; }
|
|
384
|
-
|
|
385
|
-
/* ── Proactive Toast ── */
|
|
386
|
-
.ihooman-proactive-toast { position: fixed; ${positionRight ? 'right: 20px' : 'left: 20px'}; ${positionBottom ? 'bottom: 84px' : 'top: 84px'}; max-width: 320px; padding: 16px; background: ${bgElevated}; border-radius: 14px; box-shadow: ${shadowLg}; z-index: ${(zIndex ?? 9999) - 2}; opacity: 0; visibility: hidden; transform: translateY(8px); transition: all 0.2s ease-out; border: 1px solid ${borderColor}; }
|
|
343
|
+
.ihooman-proactive-toast { position: fixed; ${positionRight ? 'right: 20px' : 'left: 20px'}; ${positionBottom ? 'bottom: 90px' : 'top: 90px'}; max-width: 300px; padding: 16px; background: ${bgColor}; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: ${(zIndex ?? 9999) - 2}; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; border: 1px solid ${borderColor}; }
|
|
387
344
|
.ihooman-proactive-toast.show { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
388
|
-
.ihooman-proactive-toast-content { font-size: 14px; color: ${textColor}; margin-bottom: 12px;
|
|
345
|
+
.ihooman-proactive-toast-content { font-size: 14px; color: ${textColor}; margin-bottom: 12px; }
|
|
389
346
|
.ihooman-proactive-toast-actions { display: flex; gap: 8px; }
|
|
390
|
-
.ihooman-proactive-toast-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius:
|
|
391
|
-
.ihooman-proactive-toast-btn.primary { background: ${
|
|
392
|
-
.ihooman-proactive-toast-btn.primary:hover { opacity: 0.
|
|
393
|
-
.ihooman-proactive-toast-btn.secondary { background: transparent; color: ${
|
|
394
|
-
.ihooman-proactive-toast-btn.secondary:hover { background: ${
|
|
395
|
-
|
|
396
|
-
/* ── Survey View ── */
|
|
397
|
-
.ihooman-survey-view { display: none; flex-direction: column; padding: 24px; gap: 16px; background: ${bgColor}; flex: 1; align-items: center; justify-content: center; }
|
|
347
|
+
.ihooman-proactive-toast-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; line-height: 1.4; }
|
|
348
|
+
.ihooman-proactive-toast-btn.primary { background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}); color: white; border: none; }
|
|
349
|
+
.ihooman-proactive-toast-btn.primary:hover { opacity: 0.9; }
|
|
350
|
+
.ihooman-proactive-toast-btn.secondary { background: transparent; color: ${mutedColor}; border: 1px solid ${borderColor}; }
|
|
351
|
+
.ihooman-proactive-toast-btn.secondary:hover { background: ${isDark ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.03)'}; }
|
|
352
|
+
.ihooman-survey-view { display: none; flex-direction: column; padding: 20px; gap: 16px; background: ${bgColor}; flex: 1; align-items: center; justify-content: center; }
|
|
398
353
|
.ihooman-survey-view.show { display: flex; }
|
|
399
|
-
.ihooman-survey-question { font-size: 16px; font-weight: 600; color: ${textColor}; text-align: center;
|
|
354
|
+
.ihooman-survey-question { font-size: 16px; font-weight: 600; color: ${textColor}; text-align: center; }
|
|
400
355
|
.ihooman-survey-stars { display: flex; gap: 8px; }
|
|
401
|
-
.ihooman-survey-star { width:
|
|
356
|
+
.ihooman-survey-star { width: 40px; height: 40px; cursor: pointer; color: ${mutedColor}; transition: all 0.2s; }
|
|
402
357
|
.ihooman-survey-star:hover, .ihooman-survey-star.active { color: #fbbf24; transform: scale(1.1); }
|
|
403
358
|
.ihooman-survey-star svg { width: 100%; height: 100%; }
|
|
404
|
-
.ihooman-survey-comment { width: 100%; padding: 12px; border: 1px solid ${borderColor}; border-radius:
|
|
405
|
-
.ihooman-survey-
|
|
406
|
-
.ihooman-survey-submit
|
|
407
|
-
.ihooman-survey-submit:hover { opacity: 0.85; }
|
|
359
|
+
.ihooman-survey-comment { width: 100%; padding: 12px; border: 1px solid ${borderColor}; border-radius: 8px; font-size: 14px; resize: none; min-height: 80px; background: ${inputBg}; color: ${textColor}; }
|
|
360
|
+
.ihooman-survey-submit { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; background: linear-gradient(135deg, ${gradientFrom}, ${gradientTo}); color: white; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; line-height: 1.4; }
|
|
361
|
+
.ihooman-survey-submit:hover { opacity: 0.9; }
|
|
408
362
|
.ihooman-survey-skip { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; background: transparent; color: ${mutedColor}; border: none; font-size: 12px; cursor: pointer; line-height: 1.4; }
|
|
409
363
|
.ihooman-survey-skip:hover { color: ${textColor}; }
|
|
410
|
-
|
|
411
|
-
/* ── Feedback ── */
|
|
412
|
-
.ihooman-feedback-btns { display: flex; gap: 4px; margin-top: 4px; }
|
|
364
|
+
.ihooman-feedback-btns { display: flex; gap: 6px; margin-top: 6px; }
|
|
413
365
|
.ihooman-feedback-btn svg { width: 12px; height: 12px; }
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
.ihooman-carousel {
|
|
417
|
-
.ihooman-carousel::-webkit-scrollbar { height: 3px; }
|
|
418
|
-
.ihooman-carousel::-webkit-scrollbar-thumb { background: ${isDark ? '#27272a' : '#d4d4d8'}; border-radius: 2px; }
|
|
419
|
-
.ihooman-carousel-card { min-width: 200px; max-width: 250px; border: 1px solid ${borderColor}; border-radius: 12px; overflow: hidden; scroll-snap-align: start; background: ${bgElevated}; }
|
|
366
|
+
.ihooman-carousel { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0; scroll-snap-type: x mandatory; }
|
|
367
|
+
.ihooman-carousel::-webkit-scrollbar { height: 4px; }
|
|
368
|
+
.ihooman-carousel-card { min-width: 200px; max-width: 250px; border: 1px solid ${borderColor}; border-radius: 12px; overflow: hidden; scroll-snap-align: start; background: ${bgColor}; }
|
|
420
369
|
.ihooman-carousel-card img { width: 100%; height: 120px; object-fit: cover; }
|
|
421
370
|
.ihooman-carousel-card-content { padding: 12px; }
|
|
422
|
-
.ihooman-carousel-card-title { font-size:
|
|
423
|
-
.ihooman-carousel-card-desc { font-size: 12px; color: ${
|
|
371
|
+
.ihooman-carousel-card-title { font-size: 14px; font-weight: 600; color: ${textColor}; margin-bottom: 4px; }
|
|
372
|
+
.ihooman-carousel-card-desc { font-size: 12px; color: ${mutedColor}; margin-bottom: 8px; }
|
|
424
373
|
.ihooman-carousel-card-btns { display: flex; flex-direction: column; gap: 6px; }
|
|
425
|
-
|
|
426
|
-
/* ── Quick Replies ── */
|
|
427
374
|
.ihooman-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
|
|
428
|
-
|
|
429
|
-
/* ── Responsive ── */
|
|
430
|
-
@media (max-width: 480px) { .ihooman-window { width: calc(100vw - 16px); height: calc(100vh - 100px); min-height: 400px; max-height: calc(100vh - 100px); left: 8px; right: 8px; bottom: 80px; } .ihooman-toggle { ${positionRight ? 'right: 16px' : 'left: 16px'}; bottom: 16px; } .ihooman-proactive-toast { left: 8px; right: 8px; max-width: none; } }
|
|
375
|
+
@media (max-width: 480px) { .ihooman-window { width: calc(100vw - 20px); height: calc(100vh - 100px); min-height: 400px; max-height: calc(100vh - 100px); left: 10px; right: 10px; bottom: 80px; } .ihooman-toggle { ${positionRight ? 'right: 16px' : 'left: 16px'}; bottom: 16px; } .ihooman-proactive-toast { left: 10px; right: 10px; max-width: none; } }
|
|
431
376
|
`;
|
|
432
377
|
}
|
|
433
378
|
// ============================================================================
|
|
@@ -467,9 +412,9 @@
|
|
|
467
412
|
<div class="ihooman-window" role="dialog" aria-label="Chat window">
|
|
468
413
|
<div class="ihooman-container">
|
|
469
414
|
<div class="ihooman-header">
|
|
470
|
-
<div class="ihooman-header-avatar">${config.avatarUrl ? `<img src="${escapeHtml(config.avatarUrl)}" alt="
|
|
415
|
+
<div class="ihooman-header-avatar">${config.avatarUrl ? `<img src="${escapeHtml(config.avatarUrl)}" alt="Support">` : icons.bot}</div>
|
|
471
416
|
<div class="ihooman-header-info">
|
|
472
|
-
<div class="ihooman-header-title">${escapeHtml(config.title || '
|
|
417
|
+
<div class="ihooman-header-title">${escapeHtml(config.title || 'Chat Support')}</div>
|
|
473
418
|
<div class="ihooman-header-status"><span class="ihooman-status-dot"></span><span class="ihooman-status-text">Online</span></div>
|
|
474
419
|
</div>
|
|
475
420
|
<div class="ihooman-header-actions">
|
|
@@ -491,7 +436,7 @@
|
|
|
491
436
|
</div>
|
|
492
437
|
</div>
|
|
493
438
|
<div class="ihooman-ticket-view">
|
|
494
|
-
<h4 class="ihooman-ticket-title"
|
|
439
|
+
<h4 class="ihooman-ticket-title">📝 Submit a Ticket</h4>
|
|
495
440
|
<p class="ihooman-ticket-subtitle">We'll get back to you via email</p>
|
|
496
441
|
<input class="ihooman-ticket-input" id="ihooman-ticket-name" placeholder="Your name" required>
|
|
497
442
|
<input class="ihooman-ticket-input" id="ihooman-ticket-email" type="email" placeholder="Your email" required>
|
|
@@ -1082,7 +1027,7 @@
|
|
|
1082
1027
|
return;
|
|
1083
1028
|
const typing = document.createElement('div');
|
|
1084
1029
|
typing.className = 'ihooman-typing';
|
|
1085
|
-
typing.innerHTML = `<
|
|
1030
|
+
typing.innerHTML = `<div class="ihooman-typing-dots"><span class="ihooman-typing-dot"></span><span class="ihooman-typing-dot"></span><span class="ihooman-typing-dot"></span></div>`;
|
|
1086
1031
|
elements.messages.appendChild(typing);
|
|
1087
1032
|
elements.messages.scrollTop = elements.messages.scrollHeight;
|
|
1088
1033
|
}
|
|
@@ -1104,7 +1049,7 @@
|
|
|
1104
1049
|
function enableInput() {
|
|
1105
1050
|
if (elements.input) {
|
|
1106
1051
|
elements.input.disabled = false;
|
|
1107
|
-
elements.input.placeholder = config.placeholder || '
|
|
1052
|
+
elements.input.placeholder = config.placeholder || 'Type a message...';
|
|
1108
1053
|
}
|
|
1109
1054
|
if (elements.sendBtn)
|
|
1110
1055
|
elements.sendBtn.disabled = !elements.input?.value.trim();
|
|
@@ -1728,10 +1673,11 @@
|
|
|
1728
1673
|
default: return 500;
|
|
1729
1674
|
}
|
|
1730
1675
|
}
|
|
1676
|
+
// Default button styles - MUST match client-dashboard/src/components/widget/ButtonStylingEditor.tsx
|
|
1731
1677
|
const DEFAULT_BUTTON_STYLES = {
|
|
1732
1678
|
primary: {
|
|
1733
|
-
backgroundColor: '#
|
|
1734
|
-
textColor: '#
|
|
1679
|
+
backgroundColor: '#00aeff',
|
|
1680
|
+
textColor: '#ffffff',
|
|
1735
1681
|
borderColor: 'transparent',
|
|
1736
1682
|
borderWidth: 0,
|
|
1737
1683
|
borderRadius: 8,
|
|
@@ -1742,8 +1688,8 @@
|
|
|
1742
1688
|
},
|
|
1743
1689
|
secondary: {
|
|
1744
1690
|
backgroundColor: 'transparent',
|
|
1745
|
-
textColor: '#
|
|
1746
|
-
borderColor: '#
|
|
1691
|
+
textColor: '#6b7280',
|
|
1692
|
+
borderColor: '#e5e7eb',
|
|
1747
1693
|
borderWidth: 1,
|
|
1748
1694
|
borderRadius: 8,
|
|
1749
1695
|
paddingVertical: 8,
|
|
@@ -1752,9 +1698,9 @@
|
|
|
1752
1698
|
fontWeight: 'medium',
|
|
1753
1699
|
},
|
|
1754
1700
|
presetQuestions: {
|
|
1755
|
-
backgroundColor: '
|
|
1756
|
-
textColor: '#
|
|
1757
|
-
borderColor: '
|
|
1701
|
+
backgroundColor: 'rgba(0, 174, 255, 0.1)',
|
|
1702
|
+
textColor: '#00aeff',
|
|
1703
|
+
borderColor: 'rgba(0, 174, 255, 0.2)',
|
|
1758
1704
|
borderWidth: 1,
|
|
1759
1705
|
borderRadius: 20,
|
|
1760
1706
|
paddingVertical: 6,
|
|
@@ -1763,9 +1709,9 @@
|
|
|
1763
1709
|
fontWeight: 'medium',
|
|
1764
1710
|
},
|
|
1765
1711
|
quickReplies: {
|
|
1766
|
-
backgroundColor: '#
|
|
1767
|
-
textColor: '#
|
|
1768
|
-
borderColor: '#
|
|
1712
|
+
backgroundColor: '#f3f4f6',
|
|
1713
|
+
textColor: '#374151',
|
|
1714
|
+
borderColor: '#e5e7eb',
|
|
1769
1715
|
borderWidth: 1,
|
|
1770
1716
|
borderRadius: 16,
|
|
1771
1717
|
paddingVertical: 5,
|
|
@@ -1775,8 +1721,8 @@
|
|
|
1775
1721
|
},
|
|
1776
1722
|
feedback: {
|
|
1777
1723
|
backgroundColor: 'transparent',
|
|
1778
|
-
textColor: '#
|
|
1779
|
-
borderColor: '#
|
|
1724
|
+
textColor: '#9ca3af',
|
|
1725
|
+
borderColor: '#e5e7eb',
|
|
1780
1726
|
borderWidth: 1,
|
|
1781
1727
|
borderRadius: 6,
|
|
1782
1728
|
paddingVertical: 4,
|
|
@@ -1785,19 +1731,19 @@
|
|
|
1785
1731
|
fontWeight: 'medium',
|
|
1786
1732
|
},
|
|
1787
1733
|
headerActions: {
|
|
1788
|
-
backgroundColor: '
|
|
1789
|
-
textColor: '#
|
|
1734
|
+
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
1735
|
+
textColor: '#ffffff',
|
|
1790
1736
|
borderColor: 'transparent',
|
|
1791
1737
|
borderWidth: 0,
|
|
1792
|
-
borderRadius:
|
|
1738
|
+
borderRadius: 6,
|
|
1793
1739
|
paddingVertical: 6,
|
|
1794
1740
|
paddingHorizontal: 6,
|
|
1795
1741
|
fontSize: 14,
|
|
1796
1742
|
fontWeight: 'medium',
|
|
1797
1743
|
},
|
|
1798
1744
|
escalation: {
|
|
1799
|
-
backgroundColor: '#
|
|
1800
|
-
textColor: '#
|
|
1745
|
+
backgroundColor: '#00aeff',
|
|
1746
|
+
textColor: '#ffffff',
|
|
1801
1747
|
borderColor: 'transparent',
|
|
1802
1748
|
borderWidth: 0,
|
|
1803
1749
|
borderRadius: 8,
|
|
@@ -1807,21 +1753,21 @@
|
|
|
1807
1753
|
fontWeight: 'medium',
|
|
1808
1754
|
},
|
|
1809
1755
|
cardActions: {
|
|
1810
|
-
backgroundColor: '#
|
|
1811
|
-
textColor: '#
|
|
1756
|
+
backgroundColor: '#00aeff',
|
|
1757
|
+
textColor: '#ffffff',
|
|
1812
1758
|
borderColor: 'transparent',
|
|
1813
1759
|
borderWidth: 0,
|
|
1814
|
-
borderRadius:
|
|
1760
|
+
borderRadius: 6,
|
|
1815
1761
|
paddingVertical: 6,
|
|
1816
1762
|
paddingHorizontal: 12,
|
|
1817
1763
|
fontSize: 12,
|
|
1818
1764
|
fontWeight: 'medium',
|
|
1819
1765
|
},
|
|
1820
1766
|
toggleButton: {
|
|
1821
|
-
backgroundColor: '#
|
|
1822
|
-
textColor: '#
|
|
1823
|
-
borderColor: '
|
|
1824
|
-
borderWidth:
|
|
1767
|
+
backgroundColor: '#00aeff',
|
|
1768
|
+
textColor: '#ffffff',
|
|
1769
|
+
borderColor: 'transparent',
|
|
1770
|
+
borderWidth: 0,
|
|
1825
1771
|
borderRadius: 30,
|
|
1826
1772
|
paddingVertical: 0,
|
|
1827
1773
|
paddingHorizontal: 0,
|
|
@@ -1830,7 +1776,7 @@
|
|
|
1830
1776
|
},
|
|
1831
1777
|
attachButton: {
|
|
1832
1778
|
backgroundColor: 'transparent',
|
|
1833
|
-
textColor: '#
|
|
1779
|
+
textColor: '#6b7280',
|
|
1834
1780
|
borderColor: 'transparent',
|
|
1835
1781
|
borderWidth: 0,
|
|
1836
1782
|
borderRadius: 8,
|