next-chessground 0.11.1 → 0.11.5

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.es.js CHANGED
@@ -5970,7 +5970,7 @@ const useChess = props => {
5970
5970
  setChess(new chess.Chess(props.fen));
5971
5971
  setLastMove([]);
5972
5972
  }
5973
- }, [props.fen]);
5973
+ }, [props.fen, props.reset]);
5974
5974
  const [lastMove, setLastMove] = useState([]);
5975
5975
  const promotion = props.lastMove && props.lastMove.promotion;
5976
5976
  const turnColor = chess$1.turn() === 'w' ? 'white' : 'black';
@@ -6371,19 +6371,20 @@ const cgProps = props => {
6371
6371
  if (cgProps.orientation === 'b') {
6372
6372
  cgProps.orientation = 'black';
6373
6373
  }
6374
- }
6375
-
6376
- if (props.drawable === false) {
6377
- cgProps.drawable = {
6378
- enabled: false
6379
- };
6380
6374
  } // pass props directly to Chessground
6381
6375
 
6382
6376
 
6383
- const passProps = ['shapes', 'onSelect'];
6377
+ const passProps = ['shapes', 'onSelect', 'drawable'];
6384
6378
 
6385
6379
  for (const prop of passProps) {
6386
6380
  cgProps[prop] = props[prop];
6381
+ } // helper that disables Chessground drawable option
6382
+
6383
+
6384
+ if (props.drawable === false) {
6385
+ cgProps.drawable = {
6386
+ enabled: false
6387
+ };
6387
6388
  }
6388
6389
 
6389
6390
  return cgProps;
@@ -7025,6 +7026,13 @@ class Stockfish {
7025
7026
  });
7026
7027
  }
7027
7028
 
7029
+ async new_position(fen) {
7030
+ await this.stop();
7031
+ await this.is_ready();
7032
+ this.set_position(fen);
7033
+ this.go_infinite();
7034
+ }
7035
+
7028
7036
  set_multipv(numPv) {
7029
7037
  window.chessEngineWorker.postMessage('setoption name MultiPV value ' + numPv);
7030
7038
  }
package/dist/index.js CHANGED
@@ -5979,7 +5979,7 @@ const useChess = props => {
5979
5979
  setChess(new chess.Chess(props.fen));
5980
5980
  setLastMove([]);
5981
5981
  }
5982
- }, [props.fen]);
5982
+ }, [props.fen, props.reset]);
5983
5983
  const [lastMove, setLastMove] = React.useState([]);
5984
5984
  const promotion = props.lastMove && props.lastMove.promotion;
5985
5985
  const turnColor = chess$1.turn() === 'w' ? 'white' : 'black';
@@ -6380,19 +6380,20 @@ const cgProps = props => {
6380
6380
  if (cgProps.orientation === 'b') {
6381
6381
  cgProps.orientation = 'black';
6382
6382
  }
6383
- }
6384
-
6385
- if (props.drawable === false) {
6386
- cgProps.drawable = {
6387
- enabled: false
6388
- };
6389
6383
  } // pass props directly to Chessground
6390
6384
 
6391
6385
 
6392
- const passProps = ['shapes', 'onSelect'];
6386
+ const passProps = ['shapes', 'onSelect', 'drawable'];
6393
6387
 
6394
6388
  for (const prop of passProps) {
6395
6389
  cgProps[prop] = props[prop];
6390
+ } // helper that disables Chessground drawable option
6391
+
6392
+
6393
+ if (props.drawable === false) {
6394
+ cgProps.drawable = {
6395
+ enabled: false
6396
+ };
6396
6397
  }
6397
6398
 
6398
6399
  return cgProps;
@@ -7034,6 +7035,13 @@ class Stockfish {
7034
7035
  });
7035
7036
  }
7036
7037
 
7038
+ async new_position(fen) {
7039
+ await this.stop();
7040
+ await this.is_ready();
7041
+ this.set_position(fen);
7042
+ this.go_infinite();
7043
+ }
7044
+
7037
7045
  set_multipv(numPv) {
7038
7046
  window.chessEngineWorker.postMessage('setoption name MultiPV value ' + numPv);
7039
7047
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-chessground",
3
- "version": "0.11.1",
3
+ "version": "0.11.5",
4
4
  "description": "React and Next wrapper for Chessground with chessboard and pieces out of the box",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",