@uipath/apollo-react 7.31.0 → 7.32.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/AgentCanvas/nodes/AgentNode.cjs +11 -9
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.js +11 -9
- package/dist/canvas/components/BaseNode/BaseNode.cjs +7 -5
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +8 -6
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +2 -2
- package/dist/canvas/components/ButtonHandle/HandleButton.js +2 -2
- package/dist/canvas/components/ContainerNode/ContainerNode.cjs +8 -2
- package/dist/canvas/components/ContainerNode/ContainerNode.d.ts.map +1 -1
- package/dist/canvas/components/ContainerNode/ContainerNode.js +9 -3
- package/dist/canvas/constants.cjs +4 -0
- package/dist/canvas/constants.d.ts +1 -0
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +2 -1
- package/dist/canvas/icons/AutonomousAgentIcon.cjs +7 -1
- package/dist/canvas/icons/AutonomousAgentIcon.d.ts +2 -1
- package/dist/canvas/icons/AutonomousAgentIcon.d.ts.map +1 -1
- package/dist/canvas/icons/AutonomousAgentIcon.js +7 -1
- package/dist/canvas/icons/ConversationalAgentIcon.cjs +7 -1
- package/dist/canvas/icons/ConversationalAgentIcon.d.ts +2 -1
- package/dist/canvas/icons/ConversationalAgentIcon.d.ts.map +1 -1
- package/dist/canvas/icons/ConversationalAgentIcon.js +7 -1
- package/dist/canvas/utils/NodeUtils.cjs +12 -1
- package/dist/canvas/utils/NodeUtils.d.ts +14 -0
- package/dist/canvas/utils/NodeUtils.d.ts.map +1 -1
- package/dist/canvas/utils/NodeUtils.js +9 -1
- package/package.json +4 -4
|
@@ -55,19 +55,23 @@ const AgentNodeComponent = /*#__PURE__*/ (0, external_react_namespaceObject.memo
|
|
|
55
55
|
const suggestionType = isSuggestion ? data.suggestionType : null;
|
|
56
56
|
const isConversational = definition?.metadata?.isConversational === true;
|
|
57
57
|
const suggestTranslations = suggestionTranslations ?? external_types_cjs_namespaceObject.DefaultSuggestionTranslations;
|
|
58
|
+
const agentTypeLabel = isConversational ? translations.conversationalAgent : translations.autonomousAgent;
|
|
58
59
|
const agentIcon = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
59
60
|
if (isConversational) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ConversationalAgentIcon, {
|
|
60
61
|
color: "var(--canvas-foreground-de-emp)",
|
|
61
62
|
w: 32,
|
|
62
|
-
h: 32
|
|
63
|
+
h: 32,
|
|
64
|
+
label: agentTypeLabel
|
|
63
65
|
});
|
|
64
66
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.AutonomousAgentIcon, {
|
|
65
67
|
color: "var(--canvas-foreground-de-emp)",
|
|
66
68
|
w: 32,
|
|
67
|
-
h: 32
|
|
69
|
+
h: 32,
|
|
70
|
+
label: agentTypeLabel
|
|
68
71
|
});
|
|
69
72
|
}, [
|
|
70
|
-
isConversational
|
|
73
|
+
isConversational,
|
|
74
|
+
agentTypeLabel
|
|
71
75
|
]);
|
|
72
76
|
const settings = definition?.settings;
|
|
73
77
|
const handleMouseEnter = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
@@ -229,19 +233,17 @@ const AgentNodeComponent = /*#__PURE__*/ (0, external_react_namespaceObject.memo
|
|
|
229
233
|
onHealthScoreClick
|
|
230
234
|
]);
|
|
231
235
|
const subLabelWithHealthScore = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
232
|
-
|
|
233
|
-
if (!healthScoreBadge) return baseSubLabel;
|
|
236
|
+
if (!healthScoreBadge) return agentTypeLabel;
|
|
234
237
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_AgentNode_styles_cjs_namespaceObject.SubLabelContainer, {
|
|
235
238
|
children: [
|
|
236
239
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
237
|
-
children:
|
|
240
|
+
children: agentTypeLabel
|
|
238
241
|
}),
|
|
239
242
|
healthScoreBadge
|
|
240
243
|
]
|
|
241
244
|
});
|
|
242
245
|
}, [
|
|
243
|
-
|
|
244
|
-
translations,
|
|
246
|
+
agentTypeLabel,
|
|
245
247
|
healthScoreBadge
|
|
246
248
|
]);
|
|
247
249
|
const { instructionsFooter, footerVariant } = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
@@ -488,7 +490,7 @@ const AgentNodeComponent = /*#__PURE__*/ (0, external_react_namespaceObject.memo
|
|
|
488
490
|
...data,
|
|
489
491
|
display: {
|
|
490
492
|
label: name,
|
|
491
|
-
subLabel:
|
|
493
|
+
subLabel: agentTypeLabel,
|
|
492
494
|
shape: 'rectangle',
|
|
493
495
|
background: 'var(--canvas-background)',
|
|
494
496
|
iconBackground: 'var(--canvas-background-secondary)'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentNode.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/AgentCanvas/nodes/AgentNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAIhF,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA8BlE,UAAU,aAAc,SAAQ,YAAY;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO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,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,aAAa,GAAG,KAAK,KAAK,IAAI,CAAC;IAClG,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,YAAY,EAAE,qBAAqB,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAEhD,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AA4kBD,eAAO,MAAM,gBAAgB,8CAxDI,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,cAAc,6CAwD1B,CAAC;AAEvD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -27,19 +27,23 @@ const AgentNodeComponent = /*#__PURE__*/ memo((props)=>{
|
|
|
27
27
|
const suggestionType = isSuggestion ? data.suggestionType : null;
|
|
28
28
|
const isConversational = definition?.metadata?.isConversational === true;
|
|
29
29
|
const suggestTranslations = suggestionTranslations ?? DefaultSuggestionTranslations;
|
|
30
|
+
const agentTypeLabel = isConversational ? translations.conversationalAgent : translations.autonomousAgent;
|
|
30
31
|
const agentIcon = useMemo(()=>{
|
|
31
32
|
if (isConversational) return /*#__PURE__*/ jsx(ConversationalAgentIcon, {
|
|
32
33
|
color: "var(--canvas-foreground-de-emp)",
|
|
33
34
|
w: 32,
|
|
34
|
-
h: 32
|
|
35
|
+
h: 32,
|
|
36
|
+
label: agentTypeLabel
|
|
35
37
|
});
|
|
36
38
|
return /*#__PURE__*/ jsx(AutonomousAgentIcon, {
|
|
37
39
|
color: "var(--canvas-foreground-de-emp)",
|
|
38
40
|
w: 32,
|
|
39
|
-
h: 32
|
|
41
|
+
h: 32,
|
|
42
|
+
label: agentTypeLabel
|
|
40
43
|
});
|
|
41
44
|
}, [
|
|
42
|
-
isConversational
|
|
45
|
+
isConversational,
|
|
46
|
+
agentTypeLabel
|
|
43
47
|
]);
|
|
44
48
|
const settings = definition?.settings;
|
|
45
49
|
const handleMouseEnter = useCallback(()=>{
|
|
@@ -201,19 +205,17 @@ const AgentNodeComponent = /*#__PURE__*/ memo((props)=>{
|
|
|
201
205
|
onHealthScoreClick
|
|
202
206
|
]);
|
|
203
207
|
const subLabelWithHealthScore = useMemo(()=>{
|
|
204
|
-
|
|
205
|
-
if (!healthScoreBadge) return baseSubLabel;
|
|
208
|
+
if (!healthScoreBadge) return agentTypeLabel;
|
|
206
209
|
return /*#__PURE__*/ jsxs(SubLabelContainer, {
|
|
207
210
|
children: [
|
|
208
211
|
/*#__PURE__*/ jsx("span", {
|
|
209
|
-
children:
|
|
212
|
+
children: agentTypeLabel
|
|
210
213
|
}),
|
|
211
214
|
healthScoreBadge
|
|
212
215
|
]
|
|
213
216
|
});
|
|
214
217
|
}, [
|
|
215
|
-
|
|
216
|
-
translations,
|
|
218
|
+
agentTypeLabel,
|
|
217
219
|
healthScoreBadge
|
|
218
220
|
]);
|
|
219
221
|
const { instructionsFooter, footerVariant } = useMemo(()=>{
|
|
@@ -460,7 +462,7 @@ const AgentNodeComponent = /*#__PURE__*/ memo((props)=>{
|
|
|
460
462
|
...data,
|
|
461
463
|
display: {
|
|
462
464
|
label: name,
|
|
463
|
-
subLabel:
|
|
465
|
+
subLabel: agentTypeLabel,
|
|
464
466
|
shape: 'rectangle',
|
|
465
467
|
background: 'var(--canvas-background)',
|
|
466
468
|
iconBackground: 'var(--canvas-background-secondary)'
|
|
@@ -286,12 +286,14 @@ const BaseNodeComponent = (props)=>{
|
|
|
286
286
|
isHovered,
|
|
287
287
|
isFocused
|
|
288
288
|
]);
|
|
289
|
-
const shouldShowHandles = (0,
|
|
289
|
+
const { shouldShowHandles, showAddButton } = (0, NodeUtils_cjs_namespaceObject.resolveNodeHandleAffordances)({
|
|
290
290
|
isConnecting,
|
|
291
291
|
selected,
|
|
292
|
-
isHovered,
|
|
293
|
-
dragging
|
|
294
|
-
|
|
292
|
+
hovered: isHovered,
|
|
293
|
+
dragging,
|
|
294
|
+
canEdit,
|
|
295
|
+
multipleNodesSelected
|
|
296
|
+
});
|
|
295
297
|
const hasVisibleBottomHandles = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
296
298
|
if (!handleConfigurations || !Array.isArray(handleConfigurations) || !selected || 'circle' === displayShape) return false;
|
|
297
299
|
return handleConfigurations.some((config)=>config.position === react_cjs_namespaceObject.Position.Bottom && config.handles.length > 0 && false !== config.visible && (config.handles.some((h)=>'source' === h.type) || config.handles.some((h)=>h.showButton)));
|
|
@@ -389,7 +391,7 @@ const BaseNodeComponent = (props)=>{
|
|
|
389
391
|
nodeId: id,
|
|
390
392
|
selected: selected ?? false,
|
|
391
393
|
hovered: isHovered,
|
|
392
|
-
showAddButton
|
|
394
|
+
showAddButton,
|
|
393
395
|
isLocked: !canEdit,
|
|
394
396
|
showNotches,
|
|
395
397
|
nodeWidth: containerWidth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AA+ChF,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AA+ChF,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AA6tB1B,eAAO,MAAM,QAAQ,8CAxrBa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CAwrBmB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { isWideNodeShape } from "../../schema/index.js";
|
|
|
9
9
|
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
10
10
|
import { CanvasIcon, getIcon } from "../../utils/icon-registry.js";
|
|
11
11
|
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
12
|
-
import { selectIsConnecting } from "../../utils/NodeUtils.js";
|
|
12
|
+
import { resolveNodeHandleAffordances, selectIsConnecting } from "../../utils/NodeUtils.js";
|
|
13
13
|
import { areNodePropsEqualIgnoringPosition } from "../../utils/nodePropsEqual.js";
|
|
14
14
|
import { resolveToolbar } from "../../utils/toolbar-resolver.js";
|
|
15
15
|
import { useBaseCanvasMode } from "../BaseCanvas/BaseCanvasModeProvider.js";
|
|
@@ -258,12 +258,14 @@ const BaseNodeComponent = (props)=>{
|
|
|
258
258
|
isHovered,
|
|
259
259
|
isFocused
|
|
260
260
|
]);
|
|
261
|
-
const shouldShowHandles =
|
|
261
|
+
const { shouldShowHandles, showAddButton } = resolveNodeHandleAffordances({
|
|
262
262
|
isConnecting,
|
|
263
263
|
selected,
|
|
264
|
-
isHovered,
|
|
265
|
-
dragging
|
|
266
|
-
|
|
264
|
+
hovered: isHovered,
|
|
265
|
+
dragging,
|
|
266
|
+
canEdit,
|
|
267
|
+
multipleNodesSelected
|
|
268
|
+
});
|
|
267
269
|
const hasVisibleBottomHandles = useMemo(()=>{
|
|
268
270
|
if (!handleConfigurations || !Array.isArray(handleConfigurations) || !selected || 'circle' === displayShape) return false;
|
|
269
271
|
return handleConfigurations.some((config)=>config.position === Position.Bottom && config.handles.length > 0 && false !== config.visible && (config.handles.some((h)=>'source' === h.type) || config.handles.some((h)=>h.showButton)));
|
|
@@ -361,7 +363,7 @@ const BaseNodeComponent = (props)=>{
|
|
|
361
363
|
nodeId: id,
|
|
362
364
|
selected: selected ?? false,
|
|
363
365
|
hovered: isHovered,
|
|
364
|
-
showAddButton
|
|
366
|
+
showAddButton,
|
|
365
367
|
isLocked: !canEdit,
|
|
366
368
|
showNotches,
|
|
367
369
|
nodeWidth: containerWidth,
|
|
@@ -31,6 +31,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
31
31
|
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
32
32
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
33
33
|
const external_react_namespaceObject = require("react");
|
|
34
|
+
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
34
35
|
const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
|
|
35
36
|
const external_NodeViewportOverlay_cjs_namespaceObject = require("../NodeViewportOverlay.cjs");
|
|
36
37
|
const external_CanvasInlineButton_cjs_namespaceObject = require("./CanvasInlineButton.cjs");
|
|
@@ -41,7 +42,6 @@ const BUTTON_POSITION = {
|
|
|
41
42
|
[react_cjs_namespaceObject.Position.Left]: 'flex-row-reverse right-full top-1/2 -translate-y-1/2',
|
|
42
43
|
[react_cjs_namespaceObject.Position.Right]: 'flex-row left-full top-1/2 -translate-y-1/2'
|
|
43
44
|
};
|
|
44
|
-
const DRAG_THRESHOLD = 5;
|
|
45
45
|
const HandleButton = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ visible, labelVisible, keepButtonMounted = false, position, onAction, onMouseEnter, onMouseLeave, handleRef, label, labelIcon, labelBackgroundColor, renderLabel = true, portal })=>{
|
|
46
46
|
const accessibleName = label ? `Add node from ${label} handle` : 'Add node';
|
|
47
47
|
const didDragRef = (0, external_react_namespaceObject.useRef)(false);
|
|
@@ -63,7 +63,7 @@ const HandleButton = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ v
|
|
|
63
63
|
if (didDragRef.current) return;
|
|
64
64
|
const dx = moveEvt.clientX - startX;
|
|
65
65
|
const dy = moveEvt.clientY - startY;
|
|
66
|
-
if (dx * dx + dy * dy <
|
|
66
|
+
if (dx * dx + dy * dy < external_constants_cjs_namespaceObject.HANDLE_DRAG_THRESHOLD * external_constants_cjs_namespaceObject.HANDLE_DRAG_THRESHOLD) return;
|
|
67
67
|
didDragRef.current = true;
|
|
68
68
|
const handleEl = handleRef?.current;
|
|
69
69
|
if (handleEl) {
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Row } from "../../layouts/index.js";
|
|
3
3
|
import { Position } from "../../xyflow/react.js";
|
|
4
4
|
import { memo, useCallback, useEffect, useRef } from "react";
|
|
5
|
+
import { HANDLE_DRAG_THRESHOLD } from "../../constants.js";
|
|
5
6
|
import { cx } from "../../utils/CssUtil.js";
|
|
6
7
|
import { NodeViewportOverlay } from "../NodeViewportOverlay.js";
|
|
7
8
|
import { CanvasInlineButton } from "./CanvasInlineButton.js";
|
|
@@ -12,7 +13,6 @@ const BUTTON_POSITION = {
|
|
|
12
13
|
[Position.Left]: 'flex-row-reverse right-full top-1/2 -translate-y-1/2',
|
|
13
14
|
[Position.Right]: 'flex-row left-full top-1/2 -translate-y-1/2'
|
|
14
15
|
};
|
|
15
|
-
const DRAG_THRESHOLD = 5;
|
|
16
16
|
const HandleButton = /*#__PURE__*/ memo(({ visible, labelVisible, keepButtonMounted = false, position, onAction, onMouseEnter, onMouseLeave, handleRef, label, labelIcon, labelBackgroundColor, renderLabel = true, portal })=>{
|
|
17
17
|
const accessibleName = label ? `Add node from ${label} handle` : 'Add node';
|
|
18
18
|
const didDragRef = useRef(false);
|
|
@@ -34,7 +34,7 @@ const HandleButton = /*#__PURE__*/ memo(({ visible, labelVisible, keepButtonMoun
|
|
|
34
34
|
if (didDragRef.current) return;
|
|
35
35
|
const dx = moveEvt.clientX - startX;
|
|
36
36
|
const dy = moveEvt.clientY - startY;
|
|
37
|
-
if (dx * dx + dy * dy <
|
|
37
|
+
if (dx * dx + dy * dy < HANDLE_DRAG_THRESHOLD * HANDLE_DRAG_THRESHOLD) return;
|
|
38
38
|
didDragRef.current = true;
|
|
39
39
|
const handleEl = handleRef?.current;
|
|
40
40
|
if (handleEl) {
|
|
@@ -239,8 +239,14 @@ function ContainerNodeComponent(props) {
|
|
|
239
239
|
const handleHandleAction = (0, external_react_namespaceObject.useCallback)((_event)=>{
|
|
240
240
|
setIsHovered(false);
|
|
241
241
|
}, []);
|
|
242
|
-
const shouldShowHandles
|
|
243
|
-
|
|
242
|
+
const { shouldShowHandles, showAddButton: showHandleAddButtons } = (0, NodeUtils_cjs_namespaceObject.resolveNodeHandleAffordances)({
|
|
243
|
+
isConnecting,
|
|
244
|
+
selected,
|
|
245
|
+
hovered: isHovered,
|
|
246
|
+
dragging,
|
|
247
|
+
canEdit: canEditNode,
|
|
248
|
+
multipleNodesSelected
|
|
249
|
+
});
|
|
244
250
|
const showEmptyState = canEditNode && !hasChildNodes && hasEmptyState;
|
|
245
251
|
const interactionState = (0, external_ContainerNode_hooks_cjs_namespaceObject.resolveInteractionState)(dragging, selected, isHovered);
|
|
246
252
|
const activeStatus = suggestionType ?? validationState?.validationStatus ?? executionStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ContainerNode/ContainerNode.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContainerNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ContainerNode/ContainerNode.tsx"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAWhE,iBAAS,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,2CA8XxD;AAOD,eAAO,MAAM,aAAa,oEAAkE,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { useElementValidationStatus, useNodeExecutionState, useToolbarActionStor
|
|
|
8
8
|
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
9
9
|
import { DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH } from "../../utils/container.js";
|
|
10
10
|
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
11
|
-
import { selectIsConnecting, snapToGrid } from "../../utils/NodeUtils.js";
|
|
11
|
+
import { resolveNodeHandleAffordances, selectIsConnecting, snapToGrid } from "../../utils/NodeUtils.js";
|
|
12
12
|
import { areNodePropsEqualIgnoringPosition } from "../../utils/nodePropsEqual.js";
|
|
13
13
|
import { resolveToolbar } from "../../utils/toolbar-resolver.js";
|
|
14
14
|
import { useBaseCanvasMode } from "../BaseCanvas/BaseCanvasModeProvider.js";
|
|
@@ -211,8 +211,14 @@ function ContainerNodeComponent(props) {
|
|
|
211
211
|
const handleHandleAction = useCallback((_event)=>{
|
|
212
212
|
setIsHovered(false);
|
|
213
213
|
}, []);
|
|
214
|
-
const shouldShowHandles
|
|
215
|
-
|
|
214
|
+
const { shouldShowHandles, showAddButton: showHandleAddButtons } = resolveNodeHandleAffordances({
|
|
215
|
+
isConnecting,
|
|
216
|
+
selected,
|
|
217
|
+
hovered: isHovered,
|
|
218
|
+
dragging,
|
|
219
|
+
canEdit: canEditNode,
|
|
220
|
+
multipleNodesSelected
|
|
221
|
+
});
|
|
216
222
|
const showEmptyState = canEditNode && !hasChildNodes && hasEmptyState;
|
|
217
223
|
const interactionState = resolveInteractionState(dragging, selected, isHovered);
|
|
218
224
|
const activeStatus = suggestionType ?? validationState?.validationStatus ?? executionStatus;
|
|
@@ -30,6 +30,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
DEFAULT_SOURCE_HANDLE_ID: ()=>DEFAULT_SOURCE_HANDLE_ID,
|
|
31
31
|
FLOATING_CANVAS_PANEL_OFFSET: ()=>FLOATING_CANVAS_PANEL_OFFSET,
|
|
32
32
|
GRID_SPACING: ()=>GRID_SPACING,
|
|
33
|
+
HANDLE_DRAG_THRESHOLD: ()=>HANDLE_DRAG_THRESHOLD,
|
|
33
34
|
NODE_BADGE_INSET_CIRCLE: ()=>NODE_BADGE_INSET_CIRCLE,
|
|
34
35
|
NODE_BADGE_INSET_SQUARE: ()=>NODE_BADGE_INSET_SQUARE,
|
|
35
36
|
NODE_BADGE_SIZE: ()=>NODE_BADGE_SIZE,
|
|
@@ -58,6 +59,7 @@ const PREVIEW_EDGE_ID = 'preview-edge-id';
|
|
|
58
59
|
const DEFAULT_SOURCE_HANDLE_ID = 'output';
|
|
59
60
|
const DEFAULT_NODE_SIZE = 96;
|
|
60
61
|
const GRID_SPACING = 16;
|
|
62
|
+
const HANDLE_DRAG_THRESHOLD = 5;
|
|
61
63
|
const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
62
64
|
const TOOLBOX_WIDTH = 320;
|
|
63
65
|
const TOOLBOX_HEIGHT = 410;
|
|
@@ -87,6 +89,7 @@ exports.DEFAULT_RECTANGLE_NODE_WIDTH = __webpack_exports__.DEFAULT_RECTANGLE_NOD
|
|
|
87
89
|
exports.DEFAULT_SOURCE_HANDLE_ID = __webpack_exports__.DEFAULT_SOURCE_HANDLE_ID;
|
|
88
90
|
exports.FLOATING_CANVAS_PANEL_OFFSET = __webpack_exports__.FLOATING_CANVAS_PANEL_OFFSET;
|
|
89
91
|
exports.GRID_SPACING = __webpack_exports__.GRID_SPACING;
|
|
92
|
+
exports.HANDLE_DRAG_THRESHOLD = __webpack_exports__.HANDLE_DRAG_THRESHOLD;
|
|
90
93
|
exports.NODE_BADGE_INSET_CIRCLE = __webpack_exports__.NODE_BADGE_INSET_CIRCLE;
|
|
91
94
|
exports.NODE_BADGE_INSET_SQUARE = __webpack_exports__.NODE_BADGE_INSET_SQUARE;
|
|
92
95
|
exports.NODE_BADGE_SIZE = __webpack_exports__.NODE_BADGE_SIZE;
|
|
@@ -116,6 +119,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
116
119
|
"DEFAULT_SOURCE_HANDLE_ID",
|
|
117
120
|
"FLOATING_CANVAS_PANEL_OFFSET",
|
|
118
121
|
"GRID_SPACING",
|
|
122
|
+
"HANDLE_DRAG_THRESHOLD",
|
|
119
123
|
"NODE_BADGE_INSET_CIRCLE",
|
|
120
124
|
"NODE_BADGE_INSET_SQUARE",
|
|
121
125
|
"NODE_BADGE_SIZE",
|
|
@@ -3,6 +3,7 @@ export declare const PREVIEW_EDGE_ID = "preview-edge-id";
|
|
|
3
3
|
export declare const DEFAULT_SOURCE_HANDLE_ID = "output";
|
|
4
4
|
export declare const DEFAULT_NODE_SIZE = 96;
|
|
5
5
|
export declare const GRID_SPACING = 16;
|
|
6
|
+
export declare const HANDLE_DRAG_THRESHOLD = 5;
|
|
6
7
|
export declare const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
7
8
|
export declare const TOOLBOX_WIDTH = 320;
|
|
8
9
|
export declare const TOOLBOX_HEIGHT = 410;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/canvas/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AACjD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,YAAY,KAAK,CAAC;AAG/B,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAG7C,eAAO,MAAM,aAAa,MAAM,CAAC;AAOjC,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,WAAW,KAAK,CAAC;AAU9B,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAG/C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAGhD,eAAO,MAAM,mBAAmB,QAAmB,CA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AAO,MAAM,yBAAyB,QAAmB,CAAC;AAC1D,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAO3D,eAAO,MAAM,2BAA2B,QAAyB,CAAC;AAClE,eAAO,MAAM,sBAAsB,QAAyB,CAAC;AAC7D,eAAO,MAAM,qBAAqB,QAAyB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,QAAyB,CAAC;AAC9D,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAGlC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAGxD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
|
package/dist/canvas/constants.js
CHANGED
|
@@ -3,6 +3,7 @@ const PREVIEW_EDGE_ID = 'preview-edge-id';
|
|
|
3
3
|
const DEFAULT_SOURCE_HANDLE_ID = 'output';
|
|
4
4
|
const DEFAULT_NODE_SIZE = 96;
|
|
5
5
|
const GRID_SPACING = 16;
|
|
6
|
+
const HANDLE_DRAG_THRESHOLD = 5;
|
|
6
7
|
const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
7
8
|
const TOOLBOX_WIDTH = 320;
|
|
8
9
|
const TOOLBOX_HEIGHT = 410;
|
|
@@ -26,4 +27,4 @@ const NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES = -40;
|
|
|
26
27
|
const NODE_BADGE_SIZE = 20;
|
|
27
28
|
const NODE_BADGE_INSET_SQUARE = 6;
|
|
28
29
|
const NODE_BADGE_INSET_CIRCLE = 12;
|
|
29
|
-
export { CANVAS_COMPACT_BREAKPOINT, DEFAULT_NODE_SIZE, DEFAULT_RECTANGLE_NODE_WIDTH, DEFAULT_SOURCE_HANDLE_ID, FLOATING_CANVAS_PANEL_OFFSET, GRID_SPACING, NODE_BADGE_INSET_CIRCLE, NODE_BADGE_INSET_SQUARE, NODE_BADGE_SIZE, NODE_BORDER_SIZE, NODE_CONTAINER_RADIUS_RATIO, NODE_ERROR_ICON_SIZE, NODE_HEIGHT_DEFAULT, NODE_HEIGHT_FOOTER_BUTTON, NODE_HEIGHT_FOOTER_DOUBLE, NODE_HEIGHT_FOOTER_SINGLE, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO, NODE_TEXT_BOTTOM_OFFSET, NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES, PREVIEW_EDGE_ID, PREVIEW_NODE_ID, TOOLBOX_GAP, TOOLBOX_HEIGHT, TOOLBOX_PADDING_X, TOOLBOX_PADDING_Y, TOOLBOX_WIDTH };
|
|
30
|
+
export { CANVAS_COMPACT_BREAKPOINT, DEFAULT_NODE_SIZE, DEFAULT_RECTANGLE_NODE_WIDTH, DEFAULT_SOURCE_HANDLE_ID, FLOATING_CANVAS_PANEL_OFFSET, GRID_SPACING, HANDLE_DRAG_THRESHOLD, NODE_BADGE_INSET_CIRCLE, NODE_BADGE_INSET_SQUARE, NODE_BADGE_SIZE, NODE_BORDER_SIZE, NODE_CONTAINER_RADIUS_RATIO, NODE_ERROR_ICON_SIZE, NODE_HEIGHT_DEFAULT, NODE_HEIGHT_FOOTER_BUTTON, NODE_HEIGHT_FOOTER_DOUBLE, NODE_HEIGHT_FOOTER_SINGLE, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO, NODE_TEXT_BOTTOM_OFFSET, NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES, PREVIEW_EDGE_ID, PREVIEW_NODE_ID, TOOLBOX_GAP, TOOLBOX_HEIGHT, TOOLBOX_PADDING_X, TOOLBOX_PADDING_Y, TOOLBOX_WIDTH };
|
|
@@ -27,13 +27,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
AutonomousAgentIcon: ()=>AutonomousAgentIcon
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const AutonomousAgentIcon = ({ w = 48, h = 48, color = 'currentColor' })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
30
|
+
const AutonomousAgentIcon = ({ w = 48, h = 48, color = 'currentColor', label })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
31
31
|
xmlns: "http://www.w3.org/2000/svg",
|
|
32
32
|
width: w,
|
|
33
33
|
height: h,
|
|
34
34
|
viewBox: "0 0 26 26",
|
|
35
35
|
fill: "none",
|
|
36
36
|
"data-testid": "autonomous-agent-icon",
|
|
37
|
+
...label ? {
|
|
38
|
+
role: 'img',
|
|
39
|
+
'aria-label': label
|
|
40
|
+
} : {
|
|
41
|
+
'aria-hidden': true
|
|
42
|
+
},
|
|
37
43
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
38
44
|
d: "M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",
|
|
39
45
|
fill: color
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare const AutonomousAgentIcon: ({ w, h, color, }: {
|
|
1
|
+
export declare const AutonomousAgentIcon: ({ w, h, color, label, }: {
|
|
2
2
|
w?: number | string;
|
|
3
3
|
h?: number | string;
|
|
4
4
|
color?: string;
|
|
5
|
+
label?: string;
|
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=AutonomousAgentIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutonomousAgentIcon.d.ts","sourceRoot":"","sources":["../../../src/canvas/icons/AutonomousAgentIcon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,GAAI,
|
|
1
|
+
{"version":3,"file":"AutonomousAgentIcon.d.ts","sourceRoot":"","sources":["../../../src/canvas/icons/AutonomousAgentIcon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,GAAI,yBAKjC;IACD,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,4CAiBA,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
const AutonomousAgentIcon = ({ w = 48, h = 48, color = 'currentColor' })=>/*#__PURE__*/ jsx("svg", {
|
|
2
|
+
const AutonomousAgentIcon = ({ w = 48, h = 48, color = 'currentColor', label })=>/*#__PURE__*/ jsx("svg", {
|
|
3
3
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4
4
|
width: w,
|
|
5
5
|
height: h,
|
|
6
6
|
viewBox: "0 0 26 26",
|
|
7
7
|
fill: "none",
|
|
8
8
|
"data-testid": "autonomous-agent-icon",
|
|
9
|
+
...label ? {
|
|
10
|
+
role: 'img',
|
|
11
|
+
'aria-label': label
|
|
12
|
+
} : {
|
|
13
|
+
'aria-hidden': true
|
|
14
|
+
},
|
|
9
15
|
children: /*#__PURE__*/ jsx("path", {
|
|
10
16
|
d: "M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",
|
|
11
17
|
fill: color
|
|
@@ -27,13 +27,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
ConversationalAgentIcon: ()=>ConversationalAgentIcon
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const ConversationalAgentIcon = ({ w = 48, h = 48, color = 'currentColor' })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
|
|
30
|
+
const ConversationalAgentIcon = ({ w = 48, h = 48, color = 'currentColor', label })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
|
|
31
31
|
xmlns: "http://www.w3.org/2000/svg",
|
|
32
32
|
width: w,
|
|
33
33
|
height: h,
|
|
34
34
|
viewBox: "0 0 26 26",
|
|
35
35
|
fill: "none",
|
|
36
36
|
"data-testid": "conversational-agent-icon",
|
|
37
|
+
...label ? {
|
|
38
|
+
role: 'img',
|
|
39
|
+
'aria-label': label
|
|
40
|
+
} : {
|
|
41
|
+
'aria-hidden': true
|
|
42
|
+
},
|
|
37
43
|
children: [
|
|
38
44
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
39
45
|
d: "M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare const ConversationalAgentIcon: ({ w, h, color, }: {
|
|
1
|
+
export declare const ConversationalAgentIcon: ({ w, h, color, label, }: {
|
|
2
2
|
w?: number | string;
|
|
3
3
|
h?: number | string;
|
|
4
4
|
color?: string;
|
|
5
|
+
label?: string;
|
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=ConversationalAgentIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationalAgentIcon.d.ts","sourceRoot":"","sources":["../../../src/canvas/icons/ConversationalAgentIcon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,GAAI,
|
|
1
|
+
{"version":3,"file":"ConversationalAgentIcon.d.ts","sourceRoot":"","sources":["../../../src/canvas/icons/ConversationalAgentIcon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,GAAI,yBAKrC;IACD,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,4CAkCA,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
const ConversationalAgentIcon = ({ w = 48, h = 48, color = 'currentColor' })=>/*#__PURE__*/ jsxs("svg", {
|
|
2
|
+
const ConversationalAgentIcon = ({ w = 48, h = 48, color = 'currentColor', label })=>/*#__PURE__*/ jsxs("svg", {
|
|
3
3
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4
4
|
width: w,
|
|
5
5
|
height: h,
|
|
6
6
|
viewBox: "0 0 26 26",
|
|
7
7
|
fill: "none",
|
|
8
8
|
"data-testid": "conversational-agent-icon",
|
|
9
|
+
...label ? {
|
|
10
|
+
role: 'img',
|
|
11
|
+
'aria-label': label
|
|
12
|
+
} : {
|
|
13
|
+
'aria-hidden': true
|
|
14
|
+
},
|
|
9
15
|
children: [
|
|
10
16
|
/*#__PURE__*/ jsx("path", {
|
|
11
17
|
d: "M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",
|
|
@@ -33,11 +33,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
snapUpToGrid: ()=>snapUpToGrid,
|
|
34
34
|
resolveHandleContext: ()=>resolveHandleContext,
|
|
35
35
|
resolveCollisions: ()=>resolveCollisions,
|
|
36
|
-
snapDownToGrid: ()=>snapDownToGrid
|
|
36
|
+
snapDownToGrid: ()=>snapDownToGrid,
|
|
37
|
+
resolveNodeHandleAffordances: ()=>resolveNodeHandleAffordances
|
|
37
38
|
});
|
|
38
39
|
const react_cjs_namespaceObject = require("../xyflow/react.cjs");
|
|
39
40
|
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
40
41
|
const selectIsConnecting = (state)=>!!state.connection.inProgress;
|
|
42
|
+
function resolveNodeHandleAffordances({ isConnecting, selected = false, hovered, dragging = false, canEdit, multipleNodesSelected }) {
|
|
43
|
+
const showAddButton = canEdit && !multipleNodesSelected && !isConnecting && !dragging;
|
|
44
|
+
return {
|
|
45
|
+
shouldShowHandles: (isConnecting || selected || hovered) && !dragging,
|
|
46
|
+
showAddButton,
|
|
47
|
+
isAddButtonVisible: showAddButton && (selected || hovered)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
41
50
|
const getAbsolutePosition = (node, nodes)=>{
|
|
42
51
|
let x = node.position.x;
|
|
43
52
|
let y = node.position.y;
|
|
@@ -176,6 +185,7 @@ exports.getHandleIndex = __webpack_exports__.getHandleIndex;
|
|
|
176
185
|
exports.getNonOverlappingPositionForDirection = __webpack_exports__.getNonOverlappingPositionForDirection;
|
|
177
186
|
exports.resolveCollisions = __webpack_exports__.resolveCollisions;
|
|
178
187
|
exports.resolveHandleContext = __webpack_exports__.resolveHandleContext;
|
|
188
|
+
exports.resolveNodeHandleAffordances = __webpack_exports__.resolveNodeHandleAffordances;
|
|
179
189
|
exports.selectIsConnecting = __webpack_exports__.selectIsConnecting;
|
|
180
190
|
exports.snapDownToGrid = __webpack_exports__.snapDownToGrid;
|
|
181
191
|
exports.snapToGrid = __webpack_exports__.snapToGrid;
|
|
@@ -187,6 +197,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
187
197
|
"getNonOverlappingPositionForDirection",
|
|
188
198
|
"resolveCollisions",
|
|
189
199
|
"resolveHandleContext",
|
|
200
|
+
"resolveNodeHandleAffordances",
|
|
190
201
|
"selectIsConnecting",
|
|
191
202
|
"snapDownToGrid",
|
|
192
203
|
"snapToGrid",
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { type Handle, type InternalNode, type Node, Position, type ReactFlowState, type XYPosition } from '../xyflow/react.ts';
|
|
2
2
|
export declare const selectIsConnecting: (state: ReactFlowState) => boolean;
|
|
3
|
+
export interface NodeHandleAffordanceState {
|
|
4
|
+
isConnecting: boolean;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
hovered: boolean;
|
|
7
|
+
dragging?: boolean;
|
|
8
|
+
canEdit: boolean;
|
|
9
|
+
multipleNodesSelected: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface NodeHandleAffordances {
|
|
12
|
+
shouldShowHandles: boolean;
|
|
13
|
+
showAddButton: boolean;
|
|
14
|
+
isAddButtonVisible: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveNodeHandleAffordances({ isConnecting, selected, hovered, dragging, canEdit, multipleNodesSelected, }: NodeHandleAffordanceState): NodeHandleAffordances;
|
|
3
17
|
export declare const getAbsolutePosition: (node: Node, nodes: Node[]) => {
|
|
4
18
|
x: number;
|
|
5
19
|
y: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeUtils.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/NodeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,0CAA0C,CAAC;AAQlD,eAAO,MAAM,kBAAkB,GAAI,OAAO,cAAc,YAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeUtils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BAAsB,CAAC;CACrC;AAMD,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,QAAQ,EACxB,OAAO,CAAC,EAAE,2BAA2B,GACpC,aAAa,GAAG,SAAS,CAkB3B;AAoCD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAAE,GACnB,MAAM,GAAG,IAAI,CAQf"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Position } from "../xyflow/react.js";
|
|
2
2
|
import { DEFAULT_NODE_SIZE, GRID_SPACING, PREVIEW_NODE_ID } from "../constants.js";
|
|
3
3
|
const selectIsConnecting = (state)=>!!state.connection.inProgress;
|
|
4
|
+
function resolveNodeHandleAffordances({ isConnecting, selected = false, hovered, dragging = false, canEdit, multipleNodesSelected }) {
|
|
5
|
+
const showAddButton = canEdit && !multipleNodesSelected && !isConnecting && !dragging;
|
|
6
|
+
return {
|
|
7
|
+
shouldShowHandles: (isConnecting || selected || hovered) && !dragging,
|
|
8
|
+
showAddButton,
|
|
9
|
+
isAddButtonVisible: showAddButton && (selected || hovered)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
4
12
|
const getAbsolutePosition = (node, nodes)=>{
|
|
5
13
|
let x = node.position.x;
|
|
6
14
|
let y = node.position.y;
|
|
@@ -133,4 +141,4 @@ function getHandleIndex(handleId, position, allHandles) {
|
|
|
133
141
|
const index = peers.findIndex((h)=>h.id === handleId);
|
|
134
142
|
return -1 === index ? null : index;
|
|
135
143
|
}
|
|
136
|
-
export { clamp, getAbsolutePosition, getHandleIndex, getNonOverlappingPositionForDirection, resolveCollisions, resolveHandleContext, selectIsConnecting, snapDownToGrid, snapToGrid, snapUpToGrid };
|
|
144
|
+
export { clamp, getAbsolutePosition, getHandleIndex, getNonOverlappingPositionForDirection, resolveCollisions, resolveHandleContext, resolveNodeHandleAffordances, selectIsConnecting, snapDownToGrid, snapToGrid, snapUpToGrid };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.32.0",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -251,10 +251,10 @@
|
|
|
251
251
|
"use-sync-external-store": "^1.2.0",
|
|
252
252
|
"zod": "^4.6.6",
|
|
253
253
|
"zustand": "^5.0.9",
|
|
254
|
-
"@uipath/apollo-core": "5.15.3",
|
|
255
|
-
"@uipath/apollo-ui-icons": "1.2.1",
|
|
256
254
|
"@uipath/apollo-ui-icons-react": "1.0.0",
|
|
257
|
-
"@uipath/apollo-wind": "2.94.1"
|
|
255
|
+
"@uipath/apollo-wind": "2.94.1",
|
|
256
|
+
"@uipath/apollo-core": "5.15.3",
|
|
257
|
+
"@uipath/apollo-ui-icons": "1.2.1"
|
|
258
258
|
},
|
|
259
259
|
"devDependencies": {
|
|
260
260
|
"@lingui/cli": "^5.6.1",
|