@uipath/apollo-react 4.14.1-pr556.aa710a0 → 4.15.0
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/canvas/components/AddNodePanel/createAddNodePreview.cjs +3 -9
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.js +3 -9
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +0 -1
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.cjs +5 -11
- package/dist/canvas/components/BaseNode/BaseNode.d.ts +1 -2
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +6 -9
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts +0 -3
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +13 -222
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts +5 -10
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +14 -223
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +2 -10
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts +0 -2
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +3 -5
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +2 -17
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts +1 -10
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/HandleButton.js +2 -17
- package/dist/canvas/components/ButtonHandle/useButtonHandles.cjs +2 -4
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts +1 -2
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.js +2 -4
- package/dist/canvas/components/Edges/SequenceEdge.cjs +14 -16
- package/dist/canvas/components/Edges/SequenceEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/SequenceEdge.js +14 -16
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +25 -34
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts +2 -8
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +27 -36
- package/dist/canvas/components/HierarchicalCanvas/index.d.ts +1 -1
- package/dist/canvas/components/HierarchicalCanvas/index.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.cjs +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.js +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.cjs +23 -25
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.js +25 -27
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.cjs +3 -10
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.js +3 -10
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts +0 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts.map +1 -1
- package/dist/canvas/components/index.cjs +20 -27
- package/dist/canvas/components/index.d.ts +0 -1
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +0 -1
- package/dist/canvas/constants.cjs +0 -4
- package/dist/canvas/constants.d.ts +0 -1
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +1 -2
- package/dist/canvas/core/NodeTypeRegistry.cjs +26 -50
- package/dist/canvas/core/NodeTypeRegistry.d.ts +5 -10
- package/dist/canvas/core/NodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/NodeTypeRegistry.js +26 -50
- package/dist/canvas/core/useNodeTypeRegistry.cjs +3 -13
- package/dist/canvas/core/useNodeTypeRegistry.d.ts +1 -2
- package/dist/canvas/core/useNodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/useNodeTypeRegistry.js +4 -11
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.cjs +23 -22
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.d.ts.map +1 -1
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.js +24 -23
- package/dist/canvas/hooks/usePreviewNode.cjs +3 -7
- package/dist/canvas/hooks/usePreviewNode.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.js +3 -7
- package/dist/canvas/schema/node-definition/handle.cjs +2 -10
- package/dist/canvas/schema/node-definition/handle.d.ts +0 -9
- package/dist/canvas/schema/node-definition/handle.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/handle.js +1 -6
- package/dist/canvas/schema/node-definition/index.cjs +1 -4
- package/dist/canvas/schema/node-definition/index.d.ts +3 -3
- package/dist/canvas/schema/node-definition/index.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/index.js +2 -2
- package/dist/canvas/schema/node-definition/node-manifest.d.ts +0 -4
- package/dist/canvas/schema/node-definition/node-manifest.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/hooks/useCanvasStory.d.ts +0 -6
- package/dist/canvas/storybook-utils/hooks/useCanvasStory.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts +0 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/mocks/nodes.d.ts +1 -1
- package/dist/canvas/storybook-utils/mocks/nodes.d.ts.map +1 -1
- package/dist/canvas/styles/reactflow-reset.css +2 -2
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/utils/collapse.cjs +6 -13
- package/dist/canvas/utils/collapse.d.ts +2 -2
- package/dist/canvas/utils/collapse.d.ts.map +1 -1
- package/dist/canvas/utils/collapse.js +2 -9
- package/dist/canvas/utils/createPreviewNode.cjs +11 -30
- package/dist/canvas/utils/createPreviewNode.d.ts +2 -10
- package/dist/canvas/utils/createPreviewNode.d.ts.map +1 -1
- package/dist/canvas/utils/createPreviewNode.js +11 -21
- package/dist/canvas/utils/index.cjs +26 -33
- package/dist/canvas/utils/index.d.ts +1 -2
- package/dist/canvas/utils/index.d.ts.map +1 -1
- package/dist/canvas/utils/index.js +1 -2
- package/dist/canvas/utils/manifest-resolver.cjs +0 -8
- package/dist/canvas/utils/manifest-resolver.d.ts +0 -1
- package/dist/canvas/utils/manifest-resolver.d.ts.map +1 -1
- package/dist/canvas/utils/manifest-resolver.js +1 -6
- package/package.json +1 -1
- package/dist/canvas/components/LoopNode/LoopCanvasNode.cjs +0 -86
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts +0 -6
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopCanvasNode.js +0 -52
- package/dist/canvas/components/LoopNode/LoopNode.cjs +0 -434
- package/dist/canvas/components/LoopNode/LoopNode.constants.cjs +0 -81
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts +0 -13
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.constants.js +0 -14
- package/dist/canvas/components/LoopNode/LoopNode.d.ts +0 -5
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.cjs +0 -144
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts +0 -29
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +0 -98
- package/dist/canvas/components/LoopNode/LoopNode.js +0 -400
- package/dist/canvas/components/LoopNode/LoopNode.types.cjs +0 -18
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +0 -22
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.types.js +0 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.cjs +0 -61
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts +0 -9
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNodePreview.js +0 -27
- package/dist/canvas/components/LoopNode/index.cjs +0 -79
- package/dist/canvas/components/LoopNode/index.d.ts +0 -5
- package/dist/canvas/components/LoopNode/index.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/index.js +0 -4
- package/dist/canvas/components/NodeViewportOverlay.cjs +0 -63
- package/dist/canvas/components/NodeViewportOverlay.d.ts +0 -22
- package/dist/canvas/components/NodeViewportOverlay.d.ts.map +0 -1
- package/dist/canvas/components/NodeViewportOverlay.js +0 -29
- package/dist/canvas/utils/createPreviewGraph.cjs +0 -126
- package/dist/canvas/utils/createPreviewGraph.d.ts +0 -36
- package/dist/canvas/utils/createPreviewGraph.d.ts.map +0 -1
- package/dist/canvas/utils/createPreviewGraph.js +0 -83
|
@@ -29,8 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
|
+
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
32
33
|
const index_cjs_namespaceObject = require("../../hooks/index.cjs");
|
|
33
|
-
const createPreviewNode_cjs_namespaceObject = require("../../utils/createPreviewNode.cjs");
|
|
34
34
|
const BaseCanvasModeProvider_cjs_namespaceObject = require("../BaseCanvas/BaseCanvasModeProvider.cjs");
|
|
35
35
|
const external_Toolbar_index_cjs_namespaceObject = require("../Toolbar/index.cjs");
|
|
36
36
|
const external_EdgeUtils_cjs_namespaceObject = require("./EdgeUtils.cjs");
|
|
@@ -80,11 +80,7 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ (0, external_react_namespaceObje
|
|
|
80
80
|
const pathElementRef = (0, external_react_namespaceObject.useRef)(null);
|
|
81
81
|
const { mode } = (0, BaseCanvasModeProvider_cjs_namespaceObject.useBaseCanvasMode)();
|
|
82
82
|
const isReadOnly = 'readonly' === mode;
|
|
83
|
-
const
|
|
84
|
-
id,
|
|
85
|
-
source,
|
|
86
|
-
target
|
|
87
|
-
});
|
|
83
|
+
const isPreviewEdge = id === external_constants_cjs_namespaceObject.PREVIEW_EDGE_ID;
|
|
88
84
|
const executionStatus = (0, index_cjs_namespaceObject.useEdgeExecutionState)(id, target);
|
|
89
85
|
const { validationStatus } = (0, index_cjs_namespaceObject.useElementValidationStatus)(id) ?? {
|
|
90
86
|
validationStatus: void 0
|
|
@@ -92,6 +88,8 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ (0, external_react_namespaceObje
|
|
|
92
88
|
const status = executionStatus ? executionStatus?.status ?? executionStatus : validationStatus;
|
|
93
89
|
const isDiffAdded = data?.isDiffAdded === true;
|
|
94
90
|
const isDiffRemoved = data?.isDiffRemoved === true;
|
|
91
|
+
const hideArrowHead = data?.hideArrowHead === true;
|
|
92
|
+
const hideToolbar = data?.hideToolbar === true;
|
|
95
93
|
const angle = ANGLE_MAP[targetPosition];
|
|
96
94
|
const { x: offsetX, y: offsetY } = ARROW_OFFSETS[targetPosition];
|
|
97
95
|
const { edgePath, labelX, labelY } = (0, index_cjs_namespaceObject.useEdgePath)({
|
|
@@ -102,8 +100,8 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ (0, external_react_namespaceObje
|
|
|
102
100
|
sourceX,
|
|
103
101
|
sourceY,
|
|
104
102
|
sourcePosition,
|
|
105
|
-
targetX,
|
|
106
|
-
targetY,
|
|
103
|
+
targetX: hideArrowHead ? targetX + offsetX : targetX,
|
|
104
|
+
targetY: hideArrowHead ? targetY + offsetY : targetY,
|
|
107
105
|
targetPosition
|
|
108
106
|
});
|
|
109
107
|
const { showToolbar, toolbarPositioning, config: toolbarConfig, handleMouseMoveOnPath } = (0, external_Toolbar_index_cjs_namespaceObject.useEdgeToolbarState)({
|
|
@@ -120,7 +118,7 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ (0, external_react_namespaceObje
|
|
|
120
118
|
const getEdgeColor = ()=>{
|
|
121
119
|
if (isDiffAdded) return 'var(--canvas-success-icon)';
|
|
122
120
|
if (isDiffRemoved) return 'var(--canvas-error-icon)';
|
|
123
|
-
if (
|
|
121
|
+
if (isPreviewEdge) return 'var(--canvas-primary)';
|
|
124
122
|
if (selected) return 'var(--canvas-primary)';
|
|
125
123
|
if (isHovered) return 'var(--canvas-primary-hover)';
|
|
126
124
|
if (status) return external_EdgeUtils_cjs_namespaceObject.edgeTargetStatusToEdgeColor[status] ?? 'var(--canvas-border)';
|
|
@@ -164,18 +162,18 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ (0, external_react_namespaceObje
|
|
|
164
162
|
strokeWidth: style?.strokeWidth || 2,
|
|
165
163
|
style: {
|
|
166
164
|
stroke: edgeColor,
|
|
167
|
-
strokeDasharray: isDiffRemoved ? style?.strokeDasharray || '5,5' :
|
|
165
|
+
strokeDasharray: isDiffRemoved ? style?.strokeDasharray || '5,5' : isPreviewEdge ? '5,5' : '0',
|
|
168
166
|
opacity: style?.opacity !== void 0 ? style.opacity : 1,
|
|
169
167
|
transition: 'stroke 0.2s ease, opacity 0.2s ease'
|
|
170
168
|
},
|
|
171
169
|
ref: pathElementRef
|
|
172
170
|
}),
|
|
173
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("polygon", {
|
|
171
|
+
!hideArrowHead && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("polygon", {
|
|
174
172
|
points: `
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
${targetX},${targetY}
|
|
174
|
+
${targetX - ARROW_SIZE * Math.cos(angle - Math.PI / 6)},${targetY - ARROW_SIZE * Math.sin(angle - Math.PI / 6)}
|
|
175
|
+
${targetX - ARROW_SIZE * Math.cos(angle + Math.PI / 6)},${targetY - ARROW_SIZE * Math.sin(angle + Math.PI / 6)}
|
|
176
|
+
`,
|
|
179
177
|
fill: edgeColor,
|
|
180
178
|
style: {
|
|
181
179
|
pointerEvents: 'none',
|
|
@@ -215,7 +213,7 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ (0, external_react_namespaceObje
|
|
|
215
213
|
})
|
|
216
214
|
]
|
|
217
215
|
}),
|
|
218
|
-
showToolbar && toolbarPositioning && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.EdgeToolbar, {
|
|
216
|
+
!hideToolbar && showToolbar && toolbarPositioning && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.EdgeToolbar, {
|
|
219
217
|
edgeId: id,
|
|
220
218
|
visible: showToolbar,
|
|
221
219
|
positioning: toolbarPositioning,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceEdge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/SequenceEdge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,0CAA0C,CAAC;AAoDpF,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"SequenceEdge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/SequenceEdge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,0CAA0C,CAAC;AAoDpF,eAAO,MAAM,YAAY,iDA+MJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Position } from "../../xyflow/react.js";
|
|
3
3
|
import { memo, useRef, useState } from "react";
|
|
4
|
+
import { PREVIEW_EDGE_ID } from "../../constants.js";
|
|
4
5
|
import { useEdgeExecutionState, useEdgePath, useElementValidationStatus } from "../../hooks/index.js";
|
|
5
|
-
import { isPreviewEdge } from "../../utils/createPreviewNode.js";
|
|
6
6
|
import { useBaseCanvasMode } from "../BaseCanvas/BaseCanvasModeProvider.js";
|
|
7
7
|
import { EdgeToolbar, useEdgeToolbarState } from "../Toolbar/index.js";
|
|
8
8
|
import { edgeTargetStatusToEdgeColor, getStatusAnimation } from "./EdgeUtils.js";
|
|
@@ -52,11 +52,7 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ memo(function({ id, selected, so
|
|
|
52
52
|
const pathElementRef = useRef(null);
|
|
53
53
|
const { mode } = useBaseCanvasMode();
|
|
54
54
|
const isReadOnly = 'readonly' === mode;
|
|
55
|
-
const
|
|
56
|
-
id,
|
|
57
|
-
source,
|
|
58
|
-
target
|
|
59
|
-
});
|
|
55
|
+
const isPreviewEdge = id === PREVIEW_EDGE_ID;
|
|
60
56
|
const executionStatus = useEdgeExecutionState(id, target);
|
|
61
57
|
const { validationStatus } = useElementValidationStatus(id) ?? {
|
|
62
58
|
validationStatus: void 0
|
|
@@ -64,6 +60,8 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ memo(function({ id, selected, so
|
|
|
64
60
|
const status = executionStatus ? executionStatus?.status ?? executionStatus : validationStatus;
|
|
65
61
|
const isDiffAdded = data?.isDiffAdded === true;
|
|
66
62
|
const isDiffRemoved = data?.isDiffRemoved === true;
|
|
63
|
+
const hideArrowHead = data?.hideArrowHead === true;
|
|
64
|
+
const hideToolbar = data?.hideToolbar === true;
|
|
67
65
|
const angle = ANGLE_MAP[targetPosition];
|
|
68
66
|
const { x: offsetX, y: offsetY } = ARROW_OFFSETS[targetPosition];
|
|
69
67
|
const { edgePath, labelX, labelY } = useEdgePath({
|
|
@@ -74,8 +72,8 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ memo(function({ id, selected, so
|
|
|
74
72
|
sourceX,
|
|
75
73
|
sourceY,
|
|
76
74
|
sourcePosition,
|
|
77
|
-
targetX,
|
|
78
|
-
targetY,
|
|
75
|
+
targetX: hideArrowHead ? targetX + offsetX : targetX,
|
|
76
|
+
targetY: hideArrowHead ? targetY + offsetY : targetY,
|
|
79
77
|
targetPosition
|
|
80
78
|
});
|
|
81
79
|
const { showToolbar, toolbarPositioning, config: toolbarConfig, handleMouseMoveOnPath } = useEdgeToolbarState({
|
|
@@ -92,7 +90,7 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ memo(function({ id, selected, so
|
|
|
92
90
|
const getEdgeColor = ()=>{
|
|
93
91
|
if (isDiffAdded) return 'var(--canvas-success-icon)';
|
|
94
92
|
if (isDiffRemoved) return 'var(--canvas-error-icon)';
|
|
95
|
-
if (
|
|
93
|
+
if (isPreviewEdge) return 'var(--canvas-primary)';
|
|
96
94
|
if (selected) return 'var(--canvas-primary)';
|
|
97
95
|
if (isHovered) return 'var(--canvas-primary-hover)';
|
|
98
96
|
if (status) return edgeTargetStatusToEdgeColor[status] ?? 'var(--canvas-border)';
|
|
@@ -136,18 +134,18 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ memo(function({ id, selected, so
|
|
|
136
134
|
strokeWidth: style?.strokeWidth || 2,
|
|
137
135
|
style: {
|
|
138
136
|
stroke: edgeColor,
|
|
139
|
-
strokeDasharray: isDiffRemoved ? style?.strokeDasharray || '5,5' :
|
|
137
|
+
strokeDasharray: isDiffRemoved ? style?.strokeDasharray || '5,5' : isPreviewEdge ? '5,5' : '0',
|
|
140
138
|
opacity: style?.opacity !== void 0 ? style.opacity : 1,
|
|
141
139
|
transition: 'stroke 0.2s ease, opacity 0.2s ease'
|
|
142
140
|
},
|
|
143
141
|
ref: pathElementRef
|
|
144
142
|
}),
|
|
145
|
-
/*#__PURE__*/ jsx("polygon", {
|
|
143
|
+
!hideArrowHead && /*#__PURE__*/ jsx("polygon", {
|
|
146
144
|
points: `
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
${targetX},${targetY}
|
|
146
|
+
${targetX - ARROW_SIZE * Math.cos(angle - Math.PI / 6)},${targetY - ARROW_SIZE * Math.sin(angle - Math.PI / 6)}
|
|
147
|
+
${targetX - ARROW_SIZE * Math.cos(angle + Math.PI / 6)},${targetY - ARROW_SIZE * Math.sin(angle + Math.PI / 6)}
|
|
148
|
+
`,
|
|
151
149
|
fill: edgeColor,
|
|
152
150
|
style: {
|
|
153
151
|
pointerEvents: 'none',
|
|
@@ -187,7 +185,7 @@ const SequenceEdge_SequenceEdge = /*#__PURE__*/ memo(function({ id, selected, so
|
|
|
187
185
|
})
|
|
188
186
|
]
|
|
189
187
|
}),
|
|
190
|
-
showToolbar && toolbarPositioning && /*#__PURE__*/ jsx(EdgeToolbar, {
|
|
188
|
+
!hideToolbar && showToolbar && toolbarPositioning && /*#__PURE__*/ jsx(EdgeToolbar, {
|
|
191
189
|
edgeId: id,
|
|
192
190
|
visible: showToolbar,
|
|
193
191
|
positioning: toolbarPositioning,
|
|
@@ -38,7 +38,6 @@ const animatedViewportManager_cjs_namespaceObject = require("../../stores/animat
|
|
|
38
38
|
const canvasStore_cjs_namespaceObject = require("../../stores/canvasStore.cjs");
|
|
39
39
|
const viewportManager_cjs_namespaceObject = require("../../stores/viewportManager.cjs");
|
|
40
40
|
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
41
|
-
const createPreviewNode_cjs_namespaceObject = require("../../utils/createPreviewNode.cjs");
|
|
42
41
|
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
|
|
43
42
|
const transitions_cjs_namespaceObject = require("../../utils/transitions.cjs");
|
|
44
43
|
const AddNodeManager_cjs_namespaceObject = require("../AddNodePanel/AddNodeManager.cjs");
|
|
@@ -53,15 +52,7 @@ const DEFAULT_NODE_TYPES = {
|
|
|
53
52
|
'blank-canvas-node': external_BlankCanvasNode_index_cjs_namespaceObject.BlankCanvasNode,
|
|
54
53
|
preview: AddNodePreview_cjs_namespaceObject.AddNodePreview
|
|
55
54
|
};
|
|
56
|
-
|
|
57
|
-
if ('position' === change.type) return !!change.dragging;
|
|
58
|
-
if ('dimensions' === change.type) return !!change.setAttributes;
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
function isDefaultViewport(viewport) {
|
|
62
|
-
return 0 === viewport.x && 0 === viewport.y && 1 === viewport.zoom;
|
|
63
|
-
}
|
|
64
|
-
const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanvases, initialPath, onCanvasesChange, onPathChange })=>{
|
|
55
|
+
const HierarchicalCanvas = ({ mode = 'design', initialCanvases, initialPath, onCanvasesChange, onPathChange })=>{
|
|
65
56
|
const canvasRef = (0, external_react_namespaceObject.useRef)(null);
|
|
66
57
|
const containerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
67
58
|
const [reactFlowInstance, setReactFlowInstance] = (0, external_react_namespaceObject.useState)(null);
|
|
@@ -72,22 +63,17 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
72
63
|
});
|
|
73
64
|
const lastCanvasIdRef = (0, external_react_namespaceObject.useRef)(null);
|
|
74
65
|
const shouldAnimate = 'design' === mode && !(0, transitions_cjs_namespaceObject.prefersReducedMotion)();
|
|
75
|
-
const nodeManifests = (0, external_core_index_cjs_namespaceObject.
|
|
76
|
-
const nodeTypes = (0, external_react_namespaceObject.useMemo)(()=>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const resolvedRenderer = resolveNodeRenderer?.({
|
|
80
|
-
manifest,
|
|
81
|
-
defaultRenderer
|
|
82
|
-
});
|
|
83
|
-
acc[manifest.nodeType] = resolvedRenderer ?? defaultRenderer;
|
|
84
|
-
}
|
|
66
|
+
const nodeManifests = (0, external_core_index_cjs_namespaceObject.useNodeManifests)();
|
|
67
|
+
const nodeTypes = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
68
|
+
const types = nodeManifests.reduce((acc, manifest)=>{
|
|
69
|
+
if (!acc[manifest.nodeType]) acc[manifest.nodeType] = external_BaseNode_index_cjs_namespaceObject.BaseNode;
|
|
85
70
|
return acc;
|
|
86
71
|
}, {
|
|
87
72
|
...DEFAULT_NODE_TYPES
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
});
|
|
74
|
+
return types;
|
|
75
|
+
}, [
|
|
76
|
+
nodeManifests
|
|
91
77
|
]);
|
|
92
78
|
const currentCanvas = (0, canvasStore_cjs_namespaceObject.useCanvasStore)(canvasStore_cjs_namespaceObject.selectCurrentCanvas);
|
|
93
79
|
const previousCanvas = (0, canvasStore_cjs_namespaceObject.useCanvasStore)(canvasStore_cjs_namespaceObject.selectPreviousCanvas);
|
|
@@ -162,14 +148,15 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
162
148
|
if (currentCanvasId && lastCanvasIdRef.current && currentCanvasId !== lastCanvasIdRef.current) {
|
|
163
149
|
if (reactFlowInstance && currentCanvas?.viewport) {
|
|
164
150
|
const viewport = currentCanvas.viewport;
|
|
165
|
-
if (
|
|
166
|
-
currentViewportRef.current = viewport;
|
|
167
|
-
viewportManager_cjs_namespaceObject.viewportManager.setCurrentViewport(viewport);
|
|
168
|
-
} else setTimeout(()=>{
|
|
151
|
+
if (0 !== viewport.x || 0 !== viewport.y || 1 !== viewport.zoom) setTimeout(()=>{
|
|
169
152
|
reactFlowInstance.setViewport(viewport);
|
|
170
153
|
currentViewportRef.current = viewport;
|
|
171
154
|
viewportManager_cjs_namespaceObject.viewportManager.setCurrentViewport(viewport);
|
|
172
155
|
}, 0);
|
|
156
|
+
else {
|
|
157
|
+
currentViewportRef.current = viewport;
|
|
158
|
+
viewportManager_cjs_namespaceObject.viewportManager.setCurrentViewport(viewport);
|
|
159
|
+
}
|
|
173
160
|
}
|
|
174
161
|
}
|
|
175
162
|
lastCanvasIdRef.current = currentCanvasId || null;
|
|
@@ -184,7 +171,9 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
184
171
|
const handleNodesChange = (0, external_react_namespaceObject.useCallback)((changes)=>{
|
|
185
172
|
const canvas = currentCanvasRef.current;
|
|
186
173
|
if (!canvas) return;
|
|
187
|
-
|
|
174
|
+
const hasMeaningfulChanges = changes.some((change)=>'dimensions' !== change.type && 'position' !== change.type);
|
|
175
|
+
const hasPositionChanges = changes.some((change)=>'position' === change.type && change.dragging);
|
|
176
|
+
if (!hasMeaningfulChanges && !hasPositionChanges) return;
|
|
188
177
|
const updatedNodes = (0, react_cjs_namespaceObject.applyNodeChanges)(changes, canvas.nodes ?? []);
|
|
189
178
|
updateNodes(updatedNodes);
|
|
190
179
|
}, [
|
|
@@ -216,7 +205,7 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
216
205
|
const handleConnect = (0, external_react_namespaceObject.useCallback)((connection)=>{
|
|
217
206
|
const canvas = currentCanvasRef.current;
|
|
218
207
|
if (!connection.source || !connection.target || !canvas) return;
|
|
219
|
-
if (
|
|
208
|
+
if (connection.target === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID || connection.source === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID) return;
|
|
220
209
|
const newEdge = {
|
|
221
210
|
id: `${connection.source}-${connection.target}-${Date.now()}`,
|
|
222
211
|
source: connection.source,
|
|
@@ -224,13 +213,15 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
224
213
|
sourceHandle: connection.sourceHandle || void 0,
|
|
225
214
|
targetHandle: connection.targetHandle || void 0
|
|
226
215
|
};
|
|
227
|
-
const hasPreview = canvas.nodes.some((n)=>n.id === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID);
|
|
228
|
-
const baseEdges = hasPreview ? canvas.edges.filter((edge)=>!(0, createPreviewNode_cjs_namespaceObject.isPreviewEdge)(edge)) : canvas.edges;
|
|
229
216
|
updateEdges([
|
|
230
|
-
...
|
|
217
|
+
...canvas.edges,
|
|
231
218
|
newEdge
|
|
232
219
|
]);
|
|
233
|
-
|
|
220
|
+
const hasPreview = canvas.nodes.some((n)=>n.id === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID);
|
|
221
|
+
if (hasPreview) {
|
|
222
|
+
updateNodes(canvas.nodes.filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID));
|
|
223
|
+
updateEdges(canvas.edges.filter((e)=>e.id !== external_constants_cjs_namespaceObject.PREVIEW_EDGE_ID));
|
|
224
|
+
}
|
|
234
225
|
}, [
|
|
235
226
|
updateNodes,
|
|
236
227
|
updateEdges
|
|
@@ -264,7 +255,7 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
264
255
|
]);
|
|
265
256
|
const shouldFitView = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
266
257
|
const viewport = currentCanvas?.viewport;
|
|
267
|
-
return viewport ?
|
|
258
|
+
return viewport ? 0 === viewport.x && 0 === viewport.y && 1 === viewport.zoom : false;
|
|
268
259
|
}, [
|
|
269
260
|
currentCanvas?.viewport
|
|
270
261
|
]);
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { type NodeTypes } from '../../xyflow/react.ts';
|
|
2
1
|
import type React from 'react';
|
|
3
|
-
import type { NodeManifest } from '../../schema/node-definition';
|
|
4
2
|
import type { CanvasLevel } from '../../types/canvas.types';
|
|
5
|
-
|
|
6
|
-
manifest: NodeManifest;
|
|
7
|
-
defaultRenderer: NodeTypes[string];
|
|
8
|
-
}) => NodeTypes[string] | undefined;
|
|
9
|
-
export interface HierarchicalCanvasProps {
|
|
10
|
-
resolveNodeRenderer?: NodeRendererResolver;
|
|
3
|
+
interface HierarchicalCanvasProps {
|
|
11
4
|
mode?: 'view' | 'design' | 'readonly';
|
|
12
5
|
initialCanvases?: Record<string, CanvasLevel>;
|
|
13
6
|
initialPath?: string[];
|
|
@@ -15,4 +8,5 @@ export interface HierarchicalCanvasProps {
|
|
|
15
8
|
onPathChange?: (path: string[]) => void;
|
|
16
9
|
}
|
|
17
10
|
export declare const HierarchicalCanvas: React.FC<HierarchicalCanvasProps>;
|
|
11
|
+
export {};
|
|
18
12
|
//# sourceMappingURL=HierarchicalCanvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchicalCanvas.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/HierarchicalCanvas/HierarchicalCanvas.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HierarchicalCanvas.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/HierarchicalCanvas/HierarchicalCanvas.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4B/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAW5D,UAAU,uBAAuB;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IAKtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAK9C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAMvB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,IAAI,CAAC;IAInE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACzC;AASD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA2YhE,CAAC"}
|
|
@@ -2,15 +2,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Panel, applyEdgeChanges, applyNodeChanges } from "../../xyflow/react.js";
|
|
3
3
|
import { Spinner } from "@uipath/apollo-wind";
|
|
4
4
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
-
import { PREVIEW_NODE_ID } from "../../constants.js";
|
|
5
|
+
import { PREVIEW_EDGE_ID, PREVIEW_NODE_ID } from "../../constants.js";
|
|
6
6
|
import { Breadcrumb } from "../../controls/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useNodeManifests } from "../../core/index.js";
|
|
8
8
|
import { useAddNodeOnConnectEnd } from "../../hooks/useAddNodeOnConnectEnd.js";
|
|
9
9
|
import { animatedViewportManager } from "../../stores/animatedViewportManager.js";
|
|
10
10
|
import { selectBreadcrumbs, selectCanvasStack, selectCurrentCanvas, selectCurrentPath, selectDrillIntoNode, selectInitializeCanvas, selectInitializeWithData, selectNavigateToDepth, selectNavigateToSiblingCanvas, selectPreviousCanvas, selectTransitionState, selectUpdateEdges, selectUpdateNodes, selectUpdateSelection, selectUpdateViewport, useCanvasStore } from "../../stores/canvasStore.js";
|
|
11
11
|
import { viewportManager } from "../../stores/viewportManager.js";
|
|
12
12
|
import { DefaultCanvasTranslations } from "../../types.js";
|
|
13
|
-
import { isPreviewEdge } from "../../utils/createPreviewNode.js";
|
|
14
13
|
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
15
14
|
import { prefersReducedMotion } from "../../utils/transitions.js";
|
|
16
15
|
import { AddNodeManager } from "../AddNodePanel/AddNodeManager.js";
|
|
@@ -25,15 +24,7 @@ const DEFAULT_NODE_TYPES = {
|
|
|
25
24
|
'blank-canvas-node': BlankCanvasNode,
|
|
26
25
|
preview: AddNodePreview
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
if ('position' === change.type) return !!change.dragging;
|
|
30
|
-
if ('dimensions' === change.type) return !!change.setAttributes;
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
function isDefaultViewport(viewport) {
|
|
34
|
-
return 0 === viewport.x && 0 === viewport.y && 1 === viewport.zoom;
|
|
35
|
-
}
|
|
36
|
-
const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanvases, initialPath, onCanvasesChange, onPathChange })=>{
|
|
27
|
+
const HierarchicalCanvas = ({ mode = 'design', initialCanvases, initialPath, onCanvasesChange, onPathChange })=>{
|
|
37
28
|
const canvasRef = useRef(null);
|
|
38
29
|
const containerRef = useRef(null);
|
|
39
30
|
const [reactFlowInstance, setReactFlowInstance] = useState(null);
|
|
@@ -44,22 +35,17 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
44
35
|
});
|
|
45
36
|
const lastCanvasIdRef = useRef(null);
|
|
46
37
|
const shouldAnimate = 'design' === mode && !prefersReducedMotion();
|
|
47
|
-
const nodeManifests =
|
|
48
|
-
const nodeTypes = useMemo(()=>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const resolvedRenderer = resolveNodeRenderer?.({
|
|
52
|
-
manifest,
|
|
53
|
-
defaultRenderer
|
|
54
|
-
});
|
|
55
|
-
acc[manifest.nodeType] = resolvedRenderer ?? defaultRenderer;
|
|
56
|
-
}
|
|
38
|
+
const nodeManifests = useNodeManifests();
|
|
39
|
+
const nodeTypes = useMemo(()=>{
|
|
40
|
+
const types = nodeManifests.reduce((acc, manifest)=>{
|
|
41
|
+
if (!acc[manifest.nodeType]) acc[manifest.nodeType] = BaseNode;
|
|
57
42
|
return acc;
|
|
58
43
|
}, {
|
|
59
44
|
...DEFAULT_NODE_TYPES
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
});
|
|
46
|
+
return types;
|
|
47
|
+
}, [
|
|
48
|
+
nodeManifests
|
|
63
49
|
]);
|
|
64
50
|
const currentCanvas = useCanvasStore(selectCurrentCanvas);
|
|
65
51
|
const previousCanvas = useCanvasStore(selectPreviousCanvas);
|
|
@@ -134,14 +120,15 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
134
120
|
if (currentCanvasId && lastCanvasIdRef.current && currentCanvasId !== lastCanvasIdRef.current) {
|
|
135
121
|
if (reactFlowInstance && currentCanvas?.viewport) {
|
|
136
122
|
const viewport = currentCanvas.viewport;
|
|
137
|
-
if (
|
|
138
|
-
currentViewportRef.current = viewport;
|
|
139
|
-
viewportManager.setCurrentViewport(viewport);
|
|
140
|
-
} else setTimeout(()=>{
|
|
123
|
+
if (0 !== viewport.x || 0 !== viewport.y || 1 !== viewport.zoom) setTimeout(()=>{
|
|
141
124
|
reactFlowInstance.setViewport(viewport);
|
|
142
125
|
currentViewportRef.current = viewport;
|
|
143
126
|
viewportManager.setCurrentViewport(viewport);
|
|
144
127
|
}, 0);
|
|
128
|
+
else {
|
|
129
|
+
currentViewportRef.current = viewport;
|
|
130
|
+
viewportManager.setCurrentViewport(viewport);
|
|
131
|
+
}
|
|
145
132
|
}
|
|
146
133
|
}
|
|
147
134
|
lastCanvasIdRef.current = currentCanvasId || null;
|
|
@@ -156,7 +143,9 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
156
143
|
const handleNodesChange = useCallback((changes)=>{
|
|
157
144
|
const canvas = currentCanvasRef.current;
|
|
158
145
|
if (!canvas) return;
|
|
159
|
-
|
|
146
|
+
const hasMeaningfulChanges = changes.some((change)=>'dimensions' !== change.type && 'position' !== change.type);
|
|
147
|
+
const hasPositionChanges = changes.some((change)=>'position' === change.type && change.dragging);
|
|
148
|
+
if (!hasMeaningfulChanges && !hasPositionChanges) return;
|
|
160
149
|
const updatedNodes = applyNodeChanges(changes, canvas.nodes ?? []);
|
|
161
150
|
updateNodes(updatedNodes);
|
|
162
151
|
}, [
|
|
@@ -188,7 +177,7 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
188
177
|
const handleConnect = useCallback((connection)=>{
|
|
189
178
|
const canvas = currentCanvasRef.current;
|
|
190
179
|
if (!connection.source || !connection.target || !canvas) return;
|
|
191
|
-
if (
|
|
180
|
+
if (connection.target === PREVIEW_NODE_ID || connection.source === PREVIEW_NODE_ID) return;
|
|
192
181
|
const newEdge = {
|
|
193
182
|
id: `${connection.source}-${connection.target}-${Date.now()}`,
|
|
194
183
|
source: connection.source,
|
|
@@ -196,13 +185,15 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
196
185
|
sourceHandle: connection.sourceHandle || void 0,
|
|
197
186
|
targetHandle: connection.targetHandle || void 0
|
|
198
187
|
};
|
|
199
|
-
const hasPreview = canvas.nodes.some((n)=>n.id === PREVIEW_NODE_ID);
|
|
200
|
-
const baseEdges = hasPreview ? canvas.edges.filter((edge)=>!isPreviewEdge(edge)) : canvas.edges;
|
|
201
188
|
updateEdges([
|
|
202
|
-
...
|
|
189
|
+
...canvas.edges,
|
|
203
190
|
newEdge
|
|
204
191
|
]);
|
|
205
|
-
|
|
192
|
+
const hasPreview = canvas.nodes.some((n)=>n.id === PREVIEW_NODE_ID);
|
|
193
|
+
if (hasPreview) {
|
|
194
|
+
updateNodes(canvas.nodes.filter((n)=>n.id !== PREVIEW_NODE_ID));
|
|
195
|
+
updateEdges(canvas.edges.filter((e)=>e.id !== PREVIEW_EDGE_ID));
|
|
196
|
+
}
|
|
206
197
|
}, [
|
|
207
198
|
updateNodes,
|
|
208
199
|
updateEdges
|
|
@@ -236,7 +227,7 @@ const HierarchicalCanvas = ({ resolveNodeRenderer, mode = 'design', initialCanva
|
|
|
236
227
|
]);
|
|
237
228
|
const shouldFitView = useMemo(()=>{
|
|
238
229
|
const viewport = currentCanvas?.viewport;
|
|
239
|
-
return viewport ?
|
|
230
|
+
return viewport ? 0 === viewport.x && 0 === viewport.y && 1 === viewport.zoom : false;
|
|
240
231
|
}, [
|
|
241
232
|
currentCanvas?.viewport
|
|
242
233
|
]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { HierarchicalCanvas
|
|
1
|
+
export { HierarchicalCanvas } from './HierarchicalCanvas';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/HierarchicalCanvas/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/HierarchicalCanvas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -38,7 +38,7 @@ const EdgeToolbarComponent = ({ edgeId, visible, positioning, config, onMouseEnt
|
|
|
38
38
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.EdgeLabelRenderer, {
|
|
39
39
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.AnimatePresence, {
|
|
40
40
|
children: visible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.div, {
|
|
41
|
-
className: "nodrag nopan absolute top-0 left-0
|
|
41
|
+
className: "nodrag nopan absolute top-0 left-0 pointer-events-auto z-[1000] flex flex-row items-center gap-1",
|
|
42
42
|
initial: {
|
|
43
43
|
opacity: 0
|
|
44
44
|
},
|
|
@@ -10,7 +10,7 @@ const EdgeToolbarComponent = ({ edgeId, visible, positioning, config, onMouseEnt
|
|
|
10
10
|
return /*#__PURE__*/ jsx(EdgeLabelRenderer, {
|
|
11
11
|
children: /*#__PURE__*/ jsx(AnimatePresence, {
|
|
12
12
|
children: visible && /*#__PURE__*/ jsx(motion.div, {
|
|
13
|
-
className: "nodrag nopan absolute top-0 left-0
|
|
13
|
+
className: "nodrag nopan absolute top-0 left-0 pointer-events-auto z-[1000] flex flex-row items-center gap-1",
|
|
14
14
|
initial: {
|
|
15
15
|
opacity: 0
|
|
16
16
|
},
|
|
@@ -29,7 +29,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
31
|
const external_constants_cjs_namespaceObject = require("../../../constants.cjs");
|
|
32
|
-
const createPreviewGraph_cjs_namespaceObject = require("../../../utils/createPreviewGraph.cjs");
|
|
33
32
|
const createPreviewNode_cjs_namespaceObject = require("../../../utils/createPreviewNode.cjs");
|
|
34
33
|
const BaseCanvasModeProvider_cjs_namespaceObject = require("../../BaseCanvas/BaseCanvasModeProvider.cjs");
|
|
35
34
|
const external_useEdgeToolbarPositioning_cjs_namespaceObject = require("./useEdgeToolbarPositioning.cjs");
|
|
@@ -37,14 +36,10 @@ function useEdgeToolbarState({ edgeId, pathElementRef, isHovered, source, target
|
|
|
37
36
|
const reactFlow = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
38
37
|
const { mode } = (0, BaseCanvasModeProvider_cjs_namespaceObject.useBaseCanvasMode)();
|
|
39
38
|
const isDesignMode = 'design' === mode;
|
|
40
|
-
const
|
|
41
|
-
id: edgeId,
|
|
42
|
-
source,
|
|
43
|
-
target
|
|
44
|
-
});
|
|
39
|
+
const isPreviewEdge = source === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID || target === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID;
|
|
45
40
|
const { positionData, handleMouseMoveOnPath } = (0, external_useEdgeToolbarPositioning_cjs_namespaceObject.useEdgeToolbarPositioning)({
|
|
46
41
|
pathElementRef,
|
|
47
|
-
isEnabled: isHovered && isDesignMode && !
|
|
42
|
+
isEnabled: isHovered && isDesignMode && !isPreviewEdge,
|
|
48
43
|
targetPosition
|
|
49
44
|
});
|
|
50
45
|
const handleAddNodeOnEdge = (0, external_react_namespaceObject.useCallback)((position)=>{
|
|
@@ -56,23 +51,26 @@ function useEdgeToolbarState({ edgeId, pathElementRef, isHovered, source, target
|
|
|
56
51
|
targetHandle: targetHandleId,
|
|
57
52
|
type: 'default'
|
|
58
53
|
};
|
|
59
|
-
(0,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
edgeId
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
const preview = (0, createPreviewNode_cjs_namespaceObject.createPreviewNode)(source, sourceHandleId || 'output', reactFlow, position, {
|
|
55
|
+
originalEdge
|
|
56
|
+
}, 'source', void 0, sourcePosition, ignoredNodeTypes);
|
|
57
|
+
if (!preview) return;
|
|
58
|
+
const secondEdge = {
|
|
59
|
+
id: `${external_constants_cjs_namespaceObject.PREVIEW_NODE_ID}-${target}`,
|
|
60
|
+
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
61
|
+
sourceHandle: 'output',
|
|
62
|
+
target,
|
|
63
|
+
targetHandle: targetHandleId,
|
|
64
|
+
type: 'default'
|
|
65
|
+
};
|
|
66
|
+
(0, createPreviewNode_cjs_namespaceObject.applyPreviewToReactFlow)(preview, reactFlow);
|
|
67
|
+
reactFlow.setEdges((edges)=>[
|
|
68
|
+
...edges.filter((e)=>e.id !== edgeId).map((e)=>({
|
|
69
|
+
...e,
|
|
70
|
+
selected: false
|
|
71
|
+
})),
|
|
72
|
+
secondEdge
|
|
73
|
+
]);
|
|
76
74
|
}, [
|
|
77
75
|
sourcePosition,
|
|
78
76
|
source,
|
|
@@ -98,7 +96,7 @@ function useEdgeToolbarState({ edgeId, pathElementRef, isHovered, source, target
|
|
|
98
96
|
}), [
|
|
99
97
|
handleAddNodeOnEdge
|
|
100
98
|
]);
|
|
101
|
-
const showToolbar = isHovered && isDesignMode && null !== positionData && !
|
|
99
|
+
const showToolbar = isHovered && isDesignMode && null !== positionData && !isPreviewEdge;
|
|
102
100
|
return {
|
|
103
101
|
showToolbar,
|
|
104
102
|
toolbarPositioning: positionData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEdgeToolbarState.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,QAAQ,EAAgB,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"useEdgeToolbarState.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,QAAQ,EAAgB,MAAM,0CAA0C,CAAC;AAKlG,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAGtF,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACnD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC3D;AAED,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,cAAc,EACd,SAAS,EACT,MAAM,EACN,MAAM,EACN,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,gBAAgB,CAoG7C"}
|