listpage-next 0.0.158 → 0.0.159
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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ChatSplitterProps {
|
|
3
|
+
left: {
|
|
4
|
+
title?: string;
|
|
5
|
+
extra?: ReactNode;
|
|
6
|
+
body: ReactNode;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
};
|
|
9
|
+
right: {
|
|
10
|
+
title?: string;
|
|
11
|
+
extra?: ReactNode;
|
|
12
|
+
body: ReactNode;
|
|
13
|
+
visible: boolean;
|
|
14
|
+
};
|
|
15
|
+
size?: {
|
|
16
|
+
default?: string;
|
|
17
|
+
min?: string;
|
|
18
|
+
max?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const ChatSplitter: (props: ChatSplitterProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, Splitter } from "antd";
|
|
3
|
+
import styled_components from "styled-components";
|
|
4
|
+
const ChatSplitter = (props)=>{
|
|
5
|
+
const { left, right, size } = props;
|
|
6
|
+
const defaultSize = size?.default || '70%';
|
|
7
|
+
const maxSize = size?.max || '80%';
|
|
8
|
+
const minSize = size?.min || '60%';
|
|
9
|
+
if (!right.visible) return left.body;
|
|
10
|
+
return /*#__PURE__*/ jsxs(StyledSplitter, {
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx(Splitter.Panel, {
|
|
13
|
+
size: defaultSize,
|
|
14
|
+
min: minSize,
|
|
15
|
+
max: maxSize,
|
|
16
|
+
style: panelStyle,
|
|
17
|
+
children: /*#__PURE__*/ jsx(Card, {
|
|
18
|
+
styles: {
|
|
19
|
+
body: cardBodyStyle,
|
|
20
|
+
header: cardHeaderStyle
|
|
21
|
+
},
|
|
22
|
+
style: cardStyle,
|
|
23
|
+
size: "small",
|
|
24
|
+
title: left.title,
|
|
25
|
+
extra: left.extra,
|
|
26
|
+
children: left.body
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ jsx(Splitter.Panel, {
|
|
30
|
+
style: panelStyle,
|
|
31
|
+
children: /*#__PURE__*/ jsx(Card, {
|
|
32
|
+
styles: {
|
|
33
|
+
body: cardBodyStyle,
|
|
34
|
+
header: cardHeaderStyle
|
|
35
|
+
},
|
|
36
|
+
style: cardStyle,
|
|
37
|
+
size: "small",
|
|
38
|
+
title: right.title,
|
|
39
|
+
extra: right.extra,
|
|
40
|
+
children: right.body
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const StyledSplitter = styled_components(Splitter)`
|
|
47
|
+
height: 100%;
|
|
48
|
+
background: rgb(240, 240, 240);
|
|
49
|
+
|
|
50
|
+
.ant-splitter-bar-dragger::before {
|
|
51
|
+
background: transparent !important;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const cardStyle = {
|
|
55
|
+
height: '100%'
|
|
56
|
+
};
|
|
57
|
+
const cardBodyStyle = {
|
|
58
|
+
height: 'calc(100% - 38px)',
|
|
59
|
+
overflow: 'auto'
|
|
60
|
+
};
|
|
61
|
+
const cardHeaderStyle = {
|
|
62
|
+
background: 'rgba(0, 0, 0, 0.02)'
|
|
63
|
+
};
|
|
64
|
+
const panelStyle = {
|
|
65
|
+
padding: 4
|
|
66
|
+
};
|
|
67
|
+
export { ChatSplitter };
|
|
@@ -4,6 +4,7 @@ export * from './components/ChatContent';
|
|
|
4
4
|
export * from './components/Bubble';
|
|
5
5
|
export { SimplifyChatPage, type SimplifyChatPageProps, } from './components/ChatPage/SimplifyChatPage';
|
|
6
6
|
export * from './components/ChatDialog';
|
|
7
|
+
export * from './components/ChatSplitter';
|
|
7
8
|
export { useChatContext } from './context/useChatContext';
|
|
8
9
|
export * from './context/types';
|
|
9
10
|
export * from './utils/parseSse';
|
|
@@ -5,6 +5,7 @@ export * from "./components/ChatGuidance/index.js";
|
|
|
5
5
|
export * from "./components/ChatContent/index.js";
|
|
6
6
|
export * from "./components/Bubble/index.js";
|
|
7
7
|
export * from "./components/ChatDialog/index.js";
|
|
8
|
+
export * from "./components/ChatSplitter/index.js";
|
|
8
9
|
export * from "./context/types.js";
|
|
9
10
|
export * from "./utils/parseSse.js";
|
|
10
11
|
export { SimplifyChatPage, useChatContext };
|