@uipath/apollo-react 3.62.0-pr418.fccf75c → 3.62.1

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.
@@ -483,11 +483,13 @@ const StageNodeComponent = (props)=>{
483
483
  (onTaskAdd || onAddTaskFromToolbox) && !isReadOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
484
484
  content: addTaskLabel,
485
485
  placement: "top",
486
+ hide: addTaskLoading,
486
487
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
487
488
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
488
489
  onClick: handleTaskAddClick,
489
490
  size: "small",
490
491
  label: addTaskLabel,
492
+ disabled: addTaskLoading,
491
493
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIcon, {
492
494
  name: "add",
493
495
  size: "20px"
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAspBxD,eAAO,MAAM,SAAS,8CA5oBa,cAAc,6CA4oBA,CAAC"}
1
+ {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA2pBxD,eAAO,MAAM,SAAS,8CAjpBa,cAAc,6CAipBA,CAAC"}
@@ -455,11 +455,13 @@ const StageNodeComponent = (props)=>{
455
455
  (onTaskAdd || onAddTaskFromToolbox) && !isReadOnly && /*#__PURE__*/ jsx(ApTooltip, {
456
456
  content: addTaskLabel,
457
457
  placement: "top",
458
+ hide: addTaskLoading,
458
459
  children: /*#__PURE__*/ jsx("span", {
459
460
  children: /*#__PURE__*/ jsx(ApIconButton, {
460
461
  onClick: handleTaskAddClick,
461
462
  size: "small",
462
463
  label: addTaskLabel,
464
+ disabled: addTaskLoading,
463
465
  children: /*#__PURE__*/ jsx(ApIcon, {
464
466
  name: "add",
465
467
  size: "20px"
@@ -1968,7 +1968,7 @@ const AddTaskLoadingStory = ()=>{
1968
1968
  width: 304,
1969
1969
  data: {
1970
1970
  stageDetails: {
1971
- label: 'Top-level loading (click +)',
1971
+ label: 'Loading (+ disabled for 3s)',
1972
1972
  tasks: []
1973
1973
  },
1974
1974
  addTaskLoading: true,
@@ -2018,16 +2018,40 @@ const AddTaskLoadingStory = ()=>{
2018
2018
  }, [
2019
2019
  setNodes
2020
2020
  ]);
2021
+ const timeoutRef = (0, external_react_namespaceObject.useRef)(void 0);
2022
+ (0, external_react_namespaceObject.useEffect)(()=>()=>clearTimeout(timeoutRef.current), []);
2023
+ const handleAddTaskFromToolbox = (0, external_react_namespaceObject.useCallback)((nodeId, _taskItem)=>{
2024
+ clearTimeout(timeoutRef.current);
2025
+ setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
2026
+ ...n,
2027
+ data: {
2028
+ ...n.data,
2029
+ addTaskLoading: true
2030
+ }
2031
+ } : n));
2032
+ timeoutRef.current = setTimeout(()=>{
2033
+ setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
2034
+ ...n,
2035
+ data: {
2036
+ ...n.data,
2037
+ addTaskLoading: false
2038
+ }
2039
+ } : n));
2040
+ }, 2000);
2041
+ }, [
2042
+ setNodes
2043
+ ]);
2021
2044
  const nodesWithHandler = (0, external_react_namespaceObject.useMemo)(()=>nodesState.map((node)=>({
2022
2045
  ...node,
2023
2046
  data: {
2024
2047
  ...node.data,
2025
2048
  onAddTaskFromToolbox: (taskItem)=>{
2026
- window.alert(`Added task "${taskItem.name}" to ${node.id}`);
2049
+ handleAddTaskFromToolbox(node.id, taskItem);
2027
2050
  }
2028
2051
  }
2029
2052
  })), [
2030
- nodesState
2053
+ nodesState,
2054
+ handleAddTaskFromToolbox
2031
2055
  ]);
2032
2056
  const onConnect = (0, external_react_namespaceObject.useCallback)((connection)=>setEdges((eds)=>(0, react_cjs_namespaceObject.addEdge)(connection, eds)), [
2033
2057
  setEdges
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAoHrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAkVF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA2HF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAiJF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAiHxB,CAAC"}
1
+ {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAoHrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAkVF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA2HF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA0KF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAiHxB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { ConnectionMode, Panel, ReactFlowProvider, addEdge, useEdgesState, useNodesState } from "../../xyflow/react.js";
3
3
  import { ApButton, ApMenu } from "../../../material/components/index.js";
4
- import { useCallback, useEffect, useMemo, useState } from "react";
4
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { DefaultCanvasTranslations } from "../../types.js";
6
6
  import { createGroupModificationHandlers, getHandlerForModificationType } from "../../utils/GroupModificationUtils.js";
7
7
  import { BaseCanvas } from "../BaseCanvas/index.js";
@@ -1930,7 +1930,7 @@ const AddTaskLoadingStory = ()=>{
1930
1930
  width: 304,
1931
1931
  data: {
1932
1932
  stageDetails: {
1933
- label: 'Top-level loading (click +)',
1933
+ label: 'Loading (+ disabled for 3s)',
1934
1934
  tasks: []
1935
1935
  },
1936
1936
  addTaskLoading: true,
@@ -1980,16 +1980,40 @@ const AddTaskLoadingStory = ()=>{
1980
1980
  }, [
1981
1981
  setNodes
1982
1982
  ]);
1983
+ const timeoutRef = useRef(void 0);
1984
+ useEffect(()=>()=>clearTimeout(timeoutRef.current), []);
1985
+ const handleAddTaskFromToolbox = useCallback((nodeId, _taskItem)=>{
1986
+ clearTimeout(timeoutRef.current);
1987
+ setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
1988
+ ...n,
1989
+ data: {
1990
+ ...n.data,
1991
+ addTaskLoading: true
1992
+ }
1993
+ } : n));
1994
+ timeoutRef.current = setTimeout(()=>{
1995
+ setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
1996
+ ...n,
1997
+ data: {
1998
+ ...n.data,
1999
+ addTaskLoading: false
2000
+ }
2001
+ } : n));
2002
+ }, 2000);
2003
+ }, [
2004
+ setNodes
2005
+ ]);
1983
2006
  const nodesWithHandler = useMemo(()=>nodesState.map((node)=>({
1984
2007
  ...node,
1985
2008
  data: {
1986
2009
  ...node.data,
1987
2010
  onAddTaskFromToolbox: (taskItem)=>{
1988
- window.alert(`Added task "${taskItem.name}" to ${node.id}`);
2011
+ handleAddTaskFromToolbox(node.id, taskItem);
1989
2012
  }
1990
2013
  }
1991
2014
  })), [
1992
- nodesState
2015
+ nodesState,
2016
+ handleAddTaskFromToolbox
1993
2017
  ]);
1994
2018
  const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
1995
2019
  setEdges
@@ -33,22 +33,31 @@ const CaseManagementProject = ({ w = 22, h = 22 })=>/*#__PURE__*/ (0, jsx_runtim
33
33
  width: w,
34
34
  height: h,
35
35
  fill: "none",
36
- viewBox: "0 0 24 24",
36
+ viewBox: "0 0 16 16",
37
37
  children: [
38
38
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
39
- d: "M16.466 7.5C15.643 4.237 13.952 2 12 2C9.239 2 7 6.477 7 12C7 17.523 9.239 22 12 22C12.342 22 12.677 21.931 13 21.8",
40
- stroke: "currentColor",
41
- "stroke-width": "2",
42
- "stroke-linecap": "round",
43
- "stroke-linejoin": "round"
39
+ fill: "currentColor",
40
+ fillRule: "evenodd",
41
+ clipRule: "evenodd",
42
+ d: "M1.09 3.818 3.075 1.53c.242-.279.593-.44.962-.44h7.928c.37 0 .72.161.962.44l1.983 2.288v9.818c0 .703-.57 1.273-1.273 1.273H2.364c-.703 0-1.273-.57-1.273-1.273zm2.946-1.636h7.928c.053 0 .103.023.138.063l.89 1.028H3.008l.891-1.028a.18.18 0 0 1 .138-.063m9.782 2.182H2.182v9.272c0 .1.081.182.182.182h11.272c.1 0 .182-.081.182-.182z"
43
+ }),
44
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
45
+ fill: "currentColor",
46
+ d: "M4.833 12.45a.83.83 0 0 1-.588-.23.73.73 0 0 1-.245-.554V7.353q0-.324.245-.554a.83.83 0 0 1 .588-.23H6.5v-.785q0-.323.245-.554A.83.83 0 0 1 7.333 5H9q.344 0 .589.23a.73.73 0 0 1 .244.554v.784H11.5q.344 0 .588.23a.73.73 0 0 1 .245.555v4.313q0 .323-.245.554a.83.83 0 0 1-.588.23zm0-.784H11.5V7.353H4.833zm2.5-5.098H9v-.784H7.333z"
44
47
  }),
45
48
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
46
49
  fill: "currentColor",
47
- d: "M12 6C14.5294 6 16.8808 6.44759 18.749 7.21973C20.5787 7.976 22.115 9.11858 22.7266 10.624C22.9341 11.1355 22.6881 11.7189 22.1768 11.9268C21.6651 12.1346 21.0809 11.8877 20.873 11.376C20.5574 10.5996 19.6129 9.74145 17.9844 9.06836C16.3939 8.41106 14.3085 8 12 8C9.36011 8 7.01949 8.53756 5.37598 9.35938C3.67279 10.2111 3 11.2024 3 12C3 12.7976 3.67279 13.7889 5.37598 14.6406C7.01949 15.4624 9.36011 16 12 16C12.6959 16 13.3706 15.9607 14.0176 15.8906C14.0783 16.5962 14.3009 17.2553 14.6494 17.8301C13.7983 17.9406 12.9105 18 12 18C9.11689 18 6.45718 17.4176 4.48145 16.4297C2.56565 15.4717 1 13.9633 1 12C1 10.0367 2.56565 8.52833 4.48145 7.57031C6.45718 6.58238 9.11689 6 12 6Z"
50
+ d: "M4.417 8.529h7.5v.784h-7.5z"
48
51
  }),
49
52
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
50
- fill: "var(--color-primary)",
51
- d: "M17.8761 12.4344C18.0904 11.8552 18.9096 11.8552 19.1239 12.4344L19.7834 14.2166L21.5656 14.8761C22.1448 15.0904 22.1448 15.9096 21.5656 16.1239L19.7834 16.7834L19.1239 18.5656C18.9096 19.1448 18.0904 19.1448 17.8761 18.5656L17.2166 16.7834L15.4344 16.1239C14.8552 15.9096 14.8552 15.0904 15.4344 14.8761L17.2166 14.2166L17.8761 12.4344Z"
53
+ stroke: "currentColor",
54
+ strokeWidth: ".15",
55
+ d: "M4.833 12.45a.83.83 0 0 1-.588-.23.73.73 0 0 1-.245-.554V7.353q0-.324.245-.554a.83.83 0 0 1 .588-.23H6.5v-.785q0-.323.245-.554A.83.83 0 0 1 7.333 5H9q.344 0 .589.23a.73.73 0 0 1 .244.554v.784H11.5q.344 0 .588.23a.73.73 0 0 1 .245.555v4.313q0 .323-.245.554a.83.83 0 0 1-.588.23zm0-.784H11.5V7.353H4.833zm2.5-5.098H9v-.784H7.333z"
56
+ }),
57
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
58
+ stroke: "currentColor",
59
+ strokeWidth: ".15",
60
+ d: "M4.417 8.529h7.5v.784h-7.5z"
52
61
  })
53
62
  ]
54
63
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CaseManagementProject.d.ts","sourceRoot":"","sources":["../../../src/canvas/icons/CaseManagementProject.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,GAAI,WAGnC;IACD,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB,4CAyBA,CAAC"}
1
+ {"version":3,"file":"CaseManagementProject.d.ts","sourceRoot":"","sources":["../../../src/canvas/icons/CaseManagementProject.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,GAAI,WAGnC;IACD,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB,4CA2BA,CAAC"}
@@ -5,22 +5,31 @@ const CaseManagementProject = ({ w = 22, h = 22 })=>/*#__PURE__*/ jsxs("svg", {
5
5
  width: w,
6
6
  height: h,
7
7
  fill: "none",
8
- viewBox: "0 0 24 24",
8
+ viewBox: "0 0 16 16",
9
9
  children: [
10
10
  /*#__PURE__*/ jsx("path", {
11
- d: "M16.466 7.5C15.643 4.237 13.952 2 12 2C9.239 2 7 6.477 7 12C7 17.523 9.239 22 12 22C12.342 22 12.677 21.931 13 21.8",
12
- stroke: "currentColor",
13
- "stroke-width": "2",
14
- "stroke-linecap": "round",
15
- "stroke-linejoin": "round"
11
+ fill: "currentColor",
12
+ fillRule: "evenodd",
13
+ clipRule: "evenodd",
14
+ d: "M1.09 3.818 3.075 1.53c.242-.279.593-.44.962-.44h7.928c.37 0 .72.161.962.44l1.983 2.288v9.818c0 .703-.57 1.273-1.273 1.273H2.364c-.703 0-1.273-.57-1.273-1.273zm2.946-1.636h7.928c.053 0 .103.023.138.063l.89 1.028H3.008l.891-1.028a.18.18 0 0 1 .138-.063m9.782 2.182H2.182v9.272c0 .1.081.182.182.182h11.272c.1 0 .182-.081.182-.182z"
15
+ }),
16
+ /*#__PURE__*/ jsx("path", {
17
+ fill: "currentColor",
18
+ d: "M4.833 12.45a.83.83 0 0 1-.588-.23.73.73 0 0 1-.245-.554V7.353q0-.324.245-.554a.83.83 0 0 1 .588-.23H6.5v-.785q0-.323.245-.554A.83.83 0 0 1 7.333 5H9q.344 0 .589.23a.73.73 0 0 1 .244.554v.784H11.5q.344 0 .588.23a.73.73 0 0 1 .245.555v4.313q0 .323-.245.554a.83.83 0 0 1-.588.23zm0-.784H11.5V7.353H4.833zm2.5-5.098H9v-.784H7.333z"
16
19
  }),
17
20
  /*#__PURE__*/ jsx("path", {
18
21
  fill: "currentColor",
19
- d: "M12 6C14.5294 6 16.8808 6.44759 18.749 7.21973C20.5787 7.976 22.115 9.11858 22.7266 10.624C22.9341 11.1355 22.6881 11.7189 22.1768 11.9268C21.6651 12.1346 21.0809 11.8877 20.873 11.376C20.5574 10.5996 19.6129 9.74145 17.9844 9.06836C16.3939 8.41106 14.3085 8 12 8C9.36011 8 7.01949 8.53756 5.37598 9.35938C3.67279 10.2111 3 11.2024 3 12C3 12.7976 3.67279 13.7889 5.37598 14.6406C7.01949 15.4624 9.36011 16 12 16C12.6959 16 13.3706 15.9607 14.0176 15.8906C14.0783 16.5962 14.3009 17.2553 14.6494 17.8301C13.7983 17.9406 12.9105 18 12 18C9.11689 18 6.45718 17.4176 4.48145 16.4297C2.56565 15.4717 1 13.9633 1 12C1 10.0367 2.56565 8.52833 4.48145 7.57031C6.45718 6.58238 9.11689 6 12 6Z"
22
+ d: "M4.417 8.529h7.5v.784h-7.5z"
20
23
  }),
21
24
  /*#__PURE__*/ jsx("path", {
22
- fill: "var(--color-primary)",
23
- d: "M17.8761 12.4344C18.0904 11.8552 18.9096 11.8552 19.1239 12.4344L19.7834 14.2166L21.5656 14.8761C22.1448 15.0904 22.1448 15.9096 21.5656 16.1239L19.7834 16.7834L19.1239 18.5656C18.9096 19.1448 18.0904 19.1448 17.8761 18.5656L17.2166 16.7834L15.4344 16.1239C14.8552 15.9096 14.8552 15.0904 15.4344 14.8761L17.2166 14.2166L17.8761 12.4344Z"
25
+ stroke: "currentColor",
26
+ strokeWidth: ".15",
27
+ d: "M4.833 12.45a.83.83 0 0 1-.588-.23.73.73 0 0 1-.245-.554V7.353q0-.324.245-.554a.83.83 0 0 1 .588-.23H6.5v-.785q0-.323.245-.554A.83.83 0 0 1 7.333 5H9q.344 0 .589.23a.73.73 0 0 1 .244.554v.784H11.5q.344 0 .588.23a.73.73 0 0 1 .245.555v4.313q0 .323-.245.554a.83.83 0 0 1-.588.23zm0-.784H11.5V7.353H4.833zm2.5-5.098H9v-.784H7.333z"
28
+ }),
29
+ /*#__PURE__*/ jsx("path", {
30
+ stroke: "currentColor",
31
+ strokeWidth: ".15",
32
+ d: "M4.417 8.529h7.5v.784h-7.5z"
24
33
  })
25
34
  ]
26
35
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "3.62.0-pr418.fccf75c",
3
+ "version": "3.62.1",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",