@uipath/apollo-react 4.13.1-pr581.30f7035 → 4.14.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 +7 -26
- package/dist/canvas/components/AddNodePanel/AddNodeManager.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.js +7 -26
- package/dist/canvas/components/AddNodePanel/AddNodePanel.types.d.ts +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodePanel.types.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.cjs +41 -0
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts +3 -0
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts.map +1 -0
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.js +7 -0
- package/dist/canvas/components/AddNodePanel/index.cjs +6 -2
- package/dist/canvas/components/AddNodePanel/index.d.ts +1 -0
- package/dist/canvas/components/AddNodePanel/index.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/index.js +2 -1
- 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 +3 -8
- 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 +3 -5
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts +0 -2
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +34 -115
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts +2 -4
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +36 -117
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +1 -48
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts +0 -4
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +1 -36
- package/dist/canvas/components/ButtonHandle/SmartHandle.cjs +1 -1
- package/dist/canvas/components/ButtonHandle/SmartHandle.js +1 -1
- package/dist/canvas/components/Edges/SequenceEdge.cjs +2 -3
- package/dist/canvas/components/Edges/SequenceEdge.d.ts +2 -11
- package/dist/canvas/components/Edges/SequenceEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/SequenceEdge.js +3 -4
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +15 -23
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts +0 -2
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +16 -24
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.cjs +8 -11
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.js +8 -11
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.cjs +25 -34
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts +1 -2
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.js +26 -35
- 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 -8
- package/dist/canvas/constants.d.ts +0 -2
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +1 -3
- package/dist/canvas/core/CategoryTreeAdapter.cjs +1 -1
- package/dist/canvas/core/CategoryTreeAdapter.js +1 -1
- package/dist/canvas/core/NodeTypeRegistry.cjs +24 -40
- package/dist/canvas/core/NodeTypeRegistry.d.ts +4 -8
- package/dist/canvas/core/NodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/NodeTypeRegistry.js +24 -40
- package/dist/canvas/core/useNodeTypeRegistry.cjs +3 -4
- package/dist/canvas/core/useNodeTypeRegistry.d.ts +1 -1
- package/dist/canvas/core/useNodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/useNodeTypeRegistry.js +3 -4
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.cjs +3 -10
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.d.ts.map +1 -1
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.js +3 -10
- package/dist/canvas/hooks/usePreviewNode.cjs +2 -4
- package/dist/canvas/hooks/usePreviewNode.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.js +2 -4
- 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/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/styles/reactflow-reset.css +0 -4
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/utils/{createPreviewGraph.cjs → createPreviewNode.cjs} +41 -115
- package/dist/canvas/utils/createPreviewNode.d.ts +17 -0
- package/dist/canvas/utils/createPreviewNode.d.ts.map +1 -0
- package/dist/canvas/utils/{createPreviewGraph.js → createPreviewNode.js} +36 -95
- package/dist/canvas/utils/index.cjs +10 -10
- package/dist/canvas/utils/index.d.ts +2 -2
- package/dist/canvas/utils/index.d.ts.map +1 -1
- package/dist/canvas/utils/index.js +2 -2
- package/dist/material/components/ap-chat/components/common/action-button.cjs +7 -33
- package/dist/material/components/ap-chat/components/common/action-button.d.ts +3 -9
- package/dist/material/components/ap-chat/components/common/action-button.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/common/action-button.js +7 -33
- package/dist/material/components/ap-chat/components/input/always-on-voice-button.cjs +183 -0
- package/dist/material/components/ap-chat/components/input/always-on-voice-button.d.ts +10 -0
- package/dist/material/components/ap-chat/components/input/always-on-voice-button.d.ts.map +1 -0
- package/dist/material/components/ap-chat/components/input/always-on-voice-button.js +136 -0
- package/dist/material/components/ap-chat/components/input/chat-input-actions.cjs +46 -4
- package/dist/material/components/ap-chat/components/input/chat-input-actions.d.ts +4 -1
- package/dist/material/components/ap-chat/components/input/chat-input-actions.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input-actions.js +46 -4
- package/dist/material/components/ap-chat/components/input/chat-input.cjs +19 -5
- package/dist/material/components/ap-chat/components/input/chat-input.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/input/chat-input.js +19 -5
- package/dist/material/components/ap-chat/locales/en.cjs +1 -1
- package/dist/material/components/ap-chat/locales/en.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/en.js +1 -1
- package/dist/material/components/ap-chat/service/ChatModel.cjs +2 -0
- package/dist/material/components/ap-chat/service/ChatModel.d.ts +4 -1
- package/dist/material/components/ap-chat/service/ChatModel.d.ts.map +1 -1
- package/dist/material/components/ap-chat/service/ChatModel.js +2 -0
- package/dist/material/components/ap-chat/service/ChatService.cjs +14 -0
- package/dist/material/components/ap-chat/service/ChatService.d.ts +4 -0
- package/dist/material/components/ap-chat/service/ChatService.d.ts.map +1 -1
- package/dist/material/components/ap-chat/service/ChatService.js +14 -0
- package/package.json +3 -3
- package/dist/canvas/components/LoopNode/LoopCanvasNode.cjs +0 -112
- 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 -78
- package/dist/canvas/components/LoopNode/LoopNode.cjs +0 -435
- package/dist/canvas/components/LoopNode/LoopNode.constants.cjs +0 -77
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts +0 -12
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.constants.js +0 -13
- 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 -137
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts +0 -26
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +0 -94
- package/dist/canvas/components/LoopNode/LoopNode.js +0 -401
- package/dist/canvas/components/LoopNode/LoopNode.types.cjs +0 -18
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +0 -11
- 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 -72
- package/dist/canvas/components/LoopNode/index.d.ts +0 -4
- package/dist/canvas/components/LoopNode/index.d.ts.map +0 -1
- package/dist/canvas/components/LoopNode/index.js +0 -3
- package/dist/canvas/utils/createPreviewGraph.d.ts +0 -43
- package/dist/canvas/utils/createPreviewGraph.d.ts.map +0 -1
- package/dist/material/components/ap-chat/components/audio/chat-audio.cjs +0 -334
- package/dist/material/components/ap-chat/components/audio/chat-audio.d.ts +0 -10
- package/dist/material/components/ap-chat/components/audio/chat-audio.d.ts.map +0 -1
- package/dist/material/components/ap-chat/components/audio/chat-audio.js +0 -290
|
@@ -24,46 +24,13 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
applyPreviewToReactFlow: ()=>applyPreviewToReactFlow,
|
|
27
28
|
removePreviewFromReactFlow: ()=>removePreviewFromReactFlow,
|
|
28
|
-
|
|
29
|
-
PREVIEW_EDGE_STYLE: ()=>PREVIEW_EDGE_STYLE,
|
|
30
|
-
createPreviewGraph: ()=>createPreviewGraph,
|
|
31
|
-
reparentPreviewNodeToContainer: ()=>reparentPreviewNodeToContainer,
|
|
32
|
-
showPreviewGraph: ()=>showPreviewGraph,
|
|
33
|
-
getOppositePosition: ()=>getOppositePosition,
|
|
34
|
-
inferParentId: ()=>inferParentId
|
|
29
|
+
createPreviewNode: ()=>createPreviewNode
|
|
35
30
|
});
|
|
36
31
|
const react_cjs_namespaceObject = require("../xyflow/react.cjs");
|
|
37
32
|
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
38
33
|
const external_NodeUtils_cjs_namespaceObject = require("./NodeUtils.cjs");
|
|
39
|
-
const PREVIEW_EDGE_STYLE = {
|
|
40
|
-
strokeDasharray: '5,5',
|
|
41
|
-
opacity: 0.8,
|
|
42
|
-
stroke: 'var(--canvas-selection-indicator)',
|
|
43
|
-
strokeWidth: 2
|
|
44
|
-
};
|
|
45
|
-
function inferParentId(sourceId, targetId, nodes) {
|
|
46
|
-
const sourceNode = nodes.find((node)=>node.id === sourceId);
|
|
47
|
-
const targetNode = nodes.find((node)=>node.id === targetId);
|
|
48
|
-
if (!sourceNode || !targetNode) return;
|
|
49
|
-
if (sourceNode.parentId && sourceNode.parentId === targetNode.parentId) return sourceNode.parentId;
|
|
50
|
-
if (targetNode.parentId && targetNode.parentId === sourceNode.id) return sourceNode.id;
|
|
51
|
-
if (sourceNode.parentId && sourceNode.parentId === targetNode.id) return targetNode.id;
|
|
52
|
-
}
|
|
53
|
-
function reparentPreviewNodeToContainer(previewNode, containerId, reactFlowInstance) {
|
|
54
|
-
const containerNode = reactFlowInstance.getNode(containerId);
|
|
55
|
-
if (!containerNode) return null;
|
|
56
|
-
const containerAbsolutePosition = (0, external_NodeUtils_cjs_namespaceObject.getAbsolutePosition)(containerNode, reactFlowInstance.getNodes());
|
|
57
|
-
return {
|
|
58
|
-
...previewNode,
|
|
59
|
-
position: {
|
|
60
|
-
x: previewNode.position.x - containerAbsolutePosition.x,
|
|
61
|
-
y: previewNode.position.y - containerAbsolutePosition.y
|
|
62
|
-
},
|
|
63
|
-
parentId: containerId,
|
|
64
|
-
extent: 'parent'
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
34
|
function getOppositePosition(position) {
|
|
68
35
|
switch(position){
|
|
69
36
|
case react_cjs_namespaceObject.Position.Left:
|
|
@@ -107,12 +74,6 @@ function calculatePositionFromDrop(dropPosition, handlePosition, previewNodeSize
|
|
|
107
74
|
};
|
|
108
75
|
}
|
|
109
76
|
}
|
|
110
|
-
function calculateCenteredPosition(centerPosition, previewNodeSize) {
|
|
111
|
-
return {
|
|
112
|
-
x: centerPosition.x - previewNodeSize.width / 2,
|
|
113
|
-
y: centerPosition.y - previewNodeSize.height / 2
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
77
|
function computeSpreadOffset(handle, size) {
|
|
117
78
|
const index = handle?.index ?? null;
|
|
118
79
|
const count = handle?.count ?? 1;
|
|
@@ -175,10 +136,10 @@ function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, exis
|
|
|
175
136
|
};
|
|
176
137
|
return (0, external_NodeUtils_cjs_namespaceObject.getNonOverlappingPositionForDirection)(nodesWithAbsolutePositions, initialPosition, previewNodeSize, direction, offset, ignoredNodeTypes, overflowDirection);
|
|
177
138
|
}
|
|
178
|
-
function createPreviewNode(
|
|
139
|
+
function createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, position, data, sourceHandleType = 'source', previewNodeSize = {
|
|
179
140
|
width: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
|
|
180
141
|
height: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE
|
|
181
|
-
}, handlePosition = react_cjs_namespaceObject.Position.Right, ignoredNodeTypes = []
|
|
142
|
+
}, handlePosition = react_cjs_namespaceObject.Position.Right, ignoredNodeTypes = []) {
|
|
182
143
|
const sourceNode = reactFlowInstance.getNode(sourceNodeId);
|
|
183
144
|
if (!sourceNode) {
|
|
184
145
|
console.warn(`Source node ${sourceNodeId} not found`);
|
|
@@ -188,74 +149,49 @@ function createPreviewNode({ sourceNodeId, sourceHandleId, reactFlowInstance, po
|
|
|
188
149
|
const existingNodes = reactFlowInstance.getNodes().filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID);
|
|
189
150
|
const internalNode = void 0 === position ? reactFlowInstance.getInternalNode(sourceNodeId) : void 0;
|
|
190
151
|
const handle = internalNode ? (0, external_NodeUtils_cjs_namespaceObject.resolveHandleContext)(internalNode, sourceHandleId, handlePosition) : void 0;
|
|
191
|
-
const
|
|
152
|
+
const nodePosition = position ? calculatePositionFromDrop(position, handlePosition, previewNodeSize) : calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, existingNodes, void 0, ignoredNodeTypes, handle);
|
|
192
153
|
const handleFacingSource = getOppositePosition(handlePosition);
|
|
193
|
-
const
|
|
154
|
+
const finalData = {
|
|
194
155
|
...data ?? {}
|
|
195
156
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
157
|
+
finalData.inputHandlePosition = treatPreviewAsSource ? handlePosition : handleFacingSource;
|
|
158
|
+
finalData.outputHandlePosition = treatPreviewAsSource ? handleFacingSource : handlePosition;
|
|
159
|
+
const previewNode = {
|
|
199
160
|
id: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
200
161
|
type: 'preview',
|
|
201
|
-
position:
|
|
162
|
+
position: nodePosition,
|
|
202
163
|
...previewNodeSize,
|
|
203
164
|
selected: true,
|
|
204
|
-
data:
|
|
165
|
+
data: finalData
|
|
205
166
|
};
|
|
206
|
-
const
|
|
167
|
+
const previewSourceAndTargetData = treatPreviewAsSource ? {
|
|
168
|
+
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
169
|
+
sourceHandle: 'output',
|
|
170
|
+
target: sourceNodeId,
|
|
171
|
+
targetHandle: sourceHandleId
|
|
172
|
+
} : {
|
|
173
|
+
source: sourceNodeId,
|
|
174
|
+
sourceHandle: sourceHandleId,
|
|
175
|
+
target: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
176
|
+
targetHandle: 'input'
|
|
177
|
+
};
|
|
178
|
+
const previewEdge = {
|
|
207
179
|
id: external_constants_cjs_namespaceObject.PREVIEW_EDGE_ID,
|
|
208
|
-
...
|
|
209
|
-
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
210
|
-
sourceHandle: external_constants_cjs_namespaceObject.DEFAULT_SOURCE_HANDLE_ID,
|
|
211
|
-
target: sourceNodeId,
|
|
212
|
-
targetHandle: sourceHandleId
|
|
213
|
-
} : {
|
|
214
|
-
source: sourceNodeId,
|
|
215
|
-
sourceHandle: sourceHandleId,
|
|
216
|
-
target: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
217
|
-
targetHandle: external_constants_cjs_namespaceObject.DEFAULT_TARGET_HANDLE_ID
|
|
218
|
-
},
|
|
180
|
+
...previewSourceAndTargetData,
|
|
219
181
|
type: 'default',
|
|
220
|
-
style:
|
|
182
|
+
style: {
|
|
183
|
+
strokeDasharray: '5,5',
|
|
184
|
+
opacity: 0.8,
|
|
185
|
+
stroke: 'var(--canvas-selection-indicator)',
|
|
186
|
+
strokeWidth: 2
|
|
187
|
+
}
|
|
221
188
|
};
|
|
222
189
|
return {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
edge
|
|
190
|
+
node: previewNode,
|
|
191
|
+
edge: previewEdge
|
|
226
192
|
};
|
|
227
193
|
}
|
|
228
|
-
function
|
|
229
|
-
const { reactFlowInstance, targetNodeId, targetHandleId, containerId, removedEdgeIds, trailingEdgeId, trailingEdgeStyle = PREVIEW_EDGE_STYLE } = options;
|
|
230
|
-
const preview = createPreviewNode(options);
|
|
231
|
-
if (!preview) return null;
|
|
232
|
-
const resolvedContainerId = containerId ?? preview.sourceNode.parentId;
|
|
233
|
-
const finalPreviewNode = resolvedContainerId ? reparentPreviewNodeToContainer(preview.node, resolvedContainerId, reactFlowInstance) : preview.node;
|
|
234
|
-
if (!finalPreviewNode) return null;
|
|
235
|
-
const edges = [
|
|
236
|
-
preview.edge
|
|
237
|
-
];
|
|
238
|
-
if (targetNodeId) edges.push({
|
|
239
|
-
id: trailingEdgeId ?? `${external_constants_cjs_namespaceObject.PREVIEW_NODE_ID}-${targetNodeId}`,
|
|
240
|
-
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
241
|
-
sourceHandle: external_constants_cjs_namespaceObject.DEFAULT_SOURCE_HANDLE_ID,
|
|
242
|
-
target: targetNodeId,
|
|
243
|
-
targetHandle: targetHandleId,
|
|
244
|
-
type: 'default',
|
|
245
|
-
style: trailingEdgeStyle
|
|
246
|
-
});
|
|
247
|
-
return {
|
|
248
|
-
node: finalPreviewNode,
|
|
249
|
-
edges,
|
|
250
|
-
removedEdgeIds
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
function showPreviewGraph(options) {
|
|
254
|
-
const preview = createPreviewGraph(options);
|
|
255
|
-
if (preview) applyPreviewGraphToReactFlow(preview, options.reactFlowInstance);
|
|
256
|
-
return preview;
|
|
257
|
-
}
|
|
258
|
-
function applyPreviewGraphToReactFlow(preview, reactFlowInstance) {
|
|
194
|
+
function applyPreviewToReactFlow(preview, reactFlowInstance) {
|
|
259
195
|
setTimeout(()=>{
|
|
260
196
|
reactFlowInstance.setNodes((nodes)=>[
|
|
261
197
|
...nodes.filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID).map((n)=>({
|
|
@@ -265,32 +201,22 @@ function applyPreviewGraphToReactFlow(preview, reactFlowInstance) {
|
|
|
265
201
|
preview.node
|
|
266
202
|
]);
|
|
267
203
|
reactFlowInstance.setEdges((edges)=>[
|
|
268
|
-
...edges.filter((
|
|
269
|
-
|
|
204
|
+
...edges.filter((e)=>e.id !== external_constants_cjs_namespaceObject.PREVIEW_EDGE_ID),
|
|
205
|
+
preview.edge
|
|
270
206
|
]);
|
|
271
207
|
}, 0);
|
|
272
208
|
}
|
|
273
209
|
function removePreviewFromReactFlow(reactFlowInstance) {
|
|
274
210
|
reactFlowInstance.setNodes((nodes)=>nodes.filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID));
|
|
275
|
-
reactFlowInstance.setEdges((edges)=>edges.filter((
|
|
211
|
+
reactFlowInstance.setEdges((edges)=>edges.filter((e)=>e.id !== external_constants_cjs_namespaceObject.PREVIEW_EDGE_ID));
|
|
276
212
|
}
|
|
277
|
-
exports.
|
|
278
|
-
exports.
|
|
279
|
-
exports.createPreviewGraph = __webpack_exports__.createPreviewGraph;
|
|
280
|
-
exports.getOppositePosition = __webpack_exports__.getOppositePosition;
|
|
281
|
-
exports.inferParentId = __webpack_exports__.inferParentId;
|
|
213
|
+
exports.applyPreviewToReactFlow = __webpack_exports__.applyPreviewToReactFlow;
|
|
214
|
+
exports.createPreviewNode = __webpack_exports__.createPreviewNode;
|
|
282
215
|
exports.removePreviewFromReactFlow = __webpack_exports__.removePreviewFromReactFlow;
|
|
283
|
-
exports.reparentPreviewNodeToContainer = __webpack_exports__.reparentPreviewNodeToContainer;
|
|
284
|
-
exports.showPreviewGraph = __webpack_exports__.showPreviewGraph;
|
|
285
216
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"getOppositePosition",
|
|
290
|
-
"inferParentId",
|
|
291
|
-
"removePreviewFromReactFlow",
|
|
292
|
-
"reparentPreviewNodeToContainer",
|
|
293
|
-
"showPreviewGraph"
|
|
217
|
+
"applyPreviewToReactFlow",
|
|
218
|
+
"createPreviewNode",
|
|
219
|
+
"removePreviewFromReactFlow"
|
|
294
220
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
295
221
|
Object.defineProperty(exports, '__esModule', {
|
|
296
222
|
value: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Edge, type Node, Position, type ReactFlowInstance } from '../xyflow/react.ts';
|
|
2
|
+
export declare function createPreviewNode(sourceNodeId: string, sourceHandleId: string, reactFlowInstance: ReactFlowInstance, position?: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}, data?: Record<string, any>, sourceHandleType?: 'source' | 'target', previewNodeSize?: {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}, handlePosition?: Position, ignoredNodeTypes?: string[]): {
|
|
9
|
+
node: Node;
|
|
10
|
+
edge: Edge;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare function applyPreviewToReactFlow(preview: {
|
|
13
|
+
node: Node;
|
|
14
|
+
edge: Edge;
|
|
15
|
+
}, reactFlowInstance: ReactFlowInstance): void;
|
|
16
|
+
export declare function removePreviewFromReactFlow(reactFlowInstance: ReactFlowInstance): void;
|
|
17
|
+
//# sourceMappingURL=createPreviewNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPreviewNode.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/createPreviewNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,iBAAiB,EACvB,MAAM,0CAA0C,CAAC;AAiMlD,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,gBAAgB,GAAE,QAAQ,GAAG,QAAmB,EAChD,eAAe,GAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAG/C,EACD,cAAc,GAAE,QAAyB,EACzC,gBAAgB,GAAE,MAAM,EAAO,GAC9B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CA2FnC;AAMD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACnC,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAcN;AAKD,wBAAgB,0BAA0B,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAGrF"}
|
|
@@ -1,34 +1,6 @@
|
|
|
1
1
|
import { Position } from "../xyflow/react.js";
|
|
2
|
-
import { DEFAULT_NODE_SIZE,
|
|
2
|
+
import { DEFAULT_NODE_SIZE, GRID_SPACING, PREVIEW_EDGE_ID, PREVIEW_NODE_ID } from "../constants.js";
|
|
3
3
|
import { getAbsolutePosition, getNonOverlappingPositionForDirection, resolveHandleContext } from "./NodeUtils.js";
|
|
4
|
-
const PREVIEW_EDGE_STYLE = {
|
|
5
|
-
strokeDasharray: '5,5',
|
|
6
|
-
opacity: 0.8,
|
|
7
|
-
stroke: 'var(--canvas-selection-indicator)',
|
|
8
|
-
strokeWidth: 2
|
|
9
|
-
};
|
|
10
|
-
function inferParentId(sourceId, targetId, nodes) {
|
|
11
|
-
const sourceNode = nodes.find((node)=>node.id === sourceId);
|
|
12
|
-
const targetNode = nodes.find((node)=>node.id === targetId);
|
|
13
|
-
if (!sourceNode || !targetNode) return;
|
|
14
|
-
if (sourceNode.parentId && sourceNode.parentId === targetNode.parentId) return sourceNode.parentId;
|
|
15
|
-
if (targetNode.parentId && targetNode.parentId === sourceNode.id) return sourceNode.id;
|
|
16
|
-
if (sourceNode.parentId && sourceNode.parentId === targetNode.id) return targetNode.id;
|
|
17
|
-
}
|
|
18
|
-
function reparentPreviewNodeToContainer(previewNode, containerId, reactFlowInstance) {
|
|
19
|
-
const containerNode = reactFlowInstance.getNode(containerId);
|
|
20
|
-
if (!containerNode) return null;
|
|
21
|
-
const containerAbsolutePosition = getAbsolutePosition(containerNode, reactFlowInstance.getNodes());
|
|
22
|
-
return {
|
|
23
|
-
...previewNode,
|
|
24
|
-
position: {
|
|
25
|
-
x: previewNode.position.x - containerAbsolutePosition.x,
|
|
26
|
-
y: previewNode.position.y - containerAbsolutePosition.y
|
|
27
|
-
},
|
|
28
|
-
parentId: containerId,
|
|
29
|
-
extent: 'parent'
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
4
|
function getOppositePosition(position) {
|
|
33
5
|
switch(position){
|
|
34
6
|
case Position.Left:
|
|
@@ -72,12 +44,6 @@ function calculatePositionFromDrop(dropPosition, handlePosition, previewNodeSize
|
|
|
72
44
|
};
|
|
73
45
|
}
|
|
74
46
|
}
|
|
75
|
-
function calculateCenteredPosition(centerPosition, previewNodeSize) {
|
|
76
|
-
return {
|
|
77
|
-
x: centerPosition.x - previewNodeSize.width / 2,
|
|
78
|
-
y: centerPosition.y - previewNodeSize.height / 2
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
47
|
function computeSpreadOffset(handle, size) {
|
|
82
48
|
const index = handle?.index ?? null;
|
|
83
49
|
const count = handle?.count ?? 1;
|
|
@@ -140,10 +106,10 @@ function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, exis
|
|
|
140
106
|
};
|
|
141
107
|
return getNonOverlappingPositionForDirection(nodesWithAbsolutePositions, initialPosition, previewNodeSize, direction, offset, ignoredNodeTypes, overflowDirection);
|
|
142
108
|
}
|
|
143
|
-
function createPreviewNode(
|
|
109
|
+
function createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, position, data, sourceHandleType = 'source', previewNodeSize = {
|
|
144
110
|
width: DEFAULT_NODE_SIZE,
|
|
145
111
|
height: DEFAULT_NODE_SIZE
|
|
146
|
-
}, handlePosition = Position.Right, ignoredNodeTypes = []
|
|
112
|
+
}, handlePosition = Position.Right, ignoredNodeTypes = []) {
|
|
147
113
|
const sourceNode = reactFlowInstance.getNode(sourceNodeId);
|
|
148
114
|
if (!sourceNode) {
|
|
149
115
|
console.warn(`Source node ${sourceNodeId} not found`);
|
|
@@ -153,74 +119,49 @@ function createPreviewNode({ sourceNodeId, sourceHandleId, reactFlowInstance, po
|
|
|
153
119
|
const existingNodes = reactFlowInstance.getNodes().filter((n)=>n.id !== PREVIEW_NODE_ID);
|
|
154
120
|
const internalNode = void 0 === position ? reactFlowInstance.getInternalNode(sourceNodeId) : void 0;
|
|
155
121
|
const handle = internalNode ? resolveHandleContext(internalNode, sourceHandleId, handlePosition) : void 0;
|
|
156
|
-
const
|
|
122
|
+
const nodePosition = position ? calculatePositionFromDrop(position, handlePosition, previewNodeSize) : calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, existingNodes, void 0, ignoredNodeTypes, handle);
|
|
157
123
|
const handleFacingSource = getOppositePosition(handlePosition);
|
|
158
|
-
const
|
|
124
|
+
const finalData = {
|
|
159
125
|
...data ?? {}
|
|
160
126
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const
|
|
127
|
+
finalData.inputHandlePosition = treatPreviewAsSource ? handlePosition : handleFacingSource;
|
|
128
|
+
finalData.outputHandlePosition = treatPreviewAsSource ? handleFacingSource : handlePosition;
|
|
129
|
+
const previewNode = {
|
|
164
130
|
id: PREVIEW_NODE_ID,
|
|
165
131
|
type: 'preview',
|
|
166
|
-
position:
|
|
132
|
+
position: nodePosition,
|
|
167
133
|
...previewNodeSize,
|
|
168
134
|
selected: true,
|
|
169
|
-
data:
|
|
135
|
+
data: finalData
|
|
170
136
|
};
|
|
171
|
-
const
|
|
137
|
+
const previewSourceAndTargetData = treatPreviewAsSource ? {
|
|
138
|
+
source: PREVIEW_NODE_ID,
|
|
139
|
+
sourceHandle: 'output',
|
|
140
|
+
target: sourceNodeId,
|
|
141
|
+
targetHandle: sourceHandleId
|
|
142
|
+
} : {
|
|
143
|
+
source: sourceNodeId,
|
|
144
|
+
sourceHandle: sourceHandleId,
|
|
145
|
+
target: PREVIEW_NODE_ID,
|
|
146
|
+
targetHandle: 'input'
|
|
147
|
+
};
|
|
148
|
+
const previewEdge = {
|
|
172
149
|
id: PREVIEW_EDGE_ID,
|
|
173
|
-
...
|
|
174
|
-
source: PREVIEW_NODE_ID,
|
|
175
|
-
sourceHandle: DEFAULT_SOURCE_HANDLE_ID,
|
|
176
|
-
target: sourceNodeId,
|
|
177
|
-
targetHandle: sourceHandleId
|
|
178
|
-
} : {
|
|
179
|
-
source: sourceNodeId,
|
|
180
|
-
sourceHandle: sourceHandleId,
|
|
181
|
-
target: PREVIEW_NODE_ID,
|
|
182
|
-
targetHandle: DEFAULT_TARGET_HANDLE_ID
|
|
183
|
-
},
|
|
150
|
+
...previewSourceAndTargetData,
|
|
184
151
|
type: 'default',
|
|
185
|
-
style:
|
|
152
|
+
style: {
|
|
153
|
+
strokeDasharray: '5,5',
|
|
154
|
+
opacity: 0.8,
|
|
155
|
+
stroke: 'var(--canvas-selection-indicator)',
|
|
156
|
+
strokeWidth: 2
|
|
157
|
+
}
|
|
186
158
|
};
|
|
187
159
|
return {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
edge
|
|
160
|
+
node: previewNode,
|
|
161
|
+
edge: previewEdge
|
|
191
162
|
};
|
|
192
163
|
}
|
|
193
|
-
function
|
|
194
|
-
const { reactFlowInstance, targetNodeId, targetHandleId, containerId, removedEdgeIds, trailingEdgeId, trailingEdgeStyle = PREVIEW_EDGE_STYLE } = options;
|
|
195
|
-
const preview = createPreviewNode(options);
|
|
196
|
-
if (!preview) return null;
|
|
197
|
-
const resolvedContainerId = containerId ?? preview.sourceNode.parentId;
|
|
198
|
-
const finalPreviewNode = resolvedContainerId ? reparentPreviewNodeToContainer(preview.node, resolvedContainerId, reactFlowInstance) : preview.node;
|
|
199
|
-
if (!finalPreviewNode) return null;
|
|
200
|
-
const edges = [
|
|
201
|
-
preview.edge
|
|
202
|
-
];
|
|
203
|
-
if (targetNodeId) edges.push({
|
|
204
|
-
id: trailingEdgeId ?? `${PREVIEW_NODE_ID}-${targetNodeId}`,
|
|
205
|
-
source: PREVIEW_NODE_ID,
|
|
206
|
-
sourceHandle: DEFAULT_SOURCE_HANDLE_ID,
|
|
207
|
-
target: targetNodeId,
|
|
208
|
-
targetHandle: targetHandleId,
|
|
209
|
-
type: 'default',
|
|
210
|
-
style: trailingEdgeStyle
|
|
211
|
-
});
|
|
212
|
-
return {
|
|
213
|
-
node: finalPreviewNode,
|
|
214
|
-
edges,
|
|
215
|
-
removedEdgeIds
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
function showPreviewGraph(options) {
|
|
219
|
-
const preview = createPreviewGraph(options);
|
|
220
|
-
if (preview) applyPreviewGraphToReactFlow(preview, options.reactFlowInstance);
|
|
221
|
-
return preview;
|
|
222
|
-
}
|
|
223
|
-
function applyPreviewGraphToReactFlow(preview, reactFlowInstance) {
|
|
164
|
+
function applyPreviewToReactFlow(preview, reactFlowInstance) {
|
|
224
165
|
setTimeout(()=>{
|
|
225
166
|
reactFlowInstance.setNodes((nodes)=>[
|
|
226
167
|
...nodes.filter((n)=>n.id !== PREVIEW_NODE_ID).map((n)=>({
|
|
@@ -230,13 +171,13 @@ function applyPreviewGraphToReactFlow(preview, reactFlowInstance) {
|
|
|
230
171
|
preview.node
|
|
231
172
|
]);
|
|
232
173
|
reactFlowInstance.setEdges((edges)=>[
|
|
233
|
-
...edges.filter((
|
|
234
|
-
|
|
174
|
+
...edges.filter((e)=>e.id !== PREVIEW_EDGE_ID),
|
|
175
|
+
preview.edge
|
|
235
176
|
]);
|
|
236
177
|
}, 0);
|
|
237
178
|
}
|
|
238
179
|
function removePreviewFromReactFlow(reactFlowInstance) {
|
|
239
180
|
reactFlowInstance.setNodes((nodes)=>nodes.filter((n)=>n.id !== PREVIEW_NODE_ID));
|
|
240
|
-
reactFlowInstance.setEdges((edges)=>edges.filter((
|
|
181
|
+
reactFlowInstance.setEdges((edges)=>edges.filter((e)=>e.id !== PREVIEW_EDGE_ID));
|
|
241
182
|
}
|
|
242
|
-
export {
|
|
183
|
+
export { applyPreviewToReactFlow, createPreviewNode, removePreviewFromReactFlow };
|
|
@@ -36,8 +36,8 @@ var __webpack_modules__ = {
|
|
|
36
36
|
"./constraint-validator" (module) {
|
|
37
37
|
module.exports = require("./constraint-validator.cjs");
|
|
38
38
|
},
|
|
39
|
-
"./
|
|
40
|
-
module.exports = require("./
|
|
39
|
+
"./createPreviewNode" (module) {
|
|
40
|
+
module.exports = require("./createPreviewNode.cjs");
|
|
41
41
|
},
|
|
42
42
|
"./export-canvas" (module) {
|
|
43
43
|
module.exports = require("./export-canvas.cjs");
|
|
@@ -114,25 +114,25 @@ var __webpack_exports__ = {};
|
|
|
114
114
|
var __rspack_reexport = {};
|
|
115
115
|
for(const __rspack_import_key in _CssUtil__rspack_import_3)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_CssUtil__rspack_import_3[__rspack_import_key];
|
|
116
116
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
117
|
-
var
|
|
117
|
+
var _collapse__rspack_import_4 = __webpack_require__("./collapse");
|
|
118
118
|
var __rspack_reexport = {};
|
|
119
|
-
for(const __rspack_import_key in
|
|
119
|
+
for(const __rspack_import_key in _collapse__rspack_import_4)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_collapse__rspack_import_4[__rspack_import_key];
|
|
120
120
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
121
|
-
var
|
|
121
|
+
var _coded_agents_d3_layout__rspack_import_5 = __webpack_require__("./coded-agents/d3-layout");
|
|
122
122
|
var __rspack_reexport = {};
|
|
123
|
-
for(const __rspack_import_key in
|
|
123
|
+
for(const __rspack_import_key in _coded_agents_d3_layout__rspack_import_5)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_coded_agents_d3_layout__rspack_import_5[__rspack_import_key];
|
|
124
124
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
125
|
-
var
|
|
125
|
+
var _coded_agents_mermaid_parser__rspack_import_6 = __webpack_require__("./coded-agents/mermaid-parser");
|
|
126
126
|
var __rspack_reexport = {};
|
|
127
|
-
for(const __rspack_import_key in
|
|
127
|
+
for(const __rspack_import_key in _coded_agents_mermaid_parser__rspack_import_6)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_coded_agents_mermaid_parser__rspack_import_6[__rspack_import_key];
|
|
128
128
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
129
129
|
var _constraint_validator__rspack_import_7 = __webpack_require__("./constraint-validator");
|
|
130
130
|
var __rspack_reexport = {};
|
|
131
131
|
for(const __rspack_import_key in _constraint_validator__rspack_import_7)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_constraint_validator__rspack_import_7[__rspack_import_key];
|
|
132
132
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
133
|
-
var
|
|
133
|
+
var _createPreviewNode__rspack_import_8 = __webpack_require__("./createPreviewNode");
|
|
134
134
|
var __rspack_reexport = {};
|
|
135
|
-
for(const __rspack_import_key in
|
|
135
|
+
for(const __rspack_import_key in _createPreviewNode__rspack_import_8)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_createPreviewNode__rspack_import_8[__rspack_import_key];
|
|
136
136
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
137
137
|
var _export_canvas__rspack_import_9 = __webpack_require__("./export-canvas");
|
|
138
138
|
var __rspack_reexport = {};
|
|
@@ -2,11 +2,11 @@ export * from './ArrayUtil';
|
|
|
2
2
|
export * from './auto-layout';
|
|
3
3
|
export * from './CanvasEventBus';
|
|
4
4
|
export * from './CssUtil';
|
|
5
|
+
export * from './collapse';
|
|
5
6
|
export * from './coded-agents/d3-layout';
|
|
6
7
|
export * from './coded-agents/mermaid-parser';
|
|
7
|
-
export * from './collapse';
|
|
8
8
|
export * from './constraint-validator';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './createPreviewNode';
|
|
10
10
|
export * from './export-canvas';
|
|
11
11
|
export * from './GroupModificationUtils';
|
|
12
12
|
export * from './icon-registry';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -2,11 +2,11 @@ export * from "./ArrayUtil.js";
|
|
|
2
2
|
export * from "./auto-layout.js";
|
|
3
3
|
export * from "./CanvasEventBus.js";
|
|
4
4
|
export * from "./CssUtil.js";
|
|
5
|
+
export * from "./collapse.js";
|
|
5
6
|
export * from "./coded-agents/d3-layout.js";
|
|
6
7
|
export * from "./coded-agents/mermaid-parser.js";
|
|
7
|
-
export * from "./collapse.js";
|
|
8
8
|
export * from "./constraint-validator.js";
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./createPreviewNode.js";
|
|
10
10
|
export * from "./export-canvas.js";
|
|
11
11
|
export * from "./GroupModificationUtils.js";
|
|
12
12
|
export * from "./icon-registry.js";
|
|
@@ -65,13 +65,9 @@ const StyledButtonContainer = (0, material_namespaceObject.styled)('div')(()=>({
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}));
|
|
68
|
-
const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default().forwardRef(({ iconName, disabled, iconSize, preventHover, overrideColor, variant = 'outlined', text, tooltip, tooltipPlacement = 'bottom', ariaLabel, ariaDescribedby, title, tabIndex, onMouseEnter, onMouseLeave, onFocus, onBlur, onMouseDown, onMouseUp, onKeyDown, disableInteractiveTooltip = false, 'data-testid': dataTestId
|
|
68
|
+
const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default().forwardRef(({ iconName, disabled, iconSize, preventHover, overrideColor, variant = 'outlined', text, tooltip, tooltipPlacement = 'bottom', ariaLabel, ariaDescribedby, ariaPressed, title, tabIndex, onClick, onMouseEnter, onMouseLeave, onFocus, onBlur, onMouseDown, onMouseUp, onKeyDown, disableInteractiveTooltip = false, 'data-testid': dataTestId }, ref)=>{
|
|
69
69
|
const [iconColor, setIconColor] = external_react_default().useState('var(--color-icon-default)');
|
|
70
70
|
const { chatMode } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
71
|
-
const [isPressed, setIsPressed] = external_react_default().useState(false);
|
|
72
|
-
const onClick = 'onClick' in props ? props.onClick : ()=>{};
|
|
73
|
-
const onPress = 'onPress' in props ? props.onPress : ()=>{};
|
|
74
|
-
const onRelease = 'onRelease' in props ? props.onRelease : ()=>{};
|
|
75
71
|
const showTooltip = tooltip && chatMode !== index_cjs_namespaceObject.AutopilotChatMode.Closed && !disabled;
|
|
76
72
|
const button = text ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StyledButtonContainer, {
|
|
77
73
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.Button, {
|
|
@@ -82,10 +78,6 @@ const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default(
|
|
|
82
78
|
},
|
|
83
79
|
onMouseLeave: (event)=>{
|
|
84
80
|
onMouseLeave?.(event);
|
|
85
|
-
if (isPressed) {
|
|
86
|
-
setIsPressed(false);
|
|
87
|
-
onRelease(event);
|
|
88
|
-
}
|
|
89
81
|
if (!preventHover) setIconColor('var(--color-icon-default)');
|
|
90
82
|
},
|
|
91
83
|
startIcon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_cjs_namespaceObject.ApIcon, {
|
|
@@ -96,6 +88,7 @@ const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default(
|
|
|
96
88
|
}),
|
|
97
89
|
"aria-label": ariaLabel,
|
|
98
90
|
"aria-describedby": ariaDescribedby,
|
|
91
|
+
"aria-pressed": ariaPressed,
|
|
99
92
|
title: showTooltip ? void 0 : title,
|
|
100
93
|
variant: "text",
|
|
101
94
|
size: "small",
|
|
@@ -103,16 +96,8 @@ const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default(
|
|
|
103
96
|
onClick: onClick,
|
|
104
97
|
onFocus: onFocus,
|
|
105
98
|
onBlur: onBlur,
|
|
106
|
-
onMouseDown:
|
|
107
|
-
|
|
108
|
-
setIsPressed(true);
|
|
109
|
-
onPress(event);
|
|
110
|
-
},
|
|
111
|
-
onMouseUp: (event)=>{
|
|
112
|
-
onMouseUp?.(event);
|
|
113
|
-
setIsPressed(false);
|
|
114
|
-
onRelease(event);
|
|
115
|
-
},
|
|
99
|
+
onMouseDown: onMouseDown,
|
|
100
|
+
onMouseUp: onMouseUp,
|
|
116
101
|
tabIndex: tabIndex,
|
|
117
102
|
onKeyDown: onKeyDown,
|
|
118
103
|
"data-testid": dataTestId,
|
|
@@ -125,20 +110,13 @@ const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default(
|
|
|
125
110
|
onClick: onClick,
|
|
126
111
|
onFocus: onFocus,
|
|
127
112
|
onBlur: onBlur,
|
|
128
|
-
onMouseDown:
|
|
129
|
-
|
|
130
|
-
setIsPressed(true);
|
|
131
|
-
onPress(event);
|
|
132
|
-
},
|
|
133
|
-
onMouseUp: (event)=>{
|
|
134
|
-
onMouseUp?.(event);
|
|
135
|
-
setIsPressed(false);
|
|
136
|
-
onRelease(event);
|
|
137
|
-
},
|
|
113
|
+
onMouseDown: onMouseDown,
|
|
114
|
+
onMouseUp: onMouseUp,
|
|
138
115
|
tabIndex: tabIndex,
|
|
139
116
|
onKeyDown: onKeyDown,
|
|
140
117
|
"aria-label": ariaLabel,
|
|
141
118
|
"aria-describedby": ariaDescribedby,
|
|
119
|
+
"aria-pressed": ariaPressed,
|
|
142
120
|
title: showTooltip ? void 0 : title,
|
|
143
121
|
onMouseEnter: (event)=>{
|
|
144
122
|
onMouseEnter?.(event);
|
|
@@ -146,10 +124,6 @@ const AutopilotChatActionButtonComponent = /*#__PURE__*/ external_react_default(
|
|
|
146
124
|
},
|
|
147
125
|
onMouseLeave: (event)=>{
|
|
148
126
|
onMouseLeave?.(event);
|
|
149
|
-
if (isPressed) {
|
|
150
|
-
setIsPressed(false);
|
|
151
|
-
onRelease(event);
|
|
152
|
-
}
|
|
153
127
|
if (!preventHover) setIconColor('var(--color-icon-default)');
|
|
154
128
|
},
|
|
155
129
|
"data-testid": dataTestId,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type TooltipProps } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
interface AutopilotChatActionButtonBaseProps {
|
|
3
|
+
interface AutopilotChatActionButtonProps {
|
|
5
4
|
iconName: string;
|
|
6
5
|
iconSize?: string;
|
|
7
6
|
disabled?: boolean;
|
|
@@ -13,9 +12,11 @@ interface AutopilotChatActionButtonBaseProps {
|
|
|
13
12
|
tooltipPlacement?: TooltipProps['placement'];
|
|
14
13
|
ariaLabel?: string;
|
|
15
14
|
ariaDescribedby?: string;
|
|
15
|
+
ariaPressed?: boolean;
|
|
16
16
|
title?: string;
|
|
17
17
|
tabIndex?: number;
|
|
18
18
|
disableInteractiveTooltip?: boolean;
|
|
19
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
20
|
onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
20
21
|
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
21
22
|
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -25,13 +26,6 @@ interface AutopilotChatActionButtonBaseProps {
|
|
|
25
26
|
onMouseLeave?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
26
27
|
'data-testid'?: string;
|
|
27
28
|
}
|
|
28
|
-
interface AutopilotChatActionButtonClickProps {
|
|
29
|
-
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
30
|
-
}
|
|
31
|
-
interface AutopilotChatActionButtonPressProps {
|
|
32
|
-
onPress: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
33
|
-
onRelease: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
34
|
-
}
|
|
35
29
|
export declare const AutopilotChatActionButton: React.NamedExoticComponent<AutopilotChatActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
36
30
|
export {};
|
|
37
31
|
//# sourceMappingURL=action-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-button.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/common/action-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlE,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"action-button.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/common/action-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlE,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,UAAU,8BAA8B;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACnE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACjE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACpE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA0ID,eAAO,MAAM,yBAAyB,qGAAiD,CAAC"}
|