@digitalsee-ai/rcs 1.0.0 → 1.0.2
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 +40 -208
- package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/api/dip.d.ts +1 -1
- package/dist/components/digitalsee/workflow/api/dip.types.d.ts +1 -1
- package/dist/components/digitalsee/workflow/api/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -1
- package/dist/components/digitalsee/workflow/index.d.ts +18 -11
- package/dist/components/digitalsee/workflow/types/engine.d.ts +9 -2
- package/dist/components/digitalsee/workflow/utils/mergeConfig.d.ts +3 -6
- package/dist/components/dynamic-form/fields/complex/ArrayObjectField.d.ts +2 -1
- package/dist/components/dynamic-form/types/form-schema.d.ts +14 -2
- package/dist/rcs.css +1 -1
- package/dist/rcs.es.js +11497 -11236
- package/dist/rcs.es.js.map +1 -1
- package/dist/rcs.umd.js +54 -54
- package/dist/rcs.umd.js.map +1 -1
- package/package.json +25 -23
- package/dist/postcss.config.js +0 -1
package/README.md
CHANGED
|
@@ -1,237 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# @digitalsee/rcs
|
|
4
|
-
|
|
5
|
-
**数犀 React 组件库**
|
|
1
|
+
# @digitalsee-ai/rcs
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
为数犀内部提供跨工程运行的React组件服务
|
|
9
|
-
|
|
3
|
+
数犀 React 组件库,当前主要提供工作流画布、DynamicForm 和 JsonRenderer。
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
## 环境要求
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
- Node.js `>= 22`
|
|
8
|
+
- pnpm `10.12.1`
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pnpm add @digitalsee/rcs
|
|
18
|
-
```
|
|
10
|
+
## 安装与使用
|
|
19
11
|
|
|
20
|
-
使用 npm:
|
|
21
12
|
```bash
|
|
22
|
-
|
|
13
|
+
pnpm add @digitalsee-ai/rcs
|
|
23
14
|
```
|
|
24
15
|
|
|
25
|
-
使用 yarn:
|
|
26
|
-
```bash
|
|
27
|
-
yarn add @digitalsee/rcs
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## ✨ 特性
|
|
31
|
-
|
|
32
|
-
- 🎨 **工作流编辑器** - 基于 ReactFlow 的强大可视化工作流编辑器
|
|
33
|
-
- 📊 **数据可视化** - 内置 JSON 渲染器和数据展示组件
|
|
34
|
-
- 🌍 **国际化支持** - 内置中文(简体/繁体)和英文支持
|
|
35
|
-
- 🎯 **TypeScript** - 完整的 TypeScript 类型支持
|
|
36
|
-
- 🔧 **可定制** - 灵活的配置和主题定制
|
|
37
|
-
- ⚡ **高性能** - 优化的渲染性能和内存使用
|
|
38
|
-
- 📱 **响应式** - 适配各种屏幕尺寸
|
|
39
|
-
|
|
40
|
-
## 🚀 快速开始
|
|
41
|
-
|
|
42
|
-
### 基础使用
|
|
43
|
-
|
|
44
16
|
```tsx
|
|
45
|
-
import {
|
|
46
|
-
import '@digitalsee/rcs/styles.css';
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
<Workflow
|
|
51
|
-
workflowId="my-workflow"
|
|
52
|
-
// 更多配置项...
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
17
|
+
import { DigitalseeWorkFlow } from '@digitalsee-ai/rcs';
|
|
18
|
+
import '@digitalsee-ai/rcs/styles.css';
|
|
19
|
+
|
|
20
|
+
export function WorkflowPage() {
|
|
21
|
+
return <DigitalseeWorkFlow workflowId="workflow-id" />;
|
|
55
22
|
}
|
|
56
23
|
```
|
|
57
24
|
|
|
58
|
-
|
|
25
|
+
DynamicForm 示例:
|
|
59
26
|
|
|
60
27
|
```tsx
|
|
61
|
-
import {
|
|
62
|
-
import '@digitalsee/rcs/styles.css';
|
|
28
|
+
import { DynamicForm, DynamicFormField, type FormSchema } from '@digitalsee-ai/rcs';
|
|
29
|
+
import '@digitalsee-ai/rcs/styles.css';
|
|
63
30
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
value: 123
|
|
68
|
-
};
|
|
31
|
+
const schema: FormSchema = {
|
|
32
|
+
fields: [{ type: DynamicFormField.TEXT, name: 'name', label: '名称' }],
|
|
33
|
+
};
|
|
69
34
|
|
|
70
|
-
|
|
35
|
+
export function FormPage() {
|
|
36
|
+
return <DynamicForm schema={schema} />;
|
|
71
37
|
}
|
|
72
38
|
```
|
|
73
39
|
|
|
74
|
-
##
|
|
75
|
-
|
|
76
|
-
### 🔄 Workflow(工作流)
|
|
77
|
-
|
|
78
|
-
完整的可视化工作流编辑器,支持:
|
|
79
|
-
|
|
80
|
-
- ✅ 节点的拖拽和连接
|
|
81
|
-
- ✅ 自定义节点类型
|
|
82
|
-
- ✅ 边的样式和交互
|
|
83
|
-
- ✅ 撤销/重做功能
|
|
84
|
-
- ✅ 小地图导航
|
|
85
|
-
- ✅ 自动布局
|
|
86
|
-
- ✅ 调试面板
|
|
87
|
-
- ✅ 数据持久化
|
|
88
|
-
|
|
89
|
-
**主要特性:**
|
|
90
|
-
- 支持多种节点类型(触发器、动作、条件等)
|
|
91
|
-
- 灵活的节点配置面板
|
|
92
|
-
- 实时数据流调试
|
|
93
|
-
- 节点搜索和筛选
|
|
94
|
-
- 快捷键支持
|
|
95
|
-
|
|
96
|
-
### 📋 JsonRenderer
|
|
97
|
-
|
|
98
|
-
强大的 JSON 数据渲染组件:
|
|
99
|
-
- 语法高亮
|
|
100
|
-
- 可折叠/展开
|
|
101
|
-
- 搜索功能
|
|
102
|
-
- 复制功能
|
|
103
|
-
|
|
104
|
-
## 🔨 开发
|
|
105
|
-
|
|
106
|
-
### 环境要求
|
|
107
|
-
|
|
108
|
-
- Node.js >= 22
|
|
109
|
-
- pnpm >= 10.12.1
|
|
110
|
-
|
|
111
|
-
### 开发命令
|
|
40
|
+
## 开发命令
|
|
112
41
|
|
|
113
42
|
```bash
|
|
114
|
-
# 安装依赖
|
|
115
43
|
pnpm install
|
|
116
|
-
|
|
117
|
-
#
|
|
118
|
-
pnpm
|
|
119
|
-
|
|
120
|
-
#
|
|
121
|
-
pnpm
|
|
122
|
-
|
|
123
|
-
#
|
|
124
|
-
pnpm test
|
|
125
|
-
|
|
126
|
-
# 代码格式化
|
|
127
|
-
pnpm format
|
|
128
|
-
|
|
129
|
-
# 代码检查
|
|
130
|
-
pnpm lint
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### 构建输出
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# 构建并发布新版本
|
|
137
|
-
pnpm update:version
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
构建产物包括:
|
|
141
|
-
- `dist/rcs.es.js` - ES Module 格式
|
|
142
|
-
- `dist/rcs.umd.js` - UMD 格式
|
|
143
|
-
- `dist/rcs.css` - 样式文件
|
|
144
|
-
- `dist/index.d.ts` - TypeScript 类型定义
|
|
145
|
-
|
|
146
|
-
## 🎨 技术栈
|
|
147
|
-
|
|
148
|
-
- **核心框架**: React 19+
|
|
149
|
-
- **状态管理**: Redux Toolkit
|
|
150
|
-
- **流程图**: @xyflow/react
|
|
151
|
-
- **UI 组件**: Ant Design 5+ / Ant Design Pro Components
|
|
152
|
-
- **样式方案**: Tailwind CSS + Less
|
|
153
|
-
- **代码编辑器**: Monaco Editor / CodeMirror
|
|
154
|
-
- **富文本**: Slate.js
|
|
155
|
-
- **构建工具**: Vite
|
|
156
|
-
- **文档工具**: Storybook
|
|
157
|
-
- **代码质量**: Biome
|
|
158
|
-
- **测试框架**: Vitest
|
|
159
|
-
|
|
160
|
-
## 📖 依赖要求
|
|
161
|
-
|
|
162
|
-
### Peer Dependencies
|
|
163
|
-
|
|
164
|
-
确保你的项目中已安装以下依赖:
|
|
165
|
-
|
|
166
|
-
- `react` >= 18.0.0
|
|
167
|
-
- `react-dom` >= 18.0.0
|
|
168
|
-
- `antd` >= 5.0.0
|
|
169
|
-
- `@ant-design/icons` >= 5.0.0
|
|
170
|
-
- `@ant-design/pro-components` >= 2.0.0
|
|
171
|
-
- `@reduxjs/toolkit` >= 2.0.0
|
|
172
|
-
- `react-redux` >= 9.0.0
|
|
173
|
-
- `@xyflow/react` >= 12.0.0
|
|
174
|
-
- `ahooks` >= 3.0.0
|
|
175
|
-
- `lodash-es` >= 4.17.0
|
|
176
|
-
|
|
177
|
-
## 🌐 国际化
|
|
178
|
-
|
|
179
|
-
组件库内置多语言支持:
|
|
180
|
-
|
|
181
|
-
```tsx
|
|
182
|
-
import { IntlProvider } from 'react-intl';
|
|
183
|
-
import zhCN from '@digitalsee/rcs/locales/zh-CN';
|
|
184
|
-
|
|
185
|
-
<IntlProvider locale="zh-CN" messages={zhCN}>
|
|
186
|
-
<Workflow />
|
|
187
|
-
</IntlProvider>
|
|
44
|
+
pnpm dev # Storybook,默认 http://localhost:8888
|
|
45
|
+
pnpm build:lib # tsc + Vite,生成 dist
|
|
46
|
+
pnpm build:vite # 仅 Vite 构建,适合快速联调
|
|
47
|
+
pnpm tsc # 类型检查
|
|
48
|
+
pnpm test # Vitest watch
|
|
49
|
+
pnpm test:cov # 单次运行并生成覆盖率
|
|
50
|
+
pnpm format # Biome 格式化 src
|
|
51
|
+
pnpm lint # Biome lint 并自动修复 src
|
|
188
52
|
```
|
|
189
53
|
|
|
190
|
-
|
|
191
|
-
- 🇨🇳 简体中文 (zh-CN)
|
|
192
|
-
- 🇹🇼 繁体中文 (zh-TW)
|
|
193
|
-
- 🇺🇸 英文 (en-US)
|
|
194
|
-
|
|
195
|
-
## 📝 版本管理
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# 补丁版本 (0.0.x)
|
|
199
|
-
pnpm bump
|
|
200
|
-
|
|
201
|
-
# 次要版本 (0.x.0)
|
|
202
|
-
pnpm bump:minor
|
|
203
|
-
|
|
204
|
-
# 主要版本 (x.0.0)
|
|
205
|
-
pnpm bump:major
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## 🤝 贡献
|
|
209
|
-
|
|
210
|
-
欢迎提交 Issue 和 Pull Request!
|
|
211
|
-
|
|
212
|
-
### 开发流程
|
|
213
|
-
|
|
214
|
-
1. Fork 本仓库
|
|
215
|
-
2. 创建你的特性分支 (`git checkout -b feature/AmazingFeature`)
|
|
216
|
-
3. 提交你的改动 (`git commit -m 'Add some AmazingFeature'`)
|
|
217
|
-
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
|
218
|
-
5. 提交 Pull Request
|
|
219
|
-
|
|
220
|
-
### 代码规范
|
|
221
|
-
|
|
222
|
-
项目使用 Biome 进行代码检查和格式化:
|
|
223
|
-
```bash
|
|
224
|
-
pnpm format # 自动格式化代码
|
|
225
|
-
pnpm lint # 检查代码问题
|
|
226
|
-
```
|
|
54
|
+
`dist/` 是 npm 包实际消费的构建产物。修改源码后,宿主项目不会自动获得更新,需重新构建。
|
|
227
55
|
|
|
56
|
+
## 文档
|
|
228
57
|
|
|
229
|
-
|
|
58
|
+
- [文档索引与维护状态](docs/README.md)
|
|
59
|
+
- [本地联调 npm 包](docs/development/local-package-debugging.md)
|
|
60
|
+
- [工作流组件集成](docs/guides/workflow-integration.md)
|
|
61
|
+
- [发布说明](docs/development/publishing.md)
|
|
230
62
|
|
|
231
|
-
|
|
63
|
+
## 包导出
|
|
232
64
|
|
|
233
|
-
|
|
65
|
+
- `@digitalsee-ai/rcs`:组件、类型与工具
|
|
66
|
+
- `@digitalsee-ai/rcs/styles.css`:组件库样式
|
|
234
67
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
</div>
|
|
68
|
+
构建产物包括 `dist/rcs.es.js`、`dist/rcs.umd.js`、`dist/rcs.css` 和
|
|
69
|
+
`dist/index.d.ts`。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactFlowInstance } from '@xyflow/react';
|
|
2
1
|
import { AppDispatch } from '../../store';
|
|
3
2
|
import { CanvasAPI } from '../../types/engine';
|
|
3
|
+
import { ReactFlowInstance } from '@xyflow/react';
|
|
4
4
|
interface UseCanvasApiParams {
|
|
5
5
|
dispatch: AppDispatch;
|
|
6
6
|
reactFlow: ReactFlowInstance;
|
|
@@ -5,7 +5,7 @@ interface AccountSelectProps {
|
|
|
5
5
|
value?: string | null;
|
|
6
6
|
onChange?: (value: string | undefined) => void;
|
|
7
7
|
linkApp: LinkApp;
|
|
8
|
-
actionAccountSchemaId?: string;
|
|
8
|
+
actionAccountSchemaId?: string | number;
|
|
9
9
|
credentialRequirements?: CredentialRequirementLike[];
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
placeholder?: string;
|
|
@@ -98,7 +98,7 @@ export declare function dipGetNodeSchema(nodeKey: string, version?: number): Pro
|
|
|
98
98
|
* @param request - 节点测试请求参数
|
|
99
99
|
* @returns 节点测试结果(含 outputData、resolvedParams、executionTimeMs)
|
|
100
100
|
* @see POST /api/nodes/test
|
|
101
|
-
* @see
|
|
101
|
+
* @see docs/reference/node-test-api.md
|
|
102
102
|
*/
|
|
103
103
|
export declare function dipTestNode(request: DipNodeTestRequest): Promise<DipNodeTestResult>;
|
|
104
104
|
/**
|
|
@@ -937,7 +937,7 @@ export interface DipPageWorkflowDefinitionEntity {
|
|
|
937
937
|
* 对应后端 {@link NodeTestRequest} record,提交给 `POST /api/nodes/test`。
|
|
938
938
|
* 前端负责管理测试历史和上下文,后端完全无状态,支持集群部署。
|
|
939
939
|
*
|
|
940
|
-
* @see
|
|
940
|
+
* @see docs/reference/node-test-api.md
|
|
941
941
|
*/
|
|
942
942
|
export interface DipNodeTestRequest {
|
|
943
943
|
/** 节点类型标识(必填),如 `"http_request"` */
|
|
@@ -146,7 +146,7 @@ export declare function apiRemoveEdges(flowId: string, edges: string[]): Promise
|
|
|
146
146
|
export declare function apiGetSelectOptions(type: string): Promise<unknown>;
|
|
147
147
|
export declare function updateFlowOpStatus(paramsId: any, opStatus: any): Promise<unknown>;
|
|
148
148
|
export declare function onlineFlow(id: any): Promise<unknown>;
|
|
149
|
-
export declare const apiGetAccountInstanceV2: (linkId?: string | null, actionAccountSchemaId?: string) => Promise<unknown>;
|
|
149
|
+
export declare const apiGetAccountInstanceV2: (linkId?: string | null, actionAccountSchemaId?: string | number) => Promise<unknown>;
|
|
150
150
|
export declare const getAppList: (params: any, formData?: any) => Promise<unknown>;
|
|
151
151
|
export declare const fetchSubFlowList: (name: any, formData?: any) => Promise<unknown>;
|
|
152
152
|
export {};
|
|
@@ -11,7 +11,7 @@ interface GlobalWorkflowConfig {
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```typescript
|
|
14
|
-
* import { configureWorkflow } from 'digitalsee-rcs';
|
|
14
|
+
* import { configureWorkflow } from '@digitalsee-ai/rcs';
|
|
15
15
|
* import axios from 'axios';
|
|
16
16
|
* import { useHistory } from 'react-router-dom';
|
|
17
17
|
*
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { default as defaultCanvasEngineConfig } from './config/defaultCanvasEngineConfig';
|
|
3
|
-
import { CanvasEngineConfig, HistoryNavigator, HttpClient } from './types/engine';
|
|
2
|
+
import { CanvasEngineConfig, DeepPartial, CanvasAPI, HistoryNavigator, HttpClient } from './types/engine';
|
|
4
3
|
import { mergeConfig } from './utils/mergeConfig';
|
|
5
|
-
import { LocaleType } from '../../../locales';
|
|
6
4
|
import { EngineMode } from './enums/workflow';
|
|
5
|
+
import { LocaleType } from '../../../locales';
|
|
7
6
|
/**
|
|
8
7
|
* DigitalseeWorkFlow 组件对外暴露的属性定义
|
|
9
8
|
*
|
|
@@ -46,12 +45,18 @@ export interface DigitalseeWorkFlowProps {
|
|
|
46
45
|
* @param workflow 当前工作流数据
|
|
47
46
|
*/
|
|
48
47
|
onSave?: (workflow: any) => void;
|
|
48
|
+
/**
|
|
49
|
+
* 画布初始化回调
|
|
50
|
+
*
|
|
51
|
+
* @param api 画布对外 API
|
|
52
|
+
*/
|
|
53
|
+
onInit?: (api: CanvasAPI) => void;
|
|
49
54
|
/**
|
|
50
55
|
* 画布配置
|
|
51
56
|
*
|
|
52
57
|
* @description 支持传入局部配置,内部会与默认配置做深度合并
|
|
53
58
|
*/
|
|
54
|
-
config?:
|
|
59
|
+
config?: DeepPartial<CanvasEngineConfig>;
|
|
55
60
|
/**
|
|
56
61
|
* Locale override for workflow translations
|
|
57
62
|
*
|
|
@@ -95,22 +100,24 @@ export interface DigitalseeWorkFlowProps {
|
|
|
95
100
|
*
|
|
96
101
|
* @param props 组件参数
|
|
97
102
|
*/
|
|
98
|
-
declare const DigitalseeWorkFlow:
|
|
99
|
-
export { DigitalseeWorkFlow };
|
|
103
|
+
declare const DigitalseeWorkFlow: (props: DigitalseeWorkFlowProps) => any;
|
|
100
104
|
export type { WorkflowHttpClient } from './api';
|
|
101
|
-
export type { CanvasEngineConfig, HistoryNavigator, HttpClient, } from './types/engine';
|
|
102
|
-
export { EngineMode } from './enums/workflow';
|
|
103
|
-
export { defaultCanvasEngineConfig, mergeConfig };
|
|
104
|
-
export type { LocaleType as WorkflowLocale, TranslateFn as WorkflowTranslateFn, } from '../../../locales';
|
|
105
|
-
export { createTranslator } from '../../../locales';
|
|
106
105
|
export { configureWorkflow, getGlobalWorkflowConfig, resetGlobalWorkflowConfig, } from './config/globalConfig';
|
|
107
106
|
export * from './config/themeConfig';
|
|
107
|
+
export { useCanvasApi } from './context/canvasApiContext';
|
|
108
|
+
export { useCanvasConfig } from './context/canvasConfig';
|
|
108
109
|
export { default as EdgeFactory } from './Edges/EdgeFactory';
|
|
110
|
+
export { NodeStatus, NodeType } from './enums/node';
|
|
111
|
+
export { EngineMode, WorkflowOpStatus } from './enums/workflow';
|
|
109
112
|
export { default as HandleFactory } from './Handles/HandleFactory';
|
|
110
113
|
export { useCanvasLayout } from './hooks/useCanvasLayout';
|
|
111
114
|
export { useUndo } from './hooks/useUndo';
|
|
112
115
|
export { useWorkflow } from './hooks/useWorkflow';
|
|
113
116
|
export { default as NodeFactory } from './Nodes/NodeFactory';
|
|
114
117
|
export * from './types/Edge';
|
|
118
|
+
export type { CanvasAPI, CanvasEngineConfig, DeepPartial, HistoryNavigator, HttpClient, } from './types/engine';
|
|
115
119
|
export * from './types/Node';
|
|
116
120
|
export * from './types/Workflow';
|
|
121
|
+
export type { LocaleType as WorkflowLocale, TranslateFn as WorkflowTranslateFn, } from '../../../locales';
|
|
122
|
+
export { createTranslator } from '../../../locales';
|
|
123
|
+
export { DigitalseeWorkFlow, defaultCanvasEngineConfig, mergeConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactFlow } from '@xyflow/react';
|
|
2
|
-
import { ComponentProps, ReactNode } from 'react';
|
|
3
2
|
import { Rule } from 'antd/es/form';
|
|
4
|
-
import {
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
import { EngineMode, WorkflowOpStatus } from '../enums/workflow';
|
|
5
5
|
export type HttpClient = <T = any>(url: string, config: any) => Promise<T>;
|
|
6
6
|
export interface HistoryNavigator {
|
|
7
7
|
push(path: string, state?: any): void;
|
|
@@ -11,6 +11,9 @@ export interface HistoryNavigator {
|
|
|
11
11
|
goForward(): void;
|
|
12
12
|
listen?(listener: (location: any, action: any) => void): () => void;
|
|
13
13
|
}
|
|
14
|
+
export type DeepPartial<T> = {
|
|
15
|
+
[P in keyof T]?: T[P] extends (...args: any[]) => any ? T[P] : T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
16
|
+
};
|
|
14
17
|
export interface CanvasEngineConfig {
|
|
15
18
|
flowId: string;
|
|
16
19
|
engineMode?: EngineMode;
|
|
@@ -58,6 +61,7 @@ export interface CanvasCoreConfig {
|
|
|
58
61
|
}
|
|
59
62
|
export interface NodeTypesRegistryConfig {
|
|
60
63
|
types: Record<string, NodeTypeConfig>;
|
|
64
|
+
nodeBlackList?: string[];
|
|
61
65
|
fixed?: {
|
|
62
66
|
triggers?: string[];
|
|
63
67
|
finalAction?: string;
|
|
@@ -148,6 +152,8 @@ export interface ToolbarButtonConfig {
|
|
|
148
152
|
icon?: ReactNode;
|
|
149
153
|
style?: Record<string, any>;
|
|
150
154
|
type?: 'link' | 'text' | 'default' | 'primary' | 'dashed';
|
|
155
|
+
danger?: boolean;
|
|
156
|
+
loading?: boolean;
|
|
151
157
|
onClick?: (ctx: CanvasAPI) => void;
|
|
152
158
|
}
|
|
153
159
|
export interface NodeConfigPanelConfig {
|
|
@@ -190,6 +196,7 @@ export interface CanvasAPI {
|
|
|
190
196
|
init(): void;
|
|
191
197
|
destroy(): void;
|
|
192
198
|
refresh(): void;
|
|
199
|
+
setFlowOpStatus(status: WorkflowOpStatus): void;
|
|
193
200
|
getData(): FlowData;
|
|
194
201
|
setData(flow: FlowData): void;
|
|
195
202
|
exportJSON(): any;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* mergeConfig - Deep merge helper for CanvasEngineConfig
|
|
3
|
-
* 支持深度合并、数组自定义合并策略、对象合并、函数覆盖
|
|
4
|
-
*/
|
|
1
|
+
import { DeepPartial } from '../types/engine';
|
|
5
2
|
type MergeArrayStrategy = 'append' | 'override' | 'mergeById';
|
|
6
3
|
/**
|
|
7
4
|
* merge options
|
|
@@ -13,10 +10,10 @@ export interface MergeConfigOptions {
|
|
|
13
10
|
/**
|
|
14
11
|
* Deep merge core function
|
|
15
12
|
*/
|
|
16
|
-
export declare function mergeDeep<T>(target:
|
|
13
|
+
export declare function mergeDeep<T>(target: T | DeepPartial<T>, source: DeepPartial<T>, options?: MergeConfigOptions): T;
|
|
17
14
|
/**
|
|
18
15
|
* 业务常用:合并 CanvasEngineConfig
|
|
19
16
|
* mergeConfig(defaultConfig, customConfig)
|
|
20
17
|
*/
|
|
21
|
-
export declare function mergeConfig<T>(base: T, override:
|
|
18
|
+
export declare function mergeConfig<T>(base: T, override: DeepPartial<T>, options?: MergeConfigOptions): T;
|
|
22
19
|
export default mergeConfig;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { FieldDef } from '../../types/form-schema';
|
|
2
|
+
export declare const ArrayObjectField: import('../../types/field-component').FieldComponentDefinition<FieldDef>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ValidationRule } from './validation';
|
|
2
1
|
import { EventConfig } from './events';
|
|
2
|
+
import { ValidationRule } from './validation';
|
|
3
3
|
export type Option = {
|
|
4
4
|
label: string;
|
|
5
5
|
value: string | number;
|
|
@@ -17,7 +17,7 @@ export type OptionsSource = {
|
|
|
17
17
|
params?: Record<string, unknown>;
|
|
18
18
|
fallbackOptions?: Option[];
|
|
19
19
|
};
|
|
20
|
-
export type OperatorType = 'EQ' | 'NOT' | 'GT' | 'LT' | 'GE' | 'LE' | 'ISEVEN' | 'ISODD' | 'IC' | 'NIC' | 'IN' | 'NIN' | 'EXISTS' | 'EMPTY' | 'NOT_EMPTY';
|
|
20
|
+
export type OperatorType = 'EQ' | 'NOT' | 'GT' | 'LT' | 'GE' | 'LE' | 'ISEVEN' | 'ISODD' | 'IC' | 'NIC' | 'IN' | 'NIN' | 'NOT_IN' | 'EXISTS' | 'EMPTY' | 'NOT_EMPTY';
|
|
21
21
|
export type ConditionNode = {
|
|
22
22
|
AND?: ConditionNode[];
|
|
23
23
|
OR?: ConditionNode[];
|
|
@@ -270,6 +270,18 @@ export type ArrayObjectField = BaseField & {
|
|
|
270
270
|
allowCopy?: boolean;
|
|
271
271
|
minItems?: number;
|
|
272
272
|
maxItems?: number;
|
|
273
|
+
/** 子字段布局。grid 会按 columnCount 横向排列,超出自动换行。 */
|
|
274
|
+
columnLayout?: 'vertical' | 'grid';
|
|
275
|
+
/** grid 布局每行列数,默认 3。 */
|
|
276
|
+
columnCount?: number;
|
|
277
|
+
/** 是否允许编辑每一项的标题。开启后默认保存到 title 字段。 */
|
|
278
|
+
titleEditable?: boolean;
|
|
279
|
+
/** 每一项标题保存到行对象内的字段名。设置后会自动开启标题编辑。 */
|
|
280
|
+
titleFieldName?: string;
|
|
281
|
+
/** 当前层每一项卡片的背景色。 */
|
|
282
|
+
backgroundColor?: string;
|
|
283
|
+
/** 多层 ARRAY_OBJECT 背景色列表。嵌套层会按深度自动取色。 */
|
|
284
|
+
levelBackgroundColors?: string[];
|
|
273
285
|
};
|
|
274
286
|
/** 字段定义联合类型 */
|
|
275
287
|
export type FieldDef = BaseField | TextareaField | SelectField | RadioField | CheckboxGroupField | DateField | DateRangeField | TimeField | TimeRangeField | NumberField | UploadField | SliderField | RateField | CascaderField | TreeSelectField | AutoCompleteField | SwitchField | InfoCardField | ArrayField | ObjectField | KeyValueField | ArrayObjectField;
|