@uipath/apollo-react 6.60.0 → 6.62.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/Toolbox/Toolbox.cjs +26 -1
- package/dist/canvas/components/Toolbox/Toolbox.d.ts +2 -1
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.js +26 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input-actions.cjs +5 -5
- package/dist/material/components/ap-chat/components/input/chat-input-actions.d.ts +2 -1
- package/dist/material/components/ap-chat/components/input/chat-input-actions.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input-actions.js +5 -5
- package/dist/material/components/ap-chat/components/input/chat-input.cjs +13 -8
- package/dist/material/components/ap-chat/components/input/chat-input.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input.js +13 -8
- package/dist/material/components/ap-chat/service/ChatModel.d.ts +1 -0
- package/dist/material/components/ap-chat/service/ChatModel.d.ts.map +1 -1
- package/dist/material/stories/chat-story-support.cjs +14 -2
- package/dist/material/stories/chat-story-support.d.ts.map +1 -1
- package/dist/material/stories/chat-story-support.js +14 -2
- package/package.json +3 -3
|
@@ -86,7 +86,7 @@ function searchLeafItems(items, query) {
|
|
|
86
86
|
}
|
|
87
87
|
return results;
|
|
88
88
|
}
|
|
89
|
-
function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth = false, fullHeight = false, quickActions, renderEmptyState, searchPlaceholder: searchPlaceholderProp }) {
|
|
89
|
+
function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth = false, fullHeight = false, quickActions, renderEmptyState, searchPlaceholder: searchPlaceholderProp, initialCategoryId }) {
|
|
90
90
|
const { _ } = (0, external_i18n_index_cjs_namespaceObject.useSafeLingui)();
|
|
91
91
|
const searchPlaceholder = searchPlaceholderProp ?? _({
|
|
92
92
|
id: 'toolbox.search',
|
|
@@ -116,6 +116,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
116
116
|
const searchInputRef = (0, external_react_namespaceObject.useRef)(null);
|
|
117
117
|
const clearButtonRef = (0, external_react_namespaceObject.useRef)(null);
|
|
118
118
|
const lastScrollTopRef = (0, external_react_namespaceObject.useRef)(0);
|
|
119
|
+
const initialCategoryAppliedRef = (0, external_react_namespaceObject.useRef)(false);
|
|
119
120
|
const handleListScroll = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
120
121
|
lastScrollTopRef.current = e.currentTarget.scrollTop;
|
|
121
122
|
}, []);
|
|
@@ -228,6 +229,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
228
229
|
]);
|
|
229
230
|
const handleItemSelect = (0, external_react_namespaceObject.useCallback)(async (item, index)=>{
|
|
230
231
|
if (!item.children) return void onItemSelect(item);
|
|
232
|
+
initialCategoryAppliedRef.current = true;
|
|
231
233
|
setAwaitingChildren(true);
|
|
232
234
|
const nestedItems = 'function' == typeof item.children ? await item.children(item.id, item.name) : item.children;
|
|
233
235
|
const savedIndex = isSearching ? SEARCH_BAR_INDEX : index ?? activeIndex;
|
|
@@ -309,6 +311,29 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
309
311
|
navigationStack,
|
|
310
312
|
currentParentItem
|
|
311
313
|
]);
|
|
314
|
+
const pushNavigation = navigationStack.push;
|
|
315
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
316
|
+
if (!initialCategoryId || initialCategoryAppliedRef.current) return;
|
|
317
|
+
const category = findItemById(initialItems, initialCategoryId);
|
|
318
|
+
if (!category?.children || 'function' == typeof category.children) return;
|
|
319
|
+
initialCategoryAppliedRef.current = true;
|
|
320
|
+
pushNavigation({
|
|
321
|
+
title,
|
|
322
|
+
data: {
|
|
323
|
+
items: initialItems,
|
|
324
|
+
parentItem: null,
|
|
325
|
+
activeIndex: SEARCH_BAR_INDEX,
|
|
326
|
+
scrollTop: 0
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
setItems(category.children);
|
|
330
|
+
setCurrentParentItem(category);
|
|
331
|
+
}, [
|
|
332
|
+
initialCategoryId,
|
|
333
|
+
initialItems,
|
|
334
|
+
pushNavigation,
|
|
335
|
+
title
|
|
336
|
+
]);
|
|
312
337
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
313
338
|
if (search) handleSearch(search);
|
|
314
339
|
}, [
|
|
@@ -21,6 +21,7 @@ export interface ToolboxProps<T> {
|
|
|
21
21
|
searchPlaceholder?: string;
|
|
22
22
|
quickActions?: ToolboxQuickAction[];
|
|
23
23
|
renderEmptyState?: ToolboxEmptyStateRenderer<T>;
|
|
24
|
+
initialCategoryId?: string;
|
|
24
25
|
}
|
|
25
|
-
export declare function Toolbox<T>({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth, fullHeight, quickActions, renderEmptyState, searchPlaceholder: searchPlaceholderProp, }: ToolboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function Toolbox<T>({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth, fullHeight, quickActions, renderEmptyState, searchPlaceholder: searchPlaceholderProp, initialCategoryId, }: ToolboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
//# sourceMappingURL=Toolbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/Toolbox.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,QAAQ,EAAkD,MAAM,YAAY,CAAC;AAC3F,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA+D7E,MAAM,MAAM,yBAAyB,CAAC,CAAC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nC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAOpC,gBAAgB,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAOhD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAgDD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,OAAO,EACP,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,EACP,SAAiB,EACjB,UAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EAAE,qBAAqB,EACxC,iBAAiB,GAClB,EAAE,YAAY,CAAC,CAAC,CAAC,2CA6jBjB"}
|
|
@@ -58,7 +58,7 @@ function searchLeafItems(items, query) {
|
|
|
58
58
|
}
|
|
59
59
|
return results;
|
|
60
60
|
}
|
|
61
|
-
function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth = false, fullHeight = false, quickActions, renderEmptyState, searchPlaceholder: searchPlaceholderProp }) {
|
|
61
|
+
function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title, initialItems, loading, fullWidth = false, fullHeight = false, quickActions, renderEmptyState, searchPlaceholder: searchPlaceholderProp, initialCategoryId }) {
|
|
62
62
|
const { _ } = useSafeLingui();
|
|
63
63
|
const searchPlaceholder = searchPlaceholderProp ?? _({
|
|
64
64
|
id: 'toolbox.search',
|
|
@@ -88,6 +88,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
88
88
|
const searchInputRef = useRef(null);
|
|
89
89
|
const clearButtonRef = useRef(null);
|
|
90
90
|
const lastScrollTopRef = useRef(0);
|
|
91
|
+
const initialCategoryAppliedRef = useRef(false);
|
|
91
92
|
const handleListScroll = useCallback((e)=>{
|
|
92
93
|
lastScrollTopRef.current = e.currentTarget.scrollTop;
|
|
93
94
|
}, []);
|
|
@@ -200,6 +201,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
200
201
|
]);
|
|
201
202
|
const handleItemSelect = useCallback(async (item, index)=>{
|
|
202
203
|
if (!item.children) return void onItemSelect(item);
|
|
204
|
+
initialCategoryAppliedRef.current = true;
|
|
203
205
|
setAwaitingChildren(true);
|
|
204
206
|
const nestedItems = 'function' == typeof item.children ? await item.children(item.id, item.name) : item.children;
|
|
205
207
|
const savedIndex = isSearching ? SEARCH_BAR_INDEX : index ?? activeIndex;
|
|
@@ -281,6 +283,29 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
|
|
|
281
283
|
navigationStack,
|
|
282
284
|
currentParentItem
|
|
283
285
|
]);
|
|
286
|
+
const pushNavigation = navigationStack.push;
|
|
287
|
+
useEffect(()=>{
|
|
288
|
+
if (!initialCategoryId || initialCategoryAppliedRef.current) return;
|
|
289
|
+
const category = findItemById(initialItems, initialCategoryId);
|
|
290
|
+
if (!category?.children || 'function' == typeof category.children) return;
|
|
291
|
+
initialCategoryAppliedRef.current = true;
|
|
292
|
+
pushNavigation({
|
|
293
|
+
title,
|
|
294
|
+
data: {
|
|
295
|
+
items: initialItems,
|
|
296
|
+
parentItem: null,
|
|
297
|
+
activeIndex: SEARCH_BAR_INDEX,
|
|
298
|
+
scrollTop: 0
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
setItems(category.children);
|
|
302
|
+
setCurrentParentItem(category);
|
|
303
|
+
}, [
|
|
304
|
+
initialCategoryId,
|
|
305
|
+
initialItems,
|
|
306
|
+
pushNavigation,
|
|
307
|
+
title
|
|
308
|
+
]);
|
|
284
309
|
useEffect(()=>{
|
|
285
310
|
if (search) handleSearch(search);
|
|
286
311
|
}, [
|