@ihoomanai/chat-widget 2.5.13 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +15 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +15 -4
- 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 +15 -4
- 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/types.d.ts +256 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +34 -0
- package/src/types.ts +353 -5
- package/src/widget.ts +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for @ihooman/chat-widget
|
|
3
|
+
* Enhanced with professional features
|
|
3
4
|
*/
|
|
4
5
|
/**
|
|
5
6
|
* Theme configuration for the widget appearance
|
|
@@ -55,6 +56,8 @@ export interface BrandingConfig {
|
|
|
55
56
|
avatarUrl?: string | null;
|
|
56
57
|
/** Show "Powered by Ihooman" branding */
|
|
57
58
|
poweredBy?: boolean;
|
|
59
|
+
/** Custom CSS for widget styling */
|
|
60
|
+
customCss?: string;
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
63
|
* Preset question for quick access
|
|
@@ -66,6 +69,124 @@ export interface PresetQuestion {
|
|
|
66
69
|
text: string;
|
|
67
70
|
/** Optional emoji icon */
|
|
68
71
|
icon?: string;
|
|
72
|
+
/** Optional emoji (alias for icon) */
|
|
73
|
+
emoji?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Quick reply suggestion from AI agent
|
|
77
|
+
*/
|
|
78
|
+
export interface QuickReply {
|
|
79
|
+
id: string;
|
|
80
|
+
text: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Proactive message trigger configuration
|
|
84
|
+
*/
|
|
85
|
+
export interface ProactiveTriggerConfig {
|
|
86
|
+
type: 'time' | 'scroll' | 'exit_intent' | 'url_pattern';
|
|
87
|
+
value: number | string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Proactive message configuration
|
|
91
|
+
*/
|
|
92
|
+
export interface ProactiveMessage {
|
|
93
|
+
id: string;
|
|
94
|
+
message: string;
|
|
95
|
+
trigger: ProactiveTriggerConfig;
|
|
96
|
+
autoOpen: boolean;
|
|
97
|
+
cooldownMinutes: number;
|
|
98
|
+
startDate?: Date;
|
|
99
|
+
endDate?: Date;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Survey type options
|
|
103
|
+
*/
|
|
104
|
+
export type SurveyType = 'star' | 'nps' | 'emoji';
|
|
105
|
+
/**
|
|
106
|
+
* Survey configuration
|
|
107
|
+
*/
|
|
108
|
+
export interface SurveyConfig {
|
|
109
|
+
id: string;
|
|
110
|
+
type: SurveyType;
|
|
111
|
+
question: string;
|
|
112
|
+
followUpQuestion?: string;
|
|
113
|
+
thankYouMessage: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Survey response
|
|
117
|
+
*/
|
|
118
|
+
export interface SurveyResponse {
|
|
119
|
+
surveyId: string;
|
|
120
|
+
rating: number;
|
|
121
|
+
comment?: string;
|
|
122
|
+
sessionId: string;
|
|
123
|
+
timestamp: Date;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Card button action type
|
|
127
|
+
*/
|
|
128
|
+
export type CardButtonAction = 'link' | 'message' | 'callback';
|
|
129
|
+
/**
|
|
130
|
+
* Card button
|
|
131
|
+
*/
|
|
132
|
+
export interface CardButton {
|
|
133
|
+
id: string;
|
|
134
|
+
label: string;
|
|
135
|
+
action: CardButtonAction;
|
|
136
|
+
value: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Card content for carousel messages
|
|
140
|
+
*/
|
|
141
|
+
export interface CardContent {
|
|
142
|
+
id: string;
|
|
143
|
+
imageUrl?: string;
|
|
144
|
+
title: string;
|
|
145
|
+
description?: string;
|
|
146
|
+
buttons: CardButton[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Form field type
|
|
150
|
+
*/
|
|
151
|
+
export type FormFieldType = 'text' | 'email' | 'phone' | 'select' | 'checkbox' | 'textarea';
|
|
152
|
+
/**
|
|
153
|
+
* Form field validation rule
|
|
154
|
+
*/
|
|
155
|
+
export interface ValidationRule {
|
|
156
|
+
pattern?: string;
|
|
157
|
+
minLength?: number;
|
|
158
|
+
maxLength?: number;
|
|
159
|
+
message: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Form field option (for select fields)
|
|
163
|
+
*/
|
|
164
|
+
export interface FormFieldOption {
|
|
165
|
+
value: string;
|
|
166
|
+
label: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Form field
|
|
170
|
+
*/
|
|
171
|
+
export interface FormField {
|
|
172
|
+
id: string;
|
|
173
|
+
type: FormFieldType;
|
|
174
|
+
label: string;
|
|
175
|
+
placeholder?: string;
|
|
176
|
+
required: boolean;
|
|
177
|
+
options?: FormFieldOption[];
|
|
178
|
+
validation?: ValidationRule;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Image item for gallery messages
|
|
182
|
+
*/
|
|
183
|
+
export interface GalleryImage {
|
|
184
|
+
id: string;
|
|
185
|
+
url: string;
|
|
186
|
+
thumbnailUrl?: string;
|
|
187
|
+
alt: string;
|
|
188
|
+
width?: number;
|
|
189
|
+
height?: number;
|
|
69
190
|
}
|
|
70
191
|
/**
|
|
71
192
|
* Main widget configuration options
|
|
@@ -83,7 +204,7 @@ export interface WidgetConfig {
|
|
|
83
204
|
*/
|
|
84
205
|
serverUrl?: string;
|
|
85
206
|
/** Widget color theme */
|
|
86
|
-
theme?: 'light' | 'dark';
|
|
207
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
87
208
|
/** Widget position on the page */
|
|
88
209
|
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
89
210
|
/** Widget title displayed in header */
|
|
@@ -126,8 +247,28 @@ export interface WidgetConfig {
|
|
|
126
247
|
fontFamily?: string;
|
|
127
248
|
/** Custom avatar URL */
|
|
128
249
|
avatarUrl?: string;
|
|
250
|
+
/** Custom logo URL */
|
|
251
|
+
logoUrl?: string;
|
|
129
252
|
/** Show powered by branding */
|
|
130
253
|
poweredBy?: boolean;
|
|
254
|
+
/** Custom CSS for widget styling */
|
|
255
|
+
customCss?: string;
|
|
256
|
+
/** Preset questions for quick access */
|
|
257
|
+
presetQuestions?: PresetQuestion[];
|
|
258
|
+
/** Proactive messages configuration */
|
|
259
|
+
proactiveMessages?: ProactiveMessage[];
|
|
260
|
+
/** Survey configuration */
|
|
261
|
+
surveyConfig?: SurveyConfig | null;
|
|
262
|
+
/** Localization locale */
|
|
263
|
+
locale?: string;
|
|
264
|
+
/** Custom translations */
|
|
265
|
+
translations?: Record<string, string>;
|
|
266
|
+
/** Right-to-left text direction */
|
|
267
|
+
rtl?: boolean;
|
|
268
|
+
/** Allowed domains for security validation */
|
|
269
|
+
allowedDomains?: string[];
|
|
270
|
+
/** Allow localhost for development */
|
|
271
|
+
allowLocalhost?: boolean;
|
|
131
272
|
/** Callback when widget is ready */
|
|
132
273
|
onReady?: () => void;
|
|
133
274
|
/** Callback when widget opens */
|
|
@@ -147,21 +288,65 @@ export interface UserInfo {
|
|
|
147
288
|
name?: string;
|
|
148
289
|
/** User's email address */
|
|
149
290
|
email?: string;
|
|
291
|
+
/** User's phone number */
|
|
292
|
+
phone?: string;
|
|
150
293
|
/** Additional metadata */
|
|
151
|
-
metadata?: Record<string,
|
|
294
|
+
metadata?: Record<string, unknown>;
|
|
152
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Message sender type
|
|
298
|
+
*/
|
|
299
|
+
export type MessageSender = 'user' | 'bot' | 'assistant' | 'agent' | 'system';
|
|
300
|
+
/**
|
|
301
|
+
* Message delivery status
|
|
302
|
+
*/
|
|
303
|
+
export type MessageStatus = 'pending' | 'sending' | 'sent' | 'delivered' | 'read' | 'error';
|
|
304
|
+
/**
|
|
305
|
+
* Message type
|
|
306
|
+
*/
|
|
307
|
+
export type MessageType = 'text' | 'image' | 'file' | 'carousel' | 'form' | 'buttons' | 'gallery';
|
|
153
308
|
/**
|
|
154
309
|
* Chat message structure
|
|
155
310
|
*/
|
|
156
311
|
export interface Message {
|
|
157
312
|
/** Unique message ID */
|
|
158
313
|
id: string;
|
|
159
|
-
/** Message
|
|
314
|
+
/** Message type */
|
|
315
|
+
type?: MessageType;
|
|
316
|
+
/** Message content (for text messages) */
|
|
160
317
|
content: string;
|
|
161
318
|
/** Message sender type */
|
|
162
|
-
sender:
|
|
319
|
+
sender: MessageSender;
|
|
163
320
|
/** Message timestamp */
|
|
164
321
|
timestamp: Date;
|
|
322
|
+
/** Session ID */
|
|
323
|
+
sessionId?: string;
|
|
324
|
+
/** Message status */
|
|
325
|
+
status?: MessageStatus;
|
|
326
|
+
/** Whether content contains markdown */
|
|
327
|
+
markdown?: boolean;
|
|
328
|
+
/** Image URL (for image messages) */
|
|
329
|
+
imageUrl?: string;
|
|
330
|
+
/** File URL (for file messages) */
|
|
331
|
+
fileUrl?: string;
|
|
332
|
+
/** Filename (for file messages) */
|
|
333
|
+
filename?: string;
|
|
334
|
+
/** File size (for file messages) */
|
|
335
|
+
fileSize?: number;
|
|
336
|
+
/** Cards (for carousel messages) */
|
|
337
|
+
cards?: CardContent[];
|
|
338
|
+
/** Form fields (for form messages) */
|
|
339
|
+
formFields?: FormField[];
|
|
340
|
+
/** Form ID (for form messages) */
|
|
341
|
+
formId?: string;
|
|
342
|
+
/** Form title (for form messages) */
|
|
343
|
+
formTitle?: string;
|
|
344
|
+
/** Submit label (for form messages) */
|
|
345
|
+
submitLabel?: string;
|
|
346
|
+
/** Buttons (for button group messages) */
|
|
347
|
+
buttons?: CardButton[];
|
|
348
|
+
/** Gallery images (for gallery messages) */
|
|
349
|
+
images?: GalleryImage[];
|
|
165
350
|
/** Additional message metadata */
|
|
166
351
|
metadata?: {
|
|
167
352
|
/** Source documents for RAG responses */
|
|
@@ -179,8 +364,31 @@ export interface Message {
|
|
|
179
364
|
escalated?: boolean;
|
|
180
365
|
/** Whether this is a system message */
|
|
181
366
|
is_system_message?: boolean;
|
|
367
|
+
/** Quick replies */
|
|
368
|
+
quick_replies?: QuickReply[];
|
|
182
369
|
};
|
|
183
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Widget initialization status
|
|
373
|
+
*/
|
|
374
|
+
export type WidgetStatus = 'initializing' | 'ready' | 'open' | 'error';
|
|
375
|
+
/**
|
|
376
|
+
* Connection status
|
|
377
|
+
*/
|
|
378
|
+
export type ConnectionStatus = 'connected' | 'connecting' | 'disconnected' | 'offline';
|
|
379
|
+
/**
|
|
380
|
+
* Current view in the widget
|
|
381
|
+
*/
|
|
382
|
+
export type WidgetView = 'chat' | 'ticket' | 'history' | 'survey';
|
|
383
|
+
/**
|
|
384
|
+
* Escalation status
|
|
385
|
+
*/
|
|
386
|
+
export interface EscalationStatus {
|
|
387
|
+
active: boolean;
|
|
388
|
+
type: 'live_agent' | 'ticket';
|
|
389
|
+
queuePosition?: number;
|
|
390
|
+
estimatedWait?: number;
|
|
391
|
+
}
|
|
184
392
|
/**
|
|
185
393
|
* Widget state information
|
|
186
394
|
*/
|
|
@@ -191,21 +399,52 @@ export interface WidgetState {
|
|
|
191
399
|
isConnected: boolean;
|
|
192
400
|
/** Chat message history */
|
|
193
401
|
messages: Message[];
|
|
402
|
+
/** Pending messages (offline queue) */
|
|
403
|
+
pendingMessages?: Message[];
|
|
194
404
|
/** Current session ID */
|
|
195
405
|
sessionId: string | null;
|
|
196
406
|
/** Visitor ID */
|
|
197
407
|
visitorId: string | null;
|
|
198
408
|
/** Number of unread messages */
|
|
199
409
|
unreadCount: number;
|
|
410
|
+
/** Current view */
|
|
411
|
+
view?: WidgetView;
|
|
412
|
+
/** Connection status */
|
|
413
|
+
connectionStatus?: ConnectionStatus;
|
|
414
|
+
/** Typing indicator */
|
|
415
|
+
typingIndicator?: boolean;
|
|
416
|
+
/** Sound muted */
|
|
417
|
+
soundMuted?: boolean;
|
|
418
|
+
/** Widget dimensions */
|
|
419
|
+
dimensions?: {
|
|
420
|
+
width: number;
|
|
421
|
+
height: number;
|
|
422
|
+
};
|
|
423
|
+
/** Escalation status */
|
|
424
|
+
escalationStatus?: EscalationStatus | null;
|
|
425
|
+
/** Queue position */
|
|
426
|
+
queuePosition?: number | null;
|
|
427
|
+
/** User info */
|
|
428
|
+
userInfo?: UserInfo | null;
|
|
200
429
|
}
|
|
201
430
|
/**
|
|
202
431
|
* Widget event types
|
|
203
432
|
*/
|
|
204
|
-
export type WidgetEvent = 'ready' | 'open' | 'close' | 'message' | 'error' | 'connected' | 'disconnected' | 'newConversation';
|
|
433
|
+
export type WidgetEvent = 'ready' | 'open' | 'close' | 'message' | 'message:sent' | 'message:received' | 'error' | 'connected' | 'disconnected' | 'connection:change' | 'newConversation' | 'escalation:start' | 'escalation:end' | 'survey:shown' | 'survey:submitted' | 'proactive:shown' | 'proactive:clicked';
|
|
205
434
|
/**
|
|
206
435
|
* Event callback function type
|
|
207
436
|
*/
|
|
208
437
|
export type EventCallback = (data?: unknown) => void;
|
|
438
|
+
/**
|
|
439
|
+
* Conversation summary for history display
|
|
440
|
+
*/
|
|
441
|
+
export interface ConversationSummary {
|
|
442
|
+
sessionId: string;
|
|
443
|
+
startTime: Date;
|
|
444
|
+
lastMessageTime: Date;
|
|
445
|
+
messageCount: number;
|
|
446
|
+
preview: string;
|
|
447
|
+
}
|
|
209
448
|
/**
|
|
210
449
|
* Public API interface for the Ihooman Chat Widget
|
|
211
450
|
*/
|
|
@@ -228,6 +467,10 @@ export interface IhoomanChatAPI {
|
|
|
228
467
|
* Toggle the chat widget window open/closed
|
|
229
468
|
*/
|
|
230
469
|
toggle(): void;
|
|
470
|
+
/**
|
|
471
|
+
* Check if widget is open
|
|
472
|
+
*/
|
|
473
|
+
isOpen?(): boolean;
|
|
231
474
|
/**
|
|
232
475
|
* Destroy the widget and clean up resources
|
|
233
476
|
*/
|
|
@@ -242,6 +485,10 @@ export interface IhoomanChatAPI {
|
|
|
242
485
|
* @param user - User information
|
|
243
486
|
*/
|
|
244
487
|
setUser(user: UserInfo): void;
|
|
488
|
+
/**
|
|
489
|
+
* Clear user information
|
|
490
|
+
*/
|
|
491
|
+
clearUser?(): void;
|
|
245
492
|
/**
|
|
246
493
|
* Clear chat history and start a new conversation
|
|
247
494
|
*/
|
|
@@ -263,6 +510,10 @@ export interface IhoomanChatAPI {
|
|
|
263
510
|
* @returns Current widget state
|
|
264
511
|
*/
|
|
265
512
|
getState(): WidgetState;
|
|
513
|
+
/**
|
|
514
|
+
* Get current widget configuration
|
|
515
|
+
*/
|
|
516
|
+
getConfig?(): WidgetConfig;
|
|
266
517
|
/**
|
|
267
518
|
* Widget version
|
|
268
519
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,aAAa,C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ACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAE3D;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,SAAS,CAAC,IAAI,IAAI,CAAC;IAEnB;;OAEG;IACH,YAAY,IAAI,IAAI,CAAC;IAErB;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAEtD;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,QAAQ,IAAI,WAAW,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,IAAI,YAAY,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
* Universal chat support widget for any website.
|
|
5
5
|
* Uses secure Widget ID based initialization - no API keys exposed in client code.
|
|
6
6
|
*
|
|
7
|
+
* Enhanced with professional features:
|
|
8
|
+
* - Proactive messages with triggers (time, scroll, exit intent, URL pattern)
|
|
9
|
+
* - Survey support (star, NPS, emoji ratings)
|
|
10
|
+
* - Rich message types (carousel, forms, buttons, quick replies)
|
|
11
|
+
* - Message feedback (thumbs up/down)
|
|
12
|
+
* - Conversation history
|
|
13
|
+
* - Live agent escalation
|
|
14
|
+
* - Ticket submission
|
|
15
|
+
* - Localization support
|
|
16
|
+
* - Security features (domain validation, XSS prevention)
|
|
17
|
+
*
|
|
7
18
|
* @packageDocumentation
|
|
8
19
|
*/
|
|
9
20
|
|
|
@@ -19,6 +30,29 @@ export type {
|
|
|
19
30
|
BehaviorConfig,
|
|
20
31
|
BrandingConfig,
|
|
21
32
|
IhoomanChatAPI,
|
|
33
|
+
PresetQuestion,
|
|
34
|
+
QuickReply,
|
|
35
|
+
ProactiveMessage,
|
|
36
|
+
ProactiveTriggerConfig,
|
|
37
|
+
SurveyConfig,
|
|
38
|
+
SurveyResponse,
|
|
39
|
+
SurveyType,
|
|
40
|
+
CardButton,
|
|
41
|
+
CardContent,
|
|
42
|
+
CardButtonAction,
|
|
43
|
+
FormField,
|
|
44
|
+
FormFieldType,
|
|
45
|
+
FormFieldOption,
|
|
46
|
+
ValidationRule,
|
|
47
|
+
GalleryImage,
|
|
48
|
+
MessageSender,
|
|
49
|
+
MessageStatus,
|
|
50
|
+
MessageType,
|
|
51
|
+
WidgetStatus,
|
|
52
|
+
ConnectionStatus,
|
|
53
|
+
WidgetView,
|
|
54
|
+
EscalationStatus,
|
|
55
|
+
ConversationSummary,
|
|
22
56
|
} from './types';
|
|
23
57
|
|
|
24
58
|
// Re-export the default instance for convenience
|