next-chessground 0.13.11 → 0.13.12

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
@@ -5584,6 +5584,19 @@ const useDisclosure = (initialState = false) => {
5584
5584
  };
5585
5585
  };
5586
5586
 
5587
+ const cleanShapes = shapes => {
5588
+ try {
5589
+ // Iterate over each shape and remove the ']' character from the dest string
5590
+ shapes.forEach(shape => {
5591
+ // Use a regular expression to remove all occurrences of ']'
5592
+ shape.dest = shape.dest.replace(/\]/g, '');
5593
+ });
5594
+ return shapes;
5595
+ } catch {
5596
+ return shapes;
5597
+ }
5598
+ };
5599
+
5587
5600
  const cgProps = props => {
5588
5601
  const cgProps = {};
5589
5602
 
@@ -5611,6 +5624,11 @@ const cgProps = props => {
5611
5624
  };
5612
5625
  }
5613
5626
 
5627
+ // fix shapes
5628
+ if (cgProps.shapes) {
5629
+ cgProps.shapes = cleanShapes(cgProps.shapes);
5630
+ }
5631
+
5614
5632
  // helper for Chessground editing mode
5615
5633
  if (props.editing) {
5616
5634
  cgProps.movable = {
package/dist/index.js CHANGED
@@ -5593,6 +5593,19 @@ const useDisclosure = (initialState = false) => {
5593
5593
  };
5594
5594
  };
5595
5595
 
5596
+ const cleanShapes = shapes => {
5597
+ try {
5598
+ // Iterate over each shape and remove the ']' character from the dest string
5599
+ shapes.forEach(shape => {
5600
+ // Use a regular expression to remove all occurrences of ']'
5601
+ shape.dest = shape.dest.replace(/\]/g, '');
5602
+ });
5603
+ return shapes;
5604
+ } catch {
5605
+ return shapes;
5606
+ }
5607
+ };
5608
+
5596
5609
  const cgProps = props => {
5597
5610
  const cgProps = {};
5598
5611
 
@@ -5620,6 +5633,11 @@ const cgProps = props => {
5620
5633
  };
5621
5634
  }
5622
5635
 
5636
+ // fix shapes
5637
+ if (cgProps.shapes) {
5638
+ cgProps.shapes = cleanShapes(cgProps.shapes);
5639
+ }
5640
+
5623
5641
  // helper for Chessground editing mode
5624
5642
  if (props.editing) {
5625
5643
  cgProps.movable = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-chessground",
3
- "version": "0.13.11",
3
+ "version": "0.13.12",
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",