gigaboard 1.3.1 → 1.3.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.
Files changed (224) hide show
  1. package/README.md +28 -8
  2. package/dist/chunk-35HQL3AK.js +19 -0
  3. package/dist/chunk-35HQL3AK.js.map +1 -0
  4. package/dist/chunk-375XPUCQ.js +18 -0
  5. package/dist/chunk-375XPUCQ.js.map +1 -0
  6. package/dist/chunk-3DEOTW2M.js +16 -0
  7. package/dist/chunk-3DEOTW2M.js.map +1 -0
  8. package/dist/chunk-3UFHYHMR.js +16 -0
  9. package/dist/chunk-3UFHYHMR.js.map +1 -0
  10. package/dist/chunk-52DIWDSX.js +18 -0
  11. package/dist/chunk-52DIWDSX.js.map +1 -0
  12. package/dist/chunk-5OGPVD4R.cjs +18 -0
  13. package/dist/chunk-5OGPVD4R.cjs.map +1 -0
  14. package/dist/chunk-6S6THNZP.js +24 -0
  15. package/dist/chunk-6S6THNZP.js.map +1 -0
  16. package/dist/chunk-6ZEPUUY5.cjs +18 -0
  17. package/dist/chunk-6ZEPUUY5.cjs.map +1 -0
  18. package/dist/chunk-76PL52EB.cjs +21 -0
  19. package/dist/chunk-76PL52EB.cjs.map +1 -0
  20. package/dist/chunk-A3HBH676.cjs +20 -0
  21. package/dist/chunk-A3HBH676.cjs.map +1 -0
  22. package/dist/chunk-AWNSXENI.js +18 -0
  23. package/dist/chunk-AWNSXENI.js.map +1 -0
  24. package/dist/{chunk-GYVBIZKI.js → chunk-BB54XFHQ.js} +3 -3
  25. package/dist/{chunk-GYVBIZKI.js.map → chunk-BB54XFHQ.js.map} +1 -1
  26. package/dist/chunk-CMV3NVR3.cjs +18 -0
  27. package/dist/chunk-CMV3NVR3.cjs.map +1 -0
  28. package/dist/{chunk-I4BQGFP5.cjs → chunk-D45G3J5E.cjs} +8 -2
  29. package/dist/chunk-D45G3J5E.cjs.map +1 -0
  30. package/dist/{chunk-CXDGJMYL.js → chunk-EJUGH25P.js} +8 -2
  31. package/dist/chunk-EJUGH25P.js.map +1 -0
  32. package/dist/{chunk-BFMVMUTU.cjs → chunk-ENYRJ4Q2.cjs} +3 -3
  33. package/dist/{chunk-BFMVMUTU.cjs.map → chunk-ENYRJ4Q2.cjs.map} +1 -1
  34. package/dist/chunk-EWAHJSTZ.js +18 -0
  35. package/dist/chunk-EWAHJSTZ.js.map +1 -0
  36. package/dist/chunk-F2QTCQXE.cjs +20 -0
  37. package/dist/chunk-F2QTCQXE.cjs.map +1 -0
  38. package/dist/chunk-FACLRSNS.js +16 -0
  39. package/dist/chunk-FACLRSNS.js.map +1 -0
  40. package/dist/chunk-FICI4AMA.cjs +24 -0
  41. package/dist/chunk-FICI4AMA.cjs.map +1 -0
  42. package/dist/chunk-FW54YBHD.cjs +23 -0
  43. package/dist/chunk-FW54YBHD.cjs.map +1 -0
  44. package/dist/chunk-HL6YTFI6.js +18 -0
  45. package/dist/chunk-HL6YTFI6.js.map +1 -0
  46. package/dist/chunk-JHWYLKFQ.cjs +23 -0
  47. package/dist/chunk-JHWYLKFQ.cjs.map +1 -0
  48. package/dist/chunk-KYPCPATQ.js +21 -0
  49. package/dist/chunk-KYPCPATQ.js.map +1 -0
  50. package/dist/chunk-LIC3EXRR.cjs +20 -0
  51. package/dist/chunk-LIC3EXRR.cjs.map +1 -0
  52. package/dist/chunk-M6NSGIVF.cjs +24 -0
  53. package/dist/chunk-M6NSGIVF.cjs.map +1 -0
  54. package/dist/chunk-MDBGFL5S.js +22 -0
  55. package/dist/chunk-MDBGFL5S.js.map +1 -0
  56. package/dist/chunk-NB62E57G.js +21 -0
  57. package/dist/chunk-NB62E57G.js.map +1 -0
  58. package/dist/chunk-QIIIL4BN.cjs +20 -0
  59. package/dist/chunk-QIIIL4BN.cjs.map +1 -0
  60. package/dist/chunk-RNC76LWZ.js +16 -0
  61. package/dist/chunk-RNC76LWZ.js.map +1 -0
  62. package/dist/chunk-TUO6GFCZ.cjs +20 -0
  63. package/dist/chunk-TUO6GFCZ.cjs.map +1 -0
  64. package/dist/chunk-UERUICKB.cjs +20 -0
  65. package/dist/chunk-UERUICKB.cjs.map +1 -0
  66. package/dist/chunk-UF32KQA3.cjs +18 -0
  67. package/dist/chunk-UF32KQA3.cjs.map +1 -0
  68. package/dist/chunk-W5WAATJ7.js +22 -0
  69. package/dist/chunk-W5WAATJ7.js.map +1 -0
  70. package/dist/chunk-WD7Y2RDG.js +16 -0
  71. package/dist/chunk-WD7Y2RDG.js.map +1 -0
  72. package/dist/chunk-WNFJK4HA.js +16 -0
  73. package/dist/chunk-WNFJK4HA.js.map +1 -0
  74. package/dist/chunk-XQO7TG53.cjs +18 -0
  75. package/dist/chunk-XQO7TG53.cjs.map +1 -0
  76. package/dist/chunk-XQW5XTYT.js +18 -0
  77. package/dist/chunk-XQW5XTYT.js.map +1 -0
  78. package/dist/chunk-ZB2G3XMO.cjs +18 -0
  79. package/dist/chunk-ZB2G3XMO.cjs.map +1 -0
  80. package/dist/chunk-ZZQ5FPWF.cjs +26 -0
  81. package/dist/chunk-ZZQ5FPWF.cjs.map +1 -0
  82. package/dist/core.cjs +44 -44
  83. package/dist/core.d.cts +1 -1
  84. package/dist/core.d.ts +1 -1
  85. package/dist/core.js +1 -1
  86. package/dist/index.cjs +89 -73
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.d.cts +7 -1
  89. package/dist/index.d.ts +7 -1
  90. package/dist/index.js +29 -13
  91. package/dist/index.js.map +1 -1
  92. package/dist/pieces.cjs +1 -1
  93. package/dist/pieces.cjs.map +1 -1
  94. package/dist/pieces.d.cts +1 -1
  95. package/dist/pieces.d.ts +1 -1
  96. package/dist/pieces.js +1 -1
  97. package/dist/pieces.js.map +1 -1
  98. package/dist/server.cjs +15 -8
  99. package/dist/server.cjs.map +1 -1
  100. package/dist/server.js +10 -3
  101. package/dist/server.js.map +1 -1
  102. package/dist/themes/blue.d.cts +255 -3
  103. package/dist/themes/blue.d.ts +255 -3
  104. package/dist/themes/cafeCreme.cjs +12 -0
  105. package/dist/themes/cafeCreme.cjs.map +1 -0
  106. package/dist/themes/cafeCreme.d.cts +1 -0
  107. package/dist/themes/cafeCreme.d.ts +1 -0
  108. package/dist/themes/cafeCreme.js +3 -0
  109. package/dist/themes/cafeCreme.js.map +1 -0
  110. package/dist/themes/canvas.cjs +12 -0
  111. package/dist/themes/canvas.cjs.map +1 -0
  112. package/dist/themes/canvas.d.cts +1 -0
  113. package/dist/themes/canvas.d.ts +1 -0
  114. package/dist/themes/canvas.js +3 -0
  115. package/dist/themes/canvas.js.map +1 -0
  116. package/dist/themes/chesscomBlue.cjs +12 -0
  117. package/dist/themes/chesscomBlue.cjs.map +1 -0
  118. package/dist/themes/chesscomBlue.d.cts +1 -0
  119. package/dist/themes/chesscomBlue.d.ts +1 -0
  120. package/dist/themes/chesscomBlue.js +3 -0
  121. package/dist/themes/chesscomBlue.js.map +1 -0
  122. package/dist/themes/chesscomGreen.cjs +12 -0
  123. package/dist/themes/chesscomGreen.cjs.map +1 -0
  124. package/dist/themes/chesscomGreen.d.cts +1 -0
  125. package/dist/themes/chesscomGreen.d.ts +1 -0
  126. package/dist/themes/chesscomGreen.js +3 -0
  127. package/dist/themes/chesscomGreen.js.map +1 -0
  128. package/dist/themes/darkWood.cjs +12 -0
  129. package/dist/themes/darkWood.cjs.map +1 -0
  130. package/dist/themes/darkWood.d.cts +1 -0
  131. package/dist/themes/darkWood.d.ts +1 -0
  132. package/dist/themes/darkWood.js +3 -0
  133. package/dist/themes/darkWood.js.map +1 -0
  134. package/dist/themes/deuteranopia.cjs +12 -0
  135. package/dist/themes/deuteranopia.cjs.map +1 -0
  136. package/dist/themes/deuteranopia.d.cts +1 -0
  137. package/dist/themes/deuteranopia.d.ts +1 -0
  138. package/dist/themes/deuteranopia.js +3 -0
  139. package/dist/themes/deuteranopia.js.map +1 -0
  140. package/dist/themes/espresso.cjs +12 -0
  141. package/dist/themes/espresso.cjs.map +1 -0
  142. package/dist/themes/espresso.d.cts +1 -0
  143. package/dist/themes/espresso.d.ts +1 -0
  144. package/dist/themes/espresso.js +3 -0
  145. package/dist/themes/espresso.js.map +1 -0
  146. package/dist/themes/green.d.cts +1 -1
  147. package/dist/themes/green.d.ts +1 -1
  148. package/dist/themes/highContrast.cjs +12 -0
  149. package/dist/themes/highContrast.cjs.map +1 -0
  150. package/dist/themes/highContrast.d.cts +1 -0
  151. package/dist/themes/highContrast.d.ts +1 -0
  152. package/dist/themes/highContrast.js +3 -0
  153. package/dist/themes/highContrast.js.map +1 -0
  154. package/dist/themes/ic.cjs +12 -0
  155. package/dist/themes/ic.cjs.map +1 -0
  156. package/dist/themes/ic.d.cts +1 -0
  157. package/dist/themes/ic.d.ts +1 -0
  158. package/dist/themes/ic.js +3 -0
  159. package/dist/themes/ic.js.map +1 -0
  160. package/dist/themes/leather.cjs +12 -0
  161. package/dist/themes/leather.cjs.map +1 -0
  162. package/dist/themes/leather.d.cts +1 -0
  163. package/dist/themes/leather.d.ts +1 -0
  164. package/dist/themes/leather.js +3 -0
  165. package/dist/themes/leather.js.map +1 -0
  166. package/dist/themes/marble.cjs +12 -0
  167. package/dist/themes/marble.cjs.map +1 -0
  168. package/dist/themes/marble.d.cts +1 -0
  169. package/dist/themes/marble.d.ts +1 -0
  170. package/dist/themes/marble.js +3 -0
  171. package/dist/themes/marble.js.map +1 -0
  172. package/dist/themes/neon.cjs +12 -0
  173. package/dist/themes/neon.cjs.map +1 -0
  174. package/dist/themes/neon.d.cts +1 -0
  175. package/dist/themes/neon.d.ts +1 -0
  176. package/dist/themes/neon.js +3 -0
  177. package/dist/themes/neon.js.map +1 -0
  178. package/dist/themes/newspaper.cjs +12 -0
  179. package/dist/themes/newspaper.cjs.map +1 -0
  180. package/dist/themes/newspaper.d.cts +1 -0
  181. package/dist/themes/newspaper.d.ts +1 -0
  182. package/dist/themes/newspaper.js +3 -0
  183. package/dist/themes/newspaper.js.map +1 -0
  184. package/dist/themes/olive.cjs +12 -0
  185. package/dist/themes/olive.cjs.map +1 -0
  186. package/dist/themes/olive.d.cts +1 -0
  187. package/dist/themes/olive.d.ts +1 -0
  188. package/dist/themes/olive.js +3 -0
  189. package/dist/themes/olive.js.map +1 -0
  190. package/dist/themes/pink.cjs +12 -0
  191. package/dist/themes/pink.cjs.map +1 -0
  192. package/dist/themes/pink.d.cts +1 -0
  193. package/dist/themes/pink.d.ts +1 -0
  194. package/dist/themes/pink.js +3 -0
  195. package/dist/themes/pink.js.map +1 -0
  196. package/dist/themes/purple.cjs +12 -0
  197. package/dist/themes/purple.cjs.map +1 -0
  198. package/dist/themes/purple.d.cts +1 -0
  199. package/dist/themes/purple.d.ts +1 -0
  200. package/dist/themes/purple.js +3 -0
  201. package/dist/themes/purple.js.map +1 -0
  202. package/dist/themes/tritanopia.cjs +12 -0
  203. package/dist/themes/tritanopia.cjs.map +1 -0
  204. package/dist/themes/tritanopia.d.cts +1 -0
  205. package/dist/themes/tritanopia.d.ts +1 -0
  206. package/dist/themes/tritanopia.js +3 -0
  207. package/dist/themes/tritanopia.js.map +1 -0
  208. package/dist/themes/walnut.cjs +12 -0
  209. package/dist/themes/walnut.cjs.map +1 -0
  210. package/dist/themes/walnut.d.cts +1 -0
  211. package/dist/themes/walnut.d.ts +1 -0
  212. package/dist/themes/walnut.js +3 -0
  213. package/dist/themes/walnut.js.map +1 -0
  214. package/dist/themes/wood.d.cts +1 -1
  215. package/dist/themes/wood.d.ts +1 -1
  216. package/dist/themes.cjs +116 -8
  217. package/dist/themes.cjs.map +1 -1
  218. package/dist/themes.d.cts +1 -1
  219. package/dist/themes.d.ts +1 -1
  220. package/dist/themes.js +60 -6
  221. package/dist/themes.js.map +1 -1
  222. package/package.json +1 -1
  223. package/dist/chunk-CXDGJMYL.js.map +0 -1
  224. package/dist/chunk-I4BQGFP5.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkBFMVMUTU_cjs = require('./chunk-BFMVMUTU.cjs');
4
- var chunkI4BQGFP5_cjs = require('./chunk-I4BQGFP5.cjs');
3
+ var chunkENYRJ4Q2_cjs = require('./chunk-ENYRJ4Q2.cjs');
4
+ var chunkD45G3J5E_cjs = require('./chunk-D45G3J5E.cjs');
5
5
  require('./chunk-G6ZFOJZR.cjs');
6
6
  require('./chunk-AYVQCHSG.cjs');
7
7
  require('./chunk-FNRS6YJI.cjs');
@@ -362,9 +362,12 @@ function SquareImpl({
362
362
  style: {
363
363
  position: "relative",
364
364
  // `backgroundColor` (not the `background` shorthand) so the
365
- // CSS `background-image` set by `useSelectionController` can
366
- // layer on top without clobbering this base colour.
367
- backgroundColor: `var(${isLight ? chunkI4BQGFP5_cjs.CSS_VARS.SQ_LIGHT : chunkI4BQGFP5_cjs.CSS_VARS.SQ_DARK})`,
365
+ // CSS `background-image` set by `useSelectionController` (or pseudo-elements)
366
+ // can layer on top without clobbering this base colour.
367
+ backgroundColor: `var(${isLight ? chunkD45G3J5E_cjs.CSS_VARS.SQ_LIGHT : chunkD45G3J5E_cjs.CSS_VARS.SQ_DARK})`,
368
+ backgroundImage: `var(${isLight ? chunkD45G3J5E_cjs.CSS_VARS.SQ_LIGHT_IMAGE : chunkD45G3J5E_cjs.CSS_VARS.SQ_DARK_IMAGE},none)`,
369
+ backgroundSize: `var(${chunkD45G3J5E_cjs.CSS_VARS.SQ_IMAGE_SIZE},cover)`,
370
+ backgroundBlendMode: `var(${chunkD45G3J5E_cjs.CSS_VARS.SQ_BLEND_MODE},normal)`,
368
371
  // Cursor is managed by `useCursorController` via injected CSS so
369
372
  // it can flip between `pointer` / `grab` / `grabbing` without a
370
373
  // React re-render per hover.
@@ -482,7 +485,7 @@ function CheckLayerInner({ model, orientation }) {
482
485
  top: `${y}%`,
483
486
  width: "12.5%",
484
487
  height: "12.5%",
485
- background: `var(${chunkI4BQGFP5_cjs.CSS_VARS.CHECK})`,
488
+ background: `var(${chunkD45G3J5E_cjs.CSS_VARS.CHECK})`,
486
489
  pointerEvents: "none",
487
490
  zIndex: 2
488
491
  }
@@ -516,7 +519,7 @@ function Coordinates({ orientation, ranksPosition = "left" }) {
516
519
  position: "absolute",
517
520
  left: `${col * 12.5 + 10}%`,
518
521
  bottom: "1%",
519
- color: `var(${isLightSquare ? chunkI4BQGFP5_cjs.CSS_VARS.COORDINATE_LIGHT : chunkI4BQGFP5_cjs.CSS_VARS.COORDINATE_DARK})`
522
+ color: `var(${isLightSquare ? chunkD45G3J5E_cjs.CSS_VARS.COORDINATE_LIGHT : chunkD45G3J5E_cjs.CSS_VARS.COORDINATE_DARK})`
520
523
  },
521
524
  children: letter
522
525
  },
@@ -536,7 +539,7 @@ function Coordinates({ orientation, ranksPosition = "left" }) {
536
539
  position: "absolute",
537
540
  top: `${row * 12.5 + 1}%`,
538
541
  ...sideStyle,
539
- color: `var(${isLightSquare ? chunkI4BQGFP5_cjs.CSS_VARS.COORDINATE_LIGHT : chunkI4BQGFP5_cjs.CSS_VARS.COORDINATE_DARK})`
542
+ color: `var(${isLightSquare ? chunkD45G3J5E_cjs.CSS_VARS.COORDINATE_LIGHT : chunkD45G3J5E_cjs.CSS_VARS.COORDINATE_DARK})`
540
543
  },
541
544
  children: rank + 1
542
545
  },
@@ -581,7 +584,10 @@ var DragLayer = react.forwardRef(function DragLayer2({ pieces }, ref) {
581
584
  slotRefs.current[cell] = el;
582
585
  },
583
586
  "data-drag-cell": cell,
584
- style: SLOT_STYLE,
587
+ style: {
588
+ ...SLOT_STYLE,
589
+ filter: `var(${cell <= 6 ? chunkD45G3J5E_cjs.CSS_VARS.PIECE_FILTER_WHITE : chunkD45G3J5E_cjs.CSS_VARS.PIECE_FILTER_BLACK}, none)`
590
+ },
585
591
  children: child
586
592
  },
587
593
  cell
@@ -678,7 +684,7 @@ function IllegalFlashLayer({ at, orientation }) {
678
684
  top: `${y}%`,
679
685
  width: "12.5%",
680
686
  height: "12.5%",
681
- background: chunkI4BQGFP5_cjs.DEFAULT_ILLEGAL_FLASH_TINT,
687
+ background: chunkD45G3J5E_cjs.DEFAULT_ILLEGAL_FLASH_TINT,
682
688
  opacity: 0,
683
689
  pointerEvents: "none",
684
690
  zIndex: 5
@@ -713,7 +719,7 @@ function pieceName(cell) {
713
719
  }
714
720
  }
715
721
  function announcementFor(lastMove, board, wasCapture) {
716
- const { from, to, kind, promotion } = chunkBFMVMUTU_cjs.decodePackedMove(lastMove);
722
+ const { from, to, kind, promotion } = chunkENYRJ4Q2_cjs.decodePackedMove(lastMove);
717
723
  if (kind === "castle") {
718
724
  const isKingside = (to & 7) > (from & 7);
719
725
  return isKingside ? "Castles kingside." : "Castles queenside.";
@@ -798,7 +804,12 @@ function PieceSlotImpl({ index, model, orientation, pieces }) {
798
804
  {
799
805
  "data-piece-square": algebraicOf3(index),
800
806
  "data-piece-cell": cell,
801
- style: { ...SLOT_BASE_STYLE, gridColumnStart: col, gridRowStart: row },
807
+ style: {
808
+ ...SLOT_BASE_STYLE,
809
+ gridColumnStart: col,
810
+ gridRowStart: row,
811
+ filter: `var(${cell <= 6 ? chunkD45G3J5E_cjs.CSS_VARS.PIECE_FILTER_WHITE : chunkD45G3J5E_cjs.CSS_VARS.PIECE_FILTER_BLACK}, none)`
812
+ },
802
813
  children: pieces({ cell, square: index })
803
814
  }
804
815
  );
@@ -884,7 +895,7 @@ function PremoveLayerInner({ model, orientation, pieces, from, to }) {
884
895
  top: `${origin.y}%`,
885
896
  width: "12.5%",
886
897
  height: "12.5%",
887
- background: chunkI4BQGFP5_cjs.DEFAULT_PREMOVE_TINT,
898
+ background: chunkD45G3J5E_cjs.DEFAULT_PREMOVE_TINT,
888
899
  opacity: 0.5
889
900
  }
890
901
  }
@@ -898,7 +909,7 @@ function PremoveLayerInner({ model, orientation, pieces, from, to }) {
898
909
  top: `${target.y}%`,
899
910
  width: "12.5%",
900
911
  height: "12.5%",
901
- background: chunkI4BQGFP5_cjs.DEFAULT_PREMOVE_TINT
912
+ background: chunkD45G3J5E_cjs.DEFAULT_PREMOVE_TINT
902
913
  }
903
914
  }
904
915
  ),
@@ -933,20 +944,20 @@ function positionOf4(index, orientation) {
933
944
  return { x: col * 12.5, y: row * 12.5 };
934
945
  }
935
946
  var CHOICE_ORDER = [
936
- chunkBFMVMUTU_cjs.PieceType.Queen,
937
- chunkBFMVMUTU_cjs.PieceType.Knight,
938
- chunkBFMVMUTU_cjs.PieceType.Rook,
939
- chunkBFMVMUTU_cjs.PieceType.Bishop
947
+ chunkENYRJ4Q2_cjs.PieceType.Queen,
948
+ chunkENYRJ4Q2_cjs.PieceType.Knight,
949
+ chunkENYRJ4Q2_cjs.PieceType.Rook,
950
+ chunkENYRJ4Q2_cjs.PieceType.Bishop
940
951
  ];
941
952
  var SHORTCUTS = {
942
- q: chunkBFMVMUTU_cjs.PieceType.Queen,
943
- r: chunkBFMVMUTU_cjs.PieceType.Rook,
944
- b: chunkBFMVMUTU_cjs.PieceType.Bishop,
945
- n: chunkBFMVMUTU_cjs.PieceType.Knight,
946
- Q: chunkBFMVMUTU_cjs.PieceType.Queen,
947
- R: chunkBFMVMUTU_cjs.PieceType.Rook,
948
- B: chunkBFMVMUTU_cjs.PieceType.Bishop,
949
- N: chunkBFMVMUTU_cjs.PieceType.Knight
953
+ q: chunkENYRJ4Q2_cjs.PieceType.Queen,
954
+ r: chunkENYRJ4Q2_cjs.PieceType.Rook,
955
+ b: chunkENYRJ4Q2_cjs.PieceType.Bishop,
956
+ n: chunkENYRJ4Q2_cjs.PieceType.Knight,
957
+ Q: chunkENYRJ4Q2_cjs.PieceType.Queen,
958
+ R: chunkENYRJ4Q2_cjs.PieceType.Rook,
959
+ B: chunkENYRJ4Q2_cjs.PieceType.Bishop,
960
+ N: chunkENYRJ4Q2_cjs.PieceType.Knight
950
961
  };
951
962
  function PromotionOverlay({
952
963
  from: _from,
@@ -964,7 +975,7 @@ function PromotionOverlay({
964
975
  [getPromotionPieceAriaLabel, color]
965
976
  );
966
977
  const [activeAnnouncement, setActiveAnnouncement] = react.useState(
967
- () => getLabel(CHOICE_ORDER[0] ?? chunkBFMVMUTU_cjs.PieceType.Queen)
978
+ () => getLabel(CHOICE_ORDER[0] ?? chunkENYRJ4Q2_cjs.PieceType.Queen)
968
979
  );
969
980
  react.useEffect(() => {
970
981
  buttonRefs.current[0]?.focus();
@@ -979,7 +990,7 @@ function PromotionOverlay({
979
990
  if (e.key === "Tab") {
980
991
  e.preventDefault();
981
992
  const activeEl = document.activeElement;
982
- const currentIdx = buttonRefs.current.findIndex((el) => el === activeEl);
993
+ const currentIdx = buttonRefs.current.indexOf(activeEl);
983
994
  let nextIdx;
984
995
  if (e.shiftKey) {
985
996
  nextIdx = currentIdx <= 0 ? buttonRefs.current.length - 1 : currentIdx - 1;
@@ -992,7 +1003,7 @@ function PromotionOverlay({
992
1003
  if (e.key === "ArrowDown" || e.key === "ArrowRight") {
993
1004
  e.preventDefault();
994
1005
  const activeEl = document.activeElement;
995
- const currentIdx = buttonRefs.current.findIndex((el) => el === activeEl);
1006
+ const currentIdx = buttonRefs.current.indexOf(activeEl);
996
1007
  const nextIdx = currentIdx < 0 ? 0 : (currentIdx + 1) % CHOICE_ORDER.length;
997
1008
  buttonRefs.current[nextIdx]?.focus();
998
1009
  return;
@@ -1000,7 +1011,7 @@ function PromotionOverlay({
1000
1011
  if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
1001
1012
  e.preventDefault();
1002
1013
  const activeEl = document.activeElement;
1003
- const currentIdx = buttonRefs.current.findIndex((el) => el === activeEl);
1014
+ const currentIdx = buttonRefs.current.indexOf(activeEl);
1004
1015
  const prevIdx = currentIdx <= 0 ? CHOICE_ORDER.length - 1 : currentIdx - 1;
1005
1016
  buttonRefs.current[prevIdx]?.focus();
1006
1017
  return;
@@ -1062,7 +1073,7 @@ function PromotionOverlay({
1062
1073
  overflow: "hidden"
1063
1074
  },
1064
1075
  children: CHOICE_ORDER.map((piece, index) => {
1065
- const cell = chunkBFMVMUTU_cjs.encodeBoardCell(color, piece);
1076
+ const cell = chunkENYRJ4Q2_cjs.encodeBoardCell(color, piece);
1066
1077
  const label = getLabel(piece);
1067
1078
  return /* @__PURE__ */ jsxRuntime.jsx(
1068
1079
  "button",
@@ -1114,13 +1125,13 @@ var srOnlyStyle2 = {
1114
1125
  };
1115
1126
  function pieceName2(t) {
1116
1127
  switch (t) {
1117
- case chunkBFMVMUTU_cjs.PieceType.Queen:
1128
+ case chunkENYRJ4Q2_cjs.PieceType.Queen:
1118
1129
  return "Queen";
1119
- case chunkBFMVMUTU_cjs.PieceType.Rook:
1130
+ case chunkENYRJ4Q2_cjs.PieceType.Rook:
1120
1131
  return "Rook";
1121
- case chunkBFMVMUTU_cjs.PieceType.Bishop:
1132
+ case chunkENYRJ4Q2_cjs.PieceType.Bishop:
1122
1133
  return "Bishop";
1123
- case chunkBFMVMUTU_cjs.PieceType.Knight:
1134
+ case chunkENYRJ4Q2_cjs.PieceType.Knight:
1124
1135
  return "Knight";
1125
1136
  default:
1126
1137
  return "Piece";
@@ -1144,7 +1155,12 @@ function StaticPieceLayer({ board, orientation, pieces }) {
1144
1155
  {
1145
1156
  "data-piece-square": algebraicOf3(index),
1146
1157
  "data-piece-cell": cell,
1147
- style: { ...SLOT_BASE_STYLE, gridColumnStart: col, gridRowStart: row },
1158
+ style: {
1159
+ ...SLOT_BASE_STYLE,
1160
+ gridColumnStart: col,
1161
+ gridRowStart: row,
1162
+ filter: `var(${cell <= 6 ? chunkD45G3J5E_cjs.CSS_VARS.PIECE_FILTER_WHITE : chunkD45G3J5E_cjs.CSS_VARS.PIECE_FILTER_BLACK}, none)`
1163
+ },
1148
1164
  children: pieces({ cell, square: index })
1149
1165
  },
1150
1166
  i
@@ -1395,7 +1411,7 @@ function useArrowGesture(options) {
1395
1411
  function wouldPromote(fromCell, toIndex) {
1396
1412
  if (fromCell === 0) return false;
1397
1413
  const pieceType = (fromCell - 1) % 6;
1398
- if (pieceType !== chunkBFMVMUTU_cjs.PieceType.Pawn) return false;
1414
+ if (pieceType !== chunkENYRJ4Q2_cjs.PieceType.Pawn) return false;
1399
1415
  const toRank = toIndex >> 3;
1400
1416
  return toRank === 0 || toRank === 7;
1401
1417
  }
@@ -1406,7 +1422,7 @@ function useClickToMove(model, onMove, onPromotionNeeded, enabled = true) {
1406
1422
  if (model === null) return;
1407
1423
  const snap = model.getSnapshot();
1408
1424
  const cell = snap.board[index] ?? 0;
1409
- const pieceColour = cell === 0 ? -1 : cell > 6 ? chunkBFMVMUTU_cjs.Color.Black : chunkBFMVMUTU_cjs.Color.White;
1425
+ const pieceColour = cell === 0 ? -1 : cell > 6 ? chunkENYRJ4Q2_cjs.Color.Black : chunkENYRJ4Q2_cjs.Color.White;
1410
1426
  if (snap.selected === null) {
1411
1427
  if (pieceColour === snap.turn) model.selectSquare(index);
1412
1428
  return;
@@ -1422,7 +1438,7 @@ function useClickToMove(model, onMove, onPromotionNeeded, enabled = true) {
1422
1438
  onPromotionNeeded(snap.selected, index);
1423
1439
  return;
1424
1440
  }
1425
- const played2 = model.tryMove(snap.selected, index, chunkBFMVMUTU_cjs.PieceType.Queen);
1441
+ const played2 = model.tryMove(snap.selected, index, chunkENYRJ4Q2_cjs.PieceType.Queen);
1426
1442
  if (played2 !== null && onMove !== void 0) onMove(played2);
1427
1443
  return;
1428
1444
  }
@@ -1534,7 +1550,7 @@ function useCursorController(model, containerRef, allowDrag, allowPremove) {
1534
1550
  };
1535
1551
  }, [model, containerRef, allowDrag, allowPremove]);
1536
1552
  }
1537
- var GHOST_OPACITY_VAR = chunkI4BQGFP5_cjs.CSS_VARS.DRAG_GHOST_OPACITY;
1553
+ var GHOST_OPACITY_VAR = chunkD45G3J5E_cjs.CSS_VARS.DRAG_GHOST_OPACITY;
1538
1554
  function useDrag(options) {
1539
1555
  const {
1540
1556
  game,
@@ -1556,7 +1572,7 @@ function useDrag(options) {
1556
1572
  if (!enabled) return;
1557
1573
  const container = containerRef.current;
1558
1574
  if (container === null || game === null) return;
1559
- const controller = chunkBFMVMUTU_cjs.createDragController(
1575
+ const controller = chunkENYRJ4Q2_cjs.createDragController(
1560
1576
  activationDistance === void 0 ? {} : { activationDistance }
1561
1577
  );
1562
1578
  let originEl = null;
@@ -2334,7 +2350,7 @@ function parseTransitionMove(transition) {
2334
2350
  };
2335
2351
  }
2336
2352
  function isPawn(cell) {
2337
- return !chunkBFMVMUTU_cjs.isEmptyCell(cell) && chunkBFMVMUTU_cjs.pieceTypeOf(cell) === 0;
2353
+ return !chunkENYRJ4Q2_cjs.isEmptyCell(cell) && chunkENYRJ4Q2_cjs.pieceTypeOf(cell) === 0;
2338
2354
  }
2339
2355
  function controlledFeedbackDescriptors(transition, previousBoard, nextBoard) {
2340
2356
  if (transition === null || transition === void 0) return null;
@@ -2343,25 +2359,25 @@ function controlledFeedbackDescriptors(transition, previousBoard, nextBoard) {
2343
2359
  const before = transition.direction === "forward" ? previousBoard : nextBoard;
2344
2360
  const after = transition.direction === "forward" ? nextBoard : previousBoard;
2345
2361
  const movingPiece = before[parsed.from] ?? 0;
2346
- if (chunkBFMVMUTU_cjs.isEmptyCell(movingPiece)) return null;
2362
+ if (chunkENYRJ4Q2_cjs.isEmptyCell(movingPiece)) return null;
2347
2363
  const fromFile = parsed.from & 7;
2348
2364
  const toFile = parsed.to & 7;
2349
2365
  const targetBefore = before[parsed.to] ?? 0;
2350
2366
  const targetAfter = after[parsed.to] ?? 0;
2351
- if (chunkBFMVMUTU_cjs.pieceTypeOf(movingPiece) === 5 && Math.abs(toFile - fromFile) === 2) {
2367
+ if (chunkENYRJ4Q2_cjs.pieceTypeOf(movingPiece) === 5 && Math.abs(toFile - fromFile) === 2) {
2352
2368
  return [{ kind: "castle" }];
2353
2369
  }
2354
- if (parsed.promotion !== null || isPawn(movingPiece) && (parsed.to >> 3 === 0 || parsed.to >> 3 === 7) && !chunkBFMVMUTU_cjs.isEmptyCell(targetAfter) && chunkBFMVMUTU_cjs.pieceTypeOf(targetAfter) !== 0) {
2370
+ if (parsed.promotion !== null || isPawn(movingPiece) && (parsed.to >> 3 === 0 || parsed.to >> 3 === 7) && !chunkENYRJ4Q2_cjs.isEmptyCell(targetAfter) && chunkENYRJ4Q2_cjs.pieceTypeOf(targetAfter) !== 0) {
2355
2371
  return [{ kind: "promotion" }];
2356
2372
  }
2357
- if (!chunkBFMVMUTU_cjs.isEmptyCell(targetBefore) && chunkBFMVMUTU_cjs.colorOf(targetBefore) !== chunkBFMVMUTU_cjs.colorOf(movingPiece)) {
2373
+ if (!chunkENYRJ4Q2_cjs.isEmptyCell(targetBefore) && chunkENYRJ4Q2_cjs.colorOf(targetBefore) !== chunkENYRJ4Q2_cjs.colorOf(movingPiece)) {
2358
2374
  return [{ kind: "capture" }];
2359
2375
  }
2360
- if (isPawn(movingPiece) && fromFile !== toFile && chunkBFMVMUTU_cjs.isEmptyCell(targetBefore)) {
2376
+ if (isPawn(movingPiece) && fromFile !== toFile && chunkENYRJ4Q2_cjs.isEmptyCell(targetBefore)) {
2361
2377
  const capturedSquare = parsed.from & -8 | toFile;
2362
2378
  const capturedBefore = before[capturedSquare] ?? 0;
2363
2379
  const capturedAfter = after[capturedSquare] ?? 0;
2364
- if (!chunkBFMVMUTU_cjs.isEmptyCell(capturedBefore) && chunkBFMVMUTU_cjs.colorOf(capturedBefore) !== chunkBFMVMUTU_cjs.colorOf(movingPiece) && chunkBFMVMUTU_cjs.isEmptyCell(capturedAfter)) {
2380
+ if (!chunkENYRJ4Q2_cjs.isEmptyCell(capturedBefore) && chunkENYRJ4Q2_cjs.colorOf(capturedBefore) !== chunkENYRJ4Q2_cjs.colorOf(movingPiece) && chunkENYRJ4Q2_cjs.isEmptyCell(capturedAfter)) {
2365
2381
  return [{ kind: "en-passant" }];
2366
2382
  }
2367
2383
  }
@@ -2429,8 +2445,8 @@ function Chessboard(props) {
2429
2445
  managedArrows,
2430
2446
  preserveUserArrowsOnPositionSync,
2431
2447
  orientation = "white",
2432
- theme = chunkI4BQGFP5_cjs.defaultTheme,
2433
- pieces = chunkI4BQGFP5_cjs.defaultPieces,
2448
+ theme = chunkD45G3J5E_cjs.defaultTheme,
2449
+ pieces = chunkD45G3J5E_cjs.defaultPieces,
2434
2450
  showCoordinates = true,
2435
2451
  ranksPosition = "left",
2436
2452
  showLegalTargets = "rings",
@@ -2469,7 +2485,7 @@ function Chessboard(props) {
2469
2485
  const fallbackBoard = react.useMemo(() => {
2470
2486
  if (fallbackFen === void 0 || fallbackFen === "") return null;
2471
2487
  try {
2472
- return chunkI4BQGFP5_cjs.parseFenPlacement(fallbackFen);
2488
+ return chunkD45G3J5E_cjs.parseFenPlacement(fallbackFen);
2473
2489
  } catch {
2474
2490
  return null;
2475
2491
  }
@@ -2547,10 +2563,10 @@ function Chessboard(props) {
2547
2563
  ]);
2548
2564
  const palette = react.useMemo(() => {
2549
2565
  const merged = {
2550
- default: chunkI4BQGFP5_cjs.defaultArrowColors.default,
2551
- shift: chunkI4BQGFP5_cjs.defaultArrowColors.shift,
2552
- alt: chunkI4BQGFP5_cjs.defaultArrowColors.alt,
2553
- ctrl: chunkI4BQGFP5_cjs.defaultArrowColors.ctrl
2566
+ default: chunkD45G3J5E_cjs.defaultArrowColors.default,
2567
+ shift: chunkD45G3J5E_cjs.defaultArrowColors.shift,
2568
+ alt: chunkD45G3J5E_cjs.defaultArrowColors.alt,
2569
+ ctrl: chunkD45G3J5E_cjs.defaultArrowColors.ctrl
2554
2570
  };
2555
2571
  if (arrowColors !== void 0) {
2556
2572
  for (const k in arrowColors) {
@@ -2868,15 +2884,15 @@ function useChessGame(options = {}) {
2868
2884
  const { fen, ...modelOptions } = options;
2869
2885
  const [initialModelOptions] = react.useState(() => modelOptions);
2870
2886
  const [model, setModel] = react.useState(() => {
2871
- const adapter = chunkBFMVMUTU_cjs.createGigachessAdapter(fen);
2872
- return chunkBFMVMUTU_cjs.createBoardModel(adapter, modelOptions);
2887
+ const adapter = chunkENYRJ4Q2_cjs.createGigachessAdapter(fen);
2888
+ return chunkENYRJ4Q2_cjs.createBoardModel(adapter, modelOptions);
2873
2889
  });
2874
2890
  const prevFenRef = react.useRef(fen);
2875
2891
  react.useEffect(() => {
2876
2892
  if (prevFenRef.current !== fen) {
2877
2893
  prevFenRef.current = fen;
2878
- const adapter = chunkBFMVMUTU_cjs.createGigachessAdapter(fen);
2879
- const nextModel = chunkBFMVMUTU_cjs.createBoardModel(adapter, initialModelOptions);
2894
+ const adapter = chunkENYRJ4Q2_cjs.createGigachessAdapter(fen);
2895
+ const nextModel = chunkENYRJ4Q2_cjs.createBoardModel(adapter, initialModelOptions);
2880
2896
  setModel((prev) => {
2881
2897
  prev.dispose();
2882
2898
  return nextModel;
@@ -2892,59 +2908,59 @@ function useChessGame(options = {}) {
2892
2908
  }
2893
2909
 
2894
2910
  // src/index.ts
2895
- var PACKAGE_VERSION = "1.3.1";
2911
+ var PACKAGE_VERSION = "1.3.3";
2896
2912
 
2897
2913
  Object.defineProperty(exports, "Color", {
2898
2914
  enumerable: true,
2899
- get: function () { return chunkBFMVMUTU_cjs.Color; }
2915
+ get: function () { return chunkENYRJ4Q2_cjs.Color; }
2900
2916
  });
2901
2917
  Object.defineProperty(exports, "PieceType", {
2902
2918
  enumerable: true,
2903
- get: function () { return chunkBFMVMUTU_cjs.PieceType; }
2919
+ get: function () { return chunkENYRJ4Q2_cjs.PieceType; }
2904
2920
  });
2905
2921
  Object.defineProperty(exports, "createBoardModel", {
2906
2922
  enumerable: true,
2907
- get: function () { return chunkBFMVMUTU_cjs.createBoardModel; }
2923
+ get: function () { return chunkENYRJ4Q2_cjs.createBoardModel; }
2908
2924
  });
2909
2925
  Object.defineProperty(exports, "createGigachessAdapter", {
2910
2926
  enumerable: true,
2911
- get: function () { return chunkBFMVMUTU_cjs.createGigachessAdapter; }
2927
+ get: function () { return chunkENYRJ4Q2_cjs.createGigachessAdapter; }
2912
2928
  });
2913
2929
  Object.defineProperty(exports, "packMove", {
2914
2930
  enumerable: true,
2915
- get: function () { return chunkBFMVMUTU_cjs.packMove; }
2931
+ get: function () { return chunkENYRJ4Q2_cjs.packMove; }
2916
2932
  });
2917
2933
  Object.defineProperty(exports, "preloadGigachessAdapter", {
2918
2934
  enumerable: true,
2919
- get: function () { return chunkBFMVMUTU_cjs.preloadGigachessAdapter; }
2935
+ get: function () { return chunkENYRJ4Q2_cjs.preloadGigachessAdapter; }
2920
2936
  });
2921
2937
  Object.defineProperty(exports, "unpackMove", {
2922
2938
  enumerable: true,
2923
- get: function () { return chunkBFMVMUTU_cjs.unpackMove; }
2939
+ get: function () { return chunkENYRJ4Q2_cjs.unpackMove; }
2924
2940
  });
2925
2941
  Object.defineProperty(exports, "CSS_VARS", {
2926
2942
  enumerable: true,
2927
- get: function () { return chunkI4BQGFP5_cjs.CSS_VARS; }
2943
+ get: function () { return chunkD45G3J5E_cjs.CSS_VARS; }
2928
2944
  });
2929
2945
  Object.defineProperty(exports, "DEFAULT_ILLEGAL_FLASH_TINT", {
2930
2946
  enumerable: true,
2931
- get: function () { return chunkI4BQGFP5_cjs.DEFAULT_ILLEGAL_FLASH_TINT; }
2947
+ get: function () { return chunkD45G3J5E_cjs.DEFAULT_ILLEGAL_FLASH_TINT; }
2932
2948
  });
2933
2949
  Object.defineProperty(exports, "DEFAULT_PREMOVE_TINT", {
2934
2950
  enumerable: true,
2935
- get: function () { return chunkI4BQGFP5_cjs.DEFAULT_PREMOVE_TINT; }
2951
+ get: function () { return chunkD45G3J5E_cjs.DEFAULT_PREMOVE_TINT; }
2936
2952
  });
2937
2953
  Object.defineProperty(exports, "defaultArrowColors", {
2938
2954
  enumerable: true,
2939
- get: function () { return chunkI4BQGFP5_cjs.defaultArrowColors; }
2955
+ get: function () { return chunkD45G3J5E_cjs.defaultArrowColors; }
2940
2956
  });
2941
2957
  Object.defineProperty(exports, "defaultPieces", {
2942
2958
  enumerable: true,
2943
- get: function () { return chunkI4BQGFP5_cjs.defaultPieces; }
2959
+ get: function () { return chunkD45G3J5E_cjs.defaultPieces; }
2944
2960
  });
2945
2961
  Object.defineProperty(exports, "defaultTheme", {
2946
2962
  enumerable: true,
2947
- get: function () { return chunkI4BQGFP5_cjs.defaultTheme; }
2963
+ get: function () { return chunkD45G3J5E_cjs.defaultTheme; }
2948
2964
  });
2949
2965
  exports.AnimationRunner = AnimationRunner;
2950
2966
  exports.Chessboard = Chessboard;