@uipath/apollo-react 3.29.1 → 3.30.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/components/SuggestionGroupPanel.cjs +34 -13
- package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.js +34 -13
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.cjs +42 -25
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/nodes/AgentNode.js +42 -25
- package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.cjs +52 -32
- package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.d.ts.map +1 -1
- package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.js +52 -32
- package/dist/canvas/components/BaseNode/BaseNode.cjs +3 -1
- package/dist/canvas/components/BaseNode/BaseNode.d.ts +3 -2
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +3 -1
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts +0 -28
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.cjs +45 -0
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts +31 -0
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.js +8 -0
- package/dist/canvas/components/BaseNode/index.cjs +12 -3
- package/dist/canvas/components/BaseNode/index.d.ts +1 -0
- package/dist/canvas/components/BaseNode/index.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/index.js +1 -0
- package/dist/canvas/components/CodedAgent/CodedAgentFlow.cjs +112 -82
- package/dist/canvas/components/CodedAgent/CodedAgentFlow.d.ts.map +1 -1
- package/dist/canvas/components/CodedAgent/CodedAgentFlow.js +112 -82
- package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.cjs +24 -15
- package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.d.ts.map +1 -1
- package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.js +24 -15
- package/package.json +2 -2
|
@@ -27,11 +27,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
SuggestionGroupPanel: ()=>SuggestionGroupPanel
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const material_namespaceObject = require("@mui/material");
|
|
30
31
|
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
31
32
|
const index_cjs_namespaceObject = require("../../../layouts/index.cjs");
|
|
33
|
+
const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
|
|
32
34
|
const external_material_index_cjs_namespaceObject = require("../../../../material/index.cjs");
|
|
33
35
|
const external_react_namespaceObject = require("react");
|
|
34
|
-
const RejectAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApButton, {
|
|
36
|
+
const RejectAllButton = ({ suggestionGroup, onClick, compact })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApButton, {
|
|
35
37
|
variant: "tertiary",
|
|
36
38
|
size: "small",
|
|
37
39
|
label: "Reject all",
|
|
@@ -39,9 +41,13 @@ const RejectAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ (0, jsx_ru
|
|
|
39
41
|
variant: "outlined",
|
|
40
42
|
name: "close"
|
|
41
43
|
}),
|
|
42
|
-
onClick: ()=>onClick(suggestionGroup.id)
|
|
44
|
+
onClick: ()=>onClick(suggestionGroup.id),
|
|
45
|
+
sx: compact ? {
|
|
46
|
+
fontSize: '0.75rem',
|
|
47
|
+
minWidth: 'auto'
|
|
48
|
+
} : void 0
|
|
43
49
|
});
|
|
44
|
-
const AcceptAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApButton, {
|
|
50
|
+
const AcceptAllButton = ({ suggestionGroup, onClick, compact })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApButton, {
|
|
45
51
|
variant: "primary",
|
|
46
52
|
size: "small",
|
|
47
53
|
label: "Accept all",
|
|
@@ -49,7 +55,11 @@ const AcceptAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ (0, jsx_ru
|
|
|
49
55
|
variant: "outlined",
|
|
50
56
|
name: "check"
|
|
51
57
|
}),
|
|
52
|
-
onClick: ()=>onClick(suggestionGroup.id)
|
|
58
|
+
onClick: ()=>onClick(suggestionGroup.id),
|
|
59
|
+
sx: compact ? {
|
|
60
|
+
fontSize: '0.75rem',
|
|
61
|
+
minWidth: 'auto'
|
|
62
|
+
} : void 0
|
|
53
63
|
});
|
|
54
64
|
const Divider = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
55
65
|
style: {
|
|
@@ -58,15 +68,16 @@ const Divider = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
|
58
68
|
backgroundColor: 'var(--uix-canvas-border)'
|
|
59
69
|
}
|
|
60
70
|
});
|
|
61
|
-
const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavigatePrevious })=>{
|
|
71
|
+
const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavigatePrevious, compact })=>{
|
|
62
72
|
const [isHoveringUp, setIsHoveringUp] = (0, external_react_namespaceObject.useState)(false);
|
|
63
73
|
const [isHoveringDown, setIsHoveringDown] = (0, external_react_namespaceObject.useState)(false);
|
|
74
|
+
const iconSize = compact ? '16px' : '20px';
|
|
64
75
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
65
76
|
style: {
|
|
66
77
|
display: 'flex',
|
|
67
78
|
alignItems: 'center',
|
|
68
79
|
gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
|
|
69
|
-
minWidth: '100px'
|
|
80
|
+
minWidth: compact ? '80px' : '100px'
|
|
70
81
|
},
|
|
71
82
|
children: [
|
|
72
83
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
|
|
@@ -76,11 +87,11 @@ const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavig
|
|
|
76
87
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIcon, {
|
|
77
88
|
name: "keyboard_arrow_up",
|
|
78
89
|
color: isHoveringUp ? 'var(--uix-canvas-primary)' : 'var(--uix-canvas-foreground-de-emp)',
|
|
79
|
-
size:
|
|
90
|
+
size: iconSize
|
|
80
91
|
})
|
|
81
92
|
}),
|
|
82
93
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_material_index_cjs_namespaceObject.ApTypography, {
|
|
83
|
-
variant: apollo_core_namespaceObject.FontVariantToken.fontSizeMBold,
|
|
94
|
+
variant: compact ? apollo_core_namespaceObject.FontVariantToken.fontSizeSBold : apollo_core_namespaceObject.FontVariantToken.fontSizeMBold,
|
|
84
95
|
color: "var(--uix-canvas-foreground-de-emp)",
|
|
85
96
|
children: [
|
|
86
97
|
currentIndex + 1,
|
|
@@ -95,13 +106,17 @@ const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavig
|
|
|
95
106
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIcon, {
|
|
96
107
|
name: "keyboard_arrow_down",
|
|
97
108
|
color: isHoveringDown ? 'var(--uix-canvas-primary)' : 'var(--uix-canvas-foreground-de-emp)',
|
|
98
|
-
size:
|
|
109
|
+
size: iconSize
|
|
99
110
|
})
|
|
100
111
|
})
|
|
101
112
|
]
|
|
102
113
|
});
|
|
103
114
|
};
|
|
104
115
|
const SuggestionGroupPanel = ({ suggestionGroup, onRejectAll, onAcceptAll, currentIndex = 0, onNavigateNext, onNavigatePrevious })=>{
|
|
116
|
+
const theme = (0, material_namespaceObject.useTheme)();
|
|
117
|
+
const canvasWidth = (0, react_cjs_namespaceObject.useStore)((state)=>state.width);
|
|
118
|
+
const smBreakpoint = theme.breakpoints.values.sm;
|
|
119
|
+
const isCompact = canvasWidth < smBreakpoint;
|
|
105
120
|
const nonStandaloneSuggestions = suggestionGroup?.suggestions.filter((s)=>!s.isStandalone) ?? [];
|
|
106
121
|
const placeholderCount = nonStandaloneSuggestions.length;
|
|
107
122
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
@@ -118,23 +133,29 @@ const SuggestionGroupPanel = ({ suggestionGroup, onRejectAll, onAcceptAll, curre
|
|
|
118
133
|
},
|
|
119
134
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
120
135
|
align: "center",
|
|
121
|
-
gap: apollo_core_namespaceObject.Spacing.SpacingS,
|
|
136
|
+
gap: isCompact ? apollo_core_namespaceObject.Spacing.SpacingXs : apollo_core_namespaceObject.Spacing.SpacingS,
|
|
122
137
|
justify: "space-evenly",
|
|
138
|
+
style: {
|
|
139
|
+
whiteSpace: 'nowrap'
|
|
140
|
+
},
|
|
123
141
|
children: [
|
|
124
142
|
onRejectAll && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(RejectAllButton, {
|
|
125
143
|
suggestionGroup: suggestionGroup,
|
|
126
|
-
onClick: onRejectAll
|
|
144
|
+
onClick: onRejectAll,
|
|
145
|
+
compact: isCompact
|
|
127
146
|
}),
|
|
128
147
|
onAcceptAll && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AcceptAllButton, {
|
|
129
148
|
suggestionGroup: suggestionGroup,
|
|
130
|
-
onClick: onAcceptAll
|
|
149
|
+
onClick: onAcceptAll,
|
|
150
|
+
compact: isCompact
|
|
131
151
|
}),
|
|
132
152
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Divider, {}),
|
|
133
153
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SuggestionGroupNavigator, {
|
|
134
154
|
currentIndex: currentIndex,
|
|
135
155
|
total: placeholderCount,
|
|
136
156
|
onNavigateNext: onNavigateNext,
|
|
137
|
-
onNavigatePrevious: onNavigatePrevious
|
|
157
|
+
onNavigatePrevious: onNavigatePrevious,
|
|
158
|
+
compact: isCompact
|
|
138
159
|
})
|
|
139
160
|
]
|
|
140
161
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionGroupPanel.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/AgentCanvas/components/SuggestionGroupPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuggestionGroupPanel.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/AgentCanvas/components/SuggestionGroupPanel.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,UAAU,yBAAyB;IACjC,eAAe,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAuGD,eAAO,MAAM,oBAAoB,GAAI,kGAOlC,yBAAyB,4CA2D3B,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@mui/material";
|
|
2
3
|
import { FontVariantToken, Spacing } from "@uipath/apollo-core";
|
|
3
4
|
import { Column, Row } from "../../../layouts/index.js";
|
|
5
|
+
import { useStore } from "../../../xyflow/react.js";
|
|
4
6
|
import { ApButton, ApIcon, ApIconButton, ApTypography } from "../../../../material/index.js";
|
|
5
7
|
import { useState } from "react";
|
|
6
|
-
const RejectAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ jsx(ApButton, {
|
|
8
|
+
const RejectAllButton = ({ suggestionGroup, onClick, compact })=>/*#__PURE__*/ jsx(ApButton, {
|
|
7
9
|
variant: "tertiary",
|
|
8
10
|
size: "small",
|
|
9
11
|
label: "Reject all",
|
|
@@ -11,9 +13,13 @@ const RejectAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ jsx(ApButt
|
|
|
11
13
|
variant: "outlined",
|
|
12
14
|
name: "close"
|
|
13
15
|
}),
|
|
14
|
-
onClick: ()=>onClick(suggestionGroup.id)
|
|
16
|
+
onClick: ()=>onClick(suggestionGroup.id),
|
|
17
|
+
sx: compact ? {
|
|
18
|
+
fontSize: '0.75rem',
|
|
19
|
+
minWidth: 'auto'
|
|
20
|
+
} : void 0
|
|
15
21
|
});
|
|
16
|
-
const AcceptAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ jsx(ApButton, {
|
|
22
|
+
const AcceptAllButton = ({ suggestionGroup, onClick, compact })=>/*#__PURE__*/ jsx(ApButton, {
|
|
17
23
|
variant: "primary",
|
|
18
24
|
size: "small",
|
|
19
25
|
label: "Accept all",
|
|
@@ -21,7 +27,11 @@ const AcceptAllButton = ({ suggestionGroup, onClick })=>/*#__PURE__*/ jsx(ApButt
|
|
|
21
27
|
variant: "outlined",
|
|
22
28
|
name: "check"
|
|
23
29
|
}),
|
|
24
|
-
onClick: ()=>onClick(suggestionGroup.id)
|
|
30
|
+
onClick: ()=>onClick(suggestionGroup.id),
|
|
31
|
+
sx: compact ? {
|
|
32
|
+
fontSize: '0.75rem',
|
|
33
|
+
minWidth: 'auto'
|
|
34
|
+
} : void 0
|
|
25
35
|
});
|
|
26
36
|
const Divider = ()=>/*#__PURE__*/ jsx("div", {
|
|
27
37
|
style: {
|
|
@@ -30,15 +40,16 @@ const Divider = ()=>/*#__PURE__*/ jsx("div", {
|
|
|
30
40
|
backgroundColor: 'var(--uix-canvas-border)'
|
|
31
41
|
}
|
|
32
42
|
});
|
|
33
|
-
const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavigatePrevious })=>{
|
|
43
|
+
const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavigatePrevious, compact })=>{
|
|
34
44
|
const [isHoveringUp, setIsHoveringUp] = useState(false);
|
|
35
45
|
const [isHoveringDown, setIsHoveringDown] = useState(false);
|
|
46
|
+
const iconSize = compact ? '16px' : '20px';
|
|
36
47
|
return /*#__PURE__*/ jsxs("div", {
|
|
37
48
|
style: {
|
|
38
49
|
display: 'flex',
|
|
39
50
|
alignItems: 'center',
|
|
40
51
|
gap: Spacing.SpacingMicro,
|
|
41
|
-
minWidth: '100px'
|
|
52
|
+
minWidth: compact ? '80px' : '100px'
|
|
42
53
|
},
|
|
43
54
|
children: [
|
|
44
55
|
/*#__PURE__*/ jsx(ApIconButton, {
|
|
@@ -48,11 +59,11 @@ const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavig
|
|
|
48
59
|
children: /*#__PURE__*/ jsx(ApIcon, {
|
|
49
60
|
name: "keyboard_arrow_up",
|
|
50
61
|
color: isHoveringUp ? 'var(--uix-canvas-primary)' : 'var(--uix-canvas-foreground-de-emp)',
|
|
51
|
-
size:
|
|
62
|
+
size: iconSize
|
|
52
63
|
})
|
|
53
64
|
}),
|
|
54
65
|
/*#__PURE__*/ jsxs(ApTypography, {
|
|
55
|
-
variant: FontVariantToken.fontSizeMBold,
|
|
66
|
+
variant: compact ? FontVariantToken.fontSizeSBold : FontVariantToken.fontSizeMBold,
|
|
56
67
|
color: "var(--uix-canvas-foreground-de-emp)",
|
|
57
68
|
children: [
|
|
58
69
|
currentIndex + 1,
|
|
@@ -67,13 +78,17 @@ const SuggestionGroupNavigator = ({ currentIndex, total, onNavigateNext, onNavig
|
|
|
67
78
|
children: /*#__PURE__*/ jsx(ApIcon, {
|
|
68
79
|
name: "keyboard_arrow_down",
|
|
69
80
|
color: isHoveringDown ? 'var(--uix-canvas-primary)' : 'var(--uix-canvas-foreground-de-emp)',
|
|
70
|
-
size:
|
|
81
|
+
size: iconSize
|
|
71
82
|
})
|
|
72
83
|
})
|
|
73
84
|
]
|
|
74
85
|
});
|
|
75
86
|
};
|
|
76
87
|
const SuggestionGroupPanel = ({ suggestionGroup, onRejectAll, onAcceptAll, currentIndex = 0, onNavigateNext, onNavigatePrevious })=>{
|
|
88
|
+
const theme = useTheme();
|
|
89
|
+
const canvasWidth = useStore((state)=>state.width);
|
|
90
|
+
const smBreakpoint = theme.breakpoints.values.sm;
|
|
91
|
+
const isCompact = canvasWidth < smBreakpoint;
|
|
77
92
|
const nonStandaloneSuggestions = suggestionGroup?.suggestions.filter((s)=>!s.isStandalone) ?? [];
|
|
78
93
|
const placeholderCount = nonStandaloneSuggestions.length;
|
|
79
94
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
@@ -90,23 +105,29 @@ const SuggestionGroupPanel = ({ suggestionGroup, onRejectAll, onAcceptAll, curre
|
|
|
90
105
|
},
|
|
91
106
|
children: /*#__PURE__*/ jsxs(Row, {
|
|
92
107
|
align: "center",
|
|
93
|
-
gap: Spacing.SpacingS,
|
|
108
|
+
gap: isCompact ? Spacing.SpacingXs : Spacing.SpacingS,
|
|
94
109
|
justify: "space-evenly",
|
|
110
|
+
style: {
|
|
111
|
+
whiteSpace: 'nowrap'
|
|
112
|
+
},
|
|
95
113
|
children: [
|
|
96
114
|
onRejectAll && /*#__PURE__*/ jsx(RejectAllButton, {
|
|
97
115
|
suggestionGroup: suggestionGroup,
|
|
98
|
-
onClick: onRejectAll
|
|
116
|
+
onClick: onRejectAll,
|
|
117
|
+
compact: isCompact
|
|
99
118
|
}),
|
|
100
119
|
onAcceptAll && /*#__PURE__*/ jsx(AcceptAllButton, {
|
|
101
120
|
suggestionGroup: suggestionGroup,
|
|
102
|
-
onClick: onAcceptAll
|
|
121
|
+
onClick: onAcceptAll,
|
|
122
|
+
compact: isCompact
|
|
103
123
|
}),
|
|
104
124
|
/*#__PURE__*/ jsx(Divider, {}),
|
|
105
125
|
/*#__PURE__*/ jsx(SuggestionGroupNavigator, {
|
|
106
126
|
currentIndex: currentIndex,
|
|
107
127
|
total: placeholderCount,
|
|
108
128
|
onNavigateNext: onNavigateNext,
|
|
109
|
-
onNavigatePrevious: onNavigatePrevious
|
|
129
|
+
onNavigatePrevious: onNavigatePrevious,
|
|
130
|
+
compact: isCompact
|
|
110
131
|
})
|
|
111
132
|
]
|
|
112
133
|
})
|
|
@@ -34,11 +34,13 @@ const external_react_namespaceObject = require("react");
|
|
|
34
34
|
const external_FloatingCanvasPanel_index_cjs_namespaceObject = require("../../FloatingCanvasPanel/index.cjs");
|
|
35
35
|
const external_types_cjs_namespaceObject = require("../../../types.cjs");
|
|
36
36
|
const BaseNode_cjs_namespaceObject = require("../../BaseNode/BaseNode.cjs");
|
|
37
|
+
const BaseNodeConfigContext_cjs_namespaceObject = require("../../BaseNode/BaseNodeConfigContext.cjs");
|
|
37
38
|
const external_AgentFlow_constants_cjs_namespaceObject = require("../AgentFlow.constants.cjs");
|
|
38
39
|
const agent_flow_store_cjs_namespaceObject = require("../store/agent-flow-store.cjs");
|
|
39
40
|
const external_AgentNode_styles_cjs_namespaceObject = require("./AgentNode.styles.cjs");
|
|
40
41
|
const HOVER_DELAY_MS = 500;
|
|
41
42
|
const HOVER_HIDE_DELAY_MS = 300;
|
|
43
|
+
const alwaysShowNotches = ()=>true;
|
|
42
44
|
const AgentNodeComponent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)((props)=>{
|
|
43
45
|
const { id, data, selected = false, mode = 'design', hasMemory = false, hasContext = false, hasEscalation = false, hasTool = false, hasMcp = false, mcpEnabled = true, hasError = false, hasSuccess = false, hasRunning = false, onAddResource, onAddInstructions, translations, enableMemory, enableInstructions = false, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroupVersion, ...nodeProps } = props;
|
|
44
46
|
const { actOnSuggestion } = (0, agent_flow_store_cjs_namespaceObject.useAgentFlowStore)();
|
|
@@ -446,35 +448,50 @@ const AgentNodeComponent = /*#__PURE__*/ (0, external_react_namespaceObject.memo
|
|
|
446
448
|
translations,
|
|
447
449
|
isConversational
|
|
448
450
|
]);
|
|
451
|
+
const baseNodeConfig = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
452
|
+
executionStatusOverride: executionStatus,
|
|
453
|
+
suggestionType,
|
|
454
|
+
handleConfigurations,
|
|
455
|
+
toolbarConfig,
|
|
456
|
+
footerVariant,
|
|
457
|
+
iconComponent: agentIcon,
|
|
458
|
+
footerComponent: instructionsFooter,
|
|
459
|
+
subLabelComponent: subLabelWithHealthScore,
|
|
460
|
+
shouldShowAddButtonFn,
|
|
461
|
+
shouldShowButtonHandleNotchesFn: alwaysShowNotches
|
|
462
|
+
}), [
|
|
463
|
+
executionStatus,
|
|
464
|
+
suggestionType,
|
|
465
|
+
handleConfigurations,
|
|
466
|
+
toolbarConfig,
|
|
467
|
+
footerVariant,
|
|
468
|
+
agentIcon,
|
|
469
|
+
instructionsFooter,
|
|
470
|
+
subLabelWithHealthScore,
|
|
471
|
+
shouldShowAddButtonFn
|
|
472
|
+
]);
|
|
449
473
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
450
474
|
onMouseEnter: handleMouseEnter,
|
|
451
475
|
onMouseLeave: handleMouseLeave,
|
|
452
476
|
children: [
|
|
453
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
toolbarConfig: toolbarConfig,
|
|
472
|
-
footerVariant: footerVariant,
|
|
473
|
-
iconComponent: agentIcon,
|
|
474
|
-
footerComponent: instructionsFooter,
|
|
475
|
-
subLabelComponent: subLabelWithHealthScore,
|
|
476
|
-
shouldShowAddButtonFn: shouldShowAddButtonFn,
|
|
477
|
-
shouldShowButtonHandleNotchesFn: ()=>true
|
|
477
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BaseNodeConfigContext_cjs_namespaceObject.BaseNodeOverrideConfigProvider, {
|
|
478
|
+
value: baseNodeConfig,
|
|
479
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BaseNode_cjs_namespaceObject.BaseNode, {
|
|
480
|
+
...nodeProps,
|
|
481
|
+
id: id,
|
|
482
|
+
type: isConversational ? 'uipath.agent.conversational' : 'uipath.agent.autonomous',
|
|
483
|
+
data: {
|
|
484
|
+
...data,
|
|
485
|
+
display: {
|
|
486
|
+
label: name,
|
|
487
|
+
subLabel: isConversational ? translations.conversationalAgent : translations.autonomousAgent,
|
|
488
|
+
shape: 'rectangle',
|
|
489
|
+
background: 'var(--uix-canvas-background)',
|
|
490
|
+
iconBackground: 'var(--uix-canvas-background-secondary)'
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
selected: selected
|
|
494
|
+
})
|
|
478
495
|
}),
|
|
479
496
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_FloatingCanvasPanel_index_cjs_namespaceObject.FloatingCanvasPanel, {
|
|
480
497
|
open: showSettingsPreview,
|
|
@@ -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;AAKhF,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
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;AAKhF,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB,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,CAAC;IAC3B,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,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,KAAK,IAAI,CAAC;IAC1F,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;AAgjBD,eAAO,MAAM,gBAAgB,8CApDI,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,cAAc,6CAoD1B,CAAC;AAEvD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -6,11 +6,13 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
6
6
|
import { FloatingCanvasPanel } from "../../FloatingCanvasPanel/index.js";
|
|
7
7
|
import { DefaultSuggestionTranslations } from "../../../types.js";
|
|
8
8
|
import { BaseNode } from "../../BaseNode/BaseNode.js";
|
|
9
|
+
import { BaseNodeOverrideConfigProvider } from "../../BaseNode/BaseNodeConfigContext.js";
|
|
9
10
|
import { ResourceNodeType } from "../AgentFlow.constants.js";
|
|
10
11
|
import { useAgentFlowStore } from "../store/agent-flow-store.js";
|
|
11
12
|
import { AddInstructionsButton, HealthScoreBadge, InstructionsLabel, InstructionsLine, InstructionsPreview, SettingsPreviewContainer, SettingsPreviewHeader, SettingsPreviewSubtitle, SettingsPreviewTitle, SettingsPromptBox, SettingsRow, SettingsRowLabel, SettingsRowValue, SettingsSection, SettingsSectionLabel, SettingsSectionValue, SubLabelContainer } from "./AgentNode.styles.js";
|
|
12
13
|
const HOVER_DELAY_MS = 500;
|
|
13
14
|
const HOVER_HIDE_DELAY_MS = 300;
|
|
15
|
+
const alwaysShowNotches = ()=>true;
|
|
14
16
|
const AgentNodeComponent = /*#__PURE__*/ memo((props)=>{
|
|
15
17
|
const { id, data, selected = false, mode = 'design', hasMemory = false, hasContext = false, hasEscalation = false, hasTool = false, hasMcp = false, mcpEnabled = true, hasError = false, hasSuccess = false, hasRunning = false, onAddResource, onAddInstructions, translations, enableMemory, enableInstructions = false, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroupVersion, ...nodeProps } = props;
|
|
16
18
|
const { actOnSuggestion } = useAgentFlowStore();
|
|
@@ -418,35 +420,50 @@ const AgentNodeComponent = /*#__PURE__*/ memo((props)=>{
|
|
|
418
420
|
translations,
|
|
419
421
|
isConversational
|
|
420
422
|
]);
|
|
423
|
+
const baseNodeConfig = useMemo(()=>({
|
|
424
|
+
executionStatusOverride: executionStatus,
|
|
425
|
+
suggestionType,
|
|
426
|
+
handleConfigurations,
|
|
427
|
+
toolbarConfig,
|
|
428
|
+
footerVariant,
|
|
429
|
+
iconComponent: agentIcon,
|
|
430
|
+
footerComponent: instructionsFooter,
|
|
431
|
+
subLabelComponent: subLabelWithHealthScore,
|
|
432
|
+
shouldShowAddButtonFn,
|
|
433
|
+
shouldShowButtonHandleNotchesFn: alwaysShowNotches
|
|
434
|
+
}), [
|
|
435
|
+
executionStatus,
|
|
436
|
+
suggestionType,
|
|
437
|
+
handleConfigurations,
|
|
438
|
+
toolbarConfig,
|
|
439
|
+
footerVariant,
|
|
440
|
+
agentIcon,
|
|
441
|
+
instructionsFooter,
|
|
442
|
+
subLabelWithHealthScore,
|
|
443
|
+
shouldShowAddButtonFn
|
|
444
|
+
]);
|
|
421
445
|
return /*#__PURE__*/ jsxs("div", {
|
|
422
446
|
onMouseEnter: handleMouseEnter,
|
|
423
447
|
onMouseLeave: handleMouseLeave,
|
|
424
448
|
children: [
|
|
425
|
-
/*#__PURE__*/ jsx(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
toolbarConfig: toolbarConfig,
|
|
444
|
-
footerVariant: footerVariant,
|
|
445
|
-
iconComponent: agentIcon,
|
|
446
|
-
footerComponent: instructionsFooter,
|
|
447
|
-
subLabelComponent: subLabelWithHealthScore,
|
|
448
|
-
shouldShowAddButtonFn: shouldShowAddButtonFn,
|
|
449
|
-
shouldShowButtonHandleNotchesFn: ()=>true
|
|
449
|
+
/*#__PURE__*/ jsx(BaseNodeOverrideConfigProvider, {
|
|
450
|
+
value: baseNodeConfig,
|
|
451
|
+
children: /*#__PURE__*/ jsx(BaseNode, {
|
|
452
|
+
...nodeProps,
|
|
453
|
+
id: id,
|
|
454
|
+
type: isConversational ? 'uipath.agent.conversational' : 'uipath.agent.autonomous',
|
|
455
|
+
data: {
|
|
456
|
+
...data,
|
|
457
|
+
display: {
|
|
458
|
+
label: name,
|
|
459
|
+
subLabel: isConversational ? translations.conversationalAgent : translations.autonomousAgent,
|
|
460
|
+
shape: 'rectangle',
|
|
461
|
+
background: 'var(--uix-canvas-background)',
|
|
462
|
+
iconBackground: 'var(--uix-canvas-background-secondary)'
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
selected: selected
|
|
466
|
+
})
|
|
450
467
|
}),
|
|
451
468
|
/*#__PURE__*/ jsx(FloatingCanvasPanel, {
|
|
452
469
|
open: showSettingsPreview,
|
|
@@ -34,9 +34,11 @@ const components_index_cjs_namespaceObject = require("../../../../material/compo
|
|
|
34
34
|
const external_react_namespaceObject = require("react");
|
|
35
35
|
const external_types_cjs_namespaceObject = require("../../../types.cjs");
|
|
36
36
|
const BaseNode_cjs_namespaceObject = require("../../BaseNode/BaseNode.cjs");
|
|
37
|
+
const BaseNodeConfigContext_cjs_namespaceObject = require("../../BaseNode/BaseNodeConfigContext.cjs");
|
|
37
38
|
const ExecutionStatusIcon_cjs_namespaceObject = require("../../ExecutionStatusIcon/ExecutionStatusIcon.cjs");
|
|
38
39
|
const ToolResourceIcon_index_cjs_namespaceObject = require("../components/ToolResourceIcon/index.cjs");
|
|
39
40
|
const agent_flow_store_cjs_namespaceObject = require("../store/agent-flow-store.cjs");
|
|
41
|
+
const alwaysShowNotches = ()=>true;
|
|
40
42
|
const ResourceNode = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ data, selected, id, mode, hasError = false, hasSuccess = false, hasRunning = false, onEnable, onDisable, onAddBreakpoint, onRemoveBreakpoint, onAddGuardrail, onGoToSource, translations, suggestionTranslations, suggestionGroupVersion, ...nodeProps })=>{
|
|
41
43
|
const { nodes: _nodes, deleteNode, actOnSuggestion } = (0, agent_flow_store_cjs_namespaceObject.useAgentFlowStore)();
|
|
42
44
|
const edges = (0, agent_flow_store_cjs_namespaceObject.useEdges)();
|
|
@@ -431,38 +433,56 @@ const ResourceNode = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ d
|
|
|
431
433
|
return 'uipath.resource.tool';
|
|
432
434
|
}
|
|
433
435
|
};
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
suggestionType
|
|
456
|
-
|
|
457
|
-
handleConfigurations
|
|
458
|
-
toolbarConfig
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
436
|
+
const baseNodeConfig = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
437
|
+
labelTooltip: displayTooltips ? data.description : void 0,
|
|
438
|
+
labelBackgroundColor: 'var(--uix-canvas-background-secondary)',
|
|
439
|
+
disabled: isDisabled,
|
|
440
|
+
executionStatusOverride: executionStatus,
|
|
441
|
+
suggestionType,
|
|
442
|
+
iconComponent: resourceIcon,
|
|
443
|
+
handleConfigurations,
|
|
444
|
+
toolbarConfig,
|
|
445
|
+
adornments: {
|
|
446
|
+
topLeft: breakpointAdornment,
|
|
447
|
+
topRight: statusAdornment,
|
|
448
|
+
bottomLeft: suggestionAdornment,
|
|
449
|
+
bottomRight: guardrailsAdornment
|
|
450
|
+
},
|
|
451
|
+
shouldShowButtonHandleNotchesFn: alwaysShowNotches
|
|
452
|
+
}), [
|
|
453
|
+
displayTooltips,
|
|
454
|
+
data.description,
|
|
455
|
+
isDisabled,
|
|
456
|
+
executionStatus,
|
|
457
|
+
suggestionType,
|
|
458
|
+
resourceIcon,
|
|
459
|
+
handleConfigurations,
|
|
460
|
+
toolbarConfig,
|
|
461
|
+
breakpointAdornment,
|
|
462
|
+
statusAdornment,
|
|
463
|
+
suggestionAdornment,
|
|
464
|
+
guardrailsAdornment
|
|
465
|
+
]);
|
|
466
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BaseNodeConfigContext_cjs_namespaceObject.BaseNodeOverrideConfigProvider, {
|
|
467
|
+
value: baseNodeConfig,
|
|
468
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BaseNode_cjs_namespaceObject.BaseNode, {
|
|
469
|
+
...nodeProps,
|
|
470
|
+
type: getResourceNodeType(),
|
|
471
|
+
data: {
|
|
472
|
+
...data,
|
|
473
|
+
display: {
|
|
474
|
+
iconBackground: 'var(--uix-canvas-background-secondary)',
|
|
475
|
+
label: data.name,
|
|
476
|
+
subLabel: data.originalName,
|
|
477
|
+
shape: 'circle'
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
id: id,
|
|
481
|
+
selected: selected,
|
|
482
|
+
draggable: false,
|
|
483
|
+
selectable: true,
|
|
484
|
+
deletable: !isSuggestion
|
|
485
|
+
})
|
|
466
486
|
});
|
|
467
487
|
});
|
|
468
488
|
exports.ResourceNode = __webpack_exports__.ResourceNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceNode.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/AgentCanvas/nodes/ResourceNode.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,0CAA0C,CAAC;AAGpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAE9B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceNode.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/AgentCanvas/nodes/ResourceNode.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,0CAA0C,CAAC;AAGpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAE9B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAexB,UAAU,iBAAkB,SAAQ,SAAS,CAAC,qBAAqB,CAAC;IAClE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC7E,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC9E,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACpF,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACvF,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACnF,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACjF,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACrF,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACvF,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAEhD,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,YAAY,2QAmBpB,iBAAiB,6CAmbrB,CAAC"}
|