react-chessboard-ui 1.3.0 → 1.4.1

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.
@@ -2607,9 +2607,13 @@ var useChessBoardInteractive = function useChessBoardInteractive(props) {
2607
2607
  clearClickedPos();
2608
2608
  clearClickPossibleMoves();
2609
2609
  };
2610
- var handleClick = function handleClick(cellPos) {
2610
+ var handleClick = function handleClick(cellPos, viewOnly) {
2611
+ if (viewOnly === void 0) {
2612
+ viewOnly = false;
2613
+ }
2611
2614
  clearMarkedCells();
2612
2615
  clearArrows();
2616
+ if (viewOnly) return;
2613
2617
  if (clickedPos[0] === -1) {
2614
2618
  selectClickFrom(cellPos);
2615
2619
  return;
@@ -2886,7 +2890,8 @@ var ChessBoard = function ChessBoard(props) {
2886
2890
  change = props.change,
2887
2891
  reversed = props.reversed,
2888
2892
  config = props.config,
2889
- playerColor = props.playerColor;
2893
+ playerColor = props.playerColor,
2894
+ viewOnly = props.viewOnly;
2890
2895
  var _useChessBoardInterac = useChessBoardInteractive({
2891
2896
  onChange: onChange,
2892
2897
  onEndGame: onEndGame,
@@ -2969,12 +2974,14 @@ var ChessBoard = function ChessBoard(props) {
2969
2974
  boardConfig: boardConfig
2970
2975
  }), React.createElement(ChessBoardControlLayout, {
2971
2976
  boardConfig: boardConfig,
2972
- onClick: handleClick,
2973
- onGrabStart: selectHoverFrom,
2977
+ onClick: function onClick(pos) {
2978
+ return handleClick(pos, viewOnly);
2979
+ },
2980
+ onGrabStart: viewOnly ? function () {} : selectHoverFrom,
2974
2981
  onGrabStartRight: startRenderArrow,
2975
- onGrabEnd: handleGrabEnd,
2982
+ onGrabEnd: viewOnly ? function () {} : handleGrabEnd,
2976
2983
  onGrabEndRight: endRenderArrow,
2977
- onGrabbing: handleGrabbing,
2984
+ onGrabbing: viewOnly ? function () {} : handleGrabbing,
2978
2985
  onRightClick: markCell,
2979
2986
  onGrabbingCell: handleGrabbingCell
2980
2987
  }), showFigurePicker && React.createElement("div", {