@uipath/apollo-react 3.53.0 → 3.54.0-pr354.17cbb75
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/AddNodePanel.cjs +21 -8
- package/dist/canvas/components/AddNodePanel/AddNodePanel.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodePanel.js +11 -8
- package/dist/canvas/components/BaseNode/BaseNode.styles.cjs +4 -52
- package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.styles.js +2 -50
- package/dist/canvas/components/GroupNode/GroupNode.cjs +147 -75
- package/dist/canvas/components/GroupNode/GroupNode.d.ts.map +1 -1
- package/dist/canvas/components/GroupNode/GroupNode.js +147 -75
- package/dist/canvas/components/GroupNode/GroupNode.stories.cjs +610 -13
- package/dist/canvas/components/GroupNode/GroupNode.stories.d.ts +5 -0
- package/dist/canvas/components/GroupNode/GroupNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/GroupNode/GroupNode.stories.js +589 -7
- package/dist/canvas/components/GroupNode/GroupNode.styles.cjs +6 -2
- package/dist/canvas/components/GroupNode/GroupNode.styles.d.ts +1 -0
- package/dist/canvas/components/GroupNode/GroupNode.styles.d.ts.map +1 -1
- package/dist/canvas/components/GroupNode/GroupNode.styles.js +6 -2
- package/dist/canvas/components/GroupNode/GroupNode.types.d.ts +1 -0
- package/dist/canvas/components/GroupNode/GroupNode.types.d.ts.map +1 -1
- package/dist/canvas/components/GroupNode/GroupNodeConfigContext.cjs +45 -0
- package/dist/canvas/components/GroupNode/GroupNodeConfigContext.d.ts +11 -0
- package/dist/canvas/components/GroupNode/GroupNodeConfigContext.d.ts.map +1 -0
- package/dist/canvas/components/GroupNode/GroupNodeConfigContext.js +8 -0
- package/dist/canvas/components/GroupNode/index.cjs +9 -2
- package/dist/canvas/components/GroupNode/index.d.ts +2 -0
- package/dist/canvas/components/GroupNode/index.d.ts.map +1 -1
- package/dist/canvas/components/GroupNode/index.js +2 -1
- package/dist/canvas/components/Toolbox/ListView.cjs +47 -34
- package/dist/canvas/components/Toolbox/ListView.d.ts +7 -2
- package/dist/canvas/components/Toolbox/ListView.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/ListView.js +43 -33
- package/dist/canvas/components/Toolbox/ListView.styles.cjs +7 -1
- package/dist/canvas/components/Toolbox/ListView.styles.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/ListView.styles.js +7 -1
- package/dist/canvas/components/Toolbox/SearchBox.cjs +12 -4
- package/dist/canvas/components/Toolbox/SearchBox.d.ts +3 -0
- package/dist/canvas/components/Toolbox/SearchBox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/SearchBox.js +12 -4
- package/dist/canvas/components/Toolbox/Toolbox.cjs +115 -2
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.js +116 -3
- package/dist/canvas/styles/execution-status.cjs +88 -0
- package/dist/canvas/styles/execution-status.d.ts +8 -0
- package/dist/canvas/styles/execution-status.d.ts.map +1 -0
- package/dist/canvas/styles/execution-status.js +51 -0
- package/package.json +2 -2
|
@@ -30,6 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const index_cjs_namespaceObject = require("../../hooks/index.cjs");
|
|
31
31
|
const external_layouts_index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_react_window_namespaceObject = require("react-window");
|
|
33
34
|
const external_Header_cjs_namespaceObject = require("./Header.cjs");
|
|
34
35
|
const external_ListView_cjs_namespaceObject = require("./ListView.cjs");
|
|
35
36
|
const external_SearchBox_cjs_namespaceObject = require("./SearchBox.cjs");
|
|
@@ -71,13 +72,48 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
71
72
|
const [isTransitioning, setIsTransitioning] = (0, external_react_namespaceObject.useState)(false);
|
|
72
73
|
const [animationDirection, setAnimationDirection] = (0, external_react_namespaceObject.useState)('forward');
|
|
73
74
|
const navigationStack = (0, index_cjs_namespaceObject.useNavigationStack)();
|
|
75
|
+
const [activeIndex, setActiveIndex] = (0, external_react_namespaceObject.useState)(-1);
|
|
74
76
|
const containerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
75
77
|
const transitionTimeoutRef = (0, external_react_namespaceObject.useRef)(void 0);
|
|
76
78
|
const searchIdRef = (0, external_react_namespaceObject.useRef)(0);
|
|
77
79
|
const initialItemsRef = (0, external_react_namespaceObject.useRef)(initialItems);
|
|
80
|
+
const listRef = (0, external_react_window_namespaceObject.useListRef)(null);
|
|
81
|
+
const searchInputRef = (0, external_react_namespaceObject.useRef)(null);
|
|
78
82
|
const isSearching = (0, external_react_namespaceObject.useMemo)(()=>search.length > 0, [
|
|
79
83
|
search
|
|
80
84
|
]);
|
|
85
|
+
const displayedItems = (0, external_react_namespaceObject.useMemo)(()=>isSearching && !isSearchingInitialItems ? searchedItems : items, [
|
|
86
|
+
isSearching,
|
|
87
|
+
isSearchingInitialItems,
|
|
88
|
+
searchedItems,
|
|
89
|
+
items
|
|
90
|
+
]);
|
|
91
|
+
const renderedItems = (0, external_react_namespaceObject.useMemo)(()=>(0, external_ListView_cjs_namespaceObject.buildRenderedItems)(displayedItems, !isSearching), [
|
|
92
|
+
displayedItems,
|
|
93
|
+
isSearching
|
|
94
|
+
]);
|
|
95
|
+
const getNextSelectableIndex = (0, external_react_namespaceObject.useCallback)((currentIndex, direction)=>{
|
|
96
|
+
let next = currentIndex + direction;
|
|
97
|
+
while(next >= 0 && next < renderedItems.length){
|
|
98
|
+
if (renderedItems[next]?.type === 'item') return next;
|
|
99
|
+
next += direction;
|
|
100
|
+
}
|
|
101
|
+
return -1;
|
|
102
|
+
}, [
|
|
103
|
+
renderedItems
|
|
104
|
+
]);
|
|
105
|
+
const getFirstSelectableIndex = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
106
|
+
for(let i = 0; i < renderedItems.length; i++)if (renderedItems[i]?.type === 'item') return i;
|
|
107
|
+
return -1;
|
|
108
|
+
}, [
|
|
109
|
+
renderedItems
|
|
110
|
+
]);
|
|
111
|
+
const getLastSelectableIndex = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
112
|
+
for(let i = renderedItems.length - 1; i >= 0; i--)if (renderedItems[i]?.type === 'item') return i;
|
|
113
|
+
return -1;
|
|
114
|
+
}, [
|
|
115
|
+
renderedItems
|
|
116
|
+
]);
|
|
81
117
|
const startTransition = (0, external_react_namespaceObject.useCallback)((direction)=>{
|
|
82
118
|
if (transitionTimeoutRef.current) clearTimeout(transitionTimeoutRef.current);
|
|
83
119
|
setIsTransitioning(true);
|
|
@@ -86,11 +122,21 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
86
122
|
setIsTransitioning(false);
|
|
87
123
|
}, TRANSITION_DURATION);
|
|
88
124
|
}, []);
|
|
125
|
+
const navigateToIndex = (0, external_react_namespaceObject.useCallback)((index)=>{
|
|
126
|
+
setActiveIndex(index);
|
|
127
|
+
if (index >= 0) listRef.current?.scrollToRow({
|
|
128
|
+
index,
|
|
129
|
+
align: 'auto'
|
|
130
|
+
});
|
|
131
|
+
}, [
|
|
132
|
+
listRef
|
|
133
|
+
]);
|
|
89
134
|
const clearSearch = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
90
135
|
setSearch('');
|
|
91
136
|
setSearchedItems([]);
|
|
92
137
|
setSearchLoading(false);
|
|
93
138
|
setIsSearchingInitialItems(true);
|
|
139
|
+
setActiveIndex(-1);
|
|
94
140
|
}, []);
|
|
95
141
|
const handleSearch = (0, external_react_namespaceObject.useCallback)(async (query)=>{
|
|
96
142
|
if (!query.trim()) {
|
|
@@ -101,6 +147,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
101
147
|
return;
|
|
102
148
|
}
|
|
103
149
|
setSearch(query);
|
|
150
|
+
setActiveIndex(-1);
|
|
104
151
|
searchIdRef.current += 1;
|
|
105
152
|
const currentRequestId = searchIdRef.current;
|
|
106
153
|
setSearchLoading(true);
|
|
@@ -121,6 +168,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
121
168
|
]);
|
|
122
169
|
const handleBackTransition = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
123
170
|
startTransition('back');
|
|
171
|
+
setActiveIndex(-1);
|
|
124
172
|
const previousState = navigationStack.pop();
|
|
125
173
|
if (previousState) {
|
|
126
174
|
setItems(previousState.data.items);
|
|
@@ -149,6 +197,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
149
197
|
setItems(nestedItems);
|
|
150
198
|
setCurrentParentItem(item);
|
|
151
199
|
clearSearch();
|
|
200
|
+
setActiveIndex(-1);
|
|
152
201
|
startTransition('forward');
|
|
153
202
|
setChildrenLoading(false);
|
|
154
203
|
}, [
|
|
@@ -206,6 +255,65 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
206
255
|
}, [
|
|
207
256
|
items
|
|
208
257
|
]);
|
|
258
|
+
const activeDescendantId = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
259
|
+
if (activeIndex < 0) return;
|
|
260
|
+
const renderItem = renderedItems[activeIndex];
|
|
261
|
+
if (renderItem?.type === 'item') return `toolbox-item-${renderItem.item.id}`;
|
|
262
|
+
}, [
|
|
263
|
+
activeIndex,
|
|
264
|
+
renderedItems
|
|
265
|
+
]);
|
|
266
|
+
const handleNavigationKeyDown = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
267
|
+
if (isTransitioning) return;
|
|
268
|
+
switch(e.key){
|
|
269
|
+
case 'ArrowDown':
|
|
270
|
+
e.preventDefault();
|
|
271
|
+
if (-1 === activeIndex) {
|
|
272
|
+
const firstIndex = getFirstSelectableIndex();
|
|
273
|
+
if (-1 !== firstIndex) navigateToIndex(firstIndex);
|
|
274
|
+
} else {
|
|
275
|
+
const nextIndex = getNextSelectableIndex(activeIndex, 1);
|
|
276
|
+
if (-1 !== nextIndex) navigateToIndex(nextIndex);
|
|
277
|
+
}
|
|
278
|
+
break;
|
|
279
|
+
case 'ArrowUp':
|
|
280
|
+
e.preventDefault();
|
|
281
|
+
activeIndex <= 0 || -1 === getNextSelectableIndex(activeIndex, -1) ? navigateToIndex(-1) : navigateToIndex(getNextSelectableIndex(activeIndex, -1));
|
|
282
|
+
break;
|
|
283
|
+
case 'Enter':
|
|
284
|
+
if (activeIndex >= 0) {
|
|
285
|
+
const renderItem = renderedItems[activeIndex];
|
|
286
|
+
if (renderItem?.type === 'item') {
|
|
287
|
+
e.preventDefault();
|
|
288
|
+
handleItemSelect(renderItem.item);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
case 'Home':
|
|
293
|
+
{
|
|
294
|
+
e.preventDefault();
|
|
295
|
+
const firstIndex = getFirstSelectableIndex();
|
|
296
|
+
if (-1 !== firstIndex) navigateToIndex(firstIndex);
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
case 'End':
|
|
300
|
+
{
|
|
301
|
+
e.preventDefault();
|
|
302
|
+
const lastIndex = getLastSelectableIndex();
|
|
303
|
+
if (-1 !== lastIndex) navigateToIndex(lastIndex);
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}, [
|
|
308
|
+
isTransitioning,
|
|
309
|
+
activeIndex,
|
|
310
|
+
renderedItems,
|
|
311
|
+
navigateToIndex,
|
|
312
|
+
handleItemSelect,
|
|
313
|
+
getNextSelectableIndex,
|
|
314
|
+
getFirstSelectableIndex,
|
|
315
|
+
getLastSelectableIndex
|
|
316
|
+
]);
|
|
209
317
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
210
318
|
const handleKeyDown = (e)=>{
|
|
211
319
|
if ('Escape' === e.key) if (isSearching) {
|
|
@@ -251,7 +359,10 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
251
359
|
value: search,
|
|
252
360
|
onChange: handleSearch,
|
|
253
361
|
clear: clearSearch,
|
|
254
|
-
placeholder: "Search"
|
|
362
|
+
placeholder: "Search",
|
|
363
|
+
inputRef: searchInputRef,
|
|
364
|
+
onNavigationKeyDown: handleNavigationKeyDown,
|
|
365
|
+
activeDescendantId: activeDescendantId
|
|
255
366
|
}),
|
|
256
367
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbox_styles_cjs_namespaceObject.AnimatedContainer, {
|
|
257
368
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbox_styles_cjs_namespaceObject.AnimatedContent, {
|
|
@@ -259,7 +370,9 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
259
370
|
direction: animationDirection,
|
|
260
371
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ListView_cjs_namespaceObject.ListView, {
|
|
261
372
|
isLoading: childrenLoading || searchLoading || loading,
|
|
262
|
-
items:
|
|
373
|
+
items: displayedItems,
|
|
374
|
+
activeIndex: activeIndex,
|
|
375
|
+
listRef: listRef,
|
|
263
376
|
emptyStateMessage: isSearching ? 'No matching nodes found' : 'No nodes found',
|
|
264
377
|
enableSections: !isSearching,
|
|
265
378
|
onItemClick: handleItemSelect,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/Toolbox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toolbox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/Toolbox.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,QAAQ,EAAY,MAAM,YAAY,CAAC;AAuCzE,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,GAAG,IAAI,CAC1C,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5E,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACpC;AAoBD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,OAAO,EACP,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,GACR,EAAE,YAAY,CAAC,CAAC,CAAC,2CAwYjB"}
|
|
@@ -2,8 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useNavigationStack } from "../../hooks/index.js";
|
|
3
3
|
import { Column } from "../../layouts/index.js";
|
|
4
4
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { useListRef } from "react-window";
|
|
5
6
|
import { Header } from "./Header.js";
|
|
6
|
-
import { ListView } from "./ListView.js";
|
|
7
|
+
import { ListView, buildRenderedItems } from "./ListView.js";
|
|
7
8
|
import { SearchBox } from "./SearchBox.js";
|
|
8
9
|
import { AnimatedContainer, AnimatedContent } from "./Toolbox.styles.js";
|
|
9
10
|
const TRANSITION_DURATION = 150;
|
|
@@ -43,13 +44,48 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
43
44
|
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
44
45
|
const [animationDirection, setAnimationDirection] = useState('forward');
|
|
45
46
|
const navigationStack = useNavigationStack();
|
|
47
|
+
const [activeIndex, setActiveIndex] = useState(-1);
|
|
46
48
|
const containerRef = useRef(null);
|
|
47
49
|
const transitionTimeoutRef = useRef(void 0);
|
|
48
50
|
const searchIdRef = useRef(0);
|
|
49
51
|
const initialItemsRef = useRef(initialItems);
|
|
52
|
+
const listRef = useListRef(null);
|
|
53
|
+
const searchInputRef = useRef(null);
|
|
50
54
|
const isSearching = useMemo(()=>search.length > 0, [
|
|
51
55
|
search
|
|
52
56
|
]);
|
|
57
|
+
const displayedItems = useMemo(()=>isSearching && !isSearchingInitialItems ? searchedItems : items, [
|
|
58
|
+
isSearching,
|
|
59
|
+
isSearchingInitialItems,
|
|
60
|
+
searchedItems,
|
|
61
|
+
items
|
|
62
|
+
]);
|
|
63
|
+
const renderedItems = useMemo(()=>buildRenderedItems(displayedItems, !isSearching), [
|
|
64
|
+
displayedItems,
|
|
65
|
+
isSearching
|
|
66
|
+
]);
|
|
67
|
+
const getNextSelectableIndex = useCallback((currentIndex, direction)=>{
|
|
68
|
+
let next = currentIndex + direction;
|
|
69
|
+
while(next >= 0 && next < renderedItems.length){
|
|
70
|
+
if (renderedItems[next]?.type === 'item') return next;
|
|
71
|
+
next += direction;
|
|
72
|
+
}
|
|
73
|
+
return -1;
|
|
74
|
+
}, [
|
|
75
|
+
renderedItems
|
|
76
|
+
]);
|
|
77
|
+
const getFirstSelectableIndex = useCallback(()=>{
|
|
78
|
+
for(let i = 0; i < renderedItems.length; i++)if (renderedItems[i]?.type === 'item') return i;
|
|
79
|
+
return -1;
|
|
80
|
+
}, [
|
|
81
|
+
renderedItems
|
|
82
|
+
]);
|
|
83
|
+
const getLastSelectableIndex = useCallback(()=>{
|
|
84
|
+
for(let i = renderedItems.length - 1; i >= 0; i--)if (renderedItems[i]?.type === 'item') return i;
|
|
85
|
+
return -1;
|
|
86
|
+
}, [
|
|
87
|
+
renderedItems
|
|
88
|
+
]);
|
|
53
89
|
const startTransition = useCallback((direction)=>{
|
|
54
90
|
if (transitionTimeoutRef.current) clearTimeout(transitionTimeoutRef.current);
|
|
55
91
|
setIsTransitioning(true);
|
|
@@ -58,11 +94,21 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
58
94
|
setIsTransitioning(false);
|
|
59
95
|
}, TRANSITION_DURATION);
|
|
60
96
|
}, []);
|
|
97
|
+
const navigateToIndex = useCallback((index)=>{
|
|
98
|
+
setActiveIndex(index);
|
|
99
|
+
if (index >= 0) listRef.current?.scrollToRow({
|
|
100
|
+
index,
|
|
101
|
+
align: 'auto'
|
|
102
|
+
});
|
|
103
|
+
}, [
|
|
104
|
+
listRef
|
|
105
|
+
]);
|
|
61
106
|
const clearSearch = useCallback(()=>{
|
|
62
107
|
setSearch('');
|
|
63
108
|
setSearchedItems([]);
|
|
64
109
|
setSearchLoading(false);
|
|
65
110
|
setIsSearchingInitialItems(true);
|
|
111
|
+
setActiveIndex(-1);
|
|
66
112
|
}, []);
|
|
67
113
|
const handleSearch = useCallback(async (query)=>{
|
|
68
114
|
if (!query.trim()) {
|
|
@@ -73,6 +119,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
73
119
|
return;
|
|
74
120
|
}
|
|
75
121
|
setSearch(query);
|
|
122
|
+
setActiveIndex(-1);
|
|
76
123
|
searchIdRef.current += 1;
|
|
77
124
|
const currentRequestId = searchIdRef.current;
|
|
78
125
|
setSearchLoading(true);
|
|
@@ -93,6 +140,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
93
140
|
]);
|
|
94
141
|
const handleBackTransition = useCallback(()=>{
|
|
95
142
|
startTransition('back');
|
|
143
|
+
setActiveIndex(-1);
|
|
96
144
|
const previousState = navigationStack.pop();
|
|
97
145
|
if (previousState) {
|
|
98
146
|
setItems(previousState.data.items);
|
|
@@ -121,6 +169,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
121
169
|
setItems(nestedItems);
|
|
122
170
|
setCurrentParentItem(item);
|
|
123
171
|
clearSearch();
|
|
172
|
+
setActiveIndex(-1);
|
|
124
173
|
startTransition('forward');
|
|
125
174
|
setChildrenLoading(false);
|
|
126
175
|
}, [
|
|
@@ -178,6 +227,65 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
178
227
|
}, [
|
|
179
228
|
items
|
|
180
229
|
]);
|
|
230
|
+
const activeDescendantId = useMemo(()=>{
|
|
231
|
+
if (activeIndex < 0) return;
|
|
232
|
+
const renderItem = renderedItems[activeIndex];
|
|
233
|
+
if (renderItem?.type === 'item') return `toolbox-item-${renderItem.item.id}`;
|
|
234
|
+
}, [
|
|
235
|
+
activeIndex,
|
|
236
|
+
renderedItems
|
|
237
|
+
]);
|
|
238
|
+
const handleNavigationKeyDown = useCallback((e)=>{
|
|
239
|
+
if (isTransitioning) return;
|
|
240
|
+
switch(e.key){
|
|
241
|
+
case 'ArrowDown':
|
|
242
|
+
e.preventDefault();
|
|
243
|
+
if (-1 === activeIndex) {
|
|
244
|
+
const firstIndex = getFirstSelectableIndex();
|
|
245
|
+
if (-1 !== firstIndex) navigateToIndex(firstIndex);
|
|
246
|
+
} else {
|
|
247
|
+
const nextIndex = getNextSelectableIndex(activeIndex, 1);
|
|
248
|
+
if (-1 !== nextIndex) navigateToIndex(nextIndex);
|
|
249
|
+
}
|
|
250
|
+
break;
|
|
251
|
+
case 'ArrowUp':
|
|
252
|
+
e.preventDefault();
|
|
253
|
+
activeIndex <= 0 || -1 === getNextSelectableIndex(activeIndex, -1) ? navigateToIndex(-1) : navigateToIndex(getNextSelectableIndex(activeIndex, -1));
|
|
254
|
+
break;
|
|
255
|
+
case 'Enter':
|
|
256
|
+
if (activeIndex >= 0) {
|
|
257
|
+
const renderItem = renderedItems[activeIndex];
|
|
258
|
+
if (renderItem?.type === 'item') {
|
|
259
|
+
e.preventDefault();
|
|
260
|
+
handleItemSelect(renderItem.item);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
264
|
+
case 'Home':
|
|
265
|
+
{
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
const firstIndex = getFirstSelectableIndex();
|
|
268
|
+
if (-1 !== firstIndex) navigateToIndex(firstIndex);
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
case 'End':
|
|
272
|
+
{
|
|
273
|
+
e.preventDefault();
|
|
274
|
+
const lastIndex = getLastSelectableIndex();
|
|
275
|
+
if (-1 !== lastIndex) navigateToIndex(lastIndex);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}, [
|
|
280
|
+
isTransitioning,
|
|
281
|
+
activeIndex,
|
|
282
|
+
renderedItems,
|
|
283
|
+
navigateToIndex,
|
|
284
|
+
handleItemSelect,
|
|
285
|
+
getNextSelectableIndex,
|
|
286
|
+
getFirstSelectableIndex,
|
|
287
|
+
getLastSelectableIndex
|
|
288
|
+
]);
|
|
181
289
|
useEffect(()=>{
|
|
182
290
|
const handleKeyDown = (e)=>{
|
|
183
291
|
if ('Escape' === e.key) if (isSearching) {
|
|
@@ -223,7 +331,10 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
223
331
|
value: search,
|
|
224
332
|
onChange: handleSearch,
|
|
225
333
|
clear: clearSearch,
|
|
226
|
-
placeholder: "Search"
|
|
334
|
+
placeholder: "Search",
|
|
335
|
+
inputRef: searchInputRef,
|
|
336
|
+
onNavigationKeyDown: handleNavigationKeyDown,
|
|
337
|
+
activeDescendantId: activeDescendantId
|
|
227
338
|
}),
|
|
228
339
|
/*#__PURE__*/ jsx(AnimatedContainer, {
|
|
229
340
|
children: /*#__PURE__*/ jsx(AnimatedContent, {
|
|
@@ -231,7 +342,9 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
231
342
|
direction: animationDirection,
|
|
232
343
|
children: /*#__PURE__*/ jsx(ListView, {
|
|
233
344
|
isLoading: childrenLoading || searchLoading || loading,
|
|
234
|
-
items:
|
|
345
|
+
items: displayedItems,
|
|
346
|
+
activeIndex: activeIndex,
|
|
347
|
+
listRef: listRef,
|
|
235
348
|
emptyStateMessage: isSearching ? 'No matching nodes found' : 'No nodes found',
|
|
236
349
|
enableSections: !isSearching,
|
|
237
350
|
onItemClick: handleItemSelect,
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getExecutionStatusBorder: ()=>getExecutionStatusBorder,
|
|
28
|
+
pulseAnimation: ()=>pulseAnimation
|
|
29
|
+
});
|
|
30
|
+
const react_namespaceObject = require("@emotion/react");
|
|
31
|
+
const pulseAnimation = (cssVar)=>(0, react_namespaceObject.keyframes)`
|
|
32
|
+
0% {
|
|
33
|
+
box-shadow: 0 0 0 0 color-mix(in srgb, var(${cssVar}) 20%, transparent);
|
|
34
|
+
}
|
|
35
|
+
70% {
|
|
36
|
+
box-shadow: 0 0 0 10px color-mix(in srgb, var(${cssVar}) 0%, transparent);
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
box-shadow: 0 0 0 0 color-mix(in srgb, var(${cssVar}) 0%, transparent);
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
const getExecutionStatusBorder = (executionStatus)=>{
|
|
43
|
+
switch(executionStatus){
|
|
44
|
+
case 'NotExecuted':
|
|
45
|
+
case 'INFO':
|
|
46
|
+
return (0, react_namespaceObject.css)`
|
|
47
|
+
border-color: var(--uix-canvas-border-de-emp);
|
|
48
|
+
`;
|
|
49
|
+
case 'InProgress':
|
|
50
|
+
return (0, react_namespaceObject.css)`
|
|
51
|
+
border-color: var(--uix-canvas-info-icon);
|
|
52
|
+
animation: ${pulseAnimation('--uix-canvas-info-icon')} 2s infinite;
|
|
53
|
+
`;
|
|
54
|
+
case 'Completed':
|
|
55
|
+
return (0, react_namespaceObject.css)`
|
|
56
|
+
border-color: var(--uix-canvas-success-icon);
|
|
57
|
+
`;
|
|
58
|
+
case 'Paused':
|
|
59
|
+
case 'WARNING':
|
|
60
|
+
return (0, react_namespaceObject.css)`
|
|
61
|
+
border-color: var(--uix-canvas-warning-icon);
|
|
62
|
+
animation: ${pulseAnimation('--uix-canvas-warning-icon')} 2s infinite;
|
|
63
|
+
`;
|
|
64
|
+
case 'Cancelled':
|
|
65
|
+
case 'Failed':
|
|
66
|
+
case 'Terminated':
|
|
67
|
+
case 'ERROR':
|
|
68
|
+
case 'CRITICAL':
|
|
69
|
+
return (0, react_namespaceObject.css)`
|
|
70
|
+
border-color: var(--uix-canvas-error-icon);
|
|
71
|
+
background: var(--uix-canvas-error-background);
|
|
72
|
+
animation: ${pulseAnimation('--uix-canvas-error-icon')} 2s infinite;
|
|
73
|
+
`;
|
|
74
|
+
default:
|
|
75
|
+
return (0, react_namespaceObject.css)`
|
|
76
|
+
border-color: var(--uix-canvas-border-de-emp);
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.getExecutionStatusBorder = __webpack_exports__.getExecutionStatusBorder;
|
|
81
|
+
exports.pulseAnimation = __webpack_exports__.pulseAnimation;
|
|
82
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
83
|
+
"getExecutionStatusBorder",
|
|
84
|
+
"pulseAnimation"
|
|
85
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
86
|
+
Object.defineProperty(exports, '__esModule', {
|
|
87
|
+
value: true
|
|
88
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const pulseAnimation: (cssVar: string) => {
|
|
2
|
+
name: string;
|
|
3
|
+
styles: string;
|
|
4
|
+
anim: 1;
|
|
5
|
+
toString: () => string;
|
|
6
|
+
} & string;
|
|
7
|
+
export declare const getExecutionStatusBorder: (executionStatus?: string) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
//# sourceMappingURL=execution-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-status.d.ts","sourceRoot":"","sources":["../../../src/canvas/styles/execution-status.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM;;;;;UAU5C,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,kBAAkB,MAAM,8CAwChE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { css, keyframes } from "@emotion/react";
|
|
2
|
+
const pulseAnimation = (cssVar)=>keyframes`
|
|
3
|
+
0% {
|
|
4
|
+
box-shadow: 0 0 0 0 color-mix(in srgb, var(${cssVar}) 20%, transparent);
|
|
5
|
+
}
|
|
6
|
+
70% {
|
|
7
|
+
box-shadow: 0 0 0 10px color-mix(in srgb, var(${cssVar}) 0%, transparent);
|
|
8
|
+
}
|
|
9
|
+
100% {
|
|
10
|
+
box-shadow: 0 0 0 0 color-mix(in srgb, var(${cssVar}) 0%, transparent);
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
const getExecutionStatusBorder = (executionStatus)=>{
|
|
14
|
+
switch(executionStatus){
|
|
15
|
+
case 'NotExecuted':
|
|
16
|
+
case 'INFO':
|
|
17
|
+
return css`
|
|
18
|
+
border-color: var(--uix-canvas-border-de-emp);
|
|
19
|
+
`;
|
|
20
|
+
case 'InProgress':
|
|
21
|
+
return css`
|
|
22
|
+
border-color: var(--uix-canvas-info-icon);
|
|
23
|
+
animation: ${pulseAnimation('--uix-canvas-info-icon')} 2s infinite;
|
|
24
|
+
`;
|
|
25
|
+
case 'Completed':
|
|
26
|
+
return css`
|
|
27
|
+
border-color: var(--uix-canvas-success-icon);
|
|
28
|
+
`;
|
|
29
|
+
case 'Paused':
|
|
30
|
+
case 'WARNING':
|
|
31
|
+
return css`
|
|
32
|
+
border-color: var(--uix-canvas-warning-icon);
|
|
33
|
+
animation: ${pulseAnimation('--uix-canvas-warning-icon')} 2s infinite;
|
|
34
|
+
`;
|
|
35
|
+
case 'Cancelled':
|
|
36
|
+
case 'Failed':
|
|
37
|
+
case 'Terminated':
|
|
38
|
+
case 'ERROR':
|
|
39
|
+
case 'CRITICAL':
|
|
40
|
+
return css`
|
|
41
|
+
border-color: var(--uix-canvas-error-icon);
|
|
42
|
+
background: var(--uix-canvas-error-background);
|
|
43
|
+
animation: ${pulseAnimation('--uix-canvas-error-icon')} 2s infinite;
|
|
44
|
+
`;
|
|
45
|
+
default:
|
|
46
|
+
return css`
|
|
47
|
+
border-color: var(--uix-canvas-border-de-emp);
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export { getExecutionStatusBorder, pulseAnimation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.54.0-pr354.17cbb75",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
"zod": "^4.3.5",
|
|
202
202
|
"zustand": "^5.0.9",
|
|
203
203
|
"@uipath/apollo-core": "5.7.1",
|
|
204
|
-
"@uipath/apollo-wind": "0.
|
|
204
|
+
"@uipath/apollo-wind": "0.15.0"
|
|
205
205
|
},
|
|
206
206
|
"devDependencies": {
|
|
207
207
|
"@lingui/cli": "^5.6.1",
|