@uipath/apollo-react 6.16.2 → 6.16.3
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.types.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.cjs +11 -13
- package/dist/canvas/hooks/usePreviewNode.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.js +11 -13
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddNodePanel.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodePanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,YAAY,EAAE,QAAQ,EAAE,KACrB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AddNodePanel.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodePanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEt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AO,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;IAKnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAOpC,gBAAgB,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;CACjD;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,GACzC,EAAE,YAAY,CAAC,CAAC,CAAC,2CAqiBjB"}
|
|
@@ -28,29 +28,27 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const react_cjs_namespaceObject = require("../xyflow/react.cjs");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
|
-
const shallow_namespaceObject = require("zustand/shallow");
|
|
32
31
|
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
33
32
|
const index_cjs_namespaceObject = require("../core/index.cjs");
|
|
34
33
|
const createPreviewNode_cjs_namespaceObject = require("../utils/createPreviewNode.cjs");
|
|
35
|
-
const previewNodeSelectedSelector = (state)=>
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const previewNodeSelectedSelector = (state)=>state.nodeLookup.get(external_constants_cjs_namespaceObject.PREVIEW_NODE_ID)?.selected ?? false;
|
|
35
|
+
const previewConnectionKey = (edge, state)=>{
|
|
36
|
+
const sourceIsPreviewNode = edge.source === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID;
|
|
37
|
+
const existingNodeId = sourceIsPreviewNode ? edge.target : edge.source;
|
|
38
|
+
const existingHandleId = sourceIsPreviewNode ? edge.targetHandle || 'input' : edge.sourceHandle || 'output';
|
|
39
|
+
const existingNodeType = state.nodeLookup.get(existingNodeId)?.type ?? '';
|
|
40
|
+
return `${edge.id},${existingNodeId},${existingHandleId},${existingNodeType},${sourceIsPreviewNode}`;
|
|
38
41
|
};
|
|
39
|
-
const
|
|
40
|
-
id: edge.id,
|
|
41
|
-
source: edge.source,
|
|
42
|
-
target: edge.target,
|
|
43
|
-
sourceHandle: edge.sourceHandle,
|
|
44
|
-
targetHandle: edge.targetHandle
|
|
45
|
-
}));
|
|
42
|
+
const previewEdgeSignatureSelector = (state)=>state.edges.filter(createPreviewNode_cjs_namespaceObject.isPreviewEdge).map((edge)=>previewConnectionKey(edge, state)).join('|');
|
|
46
43
|
const usePreviewNode = ()=>{
|
|
47
44
|
const reactFlowInstance = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
48
45
|
const isPreviewNodeSelected = (0, react_cjs_namespaceObject.useStore)(previewNodeSelectedSelector);
|
|
49
|
-
const
|
|
46
|
+
const previewEdgeSignature = (0, react_cjs_namespaceObject.useStore)(previewEdgeSignatureSelector);
|
|
50
47
|
const registry = (0, index_cjs_namespaceObject.useOptionalNodeTypeRegistry)();
|
|
51
48
|
const previewNode = isPreviewNodeSelected ? reactFlowInstance.getNode(external_constants_cjs_namespaceObject.PREVIEW_NODE_ID) ?? null : null;
|
|
52
49
|
const connectionInfo = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
53
50
|
if (!isPreviewNodeSelected) return null;
|
|
51
|
+
const previewEdges = reactFlowInstance.getEdges().filter(createPreviewNode_cjs_namespaceObject.isPreviewEdge);
|
|
54
52
|
const connections = previewEdges.map((previewEdge)=>{
|
|
55
53
|
const sourceIsPreviewNode = previewEdge.source === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID;
|
|
56
54
|
const existingNodeId = sourceIsPreviewNode ? previewEdge.target : previewEdge.source;
|
|
@@ -75,7 +73,7 @@ const usePreviewNode = ()=>{
|
|
|
75
73
|
return connections;
|
|
76
74
|
}, [
|
|
77
75
|
isPreviewNodeSelected,
|
|
78
|
-
|
|
76
|
+
previewEdgeSignature,
|
|
79
77
|
reactFlowInstance,
|
|
80
78
|
registry
|
|
81
79
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreviewNode.d.ts","sourceRoot":"","sources":["../../../src/canvas/hooks/usePreviewNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"usePreviewNode.d.ts","sourceRoot":"","sources":["../../../src/canvas/hooks/usePreviewNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,0CAA0C,CAAC;AAIlD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAS9E,MAAM,WAAW,yBAAyB;IAExC,cAAc,EAAE,MAAM,CAAC;IAEvB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,oBAAoB,EAAE,YAAY,GAAG,SAAS,CAAC;IAE/C,sBAAsB,EAAE,cAAc,GAAG,SAAS,CAAC;IAEnD,kBAAkB,EAAE,OAAO,CAAC;IAE5B,aAAa,EAAE,MAAM,CAAC;CACvB;AAoCD,UAAU,oBAAoB;IAE5B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAKzB,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;CACpE;AAgBD,eAAO,MAAM,cAAc,QAAO,oBAoEjC,CAAC"}
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { useReactFlow, useStore } from "../xyflow/react.js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { shallow } from "zustand/shallow";
|
|
4
3
|
import { PREVIEW_NODE_ID } from "../constants.js";
|
|
5
4
|
import { useOptionalNodeTypeRegistry } from "../core/index.js";
|
|
6
5
|
import { isPreviewEdge } from "../utils/createPreviewNode.js";
|
|
7
|
-
const previewNodeSelectedSelector = (state)=>
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const previewNodeSelectedSelector = (state)=>state.nodeLookup.get(PREVIEW_NODE_ID)?.selected ?? false;
|
|
7
|
+
const previewConnectionKey = (edge, state)=>{
|
|
8
|
+
const sourceIsPreviewNode = edge.source === PREVIEW_NODE_ID;
|
|
9
|
+
const existingNodeId = sourceIsPreviewNode ? edge.target : edge.source;
|
|
10
|
+
const existingHandleId = sourceIsPreviewNode ? edge.targetHandle || 'input' : edge.sourceHandle || 'output';
|
|
11
|
+
const existingNodeType = state.nodeLookup.get(existingNodeId)?.type ?? '';
|
|
12
|
+
return `${edge.id},${existingNodeId},${existingHandleId},${existingNodeType},${sourceIsPreviewNode}`;
|
|
10
13
|
};
|
|
11
|
-
const
|
|
12
|
-
id: edge.id,
|
|
13
|
-
source: edge.source,
|
|
14
|
-
target: edge.target,
|
|
15
|
-
sourceHandle: edge.sourceHandle,
|
|
16
|
-
targetHandle: edge.targetHandle
|
|
17
|
-
}));
|
|
14
|
+
const previewEdgeSignatureSelector = (state)=>state.edges.filter(isPreviewEdge).map((edge)=>previewConnectionKey(edge, state)).join('|');
|
|
18
15
|
const usePreviewNode = ()=>{
|
|
19
16
|
const reactFlowInstance = useReactFlow();
|
|
20
17
|
const isPreviewNodeSelected = useStore(previewNodeSelectedSelector);
|
|
21
|
-
const
|
|
18
|
+
const previewEdgeSignature = useStore(previewEdgeSignatureSelector);
|
|
22
19
|
const registry = useOptionalNodeTypeRegistry();
|
|
23
20
|
const previewNode = isPreviewNodeSelected ? reactFlowInstance.getNode(PREVIEW_NODE_ID) ?? null : null;
|
|
24
21
|
const connectionInfo = useMemo(()=>{
|
|
25
22
|
if (!isPreviewNodeSelected) return null;
|
|
23
|
+
const previewEdges = reactFlowInstance.getEdges().filter(isPreviewEdge);
|
|
26
24
|
const connections = previewEdges.map((previewEdge)=>{
|
|
27
25
|
const sourceIsPreviewNode = previewEdge.source === PREVIEW_NODE_ID;
|
|
28
26
|
const existingNodeId = sourceIsPreviewNode ? previewEdge.target : previewEdge.source;
|
|
@@ -47,7 +45,7 @@ const usePreviewNode = ()=>{
|
|
|
47
45
|
return connections;
|
|
48
46
|
}, [
|
|
49
47
|
isPreviewNodeSelected,
|
|
50
|
-
|
|
48
|
+
previewEdgeSignature,
|
|
51
49
|
reactFlowInstance,
|
|
52
50
|
registry
|
|
53
51
|
]);
|