@agentscope-ai/chat 1.1.45-beta.1766042199498 → 1.1.45-beta.1766386435551

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.
@@ -2,7 +2,7 @@ import { SparkCopyLine, SparkReplaceLine } from "@agentscope-ai/icons";
2
2
  import { IAgentScopeRuntimeResponse } from "../types";
3
3
  import AgentScopeRuntimeResponseBuilder from "./Builder";
4
4
  import { Bubble } from "@agentscope-ai/chat";
5
- import { copy } from "@agentscope-ai/design";
5
+ import { copy, Tooltip } from "@agentscope-ai/design";
6
6
  import compact from 'lodash/compact';
7
7
  import { emit } from "../../Context/useChatAnywhereEventEmitter";
8
8
  import { useChatAnywhereOptions } from "../../Context/ChatAnywhereOptionsContext";
@@ -47,7 +47,7 @@ export default function Tools(props: {
47
47
  }
48
48
  }),
49
49
  props.isLast ? {
50
- icon: <SparkReplaceLine />,
50
+ icon: <Tooltip title="重新生成"><SparkReplaceLine /></Tooltip>,
51
51
  onClick: () => {
52
52
  emit({
53
53
  type: 'handleReplace',
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
2
- import { UploadFile } from 'antd';
2
+ import { Flex, Popover, UploadFile } from 'antd';
3
3
  import { useProviderContext, ChatInput, uuid, Sender, Attachments } from '@agentscope-ai/chat';
4
4
  import cls from 'classnames';
5
5
  import { useChatAnywhere } from '../hooks/ChatAnywhereProvider';
@@ -31,7 +31,7 @@ export default forwardRef(function (_, ref) {
31
31
  useEffect(() => {
32
32
  attachedFilesRef.current = attachedFiles;
33
33
  }, [attachedFiles]);
34
-
34
+
35
35
  const uiConfig = useChatAnywhere(v => v.uiConfig);
36
36
  const { getPrefixCls } = useProviderContext();
37
37
  const prefixCls = getPrefixCls('chat-anywhere-sender');
@@ -85,8 +85,11 @@ export default forwardRef(function (_, ref) {
85
85
  })
86
86
  }
87
87
 
88
- const prefixNodes = onInput.variant !== 'aigc' && onUpload?.length ?
89
- onUpload.map((item, index) => {
88
+ const uploadPrefixNodes = useMemo(() => {
89
+ if (onInput.variant === 'aigc' || !onUpload?.length) {
90
+ return [];
91
+ }
92
+ const nodes = onUpload.map((item, index) => {
90
93
  return <Upload
91
94
  {...item}
92
95
  fileList={attachedFiles[index]}
@@ -102,12 +105,26 @@ export default forwardRef(function (_, ref) {
102
105
  }}
103
106
  showUploadList={false}
104
107
  >
105
- <IconButton
106
- icon={item.icon}
107
- bordered={false}
108
- />
108
+ {
109
+ item.trigger || <IconButton
110
+ icon={item.icon}
111
+ bordered={false}
112
+ />
113
+ }
109
114
  </Upload>
110
- }) : [];
115
+ });
116
+
117
+ if (nodes.length === 1) return nodes;
118
+ return <Popover content={nodes} trigger="click">
119
+ <Flex vertical>
120
+ {nodes}
121
+ </Flex>
122
+ </Popover>
123
+
124
+
125
+ }, [onInput.variant, onUpload, attachedFiles]);
126
+
127
+
111
128
 
112
129
 
113
130
  // aigc 模式下的 header
@@ -162,7 +179,7 @@ export default forwardRef(function (_, ref) {
162
179
  if (trimmed.startsWith('.')) {
163
180
  return fileName.toLowerCase().endsWith(trimmed.toLowerCase());
164
181
  }
165
-
182
+
166
183
  // Wildcard: image/*, */*
167
184
  if (trimmed.includes('*')) {
168
185
  if (trimmed === '*/*') return true;
@@ -170,7 +187,7 @@ export default forwardRef(function (_, ref) {
170
187
  const [fileMain] = fileType.split('/');
171
188
  return acceptMain === fileMain;
172
189
  }
173
-
190
+
174
191
  // Exact: image/jpeg
175
192
  return fileType === trimmed;
176
193
  });
@@ -225,7 +242,7 @@ export default forwardRef(function (_, ref) {
225
242
  const getExtension = () => {
226
243
  const nameMatch = fileName.match(/\.([^.]+)$/);
227
244
  if (nameMatch) return nameMatch[1].toLowerCase();
228
-
245
+
229
246
  const typeMatch = fileType.match(/\/([^/+]+)/);
230
247
  return typeMatch ? typeMatch[1].toLowerCase() : 'bin';
231
248
  };
@@ -257,7 +274,7 @@ export default forwardRef(function (_, ref) {
257
274
  setAttachedFiles(prev => {
258
275
  const updated = [...prev];
259
276
  const currentList = updated[uploadIndex] || [];
260
-
277
+
261
278
  // If not multiple, replace existing files
262
279
  if (!uploadConfig.multiple) {
263
280
  updated[uploadIndex] = [uploadFile];
@@ -296,11 +313,11 @@ export default forwardRef(function (_, ref) {
296
313
  updateFile({ percent: event.percent });
297
314
  },
298
315
  } as any, {
299
- defaultRequest: () => {}
316
+ defaultRequest: () => { }
300
317
  });
301
318
  }
302
319
  };
303
-
320
+
304
321
  // 检查是否有必需的上传项没有文件
305
322
  const requiredFileMissing = useMemo(() => {
306
323
  return onUpload?.some((item, index) => {
@@ -311,7 +328,7 @@ export default forwardRef(function (_, ref) {
311
328
  return false;
312
329
  }) ?? false;
313
330
  }, [onUpload, attachedFiles]);
314
-
331
+
315
332
  const sendDisabled = requiredFileMissing;
316
333
 
317
334
  return <>
@@ -340,7 +357,7 @@ export default forwardRef(function (_, ref) {
340
357
  scalable={onInput?.zoomable}
341
358
  header={senderHeader}
342
359
  prefix={<>
343
- {prefixNodes}
360
+ {uploadPrefixNodes}
344
361
  {onInput?.morePrefixActions}
345
362
  </>}
346
363
  onSubmit={async () => {
@@ -234,6 +234,7 @@ export interface IChatAnywhereConfigOnUpload {
234
234
  * @descriptionEn Description for the upload component
235
235
  */
236
236
  description?: string | React.ReactElement;
237
+ trigger?: React.ReactElement;
237
238
  }
238
239
 
239
240
  export interface IChatAnywhereConfig {
@@ -0,0 +1,7 @@
1
+ export default function Iframe() {
2
+ return <iframe srcDoc={`<html>
3
+ <body>
4
+ <h1>Hello, world!</h1>
5
+ </body>
6
+ </html>`} />
7
+ }
@@ -0,0 +1 @@
1
+ export { default as Sandbox } from './Sandbox';
@@ -3,7 +3,7 @@ import { Empty, IconButton, Tag } from '@agentscope-ai/design';
3
3
  import { SparkBookLine, SparkDownLine, SparkUpLine, SparkWarningCircleFill } from '@agentscope-ai/icons';
4
4
  import { ConfigProvider, Flex, Image } from 'antd';
5
5
  import { Locale } from "antd/es/locale";
6
- import { useState } from 'react';
6
+ import { ReactNode, useState } from 'react';
7
7
 
8
8
  export interface IRagProps {
9
9
  /**
@@ -41,7 +41,7 @@ export interface IRagProps {
41
41
  * @default []
42
42
  */
43
43
  list: {
44
- score?: number | string;
44
+ score?: number | string | ReactNode;
45
45
  title: string;
46
46
  content: string;
47
47
  footer: string;
@@ -94,7 +94,7 @@ function Item({ item }) {
94
94
  </span>
95
95
  <span style={{ flex: 1 }}></span>
96
96
  {
97
- item.score && <Tag color="blue">{item.score}</Tag>
97
+ item.score || null
98
98
  }
99
99
 
100
100
  <IconButton
@@ -106,7 +106,7 @@ function Item({ item }) {
106
106
  </div>
107
107
  {
108
108
  open && <div className={`${prefixCls}-rag-item-content`}>
109
- <div>{item.content}</div>
109
+ <div className={`${prefixCls}-rag-item-content-text`}>{item.content}</div>
110
110
 
111
111
  {
112
112
  item.images &&
@@ -261,6 +261,11 @@ export default createGlobalStyle`
261
261
  padding: 8px;
262
262
  border-radius: 6px;
263
263
  background-color: ${(p) => p.theme.colorFillTertiary};
264
+
265
+ &-text {
266
+ font-size: 12px;
267
+ line-height: 20px;
268
+ }
264
269
  }
265
270
 
266
271
  &-images {
@@ -85,4 +85,6 @@ export {
85
85
  type MarkdownProps,
86
86
  } from './Markdown';
87
87
 
88
- export { default as AIGC } from './AIGC';
88
+ export { default as AIGC } from './AIGC';
89
+
90
+ export { Sandbox as GenerativeUISandbox } from './GenerativeUI';
@@ -13,7 +13,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
13
13
  import { SparkCopyLine, SparkReplaceLine } from "@agentscope-ai/icons";
14
14
  import AgentScopeRuntimeResponseBuilder from "./Builder";
15
15
  import { Bubble } from "../../../..";
16
- import { copy } from "@agentscope-ai/design";
16
+ import { copy, Tooltip } from "@agentscope-ai/design";
17
17
  import compact from 'lodash/compact';
18
18
  import { emit } from "../../Context/useChatAnywhereEventEmitter";
19
19
  import { useChatAnywhereOptions } from "../../Context/ChatAnywhereOptionsContext";
@@ -50,7 +50,10 @@ export default function Tools(props) {
50
50
  }
51
51
  });
52
52
  })), [props.isLast ? {
53
- icon: /*#__PURE__*/_jsx(SparkReplaceLine, {}),
53
+ icon: /*#__PURE__*/_jsx(Tooltip, {
54
+ title: "\u91CD\u65B0\u751F\u6210",
55
+ children: /*#__PURE__*/_jsx(SparkReplaceLine, {})
56
+ }),
54
57
  onClick: function onClick() {
55
58
  emit({
56
59
  type: 'handleReplace',
@@ -18,6 +18,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
18
18
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
  import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
21
+ import { Flex, Popover } from 'antd';
21
22
  import { useProviderContext, ChatInput, Sender, Attachments } from "../..";
22
23
  import cls from 'classnames';
23
24
  import { useChatAnywhere } from "../hooks/ChatAnywhereProvider";
@@ -123,24 +124,38 @@ export default /*#__PURE__*/forwardRef(function (_, ref) {
123
124
  return _ref.apply(this, arguments);
124
125
  };
125
126
  }();
126
- var prefixNodes = onInput.variant !== 'aigc' && onUpload !== null && onUpload !== void 0 && onUpload.length ? onUpload.map(function (item, index) {
127
- return /*#__PURE__*/_createElement(Upload, _objectSpread(_objectSpread({}, item), {}, {
128
- fileList: attachedFiles[index],
129
- key: index,
130
- onChange: function onChange(info) {
131
- if (item.beforeUpload && info.file.status) {
132
- handleFileChange(index, info.fileList);
133
- }
134
- if (!item.beforeUpload) {
135
- handleFileChange(index, info.fileList);
136
- }
137
- },
138
- showUploadList: false
139
- }), /*#__PURE__*/_jsx(IconButton, {
140
- icon: item.icon,
141
- bordered: false
142
- }));
143
- }) : [];
127
+ var uploadPrefixNodes = useMemo(function () {
128
+ if (onInput.variant === 'aigc' || !(onUpload !== null && onUpload !== void 0 && onUpload.length)) {
129
+ return [];
130
+ }
131
+ var nodes = onUpload.map(function (item, index) {
132
+ return /*#__PURE__*/_createElement(Upload, _objectSpread(_objectSpread({}, item), {}, {
133
+ fileList: attachedFiles[index],
134
+ key: index,
135
+ onChange: function onChange(info) {
136
+ if (item.beforeUpload && info.file.status) {
137
+ handleFileChange(index, info.fileList);
138
+ }
139
+ if (!item.beforeUpload) {
140
+ handleFileChange(index, info.fileList);
141
+ }
142
+ },
143
+ showUploadList: false
144
+ }), item.trigger || /*#__PURE__*/_jsx(IconButton, {
145
+ icon: item.icon,
146
+ bordered: false
147
+ }));
148
+ });
149
+ if (nodes.length === 1) return nodes;
150
+ return /*#__PURE__*/_jsx(Popover, {
151
+ content: nodes,
152
+ trigger: "click",
153
+ children: /*#__PURE__*/_jsx(Flex, {
154
+ vertical: true,
155
+ children: nodes
156
+ })
157
+ });
158
+ }, [onInput.variant, onUpload, attachedFiles]);
144
159
 
145
160
  // aigc 模式下的 header
146
161
  var aigcSenderHeader = /*#__PURE__*/_jsx(AIGC.SenderHeader, {
@@ -377,7 +392,7 @@ export default /*#__PURE__*/forwardRef(function (_, ref) {
377
392
  scalable: onInput === null || onInput === void 0 ? void 0 : onInput.zoomable,
378
393
  header: senderHeader,
379
394
  prefix: /*#__PURE__*/_jsxs(_Fragment, {
380
- children: [prefixNodes, onInput === null || onInput === void 0 ? void 0 : onInput.morePrefixActions]
395
+ children: [uploadPrefixNodes, onInput === null || onInput === void 0 ? void 0 : onInput.morePrefixActions]
381
396
  }),
382
397
  onSubmit: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
383
398
  var next;
@@ -231,6 +231,7 @@ export interface IChatAnywhereConfigOnUpload {
231
231
  * @descriptionEn Description for the upload component
232
232
  */
233
233
  description?: string | React.ReactElement;
234
+ trigger?: React.ReactElement;
234
235
  }
235
236
  export interface IChatAnywhereConfig {
236
237
  /**
@@ -0,0 +1 @@
1
+ export default function Iframe(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function Iframe() {
3
+ return /*#__PURE__*/_jsx("iframe", {
4
+ srcDoc: "<html>\n <body>\n <h1>Hello, world!</h1>\n </body>\n </html>"
5
+ });
6
+ }
@@ -0,0 +1 @@
1
+ export { default as Sandbox } from './Sandbox';
@@ -0,0 +1 @@
1
+ export { default as Sandbox } from "./Sandbox";
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface IRagProps {
2
3
  /**
3
4
  * @description 标题
@@ -34,7 +35,7 @@ export interface IRagProps {
34
35
  * @default []
35
36
  */
36
37
  list: {
37
- score?: number | string;
38
+ score?: number | string | ReactNode;
38
39
  title: string;
39
40
  content: string;
40
41
  footer: string;
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { OperateCard, useProviderContext } from "../..";
8
- import { IconButton, Tag } from '@agentscope-ai/design';
8
+ import { IconButton } from '@agentscope-ai/design';
9
9
  import { SparkBookLine, SparkDownLine, SparkUpLine, SparkWarningCircleFill } from '@agentscope-ai/icons';
10
10
  import { ConfigProvider, Flex, Image } from 'antd';
11
11
  import { useState } from 'react';
@@ -56,10 +56,7 @@ function Item(_ref2) {
56
56
  style: {
57
57
  flex: 1
58
58
  }
59
- }), item.score && /*#__PURE__*/_jsx(Tag, {
60
- color: "blue",
61
- children: item.score
62
- }), /*#__PURE__*/_jsx(IconButton, {
59
+ }), item.score || null, /*#__PURE__*/_jsx(IconButton, {
63
60
  bordered: false,
64
61
  size: "small",
65
62
  icon: open ? /*#__PURE__*/_jsx(SparkUpLine, {}) : /*#__PURE__*/_jsx(SparkDownLine, {})
@@ -67,6 +64,7 @@ function Item(_ref2) {
67
64
  }), open && /*#__PURE__*/_jsxs("div", {
68
65
  className: "".concat(prefixCls, "-rag-item-content"),
69
66
  children: [/*#__PURE__*/_jsx("div", {
67
+ className: "".concat(prefixCls, "-rag-item-content-text"),
70
68
  children: item.content
71
69
  }), item.images && /*#__PURE__*/_jsx("div", {
72
70
  className: "".concat(prefixCls, "-rag-item-images"),
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import { createGlobalStyle } from 'antd-style';
4
- export default createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-operate-card {\n width: 100%;\n border-radius: ", "px;\n overflow: hidden;\n background-color: ", ";\n\n &-header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n height: 32px;\n\n &-icon {\n font-size: 16px;\n }\n\n &-title {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n font-weight: 500;\n color: ", ";\n }\n\n &-description {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n color: ", ";\n }\n\n &-arrow {\n margin: 0 0 0 auto;\n }\n\n &-has-body {\n cursor: pointer;\n }\n }\n\n &-body {\n opacity: 0;\n animation: ", "-operate-card-body-open 0.2s ease-in-out forwards;\n \n @keyframes ", "-operate-card-body-open {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n \n }\n\n\n &-line-body {\n margin: 0 12px 12px 20px;\n border-left: 1px solid ", ";\n }\n\n &-thinking {\n padding-left: 16px;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n opacity: 0.85;\n white-space: pre-wrap;\n }\n\n\n &-todo-list {\n\n &-item {\n height: 32px;\n display: flex;\n align-items: center;\n padding: 0 12px;\n gap: 8px;\n \n color: ", ";\n\n\n &-done {\n color: ", ";\n }\n\n &-icon {\n font-size: 16px;\n }\n\n &-title {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n font-size: 12px;\n }\n\n &-done {\n \n }\n\n }\n \n }\n\n\n &-web-search-item {\n display: flex;\n height: 32px;\n align-items: center;\n padding: 0 12px;\n gap: 8px;\n color: ", ";\n cursor: pointer;\n\n &-icon {\n display: block;\n width: 16px;\n height: 16px;\n border: 1px solid ", ";\n border-radius: 99px;\n }\n\n &-title {\n font-size: 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n\n &:hover {\n color: ", ";\n \n }\n\n }\n\n &-subTitle {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-left: 1px solid ", ";\n font-size: 12px;\n line-height: 1;\n color: ", ";\n padding-left: 8px;\n margin-left: 4px;\n }\n\n }\n\n\n &-tool-call-block {\n margin-left: 16px;\n margin-top: 8px;\n\n \n &-title {\n font-size: 12px;\n color: ", ";\n line-height: 20px;\n margin-bottom: 4px;\n }\n\n }\n\n\n\n &-device-action {\n height: auto;\n align-items: flex-start;\n\n &-icon {\n margin-top: 6px;\n }\n\n &-time {\n margin-bottom: 4px;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n }\n\n &-content {\n \n width: 100%;\n display: flex;\n justify-content: space-between;\n }\n\n &-description {\n width: 0;\n flex: 1;\n margin: 8px 0 6px 0;\n }\n\n &-image {\n margin: 4px 0;\n height: 32px;\n margin-left: 8px;\n display: block;\n border-radius: 6px;\n overflow: hidden;\n border: 1px solid ", ";\n }\n\n\n \n }\n\n &-rag-empty-placeholder {\n padding: 16px 0;\n border: 1px solid ", ";\n border-radius: 6px;\n background-color: ", ";\n line-height: 20px;\n font-size: 12px;\n color: ", ";\n margin: 0 12px 12px 12px;\n }\n\n &-rag-query {\n margin: 0 12px 8px 12px;\n line-height: 20px;\n font-size: 12px;\n color: ", ";\n\n &-title {\n font-weight: 500;\n }\n\n &-images {\n margin: 0 12px 8px 12px;\n display: flex;\n gap: 8px;\n }\n }\n\n &-rag-item {\n margin-left: 16px;\n\n &-title {\n font-size: 12px;\n color: ", ";\n line-height: 20px;\n margin-bottom: 4px;\n display: flex;\n align-items: center;\n cursor: pointer;\n }\n\n &-content {\n padding: 8px;\n border-radius: 6px;\n background-color: ", ";\n }\n\n &-images {\n margin-top: 8px;\n padding: 8px;\n display: flex;\n gap: 8px;\n background-color: ", ";\n \n }\n\n &-footer {\n display: block;\n margin-top: 8px;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n }\n\n }\n\n &-rag-item ~ &-rag-item {\n margin-top: 8px;\n }\n}\n"])), function (p) {
4
+ export default createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-operate-card {\n width: 100%;\n border-radius: ", "px;\n overflow: hidden;\n background-color: ", ";\n\n &-header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n height: 32px;\n\n &-icon {\n font-size: 16px;\n }\n\n &-title {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n font-weight: 500;\n color: ", ";\n }\n\n &-description {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n color: ", ";\n }\n\n &-arrow {\n margin: 0 0 0 auto;\n }\n\n &-has-body {\n cursor: pointer;\n }\n }\n\n &-body {\n opacity: 0;\n animation: ", "-operate-card-body-open 0.2s ease-in-out forwards;\n \n @keyframes ", "-operate-card-body-open {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n \n }\n\n\n &-line-body {\n margin: 0 12px 12px 20px;\n border-left: 1px solid ", ";\n }\n\n &-thinking {\n padding-left: 16px;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n opacity: 0.85;\n white-space: pre-wrap;\n }\n\n\n &-todo-list {\n\n &-item {\n height: 32px;\n display: flex;\n align-items: center;\n padding: 0 12px;\n gap: 8px;\n \n color: ", ";\n\n\n &-done {\n color: ", ";\n }\n\n &-icon {\n font-size: 16px;\n }\n\n &-title {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n font-size: 12px;\n }\n\n &-done {\n \n }\n\n }\n \n }\n\n\n &-web-search-item {\n display: flex;\n height: 32px;\n align-items: center;\n padding: 0 12px;\n gap: 8px;\n color: ", ";\n cursor: pointer;\n\n &-icon {\n display: block;\n width: 16px;\n height: 16px;\n border: 1px solid ", ";\n border-radius: 99px;\n }\n\n &-title {\n font-size: 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n\n &:hover {\n color: ", ";\n \n }\n\n }\n\n &-subTitle {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-left: 1px solid ", ";\n font-size: 12px;\n line-height: 1;\n color: ", ";\n padding-left: 8px;\n margin-left: 4px;\n }\n\n }\n\n\n &-tool-call-block {\n margin-left: 16px;\n margin-top: 8px;\n\n \n &-title {\n font-size: 12px;\n color: ", ";\n line-height: 20px;\n margin-bottom: 4px;\n }\n\n }\n\n\n\n &-device-action {\n height: auto;\n align-items: flex-start;\n\n &-icon {\n margin-top: 6px;\n }\n\n &-time {\n margin-bottom: 4px;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n }\n\n &-content {\n \n width: 100%;\n display: flex;\n justify-content: space-between;\n }\n\n &-description {\n width: 0;\n flex: 1;\n margin: 8px 0 6px 0;\n }\n\n &-image {\n margin: 4px 0;\n height: 32px;\n margin-left: 8px;\n display: block;\n border-radius: 6px;\n overflow: hidden;\n border: 1px solid ", ";\n }\n\n\n \n }\n\n &-rag-empty-placeholder {\n padding: 16px 0;\n border: 1px solid ", ";\n border-radius: 6px;\n background-color: ", ";\n line-height: 20px;\n font-size: 12px;\n color: ", ";\n margin: 0 12px 12px 12px;\n }\n\n &-rag-query {\n margin: 0 12px 8px 12px;\n line-height: 20px;\n font-size: 12px;\n color: ", ";\n\n &-title {\n font-weight: 500;\n }\n\n &-images {\n margin: 0 12px 8px 12px;\n display: flex;\n gap: 8px;\n }\n }\n\n &-rag-item {\n margin-left: 16px;\n\n &-title {\n font-size: 12px;\n color: ", ";\n line-height: 20px;\n margin-bottom: 4px;\n display: flex;\n align-items: center;\n cursor: pointer;\n }\n\n &-content {\n padding: 8px;\n border-radius: 6px;\n background-color: ", ";\n\n &-text {\n font-size: 12px;\n line-height: 20px;\n }\n }\n\n &-images {\n margin-top: 8px;\n padding: 8px;\n display: flex;\n gap: 8px;\n background-color: ", ";\n \n }\n\n &-footer {\n display: block;\n margin-top: 8px;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n }\n\n }\n\n &-rag-item ~ &-rag-item {\n margin-top: 8px;\n }\n}\n"])), function (p) {
5
5
  return p.theme.prefixCls;
6
6
  }, function (p) {
7
7
  return p.theme.borderRadiusLG;
package/lib/index.d.ts CHANGED
@@ -26,3 +26,4 @@ export { default as sleep } from './Util/sleep';
26
26
  export { default as Welcome, type IWelcomeProps } from './Welcome';
27
27
  export { default as Markdown, type MarkdownProps as IMarkdownProps, type MarkdownProps, } from './Markdown';
28
28
  export { default as AIGC } from './AIGC';
29
+ export { Sandbox as GenerativeUISandbox } from './GenerativeUI';
package/lib/index.js CHANGED
@@ -24,4 +24,5 @@ export { default as StatusCard } from "./StatusCard";
24
24
  export { default as sleep } from "./Util/sleep";
25
25
  export { default as Welcome } from "./Welcome";
26
26
  export { default as Markdown } from "./Markdown";
27
- export { default as AIGC } from "./AIGC";
27
+ export { default as AIGC } from "./AIGC";
28
+ export { Sandbox as GenerativeUISandbox } from "./GenerativeUI";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/chat",
3
- "version": "1.1.45-beta.1766042199498",
3
+ "version": "1.1.45-beta.1766386435551",
4
4
  "description": "a free and open-source chat framework for building excellent LLM-powered chat experiences",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": [