listpage-next 0.0.223 → 0.0.225
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/ChatPage/SimplifyChatPage.d.ts +1 -0
- package/dist/features/ChatClient/components/ChatPage/SimplifyChatPage.js +5 -1
- package/dist/features/ChatClient/ui/Bubble/Markdown.js +55 -0
- package/dist/features/ChatClient/ui/ConversationDropdownMenu/index.js +18 -11
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export interface SimplifyChatPageProps<SessionData = any, MessageInfo extends Ba
|
|
|
9
9
|
chatRef?: RefObject<ChatInstance>;
|
|
10
10
|
request: ChatRequest<SessionData, MessageInfo>;
|
|
11
11
|
render: ChatRender<MessageInfo>;
|
|
12
|
+
loading?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const SimplifyChatPageComponent: <T = any>(props: SimplifyChatPageProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export declare const SimplifyChatPage: <T = any>(props: SimplifyChatPageProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { useImperativeHandle } from "react";
|
|
|
3
3
|
import { ChatClientProvider, MessageProvider } from "../../context/index.js";
|
|
4
4
|
import { useChatContext } from "../../context/useChatContext.js";
|
|
5
5
|
import { SimplifyClientContentBody } from "../ChatContent/ClientContentBody.js";
|
|
6
|
+
import { PageLoading } from "../../../../components/index.js";
|
|
6
7
|
const SimplifyChatPageComponent = (props)=>{
|
|
7
8
|
const { chatRef, senderProps } = props;
|
|
8
9
|
const context = useChatContext();
|
|
@@ -14,7 +15,9 @@ const SimplifyChatPageComponent = (props)=>{
|
|
|
14
15
|
style: props.style
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
|
-
const SimplifyChatPage = (props)
|
|
18
|
+
const SimplifyChatPage = (props)=>{
|
|
19
|
+
if (props.loading) return /*#__PURE__*/ jsx(PageLoading, {});
|
|
20
|
+
return /*#__PURE__*/ jsx(ChatClientProvider, {
|
|
18
21
|
request: props.request,
|
|
19
22
|
render: props.render,
|
|
20
23
|
children: /*#__PURE__*/ jsx(MessageProvider, {
|
|
@@ -25,4 +28,5 @@ const SimplifyChatPage = (props)=>/*#__PURE__*/ jsx(ChatClientProvider, {
|
|
|
25
28
|
})
|
|
26
29
|
})
|
|
27
30
|
});
|
|
31
|
+
};
|
|
28
32
|
export { SimplifyChatPage, SimplifyChatPageComponent };
|
|
@@ -212,5 +212,60 @@ const MarkdownBody = styled_components.div`
|
|
|
212
212
|
margin: 16px 0;
|
|
213
213
|
background: linear-gradient(to right, #e5e7eb, #cbd5e1, #e5e7eb);
|
|
214
214
|
}
|
|
215
|
+
|
|
216
|
+
placeholder[type='pending'] {
|
|
217
|
+
display: inline-block;
|
|
218
|
+
vertical-align: text-bottom;
|
|
219
|
+
width: 28px;
|
|
220
|
+
height: 100%;
|
|
221
|
+
position: relative;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
placeholder[type='pending']::after {
|
|
225
|
+
content: '';
|
|
226
|
+
display: inline-block;
|
|
227
|
+
width: 8px;
|
|
228
|
+
height: 8px;
|
|
229
|
+
border-radius: 50%;
|
|
230
|
+
background: rgba(0, 0, 0, 0.6);
|
|
231
|
+
box-shadow:
|
|
232
|
+
0 0 0 0 rgba(0, 0, 0, 0.6),
|
|
233
|
+
10px 0 0 0 rgba(0, 0, 0, 0.6),
|
|
234
|
+
20px 0 0 0 rgba(0, 0, 0, 0.6);
|
|
235
|
+
transform-origin: center;
|
|
236
|
+
will-change: transform, box-shadow, background;
|
|
237
|
+
animation: dotRolling 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@keyframes dotRolling {
|
|
241
|
+
0% {
|
|
242
|
+
background: rgba(0, 0, 0, 0.85);
|
|
243
|
+
box-shadow:
|
|
244
|
+
0 0 0 0 rgba(0, 0, 0, 0.85),
|
|
245
|
+
10px 0 0 0 rgba(0, 0, 0, 0.55),
|
|
246
|
+
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
247
|
+
}
|
|
248
|
+
33% {
|
|
249
|
+
background: rgba(0, 0, 0, 0.55);
|
|
250
|
+
box-shadow:
|
|
251
|
+
0 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
252
|
+
10px 0 0 2px rgba(0, 0, 0, 0.85),
|
|
253
|
+
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
254
|
+
}
|
|
255
|
+
66% {
|
|
256
|
+
background: rgba(0, 0, 0, 0.55);
|
|
257
|
+
box-shadow:
|
|
258
|
+
0 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
259
|
+
10px 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
260
|
+
20px 0 0 2px rgba(0, 0, 0, 0.85);
|
|
261
|
+
}
|
|
262
|
+
100% {
|
|
263
|
+
background: rgba(0, 0, 0, 0.85);
|
|
264
|
+
box-shadow:
|
|
265
|
+
0 0 0 0 rgba(0, 0, 0, 0.85),
|
|
266
|
+
10px 0 0 0 rgba(0, 0, 0, 0.55),
|
|
267
|
+
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
215
270
|
`;
|
|
216
271
|
export { Markdown };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { HistoryOutlined } from "@ant-design/icons";
|
|
3
|
+
import { PageLoading } from "../../../../components/index.js";
|
|
3
4
|
import { useRequest } from "ahooks";
|
|
4
5
|
import { Button, Dropdown, Tooltip } from "antd";
|
|
6
|
+
import styled_components from "styled-components";
|
|
5
7
|
const ConversationDropdownMenu = (props)=>{
|
|
6
8
|
const { request, onSelect, activeKey } = props;
|
|
7
|
-
const { data, run: refresh } = useRequest(()=>request(), {
|
|
9
|
+
const { data, run: refresh, loading } = useRequest(()=>request(), {
|
|
8
10
|
manual: true
|
|
9
11
|
});
|
|
10
12
|
const menus = [
|
|
@@ -29,18 +31,15 @@ const ConversationDropdownMenu = (props)=>{
|
|
|
29
31
|
],
|
|
30
32
|
menu: {
|
|
31
33
|
items: menus,
|
|
32
|
-
activeKey
|
|
34
|
+
activeKey
|
|
33
35
|
},
|
|
34
36
|
popupRender: (originNode)=>{
|
|
35
|
-
if (!data?.list?.length)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
children: "暂无历史会话"
|
|
43
|
-
});
|
|
37
|
+
if (loading || !data?.list?.length) {
|
|
38
|
+
const content = loading ? /*#__PURE__*/ jsx(PageLoading, {}) : '暂无历史会话';
|
|
39
|
+
return /*#__PURE__*/ jsx(DefaultPanelContainer, {
|
|
40
|
+
children: content
|
|
41
|
+
});
|
|
42
|
+
}
|
|
44
43
|
return originNode;
|
|
45
44
|
},
|
|
46
45
|
children: /*#__PURE__*/ jsx(Button, {
|
|
@@ -53,4 +52,12 @@ const ConversationDropdownMenu = (props)=>{
|
|
|
53
52
|
})
|
|
54
53
|
});
|
|
55
54
|
};
|
|
55
|
+
const DefaultPanelContainer = styled_components.div`
|
|
56
|
+
padding: 12px 24px;
|
|
57
|
+
background: '#eee';
|
|
58
|
+
color: '#000';
|
|
59
|
+
border-radius: 8px;
|
|
60
|
+
min-height: 100px;
|
|
61
|
+
min-width: 200px;
|
|
62
|
+
`;
|
|
56
63
|
export { ConversationDropdownMenu };
|