@developer.notchatbot/webchat 1.0.8 → 1.1.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.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { EmbedChatProps } from '../../types';
3
+ declare const EmbedChat: React.FC<EmbedChatProps>;
4
+ export default EmbedChat;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { EmbedChatFooterProps } from '../../types';
3
+ declare const EmbedChatFooter: React.FC<EmbedChatFooterProps>;
4
+ export default EmbedChatFooter;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { EmbedChatHeaderProps } from '../../types';
3
+ declare const EmbedChatHeader: React.FC<EmbedChatHeaderProps>;
4
+ export default EmbedChatHeader;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { EmbedChatWindowProps } from '../../types';
3
+ declare const EmbedChatWindow: React.FC<EmbedChatWindowProps>;
4
+ export default EmbedChatWindow;
@@ -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: "ChatBot - NotChatBot";
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
@@ -1,3 +1,4 @@
1
- import { WebChatAPI } from './types';
1
+ import { WebChatAPI, EmbedChatAPI } from './types';
2
2
  declare const WebChat: WebChatAPI;
3
- export default WebChat;
3
+ declare const EmbedChatAPI: EmbedChatAPI;
4
+ export { WebChat, EmbedChatAPI };
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,73 @@ export interface WebChatConfig {
21
20
  mobile?: WebChatPositionConfig;
22
21
  desktop?: WebChatPositionConfig;
23
22
  }
23
+ export interface EmbedChatInputConfig {
24
+ backgroundColor?: string;
25
+ inputBorder?: string;
26
+ inputBorderRadius?: string;
27
+ iconColor?: string;
28
+ }
29
+ export interface EmbedChatConfig {
30
+ elementId: string;
31
+ title?: string;
32
+ placeholder?: string;
33
+ primaryColor?: string;
34
+ avatar?: string;
35
+ apiKey?: string;
36
+ initialMessage?: string;
37
+ footerText?: string;
38
+ width?: string | number;
39
+ height?: string | number;
40
+ maxWidth?: string | number;
41
+ maxHeight?: string | number;
42
+ minWidth?: string | number;
43
+ minHeight?: string | number;
44
+ showHeader?: boolean;
45
+ showFooter?: boolean;
46
+ borderRadius?: string | number;
47
+ border?: string;
48
+ boxShadow?: string;
49
+ chatTransparent?: boolean;
50
+ chatBackground?: string;
51
+ textColor?: string;
52
+ bubbleUserColor?: string;
53
+ input?: EmbedChatInputConfig;
54
+ footerColor?: string;
55
+ customCSS?: string;
56
+ }
57
+ export interface EmbedChatProps {
58
+ config: EmbedChatConfig;
59
+ }
60
+ export interface EmbedChatWindowProps {
61
+ config: EmbedChatConfig;
62
+ messages: Message[];
63
+ onSendMessage: (message: string) => void;
64
+ isLoading?: boolean;
65
+ isAiTyping?: boolean;
66
+ }
67
+ export interface EmbedChatHeaderProps {
68
+ title: string;
69
+ primaryColor?: string;
70
+ avatar?: string;
71
+ }
72
+ export interface EmbedChatFooterProps {
73
+ footerText?: string;
74
+ primaryColor?: string;
75
+ footerColor?: string;
76
+ }
77
+ export interface EmbedChatInstance {
78
+ destroy: () => void;
79
+ updateConfig: (newConfig: Partial<EmbedChatConfig>) => void;
80
+ injectCSS: (css: string) => void;
81
+ removeCustomCSS: () => void;
82
+ }
24
83
  export interface Message {
25
84
  id: string;
26
85
  text: string;
27
86
  sender: 'user' | 'bot';
28
87
  timestamp: Date | string;
29
88
  conversationId?: string;
89
+ type: string;
30
90
  }
31
91
  export interface ChatBotProps {
32
92
  config: WebChatConfig;
@@ -67,16 +127,21 @@ export interface MessageListProps {
67
127
  messages: Message[];
68
128
  isTyping: boolean;
69
129
  avatar?: string;
130
+ textColor?: string;
131
+ bubbleUserColor?: string;
70
132
  }
71
133
  export interface MessageProps {
72
134
  message: Message;
73
135
  avatar?: string;
136
+ textColor?: string;
137
+ bubbleUserColor?: string;
74
138
  }
75
139
  export interface MessageInputProps {
76
140
  onSendMessage: (message: string) => void;
77
141
  placeholder?: string;
78
142
  primaryColor?: string;
79
143
  disabled?: boolean;
144
+ input?: EmbedChatInputConfig;
80
145
  }
81
146
  export interface TypingIndicatorProps {
82
147
  avatar?: string;
@@ -89,3 +154,6 @@ export interface WebChatInstance {
89
154
  export interface WebChatAPI {
90
155
  initialize: (config?: Partial<WebChatConfig>) => WebChatInstance | null;
91
156
  }
157
+ export interface EmbedChatAPI {
158
+ initialize: (config: EmbedChatConfig) => EmbedChatInstance | null;
159
+ }
@@ -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 userIP User's IP address
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
- }, userIP: string) => SendMessagePayload;
31
+ }, sessionId: string) => SendMessagePayload;
32
32
  /**
33
33
  * Sends messages to the chat API
34
34
  * @param payload Message payload
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Fetches the user's IP address from an external service
3
- * @returns Promise that resolves to the user's IP address or a fallback identifier
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 getUserIP: () => Promise<string>;
5
+ export declare const getSessionId: () => Promise<string>;