@agentscope-ai/design 1.0.26 → 1.0.27-beta.1769678521654
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/lib/antd/styles/index.style.js +3 -1
- package/lib/antd/styles/inputSearch.style.d.ts +2 -0
- package/lib/antd/styles/inputSearch.style.js +15 -0
- package/lib/antd/styles/table.style.js +7 -1
- package/lib/components/commonComponents/Audio/Control.style.js +1 -1
- package/lib/components/commonComponents/CodeBlock/index.d.ts +7 -0
- package/lib/components/commonComponents/CodeBlock/index.js +2 -2
- package/lib/components/commonComponents/MediaPreview/demo/demo1.d.ts +1 -0
- package/lib/components/commonComponents/MediaPreview/demo/demo1.js +44 -0
- package/lib/components/commonComponents/MediaPreview/index.d.ts +23 -0
- package/lib/components/commonComponents/MediaPreview/index.js +352 -0
- package/lib/components/commonComponents/MediaPreview/index.style.d.ts +1 -0
- package/lib/components/commonComponents/MediaPreview/index.style.js +54 -0
- package/lib/components/commonComponents/Pagination/index.js +22 -23
- package/lib/components/commonComponents/PromptsEditor/index.d.ts +6 -0
- package/lib/components/commonComponents/PromptsEditor/index.js +2 -1
- package/lib/components/commonComponents/Tabs/index.d.ts +6 -0
- package/lib/components/commonComponents/Tabs/index.js +7 -5
- package/lib/index.d.ts +9 -8
- package/lib/index.js +7 -6
- package/llms/all.llms.txt +1071 -1039
- package/llms/components/commonComponents/CodeBlock/index.zh-CN.llms.txt +1 -0
- package/llms/components/commonComponents/InputSearch/index.zh-CN.llms.txt +6 -0
- package/llms/components/commonComponents/MediaPreview/index.zh-CN.llms.txt +21 -0
- package/llms/components/commonComponents/Tabs/index.zh-CN.llms.txt +1 -0
- package/llms/docs/changelog/index.zh-CN.llms.txt +22 -0
- package/llms/index.llms.txt +19 -17
- package/package.json +1 -1
- package/llms/docs/guide/iconLibrary.zh-CN.llms.txt +0 -150
- package/llms/docs/icons/sparkIcons.zh-CN.llms.txt +0 -25
|
@@ -16,13 +16,19 @@ import classNames from 'classnames';
|
|
|
16
16
|
import { useStyle } from "./index.style";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* 使用函数形式以支持动态国际化
|
|
19
|
+
* 获取默认的分页大小选项
|
|
21
20
|
*/
|
|
22
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
-
var
|
|
24
|
+
var DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 根据 pageSizeOptions 生成带国际化文案的选项配置
|
|
28
|
+
* @param pageSizeOptions 分页大小选项数组
|
|
29
|
+
*/
|
|
30
|
+
var getShowSizeChangeOptions = function getShowSizeChangeOptions() {
|
|
31
|
+
var pageSizeOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_PAGE_SIZE_OPTIONS;
|
|
26
32
|
var itemsText = $i18n.get({
|
|
27
33
|
id: 'components.commonComponents.Pagination.Items',
|
|
28
34
|
dm: '条'
|
|
@@ -32,19 +38,12 @@ var getDefaultShowSizeChange = function getDefaultShowSizeChange() {
|
|
|
32
38
|
dm: '页'
|
|
33
39
|
});
|
|
34
40
|
return {
|
|
35
|
-
options:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, {
|
|
42
|
-
label: "50 ".concat(itemsText, " / ").concat(pageText),
|
|
43
|
-
value: 50
|
|
44
|
-
}, {
|
|
45
|
-
label: "100 ".concat(itemsText, " / ").concat(pageText),
|
|
46
|
-
value: 100
|
|
47
|
-
}]
|
|
41
|
+
options: pageSizeOptions.map(function (size) {
|
|
42
|
+
return {
|
|
43
|
+
label: "".concat(size, " ").concat(itemsText, " / ").concat(pageText),
|
|
44
|
+
value: Number(size)
|
|
45
|
+
};
|
|
46
|
+
})
|
|
48
47
|
};
|
|
49
48
|
};
|
|
50
49
|
export default (function (props) {
|
|
@@ -105,21 +104,21 @@ export default (function (props) {
|
|
|
105
104
|
shouldShowSizeChanger = restProps.total && restProps.total > 50;
|
|
106
105
|
}
|
|
107
106
|
var getMergedShowSizeChange = function getMergedShowSizeChange() {
|
|
108
|
-
if (props.showSizeChanger === true) {
|
|
109
|
-
// 用户手动设置为 true,使用预置选项(动态获取以支持国际化)
|
|
110
|
-
return getDefaultShowSizeChange();
|
|
111
|
-
}
|
|
112
107
|
if (props.showSizeChanger === false) {
|
|
113
108
|
// 用户手动设为 false
|
|
114
109
|
return false;
|
|
115
110
|
}
|
|
116
111
|
if (_typeof(props.showSizeChanger) === 'object' && props.showSizeChanger) {
|
|
117
|
-
//
|
|
112
|
+
// 用户手动传入对象配置,优先使用
|
|
118
113
|
return props.showSizeChanger;
|
|
119
114
|
}
|
|
115
|
+
if (props.showSizeChanger === true) {
|
|
116
|
+
// 用户手动设置为 true,使用 pageSizeOptions 或预置选项
|
|
117
|
+
return getShowSizeChangeOptions(restProps.pageSizeOptions);
|
|
118
|
+
}
|
|
120
119
|
if (restProps.total && restProps.total > 50) {
|
|
121
|
-
// 数据量大于 50
|
|
122
|
-
return
|
|
120
|
+
// 数据量大于 50,使用 pageSizeOptions 或预置选项
|
|
121
|
+
return getShowSizeChangeOptions(restProps.pageSizeOptions);
|
|
123
122
|
}
|
|
124
123
|
return false;
|
|
125
124
|
};
|
|
@@ -42,6 +42,12 @@ export interface PromptsEditorProps {
|
|
|
42
42
|
* @descriptionEn Text of the tips, set to false to hide the tips
|
|
43
43
|
*/
|
|
44
44
|
tipsText?: string | React.ReactNode | false;
|
|
45
|
+
/**
|
|
46
|
+
* @description 仅可读
|
|
47
|
+
* @descriptionEn Read only
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
readOnly?: boolean;
|
|
45
51
|
}
|
|
46
52
|
export declare const langExtensionsMap: Record<string, any[]>;
|
|
47
53
|
declare const _default: React.MemoExoticComponent<(props: PromptsEditorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -128,7 +128,8 @@ var Editor = function Editor(props) {
|
|
|
128
128
|
lineNumbers: false,
|
|
129
129
|
foldGutter: false,
|
|
130
130
|
highlightActiveLine: false
|
|
131
|
-
}
|
|
131
|
+
},
|
|
132
|
+
readOnly: props.readOnly
|
|
132
133
|
}, getTheme), /*#__PURE__*/_jsxs("div", {
|
|
133
134
|
className: styles.footer,
|
|
134
135
|
children: [tips, props.maxLength ? /*#__PURE__*/_jsxs("div", {
|
|
@@ -7,6 +7,12 @@ export interface SparkTabsProps extends Omit<TabsProps, 'type'> {
|
|
|
7
7
|
* @default true
|
|
8
8
|
*/
|
|
9
9
|
type?: 'line' | 'card' | 'editable-card' | 'segmented';
|
|
10
|
+
/**
|
|
11
|
+
* @description 类名
|
|
12
|
+
* @descriptionEn ClassName
|
|
13
|
+
* @default ''
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
10
16
|
}
|
|
11
17
|
declare const SparkTabs: {
|
|
12
18
|
(props: SparkTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["type", "centered"];
|
|
2
|
+
var _excluded = ["type", "centered", "className"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -25,6 +25,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
25
25
|
var SparkTabs = function SparkTabs(props) {
|
|
26
26
|
var type = props.type,
|
|
27
27
|
centered = props.centered,
|
|
28
|
+
className = props.className,
|
|
28
29
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
29
30
|
var _getCommonConfig = getCommonConfig(),
|
|
30
31
|
sparkPrefix = _getCommonConfig.sparkPrefix;
|
|
@@ -61,8 +62,8 @@ var SparkTabs = function SparkTabs(props) {
|
|
|
61
62
|
|
|
62
63
|
// 缓存 className
|
|
63
64
|
var segmentedClassName = useMemo(function () {
|
|
64
|
-
return classNames("".concat(sparkPrefix, "-segmented-tab-bar"), _defineProperty({}, "".concat(sparkPrefix, "-segmented-tab-bar-centered"), centered));
|
|
65
|
-
}, [sparkPrefix, centered]);
|
|
65
|
+
return classNames("".concat(sparkPrefix, "-segmented-tab-bar"), _defineProperty({}, "".concat(sparkPrefix, "-segmented-tab-bar-centered"), centered), className);
|
|
66
|
+
}, [sparkPrefix, centered, className]);
|
|
66
67
|
|
|
67
68
|
// 获取当前选中 tab 的内容
|
|
68
69
|
var activeContent = useMemo(function () {
|
|
@@ -89,8 +90,9 @@ var SparkTabs = function SparkTabs(props) {
|
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
92
|
-
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Tabs, _objectSpread(_objectSpread({},
|
|
93
|
-
type: type
|
|
93
|
+
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Tabs, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
94
|
+
type: type,
|
|
95
|
+
className: className
|
|
94
96
|
}))]
|
|
95
97
|
});
|
|
96
98
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -38,7 +38,10 @@ export { default as Steps } from './components/commonComponents/Steps';
|
|
|
38
38
|
export { default as SlateEditor } from './components/commonComponents/SlateEditor';
|
|
39
39
|
export { default as Slider, type SliderInputProps, } from './components/commonComponents/Slider';
|
|
40
40
|
export { default as Spinner, type SparkSpinnerProps, type SparkSpinnerProps as SpinnerProps, } from './components/commonComponents/Spinner';
|
|
41
|
+
export { default as Audio, type AudioProps, } from './components/commonComponents/Audio';
|
|
41
42
|
export { default as Descriptions } from './components/commonComponents/Descriptions';
|
|
43
|
+
export { FileCard, default as FileIcon, type SparkFileCardProps, type SparkFileIconProps, } from './components/commonComponents/FileIcon';
|
|
44
|
+
export { default as MediaPreview, type MediaItem, type MediaPreviewProps, } from './components/commonComponents/MediaPreview';
|
|
42
45
|
export { default as SliderSelector } from './components/commonComponents/SliderSelector';
|
|
43
46
|
export { default as Statistic } from './components/commonComponents/Statistic';
|
|
44
47
|
export { default as Switch, type SparkSwitchProps as SwitchProps, } from './components/commonComponents/Switch';
|
|
@@ -48,15 +51,13 @@ export { default as Tag, type SparkTagProps as TagProps, } from './components/co
|
|
|
48
51
|
export { default as TimePicker } from './components/commonComponents/TimePicker';
|
|
49
52
|
export { default as Tooltip, type SparkTooltipProps as TooltipProps, } from './components/commonComponents/Tooltip';
|
|
50
53
|
export { default as Upload } from './components/commonComponents/Upload';
|
|
51
|
-
export { default as Video, type VideoProps } from './components/commonComponents/Video';
|
|
52
|
-
export { default as Audio, type AudioProps } from './components/commonComponents/Audio';
|
|
53
|
-
export { FileCard, default as FileIcon, type SparkFileCardProps, type SparkFileIconProps, } from './components/commonComponents/FileIcon';
|
|
54
|
+
export { default as Video, type VideoProps, } from './components/commonComponents/Video';
|
|
54
55
|
/**
|
|
55
56
|
* 移动端组件
|
|
56
57
|
*/
|
|
57
|
-
export { default as
|
|
58
|
-
export { default as MobileDrawer, type SparkMobileDrawerProps as MobileDrawerProps } from './components/mobileComponents/MobileDrawer';
|
|
59
|
-
export { default as
|
|
58
|
+
export { default as MobileAlertDialog, type MobileAlertDialogProps, } from './components/mobileComponents/MobileAlertDialog';
|
|
59
|
+
export { default as MobileDrawer, type SparkMobileDrawerProps as MobileDrawerProps, } from './components/mobileComponents/MobileDrawer';
|
|
60
|
+
export { default as MobileModal, type SparkMobileModalProps as MobileModalProps, } from './components/mobileComponents/MobileModal';
|
|
60
61
|
/**
|
|
61
62
|
* hooks
|
|
62
63
|
*/
|
|
@@ -66,11 +67,11 @@ export { default as useGlobalStyle } from './hooks/useGlobalStyle';
|
|
|
66
67
|
*/
|
|
67
68
|
export { default as delay } from './libs/delay';
|
|
68
69
|
export { safeHtml } from './libs/dom';
|
|
69
|
-
export { copy, renderTooltip } from './libs/utils';
|
|
70
|
-
export { waitForDom, waitForFunc } from './libs/waitFor';
|
|
71
70
|
export { default as requestPop, type AliyunPopOptions, type BaseResponse, type RequestOptions, } from './libs/requestPop';
|
|
72
71
|
export { default as requestPopSse, type SseOptions, type SseResponse, } from './libs/requestPopSse';
|
|
73
72
|
export { default as requestSse } from './libs/requestSse';
|
|
73
|
+
export { copy, renderTooltip } from './libs/utils';
|
|
74
|
+
export { waitForDom, waitForFunc } from './libs/waitFor';
|
|
74
75
|
/**
|
|
75
76
|
* Spark的ConfigProvider
|
|
76
77
|
*/
|
package/lib/index.js
CHANGED
|
@@ -43,7 +43,10 @@ export { default as Steps } from "./components/commonComponents/Steps";
|
|
|
43
43
|
export { default as SlateEditor } from "./components/commonComponents/SlateEditor";
|
|
44
44
|
export { default as Slider } from "./components/commonComponents/Slider";
|
|
45
45
|
export { default as Spinner } from "./components/commonComponents/Spinner";
|
|
46
|
+
export { default as Audio } from "./components/commonComponents/Audio";
|
|
46
47
|
export { default as Descriptions } from "./components/commonComponents/Descriptions";
|
|
48
|
+
export { FileCard, default as FileIcon } from "./components/commonComponents/FileIcon";
|
|
49
|
+
export { default as MediaPreview } from "./components/commonComponents/MediaPreview";
|
|
47
50
|
export { default as SliderSelector } from "./components/commonComponents/SliderSelector";
|
|
48
51
|
export { default as Statistic } from "./components/commonComponents/Statistic";
|
|
49
52
|
export { default as Switch } from "./components/commonComponents/Switch";
|
|
@@ -54,15 +57,13 @@ export { default as TimePicker } from "./components/commonComponents/TimePicker"
|
|
|
54
57
|
export { default as Tooltip } from "./components/commonComponents/Tooltip";
|
|
55
58
|
export { default as Upload } from "./components/commonComponents/Upload";
|
|
56
59
|
export { default as Video } from "./components/commonComponents/Video";
|
|
57
|
-
export { default as Audio } from "./components/commonComponents/Audio";
|
|
58
|
-
export { FileCard, default as FileIcon } from "./components/commonComponents/FileIcon";
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* 移动端组件
|
|
62
63
|
*/
|
|
63
|
-
export { default as MobileModal } from "./components/mobileComponents/MobileModal";
|
|
64
|
-
export { default as MobileDrawer } from "./components/mobileComponents/MobileDrawer";
|
|
65
64
|
export { default as MobileAlertDialog } from "./components/mobileComponents/MobileAlertDialog";
|
|
65
|
+
export { default as MobileDrawer } from "./components/mobileComponents/MobileDrawer";
|
|
66
|
+
export { default as MobileModal } from "./components/mobileComponents/MobileModal";
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
69
|
* hooks
|
|
@@ -74,11 +75,11 @@ export { default as useGlobalStyle } from "./hooks/useGlobalStyle";
|
|
|
74
75
|
*/
|
|
75
76
|
export { default as delay } from "./libs/delay";
|
|
76
77
|
export { safeHtml } from "./libs/dom";
|
|
77
|
-
export { copy, renderTooltip } from "./libs/utils";
|
|
78
|
-
export { waitForDom, waitForFunc } from "./libs/waitFor";
|
|
79
78
|
export { default as requestPop } from "./libs/requestPop";
|
|
80
79
|
export { default as requestPopSse } from "./libs/requestPopSse";
|
|
81
80
|
export { default as requestSse } from "./libs/requestSse";
|
|
81
|
+
export { copy, renderTooltip } from "./libs/utils";
|
|
82
|
+
export { waitForDom, waitForFunc } from "./libs/waitFor";
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
85
|
* Spark的ConfigProvider
|