listpage-next 0.0.157 → 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.
@@ -55,7 +55,6 @@ const BubbleContainer = styled_components.div`
55
55
  display: flex;
56
56
  flex-direction: column;
57
57
  gap: 20px;
58
- margin-top: 12px;
59
58
  align-items: ${(props)=>'start' === props.placement ? 'flex-start' : 'flex-end'};
60
59
  `;
61
60
  const UserContentWrapper = styled_components.div`
@@ -1,7 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
2
  export interface BubbleListProps {
3
3
  styles?: {
4
- topPlaceholder?: CSSProperties;
5
4
  bottomPlaceholder?: CSSProperties;
6
5
  content?: CSSProperties;
7
6
  };
@@ -28,11 +28,6 @@ const BubbleList = (props)=>{
28
28
  return /*#__PURE__*/ jsxs(ContentContainer, {
29
29
  ref: containerRef,
30
30
  children: [
31
- /*#__PURE__*/ jsx("div", {
32
- style: styles?.topPlaceholder ?? {
33
- height: 20
34
- }
35
- }),
36
31
  /*#__PURE__*/ jsx("div", {
37
32
  style: styles?.content,
38
33
  children: (ctx.messages ?? []).map((msg)=>render.renderMessage(msg, ctx))
@@ -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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.157",
3
+ "version": "0.0.159",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",