@agentscope-ai/design 1.0.13 → 1.0.15-rc.0
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/README.md +237 -178
- package/README.zh-CN.md +312 -0
- package/lib/antd/styles/alert.style.js +7 -1
- package/lib/antd/styles/dropdown.style.js +5 -1
- package/lib/antd/styles/select.style.js +9 -1
- package/lib/components/commonComponents/Alert/demo/demo2.js +5 -0
- package/lib/components/commonComponents/AlertDialog/index.d.ts +37 -325
- package/lib/components/commonComponents/AlertDialog/index.js +151 -3
- package/lib/components/commonComponents/AlertDialog/index.style.js +2 -14
- package/lib/components/commonComponents/Drawer/index.style.js +2 -42
- package/lib/components/commonComponents/Modal/index.d.ts +16 -2
- package/lib/components/commonComponents/Modal/index.js +71 -3
- package/lib/components/commonComponents/Modal/index.style.js +2 -62
- package/lib/components/commonComponents/PromptsEditor/VarRender.d.ts +1 -1
- package/lib/components/commonComponents/Tabs/index.style.js +7 -1
- package/lib/components/commonComponents/Tag/demo/demo1.js +1 -1
- package/lib/components/commonComponents/Tag/index.d.ts +5 -1
- package/lib/components/commonComponents/Tag/index.js +4 -0
- package/lib/components/commonComponents/Tag/index.style.js +65 -1
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo1.d.ts +3 -0
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo1.js +20 -0
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo2.d.ts +3 -0
- package/lib/components/mobileComponents/MobileAlertDialog/demo/demo2.js +50 -0
- package/lib/components/{commonComponents/AlertDialog/mobile.d.ts → mobileComponents/MobileAlertDialog/index.d.ts} +8 -8
- package/lib/components/{commonComponents/AlertDialog/mobile.js → mobileComponents/MobileAlertDialog/index.js} +3 -3
- package/lib/components/mobileComponents/MobileAlertDialog/index.style.d.ts +1 -0
- package/lib/components/mobileComponents/MobileAlertDialog/index.style.js +22 -0
- package/lib/components/mobileComponents/MobileDrawer/Confirm.d.ts +46 -0
- package/lib/components/mobileComponents/MobileDrawer/Confirm.js +63 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo1.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo1.js +49 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo2.d.ts +7 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo2.js +90 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo3.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo3.js +64 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo4.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo4.js +99 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo5.d.ts +2 -0
- package/lib/components/mobileComponents/MobileDrawer/demo/demo5.js +73 -0
- package/lib/components/mobileComponents/MobileDrawer/index.d.ts +16 -0
- package/lib/components/{commonComponents/Modal/pc.js → mobileComponents/MobileDrawer/index.js} +25 -52
- package/lib/components/mobileComponents/MobileDrawer/index.style.d.ts +1 -0
- package/lib/components/mobileComponents/MobileDrawer/index.style.js +44 -0
- package/lib/components/mobileComponents/MobileModal/demo/basic.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/demo/basic.js +49 -0
- package/lib/components/mobileComponents/MobileModal/demo/styles.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/demo/styles.js +158 -0
- package/lib/components/mobileComponents/MobileModal/demo/width.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/demo/width.js +68 -0
- package/lib/components/mobileComponents/MobileModal/index.d.ts +43 -0
- package/lib/components/{commonComponents/Modal/mobile.js → mobileComponents/MobileModal/index.js} +45 -11
- package/lib/components/mobileComponents/MobileModal/index.style.d.ts +1 -0
- package/lib/components/mobileComponents/MobileModal/index.style.js +70 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +10 -1
- package/lib/libs/env/index.d.ts +1 -1
- package/lib/typings.d.ts +0 -2
- package/llms/all.llms.txt +4953 -0
- package/llms/components/commonComponents/Alert/index.zh-CN.llms.txt +32 -0
- package/llms/components/commonComponents/AlertDialog/index.zh-CN.llms.txt +171 -0
- package/llms/components/commonComponents/Anchor/index.zh-CN.llms.txt +51 -0
- package/llms/components/commonComponents/Avatar/index.zh-CN.llms.txt +37 -0
- package/llms/components/commonComponents/Breadcrumb/index.zh-CN.llms.txt +117 -0
- package/llms/components/commonComponents/Button/index.zh-CN.llms.txt +54 -0
- package/llms/components/commonComponents/Card/index.zh-CN.llms.txt +61 -0
- package/llms/components/commonComponents/Checkbox/index.zh-CN.llms.txt +69 -0
- package/llms/components/commonComponents/CodeBlock/index.zh-CN.llms.txt +13 -0
- package/llms/components/commonComponents/Collapse/index.zh-CN.llms.txt +56 -0
- package/llms/components/commonComponents/CollapsePanel/index.zh-CN.llms.txt +69 -0
- package/llms/components/commonComponents/DatePicker/index.zh-CN.llms.txt +221 -0
- package/llms/components/commonComponents/Descriptions/index.zh-CN.llms.txt +37 -0
- package/llms/components/commonComponents/Drawer/index.zh-CN.llms.txt +62 -0
- package/llms/components/commonComponents/Dropdown/index.zh-CN.llms.txt +149 -0
- package/llms/components/commonComponents/Empty/index.zh-CN.llms.txt +40 -0
- package/llms/components/commonComponents/FloatButton/index.zh-CN.llms.txt +51 -0
- package/llms/components/commonComponents/Form/index.zh-CN.llms.txt +558 -0
- package/llms/components/commonComponents/IconButton/index.zh-CN.llms.txt +45 -0
- package/llms/components/commonComponents/Image/index.zh-CN.llms.txt +165 -0
- package/llms/components/commonComponents/Input/index.zh-CN.llms.txt +133 -0
- package/llms/components/commonComponents/InputNumber/index.zh-CN.llms.txt +51 -0
- package/llms/components/commonComponents/Message/index.zh-CN.llms.txt +98 -0
- package/llms/components/commonComponents/Modal/index.zh-CN.llms.txt +168 -0
- package/llms/components/commonComponents/Notification/index.zh-CN.llms.txt +94 -0
- package/llms/components/commonComponents/Pagination/index.zh-CN.llms.txt +45 -0
- package/llms/components/commonComponents/Popconfirm/index.zh-CN.llms.txt +55 -0
- package/llms/components/commonComponents/Popover/index.zh-CN.llms.txt +43 -0
- package/llms/components/commonComponents/Progress/index.zh-CN.llms.txt +50 -0
- package/llms/components/commonComponents/PromptsEditor/index.zh-CN.llms.txt +15 -0
- package/llms/components/commonComponents/Radio/index.zh-CN.llms.txt +66 -0
- package/llms/components/commonComponents/RadioButton/index.zh-CN.llms.txt +73 -0
- package/llms/components/commonComponents/Result/index.zh-CN.llms.txt +10 -0
- package/llms/components/commonComponents/Select/index.zh-CN.llms.txt +96 -0
- package/llms/components/commonComponents/Skeleton/index.zh-CN.llms.txt +59 -0
- package/llms/components/commonComponents/Slider/index.zh-CN.llms.txt +62 -0
- package/llms/components/commonComponents/Spinner/index.zh-CN.llms.txt +15 -0
- package/llms/components/commonComponents/Statistic/index.zh-CN.llms.txt +58 -0
- package/llms/components/commonComponents/Steps/index.zh-CN.llms.txt +57 -0
- package/llms/components/commonComponents/Switch/index.zh-CN.llms.txt +39 -0
- package/llms/components/commonComponents/Table/index.zh-CN.llms.txt +254 -0
- package/llms/components/commonComponents/Tabs/index.zh-CN.llms.txt +68 -0
- package/llms/components/commonComponents/Tag/index.zh-CN.llms.txt +33 -0
- package/llms/components/commonComponents/TimePicker/index.zh-CN.llms.txt +111 -0
- package/llms/components/commonComponents/Tooltip/index.zh-CN.llms.txt +44 -0
- package/llms/components/commonComponents/Upload/index.zh-CN.llms.txt +95 -0
- package/llms/components/commonComponents/Video/index.zh-CN.llms.txt +7 -0
- package/llms/docs/guide/fromAntd.zh-CN.llms.txt +156 -0
- package/llms/docs/guide/fromScratch.zh-CN.llms.txt +83 -0
- package/llms/docs/guide/iconfont.zh-CN.llms.txt +69 -0
- package/llms/docs/guide/overview.zh-CN.llms.txt +51 -0
- package/llms/docs/guide/sparkIcons.zh-CN.llms.txt +25 -0
- package/llms/docs/guide/theme.zh-CN.llms.txt +61 -0
- package/llms/docs/guide/tokens&variables.zh-CN.llms.txt +425 -0
- package/llms/docs/guide/vibe-coding.zh-CN.llms.txt +29 -0
- package/llms/index.llms.txt +49 -0
- package/package.json +14 -4
- package/scripts/mcp-docs-server.js +14079 -0
- package/lib/components/commonComponents/AlertDialog/pc.d.ts +0 -38
- package/lib/components/commonComponents/AlertDialog/pc.js +0 -152
- package/lib/components/commonComponents/Modal/mobile.d.ts +0 -28
- package/lib/components/commonComponents/Modal/pc.d.ts +0 -28
package/README.md
CHANGED
|
@@ -1,185 +1,247 @@
|
|
|
1
|
-
# @
|
|
2
|
-
|
|
3
|
-
[
|
|
35
|
-
| │ ├── bizComponents # 业务组件
|
|
36
|
-
| | │ ├── bailian # 百炼控制台业务组件(只放有复用场景的)
|
|
37
|
-
| | │ ├── quanmiao # 全妙业务组件(只放有复用场景的)
|
|
38
|
-
│ ├── demos # 【deprecated】临时存放Demo UI层的相关文件,后续会迁移到theme中
|
|
39
|
-
│ ├── i18n # 国际化相关
|
|
40
|
-
│ ├── config.ts # 配置项
|
|
41
|
-
│ ├── index.less # 【deprecated】组件库全局样式(历史包袱,后续考虑删掉)
|
|
42
|
-
│ ├── index.ts # 入口文件,所有组件、hooks、工具函数都从这里用export导出
|
|
43
|
-
│ └── typings.d.ts # 类型文件
|
|
44
|
-
├── docs
|
|
45
|
-
│ ├── guide # 指南页
|
|
46
|
-
│ ├── index.md # 首页
|
|
47
|
-
└── tsconfig.json
|
|
1
|
+
# @agentscope-ai/design
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.org/package/@agentscope-ai/design)
|
|
4
|
+
[](https://npmjs.org/package/@agentscope-ai/design)
|
|
5
|
+
|
|
6
|
+
AgentScope Spark Design - UI Component Library for Alibaba Cloud Apsara Lab
|
|
7
|
+
|
|
8
|
+
[中文文档](./README.zh-CN.md)
|
|
9
|
+
|
|
10
|
+
## ✨ Features
|
|
11
|
+
|
|
12
|
+
- 🎨 Custom theme system based on Ant Design 5
|
|
13
|
+
- 🔧 50+ enhanced UI components
|
|
14
|
+
- 📱 Mobile component support
|
|
15
|
+
- 🎯 Custom icon system (@agentscope-ai/icons)
|
|
16
|
+
- 🌐 Internationalization support (Chinese/English)
|
|
17
|
+
- 📝 Full TypeScript type support
|
|
18
|
+
- 🎨 CSS-in-JS styling solution (antd-style)
|
|
19
|
+
|
|
20
|
+
## 📦 Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Using npm
|
|
24
|
+
npm install @agentscope-ai/design antd --save
|
|
25
|
+
|
|
26
|
+
# Using pnpm
|
|
27
|
+
pnpm add @agentscope-ai/design antd
|
|
28
|
+
|
|
29
|
+
# Using yarn
|
|
30
|
+
yarn add @agentscope-ai/design antd
|
|
48
31
|
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
BizAlert -> BLAlert
|
|
56
|
-
BizBreadcrumb -> BLBreadcrumb
|
|
57
|
-
BizDragList -> -
|
|
58
|
-
BizDrawer -> BLDrawer
|
|
59
|
-
BizDropMenu -> BLDropMenu
|
|
60
|
-
BizEmpty -> BLEmpty
|
|
61
|
-
BizForm -> Form
|
|
62
|
-
BizIdIcon -> BLIDIcon
|
|
63
|
-
BizLoadingIcon -> BLLoadingIcon
|
|
64
|
-
BizModal -> Modal
|
|
65
|
-
BizPopConfirm -> Popconfirm
|
|
66
|
-
BizPopover -> BLPopover
|
|
67
|
-
BizSearch -> Search
|
|
68
|
-
BizSelect -> Select
|
|
69
|
-
BizSliderSelector -> SliderSelector
|
|
70
|
-
BizTabs -> Tabs
|
|
71
|
-
BizTag -> Tag
|
|
72
|
-
BizTourGuide -> TourGuide
|
|
73
|
-
BizTriggerModal -> TriggerModal
|
|
74
|
-
BizUpload -> Upload
|
|
75
|
-
|
|
76
|
-
为了让所有 antd 组件使用 Spark Design 的自定义图标,需要在项目的 `package.json` 中添加 overrides 配置:
|
|
32
|
+
|
|
33
|
+
## 🚀 Quick Start
|
|
34
|
+
|
|
35
|
+
### 1. Configure Icon Overrides
|
|
36
|
+
|
|
37
|
+
To make all antd components use Spark Design's custom icons, add the overrides configuration to your project's `package.json`:
|
|
77
38
|
|
|
78
39
|
```json
|
|
79
40
|
{
|
|
80
|
-
"name": "your-project",
|
|
81
41
|
"dependencies": {
|
|
82
|
-
"@
|
|
83
|
-
"antd": "^5.
|
|
42
|
+
"@agentscope-ai/design": "^1.0.0",
|
|
43
|
+
"antd": "^5.18.0"
|
|
84
44
|
},
|
|
85
45
|
"pnpm": {
|
|
86
46
|
"overrides": {
|
|
87
47
|
"@ant-design/icons": "@agentscope-ai/icons-override-antd"
|
|
88
48
|
}
|
|
49
|
+
},
|
|
50
|
+
"overrides": {
|
|
51
|
+
"@ant-design/icons": "@agentscope-ai/icons-override-antd"
|
|
89
52
|
}
|
|
90
53
|
}
|
|
91
54
|
```
|
|
92
55
|
|
|
93
|
-
|
|
56
|
+
After configuration, **delete existing dependencies and reinstall**:
|
|
94
57
|
|
|
95
58
|
```bash
|
|
96
|
-
# 清理现有依赖
|
|
97
59
|
rm -rf node_modules
|
|
98
60
|
rm -f package-lock.json pnpm-lock.yaml yarn.lock
|
|
99
|
-
|
|
100
|
-
# 重新安装
|
|
101
|
-
npm install # 或 pnpm install
|
|
61
|
+
npm install # or pnpm install
|
|
102
62
|
```
|
|
103
63
|
|
|
104
|
-
###
|
|
105
|
-
|
|
106
|
-
配置完成后,所有 antd 组件都会自动使用自定义图标:
|
|
64
|
+
### 2. Use Components
|
|
107
65
|
|
|
108
|
-
```
|
|
109
|
-
import {
|
|
110
|
-
import { BLSelect, BLButton, BLModal } from '@ali/agentscope-ai-design';
|
|
66
|
+
```tsx
|
|
67
|
+
import { ConfigProvider, Button, Modal, carbonTheme } from '@agentscope-ai/design';
|
|
111
68
|
|
|
112
69
|
function App() {
|
|
113
70
|
return (
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{ value: 'option2', label: 'Option 2' },
|
|
121
|
-
]}
|
|
122
|
-
/>
|
|
123
|
-
<Input.Password placeholder="密码输入" />
|
|
124
|
-
|
|
125
|
-
{/* Spark Design 封装组件,内置更多功能 */}
|
|
126
|
-
<BLSelect placeholder="封装选择器" />
|
|
127
|
-
<BLButton type="primary">封装按钮</BLButton>
|
|
128
|
-
</div>
|
|
71
|
+
<ConfigProvider {...carbonTheme}>
|
|
72
|
+
<Button type="primary">Button</Button>
|
|
73
|
+
<Modal title="Title" open={false}>
|
|
74
|
+
Content
|
|
75
|
+
</Modal>
|
|
76
|
+
</ConfigProvider>
|
|
129
77
|
);
|
|
130
78
|
}
|
|
131
79
|
```
|
|
132
80
|
|
|
133
|
-
##
|
|
134
|
-
|
|
135
|
-
### 🎨 原生 antd 组件
|
|
136
|
-
从 antd 直接导出,通过 overrides 配置使用自定义图标:
|
|
137
|
-
- `Alert`, `Badge`, `Button`, `Checkbox`, `Input`, `Modal`, `Select` 等
|
|
138
|
-
|
|
139
|
-
### 🔧 Spark 封装组件
|
|
140
|
-
基于 antd 封装,提供额外功能和样式:
|
|
141
|
-
- `BLSelect`, `BLButton`, `BLModal`, `BLForm`, `BLTable` 等
|
|
81
|
+
## 📂 Directory Structure
|
|
142
82
|
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
83
|
+
```
|
|
84
|
+
spark-design/
|
|
85
|
+
├── src/
|
|
86
|
+
│ ├── antd/ # antd related configurations
|
|
87
|
+
│ │ ├── styles/ # Component style overrides
|
|
88
|
+
│ │ └── themes/ # Theme configurations
|
|
89
|
+
│ │ ├── bailianTheme.json # Bailian theme (light)
|
|
90
|
+
│ │ ├── bailianDarkTheme.json # Bailian theme (dark)
|
|
91
|
+
│ │ ├── carbonTheme.json # Carbon theme (light)
|
|
92
|
+
│ │ └── carbonDarkTheme.json # Carbon theme (dark)
|
|
93
|
+
│ ├── components/
|
|
94
|
+
│ │ ├── commonComponents/ # Common components (50+)
|
|
95
|
+
│ │ │ ├── Alert/
|
|
96
|
+
│ │ │ ├── Button/
|
|
97
|
+
│ │ │ ├── Modal/
|
|
98
|
+
│ │ │ └── ...
|
|
99
|
+
│ │ └── mobileComponents/ # Mobile components
|
|
100
|
+
│ │ ├── MobileModal/
|
|
101
|
+
│ │ ├── MobileDrawer/
|
|
102
|
+
│ │ └── MobileAlertDialog/
|
|
103
|
+
│ ├── hooks/ # Public Hooks
|
|
104
|
+
│ │ └── useGlobalStyle/
|
|
105
|
+
│ ├── libs/ # Utility library
|
|
106
|
+
│ │ ├── requestPop/ # POP request wrapper
|
|
107
|
+
│ │ ├── requestSse/ # SSE request wrapper
|
|
108
|
+
│ │ └── ...
|
|
109
|
+
│ ├── i18n/ # Internationalization
|
|
110
|
+
│ └── index.ts # Entry file
|
|
111
|
+
├── docs/ # Documentation
|
|
112
|
+
└── package.json
|
|
113
|
+
```
|
|
147
114
|
|
|
148
|
-
##
|
|
115
|
+
## 🎨 Theme System
|
|
149
116
|
|
|
150
|
-
###
|
|
117
|
+
### Preset Themes
|
|
151
118
|
|
|
152
|
-
|
|
119
|
+
```tsx
|
|
120
|
+
import {
|
|
121
|
+
ConfigProvider,
|
|
122
|
+
carbonTheme, // Carbon light theme
|
|
123
|
+
carbonDarkTheme, // Carbon dark theme
|
|
124
|
+
bailianTheme, // Bailian light theme
|
|
125
|
+
bailianDarkTheme, // Bailian dark theme
|
|
126
|
+
} from '@agentscope-ai/design';
|
|
153
127
|
|
|
154
|
-
|
|
128
|
+
// Use Carbon theme
|
|
129
|
+
<ConfigProvider {...carbonTheme}>
|
|
130
|
+
<App />
|
|
131
|
+
</ConfigProvider>
|
|
155
132
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"@ant-design/icons": "@agentscope-ai/icons-override-antd"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
133
|
+
// Use Bailian dark theme
|
|
134
|
+
<ConfigProvider {...bailianDarkTheme}>
|
|
135
|
+
<App />
|
|
136
|
+
</ConfigProvider>
|
|
163
137
|
```
|
|
164
138
|
|
|
165
|
-
|
|
166
|
-
```json
|
|
167
|
-
{
|
|
168
|
-
"pnpm": {
|
|
169
|
-
"overrides": {
|
|
170
|
-
"@ant-design/icons": "@agentscope-ai/icons-override-antd"
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
- ✅ **yarn**: 使用 `overrides` 字段
|
|
139
|
+
### Custom Theme
|
|
177
140
|
|
|
178
|
-
|
|
141
|
+
```tsx
|
|
142
|
+
import { generateThemeByToken } from '@agentscope-ai/design';
|
|
179
143
|
|
|
180
|
-
|
|
144
|
+
const customTheme = generateThemeByToken({
|
|
145
|
+
colorPrimary: '#1890ff',
|
|
146
|
+
borderRadius: 6,
|
|
147
|
+
// ... more tokens
|
|
148
|
+
});
|
|
149
|
+
```
|
|
181
150
|
|
|
182
|
-
|
|
151
|
+
## 📦 Component List
|
|
152
|
+
|
|
153
|
+
### Common Components
|
|
154
|
+
|
|
155
|
+
| Component | Description |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `Button` | Button |
|
|
158
|
+
| `Modal` | Modal dialog |
|
|
159
|
+
| `Drawer` | Drawer panel |
|
|
160
|
+
| `Input` | Input field |
|
|
161
|
+
| `Select` | Select dropdown |
|
|
162
|
+
| `Form` | Form |
|
|
163
|
+
| `Table` | Table |
|
|
164
|
+
| `Tabs` | Tabs |
|
|
165
|
+
| `Tag` | Tag |
|
|
166
|
+
| `Tooltip` | Tooltip |
|
|
167
|
+
| `Popover` | Popover card |
|
|
168
|
+
| `Popconfirm` | Popconfirm |
|
|
169
|
+
| `message` | Global message |
|
|
170
|
+
| `notification` | Notification |
|
|
171
|
+
| `Empty` | Empty state |
|
|
172
|
+
| `Spinner` | Loading spinner |
|
|
173
|
+
| `Progress` | Progress bar |
|
|
174
|
+
| `Steps` | Steps |
|
|
175
|
+
| `Pagination` | Pagination |
|
|
176
|
+
| `Breadcrumb` | Breadcrumb |
|
|
177
|
+
| `Dropdown` | Dropdown menu |
|
|
178
|
+
| `Checkbox` | Checkbox |
|
|
179
|
+
| `Radio` | Radio |
|
|
180
|
+
| `RadioButton` | Radio button group |
|
|
181
|
+
| `Switch` | Switch toggle |
|
|
182
|
+
| `Slider` | Slider |
|
|
183
|
+
| `DatePicker` | Date picker |
|
|
184
|
+
| `TimePicker` | Time picker |
|
|
185
|
+
| `Upload` | Upload |
|
|
186
|
+
| `Avatar` | Avatar |
|
|
187
|
+
| `Badge` | Badge |
|
|
188
|
+
| `Card` | Card |
|
|
189
|
+
| `Collapse` | Collapse panel |
|
|
190
|
+
| `Descriptions` | Description list |
|
|
191
|
+
| `Result` | Result page |
|
|
192
|
+
| `Statistic` | Statistic |
|
|
193
|
+
| `Alert` | Alert |
|
|
194
|
+
| `AlertDialog` | Alert dialog |
|
|
195
|
+
| `CodeBlock` | Code block |
|
|
196
|
+
| `IconButton` | Icon button |
|
|
197
|
+
| `EllipsisTip` | Text ellipsis tip |
|
|
198
|
+
| `HelpIcon` | Help icon |
|
|
199
|
+
| `FileIcon` | File icon |
|
|
200
|
+
| `Video` | Video player |
|
|
201
|
+
|
|
202
|
+
### Mobile Components
|
|
203
|
+
|
|
204
|
+
| Component | Description |
|
|
205
|
+
| --- | --- |
|
|
206
|
+
| `MobileModal` | Mobile modal dialog |
|
|
207
|
+
| `MobileDrawer` | Mobile drawer |
|
|
208
|
+
| `MobileAlertDialog` | Mobile alert dialog |
|
|
209
|
+
|
|
210
|
+
### Hooks
|
|
211
|
+
|
|
212
|
+
| Hook | Description |
|
|
213
|
+
| --- | --- |
|
|
214
|
+
| `useGlobalStyle` | Global style hook |
|
|
215
|
+
|
|
216
|
+
### Utility Functions
|
|
217
|
+
|
|
218
|
+
| Function | Description |
|
|
219
|
+
| --- | --- |
|
|
220
|
+
| `requestPop` | Alibaba Cloud POP request wrapper |
|
|
221
|
+
| `requestPopSse` | POP SSE request wrapper |
|
|
222
|
+
| `requestSse` | SSE request wrapper |
|
|
223
|
+
| `delay` | Delay function |
|
|
224
|
+
| `copy` | Copy to clipboard |
|
|
225
|
+
| `waitForDom` | Wait for DOM element |
|
|
226
|
+
| `waitForFunc` | Wait for function execution |
|
|
227
|
+
| `safeHtml` | Safe HTML processing |
|
|
228
|
+
| `base64Encoder` | Base64 encoder |
|
|
229
|
+
| `base64Decoder` | Base64 decoder |
|
|
230
|
+
| `parseJsonSafely` | Safe JSON parser |
|
|
231
|
+
|
|
232
|
+
## 🛠 Configuration
|
|
233
|
+
|
|
234
|
+
### Package Manager Compatibility
|
|
235
|
+
|
|
236
|
+
- ✅ **npm**: Use `overrides` field
|
|
237
|
+
- ✅ **pnpm**: Use `pnpm.overrides` field
|
|
238
|
+
- ✅ **yarn**: Use `resolutions` field
|
|
239
|
+
|
|
240
|
+
It's recommended to configure both `overrides` and `pnpm.overrides` to ensure compatibility across different package managers.
|
|
241
|
+
|
|
242
|
+
### TypeScript Support
|
|
243
|
+
|
|
244
|
+
If you encounter type errors, add path mapping in `tsconfig.json`:
|
|
183
245
|
|
|
184
246
|
```json
|
|
185
247
|
{
|
|
@@ -191,63 +253,60 @@ Spark Design 使用自定义的图标包 `@agentscope-ai/icons-override-antd`
|
|
|
191
253
|
}
|
|
192
254
|
```
|
|
193
255
|
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
-
使用 Lightning 工具时,需要在 lightning.config.mts 文件中配置:
|
|
256
|
+
### Vite Configuration
|
|
197
257
|
|
|
198
258
|
```javascript
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
__dirname,
|
|
205
|
-
'./node_modules/@agentscope-ai/icons-override-antd',
|
|
206
|
-
)
|
|
207
|
-
}
|
|
259
|
+
// vite.config.js
|
|
260
|
+
export default {
|
|
261
|
+
resolve: {
|
|
262
|
+
alias: {
|
|
263
|
+
'@ant-design/icons': '@agentscope-ai/icons-override-antd'
|
|
208
264
|
}
|
|
209
265
|
}
|
|
210
266
|
}
|
|
211
267
|
```
|
|
212
268
|
|
|
213
|
-
###
|
|
214
|
-
|
|
215
|
-
某些 Vite 版本可能需要额外的 alias 配置:
|
|
269
|
+
### Lightning Configuration
|
|
216
270
|
|
|
217
271
|
```javascript
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
272
|
+
// lightning.config.mts
|
|
273
|
+
{
|
|
274
|
+
build: {
|
|
275
|
+
resolve: {
|
|
276
|
+
alias: {
|
|
277
|
+
'@ant-design/icons': path.resolve(
|
|
278
|
+
__dirname,
|
|
279
|
+
'./node_modules/@agentscope-ai/icons-override-antd',
|
|
280
|
+
)
|
|
281
|
+
}
|
|
223
282
|
}
|
|
224
283
|
}
|
|
225
284
|
}
|
|
226
285
|
```
|
|
227
286
|
|
|
228
|
-
## 🔧
|
|
287
|
+
## 🔧 Troubleshooting
|
|
229
288
|
|
|
230
|
-
###
|
|
289
|
+
### Icons not displaying correctly?
|
|
231
290
|
|
|
232
|
-
1.
|
|
233
|
-
2.
|
|
234
|
-
3.
|
|
235
|
-
4.
|
|
291
|
+
1. **Check configuration**: Verify the overrides configuration in `package.json`
|
|
292
|
+
2. **Clean dependencies**: Delete `node_modules` and lock files, then reinstall
|
|
293
|
+
3. **Check version**: Ensure you're using a compatible antd version (^5.18.0)
|
|
294
|
+
4. **Build tools**: Check if additional alias configuration is needed
|
|
236
295
|
|
|
237
|
-
###
|
|
296
|
+
### Inconsistent behavior between development and production?
|
|
238
297
|
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
298
|
+
This is usually a caching issue. Try:
|
|
299
|
+
- Clearing build cache
|
|
300
|
+
- Adding alias configuration for your build tool
|
|
301
|
+
- Ensuring overrides configuration works in all environments
|
|
243
302
|
|
|
244
|
-
## 📖
|
|
303
|
+
## 📖 Changelog
|
|
245
304
|
|
|
246
|
-
|
|
305
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version updates.
|
|
247
306
|
|
|
248
|
-
## 🤝
|
|
307
|
+
## 🤝 Contributing
|
|
249
308
|
|
|
250
|
-
|
|
309
|
+
Issues and Pull Requests are welcome!
|
|
251
310
|
|
|
252
311
|
## 📄 License
|
|
253
312
|
|