@rkmodules/rules 0.0.162 → 0.0.163

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/index.cjs.js CHANGED
@@ -7491,7 +7491,7 @@ var ConnectionLine = (function (_a) {
7491
7491
  */
7492
7492
  var emptyObject = {};
7493
7493
  function FlowInner(_a) {
7494
- var fn = _a.function, _b = _a.positions, defaultPositions = _b === void 0 ? emptyObject : _b, engine = _a.engine, _c = _a.center, center = _c === void 0 ? true : _c, fitView = _a.fitView, _d = _a.customNodes, customNodes = _d === void 0 ? {} : _d, onChange = _a.onChange, onClick = _a.onClick, onContextMenu = _a.onContextMenu, onSelect = _a.onSelect, onInit = _a.onInit;
7494
+ var fn = _a.function, _b = _a.positions, defaultPositions = _b === void 0 ? emptyObject : _b, engine = _a.engine, _c = _a.center, center = _c === void 0 ? true : _c, fitView = _a.fitView, _d = _a.customNodes, customNodes = _d === void 0 ? {} : _d, onChange = _a.onChange, onClick = _a.onClick, onContextMenu = _a.onContextMenu, onMouseMove = _a.onMouseMove, onSelect = _a.onSelect, onInit = _a.onInit;
7495
7495
  var _e = __read(React.useState(null), 2), instance = _e[0], setInstance = _e[1];
7496
7496
  var handleInit = function (instance) {
7497
7497
  setInstance(instance);
@@ -7595,21 +7595,30 @@ function FlowInner(_a) {
7595
7595
  }, [onChange, fn]);
7596
7596
  // handle canvas clicks to be able to place nodes
7597
7597
  var handleClick = function (e) {
7598
- if (instance) {
7598
+ if (instance && onClick) {
7599
7599
  var position = instance.screenToFlowPosition({
7600
7600
  x: e.clientX,
7601
7601
  y: e.clientY,
7602
7602
  });
7603
- onClick === null || onClick === void 0 ? void 0 : onClick(e, position);
7603
+ onClick(e, position);
7604
7604
  }
7605
7605
  };
7606
7606
  var handleContextMenu = function (e) {
7607
- if (instance) {
7607
+ if (instance && onContextMenu) {
7608
7608
  var position = instance.screenToFlowPosition({
7609
7609
  x: e.clientX,
7610
7610
  y: e.clientY,
7611
7611
  });
7612
- onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(e, position);
7612
+ onContextMenu(e, position);
7613
+ }
7614
+ };
7615
+ var handleMouseMove = function (e) {
7616
+ if (instance && onMouseMove) {
7617
+ var position = instance.screenToFlowPosition({
7618
+ x: e.clientX,
7619
+ y: e.clientY,
7620
+ });
7621
+ onMouseMove(e, position);
7613
7622
  }
7614
7623
  };
7615
7624
  var onNodesChange = React.useCallback(function (changes) {
@@ -7632,7 +7641,7 @@ function FlowInner(_a) {
7632
7641
  return react.applyEdgeChanges(changes, edgesSnapshot);
7633
7642
  });
7634
7643
  }, []);
7635
- return (React.createElement(react.ReactFlow, { ref: drop, nodes: nodes, edges: edges, nodeTypes: __assign(__assign({}, nodeTypes), customNodes), onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onNodeDragStop: function (e, n) { return updatePosition(n.id, n.position); }, onConnect: onConnect, onInit: handleInit, onPaneClick: handleClick, onPaneContextMenu: handleContextMenu, fitView: center || fitView, fitViewOptions: {
7644
+ return (React.createElement(react.ReactFlow, { ref: drop, nodes: nodes, edges: edges, nodeTypes: __assign(__assign({}, nodeTypes), customNodes), onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onNodeDragStop: function (e, n) { return updatePosition(n.id, n.position); }, onConnect: onConnect, onInit: handleInit, onPaneClick: handleClick, onPaneContextMenu: handleContextMenu, onPaneMouseMove: handleMouseMove, fitView: center || fitView, fitViewOptions: {
7636
7645
  minZoom: fitView ? undefined : 1,
7637
7646
  maxZoom: fitView ? undefined : 1,
7638
7647
  },