cm-chessboard 3.18.2 → 3.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "3.18.2",
3
+ "version": "3.18.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",
@@ -4,7 +4,7 @@
4
4
  * License: MIT, see file 'LICENSE'
5
5
  */
6
6
  import {ChessboardView, renderPieceTitle} from "./ChessboardView.js"
7
- import {COLOR} from "./Chessboard.js"
7
+ import {COLOR, INPUT_EVENT_TYPE} from "./Chessboard.js"
8
8
  import {piecesTranslations} from "./ChessboardView.js"
9
9
 
10
10
  const hlTranslations = {
@@ -55,7 +55,15 @@ export class ChessboardViewAccessible extends ChessboardView {
55
55
  this.inputTo = this.movePieceFormContainer.querySelector(".input-to")
56
56
  this.moveButton = this.movePieceFormContainer.querySelector(".button-move")
57
57
  this.moveButton.addEventListener("click", () => {
58
- this.chessboard.movePiece(this.inputFrom.value, this.inputTo.value, true)
58
+ if (this.moveInputCallback({
59
+ chessboard: this.chessboard,
60
+ type: INPUT_EVENT_TYPE.moveDone,
61
+ squareFrom: this.inputFrom.value,
62
+ squareTo: this.inputTo.value
63
+ })) {
64
+ this.inputFrom.value = ""
65
+ this.inputTo.value = ""
66
+ }
59
67
  })
60
68
  this.accessibleContainer.appendChild(this.movePieceFormContainer)
61
69
 
@@ -135,7 +143,7 @@ export class ChessboardViewAccessible extends ChessboardView {
135
143
  for (let y = 0; y < 8; y++) {
136
144
  const pieceCode = squares[y % 8 + x * 8]
137
145
  let color, name
138
- if(pieceCode) {
146
+ if (pieceCode) {
139
147
  color = pieceCode.charAt(0)
140
148
  name = pieceCode.charAt(1)
141
149
  html += `<td>${renderPieceTitle(this.lang, name, color)}</td>`