@uipath/apollo-react 4.15.1 → 4.16.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/AddNodePanel/AddNodeManager.cjs +6 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.js +6 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.cjs +9 -3
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.js +9 -3
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +2 -1
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.cjs +5 -4
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +4 -3
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +108 -13
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts +10 -5
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +108 -13
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.cjs +159 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.d.ts +21 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.d.ts.map +1 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.js +122 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +10 -2
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts +2 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +5 -3
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +13 -2
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts +10 -1
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/HandleButton.js +13 -2
- package/dist/canvas/components/ButtonHandle/useButtonHandles.cjs +4 -2
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts +2 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.js +4 -2
- package/dist/canvas/components/Edges/SequenceEdge.cjs +8 -4
- package/dist/canvas/components/Edges/SequenceEdge.js +8 -4
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +24 -22
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +25 -23
- package/dist/canvas/components/LoopNode/LoopCanvasNode.cjs +75 -0
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts +6 -0
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopCanvasNode.js +41 -0
- package/dist/canvas/components/LoopNode/LoopNode.cjs +447 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.cjs +56 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts +7 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.js +7 -0
- package/dist/canvas/components/LoopNode/LoopNode.d.ts +5 -0
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.cjs +145 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts +29 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +99 -0
- package/dist/canvas/components/LoopNode/LoopNode.js +413 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.cjs +18 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +22 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.js +0 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.cjs +61 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts +9 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.js +27 -0
- package/dist/canvas/components/LoopNode/index.cjs +79 -0
- package/dist/canvas/components/LoopNode/index.d.ts +5 -0
- package/dist/canvas/components/LoopNode/index.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/index.js +4 -0
- package/dist/canvas/components/NodeViewportOverlay.cjs +63 -0
- package/dist/canvas/components/NodeViewportOverlay.d.ts +22 -0
- package/dist/canvas/components/NodeViewportOverlay.d.ts.map +1 -0
- package/dist/canvas/components/NodeViewportOverlay.js +29 -0
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.cjs +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.js +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.cjs +25 -23
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.js +27 -25
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.cjs +10 -3
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.js +10 -3
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts +1 -0
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts.map +1 -1
- package/dist/canvas/components/index.cjs +27 -20
- package/dist/canvas/components/index.d.ts +1 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +1 -0
- package/dist/canvas/constants.cjs +12 -0
- package/dist/canvas/constants.d.ts +3 -0
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +4 -1
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.cjs +22 -23
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.d.ts.map +1 -1
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.js +23 -24
- package/dist/canvas/hooks/usePreviewNode.cjs +2 -1
- package/dist/canvas/hooks/usePreviewNode.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.js +2 -1
- package/dist/canvas/schema/node-definition/handle.cjs +10 -2
- package/dist/canvas/schema/node-definition/handle.d.ts +9 -0
- package/dist/canvas/schema/node-definition/handle.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/handle.js +6 -1
- package/dist/canvas/schema/node-definition/index.cjs +4 -1
- package/dist/canvas/schema/node-definition/index.d.ts +3 -3
- package/dist/canvas/schema/node-definition/index.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/index.js +2 -2
- package/dist/canvas/schema/node-definition/node-manifest.cjs +2 -1
- package/dist/canvas/schema/node-definition/node-manifest.d.ts +7 -0
- package/dist/canvas/schema/node-definition/node-manifest.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/node-manifest.js +2 -1
- package/dist/canvas/schema/node-instance/base.d.ts +1 -0
- package/dist/canvas/schema/node-instance/base.d.ts.map +1 -1
- package/dist/canvas/schema/node-instance/node.d.ts +1 -0
- package/dist/canvas/schema/node-instance/node.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/hooks/useCanvasStory.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts +2 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
- package/dist/canvas/styles/reactflow-reset.css +2 -2
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/utils/NodeUtils.cjs +4 -0
- package/dist/canvas/utils/NodeUtils.d.ts +2 -1
- package/dist/canvas/utils/NodeUtils.d.ts.map +1 -1
- package/dist/canvas/utils/NodeUtils.js +2 -1
- package/dist/canvas/utils/collapse.cjs +13 -6
- package/dist/canvas/utils/collapse.d.ts.map +1 -1
- package/dist/canvas/utils/collapse.js +9 -2
- package/dist/canvas/utils/createPreviewGraph.cjs +126 -0
- package/dist/canvas/utils/createPreviewGraph.d.ts +36 -0
- package/dist/canvas/utils/createPreviewGraph.d.ts.map +1 -0
- package/dist/canvas/utils/createPreviewGraph.js +83 -0
- package/dist/canvas/utils/createPreviewNode.cjs +30 -11
- package/dist/canvas/utils/createPreviewNode.d.ts +10 -2
- package/dist/canvas/utils/createPreviewNode.d.ts.map +1 -1
- package/dist/canvas/utils/createPreviewNode.js +21 -11
- package/dist/canvas/utils/index.cjs +33 -26
- package/dist/canvas/utils/index.d.ts +2 -1
- package/dist/canvas/utils/index.d.ts.map +1 -1
- package/dist/canvas/utils/index.js +2 -1
- package/package.json +2 -2
|
@@ -79,12 +79,17 @@ const AddNodeManager = ({ initializing, customPanel: CustomPanel, createNodeData
|
|
|
79
79
|
...baseNodeData,
|
|
80
80
|
useSmartHandles: true
|
|
81
81
|
} : baseNodeData;
|
|
82
|
+
const previewNodeScope = currentPreviewNode.parentId ? {
|
|
83
|
+
parentId: currentPreviewNode.parentId,
|
|
84
|
+
extent: currentPreviewNode.extent
|
|
85
|
+
} : {};
|
|
82
86
|
const newNode = {
|
|
83
87
|
id: newNodeId,
|
|
84
88
|
type: nodeItem.data.type,
|
|
85
89
|
position: currentPreviewNode.position,
|
|
86
90
|
selected: true,
|
|
87
|
-
data: nodeData
|
|
91
|
+
data: nodeData,
|
|
92
|
+
...previewNodeScope
|
|
88
93
|
};
|
|
89
94
|
const newNodeManifest = registry?.getManifest(nodeItem.data.type);
|
|
90
95
|
const newEdges = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddNodeManager.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodeManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAKlC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;IAI7E,YAAY,CAAC,EAAE,OAAO,CAAC;IAIvB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAK7F,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,YAAY,CAAC;IAOtE,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IAK7F,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK,I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,IAAI,KAAK,IAAI,CAAC;IAMpF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AASD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyMxD,CAAC"}
|
|
@@ -51,12 +51,17 @@ const AddNodeManager = ({ initializing, customPanel: CustomPanel, createNodeData
|
|
|
51
51
|
...baseNodeData,
|
|
52
52
|
useSmartHandles: true
|
|
53
53
|
} : baseNodeData;
|
|
54
|
+
const previewNodeScope = currentPreviewNode.parentId ? {
|
|
55
|
+
parentId: currentPreviewNode.parentId,
|
|
56
|
+
extent: currentPreviewNode.extent
|
|
57
|
+
} : {};
|
|
54
58
|
const newNode = {
|
|
55
59
|
id: newNodeId,
|
|
56
60
|
type: nodeItem.data.type,
|
|
57
61
|
position: currentPreviewNode.position,
|
|
58
62
|
selected: true,
|
|
59
|
-
data: nodeData
|
|
63
|
+
data: nodeData,
|
|
64
|
+
...previewNodeScope
|
|
60
65
|
};
|
|
61
66
|
const newNodeManifest = registry?.getManifest(nodeItem.data.type);
|
|
62
67
|
const newEdges = [];
|
|
@@ -27,10 +27,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
createAddNodePreview: ()=>createAddNodePreview
|
|
28
28
|
});
|
|
29
29
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
30
|
-
const
|
|
30
|
+
const createPreviewGraph_cjs_namespaceObject = require("../../utils/createPreviewGraph.cjs");
|
|
31
31
|
function createAddNodePreview(sourceNodeId, sourceHandleId, reactFlowInstance, handlePosition = react_cjs_namespaceObject.Position.Right, sourceHandleType = 'source', ignoredNodeTypes = []) {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
(0, createPreviewGraph_cjs_namespaceObject.showPreviewGraph)({
|
|
33
|
+
sourceNodeId,
|
|
34
|
+
sourceHandleId,
|
|
35
|
+
reactFlowInstance,
|
|
36
|
+
sourceHandleType,
|
|
37
|
+
handlePosition,
|
|
38
|
+
ignoredNodeTypes
|
|
39
|
+
});
|
|
34
40
|
}
|
|
35
41
|
exports.createAddNodePreview = __webpack_exports__.createAddNodePreview;
|
|
36
42
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAddNodePreview.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/createAddNodePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAa5F,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,GAAE,QAAyB,EACzC,gBAAgB,GAAE,QAAQ,GAAG,QAAmB,EAChD,gBAAgB,GAAE,MAAM,EAAO,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"createAddNodePreview.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/createAddNodePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAa5F,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,GAAE,QAAyB,EACzC,gBAAgB,GAAE,QAAQ,GAAG,QAAmB,EAChD,gBAAgB,GAAE,MAAM,EAAO,GAC9B,IAAI,CASN"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Position } from "../../xyflow/react.js";
|
|
2
|
-
import {
|
|
2
|
+
import { showPreviewGraph } from "../../utils/createPreviewGraph.js";
|
|
3
3
|
function createAddNodePreview(sourceNodeId, sourceHandleId, reactFlowInstance, handlePosition = Position.Right, sourceHandleType = 'source', ignoredNodeTypes = []) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
showPreviewGraph({
|
|
5
|
+
sourceNodeId,
|
|
6
|
+
sourceHandleId,
|
|
7
|
+
reactFlowInstance,
|
|
8
|
+
sourceHandleType,
|
|
9
|
+
handlePosition,
|
|
10
|
+
ignoredNodeTypes
|
|
11
|
+
});
|
|
6
12
|
}
|
|
7
13
|
export { createAddNodePreview };
|
|
@@ -29,7 +29,7 @@ export declare const agentFlowManifest: {
|
|
|
29
29
|
label: string;
|
|
30
30
|
icon: string;
|
|
31
31
|
description?: string | undefined;
|
|
32
|
-
shape?: "square" | "circle" | "rectangle" | undefined;
|
|
32
|
+
shape?: "square" | "circle" | "container" | "rectangle" | undefined;
|
|
33
33
|
color?: string | undefined;
|
|
34
34
|
background?: string | undefined;
|
|
35
35
|
iconBackground?: string | undefined;
|
|
@@ -77,6 +77,7 @@ export declare const agentFlowManifest: {
|
|
|
77
77
|
} | undefined;
|
|
78
78
|
isDefaultForType?: boolean | undefined;
|
|
79
79
|
}[];
|
|
80
|
+
boundary?: "outer" | "inner" | undefined;
|
|
80
81
|
customPositionAndOffsets?: {
|
|
81
82
|
height?: number | undefined;
|
|
82
83
|
width?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-flow.manifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AgentCanvas/agent-flow.manifest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAMnF,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAmBjD,CAAC;AAMF,eAAO,MAAM,2BAA2B,EAAE,YAsDzC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,YAqDrC,CAAC;AAMF,eAAO,MAAM,uBAAuB,EAAE,YAwBrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAwBlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,YAwBjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,YAwBxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,YAwBpC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,YAwBjC,CAAC;AAMF,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"agent-flow.manifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AgentCanvas/agent-flow.manifest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAMnF,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAmBjD,CAAC;AAMF,eAAO,MAAM,2BAA2B,EAAE,YAsDzC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,YAqDrC,CAAC;AAMF,eAAO,MAAM,uBAAuB,EAAE,YAwBrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAwBlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,YAwBjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,YAwBxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,YAwBpC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,YAwBjC,CAAC;AAMF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa7B,CAAC"}
|
|
@@ -35,6 +35,7 @@ const external_hooks_index_cjs_namespaceObject = require("../../hooks/index.cjs"
|
|
|
35
35
|
const adornment_resolver_cjs_namespaceObject = require("../../utils/adornment-resolver.cjs");
|
|
36
36
|
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
|
|
37
37
|
const manifest_resolver_cjs_namespaceObject = require("../../utils/manifest-resolver.cjs");
|
|
38
|
+
const NodeUtils_cjs_namespaceObject = require("../../utils/NodeUtils.cjs");
|
|
38
39
|
const toolbar_resolver_cjs_namespaceObject = require("../../utils/toolbar-resolver.cjs");
|
|
39
40
|
const BaseCanvasModeProvider_cjs_namespaceObject = require("../BaseCanvas/BaseCanvasModeProvider.cjs");
|
|
40
41
|
const CanvasThemeContext_cjs_namespaceObject = require("../BaseCanvas/CanvasThemeContext.cjs");
|
|
@@ -49,7 +50,6 @@ const external_BaseNodeContainer_cjs_namespaceObject = require("./BaseNodeContai
|
|
|
49
50
|
const external_BaseNodeInnerShape_cjs_namespaceObject = require("./BaseNodeInnerShape.cjs");
|
|
50
51
|
const external_BaseNodeMissingManifest_cjs_namespaceObject = require("./BaseNodeMissingManifest.cjs");
|
|
51
52
|
const external_NodeLabel_cjs_namespaceObject = require("./NodeLabel.cjs");
|
|
52
|
-
const selectIsConnecting = (state)=>!!state.connection.inProgress;
|
|
53
53
|
const getContainerWidth = (shape, width)=>{
|
|
54
54
|
const defaultWidth = 'rectangle' === shape ? external_constants_cjs_namespaceObject.DEFAULT_RECTANGLE_NODE_WIDTH : external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE;
|
|
55
55
|
if (width && width !== external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE && width !== external_constants_cjs_namespaceObject.DEFAULT_RECTANGLE_NODE_WIDTH) return width;
|
|
@@ -69,7 +69,7 @@ const getContainerHeight = (height, hasFooter, footerVariant)=>{
|
|
|
69
69
|
return height || external_constants_cjs_namespaceObject.NODE_HEIGHT_DEFAULT;
|
|
70
70
|
};
|
|
71
71
|
const BaseNodeComponent = (props)=>{
|
|
72
|
-
const { type, data, selected, id, dragging, width, height } = props;
|
|
72
|
+
const { type, data, selected, id, dragging, width, height, parentId } = props;
|
|
73
73
|
const { onHandleAction: onHandleActionProp, shouldShowAddButtonFn: shouldShowAddButtonFnProp, shouldShowButtonHandleNotchesFn: shouldShowButtonHandleNotchesFnProp, toolbarConfig: toolbarConfigProp, handleConfigurations: handleConfigurationsProp, adornments: adornmentsProp, suggestionType, disabled, executionStatusOverride, labelTooltip, labelBackgroundColor, footerVariant, footerComponent, subLabelComponent, iconComponent } = (0, external_BaseNodeConfigContext_cjs_namespaceObject.useBaseNodeOverrideConfig)();
|
|
74
74
|
const updateNodeInternals = (0, react_cjs_namespaceObject.useUpdateNodeInternals)();
|
|
75
75
|
const { updateNodeData, updateNode } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
@@ -84,7 +84,7 @@ const BaseNodeComponent = (props)=>{
|
|
|
84
84
|
const nodeTypeRegistry = (0, index_cjs_namespaceObject.useNodeTypeRegistry)();
|
|
85
85
|
const { mode } = (0, BaseCanvasModeProvider_cjs_namespaceObject.useBaseCanvasMode)();
|
|
86
86
|
const connectedHandleIds = (0, ConnectedHandlesContext_cjs_namespaceObject.useConnectedHandles)(id);
|
|
87
|
-
const isConnecting = (0, react_cjs_namespaceObject.useStore)(selectIsConnecting);
|
|
87
|
+
const isConnecting = (0, react_cjs_namespaceObject.useStore)(NodeUtils_cjs_namespaceObject.selectIsConnecting);
|
|
88
88
|
const { multipleNodesSelected } = (0, SelectionStateContext_cjs_namespaceObject.useSelectionState)();
|
|
89
89
|
const { isDarkMode } = (0, CanvasThemeContext_cjs_namespaceObject.useCanvasTheme)();
|
|
90
90
|
const manifest = (0, external_react_namespaceObject.useMemo)(()=>nodeTypeRegistry.getManifest(type), [
|
|
@@ -340,7 +340,8 @@ const BaseNodeComponent = (props)=>{
|
|
|
340
340
|
showNotches,
|
|
341
341
|
nodeWidth: width,
|
|
342
342
|
nodeHeight: height,
|
|
343
|
-
shouldShowAddButtonFn
|
|
343
|
+
shouldShowAddButtonFn,
|
|
344
|
+
portalActions: !!parentId
|
|
344
345
|
});
|
|
345
346
|
const smartHandleElements = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
346
347
|
if (!useSmartHandles) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAuChF,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAynB1B,eAAO,MAAM,QAAQ,8CAnlBa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CAmlBhB,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { useElementValidationStatus, useNodeExecutionState } from "../../hooks/i
|
|
|
7
7
|
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
8
8
|
import { getIcon } from "../../utils/icon-registry.js";
|
|
9
9
|
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
10
|
+
import { selectIsConnecting } from "../../utils/NodeUtils.js";
|
|
10
11
|
import { resolveToolbar } from "../../utils/toolbar-resolver.js";
|
|
11
12
|
import { useBaseCanvasMode } from "../BaseCanvas/BaseCanvasModeProvider.js";
|
|
12
13
|
import { useCanvasTheme } from "../BaseCanvas/CanvasThemeContext.js";
|
|
@@ -21,7 +22,6 @@ import { BaseContainer } from "./BaseNodeContainer.js";
|
|
|
21
22
|
import { BaseInnerShape } from "./BaseNodeInnerShape.js";
|
|
22
23
|
import { MissingManifestNode } from "./BaseNodeMissingManifest.js";
|
|
23
24
|
import { NodeLabel } from "./NodeLabel.js";
|
|
24
|
-
const selectIsConnecting = (state)=>!!state.connection.inProgress;
|
|
25
25
|
const getContainerWidth = (shape, width)=>{
|
|
26
26
|
const defaultWidth = 'rectangle' === shape ? DEFAULT_RECTANGLE_NODE_WIDTH : DEFAULT_NODE_SIZE;
|
|
27
27
|
if (width && width !== DEFAULT_NODE_SIZE && width !== DEFAULT_RECTANGLE_NODE_WIDTH) return width;
|
|
@@ -41,7 +41,7 @@ const getContainerHeight = (height, hasFooter, footerVariant)=>{
|
|
|
41
41
|
return height || NODE_HEIGHT_DEFAULT;
|
|
42
42
|
};
|
|
43
43
|
const BaseNodeComponent = (props)=>{
|
|
44
|
-
const { type, data, selected, id, dragging, width, height } = props;
|
|
44
|
+
const { type, data, selected, id, dragging, width, height, parentId } = props;
|
|
45
45
|
const { onHandleAction: onHandleActionProp, shouldShowAddButtonFn: shouldShowAddButtonFnProp, shouldShowButtonHandleNotchesFn: shouldShowButtonHandleNotchesFnProp, toolbarConfig: toolbarConfigProp, handleConfigurations: handleConfigurationsProp, adornments: adornmentsProp, suggestionType, disabled, executionStatusOverride, labelTooltip, labelBackgroundColor, footerVariant, footerComponent, subLabelComponent, iconComponent } = useBaseNodeOverrideConfig();
|
|
46
46
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
47
47
|
const { updateNodeData, updateNode } = useReactFlow();
|
|
@@ -312,7 +312,8 @@ const BaseNodeComponent = (props)=>{
|
|
|
312
312
|
showNotches,
|
|
313
313
|
nodeWidth: width,
|
|
314
314
|
nodeHeight: height,
|
|
315
|
-
shouldShowAddButtonFn
|
|
315
|
+
shouldShowAddButtonFn,
|
|
316
|
+
portalActions: !!parentId
|
|
316
317
|
});
|
|
317
318
|
const smartHandleElements = useMemo(()=>{
|
|
318
319
|
if (!useSmartHandles) return null;
|
|
@@ -32,12 +32,13 @@ const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
33
|
const CanvasEventBus_cjs_namespaceObject = require("../../utils/CanvasEventBus.cjs");
|
|
34
34
|
const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
|
|
35
|
+
const external_ButtonHandleLayoutUtils_cjs_namespaceObject = require("./ButtonHandleLayoutUtils.cjs");
|
|
35
36
|
const external_ButtonHandleStyleUtils_cjs_namespaceObject = require("./ButtonHandleStyleUtils.cjs");
|
|
36
37
|
const external_HandleButton_cjs_namespaceObject = require("./HandleButton.cjs");
|
|
37
38
|
const external_HandleLabel_cjs_namespaceObject = require("./HandleLabel.cjs");
|
|
38
39
|
const external_HandleNotch_cjs_namespaceObject = require("./HandleNotch.cjs");
|
|
39
40
|
const external_useButtonHandleSizeAndPosition_cjs_namespaceObject = require("./useButtonHandleSizeAndPosition.cjs");
|
|
40
|
-
const ButtonHandleBase = ({ id, nodeId, type, position, handleType, label, labelIcon, labelBackgroundColor, visible = true, showButton = true, selected = false, index = 0, total = 1, onAction, showNotches = true, customPositionAndOffsets, nodeWidth, nodeHeight })=>{
|
|
41
|
+
const ButtonHandleBase = ({ id, nodeId, type, position, connectionPosition = position, handleType, label, labelIcon, labelBackgroundColor, visible = true, showButton = true, selected = false, index = 0, total = 1, onAction, showNotches = true, customPositionAndOffsets, nodeWidth, nodeHeight, portalAction = false })=>{
|
|
41
42
|
const handleRef = (0, external_react_namespaceObject.useRef)(null);
|
|
42
43
|
const [isHovered, setIsHovered] = (0, external_react_namespaceObject.useState)(false);
|
|
43
44
|
const isVertical = position === react_cjs_namespaceObject.Position.Top || position === react_cjs_namespaceObject.Position.Bottom;
|
|
@@ -62,7 +63,7 @@ const ButtonHandleBase = ({ id, nodeId, type, position, handleType, label, label
|
|
|
62
63
|
handleId: id,
|
|
63
64
|
nodeId,
|
|
64
65
|
handleType,
|
|
65
|
-
position,
|
|
66
|
+
position: connectionPosition,
|
|
66
67
|
originalEvent: event
|
|
67
68
|
};
|
|
68
69
|
onAction?.(actionEvent);
|
|
@@ -70,23 +71,79 @@ const ButtonHandleBase = ({ id, nodeId, type, position, handleType, label, label
|
|
|
70
71
|
handleId: id,
|
|
71
72
|
nodeId,
|
|
72
73
|
handleType,
|
|
73
|
-
position
|
|
74
|
+
position: connectionPosition
|
|
74
75
|
});
|
|
75
76
|
}, [
|
|
77
|
+
connectionPosition,
|
|
76
78
|
id,
|
|
77
79
|
nodeId,
|
|
78
80
|
handleType,
|
|
79
|
-
position,
|
|
80
81
|
onAction
|
|
81
82
|
]);
|
|
82
83
|
const markAsHovered = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(true), []);
|
|
83
84
|
const unmarkAsHovered = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(false), []);
|
|
85
|
+
const showActionButton = !!onAction && 'source' === type;
|
|
84
86
|
const { width: handleWidth, height: handleHeight, top, bottom, left, right, transform } = (0, external_useButtonHandleSizeAndPosition_cjs_namespaceObject.useButtonHandleSizeAndPosition)({
|
|
85
87
|
position,
|
|
86
88
|
positionPercent,
|
|
87
89
|
numHandles: total,
|
|
88
90
|
customPositionAndOffsets
|
|
89
91
|
});
|
|
92
|
+
if (connectionPosition !== position) {
|
|
93
|
+
const layout = (0, external_ButtonHandleLayoutUtils_cjs_namespaceObject.getInwardHandleLayout)(position, handleType);
|
|
94
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
95
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('absolute flex overflow-visible', visible ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'),
|
|
96
|
+
style: {
|
|
97
|
+
top,
|
|
98
|
+
bottom,
|
|
99
|
+
left,
|
|
100
|
+
right,
|
|
101
|
+
transform: layout.rootTransform
|
|
102
|
+
},
|
|
103
|
+
onMouseEnter: markAsHovered,
|
|
104
|
+
onMouseLeave: unmarkAsHovered,
|
|
105
|
+
onMouseDown: unmarkAsHovered,
|
|
106
|
+
children: [
|
|
107
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InwardHandleContent, {
|
|
108
|
+
handleType: handleType,
|
|
109
|
+
isVertical: isVertical,
|
|
110
|
+
selected: selected,
|
|
111
|
+
hovered: isHovered,
|
|
112
|
+
showNotch: showNotches,
|
|
113
|
+
label: label,
|
|
114
|
+
labelIcon: labelIcon,
|
|
115
|
+
labelBackgroundColor: labelBackgroundColor,
|
|
116
|
+
layout: layout
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Handle, {
|
|
119
|
+
ref: handleRef,
|
|
120
|
+
type: type,
|
|
121
|
+
position: connectionPosition,
|
|
122
|
+
id: id,
|
|
123
|
+
onMouseEnter: markAsHovered,
|
|
124
|
+
onMouseLeave: unmarkAsHovered,
|
|
125
|
+
onMouseDown: unmarkAsHovered,
|
|
126
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('absolute! z-20 flex! items-center! justify-center! overflow-visible! border-0! rounded-none! bg-transparent!', visible ? 'cursor-crosshair! pointer-events-auto! opacity-100' : 'cursor-default! pointer-events-none! opacity-0'),
|
|
127
|
+
style: layout.anchorStyle
|
|
128
|
+
}),
|
|
129
|
+
showActionButton ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleButton_cjs_namespaceObject.HandleButton, {
|
|
130
|
+
visible: showButton,
|
|
131
|
+
labelVisible: visible,
|
|
132
|
+
position: connectionPosition,
|
|
133
|
+
onAction: handleButtonClick,
|
|
134
|
+
handleRef: handleRef
|
|
135
|
+
}) : null
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const portal = showActionButton && portalAction && !customPositionAndOffsets ? (0, external_ButtonHandleLayoutUtils_cjs_namespaceObject.getHandleActionPortal)({
|
|
140
|
+
nodeId,
|
|
141
|
+
position,
|
|
142
|
+
positionPercent,
|
|
143
|
+
total,
|
|
144
|
+
nodeWidth,
|
|
145
|
+
nodeHeight
|
|
146
|
+
}) : void 0;
|
|
90
147
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_cjs_namespaceObject.Handle, {
|
|
91
148
|
ref: handleRef,
|
|
92
149
|
type: type,
|
|
@@ -113,7 +170,7 @@ const ButtonHandleBase = ({ id, nodeId, type, position, handleType, label, label
|
|
|
113
170
|
hovered: isHovered,
|
|
114
171
|
showNotch: showNotches
|
|
115
172
|
}),
|
|
116
|
-
|
|
173
|
+
showActionButton ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleButton_cjs_namespaceObject.HandleButton, {
|
|
117
174
|
visible: showButton,
|
|
118
175
|
labelVisible: visible,
|
|
119
176
|
position: position,
|
|
@@ -121,7 +178,8 @@ const ButtonHandleBase = ({ id, nodeId, type, position, handleType, label, label
|
|
|
121
178
|
handleRef: handleRef,
|
|
122
179
|
label: label,
|
|
123
180
|
labelIcon: labelIcon,
|
|
124
|
-
labelBackgroundColor: labelBackgroundColor
|
|
181
|
+
labelBackgroundColor: labelBackgroundColor,
|
|
182
|
+
portal: portal
|
|
125
183
|
}) : label && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleLabel_cjs_namespaceObject.HandleLabel, {
|
|
126
184
|
position: position,
|
|
127
185
|
backgroundColor: labelBackgroundColor,
|
|
@@ -132,7 +190,39 @@ const ButtonHandleBase = ({ id, nodeId, type, position, handleType, label, label
|
|
|
132
190
|
});
|
|
133
191
|
};
|
|
134
192
|
const ButtonHandle = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(ButtonHandleBase);
|
|
135
|
-
|
|
193
|
+
function InwardHandleContent({ handleType, isVertical, selected, hovered, showNotch, label, labelIcon, labelBackgroundColor, layout }) {
|
|
194
|
+
const labelElement = label ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
195
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('pointer-events-none flex items-center gap-1.5 whitespace-nowrap rounded-full border border-border-subtle bg-transparent px-2 py-0.5', 'text-xs font-medium leading-4 text-foreground-muted'),
|
|
196
|
+
style: labelBackgroundColor ? {
|
|
197
|
+
backgroundColor: labelBackgroundColor
|
|
198
|
+
} : void 0,
|
|
199
|
+
children: [
|
|
200
|
+
labelIcon,
|
|
201
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
202
|
+
children: label
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
}) : null;
|
|
206
|
+
const notchElement = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
207
|
+
className: "relative z-10 flex shrink-0",
|
|
208
|
+
style: layout.notchStyle,
|
|
209
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleNotch_cjs_namespaceObject.HandleNotch, {
|
|
210
|
+
handleType: handleType,
|
|
211
|
+
isVertical: isVertical,
|
|
212
|
+
selected: selected,
|
|
213
|
+
hovered: hovered,
|
|
214
|
+
showNotch: showNotch
|
|
215
|
+
})
|
|
216
|
+
});
|
|
217
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
218
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('flex items-center', layout.contentDirectionClassName),
|
|
219
|
+
children: [
|
|
220
|
+
labelElement,
|
|
221
|
+
notchElement
|
|
222
|
+
]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
const ButtonHandlesBase = ({ nodeId, handles, position, connectionPosition = position, selected = false, hovered = false, visible = true, showAddButton = true, showNotches = true, customPositionAndOffsets, shouldShowAddButtonFn = ({ showAddButton, selected, hovered })=>showAddButton && (selected || hovered), nodeWidth, nodeHeight, portalActions = false })=>{
|
|
136
226
|
const finalSelected = shouldShowAddButtonFn({
|
|
137
227
|
showAddButton,
|
|
138
228
|
selected,
|
|
@@ -143,14 +233,17 @@ const ButtonHandlesBase = ({ nodeId, handles, position, selected = false, hovere
|
|
|
143
233
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
144
234
|
children: [
|
|
145
235
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleButton_cjs_namespaceObject.HandleHoverBridge, {
|
|
146
|
-
position:
|
|
236
|
+
position: connectionPosition,
|
|
147
237
|
visible: hasSourceButtons && finalSelected
|
|
148
238
|
}),
|
|
149
|
-
visibleHandles.map((handle, index)
|
|
239
|
+
visibleHandles.map((handle, index)=>{
|
|
240
|
+
const handleVisible = handle.showHandle ?? visible;
|
|
241
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ButtonHandle, {
|
|
150
242
|
id: handle.id,
|
|
151
243
|
nodeId: nodeId,
|
|
152
244
|
type: handle.type,
|
|
153
245
|
position: position,
|
|
246
|
+
connectionPosition: connectionPosition,
|
|
154
247
|
handleType: handle.handleType,
|
|
155
248
|
label: handle.label,
|
|
156
249
|
labelIcon: handle.labelIcon,
|
|
@@ -158,14 +251,16 @@ const ButtonHandlesBase = ({ nodeId, handles, position, selected = false, hovere
|
|
|
158
251
|
index: index,
|
|
159
252
|
total: visibleHandles.length,
|
|
160
253
|
selected: selected,
|
|
161
|
-
visible:
|
|
162
|
-
showButton: finalSelected &&
|
|
254
|
+
visible: handleVisible,
|
|
255
|
+
showButton: finalSelected && handleVisible && handle.showButton,
|
|
163
256
|
onAction: handle.onAction,
|
|
164
257
|
showNotches: showNotches,
|
|
165
258
|
customPositionAndOffsets: customPositionAndOffsets,
|
|
166
259
|
nodeWidth: nodeWidth,
|
|
167
|
-
nodeHeight: nodeHeight
|
|
168
|
-
|
|
260
|
+
nodeHeight: nodeHeight,
|
|
261
|
+
portalAction: portalActions && 'source' === handle.type
|
|
262
|
+
}, handle.id);
|
|
263
|
+
})
|
|
169
264
|
]
|
|
170
265
|
});
|
|
171
266
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Position } from '../../xyflow/react.ts';
|
|
2
2
|
import type { HandleConfigurationSpecificPosition } from '../../schema/node-definition/handle';
|
|
3
|
+
import { type HandleType } from './HandleNotch';
|
|
3
4
|
export interface HandleActionEvent {
|
|
4
5
|
handleId: string;
|
|
5
6
|
nodeId: string;
|
|
6
|
-
handleType:
|
|
7
|
+
handleType: HandleType;
|
|
7
8
|
position: Position;
|
|
8
9
|
originalEvent: React.MouseEvent;
|
|
9
10
|
}
|
|
@@ -12,7 +13,8 @@ type ButtonHandleProps = {
|
|
|
12
13
|
nodeId: string;
|
|
13
14
|
type: 'source' | 'target';
|
|
14
15
|
position: Position;
|
|
15
|
-
|
|
16
|
+
connectionPosition?: Position;
|
|
17
|
+
handleType: HandleType;
|
|
16
18
|
label?: string;
|
|
17
19
|
labelIcon?: React.ReactNode;
|
|
18
20
|
labelBackgroundColor?: string;
|
|
@@ -26,12 +28,13 @@ type ButtonHandleProps = {
|
|
|
26
28
|
customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
27
29
|
nodeWidth?: number;
|
|
28
30
|
nodeHeight?: number;
|
|
31
|
+
portalAction?: boolean;
|
|
29
32
|
};
|
|
30
|
-
export declare const ButtonHandle: import("react").MemoExoticComponent<({ id, nodeId, type, position, handleType, label, labelIcon, labelBackgroundColor, visible, showButton, selected, index, total, onAction, showNotches, customPositionAndOffsets, nodeWidth, nodeHeight, }: ButtonHandleProps) => import("react/jsx-runtime").JSX.Element>;
|
|
33
|
+
export declare const ButtonHandle: import("react").MemoExoticComponent<({ id, nodeId, type, position, connectionPosition, handleType, label, labelIcon, labelBackgroundColor, visible, showButton, selected, index, total, onAction, showNotches, customPositionAndOffsets, nodeWidth, nodeHeight, portalAction, }: ButtonHandleProps) => import("react/jsx-runtime").JSX.Element>;
|
|
31
34
|
export interface ButtonHandleConfig {
|
|
32
35
|
id: string;
|
|
33
36
|
type: 'source' | 'target';
|
|
34
|
-
handleType:
|
|
37
|
+
handleType: HandleType;
|
|
35
38
|
label?: string;
|
|
36
39
|
labelIcon?: React.ReactNode;
|
|
37
40
|
showButton?: boolean;
|
|
@@ -41,10 +44,11 @@ export interface ButtonHandleConfig {
|
|
|
41
44
|
onAction?: (event: HandleActionEvent) => void;
|
|
42
45
|
customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
43
46
|
}
|
|
44
|
-
export declare const ButtonHandles: import("react").MemoExoticComponent<({ nodeId, handles, position, selected, hovered, visible, showAddButton, showNotches, customPositionAndOffsets, shouldShowAddButtonFn, nodeWidth, nodeHeight, }: {
|
|
47
|
+
export declare const ButtonHandles: import("react").MemoExoticComponent<({ nodeId, handles, position, connectionPosition, selected, hovered, visible, showAddButton, showNotches, customPositionAndOffsets, shouldShowAddButtonFn, nodeWidth, nodeHeight, portalActions, }: {
|
|
45
48
|
nodeId: string;
|
|
46
49
|
handles: ButtonHandleConfig[];
|
|
47
50
|
position: Position;
|
|
51
|
+
connectionPosition?: Position;
|
|
48
52
|
selected?: boolean;
|
|
49
53
|
hovered?: boolean;
|
|
50
54
|
visible?: boolean;
|
|
@@ -53,6 +57,7 @@ export declare const ButtonHandles: import("react").MemoExoticComponent<({ nodeI
|
|
|
53
57
|
customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
54
58
|
nodeWidth?: number;
|
|
55
59
|
nodeHeight?: number;
|
|
60
|
+
portalActions?: boolean;
|
|
56
61
|
shouldShowAddButtonFn?: ({ showAddButton, selected, hovered, }: {
|
|
57
62
|
showAddButton: boolean;
|
|
58
63
|
selected: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonHandle.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ButtonHandle/ButtonHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonHandle.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ButtonHandle/ButtonHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAW/F,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,U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