@uipath/apollo-react 6.69.0 → 6.70.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 +2 -2
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.js +1 -1
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +11 -0
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.cjs +4 -85
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.js +5 -86
- package/dist/canvas/components/BaseNode/useInlineLabelEditing.cjs +141 -0
- package/dist/canvas/components/BaseNode/useInlineLabelEditing.d.ts +28 -0
- package/dist/canvas/components/BaseNode/useInlineLabelEditing.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/useInlineLabelEditing.js +107 -0
- package/dist/canvas/components/CaseFlow/case-flow.manifest.d.ts +11 -0
- package/dist/canvas/components/CaseFlow/case-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/ContainerNode/ContainerBadge.cjs +45 -0
- package/dist/canvas/components/ContainerNode/ContainerBadge.d.ts +6 -0
- package/dist/canvas/components/ContainerNode/ContainerBadge.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerBadge.js +11 -0
- package/dist/canvas/components/ContainerNode/ContainerCanvasNode.cjs +83 -0
- package/dist/canvas/components/ContainerNode/ContainerCanvasNode.d.ts +6 -0
- package/dist/canvas/components/ContainerNode/ContainerCanvasNode.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerCanvasNode.js +49 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.cjs +375 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.config.cjs +65 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.config.d.ts +20 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.config.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.config.js +28 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.constants.cjs +173 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.constants.d.ts +50 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.constants.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.constants.js +100 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.d.ts +5 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.helpers.cjs +183 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.helpers.d.ts +34 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.helpers.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.helpers.js +137 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.hooks.cjs +100 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.hooks.d.ts +9 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.hooks.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.hooks.js +54 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.js +341 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.types.cjs +18 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.types.d.ts +69 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.types.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNode.types.js +0 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeHeader.cjs +144 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeHeader.d.ts +32 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeHeader.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeHeader.js +110 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeParts.cjs +167 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeParts.d.ts +51 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeParts.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/ContainerNodeParts.js +118 -0
- package/dist/canvas/components/{LoopNode/LoopNodePreview.cjs → ContainerNode/ContainerNodePreview.cjs} +4 -4
- package/dist/canvas/components/{LoopNode/LoopNodePreview.d.ts → ContainerNode/ContainerNodePreview.d.ts} +2 -2
- package/dist/canvas/components/ContainerNode/ContainerNodePreview.d.ts.map +1 -0
- package/dist/canvas/components/{LoopNode/LoopNodePreview.js → ContainerNode/ContainerNodePreview.js} +3 -3
- package/dist/canvas/components/ContainerNode/index.cjs +86 -0
- package/dist/canvas/components/ContainerNode/index.d.ts +6 -0
- package/dist/canvas/components/ContainerNode/index.d.ts.map +1 -0
- package/dist/canvas/components/ContainerNode/index.js +5 -0
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +2 -2
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +2 -2
- package/dist/canvas/components/LoopNode/LoopCanvasNode.cjs +2 -41
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts +1 -5
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopCanvasNode.js +2 -41
- package/dist/canvas/components/LoopNode/LoopNode.cjs +49 -525
- package/dist/canvas/components/LoopNode/LoopNode.d.ts +5 -1
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.cjs +32 -155
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts +1 -33
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +1 -135
- package/dist/canvas/components/LoopNode/LoopNode.js +50 -529
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +3 -12
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.cjs +2 -2
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.js +1 -1
- package/dist/canvas/components/index.cjs +51 -44
- package/dist/canvas/components/index.d.ts +1 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +1 -0
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.cjs +2 -2
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.js +1 -1
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/schema/node-definition/index.cjs +3 -0
- package/dist/canvas/schema/node-definition/index.d.ts +2 -2
- 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.cjs +37 -2
- package/dist/canvas/schema/node-definition/node-manifest.d.ts +85 -0
- package/dist/canvas/schema/node-definition/node-manifest.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/node-manifest.js +34 -2
- package/dist/canvas/storybook-utils/hooks/useCanvasStory.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts +11 -0
- package/dist/canvas/storybook-utils/manifests/index.d.ts.map +1 -1
- package/dist/canvas/styles/reactflow-reset.css +2 -2
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +1 -1
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts.map +0 -1
|
@@ -1,549 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NodeResizeControl, useStore, useUpdateNodeInternals } from "../../xyflow/react.js";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { cn } from "@uipath/apollo-wind";
|
|
4
|
-
import { memo,
|
|
5
|
-
import { shallow } from "zustand/shallow";
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
6
4
|
import { useSafeLingui } from "../../../i18n/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { useOptionalNodeTypeRegistry } from "../../core/index.js";
|
|
9
|
-
import { useElementValidationStatus, useNodeExecutionState } from "../../hooks/index.js";
|
|
10
|
-
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
11
|
-
import { DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH, getContainerResizeMinimums } from "../../utils/container.js";
|
|
5
|
+
import { DEFAULT_CONTAINER_WIDTH } from "../../utils/container.js";
|
|
12
6
|
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
13
|
-
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
14
|
-
import { selectIsConnecting, snapToGrid } from "../../utils/NodeUtils.js";
|
|
15
7
|
import { areNodePropsEqualIgnoringPosition } from "../../utils/nodePropsEqual.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { useConnectedHandles } from "../BaseCanvas/ConnectedHandlesContext.js";
|
|
19
|
-
import { useIsNodeReadOnly } from "../BaseCanvas/ReadOnlyNodesContext.js";
|
|
20
|
-
import { useSelectionState } from "../BaseCanvas/SelectionStateContext.js";
|
|
21
|
-
import { BaseBadgeSlot } from "../BaseNode/BaseNodeBadgeSlot.js";
|
|
22
|
-
import { getStatusBorder } from "../BaseNode/BaseNodeContainer.js";
|
|
23
|
-
import { MissingManifestNode } from "../BaseNode/BaseNodeMissingManifest.js";
|
|
24
|
-
import { ButtonHandles } from "../ButtonHandle/index.js";
|
|
25
|
-
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
26
|
-
import { NodeToolbar } from "../Toolbar/index.js";
|
|
27
|
-
import { lockToolbarConfig } from "../Toolbar/NodeToolbar/NodeToolbar.utils.js";
|
|
28
|
-
import { resolveContainerHandleGroups } from "./LoopNode.helpers.js";
|
|
8
|
+
import { ContainerBadge } from "../ContainerNode/ContainerBadge.js";
|
|
9
|
+
import { ContainerNode } from "../ContainerNode/ContainerNode.js";
|
|
29
10
|
import { LoopNodeExecutionCount } from "./LoopNodeExecutionCount.js";
|
|
30
11
|
const DEFAULT_LOOP_ICON = 'repeat';
|
|
31
|
-
|
|
32
|
-
const LOOP_HEADER_ADORNMENT_GAP = 8;
|
|
33
|
-
const LOOP_HEADER_ADORNMENT_PADDING = NODE_BADGE_INSET_SQUARE + NODE_BADGE_SIZE + LOOP_HEADER_ADORNMENT_GAP;
|
|
34
|
-
const RESIZE_CONTROLS = [
|
|
35
|
-
{
|
|
36
|
-
position: 'top-left',
|
|
37
|
-
widthSide: 'left',
|
|
38
|
-
heightSide: 'top',
|
|
39
|
-
cursor: 'nwse-resize',
|
|
40
|
-
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
position: 'top-right',
|
|
44
|
-
widthSide: 'right',
|
|
45
|
-
heightSide: 'top',
|
|
46
|
-
cursor: 'nesw-resize',
|
|
47
|
-
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
position: 'bottom-left',
|
|
51
|
-
widthSide: 'left',
|
|
52
|
-
heightSide: 'bottom',
|
|
53
|
-
cursor: 'nesw-resize',
|
|
54
|
-
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
position: 'bottom-right',
|
|
58
|
-
widthSide: 'right',
|
|
59
|
-
heightSide: 'bottom',
|
|
60
|
-
cursor: 'nwse-resize',
|
|
61
|
-
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
const RESIZE_CONTROL_STYLE = {
|
|
65
|
-
background: 'transparent',
|
|
66
|
-
border: 'none',
|
|
67
|
-
zIndex: 100
|
|
68
|
-
};
|
|
69
|
-
const DEFAULT_RESIZE_MINIMUMS = {
|
|
70
|
-
left: DEFAULT_CONTAINER_MIN_WIDTH,
|
|
71
|
-
right: DEFAULT_CONTAINER_MIN_WIDTH,
|
|
72
|
-
top: DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
73
|
-
bottom: DEFAULT_CONTAINER_MIN_HEIGHT
|
|
74
|
-
};
|
|
75
|
-
const ADORNMENT_SLOT_POSITIONS = [
|
|
76
|
-
'topLeft',
|
|
77
|
-
'topRight',
|
|
78
|
-
'bottomLeft',
|
|
79
|
-
'bottomRight'
|
|
80
|
-
];
|
|
81
|
-
const ADORNMENT_SLOT_SHAPES = {
|
|
82
|
-
topLeft: 'top-left',
|
|
83
|
-
topRight: 'top-right',
|
|
84
|
-
bottomLeft: 'bottom-left',
|
|
85
|
-
bottomRight: 'bottom-right'
|
|
86
|
-
};
|
|
87
|
-
function resolveInteractionState(dragging, selected, isHovered) {
|
|
88
|
-
if (dragging) return 'drag';
|
|
89
|
-
if (selected) return 'selected';
|
|
90
|
-
if (isHovered) return 'hover';
|
|
91
|
-
return 'default';
|
|
92
|
-
}
|
|
93
|
-
function useHasChildNodes(id, enabled) {
|
|
94
|
-
return useStore(useCallback((state)=>!enabled || (state.parentLookup.get(id)?.size ?? 0) > 0, [
|
|
95
|
-
id,
|
|
96
|
-
enabled
|
|
97
|
-
]));
|
|
98
|
-
}
|
|
99
|
-
function useContainerResizeMinimums(id, width, height, enabled) {
|
|
100
|
-
return useStore(useCallback((state)=>{
|
|
101
|
-
if (!enabled) return DEFAULT_RESIZE_MINIMUMS;
|
|
102
|
-
return getContainerResizeMinimums({
|
|
103
|
-
id,
|
|
104
|
-
width,
|
|
105
|
-
height
|
|
106
|
-
}, Array.from(state.parentLookup.get(id)?.values() ?? []));
|
|
107
|
-
}, [
|
|
108
|
-
enabled,
|
|
109
|
-
height,
|
|
110
|
-
id,
|
|
111
|
-
width
|
|
112
|
-
]), shallow);
|
|
113
|
-
}
|
|
114
|
-
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
115
|
-
const updateNodeInternals = useUpdateNodeInternals();
|
|
116
|
-
useEffect(()=>{
|
|
117
|
-
const frameId = requestAnimationFrame(()=>{
|
|
118
|
-
updateNodeInternals(id);
|
|
119
|
-
});
|
|
120
|
-
return ()=>{
|
|
121
|
-
cancelAnimationFrame(frameId);
|
|
122
|
-
};
|
|
123
|
-
}, [
|
|
124
|
-
id,
|
|
125
|
-
handleGroups,
|
|
126
|
-
updateNodeInternals,
|
|
127
|
-
width,
|
|
128
|
-
height
|
|
129
|
-
]);
|
|
130
|
-
}
|
|
131
|
-
function resolveLoopHandleConfigurations(manifestHandleConfigurations, data) {
|
|
132
|
-
if (Array.isArray(data.handleConfigurations)) return data.handleConfigurations;
|
|
133
|
-
return manifestHandleConfigurations ?? [];
|
|
134
|
-
}
|
|
135
|
-
function LoopNodeComponent(props) {
|
|
136
|
-
const { id, type, data, selected = false, dragging = false, width = 0, height = 0, onAddFirstChild, onResize, onResizeStart, onResizeEnd, toolbarConfig: toolbarConfigProp, adornments: adornmentsProp, executionStatusOverride, suggestionType: suggestionTypeProp, iterationPillState: iterationPillStateProp } = props;
|
|
137
|
-
const nodeTypeRegistry = useOptionalNodeTypeRegistry();
|
|
12
|
+
function LoopModePill({ parallel, label }) {
|
|
138
13
|
const { _ } = useSafeLingui();
|
|
139
|
-
const
|
|
140
|
-
const [isResizing, setIsResizing] = useState(false);
|
|
141
|
-
const resolvedData = data ?? EMPTY_DATA;
|
|
142
|
-
const isLoading = !!resolvedData.loading;
|
|
143
|
-
const suggestionType = suggestionTypeProp ?? resolvedData.suggestionType;
|
|
144
|
-
const manifest = useMemo(()=>nodeTypeRegistry?.getManifest(type), [
|
|
145
|
-
nodeTypeRegistry,
|
|
146
|
-
type
|
|
147
|
-
]);
|
|
148
|
-
const { mode } = useBaseCanvasMode();
|
|
149
|
-
const isDesignMode = 'design' === mode;
|
|
150
|
-
const isNodeReadOnly = useIsNodeReadOnly(id);
|
|
151
|
-
const canEditNode = isDesignMode && !isNodeReadOnly;
|
|
152
|
-
const connectedHandleIds = useConnectedHandles(id);
|
|
153
|
-
const { multipleNodesSelected } = useSelectionState();
|
|
154
|
-
const isConnecting = useStore(selectIsConnecting);
|
|
155
|
-
const hasChildNodes = useHasChildNodes(id, isDesignMode && !!onAddFirstChild);
|
|
156
|
-
const executionState = useNodeExecutionState(id);
|
|
157
|
-
const validationState = useElementValidationStatus(id);
|
|
158
|
-
const statusContext = useMemo(()=>({
|
|
159
|
-
nodeId: id,
|
|
160
|
-
executionState: executionStatusOverride ?? executionState,
|
|
161
|
-
validationState,
|
|
162
|
-
isConnecting,
|
|
163
|
-
isSelected: selected,
|
|
164
|
-
isDragging: dragging,
|
|
165
|
-
mode
|
|
166
|
-
}), [
|
|
167
|
-
dragging,
|
|
168
|
-
executionStatusOverride,
|
|
169
|
-
executionState,
|
|
170
|
-
id,
|
|
171
|
-
isConnecting,
|
|
172
|
-
mode,
|
|
173
|
-
selected,
|
|
174
|
-
validationState
|
|
175
|
-
]);
|
|
176
|
-
const executionStatus = executionStatusOverride ?? ('string' == typeof executionState ? executionState : executionState?.status);
|
|
177
|
-
const display = useMemo(()=>resolveDisplay(manifest?.display, {
|
|
178
|
-
...resolvedData,
|
|
179
|
-
nodeId: id
|
|
180
|
-
}), [
|
|
181
|
-
manifest?.display,
|
|
182
|
-
id,
|
|
183
|
-
resolvedData
|
|
184
|
-
]);
|
|
185
|
-
const displayTitle = display.label ?? _({
|
|
186
|
-
id: 'loop-node.title',
|
|
187
|
-
message: 'Loop'
|
|
188
|
-
});
|
|
189
|
-
const displayIcon = display.icon ?? DEFAULT_LOOP_ICON;
|
|
190
|
-
const isParallel = true === resolvedData.parallel;
|
|
191
|
-
const label = isParallel ? _({
|
|
14
|
+
const resolvedLabel = label ?? (parallel ? _({
|
|
192
15
|
id: 'loop-node.mode.parallel',
|
|
193
16
|
message: 'Parallel'
|
|
194
17
|
}) : _({
|
|
195
18
|
id: 'loop-node.mode.sequential',
|
|
196
19
|
message: 'Sequential'
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const isDropTarget = true === resolvedData.isDropTarget;
|
|
203
|
-
const containerWidth = width || DEFAULT_CONTAINER_WIDTH;
|
|
204
|
-
const containerHeight = height || DEFAULT_CONTAINER_HEIGHT;
|
|
205
|
-
const resizeControlsMounted = isDesignMode && !dragging;
|
|
206
|
-
const resizeControlsVisible = resizeControlsMounted && (selected || isResizing);
|
|
207
|
-
const resizeMinimumsEnabled = resizeControlsMounted && (selected || isHovered || isResizing);
|
|
208
|
-
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, resizeMinimumsEnabled);
|
|
209
|
-
const nodeSizeStyle = {
|
|
210
|
-
width: containerWidth,
|
|
211
|
-
height: containerHeight,
|
|
212
|
-
minWidth: DEFAULT_CONTAINER_MIN_WIDTH,
|
|
213
|
-
minHeight: DEFAULT_CONTAINER_MIN_HEIGHT
|
|
214
|
-
};
|
|
215
|
-
const toolbarConfig = useMemo(()=>{
|
|
216
|
-
if (void 0 !== toolbarConfigProp) return null === toolbarConfigProp ? void 0 : toolbarConfigProp;
|
|
217
|
-
return manifest ? resolveToolbar(manifest, statusContext, data) : void 0;
|
|
218
|
-
}, [
|
|
219
|
-
data,
|
|
220
|
-
manifest,
|
|
221
|
-
statusContext,
|
|
222
|
-
toolbarConfigProp
|
|
223
|
-
]);
|
|
224
|
-
const effectiveToolbarConfig = useMemo(()=>toolbarConfig && isNodeReadOnly ? lockToolbarConfig(toolbarConfig) : toolbarConfig, [
|
|
225
|
-
toolbarConfig,
|
|
226
|
-
isNodeReadOnly
|
|
227
|
-
]);
|
|
228
|
-
const adornments = useMemo(()=>({
|
|
229
|
-
...resolveAdornments(statusContext, {
|
|
230
|
-
hideExecutionStatusAdornment: true
|
|
231
|
-
}),
|
|
232
|
-
...adornmentsProp ?? {}
|
|
233
|
-
}), [
|
|
234
|
-
adornmentsProp,
|
|
235
|
-
statusContext
|
|
236
|
-
]);
|
|
237
|
-
const hasTopLeftAdornment = !!adornments.topLeft;
|
|
238
|
-
const hasTopRightAdornment = !!adornments.topRight;
|
|
239
|
-
const resolvedHandleGroups = useMemo(()=>{
|
|
240
|
-
const handleConfigurations = resolveLoopHandleConfigurations(manifest?.handleConfiguration, resolvedData);
|
|
241
|
-
return resolveHandles(handleConfigurations, {
|
|
242
|
-
...resolvedData,
|
|
243
|
-
nodeId: id
|
|
244
|
-
});
|
|
245
|
-
}, [
|
|
246
|
-
manifest?.handleConfiguration,
|
|
247
|
-
id,
|
|
248
|
-
resolvedData
|
|
249
|
-
]);
|
|
250
|
-
const containerHandleGroups = useMemo(()=>resolveContainerHandleGroups(resolvedHandleGroups), [
|
|
251
|
-
resolvedHandleGroups
|
|
252
|
-
]);
|
|
253
|
-
useContainerNodeInternalsRefresh(id, containerHandleGroups, containerWidth, containerHeight);
|
|
254
|
-
const handleResize = useCallback((_event, params)=>{
|
|
255
|
-
onResize?.({
|
|
256
|
-
width: snapToGrid(params.width),
|
|
257
|
-
height: snapToGrid(params.height)
|
|
258
|
-
});
|
|
259
|
-
}, [
|
|
260
|
-
onResize
|
|
261
|
-
]);
|
|
262
|
-
const handleResizeStart = useCallback(()=>{
|
|
263
|
-
setIsResizing(true);
|
|
264
|
-
onResizeStart?.();
|
|
265
|
-
}, [
|
|
266
|
-
onResizeStart
|
|
267
|
-
]);
|
|
268
|
-
const handleResizeEnd = useCallback(()=>{
|
|
269
|
-
setIsResizing(false);
|
|
270
|
-
if (onResizeEnd) queueMicrotask(onResizeEnd);
|
|
271
|
-
}, [
|
|
272
|
-
onResizeEnd
|
|
273
|
-
]);
|
|
274
|
-
const handleEmptyClick = useCallback(()=>{
|
|
275
|
-
onAddFirstChild?.();
|
|
276
|
-
}, [
|
|
277
|
-
onAddFirstChild
|
|
278
|
-
]);
|
|
279
|
-
const handleMouseEnter = useCallback(()=>setIsHovered(true), []);
|
|
280
|
-
const handleMouseLeave = useCallback(()=>setIsHovered(false), []);
|
|
281
|
-
const handleHandleAction = useCallback((_event)=>{
|
|
282
|
-
setIsHovered(false);
|
|
283
|
-
}, []);
|
|
284
|
-
const shouldShowHandles = (isConnecting || selected || isHovered) && !dragging;
|
|
285
|
-
const showHandleAddButtons = canEditNode && !multipleNodesSelected && !isConnecting && !dragging;
|
|
286
|
-
const showEmptyStateButton = canEditNode && !hasChildNodes && !!onAddFirstChild;
|
|
287
|
-
const interactionState = resolveInteractionState(dragging, selected, isHovered);
|
|
288
|
-
const activeStatus = suggestionType ?? validationState?.validationStatus ?? executionStatus;
|
|
289
|
-
const statusBorder = getStatusBorder(activeStatus);
|
|
290
|
-
const hasStatusBorder = statusBorder.length > 0;
|
|
291
|
-
if (!manifest) return /*#__PURE__*/ jsx("div", {
|
|
292
|
-
className: "relative",
|
|
293
|
-
style: nodeSizeStyle,
|
|
294
|
-
onMouseEnter: handleMouseEnter,
|
|
295
|
-
onMouseLeave: handleMouseLeave,
|
|
296
|
-
children: /*#__PURE__*/ jsx(MissingManifestNode, {
|
|
297
|
-
type: type,
|
|
298
|
-
isSelected: selected,
|
|
299
|
-
isHovered: isHovered,
|
|
300
|
-
interactionState: interactionState
|
|
301
|
-
})
|
|
302
|
-
});
|
|
303
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
304
|
-
"data-loop-container": true,
|
|
305
|
-
"data-selected": selected ? 'true' : 'false',
|
|
306
|
-
"data-execution-status": executionStatus,
|
|
307
|
-
"data-interaction-state": interactionState,
|
|
308
|
-
"data-suggestion-type": suggestionType,
|
|
309
|
-
"data-validation-status": validationState?.validationStatus,
|
|
310
|
-
"aria-busy": resolvedData.loading || void 0,
|
|
311
|
-
className: cn('group/loop-shell relative box-border flex h-full w-full flex-col overflow-visible rounded-[20px] border bg-transparent', 'transition-[border-color,box-shadow,opacity] shadow-(--canvas-node-shadow-rest)', 'border-border', statusBorder, isHovered && 'shadow-(--canvas-node-shadow-hover)', isHovered && !hasStatusBorder && 'border-border-hover', selected && 'outline-2 outline-foreground-accent-muted', isDropTarget && 'bg-surface-hover outline-2 outline-brand', 'drag' === interactionState && 'cursor-grabbing shadow-(--canvas-node-shadow-lifted)'),
|
|
312
|
-
style: {
|
|
313
|
-
...nodeSizeStyle,
|
|
314
|
-
...display.background ? {
|
|
315
|
-
background: display.background
|
|
316
|
-
} : {}
|
|
317
|
-
},
|
|
318
|
-
onMouseEnter: handleMouseEnter,
|
|
319
|
-
onMouseLeave: handleMouseLeave,
|
|
320
|
-
children: [
|
|
321
|
-
/*#__PURE__*/ jsxs("div", {
|
|
322
|
-
className: "absolute inset-0 isolate flex flex-col overflow-hidden rounded-[19px]",
|
|
323
|
-
children: [
|
|
324
|
-
/*#__PURE__*/ jsx(Header, {
|
|
325
|
-
title: displayTitle,
|
|
326
|
-
icon: displayIcon,
|
|
327
|
-
loading: isLoading,
|
|
328
|
-
isParallel: isParallel,
|
|
329
|
-
label: label,
|
|
330
|
-
iterationPillState: iterationPillStateProp,
|
|
331
|
-
nodeWidth: containerWidth,
|
|
332
|
-
hasTopLeftAdornment: hasTopLeftAdornment,
|
|
333
|
-
hasTopRightAdornment: hasTopRightAdornment
|
|
334
|
-
}),
|
|
335
|
-
/*#__PURE__*/ jsx(LoopNode_BodyFrame, {
|
|
336
|
-
isEmpty: showEmptyStateButton,
|
|
337
|
-
isLoading: isLoading
|
|
338
|
-
})
|
|
339
|
-
]
|
|
340
|
-
}),
|
|
341
|
-
ADORNMENT_SLOT_POSITIONS.map((slot)=>adornments?.[slot] ? /*#__PURE__*/ jsx(BaseBadgeSlot, {
|
|
342
|
-
position: ADORNMENT_SLOT_SHAPES[slot],
|
|
343
|
-
shape: "rectangle",
|
|
344
|
-
children: adornments[slot]
|
|
345
|
-
}, slot) : null),
|
|
346
|
-
/*#__PURE__*/ jsx(LoopNode_ResizeCornerIndicators, {
|
|
347
|
-
visible: resizeControlsVisible
|
|
348
|
-
}),
|
|
349
|
-
resizeControlsMounted ? /*#__PURE__*/ jsx(LoopNode_ResizeControls, {
|
|
350
|
-
minimums: resizeMinimums,
|
|
351
|
-
onResize: handleResize,
|
|
352
|
-
onResizeStart: handleResizeStart,
|
|
353
|
-
onResizeEnd: handleResizeEnd
|
|
354
|
-
}) : null,
|
|
355
|
-
showEmptyStateButton ? /*#__PURE__*/ jsx("div", {
|
|
356
|
-
className: cn('pointer-events-none absolute left-1/2 top-1/2', '-translate-x-1/2 -translate-y-1/2'),
|
|
357
|
-
children: /*#__PURE__*/ jsx(EmptyState, {
|
|
358
|
-
label: addNodeToLoopLabel,
|
|
359
|
-
onAddFirstChild: handleEmptyClick
|
|
360
|
-
})
|
|
361
|
-
}) : null,
|
|
362
|
-
effectiveToolbarConfig && /*#__PURE__*/ jsx(NodeToolbar, {
|
|
363
|
-
nodeId: id,
|
|
364
|
-
config: effectiveToolbarConfig,
|
|
365
|
-
expanded: selected || isHovered,
|
|
366
|
-
hidden: dragging || multipleNodesSelected,
|
|
367
|
-
portalToNodeOverlay: true
|
|
368
|
-
}),
|
|
369
|
-
/*#__PURE__*/ jsx(HandleGroups, {
|
|
370
|
-
nodeId: id,
|
|
371
|
-
groups: containerHandleGroups,
|
|
372
|
-
selected: selected,
|
|
373
|
-
hovered: isHovered,
|
|
374
|
-
shouldShowHandles: shouldShowHandles,
|
|
375
|
-
showAddButton: showHandleAddButtons,
|
|
376
|
-
isLocked: !canEditNode,
|
|
377
|
-
showNotches: shouldShowHandles,
|
|
378
|
-
nodeWidth: containerWidth,
|
|
379
|
-
nodeHeight: containerHeight,
|
|
380
|
-
connectedHandleIds: connectedHandleIds,
|
|
381
|
-
onHandleAction: handleHandleAction
|
|
382
|
-
})
|
|
383
|
-
]
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
const LoopNode = /*#__PURE__*/ memo(LoopNodeComponent, areNodePropsEqualIgnoringPosition);
|
|
387
|
-
function Header({ title, icon, loading, isParallel, label, iterationPillState, nodeWidth, hasTopLeftAdornment, hasTopRightAdornment }) {
|
|
388
|
-
const titleContent = loading ? /*#__PURE__*/ jsx("div", {
|
|
389
|
-
className: "h-5 w-28 animate-pulse rounded bg-(--canvas-background-overlay)"
|
|
390
|
-
}) : /*#__PURE__*/ jsx("span", {
|
|
391
|
-
className: "truncate text-[15px] font-semibold leading-5 tracking-normal",
|
|
392
|
-
children: title
|
|
393
|
-
});
|
|
394
|
-
const iconContent = loading ? /*#__PURE__*/ jsx("div", {
|
|
395
|
-
className: "h-4 w-4 shrink-0 animate-pulse rounded bg-(--canvas-background-overlay)"
|
|
396
|
-
}) : icon ? /*#__PURE__*/ jsx("span", {
|
|
397
|
-
className: "shrink-0 text-foreground",
|
|
398
|
-
"aria-hidden": true,
|
|
399
|
-
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
400
|
-
icon: icon,
|
|
401
|
-
size: 16
|
|
402
|
-
})
|
|
403
|
-
}) : null;
|
|
404
|
-
const headerStyle = hasTopLeftAdornment || hasTopRightAdornment ? {
|
|
405
|
-
paddingLeft: hasTopLeftAdornment ? LOOP_HEADER_ADORNMENT_PADDING : void 0,
|
|
406
|
-
paddingRight: hasTopRightAdornment ? LOOP_HEADER_ADORNMENT_PADDING : void 0
|
|
407
|
-
} : void 0;
|
|
408
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
409
|
-
className: cn('relative z-10 flex shrink-0 cursor-grab items-center justify-between gap-2.5 rounded-t-[18px]', '-mb-2.5 bg-surface-overlay px-3.5 pb-2.5 pt-2.5 text-foreground', 'active:cursor-grabbing'),
|
|
410
|
-
style: headerStyle,
|
|
411
|
-
"data-testid": "loop-node-header",
|
|
412
|
-
children: [
|
|
413
|
-
/*#__PURE__*/ jsxs("div", {
|
|
414
|
-
className: "flex min-w-0 items-center gap-2.5",
|
|
415
|
-
children: [
|
|
416
|
-
iconContent,
|
|
417
|
-
titleContent
|
|
418
|
-
]
|
|
419
|
-
}),
|
|
420
|
-
/*#__PURE__*/ jsxs("div", {
|
|
421
|
-
className: "flex shrink-0 items-center gap-2",
|
|
422
|
-
children: [
|
|
423
|
-
iterationPillState ? /*#__PURE__*/ jsx(LoopNodeExecutionCount, {
|
|
424
|
-
state: iterationPillState,
|
|
425
|
-
size: nodeWidth >= 400 ? 'full' : nodeWidth >= 260 ? 'compact' : 'minimal'
|
|
426
|
-
}) : null,
|
|
427
|
-
/*#__PURE__*/ jsxs("span", {
|
|
428
|
-
className: "flex h-6 shrink-0 items-center gap-1 rounded-full border border-border bg-surface px-2.5 text-[11px] font-semibold leading-4 text-foreground shadow-sm",
|
|
429
|
-
children: [
|
|
430
|
-
/*#__PURE__*/ jsx("span", {
|
|
431
|
-
className: cn('flex shrink-0', isParallel && 'rotate-90'),
|
|
432
|
-
"aria-hidden": true,
|
|
433
|
-
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
434
|
-
icon: "text-align-justify",
|
|
435
|
-
size: 12
|
|
436
|
-
})
|
|
437
|
-
}),
|
|
438
|
-
label
|
|
439
|
-
]
|
|
440
|
-
})
|
|
441
|
-
]
|
|
442
|
-
})
|
|
443
|
-
]
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
function EmptyState({ label, onAddFirstChild }) {
|
|
447
|
-
return /*#__PURE__*/ jsx(CanvasTooltip, {
|
|
448
|
-
content: label,
|
|
449
|
-
placement: "top",
|
|
450
|
-
children: /*#__PURE__*/ jsx("button", {
|
|
451
|
-
type: "button",
|
|
452
|
-
onClick: onAddFirstChild,
|
|
453
|
-
"aria-label": label,
|
|
454
|
-
className: cn('nodrag nopan', 'pointer-events-auto flex h-8 w-8 items-center justify-center rounded-xl', 'border border-border bg-surface-overlay text-foreground', 'shadow-(--canvas-node-shadow-lifted)', 'transition-colors', 'hover:bg-surface-hover hover:border-brand'),
|
|
20
|
+
}));
|
|
21
|
+
return /*#__PURE__*/ jsx(ContainerBadge, {
|
|
22
|
+
icon: /*#__PURE__*/ jsx("span", {
|
|
23
|
+
className: cn('flex shrink-0', parallel && 'rotate-90'),
|
|
24
|
+
"aria-hidden": true,
|
|
455
25
|
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
456
|
-
icon: "
|
|
457
|
-
size:
|
|
26
|
+
icon: "text-align-justify",
|
|
27
|
+
size: 12
|
|
458
28
|
})
|
|
459
|
-
})
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
const LoopNode_BodyFrame = /*#__PURE__*/ memo(function({ isEmpty, isLoading }) {
|
|
463
|
-
return /*#__PURE__*/ jsx("div", {
|
|
464
|
-
"data-testid": "loop-body-frame",
|
|
465
|
-
"data-empty": isEmpty ? 'true' : 'false',
|
|
466
|
-
className: cn('relative m-2.5 flex flex-1 rounded-xl border-[1.5px] border-dashed border-border bg-transparent', 'shadow-[0_0_0_200px_var(--surface-overlay)]', 'pointer-events-none'),
|
|
467
|
-
children: isLoading ? /*#__PURE__*/ jsx("div", {
|
|
468
|
-
className: "m-6 h-14 w-full animate-pulse rounded-[18px] bg-(--canvas-background-overlay)"
|
|
469
|
-
}) : null
|
|
470
|
-
});
|
|
471
|
-
});
|
|
472
|
-
const LoopNode_ResizeControls = /*#__PURE__*/ memo(function({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize, onResizeStart, onResizeEnd }) {
|
|
473
|
-
return /*#__PURE__*/ jsx(Fragment, {
|
|
474
|
-
children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
|
|
475
|
-
style: RESIZE_CONTROL_STYLE,
|
|
476
|
-
position: position,
|
|
477
|
-
minWidth: minimums[widthSide],
|
|
478
|
-
minHeight: minimums[heightSide],
|
|
479
|
-
onResizeStart: onResizeStart,
|
|
480
|
-
onResize: onResize,
|
|
481
|
-
onResizeEnd: onResizeEnd,
|
|
482
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
483
|
-
className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
|
|
484
|
-
style: {
|
|
485
|
-
cursor
|
|
486
|
-
}
|
|
487
|
-
})
|
|
488
|
-
}, position))
|
|
489
|
-
});
|
|
490
|
-
});
|
|
491
|
-
const LoopNode_ResizeCornerIndicators = /*#__PURE__*/ memo(function({ visible }) {
|
|
492
|
-
return /*#__PURE__*/ jsx(Fragment, {
|
|
493
|
-
children: RESIZE_CONTROLS.map(({ position, indicatorClassName })=>/*#__PURE__*/ jsx("div", {
|
|
494
|
-
"aria-hidden": true,
|
|
495
|
-
"data-testid": `loop-resize-corner-indicator-${position}`,
|
|
496
|
-
className: cn('pointer-events-none absolute h-2 w-2 rounded-full bg-brand transition-opacity', indicatorClassName, visible ? 'opacity-100' : 'opacity-0')
|
|
497
|
-
}, position))
|
|
498
|
-
});
|
|
499
|
-
});
|
|
500
|
-
function HandleGroups({ groups, ...handleGroupProps }) {
|
|
501
|
-
if (0 === groups.length) return null;
|
|
502
|
-
return /*#__PURE__*/ jsx(Fragment, {
|
|
503
|
-
children: groups.map((group, groupIndex)=>/*#__PURE__*/ jsx(HandleGroup, {
|
|
504
|
-
...handleGroupProps,
|
|
505
|
-
group: group
|
|
506
|
-
}, `${group.boundary}:${group.position}:${groupIndex}`))
|
|
29
|
+
}),
|
|
30
|
+
children: resolvedLabel
|
|
507
31
|
});
|
|
508
32
|
}
|
|
509
|
-
function
|
|
510
|
-
const
|
|
511
|
-
const
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
33
|
+
function LoopNodeComponent({ iterationPillState, defaults, ...props }) {
|
|
34
|
+
const { _ } = useSafeLingui();
|
|
35
|
+
const isParallel = props.data?.parallel === true;
|
|
36
|
+
const nodeWidth = props.width || DEFAULT_CONTAINER_WIDTH;
|
|
37
|
+
const counterSize = nodeWidth >= 400 ? 'full' : nodeWidth >= 260 ? 'compact' : 'minimal';
|
|
38
|
+
const loopDefaults = useMemo(()=>({
|
|
39
|
+
kind: 'loop',
|
|
40
|
+
title: _({
|
|
41
|
+
id: 'loop-node.title',
|
|
42
|
+
message: 'Loop'
|
|
43
|
+
}),
|
|
44
|
+
icon: DEFAULT_LOOP_ICON,
|
|
45
|
+
headerBadges: /*#__PURE__*/ jsx(LoopModePill, {
|
|
46
|
+
parallel: isParallel
|
|
47
|
+
}),
|
|
48
|
+
headerEnd: iterationPillState ? /*#__PURE__*/ jsx(LoopNodeExecutionCount, {
|
|
49
|
+
state: iterationPillState,
|
|
50
|
+
size: counterSize
|
|
51
|
+
}) : void 0,
|
|
52
|
+
emptyStateLabel: _({
|
|
53
|
+
id: 'loop-node.add-node',
|
|
54
|
+
message: 'Add node to loop'
|
|
55
|
+
}),
|
|
56
|
+
...defaults
|
|
526
57
|
}), [
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
58
|
+
_,
|
|
59
|
+
counterSize,
|
|
60
|
+
defaults,
|
|
61
|
+
isParallel,
|
|
62
|
+
iterationPillState
|
|
532
63
|
]);
|
|
533
|
-
return /*#__PURE__*/ jsx(
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
position: position,
|
|
537
|
-
connectionPosition: group.connectionPosition,
|
|
538
|
-
selected: selected,
|
|
539
|
-
hovered: hovered,
|
|
540
|
-
showAddButton: showAddButton,
|
|
541
|
-
isLocked: isLocked,
|
|
542
|
-
showNotches: showNotches,
|
|
543
|
-
customPositionAndOffsets: group.customPositionAndOffsets,
|
|
544
|
-
nodeWidth: nodeWidth,
|
|
545
|
-
nodeHeight: nodeHeight,
|
|
546
|
-
portalActions: 'outer' === group.boundary
|
|
64
|
+
return /*#__PURE__*/ jsx(ContainerNode, {
|
|
65
|
+
...props,
|
|
66
|
+
defaults: loopDefaults
|
|
547
67
|
});
|
|
548
68
|
}
|
|
549
|
-
|
|
69
|
+
const LoopNode = /*#__PURE__*/ memo(LoopNodeComponent, areNodePropsEqualIgnoringPosition);
|
|
70
|
+
export { LoopModePill, LoopNode };
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type { Node, NodeProps } from '../../xyflow/react.ts';
|
|
2
|
-
import type { SuggestionType } from '../../types';
|
|
3
2
|
import type { ElementStatusValues } from '../../types/execution';
|
|
4
3
|
import type { BaseNodeData } from '../BaseNode';
|
|
5
|
-
import type {
|
|
6
|
-
import type { NodeToolbarConfig } from '../Toolbar';
|
|
4
|
+
import type { ContainerNodeConfig, ContainerNodeResizeSize } from '../ContainerNode/ContainerNode.types';
|
|
7
5
|
export type LoopNodeData = BaseNodeData;
|
|
8
|
-
export
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
}
|
|
6
|
+
export type LoopNodeResizeSize = ContainerNodeResizeSize;
|
|
12
7
|
export interface LoopNodeExecutionCountState {
|
|
13
8
|
activeIndex: number;
|
|
14
9
|
total: number;
|
|
@@ -18,11 +13,7 @@ export interface LoopNodeExecutionCountState {
|
|
|
18
13
|
onAllChange: (isAll: boolean) => void;
|
|
19
14
|
iterationStatuses?: Map<number, ElementStatusValues>;
|
|
20
15
|
}
|
|
21
|
-
export interface LoopNodeConfig {
|
|
22
|
-
toolbarConfig?: NodeToolbarConfig | null;
|
|
23
|
-
adornments?: NodeAdornments;
|
|
24
|
-
executionStatusOverride?: ElementStatusValues;
|
|
25
|
-
suggestionType?: SuggestionType;
|
|
16
|
+
export interface LoopNodeConfig extends ContainerNodeConfig {
|
|
26
17
|
iterationPillState?: LoopNodeExecutionCountState;
|
|
27
18
|
}
|
|
28
19
|
export interface LoopNodeProps extends NodeProps<Node<LoopNodeData>>, LoopNodeConfig {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoopNode.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"LoopNode.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAEzD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IAEzD,kBAAkB,CAAC,EAAE,2BAA2B,CAAC;CAClD;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,cAAc;IAClF,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B"}
|
|
@@ -34,7 +34,7 @@ const createPreviewGraph_cjs_namespaceObject = require("../../../utils/createPre
|
|
|
34
34
|
const createPreviewNode_cjs_namespaceObject = require("../../../utils/createPreviewNode.cjs");
|
|
35
35
|
const BaseCanvasModeProvider_cjs_namespaceObject = require("../../BaseCanvas/BaseCanvasModeProvider.cjs");
|
|
36
36
|
const ReadOnlyNodesContext_cjs_namespaceObject = require("../../BaseCanvas/ReadOnlyNodesContext.cjs");
|
|
37
|
-
const
|
|
37
|
+
const ContainerNode_helpers_cjs_namespaceObject = require("../../ContainerNode/ContainerNode.helpers.cjs");
|
|
38
38
|
const external_useEdgeToolbarPositioning_cjs_namespaceObject = require("./useEdgeToolbarPositioning.cjs");
|
|
39
39
|
function hasSameConnection(edge, expected) {
|
|
40
40
|
if (!edge) return false;
|
|
@@ -69,7 +69,7 @@ function useEdgeToolbarState({ edgeId, pathElementRef, isHovered, source, target
|
|
|
69
69
|
nodeId: source,
|
|
70
70
|
handleId: sourceHandleId ?? external_constants_cjs_namespaceObject.DEFAULT_SOURCE_HANDLE_ID
|
|
71
71
|
};
|
|
72
|
-
const containerOverrides = (0,
|
|
72
|
+
const containerOverrides = (0, ContainerNode_helpers_cjs_namespaceObject.resolveContainerAddNodePreview)({
|
|
73
73
|
source: sourceEndpoint,
|
|
74
74
|
sourceHandleType: 'source',
|
|
75
75
|
reactFlowInstance: reactFlow,
|
|
@@ -6,7 +6,7 @@ import { showPreviewGraph } from "../../../utils/createPreviewGraph.js";
|
|
|
6
6
|
import { isPreviewEdge } from "../../../utils/createPreviewNode.js";
|
|
7
7
|
import { useBaseCanvasMode } from "../../BaseCanvas/BaseCanvasModeProvider.js";
|
|
8
8
|
import { useIsConnectionReadOnly, useReadOnlyConnectionCheck } from "../../BaseCanvas/ReadOnlyNodesContext.js";
|
|
9
|
-
import { resolveContainerAddNodePreview } from "../../
|
|
9
|
+
import { resolveContainerAddNodePreview } from "../../ContainerNode/ContainerNode.helpers.js";
|
|
10
10
|
import { useEdgeToolbarPositioning } from "./useEdgeToolbarPositioning.js";
|
|
11
11
|
function hasSameConnection(edge, expected) {
|
|
12
12
|
if (!edge) return false;
|