cm-chessboard 8.4.0 → 8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "8.4.0",
3
+ "version": "8.4.1",
4
4
  "description": "A JavaScript chessboard which is lightweight, ES6 module based, responsive, SVG rendered and without dependencies.",
5
5
  "keywords": [
6
6
  "chess",
@@ -23,7 +23,9 @@ export class ChessboardView {
23
23
  if (chessboard.props.responsive) {
24
24
  if (typeof ResizeObserver !== "undefined") {
25
25
  this.resizeObserver = new ResizeObserver(() => {
26
- this.handleResize()
26
+ setTimeout(() => { // prevents "ResizeObserver loop completed with undelivered notifications."
27
+ this.handleResize()
28
+ })
27
29
  })
28
30
  this.resizeObserver.observe(this.chessboard.context)
29
31
  } else {
@@ -252,8 +254,8 @@ export class ChessboardView {
252
254
  const pieceGroup = Svg.addElement(this.piecesGroup, "g", {})
253
255
  pieceGroup.setAttribute("data-piece", pieceName)
254
256
  pieceGroup.setAttribute("data-square", square)
255
- if(hidden) {
256
- pieceGroup.setAttribute("visibility","hidden")
257
+ if (hidden) {
258
+ pieceGroup.setAttribute("visibility", "hidden")
257
259
  }
258
260
  const point = this.squareToPoint(square)
259
261
  const transform = (this.svg.createSVGTransform())
@@ -431,7 +433,7 @@ export class ChessboardView {
431
433
  }
432
434
 
433
435
  getSpriteUrl() {
434
- if(Utils.isAbsoluteUrl(this.chessboard.props.style.pieces.file)) {
436
+ if (Utils.isAbsoluteUrl(this.chessboard.props.style.pieces.file)) {
435
437
  return this.chessboard.props.style.pieces.file
436
438
  } else {
437
439
  return this.chessboard.props.assetsUrl + this.chessboard.props.style.pieces.file