@uipath/apollo-react 4.14.1-pr556.aa710a0 → 4.15.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/createAddNodePreview.cjs +3 -9
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.js +3 -9
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +0 -1
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.cjs +5 -11
- package/dist/canvas/components/BaseNode/BaseNode.d.ts +1 -2
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +6 -9
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts +0 -3
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +13 -222
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts +5 -10
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +14 -223
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +2 -10
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts +0 -2
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +3 -5
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +2 -17
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts +1 -10
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/HandleButton.js +2 -17
- package/dist/canvas/components/ButtonHandle/useButtonHandles.cjs +2 -4
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts +1 -2
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.js +2 -4
- package/dist/canvas/components/Edges/SequenceEdge.cjs +14 -16
- package/dist/canvas/components/Edges/SequenceEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/SequenceEdge.js +14 -16
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +25 -34
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts +2 -8
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +27 -36
- package/dist/canvas/components/HierarchicalCanvas/index.d.ts +1 -1
- package/dist/canvas/components/HierarchicalCanvas/index.d.ts.map +1 -1
- 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 +23 -25
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.js +25 -27
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.cjs +3 -10
- 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 +3 -10
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts +0 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts.map +1 -1
- package/dist/canvas/components/index.cjs +20 -27
- package/dist/canvas/components/index.d.ts +0 -1
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +0 -1
- package/dist/canvas/constants.cjs +0 -4
- package/dist/canvas/constants.d.ts +0 -1
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +1 -2
- package/dist/canvas/core/NodeTypeRegistry.cjs +26 -50
- package/dist/canvas/core/NodeTypeRegistry.d.ts +5 -10
- package/dist/canvas/core/NodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/NodeTypeRegistry.js +26 -50
- package/dist/canvas/core/useNodeTypeRegistry.cjs +3 -13
- package/dist/canvas/core/useNodeTypeRegistry.d.ts +1 -2
- package/dist/canvas/core/useNodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/useNodeTypeRegistry.js +4 -11
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.cjs +23 -22
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.d.ts.map +1 -1
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.js +24 -23
- package/dist/canvas/hooks/usePreviewNode.cjs +3 -7
- package/dist/canvas/hooks/usePreviewNode.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.js +3 -7
- package/dist/canvas/schema/node-definition/handle.cjs +2 -10
- package/dist/canvas/schema/node-definition/handle.d.ts +0 -9
- package/dist/canvas/schema/node-definition/handle.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/handle.js +1 -6
- package/dist/canvas/schema/node-definition/index.cjs +1 -4
- 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.d.ts +0 -4
- package/dist/canvas/schema/node-definition/node-manifest.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/hooks/useCanvasStory.d.ts +0 -6
- package/dist/canvas/storybook-utils/hooks/useCanvasStory.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts +0 -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/storybook-utils/mocks/nodes.d.ts +1 -1
- package/dist/canvas/storybook-utils/mocks/nodes.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/collapse.cjs +6 -13
- package/dist/canvas/utils/collapse.d.ts +2 -2
- package/dist/canvas/utils/collapse.d.ts.map +1 -1
- package/dist/canvas/utils/collapse.js +2 -9
- package/dist/canvas/utils/createPreviewNode.cjs +11 -30
- package/dist/canvas/utils/createPreviewNode.d.ts +2 -10
- package/dist/canvas/utils/createPreviewNode.d.ts.map +1 -1
- package/dist/canvas/utils/createPreviewNode.js +11 -21
- package/dist/canvas/utils/index.cjs +26 -33
- package/dist/canvas/utils/index.d.ts +1 -2
- package/dist/canvas/utils/index.d.ts.map +1 -1
- package/dist/canvas/utils/index.js +1 -2
- package/dist/canvas/utils/manifest-resolver.cjs +0 -8
- package/dist/canvas/utils/manifest-resolver.d.ts +0 -1
- package/dist/canvas/utils/manifest-resolver.d.ts.map +1 -1
- package/dist/canvas/utils/manifest-resolver.js +1 -6
- package/package.json +1 -1
- package/dist/canvas/components/LoopNode/LoopCanvasNode.cjs +0 -86
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts +0 -6
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopCanvasNode.js +0 -52
- package/dist/canvas/components/LoopNode/LoopNode.cjs +0 -434
- package/dist/canvas/components/LoopNode/LoopNode.constants.cjs +0 -81
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts +0 -13
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.constants.js +0 -14
- package/dist/canvas/components/LoopNode/LoopNode.d.ts +0 -5
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.cjs +0 -144
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts +0 -29
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +0 -98
- package/dist/canvas/components/LoopNode/LoopNode.js +0 -400
- package/dist/canvas/components/LoopNode/LoopNode.types.cjs +0 -18
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +0 -22
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.types.js +0 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.cjs +0 -61
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts +0 -9
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNodePreview.js +0 -27
- package/dist/canvas/components/LoopNode/index.cjs +0 -79
- package/dist/canvas/components/LoopNode/index.d.ts +0 -5
- package/dist/canvas/components/LoopNode/index.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/index.js +0 -4
- package/dist/canvas/components/NodeViewportOverlay.cjs +0 -63
- package/dist/canvas/components/NodeViewportOverlay.d.ts +0 -22
- package/dist/canvas/components/NodeViewportOverlay.d.ts.map +0 -1
- package/dist/canvas/components/NodeViewportOverlay.js +0 -29
- package/dist/canvas/utils/createPreviewGraph.cjs +0 -126
- package/dist/canvas/utils/createPreviewGraph.d.ts +0 -36
- package/dist/canvas/utils/createPreviewGraph.d.ts.map +0 -1
- package/dist/canvas/utils/createPreviewGraph.js +0 -83
|
@@ -27,16 +27,10 @@ __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 createPreviewNode_cjs_namespaceObject = require("../../utils/createPreviewNode.cjs");
|
|
31
31
|
function createAddNodePreview(sourceNodeId, sourceHandleId, reactFlowInstance, handlePosition = react_cjs_namespaceObject.Position.Right, sourceHandleType = 'source', ignoredNodeTypes = []) {
|
|
32
|
-
(0,
|
|
33
|
-
|
|
34
|
-
sourceHandleId,
|
|
35
|
-
reactFlowInstance,
|
|
36
|
-
sourceHandleType,
|
|
37
|
-
handlePosition,
|
|
38
|
-
ignoredNodeTypes
|
|
39
|
-
});
|
|
32
|
+
const preview = (0, createPreviewNode_cjs_namespaceObject.createPreviewNode)(sourceNodeId, sourceHandleId, reactFlowInstance, void 0, void 0, sourceHandleType, void 0, handlePosition, ignoredNodeTypes);
|
|
33
|
+
if (preview) (0, createPreviewNode_cjs_namespaceObject.applyPreviewToReactFlow)(preview, reactFlowInstance);
|
|
40
34
|
}
|
|
41
35
|
exports.createAddNodePreview = __webpack_exports__.createAddNodePreview;
|
|
42
36
|
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,CAiBN"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Position } from "../../xyflow/react.js";
|
|
2
|
-
import {
|
|
2
|
+
import { applyPreviewToReactFlow, createPreviewNode } from "../../utils/createPreviewNode.js";
|
|
3
3
|
function createAddNodePreview(sourceNodeId, sourceHandleId, reactFlowInstance, handlePosition = Position.Right, sourceHandleType = 'source', ignoredNodeTypes = []) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
sourceHandleId,
|
|
7
|
-
reactFlowInstance,
|
|
8
|
-
sourceHandleType,
|
|
9
|
-
handlePosition,
|
|
10
|
-
ignoredNodeTypes
|
|
11
|
-
});
|
|
4
|
+
const preview = createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, void 0, void 0, sourceHandleType, void 0, handlePosition, ignoredNodeTypes);
|
|
5
|
+
if (preview) applyPreviewToReactFlow(preview, reactFlowInstance);
|
|
12
6
|
}
|
|
13
7
|
export { createAddNodePreview };
|
|
@@ -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"}
|
|
@@ -24,7 +24,6 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
selectIsConnecting: ()=>selectIsConnecting,
|
|
28
27
|
BaseNode: ()=>BaseNode
|
|
29
28
|
});
|
|
30
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
@@ -70,8 +69,7 @@ const getContainerHeight = (height, hasFooter, footerVariant)=>{
|
|
|
70
69
|
return height || external_constants_cjs_namespaceObject.NODE_HEIGHT_DEFAULT;
|
|
71
70
|
};
|
|
72
71
|
const BaseNodeComponent = (props)=>{
|
|
73
|
-
const { type, data, selected, id, dragging, width, height
|
|
74
|
-
const nodeVersion = (0, manifest_resolver_cjs_namespaceObject.getNodeTypeVersion)(data);
|
|
72
|
+
const { type, data, selected, id, dragging, width, height } = props;
|
|
75
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)();
|
|
76
74
|
const updateNodeInternals = (0, react_cjs_namespaceObject.useUpdateNodeInternals)();
|
|
77
75
|
const { updateNodeData, updateNode } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
@@ -89,10 +87,9 @@ const BaseNodeComponent = (props)=>{
|
|
|
89
87
|
const isConnecting = (0, react_cjs_namespaceObject.useStore)(selectIsConnecting);
|
|
90
88
|
const { multipleNodesSelected } = (0, SelectionStateContext_cjs_namespaceObject.useSelectionState)();
|
|
91
89
|
const { isDarkMode } = (0, CanvasThemeContext_cjs_namespaceObject.useCanvasTheme)();
|
|
92
|
-
const manifest = (0, external_react_namespaceObject.useMemo)(()=>nodeTypeRegistry.getManifest(type
|
|
90
|
+
const manifest = (0, external_react_namespaceObject.useMemo)(()=>nodeTypeRegistry.getManifest(type), [
|
|
93
91
|
type,
|
|
94
|
-
nodeTypeRegistry
|
|
95
|
-
nodeVersion
|
|
92
|
+
nodeTypeRegistry
|
|
96
93
|
]);
|
|
97
94
|
const statusContext = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
98
95
|
nodeId: id,
|
|
@@ -343,8 +340,7 @@ const BaseNodeComponent = (props)=>{
|
|
|
343
340
|
showNotches,
|
|
344
341
|
nodeWidth: width,
|
|
345
342
|
nodeHeight: height,
|
|
346
|
-
shouldShowAddButtonFn
|
|
347
|
-
portalActions: !!parentId
|
|
343
|
+
shouldShowAddButtonFn
|
|
348
344
|
});
|
|
349
345
|
const smartHandleElements = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
350
346
|
if (!useSmartHandles) return null;
|
|
@@ -489,10 +485,8 @@ const BaseNodeComponent = (props)=>{
|
|
|
489
485
|
};
|
|
490
486
|
const BaseNode = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(BaseNodeComponent);
|
|
491
487
|
exports.BaseNode = __webpack_exports__.BaseNode;
|
|
492
|
-
exports.selectIsConnecting = __webpack_exports__.selectIsConnecting;
|
|
493
488
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
494
|
-
"BaseNode"
|
|
495
|
-
"selectIsConnecting"
|
|
489
|
+
"BaseNode"
|
|
496
490
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
497
491
|
Object.defineProperty(exports, '__esModule', {
|
|
498
492
|
value: true
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Node, NodeProps
|
|
1
|
+
import type { Node, NodeProps } from '../../xyflow/react.ts';
|
|
2
2
|
import type { BaseNodeData } from './BaseNode.types';
|
|
3
|
-
export declare const selectIsConnecting: (state: ReactFlowState) => boolean;
|
|
4
3
|
export declare const BaseNode: import("react").MemoExoticComponent<(props: NodeProps<Node<BaseNodeData>>) => import("react/jsx-runtime").JSX.Element>;
|
|
5
4
|
//# sourceMappingURL=BaseNode.d.ts.map
|
|
@@ -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,EAAkB,MAAM,0CAA0C,CAAC;AAsChG,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AA+nB1B,eAAO,MAAM,QAAQ,8CAllBa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CAklBhB,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { useNodeTypeRegistry } from "../../core/index.js";
|
|
|
6
6
|
import { useElementValidationStatus, useNodeExecutionState } from "../../hooks/index.js";
|
|
7
7
|
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
8
8
|
import { getIcon } from "../../utils/icon-registry.js";
|
|
9
|
-
import {
|
|
9
|
+
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
10
10
|
import { resolveToolbar } from "../../utils/toolbar-resolver.js";
|
|
11
11
|
import { useBaseCanvasMode } from "../BaseCanvas/BaseCanvasModeProvider.js";
|
|
12
12
|
import { useCanvasTheme } from "../BaseCanvas/CanvasThemeContext.js";
|
|
@@ -41,8 +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
|
|
45
|
-
const nodeVersion = getNodeTypeVersion(data);
|
|
44
|
+
const { type, data, selected, id, dragging, width, height } = props;
|
|
46
45
|
const { onHandleAction: onHandleActionProp, shouldShowAddButtonFn: shouldShowAddButtonFnProp, shouldShowButtonHandleNotchesFn: shouldShowButtonHandleNotchesFnProp, toolbarConfig: toolbarConfigProp, handleConfigurations: handleConfigurationsProp, adornments: adornmentsProp, suggestionType, disabled, executionStatusOverride, labelTooltip, labelBackgroundColor, footerVariant, footerComponent, subLabelComponent, iconComponent } = useBaseNodeOverrideConfig();
|
|
47
46
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
48
47
|
const { updateNodeData, updateNode } = useReactFlow();
|
|
@@ -60,10 +59,9 @@ const BaseNodeComponent = (props)=>{
|
|
|
60
59
|
const isConnecting = useStore(selectIsConnecting);
|
|
61
60
|
const { multipleNodesSelected } = useSelectionState();
|
|
62
61
|
const { isDarkMode } = useCanvasTheme();
|
|
63
|
-
const manifest = useMemo(()=>nodeTypeRegistry.getManifest(type
|
|
62
|
+
const manifest = useMemo(()=>nodeTypeRegistry.getManifest(type), [
|
|
64
63
|
type,
|
|
65
|
-
nodeTypeRegistry
|
|
66
|
-
nodeVersion
|
|
64
|
+
nodeTypeRegistry
|
|
67
65
|
]);
|
|
68
66
|
const statusContext = useMemo(()=>({
|
|
69
67
|
nodeId: id,
|
|
@@ -314,8 +312,7 @@ const BaseNodeComponent = (props)=>{
|
|
|
314
312
|
showNotches,
|
|
315
313
|
nodeWidth: width,
|
|
316
314
|
nodeHeight: height,
|
|
317
|
-
shouldShowAddButtonFn
|
|
318
|
-
portalActions: !!parentId
|
|
315
|
+
shouldShowAddButtonFn
|
|
319
316
|
});
|
|
320
317
|
const smartHandleElements = useMemo(()=>{
|
|
321
318
|
if (!useSmartHandles) return null;
|
|
@@ -459,4 +456,4 @@ const BaseNodeComponent = (props)=>{
|
|
|
459
456
|
return nodeContent;
|
|
460
457
|
};
|
|
461
458
|
const BaseNode = /*#__PURE__*/ memo(BaseNodeComponent);
|
|
462
|
-
export { BaseNode
|
|
459
|
+
export { BaseNode };
|
|
@@ -3,9 +3,6 @@ import type { ExecutionState } from '../../types/execution';
|
|
|
3
3
|
import type { ValidationState } from '../../types/validation';
|
|
4
4
|
export type FooterVariant = 'none' | 'button' | 'single' | 'double';
|
|
5
5
|
export interface BaseNodeData extends Record<string, unknown> {
|
|
6
|
-
nodeType?: string;
|
|
7
|
-
typeVersion?: string;
|
|
8
|
-
parameters?: Record<string, unknown>;
|
|
9
6
|
display?: {
|
|
10
7
|
label?: string;
|
|
11
8
|
subLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNode.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,
|
|
1
|
+
{"version":3,"file":"BaseNode.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAOF,eAAe,CAAC,EAAE,OAAO,CAAC;IAM1B,WAAW,CAAC,EAAE,OAAO,CAAC;IAOtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -30,7 +30,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
31
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
34
33
|
const CanvasEventBus_cjs_namespaceObject = require("../../utils/CanvasEventBus.cjs");
|
|
35
34
|
const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
|
|
36
35
|
const external_ButtonHandleStyleUtils_cjs_namespaceObject = require("./ButtonHandleStyleUtils.cjs");
|
|
@@ -38,14 +37,7 @@ const external_HandleButton_cjs_namespaceObject = require("./HandleButton.cjs");
|
|
|
38
37
|
const external_HandleLabel_cjs_namespaceObject = require("./HandleLabel.cjs");
|
|
39
38
|
const external_HandleNotch_cjs_namespaceObject = require("./HandleNotch.cjs");
|
|
40
39
|
const external_useButtonHandleSizeAndPosition_cjs_namespaceObject = require("./useButtonHandleSizeAndPosition.cjs");
|
|
41
|
-
const
|
|
42
|
-
const INWARD_HANDLE_ANCHOR_RADIUS_PX = INWARD_HANDLE_ANCHOR_SIZE_PX / 2;
|
|
43
|
-
const INWARD_NOTCH_OVERLAP_PX = {
|
|
44
|
-
artifact: 5,
|
|
45
|
-
input: 4,
|
|
46
|
-
output: 6
|
|
47
|
-
};
|
|
48
|
-
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 })=>{
|
|
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 })=>{
|
|
49
41
|
const handleRef = (0, external_react_namespaceObject.useRef)(null);
|
|
50
42
|
const [isHovered, setIsHovered] = (0, external_react_namespaceObject.useState)(false);
|
|
51
43
|
const isVertical = position === react_cjs_namespaceObject.Position.Top || position === react_cjs_namespaceObject.Position.Bottom;
|
|
@@ -70,7 +62,7 @@ const ButtonHandleBase = ({ id, nodeId, type, position, connectionPosition = pos
|
|
|
70
62
|
handleId: id,
|
|
71
63
|
nodeId,
|
|
72
64
|
handleType,
|
|
73
|
-
position
|
|
65
|
+
position,
|
|
74
66
|
originalEvent: event
|
|
75
67
|
};
|
|
76
68
|
onAction?.(actionEvent);
|
|
@@ -78,83 +70,23 @@ const ButtonHandleBase = ({ id, nodeId, type, position, connectionPosition = pos
|
|
|
78
70
|
handleId: id,
|
|
79
71
|
nodeId,
|
|
80
72
|
handleType,
|
|
81
|
-
position
|
|
73
|
+
position
|
|
82
74
|
});
|
|
83
75
|
}, [
|
|
84
|
-
connectionPosition,
|
|
85
76
|
id,
|
|
86
77
|
nodeId,
|
|
87
78
|
handleType,
|
|
79
|
+
position,
|
|
88
80
|
onAction
|
|
89
81
|
]);
|
|
90
82
|
const markAsHovered = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(true), []);
|
|
91
83
|
const unmarkAsHovered = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(false), []);
|
|
92
|
-
const showActionButton = !!onAction && 'source' === type;
|
|
93
84
|
const { width: handleWidth, height: handleHeight, top, bottom, left, right, transform } = (0, external_useButtonHandleSizeAndPosition_cjs_namespaceObject.useButtonHandleSizeAndPosition)({
|
|
94
85
|
position,
|
|
95
86
|
positionPercent,
|
|
96
87
|
numHandles: total,
|
|
97
88
|
customPositionAndOffsets
|
|
98
89
|
});
|
|
99
|
-
if (connectionPosition !== position) {
|
|
100
|
-
const layout = getInwardHandleLayout(position, handleType);
|
|
101
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
102
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('absolute flex overflow-visible', visible ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'),
|
|
103
|
-
style: {
|
|
104
|
-
top,
|
|
105
|
-
bottom,
|
|
106
|
-
left,
|
|
107
|
-
right,
|
|
108
|
-
transform: layout.rootTransform
|
|
109
|
-
},
|
|
110
|
-
onMouseEnter: markAsHovered,
|
|
111
|
-
onMouseLeave: unmarkAsHovered,
|
|
112
|
-
onMouseDown: unmarkAsHovered,
|
|
113
|
-
children: [
|
|
114
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InwardHandleContent, {
|
|
115
|
-
handleType: handleType,
|
|
116
|
-
isVertical: isVertical,
|
|
117
|
-
selected: selected,
|
|
118
|
-
hovered: isHovered,
|
|
119
|
-
showNotch: showNotches,
|
|
120
|
-
label: label,
|
|
121
|
-
labelIcon: labelIcon,
|
|
122
|
-
labelBackgroundColor: labelBackgroundColor,
|
|
123
|
-
layout: layout
|
|
124
|
-
}),
|
|
125
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Handle, {
|
|
126
|
-
ref: handleRef,
|
|
127
|
-
type: type,
|
|
128
|
-
position: connectionPosition,
|
|
129
|
-
id: id,
|
|
130
|
-
onMouseEnter: markAsHovered,
|
|
131
|
-
onMouseLeave: unmarkAsHovered,
|
|
132
|
-
onMouseDown: unmarkAsHovered,
|
|
133
|
-
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'),
|
|
134
|
-
style: {
|
|
135
|
-
...layout.anchorStyle,
|
|
136
|
-
width: INWARD_HANDLE_ANCHOR_SIZE_PX,
|
|
137
|
-
height: INWARD_HANDLE_ANCHOR_SIZE_PX
|
|
138
|
-
}
|
|
139
|
-
}),
|
|
140
|
-
showActionButton ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleButton_cjs_namespaceObject.HandleButton, {
|
|
141
|
-
visible: showButton,
|
|
142
|
-
labelVisible: visible,
|
|
143
|
-
position: connectionPosition,
|
|
144
|
-
onAction: handleButtonClick,
|
|
145
|
-
handleRef: handleRef
|
|
146
|
-
}) : null
|
|
147
|
-
]
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
const portal = showActionButton && portalAction && !customPositionAndOffsets ? getHandleActionPortal({
|
|
151
|
-
nodeId,
|
|
152
|
-
position,
|
|
153
|
-
positionPercent,
|
|
154
|
-
total,
|
|
155
|
-
nodeWidth,
|
|
156
|
-
nodeHeight
|
|
157
|
-
}) : void 0;
|
|
158
90
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_cjs_namespaceObject.Handle, {
|
|
159
91
|
ref: handleRef,
|
|
160
92
|
type: type,
|
|
@@ -181,7 +113,7 @@ const ButtonHandleBase = ({ id, nodeId, type, position, connectionPosition = pos
|
|
|
181
113
|
hovered: isHovered,
|
|
182
114
|
showNotch: showNotches
|
|
183
115
|
}),
|
|
184
|
-
|
|
116
|
+
onAction && 'source' === type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleButton_cjs_namespaceObject.HandleButton, {
|
|
185
117
|
visible: showButton,
|
|
186
118
|
labelVisible: visible,
|
|
187
119
|
position: position,
|
|
@@ -189,8 +121,7 @@ const ButtonHandleBase = ({ id, nodeId, type, position, connectionPosition = pos
|
|
|
189
121
|
handleRef: handleRef,
|
|
190
122
|
label: label,
|
|
191
123
|
labelIcon: labelIcon,
|
|
192
|
-
labelBackgroundColor: labelBackgroundColor
|
|
193
|
-
portal: portal
|
|
124
|
+
labelBackgroundColor: labelBackgroundColor
|
|
194
125
|
}) : label && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleLabel_cjs_namespaceObject.HandleLabel, {
|
|
195
126
|
position: position,
|
|
196
127
|
backgroundColor: labelBackgroundColor,
|
|
@@ -201,142 +132,7 @@ const ButtonHandleBase = ({ id, nodeId, type, position, connectionPosition = pos
|
|
|
201
132
|
});
|
|
202
133
|
};
|
|
203
134
|
const ButtonHandle = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(ButtonHandleBase);
|
|
204
|
-
|
|
205
|
-
if (!nodeWidth || !nodeHeight) return;
|
|
206
|
-
const edgeCoverageRatio = external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_EDGE_COVERAGE_RATIO / total;
|
|
207
|
-
const horizontalWidth = nodeWidth * edgeCoverageRatio;
|
|
208
|
-
const verticalHeight = nodeHeight * edgeCoverageRatio;
|
|
209
|
-
const x = positionPercent / 100 * nodeWidth;
|
|
210
|
-
const y = positionPercent / 100 * nodeHeight;
|
|
211
|
-
switch(position){
|
|
212
|
-
case react_cjs_namespaceObject.Position.Top:
|
|
213
|
-
return {
|
|
214
|
-
nodeId,
|
|
215
|
-
left: x,
|
|
216
|
-
top: 0,
|
|
217
|
-
width: horizontalWidth,
|
|
218
|
-
height: external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_CROSS_AXIS_SIZE_PX,
|
|
219
|
-
transform: 'translate(-50%, -50%)'
|
|
220
|
-
};
|
|
221
|
-
case react_cjs_namespaceObject.Position.Bottom:
|
|
222
|
-
return {
|
|
223
|
-
nodeId,
|
|
224
|
-
left: x,
|
|
225
|
-
top: nodeHeight - external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_CROSS_AXIS_SIZE_PX,
|
|
226
|
-
width: horizontalWidth,
|
|
227
|
-
height: external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_CROSS_AXIS_SIZE_PX,
|
|
228
|
-
transform: 'translate(-50%, 50%)'
|
|
229
|
-
};
|
|
230
|
-
case react_cjs_namespaceObject.Position.Left:
|
|
231
|
-
return {
|
|
232
|
-
nodeId,
|
|
233
|
-
left: 0,
|
|
234
|
-
top: y,
|
|
235
|
-
width: external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_CROSS_AXIS_SIZE_PX,
|
|
236
|
-
height: verticalHeight,
|
|
237
|
-
transform: 'translate(-50%, -50%)'
|
|
238
|
-
};
|
|
239
|
-
case react_cjs_namespaceObject.Position.Right:
|
|
240
|
-
return {
|
|
241
|
-
nodeId,
|
|
242
|
-
left: nodeWidth - external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_CROSS_AXIS_SIZE_PX,
|
|
243
|
-
top: y,
|
|
244
|
-
width: external_ButtonHandleStyleUtils_cjs_namespaceObject.HANDLE_CROSS_AXIS_SIZE_PX,
|
|
245
|
-
height: verticalHeight,
|
|
246
|
-
transform: 'translate(50%, -50%)'
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
function InwardHandleContent({ handleType, isVertical, selected, hovered, showNotch, label, labelIcon, labelBackgroundColor, layout }) {
|
|
251
|
-
const labelElement = label ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
252
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('pointer-events-none flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full border border-border-subtle bg-surface-overlay px-2.5', 'text-xs font-medium text-foreground'),
|
|
253
|
-
style: labelBackgroundColor ? {
|
|
254
|
-
backgroundColor: labelBackgroundColor
|
|
255
|
-
} : void 0,
|
|
256
|
-
children: [
|
|
257
|
-
labelIcon,
|
|
258
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
259
|
-
children: label
|
|
260
|
-
})
|
|
261
|
-
]
|
|
262
|
-
}) : null;
|
|
263
|
-
const notchElement = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
264
|
-
className: "relative z-10 flex shrink-0",
|
|
265
|
-
style: layout.notchStyle,
|
|
266
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleNotch_cjs_namespaceObject.HandleNotch, {
|
|
267
|
-
handleType: handleType,
|
|
268
|
-
isVertical: isVertical,
|
|
269
|
-
selected: selected,
|
|
270
|
-
hovered: hovered,
|
|
271
|
-
showNotch: showNotch
|
|
272
|
-
})
|
|
273
|
-
});
|
|
274
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
275
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('flex items-center', layout.contentDirectionClassName),
|
|
276
|
-
children: [
|
|
277
|
-
labelElement,
|
|
278
|
-
notchElement
|
|
279
|
-
]
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
function getInwardHandleLayout(position, handleType) {
|
|
283
|
-
const notchOverlap = -INWARD_NOTCH_OVERLAP_PX[handleType];
|
|
284
|
-
switch(position){
|
|
285
|
-
case react_cjs_namespaceObject.Position.Left:
|
|
286
|
-
return {
|
|
287
|
-
rootTransform: 'translate(0, -50%)',
|
|
288
|
-
contentDirectionClassName: 'flex-row',
|
|
289
|
-
notchStyle: {
|
|
290
|
-
marginLeft: notchOverlap
|
|
291
|
-
},
|
|
292
|
-
anchorStyle: {
|
|
293
|
-
left: `calc(100% - ${INWARD_HANDLE_ANCHOR_RADIUS_PX}px)`,
|
|
294
|
-
top: '50%',
|
|
295
|
-
transform: 'translateY(-50%)'
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
case react_cjs_namespaceObject.Position.Right:
|
|
299
|
-
return {
|
|
300
|
-
rootTransform: 'translate(0, -50%)',
|
|
301
|
-
contentDirectionClassName: 'flex-row-reverse',
|
|
302
|
-
notchStyle: {
|
|
303
|
-
marginRight: notchOverlap
|
|
304
|
-
},
|
|
305
|
-
anchorStyle: {
|
|
306
|
-
left: -INWARD_HANDLE_ANCHOR_RADIUS_PX,
|
|
307
|
-
top: '50%',
|
|
308
|
-
transform: 'translateY(-50%)'
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
case react_cjs_namespaceObject.Position.Top:
|
|
312
|
-
return {
|
|
313
|
-
rootTransform: 'translate(-50%, 0)',
|
|
314
|
-
contentDirectionClassName: 'flex-col',
|
|
315
|
-
notchStyle: {
|
|
316
|
-
marginTop: notchOverlap
|
|
317
|
-
},
|
|
318
|
-
anchorStyle: {
|
|
319
|
-
left: '50%',
|
|
320
|
-
top: `calc(100% - ${INWARD_HANDLE_ANCHOR_RADIUS_PX}px)`,
|
|
321
|
-
transform: 'translateX(-50%)'
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
case react_cjs_namespaceObject.Position.Bottom:
|
|
325
|
-
return {
|
|
326
|
-
rootTransform: 'translate(-50%, 0)',
|
|
327
|
-
contentDirectionClassName: 'flex-col-reverse',
|
|
328
|
-
notchStyle: {
|
|
329
|
-
marginBottom: notchOverlap
|
|
330
|
-
},
|
|
331
|
-
anchorStyle: {
|
|
332
|
-
left: '50%',
|
|
333
|
-
top: -INWARD_HANDLE_ANCHOR_RADIUS_PX,
|
|
334
|
-
transform: 'translateX(-50%)'
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
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 })=>{
|
|
135
|
+
const ButtonHandlesBase = ({ nodeId, handles, position, selected = false, hovered = false, visible = true, showAddButton = true, showNotches = true, customPositionAndOffsets, shouldShowAddButtonFn = ({ showAddButton, selected, hovered })=>showAddButton && (selected || hovered), nodeWidth, nodeHeight })=>{
|
|
340
136
|
const finalSelected = shouldShowAddButtonFn({
|
|
341
137
|
showAddButton,
|
|
342
138
|
selected,
|
|
@@ -347,17 +143,14 @@ const ButtonHandlesBase = ({ nodeId, handles, position, connectionPosition = pos
|
|
|
347
143
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
348
144
|
children: [
|
|
349
145
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_HandleButton_cjs_namespaceObject.HandleHoverBridge, {
|
|
350
|
-
position:
|
|
146
|
+
position: position,
|
|
351
147
|
visible: hasSourceButtons && finalSelected
|
|
352
148
|
}),
|
|
353
|
-
visibleHandles.map((handle, index)
|
|
354
|
-
const handleVisible = handle.showHandle ?? visible;
|
|
355
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ButtonHandle, {
|
|
149
|
+
visibleHandles.map((handle, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ButtonHandle, {
|
|
356
150
|
id: handle.id,
|
|
357
151
|
nodeId: nodeId,
|
|
358
152
|
type: handle.type,
|
|
359
153
|
position: position,
|
|
360
|
-
connectionPosition: connectionPosition,
|
|
361
154
|
handleType: handle.handleType,
|
|
362
155
|
label: handle.label,
|
|
363
156
|
labelIcon: handle.labelIcon,
|
|
@@ -365,16 +158,14 @@ const ButtonHandlesBase = ({ nodeId, handles, position, connectionPosition = pos
|
|
|
365
158
|
index: index,
|
|
366
159
|
total: visibleHandles.length,
|
|
367
160
|
selected: selected,
|
|
368
|
-
visible:
|
|
369
|
-
showButton: finalSelected &&
|
|
161
|
+
visible: handle.showHandle ?? visible,
|
|
162
|
+
showButton: finalSelected && (handle.showHandle ?? visible) && handle.showButton,
|
|
370
163
|
onAction: handle.onAction,
|
|
371
164
|
showNotches: showNotches,
|
|
372
165
|
customPositionAndOffsets: customPositionAndOffsets,
|
|
373
166
|
nodeWidth: nodeWidth,
|
|
374
|
-
nodeHeight: nodeHeight
|
|
375
|
-
|
|
376
|
-
}, handle.id);
|
|
377
|
-
})
|
|
167
|
+
nodeHeight: nodeHeight
|
|
168
|
+
}, handle.id))
|
|
378
169
|
]
|
|
379
170
|
});
|
|
380
171
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Position } from '../../xyflow/react.ts';
|
|
2
2
|
import type { HandleConfigurationSpecificPosition } from '../../schema/node-definition/handle';
|
|
3
|
-
import { type HandleType } from './HandleNotch';
|
|
4
3
|
export interface HandleActionEvent {
|
|
5
4
|
handleId: string;
|
|
6
5
|
nodeId: string;
|
|
7
|
-
handleType:
|
|
6
|
+
handleType: 'artifact' | 'input' | 'output';
|
|
8
7
|
position: Position;
|
|
9
8
|
originalEvent: React.MouseEvent;
|
|
10
9
|
}
|
|
@@ -13,8 +12,7 @@ type ButtonHandleProps = {
|
|
|
13
12
|
nodeId: string;
|
|
14
13
|
type: 'source' | 'target';
|
|
15
14
|
position: Position;
|
|
16
|
-
|
|
17
|
-
handleType: HandleType;
|
|
15
|
+
handleType: 'artifact' | 'input' | 'output';
|
|
18
16
|
label?: string;
|
|
19
17
|
labelIcon?: React.ReactNode;
|
|
20
18
|
labelBackgroundColor?: string;
|
|
@@ -28,13 +26,12 @@ type ButtonHandleProps = {
|
|
|
28
26
|
customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
29
27
|
nodeWidth?: number;
|
|
30
28
|
nodeHeight?: number;
|
|
31
|
-
portalAction?: boolean;
|
|
32
29
|
};
|
|
33
|
-
export declare const ButtonHandle: import("react").MemoExoticComponent<({ id, nodeId, type, position,
|
|
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>;
|
|
34
31
|
export interface ButtonHandleConfig {
|
|
35
32
|
id: string;
|
|
36
33
|
type: 'source' | 'target';
|
|
37
|
-
handleType:
|
|
34
|
+
handleType: 'artifact' | 'input' | 'output';
|
|
38
35
|
label?: string;
|
|
39
36
|
labelIcon?: React.ReactNode;
|
|
40
37
|
showButton?: boolean;
|
|
@@ -44,11 +41,10 @@ export interface ButtonHandleConfig {
|
|
|
44
41
|
onAction?: (event: HandleActionEvent) => void;
|
|
45
42
|
customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
46
43
|
}
|
|
47
|
-
export declare const ButtonHandles: import("react").MemoExoticComponent<({ nodeId, handles, position,
|
|
44
|
+
export declare const ButtonHandles: import("react").MemoExoticComponent<({ nodeId, handles, position, selected, hovered, visible, showAddButton, showNotches, customPositionAndOffsets, shouldShowAddButtonFn, nodeWidth, nodeHeight, }: {
|
|
48
45
|
nodeId: string;
|
|
49
46
|
handles: ButtonHandleConfig[];
|
|
50
47
|
position: Position;
|
|
51
|
-
connectionPosition?: Position;
|
|
52
48
|
selected?: boolean;
|
|
53
49
|
hovered?: boolean;
|
|
54
50
|
visible?: boolean;
|
|
@@ -57,7 +53,6 @@ export declare const ButtonHandles: import("react").MemoExoticComponent<({ nodeI
|
|
|
57
53
|
customPositionAndOffsets?: HandleConfigurationSpecificPosition;
|
|
58
54
|
nodeWidth?: number;
|
|
59
55
|
nodeHeight?: number;
|
|
60
|
-
portalActions?: boolean;
|
|
61
56
|
shouldShowAddButtonFn?: ({ showAddButton, selected, hovered, }: {
|
|
62
57
|
showAddButton: boolean;
|
|
63
58
|
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;
|
|
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;AAS/F,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5C,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC;CACjC;AAED,KAAK,iBAAiB,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wBAAwB,CAAC,EAAE,mCAAmC,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAiJF,eAAO,MAAM,YAAY,iPA5HtB,iBAAiB,6CA4H8B,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IAEjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,UAAU,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,wBAAwB,CAAC,EAAE,mCAAmC,CAAC;CAChE;AAuFD,eAAO,MAAM,aAAa,uMAvEvB;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wBAAwB,CAAC,EAAE,mCAAmC,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAUpB,qBAAqB,CAAC,EAAE,CAAC,EACvB,aAAa,EACb,QAAQ,EACR,OAAO,GACR,EAAE;QACD,aAAa,EAAE,OAAO,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;KAClB,KAAK,OAAO,CAAC;CACf,6CAyCmD,CAAC"}
|