@digitalsee-ai/rcs 2.0.0-beta5 → 2.0.0-beta7
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/Edges/edgeLayout.d.ts +24 -0
- package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +13 -5
- package/dist/components/digitalsee/workflow/config/themeConfig.d.ts +1 -0
- package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +4 -2
- package/dist/components/digitalsee/workflow/utils/graphLoop.d.ts +12 -0
- package/dist/{index-BmQBE_IZ.mjs → index-Dy43iMlV.mjs} +9545 -9484
- package/dist/{index-BsVgIib3.mjs → index-trJRukGS.mjs} +2 -2
- package/dist/rcs.es.js +1 -1
- package/dist/rcs.umd.js +67 -67
- package/package.json +1 -1
- package/dist/postcss.config.js +0 -1
|
@@ -71,3 +71,27 @@ export declare function getSelfLoopPath(params: SelfLoopPathParams): {
|
|
|
71
71
|
labelX: number;
|
|
72
72
|
labelY: number;
|
|
73
73
|
};
|
|
74
|
+
export interface LoopBackPathParams {
|
|
75
|
+
sourceX: number;
|
|
76
|
+
sourceY: number;
|
|
77
|
+
sourcePosition: Position | undefined;
|
|
78
|
+
targetX: number;
|
|
79
|
+
targetY: number;
|
|
80
|
+
targetPosition: Position | undefined;
|
|
81
|
+
/** 圆角半径(透传 EDGE_BORDER_RADIUS) */
|
|
82
|
+
borderRadius: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 生成多节点回环边的路径:绕到链路下方走大 U 形,避免与中间节点/边交叉。
|
|
86
|
+
*
|
|
87
|
+
* 与自环不同,多节点回环两端距离远、中间隔着整条链路的节点,
|
|
88
|
+
* SmoothStep 的 centerY 水平段会穿过节点形成 8 字交叉。
|
|
89
|
+
* 本函数强制走"下方 U 形":source 端先向开口方向伸出 L 再向下绕、
|
|
90
|
+
* target 端先向开口方向伸出 L 再向上收,中间水平段在所有节点下方
|
|
91
|
+
* (source 下绕、target 上绕,两端反向错开,不与链路同高交叉)。
|
|
92
|
+
*/
|
|
93
|
+
export declare function getLoopBackPath(params: LoopBackPathParams): {
|
|
94
|
+
edgePath: string;
|
|
95
|
+
labelX: number;
|
|
96
|
+
labelY: number;
|
|
97
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeAddInfo } from '../types/NodeAddContext';
|
|
2
|
-
import { Node } from '@xyflow/react';
|
|
2
|
+
import { Edge, Node } from '@xyflow/react';
|
|
3
3
|
interface HandleExtenderVisibilityOptions {
|
|
4
4
|
type: 'source' | 'target';
|
|
5
5
|
handleId?: string;
|
|
@@ -28,16 +28,24 @@ interface SelfConnectionDragOptions {
|
|
|
28
28
|
type: string;
|
|
29
29
|
} | null;
|
|
30
30
|
fromNode: Node | null;
|
|
31
|
+
toHandle?: {
|
|
32
|
+
id?: string | null;
|
|
33
|
+
nodeId: string;
|
|
34
|
+
type: string;
|
|
35
|
+
} | null;
|
|
36
|
+
toNode?: Node | null;
|
|
31
37
|
};
|
|
32
38
|
nodeId: string;
|
|
33
39
|
handleId: string;
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
|
-
*
|
|
37
|
-
* 命中 auto_connect
|
|
38
|
-
*
|
|
42
|
+
* 判断进行中的拖线是否为允许突破 maxConnections 限制的回环类连线:
|
|
43
|
+
* 1. 本节点自身输出桩发起、且 (sourceHandle -> handleId) 命中 auto_connect 声明的自连;
|
|
44
|
+
* 2. 多节点回环:fromHandle.nodeId 的祖先链上含 toHandle.nodeId,
|
|
45
|
+
* 新边闭合环路(回环连线不计入连线次数限制)。
|
|
46
|
+
* 命中时满载 target 桩临时解除禁用,拖线结束(成功/取消)后自动恢复。
|
|
39
47
|
*/
|
|
40
|
-
export declare function isAllowedSelfConnectionInProgress(options: SelfConnectionDragOptions): boolean;
|
|
48
|
+
export declare function isAllowedSelfConnectionInProgress(options: SelfConnectionDragOptions, currentEdges: Edge[]): boolean;
|
|
41
49
|
interface BuildHandleNodeAddInfoOptions {
|
|
42
50
|
type: 'source' | 'target';
|
|
43
51
|
nodeId: string;
|
|
@@ -161,6 +161,7 @@ export declare const canvasGeometry: {
|
|
|
161
161
|
HANDLE_SIZE: number;
|
|
162
162
|
SELF_LOOP_EXIT_OFFSET: number;
|
|
163
163
|
SELF_LOOP_DEPTH: number;
|
|
164
|
+
SELF_LOOP_TIP_OFFSET: number;
|
|
164
165
|
};
|
|
165
166
|
export declare const connectionRules: {
|
|
166
167
|
undeletableEdgeTargetTypes: NodeType[];
|
|
@@ -3,8 +3,10 @@ import { Edge } from '@xyflow/react';
|
|
|
3
3
|
/**
|
|
4
4
|
* 过滤指定 Handle 上的边,用于 maxConnections 计数。
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* 回环类连线不占 target 桩的 maxConnections 名额:
|
|
7
|
+
* 1. 自环边(source === target,如 LOOP 的 loop -> input);
|
|
8
|
+
* 2. 多节点回环边(源节点位于本节点下游,即存在 本节点 -> ... -> 源节点 通路)。
|
|
9
|
+
* handleStatus 仍将其视为已连接样式。
|
|
8
10
|
*/
|
|
9
11
|
export declare const filterHandleConnections: (edges: readonly Edge[], nodeId: string, handleId: string, handleType: HandleDirection) => Edge[];
|
|
10
12
|
export declare function useHandleConnections(): {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Edge } from '@xyflow/react';
|
|
2
|
+
/**
|
|
3
|
+
* 判断 fromNodeId -> toNodeId 的连线是否会形成回环。
|
|
4
|
+
*
|
|
5
|
+
* 从 fromNodeId 出发沿入边(edge.target === current)向上遍历祖先链:
|
|
6
|
+
* - 途中遇到 toNodeId,说明已存在 toNodeId -> ... -> fromNodeId 的通路,
|
|
7
|
+
* 新边将闭合环路,返回 true;
|
|
8
|
+
* - 遍历到根(无入边)仍未遇到,返回 false。
|
|
9
|
+
*
|
|
10
|
+
* 用 visited 集合防止图中已有环导致死循环。
|
|
11
|
+
*/
|
|
12
|
+
export declare function isLoopEdgeLine(fromNodeId: string, toNodeId: string, edges: Edge[]): boolean;
|