@agentscope-ai/design 1.0.26 → 1.0.27-beta.1769499161692
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/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/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 +55 -4086
- 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 +3 -50
- 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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<DemoTitle title="MediaPreview" desc="用于预览图片和视频的弹窗组件">
|
|
4
|
+
#### API
|
|
5
|
+
|
|
6
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
7
|
+
|--------|--------|--------|--------|
|
|
8
|
+
| visible | 是否显示预览 | boolean | false |
|
|
9
|
+
| mediaList | 媒体列表 | MediaItem[] | [] |
|
|
10
|
+
| currentIndex | 当前选中的索引 | number | 0 |
|
|
11
|
+
| onClose | 关闭回调 | () => void | - |
|
|
12
|
+
| className | 自定义样式类名 | string | - |
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
#### MediaItem
|
|
16
|
+
|
|
17
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
18
|
+
|--------|--------|--------|--------|
|
|
19
|
+
| type | 媒体类型 | 'image' \| 'video' | - |
|
|
20
|
+
| src | 媒体资源地址 | string | - |
|
|
21
|
+
| alt | 媒体替代文本 | string | - |
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
### 1.0.27
|
|
4
|
+
`2025-01-27`
|
|
5
|
+
|
|
6
|
+
##### Changed
|
|
7
|
+
|
|
8
|
+
- 补充 InputSearch 组件文档
|
|
9
|
+
|
|
10
|
+
##### Fixed
|
|
11
|
+
|
|
12
|
+
- Table 组件在表头固定时,表头样式默认圆角改为直角
|
|
13
|
+
- Empty 组件修复了引入多个 Empty 组件的情况下,可能导致的 svg 丢失的问题
|
|
14
|
+
- 文档搜索白屏问题修复
|
|
15
|
+
|
|
16
|
+
### 1.0.26
|
|
17
|
+
`2025-01-21`
|
|
18
|
+
|
|
19
|
+
##### Changed
|
|
20
|
+
|
|
21
|
+
- Audio 组件探测逻辑重构、使用 useCallback 提升性能
|
|
22
|
+
- Audio 与 Video 新增 SVG icons,支持在 FileIcon 组件中透出展示
|
|
23
|
+
- 文档新增 icons 列表展示与复制功能
|
|
24
|
+
|
|
3
25
|
### 1.0.25
|
|
4
26
|
`2025-01-07`
|
|
5
27
|
|
package/llms/index.llms.txt
CHANGED
|
@@ -1,53 +1,6 @@
|
|
|
1
1
|
# 索引
|
|
2
2
|
|
|
3
|
-
- [](components/commonComponents/Video/index.zh-CN.llms.txt)
|
|
4
|
-
- [](components/commonComponents/Upload/index.zh-CN.llms.txt)
|
|
5
|
-
- [](components/commonComponents/Tooltip/index.zh-CN.llms.txt)
|
|
6
3
|
- [](components/commonComponents/Table/index.zh-CN.llms.txt)
|
|
7
|
-
- [](components/commonComponents/
|
|
8
|
-
- [](
|
|
9
|
-
- [](components/commonComponents/
|
|
10
|
-
- [](components/commonComponents/TimePicker/index.zh-CN.llms.txt)
|
|
11
|
-
- [](components/commonComponents/Steps/index.zh-CN.llms.txt)
|
|
12
|
-
- [](components/commonComponents/Statistic/index.zh-CN.llms.txt)
|
|
13
|
-
- [](components/commonComponents/Spinner/index.zh-CN.llms.txt)
|
|
14
|
-
- [](components/commonComponents/Slider/index.zh-CN.llms.txt)
|
|
15
|
-
- [](components/commonComponents/Skeleton/index.zh-CN.llms.txt)
|
|
16
|
-
- [](components/commonComponents/RadioButton/index.zh-CN.llms.txt)
|
|
17
|
-
- [](components/commonComponents/Select/index.zh-CN.llms.txt)
|
|
18
|
-
- [](components/commonComponents/Result/index.zh-CN.llms.txt)
|
|
19
|
-
- [](components/commonComponents/Progress/index.zh-CN.llms.txt)
|
|
20
|
-
- [](components/commonComponents/Radio/index.zh-CN.llms.txt)
|
|
21
|
-
- [](components/commonComponents/PromptsEditor/index.zh-CN.llms.txt)
|
|
22
|
-
- [](components/commonComponents/Popover/index.zh-CN.llms.txt)
|
|
23
|
-
- [](components/commonComponents/Popconfirm/index.zh-CN.llms.txt)
|
|
24
|
-
- [](components/commonComponents/Pagination/index.zh-CN.llms.txt)
|
|
25
|
-
- [](components/commonComponents/Notification/index.zh-CN.llms.txt)
|
|
26
|
-
- [](components/commonComponents/Modal/index.zh-CN.llms.txt)
|
|
27
|
-
- [](components/commonComponents/Message/index.zh-CN.llms.txt)
|
|
28
|
-
- [](components/commonComponents/InputNumber/index.zh-CN.llms.txt)
|
|
29
|
-
- [](components/commonComponents/Image/index.zh-CN.llms.txt)
|
|
30
|
-
- [](components/commonComponents/Input/index.zh-CN.llms.txt)
|
|
31
|
-
- [](components/commonComponents/IconButton/index.zh-CN.llms.txt)
|
|
32
|
-
- [](components/commonComponents/Form/index.zh-CN.llms.txt)
|
|
33
|
-
- [](components/commonComponents/FloatButton/index.zh-CN.llms.txt)
|
|
34
|
-
- [](components/commonComponents/Dropdown/index.zh-CN.llms.txt)
|
|
35
|
-
- [](components/commonComponents/Empty/index.zh-CN.llms.txt)
|
|
36
|
-
- [](components/commonComponents/Descriptions/index.zh-CN.llms.txt)
|
|
37
|
-
- [](components/commonComponents/FileIcon/index.zh-CN.llms.txt)
|
|
38
|
-
- [](components/commonComponents/DatePicker/index.zh-CN.llms.txt)
|
|
39
|
-
- [](components/commonComponents/Drawer/index.zh-CN.llms.txt)
|
|
40
|
-
- [](components/commonComponents/CollapsePanel/index.zh-CN.llms.txt)
|
|
41
|
-
- [](components/commonComponents/Checkbox/index.zh-CN.llms.txt)
|
|
42
|
-
- [](components/commonComponents/CodeBlock/index.zh-CN.llms.txt)
|
|
43
|
-
- [](components/commonComponents/Collapse/index.zh-CN.llms.txt)
|
|
44
|
-
- [](components/commonComponents/Button/index.zh-CN.llms.txt)
|
|
45
|
-
- [](components/commonComponents/Breadcrumb/index.zh-CN.llms.txt)
|
|
46
|
-
- [](components/commonComponents/Card/index.zh-CN.llms.txt)
|
|
47
|
-
- [](components/commonComponents/Avatar/index.zh-CN.llms.txt)
|
|
48
|
-
- [](components/commonComponents/Audio/index.zh-CN.llms.txt)
|
|
49
|
-
- [](components/commonComponents/Anchor/index.zh-CN.llms.txt)
|
|
50
|
-
- [](components/commonComponents/AlertDialog/index.zh-CN.llms.txt)
|
|
51
|
-
- [](components/commonComponents/Alert/index.zh-CN.llms.txt)
|
|
52
|
-
- [使用](docs/guide/sparkIcons.zh-CN.llms.txt)
|
|
53
|
-
- [Icon Library](docs/icons/iconLibrary.zh-CN.llms.txt)
|
|
4
|
+
- [](components/commonComponents/InputSearch/index.zh-CN.llms.txt)
|
|
5
|
+
- [](docs/changelog/index.zh-CN.llms.txt)
|
|
6
|
+
- [](components/commonComponents/Tabs/index.zh-CN.llms.txt)
|
package/package.json
CHANGED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Icon Library
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```tsx
|
|
8
|
-
import React, { useMemo, useState } from 'react';
|
|
9
|
-
import * as SparkIcons from '@agentscope-ai/icons';
|
|
10
|
-
import { Input, Radio, message, copy } from '@agentscope-ai/design';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Icons Library
|
|
14
|
-
* - 自动枚举并展示 @agentscope-ai/icons 的全部导出图标
|
|
15
|
-
* - 支持搜索、点击复制
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
interface IconItem {
|
|
19
|
-
/** 图标导出名称 */
|
|
20
|
-
name: string;
|
|
21
|
-
/** 图标 React 组件 */
|
|
22
|
-
Icon: React.ComponentType<any>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type CopyMode = 'name' | 'import' | 'jsx';
|
|
26
|
-
|
|
27
|
-
const GRID_STYLE: React.CSSProperties = {
|
|
28
|
-
display: 'grid',
|
|
29
|
-
gridTemplateColumns: 'repeat(auto-fill, minmax(140px, 1fr))',
|
|
30
|
-
gap: 12,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const CARD_STYLE: React.CSSProperties = {
|
|
34
|
-
padding: 12,
|
|
35
|
-
borderRadius: 8,
|
|
36
|
-
cursor: 'pointer',
|
|
37
|
-
border: '1px solid var(--sps-color-border-secondary)',
|
|
38
|
-
background: 'var(--sps-color-bg-base)',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const NAME_STYLE: React.CSSProperties = {
|
|
42
|
-
marginTop: 8,
|
|
43
|
-
fontSize: 12,
|
|
44
|
-
lineHeight: '16px',
|
|
45
|
-
color: 'var(--sps-color-text-tertiary)',
|
|
46
|
-
overflow: 'hidden',
|
|
47
|
-
textOverflow: 'ellipsis',
|
|
48
|
-
whiteSpace: 'nowrap',
|
|
49
|
-
width: '100%',
|
|
50
|
-
fontFamily:
|
|
51
|
-
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default function IconLibrary() {
|
|
55
|
-
const [keyword, setKeyword] = useState<string>('');
|
|
56
|
-
const [copyMode, setCopyMode] = useState<CopyMode>('name');
|
|
57
|
-
|
|
58
|
-
const allIcons = useMemo<IconItem[]>(() => {
|
|
59
|
-
return Object.entries(SparkIcons)
|
|
60
|
-
.filter(([name, Icon]) => {
|
|
61
|
-
if (!name.startsWith('Spark')) return false;
|
|
62
|
-
return typeof Icon === 'function';
|
|
63
|
-
})
|
|
64
|
-
.map(([name, Icon]) => ({
|
|
65
|
-
name,
|
|
66
|
-
Icon: Icon as React.ComponentType<any>,
|
|
67
|
-
}))
|
|
68
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
69
|
-
}, []);
|
|
70
|
-
|
|
71
|
-
const filteredIcons = useMemo<IconItem[]>(() => {
|
|
72
|
-
const q = keyword.trim().toLowerCase();
|
|
73
|
-
if (!q) return allIcons;
|
|
74
|
-
return allIcons.filter((item) => item.name.toLowerCase().includes(q));
|
|
75
|
-
}, [allIcons, keyword]);
|
|
76
|
-
|
|
77
|
-
const handleCopy = (item: IconItem) => {
|
|
78
|
-
let text = item.name;
|
|
79
|
-
if (copyMode === 'import') {
|
|
80
|
-
text = `import { ${item.name} } from '@agentscope-ai/icons';`;
|
|
81
|
-
}
|
|
82
|
-
if (copyMode === 'jsx') {
|
|
83
|
-
text = `<${item.name} style={{ fontSize: 24 }} />`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
copy(text);
|
|
87
|
-
message.success('已复制');
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<div style={{ padding: 16 }}>
|
|
92
|
-
<div style={{ display: 'flex', gap: 12, alignItems: 'center' }}>
|
|
93
|
-
<Input
|
|
94
|
-
placeholder="搜索图标(按导出名)"
|
|
95
|
-
value={keyword}
|
|
96
|
-
onChange={(e) => setKeyword((e?.target as any)?.value || '')}
|
|
97
|
-
style={{ maxWidth: 360 }}
|
|
98
|
-
allowClear
|
|
99
|
-
/>
|
|
100
|
-
<Radio.Group
|
|
101
|
-
value={copyMode}
|
|
102
|
-
onChange={(e) => setCopyMode(e.target.value)}
|
|
103
|
-
optionType="button"
|
|
104
|
-
buttonStyle="solid"
|
|
105
|
-
options={[
|
|
106
|
-
{ label: '复制名称', value: 'name' },
|
|
107
|
-
{ label: '复制 import', value: 'import' },
|
|
108
|
-
{ label: '复制 JSX', value: 'jsx' },
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
111
|
-
<div style={{ color: 'var(--sps-color-text-tertiary)', fontSize: 12 }}>
|
|
112
|
-
共 {filteredIcons.length} 个
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<div style={{ marginTop: 16, ...GRID_STYLE }}>
|
|
117
|
-
{filteredIcons.map((item) => {
|
|
118
|
-
const Icon = item.Icon;
|
|
119
|
-
return (
|
|
120
|
-
<div
|
|
121
|
-
key={item.name}
|
|
122
|
-
style={CARD_STYLE}
|
|
123
|
-
onClick={() => handleCopy(item)}
|
|
124
|
-
>
|
|
125
|
-
<div
|
|
126
|
-
style={{
|
|
127
|
-
width: 48,
|
|
128
|
-
height: 48,
|
|
129
|
-
display: 'flex',
|
|
130
|
-
alignItems: 'center',
|
|
131
|
-
justifyContent: 'center',
|
|
132
|
-
}}
|
|
133
|
-
>
|
|
134
|
-
<Icon style={{ fontSize: 24 }} />
|
|
135
|
-
</div>
|
|
136
|
-
<div style={NAME_STYLE} title={item.name}>
|
|
137
|
-
{item.name}
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
141
|
-
})}
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
查看全部图标
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# 使用
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```tsx
|
|
8
|
-
import { SparkLoadingLine } from '@agentscope-ai/icons';
|
|
9
|
-
|
|
10
|
-
export default () => {
|
|
11
|
-
return (
|
|
12
|
-
<SparkLoadingLine
|
|
13
|
-
className="your-class-name"
|
|
14
|
-
style={{ color: 'var(--sps-color-primary)' }}
|
|
15
|
-
spin
|
|
16
|
-
size={48}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
基本用法
|
|
24
|
-
|
|
25
|
-
访问 [Icon Library](https://sparkdesign.agentscope.io/#/resources/icons) 查看全部 Icon
|