kokopu-react 3.3.0 → 3.3.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.
Files changed (337) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/lib/chessboard/Chessboard.js +3 -2
  3. package/dist/lib/chessboard/Chessboard.js.map +1 -1
  4. package/dist/lib/chessboard/ChessboardImpl.js +1 -1
  5. package/dist/lib/chessboard/ChessboardImpl.js.map +1 -1
  6. package/dist/lib/chessboard/Motion.js +1 -1
  7. package/dist/lib/chessboard/Motion.js.map +1 -1
  8. package/dist/lib/i18n.js +2 -2
  9. package/dist/lib/i18n.js.map +1 -1
  10. package/dist/lib/icons/ArrowMarkerIcon.js.map +1 -1
  11. package/dist/lib/icons/ChessPieceIcon.d.ts +1 -4
  12. package/dist/lib/icons/ChessPieceIcon.js +1 -5
  13. package/dist/lib/icons/ChessPieceIcon.js.map +1 -1
  14. package/dist/lib/icons/SquareMarkerIcon.d.ts +1 -4
  15. package/dist/lib/icons/SquareMarkerIcon.js +1 -5
  16. package/dist/lib/icons/SquareMarkerIcon.js.map +1 -1
  17. package/dist/lib/icons/TextMarkerIcon.d.ts +1 -4
  18. package/dist/lib/icons/TextMarkerIcon.js +1 -5
  19. package/dist/lib/icons/TextMarkerIcon.js.map +1 -1
  20. package/dist/lib/movetext/Movetext.js.map +1 -1
  21. package/dist/lib/movetext/MovetextImpl.js +4 -3
  22. package/dist/lib/movetext/MovetextImpl.js.map +1 -1
  23. package/dist/lib/movetext/htmlFilter.js +1 -1
  24. package/dist/lib/movetext/htmlFilter.js.map +1 -1
  25. package/dist/lib/navigationboard/NavigationBoard.d.ts +1 -1
  26. package/dist/lib/navigationboard/NavigationBoard.js +2 -2
  27. package/dist/lib/navigationboard/NavigationBoard.js.map +1 -1
  28. package/dist/lib/navigationboard/NavigationField.js +1 -1
  29. package/dist/lib/navigationboard/NavigationField.js.map +1 -1
  30. package/dist/lib/navigationboard/NavigationToolbar.js.map +1 -1
  31. package/dist/lib/util.js +2 -2
  32. package/dist/lib/util.js.map +1 -1
  33. package/doc_src/demo/PageChessboardBase.tsx +57 -51
  34. package/doc_src/demo/PageChessboardInteraction.tsx +78 -63
  35. package/doc_src/demo/PageChessboardMove.tsx +35 -30
  36. package/doc_src/demo/PageChessboardSmallScreens.tsx +3 -3
  37. package/doc_src/demo/PageMovetextBase.tsx +91 -81
  38. package/doc_src/demo/PageMovetextInteraction.tsx +23 -21
  39. package/doc_src/demo/PageNavigationBoardBase.tsx +62 -54
  40. package/doc_src/demo/PageNavigationBoardUncontrolledVsControlled.tsx +24 -18
  41. package/doc_src/theming/LogoRenderer.js +8 -9
  42. package/package.json +30 -28
  43. package/scripts/docker-compose.yml +1 -3
  44. package/src/chessboard/BoardProperties.ts +13 -13
  45. package/src/chessboard/Chessboard.tsx +43 -39
  46. package/src/chessboard/ChessboardImpl.tsx +58 -41
  47. package/src/chessboard/Draggable.tsx +15 -15
  48. package/src/chessboard/Motion.tsx +4 -4
  49. package/src/errorbox/ErrorBox.tsx +5 -5
  50. package/src/errorbox/parsing.tsx +6 -6
  51. package/src/i18n.ts +2 -2
  52. package/src/icons/AnnotationSymbolShape.tsx +5 -5
  53. package/src/icons/ArrowMarkerIcon.tsx +8 -4
  54. package/src/icons/ArrowTip.tsx +2 -2
  55. package/src/icons/ChessPieceIcon.tsx +4 -11
  56. package/src/icons/SquareMarkerIcon.tsx +3 -10
  57. package/src/icons/TextMarkerIcon.tsx +4 -11
  58. package/src/movetext/Movetext.tsx +11 -10
  59. package/src/movetext/MovetextImpl.tsx +34 -28
  60. package/src/movetext/htmlFilter.tsx +4 -4
  61. package/src/navigationboard/NavigationBoard.tsx +55 -50
  62. package/src/navigationboard/NavigationButton.ts +4 -4
  63. package/src/navigationboard/NavigationField.tsx +6 -6
  64. package/src/navigationboard/NavigationToolbar.tsx +17 -13
  65. package/src/types.ts +26 -26
  66. package/src/util.ts +2 -2
  67. package/test/01_types.js +83 -61
  68. package/test/02_chessboard_util.js +2 -0
  69. package/test/03_error_box_graphic.js +1 -1
  70. package/test/07_chessboard_interaction.js +1 -2
  71. package/test/13_navigation_board_graphic.js +3 -3
  72. package/test/common/graphic.js +11 -11
  73. package/test/graphic_references/03_error_box_graphic/base/cut_beginning_of_text.png +0 -0
  74. package/test/graphic_references/03_error_box_graphic/base/cut_end_of_text.png +0 -0
  75. package/test/graphic_references/03_error_box_graphic/base/cut_on_line_breaks.png +0 -0
  76. package/test/graphic_references/03_error_box_graphic/base/error_index_not_integer.png +0 -0
  77. package/test/graphic_references/03_error_box_graphic/base/full.png +0 -0
  78. package/test/graphic_references/03_error_box_graphic/base/minimal.png +0 -0
  79. package/test/graphic_references/03_error_box_graphic/base/missing_error_index.png +0 -0
  80. package/test/graphic_references/03_error_box_graphic/base/missing_error_text.png +0 -0
  81. package/test/graphic_references/03_error_box_graphic/base/negative_error_index.png +0 -0
  82. package/test/graphic_references/03_error_box_graphic/base/single_character_text.png +0 -0
  83. package/test/graphic_references/03_error_box_graphic/base/too_large_error_index.png +0 -0
  84. package/test/graphic_references/03_error_box_graphic/localization/default.png +0 -0
  85. package/test/graphic_references/04_icons_graphic/chess_piece/customized_pieceset.png +0 -0
  86. package/test/graphic_references/04_icons_graphic/chess_piece/invalid_multiple_pieces.png +0 -0
  87. package/test/graphic_references/04_icons_graphic/chess_piece/invalid_pieceset.png +0 -0
  88. package/test/graphic_references/04_icons_graphic/chess_piece/invalid_single_piece.png +0 -0
  89. package/test/graphic_references/04_icons_graphic/chess_piece/invalid_size.png +0 -0
  90. package/test/graphic_references/04_icons_graphic/chess_piece/multiple_pieces.png +0 -0
  91. package/test/graphic_references/04_icons_graphic/chess_piece/single_piece.png +0 -0
  92. package/test/graphic_references/04_icons_graphic/marker/colorized_arrow.png +0 -0
  93. package/test/graphic_references/04_icons_graphic/marker/colorized_square.png +0 -0
  94. package/test/graphic_references/04_icons_graphic/marker/colorized_symbol.png +0 -0
  95. package/test/graphic_references/04_icons_graphic/marker/colorized_text.png +0 -0
  96. package/test/graphic_references/04_icons_graphic/marker/default_arrow.png +0 -0
  97. package/test/graphic_references/04_icons_graphic/marker/default_square.png +0 -0
  98. package/test/graphic_references/04_icons_graphic/marker/default_text.png +0 -0
  99. package/test/graphic_references/04_icons_graphic/marker/invalid_arrow_size.png +0 -0
  100. package/test/graphic_references/04_icons_graphic/marker/invalid_square_size.png +0 -0
  101. package/test/graphic_references/04_icons_graphic/marker/invalid_symbol.png +0 -0
  102. package/test/graphic_references/04_icons_graphic/marker/invalid_text_size.png +0 -0
  103. package/test/graphic_references/04_icons_graphic/marker/wrapped_arrow.png +0 -0
  104. package/test/graphic_references/04_icons_graphic/marker/wrapped_square.png +0 -0
  105. package/test/graphic_references/04_icons_graphic/marker/wrapped_symbol.png +0 -0
  106. package/test/graphic_references/04_icons_graphic/marker/wrapped_text.png +0 -0
  107. package/test/graphic_references/05_chessboard_graphic/annotations/overlap.png +0 -0
  108. package/test/graphic_references/05_chessboard_graphic/annotations/overlap_and_flip.png +0 -0
  109. package/test/graphic_references/05_chessboard_graphic/annotations/with_coordinates.png +0 -0
  110. package/test/graphic_references/05_chessboard_graphic/annotations/with_coordinates_and_flip.png +0 -0
  111. package/test/graphic_references/05_chessboard_graphic/annotations/without_coordinates.png +0 -0
  112. package/test/graphic_references/05_chessboard_graphic/annotations/without_coordinates_and_flip.png +0 -0
  113. package/test/graphic_references/05_chessboard_graphic/base/default.png +0 -0
  114. package/test/graphic_references/05_chessboard_graphic/base/empty.png +0 -0
  115. package/test/graphic_references/05_chessboard_graphic/base/from_fen.png +0 -0
  116. package/test/graphic_references/05_chessboard_graphic/base/from_kokopu_object.png +0 -0
  117. package/test/graphic_references/05_chessboard_graphic/base/parsing_error.png +0 -0
  118. package/test/graphic_references/05_chessboard_graphic/base/wrong_position_type.png +0 -0
  119. package/test/graphic_references/05_chessboard_graphic/chess_variants/chess960.png +0 -0
  120. package/test/graphic_references/05_chessboard_graphic/chess_variants/chess960_with_move.png +0 -0
  121. package/test/graphic_references/05_chessboard_graphic/chess_variants/invalid_variant.png +0 -0
  122. package/test/graphic_references/05_chessboard_graphic/chess_variants/invalid_variant_with_fen.png +0 -0
  123. package/test/graphic_references/05_chessboard_graphic/chess_variants/special_code.png +0 -0
  124. package/test/graphic_references/05_chessboard_graphic/chess_variants/variant_with_std_initial_position.png +0 -0
  125. package/test/graphic_references/05_chessboard_graphic/chess_variants/variant_without_std_initial_position.png +0 -0
  126. package/test/graphic_references/05_chessboard_graphic/flipped/default.png +0 -0
  127. package/test/graphic_references/05_chessboard_graphic/flipped/empty.png +0 -0
  128. package/test/graphic_references/05_chessboard_graphic/flipped/from_fen.png +0 -0
  129. package/test/graphic_references/05_chessboard_graphic/flipped/from_kokopu_object.png +0 -0
  130. package/test/graphic_references/05_chessboard_graphic/flipped/parsing_error.png +0 -0
  131. package/test/graphic_references/05_chessboard_graphic/move/capture.png +0 -0
  132. package/test/graphic_references/05_chessboard_graphic/move/castling_move.png +0 -0
  133. package/test/graphic_references/05_chessboard_graphic/move/default.png +0 -0
  134. package/test/graphic_references/05_chessboard_graphic/move/en-passant.png +0 -0
  135. package/test/graphic_references/05_chessboard_graphic/move/illegal_null-move.png +0 -0
  136. package/test/graphic_references/05_chessboard_graphic/move/no_move_arrow.png +0 -0
  137. package/test/graphic_references/05_chessboard_graphic/move/null-move.png +0 -0
  138. package/test/graphic_references/05_chessboard_graphic/move/parsing_error.png +0 -0
  139. package/test/graphic_references/05_chessboard_graphic/move/promotion.png +0 -0
  140. package/test/graphic_references/05_chessboard_graphic/move/with_forced_move_arrow_and_flip.png +0 -0
  141. package/test/graphic_references/05_chessboard_graphic/move/wrong_move_arrow_color_type.png +0 -0
  142. package/test/graphic_references/05_chessboard_graphic/move/wrong_move_type.png +0 -0
  143. package/test/graphic_references/05_chessboard_graphic/theme/custom_1.png +0 -0
  144. package/test/graphic_references/05_chessboard_graphic/theme/custom_2.png +0 -0
  145. package/test/graphic_references/05_chessboard_graphic/theme/custom_3.png +0 -0
  146. package/test/graphic_references/05_chessboard_graphic/theme/custom_4.png +0 -0
  147. package/test/graphic_references/05_chessboard_graphic/theme/custom_5.png +0 -0
  148. package/test/graphic_references/05_chessboard_graphic/theme/custom_6.png +0 -0
  149. package/test/graphic_references/05_chessboard_graphic/theme/default.png +0 -0
  150. package/test/graphic_references/05_chessboard_graphic/theme/large.png +0 -0
  151. package/test/graphic_references/05_chessboard_graphic/theme/small.png +0 -0
  152. package/test/graphic_references/05_chessboard_graphic/theme/wrong_colorset.png +0 -0
  153. package/test/graphic_references/05_chessboard_graphic/theme/wrong_pieceset.png +0 -0
  154. package/test/graphic_references/05_chessboard_graphic/theme/wrong_square_size_type.png +0 -0
  155. package/test/graphic_references/06_chessboard_animation/base_1/capture.png +0 -0
  156. package/test/graphic_references/06_chessboard_animation/base_1/castling_move.png +0 -0
  157. package/test/graphic_references/06_chessboard_animation/base_1/en-passant.png +0 -0
  158. package/test/graphic_references/06_chessboard_animation/base_1/move_1.png +0 -0
  159. package/test/graphic_references/06_chessboard_animation/base_1/move_2.png +0 -0
  160. package/test/graphic_references/06_chessboard_animation/base_1/promotion.png +0 -0
  161. package/test/graphic_references/06_chessboard_animation/base_2/capture.png +0 -0
  162. package/test/graphic_references/06_chessboard_animation/base_2/castling_move.png +0 -0
  163. package/test/graphic_references/06_chessboard_animation/base_2/en-passant.png +0 -0
  164. package/test/graphic_references/06_chessboard_animation/base_2/move_1.png +0 -0
  165. package/test/graphic_references/06_chessboard_animation/base_2/move_2.png +0 -0
  166. package/test/graphic_references/06_chessboard_animation/base_2/promotion.png +0 -0
  167. package/test/graphic_references/06_chessboard_animation/base_3/capture.png +0 -0
  168. package/test/graphic_references/06_chessboard_animation/base_3/castling_move.png +0 -0
  169. package/test/graphic_references/06_chessboard_animation/base_3/en-passant.png +0 -0
  170. package/test/graphic_references/06_chessboard_animation/base_3/move_1.png +0 -0
  171. package/test/graphic_references/06_chessboard_animation/base_3/move_2.png +0 -0
  172. package/test/graphic_references/06_chessboard_animation/base_3/promotion.png +0 -0
  173. package/test/graphic_references/06_chessboard_animation/on_redraw/final_state.png +0 -0
  174. package/test/graphic_references/06_chessboard_animation/on_redraw/initial_state.png +0 -0
  175. package/test/graphic_references/07_chessboard_interaction/edit_arrows/base_1.png +0 -0
  176. package/test/graphic_references/07_chessboard_interaction/edit_arrows/base_2.png +0 -0
  177. package/test/graphic_references/07_chessboard_interaction/edit_arrows/from_==_to.png +0 -0
  178. package/test/graphic_references/07_chessboard_interaction/edit_arrows/out_of_board.png +0 -0
  179. package/test/graphic_references/07_chessboard_interaction/edit_arrows/over_arrow_marker.png +0 -0
  180. package/test/graphic_references/07_chessboard_interaction/edit_arrows/over_square_marker.png +0 -0
  181. package/test/graphic_references/07_chessboard_interaction/error/edit_color_not_set.png +0 -0
  182. package/test/graphic_references/07_chessboard_interaction/error/wrong_interaction_mode.png +0 -0
  183. package/test/graphic_references/07_chessboard_interaction/move_pieces/after_move.png +0 -0
  184. package/test/graphic_references/07_chessboard_interaction/move_pieces/from_==_to.png +0 -0
  185. package/test/graphic_references/07_chessboard_interaction/move_pieces/move_empty_square.png +0 -0
  186. package/test/graphic_references/07_chessboard_interaction/move_pieces/out_of_board.png +0 -0
  187. package/test/graphic_references/07_chessboard_interaction/move_pieces/over_arrow_marker.png +0 -0
  188. package/test/graphic_references/07_chessboard_interaction/move_pieces/over_empty.png +0 -0
  189. package/test/graphic_references/07_chessboard_interaction/move_pieces/over_non-empty_1.png +0 -0
  190. package/test/graphic_references/07_chessboard_interaction/move_pieces/over_non-empty_2.png +0 -0
  191. package/test/graphic_references/07_chessboard_interaction/move_pieces/over_square_marker.png +0 -0
  192. package/test/graphic_references/07_chessboard_interaction/move_pieces/over_text_marker.png +0 -0
  193. package/test/graphic_references/08_chessboard_play_moves/base/castling_move.png +0 -0
  194. package/test/graphic_references/08_chessboard_play_moves/base/chess960_ambiguous_king_move.png +0 -0
  195. package/test/graphic_references/08_chessboard_play_moves/base/chess960_castling_move_1.png +0 -0
  196. package/test/graphic_references/08_chessboard_play_moves/base/chess960_castling_move_2.png +0 -0
  197. package/test/graphic_references/08_chessboard_play_moves/base/chess960_non-kxr_castling.png +0 -0
  198. package/test/graphic_references/08_chessboard_play_moves/base/from_==_to.png +0 -0
  199. package/test/graphic_references/08_chessboard_play_moves/base/illegal_move.png +0 -0
  200. package/test/graphic_references/08_chessboard_play_moves/base/illegal_position.png +0 -0
  201. package/test/graphic_references/08_chessboard_play_moves/base/out_of_board.png +0 -0
  202. package/test/graphic_references/08_chessboard_play_moves/base/regular_move_1.png +0 -0
  203. package/test/graphic_references/08_chessboard_play_moves/base/regular_move_2.png +0 -0
  204. package/test/graphic_references/08_chessboard_play_moves/base/wrong_color_moved.png +0 -0
  205. package/test/graphic_references/08_chessboard_play_moves/promotions/antichess_promotion.png +0 -0
  206. package/test/graphic_references/08_chessboard_play_moves/promotions/cancel_promotion.png +0 -0
  207. package/test/graphic_references/08_chessboard_play_moves/promotions/regular_promotion_1.png +0 -0
  208. package/test/graphic_references/08_chessboard_play_moves/promotions/regular_promotion_2.png +0 -0
  209. package/test/graphic_references/09_chessboard_small_screens/base/default.png +0 -0
  210. package/test/graphic_references/09_chessboard_small_screens/base/invalid_limits.png +0 -0
  211. package/test/graphic_references/09_chessboard_small_screens/base/width_690.png +0 -0
  212. package/test/graphic_references/09_chessboard_small_screens/base/width_700.png +0 -0
  213. package/test/graphic_references/09_chessboard_small_screens/base/width_710.png +0 -0
  214. package/test/graphic_references/09_chessboard_small_screens/base/width_720.png +0 -0
  215. package/test/graphic_references/09_chessboard_small_screens/base/width_730.png +0 -0
  216. package/test/graphic_references/09_chessboard_small_screens/base/width_740.png +0 -0
  217. package/test/graphic_references/09_chessboard_small_screens/base/width_750.png +0 -0
  218. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/default_bottom_component.png +0 -0
  219. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/default_top_component.png +0 -0
  220. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/reduced_bottom_component.png +0 -0
  221. package/test/graphic_references/09_chessboard_small_screens/top_bottom_components/reduced_top_component.png +0 -0
  222. package/test/graphic_references/10_movetext_graphic/base/game_1.png +0 -0
  223. package/test/graphic_references/10_movetext_graphic/base/game_2.png +0 -0
  224. package/test/graphic_references/10_movetext_graphic/base/game_3.png +0 -0
  225. package/test/graphic_references/10_movetext_graphic/base/game_4.png +0 -0
  226. package/test/graphic_references/10_movetext_graphic/error/pgn_parsing_error_1.png +0 -0
  227. package/test/graphic_references/10_movetext_graphic/error/pgn_parsing_error_2.png +0 -0
  228. package/test/graphic_references/10_movetext_graphic/error/wrong_game_index_1.png +0 -0
  229. package/test/graphic_references/10_movetext_graphic/error/wrong_game_index_2.png +0 -0
  230. package/test/graphic_references/10_movetext_graphic/error/wrong_game_index_type.png +0 -0
  231. package/test/graphic_references/10_movetext_graphic/error/wrong_game_type.png +0 -0
  232. package/test/graphic_references/10_movetext_graphic/format_move/format_text.png +0 -0
  233. package/test/graphic_references/10_movetext_graphic/html/filtered_tags_and_attributes.png +0 -0
  234. package/test/graphic_references/10_movetext_graphic/html/html_in_comments.png +0 -0
  235. package/test/graphic_references/10_movetext_graphic/html/html_in_headers.png +0 -0
  236. package/test/graphic_references/10_movetext_graphic/options/custom_piece_symbols.png +0 -0
  237. package/test/graphic_references/10_movetext_graphic/options/figurine_piece_symbols_and_diagram_options.png +0 -0
  238. package/test/graphic_references/10_movetext_graphic/options/hidden_diagrams.png +0 -0
  239. package/test/graphic_references/10_movetext_graphic/options/localized_piece_symbols.png +0 -0
  240. package/test/graphic_references/10_movetext_graphic/options/other_diagram_options.png +0 -0
  241. package/test/graphic_references/10_movetext_graphic/options/wrong_diagram_options_1.png +0 -0
  242. package/test/graphic_references/10_movetext_graphic/options/wrong_diagram_options_2.png +0 -0
  243. package/test/graphic_references/10_movetext_graphic/options/wrong_piece_symbol_value.png +0 -0
  244. package/test/graphic_references/11_movetext_interaction/error/wrong_interaction_mode.png +0 -0
  245. package/test/graphic_references/11_movetext_interaction/select_moves/click_on_disabled.png +0 -0
  246. package/test/graphic_references/11_movetext_interaction/select_moves/click_on_unselected.png +0 -0
  247. package/test/graphic_references/11_movetext_interaction/select_moves/click_on_unselected_without_callback.png +0 -0
  248. package/test/graphic_references/11_movetext_interaction/select_moves/click_on_with_variations.png +0 -0
  249. package/test/graphic_references/12_navigation_board_base/controlled/default.png +0 -0
  250. package/test/graphic_references/12_navigation_board_base/controlled/forbidden_navigation_0.png +0 -0
  251. package/test/graphic_references/12_navigation_board_base/controlled/forbidden_navigation_1.png +0 -0
  252. package/test/graphic_references/12_navigation_board_base/controlled/invalid_node_id.png +0 -0
  253. package/test/graphic_references/12_navigation_board_base/controlled/no_callback_defined_0.png +0 -0
  254. package/test/graphic_references/12_navigation_board_base/controlled/no_callback_defined_1.png +0 -0
  255. package/test/graphic_references/12_navigation_board_base/controlled/overriding_initial_node_id.png +0 -0
  256. package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_0.png +0 -0
  257. package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_1.png +0 -0
  258. package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_2.png +0 -0
  259. package/test/graphic_references/12_navigation_board_base/controlled/regular_navigation_3.png +0 -0
  260. package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_beginning_0.png +0 -0
  261. package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_beginning_1.png +0 -0
  262. package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_beginning_2.png +0 -0
  263. package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_end_0.png +0 -0
  264. package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_end_1.png +0 -0
  265. package/test/graphic_references/12_navigation_board_base/uncontrolled/forbidden_navigation_at_end_2.png +0 -0
  266. package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_at_end.png +0 -0
  267. package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_at_specific_id.png +0 -0
  268. package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_default.png +0 -0
  269. package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_default_with_game_index.png +0 -0
  270. package/test/graphic_references/12_navigation_board_base/uncontrolled/initial_state_on_null-move.png +0 -0
  271. package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_0.png +0 -0
  272. package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_1.png +0 -0
  273. package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_2.png +0 -0
  274. package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_3.png +0 -0
  275. package/test/graphic_references/12_navigation_board_base/uncontrolled/navigation_with_keys_4.png +0 -0
  276. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_flipping_0.png +0 -0
  277. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_flipping_1.png +0 -0
  278. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_0.png +0 -0
  279. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_1.png +0 -0
  280. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_2.png +0 -0
  281. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_3.png +0 -0
  282. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_4.png +0 -0
  283. package/test/graphic_references/12_navigation_board_base/uncontrolled/regular_navigation_5.png +0 -0
  284. package/test/graphic_references/13_navigation_board_graphic/additional_buttons/error_1.png +0 -0
  285. package/test/graphic_references/13_navigation_board_graphic/additional_buttons/error_2.png +0 -0
  286. package/test/graphic_references/13_navigation_board_graphic/additional_buttons/multiple_buttons.png +0 -0
  287. package/test/graphic_references/13_navigation_board_graphic/additional_buttons/single_button.png +0 -0
  288. package/test/graphic_references/13_navigation_board_graphic/error/pgn_parsing_error.png +0 -0
  289. package/test/graphic_references/13_navigation_board_graphic/error/wrong_game_type.png +0 -0
  290. package/test/graphic_references/13_navigation_board_graphic/theme/custom_1.png +0 -0
  291. package/test/graphic_references/13_navigation_board_graphic/theme/custom_2.png +0 -0
  292. package/test/graphic_references/13_navigation_board_graphic/theme/large.png +0 -0
  293. package/test/graphic_references/13_navigation_board_graphic/theme/small.png +0 -0
  294. package/test/graphic_references/14_navigation_board_autoplay/controlled/after_1_move_acknowledging_is-playing_changes.png +0 -0
  295. package/test/graphic_references/14_navigation_board_autoplay/controlled/after_1_move_not_acknowledging_is-playing_changes.png +0 -0
  296. package/test/graphic_references/14_navigation_board_autoplay/controlled/after_2_moves_acknowledging_node_changes.png +0 -0
  297. package/test/graphic_references/14_navigation_board_autoplay/controlled/after_2_moves_not_acknowledging_node_changes.png +0 -0
  298. package/test/graphic_references/14_navigation_board_autoplay/controlled/after_reaching_the_end.png +0 -0
  299. package/test/graphic_references/14_navigation_board_autoplay/controlled/already_at_the_end.png +0 -0
  300. package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_acknowledging_is-playing_changes.png +0 -0
  301. package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_acknowledging_node_changes.png +0 -0
  302. package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_at_the_end.png +0 -0
  303. package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_close_to_end.png +0 -0
  304. package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_not_acknowledging_is-playing_changes.png +0 -0
  305. package/test/graphic_references/14_navigation_board_autoplay/controlled/initial_state_not_acknowledging_node_changes.png +0 -0
  306. package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_2_moves_from_beginning_after_stop.png +0 -0
  307. package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_2_moves_from_beginning_before_stop.png +0 -0
  308. package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_reaching_the_end_after_stop.png +0 -0
  309. package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/after_reaching_the_end_before_stop.png +0 -0
  310. package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/initial_state_close_to_end.png +0 -0
  311. package/test/graphic_references/14_navigation_board_autoplay/uncontrolled/initial_state_default.png +0 -0
  312. package/test/graphic_test_app/03_error_box_graphic/base.tsx +18 -6
  313. package/test/graphic_test_app/04_icons_graphic/chess_piece.tsx +12 -3
  314. package/test/graphic_test_app/04_icons_graphic/marker.tsx +14 -4
  315. package/test/graphic_test_app/05_chessboard_graphic/annotations.tsx +7 -3
  316. package/test/graphic_test_app/05_chessboard_graphic/base.tsx +1 -1
  317. package/test/graphic_test_app/05_chessboard_graphic/move.tsx +9 -2
  318. package/test/graphic_test_app/05_chessboard_graphic/theme.tsx +1 -1
  319. package/test/graphic_test_app/06_chessboard_animation/on_redraw.tsx +8 -6
  320. package/test/graphic_test_app/07_chessboard_interaction/click_squares.tsx +4 -2
  321. package/test/graphic_test_app/07_chessboard_interaction/edit_arrows.tsx +4 -2
  322. package/test/graphic_test_app/07_chessboard_interaction/error.tsx +3 -1
  323. package/test/graphic_test_app/07_chessboard_interaction/move_pieces.tsx +4 -2
  324. package/test/graphic_test_app/08_chessboard_play_moves/base.tsx +12 -6
  325. package/test/graphic_test_app/08_chessboard_play_moves/promotions.tsx +12 -3
  326. package/test/graphic_test_app/09_chessboard_small_screens/base.tsx +3 -1
  327. package/test/graphic_test_app/09_chessboard_small_screens/top_bottom_components.tsx +8 -6
  328. package/test/graphic_test_app/10_movetext_graphic/error.tsx +1 -1
  329. package/test/graphic_test_app/10_movetext_graphic/options.tsx +16 -6
  330. package/test/graphic_test_app/11_movetext_interaction/error.tsx +4 -1
  331. package/test/graphic_test_app/13_navigation_board_graphic/additional_buttons.tsx +23 -16
  332. package/test/graphic_test_app/13_navigation_board_graphic/error.tsx +1 -1
  333. package/test/graphic_test_app/14_navigation_board_autoplay/controlled.tsx +34 -18
  334. package/test/graphic_test_app/common/test_app.tsx +4 -4
  335. package/.eslintrc.yml +0 -83
  336. package/test/.eslintrc.yml +0 -8
  337. package/test/graphic_test_app/.eslintrc.yml +0 -3
@@ -31,19 +31,29 @@ testApp([ /* eslint-disable react/jsx-key */
31
31
  <SquareMarkerIcon size={40} />,
32
32
  <SquareMarkerIcon size={45} color="green" />,
33
33
  <div style={{ color: 'purple' }}><SquareMarkerIcon size={31} /></div>,
34
- <SquareMarkerIcon size={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-number' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
34
+ <SquareMarkerIcon
35
+ size={/* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-number' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
36
+ />,
35
37
 
36
38
  <TextMarkerIcon size={41} symbol="A" />,
37
39
  <TextMarkerIcon size={29} symbol="b" color="#0ff" />,
38
40
  <div style={{ color: 'red' }}><TextMarkerIcon size={53} symbol="5" /></div>,
39
41
  <TextMarkerIcon size={47} symbol="dot" color="#00f" />,
40
42
  <div style={{ color: 'pink' }}><TextMarkerIcon size={48} symbol="circle" /></div>,
41
- <TextMarkerIcon size={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-number' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } symbol="A" />,
42
- <TextMarkerIcon size={40} symbol={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-symbol' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
43
+ <TextMarkerIcon
44
+ size={/* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-number' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
45
+ symbol="A"
46
+ />,
47
+ <TextMarkerIcon
48
+ size={40}
49
+ symbol={/* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-symbol' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
50
+ />,
43
51
 
44
52
  <ArrowMarkerIcon size={40} />,
45
53
  <ArrowMarkerIcon size={24} color="#888" />,
46
54
  <div style={{ color: '#f70' }}><ArrowMarkerIcon size={48} /></div>,
47
- <ArrowMarkerIcon size={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-number' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
55
+ <ArrowMarkerIcon
56
+ size={/* eslint-disable @typescript-eslint/no-explicit-any */ 'not-a-number' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
57
+ />,
48
58
 
49
59
  ]); /* eslint-enable react/jsx-key */
@@ -52,7 +52,11 @@ testApp([ /* eslint-disable react/jsx-key */
52
52
  <Chessboard squareMarkers={squareMarkers1} arrowMarkers={arrowMarkers1} textMarkers={textMarkers1} flipped={true} coordinateVisible={true} />,
53
53
  <Chessboard squareMarkers={squareMarkers2} arrowMarkers={arrowMarkers2} textMarkers={textMarkers2} flipped={false} coordinateVisible={false} />,
54
54
  <Chessboard squareMarkers={squareMarkers2} arrowMarkers={arrowMarkers2} textMarkers={textMarkers2} flipped={true} coordinateVisible={false} />,
55
- <Chessboard squareMarkers={squareMarkers3} arrowMarkers={arrowMarkers3} textMarkers={textMarkers3} flipped={false} coordinateVisible={false} position="empty" />,
56
- <Chessboard squareMarkers={squareMarkers3} arrowMarkers={arrowMarkers3} textMarkers={textMarkers3} flipped={true} coordinateVisible={true}
57
- position="8/8/1r6/8/5k1K/8/8/8 b - - 0 1" />,
55
+ <Chessboard
56
+ squareMarkers={squareMarkers3} arrowMarkers={arrowMarkers3} textMarkers={textMarkers3} flipped={false} coordinateVisible={false} position="empty"
57
+ />,
58
+ <Chessboard
59
+ squareMarkers={squareMarkers3} arrowMarkers={arrowMarkers3} textMarkers={textMarkers3} flipped={true} coordinateVisible={true}
60
+ position="8/8/1r6/8/5k1K/8/8/8 b - - 0 1"
61
+ />,
58
62
  ]); /* eslint-enable react/jsx-key */
@@ -33,5 +33,5 @@ testApp([ /* eslint-disable react/jsx-key */
33
33
  <Chessboard position="something invalid" />,
34
34
  <Chessboard position="r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 3 3" turnVisible={false} />,
35
35
  <Chessboard position={new Position('8/8/1r6/8/5k1K/8/8/8 b - - 0 1')} />,
36
- <Chessboard position={ /* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
36
+ <Chessboard position={/* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */} />,
37
37
  ]); /* eslint-enable react/jsx-key */
@@ -39,8 +39,15 @@ testApp([ /* eslint-disable react/jsx-key */
39
39
  <Chessboard position="r3k2r/pppppppp/8/8/8/8/PPPPPPPP/R3K2R b KQkq - 0 1" move="O-O-O" animated={false} moveArrowColor="r" />,
40
40
  <Chessboard position="rnbqkbnr/ppp1p1pp/8/3pPp2/8/8/PPPP1PPP/RNBQKBNR w KQkq f6 0 3" move="exf6" animated={false} moveArrowColor="y" />,
41
41
  <Chessboard position="8/8/8/1K6/8/4k3/1p6/8 b - - 0 1" move="b1=R+" animated={false} moveArrowColor="b" />,
42
- <Chessboard move={ /* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */ } animated={false} />,
43
- <Chessboard move="e4" animated={false} moveArrowColor={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'z' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
42
+ <Chessboard
43
+ move={/* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */}
44
+ animated={false}
45
+ />,
46
+ <Chessboard
47
+ move="e4"
48
+ animated={false}
49
+ moveArrowColor={/* eslint-disable @typescript-eslint/no-explicit-any */ 'z' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
50
+ />,
44
51
  <Chessboard move="--" animated={false} />,
45
52
  <Chessboard position="rnbqkbnr/ppp1pppp/8/1B1p4/4P3/8/PPPP1PPP/RNBQK1NR b KQkq - 1 2" move="--" animated={false} />,
46
53
  ]); /* eslint-enable react/jsx-key */
@@ -45,7 +45,7 @@ testApp([ /* eslint-disable react/jsx-key */
45
45
  <Chessboard position={pos1} move={mv1} squareMarkers={sm} arrowMarkers={am} colorset="emerald" pieceset="skulls" animated={false} />,
46
46
  <Chessboard position={pos2} move={mv2} squareMarkers={sm} arrowMarkers={am} squareSize={91} flipped={true} colorset="gray" pieceset="spatial" animated={false} />,
47
47
  <Chessboard position={pos1} move={mv1} squareMarkers={sm} arrowMarkers={am} squareSize={17} colorset="dusk" animated={false} />,
48
- <Chessboard squareSize={ /* eslint-disable @typescript-eslint/no-explicit-any */ '24' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
48
+ <Chessboard squareSize={/* eslint-disable @typescript-eslint/no-explicit-any */ '24' as any /* eslint-enable @typescript-eslint/no-explicit-any */} />,
49
49
  <Chessboard colorset="not-a-colorset" />,
50
50
  <Chessboard pieceset="not-a-pieceset" />,
51
51
  ]); /* eslint-enable react/jsx-key */
@@ -37,12 +37,14 @@ function TestComponent() {
37
37
  setClicked(true);
38
38
  }
39
39
 
40
- return (<>
41
- <div>
42
- <Chessboard position={position} move={move} animated={true} />
43
- </div>
44
- {clicked ? undefined : <button id="chessboard-action-button" onClick={onClick}>Click here</button>}
45
- </>);
40
+ return (
41
+ <>
42
+ <div>
43
+ <Chessboard position={position} move={move} animated={true} />
44
+ </div>
45
+ {clicked ? undefined : <button id="chessboard-action-button" onClick={onClick}>Click here</button>}
46
+ </>
47
+ );
46
48
  }
47
49
 
48
50
 
@@ -34,6 +34,8 @@ function onSquareClicked(sq: Square) {
34
34
  testApp([ /* eslint-disable react/jsx-key */
35
35
  <Chessboard squareSize={50} interactionMode="clickSquares" onSquareClicked={onSquareClicked} />,
36
36
  <Chessboard squareSize={50} interactionMode="clickSquares" onSquareClicked={onSquareClicked} flipped coordinateVisible={false} />,
37
- <Chessboard squareSize={50} interactionMode="clickSquares" onSquareClicked={onSquareClicked} position="empty"
38
- squareMarkers="Ga8" arrowMarkers="Ra6d6" textMarkers="YAb4" />,
37
+ <Chessboard
38
+ squareSize={50} interactionMode="clickSquares" onSquareClicked={onSquareClicked} position="empty"
39
+ squareMarkers="Ga8" arrowMarkers="Ra6d6" textMarkers="YAb4"
40
+ />,
39
41
  ]); /* eslint-enable react/jsx-key */
@@ -33,6 +33,8 @@ function onArrowEdited(from: Square, to: Square) {
33
33
 
34
34
  testApp([ /* eslint-disable react/jsx-key */
35
35
  <Chessboard squareSize={50} coordinateVisible={false} interactionMode="editArrows" onArrowEdited={onArrowEdited} editedArrowColor="g" />,
36
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="editArrows" onArrowEdited={onArrowEdited} editedArrowColor="r" flipped
37
- squareMarkers="Gc5" arrowMarkers="Yh3f6" />,
36
+ <Chessboard
37
+ squareSize={50} coordinateVisible={false} interactionMode="editArrows" onArrowEdited={onArrowEdited} editedArrowColor="r" flipped
38
+ squareMarkers="Gc5" arrowMarkers="Yh3f6"
39
+ />,
38
40
  ]); /* eslint-enable react/jsx-key */
@@ -27,6 +27,8 @@ import { testApp } from '../common/test_app';
27
27
  import { Chessboard } from '../../../dist/lib/index';
28
28
 
29
29
  testApp([ /* eslint-disable react/jsx-key */
30
- <Chessboard interactionMode={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'whatever' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
30
+ <Chessboard
31
+ interactionMode={/* eslint-disable @typescript-eslint/no-explicit-any */ 'whatever' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
32
+ />,
31
33
  <Chessboard interactionMode="editArrows" />,
32
34
  ]); /* eslint-enable react/jsx-key */
@@ -33,7 +33,9 @@ function onPieceMoved(from: Square, to: Square) {
33
33
 
34
34
  testApp([ /* eslint-disable react/jsx-key */
35
35
  <Chessboard squareSize={50} coordinateVisible={false} interactionMode="movePieces" onPieceMoved={onPieceMoved} />,
36
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="movePieces" onPieceMoved={onPieceMoved} flipped
37
- squareMarkers="Gc4" textMarkers="BAh3" arrowMarkers="Gc8a4" moveArrowColor="r" />,
36
+ <Chessboard
37
+ squareSize={50} coordinateVisible={false} interactionMode="movePieces" onPieceMoved={onPieceMoved} flipped
38
+ squareMarkers="Gc4" textMarkers="BAh3" arrowMarkers="Gc8a4" moveArrowColor="r"
39
+ />,
38
40
  <Chessboard squareSize={50} coordinateVisible={false} interactionMode="movePieces" onPieceMoved={onPieceMoved} move="e4" animated={false} />,
39
41
  ]); /* eslint-enable react/jsx-key */
@@ -32,10 +32,16 @@ function onMovePlayed(move: string) {
32
32
 
33
33
  testApp([ /* eslint-disable react/jsx-key */
34
34
  <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed} />,
35
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
36
- flipped position="rnbqk2r/ppp2ppp/3p1n2/2b1p3/4P3/2NP1N2/PPP2PPP/R1BQKB1R w KQkq - 0 1" move="Bg5" animated={false} moveArrowColor="g" />,
37
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
38
- position="rnbq1bnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1" />,
39
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
40
- position="chess960:1r3k1r/pppppppp/8/8/8/8/PPPPPPPP/1R3K1R w BHbh - 0 1" />,
35
+ <Chessboard
36
+ squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
37
+ flipped position="rnbqk2r/ppp2ppp/3p1n2/2b1p3/4P3/2NP1N2/PPP2PPP/R1BQKB1R w KQkq - 0 1" move="Bg5" animated={false} moveArrowColor="g"
38
+ />,
39
+ <Chessboard
40
+ squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
41
+ position="rnbq1bnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1"
42
+ />,
43
+ <Chessboard
44
+ squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
45
+ position="chess960:1r3k1r/pppppppp/8/8/8/8/PPPPPPPP/1R3K1R w BHbh - 0 1"
46
+ />,
41
47
  ]); /* eslint-enable react/jsx-key */
@@ -31,7 +31,16 @@ function onMovePlayed(move: string) {
31
31
  }
32
32
 
33
33
  testApp([ /* eslint-disable react/jsx-key */
34
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed} position="8/1P6/8/8/7k/8/5K2/8 w - - 0 1" />,
35
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed} position="8/8/8/8/7k/8/1p3K2/R7 b - - 0 1" />,
36
- <Chessboard squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed} flipped position="antichess:8/1P6/8/8/7r/8/5K2/8 w - - 0 1" />,
34
+ <Chessboard
35
+ squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
36
+ position="8/1P6/8/8/7k/8/5K2/8 w - - 0 1"
37
+ />,
38
+ <Chessboard
39
+ squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
40
+ position="8/8/8/8/7k/8/1p3K2/R7 b - - 0 1"
41
+ />,
42
+ <Chessboard
43
+ squareSize={50} coordinateVisible={false} interactionMode="playMoves" onMovePlayed={onMovePlayed}
44
+ flipped position="antichess:8/1P6/8/8/7r/8/5K2/8 w - - 0 1"
45
+ />,
37
46
  ]); /* eslint-enable react/jsx-key */
@@ -39,5 +39,7 @@ const limits = [
39
39
 
40
40
  testApp([ /* eslint-disable react/jsx-key */
41
41
  <Chessboard squareSize={50} smallScreenLimits={limits} />,
42
- <Chessboard smallScreenLimits={ /* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
42
+ <Chessboard
43
+ smallScreenLimits={/* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */}
44
+ />,
43
45
  ]); /* eslint-enable react/jsx-key */
@@ -34,12 +34,14 @@ const limits2 = [
34
34
  { width: 750, squareSize: 27, turnVisible: false },
35
35
  ];
36
36
 
37
- function AuxilliaryComponent({ squareSize, coordinateVisible, turnVisible}: Pick<ChessboardProps, 'squareSize' | 'coordinateVisible' | 'turnVisible'>) {
38
- return (<>
39
- <div>{`Square size: ${squareSize}`}</div>
40
- <div>{`Coordinates: ${coordinateVisible}`}</div>
41
- <div>{`Turn: ${turnVisible}`}</div>
42
- </>);
37
+ function AuxilliaryComponent({ squareSize, coordinateVisible, turnVisible }: Pick<ChessboardProps, 'squareSize' | 'coordinateVisible' | 'turnVisible'>) {
38
+ return (
39
+ <>
40
+ <div>{`Square size: ${squareSize}`}</div>
41
+ <div>{`Coordinates: ${coordinateVisible}`}</div>
42
+ <div>{`Turn: ${turnVisible}`}</div>
43
+ </>
44
+ );
43
45
  }
44
46
 
45
47
  testApp([ /* eslint-disable react/jsx-key */
@@ -37,6 +37,6 @@ testApp([ /* eslint-disable react/jsx-key */
37
37
  <Movetext game={database} gameIndex={99} />,
38
38
  <Movetext game={dummyPgn} />,
39
39
  <Movetext game={pgnRead(dummyPgn)} gameIndex={1} />,
40
- <Movetext game={ /* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
40
+ <Movetext game={/* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */} />,
41
41
  <Movetext game={pgn} gameIndex={-1} />,
42
42
  ], 'width-600'); /* eslint-enable react/jsx-key */
@@ -34,12 +34,22 @@ i18n.PIECE_SYMBOLS = { K: 'R', Q: 'D', R: 'T', B: 'F', N: 'C', P: 'P' };
34
34
  testApp([ /* eslint-disable react/jsx-key */
35
35
  <Movetext game={pgn} pieceSymbols="localized" />,
36
36
  <Movetext game={pgn} gameIndex={2} pieceSymbols={{ K: 'Ki_', Q: 'Qu_', R: 'Rk_', B: 'Bi_', N: 'Kn_', P: 'Pw_' }} />,
37
- <Movetext game={pgn} gameIndex={3} pieceSymbols="figurines" headerVisible={false}
38
- diagramOptions={{ flipped: true, coordinateVisible: false, squareSize: 32, colorset: 'scid', pieceset: 'eyes' }} />,
37
+ <Movetext
38
+ game={pgn} gameIndex={3} pieceSymbols="figurines" headerVisible={false}
39
+ diagramOptions={{ flipped: true, coordinateVisible: false, squareSize: 32, colorset: 'scid', pieceset: 'eyes' }}
40
+ />,
39
41
  <Movetext game={pgn} gameIndex={3} diagramOptions={{ turnVisible: false, squareSize: 32 }} />,
40
42
  <Movetext game={pgn} gameIndex={9} diagramVisible={false} />,
41
- <Movetext game={pgn} gameIndex={3} diagramOptions={ /* eslint-disable @typescript-eslint/no-explicit-any */ null as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
42
- <Movetext game={pgn} gameIndex={3}
43
- diagramOptions={ /* eslint-disable @typescript-eslint/no-explicit-any */ { squareSize: '32' } as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
44
- <Movetext game={pgn} pieceSymbols={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'invalid' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />
43
+ <Movetext
44
+ game={pgn} gameIndex={3}
45
+ diagramOptions={/* eslint-disable @typescript-eslint/no-explicit-any */ null as any /* eslint-enable @typescript-eslint/no-explicit-any */}
46
+ />,
47
+ <Movetext
48
+ game={pgn} gameIndex={3}
49
+ diagramOptions={/* eslint-disable @typescript-eslint/no-explicit-any */ { squareSize: '32' } as any /* eslint-enable @typescript-eslint/no-explicit-any */}
50
+ />,
51
+ <Movetext
52
+ game={pgn}
53
+ pieceSymbols={/* eslint-disable @typescript-eslint/no-explicit-any */ 'invalid' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
54
+ />,
45
55
  ], 'width-600'); /* eslint-enable react/jsx-key */
@@ -29,5 +29,8 @@ import { Movetext } from '../../../dist/lib/index';
29
29
  import pgn from '../common/games.pgn';
30
30
 
31
31
  testApp([ /* eslint-disable react/jsx-key */
32
- <Movetext game={pgn} gameIndex={7} interactionMode={ /* eslint-disable @typescript-eslint/no-explicit-any */ 'whatever' as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
32
+ <Movetext
33
+ game={pgn} gameIndex={7}
34
+ interactionMode={/* eslint-disable @typescript-eslint/no-explicit-any */ 'whatever' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
35
+ />,
33
36
  ], 'width-600'); /* eslint-enable react/jsx-key */
@@ -30,20 +30,27 @@ import pgn from '../common/games.pgn';
30
30
 
31
31
  testApp([ /* eslint-disable react/jsx-key */
32
32
  <NavigationBoard game={pgn} additionalButtons={[ { iconPath: 'M 11 11 H 21 V 21 H 11 Z' } ]} />,
33
- <NavigationBoard game={pgn} additionalButtons={[
34
- { iconPath: 'M 11 11 H 21 V 21 H 11 Z', tooltip: 'Button 0', enabled: true },
35
- { iconPath: 'M 9 16 L 16 9 L 23 16 L 16 23 Z', tooltip: 'Button A', onClick: () => setSandbox('Button A clicked') },
36
- 'spacer',
37
- { iconPath: 'M 16 22 L 10 11 H 22 Z', tooltip: 'Button B', onClick: () => setSandbox('Button B clicked') },
38
- 'spacer',
39
- 'spacer',
40
- { iconPath: 'M 16 10 L 22 21 H 10 Z', tooltip: 'Button C', enabled: false, onClick: () => setSandbox('Button C clicked') },
41
- ]} />,
42
- <NavigationBoard game={pgn} additionalButtons={
43
- /* eslint-disable @typescript-eslint/no-explicit-any */ 'not a button nor a spacer' as any /* eslint-enable @typescript-eslint/no-explicit-any */
44
- } />,
45
- <NavigationBoard game={pgn} additionalButtons={[
46
- { iconPath: 'M 11 11 H 21 V 21 H 11 Z' },
47
- /* eslint-disable @typescript-eslint/no-explicit-any */ 'not a button nor a spacer' as any /* eslint-enable @typescript-eslint/no-explicit-any */,
48
- ]} />,
33
+ <NavigationBoard
34
+ game={pgn}
35
+ additionalButtons={[
36
+ { iconPath: 'M 11 11 H 21 V 21 H 11 Z', tooltip: 'Button 0', enabled: true },
37
+ { iconPath: 'M 9 16 L 16 9 L 23 16 L 16 23 Z', tooltip: 'Button A', onClick: () => setSandbox('Button A clicked') },
38
+ 'spacer',
39
+ { iconPath: 'M 16 22 L 10 11 H 22 Z', tooltip: 'Button B', onClick: () => setSandbox('Button B clicked') },
40
+ 'spacer',
41
+ 'spacer',
42
+ { iconPath: 'M 16 10 L 22 21 H 10 Z', tooltip: 'Button C', enabled: false, onClick: () => setSandbox('Button C clicked') },
43
+ ]}
44
+ />,
45
+ <NavigationBoard
46
+ game={pgn}
47
+ additionalButtons={/* eslint-disable @typescript-eslint/no-explicit-any */ 'not a button nor a spacer' as any /* eslint-enable @typescript-eslint/no-explicit-any */}
48
+ />,
49
+ <NavigationBoard
50
+ game={pgn}
51
+ additionalButtons={[
52
+ { iconPath: 'M 11 11 H 21 V 21 H 11 Z' },
53
+ /* eslint-disable @typescript-eslint/no-explicit-any */ 'not a button nor a spacer' as any /* eslint-enable @typescript-eslint/no-explicit-any */,
54
+ ]}
55
+ />,
49
56
  ]); /* eslint-enable react/jsx-key */
@@ -30,5 +30,5 @@ import dummyPgn from '../common/dummy.pgn';
30
30
 
31
31
  testApp([ /* eslint-disable react/jsx-key */
32
32
  <NavigationBoard game={dummyPgn} />,
33
- <NavigationBoard game={ /* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */ } />,
33
+ <NavigationBoard game={/* eslint-disable @typescript-eslint/no-explicit-any */ 42 as any /* eslint-enable @typescript-eslint/no-explicit-any */} />,
34
34
  ], 'width-600'); /* eslint-enable react/jsx-key */
@@ -33,41 +33,57 @@ const HISTORY_1: string[] = [];
33
33
  const HISTORY_2: string[] = [];
34
34
 
35
35
  interface NavigationBoardWithNodeIdControllerProps {
36
- initialNodeId: string;
37
- sandboxHistory: string[];
36
+ initialNodeId: string,
37
+ sandboxHistory: string[],
38
38
  }
39
39
 
40
40
  function NavigationBoardWithNodeIdController({ initialNodeId, sandboxHistory }: NavigationBoardWithNodeIdControllerProps) {
41
41
 
42
42
  const [ nodeId, setNodeId ] = React.useState(initialNodeId);
43
43
 
44
- return <NavigationBoard game={pgn} playButtonVisible nodeId={nodeId} onNodeIdChanged={newNodeId => {
45
- sandboxHistory.push(`Node ID changed: ${newNodeId}`);
46
- setSandbox(sandboxHistory.join('\n'));
47
- setNodeId(newNodeId);
48
- }} />;
44
+ return (
45
+ <NavigationBoard
46
+ game={pgn} playButtonVisible nodeId={nodeId}
47
+ onNodeIdChanged={newNodeId => {
48
+ sandboxHistory.push(`Node ID changed: ${newNodeId}`);
49
+ setSandbox(sandboxHistory.join('\n'));
50
+ setNodeId(newNodeId);
51
+ }}
52
+ />
53
+ );
49
54
  }
50
55
 
51
56
  function NavigationBoardWithIsPlayingController() {
52
57
 
53
58
  const [ isPlaying, setIsPlaying ] = React.useState(false);
54
59
 
55
- return <NavigationBoard game={pgn} playButtonVisible initialNodeId="5b" isPlaying={isPlaying} onIsPlayingChanged={newIsPlaying => {
56
- setSandbox(`is-playing flag changed: ${newIsPlaying}`);
57
- setIsPlaying(newIsPlaying);
58
- }} />;
60
+ return (
61
+ <NavigationBoard
62
+ game={pgn} playButtonVisible initialNodeId="5b" isPlaying={isPlaying}
63
+ onIsPlayingChanged={newIsPlaying => {
64
+ setSandbox(`is-playing flag changed: ${newIsPlaying}`);
65
+ setIsPlaying(newIsPlaying);
66
+ }}
67
+ />
68
+ );
59
69
  }
60
70
 
61
71
  testApp([ /* eslint-disable react/jsx-key */
62
- <NavigationBoard game={pgn} playButtonVisible nodeId="3w" onNodeIdChanged={nodeId => {
63
- HISTORY_0.push(`Node ID changed: ${nodeId}`);
64
- setSandbox(HISTORY_0.join('\n'));
65
- }} />,
72
+ <NavigationBoard
73
+ game={pgn} playButtonVisible nodeId="3w"
74
+ onNodeIdChanged={nodeId => {
75
+ HISTORY_0.push(`Node ID changed: ${nodeId}`);
76
+ setSandbox(HISTORY_0.join('\n'));
77
+ }}
78
+ />,
66
79
  <NavigationBoardWithNodeIdController initialNodeId="3w" sandboxHistory={HISTORY_1} />,
67
80
  <NavigationBoardWithNodeIdController initialNodeId="20w" sandboxHistory={HISTORY_2} />,
68
- <NavigationBoard game={pgn} playButtonVisible initialNodeId="5b" isPlaying={false} onIsPlayingChanged={isPlaying => {
69
- setSandbox(`is-playing flag changed: ${isPlaying}`);
70
- }} />,
81
+ <NavigationBoard
82
+ game={pgn} playButtonVisible initialNodeId="5b" isPlaying={false}
83
+ onIsPlayingChanged={isPlaying => {
84
+ setSandbox(`is-playing flag changed: ${isPlaying}`);
85
+ }}
86
+ />,
71
87
  <NavigationBoardWithIsPlayingController />,
72
88
  <NavigationBoard game={pgn} playButtonVisible initialNodeId="20b" isPlaying={true} />,
73
89
  ]); /* eslint-enable react/jsx-key */
@@ -31,19 +31,19 @@ import './test_app.css';
31
31
  // This global variable allows to freeze animations in an intermediate stage.
32
32
  declare global {
33
33
  interface Window {
34
- '__kokopu_debug_freeze_motion': number;
34
+ __kokopu_debug_freeze_motion: number,
35
35
  }
36
36
  }
37
37
 
38
38
 
39
39
  interface TestItemContainerProps {
40
- index: number;
41
- children: React.ReactNode;
40
+ index: number,
41
+ children: React.ReactNode,
42
42
  }
43
43
 
44
44
 
45
45
  interface TestItemContainerState {
46
- hasError: boolean;
46
+ hasError: boolean,
47
47
  }
48
48
 
49
49
 
package/.eslintrc.yml DELETED
@@ -1,83 +0,0 @@
1
- env:
2
- browser: true
3
- es2020: true
4
-
5
- plugins:
6
- - '@typescript-eslint'
7
- - react
8
-
9
- settings:
10
- react:
11
- version: 18.2.0
12
-
13
- extends:
14
- - 'eslint:recommended'
15
- - 'plugin:@typescript-eslint/recommended'
16
- - 'plugin:react/recommended'
17
-
18
- parser: '@typescript-eslint/parser'
19
-
20
- parserOptions:
21
- sourceType: module
22
-
23
- rules:
24
-
25
- # Style
26
- indent: [ error, 4, { SwitchCase: 1 }]
27
- linebreak-style: [ error, unix ]
28
- quotes: [ error, single ]
29
- semi: [ error, always ]
30
- camelcase: [ error ]
31
- no-trailing-spaces: [ error ]
32
-
33
- # Additional rules (possible errors)
34
- no-console: [ error ]
35
-
36
- # Additional rules (best practices)
37
- curly: [ error, all ]
38
- eqeqeq: [ error, always ]
39
- no-alert: [ error ]
40
- no-confusing-arrow: [ error ]
41
- no-constructor-return: [ error ]
42
- no-duplicate-imports: [ error ]
43
- no-eval: [ error ]
44
- no-extend-native: [ error ]
45
- no-floating-decimal: [ error ]
46
- no-implicit-coercion: [ error ]
47
- no-implied-eval: [ error ]
48
- no-invalid-this: [ error ]
49
- no-labels: [ error ]
50
- no-lone-blocks: [ error ]
51
- no-loop-func: [ error ]
52
- no-new: [ error ]
53
- no-new-func: [ error ]
54
- no-new-wrappers: [ error ]
55
- no-octal-escape: [ error ]
56
- no-return-assign: [ error, always ]
57
- no-script-url: [ error ]
58
- no-self-compare: [ error ]
59
- no-throw-literal: [ error ]
60
- no-unmodified-loop-condition: [ error ]
61
- no-unused-expressions: [ error ]
62
- no-useless-computed-key: [ error ]
63
- no-useless-concat: [ error ]
64
- no-useless-rename: [ error ]
65
- no-useless-return: [ error ]
66
- no-var: [ error ]
67
- no-warning-comments: [ warn, { location: anywhere, terms: [ TODO ] }]
68
- prefer-arrow-callback: [ error ]
69
- prefer-const: [ error ]
70
- prefer-regex-literals: [ error ]
71
- prefer-rest-params: [ error ]
72
- rest-spread-spacing: [ error ]
73
-
74
- # Additional rules (typescript)
75
- '@typescript-eslint/no-shadow': [ error, { builtinGlobals: true }]
76
-
77
- # Relaxed rules
78
- no-constant-condition: [ error, { checkLoops: false }]
79
-
80
- # Relaxed rules (typescript)
81
- '@typescript-eslint/no-non-null-assertion': [ off ]
82
- '@typescript-eslint/no-namespace': [ off ]
83
- '@typescript-eslint/no-empty-function': [ error, { allow: [ private-constructors, protected-constructors ] }]
@@ -1,8 +0,0 @@
1
- env:
2
- node: true
3
- mocha: true
4
-
5
- rules:
6
- '@typescript-eslint/no-shadow': [ error, { builtinGlobals: true, allow: [ test ] }]
7
- '@typescript-eslint/no-var-requires': [ off ]
8
- no-invalid-this: [ off ] # the rule is incompatible with the use of Mocha contexts
@@ -1,3 +0,0 @@
1
- env:
2
- node: false
3
- mocha: false