@ant-design/agentic-ui 2.29.15 → 2.29.16
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 +93 -205
- package/dist/Bubble/List/PureBubbleList.js +2 -4
- package/dist/Components/LayoutHeader/index.js +1 -1
- package/dist/Hooks/useLanguage.d.ts +2 -0
- package/dist/I18n/locales.d.ts +2 -0
- package/dist/I18n/locales.js +4 -0
- package/dist/MarkdownEditor/editor/parser/parse/parseHtml.js +11 -3
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.d.ts +8 -0
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +206 -144
- package/dist/MarkdownEditor/editor/plugins/elements.js +8 -2
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.d.ts +1 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.js +4 -3
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +1 -2
- package/dist/MarkdownInputField/MarkdownInputField.js +4 -2
- package/dist/MarkdownInputField/SendActions/index.d.ts +2 -0
- package/dist/MarkdownInputField/SendActions/index.js +5 -3
- package/dist/MarkdownInputField/SendButton/index.d.ts +4 -0
- package/dist/MarkdownInputField/SendButton/index.js +3 -3
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.d.ts +1 -1
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.js +23 -10
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +3 -3
- package/dist/MarkdownInputField/utils/renderHelpers.d.ts +1 -1
- package/dist/MarkdownInputField/utils/renderHelpers.js +3 -1
- package/dist/Workspace/Browser/index.d.ts +4 -0
- package/dist/Workspace/Browser/index.js +25 -7
- package/dist/Workspace/File/style.js +4 -1
- package/guidelines/Guidelines.md +31 -0
- package/guidelines/components/bubble.md +41 -0
- package/guidelines/components/chat-layout.md +45 -0
- package/guidelines/components/input.md +52 -0
- package/guidelines/components/loading.md +33 -0
- package/guidelines/components/markdown-editor.md +30 -0
- package/guidelines/components/robot.md +26 -0
- package/guidelines/components/task-list.md +22 -0
- package/guidelines/components/thought-chain.md +30 -0
- package/guidelines/components/tool-use-bar.md +22 -0
- package/guidelines/components/welcome-message.md +27 -0
- package/guidelines/components/workspace.md +63 -0
- package/guidelines/design-tokens/colors.md +51 -0
- package/guidelines/design-tokens/spacing.md +29 -0
- package/guidelines/design-tokens/typography.md +46 -0
- package/guidelines/overview-components.md +30 -0
- package/guidelines/overview-icons.md +15 -0
- package/package.json +5 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Color design tokens
|
|
2
|
+
|
|
3
|
+
The project uses a comprehensive system of CSS variables for colors, following the pattern: `--color-{hue}-{role}-{state}`.
|
|
4
|
+
|
|
5
|
+
## Naming pattern
|
|
6
|
+
|
|
7
|
+
- **Hue**: `primary`, `gray`, `blue`, `red`, `green`, `gold`
|
|
8
|
+
- **Role**: `bg-page`, `bg-card`, `control-fill`, `text`, `border`
|
|
9
|
+
- **State** (optional): `hover`, `active`, `disabled`, `light`, `dark`
|
|
10
|
+
|
|
11
|
+
## Common Tokens
|
|
12
|
+
|
|
13
|
+
### Primary (Brand)
|
|
14
|
+
Used for primary actions, active states, and brand elements.
|
|
15
|
+
- `--color-primary-bg-page-light`
|
|
16
|
+
- `--color-primary-control-fill-primary` (Primary button bg)
|
|
17
|
+
- `--color-primary-text-default`
|
|
18
|
+
- `--color-primary-border-light`
|
|
19
|
+
|
|
20
|
+
### Gray (Neutral)
|
|
21
|
+
Used for text, backgrounds, and borders.
|
|
22
|
+
- `--color-gray-bg-page`
|
|
23
|
+
- `--color-gray-bg-card-light`
|
|
24
|
+
- `--color-gray-text-default` (Main text)
|
|
25
|
+
- `--color-gray-text-secondary` (Secondary text)
|
|
26
|
+
- `--color-gray-border-light`
|
|
27
|
+
|
|
28
|
+
### Functional Colors
|
|
29
|
+
- **Blue**: Info / Action (`--color-blue-text-default`)
|
|
30
|
+
- **Red**: Error / Danger (`--color-red-text-default`, `--color-red-bg-tip`)
|
|
31
|
+
- **Green**: Success (`--color-green-text-default`)
|
|
32
|
+
|
|
33
|
+
## Usage Examples
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
.my-card {
|
|
37
|
+
background: var(--color-gray-bg-card-light);
|
|
38
|
+
border: 1px solid var(--color-gray-border-light);
|
|
39
|
+
color: var(--color-gray-text-default);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.my-button {
|
|
43
|
+
background: var(--color-primary-control-fill-primary);
|
|
44
|
+
color: #fff;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Best Practices
|
|
49
|
+
- Always use CSS variables instead of hex codes.
|
|
50
|
+
- Use `text-default` for primary text and `text-secondary` for less important info.
|
|
51
|
+
- Use `bg-card` for containers and `bg-page` for the main background.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Spacing design tokens
|
|
2
|
+
|
|
3
|
+
The spacing system is based on a 4px unit.
|
|
4
|
+
|
|
5
|
+
## Tokens
|
|
6
|
+
|
|
7
|
+
| Token | Value | Pixel |
|
|
8
|
+
|-------|-------|-------|
|
|
9
|
+
| `--padding-0-25x` | 0.25 unit | 1px |
|
|
10
|
+
| `--padding-0-5x` | 0.5 unit | 2px |
|
|
11
|
+
| `--padding-1x` | 1 unit | 4px |
|
|
12
|
+
| `--padding-2x` | 2 units | 8px |
|
|
13
|
+
| `--padding-3x` | 3 units | 12px |
|
|
14
|
+
| `--padding-4x` | 4 units | 16px |
|
|
15
|
+
| `--padding-5x` | 5 units | 20px |
|
|
16
|
+
| `--padding-6x` | 6 units | 24px |
|
|
17
|
+
| `--padding-8x` | 8 units | 32px |
|
|
18
|
+
| `--padding-12x` | 12 units | 48px |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Use these tokens for `padding`, `margin`, `gap`, and other spacing properties.
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
.container {
|
|
26
|
+
padding: var(--padding-4x); /* 16px */
|
|
27
|
+
gap: var(--padding-2x); /* 8px */
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Typography design tokens
|
|
2
|
+
|
|
3
|
+
The project uses a comprehensive set of typography tokens that combine font-weight, font-size, and line-height.
|
|
4
|
+
|
|
5
|
+
## Naming Pattern
|
|
6
|
+
`--font-text-{category}-{variant}-{size}`
|
|
7
|
+
|
|
8
|
+
- **Category**: `body`, `paragraph`, `h1`-`h6`, `code`, `number`
|
|
9
|
+
- **Variant** (optional): `emphasized`
|
|
10
|
+
- **Size**: `xs`, `sm`, `base`, `lg`, `xl`, ...
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```css
|
|
15
|
+
.my-text {
|
|
16
|
+
font: var(--font-text-body-base);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.my-heading {
|
|
20
|
+
font: var(--font-text-h1-base);
|
|
21
|
+
color: var(--color-gray-text-default);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Available Tokens
|
|
26
|
+
|
|
27
|
+
### Body
|
|
28
|
+
Used for short text, UI labels.
|
|
29
|
+
- `--font-text-body-sm`
|
|
30
|
+
- `--font-text-body-base`
|
|
31
|
+
- `--font-text-body-lg`
|
|
32
|
+
- `--font-text-body-emphasized-base`
|
|
33
|
+
|
|
34
|
+
### Paragraph
|
|
35
|
+
Used for long-form text.
|
|
36
|
+
- `--font-text-paragraph-base`
|
|
37
|
+
- `--font-text-paragraph-lg`
|
|
38
|
+
|
|
39
|
+
### Headings
|
|
40
|
+
- `--font-text-h1-base`
|
|
41
|
+
- `--font-text-h2-base`
|
|
42
|
+
- ...
|
|
43
|
+
- `--font-text-h6-base`
|
|
44
|
+
|
|
45
|
+
### Code
|
|
46
|
+
- `--font-text-code-base`
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## Components
|
|
2
|
+
|
|
3
|
+
Always prefer components from `@ant-design/agentic-ui` if they are available. This library is built on top of Ant Design (`antd`), so standard Ant Design components can also be used when no specific agentic component exists.
|
|
4
|
+
|
|
5
|
+
Here are the guidelines files for the core Agentic UI components:
|
|
6
|
+
|
|
7
|
+
| Component | Overview | Guidelines file | Source Path |
|
|
8
|
+
|----------|----------|----------|----------|
|
|
9
|
+
| Bubble | Chat message bubbles (User/AI) | [bubble.md](components/bubble.md) | `src/Bubble/index.tsx` |
|
|
10
|
+
| ChatLayout | Main layout for chat interfaces | [chat-layout.md](components/chat-layout.md) | `src/ChatLayout/index.tsx` |
|
|
11
|
+
| Loading | Loading indicator and spinner | [loading.md](components/loading.md) | `src/Components/Loading/index.tsx` |
|
|
12
|
+
| MarkdownEditor | Rich text editor for chat input | [markdown-editor.md](components/markdown-editor.md) | `src/MarkdownEditor/index.tsx` |
|
|
13
|
+
| MarkdownInputField | Chat input field | [input.md](components/input.md) | `src/MarkdownInputField/MarkdownInputField.tsx` |
|
|
14
|
+
| Robot | Robot avatar with states | [robot.md](components/robot.md) | `src/Components/Robot/index.tsx` |
|
|
15
|
+
| ThoughtChainList | Visualization for reasoning steps | [thought-chain.md](components/thought-chain.md) | `src/ThoughtChainList/index.tsx` |
|
|
16
|
+
| ToolUseBar | Display for tool usage/calls | [tool-use-bar.md](components/tool-use-bar.md) | `src/ToolUseBar/index.tsx` |
|
|
17
|
+
| TaskList | List of tasks/steps | [task-list.md](components/task-list.md) | `src/TaskList/index.tsx` |
|
|
18
|
+
| WelcomeMessage | Initial welcome screen | [welcome-message.md](components/welcome-message.md) | `src/WelcomeMessage/index.tsx` |
|
|
19
|
+
| Workspace | Multi-tab workspace (Browser, File, Task) | [workspace.md](components/workspace.md) | `src/Workspace/index.tsx` |
|
|
20
|
+
|
|
21
|
+
## General Component Usage and Best Practices
|
|
22
|
+
|
|
23
|
+
### Styling
|
|
24
|
+
- The project uses `@ant-design/cssinjs` and `antd` tokens.
|
|
25
|
+
- Avoid inline styles. Use `createStyles` or `style.ts` files.
|
|
26
|
+
|
|
27
|
+
### Common Patterns
|
|
28
|
+
- **Bubbles**: Used for the main conversation flow.
|
|
29
|
+
- **ThoughtChain**: Used to show the "thinking" process of the agent.
|
|
30
|
+
- **Markdown**: Both input and output often involve Markdown.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Icon Library
|
|
2
|
+
|
|
3
|
+
This project primarily uses icons from `@ant-design/icons`.
|
|
4
|
+
It also contains some custom animated icons in `src/Icons`.
|
|
5
|
+
|
|
6
|
+
### Ant Design Icons
|
|
7
|
+
Import icons from `@ant-design/icons`.
|
|
8
|
+
Example:
|
|
9
|
+
```typescript
|
|
10
|
+
import { UserOutlined, RobotOutlined } from '@ant-design/icons';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Custom Icons & Lotties
|
|
14
|
+
Some specific animated icons (Lotties) are available for voice or loading states.
|
|
15
|
+
Check `src/Icons` and `src/Components/icons` for special cases.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.29.
|
|
3
|
+
"version": "2.29.16",
|
|
4
4
|
"description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
|
|
5
5
|
"repository": "git@github.com:ant-design/agentic-ui.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"module": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"guidelines"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "father build",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"test:e2e:debug": "playwright test --debug",
|
|
34
35
|
"test:e2e:skip-server": "cross-env SKIP_WEBSERVER=1 playwright test",
|
|
35
36
|
"test:e2e:ui": "playwright test --ui",
|
|
37
|
+
"bench:parsemd": "vitest --run tests/editor/parseMd.benchmark.test.ts",
|
|
36
38
|
"tsc": "tsc --noEmit"
|
|
37
39
|
},
|
|
38
40
|
"lint-staged": {
|
|
@@ -126,6 +128,7 @@
|
|
|
126
128
|
"unist-util-visit": "^5.0.0"
|
|
127
129
|
},
|
|
128
130
|
"devDependencies": {
|
|
131
|
+
"@mlc-ai/web-llm": "^0.2.80",
|
|
129
132
|
"@playwright/test": "^1.57.0",
|
|
130
133
|
"@swc/core": "^1.15.8",
|
|
131
134
|
"@testing-library/jest-dom": "^6.9.1",
|