@digitalsee-ai/rcs 1.1.9 → 2.0.0-beta3
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 +6 -38
- package/README.npm.md +37 -0
- package/dist/components/digitalsee/JsonRenderer/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Canvas/FastOperationButtons.d.ts +5 -2
- package/dist/components/digitalsee/workflow/Canvas/FullscreenLoading.d.ts +10 -2
- package/dist/components/digitalsee/workflow/Canvas/MiniMap.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Canvas/NodePlaceholder.d.ts +12 -0
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +4 -8
- package/dist/components/digitalsee/workflow/Canvas/actionItemToNodeData.d.ts +1 -6
- package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +25 -26
- package/dist/components/digitalsee/workflow/Canvas/hooks/{classicNodeAddConnection.d.ts → nodePackageAddConnection.d.ts} +3 -3
- package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +4 -2
- package/dist/components/digitalsee/workflow/Canvas/hooks/useDataLoading.d.ts +42 -5
- package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +2 -3
- package/dist/components/digitalsee/workflow/Canvas/hooks/useSaveFlowAfterNodeAdd.d.ts +4 -7
- package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +22 -4
- package/dist/components/digitalsee/workflow/Canvas/types.d.ts +19 -21
- package/dist/components/digitalsee/workflow/Edges/BaseEdge.d.ts +2 -0
- package/dist/components/digitalsee/workflow/Edges/EdgeFactory.d.ts +3 -8
- package/dist/components/digitalsee/workflow/Edges/edgeLayout.d.ts +73 -0
- package/dist/components/digitalsee/workflow/Handles/CustomHandle.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +19 -0
- package/dist/components/digitalsee/workflow/Nodes/DeclaredNode.d.ts +33 -0
- package/dist/components/digitalsee/workflow/Nodes/DynamicNode.d.ts +24 -0
- package/dist/components/digitalsee/workflow/Nodes/NodeFactory.d.ts +42 -4
- package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +2 -1
- package/dist/components/digitalsee/workflow/Nodes/classicPortLayout.d.ts +51 -0
- package/dist/components/digitalsee/workflow/Nodes/components/NodeStatusBadge.d.ts +11 -0
- package/dist/components/digitalsee/workflow/Nodes/{classicNodePackagePortLayout.d.ts → nodePackagePortLayout.d.ts} +4 -4
- package/dist/components/digitalsee/workflow/Nodes/nodeTypeRegistry.d.ts +131 -0
- package/dist/components/digitalsee/workflow/Nodes/useNodePackagePorts.d.ts +35 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NodePackageConfig/fieldSchemaAdapter.d.ts +14 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/help.d.ts +5 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.helpers.d.ts +11 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/VariableModal/tree-help.d.ts +5 -12
- package/dist/components/digitalsee/workflow/NodesConfig/submitPayload.d.ts +10 -17
- package/dist/components/digitalsee/workflow/Panels/CanvasConfigDebugger.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryItem.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryTabs.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCard.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeItem.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/PanelHeader.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useConnectableNodeSelector.d.ts +2 -5
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +10 -4
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableDataSource.d.ts +6 -10
- package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/components/NodeListItem.d.ts +1 -1
- package/dist/components/digitalsee/workflow/api/dip.types.d.ts +30 -1
- package/dist/components/digitalsee/workflow/api/index.d.ts +3 -22
- package/dist/components/digitalsee/workflow/builtin/controls/ConfigSubflow/index.d.ts +2 -2
- package/dist/components/digitalsee/workflow/builtin/globalConfig/index.d.ts +5 -1
- package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -5
- package/dist/components/digitalsee/workflow/config/layerConfig.d.ts +14 -0
- package/dist/components/digitalsee/workflow/config/themeConfig.d.ts +19 -23
- package/dist/components/digitalsee/workflow/constants/nodePackageHandles.d.ts +10 -0
- package/dist/components/digitalsee/workflow/context/workflowTriggerContext.d.ts +22 -0
- package/dist/components/digitalsee/workflow/coverage/acceptanceManifest.d.ts +30 -0
- package/dist/components/digitalsee/workflow/coverage/runtimeCoverage.d.ts +34 -0
- package/dist/components/digitalsee/workflow/design-system/AiFlowNodeTestPanel.d.ts +24 -0
- package/dist/components/digitalsee/workflow/design-system/AiFlowVariableTree.d.ts +34 -0
- package/dist/components/digitalsee/workflow/design-system/index.d.ts +3 -0
- package/dist/components/digitalsee/workflow/design-system/tokens.d.ts +103 -0
- package/dist/components/digitalsee/workflow/enums/canvas.d.ts +0 -12
- package/dist/components/digitalsee/workflow/enums/edge.d.ts +4 -2
- package/dist/components/digitalsee/workflow/enums/node.d.ts +5 -6
- package/dist/components/digitalsee/workflow/enums/workflow.d.ts +1 -1
- package/dist/components/digitalsee/workflow/examples/global-config-example.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/state.hooks.d.ts +1 -7
- package/dist/components/digitalsee/workflow/hooks/use-flow-data-operation.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/useCanvasLayout.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/useCanvasMode.d.ts +8 -0
- package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +9 -1
- package/dist/components/digitalsee/workflow/hooks/useVariables.d.ts +1 -0
- package/dist/components/digitalsee/workflow/hooks/useWorkflow.d.ts +1 -1
- package/dist/components/digitalsee/workflow/index.d.ts +28 -46
- package/dist/components/digitalsee/workflow/migration/umi.d.ts +1 -2
- package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +5 -2
- package/dist/components/digitalsee/workflow/types/Node.d.ts +2 -0
- package/dist/components/digitalsee/workflow/types/Workflow.d.ts +1 -1
- package/dist/components/digitalsee/workflow/types/engine.d.ts +21 -12
- package/dist/components/digitalsee/workflow/types/flowVersion.d.ts +0 -30
- package/dist/components/digitalsee/workflow/utils/connectionCheck.d.ts +30 -0
- package/dist/components/digitalsee/workflow/utils/layoutUtils.d.ts +2 -2
- package/dist/components/digitalsee/workflow/utils/mcpCanvas.d.ts +0 -40
- package/dist/components/digitalsee/workflow/utils/mode.d.ts +18 -0
- package/dist/components/digitalsee/workflow/utils/nodeAutoConnect.d.ts +24 -0
- package/dist/components/digitalsee/workflow/utils/nodeCommon.d.ts +5 -0
- package/dist/components/digitalsee/workflow/utils/nodeHandleLayout.d.ts +83 -0
- package/dist/components/digitalsee/workflow/utils/nodePackageConnection.d.ts +28 -0
- package/dist/components/digitalsee/workflow/utils/nodePackageGraphValidation.d.ts +29 -0
- package/dist/components/digitalsee/workflow/utils/nodePackageSchemaCache.d.ts +15 -0
- package/dist/components/digitalsee/workflow/utils/onNodeRemoveHook.d.ts +13 -0
- package/dist/components/digitalsee/workflow/utils/triggerNode.d.ts +13 -0
- package/dist/components/digitalsee/workflow/utils/workflowConnectionValidator.d.ts +1 -3
- package/dist/components/digitalsee/workflow/workflow.story-fixtures.d.ts +50 -0
- package/dist/{index-CqZ6Y0AC.mjs → index-Bw7AlWFF.mjs} +23754 -25891
- package/dist/index-D6yj1rMq.mjs +285 -0
- package/dist/locales/en-US/common.d.ts +29 -52
- package/dist/locales/en-US.d.ts +29 -52
- package/dist/locales/zh-CN/common.d.ts +29 -52
- package/dist/locales/zh-CN.d.ts +29 -52
- package/dist/locales/zh-TW/common.d.ts +29 -52
- package/dist/locales/zh-TW.d.ts +29 -52
- package/dist/rcs.css +1 -1
- package/dist/rcs.es.js +65 -62
- package/dist/rcs.umd.js +132 -72
- package/package.json +38 -23
- package/dist/components/digitalsee/workflow/Canvas/FlowVersionManager.d.ts +0 -17
- package/dist/components/digitalsee/workflow/Canvas/NextConfigModalWrapper.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvas.d.ts +0 -4
- package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvasHeader.d.ts +0 -17
- package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +0 -38
- package/dist/components/digitalsee/workflow/NextNodesConfigModal/index.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/AISubNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/ActionNode.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/BuiltinMCPNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/ConditionNode.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/CustomNode.d.ts +0 -15
- package/dist/components/digitalsee/workflow/Nodes/LoopNode.d.ts +0 -4
- package/dist/components/digitalsee/workflow/Nodes/MCPServerNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/MCPToolNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/NextNodeFactory.d.ts +0 -12
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextActionNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextBaseNode.d.ts +0 -16
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextConditionNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextLoopNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextSwitchNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextTriggerNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/SelfLoopNode.d.ts +0 -4
- package/dist/components/digitalsee/workflow/Nodes/StartNode.d.ts +0 -1
- package/dist/components/digitalsee/workflow/Nodes/SwitchNode.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/TriggerNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/components/NextNodeDescription.d.ts +0 -16
- package/dist/components/digitalsee/workflow/Nodes/components/NextNodeOperations.d.ts +0 -11
- package/dist/components/digitalsee/workflow/Nodes/useClassicNodePackagePorts.d.ts +0 -27
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CreateCredentialModal.d.ts +0 -13
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CredentialSelect.d.ts +0 -17
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/ModifyCredentialModal.d.ts +0 -17
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.d.ts +0 -10
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/index.d.ts +0 -17
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeSettings.d.ts +0 -6
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeTest.d.ts +0 -6
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/index.d.ts +0 -6
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.d.ts +0 -49
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/EntryTypeSelector.d.ts +0 -8
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCardList.d.ts +0 -20
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeActionState.d.ts +0 -28
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeSelectorPresentation.d.ts +0 -25
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/queryParams.d.ts +0 -18
- package/dist/components/digitalsee/workflow/constants/nextHandles.d.ts +0 -1
- package/dist/components/digitalsee/workflow/utils/classicNodePackageConnection.d.ts +0 -28
- package/dist/components/digitalsee/workflow/utils/classicNodePackageGraphValidation.d.ts +0 -29
- package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +0 -14
- package/dist/components/digitalsee/workflow/utils/queuedNodeConfigOpen.d.ts +0 -12
- package/dist/index-BnE-Ea2s.mjs +0 -312
- package/dist/index-BnE-Ea2s.mjs.map +0 -1
- package/dist/index-CqZ6Y0AC.mjs.map +0 -1
- package/dist/rcs.es.js.map +0 -1
- package/dist/rcs.umd.js.map +0 -1
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/WorkflowNodeSchemaFieldProvider.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowCodeField.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowProxyField.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/proxyField.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/{next-compatible.d.ts → nodePackage-compatible.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
数犀 React 组件库,当前主要提供工作流画布、DynamicForm 和 JsonRenderer。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
- Node.js `>= 22`
|
|
8
|
-
- pnpm `10.12.1`
|
|
9
|
-
|
|
10
|
-
## 安装与使用
|
|
5
|
+
## 安装
|
|
11
6
|
|
|
12
7
|
```bash
|
|
13
8
|
pnpm add @digitalsee-ai/rcs
|
|
14
9
|
```
|
|
15
10
|
|
|
11
|
+
## 使用
|
|
12
|
+
|
|
13
|
+
工作流画布:
|
|
14
|
+
|
|
16
15
|
```tsx
|
|
17
16
|
import { DigitalseeWorkFlow } from '@digitalsee-ai/rcs';
|
|
18
17
|
import '@digitalsee-ai/rcs/styles.css';
|
|
@@ -22,7 +21,7 @@ export function WorkflowPage() {
|
|
|
22
21
|
}
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
DynamicForm
|
|
24
|
+
DynamicForm:
|
|
26
25
|
|
|
27
26
|
```tsx
|
|
28
27
|
import { DynamicForm, DynamicFormField, type FormSchema } from '@digitalsee-ai/rcs';
|
|
@@ -36,34 +35,3 @@ export function FormPage() {
|
|
|
36
35
|
return <DynamicForm schema={schema} />;
|
|
37
36
|
}
|
|
38
37
|
```
|
|
39
|
-
|
|
40
|
-
## 开发命令
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
pnpm install
|
|
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
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
`dist/` 是 npm 包实际消费的构建产物。修改源码后,宿主项目不会自动获得更新,需重新构建。
|
|
55
|
-
|
|
56
|
-
## 文档
|
|
57
|
-
|
|
58
|
-
- [文档索引与维护状态](docs/README.md)
|
|
59
|
-
- [本地联调 npm 包](docs/development/local-package-debugging.md)
|
|
60
|
-
- [工作流组件集成](docs/guides/workflow-integration.md)
|
|
61
|
-
- [发布说明](docs/development/publishing.md)
|
|
62
|
-
|
|
63
|
-
## 包导出
|
|
64
|
-
|
|
65
|
-
- `@digitalsee-ai/rcs`:组件、类型与工具
|
|
66
|
-
- `@digitalsee-ai/rcs/styles.css`:组件库样式
|
|
67
|
-
|
|
68
|
-
构建产物包括 `dist/rcs.es.js`、`dist/rcs.umd.js`、`dist/rcs.css` 和
|
|
69
|
-
`dist/index.d.ts`。
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @digitalsee-ai/rcs
|
|
2
|
+
|
|
3
|
+
数犀 React 组件库,当前主要提供工作流画布、DynamicForm 和 JsonRenderer。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @digitalsee-ai/rcs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 使用
|
|
12
|
+
|
|
13
|
+
工作流画布:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { DigitalseeWorkFlow } from '@digitalsee-ai/rcs';
|
|
17
|
+
import '@digitalsee-ai/rcs/styles.css';
|
|
18
|
+
|
|
19
|
+
export function WorkflowPage() {
|
|
20
|
+
return <DigitalseeWorkFlow workflowId="workflow-id" />;
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
DynamicForm:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { DynamicForm, DynamicFormField, type FormSchema } from '@digitalsee-ai/rcs';
|
|
28
|
+
import '@digitalsee-ai/rcs/styles.css';
|
|
29
|
+
|
|
30
|
+
const schema: FormSchema = {
|
|
31
|
+
fields: [{ type: DynamicFormField.TEXT, name: 'name', label: '名称' }],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function FormPage() {
|
|
35
|
+
return <DynamicForm schema={schema} />;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { default as React
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
export interface ToolbarPanelProps {
|
|
3
3
|
/**
|
|
4
4
|
* 打开节点选择面板的回调
|
|
5
5
|
*/
|
|
6
|
-
onOpenNodeSelector?: (e
|
|
6
|
+
onOpenNodeSelector?: (e?: {
|
|
7
|
+
protocol?: string;
|
|
8
|
+
trigger?: boolean;
|
|
9
|
+
}) => void;
|
|
7
10
|
/**
|
|
8
11
|
* 添加便签节点的回调
|
|
9
12
|
*/
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface LoadErrorInfo {
|
|
2
|
+
code?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
interface FullscreenLoadingProps {
|
|
2
6
|
loading: boolean;
|
|
3
|
-
|
|
7
|
+
error?: LoadErrorInfo | null;
|
|
8
|
+
onRetry?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const FullscreenLoading: import('react').MemoExoticComponent<({ loading, error, onRetry }: FullscreenLoadingProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MiniMap as NativeMiniMap } from '@xyflow/react';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
|
-
export default function MiniMap<T extends ComponentProps<typeof NativeMiniMap
|
|
3
|
+
export default function MiniMap<T extends ComponentProps<typeof NativeMiniMap>>(props: T): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface NodePlaceholderProps {
|
|
3
|
+
/**
|
|
4
|
+
* 打开节点选择面板的回调
|
|
5
|
+
*/
|
|
6
|
+
onOpenNodeSelector?: (e?: {
|
|
7
|
+
protocol?: string;
|
|
8
|
+
trigger?: boolean;
|
|
9
|
+
}) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const NodePlaceholder: React.FC<NodePlaceholderProps>;
|
|
12
|
+
export default NodePlaceholder;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { SaveStatus } from '../enums/workflow';
|
|
3
|
-
import { CanvasAPI } from '../types/engine';
|
|
4
3
|
import { FlowDraftPayload } from '../types/flowVersion';
|
|
5
|
-
import { SaveFlowFn } from './types';
|
|
6
4
|
interface WorkflowCanvasHeaderProps {
|
|
7
|
-
|
|
5
|
+
/** 连接流加载中或加载失败:除返回外 header 操作均不可用 */
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
onSave?: () => Promise<FlowDraftPayload | undefined>;
|
|
8
8
|
getFlowPayload?: () => FlowDraftPayload;
|
|
9
|
-
readOnly?: boolean;
|
|
10
9
|
unSave?: boolean;
|
|
11
|
-
preview?: boolean;
|
|
12
|
-
appFlowMode?: boolean;
|
|
13
10
|
autoSaveStatus?: SaveStatus;
|
|
14
11
|
lastSavedTime?: string;
|
|
15
|
-
|
|
16
|
-
canvasApi?: CanvasAPI;
|
|
12
|
+
onOffline?: (workflowId: string) => Promise<boolean>;
|
|
17
13
|
}
|
|
18
14
|
declare const WorkflowCanvasHeader: React.FC<WorkflowCanvasHeaderProps>;
|
|
19
15
|
export default WorkflowCanvasHeader;
|
|
@@ -4,11 +4,6 @@ type ConvertibleActionItem = Partial<ActionItem> & {
|
|
|
4
4
|
status?: string;
|
|
5
5
|
protocol?: string;
|
|
6
6
|
} & Record<string, unknown>;
|
|
7
|
-
/**
|
|
7
|
+
/** 将节点动作转换为画布节点数据。 */
|
|
8
8
|
export declare const convertActionItemToNodeData: (actionItem: ConvertibleActionItem) => NodeFactoryData;
|
|
9
|
-
/**
|
|
10
|
-
* NEXT 模式专用转换函数(暂废保留分支):额外保留 name 字段。
|
|
11
|
-
* 当前 nodepackage 节点仍走 CLASSIC 的 convertActionItemToNodeData。
|
|
12
|
-
*/
|
|
13
|
-
export declare const convertActionItemToNodeDataNext: (actionItem: ConvertibleActionItem) => NodeFactoryData;
|
|
14
9
|
export {};
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
import { EdgeType } from '../enums/edge';
|
|
2
|
-
import {
|
|
2
|
+
import { ExecutionControlState } from '../store/workflowSlice';
|
|
3
|
+
import { CanvasAPI, WorkflowCanvasMode } from '../types/engine';
|
|
3
4
|
import { FlowDraftPayload } from '../types/flowVersion';
|
|
4
|
-
import { NodeType } from '../types/Node';
|
|
5
5
|
import { MarkerType, Viewport } from '@xyflow/react';
|
|
6
|
-
export { convertActionItemToNodeData
|
|
7
|
-
export declare const startNode: {
|
|
8
|
-
type: NodeType;
|
|
9
|
-
id: string;
|
|
10
|
-
position: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
};
|
|
14
|
-
data: {
|
|
15
|
-
type: NodeType;
|
|
16
|
-
name: string;
|
|
17
|
-
nodeId: string;
|
|
18
|
-
id: string;
|
|
19
|
-
description: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare const nodeTypes: Record<NodeType, import('react').ComponentType<any>>;
|
|
6
|
+
export { convertActionItemToNodeData } from './actionItemToNodeData';
|
|
23
7
|
export declare const edgeTypes: {
|
|
24
8
|
main: import('react').FC<import('../Edges/BaseEdge').CustomEdgeProps>;
|
|
25
9
|
};
|
|
@@ -38,16 +22,33 @@ export declare const defaultEdgeOptions: {
|
|
|
38
22
|
color: string;
|
|
39
23
|
};
|
|
40
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* 宿主 onLoad 需返回的工作流数据(ACM 流程格式)
|
|
27
|
+
*
|
|
28
|
+
* @description 与 adaptApiGetFlowData 的输入结构一致
|
|
29
|
+
*/
|
|
30
|
+
export type WorkflowLoadResponse = {
|
|
31
|
+
id?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
/** 流程节点列表(ACM 后端格式) */
|
|
34
|
+
nodes?: any[];
|
|
35
|
+
/** 流程连接列表(ACM 后端格式) */
|
|
36
|
+
connections?: any[];
|
|
37
|
+
/** 流程状态,如 online/offline */
|
|
38
|
+
op_status?: string;
|
|
39
|
+
/** 执行控制配置 */
|
|
40
|
+
execution_control?: ExecutionControlState | null;
|
|
41
|
+
};
|
|
41
42
|
/** 工作流画布属性接口 */
|
|
42
43
|
export interface WorkflowCanvasProps {
|
|
43
44
|
workflowId?: string;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
previewId?: string;
|
|
47
|
-
appFlowMode?: boolean;
|
|
48
|
-
linkMode?: boolean;
|
|
45
|
+
/** 画布模式(默认 'edit') */
|
|
46
|
+
mode?: WorkflowCanvasMode;
|
|
49
47
|
onSave?: (workflow: FlowDraftPayload) => void | Promise<void>;
|
|
50
48
|
onInit?: (api: CanvasAPI) => void;
|
|
49
|
+
onOffline?: (workflowId: string) => Promise<boolean>;
|
|
50
|
+
onLoad?: (workflowId?: string) => Promise<WorkflowLoadResponse>;
|
|
51
|
+
scene?: string;
|
|
51
52
|
}
|
|
52
53
|
/** 常量定义 */
|
|
53
54
|
export declare const DEBOUNCE_DELAY: {
|
|
@@ -56,5 +57,3 @@ export declare const DEBOUNCE_DELAY: {
|
|
|
56
57
|
};
|
|
57
58
|
/** 便签节点的action_id 快捷入口添加时直接写死 */
|
|
58
59
|
export declare const STICKY_ACTION_ID = "944";
|
|
59
|
-
/** DIP 模式下便签节点的 nodeKey */
|
|
60
|
-
export declare const DIP_STICKY_NODE_KEY = "core.stickyNote";
|
|
@@ -4,7 +4,7 @@ import { NodeAddInfo } from '../../types/NodeAddContext';
|
|
|
4
4
|
import { Edge, Node } from '@xyflow/react';
|
|
5
5
|
type ReportConnectable = (messageId: string, details: Record<string, unknown>) => void;
|
|
6
6
|
type ReportAmbiguousPorts = (details: Record<string, unknown>) => void;
|
|
7
|
-
export interface
|
|
7
|
+
export interface TryConnectNodePackageParams {
|
|
8
8
|
info: NodeAddInfo;
|
|
9
9
|
newNode: Node<NodeFactoryData>;
|
|
10
10
|
currentNodes: Node[];
|
|
@@ -28,7 +28,7 @@ export interface TryConnectClassicNodePackageParams {
|
|
|
28
28
|
* 画布)走 Schema 端口;AI_LANGUAGE_MODEL / AI_MEMORY 等专项 protocol 仍走 legacy handle。
|
|
29
29
|
* MCP Tool 下游新增也必须走这里,否则会写死 targetHandle=`input`,与 nodepackage 的 `main` 冲突。
|
|
30
30
|
*/
|
|
31
|
-
export declare function
|
|
31
|
+
export declare function canUseConnectablePorts(options: {
|
|
32
32
|
connectableEnabled: boolean;
|
|
33
33
|
protocol?: string | null;
|
|
34
34
|
}): boolean;
|
|
@@ -38,5 +38,5 @@ export declare function canUseClassicConnectablePorts(options: {
|
|
|
38
38
|
* 返回 true 表示该上下文已完整处理(成功连线或保留独立节点并给出提示);
|
|
39
39
|
* 返回 false 时调用方继续 legacy 固定 handle 流程。
|
|
40
40
|
*/
|
|
41
|
-
export declare function
|
|
41
|
+
export declare function tryConnectNodePackage({ info, newNode, currentNodes, currentEdges, canUseConnectablePorts, addEdges, removeEdges, handleEdgeAddNode, saveFlow, reportConnectableFallback, reportAmbiguousPorts, validateConnectionAgainstSnapshot, }: TryConnectNodePackageParams): Promise<boolean>;
|
|
42
42
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AppDispatch } from '../../store';
|
|
2
2
|
import { CanvasAPI } from '../../types/engine';
|
|
3
|
+
import { FlowDraftPayload } from '../../types/flowVersion';
|
|
3
4
|
import { ReactFlowInstance } from '@xyflow/react';
|
|
4
5
|
interface UseCanvasApiParams {
|
|
6
|
+
workflowId?: string;
|
|
5
7
|
dispatch: AppDispatch;
|
|
6
8
|
reactFlow: ReactFlowInstance;
|
|
7
9
|
setEdges: (edges: any) => void;
|
|
@@ -10,12 +12,12 @@ interface UseCanvasApiParams {
|
|
|
10
12
|
getState: () => any;
|
|
11
13
|
};
|
|
12
14
|
setNodeConfigVisible: (nodeId: string | null) => void;
|
|
13
|
-
saveFlowRef: React.RefObject<(
|
|
15
|
+
saveFlowRef: React.RefObject<() => Promise<FlowDraftPayload | undefined>>;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* 构造对外 Canvas API
|
|
17
19
|
*/
|
|
18
|
-
export declare function useCanvasApi({ dispatch, reactFlow, setEdges, setNodes, store, setNodeConfigVisible, saveFlowRef, }: UseCanvasApiParams): {
|
|
20
|
+
export declare function useCanvasApi({ workflowId, dispatch, reactFlow, setEdges, setNodes, store, setNodeConfigVisible, saveFlowRef, }: UseCanvasApiParams): {
|
|
19
21
|
canvasApi: CanvasAPI;
|
|
20
22
|
eventListenersRef: React.RefObject<Map<string, Set<Function>>>;
|
|
21
23
|
};
|
|
@@ -1,21 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkflowLoadResponse } from '../constants';
|
|
2
|
+
import { LoadErrorInfo } from '../FullscreenLoading';
|
|
3
|
+
import { LoadFlowResult, WorkflowCanvasStrategy } from '../types';
|
|
2
4
|
import { AppDispatch } from '../../store';
|
|
5
|
+
import { Edge, Node } from '@xyflow/react';
|
|
3
6
|
interface UseDataLoadingParams {
|
|
4
7
|
workflowId?: string;
|
|
5
8
|
strategy: WorkflowCanvasStrategy;
|
|
6
|
-
setNodes: (nodes:
|
|
7
|
-
setEdges: (edges:
|
|
9
|
+
setNodes: (nodes: Node[]) => void;
|
|
10
|
+
setEdges: (edges: Edge[]) => void;
|
|
8
11
|
fitView: (options?: any) => void;
|
|
9
12
|
setLoading: (v: boolean) => void;
|
|
10
|
-
setUnSave: (v: boolean) => void;
|
|
11
13
|
dispatch: AppDispatch;
|
|
12
14
|
setFlowOpStatusAction: (status: any) => void;
|
|
13
15
|
refreshWorkFlowNum: number;
|
|
16
|
+
onLoad?: (workflowId?: string) => Promise<WorkflowLoadResponse>;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* 扫描 flowNodes 中带 action_key / action_ver 的 NodePackage 节点,
|
|
20
|
+
* 在 setNodes / setEdges 之前把所有 schema 预热到 nodePackageSchemaCache,
|
|
21
|
+
* 避免首次渲染时所有节点都进入 `loading` 状态、连线校验时拿不到 schema。
|
|
22
|
+
*
|
|
23
|
+
* - Schema 唯一来源:{@link getNodePackageSchema}(命中即同步返回 / 否则远端拉取,去重 + pending 复用);
|
|
24
|
+
* - 任意一次失败都吞掉,不阻塞画布渲染。
|
|
25
|
+
*
|
|
26
|
+
* action_ver 缺失或非法值时 fallback 到 version=1 并 console.warn。
|
|
27
|
+
*
|
|
28
|
+
* Export 仅供测试访问,业务侧请通过 useDataLoading 触发。
|
|
29
|
+
*/
|
|
30
|
+
export declare function preloadClassicNodeSchemas(flowNodes: Node[]): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* 把 flowNodes 中所有 NodePackage 节点对应的 ReactFlow nodeType wrapper 注册到全局表。
|
|
33
|
+
*
|
|
34
|
+
* - 缺 action_key 的节点:ensureNodeTypeRegistered 内部 console.warn 后返回 null,
|
|
35
|
+
* 调用方继续走 NodeType 经典 wrapper(acceptable degradation)
|
|
36
|
+
* - schema 拉取失败:仅 console.error(后续 PR 处理),wrapper 仍按 base 注册
|
|
37
|
+
* - 已注册或成功注册的节点:触发 useNodeTypes 重渲染,ReactFlow 拿到最新 wrapper
|
|
38
|
+
*
|
|
39
|
+
* 内部走 Promise.all:上游 preloadClassicNodeSchemas 已对相同 (key, version) schema
|
|
40
|
+
* 拉取做去重,幂等检查由 listRegisteredDescriptorIds().includes 兜底。
|
|
41
|
+
*/
|
|
42
|
+
export declare function ensureClassicNodeTypesRegistered(flowNodes: Node[]): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* 将宿主 onLoad 返回的 ACM 流程数据适配为 LoadFlowResult。
|
|
45
|
+
*
|
|
46
|
+
* Export 仅供测试访问,业务侧请通过 useDataLoading 触发。
|
|
47
|
+
*/
|
|
48
|
+
export declare function adaptOnLoadResponse(response: WorkflowLoadResponse): LoadFlowResult;
|
|
15
49
|
/**
|
|
16
50
|
* 数据加载 Hook
|
|
17
51
|
*
|
|
18
52
|
* @param params 加载所需的依赖
|
|
19
53
|
*/
|
|
20
|
-
export declare function useDataLoading(params: UseDataLoadingParams):
|
|
54
|
+
export declare function useDataLoading(params: UseDataLoadingParams): {
|
|
55
|
+
loadError: LoadErrorInfo;
|
|
56
|
+
retry: () => void;
|
|
57
|
+
};
|
|
21
58
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WorkflowCanvasStrategy } from '../types';
|
|
2
|
-
import { EngineMode } from '../../enums/workflow';
|
|
3
2
|
import { NodeData as NodeFactoryData } from '../../Nodes/NodeFactory';
|
|
4
3
|
import { ActionItem } from '../../Panels/ModernNodeSelectorPanel/types';
|
|
5
4
|
import { EdgeConfig } from '../../types/engine';
|
|
@@ -17,6 +16,7 @@ interface UseNodeAddCallbackParams {
|
|
|
17
16
|
addNodes: (nodes: Node<NodeFactoryData>[]) => void;
|
|
18
17
|
addEdges: (edges: Edge[]) => void;
|
|
19
18
|
removeEdges: (edgeIds: string[]) => void;
|
|
19
|
+
updateEdge: (id: string, edgeUpdate: Partial<Edge>) => void;
|
|
20
20
|
setNodeAddCallback: (callback: (info: NodeAddInfo, nodeType: ActionItem) => void) => void;
|
|
21
21
|
handleEdgeAddNode: (position: {
|
|
22
22
|
x: number;
|
|
@@ -26,7 +26,6 @@ interface UseNodeAddCallbackParams {
|
|
|
26
26
|
setNodeFitHumanView: (nodeId: string) => void;
|
|
27
27
|
validateConnectionAgainstSnapshot: (edge: EdgeConfig, nodes: Node[], edges: Edge[]) => boolean;
|
|
28
28
|
saveFlow: () => Promise<void>;
|
|
29
|
-
engineMode: EngineMode;
|
|
30
29
|
}
|
|
31
|
-
export declare function useNodeAddCallback({ workflowId, strategy, store, addNodes, addEdges, removeEdges, setNodeAddCallback, handleEdgeAddNode, setNodeConfigVisible, setNodeFitHumanView, validateConnectionAgainstSnapshot, saveFlow,
|
|
30
|
+
export declare function useNodeAddCallback({ workflowId, strategy, store, addNodes, addEdges, removeEdges, updateEdge, setNodeAddCallback, handleEdgeAddNode, setNodeConfigVisible, setNodeFitHumanView, validateConnectionAgainstSnapshot, saveFlow, }: UseNodeAddCallbackParams): void;
|
|
32
31
|
export {};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* 不传 notifyHost,避免内部自动保存触发宿主 onSave / toast。
|
|
5
|
-
*/
|
|
6
|
-
export declare const createSaveFlowAfterNodeAdd: (saveFlow: SaveFlowFn) => () => Promise<void>;
|
|
1
|
+
import { FlowDraftPayload } from '../../types/flowVersion';
|
|
2
|
+
/** 将画布保存返回值收敛为节点新增流程需要的 Promise<void>。 */
|
|
3
|
+
export declare const createSaveFlowAfterNodeAdd: (saveFlow: () => Promise<FlowDraftPayload | undefined>) => () => Promise<void>;
|
|
7
4
|
/**
|
|
8
5
|
* 将带返回值的画布保存函数适配为节点新增回调需要的 Promise<void>。
|
|
9
6
|
*
|
|
10
7
|
* 必须保持引用稳定,否则 useNodeAddCallback 的 effect 会反复清理并 dispatch,造成无限更新。
|
|
11
8
|
*/
|
|
12
|
-
export declare const useSaveFlowAfterNodeAdd: (saveFlow:
|
|
9
|
+
export declare const useSaveFlowAfterNodeAdd: (saveFlow: () => Promise<FlowDraftPayload | undefined>) => () => Promise<void>;
|
|
@@ -7,8 +7,16 @@ import { usePanel } from '../../hooks/usePanel';
|
|
|
7
7
|
import { useWorkflow } from '../../hooks/useWorkflow';
|
|
8
8
|
import { useAppDispatch } from '../../store';
|
|
9
9
|
import { CanvasAPI, EdgeConfig as EngineEdgeConfig } from '../../types/engine';
|
|
10
|
+
import { FlowDraftPayload } from '../../types/flowVersion';
|
|
10
11
|
import { Connection, Edge, EdgeChange, Node, NodeChange, useEdgesState, useNodesState, useReactFlow, useStoreApi } from '@xyflow/react';
|
|
11
12
|
import { default as React } from 'react';
|
|
13
|
+
/** 当前画布 trigger 节点信息;一个画布最多一个 trigger,记录它即可推导画布级状态。 */
|
|
14
|
+
export interface TriggerNodeInfo {
|
|
15
|
+
/** trigger 节点 id */
|
|
16
|
+
id: string;
|
|
17
|
+
/** 是否为 MCP Server 触发画布(trigger 节点的 action_key 指向 MCP Server) */
|
|
18
|
+
isMcpServer: boolean;
|
|
19
|
+
}
|
|
12
20
|
export interface WorkflowCanvasStateResult {
|
|
13
21
|
nodes: Node[];
|
|
14
22
|
edges: Edge[];
|
|
@@ -16,6 +24,14 @@ export interface WorkflowCanvasStateResult {
|
|
|
16
24
|
setEdges: ReturnType<typeof useEdgesState>[1];
|
|
17
25
|
unSave: boolean;
|
|
18
26
|
setUnSave: (v: boolean) => void;
|
|
27
|
+
/** 当前画布 trigger 节点信息(一个画布最多一个 trigger),为 null 表示没有 trigger。 */
|
|
28
|
+
triggerNode: TriggerNodeInfo | null;
|
|
29
|
+
/** 画布是否已存在 trigger 节点。 */
|
|
30
|
+
hasTriggerNode: boolean;
|
|
31
|
+
/** 画布是否为 MCP Server 触发画布(由 trigger 节点决定)。 */
|
|
32
|
+
isMcpServerCanvas: boolean;
|
|
33
|
+
/** 用户是否手动删除过 trigger 节点(手动删除后不再展示 NodePlaceholder)。 */
|
|
34
|
+
triggerDeleted: boolean;
|
|
19
35
|
loading: boolean;
|
|
20
36
|
setLoading: (v: boolean) => void;
|
|
21
37
|
debugVisible: boolean;
|
|
@@ -41,7 +57,10 @@ export interface WorkflowCanvasStateResult {
|
|
|
41
57
|
x: number;
|
|
42
58
|
y: number;
|
|
43
59
|
}, edge?: Edge) => void;
|
|
44
|
-
handleOpenNodeSelector: (e
|
|
60
|
+
handleOpenNodeSelector: (e?: {
|
|
61
|
+
protocol?: string;
|
|
62
|
+
trigger?: boolean;
|
|
63
|
+
}) => void;
|
|
45
64
|
handleAddNoteNode: () => void;
|
|
46
65
|
handleTidy: () => void;
|
|
47
66
|
onEdgeMouseEnter: ReturnType<typeof useEdgesInteraction>['onEdgeMouseEnter'];
|
|
@@ -56,7 +75,6 @@ export interface WorkflowCanvasStateResult {
|
|
|
56
75
|
reactFlow: ReturnType<typeof useReactFlow>;
|
|
57
76
|
dispatch: ReturnType<typeof useAppDispatch>;
|
|
58
77
|
store: ReturnType<typeof useStoreApi>;
|
|
59
|
-
storeEdges: Edge[];
|
|
60
78
|
refreshWorkFlowNum: number;
|
|
61
79
|
addNodes: ReturnType<typeof useFlowDataOperation>['addNodes'];
|
|
62
80
|
addEdges: ReturnType<typeof useFlowDataOperation>['addEdges'];
|
|
@@ -69,12 +87,12 @@ export interface WorkflowCanvasStateResult {
|
|
|
69
87
|
openNodeSelector: ReturnType<typeof usePanel>['openNodeSelector'];
|
|
70
88
|
handleManualAdd: ReturnType<typeof usePanel>['handleManualAdd'];
|
|
71
89
|
restNativeProps: Record<string, any>;
|
|
72
|
-
saveFlowRef: React.RefObject<(
|
|
90
|
+
saveFlowRef: React.RefObject<() => Promise<FlowDraftPayload | undefined>>;
|
|
73
91
|
}
|
|
74
92
|
/**
|
|
75
93
|
* 工作流画布共享状态 Hook
|
|
76
94
|
*
|
|
77
95
|
* @param props 画布组件 props
|
|
78
|
-
* @param stickyNodeKey 便签节点的 key
|
|
96
|
+
* @param stickyNodeKey 便签节点的 key(默认 '944')
|
|
79
97
|
*/
|
|
80
98
|
export declare function useWorkflowCanvasState(props: WorkflowCanvasProps, stickyNodeKey: string): WorkflowCanvasStateResult;
|
|
@@ -3,33 +3,26 @@ import { SaveStatus } from '../enums/canvas';
|
|
|
3
3
|
import { NodeData as NodeFactoryData } from '../Nodes/NodeFactory';
|
|
4
4
|
import { ActionItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
5
5
|
import { ExecutionControlState } from '../store/workflowSlice';
|
|
6
|
-
import { CanvasAPI } from '../types/engine';
|
|
7
6
|
import { FlowDraftPayload } from '../types/flowVersion';
|
|
8
7
|
import { Edge, Node, NodeTypes } from '@xyflow/react';
|
|
9
|
-
/**
|
|
10
|
-
* 画布 saveFlow 调用选项。
|
|
11
|
-
*
|
|
12
|
-
* 节点新增等内部自动保存默认不通知宿主;用户主动保存(工具栏、发布前落草稿、canvasApi)应传 notifyHost: true。
|
|
13
|
-
*/
|
|
14
|
-
export interface SaveFlowCallOptions {
|
|
15
|
-
/**
|
|
16
|
-
* 是否回调宿主 DigitalseeWorkFlow.onSave。
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
notifyHost?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/** 画布内部保存函数签名 */
|
|
22
|
-
export type SaveFlowFn = (options?: SaveFlowCallOptions) => Promise<FlowDraftPayload | undefined>;
|
|
23
8
|
export interface CanvasHeaderProps {
|
|
24
|
-
|
|
9
|
+
/** 连接流加载中或加载失败:除返回外 header 操作均不可用 */
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
onSave?: () => Promise<FlowDraftPayload | undefined>;
|
|
25
12
|
getFlowPayload?: () => FlowDraftPayload;
|
|
26
|
-
readOnly?: boolean;
|
|
27
13
|
unSave?: boolean;
|
|
28
|
-
preview?: boolean;
|
|
29
|
-
appFlowMode?: boolean;
|
|
30
14
|
autoSaveStatus?: SaveStatus;
|
|
31
15
|
lastSavedTime?: string;
|
|
32
|
-
|
|
16
|
+
onOffline?: (workflowId: string) => Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 连接流加载失败:后端业务错误(result=false)透传的错误码与描述。
|
|
20
|
+
* message 兜底为 description || code,保证日志可读。
|
|
21
|
+
*/
|
|
22
|
+
export declare class FlowLoadError extends Error {
|
|
23
|
+
code?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
constructor(code?: string, description?: string);
|
|
33
26
|
}
|
|
34
27
|
export interface CreateNodeParams {
|
|
35
28
|
/** 工作流 ID */
|
|
@@ -96,7 +89,11 @@ export interface WorkflowCanvasStrategy {
|
|
|
96
89
|
convertNodeData?: (actionItem: Partial<ActionItem> & Record<string, any>) => NodeFactoryData;
|
|
97
90
|
/** 便签节点的 action ID / nodeKey */
|
|
98
91
|
stickyNodeKey: string;
|
|
99
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* 可选 ReactFlow nodeTypes 初始 seed:仅在 canvas 首次挂载时与内置 map 合并,
|
|
94
|
+
* 不会覆盖运行期通过 {@link nodeTypeRegistry} 动态注册的 descriptorId。
|
|
95
|
+
* 不传则使用 {@link NodeFactory.getNodeTypes} 默认合并结果。
|
|
96
|
+
*/
|
|
100
97
|
nodeTypes?: NodeTypes;
|
|
101
98
|
/** 头部组件 */
|
|
102
99
|
HeaderComponent: React.ComponentType<CanvasHeaderProps>;
|
|
@@ -109,4 +106,5 @@ export interface WorkflowCanvasStrategy {
|
|
|
109
106
|
}
|
|
110
107
|
export interface WorkflowCanvasBaseProps extends WorkflowCanvasProps {
|
|
111
108
|
strategy: WorkflowCanvasStrategy;
|
|
109
|
+
nodeTypes: NodeTypes;
|
|
112
110
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Edge } from '@xyflow/react';
|
|
2
|
-
import { EdgeData, EdgeDefinition } from '../types/Edge';
|
|
3
1
|
import { EdgeType } from '../enums/edge';
|
|
2
|
+
import { EdgeData } from '../types/Edge';
|
|
3
|
+
import { Edge } from '@xyflow/react';
|
|
4
4
|
interface EdgeCreationOptions {
|
|
5
5
|
sourceHandle?: string;
|
|
6
6
|
targetHandle?: string;
|
|
@@ -24,7 +24,7 @@ declare class EdgeFactory {
|
|
|
24
24
|
* 根据连线类型获取对应的连线组件
|
|
25
25
|
* @param type 连线类型
|
|
26
26
|
*/
|
|
27
|
-
static getEdgeComponent(type: EdgeType):
|
|
27
|
+
static getEdgeComponent(type: EdgeType): import('react').FC<import('./BaseEdge').CustomEdgeProps>;
|
|
28
28
|
/**
|
|
29
29
|
* 创建一个连线实例
|
|
30
30
|
* @param type 连线类型
|
|
@@ -34,10 +34,5 @@ declare class EdgeFactory {
|
|
|
34
34
|
* @param options 可选参数,包括sourceHandle, targetHandle, data和回调函数
|
|
35
35
|
*/
|
|
36
36
|
static createEdge(type: EdgeType | string, id: string, source: string, target: string, options?: EdgeCreationOptions): Edge;
|
|
37
|
-
/**
|
|
38
|
-
* 渲染连线
|
|
39
|
-
* @param props 连线属性
|
|
40
|
-
*/
|
|
41
|
-
static renderEdge(props: EdgeDefinition): import("react/jsx-runtime").JSX.Element;
|
|
42
37
|
}
|
|
43
38
|
export default EdgeFactory;
|