likec4 1.23.1 → 1.24.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "likec4",
3
- "version": "1.23.1",
3
+ "version": "1.24.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -70,7 +70,7 @@
70
70
  "rollup": "4.34.6",
71
71
  "type-fest": "4.34.1",
72
72
  "vite": "5.4.14",
73
- "@likec4/core": "~1.23.1"
73
+ "@likec4/core": "~1.24.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@dagrejs/dagre": "1.1.4",
@@ -93,8 +93,8 @@
93
93
  "@vanilla-extract/css": "^1.17.1",
94
94
  "@vanilla-extract/dynamic": "^2.1.2",
95
95
  "@vanilla-extract/vite-plugin": "^5.0.1",
96
- "@xyflow/react": "12.4.2",
97
- "@xyflow/system": "0.0.50",
96
+ "@xyflow/react": "12.4.3",
97
+ "@xyflow/system": "0.0.51",
98
98
  "autoprefixer": "^10.4.20",
99
99
  "classnames": "^2.5.1",
100
100
  "clsx": "^2.1.1",
@@ -143,17 +143,20 @@
143
143
  "vite-plugin-dts": "^4.5.0",
144
144
  "vite-plugin-shadow-style": "^1.2.0",
145
145
  "vite-plugin-singlefile": "^2.1.0",
146
+ "vscode-jsonrpc": "8.2.0",
147
+ "vscode-languageserver": "9.0.1",
148
+ "vscode-uri": "3.1.0",
146
149
  "vscode-languageserver-types": "3.17.5",
147
150
  "vitest": "^3.0.4",
148
151
  "which": "^5.0.0",
149
152
  "yargs": "17.7.2",
150
- "@likec4/diagram": "1.23.1",
151
- "@likec4/icons": "1.23.1",
152
- "@likec4/generators": "1.23.1",
153
- "@likec4/language-server": "1.23.1",
154
- "@likec4/layouts": "1.23.1",
155
- "@likec4/log": "1.23.1",
156
- "@likec4/tsconfig": "1.23.1"
153
+ "@likec4/diagram": "1.24.0",
154
+ "@likec4/generators": "1.24.0",
155
+ "@likec4/language-server": "1.24.0",
156
+ "@likec4/layouts": "1.24.0",
157
+ "@likec4/log": "1.24.0",
158
+ "@likec4/tsconfig": "1.24.0",
159
+ "@likec4/icons": "1.24.0"
157
160
  },
158
161
  "scripts": {
159
162
  "turbo-build": "turbo run build --log-prefix=none --log-order=grouped",
@@ -179,7 +182,7 @@
179
182
  "dev:playground:deployment": "pnpm cli:serve ../../apps/playground/src/examples/deployment",
180
183
  "dev:template": "pnpm cli:serve ../create-likec4/template",
181
184
  "dev:e2e": "pnpm cli:serve ../../e2e/src",
182
- "dev:example-cloud": "cli:serve ../../examples/cloud-system",
185
+ "dev:example-cloud": "pnpm cli:serve ../../examples/cloud-system",
183
186
  "dev:failed": "pnpm cli:serve ../../examples/failed",
184
187
  "dev:example-dev": "pnpm cli:serve ../../examples/diagrams-dev/likec4",
185
188
  "cli": "tsx --conditions=sources src/cli/index.ts",
package/react/index.js CHANGED
@@ -20077,7 +20077,12 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
20077
20077
  async function autoPan() {
20078
20078
  if (!containerBounds)
20079
20079
  return;
20080
- const { transform: transform2, panBy: panBy2, autoPanSpeed } = getStoreItems(), [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);
20080
+ const { transform: transform2, panBy: panBy2, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();
20081
+ if (!autoPanOnNodeDrag) {
20082
+ autoPanStarted = !1, cancelAnimationFrame(autoPanId);
20083
+ return;
20084
+ }
20085
+ const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);
20081
20086
  (xMovement !== 0 || yMovement !== 0) && (lastPos.x = (lastPos.x ?? 0) - xMovement / transform2[2], lastPos.y = (lastPos.y ?? 0) - yMovement / transform2[2], await panBy2({ x: xMovement, y: yMovement }) && updateNodes2(lastPos, null)), autoPanId = requestAnimationFrame(autoPan);
20082
20087
  }
20083
20088
  function startDrag(event) {
@@ -20932,6 +20937,7 @@ const selector$n = (s2) => s2.userSelectionActive ? "none" : "all", Panel = forw
20932
20937
  const pointerEvents = useStore$1(selector$n), positionClasses = `${position2}`.split("-");
20933
20938
  return jsx("div", { className: cc(["react-flow__panel", className, ...positionClasses]), style: { ...style2, pointerEvents }, ref, ...rest, children: children2 });
20934
20939
  });
20940
+ Panel.displayName = "Panel";
20935
20941
  function Attribution({ proOptions, position: position2 = "bottom-right" }) {
20936
20942
  return proOptions != null && proOptions.hideAttribution ? null : jsx(Panel, { position: position2, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: jsx("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) });
20937
20943
  }
@@ -21025,9 +21031,11 @@ const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, rea
21025
21031
  setDefaultNodesAndEdges: s2.setDefaultNodesAndEdges,
21026
21032
  setPaneClickDistance: s2.setPaneClickDistance
21027
21033
  }), initPrevValues = {
21028
- // these are values that are also passed directly to other components
21029
- // than the StoreUpdater. We can reduce the number of setStore calls
21030
- // by setting the same values here as prev fields.
21034
+ /*
21035
+ * these are values that are also passed directly to other components
21036
+ * than the StoreUpdater. We can reduce the number of setStore calls
21037
+ * by setting the same values here as prev fields.
21038
+ */
21031
21039
  translateExtent: infiniteExtent,
21032
21040
  nodeOrigin: defaultNodeOrigin,
21033
21041
  minZoom: 0.5,
@@ -21168,15 +21176,15 @@ const useViewportHelper = () => {
21168
21176
  const { width: width2, height, minZoom, maxZoom, panZoom } = store.getState(), viewport = getViewportForBounds(bounds, width2, height, minZoom, maxZoom, (options == null ? void 0 : options.padding) ?? 0.1);
21169
21177
  return panZoom ? (await panZoom.setViewport(viewport, { duration: options == null ? void 0 : options.duration }), Promise.resolve(!0)) : Promise.resolve(!1);
21170
21178
  },
21171
- screenToFlowPosition: (clientPosition, options = { snapToGrid: !0 }) => {
21172
- const { transform: transform2, snapGrid, domNode } = store.getState();
21179
+ screenToFlowPosition: (clientPosition, options = {}) => {
21180
+ const { transform: transform2, snapGrid, snapToGrid, domNode } = store.getState();
21173
21181
  if (!domNode)
21174
21182
  return clientPosition;
21175
21183
  const { x: domX, y: domY } = domNode.getBoundingClientRect(), correctedPosition = {
21176
21184
  x: clientPosition.x - domX,
21177
21185
  y: clientPosition.y - domY
21178
- };
21179
- return pointToRendererPoint(correctedPosition, transform2, options.snapToGrid, snapGrid);
21186
+ }, _snapGrid = options.snapGrid ?? snapGrid, _snapToGrid = options.snapToGrid ?? snapToGrid;
21187
+ return pointToRendererPoint(correctedPosition, transform2, _snapToGrid, _snapGrid);
21180
21188
  },
21181
21189
  flowToScreenPosition: (flowPosition) => {
21182
21190
  const { transform: transform2, domNode } = store.getState();
@@ -21861,8 +21869,10 @@ function HandleComponent({ type = "source", position: position2 = Position.Top,
21861
21869
  connectingfrom: connectingFrom,
21862
21870
  connectingto: connectingTo,
21863
21871
  valid,
21864
- // shows where you can start a connection from
21865
- // and where you can end it while connecting
21872
+ /*
21873
+ * shows where you can start a connection from
21874
+ * and where you can end it while connecting
21875
+ */
21866
21876
  connectionindicator: isConnectable && (!connectionInProcess || isPossibleEndHandle) && (connectionInProcess ? isConnectableEnd : isConnectableStart)
21867
21877
  }
21868
21878
  ]), onMouseDown: onPointerDown2, onTouchStart: onPointerDown2, onClick: connectOnClick ? onClick : void 0, ref, ...rest, children: children2 });
@@ -21979,7 +21989,7 @@ function useNodeObserver({ node: node2, nodeType, hasDimensions, resizeObserver
21979
21989
  }
21980
21990
  }, [node2.id, nodeType, node2.sourcePosition, node2.targetPosition]), nodeRef2;
21981
21991
  }
21982
- function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes: nodeTypes2, nodeExtent, nodeClickDistance, onError }) {
21992
+ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes: nodeTypes2, nodeClickDistance, onError }) {
21983
21993
  const { node: node2, internals, isParent: isParent2 } = useStore$1((s2) => {
21984
21994
  const node22 = s2.nodeLookup.get(id2), isParent22 = s2.parentLookup.has(id2);
21985
21995
  return {
@@ -22059,29 +22069,31 @@ const selector$b = (s2) => ({
22059
22069
  function NodeRendererComponent(props) {
22060
22070
  const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore$1(selector$b, shallow$1), nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements), resizeObserver = useResizeObserver();
22061
22071
  return jsx("div", { className: "react-flow__nodes", style: containerStyle, children: nodeIds.map((nodeId) => (
22062
- // The split of responsibilities between NodeRenderer and
22063
- // NodeComponentWrapper may appear weird. However, it’s designed to
22064
- // minimize the cost of updates when individual nodes change.
22065
- //
22066
- // For example, when you’re dragging a single node, that node gets
22067
- // updated multiple times per second. If `NodeRenderer` were to update
22068
- // every time, it would have to re-run the `nodes.map()` loop every
22069
- // time. This gets pricey with hundreds of nodes, especially if every
22070
- // loop cycle does more than just rendering a JSX element!
22071
- //
22072
- // As a result of this choice, we took the following implementation
22073
- // decisions:
22074
- // - NodeRenderer subscribes *only* to node IDs – and therefore
22075
- // rerender *only* when visible nodes are added or removed.
22076
- // - NodeRenderer performs all operations the result of which can be
22077
- // shared between nodes (such as creating the `ResizeObserver`
22078
- // instance, or subscribing to `selector`). This means extra prop
22079
- // drilling into `NodeComponentWrapper`, but it means we need to run
22080
- // these operations only once instead of once per node.
22081
- // - Any operations that you’d normally write inside `nodes.map` are
22082
- // moved into `NodeComponentWrapper`. This ensures they are
22083
- // memorized so if `NodeRenderer` *has* to rerender, it only
22084
- // needs to regenerate the list of nodes, nothing else.
22072
+ /*
22073
+ * The split of responsibilities between NodeRenderer and
22074
+ * NodeComponentWrapper may appear weird. However, it’s designed to
22075
+ * minimize the cost of updates when individual nodes change.
22076
+ *
22077
+ * For example, when you’re dragging a single node, that node gets
22078
+ * updated multiple times per second. If `NodeRenderer` were to update
22079
+ * every time, it would have to re-run the `nodes.map()` loop every
22080
+ * time. This gets pricey with hundreds of nodes, especially if every
22081
+ * loop cycle does more than just rendering a JSX element!
22082
+ *
22083
+ * As a result of this choice, we took the following implementation
22084
+ * decisions:
22085
+ * - NodeRenderer subscribes *only* to node IDs and therefore
22086
+ * rerender *only* when visible nodes are added or removed.
22087
+ * - NodeRenderer performs all operations the result of which can be
22088
+ * shared between nodes (such as creating the `ResizeObserver`
22089
+ * instance, or subscribing to `selector`). This means extra prop
22090
+ * drilling into `NodeComponentWrapper`, but it means we need to run
22091
+ * these operations only once instead of once per node.
22092
+ * - Any operations that you’d normally write inside `nodes.map` are
22093
+ * moved into `NodeComponentWrapper`. This ensures they are
22094
+ * memorized so if `NodeRenderer` *has* to rerender, it only
22095
+ * needs to regenerate the list of nodes, nothing else.
22096
+ */
22085
22097
  jsx(NodeWrapper, { id: nodeId, nodeTypes: props.nodeTypes, nodeExtent: props.nodeExtent, onClick: props.onNodeClick, onMouseEnter: props.onNodeMouseEnter, onMouseMove: props.onNodeMouseMove, onMouseLeave: props.onNodeMouseLeave, onContextMenu: props.onNodeContextMenu, onDoubleClick: props.onNodeDoubleClick, noDragClassName: props.noDragClassName, noPanClassName: props.noPanClassName, rfId: props.rfId, disableKeyboardA11y: props.disableKeyboardA11y, resizeObserver, nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, nodeClickDistance: props.nodeClickDistance, onError }, nodeId)
22086
22098
  )) });
22087
22099
  }
@@ -22587,9 +22599,11 @@ const GraphView = memo$2(GraphViewComponent), getInitialState = ({ nodes, edges,
22587
22599
  setEdges(edges2), set2({ hasDefaultEdges: !0 });
22588
22600
  }
22589
22601
  },
22590
- // Every node gets registerd at a ResizeObserver. Whenever a node
22591
- // changes its dimensions, this function is called to measure the
22592
- // new dimensions and update the nodes.
22602
+ /*
22603
+ * Every node gets registerd at a ResizeObserver. Whenever a node
22604
+ * changes its dimensions, this function is called to measure the
22605
+ * new dimensions and update the nodes.
22606
+ */
22593
22607
  updateNodeInternals: (updates, params = { triggerFitView: !0 }) => {
22594
22608
  const { triggerNodeChanges, nodeLookup, parentLookup, fitViewOnInit, fitViewDone, fitViewOnInitOptions, domNode, nodeOrigin: nodeOrigin2, nodeExtent: nodeExtent2, debug: debug2, fitViewSync } = get2(), { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin2, nodeExtent2);
22595
22609
  if (updatedInternals) {
@@ -22724,8 +22738,10 @@ const GraphView = memo$2(GraphViewComponent), getInitialState = ({ nodes, edges,
22724
22738
  maxZoom
22725
22739
  }, options);
22726
22740
  },
22727
- // we can't call an asnychronous function in updateNodeInternals
22728
- // for that we created this sync version of fitView
22741
+ /*
22742
+ * we can't call an asnychronous function in updateNodeInternals
22743
+ * for that we created this sync version of fitView
22744
+ */
22729
22745
  fitViewSync: (options) => {
22730
22746
  const { panZoom, width: width22, height: height2, minZoom, maxZoom, nodeLookup } = get2();
22731
22747
  if (!panZoom)
@@ -22774,9 +22790,11 @@ const wrapperStyle = {
22774
22790
  position: "relative",
22775
22791
  zIndex: 0
22776
22792
  };
22777
- function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes: nodeTypes2, edgeTypes: edgeTypes2, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = "Backspace", selectionKeyCode = "Shift", selectionOnDrag = !1, selectionMode = SelectionMode.Full, panActivationKeyCode = "Space", multiSelectionKeyCode = isMacOs() ? "Meta" : "Control", zoomActivationKeyCode = isMacOs() ? "Meta" : "Control", snapToGrid, snapGrid, onlyRenderVisibleElements = !1, selectNodesOnDrag, nodesDraggable, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = !0, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = !0, nodeExtent, defaultMarkerColor = "#b1b1b7", zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children: children2, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = "nodrag", noWheelClassName = "nowheel", noPanClassName = "nopan", fitView: fitView2, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = !1, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style: style2, id: id2, nodeDragThreshold, viewport, onViewportChange, width: width2, height, colorMode = "light", debug: debug2, ...rest }, ref) {
22778
- const rfId = id2 || "1", colorModeClassName = useColorModeClass(colorMode);
22779
- return jsx("div", { "data-testid": "rf__wrapper", ...rest, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, children: jsxs(Wrapper, { nodes, edges, width: width2, height, fitView: fitView2, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes: nodeTypes2, edgeTypes: edgeTypes2, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView: fitView2, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, onBeforeDelete, paneClickDistance, debug: debug2 }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
22793
+ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes: nodeTypes2, edgeTypes: edgeTypes2, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = "Backspace", selectionKeyCode = "Shift", selectionOnDrag = !1, selectionMode = SelectionMode.Full, panActivationKeyCode = "Space", multiSelectionKeyCode = isMacOs() ? "Meta" : "Control", zoomActivationKeyCode = isMacOs() ? "Meta" : "Control", snapToGrid, snapGrid, onlyRenderVisibleElements = !1, selectNodesOnDrag, nodesDraggable, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = !0, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = !0, nodeExtent, defaultMarkerColor = "#b1b1b7", zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children: children2, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = "nodrag", noWheelClassName = "nowheel", noPanClassName = "nopan", fitView: fitView2, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = !1, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style: style2, id: id2, nodeDragThreshold, viewport, onViewportChange, width: width2, height, colorMode = "light", debug: debug2, onScroll, ...rest }, ref) {
22794
+ const rfId = id2 || "1", colorModeClassName = useColorModeClass(colorMode), wrapperOnScroll = useCallback((e2) => {
22795
+ e2.currentTarget.scrollTo({ top: 0, left: 0, behavior: "instant" }), onScroll == null || onScroll(e2);
22796
+ }, [onScroll]);
22797
+ return jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, children: jsxs(Wrapper, { nodes, edges, width: width2, height, fitView: fitView2, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes: nodeTypes2, edgeTypes: edgeTypes2, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView: fitView2, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, onBeforeDelete, paneClickDistance, debug: debug2 }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
22780
22798
  }
22781
22799
  var index = fixedForwardRef(ReactFlow);
22782
22800
  const selector$6 = (s2) => {
@@ -22907,18 +22925,22 @@ function MiniMapNodes({
22907
22925
  nodeClassName = "",
22908
22926
  nodeBorderRadius = 5,
22909
22927
  nodeStrokeWidth,
22910
- // We need to rename the prop to be `CapitalCase` so that JSX will render it as
22911
- // a component properly.
22928
+ /*
22929
+ * We need to rename the prop to be `CapitalCase` so that JSX will render it as
22930
+ * a component properly.
22931
+ */
22912
22932
  nodeComponent: NodeComponent = MiniMapNode,
22913
22933
  onClick
22914
22934
  }) {
22915
22935
  const nodeIds = useStore$1(selectorNodeIds, shallow$1), nodeColorFunc = getAttrFunction(nodeColor), nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor), nodeClassNameFunc = getAttrFunction(nodeClassName), shapeRendering = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
22916
22936
  return jsx(Fragment$1, { children: nodeIds.map((nodeId) => (
22917
- // The split of responsibilities between MiniMapNodes and
22918
- // NodeComponentWrapper may appear weird. However, it’s designed to
22919
- // minimize the cost of updates when individual nodes change.
22920
- //
22921
- // For more details, see a similar commit in `NodeRenderer/index.tsx`.
22937
+ /*
22938
+ * The split of responsibilities between MiniMapNodes and
22939
+ * NodeComponentWrapper may appear weird. However, it’s designed to
22940
+ * minimize the cost of updates when individual nodes change.
22941
+ *
22942
+ * For more details, see a similar commit in `NodeRenderer/index.tsx`.
22943
+ */
22922
22944
  jsx(NodeComponentWrapper, { id: nodeId, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, NodeComponent, onClick, shapeRendering }, nodeId)
22923
22945
  )) });
22924
22946
  }
@@ -22962,8 +22984,10 @@ function MiniMapComponent({
22962
22984
  nodeClassName = "",
22963
22985
  nodeBorderRadius = 5,
22964
22986
  nodeStrokeWidth,
22965
- // We need to rename the prop to be `CapitalCase` so that JSX will render it as
22966
- // a component properly.
22987
+ /*
22988
+ * We need to rename the prop to be `CapitalCase` so that JSX will render it as
22989
+ * a component properly.
22990
+ */
22967
22991
  nodeComponent,
22968
22992
  bgColor,
22969
22993
  maskColor,
@@ -23153,11 +23177,12 @@ const nodeEqualityFn = (a2, b2) => (a2 == null ? void 0 : a2.internals.positionA
23153
23177
  selectedNodesCount: state.nodes.filter((node2) => node2.selected).length
23154
23178
  });
23155
23179
  function NodeToolbar({ nodeId, children: children2, className, style: style2, isVisible, position: position2 = Position.Top, offset: offset2 = 10, align = "center", ...rest }) {
23180
+ var _a;
23156
23181
  const contextNodeId = useNodeId(), nodesSelector2 = useCallback((state) => (Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ""]).reduce((res, id2) => {
23157
23182
  const node2 = state.nodeLookup.get(id2);
23158
23183
  return node2 && res.set(node2.id, node2), res;
23159
23184
  }, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore$1(nodesSelector2, nodesEqualityFn), { x: x2, y: y2, zoom: zoom2, selectedNodesCount } = useStore$1(storeSelector, shallow$1);
23160
- if (!(typeof isVisible == "boolean" ? isVisible : nodes.size === 1 && nodes.values().next().value.selected && selectedNodesCount === 1) || !nodes.size)
23185
+ if (!(typeof isVisible == "boolean" ? isVisible : nodes.size === 1 && ((_a = nodes.values().next().value) == null ? void 0 : _a.selected) && selectedNodesCount === 1) || !nodes.size)
23161
23186
  return null;
23162
23187
  const nodeRect = getInternalNodesBounds(nodes), nodesArray = Array.from(nodes.values()), zIndex = Math.max(...nodesArray.map((node2) => node2.internals.z + 1)), wrapperStyle2 = {
23163
23188
  position: "absolute",
@@ -39022,6 +39047,17 @@ const diagramMachine = setup({
39022
39047
  },
39023
39048
  "trigger:OpenSource": (_, _params) => {
39024
39049
  },
39050
+ "open source of focused node": enqueueActions(({ context, enqueue }) => {
39051
+ if (!context.focusedNode || !context.features.enableVscode) return;
39052
+ const diagramNode = findDiagramNode(context, context.focusedNode);
39053
+ diagramNode && (enqueue.cancel("openSource"), DiagramNode.deploymentRef(diagramNode) ? enqueue.raise({ type: "open.source", deployment: DiagramNode.deploymentRef(diagramNode) }, {
39054
+ id: "openSource",
39055
+ delay: 100
39056
+ }) : DiagramNode.modelRef(diagramNode) && enqueue.raise({ type: "open.source", element: DiagramNode.modelRef(diagramNode) }, {
39057
+ id: "openSource",
39058
+ delay: 100
39059
+ }));
39060
+ }),
39025
39061
  "xyflow:fitDiagram": ({ context }, params) => {
39026
39062
  const {
39027
39063
  bounds = context.view.bounds,
@@ -39220,6 +39256,7 @@ const diagramMachine = setup({
39220
39256
  ...focusNodesEdges(s2),
39221
39257
  viewportBeforeFocus: { ...s2.context.viewport }
39222
39258
  })),
39259
+ "open source of focused node",
39223
39260
  spawnChild("hotkeyActorLogic", { id: "hotkey" }),
39224
39261
  {
39225
39262
  type: "xyflow:fitDiagram",
@@ -39246,6 +39283,7 @@ const diagramMachine = setup({
39246
39283
  focusedNode: ({ event }) => event.node.id
39247
39284
  }),
39248
39285
  assign(focusNodesEdges),
39286
+ "open source of focused node",
39249
39287
  {
39250
39288
  type: "xyflow:fitDiagram",
39251
39289
  params: focusedBounds
@@ -39259,6 +39297,7 @@ const diagramMachine = setup({
39259
39297
  focusedNode: ({ event }) => event.nodeId
39260
39298
  }),
39261
39299
  assign(focusNodesEdges),
39300
+ "open source of focused node",
39262
39301
  {
39263
39302
  type: "xyflow:fitDiagram",
39264
39303
  params: focusedBounds