blixify-ui-web-mcp 0.1.3 → 0.1.19
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/lib/components/action/button/README.md +12 -11
- package/lib/components/action/button/button.stories.tsx +38 -27
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +82 -16
- package/lib/components/action/iconButton/README.md +1 -0
- package/lib/components/action/iconButton/iconButton.stories.tsx +6 -12
- package/lib/components/action/radioList/radioList.stories.tsx +10 -16
- package/lib/components/action/slider/slider.stories.tsx +9 -15
- package/lib/components/action/textButton/textButton.stories.tsx +6 -12
- package/lib/components/action/toggle/toggle.stories.tsx +6 -12
- package/lib/components/advanced/collapse/collapse.stories.tsx +240 -24
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +10 -16
- package/lib/components/advanced/popUp/README.md +33 -7
- package/lib/components/advanced/popUp/popUp.stories.tsx +9 -15
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +36 -16
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +7 -13
- package/lib/components/auth/signIn/signIn.stories.tsx +4 -10
- package/lib/components/auth/signUp/signUp.stories.tsx +4 -10
- package/lib/components/chart/areaChart/areaChart.stories.tsx +12 -18
- package/lib/components/chart/barChart/barChart.stories.tsx +12 -18
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +11 -17
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +11 -17
- package/lib/components/chart/card/card.stories.tsx +172 -38
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +10 -16
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +11 -17
- package/lib/components/chart/lineChart/lineChart.stories.tsx +8 -14
- package/lib/components/chart/pieChart/pieChart.stories.tsx +11 -17
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +11 -17
- package/lib/components/chart/radarChart/radarChart.stories.tsx +6 -12
- package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +8 -14
- package/lib/components/chart/statsCard/statsCard.stories.tsx +12 -18
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +11 -17
- package/lib/components/chat/chatAnchor/README.md +7 -0
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +15 -21
- package/lib/components/chat/chatBase/README.md +103 -22
- package/lib/components/chat/chatBase/chatBase.stories.tsx +657 -57
- package/lib/components/chat/chatDashboard/README.md +17 -15
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +358 -46
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +8 -14
- package/lib/components/data/dataReference/dataReference.stories.tsx +9 -15
- package/lib/components/data/dataTemplate/README.md +443 -129
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +10 -15
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +20 -34
- package/lib/components/data/dataWrapper/README.md +207 -84
- package/lib/components/data/dataWrapper/dataWrapper.consumer.stories.tsx +2125 -0
- package/lib/components/data/dataWrapper/dataWrapper.edit.stories.tsx +607 -0
- package/lib/components/data/dataWrapper/dataWrapper.utils.stories.tsx +576 -0
- package/lib/components/data/dataWrapper/dataWrapper.view.stories.tsx +1273 -0
- package/lib/components/data/flexFilter/flexFilter.stories.tsx +171 -0
- package/lib/components/data/queryForm/queryForm.stories.tsx +6 -12
- package/lib/components/data/readQuery/readQuery.stories.tsx +6 -11
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +6 -12
- package/lib/components/data/writeQuery/README.md +21 -10
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +6 -10
- package/lib/components/design/actionSection/actionSection.stories.tsx +10 -14
- package/lib/components/design/banner/banner.stories.tsx +6 -12
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +100 -21
- package/lib/components/design/blogSection/blogSection.stories.tsx +6 -12
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +6 -12
- package/lib/components/design/designList/designList.stories.tsx +6 -12
- package/lib/components/design/faq/faq.stories.tsx +53 -31
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +10 -16
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +6 -12
- package/lib/components/design/footerSection/footerSection.stories.tsx +6 -12
- package/lib/components/design/googleReview/googleReview.stories.tsx +6 -12
- package/lib/components/design/heroSection/heroSection.stories.tsx +10 -16
- package/lib/components/design/iconList/iconList.stories.tsx +6 -12
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +6 -12
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +6 -12
- package/lib/components/design/leftContent/leftContent.stories.tsx +6 -12
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +6 -12
- package/lib/components/design/onboarding/onboarding.stories.tsx +8 -14
- package/lib/components/design/pricing/pricing.stories.tsx +6 -12
- package/lib/components/design/rightContent/rightContent.stories.tsx +6 -12
- package/lib/components/design/sectionList/sectionList.stories.tsx +6 -12
- package/lib/components/design/teams/teams.stories.tsx +6 -12
- package/lib/components/display/alert/alert.stories.tsx +8 -14
- package/lib/components/display/calendar/README.md +49 -0
- package/lib/components/display/calendar/calendar.stories.tsx +78 -35
- package/lib/components/display/clipboard/clipboard.stories.tsx +6 -12
- package/lib/components/display/detailList/detailList.stories.tsx +172 -48
- package/lib/components/display/drawer/README.md +44 -11
- package/lib/components/display/drawer/drawer.stories.tsx +71 -16
- package/lib/components/display/emptyState/emptyState.stories.tsx +47 -15
- package/lib/components/display/feeds/feeds.stories.tsx +6 -12
- package/lib/components/display/flexTable/README.md +11 -7
- package/lib/components/display/flexTable/flexTable.stories.tsx +318 -20
- package/lib/components/display/grid/README.md +29 -30
- package/lib/components/display/grid/grid.stories.tsx +16 -23
- package/lib/components/display/kanban/kanban.stories.tsx +17 -23
- package/lib/components/display/list/README.md +30 -29
- package/lib/components/display/list/list.stories.tsx +11 -17
- package/lib/components/display/loading/loading.stories.tsx +7 -12
- package/lib/components/display/mapView/mapView.stories.tsx +9 -15
- package/lib/components/display/modal/modal.stories.tsx +6 -13
- package/lib/components/display/newCalendar/README.md +163 -0
- package/lib/components/display/newCalendar/newCalendar.stories.tsx +292 -0
- package/lib/components/display/newFeeds/README.md +53 -0
- package/lib/components/display/newFeeds/newFeeds.stories.tsx +104 -0
- package/lib/components/display/newKanban/README.md +25 -0
- package/lib/components/display/newKanban/newKanban.stories.tsx +131 -0
- package/lib/components/display/newList/README.md +30 -0
- package/lib/components/display/newList/newList.stories.tsx +231 -0
- package/lib/components/display/newPagination/README.md +15 -0
- package/lib/components/display/newTable/README.md +121 -0
- package/lib/components/display/newTable/newTable.stories.tsx +551 -0
- package/lib/components/display/notification/notification.stories.tsx +6 -12
- package/lib/components/display/progress/progress.stories.tsx +7 -12
- package/lib/components/display/stepper/README.md +4 -0
- package/lib/components/display/stepper/stepper.stories.tsx +70 -23
- package/lib/components/display/table/README.md +38 -37
- package/lib/components/display/table/table.stories.tsx +34 -36
- package/lib/components/display/tag/tag.stories.tsx +34 -40
- package/lib/components/input/address/address.stories.tsx +12 -18
- package/lib/components/input/canvas/canvas.stories.tsx +12 -18
- package/lib/components/input/checkbox/checkbox.stories.tsx +7 -13
- package/lib/components/input/datePicker/datePicker.stories.tsx +41 -11
- package/lib/components/input/form/form.stories.tsx +11 -17
- package/lib/components/input/markdown/README.md +80 -2
- package/lib/components/input/markdown/markdown.stories.tsx +83 -32
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +52 -24
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +6 -12
- package/lib/components/input/rating/rating.stories.tsx +6 -12
- package/lib/components/input/select/README.md +31 -29
- package/lib/components/input/select/select.stories.tsx +33 -39
- package/lib/components/input/signature/signature.stories.tsx +12 -18
- package/lib/components/input/textArea/textArea.stories.tsx +6 -12
- package/lib/components/input/textInput/textinput.stories.tsx +14 -20
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +143 -19
- package/lib/components/navigation/bars/README.md +27 -0
- package/lib/components/navigation/bars/bars.stories.tsx +56 -19
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +7 -12
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +8 -14
- package/lib/components/navigation/header/header.stories.tsx +33 -21
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +10 -16
- package/lib/components/navigation/tabs/tabs.stories.tsx +10 -16
- package/lib/components/structure/column/column.stories.tsx +10 -15
- package/lib/components/structure/container/container.stories.tsx +8 -13
- package/lib/components/structure/link/link.stories.tsx +11 -17
- package/lib/components/structure/text/text.stories.tsx +12 -17
- package/lib/components/template/authPage/authPage.stories.tsx +6 -5
- package/lib/components/template/calendarView/calendarView.stories.tsx +726 -0
- package/lib/components/template/chatDashboard/chatDashboard.stories.tsx +497 -0
- package/lib/components/template/landingPage/landingPage.stories.tsx +10 -7
- package/lib/components/template/mapLayout/mapLayout.stories.tsx +519 -0
- package/lib/components/template/productListing/productListing.stories.tsx +7 -13
- package/lib/components/template/productOverview/productOverview.stories.tsx +5 -11
- package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +6 -12
- package/lib/components/template/userHomePage/userHomePage.stories.tsx +384 -524
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +145 -75
- package/lib/mcp/tools/componentsRoot.d.ts +2 -0
- package/lib/mcp/tools/componentsRoot.d.ts.map +1 -0
- package/lib/mcp/tools/componentsRoot.js +59 -0
- package/lib/mcp/tools/componentsRoot.js.map +1 -0
- package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getBackendComponent.js +2 -5
- package/lib/mcp/tools/getBackendComponent.js.map +1 -1
- package/lib/mcp/tools/getComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getComponent.js +2 -5
- package/lib/mcp/tools/getComponent.js.map +1 -1
- package/lib/mcp/tools/listComponents.d.ts.map +1 -1
- package/lib/mcp/tools/listComponents.js +15 -10
- package/lib/mcp/tools/listComponents.js.map +1 -1
- package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -1
- package/lib/mcp/tools/suggestTemplate.js +107 -21
- package/lib/mcp/tools/suggestTemplate.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +0 -831
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
A floating chat button fixed to the viewport. Clicking it toggles the `ChatBase` panel open/closed with an animated transition. On mobile (< 640px) the chat panel expands to full screen when open.
|
|
8
8
|
|
|
9
|
+
The button can be dragged out of the way on desktop and touch, and where it is dropped is kept in `localStorage` so it stays there on the next visit. A short drag is still treated as a click, so tapping always opens the chat. A saved position is clamped back into view when it is restored on a smaller screen or the window is resized under it, and dragging is disabled while the panel is full screen on mobile.
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| -------------------- | --------- | -------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
13
|
+
| `draggable` | `boolean` | `true` | Set `false` to pin the button to `positionOffset` and ignore any saved position |
|
|
14
|
+
| `positionStorageKey` | `string` | `"blixify-chat-anchor-position"` | `localStorage` key holding `{ right, bottom }` in px, measured from the bottom-right corner |
|
|
15
|
+
|
|
9
16
|
##### Import
|
|
10
17
|
|
|
11
18
|
```js
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import moment from "moment";
|
|
1
|
+
import dayjs from "../../dayjs";
|
|
3
2
|
import React, { useState } from "react";
|
|
4
|
-
import { ChatAnchor } from ".";
|
|
3
|
+
import { ChatAnchor as ChatAnchorImpl } from ".";
|
|
5
4
|
import Logo from "../../../assets/logo.png";
|
|
6
5
|
import { Conversation } from "../chatBase";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Chat/Chat Anchor" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
export const ChatAnchor = () => {
|
|
18
12
|
const botUser = {
|
|
19
13
|
id: "1",
|
|
20
14
|
name: "Bot",
|
|
@@ -36,14 +30,14 @@ stories.add("Chat Anchor", () => {
|
|
|
36
30
|
{
|
|
37
31
|
sender: botUser,
|
|
38
32
|
messageBody: "Hi! How can I help you? 🤖",
|
|
39
|
-
createdAt:
|
|
33
|
+
createdAt: dayjs(
|
|
40
34
|
"Fri Nov 03 2023 12:21:14 GMT+0800 (Malaysia Time)"
|
|
41
35
|
).toDate(),
|
|
42
36
|
},
|
|
43
37
|
{
|
|
44
38
|
sender: currentUser,
|
|
45
39
|
messageBody: "Yo, my computer's acting up.",
|
|
46
|
-
createdAt:
|
|
40
|
+
createdAt: dayjs(
|
|
47
41
|
"Fri Nov 03 2023 13:21:14 GMT+0800 (Malaysia Time)"
|
|
48
42
|
).toDate(),
|
|
49
43
|
},
|
|
@@ -51,7 +45,7 @@ stories.add("Chat Anchor", () => {
|
|
|
51
45
|
sender: currentUser,
|
|
52
46
|
messageBody:
|
|
53
47
|
"It keeps saying 'Error 404: Coffee not found' when I start it up.",
|
|
54
|
-
createdAt:
|
|
48
|
+
createdAt: dayjs(
|
|
55
49
|
"Fri Nov 03 2023 14:21:14 GMT+0800 (Malaysia Time)"
|
|
56
50
|
).toDate(),
|
|
57
51
|
},
|
|
@@ -59,14 +53,14 @@ stories.add("Chat Anchor", () => {
|
|
|
59
53
|
sender: botUser,
|
|
60
54
|
messageBody:
|
|
61
55
|
"Sounds like a caffeine emergency! Have you tried offering it coffee?",
|
|
62
|
-
createdAt:
|
|
56
|
+
createdAt: dayjs(
|
|
63
57
|
"Fri Nov 03 2023 15:21:14 GMT+0800 (Malaysia Time)"
|
|
64
58
|
).toDate(),
|
|
65
59
|
},
|
|
66
60
|
{
|
|
67
61
|
sender: currentUser,
|
|
68
62
|
messageBody: "Seriously?",
|
|
69
|
-
createdAt:
|
|
63
|
+
createdAt: dayjs(
|
|
70
64
|
"Fri Nov 03 2023 16:21:14 GMT+0800 (Malaysia Time)"
|
|
71
65
|
).toDate(),
|
|
72
66
|
},
|
|
@@ -74,14 +68,14 @@ stories.add("Chat Anchor", () => {
|
|
|
74
68
|
sender: botUser,
|
|
75
69
|
messageBody:
|
|
76
70
|
"Well, computers do like a jolt of energy, but don't spill, that could be 'mocha-nical' trouble!",
|
|
77
|
-
createdAt:
|
|
71
|
+
createdAt: dayjs(
|
|
78
72
|
"Fri Nov 03 2023 17:21:14 GMT+0800 (Malaysia Time)"
|
|
79
73
|
).toDate(),
|
|
80
74
|
},
|
|
81
75
|
{
|
|
82
76
|
sender: currentUser,
|
|
83
77
|
messageBody: "Cringe. I'll give it a shot. Thanks.",
|
|
84
|
-
createdAt:
|
|
78
|
+
createdAt: dayjs(
|
|
85
79
|
"Fri Nov 03 2023 18:21:14 GMT+0800 (Malaysia Time)"
|
|
86
80
|
).toDate(),
|
|
87
81
|
},
|
|
@@ -89,7 +83,7 @@ stories.add("Chat Anchor", () => {
|
|
|
89
83
|
sender: botUser,
|
|
90
84
|
messageBody:
|
|
91
85
|
"Anytime! If it demands a donut, that's on me. Have a brew-tiful day!",
|
|
92
|
-
createdAt:
|
|
86
|
+
createdAt: dayjs(
|
|
93
87
|
"Fri Nov 03 2023 19:21:14 GMT+0800 (Malaysia Time)"
|
|
94
88
|
).toDate(),
|
|
95
89
|
},
|
|
@@ -133,7 +127,7 @@ stories.add("Chat Anchor", () => {
|
|
|
133
127
|
|
|
134
128
|
return (
|
|
135
129
|
<div className="h-96 w-full relative">
|
|
136
|
-
<
|
|
130
|
+
<ChatAnchorImpl
|
|
137
131
|
open={openChatBase}
|
|
138
132
|
value={message}
|
|
139
133
|
currentUser={currentUser}
|
|
@@ -153,4 +147,4 @@ stories.add("Chat Anchor", () => {
|
|
|
153
147
|
/>
|
|
154
148
|
</div>
|
|
155
149
|
);
|
|
156
|
-
}
|
|
150
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<hr>
|
|
6
6
|
|
|
7
|
-
A chat window component with message bubbles, markdown rendering for received messages, message search, file upload (
|
|
7
|
+
A chat window component with message bubbles, markdown rendering for received messages, message search, file upload (images, videos, PDFs, and other documents), a loading reply indicator, tool report logs, tool call chips, and customisable header/footer/body slots.
|
|
8
8
|
|
|
9
9
|
##### Import
|
|
10
10
|
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
ChatBase,
|
|
14
14
|
Conversation,
|
|
15
15
|
Message,
|
|
16
|
+
ToolReport,
|
|
17
|
+
ToolCall,
|
|
16
18
|
User,
|
|
17
19
|
} from "blixify-ui-web/components/chat/chatBase";
|
|
18
20
|
```
|
|
@@ -80,9 +82,9 @@ With file upload:
|
|
|
80
82
|
fileUpload={{
|
|
81
83
|
allowFileUpload: true,
|
|
82
84
|
file,
|
|
83
|
-
acceptFileType: ".jpg,.jpeg,.png,.mp4,.webm",
|
|
85
|
+
acceptFileType: ".jpg,.jpeg,.png,.mp4,.webm,.pdf,.docx",
|
|
84
86
|
onChangeUpload: (e) => setFile(e.target.files[0]),
|
|
85
|
-
onSendUpload: (conversation) => { /*
|
|
87
|
+
onSendUpload: (conversation, file) => { /* handle upload */ },
|
|
86
88
|
}}
|
|
87
89
|
onSendMessage={...}
|
|
88
90
|
onChangeMessage={...}
|
|
@@ -103,6 +105,43 @@ With loading reply indicator:
|
|
|
103
105
|
/>
|
|
104
106
|
```
|
|
105
107
|
|
|
108
|
+
With tool report (shows model + tool call status above an assistant message):
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
const assistantMessage: Message = {
|
|
112
|
+
sender: botUser,
|
|
113
|
+
messageBody: "Your order is out for delivery.",
|
|
114
|
+
createdAt: new Date(),
|
|
115
|
+
toolReport: {
|
|
116
|
+
model: "gemini-2.0-flash",
|
|
117
|
+
tools: [
|
|
118
|
+
{ content: "search_orders", request: {}, response: {}, status: "done" },
|
|
119
|
+
{
|
|
120
|
+
content: "fetch_delivery_status",
|
|
121
|
+
request: {},
|
|
122
|
+
response: {},
|
|
123
|
+
status: "done",
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Status dot colours: `"pending"` → yellow pulsing, `"done"` → green, `"error"` → red.
|
|
131
|
+
|
|
132
|
+
With tool call chips (for AI pipelines that log tool invocations as separate messages):
|
|
133
|
+
|
|
134
|
+
```jsx
|
|
135
|
+
// Messages where author === "tool" should set isToolCall: true.
|
|
136
|
+
// They render as a small centred chip instead of a chat bubble.
|
|
137
|
+
const toolCallMessage: Message = {
|
|
138
|
+
sender: botUser,
|
|
139
|
+
messageBody: "fetch_policy_details",
|
|
140
|
+
createdAt: new Date(),
|
|
141
|
+
isToolCall: true,
|
|
142
|
+
};
|
|
143
|
+
```
|
|
144
|
+
|
|
106
145
|
##### Required props
|
|
107
146
|
|
|
108
147
|
| Name | Type | Description |
|
|
@@ -130,6 +169,7 @@ With loading reply indicator:
|
|
|
130
169
|
| `sizeClassName` | `string` | `h-full w-full sm:h-[75vh] sm:w-96` | Tailwind classes controlling the component dimensions |
|
|
131
170
|
| `className` | `string` | — | Additional Tailwind classes applied to the outer container |
|
|
132
171
|
| `paddingTop` | `number` | `0` | Top padding in pixels. Used to offset the actions menu in mobile app layouts. |
|
|
172
|
+
| `inputActions` | `ReactElement[]` | — | Extra icon buttons rendered in the input row between the paperclip and the send button |
|
|
133
173
|
| `onSendMessage` | `(conversation: Conversation) => void` | — | Called with the updated conversation (including the new message) when send is triggered |
|
|
134
174
|
| `onChangeMessage` | `(event: any) => void` | — | Called on every keystroke in the message input |
|
|
135
175
|
| `onSearch` | `(searchMessage: string) => void` | — | Called when the search form is submitted |
|
|
@@ -139,14 +179,22 @@ With loading reply indicator:
|
|
|
139
179
|
|
|
140
180
|
##### FileUpload
|
|
141
181
|
|
|
142
|
-
| Name | Type
|
|
143
|
-
| ----------------- |
|
|
144
|
-
| `allowFileUpload` | `boolean`
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `acceptFileType` | `string`
|
|
148
|
-
| `onChangeUpload` | `(event: any) => void`
|
|
149
|
-
|
|
182
|
+
| Name | Type | Description |
|
|
183
|
+
| ----------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
184
|
+
| `allowFileUpload` | `boolean` | Shows the paperclip button to trigger file selection |
|
|
185
|
+
| `hasFiles` | `boolean` | Tells the component files are selected — shows the send button and triggers `onSendMessage` on send |
|
|
186
|
+
| `multiple` | `boolean` | Allows picking multiple files at once |
|
|
187
|
+
| `acceptFileType` | `string` | Comma-separated accepted extensions, e.g. `".jpg,.png,.mp4,.pdf,.docx"`. Defaults to images only if omitted. |
|
|
188
|
+
| `onChangeUpload` | `(event: any) => void` | Called when files are selected via the file input. Consumer extracts files from `event.target.files` and manages their own `File[]` state |
|
|
189
|
+
|
|
190
|
+
##### File rendering in message bubbles
|
|
191
|
+
|
|
192
|
+
| File type | Behaviour |
|
|
193
|
+
| ----------------- | ---------------------------------------------------------------------------------------------------- |
|
|
194
|
+
| `image/*` | Renders as an inline image. Click to open a full-size preview modal. Hover to download. |
|
|
195
|
+
| `video/*` | Renders as an inline video player. Hover to download. |
|
|
196
|
+
| `application/pdf` | Renders as a document icon + filename. Click to open a PDF preview modal. Download link shown below. |
|
|
197
|
+
| Other | Renders as a document icon + filename with a "Cannot preview" label. Download link shown below. |
|
|
150
198
|
|
|
151
199
|
##### ChatBaseAction
|
|
152
200
|
|
|
@@ -166,12 +214,45 @@ With loading reply indicator:
|
|
|
166
214
|
|
|
167
215
|
##### Message
|
|
168
216
|
|
|
169
|
-
| Name | Type | Description
|
|
170
|
-
| -------------- | ------------------- |
|
|
171
|
-
| `sender` | `User` | The user who sent the message
|
|
172
|
-
| `messageBody` | `string \| FileObj` | Text content (supports markdown for received messages) or a `FileObj` for image
|
|
173
|
-
| `reactElement` | `ReactElement` | Optional — replaces `messageBody` rendering with a custom element
|
|
174
|
-
| `createdAt` | `Date` | Timestamp shown below the message bubble
|
|
217
|
+
| Name | Type | Description |
|
|
218
|
+
| -------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
219
|
+
| `sender` | `User` | The user who sent the message |
|
|
220
|
+
| `messageBody` | `string \| FileObj` | Text content (supports markdown for received messages) or a `FileObj` for image, video, PDF, or document messages |
|
|
221
|
+
| `reactElement` | `ReactElement` | Optional — replaces `messageBody` rendering with a custom element |
|
|
222
|
+
| `createdAt` | `Date` | Timestamp shown below the message bubble |
|
|
223
|
+
| `toolReport` | `ToolReport` | Optional — renders a compact tool log panel above the message body (see ToolReport below) |
|
|
224
|
+
| `isToolCall` | `boolean` | Optional — renders the message as a centred chip instead of a chat bubble (see Tool Calls) |
|
|
225
|
+
|
|
226
|
+
##### ToolReport
|
|
227
|
+
|
|
228
|
+
Attach to an assistant `Message` to show which model and tools were used to produce the reply.
|
|
229
|
+
|
|
230
|
+
| Name | Type | Description |
|
|
231
|
+
| ------- | ------------ | ------------------------------------ |
|
|
232
|
+
| `model` | `string` | Optional model name shown at the top |
|
|
233
|
+
| `tools` | `ToolCall[]` | List of tool calls and their status |
|
|
234
|
+
|
|
235
|
+
##### ToolCall
|
|
236
|
+
|
|
237
|
+
| Name | Type | Description |
|
|
238
|
+
| ---------- | -------------------------------- | -------------------------------------------------------------------------------- |
|
|
239
|
+
| `content` | `string` | Tool name displayed in the summary row |
|
|
240
|
+
| `request` | `string \| any` | Request payload — shown in the expandable details panel |
|
|
241
|
+
| `response` | `any` | Response payload — shown in the expandable details panel |
|
|
242
|
+
| `status` | `"pending" \| "done" \| "error"` | Dot colour: yellow pulsing (pending), green (done), red (error). Default pending |
|
|
243
|
+
|
|
244
|
+
##### Tool Calls
|
|
245
|
+
|
|
246
|
+
When an AI pipeline stores tool invocations as separate messages (e.g. `author: "tool"` in a database), set `isToolCall: true` on those messages. They render as small centred chips between conversation bubbles — visually distinct from user/assistant messages.
|
|
247
|
+
|
|
248
|
+
```jsx
|
|
249
|
+
const messages = chatList.map((chat) => ({
|
|
250
|
+
sender: chat.author === "assistant" ? botUser : userObj,
|
|
251
|
+
messageBody: chat.content,
|
|
252
|
+
createdAt: new Date(chat.createdAt),
|
|
253
|
+
isToolCall: chat.author === "tool",
|
|
254
|
+
}));
|
|
255
|
+
```
|
|
175
256
|
|
|
176
257
|
##### User
|
|
177
258
|
|
|
@@ -183,8 +264,8 @@ With loading reply indicator:
|
|
|
183
264
|
|
|
184
265
|
##### FileObj
|
|
185
266
|
|
|
186
|
-
| Name | Type | Description
|
|
187
|
-
| ---------- | -------- |
|
|
188
|
-
| `fileName` | `string` | File URL or path
|
|
189
|
-
| `token` | `string` | Unique file token
|
|
190
|
-
| `type` | `string` | MIME type, e.g. `"image/png"
|
|
267
|
+
| Name | Type | Description |
|
|
268
|
+
| ---------- | -------- | ----------------------------------------------------------------- |
|
|
269
|
+
| `fileName` | `string` | File URL or path |
|
|
270
|
+
| `token` | `string` | Unique file token — also used as the display name in the bubble |
|
|
271
|
+
| `type` | `string` | MIME type, e.g. `"image/png"`, `"video/mp4"`, `"application/pdf"` |
|