thub-embed 9.0.26 → 9.1.2

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.
Files changed (67) hide show
  1. package/.env.example +34 -0
  2. package/README.md +342 -151
  3. package/dist/components/Badge.d.ts.map +1 -1
  4. package/dist/components/Bot.d.ts +37 -3
  5. package/dist/components/Bot.d.ts.map +1 -1
  6. package/dist/components/ImageUploadButton.d.ts +11 -0
  7. package/dist/components/ImageUploadButton.d.ts.map +1 -0
  8. package/dist/components/RecordAudioButton.d.ts +11 -0
  9. package/dist/components/RecordAudioButton.d.ts.map +1 -0
  10. package/dist/components/SendButton.d.ts +12 -0
  11. package/dist/components/SendButton.d.ts.map +1 -0
  12. package/dist/components/bubbles/AgentReasoningBubble.d.ts +6 -0
  13. package/dist/components/bubbles/AgentReasoningBubble.d.ts.map +1 -1
  14. package/dist/components/bubbles/BotBubble.d.ts +8 -1
  15. package/dist/components/bubbles/BotBubble.d.ts.map +1 -1
  16. package/dist/components/bubbles/FollowUpPromptBubble.d.ts +8 -0
  17. package/dist/components/bubbles/FollowUpPromptBubble.d.ts.map +1 -0
  18. package/dist/components/bubbles/GuestBubble.d.ts +1 -0
  19. package/dist/components/bubbles/GuestBubble.d.ts.map +1 -1
  20. package/dist/components/bubbles/StarterPromptBubble.d.ts +1 -0
  21. package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -1
  22. package/dist/components/buttons/AttachmentUploadButton.d.ts +11 -0
  23. package/dist/components/buttons/AttachmentUploadButton.d.ts.map +1 -0
  24. package/dist/components/icons/AttachmentIcon.d.ts +3 -0
  25. package/dist/components/icons/AttachmentIcon.d.ts.map +1 -0
  26. package/dist/components/icons/SparklesIcon.d.ts +3 -0
  27. package/dist/components/icons/SparklesIcon.d.ts.map +1 -0
  28. package/dist/components/icons/TickIcon.d.ts +2 -0
  29. package/dist/components/icons/TickIcon.d.ts.map +1 -0
  30. package/dist/components/icons/XIcon.d.ts +3 -1
  31. package/dist/components/icons/XIcon.d.ts.map +1 -1
  32. package/dist/components/icons/index.d.ts +3 -0
  33. package/dist/components/icons/index.d.ts.map +1 -1
  34. package/dist/components/inputs/textInput/components/FilePreview.d.ts +12 -0
  35. package/dist/components/inputs/textInput/components/FilePreview.d.ts.map +1 -0
  36. package/dist/components/inputs/textInput/components/TextInput.d.ts +7 -3
  37. package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -1
  38. package/dist/components/inputs/textInput/index.d.ts +1 -0
  39. package/dist/components/inputs/textInput/index.d.ts.map +1 -1
  40. package/dist/constants.d.ts.map +1 -1
  41. package/dist/features/bubble/components/Bubble.d.ts.map +1 -1
  42. package/dist/features/bubble/components/BubbleButton.d.ts +3 -0
  43. package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -1
  44. package/dist/features/bubble/types.d.ts +23 -0
  45. package/dist/features/bubble/types.d.ts.map +1 -1
  46. package/dist/features/full/components/Full.d.ts.map +1 -1
  47. package/dist/features/popup/components/DisclaimerPopup.d.ts +9 -0
  48. package/dist/features/popup/components/DisclaimerPopup.d.ts.map +1 -0
  49. package/dist/features/popup/components/index.d.ts +1 -0
  50. package/dist/features/popup/components/index.d.ts.map +1 -1
  51. package/dist/queries/sendMessageQuery.d.ts +31 -16
  52. package/dist/queries/sendMessageQuery.d.ts.map +1 -1
  53. package/dist/utils/chatInputHistory.d.ts +22 -0
  54. package/dist/utils/chatInputHistory.d.ts.map +1 -0
  55. package/dist/utils/index.d.ts +9 -4
  56. package/dist/utils/index.d.ts.map +1 -1
  57. package/dist/web.d.ts +4 -0
  58. package/dist/web.d.ts.map +1 -1
  59. package/dist/web.js +1 -1
  60. package/dist/window.d.ts +3 -0
  61. package/dist/window.d.ts.map +1 -1
  62. package/images/proxyserver.png +0 -0
  63. package/package.json +15 -6
  64. package/public/index.html +37 -0
  65. package/server.js +402 -0
  66. package/dist/features/bubble/components/ExpandButton.d.ts +0 -18
  67. package/dist/features/bubble/components/ExpandButton.d.ts.map +0 -1
package/.env.example ADDED
@@ -0,0 +1,34 @@
1
+ # ==============================================
2
+ # REQUIRED CONFIGURATION
3
+ # ==============================================
4
+
5
+ # API Host URL (required)
6
+ # This should be the URL where your THub instance is running
7
+ # Example: https://your-thub-instance.com
8
+ API_HOST=
9
+
10
+ # THub API Key (required)
11
+ # Generate this from your THub instance settings page
12
+ # Example: OxxGE-h_LaH7ZYorStjTOik1XY999RxxoHpCSYl8BXxc
13
+ FLOWISE_API_KEY=
14
+
15
+ # ==============================================
16
+ # CHATFLOWS CONFIGURATION (required)
17
+ # ==============================================
18
+
19
+ # Format: [identifier]=[chatflowId],[allowedDomain1],[allowedDomain2],...
20
+ #
21
+ # Each entry consists of:
22
+ # - identifier: Any name you choose (e.g., agent1, support, salesbot)
23
+ # - chatflowId: The UUID of your THub chatflow
24
+ # - allowedDomains: Comma-separated list of domains where this chat can be embedded
25
+ # Note: Wildcard domains (*) are not supported for security reasons
26
+ #
27
+ # Examples:
28
+ # agent1=20db97c6-64c9-4411-bab4-7d6202171600,https://example1.com
29
+ # support=1c28f529-a70f-5001-9bc5-4f4c5d03d8c0,https://example2.com,https://another-example2.com
30
+ # salesbot=3db97c6-64c9-4411-bab4-7d620217160a,https://sales.example.com
31
+
32
+ # Add your chatflows below:
33
+ chatflow_1=
34
+ chatflow_2=
package/README.md CHANGED
@@ -1,151 +1,342 @@
1
- <!-- markdownlint-disable MD030 -->
2
-
3
- # thub Embed
4
-
5
- Javascript library to display thub chatbot on your website
6
-
7
- ![thub](https://github.com/thubAI/thubChatEmbed/blob/main/images/ChatEmbed.gif?raw=true)
8
-
9
- Install:
10
-
11
- ```bash
12
- yarn install
13
- ```
14
-
15
- Dev:
16
-
17
- ```bash
18
- yarn dev
19
- ```
20
-
21
- Build:
22
-
23
- ```bash
24
- yarn build
25
- ```
26
-
27
- ## Embed in your HTML
28
-
29
- ### PopUp
30
-
31
- ```html
32
- <script type="module">
33
- import Chatbot from 'https://cdn.jsdelivr.net/npm/thub-embed/dist/web.js';
34
- Chatbot.init({
35
- chatflowid: '<chatflowid>',
36
- apiHost: 'http://localhost:3000',
37
- });
38
- </script>
39
- ```
40
-
41
- ### FullPage
42
-
43
- ```html
44
- <script type="module">
45
- import Chatbot from './web.js';
46
- Chatbot.initFull({
47
- chatflowid: '<chatflowid>',
48
- apiHost: 'http://localhost:3000',
49
- });
50
- </script>
51
- <thub-fullchatbot></thub-fullchatbot>
52
- ```
53
-
54
- To enable full screen, add `margin: 0` to <code>body</code> style, and confirm you don't set height and width
55
-
56
- ```html
57
- <body style="margin: 0">
58
- <script type="module">
59
- import Chatbot from './web.js';
60
- Chatbot.initFull({
61
- chatflowid: '<chatflowid>',
62
- apiHost: 'http://localhost:3000',
63
- theme: {
64
- chatWindow: {
65
- // height: 700, don't set height
66
- // width: 400, don't set width
67
- },
68
- },
69
- });
70
- </script>
71
- </body>
72
- ```
73
-
74
- ## Configuration
75
-
76
- You can also customize chatbot with different configuration
77
-
78
- ```html
79
- <script type="module">
80
- import Chatbot from 'https://cdn.jsdelivr.net/npm/thub-embed/dist/web.js';
81
- Chatbot.init({
82
- chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f',
83
- apiHost: 'http://localhost:3000',
84
- chatflowConfig: {
85
- // topK: 2
86
- },
87
- observersConfig: {
88
- // (optional) Allows you to execute code in parent based upon signal observations within the chatbot.
89
- // The userinput field submitted to bot ("" when reset by bot)
90
- observeUserInput: (userInput) => {
91
- console.log({ userInput });
92
- },
93
- // The bot message stack has changed
94
- observeMessages: (messages) => {
95
- console.log({ messages });
96
- },
97
- // The bot loading signal changed
98
- observeLoading: (loading) => {
99
- console.log({ loading });
100
- },
101
- },
102
- theme: {
103
- button: {
104
- backgroundColor: '#3B81F6',
105
- right: 20,
106
- bottom: 20,
107
- size: 'medium',
108
- iconColor: 'white',
109
- customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
110
- },
111
- chatWindow: {
112
- showTitle: true, // show/hide the title bar
113
- title: 'thub Bot',
114
- titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
115
- welcomeMessage: 'Hello! This is custom welcome message',
116
- errorMessage: 'This is a custom error message',
117
- backgroundColor: '#ffffff',
118
- height: 700,
119
- width: 400,
120
- fontSize: 16,
121
- poweredByTextColor: '#303235',
122
- botMessage: {
123
- backgroundColor: '#f7f8ff',
124
- textColor: '#303235',
125
- showAvatar: true,
126
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
127
- },
128
- userMessage: {
129
- backgroundColor: '#3B81F6',
130
- textColor: '#ffffff',
131
- showAvatar: true,
132
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
133
- },
134
- textInput: {
135
- placeholder: 'Type your question',
136
- backgroundColor: '#ffffff',
137
- textColor: '#303235',
138
- sendButtonColor: '#3B81F6',
139
- },
140
- feedback: {
141
- color: '#303235',
142
- },
143
- },
144
- },
145
- });
146
- </script>
147
- ```
148
-
149
- ## License
150
-
151
- Source code in this repository is made available under the [MIT License](https://github.com/thubAI/thub/blob/master/LICENSE.md).
1
+ <!-- markdownlint-disable MD030 -->
2
+
3
+ # THub Embed
4
+
5
+ Javascript library to display thub chatbot on your website
6
+
7
+ ![THub](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/ChatEmbed.gif?raw=true)
8
+
9
+ Install:
10
+
11
+ ```bash
12
+ yarn install
13
+ ```
14
+
15
+ Dev:
16
+
17
+ ```bash
18
+ yarn dev
19
+ ```
20
+
21
+ A development server will be running on http://localhost:5678 automatically. Update `public/index.html` to connect directly to THub:
22
+
23
+ ```html
24
+ <!-- public/index.html -->
25
+ <script type="module">
26
+ import Chatbot from 'https://localhost:5678/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
27
+ Chatbot.init({
28
+ chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f', // Add your THub chatflowid
29
+ apiHost: 'https://your-thub-instance.com', // Add your THub apiHost
30
+ });
31
+ </script>
32
+ ```
33
+
34
+ Build:
35
+
36
+ ```bash
37
+ yarn build
38
+ ```
39
+
40
+ ## Embed in your HTML
41
+
42
+ ### PopUp
43
+
44
+ ```html
45
+ <script type="module">
46
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/thub-embed/dist/web.js';
47
+ Chatbot.init({
48
+ chatflowid: '<chatflowid>',
49
+ apiHost: 'http://localhost:3000',
50
+ });
51
+ </script>
52
+ ```
53
+
54
+ ### FullPage
55
+
56
+ ```html
57
+ <script type="module">
58
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/thub-embed/dist/web.js';
59
+ Chatbot.initFull({
60
+ chatflowid: '<chatflowid>',
61
+ apiHost: 'http://localhost:3000',
62
+ });
63
+ </script>
64
+ <thub-fullchatbot></thub-fullchatbot>
65
+ ```
66
+
67
+ To enable full screen, add `margin: 0` to <code>body</code> style, and confirm you don't set height and width
68
+
69
+ ```html
70
+ <body style="margin: 0">
71
+ <script type="module">
72
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/thub-embed/dist/web.js';
73
+ Chatbot.initFull({
74
+ chatflowid: '<chatflowid>',
75
+ apiHost: 'http://localhost:3000',
76
+ theme: {
77
+ chatWindow: {
78
+ // height: 700, don't set height
79
+ // width: 400, don't set width
80
+ },
81
+ },
82
+ });
83
+ </script>
84
+ </body>
85
+ ```
86
+
87
+ ## Configuration
88
+
89
+ You can also customize chatbot with different configuration
90
+
91
+ ```html
92
+ <script type="module">
93
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/thub-embed/dist/web.js';
94
+ Chatbot.init({
95
+ chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f',
96
+ apiHost: 'http://localhost:3000',
97
+ chatflowConfig: {
98
+ // topK: 2
99
+ },
100
+ observersConfig: {
101
+ // (optional) Allows you to execute code in parent based upon signal observations within the chatbot.
102
+ // The userinput field submitted to bot ("" when reset by bot)
103
+ observeUserInput: (userInput) => {
104
+ console.log({ userInput });
105
+ },
106
+ // The bot message stack has changed
107
+ observeMessages: (messages) => {
108
+ console.log({ messages });
109
+ },
110
+ // The bot loading signal changed
111
+ observeLoading: (loading) => {
112
+ console.log({ loading });
113
+ },
114
+ },
115
+ theme: {
116
+ button: {
117
+ backgroundColor: '#3B81F6',
118
+ right: 20,
119
+ bottom: 20,
120
+ size: 48, // small | medium | large | number
121
+ dragAndDrop: true,
122
+ iconColor: 'white',
123
+ customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
124
+ autoWindowOpen: {
125
+ autoOpen: true, //parameter to control automatic window opening
126
+ openDelay: 2, // Optional parameter for delay time in seconds
127
+ autoOpenOnMobile: false, //parameter to control automatic window opening in mobile
128
+ },
129
+ },
130
+ tooltip: {
131
+ showTooltip: true,
132
+ tooltipMessage: 'Hi There 👋!',
133
+ tooltipBackgroundColor: 'black',
134
+ tooltipTextColor: 'white',
135
+ tooltipFontSize: 16,
136
+ },
137
+ disclaimer: {
138
+ title: 'Disclaimer',
139
+ message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
140
+ },
141
+ chatWindow: {
142
+ showTitle: true,
143
+ showAgentMessages: true,
144
+ title: 'THub Bot',
145
+ titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
146
+ welcomeMessage: 'Hello! This is custom welcome message',
147
+ errorMessage: 'This is a custom error message',
148
+ backgroundColor: '#ffffff',
149
+ backgroundImage: 'enter image path or link', // If set, this will overlap the background color of the chat window.
150
+ height: 700,
151
+ width: 400,
152
+ fontSize: 16,
153
+ starterPrompts: ['What is a bot?', 'Who are you?'], // It overrides the starter prompts set by the chat flow passed
154
+ starterPromptFontSize: 15,
155
+ clearChatOnReload: false, // If set to true, the chat will be cleared when the page reloads
156
+ sourceDocsTitle: 'Sources:',
157
+ renderHTML: true,
158
+ botMessage: {
159
+ backgroundColor: '#f7f8ff',
160
+ textColor: '#303235',
161
+ showAvatar: true,
162
+ avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
163
+ },
164
+ userMessage: {
165
+ backgroundColor: '#3B81F6',
166
+ textColor: '#ffffff',
167
+ showAvatar: true,
168
+ avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
169
+ },
170
+ textInput: {
171
+ placeholder: 'Type your question',
172
+ backgroundColor: '#ffffff',
173
+ textColor: '#303235',
174
+ sendButtonColor: '#3B81F6',
175
+ maxChars: 50,
176
+ maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
177
+ autoFocus: true, // If not used, autofocus is disabled on mobile and enabled on desktop. true enables it on both, false disables it on both.
178
+ sendMessageSound: true,
179
+ // sendSoundLocation: "send_message.mp3", // If this is not used, the default sound effect will be played if sendSoundMessage is true.
180
+ receiveMessageSound: true,
181
+ // receiveSoundLocation: "receive_message.mp3", // If this is not used, the default sound effect will be played if receiveSoundMessage is true.
182
+ },
183
+ feedback: {
184
+ color: '#303235',
185
+ },
186
+ dateTimeToggle: {
187
+ date: true,
188
+ time: true,
189
+ },
190
+ footer: {
191
+ textColor: '#303235',
192
+ text: 'Powered by',
193
+ company: 'THub',
194
+ companyLink: 'https://flowiseai.com',
195
+ },
196
+ },
197
+ },
198
+ });
199
+ </script>
200
+ ```
201
+
202
+ ## (Experimental) Proxy Server Setup
203
+
204
+ The THub Embed Proxy Server enhances the security of your chatbot implementation by acting as a protective intermediary layer. This server eliminates the need to expose sensitive THub instance details in your frontend code and provides several key security benefits:
205
+
206
+ ![Proxy Server](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/proxyserver.png?raw=true)
207
+
208
+ - **Enhanced Security**: Conceals your THub API host and chatflow IDs from client-side exposure
209
+ - **Access Control**: Implements strict domain-based restrictions for chatbot embedding
210
+ - **Secure Communication**: Acts as a secure gateway for all interactions between your website and THub instance
211
+ - **Authentication Management**: Handles API key authentication securely on the server side, away from client exposure
212
+
213
+ This proxy server can be deployed to any Node.js hosting platform.
214
+
215
+ ## Quick Start
216
+
217
+ 1. Configure environment:
218
+
219
+ ```bash
220
+ # Copy .env.example to .env and configure required settings:
221
+ API_HOST=https://your-thub-instance.com
222
+ FLOWISE_API_KEY=your-api-key
223
+
224
+ # Configure your chatflows:
225
+ # Format: [identifier]=[chatflowId],[allowedDomain1],[allowedDomain2],...
226
+ #
227
+ # identifier: Any name you choose (e.g., agent1, support, salesbot)
228
+ # chatflowId: The UUID of your THub chatflow
229
+ # allowedDomains: Comma-separated list of domains where this chat can be embedded
230
+ #
231
+ # Examples:
232
+ support=abc123-def456,https://example.com
233
+ agent1=xyz789-uvw456,https://sales.example.com
234
+ helpdesk=ghi123-jkl456,https://help.example.com,https://support.example.com
235
+ ```
236
+
237
+ 2. Install dependencies: (assuming you did not run `yarn install` yet)
238
+
239
+ ```bash
240
+ yarn install
241
+ ```
242
+
243
+ 3. Start proxy server:
244
+
245
+ ```bash
246
+ yarn start
247
+ # Server will be available at:
248
+ # - Local: http://localhost:3001
249
+ # - Cloud: [Your Platform URL] (e.g., https://your-app.herokuapp.com)
250
+ ```
251
+
252
+ 4. Once the proxy server is running in production, you will be able to embed your chatbots safely without exposing your THub API host and chatflow IDs as below:
253
+
254
+ ```html
255
+ <script type="module">
256
+ import Chatbot from 'your-proxy-server-url/web.js'; // Must be 'your-proxy-server-url/web.js'
257
+ Chatbot.init({
258
+ chatflowid: 'your-identifier-here', // Must match an identifier from your .env
259
+ apiHost: 'your-proxy-server-url', // Must match the URL of your proxy server
260
+ chatflowConfig: {
261
+ // ...
262
+ },
263
+ });
264
+ </script>
265
+ ```
266
+
267
+ 5. (optional) If you want to test any identifier in public/index.html, you can update it as below:
268
+
269
+ ```html
270
+ <!-- public/index.html -->
271
+ chatflowid: 'your-identifier-here' // Must match an identifier from your .env
272
+ ```
273
+
274
+ **Important Notes:**
275
+
276
+ - You must specify which websites can embed each chatbot
277
+ - Wildcard domains (\*) are not supported for security reasons
278
+ - Identifiers are case-insensitive (e.g., 'Support' and 'support' are treated the same)
279
+
280
+ ## Cloud Deployment Requirements
281
+
282
+ When deploying to cloud platforms, you must configure the environment variables directly in your platform. The proxy server will not start without these variables being properly set. Compatible with Nixpacks for automatic deployment configuration.
283
+
284
+ ## Development Mode (For Local Testing)
285
+
286
+ 1. Configure your environment variables (see above)
287
+
288
+ 2. Start the proxy server:
289
+
290
+ ```bash
291
+ yarn start
292
+ # Server will be available at:
293
+ # - Local: http://localhost:3001
294
+ ```
295
+
296
+ 3. Update the test page configuration:
297
+
298
+ - Open `public/index.html` in your code editor
299
+ - Modify the `chatflowid` and `apiHost` to match your `.env` settings:
300
+
301
+ ```html
302
+ <!-- public/index.html -->
303
+ <script type="module">
304
+ import Chatbot from './web.js';
305
+ Chatbot.init({
306
+ chatflowid: 'agent1', // Must match an identifier from your .env
307
+ apiHost: 'http://localhost:3001', // Change this from window.location.origin to 'http://localhost:3001'
308
+ });
309
+ </script>
310
+ ```
311
+
312
+ For full page testing, use this configuration instead:
313
+
314
+ ```html
315
+ <!-- public/index.html -->
316
+ <thub-fullchatbot></thub-fullchatbot>
317
+ <script type="module">
318
+ import Chatbot from './web.js';
319
+ Chatbot.initFull({
320
+ chatflowid: 'agent1', // Must match an identifier from your .env
321
+ apiHost: 'http://localhost:3001', // Change this from window.location.origin to 'http://localhost:3001'
322
+ });
323
+ </script>
324
+ ```
325
+
326
+ 4. While the proxy server is running, open a new terminal and start the development server:
327
+
328
+ ```bash
329
+ yarn dev
330
+ # This will serve the test page on http://localhost:5678 automatically
331
+ ```
332
+
333
+ 5. Test the chatbot:
334
+
335
+ - Navigate to http://localhost:5678
336
+ - The chatbot should now be visible and functional
337
+
338
+ **Note:** The development URL (http://localhost:5678) is automatically added to allowed domains in development mode. You don't need to add it manually.
339
+
340
+ ## License
341
+
342
+ Source code in this repository is made available under the [MIT License](https://github.com/FlowiseAI/THub/blob/master/LICENSE.md).
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,cAAc,GAAG,SAAS,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAIF,eAAO,MAAM,KAAK,UAAW,KAAK,mCAgEjC,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,cAAc,GAAG,SAAS,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAIF,eAAO,MAAM,KAAK,UAAW,KAAK,mCA+DjC,CAAC"}
@@ -1,4 +1,6 @@
1
- import { BotMessageTheme, FooterTheme, TextInputTheme, UserMessageTheme, FeedbackTheme } from '@/features/bubble/types';
1
+ import { FeedbackRatingType } from '@/queries/sendMessageQuery';
2
+ import { BotMessageTheme, FooterTheme, TextInputTheme, UserMessageTheme, FeedbackTheme, DisclaimerPopUpTheme, DateTimeToggleTheme } from '@/features/bubble/types';
3
+ import { FilePreview } from '@/components/inputs/textInput/components/FilePreview';
2
4
  export type FileEvent<T = EventTarget> = {
3
5
  target: T;
4
6
  };
@@ -6,14 +8,16 @@ export type FormEvent<T = EventTarget> = {
6
8
  preventDefault: () => void;
7
9
  currentTarget: T;
8
10
  };
9
- type ImageUploadConstraits = {
11
+ type IUploadConstraits = {
10
12
  fileTypes: string[];
11
13
  maxUploadSize: number;
12
14
  };
13
15
  export type UploadsConfig = {
14
- imgUploadSizeAndTypes: ImageUploadConstraits[];
16
+ imgUploadSizeAndTypes: IUploadConstraits[];
17
+ fileUploadSizeAndTypes: IUploadConstraits[];
15
18
  isImageUploadAllowed: boolean;
16
19
  isSpeechToTextEnabled: boolean;
20
+ isRAGFileUploadAllowed: boolean;
17
21
  };
18
22
  type FilePreviewData = string | ArrayBuffer;
19
23
  type FilePreview = {
@@ -28,10 +32,23 @@ export type IAgentReasoning = {
28
32
  agentName?: string;
29
33
  messages?: string[];
30
34
  usedTools?: any[];
35
+ artifacts?: FileUpload[];
31
36
  sourceDocuments?: any[];
32
37
  instructions?: string;
33
38
  nextAgent?: string;
34
39
  };
40
+ export type IAction = {
41
+ id?: string;
42
+ elements?: Array<{
43
+ type: string;
44
+ label: string;
45
+ }>;
46
+ mapping?: {
47
+ approve: string;
48
+ reject: string;
49
+ toolCalls: any[];
50
+ };
51
+ };
35
52
  export type FileUpload = Omit<FilePreview, 'preview'>;
36
53
  export type MessageType = {
37
54
  messageId?: string;
@@ -40,13 +57,21 @@ export type MessageType = {
40
57
  sourceDocuments?: any;
41
58
  fileAnnotations?: any;
42
59
  fileUploads?: Partial<FileUpload>[];
60
+ artifacts?: Partial<FileUpload>[];
43
61
  agentReasoning?: IAgentReasoning[];
62
+ usedTools?: any[];
63
+ action?: IAction | null;
64
+ rating?: FeedbackRatingType;
65
+ id?: string;
66
+ followUpPrompts?: string;
67
+ dateTime?: string;
44
68
  };
45
69
  type observerConfigType = (accessor: string | boolean | object | MessageType[]) => void;
46
70
  export type observersConfigType = Record<'observeUserInput' | 'observeLoading' | 'observeMessages', observerConfigType>;
47
71
  export type BotProps = {
48
72
  chatflowid: string;
49
73
  apiHost?: string;
74
+ onRequest?: (request: RequestInit) => Promise<void>;
50
75
  chatflowConfig?: Record<string, unknown>;
51
76
  welcomeMessage?: string;
52
77
  errorMessage?: string;
@@ -65,7 +90,16 @@ export type BotProps = {
65
90
  fontSize?: number;
66
91
  isFullPage?: boolean;
67
92
  footer?: FooterTheme;
93
+ sourceDocsTitle?: string;
68
94
  observersConfig?: observersConfigType;
95
+ starterPrompts?: string[] | Record<string, {
96
+ prompt: string;
97
+ }>;
98
+ starterPromptFontSize?: number;
99
+ clearChatOnReload?: boolean;
100
+ disclaimer?: DisclaimerPopUpTheme;
101
+ dateTimeToggle?: DateTimeToggleTheme;
102
+ renderHTML?: boolean;
69
103
  };
70
104
  export type LeadsConfig = {
71
105
  status: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Bot.d.ts","sourceRoot":"","sources":["../../src/components/Bot.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAYxH,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,WAAW,IAAI;IACvC,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,WAAW,IAAI;IACvC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,CAAC;CAClB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,qBAAqB,EAAE,qBAAqB,EAAE,CAAC;IAC/C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,KAAK,eAAe,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE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,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAoFF,eAAO,MAAM,GAAG,aAAc,QAAQ,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,mCA42C1D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'solid-js/jsx-runtime';
2
+ type ImageUploadButtonProps = {
3
+ buttonColor?: string;
4
+ isDisabled?: boolean;
5
+ isLoading?: boolean;
6
+ disableIcon?: boolean;
7
+ } & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
8
+ export declare const ImageUploadButton: (props: ImageUploadButtonProps) => JSX.Element;
9
+ export declare const Spinner: (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=ImageUploadButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageUploadButton.d.ts","sourceRoot":"","sources":["../../src/components/ImageUploadButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAG3C,KAAK,sBAAsB,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,GAAG,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEhD,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,gBAiB9D,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,IAAI,gBAAgB,CAAC,aAAa,CAAC,gBAgBjE,CAAC"}