@digitalsee-ai/rcs 1.1.2 → 1.1.4
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/dist/components/digitalsee/workflow/Canvas/FlowVersionManager.d.ts +15 -0
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvas.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +3 -1
- package/dist/components/digitalsee/workflow/Canvas/actionItemToNodeData.d.ts +14 -0
- package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +4 -20
- package/dist/components/digitalsee/workflow/Canvas/constants.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Canvas/flowPayload.d.ts +4 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/classicNodeAddConnection.d.ts +31 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/classicNodeAddConnection.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +1 -16
- package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +4 -17
- package/dist/components/digitalsee/workflow/Canvas/hooks/useSaveFlowAfterNodeAdd.d.ts +9 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +4 -2
- package/dist/components/digitalsee/workflow/Canvas/types.d.ts +8 -1
- package/dist/components/digitalsee/workflow/Handles/CustomHandle.d.ts +3 -0
- package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +35 -0
- package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Nodes/ConditionNode.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +6 -1
- package/dist/components/digitalsee/workflow/Nodes/SwitchNode.d.ts +2 -2
- package/dist/components/digitalsee/workflow/Nodes/classicNodePackageNodes.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Nodes/classicNodePackagePortLayout.d.ts +23 -0
- package/dist/components/digitalsee/workflow/Nodes/classicNodePackagePortLayout.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Nodes/useClassicNodePackagePorts.d.ts +27 -0
- package/dist/components/digitalsee/workflow/Nodes/useClassicNodePackagePorts.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/ActionNodeConfig/index.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/WorkflowNodeSchemaFieldProvider.d.ts +3 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fields/WorkflowCodeField.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fields/WorkflowCodeField.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fields/WorkflowProxyField.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/proxyField.d.ts +18 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/proxyField.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/EditInOnlineIDE/index.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/online-ide/components/title/index.d.ts +5 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/online-ide/index.d.ts +2 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/EntryTypeSelector.d.ts +8 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCardList.d.ts +19 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useCategories.d.ts +6 -2
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useCategories.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useConnectableNodeSelector.d.ts +40 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNavigation.d.ts +4 -2
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNavigation.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeActionState.d.ts +30 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeSelectorPresentation.d.ts +25 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeSelectorPresentation.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +19 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableActionLoader.d.ts +16 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableActionLoader.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableDataSource.d.ts +15 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableDataSource.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableFallback.d.ts +2 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableFallback.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableQuery.d.ts +40 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableQuery.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableResponse.d.ts +35 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableResponse.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/dataTransformers.d.ts +13 -2
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/filterEdgeInsertActions.d.ts +62 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/filterEdgeInsertActions.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/nodeAddContext.d.ts +26 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/nodeAddContext.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/api/connectable.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/api/connectable.types.d.ts +75 -0
- package/dist/components/digitalsee/workflow/api/dip.types.d.ts +43 -3
- package/dist/components/digitalsee/workflow/api/index.d.ts +28 -1
- package/dist/components/digitalsee/workflow/config/defaultCanvasEngineConfig.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/config/defaultNodeSelectorConfig.d.ts +9 -0
- package/dist/components/digitalsee/workflow/events/eventBus.d.ts +2 -12
- package/dist/components/digitalsee/workflow/hooks/usePanel.d.ts +3 -17
- package/dist/components/digitalsee/workflow/index.d.ts +3 -1
- package/dist/components/digitalsee/workflow/store/panelSlice.d.ts +118 -41
- package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +2 -1
- package/dist/components/digitalsee/workflow/types/Node.d.ts +3 -3
- package/dist/components/digitalsee/workflow/types/NodeAddContext.d.ts +31 -0
- package/dist/components/digitalsee/workflow/types/engine.d.ts +21 -1
- package/dist/components/digitalsee/workflow/types/flowVersion.d.ts +53 -0
- package/dist/components/digitalsee/workflow/utils/classicNodeActionIdentity.d.ts +7 -0
- package/dist/components/digitalsee/workflow/utils/classicNodeActionIdentity.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/classicNodePackageConnection.d.ts +28 -0
- package/dist/components/digitalsee/workflow/utils/classicNodePackageConnection.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/classicNodePackageGraphValidation.d.ts +29 -0
- package/dist/components/digitalsee/workflow/utils/classicNodePackageGraphValidation.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/compatiblePortSelection.d.ts +79 -0
- package/dist/components/digitalsee/workflow/utils/compatiblePortSelection.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +8 -0
- package/dist/components/digitalsee/workflow/utils/nodeDataFormatter.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/portConnectionValidationMessages.d.ts +48 -0
- package/dist/components/digitalsee/workflow/utils/portConnectionValidationMessages.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/portConnectionValidator.d.ts +66 -0
- package/dist/components/digitalsee/workflow/utils/portConnectionValidator.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/switchNodePackage.d.ts +43 -0
- package/dist/components/digitalsee/workflow/utils/switchNodePackage.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/workflowConnectionValidator.d.ts +20 -0
- package/dist/components/digitalsee/workflow/utils/workflowConnectionValidator.test.d.ts +1 -0
- package/dist/components/dynamic-form/DynamicForm.d.ts +7 -1
- package/dist/components/dynamic-form/components/ValueModeWrapper/ValueModePolicy.test.d.ts +1 -0
- package/dist/components/dynamic-form/components/ValueModeWrapper/index.d.ts +23 -3
- package/dist/components/dynamic-form/registry/createFieldComponent.d.ts +4 -4
- package/dist/components/dynamic-form/types/field-component.d.ts +1 -1
- package/dist/components/dynamic-form/types/form-schema.d.ts +10 -1
- package/dist/index-DVB8Tfvb.mjs +63909 -0
- package/dist/index-DVB8Tfvb.mjs.map +1 -0
- package/dist/index-DuXBchhk.mjs +312 -0
- package/dist/index-DuXBchhk.mjs.map +1 -0
- package/dist/locales/en-US/common.d.ts +52 -0
- package/dist/locales/en-US/link/flow.d.ts +25 -0
- package/dist/locales/en-US.d.ts +77 -0
- package/dist/locales/zh-CN/common.d.ts +52 -0
- package/dist/locales/zh-CN/link/flow.d.ts +25 -0
- package/dist/locales/zh-CN.d.ts +77 -0
- package/dist/locales/zh-TW/common.d.ts +52 -0
- package/dist/locales/zh-TW/link/flow.d.ts +25 -0
- package/dist/locales/zh-TW.d.ts +77 -0
- package/dist/rcs.css +1 -1
- package/dist/rcs.es.js +60 -61089
- package/dist/rcs.es.js.map +1 -1
- package/dist/rcs.umd.js +65 -65
- package/dist/rcs.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CanvasAPI } from '../types/engine';
|
|
2
|
+
import { FlowDraftPayload } from '../types/flowVersion';
|
|
3
|
+
interface FlowVersionManagerProps {
|
|
4
|
+
flowId: string;
|
|
5
|
+
dirty: boolean;
|
|
6
|
+
canManage: boolean;
|
|
7
|
+
onSave?: () => Promise<FlowDraftPayload | undefined>;
|
|
8
|
+
getFlowPayload?: () => FlowDraftPayload;
|
|
9
|
+
canvasApi?: CanvasAPI;
|
|
10
|
+
offlineApi?: (flowId: string) => Promise<void>;
|
|
11
|
+
onUnsupported?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/** 连接流版本发布、下线与历史管理。 */
|
|
14
|
+
declare const FlowVersionManager: ({ flowId, dirty, canManage, onSave, getFlowPayload, canvasApi, offlineApi, onUnsupported, }: FlowVersionManagerProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default FlowVersionManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { SaveStatus } from '../enums/workflow';
|
|
3
3
|
import { CanvasAPI } from '../types/engine';
|
|
4
|
+
import { FlowDraftPayload } from '../types/flowVersion';
|
|
4
5
|
interface WorkflowCanvasHeaderProps {
|
|
5
|
-
onSave?: () =>
|
|
6
|
+
onSave?: () => Promise<FlowDraftPayload | undefined>;
|
|
7
|
+
getFlowPayload?: () => FlowDraftPayload;
|
|
6
8
|
readOnly?: boolean;
|
|
7
9
|
unSave?: boolean;
|
|
8
10
|
preview?: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NodeData as NodeFactoryData } from '../Nodes/NodeFactory';
|
|
2
|
+
import { ActionItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
3
|
+
type ConvertibleActionItem = Partial<ActionItem> & {
|
|
4
|
+
status?: string;
|
|
5
|
+
protocol?: string;
|
|
6
|
+
} & Record<string, unknown>;
|
|
7
|
+
/** 将节点动作转换为 CLASSIC 画布节点数据。 */
|
|
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
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EdgeType } from '../enums/edge';
|
|
2
|
-
import { NodeData as NodeFactoryData } from '../Nodes/NodeFactory';
|
|
3
|
-
import { ActionItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
4
2
|
import { CanvasAPI } from '../types/engine';
|
|
3
|
+
import { FlowDraftPayload } from '../types/flowVersion';
|
|
5
4
|
import { NodeType } from '../types/Node';
|
|
6
|
-
import {
|
|
5
|
+
import { MarkerType, Viewport } from '@xyflow/react';
|
|
6
|
+
export { convertActionItemToNodeData, convertActionItemToNodeDataNext, } from './actionItemToNodeData';
|
|
7
7
|
export declare const startNode: {
|
|
8
8
|
type: NodeType;
|
|
9
9
|
id: string;
|
|
@@ -19,19 +19,6 @@ export declare const startNode: {
|
|
|
19
19
|
description: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
export declare const convertActionItemToNodeData: (actionItem: Partial<ActionItem> & {
|
|
23
|
-
status?: string;
|
|
24
|
-
protocol?: string;
|
|
25
|
-
} & Record<string, any>) => NodeFactoryData;
|
|
26
|
-
/**
|
|
27
|
-
* NEXT 模式专用转换函数(暂废保留分支):在 convertActionItemToNodeData 基础上额外保留 name 字段
|
|
28
|
-
* name 在 NEXT 模式下作为节点实例的唯一显示名称
|
|
29
|
-
* 当前 nodepackage 节点仍走 CLASSIC 的 convertActionItemToNodeData。
|
|
30
|
-
*/
|
|
31
|
-
export declare const convertActionItemToNodeDataNext: (actionItem: Partial<ActionItem> & {
|
|
32
|
-
status?: string;
|
|
33
|
-
protocol?: string;
|
|
34
|
-
} & Record<string, any>) => NodeFactoryData;
|
|
35
22
|
export declare const nodeTypes: Record<NodeType, import('react').ComponentType<any>>;
|
|
36
23
|
export declare const edgeTypes: {
|
|
37
24
|
main: import('react').FC<import('../Edges/BaseEdge').CustomEdgeProps>;
|
|
@@ -59,10 +46,7 @@ export interface WorkflowCanvasProps {
|
|
|
59
46
|
previewId?: string;
|
|
60
47
|
appFlowMode?: boolean;
|
|
61
48
|
linkMode?: boolean;
|
|
62
|
-
onSave?: (workflow:
|
|
63
|
-
nodes: Node[];
|
|
64
|
-
edges: Edge[];
|
|
65
|
-
}) => void;
|
|
49
|
+
onSave?: (workflow: FlowDraftPayload) => void | Promise<void>;
|
|
66
50
|
onInit?: (api: CanvasAPI) => void;
|
|
67
51
|
}
|
|
68
52
|
/** 常量定义 */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkflowCanvasStrategy } from './types';
|
|
2
|
+
import { FlowDraftPayload } from '../types/flowVersion';
|
|
3
|
+
/** 生成保存草稿与发布版本共用的完整 CLASSIC flow。 */
|
|
4
|
+
export declare const buildClassicFlowPayload: ({ nodes, edges, workflowName, workflowId, executionControl, metadata, }: Parameters<NonNullable<WorkflowCanvasStrategy["buildFlowPayload"]>>[0]) => FlowDraftPayload;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NodeData as NodeFactoryData } from '../../Nodes/NodeFactory';
|
|
2
|
+
import { EdgeConfig } from '../../types/engine';
|
|
3
|
+
import { NodeAddInfo } from '../../types/NodeAddContext';
|
|
4
|
+
import { Edge, Node } from '@xyflow/react';
|
|
5
|
+
type ReportConnectable = (messageId: string, details: Record<string, unknown>) => void;
|
|
6
|
+
type ReportAmbiguousPorts = (details: Record<string, unknown>) => void;
|
|
7
|
+
export interface TryConnectClassicNodePackageParams {
|
|
8
|
+
info: NodeAddInfo;
|
|
9
|
+
newNode: Node<NodeFactoryData>;
|
|
10
|
+
currentNodes: Node[];
|
|
11
|
+
currentEdges: Edge[];
|
|
12
|
+
canUseConnectablePorts: boolean;
|
|
13
|
+
addEdges: (edges: Edge[]) => void;
|
|
14
|
+
removeEdges: (edgeIds: string[]) => void;
|
|
15
|
+
handleEdgeAddNode: (position: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}, edge?: Edge) => void;
|
|
19
|
+
saveFlow: () => Promise<void>;
|
|
20
|
+
reportConnectableFallback: ReportConnectable;
|
|
21
|
+
reportAmbiguousPorts: ReportAmbiguousPorts;
|
|
22
|
+
validateConnectionAgainstSnapshot: (edge: EdgeConfig, nodes: Node[], edges: Edge[]) => boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 尝试按 NodePackage Schema 连接新建节点。
|
|
26
|
+
*
|
|
27
|
+
* 返回 true 表示该上下文已完整处理(成功连线或保留独立节点并给出提示);
|
|
28
|
+
* 返回 false 时调用方继续 legacy 固定 handle 流程。
|
|
29
|
+
*/
|
|
30
|
+
export declare function tryConnectClassicNodePackage({ info, newNode, currentNodes, currentEdges, canUseConnectablePorts, addEdges, removeEdges, handleEdgeAddNode, saveFlow, reportConnectableFallback, reportAmbiguousPorts, validateConnectionAgainstSnapshot, }: TryConnectClassicNodePackageParams): Promise<boolean>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { WorkflowCanvasStrategy } from '../types';
|
|
2
2
|
import { NodeData as NodeFactoryData } from '../../Nodes/NodeFactory';
|
|
3
3
|
import { ActionItem } from '../../Panels/ModernNodeSelectorPanel/types';
|
|
4
|
+
import { NodeAddInfo } from '../../types/NodeAddContext';
|
|
4
5
|
import { Edge, Node } from '@xyflow/react';
|
|
5
|
-
interface NodeAddInfo {
|
|
6
|
-
sourceNodeId?: string;
|
|
7
|
-
sourceHandle?: string;
|
|
8
|
-
targetNodeId?: string;
|
|
9
|
-
targetHandle?: string;
|
|
10
|
-
position?: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
};
|
|
14
|
-
trigger?: boolean;
|
|
15
|
-
edge?: any;
|
|
16
|
-
sourceNode?: any;
|
|
17
|
-
targetNode?: any;
|
|
18
|
-
protocol?: string;
|
|
19
|
-
refresh?: boolean;
|
|
20
|
-
}
|
|
21
6
|
interface CreateNodeAddHandlerNextParams {
|
|
22
7
|
workflowId?: string;
|
|
23
8
|
strategy: WorkflowCanvasStrategy;
|
|
@@ -10,7 +10,7 @@ interface UseCanvasApiParams {
|
|
|
10
10
|
getState: () => any;
|
|
11
11
|
};
|
|
12
12
|
setNodeConfigVisible: (nodeId: string | null) => void;
|
|
13
|
-
saveFlowRef: React.RefObject<() => Promise<
|
|
13
|
+
saveFlowRef: React.RefObject<() => Promise<import('../../types/flowVersion').FlowDraftPayload | undefined>>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* 构造对外 Canvas API
|
|
@@ -2,23 +2,9 @@ import { WorkflowCanvasStrategy } from '../types';
|
|
|
2
2
|
import { EngineMode } from '../../enums/workflow';
|
|
3
3
|
import { NodeData as NodeFactoryData } from '../../Nodes/NodeFactory';
|
|
4
4
|
import { ActionItem } from '../../Panels/ModernNodeSelectorPanel/types';
|
|
5
|
+
import { EdgeConfig } from '../../types/engine';
|
|
6
|
+
import { NodeAddInfo } from '../../types/NodeAddContext';
|
|
5
7
|
import { Edge, Node } from '@xyflow/react';
|
|
6
|
-
interface NodeAddInfo {
|
|
7
|
-
sourceNodeId?: string;
|
|
8
|
-
sourceHandle?: string;
|
|
9
|
-
targetNodeId?: string;
|
|
10
|
-
targetHandle?: string;
|
|
11
|
-
position?: {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
};
|
|
15
|
-
trigger?: boolean;
|
|
16
|
-
edge?: any;
|
|
17
|
-
sourceNode?: any;
|
|
18
|
-
targetNode?: any;
|
|
19
|
-
protocol?: string;
|
|
20
|
-
refresh?: boolean;
|
|
21
|
-
}
|
|
22
8
|
interface UseNodeAddCallbackParams {
|
|
23
9
|
workflowId?: string;
|
|
24
10
|
strategy: WorkflowCanvasStrategy;
|
|
@@ -38,8 +24,9 @@ interface UseNodeAddCallbackParams {
|
|
|
38
24
|
}, edge?: Edge) => void;
|
|
39
25
|
setNodeConfigVisible: (nodeId: string | null) => void;
|
|
40
26
|
setNodeFitHumanView: (nodeId: string) => void;
|
|
27
|
+
validateConnectionAgainstSnapshot: (edge: EdgeConfig, nodes: Node[], edges: Edge[]) => boolean;
|
|
41
28
|
saveFlow: () => Promise<void>;
|
|
42
29
|
engineMode: EngineMode;
|
|
43
30
|
}
|
|
44
|
-
export declare function useNodeAddCallback({ workflowId, strategy, store, addNodes, addEdges, removeEdges, setNodeAddCallback, handleEdgeAddNode, setNodeConfigVisible, setNodeFitHumanView, saveFlow, engineMode, }: UseNodeAddCallbackParams): void;
|
|
31
|
+
export declare function useNodeAddCallback({ workflowId, strategy, store, addNodes, addEdges, removeEdges, setNodeAddCallback, handleEdgeAddNode, setNodeConfigVisible, setNodeFitHumanView, validateConnectionAgainstSnapshot, saveFlow, engineMode, }: UseNodeAddCallbackParams): void;
|
|
45
32
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FlowDraftPayload } from '../../types/flowVersion';
|
|
2
|
+
/** 将画布保存返回值收敛为节点新增流程需要的 Promise<void>。 */
|
|
3
|
+
export declare const createSaveFlowAfterNodeAdd: (saveFlow: () => Promise<FlowDraftPayload | undefined>) => () => Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* 将带返回值的画布保存函数适配为节点新增回调需要的 Promise<void>。
|
|
6
|
+
*
|
|
7
|
+
* 必须保持引用稳定,否则 useNodeAddCallback 的 effect 会反复清理并 dispatch,造成无限更新。
|
|
8
|
+
*/
|
|
9
|
+
export declare const useSaveFlowAfterNodeAdd: (saveFlow: () => Promise<FlowDraftPayload | undefined>) => () => Promise<void>;
|
|
@@ -6,7 +6,7 @@ import { useNodesInteraction } from '../../hooks/use-nodes-interaction';
|
|
|
6
6
|
import { usePanel } from '../../hooks/usePanel';
|
|
7
7
|
import { useWorkflow } from '../../hooks/useWorkflow';
|
|
8
8
|
import { useAppDispatch } from '../../store';
|
|
9
|
-
import { CanvasAPI } from '../../types/engine';
|
|
9
|
+
import { CanvasAPI, EdgeConfig as EngineEdgeConfig } from '../../types/engine';
|
|
10
10
|
import { Connection, Edge, EdgeChange, Node, NodeChange, useEdgesState, useNodesState, useReactFlow, useStoreApi } from '@xyflow/react';
|
|
11
11
|
import { default as React } from 'react';
|
|
12
12
|
export interface WorkflowCanvasStateResult {
|
|
@@ -35,6 +35,8 @@ export interface WorkflowCanvasStateResult {
|
|
|
35
35
|
onNodesChange: (changes: NodeChange[]) => void;
|
|
36
36
|
handleEdgesChange: (changes: EdgeChange[]) => void;
|
|
37
37
|
handleConnect: (params: Connection) => void;
|
|
38
|
+
isValidConnection: (params: Connection | Edge) => boolean;
|
|
39
|
+
validateConnectionAgainstSnapshot: (edge: EngineEdgeConfig, nodes: Node[], edges: Edge[]) => boolean;
|
|
38
40
|
handleEdgeAddNode: (position: {
|
|
39
41
|
x: number;
|
|
40
42
|
y: number;
|
|
@@ -67,7 +69,7 @@ export interface WorkflowCanvasStateResult {
|
|
|
67
69
|
openNodeSelector: ReturnType<typeof usePanel>['openNodeSelector'];
|
|
68
70
|
handleManualAdd: ReturnType<typeof usePanel>['handleManualAdd'];
|
|
69
71
|
restNativeProps: Record<string, any>;
|
|
70
|
-
saveFlowRef: React.RefObject<() => Promise<
|
|
72
|
+
saveFlowRef: React.RefObject<() => Promise<import('../../types/flowVersion').FlowDraftPayload | undefined>>;
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
75
|
* 工作流画布共享状态 Hook
|
|
@@ -4,9 +4,11 @@ import { NodeData as NodeFactoryData } from '../Nodes/NodeFactory';
|
|
|
4
4
|
import { ActionItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
5
5
|
import { ExecutionControlState } from '../store/workflowSlice';
|
|
6
6
|
import { CanvasAPI } from '../types/engine';
|
|
7
|
+
import { FlowDraftPayload } from '../types/flowVersion';
|
|
7
8
|
import { Edge, Node, NodeTypes } from '@xyflow/react';
|
|
8
9
|
export interface CanvasHeaderProps {
|
|
9
|
-
onSave?: () =>
|
|
10
|
+
onSave?: () => Promise<FlowDraftPayload | undefined>;
|
|
11
|
+
getFlowPayload?: () => FlowDraftPayload;
|
|
10
12
|
readOnly?: boolean;
|
|
11
13
|
unSave?: boolean;
|
|
12
14
|
preview?: boolean;
|
|
@@ -56,6 +58,7 @@ export interface LoadFlowResult {
|
|
|
56
58
|
name: string;
|
|
57
59
|
opStatus?: string;
|
|
58
60
|
executionControl?: ExecutionControlState | null;
|
|
61
|
+
metadata?: Record<string, unknown>;
|
|
59
62
|
}
|
|
60
63
|
export interface SaveFlowParams {
|
|
61
64
|
nodes: Node[];
|
|
@@ -63,12 +66,16 @@ export interface SaveFlowParams {
|
|
|
63
66
|
workflowName: string;
|
|
64
67
|
workflowId: string;
|
|
65
68
|
executionControl?: ExecutionControlState | null;
|
|
69
|
+
metadata?: Record<string, unknown>;
|
|
70
|
+
payload?: FlowDraftPayload;
|
|
66
71
|
}
|
|
67
72
|
export interface WorkflowCanvasStrategy {
|
|
68
73
|
/** 加载工作流数据 */
|
|
69
74
|
loadFlow: (workflowId: string) => Promise<LoadFlowResult>;
|
|
70
75
|
/** 保存工作流数据 */
|
|
71
76
|
saveFlow: (params: SaveFlowParams) => Promise<void>;
|
|
77
|
+
/** 将当前画布转换为后端草稿/发布共用的完整 flow。 */
|
|
78
|
+
buildFlowPayload?: (params: SaveFlowParams) => FlowDraftPayload;
|
|
72
79
|
/** 创建节点(返回新节点 ID 和附加数据) */
|
|
73
80
|
createNode: (params: CreateNodeParams) => Promise<CreateNodeResult>;
|
|
74
81
|
/** 将 ActionItem 转换为节点 data(可选,不提供则使用默认的 convertActionItemToNodeData) */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DipPortSchema } from '../api/dip';
|
|
1
2
|
import { Connection, HandleType as FlowHandleType, Position, IsValidConnection as ReactFlowIsValidConnection } from '@xyflow/react';
|
|
2
3
|
import { default as React } from 'react';
|
|
3
4
|
import { NodeStatus } from '../types/Node';
|
|
@@ -20,6 +21,8 @@ interface CustomHandleProps {
|
|
|
20
21
|
square?: boolean;
|
|
21
22
|
shape?: 'square' | 'circle' | 'rhombus';
|
|
22
23
|
protocol?: string;
|
|
24
|
+
/** NodePackage 真实端口 Schema;仅用于保留端口元数据,不改变 input 只接收连线的语义。 */
|
|
25
|
+
portSchema?: DipPortSchema;
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
28
|
* @description 自定义连接桩组件,统一输出 11×11px 菱形桩点并同步节点状态色。
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NodeAddInfo } from '../types/NodeAddContext';
|
|
2
|
+
import { Node } from '@xyflow/react';
|
|
3
|
+
interface HandleExtenderVisibilityOptions {
|
|
4
|
+
type: 'source' | 'target';
|
|
5
|
+
isFull: boolean;
|
|
6
|
+
connectionInProgress: boolean;
|
|
7
|
+
canEdit: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 判断连接桩是否展示快捷新增入口。
|
|
11
|
+
*
|
|
12
|
+
* 画布连线始终由 output/source 发起,input/target 只接收连线,
|
|
13
|
+
* 因此快捷新增入口只允许展示在输出桩。连接数达到上限时隐藏入口。
|
|
14
|
+
*/
|
|
15
|
+
export declare function shouldShowHandleExtender(options: HandleExtenderVisibilityOptions): boolean;
|
|
16
|
+
/** output 只能发起连线,input 只能接收连线;空间布局不改变端口语义。 */
|
|
17
|
+
export declare function getHandleConnectionPermissions(type: 'source' | 'target', canEdit: boolean): {
|
|
18
|
+
isConnectableStart: boolean;
|
|
19
|
+
isConnectableEnd: boolean;
|
|
20
|
+
};
|
|
21
|
+
interface BuildHandleNodeAddInfoOptions {
|
|
22
|
+
type: 'source' | 'target';
|
|
23
|
+
nodeId: string;
|
|
24
|
+
handleId: string;
|
|
25
|
+
position: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
protocol?: string;
|
|
30
|
+
anchorNode?: Node;
|
|
31
|
+
refresh: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** 构造连接桩快捷新增上下文,避免输入桩误带 source/protocol 语义。 */
|
|
34
|
+
export declare function buildHandleNodeAddInfo(options: BuildHandleNodeAddInfoOptions): NodeAddInfo;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DipPortSchema } from '../api/dip';
|
|
1
2
|
import { HandleType } from '../types/Handle';
|
|
2
3
|
import { NodeData, NodeStatus, NodeType } from '../types/Node';
|
|
3
4
|
import { Position } from '@xyflow/react';
|
|
@@ -7,8 +8,12 @@ export interface HandleConfig {
|
|
|
7
8
|
position: Position;
|
|
8
9
|
type: HandleType;
|
|
9
10
|
isMain?: boolean;
|
|
10
|
-
label?:
|
|
11
|
+
label?: React.ReactNode;
|
|
11
12
|
maxConnections?: number;
|
|
13
|
+
/** NodePackage 端口的连接类型;与 legacy protocol 语义保持隔离。 */
|
|
14
|
+
connectionType?: string;
|
|
15
|
+
/** 原始端口 Schema,供统一连线校验器读取 type/required/黑白名单等约束。 */
|
|
16
|
+
portSchema?: DipPortSchema;
|
|
12
17
|
style?: React.CSSProperties;
|
|
13
18
|
category?: string;
|
|
14
19
|
protocol?: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { NodeStatus } from '../types/Node';
|
|
1
2
|
import { NodeProps } from '@xyflow/react';
|
|
2
3
|
import { default as React } from 'react';
|
|
3
|
-
import { NodeStatus } from '../types/Node';
|
|
4
4
|
interface SwitchNodeProps extends NodeProps {
|
|
5
5
|
status?: NodeStatus;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* @description Switch
|
|
8
|
+
* @description Switch多分支节点,根据实例配置动态生成输出插槽。
|
|
9
9
|
* @param {SwitchNodeProps} props React Flow Switch节点参数。
|
|
10
10
|
* @returns {JSX.Element} 渲染后的Switch节点。
|
|
11
11
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DipNodeSchema } from '../api/dip';
|
|
2
|
+
import { HandleConfig } from './SuperBaseNode';
|
|
3
|
+
export interface ClassicNodePackagePortLayout {
|
|
4
|
+
inputs: HandleConfig[];
|
|
5
|
+
outputs: HandleConfig[];
|
|
6
|
+
height: number;
|
|
7
|
+
compact: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 按端口较多的一侧计算 CLASSIC nodepackage 节点高度。
|
|
11
|
+
*
|
|
12
|
+
* 1–6 个端口保持 72px;7–12 个端口按 24px 递增;超过 12 个端口
|
|
13
|
+
* 使用 16px 紧凑步长,并在极端 Schema 下限制节点最大高度。
|
|
14
|
+
*/
|
|
15
|
+
export declare function getClassicNodePackageHeight(portCount: number): {
|
|
16
|
+
height: number;
|
|
17
|
+
compact: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 将 NodeSchema 的 inputs/outputs 转为 SuperBaseNode 所需的 handle 配置。
|
|
21
|
+
* 不补造默认端口,空数组即代表该方向没有端口。
|
|
22
|
+
*/
|
|
23
|
+
export declare function createClassicNodePackagePortLayout(schema: Pick<DipNodeSchema, 'inputs' | 'outputs'>): ClassicNodePackagePortLayout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DipNodeSchema } from '../api/dip';
|
|
2
|
+
import { HandleConfig } from './SuperBaseNode';
|
|
3
|
+
import { NodeData, NodeType } from '../types/Node';
|
|
4
|
+
type PortLoadStatus = 'legacy' | 'loading' | 'ready' | 'error';
|
|
5
|
+
interface UseClassicNodePackagePortsOptions {
|
|
6
|
+
nodeType: NodeType;
|
|
7
|
+
data: NodeData;
|
|
8
|
+
legacyInputs: HandleConfig[];
|
|
9
|
+
legacyOutputs: HandleConfig[];
|
|
10
|
+
resolvePortSchema?: (schema: DipNodeSchema) => Pick<DipNodeSchema, 'inputs' | 'outputs'>;
|
|
11
|
+
}
|
|
12
|
+
interface ClassicNodePackagePortsResult {
|
|
13
|
+
inputs: HandleConfig[];
|
|
14
|
+
outputs: HandleConfig[];
|
|
15
|
+
height?: number;
|
|
16
|
+
status: PortLoadStatus;
|
|
17
|
+
isNodePackage: boolean;
|
|
18
|
+
schema: DipNodeSchema | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 为 CLASSIC nodepackage 节点加载 NodeSchema 并生成动态端口。
|
|
22
|
+
*
|
|
23
|
+
* 仅当宿主开启 connectable 能力、引擎是 CLASSIC 且
|
|
24
|
+
* isClassicNextCompatibleNode 返回 true 时生效;其它节点完整保留 legacy 端口。
|
|
25
|
+
*/
|
|
26
|
+
export declare function useClassicNodePackagePorts({ nodeType, data, legacyInputs, legacyOutputs, resolvePortSchema, }: UseClassicNodePackagePortsOptions): ClassicNodePackagePortsResult;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,7 @@ interface ActionNodeConfigProps {
|
|
|
4
4
|
nodeType?: NodeType | string;
|
|
5
5
|
data: any;
|
|
6
6
|
onSubmit: (values: any, isRunNodeTest?: boolean) => void;
|
|
7
|
+
onNodePackageValuesChange?: (properties: Record<string, unknown>) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare const ActionNodeConfig: import('react').NamedExoticComponent<ActionNodeConfigProps & import('react').RefAttributes<any>>;
|
|
9
10
|
export {};
|
package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fields/WorkflowCodeField.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WorkflowCodeField: import('../../../../../dynamic-form/types/field-component').FieldComponentDefinition<import('../../../../../dynamic-form/types/form-schema').FieldDef>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WorkflowProxyField: import('../../../../../dynamic-form/types/field-component').FieldComponentDefinition<import('../../../../../dynamic-form/types/form-schema').FieldDef>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DipNodeSchema } from '../../api/dip';
|
|
2
|
+
type FormValues = Record<string, unknown>;
|
|
3
|
+
/** 查找 NodeSchema 中由宿主处理的代理网关字段。 */
|
|
4
|
+
export declare function getProxyFieldKey(schema?: DipNodeSchema | null): string | undefined;
|
|
5
|
+
/** 将代理网关 ID 归一化为 ACM 表单和接口使用的字符串。 */
|
|
6
|
+
export declare function normalizeProxyId(value: unknown): string;
|
|
7
|
+
/** 将顶层 proxy_id 回填到 DynamicForm 的实际 PROXY 字段。 */
|
|
8
|
+
export declare function hydrateProxyField(values: FormValues, schema?: DipNodeSchema | null, proxyId?: unknown): FormValues;
|
|
9
|
+
/**
|
|
10
|
+
* 从 DynamicForm values 提取宿主代理元数据。
|
|
11
|
+
*
|
|
12
|
+
* PROXY 是工作流宿主能力,不属于 NodePackage 业务参数,因此提交时从 properties 中移除。
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractProxyField(values: FormValues, schema?: DipNodeSchema | null): {
|
|
15
|
+
properties: FormValues;
|
|
16
|
+
proxyId?: string;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/components/digitalsee/workflow/NodesConfig/components/EditInOnlineIDE/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ interface IEditInOnlineIDEProps extends PropsWithChildren<any> {
|
|
|
6
6
|
id: string;
|
|
7
7
|
nodeId: string;
|
|
8
8
|
value?: string;
|
|
9
|
+
language?: 'javascript' | 'json';
|
|
10
|
+
showVariableSidebar?: boolean;
|
|
9
11
|
}
|
|
10
12
|
export declare const EditInOnlineIDE: (props: IEditInOnlineIDEProps) => any;
|
|
11
13
|
export {};
|
|
@@ -5,5 +5,7 @@ export interface IOnlineIDEProps {
|
|
|
5
5
|
onFinish: (value: string) => void;
|
|
6
6
|
onCancel: () => void;
|
|
7
7
|
open?: boolean;
|
|
8
|
+
language?: 'javascript' | 'json';
|
|
9
|
+
showVariableSidebar?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export default function OnlineIDE(props: IOnlineIDEProps): import('react').ReactPortal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type EntryMode = 'automation' | 'mcp' | null;
|
|
3
|
+
interface EntryTypeSelectorProps {
|
|
4
|
+
onSelect: (mode: Exclude<EntryMode, null>) => void;
|
|
5
|
+
}
|
|
6
|
+
/** @description 首节点入口类型选择。 */
|
|
7
|
+
declare const EntryTypeSelector: React.FC<EntryTypeSelectorProps>;
|
|
8
|
+
export default EntryTypeSelector;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NodeActionMeta } from '../hooks/useNodeActionState';
|
|
2
|
+
import { ActionItem, NodeTypeItem } from '../types';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
interface NodeCardListProps {
|
|
5
|
+
isSearching: boolean;
|
|
6
|
+
visibleNodes: NodeTypeItem[];
|
|
7
|
+
useConnectableDataSource: boolean;
|
|
8
|
+
expandedNodeIds: string[];
|
|
9
|
+
nodeActionsMap: Record<string, NodeActionMeta>;
|
|
10
|
+
searchText: string;
|
|
11
|
+
isLoadingNodes: boolean;
|
|
12
|
+
hasMore: boolean;
|
|
13
|
+
onNodeToggle: (node: NodeTypeItem) => void;
|
|
14
|
+
onActionSelect: (node: NodeTypeItem, action: ActionItem) => void;
|
|
15
|
+
onLoadAllActions: (node: NodeTypeItem) => void;
|
|
16
|
+
}
|
|
17
|
+
/** @description 节点卡片集合及其加载、空态和分页尾部。 */
|
|
18
|
+
declare const NodeCardList: React.FC<NodeCardListProps>;
|
|
19
|
+
export default NodeCardList;
|
package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useCategories.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { CategoryItem, CategoryRequestType } from '../types';
|
|
2
|
+
import { NodeAddInfo } from '../../../types/NodeAddContext';
|
|
2
3
|
interface UseCategoriesProps {
|
|
3
4
|
onFetchCategories: (type?: CategoryRequestType) => Promise<CategoryItem[]>;
|
|
4
5
|
restrictToCategory?: string;
|
|
5
6
|
nodeSelectorVisible: boolean;
|
|
6
|
-
nodeAddInfo?:
|
|
7
|
+
nodeAddInfo?: NodeAddInfo | null;
|
|
7
8
|
fallbackCategories?: CategoryItem[];
|
|
9
|
+
requestContextKey: string;
|
|
10
|
+
useConnectableDataSource?: boolean;
|
|
8
11
|
}
|
|
9
|
-
export declare const useCategories: ({ onFetchCategories, restrictToCategory, nodeSelectorVisible, nodeAddInfo, fallbackCategories, }: UseCategoriesProps) => {
|
|
12
|
+
export declare const useCategories: ({ onFetchCategories, restrictToCategory, nodeSelectorVisible, nodeAddInfo, fallbackCategories, requestContextKey, useConnectableDataSource, }: UseCategoriesProps) => {
|
|
10
13
|
categories: CategoryItem[];
|
|
14
|
+
categoriesReady: boolean;
|
|
11
15
|
isLoadingCategories: boolean;
|
|
12
16
|
setCategories: import('react').Dispatch<import('react').SetStateAction<CategoryItem[]>>;
|
|
13
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ActionItem, LinkSearchParams, ModernNodeSelectorProps, NodeFetchResult, NodeTypeItem } from '../types';
|
|
2
|
+
import { NodeAddInfo } from '../../../types/NodeAddContext';
|
|
3
|
+
type SearchHandler = NonNullable<ModernNodeSelectorProps['onSearch']>;
|
|
4
|
+
type CategoryHandler = NonNullable<ModernNodeSelectorProps['onFetchCategories']>;
|
|
5
|
+
type NodeCategoryHandler = NonNullable<ModernNodeSelectorProps['onFetchNodesByCategory']>;
|
|
6
|
+
type EntryMode = 'automation' | 'mcp' | null;
|
|
7
|
+
interface FetchNodeActionOptions {
|
|
8
|
+
suppressLoading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface UseConnectableNodeSelectorProps {
|
|
11
|
+
nodeSelectorVisible: boolean;
|
|
12
|
+
entryMode: EntryMode;
|
|
13
|
+
effectiveNodeAddInfo?: NodeAddInfo | null;
|
|
14
|
+
workflowId?: string;
|
|
15
|
+
onSearch?: SearchHandler;
|
|
16
|
+
onFetchCategories?: CategoryHandler;
|
|
17
|
+
onFetchNodesByCategory?: NodeCategoryHandler;
|
|
18
|
+
fetchLegacyNodeActions: (node: NodeTypeItem, options?: FetchNodeActionOptions) => Promise<ActionItem[]>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @description 为 NodePackage 连线场景选择数据源,并封装查询、边中插入求交与旧接口回退。
|
|
22
|
+
*/
|
|
23
|
+
export declare function useConnectableNodeSelector({ nodeSelectorVisible, entryMode, effectiveNodeAddInfo, workflowId, onSearch, onFetchCategories, onFetchNodesByCategory, fetchLegacyNodeActions, }: UseConnectableNodeSelectorProps): {
|
|
24
|
+
actionRequestContextKey: string;
|
|
25
|
+
connectableContext: import('../utils/connectableQuery').ConnectableQueryContext;
|
|
26
|
+
useConnectableDataSource: boolean;
|
|
27
|
+
onSearch: (params?: LinkSearchParams) => Promise<NodeFetchResult>;
|
|
28
|
+
onFetchCategories: (type?: import('../types').CategoryRequestType) => Promise<import('../types').CategoryItem[] | {
|
|
29
|
+
id: any;
|
|
30
|
+
name: any;
|
|
31
|
+
description: any;
|
|
32
|
+
icon: any;
|
|
33
|
+
search_action: any;
|
|
34
|
+
children: any;
|
|
35
|
+
nodes: any[];
|
|
36
|
+
}[]>;
|
|
37
|
+
onFetchNodesByCategory: (params?: LinkSearchParams) => Promise<NodeFetchResult>;
|
|
38
|
+
fetchNodeActions: (node: NodeTypeItem, options?: FetchNodeActionOptions) => Promise<ActionItem[]>;
|
|
39
|
+
};
|
|
40
|
+
export {};
|