@ray-js/t-agent-ui-ray 0.1.0-beta-12 → 0.1.0-beta-14

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.
@@ -10,6 +10,16 @@ interface Props {
10
10
  assistant?: 'start' | 'end' | string;
11
11
  [key: string]: 'start' | 'end' | string;
12
12
  };
13
+ historyLimit?: {
14
+ /** 历史消息数量限制 */
15
+ count: number;
16
+ /** 超过限制时显示的提示文本 */
17
+ tipText: string;
18
+ /** 提示文本的样式 */
19
+ tipStyle?: React.CSSProperties;
20
+ /** 提示文本的类名 */
21
+ tipClassName?: string;
22
+ };
13
23
  }
14
24
  export default function MessageList(props: Props): React.JSX.Element;
15
25
  export {};
@@ -19,7 +19,8 @@ export default function MessageList(props) {
19
19
  roleSide,
20
20
  style,
21
21
  wrapperClassName,
22
- wrapperStyle
22
+ wrapperStyle,
23
+ historyLimit
23
24
  } = props;
24
25
  const {
25
26
  messages
@@ -107,7 +108,10 @@ export default function MessageList(props) {
107
108
  isLatestMessage: index === 0,
108
109
  side: side
109
110
  });
110
- }), /*#__PURE__*/React.createElement(View, {
111
+ }), historyLimit && historyLimit.count < reversed.length && /*#__PURE__*/React.createElement(View, {
112
+ className: "t-agent-message-list-history-tip ".concat(historyLimit.tipClassName || ''),
113
+ style: historyLimit.tipStyle
114
+ }, historyLimit.tipText), /*#__PURE__*/React.createElement(View, {
111
115
  className: "t-agent-message-list-padding-start"
112
116
  })));
113
117
  }
@@ -19,3 +19,12 @@
19
19
  }
20
20
 
21
21
  .t-agent-message-list-padding-start {}
22
+
23
+ .t-agent-message-list-history-tip {
24
+ width: 100%;
25
+ text-align: center;
26
+ padding: 20rpx 0;
27
+ font-size: 24rpx;
28
+ color: var(--app-F3, #999);
29
+ background-color: var(--app-B1);
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/t-agent-ui-ray",
3
- "version": "0.1.0-beta-12",
3
+ "version": "0.1.0-beta-14",
4
4
  "author": "Tuya.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -41,5 +41,5 @@
41
41
  "@types/echarts": "^4.9.22",
42
42
  "@types/markdown-it": "^14.1.1"
43
43
  },
44
- "gitHead": "34434bfc256e79bdb1c33ef9f55fb705704264f6"
44
+ "gitHead": "c6d168aa2aeb47de7dade3251dcddda23bbbd950"
45
45
  }