@developer.notchatbot/webchat 1.0.8 → 1.0.9
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 +733 -733
- package/dist/components/embedchat/EmbedChat.d.ts +4 -0
- package/dist/components/embedchat/EmbedChatFooter.d.ts +4 -0
- package/dist/components/embedchat/EmbedChatHeader.d.ts +4 -0
- package/dist/components/embedchat/EmbedChatWindow.d.ts +4 -0
- package/dist/config/company-config.d.ts +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/types.d.ts +48 -1
- package/dist/utils/messaging.d.ts +2 -2
- package/dist/utils/user.d.ts +3 -3
- package/dist/webchat-bundle.min.js +8834 -7026
- package/dist/webchat-bundle.min.umd.cjs +77 -22
- package/package.json +55 -54
|
@@ -2,7 +2,7 @@ export declare const COMPANY_CONFIG: {
|
|
|
2
2
|
readonly apiKey: "";
|
|
3
3
|
readonly primaryColor: "#111111";
|
|
4
4
|
readonly avatar: "";
|
|
5
|
-
readonly title: "
|
|
5
|
+
readonly title: "NotChatBot";
|
|
6
6
|
readonly placeholder: "Escribe tu mensaje...";
|
|
7
7
|
readonly initialMessage: "¡Hola! ¿En qué puedo ayudarte?";
|
|
8
8
|
readonly position: "bottom-right";
|
package/dist/index.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface WebChatConfig {
|
|
|
11
11
|
avatar?: string;
|
|
12
12
|
apiKey?: string;
|
|
13
13
|
position?: 'bottom-right' | 'bottom-left';
|
|
14
|
-
conversationId?: string;
|
|
15
14
|
initialMessage?: string;
|
|
16
15
|
closeButtonIcon?: 'default' | 'text' | 'custom';
|
|
17
16
|
closeButtonText?: string;
|
|
@@ -21,12 +20,57 @@ export interface WebChatConfig {
|
|
|
21
20
|
mobile?: WebChatPositionConfig;
|
|
22
21
|
desktop?: WebChatPositionConfig;
|
|
23
22
|
}
|
|
23
|
+
export interface EmbedChatConfig {
|
|
24
|
+
elementId: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
primaryColor?: string;
|
|
28
|
+
avatar?: string;
|
|
29
|
+
apiKey?: string;
|
|
30
|
+
initialMessage?: string;
|
|
31
|
+
footerText?: string;
|
|
32
|
+
width?: string | number;
|
|
33
|
+
height?: string | number;
|
|
34
|
+
maxWidth?: string | number;
|
|
35
|
+
maxHeight?: string | number;
|
|
36
|
+
minWidth?: string | number;
|
|
37
|
+
minHeight?: string | number;
|
|
38
|
+
showHeader?: boolean;
|
|
39
|
+
showFooter?: boolean;
|
|
40
|
+
borderRadius?: string | number;
|
|
41
|
+
border?: string;
|
|
42
|
+
boxShadow?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface EmbedChatProps {
|
|
45
|
+
config: EmbedChatConfig;
|
|
46
|
+
}
|
|
47
|
+
export interface EmbedChatWindowProps {
|
|
48
|
+
config: EmbedChatConfig;
|
|
49
|
+
messages: Message[];
|
|
50
|
+
onSendMessage: (message: string) => void;
|
|
51
|
+
isLoading?: boolean;
|
|
52
|
+
isAiTyping?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface EmbedChatHeaderProps {
|
|
55
|
+
title: string;
|
|
56
|
+
primaryColor?: string;
|
|
57
|
+
avatar?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface EmbedChatFooterProps {
|
|
60
|
+
footerText?: string;
|
|
61
|
+
primaryColor?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface EmbedChatInstance {
|
|
64
|
+
destroy: () => void;
|
|
65
|
+
updateConfig: (newConfig: Partial<EmbedChatConfig>) => void;
|
|
66
|
+
}
|
|
24
67
|
export interface Message {
|
|
25
68
|
id: string;
|
|
26
69
|
text: string;
|
|
27
70
|
sender: 'user' | 'bot';
|
|
28
71
|
timestamp: Date | string;
|
|
29
72
|
conversationId?: string;
|
|
73
|
+
type: string;
|
|
30
74
|
}
|
|
31
75
|
export interface ChatBotProps {
|
|
32
76
|
config: WebChatConfig;
|
|
@@ -89,3 +133,6 @@ export interface WebChatInstance {
|
|
|
89
133
|
export interface WebChatAPI {
|
|
90
134
|
initialize: (config?: Partial<WebChatConfig>) => WebChatInstance | null;
|
|
91
135
|
}
|
|
136
|
+
export interface EmbedChatAPI {
|
|
137
|
+
initialize: (config: EmbedChatConfig) => EmbedChatInstance | null;
|
|
138
|
+
}
|
|
@@ -23,12 +23,12 @@ export declare const createFallbackMessage: () => Message;
|
|
|
23
23
|
* @param conversationId Conversation ID
|
|
24
24
|
* @param messages Array of messages
|
|
25
25
|
* @param config Chat configuration
|
|
26
|
-
* @param
|
|
26
|
+
* @param sessionId User's session identifier
|
|
27
27
|
* @returns API payload
|
|
28
28
|
*/
|
|
29
29
|
export declare const buildMessagePayload: (conversationId: string, messages: Message[], config: {
|
|
30
30
|
apiKey: string;
|
|
31
|
-
},
|
|
31
|
+
}, sessionId: string) => SendMessagePayload;
|
|
32
32
|
/**
|
|
33
33
|
* Sends messages to the chat API
|
|
34
34
|
* @param payload Message payload
|
package/dist/utils/user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @returns Promise that resolves to
|
|
2
|
+
* Generates a unique session identifier without making network requests
|
|
3
|
+
* @returns Promise that resolves to a unique session identifier
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const getSessionId: () => Promise<string>;
|