cm-chessboard 4.0.2 → 4.0.3

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.
@@ -0,0 +1,2 @@
1
+ # Pre Moves
2
+
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html lang="de">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <title>cm-chessboard</title>
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html lang="de">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <title>cm-chessboard</title>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "A JavaScript chessboard which is lightweight, ES6 module based, responsive, SVG rendered and without dependencies.",
5
5
  "keywords": [
6
6
  "chess",
@@ -87,11 +87,7 @@ export class Chessboard {
87
87
  if (props.accessibility) {
88
88
  Object.assign(this.props.accessibility, props.accessibility)
89
89
  }
90
- /*
91
- if (this.props.style.aspectRatio) {
92
- this.context.style.height = (this.context.offsetWidth * this.props.style.aspectRatio) + "px"
93
- }
94
- */
90
+
95
91
  this.state = new ChessboardState()
96
92
  this.view = new ChessboardViewAccessible(this)
97
93
  /*
@@ -215,7 +215,7 @@ export class ChessboardMoveInput {
215
215
  if (e.type === "mousedown" && e.button === 0 || e.type === "touchstart") {
216
216
  const square = e.target.getAttribute("data-square")
217
217
  const pieceName = this.chessboard.getPiece(square)
218
- console.log("onPointerDown", square, pieceName)
218
+ // console.log("onPointerDown", square, pieceName)
219
219
  let color
220
220
  if (pieceName) {
221
221
  color = pieceName ? pieceName.substring(0, 1) : undefined
@@ -339,7 +339,7 @@ export class ChessboardMoveInput {
339
339
  if (this.moveInputState === STATE.dragTo || this.moveInputState === STATE.clickDragTo) {
340
340
  if (this.fromSquare === square) {
341
341
  if (this.moveInputState === STATE.clickDragTo) {
342
- this.chessboard.state.setPiece(this.fromSquare, this.movedPiece)
342
+ this.chessboard.state.position.setPiece(this.fromSquare, this.movedPiece)
343
343
  this.view.setPieceVisibility(this.fromSquare)
344
344
  this.moveCanceledCallback(MOVE_CANCELED_REASON.draggedBack, square, square)
345
345
  this.setMoveInputState(STATE.reset)