@filigran/chatbot 1.0.0 → 1.0.1

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,218 @@
1
+ import { BotMessageTheme as BotMessageTheme$1, UserMessageTheme as UserMessageTheme$1, TextInputTheme as TextInputTheme$1, FooterTheme as FooterTheme$1, DisclaimerPopUpTheme as DisclaimerPopUpTheme$1, DateTimeToggleTheme as DateTimeToggleTheme$1 } from '@/features/bubble/types';
2
+
3
+ type FilePreviewData = string | ArrayBuffer;
4
+ type FilePreviewItem = {
5
+ data: FilePreviewData;
6
+ mime: string;
7
+ name: string;
8
+ preview: string;
9
+ type: string;
10
+ };
11
+ type messageType = 'apiMessage' | 'userMessage' | 'usermessagewaiting' | 'leadCaptureMessage';
12
+ type IAgentReasoning = {
13
+ agentName?: string;
14
+ messages?: string[];
15
+ usedTools?: any[];
16
+ artifacts?: FileUpload[];
17
+ sourceDocuments?: any[];
18
+ instructions?: string;
19
+ nextAgent?: string;
20
+ };
21
+ type IAction = {
22
+ id?: string;
23
+ data?: any;
24
+ elements?: Array<{
25
+ type: string;
26
+ label: string;
27
+ }>;
28
+ mapping?: {
29
+ approve: string;
30
+ reject: string;
31
+ toolCalls: any[];
32
+ };
33
+ };
34
+ type FileUpload = Omit<FilePreviewItem, 'preview'>;
35
+ type MessageType = {
36
+ messageId?: string;
37
+ message: string;
38
+ type: messageType;
39
+ sourceDocuments?: any;
40
+ fileAnnotations?: any;
41
+ fileUploads?: Partial<FileUpload>[];
42
+ artifacts?: Partial<FileUpload>[];
43
+ agentReasoning?: IAgentReasoning[];
44
+ execution?: any;
45
+ agentFlowEventStatus?: string;
46
+ agentFlowExecutedData?: any;
47
+ usedTools?: any[];
48
+ action?: IAction | null;
49
+ id?: string;
50
+ followUpPrompts?: string;
51
+ dateTime?: string;
52
+ };
53
+ type observerConfigType = (accessor: string | boolean | object | MessageType[]) => void;
54
+ type observersConfigType = Record<'observeUserInput' | 'observeLoading' | 'observeMessages', observerConfigType>;
55
+ type BotProps = {
56
+ expanded?: boolean;
57
+ onExpand?: () => void;
58
+ agenticUrl: string;
59
+ onRequest?: (request: RequestInit) => Promise<void>;
60
+ chatflowConfig?: Record<string, unknown> & {
61
+ vars: Record<string, string>;
62
+ };
63
+ backgroundColor?: string;
64
+ welcomeMessage?: string;
65
+ errorMessage?: string;
66
+ botMessage?: BotMessageTheme$1;
67
+ userMessage?: UserMessageTheme$1;
68
+ textInput?: TextInputTheme$1;
69
+ poweredByTextColor?: string;
70
+ badgeBackgroundColor?: string;
71
+ bubbleBackgroundColor?: string;
72
+ bubbleTextColor?: string;
73
+ showTitle?: boolean;
74
+ showAgentMessages?: boolean;
75
+ title?: string;
76
+ titleAvatarSrc?: string;
77
+ titleTextColor?: string;
78
+ titleBackgroundColor?: string;
79
+ formBackgroundColor?: string;
80
+ formTextColor?: string;
81
+ fontSize?: number;
82
+ isFullPage?: boolean;
83
+ footer?: FooterTheme$1;
84
+ sourceDocsTitle?: string;
85
+ observersConfig?: observersConfigType;
86
+ starterPrompts?: string[] | Record<string, {
87
+ prompt: string;
88
+ }>;
89
+ starterPromptFontSize?: number;
90
+ clearChatOnReload?: boolean;
91
+ disclaimer?: DisclaimerPopUpTheme$1;
92
+ dateTimeToggle?: DateTimeToggleTheme$1;
93
+ renderHTML?: boolean;
94
+ closeBot?: () => void;
95
+ };
96
+
97
+ type BubbleParams = {
98
+ theme?: BubbleTheme;
99
+ ref?: HTMLElement;
100
+ left: number;
101
+ text?: string;
102
+ };
103
+ type BubbleTheme = {
104
+ chatWindow?: ChatWindowTheme;
105
+ button?: ButtonTheme;
106
+ tooltip?: ToolTipTheme;
107
+ disclaimer?: DisclaimerPopUpTheme;
108
+ customCSS?: string;
109
+ form?: FormTheme;
110
+ };
111
+ type FormTheme = {
112
+ backgroundColor?: string;
113
+ textColor?: string;
114
+ };
115
+ type TextInputTheme = {
116
+ backgroundColor?: string;
117
+ textColor?: string;
118
+ placeholder?: string;
119
+ sendButtonColor?: string;
120
+ maxChars?: number;
121
+ maxCharsWarningMessage?: string;
122
+ autoFocus?: boolean;
123
+ sendMessageSound?: boolean;
124
+ sendSoundLocation?: string;
125
+ receiveMessageSound?: boolean;
126
+ receiveSoundLocation?: string;
127
+ };
128
+ type UserMessageTheme = {
129
+ backgroundColor?: string;
130
+ textColor?: string;
131
+ showAvatar?: boolean;
132
+ avatarSrc?: string;
133
+ };
134
+ type BotMessageTheme = {
135
+ backgroundColor?: string;
136
+ textColor?: string;
137
+ showAvatar?: boolean;
138
+ avatarSrc?: string;
139
+ };
140
+ type FooterTheme = {
141
+ showFooter?: boolean;
142
+ textColor?: string;
143
+ text?: string;
144
+ company?: string;
145
+ companyLink?: string;
146
+ };
147
+ type ChatWindowTheme = {
148
+ showTitle?: boolean;
149
+ showAgentMessages?: boolean;
150
+ title?: string;
151
+ titleAvatarSrc?: string;
152
+ titleTextColor?: string;
153
+ titleBackgroundColor?: string;
154
+ welcomeMessage?: string;
155
+ errorMessage?: string;
156
+ backgroundColor?: string;
157
+ backgroundImage?: string;
158
+ boxShadow?: string;
159
+ height?: number;
160
+ width?: number;
161
+ fontSize?: number;
162
+ userMessage?: UserMessageTheme;
163
+ botMessage?: BotMessageTheme;
164
+ textInput?: TextInputTheme;
165
+ footer?: FooterTheme;
166
+ sourceDocsTitle?: string;
167
+ poweredByTextColor?: string;
168
+ starterPrompts?: string[];
169
+ starterPromptFontSize?: number;
170
+ clearChatOnReload?: boolean;
171
+ dateTimeToggle?: DateTimeToggleTheme;
172
+ renderHTML?: boolean;
173
+ };
174
+ type ButtonTheme = {
175
+ size?: 'small' | 'medium' | 'large' | number;
176
+ backgroundColor?: string;
177
+ iconColor?: string;
178
+ customIconSrc?: string;
179
+ top?: number;
180
+ left?: number;
181
+ dragAndDrop?: boolean;
182
+ autoWindowOpen?: autoWindowOpenTheme;
183
+ };
184
+ type ToolTipTheme = {
185
+ showTooltip?: boolean;
186
+ tooltipMessage?: string;
187
+ tooltipBackgroundColor?: string;
188
+ tooltipTextColor?: string;
189
+ tooltipFontSize?: number;
190
+ };
191
+ type autoWindowOpenTheme = {
192
+ autoOpen?: boolean;
193
+ openDelay?: number;
194
+ autoOpenOnMobile?: boolean;
195
+ };
196
+ type DisclaimerPopUpTheme = {
197
+ title?: string;
198
+ message?: string;
199
+ textColor?: string;
200
+ buttonColor?: string;
201
+ buttonTextColor?: string;
202
+ buttonText?: string;
203
+ blurredBackgroundColor?: string;
204
+ backgroundColor?: string;
205
+ denyButtonBgColor?: string;
206
+ denyButtonText?: string;
207
+ };
208
+ type DateTimeToggleTheme = {
209
+ date?: boolean;
210
+ time?: boolean;
211
+ };
212
+
213
+ type BubbleProps = BotProps & BubbleParams & {
214
+ open?: boolean;
215
+ onClose?: () => void;
216
+ };
217
+
218
+ export type { BotProps, BubbleProps };