@bcrumbs.net/bc-chat 1.0.76 → 1.0.78

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/build/index.d.ts CHANGED
@@ -1,99 +1,99 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { MessageDto, MessageStatus } from 'graphql.autogenerated';
3
3
 
4
- /**
5
- * MessageType is an enum of the message types.
6
- * It can be:
7
- * - text: Text message.
8
- * - image: Image message.
9
- * - audio: Audio message.
10
- * - document: Document message (Files, PDFs, etc.).
11
- * - video: Video message.
12
- * - location: Location message.
13
- * - interactive: Interactive message.
14
- * - template: Template message (WhatsApp only).
15
- * - note: Note message (Internal note).
16
- */
17
- declare const MessageType: {
18
- readonly AUDIO: "audio";
19
- readonly BUTTON: "button";
20
- readonly DOCUMENT: "document";
21
- readonly IMAGE: "image";
22
- readonly INTERACTIVE: "interactive";
23
- readonly LOCATION: "location";
24
- readonly NOTE: "note";
25
- readonly TEMPLATE: "template";
26
- readonly TEXT: "text";
27
- readonly VIDEO: "video";
28
- };
4
+ /**
5
+ * MessageType is an enum of the message types.
6
+ * It can be:
7
+ * - text: Text message.
8
+ * - image: Image message.
9
+ * - audio: Audio message.
10
+ * - document: Document message (Files, PDFs, etc.).
11
+ * - video: Video message.
12
+ * - location: Location message.
13
+ * - interactive: Interactive message.
14
+ * - template: Template message (WhatsApp only).
15
+ * - note: Note message (Internal note).
16
+ */
17
+ declare const MessageType: {
18
+ readonly AUDIO: "audio";
19
+ readonly BUTTON: "button";
20
+ readonly DOCUMENT: "document";
21
+ readonly IMAGE: "image";
22
+ readonly INTERACTIVE: "interactive";
23
+ readonly LOCATION: "location";
24
+ readonly NOTE: "note";
25
+ readonly TEMPLATE: "template";
26
+ readonly TEXT: "text";
27
+ readonly VIDEO: "video";
28
+ };
29
29
  type MessageType = typeof MessageType[keyof typeof MessageType];
30
30
 
31
- type Lang = "EN" | "AR" | "TR";
32
- type ChatConfig = {
33
- backgroundImage?: string;
34
- backgroundColor?: string;
35
- brandLogo?: string;
36
- brandName?: string;
37
- inputPlaceholder?: string;
38
- whiteLabeled?: boolean;
39
- inputDisabled?: boolean;
40
- language?: Lang;
41
- hideHeader?: boolean;
42
- isAgent?: boolean;
43
- };
44
- type UtilMessage = {
45
- type: 'seperator';
46
- content?: string;
47
- };
48
- type ChatMessage = Partial<MessageDto> & {
49
- status?: MessageStatus;
50
- agentId?: string;
31
+ type Lang = "EN" | "AR" | "TR";
32
+ type ChatConfig = {
33
+ backgroundImage?: string;
34
+ backgroundColor?: string;
35
+ brandLogo?: string;
36
+ brandName?: string;
37
+ inputPlaceholder?: string;
38
+ whiteLabeled?: boolean;
39
+ inputDisabled?: boolean;
40
+ language?: Lang;
41
+ hideHeader?: boolean;
42
+ isAgent?: boolean;
43
+ };
44
+ type UtilMessage = {
45
+ type: 'seperator';
46
+ content?: string;
47
+ };
48
+ type ChatMessage = Partial<MessageDto> & {
49
+ status?: MessageStatus;
50
+ agentId?: string;
51
51
  };
52
52
 
53
- /** Controls for auto-complete functionality */
54
- interface AutoCompleteControls {
55
- /** Enable/disable auto-complete feature */
56
- autoCompleteEnabled?: boolean;
57
- /** The auto-complete suggestion text to display */
58
- autoCompleteSuggestion?: string;
59
- /** Callback fired when the input text changes */
60
- onInputChange?: (text: string) => void;
61
- /** Callback to mutate the auto-complete suggestion. Called with updated suggestion or null to reset */
62
- onAutoCompleteMutate?: (suggestion: string | null) => void;
53
+ /** Controls for auto-complete functionality */
54
+ interface AutoCompleteControls {
55
+ /** Enable/disable auto-complete feature */
56
+ autoCompleteEnabled?: boolean;
57
+ /** The auto-complete suggestion text to display */
58
+ autoCompleteSuggestion?: string;
59
+ /** Callback fired when the input text changes */
60
+ onInputChange?: (text: string) => void;
61
+ /** Callback to mutate the auto-complete suggestion. Called with updated suggestion or null to reset */
62
+ onAutoCompleteMutate?: (suggestion: string | null) => void;
63
63
  }
64
64
 
65
- interface ChatProps extends AutoCompleteControls {
66
- config?: ChatConfig;
67
- messages?: (ChatMessage | UtilMessage)[];
68
- sendMessage: (type: MessageType, messageContent: string) => void;
69
- onReachingUp?: () => void;
70
- minimize?: () => void;
71
- debug?: boolean;
72
- agentsIdsAvatarsMap?: Record<string, string>;
73
- actionChips?: React.ReactNode;
74
- /** When true, the input switches to note mode */
75
- noteMode?: boolean;
76
- /** Called with the note text when user clicks send in note mode */
77
- onNoteSend?: (note: string) => void;
78
- /** Close handler for the note mode (X icon) */
79
- onCloseNoteMode?: () => void;
80
- /** Placeholder to display in the input while in note mode */
81
- notePlaceholder?: string;
82
- searchPattern?: string;
83
- searchMatchNo?: number;
84
- /** Called with the number of search pattern matches found */
85
- onSearchMatchCount?: (count: number) => void;
86
- /** Triggered when the user clicks reply on a message bubble */
87
- onMessageReply?: (messageId: string) => void;
88
- /** Title displayed in the input while replying to a message */
89
- replyMessageTitle?: string;
90
- /** Content preview displayed in the input while replying */
91
- replyMessageContent?: string;
92
- /** Called when the reply preview is dismissed */
93
- onCancelReplyMessage?: () => void;
94
- /** When provided, renders a disabled/error state message at the bottom of the list */
95
- errorMessage?: string;
96
- }
65
+ interface ChatProps extends AutoCompleteControls {
66
+ config?: ChatConfig;
67
+ messages?: (ChatMessage | UtilMessage)[];
68
+ sendMessage: (type: MessageType, messageContent: string) => void;
69
+ onReachingUp?: () => void;
70
+ minimize?: () => void;
71
+ debug?: boolean;
72
+ agentsIdsAvatarsMap?: Record<string, string>;
73
+ actionChips?: React.ReactNode;
74
+ /** When true, the input switches to note mode */
75
+ noteMode?: boolean;
76
+ /** Called with the note text when user clicks send in note mode */
77
+ onNoteSend?: (note: string) => void;
78
+ /** Close handler for the note mode (X icon) */
79
+ onCloseNoteMode?: () => void;
80
+ /** Placeholder to display in the input while in note mode */
81
+ notePlaceholder?: string;
82
+ searchPattern?: string;
83
+ searchMatchNo?: number;
84
+ /** Called with the number of search pattern matches found */
85
+ onSearchMatchCount?: (count: number) => void;
86
+ /** Triggered when the user clicks reply on a message bubble */
87
+ onMessageReply?: (messageId: string) => void;
88
+ /** Title displayed in the input while replying to a message */
89
+ replyMessageTitle?: string;
90
+ /** Content preview displayed in the input while replying */
91
+ replyMessageContent?: string;
92
+ /** Called when the reply preview is dismissed */
93
+ onCancelReplyMessage?: () => void;
94
+ /** When provided, renders a disabled/error state message at the bottom of the list */
95
+ errorMessage?: string;
96
+ }
97
97
  declare const Chat: ({ config, messages, sendMessage, debug, minimize, onReachingUp, agentsIdsAvatarsMap, actionChips, noteMode, onNoteSend, onCloseNoteMode, searchPattern, notePlaceholder, searchMatchNo, onSearchMatchCount, onMessageReply, replyMessageTitle, replyMessageContent, onCancelReplyMessage, errorMessage, autoCompleteEnabled, autoCompleteSuggestion, onInputChange, onAutoCompleteMutate }: ChatProps) => react_jsx_runtime.JSX.Element;
98
98
 
99
99
  export { Chat as BCChat };