listpage-next 0.0.140 → 0.0.141
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/demos/demo11.js +9 -14
- package/dist/features/ChatClient/components/ChatContent/ClientContentBody.d.ts +2 -2
- package/dist/features/ChatClient/components/ChatContent/ClientContentBody.js +13 -13
- package/dist/features/ChatClient/components/ChatDialog/index.d.ts +1 -0
- package/dist/features/ChatClient/components/ChatDialog/index.js +2 -1
- package/dist/features/ChatClient/components/SuggestMessageList/index.d.ts +10 -0
- package/dist/features/ChatClient/components/SuggestMessageList/index.js +60 -0
- package/dist/features/ChatClient/context/message.js +1 -0
- package/dist/features/ChatClient/index.d.ts +1 -0
- package/dist/features/ChatClient/index.js +1 -0
- package/package.json +1 -1
package/dist/demos/demo11.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
const Demo11 = ()=>/*#__PURE__*/ jsx(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
children: /*#__PURE__*/ jsx(ChatDialog, {
|
|
8
|
-
title: "测试",
|
|
9
|
-
style: {
|
|
10
|
-
width: 500,
|
|
11
|
-
height: 800
|
|
2
|
+
import { SuggestMessageList } from "../features/ChatClient/index.js";
|
|
3
|
+
const Demo11 = ()=>/*#__PURE__*/ jsx(SuggestMessageList, {
|
|
4
|
+
suggests: [
|
|
5
|
+
{
|
|
6
|
+
title: '测试1'
|
|
12
7
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
8
|
+
{
|
|
9
|
+
title: '测试2'
|
|
10
|
+
}
|
|
11
|
+
]
|
|
17
12
|
});
|
|
18
13
|
export { Demo11 };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 极简版对话内容
|
|
3
3
|
*/
|
|
4
|
-
import { BubbleListProps } from
|
|
5
|
-
import { ChatSenderProps } from
|
|
4
|
+
import { BubbleListProps } from './BubbleList';
|
|
5
|
+
import { ChatSenderProps } from '../ChatSender';
|
|
6
6
|
export interface ClientContentBodyProps {
|
|
7
7
|
senderProps?: ChatSenderProps;
|
|
8
8
|
bubbleProps?: BubbleListProps;
|
|
@@ -34,20 +34,20 @@ const SimplifyClientContentBody = (props)=>{
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
const Content = styled.div`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
flex: 1;
|
|
38
|
+
min-height: 0;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
width: 100%;
|
|
42
|
+
box-sizing: border-box;
|
|
43
43
|
`;
|
|
44
44
|
const SenderContainer = styled.div`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
height: 140px;
|
|
46
|
+
padding: 0 calc((100% - 800px) / 2);
|
|
47
|
+
padding-bottom: 20px;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 100%;
|
|
52
52
|
`;
|
|
53
53
|
export { ClientContentBody, SimplifyClientContentBody };
|
|
@@ -3,7 +3,7 @@ import { useRef } from "react";
|
|
|
3
3
|
import { useExtra } from "./useExtra.js";
|
|
4
4
|
import { CardBody, CardExtra, CardHeader, CardTitle, Container } from "./styles.js";
|
|
5
5
|
const ChatDialog = (props)=>{
|
|
6
|
-
const { id, style, children, title } = props;
|
|
6
|
+
const { id, style, children, title, className } = props;
|
|
7
7
|
const containerRef = useRef(null);
|
|
8
8
|
const extra = useExtra({
|
|
9
9
|
containerRef,
|
|
@@ -17,6 +17,7 @@ const ChatDialog = (props)=>{
|
|
|
17
17
|
children: [
|
|
18
18
|
/*#__PURE__*/ jsxs(CardHeader, {
|
|
19
19
|
id: id,
|
|
20
|
+
className: className,
|
|
20
21
|
children: [
|
|
21
22
|
/*#__PURE__*/ jsx(CardTitle, {
|
|
22
23
|
children: title
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type SuggestData = {
|
|
3
|
+
title: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
};
|
|
6
|
+
export interface SuggestMessageListProps {
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
suggests: SuggestData[];
|
|
9
|
+
}
|
|
10
|
+
export declare const SuggestMessageList: (props: SuggestMessageListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled_components from "styled-components";
|
|
3
|
+
import { ArrowRightOutlined } from "@ant-design/icons";
|
|
4
|
+
const SuggestMessageList = (props)=>{
|
|
5
|
+
const { suggests, style } = props;
|
|
6
|
+
return /*#__PURE__*/ jsx(SuggestMessageContainer, {
|
|
7
|
+
style: style,
|
|
8
|
+
children: suggests.map((item, index)=>/*#__PURE__*/ jsxs(SuggestMessageItemContainer, {
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ jsx(SuggestMessageText, {
|
|
11
|
+
children: item.title
|
|
12
|
+
}),
|
|
13
|
+
/*#__PURE__*/ jsx(ArrowRightOutlined, {
|
|
14
|
+
style: {
|
|
15
|
+
fontSize: 12
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
]
|
|
19
|
+
}, index))
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const SuggestMessageContainer = styled_components.div`
|
|
23
|
+
gap: 8px;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
`;
|
|
28
|
+
const SuggestMessageItemContainer = styled_components.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
padding: 10px;
|
|
33
|
+
border-bottom: 1px solid #eee;
|
|
34
|
+
background: #0000000a;
|
|
35
|
+
border-radius: 12px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
height: fit-content;
|
|
39
|
+
padding: 9px 10px 9px 16px;
|
|
40
|
+
user-select: none;
|
|
41
|
+
width: fit-content;
|
|
42
|
+
border: none;
|
|
43
|
+
gap: 2px;
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
background: #0000000f;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:active {
|
|
50
|
+
background: #0000001a;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const SuggestMessageText = styled_components.span`
|
|
54
|
+
flex-shrink: 1;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
line-height: 20px;
|
|
58
|
+
color: #000000b3;
|
|
59
|
+
`;
|
|
60
|
+
export { SuggestMessageList };
|
|
@@ -5,6 +5,7 @@ export * from './components/Bubble';
|
|
|
5
5
|
export * from './components/Reasoning';
|
|
6
6
|
export { SimplifyChatPage, type SimplifyChatPageProps, } from './components/ChatPage/SimplifyChatPage';
|
|
7
7
|
export * from './components/ChatDialog';
|
|
8
|
+
export * from './components/SuggestMessageList';
|
|
8
9
|
export { useChatContext } from './context/useChatContext';
|
|
9
10
|
export * from './context/types';
|
|
10
11
|
export * from './utils/parseSse';
|
|
@@ -6,6 +6,7 @@ export * from "./components/ChatContent/index.js";
|
|
|
6
6
|
export * from "./components/Bubble/index.js";
|
|
7
7
|
export * from "./components/Reasoning/index.js";
|
|
8
8
|
export * from "./components/ChatDialog/index.js";
|
|
9
|
+
export * from "./components/SuggestMessageList/index.js";
|
|
9
10
|
export * from "./context/types.js";
|
|
10
11
|
export * from "./utils/parseSse.js";
|
|
11
12
|
export { SimplifyChatPage, useChatContext };
|