listpage-next 0.0.146 → 0.0.148
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/dist/features/ChatClient/components/Bubble/ReferenceList.d.ts +1 -0
- package/dist/features/ChatClient/components/Bubble/ReferenceList.js +24 -11
- package/dist/features/ChatClient/context/types.d.ts +1 -0
- package/dist/features/ChatClient/context/useChatContext.d.ts +2 -0
- package/dist/features/ChatClient/context/useChatContext.js +3 -1
- package/package.json +1 -1
|
@@ -68,19 +68,21 @@ const ReferenceList = (props)=>{
|
|
|
68
68
|
}),
|
|
69
69
|
/*#__PURE__*/ jsxs(ReferenceFooter, {
|
|
70
70
|
children: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
/*#__PURE__*/ jsx(FooterIcon, {
|
|
72
|
+
children: item.icon ? /*#__PURE__*/ jsx(Avatar, {
|
|
73
|
+
size: 16,
|
|
74
|
+
src: item.icon
|
|
75
|
+
}) : /*#__PURE__*/ jsx(Avatar, {
|
|
76
|
+
size: 16,
|
|
77
|
+
icon: /*#__PURE__*/ jsx(ApiOutlined, {
|
|
78
|
+
style: {
|
|
79
|
+
fontSize: 16
|
|
80
|
+
}
|
|
81
|
+
})
|
|
80
82
|
})
|
|
81
83
|
}),
|
|
82
84
|
/*#__PURE__*/ jsx(FooterTitle, {
|
|
83
|
-
children: item.url
|
|
85
|
+
children: item.source || item.url
|
|
84
86
|
}),
|
|
85
87
|
/*#__PURE__*/ jsx(ReferenceIndex, {
|
|
86
88
|
children: index + 1
|
|
@@ -147,15 +149,26 @@ const ReferenceFooter = styled_components.div`
|
|
|
147
149
|
gap: 6px;
|
|
148
150
|
margin-top: 2px;
|
|
149
151
|
`;
|
|
152
|
+
const FooterIcon = styled_components(Avatar)`
|
|
153
|
+
width: 16px;
|
|
154
|
+
height: 16px;
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
`;
|
|
150
157
|
const FooterTitle = styled_components.span`
|
|
151
158
|
color: rgba(0, 0, 0, 0.55);
|
|
152
|
-
flex: 1 1;
|
|
153
159
|
font-size: 14px;
|
|
154
160
|
|
|
155
161
|
height: 22px;
|
|
156
162
|
line-height: 22px;
|
|
163
|
+
min-width: 0;
|
|
164
|
+
flex-grow: 1;
|
|
165
|
+
flex-shrink: 1;
|
|
166
|
+
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
text-overflow: ellipsis;
|
|
157
169
|
`;
|
|
158
170
|
const ReferenceIndex = styled_components.span`
|
|
171
|
+
flex-shrink: 0;
|
|
159
172
|
border-radius: 8px;
|
|
160
173
|
display: inline-block;
|
|
161
174
|
font-size: 11px;
|
|
@@ -17,3 +17,4 @@ export type SendMessageRequest<MessageInfo extends BaseMessageInfo = any> = (inf
|
|
|
17
17
|
onSuccess: (id: string, info: MessageInfo) => void;
|
|
18
18
|
onError: (id: string, info: MessageInfo) => void;
|
|
19
19
|
}, messages: MessageInfo[]) => Promise<void>;
|
|
20
|
+
export type { MessageContextValue } from './message';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare function useChatContext(): {
|
|
2
2
|
messages: import("./types").Message<any>[];
|
|
3
3
|
sendMessage: (info: any, callback?: ((info: any) => void) | undefined) => void;
|
|
4
|
+
appendMessage: (info: any) => void;
|
|
5
|
+
setMessages: (messages: import("./types").Message<any>[]) => void;
|
|
4
6
|
deleteConversation: ((key: string) => void) | undefined;
|
|
5
7
|
updateConversation: ((key: string, item: any) => void) | undefined;
|
|
6
8
|
scrollToBottom: () => void;
|
|
@@ -2,11 +2,13 @@ import { useChatClientContext } from "./client.js";
|
|
|
2
2
|
import { useMessageContext } from "./message.js";
|
|
3
3
|
function useChatContext() {
|
|
4
4
|
const { conversationAction, bubbleListRef } = useChatClientContext();
|
|
5
|
-
const { messages, sendMessage } = useMessageContext();
|
|
5
|
+
const { messages, sendMessage, appendMessage, setMessages } = useMessageContext();
|
|
6
6
|
const { deleteItem, updateItem } = conversationAction ?? {};
|
|
7
7
|
return {
|
|
8
8
|
messages,
|
|
9
9
|
sendMessage,
|
|
10
|
+
appendMessage,
|
|
11
|
+
setMessages,
|
|
10
12
|
deleteConversation: deleteItem,
|
|
11
13
|
updateConversation: updateItem,
|
|
12
14
|
scrollToBottom: ()=>bubbleListRef.current?.scrollToBottom()
|